aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rwxr-xr-xlib/decl/chrome/chrome.d.ts7697
-rw-r--r--lib/decl/filesystem/filesystem.d.ts548
-rw-r--r--lib/decl/filewriter/filewriter.d.ts176
-rw-r--r--lib/decl/handlebars/handlebars-1.0.0.d.ts184
-rw-r--r--lib/decl/handlebars/handlebars.d.ts227
-rw-r--r--lib/decl/jquery/jquery.d.ts3190
-rw-r--r--lib/decl/lib.es6.d.ts20674
-rw-r--r--lib/decl/lodash.d.ts16525
-rw-r--r--lib/decl/mithril.d.ts926
-rw-r--r--lib/decl/node.d.ts2178
-rw-r--r--lib/decl/systemjs/systemjs.d.ts20
-rw-r--r--lib/decl/urijs/URIjs.d.ts236
-rw-r--r--lib/emscripten/emsc.d.ts52
-rw-r--r--lib/emscripten/libwrapper.js24
-rw-r--r--lib/i18n.ts205
-rw-r--r--lib/module-trampoline.js80
-rw-r--r--lib/refs.ts6
-rw-r--r--lib/shopApi.ts169
l---------lib/taler-wallet-lib.ts1
-rw-r--r--lib/vendor/URI.js2162
-rw-r--r--lib/vendor/jed.js1022
-rw-r--r--lib/vendor/lodash.core.min.js29
-rw-r--r--lib/vendor/mithril.js2233
-rw-r--r--lib/vendor/system-csp-production.src.js4536
-rw-r--r--lib/wallet/checkable.ts262
-rw-r--r--lib/wallet/chromeBadge.ts227
-rw-r--r--lib/wallet/cryptoApi.ts204
-rw-r--r--lib/wallet/cryptoLib.ts227
-rw-r--r--lib/wallet/cryptoWorker.ts61
-rw-r--r--lib/wallet/db.ts119
-rw-r--r--lib/wallet/emscriptif.ts1033
-rw-r--r--lib/wallet/helpers.ts67
-rw-r--r--lib/wallet/http.ts84
-rw-r--r--lib/wallet/query.ts415
-rw-r--r--lib/wallet/renderHtml.ts49
-rw-r--r--lib/wallet/types.ts396
-rw-r--r--lib/wallet/wallet.ts1156
-rw-r--r--lib/wallet/wxApi.ts41
-rw-r--r--lib/wallet/wxMessaging.ts392
39 files changed, 67833 insertions, 0 deletions
diff --git a/lib/decl/chrome/chrome.d.ts b/lib/decl/chrome/chrome.d.ts
new file mode 100755
index 000000000..5a67322f2
--- /dev/null
+++ b/lib/decl/chrome/chrome.d.ts
@@ -0,0 +1,7697 @@
+// Type definitions for Chrome extension development
+// Project: http://developer.chrome.com/extensions/
+// Definitions by: Matthew Kimber <https://github.com/matthewkimber>, otiai10 <https://github.com/otiai10>, couven92 <https://github.com/couven92>, RReverser <https://github.com/rreverser>
+// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+
+/// <reference path='../filesystem/filesystem.d.ts' />
+
+////////////////////
+// Global object
+////////////////////
+interface Window {
+ chrome: typeof chrome;
+}
+
+////////////////////
+// Accessibility Features
+////////////////////
+/**
+ * Use the chrome.accessibilityFeatures API to manage Chrome's accessibility features. This API relies on the ChromeSetting prototype of the type API for getting and setting individual accessibility features. In order to get feature states the extension must request accessibilityFeatures.read permission. For modifying feature state, the extension needs accessibilityFeatures.modify permission. Note that accessibilityFeatures.modify does not imply accessibilityFeatures.read permission.
+ * Availability: Since Chrome 37.
+ * Permissions: "accessibilityFeatures.read"
+ * Important: This API works only on Chrome OS.
+ */
+declare namespace chrome.accessibilityFeatures {
+ interface AccessibilityFeaturesGetArg {
+ /** Optional. Whether to return the value that applies to the incognito session (default false). */
+ incognito?: boolean;
+ }
+
+ interface AccessibilityFeaturesCallbackArg {
+ /** The value of the setting. */
+ value: any;
+ /**
+ * One of
+ * • not_controllable: cannot be controlled by any extension
+ * • controlled_by_other_extensions: controlled by extensions with higher precedence
+ * • controllable_by_this_extension: can be controlled by this extension
+ * • controlled_by_this_extension: controlled by this extension
+ */
+ levelOfControl: string;
+ /** Optional. Whether the effective value is specific to the incognito session. This property will only be present if the incognito property in the details parameter of get() was true. */
+ incognitoSpecific?: boolean;
+ }
+
+ interface AccessibilityFeaturesSetArg {
+ /**
+ * The value of the setting.
+ * Note that every setting has a specific value type, which is described together with the setting. An extension should not set a value of a different type.
+ */
+ value: any;
+ /**
+ * Optional.
+ * The scope of the ChromeSetting. One of
+ * • regular: setting for the regular profile (which is inherited by the incognito profile if not overridden elsewhere),
+ * • regular_only: setting for the regular profile only (not inherited by the incognito profile),
+ * • incognito_persistent: setting for the incognito profile that survives browser restarts (overrides regular preferences),
+ * • incognito_session_only: setting for the incognito profile that can only be set during an incognito session and is deleted when the incognito session ends (overrides regular and incognito_persistent preferences).
+ */
+ scope?: string;
+ }
+
+ interface AccessibilityFeaturesClearArg {
+ /**
+ * Optional.
+ * The scope of the ChromeSetting. One of
+ * • regular: setting for the regular profile (which is inherited by the incognito profile if not overridden elsewhere),
+ * • regular_only: setting for the regular profile only (not inherited by the incognito profile),
+ * • incognito_persistent: setting for the incognito profile that survives browser restarts (overrides regular preferences),
+ * • incognito_session_only: setting for the incognito profile that can only be set during an incognito session and is deleted when the incognito session ends (overrides regular and incognito_persistent preferences).
+ */
+ scope?: string;
+ }
+
+ interface AccessibilityFeaturesSetting {
+ /**
+ * Gets the value of a setting.
+ * @param details Which setting to consider.
+ * @param callback The callback parameter should be a function that looks like this:
+ * function(object details) {...};
+ */
+ get(details: AccessibilityFeaturesGetArg, callback: (details: AccessibilityFeaturesCallbackArg) => void): void;
+ /**
+ * Sets the value of a setting.
+ * @param details Which setting to change.
+ * @param callback Called at the completion of the set operation.
+ * If you specify the callback parameter, it should be a function that looks like this:
+ * function() {...};
+ */
+ set(details: AccessibilityFeaturesSetArg, callback?: () => void): void;
+ /**
+ * Clears the setting, restoring any default value.
+ * @param details Which setting to clear.
+ * @param callback Called at the completion of the clear operation.
+ * If you specify the callback parameter, it should be a function that looks like this:
+ * function() {...};
+ */
+ clear(details: AccessibilityFeaturesClearArg, callback?: () => void): void;
+ }
+
+ var spokenFeedback: AccessibilityFeaturesSetting;
+ var largeCursor: AccessibilityFeaturesSetting;
+ var stickyKeys: AccessibilityFeaturesSetting;
+ var highContrast: AccessibilityFeaturesSetting;
+ var screenMagnifier: AccessibilityFeaturesSetting;
+ var autoclick: AccessibilityFeaturesSetting;
+ var virtualKeyboard: AccessibilityFeaturesSetting;
+ var animationPolicy: AccessibilityFeaturesSetting;
+}
+
+////////////////////
+// Alarms
+////////////////////
+/**
+ * Use the chrome.alarms API to schedule code to run periodically or at a specified time in the future.
+ * Availability: Since Chrome 22.
+ * Permissions: "alarms"
+ */
+declare namespace chrome.alarms {
+ interface AlarmCreateInfo {
+ /** Optional. Length of time in minutes after which the onAlarm event should fire. */
+ delayInMinutes?: number;
+ /** Optional. If set, the onAlarm event should fire every periodInMinutes minutes after the initial event specified by when or delayInMinutes. If not set, the alarm will only fire once. */
+ periodInMinutes?: number;
+ /** Optional. Time at which the alarm should fire, in milliseconds past the epoch (e.g. Date.now() + n). */
+ when?: number;
+ }
+
+ interface Alarm {
+ /** Optional. If not null, the alarm is a repeating alarm and will fire again in periodInMinutes minutes. */
+ periodInMinutes?: number;
+ /** Time at which this alarm was scheduled to fire, in milliseconds past the epoch (e.g. Date.now() + n). For performance reasons, the alarm may have been delayed an arbitrary amount beyond this. */
+ scheduledTime: number;
+ /** Name of this alarm. */
+ name: string;
+ }
+
+ interface AlarmEvent extends chrome.events.Event<(alarm: Alarm) => void> {}
+
+ /**
+ * Creates an alarm. Near the time(s) specified by alarmInfo, the onAlarm event is fired. If there is another alarm with the same name (or no name if none is specified), it will be cancelled and replaced by this alarm.
+ * In order to reduce the load on the user's machine, Chrome limits alarms to at most once every 1 minute but may delay them an arbitrary amount more. That is, setting delayInMinutes or periodInMinutes to less than 1 will not be honored and will cause a warning. when can be set to less than 1 minute after "now" without warning but won't actually cause the alarm to fire for at least 1 minute.
+ * To help you debug your app or extension, when you've loaded it unpacked, there's no limit to how often the alarm can fire.
+ * @param alarmInfo Describes when the alarm should fire. The initial time must be specified by either when or delayInMinutes (but not both). If periodInMinutes is set, the alarm will repeat every periodInMinutes minutes after the initial event. If neither when or delayInMinutes is set for a repeating alarm, periodInMinutes is used as the default for delayInMinutes.
+ */
+ export function create(alarmInfo: AlarmCreateInfo): void;
+ /**
+ * Creates an alarm. Near the time(s) specified by alarmInfo, the onAlarm event is fired. If there is another alarm with the same name (or no name if none is specified), it will be cancelled and replaced by this alarm.
+ * In order to reduce the load on the user's machine, Chrome limits alarms to at most once every 1 minute but may delay them an arbitrary amount more. That is, setting delayInMinutes or periodInMinutes to less than 1 will not be honored and will cause a warning. when can be set to less than 1 minute after "now" without warning but won't actually cause the alarm to fire for at least 1 minute.
+ * To help you debug your app or extension, when you've loaded it unpacked, there's no limit to how often the alarm can fire.
+ * @param name Optional name to identify this alarm. Defaults to the empty string.
+ * @param alarmInfo Describes when the alarm should fire. The initial time must be specified by either when or delayInMinutes (but not both). If periodInMinutes is set, the alarm will repeat every periodInMinutes minutes after the initial event. If neither when or delayInMinutes is set for a repeating alarm, periodInMinutes is used as the default for delayInMinutes.
+ */
+ export function create(name: string, alarmInfo: AlarmCreateInfo): void;
+ /**
+ * Gets an array of all the alarms.
+ * @param callback The callback parameter should be a function that looks like this:
+ * function(array of Alarm alarms) {...};
+ */
+ export function getAll(callback: (alarms: Alarm[]) => void): void;
+ /**
+ * Clears all alarms.
+ * @param callback If you specify the callback parameter, it should be a function that looks like this:
+ * function(boolean wasCleared) {...};
+ */
+ export function clearAll(callback?: (wasCleared: boolean) => void): void;
+ /**
+ * Clears the alarm with the given name.
+ * @param name The name of the alarm to clear. Defaults to the empty string.
+ * @param callback If you specify the callback parameter, it should be a function that looks like this:
+ * function(boolean wasCleared) {...};
+ */
+ export function clear(name?: string, callback?: (wasCleared: boolean) => void): void;
+ /**
+ * Clears the alarm without a name.
+ * @param callback If you specify the callback parameter, it should be a function that looks like this:
+ * function(boolean wasCleared) {...};
+ */
+ export function clear(callback: (wasCleared: boolean) => void): void;
+ /**
+ * Retrieves details about the specified alarm.
+ * @param callback The callback parameter should be a function that looks like this:
+ * function( Alarm alarm) {...};
+ */
+ export function get(callback: (alarm: Alarm) => void): void;
+ /**
+ * Retrieves details about the specified alarm.
+ * @param name The name of the alarm to get. Defaults to the empty string.
+ * @param callback The callback parameter should be a function that looks like this:
+ * function( Alarm alarm) {...};
+ */
+ export function get(name: string, callback: (alarm: Alarm) => void): void;
+
+ /** Fired when an alarm has elapsed. Useful for event pages. */
+ var onAlarm: AlarmEvent;
+}
+
+/**
+ * Use the chrome.browser API to interact with the Chrome browser associated with
+ * the current application and Chrome profile.
+ */
+declare namespace chrome.browser {
+ interface Options {
+ /** The URL to navigate to when the new tab is initially opened. */
+ url: string;
+ }
+
+ /**
+ * Opens a new tab in a browser window associated with the current application
+ * and Chrome profile. If no browser window for the Chrome profile is opened,
+ * a new one is opened prior to creating the new tab.
+ * @param options Configures how the tab should be opened.
+ * @param callback Called when the tab was successfully
+ * created, or failed to be created. If failed, runtime.lastError will be set.
+ */
+ export function openTab(options: Options, callback: () => void): void;
+
+ /**
+ * Opens a new tab in a browser window associated with the current application
+ * and Chrome profile. If no browser window for the Chrome profile is opened,
+ * a new one is opened prior to creating the new tab. Since Chrome 42 only.
+ * @param options Configures how the tab should be opened.
+ */
+ export function openTab(options: Options): void;
+}
+
+////////////////////
+// Bookmarks
+////////////////////
+/**
+ * Use the chrome.bookmarks API to create, organize, and otherwise manipulate bookmarks. Also see Override Pages, which you can use to create a custom Bookmark Manager page.
+ * Availability: Since Chrome 5.
+ * Permissions: "bookmarks"
+ */
+declare namespace chrome.bookmarks {
+ /** A node (either a bookmark or a folder) in the bookmark tree. Child nodes are ordered within their parent folder. */
+ interface BookmarkTreeNode {
+ /** Optional. The 0-based position of this node within its parent folder. */
+ index?: number;
+ /** Optional. When this node was created, in milliseconds since the epoch (new Date(dateAdded)). */
+ dateAdded?: number;
+ /** The text displayed for the node. */
+ title: string;
+ /** Optional. The URL navigated to when a user clicks the bookmark. Omitted for folders. */
+ url?: string;
+ /** Optional. When the contents of this folder last changed, in milliseconds since the epoch. */
+ dateGroupModified?: number;
+ /** The unique identifier for the node. IDs are unique within the current profile, and they remain valid even after the browser is restarted. */
+ id: string;
+ /** Optional. The id of the parent folder. Omitted for the root node. */
+ parentId?: string;
+ /** Optional. An ordered list of children of this node. */
+ children?: BookmarkTreeNode[];
+ /**
+ * Optional.
+ * Since Chrome 37.
+ * Indicates the reason why this node is unmodifiable. The managed value indicates that this node was configured by the system administrator or by the custodian of a supervised user. Omitted if the node can be modified by the user and the extension (default).
+ */
+ unmodifiable?: any;
+ }
+
+ interface BookmarkRemoveInfo {
+ index: number;
+ parentId: string;
+ }
+
+ interface BookmarkMoveInfo {
+ index: number;
+ oldIndex: number;
+ parentId: string;
+ oldParentId: string;
+ }
+
+ interface BookmarkChangeInfo {
+ url?: string;
+ title: string;
+ }
+
+ interface BookmarkReorderInfo {
+ childIds: string[];
+ }
+
+ interface BookmarkRemovedEvent extends chrome.events.Event<(id: string, removeInfo: BookmarkRemoveInfo) => void> {}
+
+ interface BookmarkImportEndedEvent extends chrome.events.Event<() => void> {}
+
+ interface BookmarkMovedEvent extends chrome.events.Event<(id: string, moveInfo: BookmarkMoveInfo) => void> {}
+
+ interface BookmarkImportBeganEvent extends chrome.events.Event<() => void> {}
+
+ interface BookmarkChangedEvent extends chrome.events.Event<(id: string, changeInfo: BookmarkChangeInfo) => void> {}
+
+ interface BookmarkCreatedEvent extends chrome.events.Event<(id: string, bookmark: BookmarkTreeNode) => void> {}
+
+ interface BookmarkChildrenReordered extends chrome.events.Event<(id: string, reorderInfo: BookmarkReorderInfo) => void> {}
+
+ interface BookmarkSearchQuery {
+ query?: string;
+ url?: string;
+ title?: string;
+ }
+
+ interface BookmarkCreateArg {
+ /** Optional. Defaults to the Other Bookmarks folder. */
+ parentId?: string;
+ index?: number;
+ title?: string;
+ url?: string;
+ }
+
+ interface BookmarkDestinationArg {
+ parentId?: string;
+ index?: number;
+ }
+
+ interface BookmarkChangesArg {
+ title?: string;
+ url?: string;
+ }
+
+ /** @deprecated since Chrome 38. Bookmark write operations are no longer limited by Chrome. */
+ var MAX_WRITE_OPERATIONS_PER_HOUR: number;
+ /** @deprecated since Chrome 38. Bookmark write operations are no longer limited by Chrome. */
+ var MAX_SUSTAINED_WRITE_OPERATIONS_PER_MINUTE: number;
+
+ /**
+ * Searches for BookmarkTreeNodes matching the given query. Queries specified with an object produce BookmarkTreeNodes matching all specified properties.
+ * @param query A string of words and quoted phrases that are matched against bookmark URLs and titles.
+ * @param callback The callback parameter should be a function that looks like this:
+ * function(array of BookmarkTreeNode results) {...};
+ */
+ export function search(query: string, callback: (results: BookmarkTreeNode[]) => void): void;
+ /**
+ * Searches for BookmarkTreeNodes matching the given query. Queries specified with an object produce BookmarkTreeNodes matching all specified properties.
+ * @param query An object with one or more of the properties query, url, and title specified. Bookmarks matching all specified properties will be produced.
+ * @param callback The callback parameter should be a function that looks like this:
+ * function(array of BookmarkTreeNode results) {...};
+ */
+ export function search(query: BookmarkSearchQuery, callback: (results: BookmarkTreeNode[]) => void): void;
+ /**
+ * Retrieves the entire Bookmarks hierarchy.
+ * @param callback The callback parameter should be a function that looks like this:
+ * function(array of BookmarkTreeNode results) {...};
+ */
+ export function getTree(callback: (results: BookmarkTreeNode[]) => void): void;
+ /**
+ * Retrieves the recently added bookmarks.
+ * @param numberOfItems The maximum number of items to return.
+ * @param callback The callback parameter should be a function that looks like this:
+ * function(array of BookmarkTreeNode results) {...};
+ */
+ export function getRecent(numberOfItems: number, callback: (results: BookmarkTreeNode[]) => void): void;
+ /**
+ * Retrieves the specified BookmarkTreeNode.
+ * @param id A single string-valued id
+ * @param callback The callback parameter should be a function that looks like this:
+ * function(array of BookmarkTreeNode results) {...};
+ */
+ export function get(id: string, callback: (results: BookmarkTreeNode[]) => void): void;
+ /**
+ * Retrieves the specified BookmarkTreeNode.
+ * @param idList An array of string-valued ids
+ * @param callback The callback parameter should be a function that looks like this:
+ * function(array of BookmarkTreeNode results) {...};
+ */
+ export function get(idList: string[], callback: (results: BookmarkTreeNode[]) => void): void;
+ /**
+ * Creates a bookmark or folder under the specified parentId. If url is NULL or missing, it will be a folder.
+ * @param callback If you specify the callback parameter, it should be a function that looks like this:
+ * function( BookmarkTreeNode result) {...};
+ */
+ export function create(bookmark: BookmarkCreateArg, callback?: (result: BookmarkTreeNode) => void): void;
+ /**
+ * Moves the specified BookmarkTreeNode to the provided location.
+ * @param callback If you specify the callback parameter, it should be a function that looks like this:
+ * function( BookmarkTreeNode result) {...};
+ */
+ export function move(id: string, destination: BookmarkDestinationArg, callback?: (result: BookmarkTreeNode) => void): void;
+ /**
+ * Updates the properties of a bookmark or folder. Specify only the properties that you want to change; unspecified properties will be left unchanged. Note: Currently, only 'title' and 'url' are supported.
+ * @param callback If you specify the callback parameter, it should be a function that looks like this:
+ * function( BookmarkTreeNode result) {...};
+ */
+ export function update(id: string, changes: BookmarkChangesArg, callback?: (result: BookmarkTreeNode) => void): void;
+ /**
+ * Removes a bookmark or an empty bookmark folder.
+ * @param callback If you specify the callback parameter, it should be a function that looks like this:
+ * function() {...};
+ */
+ export function remove(id: string, callback?: Function): void;
+ /**
+ * Retrieves the children of the specified BookmarkTreeNode id.
+ * @param callback The callback parameter should be a function that looks like this:
+ * function(array of BookmarkTreeNode results) {...};
+ */
+ export function getChildren(id: string, callback: (results: BookmarkTreeNode[]) => void): void;
+ /**
+ * Since Chrome 14.
+ * Retrieves part of the Bookmarks hierarchy, starting at the specified node.
+ * @param id The ID of the root of the subtree to retrieve.
+ * @param callback The callback parameter should be a function that looks like this:
+ * function(array of BookmarkTreeNode results) {...};
+ */
+ export function getSubTree(id: string, callback: (results: BookmarkTreeNode[]) => void): void;
+ /**
+ * Recursively removes a bookmark folder.
+ * @param callback If you specify the callback parameter, it should be a function that looks like this:
+ * function() {...};
+ */
+ export function removeTree(id: string, callback?: Function): void;
+
+ /** Fired when a bookmark or folder is removed. When a folder is removed recursively, a single notification is fired for the folder, and none for its contents. */
+ var onRemoved: BookmarkRemovedEvent;
+ /** Fired when a bookmark import session is ended. */
+ var onImportEnded: BookmarkImportEndedEvent;
+ /** Fired when a bookmark import session is begun. Expensive observers should ignore onCreated updates until onImportEnded is fired. Observers should still handle other notifications immediately. */
+ var onImportBegan: BookmarkImportBeganEvent;
+ /** Fired when a bookmark or folder changes. Note: Currently, only title and url changes trigger this. */
+ var onChanged: BookmarkChangedEvent;
+ /** Fired when a bookmark or folder is moved to a different parent folder. */
+ var onMoved: BookmarkMovedEvent;
+ /** Fired when a bookmark or folder is created. */
+ var onCreated: BookmarkCreatedEvent;
+ /** Fired when the children of a folder have changed their order due to the order being sorted in the UI. This is not called as a result of a move(). */
+ var onChildrenReordered: BookmarkChildrenReordered;
+}
+
+////////////////////
+// Browser Action
+////////////////////
+/**
+ * Use browser actions to put icons in the main Google Chrome toolbar, to the right of the address bar. In addition to its icon, a browser action can also have a tooltip, a badge, and a popup.
+ * Availability: Since Chrome 5.
+ * Manifest: "browser_action": {...}
+ */
+declare namespace chrome.browserAction {
+ interface BadgeBackgroundColorDetails {
+ /** An array of four integers in the range [0,255] that make up the RGBA color of the badge. For example, opaque red is [255, 0, 0, 255]. Can also be a string with a CSS value, with opaque red being #FF0000 or #F00. */
+ color: any;
+ /** Optional. Limits the change to when a particular tab is selected. Automatically resets when the tab is closed. */
+ tabId?: number;
+ }
+
+ interface BadgeTextDetails {
+ /** Any number of characters can be passed, but only about four can fit in the space. */
+ text: string;
+ /** Optional. Limits the change to when a particular tab is selected. Automatically resets when the tab is closed. */
+ tabId?: number;
+ }
+
+ interface TitleDetails {
+ /** The string the browser action should display when moused over. */
+ title: string;
+ /** Optional. Limits the change to when a particular tab is selected. Automatically resets when the tab is closed. */
+ tabId?: number;
+ }
+
+ interface TabDetails {
+ /** Optional. Specify the tab to get the information. If no tab is specified, the non-tab-specific information is returned. */
+ tabId?: number;
+ }
+
+ interface TabIconDetails {
+ /** Optional. Either a relative image path or a dictionary {size -> relative image path} pointing to icon to be set. If the icon is specified as a dictionary, the actual image to be used is chosen depending on screen's pixel density. If the number of image pixels that fit into one screen space unit equals scale, then image with size scale * 19 will be selected. Initially only scales 1 and 2 will be supported. At least one image must be specified. Note that 'details.path = foo' is equivalent to 'details.imageData = {'19': foo}' */
+ path?: any;
+ /** Optional. Limits the change to when a particular tab is selected. Automatically resets when the tab is closed. */
+ tabId?: number;
+ /** Optional. Either an ImageData object or a dictionary {size -> ImageData} representing icon to be set. If the icon is specified as a dictionary, the actual image to be used is chosen depending on screen's pixel density. If the number of image pixels that fit into one screen space unit equals scale, then image with size scale * 19 will be selected. Initially only scales 1 and 2 will be supported. At least one image must be specified. Note that 'details.imageData = foo' is equivalent to 'details.imageData = {'19': foo}' */
+ imageData?: ImageData;
+ }
+
+ interface PopupDetails {
+ /** Optional. Limits the change to when a particular tab is selected. Automatically resets when the tab is closed. */
+ tabId?: number;
+ /** The html file to show in a popup. If set to the empty string (''), no popup is shown. */
+ popup: string;
+ }
+
+ interface BrowserClickedEvent extends chrome.events.Event<(tab: chrome.tabs.Tab) => void> {}
+
+ /**
+ * Since Chrome 22.
+ * Enables the browser action for a tab. By default, browser actions are enabled.
+ * @param tabId The id of the tab for which you want to modify the browser action.
+ */
+ export function enable(tabId?: number): void;
+ /** Sets the background color for the badge. */
+ export function setBadgeBackgroundColor(details: BadgeBackgroundColorDetails): void;
+ /** Sets the badge text for the browser action. The badge is displayed on top of the icon. */
+ export function setBadgeText(details: BadgeTextDetails): void;
+ /** Sets the title of the browser action. This shows up in the tooltip. */
+ export function setTitle(details: TitleDetails): void;
+ /**
+ * Since Chrome 19.
+ * Gets the badge text of the browser action. If no tab is specified, the non-tab-specific badge text is returned.
+ * @param callback The callback parameter should be a function that looks like this:
+ * function(string result) {...};
+ */
+ export function getBadgeText(details: TabDetails, callback: (result: string) => void): void;
+ /** Sets the html document to be opened as a popup when the user clicks on the browser action's icon. */
+ export function setPopup(details: PopupDetails): void;
+ /**
+ * Since Chrome 22.
+ * Disables the browser action for a tab.
+ * @param tabId The id of the tab for which you want to modify the browser action.
+ */
+ export function disable(tabId?: number): void;
+ /**
+ * Since Chrome 19.
+ * Gets the title of the browser action.
+ * @param callback The callback parameter should be a function that looks like this:
+ * function(string result) {...};
+ */
+ export function getTitle(details: TabDetails, callback: (result: string) => void): void;
+ /**
+ * Since Chrome 19.
+ * Gets the background color of the browser action.
+ * @param callback The callback parameter should be a function that looks like this:
+ * function( ColorArray result) {...};
+ */
+ export function getBadgeBackgroundColor(details: TabDetails, callback: (result: number[]) => void): void;
+ /**
+ * Since Chrome 19.
+ * Gets the html document set as the popup for this browser action.
+ * @param callback The callback parameter should be a function that looks like this:
+ * function(string result) {...};
+ */
+ export function getPopup(details: TabDetails, callback: (result: string) => void): void;
+ /**
+ * Sets the icon for the browser action. The icon can be specified either as the path to an image file or as the pixel data from a canvas element, or as dictionary of either one of those. Either the path or the imageData property must be specified.
+ * @param callback If you specify the callback parameter, it should be a function that looks like this:
+ * function() {...};
+ */
+ export function setIcon(details: TabIconDetails, callback?: Function): void;
+
+ /** Fired when a browser action icon is clicked. This event will not fire if the browser action has a popup. */
+ var onClicked: BrowserClickedEvent;
+}
+
+////////////////////
+// Browsing Data
+////////////////////
+/**
+ * Use the chrome.browsingData API to remove browsing data from a user's local profile.
+ * Availability: Since Chrome 19.
+ * Permissions: "browsingData"
+ */
+declare namespace chrome.browsingData {
+ interface OriginTypes {
+ /** Optional. Websites that have been installed as hosted applications (be careful!). */
+ protectedWeb?: boolean;
+ /** Optional. Extensions and packaged applications a user has installed (be _really_ careful!). */
+ extension?: boolean;
+ /** Optional. Normal websites. */
+ unprotectedWeb?: boolean;
+ }
+
+ /** Options that determine exactly what data will be removed. */
+ interface RemovalOptions {
+ /**
+ * Optional.
+ * Since Chrome 21.
+ * An object whose properties specify which origin types ought to be cleared. If this object isn't specified, it defaults to clearing only "unprotected" origins. Please ensure that you really want to remove application data before adding 'protectedWeb' or 'extensions'.
+ */
+ originTypes?: OriginTypes;
+ /** Optional. Remove data accumulated on or after this date, represented in milliseconds since the epoch (accessible via the getTime method of the JavaScript Date object). If absent, defaults to 0 (which would remove all browsing data). */
+ since?: number;
+ }
+
+ /**
+ * Since Chrome 27.
+ * A set of data types. Missing data types are interpreted as false.
+ */
+ interface DataTypeSet {
+ /** Optional. Websites' WebSQL data. */
+ webSQL?: boolean;
+ /** Optional. Websites' IndexedDB data. */
+ indexedDB?: boolean;
+ /** Optional. The browser's cookies. */
+ cookies?: boolean;
+ /** Optional. Stored passwords. */
+ passwords?: boolean;
+ /** Optional. Server-bound certificates. */
+ serverBoundCertificates?: boolean;
+ /** Optional. The browser's download list. */
+ downloads?: boolean;
+ /** Optional. The browser's cache. Note: when removing data, this clears the entire cache: it is not limited to the range you specify. */
+ cache?: boolean;
+ /** Optional. Websites' appcaches. */
+ appcache?: boolean;
+ /** Optional. Websites' file systems. */
+ fileSystems?: boolean;
+ /** Optional. Plugins' data. */
+ pluginData?: boolean;
+ /** Optional. Websites' local storage data. */
+ localStorage?: boolean;
+ /** Optional. The browser's stored form data. */
+ formData?: boolean;
+ /** Optional. The browser's history. */
+ history?: boolean;
+ /**
+ * Optional.
+ * Since Chrome 39.
+ * Service Workers.
+ */
+ serviceWorkers?: boolean;
+ }
+
+ interface SettingsCallback {
+ options: RemovalOptions;
+ /** All of the types will be present in the result, with values of true if they are both selected to be removed and permitted to be removed, otherwise false. */
+ dataToRemove: DataTypeSet;
+ /** All of the types will be present in the result, with values of true if they are permitted to be removed (e.g., by enterprise policy) and false if not. */
+ dataRemovalPermitted: DataTypeSet;
+ }
+
+ /**
+ * Since Chrome 26.
+ * Reports which types of data are currently selected in the 'Clear browsing data' settings UI. Note: some of the data types included in this API are not available in the settings UI, and some UI settings control more than one data type listed here.
+ * @param callback The callback parameter should be a function that looks like this:
+ * function(object result) {...};
+ */
+ export function settings(callback: (result: SettingsCallback) => void): void;
+ /**
+ * Clears plugins' data.
+ * @param callback Called when plugins' data has been cleared.
+ * If you specify the callback parameter, it should be a function that looks like this:
+ * function() {...};
+ */
+ export function removePluginData(options: RemovalOptions, callback?: () => void): void;
+ /**
+ * Clears the browser's stored form data (autofill).
+ * @param callback Called when the browser's form data has been cleared.
+ * If you specify the callback parameter, it should be a function that looks like this:
+ * function() {...};
+ */
+ export function removeFormData(options: RemovalOptions, callback?: () => void): void;
+ /**
+ * Clears websites' file system data.
+ * @param callback Called when websites' file systems have been cleared.
+ * If you specify the callback parameter, it should be a function that looks like this:
+ * function() {...};
+ */
+ export function removeFileSystems(options: RemovalOptions, callback?: () => void): void;
+ /**
+ * Clears various types of browsing data stored in a user's profile.
+ * @param dataToRemove The set of data types to remove.
+ * @param callback Called when deletion has completed.
+ * If you specify the callback parameter, it should be a function that looks like this:
+ * function() {...};
+ */
+ export function remove(options: RemovalOptions, dataToRemove: DataTypeSet, callback?: () => void): void;
+ /**
+ * Clears the browser's stored passwords.
+ * @param callback Called when the browser's passwords have been cleared.
+ * If you specify the callback parameter, it should be a function that looks like this:
+ * function() {...};
+ */
+ export function removePasswords(options: RemovalOptions, callback?: () => void): void;
+ /**
+ * Clears the browser's cookies and server-bound certificates modified within a particular timeframe.
+ * @param callback Called when the browser's cookies and server-bound certificates have been cleared.
+ * If you specify the callback parameter, it should be a function that looks like this:
+ * function() {...};
+ */
+ export function removeCookies(options: RemovalOptions, callback?: () => void): void;
+ /**
+ * Clears websites' WebSQL data.
+ * @param callback Called when websites' WebSQL databases have been cleared.
+ * If you specify the callback parameter, it should be a function that looks like this:
+ * function() {...};
+ */
+ export function removeWebSQL(options: RemovalOptions, callback?: () => void): void;
+ /**
+ * Clears websites' appcache data.
+ * @param callback Called when websites' appcache data has been cleared.
+ * If you specify the callback parameter, it should be a function that looks like this:
+ * function() {...};
+ */
+ export function removeAppcache(options: RemovalOptions, callback?: () => void): void;
+ /**
+ * Clears the browser's list of downloaded files (not the downloaded files themselves).
+ * @param callback Called when the browser's list of downloaded files has been cleared.
+ * If you specify the callback parameter, it should be a function that looks like this:
+ * function() {...};
+ */
+ export function removeDownloads(options: RemovalOptions, callback?: () => void): void;
+ /**
+ * Clears websites' local storage data.
+ * @param callback Called when websites' local storage has been cleared.
+ * If you specify the callback parameter, it should be a function that looks like this:
+ * function() {...};
+ */
+ export function removeLocalStorage(options: RemovalOptions, callback?: () => void): void;
+ /**
+ * Clears the browser's cache.
+ * @param callback Called when the browser's cache has been cleared.
+ * If you specify the callback parameter, it should be a function that looks like this:
+ * function() {...};
+ */
+ export function removeCache(options: RemovalOptions, callback?: () => void): void;
+ /**
+ * Clears the browser's history.
+ * @param callback Called when the browser's history has cleared.
+ * If you specify the callback parameter, it should be a function that looks like this:
+ * function() {...};
+ */
+ export function removeHistory(options: RemovalOptions, callback?: () => void): void;
+ /**
+ * Clears websites' IndexedDB data.
+ * @param callback Called when websites' IndexedDB data has been cleared.
+ * If you specify the callback parameter, it should be a function that looks like this:
+ * function() {...};
+ */
+ export function removeIndexedDB(options: RemovalOptions, callback?: () => void): void;
+}
+
+////////////////////
+// Commands
+////////////////////
+/**
+ * Use the commands API to add keyboard shortcuts that trigger actions in your extension, for example, an action to open the browser action or send a command to the extension.
+ * Availability: Since Chrome 25.
+ * Manifest: "commands": {...}
+ */
+declare namespace chrome.commands {
+ interface Command {
+ /** Optional. The name of the Extension Command */
+ name?: string;
+ /** Optional. The Extension Command description */
+ description?: string;
+ /** Optional. The shortcut active for this command, or blank if not active. */
+ shortcut?: string;
+ }
+
+ interface CommandEvent extends chrome.events.Event<(command: string) => void> {}
+
+ /**
+ * Returns all the registered extension commands for this extension and their shortcut (if active).
+ * @param callback Called to return the registered commands.
+ * If you specify the callback parameter, it should be a function that looks like this:
+ * function(array of Command commands) {...};
+ */
+ export function getAll(callback: (commands: Command[]) => void): void;
+
+ /** Fired when a registered command is activated using a keyboard shortcut. */
+ var onCommand: CommandEvent;
+}
+
+////////////////////
+// Content Settings
+////////////////////
+/**
+ * Use the chrome.contentSettings API to change settings that control whether websites can use features such as cookies, JavaScript, and plugins. More generally speaking, content settings allow you to customize Chrome's behavior on a per-site basis instead of globally.
+ * Availability: Since Chrome 16.
+ * Permissions: "contentSettings"
+ */
+declare namespace chrome.contentSettings {
+ interface ClearDetails {
+ /**
+ * Optional.
+ * Where to clear the setting (default: regular).
+ * The scope of the ContentSetting. One of
+ * * regular: setting for regular profile (which is inherited by the incognito profile if not overridden elsewhere),
+ * * incognito_session_only: setting for incognito profile that can only be set during an incognito session and is deleted when the incognito session ends (overrides regular settings).
+ */
+ scope?: string;
+ }
+
+ interface SetDetails {
+ /** Optional. The resource identifier for the content type. */
+ resourceIdentifier?: ResourceIdentifier;
+ /** The setting applied by this rule. See the description of the individual ContentSetting objects for the possible values. */
+ setting: any;
+ /** Optional. The pattern for the secondary URL. Defaults to matching all URLs. For details on the format of a pattern, see Content Setting Patterns. */
+ secondaryPattern?: string;
+ /** Optional. Where to set the setting (default: regular). */
+ scope?: string;
+ /** The pattern for the primary URL. For details on the format of a pattern, see Content Setting Patterns. */
+ primaryPattern: string;
+ }
+
+ interface GetDetails {
+ /** Optional. The secondary URL for which the content setting should be retrieved. Defaults to the primary URL. Note that the meaning of a secondary URL depends on the content type, and not all content types use secondary URLs. */
+ secondaryUrl?: string;
+ /** Optional. A more specific identifier of the type of content for which the settings should be retrieved. */
+ resourceIdentifier?: ResourceIdentifier;
+ /** Optional. Whether to check the content settings for an incognito session. (default false) */
+ incognito?: boolean;
+ /** The primary URL for which the content setting should be retrieved. Note that the meaning of a primary URL depends on the content type. */
+ primaryUrl: string;
+ }
+
+ interface ReturnedDetails {
+ /** The content setting. See the description of the individual ContentSetting objects for the possible values. */
+ setting: any;
+ }
+
+ interface ContentSetting {
+ /**
+ * Clear all content setting rules set by this extension.
+ * @param callback If you specify the callback parameter, it should be a function that looks like this:
+ * function() {...};
+ */
+ clear(details: ClearDetails, callback?: () => void): void;
+ /**
+ * Applies a new content setting rule.
+ * @param callback If you specify the callback parameter, it should be a function that looks like this:
+ * function() {...};
+ */
+ set(details: SetDetails, callback?: () => void): void;
+ /**
+ * @param callback The callback parameter should be a function that looks like this:
+ * function(array of ResourceIdentifier resourceIdentifiers) {...};
+ * Parameter resourceIdentifiers: A list of resource identifiers for this content type, or undefined if this content type does not use resource identifiers.
+ */
+ getResourceIdentifiers(callback: (resourceIdentifiers?: ResourceIdentifier[]) => void): void;
+ /**
+ * Gets the current content setting for a given pair of URLs.
+ * @param callback The callback parameter should be a function that looks like this:
+ * function(object details) {...};
+ */
+ get(details: GetDetails, callback: (details: ReturnedDetails) => void): void;
+ }
+
+ /** The only content type using resource identifiers is contentSettings.plugins. For more information, see Resource Identifiers. */
+ interface ResourceIdentifier {
+ /** The resource identifier for the given content type. */
+ id: string;
+ /** Optional. A human readable description of the resource. */
+ description?: string;
+ }
+
+ /**
+ * Whether to allow cookies and other local data to be set by websites. One of
+ * allow: Accept cookies,
+ * block: Block cookies,
+ * session_only: Accept cookies only for the current session.
+ * Default is allow.
+ * The primary URL is the URL representing the cookie origin. The secondary URL is the URL of the top-level frame.
+ */
+ var cookies: ContentSetting;
+ /**
+ * Whether to allow sites to show pop-ups. One of
+ * allow: Allow sites to show pop-ups,
+ * block: Don't allow sites to show pop-ups.
+ * Default is block.
+ * The primary URL is the URL of the top-level frame. The secondary URL is not used.
+ */
+ var popups: ContentSetting;
+ /**
+ * Whether to run JavaScript. One of
+ * allow: Run JavaScript,
+ * block: Don't run JavaScript.
+ * Default is allow.
+ * The primary URL is the URL of the top-level frame. The secondary URL is not used.
+ */
+ var javascript: ContentSetting;
+ /**
+ * Whether to allow sites to show desktop notifications. One of
+ * allow: Allow sites to show desktop notifications,
+ * block: Don't allow sites to show desktop notifications,
+ * ask: Ask when a site wants to show desktop notifications.
+ * Default is ask.
+ * The primary URL is the URL of the document which wants to show the notification. The secondary URL is not used.
+ */
+ var notifications: ContentSetting;
+ /**
+ * Whether to run plugins. One of
+ * allow: Run plugins automatically,
+ * block: Don't run plugins automatically,
+ * detect_important_content: Only run automatically those plugins that are detected as the website's main content.
+ * Default is allow.
+ * The primary URL is the URL of the top-level frame. The secondary URL is not used.
+ */
+ var plugins: ContentSetting;
+ /**
+ * Whether to show images. One of
+ * allow: Show images,
+ * block: Don't show images.
+ * Default is allow.
+ * The primary URL is the URL of the top-level frame. The secondary URL is the URL of the image.
+ */
+ var images: ContentSetting;
+ /**
+ * Since Chrome 42.
+ * Whether to allow Geolocation. One of
+ * allow: Allow sites to track your physical location,
+ * block: Don't allow sites to track your physical location,
+ * ask: Ask before allowing sites to track your physical location.
+ * Default is ask.
+ * The primary URL is the URL of the document which requested location data. The secondary URL is the URL of the top-level frame (which may or may not differ from the requesting URL).
+ */
+ var location: ContentSetting;
+ /**
+ * Since Chrome 42.
+ * Whether to allow sites to toggle the fullscreen mode. One of
+ * allow: Allow sites to toggle the fullscreen mode,
+ * ask: Ask when a site wants to toggle the fullscreen mode.
+ * Default is ask.
+ * The primary URL is the URL of the document which requested to toggle the fullscreen mode. The secondary URL is the URL of the top-level frame (which may or may not differ from the requesting URL).
+ */
+ var fullscreen: ContentSetting;
+ /**
+ * Since Chrome 42.
+ * Whether to allow sites to disable the mouse cursor. One of
+ * allow: Allow sites to disable the mouse cursor,
+ * block: Don't allow sites to disable the mouse cursor,
+ * ask: Ask when a site wants to disable the mouse cursor.
+ * Default is ask.
+ * The primary URL is the URL of the top-level frame. The secondary URL is not used.
+ */
+ var mouselock: ContentSetting;
+ /**
+ * Since Chrome 42.
+ * Whether to allow sites to run plugins unsandboxed. One of
+ * allow: Allow sites to run plugins unsandboxed,
+ * block: Don't allow sites to run plugins unsandboxed,
+ * ask: Ask when a site wants to run a plugin unsandboxed.
+ * Default is ask.
+ * The primary URL is the URL of the top-level frame. The secondary URL is not used.
+ */
+ var unsandboxedPlugins: ContentSetting;
+ /**
+ * Since Chrome 42.
+ * Whether to allow sites to download multiple files automatically. One of
+ * allow: Allow sites to download multiple files automatically,
+ * block: Don't allow sites to download multiple files automatically,
+ * ask: Ask when a site wants to download files automatically after the first file.
+ * Default is ask.
+ * The primary URL is the URL of the top-level frame. The secondary URL is not used.
+ */
+ var automaticDownloads: ContentSetting;
+}
+
+////////////////////
+// Context Menus
+////////////////////
+/**
+ * Use the chrome.contextMenus API to add items to Google Chrome's context menu. You can choose what types of objects your context menu additions apply to, such as images, hyperlinks, and pages.
+ * Availability: Since Chrome 6.
+ * Permissions: "contextMenus"
+ */
+declare namespace chrome.contextMenus {
+ interface OnClickData {
+ /**
+ * Optional.
+ * Since Chrome 35.
+ * The text for the context selection, if any.
+ */
+ selectionText?: string;
+ /**
+ * Optional.
+ * Since Chrome 35.
+ * A flag indicating the state of a checkbox or radio item after it is clicked.
+ */
+ checked?: boolean;
+ /**
+ * Since Chrome 35.
+ * The ID of the menu item that was clicked.
+ */
+ menuItemId: any;
+ /**
+ * Optional.
+ * Since Chrome 35.
+ * The URL of the frame of the element where the context menu was clicked, if it was in a frame.
+ */
+ frameUrl?: string;
+ /**
+ * Since Chrome 35.
+ * A flag indicating whether the element is editable (text input, textarea, etc.).
+ */
+ editable: boolean;
+ /**
+ * Optional.
+ * Since Chrome 35.
+ * One of 'image', 'video', or 'audio' if the context menu was activated on one of these types of elements.
+ */
+ mediaType?: string;
+ /**
+ * Optional.
+ * Since Chrome 35.
+ * A flag indicating the state of a checkbox or radio item before it was clicked.
+ */
+ wasChecked?: boolean;
+ /**
+ * Since Chrome 35.
+ * The URL of the page where the menu item was clicked. This property is not set if the click occured in a context where there is no current page, such as in a launcher context menu.
+ */
+ pageUrl: string;
+ /**
+ * Optional.
+ * Since Chrome 35.
+ * If the element is a link, the URL it points to.
+ */
+ linkUrl?: string;
+ /**
+ * Optional.
+ * Since Chrome 35.
+ * The parent ID, if any, for the item clicked.
+ */
+ parentMenuItemId?: any;
+ /**
+ * Optional.
+ * Since Chrome 35.
+ * Will be present for elements with a 'src' URL.
+ */
+ srcUrl?: string;
+ }
+
+ interface CreateProperties {
+ /** Optional. Lets you restrict the item to apply only to documents whose URL matches one of the given patterns. (This applies to frames as well.) For details on the format of a pattern, see Match Patterns. */
+ documentUrlPatterns?: string[];
+ /** Optional. The initial state of a checkbox or radio item: true for selected and false for unselected. Only one radio item can be selected at a time in a given group of radio items. */
+ checked?: boolean;
+ /** Optional. The text to be displayed in the item; this is required unless type is 'separator'. When the context is 'selection', you can use %s within the string to show the selected text. For example, if this parameter's value is "Translate '%s' to Pig Latin" and the user selects the word "cool", the context menu item for the selection is "Translate 'cool' to Pig Latin". */
+ title?: string;
+ /** Optional. List of contexts this menu item will appear in. Defaults to ['page'] if not specified. */
+ contexts?: string[];
+ /**
+ * Optional.
+ * Since Chrome 20.
+ * Whether this context menu item is enabled or disabled. Defaults to true.
+ */
+ enabled?: boolean;
+ /** Optional. Similar to documentUrlPatterns, but lets you filter based on the src attribute of img/audio/video tags and the href of anchor tags. */
+ targetUrlPatterns?: string[];
+ /**
+ * Optional.
+ * A function that will be called back when the menu item is clicked. Event pages cannot use this; instead, they should register a listener for chrome.contextMenus.onClicked.
+ * @param info Information sent when a context menu item is clicked.
+ * @param tab The details of the tab where the click took place. Note: this parameter only present for extensions.
+ */
+ onclick?: (info: OnClickData, tab: chrome.tabs.Tab) => void;
+ /** Optional. The ID of a parent menu item; this makes the item a child of a previously added item. */
+ parentId?: any;
+ /** Optional. The type of menu item. Defaults to 'normal' if not specified. */
+ type?: string;
+ /**
+ * Optional.
+ * Since Chrome 21.
+ * The unique ID to assign to this item. Mandatory for event pages. Cannot be the same as another ID for this extension.
+ */
+ id?: string;
+ }
+
+ interface UpdateProperties {
+ documentUrlPatterns?: string[];
+ checked?: boolean;
+ title?: string;
+ contexts?: string[];
+ /** Optional. Since Chrome 20. */
+ enabled?: boolean;
+ targetUrlPatterns?: string[];
+ onclick?: Function;
+ /** Optional. Note: You cannot change an item to be a child of one of its own descendants. */
+ parentId?: any;
+ type?: string;
+ }
+
+ interface MenuClickedEvent extends chrome.events.Event<(info: OnClickData, tab?: chrome.tabs.Tab) => void> {}
+
+ /**
+ * Since Chrome 38.
+ * The maximum number of top level extension items that can be added to an extension action context menu. Any items beyond this limit will be ignored.
+ */
+ var ACTION_MENU_TOP_LEVEL_LIMIT: number;
+
+ /**
+ * Removes all context menu items added by this extension.
+ * @param callback Called when removal is complete.
+ * If you specify the callback parameter, it should be a function that looks like this:
+ * function() {...};
+ */
+ export function removeAll(callback?: () => void): void;
+ /**
+ * Creates a new context menu item. Note that if an error occurs during creation, you may not find out until the creation callback fires (the details will be in chrome.runtime.lastError).
+ * @param callback Called when the item has been created in the browser. If there were any problems creating the item, details will be available in chrome.runtime.lastError.
+ * If you specify the callback parameter, it should be a function that looks like this:
+ * function() {...};
+ */
+ export function create(createProperties: CreateProperties, callback?: () => void): void;
+ /**
+ * Updates a previously created context menu item.
+ * @param id The ID of the item to update.
+ * @param updateProperties The properties to update. Accepts the same values as the create function.
+ * @param callback Called when the context menu has been updated.
+ * If you specify the callback parameter, it should be a function that looks like this:
+ * function() {...};
+ */
+ export function update(id: string, updateProperties: UpdateProperties, callback?: () => void): void;
+ /**
+ * Updates a previously created context menu item.
+ * @param id The ID of the item to update.
+ * @param updateProperties The properties to update. Accepts the same values as the create function.
+ * @param callback Called when the context menu has been updated.
+ * If you specify the callback parameter, it should be a function that looks like this:
+ * function() {...};
+ */
+ export function update(id: number, updateProperties: UpdateProperties, callback?: () => void): void;
+ /**
+ * Removes a context menu item.
+ * @param menuItemId The ID of the context menu item to remove.
+ * @param callback Called when the context menu has been removed.
+ * If you specify the callback parameter, it should be a function that looks like this:
+ * function() {...};
+ */
+ export function remove(menuItemId: string, callback?: () => void): void;
+ /**
+ * Removes a context menu item.
+ * @param menuItemId The ID of the context menu item to remove.
+ * @param callback Called when the context menu has been removed.
+ * If you specify the callback parameter, it should be a function that looks like this:
+ * function() {...};
+ */
+ export function remove(menuItemId: number, callback?: () => void): void;
+
+ /**
+ * Since Chrome 21.
+ * Fired when a context menu item is clicked.
+ */
+ var onClicked: MenuClickedEvent;
+}
+
+////////////////////
+// Cookies
+////////////////////
+/**
+ * Use the chrome.cookies API to query and modify cookies, and to be notified when they change.
+ * Availability: Since Chrome 6.
+ * Permissions: "cookies", host permissions
+ */
+declare namespace chrome.cookies {
+ /** Represents information about an HTTP cookie. */
+ interface Cookie {
+ /** The domain of the cookie (e.g. "www.google.com", "example.com"). */
+ domain: string;
+ /** The name of the cookie. */
+ name: string;
+ /** The ID of the cookie store containing this cookie, as provided in getAllCookieStores(). */
+ storeId: string;
+ /** The value of the cookie. */
+ value: string;
+ /** True if the cookie is a session cookie, as opposed to a persistent cookie with an expiration date. */
+ session: boolean;
+ /** True if the cookie is a host-only cookie (i.e. a request's host must exactly match the domain of the cookie). */
+ hostOnly: boolean;
+ /** Optional. The expiration date of the cookie as the number of seconds since the UNIX epoch. Not provided for session cookies. */
+ expirationDate?: number;
+ /** The path of the cookie. */
+ path: string;
+ /** True if the cookie is marked as HttpOnly (i.e. the cookie is inaccessible to client-side scripts). */
+ httpOnly: boolean;
+ /** True if the cookie is marked as Secure (i.e. its scope is limited to secure channels, typically HTTPS). */
+ secure: boolean;
+ }
+
+ /** Represents a cookie store in the browser. An incognito mode window, for instance, uses a separate cookie store from a non-incognito window. */
+ interface CookieStore {
+ /** The unique identifier for the cookie store. */
+ id: string;
+ /** Identifiers of all the browser tabs that share this cookie store. */
+ tabIds: number[];
+ }
+
+ interface GetAllDetails {
+ /** Optional. Restricts the retrieved cookies to those whose domains match or are subdomains of this one. */
+ domain?: string;
+ /** Optional. Filters the cookies by name. */
+ name?: string;
+ /** Optional. Restricts the retrieved cookies to those that would match the given URL. */
+ url?: string;
+ /** Optional. The cookie store to retrieve cookies from. If omitted, the current execution context's cookie store will be used. */
+ storeId?: string;
+ /** Optional. Filters out session vs. persistent cookies. */
+ session?: boolean;
+ /** Optional. Restricts the retrieved cookies to those whose path exactly matches this string. */
+ path?: string;
+ /** Optional. Filters the cookies by their Secure property. */
+ secure?: boolean;
+ }
+
+ interface SetDetails {
+ /** Optional. The domain of the cookie. If omitted, the cookie becomes a host-only cookie. */
+ domain?: string;
+ /** Optional. The name of the cookie. Empty by default if omitted. */
+ name?: string;
+ /** The request-URI to associate with the setting of the cookie. This value can affect the default domain and path values of the created cookie. If host permissions for this URL are not specified in the manifest file, the API call will fail. */
+ url: string;
+ /** Optional. The ID of the cookie store in which to set the cookie. By default, the cookie is set in the current execution context's cookie store. */
+ storeId?: string;
+ /** Optional. The value of the cookie. Empty by default if omitted. */
+ value?: string;
+ /** Optional. The expiration date of the cookie as the number of seconds since the UNIX epoch. If omitted, the cookie becomes a session cookie. */
+ expirationDate?: number;
+ /** Optional. The path of the cookie. Defaults to the path portion of the url parameter. */
+ path?: string;
+ /** Optional. Whether the cookie should be marked as HttpOnly. Defaults to false. */
+ httpOnly?: boolean;
+ /** Optional. Whether the cookie should be marked as Secure. Defaults to false. */
+ secure?: boolean;
+ }
+
+ interface Details {
+ name: string;
+ url: string;
+ storeId?: string;
+ }
+
+ interface CookieChangeInfo {
+ /** Information about the cookie that was set or removed. */
+ cookie: Cookie;
+ /** True if a cookie was removed. */
+ removed: boolean;
+ /**
+ * Since Chrome 12.
+ * The underlying reason behind the cookie's change.
+ */
+ cause: string;
+ }
+
+ interface CookieChangedEvent extends chrome.events.Event<(changeInfo: CookieChangeInfo) => void> {}
+
+ /**
+ * Lists all existing cookie stores.
+ * @param callback The callback parameter should be a function that looks like this:
+ * function(array of CookieStore cookieStores) {...};
+ * Parameter cookieStores: All the existing cookie stores.
+ */
+ export function getAllCookieStores(callback: (cookieStores: CookieStore[]) => void): void;
+ /**
+ * Retrieves all cookies from a single cookie store that match the given information. The cookies returned will be sorted, with those with the longest path first. If multiple cookies have the same path length, those with the earliest creation time will be first.
+ * @param details Information to filter the cookies being retrieved.
+ * @param callback The callback parameter should be a function that looks like this:
+ * function(array of Cookie cookies) {...};
+ * Parameter cookies: All the existing, unexpired cookies that match the given cookie info.
+ */
+ export function getAll(details: GetAllDetails, callback: (cookies: Cookie[]) => void): void;
+ /**
+ * Sets a cookie with the given cookie data; may overwrite equivalent cookies if they exist.
+ * @param details Details about the cookie being set.
+ * @param callback If you specify the callback parameter, it should be a function that looks like this:
+ * function( Cookie cookie) {...};
+ * Optional parameter cookie: Contains details about the cookie that's been set. If setting failed for any reason, this will be "null", and "chrome.runtime.lastError" will be set.
+ */
+ export function set(details: SetDetails, callback?: (cookie?: Cookie) => void): void;
+ /**
+ * Deletes a cookie by name.
+ * @param details Information to identify the cookie to remove.
+ * @param callback If you specify the callback parameter, it should be a function that looks like this:
+ * function(object details) {...};
+ */
+ export function remove(details: Details, callback?: (details: Details) => void): void;
+ /**
+ * Retrieves information about a single cookie. If more than one cookie of the same name exists for the given URL, the one with the longest path will be returned. For cookies with the same path length, the cookie with the earliest creation time will be returned.
+ * @param details Details to identify the cookie being retrieved.
+ * @param callback The callback parameter should be a function that looks like this:
+ * function( Cookie cookie) {...};
+ * Parameter cookie: Contains details about the cookie. This parameter is null if no such cookie was found.
+ */
+ export function get(details: Details, callback: (cookie?: Cookie) => void): void;
+
+ /** Fired when a cookie is set or removed. As a special case, note that updating a cookie's properties is implemented as a two step process: the cookie to be updated is first removed entirely, generating a notification with "cause" of "overwrite" . Afterwards, a new cookie is written with the updated values, generating a second notification with "cause" "explicit". */
+ var onChanged: CookieChangedEvent;
+}
+
+////////////////////
+// Debugger
+////////////////////
+/**
+ * The chrome.debugger API serves as an alternate transport for Chrome's remote debugging protocol. Use chrome.debugger to attach to one or more tabs to instrument network interaction, debug JavaScript, mutate the DOM and CSS, etc. Use the Debuggee tabId to target tabs with sendCommand and route events by tabId from onEvent callbacks.
+ * Availability: Since Chrome 18.
+ * Permissions: "debugger"
+ */
+declare module "chrome.debugger" {
+ /** Debuggee identifier. Either tabId or extensionId must be specified */
+ interface Debuggee {
+ /** Optional. The id of the tab which you intend to debug. */
+ tabId?: number;
+ /**
+ * Optional.
+ * Since Chrome 27.
+ * The id of the extension which you intend to debug. Attaching to an extension background page is only possible when 'silent-debugger-extension-api' flag is enabled on the target browser.
+ */
+ extensionId?: string;
+ /**
+ * Optional.
+ * Since Chrome 28.
+ * The opaque id of the debug target.
+ */
+ targetId?: string;
+ }
+
+ /**
+ * Since Chrome 28.
+ * Debug target information
+ */
+ interface TargetInfo {
+ /** Target type. */
+ type: string;
+ /** Target id. */
+ id: string;
+ /**
+ * Optional.
+ * Since Chrome 30.
+ * The tab id, defined if type == 'page'.
+ */
+ tabId?: number;
+ /**
+ * Optional.
+ * Since Chrome 30.
+ * The extension id, defined if type = 'background_page'.
+ */
+ extensionId?: string;
+ /** True if debugger is already attached. */
+ attached: boolean;
+ /** Target page title. */
+ title: string;
+ /** Target URL. */
+ url: string;
+ /** Optional. Target favicon URL. */
+ faviconUrl?: string;
+ }
+
+ interface DebuggerDetachedEvent extends chrome.events.Event<(source: Debuggee, reason: string) => void> {}
+
+ interface DebuggerEventEvent extends chrome.events.Event<(source: Debuggee, method: string, params?: Object) => void> {}
+
+ /**
+ * Attaches debugger to the given target.
+ * @param target Debugging target to which you want to attach.
+ * @param requiredVersion Required debugging protocol version ("0.1"). One can only attach to the debuggee with matching major version and greater or equal minor version. List of the protocol versions can be obtained in the documentation pages.
+ * @param callback Called once the attach operation succeeds or fails. Callback receives no arguments. If the attach fails, runtime.lastError will be set to the error message.
+ * If you specify the callback parameter, it should be a function that looks like this:
+ * function() {...};
+ */
+ export function attach(target: Debuggee, requiredVersion: string, callback?: () => void): void;
+ /**
+ * Detaches debugger from the given target.
+ * @param target Debugging target from which you want to detach.
+ * @param callback Called once the detach operation succeeds or fails. Callback receives no arguments. If the detach fails, runtime.lastError will be set to the error message.
+ * If you specify the callback parameter, it should be a function that looks like this:
+ * function() {...};
+ */
+ export function detach(target: Debuggee, callback?: () => void): void;
+ /**
+ * Sends given command to the debugging target.
+ * @param target Debugging target to which you want to send the command.
+ * @param method Method name. Should be one of the methods defined by the remote debugging protocol.
+ * @param commandParams Since Chrome 22.
+ * JSON object with request parameters. This object must conform to the remote debugging params scheme for given method.
+ * @param callback Response body. If an error occurs while posting the message, the callback will be called with no arguments and runtime.lastError will be set to the error message.
+ * If you specify the callback parameter, it should be a function that looks like this:
+ * function(object result) {...};
+ */
+ export function sendCommand(target: Debuggee, method: string, commandParams?: Object, callback?: (result?: Object) => void): void;
+ /**
+ * Since Chrome 28.
+ * Returns the list of available debug targets.
+ * @param callback The callback parameter should be a function that looks like this:
+ * function(array of TargetInfo result) {...};
+ * Parameter result: Array of TargetInfo objects corresponding to the available debug targets.
+ */
+ export function getTargets(callback: (result: TargetInfo[]) => void): void;
+
+ /** Fired when browser terminates debugging session for the tab. This happens when either the tab is being closed or Chrome DevTools is being invoked for the attached tab. */
+ var onDetach: DebuggerDetachedEvent;
+ /** Fired whenever debugging target issues instrumentation event. */
+ var onEvent: DebuggerEventEvent;
+}
+
+////////////////////
+// Declarative Content
+////////////////////
+/**
+ * Use the chrome.declarativeContent API to take actions depending on the content of a page, without requiring permission to read the page's content.
+ * Availability: Since Chrome 33.
+ * Permissions: "declarativeContent"
+ */
+declare namespace chrome.declarativeContent {
+ interface PageStateUrlDetails {
+ /** Optional. Matches if the host name of the URL contains a specified string. To test whether a host name component has a prefix 'foo', use hostContains: '.foo'. This matches 'www.foobar.com' and 'foo.com', because an implicit dot is added at the beginning of the host name. Similarly, hostContains can be used to match against component suffix ('foo.') and to exactly match against components ('.foo.'). Suffix- and exact-matching for the last components need to be done separately using hostSuffix, because no implicit dot is added at the end of the host name. */
+ hostContains?: string;
+ /** Optional. Matches if the host name of the URL is equal to a specified string. */
+ hostEquals?: string;
+ /** Optional. Matches if the host name of the URL starts with a specified string. */
+ hostPrefix?: string;
+ /** Optional. Matches if the host name of the URL ends with a specified string. */
+ hostSuffix?: string;
+ /** Optional. Matches if the path segment of the URL contains a specified string. */
+ pathContains?: string;
+ /** Optional. Matches if the path segment of the URL is equal to a specified string. */
+ pathEquals?: string;
+ /** Optional. Matches if the path segment of the URL starts with a specified string. */
+ pathPrefix?: string;
+ /** Optional. Matches if the path segment of the URL ends with a specified string. */
+ pathSuffix?: string;
+ /** Optional. Matches if the query segment of the URL contains a specified string. */
+ queryContains?: string;
+ /** Optional. Matches if the query segment of the URL is equal to a specified string. */
+ queryEquals?: string;
+ /** Optional. Matches if the query segment of the URL starts with a specified string. */
+ queryPrefix?: string;
+ /** Optional. Matches if the query segment of the URL ends with a specified string. */
+ querySuffix?: string;
+ /** Optional. Matches if the URL (without fragment identifier) contains a specified string. Port numbers are stripped from the URL if they match the default port number. */
+ urlContains?: string;
+ /** Optional. Matches if the URL (without fragment identifier) is equal to a specified string. Port numbers are stripped from the URL if they match the default port number. */
+ urlEquals?: string;
+ /** Optional. Matches if the URL (without fragment identifier) matches a specified regular expression. Port numbers are stripped from the URL if they match the default port number. The regular expressions use the RE2 syntax. */
+ urlMatches?: string;
+ /** Optional. Matches if the URL without query segment and fragment identifier matches a specified regular expression. Port numbers are stripped from the URL if they match the default port number. The regular expressions use the RE2 syntax. */
+ originAndPathMatches?: string;
+ /** Optional. Matches if the URL (without fragment identifier) starts with a specified string. Port numbers are stripped from the URL if they match the default port number. */
+ urlPrefix?: string;
+ /** Optional. Matches if the URL (without fragment identifier) ends with a specified string. Port numbers are stripped from the URL if they match the default port number. */
+ urlSuffix?: string;
+ /** Optional. Matches if the scheme of the URL is equal to any of the schemes specified in the array. */
+ schemes?: string[];
+ /** Optional. Matches if the port of the URL is contained in any of the specified port lists. For example [80, 443, [1000, 1200]] matches all requests on port 80, 443 and in the range 1000-1200. */
+ ports?: (number | number[])[];
+ }
+
+ /** Matches the state of a web page by various criteria. */
+ interface PageStateMatcher {
+ /** Optional. Filters URLs for various criteria. See event filtering. All criteria are case sensitive. */
+ pageUrl?: PageStateUrlDetails;
+ /** Optional. Matches if all of the CSS selectors in the array match displayed elements in a frame with the same origin as the page's main frame. All selectors in this array must be compound selectors to speed up matching. Note that listing hundreds of CSS selectors or CSS selectors that match hundreds of times per page can still slow down web sites. */
+ css?: string[];
+ /**
+ * Optional.
+ * Since Chrome 45. Warning: this is the current Beta channel. More information available on the API documentation pages.
+ * Matches if the bookmarked state of the page is equal to the specified value. Requres the bookmarks permission.
+ */
+ isBookmarked?: boolean;
+ }
+}
+
+////////////////////
+// Declarative Web Request
+////////////////////
+declare namespace chrome.declarativeWebRequest {
+ interface HeaderFilter {
+ nameEquals?: string;
+ valueContains?: any;
+ nameSuffix?: string;
+ valueSuffix?: string;
+ valuePrefix?: string;
+ nameContains?: any;
+ valueEquals?: string;
+ namePrefix?: string;
+ }
+
+ interface AddResponseHeader {
+ name: string;
+ value: string;
+ }
+
+ interface RemoveResponseCookie {
+ filter: ResponseCookie;
+ }
+
+ interface RemoveResponseHeader {
+ name: string;
+ value?: string;
+ }
+
+ interface RequestMatcher {
+ contentType?: string[];
+ url?: chrome.events.UrlFilter;
+ excludeContentType?: string[];
+ excludeResponseHeader?: HeaderFilter[];
+ resourceType?: string;
+ responseHeaders?: HeaderFilter[];
+ }
+
+ interface IgnoreRules {
+ lowerPriorityThan: number;
+ }
+
+ interface RedirectToEmptyDocument { }
+
+ interface RedirectRequest {
+ redirectUrl: string;
+ }
+
+ interface ResponseCookie {
+ domain?: string;
+ name?: string;
+ expires?: string;
+ maxAge?: number;
+ value?: string;
+ path?: string;
+ httpOnly?: string;
+ secure?: string;
+ }
+
+ interface AddResponseCookie {
+ cookie: ResponseCookie;
+ }
+
+ interface EditResponseCookie {
+ filter: ResponseCookie;
+ modification: ResponseCookie;
+ }
+
+ interface CancelRequest { }
+
+ interface RemoveRequestHeader {
+ name: string;
+ }
+
+ interface EditRequestCookie {
+ filter: RequestCookie;
+ modification: RequestCookie;
+ }
+
+ interface SetRequestHeader {
+ name: string;
+ value: string;
+ }
+
+ interface RequestCookie {
+ name?: string;
+ value?: string;
+ }
+
+ interface RedirectByRegEx {
+ to: string;
+ from: string;
+ }
+
+ interface RedirectToTransparentImage { }
+
+ interface AddRequestCookie {
+ cookie: RequestCookie;
+ }
+
+ interface RemoveRequestCookie {
+ filter: RequestCookie;
+ }
+
+ interface RequestedEvent extends chrome.events.Event<Function> {}
+
+ var onRequest: RequestedEvent;
+}
+
+////////////////////
+// DesktopCapture
+////////////////////
+/**
+ * Desktop Capture API that can be used to capture content of screen, individual windows or tabs.
+ * Availability: Since Chrome 34.
+ * Permissions: "desktopCapture"
+ */
+declare namespace chrome.desktopCapture {
+ /**
+ * Shows desktop media picker UI with the specified set of sources.
+ * @param sources Set of sources that should be shown to the user.
+ * @param callback The callback parameter should be a function that looks like this:
+ * function(string streamId) {...};
+ * Parameter streamId: An opaque string that can be passed to getUserMedia() API to generate media stream that corresponds to the source selected by the user. If user didn't select any source (i.e. canceled the prompt) then the callback is called with an empty streamId. The created streamId can be used only once and expires after a few seconds when it is not used.
+ */
+ export function chooseDesktopMedia(sources: string[], callback: (streamId: string) => void): number;
+ /**
+ * Shows desktop media picker UI with the specified set of sources.
+ * @param sources Set of sources that should be shown to the user.
+ * @param targetTab Optional tab for which the stream is created. If not specified then the resulting stream can be used only by the calling extension. The stream can only be used by frames in the given tab whose security origin matches tab.url.
+ * @param callback The callback parameter should be a function that looks like this:
+ * function(string streamId) {...};
+ * Parameter streamId: An opaque string that can be passed to getUserMedia() API to generate media stream that corresponds to the source selected by the user. If user didn't select any source (i.e. canceled the prompt) then the callback is called with an empty streamId. The created streamId can be used only once and expires after a few seconds when it is not used.
+ */
+ export function chooseDesktopMedia(sources: string[], targetTab: chrome.tabs.Tab, callback: (streamId: string) => void): number;
+ /**
+ * Hides desktop media picker dialog shown by chooseDesktopMedia().
+ * @param desktopMediaRequestId Id returned by chooseDesktopMedia()
+ */
+ export function cancelChooseDesktopMedia(desktopMediaRequestId: number): void;
+}
+
+////////////////////
+// Dev Tools - Inspected Window
+////////////////////
+/**
+ * Use the chrome.devtools.inspectedWindow API to interact with the inspected window: obtain the tab ID for the inspected page, evaluate the code in the context of the inspected window, reload the page, or obtain the list of resources within the page.
+ * Availability: Since Chrome 18.
+ */
+declare namespace chrome.devtools.inspectedWindow {
+ /** A resource within the inspected page, such as a document, a script, or an image. */
+ interface Resource {
+ /** The URL of the resource. */
+ url: string;
+ /**
+ * Gets the content of the resource.
+ * @param callback A function that receives resource content when the request completes.
+ * The callback parameter should be a function that looks like this:
+ * function(string content, string encoding) {...};
+ * Parameter content: Content of the resource (potentially encoded).
+ * Parameter encoding: Empty if content is not encoded, encoding name otherwise. Currently, only base64 is supported.
+ */
+ getContent(callback: (content: string, encoding: string) => void): void;
+ /**
+ * Sets the content of the resource.
+ * @param content New content of the resource. Only resources with the text type are currently supported.
+ * @param commit True if the user has finished editing the resource, and the new content of the resource should be persisted; false if this is a minor change sent in progress of the user editing the resource.
+ * @param callback A function called upon request completion.
+ * If you specify the callback parameter, it should be a function that looks like this:
+ * function(object error) {...};
+ * Optional parameter error: Set to undefined if the resource content was set successfully; describes error otherwise.
+ */
+ setContent(content: string, commit: boolean, callback?: (error: Object) => void): void;
+ }
+
+ interface ReloadOptions {
+ /** Optional. If specified, the string will override the value of the User-Agent HTTP header that's sent while loading the resources of the inspected page. The string will also override the value of the navigator.userAgent property that's returned to any scripts that are running within the inspected page. */
+ userAgent?: string;
+ /** Optional. When true, the loader will ignore the cache for all inspected page resources loaded before the load event is fired. The effect is similar to pressing Ctrl+Shift+R in the inspected window or within the Developer Tools window. */
+ ignoreCache?: boolean;
+ /** Optional. If specified, the script will be injected into every frame of the inspected page immediately upon load, before any of the frame's scripts. The script will not be injected after subsequent reloads—for example, if the user presses Ctrl+R. */
+ injectedScript?: boolean;
+ /**
+ * Optional.
+ * If specified, this script evaluates into a function that accepts three string arguments: the source to preprocess, the URL of the source, and a function name if the source is an DOM event handler. The preprocessorerScript function should return a string to be compiled by Chrome in place of the input source. In the case that the source is a DOM event handler, the returned source must compile to a single JS function.
+ * @deprecated Deprecated since Chrome 41. Please avoid using this parameter, it will be removed soon.
+ */
+ preprocessorScript?: string;
+ }
+
+ interface EvaluationExceptionInfo {
+ /** Set if the error occurred on the DevTools side before the expression is evaluated. */
+ isError: boolean;
+ /** Set if the error occurred on the DevTools side before the expression is evaluated. */
+ code: string;
+ /** Set if the error occurred on the DevTools side before the expression is evaluated. */
+ description: string;
+ /** Set if the error occurred on the DevTools side before the expression is evaluated, contains the array of the values that may be substituted into the description string to provide more information about the cause of the error. */
+ details: any[];
+ /** Set if the evaluated code produces an unhandled exception. */
+ isException: boolean;
+ /** Set if the evaluated code produces an unhandled exception. */
+ value: string;
+ }
+
+ interface ResourceAddedEvent extends chrome.events.Event<(resource: Resource) => void> {}
+
+ interface ResourceContentCommittedEvent extends chrome.events.Event<(resource: Resource, content: string) => void> {}
+
+ /** The ID of the tab being inspected. This ID may be used with chrome.tabs.* API. */
+ var tabId: number;
+
+ /** Reloads the inspected page. */
+ export function reload(reloadOptions: ReloadOptions): void;
+ /**
+ * Evaluates a JavaScript expression in the context of the main frame of the inspected page. The expression must evaluate to a JSON-compliant object, otherwise an exception is thrown. The eval function can report either a DevTools-side error or a JavaScript exception that occurs during evaluation. In either case, the result parameter of the callback is undefined. In the case of a DevTools-side error, the isException parameter is non-null and has isError set to true and code set to an error code. In the case of a JavaScript error, isException is set to true and value is set to the string value of thrown object.
+ * @param expression An expression to evaluate.
+ * @param callback A function called when evaluation completes.
+ * If you specify the callback parameter, it should be a function that looks like this:
+ * function(object result, object exceptionInfo) {...};
+ * Parameter result: The result of evaluation.
+ * Parameter exceptionInfo: An object providing details if an exception occurred while evaluating the expression.
+ */
+ export function eval(expression: string, callback?: (result: Object, exceptionInfo: EvaluationExceptionInfo) => void): void;
+ /**
+ * Retrieves the list of resources from the inspected page.
+ * @param callback A function that receives the list of resources when the request completes.
+ * The callback parameter should be a function that looks like this:
+ * function(array of Resource resources) {...};
+ */
+ export function getResources(callback: (resources: Resource[]) => void): void;
+
+ /** Fired when a new resource is added to the inspected page. */
+ var onResourceAdded: ResourceAddedEvent;
+ /** Fired when a new revision of the resource is committed (e.g. user saves an edited version of the resource in the Developer Tools). */
+ var onResourceContentCommitted: ResourceContentCommittedEvent;
+}
+
+////////////////////
+// Dev Tools - Network
+////////////////////
+/**
+ * Use the chrome.devtools.network API to retrieve the information about network requests displayed by the Developer Tools in the Network panel.
+ * Availability: Since Chrome 18.
+ */
+declare namespace chrome.devtools.network {
+ /** Represents a network request for a document resource (script, image and so on). See HAR Specification for reference. */
+ interface Request {
+ /**
+ * Returns content of the response body.
+ * @param callback A function that receives the response body when the request completes.
+ * The callback parameter should be a function that looks like this:
+ * function(string content, string encoding) {...};
+ * Parameter content: Content of the response body (potentially encoded).
+ * Parameter encoding: Empty if content is not encoded, encoding name otherwise. Currently, only base64 is supported.
+ */
+ getContent(callback: (content: string, encoding: string) => void): void;
+ }
+
+ interface RequestFinishedEvent extends chrome.events.Event<(request: Request) => void> {}
+
+ interface NavigatedEvent extends chrome.events.Event<(url: string) => void> {}
+
+ /**
+ * Returns HAR log that contains all known network requests.
+ * @param callback A function that receives the HAR log when the request completes.
+ * The callback parameter should be a function that looks like this:
+ * function(object harLog) {...};
+ * Parameter harLog: A HAR log. See HAR specification for details.
+ */
+ export function getHAR(callback: (harLog: Object) => void): void;
+
+ /** Fired when a network request is finished and all request data are available. */
+ var onRequestFinished: RequestFinishedEvent;
+ /** Fired when the inspected window navigates to a new page. */
+ var onNavigated: NavigatedEvent;
+}
+
+////////////////////
+// Dev Tools - Panels
+////////////////////
+/**
+ * Use the chrome.devtools.panels API to integrate your extension into Developer Tools window UI: create your own panels, access existing panels, and add sidebars.
+ * Availability: Since Chrome 18.
+ */
+declare namespace chrome.devtools.panels {
+ interface PanelShownEvent extends chrome.events.Event<(window: chrome.windows.Window) => void> {}
+
+ interface PanelHiddenEvent extends chrome.events.Event<() => void> {}
+
+ interface PanelSearchEvent extends chrome.events.Event<(action: string, queryString?: string) => void> {}
+
+ /** Represents a panel created by extension. */
+ interface ExtensionPanel {
+ /**
+ * Appends a button to the status bar of the panel.
+ * @param iconPath Path to the icon of the button. The file should contain a 64x24-pixel image composed of two 32x24 icons. The left icon is used when the button is inactive; the right icon is displayed when the button is pressed.
+ * @param tooltipText Text shown as a tooltip when user hovers the mouse over the button.
+ * @param disabled Whether the button is disabled.
+ */
+ createStatusBarButton(iconPath: string, tooltipText: string, disabled: boolean): Button;
+ /** Fired when the user switches to the panel. */
+ onShown: PanelShownEvent;
+ /** Fired when the user switches away from the panel. */
+ onHidden: PanelHiddenEvent;
+ /** Fired upon a search action (start of a new search, search result navigation, or search being canceled). */
+ onSearch: PanelSearchEvent;
+ }
+
+ interface ButtonClickedEvent extends chrome.events.Event<() => void> {}
+
+ /** A button created by the extension. */
+ interface Button {
+ /**
+ * Updates the attributes of the button. If some of the arguments are omitted or null, the corresponding attributes are not updated.
+ * @param iconPath Path to the new icon of the button.
+ * @param tooltipText Text shown as a tooltip when user hovers the mouse over the button.
+ * @param disabled Whether the button is disabled.
+ */
+ update(iconPath?: string, tooltipText?: string, disabled?: boolean): void;
+ /** Fired when the button is clicked. */
+ onClicked: ButtonClickedEvent;
+ }
+
+ interface SelectionChangedEvent extends chrome.events.Event<() => void> {}
+
+ /** Represents the Elements panel. */
+ interface ElementsPanel {
+ /**
+ * Creates a pane within panel's sidebar.
+ * @param title Text that is displayed in sidebar caption.
+ * @param callback A callback invoked when the sidebar is created.
+ * If you specify the callback parameter, it should be a function that looks like this:
+ * function( ExtensionSidebarPane result) {...};
+ * Parameter result: An ExtensionSidebarPane object for created sidebar pane.
+ */
+ createSidebarPane(title: string, callback?: (result: ExtensionSidebarPane) => void): void;
+ /** Fired when an object is selected in the panel. */
+ onSelectionChanged: SelectionChangedEvent;
+ }
+
+ /**
+ * Since Chrome 41.
+ * Represents the Sources panel.
+ */
+ interface SourcesPanel {
+ /**
+ * Creates a pane within panel's sidebar.
+ * @param title Text that is displayed in sidebar caption.
+ * @param callback A callback invoked when the sidebar is created.
+ * If you specify the callback parameter, it should be a function that looks like this:
+ * function( ExtensionSidebarPane result) {...};
+ * Parameter result: An ExtensionSidebarPane object for created sidebar pane.
+ */
+ createSidebarPane(title: string, callback?: (result: ExtensionSidebarPane) => void): void;
+ /** Fired when an object is selected in the panel. */
+ onSelectionChanged: SelectionChangedEvent;
+ }
+
+ interface ExtensionSidebarPaneShownEvent extends chrome.events.Event<(window: chrome.windows.Window) => void> {}
+
+ interface ExtensionSidebarPaneHiddenEvent extends chrome.events.Event<() => void> {}
+
+ /** A sidebar created by the extension. */
+ interface ExtensionSidebarPane {
+ /**
+ * Sets the height of the sidebar.
+ * @param height A CSS-like size specification, such as '100px' or '12ex'.
+ */
+ setHeight(height: string): void;
+ /**
+ * Sets an expression that is evaluated within the inspected page. The result is displayed in the sidebar pane.
+ * @param expression An expression to be evaluated in context of the inspected page. JavaScript objects and DOM nodes are displayed in an expandable tree similar to the console/watch.
+ * @param rootTitle An optional title for the root of the expression tree.
+ * @param callback A callback invoked after the sidebar pane is updated with the expression evaluation results.
+ * If you specify the callback parameter, it should be a function that looks like this:
+ * function() {...};
+ */
+ setExpression(expression: string, rootTitle?: string, callback?: () => void): void;
+ /**
+ * Sets an expression that is evaluated within the inspected page. The result is displayed in the sidebar pane.
+ * @param expression An expression to be evaluated in context of the inspected page. JavaScript objects and DOM nodes are displayed in an expandable tree similar to the console/watch.
+ * @param callback A callback invoked after the sidebar pane is updated with the expression evaluation results.
+ * If you specify the callback parameter, it should be a function that looks like this:
+ * function() {...};
+ */
+ setExpression(expression: string, callback?: () => void): void;
+ /**
+ * Sets a JSON-compliant object to be displayed in the sidebar pane.
+ * @param jsonObject An object to be displayed in context of the inspected page. Evaluated in the context of the caller (API client).
+ * @param rootTitle An optional title for the root of the expression tree.
+ * @param callback A callback invoked after the sidebar is updated with the object.
+ * If you specify the callback parameter, it should be a function that looks like this:
+ * function() {...};
+ */
+ setObject(jsonObject: string, rootTitle?: string, callback?: () => void): void;
+ /**
+ * Sets a JSON-compliant object to be displayed in the sidebar pane.
+ * @param jsonObject An object to be displayed in context of the inspected page. Evaluated in the context of the caller (API client).
+ * @param callback A callback invoked after the sidebar is updated with the object.
+ * If you specify the callback parameter, it should be a function that looks like this:
+ * function() {...};
+ */
+ setObject(jsonObject: string, callback?: () => void): void;
+ /**
+ * Sets an HTML page to be displayed in the sidebar pane.
+ * @param path Relative path of an extension page to display within the sidebar.
+ */
+ setPage(path: string): void;
+ /** Fired when the sidebar pane becomes visible as a result of user switching to the panel that hosts it. */
+ onShown: ExtensionSidebarPaneShownEvent;
+ /** Fired when the sidebar pane becomes hidden as a result of the user switching away from the panel that hosts the sidebar pane. */
+ onHidden: ExtensionSidebarPaneHiddenEvent;
+ }
+
+ /** Elements panel. */
+ var elements: ElementsPanel;
+ /**
+ * Since Chrome 38.
+ * Sources panel.
+ */
+ var sources: SourcesPanel;
+
+ /**
+ * Creates an extension panel.
+ * @param title Title that is displayed next to the extension icon in the Developer Tools toolbar.
+ * @param iconPath Path of the panel's icon relative to the extension directory.
+ * @param pagePath Path of the panel's HTML page relative to the extension directory.
+ * @param callback A function that is called when the panel is created.
+ * If you specify the callback parameter, it should be a function that looks like this:
+ * function( ExtensionPanel panel) {...};
+ * Parameter panel: An ExtensionPanel object representing the created panel.
+ */
+ export function create(title: string, iconPath: string, pagePath: string, callback?: (panel: ExtensionPanel) => void): void;
+ /**
+ * Specifies the function to be called when the user clicks a resource link in the Developer Tools window. To unset the handler, either call the method with no parameters or pass null as the parameter.
+ * @param callback A function that is called when the user clicks on a valid resource link in Developer Tools window. Note that if the user clicks an invalid URL or an XHR, this function is not called.
+ * If you specify the callback parameter, it should be a function that looks like this:
+ * function( devtools.inspectedWindow.Resource resource) {...};
+ * Parameter resource: A devtools.inspectedWindow.Resource object for the resource that was clicked.
+ */
+ export function setOpenResourceHandler(callback?: (resource: chrome.devtools.inspectedWindow.Resource) => void): void;
+ /**
+ * Since Chrome 38.
+ * Requests DevTools to open a URL in a Developer Tools panel.
+ * @param url The URL of the resource to open.
+ * @param lineNumber Specifies the line number to scroll to when the resource is loaded.
+ * @param callback A function that is called when the resource has been successfully loaded.
+ * If you specify the callback parameter, it should be a function that looks like this:
+ * function() {...};
+ */
+ export function openResource(url: string, lineNumber: number, callback: () => void): void;
+}
+
+////////////////////
+// Document Scan
+////////////////////
+/**
+ * Use the chrome.documentScan API to discover and retrieve images from attached paper document scanners.
+ * Availability: Since Chrome 44.
+ * Permissions: "documentScan"
+ * Important: This API works only on Chrome OS.
+ */
+declare namespace chrome.documentScan {
+ interface DocumentScanOptions {
+ /** Optional. The MIME types that are accepted by the caller. */
+ mimeTypes?: string[];
+ /** Optional. The number of scanned images allowed (defaults to 1). */
+ maxImages?: number;
+ }
+
+ interface DocumentScanCallbackArg {
+ /** The data image URLs in a form that can be passed as the "src" value to an image tag. */
+ dataUrls: string[];
+ /** The MIME type of dataUrls. */
+ mimeType: string;
+ }
+
+ /**
+ * Performs a document scan. On success, the PNG data will be sent to the callback.
+ * @param options Object containing scan parameters.
+ * @param callback Called with the result and data from the scan.
+ * The callback parameter should be a function that looks like this:
+ * function(object result) {...};
+ */
+ export function scan(options: DocumentScanOptions, callback: (result: DocumentScanCallbackArg) => void): void;
+}
+
+////////////////////
+// Dev Tools - Downloads
+////////////////////
+/**
+ * Use the chrome.downloads API to programmatically initiate, monitor, manipulate, and search for downloads.
+ * Availability: Since Chrome 31.
+ * Permissions: "downloads"
+ */
+declare namespace chrome.downloads {
+ interface HeaderNameValuePair {
+ /** Name of the HTTP header. */
+ name: string;
+ /** Value of the HTTP header. */
+ value: string;
+ }
+
+ interface DownloadOptions {
+ /** Optional. Post body. */
+ body?: string;
+ /** Optional. Use a file-chooser to allow the user to select a filename regardless of whether filename is set or already exists. */
+ saveAs?: boolean;
+ /** The URL to download. */
+ url: string;
+ /** Optional. A file path relative to the Downloads directory to contain the downloaded file, possibly containing subdirectories. Absolute paths, empty paths, and paths containing back-references ".." will cause an error. onDeterminingFilename allows suggesting a filename after the file's MIME type and a tentative filename have been determined. */
+ filename?: string;
+ /** Optional. Extra HTTP headers to send with the request if the URL uses the HTTP[s] protocol. Each header is represented as a dictionary containing the keys name and either value or binaryValue, restricted to those allowed by XMLHttpRequest. */
+ headers?: HeaderNameValuePair[];
+ /** Optional. The HTTP method to use if the URL uses the HTTP[S] protocol. */
+ method?: string;
+ /** Optional. The action to take if filename already exists. */
+ conflictAction?: string;
+ }
+
+ interface DownloadDelta {
+ /** Optional. The change in danger, if any. */
+ danger?: StringDelta;
+ /** Optional. The change in url, if any. */
+ url?: StringDelta;
+ /** Optional. The change in totalBytes, if any. */
+ totalBytes?: DoubleDelta;
+ /** Optional. The change in filename, if any. */
+ filename?: StringDelta;
+ /** Optional. The change in paused, if any. */
+ paused?: BooleanDelta;
+ /** Optional. The change in state, if any. */
+ state?: StringDelta;
+ /** Optional. The change in mime, if any. */
+ mime?: StringDelta;
+ /** Optional. The change in fileSize, if any. */
+ fileSize?: DoubleDelta;
+ /** Optional. The change in startTime, if any. */
+ startTime?: DoubleDelta;
+ /** Optional. The change in error, if any. */
+ error?: StringDelta;
+ /** Optional. The change in endTime, if any. */
+ endTime?: DoubleDelta;
+ /** The id of the DownloadItem that changed. */
+ id: number;
+ /** Optional. The change in canResume, if any. */
+ canResume?: BooleanDelta;
+ /** Optional. The change in exists, if any. */
+ exists?: BooleanDelta;
+ }
+
+ interface BooleanDelta {
+ current?: boolean;
+ previous?: boolean;
+ }
+
+ /** Since Chrome 34. */
+ interface DoubleDelta {
+ current?: number;
+ previous?: number;
+ }
+
+ interface StringDelta {
+ current?: string;
+ previous?: string;
+ }
+
+ interface DownloadItem {
+ /** Number of bytes received so far from the host, without considering file compression. */
+ bytesReceived: number;
+ /** Indication of whether this download is thought to be safe or known to be suspicious. */
+ danger: string;
+ /** Absolute URL. */
+ url: string;
+ /** Number of bytes in the whole file, without considering file compression, or -1 if unknown. */
+ totalBytes: number;
+ /** Absolute local path. */
+ filename: string;
+ /** True if the download has stopped reading data from the host, but kept the connection open. */
+ paused: boolean;
+ /** Indicates whether the download is progressing, interrupted, or complete. */
+ state: string;
+ /** The file's MIME type. */
+ mime: string;
+ /** Number of bytes in the whole file post-decompression, or -1 if unknown. */
+ fileSize: number;
+ /** The time when the download began in ISO 8601 format. May be passed directly to the Date constructor: chrome.downloads.search({}, function(items){items.forEach(function(item){console.log(new Date(item.startTime))})}) */
+ startTime: string;
+ /** Optional. Why the download was interrupted. Several kinds of HTTP errors may be grouped under one of the errors beginning with SERVER_. Errors relating to the network begin with NETWORK_, errors relating to the process of writing the file to the file system begin with FILE_, and interruptions initiated by the user begin with USER_. */
+ error?: string;
+ /** Optional. The time when the download ended in ISO 8601 format. May be passed directly to the Date constructor: chrome.downloads.search({}, function(items){items.forEach(function(item){if (item.endTime) console.log(new Date(item.endTime))})}) */
+ endTime?: string;
+ /** An identifier that is persistent across browser sessions. */
+ id: number;
+ /** False if this download is recorded in the history, true if it is not recorded. */
+ incognito: boolean;
+ /** Absolute URL. */
+ referrer: string;
+ /** Optional. Estimated time when the download will complete in ISO 8601 format. May be passed directly to the Date constructor: chrome.downloads.search({}, function(items){items.forEach(function(item){if (item.estimatedEndTime) console.log(new Date(item.estimatedEndTime))})}) */
+ estimatedEndTime?: string;
+ /** True if the download is in progress and paused, or else if it is interrupted and can be resumed starting from where it was interrupted. */
+ canResume: boolean;
+ /** Whether the downloaded file still exists. This information may be out of date because Chrome does not automatically watch for file removal. Call search() in order to trigger the check for file existence. When the existence check completes, if the file has been deleted, then an onChanged event will fire. Note that search() does not wait for the existence check to finish before returning, so results from search() may not accurately reflect the file system. Also, search() may be called as often as necessary, but will not check for file existence any more frequently than once every 10 seconds. */
+ exists: boolean;
+ /** Optional. The identifier for the extension that initiated this download if this download was initiated by an extension. Does not change once it is set. */
+ byExtensionId?: string;
+ /** Optional. The localized name of the extension that initiated this download if this download was initiated by an extension. May change if the extension changes its name or if the user changes their locale. */
+ byExtensionName?: string;
+ }
+
+ interface GetFileIconOptions {
+ /** Optional. * The size of the returned icon. The icon will be square with dimensions size * size pixels. The default and largest size for the icon is 32x32 pixels. The only supported sizes are 16 and 32. It is an error to specify any other size.
+ */
+ size?: number;
+ }
+
+ interface DownloadQuery {
+ /** Optional. Set elements of this array to DownloadItem properties in order to sort search results. For example, setting orderBy=['startTime'] sorts the DownloadItem by their start time in ascending order. To specify descending order, prefix with a hyphen: '-startTime'. */
+ orderBy?: string[];
+ /** Optional. Limits results to DownloadItem whose url matches the given regular expression. */
+ urlRegex?: string;
+ /** Optional. Limits results to DownloadItem that ended before the given ms since the epoch. */
+ endedBefore?: number;
+ /** Optional. Limits results to DownloadItem whose totalBytes is greater than the given integer. */
+ totalBytesGreater?: number;
+ /** Optional. Indication of whether this download is thought to be safe or known to be suspicious. */
+ danger?: string;
+ /** Optional. Number of bytes in the whole file, without considering file compression, or -1 if unknown. */
+ totalBytes?: number;
+ /** Optional. True if the download has stopped reading data from the host, but kept the connection open. */
+ paused?: boolean;
+ /** Optional. Limits results to DownloadItem whose filename matches the given regular expression. */
+ filenameRegex?: string;
+ /** Optional. This array of search terms limits results to DownloadItem whose filename or url contain all of the search terms that do not begin with a dash '-' and none of the search terms that do begin with a dash. */
+ query?: string[];
+ /** Optional. Limits results to DownloadItem whose totalBytes is less than the given integer. */
+ totalBytesLess?: number;
+ /** Optional. The id of the DownloadItem to query. */
+ id?: number;
+ /** Optional. Number of bytes received so far from the host, without considering file compression. */
+ bytesReceived?: number;
+ /** Optional. Limits results to DownloadItem that ended after the given ms since the epoch. */
+ endedAfter?: number;
+ /** Optional. Absolute local path. */
+ filename?: string;
+ /** Optional. Indicates whether the download is progressing, interrupted, or complete. */
+ state?: string;
+ /** Optional. Limits results to DownloadItem that started after the given ms since the epoch. */
+ startedAfter?: number;
+ /** Optional. The file's MIME type. */
+ mime?: string;
+ /** Optional. Number of bytes in the whole file post-decompression, or -1 if unknown. */
+ fileSize?: number;
+ /** Optional. The time when the download began in ISO 8601 format. */
+ startTime?: number;
+ /** Optional. Absolute URL. */
+ url?: string;
+ /** Optional. Limits results to DownloadItem that started before the given ms since the epoch. */
+ startedBefore?: number;
+ /** Optional. The maximum number of matching DownloadItem returned. Defaults to 1000. Set to 0 in order to return all matching DownloadItem. See search for how to page through results. */
+ limit?: number;
+ /** Optional. Why a download was interrupted. */
+ error?: number;
+ /** Optional. The time when the download ended in ISO 8601 format. */
+ endTime?: number;
+ /** Optional. Whether the downloaded file exists; */
+ exists?: boolean;
+ }
+
+ interface DownloadFilenameSuggestion {
+ /** The DownloadItem's new target DownloadItem.filename, as a path relative to the user's default Downloads directory, possibly containing subdirectories. Absolute paths, empty paths, and paths containing back-references ".." will be ignored. */
+ filename: string;
+ /** Optional. The action to take if filename already exists. */
+ conflictAction?: string;
+ }
+
+ interface DownloadChangedEvent extends chrome.events.Event<(downloadDelta: DownloadDelta) => void> {}
+
+ interface DownloadCreatedEvent extends chrome.events.Event<(downloadItem: DownloadItem) => void> {}
+
+ interface DownloadErasedEvent extends chrome.events.Event<(downloadId: number) => void> {}
+
+ interface DownloadDeterminingFilenameEvent extends chrome.events.Event<(downloadItem: DownloadItem, suggest: (suggestion?: DownloadFilenameSuggestion) => void) => void> {}
+
+ /**
+ * Find DownloadItem. Set query to the empty object to get all DownloadItem. To get a specific DownloadItem, set only the id field. To page through a large number of items, set orderBy: ['-startTime'], set limit to the number of items per page, and set startedAfter to the startTime of the last item from the last page.
+ * @param callback The callback parameter should be a function that looks like this:
+ * function(array of DownloadItem results) {...};
+ */
+ export function search(query: DownloadQuery, callback: (results: DownloadItem[]) => void): void;
+ /**
+ * Pause the download. If the request was successful the download is in a paused state. Otherwise runtime.lastError contains an error message. The request will fail if the download is not active.
+ * @param downloadId The id of the download to pause.
+ * @param callback Called when the pause request is completed.
+ * If you specify the callback parameter, it should be a function that looks like this:
+ * function() {...};
+ */
+ export function pause(downloadId: number, callback?: () => void): void;
+ /**
+ * Retrieve an icon for the specified download. For new downloads, file icons are available after the onCreated event has been received. The image returned by this function while a download is in progress may be different from the image returned after the download is complete. Icon retrieval is done by querying the underlying operating system or toolkit depending on the platform. The icon that is returned will therefore depend on a number of factors including state of the download, platform, registered file types and visual theme. If a file icon cannot be determined, runtime.lastError will contain an error message.
+ * @param downloadId The identifier for the download.
+ * @param callback A URL to an image that represents the download.
+ * The callback parameter should be a function that looks like this:
+ * function(string iconURL) {...};
+ */
+ export function getFileIcon(downloadId: number, callback: (iconURL: string) => void): void;
+ /**
+ * Retrieve an icon for the specified download. For new downloads, file icons are available after the onCreated event has been received. The image returned by this function while a download is in progress may be different from the image returned after the download is complete. Icon retrieval is done by querying the underlying operating system or toolkit depending on the platform. The icon that is returned will therefore depend on a number of factors including state of the download, platform, registered file types and visual theme. If a file icon cannot be determined, runtime.lastError will contain an error message.
+ * @param downloadId The identifier for the download.
+ * @param callback A URL to an image that represents the download.
+ * The callback parameter should be a function that looks like this:
+ * function(string iconURL) {...};
+ */
+ export function getFileIcon(downloadId: number, options: GetFileIconOptions, callback: (iconURL: string) => void): void;
+ /**
+ * Resume a paused download. If the request was successful the download is in progress and unpaused. Otherwise runtime.lastError contains an error message. The request will fail if the download is not active.
+ * @param downloadId The id of the download to resume.
+ * @param callback Called when the resume request is completed.
+ * If you specify the callback parameter, it should be a function that looks like this:
+ * function() {...};
+ */
+ export function resume(downloadId: number, callback?: () => void): void;
+ /**
+ * Cancel a download. When callback is run, the download is cancelled, completed, interrupted or doesn't exist anymore.
+ * @param downloadId The id of the download to cancel.
+ * @param callback Called when the cancel request is completed.
+ * If you specify the callback parameter, it should be a function that looks like this:
+ * function() {...};
+ */
+ export function cancel(downloadId: number, callback?: () => void): void;
+ /**
+ * Download a URL. If the URL uses the HTTP[S] protocol, then the request will include all cookies currently set for its hostname. If both filename and saveAs are specified, then the Save As dialog will be displayed, pre-populated with the specified filename. If the download started successfully, callback will be called with the new DownloadItem's downloadId. If there was an error starting the download, then callback will be called with downloadId=undefined and runtime.lastError will contain a descriptive string. The error strings are not guaranteed to remain backwards compatible between releases. Extensions must not parse it.
+ * @param options What to download and how.
+ * @param callback Called with the id of the new DownloadItem.
+ * If you specify the callback parameter, it should be a function that looks like this:
+ * function(integer downloadId) {...};
+ */
+ export function download(options: DownloadOptions, callback?: (downloadId: number) => void): void;
+ /**
+ * Open the downloaded file now if the DownloadItem is complete; otherwise returns an error through runtime.lastError. Requires the "downloads.open" permission in addition to the "downloads" permission. An onChanged event will fire when the item is opened for the first time.
+ * @param downloadId The identifier for the downloaded file.
+ */
+ export function open(downloadId: number): void;
+ /**
+ * Show the downloaded file in its folder in a file manager.
+ * @param downloadId The identifier for the downloaded file.
+ */
+ export function show(downloadId: number): void;
+ /** Show the default Downloads folder in a file manager. */
+ export function showDefaultFolder(): void;
+ /**
+ * Erase matching DownloadItem from history without deleting the downloaded file. An onErased event will fire for each DownloadItem that matches query, then callback will be called.
+ * @param callback If you specify the callback parameter, it should be a function that looks like this:
+ * function(array of integer erasedIds) {...};
+ */
+ export function erase(query: DownloadQuery, callback: (erasedIds: number[]) => void): void;
+ /**
+ * Remove the downloaded file if it exists and the DownloadItem is complete; otherwise return an error through runtime.lastError.
+ * @param callback If you specify the callback parameter, it should be a function that looks like this:
+ * function() {...};
+ */
+ export function removeFile(downloadId: number, callback?: () => void): void;
+ /**
+ * Prompt the user to accept a dangerous download. Can only be called from a visible context (tab, window, or page/browser action popup). Does not automatically accept dangerous downloads. If the download is accepted, then an onChanged event will fire, otherwise nothing will happen. When all the data is fetched into a temporary file and either the download is not dangerous or the danger has been accepted, then the temporary file is renamed to the target filename, the |state| changes to 'complete', and onChanged fires.
+ * @param downloadId The identifier for the DownloadItem.
+ * @param callback Called when the danger prompt dialog closes.
+ * If you specify the callback parameter, it should be a function that looks like this:
+ * function() {...};
+ */
+ export function acceptDanger(downloadId: number, callback: () => void): void;
+ /** Initiate dragging the downloaded file to another application. Call in a javascript ondragstart handler. */
+ export function drag(downloadId: number): void;
+ /** Enable or disable the gray shelf at the bottom of every window associated with the current browser profile. The shelf will be disabled as long as at least one extension has disabled it. Enabling the shelf while at least one other extension has disabled it will return an error through runtime.lastError. Requires the "downloads.shelf" permission in addition to the "downloads" permission. */
+ export function setShelfEnabled(enabled: boolean): void;
+
+ /** When any of a DownloadItem's properties except bytesReceived and estimatedEndTime changes, this event fires with the downloadId and an object containing the properties that changed. */
+ var onChanged: DownloadChangedEvent;
+ /** This event fires with the DownloadItem object when a download begins. */
+ var onCreated: DownloadCreatedEvent;
+ /** Fires with the downloadId when a download is erased from history. */
+ var onErased: DownloadErasedEvent;
+ /** During the filename determination process, extensions will be given the opportunity to override the target DownloadItem.filename. Each extension may not register more than one listener for this event. Each listener must call suggest exactly once, either synchronously or asynchronously. If the listener calls suggest asynchronously, then it must return true. If the listener neither calls suggest synchronously nor returns true, then suggest will be called automatically. The DownloadItem will not complete until all listeners have called suggest. Listeners may call suggest without any arguments in order to allow the download to use downloadItem.filename for its filename, or pass a suggestion object to suggest in order to override the target filename. If more than one extension overrides the filename, then the last extension installed whose listener passes a suggestion object to suggest wins. In order to avoid confusion regarding which extension will win, users should not install extensions that may conflict. If the download is initiated by download and the target filename is known before the MIME type and tentative filename have been determined, pass filename to download instead. */
+ var onDeterminingFilename: DownloadDeterminingFilenameEvent;
+}
+
+////////////////////
+// Enterprise Platform Keys
+////////////////////
+/**
+ * Use the chrome.enterprise.platformKeys API to generate hardware-backed keys and to install certificates for these keys. The certificates will be managed by the platform and can be used for TLS authentication, network access or by other extension through chrome.platformKeys.
+ * Availability: Since Chrome 37.
+ * Permissions: "enterprise.platformKeys"
+ * Important: This API works only on Chrome OS.
+ * Note: This API is only for extensions pre-installed by policy.
+ */
+declare namespace chrome.enterprise.platformKeys {
+ interface Token {
+ /**
+ * Uniquely identifies this Token.
+ * Static IDs are "user" and "system", referring to the platform's user-specific and the system-wide hardware token, respectively. Any other tokens (with other identifiers) might be returned by enterprise.platformKeys.getTokens.
+ */
+ id: string;
+ /**
+ * Implements the WebCrypto's SubtleCrypto interface. The cryptographic operations, including key generation, are hardware-backed.
+ * Only non-extractable RSASSA-PKCS1-V1_5 keys with modulusLength up to 2048 can be generated. Each key can be used for signing data at most once.
+ * Keys generated on a specific Token cannot be used with any other Tokens, nor can they be used with window.crypto.subtle. Equally, Key objects created with window.crypto.subtle cannot be used with this interface.
+ */
+ subtleCrypto: SubtleCrypto;
+ }
+
+ /**
+ * Returns the available Tokens. In a regular user's session the list will always contain the user's token with id "user". If a system-wide TPM token is available, the returned list will also contain the system-wide token with id "system". The system-wide token will be the same for all sessions on this device (device in the sense of e.g. a Chromebook).
+ * @param callback Invoked by getTokens with the list of available Tokens.
+ * The callback parameter should be a function that looks like this:
+ * function(array of Token tokens) {...};
+ * Parameter tokens: The list of available tokens.
+ */
+ export function getToken(callback: (tokens: Token[]) => void): void;
+ /**
+ * Returns the list of all client certificates available from the given token. Can be used to check for the existence and expiration of client certificates that are usable for a certain authentication.
+ * @param tokenId The id of a Token returned by getTokens.
+ * @param callback Called back with the list of the available certificates.
+ * The callback parameter should be a function that looks like this:
+ * function(array of ArrayBuffer certificates) {...};
+ * Parameter certificates: The list of certificates, each in DER encoding of a X.509 certificate.
+ */
+ export function getCertificates(tokenId: string, callback: (certificates: ArrayBuffer) => void): void;
+ /**
+ * Imports certificate to the given token if the certified key is already stored in this token. After a successful certification request, this function should be used to store the obtained certificate and to make it available to the operating system and browser for authentication.
+ * @param tokenId The id of a Token returned by getTokens.
+ * @param certificate The DER encoding of a X.509 certificate.
+ * @param callback Called back when this operation is finished.
+ * If you specify the callback parameter, it should be a function that looks like this:
+ * function() {...};
+ */
+ export function importCertificate(tokenId: string, certificate: ArrayBuffer, callback?: () => void): void;
+ /**
+ * Removes certificate from the given token if present. Should be used to remove obsolete certificates so that they are not considered during authentication and do not clutter the certificate choice. Should be used to free storage in the certificate store.
+ * @param tokenId The id of a Token returned by getTokens.
+ * @param certificate The DER encoding of a X.509 certificate.
+ * @param callback Called back when this operation is finished.
+ * If you specify the callback parameter, it should be a function that looks like this:
+ * function() {...};
+ */
+ export function removeCertificate(tokenId: string, certificate: ArrayBuffer, callback?: () => void): void;
+}
+
+////////////////////
+// Events
+////////////////////
+/**
+ * The chrome.events namespace contains common types used by APIs dispatching events to notify you when something interesting happens.
+ * Availability: Since Chrome 21.
+ */
+declare namespace chrome.events {
+ /** Filters URLs for various criteria. See event filtering. All criteria are case sensitive. */
+ interface UrlFilter {
+ /** Optional. Matches if the scheme of the URL is equal to any of the schemes specified in the array. */
+ schemes?: string[];
+ /**
+ * Optional.
+ * Since Chrome 23.
+ * Matches if the URL (without fragment identifier) matches a specified regular expression. Port numbers are stripped from the URL if they match the default port number. The regular expressions use the RE2 syntax.
+ */
+ urlMatches?: string;
+ /** Optional. Matches if the path segment of the URL contains a specified string. */
+ pathContains?: string;
+ /** Optional. Matches if the host name of the URL ends with a specified string. */
+ hostSuffix?: string;
+ /** Optional. Matches if the host name of the URL starts with a specified string. */
+ hostPrefix?: string;
+ /** Optional. Matches if the host name of the URL contains a specified string. To test whether a host name component has a prefix 'foo', use hostContains: '.foo'. This matches 'www.foobar.com' and 'foo.com', because an implicit dot is added at the beginning of the host name. Similarly, hostContains can be used to match against component suffix ('foo.') and to exactly match against components ('.foo.'). Suffix- and exact-matching for the last components need to be done separately using hostSuffix, because no implicit dot is added at the end of the host name. */
+ hostContains?: string;
+ /** Optional. Matches if the URL (without fragment identifier) contains a specified string. Port numbers are stripped from the URL if they match the default port number. */
+ urlContains?: string;
+ /** Optional. Matches if the query segment of the URL ends with a specified string. */
+ querySuffix?: string;
+ /** Optional. Matches if the URL (without fragment identifier) starts with a specified string. Port numbers are stripped from the URL if they match the default port number. */
+ urlPrefix?: string;
+ /** Optional. Matches if the host name of the URL is equal to a specified string. */
+ hostEquals?: string;
+ /** Optional. Matches if the URL (without fragment identifier) is equal to a specified string. Port numbers are stripped from the URL if they match the default port number. */
+ urlEquals?: string;
+ /** Optional. Matches if the query segment of the URL contains a specified string. */
+ queryContains?: string;
+ /** Optional. Matches if the path segment of the URL starts with a specified string. */
+ pathPrefix?: string;
+ /** Optional. Matches if the path segment of the URL is equal to a specified string. */
+ pathEquals?: string;
+ /** Optional. Matches if the path segment of the URL ends with a specified string. */
+ pathSuffix?: string;
+ /** Optional. Matches if the query segment of the URL is equal to a specified string. */
+ queryEquals?: string;
+ /** Optional. Matches if the query segment of the URL starts with a specified string. */
+ queryPrefix?: string;
+ /** Optional. Matches if the URL (without fragment identifier) ends with a specified string. Port numbers are stripped from the URL if they match the default port number. */
+ urlSuffix?: string;
+ /** Optional. Matches if the port of the URL is contained in any of the specified port lists. For example [80, 443, [1000, 1200]] matches all requests on port 80, 443 and in the range 1000-1200. */
+ ports?: any[];
+ /**
+ * Optional.
+ * Since Chrome 28.
+ * Matches if the URL without query segment and fragment identifier matches a specified regular expression. Port numbers are stripped from the URL if they match the default port number. The regular expressions use the RE2 syntax.
+ */
+ originAndPathMatches?: string;
+ }
+
+ /** An object which allows the addition and removal of listeners for a Chrome event. */
+ interface Event<T extends Function> {
+ /**
+ * Registers an event listener callback to an event.
+ * @param callback Called when an event occurs. The parameters of this function depend on the type of event.
+ * The callback parameter should be a function that looks like this:
+ * function() {...};
+ */
+ addListener(callback: T): void;
+ /**
+ * Returns currently registered rules.
+ * @param callback Called with registered rules.
+ * The callback parameter should be a function that looks like this:
+ * function(array of Rule rules) {...};
+ * Parameter rules: Rules that were registered, the optional parameters are filled with values.
+ */
+ getRules(callback: (rules: Rule[]) => void): void;
+ /**
+ * Returns currently registered rules.
+ * @param ruleIdentifiers If an array is passed, only rules with identifiers contained in this array are returned.
+ * @param callback Called with registered rules.
+ * The callback parameter should be a function that looks like this:
+ * function(array of Rule rules) {...};
+ * Parameter rules: Rules that were registered, the optional parameters are filled with values.
+ */
+ getRules(ruleIdentifiers: string[], callback: (rules: Rule[]) => void): void;
+ /**
+ * @param callback Listener whose registration status shall be tested.
+ */
+ hasListener(callback: T): boolean;
+ /**
+ * Unregisters currently registered rules.
+ * @param ruleIdentifiers If an array is passed, only rules with identifiers contained in this array are unregistered.
+ * @param callback Called when rules were unregistered.
+ * If you specify the callback parameter, it should be a function that looks like this:
+ * function() {...};
+ */
+ removeRules(ruleIdentifiers?: string[], callback?: () => void): void;
+ /**
+ * Unregisters currently registered rules.
+ * @param callback Called when rules were unregistered.
+ * If you specify the callback parameter, it should be a function that looks like this:
+ * function() {...};
+ */
+ removeRules(callback?: () => void): void;
+ /**
+ * Registers rules to handle events.
+ * @param rules Rules to be registered. These do not replace previously registered rules.
+ * @param callback Called with registered rules.
+ * If you specify the callback parameter, it should be a function that looks like this:
+ * function(array of Rule rules) {...};
+ * Parameter rules: Rules that were registered, the optional parameters are filled with values.
+ */
+ addRules(rules: Rule[], callback?: (rules: Rule[]) => void): void;
+ /**
+ * Deregisters an event listener callback from an event.
+ * @param callback Listener that shall be unregistered.
+ * The callback parameter should be a function that looks like this:
+ * function() {...};
+ */
+ removeListener(callback: T): void;
+ hasListeners(): boolean;
+ }
+
+ /** Description of a declarative rule for handling events. */
+ interface Rule {
+ /** Optional. Optional priority of this rule. Defaults to 100. */
+ priority?: number;
+ /** List of conditions that can trigger the actions. */
+ conditions: any[];
+ /** Optional. Optional identifier that allows referencing this rule. */
+ id?: string;
+ /** List of actions that are triggered if one of the condtions is fulfilled. */
+ actions: any[];
+ /**
+ * Optional.
+ * Since Chrome 28.
+ * Tags can be used to annotate rules and perform operations on sets of rules.
+ */
+ tags?: string[];
+ }
+}
+
+////////////////////
+// Extension
+////////////////////
+/**
+ * The chrome.extension API has utilities that can be used by any extension page. It includes support for exchanging messages between an extension and its content scripts or between extensions, as described in detail in Message Passing.
+ * Availability: Since Chrome 5.
+ */
+declare namespace chrome.extension {
+ interface FetchProperties {
+ /** Optional. The window to restrict the search to. If omitted, returns all views. */
+ windowId?: number;
+ /** Optional. The type of view to get. If omitted, returns all views (including background pages and tabs). Valid values: 'tab', 'notification', 'popup'. */
+ type?: string;
+ }
+
+ interface LastError {
+ /** Description of the error that has taken place. */
+ message: string;
+ }
+
+ interface OnRequestEvent extends chrome.events.Event<((request: any, sender: runtime.MessageSender, sendResponse: (response: any) => void) => void) | ((sender: runtime.MessageSender, sendResponse: (response: any) => void) => void)> {}
+
+ /**
+ * Since Chrome 7.
+ * True for content scripts running inside incognito tabs, and for extension pages running inside an incognito process. The latter only applies to extensions with 'split' incognito_behavior.
+ */
+ var inIncognitoContext: boolean;
+ /** Set for the lifetime of a callback if an ansychronous extension api has resulted in an error. If no error has occured lastError will be undefined. */
+ var lastError: LastError;
+
+ /** Returns the JavaScript 'window' object for the background page running inside the current extension. Returns null if the extension has no background page. */
+ export function getBackgroundPage(): Window;
+ /**
+ * Converts a relative path within an extension install directory to a fully-qualified URL.
+ * @param path A path to a resource within an extension expressed relative to its install directory.
+ */
+ export function getURL(path: string): string;
+ /**
+ * Sets the value of the ap CGI parameter used in the extension's update URL. This value is ignored for extensions that are hosted in the Chrome Extension Gallery.
+ * Since Chrome 9.
+ */
+ export function setUpdateUrlData(data: string): void;
+ /** Returns an array of the JavaScript 'window' objects for each of the pages running inside the current extension. */
+ export function getViews(fetchProperties?: FetchProperties): Window[];
+ /**
+ * Retrieves the state of the extension's access to the 'file://' scheme (as determined by the user-controlled 'Allow access to File URLs' checkbox.
+ * Since Chrome 12.
+ * @param callback The callback parameter should be a function that looks like this:
+ * function(boolean isAllowedAccess) {...};
+ * Parameter isAllowedAccess: True if the extension can access the 'file://' scheme, false otherwise.
+ */
+ export function isAllowedFileSchemeAccess(callback: (isAllowedAccess: boolean) => void): void;
+ /**
+ * Retrieves the state of the extension's access to Incognito-mode (as determined by the user-controlled 'Allowed in Incognito' checkbox.
+ * Since Chrome 12.
+ * @param callback The callback parameter should be a function that looks like this:
+ * function(boolean isAllowedAccess) {...};
+ * Parameter isAllowedAccess: True if the extension has access to Incognito mode, false otherwise.
+ */
+ export function isAllowedIncognitoAccess(callback: (isAllowedAccess: boolean) => void): void;
+ /**
+ * Sends a single request to other listeners within the extension. Similar to runtime.connect, but only sends a single request with an optional response. The extension.onRequest event is fired in each page of the extension.
+ * @deprecated Deprecated since Chrome 33. Please use runtime.sendMessage.
+ * @param extensionId The extension ID of the extension you want to connect to. If omitted, default is your own extension.
+ * @param responseCallback If you specify the responseCallback parameter, it should be a function that looks like this:
+ * function(any response) {...};
+ * Parameter response: The JSON response object sent by the handler of the request. If an error occurs while connecting to the extension, the callback will be called with no arguments and runtime.lastError will be set to the error message.
+ */
+ export function sendRequest(extensionId: string, request: any, responseCallback?: (response: any) => void): void;
+ /**
+ * Sends a single request to other listeners within the extension. Similar to runtime.connect, but only sends a single request with an optional response. The extension.onRequest event is fired in each page of the extension.
+ * @deprecated Deprecated since Chrome 33. Please use runtime.sendMessage.
+ * @param responseCallback If you specify the responseCallback parameter, it should be a function that looks like this:
+ * function(any response) {...};
+ * Parameter response: The JSON response object sent by the handler of the request. If an error occurs while connecting to the extension, the callback will be called with no arguments and runtime.lastError will be set to the error message.
+ */
+ export function sendRequest(request: any, responseCallback?: (response: any) => void): void;
+ /**
+ * Returns an array of the JavaScript 'window' objects for each of the tabs running inside the current extension. If windowId is specified, returns only the 'window' objects of tabs attached to the specified window.
+ * @deprecated Deprecated since Chrome 33. Please use extension.getViews {type: "tab"}.
+ */
+ export function getExtensionTabs(windowId?: number): Window[];
+
+ /**
+ * Fired when a request is sent from either an extension process or a content script.
+ * @deprecated Deprecated since Chrome 33. Please use runtime.onMessage.
+ */
+ var onRequest: OnRequestEvent;
+ /**
+ * Fired when a request is sent from another extension.
+ * @deprecated Deprecated since Chrome 33. Please use runtime.onMessageExternal.
+ */
+ var onRequestExternal: OnRequestEvent;
+}
+
+////////////////////
+// File Browser Handler
+////////////////////
+/**
+ * Use the chrome.fileBrowserHandler API to extend the Chrome OS file browser. For example, you can use this API to enable users to upload files to your website.
+ * Availability: Since Chrome 12.
+ * Permissions: "fileBrowserHandler"
+ * Important: This API works only on Chrome OS.
+ */
+declare namespace chrome.fileBrowserHandler {
+ interface SelectionParams {
+ /**
+ * Optional.
+ * List of file extensions that the selected file can have. The list is also used to specify what files to be shown in the select file dialog. Files with the listed extensions are only shown in the dialog. Extensions should not include the leading '.'. Example: ['jpg', 'png']
+ * Since Chrome 23.
+ */
+ allowedFileExtensions?: string[];
+ /** Suggested name for the file. */
+ suggestedName: string;
+ }
+
+ interface SelectionResult {
+ /** Optional. Selected file entry. It will be null if a file hasn't been selected. */
+ entry?: Object;
+ /** Whether the file has been selected. */
+ success: boolean;
+ }
+
+ /** Event details payload for fileBrowserHandler.onExecute event. */
+ interface FileHandlerExecuteEventDetails {
+ /** Optional. The ID of the tab that raised this event. Tab IDs are unique within a browser session. */
+ tab_id?: number;
+ /** Array of Entry instances representing files that are targets of this action (selected in ChromeOS file browser). */
+ entries: any[];
+ }
+
+ interface FileBrowserHandlerExecuteEvent extends chrome.events.Event<(id: string, details: FileHandlerExecuteEventDetails) => void> {}
+
+ /**
+ * Prompts user to select file path under which file should be saved. When the file is selected, file access permission required to use the file (read, write and create) are granted to the caller. The file will not actually get created during the function call, so function caller must ensure its existence before using it. The function has to be invoked with a user gesture.
+ * Since Chrome 21.
+ * @param selectionParams Parameters that will be used while selecting the file.
+ * @param callback Function called upon completion.
+ * The callback parameter should be a function that looks like this:
+ * function(object result) {...};
+ * Parameter result: Result of the method.
+ */
+ export function selectFile(selectionParams: SelectionParams, callback: (result: SelectionResult) => void): void;
+
+ /** Fired when file system action is executed from ChromeOS file browser. */
+ var onExecute: FileBrowserHandlerExecuteEvent;
+}
+
+////////////////////
+// File System Provider
+////////////////////
+/**
+ * Use the chrome.fileSystemProvider API to create file systems, that can be accessible from the file manager on Chrome OS.
+ * Availability: Since Chrome 40.
+ * Permissions: "fileSystemProvider"
+ * Important: This API works only on Chrome OS.
+ */
+declare namespace chrome.fileSystemProvider {
+ interface OpenedFileInfo {
+ /** A request ID to be be used by consecutive read/write and close requests. */
+ openRequestId: number;
+ /** The path of the opened file. */
+ filePath: string;
+ /** Whether the file was opened for reading or writing. */
+ mode: string;
+ }
+
+ interface FileWatchersInfo {
+ /** The path of the entry being observed. */
+ entryPath: string;
+ /** Whether watching should include all child entries recursively. It can be true for directories only. */
+ recursive: boolean;
+ /** Optional. Tag used by the last notification for the watcher. */
+ lastTag?: string;
+ }
+
+ interface EntryMetadata {
+ /** True if it is a directory. */
+ isDirectory: boolean;
+ /** Name of this entry (not full path name). Must not contain '/'. For root it must be empty. */
+ name: string;
+ /** File size in bytes. */
+ size: number;
+ /** The last modified time of this entry. */
+ modificationTime: Date;
+ /** Optional. Mime type for the entry. */
+ mimeType?: string;
+ /** Optional. Thumbnail image as a data URI in either PNG, JPEG or WEBP format, at most 32 KB in size. Optional, but can be provided only when explicitly requested by the onGetMetadataRequested event. */
+ thumbnail?: string;
+ }
+
+ interface FileSystemInfo {
+ /** The identifier of the file system. */
+ fileSystemId: string;
+ /** A human-readable name for the file system. */
+ displayName: string;
+ /** Whether the file system supports operations which may change contents of the file system (such as creating, deleting or writing to files). */
+ writable: boolean;
+ /**
+ * The maximum number of files that can be opened at once. If 0, then not limited.
+ * @since Since Chrome 42.
+ */
+ openedFilesLimit: number;
+ /**
+ * List of currently opened files.
+ * @since Since Chrome 42.
+ */
+ openedFiles: OpenedFileInfo[];
+ /**
+ * Optional.
+ * Whether the file system supports the tag field for observing directories.
+ * @since Since Chrome 45. Warning: this is the current Beta channel.
+ */
+ supportsNotifyTag?: boolean;
+ /**
+ * List of watchers.
+ * @since Since Chrome 45. Warning: this is the current Beta channel.
+ */
+ watchers: FileWatchersInfo[];
+ }
+
+ /** @since Since Chrome 45. Warning: this is the current Beta channel. */
+ interface GetActionsRequestedOptions {
+ /** The identifier of the file system related to this operation. */
+ fileSystemId: string;
+ /** The unique identifier of this request. */
+ requestId: number;
+ /** The path of the entry to return the list of actions for. */
+ entryPath: string;
+ }
+
+ /** @since Since Chrome 45. Warning: this is the current Beta channel. */
+ interface Action {
+ /** The identifier of the action. Any string or CommonActionId for common actions. */
+ id: string;
+ /** Optional. The title of the action. It may be ignored for common actions. */
+ title?: string;
+ }
+
+ /** @since Since Chrome 45. Warning: this is the current Beta channel. */
+ interface ExecuteActionRequestedOptions {
+ /** The identifier of the file system related to this operation. */
+ fileSystemId: string;
+ /** The unique identifier of this request. */
+ requestId: number;
+ /** The path of the entry to be used for the action. */
+ entryPath: string;
+ /** The identifier of the action to be executed. */
+ actionId: string;
+ }
+
+ interface MountOptions {
+ /** The string indentifier of the file system. Must be unique per each extension. */
+ fileSystemId: string;
+ /** A human-readable name for the file system. */
+ displayName: string;
+ /** Optional. Whether the file system supports operations which may change contents of the file system (such as creating, deleting or writing to files). */
+ writable?: boolean;
+ /**
+ * Optional.
+ * The maximum number of files that can be opened at once. If not specified, or 0, then not limited.
+ * @since Since Chrome 41.
+ */
+ openedFilesLimit?: number;
+ /**
+ * Optional.
+ * Whether the file system supports the tag field for observed directories.
+ * @since Since Chrome 45. Warning: this is the current Beta channel.
+ */
+ supportsNotifyTag?: boolean;
+ }
+
+ interface UnmountOptions {
+ /** The identifier of the file system to be unmounted. */
+ fileSystemId: string;
+ }
+
+ interface NotificationChange {
+ /** The path of the changed entry. */
+ entryPath: string;
+ /** The type of the change which happened to the entry. */
+ changeType: string;
+ }
+
+ interface NotificationOptions {
+ /** The identifier of the file system related to this change. */
+ fileSystemId: string;
+ /** The path of the observed entry. */
+ observedPath: string;
+ /** Mode of the observed entry. */
+ recursive: boolean;
+ /** The type of the change which happened to the observed entry. If it is DELETED, then the observed entry will be automatically removed from the list of observed entries. */
+ changeType: string;
+ /** Optional. List of changes to entries within the observed directory (including the entry itself) */
+ changes?: NotificationChange[];
+ /** Optional. Tag for the notification. Required if the file system was mounted with the supportsNotifyTag option. Note, that this flag is necessary to provide notifications about changes which changed even when the system was shutdown. */
+ tag?: string;
+ }
+
+ interface RequestedEventOptions {
+ /** The identifier of the file system related to this operation. */
+ fileSystemId: string;
+ /** The unique identifier of this request. */
+ requestId: number;
+ }
+
+ interface EntryPathRequestedEventOptions extends RequestedEventOptions {
+ /** The path of the entry to which this operation is related to. */
+ entryPath: string;
+ }
+
+ interface MetadataRequestedEventOptions extends EntryPathRequestedEventOptions {
+ /** Set to true if the thumbnail is requested. */
+ thumbnail: boolean;
+ }
+
+ interface DirectoryPathRequestedEventOptions extends RequestedEventOptions {
+ /** The path of the directory which is to be operated on. */
+ directoryPath: string;
+ }
+
+ interface FilePathRequestedEventOptions extends RequestedEventOptions {
+ /** The path of the entry for the operation */
+ filePath: string;
+ }
+
+ interface OpenFileRequestedEventOptions extends FilePathRequestedEventOptions {
+ /** Whether the file will be used for reading or writing. */
+ mode: string;
+ }
+
+ interface OpenedFileRequestedEventOptions extends RequestedEventOptions {
+ /** A request ID used to open the file. */
+ openRequestId: number;
+ }
+
+ interface OpenedFileOffsetRequestedEventOptions extends OpenedFileRequestedEventOptions {
+ /** Position in the file (in bytes) to start reading from. */
+ offset: number;
+ /** Number of bytes to be returned. */
+ length: number;
+ }
+
+ interface DirectoryPathRecursiveRequestedEventOptions extends DirectoryPathRequestedEventOptions {
+ /** Whether the operation is recursive (for directories only). */
+ recursive: boolean;
+ }
+
+ interface EntryPathRecursiveRequestedEventOptions extends EntryPathRequestedEventOptions {
+ /** Whether the operation is recursive (for directories only). */
+ recursive: boolean;
+ }
+
+ interface SourceTargetPathRequestedEventOptions extends RequestedEventOptions {
+ /** The source path for the operation. */
+ sourcePath: string;
+ /** The destination path for the operation. */
+ targetPath: string;
+ }
+
+ interface FilePathLengthRequestedEventOptions extends FilePathRequestedEventOptions {
+ /** Number of bytes to be retained after the operation completes. */
+ length: number;
+ }
+
+ interface OpenedFileIoRequestedEventOptions extends OpenedFileRequestedEventOptions {
+ /** Position in the file (in bytes) to start operating from. */
+ offset: number;
+ /** Buffer of bytes to be operated on the file. */
+ data: ArrayBuffer;
+ }
+
+ interface OperationRequestedEventOptions extends RequestedEventOptions {
+ /** An ID of the request to which this operation is related. */
+ operationRequestId: number;
+ }
+
+ interface RequestedEvent extends chrome.events.Event<(options: RequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> {}
+
+ interface MetadataRequestedEvent extends chrome.events.Event<(options: MetadataRequestedEventOptions, successCallback: (metadata: EntryMetadata) => void, errorCallback: (error: string) => void) => void> {}
+
+ interface DirectoryPathRequestedEvent extends chrome.events.Event<(options: DirectoryPathRequestedEventOptions, successCallback: (entries: EntryMetadata[], hasMore: boolean) => void, errorCallback: (error: string) => void) => void> {}
+
+ interface OpenFileRequestedEvent extends chrome.events.Event<(options: OpenFileRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> {}
+
+ interface OpenedFileRequestedEvent extends chrome.events.Event<(options: OpenedFileRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> {}
+
+ interface OpenedFileOffsetRequestedEvent extends chrome.events.Event<(options: OpenedFileOffsetRequestedEventOptions, successCallback: (data: ArrayBuffer, hasMore: boolean) => void, errorCallback: (error: string) => void) => void> {}
+
+ interface DirectoryPathRecursiveRequestedEvent extends chrome.events.Event<(options: DirectoryPathRecursiveRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> {}
+
+ interface EntryPathRecursiveRequestedEvent extends chrome.events.Event<(options: EntryPathRecursiveRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> {}
+
+ interface FilePathRequestedEvent extends chrome.events.Event<(options: FilePathRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> {}
+
+ interface SourceTargetPathRequestedEvent extends chrome.events.Event<(options: SourceTargetPathRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> {}
+
+ interface FilePathLengthRequestedEvent extends chrome.events.Event<(options: FilePathLengthRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> {}
+
+ interface OpenedFileIoRequestedEvent extends chrome.events.Event<(options: OpenedFileIoRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> {}
+
+ interface OperationRequestedEvent extends chrome.events.Event<(options: OperationRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> {}
+
+ interface OptionlessRequestedEvent extends chrome.events.Event<(successCallback: Function, errorCallback: (error: string) => void) => void> {}
+
+ /**
+ * Mounts a file system with the given fileSystemId and displayName. displayName will be shown in the left panel of Files.app. displayName can contain any characters including '/', but cannot be an empty string. displayName must be descriptive but doesn't have to be unique. The fileSystemId must not be an empty string.
+ * Depending on the type of the file system being mounted, the source option must be set appropriately.
+ * In case of an error, runtime.lastError will be set with a corresponding error code.
+ * @param callback A generic result callback to indicate success or failure.
+ * If you specify the callback parameter, it should be a function that looks like this:
+ * function() {...};
+ */
+ export function mount(options: MountOptions, callback?: () => void): void;
+ /**
+ * Unmounts a file system with the given fileSystemId. It must be called after onUnmountRequested is invoked. Also, the providing extension can decide to perform unmounting if not requested (eg. in case of lost connection, or a file error).
+ * In case of an error, runtime.lastError will be set with a corresponding error code.
+ * @param callback A generic result callback to indicate success or failure.
+ * If you specify the callback parameter, it should be a function that looks like this:
+ * function() {...};
+ */
+ export function unmount(options: UnmountOptions, callback?: () => void): void;
+ /**
+ * Returns all file systems mounted by the extension.
+ * @param callback Callback to receive the result of getAll function.
+ * The callback parameter should be a function that looks like this:
+ * function(array of FileSystemInfo fileSystems) {...};
+ */
+ export function getAll(callback: (fileSystems: FileSystemInfo[]) => void): void;
+ /**
+ * Returns information about a file system with the passed fileSystemId.
+ * @since Since Chrome 42.
+ * @param callback Callback to receive the result of get function.
+ * The callback parameter should be a function that looks like this:
+ * function(FileSystemInfo fileSystem) {...};
+ */
+ export function get(fileSystemId: string, callback: (fileSystem: FileSystemInfo) => void): void;
+ /**
+ * Notifies about changes in the watched directory at observedPath in recursive mode. If the file system is mounted with supportsNofityTag, then tag must be provided, and all changes since the last notification always reported, even if the system was shutdown. The last tag can be obtained with getAll.
+ * To use, the file_system_provider.notify manifest option must be set to true.
+ * Value of tag can be any string which is unique per call, so it's possible to identify the last registered notification. Eg. if the providing extension starts after a reboot, and the last registered notification's tag is equal to "123", then it should call notify for all changes which happened since the change tagged as "123". It cannot be an empty string.
+ * Not all providers are able to provide a tag, but if the file system has a changelog, then the tag can be eg. a change number, or a revision number.
+ * Note that if a parent directory is removed, then all descendant entries are also removed, and if they are watched, then the API must be notified about the fact. Also, if a directory is renamed, then all descendant entries are in fact removed, as there is no entry under their original paths anymore.
+ * In case of an error, runtime.lastError will be set will a corresponding error code.
+ * @param callback A generic result callback to indicate success or failure.
+ * If you specify the callback parameter, it should be a function that looks like this:
+ * function() {...};
+ */
+ export function notify(options: NotificationOptions, callback: () => void): void;
+
+ /** Raised when unmounting for the file system with the fileSystemId identifier is requested. In the response, the unmount API method must be called together with successCallback. If unmounting is not possible (eg. due to a pending operation), then errorCallback must be called. */
+ var onUnmountRequested: RequestedEvent;
+ /** Raised when metadata of a file or a directory at entryPath is requested. The metadata must be returned with the successCallback call. In case of an error, errorCallback must be called. */
+ var onGetMetadataRequested: MetadataRequestedEvent;
+ /** Raised when contents of a directory at directoryPath are requested. The results must be returned in chunks by calling the successCallback several times. In case of an error, errorCallback must be called. */
+ var onReadDirectoryRequested: DirectoryPathRequestedEvent;
+ /** Raised when opening a file at filePath is requested. If the file does not exist, then the operation must fail. Maximum number of files opened at once can be specified with MountOptions. */
+ var onOpenFileRequested: OpenFileRequestedEvent;
+ /** Raised when opening a file previously opened with openRequestId is requested to be closed. */
+ var onCloseFileRequested: OpenedFileRequestedEvent;
+ /** Raised when reading contents of a file opened previously with openRequestId is requested. The results must be returned in chunks by calling successCallback several times. In case of an error, errorCallback must be called. */
+ var onReadFileRequested: OpenedFileOffsetRequestedEvent;
+ /** Raised when creating a directory is requested. The operation must fail with the EXISTS error if the target directory already exists. If recursive is true, then all of the missing directories on the directory path must be created. */
+ var onCreateDirectoryRequested: DirectoryPathRecursiveRequestedEvent;
+ /** Raised when deleting an entry is requested. If recursive is true, and the entry is a directory, then all of the entries inside must be recursively deleted as well. */
+ var onDeleteEntryRequested: EntryPathRecursiveRequestedEvent;
+ /** Raised when creating a file is requested. If the file already exists, then errorCallback must be called with the "EXISTS" error code. */
+ var onCreateFileRequested: FilePathRequestedEvent;
+ /** Raised when copying an entry (recursively if a directory) is requested. If an error occurs, then errorCallback must be called. */
+ var onCopyEntryRequested: SourceTargetPathRequestedEvent;
+ /** Raised when moving an entry (recursively if a directory) is requested. If an error occurs, then errorCallback must be called. */
+ var onMoveEntryRequested: SourceTargetPathRequestedEvent;
+ /** Raised when truncating a file to a desired length is requested. If an error occurs, then errorCallback must be called. */
+ var onTruncateRequested: FilePathLengthRequestedEvent;
+ /** Raised when writing contents to a file opened previously with openRequestId is requested. */
+ var onWriteFileRequested: OpenedFileIoRequestedEvent;
+ /** Raised when aborting an operation with operationRequestId is requested. The operation executed with operationRequestId must be immediately stopped and successCallback of this abort request executed. If aborting fails, then errorCallback must be called. Note, that callbacks of the aborted operation must not be called, as they will be ignored. Despite calling errorCallback, the request may be forcibly aborted. */
+ var onAbortRequested: OperationRequestedEvent;
+ /**
+ * Raised when showing a configuration dialog for fileSystemId is requested. If it's handled, the file_system_provider.configurable manfiest option must be set to true.
+ * @since Since Chrome 44.
+ */
+ var onConfigureRequested: RequestedEvent;
+ /**
+ * Raised when showing a dialog for mounting a new file system is requested. If the extension/app is a file handler, then this event shouldn't be handled. Instead app.runtime.onLaunched should be handled in order to mount new file systems when a file is opened. For multiple mounts, the file_system_provider.multiple_mounts manifest option must be set to true.
+ * @since Since Chrome 44.
+ */
+ var onMountRequested: OptionlessRequestedEvent;
+ /**
+ * Raised when setting a new directory watcher is requested. If an error occurs, then errorCallback must be called.
+ * @since Since Chrome 45. Warning: this is the current Beta channel.
+ */
+ var onAddWatcherRequested: EntryPathRecursiveRequestedEvent;
+ /**
+ * Raised when the watcher should be removed. If an error occurs, then errorCallback must be called.
+ * @since Since Chrome 45. Warning: this is the current Beta channel.
+ */
+ var onRemoveWatcherRequested: EntryPathRecursiveRequestedEvent;
+}
+
+////////////////////
+// Font Settings
+////////////////////
+/**
+ * Use the chrome.fontSettings API to manage Chrome's font settings.
+ * Availability: Since Chrome 22.
+ * Permissions: "fontSettings"
+ */
+declare namespace chrome.fontSettings {
+ /** Represents a font name. */
+ interface FontName {
+ /** The display name of the font. */
+ displayName: string;
+ /** The font ID. */
+ fontId: string;
+ }
+
+ interface DefaultFontSizeDetails {
+ /** The font size in pixels. */
+ pixelSize: number;
+ }
+
+ interface FontDetails {
+ /** The generic font family for the font. */
+ genericFamily: string;
+ /** Optional. The script for the font. If omitted, the global script font setting is affected. */
+ script?: string;
+ }
+
+ interface FullFontDetails {
+ /** The generic font family for which the font setting has changed. */
+ genericFamily: string;
+ /** The level of control this extension has over the setting. */
+ levelOfControl: string;
+ /** Optional. The script code for which the font setting has changed. */
+ script?: string;
+ /** The font ID. See the description in getFont. */
+ fontId: string;
+ }
+
+ interface FontDetailsResult {
+ /** The level of control this extension has over the setting. */
+ levelOfControl: string;
+ /** The font ID. Rather than the literal font ID preference value, this may be the ID of the font that the system resolves the preference value to. So, fontId can differ from the font passed to setFont, if, for example, the font is not available on the system. The empty string signifies fallback to the global script font setting. */
+ fontId: string;
+ }
+
+ interface FontSizeDetails {
+ /** The font size in pixels. */
+ pixelSize: number;
+ /** The level of control this extension has over the setting. */
+ levelOfControl: string;
+ }
+
+ interface SetFontSizeDetails {
+ /** The font size in pixels. */
+ pixelSize: number;
+ }
+
+ interface SetFontDetails extends FontDetails {
+ /** The font ID. The empty string means to fallback to the global script font setting. */
+ fontId: string;
+ }
+
+ interface DefaultFixedFontSizeChangedEvent extends chrome.events.Event<(details: FontSizeDetails) => void> {}
+
+ interface DefaultFontSizeChangedEvent extends chrome.events.Event<(details: FontSizeDetails) => void> {}
+
+ interface MinimumFontSizeChangedEvent extends chrome.events.Event<(details: FontSizeDetails) => void> {}
+
+ interface FontChangedEvent extends chrome.events.Event<(details: FullFontDetails) => void> {}
+
+ /**
+ * Sets the default font size.
+ * @param callback If you specify the callback parameter, it should be a function that looks like this:
+ * function() {...};
+ */
+ export function setDefaultFontSize(details: DefaultFontSizeDetails, callback?: Function): void;
+ /**
+ * Gets the font for a given script and generic font family.
+ * @param callback If you specify the callback parameter, it should be a function that looks like this:
+ * function(object details) {...};
+ */
+ export function getFont(details: FontDetails, callback?: (details: FontDetailsResult) => void): void;
+ /**
+ * Gets the default font size.
+ * @param details This parameter is currently unused.
+ * @param callback If you specify the callback parameter, it should be a function that looks like this:
+ * function(object details) {...};
+ */
+ export function getDefaultFontSize(details?: Object, callback?: (options: FontSizeDetails) => void): void;
+ /**
+ * Gets the minimum font size.
+ * @param details This parameter is currently unused.
+ * @param callback If you specify the callback parameter, it should be a function that looks like this:
+ * function(object details) {...};
+ */
+ export function getMinimumFontSize(details?: FontSizeDetails, callback?: (options: FontSizeDetails) => void): void;
+ /**
+ * Sets the minimum font size.
+ * @param callback If you specify the callback parameter, it should be a function that looks like this:
+ * function() {...};
+ */
+ export function setMinimumFontSize(details: SetFontSizeDetails, callback?: Function): void;
+ /**
+ * Gets the default size for fixed width fonts.
+ * @param details This parameter is currently unused.
+ * @param callback If you specify the callback parameter, it should be a function that looks like this:
+ * function(object details) {...};
+ */
+ export function getDefaultFixedFontSize(details?: Object, callback?: (details: FontSizeDetails) => void): void;
+ /**
+ * Clears the default font size set by this extension, if any.
+ * @param details This parameter is currently unused.
+ * @param callback If you specify the callback parameter, it should be a function that looks like this:
+ * function() {...};
+ */
+ export function clearDefaultFontSize(details?: Object, callback?: Function): void;
+ /**
+ * Sets the default size for fixed width fonts.
+ * @param callback If you specify the callback parameter, it should be a function that looks like this:
+ * function() {...};
+ */
+ export function setDefaultFixedFontSize(details: SetFontSizeDetails, callback?: Function): void;
+ /**
+ * Clears the font set by this extension, if any.
+ * @param callback If you specify the callback parameter, it should be a function that looks like this:
+ * function() {...};
+ */
+ export function clearFont(details: FontDetails, callback?: Function): void;
+ /**
+ * Sets the font for a given script and generic font family.
+ * @param callback If you specify the callback parameter, it should be a function that looks like this:
+ * function(object details) {...};
+ */
+ export function setFont(details: SetFontDetails, callback?: Function): void;
+ /**
+ * Clears the minimum font size set by this extension, if any.
+ * @param details This parameter is currently unused.
+ * @param callback If you specify the callback parameter, it should be a function that looks like this:
+ * function() {...};
+ */
+ export function clearMinimumFontSize(details?: Object, callback?: Function): void;
+ /**
+ * Gets a list of fonts on the system.
+ * @param callback The callback parameter should be a function that looks like this:
+ * function(array of FontName results) {...};
+ */
+ export function getFontList(callback: (results: FontName[]) => void): void;
+ /**
+ * Clears the default fixed font size set by this extension, if any.
+ * @param details This parameter is currently unused.
+ * @param callback If you specify the callback parameter, it should be a function that looks like this:
+ * function() {...};
+ */
+ export function clearDefaultFixedFontSize(details: Object, callback?: Function): void;
+
+ /** Fired when the default fixed font size setting changes. */
+ var onDefaultFixedFontSizeChanged: DefaultFixedFontSizeChangedEvent;
+ /** Fired when the default font size setting changes. */
+ var onDefaultFontSizeChanged: DefaultFontSizeChangedEvent;
+ /** Fired when the minimum font size setting changes. */
+ var onMinimumFontSizeChanged: MinimumFontSizeChangedEvent;
+ /** Fired when a font setting changes. */
+ var onFontChanged: FontChangedEvent;
+}
+
+////////////////////
+// Google Cloud Messaging
+////////////////////
+/**
+ * Use chrome.gcm to enable apps and extensions to send and receive messages through the Google Cloud Messaging Service.
+ * Availability: Since Chrome 35.
+ * Permissions: "gcm"
+ */
+declare namespace chrome.gcm {
+ interface OutgoingMessage {
+ /** The ID of the server to send the message to as assigned by Google API Console. */
+ destinationId: string;
+ /** The ID of the message. It must be unique for each message in scope of the applications. See the Cloud Messaging documentation for advice for picking and handling an ID. */
+ messageId: string;
+ /** Optional. Time-to-live of the message in seconds. If it is not possible to send the message within that time, an onSendError event will be raised. A time-to-live of 0 indicates that the message should be sent immediately or fail if it's not possible. The maximum and a default value of time-to-live is 86400 seconds (1 day). */
+ timeToLive?: number;
+ /** Message data to send to the server. Case-insensitive goog. and google, as well as case-sensitive collapse_key are disallowed as key prefixes. Sum of all key/value pairs should not exceed gcm.MAX_MESSAGE_SIZE. */
+ data: Object;
+ }
+
+ interface IncomingMessage {
+ /** The message data. */
+ data: Object;
+ /**
+ * Optional.
+ * The sender who issued the message.
+ * @since Since Chrome 41.
+ */
+ from?: string;
+ /**
+ * Optional.
+ * The collapse key of a message. See Collapsible Messages section of Cloud Messaging documentation for details.
+ */
+ collapseKey?: string;
+ }
+
+ interface GcmError {
+ /** The error message describing the problem. */
+ errorMessage: string;
+ /** Optional. The ID of the message with this error, if error is related to a specific message. */
+ messageId?: string;
+ /** Additional details related to the error, when available. */
+ detail: Object;
+ }
+
+ interface MessageReceptionEvent extends chrome.events.Event<(message: IncomingMessage) => void> {}
+
+ interface MessageDeletionEvent extends chrome.events.Event<() => void> {}
+
+ interface GcmErrorEvent extends chrome.events.Event<(error: GcmError) => void> {}
+
+ /** The maximum size (in bytes) of all key/value pairs in a message. */
+ var MAX_MESSAGE_SIZE: number;
+
+ /**
+ * Registers the application with GCM. The registration ID will be returned by the callback. If register is called again with the same list of senderIds, the same registration ID will be returned.
+ * @param senderIds A list of server IDs that are allowed to send messages to the application. It should contain at least one and no more than 100 sender IDs.
+ * @param callback Function called when registration completes. It should check runtime.lastError for error when registrationId is empty.
+ * The callback parameter should be a function that looks like this:
+ * function(string registrationId) {...};
+ * Parameter registrationId: A registration ID assigned to the application by the GCM.
+ */
+ export function register(senderIds: string[], callback: (registrationId: string) => void): void;
+ /**
+ * Unregisters the application from GCM.
+ * @param callback A function called after the unregistration completes. Unregistration was successful if runtime.lastError is not set.
+ * The callback parameter should be a function that looks like this:
+ * function() {...};
+ */
+ export function unregister(callback: () => void): void;
+ /**
+ * Sends a message according to its contents.
+ * @param message A message to send to the other party via GCM.
+ * @param callback A function called after the message is successfully queued for sending. runtime.lastError should be checked, to ensure a message was sent without problems.
+ * The callback parameter should be a function that looks like this:
+ * function(string messageId) {...};
+ * Parameter messageId: The ID of the message that the callback was issued for.
+ */
+ export function send(message: OutgoingMessage, callback: (messageId: string) => void): void;
+
+ /** Fired when a message is received through GCM. */
+ var onMessage: MessageReceptionEvent;
+ /** Fired when a GCM server had to delete messages sent by an app server to the application. See Messages deleted event section of Cloud Messaging documentation for details on handling this event. */
+ var onMessagesDeleted: MessageDeletionEvent;
+ /** Fired when it was not possible to send a message to the GCM server. */
+ var onSendError: GcmErrorEvent;
+}
+
+////////////////////
+// History
+////////////////////
+/**
+ * Use the chrome.history API to interact with the browser's record of visited pages. You can add, remove, and query for URLs in the browser's history. To override the history page with your own version, see Override Pages.
+ * Availability: Since Chrome 5.
+ * Permissions: "history"
+ */
+declare namespace chrome.history {
+ /** An object encapsulating one visit to a URL. */
+ interface VisitItem {
+ /** The transition type for this visit from its referrer. */
+ transition: string;
+ /** Optional. When this visit occurred, represented in milliseconds since the epoch. */
+ visitTime?: number;
+ /** The unique identifier for this visit. */
+ visitId: string;
+ /** The visit ID of the referrer. */
+ referringVisitId: string;
+ /** The unique identifier for the item. */
+ id: string;
+ }
+
+ /** An object encapsulating one result of a history query. */
+ interface HistoryItem {
+ /** Optional. The number of times the user has navigated to this page by typing in the address. */
+ typedCount?: number;
+ /** Optional. The title of the page when it was last loaded. */
+ title?: string;
+ /** Optional. The URL navigated to by a user. */
+ url?: string;
+ /** Optional. When this page was last loaded, represented in milliseconds since the epoch. */
+ lastVisitTime?: number;
+ /** Optional. The number of times the user has navigated to this page. */
+ visitCount?: number;
+ /** The unique identifier for the item. */
+ id: string;
+ }
+
+ interface HistoryQuery {
+ /** A free-text query to the history service. Leave empty to retrieve all pages. */
+ text: string;
+ /** Optional. The maximum number of results to retrieve. Defaults to 100. */
+ maxResults?: number;
+ /** Optional. Limit results to those visited after this date, represented in milliseconds since the epoch. */
+ startTime?: number;
+ /** Optional. Limit results to those visited before this date, represented in milliseconds since the epoch. */
+ endTime?: number;
+ }
+
+ interface Url {
+ /** The URL for the operation. It must be in the format as returned from a call to history.search. */
+ url: string;
+ }
+
+ interface Range {
+ /** Items added to history before this date, represented in milliseconds since the epoch. */
+ endTime: number;
+ /** Items added to history after this date, represented in milliseconds since the epoch. */
+ startTime: number;
+ }
+
+ interface RemovedResult {
+ /** True if all history was removed. If true, then urls will be empty. */
+ allHistory: boolean;
+ /** Optional. */
+ urls?: string[];
+ }
+
+ interface HistoryVisitedEvent extends chrome.events.Event<(result: HistoryItem) => void> {}
+
+ interface HistoryVisitRemovedEvent extends chrome.events.Event<(removed: RemovedResult) => void> {}
+
+ /**
+ * Searches the history for the last visit time of each page matching the query.
+ * @param callback The callback parameter should be a function that looks like this:
+ * function(array of HistoryItem results) {...};
+ */
+ export function search(query: HistoryQuery, callback: (results: HistoryItem[]) => void): void;
+ /**
+ * Adds a URL to the history at the current time with a transition type of "link".
+ * @param callback If you specify the callback parameter, it should be a function that looks like this:
+ * function() {...};
+ */
+ export function addUrl(details: Url, callback?: () => void): void;
+ /**
+ * Removes all items within the specified date range from the history. Pages will not be removed from the history unless all visits fall within the range.
+ * @param callback The callback parameter should be a function that looks like this:
+ * function() {...};
+ */
+ export function deleteRange(range: Range, callback: () => void): void;
+ /**
+ * Deletes all items from the history.
+ * @param callback The callback parameter should be a function that looks like this:
+ * function() {...};
+ */
+ export function deleteAll(callback: () => void): void;
+ /**
+ * Retrieves information about visits to a URL.
+ * @param callback The callback parameter should be a function that looks like this:
+ * function(array of VisitItem results) {...};
+ */
+ export function getVisits(details: Url, callback: (results: VisitItem[]) => void): void;
+ /**
+ * Removes all occurrences of the given URL from the history.
+ * @param callback If you specify the callback parameter, it should be a function that looks like this:
+ * function() {...};
+ */
+ export function deleteUrl(details: Url, callback?: () => void): void;
+
+ /** Fired when a URL is visited, providing the HistoryItem data for that URL. This event fires before the page has loaded. */
+ var onVisited: HistoryVisitedEvent;
+ /** Fired when one or more URLs are removed from the history service. When all visits have been removed the URL is purged from history. */
+ var onVisitRemoved: HistoryVisitRemovedEvent;
+}
+
+////////////////////
+// i18n
+////////////////////
+/**
+ * Use the chrome.i18n infrastructure to implement internationalization across your whole app or extension.
+ * @since Chrome 5.
+ */
+declare namespace chrome.i18n {
+ /**
+ * Gets the accept-languages of the browser. This is different from the locale used by the browser; to get the locale, use i18n.getUILanguage.
+ * @param callback The callback parameter should be a function that looks like this:
+ * function(array of string languages) {...};
+ * Parameter languages: Array of the accept languages of the browser, such as en-US,en,zh-CN
+ */
+ export function getAcceptLanguages(callback: (languages: string[]) => void): void;
+ /**
+ * Gets the localized string for the specified message. If the message is missing, this method returns an empty string (''). If the format of the getMessage() call is wrong — for example, messageName is not a string or the substitutions array has more than 9 elements — this method returns undefined.
+ * @param messageName The name of the message, as specified in the messages.json file.
+ * @param substitutions Optional. Up to 9 substitution strings, if the message requires any.
+ */
+ export function getMessage(messageName: string, substitutions?: any): string;
+ /**
+ * Gets the browser UI language of the browser. This is different from i18n.getAcceptLanguages which returns the preferred user languages.
+ * @since Chrome 35.
+ */
+ export function getUILanguage(): string;
+}
+
+////////////////////
+// Identity
+////////////////////
+/**
+ * Use the chrome.identity API to get OAuth2 access tokens.
+ * Permissions: "identity"
+ * @since Chrome 29.
+ */
+declare namespace chrome.identity {
+ /** @since Chrome 32. */
+ interface AccountInfo {
+ /** A unique identifier for the account. This ID will not change for the lifetime of the account. */
+ id: string;
+ }
+
+ interface TokenDetails {
+ /**
+ * Optional.
+ * Fetching a token may require the user to sign-in to Chrome, or approve the application's requested scopes. If the interactive flag is true, getAuthToken will prompt the user as necessary. When the flag is false or omitted, getAuthToken will return failure any time a prompt would be required.
+ */
+ interactive?: boolean;
+ /**
+ * Optional.
+ * The account ID whose token should be returned. If not specified, the primary account for the profile will be used.
+ * account is only supported when the "enable-new-profile-management" flag is set.
+ * @since Chrome 37.
+ */
+ account?: AccountInfo;
+ /**
+ * Optional.
+ * A list of OAuth2 scopes to request.
+ * When the scopes field is present, it overrides the list of scopes specified in manifest.json.
+ * @since Chrome 37.
+ */
+ scopes?: string[];
+ }
+
+ interface UserInfo {
+ /** An email address for the user account signed into the current profile. Empty if the user is not signed in or the identity.email manifest permission is not specified. */
+ email: string;
+ /** A unique identifier for the account. This ID will not change for the lifetime of the account. Empty if the user is not signed in or (in M41+) the identity.email manifest permission is not specified. */
+ id: string;
+ }
+
+ interface TokenInformation {
+ /** The specific token that should be removed from the cache. */
+ token: string;
+ }
+
+ interface WebAuthFlowOptions {
+ /** The URL that initiates the auth flow. */
+ url: string;
+ /**
+ * Optional.
+ * Whether to launch auth flow in interactive mode.
+ * Since some auth flows may immediately redirect to a result URL, launchWebAuthFlow hides its web view until the first navigation either redirects to the final URL, or finishes loading a page meant to be displayed.
+ * If the interactive flag is true, the window will be displayed when a page load completes. If the flag is false or omitted, launchWebAuthFlow will return with an error if the initial navigation does not complete the flow.
+ */
+ interactive?: boolean;
+ }
+
+ interface SignInChangeEvent extends chrome.events.Event<(account: AccountInfo, signedIn: boolean) => void> {}
+
+ /**
+ * Retrieves a list of AccountInfo objects describing the accounts present on the profile.
+ * getAccounts is only supported on dev channel.
+ * Dev channel only.
+ */
+ export function getAccounts(callback: (accounts: AccountInfo[]) => void): void;
+ /**
+ * Gets an OAuth2 access token using the client ID and scopes specified in the oauth2 section of manifest.json.
+ * The Identity API caches access tokens in memory, so it's ok to call getAuthToken non-interactively any time a token is required. The token cache automatically handles expiration.
+ * For a good user experience it is important interactive token requests are initiated by UI in your app explaining what the authorization is for. Failing to do this will cause your users to get authorization requests, or Chrome sign in screens if they are not signed in, with with no context. In particular, do not use getAuthToken interactively when your app is first launched.
+ * @param details Token options.
+ * @param callback Called with an OAuth2 access token as specified by the manifest, or undefined if there was an error.
+ * If you specify the callback parameter, it should be a function that looks like this:
+ * function(string token) {...};
+ */
+ export function getAuthToken(details: TokenDetails, callback?: (token: string) => void): void;
+ /**
+ * Retrieves email address and obfuscated gaia id of the user signed into a profile.
+ * This API is different from identity.getAccounts in two ways. The information returned is available offline, and it only applies to the primary account for the profile.
+ * @since Chrome 37.
+ */
+ export function getProfileUserInfo(callback: (userInfo: UserInfo) => void): void;
+ /**
+ * Removes an OAuth2 access token from the Identity API's token cache.
+ * If an access token is discovered to be invalid, it should be passed to removeCachedAuthToken to remove it from the cache. The app may then retrieve a fresh token with getAuthToken.
+ * @param details Token information.
+ * @param callback Called when the token has been removed from the cache.
+ * If you specify the callback parameter, it should be a function that looks like this:
+ * function() {...};
+ */
+ export function removeCachedAuthToken(details: TokenInformation, callback?: () => void): void;
+ /**
+ * Starts an auth flow at the specified URL.
+ * This method enables auth flows with non-Google identity providers by launching a web view and navigating it to the first URL in the provider's auth flow. When the provider redirects to a URL matching the pattern https://<app-id>.chromiumapp.org/*, the window will close, and the final redirect URL will be passed to the callback function.
+ * For a good user experience it is important interactive auth flows are initiated by UI in your app explaining what the authorization is for. Failing to do this will cause your users to get authorization requests with no context. In particular, do not launch an interactive auth flow when your app is first launched.
+ * @param details WebAuth flow options.
+ * @param callback Called with the URL redirected back to your application.
+ * The callback parameter should be a function that looks like this:
+ * function(string responseUrl) {...};
+ */
+ export function launchWebAuthFlow(details: WebAuthFlowOptions, callback: (responseUrl?: string) => void): void;
+ /**
+ * Generates a redirect URL to be used in launchWebAuthFlow.
+ * The generated URLs match the pattern https://<app-id>.chromiumapp.org/*.
+ * @since Chrome 33.
+ * @param path Optional. The path appended to the end of the generated URL.
+ */
+ export function getRedirectURL(path?: string): string;
+
+ /**
+ * Fired when signin state changes for an account on the user's profile.
+ * @since Chrome 33.
+ */
+ var onSignInChanged: SignInChangeEvent;
+}
+
+////////////////////
+// Idle
+////////////////////
+/**
+ * Use the chrome.idle API to detect when the machine's idle state changes.
+ * Permissions: "idle"
+ * @since Chrome 6.
+ */
+declare namespace chrome.idle {
+ interface IdleStateChangedEvent extends chrome.events.Event<(newState: string) => void> {}
+
+ /**
+ * Returns "locked" if the system is locked, "idle" if the user has not generated any input for a specified number of seconds, or "active" otherwise.
+ * @param detectionIntervalInSeconds The system is considered idle if detectionIntervalInSeconds seconds have elapsed since the last user input detected.
+ * Since Chrome 25.
+ * @param callback The callback parameter should be a function that looks like this:
+ * function( IdleState newState) {...};
+ */
+ export function queryState(detectionIntervalInSeconds: number, callback: (newState: string) => void): void;
+ /**
+ * Sets the interval, in seconds, used to determine when the system is in an idle state for onStateChanged events. The default interval is 60 seconds.
+ * @since Chrome 25.
+ * @param intervalInSeconds Threshold, in seconds, used to determine when the system is in an idle state.
+ */
+ export function setDetectionInterval(intervalInSeconds: number): void;
+
+ /** Fired when the system changes to an active, idle or locked state. The event fires with "locked" if the screen is locked or the screensaver activates, "idle" if the system is unlocked and the user has not generated any input for a specified number of seconds, and "active" when the user generates input on an idle system. */
+ var onStateChanged: IdleStateChangedEvent;
+}
+
+////////////////////
+// Input - IME
+////////////////////
+/**
+ * Use the chrome.input.ime API to implement a custom IME for Chrome OS. This allows your extension to handle keystrokes, set the composition, and manage the candidate window.
+ * Permissions: "input"
+ * @since Chrome 21.
+ */
+declare namespace chrome.input.ime {
+ /** See http://www.w3.org/TR/DOM-Level-3-Events/#events-KeyboardEvent */
+ interface KeyboardEvent {
+ /**
+ * Optional.
+ * Whether or not the SHIFT key is pressed.
+ */
+ shiftKey?: boolean;
+ /**
+ * Optional.
+ * Whether or not the ALT key is pressed.
+ */
+ altKey?: boolean;
+ /** The ID of the request. */
+ requestId: string;
+ /** Value of the key being pressed */
+ key: string;
+ /**
+ * Optional.
+ * Whether or not the CTRL key is pressed.
+ */
+ ctrlKey?: boolean;
+ /** One of keyup or keydown. */
+ type: string;
+ /**
+ * Optional.
+ * The extension ID of the sender of this keyevent.
+ * @since Chrome 34.
+ */
+ extensionId?: string;
+ /**
+ * Optional.
+ * Value of the physical key being pressed. The value is not affected by current keyboard layout or modifier state.
+ * @since Chrome 26.
+ */
+ code: string;
+ /**
+ * Optional.
+ * The deprecated HTML keyCode, which is system- and implementation-dependent numerical code signifying the unmodified identifier associated with the key pressed.
+ * @since Chrome 37.
+ */
+ keyCode?: number;
+ /**
+ * Optional.
+ * Whether or not the CAPS_LOCK is enabled.
+ * @since Chrome 29.
+ */
+ capsLock?: boolean;
+ }
+
+ /** Describes an input Context */
+ interface InputContext {
+ /** This is used to specify targets of text field operations. This ID becomes invalid as soon as onBlur is called. */
+ contextID: number;
+ /** Type of value this text field edits, (Text, Number, URL, etc) */
+ type: string;
+ /**
+ * Whether the text field wants auto-correct.
+ * @since Chrome 40.
+ */
+ autoCorrect: boolean;
+ /**
+ * Whether the text field wants auto-complete.
+ * @since Chrome 40.
+ */
+ autoComplete: boolean;
+ /**
+ * Whether the text field wants spell-check.
+ * @since Chrome 40.
+ */
+ spellCheck: boolean;
+ }
+
+ /**
+ * A menu item used by an input method to interact with the user from the language menu.
+ * @since Chrome 30.
+ */
+ interface MenuItem {
+ /** String that will be passed to callbacks referencing this MenuItem. */
+ id: string;
+ /** Optional. Text displayed in the menu for this item. */
+ label?: string;
+ /** Optional. The type of menu item. */
+ style?: string;
+ /** Optional. Indicates this item is visible. */
+ visible?: boolean;
+ /** Indicates this item should be drawn with a check. */
+ checked?: boolean;
+ /** Indicates this item is enabled. */
+ enabled?: boolean;
+ }
+
+ interface ImeParameters {
+ /** MenuItems to use. */
+ items: MenuItem[];
+ /** ID of the engine to use */
+ engineID: string;
+ }
+
+ interface CommitTextParameters {
+ /** The text to commit */
+ text: string;
+ /** ID of the context where the text will be committed */
+ contextID: number;
+ }
+
+ interface CandidateUsage {
+ /** The title string of details description. */
+ title: string;
+ /** The body string of detail description. */
+ body: string;
+ }
+
+ interface CandidateTemplate {
+ /** The candidate */
+ candidate: string;
+ /** The candidate's id */
+ id: number;
+ /**
+ * Optional.
+ * The id to add these candidates under
+ */
+ parentId?: number;
+ /**
+ * Optional.
+ * Short string displayed to next to the candidate, often the shortcut key or index
+ */
+ label?: string;
+ /**
+ * Optional.
+ * Additional text describing the candidate
+ */
+ annotation?: string;
+ /**
+ * Optional.
+ * The usage or detail description of word.
+ */
+ usage?: CandidateUsage;
+ }
+
+ interface CandidatesParameters {
+ /** ID of the context that owns the candidate window. */
+ contextID: number;
+ /** List of candidates to show in the candidate window */
+ candidates: CandidateTemplate[];
+ }
+
+ interface CompositionParameterSegment {
+ /** Index of the character to start this segment at */
+ start: number;
+ /** Index of the character to end this segment after. */
+ end: number;
+ /** The type of the underline to modify this segment. */
+ style: string;
+ }
+
+ interface CompositionParameters {
+ /** ID of the context where the composition text will be set */
+ contextID: number;
+ /** Text to set */
+ text: string;
+ /** Optional. List of segments and their associated types. */
+ segments: CompositionParameterSegment[];
+ /** Position in the text of the cursor. */
+ cursor: number;
+ /** Optional. Position in the text that the selection starts at. */
+ selectionStart?: number;
+ /** Optional. Position in the text that the selection ends at. */
+ selectionEnd?: number;
+ }
+
+ interface MenuItemParameters {
+ items: Object[];
+ engineId: string;
+ }
+
+ interface CandidateWindowParameterProperties {
+ /**
+ * Optional.
+ * True to show the cursor, false to hide it.
+ */
+ cursorVisible?: boolean;
+ /**
+ * Optional.
+ * True if the candidate window should be rendered vertical, false to make it horizontal.
+ */
+ vertical?: boolean;
+ /**
+ * Optional.
+ * The number of candidates to display per page.
+ */
+ pageSize?: number;
+ /**
+ * Optional.
+ * True to display the auxiliary text, false to hide it.
+ */
+ auxiliaryTextVisible?: boolean;
+ /**
+ * Optional.
+ * Text that is shown at the bottom of the candidate window.
+ */
+ auxiliaryText?: string;
+ /**
+ * Optional.
+ * True to show the Candidate window, false to hide it.
+ */
+ visible?: boolean;
+ /**
+ * Optional.
+ * Where to display the candidate window.
+ * @since Chrome 28.
+ */
+ windowPosition?: string;
+ }
+
+ interface CandidateWindowParameter {
+ /** ID of the engine to set properties on. */
+ engineID: string;
+ properties: CandidateWindowParameterProperties;
+ }
+
+ interface ClearCompositionParameters {
+ /** ID of the context where the composition will be cleared */
+ contextID: number;
+ }
+
+ interface CursorPositionParameters {
+ /** ID of the candidate to select. */
+ candidateID: number;
+ /** ID of the context that owns the candidate window. */
+ contextID: number;
+ }
+
+ interface SendKeyEventParameters {
+ /** ID of the context where the key events will be sent, or zero to send key events to non-input field. */
+ contextID: number;
+ /** Data on the key event. */
+ keyData: KeyboardEvent[];
+ }
+
+ interface DeleteSurroundingTextParameters {
+ /** ID of the engine receiving the event. */
+ engineID: string;
+ /** ID of the context where the surrounding text will be deleted. */
+ contextID: number;
+ /** The offset from the caret position where deletion will start. This value can be negative. */
+ offset: number;
+ /** The number of characters to be deleted */
+ length: number;
+ }
+
+ interface SurroundingTextInfo {
+ /** The text around cursor. */
+ text: string;
+ /** The ending position of the selection. This value indicates caret position if there is no selection. */
+ focus: number;
+ /** The beginning position of the selection. This value indicates caret position if is no selection. */
+ anchor: number;
+ }
+
+ interface BlurEvent extends chrome.events.Event<(contextID: number) => void> {}
+
+ interface CandidateClickedEvent extends chrome.events.Event<(engineID: string, candidateID: number, button: string) => void> {}
+
+ interface KeyEventEvent extends chrome.events.Event<(engineID: string, keyData: KeyboardEvent) => void> {}
+
+ interface DeactivatedEvent extends chrome.events.Event<(engineID: string) => void> {}
+
+ interface InputContextUpdateEvent extends chrome.events.Event<(context: InputContext) => void> {}
+
+ interface ActivateEvent extends chrome.events.Event<(engineID: string, screen: string) => void> {}
+
+ interface FocusEvent extends chrome.events.Event<(context: InputContext) => void> {}
+
+ interface MenuItemActivatedEvent extends chrome.events.Event<(engineID: string, name: string) => void> {}
+
+ interface SurroundingTextChangedEvent extends chrome.events.Event<(engineID: string, surroundingInfo: SurroundingTextInfo) => void> {}
+
+ interface InputResetEvent extends chrome.events.Event<(engineID: string) => void> {}
+
+ /**
+ * Adds the provided menu items to the language menu when this IME is active.
+ * @param callback If you specify the callback parameter, it should be a function that looks like this:
+ * function() {...};
+ */
+ export function setMenuItems(parameters: ImeParameters, callback?: () => void): void;
+ /**
+ * Commits the provided text to the current input.
+ * @param callback Called when the operation completes with a boolean indicating if the text was accepted or not. On failure, chrome.runtime.lastError is set.
+ * If you specify the callback parameter, it should be a function that looks like this:
+ * function(boolean success) {...};
+ */
+ export function commitText(parameters: CommitTextParameters, callback?: (success: boolean) => void): void;
+ /**
+ * Sets the current candidate list. This fails if this extension doesn't own the active IME
+ * @param callback Called when the operation completes.
+ * If you specify the callback parameter, it should be a function that looks like this:
+ * function(boolean success) {...};
+ */
+ export function setCandidates(parameters: CandidatesParameters, callback?: (success: boolean) => void): void;
+ /**
+ * Set the current composition. If this extension does not own the active IME, this fails.
+ * @param callback Called when the operation completes with a boolean indicating if the text was accepted or not. On failure, chrome.runtime.lastError is set.
+ * If you specify the callback parameter, it should be a function that looks like this:
+ * function(boolean success) {...};
+ */
+ export function setComposition(parameters: CompositionParameters, callback?: (success: boolean) => void): void;
+ /**
+ * Updates the state of the MenuItems specified
+ * @param callback Called when the operation completes
+ * If you specify the callback parameter, it should be a function that looks like this:
+ * function() {...};
+ */
+ export function updateMenuItems(parameters: MenuItemParameters, callback?: () => void): void;
+ /**
+ * Sets the properties of the candidate window. This fails if the extension doesn't own the active IME
+ * @param callback Called when the operation completes.
+ * If you specify the callback parameter, it should be a function that looks like this:
+ * function(boolean success) {...};
+ */
+ export function setCandidateWindowProperties(parameters: CandidateWindowParameter, callback?: (success: boolean) => void): void;
+ /**
+ * Clear the current composition. If this extension does not own the active IME, this fails.
+ * @param callback Called when the operation completes with a boolean indicating if the text was accepted or not. On failure, chrome.runtime.lastError is set.
+ * If you specify the callback parameter, it should be a function that looks like this:
+ * function(boolean success) {...};
+ */
+ export function clearComposition(parameters: ClearCompositionParameters, callback?: (success: boolean) => void): void;
+ /**
+ * Set the position of the cursor in the candidate window. This is a no-op if this extension does not own the active IME.
+ * @param callback Called when the operation completes
+ * If you specify the callback parameter, it should be a function that looks like this:
+ * function(boolean success) {...};
+ */
+ export function setCursorPosition(parameters: CursorPositionParameters, callback?: (success: boolean) => void): void;
+ /**
+ * Sends the key events. This function is expected to be used by virtual keyboards. When key(s) on a virtual keyboard is pressed by a user, this function is used to propagate that event to the system.
+ * @since Chrome 33.
+ * @param callback Called when the operation completes.
+ * If you specify the callback parameter, it should be a function that looks like this:
+ * function() {...};
+ */
+ export function sendKeyEvents(parameters: SendKeyEventParameters, callback?: () => void): void;
+ /**
+ * Hides the input view window, which is popped up automatically by system. If the input view window is already hidden, this function will do nothing.
+ * @since Chrome 34.
+ */
+ export function hideInputView(): void;
+ /**
+ * Deletes the text around the caret.
+ * @since Chrome 27.
+ */
+ export function deleteSurroundingText(parameters: DeleteSurroundingTextParameters, callback?: () => void): void;
+ /**
+ * Indicates that the key event received by onKeyEvent is handled. This should only be called if the onKeyEvent listener is asynchronous.
+ * @since Chrome 25.
+ * @param requestId Request id of the event that was handled. This should come from keyEvent.requestId
+ * @param response True if the keystroke was handled, false if not
+ */
+ export function keyEventHandled(requestId: string, response: boolean): void;
+
+ /** This event is sent when focus leaves a text box. It is sent to all extensions that are listening to this event, and enabled by the user. */
+ var onBlur: BlurEvent;
+ /** This event is sent if this extension owns the active IME. */
+ var onCandidateClicked: CandidateClickedEvent;
+ /** This event is sent if this extension owns the active IME. */
+ var onKeyEvent: KeyEventEvent;
+ /** This event is sent when an IME is deactivated. It signals that the IME will no longer be receiving onKeyPress events. */
+ var onDeactivated: DeactivatedEvent;
+ /** This event is sent when the properties of the current InputContext change, such as the the type. It is sent to all extensions that are listening to this event, and enabled by the user. */
+ var onInputContextUpdate: InputContextUpdateEvent;
+ /** This event is sent when an IME is activated. It signals that the IME will be receiving onKeyPress events. */
+ var onActivate: ActivateEvent;
+ /** This event is sent when focus enters a text box. It is sent to all extensions that are listening to this event, and enabled by the user. */
+ var onFocus: FocusEvent;
+ /** Called when the user selects a menu item */
+ var onMenuItemActivated: MenuItemActivatedEvent;
+ /**
+ * Called when the editable string around caret is changed or when the caret position is moved. The text length is limited to 100 characters for each back and forth direction.
+ * @since Chrome 27.
+ */
+ var onSurroundingTextChanged: SurroundingTextChangedEvent;
+ /**
+ * This event is sent when chrome terminates ongoing text input session.
+ * @since Chrome 29.
+ */
+ var onReset: InputResetEvent;
+}
+
+////////////////////
+// Management
+////////////////////
+/**
+ * The chrome.management API provides ways to manage the list of extensions/apps that are installed and running. It is particularly useful for extensions that override the built-in New Tab page.
+ * Permissions: "management"
+ * @since Chrome 8.
+ */
+declare namespace chrome.management {
+ /** Information about an installed extension, app, or theme. */
+ interface ExtensionInfo {
+ /**
+ * Optional.
+ * A reason the item is disabled.
+ * @since Chrome 17.
+ */
+ disabledReason?: string;
+ /** Optional. The launch url (only present for apps). */
+ appLaunchUrl?: string;
+ /**
+ * The description of this extension, app, or theme.
+ * @since Chrome 9.
+ */
+ description: string;
+ /**
+ * Returns a list of API based permissions.
+ * @since Chrome 9.
+ */
+ permissions: string[];
+ /**
+ * Optional.
+ * A list of icon information. Note that this just reflects what was declared in the manifest, and the actual image at that url may be larger or smaller than what was declared, so you might consider using explicit width and height attributes on img tags referencing these images. See the manifest documentation on icons for more details.
+ */
+ icons?: IconInfo[];
+ /**
+ * Returns a list of host based permissions.
+ * @since Chrome 9.
+ */
+ hostPermissions: string[];
+ /** Whether it is currently enabled or disabled. */
+ enabled: boolean;
+ /**
+ * Optional.
+ * The URL of the homepage of this extension, app, or theme.
+ * @since Chrome 11.
+ */
+ homepageUrl?: string;
+ /**
+ * Whether this extension can be disabled or uninstalled by the user.
+ * @since Chrome 12.
+ */
+ mayDisable: boolean;
+ /**
+ * How the extension was installed.
+ * @since Chrome 22.
+ */
+ installType: string;
+ /** The version of this extension, app, or theme. */
+ version: string;
+ /** The extension's unique identifier. */
+ id: string;
+ /**
+ * Whether the extension, app, or theme declares that it supports offline.
+ * @since Chrome 15.
+ */
+ offlineEnabled: boolean;
+ /**
+ * Optional.
+ * The update URL of this extension, app, or theme.
+ * @since Chrome 16.
+ */
+ updateUrl?: string;
+ /**
+ * The type of this extension, app, or theme.
+ * @since Chrome 23.
+ */
+ type: string;
+ /** The url for the item's options page, if it has one. */
+ optionsUrl: string;
+ /** The name of this extension, app, or theme. */
+ name: string;
+ /**
+ * A short version of the name of this extension, app, or theme.
+ * @since Chrome 31.
+ */
+ shortName: string;
+ /**
+ * True if this is an app.
+ * @deprecated since Chrome 33. Please use management.ExtensionInfo.type.
+ */
+ isApp: boolean;
+ /**
+ * Optional.
+ * The app launch type (only present for apps).
+ * @since Chrome 37.
+ */
+ launchType?: string;
+ /**
+ * Optional.
+ * The currently available launch types (only present for apps).
+ * @since Chrome 37.
+ */
+ availableLaunchTypes?: string[];
+ }
+
+ /** Information about an icon belonging to an extension, app, or theme. */
+ interface IconInfo {
+ /** The URL for this icon image. To display a grayscale version of the icon (to indicate that an extension is disabled, for example), append ?grayscale=true to the URL. */
+ url: string;
+ /** A number representing the width and height of the icon. Likely values include (but are not limited to) 128, 48, 24, and 16. */
+ size: number;
+ }
+
+ interface UninstallOptions {
+ /**
+ * Optional.
+ * Whether or not a confirm-uninstall dialog should prompt the user. Defaults to false for self uninstalls. If an extension uninstalls another extension, this parameter is ignored and the dialog is always shown.
+ */
+ showConfirmDialog?: boolean;
+ }
+
+ interface ManagementDisabledEvent extends chrome.events.Event<(info: ExtensionInfo) => void> {}
+
+ interface ManagementUninstalledEvent extends chrome.events.Event<(id: string) => void> {}
+
+ interface ManagementInstalledEvent extends chrome.events.Event<(info: ExtensionInfo) => void> {}
+
+ interface ManagementEnabledEvent extends chrome.events.Event<(info: ExtensionInfo) => void> {}
+
+ /**
+ * Enables or disables an app or extension.
+ * @param id This should be the id from an item of management.ExtensionInfo.
+ * @param enabled Whether this item should be enabled or disabled.
+ * @param callback If you specify the callback parameter, it should be a function that looks like this:
+ * function() {...};
+ */
+ export function setEnabled(id: string, enabled: boolean, callback?: () => void): void;
+ /**
+ * Returns a list of permission warnings for the given extension id.
+ * @since Chrome 15.
+ * @param id The ID of an already installed extension.
+ * @param callback If you specify the callback parameter, it should be a function that looks like this:
+ * function(array of string permissionWarnings) {...};
+ */
+ export function getPermissionWarningsById(id: string, callback?: (permissionWarnings: string[]) => void): void;
+ /**
+ * Returns information about the installed extension, app, or theme that has the given ID.
+ * @since Chrome 9.
+ * @param id The ID from an item of management.ExtensionInfo.
+ * @param callback If you specify the callback parameter, it should be a function that looks like this:
+ * function( ExtensionInfo result) {...};
+ */
+ export function get(id: string, callback?: (result: ExtensionInfo) => void): void;
+ /**
+ * Returns a list of information about installed extensions and apps.
+ * @param callback If you specify the callback parameter, it should be a function that looks like this:
+ * function(array of ExtensionInfo result) {...};
+ */
+ export function getAll(callback?: (result: ExtensionInfo[]) => void): void;
+ /**
+ * Returns a list of permission warnings for the given extension manifest string. Note: This function can be used without requesting the 'management' permission in the manifest.
+ * @since Chrome 15.
+ * @param manifestStr Extension manifest JSON string.
+ * @param callback If you specify the callback parameter, it should be a function that looks like this:
+ * function(array of string permissionWarnings) {...};
+ */
+ export function getPermissionWarningsByManifest(manifestStr: string, callback?: (permissionwarnings: string[]) => void): void;
+ /**
+ * Launches an application.
+ * @param id The extension id of the application.
+ * @param callback If you specify the callback parameter, it should be a function that looks like this:
+ * function() {...};
+ */
+ export function launchApp(id: string, callback?: () => void): void;
+ /**
+ * Uninstalls a currently installed app or extension.
+ * @since Chrome 21.
+ * @param id This should be the id from an item of management.ExtensionInfo.
+ * @param callback If you specify the callback parameter, it should be a function that looks like this:
+ * function() {...};
+ */
+ export function uninstall(id: string, options?: UninstallOptions, callback?: () => void): void;
+ /**
+ * Uninstalls a currently installed app or extension.
+ * @deprecated since Chrome 21. The options parameter was added to this function.
+ * @param id This should be the id from an item of management.ExtensionInfo.
+ * @param callback If you specify the callback parameter, it should be a function that looks like this:
+ * function() {...};
+ */
+ export function uninstall(id: string, callback?: () => void): void;
+ /**
+ * Returns information about the calling extension, app, or theme. Note: This function can be used without requesting the 'management' permission in the manifest.
+ * @since Chrome 39.
+ * @param callback If you specify the callback parameter, it should be a function that looks like this:
+ * function( ExtensionInfo result) {...};
+ */
+ export function getSelf(callback?: (result: ExtensionInfo) => void): void;
+ /**
+ * Uninstalls the calling extension.
+ * Note: This function can be used without requesting the 'management' permission in the manifest.
+ * @since Chrome 26.
+ * @param callback If you specify the callback parameter, it should be a function that looks like this:
+ * function() {...};
+ */
+ export function uninstallSelf(options?: UninstallOptions, callback?: () => void): void;
+ /**
+ * Uninstalls the calling extension.
+ * Note: This function can be used without requesting the 'management' permission in the manifest.
+ * @since Chrome 26.
+ * @param callback If you specify the callback parameter, it should be a function that looks like this:
+ * function() {...};
+ */
+ export function uninstallSelf(callback?: () => void): void;
+ /**
+ * Display options to create shortcuts for an app. On Mac, only packaged app shortcuts can be created.
+ * @since Chrome 37.
+ * @param callback If you specify the callback parameter, it should be a function that looks like this:
+ * function() {...};
+ */
+ export function createAppShortcut(id: string, callback?: () => void): void;
+ /**
+ * Set the launch type of an app.
+ * @since Chrome 37.
+ * @param id This should be the id from an app item of management.ExtensionInfo.
+ * @param launchType The target launch type. Always check and make sure this launch type is in ExtensionInfo.availableLaunchTypes, because the available launch types vary on different platforms and configurations.
+ * @param callback If you specify the callback parameter, it should be a function that looks like this:
+ * function() {...};
+ */
+ export function setLaunchType(id: string, launchType: string, callback?: () => void): void;
+ /**
+ * Generate an app for a URL. Returns the generated bookmark app.
+ * @since Chrome 37.
+ * @param url The URL of a web page. The scheme of the URL can only be "http" or "https".
+ * @param title The title of the generated app.
+ * @param callback If you specify the callback parameter, it should be a function that looks like this:
+ * function( ExtensionInfo result) {...};
+ */
+ export function generateAppForLink(url: string, title: string, callback?: (result: ExtensionInfo) => void): void;
+
+ /** Fired when an app or extension has been disabled. */
+ var onDisabled: ManagementDisabledEvent;
+ /** Fired when an app or extension has been uninstalled. */
+ var onUninstalled: ManagementUninstalledEvent;
+ /** Fired when an app or extension has been installed. */
+ var onInstalled: ManagementInstalledEvent;
+ /** Fired when an app or extension has been enabled. */
+ var onEnabled: ManagementEnabledEvent;
+}
+
+////////////////////
+// Notifications
+////////////////////
+/**
+ * Use the networking.config API to authenticate to captive portals.
+ * Permissions: "networking.config"
+ * Important: This API works only on Chrome OS.
+ * @since Chrome 43.
+ */
+declare namespace chrome.networking.config {
+ interface NetworkInfo {
+ /** Currently only WiFi supported. */
+ Type: string;
+ /** Optional. A unique identifier of the network. */
+ GUID?: string;
+ /** Optional. A hex-encoded byte sequence. */
+ HexSSID?: string;
+ /** Optional. The decoded SSID of the network (default encoding is UTF-8). To filter for non-UTF-8 SSIDs, use HexSSID instead. */
+ SSID?: string;
+ /** Optional. The basic service set identification (BSSID) uniquely identifying the basic service set. BSSID is represented as a human readable, hex-encoded string with bytes separated by colons, e.g. 45:67:89:ab:cd:ef. */
+ BSSID?: string;
+ /** Optional. Identifier indicating the security type of the network. Valid values are None, WEP-PSK, WPA-PSK and WPA-EAP. */
+ Security?: string;
+ }
+
+ interface CaptivePorttalDetectedEvent extends chrome.events.Event<(networkInfo: NetworkInfo) => void> {}
+
+ /**
+ * Allows an extension to define network filters for the networks it can handle. A call to this function will remove all filters previously installed by the extension before setting the new list.
+ * @param networks Network filters to set. Every NetworkInfo must either have the SSID or HexSSID set. Other fields will be ignored.
+ * @param callback Called back when this operation is finished.
+ * The callback parameter should be a function that looks like this:
+ * function() {...};
+ */
+ export function setNetworkFilter(networks: NetworkInfo[], callback: () => void): void;
+ /**
+ * Called by the extension to notify the network config API that it finished a captive portal authentication attempt and hand over the result of the attempt. This function must only be called with the GUID of the latest onCaptivePortalDetected event.
+ * @param GUID Unique network identifier obtained from onCaptivePortalDetected.
+ * @param result The result of the authentication attempt.
+ * unhandled: The extension does not handle this network or captive portal (e.g. server end-point not found or not compatible).
+ * succeeded: The extension handled this network and authenticated successfully.
+ * rejected: The extension handled this network, tried to authenticate, however was rejected by the server.
+ * failed: The extension handled this network, tried to authenticate, however failed due to an unspecified error.
+ * @param callback Called back when this operation is finished.
+ * If you specify the callback parameter, it should be a function that looks like this:
+ * function() {...};
+ */
+ export function finishAuthentication(GUID: string, result: string, callback?: () => void): void;
+
+ /** This event fires everytime a captive portal is detected on a network matching any of the currently registered network filters and the user consents to use the extension for authentication. Network filters may be set using the setNetworkFilter. Upon receiving this event the extension should start its authentication attempt with the captive portal. When the extension finishes its attempt, it must call finishAuthentication with the GUID received with this event and the appropriate authentication result. */
+ var onCaptivePortalDetected: CaptivePorttalDetectedEvent;
+}
+
+////////////////////
+// Notifications
+// https://developer.chrome.com/extensions/notifications
+////////////////////
+/**
+ * Use the chrome.notifications API to create rich notifications using templates and show these notifications to users in the system tray.
+ * Permissions: "notifications"
+ * @since Chrome 28.
+ */
+declare namespace chrome.notifications {
+ interface ButtonOptions {
+ title: string;
+ iconUrl?: string;
+ }
+
+ interface ItemOptions {
+ /** Title of one item of a list notification. */
+ title: string;
+ /** Additional details about this item. */
+ message: string;
+ }
+
+ interface NotificationOptions {
+ /** Optional. Which type of notification to display. Required for notifications.create method. */
+ type?: string;
+ /**
+ * Optional.
+ * A URL to the sender's avatar, app icon, or a thumbnail for image notifications.
+ * URLs can be a data URL, a blob URL, or a URL relative to a resource within this extension's .crx file Required for notifications.create method.
+ */
+ iconUrl?: string;
+ /** Optional. Title of the notification (e.g. sender name for email). Required for notifications.create method. */
+ title?: string;
+ /** Optional. Main notification content. Required for notifications.create method. */
+ message?: string;
+ /**
+ * Optional.
+ * Alternate notification content with a lower-weight font.
+ * @since Chrome 31.
+ */
+ contextMessage?: string;
+ /** Optional. Priority ranges from -2 to 2. -2 is lowest priority. 2 is highest. Zero is default. */
+ priority?: number;
+ /** Optional. A timestamp associated with the notification, in milliseconds past the epoch (e.g. Date.now() + n). */
+ eventTime?: number;
+ /** Optional. Text and icons for up to two notification action buttons. */
+ buttons?: ButtonOptions[];
+ /** Optional. Items for multi-item notifications. */
+ items?: ItemOptions[];
+ /**
+ * Optional.
+ * Current progress ranges from 0 to 100.
+ * @since Chrome 30.
+ */
+ progress?: number;
+ /**
+ * Optional.
+ * Whether to show UI indicating that the app will visibly respond to clicks on the body of a notification.
+ * @since Chrome 32.
+ */
+ isClickable?: boolean;
+ /**
+ * Optional.
+ * A URL to the app icon mask. URLs have the same restrictions as iconUrl. The app icon mask should be in alpha channel, as only the alpha channel of the image will be considered.
+ * @since Chrome 38.
+ */
+ appIconMaskUrl?: string;
+ /** Optional. A URL to the image thumbnail for image-type notifications. URLs have the same restrictions as iconUrl. */
+ imageUrl?: string;
+ }
+
+ interface NotificationClosedEvent extends chrome.events.Event<(notificationId: string, byUser: boolean) => void> {}
+
+ interface NotificationClickedEvent extends chrome.events.Event<(notificationId: string) => void> {}
+
+ interface NotificationButtonClickedEvent extends chrome.events.Event<(notificationId: string, buttonIndex: number) => void> {}
+
+ interface NotificationPermissionLevelChangedEvent extends chrome.events.Event<(level: string) => void> {}
+
+ interface NotificationShowSettingsEvent extends chrome.events.Event<() => void> {}
+
+ /** The notification closed, either by the system or by user action. */
+ export var onClosed: NotificationClosedEvent;
+ /** The user clicked in a non-button area of the notification. */
+ export var onClicked: NotificationClickedEvent;
+ /** The user pressed a button in the notification. */
+ export var onButtonClicked: NotificationButtonClickedEvent;
+ /**
+ * The user changes the permission level.
+ * @since Chrome 32.
+ */
+ export var onPermissionLevelChanged: NotificationPermissionLevelChangedEvent;
+ /**
+ * The user clicked on a link for the app's notification settings.
+ * @since Chrome 32.
+ */
+ export var onShowSettings: NotificationShowSettingsEvent;
+
+ /**
+ * Creates and displays a notification.
+ * @param notificationId Identifier of the notification. If not set or empty, an ID will automatically be generated. If it matches an existing notification, this method first clears that notification before proceeding with the create operation.
+ * The notificationId parameter is required before Chrome 42.
+ * @param options Contents of the notification.
+ * @param callback Returns the notification id (either supplied or generated) that represents the created notification.
+ * The callback is required before Chrome 42.
+ * If you specify the callback parameter, it should be a function that looks like this:
+ * function(string notificationId) {...};
+ */
+ export function create(notificationId: string, options: NotificationOptions, callback?: (notificationId: string) => void): void;
+ /**
+ * Creates and displays a notification.
+ * @param notificationId Identifier of the notification. If not set or empty, an ID will automatically be generated. If it matches an existing notification, this method first clears that notification before proceeding with the create operation.
+ * The notificationId parameter is required before Chrome 42.
+ * @param options Contents of the notification.
+ * @param callback Returns the notification id (either supplied or generated) that represents the created notification.
+ * The callback is required before Chrome 42.
+ * If you specify the callback parameter, it should be a function that looks like this:
+ * function(string notificationId) {...};
+ */
+ export function create(options: NotificationOptions, callback?: (notificationId: string) => void): void;
+ /**
+ * Updates an existing notification.
+ * @param notificationId The id of the notification to be updated. This is returned by notifications.create method.
+ * @param options Contents of the notification to update to.
+ * @param callback Called to indicate whether a matching notification existed.
+ * The callback is required before Chrome 42.
+ * If you specify the callback parameter, it should be a function that looks like this:
+ * function(boolean wasUpdated) {...};
+ */
+ export function update(notificationId: string, options: NotificationOptions, callback?: (wasUpdated: boolean) => void): void;
+ /**
+ * Clears the specified notification.
+ * @param notificationId The id of the notification to be cleared. This is returned by notifications.create method.
+ * @param callback Called to indicate whether a matching notification existed.
+ * The callback is required before Chrome 42.
+ * If you specify the callback parameter, it should be a function that looks like this:
+ * function(boolean wasCleared) {...};
+ */
+ export function clear(notificationId: string, callback?: (wasCleared: boolean) => void): void;
+ /**
+ * Retrieves all the notifications.
+ * @since Chrome 29.
+ * @param callback Returns the set of notification_ids currently in the system.
+ * The callback parameter should be a function that looks like this:
+ * function(object notifications) {...};
+ */
+ export function getAll(callback: (notifications: Object) => void): void;
+ /**
+ * Retrieves whether the user has enabled notifications from this app or extension.
+ * @since Chrome 32.
+ * @param callback Returns the current permission level.
+ * The callback parameter should be a function that looks like this:
+ * function( PermissionLevel level) {...};
+ */
+ export function getPermissionLevel(callback: (level: string) => void): void;
+}
+
+////////////////////
+// Omnibox
+////////////////////
+/**
+ * The omnibox API allows you to register a keyword with Google Chrome's address bar, which is also known as the omnibox.
+ * Manifest: "omnibox": {...}
+ * @since Chrome 9.
+ */
+declare namespace chrome.omnibox {
+ /** A suggest result. */
+ interface SuggestResult {
+ /** The text that is put into the URL bar, and that is sent to the extension when the user chooses this entry. */
+ content: string;
+ /** The text that is displayed in the URL dropdown. Can contain XML-style markup for styling. The supported tags are 'url' (for a literal URL), 'match' (for highlighting text that matched what the user's query), and 'dim' (for dim helper text). The styles can be nested, eg. dimmed match. You must escape the five predefined entities to display them as text: stackoverflow.com/a/1091953/89484 */
+ description: string;
+ }
+
+ interface Suggestion {
+ /** The text that is displayed in the URL dropdown. Can contain XML-style markup for styling. The supported tags are 'url' (for a literal URL), 'match' (for highlighting text that matched what the user's query), and 'dim' (for dim helper text). The styles can be nested, eg. dimmed match. */
+ description: string;
+ }
+
+ interface OmniboxInputEnteredEvent extends chrome.events.Event<(text: string) => void> {}
+
+ interface OmniboxInputChangedEvent extends chrome.events.Event<(text: string, suggest: (suggestResults: SuggestResult[]) => void) => void> {}
+
+ interface OmniboxInputStartedEvent extends chrome.events.Event<() => void> {}
+
+ interface OmniboxInputCancelledEvent extends chrome.events.Event<() => void> {}
+
+ /**
+ * Sets the description and styling for the default suggestion. The default suggestion is the text that is displayed in the first suggestion row underneath the URL bar.
+ * @param suggestion A partial SuggestResult object, without the 'content' parameter.
+ */
+ export function setDefaultSuggestion(suggestion: Suggestion): void;
+
+ /** User has accepted what is typed into the omnibox. */
+ var onInputEntered: OmniboxInputEnteredEvent;
+ /** User has changed what is typed into the omnibox. */
+ var onInputChanged: OmniboxInputChangedEvent;
+ /** User has started a keyword input session by typing the extension's keyword. This is guaranteed to be sent exactly once per input session, and before any onInputChanged events. */
+ var onInputStarted: OmniboxInputStartedEvent;
+ /** User has ended the keyword input session without accepting the input. */
+ var onInputCancelled: OmniboxInputCancelledEvent;
+}
+
+////////////////////
+// Page Action
+////////////////////
+/**
+ * Use the chrome.pageAction API to put icons inside the address bar. Page actions represent actions that can be taken on the current page, but that aren't applicable to all pages.
+ * Manifest: "page_action": {...}
+ * @since Chrome 5.
+ */
+declare namespace chrome.pageAction {
+ interface PageActionClickedEvent extends chrome.events.Event<(tab: chrome.tabs.Tab) => void> {}
+
+ interface TitleDetails {
+ /** The id of the tab for which you want to modify the page action. */
+ tabId: number;
+ /** The tooltip string. */
+ title: string;
+ }
+
+ interface GetDetails {
+ /** Specify the tab to get the title from. */
+ tabId: number;
+ }
+
+ interface PopupDetails {
+ /** The id of the tab for which you want to modify the page action. */
+ tabId: number;
+ /** The html file to show in a popup. If set to the empty string (''), no popup is shown. */
+ popup: string;
+ }
+
+ interface IconDetails {
+ /** The id of the tab for which you want to modify the page action. */
+ tabId: number;
+ /**
+ * Optional.
+ * @deprecated This argument is ignored.
+ */
+ iconIndex?: number;
+ /**
+ * Optional.
+ * Either an ImageData object or a dictionary {size -> ImageData} representing icon to be set. If the icon is specified as a dictionary, the actual image to be used is chosen depending on screen's pixel density. If the number of image pixels that fit into one screen space unit equals scale, then image with size scale * 19 will be selected. Initially only scales 1 and 2 will be supported. At least one image must be specified. Note that 'details.imageData = foo' is equivalent to 'details.imageData = {'19': foo}'
+ */
+ imageData?: ImageData;
+ /**
+ * Optional.
+ * Either a relative image path or a dictionary {size -> relative image path} pointing to icon to be set. If the icon is specified as a dictionary, the actual image to be used is chosen depending on screen's pixel density. If the number of image pixels that fit into one screen space unit equals scale, then image with size scale * 19 will be selected. Initially only scales 1 and 2 will be supported. At least one image must be specified. Note that 'details.path = foo' is equivalent to 'details.imageData = {'19': foo}'
+ */
+ path?: any;
+ }
+
+ /**
+ * Shows the page action. The page action is shown whenever the tab is selected.
+ * @param tabId The id of the tab for which you want to modify the page action.
+ */
+ export function hide(tabId: number): void;
+ /**
+ * Shows the page action. The page action is shown whenever the tab is selected.
+ * @param tabId The id of the tab for which you want to modify the page action.
+ */
+ export function show(tabId: number): void;
+ /** Sets the title of the page action. This is displayed in a tooltip over the page action. */
+ export function setTitle(details: TitleDetails): void;
+ /** Sets the html document to be opened as a popup when the user clicks on the page action's icon. */
+ export function setPopup(details: PopupDetails): void;
+ /**
+ * Gets the title of the page action.
+ * @since Chrome 19.
+ * @param callback The callback parameter should be a function that looks like this:
+ * function(string result) {...};
+ */
+ export function getTitle(details: GetDetails, callback: (result: string) => void): void;
+ /**
+ * Gets the html document set as the popup for this page action.
+ * @since Chrome 19.
+ * @param callback The callback parameter should be a function that looks like this:
+ * function(string result) {...};
+ */
+ export function getPopup(details: GetDetails, callback: (result: string) => void): void;
+ /**
+ * Sets the icon for the page action. The icon can be specified either as the path to an image file or as the pixel data from a canvas element, or as dictionary of either one of those. Either the path or the imageData property must be specified.
+ * @param callback If you specify the callback parameter, it should be a function that looks like this:
+ * function() {...};
+ */
+ export function setIcon(details: IconDetails, callback?: () => void): void;
+
+ /** Fired when a page action icon is clicked. This event will not fire if the page action has a popup. */
+ var onClicked: PageActionClickedEvent;
+}
+
+////////////////////
+// Page Capture
+////////////////////
+/**
+ * Use the chrome.pageCapture API to save a tab as MHTML.
+ * Permissions: "pageCapture"
+ * @since Chrome 18.
+ */
+declare namespace chrome.pageCapture {
+ interface SaveDetails {
+ /** The id of the tab to save as MHTML. */
+ tabId: number;
+ }
+
+ /**
+ * Saves the content of the tab with given id as MHTML.
+ * @param callback Called when the MHTML has been generated.
+ * The callback parameter should be a function that looks like this:
+ * function(binary mhtmlData) {...};
+ * Parameter mhtmlData: The MHTML data as a Blob.
+ */
+ export function saveAsMHTML(details: SaveDetails, callback: (mhtmlData: any) => void): void;
+}
+
+////////////////////
+// Permissions
+////////////////////
+/**
+ * Use the chrome.permissions API to request declared optional permissions at run time rather than install time, so users understand why the permissions are needed and grant only those that are necessary.
+ * @since Chrome 16.
+ */
+declare namespace chrome.permissions {
+ interface Permissions {
+ /**
+ * Optional.
+ * List of named permissions (does not include hosts or origins). Anything listed here must appear in the optional_permissions list in the manifest.
+ */
+ origins?: string[];
+ /**
+ * Optional.
+ * List of origin permissions. Anything listed here must be a subset of a host that appears in the optional_permissions list in the manifest. For example, if http://*.example.com/ or http://* appears in optional_permissions, you can request an origin of http://help.example.com/. Any path is ignored.
+ */
+ permissions?: string[];
+ }
+
+ interface PermissionsRemovedEvent {
+ /**
+ * @param callback The callback parameter should be a function that looks like this:
+ * function( Permissions permissions) {...};
+ * Parameter permissions: The permissions that have been removed.
+ */
+ addListener(callback: (permissions: Permissions) => void): void;
+ }
+
+ interface PermissionsAddedEvent {
+ /**
+ * @param callback The callback parameter should be a function that looks like this:
+ * function( Permissions permissions) {...};
+ * Parameter permissions: The newly acquired permissions.
+ */
+ addListener(callback: (permissions: Permissions) => void): void;
+ }
+
+ /**
+ * Checks if the extension has the specified permissions.
+ * @param callback The callback parameter should be a function that looks like this:
+ * function(boolean result) {...};
+ * Parameter result: True if the extension has the specified permissions.
+ */
+ export function contains(permissions: Permissions, callback: (result: boolean) => void): void;
+ /**
+ * Gets the extension's current set of permissions.
+ * @param callback The callback parameter should be a function that looks like this:
+ * function( Permissions permissions) {...};
+ * Parameter permissions: The extension's active permissions.
+ */
+ export function getAll(callback: (permissions: Permissions) => void): void;
+ /**
+ * Requests access to the specified permissions. These permissions must be defined in the optional_permissions field of the manifest. If there are any problems requesting the permissions, runtime.lastError will be set.
+ * @param callback If you specify the callback parameter, it should be a function that looks like this:
+ * function(boolean granted) {...};
+ * Parameter granted: True if the user granted the specified permissions.
+ */
+ export function request(permissions: Permissions, callback?: (granted: boolean) => void): void;
+ /**
+ * Removes access to the specified permissions. If there are any problems removing the permissions, runtime.lastError will be set.
+ * @param callback If you specify the callback parameter, it should be a function that looks like this:
+ * function(boolean removed) {...};
+ * Parameter removed: True if the permissions were removed.
+ */
+ export function remove(permissions: Permissions, callback?: (removed: boolean) => void): void;
+
+ /** Fired when access to permissions has been removed from the extension. */
+ var onRemoved: PermissionsRemovedEvent;
+ /** Fired when the extension acquires new permissions. */
+ var onAdded: PermissionsAddedEvent;
+}
+
+////////////////////
+// Platform Keys
+////////////////////
+/**
+ * Use the chrome.platformKeys API to access client certificates managed by the platform. If the user or policy grants the permission, an extension can use such a certficate in its custom authentication protocol. E.g. this allows usage of platform managed certificates in third party VPNs (see chrome.vpnProvider).
+ * Permissions: "platformKeys"
+ * Important: This API works only on Chrome OS.
+ * @since Chrome 45.
+ */
+declare namespace chrome.platformKeys {
+ interface Match {
+ /** The DER encoding of a X.509 certificate. */
+ certificate: ArrayBuffer;
+ /** The KeyAlgorithm of the certified key. This contains algorithm parameters that are inherent to the key of the certificate (e.g. the key length). Other parameters like the hash function used by the sign function are not included. */
+ keyAlgorithm: KeyAlgorithm;
+ }
+
+ interface ClientCertificateSelectRequestDetails {
+ /** This field is a list of the types of certificates requested, sorted in order of the server's preference. Only certificates of a type contained in this list will be retrieved. If certificateTypes is the empty list, however, certificates of any type will be returned. */
+ certificateTypes: string[];
+ /** List of distinguished names of certificate authorities allowed by the server. Each entry must be a DER-encoded X.509 DistinguishedName. */
+ certificateAuthorities: ArrayBuffer[];
+ }
+
+ interface ClientCertificateSelectDetails {
+ /** Only certificates that match this request will be returned. */
+ request: ClientCertificateSelectRequestDetails;
+ /**
+ * Optional.
+ * If given, the selectClientCertificates operates on this list. Otherwise, obtains the list of all certificates from the platform's certificate stores that are available to this extensions. Entries that the extension doesn't have permission for or which doesn't match the request, are removed.
+ */
+ clientCerts?: ArrayBuffer[];
+ /** If true, the filtered list is presented to the user to manually select a certificate and thereby granting the extension access to the certificate(s) and key(s). Only the selected certificate(s) will be returned. If is false, the list is reduced to all certificates that the extension has been granted access to (automatically or manually). */
+ interactive: boolean;
+ }
+
+ interface ServerCertificateVerificationDetails {
+ /** Each chain entry must be the DER encoding of a X.509 certificate, the first entry must be the server certificate and each entry must certify the entry preceding it. */
+ serverCertificateChain: ArrayBuffer[];
+ /** The hostname of the server to verify the certificate for, e.g. the server that presented the serverCertificateChain. */
+ hostname: string;
+ }
+
+ interface ServerCertificateVerificationResult {
+ /** The result of the trust verification: true if trust for the given verification details could be established and false if trust is rejected for any reason. */
+ trusted: boolean;
+ /**
+ * If the trust verification failed, this array contains the errors reported by the underlying network layer. Otherwise, this array is empty.
+ * Note: This list is meant for debugging only and may not contain all relevant errors. The errors returned may change in future revisions of this API, and are not guaranteed to be forwards or backwards compatible.
+ */
+ debug_errors: string[];
+ }
+
+ /**
+ * This function filters from a list of client certificates the ones that are known to the platform, match request and for which the extension has permission to access the certificate and its private key. If interactive is true, the user is presented a dialog where he can select from matching certificates and grant the extension access to the certificate. The selected/filtered client certificates will be passed to callback.
+ * @param callback The callback parameter should be a function that looks like this:
+ * function(array of Match matches) {...};
+ * Parameter matches: The list of certificates that match the request, that the extension has permission for and, if interactive is true, that were selected by the user.
+ */
+ export function selectClientCertificates(details: ClientCertificateSelectDetails, callback: (matches: Match[]) => void): void;
+ /**
+ * Passes the key pair of certificate for usage with platformKeys.subtleCrypto to callback.
+ * @param certificate The certificate of a Match returned by selectClientCertificates.
+ * @param parameters Determines signature/hash algorithm parameters additionally to the parameters fixed by the key itself. The same parameters are accepted as by WebCrypto's importKey function, e.g. RsaHashedImportParams for a RSASSA-PKCS1-v1_5 key. For RSASSA-PKCS1-v1_5 keys, additionally the parameters { 'hash': { 'name': 'none' } } are supported. The sign function will then apply PKCS#1 v1.5 padding and but not hash the given data.
+ * @param callback The public and private CryptoKey of a certificate which can only be used with platformKeys.subtleCrypto.
+ * The callback parameter should be a function that looks like this:
+ * function(object publicKey, object privateKey) {...};
+ * Optional parameter privateKey: Might be null if this extension does not have access to it.
+ */
+ export function getKeyPair(certificate: ArrayBuffer, parameters: Object, callback: (publicKey: CryptoKey, privateKey?: CryptoKey) => void): void;
+ /** An implementation of WebCrypto's SubtleCrypto that allows crypto operations on keys of client certificates that are available to this extension. */
+ export function subtleCrypto(): SubtleCrypto;
+ /**
+ * Checks whether details.serverCertificateChain can be trusted for details.hostname according to the trust settings of the platform. Note: The actual behavior of the trust verification is not fully specified and might change in the future. The API implementation verifies certificate expiration, validates the certification path and checks trust by a known CA. The implementation is supposed to respect the EKU serverAuth and to support subject alternative names.
+ * @param callback The callback parameter should be a function that looks like this:
+ * function(object result) {...};
+ */
+ export function verifyTLSServerCertificate(details: ServerCertificateVerificationDetails, callback: (result: ServerCertificateVerificationResult) => void): void;
+}
+
+////////////////////
+// Power
+////////////////////
+/**
+ * Use the chrome.power API to override the system's power management features.
+ * Permissions: "power"
+ * @since Chrome 27.
+ */
+declare namespace chrome.power {
+ /** Requests that power management be temporarily disabled. |level| describes the degree to which power management should be disabled. If a request previously made by the same app is still active, it will be replaced by the new request. */
+ export function requestKeepAwake(level: string): void;
+ /** Releases a request previously made via requestKeepAwake(). */
+ export function releaseKeepAwake(): void;
+}
+
+////////////////////
+// Printer Provider
+////////////////////
+/**
+ * The chrome.printerProvider API exposes events used by print manager to query printers controlled by extensions, to query their capabilities and to submit print jobs to these printers.
+ * Permissions: "printerProvider"
+ * @since Chrome 44.
+ */
+declare namespace chrome.printerProvider {
+ interface PrinterInfo {
+ /** Unique printer ID. */
+ id: string;
+ /** Printer's human readable name. */
+ name: string;
+ /** Optional. Printer's human readable description. */
+ description?: string;
+ }
+
+ interface PrinterCapabilities {
+ /** Device capabilities in CDD format. */
+ capabilities: any;
+ }
+
+ interface PrintJob {
+ /** ID of the printer which should handle the job. */
+ printerId: string;
+ /** The print job title. */
+ title: string;
+ /** Print ticket in CJT format. */
+ ticket: Object;
+ /** The document content type. Supported formats are "application/pdf" and "image/pwg-raster". */
+ contentType: string;
+ /** Blob containing the document data to print. Format must match |contentType|. */
+ document: Blob;
+ }
+
+ interface PrinterRequestedEvent extends chrome.events.Event<(resultCallback: (printerInfo: PrinterInfo[]) => void) => void> {}
+
+ interface PrinterInfoRequestedEvent extends chrome.events.Event<(device: any, resultCallback: (printerInfo?: PrinterInfo) => void) => void> {}
+
+ interface CapabilityRequestedEvent extends chrome.events.Event<(printerId: string, resultCallback: (capabilities: PrinterCapabilities) => void) => void> {}
+
+ interface PrintRequestedEvent extends chrome.events.Event<(printJob: PrintJob, resultCallback: (result: string) => void) => void> {}
+
+ /** Event fired when print manager requests printers provided by extensions. */
+ export var onGetPrintersRequested: PrinterRequestedEvent;
+ /**
+ * Event fired when print manager requests information about a USB device that may be a printer.
+ * Note: An application should not rely on this event being fired more than once per device. If a connected device is supported it should be returned in the onGetPrintersRequested event.
+ * @since Chrome 45.
+ */
+ export var onGetUsbPrinterInfoRequested: PrinterInfoRequestedEvent;
+ /** Event fired when print manager requests printer capabilities. */
+ export var onGetCapabilityRequested: CapabilityRequestedEvent;
+ /** Event fired when print manager requests printing. */
+ export var onPrintRequested: PrintRequestedEvent;
+}
+
+////////////////////
+// Privacy
+////////////////////
+/**
+ * Use the chrome.privacy API to control usage of the features in Chrome that can affect a user's privacy. This API relies on the ChromeSetting prototype of the type API for getting and setting Chrome's configuration.
+ * Permissions: "privacy"
+ * The Chrome Privacy Whitepaper gives background detail regarding the features which this API can control.
+ * @since Chrome 18.
+ */
+declare namespace chrome.privacy {
+ interface Services {
+ /** since Chrome 20. */
+ spellingServiceEnabled: chrome.types.ChromeSetting;
+ searchSuggestEnabled: chrome.types.ChromeSetting;
+ instantEnabled: chrome.types.ChromeSetting;
+ alternateErrorPagesEnabled: chrome.types.ChromeSetting;
+ safeBrowsingEnabled: chrome.types.ChromeSetting;
+ autofillEnabled: chrome.types.ChromeSetting;
+ translationServiceEnabled: chrome.types.ChromeSetting;
+ /** @since Chrome 38. */
+ passwordSavingEnabled: chrome.types.ChromeSetting;
+ /** @since Chrome 42. */
+ hotwordSearchEnabled: chrome.types.ChromeSetting;
+ /** @since Chrome 42. */
+ safeBrowsingExtendedReportingEnabled: chrome.types.ChromeSetting;
+ }
+
+ interface Network {
+ networkPredictionEnabled: chrome.types.ChromeSetting;
+ /** @since Chrome 42. */
+ webRTCMultipleRoutesEnabled: chrome.types.ChromeSetting;
+ /** @since Chrome 47. Warning: this is the current Dev channel. */
+ webRTCNonProxiedUdpEnabled: chrome.types.ChromeSetting;
+ }
+
+ interface Websites {
+ thirdPartyCookiesAllowed: chrome.types.ChromeSetting;
+ referrersEnabled: chrome.types.ChromeSetting;
+ hyperlinkAuditingEnabled: chrome.types.ChromeSetting;
+ /** @since Chrome 21. */
+ protectedContentEnabled: chrome.types.ChromeSetting;
+ }
+
+ /** Settings that enable or disable features that require third-party network services provided by Google and your default search provider. */
+ var services: Services;
+ /** Settings that influence Chrome's handling of network connections in general. */
+ var network: Network;
+ /** Settings that determine what information Chrome makes available to websites. */
+ var websites: Websites;
+}
+
+////////////////////
+// Proxy
+////////////////////
+/**
+ * Use the chrome.proxy API to manage Chrome's proxy settings. This API relies on the ChromeSetting prototype of the type API for getting and setting the proxy configuration.
+ * Permissions: "proxy"
+ * @since Chrome 13.
+ */
+declare namespace chrome.proxy {
+ /** An object holding proxy auto-config information. Exactly one of the fields should be non-empty. */
+ interface PacScript {
+ /** Optional. URL of the PAC file to be used. */
+ url?: string;
+ /** Optional. If true, an invalid PAC script will prevent the network stack from falling back to direct connections. Defaults to false. */
+ mandatory?: boolean;
+ /** Optional. A PAC script. */
+ data?: string;
+ }
+
+ /** An object encapsulating a complete proxy configuration. */
+ interface ProxyConfig {
+ /** Optional. The proxy rules describing this configuration. Use this for 'fixed_servers' mode. */
+ rules?: ProxyRules;
+ /** Optional. The proxy auto-config (PAC) script for this configuration. Use this for 'pac_script' mode. */
+ pacScript?: PacScript;
+ /**
+ * 'direct' = Never use a proxy
+ * 'auto_detect' = Auto detect proxy settings
+ * 'pac_script' = Use specified PAC script
+ * 'fixed_servers' = Manually specify proxy servers
+ * 'system' = Use system proxy settings
+ */
+ mode: string;
+ }
+
+ /** An object encapsulating a single proxy server's specification. */
+ interface ProxyServer {
+ /** The URI of the proxy server. This must be an ASCII hostname (in Punycode format). IDNA is not supported, yet. */
+ host: string;
+ /** Optional. The scheme (protocol) of the proxy server itself. Defaults to 'http'. */
+ scheme?: string;
+ /** Optional. The port of the proxy server. Defaults to a port that depends on the scheme. */
+ port?: number;
+ }
+
+ /** An object encapsulating the set of proxy rules for all protocols. Use either 'singleProxy' or (a subset of) 'proxyForHttp', 'proxyForHttps', 'proxyForFtp' and 'fallbackProxy'. */
+ interface ProxyRules {
+ /** Optional. The proxy server to be used for FTP requests. */
+ proxyForFtp?: ProxyServer;
+ /** Optional. The proxy server to be used for HTTP requests. */
+ proxyForHttp?: ProxyServer;
+ /** Optional. The proxy server to be used for everthing else or if any of the specific proxyFor... is not specified. */
+ fallbackProxy?: ProxyServer;
+ /** Optional. The proxy server to be used for all per-URL requests (that is http, https, and ftp). */
+ singleProxy?: ProxyServer;
+ /** Optional. The proxy server to be used for HTTPS requests. */
+ proxyForHttps?: ProxyServer;
+ /** Optional. List of servers to connect to without a proxy server. */
+ bypassList?: string[];
+ }
+
+ interface ErrorDetails {
+ /** Additional details about the error such as a JavaScript runtime error. */
+ details: string;
+ /** The error description. */
+ error: string;
+ /** If true, the error was fatal and the network transaction was aborted. Otherwise, a direct connection is used instead. */
+ fatal: boolean;
+ }
+
+ interface ProxyErrorEvent extends chrome.events.Event<(details: ErrorDetails) => void> {}
+
+ var settings: chrome.types.ChromeSetting;
+ /** Notifies about proxy errors. */
+ var onProxyError: ProxyErrorEvent;
+}
+
+////////////////////
+// Runtime
+////////////////////
+/**
+ * Use the chrome.runtime API to retrieve the background page, return details about the manifest, and listen for and respond to events in the app or extension lifecycle. You can also use this API to convert the relative path of URLs to fully-qualified URLs.
+ * @since Chrome 22
+ */
+declare namespace chrome.runtime {
+ /** This will be defined during an API method callback if there was an error */
+ var lastError: LastError;
+ /** The ID of the extension/app. */
+ var id: string;
+
+ interface LastError {
+ /** Optional. Details about the error which occurred. */
+ message?: string;
+ }
+
+ interface ConnectInfo {
+ name?: string;
+ }
+
+ interface InstalledDetails {
+ /**
+ * The reason that this event is being dispatched.
+ * One of: "install", "update", "chrome_update", or "shared_module_update"
+ */
+ reason: string;
+ /**
+ * Optional.
+ * Indicates the previous version of the extension, which has just been updated. This is present only if 'reason' is 'update'.
+ */
+ previousVersion?: string;
+ /**
+ * Optional.
+ * Indicates the ID of the imported shared module extension which updated. This is present only if 'reason' is 'shared_module_update'.
+ * @since Chrome 29.
+ */
+ id?: string;
+ }
+
+ interface MessageOptions {
+ /** Whether the TLS channel ID will be passed into onMessageExternal for processes that are listening for the connection event. */
+ includeTlsChannelId?: boolean;
+ }
+
+ /**
+ * An object containing information about the script context that sent a message or request.
+ * @since Chrome 26.
+ */
+ interface MessageSender {
+ /** The ID of the extension or app that opened the connection, if any. */
+ id?: string;
+ /** The tabs.Tab which opened the connection, if any. This property will only be present when the connection was opened from a tab (including content scripts), and only if the receiver is an extension, not an app. */
+ tab?: chrome.tabs.Tab;
+ /**
+ * The frame that opened the connection. 0 for top-level frames, positive for child frames. This will only be set when tab is set.
+ * @since Chrome 41.
+ */
+ frameId?: number;
+ /**
+ * The URL of the page or frame that opened the connection. If the sender is in an iframe, it will be iframe's URL not the URL of the page which hosts it.
+ * @since Chrome 28.
+ */
+ url?: string;
+ /**
+ * The TLS channel ID of the page or frame that opened the connection, if requested by the extension or app, and if available.
+ * @since Chrome 32.
+ */
+ tlsChannelId?: string;
+ }
+
+ /**
+ * An object containing information about the current platform.
+ * @since Chrome 36.
+ */
+ interface PlatformInfo {
+ /**
+ * The operating system chrome is running on.
+ * One of: "mac", "win", "android", "cros", "linux", or "openbsd"
+ */
+ os: string;
+ /**
+ * The machine's processor architecture.
+ * One of: "arm", "x86-32", or "x86-64"
+ */
+ arch: string;
+ /**
+ * The native client architecture. This may be different from arch on some platforms.
+ * One of: "arm", "x86-32", or "x86-64"
+ */
+ nacl_arch: string;
+ }
+
+ /**
+ * An object which allows two way communication with other pages.
+ * @since Chrome 26.
+ */
+ interface Port {
+ postMessage: (message: Object) => void;
+ disconnect: () => void;
+ /**
+ * Optional.
+ * This property will only be present on ports passed to onConnect/onConnectExternal listeners.
+ */
+ sender?: MessageSender;
+ /** An object which allows the addition and removal of listeners for a Chrome event. */
+ onDisconnect: chrome.events.Event<() => void>;
+ /** An object which allows the addition and removal of listeners for a Chrome event. */
+ onMessage: PortMessageEvent;
+ name: string;
+ }
+
+ interface UpdateAvailableDetails {
+ /** The version number of the available update. */
+ version: string;
+ }
+
+ interface UpdateCheckDetails {
+ /** The version of the available update. */
+ version: string;
+ }
+
+ interface PortMessageEvent extends chrome.events.Event<(message: Object, port: Port) => void> {}
+
+ interface ExtensionMessageEvent extends chrome.events.Event<(message: any, sender: MessageSender, sendResponse: (response: any) => void) => void> {}
+
+ interface ExtensionConnectEvent extends chrome.events.Event<(port: Port) => void> {}
+
+ interface RuntimeInstalledEvent extends chrome.events.Event<(details: InstalledDetails) => void> {}
+
+ interface RuntimeEvent extends chrome.events.Event<() => void> {}
+
+ interface RuntimeRestartRequiredEvent extends chrome.events.Event<(reason: string) => void> {}
+
+ interface RuntimeUpdateAvailableEvent extends chrome.events.Event<(details: UpdateAvailableDetails) => void> {}
+
+ interface ManifestIcons {
+ [size: number]: string;
+ }
+
+ interface ManifestAction {
+ default_icon?: ManifestIcons;
+ default_title?: string;
+ default_popup?: string;
+ }
+
+ interface SearchProvider {
+ name?: string;
+ keyword?: string;
+ favicon_url?: string;
+ search_url: string;
+ encoding?: string;
+ suggest_url?: string;
+ instant_url?: string;
+ image_url?: string;
+ search_url_post_params?: string;
+ suggest_url_post_params?: string;
+ instant_url_post_params?: string;
+ image_url_post_params?: string;
+ alternate_urls?: string[];
+ prepopulated_id?: number;
+ is_default?: boolean;
+ }
+
+ interface Manifest {
+ // Required
+ manifest_version: number;
+ name: string;
+ version: string;
+
+ // Recommended
+ default_locale?: string;
+ description?: string;
+ icons?: ManifestIcons;
+
+ // Pick one (or none)
+ browser_action?: ManifestAction;
+ page_action?: ManifestAction;
+
+ // Optional
+ author?: any;
+ automation?: any;
+ background?: {
+ scripts?: string[];
+ page?: string;
+ persistent?: boolean;
+ };
+ background_page?: string;
+ chrome_settings_overrides?: {
+ homepage?: string;
+ search_provider?: SearchProvider;
+ startup_pages?: string[];
+ };
+ chrome_ui_overrides?: {
+ bookmarks_ui?: {
+ remove_bookmark_shortcut?: boolean;
+ remove_button?: boolean;
+ }
+ };
+ chrome_url_overrides?: {
+ bookmarks?: string;
+ history?: string;
+ newtab?: string;
+ };
+ commands?: {
+ [name: string]: {
+ suggested_key?: {
+ default?: string;
+ windows?: string;
+ mac?: string;
+ chromeos?: string;
+ linux?: string;
+ };
+ description?: string;
+ global?: boolean
+ }
+ };
+ content_capabilities?: {
+ matches?: string[];
+ permissions?: string[];
+ };
+ content_scripts?: {
+ matches?: string[];
+ exclude_matches?: string[];
+ css?: string[];
+ js?: string[];
+ run_at?: string;
+ all_frames?: boolean;
+ include_globs?: string[];
+ exclude_globs?: string[];
+ }[];
+ content_security_policy?: string;
+ converted_from_user_script?: boolean;
+ copresence?: any;
+ current_locale?: string;
+ devtools_page?: string;
+ event_rules?: {
+ event?: string;
+ actions?: {
+ type: string;
+ }[];
+ conditions?: chrome.declarativeContent.PageStateMatcher[]
+ }[];
+ externally_connectable?: {
+ ids?: string[];
+ matches?: string[];
+ accepts_tls_channel_id?: boolean;
+ };
+ file_browser_handlers?: {
+ id?: string;
+ default_title?: string;
+ file_filters?: string[];
+ }[];
+ file_system_provider_capabilities?: {
+ configurable?: boolean;
+ watchable?: boolean;
+ multiple_mounts?: boolean;
+ source?: string;
+ };
+ homepage_url?: string;
+ import?: {
+ id: string;
+ minimum_version?: string
+ }[];
+ export?: {
+ whitelist?: string[]
+ };
+ incognito?: string;
+ input_components?: {
+ name?: string;
+ type?: string;
+ id?: string;
+ description?: string;
+ language?: string;
+ layouts?: any[];
+ }[];
+ key?: string;
+ minimum_chrome_version?: string;
+ nacl_modules?: {
+ path: string;
+ mime_type: string;
+ }[];
+ oauth2?: {
+ client_id: string;
+ scopes?: string[];
+ };
+ offline_enabled?: boolean;
+ omnibox?: {
+ keyword: string;
+ };
+ optional_permissions?: string[];
+ options_page?: string;
+ options_ui?: {
+ page?: string;
+ chrome_style?: boolean;
+ open_in_tab?: boolean;
+ };
+ permissions?: string[];
+ platforms?: {
+ nacl_arch?: string;
+ sub_package_path: string;
+ }[];
+ plugins?: {
+ path: string;
+ }[];
+ requirements?: {
+ '3D'?: {
+ features?: string[]
+ };
+ plugins?: {
+ npapi?: boolean;
+ }
+ };
+ sandbox?: {
+ pages: string[];
+ content_security_policy?: string;
+ };
+ short_name?: string;
+ signature?: any;
+ spellcheck?: {
+ dictionary_language?: string;
+ dictionary_locale?: string;
+ dictionary_format?: string;
+ dictionary_path?: string;
+ };
+ storage?: {
+ managed_schema: string
+ };
+ system_indicator?: any;
+ tts_engine?: {
+ voices: {
+ voice_name: string;
+ lang?: string;
+ gender?: string;
+ event_types?: string[];
+ }[]
+ };
+ update_url?: string;
+ version_name?: string;
+ web_accessible_resources?: string[];
+ [key: string]: any;
+ }
+
+ /**
+ * Attempts to connect to connect listeners within an extension/app (such as the background page), or other extensions/apps. This is useful for content scripts connecting to their extension processes, inter-app/extension communication, and web messaging. Note that this does not connect to any listeners in a content script. Extensions may connect to content scripts embedded in tabs via tabs.connect.
+ * @since Chrome 26.
+ */
+ export function connect(connectInfo?: ConnectInfo): Port;
+ /**
+ * Attempts to connect to connect listeners within an extension/app (such as the background page), or other extensions/apps. This is useful for content scripts connecting to their extension processes, inter-app/extension communication, and web messaging. Note that this does not connect to any listeners in a content script. Extensions may connect to content scripts embedded in tabs via tabs.connect.
+ * @since Chrome 26.
+ * @param extensionId Optional.
+ * The ID of the extension or app to connect to. If omitted, a connection will be attempted with your own extension. Required if sending messages from a web page for web messaging.
+ */
+ export function connect(extensionId: string, connectInfo?: ConnectInfo): Port;
+ /**
+ * Connects to a native application in the host machine.
+ * @since Chrome 28.
+ * @param application The name of the registered application to connect to.
+ */
+ export function connectNative(application: string): Port;
+ /** Retrieves the JavaScript 'window' object for the background page running inside the current extension/app. If the background page is an event page, the system will ensure it is loaded before calling the callback. If there is no background page, an error is set. */
+ export function getBackgroundPage(callback: (backgroundPage?: Window) => void): void;
+ /**
+ * Returns details about the app or extension from the manifest. The object returned is a serialization of the full manifest file.
+ * @returns The manifest details.
+ */
+ export function getManifest(): Manifest;
+ /**
+ * Returns a DirectoryEntry for the package directory.
+ * @since Chrome 29.
+ */
+ export function getPackageDirectoryEntry(callback: (directoryEntry: DirectoryEntry) => void): void;
+ /**
+ * Returns information about the current platform.
+ * @since Chrome 29.
+ * @param callback Called with results
+ */
+ export function getPlatformInfo(callback: (platformInfo: PlatformInfo) => void): void;
+ /**
+ * Converts a relative path within an app/extension install directory to a fully-qualified URL.
+ * @param path A path to a resource within an app/extension expressed relative to its install directory.
+ */
+ export function getURL(path: string): string;
+ /**
+ * Reloads the app or extension.
+ * @since Chrome 25.
+ */
+ export function reload(): void;
+ /**
+ * Requests an update check for this app/extension.
+ * @since Chrome 25.
+ * @param callback
+ * Parameter status: Result of the update check. One of: "throttled", "no_update", or "update_available"
+ * Optional parameter details: If an update is available, this contains more information about the available update.
+ */
+ export function requestUpdateCheck(callback: (status: string, details?: UpdateCheckDetails) => void): void;
+ /**
+ * Restart the ChromeOS device when the app runs in kiosk mode. Otherwise, it's no-op.
+ * @since Chrome 32.
+ */
+ export function restart(): void;
+ /**
+ * Sends a single message to event listeners within your extension/app or a different extension/app. Similar to runtime.connect but only sends a single message, with an optional response. If sending to your extension, the runtime.onMessage event will be fired in each page, or runtime.onMessageExternal, if a different extension. Note that extensions cannot send messages to content scripts using this method. To send messages to content scripts, use tabs.sendMessage.
+ * @since Chrome 26.
+ * @param responseCallback Optional
+ * Parameter response: The JSON response object sent by the handler of the message. If an error occurs while connecting to the extension, the callback will be called with no arguments and runtime.lastError will be set to the error message.
+ */
+ export function sendMessage(message: any, responseCallback?: (response: any) => void): void;
+ /**
+ * Sends a single message to event listeners within your extension/app or a different extension/app. Similar to runtime.connect but only sends a single message, with an optional response. If sending to your extension, the runtime.onMessage event will be fired in each page, or runtime.onMessageExternal, if a different extension. Note that extensions cannot send messages to content scripts using this method. To send messages to content scripts, use tabs.sendMessage.
+ * @since Chrome 32.
+ * @param responseCallback Optional
+ * Parameter response: The JSON response object sent by the handler of the message. If an error occurs while connecting to the extension, the callback will be called with no arguments and runtime.lastError will be set to the error message.
+ */
+ export function sendMessage(message: any, options: MessageOptions, responseCallback?: (response: any) => void): void;
+ /**
+ * Sends a single message to event listeners within your extension/app or a different extension/app. Similar to runtime.connect but only sends a single message, with an optional response. If sending to your extension, the runtime.onMessage event will be fired in each page, or runtime.onMessageExternal, if a different extension. Note that extensions cannot send messages to content scripts using this method. To send messages to content scripts, use tabs.sendMessage.
+ * @since Chrome 26.
+ * @param extensionId The ID of the extension/app to send the message to. If omitted, the message will be sent to your own extension/app. Required if sending messages from a web page for web messaging.
+ * @param responseCallback Optional
+ * Parameter response: The JSON response object sent by the handler of the message. If an error occurs while connecting to the extension, the callback will be called with no arguments and runtime.lastError will be set to the error message.
+ */
+ export function sendMessage(extensionId: string, message: any, responseCallback?: (response: any) => void): void;
+ /**
+ * Sends a single message to event listeners within your extension/app or a different extension/app. Similar to runtime.connect but only sends a single message, with an optional response. If sending to your extension, the runtime.onMessage event will be fired in each page, or runtime.onMessageExternal, if a different extension. Note that extensions cannot send messages to content scripts using this method. To send messages to content scripts, use tabs.sendMessage.
+ * @since Chrome 32.
+ * @param extensionId The ID of the extension/app to send the message to. If omitted, the message will be sent to your own extension/app. Required if sending messages from a web page for web messaging.
+ * @param responseCallback Optional
+ * Parameter response: The JSON response object sent by the handler of the message. If an error occurs while connecting to the extension, the callback will be called with no arguments and runtime.lastError will be set to the error message.
+ */
+ export function sendMessage(extensionId: string, message: any, options: MessageOptions, responseCallback?: (response: any) => void): void;
+ /**
+ * Send a single message to a native application.
+ * @since Chrome 28.
+ * @param application The of the native messaging host.
+ * @param message The message that will be passed to the native messaging host.
+ * @param responseCallback Optional.
+ * Parameter response: The response message sent by the native messaging host. If an error occurs while connecting to the native messaging host, the callback will be called with no arguments and runtime.lastError will be set to the error message.
+ */
+ export function sendNativeMessage(application: string, message: Object, responseCallback?: (response: any) => void): void;
+ /**
+ * Sets the URL to be visited upon uninstallation. This may be used to clean up server-side data, do analytics, and implement surveys. Maximum 255 characters.
+ * @since Chrome 41.
+ * @param url Since Chrome 34.
+ * URL to be opened after the extension is uninstalled. This URL must have an http: or https: scheme. Set an empty string to not open a new tab upon uninstallation.
+ * @param callback Called when the uninstall URL is set. If the given URL is invalid, runtime.lastError will be set.
+ */
+ export function setUninstallURL(url: string, callback?: () => void): void;
+ /**
+ * Open your Extension's options page, if possible.
+ * The precise behavior may depend on your manifest's options_ui or options_page key, or what Chrome happens to support at the time. For example, the page may be opened in a new tab, within chrome://extensions, within an App, or it may just focus an open options page. It will never cause the caller page to reload.
+ * If your Extension does not declare an options page, or Chrome failed to create one for some other reason, the callback will set lastError.
+ * @since Chrome 42.
+ */
+ export function openOptionsPage(callback?: () => void): void;
+
+ /**
+ * Fired when a connection is made from either an extension process or a content script.
+ * @since Chrome 26.
+ */
+ var onConnect: ExtensionConnectEvent;
+ /**
+ * Fired when a connection is made from another extension.
+ * @since Chrome 26.
+ */
+ var onConnectExternal: ExtensionConnectEvent;
+ /** Sent to the event page just before it is unloaded. This gives the extension opportunity to do some clean up. Note that since the page is unloading, any asynchronous operations started while handling this event are not guaranteed to complete. If more activity for the event page occurs before it gets unloaded the onSuspendCanceled event will be sent and the page won't be unloaded. */
+ var onSuspend: RuntimeEvent;
+ /**
+ * Fired when a profile that has this extension installed first starts up. This event is not fired when an incognito profile is started, even if this extension is operating in 'split' incognito mode.
+ * @since Chrome 23.
+ */
+ var onStartup: RuntimeEvent;
+ /** Fired when the extension is first installed, when the extension is updated to a new version, and when Chrome is updated to a new version. */
+ var onInstalled: RuntimeInstalledEvent;
+ /** Sent after onSuspend to indicate that the app won't be unloaded after all. */
+ var onSuspendCanceled: RuntimeEvent;
+ /**
+ * Fired when a message is sent from either an extension process or a content script.
+ * @since Chrome 26.
+ */
+ var onMessage: ExtensionMessageEvent;
+ /**
+ * Fired when a message is sent from another extension/app. Cannot be used in a content script.
+ * @since Chrome 26.
+ */
+ var onMessageExternal: ExtensionMessageEvent;
+ /**
+ * Fired when an app or the device that it runs on needs to be restarted. The app should close all its windows at its earliest convenient time to let the restart to happen. If the app does nothing, a restart will be enforced after a 24-hour grace period has passed. Currently, this event is only fired for Chrome OS kiosk apps.
+ * @since Chrome 29.
+ */
+ var onRestartRequired: RuntimeRestartRequiredEvent;
+ /**
+ * Fired when an update is available, but isn't installed immediately because the app is currently running. If you do nothing, the update will be installed the next time the background page gets unloaded, if you want it to be installed sooner you can explicitly call chrome.runtime.reload(). If your extension is using a persistent background page, the background page of course never gets unloaded, so unless you call chrome.runtime.reload() manually in response to this event the update will not get installed until the next time chrome itself restarts. If no handlers are listening for this event, and your extension has a persistent background page, it behaves as if chrome.runtime.reload() is called in response to this event.
+ * @since Chrome 25.
+ */
+ var onUpdateAvailable: RuntimeUpdateAvailableEvent;
+ /**
+ * @deprecated since Chrome 33. Please use chrome.runtime.onRestartRequired.
+ * Fired when a Chrome update is available, but isn't installed immediately because a browser restart is required.
+ */
+ var onBrowserUpdateAvailable: RuntimeEvent;
+}
+
+////////////////////
+// Script Badge
+////////////////////
+declare namespace chrome.scriptBadge {
+ interface GetPopupDetails {
+ tabId: number;
+ }
+
+ interface AttentionDetails {
+ tabId: number;
+ }
+
+ interface SetPopupDetails {
+ tabId: number;
+ popup: string;
+ }
+
+ interface ScriptBadgeClickedEvent extends chrome.events.Event<(tab: chrome.tabs.Tab) => void> {}
+
+ export function getPopup(details: GetPopupDetails, callback: Function): void;
+ export function getAttention(details: AttentionDetails): void;
+ export function setPopup(details: SetPopupDetails): void;
+
+ var onClicked: ScriptBadgeClickedEvent;
+}
+
+////////////////////
+// Sessions
+////////////////////
+/**
+ * Use the chrome.sessions API to query and restore tabs and windows from a browsing session.
+ * Permissions: "sessions"
+ * @since Chrome 37.
+ */
+declare namespace chrome.sessions {
+ interface Filter {
+ /**
+ * Optional.
+ * The maximum number of entries to be fetched in the requested list. Omit this parameter to fetch the maximum number of entries (sessions.MAX_SESSION_RESULTS).
+ */
+ maxResults?: number;
+ }
+
+ interface Session {
+ /** The time when the window or tab was closed or modified, represented in milliseconds since the epoch. */
+ lastModified: number;
+ /**
+ * Optional.
+ * The tabs.Tab, if this entry describes a tab. Either this or sessions.Session.window will be set.
+ */
+ tab?: tabs.Tab;
+ /**
+ * Optional.
+ * The windows.Window, if this entry describes a window. Either this or sessions.Session.tab will be set.
+ */
+ window?: windows.Window;
+ }
+
+ interface Device {
+ /** The name of the foreign device. */
+ deviceName: string;
+ /** A list of open window sessions for the foreign device, sorted from most recently to least recently modified session. */
+ sessions: Session[];
+ }
+
+ interface SessionChangedEvent extends chrome.events.Event<() => void> {}
+
+ /** The maximum number of sessions.Session that will be included in a requested list. */
+ export var MAX_SESSION_RESULTS: number;
+
+ /**
+ * Gets the list of recently closed tabs and/or windows.
+ * @param callback
+ * Parameter sessions: The list of closed entries in reverse order that they were closed (the most recently closed tab or window will be at index 0). The entries may contain either tabs or windows.
+ */
+ export function getRecentlyClosed(filter: Filter, callback: (sessions: Session[]) => void): void;
+ /**
+ * Gets the list of recently closed tabs and/or windows.
+ * @param callback
+ * Parameter sessions: The list of closed entries in reverse order that they were closed (the most recently closed tab or window will be at index 0). The entries may contain either tabs or windows.
+ */
+ export function getRecentlyClosed(callback: (sessions: Session[]) => void): void;
+ /**
+ * Retrieves all devices with synced sessions.
+ * @param callback
+ * Parameter devices: The list of sessions.Device objects for each synced session, sorted in order from device with most recently modified session to device with least recently modified session. tabs.Tab objects are sorted by recency in the windows.Window of the sessions.Session objects.
+ */
+ export function getDevices(filter: Filter, callback: (devices: Device[]) => void): void;
+ /**
+ * Retrieves all devices with synced sessions.
+ * @param callback
+ * Parameter devices: The list of sessions.Device objects for each synced session, sorted in order from device with most recently modified session to device with least recently modified session. tabs.Tab objects are sorted by recency in the windows.Window of the sessions.Session objects.
+ */
+ export function getDevices(callback: (devices: Device[]) => void): void;
+ /**
+ * Reopens a windows.Window or tabs.Tab, with an optional callback to run when the entry has been restored.
+ * @param sessionId Optional.
+ * The windows.Window.sessionId, or tabs.Tab.sessionId to restore. If this parameter is not specified, the most recently closed session is restored.
+ * @param callback Optional.
+ * Parameter restoredSession: A sessions.Session containing the restored windows.Window or tabs.Tab object.
+ */
+ export function restore(sessionId?: string, callback?: (restoredSession: Session) => void): void;
+
+ /** Fired when recently closed tabs and/or windows are changed. This event does not monitor synced sessions changes. */
+ export var onChanged: SessionChangedEvent;
+}
+
+////////////////////
+// Storage
+////////////////////
+/**
+ * Use the chrome.storage API to store, retrieve, and track changes to user data.
+ * Permissions: "storage"
+ * @since Chrome 20.
+ */
+declare namespace chrome.storage {
+ interface StorageArea {
+ /**
+ * Gets the amount of space (in bytes) being used by one or more items.
+ * @param callback Callback with the amount of space being used by storage, or on failure (in which case runtime.lastError will be set).
+ * Parameter bytesInUse: Amount of space being used in storage, in bytes.
+ */
+ getBytesInUse(callback: (bytesInUse: number) => void): void;
+ /**
+ * Gets the amount of space (in bytes) being used by one or more items.
+ * @param key A single key to get the total usage for. Pass in null to get the total usage of all of storage.
+ * @param callback Callback with the amount of space being used by storage, or on failure (in which case runtime.lastError will be set).
+ * Parameter bytesInUse: Amount of space being used in storage, in bytes.
+ */
+ getBytesInUse(key: string, callback: (bytesInUse: number) => void): void;
+ /**
+ * Gets the amount of space (in bytes) being used by one or more items.
+ * @param keys A list of keys to get the total usage for. An empty list will return 0. Pass in null to get the total usage of all of storage.
+ * @param callback Callback with the amount of space being used by storage, or on failure (in which case runtime.lastError will be set).
+ * Parameter bytesInUse: Amount of space being used in storage, in bytes.
+ */
+ getBytesInUse(keys: string[], callback: (bytesInUse: number) => void): void;
+ /**
+ * Removes all items from storage.
+ * @param callback Optional.
+ * Callback on success, or on failure (in which case runtime.lastError will be set).
+ */
+ clear(callback?: () => void): void;
+ /**
+ * Sets multiple items.
+ * @param items An object which gives each key/value pair to update storage with. Any other key/value pairs in storage will not be affected.
+ * Primitive values such as numbers will serialize as expected. Values with a typeof "object" and "function" will typically serialize to {}, with the exception of Array (serializes as expected), Date, and Regex (serialize using their String representation).
+ * @param callback Optional.
+ * Callback on success, or on failure (in which case runtime.lastError will be set).
+ */
+ set(items: Object, callback?: () => void): void;
+ /**
+ * Removes one item from storage.
+ * @param key A single key for items to remove.
+ * @param callback Optional.
+ * Callback on success, or on failure (in which case runtime.lastError will be set).
+ */
+ remove(key: string, callback?: () => void): void;
+ /**
+ * Removes items from storage.
+ * @param keys A list of keys for items to remove.
+ * @param callback Optional.
+ * Callback on success, or on failure (in which case runtime.lastError will be set).
+ */
+ remove(keys: string[], callback?: () => void): void;
+ /**
+ * Gets one or more items from storage.
+ * @param callback Callback with storage items, or on failure (in which case runtime.lastError will be set).
+ * Parameter items: Object with items in their key-value mappings.
+ */
+ get(callback: (items: { [key: string]: any }) => void): void;
+ /**
+ * Gets one or more items from storage.
+ * @param key A single key to get. Pass in null to get the entire contents of storage.
+ * @param callback Callback with storage items, or on failure (in which case runtime.lastError will be set).
+ * Parameter items: Object with items in their key-value mappings.
+ */
+ get(key: string, callback: (items: { [key: string]: any }) => void): void;
+ /**
+ * Gets one or more items from storage.
+ * @param keys A list of keys to get. An empty list or object will return an empty result object. Pass in null to get the entire contents of storage.
+ * @param callback Callback with storage items, or on failure (in which case runtime.lastError will be set).
+ * Parameter items: Object with items in their key-value mappings.
+ */
+ get(keys: string[], callback: (items: { [key: string]: any }) => void): void;
+ /**
+ * Gets one or more items from storage.
+ * @param keys A dictionary specifying default values. Pass in null to get the entire contents of storage.
+ * @param callback Callback with storage items, or on failure (in which case runtime.lastError will be set).
+ * Parameter items: Object with items in their key-value mappings.
+ */
+ get(keys: Object, callback: (items: { [key: string]: any }) => void): void;
+ }
+
+ interface StorageChange {
+ /** Optional. The new value of the item, if there is a new value. */
+ newValue?: any;
+ /** Optional. The old value of the item, if there was an old value. */
+ oldValue?: any;
+ }
+
+ interface LocalStorageArea extends StorageArea {
+ /** The maximum amount (in bytes) of data that can be stored in local storage, as measured by the JSON stringification of every value plus every key's length. This value will be ignored if the extension has the unlimitedStorage permission. Updates that would cause this limit to be exceeded fail immediately and set runtime.lastError. */
+ QUOTA_BYTES: number;
+ }
+
+ interface SyncStorageArea extends StorageArea {
+ /** @deprecated since Chrome 40. The storage.sync API no longer has a sustained write operation quota. */
+ MAX_SUSTAINED_WRITE_OPERATIONS_PER_MINUTE: number;
+ /** The maximum total amount (in bytes) of data that can be stored in sync storage, as measured by the JSON stringification of every value plus every key's length. Updates that would cause this limit to be exceeded fail immediately and set runtime.lastError. */
+ QUOTA_BYTES: number;
+ /** The maximum size (in bytes) of each individual item in sync storage, as measured by the JSON stringification of its value plus its key length. Updates containing items larger than this limit will fail immediately and set runtime.lastError. */
+ QUOTA_BYTES_PER_ITEM: number;
+ /** The maximum number of items that can be stored in sync storage. Updates that would cause this limit to be exceeded will fail immediately and set runtime.lastError. */
+ MAX_ITEMS: number;
+ /**
+ * The maximum number of set, remove, or clear operations that can be performed each hour. This is 1 every 2 seconds, a lower ceiling than the short term higher writes-per-minute limit.
+ * Updates that would cause this limit to be exceeded fail immediately and set runtime.lastError.
+ */
+ MAX_WRITE_OPERATIONS_PER_HOUR: number;
+ /**
+ * The maximum number of set, remove, or clear operations that can be performed each minute. This is 2 per second, providing higher throughput than writes-per-hour over a shorter period of time.
+ * Updates that would cause this limit to be exceeded fail immediately and set runtime.lastError.
+ * @since Chrome 40.
+ */
+ MAX_WRITE_OPERATIONS_PER_MINUTE: number;
+ }
+
+ interface StorageChangedEvent extends chrome.events.Event<(changes: { [key: string]: StorageChange }, areaName: string) => void> {}
+
+ /** Items in the local storage area are local to each machine. */
+ var local: LocalStorageArea;
+ /** Items in the sync storage area are synced using Chrome Sync. */
+ var sync: SyncStorageArea;
+
+ /**
+ * Items in the managed storage area are set by the domain administrator, and are read-only for the extension; trying to modify this namespace results in an error.
+ * @since Chrome 33.
+ */
+ var managed: StorageArea;
+
+ /** Fired when one or more items change. */
+ var onChanged: StorageChangedEvent;
+}
+
+////////////////////
+// Socket
+////////////////////
+declare namespace chrome.socket {
+ interface CreateInfo {
+ socketId: number;
+ }
+
+ interface AcceptInfo {
+ resultCode: number;
+ socketId?: number;
+ }
+
+ interface ReadInfo {
+ resultCode: number;
+ data: ArrayBuffer;
+ }
+
+ interface WriteInfo {
+ bytesWritten: number;
+ }
+
+ interface RecvFromInfo {
+ resultCode: number;
+ data: ArrayBuffer;
+ port: number;
+ address: string;
+ }
+
+ interface SocketInfo {
+ socketType: string;
+ localPort?: number;
+ peerAddress?: string;
+ peerPort?: number;
+ localAddress?: string;
+ connected: boolean;
+ }
+
+ interface NetworkInterface {
+ name: string;
+ address: string;
+ }
+
+ export function create(type: string, options?: Object, callback?: (createInfo: CreateInfo) => void): void;
+ export function destroy(socketId: number): void;
+ export function connect(socketId: number, hostname: string, port: number, callback: (result: number) => void): void;
+ export function bind(socketId: number, address: string, port: number, callback: (result: number) => void): void;
+ export function disconnect(socketId: number): void;
+ export function read(socketId: number, bufferSize?: number, callback?: (readInfo: ReadInfo) => void): void;
+ export function write(socketId: number, data: ArrayBuffer, callback?: (writeInfo: WriteInfo) => void): void;
+ export function recvFrom(socketId: number, bufferSize?: number, callback?: (recvFromInfo: RecvFromInfo) => void): void;
+ export function sendTo(socketId: number, data: ArrayBuffer, address: string, port: number, callback?: (writeInfo: WriteInfo) => void): void;
+ export function listen(socketId: number, address: string, port: number, backlog?: number, callback?: (result: number) => void): void;
+ export function accept(socketId: number, callback?: (acceptInfo: AcceptInfo) => void): void;
+ export function setKeepAlive(socketId: number, enable: boolean, delay?: number, callback?: (result: boolean) => void): void;
+ export function setNoDelay(socketId: number, noDelay: boolean, callback?: (result: boolean) => void): void;
+ export function getInfo(socketId: number, callback: (result: SocketInfo) => void): void;
+ export function getNetworkList(callback: (result: NetworkInterface[]) => void): void;
+}
+
+////////////////////
+// System CPU
+////////////////////
+/**
+ * Use the system.cpu API to query CPU metadata.
+ * Permissions: "system.cpu"
+ * @since Chrome 32.
+ */
+declare namespace chrome.system.cpu {
+ interface ProcessorUsage {
+ /** The cumulative time used by userspace programs on this processor. */
+ user: number;
+ /** The cumulative time used by kernel programs on this processor. */
+ kernel: number;
+ /** The cumulative time spent idle by this processor. */
+ idle: number;
+ /** The total cumulative time for this processor. This value is equal to user + kernel + idle. */
+ total: number;
+ }
+
+ interface ProcessorInfo {
+ /** Cumulative usage info for this logical processor. */
+ usage: ProcessorUsage;
+ }
+
+ interface CpuInfo {
+ /** The number of logical processors. */
+ numOfProcessors: number;
+ /** The architecture name of the processors. */
+ archName: string;
+ /** The model name of the processors. */
+ modelName: string;
+ /**
+ * A set of feature codes indicating some of the processor's capabilities.
+ * The currently supported codes are "mmx", "sse", "sse2", "sse3", "ssse3", "sse4_1", "sse4_2", and "avx".
+ */
+ features: string[];
+ /** Information about each logical processor. */
+ processors: ProcessorInfo[];
+ }
+
+ /** Queries basic CPU information of the system. */
+ export function getInfo(callback: (info: CpuInfo) => void): void;
+}
+
+////////////////////
+// System Memory
+////////////////////
+/**
+ * The chrome.system.memory API.
+ * Permissions: "system.memory"
+ * @since Chrome 32.
+ */
+declare namespace chrome.system.memory {
+ interface MemoryInfo {
+ /** The total amount of physical memory capacity, in bytes. */
+ capacity: number;
+ /** The amount of available capacity, in bytes. */
+ availableCapacity: number;
+ }
+
+ /** Get physical memory information. */
+ export function getInfo(callback: (info: MemoryInfo) => void): void;
+}
+
+////////////////////
+// System Storage
+////////////////////
+/**
+ * Use the chrome.system.storage API to query storage device information and be notified when a removable storage device is attached and detached.
+ * Permissions: "system.storage"
+ * @since Chrome 30.
+ */
+declare namespace chrome.system.storage {
+ interface StorageUnitInfo {
+ /** The transient ID that uniquely identifies the storage device. This ID will be persistent within the same run of a single application. It will not be a persistent identifier between different runs of an application, or between different applications. */
+ id: string;
+ /** The name of the storage unit. */
+ name: string;
+ /**
+ * The media type of the storage unit.
+ * fixed: The storage has fixed media, e.g. hard disk or SSD.
+ * removable: The storage is removable, e.g. USB flash drive.
+ * unknown: The storage type is unknown.
+ */
+ type: string;
+ /** The total amount of the storage space, in bytes. */
+ capacity: number;
+ }
+
+ interface StorageCapacityInfo {
+ /** A copied |id| of getAvailableCapacity function parameter |id|. */
+ id: string;
+ /** The available capacity of the storage device, in bytes. */
+ availableCapacity: number;
+ }
+
+ interface SystemStorageAttachedEvent extends chrome.events.Event<(info: StorageUnitInfo) => void> {}
+
+ interface SystemStorageDetachedEvent extends chrome.events.Event<(id: string) => void> {}
+
+ /** Get the storage information from the system. The argument passed to the callback is an array of StorageUnitInfo objects. */
+ export function getInfo(callback: (info: StorageUnitInfo[]) => void): void;
+ /**
+ * Ejects a removable storage device.
+ * @param callback
+ * Parameter result: success: The ejection command is successful -- the application can prompt the user to remove the device; in_use: The device is in use by another application. The ejection did not succeed; the user should not remove the device until the other application is done with the device; no_such_device: There is no such device known. failure: The ejection command failed.
+ */
+ export function ejectDevice(id: string, callback: (result: string) => void): void;
+ /**
+ * Get the available capacity of a specified |id| storage device. The |id| is the transient device ID from StorageUnitInfo.
+ * @since Dev channel only.
+ */
+ export function getAvailableCapacity(id: string, callback: (info: StorageCapacityInfo) => void): void;
+
+ /** Fired when a new removable storage is attached to the system. */
+ export var onAttached: SystemStorageAttachedEvent;
+ /** Fired when a removable storage is detached from the system. */
+ export var onDetached: SystemStorageDetachedEvent;
+}
+
+////////////////////
+// TabCapture
+////////////////////
+/**
+ * Use the chrome.tabCapture API to interact with tab media streams.
+ * Permissions: "tabCapture"
+ * @since Chrome 31.
+ */
+declare namespace chrome.tabCapture {
+ interface CaptureInfo {
+ /** The id of the tab whose status changed. */
+ tabId: number;
+ /**
+ * The new capture status of the tab.
+ * One of: "pending", "active", "stopped", or "error"
+ */
+ status: string;
+ /** Whether an element in the tab being captured is in fullscreen mode. */
+ fullscreen: boolean;
+ }
+
+ interface CaptureOptions {
+ /** Optional. */
+ audio?: boolean;
+ /** Optional. */
+ video?: boolean;
+ /** Optional. */
+ audioConstraints?: MediaStreamConstraints;
+ /** Optional. */
+ videoConstraints?: MediaStreamConstraints;
+ }
+
+ interface CaptureStatusChangedEvent extends chrome.events.Event<(info: CaptureInfo) => void> {}
+
+ /**
+ * Captures the visible area of the currently active tab. Capture can only be started on the currently active tab after the extension has been invoked. Capture is maintained across page navigations within the tab, and stops when the tab is closed, or the media stream is closed by the extension.
+ * @param options Configures the returned media stream.
+ * @param callback Callback with either the tab capture stream or null.
+ */
+ export function capture(options: CaptureOptions, callback: (stream: MediaStream) => void): void;
+ /**
+ * Returns a list of tabs that have requested capture or are being captured, i.e. status != stopped and status != error. This allows extensions to inform the user that there is an existing tab capture that would prevent a new tab capture from succeeding (or to prevent redundant requests for the same tab).
+ * @param callback Callback invoked with CaptureInfo[] for captured tabs.
+ */
+ export function getCapturedTabs(callback: (result: CaptureInfo[]) => void): void;
+
+ /** Event fired when the capture status of a tab changes. This allows extension authors to keep track of the capture status of tabs to keep UI elements like page actions in sync. */
+ var onStatusChanged: CaptureStatusChangedEvent;
+}
+
+////////////////////
+// Tabs
+////////////////////
+/**
+ * Use the chrome.tabs API to interact with the browser's tab system. You can use this API to create, modify, and rearrange tabs in the browser.
+ * Permissions: The majority of the chrome.tabs API can be used without declaring any permission. However, the "tabs" permission is required in order to populate the url, title, and favIconUrl properties of Tab.
+ * @since Chrome 5.
+ */
+declare namespace chrome.tabs {
+ /**
+ * Tab muted state and the reason for the last state change.
+ * @since Chrome 46. Warning: this is the current Beta channel.
+ */
+ interface MutedInfo {
+ /** Whether the tab is prevented from playing sound (but hasn't necessarily recently produced sound). Equivalent to whether the muted audio indicator is showing. */
+ muted: boolean;
+ /**
+ * Optional.
+ * The reason the tab was muted or unmuted. Not set if the tab's mute state has never been changed.
+ * "user": A user input action has set/overridden the muted state.
+ * "capture": Tab capture started, forcing a muted state change.
+ * "extension": An extension, identified by the extensionId field, set the muted state.
+ */
+ reason?: string;
+ /**
+ * Optional.
+ * The ID of the extension that changed the muted state. Not set if an extension was not the reason the muted state last changed.
+ */
+ extensionId?: string;
+ }
+
+ interface Tab {
+ /**
+ * Optional.
+ * Either loading or complete.
+ */
+ status?: string;
+ /** The zero-based index of the tab within its window. */
+ index: number;
+ /**
+ * Optional.
+ * The ID of the tab that opened this tab, if any. This property is only present if the opener tab still exists.
+ * @since Chrome 18.
+ */
+ openerTabId?: number;
+ /**
+ * Optional.
+ * The title of the tab. This property is only present if the extension's manifest includes the "tabs" permission.
+ */
+ title?: string;
+ /**
+ * Optional.
+ * The URL the tab is displaying. This property is only present if the extension's manifest includes the "tabs" permission.
+ */
+ url?: string;
+ /**
+ * Whether the tab is pinned.
+ * @since Chrome 9.
+ */
+ pinned: boolean;
+ /**
+ * Whether the tab is highlighted.
+ * @since Chrome 16.
+ */
+ highlighted: boolean;
+ /** The ID of the window the tab is contained within. */
+ windowId: number;
+ /**
+ * Whether the tab is active in its window. (Does not necessarily mean the window is focused.)
+ * @since Chrome 16.
+ */
+ active: boolean;
+ /**
+ * Optional.
+ * The URL of the tab's favicon. This property is only present if the extension's manifest includes the "tabs" permission. It may also be an empty string if the tab is loading.
+ */
+ favIconUrl?: string;
+ /**
+ * Optional.
+ * The ID of the tab. Tab IDs are unique within a browser session. Under some circumstances a Tab may not be assigned an ID, for example when querying foreign tabs using the sessions API, in which case a session ID may be present. Tab ID can also be set to chrome.tabs.TAB_ID_NONE for apps and devtools windows.
+ */
+ id?: number;
+ /** Whether the tab is in an incognito window. */
+ incognito: boolean;
+ /**
+ * Whether the tab is selected.
+ * @deprecated since Chrome 33. Please use tabs.Tab.highlighted.
+ */
+ selected: boolean;
+ /**
+ * Optional.
+ * Whether the tab has produced sound over the past couple of seconds (but it might not be heard if also muted). Equivalent to whether the speaker audio indicator is showing.
+ * @since Chrome 45.
+ */
+ audible?: boolean;
+ /**
+ * Optional.
+ * Current tab muted state and the reason for the last state change.
+ * @since Chrome 46. Warning: this is the current Beta channel.
+ */
+ mutedInfo?: MutedInfo;
+ /**
+ * Optional. The width of the tab in pixels.
+ * @since Chrome 31.
+ */
+ width?: number;
+ /**
+ * Optional. The height of the tab in pixels.
+ * @since Chrome 31.
+ */
+ height?: number;
+ /**
+ * Optional. The session ID used to uniquely identify a Tab obtained from the sessions API.
+ * @since Chrome 31.
+ */
+ sessionId?: string;
+ }
+
+ /**
+ * Defines how zoom changes in a tab are handled and at what scope.
+ * @since Chrome 38.
+ */
+ interface ZoomSettings {
+ /**
+ * Optional.
+ * Defines how zoom changes are handled, i.e. which entity is responsible for the actual scaling of the page; defaults to "automatic".
+ * "automatic": Zoom changes are handled automatically by the browser.
+ * "manual": Overrides the automatic handling of zoom changes. The onZoomChange event will still be dispatched, and it is the responsibility of the extension to listen for this event and manually scale the page. This mode does not support per-origin zooming, and will thus ignore the scope zoom setting and assume per-tab.
+ * "disabled": Disables all zooming in the tab. The tab will revert to the default zoom level, and all attempted zoom changes will be ignored.
+ */
+ mode?: string;
+ /**
+ * Optional.
+ * Defines whether zoom changes will persist for the page's origin, or only take effect in this tab; defaults to per-origin when in automatic mode, and per-tab otherwise.
+ * "per-origin": Zoom changes will persist in the zoomed page's origin, i.e. all other tabs navigated to that same origin will be zoomed as well. Moreover, per-origin zoom changes are saved with the origin, meaning that when navigating to other pages in the same origin, they will all be zoomed to the same zoom factor. The per-origin scope is only available in the automatic mode.
+ * "per-tab": Zoom changes only take effect in this tab, and zoom changes in other tabs will not affect the zooming of this tab. Also, per-tab zoom changes are reset on navigation; navigating a tab will always load pages with their per-origin zoom factors.
+ */
+ scope?: string;
+ /**
+ * Optional.
+ * Used to return the default zoom level for the current tab in calls to tabs.getZoomSettings.
+ * @since Chrome 43.
+ */
+ defaultZoomFactor?: number;
+ }
+
+ interface InjectDetails {
+ /**
+ * Optional.
+ * If allFrames is true, implies that the JavaScript or CSS should be injected into all frames of current page. By default, it's false and is only injected into the top frame.
+ */
+ allFrames?: boolean;
+ /**
+ * Optional. JavaScript or CSS code to inject.
+ * Warning: Be careful using the code parameter. Incorrect use of it may open your extension to cross site scripting attacks.
+ */
+ code?: string;
+ /**
+ * Optional. The soonest that the JavaScript or CSS will be injected into the tab.
+ * One of: "document_start", "document_end", or "document_idle"
+ * @since Chrome 20.
+ */
+ runAt?: string;
+ /** Optional. JavaScript or CSS file to inject. */
+ file?: string;
+ /**
+ * Optional.
+ * If matchAboutBlank is true, then the code is also injected in about:blank and about:srcdoc frames if your extension has access to its parent document. Code cannot be inserted in top-level about:-frames. By default it is false.
+ * @since Chrome 39.
+ */
+ matchAboutBlank?: boolean;
+ }
+
+ interface CreateProperties {
+ /** Optional. The position the tab should take in the window. The provided value will be clamped to between zero and the number of tabs in the window. */
+ index?: number;
+ /**
+ * Optional.
+ * The ID of the tab that opened this tab. If specified, the opener tab must be in the same window as the newly created tab.
+ * @since Chrome 18.
+ */
+ openerTabId?: number;
+ /**
+ * Optional.
+ * The URL to navigate the tab to initially. Fully-qualified URLs must include a scheme (i.e. 'http://www.google.com', not 'www.google.com'). Relative URLs will be relative to the current page within the extension. Defaults to the New Tab Page.
+ */
+ url?: string;
+ /**
+ * Optional. Whether the tab should be pinned. Defaults to false
+ * @since Chrome 9.
+ */
+ pinned?: boolean;
+ /** Optional. The window to create the new tab in. Defaults to the current window. */
+ windowId?: number;
+ /**
+ * Optional.
+ * Whether the tab should become the active tab in the window. Does not affect whether the window is focused (see windows.update). Defaults to true.
+ * @since Chrome 16.
+ */
+ active?: boolean;
+ /**
+ * Optional. Whether the tab should become the selected tab in the window. Defaults to true
+ * @deprecated since Chrome 33. Please use active.
+ */
+ selected?: boolean;
+ }
+
+ interface MoveProperties {
+ /** The position to move the window to. -1 will place the tab at the end of the window. */
+ index: number;
+ /** Optional. Defaults to the window the tab is currently in. */
+ windowId?: number;
+ }
+
+ interface UpdateProperties {
+ /**
+ * Optional. Whether the tab should be pinned.
+ * @since Chrome 9.
+ */
+ pinned?: boolean;
+ /**
+ * Optional. The ID of the tab that opened this tab. If specified, the opener tab must be in the same window as this tab.
+ * @since Chrome 18.
+ */
+ openerTabId?: number;
+ /** Optional. A URL to navigate the tab to. */
+ url?: string;
+ /**
+ * Optional. Adds or removes the tab from the current selection.
+ * @since Chrome 16.
+ */
+ highlighted?: boolean;
+ /**
+ * Optional. Whether the tab should be active. Does not affect whether the window is focused (see windows.update).
+ * @since Chrome 16.
+ */
+ active?: boolean;
+ /**
+ * Optional. Whether the tab should be selected.
+ * @deprecated since Chrome 33. Please use highlighted.
+ */
+ selected?: boolean;
+ /**
+ * Optional. Whether the tab should be muted.
+ * @since Chrome 45.
+ */
+ muted?: boolean;
+ }
+
+ interface CaptureVisibleTabOptions {
+ /**
+ * Optional.
+ * When format is "jpeg", controls the quality of the resulting image. This value is ignored for PNG images. As quality is decreased, the resulting image will have more visual artifacts, and the number of bytes needed to store it will decrease.
+ */
+ quality?: number;
+ /**
+ * Optional. The format of an image.
+ * One of: "jpeg", or "png"
+ */
+ format?: string;
+ }
+
+ interface ReloadProperties {
+ /** Optional. Whether using any local cache. Default is false. */
+ bypassCache?: boolean;
+ }
+
+ interface ConnectInfo {
+ /** Optional. Will be passed into onConnect for content scripts that are listening for the connection event. */
+ name?: string;
+ /**
+ * Open a port to a specific frame identified by frameId instead of all frames in the tab.
+ * @since Chrome 41.
+ */
+ frameId?: number;
+ }
+
+ interface MessageSendOptions {
+ /** Optional. Send a message to a specific frame identified by frameId instead of all frames in the tab. */
+ frameId?: number;
+ }
+
+ interface HighlightInfo {
+ /** One or more tab indices to highlight. */
+ tabs: number | number[];
+ /** Optional. The window that contains the tabs. */
+ windowId?: number;
+ }
+
+ interface QueryInfo {
+ /**
+ * Optional. Whether the tabs have completed loading.
+ * One of: "loading", or "complete"
+ */
+ status?: string;
+ /**
+ * Optional. Whether the tabs are in the last focused window.
+ * @since Chrome 19.
+ */
+ lastFocusedWindow?: boolean;
+ /** Optional. The ID of the parent window, or windows.WINDOW_ID_CURRENT for the current window. */
+ windowId?: number;
+ /**
+ * Optional. The type of window the tabs are in.
+ * One of: "normal", "popup", "panel", "app", or "devtools"
+ */
+ windowType?: string;
+ /** Optional. Whether the tabs are active in their windows. */
+ active?: boolean;
+ /**
+ * Optional. The position of the tabs within their windows.
+ * @since Chrome 18.
+ */
+ index?: number;
+ /** Optional. Match page titles against a pattern. */
+ title?: string;
+ /** Optional. Match tabs against one or more URL patterns. Note that fragment identifiers are not matched. */
+ url?: string | string[];
+ /**
+ * Optional. Whether the tabs are in the current window.
+ * @since Chrome 19.
+ */
+ currentWindow?: boolean;
+ /** Optional. Whether the tabs are highlighted. */
+ highlighted?: boolean;
+ /** Optional. Whether the tabs are pinned. */
+ pinned?: boolean;
+ /**
+ * Optional. Whether the tabs are audible.
+ * @since Chrome 45.
+ */
+ audible?: boolean;
+ /**
+ * Optional. Whether the tabs are muted.
+ * @since Chrome 45.
+ */
+ muted?: boolean;
+ }
+
+ interface TabHighlightInfo {
+ windowId: number;
+ tabIds: number[];
+ }
+
+ interface TabRemoveInfo {
+ /**
+ * The window whose tab is closed.
+ * @since Chrome 25.
+ */
+ windowId: number;
+ /** True when the tab is being closed because its window is being closed. */
+ isWindowClosing: boolean;
+ }
+
+ interface TabAttachInfo {
+ newPosition: number;
+ newWindowId: number;
+ }
+
+ interface TabChangeInfo {
+ /** Optional. The status of the tab. Can be either loading or complete. */
+ status?: string;
+ /**
+ * The tab's new pinned state.
+ * @since Chrome 9.
+ */
+ pinned?: boolean;
+ /** Optional. The tab's URL if it has changed. */
+ url?: string;
+ /**
+ * The tab's new audible state.
+ * @since Chrome 45.
+ */
+ audible?: boolean;
+ /**
+ * The tab's new muted state and the reason for the change.
+ * @since Chrome 46. Warning: this is the current Beta channel.
+ */
+ mutedInfo?: MutedInfo;
+ /**
+ * The tab's new favicon URL.
+ * @since Chrome 27.
+ */
+ favIconUrl?: string;
+ /**
+ * The tab's new title.
+ * @since Chrome 48.
+ */
+ title?: string;
+ }
+
+ interface TabMoveInfo {
+ toIndex: number;
+ windowId: number;
+ fromIndex: number;
+ }
+
+ interface TabDetachInfo {
+ oldWindowId: number;
+ oldPosition: number;
+ }
+
+ interface TabActiveInfo {
+ /** The ID of the tab that has become active. */
+ tabId: number;
+ /** The ID of the window the active tab changed inside of. */
+ windowId: number;
+ }
+
+ interface TabWindowInfo {
+ /** The ID of the window of where the tab is located. */
+ windowId: number;
+ }
+
+ interface ZoomChangeInfo {
+ tabId: number;
+ oldZoomFactor: number;
+ newZoomFactor: number;
+ zoomSettings: ZoomSettings;
+ }
+
+ interface TabHighlightedEvent extends chrome.events.Event<(highlightInfo: HighlightInfo) => void> {}
+
+ interface TabRemovedEvent extends chrome.events.Event<(tabId: number, removeInfo: TabRemoveInfo) => void> {}
+
+ interface TabUpdatedEvent extends chrome.events.Event<(tabId: number, changeInfo: TabChangeInfo, tab: Tab) => void> {}
+
+ interface TabAttachedEvent extends chrome.events.Event<(tabId: number, attachInfo: TabAttachInfo) => void> {}
+
+ interface TabMovedEvent extends chrome.events.Event<(tabId: number, moveInfo: TabMoveInfo) => void> {}
+
+ interface TabDetachedEvent extends chrome.events.Event<(tabId: number, detachInfo: TabDetachInfo) => void> {}
+
+ interface TabCreatedEvent extends chrome.events.Event<(tab: Tab) => void> {}
+
+ interface TabActivatedEvent extends chrome.events.Event<(activeInfo: TabActiveInfo) => void> {}
+
+ interface TabReplacedEvent extends chrome.events.Event<(addedTabId: number, removedTabId: number) => void> {}
+
+ interface TabSelectedEvent extends chrome.events.Event<(tabId: number, selectInfo: TabWindowInfo) => void> {}
+
+ interface TabZoomChangeEvent extends chrome.events.Event<(ZoomChangeInfo: ZoomChangeInfo) => void> {}
+
+ /**
+ * Injects JavaScript code into a page. For details, see the programmatic injection section of the content scripts doc.
+ * @param details Details of the script or CSS to inject. Either the code or the file property must be set, but both may not be set at the same time.
+ * @param callback Optional. Called after all the JavaScript has been executed.
+ * Parameter result: The result of the script in every injected frame.
+ */
+ export function executeScript(details: InjectDetails, callback?: (result: any[]) => void): void;
+ /**
+ * Injects JavaScript code into a page. For details, see the programmatic injection section of the content scripts doc.
+ * @param tabId Optional. The ID of the tab in which to run the script; defaults to the active tab of the current window.
+ * @param details Details of the script or CSS to inject. Either the code or the file property must be set, but both may not be set at the same time.
+ * @param callback Optional. Called after all the JavaScript has been executed.
+ * Parameter result: The result of the script in every injected frame.
+ */
+ export function executeScript(tabId: number, details: InjectDetails, callback?: (result: any[]) => void): void;
+ /** Retrieves details about the specified tab. */
+ export function get(tabId: number, callback: (tab: Tab) => void): void;
+ /**
+ * Gets details about all tabs in the specified window.
+ * @deprecated since Chrome 33. Please use tabs.query {windowId: windowId}.
+ */
+ export function getAllInWindow(callback: (tab: Tab) => void): void;
+ /**
+ * Gets details about all tabs in the specified window.
+ * @deprecated since Chrome 33. Please use tabs.query {windowId: windowId}.
+ * @param windowId Optional. Defaults to the current window.
+ */
+ export function getAllInWindow(windowId: number, callback: (tab: Tab) => void): void;
+ /** Gets the tab that this script call is being made from. May be undefined if called from a non-tab context (for example: a background page or popup view). */
+ export function getCurrent(callback: (tab?: Tab) => void): void;
+ /**
+ * Gets the tab that is selected in the specified window.
+ * @deprecated since Chrome 33. Please use tabs.query {active: true}.
+ */
+ export function getSelected(callback: (tab: Tab) => void): void;
+ /**
+ * Gets the tab that is selected in the specified window.
+ * @deprecated since Chrome 33. Please use tabs.query {active: true}.
+ * @param windowId Optional. Defaults to the current window.
+ */
+ export function getSelected(windowId: number, callback: (tab: Tab) => void): void;
+ /**
+ * Creates a new tab.
+ * @param callback Optional.
+ * Parameter tab: Details about the created tab. Will contain the ID of the new tab.
+ */
+ export function create(createProperties: CreateProperties, callback?: (tab: Tab) => void): void;
+ /**
+ * Moves one or more tabs to a new position within its window, or to a new window. Note that tabs can only be moved to and from normal (window.type === "normal") windows.
+ * @param tabId The tab to move.
+ * @param callback Optional.
+ * Parameter tab: Details about the moved tab.
+ */
+ export function move(tabId: number, moveProperties: MoveProperties, callback?: (tab: Tab) => void): void;
+ /**
+ * Moves one or more tabs to a new position within its window, or to a new window. Note that tabs can only be moved to and from normal (window.type === "normal") windows.
+ * @param tabIds The tabs to move.
+ * @param callback Optional.
+ * Parameter tabs: Details about the moved tabs.
+ */
+ export function move(tabIds: number[], moveProperties: MoveProperties, callback?: (tabs: Tab[]) => void): void;
+ /**
+ * Modifies the properties of a tab. Properties that are not specified in updateProperties are not modified.
+ * @param callback Optional.
+ * Optional parameter tab: Details about the updated tab. The tabs.Tab object doesn't contain url, title and favIconUrl if the "tabs" permission has not been requested.
+ */
+ export function update(updateProperties: UpdateProperties, callback?: (tab?: Tab) => void): void;
+ /**
+ * Modifies the properties of a tab. Properties that are not specified in updateProperties are not modified.
+ * @param tabId Defaults to the selected tab of the current window.
+ * @param callback Optional.
+ * Optional parameter tab: Details about the updated tab. The tabs.Tab object doesn't contain url, title and favIconUrl if the "tabs" permission has not been requested.
+ */
+ export function update(tabId: number, updateProperties: UpdateProperties, callback?: (tab?: Tab) => void): void;
+ /**
+ * Closes a tab.
+ * @param tabId The tab to close.
+ */
+ export function remove(tabId: number, callback?: Function): void;
+ /**
+ * Closes several tabs.
+ * @param tabIds The list of tabs to close.
+ */
+ export function remove(tabIds: number[], callback?: Function): void;
+ /**
+ * Captures the visible area of the currently active tab in the specified window. You must have <all_urls> permission to use this method.
+ * @param callback
+ * Parameter dataUrl: A data URL which encodes an image of the visible area of the captured tab. May be assigned to the 'src' property of an HTML Image element for display.
+ */
+ export function captureVisibleTab(callback: (dataUrl: string) => void): void;
+ /**
+ * Captures the visible area of the currently active tab in the specified window. You must have <all_urls> permission to use this method.
+ * @param windowId Optional. The target window. Defaults to the current window.
+ * @param callback
+ * Parameter dataUrl: A data URL which encodes an image of the visible area of the captured tab. May be assigned to the 'src' property of an HTML Image element for display.
+ */
+ export function captureVisibleTab(windowId: number, callback: (dataUrl: string) => void): void;
+ /**
+ * Captures the visible area of the currently active tab in the specified window. You must have <all_urls> permission to use this method.
+ * @param options Optional. Details about the format and quality of an image.
+ * @param callback
+ * Parameter dataUrl: A data URL which encodes an image of the visible area of the captured tab. May be assigned to the 'src' property of an HTML Image element for display.
+ */
+ export function captureVisibleTab(options: CaptureVisibleTabOptions, callback: (dataUrl: string) => void): void;
+ /**
+ * Captures the visible area of the currently active tab in the specified window. You must have <all_urls> permission to use this method.
+ * @param windowId Optional. The target window. Defaults to the current window.
+ * @param options Optional. Details about the format and quality of an image.
+ * @param callback
+ * Parameter dataUrl: A data URL which encodes an image of the visible area of the captured tab. May be assigned to the 'src' property of an HTML Image element for display.
+ */
+ export function captureVisibleTab(windowId: number, options: CaptureVisibleTabOptions, callback: (dataUrl: string) => void): void;
+ /**
+ * Reload a tab.
+ * @since Chrome 16.
+ * @param tabId The ID of the tab to reload; defaults to the selected tab of the current window.
+ */
+ export function reload(tabId: number, reloadProperties?: ReloadProperties, callback?: () => void): void;
+ /**
+ * Reload the selected tab of the current window.
+ * @since Chrome 16.
+ */
+ export function reload(reloadProperties: ReloadProperties, callback?: () => void): void;
+ /**
+ * Reload the selected tab of the current window.
+ * @since Chrome 16.
+ */
+ export function reload(callback?: () => void): void;
+ /**
+ * Duplicates a tab.
+ * @since Chrome 23.
+ * @param tabId The ID of the tab which is to be duplicated.
+ * @param callback Optional.
+ * Optional parameter tab: Details about the duplicated tab. The tabs.Tab object doesn't contain url, title and favIconUrl if the "tabs" permission has not been requested.
+ */
+ export function duplicate(tabId: number, callback?: (tab?: Tab) => void): void;
+ /**
+ * Sends a single message to the content script(s) in the specified tab, with an optional callback to run when a response is sent back. The runtime.onMessage event is fired in each content script running in the specified tab for the current extension.
+ * @since Chrome 20.
+ */
+ export function sendMessage(tabId: number, message: any, responseCallback?: (response: any) => void): void;
+ /**
+ * Sends a single message to the content script(s) in the specified tab, with an optional callback to run when a response is sent back. The runtime.onMessage event is fired in each content script running in the specified tab for the current extension.
+ * @since Chrome 41.
+ * @param responseCallback Optional.
+ * Parameter response: The JSON response object sent by the handler of the message. If an error occurs while connecting to the specified tab, the callback will be called with no arguments and runtime.lastError will be set to the error message.
+ */
+ export function sendMessage(tabId: number, message: any, options: MessageSendOptions, responseCallback?: (response: any) => void): void;
+ /**
+ * Sends a single request to the content script(s) in the specified tab, with an optional callback to run when a response is sent back. The extension.onRequest event is fired in each content script running in the specified tab for the current extension.
+ * @deprecated since Chrome 33. Please use runtime.sendMessage.
+ * @param responseCallback Optional.
+ * Parameter response: The JSON response object sent by the handler of the request. If an error occurs while connecting to the specified tab, the callback will be called with no arguments and runtime.lastError will be set to the error message.
+ */
+ export function sendRequest(tabId: number, request: any, responseCallback?: (response: any) => void): void;
+ /** Connects to the content script(s) in the specified tab. The runtime.onConnect event is fired in each content script running in the specified tab for the current extension. */
+ export function connect(tabId: number, connectInfo?: ConnectInfo): runtime.Port;
+ /**
+ * Injects CSS into a page. For details, see the programmatic injection section of the content scripts doc.
+ * @param details Details of the script or CSS to inject. Either the code or the file property must be set, but both may not be set at the same time.
+ * @param callback Optional. Called when all the CSS has been inserted.
+ */
+ export function insertCSS(details: InjectDetails, callback?: Function): void;
+ /**
+ * Injects CSS into a page. For details, see the programmatic injection section of the content scripts doc.
+ * @param tabId Optional. The ID of the tab in which to insert the CSS; defaults to the active tab of the current window.
+ * @param details Details of the script or CSS to inject. Either the code or the file property must be set, but both may not be set at the same time.
+ * @param callback Optional. Called when all the CSS has been inserted.
+ */
+ export function insertCSS(tabId: number, details: InjectDetails, callback?: Function): void;
+ /**
+ * Highlights the given tabs.
+ * @since Chrome 16.
+ * @param callback Optional.
+ * Parameter window: Contains details about the window whose tabs were highlighted.
+ */
+ export function highlight(highlightInfo: HighlightInfo, callback: (window: chrome.windows.Window) => void): void;
+ /**
+ * Gets all tabs that have the specified properties, or all tabs if no properties are specified.
+ * @since Chrome 16.
+ */
+ export function query(queryInfo: QueryInfo, callback: (result: Tab[]) => void): void;
+ /**
+ * Detects the primary language of the content in a tab.
+ * @param callback
+ * Parameter language: An ISO language code such as en or fr. For a complete list of languages supported by this method, see kLanguageInfoTable. The 2nd to 4th columns will be checked and the first non-NULL value will be returned except for Simplified Chinese for which zh-CN will be returned. For an unknown language, und will be returned.
+ */
+ export function detectLanguage(callback: (language: string) => void): void;
+ /**
+ * Detects the primary language of the content in a tab.
+ * @param tabId Optional. Defaults to the active tab of the current window.
+ * @param callback
+ * Parameter language: An ISO language code such as en or fr. For a complete list of languages supported by this method, see kLanguageInfoTable. The 2nd to 4th columns will be checked and the first non-NULL value will be returned except for Simplified Chinese for which zh-CN will be returned. For an unknown language, und will be returned.
+ */
+ export function detectLanguage(tabId: number, callback: (language: string) => void): void;
+ /**
+ * Zooms a specified tab.
+ * @since Chrome 42.
+ * @param zoomFactor The new zoom factor. Use a value of 0 here to set the tab to its current default zoom factor. Values greater than zero specify a (possibly non-default) zoom factor for the tab.
+ * @param callback Optional. Called after the zoom factor has been changed.
+ */
+ export function setZoom(zoomFactor: number, callback?: () => void): void;
+ /**
+ * Zooms a specified tab.
+ * @since Chrome 42.
+ * @param tabId Optional. The ID of the tab to zoom; defaults to the active tab of the current window.
+ * @param zoomFactor The new zoom factor. Use a value of 0 here to set the tab to its current default zoom factor. Values greater than zero specify a (possibly non-default) zoom factor for the tab.
+ * @param callback Optional. Called after the zoom factor has been changed.
+ */
+ export function setZoom(tabId: number, zoomFactor: number, callback?: () => void): void;
+ /**
+ * Gets the current zoom factor of a specified tab.
+ * @since Chrome 42.
+ * @param callback Called with the tab's current zoom factor after it has been fetched.
+ * Parameter zoomFactor: The tab's current zoom factor.
+ */
+ export function getZoom(callback: (zoomFactor: number) => void): void;
+ /**
+ * Gets the current zoom factor of a specified tab.
+ * @since Chrome 42.
+ * @param tabId Optional. The ID of the tab to get the current zoom factor from; defaults to the active tab of the current window.
+ * @param callback Called with the tab's current zoom factor after it has been fetched.
+ * Parameter zoomFactor: The tab's current zoom factor.
+ */
+ export function getZoom(tabId: number, callback: (zoomFactor: number) => void): void;
+ /**
+ * Sets the zoom settings for a specified tab, which define how zoom changes are handled. These settings are reset to defaults upon navigating the tab.
+ * @since Chrome 42.
+ * @param zoomSettings Defines how zoom changes are handled and at what scope.
+ * @param callback Optional. Called after the zoom settings have been changed.
+ */
+ export function setZoomSettings(zoomSettings: ZoomSettings, callback?: () => void): void;
+ /**
+ * Sets the zoom settings for a specified tab, which define how zoom changes are handled. These settings are reset to defaults upon navigating the tab.
+ * @since Chrome 42.
+ * @param tabId Optional. The ID of the tab to change the zoom settings for; defaults to the active tab of the current window.
+ * @param zoomSettings Defines how zoom changes are handled and at what scope.
+ * @param callback Optional. Called after the zoom settings have been changed.
+ */
+ export function setZoomSettings(tabId: number, zoomSettings: ZoomSettings, callback?: () => void): void;
+ /**
+ * Gets the current zoom settings of a specified tab.
+ * @since Chrome 42.
+ * @param callback Called with the tab's current zoom settings.
+ * Paramater zoomSettings: The tab's current zoom settings.
+ */
+ export function getZoomSettings(callback: (zoomSettings: ZoomSettings) => void): void;
+ /**
+ * Gets the current zoom settings of a specified tab.
+ * @since Chrome 42.
+ * @param tabId Optional. The ID of the tab to get the current zoom settings from; defaults to the active tab of the current window.
+ * @param callback Called with the tab's current zoom settings.
+ * Paramater zoomSettings: The tab's current zoom settings.
+ */
+ export function getZoomSettings(tabId: number, callback: (zoomSettings: ZoomSettings) => void): void;
+
+ /**
+ * Fired when the highlighted or selected tabs in a window changes.
+ * @since Chrome 18.
+ */
+ var onHighlighted: TabHighlightedEvent;
+ /** Fired when a tab is closed. */
+ var onRemoved: TabRemovedEvent;
+ /** Fired when a tab is updated. */
+ var onUpdated: TabUpdatedEvent;
+ /** Fired when a tab is attached to a window, for example because it was moved between windows. */
+ var onAttached: TabAttachedEvent;
+ /**
+ * Fired when a tab is moved within a window. Only one move event is fired, representing the tab the user directly moved. Move events are not fired for the other tabs that must move in response. This event is not fired when a tab is moved between windows. For that, see tabs.onDetached.
+ */
+ var onMoved: TabMovedEvent;
+ /** Fired when a tab is detached from a window, for example because it is being moved between windows. */
+ var onDetached: TabDetachedEvent;
+ /** Fired when a tab is created. Note that the tab's URL may not be set at the time this event fired, but you can listen to onUpdated events to be notified when a URL is set. */
+ var onCreated: TabCreatedEvent;
+ /**
+ * Fires when the active tab in a window changes. Note that the tab's URL may not be set at the time this event fired, but you can listen to onUpdated events to be notified when a URL is set.
+ * @since Chrome 18.
+ */
+ var onActivated: TabActivatedEvent;
+ /**
+ * Fired when a tab is replaced with another tab due to prerendering or instant.
+ * @since Chrome 26.
+ */
+ var onReplaced: TabReplacedEvent;
+ /**
+ * @deprecated since Chrome 33. Please use tabs.onActivated.
+ * Fires when the selected tab in a window changes.
+ */
+ var onSelectionChanged: TabSelectedEvent;
+ /**
+ * @deprecated since Chrome 33. Please use tabs.onActivated.
+ * Fires when the selected tab in a window changes. Note that the tab's URL may not be set at the time this event fired, but you can listen to tabs.onUpdated events to be notified when a URL is set.
+ */
+ var onActiveChanged: TabSelectedEvent;
+ /**
+ * @deprecated since Chrome 33. Please use tabs.onHighlighted.
+ * Fired when the highlighted or selected tabs in a window changes.
+ */
+ var onHighlightChanged: TabHighlightedEvent;
+ /**
+ * Fired when a tab is zoomed.
+ * @since Chrome 38.
+ */
+ var onZoomChange: TabZoomChangeEvent;
+}
+
+////////////////////
+// Top Sites
+////////////////////
+/**
+ * Use the chrome.topSites API to access the top sites that are displayed on the new tab page.
+ * Permissions: "topSites"
+ * @since Chrome 19.
+ */
+declare namespace chrome.topSites {
+ /** An object encapsulating a most visited URL, such as the URLs on the new tab page. */
+ interface MostVisitedURL {
+ /** The most visited URL. */
+ url: string;
+ /** The title of the page */
+ title: string;
+ }
+
+ /** Gets a list of top sites. */
+ export function get(callback: (data: MostVisitedURL[]) => void): void;
+}
+
+////////////////////
+// Text to Speech
+////////////////////
+/**
+ * Use the chrome.tts API to play synthesized text-to-speech (TTS). See also the related ttsEngine API, which allows an extension to implement a speech engine.
+ * Permissions: "tts"
+ * @since Chrome 14.
+ */
+declare namespace chrome.tts {
+ /** An event from the TTS engine to communicate the status of an utterance. */
+ interface TtsEvent {
+ /** Optional. The index of the current character in the utterance. */
+ charIndex?: number;
+ /** Optional. The error description, if the event type is 'error'. */
+ errorMessage?: string;
+ /**
+ * The type can be 'start' as soon as speech has started, 'word' when a word boundary is reached, 'sentence' when a sentence boundary is reached, 'marker' when an SSML mark element is reached, 'end' when the end of the utterance is reached, 'interrupted' when the utterance is stopped or interrupted before reaching the end, 'cancelled' when it's removed from the queue before ever being synthesized, or 'error' when any other error occurs. When pausing speech, a 'pause' event is fired if a particular utterance is paused in the middle, and 'resume' if an utterance resumes speech. Note that pause and resume events may not fire if speech is paused in-between utterances.
+ * One of: "start", "end", "word", "sentence", "marker", "interrupted", "cancelled", "error", "pause", or "resume"
+ */
+ type: string;
+ }
+
+ /** A description of a voice available for speech synthesis. */
+ interface TtsVoice {
+ /** Optional. The language that this voice supports, in the form language-region. Examples: 'en', 'en-US', 'en-GB', 'zh-CN'. */
+ lang?: string;
+ /**
+ * Optional. This voice's gender.
+ * One of: "male", or "female"
+ */
+ gender?: string;
+ /** Optional. The name of the voice. */
+ voiceName?: string;
+ /** The ID of the extension providing this voice. */
+ extensionsId?: string;
+ /** All of the callback event types that this voice is capable of sending. */
+ eventTypes?: string[];
+ /**
+ * If true, the synthesis engine is a remote network resource. It may be higher latency and may incur bandwidth costs.
+ * @since Chrome 33.
+ */
+ remote?: boolean;
+ }
+
+ interface SpeakOptions {
+ /** Optional. Speaking volume between 0 and 1 inclusive, with 0 being lowest and 1 being highest, with a default of 1.0. */
+ volume?: number;
+ /**
+ * Optional.
+ * If true, enqueues this utterance if TTS is already in progress. If false (the default), interrupts any current speech and flushes the speech queue before speaking this new utterance.
+ */
+ enqueue?: boolean;
+ /**
+ * Optional.
+ * Speaking rate relative to the default rate for this voice. 1.0 is the default rate, normally around 180 to 220 words per minute. 2.0 is twice as fast, and 0.5 is half as fast. Values below 0.1 or above 10.0 are strictly disallowed, but many voices will constrain the minimum and maximum rates further—for example a particular voice may not actually speak faster than 3 times normal even if you specify a value larger than 3.0.
+ */
+ rate?: number;
+ /**
+ * Optional. This function is called with events that occur in the process of speaking the utterance.
+ * @param event The update event from the text-to-speech engine indicating the status of this utterance.
+ */
+ onEvent?: (event: TtsEvent) => void;
+ /**
+ * Optional.
+ * Speaking pitch between 0 and 2 inclusive, with 0 being lowest and 2 being highest. 1.0 corresponds to a voice's default pitch.
+ */
+ pitch?: number;
+ /** Optional. The language to be used for synthesis, in the form language-region. Examples: 'en', 'en-US', 'en-GB', 'zh-CN'. */
+ lang?: string;
+ /** Optional. The name of the voice to use for synthesis. If empty, uses any available voice. */
+ voiceName?: string;
+ /** Optional. The extension ID of the speech engine to use, if known. */
+ extensionId?: string;
+ /**
+ * Optional. Gender of voice for synthesized speech.
+ * One of: "male", or "female"
+ */
+ gender?: string;
+ /** Optional. The TTS event types the voice must support. */
+ requiredEventTypes?: string[];
+ /** Optional. The TTS event types that you are interested in listening to. If missing, all event types may be sent. */
+ desiredEventTypes?: string[];
+ }
+
+ /** Checks whether the engine is currently speaking. On Mac OS X, the result is true whenever the system speech engine is speaking, even if the speech wasn't initiated by Chrome. */
+ export function isSpeaking(callback?: (speaking: boolean) => void): void;
+ /** Stops any current speech and flushes the queue of any pending utterances. In addition, if speech was paused, it will now be un-paused for the next call to speak. */
+ export function stop(): void;
+ /** Gets an array of all available voices. */
+ export function getVoices(callback?: (voices: TtsVoice[]) => void): void;
+ /**
+ * Speaks text using a text-to-speech engine.
+ * @param utterance The text to speak, either plain text or a complete, well-formed SSML document. Speech engines that do not support SSML will strip away the tags and speak the text. The maximum length of the text is 32,768 characters.
+ * @param callback Optional. Called right away, before speech finishes. Check chrome.runtime.lastError to make sure there were no errors. Use options.onEvent to get more detailed feedback.
+ */
+ export function speak(utterance: string, callback?: Function): void;
+ /**
+ * Speaks text using a text-to-speech engine.
+ * @param utterance The text to speak, either plain text or a complete, well-formed SSML document. Speech engines that do not support SSML will strip away the tags and speak the text. The maximum length of the text is 32,768 characters.
+ * @param options Optional. The speech options.
+ * @param callback Optional. Called right away, before speech finishes. Check chrome.runtime.lastError to make sure there were no errors. Use options.onEvent to get more detailed feedback.
+ */
+ export function speak(utterance: string, options: SpeakOptions, callback?: Function): void;
+ /**
+ * Pauses speech synthesis, potentially in the middle of an utterance. A call to resume or stop will un-pause speech.
+ * @since Chrome 29.
+ */
+ export function pause(): void;
+ /**
+ * If speech was paused, resumes speaking where it left off.
+ * @since Chrome 29.
+ */
+ export function resume(): void;
+}
+
+////////////////////
+// Text to Speech Engine
+////////////////////
+/**
+ * Use the chrome.ttsEngine API to implement a text-to-speech(TTS) engine using an extension. If your extension registers using this API, it will receive events containing an utterance to be spoken and other parameters when any extension or Chrome App uses the tts API to generate speech. Your extension can then use any available web technology to synthesize and output the speech, and send events back to the calling function to report the status.
+ * Permissions: "ttsEngine"
+ * @since Chrome 14.
+ */
+declare namespace chrome.ttsEngine {
+ interface SpeakOptions {
+ /** Optional. The language to be used for synthesis, in the form language-region. Examples: 'en', 'en-US', 'en-GB', 'zh-CN'. */
+ lang?: string;
+ /** Optional. The name of the voice to use for synthesis. */
+ voiceName?: string;
+ /**
+ * Optional. Gender of voice for synthesized speech.
+ * One of: "male", or "female"
+ */
+ gender?: string;
+ /** Optional. Speaking volume between 0 and 1 inclusive, with 0 being lowest and 1 being highest, with a default of 1.0. */
+ volume?: number;
+ /**
+ * Optional.
+ * Speaking rate relative to the default rate for this voice. 1.0 is the default rate, normally around 180 to 220 words per minute. 2.0 is twice as fast, and 0.5 is half as fast. This value is guaranteed to be between 0.1 and 10.0, inclusive. When a voice does not support this full range of rates, don't return an error. Instead, clip the rate to the range the voice supports.
+ */
+ rate?: number;
+ /** Optional. Speaking pitch between 0 and 2 inclusive, with 0 being lowest and 2 being highest. 1.0 corresponds to this voice's default pitch. */
+ pitch?: number;
+ }
+
+ interface TtsEngineSpeakEvent extends chrome.events.Event<(utterance: string, options: SpeakOptions, sendTtsEvent: (event: chrome.tts.TtsEvent) => void) => void> {}
+
+ /** Called when the user makes a call to tts.speak() and one of the voices from this extension's manifest is the first to match the options object. */
+ var onSpeak: TtsEngineSpeakEvent;
+ /** Fired when a call is made to tts.stop and this extension may be in the middle of speaking. If an extension receives a call to onStop and speech is already stopped, it should do nothing (not raise an error). If speech is in the paused state, this should cancel the paused state. */
+ var onStop: chrome.events.Event<() => void>;
+ /**
+ * Optional: if an engine supports the pause event, it should pause the current utterance being spoken, if any, until it receives a resume event or stop event. Note that a stop event should also clear the paused state.
+ * @since Chrome 29.
+ */
+ var onPause: chrome.events.Event<() => void>;
+ /**
+ * Optional: if an engine supports the pause event, it should also support the resume event, to continue speaking the current utterance, if any. Note that a stop event should also clear the paused state.
+ * @since Chrome 29.
+ */
+ var onResume: chrome.events.Event<() => void>;
+}
+
+////////////////////
+// Types
+////////////////////
+/**
+ * The chrome.types API contains type declarations for Chrome.
+ * @since Chrome 13.
+ */
+declare namespace chrome.types {
+ interface ChromeSettingClearDetails {
+ /**
+ * Optional.
+ * The scope of the ChromeSetting. One of
+ * • regular: setting for the regular profile (which is inherited by the incognito profile if not overridden elsewhere),
+ * • regular_only: setting for the regular profile only (not inherited by the incognito profile),
+ * • incognito_persistent: setting for the incognito profile that survives browser restarts (overrides regular preferences),
+ * • incognito_session_only: setting for the incognito profile that can only be set during an incognito session and is deleted when the incognito session ends (overrides regular and incognito_persistent preferences).
+ */
+ scope?: string;
+ }
+
+ interface ChromeSettingSetDetails extends ChromeSettingClearDetails {
+ /**
+ * The value of the setting.
+ * Note that every setting has a specific value type, which is described together with the setting. An extension should not set a value of a different type.
+ */
+ value: any;
+ /**
+ * Optional.
+ * The scope of the ChromeSetting. One of
+ * • regular: setting for the regular profile (which is inherited by the incognito profile if not overridden elsewhere),
+ * • regular_only: setting for the regular profile only (not inherited by the incognito profile),
+ * • incognito_persistent: setting for the incognito profile that survives browser restarts (overrides regular preferences),
+ * • incognito_session_only: setting for the incognito profile that can only be set during an incognito session and is deleted when the incognito session ends (overrides regular and incognito_persistent preferences).
+ */
+ scope?: string;
+ }
+
+ interface ChromeSettingGetDetails {
+ /** Optional. Whether to return the value that applies to the incognito session (default false). */
+ incognito?: boolean;
+ }
+
+ /**
+ * @param details Details of the currently effective value.
+ */
+ type DetailsCallback = (details: ChromeSettingGetResultDetails) => void;
+
+ interface ChromeSettingGetResultDetails {
+ /**
+ * One of
+ * • not_controllable: cannot be controlled by any extension
+ * • controlled_by_other_extensions: controlled by extensions with higher precedence
+ * • controllable_by_this_extension: can be controlled by this extension
+ * • controlled_by_this_extension: controlled by this extension
+ */
+ levelOfControl: string;
+ /** The value of the setting. */
+ value: any;
+ /**
+ * Optional.
+ * Whether the effective value is specific to the incognito session.
+ * This property will only be present if the incognito property in the details parameter of get() was true.
+ */
+ incognitoSpecific?: boolean;
+ }
+
+ interface ChromeSettingChangedEvent extends chrome.events.Event<DetailsCallback> {}
+
+ /** An interface that allows access to a Chrome browser setting. See accessibilityFeatures for an example. */
+ interface ChromeSetting {
+ /**
+ * Sets the value of a setting.
+ * @param details Which setting to change.
+ * @param callback Optional. Called at the completion of the set operation.
+ */
+ set(details: ChromeSettingSetDetails, callback?: Function): void;
+ /**
+ * Gets the value of a setting.
+ * @param details Which setting to consider.
+ */
+ get(details: ChromeSettingGetDetails, callback?: DetailsCallback): void;
+ /**
+ * Clears the setting, restoring any default value.
+ * @param details Which setting to clear.
+ * @param callback Optional. Called at the completion of the clear operation.
+ */
+ clear(details: ChromeSettingClearDetails, callback?: Function): void;
+ /** Fired after the setting changes. */
+ onChange: ChromeSettingChangedEvent;
+ }
+}
+
+////////////////////
+// VPN Provider
+////////////////////
+/**
+ * Use the chrome.vpnProvider API to implement a VPN client.
+ * Permissions: "vpnProvider"
+ * Important: This API works only on Chrome OS.
+ * @since Chrome 43.
+ */
+declare namespace chrome.vpnProvider {
+ interface VpnSessionParameters {
+ /** IP address for the VPN interface in CIDR notation. IPv4 is currently the only supported mode. */
+ address: string;
+ /** Optional. Broadcast address for the VPN interface. (default: deduced from IP address and mask) */
+ broadcastAddress?: string;
+ /** Optional. MTU setting for the VPN interface. (default: 1500 bytes) */
+ mtu?: string;
+ /**
+ * Exclude network traffic to the list of IP blocks in CIDR notation from the tunnel. This can be used to bypass traffic to and from the VPN server. When many rules match a destination, the rule with the longest matching prefix wins. Entries that correspond to the same CIDR block are treated as duplicates. Such duplicates in the collated (exclusionList + inclusionList) list are eliminated and the exact duplicate entry that will be eliminated is undefined.
+ */
+ exclusionList: string[];
+ /**
+ * Include network traffic to the list of IP blocks in CIDR notation to the tunnel. This parameter can be used to set up a split tunnel. By default no traffic is directed to the tunnel. Adding the entry "0.0.0.0/0" to this list gets all the user traffic redirected to the tunnel. When many rules match a destination, the rule with the longest matching prefix wins. Entries that correspond to the same CIDR block are treated as duplicates. Such duplicates in the collated (exclusionList + inclusionList) list are eliminated and the exact duplicate entry that will be eliminated is undefined.
+ */
+ inclusionList: string[];
+ /** Optional. A list of search domains. (default: no search domain) */
+ domainSearch?: string[];
+ /** A list of IPs for the DNS servers. */
+ dnsServer: string[];
+ }
+
+ interface VpnPlatformMessageEvent extends chrome.events.Event<(id: string, message: string, error: string) => void> {}
+
+ interface VpnPacketReceptionEvent extends chrome.events.Event<(data: ArrayBuffer) => void> {}
+
+ interface VpnConfigRemovalEvent extends chrome.events.Event<(id: string) => void> {}
+
+ interface VpnConfigCreationEvent extends chrome.events.Event<(id: string, name: string, data: Object) => void> {}
+
+ interface VpnUiEvent extends chrome.events.Event<(event: string, id?: string) => void> {}
+
+ /**
+ * Creates a new VPN configuration that persists across multiple login sessions of the user.
+ * @param name The name of the VPN configuration.
+ * @param callback Called when the configuration is created or if there is an error.
+ * Parameter id: A unique ID for the created configuration, empty string on failure.
+ */
+ export function createConfig(name: string, callback: (id: string) => void): void;
+ /**
+ * Destroys a VPN configuration created by the extension.
+ * @param id ID of the VPN configuration to destroy.
+ * @param callback Optional. Called when the configuration is destroyed or if there is an error.
+ */
+ export function destroyConfig(id: string, callback?: Function): void;
+ /**
+ * Sets the parameters for the VPN session. This should be called immediately after "connected" is received from the platform. This will succeed only when the VPN session is owned by the extension.
+ * @param parameters The parameters for the VPN session.
+ * @param callback Called when the parameters are set or if there is an error.
+ */
+ export function setParameters(parameters: VpnSessionParameters, callback: Function): void;
+ /**
+ * Sends an IP packet through the tunnel created for the VPN session. This will succeed only when the VPN session is owned by the extension.
+ * @param data The IP packet to be sent to the platform.
+ * @param callback Optional. Called when the packet is sent or if there is an error.
+ */
+ export function sendPacket(data: ArrayBuffer, callback?: Function): void;
+ /**
+ * Notifies the VPN session state to the platform. This will succeed only when the VPN session is owned by the extension.
+ * @param state The VPN session state of the VPN client.
+ * connected: VPN connection was successful.
+ * failure: VPN connection failed.
+ * @param callback Optional. Called when the notification is complete or if there is an error.
+ */
+ export function notifyConnectionStateChanged(state: string, callback?: Function): void;
+
+ /** Triggered when a message is received from the platform for a VPN configuration owned by the extension. */
+ var onPlatformMessage: VpnPlatformMessageEvent;
+ /** Triggered when an IP packet is received via the tunnel for the VPN session owned by the extension. */
+ var onPacketReceived: VpnPacketReceptionEvent;
+ /** Triggered when a configuration created by the extension is removed by the platform. */
+ var onConfigRemoved: VpnConfigRemovalEvent;
+ /** Triggered when a configuration is created by the platform for the extension. */
+ var onConfigCreated: VpnConfigCreationEvent;
+ /** Triggered when there is a UI event for the extension. UI events are signals from the platform that indicate to the app that a UI dialog needs to be shown to the user. */
+ var onUIEvent: VpnUiEvent;
+}
+
+////////////////////
+// Wallpaper
+////////////////////
+/**
+ * Use the chrome.wallpaper API to change the ChromeOS wallpaper.
+ * Permissions: "wallpaper"
+ * Important: This API works only on Chrome OS.
+ * @since Chrome 43.
+ */
+declare namespace chrome.wallpaper {
+ interface WallpaperDetails {
+ /** Optional. The jpeg or png encoded wallpaper image. */
+ data?: any;
+ /** Optional. The URL of the wallpaper to be set. */
+ url?: string;
+ /**
+ * The supported wallpaper layouts.
+ * One of: "STRETCH", "CENTER", or "CENTER_CROPPED"
+ */
+ layout: string;
+ /** The file name of the saved wallpaper. */
+ filename: string;
+ /** Optional. True if a 128x60 thumbnail should be generated. */
+ thumbnail?: boolean;
+ }
+
+ /**
+ * Sets wallpaper to the image at url or wallpaperData with the specified layout
+ * @param callback
+ * Optional parameter thumbnail: The jpeg encoded wallpaper thumbnail. It is generated by resizing the wallpaper to 128x60.
+ */
+ export function setWallpaper(details: WallpaperDetails, callback: (thumbnail: any) => void): void;
+}
+
+////////////////////
+// Web Navigation
+////////////////////
+/**
+ * Use the chrome.webNavigation API to receive notifications about the status of navigation requests in-flight.
+ * Permissions: "webNavigation"
+ * @since Chrome 16.
+ */
+declare namespace chrome.webNavigation {
+ interface GetFrameDetails {
+ /**
+ * The ID of the process runs the renderer for this tab.
+ * @since Chrome 22.
+ */
+ processId: number;
+ /** The ID of the tab in which the frame is. */
+ tabId: number;
+ /** The ID of the frame in the given tab. */
+ frameId: number;
+ }
+
+ interface GetFrameResultDetails {
+ /** The URL currently associated with this frame, if the frame identified by the frameId existed at one point in the given tab. The fact that an URL is associated with a given frameId does not imply that the corresponding frame still exists. */
+ url: string;
+ /** True if the last navigation in this frame was interrupted by an error, i.e. the onErrorOccurred event fired. */
+ errorOccurred: boolean;
+ /** ID of frame that wraps the frame. Set to -1 of no parent frame exists. */
+ parentFrameId: number;
+ }
+
+ interface GetAllFrameDetails {
+ /** The ID of the tab. */
+ tabId: number;
+ }
+
+ interface GetAllFrameResultDetails extends GetFrameResultDetails {
+ /** The ID of the process runs the renderer for this tab. */
+ processId: number;
+ /** The ID of the frame. 0 indicates that this is the main frame; a positive value indicates the ID of a subframe. */
+ frameId: number;
+ }
+
+ interface WebNavigationCallbackDetails {
+ /** The ID of the tab in which the navigation is about to occur. */
+ tabId: number;
+ /** The time when the browser was about to start the navigation, in milliseconds since the epoch. */
+ timeStamp: number;
+ }
+
+ interface WebNavigationUrlCallbackDetails extends WebNavigationCallbackDetails {
+ url: string;
+ }
+
+ interface WebNavigationReplacementCallbackDetails extends WebNavigationCallbackDetails {
+ /** The ID of the tab that was replaced. */
+ replacedTabId: number;
+ }
+
+ interface WebNavigationFramedCallbackDetails extends WebNavigationUrlCallbackDetails {
+ /** 0 indicates the navigation happens in the tab content window; a positive value indicates navigation in a subframe. Frame IDs are unique for a given tab and process. */
+ frameId: number;
+ /**
+ * The ID of the process runs the renderer for this tab.
+ * @since Chrome 22.
+ */
+ processId: number;
+ }
+
+ interface WebNavigationFramedErrorCallbackDetails extends WebNavigationFramedCallbackDetails {
+ /** The error description. */
+ error: string;
+ }
+
+ interface WebNavigationSourceCallbackDetails extends WebNavigationUrlCallbackDetails {
+ /** The ID of the tab in which the navigation is triggered. */
+ sourceTabId: number;
+ /**
+ * The ID of the process runs the renderer for the source tab.
+ * @since Chrome 22.
+ */
+ sourceProcessId: number;
+ /** The ID of the frame with sourceTabId in which the navigation is triggered. 0 indicates the main frame. */
+ sourceFrameId: number;
+ }
+
+ interface WebNavigationParentedCallbackDetails extends WebNavigationFramedCallbackDetails {
+ /**
+ * ID of frame that wraps the frame. Set to -1 of no parent frame exists.
+ * @since Chrome 24.
+ */
+ parentFrameId: number;
+ }
+
+ interface WebNavigationTransitionCallbackDetails extends WebNavigationFramedCallbackDetails {
+ /**
+ * Cause of the navigation.
+ * One of: "link", "typed", "auto_bookmark", "auto_subframe", "manual_subframe", "generated", "start_page", "form_submit", "reload", "keyword", or "keyword_generated"
+ */
+ transitionType: string;
+ /**
+ * A list of transition qualifiers.
+ * Each element one of: "client_redirect", "server_redirect", "forward_back", or "from_address_bar"
+ */
+ transitionQualifiers: string[];
+ }
+
+ interface WebNavigationEventFilter {
+ /** Conditions that the URL being navigated to must satisfy. The 'schemes' and 'ports' fields of UrlFilter are ignored for this event. */
+ url: chrome.events.UrlFilter[];
+ }
+
+ interface WebNavigationEvent<T extends WebNavigationCallbackDetails> extends chrome.events.Event<(details: T) => void> {
+ addListener(callback: (details: T) => void, filters?: WebNavigationEventFilter): void;
+ }
+
+ interface WebNavigationFramedEvent extends WebNavigationEvent<WebNavigationFramedCallbackDetails> {}
+
+ interface WebNavigationFramedErrorEvent extends WebNavigationEvent<WebNavigationFramedErrorCallbackDetails> {}
+
+ interface WebNavigationSourceEvent extends WebNavigationEvent<WebNavigationSourceCallbackDetails> {}
+
+ interface WebNavigationParentedEvent extends WebNavigationEvent<WebNavigationParentedCallbackDetails> {}
+
+ interface WebNavigationTransitionalEvent extends WebNavigationEvent<WebNavigationTransitionCallbackDetails> {}
+
+ interface WebNavigationReplacementEvent extends WebNavigationEvent<WebNavigationReplacementCallbackDetails> {}
+
+ /**
+ * Retrieves information about the given frame. A frame refers to an <iframe> or a <frame> of a web page and is identified by a tab ID and a frame ID.
+ * @param details Information about the frame to retrieve information about.
+ * @param callback
+ * Optional parameter details: Information about the requested frame, null if the specified frame ID and/or tab ID are invalid.
+ */
+ export function getFrame(details: GetFrameDetails, callback: (details?: GetFrameResultDetails) => void): void;
+ /**
+ * Retrieves information about all frames of a given tab.
+ * @param details Information about the tab to retrieve all frames from.
+ * @param callback
+ * Optional parameter details: A list of frames in the given tab, null if the specified tab ID is invalid.
+ */
+ export function getAllFrames(details: GetAllFrameDetails, callback: (details?: GetAllFrameResultDetails[]) => void): void;
+
+ /** Fired when the reference fragment of a frame was updated. All future events for that frame will use the updated URL. */
+ var onReferenceFragmentUpdated: WebNavigationTransitionalEvent;
+ /** Fired when a document, including the resources it refers to, is completely loaded and initialized. */
+ var onCompleted: WebNavigationFramedEvent;
+ /**
+ * Fired when the frame's history was updated to a new URL. All future events for that frame will use the updated URL.
+ * @since Chrome 22.
+ */
+ var onHistoryStateUpdated: WebNavigationTransitionalEvent;
+ /** Fired when a new window, or a new tab in an existing window, is created to host a navigation. */
+ var onCreatedNavigationTarget: WebNavigationSourceEvent;
+ /**
+ * Fired when the contents of the tab is replaced by a different (usually previously pre-rendered) tab.
+ * @since Chrome 22.
+ */
+ var onTabReplaced: WebNavigationReplacementEvent;
+ /** Fired when a navigation is about to occur. */
+ var onBeforeNavigate: WebNavigationParentedEvent;
+ /** Fired when a navigation is committed. The document (and the resources it refers to, such as images and subframes) might still be downloading, but at least part of the document has been received from the server and the browser has decided to switch to the new document. */
+ var onCommitted: WebNavigationTransitionalEvent;
+ /** Fired when the page's DOM is fully constructed, but the referenced resources may not finish loading. */
+ var onDOMContentLoaded: WebNavigationFramedEvent;
+ /** Fired when an error occurs and the navigation is aborted. This can happen if either a network error occurred, or the user aborted the navigation. */
+ var onErrorOccurred: WebNavigationFramedErrorEvent;
+}
+
+////////////////////
+// Web Request
+////////////////////
+/**
+ * Use the chrome.webRequest API to observe and analyze traffic and to intercept, block, or modify requests in-flight.
+ * Permissions: "webRequest", host permissions
+ * @since Chrome 17.
+ */
+declare namespace chrome.webRequest {
+ interface AuthCredentials {
+ username: string;
+ password: string;
+ }
+
+ /** An HTTP Header, represented as an object containing a key and either a value or a binaryValue. */
+ interface HttpHeader {
+ name: string;
+ value?: string;
+ binaryValue?: ArrayBuffer;
+ }
+
+ /** Returns value for event handlers that have the 'blocking' extraInfoSpec applied. Allows the event handler to modify network requests. */
+ interface BlockingResponse {
+ /** Optional. If true, the request is cancelled. Used in onBeforeRequest, this prevents the request from being sent. */
+ cancel?: boolean;
+ /**
+ * Optional.
+ * Only used as a response to the onBeforeRequest and onHeadersReceived events. If set, the original request is prevented from being sent/completed and is instead redirected to the given URL. Redirections to non-HTTP schemes such as data: are allowed. Redirects initiated by a redirect action use the original request method for the redirect, with one exception: If the redirect is initiated at the onHeadersReceived stage, then the redirect will be issued using the GET method.
+ */
+ redirectUrl?: string;
+ /**
+ * Optional.
+ * Only used as a response to the onHeadersReceived event. If set, the server is assumed to have responded with these response headers instead. Only return responseHeaders if you really want to modify the headers in order to limit the number of conflicts (only one extension may modify responseHeaders for each request).
+ */
+ responseHeaders?: HttpHeader[];
+ /** Optional. Only used as a response to the onAuthRequired event. If set, the request is made using the supplied credentials. */
+ authCredentials?: AuthCredentials;
+ /**
+ * Optional.
+ * Only used as a response to the onBeforeSendHeaders event. If set, the request is made with these request headers instead.
+ */
+ requestHeaders?: HttpHeader[];
+ }
+
+ /** An object describing filters to apply to webRequest events. */
+ interface RequestFilter {
+ /** Optional. */
+ tabId?: number;
+ /**
+ * A list of request types. Requests that cannot match any of the types will be filtered out.
+ * Each element one of: "main_frame", "sub_frame", "stylesheet", "script", "image", "object", "xmlhttprequest", or "other"
+ */
+ types?: string[];
+ /** A list of URLs or URL patterns. Requests that cannot match any of the URLs will be filtered out. */
+ urls: string[];
+ /** Optional. */
+ windowId?: number;
+ }
+
+ /**
+ * Contains data uploaded in a URL request.
+ * @since Chrome 23.
+ */
+ interface UploadData {
+ /** Optional. An ArrayBuffer with a copy of the data. */
+ bytes?: ArrayBuffer;
+ /** Optional. A string with the file's path and name. */
+ file?: string;
+ }
+
+ interface WebRequestBody {
+ /** Optional. Errors when obtaining request body data. */
+ error?: string;
+ /**
+ * Optional.
+ * If the request method is POST and the body is a sequence of key-value pairs encoded in UTF8, encoded as either multipart/form-data, or application/x-www-form-urlencoded, this dictionary is present and for each key contains the list of all values for that key. If the data is of another media type, or if it is malformed, the dictionary is not present. An example value of this dictionary is {'key': ['value1', 'value2']}.
+ */
+ formData?: { [key: string]: string[] };
+ /**
+ * Optional.
+ * If the request method is PUT or POST, and the body is not already parsed in formData, then the unparsed request body elements are contained in this array.
+ */
+ raw?: UploadData[];
+ }
+
+ interface WebAuthChallenger {
+ host: string;
+ port: number;
+ }
+
+ interface ResourceRequest {
+ url: string;
+ /** The ID of the request. Request IDs are unique within a browser session. As a result, they could be used to relate different events of the same request. */
+ requestId: string;
+ /** The value 0 indicates that the request happens in the main frame; a positive value indicates the ID of a subframe in which the request happens. If the document of a (sub-)frame is loaded (type is main_frame or sub_frame), frameId indicates the ID of this frame, not the ID of the outer frame. Frame IDs are unique within a tab. */
+ frameId: number;
+ /** ID of frame that wraps the frame which sent the request. Set to -1 if no parent frame exists. */
+ parentFrameId: number;
+ /** The ID of the tab in which the request takes place. Set to -1 if the request isn't related to a tab. */
+ tabId: number;
+ /**
+ * How the requested resource will be used.
+ * One of: "main_frame", "sub_frame", "stylesheet", "script", "image", "object", "xmlhttprequest", or "other"
+ */
+ type: string;
+ /** The time when this signal is triggered, in milliseconds since the epoch. */
+ timeStamp: number;
+ }
+
+ interface WebRequestDetails extends ResourceRequest {
+ /** Standard HTTP method. */
+ method: string;
+ }
+
+ interface WebRequestHeadersDetails extends WebRequestDetails {
+ /** Optional. The HTTP request headers that are going to be sent out with this request. */
+ requestHeaders?: HttpHeader[];
+ }
+
+ interface WebRequestBodyDetails extends WebRequestDetails {
+ /**
+ * Contains the HTTP request body data. Only provided if extraInfoSpec contains 'requestBody'.
+ * @since Chrome 23.
+ */
+ requestBody: WebRequestBody;
+ }
+
+ interface WebRequestFullDetails extends WebRequestHeadersDetails, WebRequestBodyDetails {
+ }
+
+ interface WebResponseDetails extends ResourceRequest {
+ /** HTTP status line of the response or the 'HTTP/0.9 200 OK' string for HTTP/0.9 responses (i.e., responses that lack a status line). */
+ statusLine: string;
+ /**
+ * Standard HTTP status code returned by the server.
+ * @since Chrome 43.
+ */
+ statusCode: number;
+ }
+
+ interface WebResponseHeadersDetails extends WebResponseDetails {
+ /** Optional. The HTTP response headers that have been received with this response. */
+ responseHeaders?: HttpHeader[];
+ }
+
+ interface WebResponseCacheDetails extends WebResponseHeadersDetails {
+ /**
+ * Optional.
+ * The server IP address that the request was actually sent to. Note that it may be a literal IPv6 address.
+ */
+ ip?: string;
+ /** Indicates if this response was fetched from disk cache. */
+ fromCache: boolean;
+ }
+
+ interface WebRedirectionResponseDetails extends WebResponseCacheDetails {
+ /** The new URL. */
+ redirectUrl: string;
+ }
+
+ interface WebAuthenticationChallengeDetails extends WebResponseHeadersDetails {
+ /** The authentication scheme, e.g. Basic or Digest. */
+ scheme: string;
+ /** The authentication realm provided by the server, if there is one. */
+ realm?: string;
+ /** The server requesting authentication. */
+ challenger: WebAuthChallenger;
+ /** True for Proxy-Authenticate, false for WWW-Authenticate. */
+ isProxy: boolean;
+ }
+
+ interface WebResponseErrorDetails extends WebResponseCacheDetails {
+ /** The error description. This string is not guaranteed to remain backwards compatible between releases. You must not parse and act based upon its content. */
+ error: string;
+ }
+
+ interface WebRequestBodyEvent extends chrome.events.Event<(details: WebRequestBodyDetails) => void> {
+ addListener(callback: (details: WebRequestBodyDetails) => void, filter?: RequestFilter, opt_extraInfoSpec?: string[]): void;
+ }
+
+ interface WebRequestHeadersEvent extends chrome.events.Event<(details: WebRequestHeadersDetails) => void> {
+ addListener(callback: (details: WebRequestHeadersDetails) => void, filter?: RequestFilter, opt_extraInfoSpec?: string[]): void;
+ }
+
+ interface _WebResponseHeadersEvent<T extends WebResponseHeadersDetails> extends chrome.events.Event<(details: T) => void> {
+ addListener(callback: (details: T) => void, filter?: RequestFilter, opt_extraInfoSpec?: string[]): void;
+ }
+
+ interface WebResponseHeadersEvent extends _WebResponseHeadersEvent<WebResponseHeadersDetails> {}
+
+ interface WebResponseCacheEvent extends _WebResponseHeadersEvent<WebResponseCacheDetails> {}
+
+ interface WebRedirectionResponseEvent extends _WebResponseHeadersEvent<WebRedirectionResponseDetails> {}
+
+ interface WebAuthenticationChallengeEvent extends chrome.events.Event<(details: WebAuthenticationChallengeDetails, callback?: (response: BlockingResponse) => void) => void> {
+ addListener(callback: (details: WebAuthenticationChallengeDetails) => void, filter?: RequestFilter, opt_extraInfoSpec?: string[]): void;
+ }
+
+ interface WebResponseErrorEvent extends _WebResponseHeadersEvent<WebResponseErrorDetails> {}
+
+ /**
+ * The maximum number of times that handlerBehaviorChanged can be called per 10 minute sustained interval. handlerBehaviorChanged is an expensive function call that shouldn't be called often.
+ * @since Chrome 23.
+ */
+ var MAX_HANDLER_BEHAVIOR_CHANGED_CALLS_PER_10_MINUTES: number;
+
+ /** Needs to be called when the behavior of the webRequest handlers has changed to prevent incorrect handling due to caching. This function call is expensive. Don't call it often. */
+ export function handlerBehaviorChanged(callback?: Function): void;
+
+ /** Fired when a request is about to occur. */
+ var onBeforeRequest: WebRequestBodyEvent;
+ /** Fired before sending an HTTP request, once the request headers are available. This may occur after a TCP connection is made to the server, but before any HTTP data is sent. */
+ var onBeforeSendHeaders: WebRequestHeadersEvent;
+ /** Fired just before a request is going to be sent to the server (modifications of previous onBeforeSendHeaders callbacks are visible by the time onSendHeaders is fired). */
+ var onSendHeaders: WebRequestHeadersEvent;
+ /** Fired when HTTP response headers of a request have been received. */
+ var onHeadersReceived: WebResponseHeadersEvent;
+ /** Fired when an authentication failure is received. The listener has three options: it can provide authentication credentials, it can cancel the request and display the error page, or it can take no action on the challenge. If bad user credentials are provided, this may be called multiple times for the same request. */
+ var onAuthRequired: WebAuthenticationChallengeEvent;
+ /** Fired when the first byte of the response body is received. For HTTP requests, this means that the status line and response headers are available. */
+ var onResponseStarted: WebResponseCacheEvent;
+ /** Fired when a server-initiated redirect is about to occur. */
+ var onBeforeRedirect: WebRedirectionResponseEvent;
+ /** Fired when a request is completed. */
+ var onCompleted: WebResponseCacheEvent;
+ /** Fired when an error occurs. */
+ var onErrorOccurred: WebResponseErrorEvent;
+}
+
+////////////////////
+// Web Store
+////////////////////
+/**
+ * Use the chrome.webstore API to initiate app and extension installations "inline" from your site.
+ * @since Chrome 15.
+ */
+declare namespace chrome.webstore {
+ /**
+ * @param url Optional. If you have more than one <link> tag on your page with the chrome-webstore-item relation, you can choose which item you'd like to install by passing in its URL here. If it is omitted, then the first (or only) link will be used. An exception will be thrown if the passed in URL does not exist on the page.
+ * @param successCallback Optional. This function is invoked when inline installation successfully completes (after the dialog is shown and the user agrees to add the item to Chrome). You may wish to use this to hide the user interface element that prompted the user to install the app or extension.
+ * @param failureCallback Optional. This function is invoked when inline installation does not successfully complete. Possible reasons for this include the user canceling the dialog, the linked item not being found in the store, or the install being initiated from a non-verified site.
+ * Parameter error: The failure detail. You may wish to inspect or log this for debugging purposes, but you should not rely on specific strings being passed back.
+ * Optional parameter errorCode: The error code from the stable set of possible errors.
+ * * Enum of the possible install results, including error codes sent back in the event that an inline installation has failed.
+ * * * "otherError": An uncommon, unrecognized, or unexpected error. In some cases, the readable error string can provide more information.
+ * * * "aborted": The operation was aborted as the requestor is no longer alive.
+ * * * "installInProgress": An installation of the same extension is in progress.
+ * * * "notPermitted": The installation is not permitted.
+ * * * "invalidId": Invalid Chrome Web Store item ID.
+ * * * "webstoreRequestError": Failed to retrieve extension metadata from the Web Store.
+ * * * "invalidWebstoreResponse": The extension metadata retrieved from the Web Store was invalid.
+ * * * "invalidManifest": An error occurred while parsing the extension manifest retrieved from the Web Store.
+ * * * "iconError": Failed to retrieve the extension's icon from the Web Store, or the icon was invalid.
+ * * * "userCanceled": The user canceled the operation.
+ * * * "blacklisted": The extension is blacklisted.
+ * * * "missingDependencies": Unsatisfied dependencies, such as shared modules.
+ * * * "requirementViolations": Unsatisfied requirements, such as webgl.
+ * * * "blockedByPolicy": The extension is blocked by management policies.
+ * * * "launchFeatureDisabled": The launch feature is not available.
+ * * * "launchUnsupportedExtensionType": The launch feature is not supported for the extension type.
+ * * * "launchInProgress": A launch of the same extension is in progress.
+ */
+ export function install(url: string, successCallback?: Function, failureCallback?: (error: string, errorCode?: string) => void): void;
+ /**
+ * @param successCallback Optional. This function is invoked when inline installation successfully completes (after the dialog is shown and the user agrees to add the item to Chrome). You may wish to use this to hide the user interface element that prompted the user to install the app or extension.
+ * @param failureCallback Optional. This function is invoked when inline installation does not successfully complete. Possible reasons for this include the user canceling the dialog, the linked item not being found in the store, or the install being initiated from a non-verified site.
+ * Parameter error: The failure detail. You may wish to inspect or log this for debugging purposes, but you should not rely on specific strings being passed back.
+ * Optional parameter errorCode: The error code from the stable set of possible errors.
+ * * Enum of the possible install results, including error codes sent back in the event that an inline installation has failed.
+ * * * "otherError": An uncommon, unrecognized, or unexpected error. In some cases, the readable error string can provide more information.
+ * * * "aborted": The operation was aborted as the requestor is no longer alive.
+ * * * "installInProgress": An installation of the same extension is in progress.
+ * * * "notPermitted": The installation is not permitted.
+ * * * "invalidId": Invalid Chrome Web Store item ID.
+ * * * "webstoreRequestError": Failed to retrieve extension metadata from the Web Store.
+ * * * "invalidWebstoreResponse": The extension metadata retrieved from the Web Store was invalid.
+ * * * "invalidManifest": An error occurred while parsing the extension manifest retrieved from the Web Store.
+ * * * "iconError": Failed to retrieve the extension's icon from the Web Store, or the icon was invalid.
+ * * * "userCanceled": The user canceled the operation.
+ * * * "blacklisted": The extension is blacklisted.
+ * * * "missingDependencies": Unsatisfied dependencies, such as shared modules.
+ * * * "requirementViolations": Unsatisfied requirements, such as webgl.
+ * * * "blockedByPolicy": The extension is blocked by management policies.
+ * * * "launchFeatureDisabled": The launch feature is not available.
+ * * * "launchUnsupportedExtensionType": The launch feature is not supported for the extension type.
+ * * * "launchInProgress": A launch of the same extension is in progress.
+ */
+ export function install(successCallback: Function, failureCallback?: (error: string, errorCode?: string) => void): void;
+ /**
+ * @param failureCallback Optional. This function is invoked when inline installation does not successfully complete. Possible reasons for this include the user canceling the dialog, the linked item not being found in the store, or the install being initiated from a non-verified site.
+ * Parameter error: The failure detail. You may wish to inspect or log this for debugging purposes, but you should not rely on specific strings being passed back.
+ * Optional parameter errorCode: The error code from the stable set of possible errors.
+ * * Enum of the possible install results, including error codes sent back in the event that an inline installation has failed.
+ * * * "otherError": An uncommon, unrecognized, or unexpected error. In some cases, the readable error string can provide more information.
+ * * * "aborted": The operation was aborted as the requestor is no longer alive.
+ * * * "installInProgress": An installation of the same extension is in progress.
+ * * * "notPermitted": The installation is not permitted.
+ * * * "invalidId": Invalid Chrome Web Store item ID.
+ * * * "webstoreRequestError": Failed to retrieve extension metadata from the Web Store.
+ * * * "invalidWebstoreResponse": The extension metadata retrieved from the Web Store was invalid.
+ * * * "invalidManifest": An error occurred while parsing the extension manifest retrieved from the Web Store.
+ * * * "iconError": Failed to retrieve the extension's icon from the Web Store, or the icon was invalid.
+ * * * "userCanceled": The user canceled the operation.
+ * * * "blacklisted": The extension is blacklisted.
+ * * * "missingDependencies": Unsatisfied dependencies, such as shared modules.
+ * * * "requirementViolations": Unsatisfied requirements, such as webgl.
+ * * * "blockedByPolicy": The extension is blocked by management policies.
+ * * * "launchFeatureDisabled": The launch feature is not available.
+ * * * "launchUnsupportedExtensionType": The launch feature is not supported for the extension type.
+ * * * "launchInProgress": A launch of the same extension is in progress.
+ */
+ export function install(failureCallback?: (error: string, errorCode?: string) => void): void;
+
+ interface InstallationStageEvent extends chrome.events.Event<(stage: string) => void> {}
+
+ interface DownloadProgressEvent extends chrome.events.Event<(percentDownloaded: number) => void> {}
+
+ /**
+ * Fired when an inline installation enters a new InstallStage. In order to receive notifications about this event, listeners must be registered before the inline installation begins.
+ * @since Chrome 35.
+ */
+ var onInstallStageChanged: InstallationStageEvent;
+ /**
+ * Fired periodically with the download progress of an inline install. In order to receive notifications about this event, listeners must be registered before the inline installation begins.
+ * @since Chrome 35.
+ */
+ var onDownloadProgress: DownloadProgressEvent;
+}
+
+////////////////////
+// Windows
+////////////////////
+/**
+ * Use the chrome.windows API to interact with browser windows. You can use this API to create, modify, and rearrange windows in the browser.
+ * Permissions: The chrome.windows API can be used without declaring any permission. However, the "tabs" permission is required in order to populate the url, title, and favIconUrl properties of Tab objects.
+ * @since Chrome 5.
+ */
+declare namespace chrome.windows {
+ interface Window {
+ /** Array of tabs.Tab objects representing the current tabs in the window. */
+ tabs?: chrome.tabs.Tab[];
+ /** Optional. The offset of the window from the top edge of the screen in pixels. Under some circumstances a Window may not be assigned top property, for example when querying closed windows from the sessions API. */
+ top?: number;
+ /** Optional. The height of the window, including the frame, in pixels. Under some circumstances a Window may not be assigned height property, for example when querying closed windows from the sessions API. */
+ height?: number;
+ /** Optional. The width of the window, including the frame, in pixels. Under some circumstances a Window may not be assigned width property, for example when querying closed windows from the sessions API. */
+ width?: number;
+ /**
+ * The state of this browser window.
+ * One of: "normal", "minimized", "maximized", "fullscreen", or "docked"
+ * @since Chrome 17.
+ */
+ state: string;
+ /** Whether the window is currently the focused window. */
+ focused: boolean;
+ /**
+ * Whether the window is set to be always on top.
+ * @since Chrome 19.
+ */
+ alwaysOnTop: boolean;
+ /** Whether the window is incognito. */
+ incognito: boolean;
+ /**
+ * The type of browser window this is.
+ * One of: "normal", "popup", "panel", "app", or "devtools"
+ */
+ type: string;
+ /** Optional. The ID of the window. Window IDs are unique within a browser session. Under some circumstances a Window may not be assigned an ID, for example when querying windows using the sessions API, in which case a session ID may be present. */
+ id: number;
+ /** Optional. The offset of the window from the left edge of the screen in pixels. Under some circumstances a Window may not be assigned left property, for example when querying closed windows from the sessions API. */
+ left?: number;
+ /**
+ * The session ID used to uniquely identify a Window obtained from the sessions API.
+ * @since Chrome 31.
+ */
+ sessionId?: string;
+ }
+
+ interface GetInfo {
+ /**
+ * Optional.
+ * If true, the windows.Window object will have a tabs property that contains a list of the tabs.Tab objects. The Tab objects only contain the url, title and favIconUrl properties if the extension's manifest file includes the "tabs" permission.
+ */
+ populate?: boolean;
+ /**
+ * If set, the windows.Window returned will be filtered based on its type. If unset the default filter is set to ['app', 'normal', 'panel', 'popup'], with 'app' and 'panel' window types limited to the extension's own windows.
+ * Each one of: "normal", "popup", "panel", "app", or "devtools"
+ * @since Chrome 46. Warning: this is the current Beta channel.
+ */
+ windowTypes?: string[];
+ }
+
+ interface CreateData {
+ /**
+ * Optional. The id of the tab for which you want to adopt to the new window.
+ * @since Chrome 10.
+ */
+ tabId?: number;
+ /**
+ * Optional.
+ * A URL or array of URLs to open as tabs in the window. Fully-qualified URLs must include a scheme (i.e. 'http://www.google.com', not 'www.google.com'). Relative URLs will be relative to the current page within the extension. Defaults to the New Tab Page.
+ */
+ url?: string | string[];
+ /**
+ * Optional.
+ * The number of pixels to position the new window from the top edge of the screen. If not specified, the new window is offset naturally from the last focused window. This value is ignored for panels.
+ */
+ top?: number;
+ /**
+ * Optional.
+ * The height in pixels of the new window, including the frame. If not specified defaults to a natural height.
+ */
+ height?: number;
+ /**
+ * Optional.
+ * The width in pixels of the new window, including the frame. If not specified defaults to a natural width.
+ */
+ width?: number;
+ /**
+ * Optional. If true, opens an active window. If false, opens an inactive window.
+ * @since Chrome 12.
+ */
+ focused?: boolean;
+ /** Optional. Whether the new window should be an incognito window. */
+ incognito?: boolean;
+ /**
+ * Optional. Specifies what type of browser window to create. The 'panel' and 'detached_panel' types create a popup unless the '--enable-panels' flag is set.
+ * One of: "normal", "popup", "panel", or "detached_panel"
+ */
+ type?: string;
+ /**
+ * Optional.
+ * The number of pixels to position the new window from the left edge of the screen. If not specified, the new window is offset naturally from the last focused window. This value is ignored for panels.
+ */
+ left?: number;
+ /**
+ * Optional. The initial state of the window. The 'minimized', 'maximized' and 'fullscreen' states cannot be combined with 'left', 'top', 'width' or 'height'.
+ * One of: "normal", "minimized", "maximized", "fullscreen", or "docked"
+ * @since Chrome 44.
+ */
+ state?: string;
+ }
+
+ interface UpdateInfo {
+ /** Optional. The offset from the top edge of the screen to move the window to in pixels. This value is ignored for panels. */
+ top?: number;
+ /**
+ * Optional. If true, causes the window to be displayed in a manner that draws the user's attention to the window, without changing the focused window. The effect lasts until the user changes focus to the window. This option has no effect if the window already has focus. Set to false to cancel a previous draw attention request.
+ * @since Chrome 14.
+ */
+ drawAttention?: boolean;
+ /** Optional. The height to resize the window to in pixels. This value is ignored for panels. */
+ height?: number;
+ /** Optional. The width to resize the window to in pixels. This value is ignored for panels. */
+ width?: number;
+ /**
+ * Optional. The new state of the window. The 'minimized', 'maximized' and 'fullscreen' states cannot be combined with 'left', 'top', 'width' or 'height'.
+ * One of: "normal", "minimized", "maximized", "fullscreen", or "docked"
+ * @since Chrome 17.
+ */
+ state?: string;
+ /**
+ * Optional. If true, brings the window to the front. If false, brings the next window in the z-order to the front.
+ * @since Chrome 8.
+ */
+ focused?: boolean;
+ /** Optional. The offset from the left edge of the screen to move the window to in pixels. This value is ignored for panels. */
+ left?: number;
+ }
+
+ interface WindowEventFilter {
+ /**
+ * Conditions that the window's type being created must satisfy. By default it will satisfy ['app', 'normal', 'panel', 'popup'], with 'app' and 'panel' window types limited to the extension's own windows.
+ * Each one of: "normal", "popup", "panel", "app", or "devtools"
+ */
+ windowTypes: string[];
+ }
+
+ interface WindowIdEvent extends chrome.events.Event<(windowId: number, filters?: WindowEventFilter) => void> {}
+
+ interface WindowReferenceEvent extends chrome.events.Event<(window: Window, filters?: WindowEventFilter) => void> {}
+
+ /**
+ * The windowId value that represents the current window.
+ * @since Chrome 18.
+ */
+ var WINDOW_ID_CURRENT: number;
+ /**
+ * The windowId value that represents the absence of a chrome browser window.
+ * @since Chrome 6.
+ */
+ var WINDOW_ID_NONE: number;
+
+ /** Gets details about a window. */
+ export function get(windowId: number, callback: (window: chrome.windows.Window) => void): void;
+ /**
+ * Gets details about a window.
+ * @since Chrome 18.
+ */
+ export function get(windowId: number, getInfo: GetInfo, callback: (window: chrome.windows.Window) => void): void;
+ /**
+ * Gets the current window.
+ */
+ export function getCurrent(callback: (window: chrome.windows.Window) => void): void;
+ /**
+ * Gets the current window.
+ * @since Chrome 18.
+ */
+ export function getCurrent(getInfo: GetInfo, callback: (window: chrome.windows.Window) => void): void;
+ /**
+ * Creates (opens) a new browser with any optional sizing, position or default URL provided.
+ * @param callback
+ * Optional parameter window: Contains details about the created window.
+ */
+ export function create(callback?: (window?: chrome.windows.Window) => void): void;
+ /**
+ * Creates (opens) a new browser with any optional sizing, position or default URL provided.
+ * @param callback
+ * Optional parameter window: Contains details about the created window.
+ */
+ export function create(createData: CreateData, callback?: (window?: chrome.windows.Window) => void): void;
+ /**
+ * Gets all windows.
+ */
+ export function getAll(callback: (windows: chrome.windows.Window[]) => void): void;
+ /**
+ * Gets all windows.
+ * @since Chrome 18.
+ */
+ export function getAll(getInfo: GetInfo, callback: (windows: chrome.windows.Window[]) => void): void;
+ /** Updates the properties of a window. Specify only the properties that you want to change; unspecified properties will be left unchanged. */
+ export function update(windowId: number, updateInfo: UpdateInfo, callback?: (window: chrome.windows.Window) => void): void;
+ /** Removes (closes) a window, and all the tabs inside it. */
+ export function remove(windowId: number, callback?: Function): void;
+ /**
+ * Gets the window that was most recently focused — typically the window 'on top'.
+ */
+ export function getLastFocused(callback: (window: chrome.windows.Window) => void): void;
+ /**
+ * Gets the window that was most recently focused — typically the window 'on top'.
+ * @since Chrome 18.
+ */
+ export function getLastFocused(getInfo: GetInfo, callback: (window: chrome.windows.Window) => void): void;
+
+ /** Fired when a window is removed (closed). */
+ var onRemoved: WindowIdEvent;
+ /** Fired when a window is created. */
+ var onCreated: WindowReferenceEvent;
+ /**
+ * Fired when the currently focused window changes. Will be chrome.windows.WINDOW_ID_NONE if all chrome windows have lost focus.
+ * Note: On some Linux window managers, WINDOW_ID_NONE will always be sent immediately preceding a switch from one chrome window to another.
+ */
+ var onFocusChanged: WindowIdEvent;
+}
diff --git a/lib/decl/filesystem/filesystem.d.ts b/lib/decl/filesystem/filesystem.d.ts
new file mode 100644
index 000000000..1b76846b4
--- /dev/null
+++ b/lib/decl/filesystem/filesystem.d.ts
@@ -0,0 +1,548 @@
+// Type definitions for File System API
+// Project: http://www.w3.org/TR/file-system-api/
+// Definitions by: Kon <http://phyzkit.net/>
+// Definitions: https://github.com/borisyankov/DefinitelyTyped
+
+/// <reference path="../filewriter/filewriter.d.ts" />
+
+interface LocalFileSystem {
+
+ /**
+ * Used for storage with no guarantee of persistence.
+ */
+ TEMPORARY:number;
+
+ /**
+ * Used for storage that should not be removed by the user agent without application or user permission.
+ */
+ PERSISTENT:number;
+
+ /**
+ * Requests a filesystem in which to store application data.
+ * @param type Whether the filesystem requested should be persistent, as defined above. Use one of TEMPORARY or PERSISTENT.
+ * @param size This is an indicator of how much storage space, in bytes, the application expects to need.
+ * @param successCallback The callback that is called when the user agent provides a filesystem.
+ * @param errorCallback A callback that is called when errors happen, or when the request to obtain the filesystem is denied.
+ */
+ requestFileSystem(type:number, size:number, successCallback:FileSystemCallback, errorCallback?:ErrorCallback):void;
+
+ /**
+ * Allows the user to look up the Entry for a file or directory referred to by a local URL.
+ * @param url A URL referring to a local file in a filesystem accessable via this API.
+ * @param successCallback A callback that is called to report the Entry to which the supplied URL refers.
+ * @param errorCallback A callback that is called when errors happen, or when the request to obtain the Entry is denied.
+ */
+ resolveLocalFileSystemURL(url:string, successCallback:EntryCallback, errorCallback?:ErrorCallback):void;
+
+ /**
+ * see requestFileSystem.
+ */
+ webkitRequestFileSystem(type:number, size:number, successCallback:FileSystemCallback, errorCallback?:ErrorCallback):void;
+}
+
+interface LocalFileSystemSync {
+ /**
+ * Used for storage with no guarantee of persistence.
+ */
+ TEMPORARY:number;
+
+ /**
+ * Used for storage that should not be removed by the user agent without application or user permission.
+ */
+ PERSISTENT:number;
+
+ /**
+ * Requests a filesystem in which to store application data.
+ * @param type Whether the filesystem requested should be persistent, as defined above. Use one of TEMPORARY or PERSISTENT.
+ * @param size This is an indicator of how much storage space, in bytes, the application expects to need.
+ */
+ requestFileSystemSync(type:number, size:number):FileSystemSync;
+
+ /**
+ * Allows the user to look up the Entry for a file or directory referred to by a local URL.
+ * @param url A URL referring to a local file in a filesystem accessable via this API.
+ */
+ resolveLocalFileSystemSyncURL(url:string):EntrySync;
+
+ /**
+ * see requestFileSystemSync
+ */
+ webkitRequestFileSystemSync(type:number, size:number):FileSystemSync;
+}
+
+interface Metadata {
+ /**
+ * This is the time at which the file or directory was last modified.
+ * @readonly
+ */
+ modificationTime:Date;
+
+ /**
+ * The size of the file, in bytes. This must return 0 for directories.
+ * @readonly
+ */
+ size:number;
+}
+
+interface Flags {
+ /**
+ * Used to indicate that the user wants to create a file or directory if it was not previously there.
+ */
+ create?:boolean;
+
+ /**
+ * By itself, exclusive must have no effect. Used with create, it must cause getFile and getDirectory to fail if the target path already exists.
+ */
+ exclusive?:boolean;
+}
+
+/**
+ * This interface represents a file system.
+ */
+interface FileSystem{
+ /**
+ * This is the name of the file system. The specifics of naming filesystems is unspecified, but a name must be unique across the list of exposed file systems.
+ * @readonly
+ */
+ name: string;
+
+ /**
+ * The root directory of the file system.
+ * @readonly
+ */
+ root: DirectoryEntry;
+}
+
+interface Entry {
+
+ /**
+ * Entry is a file.
+ */
+ isFile:boolean;
+
+ /**
+ * Entry is a directory.
+ */
+ isDirectory:boolean;
+
+ /**
+ * Look up metadata about this entry.
+ * @param successCallback A callback that is called with the time of the last modification.
+ * @param errorCallback ErrorCallback A callback that is called when errors happen.
+ */
+ getMetadata(successCallback:MetadataCallback, errorCallback?:ErrorCallback):void;
+
+ /**
+ * The name of the entry, excluding the path leading to it.
+ */
+ name:string;
+
+ /**
+ * The full absolute path from the root to the entry.
+ */
+ fullPath:string;
+
+ /**
+ * The file system on which the entry resides.
+ */
+ filesystem:FileSystem;
+
+ /**
+ * Move an entry to a different location on the file system. It is an error to try to:
+ *
+ * <ui>
+ * <li>move a directory inside itself or to any child at any depth;</li>
+ * <li>move an entry into its parent if a name different from its current one isn't provided;</li>
+ * <li>move a file to a path occupied by a directory;</li>
+ * <li>move a directory to a path occupied by a file;</li>
+ * <li>move any element to a path occupied by a directory which is not empty.</li>
+ * <ul>
+ *
+ * A move of a file on top of an existing file must attempt to delete and replace that file.
+ * A move of a directory on top of an existing empty directory must attempt to delete and replace that directory.
+ */
+ moveTo(parent:DirectoryEntry, newName?:string, successCallback?:EntryCallback, errorCallback?:ErrorCallback):string;
+
+ /**
+ * Copy an entry to a different location on the file system. It is an error to try to:
+ *
+ * <ul>
+ * <li> copy a directory inside itself or to any child at any depth;</li>
+ * <li> copy an entry into its parent if a name different from its current one isn't provided;</li>
+ * <li> copy a file to a path occupied by a directory;</li>
+ * <li> copy a directory to a path occupied by a file;</li>
+ * <li> copy any element to a path occupied by a directory which is not empty.</li>
+ * <li> A copy of a file on top of an existing file must attempt to delete and replace that file.</li>
+ * <li> A copy of a directory on top of an existing empty directory must attempt to delete and replace that directory.</li>
+ * </ul>
+ *
+ * Directory copies are always recursive--that is, they copy all contents of the directory.
+ */
+ copyTo(parent:DirectoryEntry, newName?:string, successCallback?:EntryCallback, errorCallback?:ErrorCallback):string;
+
+ /**
+ * Returns a URL that can be used to identify this entry. Unlike the URN defined in [FILE-API-ED], it has no specific expiration; as it describes a location on disk, it should be valid at least as long as that location exists.
+ */
+ toURL():string;
+
+ /**
+ * Deletes a file or directory. It is an error to attempt to delete a directory that is not empty. It is an error to attempt to delete the root directory of a filesystem.
+ * @param successCallback A callback that is called on success.
+ * @param errorCallback A callback that is called when errors happen.
+ */
+ remove(successCallback:VoidCallback, errorCallback?:ErrorCallback):void;
+
+ /**
+ * Look up the parent DirectoryEntry containing this Entry. If this Entry is the root of its filesystem, its parent is itself.
+ * @param successCallback A callback that is called to return the parent Entry.
+ * @param errorCallback A callback that is called when errors happen.
+ */
+ getParent(successCallback:DirectoryEntryCallback, errorCallback?:ErrorCallback):void;
+}
+
+/**
+ * This interface represents a directory on a file system.
+ */
+interface DirectoryEntry extends Entry {
+ /**
+ * Creates a new DirectoryReader to read Entries from this Directory.
+ */
+ createReader():DirectoryReader;
+
+ /**
+ * Creates or looks up a file.
+ * @param path Either an absolute path or a relative path from this DirectoryEntry to the file to be looked up or created. It is an error to attempt to create a file whose immediate parent does not yet exist.
+ * @param options
+ * <ul>
+ * <li>If create and exclusive are both true, and the path already exists, getFile must fail.</li>
+ * <li>If create is true, the path doesn't exist, and no other error occurs, getFile must create it as a zero-length file and return a corresponding FileEntry.</li>
+ * <li>If create is not true and the path doesn't exist, getFile must fail.</li>
+ * <li>If create is not true and the path exists, but is a directory, getFile must fail.</li>
+ * <li>Otherwise, if no other error occurs, getFile must return a FileEntry corresponding to path.</li>
+ * </ul>
+ * @param successCallback A callback that is called to return the File selected or created.
+ * @param errorCallback A callback that is called when errors happen.
+ */
+ getFile(path:string, options?:Flags, successCallback?:FileEntryCallback, errorCallback?:ErrorCallback):void;
+
+ /**
+ * Creates or looks up a directory.
+ * @param path Either an absolute path or a relative path from this DirectoryEntry to the directory to be looked up or created. It is an error to attempt to create a directory whose immediate parent does not yet exist.
+ * @param options
+ * <ul>
+ * <li>If create and exclusive are both true and the path already exists, getDirectory must fail.</li>
+ * <li>If create is true, the path doesn't exist, and no other error occurs, getDirectory must create and return a corresponding DirectoryEntry.</li>
+ * <li>If create is not true and the path doesn't exist, getDirectory must fail.</li>
+ * <li>If create is not true and the path exists, but is a file, getDirectory must fail.</li>
+ * <li>Otherwise, if no other error occurs, getDirectory must return a DirectoryEntry corresponding to path.</li>
+ * </ul>
+ * @param successCallback A callback that is called to return the DirectoryEntry selected or created.
+ * @param errorCallback A callback that is called when errors happen.
+ *
+ */
+ getDirectory(path:string, options?:Flags, successCallback?:DirectoryEntryCallback, errorCallback?:ErrorCallback):void;
+
+ /**
+ * Deletes a directory and all of its contents, if any. In the event of an error [e.g. trying to delete a directory that contains a file that cannot be removed], some of the contents of the directory may be deleted. It is an error to attempt to delete the root directory of a filesystem.
+ * @param successCallback A callback that is called on success.
+ * @param errorCallback A callback that is called when errors happen.
+ */
+ removeRecursively(successCallback:VoidCallback, errorCallback?:ErrorCallback):void;
+}
+
+/**
+ * This interface lets a user list files and directories in a directory. If there are no additions to or deletions from a directory between the first and last call to readEntries, and no errors occur, then:
+ * <ul>
+ * <li> A series of calls to readEntries must return each entry in the directory exactly once.</li>
+ * <li> Once all entries have been returned, the next call to readEntries must produce an empty array.</li>
+ * <li> If not all entries have been returned, the array produced by readEntries must not be empty.</li>
+ * <li> The entries produced by readEntries must not include the directory itself ["."] or its parent [".."].</li>
+ * </ul>
+ */
+interface DirectoryReader {
+ /**
+ * Read the next block of entries from this directory.
+ * @param successCallback Called once per successful call to readEntries to deliver the next previously-unreported set of Entries in the associated Directory. If all Entries have already been returned from previous invocations of readEntries, successCallback must be called with a zero-length array as an argument.
+ * @param errorCallback A callback indicating that there was an error reading from the Directory.
+ */
+ readEntries(successCallback:EntriesCallback, errorCallback?:ErrorCallback):void;
+}
+
+/**
+ * This interface represents a file on a file system.
+ */
+interface FileEntry extends Entry {
+ /**
+ * Creates a new FileWriter associated with the file that this FileEntry represents.
+ * @param successCallback A callback that is called with the new FileWriter.
+ * @param errorCallback A callback that is called when errors happen.
+ */
+ createWriter(successCallback:FileWriterCallback, errorCallback?:ErrorCallback):void;
+
+ /**
+ * Returns a File that represents the current state of the file that this FileEntry represents.
+ * @param successCallback A callback that is called with the File.
+ * @param errorCallback A callback that is called when errors happen.
+ */
+ file(successCallback:FileCallback, errorCallback?:ErrorCallback):void;
+}
+
+/**
+ * When requestFileSystem() succeeds, the following callback is made.
+ */
+interface FileSystemCallback {
+ /**
+ * @param filesystem The file systems to which the app is granted access.
+ */
+ (filesystem:FileSystem):void;
+}
+
+/**
+ * This interface is the callback used to look up Entry objects.
+ */
+interface EntryCallback {
+ /**
+ * @param entry
+ */
+ (entry:Entry):void;
+}
+
+/**
+ * This interface is the callback used to look up FileEntry objects.
+ */
+interface FileEntryCallback {
+ /**
+ * @param entry
+ */
+ (entry:FileEntry):void;
+}
+
+/**
+ * This interface is the callback used to look up DirectoryEntry objects.
+ */
+interface DirectoryEntryCallback {
+ /**
+ * @param entry
+ */
+ (entry:DirectoryEntry):void;
+}
+
+/**
+ * When readEntries() succeeds, the following callback is made.
+ */
+interface EntriesCallback {
+ (entries:Entry[]):void;
+}
+
+/**
+ * This interface is the callback used to look up file and directory metadata.
+ */
+interface MetadataCallback {
+ (metadata:Metadata):void;
+}
+
+/**
+ * This interface is the callback used to create a FileWriter.
+ */
+interface FileWriterCallback {
+ (fileWriter:FileWriter):void;
+}
+
+/**
+ * This interface is the callback used to obtain a File.
+ */
+interface FileCallback {
+ (file:File):void;
+}
+
+/**
+ * This interface is the generic callback used to indicate success of an asynchronous method.
+ */
+interface VoidCallback {
+ ():void;
+}
+
+/**
+ * When an error occurs, the following callback is made.
+ */
+interface ErrorCallback {
+ (err:DOMError):void;
+}
+
+
+/**
+ * This interface represents a file system.
+ */
+interface FileSystemSync {
+ /**
+ * This is the name of the file system. The specifics of naming filesystems is unspecified, but a name must be unique across the list of exposed file systems.
+ */
+ name:string;
+
+ /**
+ * root The root directory of the file system.
+ */
+ root:DirectoryEntrySync;
+}
+
+/**
+ * An abstract interface representing entries in a file system, each of which may be a FileEntrySync or DirectoryEntrySync.
+ */
+interface EntrySync{
+ /**
+ * EntrySync is a file.
+ * @readonly
+ */
+ isFile:boolean;
+
+ /**
+ * EntrySync is a directory.
+ * @readonly
+ */
+ isDirectory:boolean;
+
+ /**
+ * Look up metadata about this entry.
+ */
+ getMetadata():Metadata;
+
+ /**
+ * The name of the entry, excluding the path leading to it.
+ */
+ name:string;
+
+ /**
+ * The full absolute path from the root to the entry.
+ */
+ fullPath:string;
+
+ /**
+ * The file system on which the entry resides.
+ */
+ filesystem:FileSystemSync;
+
+ /**
+ * Move an entry to a different location on the file system. It is an error to try to:
+ * <ul>
+ * <li> move a directory inside itself or to any child at any depth;</li>
+ * <li> move an entry into its parent if a name different from its current one isn't provided;</li>
+ * <li> move a file to a path occupied by a directory;</li>
+ * <li> move a directory to a path occupied by a file;</li>
+ * <li> move any element to a path occupied by a directory which is not empty.</li>
+ * </ui>
+ * A move of a file on top of an existing file must attempt to delete and replace that file. A move of a directory on top of an existing empty directory must attempt to delete and replace that directory.
+ * @param parent The directory to which to move the entry.
+ * @param newName The new name of the entry. Defaults to the EntrySync's current name if unspecified.
+ */
+ moveTo(parent:DirectoryEntrySync, newName?:string):EntrySync;
+
+ /**
+ * Copy an entry to a different location on the file system. It is an error to try to:
+ * <ul>
+ * <li> copy a directory inside itself or to any child at any depth;</li>
+ * <li> copy an entry into its parent if a name different from its current one isn't provided;</li>
+ * <li> copy a file to a path occupied by a directory;</li>
+ * <li> copy a directory to a path occupied by a file;</li>
+ * <li> copy any element to a path occupied by a directory which is not empty.</li>
+ * </ui>
+ * A copy of a file on top of an existing file must attempt to delete and replace that file.
+ * A copy of a directory on top of an existing empty directory must attempt to delete and replace that directory.
+ * Directory copies are always recursive--that is, they copy all contents of the directory.
+ */
+ copyTo(parent:DirectoryEntrySync, newName?:string):EntrySync;
+
+ /**
+ * Returns a URL that can be used to identify this entry. Unlike the URN defined in [FILE-API-ED], it has no specific expiration; as it describes a location on disk, it should be valid at least as long as that location exists.
+ */
+ toURL():string;
+
+ /**
+ * Deletes a file or directory. It is an error to attempt to delete a directory that is not empty. It is an error to attempt to delete the root directory of a filesystem.
+ */
+ remove ():void;
+
+ /**
+ * Look up the parent DirectoryEntrySync containing this Entry. If this EntrySync is the root of its filesystem, its parent is itself.
+ */
+ getParent():DirectoryEntrySync;
+}
+
+/**
+ * This interface represents a directory on a file system.
+ */
+interface DirectoryEntrySync extends EntrySync {
+ /**
+ * Creates a new DirectoryReaderSync to read EntrySyncs from this DirectorySync.
+ */
+ createReader():DirectoryReaderSync;
+
+ /**
+ * Creates or looks up a directory.
+ * @param path Either an absolute path or a relative path from this DirectoryEntrySync to the file to be looked up or created. It is an error to attempt to create a file whose immediate parent does not yet exist.
+ * @param options
+ * <ul>
+ * <li> If create and exclusive are both true and the path already exists, getFile must fail.</li>
+ * <li> If create is true, the path doesn't exist, and no other error occurs, getFile must create it as a zero-length file and return a corresponding FileEntry.</li>
+ * <li> If create is not true and the path doesn't exist, getFile must fail.</li>
+ * <li> If create is not true and the path exists, but is a directory, getFile must fail.</li>
+ * <li> Otherwise, if no other error occurs, getFile must return a FileEntrySync corresponding to path.</li>
+ * </ul>
+ */
+ getFile(path:string, options?:Flags):FileEntrySync;
+
+ /**
+ * Creates or looks up a directory.
+ * @param path Either an absolute path or a relative path from this DirectoryEntrySync to the directory to be looked up or created. It is an error to attempt to create a directory whose immediate parent does not yet exist.
+ * @param options
+ * <ul>
+ * <li> If create and exclusive are both true and the path already exists, getDirectory must fail.</li>
+ * <li> If create is true, the path doesn't exist, and no other error occurs, getDirectory must create and return a corresponding DirectoryEntry.</li>
+ * <li> If create is not true and the path doesn't exist, getDirectory must fail.</li>
+ * <li> If create is not true and the path exists, but is a file, getDirectory must fail.</li>
+ * <li> Otherwise, if no other error occurs, getDirectory must return a DirectoryEntrySync corresponding to path.</li>
+ * </ul>
+ */
+ getDirectory(path:string, options?:Flags):DirectoryEntrySync;
+
+ /**
+ * Deletes a directory and all of its contents, if any. In the event of an error [e.g. trying to delete a directory that contains a file that cannot be removed], some of the contents of the directory may be deleted. It is an error to attempt to delete the root directory of a filesystem.
+ */
+ removeRecursively():void;
+}
+
+/**
+ * This interface lets a user list files and directories in a directory. If there are no additions to or deletions from a directory between the first and last call to readEntries, and no errors occur, then:
+ * <ul>
+ * <li> A series of calls to readEntries must return each entry in the directory exactly once.</li>
+ * <li> Once all entries have been returned, the next call to readEntries must produce an empty array.</li>
+ * <li> If not all entries have been returned, the array produced by readEntries must not be empty.</li>
+ * <li> The entries produced by readEntries must not include the directory itself ["."] or its parent [".."].</li>
+ * </ul>
+ */
+interface DirectoryReaderSync {
+ /**
+ * Read the next block of entries from this directory.
+ */
+ readEntries():EntrySync[];
+}
+
+/**
+ * This interface represents a file on a file system.
+ */
+interface FileEntrySync extends EntrySync {
+ /**
+ * Creates a new FileWriterSync associated with the file that this FileEntrySync represents.
+ */
+ createWriter():FileWriterSync;
+
+ /**
+ * Returns a File that represents the current state of the file that this FileEntrySync represents.
+ */
+ file():File;
+}
+
+interface Window extends LocalFileSystem, LocalFileSystemSync{
+}
+
+interface WorkerGlobalScope extends LocalFileSystem, LocalFileSystemSync{
+}
diff --git a/lib/decl/filewriter/filewriter.d.ts b/lib/decl/filewriter/filewriter.d.ts
new file mode 100644
index 000000000..a4910d0b1
--- /dev/null
+++ b/lib/decl/filewriter/filewriter.d.ts
@@ -0,0 +1,176 @@
+// Type definitions for File API: Writer
+// Project: http://www.w3.org/TR/file-writer-api/
+// Definitions by: Kon <http://phyzkit.net/>
+// Definitions: https://github.com/borisyankov/DefinitelyTyped
+
+/**
+ * This interface provides methods to monitor the asynchronous writing of blobs to disk using progress events [PROGRESS-EVENTS] and event handler attributes.
+ * This interface is specified to be used within the context of the global object (Window [HTML5]) and within Web Workers (WorkerUtils [WEBWORKERS-ED]).
+ */
+interface FileSaver extends EventTarget {
+ /**
+ * When the abort method is called, user agents must run the steps below:
+ * <ol>
+ * <li> If readyState == DONE or readyState == INIT, terminate this overall series of steps without doing anything else. </li>
+ * <li> Set readyState to DONE. </li>
+ * <li> If there are any tasks from the object's FileSaver task source in one of the task queues, then remove those tasks. </li>
+ * <li> Terminate the write algorithm being processed. </li>
+ * <li> Set the error attribute to a DOMError object of type "AbortError". </li>
+ * <li> Fire a progress event called abort </li>
+ * <li> Fire a progress event called writeend </li>
+ * <li> Terminate this algorithm. </li>
+ * </ol>
+ */
+ abort():void;
+
+ /**
+ * The blob is being written.
+ * @readonly
+ */
+ INIT:number;
+
+ /**
+ * The object has been constructed, but there is no pending write.
+ * @readonly
+ */
+ WRITING:number;
+
+ /**
+ * The entire Blob has been written to the file, an error occurred during the write, or the write was aborted using abort(). The FileSaver is no longer writing the blob.
+ * @readonly
+ */
+ DONE:number;
+
+ /**
+ * The FileSaver object can be in one of 3 states. The readyState attribute, on getting, must return the current state, which must be one of the following values:
+ * <ul>
+ * <li>INIT</li>
+ * <li>WRITING</li>
+ * <li>DONE</li>
+ * <ul>
+ * @readonly
+ */
+ readyState:number;
+
+ /**
+ * The last error that occurred on the FileSaver.
+ * @readonly
+ */
+ error:DOMError;
+
+ /**
+ * Handler for writestart events
+ */
+ onwritestart:Function;
+
+ /**
+ * Handler for progress events.
+ */
+ onprogress:Function;
+
+ /**
+ * Handler for write events.
+ */
+ onwrite:Function;
+
+ /**
+ * Handler for abort events.
+ */
+ onabort:Function;
+
+ /**
+ * Handler for error events.
+ */
+ onerror:Function;
+
+ /**
+ * Handler for writeend events.
+ */
+ onwriteend:Function;
+}
+
+declare var FileSaver: {
+ /**
+ * When the FileSaver constructor is called, the user agent must return a new FileSaver object with readyState set to INIT.
+ * This constructor must be visible when the script's global object is either a Window object or an object implementing the WorkerUtils interface.
+ */
+ new(data:Blob): FileSaver;
+}
+
+/**
+ * This interface expands on the FileSaver interface to allow for multiple write actions, rather than just saving a single Blob.
+ */
+interface FileWriter extends FileSaver {
+ /**
+ * The byte offset at which the next write to the file will occur. This must be no greater than length.
+ * A newly-created FileWriter must have position set to 0.
+ */
+ position:number;
+
+ /**
+ * The length of the file. If the user does not have read access to the file, this must be the highest byte offset at which the user has written.
+ */
+ length:number;
+
+ /**
+ * Write the supplied data to the file at position.
+ * @param data The blob to write.
+ */
+ write(data:Blob):void;
+
+ /**
+ * Seek sets the file position at which the next write will occur.
+ * @param offset If nonnegative, an absolute byte offset into the file. If negative, an offset back from the end of the file.
+ */
+ seek(offset:number):void;
+
+ /**
+ * Changes the length of the file to that specified. If shortening the file, data beyond the new length must be discarded. If extending the file, the existing data must be zero-padded up to the new length.
+ * @param size The size to which the length of the file is to be adjusted, measured in bytes.
+ */
+ truncate(size:number):void;
+}
+
+/**
+ * This interface lets users write, truncate, and append to files using simple synchronous calls.
+ * This interface is specified to be used only within Web Workers (WorkerUtils [WEBWORKERS]).
+ */
+interface FileWriterSync {
+ /**
+ * The byte offset at which the next write to the file will occur. This must be no greater than length.
+ */
+ position:number;
+
+ /**
+ * The length of the file. If the user does not have read access to the file, this must be the highest byte offset at which the user has written.
+ */
+ length:number;
+
+ /**
+ * Write the supplied data to the file at position. Upon completion, position will increase by data.size.
+ * @param data The blob to write.
+ */
+ write(data:Blob):void;
+
+ /**
+ * Seek sets the file position at which the next write will occur.
+ * @param offset An absolute byte offset into the file. If offset is greater than length, length is used instead. If offset is less than zero, length is added to it, so that it is treated as an offset back from the end of the file. If it is still less than zero, zero is used.
+ */
+ seek(offset:number):void;
+
+ /**
+ * Changes the length of the file to that specified. If shortening the file, data beyond the new length must be discarded. If extending the file, the existing data must be zero-padded up to the new length.
+ * Upon successful completion:
+ * <ul>
+ * <li>length must be equal to size.</li>
+ * <li>position must be the lesser of
+ * <ul>
+ * <li>its pre-truncate value,</li>
+ * <li>size.</li>
+ * </ul>
+ * </li>
+ * </ul>
+ * @param size The size to which the length of the file is to be adjusted, measured in bytes.
+ */
+ truncate(size:number):void;
+}
diff --git a/lib/decl/handlebars/handlebars-1.0.0.d.ts b/lib/decl/handlebars/handlebars-1.0.0.d.ts
new file mode 100644
index 000000000..c118760c5
--- /dev/null
+++ b/lib/decl/handlebars/handlebars-1.0.0.d.ts
@@ -0,0 +1,184 @@
+// Type definitions for Handlebars 1.0
+// Project: http://handlebarsjs.com/
+// Definitions by: Boris Yankov <https://github.com/borisyankov/>
+// Definitions: https://github.com/borisyankov/DefinitelyTyped
+
+
+// Use either HandlebarsStatic or HandlebarsRuntimeStatic
+declare var Handlebars: HandlebarsStatic;
+//declare var Handlebars: HandlebarsRuntimeStatic;
+
+/**
+* Implement this interface on your MVW/MVVM/MVC views such as Backbone.View
+**/
+interface HandlebarsTemplatable {
+ template: HandlebarsTemplateDelegate;
+}
+
+interface HandlebarsTemplateDelegate {
+ (context: any, options?: any): string;
+}
+
+interface HandlebarsCommon {
+ registerHelper(name: string, fn: Function, inverse?: boolean): void;
+ registerPartial(name: string, str: any): void;
+ K(): void;
+ createFrame(object: any): any;
+
+ Exception(message: string): void;
+ SafeString: typeof hbs.SafeString;
+ Utils: typeof hbs.Utils;
+
+ logger: Logger;
+ log(level: number, obj: any): void;
+}
+
+interface HandlebarsStatic extends HandlebarsCommon {
+ parse(input: string): hbs.AST.ProgramNode;
+ compile(input: any, options?: any): HandlebarsTemplateDelegate;
+}
+
+interface HandlebarsTemplates {
+ [index: string]: HandlebarsTemplateDelegate;
+}
+
+interface HandlebarsRuntimeStatic extends HandlebarsCommon {
+ // Handlebars.templates is the default template namespace in precompiler.
+ templates: HandlebarsTemplates;
+}
+
+declare module hbs {
+ class SafeString {
+ constructor(str: string);
+ static toString(): string;
+ }
+
+ module Utils {
+ function escapeExpression(str: string): string;
+ }
+}
+
+interface Logger {
+ DEBUG: number;
+ INFO: number;
+ WARN: number;
+ ERROR: number;
+ level: number;
+
+ methodMap: { [level: number]: string };
+
+ log(level: number, obj: string): void;
+}
+
+declare module hbs {
+ module AST {
+ interface IStripInfo {
+ left?: boolean;
+ right?: boolean;
+ inlineStandalone?: boolean;
+ }
+
+ class NodeBase {
+ firstColumn: number;
+ firstLine: number;
+ lastColumn: number;
+ lastLine: number;
+ type: string;
+ }
+
+ class ProgramNode extends NodeBase {
+ statements: NodeBase[];
+ }
+
+ class IdNode extends NodeBase {
+ original: string;
+ parts: string[];
+ string: string;
+ depth: number;
+ idName: string;
+ isSimple: boolean;
+ stringModeValue: string;
+ }
+
+ class HashNode extends NodeBase {
+ pairs: {0: string;
+ 1: NodeBase}[];
+ }
+
+ class SexprNode extends NodeBase {
+ hash: HashNode;
+ id: NodeBase;
+ params: NodeBase[];
+ isHelper: boolean;
+ eligibleHelper: boolean;
+ }
+
+ class MustacheNode extends NodeBase {
+ strip: IStripInfo;
+ escaped: boolean;
+ sexpr: SexprNode;
+
+ }
+
+ class BlockNode extends NodeBase {
+ mustache: MustacheNode;
+ program: ProgramNode;
+ inverse: ProgramNode;
+ strip: IStripInfo;
+ isInverse: boolean;
+ }
+
+ class PartialNameNode extends NodeBase {
+ name: string;
+ }
+
+ class PartialNode extends NodeBase {
+ partialName: PartialNameNode;
+ context: NodeBase;
+ hash: HashNode;
+ strip: IStripInfo;
+ }
+
+ class RawBlockNode extends NodeBase {
+ mustache: MustacheNode;
+ program: ProgramNode;
+ }
+
+ class ContentNode extends NodeBase {
+ original: string;
+ string: string;
+ }
+
+ class DataNode extends NodeBase {
+ id: IdNode;
+ stringModeValue: string;
+ idName: string;
+ }
+
+ class StringNode extends NodeBase {
+ original: string;
+ string: string;
+ stringModeValue: string;
+ }
+
+ class NumberNode extends NodeBase {
+ original: string;
+ number: string;
+ stringModeValue: number;
+ }
+
+ class BooleanNode extends NodeBase {
+ bool: string;
+ stringModeValue: boolean;
+ }
+
+ class CommentNode extends NodeBase {
+ comment: string;
+ strip: IStripInfo;
+ }
+ }
+}
+
+declare module "handlebars" {
+ export = Handlebars;
+}
diff --git a/lib/decl/handlebars/handlebars.d.ts b/lib/decl/handlebars/handlebars.d.ts
new file mode 100644
index 000000000..54dc7e9ae
--- /dev/null
+++ b/lib/decl/handlebars/handlebars.d.ts
@@ -0,0 +1,227 @@
+// Type definitions for Handlebars v3.0.3
+// Project: http://handlebarsjs.com/
+// Definitions by: Boris Yankov <https://github.com/borisyankov/>
+// Definitions: https://github.com/borisyankov/DefinitelyTyped
+
+
+declare module Handlebars {
+ export function registerHelper(name: string, fn: Function, inverse?: boolean): void;
+ export function registerPartial(name: string, str: any): void;
+ export function unregisterHelper(name: string): void;
+ export function unregisterPartial(name: string): void;
+ export function K(): void;
+ export function createFrame(object: any): any;
+ export function Exception(message: string): void;
+ export function log(level: number, obj: any): void;
+ export function parse(input: string): hbs.AST.Program;
+ export function compile(input: any, options?: any): HandlebarsTemplateDelegate;
+
+ export var SafeString: typeof hbs.SafeString;
+ export var Utils: typeof hbs.Utils;
+ export var logger: Logger;
+ export var templates: HandlebarsTemplates;
+ export var helpers: any;
+
+ export module AST {
+ export var helpers: hbs.AST.helpers;
+ }
+
+ interface ICompiler {
+ accept(node: hbs.AST.Node): void;
+ Program(program: hbs.AST.Program): void;
+ BlockStatement(block: hbs.AST.BlockStatement): void;
+ PartialStatement(partial: hbs.AST.PartialStatement): void;
+ MustacheStatement(mustache: hbs.AST.MustacheStatement): void;
+ ContentStatement(content: hbs.AST.ContentStatement): void;
+ CommentStatement(comment?: hbs.AST.CommentStatement): void;
+ SubExpression(sexpr: hbs.AST.SubExpression): void;
+ PathExpression(path: hbs.AST.PathExpression): void;
+ StringLiteral(str: hbs.AST.StringLiteral): void;
+ NumberLiteral(num: hbs.AST.NumberLiteral): void;
+ BooleanLiteral(bool: hbs.AST.BooleanLiteral): void;
+ UndefinedLiteral(): void;
+ NullLiteral(): void;
+ Hash(hash: hbs.AST.Hash): void;
+ }
+
+ export class Visitor implements ICompiler {
+ accept(node: hbs.AST.Node): void;
+ acceptKey(node: hbs.AST.Node, name: string): void;
+ acceptArray(arr: hbs.AST.Expression[]): void;
+ Program(program: hbs.AST.Program): void;
+ BlockStatement(block: hbs.AST.BlockStatement): void;
+ PartialStatement(partial: hbs.AST.PartialStatement): void;
+ MustacheStatement(mustache: hbs.AST.MustacheStatement): void;
+ ContentStatement(content: hbs.AST.ContentStatement): void;
+ CommentStatement(comment?: hbs.AST.CommentStatement): void;
+ SubExpression(sexpr: hbs.AST.SubExpression): void;
+ PathExpression(path: hbs.AST.PathExpression): void;
+ StringLiteral(str: hbs.AST.StringLiteral): void;
+ NumberLiteral(num: hbs.AST.NumberLiteral): void;
+ BooleanLiteral(bool: hbs.AST.BooleanLiteral): void;
+ UndefinedLiteral(): void;
+ NullLiteral(): void;
+ Hash(hash: hbs.AST.Hash): void;
+ }
+}
+
+/**
+* Implement this interface on your MVW/MVVM/MVC views such as Backbone.View
+**/
+interface HandlebarsTemplatable {
+ template: HandlebarsTemplateDelegate;
+}
+
+interface HandlebarsTemplateDelegate {
+ (context: any, options?: any): string;
+}
+
+interface HandlebarsTemplates {
+ [index: string]: HandlebarsTemplateDelegate;
+}
+
+declare module hbs {
+ class SafeString {
+ constructor(str: string);
+ static toString(): string;
+ }
+
+ module Utils {
+ function escapeExpression(str: string): string;
+ }
+}
+
+interface Logger {
+ DEBUG: number;
+ INFO: number;
+ WARN: number;
+ ERROR: number;
+ level: number;
+
+ methodMap: { [level: number]: string };
+
+ log(level: number, obj: string): void;
+}
+
+declare module hbs {
+ module AST {
+ interface Node {
+ type: string;
+ loc: SourceLocation;
+ }
+
+ interface SourceLocation {
+ source: string;
+ start: Position;
+ end: Position;
+ }
+
+ interface Position {
+ line: number;
+ column: number;
+ }
+
+ interface Program extends Node {
+ body: Statement[];
+ blockParams: string[];
+ }
+
+ interface Statement extends Node {}
+
+ interface MustacheStatement extends Statement {
+ path: PathExpression | Literal;
+ params: Expression[];
+ hash: Hash;
+ escaped: boolean;
+ strip: StripFlags;
+ }
+
+ interface BlockStatement extends Statement {
+ path: PathExpression;
+ params: Expression[];
+ hash: Hash;
+ program: Program;
+ inverse: Program;
+ openStrip: StripFlags;
+ inverseStrip: StripFlags;
+ closeStrip: StripFlags;
+ }
+
+ interface PartialStatement extends Statement {
+ name: PathExpression | SubExpression;
+ params: Expression[];
+ hash: Hash;
+ indent: string;
+ strip: StripFlags;
+ }
+
+ interface ContentStatement extends Statement {
+ value: string;
+ original: StripFlags;
+ }
+
+ interface CommentStatement extends Statement {
+ value: string;
+ strip: StripFlags;
+ }
+
+ interface Expression extends Node {}
+
+ interface SubExpression extends Expression {
+ path: PathExpression;
+ params: Expression[];
+ hash: Hash;
+ }
+
+ interface PathExpression extends Expression {
+ data: boolean;
+ depth: number;
+ parts: string[];
+ original: string;
+ }
+
+ interface Literal extends Expression {}
+ interface StringLiteral extends Literal {
+ value: string;
+ original: string;
+ }
+
+ interface BooleanLiteral extends Literal {
+ value: boolean;
+ original: boolean;
+ }
+
+ interface NumberLiteral extends Literal {
+ value: number;
+ original: number;
+ }
+
+ interface UndefinedLiteral extends Literal {}
+
+ interface NullLiteral extends Literal {}
+
+ interface Hash extends Node {
+ pairs: HashPair[];
+ }
+
+ interface HashPair extends Node {
+ key: string;
+ value: Expression;
+ }
+
+ interface StripFlags {
+ open: boolean;
+ close: boolean;
+ }
+
+ interface helpers {
+ helperExpression(node: Node): boolean;
+ scopeId(path: PathExpression): boolean;
+ simpleId(path: PathExpression): boolean;
+ }
+ }
+}
+
+declare module "handlebars" {
+ export = Handlebars;
+}
diff --git a/lib/decl/jquery/jquery.d.ts b/lib/decl/jquery/jquery.d.ts
new file mode 100644
index 000000000..8401753e3
--- /dev/null
+++ b/lib/decl/jquery/jquery.d.ts
@@ -0,0 +1,3190 @@
+// Type definitions for jQuery 1.10.x / 2.0.x
+// Project: http://jquery.com/
+// Definitions by: Boris Yankov <https://github.com/borisyankov/>, Christian Hoffmeister <https://github.com/choffmeister>, Steve Fenton <https://github.com/Steve-Fenton>, Diullei Gomes <https://github.com/Diullei>, Tass Iliopoulos <https://github.com/tasoili>, Jason Swearingen <https://github.com/jasons-novaleaf>, Sean Hill <https://github.com/seanski>, Guus Goossens <https://github.com/Guuz>, Kelly Summerlin <https://github.com/ksummerlin>, Basarat Ali Syed <https://github.com/basarat>, Nicholas Wolverson <https://github.com/nwolverson>, Derek Cicerone <https://github.com/derekcicerone>, Andrew Gaspar <https://github.com/AndrewGaspar>, James Harrison Fisher <https://github.com/jameshfisher>, Seikichi Kondo <https://github.com/seikichi>, Benjamin Jackman <https://github.com/benjaminjackman>, Poul Sorensen <https://github.com/s093294>, Josh Strobl <https://github.com/JoshStrobl>, John Reilly <https://github.com/johnnyreilly/>, Dick van den Brink <https://github.com/DickvdBrink>
+// Definitions: https://github.com/borisyankov/DefinitelyTyped
+
+/* *****************************************************************************
+Copyright (c) Microsoft Corporation. All rights reserved.
+Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+this file except in compliance with the License. You may obtain a copy of the
+License at http://www.apache.org/licenses/LICENSE-2.0
+
+THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
+WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
+MERCHANTABLITY OR NON-INFRINGEMENT.
+
+See the Apache Version 2.0 License for specific language governing permissions
+and limitations under the License.
+***************************************************************************** */
+
+
+/**
+ * Interface for the AJAX setting that will configure the AJAX request
+ */
+interface JQueryAjaxSettings {
+ /**
+ * The content type sent in the request header that tells the server what kind of response it will accept in return. If the accepts setting needs modification, it is recommended to do so once in the $.ajaxSetup() method.
+ */
+ accepts?: any;
+ /**
+ * By default, all requests are sent asynchronously (i.e. this is set to true by default). If you need synchronous requests, set this option to false. Cross-domain requests and dataType: "jsonp" requests do not support synchronous operation. Note that synchronous requests may temporarily lock the browser, disabling any actions while the request is active. As of jQuery 1.8, the use of async: false with jqXHR ($.Deferred) is deprecated; you must use the success/error/complete callback options instead of the corresponding methods of the jqXHR object such as jqXHR.done() or the deprecated jqXHR.success().
+ */
+ async?: boolean;
+ /**
+ * A pre-request callback function that can be used to modify the jqXHR (in jQuery 1.4.x, XMLHTTPRequest) object before it is sent. Use this to set custom headers, etc. The jqXHR and settings objects are passed as arguments. This is an Ajax Event. Returning false in the beforeSend function will cancel the request. As of jQuery 1.5, the beforeSend option will be called regardless of the type of request.
+ */
+ beforeSend? (jqXHR: JQueryXHR, settings: JQueryAjaxSettings): any;
+ /**
+ * If set to false, it will force requested pages not to be cached by the browser. Note: Setting cache to false will only work correctly with HEAD and GET requests. It works by appending "_={timestamp}" to the GET parameters. The parameter is not needed for other types of requests, except in IE8 when a POST is made to a URL that has already been requested by a GET.
+ */
+ cache?: boolean;
+ /**
+ * A function to be called when the request finishes (after success and error callbacks are executed). The function gets passed two arguments: The jqXHR (in jQuery 1.4.x, XMLHTTPRequest) object and a string categorizing the status of the request ("success", "notmodified", "error", "timeout", "abort", or "parsererror"). As of jQuery 1.5, the complete setting can accept an array of functions. Each function will be called in turn. This is an Ajax Event.
+ */
+ complete? (jqXHR: JQueryXHR, textStatus: string): any;
+ /**
+ * An object of string/regular-expression pairs that determine how jQuery will parse the response, given its content type. (version added: 1.5)
+ */
+ contents?: { [key: string]: any; };
+ //According to jQuery.ajax source code, ajax's option actually allows contentType to set to "false"
+ // https://github.com/borisyankov/DefinitelyTyped/issues/742
+ /**
+ * When sending data to the server, use this content type. Default is "application/x-www-form-urlencoded; charset=UTF-8", which is fine for most cases. If you explicitly pass in a content-type to $.ajax(), then it is always sent to the server (even if no data is sent). The W3C XMLHttpRequest specification dictates that the charset is always UTF-8; specifying another charset will not force the browser to change the encoding.
+ */
+ contentType?: any;
+ /**
+ * This object will be made the context of all Ajax-related callbacks. By default, the context is an object that represents the ajax settings used in the call ($.ajaxSettings merged with the settings passed to $.ajax).
+ */
+ context?: any;
+ /**
+ * An object containing dataType-to-dataType converters. Each converter's value is a function that returns the transformed value of the response. (version added: 1.5)
+ */
+ converters?: { [key: string]: any; };
+ /**
+ * If you wish to force a crossDomain request (such as JSONP) on the same domain, set the value of crossDomain to true. This allows, for example, server-side redirection to another domain. (version added: 1.5)
+ */
+ crossDomain?: boolean;
+ /**
+ * Data to be sent to the server. It is converted to a query string, if not already a string. It's appended to the url for GET-requests. See processData option to prevent this automatic processing. Object must be Key/Value pairs. If value is an Array, jQuery serializes multiple values with same key based on the value of the traditional setting (described below).
+ */
+ data?: any;
+ /**
+ * A function to be used to handle the raw response data of XMLHttpRequest.This is a pre-filtering function to sanitize the response. You should return the sanitized data. The function accepts two arguments: The raw data returned from the server and the 'dataType' parameter.
+ */
+ dataFilter? (data: any, ty: any): any;
+ /**
+ * The type of data that you're expecting back from the server. If none is specified, jQuery will try to infer it based on the MIME type of the response (an XML MIME type will yield XML, in 1.4 JSON will yield a JavaScript object, in 1.4 script will execute the script, and anything else will be returned as a string).
+ */
+ dataType?: string;
+ /**
+ * A function to be called if the request fails. The function receives three arguments: The jqXHR (in jQuery 1.4.x, XMLHttpRequest) object, a string describing the type of error that occurred and an optional exception object, if one occurred. Possible values for the second argument (besides null) are "timeout", "error", "abort", and "parsererror". When an HTTP error occurs, errorThrown receives the textual portion of the HTTP status, such as "Not Found" or "Internal Server Error." As of jQuery 1.5, the error setting can accept an array of functions. Each function will be called in turn. Note: This handler is not called for cross-domain script and cross-domain JSONP requests. This is an Ajax Event.
+ */
+ error? (jqXHR: JQueryXHR, textStatus: string, errorThrown: string): any;
+ /**
+ * Whether to trigger global Ajax event handlers for this request. The default is true. Set to false to prevent the global handlers like ajaxStart or ajaxStop from being triggered. This can be used to control various Ajax Events.
+ */
+ global?: boolean;
+ /**
+ * An object of additional header key/value pairs to send along with requests using the XMLHttpRequest transport. The header X-Requested-With: XMLHttpRequest is always added, but its default XMLHttpRequest value can be changed here. Values in the headers setting can also be overwritten from within the beforeSend function. (version added: 1.5)
+ */
+ headers?: { [key: string]: any; };
+ /**
+ * Allow the request to be successful only if the response has changed since the last request. This is done by checking the Last-Modified header. Default value is false, ignoring the header. In jQuery 1.4 this technique also checks the 'etag' specified by the server to catch unmodified data.
+ */
+ ifModified?: boolean;
+ /**
+ * Allow the current environment to be recognized as "local," (e.g. the filesystem), even if jQuery does not recognize it as such by default. The following protocols are currently recognized as local: file, *-extension, and widget. If the isLocal setting needs modification, it is recommended to do so once in the $.ajaxSetup() method. (version added: 1.5.1)
+ */
+ isLocal?: boolean;
+ /**
+ * Override the callback function name in a jsonp request. This value will be used instead of 'callback' in the 'callback=?' part of the query string in the url. So {jsonp:'onJSONPLoad'} would result in 'onJSONPLoad=?' passed to the server. As of jQuery 1.5, setting the jsonp option to false prevents jQuery from adding the "?callback" string to the URL or attempting to use "=?" for transformation. In this case, you should also explicitly set the jsonpCallback setting. For example, { jsonp: false, jsonpCallback: "callbackName" }
+ */
+ jsonp?: any;
+ /**
+ * Specify the callback function name for a JSONP request. This value will be used instead of the random name automatically generated by jQuery. It is preferable to let jQuery generate a unique name as it'll make it easier to manage the requests and provide callbacks and error handling. You may want to specify the callback when you want to enable better browser caching of GET requests. As of jQuery 1.5, you can also use a function for this setting, in which case the value of jsonpCallback is set to the return value of that function.
+ */
+ jsonpCallback?: any;
+ /**
+ * The HTTP method to use for the request (e.g. "POST", "GET", "PUT"). (version added: 1.9.0)
+ */
+ method?: string;
+ /**
+ * A mime type to override the XHR mime type. (version added: 1.5.1)
+ */
+ mimeType?: string;
+ /**
+ * A password to be used with XMLHttpRequest in response to an HTTP access authentication request.
+ */
+ password?: string;
+ /**
+ * By default, data passed in to the data option as an object (technically, anything other than a string) will be processed and transformed into a query string, fitting to the default content-type "application/x-www-form-urlencoded". If you want to send a DOMDocument, or other non-processed data, set this option to false.
+ */
+ processData?: boolean;
+ /**
+ * Only applies when the "script" transport is used (e.g., cross-domain requests with "jsonp" or "script" dataType and "GET" type). Sets the charset attribute on the script tag used in the request. Used when the character set on the local page is not the same as the one on the remote script.
+ */
+ scriptCharset?: string;
+ /**
+ * An object of numeric HTTP codes and functions to be called when the response has the corresponding code. f the request is successful, the status code functions take the same parameters as the success callback; if it results in an error (including 3xx redirect), they take the same parameters as the error callback. (version added: 1.5)
+ */
+ statusCode?: { [key: string]: any; };
+ /**
+ * A function to be called if the request succeeds. The function gets passed three arguments: The data returned from the server, formatted according to the dataType parameter; a string describing the status; and the jqXHR (in jQuery 1.4.x, XMLHttpRequest) object. As of jQuery 1.5, the success setting can accept an array of functions. Each function will be called in turn. This is an Ajax Event.
+ */
+ success? (data: any, textStatus: string, jqXHR: JQueryXHR): any;
+ /**
+ * Set a timeout (in milliseconds) for the request. This will override any global timeout set with $.ajaxSetup(). The timeout period starts at the point the $.ajax call is made; if several other requests are in progress and the browser has no connections available, it is possible for a request to time out before it can be sent. In jQuery 1.4.x and below, the XMLHttpRequest object will be in an invalid state if the request times out; accessing any object members may throw an exception. In Firefox 3.0+ only, script and JSONP requests cannot be cancelled by a timeout; the script will run even if it arrives after the timeout period.
+ */
+ timeout?: number;
+ /**
+ * Set this to true if you wish to use the traditional style of param serialization.
+ */
+ traditional?: boolean;
+ /**
+ * The type of request to make ("POST" or "GET"), default is "GET". Note: Other HTTP request methods, such as PUT and DELETE, can also be used here, but they are not supported by all browsers.
+ */
+ type?: string;
+ /**
+ * A string containing the URL to which the request is sent.
+ */
+ url?: string;
+ /**
+ * A username to be used with XMLHttpRequest in response to an HTTP access authentication request.
+ */
+ username?: string;
+ /**
+ * Callback for creating the XMLHttpRequest object. Defaults to the ActiveXObject when available (IE), the XMLHttpRequest otherwise. Override to provide your own implementation for XMLHttpRequest or enhancements to the factory.
+ */
+ xhr?: any;
+ /**
+ * An object of fieldName-fieldValue pairs to set on the native XHR object. For example, you can use it to set withCredentials to true for cross-domain requests if needed. In jQuery 1.5, the withCredentials property was not propagated to the native XHR and thus CORS requests requiring it would ignore this flag. For this reason, we recommend using jQuery 1.5.1+ should you require the use of it. (version added: 1.5.1)
+ */
+ xhrFields?: { [key: string]: any; };
+}
+
+/**
+ * Interface for the jqXHR object
+ */
+interface JQueryXHR extends XMLHttpRequest, JQueryPromise<any> {
+ /**
+ * The .overrideMimeType() method may be used in the beforeSend() callback function, for example, to modify the response content-type header. As of jQuery 1.5.1, the jqXHR object also contains the overrideMimeType() method (it was available in jQuery 1.4.x, as well, but was temporarily removed in jQuery 1.5).
+ */
+ overrideMimeType(mimeType: string): any;
+ /**
+ * Cancel the request.
+ *
+ * @param statusText A string passed as the textStatus parameter for the done callback. Default value: "canceled"
+ */
+ abort(statusText?: string): void;
+ /**
+ * Incorporates the functionality of the .done() and .fail() methods, allowing (as of jQuery 1.8) the underlying Promise to be manipulated. Refer to deferred.then() for implementation details.
+ */
+ then(doneCallback: (data: any, textStatus: string, jqXHR: JQueryXHR) => void, failCallback?: (jqXHR: JQueryXHR, textStatus: string, errorThrown: any) => void): JQueryPromise<any>;
+ /**
+ * Property containing the parsed response if the response Content-Type is json
+ */
+ responseJSON?: any;
+ /**
+ * A function to be called if the request fails.
+ */
+ error(xhr: JQueryXHR, textStatus: string, errorThrown: string): void;
+}
+
+/**
+ * Interface for the JQuery callback
+ */
+interface JQueryCallback {
+ /**
+ * Add a callback or a collection of callbacks to a callback list.
+ *
+ * @param callbacks A function, or array of functions, that are to be added to the callback list.
+ */
+ add(callbacks: Function): JQueryCallback;
+ /**
+ * Add a callback or a collection of callbacks to a callback list.
+ *
+ * @param callbacks A function, or array of functions, that are to be added to the callback list.
+ */
+ add(callbacks: Function[]): JQueryCallback;
+
+ /**
+ * Disable a callback list from doing anything more.
+ */
+ disable(): JQueryCallback;
+
+ /**
+ * Determine if the callbacks list has been disabled.
+ */
+ disabled(): boolean;
+
+ /**
+ * Remove all of the callbacks from a list.
+ */
+ empty(): JQueryCallback;
+
+ /**
+ * Call all of the callbacks with the given arguments
+ *
+ * @param arguments The argument or list of arguments to pass back to the callback list.
+ */
+ fire(...arguments: any[]): JQueryCallback;
+
+ /**
+ * Determine if the callbacks have already been called at least once.
+ */
+ fired(): boolean;
+
+ /**
+ * Call all callbacks in a list with the given context and arguments.
+ *
+ * @param context A reference to the context in which the callbacks in the list should be fired.
+ * @param arguments An argument, or array of arguments, to pass to the callbacks in the list.
+ */
+ fireWith(context?: any, args?: any[]): JQueryCallback;
+
+ /**
+ * Determine whether a supplied callback is in a list
+ *
+ * @param callback The callback to search for.
+ */
+ has(callback: Function): boolean;
+
+ /**
+ * Lock a callback list in its current state.
+ */
+ lock(): JQueryCallback;
+
+ /**
+ * Determine if the callbacks list has been locked.
+ */
+ locked(): boolean;
+
+ /**
+ * Remove a callback or a collection of callbacks from a callback list.
+ *
+ * @param callbacks A function, or array of functions, that are to be removed from the callback list.
+ */
+ remove(callbacks: Function): JQueryCallback;
+ /**
+ * Remove a callback or a collection of callbacks from a callback list.
+ *
+ * @param callbacks A function, or array of functions, that are to be removed from the callback list.
+ */
+ remove(callbacks: Function[]): JQueryCallback;
+}
+
+/**
+ * Allows jQuery Promises to interop with non-jQuery promises
+ */
+interface JQueryGenericPromise<T> {
+ /**
+ * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress.
+ *
+ * @param doneFilter A function that is called when the Deferred is resolved.
+ * @param failFilter An optional function that is called when the Deferred is rejected.
+ */
+ then<U>(doneFilter: (value?: T, ...values: any[]) => U|JQueryPromise<U>, failFilter?: (...reasons: any[]) => any, progressFilter?: (...progression: any[]) => any): JQueryPromise<U>;
+
+ /**
+ * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress.
+ *
+ * @param doneFilter A function that is called when the Deferred is resolved.
+ * @param failFilter An optional function that is called when the Deferred is rejected.
+ */
+ then(doneFilter: (value?: T, ...values: any[]) => void, failFilter?: (...reasons: any[]) => any, progressFilter?: (...progression: any[]) => any): JQueryPromise<void>;
+}
+
+/**
+ * Interface for the JQuery promise/deferred callbacks
+ */
+interface JQueryPromiseCallback<T> {
+ (value?: T, ...args: any[]): void;
+}
+
+interface JQueryPromiseOperator<T, U> {
+ (callback1: JQueryPromiseCallback<T>|JQueryPromiseCallback<T>[], ...callbacksN: Array<JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[]>): JQueryPromise<U>;
+}
+
+/**
+ * Interface for the JQuery promise, part of callbacks
+ */
+interface JQueryPromise<T> extends JQueryGenericPromise<T> {
+ /**
+ * Determine the current state of a Deferred object.
+ */
+ state(): string;
+ /**
+ * Add handlers to be called when the Deferred object is either resolved or rejected.
+ *
+ * @param alwaysCallbacks1 A function, or array of functions, that is called when the Deferred is resolved or rejected.
+ * @param alwaysCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is resolved or rejected.
+ */
+ always(alwaysCallback1?: JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[], ...alwaysCallbacksN: Array<JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[]>): JQueryPromise<T>;
+ /**
+ * Add handlers to be called when the Deferred object is resolved.
+ *
+ * @param doneCallbacks1 A function, or array of functions, that are called when the Deferred is resolved.
+ * @param doneCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is resolved.
+ */
+ done(doneCallback1?: JQueryPromiseCallback<T>|JQueryPromiseCallback<T>[], ...doneCallbackN: Array<JQueryPromiseCallback<T>|JQueryPromiseCallback<T>[]>): JQueryPromise<T>;
+ /**
+ * Add handlers to be called when the Deferred object is rejected.
+ *
+ * @param failCallbacks1 A function, or array of functions, that are called when the Deferred is rejected.
+ * @param failCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is rejected.
+ */
+ fail(failCallback1?: JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[], ...failCallbacksN: Array<JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[]>): JQueryPromise<T>;
+ /**
+ * Add handlers to be called when the Deferred object generates progress notifications.
+ *
+ * @param progressCallbacks A function, or array of functions, to be called when the Deferred generates progress notifications.
+ */
+ progress(progressCallback1?: JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[], ...progressCallbackN: Array<JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[]>): JQueryPromise<T>;
+
+ // Deprecated - given no typings
+ pipe(doneFilter?: (x: any) => any, failFilter?: (x: any) => any, progressFilter?: (x: any) => any): JQueryPromise<any>;
+}
+
+/**
+ * Interface for the JQuery deferred, part of callbacks
+ */
+interface JQueryDeferred<T> extends JQueryGenericPromise<T> {
+ /**
+ * Determine the current state of a Deferred object.
+ */
+ state(): string;
+ /**
+ * Add handlers to be called when the Deferred object is either resolved or rejected.
+ *
+ * @param alwaysCallbacks1 A function, or array of functions, that is called when the Deferred is resolved or rejected.
+ * @param alwaysCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is resolved or rejected.
+ */
+ always(alwaysCallback1?: JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[], ...alwaysCallbacksN: Array<JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[]>): JQueryDeferred<T>;
+ /**
+ * Add handlers to be called when the Deferred object is resolved.
+ *
+ * @param doneCallbacks1 A function, or array of functions, that are called when the Deferred is resolved.
+ * @param doneCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is resolved.
+ */
+ done(doneCallback1?: JQueryPromiseCallback<T>|JQueryPromiseCallback<T>[], ...doneCallbackN: Array<JQueryPromiseCallback<T>|JQueryPromiseCallback<T>[]>): JQueryDeferred<T>;
+ /**
+ * Add handlers to be called when the Deferred object is rejected.
+ *
+ * @param failCallbacks1 A function, or array of functions, that are called when the Deferred is rejected.
+ * @param failCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is rejected.
+ */
+ fail(failCallback1?: JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[], ...failCallbacksN: Array<JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[]>): JQueryDeferred<T>;
+ /**
+ * Add handlers to be called when the Deferred object generates progress notifications.
+ *
+ * @param progressCallbacks A function, or array of functions, to be called when the Deferred generates progress notifications.
+ */
+ progress(progressCallback1?: JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[], ...progressCallbackN: Array<JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[]>): JQueryDeferred<T>;
+
+ /**
+ * Call the progressCallbacks on a Deferred object with the given args.
+ *
+ * @param args Optional arguments that are passed to the progressCallbacks.
+ */
+ notify(value?: any, ...args: any[]): JQueryDeferred<T>;
+
+ /**
+ * Call the progressCallbacks on a Deferred object with the given context and args.
+ *
+ * @param context Context passed to the progressCallbacks as the this object.
+ * @param args Optional arguments that are passed to the progressCallbacks.
+ */
+ notifyWith(context: any, value?: any[]): JQueryDeferred<T>;
+
+ /**
+ * Reject a Deferred object and call any failCallbacks with the given args.
+ *
+ * @param args Optional arguments that are passed to the failCallbacks.
+ */
+ reject(value?: any, ...args: any[]): JQueryDeferred<T>;
+ /**
+ * Reject a Deferred object and call any failCallbacks with the given context and args.
+ *
+ * @param context Context passed to the failCallbacks as the this object.
+ * @param args An optional array of arguments that are passed to the failCallbacks.
+ */
+ rejectWith(context: any, value?: any[]): JQueryDeferred<T>;
+
+ /**
+ * Resolve a Deferred object and call any doneCallbacks with the given args.
+ *
+ * @param value First argument passed to doneCallbacks.
+ * @param args Optional subsequent arguments that are passed to the doneCallbacks.
+ */
+ resolve(value?: T, ...args: any[]): JQueryDeferred<T>;
+
+ /**
+ * Resolve a Deferred object and call any doneCallbacks with the given context and args.
+ *
+ * @param context Context passed to the doneCallbacks as the this object.
+ * @param args An optional array of arguments that are passed to the doneCallbacks.
+ */
+ resolveWith(context: any, value?: T[]): JQueryDeferred<T>;
+
+ /**
+ * Return a Deferred's Promise object.
+ *
+ * @param target Object onto which the promise methods have to be attached
+ */
+ promise(target?: any): JQueryPromise<T>;
+
+ // Deprecated - given no typings
+ pipe(doneFilter?: (x: any) => any, failFilter?: (x: any) => any, progressFilter?: (x: any) => any): JQueryPromise<any>;
+}
+
+/**
+ * Interface of the JQuery extension of the W3C event object
+ */
+interface BaseJQueryEventObject extends Event {
+ data: any;
+ delegateTarget: Element;
+ isDefaultPrevented(): boolean;
+ isImmediatePropagationStopped(): boolean;
+ isPropagationStopped(): boolean;
+ namespace: string;
+ originalEvent: Event;
+ preventDefault(): any;
+ relatedTarget: Element;
+ result: any;
+ stopImmediatePropagation(): void;
+ stopPropagation(): void;
+ target: Element;
+ pageX: number;
+ pageY: number;
+ which: number;
+ metaKey: boolean;
+}
+
+interface JQueryInputEventObject extends BaseJQueryEventObject {
+ altKey: boolean;
+ ctrlKey: boolean;
+ metaKey: boolean;
+ shiftKey: boolean;
+}
+
+interface JQueryMouseEventObject extends JQueryInputEventObject {
+ button: number;
+ clientX: number;
+ clientY: number;
+ offsetX: number;
+ offsetY: number;
+ pageX: number;
+ pageY: number;
+ screenX: number;
+ screenY: number;
+}
+
+interface JQueryKeyEventObject extends JQueryInputEventObject {
+ char: any;
+ charCode: number;
+ key: any;
+ keyCode: number;
+}
+
+interface JQueryEventObject extends BaseJQueryEventObject, JQueryInputEventObject, JQueryMouseEventObject, JQueryKeyEventObject{
+}
+
+/*
+ Collection of properties of the current browser
+*/
+
+interface JQuerySupport {
+ ajax?: boolean;
+ boxModel?: boolean;
+ changeBubbles?: boolean;
+ checkClone?: boolean;
+ checkOn?: boolean;
+ cors?: boolean;
+ cssFloat?: boolean;
+ hrefNormalized?: boolean;
+ htmlSerialize?: boolean;
+ leadingWhitespace?: boolean;
+ noCloneChecked?: boolean;
+ noCloneEvent?: boolean;
+ opacity?: boolean;
+ optDisabled?: boolean;
+ optSelected?: boolean;
+ scriptEval? (): boolean;
+ style?: boolean;
+ submitBubbles?: boolean;
+ tbody?: boolean;
+}
+
+interface JQueryParam {
+ /**
+ * Create a serialized representation of an array or object, suitable for use in a URL query string or Ajax request.
+ *
+ * @param obj An array or object to serialize.
+ */
+ (obj: any): string;
+
+ /**
+ * Create a serialized representation of an array or object, suitable for use in a URL query string or Ajax request.
+ *
+ * @param obj An array or object to serialize.
+ * @param traditional A Boolean indicating whether to perform a traditional "shallow" serialization.
+ */
+ (obj: any, traditional: boolean): string;
+}
+
+/**
+ * The interface used to construct jQuery events (with $.Event). It is
+ * defined separately instead of inline in JQueryStatic to allow
+ * overriding the construction function with specific strings
+ * returning specific event objects.
+ */
+interface JQueryEventConstructor {
+ (name: string, eventProperties?: any): JQueryEventObject;
+ new (name: string, eventProperties?: any): JQueryEventObject;
+}
+
+/**
+ * The interface used to specify coordinates.
+ */
+interface JQueryCoordinates {
+ left: number;
+ top: number;
+}
+
+/**
+ * Elements in the array returned by serializeArray()
+ */
+interface JQuerySerializeArrayElement {
+ name: string;
+ value: string;
+}
+
+interface JQueryAnimationOptions {
+ /**
+ * A string or number determining how long the animation will run.
+ */
+ duration?: any;
+ /**
+ * A string indicating which easing function to use for the transition.
+ */
+ easing?: string;
+ /**
+ * A function to call once the animation is complete.
+ */
+ complete?: Function;
+ /**
+ * A function to be called for each animated property of each animated element. This function provides an opportunity to modify the Tween object to change the value of the property before it is set.
+ */
+ step?: (now: number, tween: any) => any;
+ /**
+ * A function to be called after each step of the animation, only once per animated element regardless of the number of animated properties. (version added: 1.8)
+ */
+ progress?: (animation: JQueryPromise<any>, progress: number, remainingMs: number) => any;
+ /**
+ * A function to call when the animation begins. (version added: 1.8)
+ */
+ start?: (animation: JQueryPromise<any>) => any;
+ /**
+ * A function to be called when the animation completes (its Promise object is resolved). (version added: 1.8)
+ */
+ done?: (animation: JQueryPromise<any>, jumpedToEnd: boolean) => any;
+ /**
+ * A function to be called when the animation fails to complete (its Promise object is rejected). (version added: 1.8)
+ */
+ fail?: (animation: JQueryPromise<any>, jumpedToEnd: boolean) => any;
+ /**
+ * A function to be called when the animation completes or stops without completing (its Promise object is either resolved or rejected). (version added: 1.8)
+ */
+ always?: (animation: JQueryPromise<any>, jumpedToEnd: boolean) => any;
+ /**
+ * A Boolean indicating whether to place the animation in the effects queue. If false, the animation will begin immediately. As of jQuery 1.7, the queue option can also accept a string, in which case the animation is added to the queue represented by that string. When a custom queue name is used the animation does not automatically start; you must call .dequeue("queuename") to start it.
+ */
+ queue?: any;
+ /**
+ * A map of one or more of the CSS properties defined by the properties argument and their corresponding easing functions. (version added: 1.4)
+ */
+ specialEasing?: Object;
+}
+
+/**
+ * Static members of jQuery (those on $ and jQuery themselves)
+ */
+interface JQueryStatic {
+
+ /**
+ * Perform an asynchronous HTTP (Ajax) request.
+ *
+ * @param settings A set of key/value pairs that configure the Ajax request. All settings are optional. A default can be set for any option with $.ajaxSetup().
+ */
+ ajax(settings: JQueryAjaxSettings): JQueryXHR;
+ /**
+ * Perform an asynchronous HTTP (Ajax) request.
+ *
+ * @param url A string containing the URL to which the request is sent.
+ * @param settings A set of key/value pairs that configure the Ajax request. All settings are optional. A default can be set for any option with $.ajaxSetup().
+ */
+ ajax(url: string, settings?: JQueryAjaxSettings): JQueryXHR;
+
+ /**
+ * Handle custom Ajax options or modify existing options before each request is sent and before they are processed by $.ajax().
+ *
+ * @param dataTypes An optional string containing one or more space-separated dataTypes
+ * @param handler A handler to set default values for future Ajax requests.
+ */
+ ajaxPrefilter(dataTypes: string, handler: (opts: any, originalOpts: JQueryAjaxSettings, jqXHR: JQueryXHR) => any): void;
+ /**
+ * Handle custom Ajax options or modify existing options before each request is sent and before they are processed by $.ajax().
+ *
+ * @param handler A handler to set default values for future Ajax requests.
+ */
+ ajaxPrefilter(handler: (opts: any, originalOpts: JQueryAjaxSettings, jqXHR: JQueryXHR) => any): void;
+
+ ajaxSettings: JQueryAjaxSettings;
+
+ /**
+ * Set default values for future Ajax requests. Its use is not recommended.
+ *
+ * @param options A set of key/value pairs that configure the default Ajax request. All options are optional.
+ */
+ ajaxSetup(options: JQueryAjaxSettings): void;
+
+ /**
+ * Load data from the server using a HTTP GET request.
+ *
+ * @param url A string containing the URL to which the request is sent.
+ * @param success A callback function that is executed if the request succeeds.
+ * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, or html).
+ */
+ get(url: string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any, dataType?: string): JQueryXHR;
+ /**
+ * Load data from the server using a HTTP GET request.
+ *
+ * @param url A string containing the URL to which the request is sent.
+ * @param data A plain object or string that is sent to the server with the request.
+ * @param success A callback function that is executed if the request succeeds.
+ * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, or html).
+ */
+ get(url: string, data?: Object|string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any, dataType?: string): JQueryXHR;
+ /**
+ * Load JSON-encoded data from the server using a GET HTTP request.
+ *
+ * @param url A string containing the URL to which the request is sent.
+ * @param success A callback function that is executed if the request succeeds.
+ */
+ getJSON(url: string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any): JQueryXHR;
+ /**
+ * Load JSON-encoded data from the server using a GET HTTP request.
+ *
+ * @param url A string containing the URL to which the request is sent.
+ * @param data A plain object or string that is sent to the server with the request.
+ * @param success A callback function that is executed if the request succeeds.
+ */
+ getJSON(url: string, data?: Object|string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any): JQueryXHR;
+ /**
+ * Load a JavaScript file from the server using a GET HTTP request, then execute it.
+ *
+ * @param url A string containing the URL to which the request is sent.
+ * @param success A callback function that is executed if the request succeeds.
+ */
+ getScript(url: string, success?: (script: string, textStatus: string, jqXHR: JQueryXHR) => any): JQueryXHR;
+
+ /**
+ * Create a serialized representation of an array or object, suitable for use in a URL query string or Ajax request.
+ */
+ param: JQueryParam;
+
+ /**
+ * Load data from the server using a HTTP POST request.
+ *
+ * @param url A string containing the URL to which the request is sent.
+ * @param success A callback function that is executed if the request succeeds. Required if dataType is provided, but can be null in that case.
+ * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, text, html).
+ */
+ post(url: string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any, dataType?: string): JQueryXHR;
+ /**
+ * Load data from the server using a HTTP POST request.
+ *
+ * @param url A string containing the URL to which the request is sent.
+ * @param data A plain object or string that is sent to the server with the request.
+ * @param success A callback function that is executed if the request succeeds. Required if dataType is provided, but can be null in that case.
+ * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, text, html).
+ */
+ post(url: string, data?: Object|string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any, dataType?: string): JQueryXHR;
+
+ /**
+ * A multi-purpose callbacks list object that provides a powerful way to manage callback lists.
+ *
+ * @param flags An optional list of space-separated flags that change how the callback list behaves.
+ */
+ Callbacks(flags?: string): JQueryCallback;
+
+ /**
+ * Holds or releases the execution of jQuery's ready event.
+ *
+ * @param hold Indicates whether the ready hold is being requested or released
+ */
+ holdReady(hold: boolean): void;
+
+ /**
+ * Accepts a string containing a CSS selector which is then used to match a set of elements.
+ *
+ * @param selector A string containing a selector expression
+ * @param context A DOM Element, Document, or jQuery to use as context
+ */
+ (selector: string, context?: Element|JQuery): JQuery;
+
+ /**
+ * Accepts a string containing a CSS selector which is then used to match a set of elements.
+ *
+ * @param element A DOM element to wrap in a jQuery object.
+ */
+ (element: Element): JQuery;
+
+ /**
+ * Accepts a string containing a CSS selector which is then used to match a set of elements.
+ *
+ * @param elementArray An array containing a set of DOM elements to wrap in a jQuery object.
+ */
+ (elementArray: Element[]): JQuery;
+
+ /**
+ * Binds a function to be executed when the DOM has finished loading.
+ *
+ * @param callback A function to execute after the DOM is ready.
+ */
+ (callback: (jQueryAlias?: JQueryStatic) => any): JQuery;
+
+ /**
+ * Accepts a string containing a CSS selector which is then used to match a set of elements.
+ *
+ * @param object A plain object to wrap in a jQuery object.
+ */
+ (object: {}): JQuery;
+
+ /**
+ * Accepts a string containing a CSS selector which is then used to match a set of elements.
+ *
+ * @param object An existing jQuery object to clone.
+ */
+ (object: JQuery): JQuery;
+
+ /**
+ * Specify a function to execute when the DOM is fully loaded.
+ */
+ (): JQuery;
+
+ /**
+ * Creates DOM elements on the fly from the provided string of raw HTML.
+ *
+ * @param html A string of HTML to create on the fly. Note that this parses HTML, not XML.
+ * @param ownerDocument A document in which the new elements will be created.
+ */
+ (html: string, ownerDocument?: Document): JQuery;
+
+ /**
+ * Creates DOM elements on the fly from the provided string of raw HTML.
+ *
+ * @param html A string defining a single, standalone, HTML element (e.g. <div/> or <div></div>).
+ * @param attributes An object of attributes, events, and methods to call on the newly-created element.
+ */
+ (html: string, attributes: Object): JQuery;
+
+ /**
+ * Relinquish jQuery's control of the $ variable.
+ *
+ * @param removeAll A Boolean indicating whether to remove all jQuery variables from the global scope (including jQuery itself).
+ */
+ noConflict(removeAll?: boolean): Object;
+
+ /**
+ * Provides a way to execute callback functions based on one or more objects, usually Deferred objects that represent asynchronous events.
+ *
+ * @param deferreds One or more Deferred objects, or plain JavaScript objects.
+ */
+ when<T>(...deferreds: Array<T|JQueryPromise<T>/* as JQueryDeferred<T> */>): JQueryPromise<T>;
+
+ /**
+ * Hook directly into jQuery to override how particular CSS properties are retrieved or set, normalize CSS property naming, or create custom properties.
+ */
+ cssHooks: { [key: string]: any; };
+ cssNumber: any;
+
+ /**
+ * Store arbitrary data associated with the specified element. Returns the value that was set.
+ *
+ * @param element The DOM element to associate with the data.
+ * @param key A string naming the piece of data to set.
+ * @param value The new data value.
+ */
+ data<T>(element: Element, key: string, value: T): T;
+ /**
+ * Returns value at named data store for the element, as set by jQuery.data(element, name, value), or the full data store for the element.
+ *
+ * @param element The DOM element to associate with the data.
+ * @param key A string naming the piece of data to set.
+ */
+ data(element: Element, key: string): any;
+ /**
+ * Returns value at named data store for the element, as set by jQuery.data(element, name, value), or the full data store for the element.
+ *
+ * @param element The DOM element to associate with the data.
+ */
+ data(element: Element): any;
+
+ /**
+ * Execute the next function on the queue for the matched element.
+ *
+ * @param element A DOM element from which to remove and execute a queued function.
+ * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue.
+ */
+ dequeue(element: Element, queueName?: string): void;
+
+ /**
+ * Determine whether an element has any jQuery data associated with it.
+ *
+ * @param element A DOM element to be checked for data.
+ */
+ hasData(element: Element): boolean;
+
+ /**
+ * Show the queue of functions to be executed on the matched element.
+ *
+ * @param element A DOM element to inspect for an attached queue.
+ * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue.
+ */
+ queue(element: Element, queueName?: string): any[];
+ /**
+ * Manipulate the queue of functions to be executed on the matched element.
+ *
+ * @param element A DOM element where the array of queued functions is attached.
+ * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue.
+ * @param newQueue An array of functions to replace the current queue contents.
+ */
+ queue(element: Element, queueName: string, newQueue: Function[]): JQuery;
+ /**
+ * Manipulate the queue of functions to be executed on the matched element.
+ *
+ * @param element A DOM element on which to add a queued function.
+ * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue.
+ * @param callback The new function to add to the queue.
+ */
+ queue(element: Element, queueName: string, callback: Function): JQuery;
+
+ /**
+ * Remove a previously-stored piece of data.
+ *
+ * @param element A DOM element from which to remove data.
+ * @param name A string naming the piece of data to remove.
+ */
+ removeData(element: Element, name?: string): JQuery;
+
+ /**
+ * A constructor function that returns a chainable utility object with methods to register multiple callbacks into callback queues, invoke callback queues, and relay the success or failure state of any synchronous or asynchronous function.
+ *
+ * @param beforeStart A function that is called just before the constructor returns.
+ */
+ Deferred<T>(beforeStart?: (deferred: JQueryDeferred<T>) => any): JQueryDeferred<T>;
+
+ /**
+ * Effects
+ */
+ fx: {
+ tick: () => void;
+ /**
+ * The rate (in milliseconds) at which animations fire.
+ */
+ interval: number;
+ stop: () => void;
+ speeds: { slow: number; fast: number; };
+ /**
+ * Globally disable all animations.
+ */
+ off: boolean;
+ step: any;
+ };
+
+ /**
+ * Takes a function and returns a new one that will always have a particular context.
+ *
+ * @param fnction The function whose context will be changed.
+ * @param context The object to which the context (this) of the function should be set.
+ * @param additionalArguments Any number of arguments to be passed to the function referenced in the function argument.
+ */
+ proxy(fnction: (...args: any[]) => any, context: Object, ...additionalArguments: any[]): any;
+ /**
+ * Takes a function and returns a new one that will always have a particular context.
+ *
+ * @param context The object to which the context (this) of the function should be set.
+ * @param name The name of the function whose context will be changed (should be a property of the context object).
+ * @param additionalArguments Any number of arguments to be passed to the function named in the name argument.
+ */
+ proxy(context: Object, name: string, ...additionalArguments: any[]): any;
+
+ Event: JQueryEventConstructor;
+
+ /**
+ * Takes a string and throws an exception containing it.
+ *
+ * @param message The message to send out.
+ */
+ error(message: any): JQuery;
+
+ expr: any;
+ fn: any; //TODO: Decide how we want to type this
+
+ isReady: boolean;
+
+ // Properties
+ support: JQuerySupport;
+
+ /**
+ * Check to see if a DOM element is a descendant of another DOM element.
+ *
+ * @param container The DOM element that may contain the other element.
+ * @param contained The DOM element that may be contained by (a descendant of) the other element.
+ */
+ contains(container: Element, contained: Element): boolean;
+
+ /**
+ * A generic iterator function, which can be used to seamlessly iterate over both objects and arrays. Arrays and array-like objects with a length property (such as a function's arguments object) are iterated by numeric index, from 0 to length-1. Other objects are iterated via their named properties.
+ *
+ * @param collection The object or array to iterate over.
+ * @param callback The function that will be executed on every object.
+ */
+ each<T>(
+ collection: T[],
+ callback: (indexInArray: number, valueOfElement: T) => any
+ ): any;
+
+ /**
+ * A generic iterator function, which can be used to seamlessly iterate over both objects and arrays. Arrays and array-like objects with a length property (such as a function's arguments object) are iterated by numeric index, from 0 to length-1. Other objects are iterated via their named properties.
+ *
+ * @param collection The object or array to iterate over.
+ * @param callback The function that will be executed on every object.
+ */
+ each(
+ collection: any,
+ callback: (indexInArray: any, valueOfElement: any) => any
+ ): any;
+
+ /**
+ * Merge the contents of two or more objects together into the first object.
+ *
+ * @param target An object that will receive the new properties if additional objects are passed in or that will extend the jQuery namespace if it is the sole argument.
+ * @param object1 An object containing additional properties to merge in.
+ * @param objectN Additional objects containing properties to merge in.
+ */
+ extend(target: any, object1?: any, ...objectN: any[]): any;
+ /**
+ * Merge the contents of two or more objects together into the first object.
+ *
+ * @param deep If true, the merge becomes recursive (aka. deep copy).
+ * @param target The object to extend. It will receive the new properties.
+ * @param object1 An object containing additional properties to merge in.
+ * @param objectN Additional objects containing properties to merge in.
+ */
+ extend(deep: boolean, target: any, object1?: any, ...objectN: any[]): any;
+
+ /**
+ * Execute some JavaScript code globally.
+ *
+ * @param code The JavaScript code to execute.
+ */
+ globalEval(code: string): any;
+
+ /**
+ * Finds the elements of an array which satisfy a filter function. The original array is not affected.
+ *
+ * @param array The array to search through.
+ * @param func The function to process each item against. The first argument to the function is the item, and the second argument is the index. The function should return a Boolean value. this will be the global window object.
+ * @param invert If "invert" is false, or not provided, then the function returns an array consisting of all elements for which "callback" returns true. If "invert" is true, then the function returns an array consisting of all elements for which "callback" returns false.
+ */
+ grep<T>(array: T[], func: (elementOfArray: T, indexInArray: number) => boolean, invert?: boolean): T[];
+
+ /**
+ * Search for a specified value within an array and return its index (or -1 if not found).
+ *
+ * @param value The value to search for.
+ * @param array An array through which to search.
+ * @param fromIndex he index of the array at which to begin the search. The default is 0, which will search the whole array.
+ */
+ inArray<T>(value: T, array: T[], fromIndex?: number): number;
+
+ /**
+ * Determine whether the argument is an array.
+ *
+ * @param obj Object to test whether or not it is an array.
+ */
+ isArray(obj: any): boolean;
+ /**
+ * Check to see if an object is empty (contains no enumerable properties).
+ *
+ * @param obj The object that will be checked to see if it's empty.
+ */
+ isEmptyObject(obj: any): boolean;
+ /**
+ * Determine if the argument passed is a Javascript function object.
+ *
+ * @param obj Object to test whether or not it is a function.
+ */
+ isFunction(obj: any): boolean;
+ /**
+ * Determines whether its argument is a number.
+ *
+ * @param obj The value to be tested.
+ */
+ isNumeric(value: any): boolean;
+ /**
+ * Check to see if an object is a plain object (created using "{}" or "new Object").
+ *
+ * @param obj The object that will be checked to see if it's a plain object.
+ */
+ isPlainObject(obj: any): boolean;
+ /**
+ * Determine whether the argument is a window.
+ *
+ * @param obj Object to test whether or not it is a window.
+ */
+ isWindow(obj: any): boolean;
+ /**
+ * Check to see if a DOM node is within an XML document (or is an XML document).
+ *
+ * @param node he DOM node that will be checked to see if it's in an XML document.
+ */
+ isXMLDoc(node: Node): boolean;
+
+ /**
+ * Convert an array-like object into a true JavaScript array.
+ *
+ * @param obj Any object to turn into a native Array.
+ */
+ makeArray(obj: any): any[];
+
+ /**
+ * Translate all items in an array or object to new array of items.
+ *
+ * @param array The Array to translate.
+ * @param callback The function to process each item against. The first argument to the function is the array item, the second argument is the index in array The function can return any value. Within the function, this refers to the global (window) object.
+ */
+ map<T, U>(array: T[], callback: (elementOfArray: T, indexInArray: number) => U): U[];
+ /**
+ * Translate all items in an array or object to new array of items.
+ *
+ * @param arrayOrObject The Array or Object to translate.
+ * @param callback The function to process each item against. The first argument to the function is the value; the second argument is the index or key of the array or object property. The function can return any value to add to the array. A returned array will be flattened into the resulting array. Within the function, this refers to the global (window) object.
+ */
+ map(arrayOrObject: any, callback: (value: any, indexOrKey: any) => any): any;
+
+ /**
+ * Merge the contents of two arrays together into the first array.
+ *
+ * @param first The first array to merge, the elements of second added.
+ * @param second The second array to merge into the first, unaltered.
+ */
+ merge<T>(first: T[], second: T[]): T[];
+
+ /**
+ * An empty function.
+ */
+ noop(): any;
+
+ /**
+ * Return a number representing the current time.
+ */
+ now(): number;
+
+ /**
+ * Takes a well-formed JSON string and returns the resulting JavaScript object.
+ *
+ * @param json The JSON string to parse.
+ */
+ parseJSON(json: string): any;
+
+ /**
+ * Parses a string into an XML document.
+ *
+ * @param data a well-formed XML string to be parsed
+ */
+ parseXML(data: string): XMLDocument;
+
+ /**
+ * Remove the whitespace from the beginning and end of a string.
+ *
+ * @param str Remove the whitespace from the beginning and end of a string.
+ */
+ trim(str: string): string;
+
+ /**
+ * Determine the internal JavaScript [[Class]] of an object.
+ *
+ * @param obj Object to get the internal JavaScript [[Class]] of.
+ */
+ type(obj: any): string;
+
+ /**
+ * Sorts an array of DOM elements, in place, with the duplicates removed. Note that this only works on arrays of DOM elements, not strings or numbers.
+ *
+ * @param array The Array of DOM elements.
+ */
+ unique(array: Element[]): Element[];
+
+ /**
+ * Parses a string into an array of DOM nodes.
+ *
+ * @param data HTML string to be parsed
+ * @param context DOM element to serve as the context in which the HTML fragment will be created
+ * @param keepScripts A Boolean indicating whether to include scripts passed in the HTML string
+ */
+ parseHTML(data: string, context?: HTMLElement, keepScripts?: boolean): any[];
+
+ /**
+ * Parses a string into an array of DOM nodes.
+ *
+ * @param data HTML string to be parsed
+ * @param context DOM element to serve as the context in which the HTML fragment will be created
+ * @param keepScripts A Boolean indicating whether to include scripts passed in the HTML string
+ */
+ parseHTML(data: string, context?: Document, keepScripts?: boolean): any[];
+}
+
+/**
+ * The jQuery instance members
+ */
+interface JQuery {
+ /**
+ * Register a handler to be called when Ajax requests complete. This is an AjaxEvent.
+ *
+ * @param handler The function to be invoked.
+ */
+ ajaxComplete(handler: (event: JQueryEventObject, XMLHttpRequest: XMLHttpRequest, ajaxOptions: any) => any): JQuery;
+ /**
+ * Register a handler to be called when Ajax requests complete with an error. This is an Ajax Event.
+ *
+ * @param handler The function to be invoked.
+ */
+ ajaxError(handler: (event: JQueryEventObject, jqXHR: JQueryXHR, ajaxSettings: JQueryAjaxSettings, thrownError: any) => any): JQuery;
+ /**
+ * Attach a function to be executed before an Ajax request is sent. This is an Ajax Event.
+ *
+ * @param handler The function to be invoked.
+ */
+ ajaxSend(handler: (event: JQueryEventObject, jqXHR: JQueryXHR, ajaxOptions: JQueryAjaxSettings) => any): JQuery;
+ /**
+ * Register a handler to be called when the first Ajax request begins. This is an Ajax Event.
+ *
+ * @param handler The function to be invoked.
+ */
+ ajaxStart(handler: () => any): JQuery;
+ /**
+ * Register a handler to be called when all Ajax requests have completed. This is an Ajax Event.
+ *
+ * @param handler The function to be invoked.
+ */
+ ajaxStop(handler: () => any): JQuery;
+ /**
+ * Attach a function to be executed whenever an Ajax request completes successfully. This is an Ajax Event.
+ *
+ * @param handler The function to be invoked.
+ */
+ ajaxSuccess(handler: (event: JQueryEventObject, XMLHttpRequest: XMLHttpRequest, ajaxOptions: JQueryAjaxSettings) => any): JQuery;
+
+ /**
+ * Load data from the server and place the returned HTML into the matched element.
+ *
+ * @param url A string containing the URL to which the request is sent.
+ * @param data A plain object or string that is sent to the server with the request.
+ * @param complete A callback function that is executed when the request completes.
+ */
+ load(url: string, data?: string|Object, complete?: (responseText: string, textStatus: string, XMLHttpRequest: XMLHttpRequest) => any): JQuery;
+
+ /**
+ * Encode a set of form elements as a string for submission.
+ */
+ serialize(): string;
+ /**
+ * Encode a set of form elements as an array of names and values.
+ */
+ serializeArray(): JQuerySerializeArrayElement[];
+
+ /**
+ * Adds the specified class(es) to each of the set of matched elements.
+ *
+ * @param className One or more space-separated classes to be added to the class attribute of each matched element.
+ */
+ addClass(className: string): JQuery;
+ /**
+ * Adds the specified class(es) to each of the set of matched elements.
+ *
+ * @param function A function returning one or more space-separated class names to be added to the existing class name(s). Receives the index position of the element in the set and the existing class name(s) as arguments. Within the function, this refers to the current element in the set.
+ */
+ addClass(func: (index: number, className: string) => string): JQuery;
+
+ /**
+ * Add the previous set of elements on the stack to the current set, optionally filtered by a selector.
+ */
+ addBack(selector?: string): JQuery;
+
+ /**
+ * Get the value of an attribute for the first element in the set of matched elements.
+ *
+ * @param attributeName The name of the attribute to get.
+ */
+ attr(attributeName: string): string;
+ /**
+ * Set one or more attributes for the set of matched elements.
+ *
+ * @param attributeName The name of the attribute to set.
+ * @param value A value to set for the attribute.
+ */
+ attr(attributeName: string, value: string|number): JQuery;
+ /**
+ * Set one or more attributes for the set of matched elements.
+ *
+ * @param attributeName The name of the attribute to set.
+ * @param func A function returning the value to set. this is the current element. Receives the index position of the element in the set and the old attribute value as arguments.
+ */
+ attr(attributeName: string, func: (index: number, attr: string) => string|number): JQuery;
+ /**
+ * Set one or more attributes for the set of matched elements.
+ *
+ * @param attributes An object of attribute-value pairs to set.
+ */
+ attr(attributes: Object): JQuery;
+
+ /**
+ * Determine whether any of the matched elements are assigned the given class.
+ *
+ * @param className The class name to search for.
+ */
+ hasClass(className: string): boolean;
+
+ /**
+ * Get the HTML contents of the first element in the set of matched elements.
+ */
+ html(): string;
+ /**
+ * Set the HTML contents of each element in the set of matched elements.
+ *
+ * @param htmlString A string of HTML to set as the content of each matched element.
+ */
+ html(htmlString: string): JQuery;
+ /**
+ * Set the HTML contents of each element in the set of matched elements.
+ *
+ * @param func A function returning the HTML content to set. Receives the index position of the element in the set and the old HTML value as arguments. jQuery empties the element before calling the function; use the oldhtml argument to reference the previous content. Within the function, this refers to the current element in the set.
+ */
+ html(func: (index: number, oldhtml: string) => string): JQuery;
+ /**
+ * Set the HTML contents of each element in the set of matched elements.
+ *
+ * @param func A function returning the HTML content to set. Receives the index position of the element in the set and the old HTML value as arguments. jQuery empties the element before calling the function; use the oldhtml argument to reference the previous content. Within the function, this refers to the current element in the set.
+ */
+
+ /**
+ * Get the value of a property for the first element in the set of matched elements.
+ *
+ * @param propertyName The name of the property to get.
+ */
+ prop(propertyName: string): any;
+ /**
+ * Set one or more properties for the set of matched elements.
+ *
+ * @param propertyName The name of the property to set.
+ * @param value A value to set for the property.
+ */
+ prop(propertyName: string, value: string|number|boolean): JQuery;
+ /**
+ * Set one or more properties for the set of matched elements.
+ *
+ * @param properties An object of property-value pairs to set.
+ */
+ prop(properties: Object): JQuery;
+ /**
+ * Set one or more properties for the set of matched elements.
+ *
+ * @param propertyName The name of the property to set.
+ * @param func A function returning the value to set. Receives the index position of the element in the set and the old property value as arguments. Within the function, the keyword this refers to the current element.
+ */
+ prop(propertyName: string, func: (index: number, oldPropertyValue: any) => any): JQuery;
+
+ /**
+ * Remove an attribute from each element in the set of matched elements.
+ *
+ * @param attributeName An attribute to remove; as of version 1.7, it can be a space-separated list of attributes.
+ */
+ removeAttr(attributeName: string): JQuery;
+
+ /**
+ * Remove a single class, multiple classes, or all classes from each element in the set of matched elements.
+ *
+ * @param className One or more space-separated classes to be removed from the class attribute of each matched element.
+ */
+ removeClass(className?: string): JQuery;
+ /**
+ * Remove a single class, multiple classes, or all classes from each element in the set of matched elements.
+ *
+ * @param function A function returning one or more space-separated class names to be removed. Receives the index position of the element in the set and the old class value as arguments.
+ */
+ removeClass(func: (index: number, className: string) => string): JQuery;
+
+ /**
+ * Remove a property for the set of matched elements.
+ *
+ * @param propertyName The name of the property to remove.
+ */
+ removeProp(propertyName: string): JQuery;
+
+ /**
+ * Add or remove one or more classes from each element in the set of matched elements, depending on either the class's presence or the value of the switch argument.
+ *
+ * @param className One or more class names (separated by spaces) to be toggled for each element in the matched set.
+ * @param swtch A Boolean (not just truthy/falsy) value to determine whether the class should be added or removed.
+ */
+ toggleClass(className: string, swtch?: boolean): JQuery;
+ /**
+ * Add or remove one or more classes from each element in the set of matched elements, depending on either the class's presence or the value of the switch argument.
+ *
+ * @param swtch A boolean value to determine whether the class should be added or removed.
+ */
+ toggleClass(swtch?: boolean): JQuery;
+ /**
+ * Add or remove one or more classes from each element in the set of matched elements, depending on either the class's presence or the value of the switch argument.
+ *
+ * @param func A function that returns class names to be toggled in the class attribute of each element in the matched set. Receives the index position of the element in the set, the old class value, and the switch as arguments.
+ * @param swtch A boolean value to determine whether the class should be added or removed.
+ */
+ toggleClass(func: (index: number, className: string, swtch: boolean) => string, swtch?: boolean): JQuery;
+
+ /**
+ * Get the current value of the first element in the set of matched elements.
+ */
+ val(): any;
+ /**
+ * Set the value of each element in the set of matched elements.
+ *
+ * @param value A string of text or an array of strings corresponding to the value of each matched element to set as selected/checked.
+ */
+ val(value: string|string[]): JQuery;
+ /**
+ * Set the value of each element in the set of matched elements.
+ *
+ * @param func A function returning the value to set. this is the current element. Receives the index position of the element in the set and the old value as arguments.
+ */
+ val(func: (index: number, value: string) => string): JQuery;
+
+
+ /**
+ * Get the value of style properties for the first element in the set of matched elements.
+ *
+ * @param propertyName A CSS property.
+ */
+ css(propertyName: string): string;
+ /**
+ * Set one or more CSS properties for the set of matched elements.
+ *
+ * @param propertyName A CSS property name.
+ * @param value A value to set for the property.
+ */
+ css(propertyName: string, value: string|number): JQuery;
+ /**
+ * Set one or more CSS properties for the set of matched elements.
+ *
+ * @param propertyName A CSS property name.
+ * @param value A function returning the value to set. this is the current element. Receives the index position of the element in the set and the old value as arguments.
+ */
+ css(propertyName: string, value: (index: number, value: string) => string|number): JQuery;
+ /**
+ * Set one or more CSS properties for the set of matched elements.
+ *
+ * @param properties An object of property-value pairs to set.
+ */
+ css(properties: Object): JQuery;
+
+ /**
+ * Get the current computed height for the first element in the set of matched elements.
+ */
+ height(): number;
+ /**
+ * Set the CSS height of every matched element.
+ *
+ * @param value An integer representing the number of pixels, or an integer with an optional unit of measure appended (as a string).
+ */
+ height(value: number|string): JQuery;
+ /**
+ * Set the CSS height of every matched element.
+ *
+ * @param func A function returning the height to set. Receives the index position of the element in the set and the old height as arguments. Within the function, this refers to the current element in the set.
+ */
+ height(func: (index: number, height: number) => number|string): JQuery;
+
+ /**
+ * Get the current computed height for the first element in the set of matched elements, including padding but not border.
+ */
+ innerHeight(): number;
+
+ /**
+ * Sets the inner height on elements in the set of matched elements, including padding but not border.
+ *
+ * @param value An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string).
+ */
+ innerHeight(height: number|string): JQuery;
+
+ /**
+ * Get the current computed width for the first element in the set of matched elements, including padding but not border.
+ */
+ innerWidth(): number;
+
+ /**
+ * Sets the inner width on elements in the set of matched elements, including padding but not border.
+ *
+ * @param value An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string).
+ */
+ innerWidth(width: number|string): JQuery;
+
+ /**
+ * Get the current coordinates of the first element in the set of matched elements, relative to the document.
+ */
+ offset(): JQueryCoordinates;
+ /**
+ * An object containing the properties top and left, which are integers indicating the new top and left coordinates for the elements.
+ *
+ * @param coordinates An object containing the properties top and left, which are integers indicating the new top and left coordinates for the elements.
+ */
+ offset(coordinates: JQueryCoordinates): JQuery;
+ /**
+ * An object containing the properties top and left, which are integers indicating the new top and left coordinates for the elements.
+ *
+ * @param func A function to return the coordinates to set. Receives the index of the element in the collection as the first argument and the current coordinates as the second argument. The function should return an object with the new top and left properties.
+ */
+ offset(func: (index: number, coords: JQueryCoordinates) => JQueryCoordinates): JQuery;
+
+ /**
+ * Get the current computed height for the first element in the set of matched elements, including padding, border, and optionally margin. Returns an integer (without "px") representation of the value or null if called on an empty set of elements.
+ *
+ * @param includeMargin A Boolean indicating whether to include the element's margin in the calculation.
+ */
+ outerHeight(includeMargin?: boolean): number;
+
+ /**
+ * Sets the outer height on elements in the set of matched elements, including padding and border.
+ *
+ * @param value An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string).
+ */
+ outerHeight(height: number|string): JQuery;
+
+ /**
+ * Get the current computed width for the first element in the set of matched elements, including padding and border.
+ *
+ * @param includeMargin A Boolean indicating whether to include the element's margin in the calculation.
+ */
+ outerWidth(includeMargin?: boolean): number;
+
+ /**
+ * Sets the outer width on elements in the set of matched elements, including padding and border.
+ *
+ * @param value An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string).
+ */
+ outerWidth(width: number|string): JQuery;
+
+ /**
+ * Get the current coordinates of the first element in the set of matched elements, relative to the offset parent.
+ */
+ position(): JQueryCoordinates;
+
+ /**
+ * Get the current horizontal position of the scroll bar for the first element in the set of matched elements or set the horizontal position of the scroll bar for every matched element.
+ */
+ scrollLeft(): number;
+ /**
+ * Set the current horizontal position of the scroll bar for each of the set of matched elements.
+ *
+ * @param value An integer indicating the new position to set the scroll bar to.
+ */
+ scrollLeft(value: number): JQuery;
+
+ /**
+ * Get the current vertical position of the scroll bar for the first element in the set of matched elements or set the vertical position of the scroll bar for every matched element.
+ */
+ scrollTop(): number;
+ /**
+ * Set the current vertical position of the scroll bar for each of the set of matched elements.
+ *
+ * @param value An integer indicating the new position to set the scroll bar to.
+ */
+ scrollTop(value: number): JQuery;
+
+ /**
+ * Get the current computed width for the first element in the set of matched elements.
+ */
+ width(): number;
+ /**
+ * Set the CSS width of each element in the set of matched elements.
+ *
+ * @param value An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string).
+ */
+ width(value: number|string): JQuery;
+ /**
+ * Set the CSS width of each element in the set of matched elements.
+ *
+ * @param func A function returning the width to set. Receives the index position of the element in the set and the old width as arguments. Within the function, this refers to the current element in the set.
+ */
+ width(func: (index: number, width: number) => number|string): JQuery;
+
+ /**
+ * Remove from the queue all items that have not yet been run.
+ *
+ * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue.
+ */
+ clearQueue(queueName?: string): JQuery;
+
+ /**
+ * Store arbitrary data associated with the matched elements.
+ *
+ * @param key A string naming the piece of data to set.
+ * @param value The new data value; it can be any Javascript type including Array or Object.
+ */
+ data(key: string, value: any): JQuery;
+ /**
+ * Return the value at the named data store for the first element in the jQuery collection, as set by data(name, value) or by an HTML5 data-* attribute.
+ *
+ * @param key Name of the data stored.
+ */
+ data(key: string): any;
+ /**
+ * Store arbitrary data associated with the matched elements.
+ *
+ * @param obj An object of key-value pairs of data to update.
+ */
+ data(obj: { [key: string]: any; }): JQuery;
+ /**
+ * Return the value at the named data store for the first element in the jQuery collection, as set by data(name, value) or by an HTML5 data-* attribute.
+ */
+ data(): any;
+
+ /**
+ * Execute the next function on the queue for the matched elements.
+ *
+ * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue.
+ */
+ dequeue(queueName?: string): JQuery;
+
+ /**
+ * Remove a previously-stored piece of data.
+ *
+ * @param name A string naming the piece of data to delete or space-separated string naming the pieces of data to delete.
+ */
+ removeData(name: string): JQuery;
+ /**
+ * Remove a previously-stored piece of data.
+ *
+ * @param list An array of strings naming the pieces of data to delete.
+ */
+ removeData(list: string[]): JQuery;
+ /**
+ * Remove all previously-stored piece of data.
+ */
+ removeData(): JQuery;
+
+ /**
+ * Return a Promise object to observe when all actions of a certain type bound to the collection, queued or not, have finished.
+ *
+ * @param type The type of queue that needs to be observed. (default: fx)
+ * @param target Object onto which the promise methods have to be attached
+ */
+ promise(type?: string, target?: Object): JQueryPromise<any>;
+
+ /**
+ * Perform a custom animation of a set of CSS properties.
+ *
+ * @param properties An object of CSS properties and values that the animation will move toward.
+ * @param duration A string or number determining how long the animation will run.
+ * @param complete A function to call once the animation is complete.
+ */
+ animate(properties: Object, duration?: string|number, complete?: Function): JQuery;
+ /**
+ * Perform a custom animation of a set of CSS properties.
+ *
+ * @param properties An object of CSS properties and values that the animation will move toward.
+ * @param duration A string or number determining how long the animation will run.
+ * @param easing A string indicating which easing function to use for the transition. (default: swing)
+ * @param complete A function to call once the animation is complete.
+ */
+ animate(properties: Object, duration?: string|number, easing?: string, complete?: Function): JQuery;
+ /**
+ * Perform a custom animation of a set of CSS properties.
+ *
+ * @param properties An object of CSS properties and values that the animation will move toward.
+ * @param options A map of additional options to pass to the method.
+ */
+ animate(properties: Object, options: JQueryAnimationOptions): JQuery;
+
+ /**
+ * Set a timer to delay execution of subsequent items in the queue.
+ *
+ * @param duration An integer indicating the number of milliseconds to delay execution of the next item in the queue.
+ * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue.
+ */
+ delay(duration: number, queueName?: string): JQuery;
+
+ /**
+ * Display the matched elements by fading them to opaque.
+ *
+ * @param duration A string or number determining how long the animation will run.
+ * @param complete A function to call once the animation is complete.
+ */
+ fadeIn(duration?: number|string, complete?: Function): JQuery;
+ /**
+ * Display the matched elements by fading them to opaque.
+ *
+ * @param duration A string or number determining how long the animation will run.
+ * @param easing A string indicating which easing function to use for the transition.
+ * @param complete A function to call once the animation is complete.
+ */
+ fadeIn(duration?: number|string, easing?: string, complete?: Function): JQuery;
+ /**
+ * Display the matched elements by fading them to opaque.
+ *
+ * @param options A map of additional options to pass to the method.
+ */
+ fadeIn(options: JQueryAnimationOptions): JQuery;
+
+ /**
+ * Hide the matched elements by fading them to transparent.
+ *
+ * @param duration A string or number determining how long the animation will run.
+ * @param complete A function to call once the animation is complete.
+ */
+ fadeOut(duration?: number|string, complete?: Function): JQuery;
+ /**
+ * Hide the matched elements by fading them to transparent.
+ *
+ * @param duration A string or number determining how long the animation will run.
+ * @param easing A string indicating which easing function to use for the transition.
+ * @param complete A function to call once the animation is complete.
+ */
+ fadeOut(duration?: number|string, easing?: string, complete?: Function): JQuery;
+ /**
+ * Hide the matched elements by fading them to transparent.
+ *
+ * @param options A map of additional options to pass to the method.
+ */
+ fadeOut(options: JQueryAnimationOptions): JQuery;
+
+ /**
+ * Adjust the opacity of the matched elements.
+ *
+ * @param duration A string or number determining how long the animation will run.
+ * @param opacity A number between 0 and 1 denoting the target opacity.
+ * @param complete A function to call once the animation is complete.
+ */
+ fadeTo(duration: string|number, opacity: number, complete?: Function): JQuery;
+ /**
+ * Adjust the opacity of the matched elements.
+ *
+ * @param duration A string or number determining how long the animation will run.
+ * @param opacity A number between 0 and 1 denoting the target opacity.
+ * @param easing A string indicating which easing function to use for the transition.
+ * @param complete A function to call once the animation is complete.
+ */
+ fadeTo(duration: string|number, opacity: number, easing?: string, complete?: Function): JQuery;
+
+ /**
+ * Display or hide the matched elements by animating their opacity.
+ *
+ * @param duration A string or number determining how long the animation will run.
+ * @param complete A function to call once the animation is complete.
+ */
+ fadeToggle(duration?: number|string, complete?: Function): JQuery;
+ /**
+ * Display or hide the matched elements by animating their opacity.
+ *
+ * @param duration A string or number determining how long the animation will run.
+ * @param easing A string indicating which easing function to use for the transition.
+ * @param complete A function to call once the animation is complete.
+ */
+ fadeToggle(duration?: number|string, easing?: string, complete?: Function): JQuery;
+ /**
+ * Display or hide the matched elements by animating their opacity.
+ *
+ * @param options A map of additional options to pass to the method.
+ */
+ fadeToggle(options: JQueryAnimationOptions): JQuery;
+
+ /**
+ * Stop the currently-running animation, remove all queued animations, and complete all animations for the matched elements.
+ *
+ * @param queue The name of the queue in which to stop animations.
+ */
+ finish(queue?: string): JQuery;
+
+ /**
+ * Hide the matched elements.
+ *
+ * @param duration A string or number determining how long the animation will run.
+ * @param complete A function to call once the animation is complete.
+ */
+ hide(duration?: number|string, complete?: Function): JQuery;
+ /**
+ * Hide the matched elements.
+ *
+ * @param duration A string or number determining how long the animation will run.
+ * @param easing A string indicating which easing function to use for the transition.
+ * @param complete A function to call once the animation is complete.
+ */
+ hide(duration?: number|string, easing?: string, complete?: Function): JQuery;
+ /**
+ * Hide the matched elements.
+ *
+ * @param options A map of additional options to pass to the method.
+ */
+ hide(options: JQueryAnimationOptions): JQuery;
+
+ /**
+ * Display the matched elements.
+ *
+ * @param duration A string or number determining how long the animation will run.
+ * @param complete A function to call once the animation is complete.
+ */
+ show(duration?: number|string, complete?: Function): JQuery;
+ /**
+ * Display the matched elements.
+ *
+ * @param duration A string or number determining how long the animation will run.
+ * @param easing A string indicating which easing function to use for the transition.
+ * @param complete A function to call once the animation is complete.
+ */
+ show(duration?: number|string, easing?: string, complete?: Function): JQuery;
+ /**
+ * Display the matched elements.
+ *
+ * @param options A map of additional options to pass to the method.
+ */
+ show(options: JQueryAnimationOptions): JQuery;
+
+ /**
+ * Display the matched elements with a sliding motion.
+ *
+ * @param duration A string or number determining how long the animation will run.
+ * @param complete A function to call once the animation is complete.
+ */
+ slideDown(duration?: number|string, complete?: Function): JQuery;
+ /**
+ * Display the matched elements with a sliding motion.
+ *
+ * @param duration A string or number determining how long the animation will run.
+ * @param easing A string indicating which easing function to use for the transition.
+ * @param complete A function to call once the animation is complete.
+ */
+ slideDown(duration?: number|string, easing?: string, complete?: Function): JQuery;
+ /**
+ * Display the matched elements with a sliding motion.
+ *
+ * @param options A map of additional options to pass to the method.
+ */
+ slideDown(options: JQueryAnimationOptions): JQuery;
+
+ /**
+ * Display or hide the matched elements with a sliding motion.
+ *
+ * @param duration A string or number determining how long the animation will run.
+ * @param complete A function to call once the animation is complete.
+ */
+ slideToggle(duration?: number|string, complete?: Function): JQuery;
+ /**
+ * Display or hide the matched elements with a sliding motion.
+ *
+ * @param duration A string or number determining how long the animation will run.
+ * @param easing A string indicating which easing function to use for the transition.
+ * @param complete A function to call once the animation is complete.
+ */
+ slideToggle(duration?: number|string, easing?: string, complete?: Function): JQuery;
+ /**
+ * Display or hide the matched elements with a sliding motion.
+ *
+ * @param options A map of additional options to pass to the method.
+ */
+ slideToggle(options: JQueryAnimationOptions): JQuery;
+
+ /**
+ * Hide the matched elements with a sliding motion.
+ *
+ * @param duration A string or number determining how long the animation will run.
+ * @param complete A function to call once the animation is complete.
+ */
+ slideUp(duration?: number|string, complete?: Function): JQuery;
+ /**
+ * Hide the matched elements with a sliding motion.
+ *
+ * @param duration A string or number determining how long the animation will run.
+ * @param easing A string indicating which easing function to use for the transition.
+ * @param complete A function to call once the animation is complete.
+ */
+ slideUp(duration?: number|string, easing?: string, complete?: Function): JQuery;
+ /**
+ * Hide the matched elements with a sliding motion.
+ *
+ * @param options A map of additional options to pass to the method.
+ */
+ slideUp(options: JQueryAnimationOptions): JQuery;
+
+ /**
+ * Stop the currently-running animation on the matched elements.
+ *
+ * @param clearQueue A Boolean indicating whether to remove queued animation as well. Defaults to false.
+ * @param jumpToEnd A Boolean indicating whether to complete the current animation immediately. Defaults to false.
+ */
+ stop(clearQueue?: boolean, jumpToEnd?: boolean): JQuery;
+ /**
+ * Stop the currently-running animation on the matched elements.
+ *
+ * @param queue The name of the queue in which to stop animations.
+ * @param clearQueue A Boolean indicating whether to remove queued animation as well. Defaults to false.
+ * @param jumpToEnd A Boolean indicating whether to complete the current animation immediately. Defaults to false.
+ */
+ stop(queue?: string, clearQueue?: boolean, jumpToEnd?: boolean): JQuery;
+
+ /**
+ * Display or hide the matched elements.
+ *
+ * @param duration A string or number determining how long the animation will run.
+ * @param complete A function to call once the animation is complete.
+ */
+ toggle(duration?: number|string, complete?: Function): JQuery;
+ /**
+ * Display or hide the matched elements.
+ *
+ * @param duration A string or number determining how long the animation will run.
+ * @param easing A string indicating which easing function to use for the transition.
+ * @param complete A function to call once the animation is complete.
+ */
+ toggle(duration?: number|string, easing?: string, complete?: Function): JQuery;
+ /**
+ * Display or hide the matched elements.
+ *
+ * @param options A map of additional options to pass to the method.
+ */
+ toggle(options: JQueryAnimationOptions): JQuery;
+ /**
+ * Display or hide the matched elements.
+ *
+ * @param showOrHide A Boolean indicating whether to show or hide the elements.
+ */
+ toggle(showOrHide: boolean): JQuery;
+
+ /**
+ * Attach a handler to an event for the elements.
+ *
+ * @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names.
+ * @param eventData An object containing data that will be passed to the event handler.
+ * @param handler A function to execute each time the event is triggered.
+ */
+ bind(eventType: string, eventData: any, handler: (eventObject: JQueryEventObject) => any): JQuery;
+ /**
+ * Attach a handler to an event for the elements.
+ *
+ * @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names.
+ * @param handler A function to execute each time the event is triggered.
+ */
+ bind(eventType: string, handler: (eventObject: JQueryEventObject) => any): JQuery;
+ /**
+ * Attach a handler to an event for the elements.
+ *
+ * @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names.
+ * @param eventData An object containing data that will be passed to the event handler.
+ * @param preventBubble Setting the third argument to false will attach a function that prevents the default action from occurring and stops the event from bubbling. The default is true.
+ */
+ bind(eventType: string, eventData: any, preventBubble: boolean): JQuery;
+ /**
+ * Attach a handler to an event for the elements.
+ *
+ * @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names.
+ * @param preventBubble Setting the third argument to false will attach a function that prevents the default action from occurring and stops the event from bubbling. The default is true.
+ */
+ bind(eventType: string, preventBubble: boolean): JQuery;
+ /**
+ * Attach a handler to an event for the elements.
+ *
+ * @param events An object containing one or more DOM event types and functions to execute for them.
+ */
+ bind(events: any): JQuery;
+
+ /**
+ * Trigger the "blur" event on an element
+ */
+ blur(): JQuery;
+ /**
+ * Bind an event handler to the "blur" JavaScript event
+ *
+ * @param handler A function to execute each time the event is triggered.
+ */
+ blur(handler: (eventObject: JQueryEventObject) => any): JQuery;
+ /**
+ * Bind an event handler to the "blur" JavaScript event
+ *
+ * @param eventData An object containing data that will be passed to the event handler.
+ * @param handler A function to execute each time the event is triggered.
+ */
+ blur(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery;
+
+ /**
+ * Trigger the "change" event on an element.
+ */
+ change(): JQuery;
+ /**
+ * Bind an event handler to the "change" JavaScript event
+ *
+ * @param handler A function to execute each time the event is triggered.
+ */
+ change(handler: (eventObject: JQueryEventObject) => any): JQuery;
+ /**
+ * Bind an event handler to the "change" JavaScript event
+ *
+ * @param eventData An object containing data that will be passed to the event handler.
+ * @param handler A function to execute each time the event is triggered.
+ */
+ change(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery;
+
+ /**
+ * Trigger the "click" event on an element.
+ */
+ click(): JQuery;
+ /**
+ * Bind an event handler to the "click" JavaScript event
+ *
+ * @param eventData An object containing data that will be passed to the event handler.
+ */
+ click(handler: (eventObject: JQueryEventObject) => any): JQuery;
+ /**
+ * Bind an event handler to the "click" JavaScript event
+ *
+ * @param eventData An object containing data that will be passed to the event handler.
+ * @param handler A function to execute each time the event is triggered.
+ */
+ click(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery;
+
+ /**
+ * Trigger the "dblclick" event on an element.
+ */
+ dblclick(): JQuery;
+ /**
+ * Bind an event handler to the "dblclick" JavaScript event
+ *
+ * @param handler A function to execute each time the event is triggered.
+ */
+ dblclick(handler: (eventObject: JQueryEventObject) => any): JQuery;
+ /**
+ * Bind an event handler to the "dblclick" JavaScript event
+ *
+ * @param eventData An object containing data that will be passed to the event handler.
+ * @param handler A function to execute each time the event is triggered.
+ */
+ dblclick(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery;
+
+ delegate(selector: any, eventType: string, handler: (eventObject: JQueryEventObject) => any): JQuery;
+ delegate(selector: any, eventType: string, eventData: any, handler: (eventObject: JQueryEventObject) => any): JQuery;
+
+ /**
+ * Trigger the "focus" event on an element.
+ */
+ focus(): JQuery;
+ /**
+ * Bind an event handler to the "focus" JavaScript event
+ *
+ * @param handler A function to execute each time the event is triggered.
+ */
+ focus(handler: (eventObject: JQueryEventObject) => any): JQuery;
+ /**
+ * Bind an event handler to the "focus" JavaScript event
+ *
+ * @param eventData An object containing data that will be passed to the event handler.
+ * @param handler A function to execute each time the event is triggered.
+ */
+ focus(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery;
+
+ /**
+ * Trigger the "focusin" event on an element.
+ */
+ focusin(): JQuery;
+ /**
+ * Bind an event handler to the "focusin" JavaScript event
+ *
+ * @param handler A function to execute each time the event is triggered.
+ */
+ focusin(handler: (eventObject: JQueryEventObject) => any): JQuery;
+ /**
+ * Bind an event handler to the "focusin" JavaScript event
+ *
+ * @param eventData An object containing data that will be passed to the event handler.
+ * @param handler A function to execute each time the event is triggered.
+ */
+ focusin(eventData: Object, handler: (eventObject: JQueryEventObject) => any): JQuery;
+
+ /**
+ * Trigger the "focusout" event on an element.
+ */
+ focusout(): JQuery;
+ /**
+ * Bind an event handler to the "focusout" JavaScript event
+ *
+ * @param handler A function to execute each time the event is triggered.
+ */
+ focusout(handler: (eventObject: JQueryEventObject) => any): JQuery;
+ /**
+ * Bind an event handler to the "focusout" JavaScript event
+ *
+ * @param eventData An object containing data that will be passed to the event handler.
+ * @param handler A function to execute each time the event is triggered.
+ */
+ focusout(eventData: Object, handler: (eventObject: JQueryEventObject) => any): JQuery;
+
+ /**
+ * Bind two handlers to the matched elements, to be executed when the mouse pointer enters and leaves the elements.
+ *
+ * @param handlerIn A function to execute when the mouse pointer enters the element.
+ * @param handlerOut A function to execute when the mouse pointer leaves the element.
+ */
+ hover(handlerIn: (eventObject: JQueryEventObject) => any, handlerOut: (eventObject: JQueryEventObject) => any): JQuery;
+ /**
+ * Bind a single handler to the matched elements, to be executed when the mouse pointer enters or leaves the elements.
+ *
+ * @param handlerInOut A function to execute when the mouse pointer enters or leaves the element.
+ */
+ hover(handlerInOut: (eventObject: JQueryEventObject) => any): JQuery;
+
+ /**
+ * Trigger the "keydown" event on an element.
+ */
+ keydown(): JQuery;
+ /**
+ * Bind an event handler to the "keydown" JavaScript event
+ *
+ * @param handler A function to execute each time the event is triggered.
+ */
+ keydown(handler: (eventObject: JQueryKeyEventObject) => any): JQuery;
+ /**
+ * Bind an event handler to the "keydown" JavaScript event
+ *
+ * @param eventData An object containing data that will be passed to the event handler.
+ * @param handler A function to execute each time the event is triggered.
+ */
+ keydown(eventData?: any, handler?: (eventObject: JQueryKeyEventObject) => any): JQuery;
+
+ /**
+ * Trigger the "keypress" event on an element.
+ */
+ keypress(): JQuery;
+ /**
+ * Bind an event handler to the "keypress" JavaScript event
+ *
+ * @param handler A function to execute each time the event is triggered.
+ */
+ keypress(handler: (eventObject: JQueryKeyEventObject) => any): JQuery;
+ /**
+ * Bind an event handler to the "keypress" JavaScript event
+ *
+ * @param eventData An object containing data that will be passed to the event handler.
+ * @param handler A function to execute each time the event is triggered.
+ */
+ keypress(eventData?: any, handler?: (eventObject: JQueryKeyEventObject) => any): JQuery;
+
+ /**
+ * Trigger the "keyup" event on an element.
+ */
+ keyup(): JQuery;
+ /**
+ * Bind an event handler to the "keyup" JavaScript event
+ *
+ * @param handler A function to execute each time the event is triggered.
+ */
+ keyup(handler: (eventObject: JQueryKeyEventObject) => any): JQuery;
+ /**
+ * Bind an event handler to the "keyup" JavaScript event
+ *
+ * @param eventData An object containing data that will be passed to the event handler.
+ * @param handler A function to execute each time the event is triggered.
+ */
+ keyup(eventData?: any, handler?: (eventObject: JQueryKeyEventObject) => any): JQuery;
+
+ /**
+ * Bind an event handler to the "load" JavaScript event.
+ *
+ * @param handler A function to execute when the event is triggered.
+ */
+ load(handler: (eventObject: JQueryEventObject) => any): JQuery;
+ /**
+ * Bind an event handler to the "load" JavaScript event.
+ *
+ * @param eventData An object containing data that will be passed to the event handler.
+ * @param handler A function to execute when the event is triggered.
+ */
+ load(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery;
+
+ /**
+ * Trigger the "mousedown" event on an element.
+ */
+ mousedown(): JQuery;
+ /**
+ * Bind an event handler to the "mousedown" JavaScript event.
+ *
+ * @param handler A function to execute when the event is triggered.
+ */
+ mousedown(handler: (eventObject: JQueryMouseEventObject) => any): JQuery;
+ /**
+ * Bind an event handler to the "mousedown" JavaScript event.
+ *
+ * @param eventData An object containing data that will be passed to the event handler.
+ * @param handler A function to execute when the event is triggered.
+ */
+ mousedown(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery;
+
+ /**
+ * Trigger the "mouseenter" event on an element.
+ */
+ mouseenter(): JQuery;
+ /**
+ * Bind an event handler to be fired when the mouse enters an element.
+ *
+ * @param handler A function to execute when the event is triggered.
+ */
+ mouseenter(handler: (eventObject: JQueryMouseEventObject) => any): JQuery;
+ /**
+ * Bind an event handler to be fired when the mouse enters an element.
+ *
+ * @param eventData An object containing data that will be passed to the event handler.
+ * @param handler A function to execute when the event is triggered.
+ */
+ mouseenter(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery;
+
+ /**
+ * Trigger the "mouseleave" event on an element.
+ */
+ mouseleave(): JQuery;
+ /**
+ * Bind an event handler to be fired when the mouse leaves an element.
+ *
+ * @param handler A function to execute when the event is triggered.
+ */
+ mouseleave(handler: (eventObject: JQueryMouseEventObject) => any): JQuery;
+ /**
+ * Bind an event handler to be fired when the mouse leaves an element.
+ *
+ * @param eventData An object containing data that will be passed to the event handler.
+ * @param handler A function to execute when the event is triggered.
+ */
+ mouseleave(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery;
+
+ /**
+ * Trigger the "mousemove" event on an element.
+ */
+ mousemove(): JQuery;
+ /**
+ * Bind an event handler to the "mousemove" JavaScript event.
+ *
+ * @param handler A function to execute when the event is triggered.
+ */
+ mousemove(handler: (eventObject: JQueryMouseEventObject) => any): JQuery;
+ /**
+ * Bind an event handler to the "mousemove" JavaScript event.
+ *
+ * @param eventData An object containing data that will be passed to the event handler.
+ * @param handler A function to execute when the event is triggered.
+ */
+ mousemove(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery;
+
+ /**
+ * Trigger the "mouseout" event on an element.
+ */
+ mouseout(): JQuery;
+ /**
+ * Bind an event handler to the "mouseout" JavaScript event.
+ *
+ * @param handler A function to execute when the event is triggered.
+ */
+ mouseout(handler: (eventObject: JQueryMouseEventObject) => any): JQuery;
+ /**
+ * Bind an event handler to the "mouseout" JavaScript event.
+ *
+ * @param eventData An object containing data that will be passed to the event handler.
+ * @param handler A function to execute when the event is triggered.
+ */
+ mouseout(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery;
+
+ /**
+ * Trigger the "mouseover" event on an element.
+ */
+ mouseover(): JQuery;
+ /**
+ * Bind an event handler to the "mouseover" JavaScript event.
+ *
+ * @param handler A function to execute when the event is triggered.
+ */
+ mouseover(handler: (eventObject: JQueryMouseEventObject) => any): JQuery;
+ /**
+ * Bind an event handler to the "mouseover" JavaScript event.
+ *
+ * @param eventData An object containing data that will be passed to the event handler.
+ * @param handler A function to execute when the event is triggered.
+ */
+ mouseover(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery;
+
+ /**
+ * Trigger the "mouseup" event on an element.
+ */
+ mouseup(): JQuery;
+ /**
+ * Bind an event handler to the "mouseup" JavaScript event.
+ *
+ * @param handler A function to execute when the event is triggered.
+ */
+ mouseup(handler: (eventObject: JQueryMouseEventObject) => any): JQuery;
+ /**
+ * Bind an event handler to the "mouseup" JavaScript event.
+ *
+ * @param eventData An object containing data that will be passed to the event handler.
+ * @param handler A function to execute when the event is triggered.
+ */
+ mouseup(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery;
+
+ /**
+ * Remove an event handler.
+ */
+ off(): JQuery;
+ /**
+ * Remove an event handler.
+ *
+ * @param events One or more space-separated event types and optional namespaces, or just namespaces, such as "click", "keydown.myPlugin", or ".myPlugin".
+ * @param selector A selector which should match the one originally passed to .on() when attaching event handlers.
+ * @param handler A handler function previously attached for the event(s), or the special value false.
+ */
+ off(events: string, selector?: string, handler?: (eventObject: JQueryEventObject) => any): JQuery;
+ /**
+ * Remove an event handler.
+ *
+ * @param events One or more space-separated event types and optional namespaces, or just namespaces, such as "click", "keydown.myPlugin", or ".myPlugin".
+ * @param handler A handler function previously attached for the event(s), or the special value false.
+ */
+ off(events: string, handler: (eventObject: JQueryEventObject) => any): JQuery;
+ /**
+ * Remove an event handler.
+ *
+ * @param events An object where the string keys represent one or more space-separated event types and optional namespaces, and the values represent handler functions previously attached for the event(s).
+ * @param selector A selector which should match the one originally passed to .on() when attaching event handlers.
+ */
+ off(events: { [key: string]: any; }, selector?: string): JQuery;
+
+ /**
+ * Attach an event handler function for one or more events to the selected elements.
+ *
+ * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin".
+ * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false. Rest parameter args is for optional parameters passed to jQuery.trigger(). Note that the actual parameters on the event handler function must be marked as optional (? syntax).
+ */
+ on(events: string, handler: (eventObject: JQueryEventObject, ...args: any[]) => any): JQuery;
+ /**
+ * Attach an event handler function for one or more events to the selected elements.
+ *
+ * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin".
+ * @param data Data to be passed to the handler in event.data when an event is triggered.
+ * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false.
+ */
+ on(events: string, data : any, handler: (eventObject: JQueryEventObject, ...args: any[]) => any): JQuery;
+ /**
+ * Attach an event handler function for one or more events to the selected elements.
+ *
+ * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin".
+ * @param selector A selector string to filter the descendants of the selected elements that trigger the event. If the selector is null or omitted, the event is always triggered when it reaches the selected element.
+ * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false.
+ */
+ on(events: string, selector: string, handler: (eventObject: JQueryEventObject, ...eventData: any[]) => any): JQuery;
+ /**
+ * Attach an event handler function for one or more events to the selected elements.
+ *
+ * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin".
+ * @param selector A selector string to filter the descendants of the selected elements that trigger the event. If the selector is null or omitted, the event is always triggered when it reaches the selected element.
+ * @param data Data to be passed to the handler in event.data when an event is triggered.
+ * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false.
+ */
+ on(events: string, selector: string, data: any, handler: (eventObject: JQueryEventObject, ...eventData: any[]) => any): JQuery;
+ /**
+ * Attach an event handler function for one or more events to the selected elements.
+ *
+ * @param events An object in which the string keys represent one or more space-separated event types and optional namespaces, and the values represent a handler function to be called for the event(s).
+ * @param selector A selector string to filter the descendants of the selected elements that will call the handler. If the selector is null or omitted, the handler is always called when it reaches the selected element.
+ * @param data Data to be passed to the handler in event.data when an event occurs.
+ */
+ on(events: { [key: string]: any; }, selector?: string, data?: any): JQuery;
+ /**
+ * Attach an event handler function for one or more events to the selected elements.
+ *
+ * @param events An object in which the string keys represent one or more space-separated event types and optional namespaces, and the values represent a handler function to be called for the event(s).
+ * @param data Data to be passed to the handler in event.data when an event occurs.
+ */
+ on(events: { [key: string]: any; }, data?: any): JQuery;
+
+ /**
+ * Attach a handler to an event for the elements. The handler is executed at most once per element per event type.
+ *
+ * @param events A string containing one or more JavaScript event types, such as "click" or "submit," or custom event names.
+ * @param handler A function to execute at the time the event is triggered.
+ */
+ one(events: string, handler: (eventObject: JQueryEventObject) => any): JQuery;
+ /**
+ * Attach a handler to an event for the elements. The handler is executed at most once per element per event type.
+ *
+ * @param events A string containing one or more JavaScript event types, such as "click" or "submit," or custom event names.
+ * @param data An object containing data that will be passed to the event handler.
+ * @param handler A function to execute at the time the event is triggered.
+ */
+ one(events: string, data: Object, handler: (eventObject: JQueryEventObject) => any): JQuery;
+
+ /**
+ * Attach a handler to an event for the elements. The handler is executed at most once per element per event type.
+ *
+ * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin".
+ * @param selector A selector string to filter the descendants of the selected elements that trigger the event. If the selector is null or omitted, the event is always triggered when it reaches the selected element.
+ * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false.
+ */
+ one(events: string, selector: string, handler: (eventObject: JQueryEventObject) => any): JQuery;
+ /**
+ * Attach a handler to an event for the elements. The handler is executed at most once per element per event type.
+ *
+ * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin".
+ * @param selector A selector string to filter the descendants of the selected elements that trigger the event. If the selector is null or omitted, the event is always triggered when it reaches the selected element.
+ * @param data Data to be passed to the handler in event.data when an event is triggered.
+ * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false.
+ */
+ one(events: string, selector: string, data: any, handler: (eventObject: JQueryEventObject) => any): JQuery;
+
+ /**
+ * Attach a handler to an event for the elements. The handler is executed at most once per element per event type.
+ *
+ * @param events An object in which the string keys represent one or more space-separated event types and optional namespaces, and the values represent a handler function to be called for the event(s).
+ * @param selector A selector string to filter the descendants of the selected elements that will call the handler. If the selector is null or omitted, the handler is always called when it reaches the selected element.
+ * @param data Data to be passed to the handler in event.data when an event occurs.
+ */
+ one(events: { [key: string]: any; }, selector?: string, data?: any): JQuery;
+
+ /**
+ * Attach a handler to an event for the elements. The handler is executed at most once per element per event type.
+ *
+ * @param events An object in which the string keys represent one or more space-separated event types and optional namespaces, and the values represent a handler function to be called for the event(s).
+ * @param data Data to be passed to the handler in event.data when an event occurs.
+ */
+ one(events: { [key: string]: any; }, data?: any): JQuery;
+
+
+ /**
+ * Specify a function to execute when the DOM is fully loaded.
+ *
+ * @param handler A function to execute after the DOM is ready.
+ */
+ ready(handler: (jQueryAlias?: JQueryStatic) => any): JQuery;
+
+ /**
+ * Trigger the "resize" event on an element.
+ */
+ resize(): JQuery;
+ /**
+ * Bind an event handler to the "resize" JavaScript event.
+ *
+ * @param handler A function to execute each time the event is triggered.
+ */
+ resize(handler: (eventObject: JQueryEventObject) => any): JQuery;
+ /**
+ * Bind an event handler to the "resize" JavaScript event.
+ *
+ * @param eventData An object containing data that will be passed to the event handler.
+ * @param handler A function to execute each time the event is triggered.
+ */
+ resize(eventData: Object, handler: (eventObject: JQueryEventObject) => any): JQuery;
+
+ /**
+ * Trigger the "scroll" event on an element.
+ */
+ scroll(): JQuery;
+ /**
+ * Bind an event handler to the "scroll" JavaScript event.
+ *
+ * @param handler A function to execute each time the event is triggered.
+ */
+ scroll(handler: (eventObject: JQueryEventObject) => any): JQuery;
+ /**
+ * Bind an event handler to the "scroll" JavaScript event.
+ *
+ * @param eventData An object containing data that will be passed to the event handler.
+ * @param handler A function to execute each time the event is triggered.
+ */
+ scroll(eventData: Object, handler: (eventObject: JQueryEventObject) => any): JQuery;
+
+ /**
+ * Trigger the "select" event on an element.
+ */
+ select(): JQuery;
+ /**
+ * Bind an event handler to the "select" JavaScript event.
+ *
+ * @param handler A function to execute each time the event is triggered.
+ */
+ select(handler: (eventObject: JQueryEventObject) => any): JQuery;
+ /**
+ * Bind an event handler to the "select" JavaScript event.
+ *
+ * @param eventData An object containing data that will be passed to the event handler.
+ * @param handler A function to execute each time the event is triggered.
+ */
+ select(eventData: Object, handler: (eventObject: JQueryEventObject) => any): JQuery;
+
+ /**
+ * Trigger the "submit" event on an element.
+ */
+ submit(): JQuery;
+ /**
+ * Bind an event handler to the "submit" JavaScript event
+ *
+ * @param handler A function to execute each time the event is triggered.
+ */
+ submit(handler: (eventObject: JQueryEventObject) => any): JQuery;
+ /**
+ * Bind an event handler to the "submit" JavaScript event
+ *
+ * @param eventData An object containing data that will be passed to the event handler.
+ * @param handler A function to execute each time the event is triggered.
+ */
+ submit(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery;
+
+ /**
+ * Execute all handlers and behaviors attached to the matched elements for the given event type.
+ *
+ * @param eventType A string containing a JavaScript event type, such as click or submit.
+ * @param extraParameters Additional parameters to pass along to the event handler.
+ */
+ trigger(eventType: string, extraParameters?: any[]|Object): JQuery;
+ /**
+ * Execute all handlers and behaviors attached to the matched elements for the given event type.
+ *
+ * @param event A jQuery.Event object.
+ * @param extraParameters Additional parameters to pass along to the event handler.
+ */
+ trigger(event: JQueryEventObject, extraParameters?: any[]|Object): JQuery;
+
+ /**
+ * Execute all handlers attached to an element for an event.
+ *
+ * @param eventType A string containing a JavaScript event type, such as click or submit.
+ * @param extraParameters An array of additional parameters to pass along to the event handler.
+ */
+ triggerHandler(eventType: string, ...extraParameters: any[]): Object;
+
+ /**
+ * Execute all handlers attached to an element for an event.
+ *
+ * @param event A jQuery.Event object.
+ * @param extraParameters An array of additional parameters to pass along to the event handler.
+ */
+ triggerHandler(event: JQueryEventObject, ...extraParameters: any[]): Object;
+
+ /**
+ * Remove a previously-attached event handler from the elements.
+ *
+ * @param eventType A string containing a JavaScript event type, such as click or submit.
+ * @param handler The function that is to be no longer executed.
+ */
+ unbind(eventType?: string, handler?: (eventObject: JQueryEventObject) => any): JQuery;
+ /**
+ * Remove a previously-attached event handler from the elements.
+ *
+ * @param eventType A string containing a JavaScript event type, such as click or submit.
+ * @param fls Unbinds the corresponding 'return false' function that was bound using .bind( eventType, false ).
+ */
+ unbind(eventType: string, fls: boolean): JQuery;
+ /**
+ * Remove a previously-attached event handler from the elements.
+ *
+ * @param evt A JavaScript event object as passed to an event handler.
+ */
+ unbind(evt: any): JQuery;
+
+ /**
+ * Remove a handler from the event for all elements which match the current selector, based upon a specific set of root elements.
+ */
+ undelegate(): JQuery;
+ /**
+ * Remove a handler from the event for all elements which match the current selector, based upon a specific set of root elements.
+ *
+ * @param selector A selector which will be used to filter the event results.
+ * @param eventType A string containing a JavaScript event type, such as "click" or "keydown"
+ * @param handler A function to execute at the time the event is triggered.
+ */
+ undelegate(selector: string, eventType: string, handler?: (eventObject: JQueryEventObject) => any): JQuery;
+ /**
+ * Remove a handler from the event for all elements which match the current selector, based upon a specific set of root elements.
+ *
+ * @param selector A selector which will be used to filter the event results.
+ * @param events An object of one or more event types and previously bound functions to unbind from them.
+ */
+ undelegate(selector: string, events: Object): JQuery;
+ /**
+ * Remove a handler from the event for all elements which match the current selector, based upon a specific set of root elements.
+ *
+ * @param namespace A string containing a namespace to unbind all events from.
+ */
+ undelegate(namespace: string): JQuery;
+
+ /**
+ * Bind an event handler to the "unload" JavaScript event. (DEPRECATED from v1.8)
+ *
+ * @param handler A function to execute when the event is triggered.
+ */
+ unload(handler: (eventObject: JQueryEventObject) => any): JQuery;
+ /**
+ * Bind an event handler to the "unload" JavaScript event. (DEPRECATED from v1.8)
+ *
+ * @param eventData A plain object of data that will be passed to the event handler.
+ * @param handler A function to execute when the event is triggered.
+ */
+ unload(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery;
+
+ /**
+ * The DOM node context originally passed to jQuery(); if none was passed then context will likely be the document. (DEPRECATED from v1.10)
+ */
+ context: Element;
+
+ jquery: string;
+
+ /**
+ * Bind an event handler to the "error" JavaScript event. (DEPRECATED from v1.8)
+ *
+ * @param handler A function to execute when the event is triggered.
+ */
+ error(handler: (eventObject: JQueryEventObject) => any): JQuery;
+ /**
+ * Bind an event handler to the "error" JavaScript event. (DEPRECATED from v1.8)
+ *
+ * @param eventData A plain object of data that will be passed to the event handler.
+ * @param handler A function to execute when the event is triggered.
+ */
+ error(eventData: any, handler: (eventObject: JQueryEventObject) => any): JQuery;
+
+ /**
+ * Add a collection of DOM elements onto the jQuery stack.
+ *
+ * @param elements An array of elements to push onto the stack and make into a new jQuery object.
+ */
+ pushStack(elements: any[]): JQuery;
+ /**
+ * Add a collection of DOM elements onto the jQuery stack.
+ *
+ * @param elements An array of elements to push onto the stack and make into a new jQuery object.
+ * @param name The name of a jQuery method that generated the array of elements.
+ * @param arguments The arguments that were passed in to the jQuery method (for serialization).
+ */
+ pushStack(elements: any[], name: string, arguments: any[]): JQuery;
+
+ /**
+ * Insert content, specified by the parameter, after each element in the set of matched elements.
+ *
+ * param content1 HTML string, DOM element, array of elements, or jQuery object to insert after each element in the set of matched elements.
+ * param content2 One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert after each element in the set of matched elements.
+ */
+ after(content1: JQuery|any[]|Element|Text|string, ...content2: any[]): JQuery;
+ /**
+ * Insert content, specified by the parameter, after each element in the set of matched elements.
+ *
+ * param func A function that returns an HTML string, DOM element(s), or jQuery object to insert after each element in the set of matched elements. Receives the index position of the element in the set as an argument. Within the function, this refers to the current element in the set.
+ */
+ after(func: (index: number, html: string) => string|Element|JQuery): JQuery;
+
+ /**
+ * Insert content, specified by the parameter, to the end of each element in the set of matched elements.
+ *
+ * param content1 DOM element, array of elements, HTML string, or jQuery object to insert at the end of each element in the set of matched elements.
+ * param content2 One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert at the end of each element in the set of matched elements.
+ */
+ append(content1: JQuery|any[]|Element|Text|string, ...content2: any[]): JQuery;
+ /**
+ * Insert content, specified by the parameter, to the end of each element in the set of matched elements.
+ *
+ * param func A function that returns an HTML string, DOM element(s), or jQuery object to insert at the end of each element in the set of matched elements. Receives the index position of the element in the set and the old HTML value of the element as arguments. Within the function, this refers to the current element in the set.
+ */
+ append(func: (index: number, html: string) => string|Element|JQuery): JQuery;
+
+ /**
+ * Insert every element in the set of matched elements to the end of the target.
+ *
+ * @param target A selector, element, HTML string, array of elements, or jQuery object; the matched set of elements will be inserted at the end of the element(s) specified by this parameter.
+ */
+ appendTo(target: JQuery|any[]|Element|string): JQuery;
+
+ /**
+ * Insert content, specified by the parameter, before each element in the set of matched elements.
+ *
+ * param content1 HTML string, DOM element, array of elements, or jQuery object to insert before each element in the set of matched elements.
+ * param content2 One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert before each element in the set of matched elements.
+ */
+ before(content1: JQuery|any[]|Element|Text|string, ...content2: any[]): JQuery;
+ /**
+ * Insert content, specified by the parameter, before each element in the set of matched elements.
+ *
+ * param func A function that returns an HTML string, DOM element(s), or jQuery object to insert before each element in the set of matched elements. Receives the index position of the element in the set as an argument. Within the function, this refers to the current element in the set.
+ */
+ before(func: (index: number, html: string) => string|Element|JQuery): JQuery;
+
+ /**
+ * Create a deep copy of the set of matched elements.
+ *
+ * param withDataAndEvents A Boolean indicating whether event handlers and data should be copied along with the elements. The default value is false.
+ * param deepWithDataAndEvents A Boolean indicating whether event handlers and data for all children of the cloned element should be copied. By default its value matches the first argument's value (which defaults to false).
+ */
+ clone(withDataAndEvents?: boolean, deepWithDataAndEvents?: boolean): JQuery;
+
+ /**
+ * Remove the set of matched elements from the DOM.
+ *
+ * param selector A selector expression that filters the set of matched elements to be removed.
+ */
+ detach(selector?: string): JQuery;
+
+ /**
+ * Remove all child nodes of the set of matched elements from the DOM.
+ */
+ empty(): JQuery;
+
+ /**
+ * Insert every element in the set of matched elements after the target.
+ *
+ * param target A selector, element, array of elements, HTML string, or jQuery object; the matched set of elements will be inserted after the element(s) specified by this parameter.
+ */
+ insertAfter(target: JQuery|any[]|Element|Text|string): JQuery;
+
+ /**
+ * Insert every element in the set of matched elements before the target.
+ *
+ * param target A selector, element, array of elements, HTML string, or jQuery object; the matched set of elements will be inserted before the element(s) specified by this parameter.
+ */
+ insertBefore(target: JQuery|any[]|Element|Text|string): JQuery;
+
+ /**
+ * Insert content, specified by the parameter, to the beginning of each element in the set of matched elements.
+ *
+ * param content1 DOM element, array of elements, HTML string, or jQuery object to insert at the beginning of each element in the set of matched elements.
+ * param content2 One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert at the beginning of each element in the set of matched elements.
+ */
+ prepend(content1: JQuery|any[]|Element|Text|string, ...content2: any[]): JQuery;
+ /**
+ * Insert content, specified by the parameter, to the beginning of each element in the set of matched elements.
+ *
+ * param func A function that returns an HTML string, DOM element(s), or jQuery object to insert at the beginning of each element in the set of matched elements. Receives the index position of the element in the set and the old HTML value of the element as arguments. Within the function, this refers to the current element in the set.
+ */
+ prepend(func: (index: number, html: string) => string|Element|JQuery): JQuery;
+
+ /**
+ * Insert every element in the set of matched elements to the beginning of the target.
+ *
+ * @param target A selector, element, HTML string, array of elements, or jQuery object; the matched set of elements will be inserted at the beginning of the element(s) specified by this parameter.
+ */
+ prependTo(target: JQuery|any[]|Element|string): JQuery;
+
+ /**
+ * Remove the set of matched elements from the DOM.
+ *
+ * @param selector A selector expression that filters the set of matched elements to be removed.
+ */
+ remove(selector?: string): JQuery;
+
+ /**
+ * Replace each target element with the set of matched elements.
+ *
+ * @param target A selector string, jQuery object, DOM element, or array of elements indicating which element(s) to replace.
+ */
+ replaceAll(target: JQuery|any[]|Element|string): JQuery;
+
+ /**
+ * Replace each element in the set of matched elements with the provided new content and return the set of elements that was removed.
+ *
+ * param newContent The content to insert. May be an HTML string, DOM element, array of DOM elements, or jQuery object.
+ */
+ replaceWith(newContent: JQuery|any[]|Element|Text|string): JQuery;
+ /**
+ * Replace each element in the set of matched elements with the provided new content and return the set of elements that was removed.
+ *
+ * param func A function that returns content with which to replace the set of matched elements.
+ */
+ replaceWith(func: () => Element|JQuery): JQuery;
+
+ /**
+ * Get the combined text contents of each element in the set of matched elements, including their descendants.
+ */
+ text(): string;
+ /**
+ * Set the content of each element in the set of matched elements to the specified text.
+ *
+ * @param text The text to set as the content of each matched element. When Number or Boolean is supplied, it will be converted to a String representation.
+ */
+ text(text: string|number|boolean): JQuery;
+ /**
+ * Set the content of each element in the set of matched elements to the specified text.
+ *
+ * @param func A function returning the text content to set. Receives the index position of the element in the set and the old text value as arguments.
+ */
+ text(func: (index: number, text: string) => string): JQuery;
+
+ /**
+ * Retrieve all the elements contained in the jQuery set, as an array.
+ */
+ toArray(): any[];
+
+ /**
+ * Remove the parents of the set of matched elements from the DOM, leaving the matched elements in their place.
+ */
+ unwrap(): JQuery;
+
+ /**
+ * Wrap an HTML structure around each element in the set of matched elements.
+ *
+ * @param wrappingElement A selector, element, HTML string, or jQuery object specifying the structure to wrap around the matched elements.
+ */
+ wrap(wrappingElement: JQuery|Element|string): JQuery;
+ /**
+ * Wrap an HTML structure around each element in the set of matched elements.
+ *
+ * @param func A callback function returning the HTML content or jQuery object to wrap around the matched elements. Receives the index position of the element in the set as an argument. Within the function, this refers to the current element in the set.
+ */
+ wrap(func: (index: number) => string|JQuery): JQuery;
+
+ /**
+ * Wrap an HTML structure around all elements in the set of matched elements.
+ *
+ * @param wrappingElement A selector, element, HTML string, or jQuery object specifying the structure to wrap around the matched elements.
+ */
+ wrapAll(wrappingElement: JQuery|Element|string): JQuery;
+ wrapAll(func: (index: number) => string): JQuery;
+
+ /**
+ * Wrap an HTML structure around the content of each element in the set of matched elements.
+ *
+ * @param wrappingElement An HTML snippet, selector expression, jQuery object, or DOM element specifying the structure to wrap around the content of the matched elements.
+ */
+ wrapInner(wrappingElement: JQuery|Element|string): JQuery;
+ /**
+ * Wrap an HTML structure around the content of each element in the set of matched elements.
+ *
+ * @param func A callback function which generates a structure to wrap around the content of the matched elements. Receives the index position of the element in the set as an argument. Within the function, this refers to the current element in the set.
+ */
+ wrapInner(func: (index: number) => string): JQuery;
+
+ /**
+ * Iterate over a jQuery object, executing a function for each matched element.
+ *
+ * @param func A function to execute for each matched element.
+ */
+ each(func: (index: number, elem: Element) => any): JQuery;
+
+ /**
+ * Retrieve one of the elements matched by the jQuery object.
+ *
+ * @param index A zero-based integer indicating which element to retrieve.
+ */
+ get(index: number): HTMLElement;
+ /**
+ * Retrieve the elements matched by the jQuery object.
+ */
+ get(): any[];
+
+ /**
+ * Search for a given element from among the matched elements.
+ */
+ index(): number;
+ /**
+ * Search for a given element from among the matched elements.
+ *
+ * @param selector A selector representing a jQuery collection in which to look for an element.
+ */
+ index(selector: string|JQuery|Element): number;
+
+ /**
+ * The number of elements in the jQuery object.
+ */
+ length: number;
+ /**
+ * A selector representing selector passed to jQuery(), if any, when creating the original set.
+ * version deprecated: 1.7, removed: 1.9
+ */
+ selector: string;
+ [index: string]: any;
+ [index: number]: HTMLElement;
+
+ /**
+ * Add elements to the set of matched elements.
+ *
+ * @param selector A string representing a selector expression to find additional elements to add to the set of matched elements.
+ * @param context The point in the document at which the selector should begin matching; similar to the context argument of the $(selector, context) method.
+ */
+ add(selector: string, context?: Element): JQuery;
+ /**
+ * Add elements to the set of matched elements.
+ *
+ * @param elements One or more elements to add to the set of matched elements.
+ */
+ add(...elements: Element[]): JQuery;
+ /**
+ * Add elements to the set of matched elements.
+ *
+ * @param html An HTML fragment to add to the set of matched elements.
+ */
+ add(html: string): JQuery;
+ /**
+ * Add elements to the set of matched elements.
+ *
+ * @param obj An existing jQuery object to add to the set of matched elements.
+ */
+ add(obj: JQuery): JQuery;
+
+ /**
+ * Get the children of each element in the set of matched elements, optionally filtered by a selector.
+ *
+ * @param selector A string containing a selector expression to match elements against.
+ */
+ children(selector?: string): JQuery;
+
+ /**
+ * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree.
+ *
+ * @param selector A string containing a selector expression to match elements against.
+ */
+ closest(selector: string): JQuery;
+ /**
+ * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree.
+ *
+ * @param selector A string containing a selector expression to match elements against.
+ * @param context A DOM element within which a matching element may be found. If no context is passed in then the context of the jQuery set will be used instead.
+ */
+ closest(selector: string, context?: Element): JQuery;
+ /**
+ * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree.
+ *
+ * @param obj A jQuery object to match elements against.
+ */
+ closest(obj: JQuery): JQuery;
+ /**
+ * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree.
+ *
+ * @param element An element to match elements against.
+ */
+ closest(element: Element): JQuery;
+
+ /**
+ * Get an array of all the elements and selectors matched against the current element up through the DOM tree.
+ *
+ * @param selectors An array or string containing a selector expression to match elements against (can also be a jQuery object).
+ * @param context A DOM element within which a matching element may be found. If no context is passed in then the context of the jQuery set will be used instead.
+ */
+ closest(selectors: any, context?: Element): any[];
+
+ /**
+ * Get the children of each element in the set of matched elements, including text and comment nodes.
+ */
+ contents(): JQuery;
+
+ /**
+ * End the most recent filtering operation in the current chain and return the set of matched elements to its previous state.
+ */
+ end(): JQuery;
+
+ /**
+ * Reduce the set of matched elements to the one at the specified index.
+ *
+ * @param index An integer indicating the 0-based position of the element. OR An integer indicating the position of the element, counting backwards from the last element in the set.
+ *
+ */
+ eq(index: number): JQuery;
+
+ /**
+ * Reduce the set of matched elements to those that match the selector or pass the function's test.
+ *
+ * @param selector A string containing a selector expression to match the current set of elements against.
+ */
+ filter(selector: string): JQuery;
+ /**
+ * Reduce the set of matched elements to those that match the selector or pass the function's test.
+ *
+ * @param func A function used as a test for each element in the set. this is the current DOM element.
+ */
+ filter(func: (index: number, element: Element) => any): JQuery;
+ /**
+ * Reduce the set of matched elements to those that match the selector or pass the function's test.
+ *
+ * @param element An element to match the current set of elements against.
+ */
+ filter(element: Element): JQuery;
+ /**
+ * Reduce the set of matched elements to those that match the selector or pass the function's test.
+ *
+ * @param obj An existing jQuery object to match the current set of elements against.
+ */
+ filter(obj: JQuery): JQuery;
+
+ /**
+ * Get the descendants of each element in the current set of matched elements, filtered by a selector, jQuery object, or element.
+ *
+ * @param selector A string containing a selector expression to match elements against.
+ */
+ find(selector: string): JQuery;
+ /**
+ * Get the descendants of each element in the current set of matched elements, filtered by a selector, jQuery object, or element.
+ *
+ * @param element An element to match elements against.
+ */
+ find(element: Element): JQuery;
+ /**
+ * Get the descendants of each element in the current set of matched elements, filtered by a selector, jQuery object, or element.
+ *
+ * @param obj A jQuery object to match elements against.
+ */
+ find(obj: JQuery): JQuery;
+
+ /**
+ * Reduce the set of matched elements to the first in the set.
+ */
+ first(): JQuery;
+
+ /**
+ * Reduce the set of matched elements to those that have a descendant that matches the selector or DOM element.
+ *
+ * @param selector A string containing a selector expression to match elements against.
+ */
+ has(selector: string): JQuery;
+ /**
+ * Reduce the set of matched elements to those that have a descendant that matches the selector or DOM element.
+ *
+ * @param contained A DOM element to match elements against.
+ */
+ has(contained: Element): JQuery;
+
+ /**
+ * Check the current matched set of elements against a selector, element, or jQuery object and return true if at least one of these elements matches the given arguments.
+ *
+ * @param selector A string containing a selector expression to match elements against.
+ */
+ is(selector: string): boolean;
+ /**
+ * Check the current matched set of elements against a selector, element, or jQuery object and return true if at least one of these elements matches the given arguments.
+ *
+ * @param func A function used as a test for the set of elements. It accepts one argument, index, which is the element's index in the jQuery collection.Within the function, this refers to the current DOM element.
+ */
+ is(func: (index: number, element: Element) => boolean): boolean;
+ /**
+ * Check the current matched set of elements against a selector, element, or jQuery object and return true if at least one of these elements matches the given arguments.
+ *
+ * @param obj An existing jQuery object to match the current set of elements against.
+ */
+ is(obj: JQuery): boolean;
+ /**
+ * Check the current matched set of elements against a selector, element, or jQuery object and return true if at least one of these elements matches the given arguments.
+ *
+ * @param elements One or more elements to match the current set of elements against.
+ */
+ is(elements: any): boolean;
+
+ /**
+ * Reduce the set of matched elements to the final one in the set.
+ */
+ last(): JQuery;
+
+ /**
+ * Pass each element in the current matched set through a function, producing a new jQuery object containing the return values.
+ *
+ * @param callback A function object that will be invoked for each element in the current set.
+ */
+ map(callback: (index: number, domElement: Element) => any): JQuery;
+
+ /**
+ * Get the immediately following sibling of each element in the set of matched elements. If a selector is provided, it retrieves the next sibling only if it matches that selector.
+ *
+ * @param selector A string containing a selector expression to match elements against.
+ */
+ next(selector?: string): JQuery;
+
+ /**
+ * Get all following siblings of each element in the set of matched elements, optionally filtered by a selector.
+ *
+ * @param selector A string containing a selector expression to match elements against.
+ */
+ nextAll(selector?: string): JQuery;
+
+ /**
+ * Get all following siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object passed.
+ *
+ * @param selector A string containing a selector expression to indicate where to stop matching following sibling elements.
+ * @param filter A string containing a selector expression to match elements against.
+ */
+ nextUntil(selector?: string, filter?: string): JQuery;
+ /**
+ * Get all following siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object passed.
+ *
+ * @param element A DOM node or jQuery object indicating where to stop matching following sibling elements.
+ * @param filter A string containing a selector expression to match elements against.
+ */
+ nextUntil(element?: Element, filter?: string): JQuery;
+ /**
+ * Get all following siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object passed.
+ *
+ * @param obj A DOM node or jQuery object indicating where to stop matching following sibling elements.
+ * @param filter A string containing a selector expression to match elements against.
+ */
+ nextUntil(obj?: JQuery, filter?: string): JQuery;
+
+ /**
+ * Remove elements from the set of matched elements.
+ *
+ * @param selector A string containing a selector expression to match elements against.
+ */
+ not(selector: string): JQuery;
+ /**
+ * Remove elements from the set of matched elements.
+ *
+ * @param func A function used as a test for each element in the set. this is the current DOM element.
+ */
+ not(func: (index: number, element: Element) => boolean): JQuery;
+ /**
+ * Remove elements from the set of matched elements.
+ *
+ * @param elements One or more DOM elements to remove from the matched set.
+ */
+ not(elements: Element|Element[]): JQuery;
+ /**
+ * Remove elements from the set of matched elements.
+ *
+ * @param obj An existing jQuery object to match the current set of elements against.
+ */
+ not(obj: JQuery): JQuery;
+
+ /**
+ * Get the closest ancestor element that is positioned.
+ */
+ offsetParent(): JQuery;
+
+ /**
+ * Get the parent of each element in the current set of matched elements, optionally filtered by a selector.
+ *
+ * @param selector A string containing a selector expression to match elements against.
+ */
+ parent(selector?: string): JQuery;
+
+ /**
+ * Get the ancestors of each element in the current set of matched elements, optionally filtered by a selector.
+ *
+ * @param selector A string containing a selector expression to match elements against.
+ */
+ parents(selector?: string): JQuery;
+
+ /**
+ * Get the ancestors of each element in the current set of matched elements, up to but not including the element matched by the selector, DOM node, or jQuery object.
+ *
+ * @param selector A string containing a selector expression to indicate where to stop matching ancestor elements.
+ * @param filter A string containing a selector expression to match elements against.
+ */
+ parentsUntil(selector?: string, filter?: string): JQuery;
+ /**
+ * Get the ancestors of each element in the current set of matched elements, up to but not including the element matched by the selector, DOM node, or jQuery object.
+ *
+ * @param element A DOM node or jQuery object indicating where to stop matching ancestor elements.
+ * @param filter A string containing a selector expression to match elements against.
+ */
+ parentsUntil(element?: Element, filter?: string): JQuery;
+ /**
+ * Get the ancestors of each element in the current set of matched elements, up to but not including the element matched by the selector, DOM node, or jQuery object.
+ *
+ * @param obj A DOM node or jQuery object indicating where to stop matching ancestor elements.
+ * @param filter A string containing a selector expression to match elements against.
+ */
+ parentsUntil(obj?: JQuery, filter?: string): JQuery;
+
+ /**
+ * Get the immediately preceding sibling of each element in the set of matched elements, optionally filtered by a selector.
+ *
+ * @param selector A string containing a selector expression to match elements against.
+ */
+ prev(selector?: string): JQuery;
+
+ /**
+ * Get all preceding siblings of each element in the set of matched elements, optionally filtered by a selector.
+ *
+ * @param selector A string containing a selector expression to match elements against.
+ */
+ prevAll(selector?: string): JQuery;
+
+ /**
+ * Get all preceding siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object.
+ *
+ * @param selector A string containing a selector expression to indicate where to stop matching preceding sibling elements.
+ * @param filter A string containing a selector expression to match elements against.
+ */
+ prevUntil(selector?: string, filter?: string): JQuery;
+ /**
+ * Get all preceding siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object.
+ *
+ * @param element A DOM node or jQuery object indicating where to stop matching preceding sibling elements.
+ * @param filter A string containing a selector expression to match elements against.
+ */
+ prevUntil(element?: Element, filter?: string): JQuery;
+ /**
+ * Get all preceding siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object.
+ *
+ * @param obj A DOM node or jQuery object indicating where to stop matching preceding sibling elements.
+ * @param filter A string containing a selector expression to match elements against.
+ */
+ prevUntil(obj?: JQuery, filter?: string): JQuery;
+
+ /**
+ * Get the siblings of each element in the set of matched elements, optionally filtered by a selector.
+ *
+ * @param selector A string containing a selector expression to match elements against.
+ */
+ siblings(selector?: string): JQuery;
+
+ /**
+ * Reduce the set of matched elements to a subset specified by a range of indices.
+ *
+ * @param start An integer indicating the 0-based position at which the elements begin to be selected. If negative, it indicates an offset from the end of the set.
+ * @param end An integer indicating the 0-based position at which the elements stop being selected. If negative, it indicates an offset from the end of the set. If omitted, the range continues until the end of the set.
+ */
+ slice(start: number, end?: number): JQuery;
+
+ /**
+ * Show the queue of functions to be executed on the matched elements.
+ *
+ * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue.
+ */
+ queue(queueName?: string): any[];
+ /**
+ * Manipulate the queue of functions to be executed, once for each matched element.
+ *
+ * @param newQueue An array of functions to replace the current queue contents.
+ */
+ queue(newQueue: Function[]): JQuery;
+ /**
+ * Manipulate the queue of functions to be executed, once for each matched element.
+ *
+ * @param callback The new function to add to the queue, with a function to call that will dequeue the next item.
+ */
+ queue(callback: Function): JQuery;
+ /**
+ * Manipulate the queue of functions to be executed, once for each matched element.
+ *
+ * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue.
+ * @param newQueue An array of functions to replace the current queue contents.
+ */
+ queue(queueName: string, newQueue: Function[]): JQuery;
+ /**
+ * Manipulate the queue of functions to be executed, once for each matched element.
+ *
+ * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue.
+ * @param callback The new function to add to the queue, with a function to call that will dequeue the next item.
+ */
+ queue(queueName: string, callback: Function): JQuery;
+}
+declare module "jquery" {
+ export = $;
+}
+declare var jQuery: JQueryStatic;
+declare var $: JQueryStatic;
diff --git a/lib/decl/lib.es6.d.ts b/lib/decl/lib.es6.d.ts
new file mode 100644
index 000000000..084ed4e8a
--- /dev/null
+++ b/lib/decl/lib.es6.d.ts
@@ -0,0 +1,20674 @@
+/*! *****************************************************************************
+Copyright (c) Microsoft Corporation. All rights reserved.
+Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+this file except in compliance with the License. You may obtain a copy of the
+License at http://www.apache.org/licenses/LICENSE-2.0
+
+THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
+WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
+MERCHANTABLITY OR NON-INFRINGEMENT.
+
+See the Apache Version 2.0 License for specific language governing permissions
+and limitations under the License.
+***************************************************************************** */
+
+/// <reference no-default-lib="true"/>
+/////////////////////////////
+/// ECMAScript APIs
+/////////////////////////////
+
+declare const NaN: number;
+declare const Infinity: number;
+
+/**
+ * Evaluates JavaScript code and executes it.
+ * @param x A String value that contains valid JavaScript code.
+ */
+declare function eval(x: string): any;
+
+/**
+ * Converts A string to an integer.
+ * @param s A string to convert into a number.
+ * @param radix A value between 2 and 36 that specifies the base of the number in numString.
+ * If this argument is not supplied, strings with a prefix of '0x' are considered hexadecimal.
+ * All other strings are considered decimal.
+ */
+declare function parseInt(s: string, radix?: number): number;
+
+/**
+ * Converts a string to a floating-point number.
+ * @param string A string that contains a floating-point number.
+ */
+declare function parseFloat(string: string): number;
+
+/**
+ * Returns a Boolean value that indicates whether a value is the reserved value NaN (not a number).
+ * @param number A numeric value.
+ */
+declare function isNaN(number: number): boolean;
+
+/**
+ * Determines whether a supplied number is finite.
+ * @param number Any numeric value.
+ */
+declare function isFinite(number: number): boolean;
+
+/**
+ * Gets the unencoded version of an encoded Uniform Resource Identifier (URI).
+ * @param encodedURI A value representing an encoded URI.
+ */
+declare function decodeURI(encodedURI: string): string;
+
+/**
+ * Gets the unencoded version of an encoded component of a Uniform Resource Identifier (URI).
+ * @param encodedURIComponent A value representing an encoded URI component.
+ */
+declare function decodeURIComponent(encodedURIComponent: string): string;
+
+/**
+ * Encodes a text string as a valid Uniform Resource Identifier (URI)
+ * @param uri A value representing an encoded URI.
+ */
+declare function encodeURI(uri: string): string;
+
+/**
+ * Encodes a text string as a valid component of a Uniform Resource Identifier (URI).
+ * @param uriComponent A value representing an encoded URI component.
+ */
+declare function encodeURIComponent(uriComponent: string): string;
+
+interface PropertyDescriptor {
+ configurable?: boolean;
+ enumerable?: boolean;
+ value?: any;
+ writable?: boolean;
+ get? (): any;
+ set? (v: any): void;
+}
+
+interface PropertyDescriptorMap {
+ [s: string]: PropertyDescriptor;
+}
+
+interface Object {
+ /** The initial value of Object.prototype.constructor is the standard built-in Object constructor. */
+ constructor: Function;
+
+ /** Returns a string representation of an object. */
+ toString(): string;
+
+ /** Returns a date converted to a string using the current locale. */
+ toLocaleString(): string;
+
+ /** Returns the primitive value of the specified object. */
+ valueOf(): Object;
+
+ /**
+ * Determines whether an object has a property with the specified name.
+ * @param v A property name.
+ */
+ hasOwnProperty(v: string): boolean;
+
+ /**
+ * Determines whether an object exists in another object's prototype chain.
+ * @param v Another object whose prototype chain is to be checked.
+ */
+ isPrototypeOf(v: Object): boolean;
+
+ /**
+ * Determines whether a specified property is enumerable.
+ * @param v A property name.
+ */
+ propertyIsEnumerable(v: string): boolean;
+}
+
+interface ObjectConstructor {
+ new (value?: any): Object;
+ (): any;
+ (value: any): any;
+
+ /** A reference to the prototype for a class of objects. */
+ readonly prototype: Object;
+
+ /**
+ * Returns the prototype of an object.
+ * @param o The object that references the prototype.
+ */
+ getPrototypeOf(o: any): any;
+
+ /**
+ * Gets the own property descriptor of the specified object.
+ * An own property descriptor is one that is defined directly on the object and is not inherited from the object's prototype.
+ * @param o Object that contains the property.
+ * @param p Name of the property.
+ */
+ getOwnPropertyDescriptor(o: any, p: string): PropertyDescriptor;
+
+ /**
+ * Returns the names of the own properties of an object. The own properties of an object are those that are defined directly
+ * on that object, and are not inherited from the object's prototype. The properties of an object include both fields (objects) and functions.
+ * @param o Object that contains the own properties.
+ */
+ getOwnPropertyNames(o: any): string[];
+
+ /**
+ * Creates an object that has null prototype.
+ * @param o Object to use as a prototype. May be null
+ */
+ create(o: null): any;
+
+ /**
+ * Creates an object that has the specified prototype, and that optionally contains specified properties.
+ * @param o Object to use as a prototype. May be null
+ */
+ create<T>(o: T): T;
+
+ /**
+ * Creates an object that has the specified prototype, and that optionally contains specified properties.
+ * @param o Object to use as a prototype. May be null
+ * @param properties JavaScript object that contains one or more property descriptors.
+ */
+ create(o: any, properties: PropertyDescriptorMap): any;
+
+ /**
+ * Adds a property to an object, or modifies attributes of an existing property.
+ * @param o Object on which to add or modify the property. This can be a native JavaScript object (that is, a user-defined object or a built in object) or a DOM object.
+ * @param p The property name.
+ * @param attributes Descriptor for the property. It can be for a data property or an accessor property.
+ */
+ defineProperty(o: any, p: string, attributes: PropertyDescriptor): any;
+
+ /**
+ * Adds one or more properties to an object, and/or modifies attributes of existing properties.
+ * @param o Object on which to add or modify the properties. This can be a native JavaScript object or a DOM object.
+ * @param properties JavaScript object that contains one or more descriptor objects. Each descriptor object describes a data property or an accessor property.
+ */
+ defineProperties(o: any, properties: PropertyDescriptorMap): any;
+
+ /**
+ * Prevents the modification of attributes of existing properties, and prevents the addition of new properties.
+ * @param o Object on which to lock the attributes.
+ */
+ seal<T>(o: T): T;
+
+ /**
+ * Prevents the modification of existing property attributes and values, and prevents the addition of new properties.
+ * @param o Object on which to lock the attributes.
+ */
+ freeze<T>(o: T): T;
+
+ /**
+ * Prevents the addition of new properties to an object.
+ * @param o Object to make non-extensible.
+ */
+ preventExtensions<T>(o: T): T;
+
+ /**
+ * Returns true if existing property attributes cannot be modified in an object and new properties cannot be added to the object.
+ * @param o Object to test.
+ */
+ isSealed(o: any): boolean;
+
+ /**
+ * Returns true if existing property attributes and values cannot be modified in an object, and new properties cannot be added to the object.
+ * @param o Object to test.
+ */
+ isFrozen(o: any): boolean;
+
+ /**
+ * Returns a value that indicates whether new properties can be added to an object.
+ * @param o Object to test.
+ */
+ isExtensible(o: any): boolean;
+
+ /**
+ * Returns the names of the enumerable properties and methods of an object.
+ * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object.
+ */
+ keys(o: any): string[];
+}
+
+/**
+ * Provides functionality common to all JavaScript objects.
+ */
+declare const Object: ObjectConstructor;
+
+/**
+ * Creates a new function.
+ */
+interface Function {
+ /**
+ * Calls the function, substituting the specified object for the this value of the function, and the specified array for the arguments of the function.
+ * @param thisArg The object to be used as the this object.
+ * @param argArray A set of arguments to be passed to the function.
+ */
+ apply(this: Function, thisArg: any, argArray?: any): any;
+
+ /**
+ * Calls a method of an object, substituting another object for the current object.
+ * @param thisArg The object to be used as the current object.
+ * @param argArray A list of arguments to be passed to the method.
+ */
+ call(this: Function, thisArg: any, ...argArray: any[]): any;
+
+ /**
+ * For a given function, creates a bound function that has the same body as the original function.
+ * The this object of the bound function is associated with the specified object, and has the specified initial parameters.
+ * @param thisArg An object to which the this keyword can refer inside the new function.
+ * @param argArray A list of arguments to be passed to the new function.
+ */
+ bind(this: Function, thisArg: any, ...argArray: any[]): any;
+
+ prototype: any;
+ readonly length: number;
+
+ // Non-standard extensions
+ arguments: any;
+ caller: Function;
+}
+
+interface FunctionConstructor {
+ /**
+ * Creates a new function.
+ * @param args A list of arguments the function accepts.
+ */
+ new (...args: string[]): Function;
+ (...args: string[]): Function;
+ readonly prototype: Function;
+}
+
+declare const Function: FunctionConstructor;
+
+interface IArguments {
+ [index: number]: any;
+ length: number;
+ callee: Function;
+}
+
+interface String {
+ /** Returns a string representation of a string. */
+ toString(): string;
+
+ /**
+ * Returns the character at the specified index.
+ * @param pos The zero-based index of the desired character.
+ */
+ charAt(pos: number): string;
+
+ /**
+ * Returns the Unicode value of the character at the specified location.
+ * @param index The zero-based index of the desired character. If there is no character at the specified index, NaN is returned.
+ */
+ charCodeAt(index: number): number;
+
+ /**
+ * Returns a string that contains the concatenation of two or more strings.
+ * @param strings The strings to append to the end of the string.
+ */
+ concat(...strings: string[]): string;
+
+ /**
+ * Returns the position of the first occurrence of a substring.
+ * @param searchString The substring to search for in the string
+ * @param position The index at which to begin searching the String object. If omitted, search starts at the beginning of the string.
+ */
+ indexOf(searchString: string, position?: number): number;
+
+ /**
+ * Returns the last occurrence of a substring in the string.
+ * @param searchString The substring to search for.
+ * @param position The index at which to begin searching. If omitted, the search begins at the end of the string.
+ */
+ lastIndexOf(searchString: string, position?: number): number;
+
+ /**
+ * Determines whether two strings are equivalent in the current locale.
+ * @param that String to compare to target string
+ */
+ localeCompare(that: string): number;
+
+ /**
+ * Matches a string with a regular expression, and returns an array containing the results of that search.
+ * @param regexp A variable name or string literal containing the regular expression pattern and flags.
+ */
+ match(regexp: string): RegExpMatchArray | null;
+
+ /**
+ * Matches a string with a regular expression, and returns an array containing the results of that search.
+ * @param regexp A regular expression object that contains the regular expression pattern and applicable flags.
+ */
+ match(regexp: RegExp): RegExpMatchArray | null;
+
+ /**
+ * Replaces text in a string, using a regular expression or search string.
+ * @param searchValue A string that represents the regular expression.
+ * @param replaceValue A string containing the text to replace for every successful match of searchValue in this string.
+ */
+ replace(searchValue: string, replaceValue: string): string;
+
+ /**
+ * Replaces text in a string, using a regular expression or search string.
+ * @param searchValue A string that represents the regular expression.
+ * @param replacer A function that returns the replacement text.
+ */
+ replace(searchValue: string, replacer: (substring: string, ...args: any[]) => string): string;
+
+ /**
+ * Replaces text in a string, using a regular expression or search string.
+ * @param searchValue A Regular Expression object containing the regular expression pattern and applicable flags.
+ * @param replaceValue A string containing the text to replace for every successful match of searchValue in this string.
+ */
+ replace(searchValue: RegExp, replaceValue: string): string;
+
+ /**
+ * Replaces text in a string, using a regular expression or search string.
+ * @param searchValue A Regular Expression object containing the regular expression pattern and applicable flags
+ * @param replacer A function that returns the replacement text.
+ */
+ replace(searchValue: RegExp, replacer: (substring: string, ...args: any[]) => string): string;
+
+ /**
+ * Finds the first substring match in a regular expression search.
+ * @param regexp The regular expression pattern and applicable flags.
+ */
+ search(regexp: string): number;
+
+ /**
+ * Finds the first substring match in a regular expression search.
+ * @param regexp The regular expression pattern and applicable flags.
+ */
+ search(regexp: RegExp): number;
+
+ /**
+ * Returns a section of a string.
+ * @param start The index to the beginning of the specified portion of stringObj.
+ * @param end The index to the end of the specified portion of stringObj. The substring includes the characters up to, but not including, the character indicated by end.
+ * If this value is not specified, the substring continues to the end of stringObj.
+ */
+ slice(start?: number, end?: number): string;
+
+ /**
+ * Split a string into substrings using the specified separator and return them as an array.
+ * @param separator A string that identifies character or characters to use in separating the string. If omitted, a single-element array containing the entire string is returned.
+ * @param limit A value used to limit the number of elements returned in the array.
+ */
+ split(separator: string, limit?: number): string[];
+
+ /**
+ * Split a string into substrings using the specified separator and return them as an array.
+ * @param separator A Regular Express that identifies character or characters to use in separating the string. If omitted, a single-element array containing the entire string is returned.
+ * @param limit A value used to limit the number of elements returned in the array.
+ */
+ split(separator: RegExp, limit?: number): string[];
+
+ /**
+ * Returns the substring at the specified location within a String object.
+ * @param start The zero-based index number indicating the beginning of the substring.
+ * @param end Zero-based index number indicating the end of the substring. The substring includes the characters up to, but not including, the character indicated by end.
+ * If end is omitted, the characters from start through the end of the original string are returned.
+ */
+ substring(start: number, end?: number): string;
+
+ /** Converts all the alphabetic characters in a string to lowercase. */
+ toLowerCase(): string;
+
+ /** Converts all alphabetic characters to lowercase, taking into account the host environment's current locale. */
+ toLocaleLowerCase(): string;
+
+ /** Converts all the alphabetic characters in a string to uppercase. */
+ toUpperCase(): string;
+
+ /** Returns a string where all alphabetic characters have been converted to uppercase, taking into account the host environment's current locale. */
+ toLocaleUpperCase(): string;
+
+ /** Removes the leading and trailing white space and line terminator characters from a string. */
+ trim(): string;
+
+ /** Returns the length of a String object. */
+ readonly length: number;
+
+ // IE extensions
+ /**
+ * Gets a substring beginning at the specified location and having the specified length.
+ * @param from The starting position of the desired substring. The index of the first character in the string is zero.
+ * @param length The number of characters to include in the returned substring.
+ */
+ substr(from: number, length?: number): string;
+
+ /** Returns the primitive value of the specified object. */
+ valueOf(): string;
+
+ readonly [index: number]: string;
+}
+
+interface StringConstructor {
+ new (value?: any): String;
+ (value?: any): string;
+ readonly prototype: String;
+ fromCharCode(...codes: number[]): string;
+}
+
+/**
+ * Allows manipulation and formatting of text strings and determination and location of substrings within strings.
+ */
+declare const String: StringConstructor;
+
+interface Boolean {
+ /** Returns the primitive value of the specified object. */
+ valueOf(): boolean;
+}
+
+interface BooleanConstructor {
+ new (value?: any): Boolean;
+ (value?: any): boolean;
+ readonly prototype: Boolean;
+}
+
+declare const Boolean: BooleanConstructor;
+
+interface Number {
+ /**
+ * Returns a string representation of an object.
+ * @param radix Specifies a radix for converting numeric values to strings. This value is only used for numbers.
+ */
+ toString(radix?: number): string;
+
+ /**
+ * Returns a string representing a number in fixed-point notation.
+ * @param fractionDigits Number of digits after the decimal point. Must be in the range 0 - 20, inclusive.
+ */
+ toFixed(fractionDigits?: number): string;
+
+ /**
+ * Returns a string containing a number represented in exponential notation.
+ * @param fractionDigits Number of digits after the decimal point. Must be in the range 0 - 20, inclusive.
+ */
+ toExponential(fractionDigits?: number): string;
+
+ /**
+ * Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.
+ * @param precision Number of significant digits. Must be in the range 1 - 21, inclusive.
+ */
+ toPrecision(precision?: number): string;
+
+ /** Returns the primitive value of the specified object. */
+ valueOf(): number;
+}
+
+interface NumberConstructor {
+ new (value?: any): Number;
+ (value?: any): number;
+ readonly prototype: Number;
+
+ /** The largest number that can be represented in JavaScript. Equal to approximately 1.79E+308. */
+ readonly MAX_VALUE: number;
+
+ /** The closest number to zero that can be represented in JavaScript. Equal to approximately 5.00E-324. */
+ readonly MIN_VALUE: number;
+
+ /**
+ * A value that is not a number.
+ * In equality comparisons, NaN does not equal any value, including itself. To test whether a value is equivalent to NaN, use the isNaN function.
+ */
+ readonly NaN: number;
+
+ /**
+ * A value that is less than the largest negative number that can be represented in JavaScript.
+ * JavaScript displays NEGATIVE_INFINITY values as -infinity.
+ */
+ readonly NEGATIVE_INFINITY: number;
+
+ /**
+ * A value greater than the largest number that can be represented in JavaScript.
+ * JavaScript displays POSITIVE_INFINITY values as infinity.
+ */
+ readonly POSITIVE_INFINITY: number;
+}
+
+/** An object that represents a number of any kind. All JavaScript numbers are 64-bit floating-point numbers. */
+declare const Number: NumberConstructor;
+
+interface TemplateStringsArray extends ReadonlyArray<string> {
+ readonly raw: ReadonlyArray<string>
+}
+
+interface Math {
+ /** The mathematical constant e. This is Euler's number, the base of natural logarithms. */
+ readonly E: number;
+ /** The natural logarithm of 10. */
+ readonly LN10: number;
+ /** The natural logarithm of 2. */
+ readonly LN2: number;
+ /** The base-2 logarithm of e. */
+ readonly LOG2E: number;
+ /** The base-10 logarithm of e. */
+ readonly LOG10E: number;
+ /** Pi. This is the ratio of the circumference of a circle to its diameter. */
+ readonly PI: number;
+ /** The square root of 0.5, or, equivalently, one divided by the square root of 2. */
+ readonly SQRT1_2: number;
+ /** The square root of 2. */
+ readonly SQRT2: number;
+ /**
+ * Returns the absolute value of a number (the value without regard to whether it is positive or negative).
+ * For example, the absolute value of -5 is the same as the absolute value of 5.
+ * @param x A numeric expression for which the absolute value is needed.
+ */
+ abs(x: number): number;
+ /**
+ * Returns the arc cosine (or inverse cosine) of a number.
+ * @param x A numeric expression.
+ */
+ acos(x: number): number;
+ /**
+ * Returns the arcsine of a number.
+ * @param x A numeric expression.
+ */
+ asin(x: number): number;
+ /**
+ * Returns the arctangent of a number.
+ * @param x A numeric expression for which the arctangent is needed.
+ */
+ atan(x: number): number;
+ /**
+ * Returns the angle (in radians) from the X axis to a point.
+ * @param y A numeric expression representing the cartesian y-coordinate.
+ * @param x A numeric expression representing the cartesian x-coordinate.
+ */
+ atan2(y: number, x: number): number;
+ /**
+ * Returns the smallest number greater than or equal to its numeric argument.
+ * @param x A numeric expression.
+ */
+ ceil(x: number): number;
+ /**
+ * Returns the cosine of a number.
+ * @param x A numeric expression that contains an angle measured in radians.
+ */
+ cos(x: number): number;
+ /**
+ * Returns e (the base of natural logarithms) raised to a power.
+ * @param x A numeric expression representing the power of e.
+ */
+ exp(x: number): number;
+ /**
+ * Returns the greatest number less than or equal to its numeric argument.
+ * @param x A numeric expression.
+ */
+ floor(x: number): number;
+ /**
+ * Returns the natural logarithm (base e) of a number.
+ * @param x A numeric expression.
+ */
+ log(x: number): number;
+ /**
+ * Returns the larger of a set of supplied numeric expressions.
+ * @param values Numeric expressions to be evaluated.
+ */
+ max(...values: number[]): number;
+ /**
+ * Returns the smaller of a set of supplied numeric expressions.
+ * @param values Numeric expressions to be evaluated.
+ */
+ min(...values: number[]): number;
+ /**
+ * Returns the value of a base expression taken to a specified power.
+ * @param x The base value of the expression.
+ * @param y The exponent value of the expression.
+ */
+ pow(x: number, y: number): number;
+ /** Returns a pseudorandom number between 0 and 1. */
+ random(): number;
+ /**
+ * Returns a supplied numeric expression rounded to the nearest number.
+ * @param x The value to be rounded to the nearest number.
+ */
+ round(x: number): number;
+ /**
+ * Returns the sine of a number.
+ * @param x A numeric expression that contains an angle measured in radians.
+ */
+ sin(x: number): number;
+ /**
+ * Returns the square root of a number.
+ * @param x A numeric expression.
+ */
+ sqrt(x: number): number;
+ /**
+ * Returns the tangent of a number.
+ * @param x A numeric expression that contains an angle measured in radians.
+ */
+ tan(x: number): number;
+}
+/** An intrinsic object that provides basic mathematics functionality and constants. */
+declare const Math: Math;
+
+/** Enables basic storage and retrieval of dates and times. */
+interface Date {
+ /** Returns a string representation of a date. The format of the string depends on the locale. */
+ toString(): string;
+ /** Returns a date as a string value. */
+ toDateString(): string;
+ /** Returns a time as a string value. */
+ toTimeString(): string;
+ /** Returns a value as a string value appropriate to the host environment's current locale. */
+ toLocaleString(): string;
+ /** Returns a date as a string value appropriate to the host environment's current locale. */
+ toLocaleDateString(): string;
+ /** Returns a time as a string value appropriate to the host environment's current locale. */
+ toLocaleTimeString(): string;
+ /** Returns the stored time value in milliseconds since midnight, January 1, 1970 UTC. */
+ valueOf(): number;
+ /** Gets the time value in milliseconds. */
+ getTime(): number;
+ /** Gets the year, using local time. */
+ getFullYear(): number;
+ /** Gets the year using Universal Coordinated Time (UTC). */
+ getUTCFullYear(): number;
+ /** Gets the month, using local time. */
+ getMonth(): number;
+ /** Gets the month of a Date object using Universal Coordinated Time (UTC). */
+ getUTCMonth(): number;
+ /** Gets the day-of-the-month, using local time. */
+ getDate(): number;
+ /** Gets the day-of-the-month, using Universal Coordinated Time (UTC). */
+ getUTCDate(): number;
+ /** Gets the day of the week, using local time. */
+ getDay(): number;
+ /** Gets the day of the week using Universal Coordinated Time (UTC). */
+ getUTCDay(): number;
+ /** Gets the hours in a date, using local time. */
+ getHours(): number;
+ /** Gets the hours value in a Date object using Universal Coordinated Time (UTC). */
+ getUTCHours(): number;
+ /** Gets the minutes of a Date object, using local time. */
+ getMinutes(): number;
+ /** Gets the minutes of a Date object using Universal Coordinated Time (UTC). */
+ getUTCMinutes(): number;
+ /** Gets the seconds of a Date object, using local time. */
+ getSeconds(): number;
+ /** Gets the seconds of a Date object using Universal Coordinated Time (UTC). */
+ getUTCSeconds(): number;
+ /** Gets the milliseconds of a Date, using local time. */
+ getMilliseconds(): number;
+ /** Gets the milliseconds of a Date object using Universal Coordinated Time (UTC). */
+ getUTCMilliseconds(): number;
+ /** Gets the difference in minutes between the time on the local computer and Universal Coordinated Time (UTC). */
+ getTimezoneOffset(): number;
+ /**
+ * Sets the date and time value in the Date object.
+ * @param time A numeric value representing the number of elapsed milliseconds since midnight, January 1, 1970 GMT.
+ */
+ setTime(time: number): number;
+ /**
+ * Sets the milliseconds value in the Date object using local time.
+ * @param ms A numeric value equal to the millisecond value.
+ */
+ setMilliseconds(ms: number): number;
+ /**
+ * Sets the milliseconds value in the Date object using Universal Coordinated Time (UTC).
+ * @param ms A numeric value equal to the millisecond value.
+ */
+ setUTCMilliseconds(ms: number): number;
+
+ /**
+ * Sets the seconds value in the Date object using local time.
+ * @param sec A numeric value equal to the seconds value.
+ * @param ms A numeric value equal to the milliseconds value.
+ */
+ setSeconds(sec: number, ms?: number): number;
+ /**
+ * Sets the seconds value in the Date object using Universal Coordinated Time (UTC).
+ * @param sec A numeric value equal to the seconds value.
+ * @param ms A numeric value equal to the milliseconds value.
+ */
+ setUTCSeconds(sec: number, ms?: number): number;
+ /**
+ * Sets the minutes value in the Date object using local time.
+ * @param min A numeric value equal to the minutes value.
+ * @param sec A numeric value equal to the seconds value.
+ * @param ms A numeric value equal to the milliseconds value.
+ */
+ setMinutes(min: number, sec?: number, ms?: number): number;
+ /**
+ * Sets the minutes value in the Date object using Universal Coordinated Time (UTC).
+ * @param min A numeric value equal to the minutes value.
+ * @param sec A numeric value equal to the seconds value.
+ * @param ms A numeric value equal to the milliseconds value.
+ */
+ setUTCMinutes(min: number, sec?: number, ms?: number): number;
+ /**
+ * Sets the hour value in the Date object using local time.
+ * @param hours A numeric value equal to the hours value.
+ * @param min A numeric value equal to the minutes value.
+ * @param sec A numeric value equal to the seconds value.
+ * @param ms A numeric value equal to the milliseconds value.
+ */
+ setHours(hours: number, min?: number, sec?: number, ms?: number): number;
+ /**
+ * Sets the hours value in the Date object using Universal Coordinated Time (UTC).
+ * @param hours A numeric value equal to the hours value.
+ * @param min A numeric value equal to the minutes value.
+ * @param sec A numeric value equal to the seconds value.
+ * @param ms A numeric value equal to the milliseconds value.
+ */
+ setUTCHours(hours: number, min?: number, sec?: number, ms?: number): number;
+ /**
+ * Sets the numeric day-of-the-month value of the Date object using local time.
+ * @param date A numeric value equal to the day of the month.
+ */
+ setDate(date: number): number;
+ /**
+ * Sets the numeric day of the month in the Date object using Universal Coordinated Time (UTC).
+ * @param date A numeric value equal to the day of the month.
+ */
+ setUTCDate(date: number): number;
+ /**
+ * Sets the month value in the Date object using local time.
+ * @param month A numeric value equal to the month. The value for January is 0, and other month values follow consecutively.
+ * @param date A numeric value representing the day of the month. If this value is not supplied, the value from a call to the getDate method is used.
+ */
+ setMonth(month: number, date?: number): number;
+ /**
+ * Sets the month value in the Date object using Universal Coordinated Time (UTC).
+ * @param month A numeric value equal to the month. The value for January is 0, and other month values follow consecutively.
+ * @param date A numeric value representing the day of the month. If it is not supplied, the value from a call to the getUTCDate method is used.
+ */
+ setUTCMonth(month: number, date?: number): number;
+ /**
+ * Sets the year of the Date object using local time.
+ * @param year A numeric value for the year.
+ * @param month A zero-based numeric value for the month (0 for January, 11 for December). Must be specified if numDate is specified.
+ * @param date A numeric value equal for the day of the month.
+ */
+ setFullYear(year: number, month?: number, date?: number): number;
+ /**
+ * Sets the year value in the Date object using Universal Coordinated Time (UTC).
+ * @param year A numeric value equal to the year.
+ * @param month A numeric value equal to the month. The value for January is 0, and other month values follow consecutively. Must be supplied if numDate is supplied.
+ * @param date A numeric value equal to the day of the month.
+ */
+ setUTCFullYear(year: number, month?: number, date?: number): number;
+ /** Returns a date converted to a string using Universal Coordinated Time (UTC). */
+ toUTCString(): string;
+ /** Returns a date as a string value in ISO format. */
+ toISOString(): string;
+ /** Used by the JSON.stringify method to enable the transformation of an object's data for JavaScript Object Notation (JSON) serialization. */
+ toJSON(key?: any): string;
+}
+
+interface DateConstructor {
+ new (): Date;
+ new (value: number): Date;
+ new (value: string): Date;
+ new (year: number, month: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number): Date;
+ (): string;
+ readonly prototype: Date;
+ /**
+ * Parses a string containing a date, and returns the number of milliseconds between that date and midnight, January 1, 1970.
+ * @param s A date string
+ */
+ parse(s: string): number;
+ /**
+ * Returns the number of milliseconds between midnight, January 1, 1970 Universal Coordinated Time (UTC) (or GMT) and the specified date.
+ * @param year The full year designation is required for cross-century date accuracy. If year is between 0 and 99 is used, then year is assumed to be 1900 + year.
+ * @param month The month as an number between 0 and 11 (January to December).
+ * @param date The date as an number between 1 and 31.
+ * @param hours Must be supplied if minutes is supplied. An number from 0 to 23 (midnight to 11pm) that specifies the hour.
+ * @param minutes Must be supplied if seconds is supplied. An number from 0 to 59 that specifies the minutes.
+ * @param seconds Must be supplied if milliseconds is supplied. An number from 0 to 59 that specifies the seconds.
+ * @param ms An number from 0 to 999 that specifies the milliseconds.
+ */
+ UTC(year: number, month: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number): number;
+ now(): number;
+}
+
+declare const Date: DateConstructor;
+
+interface RegExpMatchArray extends Array<string> {
+ index?: number;
+ input?: string;
+}
+
+interface RegExpExecArray extends Array<string> {
+ index: number;
+ input: string;
+}
+
+interface RegExp {
+ /**
+ * Executes a search on a string using a regular expression pattern, and returns an array containing the results of that search.
+ * @param string The String object or string literal on which to perform the search.
+ */
+ exec(string: string): RegExpExecArray | null;
+
+ /**
+ * Returns a Boolean value that indicates whether or not a pattern exists in a searched string.
+ * @param string String on which to perform the search.
+ */
+ test(string: string): boolean;
+
+ /** Returns a copy of the text of the regular expression pattern. Read-only. The regExp argument is a Regular expression object. It can be a variable name or a literal. */
+ readonly source: string;
+
+ /** Returns a Boolean value indicating the state of the global flag (g) used with a regular expression. Default is false. Read-only. */
+ readonly global: boolean;
+
+ /** Returns a Boolean value indicating the state of the ignoreCase flag (i) used with a regular expression. Default is false. Read-only. */
+ readonly ignoreCase: boolean;
+
+ /** Returns a Boolean value indicating the state of the multiline flag (m) used with a regular expression. Default is false. Read-only. */
+ readonly multiline: boolean;
+
+ lastIndex: number;
+
+ // Non-standard extensions
+ compile(): this;
+}
+
+interface RegExpConstructor {
+ new (pattern: RegExp): RegExp;
+ new (pattern: string, flags?: string): RegExp;
+ (pattern: RegExp): RegExp;
+ (pattern: string, flags?: string): RegExp;
+ readonly prototype: RegExp;
+
+ // Non-standard extensions
+ $1: string;
+ $2: string;
+ $3: string;
+ $4: string;
+ $5: string;
+ $6: string;
+ $7: string;
+ $8: string;
+ $9: string;
+ lastMatch: string;
+}
+
+declare const RegExp: RegExpConstructor;
+
+interface Error {
+ name: string;
+ message: string;
+ stack?: string;
+}
+
+interface ErrorConstructor {
+ new (message?: string): Error;
+ (message?: string): Error;
+ readonly prototype: Error;
+}
+
+declare const Error: ErrorConstructor;
+
+interface EvalError extends Error {
+}
+
+interface EvalErrorConstructor {
+ new (message?: string): EvalError;
+ (message?: string): EvalError;
+ readonly prototype: EvalError;
+}
+
+declare const EvalError: EvalErrorConstructor;
+
+interface RangeError extends Error {
+}
+
+interface RangeErrorConstructor {
+ new (message?: string): RangeError;
+ (message?: string): RangeError;
+ readonly prototype: RangeError;
+}
+
+declare const RangeError: RangeErrorConstructor;
+
+interface ReferenceError extends Error {
+}
+
+interface ReferenceErrorConstructor {
+ new (message?: string): ReferenceError;
+ (message?: string): ReferenceError;
+ readonly prototype: ReferenceError;
+}
+
+declare const ReferenceError: ReferenceErrorConstructor;
+
+interface SyntaxError extends Error {
+}
+
+interface SyntaxErrorConstructor {
+ new (message?: string): SyntaxError;
+ (message?: string): SyntaxError;
+ readonly prototype: SyntaxError;
+}
+
+declare const SyntaxError: SyntaxErrorConstructor;
+
+interface TypeError extends Error {
+}
+
+interface TypeErrorConstructor {
+ new (message?: string): TypeError;
+ (message?: string): TypeError;
+ readonly prototype: TypeError;
+}
+
+declare const TypeError: TypeErrorConstructor;
+
+interface URIError extends Error {
+}
+
+interface URIErrorConstructor {
+ new (message?: string): URIError;
+ (message?: string): URIError;
+ readonly prototype: URIError;
+}
+
+declare const URIError: URIErrorConstructor;
+
+interface JSON {
+ /**
+ * Converts a JavaScript Object Notation (JSON) string into an object.
+ * @param text A valid JSON string.
+ * @param reviver A function that transforms the results. This function is called for each member of the object.
+ * If a member contains nested objects, the nested objects are transformed before the parent object is.
+ */
+ parse(text: string, reviver?: (key: any, value: any) => any): any;
+ /**
+ * Converts a JavaScript value to a JavaScript Object Notation (JSON) string.
+ * @param value A JavaScript value, usually an object or array, to be converted.
+ * @param replacer A function that transforms the results.
+ * @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read.
+ */
+ stringify(value: any, replacer?: (key: string, value: any) => any, space?: string | number): string;
+ /**
+ * Converts a JavaScript value to a JavaScript Object Notation (JSON) string.
+ * @param value A JavaScript value, usually an object or array, to be converted.
+ * @param replacer An array of strings and numbers that acts as a approved list for selecting the object properties that will be stringified.
+ * @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read.
+ */
+ stringify(value: any, replacer?: (number | string)[] | null, space?: string | number): string;
+}
+
+/**
+ * An intrinsic object that provides functions to convert JavaScript values to and from the JavaScript Object Notation (JSON) format.
+ */
+declare const JSON: JSON;
+
+
+/////////////////////////////
+/// ECMAScript Array API (specially handled by compiler)
+/////////////////////////////
+
+interface ReadonlyArray<T> {
+ /**
+ * Gets the length of the array. This is a number one higher than the highest element defined in an array.
+ */
+ readonly length: number;
+ /**
+ * Returns a string representation of an array.
+ */
+ toString(): string;
+ toLocaleString(): string;
+ /**
+ * Combines two or more arrays.
+ * @param items Additional items to add to the end of array1.
+ */
+ concat<U extends ReadonlyArray<T>>(...items: U[]): T[];
+ /**
+ * Combines two or more arrays.
+ * @param items Additional items to add to the end of array1.
+ */
+ concat(...items: T[][]): T[];
+ /**
+ * Combines two or more arrays.
+ * @param items Additional items to add to the end of array1.
+ */
+ concat(...items: (T | T[])[]): T[];
+ /**
+ * Adds all the elements of an array separated by the specified separator string.
+ * @param separator A string used to separate one element of an array from the next in the resulting String. If omitted, the array elements are separated with a comma.
+ */
+ join(separator?: string): string;
+ /**
+ * Returns a section of an array.
+ * @param start The beginning of the specified portion of the array.
+ * @param end The end of the specified portion of the array.
+ */
+ slice(start?: number, end?: number): T[];
+ /**
+ * Returns the index of the first occurrence of a value in an array.
+ * @param searchElement The value to locate in the array.
+ * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at index 0.
+ */
+ indexOf(searchElement: T, fromIndex?: number): number;
+
+ /**
+ * Returns the index of the last occurrence of a specified value in an array.
+ * @param searchElement The value to locate in the array.
+ * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at the last index in the array.
+ */
+ lastIndexOf(searchElement: T, fromIndex?: number): number;
+ /**
+ * Determines whether all the members of an array satisfy the specified test.
+ * @param callbackfn A function that accepts up to three arguments. The every method calls the callbackfn function for each element in array1 until the callbackfn returns false, or until the end of the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
+ */
+ every(callbackfn: (value: T, index: number, array: ReadonlyArray<T>) => boolean, thisArg?: any): boolean;
+ /**
+ * Determines whether the specified callback function returns true for any element of an array.
+ * @param callbackfn A function that accepts up to three arguments. The some method calls the callbackfn function for each element in array1 until the callbackfn returns true, or until the end of the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
+ */
+ some(callbackfn: (value: T, index: number, array: ReadonlyArray<T>) => boolean, thisArg?: any): boolean;
+ /**
+ * Performs the specified action for each element in an array.
+ * @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
+ */
+ forEach(callbackfn: (value: T, index: number, array: ReadonlyArray<T>) => void, thisArg?: any): void;
+ /**
+ * Calls a defined callback function on each element of an array, and returns an array that contains the results.
+ * @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
+ */
+ map<U>(callbackfn: (value: T, index: number, array: ReadonlyArray<T>) => U, thisArg?: any): U[];
+ /**
+ * Returns the elements of an array that meet the condition specified in a callback function.
+ * @param callbackfn A function that accepts up to three arguments. The filter method calls the callbackfn function one time for each element in the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
+ */
+ filter(callbackfn: (value: T, index: number, array: ReadonlyArray<T>) => any, thisArg?: any): T[];
+ /**
+ * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.
+ */
+ reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: ReadonlyArray<T>) => T, initialValue?: T): T;
+ /**
+ * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.
+ */
+ reduce<U>(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: ReadonlyArray<T>) => U, initialValue: U): U;
+ /**
+ * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.
+ */
+ reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: ReadonlyArray<T>) => T, initialValue?: T): T;
+ /**
+ * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.
+ */
+ reduceRight<U>(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: ReadonlyArray<T>) => U, initialValue: U): U;
+
+ readonly [n: number]: T;
+}
+
+interface Array<T> {
+ /**
+ * Gets or sets the length of the array. This is a number one higher than the highest element defined in an array.
+ */
+ length: number;
+ /**
+ * Returns a string representation of an array.
+ */
+ toString(): string;
+ toLocaleString(): string;
+ /**
+ * Appends new elements to an array, and returns the new length of the array.
+ * @param items New elements of the Array.
+ */
+ push(...items: T[]): number;
+ /**
+ * Removes the last element from an array and returns it.
+ */
+ pop(): T | undefined;
+ /**
+ * Combines two or more arrays.
+ * @param items Additional items to add to the end of array1.
+ */
+ concat(...items: T[][]): T[];
+ /**
+ * Combines two or more arrays.
+ * @param items Additional items to add to the end of array1.
+ */
+ concat(...items: (T | T[])[]): T[];
+ /**
+ * Adds all the elements of an array separated by the specified separator string.
+ * @param separator A string used to separate one element of an array from the next in the resulting String. If omitted, the array elements are separated with a comma.
+ */
+ join(separator?: string): string;
+ /**
+ * Reverses the elements in an Array.
+ */
+ reverse(): T[];
+ /**
+ * Removes the first element from an array and returns it.
+ */
+ shift(): T | undefined;
+ /**
+ * Returns a section of an array.
+ * @param start The beginning of the specified portion of the array.
+ * @param end The end of the specified portion of the array.
+ */
+ slice(start?: number, end?: number): T[];
+ /**
+ * Sorts an array.
+ * @param compareFn The name of the function used to determine the order of the elements. If omitted, the elements are sorted in ascending, ASCII character order.
+ */
+ sort(compareFn?: (a: T, b: T) => number): this;
+ /**
+ * Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements.
+ * @param start The zero-based location in the array from which to start removing elements.
+ */
+ splice(start: number): T[];
+ /**
+ * Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements.
+ * @param start The zero-based location in the array from which to start removing elements.
+ * @param deleteCount The number of elements to remove.
+ * @param items Elements to insert into the array in place of the deleted elements.
+ */
+ splice(start: number, deleteCount: number, ...items: T[]): T[];
+ /**
+ * Inserts new elements at the start of an array.
+ * @param items Elements to insert at the start of the Array.
+ */
+ unshift(...items: T[]): number;
+ /**
+ * Returns the index of the first occurrence of a value in an array.
+ * @param searchElement The value to locate in the array.
+ * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at index 0.
+ */
+ indexOf(searchElement: T, fromIndex?: number): number;
+ /**
+ * Returns the index of the last occurrence of a specified value in an array.
+ * @param searchElement The value to locate in the array.
+ * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at the last index in the array.
+ */
+ lastIndexOf(searchElement: T, fromIndex?: number): number;
+ /**
+ * Determines whether all the members of an array satisfy the specified test.
+ * @param callbackfn A function that accepts up to three arguments. The every method calls the callbackfn function for each element in array1 until the callbackfn returns false, or until the end of the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
+ */
+ every(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): boolean;
+ /**
+ * Determines whether the specified callback function returns true for any element of an array.
+ * @param callbackfn A function that accepts up to three arguments. The some method calls the callbackfn function for each element in array1 until the callbackfn returns true, or until the end of the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
+ */
+ some(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): boolean;
+ /**
+ * Performs the specified action for each element in an array.
+ * @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
+ */
+ forEach(callbackfn: (value: T, index: number, array: T[]) => void, thisArg?: any): void;
+ /**
+ * Calls a defined callback function on each element of an array, and returns an array that contains the results.
+ * @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
+ */
+ map<U>(callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): U[];
+ /**
+ * Returns the elements of an array that meet the condition specified in a callback function.
+ * @param callbackfn A function that accepts up to three arguments. The filter method calls the callbackfn function one time for each element in the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
+ */
+ filter(callbackfn: (value: T, index: number, array: T[]) => any, thisArg?: any): T[];
+ /**
+ * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.
+ */
+ reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T;
+ /**
+ * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.
+ */
+ reduce<U>(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U;
+ /**
+ * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.
+ */
+ reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T;
+ /**
+ * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.
+ */
+ reduceRight<U>(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U;
+
+ [n: number]: T;
+}
+
+interface ArrayConstructor {
+ new (arrayLength?: number): any[];
+ new <T>(arrayLength: number): T[];
+ new <T>(...items: T[]): T[];
+ (arrayLength?: number): any[];
+ <T>(arrayLength: number): T[];
+ <T>(...items: T[]): T[];
+ isArray(arg: any): arg is Array<any>;
+ readonly prototype: Array<any>;
+}
+
+declare const Array: ArrayConstructor;
+
+interface TypedPropertyDescriptor<T> {
+ enumerable?: boolean;
+ configurable?: boolean;
+ writable?: boolean;
+ value?: T;
+ get?: () => T;
+ set?: (value: T) => void;
+}
+
+declare type ClassDecorator = <TFunction extends Function>(target: TFunction) => TFunction | void;
+declare type PropertyDecorator = (target: Object, propertyKey: string | symbol) => void;
+declare type MethodDecorator = <T>(target: Object, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor<T>) => TypedPropertyDescriptor<T> | void;
+declare type ParameterDecorator = (target: Object, propertyKey: string | symbol, parameterIndex: number) => void;
+
+declare type PromiseConstructorLike = new <T>(executor: (resolve: (value?: T | PromiseLike<T>) => void, reject: (reason?: any) => void) => void) => PromiseLike<T>;
+
+interface PromiseLike<T> {
+ /**
+ * Attaches callbacks for the resolution and/or rejection of the Promise.
+ * @param onfulfilled The callback to execute when the Promise is resolved.
+ * @param onrejected The callback to execute when the Promise is rejected.
+ * @returns A Promise for the completion of which ever callback is executed.
+ */
+ then<TResult>(onfulfilled?: (value: T) => TResult | PromiseLike<TResult>, onrejected?: (reason: any) => TResult | PromiseLike<TResult>): PromiseLike<TResult>;
+ then<TResult>(onfulfilled?: (value: T) => TResult | PromiseLike<TResult>, onrejected?: (reason: any) => void): PromiseLike<TResult>;
+}
+
+interface ArrayLike<T> {
+ readonly length: number;
+ readonly [n: number]: T;
+}
+
+/**
+ * Represents a raw buffer of binary data, which is used to store data for the
+ * different typed arrays. ArrayBuffers cannot be read from or written to directly,
+ * but can be passed to a typed array or DataView Object to interpret the raw
+ * buffer as needed.
+ */
+interface ArrayBuffer {
+ /**
+ * Read-only. The length of the ArrayBuffer (in bytes).
+ */
+ readonly byteLength: number;
+
+ /**
+ * Returns a section of an ArrayBuffer.
+ */
+ slice(begin:number, end?:number): ArrayBuffer;
+}
+
+interface ArrayBufferConstructor {
+ readonly prototype: ArrayBuffer;
+ new (byteLength: number): ArrayBuffer;
+ isView(arg: any): arg is ArrayBufferView;
+}
+declare const ArrayBuffer: ArrayBufferConstructor;
+
+interface ArrayBufferView {
+ /**
+ * The ArrayBuffer instance referenced by the array.
+ */
+ buffer: ArrayBuffer;
+
+ /**
+ * The length in bytes of the array.
+ */
+ byteLength: number;
+
+ /**
+ * The offset in bytes of the array.
+ */
+ byteOffset: number;
+}
+
+interface DataView {
+ readonly buffer: ArrayBuffer;
+ readonly byteLength: number;
+ readonly byteOffset: number;
+ /**
+ * Gets the Float32 value at the specified byte offset from the start of the view. There is
+ * no alignment constraint; multi-byte values may be fetched from any offset.
+ * @param byteOffset The place in the buffer at which the value should be retrieved.
+ */
+ getFloat32(byteOffset: number, littleEndian?: boolean): number;
+
+ /**
+ * Gets the Float64 value at the specified byte offset from the start of the view. There is
+ * no alignment constraint; multi-byte values may be fetched from any offset.
+ * @param byteOffset The place in the buffer at which the value should be retrieved.
+ */
+ getFloat64(byteOffset: number, littleEndian?: boolean): number;
+
+ /**
+ * Gets the Int8 value at the specified byte offset from the start of the view. There is
+ * no alignment constraint; multi-byte values may be fetched from any offset.
+ * @param byteOffset The place in the buffer at which the value should be retrieved.
+ */
+ getInt8(byteOffset: number): number;
+
+ /**
+ * Gets the Int16 value at the specified byte offset from the start of the view. There is
+ * no alignment constraint; multi-byte values may be fetched from any offset.
+ * @param byteOffset The place in the buffer at which the value should be retrieved.
+ */
+ getInt16(byteOffset: number, littleEndian?: boolean): number;
+ /**
+ * Gets the Int32 value at the specified byte offset from the start of the view. There is
+ * no alignment constraint; multi-byte values may be fetched from any offset.
+ * @param byteOffset The place in the buffer at which the value should be retrieved.
+ */
+ getInt32(byteOffset: number, littleEndian?: boolean): number;
+
+ /**
+ * Gets the Uint8 value at the specified byte offset from the start of the view. There is
+ * no alignment constraint; multi-byte values may be fetched from any offset.
+ * @param byteOffset The place in the buffer at which the value should be retrieved.
+ */
+ getUint8(byteOffset: number): number;
+
+ /**
+ * Gets the Uint16 value at the specified byte offset from the start of the view. There is
+ * no alignment constraint; multi-byte values may be fetched from any offset.
+ * @param byteOffset The place in the buffer at which the value should be retrieved.
+ */
+ getUint16(byteOffset: number, littleEndian?: boolean): number;
+
+ /**
+ * Gets the Uint32 value at the specified byte offset from the start of the view. There is
+ * no alignment constraint; multi-byte values may be fetched from any offset.
+ * @param byteOffset The place in the buffer at which the value should be retrieved.
+ */
+ getUint32(byteOffset: number, littleEndian?: boolean): number;
+
+ /**
+ * Stores an Float32 value at the specified byte offset from the start of the view.
+ * @param byteOffset The place in the buffer at which the value should be set.
+ * @param value The value to set.
+ * @param littleEndian If false or undefined, a big-endian value should be written,
+ * otherwise a little-endian value should be written.
+ */
+ setFloat32(byteOffset: number, value: number, littleEndian?: boolean): void;
+
+ /**
+ * Stores an Float64 value at the specified byte offset from the start of the view.
+ * @param byteOffset The place in the buffer at which the value should be set.
+ * @param value The value to set.
+ * @param littleEndian If false or undefined, a big-endian value should be written,
+ * otherwise a little-endian value should be written.
+ */
+ setFloat64(byteOffset: number, value: number, littleEndian?: boolean): void;
+
+ /**
+ * Stores an Int8 value at the specified byte offset from the start of the view.
+ * @param byteOffset The place in the buffer at which the value should be set.
+ * @param value The value to set.
+ */
+ setInt8(byteOffset: number, value: number): void;
+
+ /**
+ * Stores an Int16 value at the specified byte offset from the start of the view.
+ * @param byteOffset The place in the buffer at which the value should be set.
+ * @param value The value to set.
+ * @param littleEndian If false or undefined, a big-endian value should be written,
+ * otherwise a little-endian value should be written.
+ */
+ setInt16(byteOffset: number, value: number, littleEndian?: boolean): void;
+
+ /**
+ * Stores an Int32 value at the specified byte offset from the start of the view.
+ * @param byteOffset The place in the buffer at which the value should be set.
+ * @param value The value to set.
+ * @param littleEndian If false or undefined, a big-endian value should be written,
+ * otherwise a little-endian value should be written.
+ */
+ setInt32(byteOffset: number, value: number, littleEndian?: boolean): void;
+
+ /**
+ * Stores an Uint8 value at the specified byte offset from the start of the view.
+ * @param byteOffset The place in the buffer at which the value should be set.
+ * @param value The value to set.
+ */
+ setUint8(byteOffset: number, value: number): void;
+
+ /**
+ * Stores an Uint16 value at the specified byte offset from the start of the view.
+ * @param byteOffset The place in the buffer at which the value should be set.
+ * @param value The value to set.
+ * @param littleEndian If false or undefined, a big-endian value should be written,
+ * otherwise a little-endian value should be written.
+ */
+ setUint16(byteOffset: number, value: number, littleEndian?: boolean): void;
+
+ /**
+ * Stores an Uint32 value at the specified byte offset from the start of the view.
+ * @param byteOffset The place in the buffer at which the value should be set.
+ * @param value The value to set.
+ * @param littleEndian If false or undefined, a big-endian value should be written,
+ * otherwise a little-endian value should be written.
+ */
+ setUint32(byteOffset: number, value: number, littleEndian?: boolean): void;
+}
+
+interface DataViewConstructor {
+ new (buffer: ArrayBuffer, byteOffset?: number, byteLength?: number): DataView;
+}
+declare const DataView: DataViewConstructor;
+
+/**
+ * A typed array of 8-bit integer values. The contents are initialized to 0. If the requested
+ * number of bytes could not be allocated an exception is raised.
+ */
+interface Int8Array {
+ /**
+ * The size in bytes of each element in the array.
+ */
+ readonly BYTES_PER_ELEMENT: number;
+
+ /**
+ * The ArrayBuffer instance referenced by the array.
+ */
+ readonly buffer: ArrayBuffer;
+
+ /**
+ * The length in bytes of the array.
+ */
+ readonly byteLength: number;
+
+ /**
+ * The offset in bytes of the array.
+ */
+ readonly byteOffset: number;
+
+ /**
+ * Returns the this object after copying a section of the array identified by start and end
+ * to the same array starting at position target
+ * @param target If target is negative, it is treated as length+target where length is the
+ * length of the array.
+ * @param start If start is negative, it is treated as length+start. If end is negative, it
+ * is treated as length+end.
+ * @param end If not specified, length of the this object is used as its default value.
+ */
+ copyWithin(target: number, start: number, end?: number): this;
+
+ /**
+ * Determines whether all the members of an array satisfy the specified test.
+ * @param callbackfn A function that accepts up to three arguments. The every method calls
+ * the callbackfn function for each element in array1 until the callbackfn returns false,
+ * or until the end of the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ every(callbackfn: (value: number, index: number, array: Int8Array) => boolean, thisArg?: any): boolean;
+
+ /**
+ * Returns the this object after filling the section identified by start and end with value
+ * @param value value to fill array section with
+ * @param start index to start filling the array at. If start is negative, it is treated as
+ * length+start where length is the length of the array.
+ * @param end index to stop filling the array at. If end is negative, it is treated as
+ * length+end.
+ */
+ fill(value: number, start?: number, end?: number): this;
+
+ /**
+ * Returns the elements of an array that meet the condition specified in a callback function.
+ * @param callbackfn A function that accepts up to three arguments. The filter method calls
+ * the callbackfn function one time for each element in the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ filter(callbackfn: (value: number, index: number, array: Int8Array) => any, thisArg?: any): Int8Array;
+
+ /**
+ * Returns the value of the first element in the array where predicate is true, and undefined
+ * otherwise.
+ * @param predicate find calls predicate once for each element of the array, in ascending
+ * order, until it finds one where predicate returns true. If such an element is found, find
+ * immediately returns that element value. Otherwise, find returns undefined.
+ * @param thisArg If provided, it will be used as the this value for each invocation of
+ * predicate. If it is not provided, undefined is used instead.
+ */
+ find(predicate: (value: number, index: number, obj: Array<number>) => boolean, thisArg?: any): number | undefined;
+
+ /**
+ * Returns the index of the first element in the array where predicate is true, and undefined
+ * otherwise.
+ * @param predicate find calls predicate once for each element of the array, in ascending
+ * order, until it finds one where predicate returns true. If such an element is found,
+ * findIndex immediately returns that element index. Otherwise, findIndex returns -1.
+ * @param thisArg If provided, it will be used as the this value for each invocation of
+ * predicate. If it is not provided, undefined is used instead.
+ */
+ findIndex(predicate: (value: number) => boolean, thisArg?: any): number;
+
+ /**
+ * Performs the specified action for each element in an array.
+ * @param callbackfn A function that accepts up to three arguments. forEach calls the
+ * callbackfn function one time for each element in the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ forEach(callbackfn: (value: number, index: number, array: Int8Array) => void, thisArg?: any): void;
+
+ /**
+ * Returns the index of the first occurrence of a value in an array.
+ * @param searchElement The value to locate in the array.
+ * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
+ * search starts at index 0.
+ */
+ indexOf(searchElement: number, fromIndex?: number): number;
+
+ /**
+ * Adds all the elements of an array separated by the specified separator string.
+ * @param separator A string used to separate one element of an array from the next in the
+ * resulting String. If omitted, the array elements are separated with a comma.
+ */
+ join(separator?: string): string;
+
+ /**
+ * Returns the index of the last occurrence of a value in an array.
+ * @param searchElement The value to locate in the array.
+ * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
+ * search starts at index 0.
+ */
+ lastIndexOf(searchElement: number, fromIndex?: number): number;
+
+ /**
+ * The length of the array.
+ */
+ readonly length: number;
+
+ /**
+ * Calls a defined callback function on each element of an array, and returns an array that
+ * contains the results.
+ * @param callbackfn A function that accepts up to three arguments. The map method calls the
+ * callbackfn function one time for each element in the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ map(callbackfn: (value: number, index: number, array: Int8Array) => number, thisArg?: any): Int8Array;
+
+ /**
+ * Calls the specified callback function for all the elements in an array. The return value of
+ * the callback function is the accumulated result, and is provided as an argument in the next
+ * call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
+ * callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
+ * the accumulation. The first call to the callbackfn function provides this value as an argument
+ * instead of an array value.
+ */
+ reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int8Array) => number, initialValue?: number): number;
+
+ /**
+ * Calls the specified callback function for all the elements in an array. The return value of
+ * the callback function is the accumulated result, and is provided as an argument in the next
+ * call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
+ * callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
+ * the accumulation. The first call to the callbackfn function provides this value as an argument
+ * instead of an array value.
+ */
+ reduce<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int8Array) => U, initialValue: U): U;
+
+ /**
+ * Calls the specified callback function for all the elements in an array, in descending order.
+ * The return value of the callback function is the accumulated result, and is provided as an
+ * argument in the next call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
+ * the callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
+ * the accumulation. The first call to the callbackfn function provides this value as an
+ * argument instead of an array value.
+ */
+ reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int8Array) => number, initialValue?: number): number;
+
+ /**
+ * Calls the specified callback function for all the elements in an array, in descending order.
+ * The return value of the callback function is the accumulated result, and is provided as an
+ * argument in the next call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
+ * the callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
+ * the accumulation. The first call to the callbackfn function provides this value as an argument
+ * instead of an array value.
+ */
+ reduceRight<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int8Array) => U, initialValue: U): U;
+
+ /**
+ * Reverses the elements in an Array.
+ */
+ reverse(): Int8Array;
+
+ /**
+ * Sets a value or an array of values.
+ * @param index The index of the location to set.
+ * @param value The value to set.
+ */
+ set(index: number, value: number): void;
+
+ /**
+ * Sets a value or an array of values.
+ * @param array A typed or untyped array of values to set.
+ * @param offset The index in the current array at which the values are to be written.
+ */
+ set(array: ArrayLike<number>, offset?: number): void;
+
+ /**
+ * Returns a section of an array.
+ * @param start The beginning of the specified portion of the array.
+ * @param end The end of the specified portion of the array.
+ */
+ slice(start?: number, end?: number): Int8Array;
+
+ /**
+ * Determines whether the specified callback function returns true for any element of an array.
+ * @param callbackfn A function that accepts up to three arguments. The some method calls the
+ * callbackfn function for each element in array1 until the callbackfn returns true, or until
+ * the end of the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ some(callbackfn: (value: number, index: number, array: Int8Array) => boolean, thisArg?: any): boolean;
+
+ /**
+ * Sorts an array.
+ * @param compareFn The name of the function used to determine the order of the elements. If
+ * omitted, the elements are sorted in ascending, ASCII character order.
+ */
+ sort(compareFn?: (a: number, b: number) => number): this;
+
+ /**
+ * Gets a new Int8Array view of the ArrayBuffer store for this array, referencing the elements
+ * at begin, inclusive, up to end, exclusive.
+ * @param begin The index of the beginning of the array.
+ * @param end The index of the end of the array.
+ */
+ subarray(begin: number, end?: number): Int8Array;
+
+ /**
+ * Converts a number to a string by using the current locale.
+ */
+ toLocaleString(): string;
+
+ /**
+ * Returns a string representation of an array.
+ */
+ toString(): string;
+
+ [index: number]: number;
+}
+interface Int8ArrayConstructor {
+ readonly prototype: Int8Array;
+ new (length: number): Int8Array;
+ new (array: ArrayLike<number>): Int8Array;
+ new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Int8Array;
+
+ /**
+ * The size in bytes of each element in the array.
+ */
+ readonly BYTES_PER_ELEMENT: number;
+
+ /**
+ * Returns a new array from a set of elements.
+ * @param items A set of elements to include in the new array object.
+ */
+ of(...items: number[]): Int8Array;
+
+ /**
+ * Creates an array from an array-like or iterable object.
+ * @param arrayLike An array-like or iterable object to convert to an array.
+ * @param mapfn A mapping function to call on every element of the array.
+ * @param thisArg Value of 'this' used to invoke the mapfn.
+ */
+ from(arrayLike: ArrayLike<number>, mapfn?: (v: number, k: number) => number, thisArg?: any): Int8Array;
+
+}
+declare const Int8Array: Int8ArrayConstructor;
+
+/**
+ * A typed array of 8-bit unsigned integer values. The contents are initialized to 0. If the
+ * requested number of bytes could not be allocated an exception is raised.
+ */
+interface Uint8Array {
+ /**
+ * The size in bytes of each element in the array.
+ */
+ readonly BYTES_PER_ELEMENT: number;
+
+ /**
+ * The ArrayBuffer instance referenced by the array.
+ */
+ readonly buffer: ArrayBuffer;
+
+ /**
+ * The length in bytes of the array.
+ */
+ readonly byteLength: number;
+
+ /**
+ * The offset in bytes of the array.
+ */
+ readonly byteOffset: number;
+
+ /**
+ * Returns the this object after copying a section of the array identified by start and end
+ * to the same array starting at position target
+ * @param target If target is negative, it is treated as length+target where length is the
+ * length of the array.
+ * @param start If start is negative, it is treated as length+start. If end is negative, it
+ * is treated as length+end.
+ * @param end If not specified, length of the this object is used as its default value.
+ */
+ copyWithin(target: number, start: number, end?: number): this;
+
+ /**
+ * Determines whether all the members of an array satisfy the specified test.
+ * @param callbackfn A function that accepts up to three arguments. The every method calls
+ * the callbackfn function for each element in array1 until the callbackfn returns false,
+ * or until the end of the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ every(callbackfn: (value: number, index: number, array: Uint8Array) => boolean, thisArg?: any): boolean;
+
+ /**
+ * Returns the this object after filling the section identified by start and end with value
+ * @param value value to fill array section with
+ * @param start index to start filling the array at. If start is negative, it is treated as
+ * length+start where length is the length of the array.
+ * @param end index to stop filling the array at. If end is negative, it is treated as
+ * length+end.
+ */
+ fill(value: number, start?: number, end?: number): this;
+
+ /**
+ * Returns the elements of an array that meet the condition specified in a callback function.
+ * @param callbackfn A function that accepts up to three arguments. The filter method calls
+ * the callbackfn function one time for each element in the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ filter(callbackfn: (value: number, index: number, array: Uint8Array) => any, thisArg?: any): Uint8Array;
+
+ /**
+ * Returns the value of the first element in the array where predicate is true, and undefined
+ * otherwise.
+ * @param predicate find calls predicate once for each element of the array, in ascending
+ * order, until it finds one where predicate returns true. If such an element is found, find
+ * immediately returns that element value. Otherwise, find returns undefined.
+ * @param thisArg If provided, it will be used as the this value for each invocation of
+ * predicate. If it is not provided, undefined is used instead.
+ */
+ find(predicate: (value: number, index: number, obj: Array<number>) => boolean, thisArg?: any): number | undefined;
+
+ /**
+ * Returns the index of the first element in the array where predicate is true, and undefined
+ * otherwise.
+ * @param predicate find calls predicate once for each element of the array, in ascending
+ * order, until it finds one where predicate returns true. If such an element is found,
+ * findIndex immediately returns that element index. Otherwise, findIndex returns -1.
+ * @param thisArg If provided, it will be used as the this value for each invocation of
+ * predicate. If it is not provided, undefined is used instead.
+ */
+ findIndex(predicate: (value: number) => boolean, thisArg?: any): number;
+
+ /**
+ * Performs the specified action for each element in an array.
+ * @param callbackfn A function that accepts up to three arguments. forEach calls the
+ * callbackfn function one time for each element in the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ forEach(callbackfn: (value: number, index: number, array: Uint8Array) => void, thisArg?: any): void;
+
+ /**
+ * Returns the index of the first occurrence of a value in an array.
+ * @param searchElement The value to locate in the array.
+ * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
+ * search starts at index 0.
+ */
+ indexOf(searchElement: number, fromIndex?: number): number;
+
+ /**
+ * Adds all the elements of an array separated by the specified separator string.
+ * @param separator A string used to separate one element of an array from the next in the
+ * resulting String. If omitted, the array elements are separated with a comma.
+ */
+ join(separator?: string): string;
+
+ /**
+ * Returns the index of the last occurrence of a value in an array.
+ * @param searchElement The value to locate in the array.
+ * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
+ * search starts at index 0.
+ */
+ lastIndexOf(searchElement: number, fromIndex?: number): number;
+
+ /**
+ * The length of the array.
+ */
+ readonly length: number;
+
+ /**
+ * Calls a defined callback function on each element of an array, and returns an array that
+ * contains the results.
+ * @param callbackfn A function that accepts up to three arguments. The map method calls the
+ * callbackfn function one time for each element in the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ map(callbackfn: (value: number, index: number, array: Uint8Array) => number, thisArg?: any): Uint8Array;
+
+ /**
+ * Calls the specified callback function for all the elements in an array. The return value of
+ * the callback function is the accumulated result, and is provided as an argument in the next
+ * call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
+ * callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
+ * the accumulation. The first call to the callbackfn function provides this value as an argument
+ * instead of an array value.
+ */
+ reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number, initialValue?: number): number;
+
+ /**
+ * Calls the specified callback function for all the elements in an array. The return value of
+ * the callback function is the accumulated result, and is provided as an argument in the next
+ * call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
+ * callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
+ * the accumulation. The first call to the callbackfn function provides this value as an argument
+ * instead of an array value.
+ */
+ reduce<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8Array) => U, initialValue: U): U;
+
+ /**
+ * Calls the specified callback function for all the elements in an array, in descending order.
+ * The return value of the callback function is the accumulated result, and is provided as an
+ * argument in the next call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
+ * the callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
+ * the accumulation. The first call to the callbackfn function provides this value as an
+ * argument instead of an array value.
+ */
+ reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number, initialValue?: number): number;
+
+ /**
+ * Calls the specified callback function for all the elements in an array, in descending order.
+ * The return value of the callback function is the accumulated result, and is provided as an
+ * argument in the next call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
+ * the callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
+ * the accumulation. The first call to the callbackfn function provides this value as an argument
+ * instead of an array value.
+ */
+ reduceRight<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8Array) => U, initialValue: U): U;
+
+ /**
+ * Reverses the elements in an Array.
+ */
+ reverse(): Uint8Array;
+
+ /**
+ * Sets a value or an array of values.
+ * @param index The index of the location to set.
+ * @param value The value to set.
+ */
+ set(index: number, value: number): void;
+
+ /**
+ * Sets a value or an array of values.
+ * @param array A typed or untyped array of values to set.
+ * @param offset The index in the current array at which the values are to be written.
+ */
+ set(array: ArrayLike<number>, offset?: number): void;
+
+ /**
+ * Returns a section of an array.
+ * @param start The beginning of the specified portion of the array.
+ * @param end The end of the specified portion of the array.
+ */
+ slice(start?: number, end?: number): Uint8Array;
+
+ /**
+ * Determines whether the specified callback function returns true for any element of an array.
+ * @param callbackfn A function that accepts up to three arguments. The some method calls the
+ * callbackfn function for each element in array1 until the callbackfn returns true, or until
+ * the end of the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ some(callbackfn: (value: number, index: number, array: Uint8Array) => boolean, thisArg?: any): boolean;
+
+ /**
+ * Sorts an array.
+ * @param compareFn The name of the function used to determine the order of the elements. If
+ * omitted, the elements are sorted in ascending, ASCII character order.
+ */
+ sort(compareFn?: (a: number, b: number) => number): this;
+
+ /**
+ * Gets a new Uint8Array view of the ArrayBuffer store for this array, referencing the elements
+ * at begin, inclusive, up to end, exclusive.
+ * @param begin The index of the beginning of the array.
+ * @param end The index of the end of the array.
+ */
+ subarray(begin: number, end?: number): Uint8Array;
+
+ /**
+ * Converts a number to a string by using the current locale.
+ */
+ toLocaleString(): string;
+
+ /**
+ * Returns a string representation of an array.
+ */
+ toString(): string;
+
+ [index: number]: number;
+}
+
+interface Uint8ArrayConstructor {
+ readonly prototype: Uint8Array;
+ new (length: number): Uint8Array;
+ new (array: ArrayLike<number>): Uint8Array;
+ new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint8Array;
+
+ /**
+ * The size in bytes of each element in the array.
+ */
+ readonly BYTES_PER_ELEMENT: number;
+
+ /**
+ * Returns a new array from a set of elements.
+ * @param items A set of elements to include in the new array object.
+ */
+ of(...items: number[]): Uint8Array;
+
+ /**
+ * Creates an array from an array-like or iterable object.
+ * @param arrayLike An array-like or iterable object to convert to an array.
+ * @param mapfn A mapping function to call on every element of the array.
+ * @param thisArg Value of 'this' used to invoke the mapfn.
+ */
+ from(arrayLike: ArrayLike<number>, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint8Array;
+
+}
+declare const Uint8Array: Uint8ArrayConstructor;
+
+/**
+ * A typed array of 8-bit unsigned integer (clamped) values. The contents are initialized to 0.
+ * If the requested number of bytes could not be allocated an exception is raised.
+ */
+interface Uint8ClampedArray {
+ /**
+ * The size in bytes of each element in the array.
+ */
+ readonly BYTES_PER_ELEMENT: number;
+
+ /**
+ * The ArrayBuffer instance referenced by the array.
+ */
+ readonly buffer: ArrayBuffer;
+
+ /**
+ * The length in bytes of the array.
+ */
+ readonly byteLength: number;
+
+ /**
+ * The offset in bytes of the array.
+ */
+ readonly byteOffset: number;
+
+ /**
+ * Returns the this object after copying a section of the array identified by start and end
+ * to the same array starting at position target
+ * @param target If target is negative, it is treated as length+target where length is the
+ * length of the array.
+ * @param start If start is negative, it is treated as length+start. If end is negative, it
+ * is treated as length+end.
+ * @param end If not specified, length of the this object is used as its default value.
+ */
+ copyWithin(target: number, start: number, end?: number): this;
+
+ /**
+ * Determines whether all the members of an array satisfy the specified test.
+ * @param callbackfn A function that accepts up to three arguments. The every method calls
+ * the callbackfn function for each element in array1 until the callbackfn returns false,
+ * or until the end of the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ every(callbackfn: (value: number, index: number, array: Uint8ClampedArray) => boolean, thisArg?: any): boolean;
+
+ /**
+ * Returns the this object after filling the section identified by start and end with value
+ * @param value value to fill array section with
+ * @param start index to start filling the array at. If start is negative, it is treated as
+ * length+start where length is the length of the array.
+ * @param end index to stop filling the array at. If end is negative, it is treated as
+ * length+end.
+ */
+ fill(value: number, start?: number, end?: number): this;
+
+ /**
+ * Returns the elements of an array that meet the condition specified in a callback function.
+ * @param callbackfn A function that accepts up to three arguments. The filter method calls
+ * the callbackfn function one time for each element in the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ filter(callbackfn: (value: number, index: number, array: Uint8ClampedArray) => any, thisArg?: any): Uint8ClampedArray;
+
+ /**
+ * Returns the value of the first element in the array where predicate is true, and undefined
+ * otherwise.
+ * @param predicate find calls predicate once for each element of the array, in ascending
+ * order, until it finds one where predicate returns true. If such an element is found, find
+ * immediately returns that element value. Otherwise, find returns undefined.
+ * @param thisArg If provided, it will be used as the this value for each invocation of
+ * predicate. If it is not provided, undefined is used instead.
+ */
+ find(predicate: (value: number, index: number, obj: Array<number>) => boolean, thisArg?: any): number | undefined;
+
+ /**
+ * Returns the index of the first element in the array where predicate is true, and undefined
+ * otherwise.
+ * @param predicate find calls predicate once for each element of the array, in ascending
+ * order, until it finds one where predicate returns true. If such an element is found,
+ * findIndex immediately returns that element index. Otherwise, findIndex returns -1.
+ * @param thisArg If provided, it will be used as the this value for each invocation of
+ * predicate. If it is not provided, undefined is used instead.
+ */
+ findIndex(predicate: (value: number) => boolean, thisArg?: any): number;
+
+ /**
+ * Performs the specified action for each element in an array.
+ * @param callbackfn A function that accepts up to three arguments. forEach calls the
+ * callbackfn function one time for each element in the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ forEach(callbackfn: (value: number, index: number, array: Uint8ClampedArray) => void, thisArg?: any): void;
+
+ /**
+ * Returns the index of the first occurrence of a value in an array.
+ * @param searchElement The value to locate in the array.
+ * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
+ * search starts at index 0.
+ */
+ indexOf(searchElement: number, fromIndex?: number): number;
+
+ /**
+ * Adds all the elements of an array separated by the specified separator string.
+ * @param separator A string used to separate one element of an array from the next in the
+ * resulting String. If omitted, the array elements are separated with a comma.
+ */
+ join(separator?: string): string;
+
+ /**
+ * Returns the index of the last occurrence of a value in an array.
+ * @param searchElement The value to locate in the array.
+ * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
+ * search starts at index 0.
+ */
+ lastIndexOf(searchElement: number, fromIndex?: number): number;
+
+ /**
+ * The length of the array.
+ */
+ readonly length: number;
+
+ /**
+ * Calls a defined callback function on each element of an array, and returns an array that
+ * contains the results.
+ * @param callbackfn A function that accepts up to three arguments. The map method calls the
+ * callbackfn function one time for each element in the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ map(callbackfn: (value: number, index: number, array: Uint8ClampedArray) => number, thisArg?: any): Uint8ClampedArray;
+
+ /**
+ * Calls the specified callback function for all the elements in an array. The return value of
+ * the callback function is the accumulated result, and is provided as an argument in the next
+ * call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
+ * callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
+ * the accumulation. The first call to the callbackfn function provides this value as an argument
+ * instead of an array value.
+ */
+ reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => number, initialValue?: number): number;
+
+ /**
+ * Calls the specified callback function for all the elements in an array. The return value of
+ * the callback function is the accumulated result, and is provided as an argument in the next
+ * call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
+ * callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
+ * the accumulation. The first call to the callbackfn function provides this value as an argument
+ * instead of an array value.
+ */
+ reduce<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => U, initialValue: U): U;
+
+ /**
+ * Calls the specified callback function for all the elements in an array, in descending order.
+ * The return value of the callback function is the accumulated result, and is provided as an
+ * argument in the next call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
+ * the callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
+ * the accumulation. The first call to the callbackfn function provides this value as an
+ * argument instead of an array value.
+ */
+ reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => number, initialValue?: number): number;
+
+ /**
+ * Calls the specified callback function for all the elements in an array, in descending order.
+ * The return value of the callback function is the accumulated result, and is provided as an
+ * argument in the next call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
+ * the callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
+ * the accumulation. The first call to the callbackfn function provides this value as an argument
+ * instead of an array value.
+ */
+ reduceRight<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => U, initialValue: U): U;
+
+ /**
+ * Reverses the elements in an Array.
+ */
+ reverse(): Uint8ClampedArray;
+
+ /**
+ * Sets a value or an array of values.
+ * @param index The index of the location to set.
+ * @param value The value to set.
+ */
+ set(index: number, value: number): void;
+
+ /**
+ * Sets a value or an array of values.
+ * @param array A typed or untyped array of values to set.
+ * @param offset The index in the current array at which the values are to be written.
+ */
+ set(array: Uint8ClampedArray, offset?: number): void;
+
+ /**
+ * Returns a section of an array.
+ * @param start The beginning of the specified portion of the array.
+ * @param end The end of the specified portion of the array.
+ */
+ slice(start?: number, end?: number): Uint8ClampedArray;
+
+ /**
+ * Determines whether the specified callback function returns true for any element of an array.
+ * @param callbackfn A function that accepts up to three arguments. The some method calls the
+ * callbackfn function for each element in array1 until the callbackfn returns true, or until
+ * the end of the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ some(callbackfn: (value: number, index: number, array: Uint8ClampedArray) => boolean, thisArg?: any): boolean;
+
+ /**
+ * Sorts an array.
+ * @param compareFn The name of the function used to determine the order of the elements. If
+ * omitted, the elements are sorted in ascending, ASCII character order.
+ */
+ sort(compareFn?: (a: number, b: number) => number): this;
+
+ /**
+ * Gets a new Uint8ClampedArray view of the ArrayBuffer store for this array, referencing the elements
+ * at begin, inclusive, up to end, exclusive.
+ * @param begin The index of the beginning of the array.
+ * @param end The index of the end of the array.
+ */
+ subarray(begin: number, end?: number): Uint8ClampedArray;
+
+ /**
+ * Converts a number to a string by using the current locale.
+ */
+ toLocaleString(): string;
+
+ /**
+ * Returns a string representation of an array.
+ */
+ toString(): string;
+
+ [index: number]: number;
+}
+
+interface Uint8ClampedArrayConstructor {
+ readonly prototype: Uint8ClampedArray;
+ new (length: number): Uint8ClampedArray;
+ new (array: ArrayLike<number>): Uint8ClampedArray;
+ new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint8ClampedArray;
+
+ /**
+ * The size in bytes of each element in the array.
+ */
+ readonly BYTES_PER_ELEMENT: number;
+
+ /**
+ * Returns a new array from a set of elements.
+ * @param items A set of elements to include in the new array object.
+ */
+ of(...items: number[]): Uint8ClampedArray;
+
+ /**
+ * Creates an array from an array-like or iterable object.
+ * @param arrayLike An array-like or iterable object to convert to an array.
+ * @param mapfn A mapping function to call on every element of the array.
+ * @param thisArg Value of 'this' used to invoke the mapfn.
+ */
+ from(arrayLike: ArrayLike<number>, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint8ClampedArray;
+}
+declare const Uint8ClampedArray: Uint8ClampedArrayConstructor;
+
+/**
+ * A typed array of 16-bit signed integer values. The contents are initialized to 0. If the
+ * requested number of bytes could not be allocated an exception is raised.
+ */
+interface Int16Array {
+ /**
+ * The size in bytes of each element in the array.
+ */
+ readonly BYTES_PER_ELEMENT: number;
+
+ /**
+ * The ArrayBuffer instance referenced by the array.
+ */
+ readonly buffer: ArrayBuffer;
+
+ /**
+ * The length in bytes of the array.
+ */
+ readonly byteLength: number;
+
+ /**
+ * The offset in bytes of the array.
+ */
+ readonly byteOffset: number;
+
+ /**
+ * Returns the this object after copying a section of the array identified by start and end
+ * to the same array starting at position target
+ * @param target If target is negative, it is treated as length+target where length is the
+ * length of the array.
+ * @param start If start is negative, it is treated as length+start. If end is negative, it
+ * is treated as length+end.
+ * @param end If not specified, length of the this object is used as its default value.
+ */
+ copyWithin(target: number, start: number, end?: number): this;
+
+ /**
+ * Determines whether all the members of an array satisfy the specified test.
+ * @param callbackfn A function that accepts up to three arguments. The every method calls
+ * the callbackfn function for each element in array1 until the callbackfn returns false,
+ * or until the end of the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ every(callbackfn: (value: number, index: number, array: Int16Array) => boolean, thisArg?: any): boolean;
+
+ /**
+ * Returns the this object after filling the section identified by start and end with value
+ * @param value value to fill array section with
+ * @param start index to start filling the array at. If start is negative, it is treated as
+ * length+start where length is the length of the array.
+ * @param end index to stop filling the array at. If end is negative, it is treated as
+ * length+end.
+ */
+ fill(value: number, start?: number, end?: number): this;
+
+ /**
+ * Returns the elements of an array that meet the condition specified in a callback function.
+ * @param callbackfn A function that accepts up to three arguments. The filter method calls
+ * the callbackfn function one time for each element in the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ filter(callbackfn: (value: number, index: number, array: Int16Array) => any, thisArg?: any): Int16Array;
+
+ /**
+ * Returns the value of the first element in the array where predicate is true, and undefined
+ * otherwise.
+ * @param predicate find calls predicate once for each element of the array, in ascending
+ * order, until it finds one where predicate returns true. If such an element is found, find
+ * immediately returns that element value. Otherwise, find returns undefined.
+ * @param thisArg If provided, it will be used as the this value for each invocation of
+ * predicate. If it is not provided, undefined is used instead.
+ */
+ find(predicate: (value: number, index: number, obj: Array<number>) => boolean, thisArg?: any): number | undefined;
+
+ /**
+ * Returns the index of the first element in the array where predicate is true, and undefined
+ * otherwise.
+ * @param predicate find calls predicate once for each element of the array, in ascending
+ * order, until it finds one where predicate returns true. If such an element is found,
+ * findIndex immediately returns that element index. Otherwise, findIndex returns -1.
+ * @param thisArg If provided, it will be used as the this value for each invocation of
+ * predicate. If it is not provided, undefined is used instead.
+ */
+ findIndex(predicate: (value: number) => boolean, thisArg?: any): number;
+
+ /**
+ * Performs the specified action for each element in an array.
+ * @param callbackfn A function that accepts up to three arguments. forEach calls the
+ * callbackfn function one time for each element in the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ forEach(callbackfn: (value: number, index: number, array: Int16Array) => void, thisArg?: any): void;
+
+ /**
+ * Returns the index of the first occurrence of a value in an array.
+ * @param searchElement The value to locate in the array.
+ * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
+ * search starts at index 0.
+ */
+ indexOf(searchElement: number, fromIndex?: number): number;
+
+ /**
+ * Adds all the elements of an array separated by the specified separator string.
+ * @param separator A string used to separate one element of an array from the next in the
+ * resulting String. If omitted, the array elements are separated with a comma.
+ */
+ join(separator?: string): string;
+
+ /**
+ * Returns the index of the last occurrence of a value in an array.
+ * @param searchElement The value to locate in the array.
+ * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
+ * search starts at index 0.
+ */
+ lastIndexOf(searchElement: number, fromIndex?: number): number;
+
+ /**
+ * The length of the array.
+ */
+ readonly length: number;
+
+ /**
+ * Calls a defined callback function on each element of an array, and returns an array that
+ * contains the results.
+ * @param callbackfn A function that accepts up to three arguments. The map method calls the
+ * callbackfn function one time for each element in the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ map(callbackfn: (value: number, index: number, array: Int16Array) => number, thisArg?: any): Int16Array;
+
+ /**
+ * Calls the specified callback function for all the elements in an array. The return value of
+ * the callback function is the accumulated result, and is provided as an argument in the next
+ * call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
+ * callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
+ * the accumulation. The first call to the callbackfn function provides this value as an argument
+ * instead of an array value.
+ */
+ reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int16Array) => number, initialValue?: number): number;
+
+ /**
+ * Calls the specified callback function for all the elements in an array. The return value of
+ * the callback function is the accumulated result, and is provided as an argument in the next
+ * call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
+ * callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
+ * the accumulation. The first call to the callbackfn function provides this value as an argument
+ * instead of an array value.
+ */
+ reduce<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int16Array) => U, initialValue: U): U;
+
+ /**
+ * Calls the specified callback function for all the elements in an array, in descending order.
+ * The return value of the callback function is the accumulated result, and is provided as an
+ * argument in the next call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
+ * the callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
+ * the accumulation. The first call to the callbackfn function provides this value as an
+ * argument instead of an array value.
+ */
+ reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int16Array) => number, initialValue?: number): number;
+
+ /**
+ * Calls the specified callback function for all the elements in an array, in descending order.
+ * The return value of the callback function is the accumulated result, and is provided as an
+ * argument in the next call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
+ * the callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
+ * the accumulation. The first call to the callbackfn function provides this value as an argument
+ * instead of an array value.
+ */
+ reduceRight<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int16Array) => U, initialValue: U): U;
+
+ /**
+ * Reverses the elements in an Array.
+ */
+ reverse(): Int16Array;
+
+ /**
+ * Sets a value or an array of values.
+ * @param index The index of the location to set.
+ * @param value The value to set.
+ */
+ set(index: number, value: number): void;
+
+ /**
+ * Sets a value or an array of values.
+ * @param array A typed or untyped array of values to set.
+ * @param offset The index in the current array at which the values are to be written.
+ */
+ set(array: ArrayLike<number>, offset?: number): void;
+
+ /**
+ * Returns a section of an array.
+ * @param start The beginning of the specified portion of the array.
+ * @param end The end of the specified portion of the array.
+ */
+ slice(start?: number, end?: number): Int16Array;
+
+ /**
+ * Determines whether the specified callback function returns true for any element of an array.
+ * @param callbackfn A function that accepts up to three arguments. The some method calls the
+ * callbackfn function for each element in array1 until the callbackfn returns true, or until
+ * the end of the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ some(callbackfn: (value: number, index: number, array: Int16Array) => boolean, thisArg?: any): boolean;
+
+ /**
+ * Sorts an array.
+ * @param compareFn The name of the function used to determine the order of the elements. If
+ * omitted, the elements are sorted in ascending, ASCII character order.
+ */
+ sort(compareFn?: (a: number, b: number) => number): this;
+
+ /**
+ * Gets a new Int16Array view of the ArrayBuffer store for this array, referencing the elements
+ * at begin, inclusive, up to end, exclusive.
+ * @param begin The index of the beginning of the array.
+ * @param end The index of the end of the array.
+ */
+ subarray(begin: number, end?: number): Int16Array;
+
+ /**
+ * Converts a number to a string by using the current locale.
+ */
+ toLocaleString(): string;
+
+ /**
+ * Returns a string representation of an array.
+ */
+ toString(): string;
+
+ [index: number]: number;
+}
+
+interface Int16ArrayConstructor {
+ readonly prototype: Int16Array;
+ new (length: number): Int16Array;
+ new (array: ArrayLike<number>): Int16Array;
+ new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Int16Array;
+
+ /**
+ * The size in bytes of each element in the array.
+ */
+ readonly BYTES_PER_ELEMENT: number;
+
+ /**
+ * Returns a new array from a set of elements.
+ * @param items A set of elements to include in the new array object.
+ */
+ of(...items: number[]): Int16Array;
+
+ /**
+ * Creates an array from an array-like or iterable object.
+ * @param arrayLike An array-like or iterable object to convert to an array.
+ * @param mapfn A mapping function to call on every element of the array.
+ * @param thisArg Value of 'this' used to invoke the mapfn.
+ */
+ from(arrayLike: ArrayLike<number>, mapfn?: (v: number, k: number) => number, thisArg?: any): Int16Array;
+
+}
+declare const Int16Array: Int16ArrayConstructor;
+
+/**
+ * A typed array of 16-bit unsigned integer values. The contents are initialized to 0. If the
+ * requested number of bytes could not be allocated an exception is raised.
+ */
+interface Uint16Array {
+ /**
+ * The size in bytes of each element in the array.
+ */
+ readonly BYTES_PER_ELEMENT: number;
+
+ /**
+ * The ArrayBuffer instance referenced by the array.
+ */
+ readonly buffer: ArrayBuffer;
+
+ /**
+ * The length in bytes of the array.
+ */
+ readonly byteLength: number;
+
+ /**
+ * The offset in bytes of the array.
+ */
+ readonly byteOffset: number;
+
+ /**
+ * Returns the this object after copying a section of the array identified by start and end
+ * to the same array starting at position target
+ * @param target If target is negative, it is treated as length+target where length is the
+ * length of the array.
+ * @param start If start is negative, it is treated as length+start. If end is negative, it
+ * is treated as length+end.
+ * @param end If not specified, length of the this object is used as its default value.
+ */
+ copyWithin(target: number, start: number, end?: number): this;
+
+ /**
+ * Determines whether all the members of an array satisfy the specified test.
+ * @param callbackfn A function that accepts up to three arguments. The every method calls
+ * the callbackfn function for each element in array1 until the callbackfn returns false,
+ * or until the end of the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ every(callbackfn: (value: number, index: number, array: Uint16Array) => boolean, thisArg?: any): boolean;
+
+ /**
+ * Returns the this object after filling the section identified by start and end with value
+ * @param value value to fill array section with
+ * @param start index to start filling the array at. If start is negative, it is treated as
+ * length+start where length is the length of the array.
+ * @param end index to stop filling the array at. If end is negative, it is treated as
+ * length+end.
+ */
+ fill(value: number, start?: number, end?: number): this;
+
+ /**
+ * Returns the elements of an array that meet the condition specified in a callback function.
+ * @param callbackfn A function that accepts up to three arguments. The filter method calls
+ * the callbackfn function one time for each element in the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ filter(callbackfn: (value: number, index: number, array: Uint16Array) => any, thisArg?: any): Uint16Array;
+
+ /**
+ * Returns the value of the first element in the array where predicate is true, and undefined
+ * otherwise.
+ * @param predicate find calls predicate once for each element of the array, in ascending
+ * order, until it finds one where predicate returns true. If such an element is found, find
+ * immediately returns that element value. Otherwise, find returns undefined.
+ * @param thisArg If provided, it will be used as the this value for each invocation of
+ * predicate. If it is not provided, undefined is used instead.
+ */
+ find(predicate: (value: number, index: number, obj: Array<number>) => boolean, thisArg?: any): number | undefined;
+
+ /**
+ * Returns the index of the first element in the array where predicate is true, and undefined
+ * otherwise.
+ * @param predicate find calls predicate once for each element of the array, in ascending
+ * order, until it finds one where predicate returns true. If such an element is found,
+ * findIndex immediately returns that element index. Otherwise, findIndex returns -1.
+ * @param thisArg If provided, it will be used as the this value for each invocation of
+ * predicate. If it is not provided, undefined is used instead.
+ */
+ findIndex(predicate: (value: number) => boolean, thisArg?: any): number;
+
+ /**
+ * Performs the specified action for each element in an array.
+ * @param callbackfn A function that accepts up to three arguments. forEach calls the
+ * callbackfn function one time for each element in the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ forEach(callbackfn: (value: number, index: number, array: Uint16Array) => void, thisArg?: any): void;
+
+ /**
+ * Returns the index of the first occurrence of a value in an array.
+ * @param searchElement The value to locate in the array.
+ * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
+ * search starts at index 0.
+ */
+ indexOf(searchElement: number, fromIndex?: number): number;
+
+ /**
+ * Adds all the elements of an array separated by the specified separator string.
+ * @param separator A string used to separate one element of an array from the next in the
+ * resulting String. If omitted, the array elements are separated with a comma.
+ */
+ join(separator?: string): string;
+
+ /**
+ * Returns the index of the last occurrence of a value in an array.
+ * @param searchElement The value to locate in the array.
+ * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
+ * search starts at index 0.
+ */
+ lastIndexOf(searchElement: number, fromIndex?: number): number;
+
+ /**
+ * The length of the array.
+ */
+ readonly length: number;
+
+ /**
+ * Calls a defined callback function on each element of an array, and returns an array that
+ * contains the results.
+ * @param callbackfn A function that accepts up to three arguments. The map method calls the
+ * callbackfn function one time for each element in the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ map(callbackfn: (value: number, index: number, array: Uint16Array) => number, thisArg?: any): Uint16Array;
+
+ /**
+ * Calls the specified callback function for all the elements in an array. The return value of
+ * the callback function is the accumulated result, and is provided as an argument in the next
+ * call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
+ * callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
+ * the accumulation. The first call to the callbackfn function provides this value as an argument
+ * instead of an array value.
+ */
+ reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint16Array) => number, initialValue?: number): number;
+
+ /**
+ * Calls the specified callback function for all the elements in an array. The return value of
+ * the callback function is the accumulated result, and is provided as an argument in the next
+ * call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
+ * callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
+ * the accumulation. The first call to the callbackfn function provides this value as an argument
+ * instead of an array value.
+ */
+ reduce<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint16Array) => U, initialValue: U): U;
+
+ /**
+ * Calls the specified callback function for all the elements in an array, in descending order.
+ * The return value of the callback function is the accumulated result, and is provided as an
+ * argument in the next call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
+ * the callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
+ * the accumulation. The first call to the callbackfn function provides this value as an
+ * argument instead of an array value.
+ */
+ reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint16Array) => number, initialValue?: number): number;
+
+ /**
+ * Calls the specified callback function for all the elements in an array, in descending order.
+ * The return value of the callback function is the accumulated result, and is provided as an
+ * argument in the next call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
+ * the callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
+ * the accumulation. The first call to the callbackfn function provides this value as an argument
+ * instead of an array value.
+ */
+ reduceRight<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint16Array) => U, initialValue: U): U;
+
+ /**
+ * Reverses the elements in an Array.
+ */
+ reverse(): Uint16Array;
+
+ /**
+ * Sets a value or an array of values.
+ * @param index The index of the location to set.
+ * @param value The value to set.
+ */
+ set(index: number, value: number): void;
+
+ /**
+ * Sets a value or an array of values.
+ * @param array A typed or untyped array of values to set.
+ * @param offset The index in the current array at which the values are to be written.
+ */
+ set(array: ArrayLike<number>, offset?: number): void;
+
+ /**
+ * Returns a section of an array.
+ * @param start The beginning of the specified portion of the array.
+ * @param end The end of the specified portion of the array.
+ */
+ slice(start?: number, end?: number): Uint16Array;
+
+ /**
+ * Determines whether the specified callback function returns true for any element of an array.
+ * @param callbackfn A function that accepts up to three arguments. The some method calls the
+ * callbackfn function for each element in array1 until the callbackfn returns true, or until
+ * the end of the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ some(callbackfn: (value: number, index: number, array: Uint16Array) => boolean, thisArg?: any): boolean;
+
+ /**
+ * Sorts an array.
+ * @param compareFn The name of the function used to determine the order of the elements. If
+ * omitted, the elements are sorted in ascending, ASCII character order.
+ */
+ sort(compareFn?: (a: number, b: number) => number): this;
+
+ /**
+ * Gets a new Uint16Array view of the ArrayBuffer store for this array, referencing the elements
+ * at begin, inclusive, up to end, exclusive.
+ * @param begin The index of the beginning of the array.
+ * @param end The index of the end of the array.
+ */
+ subarray(begin: number, end?: number): Uint16Array;
+
+ /**
+ * Converts a number to a string by using the current locale.
+ */
+ toLocaleString(): string;
+
+ /**
+ * Returns a string representation of an array.
+ */
+ toString(): string;
+
+ [index: number]: number;
+}
+
+interface Uint16ArrayConstructor {
+ readonly prototype: Uint16Array;
+ new (length: number): Uint16Array;
+ new (array: ArrayLike<number>): Uint16Array;
+ new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint16Array;
+
+ /**
+ * The size in bytes of each element in the array.
+ */
+ readonly BYTES_PER_ELEMENT: number;
+
+ /**
+ * Returns a new array from a set of elements.
+ * @param items A set of elements to include in the new array object.
+ */
+ of(...items: number[]): Uint16Array;
+
+ /**
+ * Creates an array from an array-like or iterable object.
+ * @param arrayLike An array-like or iterable object to convert to an array.
+ * @param mapfn A mapping function to call on every element of the array.
+ * @param thisArg Value of 'this' used to invoke the mapfn.
+ */
+ from(arrayLike: ArrayLike<number>, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint16Array;
+
+}
+declare const Uint16Array: Uint16ArrayConstructor;
+/**
+ * A typed array of 32-bit signed integer values. The contents are initialized to 0. If the
+ * requested number of bytes could not be allocated an exception is raised.
+ */
+interface Int32Array {
+ /**
+ * The size in bytes of each element in the array.
+ */
+ readonly BYTES_PER_ELEMENT: number;
+
+ /**
+ * The ArrayBuffer instance referenced by the array.
+ */
+ readonly buffer: ArrayBuffer;
+
+ /**
+ * The length in bytes of the array.
+ */
+ readonly byteLength: number;
+
+ /**
+ * The offset in bytes of the array.
+ */
+ readonly byteOffset: number;
+
+ /**
+ * Returns the this object after copying a section of the array identified by start and end
+ * to the same array starting at position target
+ * @param target If target is negative, it is treated as length+target where length is the
+ * length of the array.
+ * @param start If start is negative, it is treated as length+start. If end is negative, it
+ * is treated as length+end.
+ * @param end If not specified, length of the this object is used as its default value.
+ */
+ copyWithin(target: number, start: number, end?: number): this;
+
+ /**
+ * Determines whether all the members of an array satisfy the specified test.
+ * @param callbackfn A function that accepts up to three arguments. The every method calls
+ * the callbackfn function for each element in array1 until the callbackfn returns false,
+ * or until the end of the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ every(callbackfn: (value: number, index: number, array: Int32Array) => boolean, thisArg?: any): boolean;
+
+ /**
+ * Returns the this object after filling the section identified by start and end with value
+ * @param value value to fill array section with
+ * @param start index to start filling the array at. If start is negative, it is treated as
+ * length+start where length is the length of the array.
+ * @param end index to stop filling the array at. If end is negative, it is treated as
+ * length+end.
+ */
+ fill(value: number, start?: number, end?: number): this;
+
+ /**
+ * Returns the elements of an array that meet the condition specified in a callback function.
+ * @param callbackfn A function that accepts up to three arguments. The filter method calls
+ * the callbackfn function one time for each element in the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ filter(callbackfn: (value: number, index: number, array: Int32Array) => any, thisArg?: any): Int32Array;
+
+ /**
+ * Returns the value of the first element in the array where predicate is true, and undefined
+ * otherwise.
+ * @param predicate find calls predicate once for each element of the array, in ascending
+ * order, until it finds one where predicate returns true. If such an element is found, find
+ * immediately returns that element value. Otherwise, find returns undefined.
+ * @param thisArg If provided, it will be used as the this value for each invocation of
+ * predicate. If it is not provided, undefined is used instead.
+ */
+ find(predicate: (value: number, index: number, obj: Array<number>) => boolean, thisArg?: any): number | undefined;
+
+ /**
+ * Returns the index of the first element in the array where predicate is true, and undefined
+ * otherwise.
+ * @param predicate find calls predicate once for each element of the array, in ascending
+ * order, until it finds one where predicate returns true. If such an element is found,
+ * findIndex immediately returns that element index. Otherwise, findIndex returns -1.
+ * @param thisArg If provided, it will be used as the this value for each invocation of
+ * predicate. If it is not provided, undefined is used instead.
+ */
+ findIndex(predicate: (value: number) => boolean, thisArg?: any): number;
+
+ /**
+ * Performs the specified action for each element in an array.
+ * @param callbackfn A function that accepts up to three arguments. forEach calls the
+ * callbackfn function one time for each element in the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ forEach(callbackfn: (value: number, index: number, array: Int32Array) => void, thisArg?: any): void;
+
+ /**
+ * Returns the index of the first occurrence of a value in an array.
+ * @param searchElement The value to locate in the array.
+ * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
+ * search starts at index 0.
+ */
+ indexOf(searchElement: number, fromIndex?: number): number;
+
+ /**
+ * Adds all the elements of an array separated by the specified separator string.
+ * @param separator A string used to separate one element of an array from the next in the
+ * resulting String. If omitted, the array elements are separated with a comma.
+ */
+ join(separator?: string): string;
+
+ /**
+ * Returns the index of the last occurrence of a value in an array.
+ * @param searchElement The value to locate in the array.
+ * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
+ * search starts at index 0.
+ */
+ lastIndexOf(searchElement: number, fromIndex?: number): number;
+
+ /**
+ * The length of the array.
+ */
+ readonly length: number;
+
+ /**
+ * Calls a defined callback function on each element of an array, and returns an array that
+ * contains the results.
+ * @param callbackfn A function that accepts up to three arguments. The map method calls the
+ * callbackfn function one time for each element in the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ map(callbackfn: (value: number, index: number, array: Int32Array) => number, thisArg?: any): Int32Array;
+
+ /**
+ * Calls the specified callback function for all the elements in an array. The return value of
+ * the callback function is the accumulated result, and is provided as an argument in the next
+ * call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
+ * callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
+ * the accumulation. The first call to the callbackfn function provides this value as an argument
+ * instead of an array value.
+ */
+ reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int32Array) => number, initialValue?: number): number;
+
+ /**
+ * Calls the specified callback function for all the elements in an array. The return value of
+ * the callback function is the accumulated result, and is provided as an argument in the next
+ * call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
+ * callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
+ * the accumulation. The first call to the callbackfn function provides this value as an argument
+ * instead of an array value.
+ */
+ reduce<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int32Array) => U, initialValue: U): U;
+
+ /**
+ * Calls the specified callback function for all the elements in an array, in descending order.
+ * The return value of the callback function is the accumulated result, and is provided as an
+ * argument in the next call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
+ * the callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
+ * the accumulation. The first call to the callbackfn function provides this value as an
+ * argument instead of an array value.
+ */
+ reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int32Array) => number, initialValue?: number): number;
+
+ /**
+ * Calls the specified callback function for all the elements in an array, in descending order.
+ * The return value of the callback function is the accumulated result, and is provided as an
+ * argument in the next call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
+ * the callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
+ * the accumulation. The first call to the callbackfn function provides this value as an argument
+ * instead of an array value.
+ */
+ reduceRight<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int32Array) => U, initialValue: U): U;
+
+ /**
+ * Reverses the elements in an Array.
+ */
+ reverse(): Int32Array;
+
+ /**
+ * Sets a value or an array of values.
+ * @param index The index of the location to set.
+ * @param value The value to set.
+ */
+ set(index: number, value: number): void;
+
+ /**
+ * Sets a value or an array of values.
+ * @param array A typed or untyped array of values to set.
+ * @param offset The index in the current array at which the values are to be written.
+ */
+ set(array: ArrayLike<number>, offset?: number): void;
+
+ /**
+ * Returns a section of an array.
+ * @param start The beginning of the specified portion of the array.
+ * @param end The end of the specified portion of the array.
+ */
+ slice(start?: number, end?: number): Int32Array;
+
+ /**
+ * Determines whether the specified callback function returns true for any element of an array.
+ * @param callbackfn A function that accepts up to three arguments. The some method calls the
+ * callbackfn function for each element in array1 until the callbackfn returns true, or until
+ * the end of the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ some(callbackfn: (value: number, index: number, array: Int32Array) => boolean, thisArg?: any): boolean;
+
+ /**
+ * Sorts an array.
+ * @param compareFn The name of the function used to determine the order of the elements. If
+ * omitted, the elements are sorted in ascending, ASCII character order.
+ */
+ sort(compareFn?: (a: number, b: number) => number): this;
+
+ /**
+ * Gets a new Int32Array view of the ArrayBuffer store for this array, referencing the elements
+ * at begin, inclusive, up to end, exclusive.
+ * @param begin The index of the beginning of the array.
+ * @param end The index of the end of the array.
+ */
+ subarray(begin: number, end?: number): Int32Array;
+
+ /**
+ * Converts a number to a string by using the current locale.
+ */
+ toLocaleString(): string;
+
+ /**
+ * Returns a string representation of an array.
+ */
+ toString(): string;
+
+ [index: number]: number;
+}
+
+interface Int32ArrayConstructor {
+ readonly prototype: Int32Array;
+ new (length: number): Int32Array;
+ new (array: ArrayLike<number>): Int32Array;
+ new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Int32Array;
+
+ /**
+ * The size in bytes of each element in the array.
+ */
+ readonly BYTES_PER_ELEMENT: number;
+
+ /**
+ * Returns a new array from a set of elements.
+ * @param items A set of elements to include in the new array object.
+ */
+ of(...items: number[]): Int32Array;
+
+ /**
+ * Creates an array from an array-like or iterable object.
+ * @param arrayLike An array-like or iterable object to convert to an array.
+ * @param mapfn A mapping function to call on every element of the array.
+ * @param thisArg Value of 'this' used to invoke the mapfn.
+ */
+ from(arrayLike: ArrayLike<number>, mapfn?: (v: number, k: number) => number, thisArg?: any): Int32Array;
+}
+declare const Int32Array: Int32ArrayConstructor;
+
+/**
+ * A typed array of 32-bit unsigned integer values. The contents are initialized to 0. If the
+ * requested number of bytes could not be allocated an exception is raised.
+ */
+interface Uint32Array {
+ /**
+ * The size in bytes of each element in the array.
+ */
+ readonly BYTES_PER_ELEMENT: number;
+
+ /**
+ * The ArrayBuffer instance referenced by the array.
+ */
+ readonly buffer: ArrayBuffer;
+
+ /**
+ * The length in bytes of the array.
+ */
+ readonly byteLength: number;
+
+ /**
+ * The offset in bytes of the array.
+ */
+ readonly byteOffset: number;
+
+ /**
+ * Returns the this object after copying a section of the array identified by start and end
+ * to the same array starting at position target
+ * @param target If target is negative, it is treated as length+target where length is the
+ * length of the array.
+ * @param start If start is negative, it is treated as length+start. If end is negative, it
+ * is treated as length+end.
+ * @param end If not specified, length of the this object is used as its default value.
+ */
+ copyWithin(target: number, start: number, end?: number): this;
+
+ /**
+ * Determines whether all the members of an array satisfy the specified test.
+ * @param callbackfn A function that accepts up to three arguments. The every method calls
+ * the callbackfn function for each element in array1 until the callbackfn returns false,
+ * or until the end of the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ every(callbackfn: (value: number, index: number, array: Uint32Array) => boolean, thisArg?: any): boolean;
+
+ /**
+ * Returns the this object after filling the section identified by start and end with value
+ * @param value value to fill array section with
+ * @param start index to start filling the array at. If start is negative, it is treated as
+ * length+start where length is the length of the array.
+ * @param end index to stop filling the array at. If end is negative, it is treated as
+ * length+end.
+ */
+ fill(value: number, start?: number, end?: number): this;
+
+ /**
+ * Returns the elements of an array that meet the condition specified in a callback function.
+ * @param callbackfn A function that accepts up to three arguments. The filter method calls
+ * the callbackfn function one time for each element in the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ filter(callbackfn: (value: number, index: number, array: Uint32Array) => any, thisArg?: any): Uint32Array;
+
+ /**
+ * Returns the value of the first element in the array where predicate is true, and undefined
+ * otherwise.
+ * @param predicate find calls predicate once for each element of the array, in ascending
+ * order, until it finds one where predicate returns true. If such an element is found, find
+ * immediately returns that element value. Otherwise, find returns undefined.
+ * @param thisArg If provided, it will be used as the this value for each invocation of
+ * predicate. If it is not provided, undefined is used instead.
+ */
+ find(predicate: (value: number, index: number, obj: Array<number>) => boolean, thisArg?: any): number | undefined;
+
+ /**
+ * Returns the index of the first element in the array where predicate is true, and undefined
+ * otherwise.
+ * @param predicate find calls predicate once for each element of the array, in ascending
+ * order, until it finds one where predicate returns true. If such an element is found,
+ * findIndex immediately returns that element index. Otherwise, findIndex returns -1.
+ * @param thisArg If provided, it will be used as the this value for each invocation of
+ * predicate. If it is not provided, undefined is used instead.
+ */
+ findIndex(predicate: (value: number) => boolean, thisArg?: any): number;
+
+ /**
+ * Performs the specified action for each element in an array.
+ * @param callbackfn A function that accepts up to three arguments. forEach calls the
+ * callbackfn function one time for each element in the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ forEach(callbackfn: (value: number, index: number, array: Uint32Array) => void, thisArg?: any): void;
+
+ /**
+ * Returns the index of the first occurrence of a value in an array.
+ * @param searchElement The value to locate in the array.
+ * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
+ * search starts at index 0.
+ */
+ indexOf(searchElement: number, fromIndex?: number): number;
+
+ /**
+ * Adds all the elements of an array separated by the specified separator string.
+ * @param separator A string used to separate one element of an array from the next in the
+ * resulting String. If omitted, the array elements are separated with a comma.
+ */
+ join(separator?: string): string;
+
+ /**
+ * Returns the index of the last occurrence of a value in an array.
+ * @param searchElement The value to locate in the array.
+ * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
+ * search starts at index 0.
+ */
+ lastIndexOf(searchElement: number, fromIndex?: number): number;
+
+ /**
+ * The length of the array.
+ */
+ readonly length: number;
+
+ /**
+ * Calls a defined callback function on each element of an array, and returns an array that
+ * contains the results.
+ * @param callbackfn A function that accepts up to three arguments. The map method calls the
+ * callbackfn function one time for each element in the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ map(callbackfn: (value: number, index: number, array: Uint32Array) => number, thisArg?: any): Uint32Array;
+
+ /**
+ * Calls the specified callback function for all the elements in an array. The return value of
+ * the callback function is the accumulated result, and is provided as an argument in the next
+ * call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
+ * callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
+ * the accumulation. The first call to the callbackfn function provides this value as an argument
+ * instead of an array value.
+ */
+ reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint32Array) => number, initialValue?: number): number;
+
+ /**
+ * Calls the specified callback function for all the elements in an array. The return value of
+ * the callback function is the accumulated result, and is provided as an argument in the next
+ * call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
+ * callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
+ * the accumulation. The first call to the callbackfn function provides this value as an argument
+ * instead of an array value.
+ */
+ reduce<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint32Array) => U, initialValue: U): U;
+
+ /**
+ * Calls the specified callback function for all the elements in an array, in descending order.
+ * The return value of the callback function is the accumulated result, and is provided as an
+ * argument in the next call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
+ * the callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
+ * the accumulation. The first call to the callbackfn function provides this value as an
+ * argument instead of an array value.
+ */
+ reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint32Array) => number, initialValue?: number): number;
+
+ /**
+ * Calls the specified callback function for all the elements in an array, in descending order.
+ * The return value of the callback function is the accumulated result, and is provided as an
+ * argument in the next call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
+ * the callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
+ * the accumulation. The first call to the callbackfn function provides this value as an argument
+ * instead of an array value.
+ */
+ reduceRight<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint32Array) => U, initialValue: U): U;
+
+ /**
+ * Reverses the elements in an Array.
+ */
+ reverse(): Uint32Array;
+
+ /**
+ * Sets a value or an array of values.
+ * @param index The index of the location to set.
+ * @param value The value to set.
+ */
+ set(index: number, value: number): void;
+
+ /**
+ * Sets a value or an array of values.
+ * @param array A typed or untyped array of values to set.
+ * @param offset The index in the current array at which the values are to be written.
+ */
+ set(array: ArrayLike<number>, offset?: number): void;
+
+ /**
+ * Returns a section of an array.
+ * @param start The beginning of the specified portion of the array.
+ * @param end The end of the specified portion of the array.
+ */
+ slice(start?: number, end?: number): Uint32Array;
+
+ /**
+ * Determines whether the specified callback function returns true for any element of an array.
+ * @param callbackfn A function that accepts up to three arguments. The some method calls the
+ * callbackfn function for each element in array1 until the callbackfn returns true, or until
+ * the end of the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ some(callbackfn: (value: number, index: number, array: Uint32Array) => boolean, thisArg?: any): boolean;
+
+ /**
+ * Sorts an array.
+ * @param compareFn The name of the function used to determine the order of the elements. If
+ * omitted, the elements are sorted in ascending, ASCII character order.
+ */
+ sort(compareFn?: (a: number, b: number) => number): this;
+
+ /**
+ * Gets a new Uint32Array view of the ArrayBuffer store for this array, referencing the elements
+ * at begin, inclusive, up to end, exclusive.
+ * @param begin The index of the beginning of the array.
+ * @param end The index of the end of the array.
+ */
+ subarray(begin: number, end?: number): Uint32Array;
+
+ /**
+ * Converts a number to a string by using the current locale.
+ */
+ toLocaleString(): string;
+
+ /**
+ * Returns a string representation of an array.
+ */
+ toString(): string;
+
+ [index: number]: number;
+}
+
+interface Uint32ArrayConstructor {
+ readonly prototype: Uint32Array;
+ new (length: number): Uint32Array;
+ new (array: ArrayLike<number>): Uint32Array;
+ new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint32Array;
+
+ /**
+ * The size in bytes of each element in the array.
+ */
+ readonly BYTES_PER_ELEMENT: number;
+
+ /**
+ * Returns a new array from a set of elements.
+ * @param items A set of elements to include in the new array object.
+ */
+ of(...items: number[]): Uint32Array;
+
+ /**
+ * Creates an array from an array-like or iterable object.
+ * @param arrayLike An array-like or iterable object to convert to an array.
+ * @param mapfn A mapping function to call on every element of the array.
+ * @param thisArg Value of 'this' used to invoke the mapfn.
+ */
+ from(arrayLike: ArrayLike<number>, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint32Array;
+}
+declare const Uint32Array: Uint32ArrayConstructor;
+
+/**
+ * A typed array of 32-bit float values. The contents are initialized to 0. If the requested number
+ * of bytes could not be allocated an exception is raised.
+ */
+interface Float32Array {
+ /**
+ * The size in bytes of each element in the array.
+ */
+ readonly BYTES_PER_ELEMENT: number;
+
+ /**
+ * The ArrayBuffer instance referenced by the array.
+ */
+ readonly buffer: ArrayBuffer;
+
+ /**
+ * The length in bytes of the array.
+ */
+ readonly byteLength: number;
+
+ /**
+ * The offset in bytes of the array.
+ */
+ readonly byteOffset: number;
+
+ /**
+ * Returns the this object after copying a section of the array identified by start and end
+ * to the same array starting at position target
+ * @param target If target is negative, it is treated as length+target where length is the
+ * length of the array.
+ * @param start If start is negative, it is treated as length+start. If end is negative, it
+ * is treated as length+end.
+ * @param end If not specified, length of the this object is used as its default value.
+ */
+ copyWithin(target: number, start: number, end?: number): this;
+
+ /**
+ * Determines whether all the members of an array satisfy the specified test.
+ * @param callbackfn A function that accepts up to three arguments. The every method calls
+ * the callbackfn function for each element in array1 until the callbackfn returns false,
+ * or until the end of the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ every(callbackfn: (value: number, index: number, array: Float32Array) => boolean, thisArg?: any): boolean;
+
+ /**
+ * Returns the this object after filling the section identified by start and end with value
+ * @param value value to fill array section with
+ * @param start index to start filling the array at. If start is negative, it is treated as
+ * length+start where length is the length of the array.
+ * @param end index to stop filling the array at. If end is negative, it is treated as
+ * length+end.
+ */
+ fill(value: number, start?: number, end?: number): this;
+
+ /**
+ * Returns the elements of an array that meet the condition specified in a callback function.
+ * @param callbackfn A function that accepts up to three arguments. The filter method calls
+ * the callbackfn function one time for each element in the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ filter(callbackfn: (value: number, index: number, array: Float32Array) => any, thisArg?: any): Float32Array;
+
+ /**
+ * Returns the value of the first element in the array where predicate is true, and undefined
+ * otherwise.
+ * @param predicate find calls predicate once for each element of the array, in ascending
+ * order, until it finds one where predicate returns true. If such an element is found, find
+ * immediately returns that element value. Otherwise, find returns undefined.
+ * @param thisArg If provided, it will be used as the this value for each invocation of
+ * predicate. If it is not provided, undefined is used instead.
+ */
+ find(predicate: (value: number, index: number, obj: Array<number>) => boolean, thisArg?: any): number | undefined;
+
+ /**
+ * Returns the index of the first element in the array where predicate is true, and undefined
+ * otherwise.
+ * @param predicate find calls predicate once for each element of the array, in ascending
+ * order, until it finds one where predicate returns true. If such an element is found,
+ * findIndex immediately returns that element index. Otherwise, findIndex returns -1.
+ * @param thisArg If provided, it will be used as the this value for each invocation of
+ * predicate. If it is not provided, undefined is used instead.
+ */
+ findIndex(predicate: (value: number) => boolean, thisArg?: any): number;
+
+ /**
+ * Performs the specified action for each element in an array.
+ * @param callbackfn A function that accepts up to three arguments. forEach calls the
+ * callbackfn function one time for each element in the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ forEach(callbackfn: (value: number, index: number, array: Float32Array) => void, thisArg?: any): void;
+
+ /**
+ * Returns the index of the first occurrence of a value in an array.
+ * @param searchElement The value to locate in the array.
+ * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
+ * search starts at index 0.
+ */
+ indexOf(searchElement: number, fromIndex?: number): number;
+
+ /**
+ * Adds all the elements of an array separated by the specified separator string.
+ * @param separator A string used to separate one element of an array from the next in the
+ * resulting String. If omitted, the array elements are separated with a comma.
+ */
+ join(separator?: string): string;
+
+ /**
+ * Returns the index of the last occurrence of a value in an array.
+ * @param searchElement The value to locate in the array.
+ * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
+ * search starts at index 0.
+ */
+ lastIndexOf(searchElement: number, fromIndex?: number): number;
+
+ /**
+ * The length of the array.
+ */
+ readonly length: number;
+
+ /**
+ * Calls a defined callback function on each element of an array, and returns an array that
+ * contains the results.
+ * @param callbackfn A function that accepts up to three arguments. The map method calls the
+ * callbackfn function one time for each element in the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ map(callbackfn: (value: number, index: number, array: Float32Array) => number, thisArg?: any): Float32Array;
+
+ /**
+ * Calls the specified callback function for all the elements in an array. The return value of
+ * the callback function is the accumulated result, and is provided as an argument in the next
+ * call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
+ * callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
+ * the accumulation. The first call to the callbackfn function provides this value as an argument
+ * instead of an array value.
+ */
+ reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float32Array) => number, initialValue?: number): number;
+
+ /**
+ * Calls the specified callback function for all the elements in an array. The return value of
+ * the callback function is the accumulated result, and is provided as an argument in the next
+ * call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
+ * callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
+ * the accumulation. The first call to the callbackfn function provides this value as an argument
+ * instead of an array value.
+ */
+ reduce<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float32Array) => U, initialValue: U): U;
+
+ /**
+ * Calls the specified callback function for all the elements in an array, in descending order.
+ * The return value of the callback function is the accumulated result, and is provided as an
+ * argument in the next call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
+ * the callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
+ * the accumulation. The first call to the callbackfn function provides this value as an
+ * argument instead of an array value.
+ */
+ reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float32Array) => number, initialValue?: number): number;
+
+ /**
+ * Calls the specified callback function for all the elements in an array, in descending order.
+ * The return value of the callback function is the accumulated result, and is provided as an
+ * argument in the next call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
+ * the callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
+ * the accumulation. The first call to the callbackfn function provides this value as an argument
+ * instead of an array value.
+ */
+ reduceRight<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float32Array) => U, initialValue: U): U;
+
+ /**
+ * Reverses the elements in an Array.
+ */
+ reverse(): Float32Array;
+
+ /**
+ * Sets a value or an array of values.
+ * @param index The index of the location to set.
+ * @param value The value to set.
+ */
+ set(index: number, value: number): void;
+
+ /**
+ * Sets a value or an array of values.
+ * @param array A typed or untyped array of values to set.
+ * @param offset The index in the current array at which the values are to be written.
+ */
+ set(array: ArrayLike<number>, offset?: number): void;
+
+ /**
+ * Returns a section of an array.
+ * @param start The beginning of the specified portion of the array.
+ * @param end The end of the specified portion of the array.
+ */
+ slice(start?: number, end?: number): Float32Array;
+
+ /**
+ * Determines whether the specified callback function returns true for any element of an array.
+ * @param callbackfn A function that accepts up to three arguments. The some method calls the
+ * callbackfn function for each element in array1 until the callbackfn returns true, or until
+ * the end of the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ some(callbackfn: (value: number, index: number, array: Float32Array) => boolean, thisArg?: any): boolean;
+
+ /**
+ * Sorts an array.
+ * @param compareFn The name of the function used to determine the order of the elements. If
+ * omitted, the elements are sorted in ascending, ASCII character order.
+ */
+ sort(compareFn?: (a: number, b: number) => number): this;
+
+ /**
+ * Gets a new Float32Array view of the ArrayBuffer store for this array, referencing the elements
+ * at begin, inclusive, up to end, exclusive.
+ * @param begin The index of the beginning of the array.
+ * @param end The index of the end of the array.
+ */
+ subarray(begin: number, end?: number): Float32Array;
+
+ /**
+ * Converts a number to a string by using the current locale.
+ */
+ toLocaleString(): string;
+
+ /**
+ * Returns a string representation of an array.
+ */
+ toString(): string;
+
+ [index: number]: number;
+}
+
+interface Float32ArrayConstructor {
+ readonly prototype: Float32Array;
+ new (length: number): Float32Array;
+ new (array: ArrayLike<number>): Float32Array;
+ new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Float32Array;
+
+ /**
+ * The size in bytes of each element in the array.
+ */
+ readonly BYTES_PER_ELEMENT: number;
+
+ /**
+ * Returns a new array from a set of elements.
+ * @param items A set of elements to include in the new array object.
+ */
+ of(...items: number[]): Float32Array;
+
+ /**
+ * Creates an array from an array-like or iterable object.
+ * @param arrayLike An array-like or iterable object to convert to an array.
+ * @param mapfn A mapping function to call on every element of the array.
+ * @param thisArg Value of 'this' used to invoke the mapfn.
+ */
+ from(arrayLike: ArrayLike<number>, mapfn?: (v: number, k: number) => number, thisArg?: any): Float32Array;
+
+}
+declare const Float32Array: Float32ArrayConstructor;
+
+/**
+ * A typed array of 64-bit float values. The contents are initialized to 0. If the requested
+ * number of bytes could not be allocated an exception is raised.
+ */
+interface Float64Array {
+ /**
+ * The size in bytes of each element in the array.
+ */
+ readonly BYTES_PER_ELEMENT: number;
+
+ /**
+ * The ArrayBuffer instance referenced by the array.
+ */
+ readonly buffer: ArrayBuffer;
+
+ /**
+ * The length in bytes of the array.
+ */
+ readonly byteLength: number;
+
+ /**
+ * The offset in bytes of the array.
+ */
+ readonly byteOffset: number;
+
+ /**
+ * Returns the this object after copying a section of the array identified by start and end
+ * to the same array starting at position target
+ * @param target If target is negative, it is treated as length+target where length is the
+ * length of the array.
+ * @param start If start is negative, it is treated as length+start. If end is negative, it
+ * is treated as length+end.
+ * @param end If not specified, length of the this object is used as its default value.
+ */
+ copyWithin(target: number, start: number, end?: number): this;
+
+ /**
+ * Determines whether all the members of an array satisfy the specified test.
+ * @param callbackfn A function that accepts up to three arguments. The every method calls
+ * the callbackfn function for each element in array1 until the callbackfn returns false,
+ * or until the end of the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ every(callbackfn: (value: number, index: number, array: Float64Array) => boolean, thisArg?: any): boolean;
+
+ /**
+ * Returns the this object after filling the section identified by start and end with value
+ * @param value value to fill array section with
+ * @param start index to start filling the array at. If start is negative, it is treated as
+ * length+start where length is the length of the array.
+ * @param end index to stop filling the array at. If end is negative, it is treated as
+ * length+end.
+ */
+ fill(value: number, start?: number, end?: number): this;
+
+ /**
+ * Returns the elements of an array that meet the condition specified in a callback function.
+ * @param callbackfn A function that accepts up to three arguments. The filter method calls
+ * the callbackfn function one time for each element in the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ filter(callbackfn: (value: number, index: number, array: Float64Array) => any, thisArg?: any): Float64Array;
+
+ /**
+ * Returns the value of the first element in the array where predicate is true, and undefined
+ * otherwise.
+ * @param predicate find calls predicate once for each element of the array, in ascending
+ * order, until it finds one where predicate returns true. If such an element is found, find
+ * immediately returns that element value. Otherwise, find returns undefined.
+ * @param thisArg If provided, it will be used as the this value for each invocation of
+ * predicate. If it is not provided, undefined is used instead.
+ */
+ find(predicate: (value: number, index: number, obj: Array<number>) => boolean, thisArg?: any): number | undefined;
+
+ /**
+ * Returns the index of the first element in the array where predicate is true, and undefined
+ * otherwise.
+ * @param predicate find calls predicate once for each element of the array, in ascending
+ * order, until it finds one where predicate returns true. If such an element is found,
+ * findIndex immediately returns that element index. Otherwise, findIndex returns -1.
+ * @param thisArg If provided, it will be used as the this value for each invocation of
+ * predicate. If it is not provided, undefined is used instead.
+ */
+ findIndex(predicate: (value: number) => boolean, thisArg?: any): number;
+
+ /**
+ * Performs the specified action for each element in an array.
+ * @param callbackfn A function that accepts up to three arguments. forEach calls the
+ * callbackfn function one time for each element in the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ forEach(callbackfn: (value: number, index: number, array: Float64Array) => void, thisArg?: any): void;
+
+ /**
+ * Returns the index of the first occurrence of a value in an array.
+ * @param searchElement The value to locate in the array.
+ * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
+ * search starts at index 0.
+ */
+ indexOf(searchElement: number, fromIndex?: number): number;
+
+ /**
+ * Adds all the elements of an array separated by the specified separator string.
+ * @param separator A string used to separate one element of an array from the next in the
+ * resulting String. If omitted, the array elements are separated with a comma.
+ */
+ join(separator?: string): string;
+
+ /**
+ * Returns the index of the last occurrence of a value in an array.
+ * @param searchElement The value to locate in the array.
+ * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
+ * search starts at index 0.
+ */
+ lastIndexOf(searchElement: number, fromIndex?: number): number;
+
+ /**
+ * The length of the array.
+ */
+ readonly length: number;
+
+ /**
+ * Calls a defined callback function on each element of an array, and returns an array that
+ * contains the results.
+ * @param callbackfn A function that accepts up to three arguments. The map method calls the
+ * callbackfn function one time for each element in the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ map(callbackfn: (value: number, index: number, array: Float64Array) => number, thisArg?: any): Float64Array;
+
+ /**
+ * Calls the specified callback function for all the elements in an array. The return value of
+ * the callback function is the accumulated result, and is provided as an argument in the next
+ * call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
+ * callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
+ * the accumulation. The first call to the callbackfn function provides this value as an argument
+ * instead of an array value.
+ */
+ reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float64Array) => number, initialValue?: number): number;
+
+ /**
+ * Calls the specified callback function for all the elements in an array. The return value of
+ * the callback function is the accumulated result, and is provided as an argument in the next
+ * call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
+ * callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
+ * the accumulation. The first call to the callbackfn function provides this value as an argument
+ * instead of an array value.
+ */
+ reduce<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float64Array) => U, initialValue: U): U;
+
+ /**
+ * Calls the specified callback function for all the elements in an array, in descending order.
+ * The return value of the callback function is the accumulated result, and is provided as an
+ * argument in the next call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
+ * the callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
+ * the accumulation. The first call to the callbackfn function provides this value as an
+ * argument instead of an array value.
+ */
+ reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float64Array) => number, initialValue?: number): number;
+
+ /**
+ * Calls the specified callback function for all the elements in an array, in descending order.
+ * The return value of the callback function is the accumulated result, and is provided as an
+ * argument in the next call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
+ * the callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
+ * the accumulation. The first call to the callbackfn function provides this value as an argument
+ * instead of an array value.
+ */
+ reduceRight<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float64Array) => U, initialValue: U): U;
+
+ /**
+ * Reverses the elements in an Array.
+ */
+ reverse(): Float64Array;
+
+ /**
+ * Sets a value or an array of values.
+ * @param index The index of the location to set.
+ * @param value The value to set.
+ */
+ set(index: number, value: number): void;
+
+ /**
+ * Sets a value or an array of values.
+ * @param array A typed or untyped array of values to set.
+ * @param offset The index in the current array at which the values are to be written.
+ */
+ set(array: ArrayLike<number>, offset?: number): void;
+
+ /**
+ * Returns a section of an array.
+ * @param start The beginning of the specified portion of the array.
+ * @param end The end of the specified portion of the array.
+ */
+ slice(start?: number, end?: number): Float64Array;
+
+ /**
+ * Determines whether the specified callback function returns true for any element of an array.
+ * @param callbackfn A function that accepts up to three arguments. The some method calls the
+ * callbackfn function for each element in array1 until the callbackfn returns true, or until
+ * the end of the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ some(callbackfn: (value: number, index: number, array: Float64Array) => boolean, thisArg?: any): boolean;
+
+ /**
+ * Sorts an array.
+ * @param compareFn The name of the function used to determine the order of the elements. If
+ * omitted, the elements are sorted in ascending, ASCII character order.
+ */
+ sort(compareFn?: (a: number, b: number) => number): this;
+
+ /**
+ * Gets a new Float64Array view of the ArrayBuffer store for this array, referencing the elements
+ * at begin, inclusive, up to end, exclusive.
+ * @param begin The index of the beginning of the array.
+ * @param end The index of the end of the array.
+ */
+ subarray(begin: number, end?: number): Float64Array;
+
+ /**
+ * Converts a number to a string by using the current locale.
+ */
+ toLocaleString(): string;
+
+ /**
+ * Returns a string representation of an array.
+ */
+ toString(): string;
+
+ [index: number]: number;
+}
+
+interface Float64ArrayConstructor {
+ readonly prototype: Float64Array;
+ new (length: number): Float64Array;
+ new (array: ArrayLike<number>): Float64Array;
+ new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Float64Array;
+
+ /**
+ * The size in bytes of each element in the array.
+ */
+ readonly BYTES_PER_ELEMENT: number;
+
+ /**
+ * Returns a new array from a set of elements.
+ * @param items A set of elements to include in the new array object.
+ */
+ of(...items: number[]): Float64Array;
+
+ /**
+ * Creates an array from an array-like or iterable object.
+ * @param arrayLike An array-like or iterable object to convert to an array.
+ * @param mapfn A mapping function to call on every element of the array.
+ * @param thisArg Value of 'this' used to invoke the mapfn.
+ */
+ from(arrayLike: ArrayLike<number>, mapfn?: (v: number, k: number) => number, thisArg?: any): Float64Array;
+}
+declare const Float64Array: Float64ArrayConstructor;
+
+/////////////////////////////
+/// ECMAScript Internationalization API
+/////////////////////////////
+
+declare module Intl {
+ interface CollatorOptions {
+ usage?: string;
+ localeMatcher?: string;
+ numeric?: boolean;
+ caseFirst?: string;
+ sensitivity?: string;
+ ignorePunctuation?: boolean;
+ }
+
+ interface ResolvedCollatorOptions {
+ locale: string;
+ usage: string;
+ sensitivity: string;
+ ignorePunctuation: boolean;
+ collation: string;
+ caseFirst: string;
+ numeric: boolean;
+ }
+
+ interface Collator {
+ compare(x: string, y: string): number;
+ resolvedOptions(): ResolvedCollatorOptions;
+ }
+ var Collator: {
+ new (locales?: string[], options?: CollatorOptions): Collator;
+ new (locale?: string, options?: CollatorOptions): Collator;
+ (locales?: string[], options?: CollatorOptions): Collator;
+ (locale?: string, options?: CollatorOptions): Collator;
+ supportedLocalesOf(locales: string[], options?: CollatorOptions): string[];
+ supportedLocalesOf(locale: string, options?: CollatorOptions): string[];
+ }
+
+ interface NumberFormatOptions {
+ localeMatcher?: string;
+ style?: string;
+ currency?: string;
+ currencyDisplay?: string;
+ useGrouping?: boolean;
+ minimumIntegerDigits?: number;
+ minimumFractionDigits?: number;
+ maximumFractionDigits?: number;
+ minimumSignificantDigits?: number;
+ maximumSignificantDigits?: number;
+ }
+
+ interface ResolvedNumberFormatOptions {
+ locale: string;
+ numberingSystem: string;
+ style: string;
+ currency?: string;
+ currencyDisplay?: string;
+ minimumIntegerDigits: number;
+ minimumFractionDigits: number;
+ maximumFractionDigits: number;
+ minimumSignificantDigits?: number;
+ maximumSignificantDigits?: number;
+ useGrouping: boolean;
+ }
+
+ interface NumberFormat {
+ format(value: number): string;
+ resolvedOptions(): ResolvedNumberFormatOptions;
+ }
+ var NumberFormat: {
+ new (locales?: string[], options?: NumberFormatOptions): NumberFormat;
+ new (locale?: string, options?: NumberFormatOptions): NumberFormat;
+ (locales?: string[], options?: NumberFormatOptions): NumberFormat;
+ (locale?: string, options?: NumberFormatOptions): NumberFormat;
+ supportedLocalesOf(locales: string[], options?: NumberFormatOptions): string[];
+ supportedLocalesOf(locale: string, options?: NumberFormatOptions): string[];
+ }
+
+ interface DateTimeFormatOptions {
+ localeMatcher?: string;
+ weekday?: string;
+ era?: string;
+ year?: string;
+ month?: string;
+ day?: string;
+ hour?: string;
+ minute?: string;
+ second?: string;
+ timeZoneName?: string;
+ formatMatcher?: string;
+ hour12?: boolean;
+ timeZone?: string;
+ }
+
+ interface ResolvedDateTimeFormatOptions {
+ locale: string;
+ calendar: string;
+ numberingSystem: string;
+ timeZone: string;
+ hour12?: boolean;
+ weekday?: string;
+ era?: string;
+ year?: string;
+ month?: string;
+ day?: string;
+ hour?: string;
+ minute?: string;
+ second?: string;
+ timeZoneName?: string;
+ }
+
+ interface DateTimeFormat {
+ format(date?: Date | number): string;
+ resolvedOptions(): ResolvedDateTimeFormatOptions;
+ }
+ var DateTimeFormat: {
+ new (locales?: string[], options?: DateTimeFormatOptions): DateTimeFormat;
+ new (locale?: string, options?: DateTimeFormatOptions): DateTimeFormat;
+ (locales?: string[], options?: DateTimeFormatOptions): DateTimeFormat;
+ (locale?: string, options?: DateTimeFormatOptions): DateTimeFormat;
+ supportedLocalesOf(locales: string[], options?: DateTimeFormatOptions): string[];
+ supportedLocalesOf(locale: string, options?: DateTimeFormatOptions): string[];
+ }
+}
+
+interface String {
+ /**
+ * Determines whether two strings are equivalent in the current locale.
+ * @param that String to compare to target string
+ * @param locales An array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used. This parameter must conform to BCP 47 standards; see the Intl.Collator object for details.
+ * @param options An object that contains one or more properties that specify comparison options. see the Intl.Collator object for details.
+ */
+ localeCompare(that: string, locales: string[], options?: Intl.CollatorOptions): number;
+
+ /**
+ * Determines whether two strings are equivalent in the current locale.
+ * @param that String to compare to target string
+ * @param locale Locale tag. If you omit this parameter, the default locale of the JavaScript runtime is used. This parameter must conform to BCP 47 standards; see the Intl.Collator object for details.
+ * @param options An object that contains one or more properties that specify comparison options. see the Intl.Collator object for details.
+ */
+ localeCompare(that: string, locale: string, options?: Intl.CollatorOptions): number;
+}
+
+interface Number {
+ /**
+ * Converts a number to a string by using the current or specified locale.
+ * @param locales An array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used.
+ * @param options An object that contains one or more properties that specify comparison options.
+ */
+ toLocaleString(locales?: string[], options?: Intl.NumberFormatOptions): string;
+
+ /**
+ * Converts a number to a string by using the current or specified locale.
+ * @param locale Locale tag. If you omit this parameter, the default locale of the JavaScript runtime is used.
+ * @param options An object that contains one or more properties that specify comparison options.
+ */
+ toLocaleString(locale?: string, options?: Intl.NumberFormatOptions): string;
+}
+
+interface Date {
+ /**
+ * Converts a date and time to a string by using the current or specified locale.
+ * @param locales An array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used.
+ * @param options An object that contains one or more properties that specify comparison options.
+ */
+ toLocaleString(locales?: string[], options?: Intl.DateTimeFormatOptions): string;
+ /**
+ * Converts a date to a string by using the current or specified locale.
+ * @param locales An array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used.
+ * @param options An object that contains one or more properties that specify comparison options.
+ */
+ toLocaleDateString(locales?: string[], options?: Intl.DateTimeFormatOptions): string;
+
+ /**
+ * Converts a time to a string by using the current or specified locale.
+ * @param locale Locale tag. If you omit this parameter, the default locale of the JavaScript runtime is used.
+ * @param options An object that contains one or more properties that specify comparison options.
+ */
+ toLocaleTimeString(locale?: string[], options?: Intl.DateTimeFormatOptions): string;
+
+ /**
+ * Converts a date and time to a string by using the current or specified locale.
+ * @param locale Locale tag. If you omit this parameter, the default locale of the JavaScript runtime is used.
+ * @param options An object that contains one or more properties that specify comparison options.
+ */
+ toLocaleString(locale?: string, options?: Intl.DateTimeFormatOptions): string;
+
+ /**
+ * Converts a date to a string by using the current or specified locale.
+ * @param locale Locale tag. If you omit this parameter, the default locale of the JavaScript runtime is used.
+ * @param options An object that contains one or more properties that specify comparison options.
+ */
+ toLocaleDateString(locale?: string, options?: Intl.DateTimeFormatOptions): string;
+
+ /**
+ * Converts a time to a string by using the current or specified locale.
+ * @param locale Locale tag. If you omit this parameter, the default locale of the JavaScript runtime is used.
+ * @param options An object that contains one or more properties that specify comparison options.
+ */
+ toLocaleTimeString(locale?: string, options?: Intl.DateTimeFormatOptions): string;
+}
+declare type PropertyKey = string | number | symbol;
+
+interface Array<T> {
+ /**
+ * Returns the value of the first element in the array where predicate is true, and undefined
+ * otherwise.
+ * @param predicate find calls predicate once for each element of the array, in ascending
+ * order, until it finds one where predicate returns true. If such an element is found, find
+ * immediately returns that element value. Otherwise, find returns undefined.
+ * @param thisArg If provided, it will be used as the this value for each invocation of
+ * predicate. If it is not provided, undefined is used instead.
+ */
+ find(predicate: (value: T, index: number, obj: Array<T>) => boolean, thisArg?: any): T | undefined;
+
+ /**
+ * Returns the index of the first element in the array where predicate is true, and undefined
+ * otherwise.
+ * @param predicate find calls predicate once for each element of the array, in ascending
+ * order, until it finds one where predicate returns true. If such an element is found,
+ * findIndex immediately returns that element index. Otherwise, findIndex returns -1.
+ * @param thisArg If provided, it will be used as the this value for each invocation of
+ * predicate. If it is not provided, undefined is used instead.
+ */
+ findIndex(predicate: (value: T) => boolean, thisArg?: any): number;
+
+ /**
+ * Returns the this object after filling the section identified by start and end with value
+ * @param value value to fill array section with
+ * @param start index to start filling the array at. If start is negative, it is treated as
+ * length+start where length is the length of the array.
+ * @param end index to stop filling the array at. If end is negative, it is treated as
+ * length+end.
+ */
+ fill(value: T, start?: number, end?: number): this;
+
+ /**
+ * Returns the this object after copying a section of the array identified by start and end
+ * to the same array starting at position target
+ * @param target If target is negative, it is treated as length+target where length is the
+ * length of the array.
+ * @param start If start is negative, it is treated as length+start. If end is negative, it
+ * is treated as length+end.
+ * @param end If not specified, length of the this object is used as its default value.
+ */
+ copyWithin(target: number, start: number, end?: number): this;
+}
+
+interface ArrayConstructor {
+ /**
+ * Creates an array from an array-like object.
+ * @param arrayLike An array-like object to convert to an array.
+ * @param mapfn A mapping function to call on every element of the array.
+ * @param thisArg Value of 'this' used to invoke the mapfn.
+ */
+ from<T, U>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): Array<U>;
+
+
+ /**
+ * Creates an array from an array-like object.
+ * @param arrayLike An array-like object to convert to an array.
+ */
+ from<T>(arrayLike: ArrayLike<T>): Array<T>;
+
+ /**
+ * Returns a new array from a set of elements.
+ * @param items A set of elements to include in the new array object.
+ */
+ of<T>(...items: T[]): Array<T>;
+}
+
+interface DateConstructor {
+ new (value: Date): Date;
+}
+
+interface Function {
+ /**
+ * Returns the name of the function. Function names are read-only and can not be changed.
+ */
+ readonly name: string;
+}
+
+interface Math {
+ /**
+ * Returns the number of leading zero bits in the 32-bit binary representation of a number.
+ * @param x A numeric expression.
+ */
+ clz32(x: number): number;
+
+ /**
+ * Returns the result of 32-bit multiplication of two numbers.
+ * @param x First number
+ * @param y Second number
+ */
+ imul(x: number, y: number): number;
+
+ /**
+ * Returns the sign of the x, indicating whether x is positive, negative or zero.
+ * @param x The numeric expression to test
+ */
+ sign(x: number): number;
+
+ /**
+ * Returns the base 10 logarithm of a number.
+ * @param x A numeric expression.
+ */
+ log10(x: number): number;
+
+ /**
+ * Returns the base 2 logarithm of a number.
+ * @param x A numeric expression.
+ */
+ log2(x: number): number;
+
+ /**
+ * Returns the natural logarithm of 1 + x.
+ * @param x A numeric expression.
+ */
+ log1p(x: number): number;
+
+ /**
+ * Returns the result of (e^x - 1) of x (e raised to the power of x, where e is the base of
+ * the natural logarithms).
+ * @param x A numeric expression.
+ */
+ expm1(x: number): number;
+
+ /**
+ * Returns the hyperbolic cosine of a number.
+ * @param x A numeric expression that contains an angle measured in radians.
+ */
+ cosh(x: number): number;
+
+ /**
+ * Returns the hyperbolic sine of a number.
+ * @param x A numeric expression that contains an angle measured in radians.
+ */
+ sinh(x: number): number;
+
+ /**
+ * Returns the hyperbolic tangent of a number.
+ * @param x A numeric expression that contains an angle measured in radians.
+ */
+ tanh(x: number): number;
+
+ /**
+ * Returns the inverse hyperbolic cosine of a number.
+ * @param x A numeric expression that contains an angle measured in radians.
+ */
+ acosh(x: number): number;
+
+ /**
+ * Returns the inverse hyperbolic sine of a number.
+ * @param x A numeric expression that contains an angle measured in radians.
+ */
+ asinh(x: number): number;
+
+ /**
+ * Returns the inverse hyperbolic tangent of a number.
+ * @param x A numeric expression that contains an angle measured in radians.
+ */
+ atanh(x: number): number;
+
+ /**
+ * Returns the square root of the sum of squares of its arguments.
+ * @param values Values to compute the square root for.
+ * If no arguments are passed, the result is +0.
+ * If there is only one argument, the result is the absolute value.
+ * If any argument is +Infinity or -Infinity, the result is +Infinity.
+ * If any argument is NaN, the result is NaN.
+ * If all arguments are either +0 or −0, the result is +0.
+ */
+ hypot(...values: number[] ): number;
+
+ /**
+ * Returns the integral part of the a numeric expression, x, removing any fractional digits.
+ * If x is already an integer, the result is x.
+ * @param x A numeric expression.
+ */
+ trunc(x: number): number;
+
+ /**
+ * Returns the nearest single precision float representation of a number.
+ * @param x A numeric expression.
+ */
+ fround(x: number): number;
+
+ /**
+ * Returns an implementation-dependent approximation to the cube root of number.
+ * @param x A numeric expression.
+ */
+ cbrt(x: number): number;
+}
+
+interface NumberConstructor {
+ /**
+ * The value of Number.EPSILON is the difference between 1 and the smallest value greater than 1
+ * that is representable as a Number value, which is approximately:
+ * 2.2204460492503130808472633361816 x 10‍−‍16.
+ */
+ readonly EPSILON: number;
+
+ /**
+ * Returns true if passed value is finite.
+ * Unlike the global isFininte, Number.isFinite doesn't forcibly convert the parameter to a
+ * number. Only finite values of the type number, result in true.
+ * @param number A numeric value.
+ */
+ isFinite(number: number): boolean;
+
+ /**
+ * Returns true if the value passed is an integer, false otherwise.
+ * @param number A numeric value.
+ */
+ isInteger(number: number): boolean;
+
+ /**
+ * Returns a Boolean value that indicates whether a value is the reserved value NaN (not a
+ * number). Unlike the global isNaN(), Number.isNaN() doesn't forcefully convert the parameter
+ * to a number. Only values of the type number, that are also NaN, result in true.
+ * @param number A numeric value.
+ */
+ isNaN(number: number): boolean;
+
+ /**
+ * Returns true if the value passed is a safe integer.
+ * @param number A numeric value.
+ */
+ isSafeInteger(number: number): boolean;
+
+ /**
+ * The value of the largest integer n such that n and n + 1 are both exactly representable as
+ * a Number value.
+ * The value of Number.MAX_SAFE_INTEGER is 9007199254740991 2^53 − 1.
+ */
+ readonly MAX_SAFE_INTEGER: number;
+
+ /**
+ * The value of the smallest integer n such that n and n − 1 are both exactly representable as
+ * a Number value.
+ * The value of Number.MIN_SAFE_INTEGER is −9007199254740991 (−(2^53 − 1)).
+ */
+ readonly MIN_SAFE_INTEGER: number;
+
+ /**
+ * Converts a string to a floating-point number.
+ * @param string A string that contains a floating-point number.
+ */
+ parseFloat(string: string): number;
+
+ /**
+ * Converts A string to an integer.
+ * @param s A string to convert into a number.
+ * @param radix A value between 2 and 36 that specifies the base of the number in numString.
+ * If this argument is not supplied, strings with a prefix of '0x' are considered hexadecimal.
+ * All other strings are considered decimal.
+ */
+ parseInt(string: string, radix?: number): number;
+}
+
+interface Object {
+ /**
+ * Determines whether an object has a property with the specified name.
+ * @param v A property name.
+ */
+ hasOwnProperty(v: PropertyKey): boolean
+
+ /**
+ * Determines whether a specified property is enumerable.
+ * @param v A property name.
+ */
+ propertyIsEnumerable(v: PropertyKey): boolean;
+}
+
+interface ObjectConstructor {
+ /**
+ * Copy the values of all of the enumerable own properties from one or more source objects to a
+ * target object. Returns the target object.
+ * @param target The target object to copy to.
+ * @param source The source object from which to copy properties.
+ */
+ assign<T, U>(target: T, source: U): T & U;
+
+ /**
+ * Copy the values of all of the enumerable own properties from one or more source objects to a
+ * target object. Returns the target object.
+ * @param target The target object to copy to.
+ * @param source1 The first source object from which to copy properties.
+ * @param source2 The second source object from which to copy properties.
+ */
+ assign<T, U, V>(target: T, source1: U, source2: V): T & U & V;
+
+ /**
+ * Copy the values of all of the enumerable own properties from one or more source objects to a
+ * target object. Returns the target object.
+ * @param target The target object to copy to.
+ * @param source1 The first source object from which to copy properties.
+ * @param source2 The second source object from which to copy properties.
+ * @param source3 The third source object from which to copy properties.
+ */
+ assign<T, U, V, W>(target: T, source1: U, source2: V, source3: W): T & U & V & W;
+
+ /**
+ * Copy the values of all of the enumerable own properties from one or more source objects to a
+ * target object. Returns the target object.
+ * @param target The target object to copy to.
+ * @param sources One or more source objects from which to copy properties
+ */
+ assign(target: any, ...sources: any[]): any;
+
+ /**
+ * Returns an array of all symbol properties found directly on object o.
+ * @param o Object to retrieve the symbols from.
+ */
+ getOwnPropertySymbols(o: any): symbol[];
+
+ /**
+ * Returns true if the values are the same value, false otherwise.
+ * @param value1 The first value.
+ * @param value2 The second value.
+ */
+ is(value1: any, value2: any): boolean;
+
+ /**
+ * Sets the prototype of a specified object o to object proto or null. Returns the object o.
+ * @param o The object to change its prototype.
+ * @param proto The value of the new prototype or null.
+ */
+ setPrototypeOf(o: any, proto: any): any;
+
+ /**
+ * Gets the own property descriptor of the specified object.
+ * An own property descriptor is one that is defined directly on the object and is not
+ * inherited from the object's prototype.
+ * @param o Object that contains the property.
+ * @param p Name of the property.
+ */
+ getOwnPropertyDescriptor(o: any, propertyKey: PropertyKey): PropertyDescriptor;
+
+ /**
+ * Adds a property to an object, or modifies attributes of an existing property.
+ * @param o Object on which to add or modify the property. This can be a native JavaScript
+ * object (that is, a user-defined object or a built in object) or a DOM object.
+ * @param p The property name.
+ * @param attributes Descriptor for the property. It can be for a data property or an accessor
+ * property.
+ */
+ defineProperty(o: any, propertyKey: PropertyKey, attributes: PropertyDescriptor): any;
+}
+
+interface ReadonlyArray<T> {
+ /**
+ * Returns the value of the first element in the array where predicate is true, and undefined
+ * otherwise.
+ * @param predicate find calls predicate once for each element of the array, in ascending
+ * order, until it finds one where predicate returns true. If such an element is found, find
+ * immediately returns that element value. Otherwise, find returns undefined.
+ * @param thisArg If provided, it will be used as the this value for each invocation of
+ * predicate. If it is not provided, undefined is used instead.
+ */
+ find(predicate: (value: T, index: number, obj: ReadonlyArray<T>) => boolean, thisArg?: any): T | undefined;
+
+ /**
+ * Returns the index of the first element in the array where predicate is true, and undefined
+ * otherwise.
+ * @param predicate find calls predicate once for each element of the array, in ascending
+ * order, until it finds one where predicate returns true. If such an element is found,
+ * findIndex immediately returns that element index. Otherwise, findIndex returns -1.
+ * @param thisArg If provided, it will be used as the this value for each invocation of
+ * predicate. If it is not provided, undefined is used instead.
+ */
+ findIndex(predicate: (value: T) => boolean, thisArg?: any): number;
+}
+
+interface RegExp {
+ /**
+ * Returns a string indicating the flags of the regular expression in question. This field is read-only.
+ * The characters in this string are sequenced and concatenated in the following order:
+ *
+ * - "g" for global
+ * - "i" for ignoreCase
+ * - "m" for multiline
+ * - "u" for unicode
+ * - "y" for sticky
+ *
+ * If no flags are set, the value is the empty string.
+ */
+ readonly flags: string;
+
+ /**
+ * Returns a Boolean value indicating the state of the sticky flag (y) used with a regular
+ * expression. Default is false. Read-only.
+ */
+ readonly sticky: boolean;
+
+ /**
+ * Returns a Boolean value indicating the state of the Unicode flag (u) used with a regular
+ * expression. Default is false. Read-only.
+ */
+ readonly unicode: boolean;
+}
+
+interface RegExpConstructor {
+ new (pattern: RegExp, flags?: string): RegExp;
+ (pattern: RegExp, flags?: string): RegExp;
+}
+
+interface String {
+ /**
+ * Returns a nonnegative integer Number less than 1114112 (0x110000) that is the code point
+ * value of the UTF-16 encoded code point starting at the string element at position pos in
+ * the String resulting from converting this object to a String.
+ * If there is no element at that position, the result is undefined.
+ * If a valid UTF-16 surrogate pair does not begin at pos, the result is the code unit at pos.
+ */
+ codePointAt(pos: number): number | undefined;
+
+ /**
+ * Returns true if searchString appears as a substring of the result of converting this
+ * object to a String, at one or more positions that are
+ * greater than or equal to position; otherwise, returns false.
+ * @param searchString search string
+ * @param position If position is undefined, 0 is assumed, so as to search all of the String.
+ */
+ includes(searchString: string, position?: number): boolean;
+
+ /**
+ * Returns true if the sequence of elements of searchString converted to a String is the
+ * same as the corresponding elements of this object (converted to a String) starting at
+ * endPosition – length(this). Otherwise returns false.
+ */
+ endsWith(searchString: string, endPosition?: number): boolean;
+
+ /**
+ * Returns the String value result of normalizing the string into the normalization form
+ * named by form as specified in Unicode Standard Annex #15, Unicode Normalization Forms.
+ * @param form Applicable values: "NFC", "NFD", "NFKC", or "NFKD", If not specified default
+ * is "NFC"
+ */
+ normalize(form: "NFC" | "NFD" | "NFKC" | "NFKD"): string;
+
+ /**
+ * Returns the String value result of normalizing the string into the normalization form
+ * named by form as specified in Unicode Standard Annex #15, Unicode Normalization Forms.
+ * @param form Applicable values: "NFC", "NFD", "NFKC", or "NFKD", If not specified default
+ * is "NFC"
+ */
+ normalize(form?: string): string;
+
+ /**
+ * Returns a String value that is made from count copies appended together. If count is 0,
+ * T is the empty String is returned.
+ * @param count number of copies to append
+ */
+ repeat(count: number): string;
+
+ /**
+ * Returns true if the sequence of elements of searchString converted to a String is the
+ * same as the corresponding elements of this object (converted to a String) starting at
+ * position. Otherwise returns false.
+ */
+ startsWith(searchString: string, position?: number): boolean;
+
+ /**
+ * Returns an <a> HTML anchor element and sets the name attribute to the text value
+ * @param name
+ */
+ anchor(name: string): string;
+
+ /** Returns a <big> HTML element */
+ big(): string;
+
+ /** Returns a <blink> HTML element */
+ blink(): string;
+
+ /** Returns a <b> HTML element */
+ bold(): string;
+
+ /** Returns a <tt> HTML element */
+ fixed(): string
+
+ /** Returns a <font> HTML element and sets the color attribute value */
+ fontcolor(color: string): string
+
+ /** Returns a <font> HTML element and sets the size attribute value */
+ fontsize(size: number): string;
+
+ /** Returns a <font> HTML element and sets the size attribute value */
+ fontsize(size: string): string;
+
+ /** Returns an <i> HTML element */
+ italics(): string;
+
+ /** Returns an <a> HTML element and sets the href attribute value */
+ link(url: string): string;
+
+ /** Returns a <small> HTML element */
+ small(): string;
+
+ /** Returns a <strike> HTML element */
+ strike(): string;
+
+ /** Returns a <sub> HTML element */
+ sub(): string;
+
+ /** Returns a <sup> HTML element */
+ sup(): string;
+}
+
+interface StringConstructor {
+ /**
+ * Return the String value whose elements are, in order, the elements in the List elements.
+ * If length is 0, the empty string is returned.
+ */
+ fromCodePoint(...codePoints: number[]): string;
+
+ /**
+ * String.raw is intended for use as a tag function of a Tagged Template String. When called
+ * as such the first argument will be a well formed template call site object and the rest
+ * parameter will contain the substitution values.
+ * @param template A well-formed template string call site representation.
+ * @param substitutions A set of substitution values.
+ */
+ raw(template: TemplateStringsArray, ...substitutions: any[]): string;
+}
+interface Map<K, V> {
+ clear(): void;
+ delete(key: K): boolean;
+ forEach(callbackfn: (value: V, index: K, map: Map<K, V>) => void, thisArg?: any): void;
+ get(key: K): V | undefined;
+ has(key: K): boolean;
+ set(key: K, value?: V): this;
+ readonly size: number;
+}
+
+interface MapConstructor {
+ new (): Map<any, any>;
+ new <K, V>(entries?: [K, V][]): Map<K, V>;
+ readonly prototype: Map<any, any>;
+}
+declare var Map: MapConstructor;
+
+interface WeakMap<K, V> {
+ clear(): void;
+ delete(key: K): boolean;
+ get(key: K): V | undefined;
+ has(key: K): boolean;
+ set(key: K, value?: V): this;
+}
+
+interface WeakMapConstructor {
+ new (): WeakMap<any, any>;
+ new <K, V>(entries?: [K, V][]): WeakMap<K, V>;
+ readonly prototype: WeakMap<any, any>;
+}
+declare var WeakMap: WeakMapConstructor;
+
+interface Set<T> {
+ add(value: T): this;
+ clear(): void;
+ delete(value: T): boolean;
+ forEach(callbackfn: (value: T, index: T, set: Set<T>) => void, thisArg?: any): void;
+ has(value: T): boolean;
+ readonly size: number;
+}
+
+interface SetConstructor {
+ new (): Set<any>;
+ new <T>(values?: T[]): Set<T>;
+ readonly prototype: Set<any>;
+}
+declare var Set: SetConstructor;
+
+interface WeakSet<T> {
+ add(value: T): this;
+ clear(): void;
+ delete(value: T): boolean;
+ has(value: T): boolean;
+}
+
+interface WeakSetConstructor {
+ new (): WeakSet<any>;
+ new <T>(values?: T[]): WeakSet<T>;
+ readonly prototype: WeakSet<any>;
+}
+declare var WeakSet: WeakSetConstructor;
+interface GeneratorFunction extends Function { }
+
+interface GeneratorFunctionConstructor {
+ /**
+ * Creates a new Generator function.
+ * @param args A list of arguments the function accepts.
+ */
+ new (...args: string[]): GeneratorFunction;
+ (...args: string[]): GeneratorFunction;
+ readonly prototype: GeneratorFunction;
+}
+declare var GeneratorFunction: GeneratorFunctionConstructor;
+/// <reference path="lib.es2015.symbol.d.ts" />
+
+interface SymbolConstructor {
+ /**
+ * A method that returns the default iterator for an object. Called by the semantics of the
+ * for-of statement.
+ */
+ readonly iterator: symbol;
+}
+
+interface IteratorResult<T> {
+ done: boolean;
+ value: T;
+}
+
+interface Iterator<T> {
+ next(value?: any): IteratorResult<T>;
+ return?(value?: any): IteratorResult<T>;
+ throw?(e?: any): IteratorResult<T>;
+}
+
+interface Iterable<T> {
+ [Symbol.iterator](): Iterator<T>;
+}
+
+interface IterableIterator<T> extends Iterator<T> {
+ [Symbol.iterator](): IterableIterator<T>;
+}
+
+interface Array<T> {
+ /** Iterator */
+ [Symbol.iterator](): IterableIterator<T>;
+
+ /**
+ * Returns an array of key, value pairs for every entry in the array
+ */
+ entries(): IterableIterator<[number, T]>;
+
+ /**
+ * Returns an list of keys in the array
+ */
+ keys(): IterableIterator<number>;
+
+ /**
+ * Returns an list of values in the array
+ */
+ values(): IterableIterator<T>;
+}
+
+interface ArrayConstructor {
+ /**
+ * Creates an array from an iterable object.
+ * @param iterable An iterable object to convert to an array.
+ * @param mapfn A mapping function to call on every element of the array.
+ * @param thisArg Value of 'this' used to invoke the mapfn.
+ */
+ from<T, U>(iterable: Iterable<T>, mapfn: (v: T, k: number) => U, thisArg?: any): Array<U>;
+
+ /**
+ * Creates an array from an iterable object.
+ * @param iterable An iterable object to convert to an array.
+ */
+ from<T>(iterable: Iterable<T>): Array<T>;
+}
+
+interface ReadonlyArray<T> {
+ /** Iterator */
+ [Symbol.iterator](): IterableIterator<T>;
+
+ /**
+ * Returns an array of key, value pairs for every entry in the array
+ */
+ entries(): IterableIterator<[number, T]>;
+
+ /**
+ * Returns an list of keys in the array
+ */
+ keys(): IterableIterator<number>;
+
+ /**
+ * Returns an list of values in the array
+ */
+ values(): IterableIterator<T>;
+}
+
+interface IArguments {
+ /** Iterator */
+ [Symbol.iterator](): IterableIterator<any>;
+}
+
+interface Map<K, V> {
+ [Symbol.iterator](): IterableIterator<[K,V]>;
+ entries(): IterableIterator<[K, V]>;
+ keys(): IterableIterator<K>;
+ values(): IterableIterator<V>;
+}
+
+interface MapConstructor {
+ new <K, V>(iterable: Iterable<[K, V]>): Map<K, V>;
+}
+
+interface WeakMap<K, V> { }
+
+interface WeakMapConstructor {
+ new <K, V>(iterable: Iterable<[K, V]>): WeakMap<K, V>;
+}
+
+interface Set<T> {
+ [Symbol.iterator](): IterableIterator<T>;
+ entries(): IterableIterator<[T, T]>;
+ keys(): IterableIterator<T>;
+ values(): IterableIterator<T>;
+}
+
+interface SetConstructor {
+ new <T>(iterable: Iterable<T>): Set<T>;
+}
+
+interface WeakSet<T> { }
+
+interface WeakSetConstructor {
+ new <T>(iterable: Iterable<T>): WeakSet<T>;
+}
+
+interface Promise<T> { }
+
+interface PromiseConstructor {
+ /**
+ * Creates a Promise that is resolved with an array of results when all of the provided Promises
+ * resolve, or rejected when any Promise is rejected.
+ * @param values An array of Promises.
+ * @returns A new Promise.
+ */
+ all<TAll>(values: Iterable<TAll | PromiseLike<TAll>>): Promise<TAll[]>;
+
+ /**
+ * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved
+ * or rejected.
+ * @param values An array of Promises.
+ * @returns A new Promise.
+ */
+ race<T>(values: Iterable<T | PromiseLike<T>>): Promise<T>;
+}
+
+declare namespace Reflect {
+ function enumerate(target: any): IterableIterator<any>;
+}
+
+interface String {
+ /** Iterator */
+ [Symbol.iterator](): IterableIterator<string>;
+}
+
+/**
+ * A typed array of 8-bit integer values. The contents are initialized to 0. If the requested
+ * number of bytes could not be allocated an exception is raised.
+ */
+interface Int8Array {
+ [Symbol.iterator](): IterableIterator<number>;
+ /**
+ * Returns an array of key, value pairs for every entry in the array
+ */
+ entries(): IterableIterator<[number, number]>;
+ /**
+ * Returns an list of keys in the array
+ */
+ keys(): IterableIterator<number>;
+ /**
+ * Returns an list of values in the array
+ */
+ values(): IterableIterator<number>;
+}
+
+interface Int8ArrayConstructor {
+ new (elements: Iterable<number>): Int8Array;
+
+ /**
+ * Creates an array from an array-like or iterable object.
+ * @param arrayLike An array-like or iterable object to convert to an array.
+ * @param mapfn A mapping function to call on every element of the array.
+ * @param thisArg Value of 'this' used to invoke the mapfn.
+ */
+ from(arrayLike: Iterable<number>, mapfn?: (v: number, k: number) => number, thisArg?: any): Int8Array;
+}
+
+/**
+ * A typed array of 8-bit unsigned integer values. The contents are initialized to 0. If the
+ * requested number of bytes could not be allocated an exception is raised.
+ */
+interface Uint8Array {
+ [Symbol.iterator](): IterableIterator<number>;
+ /**
+ * Returns an array of key, value pairs for every entry in the array
+ */
+ entries(): IterableIterator<[number, number]>;
+ /**
+ * Returns an list of keys in the array
+ */
+ keys(): IterableIterator<number>;
+ /**
+ * Returns an list of values in the array
+ */
+ values(): IterableIterator<number>;
+}
+
+interface Uint8ArrayConstructor {
+ new (elements: Iterable<number>): Uint8Array;
+
+ /**
+ * Creates an array from an array-like or iterable object.
+ * @param arrayLike An array-like or iterable object to convert to an array.
+ * @param mapfn A mapping function to call on every element of the array.
+ * @param thisArg Value of 'this' used to invoke the mapfn.
+ */
+ from(arrayLike: Iterable<number>, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint8Array;
+}
+
+/**
+ * A typed array of 8-bit unsigned integer (clamped) values. The contents are initialized to 0.
+ * If the requested number of bytes could not be allocated an exception is raised.
+ */
+interface Uint8ClampedArray {
+ [Symbol.iterator](): IterableIterator<number>;
+ /**
+ * Returns an array of key, value pairs for every entry in the array
+ */
+ entries(): IterableIterator<[number, number]>;
+
+ /**
+ * Returns an list of keys in the array
+ */
+ keys(): IterableIterator<number>;
+
+ /**
+ * Returns an list of values in the array
+ */
+ values(): IterableIterator<number>;
+}
+
+interface Uint8ClampedArrayConstructor {
+ new (elements: Iterable<number>): Uint8ClampedArray;
+
+
+ /**
+ * Creates an array from an array-like or iterable object.
+ * @param arrayLike An array-like or iterable object to convert to an array.
+ * @param mapfn A mapping function to call on every element of the array.
+ * @param thisArg Value of 'this' used to invoke the mapfn.
+ */
+ from(arrayLike: Iterable<number>, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint8ClampedArray;
+}
+
+/**
+ * A typed array of 16-bit signed integer values. The contents are initialized to 0. If the
+ * requested number of bytes could not be allocated an exception is raised.
+ */
+interface Int16Array {
+ [Symbol.iterator](): IterableIterator<number>;
+ /**
+ * Returns an array of key, value pairs for every entry in the array
+ */
+ entries(): IterableIterator<[number, number]>;
+
+ /**
+ * Returns an list of keys in the array
+ */
+ keys(): IterableIterator<number>;
+
+ /**
+ * Returns an list of values in the array
+ */
+ values(): IterableIterator<number>;
+}
+
+interface Int16ArrayConstructor {
+ new (elements: Iterable<number>): Int16Array;
+
+ /**
+ * Creates an array from an array-like or iterable object.
+ * @param arrayLike An array-like or iterable object to convert to an array.
+ * @param mapfn A mapping function to call on every element of the array.
+ * @param thisArg Value of 'this' used to invoke the mapfn.
+ */
+ from(arrayLike: Iterable<number>, mapfn?: (v: number, k: number) => number, thisArg?: any): Int16Array;
+}
+
+/**
+ * A typed array of 16-bit unsigned integer values. The contents are initialized to 0. If the
+ * requested number of bytes could not be allocated an exception is raised.
+ */
+interface Uint16Array {
+ [Symbol.iterator](): IterableIterator<number>;
+ /**
+ * Returns an array of key, value pairs for every entry in the array
+ */
+ entries(): IterableIterator<[number, number]>;
+ /**
+ * Returns an list of keys in the array
+ */
+ keys(): IterableIterator<number>;
+ /**
+ * Returns an list of values in the array
+ */
+ values(): IterableIterator<number>;
+}
+
+interface Uint16ArrayConstructor {
+ new (elements: Iterable<number>): Uint16Array;
+
+ /**
+ * Creates an array from an array-like or iterable object.
+ * @param arrayLike An array-like or iterable object to convert to an array.
+ * @param mapfn A mapping function to call on every element of the array.
+ * @param thisArg Value of 'this' used to invoke the mapfn.
+ */
+ from(arrayLike: Iterable<number>, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint16Array;
+}
+
+/**
+ * A typed array of 32-bit signed integer values. The contents are initialized to 0. If the
+ * requested number of bytes could not be allocated an exception is raised.
+ */
+interface Int32Array {
+ [Symbol.iterator](): IterableIterator<number>;
+ /**
+ * Returns an array of key, value pairs for every entry in the array
+ */
+ entries(): IterableIterator<[number, number]>;
+ /**
+ * Returns an list of keys in the array
+ */
+ keys(): IterableIterator<number>;
+ /**
+ * Returns an list of values in the array
+ */
+ values(): IterableIterator<number>;
+}
+
+interface Int32ArrayConstructor {
+ new (elements: Iterable<number>): Int32Array;
+
+ /**
+ * Creates an array from an array-like or iterable object.
+ * @param arrayLike An array-like or iterable object to convert to an array.
+ * @param mapfn A mapping function to call on every element of the array.
+ * @param thisArg Value of 'this' used to invoke the mapfn.
+ */
+ from(arrayLike: Iterable<number>, mapfn?: (v: number, k: number) => number, thisArg?: any): Int32Array;
+}
+
+/**
+ * A typed array of 32-bit unsigned integer values. The contents are initialized to 0. If the
+ * requested number of bytes could not be allocated an exception is raised.
+ */
+interface Uint32Array {
+ [Symbol.iterator](): IterableIterator<number>;
+ /**
+ * Returns an array of key, value pairs for every entry in the array
+ */
+ entries(): IterableIterator<[number, number]>;
+ /**
+ * Returns an list of keys in the array
+ */
+ keys(): IterableIterator<number>;
+ /**
+ * Returns an list of values in the array
+ */
+ values(): IterableIterator<number>;
+}
+
+interface Uint32ArrayConstructor {
+ new (elements: Iterable<number>): Uint32Array;
+
+ /**
+ * Creates an array from an array-like or iterable object.
+ * @param arrayLike An array-like or iterable object to convert to an array.
+ * @param mapfn A mapping function to call on every element of the array.
+ * @param thisArg Value of 'this' used to invoke the mapfn.
+ */
+ from(arrayLike: Iterable<number>, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint32Array;
+}
+
+/**
+ * A typed array of 32-bit float values. The contents are initialized to 0. If the requested number
+ * of bytes could not be allocated an exception is raised.
+ */
+interface Float32Array {
+ [Symbol.iterator](): IterableIterator<number>;
+ /**
+ * Returns an array of key, value pairs for every entry in the array
+ */
+ entries(): IterableIterator<[number, number]>;
+ /**
+ * Returns an list of keys in the array
+ */
+ keys(): IterableIterator<number>;
+ /**
+ * Returns an list of values in the array
+ */
+ values(): IterableIterator<number>;
+}
+
+interface Float32ArrayConstructor {
+ new (elements: Iterable<number>): Float32Array;
+
+ /**
+ * Creates an array from an array-like or iterable object.
+ * @param arrayLike An array-like or iterable object to convert to an array.
+ * @param mapfn A mapping function to call on every element of the array.
+ * @param thisArg Value of 'this' used to invoke the mapfn.
+ */
+ from(arrayLike: Iterable<number>, mapfn?: (v: number, k: number) => number, thisArg?: any): Float32Array;
+}
+
+/**
+ * A typed array of 64-bit float values. The contents are initialized to 0. If the requested
+ * number of bytes could not be allocated an exception is raised.
+ */
+interface Float64Array {
+ [Symbol.iterator](): IterableIterator<number>;
+ /**
+ * Returns an array of key, value pairs for every entry in the array
+ */
+ entries(): IterableIterator<[number, number]>;
+ /**
+ * Returns an list of keys in the array
+ */
+ keys(): IterableIterator<number>;
+ /**
+ * Returns an list of values in the array
+ */
+ values(): IterableIterator<number>;
+}
+
+interface Float64ArrayConstructor {
+ new (elements: Iterable<number>): Float64Array;
+
+ /**
+ * Creates an array from an array-like or iterable object.
+ * @param arrayLike An array-like or iterable object to convert to an array.
+ * @param mapfn A mapping function to call on every element of the array.
+ * @param thisArg Value of 'this' used to invoke the mapfn.
+ */
+ from(arrayLike: Iterable<number>, mapfn?: (v: number, k: number) => number, thisArg?: any): Float64Array;
+}/**
+ * Represents the completion of an asynchronous operation
+ */
+interface Promise<T> {
+ /**
+ * Attaches callbacks for the resolution and/or rejection of the Promise.
+ * @param onfulfilled The callback to execute when the Promise is resolved.
+ * @param onrejected The callback to execute when the Promise is rejected.
+ * @returns A Promise for the completion of which ever callback is executed.
+ */
+ then<TResult1, TResult2>(onfulfilled: (value: T) => TResult1 | PromiseLike<TResult1>, onrejected: (reason: any) => TResult2 | PromiseLike<TResult2>): Promise<TResult1 | TResult2>;
+
+ /**
+ * Attaches callbacks for the resolution and/or rejection of the Promise.
+ * @param onfulfilled The callback to execute when the Promise is resolved.
+ * @param onrejected The callback to execute when the Promise is rejected.
+ * @returns A Promise for the completion of which ever callback is executed.
+ */
+ then<TResult>(onfulfilled: (value: T) => TResult | PromiseLike<TResult>, onrejected: (reason: any) => TResult | PromiseLike<TResult>): Promise<TResult>;
+
+ /**
+ * Attaches callbacks for the resolution and/or rejection of the Promise.
+ * @param onfulfilled The callback to execute when the Promise is resolved.
+ * @returns A Promise for the completion of which ever callback is executed.
+ */
+ then<TResult>(onfulfilled: (value: T) => TResult | PromiseLike<TResult>): Promise<TResult>;
+
+ /**
+ * Creates a new Promise with the same internal state of this Promise.
+ * @returns A Promise.
+ */
+ then(): Promise<T>;
+
+ /**
+ * Attaches a callback for only the rejection of the Promise.
+ * @param onrejected The callback to execute when the Promise is rejected.
+ * @returns A Promise for the completion of the callback.
+ */
+ catch<TResult>(onrejected: (reason: any) => TResult | PromiseLike<TResult>): Promise<T | TResult>;
+
+ /**
+ * Attaches a callback for only the rejection of the Promise.
+ * @param onrejected The callback to execute when the Promise is rejected.
+ * @returns A Promise for the completion of the callback.
+ */
+ catch(onrejected: (reason: any) => T | PromiseLike<T>): Promise<T>;
+}
+
+interface PromiseConstructor {
+ /**
+ * A reference to the prototype.
+ */
+ readonly prototype: Promise<any>;
+
+ /**
+ * Creates a new Promise.
+ * @param executor A callback used to initialize the promise. This callback is passed two arguments:
+ * a resolve callback used resolve the promise with a value or the result of another promise,
+ * and a reject callback used to reject the promise with a provided reason or error.
+ */
+ new <T>(executor: (resolve: (value?: T | PromiseLike<T>) => void, reject: (reason?: any) => void) => void): Promise<T>;
+
+ /**
+ * Creates a Promise that is resolved with an array of results when all of the provided Promises
+ * resolve, or rejected when any Promise is rejected.
+ * @param values An array of Promises.
+ * @returns A new Promise.
+ */
+ all<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(values: [T1 | PromiseLike<T1>, T2 | PromiseLike<T2>, T3 | PromiseLike<T3>, T4 | PromiseLike <T4>, T5 | PromiseLike<T5>, T6 | PromiseLike<T6>, T7 | PromiseLike<T7>, T8 | PromiseLike<T8>, T9 | PromiseLike<T9>, T10 | PromiseLike<T10>]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]>;
+
+ /**
+ * Creates a Promise that is resolved with an array of results when all of the provided Promises
+ * resolve, or rejected when any Promise is rejected.
+ * @param values An array of Promises.
+ * @returns A new Promise.
+ */
+ all<T1, T2, T3, T4, T5, T6, T7, T8, T9>(values: [T1 | PromiseLike<T1>, T2 | PromiseLike<T2>, T3 | PromiseLike<T3>, T4 | PromiseLike <T4>, T5 | PromiseLike<T5>, T6 | PromiseLike<T6>, T7 | PromiseLike<T7>, T8 | PromiseLike<T8>, T9 | PromiseLike<T9>]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9]>;
+
+ /**
+ * Creates a Promise that is resolved with an array of results when all of the provided Promises
+ * resolve, or rejected when any Promise is rejected.
+ * @param values An array of Promises.
+ * @returns A new Promise.
+ */
+ all<T1, T2, T3, T4, T5, T6, T7, T8>(values: [T1 | PromiseLike<T1>, T2 | PromiseLike<T2>, T3 | PromiseLike<T3>, T4 | PromiseLike <T4>, T5 | PromiseLike<T5>, T6 | PromiseLike<T6>, T7 | PromiseLike<T7>, T8 | PromiseLike<T8>]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8]>;
+
+ /**
+ * Creates a Promise that is resolved with an array of results when all of the provided Promises
+ * resolve, or rejected when any Promise is rejected.
+ * @param values An array of Promises.
+ * @returns A new Promise.
+ */
+ all<T1, T2, T3, T4, T5, T6, T7>(values: [T1 | PromiseLike<T1>, T2 | PromiseLike<T2>, T3 | PromiseLike<T3>, T4 | PromiseLike <T4>, T5 | PromiseLike<T5>, T6 | PromiseLike<T6>, T7 | PromiseLike<T7>]): Promise<[T1, T2, T3, T4, T5, T6, T7]>;
+
+ /**
+ * Creates a Promise that is resolved with an array of results when all of the provided Promises
+ * resolve, or rejected when any Promise is rejected.
+ * @param values An array of Promises.
+ * @returns A new Promise.
+ */
+ all<T1, T2, T3, T4, T5, T6>(values: [T1 | PromiseLike<T1>, T2 | PromiseLike<T2>, T3 | PromiseLike<T3>, T4 | PromiseLike <T4>, T5 | PromiseLike<T5>, T6 | PromiseLike<T6>]): Promise<[T1, T2, T3, T4, T5, T6]>;
+
+ /**
+ * Creates a Promise that is resolved with an array of results when all of the provided Promises
+ * resolve, or rejected when any Promise is rejected.
+ * @param values An array of Promises.
+ * @returns A new Promise.
+ */
+ all<T1, T2, T3, T4, T5>(values: [T1 | PromiseLike<T1>, T2 | PromiseLike<T2>, T3 | PromiseLike<T3>, T4 | PromiseLike <T4>, T5 | PromiseLike<T5>]): Promise<[T1, T2, T3, T4, T5]>;
+
+ /**
+ * Creates a Promise that is resolved with an array of results when all of the provided Promises
+ * resolve, or rejected when any Promise is rejected.
+ * @param values An array of Promises.
+ * @returns A new Promise.
+ */
+ all<T1, T2, T3, T4>(values: [T1 | PromiseLike<T1>, T2 | PromiseLike<T2>, T3 | PromiseLike<T3>, T4 | PromiseLike <T4>]): Promise<[T1, T2, T3, T4]>;
+
+ /**
+ * Creates a Promise that is resolved with an array of results when all of the provided Promises
+ * resolve, or rejected when any Promise is rejected.
+ * @param values An array of Promises.
+ * @returns A new Promise.
+ */
+ all<T1, T2, T3>(values: [T1 | PromiseLike<T1>, T2 | PromiseLike<T2>, T3 | PromiseLike<T3>]): Promise<[T1, T2, T3]>;
+
+ /**
+ * Creates a Promise that is resolved with an array of results when all of the provided Promises
+ * resolve, or rejected when any Promise is rejected.
+ * @param values An array of Promises.
+ * @returns A new Promise.
+ */
+ all<T1, T2>(values: [T1 | PromiseLike<T1>, T2 | PromiseLike<T2>]): Promise<[T1, T2]>;
+
+ /**
+ * Creates a Promise that is resolved with an array of results when all of the provided Promises
+ * resolve, or rejected when any Promise is rejected.
+ * @param values An array of Promises.
+ * @returns A new Promise.
+ */
+ all<T>(values: (T | PromiseLike<T>)[]): Promise<T[]>;
+
+ /**
+ * Creates a new rejected promise for the provided reason.
+ * @param reason The reason the promise was rejected.
+ * @returns A new rejected Promise.
+ */
+ reject(reason: any): Promise<never>;
+
+ /**
+ * Creates a new rejected promise for the provided reason.
+ * @param reason The reason the promise was rejected.
+ * @returns A new rejected Promise.
+ */
+ reject<T>(reason: any): Promise<T>;
+
+ /**
+ * Creates a new resolved promise for the provided value.
+ * @param value A promise.
+ * @returns A promise whose internal state matches the provided promise.
+ */
+ resolve<T>(value: T | PromiseLike<T>): Promise<T>;
+
+ /**
+ * Creates a new resolved promise .
+ * @returns A resolved promise.
+ */
+ resolve(): Promise<void>;
+}
+
+declare var Promise: PromiseConstructor;interface ProxyHandler<T> {
+ getPrototypeOf? (target: T): any;
+ setPrototypeOf? (target: T, v: any): boolean;
+ isExtensible? (target: T): boolean;
+ preventExtensions? (target: T): boolean;
+ getOwnPropertyDescriptor? (target: T, p: PropertyKey): PropertyDescriptor;
+ has? (target: T, p: PropertyKey): boolean;
+ get? (target: T, p: PropertyKey, receiver: any): any;
+ set? (target: T, p: PropertyKey, value: any, receiver: any): boolean;
+ deleteProperty? (target: T, p: PropertyKey): boolean;
+ defineProperty? (target: T, p: PropertyKey, attributes: PropertyDescriptor): boolean;
+ enumerate? (target: T): PropertyKey[];
+ ownKeys? (target: T): PropertyKey[];
+ apply? (target: T, thisArg: any, argArray?: any): any;
+ construct? (target: T, thisArg: any, argArray?: any): any;
+}
+
+interface ProxyConstructor {
+ revocable<T>(target: T, handler: ProxyHandler<T>): { proxy: T; revoke: () => void; };
+ new <T>(target: T, handler: ProxyHandler<T>): T
+}
+declare var Proxy: ProxyConstructor;declare namespace Reflect {
+ function apply(target: Function, thisArgument: any, argumentsList: ArrayLike<any>): any;
+ function construct(target: Function, argumentsList: ArrayLike<any>, newTarget?: any): any;
+ function defineProperty(target: any, propertyKey: PropertyKey, attributes: PropertyDescriptor): boolean;
+ function deleteProperty(target: any, propertyKey: PropertyKey): boolean;
+ function get(target: any, propertyKey: PropertyKey, receiver?: any): any;
+ function getOwnPropertyDescriptor(target: any, propertyKey: PropertyKey): PropertyDescriptor;
+ function getPrototypeOf(target: any): any;
+ function has(target: any, propertyKey: string): boolean;
+ function has(target: any, propertyKey: symbol): boolean;
+ function isExtensible(target: any): boolean;
+ function ownKeys(target: any): Array<PropertyKey>;
+ function preventExtensions(target: any): boolean;
+ function set(target: any, propertyKey: PropertyKey, value: any, receiver?: any): boolean;
+ function setPrototypeOf(target: any, proto: any): boolean;
+}interface Symbol {
+ /** Returns a string representation of an object. */
+ toString(): string;
+
+ /** Returns the primitive value of the specified object. */
+ valueOf(): Object;
+}
+
+interface SymbolConstructor {
+ /**
+ * A reference to the prototype.
+ */
+ readonly prototype: Symbol;
+
+ /**
+ * Returns a new unique Symbol value.
+ * @param description Description of the new Symbol object.
+ */
+ (description?: string|number): symbol;
+
+ /**
+ * Returns a Symbol object from the global symbol registry matching the given key if found.
+ * Otherwise, returns a new symbol with this key.
+ * @param key key to search for.
+ */
+ for(key: string): symbol;
+
+ /**
+ * Returns a key from the global symbol registry matching the given Symbol if found.
+ * Otherwise, returns a undefined.
+ * @param sym Symbol to find the key for.
+ */
+ keyFor(sym: symbol): string | undefined;
+}
+
+declare var Symbol: SymbolConstructor;/// <reference path="lib.es2015.symbol.d.ts" />
+
+interface SymbolConstructor {
+ /**
+ * A method that determines if a constructor object recognizes an object as one of the
+ * constructor’s instances. Called by the semantics of the instanceof operator.
+ */
+ readonly hasInstance: symbol;
+
+ /**
+ * A Boolean value that if true indicates that an object should flatten to its array elements
+ * by Array.prototype.concat.
+ */
+ readonly isConcatSpreadable: symbol;
+
+ /**
+ * A regular expression method that matches the regular expression against a string. Called
+ * by the String.prototype.match method.
+ */
+ readonly match: symbol;
+
+ /**
+ * A regular expression method that replaces matched substrings of a string. Called by the
+ * String.prototype.replace method.
+ */
+ readonly replace: symbol;
+
+ /**
+ * A regular expression method that returns the index within a string that matches the
+ * regular expression. Called by the String.prototype.search method.
+ */
+ readonly search: symbol;
+
+ /**
+ * A function valued property that is the constructor function that is used to create
+ * derived objects.
+ */
+ readonly species: symbol;
+
+ /**
+ * A regular expression method that splits a string at the indices that match the regular
+ * expression. Called by the String.prototype.split method.
+ */
+ readonly split: symbol;
+
+ /**
+ * A method that converts an object to a corresponding primitive value.
+ * Called by the ToPrimitive abstract operation.
+ */
+ readonly toPrimitive: symbol;
+
+ /**
+ * A String value that is used in the creation of the default string description of an object.
+ * Called by the built-in method Object.prototype.toString.
+ */
+ readonly toStringTag: symbol;
+
+ /**
+ * An Object whose own property names are property names that are excluded from the 'with'
+ * environment bindings of the associated objects.
+ */
+ readonly unscopables: symbol;
+}
+
+interface Symbol {
+ readonly [Symbol.toStringTag]: "Symbol";
+}
+
+interface Array<T> {
+ /**
+ * Returns an object whose properties have the value 'true'
+ * when they will be absent when used in a 'with' statement.
+ */
+ [Symbol.unscopables](): {
+ copyWithin: boolean;
+ entries: boolean;
+ fill: boolean;
+ find: boolean;
+ findIndex: boolean;
+ keys: boolean;
+ values: boolean;
+ };
+}
+
+interface Date {
+ /**
+ * Converts a Date object to a string.
+ */
+ [Symbol.toPrimitive](hint: "default"): string;
+ /**
+ * Converts a Date object to a string.
+ */
+ [Symbol.toPrimitive](hint: "string"): string;
+ /**
+ * Converts a Date object to a number.
+ */
+ [Symbol.toPrimitive](hint: "number"): number;
+ /**
+ * Converts a Date object to a string or number.
+ *
+ * @param hint The strings "number", "string", or "default" to specify what primitive to return.
+ *
+ * @throws {TypeError} If 'hint' was given something other than "number", "string", or "default".
+ * @returns A number if 'hint' was "number", a string if 'hint' was "string" or "default".
+ */
+ [Symbol.toPrimitive](hint: string): string | number;
+}
+
+interface Map<K, V> {
+ readonly [Symbol.toStringTag]: "Map";
+}
+
+interface WeakMap<K, V>{
+ readonly [Symbol.toStringTag]: "WeakMap";
+}
+
+interface Set<T> {
+ readonly [Symbol.toStringTag]: "Set";
+}
+
+interface WeakSet<T> {
+ readonly [Symbol.toStringTag]: "WeakSet";
+}
+
+interface JSON {
+ readonly [Symbol.toStringTag]: "JSON";
+}
+
+interface Function {
+ /**
+ * Determines whether the given value inherits from this function if this function was used
+ * as a constructor function.
+ *
+ * A constructor function can control which objects are recognized as its instances by
+ * 'instanceof' by overriding this method.
+ */
+ [Symbol.hasInstance](value: any): boolean;
+}
+
+interface GeneratorFunction extends Function {
+ readonly [Symbol.toStringTag]: "GeneratorFunction";
+}
+
+interface Math {
+ readonly [Symbol.toStringTag]: "Math";
+}
+
+interface Promise<T> {
+ readonly [Symbol.toStringTag]: "Promise";
+}
+
+interface PromiseConstructor {
+ readonly [Symbol.species]: Function;
+}
+
+interface RegExp {
+ /**
+ * Matches a string with this regular expression, and returns an array containing the results of
+ * that search.
+ * @param string A string to search within.
+ */
+ [Symbol.match](string: string): RegExpMatchArray | null;
+
+ /**
+ * Replaces text in a string, using this regular expression.
+ * @param string A String object or string literal whose contents matching against
+ * this regular expression will be replaced
+ * @param replaceValue A String object or string literal containing the text to replace for every
+ * successful match of this regular expression.
+ */
+ [Symbol.replace](string: string, replaceValue: string): string;
+
+ /**
+ * Replaces text in a string, using this regular expression.
+ * @param string A String object or string literal whose contents matching against
+ * this regular expression will be replaced
+ * @param replacer A function that returns the replacement text.
+ */
+ [Symbol.replace](string: string, replacer: (substring: string, ...args: any[]) => string): string;
+
+ /**
+ * Finds the position beginning first substring match in a regular expression search
+ * using this regular expression.
+ *
+ * @param string The string to search within.
+ */
+ [Symbol.search](string: string): number;
+
+ /**
+ * Returns an array of substrings that were delimited by strings in the original input that
+ * match against this regular expression.
+ *
+ * If the regular expression contains capturing parentheses, then each time this
+ * regular expression matches, the results (including any undefined results) of the
+ * capturing parentheses are spliced.
+ *
+ * @param string string value to split
+ * @param limit if not undefined, the output array is truncated so that it contains no more
+ * than 'limit' elements.
+ */
+ [Symbol.split](string: string, limit?: number): string[];
+}
+
+interface RegExpConstructor {
+ [Symbol.species](): RegExpConstructor;
+}
+
+interface String {
+ /**
+ * Matches a string an object that supports being matched against, and returns an array containing the results of that search.
+ * @param matcher An object that supports being matched against.
+ */
+ match(matcher: { [Symbol.match](string: string): RegExpMatchArray | null; }): RegExpMatchArray | null;
+
+ /**
+ * Replaces text in a string, using an object that supports replacement within a string.
+ * @param searchValue A object can search for and replace matches within a string.
+ * @param replaceValue A string containing the text to replace for every successful match of searchValue in this string.
+ */
+ replace(searchValue: { [Symbol.replace](string: string, replaceValue: string): string; }, replaceValue: string): string;
+
+ /**
+ * Replaces text in a string, using an object that supports replacement within a string.
+ * @param searchValue A object can search for and replace matches within a string.
+ * @param replacer A function that returns the replacement text.
+ */
+ replace(searchValue: { [Symbol.replace](string: string, replacer: (substring: string, ...args: any[]) => string): string; }, replacer: (substring: string, ...args: any[]) => string): string;
+
+ /**
+ * Finds the first substring match in a regular expression search.
+ * @param searcher An object which supports searching within a string.
+ */
+ search(searcher: { [Symbol.search](string: string): number; }): number;
+
+ /**
+ * Split a string into substrings using the specified separator and return them as an array.
+ * @param splitter An object that can split a string.
+ * @param limit A value used to limit the number of elements returned in the array.
+ */
+ split(splitter: { [Symbol.split](string: string, limit?: number): string[]; }, limit?: number): string[];
+}
+
+/**
+ * Represents a raw buffer of binary data, which is used to store data for the
+ * different typed arrays. ArrayBuffers cannot be read from or written to directly,
+ * but can be passed to a typed array or DataView Object to interpret the raw
+ * buffer as needed.
+ */
+interface ArrayBuffer {
+ readonly [Symbol.toStringTag]: "ArrayBuffer";
+}
+
+interface DataView {
+ readonly [Symbol.toStringTag]: "DataView";
+}
+
+/**
+ * A typed array of 8-bit integer values. The contents are initialized to 0. If the requested
+ * number of bytes could not be allocated an exception is raised.
+ */
+interface Int8Array {
+ readonly [Symbol.toStringTag]: "Int8Array";
+}
+
+/**
+ * A typed array of 8-bit unsigned integer values. The contents are initialized to 0. If the
+ * requested number of bytes could not be allocated an exception is raised.
+ */
+interface Uint8Array {
+ readonly [Symbol.toStringTag]: "UInt8Array";
+}
+
+/**
+ * A typed array of 8-bit unsigned integer (clamped) values. The contents are initialized to 0.
+ * If the requested number of bytes could not be allocated an exception is raised.
+ */
+interface Uint8ClampedArray {
+ readonly [Symbol.toStringTag]: "Uint8ClampedArray";
+}
+
+/**
+ * A typed array of 16-bit signed integer values. The contents are initialized to 0. If the
+ * requested number of bytes could not be allocated an exception is raised.
+ */
+interface Int16Array {
+ readonly [Symbol.toStringTag]: "Int16Array";
+}
+
+/**
+ * A typed array of 16-bit unsigned integer values. The contents are initialized to 0. If the
+ * requested number of bytes could not be allocated an exception is raised.
+ */
+interface Uint16Array {
+ readonly [Symbol.toStringTag]: "Uint16Array";
+}
+
+/**
+ * A typed array of 32-bit signed integer values. The contents are initialized to 0. If the
+ * requested number of bytes could not be allocated an exception is raised.
+ */
+interface Int32Array {
+ readonly [Symbol.toStringTag]: "Int32Array";
+}
+
+/**
+ * A typed array of 32-bit unsigned integer values. The contents are initialized to 0. If the
+ * requested number of bytes could not be allocated an exception is raised.
+ */
+interface Uint32Array {
+ readonly [Symbol.toStringTag]: "Uint32Array";
+}
+
+/**
+ * A typed array of 32-bit float values. The contents are initialized to 0. If the requested number
+ * of bytes could not be allocated an exception is raised.
+ */
+interface Float32Array {
+ readonly [Symbol.toStringTag]: "Float32Array";
+}
+
+/**
+ * A typed array of 64-bit float values. The contents are initialized to 0. If the requested
+ * number of bytes could not be allocated an exception is raised.
+ */
+interface Float64Array {
+ readonly [Symbol.toStringTag]: "Float64Array";
+}
+/////////////////////////////
+/// IE DOM APIs
+/////////////////////////////
+
+interface Algorithm {
+ name: string;
+}
+
+interface AriaRequestEventInit extends EventInit {
+ attributeName?: string;
+ attributeValue?: string;
+}
+
+interface CommandEventInit extends EventInit {
+ commandName?: string;
+ detail?: string;
+}
+
+interface CompositionEventInit extends UIEventInit {
+ data?: string;
+}
+
+interface ConfirmSiteSpecificExceptionsInformation extends ExceptionInformation {
+ arrayOfDomainStrings?: string[];
+}
+
+interface ConstrainBooleanParameters {
+ exact?: boolean;
+ ideal?: boolean;
+}
+
+interface ConstrainDOMStringParameters {
+ exact?: string | string[];
+ ideal?: string | string[];
+}
+
+interface ConstrainDoubleRange extends DoubleRange {
+ exact?: number;
+ ideal?: number;
+}
+
+interface ConstrainLongRange extends LongRange {
+ exact?: number;
+ ideal?: number;
+}
+
+interface ConstrainVideoFacingModeParameters {
+ exact?: string | string[];
+ ideal?: string | string[];
+}
+
+interface CustomEventInit extends EventInit {
+ detail?: any;
+}
+
+interface DeviceAccelerationDict {
+ x?: number;
+ y?: number;
+ z?: number;
+}
+
+interface DeviceLightEventInit extends EventInit {
+ value?: number;
+}
+
+interface DeviceRotationRateDict {
+ alpha?: number;
+ beta?: number;
+ gamma?: number;
+}
+
+interface DoubleRange {
+ max?: number;
+ min?: number;
+}
+
+interface EventInit {
+ bubbles?: boolean;
+ cancelable?: boolean;
+}
+
+interface EventModifierInit extends UIEventInit {
+ ctrlKey?: boolean;
+ shiftKey?: boolean;
+ altKey?: boolean;
+ metaKey?: boolean;
+ modifierAltGraph?: boolean;
+ modifierCapsLock?: boolean;
+ modifierFn?: boolean;
+ modifierFnLock?: boolean;
+ modifierHyper?: boolean;
+ modifierNumLock?: boolean;
+ modifierOS?: boolean;
+ modifierScrollLock?: boolean;
+ modifierSuper?: boolean;
+ modifierSymbol?: boolean;
+ modifierSymbolLock?: boolean;
+}
+
+interface ExceptionInformation {
+ domain?: string;
+}
+
+interface FocusEventInit extends UIEventInit {
+ relatedTarget?: EventTarget;
+}
+
+interface HashChangeEventInit extends EventInit {
+ newURL?: string;
+ oldURL?: string;
+}
+
+interface IDBIndexParameters {
+ multiEntry?: boolean;
+ unique?: boolean;
+}
+
+interface IDBObjectStoreParameters {
+ autoIncrement?: boolean;
+ keyPath?: IDBKeyPath;
+}
+
+interface KeyAlgorithm {
+ name?: string;
+}
+
+interface KeyboardEventInit extends EventModifierInit {
+ code?: string;
+ key?: string;
+ location?: number;
+ repeat?: boolean;
+}
+
+interface LongRange {
+ max?: number;
+ min?: number;
+}
+
+interface MSAccountInfo {
+ rpDisplayName?: string;
+ userDisplayName?: string;
+ accountName?: string;
+ userId?: string;
+ accountImageUri?: string;
+}
+
+interface MSAudioLocalClientEvent extends MSLocalClientEventBase {
+ networkSendQualityEventRatio?: number;
+ networkDelayEventRatio?: number;
+ cpuInsufficientEventRatio?: number;
+ deviceHalfDuplexAECEventRatio?: number;
+ deviceRenderNotFunctioningEventRatio?: number;
+ deviceCaptureNotFunctioningEventRatio?: number;
+ deviceGlitchesEventRatio?: number;
+ deviceLowSNREventRatio?: number;
+ deviceLowSpeechLevelEventRatio?: number;
+ deviceClippingEventRatio?: number;
+ deviceEchoEventRatio?: number;
+ deviceNearEndToEchoRatioEventRatio?: number;
+ deviceRenderZeroVolumeEventRatio?: number;
+ deviceRenderMuteEventRatio?: number;
+ deviceMultipleEndpointsEventCount?: number;
+ deviceHowlingEventCount?: number;
+}
+
+interface MSAudioRecvPayload extends MSPayloadBase {
+ samplingRate?: number;
+ signal?: MSAudioRecvSignal;
+ packetReorderRatio?: number;
+ packetReorderDepthAvg?: number;
+ packetReorderDepthMax?: number;
+ burstLossLength1?: number;
+ burstLossLength2?: number;
+ burstLossLength3?: number;
+ burstLossLength4?: number;
+ burstLossLength5?: number;
+ burstLossLength6?: number;
+ burstLossLength7?: number;
+ burstLossLength8OrHigher?: number;
+ fecRecvDistance1?: number;
+ fecRecvDistance2?: number;
+ fecRecvDistance3?: number;
+ ratioConcealedSamplesAvg?: number;
+ ratioStretchedSamplesAvg?: number;
+ ratioCompressedSamplesAvg?: number;
+}
+
+interface MSAudioRecvSignal {
+ initialSignalLevelRMS?: number;
+ recvSignalLevelCh1?: number;
+ recvNoiseLevelCh1?: number;
+ renderSignalLevel?: number;
+ renderNoiseLevel?: number;
+ renderLoopbackSignalLevel?: number;
+}
+
+interface MSAudioSendPayload extends MSPayloadBase {
+ samplingRate?: number;
+ signal?: MSAudioSendSignal;
+ audioFECUsed?: boolean;
+ sendMutePercent?: number;
+}
+
+interface MSAudioSendSignal {
+ noiseLevel?: number;
+ sendSignalLevelCh1?: number;
+ sendNoiseLevelCh1?: number;
+}
+
+interface MSConnectivity {
+ iceType?: string;
+ iceWarningFlags?: MSIceWarningFlags;
+ relayAddress?: MSRelayAddress;
+}
+
+interface MSCredentialFilter {
+ accept?: MSCredentialSpec[];
+}
+
+interface MSCredentialParameters {
+ type?: string;
+}
+
+interface MSCredentialSpec {
+ type?: string;
+ id?: string;
+}
+
+interface MSDelay {
+ roundTrip?: number;
+ roundTripMax?: number;
+}
+
+interface MSDescription extends RTCStats {
+ connectivity?: MSConnectivity;
+ transport?: string;
+ networkconnectivity?: MSNetworkConnectivityInfo;
+ localAddr?: MSIPAddressInfo;
+ remoteAddr?: MSIPAddressInfo;
+ deviceDevName?: string;
+ reflexiveLocalIPAddr?: MSIPAddressInfo;
+}
+
+interface MSFIDOCredentialParameters extends MSCredentialParameters {
+ algorithm?: string | Algorithm;
+ authenticators?: AAGUID[];
+}
+
+interface MSIPAddressInfo {
+ ipAddr?: string;
+ port?: number;
+ manufacturerMacAddrMask?: string;
+}
+
+interface MSIceWarningFlags {
+ turnTcpTimedOut?: boolean;
+ turnUdpAllocateFailed?: boolean;
+ turnUdpSendFailed?: boolean;
+ turnTcpAllocateFailed?: boolean;
+ turnTcpSendFailed?: boolean;
+ udpLocalConnectivityFailed?: boolean;
+ udpNatConnectivityFailed?: boolean;
+ udpRelayConnectivityFailed?: boolean;
+ tcpNatConnectivityFailed?: boolean;
+ tcpRelayConnectivityFailed?: boolean;
+ connCheckMessageIntegrityFailed?: boolean;
+ allocationMessageIntegrityFailed?: boolean;
+ connCheckOtherError?: boolean;
+ turnAuthUnknownUsernameError?: boolean;
+ noRelayServersConfigured?: boolean;
+ multipleRelayServersAttempted?: boolean;
+ portRangeExhausted?: boolean;
+ alternateServerReceived?: boolean;
+ pseudoTLSFailure?: boolean;
+ turnTurnTcpConnectivityFailed?: boolean;
+ useCandidateChecksFailed?: boolean;
+ fipsAllocationFailure?: boolean;
+}
+
+interface MSJitter {
+ interArrival?: number;
+ interArrivalMax?: number;
+ interArrivalSD?: number;
+}
+
+interface MSLocalClientEventBase extends RTCStats {
+ networkReceiveQualityEventRatio?: number;
+ networkBandwidthLowEventRatio?: number;
+}
+
+interface MSNetwork extends RTCStats {
+ jitter?: MSJitter;
+ delay?: MSDelay;
+ packetLoss?: MSPacketLoss;
+ utilization?: MSUtilization;
+}
+
+interface MSNetworkConnectivityInfo {
+ vpn?: boolean;
+ linkspeed?: number;
+ networkConnectionDetails?: string;
+}
+
+interface MSNetworkInterfaceType {
+ interfaceTypeEthernet?: boolean;
+ interfaceTypeWireless?: boolean;
+ interfaceTypePPP?: boolean;
+ interfaceTypeTunnel?: boolean;
+ interfaceTypeWWAN?: boolean;
+}
+
+interface MSOutboundNetwork extends MSNetwork {
+ appliedBandwidthLimit?: number;
+}
+
+interface MSPacketLoss {
+ lossRate?: number;
+ lossRateMax?: number;
+}
+
+interface MSPayloadBase extends RTCStats {
+ payloadDescription?: string;
+}
+
+interface MSRelayAddress {
+ relayAddress?: string;
+ port?: number;
+}
+
+interface MSSignatureParameters {
+ userPrompt?: string;
+}
+
+interface MSTransportDiagnosticsStats extends RTCStats {
+ baseAddress?: string;
+ localAddress?: string;
+ localSite?: string;
+ networkName?: string;
+ remoteAddress?: string;
+ remoteSite?: string;
+ localMR?: string;
+ remoteMR?: string;
+ iceWarningFlags?: MSIceWarningFlags;
+ portRangeMin?: number;
+ portRangeMax?: number;
+ localMRTCPPort?: number;
+ remoteMRTCPPort?: number;
+ stunVer?: number;
+ numConsentReqSent?: number;
+ numConsentReqReceived?: number;
+ numConsentRespSent?: number;
+ numConsentRespReceived?: number;
+ interfaces?: MSNetworkInterfaceType;
+ baseInterface?: MSNetworkInterfaceType;
+ protocol?: string;
+ localInterface?: MSNetworkInterfaceType;
+ localAddrType?: string;
+ remoteAddrType?: string;
+ iceRole?: string;
+ rtpRtcpMux?: boolean;
+ allocationTimeInMs?: number;
+ msRtcEngineVersion?: string;
+}
+
+interface MSUtilization {
+ packets?: number;
+ bandwidthEstimation?: number;
+ bandwidthEstimationMin?: number;
+ bandwidthEstimationMax?: number;
+ bandwidthEstimationStdDev?: number;
+ bandwidthEstimationAvg?: number;
+}
+
+interface MSVideoPayload extends MSPayloadBase {
+ resoluton?: string;
+ videoBitRateAvg?: number;
+ videoBitRateMax?: number;
+ videoFrameRateAvg?: number;
+ videoPacketLossRate?: number;
+ durationSeconds?: number;
+}
+
+interface MSVideoRecvPayload extends MSVideoPayload {
+ videoFrameLossRate?: number;
+ recvCodecType?: string;
+ recvResolutionWidth?: number;
+ recvResolutionHeight?: number;
+ videoResolutions?: MSVideoResolutionDistribution;
+ recvFrameRateAverage?: number;
+ recvBitRateMaximum?: number;
+ recvBitRateAverage?: number;
+ recvVideoStreamsMax?: number;
+ recvVideoStreamsMin?: number;
+ recvVideoStreamsMode?: number;
+ videoPostFECPLR?: number;
+ lowBitRateCallPercent?: number;
+ lowFrameRateCallPercent?: number;
+ reorderBufferTotalPackets?: number;
+ recvReorderBufferReorderedPackets?: number;
+ recvReorderBufferPacketsDroppedDueToBufferExhaustion?: number;
+ recvReorderBufferMaxSuccessfullyOrderedExtent?: number;
+ recvReorderBufferMaxSuccessfullyOrderedLateTime?: number;
+ recvReorderBufferPacketsDroppedDueToTimeout?: number;
+ recvFpsHarmonicAverage?: number;
+ recvNumResSwitches?: number;
+}
+
+interface MSVideoResolutionDistribution {
+ cifQuality?: number;
+ vgaQuality?: number;
+ h720Quality?: number;
+ h1080Quality?: number;
+ h1440Quality?: number;
+ h2160Quality?: number;
+}
+
+interface MSVideoSendPayload extends MSVideoPayload {
+ sendFrameRateAverage?: number;
+ sendBitRateMaximum?: number;
+ sendBitRateAverage?: number;
+ sendVideoStreamsMax?: number;
+ sendResolutionWidth?: number;
+ sendResolutionHeight?: number;
+}
+
+interface MediaEncryptedEventInit extends EventInit {
+ initDataType?: string;
+ initData?: ArrayBuffer;
+}
+
+interface MediaKeyMessageEventInit extends EventInit {
+ messageType?: string;
+ message?: ArrayBuffer;
+}
+
+interface MediaKeySystemConfiguration {
+ initDataTypes?: string[];
+ audioCapabilities?: MediaKeySystemMediaCapability[];
+ videoCapabilities?: MediaKeySystemMediaCapability[];
+ distinctiveIdentifier?: string;
+ persistentState?: string;
+}
+
+interface MediaKeySystemMediaCapability {
+ contentType?: string;
+ robustness?: string;
+}
+
+interface MediaStreamConstraints {
+ video?: boolean | MediaTrackConstraints;
+ audio?: boolean | MediaTrackConstraints;
+}
+
+interface MediaStreamErrorEventInit extends EventInit {
+ error?: MediaStreamError;
+}
+
+interface MediaStreamTrackEventInit extends EventInit {
+ track?: MediaStreamTrack;
+}
+
+interface MediaTrackCapabilities {
+ width?: number | LongRange;
+ height?: number | LongRange;
+ aspectRatio?: number | DoubleRange;
+ frameRate?: number | DoubleRange;
+ facingMode?: string;
+ volume?: number | DoubleRange;
+ sampleRate?: number | LongRange;
+ sampleSize?: number | LongRange;
+ echoCancellation?: boolean[];
+ deviceId?: string;
+ groupId?: string;
+}
+
+interface MediaTrackConstraintSet {
+ width?: number | ConstrainLongRange;
+ height?: number | ConstrainLongRange;
+ aspectRatio?: number | ConstrainDoubleRange;
+ frameRate?: number | ConstrainDoubleRange;
+ facingMode?: string | string[] | ConstrainDOMStringParameters;
+ volume?: number | ConstrainDoubleRange;
+ sampleRate?: number | ConstrainLongRange;
+ sampleSize?: number | ConstrainLongRange;
+ echoCancelation?: boolean | ConstrainBooleanParameters;
+ deviceId?: string | string[] | ConstrainDOMStringParameters;
+ groupId?: string | string[] | ConstrainDOMStringParameters;
+}
+
+interface MediaTrackConstraints extends MediaTrackConstraintSet {
+ advanced?: MediaTrackConstraintSet[];
+}
+
+interface MediaTrackSettings {
+ width?: number;
+ height?: number;
+ aspectRatio?: number;
+ frameRate?: number;
+ facingMode?: string;
+ volume?: number;
+ sampleRate?: number;
+ sampleSize?: number;
+ echoCancellation?: boolean;
+ deviceId?: string;
+ groupId?: string;
+}
+
+interface MediaTrackSupportedConstraints {
+ width?: boolean;
+ height?: boolean;
+ aspectRatio?: boolean;
+ frameRate?: boolean;
+ facingMode?: boolean;
+ volume?: boolean;
+ sampleRate?: boolean;
+ sampleSize?: boolean;
+ echoCancellation?: boolean;
+ deviceId?: boolean;
+ groupId?: boolean;
+}
+
+interface MouseEventInit extends EventModifierInit {
+ screenX?: number;
+ screenY?: number;
+ clientX?: number;
+ clientY?: number;
+ button?: number;
+ buttons?: number;
+ relatedTarget?: EventTarget;
+}
+
+interface MsZoomToOptions {
+ contentX?: number;
+ contentY?: number;
+ viewportX?: string;
+ viewportY?: string;
+ scaleFactor?: number;
+ animate?: string;
+}
+
+interface MutationObserverInit {
+ childList?: boolean;
+ attributes?: boolean;
+ characterData?: boolean;
+ subtree?: boolean;
+ attributeOldValue?: boolean;
+ characterDataOldValue?: boolean;
+ attributeFilter?: string[];
+}
+
+interface ObjectURLOptions {
+ oneTimeOnly?: boolean;
+}
+
+interface PeriodicWaveConstraints {
+ disableNormalization?: boolean;
+}
+
+interface PointerEventInit extends MouseEventInit {
+ pointerId?: number;
+ width?: number;
+ height?: number;
+ pressure?: number;
+ tiltX?: number;
+ tiltY?: number;
+ pointerType?: string;
+ isPrimary?: boolean;
+}
+
+interface PositionOptions {
+ enableHighAccuracy?: boolean;
+ timeout?: number;
+ maximumAge?: number;
+}
+
+interface RTCDTMFToneChangeEventInit extends EventInit {
+ tone?: string;
+}
+
+interface RTCDtlsFingerprint {
+ algorithm?: string;
+ value?: string;
+}
+
+interface RTCDtlsParameters {
+ role?: string;
+ fingerprints?: RTCDtlsFingerprint[];
+}
+
+interface RTCIceCandidate {
+ foundation?: string;
+ priority?: number;
+ ip?: string;
+ protocol?: string;
+ port?: number;
+ type?: string;
+ tcpType?: string;
+ relatedAddress?: string;
+ relatedPort?: number;
+}
+
+interface RTCIceCandidateAttributes extends RTCStats {
+ ipAddress?: string;
+ portNumber?: number;
+ transport?: string;
+ candidateType?: string;
+ priority?: number;
+ addressSourceUrl?: string;
+}
+
+interface RTCIceCandidateComplete {
+}
+
+interface RTCIceCandidatePair {
+ local?: RTCIceCandidate;
+ remote?: RTCIceCandidate;
+}
+
+interface RTCIceCandidatePairStats extends RTCStats {
+ transportId?: string;
+ localCandidateId?: string;
+ remoteCandidateId?: string;
+ state?: string;
+ priority?: number;
+ nominated?: boolean;
+ writable?: boolean;
+ readable?: boolean;
+ bytesSent?: number;
+ bytesReceived?: number;
+ roundTripTime?: number;
+ availableOutgoingBitrate?: number;
+ availableIncomingBitrate?: number;
+}
+
+interface RTCIceGatherOptions {
+ gatherPolicy?: string;
+ iceservers?: RTCIceServer[];
+}
+
+interface RTCIceParameters {
+ usernameFragment?: string;
+ password?: string;
+}
+
+interface RTCIceServer {
+ urls?: any;
+ username?: string;
+ credential?: string;
+}
+
+interface RTCInboundRTPStreamStats extends RTCRTPStreamStats {
+ packetsReceived?: number;
+ bytesReceived?: number;
+ packetsLost?: number;
+ jitter?: number;
+ fractionLost?: number;
+}
+
+interface RTCMediaStreamTrackStats extends RTCStats {
+ trackIdentifier?: string;
+ remoteSource?: boolean;
+ ssrcIds?: string[];
+ frameWidth?: number;
+ frameHeight?: number;
+ framesPerSecond?: number;
+ framesSent?: number;
+ framesReceived?: number;
+ framesDecoded?: number;
+ framesDropped?: number;
+ framesCorrupted?: number;
+ audioLevel?: number;
+ echoReturnLoss?: number;
+ echoReturnLossEnhancement?: number;
+}
+
+interface RTCOutboundRTPStreamStats extends RTCRTPStreamStats {
+ packetsSent?: number;
+ bytesSent?: number;
+ targetBitrate?: number;
+ roundTripTime?: number;
+}
+
+interface RTCRTPStreamStats extends RTCStats {
+ ssrc?: string;
+ associateStatsId?: string;
+ isRemote?: boolean;
+ mediaTrackId?: string;
+ transportId?: string;
+ codecId?: string;
+ firCount?: number;
+ pliCount?: number;
+ nackCount?: number;
+ sliCount?: number;
+}
+
+interface RTCRtcpFeedback {
+ type?: string;
+ parameter?: string;
+}
+
+interface RTCRtcpParameters {
+ ssrc?: number;
+ cname?: string;
+ reducedSize?: boolean;
+ mux?: boolean;
+}
+
+interface RTCRtpCapabilities {
+ codecs?: RTCRtpCodecCapability[];
+ headerExtensions?: RTCRtpHeaderExtension[];
+ fecMechanisms?: string[];
+}
+
+interface RTCRtpCodecCapability {
+ name?: string;
+ kind?: string;
+ clockRate?: number;
+ preferredPayloadType?: number;
+ maxptime?: number;
+ numChannels?: number;
+ rtcpFeedback?: RTCRtcpFeedback[];
+ parameters?: any;
+ options?: any;
+ maxTemporalLayers?: number;
+ maxSpatialLayers?: number;
+ svcMultiStreamSupport?: boolean;
+}
+
+interface RTCRtpCodecParameters {
+ name?: string;
+ payloadType?: any;
+ clockRate?: number;
+ maxptime?: number;
+ numChannels?: number;
+ rtcpFeedback?: RTCRtcpFeedback[];
+ parameters?: any;
+}
+
+interface RTCRtpContributingSource {
+ timestamp?: number;
+ csrc?: number;
+ audioLevel?: number;
+}
+
+interface RTCRtpEncodingParameters {
+ ssrc?: number;
+ codecPayloadType?: number;
+ fec?: RTCRtpFecParameters;
+ rtx?: RTCRtpRtxParameters;
+ priority?: number;
+ maxBitrate?: number;
+ minQuality?: number;
+ framerateBias?: number;
+ resolutionScale?: number;
+ framerateScale?: number;
+ active?: boolean;
+ encodingId?: string;
+ dependencyEncodingIds?: string[];
+ ssrcRange?: RTCSsrcRange;
+}
+
+interface RTCRtpFecParameters {
+ ssrc?: number;
+ mechanism?: string;
+}
+
+interface RTCRtpHeaderExtension {
+ kind?: string;
+ uri?: string;
+ preferredId?: number;
+ preferredEncrypt?: boolean;
+}
+
+interface RTCRtpHeaderExtensionParameters {
+ uri?: string;
+ id?: number;
+ encrypt?: boolean;
+}
+
+interface RTCRtpParameters {
+ muxId?: string;
+ codecs?: RTCRtpCodecParameters[];
+ headerExtensions?: RTCRtpHeaderExtensionParameters[];
+ encodings?: RTCRtpEncodingParameters[];
+ rtcp?: RTCRtcpParameters;
+}
+
+interface RTCRtpRtxParameters {
+ ssrc?: number;
+}
+
+interface RTCRtpUnhandled {
+ ssrc?: number;
+ payloadType?: number;
+ muxId?: string;
+}
+
+interface RTCSrtpKeyParam {
+ keyMethod?: string;
+ keySalt?: string;
+ lifetime?: string;
+ mkiValue?: number;
+ mkiLength?: number;
+}
+
+interface RTCSrtpSdesParameters {
+ tag?: number;
+ cryptoSuite?: string;
+ keyParams?: RTCSrtpKeyParam[];
+ sessionParams?: string[];
+}
+
+interface RTCSsrcRange {
+ min?: number;
+ max?: number;
+}
+
+interface RTCStats {
+ timestamp?: number;
+ type?: string;
+ id?: string;
+ msType?: string;
+}
+
+interface RTCStatsReport {
+}
+
+interface RTCTransportStats extends RTCStats {
+ bytesSent?: number;
+ bytesReceived?: number;
+ rtcpTransportStatsId?: string;
+ activeConnection?: boolean;
+ selectedCandidatePairId?: string;
+ localCertificateId?: string;
+ remoteCertificateId?: string;
+}
+
+interface StoreExceptionsInformation extends ExceptionInformation {
+ siteName?: string;
+ explanationString?: string;
+ detailURI?: string;
+}
+
+interface StoreSiteSpecificExceptionsInformation extends StoreExceptionsInformation {
+ arrayOfDomainStrings?: string[];
+}
+
+interface UIEventInit extends EventInit {
+ view?: Window;
+ detail?: number;
+}
+
+interface WebGLContextAttributes {
+ failIfMajorPerformanceCaveat?: boolean;
+ alpha?: boolean;
+ depth?: boolean;
+ stencil?: boolean;
+ antialias?: boolean;
+ premultipliedAlpha?: boolean;
+ preserveDrawingBuffer?: boolean;
+}
+
+interface WebGLContextEventInit extends EventInit {
+ statusMessage?: string;
+}
+
+interface WheelEventInit extends MouseEventInit {
+ deltaX?: number;
+ deltaY?: number;
+ deltaZ?: number;
+ deltaMode?: number;
+}
+
+interface EventListener {
+ (evt: Event): void;
+}
+
+interface ANGLE_instanced_arrays {
+ drawArraysInstancedANGLE(mode: number, first: number, count: number, primcount: number): void;
+ drawElementsInstancedANGLE(mode: number, count: number, type: number, offset: number, primcount: number): void;
+ vertexAttribDivisorANGLE(index: number, divisor: number): void;
+ readonly VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE: number;
+}
+
+declare var ANGLE_instanced_arrays: {
+ prototype: ANGLE_instanced_arrays;
+ new(): ANGLE_instanced_arrays;
+ readonly VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE: number;
+}
+
+interface AnalyserNode extends AudioNode {
+ fftSize: number;
+ readonly frequencyBinCount: number;
+ maxDecibels: number;
+ minDecibels: number;
+ smoothingTimeConstant: number;
+ getByteFrequencyData(array: Uint8Array): void;
+ getByteTimeDomainData(array: Uint8Array): void;
+ getFloatFrequencyData(array: Float32Array): void;
+ getFloatTimeDomainData(array: Float32Array): void;
+}
+
+declare var AnalyserNode: {
+ prototype: AnalyserNode;
+ new(): AnalyserNode;
+}
+
+interface AnimationEvent extends Event {
+ readonly animationName: string;
+ readonly elapsedTime: number;
+ initAnimationEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, animationNameArg: string, elapsedTimeArg: number): void;
+}
+
+declare var AnimationEvent: {
+ prototype: AnimationEvent;
+ new(): AnimationEvent;
+}
+
+interface ApplicationCache extends EventTarget {
+ oncached: (this: this, ev: Event) => any;
+ onchecking: (this: this, ev: Event) => any;
+ ondownloading: (this: this, ev: Event) => any;
+ onerror: (this: this, ev: ErrorEvent) => any;
+ onnoupdate: (this: this, ev: Event) => any;
+ onobsolete: (this: this, ev: Event) => any;
+ onprogress: (this: this, ev: ProgressEvent) => any;
+ onupdateready: (this: this, ev: Event) => any;
+ readonly status: number;
+ abort(): void;
+ swapCache(): void;
+ update(): void;
+ readonly CHECKING: number;
+ readonly DOWNLOADING: number;
+ readonly IDLE: number;
+ readonly OBSOLETE: number;
+ readonly UNCACHED: number;
+ readonly UPDATEREADY: number;
+ addEventListener(type: "cached", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "checking", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "downloading", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "error", listener: (this: this, ev: ErrorEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "noupdate", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "obsolete", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "progress", listener: (this: this, ev: ProgressEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "updateready", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var ApplicationCache: {
+ prototype: ApplicationCache;
+ new(): ApplicationCache;
+ readonly CHECKING: number;
+ readonly DOWNLOADING: number;
+ readonly IDLE: number;
+ readonly OBSOLETE: number;
+ readonly UNCACHED: number;
+ readonly UPDATEREADY: number;
+}
+
+interface AriaRequestEvent extends Event {
+ readonly attributeName: string;
+ attributeValue: string | null;
+}
+
+declare var AriaRequestEvent: {
+ prototype: AriaRequestEvent;
+ new(type: string, eventInitDict?: AriaRequestEventInit): AriaRequestEvent;
+}
+
+interface Attr extends Node {
+ readonly name: string;
+ readonly ownerElement: Element;
+ readonly prefix: string | null;
+ readonly specified: boolean;
+ value: string;
+}
+
+declare var Attr: {
+ prototype: Attr;
+ new(): Attr;
+}
+
+interface AudioBuffer {
+ readonly duration: number;
+ readonly length: number;
+ readonly numberOfChannels: number;
+ readonly sampleRate: number;
+ copyFromChannel(destination: Float32Array, channelNumber: number, startInChannel?: number): void;
+ copyToChannel(source: Float32Array, channelNumber: number, startInChannel?: number): void;
+ getChannelData(channel: number): Float32Array;
+}
+
+declare var AudioBuffer: {
+ prototype: AudioBuffer;
+ new(): AudioBuffer;
+}
+
+interface AudioBufferSourceNode extends AudioNode {
+ buffer: AudioBuffer | null;
+ readonly detune: AudioParam;
+ loop: boolean;
+ loopEnd: number;
+ loopStart: number;
+ onended: (this: this, ev: MediaStreamErrorEvent) => any;
+ readonly playbackRate: AudioParam;
+ start(when?: number, offset?: number, duration?: number): void;
+ stop(when?: number): void;
+ addEventListener(type: "ended", listener: (this: this, ev: MediaStreamErrorEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var AudioBufferSourceNode: {
+ prototype: AudioBufferSourceNode;
+ new(): AudioBufferSourceNode;
+}
+
+interface AudioContext extends EventTarget {
+ readonly currentTime: number;
+ readonly destination: AudioDestinationNode;
+ readonly listener: AudioListener;
+ readonly sampleRate: number;
+ state: string;
+ createAnalyser(): AnalyserNode;
+ createBiquadFilter(): BiquadFilterNode;
+ createBuffer(numberOfChannels: number, length: number, sampleRate: number): AudioBuffer;
+ createBufferSource(): AudioBufferSourceNode;
+ createChannelMerger(numberOfInputs?: number): ChannelMergerNode;
+ createChannelSplitter(numberOfOutputs?: number): ChannelSplitterNode;
+ createConvolver(): ConvolverNode;
+ createDelay(maxDelayTime?: number): DelayNode;
+ createDynamicsCompressor(): DynamicsCompressorNode;
+ createGain(): GainNode;
+ createMediaElementSource(mediaElement: HTMLMediaElement): MediaElementAudioSourceNode;
+ createMediaStreamSource(mediaStream: MediaStream): MediaStreamAudioSourceNode;
+ createOscillator(): OscillatorNode;
+ createPanner(): PannerNode;
+ createPeriodicWave(real: Float32Array, imag: Float32Array, constraints?: PeriodicWaveConstraints): PeriodicWave;
+ createScriptProcessor(bufferSize?: number, numberOfInputChannels?: number, numberOfOutputChannels?: number): ScriptProcessorNode;
+ createStereoPanner(): StereoPannerNode;
+ createWaveShaper(): WaveShaperNode;
+ decodeAudioData(audioData: ArrayBuffer, successCallback?: DecodeSuccessCallback, errorCallback?: DecodeErrorCallback): PromiseLike<AudioBuffer>;
+}
+
+declare var AudioContext: {
+ prototype: AudioContext;
+ new(): AudioContext;
+}
+
+interface AudioDestinationNode extends AudioNode {
+ readonly maxChannelCount: number;
+}
+
+declare var AudioDestinationNode: {
+ prototype: AudioDestinationNode;
+ new(): AudioDestinationNode;
+}
+
+interface AudioListener {
+ dopplerFactor: number;
+ speedOfSound: number;
+ setOrientation(x: number, y: number, z: number, xUp: number, yUp: number, zUp: number): void;
+ setPosition(x: number, y: number, z: number): void;
+ setVelocity(x: number, y: number, z: number): void;
+}
+
+declare var AudioListener: {
+ prototype: AudioListener;
+ new(): AudioListener;
+}
+
+interface AudioNode extends EventTarget {
+ channelCount: number;
+ channelCountMode: string;
+ channelInterpretation: string;
+ readonly context: AudioContext;
+ readonly numberOfInputs: number;
+ readonly numberOfOutputs: number;
+ connect(destination: AudioNode, output?: number, input?: number): void;
+ disconnect(output?: number): void;
+ disconnect(destination: AudioNode, output?: number, input?: number): void;
+ disconnect(destination: AudioParam, output?: number): void;
+}
+
+declare var AudioNode: {
+ prototype: AudioNode;
+ new(): AudioNode;
+}
+
+interface AudioParam {
+ readonly defaultValue: number;
+ value: number;
+ cancelScheduledValues(startTime: number): void;
+ exponentialRampToValueAtTime(value: number, endTime: number): void;
+ linearRampToValueAtTime(value: number, endTime: number): void;
+ setTargetAtTime(target: number, startTime: number, timeConstant: number): void;
+ setValueAtTime(value: number, startTime: number): void;
+ setValueCurveAtTime(values: Float32Array, startTime: number, duration: number): void;
+}
+
+declare var AudioParam: {
+ prototype: AudioParam;
+ new(): AudioParam;
+}
+
+interface AudioProcessingEvent extends Event {
+ readonly inputBuffer: AudioBuffer;
+ readonly outputBuffer: AudioBuffer;
+ readonly playbackTime: number;
+}
+
+declare var AudioProcessingEvent: {
+ prototype: AudioProcessingEvent;
+ new(): AudioProcessingEvent;
+}
+
+interface AudioTrack {
+ enabled: boolean;
+ readonly id: string;
+ kind: string;
+ readonly label: string;
+ language: string;
+ readonly sourceBuffer: SourceBuffer;
+}
+
+declare var AudioTrack: {
+ prototype: AudioTrack;
+ new(): AudioTrack;
+}
+
+interface AudioTrackList extends EventTarget {
+ readonly length: number;
+ onaddtrack: (this: this, ev: TrackEvent) => any;
+ onchange: (this: this, ev: Event) => any;
+ onremovetrack: (this: this, ev: TrackEvent) => any;
+ getTrackById(id: string): AudioTrack | null;
+ item(index: number): AudioTrack;
+ addEventListener(type: "addtrack", listener: (this: this, ev: TrackEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "change", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "removetrack", listener: (this: this, ev: TrackEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+ [index: number]: AudioTrack;
+}
+
+declare var AudioTrackList: {
+ prototype: AudioTrackList;
+ new(): AudioTrackList;
+}
+
+interface BarProp {
+ readonly visible: boolean;
+}
+
+declare var BarProp: {
+ prototype: BarProp;
+ new(): BarProp;
+}
+
+interface BeforeUnloadEvent extends Event {
+ returnValue: any;
+}
+
+declare var BeforeUnloadEvent: {
+ prototype: BeforeUnloadEvent;
+ new(): BeforeUnloadEvent;
+}
+
+interface BiquadFilterNode extends AudioNode {
+ readonly Q: AudioParam;
+ readonly detune: AudioParam;
+ readonly frequency: AudioParam;
+ readonly gain: AudioParam;
+ type: string;
+ getFrequencyResponse(frequencyHz: Float32Array, magResponse: Float32Array, phaseResponse: Float32Array): void;
+}
+
+declare var BiquadFilterNode: {
+ prototype: BiquadFilterNode;
+ new(): BiquadFilterNode;
+}
+
+interface Blob {
+ readonly size: number;
+ readonly type: string;
+ msClose(): void;
+ msDetachStream(): any;
+ slice(start?: number, end?: number, contentType?: string): Blob;
+}
+
+declare var Blob: {
+ prototype: Blob;
+ new (blobParts?: any[], options?: BlobPropertyBag): Blob;
+}
+
+interface CDATASection extends Text {
+}
+
+declare var CDATASection: {
+ prototype: CDATASection;
+ new(): CDATASection;
+}
+
+interface CSS {
+ supports(property: string, value?: string): boolean;
+}
+declare var CSS: CSS;
+
+interface CSSConditionRule extends CSSGroupingRule {
+ conditionText: string;
+}
+
+declare var CSSConditionRule: {
+ prototype: CSSConditionRule;
+ new(): CSSConditionRule;
+}
+
+interface CSSFontFaceRule extends CSSRule {
+ readonly style: CSSStyleDeclaration;
+}
+
+declare var CSSFontFaceRule: {
+ prototype: CSSFontFaceRule;
+ new(): CSSFontFaceRule;
+}
+
+interface CSSGroupingRule extends CSSRule {
+ readonly cssRules: CSSRuleList;
+ deleteRule(index: number): void;
+ insertRule(rule: string, index: number): number;
+}
+
+declare var CSSGroupingRule: {
+ prototype: CSSGroupingRule;
+ new(): CSSGroupingRule;
+}
+
+interface CSSImportRule extends CSSRule {
+ readonly href: string;
+ readonly media: MediaList;
+ readonly styleSheet: CSSStyleSheet;
+}
+
+declare var CSSImportRule: {
+ prototype: CSSImportRule;
+ new(): CSSImportRule;
+}
+
+interface CSSKeyframeRule extends CSSRule {
+ keyText: string;
+ readonly style: CSSStyleDeclaration;
+}
+
+declare var CSSKeyframeRule: {
+ prototype: CSSKeyframeRule;
+ new(): CSSKeyframeRule;
+}
+
+interface CSSKeyframesRule extends CSSRule {
+ readonly cssRules: CSSRuleList;
+ name: string;
+ appendRule(rule: string): void;
+ deleteRule(rule: string): void;
+ findRule(rule: string): CSSKeyframeRule;
+}
+
+declare var CSSKeyframesRule: {
+ prototype: CSSKeyframesRule;
+ new(): CSSKeyframesRule;
+}
+
+interface CSSMediaRule extends CSSConditionRule {
+ readonly media: MediaList;
+}
+
+declare var CSSMediaRule: {
+ prototype: CSSMediaRule;
+ new(): CSSMediaRule;
+}
+
+interface CSSNamespaceRule extends CSSRule {
+ readonly namespaceURI: string;
+ readonly prefix: string;
+}
+
+declare var CSSNamespaceRule: {
+ prototype: CSSNamespaceRule;
+ new(): CSSNamespaceRule;
+}
+
+interface CSSPageRule extends CSSRule {
+ readonly pseudoClass: string;
+ readonly selector: string;
+ selectorText: string;
+ readonly style: CSSStyleDeclaration;
+}
+
+declare var CSSPageRule: {
+ prototype: CSSPageRule;
+ new(): CSSPageRule;
+}
+
+interface CSSRule {
+ cssText: string;
+ readonly parentRule: CSSRule;
+ readonly parentStyleSheet: CSSStyleSheet;
+ readonly type: number;
+ readonly CHARSET_RULE: number;
+ readonly FONT_FACE_RULE: number;
+ readonly IMPORT_RULE: number;
+ readonly KEYFRAMES_RULE: number;
+ readonly KEYFRAME_RULE: number;
+ readonly MEDIA_RULE: number;
+ readonly NAMESPACE_RULE: number;
+ readonly PAGE_RULE: number;
+ readonly STYLE_RULE: number;
+ readonly SUPPORTS_RULE: number;
+ readonly UNKNOWN_RULE: number;
+ readonly VIEWPORT_RULE: number;
+}
+
+declare var CSSRule: {
+ prototype: CSSRule;
+ new(): CSSRule;
+ readonly CHARSET_RULE: number;
+ readonly FONT_FACE_RULE: number;
+ readonly IMPORT_RULE: number;
+ readonly KEYFRAMES_RULE: number;
+ readonly KEYFRAME_RULE: number;
+ readonly MEDIA_RULE: number;
+ readonly NAMESPACE_RULE: number;
+ readonly PAGE_RULE: number;
+ readonly STYLE_RULE: number;
+ readonly SUPPORTS_RULE: number;
+ readonly UNKNOWN_RULE: number;
+ readonly VIEWPORT_RULE: number;
+}
+
+interface CSSRuleList {
+ readonly length: number;
+ item(index: number): CSSRule;
+ [index: number]: CSSRule;
+}
+
+declare var CSSRuleList: {
+ prototype: CSSRuleList;
+ new(): CSSRuleList;
+}
+
+interface CSSStyleDeclaration {
+ alignContent: string | null;
+ alignItems: string | null;
+ alignSelf: string | null;
+ alignmentBaseline: string | null;
+ animation: string | null;
+ animationDelay: string | null;
+ animationDirection: string | null;
+ animationDuration: string | null;
+ animationFillMode: string | null;
+ animationIterationCount: string | null;
+ animationName: string | null;
+ animationPlayState: string | null;
+ animationTimingFunction: string | null;
+ backfaceVisibility: string | null;
+ background: string | null;
+ backgroundAttachment: string | null;
+ backgroundClip: string | null;
+ backgroundColor: string | null;
+ backgroundImage: string | null;
+ backgroundOrigin: string | null;
+ backgroundPosition: string | null;
+ backgroundPositionX: string | null;
+ backgroundPositionY: string | null;
+ backgroundRepeat: string | null;
+ backgroundSize: string | null;
+ baselineShift: string | null;
+ border: string | null;
+ borderBottom: string | null;
+ borderBottomColor: string | null;
+ borderBottomLeftRadius: string | null;
+ borderBottomRightRadius: string | null;
+ borderBottomStyle: string | null;
+ borderBottomWidth: string | null;
+ borderCollapse: string | null;
+ borderColor: string | null;
+ borderImage: string | null;
+ borderImageOutset: string | null;
+ borderImageRepeat: string | null;
+ borderImageSlice: string | null;
+ borderImageSource: string | null;
+ borderImageWidth: string | null;
+ borderLeft: string | null;
+ borderLeftColor: string | null;
+ borderLeftStyle: string | null;
+ borderLeftWidth: string | null;
+ borderRadius: string | null;
+ borderRight: string | null;
+ borderRightColor: string | null;
+ borderRightStyle: string | null;
+ borderRightWidth: string | null;
+ borderSpacing: string | null;
+ borderStyle: string | null;
+ borderTop: string | null;
+ borderTopColor: string | null;
+ borderTopLeftRadius: string | null;
+ borderTopRightRadius: string | null;
+ borderTopStyle: string | null;
+ borderTopWidth: string | null;
+ borderWidth: string | null;
+ bottom: string | null;
+ boxShadow: string | null;
+ boxSizing: string | null;
+ breakAfter: string | null;
+ breakBefore: string | null;
+ breakInside: string | null;
+ captionSide: string | null;
+ clear: string | null;
+ clip: string | null;
+ clipPath: string | null;
+ clipRule: string | null;
+ color: string | null;
+ colorInterpolationFilters: string | null;
+ columnCount: any;
+ columnFill: string | null;
+ columnGap: any;
+ columnRule: string | null;
+ columnRuleColor: any;
+ columnRuleStyle: string | null;
+ columnRuleWidth: any;
+ columnSpan: string | null;
+ columnWidth: any;
+ columns: string | null;
+ content: string | null;
+ counterIncrement: string | null;
+ counterReset: string | null;
+ cssFloat: string | null;
+ cssText: string;
+ cursor: string | null;
+ direction: string | null;
+ display: string | null;
+ dominantBaseline: string | null;
+ emptyCells: string | null;
+ enableBackground: string | null;
+ fill: string | null;
+ fillOpacity: string | null;
+ fillRule: string | null;
+ filter: string | null;
+ flex: string | null;
+ flexBasis: string | null;
+ flexDirection: string | null;
+ flexFlow: string | null;
+ flexGrow: string | null;
+ flexShrink: string | null;
+ flexWrap: string | null;
+ floodColor: string | null;
+ floodOpacity: string | null;
+ font: string | null;
+ fontFamily: string | null;
+ fontFeatureSettings: string | null;
+ fontSize: string | null;
+ fontSizeAdjust: string | null;
+ fontStretch: string | null;
+ fontStyle: string | null;
+ fontVariant: string | null;
+ fontWeight: string | null;
+ glyphOrientationHorizontal: string | null;
+ glyphOrientationVertical: string | null;
+ height: string | null;
+ imeMode: string | null;
+ justifyContent: string | null;
+ kerning: string | null;
+ left: string | null;
+ readonly length: number;
+ letterSpacing: string | null;
+ lightingColor: string | null;
+ lineHeight: string | null;
+ listStyle: string | null;
+ listStyleImage: string | null;
+ listStylePosition: string | null;
+ listStyleType: string | null;
+ margin: string | null;
+ marginBottom: string | null;
+ marginLeft: string | null;
+ marginRight: string | null;
+ marginTop: string | null;
+ marker: string | null;
+ markerEnd: string | null;
+ markerMid: string | null;
+ markerStart: string | null;
+ mask: string | null;
+ maxHeight: string | null;
+ maxWidth: string | null;
+ minHeight: string | null;
+ minWidth: string | null;
+ msContentZoomChaining: string | null;
+ msContentZoomLimit: string | null;
+ msContentZoomLimitMax: any;
+ msContentZoomLimitMin: any;
+ msContentZoomSnap: string | null;
+ msContentZoomSnapPoints: string | null;
+ msContentZoomSnapType: string | null;
+ msContentZooming: string | null;
+ msFlowFrom: string | null;
+ msFlowInto: string | null;
+ msFontFeatureSettings: string | null;
+ msGridColumn: any;
+ msGridColumnAlign: string | null;
+ msGridColumnSpan: any;
+ msGridColumns: string | null;
+ msGridRow: any;
+ msGridRowAlign: string | null;
+ msGridRowSpan: any;
+ msGridRows: string | null;
+ msHighContrastAdjust: string | null;
+ msHyphenateLimitChars: string | null;
+ msHyphenateLimitLines: any;
+ msHyphenateLimitZone: any;
+ msHyphens: string | null;
+ msImeAlign: string | null;
+ msOverflowStyle: string | null;
+ msScrollChaining: string | null;
+ msScrollLimit: string | null;
+ msScrollLimitXMax: any;
+ msScrollLimitXMin: any;
+ msScrollLimitYMax: any;
+ msScrollLimitYMin: any;
+ msScrollRails: string | null;
+ msScrollSnapPointsX: string | null;
+ msScrollSnapPointsY: string | null;
+ msScrollSnapType: string | null;
+ msScrollSnapX: string | null;
+ msScrollSnapY: string | null;
+ msScrollTranslation: string | null;
+ msTextCombineHorizontal: string | null;
+ msTextSizeAdjust: any;
+ msTouchAction: string | null;
+ msTouchSelect: string | null;
+ msUserSelect: string | null;
+ msWrapFlow: string;
+ msWrapMargin: any;
+ msWrapThrough: string;
+ opacity: string | null;
+ order: string | null;
+ orphans: string | null;
+ outline: string | null;
+ outlineColor: string | null;
+ outlineStyle: string | null;
+ outlineWidth: string | null;
+ overflow: string | null;
+ overflowX: string | null;
+ overflowY: string | null;
+ padding: string | null;
+ paddingBottom: string | null;
+ paddingLeft: string | null;
+ paddingRight: string | null;
+ paddingTop: string | null;
+ pageBreakAfter: string | null;
+ pageBreakBefore: string | null;
+ pageBreakInside: string | null;
+ readonly parentRule: CSSRule;
+ perspective: string | null;
+ perspectiveOrigin: string | null;
+ pointerEvents: string | null;
+ position: string | null;
+ quotes: string | null;
+ right: string | null;
+ rubyAlign: string | null;
+ rubyOverhang: string | null;
+ rubyPosition: string | null;
+ stopColor: string | null;
+ stopOpacity: string | null;
+ stroke: string | null;
+ strokeDasharray: string | null;
+ strokeDashoffset: string | null;
+ strokeLinecap: string | null;
+ strokeLinejoin: string | null;
+ strokeMiterlimit: string | null;
+ strokeOpacity: string | null;
+ strokeWidth: string | null;
+ tableLayout: string | null;
+ textAlign: string | null;
+ textAlignLast: string | null;
+ textAnchor: string | null;
+ textDecoration: string | null;
+ textIndent: string | null;
+ textJustify: string | null;
+ textKashida: string | null;
+ textKashidaSpace: string | null;
+ textOverflow: string | null;
+ textShadow: string | null;
+ textTransform: string | null;
+ textUnderlinePosition: string | null;
+ top: string | null;
+ touchAction: string | null;
+ transform: string | null;
+ transformOrigin: string | null;
+ transformStyle: string | null;
+ transition: string | null;
+ transitionDelay: string | null;
+ transitionDuration: string | null;
+ transitionProperty: string | null;
+ transitionTimingFunction: string | null;
+ unicodeBidi: string | null;
+ verticalAlign: string | null;
+ visibility: string | null;
+ webkitAlignContent: string | null;
+ webkitAlignItems: string | null;
+ webkitAlignSelf: string | null;
+ webkitAnimation: string | null;
+ webkitAnimationDelay: string | null;
+ webkitAnimationDirection: string | null;
+ webkitAnimationDuration: string | null;
+ webkitAnimationFillMode: string | null;
+ webkitAnimationIterationCount: string | null;
+ webkitAnimationName: string | null;
+ webkitAnimationPlayState: string | null;
+ webkitAnimationTimingFunction: string | null;
+ webkitAppearance: string | null;
+ webkitBackfaceVisibility: string | null;
+ webkitBackgroundClip: string | null;
+ webkitBackgroundOrigin: string | null;
+ webkitBackgroundSize: string | null;
+ webkitBorderBottomLeftRadius: string | null;
+ webkitBorderBottomRightRadius: string | null;
+ webkitBorderImage: string | null;
+ webkitBorderRadius: string | null;
+ webkitBorderTopLeftRadius: string | null;
+ webkitBorderTopRightRadius: string | null;
+ webkitBoxAlign: string | null;
+ webkitBoxDirection: string | null;
+ webkitBoxFlex: string | null;
+ webkitBoxOrdinalGroup: string | null;
+ webkitBoxOrient: string | null;
+ webkitBoxPack: string | null;
+ webkitBoxSizing: string | null;
+ webkitColumnBreakAfter: string | null;
+ webkitColumnBreakBefore: string | null;
+ webkitColumnBreakInside: string | null;
+ webkitColumnCount: any;
+ webkitColumnGap: any;
+ webkitColumnRule: string | null;
+ webkitColumnRuleColor: any;
+ webkitColumnRuleStyle: string | null;
+ webkitColumnRuleWidth: any;
+ webkitColumnSpan: string | null;
+ webkitColumnWidth: any;
+ webkitColumns: string | null;
+ webkitFilter: string | null;
+ webkitFlex: string | null;
+ webkitFlexBasis: string | null;
+ webkitFlexDirection: string | null;
+ webkitFlexFlow: string | null;
+ webkitFlexGrow: string | null;
+ webkitFlexShrink: string | null;
+ webkitFlexWrap: string | null;
+ webkitJustifyContent: string | null;
+ webkitOrder: string | null;
+ webkitPerspective: string | null;
+ webkitPerspectiveOrigin: string | null;
+ webkitTapHighlightColor: string | null;
+ webkitTextFillColor: string | null;
+ webkitTextSizeAdjust: any;
+ webkitTransform: string | null;
+ webkitTransformOrigin: string | null;
+ webkitTransformStyle: string | null;
+ webkitTransition: string | null;
+ webkitTransitionDelay: string | null;
+ webkitTransitionDuration: string | null;
+ webkitTransitionProperty: string | null;
+ webkitTransitionTimingFunction: string | null;
+ webkitUserModify: string | null;
+ webkitUserSelect: string | null;
+ webkitWritingMode: string | null;
+ whiteSpace: string | null;
+ widows: string | null;
+ width: string | null;
+ wordBreak: string | null;
+ wordSpacing: string | null;
+ wordWrap: string | null;
+ writingMode: string | null;
+ zIndex: string | null;
+ zoom: string | null;
+ getPropertyPriority(propertyName: string): string;
+ getPropertyValue(propertyName: string): string;
+ item(index: number): string;
+ removeProperty(propertyName: string): string;
+ setProperty(propertyName: string, value: string | null, priority?: string): void;
+ [index: number]: string;
+}
+
+declare var CSSStyleDeclaration: {
+ prototype: CSSStyleDeclaration;
+ new(): CSSStyleDeclaration;
+}
+
+interface CSSStyleRule extends CSSRule {
+ readonly readOnly: boolean;
+ selectorText: string;
+ readonly style: CSSStyleDeclaration;
+}
+
+declare var CSSStyleRule: {
+ prototype: CSSStyleRule;
+ new(): CSSStyleRule;
+}
+
+interface CSSStyleSheet extends StyleSheet {
+ readonly cssRules: CSSRuleList;
+ cssText: string;
+ readonly href: string;
+ readonly id: string;
+ readonly imports: StyleSheetList;
+ readonly isAlternate: boolean;
+ readonly isPrefAlternate: boolean;
+ readonly ownerRule: CSSRule;
+ readonly owningElement: Element;
+ readonly pages: StyleSheetPageList;
+ readonly readOnly: boolean;
+ readonly rules: CSSRuleList;
+ addImport(bstrURL: string, lIndex?: number): number;
+ addPageRule(bstrSelector: string, bstrStyle: string, lIndex?: number): number;
+ addRule(bstrSelector: string, bstrStyle?: string, lIndex?: number): number;
+ deleteRule(index?: number): void;
+ insertRule(rule: string, index?: number): number;
+ removeImport(lIndex: number): void;
+ removeRule(lIndex: number): void;
+}
+
+declare var CSSStyleSheet: {
+ prototype: CSSStyleSheet;
+ new(): CSSStyleSheet;
+}
+
+interface CSSSupportsRule extends CSSConditionRule {
+}
+
+declare var CSSSupportsRule: {
+ prototype: CSSSupportsRule;
+ new(): CSSSupportsRule;
+}
+
+interface CanvasGradient {
+ addColorStop(offset: number, color: string): void;
+}
+
+declare var CanvasGradient: {
+ prototype: CanvasGradient;
+ new(): CanvasGradient;
+}
+
+interface CanvasPattern {
+}
+
+declare var CanvasPattern: {
+ prototype: CanvasPattern;
+ new(): CanvasPattern;
+}
+
+interface CanvasRenderingContext2D extends Object, CanvasPathMethods {
+ readonly canvas: HTMLCanvasElement;
+ fillStyle: string | CanvasGradient | CanvasPattern;
+ font: string;
+ globalAlpha: number;
+ globalCompositeOperation: string;
+ lineCap: string;
+ lineDashOffset: number;
+ lineJoin: string;
+ lineWidth: number;
+ miterLimit: number;
+ msFillRule: string;
+ msImageSmoothingEnabled: boolean;
+ shadowBlur: number;
+ shadowColor: string;
+ shadowOffsetX: number;
+ shadowOffsetY: number;
+ strokeStyle: string | CanvasGradient | CanvasPattern;
+ textAlign: string;
+ textBaseline: string;
+ mozImageSmoothingEnabled: boolean;
+ webkitImageSmoothingEnabled: boolean;
+ oImageSmoothingEnabled: boolean;
+ beginPath(): void;
+ clearRect(x: number, y: number, w: number, h: number): void;
+ clip(fillRule?: string): void;
+ createImageData(imageDataOrSw: number | ImageData, sh?: number): ImageData;
+ createLinearGradient(x0: number, y0: number, x1: number, y1: number): CanvasGradient;
+ createPattern(image: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement, repetition: string): CanvasPattern;
+ createRadialGradient(x0: number, y0: number, r0: number, x1: number, y1: number, r1: number): CanvasGradient;
+ drawImage(image: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement, offsetX: number, offsetY: number, width?: number, height?: number, canvasOffsetX?: number, canvasOffsetY?: number, canvasImageWidth?: number, canvasImageHeight?: number): void;
+ fill(fillRule?: string): void;
+ fillRect(x: number, y: number, w: number, h: number): void;
+ fillText(text: string, x: number, y: number, maxWidth?: number): void;
+ getImageData(sx: number, sy: number, sw: number, sh: number): ImageData;
+ getLineDash(): number[];
+ isPointInPath(x: number, y: number, fillRule?: string): boolean;
+ measureText(text: string): TextMetrics;
+ putImageData(imagedata: ImageData, dx: number, dy: number, dirtyX?: number, dirtyY?: number, dirtyWidth?: number, dirtyHeight?: number): void;
+ restore(): void;
+ rotate(angle: number): void;
+ save(): void;
+ scale(x: number, y: number): void;
+ setLineDash(segments: number[]): void;
+ setTransform(m11: number, m12: number, m21: number, m22: number, dx: number, dy: number): void;
+ stroke(): void;
+ strokeRect(x: number, y: number, w: number, h: number): void;
+ strokeText(text: string, x: number, y: number, maxWidth?: number): void;
+ transform(m11: number, m12: number, m21: number, m22: number, dx: number, dy: number): void;
+ translate(x: number, y: number): void;
+}
+
+declare var CanvasRenderingContext2D: {
+ prototype: CanvasRenderingContext2D;
+ new(): CanvasRenderingContext2D;
+}
+
+interface ChannelMergerNode extends AudioNode {
+}
+
+declare var ChannelMergerNode: {
+ prototype: ChannelMergerNode;
+ new(): ChannelMergerNode;
+}
+
+interface ChannelSplitterNode extends AudioNode {
+}
+
+declare var ChannelSplitterNode: {
+ prototype: ChannelSplitterNode;
+ new(): ChannelSplitterNode;
+}
+
+interface CharacterData extends Node, ChildNode {
+ data: string;
+ readonly length: number;
+ appendData(arg: string): void;
+ deleteData(offset: number, count: number): void;
+ insertData(offset: number, arg: string): void;
+ replaceData(offset: number, count: number, arg: string): void;
+ substringData(offset: number, count: number): string;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var CharacterData: {
+ prototype: CharacterData;
+ new(): CharacterData;
+}
+
+interface ClientRect {
+ bottom: number;
+ readonly height: number;
+ left: number;
+ right: number;
+ top: number;
+ readonly width: number;
+}
+
+declare var ClientRect: {
+ prototype: ClientRect;
+ new(): ClientRect;
+}
+
+interface ClientRectList {
+ readonly length: number;
+ item(index: number): ClientRect;
+ [index: number]: ClientRect;
+}
+
+declare var ClientRectList: {
+ prototype: ClientRectList;
+ new(): ClientRectList;
+}
+
+interface ClipboardEvent extends Event {
+ readonly clipboardData: DataTransfer;
+}
+
+declare var ClipboardEvent: {
+ prototype: ClipboardEvent;
+ new(type: string, eventInitDict?: ClipboardEventInit): ClipboardEvent;
+}
+
+interface CloseEvent extends Event {
+ readonly code: number;
+ readonly reason: string;
+ readonly wasClean: boolean;
+ initCloseEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, wasCleanArg: boolean, codeArg: number, reasonArg: string): void;
+}
+
+declare var CloseEvent: {
+ prototype: CloseEvent;
+ new(): CloseEvent;
+}
+
+interface CommandEvent extends Event {
+ readonly commandName: string;
+ readonly detail: string | null;
+}
+
+declare var CommandEvent: {
+ prototype: CommandEvent;
+ new(type: string, eventInitDict?: CommandEventInit): CommandEvent;
+}
+
+interface Comment extends CharacterData {
+ text: string;
+}
+
+declare var Comment: {
+ prototype: Comment;
+ new(): Comment;
+}
+
+interface CompositionEvent extends UIEvent {
+ readonly data: string;
+ readonly locale: string;
+ initCompositionEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, dataArg: string, locale: string): void;
+}
+
+declare var CompositionEvent: {
+ prototype: CompositionEvent;
+ new(typeArg: string, eventInitDict?: CompositionEventInit): CompositionEvent;
+}
+
+interface Console {
+ assert(test?: boolean, message?: string, ...optionalParams: any[]): void;
+ clear(): void;
+ count(countTitle?: string): void;
+ debug(message?: string, ...optionalParams: any[]): void;
+ dir(value?: any, ...optionalParams: any[]): void;
+ dirxml(value: any): void;
+ error(message?: any, ...optionalParams: any[]): void;
+ exception(message?: string, ...optionalParams: any[]): void;
+ group(groupTitle?: string): void;
+ groupCollapsed(groupTitle?: string): void;
+ groupEnd(): void;
+ info(message?: any, ...optionalParams: any[]): void;
+ log(message?: any, ...optionalParams: any[]): void;
+ msIsIndependentlyComposed(element: Element): boolean;
+ profile(reportName?: string): void;
+ profileEnd(): void;
+ select(element: Element): void;
+ table(...data: any[]): void;
+ time(timerName?: string): void;
+ timeEnd(timerName?: string): void;
+ trace(message?: any, ...optionalParams: any[]): void;
+ warn(message?: any, ...optionalParams: any[]): void;
+}
+
+declare var Console: {
+ prototype: Console;
+ new(): Console;
+}
+
+interface ConvolverNode extends AudioNode {
+ buffer: AudioBuffer | null;
+ normalize: boolean;
+}
+
+declare var ConvolverNode: {
+ prototype: ConvolverNode;
+ new(): ConvolverNode;
+}
+
+interface Coordinates {
+ readonly accuracy: number;
+ readonly altitude: number | null;
+ readonly altitudeAccuracy: number | null;
+ readonly heading: number | null;
+ readonly latitude: number;
+ readonly longitude: number;
+ readonly speed: number | null;
+}
+
+declare var Coordinates: {
+ prototype: Coordinates;
+ new(): Coordinates;
+}
+
+interface Crypto extends Object, RandomSource {
+ readonly subtle: SubtleCrypto;
+}
+
+declare var Crypto: {
+ prototype: Crypto;
+ new(): Crypto;
+}
+
+interface CryptoKey {
+ readonly algorithm: KeyAlgorithm;
+ readonly extractable: boolean;
+ readonly type: string;
+ readonly usages: string[];
+}
+
+declare var CryptoKey: {
+ prototype: CryptoKey;
+ new(): CryptoKey;
+}
+
+interface CryptoKeyPair {
+ privateKey: CryptoKey;
+ publicKey: CryptoKey;
+}
+
+declare var CryptoKeyPair: {
+ prototype: CryptoKeyPair;
+ new(): CryptoKeyPair;
+}
+
+interface CustomEvent extends Event {
+ readonly detail: any;
+ initCustomEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, detailArg: any): void;
+}
+
+declare var CustomEvent: {
+ prototype: CustomEvent;
+ new(typeArg: string, eventInitDict?: CustomEventInit): CustomEvent;
+}
+
+interface DOMError {
+ readonly name: string;
+ toString(): string;
+}
+
+declare var DOMError: {
+ prototype: DOMError;
+ new(): DOMError;
+}
+
+interface DOMException {
+ readonly code: number;
+ readonly message: string;
+ readonly name: string;
+ toString(): string;
+ readonly ABORT_ERR: number;
+ readonly DATA_CLONE_ERR: number;
+ readonly DOMSTRING_SIZE_ERR: number;
+ readonly HIERARCHY_REQUEST_ERR: number;
+ readonly INDEX_SIZE_ERR: number;
+ readonly INUSE_ATTRIBUTE_ERR: number;
+ readonly INVALID_ACCESS_ERR: number;
+ readonly INVALID_CHARACTER_ERR: number;
+ readonly INVALID_MODIFICATION_ERR: number;
+ readonly INVALID_NODE_TYPE_ERR: number;
+ readonly INVALID_STATE_ERR: number;
+ readonly NAMESPACE_ERR: number;
+ readonly NETWORK_ERR: number;
+ readonly NOT_FOUND_ERR: number;
+ readonly NOT_SUPPORTED_ERR: number;
+ readonly NO_DATA_ALLOWED_ERR: number;
+ readonly NO_MODIFICATION_ALLOWED_ERR: number;
+ readonly PARSE_ERR: number;
+ readonly QUOTA_EXCEEDED_ERR: number;
+ readonly SECURITY_ERR: number;
+ readonly SERIALIZE_ERR: number;
+ readonly SYNTAX_ERR: number;
+ readonly TIMEOUT_ERR: number;
+ readonly TYPE_MISMATCH_ERR: number;
+ readonly URL_MISMATCH_ERR: number;
+ readonly VALIDATION_ERR: number;
+ readonly WRONG_DOCUMENT_ERR: number;
+}
+
+declare var DOMException: {
+ prototype: DOMException;
+ new(): DOMException;
+ readonly ABORT_ERR: number;
+ readonly DATA_CLONE_ERR: number;
+ readonly DOMSTRING_SIZE_ERR: number;
+ readonly HIERARCHY_REQUEST_ERR: number;
+ readonly INDEX_SIZE_ERR: number;
+ readonly INUSE_ATTRIBUTE_ERR: number;
+ readonly INVALID_ACCESS_ERR: number;
+ readonly INVALID_CHARACTER_ERR: number;
+ readonly INVALID_MODIFICATION_ERR: number;
+ readonly INVALID_NODE_TYPE_ERR: number;
+ readonly INVALID_STATE_ERR: number;
+ readonly NAMESPACE_ERR: number;
+ readonly NETWORK_ERR: number;
+ readonly NOT_FOUND_ERR: number;
+ readonly NOT_SUPPORTED_ERR: number;
+ readonly NO_DATA_ALLOWED_ERR: number;
+ readonly NO_MODIFICATION_ALLOWED_ERR: number;
+ readonly PARSE_ERR: number;
+ readonly QUOTA_EXCEEDED_ERR: number;
+ readonly SECURITY_ERR: number;
+ readonly SERIALIZE_ERR: number;
+ readonly SYNTAX_ERR: number;
+ readonly TIMEOUT_ERR: number;
+ readonly TYPE_MISMATCH_ERR: number;
+ readonly URL_MISMATCH_ERR: number;
+ readonly VALIDATION_ERR: number;
+ readonly WRONG_DOCUMENT_ERR: number;
+}
+
+interface DOMImplementation {
+ createDocument(namespaceURI: string | null, qualifiedName: string | null, doctype: DocumentType): Document;
+ createDocumentType(qualifiedName: string, publicId: string | null, systemId: string | null): DocumentType;
+ createHTMLDocument(title: string): Document;
+ hasFeature(feature: string | null, version: string | null): boolean;
+}
+
+declare var DOMImplementation: {
+ prototype: DOMImplementation;
+ new(): DOMImplementation;
+}
+
+interface DOMParser {
+ parseFromString(source: string, mimeType: string): Document;
+}
+
+declare var DOMParser: {
+ prototype: DOMParser;
+ new(): DOMParser;
+}
+
+interface DOMSettableTokenList extends DOMTokenList {
+ value: string;
+}
+
+declare var DOMSettableTokenList: {
+ prototype: DOMSettableTokenList;
+ new(): DOMSettableTokenList;
+}
+
+interface DOMStringList {
+ readonly length: number;
+ contains(str: string): boolean;
+ item(index: number): string | null;
+ [index: number]: string;
+}
+
+declare var DOMStringList: {
+ prototype: DOMStringList;
+ new(): DOMStringList;
+}
+
+interface DOMStringMap {
+ [name: string]: string;
+}
+
+declare var DOMStringMap: {
+ prototype: DOMStringMap;
+ new(): DOMStringMap;
+}
+
+interface DOMTokenList {
+ readonly length: number;
+ add(...token: string[]): void;
+ contains(token: string): boolean;
+ item(index: number): string;
+ remove(...token: string[]): void;
+ toString(): string;
+ toggle(token: string, force?: boolean): boolean;
+ [index: number]: string;
+}
+
+declare var DOMTokenList: {
+ prototype: DOMTokenList;
+ new(): DOMTokenList;
+}
+
+interface DataCue extends TextTrackCue {
+ data: ArrayBuffer;
+}
+
+declare var DataCue: {
+ prototype: DataCue;
+ new(): DataCue;
+}
+
+interface DataTransfer {
+ dropEffect: string;
+ effectAllowed: string;
+ readonly files: FileList;
+ readonly items: DataTransferItemList;
+ readonly types: DOMStringList;
+ clearData(format?: string): boolean;
+ getData(format: string): string;
+ setData(format: string, data: string): boolean;
+}
+
+declare var DataTransfer: {
+ prototype: DataTransfer;
+ new(): DataTransfer;
+}
+
+interface DataTransferItem {
+ readonly kind: string;
+ readonly type: string;
+ getAsFile(): File | null;
+ getAsString(_callback: FunctionStringCallback | null): void;
+}
+
+declare var DataTransferItem: {
+ prototype: DataTransferItem;
+ new(): DataTransferItem;
+}
+
+interface DataTransferItemList {
+ readonly length: number;
+ add(data: File): DataTransferItem | null;
+ clear(): void;
+ item(index: number): DataTransferItem;
+ remove(index: number): void;
+ [index: number]: DataTransferItem;
+}
+
+declare var DataTransferItemList: {
+ prototype: DataTransferItemList;
+ new(): DataTransferItemList;
+}
+
+interface DeferredPermissionRequest {
+ readonly id: number;
+ readonly type: string;
+ readonly uri: string;
+ allow(): void;
+ deny(): void;
+}
+
+declare var DeferredPermissionRequest: {
+ prototype: DeferredPermissionRequest;
+ new(): DeferredPermissionRequest;
+}
+
+interface DelayNode extends AudioNode {
+ readonly delayTime: AudioParam;
+}
+
+declare var DelayNode: {
+ prototype: DelayNode;
+ new(): DelayNode;
+}
+
+interface DeviceAcceleration {
+ readonly x: number | null;
+ readonly y: number | null;
+ readonly z: number | null;
+}
+
+declare var DeviceAcceleration: {
+ prototype: DeviceAcceleration;
+ new(): DeviceAcceleration;
+}
+
+interface DeviceLightEvent extends Event {
+ readonly value: number;
+}
+
+declare var DeviceLightEvent: {
+ prototype: DeviceLightEvent;
+ new(type: string, eventInitDict?: DeviceLightEventInit): DeviceLightEvent;
+}
+
+interface DeviceMotionEvent extends Event {
+ readonly acceleration: DeviceAcceleration | null;
+ readonly accelerationIncludingGravity: DeviceAcceleration | null;
+ readonly interval: number | null;
+ readonly rotationRate: DeviceRotationRate | null;
+ initDeviceMotionEvent(type: string, bubbles: boolean, cancelable: boolean, acceleration: DeviceAccelerationDict | null, accelerationIncludingGravity: DeviceAccelerationDict | null, rotationRate: DeviceRotationRateDict | null, interval: number | null): void;
+}
+
+declare var DeviceMotionEvent: {
+ prototype: DeviceMotionEvent;
+ new(): DeviceMotionEvent;
+}
+
+interface DeviceOrientationEvent extends Event {
+ readonly absolute: boolean;
+ readonly alpha: number | null;
+ readonly beta: number | null;
+ readonly gamma: number | null;
+ initDeviceOrientationEvent(type: string, bubbles: boolean, cancelable: boolean, alpha: number | null, beta: number | null, gamma: number | null, absolute: boolean): void;
+}
+
+declare var DeviceOrientationEvent: {
+ prototype: DeviceOrientationEvent;
+ new(): DeviceOrientationEvent;
+}
+
+interface DeviceRotationRate {
+ readonly alpha: number | null;
+ readonly beta: number | null;
+ readonly gamma: number | null;
+}
+
+declare var DeviceRotationRate: {
+ prototype: DeviceRotationRate;
+ new(): DeviceRotationRate;
+}
+
+interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEvent, ParentNode {
+ /**
+ * Sets or gets the URL for the current document.
+ */
+ readonly URL: string;
+ /**
+ * Gets the URL for the document, stripped of any character encoding.
+ */
+ readonly URLUnencoded: string;
+ /**
+ * Gets the object that has the focus when the parent document has focus.
+ */
+ readonly activeElement: Element;
+ /**
+ * Sets or gets the color of all active links in the document.
+ */
+ alinkColor: string;
+ /**
+ * Returns a reference to the collection of elements contained by the object.
+ */
+ readonly all: HTMLAllCollection;
+ /**
+ * Retrieves a collection of all a objects that have a name and/or id property. Objects in this collection are in HTML source order.
+ */
+ anchors: HTMLCollectionOf<HTMLAnchorElement>;
+ /**
+ * Retrieves a collection of all applet objects in the document.
+ */
+ applets: HTMLCollectionOf<HTMLAppletElement>;
+ /**
+ * Deprecated. Sets or retrieves a value that indicates the background color behind the object.
+ */
+ bgColor: string;
+ /**
+ * Specifies the beginning and end of the document body.
+ */
+ body: HTMLElement;
+ readonly characterSet: string;
+ /**
+ * Gets or sets the character set used to encode the object.
+ */
+ charset: string;
+ /**
+ * Gets a value that indicates whether standards-compliant mode is switched on for the object.
+ */
+ readonly compatMode: string;
+ cookie: string;
+ readonly currentScript: HTMLScriptElement | SVGScriptElement;
+ /**
+ * Gets the default character set from the current regional language settings.
+ */
+ readonly defaultCharset: string;
+ readonly defaultView: Window;
+ /**
+ * Sets or gets a value that indicates whether the document can be edited.
+ */
+ designMode: string;
+ /**
+ * Sets or retrieves a value that indicates the reading order of the object.
+ */
+ dir: string;
+ /**
+ * Gets an object representing the document type declaration associated with the current document.
+ */
+ readonly doctype: DocumentType;
+ /**
+ * Gets a reference to the root node of the document.
+ */
+ documentElement: HTMLElement;
+ /**
+ * Sets or gets the security domain of the document.
+ */
+ domain: string;
+ /**
+ * Retrieves a collection of all embed objects in the document.
+ */
+ embeds: HTMLCollectionOf<HTMLEmbedElement>;
+ /**
+ * Sets or gets the foreground (text) color of the document.
+ */
+ fgColor: string;
+ /**
+ * Retrieves a collection, in source order, of all form objects in the document.
+ */
+ forms: HTMLCollectionOf<HTMLFormElement>;
+ readonly fullscreenElement: Element | null;
+ readonly fullscreenEnabled: boolean;
+ readonly head: HTMLHeadElement;
+ readonly hidden: boolean;
+ /**
+ * Retrieves a collection, in source order, of img objects in the document.
+ */
+ images: HTMLCollectionOf<HTMLImageElement>;
+ /**
+ * Gets the implementation object of the current document.
+ */
+ readonly implementation: DOMImplementation;
+ /**
+ * Returns the character encoding used to create the webpage that is loaded into the document object.
+ */
+ readonly inputEncoding: string | null;
+ /**
+ * Gets the date that the page was last modified, if the page supplies one.
+ */
+ readonly lastModified: string;
+ /**
+ * Sets or gets the color of the document links.
+ */
+ linkColor: string;
+ /**
+ * Retrieves a collection of all a objects that specify the href property and all area objects in the document.
+ */
+ links: HTMLCollectionOf<HTMLAnchorElement | HTMLAreaElement>;
+ /**
+ * Contains information about the current URL.
+ */
+ readonly location: Location;
+ msCSSOMElementFloatMetrics: boolean;
+ msCapsLockWarningOff: boolean;
+ /**
+ * Fires when the user aborts the download.
+ * @param ev The event.
+ */
+ onabort: (this: this, ev: UIEvent) => any;
+ /**
+ * Fires when the object is set as the active element.
+ * @param ev The event.
+ */
+ onactivate: (this: this, ev: UIEvent) => any;
+ /**
+ * Fires immediately before the object is set as the active element.
+ * @param ev The event.
+ */
+ onbeforeactivate: (this: this, ev: UIEvent) => any;
+ /**
+ * Fires immediately before the activeElement is changed from the current object to another object in the parent document.
+ * @param ev The event.
+ */
+ onbeforedeactivate: (this: this, ev: UIEvent) => any;
+ /**
+ * Fires when the object loses the input focus.
+ * @param ev The focus event.
+ */
+ onblur: (this: this, ev: FocusEvent) => any;
+ /**
+ * Occurs when playback is possible, but would require further buffering.
+ * @param ev The event.
+ */
+ oncanplay: (this: this, ev: Event) => any;
+ oncanplaythrough: (this: this, ev: Event) => any;
+ /**
+ * Fires when the contents of the object or selection have changed.
+ * @param ev The event.
+ */
+ onchange: (this: this, ev: Event) => any;
+ /**
+ * Fires when the user clicks the left mouse button on the object
+ * @param ev The mouse event.
+ */
+ onclick: (this: this, ev: MouseEvent) => any;
+ /**
+ * Fires when the user clicks the right mouse button in the client area, opening the context menu.
+ * @param ev The mouse event.
+ */
+ oncontextmenu: (this: this, ev: PointerEvent) => any;
+ /**
+ * Fires when the user double-clicks the object.
+ * @param ev The mouse event.
+ */
+ ondblclick: (this: this, ev: MouseEvent) => any;
+ /**
+ * Fires when the activeElement is changed from the current object to another object in the parent document.
+ * @param ev The UI Event
+ */
+ ondeactivate: (this: this, ev: UIEvent) => any;
+ /**
+ * Fires on the source object continuously during a drag operation.
+ * @param ev The event.
+ */
+ ondrag: (this: this, ev: DragEvent) => any;
+ /**
+ * Fires on the source object when the user releases the mouse at the close of a drag operation.
+ * @param ev The event.
+ */
+ ondragend: (this: this, ev: DragEvent) => any;
+ /**
+ * Fires on the target element when the user drags the object to a valid drop target.
+ * @param ev The drag event.
+ */
+ ondragenter: (this: this, ev: DragEvent) => any;
+ /**
+ * Fires on the target object when the user moves the mouse out of a valid drop target during a drag operation.
+ * @param ev The drag event.
+ */
+ ondragleave: (this: this, ev: DragEvent) => any;
+ /**
+ * Fires on the target element continuously while the user drags the object over a valid drop target.
+ * @param ev The event.
+ */
+ ondragover: (this: this, ev: DragEvent) => any;
+ /**
+ * Fires on the source object when the user starts to drag a text selection or selected object.
+ * @param ev The event.
+ */
+ ondragstart: (this: this, ev: DragEvent) => any;
+ ondrop: (this: this, ev: DragEvent) => any;
+ /**
+ * Occurs when the duration attribute is updated.
+ * @param ev The event.
+ */
+ ondurationchange: (this: this, ev: Event) => any;
+ /**
+ * Occurs when the media element is reset to its initial state.
+ * @param ev The event.
+ */
+ onemptied: (this: this, ev: Event) => any;
+ /**
+ * Occurs when the end of playback is reached.
+ * @param ev The event
+ */
+ onended: (this: this, ev: MediaStreamErrorEvent) => any;
+ /**
+ * Fires when an error occurs during object loading.
+ * @param ev The event.
+ */
+ onerror: (this: this, ev: ErrorEvent) => any;
+ /**
+ * Fires when the object receives focus.
+ * @param ev The event.
+ */
+ onfocus: (this: this, ev: FocusEvent) => any;
+ onfullscreenchange: (this: this, ev: Event) => any;
+ onfullscreenerror: (this: this, ev: Event) => any;
+ oninput: (this: this, ev: Event) => any;
+ oninvalid: (this: this, ev: Event) => any;
+ /**
+ * Fires when the user presses a key.
+ * @param ev The keyboard event
+ */
+ onkeydown: (this: this, ev: KeyboardEvent) => any;
+ /**
+ * Fires when the user presses an alphanumeric key.
+ * @param ev The event.
+ */
+ onkeypress: (this: this, ev: KeyboardEvent) => any;
+ /**
+ * Fires when the user releases a key.
+ * @param ev The keyboard event
+ */
+ onkeyup: (this: this, ev: KeyboardEvent) => any;
+ /**
+ * Fires immediately after the browser loads the object.
+ * @param ev The event.
+ */
+ onload: (this: this, ev: Event) => any;
+ /**
+ * Occurs when media data is loaded at the current playback position.
+ * @param ev The event.
+ */
+ onloadeddata: (this: this, ev: Event) => any;
+ /**
+ * Occurs when the duration and dimensions of the media have been determined.
+ * @param ev The event.
+ */
+ onloadedmetadata: (this: this, ev: Event) => any;
+ /**
+ * Occurs when Internet Explorer begins looking for media data.
+ * @param ev The event.
+ */
+ onloadstart: (this: this, ev: Event) => any;
+ /**
+ * Fires when the user clicks the object with either mouse button.
+ * @param ev The mouse event.
+ */
+ onmousedown: (this: this, ev: MouseEvent) => any;
+ /**
+ * Fires when the user moves the mouse over the object.
+ * @param ev The mouse event.
+ */
+ onmousemove: (this: this, ev: MouseEvent) => any;
+ /**
+ * Fires when the user moves the mouse pointer outside the boundaries of the object.
+ * @param ev The mouse event.
+ */
+ onmouseout: (this: this, ev: MouseEvent) => any;
+ /**
+ * Fires when the user moves the mouse pointer into the object.
+ * @param ev The mouse event.
+ */
+ onmouseover: (this: this, ev: MouseEvent) => any;
+ /**
+ * Fires when the user releases a mouse button while the mouse is over the object.
+ * @param ev The mouse event.
+ */
+ onmouseup: (this: this, ev: MouseEvent) => any;
+ /**
+ * Fires when the wheel button is rotated.
+ * @param ev The mouse event
+ */
+ onmousewheel: (this: this, ev: WheelEvent) => any;
+ onmscontentzoom: (this: this, ev: UIEvent) => any;
+ onmsgesturechange: (this: this, ev: MSGestureEvent) => any;
+ onmsgesturedoubletap: (this: this, ev: MSGestureEvent) => any;
+ onmsgestureend: (this: this, ev: MSGestureEvent) => any;
+ onmsgesturehold: (this: this, ev: MSGestureEvent) => any;
+ onmsgesturestart: (this: this, ev: MSGestureEvent) => any;
+ onmsgesturetap: (this: this, ev: MSGestureEvent) => any;
+ onmsinertiastart: (this: this, ev: MSGestureEvent) => any;
+ onmsmanipulationstatechanged: (this: this, ev: MSManipulationEvent) => any;
+ onmspointercancel: (this: this, ev: MSPointerEvent) => any;
+ onmspointerdown: (this: this, ev: MSPointerEvent) => any;
+ onmspointerenter: (this: this, ev: MSPointerEvent) => any;
+ onmspointerleave: (this: this, ev: MSPointerEvent) => any;
+ onmspointermove: (this: this, ev: MSPointerEvent) => any;
+ onmspointerout: (this: this, ev: MSPointerEvent) => any;
+ onmspointerover: (this: this, ev: MSPointerEvent) => any;
+ onmspointerup: (this: this, ev: MSPointerEvent) => any;
+ /**
+ * Occurs when an item is removed from a Jump List of a webpage running in Site Mode.
+ * @param ev The event.
+ */
+ onmssitemodejumplistitemremoved: (this: this, ev: MSSiteModeEvent) => any;
+ /**
+ * Occurs when a user clicks a button in a Thumbnail Toolbar of a webpage running in Site Mode.
+ * @param ev The event.
+ */
+ onmsthumbnailclick: (this: this, ev: MSSiteModeEvent) => any;
+ /**
+ * Occurs when playback is paused.
+ * @param ev The event.
+ */
+ onpause: (this: this, ev: Event) => any;
+ /**
+ * Occurs when the play method is requested.
+ * @param ev The event.
+ */
+ onplay: (this: this, ev: Event) => any;
+ /**
+ * Occurs when the audio or video has started playing.
+ * @param ev The event.
+ */
+ onplaying: (this: this, ev: Event) => any;
+ onpointerlockchange: (this: this, ev: Event) => any;
+ onpointerlockerror: (this: this, ev: Event) => any;
+ /**
+ * Occurs to indicate progress while downloading media data.
+ * @param ev The event.
+ */
+ onprogress: (this: this, ev: ProgressEvent) => any;
+ /**
+ * Occurs when the playback rate is increased or decreased.
+ * @param ev The event.
+ */
+ onratechange: (this: this, ev: Event) => any;
+ /**
+ * Fires when the state of the object has changed.
+ * @param ev The event
+ */
+ onreadystatechange: (this: this, ev: ProgressEvent) => any;
+ /**
+ * Fires when the user resets a form.
+ * @param ev The event.
+ */
+ onreset: (this: this, ev: Event) => any;
+ /**
+ * Fires when the user repositions the scroll box in the scroll bar on the object.
+ * @param ev The event.
+ */
+ onscroll: (this: this, ev: UIEvent) => any;
+ /**
+ * Occurs when the seek operation ends.
+ * @param ev The event.
+ */
+ onseeked: (this: this, ev: Event) => any;
+ /**
+ * Occurs when the current playback position is moved.
+ * @param ev The event.
+ */
+ onseeking: (this: this, ev: Event) => any;
+ /**
+ * Fires when the current selection changes.
+ * @param ev The event.
+ */
+ onselect: (this: this, ev: UIEvent) => any;
+ /**
+ * Fires when the selection state of a document changes.
+ * @param ev The event.
+ */
+ onselectionchange: (this: this, ev: Event) => any;
+ onselectstart: (this: this, ev: Event) => any;
+ /**
+ * Occurs when the download has stopped.
+ * @param ev The event.
+ */
+ onstalled: (this: this, ev: Event) => any;
+ /**
+ * Fires when the user clicks the Stop button or leaves the Web page.
+ * @param ev The event.
+ */
+ onstop: (this: this, ev: Event) => any;
+ onsubmit: (this: this, ev: Event) => any;
+ /**
+ * Occurs if the load operation has been intentionally halted.
+ * @param ev The event.
+ */
+ onsuspend: (this: this, ev: Event) => any;
+ /**
+ * Occurs to indicate the current playback position.
+ * @param ev The event.
+ */
+ ontimeupdate: (this: this, ev: Event) => any;
+ ontouchcancel: (ev: TouchEvent) => any;
+ ontouchend: (ev: TouchEvent) => any;
+ ontouchmove: (ev: TouchEvent) => any;
+ ontouchstart: (ev: TouchEvent) => any;
+ /**
+ * Occurs when the volume is changed, or playback is muted or unmuted.
+ * @param ev The event.
+ */
+ onvolumechange: (this: this, ev: Event) => any;
+ /**
+ * Occurs when playback stops because the next frame of a video resource is not available.
+ * @param ev The event.
+ */
+ onwaiting: (this: this, ev: Event) => any;
+ onwebkitfullscreenchange: (this: this, ev: Event) => any;
+ onwebkitfullscreenerror: (this: this, ev: Event) => any;
+ plugins: HTMLCollectionOf<HTMLEmbedElement>;
+ readonly pointerLockElement: Element;
+ /**
+ * Retrieves a value that indicates the current state of the object.
+ */
+ readonly readyState: string;
+ /**
+ * Gets the URL of the location that referred the user to the current page.
+ */
+ readonly referrer: string;
+ /**
+ * Gets the root svg element in the document hierarchy.
+ */
+ readonly rootElement: SVGSVGElement;
+ /**
+ * Retrieves a collection of all script objects in the document.
+ */
+ scripts: HTMLCollectionOf<HTMLScriptElement>;
+ readonly scrollingElement: Element | null;
+ /**
+ * Retrieves a collection of styleSheet objects representing the style sheets that correspond to each instance of a link or style object in the document.
+ */
+ readonly styleSheets: StyleSheetList;
+ /**
+ * Contains the title of the document.
+ */
+ title: string;
+ readonly visibilityState: string;
+ /**
+ * Sets or gets the color of the links that the user has visited.
+ */
+ vlinkColor: string;
+ readonly webkitCurrentFullScreenElement: Element | null;
+ readonly webkitFullscreenElement: Element | null;
+ readonly webkitFullscreenEnabled: boolean;
+ readonly webkitIsFullScreen: boolean;
+ readonly xmlEncoding: string | null;
+ xmlStandalone: boolean;
+ /**
+ * Gets or sets the version attribute specified in the declaration of an XML document.
+ */
+ xmlVersion: string | null;
+ adoptNode(source: Node): Node;
+ captureEvents(): void;
+ caretRangeFromPoint(x: number, y: number): Range;
+ clear(): void;
+ /**
+ * Closes an output stream and forces the sent data to display.
+ */
+ close(): void;
+ /**
+ * Creates an attribute object with a specified name.
+ * @param name String that sets the attribute object's name.
+ */
+ createAttribute(name: string): Attr;
+ createAttributeNS(namespaceURI: string | null, qualifiedName: string): Attr;
+ createCDATASection(data: string): CDATASection;
+ /**
+ * Creates a comment object with the specified data.
+ * @param data Sets the comment object's data.
+ */
+ createComment(data: string): Comment;
+ /**
+ * Creates a new document.
+ */
+ createDocumentFragment(): DocumentFragment;
+ /**
+ * Creates an instance of the element for the specified tag.
+ * @param tagName The name of an element.
+ */
+ createElement(tagName: "a"): HTMLAnchorElement;
+ createElement(tagName: "applet"): HTMLAppletElement;
+ createElement(tagName: "area"): HTMLAreaElement;
+ createElement(tagName: "audio"): HTMLAudioElement;
+ createElement(tagName: "base"): HTMLBaseElement;
+ createElement(tagName: "basefont"): HTMLBaseFontElement;
+ createElement(tagName: "blockquote"): HTMLQuoteElement;
+ createElement(tagName: "body"): HTMLBodyElement;
+ createElement(tagName: "br"): HTMLBRElement;
+ createElement(tagName: "button"): HTMLButtonElement;
+ createElement(tagName: "canvas"): HTMLCanvasElement;
+ createElement(tagName: "caption"): HTMLTableCaptionElement;
+ createElement(tagName: "col"): HTMLTableColElement;
+ createElement(tagName: "colgroup"): HTMLTableColElement;
+ createElement(tagName: "datalist"): HTMLDataListElement;
+ createElement(tagName: "del"): HTMLModElement;
+ createElement(tagName: "dir"): HTMLDirectoryElement;
+ createElement(tagName: "div"): HTMLDivElement;
+ createElement(tagName: "dl"): HTMLDListElement;
+ createElement(tagName: "embed"): HTMLEmbedElement;
+ createElement(tagName: "fieldset"): HTMLFieldSetElement;
+ createElement(tagName: "font"): HTMLFontElement;
+ createElement(tagName: "form"): HTMLFormElement;
+ createElement(tagName: "frame"): HTMLFrameElement;
+ createElement(tagName: "frameset"): HTMLFrameSetElement;
+ createElement(tagName: "h1"): HTMLHeadingElement;
+ createElement(tagName: "h2"): HTMLHeadingElement;
+ createElement(tagName: "h3"): HTMLHeadingElement;
+ createElement(tagName: "h4"): HTMLHeadingElement;
+ createElement(tagName: "h5"): HTMLHeadingElement;
+ createElement(tagName: "h6"): HTMLHeadingElement;
+ createElement(tagName: "head"): HTMLHeadElement;
+ createElement(tagName: "hr"): HTMLHRElement;
+ createElement(tagName: "html"): HTMLHtmlElement;
+ createElement(tagName: "iframe"): HTMLIFrameElement;
+ createElement(tagName: "img"): HTMLImageElement;
+ createElement(tagName: "input"): HTMLInputElement;
+ createElement(tagName: "ins"): HTMLModElement;
+ createElement(tagName: "isindex"): HTMLUnknownElement;
+ createElement(tagName: "label"): HTMLLabelElement;
+ createElement(tagName: "legend"): HTMLLegendElement;
+ createElement(tagName: "li"): HTMLLIElement;
+ createElement(tagName: "link"): HTMLLinkElement;
+ createElement(tagName: "listing"): HTMLPreElement;
+ createElement(tagName: "map"): HTMLMapElement;
+ createElement(tagName: "marquee"): HTMLMarqueeElement;
+ createElement(tagName: "menu"): HTMLMenuElement;
+ createElement(tagName: "meta"): HTMLMetaElement;
+ createElement(tagName: "meter"): HTMLMeterElement;
+ createElement(tagName: "nextid"): HTMLUnknownElement;
+ createElement(tagName: "object"): HTMLObjectElement;
+ createElement(tagName: "ol"): HTMLOListElement;
+ createElement(tagName: "optgroup"): HTMLOptGroupElement;
+ createElement(tagName: "option"): HTMLOptionElement;
+ createElement(tagName: "p"): HTMLParagraphElement;
+ createElement(tagName: "param"): HTMLParamElement;
+ createElement(tagName: "picture"): HTMLPictureElement;
+ createElement(tagName: "pre"): HTMLPreElement;
+ createElement(tagName: "progress"): HTMLProgressElement;
+ createElement(tagName: "q"): HTMLQuoteElement;
+ createElement(tagName: "script"): HTMLScriptElement;
+ createElement(tagName: "select"): HTMLSelectElement;
+ createElement(tagName: "source"): HTMLSourceElement;
+ createElement(tagName: "span"): HTMLSpanElement;
+ createElement(tagName: "style"): HTMLStyleElement;
+ createElement(tagName: "table"): HTMLTableElement;
+ createElement(tagName: "tbody"): HTMLTableSectionElement;
+ createElement(tagName: "td"): HTMLTableDataCellElement;
+ createElement(tagName: "template"): HTMLTemplateElement;
+ createElement(tagName: "textarea"): HTMLTextAreaElement;
+ createElement(tagName: "tfoot"): HTMLTableSectionElement;
+ createElement(tagName: "th"): HTMLTableHeaderCellElement;
+ createElement(tagName: "thead"): HTMLTableSectionElement;
+ createElement(tagName: "title"): HTMLTitleElement;
+ createElement(tagName: "tr"): HTMLTableRowElement;
+ createElement(tagName: "track"): HTMLTrackElement;
+ createElement(tagName: "ul"): HTMLUListElement;
+ createElement(tagName: "video"): HTMLVideoElement;
+ createElement(tagName: "x-ms-webview"): MSHTMLWebViewElement;
+ createElement(tagName: "xmp"): HTMLPreElement;
+ createElement(tagName: string): HTMLElement;
+ createElementNS(namespaceURI: "http://www.w3.org/1999/xhtml", qualifiedName: string): HTMLElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "a"): SVGAElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "circle"): SVGCircleElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "clipPath"): SVGClipPathElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "componentTransferFunction"): SVGComponentTransferFunctionElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "defs"): SVGDefsElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "desc"): SVGDescElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "ellipse"): SVGEllipseElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feBlend"): SVGFEBlendElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feColorMatrix"): SVGFEColorMatrixElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feComponentTransfer"): SVGFEComponentTransferElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feComposite"): SVGFECompositeElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feConvolveMatrix"): SVGFEConvolveMatrixElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feDiffuseLighting"): SVGFEDiffuseLightingElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feDisplacementMap"): SVGFEDisplacementMapElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feDistantLight"): SVGFEDistantLightElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feFlood"): SVGFEFloodElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feFuncA"): SVGFEFuncAElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feFuncB"): SVGFEFuncBElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feFuncG"): SVGFEFuncGElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feFuncR"): SVGFEFuncRElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feGaussianBlur"): SVGFEGaussianBlurElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feImage"): SVGFEImageElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feMerge"): SVGFEMergeElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feMergeNode"): SVGFEMergeNodeElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feMorphology"): SVGFEMorphologyElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feOffset"): SVGFEOffsetElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "fePointLight"): SVGFEPointLightElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feSpecularLighting"): SVGFESpecularLightingElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feSpotLight"): SVGFESpotLightElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feTile"): SVGFETileElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feTurbulence"): SVGFETurbulenceElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "filter"): SVGFilterElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "foreignObject"): SVGForeignObjectElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "g"): SVGGElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "image"): SVGImageElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "gradient"): SVGGradientElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "line"): SVGLineElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "linearGradient"): SVGLinearGradientElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "marker"): SVGMarkerElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "mask"): SVGMaskElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "path"): SVGPathElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "metadata"): SVGMetadataElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "pattern"): SVGPatternElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "polygon"): SVGPolygonElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "polyline"): SVGPolylineElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "radialGradient"): SVGRadialGradientElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "rect"): SVGRectElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "svg"): SVGSVGElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "script"): SVGScriptElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "stop"): SVGStopElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "style"): SVGStyleElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "switch"): SVGSwitchElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "symbol"): SVGSymbolElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "tspan"): SVGTSpanElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "textContent"): SVGTextContentElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "text"): SVGTextElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "textPath"): SVGTextPathElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "textPositioning"): SVGTextPositioningElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "title"): SVGTitleElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "use"): SVGUseElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "view"): SVGViewElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: string): SVGElement
+ createElementNS(namespaceURI: string | null, qualifiedName: string): Element;
+ createExpression(expression: string, resolver: XPathNSResolver): XPathExpression;
+ createNSResolver(nodeResolver: Node): XPathNSResolver;
+ /**
+ * Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document.
+ * @param root The root element or node to start traversing on.
+ * @param whatToShow The type of nodes or elements to appear in the node list
+ * @param filter A custom NodeFilter function to use. For more information, see filter. Use null for no filter.
+ * @param entityReferenceExpansion A flag that specifies whether entity reference nodes are expanded.
+ */
+ createNodeIterator(root: Node, whatToShow?: number, filter?: NodeFilter, entityReferenceExpansion?: boolean): NodeIterator;
+ createProcessingInstruction(target: string, data: string): ProcessingInstruction;
+ /**
+ * Returns an empty range object that has both of its boundary points positioned at the beginning of the document.
+ */
+ createRange(): Range;
+ /**
+ * Creates a text string from the specified value.
+ * @param data String that specifies the nodeValue property of the text node.
+ */
+ createTextNode(data: string): Text;
+ createTouch(view: Window, target: EventTarget, identifier: number, pageX: number, pageY: number, screenX: number, screenY: number): Touch;
+ createTouchList(...touches: Touch[]): TouchList;
+ /**
+ * Creates a TreeWalker object that you can use to traverse filtered lists of nodes or elements in a document.
+ * @param root The root element or node to start traversing on.
+ * @param whatToShow The type of nodes or elements to appear in the node list. For more information, see whatToShow.
+ * @param filter A custom NodeFilter function to use.
+ * @param entityReferenceExpansion A flag that specifies whether entity reference nodes are expanded.
+ */
+ createTreeWalker(root: Node, whatToShow?: number, filter?: NodeFilter, entityReferenceExpansion?: boolean): TreeWalker;
+ /**
+ * Returns the element for the specified x coordinate and the specified y coordinate.
+ * @param x The x-offset
+ * @param y The y-offset
+ */
+ elementFromPoint(x: number, y: number): Element;
+ evaluate(expression: string, contextNode: Node, resolver: XPathNSResolver, type: number, result: XPathResult): XPathResult;
+ /**
+ * Executes a command on the current document, current selection, or the given range.
+ * @param commandId String that specifies the command to execute. This command can be any of the command identifiers that can be executed in script.
+ * @param showUI Display the user interface, defaults to false.
+ * @param value Value to assign.
+ */
+ execCommand(commandId: string, showUI?: boolean, value?: any): boolean;
+ /**
+ * Displays help information for the given command identifier.
+ * @param commandId Displays help information for the given command identifier.
+ */
+ execCommandShowHelp(commandId: string): boolean;
+ exitFullscreen(): void;
+ exitPointerLock(): void;
+ /**
+ * Causes the element to receive the focus and executes the code specified by the onfocus event.
+ */
+ focus(): void;
+ /**
+ * Returns a reference to the first object with the specified value of the ID or NAME attribute.
+ * @param elementId String that specifies the ID value. Case-insensitive.
+ */
+ getElementById(elementId: string): HTMLElement | null;
+ getElementsByClassName(classNames: string): HTMLCollectionOf<Element>;
+ /**
+ * Gets a collection of objects based on the value of the NAME or ID attribute.
+ * @param elementName Gets a collection of objects based on the value of the NAME or ID attribute.
+ */
+ getElementsByName(elementName: string): NodeListOf<HTMLElement>;
+ /**
+ * Retrieves a collection of objects based on the specified element name.
+ * @param name Specifies the name of an element.
+ */
+ getElementsByTagName(tagname: "a"): NodeListOf<HTMLAnchorElement>;
+ getElementsByTagName(tagname: "abbr"): NodeListOf<HTMLElement>;
+ getElementsByTagName(tagname: "acronym"): NodeListOf<HTMLElement>;
+ getElementsByTagName(tagname: "address"): NodeListOf<HTMLElement>;
+ getElementsByTagName(tagname: "applet"): NodeListOf<HTMLAppletElement>;
+ getElementsByTagName(tagname: "area"): NodeListOf<HTMLAreaElement>;
+ getElementsByTagName(tagname: "article"): NodeListOf<HTMLElement>;
+ getElementsByTagName(tagname: "aside"): NodeListOf<HTMLElement>;
+ getElementsByTagName(tagname: "audio"): NodeListOf<HTMLAudioElement>;
+ getElementsByTagName(tagname: "b"): NodeListOf<HTMLElement>;
+ getElementsByTagName(tagname: "base"): NodeListOf<HTMLBaseElement>;
+ getElementsByTagName(tagname: "basefont"): NodeListOf<HTMLBaseFontElement>;
+ getElementsByTagName(tagname: "bdo"): NodeListOf<HTMLElement>;
+ getElementsByTagName(tagname: "big"): NodeListOf<HTMLElement>;
+ getElementsByTagName(tagname: "blockquote"): NodeListOf<HTMLQuoteElement>;
+ getElementsByTagName(tagname: "body"): NodeListOf<HTMLBodyElement>;
+ getElementsByTagName(tagname: "br"): NodeListOf<HTMLBRElement>;
+ getElementsByTagName(tagname: "button"): NodeListOf<HTMLButtonElement>;
+ getElementsByTagName(tagname: "canvas"): NodeListOf<HTMLCanvasElement>;
+ getElementsByTagName(tagname: "caption"): NodeListOf<HTMLTableCaptionElement>;
+ getElementsByTagName(tagname: "center"): NodeListOf<HTMLElement>;
+ getElementsByTagName(tagname: "circle"): NodeListOf<SVGCircleElement>;
+ getElementsByTagName(tagname: "cite"): NodeListOf<HTMLElement>;
+ getElementsByTagName(tagname: "clippath"): NodeListOf<SVGClipPathElement>;
+ getElementsByTagName(tagname: "code"): NodeListOf<HTMLElement>;
+ getElementsByTagName(tagname: "col"): NodeListOf<HTMLTableColElement>;
+ getElementsByTagName(tagname: "colgroup"): NodeListOf<HTMLTableColElement>;
+ getElementsByTagName(tagname: "datalist"): NodeListOf<HTMLDataListElement>;
+ getElementsByTagName(tagname: "dd"): NodeListOf<HTMLElement>;
+ getElementsByTagName(tagname: "defs"): NodeListOf<SVGDefsElement>;
+ getElementsByTagName(tagname: "del"): NodeListOf<HTMLModElement>;
+ getElementsByTagName(tagname: "desc"): NodeListOf<SVGDescElement>;
+ getElementsByTagName(tagname: "dfn"): NodeListOf<HTMLElement>;
+ getElementsByTagName(tagname: "dir"): NodeListOf<HTMLDirectoryElement>;
+ getElementsByTagName(tagname: "div"): NodeListOf<HTMLDivElement>;
+ getElementsByTagName(tagname: "dl"): NodeListOf<HTMLDListElement>;
+ getElementsByTagName(tagname: "dt"): NodeListOf<HTMLElement>;
+ getElementsByTagName(tagname: "ellipse"): NodeListOf<SVGEllipseElement>;
+ getElementsByTagName(tagname: "em"): NodeListOf<HTMLElement>;
+ getElementsByTagName(tagname: "embed"): NodeListOf<HTMLEmbedElement>;
+ getElementsByTagName(tagname: "feblend"): NodeListOf<SVGFEBlendElement>;
+ getElementsByTagName(tagname: "fecolormatrix"): NodeListOf<SVGFEColorMatrixElement>;
+ getElementsByTagName(tagname: "fecomponenttransfer"): NodeListOf<SVGFEComponentTransferElement>;
+ getElementsByTagName(tagname: "fecomposite"): NodeListOf<SVGFECompositeElement>;
+ getElementsByTagName(tagname: "feconvolvematrix"): NodeListOf<SVGFEConvolveMatrixElement>;
+ getElementsByTagName(tagname: "fediffuselighting"): NodeListOf<SVGFEDiffuseLightingElement>;
+ getElementsByTagName(tagname: "fedisplacementmap"): NodeListOf<SVGFEDisplacementMapElement>;
+ getElementsByTagName(tagname: "fedistantlight"): NodeListOf<SVGFEDistantLightElement>;
+ getElementsByTagName(tagname: "feflood"): NodeListOf<SVGFEFloodElement>;
+ getElementsByTagName(tagname: "fefunca"): NodeListOf<SVGFEFuncAElement>;
+ getElementsByTagName(tagname: "fefuncb"): NodeListOf<SVGFEFuncBElement>;
+ getElementsByTagName(tagname: "fefuncg"): NodeListOf<SVGFEFuncGElement>;
+ getElementsByTagName(tagname: "fefuncr"): NodeListOf<SVGFEFuncRElement>;
+ getElementsByTagName(tagname: "fegaussianblur"): NodeListOf<SVGFEGaussianBlurElement>;
+ getElementsByTagName(tagname: "feimage"): NodeListOf<SVGFEImageElement>;
+ getElementsByTagName(tagname: "femerge"): NodeListOf<SVGFEMergeElement>;
+ getElementsByTagName(tagname: "femergenode"): NodeListOf<SVGFEMergeNodeElement>;
+ getElementsByTagName(tagname: "femorphology"): NodeListOf<SVGFEMorphologyElement>;
+ getElementsByTagName(tagname: "feoffset"): NodeListOf<SVGFEOffsetElement>;
+ getElementsByTagName(tagname: "fepointlight"): NodeListOf<SVGFEPointLightElement>;
+ getElementsByTagName(tagname: "fespecularlighting"): NodeListOf<SVGFESpecularLightingElement>;
+ getElementsByTagName(tagname: "fespotlight"): NodeListOf<SVGFESpotLightElement>;
+ getElementsByTagName(tagname: "fetile"): NodeListOf<SVGFETileElement>;
+ getElementsByTagName(tagname: "feturbulence"): NodeListOf<SVGFETurbulenceElement>;
+ getElementsByTagName(tagname: "fieldset"): NodeListOf<HTMLFieldSetElement>;
+ getElementsByTagName(tagname: "figcaption"): NodeListOf<HTMLElement>;
+ getElementsByTagName(tagname: "figure"): NodeListOf<HTMLElement>;
+ getElementsByTagName(tagname: "filter"): NodeListOf<SVGFilterElement>;
+ getElementsByTagName(tagname: "font"): NodeListOf<HTMLFontElement>;
+ getElementsByTagName(tagname: "footer"): NodeListOf<HTMLElement>;
+ getElementsByTagName(tagname: "foreignobject"): NodeListOf<SVGForeignObjectElement>;
+ getElementsByTagName(tagname: "form"): NodeListOf<HTMLFormElement>;
+ getElementsByTagName(tagname: "frame"): NodeListOf<HTMLFrameElement>;
+ getElementsByTagName(tagname: "frameset"): NodeListOf<HTMLFrameSetElement>;
+ getElementsByTagName(tagname: "g"): NodeListOf<SVGGElement>;
+ getElementsByTagName(tagname: "h1"): NodeListOf<HTMLHeadingElement>;
+ getElementsByTagName(tagname: "h2"): NodeListOf<HTMLHeadingElement>;
+ getElementsByTagName(tagname: "h3"): NodeListOf<HTMLHeadingElement>;
+ getElementsByTagName(tagname: "h4"): NodeListOf<HTMLHeadingElement>;
+ getElementsByTagName(tagname: "h5"): NodeListOf<HTMLHeadingElement>;
+ getElementsByTagName(tagname: "h6"): NodeListOf<HTMLHeadingElement>;
+ getElementsByTagName(tagname: "head"): NodeListOf<HTMLHeadElement>;
+ getElementsByTagName(tagname: "header"): NodeListOf<HTMLElement>;
+ getElementsByTagName(tagname: "hgroup"): NodeListOf<HTMLElement>;
+ getElementsByTagName(tagname: "hr"): NodeListOf<HTMLHRElement>;
+ getElementsByTagName(tagname: "html"): NodeListOf<HTMLHtmlElement>;
+ getElementsByTagName(tagname: "i"): NodeListOf<HTMLElement>;
+ getElementsByTagName(tagname: "iframe"): NodeListOf<HTMLIFrameElement>;
+ getElementsByTagName(tagname: "image"): NodeListOf<SVGImageElement>;
+ getElementsByTagName(tagname: "img"): NodeListOf<HTMLImageElement>;
+ getElementsByTagName(tagname: "input"): NodeListOf<HTMLInputElement>;
+ getElementsByTagName(tagname: "ins"): NodeListOf<HTMLModElement>;
+ getElementsByTagName(tagname: "isindex"): NodeListOf<HTMLUnknownElement>;
+ getElementsByTagName(tagname: "kbd"): NodeListOf<HTMLElement>;
+ getElementsByTagName(tagname: "keygen"): NodeListOf<HTMLElement>;
+ getElementsByTagName(tagname: "label"): NodeListOf<HTMLLabelElement>;
+ getElementsByTagName(tagname: "legend"): NodeListOf<HTMLLegendElement>;
+ getElementsByTagName(tagname: "li"): NodeListOf<HTMLLIElement>;
+ getElementsByTagName(tagname: "line"): NodeListOf<SVGLineElement>;
+ getElementsByTagName(tagname: "lineargradient"): NodeListOf<SVGLinearGradientElement>;
+ getElementsByTagName(tagname: "link"): NodeListOf<HTMLLinkElement>;
+ getElementsByTagName(tagname: "listing"): NodeListOf<HTMLPreElement>;
+ getElementsByTagName(tagname: "map"): NodeListOf<HTMLMapElement>;
+ getElementsByTagName(tagname: "mark"): NodeListOf<HTMLElement>;
+ getElementsByTagName(tagname: "marker"): NodeListOf<SVGMarkerElement>;
+ getElementsByTagName(tagname: "marquee"): NodeListOf<HTMLMarqueeElement>;
+ getElementsByTagName(tagname: "mask"): NodeListOf<SVGMaskElement>;
+ getElementsByTagName(tagname: "menu"): NodeListOf<HTMLMenuElement>;
+ getElementsByTagName(tagname: "meta"): NodeListOf<HTMLMetaElement>;
+ getElementsByTagName(tagname: "metadata"): NodeListOf<SVGMetadataElement>;
+ getElementsByTagName(tagname: "meter"): NodeListOf<HTMLMeterElement>;
+ getElementsByTagName(tagname: "nav"): NodeListOf<HTMLElement>;
+ getElementsByTagName(tagname: "nextid"): NodeListOf<HTMLUnknownElement>;
+ getElementsByTagName(tagname: "nobr"): NodeListOf<HTMLElement>;
+ getElementsByTagName(tagname: "noframes"): NodeListOf<HTMLElement>;
+ getElementsByTagName(tagname: "noscript"): NodeListOf<HTMLElement>;
+ getElementsByTagName(tagname: "object"): NodeListOf<HTMLObjectElement>;
+ getElementsByTagName(tagname: "ol"): NodeListOf<HTMLOListElement>;
+ getElementsByTagName(tagname: "optgroup"): NodeListOf<HTMLOptGroupElement>;
+ getElementsByTagName(tagname: "option"): NodeListOf<HTMLOptionElement>;
+ getElementsByTagName(tagname: "p"): NodeListOf<HTMLParagraphElement>;
+ getElementsByTagName(tagname: "param"): NodeListOf<HTMLParamElement>;
+ getElementsByTagName(tagname: "path"): NodeListOf<SVGPathElement>;
+ getElementsByTagName(tagname: "pattern"): NodeListOf<SVGPatternElement>;
+ getElementsByTagName(tagname: "picture"): NodeListOf<HTMLPictureElement>;
+ getElementsByTagName(tagname: "plaintext"): NodeListOf<HTMLElement>;
+ getElementsByTagName(tagname: "polygon"): NodeListOf<SVGPolygonElement>;
+ getElementsByTagName(tagname: "polyline"): NodeListOf<SVGPolylineElement>;
+ getElementsByTagName(tagname: "pre"): NodeListOf<HTMLPreElement>;
+ getElementsByTagName(tagname: "progress"): NodeListOf<HTMLProgressElement>;
+ getElementsByTagName(tagname: "q"): NodeListOf<HTMLQuoteElement>;
+ getElementsByTagName(tagname: "radialgradient"): NodeListOf<SVGRadialGradientElement>;
+ getElementsByTagName(tagname: "rect"): NodeListOf<SVGRectElement>;
+ getElementsByTagName(tagname: "rt"): NodeListOf<HTMLElement>;
+ getElementsByTagName(tagname: "ruby"): NodeListOf<HTMLElement>;
+ getElementsByTagName(tagname: "s"): NodeListOf<HTMLElement>;
+ getElementsByTagName(tagname: "samp"): NodeListOf<HTMLElement>;
+ getElementsByTagName(tagname: "script"): NodeListOf<HTMLScriptElement>;
+ getElementsByTagName(tagname: "section"): NodeListOf<HTMLElement>;
+ getElementsByTagName(tagname: "select"): NodeListOf<HTMLSelectElement>;
+ getElementsByTagName(tagname: "small"): NodeListOf<HTMLElement>;
+ getElementsByTagName(tagname: "source"): NodeListOf<HTMLSourceElement>;
+ getElementsByTagName(tagname: "span"): NodeListOf<HTMLSpanElement>;
+ getElementsByTagName(tagname: "stop"): NodeListOf<SVGStopElement>;
+ getElementsByTagName(tagname: "strike"): NodeListOf<HTMLElement>;
+ getElementsByTagName(tagname: "strong"): NodeListOf<HTMLElement>;
+ getElementsByTagName(tagname: "style"): NodeListOf<HTMLStyleElement>;
+ getElementsByTagName(tagname: "sub"): NodeListOf<HTMLElement>;
+ getElementsByTagName(tagname: "sup"): NodeListOf<HTMLElement>;
+ getElementsByTagName(tagname: "svg"): NodeListOf<SVGSVGElement>;
+ getElementsByTagName(tagname: "switch"): NodeListOf<SVGSwitchElement>;
+ getElementsByTagName(tagname: "symbol"): NodeListOf<SVGSymbolElement>;
+ getElementsByTagName(tagname: "table"): NodeListOf<HTMLTableElement>;
+ getElementsByTagName(tagname: "tbody"): NodeListOf<HTMLTableSectionElement>;
+ getElementsByTagName(tagname: "td"): NodeListOf<HTMLTableDataCellElement>;
+ getElementsByTagName(tagname: "template"): NodeListOf<HTMLTemplateElement>;
+ getElementsByTagName(tagname: "text"): NodeListOf<SVGTextElement>;
+ getElementsByTagName(tagname: "textpath"): NodeListOf<SVGTextPathElement>;
+ getElementsByTagName(tagname: "textarea"): NodeListOf<HTMLTextAreaElement>;
+ getElementsByTagName(tagname: "tfoot"): NodeListOf<HTMLTableSectionElement>;
+ getElementsByTagName(tagname: "th"): NodeListOf<HTMLTableHeaderCellElement>;
+ getElementsByTagName(tagname: "thead"): NodeListOf<HTMLTableSectionElement>;
+ getElementsByTagName(tagname: "title"): NodeListOf<HTMLTitleElement>;
+ getElementsByTagName(tagname: "tr"): NodeListOf<HTMLTableRowElement>;
+ getElementsByTagName(tagname: "track"): NodeListOf<HTMLTrackElement>;
+ getElementsByTagName(tagname: "tspan"): NodeListOf<SVGTSpanElement>;
+ getElementsByTagName(tagname: "tt"): NodeListOf<HTMLElement>;
+ getElementsByTagName(tagname: "u"): NodeListOf<HTMLElement>;
+ getElementsByTagName(tagname: "ul"): NodeListOf<HTMLUListElement>;
+ getElementsByTagName(tagname: "use"): NodeListOf<SVGUseElement>;
+ getElementsByTagName(tagname: "var"): NodeListOf<HTMLElement>;
+ getElementsByTagName(tagname: "video"): NodeListOf<HTMLVideoElement>;
+ getElementsByTagName(tagname: "view"): NodeListOf<SVGViewElement>;
+ getElementsByTagName(tagname: "wbr"): NodeListOf<HTMLElement>;
+ getElementsByTagName(tagname: "x-ms-webview"): NodeListOf<MSHTMLWebViewElement>;
+ getElementsByTagName(tagname: "xmp"): NodeListOf<HTMLPreElement>;
+ getElementsByTagName(tagname: string): NodeListOf<Element>;
+ getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1999/xhtml", localName: string): HTMLCollectionOf<HTMLElement>;
+ getElementsByTagNameNS(namespaceURI: "http://www.w3.org/2000/svg", localName: string): HTMLCollectionOf<SVGElement>;
+ getElementsByTagNameNS(namespaceURI: string, localName: string): HTMLCollectionOf<Element>;
+ /**
+ * Returns an object representing the current selection of the document that is loaded into the object displaying a webpage.
+ */
+ getSelection(): Selection;
+ /**
+ * Gets a value indicating whether the object currently has focus.
+ */
+ hasFocus(): boolean;
+ importNode(importedNode: Node, deep: boolean): Node;
+ msElementsFromPoint(x: number, y: number): NodeListOf<Element>;
+ msElementsFromRect(left: number, top: number, width: number, height: number): NodeListOf<Element>;
+ /**
+ * Opens a new window and loads a document specified by a given URL. Also, opens a new window that uses the url parameter and the name parameter to collect the output of the write method and the writeln method.
+ * @param url Specifies a MIME type for the document.
+ * @param name Specifies the name of the window. This name is used as the value for the TARGET attribute on a form or an anchor element.
+ * @param features Contains a list of items separated by commas. Each item consists of an option and a value, separated by an equals sign (for example, "fullscreen=yes, toolbar=yes"). The following values are supported.
+ * @param replace Specifies whether the existing entry for the document is replaced in the history list.
+ */
+ open(url?: string, name?: string, features?: string, replace?: boolean): Document;
+ /**
+ * Returns a Boolean value that indicates whether a specified command can be successfully executed using execCommand, given the current state of the document.
+ * @param commandId Specifies a command identifier.
+ */
+ queryCommandEnabled(commandId: string): boolean;
+ /**
+ * Returns a Boolean value that indicates whether the specified command is in the indeterminate state.
+ * @param commandId String that specifies a command identifier.
+ */
+ queryCommandIndeterm(commandId: string): boolean;
+ /**
+ * Returns a Boolean value that indicates the current state of the command.
+ * @param commandId String that specifies a command identifier.
+ */
+ queryCommandState(commandId: string): boolean;
+ /**
+ * Returns a Boolean value that indicates whether the current command is supported on the current range.
+ * @param commandId Specifies a command identifier.
+ */
+ queryCommandSupported(commandId: string): boolean;
+ /**
+ * Retrieves the string associated with a command.
+ * @param commandId String that contains the identifier of a command. This can be any command identifier given in the list of Command Identifiers.
+ */
+ queryCommandText(commandId: string): string;
+ /**
+ * Returns the current value of the document, range, or current selection for the given command.
+ * @param commandId String that specifies a command identifier.
+ */
+ queryCommandValue(commandId: string): string;
+ releaseEvents(): void;
+ /**
+ * Allows updating the print settings for the page.
+ */
+ updateSettings(): void;
+ webkitCancelFullScreen(): void;
+ webkitExitFullscreen(): void;
+ /**
+ * Writes one or more HTML expressions to a document in the specified window.
+ * @param content Specifies the text and HTML tags to write.
+ */
+ write(...content: string[]): void;
+ /**
+ * Writes one or more HTML expressions, followed by a carriage return, to a document in the specified window.
+ * @param content The text and HTML tags to write.
+ */
+ writeln(...content: string[]): void;
+ addEventListener(type: "MSContentZoom", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureChange", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureDoubleTap", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureEnd", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureHold", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureStart", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureTap", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSInertiaStart", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSManipulationStateChanged", listener: (this: this, ev: MSManipulationEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerCancel", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerDown", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerEnter", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerLeave", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerMove", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerOut", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerOver", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerUp", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "abort", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "activate", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "beforeactivate", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "beforedeactivate", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "blur", listener: (this: this, ev: FocusEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "canplay", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "canplaythrough", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "change", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "click", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "contextmenu", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dblclick", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "deactivate", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "drag", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dragend", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dragenter", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dragleave", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dragover", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dragstart", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "drop", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "durationchange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "emptied", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "ended", listener: (this: this, ev: MediaStreamErrorEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "error", listener: (this: this, ev: ErrorEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "focus", listener: (this: this, ev: FocusEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "fullscreenchange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "fullscreenerror", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "input", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "invalid", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "keydown", listener: (this: this, ev: KeyboardEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "keypress", listener: (this: this, ev: KeyboardEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "keyup", listener: (this: this, ev: KeyboardEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "load", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "loadeddata", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "loadedmetadata", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "loadstart", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "mousedown", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mousemove", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mouseout", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mouseover", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mouseup", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mousewheel", listener: (this: this, ev: WheelEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mssitemodejumplistitemremoved", listener: (this: this, ev: MSSiteModeEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "msthumbnailclick", listener: (this: this, ev: MSSiteModeEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pause", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "play", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "playing", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointercancel", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerdown", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerenter", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerleave", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerlockchange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerlockerror", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointermove", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerout", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerover", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerup", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "progress", listener: (this: this, ev: ProgressEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "ratechange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "readystatechange", listener: (this: this, ev: ProgressEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "reset", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "scroll", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "seeked", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "seeking", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "select", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "selectionchange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "selectstart", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "stalled", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "stop", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "submit", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "suspend", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "timeupdate", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "touchcancel", listener: (this: this, ev: TouchEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "touchend", listener: (this: this, ev: TouchEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "touchmove", listener: (this: this, ev: TouchEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "touchstart", listener: (this: this, ev: TouchEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "volumechange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "waiting", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "webkitfullscreenchange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "webkitfullscreenerror", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "wheel", listener: (this: this, ev: WheelEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var Document: {
+ prototype: Document;
+ new(): Document;
+}
+
+interface DocumentFragment extends Node, NodeSelector, ParentNode {
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var DocumentFragment: {
+ prototype: DocumentFragment;
+ new(): DocumentFragment;
+}
+
+interface DocumentType extends Node, ChildNode {
+ readonly entities: NamedNodeMap;
+ readonly internalSubset: string | null;
+ readonly name: string;
+ readonly notations: NamedNodeMap;
+ readonly publicId: string | null;
+ readonly systemId: string | null;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var DocumentType: {
+ prototype: DocumentType;
+ new(): DocumentType;
+}
+
+interface DragEvent extends MouseEvent {
+ readonly dataTransfer: DataTransfer;
+ initDragEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget, dataTransferArg: DataTransfer): void;
+ msConvertURL(file: File, targetType: string, targetURL?: string): void;
+}
+
+declare var DragEvent: {
+ prototype: DragEvent;
+ new(): DragEvent;
+}
+
+interface DynamicsCompressorNode extends AudioNode {
+ readonly attack: AudioParam;
+ readonly knee: AudioParam;
+ readonly ratio: AudioParam;
+ readonly reduction: AudioParam;
+ readonly release: AudioParam;
+ readonly threshold: AudioParam;
+}
+
+declare var DynamicsCompressorNode: {
+ prototype: DynamicsCompressorNode;
+ new(): DynamicsCompressorNode;
+}
+
+interface EXT_frag_depth {
+}
+
+declare var EXT_frag_depth: {
+ prototype: EXT_frag_depth;
+ new(): EXT_frag_depth;
+}
+
+interface EXT_texture_filter_anisotropic {
+ readonly MAX_TEXTURE_MAX_ANISOTROPY_EXT: number;
+ readonly TEXTURE_MAX_ANISOTROPY_EXT: number;
+}
+
+declare var EXT_texture_filter_anisotropic: {
+ prototype: EXT_texture_filter_anisotropic;
+ new(): EXT_texture_filter_anisotropic;
+ readonly MAX_TEXTURE_MAX_ANISOTROPY_EXT: number;
+ readonly TEXTURE_MAX_ANISOTROPY_EXT: number;
+}
+
+interface Element extends Node, GlobalEventHandlers, ElementTraversal, NodeSelector, ChildNode, ParentNode {
+ readonly classList: DOMTokenList;
+ className: string;
+ readonly clientHeight: number;
+ readonly clientLeft: number;
+ readonly clientTop: number;
+ readonly clientWidth: number;
+ id: string;
+ msContentZoomFactor: number;
+ readonly msRegionOverflow: string;
+ onariarequest: (this: this, ev: AriaRequestEvent) => any;
+ oncommand: (this: this, ev: CommandEvent) => any;
+ ongotpointercapture: (this: this, ev: PointerEvent) => any;
+ onlostpointercapture: (this: this, ev: PointerEvent) => any;
+ onmsgesturechange: (this: this, ev: MSGestureEvent) => any;
+ onmsgesturedoubletap: (this: this, ev: MSGestureEvent) => any;
+ onmsgestureend: (this: this, ev: MSGestureEvent) => any;
+ onmsgesturehold: (this: this, ev: MSGestureEvent) => any;
+ onmsgesturestart: (this: this, ev: MSGestureEvent) => any;
+ onmsgesturetap: (this: this, ev: MSGestureEvent) => any;
+ onmsgotpointercapture: (this: this, ev: MSPointerEvent) => any;
+ onmsinertiastart: (this: this, ev: MSGestureEvent) => any;
+ onmslostpointercapture: (this: this, ev: MSPointerEvent) => any;
+ onmspointercancel: (this: this, ev: MSPointerEvent) => any;
+ onmspointerdown: (this: this, ev: MSPointerEvent) => any;
+ onmspointerenter: (this: this, ev: MSPointerEvent) => any;
+ onmspointerleave: (this: this, ev: MSPointerEvent) => any;
+ onmspointermove: (this: this, ev: MSPointerEvent) => any;
+ onmspointerout: (this: this, ev: MSPointerEvent) => any;
+ onmspointerover: (this: this, ev: MSPointerEvent) => any;
+ onmspointerup: (this: this, ev: MSPointerEvent) => any;
+ ontouchcancel: (ev: TouchEvent) => any;
+ ontouchend: (ev: TouchEvent) => any;
+ ontouchmove: (ev: TouchEvent) => any;
+ ontouchstart: (ev: TouchEvent) => any;
+ onwebkitfullscreenchange: (this: this, ev: Event) => any;
+ onwebkitfullscreenerror: (this: this, ev: Event) => any;
+ readonly prefix: string | null;
+ readonly scrollHeight: number;
+ scrollLeft: number;
+ scrollTop: number;
+ readonly scrollWidth: number;
+ readonly tagName: string;
+ innerHTML: string;
+ getAttribute(name: string): string | null;
+ getAttributeNS(namespaceURI: string, localName: string): string;
+ getAttributeNode(name: string): Attr;
+ getAttributeNodeNS(namespaceURI: string, localName: string): Attr;
+ getBoundingClientRect(): ClientRect;
+ getClientRects(): ClientRectList;
+ getElementsByTagName(name: "a"): NodeListOf<HTMLAnchorElement>;
+ getElementsByTagName(name: "abbr"): NodeListOf<HTMLElement>;
+ getElementsByTagName(name: "acronym"): NodeListOf<HTMLElement>;
+ getElementsByTagName(name: "address"): NodeListOf<HTMLElement>;
+ getElementsByTagName(name: "applet"): NodeListOf<HTMLAppletElement>;
+ getElementsByTagName(name: "area"): NodeListOf<HTMLAreaElement>;
+ getElementsByTagName(name: "article"): NodeListOf<HTMLElement>;
+ getElementsByTagName(name: "aside"): NodeListOf<HTMLElement>;
+ getElementsByTagName(name: "audio"): NodeListOf<HTMLAudioElement>;
+ getElementsByTagName(name: "b"): NodeListOf<HTMLElement>;
+ getElementsByTagName(name: "base"): NodeListOf<HTMLBaseElement>;
+ getElementsByTagName(name: "basefont"): NodeListOf<HTMLBaseFontElement>;
+ getElementsByTagName(name: "bdo"): NodeListOf<HTMLElement>;
+ getElementsByTagName(name: "big"): NodeListOf<HTMLElement>;
+ getElementsByTagName(name: "blockquote"): NodeListOf<HTMLQuoteElement>;
+ getElementsByTagName(name: "body"): NodeListOf<HTMLBodyElement>;
+ getElementsByTagName(name: "br"): NodeListOf<HTMLBRElement>;
+ getElementsByTagName(name: "button"): NodeListOf<HTMLButtonElement>;
+ getElementsByTagName(name: "canvas"): NodeListOf<HTMLCanvasElement>;
+ getElementsByTagName(name: "caption"): NodeListOf<HTMLTableCaptionElement>;
+ getElementsByTagName(name: "center"): NodeListOf<HTMLElement>;
+ getElementsByTagName(name: "circle"): NodeListOf<SVGCircleElement>;
+ getElementsByTagName(name: "cite"): NodeListOf<HTMLElement>;
+ getElementsByTagName(name: "clippath"): NodeListOf<SVGClipPathElement>;
+ getElementsByTagName(name: "code"): NodeListOf<HTMLElement>;
+ getElementsByTagName(name: "col"): NodeListOf<HTMLTableColElement>;
+ getElementsByTagName(name: "colgroup"): NodeListOf<HTMLTableColElement>;
+ getElementsByTagName(name: "datalist"): NodeListOf<HTMLDataListElement>;
+ getElementsByTagName(name: "dd"): NodeListOf<HTMLElement>;
+ getElementsByTagName(name: "defs"): NodeListOf<SVGDefsElement>;
+ getElementsByTagName(name: "del"): NodeListOf<HTMLModElement>;
+ getElementsByTagName(name: "desc"): NodeListOf<SVGDescElement>;
+ getElementsByTagName(name: "dfn"): NodeListOf<HTMLElement>;
+ getElementsByTagName(name: "dir"): NodeListOf<HTMLDirectoryElement>;
+ getElementsByTagName(name: "div"): NodeListOf<HTMLDivElement>;
+ getElementsByTagName(name: "dl"): NodeListOf<HTMLDListElement>;
+ getElementsByTagName(name: "dt"): NodeListOf<HTMLElement>;
+ getElementsByTagName(name: "ellipse"): NodeListOf<SVGEllipseElement>;
+ getElementsByTagName(name: "em"): NodeListOf<HTMLElement>;
+ getElementsByTagName(name: "embed"): NodeListOf<HTMLEmbedElement>;
+ getElementsByTagName(name: "feblend"): NodeListOf<SVGFEBlendElement>;
+ getElementsByTagName(name: "fecolormatrix"): NodeListOf<SVGFEColorMatrixElement>;
+ getElementsByTagName(name: "fecomponenttransfer"): NodeListOf<SVGFEComponentTransferElement>;
+ getElementsByTagName(name: "fecomposite"): NodeListOf<SVGFECompositeElement>;
+ getElementsByTagName(name: "feconvolvematrix"): NodeListOf<SVGFEConvolveMatrixElement>;
+ getElementsByTagName(name: "fediffuselighting"): NodeListOf<SVGFEDiffuseLightingElement>;
+ getElementsByTagName(name: "fedisplacementmap"): NodeListOf<SVGFEDisplacementMapElement>;
+ getElementsByTagName(name: "fedistantlight"): NodeListOf<SVGFEDistantLightElement>;
+ getElementsByTagName(name: "feflood"): NodeListOf<SVGFEFloodElement>;
+ getElementsByTagName(name: "fefunca"): NodeListOf<SVGFEFuncAElement>;
+ getElementsByTagName(name: "fefuncb"): NodeListOf<SVGFEFuncBElement>;
+ getElementsByTagName(name: "fefuncg"): NodeListOf<SVGFEFuncGElement>;
+ getElementsByTagName(name: "fefuncr"): NodeListOf<SVGFEFuncRElement>;
+ getElementsByTagName(name: "fegaussianblur"): NodeListOf<SVGFEGaussianBlurElement>;
+ getElementsByTagName(name: "feimage"): NodeListOf<SVGFEImageElement>;
+ getElementsByTagName(name: "femerge"): NodeListOf<SVGFEMergeElement>;
+ getElementsByTagName(name: "femergenode"): NodeListOf<SVGFEMergeNodeElement>;
+ getElementsByTagName(name: "femorphology"): NodeListOf<SVGFEMorphologyElement>;
+ getElementsByTagName(name: "feoffset"): NodeListOf<SVGFEOffsetElement>;
+ getElementsByTagName(name: "fepointlight"): NodeListOf<SVGFEPointLightElement>;
+ getElementsByTagName(name: "fespecularlighting"): NodeListOf<SVGFESpecularLightingElement>;
+ getElementsByTagName(name: "fespotlight"): NodeListOf<SVGFESpotLightElement>;
+ getElementsByTagName(name: "fetile"): NodeListOf<SVGFETileElement>;
+ getElementsByTagName(name: "feturbulence"): NodeListOf<SVGFETurbulenceElement>;
+ getElementsByTagName(name: "fieldset"): NodeListOf<HTMLFieldSetElement>;
+ getElementsByTagName(name: "figcaption"): NodeListOf<HTMLElement>;
+ getElementsByTagName(name: "figure"): NodeListOf<HTMLElement>;
+ getElementsByTagName(name: "filter"): NodeListOf<SVGFilterElement>;
+ getElementsByTagName(name: "font"): NodeListOf<HTMLFontElement>;
+ getElementsByTagName(name: "footer"): NodeListOf<HTMLElement>;
+ getElementsByTagName(name: "foreignobject"): NodeListOf<SVGForeignObjectElement>;
+ getElementsByTagName(name: "form"): NodeListOf<HTMLFormElement>;
+ getElementsByTagName(name: "frame"): NodeListOf<HTMLFrameElement>;
+ getElementsByTagName(name: "frameset"): NodeListOf<HTMLFrameSetElement>;
+ getElementsByTagName(name: "g"): NodeListOf<SVGGElement>;
+ getElementsByTagName(name: "h1"): NodeListOf<HTMLHeadingElement>;
+ getElementsByTagName(name: "h2"): NodeListOf<HTMLHeadingElement>;
+ getElementsByTagName(name: "h3"): NodeListOf<HTMLHeadingElement>;
+ getElementsByTagName(name: "h4"): NodeListOf<HTMLHeadingElement>;
+ getElementsByTagName(name: "h5"): NodeListOf<HTMLHeadingElement>;
+ getElementsByTagName(name: "h6"): NodeListOf<HTMLHeadingElement>;
+ getElementsByTagName(name: "head"): NodeListOf<HTMLHeadElement>;
+ getElementsByTagName(name: "header"): NodeListOf<HTMLElement>;
+ getElementsByTagName(name: "hgroup"): NodeListOf<HTMLElement>;
+ getElementsByTagName(name: "hr"): NodeListOf<HTMLHRElement>;
+ getElementsByTagName(name: "html"): NodeListOf<HTMLHtmlElement>;
+ getElementsByTagName(name: "i"): NodeListOf<HTMLElement>;
+ getElementsByTagName(name: "iframe"): NodeListOf<HTMLIFrameElement>;
+ getElementsByTagName(name: "image"): NodeListOf<SVGImageElement>;
+ getElementsByTagName(name: "img"): NodeListOf<HTMLImageElement>;
+ getElementsByTagName(name: "input"): NodeListOf<HTMLInputElement>;
+ getElementsByTagName(name: "ins"): NodeListOf<HTMLModElement>;
+ getElementsByTagName(name: "isindex"): NodeListOf<HTMLUnknownElement>;
+ getElementsByTagName(name: "kbd"): NodeListOf<HTMLElement>;
+ getElementsByTagName(name: "keygen"): NodeListOf<HTMLElement>;
+ getElementsByTagName(name: "label"): NodeListOf<HTMLLabelElement>;
+ getElementsByTagName(name: "legend"): NodeListOf<HTMLLegendElement>;
+ getElementsByTagName(name: "li"): NodeListOf<HTMLLIElement>;
+ getElementsByTagName(name: "line"): NodeListOf<SVGLineElement>;
+ getElementsByTagName(name: "lineargradient"): NodeListOf<SVGLinearGradientElement>;
+ getElementsByTagName(name: "link"): NodeListOf<HTMLLinkElement>;
+ getElementsByTagName(name: "listing"): NodeListOf<HTMLPreElement>;
+ getElementsByTagName(name: "map"): NodeListOf<HTMLMapElement>;
+ getElementsByTagName(name: "mark"): NodeListOf<HTMLElement>;
+ getElementsByTagName(name: "marker"): NodeListOf<SVGMarkerElement>;
+ getElementsByTagName(name: "marquee"): NodeListOf<HTMLMarqueeElement>;
+ getElementsByTagName(name: "mask"): NodeListOf<SVGMaskElement>;
+ getElementsByTagName(name: "menu"): NodeListOf<HTMLMenuElement>;
+ getElementsByTagName(name: "meta"): NodeListOf<HTMLMetaElement>;
+ getElementsByTagName(name: "metadata"): NodeListOf<SVGMetadataElement>;
+ getElementsByTagName(name: "meter"): NodeListOf<HTMLMeterElement>;
+ getElementsByTagName(name: "nav"): NodeListOf<HTMLElement>;
+ getElementsByTagName(name: "nextid"): NodeListOf<HTMLUnknownElement>;
+ getElementsByTagName(name: "nobr"): NodeListOf<HTMLElement>;
+ getElementsByTagName(name: "noframes"): NodeListOf<HTMLElement>;
+ getElementsByTagName(name: "noscript"): NodeListOf<HTMLElement>;
+ getElementsByTagName(name: "object"): NodeListOf<HTMLObjectElement>;
+ getElementsByTagName(name: "ol"): NodeListOf<HTMLOListElement>;
+ getElementsByTagName(name: "optgroup"): NodeListOf<HTMLOptGroupElement>;
+ getElementsByTagName(name: "option"): NodeListOf<HTMLOptionElement>;
+ getElementsByTagName(name: "p"): NodeListOf<HTMLParagraphElement>;
+ getElementsByTagName(name: "param"): NodeListOf<HTMLParamElement>;
+ getElementsByTagName(name: "path"): NodeListOf<SVGPathElement>;
+ getElementsByTagName(name: "pattern"): NodeListOf<SVGPatternElement>;
+ getElementsByTagName(name: "picture"): NodeListOf<HTMLPictureElement>;
+ getElementsByTagName(name: "plaintext"): NodeListOf<HTMLElement>;
+ getElementsByTagName(name: "polygon"): NodeListOf<SVGPolygonElement>;
+ getElementsByTagName(name: "polyline"): NodeListOf<SVGPolylineElement>;
+ getElementsByTagName(name: "pre"): NodeListOf<HTMLPreElement>;
+ getElementsByTagName(name: "progress"): NodeListOf<HTMLProgressElement>;
+ getElementsByTagName(name: "q"): NodeListOf<HTMLQuoteElement>;
+ getElementsByTagName(name: "radialgradient"): NodeListOf<SVGRadialGradientElement>;
+ getElementsByTagName(name: "rect"): NodeListOf<SVGRectElement>;
+ getElementsByTagName(name: "rt"): NodeListOf<HTMLElement>;
+ getElementsByTagName(name: "ruby"): NodeListOf<HTMLElement>;
+ getElementsByTagName(name: "s"): NodeListOf<HTMLElement>;
+ getElementsByTagName(name: "samp"): NodeListOf<HTMLElement>;
+ getElementsByTagName(name: "script"): NodeListOf<HTMLScriptElement>;
+ getElementsByTagName(name: "section"): NodeListOf<HTMLElement>;
+ getElementsByTagName(name: "select"): NodeListOf<HTMLSelectElement>;
+ getElementsByTagName(name: "small"): NodeListOf<HTMLElement>;
+ getElementsByTagName(name: "source"): NodeListOf<HTMLSourceElement>;
+ getElementsByTagName(name: "span"): NodeListOf<HTMLSpanElement>;
+ getElementsByTagName(name: "stop"): NodeListOf<SVGStopElement>;
+ getElementsByTagName(name: "strike"): NodeListOf<HTMLElement>;
+ getElementsByTagName(name: "strong"): NodeListOf<HTMLElement>;
+ getElementsByTagName(name: "style"): NodeListOf<HTMLStyleElement>;
+ getElementsByTagName(name: "sub"): NodeListOf<HTMLElement>;
+ getElementsByTagName(name: "sup"): NodeListOf<HTMLElement>;
+ getElementsByTagName(name: "svg"): NodeListOf<SVGSVGElement>;
+ getElementsByTagName(name: "switch"): NodeListOf<SVGSwitchElement>;
+ getElementsByTagName(name: "symbol"): NodeListOf<SVGSymbolElement>;
+ getElementsByTagName(name: "table"): NodeListOf<HTMLTableElement>;
+ getElementsByTagName(name: "tbody"): NodeListOf<HTMLTableSectionElement>;
+ getElementsByTagName(name: "td"): NodeListOf<HTMLTableDataCellElement>;
+ getElementsByTagName(name: "template"): NodeListOf<HTMLTemplateElement>;
+ getElementsByTagName(name: "text"): NodeListOf<SVGTextElement>;
+ getElementsByTagName(name: "textpath"): NodeListOf<SVGTextPathElement>;
+ getElementsByTagName(name: "textarea"): NodeListOf<HTMLTextAreaElement>;
+ getElementsByTagName(name: "tfoot"): NodeListOf<HTMLTableSectionElement>;
+ getElementsByTagName(name: "th"): NodeListOf<HTMLTableHeaderCellElement>;
+ getElementsByTagName(name: "thead"): NodeListOf<HTMLTableSectionElement>;
+ getElementsByTagName(name: "title"): NodeListOf<HTMLTitleElement>;
+ getElementsByTagName(name: "tr"): NodeListOf<HTMLTableRowElement>;
+ getElementsByTagName(name: "track"): NodeListOf<HTMLTrackElement>;
+ getElementsByTagName(name: "tspan"): NodeListOf<SVGTSpanElement>;
+ getElementsByTagName(name: "tt"): NodeListOf<HTMLElement>;
+ getElementsByTagName(name: "u"): NodeListOf<HTMLElement>;
+ getElementsByTagName(name: "ul"): NodeListOf<HTMLUListElement>;
+ getElementsByTagName(name: "use"): NodeListOf<SVGUseElement>;
+ getElementsByTagName(name: "var"): NodeListOf<HTMLElement>;
+ getElementsByTagName(name: "video"): NodeListOf<HTMLVideoElement>;
+ getElementsByTagName(name: "view"): NodeListOf<SVGViewElement>;
+ getElementsByTagName(name: "wbr"): NodeListOf<HTMLElement>;
+ getElementsByTagName(name: "x-ms-webview"): NodeListOf<MSHTMLWebViewElement>;
+ getElementsByTagName(name: "xmp"): NodeListOf<HTMLPreElement>;
+ getElementsByTagName(name: string): NodeListOf<Element>;
+ getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1999/xhtml", localName: string): HTMLCollectionOf<HTMLElement>;
+ getElementsByTagNameNS(namespaceURI: "http://www.w3.org/2000/svg", localName: string): HTMLCollectionOf<SVGElement>;
+ getElementsByTagNameNS(namespaceURI: string, localName: string): HTMLCollectionOf<Element>;
+ hasAttribute(name: string): boolean;
+ hasAttributeNS(namespaceURI: string, localName: string): boolean;
+ msGetRegionContent(): MSRangeCollection;
+ msGetUntransformedBounds(): ClientRect;
+ msMatchesSelector(selectors: string): boolean;
+ msReleasePointerCapture(pointerId: number): void;
+ msSetPointerCapture(pointerId: number): void;
+ msZoomTo(args: MsZoomToOptions): void;
+ releasePointerCapture(pointerId: number): void;
+ removeAttribute(name?: string): void;
+ removeAttributeNS(namespaceURI: string, localName: string): void;
+ removeAttributeNode(oldAttr: Attr): Attr;
+ requestFullscreen(): void;
+ requestPointerLock(): void;
+ setAttribute(name: string, value: string): void;
+ setAttributeNS(namespaceURI: string, qualifiedName: string, value: string): void;
+ setAttributeNode(newAttr: Attr): Attr;
+ setAttributeNodeNS(newAttr: Attr): Attr;
+ setPointerCapture(pointerId: number): void;
+ webkitMatchesSelector(selectors: string): boolean;
+ webkitRequestFullScreen(): void;
+ webkitRequestFullscreen(): void;
+ getElementsByClassName(classNames: string): NodeListOf<Element>;
+ matches(selector: string): boolean;
+ closest(selector: string): Element | null;
+ scrollIntoView(arg?: boolean | ScrollIntoViewOptions): void;
+ scroll(options?: ScrollToOptions): void;
+ scroll(x: number, y: number): void;
+ scrollTo(options?: ScrollToOptions): void;
+ scrollTo(x: number, y: number): void;
+ scrollBy(options?: ScrollToOptions): void;
+ scrollBy(x: number, y: number): void;
+ insertAdjacentElement(position: string, insertedElement: Element): Element | null;
+ insertAdjacentHTML(where: string, html: string): void;
+ insertAdjacentText(where: string, text: string): void;
+ addEventListener(type: "MSGestureChange", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureDoubleTap", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureEnd", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureHold", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureStart", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureTap", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGotPointerCapture", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSInertiaStart", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSLostPointerCapture", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerCancel", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerDown", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerEnter", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerLeave", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerMove", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerOut", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerOver", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerUp", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "ariarequest", listener: (this: this, ev: AriaRequestEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "command", listener: (this: this, ev: CommandEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "gotpointercapture", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "lostpointercapture", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointercancel", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerdown", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerenter", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerleave", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointermove", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerout", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerover", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerup", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "touchcancel", listener: (this: this, ev: TouchEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "touchend", listener: (this: this, ev: TouchEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "touchmove", listener: (this: this, ev: TouchEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "touchstart", listener: (this: this, ev: TouchEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "webkitfullscreenchange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "webkitfullscreenerror", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "wheel", listener: (this: this, ev: WheelEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var Element: {
+ prototype: Element;
+ new(): Element;
+}
+
+interface ErrorEvent extends Event {
+ readonly colno: number;
+ readonly error: any;
+ readonly filename: string;
+ readonly lineno: number;
+ readonly message: string;
+ initErrorEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, messageArg: string, filenameArg: string, linenoArg: number): void;
+}
+
+declare var ErrorEvent: {
+ prototype: ErrorEvent;
+ new(): ErrorEvent;
+}
+
+interface Event {
+ readonly bubbles: boolean;
+ cancelBubble: boolean;
+ readonly cancelable: boolean;
+ readonly currentTarget: EventTarget;
+ readonly defaultPrevented: boolean;
+ readonly eventPhase: number;
+ readonly isTrusted: boolean;
+ returnValue: boolean;
+ readonly srcElement: Element | null;
+ readonly target: EventTarget;
+ readonly timeStamp: number;
+ readonly type: string;
+ initEvent(eventTypeArg: string, canBubbleArg: boolean, cancelableArg: boolean): void;
+ preventDefault(): void;
+ stopImmediatePropagation(): void;
+ stopPropagation(): void;
+ readonly AT_TARGET: number;
+ readonly BUBBLING_PHASE: number;
+ readonly CAPTURING_PHASE: number;
+}
+
+declare var Event: {
+ prototype: Event;
+ new(type: string, eventInitDict?: EventInit): Event;
+ readonly AT_TARGET: number;
+ readonly BUBBLING_PHASE: number;
+ readonly CAPTURING_PHASE: number;
+}
+
+interface EventTarget {
+ addEventListener(type: string, listener?: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+ dispatchEvent(evt: Event): boolean;
+ removeEventListener(type: string, listener?: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var EventTarget: {
+ prototype: EventTarget;
+ new(): EventTarget;
+}
+
+interface External {
+}
+
+declare var External: {
+ prototype: External;
+ new(): External;
+}
+
+interface File extends Blob {
+ readonly lastModifiedDate: any;
+ readonly name: string;
+ readonly webkitRelativePath: string;
+}
+
+declare var File: {
+ prototype: File;
+ new (parts: (ArrayBuffer | ArrayBufferView | Blob | string)[], filename: string, properties?: FilePropertyBag): File;
+}
+
+interface FileList {
+ readonly length: number;
+ item(index: number): File;
+ [index: number]: File;
+}
+
+declare var FileList: {
+ prototype: FileList;
+ new(): FileList;
+}
+
+interface FileReader extends EventTarget, MSBaseReader {
+ readonly error: DOMError;
+ readAsArrayBuffer(blob: Blob): void;
+ readAsBinaryString(blob: Blob): void;
+ readAsDataURL(blob: Blob): void;
+ readAsText(blob: Blob, encoding?: string): void;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var FileReader: {
+ prototype: FileReader;
+ new(): FileReader;
+}
+
+interface FocusEvent extends UIEvent {
+ readonly relatedTarget: EventTarget;
+ initFocusEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, relatedTargetArg: EventTarget): void;
+}
+
+declare var FocusEvent: {
+ prototype: FocusEvent;
+ new(typeArg: string, eventInitDict?: FocusEventInit): FocusEvent;
+}
+
+interface FormData {
+ append(name: any, value: any, blobName?: string): void;
+}
+
+declare var FormData: {
+ prototype: FormData;
+ new (form?: HTMLFormElement): FormData;
+}
+
+interface GainNode extends AudioNode {
+ readonly gain: AudioParam;
+}
+
+declare var GainNode: {
+ prototype: GainNode;
+ new(): GainNode;
+}
+
+interface Gamepad {
+ readonly axes: number[];
+ readonly buttons: GamepadButton[];
+ readonly connected: boolean;
+ readonly id: string;
+ readonly index: number;
+ readonly mapping: string;
+ readonly timestamp: number;
+}
+
+declare var Gamepad: {
+ prototype: Gamepad;
+ new(): Gamepad;
+}
+
+interface GamepadButton {
+ readonly pressed: boolean;
+ readonly value: number;
+}
+
+declare var GamepadButton: {
+ prototype: GamepadButton;
+ new(): GamepadButton;
+}
+
+interface GamepadEvent extends Event {
+ readonly gamepad: Gamepad;
+}
+
+declare var GamepadEvent: {
+ prototype: GamepadEvent;
+ new(): GamepadEvent;
+}
+
+interface Geolocation {
+ clearWatch(watchId: number): void;
+ getCurrentPosition(successCallback: PositionCallback, errorCallback?: PositionErrorCallback, options?: PositionOptions): void;
+ watchPosition(successCallback: PositionCallback, errorCallback?: PositionErrorCallback, options?: PositionOptions): number;
+}
+
+declare var Geolocation: {
+ prototype: Geolocation;
+ new(): Geolocation;
+}
+
+interface HTMLAllCollection extends HTMLCollection {
+ namedItem(name: string): Element;
+}
+
+declare var HTMLAllCollection: {
+ prototype: HTMLAllCollection;
+ new(): HTMLAllCollection;
+}
+
+interface HTMLAnchorElement extends HTMLElement {
+ Methods: string;
+ /**
+ * Sets or retrieves the character set used to encode the object.
+ */
+ charset: string;
+ /**
+ * Sets or retrieves the coordinates of the object.
+ */
+ coords: string;
+ download: string;
+ /**
+ * Contains the anchor portion of the URL including the hash sign (#).
+ */
+ hash: string;
+ /**
+ * Contains the hostname and port values of the URL.
+ */
+ host: string;
+ /**
+ * Contains the hostname of a URL.
+ */
+ hostname: string;
+ /**
+ * Sets or retrieves a destination URL or an anchor point.
+ */
+ href: string;
+ /**
+ * Sets or retrieves the language code of the object.
+ */
+ hreflang: string;
+ readonly mimeType: string;
+ /**
+ * Sets or retrieves the shape of the object.
+ */
+ name: string;
+ readonly nameProp: string;
+ /**
+ * Contains the pathname of the URL.
+ */
+ pathname: string;
+ /**
+ * Sets or retrieves the port number associated with a URL.
+ */
+ port: string;
+ /**
+ * Contains the protocol of the URL.
+ */
+ protocol: string;
+ readonly protocolLong: string;
+ /**
+ * Sets or retrieves the relationship between the object and the destination of the link.
+ */
+ rel: string;
+ /**
+ * Sets or retrieves the relationship between the object and the destination of the link.
+ */
+ rev: string;
+ /**
+ * Sets or retrieves the substring of the href property that follows the question mark.
+ */
+ search: string;
+ /**
+ * Sets or retrieves the shape of the object.
+ */
+ shape: string;
+ /**
+ * Sets or retrieves the window or frame at which to target content.
+ */
+ target: string;
+ /**
+ * Retrieves or sets the text of the object as a string.
+ */
+ text: string;
+ type: string;
+ urn: string;
+ /**
+ * Returns a string representation of an object.
+ */
+ toString(): string;
+}
+
+declare var HTMLAnchorElement: {
+ prototype: HTMLAnchorElement;
+ new(): HTMLAnchorElement;
+}
+
+interface HTMLAppletElement extends HTMLElement {
+ /**
+ * Retrieves a string of the URL where the object tag can be found. This is often the href of the document that the object is in, or the value set by a base element.
+ */
+ readonly BaseHref: string;
+ align: string;
+ /**
+ * Sets or retrieves a text alternative to the graphic.
+ */
+ alt: string;
+ /**
+ * Gets or sets the optional alternative HTML script to execute if the object fails to load.
+ */
+ altHtml: string;
+ /**
+ * Sets or retrieves a character string that can be used to implement your own archive functionality for the object.
+ */
+ archive: string;
+ border: string;
+ code: string;
+ /**
+ * Sets or retrieves the URL of the component.
+ */
+ codeBase: string;
+ /**
+ * Sets or retrieves the Internet media type for the code associated with the object.
+ */
+ codeType: string;
+ /**
+ * Address of a pointer to the document this page or frame contains. If there is no document, then null will be returned.
+ */
+ readonly contentDocument: Document;
+ /**
+ * Sets or retrieves the URL that references the data of the object.
+ */
+ data: string;
+ /**
+ * Sets or retrieves a character string that can be used to implement your own declare functionality for the object.
+ */
+ declare: boolean;
+ readonly form: HTMLFormElement;
+ /**
+ * Sets or retrieves the height of the object.
+ */
+ height: string;
+ hspace: number;
+ /**
+ * Sets or retrieves the shape of the object.
+ */
+ name: string;
+ object: string | null;
+ /**
+ * Sets or retrieves a message to be displayed while an object is loading.
+ */
+ standby: string;
+ /**
+ * Returns the content type of the object.
+ */
+ type: string;
+ /**
+ * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map.
+ */
+ useMap: string;
+ vspace: number;
+ width: number;
+}
+
+declare var HTMLAppletElement: {
+ prototype: HTMLAppletElement;
+ new(): HTMLAppletElement;
+}
+
+interface HTMLAreaElement extends HTMLElement {
+ /**
+ * Sets or retrieves a text alternative to the graphic.
+ */
+ alt: string;
+ /**
+ * Sets or retrieves the coordinates of the object.
+ */
+ coords: string;
+ download: string;
+ /**
+ * Sets or retrieves the subsection of the href property that follows the number sign (#).
+ */
+ hash: string;
+ /**
+ * Sets or retrieves the hostname and port number of the location or URL.
+ */
+ host: string;
+ /**
+ * Sets or retrieves the host name part of the location or URL.
+ */
+ hostname: string;
+ /**
+ * Sets or retrieves a destination URL or an anchor point.
+ */
+ href: string;
+ /**
+ * Sets or gets whether clicks in this region cause action.
+ */
+ noHref: boolean;
+ /**
+ * Sets or retrieves the file name or path specified by the object.
+ */
+ pathname: string;
+ /**
+ * Sets or retrieves the port number associated with a URL.
+ */
+ port: string;
+ /**
+ * Sets or retrieves the protocol portion of a URL.
+ */
+ protocol: string;
+ rel: string;
+ /**
+ * Sets or retrieves the substring of the href property that follows the question mark.
+ */
+ search: string;
+ /**
+ * Sets or retrieves the shape of the object.
+ */
+ shape: string;
+ /**
+ * Sets or retrieves the window or frame at which to target content.
+ */
+ target: string;
+ /**
+ * Returns a string representation of an object.
+ */
+ toString(): string;
+}
+
+declare var HTMLAreaElement: {
+ prototype: HTMLAreaElement;
+ new(): HTMLAreaElement;
+}
+
+interface HTMLAreasCollection extends HTMLCollection {
+ /**
+ * Adds an element to the areas, controlRange, or options collection.
+ */
+ add(element: HTMLElement, before?: HTMLElement | number): void;
+ /**
+ * Removes an element from the collection.
+ */
+ remove(index?: number): void;
+}
+
+declare var HTMLAreasCollection: {
+ prototype: HTMLAreasCollection;
+ new(): HTMLAreasCollection;
+}
+
+interface HTMLAudioElement extends HTMLMediaElement {
+}
+
+declare var HTMLAudioElement: {
+ prototype: HTMLAudioElement;
+ new(): HTMLAudioElement;
+}
+
+interface HTMLBRElement extends HTMLElement {
+ /**
+ * Sets or retrieves the side on which floating objects are not to be positioned when any IHTMLBlockElement is inserted into the document.
+ */
+ clear: string;
+}
+
+declare var HTMLBRElement: {
+ prototype: HTMLBRElement;
+ new(): HTMLBRElement;
+}
+
+interface HTMLBaseElement extends HTMLElement {
+ /**
+ * Gets or sets the baseline URL on which relative links are based.
+ */
+ href: string;
+ /**
+ * Sets or retrieves the window or frame at which to target content.
+ */
+ target: string;
+}
+
+declare var HTMLBaseElement: {
+ prototype: HTMLBaseElement;
+ new(): HTMLBaseElement;
+}
+
+interface HTMLBaseFontElement extends HTMLElement, DOML2DeprecatedColorProperty {
+ /**
+ * Sets or retrieves the current typeface family.
+ */
+ face: string;
+ /**
+ * Sets or retrieves the font size of the object.
+ */
+ size: number;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var HTMLBaseFontElement: {
+ prototype: HTMLBaseFontElement;
+ new(): HTMLBaseFontElement;
+}
+
+interface HTMLBodyElement extends HTMLElement {
+ aLink: any;
+ background: string;
+ bgColor: any;
+ bgProperties: string;
+ link: any;
+ noWrap: boolean;
+ onafterprint: (this: this, ev: Event) => any;
+ onbeforeprint: (this: this, ev: Event) => any;
+ onbeforeunload: (this: this, ev: BeforeUnloadEvent) => any;
+ onblur: (this: this, ev: FocusEvent) => any;
+ onerror: (this: this, ev: ErrorEvent) => any;
+ onfocus: (this: this, ev: FocusEvent) => any;
+ onhashchange: (this: this, ev: HashChangeEvent) => any;
+ onload: (this: this, ev: Event) => any;
+ onmessage: (this: this, ev: MessageEvent) => any;
+ onoffline: (this: this, ev: Event) => any;
+ ononline: (this: this, ev: Event) => any;
+ onorientationchange: (this: this, ev: Event) => any;
+ onpagehide: (this: this, ev: PageTransitionEvent) => any;
+ onpageshow: (this: this, ev: PageTransitionEvent) => any;
+ onpopstate: (this: this, ev: PopStateEvent) => any;
+ onresize: (this: this, ev: UIEvent) => any;
+ onstorage: (this: this, ev: StorageEvent) => any;
+ onunload: (this: this, ev: Event) => any;
+ text: any;
+ vLink: any;
+ addEventListener(type: "MSContentZoom", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureChange", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureDoubleTap", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureEnd", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureHold", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureStart", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureTap", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGotPointerCapture", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSInertiaStart", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSLostPointerCapture", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSManipulationStateChanged", listener: (this: this, ev: MSManipulationEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerCancel", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerDown", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerEnter", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerLeave", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerMove", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerOut", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerOver", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerUp", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "abort", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "activate", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "afterprint", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "ariarequest", listener: (this: this, ev: AriaRequestEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "beforeactivate", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "beforecopy", listener: (this: this, ev: ClipboardEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "beforecut", listener: (this: this, ev: ClipboardEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "beforedeactivate", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "beforepaste", listener: (this: this, ev: ClipboardEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "beforeprint", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "beforeunload", listener: (this: this, ev: BeforeUnloadEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "blur", listener: (this: this, ev: FocusEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "blur", listener: (this: this, ev: FocusEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "canplay", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "canplaythrough", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "change", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "click", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "command", listener: (this: this, ev: CommandEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "contextmenu", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "copy", listener: (this: this, ev: ClipboardEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "cuechange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "cut", listener: (this: this, ev: ClipboardEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dblclick", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "deactivate", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "drag", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dragend", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dragenter", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dragleave", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dragover", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dragstart", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "drop", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "durationchange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "emptied", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "ended", listener: (this: this, ev: MediaStreamErrorEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "error", listener: (this: this, ev: ErrorEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "error", listener: (this: this, ev: ErrorEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "focus", listener: (this: this, ev: FocusEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "focus", listener: (this: this, ev: FocusEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "gotpointercapture", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "hashchange", listener: (this: this, ev: HashChangeEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "input", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "invalid", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "keydown", listener: (this: this, ev: KeyboardEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "keypress", listener: (this: this, ev: KeyboardEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "keyup", listener: (this: this, ev: KeyboardEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "load", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "load", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "loadeddata", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "loadedmetadata", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "loadstart", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "lostpointercapture", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "message", listener: (this: this, ev: MessageEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mousedown", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mouseenter", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mouseleave", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mousemove", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mouseout", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mouseover", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mouseup", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mousewheel", listener: (this: this, ev: WheelEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "offline", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "online", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "orientationchange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "pagehide", listener: (this: this, ev: PageTransitionEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pageshow", listener: (this: this, ev: PageTransitionEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "paste", listener: (this: this, ev: ClipboardEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pause", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "play", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "playing", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointercancel", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerdown", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerenter", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerleave", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointermove", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerout", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerover", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerup", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "popstate", listener: (this: this, ev: PopStateEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "progress", listener: (this: this, ev: ProgressEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "ratechange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "reset", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "resize", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "scroll", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "seeked", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "seeking", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "select", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "selectstart", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "stalled", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "storage", listener: (this: this, ev: StorageEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "submit", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "suspend", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "timeupdate", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "touchcancel", listener: (this: this, ev: TouchEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "touchend", listener: (this: this, ev: TouchEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "touchmove", listener: (this: this, ev: TouchEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "touchstart", listener: (this: this, ev: TouchEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "unload", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "volumechange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "waiting", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "webkitfullscreenchange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "webkitfullscreenerror", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "wheel", listener: (this: this, ev: WheelEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var HTMLBodyElement: {
+ prototype: HTMLBodyElement;
+ new(): HTMLBodyElement;
+}
+
+interface HTMLButtonElement extends HTMLElement {
+ /**
+ * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing.
+ */
+ autofocus: boolean;
+ disabled: boolean;
+ /**
+ * Retrieves a reference to the form that the object is embedded in.
+ */
+ readonly form: HTMLFormElement;
+ /**
+ * Overrides the action attribute (where the data on a form is sent) on the parent form element.
+ */
+ formAction: string;
+ /**
+ * Used to override the encoding (formEnctype attribute) specified on the form element.
+ */
+ formEnctype: string;
+ /**
+ * Overrides the submit method attribute previously specified on a form element.
+ */
+ formMethod: string;
+ /**
+ * Overrides any validation or required attributes on a form or form elements to allow it to be submitted without validation. This can be used to create a "save draft"-type submit option.
+ */
+ formNoValidate: string;
+ /**
+ * Overrides the target attribute on a form element.
+ */
+ formTarget: string;
+ /**
+ * Sets or retrieves the name of the object.
+ */
+ name: string;
+ status: any;
+ /**
+ * Gets the classification and default behavior of the button.
+ */
+ type: string;
+ /**
+ * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting.
+ */
+ readonly validationMessage: string;
+ /**
+ * Returns a ValidityState object that represents the validity states of an element.
+ */
+ readonly validity: ValidityState;
+ /**
+ * Sets or retrieves the default or selected value of the control.
+ */
+ value: string;
+ /**
+ * Returns whether an element will successfully validate based on forms validation rules and constraints.
+ */
+ readonly willValidate: boolean;
+ /**
+ * Returns whether a form will validate when it is submitted, without having to submit it.
+ */
+ checkValidity(): boolean;
+ /**
+ * Sets a custom error message that is displayed when a form is submitted.
+ * @param error Sets a custom error message that is displayed when a form is submitted.
+ */
+ setCustomValidity(error: string): void;
+}
+
+declare var HTMLButtonElement: {
+ prototype: HTMLButtonElement;
+ new(): HTMLButtonElement;
+}
+
+interface HTMLCanvasElement extends HTMLElement {
+ /**
+ * Gets or sets the height of a canvas element on a document.
+ */
+ height: number;
+ /**
+ * Gets or sets the width of a canvas element on a document.
+ */
+ width: number;
+ /**
+ * Returns an object that provides methods and properties for drawing and manipulating images and graphics on a canvas element in a document. A context object includes information about colors, line widths, fonts, and other graphic parameters that can be drawn on a canvas.
+ * @param contextId The identifier (ID) of the type of canvas to create. Internet Explorer 9 and Internet Explorer 10 support only a 2-D context using canvas.getContext("2d"); IE11 Preview also supports 3-D or WebGL context using canvas.getContext("experimental-webgl");
+ */
+ getContext(contextId: "2d", contextAttributes?: Canvas2DContextAttributes): CanvasRenderingContext2D | null;
+ getContext(contextId: "webgl" | "experimental-webgl", contextAttributes?: WebGLContextAttributes): WebGLRenderingContext | null;
+ getContext(contextId: string, contextAttributes?: {}): CanvasRenderingContext2D | WebGLRenderingContext | null;
+ /**
+ * Returns a blob object encoded as a Portable Network Graphics (PNG) format from a canvas image or drawing.
+ */
+ msToBlob(): Blob;
+ /**
+ * Returns the content of the current canvas as an image that you can use as a source for another canvas or an HTML element.
+ * @param type The standard MIME type for the image format to return. If you do not specify this parameter, the default value is a PNG format image.
+ */
+ toDataURL(type?: string, ...args: any[]): string;
+ toBlob(callback: (result: Blob | null) => void, type?: string, ...arguments: any[]): void;
+}
+
+declare var HTMLCanvasElement: {
+ prototype: HTMLCanvasElement;
+ new(): HTMLCanvasElement;
+}
+
+interface HTMLCollection {
+ /**
+ * Sets or retrieves the number of objects in a collection.
+ */
+ readonly length: number;
+ /**
+ * Retrieves an object from various collections.
+ */
+ item(index: number): Element;
+ /**
+ * Retrieves a select object or an object from an options collection.
+ */
+ namedItem(name: string): Element;
+ [index: number]: Element;
+}
+
+declare var HTMLCollection: {
+ prototype: HTMLCollection;
+ new(): HTMLCollection;
+}
+
+interface HTMLDListElement extends HTMLElement {
+ compact: boolean;
+}
+
+declare var HTMLDListElement: {
+ prototype: HTMLDListElement;
+ new(): HTMLDListElement;
+}
+
+interface HTMLDataListElement extends HTMLElement {
+ options: HTMLCollectionOf<HTMLOptionElement>;
+}
+
+declare var HTMLDataListElement: {
+ prototype: HTMLDataListElement;
+ new(): HTMLDataListElement;
+}
+
+interface HTMLDirectoryElement extends HTMLElement {
+ compact: boolean;
+}
+
+declare var HTMLDirectoryElement: {
+ prototype: HTMLDirectoryElement;
+ new(): HTMLDirectoryElement;
+}
+
+interface HTMLDivElement extends HTMLElement {
+ /**
+ * Sets or retrieves how the object is aligned with adjacent text.
+ */
+ align: string;
+ /**
+ * Sets or retrieves whether the browser automatically performs wordwrap.
+ */
+ noWrap: boolean;
+}
+
+declare var HTMLDivElement: {
+ prototype: HTMLDivElement;
+ new(): HTMLDivElement;
+}
+
+interface HTMLDocument extends Document {
+}
+
+declare var HTMLDocument: {
+ prototype: HTMLDocument;
+ new(): HTMLDocument;
+}
+
+interface HTMLElement extends Element {
+ accessKey: string;
+ readonly children: HTMLCollection;
+ contentEditable: string;
+ readonly dataset: DOMStringMap;
+ dir: string;
+ draggable: boolean;
+ hidden: boolean;
+ hideFocus: boolean;
+ innerHTML: string;
+ innerText: string;
+ readonly isContentEditable: boolean;
+ lang: string;
+ readonly offsetHeight: number;
+ readonly offsetLeft: number;
+ readonly offsetParent: Element;
+ readonly offsetTop: number;
+ readonly offsetWidth: number;
+ onabort: (this: this, ev: UIEvent) => any;
+ onactivate: (this: this, ev: UIEvent) => any;
+ onbeforeactivate: (this: this, ev: UIEvent) => any;
+ onbeforecopy: (this: this, ev: ClipboardEvent) => any;
+ onbeforecut: (this: this, ev: ClipboardEvent) => any;
+ onbeforedeactivate: (this: this, ev: UIEvent) => any;
+ onbeforepaste: (this: this, ev: ClipboardEvent) => any;
+ onblur: (this: this, ev: FocusEvent) => any;
+ oncanplay: (this: this, ev: Event) => any;
+ oncanplaythrough: (this: this, ev: Event) => any;
+ onchange: (this: this, ev: Event) => any;
+ onclick: (this: this, ev: MouseEvent) => any;
+ oncontextmenu: (this: this, ev: PointerEvent) => any;
+ oncopy: (this: this, ev: ClipboardEvent) => any;
+ oncuechange: (this: this, ev: Event) => any;
+ oncut: (this: this, ev: ClipboardEvent) => any;
+ ondblclick: (this: this, ev: MouseEvent) => any;
+ ondeactivate: (this: this, ev: UIEvent) => any;
+ ondrag: (this: this, ev: DragEvent) => any;
+ ondragend: (this: this, ev: DragEvent) => any;
+ ondragenter: (this: this, ev: DragEvent) => any;
+ ondragleave: (this: this, ev: DragEvent) => any;
+ ondragover: (this: this, ev: DragEvent) => any;
+ ondragstart: (this: this, ev: DragEvent) => any;
+ ondrop: (this: this, ev: DragEvent) => any;
+ ondurationchange: (this: this, ev: Event) => any;
+ onemptied: (this: this, ev: Event) => any;
+ onended: (this: this, ev: MediaStreamErrorEvent) => any;
+ onerror: (this: this, ev: ErrorEvent) => any;
+ onfocus: (this: this, ev: FocusEvent) => any;
+ oninput: (this: this, ev: Event) => any;
+ oninvalid: (this: this, ev: Event) => any;
+ onkeydown: (this: this, ev: KeyboardEvent) => any;
+ onkeypress: (this: this, ev: KeyboardEvent) => any;
+ onkeyup: (this: this, ev: KeyboardEvent) => any;
+ onload: (this: this, ev: Event) => any;
+ onloadeddata: (this: this, ev: Event) => any;
+ onloadedmetadata: (this: this, ev: Event) => any;
+ onloadstart: (this: this, ev: Event) => any;
+ onmousedown: (this: this, ev: MouseEvent) => any;
+ onmouseenter: (this: this, ev: MouseEvent) => any;
+ onmouseleave: (this: this, ev: MouseEvent) => any;
+ onmousemove: (this: this, ev: MouseEvent) => any;
+ onmouseout: (this: this, ev: MouseEvent) => any;
+ onmouseover: (this: this, ev: MouseEvent) => any;
+ onmouseup: (this: this, ev: MouseEvent) => any;
+ onmousewheel: (this: this, ev: WheelEvent) => any;
+ onmscontentzoom: (this: this, ev: UIEvent) => any;
+ onmsmanipulationstatechanged: (this: this, ev: MSManipulationEvent) => any;
+ onpaste: (this: this, ev: ClipboardEvent) => any;
+ onpause: (this: this, ev: Event) => any;
+ onplay: (this: this, ev: Event) => any;
+ onplaying: (this: this, ev: Event) => any;
+ onprogress: (this: this, ev: ProgressEvent) => any;
+ onratechange: (this: this, ev: Event) => any;
+ onreset: (this: this, ev: Event) => any;
+ onscroll: (this: this, ev: UIEvent) => any;
+ onseeked: (this: this, ev: Event) => any;
+ onseeking: (this: this, ev: Event) => any;
+ onselect: (this: this, ev: UIEvent) => any;
+ onselectstart: (this: this, ev: Event) => any;
+ onstalled: (this: this, ev: Event) => any;
+ onsubmit: (this: this, ev: Event) => any;
+ onsuspend: (this: this, ev: Event) => any;
+ ontimeupdate: (this: this, ev: Event) => any;
+ onvolumechange: (this: this, ev: Event) => any;
+ onwaiting: (this: this, ev: Event) => any;
+ outerHTML: string;
+ outerText: string;
+ spellcheck: boolean;
+ readonly style: CSSStyleDeclaration;
+ tabIndex: number;
+ title: string;
+ blur(): void;
+ click(): void;
+ dragDrop(): boolean;
+ focus(): void;
+ msGetInputContext(): MSInputMethodContext;
+ setActive(): void;
+ addEventListener(type: "MSContentZoom", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureChange", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureDoubleTap", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureEnd", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureHold", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureStart", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureTap", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGotPointerCapture", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSInertiaStart", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSLostPointerCapture", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSManipulationStateChanged", listener: (this: this, ev: MSManipulationEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerCancel", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerDown", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerEnter", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerLeave", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerMove", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerOut", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerOver", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerUp", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "abort", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "activate", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "ariarequest", listener: (this: this, ev: AriaRequestEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "beforeactivate", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "beforecopy", listener: (this: this, ev: ClipboardEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "beforecut", listener: (this: this, ev: ClipboardEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "beforedeactivate", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "beforepaste", listener: (this: this, ev: ClipboardEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "blur", listener: (this: this, ev: FocusEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "canplay", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "canplaythrough", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "change", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "click", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "command", listener: (this: this, ev: CommandEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "contextmenu", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "copy", listener: (this: this, ev: ClipboardEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "cuechange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "cut", listener: (this: this, ev: ClipboardEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dblclick", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "deactivate", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "drag", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dragend", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dragenter", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dragleave", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dragover", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dragstart", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "drop", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "durationchange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "emptied", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "ended", listener: (this: this, ev: MediaStreamErrorEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "error", listener: (this: this, ev: ErrorEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "focus", listener: (this: this, ev: FocusEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "gotpointercapture", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "input", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "invalid", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "keydown", listener: (this: this, ev: KeyboardEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "keypress", listener: (this: this, ev: KeyboardEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "keyup", listener: (this: this, ev: KeyboardEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "load", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "loadeddata", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "loadedmetadata", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "loadstart", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "lostpointercapture", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mousedown", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mouseenter", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mouseleave", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mousemove", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mouseout", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mouseover", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mouseup", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mousewheel", listener: (this: this, ev: WheelEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "paste", listener: (this: this, ev: ClipboardEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pause", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "play", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "playing", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointercancel", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerdown", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerenter", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerleave", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointermove", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerout", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerover", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerup", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "progress", listener: (this: this, ev: ProgressEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "ratechange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "reset", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "scroll", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "seeked", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "seeking", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "select", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "selectstart", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "stalled", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "submit", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "suspend", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "timeupdate", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "touchcancel", listener: (this: this, ev: TouchEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "touchend", listener: (this: this, ev: TouchEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "touchmove", listener: (this: this, ev: TouchEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "touchstart", listener: (this: this, ev: TouchEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "volumechange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "waiting", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "webkitfullscreenchange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "webkitfullscreenerror", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "wheel", listener: (this: this, ev: WheelEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var HTMLElement: {
+ prototype: HTMLElement;
+ new(): HTMLElement;
+}
+
+interface HTMLEmbedElement extends HTMLElement, GetSVGDocument {
+ /**
+ * Sets or retrieves the height of the object.
+ */
+ height: string;
+ hidden: any;
+ /**
+ * Gets or sets whether the DLNA PlayTo device is available.
+ */
+ msPlayToDisabled: boolean;
+ /**
+ * Gets or sets the path to the preferred media source. This enables the Play To target device to stream the media content, which can be DRM protected, from a different location, such as a cloud media server.
+ */
+ msPlayToPreferredSourceUri: string;
+ /**
+ * Gets or sets the primary DLNA PlayTo device.
+ */
+ msPlayToPrimary: boolean;
+ /**
+ * Gets the source associated with the media element for use by the PlayToManager.
+ */
+ readonly msPlayToSource: any;
+ /**
+ * Sets or retrieves the name of the object.
+ */
+ name: string;
+ /**
+ * Retrieves the palette used for the embedded document.
+ */
+ readonly palette: string;
+ /**
+ * Retrieves the URL of the plug-in used to view an embedded document.
+ */
+ readonly pluginspage: string;
+ readonly readyState: string;
+ /**
+ * Sets or retrieves a URL to be loaded by the object.
+ */
+ src: string;
+ /**
+ * Sets or retrieves the height and width units of the embed object.
+ */
+ units: string;
+ /**
+ * Sets or retrieves the width of the object.
+ */
+ width: string;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var HTMLEmbedElement: {
+ prototype: HTMLEmbedElement;
+ new(): HTMLEmbedElement;
+}
+
+interface HTMLFieldSetElement extends HTMLElement {
+ /**
+ * Sets or retrieves how the object is aligned with adjacent text.
+ */
+ align: string;
+ disabled: boolean;
+ /**
+ * Retrieves a reference to the form that the object is embedded in.
+ */
+ readonly form: HTMLFormElement;
+ /**
+ * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting.
+ */
+ readonly validationMessage: string;
+ /**
+ * Returns a ValidityState object that represents the validity states of an element.
+ */
+ readonly validity: ValidityState;
+ /**
+ * Returns whether an element will successfully validate based on forms validation rules and constraints.
+ */
+ readonly willValidate: boolean;
+ /**
+ * Returns whether a form will validate when it is submitted, without having to submit it.
+ */
+ checkValidity(): boolean;
+ /**
+ * Sets a custom error message that is displayed when a form is submitted.
+ * @param error Sets a custom error message that is displayed when a form is submitted.
+ */
+ setCustomValidity(error: string): void;
+}
+
+declare var HTMLFieldSetElement: {
+ prototype: HTMLFieldSetElement;
+ new(): HTMLFieldSetElement;
+}
+
+interface HTMLFontElement extends HTMLElement, DOML2DeprecatedColorProperty, DOML2DeprecatedSizeProperty {
+ /**
+ * Sets or retrieves the current typeface family.
+ */
+ face: string;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var HTMLFontElement: {
+ prototype: HTMLFontElement;
+ new(): HTMLFontElement;
+}
+
+interface HTMLFormElement extends HTMLElement {
+ /**
+ * Sets or retrieves a list of character encodings for input data that must be accepted by the server processing the form.
+ */
+ acceptCharset: string;
+ /**
+ * Sets or retrieves the URL to which the form content is sent for processing.
+ */
+ action: string;
+ /**
+ * Specifies whether autocomplete is applied to an editable text field.
+ */
+ autocomplete: string;
+ /**
+ * Retrieves a collection, in source order, of all controls in a given form.
+ */
+ readonly elements: HTMLCollection;
+ /**
+ * Sets or retrieves the MIME encoding for the form.
+ */
+ encoding: string;
+ /**
+ * Sets or retrieves the encoding type for the form.
+ */
+ enctype: string;
+ /**
+ * Sets or retrieves the number of objects in a collection.
+ */
+ readonly length: number;
+ /**
+ * Sets or retrieves how to send the form data to the server.
+ */
+ method: string;
+ /**
+ * Sets or retrieves the name of the object.
+ */
+ name: string;
+ /**
+ * Designates a form that is not validated when submitted.
+ */
+ noValidate: boolean;
+ /**
+ * Sets or retrieves the window or frame at which to target content.
+ */
+ target: string;
+ /**
+ * Returns whether a form will validate when it is submitted, without having to submit it.
+ */
+ checkValidity(): boolean;
+ /**
+ * Retrieves a form object or an object from an elements collection.
+ * @param name Variant of type Number or String that specifies the object or collection to retrieve. If this parameter is a Number, it is the zero-based index of the object. If this parameter is a string, all objects with matching name or id properties are retrieved, and a collection is returned if more than one match is made.
+ * @param index Variant of type Number that specifies the zero-based index of the object to retrieve when a collection is returned.
+ */
+ item(name?: any, index?: any): any;
+ /**
+ * Retrieves a form object or an object from an elements collection.
+ */
+ namedItem(name: string): any;
+ /**
+ * Fires when the user resets a form.
+ */
+ reset(): void;
+ /**
+ * Fires when a FORM is about to be submitted.
+ */
+ submit(): void;
+ [name: string]: any;
+}
+
+declare var HTMLFormElement: {
+ prototype: HTMLFormElement;
+ new(): HTMLFormElement;
+}
+
+interface HTMLFrameElement extends HTMLElement, GetSVGDocument {
+ /**
+ * Specifies the properties of a border drawn around an object.
+ */
+ border: string;
+ /**
+ * Sets or retrieves the border color of the object.
+ */
+ borderColor: any;
+ /**
+ * Retrieves the document object of the page or frame.
+ */
+ readonly contentDocument: Document;
+ /**
+ * Retrieves the object of the specified.
+ */
+ readonly contentWindow: Window;
+ /**
+ * Sets or retrieves whether to display a border for the frame.
+ */
+ frameBorder: string;
+ /**
+ * Sets or retrieves the amount of additional space between the frames.
+ */
+ frameSpacing: any;
+ /**
+ * Sets or retrieves the height of the object.
+ */
+ height: string | number;
+ /**
+ * Sets or retrieves a URI to a long description of the object.
+ */
+ longDesc: string;
+ /**
+ * Sets or retrieves the top and bottom margin heights before displaying the text in a frame.
+ */
+ marginHeight: string;
+ /**
+ * Sets or retrieves the left and right margin widths before displaying the text in a frame.
+ */
+ marginWidth: string;
+ /**
+ * Sets or retrieves the frame name.
+ */
+ name: string;
+ /**
+ * Sets or retrieves whether the user can resize the frame.
+ */
+ noResize: boolean;
+ /**
+ * Raised when the object has been completely received from the server.
+ */
+ onload: (this: this, ev: Event) => any;
+ /**
+ * Sets or retrieves whether the frame can be scrolled.
+ */
+ scrolling: string;
+ /**
+ * Sets or retrieves a URL to be loaded by the object.
+ */
+ src: string;
+ /**
+ * Sets or retrieves the width of the object.
+ */
+ width: string | number;
+ addEventListener(type: "MSContentZoom", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureChange", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureDoubleTap", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureEnd", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureHold", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureStart", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureTap", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGotPointerCapture", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSInertiaStart", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSLostPointerCapture", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSManipulationStateChanged", listener: (this: this, ev: MSManipulationEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerCancel", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerDown", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerEnter", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerLeave", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerMove", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerOut", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerOver", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerUp", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "abort", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "activate", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "ariarequest", listener: (this: this, ev: AriaRequestEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "beforeactivate", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "beforecopy", listener: (this: this, ev: ClipboardEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "beforecut", listener: (this: this, ev: ClipboardEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "beforedeactivate", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "beforepaste", listener: (this: this, ev: ClipboardEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "blur", listener: (this: this, ev: FocusEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "canplay", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "canplaythrough", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "change", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "click", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "command", listener: (this: this, ev: CommandEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "contextmenu", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "copy", listener: (this: this, ev: ClipboardEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "cuechange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "cut", listener: (this: this, ev: ClipboardEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dblclick", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "deactivate", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "drag", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dragend", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dragenter", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dragleave", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dragover", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dragstart", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "drop", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "durationchange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "emptied", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "ended", listener: (this: this, ev: MediaStreamErrorEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "error", listener: (this: this, ev: ErrorEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "focus", listener: (this: this, ev: FocusEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "gotpointercapture", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "input", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "invalid", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "keydown", listener: (this: this, ev: KeyboardEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "keypress", listener: (this: this, ev: KeyboardEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "keyup", listener: (this: this, ev: KeyboardEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "load", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "load", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "loadeddata", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "loadedmetadata", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "loadstart", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "lostpointercapture", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mousedown", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mouseenter", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mouseleave", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mousemove", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mouseout", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mouseover", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mouseup", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mousewheel", listener: (this: this, ev: WheelEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "paste", listener: (this: this, ev: ClipboardEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pause", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "play", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "playing", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointercancel", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerdown", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerenter", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerleave", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointermove", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerout", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerover", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerup", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "progress", listener: (this: this, ev: ProgressEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "ratechange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "reset", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "scroll", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "seeked", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "seeking", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "select", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "selectstart", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "stalled", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "submit", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "suspend", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "timeupdate", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "touchcancel", listener: (this: this, ev: TouchEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "touchend", listener: (this: this, ev: TouchEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "touchmove", listener: (this: this, ev: TouchEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "touchstart", listener: (this: this, ev: TouchEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "volumechange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "waiting", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "webkitfullscreenchange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "webkitfullscreenerror", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "wheel", listener: (this: this, ev: WheelEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var HTMLFrameElement: {
+ prototype: HTMLFrameElement;
+ new(): HTMLFrameElement;
+}
+
+interface HTMLFrameSetElement extends HTMLElement {
+ border: string;
+ /**
+ * Sets or retrieves the border color of the object.
+ */
+ borderColor: any;
+ /**
+ * Sets or retrieves the frame widths of the object.
+ */
+ cols: string;
+ /**
+ * Sets or retrieves whether to display a border for the frame.
+ */
+ frameBorder: string;
+ /**
+ * Sets or retrieves the amount of additional space between the frames.
+ */
+ frameSpacing: any;
+ name: string;
+ onafterprint: (this: this, ev: Event) => any;
+ onbeforeprint: (this: this, ev: Event) => any;
+ onbeforeunload: (this: this, ev: BeforeUnloadEvent) => any;
+ /**
+ * Fires when the object loses the input focus.
+ */
+ onblur: (this: this, ev: FocusEvent) => any;
+ onerror: (this: this, ev: ErrorEvent) => any;
+ /**
+ * Fires when the object receives focus.
+ */
+ onfocus: (this: this, ev: FocusEvent) => any;
+ onhashchange: (this: this, ev: HashChangeEvent) => any;
+ onload: (this: this, ev: Event) => any;
+ onmessage: (this: this, ev: MessageEvent) => any;
+ onoffline: (this: this, ev: Event) => any;
+ ononline: (this: this, ev: Event) => any;
+ onorientationchange: (this: this, ev: Event) => any;
+ onpagehide: (this: this, ev: PageTransitionEvent) => any;
+ onpageshow: (this: this, ev: PageTransitionEvent) => any;
+ onresize: (this: this, ev: UIEvent) => any;
+ onstorage: (this: this, ev: StorageEvent) => any;
+ onunload: (this: this, ev: Event) => any;
+ /**
+ * Sets or retrieves the frame heights of the object.
+ */
+ rows: string;
+ addEventListener(type: "MSContentZoom", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureChange", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureDoubleTap", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureEnd", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureHold", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureStart", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureTap", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGotPointerCapture", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSInertiaStart", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSLostPointerCapture", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSManipulationStateChanged", listener: (this: this, ev: MSManipulationEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerCancel", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerDown", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerEnter", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerLeave", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerMove", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerOut", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerOver", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerUp", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "abort", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "activate", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "ariarequest", listener: (this: this, ev: AriaRequestEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "beforeactivate", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "beforecopy", listener: (this: this, ev: ClipboardEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "beforecut", listener: (this: this, ev: ClipboardEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "beforedeactivate", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "beforepaste", listener: (this: this, ev: ClipboardEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "beforeprint", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "beforeunload", listener: (this: this, ev: BeforeUnloadEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "blur", listener: (this: this, ev: FocusEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "blur", listener: (this: this, ev: FocusEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "canplay", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "canplaythrough", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "change", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "click", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "command", listener: (this: this, ev: CommandEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "contextmenu", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "copy", listener: (this: this, ev: ClipboardEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "cuechange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "cut", listener: (this: this, ev: ClipboardEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dblclick", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "deactivate", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "drag", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dragend", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dragenter", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dragleave", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dragover", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dragstart", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "drop", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "durationchange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "emptied", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "ended", listener: (this: this, ev: MediaStreamErrorEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "error", listener: (this: this, ev: ErrorEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "error", listener: (this: this, ev: ErrorEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "focus", listener: (this: this, ev: FocusEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "focus", listener: (this: this, ev: FocusEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "gotpointercapture", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "hashchange", listener: (this: this, ev: HashChangeEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "input", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "invalid", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "keydown", listener: (this: this, ev: KeyboardEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "keypress", listener: (this: this, ev: KeyboardEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "keyup", listener: (this: this, ev: KeyboardEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "load", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "load", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "loadeddata", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "loadedmetadata", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "loadstart", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "lostpointercapture", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "message", listener: (this: this, ev: MessageEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mousedown", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mouseenter", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mouseleave", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mousemove", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mouseout", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mouseover", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mouseup", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mousewheel", listener: (this: this, ev: WheelEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "offline", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "online", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "orientationchange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "pagehide", listener: (this: this, ev: PageTransitionEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pageshow", listener: (this: this, ev: PageTransitionEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "paste", listener: (this: this, ev: ClipboardEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pause", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "play", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "playing", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointercancel", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerdown", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerenter", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerleave", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointermove", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerout", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerover", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerup", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "progress", listener: (this: this, ev: ProgressEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "ratechange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "reset", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "resize", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "scroll", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "seeked", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "seeking", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "select", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "selectstart", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "stalled", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "storage", listener: (this: this, ev: StorageEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "submit", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "suspend", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "timeupdate", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "touchcancel", listener: (this: this, ev: TouchEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "touchend", listener: (this: this, ev: TouchEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "touchmove", listener: (this: this, ev: TouchEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "touchstart", listener: (this: this, ev: TouchEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "unload", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "volumechange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "waiting", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "webkitfullscreenchange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "webkitfullscreenerror", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "wheel", listener: (this: this, ev: WheelEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var HTMLFrameSetElement: {
+ prototype: HTMLFrameSetElement;
+ new(): HTMLFrameSetElement;
+}
+
+interface HTMLHRElement extends HTMLElement, DOML2DeprecatedColorProperty, DOML2DeprecatedSizeProperty {
+ /**
+ * Sets or retrieves how the object is aligned with adjacent text.
+ */
+ align: string;
+ /**
+ * Sets or retrieves whether the horizontal rule is drawn with 3-D shading.
+ */
+ noShade: boolean;
+ /**
+ * Sets or retrieves the width of the object.
+ */
+ width: number;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var HTMLHRElement: {
+ prototype: HTMLHRElement;
+ new(): HTMLHRElement;
+}
+
+interface HTMLHeadElement extends HTMLElement {
+ profile: string;
+}
+
+declare var HTMLHeadElement: {
+ prototype: HTMLHeadElement;
+ new(): HTMLHeadElement;
+}
+
+interface HTMLHeadingElement extends HTMLElement {
+ /**
+ * Sets or retrieves a value that indicates the table alignment.
+ */
+ align: string;
+}
+
+declare var HTMLHeadingElement: {
+ prototype: HTMLHeadingElement;
+ new(): HTMLHeadingElement;
+}
+
+interface HTMLHtmlElement extends HTMLElement {
+ /**
+ * Sets or retrieves the DTD version that governs the current document.
+ */
+ version: string;
+}
+
+declare var HTMLHtmlElement: {
+ prototype: HTMLHtmlElement;
+ new(): HTMLHtmlElement;
+}
+
+interface HTMLIFrameElement extends HTMLElement, GetSVGDocument {
+ /**
+ * Sets or retrieves how the object is aligned with adjacent text.
+ */
+ align: string;
+ allowFullscreen: boolean;
+ /**
+ * Specifies the properties of a border drawn around an object.
+ */
+ border: string;
+ /**
+ * Retrieves the document object of the page or frame.
+ */
+ readonly contentDocument: Document;
+ /**
+ * Retrieves the object of the specified.
+ */
+ readonly contentWindow: Window;
+ /**
+ * Sets or retrieves whether to display a border for the frame.
+ */
+ frameBorder: string;
+ /**
+ * Sets or retrieves the amount of additional space between the frames.
+ */
+ frameSpacing: any;
+ /**
+ * Sets or retrieves the height of the object.
+ */
+ height: string;
+ /**
+ * Sets or retrieves the horizontal margin for the object.
+ */
+ hspace: number;
+ /**
+ * Sets or retrieves a URI to a long description of the object.
+ */
+ longDesc: string;
+ /**
+ * Sets or retrieves the top and bottom margin heights before displaying the text in a frame.
+ */
+ marginHeight: string;
+ /**
+ * Sets or retrieves the left and right margin widths before displaying the text in a frame.
+ */
+ marginWidth: string;
+ /**
+ * Sets or retrieves the frame name.
+ */
+ name: string;
+ /**
+ * Sets or retrieves whether the user can resize the frame.
+ */
+ noResize: boolean;
+ /**
+ * Raised when the object has been completely received from the server.
+ */
+ onload: (this: this, ev: Event) => any;
+ readonly sandbox: DOMSettableTokenList;
+ /**
+ * Sets or retrieves whether the frame can be scrolled.
+ */
+ scrolling: string;
+ /**
+ * Sets or retrieves a URL to be loaded by the object.
+ */
+ src: string;
+ /**
+ * Sets or retrieves the vertical margin for the object.
+ */
+ vspace: number;
+ /**
+ * Sets or retrieves the width of the object.
+ */
+ width: string;
+ addEventListener(type: "MSContentZoom", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureChange", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureDoubleTap", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureEnd", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureHold", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureStart", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureTap", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGotPointerCapture", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSInertiaStart", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSLostPointerCapture", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSManipulationStateChanged", listener: (this: this, ev: MSManipulationEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerCancel", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerDown", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerEnter", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerLeave", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerMove", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerOut", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerOver", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerUp", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "abort", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "activate", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "ariarequest", listener: (this: this, ev: AriaRequestEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "beforeactivate", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "beforecopy", listener: (this: this, ev: ClipboardEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "beforecut", listener: (this: this, ev: ClipboardEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "beforedeactivate", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "beforepaste", listener: (this: this, ev: ClipboardEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "blur", listener: (this: this, ev: FocusEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "canplay", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "canplaythrough", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "change", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "click", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "command", listener: (this: this, ev: CommandEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "contextmenu", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "copy", listener: (this: this, ev: ClipboardEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "cuechange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "cut", listener: (this: this, ev: ClipboardEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dblclick", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "deactivate", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "drag", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dragend", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dragenter", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dragleave", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dragover", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dragstart", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "drop", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "durationchange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "emptied", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "ended", listener: (this: this, ev: MediaStreamErrorEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "error", listener: (this: this, ev: ErrorEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "focus", listener: (this: this, ev: FocusEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "gotpointercapture", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "input", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "invalid", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "keydown", listener: (this: this, ev: KeyboardEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "keypress", listener: (this: this, ev: KeyboardEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "keyup", listener: (this: this, ev: KeyboardEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "load", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "load", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "loadeddata", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "loadedmetadata", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "loadstart", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "lostpointercapture", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mousedown", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mouseenter", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mouseleave", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mousemove", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mouseout", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mouseover", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mouseup", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mousewheel", listener: (this: this, ev: WheelEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "paste", listener: (this: this, ev: ClipboardEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pause", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "play", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "playing", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointercancel", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerdown", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerenter", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerleave", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointermove", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerout", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerover", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerup", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "progress", listener: (this: this, ev: ProgressEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "ratechange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "reset", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "scroll", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "seeked", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "seeking", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "select", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "selectstart", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "stalled", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "submit", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "suspend", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "timeupdate", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "touchcancel", listener: (this: this, ev: TouchEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "touchend", listener: (this: this, ev: TouchEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "touchmove", listener: (this: this, ev: TouchEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "touchstart", listener: (this: this, ev: TouchEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "volumechange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "waiting", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "webkitfullscreenchange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "webkitfullscreenerror", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "wheel", listener: (this: this, ev: WheelEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var HTMLIFrameElement: {
+ prototype: HTMLIFrameElement;
+ new(): HTMLIFrameElement;
+}
+
+interface HTMLImageElement extends HTMLElement {
+ /**
+ * Sets or retrieves how the object is aligned with adjacent text.
+ */
+ align: string;
+ /**
+ * Sets or retrieves a text alternative to the graphic.
+ */
+ alt: string;
+ /**
+ * Specifies the properties of a border drawn around an object.
+ */
+ border: string;
+ /**
+ * Retrieves whether the object is fully loaded.
+ */
+ readonly complete: boolean;
+ crossOrigin: string;
+ readonly currentSrc: string;
+ /**
+ * Sets or retrieves the height of the object.
+ */
+ height: number;
+ /**
+ * Sets or retrieves the width of the border to draw around the object.
+ */
+ hspace: number;
+ /**
+ * Sets or retrieves whether the image is a server-side image map.
+ */
+ isMap: boolean;
+ /**
+ * Sets or retrieves a Uniform Resource Identifier (URI) to a long description of the object.
+ */
+ longDesc: string;
+ lowsrc: string;
+ /**
+ * Gets or sets whether the DLNA PlayTo device is available.
+ */
+ msPlayToDisabled: boolean;
+ msPlayToPreferredSourceUri: string;
+ /**
+ * Gets or sets the primary DLNA PlayTo device.
+ */
+ msPlayToPrimary: boolean;
+ /**
+ * Gets the source associated with the media element for use by the PlayToManager.
+ */
+ readonly msPlayToSource: any;
+ /**
+ * Sets or retrieves the name of the object.
+ */
+ name: string;
+ /**
+ * The original height of the image resource before sizing.
+ */
+ readonly naturalHeight: number;
+ /**
+ * The original width of the image resource before sizing.
+ */
+ readonly naturalWidth: number;
+ sizes: string;
+ /**
+ * The address or URL of the a media resource that is to be considered.
+ */
+ src: string;
+ srcset: string;
+ /**
+ * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map.
+ */
+ useMap: string;
+ /**
+ * Sets or retrieves the vertical margin for the object.
+ */
+ vspace: number;
+ /**
+ * Sets or retrieves the width of the object.
+ */
+ width: number;
+ readonly x: number;
+ readonly y: number;
+ msGetAsCastingSource(): any;
+}
+
+declare var HTMLImageElement: {
+ prototype: HTMLImageElement;
+ new(): HTMLImageElement;
+ create(): HTMLImageElement;
+}
+
+interface HTMLInputElement extends HTMLElement {
+ /**
+ * Sets or retrieves a comma-separated list of content types.
+ */
+ accept: string;
+ /**
+ * Sets or retrieves how the object is aligned with adjacent text.
+ */
+ align: string;
+ /**
+ * Sets or retrieves a text alternative to the graphic.
+ */
+ alt: string;
+ /**
+ * Specifies whether autocomplete is applied to an editable text field.
+ */
+ autocomplete: string;
+ /**
+ * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing.
+ */
+ autofocus: boolean;
+ /**
+ * Sets or retrieves the width of the border to draw around the object.
+ */
+ border: string;
+ /**
+ * Sets or retrieves the state of the check box or radio button.
+ */
+ checked: boolean;
+ /**
+ * Retrieves whether the object is fully loaded.
+ */
+ readonly complete: boolean;
+ /**
+ * Sets or retrieves the state of the check box or radio button.
+ */
+ defaultChecked: boolean;
+ /**
+ * Sets or retrieves the initial contents of the object.
+ */
+ defaultValue: string;
+ disabled: boolean;
+ /**
+ * Returns a FileList object on a file type input object.
+ */
+ readonly files: FileList | null;
+ /**
+ * Retrieves a reference to the form that the object is embedded in.
+ */
+ readonly form: HTMLFormElement;
+ /**
+ * Overrides the action attribute (where the data on a form is sent) on the parent form element.
+ */
+ formAction: string;
+ /**
+ * Used to override the encoding (formEnctype attribute) specified on the form element.
+ */
+ formEnctype: string;
+ /**
+ * Overrides the submit method attribute previously specified on a form element.
+ */
+ formMethod: string;
+ /**
+ * Overrides any validation or required attributes on a form or form elements to allow it to be submitted without validation. This can be used to create a "save draft"-type submit option.
+ */
+ formNoValidate: string;
+ /**
+ * Overrides the target attribute on a form element.
+ */
+ formTarget: string;
+ /**
+ * Sets or retrieves the height of the object.
+ */
+ height: string;
+ /**
+ * Sets or retrieves the width of the border to draw around the object.
+ */
+ hspace: number;
+ indeterminate: boolean;
+ /**
+ * Specifies the ID of a pre-defined datalist of options for an input element.
+ */
+ readonly list: HTMLElement;
+ /**
+ * Defines the maximum acceptable value for an input element with type="number".When used with the min and step attributes, lets you control the range and increment (such as only even numbers) that the user can enter into an input field.
+ */
+ max: string;
+ /**
+ * Sets or retrieves the maximum number of characters that the user can enter in a text control.
+ */
+ maxLength: number;
+ /**
+ * Defines the minimum acceptable value for an input element with type="number". When used with the max and step attributes, lets you control the range and increment (such as even numbers only) that the user can enter into an input field.
+ */
+ min: string;
+ /**
+ * Sets or retrieves the Boolean value indicating whether multiple items can be selected from a list.
+ */
+ multiple: boolean;
+ /**
+ * Sets or retrieves the name of the object.
+ */
+ name: string;
+ /**
+ * Gets or sets a string containing a regular expression that the user's input must match.
+ */
+ pattern: string;
+ /**
+ * Gets or sets a text string that is displayed in an input field as a hint or prompt to users as the format or type of information they need to enter.The text appears in an input field until the user puts focus on the field.
+ */
+ placeholder: string;
+ readOnly: boolean;
+ /**
+ * When present, marks an element that can't be submitted without a value.
+ */
+ required: boolean;
+ selectionDirection: string;
+ /**
+ * Gets or sets the end position or offset of a text selection.
+ */
+ selectionEnd: number;
+ /**
+ * Gets or sets the starting position or offset of a text selection.
+ */
+ selectionStart: number;
+ size: number;
+ /**
+ * The address or URL of the a media resource that is to be considered.
+ */
+ src: string;
+ status: boolean;
+ /**
+ * Defines an increment or jump between values that you want to allow the user to enter. When used with the max and min attributes, lets you control the range and increment (for example, allow only even numbers) that the user can enter into an input field.
+ */
+ step: string;
+ /**
+ * Returns the content type of the object.
+ */
+ type: string;
+ /**
+ * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map.
+ */
+ useMap: string;
+ /**
+ * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting.
+ */
+ readonly validationMessage: string;
+ /**
+ * Returns a ValidityState object that represents the validity states of an element.
+ */
+ readonly validity: ValidityState;
+ /**
+ * Returns the value of the data at the cursor's current position.
+ */
+ value: string;
+ valueAsDate: Date;
+ /**
+ * Returns the input field value as a number.
+ */
+ valueAsNumber: number;
+ /**
+ * Sets or retrieves the vertical margin for the object.
+ */
+ vspace: number;
+ webkitdirectory: boolean;
+ /**
+ * Sets or retrieves the width of the object.
+ */
+ width: string;
+ /**
+ * Returns whether an element will successfully validate based on forms validation rules and constraints.
+ */
+ readonly willValidate: boolean;
+ minLength: number;
+ /**
+ * Returns whether a form will validate when it is submitted, without having to submit it.
+ */
+ checkValidity(): boolean;
+ /**
+ * Makes the selection equal to the current object.
+ */
+ select(): void;
+ /**
+ * Sets a custom error message that is displayed when a form is submitted.
+ * @param error Sets a custom error message that is displayed when a form is submitted.
+ */
+ setCustomValidity(error: string): void;
+ /**
+ * Sets the start and end positions of a selection in a text field.
+ * @param start The offset into the text field for the start of the selection.
+ * @param end The offset into the text field for the end of the selection.
+ */
+ setSelectionRange(start?: number, end?: number, direction?: string): void;
+ /**
+ * Decrements a range input control's value by the value given by the Step attribute. If the optional parameter is used, it will decrement the input control's step value multiplied by the parameter's value.
+ * @param n Value to decrement the value by.
+ */
+ stepDown(n?: number): void;
+ /**
+ * Increments a range input control's value by the value given by the Step attribute. If the optional parameter is used, will increment the input control's value by that value.
+ * @param n Value to increment the value by.
+ */
+ stepUp(n?: number): void;
+}
+
+declare var HTMLInputElement: {
+ prototype: HTMLInputElement;
+ new(): HTMLInputElement;
+}
+
+interface HTMLLIElement extends HTMLElement {
+ type: string;
+ /**
+ * Sets or retrieves the value of a list item.
+ */
+ value: number;
+}
+
+declare var HTMLLIElement: {
+ prototype: HTMLLIElement;
+ new(): HTMLLIElement;
+}
+
+interface HTMLLabelElement extends HTMLElement {
+ /**
+ * Retrieves a reference to the form that the object is embedded in.
+ */
+ readonly form: HTMLFormElement;
+ /**
+ * Sets or retrieves the object to which the given label object is assigned.
+ */
+ htmlFor: string;
+}
+
+declare var HTMLLabelElement: {
+ prototype: HTMLLabelElement;
+ new(): HTMLLabelElement;
+}
+
+interface HTMLLegendElement extends HTMLElement {
+ /**
+ * Retrieves a reference to the form that the object is embedded in.
+ */
+ align: string;
+ /**
+ * Retrieves a reference to the form that the object is embedded in.
+ */
+ readonly form: HTMLFormElement;
+}
+
+declare var HTMLLegendElement: {
+ prototype: HTMLLegendElement;
+ new(): HTMLLegendElement;
+}
+
+interface HTMLLinkElement extends HTMLElement, LinkStyle {
+ /**
+ * Sets or retrieves the character set used to encode the object.
+ */
+ charset: string;
+ disabled: boolean;
+ /**
+ * Sets or retrieves a destination URL or an anchor point.
+ */
+ href: string;
+ /**
+ * Sets or retrieves the language code of the object.
+ */
+ hreflang: string;
+ /**
+ * Sets or retrieves the media type.
+ */
+ media: string;
+ /**
+ * Sets or retrieves the relationship between the object and the destination of the link.
+ */
+ rel: string;
+ /**
+ * Sets or retrieves the relationship between the object and the destination of the link.
+ */
+ rev: string;
+ /**
+ * Sets or retrieves the window or frame at which to target content.
+ */
+ target: string;
+ /**
+ * Sets or retrieves the MIME type of the object.
+ */
+ type: string;
+ import?: Document;
+ integrity: string;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var HTMLLinkElement: {
+ prototype: HTMLLinkElement;
+ new(): HTMLLinkElement;
+}
+
+interface HTMLMapElement extends HTMLElement {
+ /**
+ * Retrieves a collection of the area objects defined for the given map object.
+ */
+ readonly areas: HTMLAreasCollection;
+ /**
+ * Sets or retrieves the name of the object.
+ */
+ name: string;
+}
+
+declare var HTMLMapElement: {
+ prototype: HTMLMapElement;
+ new(): HTMLMapElement;
+}
+
+interface HTMLMarqueeElement extends HTMLElement {
+ behavior: string;
+ bgColor: any;
+ direction: string;
+ height: string;
+ hspace: number;
+ loop: number;
+ onbounce: (this: this, ev: Event) => any;
+ onfinish: (this: this, ev: Event) => any;
+ onstart: (this: this, ev: Event) => any;
+ scrollAmount: number;
+ scrollDelay: number;
+ trueSpeed: boolean;
+ vspace: number;
+ width: string;
+ start(): void;
+ stop(): void;
+ addEventListener(type: "MSContentZoom", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureChange", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureDoubleTap", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureEnd", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureHold", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureStart", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureTap", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGotPointerCapture", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSInertiaStart", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSLostPointerCapture", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSManipulationStateChanged", listener: (this: this, ev: MSManipulationEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerCancel", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerDown", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerEnter", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerLeave", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerMove", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerOut", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerOver", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerUp", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "abort", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "activate", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "ariarequest", listener: (this: this, ev: AriaRequestEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "beforeactivate", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "beforecopy", listener: (this: this, ev: ClipboardEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "beforecut", listener: (this: this, ev: ClipboardEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "beforedeactivate", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "beforepaste", listener: (this: this, ev: ClipboardEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "blur", listener: (this: this, ev: FocusEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "bounce", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "canplay", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "canplaythrough", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "change", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "click", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "command", listener: (this: this, ev: CommandEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "contextmenu", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "copy", listener: (this: this, ev: ClipboardEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "cuechange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "cut", listener: (this: this, ev: ClipboardEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dblclick", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "deactivate", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "drag", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dragend", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dragenter", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dragleave", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dragover", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dragstart", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "drop", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "durationchange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "emptied", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "ended", listener: (this: this, ev: MediaStreamErrorEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "error", listener: (this: this, ev: ErrorEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "finish", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "focus", listener: (this: this, ev: FocusEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "gotpointercapture", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "input", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "invalid", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "keydown", listener: (this: this, ev: KeyboardEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "keypress", listener: (this: this, ev: KeyboardEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "keyup", listener: (this: this, ev: KeyboardEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "load", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "loadeddata", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "loadedmetadata", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "loadstart", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "lostpointercapture", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mousedown", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mouseenter", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mouseleave", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mousemove", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mouseout", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mouseover", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mouseup", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mousewheel", listener: (this: this, ev: WheelEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "paste", listener: (this: this, ev: ClipboardEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pause", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "play", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "playing", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointercancel", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerdown", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerenter", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerleave", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointermove", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerout", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerover", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerup", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "progress", listener: (this: this, ev: ProgressEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "ratechange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "reset", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "scroll", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "seeked", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "seeking", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "select", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "selectstart", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "stalled", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "start", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "submit", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "suspend", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "timeupdate", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "touchcancel", listener: (this: this, ev: TouchEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "touchend", listener: (this: this, ev: TouchEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "touchmove", listener: (this: this, ev: TouchEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "touchstart", listener: (this: this, ev: TouchEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "volumechange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "waiting", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "webkitfullscreenchange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "webkitfullscreenerror", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "wheel", listener: (this: this, ev: WheelEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var HTMLMarqueeElement: {
+ prototype: HTMLMarqueeElement;
+ new(): HTMLMarqueeElement;
+}
+
+interface HTMLMediaElement extends HTMLElement {
+ /**
+ * Returns an AudioTrackList object with the audio tracks for a given video element.
+ */
+ readonly audioTracks: AudioTrackList;
+ /**
+ * Gets or sets a value that indicates whether to start playing the media automatically.
+ */
+ autoplay: boolean;
+ /**
+ * Gets a collection of buffered time ranges.
+ */
+ readonly buffered: TimeRanges;
+ /**
+ * Gets or sets a flag that indicates whether the client provides a set of controls for the media (in case the developer does not include controls for the player).
+ */
+ controls: boolean;
+ crossOrigin: string;
+ /**
+ * Gets the address or URL of the current media resource that is selected by IHTMLMediaElement.
+ */
+ readonly currentSrc: string;
+ /**
+ * Gets or sets the current playback position, in seconds.
+ */
+ currentTime: number;
+ defaultMuted: boolean;
+ /**
+ * Gets or sets the default playback rate when the user is not using fast forward or reverse for a video or audio resource.
+ */
+ defaultPlaybackRate: number;
+ /**
+ * Returns the duration in seconds of the current media resource. A NaN value is returned if duration is not available, or Infinity if the media resource is streaming.
+ */
+ readonly duration: number;
+ /**
+ * Gets information about whether the playback has ended or not.
+ */
+ readonly ended: boolean;
+ /**
+ * Returns an object representing the current error state of the audio or video element.
+ */
+ readonly error: MediaError;
+ /**
+ * Gets or sets a flag to specify whether playback should restart after it completes.
+ */
+ loop: boolean;
+ readonly mediaKeys: MediaKeys | null;
+ /**
+ * Specifies the purpose of the audio or video media, such as background audio or alerts.
+ */
+ msAudioCategory: string;
+ /**
+ * Specifies the output device id that the audio will be sent to.
+ */
+ msAudioDeviceType: string;
+ readonly msGraphicsTrustStatus: MSGraphicsTrust;
+ /**
+ * Gets the MSMediaKeys object, which is used for decrypting media data, that is associated with this media element.
+ */
+ readonly msKeys: MSMediaKeys;
+ /**
+ * Gets or sets whether the DLNA PlayTo device is available.
+ */
+ msPlayToDisabled: boolean;
+ /**
+ * Gets or sets the path to the preferred media source. This enables the Play To target device to stream the media content, which can be DRM protected, from a different location, such as a cloud media server.
+ */
+ msPlayToPreferredSourceUri: string;
+ /**
+ * Gets or sets the primary DLNA PlayTo device.
+ */
+ msPlayToPrimary: boolean;
+ /**
+ * Gets the source associated with the media element for use by the PlayToManager.
+ */
+ readonly msPlayToSource: any;
+ /**
+ * Specifies whether or not to enable low-latency playback on the media element.
+ */
+ msRealTime: boolean;
+ /**
+ * Gets or sets a flag that indicates whether the audio (either audio or the audio track on video media) is muted.
+ */
+ muted: boolean;
+ /**
+ * Gets the current network activity for the element.
+ */
+ readonly networkState: number;
+ onencrypted: (this: this, ev: MediaEncryptedEvent) => any;
+ onmsneedkey: (this: this, ev: MSMediaKeyNeededEvent) => any;
+ /**
+ * Gets a flag that specifies whether playback is paused.
+ */
+ readonly paused: boolean;
+ /**
+ * Gets or sets the current rate of speed for the media resource to play. This speed is expressed as a multiple of the normal speed of the media resource.
+ */
+ playbackRate: number;
+ /**
+ * Gets TimeRanges for the current media resource that has been played.
+ */
+ readonly played: TimeRanges;
+ /**
+ * Gets or sets the current playback position, in seconds.
+ */
+ preload: string;
+ readyState: number;
+ /**
+ * Returns a TimeRanges object that represents the ranges of the current media resource that can be seeked.
+ */
+ readonly seekable: TimeRanges;
+ /**
+ * Gets a flag that indicates whether the the client is currently moving to a new playback position in the media resource.
+ */
+ readonly seeking: boolean;
+ /**
+ * The address or URL of the a media resource that is to be considered.
+ */
+ src: string;
+ srcObject: MediaStream | null;
+ readonly textTracks: TextTrackList;
+ readonly videoTracks: VideoTrackList;
+ /**
+ * Gets or sets the volume level for audio portions of the media element.
+ */
+ volume: number;
+ addTextTrack(kind: string, label?: string, language?: string): TextTrack;
+ /**
+ * Returns a string that specifies whether the client can play a given media resource type.
+ */
+ canPlayType(type: string): string;
+ /**
+ * Resets the audio or video object and loads a new media resource.
+ */
+ load(): void;
+ /**
+ * Clears all effects from the media pipeline.
+ */
+ msClearEffects(): void;
+ msGetAsCastingSource(): any;
+ /**
+ * Inserts the specified audio effect into media pipeline.
+ */
+ msInsertAudioEffect(activatableClassId: string, effectRequired: boolean, config?: any): void;
+ msSetMediaKeys(mediaKeys: MSMediaKeys): void;
+ /**
+ * Specifies the media protection manager for a given media pipeline.
+ */
+ msSetMediaProtectionManager(mediaProtectionManager?: any): void;
+ /**
+ * Pauses the current playback and sets paused to TRUE. This can be used to test whether the media is playing or paused. You can also use the pause or play events to tell whether the media is playing or not.
+ */
+ pause(): void;
+ /**
+ * Loads and starts playback of a media resource.
+ */
+ play(): void;
+ setMediaKeys(mediaKeys: MediaKeys | null): PromiseLike<void>;
+ readonly HAVE_CURRENT_DATA: number;
+ readonly HAVE_ENOUGH_DATA: number;
+ readonly HAVE_FUTURE_DATA: number;
+ readonly HAVE_METADATA: number;
+ readonly HAVE_NOTHING: number;
+ readonly NETWORK_EMPTY: number;
+ readonly NETWORK_IDLE: number;
+ readonly NETWORK_LOADING: number;
+ readonly NETWORK_NO_SOURCE: number;
+ addEventListener(type: "MSContentZoom", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureChange", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureDoubleTap", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureEnd", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureHold", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureStart", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureTap", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGotPointerCapture", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSInertiaStart", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSLostPointerCapture", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSManipulationStateChanged", listener: (this: this, ev: MSManipulationEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerCancel", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerDown", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerEnter", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerLeave", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerMove", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerOut", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerOver", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerUp", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "abort", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "activate", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "ariarequest", listener: (this: this, ev: AriaRequestEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "beforeactivate", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "beforecopy", listener: (this: this, ev: ClipboardEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "beforecut", listener: (this: this, ev: ClipboardEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "beforedeactivate", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "beforepaste", listener: (this: this, ev: ClipboardEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "blur", listener: (this: this, ev: FocusEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "canplay", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "canplaythrough", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "change", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "click", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "command", listener: (this: this, ev: CommandEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "contextmenu", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "copy", listener: (this: this, ev: ClipboardEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "cuechange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "cut", listener: (this: this, ev: ClipboardEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dblclick", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "deactivate", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "drag", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dragend", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dragenter", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dragleave", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dragover", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dragstart", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "drop", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "durationchange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "emptied", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "encrypted", listener: (this: this, ev: MediaEncryptedEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "ended", listener: (this: this, ev: MediaStreamErrorEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "error", listener: (this: this, ev: ErrorEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "focus", listener: (this: this, ev: FocusEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "gotpointercapture", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "input", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "invalid", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "keydown", listener: (this: this, ev: KeyboardEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "keypress", listener: (this: this, ev: KeyboardEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "keyup", listener: (this: this, ev: KeyboardEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "load", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "loadeddata", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "loadedmetadata", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "loadstart", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "lostpointercapture", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mousedown", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mouseenter", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mouseleave", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mousemove", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mouseout", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mouseover", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mouseup", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mousewheel", listener: (this: this, ev: WheelEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "msneedkey", listener: (this: this, ev: MSMediaKeyNeededEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "paste", listener: (this: this, ev: ClipboardEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pause", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "play", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "playing", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointercancel", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerdown", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerenter", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerleave", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointermove", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerout", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerover", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerup", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "progress", listener: (this: this, ev: ProgressEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "ratechange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "reset", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "scroll", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "seeked", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "seeking", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "select", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "selectstart", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "stalled", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "submit", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "suspend", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "timeupdate", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "touchcancel", listener: (this: this, ev: TouchEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "touchend", listener: (this: this, ev: TouchEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "touchmove", listener: (this: this, ev: TouchEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "touchstart", listener: (this: this, ev: TouchEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "volumechange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "waiting", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "webkitfullscreenchange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "webkitfullscreenerror", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "wheel", listener: (this: this, ev: WheelEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var HTMLMediaElement: {
+ prototype: HTMLMediaElement;
+ new(): HTMLMediaElement;
+ readonly HAVE_CURRENT_DATA: number;
+ readonly HAVE_ENOUGH_DATA: number;
+ readonly HAVE_FUTURE_DATA: number;
+ readonly HAVE_METADATA: number;
+ readonly HAVE_NOTHING: number;
+ readonly NETWORK_EMPTY: number;
+ readonly NETWORK_IDLE: number;
+ readonly NETWORK_LOADING: number;
+ readonly NETWORK_NO_SOURCE: number;
+}
+
+interface HTMLMenuElement extends HTMLElement {
+ compact: boolean;
+ type: string;
+}
+
+declare var HTMLMenuElement: {
+ prototype: HTMLMenuElement;
+ new(): HTMLMenuElement;
+}
+
+interface HTMLMetaElement extends HTMLElement {
+ /**
+ * Sets or retrieves the character set used to encode the object.
+ */
+ charset: string;
+ /**
+ * Gets or sets meta-information to associate with httpEquiv or name.
+ */
+ content: string;
+ /**
+ * Gets or sets information used to bind the value of a content attribute of a meta element to an HTTP response header.
+ */
+ httpEquiv: string;
+ /**
+ * Sets or retrieves the value specified in the content attribute of the meta object.
+ */
+ name: string;
+ /**
+ * Sets or retrieves a scheme to be used in interpreting the value of a property specified for the object.
+ */
+ scheme: string;
+ /**
+ * Sets or retrieves the URL property that will be loaded after the specified time has elapsed.
+ */
+ url: string;
+}
+
+declare var HTMLMetaElement: {
+ prototype: HTMLMetaElement;
+ new(): HTMLMetaElement;
+}
+
+interface HTMLMeterElement extends HTMLElement {
+ high: number;
+ low: number;
+ max: number;
+ min: number;
+ optimum: number;
+ value: number;
+}
+
+declare var HTMLMeterElement: {
+ prototype: HTMLMeterElement;
+ new(): HTMLMeterElement;
+}
+
+interface HTMLModElement extends HTMLElement {
+ /**
+ * Sets or retrieves reference information about the object.
+ */
+ cite: string;
+ /**
+ * Sets or retrieves the date and time of a modification to the object.
+ */
+ dateTime: string;
+}
+
+declare var HTMLModElement: {
+ prototype: HTMLModElement;
+ new(): HTMLModElement;
+}
+
+interface HTMLOListElement extends HTMLElement {
+ compact: boolean;
+ /**
+ * The starting number.
+ */
+ start: number;
+ type: string;
+}
+
+declare var HTMLOListElement: {
+ prototype: HTMLOListElement;
+ new(): HTMLOListElement;
+}
+
+interface HTMLObjectElement extends HTMLElement, GetSVGDocument {
+ /**
+ * Retrieves a string of the URL where the object tag can be found. This is often the href of the document that the object is in, or the value set by a base element.
+ */
+ readonly BaseHref: string;
+ align: string;
+ /**
+ * Sets or retrieves a text alternative to the graphic.
+ */
+ alt: string;
+ /**
+ * Gets or sets the optional alternative HTML script to execute if the object fails to load.
+ */
+ altHtml: string;
+ /**
+ * Sets or retrieves a character string that can be used to implement your own archive functionality for the object.
+ */
+ archive: string;
+ border: string;
+ /**
+ * Sets or retrieves the URL of the file containing the compiled Java class.
+ */
+ code: string;
+ /**
+ * Sets or retrieves the URL of the component.
+ */
+ codeBase: string;
+ /**
+ * Sets or retrieves the Internet media type for the code associated with the object.
+ */
+ codeType: string;
+ /**
+ * Retrieves the document object of the page or frame.
+ */
+ readonly contentDocument: Document;
+ /**
+ * Sets or retrieves the URL that references the data of the object.
+ */
+ data: string;
+ declare: boolean;
+ /**
+ * Retrieves a reference to the form that the object is embedded in.
+ */
+ readonly form: HTMLFormElement;
+ /**
+ * Sets or retrieves the height of the object.
+ */
+ height: string;
+ hspace: number;
+ /**
+ * Gets or sets whether the DLNA PlayTo device is available.
+ */
+ msPlayToDisabled: boolean;
+ /**
+ * Gets or sets the path to the preferred media source. This enables the Play To target device to stream the media content, which can be DRM protected, from a different location, such as a cloud media server.
+ */
+ msPlayToPreferredSourceUri: string;
+ /**
+ * Gets or sets the primary DLNA PlayTo device.
+ */
+ msPlayToPrimary: boolean;
+ /**
+ * Gets the source associated with the media element for use by the PlayToManager.
+ */
+ readonly msPlayToSource: any;
+ /**
+ * Sets or retrieves the name of the object.
+ */
+ name: string;
+ /**
+ * Retrieves the contained object.
+ */
+ readonly object: any;
+ readonly readyState: number;
+ /**
+ * Sets or retrieves a message to be displayed while an object is loading.
+ */
+ standby: string;
+ /**
+ * Sets or retrieves the MIME type of the object.
+ */
+ type: string;
+ /**
+ * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map.
+ */
+ useMap: string;
+ /**
+ * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting.
+ */
+ readonly validationMessage: string;
+ /**
+ * Returns a ValidityState object that represents the validity states of an element.
+ */
+ readonly validity: ValidityState;
+ vspace: number;
+ /**
+ * Sets or retrieves the width of the object.
+ */
+ width: string;
+ /**
+ * Returns whether an element will successfully validate based on forms validation rules and constraints.
+ */
+ readonly willValidate: boolean;
+ /**
+ * Returns whether a form will validate when it is submitted, without having to submit it.
+ */
+ checkValidity(): boolean;
+ /**
+ * Sets a custom error message that is displayed when a form is submitted.
+ * @param error Sets a custom error message that is displayed when a form is submitted.
+ */
+ setCustomValidity(error: string): void;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var HTMLObjectElement: {
+ prototype: HTMLObjectElement;
+ new(): HTMLObjectElement;
+}
+
+interface HTMLOptGroupElement extends HTMLElement {
+ /**
+ * Sets or retrieves the status of an option.
+ */
+ defaultSelected: boolean;
+ disabled: boolean;
+ /**
+ * Retrieves a reference to the form that the object is embedded in.
+ */
+ readonly form: HTMLFormElement;
+ /**
+ * Sets or retrieves the ordinal position of an option in a list box.
+ */
+ readonly index: number;
+ /**
+ * Sets or retrieves a value that you can use to implement your own label functionality for the object.
+ */
+ label: string;
+ /**
+ * Sets or retrieves whether the option in the list box is the default item.
+ */
+ selected: boolean;
+ /**
+ * Sets or retrieves the text string specified by the option tag.
+ */
+ readonly text: string;
+ /**
+ * Sets or retrieves the value which is returned to the server when the form control is submitted.
+ */
+ value: string;
+}
+
+declare var HTMLOptGroupElement: {
+ prototype: HTMLOptGroupElement;
+ new(): HTMLOptGroupElement;
+}
+
+interface HTMLOptionElement extends HTMLElement {
+ /**
+ * Sets or retrieves the status of an option.
+ */
+ defaultSelected: boolean;
+ disabled: boolean;
+ /**
+ * Retrieves a reference to the form that the object is embedded in.
+ */
+ readonly form: HTMLFormElement;
+ /**
+ * Sets or retrieves the ordinal position of an option in a list box.
+ */
+ readonly index: number;
+ /**
+ * Sets or retrieves a value that you can use to implement your own label functionality for the object.
+ */
+ label: string;
+ /**
+ * Sets or retrieves whether the option in the list box is the default item.
+ */
+ selected: boolean;
+ /**
+ * Sets or retrieves the text string specified by the option tag.
+ */
+ text: string;
+ /**
+ * Sets or retrieves the value which is returned to the server when the form control is submitted.
+ */
+ value: string;
+}
+
+declare var HTMLOptionElement: {
+ prototype: HTMLOptionElement;
+ new(): HTMLOptionElement;
+ create(): HTMLOptionElement;
+}
+
+interface HTMLOptionsCollection extends HTMLCollectionOf<HTMLOptionElement> {
+ length: number;
+ selectedIndex: number;
+ add(element: HTMLOptionElement | HTMLOptGroupElement, before?: HTMLElement | number): void;
+ remove(index: number): void;
+}
+
+declare var HTMLOptionsCollection: {
+ prototype: HTMLOptionsCollection;
+ new(): HTMLOptionsCollection;
+}
+
+interface HTMLParagraphElement extends HTMLElement {
+ /**
+ * Sets or retrieves how the object is aligned with adjacent text.
+ */
+ align: string;
+ clear: string;
+}
+
+declare var HTMLParagraphElement: {
+ prototype: HTMLParagraphElement;
+ new(): HTMLParagraphElement;
+}
+
+interface HTMLParamElement extends HTMLElement {
+ /**
+ * Sets or retrieves the name of an input parameter for an element.
+ */
+ name: string;
+ /**
+ * Sets or retrieves the content type of the resource designated by the value attribute.
+ */
+ type: string;
+ /**
+ * Sets or retrieves the value of an input parameter for an element.
+ */
+ value: string;
+ /**
+ * Sets or retrieves the data type of the value attribute.
+ */
+ valueType: string;
+}
+
+declare var HTMLParamElement: {
+ prototype: HTMLParamElement;
+ new(): HTMLParamElement;
+}
+
+interface HTMLPictureElement extends HTMLElement {
+}
+
+declare var HTMLPictureElement: {
+ prototype: HTMLPictureElement;
+ new(): HTMLPictureElement;
+}
+
+interface HTMLPreElement extends HTMLElement {
+ /**
+ * Sets or gets a value that you can use to implement your own width functionality for the object.
+ */
+ width: number;
+}
+
+declare var HTMLPreElement: {
+ prototype: HTMLPreElement;
+ new(): HTMLPreElement;
+}
+
+interface HTMLProgressElement extends HTMLElement {
+ /**
+ * Retrieves a reference to the form that the object is embedded in.
+ */
+ readonly form: HTMLFormElement;
+ /**
+ * Defines the maximum, or "done" value for a progress element.
+ */
+ max: number;
+ /**
+ * Returns the quotient of value/max when the value attribute is set (determinate progress bar), or -1 when the value attribute is missing (indeterminate progress bar).
+ */
+ readonly position: number;
+ /**
+ * Sets or gets the current value of a progress element. The value must be a non-negative number between 0 and the max value.
+ */
+ value: number;
+}
+
+declare var HTMLProgressElement: {
+ prototype: HTMLProgressElement;
+ new(): HTMLProgressElement;
+}
+
+interface HTMLQuoteElement extends HTMLElement {
+ /**
+ * Sets or retrieves reference information about the object.
+ */
+ cite: string;
+}
+
+declare var HTMLQuoteElement: {
+ prototype: HTMLQuoteElement;
+ new(): HTMLQuoteElement;
+}
+
+interface HTMLScriptElement extends HTMLElement {
+ async: boolean;
+ /**
+ * Sets or retrieves the character set used to encode the object.
+ */
+ charset: string;
+ /**
+ * Sets or retrieves the status of the script.
+ */
+ defer: boolean;
+ /**
+ * Sets or retrieves the event for which the script is written.
+ */
+ event: string;
+ /**
+ * Sets or retrieves the object that is bound to the event script.
+ */
+ htmlFor: string;
+ /**
+ * Retrieves the URL to an external file that contains the source code or data.
+ */
+ src: string;
+ /**
+ * Retrieves or sets the text of the object as a string.
+ */
+ text: string;
+ /**
+ * Sets or retrieves the MIME type for the associated scripting engine.
+ */
+ type: string;
+ integrity: string;
+}
+
+declare var HTMLScriptElement: {
+ prototype: HTMLScriptElement;
+ new(): HTMLScriptElement;
+}
+
+interface HTMLSelectElement extends HTMLElement {
+ /**
+ * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing.
+ */
+ autofocus: boolean;
+ disabled: boolean;
+ /**
+ * Retrieves a reference to the form that the object is embedded in.
+ */
+ readonly form: HTMLFormElement;
+ /**
+ * Sets or retrieves the number of objects in a collection.
+ */
+ length: number;
+ /**
+ * Sets or retrieves the Boolean value indicating whether multiple items can be selected from a list.
+ */
+ multiple: boolean;
+ /**
+ * Sets or retrieves the name of the object.
+ */
+ name: string;
+ readonly options: HTMLOptionsCollection;
+ /**
+ * When present, marks an element that can't be submitted without a value.
+ */
+ required: boolean;
+ /**
+ * Sets or retrieves the index of the selected option in a select object.
+ */
+ selectedIndex: number;
+ selectedOptions: HTMLCollectionOf<HTMLOptionElement>;
+ /**
+ * Sets or retrieves the number of rows in the list box.
+ */
+ size: number;
+ /**
+ * Retrieves the type of select control based on the value of the MULTIPLE attribute.
+ */
+ readonly type: string;
+ /**
+ * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting.
+ */
+ readonly validationMessage: string;
+ /**
+ * Returns a ValidityState object that represents the validity states of an element.
+ */
+ readonly validity: ValidityState;
+ /**
+ * Sets or retrieves the value which is returned to the server when the form control is submitted.
+ */
+ value: string;
+ /**
+ * Returns whether an element will successfully validate based on forms validation rules and constraints.
+ */
+ readonly willValidate: boolean;
+ /**
+ * Adds an element to the areas, controlRange, or options collection.
+ * @param element Variant of type Number that specifies the index position in the collection where the element is placed. If no value is given, the method places the element at the end of the collection.
+ * @param before Variant of type Object that specifies an element to insert before, or null to append the object to the collection.
+ */
+ add(element: HTMLElement, before?: HTMLElement | number): void;
+ /**
+ * Returns whether a form will validate when it is submitted, without having to submit it.
+ */
+ checkValidity(): boolean;
+ /**
+ * Retrieves a select object or an object from an options collection.
+ * @param name Variant of type Number or String that specifies the object or collection to retrieve. If this parameter is an integer, it is the zero-based index of the object. If this parameter is a string, all objects with matching name or id properties are retrieved, and a collection is returned if more than one match is made.
+ * @param index Variant of type Number that specifies the zero-based index of the object to retrieve when a collection is returned.
+ */
+ item(name?: any, index?: any): any;
+ /**
+ * Retrieves a select object or an object from an options collection.
+ * @param namedItem A String that specifies the name or id property of the object to retrieve. A collection is returned if more than one match is made.
+ */
+ namedItem(name: string): any;
+ /**
+ * Removes an element from the collection.
+ * @param index Number that specifies the zero-based index of the element to remove from the collection.
+ */
+ remove(index?: number): void;
+ /**
+ * Sets a custom error message that is displayed when a form is submitted.
+ * @param error Sets a custom error message that is displayed when a form is submitted.
+ */
+ setCustomValidity(error: string): void;
+ [name: string]: any;
+}
+
+declare var HTMLSelectElement: {
+ prototype: HTMLSelectElement;
+ new(): HTMLSelectElement;
+}
+
+interface HTMLSourceElement extends HTMLElement {
+ /**
+ * Gets or sets the intended media type of the media source.
+ */
+ media: string;
+ msKeySystem: string;
+ sizes: string;
+ /**
+ * The address or URL of the a media resource that is to be considered.
+ */
+ src: string;
+ srcset: string;
+ /**
+ * Gets or sets the MIME type of a media resource.
+ */
+ type: string;
+}
+
+declare var HTMLSourceElement: {
+ prototype: HTMLSourceElement;
+ new(): HTMLSourceElement;
+}
+
+interface HTMLSpanElement extends HTMLElement {
+}
+
+declare var HTMLSpanElement: {
+ prototype: HTMLSpanElement;
+ new(): HTMLSpanElement;
+}
+
+interface HTMLStyleElement extends HTMLElement, LinkStyle {
+ disabled: boolean;
+ /**
+ * Sets or retrieves the media type.
+ */
+ media: string;
+ /**
+ * Retrieves the CSS language in which the style sheet is written.
+ */
+ type: string;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var HTMLStyleElement: {
+ prototype: HTMLStyleElement;
+ new(): HTMLStyleElement;
+}
+
+interface HTMLTableCaptionElement extends HTMLElement {
+ /**
+ * Sets or retrieves the alignment of the caption or legend.
+ */
+ align: string;
+ /**
+ * Sets or retrieves whether the caption appears at the top or bottom of the table.
+ */
+ vAlign: string;
+}
+
+declare var HTMLTableCaptionElement: {
+ prototype: HTMLTableCaptionElement;
+ new(): HTMLTableCaptionElement;
+}
+
+interface HTMLTableCellElement extends HTMLElement, HTMLTableAlignment {
+ /**
+ * Sets or retrieves abbreviated text for the object.
+ */
+ abbr: string;
+ /**
+ * Sets or retrieves how the object is aligned with adjacent text.
+ */
+ align: string;
+ /**
+ * Sets or retrieves a comma-delimited list of conceptual categories associated with the object.
+ */
+ axis: string;
+ bgColor: any;
+ /**
+ * Retrieves the position of the object in the cells collection of a row.
+ */
+ readonly cellIndex: number;
+ /**
+ * Sets or retrieves the number columns in the table that the object should span.
+ */
+ colSpan: number;
+ /**
+ * Sets or retrieves a list of header cells that provide information for the object.
+ */
+ headers: string;
+ /**
+ * Sets or retrieves the height of the object.
+ */
+ height: any;
+ /**
+ * Sets or retrieves whether the browser automatically performs wordwrap.
+ */
+ noWrap: boolean;
+ /**
+ * Sets or retrieves how many rows in a table the cell should span.
+ */
+ rowSpan: number;
+ /**
+ * Sets or retrieves the group of cells in a table to which the object's information applies.
+ */
+ scope: string;
+ /**
+ * Sets or retrieves the width of the object.
+ */
+ width: string;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var HTMLTableCellElement: {
+ prototype: HTMLTableCellElement;
+ new(): HTMLTableCellElement;
+}
+
+interface HTMLTableColElement extends HTMLElement, HTMLTableAlignment {
+ /**
+ * Sets or retrieves the alignment of the object relative to the display or table.
+ */
+ align: string;
+ /**
+ * Sets or retrieves the number of columns in the group.
+ */
+ span: number;
+ /**
+ * Sets or retrieves the width of the object.
+ */
+ width: any;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var HTMLTableColElement: {
+ prototype: HTMLTableColElement;
+ new(): HTMLTableColElement;
+}
+
+interface HTMLTableDataCellElement extends HTMLTableCellElement {
+}
+
+declare var HTMLTableDataCellElement: {
+ prototype: HTMLTableDataCellElement;
+ new(): HTMLTableDataCellElement;
+}
+
+interface HTMLTableElement extends HTMLElement {
+ /**
+ * Sets or retrieves a value that indicates the table alignment.
+ */
+ align: string;
+ bgColor: any;
+ /**
+ * Sets or retrieves the width of the border to draw around the object.
+ */
+ border: string;
+ /**
+ * Sets or retrieves the border color of the object.
+ */
+ borderColor: any;
+ /**
+ * Retrieves the caption object of a table.
+ */
+ caption: HTMLTableCaptionElement;
+ /**
+ * Sets or retrieves the amount of space between the border of the cell and the content of the cell.
+ */
+ cellPadding: string;
+ /**
+ * Sets or retrieves the amount of space between cells in a table.
+ */
+ cellSpacing: string;
+ /**
+ * Sets or retrieves the number of columns in the table.
+ */
+ cols: number;
+ /**
+ * Sets or retrieves the way the border frame around the table is displayed.
+ */
+ frame: string;
+ /**
+ * Sets or retrieves the height of the object.
+ */
+ height: any;
+ /**
+ * Sets or retrieves the number of horizontal rows contained in the object.
+ */
+ rows: HTMLCollectionOf<HTMLTableRowElement>;
+ /**
+ * Sets or retrieves which dividing lines (inner borders) are displayed.
+ */
+ rules: string;
+ /**
+ * Sets or retrieves a description and/or structure of the object.
+ */
+ summary: string;
+ /**
+ * Retrieves a collection of all tBody objects in the table. Objects in this collection are in source order.
+ */
+ tBodies: HTMLCollectionOf<HTMLTableSectionElement>;
+ /**
+ * Retrieves the tFoot object of the table.
+ */
+ tFoot: HTMLTableSectionElement;
+ /**
+ * Retrieves the tHead object of the table.
+ */
+ tHead: HTMLTableSectionElement;
+ /**
+ * Sets or retrieves the width of the object.
+ */
+ width: string;
+ /**
+ * Creates an empty caption element in the table.
+ */
+ createCaption(): HTMLTableCaptionElement;
+ /**
+ * Creates an empty tBody element in the table.
+ */
+ createTBody(): HTMLTableSectionElement;
+ /**
+ * Creates an empty tFoot element in the table.
+ */
+ createTFoot(): HTMLTableSectionElement;
+ /**
+ * Returns the tHead element object if successful, or null otherwise.
+ */
+ createTHead(): HTMLTableSectionElement;
+ /**
+ * Deletes the caption element and its contents from the table.
+ */
+ deleteCaption(): void;
+ /**
+ * Removes the specified row (tr) from the element and from the rows collection.
+ * @param index Number that specifies the zero-based position in the rows collection of the row to remove.
+ */
+ deleteRow(index?: number): void;
+ /**
+ * Deletes the tFoot element and its contents from the table.
+ */
+ deleteTFoot(): void;
+ /**
+ * Deletes the tHead element and its contents from the table.
+ */
+ deleteTHead(): void;
+ /**
+ * Creates a new row (tr) in the table, and adds the row to the rows collection.
+ * @param index Number that specifies where to insert the row in the rows collection. The default value is -1, which appends the new row to the end of the rows collection.
+ */
+ insertRow(index?: number): HTMLTableRowElement;
+}
+
+declare var HTMLTableElement: {
+ prototype: HTMLTableElement;
+ new(): HTMLTableElement;
+}
+
+interface HTMLTableHeaderCellElement extends HTMLTableCellElement {
+ /**
+ * Sets or retrieves the group of cells in a table to which the object's information applies.
+ */
+ scope: string;
+}
+
+declare var HTMLTableHeaderCellElement: {
+ prototype: HTMLTableHeaderCellElement;
+ new(): HTMLTableHeaderCellElement;
+}
+
+interface HTMLTableRowElement extends HTMLElement, HTMLTableAlignment {
+ /**
+ * Sets or retrieves how the object is aligned with adjacent text.
+ */
+ align: string;
+ bgColor: any;
+ /**
+ * Retrieves a collection of all cells in the table row.
+ */
+ cells: HTMLCollectionOf<HTMLTableDataCellElement | HTMLTableHeaderCellElement>;
+ /**
+ * Sets or retrieves the height of the object.
+ */
+ height: any;
+ /**
+ * Retrieves the position of the object in the rows collection for the table.
+ */
+ readonly rowIndex: number;
+ /**
+ * Retrieves the position of the object in the collection.
+ */
+ readonly sectionRowIndex: number;
+ /**
+ * Removes the specified cell from the table row, as well as from the cells collection.
+ * @param index Number that specifies the zero-based position of the cell to remove from the table row. If no value is provided, the last cell in the cells collection is deleted.
+ */
+ deleteCell(index?: number): void;
+ /**
+ * Creates a new cell in the table row, and adds the cell to the cells collection.
+ * @param index Number that specifies where to insert the cell in the tr. The default value is -1, which appends the new cell to the end of the cells collection.
+ */
+ insertCell(index?: number): HTMLTableDataCellElement;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var HTMLTableRowElement: {
+ prototype: HTMLTableRowElement;
+ new(): HTMLTableRowElement;
+}
+
+interface HTMLTableSectionElement extends HTMLElement, HTMLTableAlignment {
+ /**
+ * Sets or retrieves a value that indicates the table alignment.
+ */
+ align: string;
+ /**
+ * Sets or retrieves the number of horizontal rows contained in the object.
+ */
+ rows: HTMLCollectionOf<HTMLTableRowElement>;
+ /**
+ * Removes the specified row (tr) from the element and from the rows collection.
+ * @param index Number that specifies the zero-based position in the rows collection of the row to remove.
+ */
+ deleteRow(index?: number): void;
+ /**
+ * Creates a new row (tr) in the table, and adds the row to the rows collection.
+ * @param index Number that specifies where to insert the row in the rows collection. The default value is -1, which appends the new row to the end of the rows collection.
+ */
+ insertRow(index?: number): HTMLTableRowElement;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var HTMLTableSectionElement: {
+ prototype: HTMLTableSectionElement;
+ new(): HTMLTableSectionElement;
+}
+
+interface HTMLTemplateElement extends HTMLElement {
+ readonly content: DocumentFragment;
+}
+
+declare var HTMLTemplateElement: {
+ prototype: HTMLTemplateElement;
+ new(): HTMLTemplateElement;
+}
+
+interface HTMLTextAreaElement extends HTMLElement {
+ /**
+ * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing.
+ */
+ autofocus: boolean;
+ /**
+ * Sets or retrieves the width of the object.
+ */
+ cols: number;
+ /**
+ * Sets or retrieves the initial contents of the object.
+ */
+ defaultValue: string;
+ disabled: boolean;
+ /**
+ * Retrieves a reference to the form that the object is embedded in.
+ */
+ readonly form: HTMLFormElement;
+ /**
+ * Sets or retrieves the maximum number of characters that the user can enter in a text control.
+ */
+ maxLength: number;
+ /**
+ * Sets or retrieves the name of the object.
+ */
+ name: string;
+ /**
+ * Gets or sets a text string that is displayed in an input field as a hint or prompt to users as the format or type of information they need to enter.The text appears in an input field until the user puts focus on the field.
+ */
+ placeholder: string;
+ /**
+ * Sets or retrieves the value indicated whether the content of the object is read-only.
+ */
+ readOnly: boolean;
+ /**
+ * When present, marks an element that can't be submitted without a value.
+ */
+ required: boolean;
+ /**
+ * Sets or retrieves the number of horizontal rows contained in the object.
+ */
+ rows: number;
+ /**
+ * Gets or sets the end position or offset of a text selection.
+ */
+ selectionEnd: number;
+ /**
+ * Gets or sets the starting position or offset of a text selection.
+ */
+ selectionStart: number;
+ /**
+ * Sets or retrieves the value indicating whether the control is selected.
+ */
+ status: any;
+ /**
+ * Retrieves the type of control.
+ */
+ readonly type: string;
+ /**
+ * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting.
+ */
+ readonly validationMessage: string;
+ /**
+ * Returns a ValidityState object that represents the validity states of an element.
+ */
+ readonly validity: ValidityState;
+ /**
+ * Retrieves or sets the text in the entry field of the textArea element.
+ */
+ value: string;
+ /**
+ * Returns whether an element will successfully validate based on forms validation rules and constraints.
+ */
+ readonly willValidate: boolean;
+ /**
+ * Sets or retrieves how to handle wordwrapping in the object.
+ */
+ wrap: string;
+ minLength: number;
+ /**
+ * Returns whether a form will validate when it is submitted, without having to submit it.
+ */
+ checkValidity(): boolean;
+ /**
+ * Highlights the input area of a form element.
+ */
+ select(): void;
+ /**
+ * Sets a custom error message that is displayed when a form is submitted.
+ * @param error Sets a custom error message that is displayed when a form is submitted.
+ */
+ setCustomValidity(error: string): void;
+ /**
+ * Sets the start and end positions of a selection in a text field.
+ * @param start The offset into the text field for the start of the selection.
+ * @param end The offset into the text field for the end of the selection.
+ */
+ setSelectionRange(start: number, end: number): void;
+}
+
+declare var HTMLTextAreaElement: {
+ prototype: HTMLTextAreaElement;
+ new(): HTMLTextAreaElement;
+}
+
+interface HTMLTitleElement extends HTMLElement {
+ /**
+ * Retrieves or sets the text of the object as a string.
+ */
+ text: string;
+}
+
+declare var HTMLTitleElement: {
+ prototype: HTMLTitleElement;
+ new(): HTMLTitleElement;
+}
+
+interface HTMLTrackElement extends HTMLElement {
+ default: boolean;
+ kind: string;
+ label: string;
+ readonly readyState: number;
+ src: string;
+ srclang: string;
+ readonly track: TextTrack;
+ readonly ERROR: number;
+ readonly LOADED: number;
+ readonly LOADING: number;
+ readonly NONE: number;
+}
+
+declare var HTMLTrackElement: {
+ prototype: HTMLTrackElement;
+ new(): HTMLTrackElement;
+ readonly ERROR: number;
+ readonly LOADED: number;
+ readonly LOADING: number;
+ readonly NONE: number;
+}
+
+interface HTMLUListElement extends HTMLElement {
+ compact: boolean;
+ type: string;
+}
+
+declare var HTMLUListElement: {
+ prototype: HTMLUListElement;
+ new(): HTMLUListElement;
+}
+
+interface HTMLUnknownElement extends HTMLElement {
+}
+
+declare var HTMLUnknownElement: {
+ prototype: HTMLUnknownElement;
+ new(): HTMLUnknownElement;
+}
+
+interface HTMLVideoElement extends HTMLMediaElement {
+ /**
+ * Gets or sets the height of the video element.
+ */
+ height: number;
+ msHorizontalMirror: boolean;
+ readonly msIsLayoutOptimalForPlayback: boolean;
+ readonly msIsStereo3D: boolean;
+ msStereo3DPackingMode: string;
+ msStereo3DRenderMode: string;
+ msZoom: boolean;
+ onMSVideoFormatChanged: (this: this, ev: Event) => any;
+ onMSVideoFrameStepCompleted: (this: this, ev: Event) => any;
+ onMSVideoOptimalLayoutChanged: (this: this, ev: Event) => any;
+ /**
+ * Gets or sets a URL of an image to display, for example, like a movie poster. This can be a still frame from the video, or another image if no video data is available.
+ */
+ poster: string;
+ /**
+ * Gets the intrinsic height of a video in CSS pixels, or zero if the dimensions are not known.
+ */
+ readonly videoHeight: number;
+ /**
+ * Gets the intrinsic width of a video in CSS pixels, or zero if the dimensions are not known.
+ */
+ readonly videoWidth: number;
+ readonly webkitDisplayingFullscreen: boolean;
+ readonly webkitSupportsFullscreen: boolean;
+ /**
+ * Gets or sets the width of the video element.
+ */
+ width: number;
+ getVideoPlaybackQuality(): VideoPlaybackQuality;
+ msFrameStep(forward: boolean): void;
+ msInsertVideoEffect(activatableClassId: string, effectRequired: boolean, config?: any): void;
+ msSetVideoRectangle(left: number, top: number, right: number, bottom: number): void;
+ webkitEnterFullScreen(): void;
+ webkitEnterFullscreen(): void;
+ webkitExitFullScreen(): void;
+ webkitExitFullscreen(): void;
+ addEventListener(type: "MSContentZoom", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureChange", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureDoubleTap", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureEnd", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureHold", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureStart", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureTap", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGotPointerCapture", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSInertiaStart", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSLostPointerCapture", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSManipulationStateChanged", listener: (this: this, ev: MSManipulationEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerCancel", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerDown", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerEnter", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerLeave", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerMove", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerOut", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerOver", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerUp", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSVideoFormatChanged", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSVideoFrameStepCompleted", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSVideoOptimalLayoutChanged", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "abort", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "activate", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "ariarequest", listener: (this: this, ev: AriaRequestEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "beforeactivate", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "beforecopy", listener: (this: this, ev: ClipboardEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "beforecut", listener: (this: this, ev: ClipboardEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "beforedeactivate", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "beforepaste", listener: (this: this, ev: ClipboardEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "blur", listener: (this: this, ev: FocusEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "canplay", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "canplaythrough", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "change", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "click", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "command", listener: (this: this, ev: CommandEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "contextmenu", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "copy", listener: (this: this, ev: ClipboardEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "cuechange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "cut", listener: (this: this, ev: ClipboardEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dblclick", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "deactivate", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "drag", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dragend", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dragenter", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dragleave", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dragover", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dragstart", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "drop", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "durationchange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "emptied", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "encrypted", listener: (this: this, ev: MediaEncryptedEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "ended", listener: (this: this, ev: MediaStreamErrorEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "error", listener: (this: this, ev: ErrorEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "focus", listener: (this: this, ev: FocusEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "gotpointercapture", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "input", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "invalid", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "keydown", listener: (this: this, ev: KeyboardEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "keypress", listener: (this: this, ev: KeyboardEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "keyup", listener: (this: this, ev: KeyboardEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "load", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "loadeddata", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "loadedmetadata", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "loadstart", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "lostpointercapture", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mousedown", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mouseenter", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mouseleave", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mousemove", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mouseout", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mouseover", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mouseup", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mousewheel", listener: (this: this, ev: WheelEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "msneedkey", listener: (this: this, ev: MSMediaKeyNeededEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "paste", listener: (this: this, ev: ClipboardEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pause", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "play", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "playing", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointercancel", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerdown", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerenter", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerleave", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointermove", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerout", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerover", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerup", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "progress", listener: (this: this, ev: ProgressEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "ratechange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "reset", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "scroll", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "seeked", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "seeking", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "select", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "selectstart", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "stalled", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "submit", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "suspend", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "timeupdate", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "touchcancel", listener: (this: this, ev: TouchEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "touchend", listener: (this: this, ev: TouchEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "touchmove", listener: (this: this, ev: TouchEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "touchstart", listener: (this: this, ev: TouchEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "volumechange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "waiting", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "webkitfullscreenchange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "webkitfullscreenerror", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "wheel", listener: (this: this, ev: WheelEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var HTMLVideoElement: {
+ prototype: HTMLVideoElement;
+ new(): HTMLVideoElement;
+}
+
+interface HashChangeEvent extends Event {
+ readonly newURL: string | null;
+ readonly oldURL: string | null;
+}
+
+declare var HashChangeEvent: {
+ prototype: HashChangeEvent;
+ new(type: string, eventInitDict?: HashChangeEventInit): HashChangeEvent;
+}
+
+interface History {
+ readonly length: number;
+ readonly state: any;
+ back(distance?: any): void;
+ forward(distance?: any): void;
+ go(delta?: any): void;
+ pushState(statedata: any, title?: string, url?: string): void;
+ replaceState(statedata: any, title?: string, url?: string): void;
+}
+
+declare var History: {
+ prototype: History;
+ new(): History;
+}
+
+interface IDBCursor {
+ readonly direction: string;
+ key: IDBKeyRange | IDBValidKey;
+ readonly primaryKey: any;
+ source: IDBObjectStore | IDBIndex;
+ advance(count: number): void;
+ continue(key?: IDBKeyRange | IDBValidKey): void;
+ delete(): IDBRequest;
+ update(value: any): IDBRequest;
+ readonly NEXT: string;
+ readonly NEXT_NO_DUPLICATE: string;
+ readonly PREV: string;
+ readonly PREV_NO_DUPLICATE: string;
+}
+
+declare var IDBCursor: {
+ prototype: IDBCursor;
+ new(): IDBCursor;
+ readonly NEXT: string;
+ readonly NEXT_NO_DUPLICATE: string;
+ readonly PREV: string;
+ readonly PREV_NO_DUPLICATE: string;
+}
+
+interface IDBCursorWithValue extends IDBCursor {
+ readonly value: any;
+}
+
+declare var IDBCursorWithValue: {
+ prototype: IDBCursorWithValue;
+ new(): IDBCursorWithValue;
+}
+
+interface IDBDatabase extends EventTarget {
+ readonly name: string;
+ readonly objectStoreNames: DOMStringList;
+ onabort: (this: this, ev: Event) => any;
+ onerror: (this: this, ev: ErrorEvent) => any;
+ version: number;
+ onversionchange: (ev: IDBVersionChangeEvent) => any;
+ close(): void;
+ createObjectStore(name: string, optionalParameters?: IDBObjectStoreParameters): IDBObjectStore;
+ deleteObjectStore(name: string): void;
+ transaction(storeNames: string | string[], mode?: string): IDBTransaction;
+ addEventListener(type: "versionchange", listener: (ev: IDBVersionChangeEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "abort", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "error", listener: (this: this, ev: ErrorEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var IDBDatabase: {
+ prototype: IDBDatabase;
+ new(): IDBDatabase;
+}
+
+interface IDBFactory {
+ cmp(first: any, second: any): number;
+ deleteDatabase(name: string): IDBOpenDBRequest;
+ open(name: string, version?: number): IDBOpenDBRequest;
+}
+
+declare var IDBFactory: {
+ prototype: IDBFactory;
+ new(): IDBFactory;
+}
+
+interface IDBIndex {
+ keyPath: string | string[];
+ readonly name: string;
+ readonly objectStore: IDBObjectStore;
+ readonly unique: boolean;
+ multiEntry: boolean;
+ count(key?: IDBKeyRange | IDBValidKey): IDBRequest;
+ get(key: IDBKeyRange | IDBValidKey): IDBRequest;
+ getKey(key: IDBKeyRange | IDBValidKey): IDBRequest;
+ openCursor(range?: IDBKeyRange | IDBValidKey, direction?: string): IDBRequest;
+ openKeyCursor(range?: IDBKeyRange | IDBValidKey, direction?: string): IDBRequest;
+}
+
+declare var IDBIndex: {
+ prototype: IDBIndex;
+ new(): IDBIndex;
+}
+
+interface IDBKeyRange {
+ readonly lower: any;
+ readonly lowerOpen: boolean;
+ readonly upper: any;
+ readonly upperOpen: boolean;
+}
+
+declare var IDBKeyRange: {
+ prototype: IDBKeyRange;
+ new(): IDBKeyRange;
+ bound(lower: any, upper: any, lowerOpen?: boolean, upperOpen?: boolean): IDBKeyRange;
+ lowerBound(lower: any, open?: boolean): IDBKeyRange;
+ only(value: any): IDBKeyRange;
+ upperBound(upper: any, open?: boolean): IDBKeyRange;
+}
+
+interface IDBObjectStore {
+ readonly indexNames: DOMStringList;
+ keyPath: string | string[];
+ readonly name: string;
+ readonly transaction: IDBTransaction;
+ autoIncrement: boolean;
+ add(value: any, key?: IDBKeyRange | IDBValidKey): IDBRequest;
+ clear(): IDBRequest;
+ count(key?: IDBKeyRange | IDBValidKey): IDBRequest;
+ createIndex(name: string, keyPath: string | string[], optionalParameters?: IDBIndexParameters): IDBIndex;
+ delete(key: IDBKeyRange | IDBValidKey): IDBRequest;
+ deleteIndex(indexName: string): void;
+ get(key: any): IDBRequest;
+ index(name: string): IDBIndex;
+ openCursor(range?: IDBKeyRange | IDBValidKey, direction?: string): IDBRequest;
+ put(value: any, key?: IDBKeyRange | IDBValidKey): IDBRequest;
+}
+
+declare var IDBObjectStore: {
+ prototype: IDBObjectStore;
+ new(): IDBObjectStore;
+}
+
+interface IDBOpenDBRequest extends IDBRequest {
+ onblocked: (this: this, ev: Event) => any;
+ onupgradeneeded: (this: this, ev: IDBVersionChangeEvent) => any;
+ addEventListener(type: "blocked", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "error", listener: (this: this, ev: ErrorEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "success", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "upgradeneeded", listener: (this: this, ev: IDBVersionChangeEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var IDBOpenDBRequest: {
+ prototype: IDBOpenDBRequest;
+ new(): IDBOpenDBRequest;
+}
+
+interface IDBRequest extends EventTarget {
+ readonly error: DOMError;
+ onerror: (this: this, ev: ErrorEvent) => any;
+ onsuccess: (this: this, ev: Event) => any;
+ readonly readyState: string;
+ readonly result: any;
+ source: IDBObjectStore | IDBIndex | IDBCursor;
+ readonly transaction: IDBTransaction;
+ addEventListener(type: "error", listener: (this: this, ev: ErrorEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "success", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var IDBRequest: {
+ prototype: IDBRequest;
+ new(): IDBRequest;
+}
+
+interface IDBTransaction extends EventTarget {
+ readonly db: IDBDatabase;
+ readonly error: DOMError;
+ readonly mode: string;
+ onabort: (this: this, ev: Event) => any;
+ oncomplete: (this: this, ev: Event) => any;
+ onerror: (this: this, ev: ErrorEvent) => any;
+ abort(): void;
+ objectStore(name: string): IDBObjectStore;
+ readonly READ_ONLY: string;
+ readonly READ_WRITE: string;
+ readonly VERSION_CHANGE: string;
+ addEventListener(type: "abort", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "complete", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "error", listener: (this: this, ev: ErrorEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var IDBTransaction: {
+ prototype: IDBTransaction;
+ new(): IDBTransaction;
+ readonly READ_ONLY: string;
+ readonly READ_WRITE: string;
+ readonly VERSION_CHANGE: string;
+}
+
+interface IDBVersionChangeEvent extends Event {
+ readonly newVersion: number | null;
+ readonly oldVersion: number;
+}
+
+declare var IDBVersionChangeEvent: {
+ prototype: IDBVersionChangeEvent;
+ new(): IDBVersionChangeEvent;
+}
+
+interface ImageData {
+ data: Uint8ClampedArray;
+ readonly height: number;
+ readonly width: number;
+}
+
+declare var ImageData: {
+ prototype: ImageData;
+ new(width: number, height: number): ImageData;
+ new(array: Uint8ClampedArray, width: number, height: number): ImageData;
+}
+
+interface KeyboardEvent extends UIEvent {
+ readonly altKey: boolean;
+ readonly char: string | null;
+ readonly charCode: number;
+ readonly ctrlKey: boolean;
+ readonly key: string;
+ readonly keyCode: number;
+ readonly locale: string;
+ readonly location: number;
+ readonly metaKey: boolean;
+ readonly repeat: boolean;
+ readonly shiftKey: boolean;
+ readonly which: number;
+ readonly code: string;
+ getModifierState(keyArg: string): boolean;
+ initKeyboardEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, keyArg: string, locationArg: number, modifiersListArg: string, repeat: boolean, locale: string): void;
+ readonly DOM_KEY_LOCATION_JOYSTICK: number;
+ readonly DOM_KEY_LOCATION_LEFT: number;
+ readonly DOM_KEY_LOCATION_MOBILE: number;
+ readonly DOM_KEY_LOCATION_NUMPAD: number;
+ readonly DOM_KEY_LOCATION_RIGHT: number;
+ readonly DOM_KEY_LOCATION_STANDARD: number;
+}
+
+declare var KeyboardEvent: {
+ prototype: KeyboardEvent;
+ new(typeArg: string, eventInitDict?: KeyboardEventInit): KeyboardEvent;
+ readonly DOM_KEY_LOCATION_JOYSTICK: number;
+ readonly DOM_KEY_LOCATION_LEFT: number;
+ readonly DOM_KEY_LOCATION_MOBILE: number;
+ readonly DOM_KEY_LOCATION_NUMPAD: number;
+ readonly DOM_KEY_LOCATION_RIGHT: number;
+ readonly DOM_KEY_LOCATION_STANDARD: number;
+}
+
+interface ListeningStateChangedEvent extends Event {
+ readonly label: string;
+ readonly state: string;
+}
+
+declare var ListeningStateChangedEvent: {
+ prototype: ListeningStateChangedEvent;
+ new(): ListeningStateChangedEvent;
+}
+
+interface Location {
+ hash: string;
+ host: string;
+ hostname: string;
+ href: string;
+ readonly origin: string;
+ pathname: string;
+ port: string;
+ protocol: string;
+ search: string;
+ assign(url: string): void;
+ reload(forcedReload?: boolean): void;
+ replace(url: string): void;
+ toString(): string;
+}
+
+declare var Location: {
+ prototype: Location;
+ new(): Location;
+}
+
+interface LongRunningScriptDetectedEvent extends Event {
+ readonly executionTime: number;
+ stopPageScriptExecution: boolean;
+}
+
+declare var LongRunningScriptDetectedEvent: {
+ prototype: LongRunningScriptDetectedEvent;
+ new(): LongRunningScriptDetectedEvent;
+}
+
+interface MSApp {
+ clearTemporaryWebDataAsync(): MSAppAsyncOperation;
+ createBlobFromRandomAccessStream(type: string, seeker: any): Blob;
+ createDataPackage(object: any): any;
+ createDataPackageFromSelection(): any;
+ createFileFromStorageFile(storageFile: any): File;
+ createStreamFromInputStream(type: string, inputStream: any): MSStream;
+ execAsyncAtPriority(asynchronousCallback: MSExecAtPriorityFunctionCallback, priority: string, ...args: any[]): void;
+ execAtPriority(synchronousCallback: MSExecAtPriorityFunctionCallback, priority: string, ...args: any[]): any;
+ getCurrentPriority(): string;
+ getHtmlPrintDocumentSourceAsync(htmlDoc: any): PromiseLike<any>;
+ getViewId(view: any): any;
+ isTaskScheduledAtPriorityOrHigher(priority: string): boolean;
+ pageHandlesAllApplicationActivations(enabled: boolean): void;
+ suppressSubdownloadCredentialPrompts(suppress: boolean): void;
+ terminateApp(exceptionObject: any): void;
+ readonly CURRENT: string;
+ readonly HIGH: string;
+ readonly IDLE: string;
+ readonly NORMAL: string;
+}
+declare var MSApp: MSApp;
+
+interface MSAppAsyncOperation extends EventTarget {
+ readonly error: DOMError;
+ oncomplete: (this: this, ev: Event) => any;
+ onerror: (this: this, ev: ErrorEvent) => any;
+ readonly readyState: number;
+ readonly result: any;
+ start(): void;
+ readonly COMPLETED: number;
+ readonly ERROR: number;
+ readonly STARTED: number;
+ addEventListener(type: "complete", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "error", listener: (this: this, ev: ErrorEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var MSAppAsyncOperation: {
+ prototype: MSAppAsyncOperation;
+ new(): MSAppAsyncOperation;
+ readonly COMPLETED: number;
+ readonly ERROR: number;
+ readonly STARTED: number;
+}
+
+interface MSAssertion {
+ readonly id: string;
+ readonly type: string;
+}
+
+declare var MSAssertion: {
+ prototype: MSAssertion;
+ new(): MSAssertion;
+}
+
+interface MSBlobBuilder {
+ append(data: any, endings?: string): void;
+ getBlob(contentType?: string): Blob;
+}
+
+declare var MSBlobBuilder: {
+ prototype: MSBlobBuilder;
+ new(): MSBlobBuilder;
+}
+
+interface MSCredentials {
+ getAssertion(challenge: string, filter?: MSCredentialFilter, params?: MSSignatureParameters): PromiseLike<MSAssertion>;
+ makeCredential(accountInfo: MSAccountInfo, params: MSCredentialParameters[], challenge?: string): PromiseLike<MSAssertion>;
+}
+
+declare var MSCredentials: {
+ prototype: MSCredentials;
+ new(): MSCredentials;
+}
+
+interface MSFIDOCredentialAssertion extends MSAssertion {
+ readonly algorithm: string | Algorithm;
+ readonly attestation: any;
+ readonly publicKey: string;
+ readonly transportHints: string[];
+}
+
+declare var MSFIDOCredentialAssertion: {
+ prototype: MSFIDOCredentialAssertion;
+ new(): MSFIDOCredentialAssertion;
+}
+
+interface MSFIDOSignature {
+ readonly authnrData: string;
+ readonly clientData: string;
+ readonly signature: string;
+}
+
+declare var MSFIDOSignature: {
+ prototype: MSFIDOSignature;
+ new(): MSFIDOSignature;
+}
+
+interface MSFIDOSignatureAssertion extends MSAssertion {
+ readonly signature: MSFIDOSignature;
+}
+
+declare var MSFIDOSignatureAssertion: {
+ prototype: MSFIDOSignatureAssertion;
+ new(): MSFIDOSignatureAssertion;
+}
+
+interface MSGesture {
+ target: Element;
+ addPointer(pointerId: number): void;
+ stop(): void;
+}
+
+declare var MSGesture: {
+ prototype: MSGesture;
+ new(): MSGesture;
+}
+
+interface MSGestureEvent extends UIEvent {
+ readonly clientX: number;
+ readonly clientY: number;
+ readonly expansion: number;
+ readonly gestureObject: any;
+ readonly hwTimestamp: number;
+ readonly offsetX: number;
+ readonly offsetY: number;
+ readonly rotation: number;
+ readonly scale: number;
+ readonly screenX: number;
+ readonly screenY: number;
+ readonly translationX: number;
+ readonly translationY: number;
+ readonly velocityAngular: number;
+ readonly velocityExpansion: number;
+ readonly velocityX: number;
+ readonly velocityY: number;
+ initGestureEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, offsetXArg: number, offsetYArg: number, translationXArg: number, translationYArg: number, scaleArg: number, expansionArg: number, rotationArg: number, velocityXArg: number, velocityYArg: number, velocityExpansionArg: number, velocityAngularArg: number, hwTimestampArg: number): void;
+ readonly MSGESTURE_FLAG_BEGIN: number;
+ readonly MSGESTURE_FLAG_CANCEL: number;
+ readonly MSGESTURE_FLAG_END: number;
+ readonly MSGESTURE_FLAG_INERTIA: number;
+ readonly MSGESTURE_FLAG_NONE: number;
+}
+
+declare var MSGestureEvent: {
+ prototype: MSGestureEvent;
+ new(): MSGestureEvent;
+ readonly MSGESTURE_FLAG_BEGIN: number;
+ readonly MSGESTURE_FLAG_CANCEL: number;
+ readonly MSGESTURE_FLAG_END: number;
+ readonly MSGESTURE_FLAG_INERTIA: number;
+ readonly MSGESTURE_FLAG_NONE: number;
+}
+
+interface MSGraphicsTrust {
+ readonly constrictionActive: boolean;
+ readonly status: string;
+}
+
+declare var MSGraphicsTrust: {
+ prototype: MSGraphicsTrust;
+ new(): MSGraphicsTrust;
+}
+
+interface MSHTMLWebViewElement extends HTMLElement {
+ readonly canGoBack: boolean;
+ readonly canGoForward: boolean;
+ readonly containsFullScreenElement: boolean;
+ readonly documentTitle: string;
+ height: number;
+ readonly settings: MSWebViewSettings;
+ src: string;
+ width: number;
+ addWebAllowedObject(name: string, applicationObject: any): void;
+ buildLocalStreamUri(contentIdentifier: string, relativePath: string): string;
+ capturePreviewToBlobAsync(): MSWebViewAsyncOperation;
+ captureSelectedContentToDataPackageAsync(): MSWebViewAsyncOperation;
+ getDeferredPermissionRequestById(id: number): DeferredPermissionRequest;
+ getDeferredPermissionRequests(): DeferredPermissionRequest[];
+ goBack(): void;
+ goForward(): void;
+ invokeScriptAsync(scriptName: string, ...args: any[]): MSWebViewAsyncOperation;
+ navigate(uri: string): void;
+ navigateToLocalStreamUri(source: string, streamResolver: any): void;
+ navigateToString(contents: string): void;
+ navigateWithHttpRequestMessage(requestMessage: any): void;
+ refresh(): void;
+ stop(): void;
+}
+
+declare var MSHTMLWebViewElement: {
+ prototype: MSHTMLWebViewElement;
+ new(): MSHTMLWebViewElement;
+}
+
+interface MSInputMethodContext extends EventTarget {
+ readonly compositionEndOffset: number;
+ readonly compositionStartOffset: number;
+ oncandidatewindowhide: (this: this, ev: Event) => any;
+ oncandidatewindowshow: (this: this, ev: Event) => any;
+ oncandidatewindowupdate: (this: this, ev: Event) => any;
+ readonly target: HTMLElement;
+ getCandidateWindowClientRect(): ClientRect;
+ getCompositionAlternatives(): string[];
+ hasComposition(): boolean;
+ isCandidateWindowVisible(): boolean;
+ addEventListener(type: "MSCandidateWindowHide", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSCandidateWindowShow", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSCandidateWindowUpdate", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var MSInputMethodContext: {
+ prototype: MSInputMethodContext;
+ new(): MSInputMethodContext;
+}
+
+interface MSManipulationEvent extends UIEvent {
+ readonly currentState: number;
+ readonly inertiaDestinationX: number;
+ readonly inertiaDestinationY: number;
+ readonly lastState: number;
+ initMSManipulationEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, lastState: number, currentState: number): void;
+ readonly MS_MANIPULATION_STATE_ACTIVE: number;
+ readonly MS_MANIPULATION_STATE_CANCELLED: number;
+ readonly MS_MANIPULATION_STATE_COMMITTED: number;
+ readonly MS_MANIPULATION_STATE_DRAGGING: number;
+ readonly MS_MANIPULATION_STATE_INERTIA: number;
+ readonly MS_MANIPULATION_STATE_PRESELECT: number;
+ readonly MS_MANIPULATION_STATE_SELECTING: number;
+ readonly MS_MANIPULATION_STATE_STOPPED: number;
+}
+
+declare var MSManipulationEvent: {
+ prototype: MSManipulationEvent;
+ new(): MSManipulationEvent;
+ readonly MS_MANIPULATION_STATE_ACTIVE: number;
+ readonly MS_MANIPULATION_STATE_CANCELLED: number;
+ readonly MS_MANIPULATION_STATE_COMMITTED: number;
+ readonly MS_MANIPULATION_STATE_DRAGGING: number;
+ readonly MS_MANIPULATION_STATE_INERTIA: number;
+ readonly MS_MANIPULATION_STATE_PRESELECT: number;
+ readonly MS_MANIPULATION_STATE_SELECTING: number;
+ readonly MS_MANIPULATION_STATE_STOPPED: number;
+}
+
+interface MSMediaKeyError {
+ readonly code: number;
+ readonly systemCode: number;
+ readonly MS_MEDIA_KEYERR_CLIENT: number;
+ readonly MS_MEDIA_KEYERR_DOMAIN: number;
+ readonly MS_MEDIA_KEYERR_HARDWARECHANGE: number;
+ readonly MS_MEDIA_KEYERR_OUTPUT: number;
+ readonly MS_MEDIA_KEYERR_SERVICE: number;
+ readonly MS_MEDIA_KEYERR_UNKNOWN: number;
+}
+
+declare var MSMediaKeyError: {
+ prototype: MSMediaKeyError;
+ new(): MSMediaKeyError;
+ readonly MS_MEDIA_KEYERR_CLIENT: number;
+ readonly MS_MEDIA_KEYERR_DOMAIN: number;
+ readonly MS_MEDIA_KEYERR_HARDWARECHANGE: number;
+ readonly MS_MEDIA_KEYERR_OUTPUT: number;
+ readonly MS_MEDIA_KEYERR_SERVICE: number;
+ readonly MS_MEDIA_KEYERR_UNKNOWN: number;
+}
+
+interface MSMediaKeyMessageEvent extends Event {
+ readonly destinationURL: string | null;
+ readonly message: Uint8Array;
+}
+
+declare var MSMediaKeyMessageEvent: {
+ prototype: MSMediaKeyMessageEvent;
+ new(): MSMediaKeyMessageEvent;
+}
+
+interface MSMediaKeyNeededEvent extends Event {
+ readonly initData: Uint8Array | null;
+}
+
+declare var MSMediaKeyNeededEvent: {
+ prototype: MSMediaKeyNeededEvent;
+ new(): MSMediaKeyNeededEvent;
+}
+
+interface MSMediaKeySession extends EventTarget {
+ readonly error: MSMediaKeyError | null;
+ readonly keySystem: string;
+ readonly sessionId: string;
+ close(): void;
+ update(key: Uint8Array): void;
+}
+
+declare var MSMediaKeySession: {
+ prototype: MSMediaKeySession;
+ new(): MSMediaKeySession;
+}
+
+interface MSMediaKeys {
+ readonly keySystem: string;
+ createSession(type: string, initData: Uint8Array, cdmData?: Uint8Array): MSMediaKeySession;
+}
+
+declare var MSMediaKeys: {
+ prototype: MSMediaKeys;
+ new(keySystem: string): MSMediaKeys;
+ isTypeSupported(keySystem: string, type?: string): boolean;
+ isTypeSupportedWithFeatures(keySystem: string, type?: string): string;
+}
+
+interface MSPointerEvent extends MouseEvent {
+ readonly currentPoint: any;
+ readonly height: number;
+ readonly hwTimestamp: number;
+ readonly intermediatePoints: any;
+ readonly isPrimary: boolean;
+ readonly pointerId: number;
+ readonly pointerType: any;
+ readonly pressure: number;
+ readonly rotation: number;
+ readonly tiltX: number;
+ readonly tiltY: number;
+ readonly width: number;
+ getCurrentPoint(element: Element): void;
+ getIntermediatePoints(element: Element): void;
+ initPointerEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget, offsetXArg: number, offsetYArg: number, widthArg: number, heightArg: number, pressure: number, rotation: number, tiltX: number, tiltY: number, pointerIdArg: number, pointerType: any, hwTimestampArg: number, isPrimary: boolean): void;
+}
+
+declare var MSPointerEvent: {
+ prototype: MSPointerEvent;
+ new(typeArg: string, eventInitDict?: PointerEventInit): MSPointerEvent;
+}
+
+interface MSRangeCollection {
+ readonly length: number;
+ item(index: number): Range;
+ [index: number]: Range;
+}
+
+declare var MSRangeCollection: {
+ prototype: MSRangeCollection;
+ new(): MSRangeCollection;
+}
+
+interface MSSiteModeEvent extends Event {
+ readonly actionURL: string;
+ readonly buttonID: number;
+}
+
+declare var MSSiteModeEvent: {
+ prototype: MSSiteModeEvent;
+ new(): MSSiteModeEvent;
+}
+
+interface MSStream {
+ readonly type: string;
+ msClose(): void;
+ msDetachStream(): any;
+}
+
+declare var MSStream: {
+ prototype: MSStream;
+ new(): MSStream;
+}
+
+interface MSStreamReader extends EventTarget, MSBaseReader {
+ readonly error: DOMError;
+ readAsArrayBuffer(stream: MSStream, size?: number): void;
+ readAsBinaryString(stream: MSStream, size?: number): void;
+ readAsBlob(stream: MSStream, size?: number): void;
+ readAsDataURL(stream: MSStream, size?: number): void;
+ readAsText(stream: MSStream, encoding?: string, size?: number): void;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var MSStreamReader: {
+ prototype: MSStreamReader;
+ new(): MSStreamReader;
+}
+
+interface MSWebViewAsyncOperation extends EventTarget {
+ readonly error: DOMError;
+ oncomplete: (this: this, ev: Event) => any;
+ onerror: (this: this, ev: ErrorEvent) => any;
+ readonly readyState: number;
+ readonly result: any;
+ readonly target: MSHTMLWebViewElement;
+ readonly type: number;
+ start(): void;
+ readonly COMPLETED: number;
+ readonly ERROR: number;
+ readonly STARTED: number;
+ readonly TYPE_CAPTURE_PREVIEW_TO_RANDOM_ACCESS_STREAM: number;
+ readonly TYPE_CREATE_DATA_PACKAGE_FROM_SELECTION: number;
+ readonly TYPE_INVOKE_SCRIPT: number;
+ addEventListener(type: "complete", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "error", listener: (this: this, ev: ErrorEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var MSWebViewAsyncOperation: {
+ prototype: MSWebViewAsyncOperation;
+ new(): MSWebViewAsyncOperation;
+ readonly COMPLETED: number;
+ readonly ERROR: number;
+ readonly STARTED: number;
+ readonly TYPE_CAPTURE_PREVIEW_TO_RANDOM_ACCESS_STREAM: number;
+ readonly TYPE_CREATE_DATA_PACKAGE_FROM_SELECTION: number;
+ readonly TYPE_INVOKE_SCRIPT: number;
+}
+
+interface MSWebViewSettings {
+ isIndexedDBEnabled: boolean;
+ isJavaScriptEnabled: boolean;
+}
+
+declare var MSWebViewSettings: {
+ prototype: MSWebViewSettings;
+ new(): MSWebViewSettings;
+}
+
+interface MediaDeviceInfo {
+ readonly deviceId: string;
+ readonly groupId: string;
+ readonly kind: string;
+ readonly label: string;
+}
+
+declare var MediaDeviceInfo: {
+ prototype: MediaDeviceInfo;
+ new(): MediaDeviceInfo;
+}
+
+interface MediaDevices extends EventTarget {
+ ondevicechange: (this: this, ev: Event) => any;
+ enumerateDevices(): any;
+ getSupportedConstraints(): MediaTrackSupportedConstraints;
+ getUserMedia(constraints: MediaStreamConstraints): PromiseLike<MediaStream>;
+ addEventListener(type: "devicechange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var MediaDevices: {
+ prototype: MediaDevices;
+ new(): MediaDevices;
+}
+
+interface MediaElementAudioSourceNode extends AudioNode {
+}
+
+declare var MediaElementAudioSourceNode: {
+ prototype: MediaElementAudioSourceNode;
+ new(): MediaElementAudioSourceNode;
+}
+
+interface MediaEncryptedEvent extends Event {
+ readonly initData: ArrayBuffer | null;
+ readonly initDataType: string;
+}
+
+declare var MediaEncryptedEvent: {
+ prototype: MediaEncryptedEvent;
+ new(type: string, eventInitDict?: MediaEncryptedEventInit): MediaEncryptedEvent;
+}
+
+interface MediaError {
+ readonly code: number;
+ readonly msExtendedCode: number;
+ readonly MEDIA_ERR_ABORTED: number;
+ readonly MEDIA_ERR_DECODE: number;
+ readonly MEDIA_ERR_NETWORK: number;
+ readonly MEDIA_ERR_SRC_NOT_SUPPORTED: number;
+ readonly MS_MEDIA_ERR_ENCRYPTED: number;
+}
+
+declare var MediaError: {
+ prototype: MediaError;
+ new(): MediaError;
+ readonly MEDIA_ERR_ABORTED: number;
+ readonly MEDIA_ERR_DECODE: number;
+ readonly MEDIA_ERR_NETWORK: number;
+ readonly MEDIA_ERR_SRC_NOT_SUPPORTED: number;
+ readonly MS_MEDIA_ERR_ENCRYPTED: number;
+}
+
+interface MediaKeyMessageEvent extends Event {
+ readonly message: ArrayBuffer;
+ readonly messageType: string;
+}
+
+declare var MediaKeyMessageEvent: {
+ prototype: MediaKeyMessageEvent;
+ new(type: string, eventInitDict?: MediaKeyMessageEventInit): MediaKeyMessageEvent;
+}
+
+interface MediaKeySession extends EventTarget {
+ readonly closed: PromiseLike<void>;
+ readonly expiration: number;
+ readonly keyStatuses: MediaKeyStatusMap;
+ readonly sessionId: string;
+ close(): PromiseLike<void>;
+ generateRequest(initDataType: string, initData: any): PromiseLike<void>;
+ load(sessionId: string): PromiseLike<boolean>;
+ remove(): PromiseLike<void>;
+ update(response: any): PromiseLike<void>;
+}
+
+declare var MediaKeySession: {
+ prototype: MediaKeySession;
+ new(): MediaKeySession;
+}
+
+interface MediaKeyStatusMap {
+ readonly size: number;
+ forEach(callback: ForEachCallback): void;
+ get(keyId: any): string;
+ has(keyId: any): boolean;
+}
+
+declare var MediaKeyStatusMap: {
+ prototype: MediaKeyStatusMap;
+ new(): MediaKeyStatusMap;
+}
+
+interface MediaKeySystemAccess {
+ readonly keySystem: string;
+ createMediaKeys(): PromiseLike<MediaKeys>;
+ getConfiguration(): MediaKeySystemConfiguration;
+}
+
+declare var MediaKeySystemAccess: {
+ prototype: MediaKeySystemAccess;
+ new(): MediaKeySystemAccess;
+}
+
+interface MediaKeys {
+ createSession(sessionType?: string): MediaKeySession;
+ setServerCertificate(serverCertificate: any): PromiseLike<void>;
+}
+
+declare var MediaKeys: {
+ prototype: MediaKeys;
+ new(): MediaKeys;
+}
+
+interface MediaList {
+ readonly length: number;
+ mediaText: string;
+ appendMedium(newMedium: string): void;
+ deleteMedium(oldMedium: string): void;
+ item(index: number): string;
+ toString(): string;
+ [index: number]: string;
+}
+
+declare var MediaList: {
+ prototype: MediaList;
+ new(): MediaList;
+}
+
+interface MediaQueryList {
+ readonly matches: boolean;
+ readonly media: string;
+ addListener(listener: MediaQueryListListener): void;
+ removeListener(listener: MediaQueryListListener): void;
+}
+
+declare var MediaQueryList: {
+ prototype: MediaQueryList;
+ new(): MediaQueryList;
+}
+
+interface MediaSource extends EventTarget {
+ readonly activeSourceBuffers: SourceBufferList;
+ duration: number;
+ readonly readyState: string;
+ readonly sourceBuffers: SourceBufferList;
+ addSourceBuffer(type: string): SourceBuffer;
+ endOfStream(error?: number): void;
+ removeSourceBuffer(sourceBuffer: SourceBuffer): void;
+}
+
+declare var MediaSource: {
+ prototype: MediaSource;
+ new(): MediaSource;
+ isTypeSupported(type: string): boolean;
+}
+
+interface MediaStream extends EventTarget {
+ readonly active: boolean;
+ readonly id: string;
+ onactive: (this: this, ev: Event) => any;
+ onaddtrack: (this: this, ev: TrackEvent) => any;
+ oninactive: (this: this, ev: Event) => any;
+ onremovetrack: (this: this, ev: TrackEvent) => any;
+ addTrack(track: MediaStreamTrack): void;
+ clone(): MediaStream;
+ getAudioTracks(): MediaStreamTrack[];
+ getTrackById(trackId: string): MediaStreamTrack | null;
+ getTracks(): MediaStreamTrack[];
+ getVideoTracks(): MediaStreamTrack[];
+ removeTrack(track: MediaStreamTrack): void;
+ stop(): void;
+ addEventListener(type: "active", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "addtrack", listener: (this: this, ev: TrackEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "inactive", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "removetrack", listener: (this: this, ev: TrackEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var MediaStream: {
+ prototype: MediaStream;
+ new(streamOrTracks?: MediaStream | MediaStreamTrack[]): MediaStream;
+}
+
+interface MediaStreamAudioSourceNode extends AudioNode {
+}
+
+declare var MediaStreamAudioSourceNode: {
+ prototype: MediaStreamAudioSourceNode;
+ new(): MediaStreamAudioSourceNode;
+}
+
+interface MediaStreamError {
+ readonly constraintName: string | null;
+ readonly message: string | null;
+ readonly name: string;
+}
+
+declare var MediaStreamError: {
+ prototype: MediaStreamError;
+ new(): MediaStreamError;
+}
+
+interface MediaStreamErrorEvent extends Event {
+ readonly error: MediaStreamError | null;
+}
+
+declare var MediaStreamErrorEvent: {
+ prototype: MediaStreamErrorEvent;
+ new(type: string, eventInitDict?: MediaStreamErrorEventInit): MediaStreamErrorEvent;
+}
+
+interface MediaStreamTrack extends EventTarget {
+ enabled: boolean;
+ readonly id: string;
+ readonly kind: string;
+ readonly label: string;
+ readonly muted: boolean;
+ onended: (this: this, ev: MediaStreamErrorEvent) => any;
+ onmute: (this: this, ev: Event) => any;
+ onoverconstrained: (this: this, ev: MediaStreamErrorEvent) => any;
+ onunmute: (this: this, ev: Event) => any;
+ readonly readonly: boolean;
+ readonly readyState: string;
+ readonly remote: boolean;
+ applyConstraints(constraints: MediaTrackConstraints): PromiseLike<void>;
+ clone(): MediaStreamTrack;
+ getCapabilities(): MediaTrackCapabilities;
+ getConstraints(): MediaTrackConstraints;
+ getSettings(): MediaTrackSettings;
+ stop(): void;
+ addEventListener(type: "ended", listener: (this: this, ev: MediaStreamErrorEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mute", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "overconstrained", listener: (this: this, ev: MediaStreamErrorEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "unmute", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var MediaStreamTrack: {
+ prototype: MediaStreamTrack;
+ new(): MediaStreamTrack;
+}
+
+interface MediaStreamTrackEvent extends Event {
+ readonly track: MediaStreamTrack;
+}
+
+declare var MediaStreamTrackEvent: {
+ prototype: MediaStreamTrackEvent;
+ new(type: string, eventInitDict?: MediaStreamTrackEventInit): MediaStreamTrackEvent;
+}
+
+interface MessageChannel {
+ readonly port1: MessagePort;
+ readonly port2: MessagePort;
+}
+
+declare var MessageChannel: {
+ prototype: MessageChannel;
+ new(): MessageChannel;
+}
+
+interface MessageEvent extends Event {
+ readonly data: any;
+ readonly origin: string;
+ readonly ports: any;
+ readonly source: Window;
+ initMessageEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, dataArg: any, originArg: string, lastEventIdArg: string, sourceArg: Window): void;
+}
+
+declare var MessageEvent: {
+ prototype: MessageEvent;
+ new(type: string, eventInitDict?: MessageEventInit): MessageEvent;
+}
+
+interface MessagePort extends EventTarget {
+ onmessage: (this: this, ev: MessageEvent) => any;
+ close(): void;
+ postMessage(message?: any, ports?: any): void;
+ start(): void;
+ addEventListener(type: "message", listener: (this: this, ev: MessageEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var MessagePort: {
+ prototype: MessagePort;
+ new(): MessagePort;
+}
+
+interface MimeType {
+ readonly description: string;
+ readonly enabledPlugin: Plugin;
+ readonly suffixes: string;
+ readonly type: string;
+}
+
+declare var MimeType: {
+ prototype: MimeType;
+ new(): MimeType;
+}
+
+interface MimeTypeArray {
+ readonly length: number;
+ item(index: number): Plugin;
+ namedItem(type: string): Plugin;
+ [index: number]: Plugin;
+}
+
+declare var MimeTypeArray: {
+ prototype: MimeTypeArray;
+ new(): MimeTypeArray;
+}
+
+interface MouseEvent extends UIEvent {
+ readonly altKey: boolean;
+ readonly button: number;
+ readonly buttons: number;
+ readonly clientX: number;
+ readonly clientY: number;
+ readonly ctrlKey: boolean;
+ readonly fromElement: Element;
+ readonly layerX: number;
+ readonly layerY: number;
+ readonly metaKey: boolean;
+ readonly movementX: number;
+ readonly movementY: number;
+ readonly offsetX: number;
+ readonly offsetY: number;
+ readonly pageX: number;
+ readonly pageY: number;
+ readonly relatedTarget: EventTarget;
+ readonly screenX: number;
+ readonly screenY: number;
+ readonly shiftKey: boolean;
+ readonly toElement: Element;
+ readonly which: number;
+ readonly x: number;
+ readonly y: number;
+ getModifierState(keyArg: string): boolean;
+ initMouseEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget): void;
+}
+
+declare var MouseEvent: {
+ prototype: MouseEvent;
+ new(typeArg: string, eventInitDict?: MouseEventInit): MouseEvent;
+}
+
+interface MutationEvent extends Event {
+ readonly attrChange: number;
+ readonly attrName: string;
+ readonly newValue: string;
+ readonly prevValue: string;
+ readonly relatedNode: Node;
+ initMutationEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, relatedNodeArg: Node, prevValueArg: string, newValueArg: string, attrNameArg: string, attrChangeArg: number): void;
+ readonly ADDITION: number;
+ readonly MODIFICATION: number;
+ readonly REMOVAL: number;
+}
+
+declare var MutationEvent: {
+ prototype: MutationEvent;
+ new(): MutationEvent;
+ readonly ADDITION: number;
+ readonly MODIFICATION: number;
+ readonly REMOVAL: number;
+}
+
+interface MutationObserver {
+ disconnect(): void;
+ observe(target: Node, options: MutationObserverInit): void;
+ takeRecords(): MutationRecord[];
+}
+
+declare var MutationObserver: {
+ prototype: MutationObserver;
+ new(callback: MutationCallback): MutationObserver;
+}
+
+interface MutationRecord {
+ readonly addedNodes: NodeList;
+ readonly attributeName: string | null;
+ readonly attributeNamespace: string | null;
+ readonly nextSibling: Node | null;
+ readonly oldValue: string | null;
+ readonly previousSibling: Node | null;
+ readonly removedNodes: NodeList;
+ readonly target: Node;
+ readonly type: string;
+}
+
+declare var MutationRecord: {
+ prototype: MutationRecord;
+ new(): MutationRecord;
+}
+
+interface NamedNodeMap {
+ readonly length: number;
+ getNamedItem(name: string): Attr;
+ getNamedItemNS(namespaceURI: string | null, localName: string | null): Attr;
+ item(index: number): Attr;
+ removeNamedItem(name: string): Attr;
+ removeNamedItemNS(namespaceURI: string | null, localName: string | null): Attr;
+ setNamedItem(arg: Attr): Attr;
+ setNamedItemNS(arg: Attr): Attr;
+ [index: number]: Attr;
+}
+
+declare var NamedNodeMap: {
+ prototype: NamedNodeMap;
+ new(): NamedNodeMap;
+}
+
+interface NavigationCompletedEvent extends NavigationEvent {
+ readonly isSuccess: boolean;
+ readonly webErrorStatus: number;
+}
+
+declare var NavigationCompletedEvent: {
+ prototype: NavigationCompletedEvent;
+ new(): NavigationCompletedEvent;
+}
+
+interface NavigationEvent extends Event {
+ readonly uri: string;
+}
+
+declare var NavigationEvent: {
+ prototype: NavigationEvent;
+ new(): NavigationEvent;
+}
+
+interface NavigationEventWithReferrer extends NavigationEvent {
+ readonly referer: string;
+}
+
+declare var NavigationEventWithReferrer: {
+ prototype: NavigationEventWithReferrer;
+ new(): NavigationEventWithReferrer;
+}
+
+interface Navigator extends Object, NavigatorID, NavigatorOnLine, NavigatorContentUtils, NavigatorStorageUtils, NavigatorGeolocation, MSNavigatorDoNotTrack, MSFileSaver, NavigatorUserMedia {
+ readonly appCodeName: string;
+ readonly cookieEnabled: boolean;
+ readonly language: string;
+ readonly maxTouchPoints: number;
+ readonly mimeTypes: MimeTypeArray;
+ readonly msManipulationViewsEnabled: boolean;
+ readonly msMaxTouchPoints: number;
+ readonly msPointerEnabled: boolean;
+ readonly plugins: PluginArray;
+ readonly pointerEnabled: boolean;
+ readonly webdriver: boolean;
+ getGamepads(): Gamepad[];
+ javaEnabled(): boolean;
+ msLaunchUri(uri: string, successCallback?: MSLaunchUriCallback, noHandlerCallback?: MSLaunchUriCallback): void;
+ requestMediaKeySystemAccess(keySystem: string, supportedConfigurations: MediaKeySystemConfiguration[]): PromiseLike<MediaKeySystemAccess>;
+ vibrate(pattern: number | number[]): boolean;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var Navigator: {
+ prototype: Navigator;
+ new(): Navigator;
+}
+
+interface Node extends EventTarget {
+ readonly attributes: NamedNodeMap;
+ readonly baseURI: string | null;
+ readonly childNodes: NodeList;
+ readonly firstChild: Node;
+ readonly lastChild: Node;
+ readonly localName: string | null;
+ readonly namespaceURI: string | null;
+ readonly nextSibling: Node;
+ readonly nodeName: string;
+ readonly nodeType: number;
+ nodeValue: string | null;
+ readonly ownerDocument: Document;
+ readonly parentElement: HTMLElement;
+ readonly parentNode: Node;
+ readonly previousSibling: Node;
+ textContent: string | null;
+ appendChild(newChild: Node): Node;
+ cloneNode(deep?: boolean): Node;
+ compareDocumentPosition(other: Node): number;
+ contains(child: Node): boolean;
+ hasAttributes(): boolean;
+ hasChildNodes(): boolean;
+ insertBefore(newChild: Node, refChild: Node | null): Node;
+ isDefaultNamespace(namespaceURI: string | null): boolean;
+ isEqualNode(arg: Node): boolean;
+ isSameNode(other: Node): boolean;
+ lookupNamespaceURI(prefix: string | null): string | null;
+ lookupPrefix(namespaceURI: string | null): string | null;
+ normalize(): void;
+ removeChild(oldChild: Node): Node;
+ replaceChild(newChild: Node, oldChild: Node): Node;
+ readonly ATTRIBUTE_NODE: number;
+ readonly CDATA_SECTION_NODE: number;
+ readonly COMMENT_NODE: number;
+ readonly DOCUMENT_FRAGMENT_NODE: number;
+ readonly DOCUMENT_NODE: number;
+ readonly DOCUMENT_POSITION_CONTAINED_BY: number;
+ readonly DOCUMENT_POSITION_CONTAINS: number;
+ readonly DOCUMENT_POSITION_DISCONNECTED: number;
+ readonly DOCUMENT_POSITION_FOLLOWING: number;
+ readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: number;
+ readonly DOCUMENT_POSITION_PRECEDING: number;
+ readonly DOCUMENT_TYPE_NODE: number;
+ readonly ELEMENT_NODE: number;
+ readonly ENTITY_NODE: number;
+ readonly ENTITY_REFERENCE_NODE: number;
+ readonly NOTATION_NODE: number;
+ readonly PROCESSING_INSTRUCTION_NODE: number;
+ readonly TEXT_NODE: number;
+}
+
+declare var Node: {
+ prototype: Node;
+ new(): Node;
+ readonly ATTRIBUTE_NODE: number;
+ readonly CDATA_SECTION_NODE: number;
+ readonly COMMENT_NODE: number;
+ readonly DOCUMENT_FRAGMENT_NODE: number;
+ readonly DOCUMENT_NODE: number;
+ readonly DOCUMENT_POSITION_CONTAINED_BY: number;
+ readonly DOCUMENT_POSITION_CONTAINS: number;
+ readonly DOCUMENT_POSITION_DISCONNECTED: number;
+ readonly DOCUMENT_POSITION_FOLLOWING: number;
+ readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: number;
+ readonly DOCUMENT_POSITION_PRECEDING: number;
+ readonly DOCUMENT_TYPE_NODE: number;
+ readonly ELEMENT_NODE: number;
+ readonly ENTITY_NODE: number;
+ readonly ENTITY_REFERENCE_NODE: number;
+ readonly NOTATION_NODE: number;
+ readonly PROCESSING_INSTRUCTION_NODE: number;
+ readonly TEXT_NODE: number;
+}
+
+interface NodeFilter {
+ acceptNode(n: Node): number;
+}
+
+declare var NodeFilter: {
+ readonly FILTER_ACCEPT: number;
+ readonly FILTER_REJECT: number;
+ readonly FILTER_SKIP: number;
+ readonly SHOW_ALL: number;
+ readonly SHOW_ATTRIBUTE: number;
+ readonly SHOW_CDATA_SECTION: number;
+ readonly SHOW_COMMENT: number;
+ readonly SHOW_DOCUMENT: number;
+ readonly SHOW_DOCUMENT_FRAGMENT: number;
+ readonly SHOW_DOCUMENT_TYPE: number;
+ readonly SHOW_ELEMENT: number;
+ readonly SHOW_ENTITY: number;
+ readonly SHOW_ENTITY_REFERENCE: number;
+ readonly SHOW_NOTATION: number;
+ readonly SHOW_PROCESSING_INSTRUCTION: number;
+ readonly SHOW_TEXT: number;
+}
+
+interface NodeIterator {
+ readonly expandEntityReferences: boolean;
+ readonly filter: NodeFilter;
+ readonly root: Node;
+ readonly whatToShow: number;
+ detach(): void;
+ nextNode(): Node;
+ previousNode(): Node;
+}
+
+declare var NodeIterator: {
+ prototype: NodeIterator;
+ new(): NodeIterator;
+}
+
+interface NodeList {
+ readonly length: number;
+ item(index: number): Node;
+ [index: number]: Node;
+}
+
+declare var NodeList: {
+ prototype: NodeList;
+ new(): NodeList;
+}
+
+interface OES_element_index_uint {
+}
+
+declare var OES_element_index_uint: {
+ prototype: OES_element_index_uint;
+ new(): OES_element_index_uint;
+}
+
+interface OES_standard_derivatives {
+ readonly FRAGMENT_SHADER_DERIVATIVE_HINT_OES: number;
+}
+
+declare var OES_standard_derivatives: {
+ prototype: OES_standard_derivatives;
+ new(): OES_standard_derivatives;
+ readonly FRAGMENT_SHADER_DERIVATIVE_HINT_OES: number;
+}
+
+interface OES_texture_float {
+}
+
+declare var OES_texture_float: {
+ prototype: OES_texture_float;
+ new(): OES_texture_float;
+}
+
+interface OES_texture_float_linear {
+}
+
+declare var OES_texture_float_linear: {
+ prototype: OES_texture_float_linear;
+ new(): OES_texture_float_linear;
+}
+
+interface OfflineAudioCompletionEvent extends Event {
+ readonly renderedBuffer: AudioBuffer;
+}
+
+declare var OfflineAudioCompletionEvent: {
+ prototype: OfflineAudioCompletionEvent;
+ new(): OfflineAudioCompletionEvent;
+}
+
+interface OfflineAudioContext extends AudioContext {
+ oncomplete: (this: this, ev: Event) => any;
+ startRendering(): PromiseLike<AudioBuffer>;
+ addEventListener(type: "complete", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var OfflineAudioContext: {
+ prototype: OfflineAudioContext;
+ new(numberOfChannels: number, length: number, sampleRate: number): OfflineAudioContext;
+}
+
+interface OscillatorNode extends AudioNode {
+ readonly detune: AudioParam;
+ readonly frequency: AudioParam;
+ onended: (this: this, ev: MediaStreamErrorEvent) => any;
+ type: string;
+ setPeriodicWave(periodicWave: PeriodicWave): void;
+ start(when?: number): void;
+ stop(when?: number): void;
+ addEventListener(type: "ended", listener: (this: this, ev: MediaStreamErrorEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var OscillatorNode: {
+ prototype: OscillatorNode;
+ new(): OscillatorNode;
+}
+
+interface OverflowEvent extends UIEvent {
+ readonly horizontalOverflow: boolean;
+ readonly orient: number;
+ readonly verticalOverflow: boolean;
+ readonly BOTH: number;
+ readonly HORIZONTAL: number;
+ readonly VERTICAL: number;
+}
+
+declare var OverflowEvent: {
+ prototype: OverflowEvent;
+ new(): OverflowEvent;
+ readonly BOTH: number;
+ readonly HORIZONTAL: number;
+ readonly VERTICAL: number;
+}
+
+interface PageTransitionEvent extends Event {
+ readonly persisted: boolean;
+}
+
+declare var PageTransitionEvent: {
+ prototype: PageTransitionEvent;
+ new(): PageTransitionEvent;
+}
+
+interface PannerNode extends AudioNode {
+ coneInnerAngle: number;
+ coneOuterAngle: number;
+ coneOuterGain: number;
+ distanceModel: string;
+ maxDistance: number;
+ panningModel: string;
+ refDistance: number;
+ rolloffFactor: number;
+ setOrientation(x: number, y: number, z: number): void;
+ setPosition(x: number, y: number, z: number): void;
+ setVelocity(x: number, y: number, z: number): void;
+}
+
+declare var PannerNode: {
+ prototype: PannerNode;
+ new(): PannerNode;
+}
+
+interface PerfWidgetExternal {
+ readonly activeNetworkRequestCount: number;
+ readonly averageFrameTime: number;
+ readonly averagePaintTime: number;
+ readonly extraInformationEnabled: boolean;
+ readonly independentRenderingEnabled: boolean;
+ readonly irDisablingContentString: string;
+ readonly irStatusAvailable: boolean;
+ readonly maxCpuSpeed: number;
+ readonly paintRequestsPerSecond: number;
+ readonly performanceCounter: number;
+ readonly performanceCounterFrequency: number;
+ addEventListener(eventType: string, callback: Function): void;
+ getMemoryUsage(): number;
+ getProcessCpuUsage(): number;
+ getRecentCpuUsage(last: number | null): any;
+ getRecentFrames(last: number | null): any;
+ getRecentMemoryUsage(last: number | null): any;
+ getRecentPaintRequests(last: number | null): any;
+ removeEventListener(eventType: string, callback: Function): void;
+ repositionWindow(x: number, y: number): void;
+ resizeWindow(width: number, height: number): void;
+}
+
+declare var PerfWidgetExternal: {
+ prototype: PerfWidgetExternal;
+ new(): PerfWidgetExternal;
+}
+
+interface Performance {
+ readonly navigation: PerformanceNavigation;
+ readonly timing: PerformanceTiming;
+ clearMarks(markName?: string): void;
+ clearMeasures(measureName?: string): void;
+ clearResourceTimings(): void;
+ getEntries(): any;
+ getEntriesByName(name: string, entryType?: string): any;
+ getEntriesByType(entryType: string): any;
+ getMarks(markName?: string): any;
+ getMeasures(measureName?: string): any;
+ mark(markName: string): void;
+ measure(measureName: string, startMarkName?: string, endMarkName?: string): void;
+ now(): number;
+ setResourceTimingBufferSize(maxSize: number): void;
+ toJSON(): any;
+}
+
+declare var Performance: {
+ prototype: Performance;
+ new(): Performance;
+}
+
+interface PerformanceEntry {
+ readonly duration: number;
+ readonly entryType: string;
+ readonly name: string;
+ readonly startTime: number;
+}
+
+declare var PerformanceEntry: {
+ prototype: PerformanceEntry;
+ new(): PerformanceEntry;
+}
+
+interface PerformanceMark extends PerformanceEntry {
+}
+
+declare var PerformanceMark: {
+ prototype: PerformanceMark;
+ new(): PerformanceMark;
+}
+
+interface PerformanceMeasure extends PerformanceEntry {
+}
+
+declare var PerformanceMeasure: {
+ prototype: PerformanceMeasure;
+ new(): PerformanceMeasure;
+}
+
+interface PerformanceNavigation {
+ readonly redirectCount: number;
+ readonly type: number;
+ toJSON(): any;
+ readonly TYPE_BACK_FORWARD: number;
+ readonly TYPE_NAVIGATE: number;
+ readonly TYPE_RELOAD: number;
+ readonly TYPE_RESERVED: number;
+}
+
+declare var PerformanceNavigation: {
+ prototype: PerformanceNavigation;
+ new(): PerformanceNavigation;
+ readonly TYPE_BACK_FORWARD: number;
+ readonly TYPE_NAVIGATE: number;
+ readonly TYPE_RELOAD: number;
+ readonly TYPE_RESERVED: number;
+}
+
+interface PerformanceNavigationTiming extends PerformanceEntry {
+ readonly connectEnd: number;
+ readonly connectStart: number;
+ readonly domComplete: number;
+ readonly domContentLoadedEventEnd: number;
+ readonly domContentLoadedEventStart: number;
+ readonly domInteractive: number;
+ readonly domLoading: number;
+ readonly domainLookupEnd: number;
+ readonly domainLookupStart: number;
+ readonly fetchStart: number;
+ readonly loadEventEnd: number;
+ readonly loadEventStart: number;
+ readonly navigationStart: number;
+ readonly redirectCount: number;
+ readonly redirectEnd: number;
+ readonly redirectStart: number;
+ readonly requestStart: number;
+ readonly responseEnd: number;
+ readonly responseStart: number;
+ readonly type: string;
+ readonly unloadEventEnd: number;
+ readonly unloadEventStart: number;
+}
+
+declare var PerformanceNavigationTiming: {
+ prototype: PerformanceNavigationTiming;
+ new(): PerformanceNavigationTiming;
+}
+
+interface PerformanceResourceTiming extends PerformanceEntry {
+ readonly connectEnd: number;
+ readonly connectStart: number;
+ readonly domainLookupEnd: number;
+ readonly domainLookupStart: number;
+ readonly fetchStart: number;
+ readonly initiatorType: string;
+ readonly redirectEnd: number;
+ readonly redirectStart: number;
+ readonly requestStart: number;
+ readonly responseEnd: number;
+ readonly responseStart: number;
+}
+
+declare var PerformanceResourceTiming: {
+ prototype: PerformanceResourceTiming;
+ new(): PerformanceResourceTiming;
+}
+
+interface PerformanceTiming {
+ readonly connectEnd: number;
+ readonly connectStart: number;
+ readonly domComplete: number;
+ readonly domContentLoadedEventEnd: number;
+ readonly domContentLoadedEventStart: number;
+ readonly domInteractive: number;
+ readonly domLoading: number;
+ readonly domainLookupEnd: number;
+ readonly domainLookupStart: number;
+ readonly fetchStart: number;
+ readonly loadEventEnd: number;
+ readonly loadEventStart: number;
+ readonly msFirstPaint: number;
+ readonly navigationStart: number;
+ readonly redirectEnd: number;
+ readonly redirectStart: number;
+ readonly requestStart: number;
+ readonly responseEnd: number;
+ readonly responseStart: number;
+ readonly unloadEventEnd: number;
+ readonly unloadEventStart: number;
+ readonly secureConnectionStart: number;
+ toJSON(): any;
+}
+
+declare var PerformanceTiming: {
+ prototype: PerformanceTiming;
+ new(): PerformanceTiming;
+}
+
+interface PeriodicWave {
+}
+
+declare var PeriodicWave: {
+ prototype: PeriodicWave;
+ new(): PeriodicWave;
+}
+
+interface PermissionRequest extends DeferredPermissionRequest {
+ readonly state: string;
+ defer(): void;
+}
+
+declare var PermissionRequest: {
+ prototype: PermissionRequest;
+ new(): PermissionRequest;
+}
+
+interface PermissionRequestedEvent extends Event {
+ readonly permissionRequest: PermissionRequest;
+}
+
+declare var PermissionRequestedEvent: {
+ prototype: PermissionRequestedEvent;
+ new(): PermissionRequestedEvent;
+}
+
+interface Plugin {
+ readonly description: string;
+ readonly filename: string;
+ readonly length: number;
+ readonly name: string;
+ readonly version: string;
+ item(index: number): MimeType;
+ namedItem(type: string): MimeType;
+ [index: number]: MimeType;
+}
+
+declare var Plugin: {
+ prototype: Plugin;
+ new(): Plugin;
+}
+
+interface PluginArray {
+ readonly length: number;
+ item(index: number): Plugin;
+ namedItem(name: string): Plugin;
+ refresh(reload?: boolean): void;
+ [index: number]: Plugin;
+}
+
+declare var PluginArray: {
+ prototype: PluginArray;
+ new(): PluginArray;
+}
+
+interface PointerEvent extends MouseEvent {
+ readonly currentPoint: any;
+ readonly height: number;
+ readonly hwTimestamp: number;
+ readonly intermediatePoints: any;
+ readonly isPrimary: boolean;
+ readonly pointerId: number;
+ readonly pointerType: any;
+ readonly pressure: number;
+ readonly rotation: number;
+ readonly tiltX: number;
+ readonly tiltY: number;
+ readonly width: number;
+ getCurrentPoint(element: Element): void;
+ getIntermediatePoints(element: Element): void;
+ initPointerEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget, offsetXArg: number, offsetYArg: number, widthArg: number, heightArg: number, pressure: number, rotation: number, tiltX: number, tiltY: number, pointerIdArg: number, pointerType: any, hwTimestampArg: number, isPrimary: boolean): void;
+}
+
+declare var PointerEvent: {
+ prototype: PointerEvent;
+ new(typeArg: string, eventInitDict?: PointerEventInit): PointerEvent;
+}
+
+interface PopStateEvent extends Event {
+ readonly state: any;
+ initPopStateEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, stateArg: any): void;
+}
+
+declare var PopStateEvent: {
+ prototype: PopStateEvent;
+ new(): PopStateEvent;
+}
+
+interface Position {
+ readonly coords: Coordinates;
+ readonly timestamp: number;
+}
+
+declare var Position: {
+ prototype: Position;
+ new(): Position;
+}
+
+interface PositionError {
+ readonly code: number;
+ readonly message: string;
+ toString(): string;
+ readonly PERMISSION_DENIED: number;
+ readonly POSITION_UNAVAILABLE: number;
+ readonly TIMEOUT: number;
+}
+
+declare var PositionError: {
+ prototype: PositionError;
+ new(): PositionError;
+ readonly PERMISSION_DENIED: number;
+ readonly POSITION_UNAVAILABLE: number;
+ readonly TIMEOUT: number;
+}
+
+interface ProcessingInstruction extends CharacterData {
+ readonly target: string;
+}
+
+declare var ProcessingInstruction: {
+ prototype: ProcessingInstruction;
+ new(): ProcessingInstruction;
+}
+
+interface ProgressEvent extends Event {
+ readonly lengthComputable: boolean;
+ readonly loaded: number;
+ readonly total: number;
+ initProgressEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, lengthComputableArg: boolean, loadedArg: number, totalArg: number): void;
+}
+
+declare var ProgressEvent: {
+ prototype: ProgressEvent;
+ new(type: string, eventInitDict?: ProgressEventInit): ProgressEvent;
+}
+
+interface RTCDTMFToneChangeEvent extends Event {
+ readonly tone: string;
+}
+
+declare var RTCDTMFToneChangeEvent: {
+ prototype: RTCDTMFToneChangeEvent;
+ new(type: string, eventInitDict: RTCDTMFToneChangeEventInit): RTCDTMFToneChangeEvent;
+}
+
+interface RTCDtlsTransport extends RTCStatsProvider {
+ ondtlsstatechange: ((this: this, ev: RTCDtlsTransportStateChangedEvent) => any) | null;
+ onerror: ((this: this, ev: ErrorEvent) => any) | null;
+ readonly state: string;
+ readonly transport: RTCIceTransport;
+ getLocalParameters(): RTCDtlsParameters;
+ getRemoteCertificates(): ArrayBuffer[];
+ getRemoteParameters(): RTCDtlsParameters | null;
+ start(remoteParameters: RTCDtlsParameters): void;
+ stop(): void;
+ addEventListener(type: "dtlsstatechange", listener: (this: this, ev: RTCDtlsTransportStateChangedEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "error", listener: (this: this, ev: ErrorEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var RTCDtlsTransport: {
+ prototype: RTCDtlsTransport;
+ new(transport: RTCIceTransport): RTCDtlsTransport;
+}
+
+interface RTCDtlsTransportStateChangedEvent extends Event {
+ readonly state: string;
+}
+
+declare var RTCDtlsTransportStateChangedEvent: {
+ prototype: RTCDtlsTransportStateChangedEvent;
+ new(): RTCDtlsTransportStateChangedEvent;
+}
+
+interface RTCDtmfSender extends EventTarget {
+ readonly canInsertDTMF: boolean;
+ readonly duration: number;
+ readonly interToneGap: number;
+ ontonechange: (this: this, ev: RTCDTMFToneChangeEvent) => any;
+ readonly sender: RTCRtpSender;
+ readonly toneBuffer: string;
+ insertDTMF(tones: string, duration?: number, interToneGap?: number): void;
+ addEventListener(type: "tonechange", listener: (this: this, ev: RTCDTMFToneChangeEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var RTCDtmfSender: {
+ prototype: RTCDtmfSender;
+ new(sender: RTCRtpSender): RTCDtmfSender;
+}
+
+interface RTCIceCandidatePairChangedEvent extends Event {
+ readonly pair: RTCIceCandidatePair;
+}
+
+declare var RTCIceCandidatePairChangedEvent: {
+ prototype: RTCIceCandidatePairChangedEvent;
+ new(): RTCIceCandidatePairChangedEvent;
+}
+
+interface RTCIceGatherer extends RTCStatsProvider {
+ readonly component: string;
+ onerror: ((this: this, ev: ErrorEvent) => any) | null;
+ onlocalcandidate: ((this: this, ev: RTCIceGathererEvent) => any) | null;
+ createAssociatedGatherer(): RTCIceGatherer;
+ getLocalCandidates(): RTCIceCandidate[];
+ getLocalParameters(): RTCIceParameters;
+ addEventListener(type: "error", listener: (this: this, ev: ErrorEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "localcandidate", listener: (this: this, ev: RTCIceGathererEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var RTCIceGatherer: {
+ prototype: RTCIceGatherer;
+ new(options: RTCIceGatherOptions): RTCIceGatherer;
+}
+
+interface RTCIceGathererEvent extends Event {
+ readonly candidate: RTCIceCandidate | RTCIceCandidateComplete;
+}
+
+declare var RTCIceGathererEvent: {
+ prototype: RTCIceGathererEvent;
+ new(): RTCIceGathererEvent;
+}
+
+interface RTCIceTransport extends RTCStatsProvider {
+ readonly component: string;
+ readonly iceGatherer: RTCIceGatherer | null;
+ oncandidatepairchange: ((this: this, ev: RTCIceCandidatePairChangedEvent) => any) | null;
+ onicestatechange: ((this: this, ev: RTCIceTransportStateChangedEvent) => any) | null;
+ readonly role: string;
+ readonly state: string;
+ addRemoteCandidate(remoteCandidate: RTCIceCandidate | RTCIceCandidateComplete): void;
+ createAssociatedTransport(): RTCIceTransport;
+ getNominatedCandidatePair(): RTCIceCandidatePair | null;
+ getRemoteCandidates(): RTCIceCandidate[];
+ getRemoteParameters(): RTCIceParameters | null;
+ setRemoteCandidates(remoteCandidates: RTCIceCandidate[]): void;
+ start(gatherer: RTCIceGatherer, remoteParameters: RTCIceParameters, role?: string): void;
+ stop(): void;
+ addEventListener(type: "candidatepairchange", listener: (this: this, ev: RTCIceCandidatePairChangedEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "icestatechange", listener: (this: this, ev: RTCIceTransportStateChangedEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var RTCIceTransport: {
+ prototype: RTCIceTransport;
+ new(): RTCIceTransport;
+}
+
+interface RTCIceTransportStateChangedEvent extends Event {
+ readonly state: string;
+}
+
+declare var RTCIceTransportStateChangedEvent: {
+ prototype: RTCIceTransportStateChangedEvent;
+ new(): RTCIceTransportStateChangedEvent;
+}
+
+interface RTCRtpReceiver extends RTCStatsProvider {
+ onerror: ((this: this, ev: ErrorEvent) => any) | null;
+ readonly rtcpTransport: RTCDtlsTransport;
+ readonly track: MediaStreamTrack | null;
+ readonly transport: RTCDtlsTransport | RTCSrtpSdesTransport;
+ getContributingSources(): RTCRtpContributingSource[];
+ receive(parameters: RTCRtpParameters): void;
+ requestSendCSRC(csrc: number): void;
+ setTransport(transport: RTCDtlsTransport | RTCSrtpSdesTransport, rtcpTransport?: RTCDtlsTransport): void;
+ stop(): void;
+ addEventListener(type: "error", listener: (this: this, ev: ErrorEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var RTCRtpReceiver: {
+ prototype: RTCRtpReceiver;
+ new(transport: RTCDtlsTransport | RTCSrtpSdesTransport, kind: string, rtcpTransport?: RTCDtlsTransport): RTCRtpReceiver;
+ getCapabilities(kind?: string): RTCRtpCapabilities;
+}
+
+interface RTCRtpSender extends RTCStatsProvider {
+ onerror: ((this: this, ev: ErrorEvent) => any) | null;
+ onssrcconflict: ((this: this, ev: RTCSsrcConflictEvent) => any) | null;
+ readonly rtcpTransport: RTCDtlsTransport;
+ readonly track: MediaStreamTrack;
+ readonly transport: RTCDtlsTransport | RTCSrtpSdesTransport;
+ send(parameters: RTCRtpParameters): void;
+ setTrack(track: MediaStreamTrack): void;
+ setTransport(transport: RTCDtlsTransport | RTCSrtpSdesTransport, rtcpTransport?: RTCDtlsTransport): void;
+ stop(): void;
+ addEventListener(type: "error", listener: (this: this, ev: ErrorEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "ssrcconflict", listener: (this: this, ev: RTCSsrcConflictEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var RTCRtpSender: {
+ prototype: RTCRtpSender;
+ new(track: MediaStreamTrack, transport: RTCDtlsTransport | RTCSrtpSdesTransport, rtcpTransport?: RTCDtlsTransport): RTCRtpSender;
+ getCapabilities(kind?: string): RTCRtpCapabilities;
+}
+
+interface RTCSrtpSdesTransport extends EventTarget {
+ onerror: ((this: this, ev: ErrorEvent) => any) | null;
+ readonly transport: RTCIceTransport;
+ addEventListener(type: "error", listener: (this: this, ev: ErrorEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var RTCSrtpSdesTransport: {
+ prototype: RTCSrtpSdesTransport;
+ new(transport: RTCIceTransport, encryptParameters: RTCSrtpSdesParameters, decryptParameters: RTCSrtpSdesParameters): RTCSrtpSdesTransport;
+ getLocalParameters(): RTCSrtpSdesParameters[];
+}
+
+interface RTCSsrcConflictEvent extends Event {
+ readonly ssrc: number;
+}
+
+declare var RTCSsrcConflictEvent: {
+ prototype: RTCSsrcConflictEvent;
+ new(): RTCSsrcConflictEvent;
+}
+
+interface RTCStatsProvider extends EventTarget {
+ getStats(): PromiseLike<RTCStatsReport>;
+ msGetStats(): PromiseLike<RTCStatsReport>;
+}
+
+declare var RTCStatsProvider: {
+ prototype: RTCStatsProvider;
+ new(): RTCStatsProvider;
+}
+
+interface Range {
+ readonly collapsed: boolean;
+ readonly commonAncestorContainer: Node;
+ readonly endContainer: Node;
+ readonly endOffset: number;
+ readonly startContainer: Node;
+ readonly startOffset: number;
+ cloneContents(): DocumentFragment;
+ cloneRange(): Range;
+ collapse(toStart: boolean): void;
+ compareBoundaryPoints(how: number, sourceRange: Range): number;
+ createContextualFragment(fragment: string): DocumentFragment;
+ deleteContents(): void;
+ detach(): void;
+ expand(Unit: string): boolean;
+ extractContents(): DocumentFragment;
+ getBoundingClientRect(): ClientRect;
+ getClientRects(): ClientRectList;
+ insertNode(newNode: Node): void;
+ selectNode(refNode: Node): void;
+ selectNodeContents(refNode: Node): void;
+ setEnd(refNode: Node, offset: number): void;
+ setEndAfter(refNode: Node): void;
+ setEndBefore(refNode: Node): void;
+ setStart(refNode: Node, offset: number): void;
+ setStartAfter(refNode: Node): void;
+ setStartBefore(refNode: Node): void;
+ surroundContents(newParent: Node): void;
+ toString(): string;
+ readonly END_TO_END: number;
+ readonly END_TO_START: number;
+ readonly START_TO_END: number;
+ readonly START_TO_START: number;
+}
+
+declare var Range: {
+ prototype: Range;
+ new(): Range;
+ readonly END_TO_END: number;
+ readonly END_TO_START: number;
+ readonly START_TO_END: number;
+ readonly START_TO_START: number;
+}
+
+interface SVGAElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGURIReference {
+ readonly target: SVGAnimatedString;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var SVGAElement: {
+ prototype: SVGAElement;
+ new(): SVGAElement;
+}
+
+interface SVGAngle {
+ readonly unitType: number;
+ value: number;
+ valueAsString: string;
+ valueInSpecifiedUnits: number;
+ convertToSpecifiedUnits(unitType: number): void;
+ newValueSpecifiedUnits(unitType: number, valueInSpecifiedUnits: number): void;
+ readonly SVG_ANGLETYPE_DEG: number;
+ readonly SVG_ANGLETYPE_GRAD: number;
+ readonly SVG_ANGLETYPE_RAD: number;
+ readonly SVG_ANGLETYPE_UNKNOWN: number;
+ readonly SVG_ANGLETYPE_UNSPECIFIED: number;
+}
+
+declare var SVGAngle: {
+ prototype: SVGAngle;
+ new(): SVGAngle;
+ readonly SVG_ANGLETYPE_DEG: number;
+ readonly SVG_ANGLETYPE_GRAD: number;
+ readonly SVG_ANGLETYPE_RAD: number;
+ readonly SVG_ANGLETYPE_UNKNOWN: number;
+ readonly SVG_ANGLETYPE_UNSPECIFIED: number;
+}
+
+interface SVGAnimatedAngle {
+ readonly animVal: SVGAngle;
+ readonly baseVal: SVGAngle;
+}
+
+declare var SVGAnimatedAngle: {
+ prototype: SVGAnimatedAngle;
+ new(): SVGAnimatedAngle;
+}
+
+interface SVGAnimatedBoolean {
+ readonly animVal: boolean;
+ baseVal: boolean;
+}
+
+declare var SVGAnimatedBoolean: {
+ prototype: SVGAnimatedBoolean;
+ new(): SVGAnimatedBoolean;
+}
+
+interface SVGAnimatedEnumeration {
+ readonly animVal: number;
+ baseVal: number;
+}
+
+declare var SVGAnimatedEnumeration: {
+ prototype: SVGAnimatedEnumeration;
+ new(): SVGAnimatedEnumeration;
+}
+
+interface SVGAnimatedInteger {
+ readonly animVal: number;
+ baseVal: number;
+}
+
+declare var SVGAnimatedInteger: {
+ prototype: SVGAnimatedInteger;
+ new(): SVGAnimatedInteger;
+}
+
+interface SVGAnimatedLength {
+ readonly animVal: SVGLength;
+ readonly baseVal: SVGLength;
+}
+
+declare var SVGAnimatedLength: {
+ prototype: SVGAnimatedLength;
+ new(): SVGAnimatedLength;
+}
+
+interface SVGAnimatedLengthList {
+ readonly animVal: SVGLengthList;
+ readonly baseVal: SVGLengthList;
+}
+
+declare var SVGAnimatedLengthList: {
+ prototype: SVGAnimatedLengthList;
+ new(): SVGAnimatedLengthList;
+}
+
+interface SVGAnimatedNumber {
+ readonly animVal: number;
+ baseVal: number;
+}
+
+declare var SVGAnimatedNumber: {
+ prototype: SVGAnimatedNumber;
+ new(): SVGAnimatedNumber;
+}
+
+interface SVGAnimatedNumberList {
+ readonly animVal: SVGNumberList;
+ readonly baseVal: SVGNumberList;
+}
+
+declare var SVGAnimatedNumberList: {
+ prototype: SVGAnimatedNumberList;
+ new(): SVGAnimatedNumberList;
+}
+
+interface SVGAnimatedPreserveAspectRatio {
+ readonly animVal: SVGPreserveAspectRatio;
+ readonly baseVal: SVGPreserveAspectRatio;
+}
+
+declare var SVGAnimatedPreserveAspectRatio: {
+ prototype: SVGAnimatedPreserveAspectRatio;
+ new(): SVGAnimatedPreserveAspectRatio;
+}
+
+interface SVGAnimatedRect {
+ readonly animVal: SVGRect;
+ readonly baseVal: SVGRect;
+}
+
+declare var SVGAnimatedRect: {
+ prototype: SVGAnimatedRect;
+ new(): SVGAnimatedRect;
+}
+
+interface SVGAnimatedString {
+ readonly animVal: string;
+ baseVal: string;
+}
+
+declare var SVGAnimatedString: {
+ prototype: SVGAnimatedString;
+ new(): SVGAnimatedString;
+}
+
+interface SVGAnimatedTransformList {
+ readonly animVal: SVGTransformList;
+ readonly baseVal: SVGTransformList;
+}
+
+declare var SVGAnimatedTransformList: {
+ prototype: SVGAnimatedTransformList;
+ new(): SVGAnimatedTransformList;
+}
+
+interface SVGCircleElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired {
+ readonly cx: SVGAnimatedLength;
+ readonly cy: SVGAnimatedLength;
+ readonly r: SVGAnimatedLength;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var SVGCircleElement: {
+ prototype: SVGCircleElement;
+ new(): SVGCircleElement;
+}
+
+interface SVGClipPathElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGUnitTypes {
+ readonly clipPathUnits: SVGAnimatedEnumeration;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var SVGClipPathElement: {
+ prototype: SVGClipPathElement;
+ new(): SVGClipPathElement;
+}
+
+interface SVGComponentTransferFunctionElement extends SVGElement {
+ readonly amplitude: SVGAnimatedNumber;
+ readonly exponent: SVGAnimatedNumber;
+ readonly intercept: SVGAnimatedNumber;
+ readonly offset: SVGAnimatedNumber;
+ readonly slope: SVGAnimatedNumber;
+ readonly tableValues: SVGAnimatedNumberList;
+ readonly type: SVGAnimatedEnumeration;
+ readonly SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE: number;
+ readonly SVG_FECOMPONENTTRANSFER_TYPE_GAMMA: number;
+ readonly SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY: number;
+ readonly SVG_FECOMPONENTTRANSFER_TYPE_LINEAR: number;
+ readonly SVG_FECOMPONENTTRANSFER_TYPE_TABLE: number;
+ readonly SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN: number;
+}
+
+declare var SVGComponentTransferFunctionElement: {
+ prototype: SVGComponentTransferFunctionElement;
+ new(): SVGComponentTransferFunctionElement;
+ readonly SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE: number;
+ readonly SVG_FECOMPONENTTRANSFER_TYPE_GAMMA: number;
+ readonly SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY: number;
+ readonly SVG_FECOMPONENTTRANSFER_TYPE_LINEAR: number;
+ readonly SVG_FECOMPONENTTRANSFER_TYPE_TABLE: number;
+ readonly SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN: number;
+}
+
+interface SVGDefsElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired {
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var SVGDefsElement: {
+ prototype: SVGDefsElement;
+ new(): SVGDefsElement;
+}
+
+interface SVGDescElement extends SVGElement, SVGStylable, SVGLangSpace {
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var SVGDescElement: {
+ prototype: SVGDescElement;
+ new(): SVGDescElement;
+}
+
+interface SVGElement extends Element {
+ onclick: (this: this, ev: MouseEvent) => any;
+ ondblclick: (this: this, ev: MouseEvent) => any;
+ onfocusin: (this: this, ev: FocusEvent) => any;
+ onfocusout: (this: this, ev: FocusEvent) => any;
+ onload: (this: this, ev: Event) => any;
+ onmousedown: (this: this, ev: MouseEvent) => any;
+ onmousemove: (this: this, ev: MouseEvent) => any;
+ onmouseout: (this: this, ev: MouseEvent) => any;
+ onmouseover: (this: this, ev: MouseEvent) => any;
+ onmouseup: (this: this, ev: MouseEvent) => any;
+ readonly ownerSVGElement: SVGSVGElement;
+ readonly viewportElement: SVGElement;
+ xmlbase: string;
+ className: any;
+ addEventListener(type: "MSGestureChange", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureDoubleTap", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureEnd", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureHold", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureStart", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureTap", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGotPointerCapture", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSInertiaStart", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSLostPointerCapture", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerCancel", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerDown", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerEnter", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerLeave", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerMove", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerOut", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerOver", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerUp", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "ariarequest", listener: (this: this, ev: AriaRequestEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "click", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "command", listener: (this: this, ev: CommandEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dblclick", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "focusin", listener: (this: this, ev: FocusEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "focusout", listener: (this: this, ev: FocusEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "gotpointercapture", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "load", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "lostpointercapture", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mousedown", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mousemove", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mouseout", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mouseover", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mouseup", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointercancel", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerdown", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerenter", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerleave", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointermove", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerout", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerover", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerup", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "touchcancel", listener: (this: this, ev: TouchEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "touchend", listener: (this: this, ev: TouchEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "touchmove", listener: (this: this, ev: TouchEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "touchstart", listener: (this: this, ev: TouchEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "webkitfullscreenchange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "webkitfullscreenerror", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "wheel", listener: (this: this, ev: WheelEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var SVGElement: {
+ prototype: SVGElement;
+ new(): SVGElement;
+}
+
+interface SVGElementInstance extends EventTarget {
+ readonly childNodes: SVGElementInstanceList;
+ readonly correspondingElement: SVGElement;
+ readonly correspondingUseElement: SVGUseElement;
+ readonly firstChild: SVGElementInstance;
+ readonly lastChild: SVGElementInstance;
+ readonly nextSibling: SVGElementInstance;
+ readonly parentNode: SVGElementInstance;
+ readonly previousSibling: SVGElementInstance;
+}
+
+declare var SVGElementInstance: {
+ prototype: SVGElementInstance;
+ new(): SVGElementInstance;
+}
+
+interface SVGElementInstanceList {
+ readonly length: number;
+ item(index: number): SVGElementInstance;
+}
+
+declare var SVGElementInstanceList: {
+ prototype: SVGElementInstanceList;
+ new(): SVGElementInstanceList;
+}
+
+interface SVGEllipseElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired {
+ readonly cx: SVGAnimatedLength;
+ readonly cy: SVGAnimatedLength;
+ readonly rx: SVGAnimatedLength;
+ readonly ry: SVGAnimatedLength;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var SVGEllipseElement: {
+ prototype: SVGEllipseElement;
+ new(): SVGEllipseElement;
+}
+
+interface SVGFEBlendElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {
+ readonly in1: SVGAnimatedString;
+ readonly in2: SVGAnimatedString;
+ readonly mode: SVGAnimatedEnumeration;
+ readonly SVG_FEBLEND_MODE_COLOR: number;
+ readonly SVG_FEBLEND_MODE_COLOR_BURN: number;
+ readonly SVG_FEBLEND_MODE_COLOR_DODGE: number;
+ readonly SVG_FEBLEND_MODE_DARKEN: number;
+ readonly SVG_FEBLEND_MODE_DIFFERENCE: number;
+ readonly SVG_FEBLEND_MODE_EXCLUSION: number;
+ readonly SVG_FEBLEND_MODE_HARD_LIGHT: number;
+ readonly SVG_FEBLEND_MODE_HUE: number;
+ readonly SVG_FEBLEND_MODE_LIGHTEN: number;
+ readonly SVG_FEBLEND_MODE_LUMINOSITY: number;
+ readonly SVG_FEBLEND_MODE_MULTIPLY: number;
+ readonly SVG_FEBLEND_MODE_NORMAL: number;
+ readonly SVG_FEBLEND_MODE_OVERLAY: number;
+ readonly SVG_FEBLEND_MODE_SATURATION: number;
+ readonly SVG_FEBLEND_MODE_SCREEN: number;
+ readonly SVG_FEBLEND_MODE_SOFT_LIGHT: number;
+ readonly SVG_FEBLEND_MODE_UNKNOWN: number;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var SVGFEBlendElement: {
+ prototype: SVGFEBlendElement;
+ new(): SVGFEBlendElement;
+ readonly SVG_FEBLEND_MODE_COLOR: number;
+ readonly SVG_FEBLEND_MODE_COLOR_BURN: number;
+ readonly SVG_FEBLEND_MODE_COLOR_DODGE: number;
+ readonly SVG_FEBLEND_MODE_DARKEN: number;
+ readonly SVG_FEBLEND_MODE_DIFFERENCE: number;
+ readonly SVG_FEBLEND_MODE_EXCLUSION: number;
+ readonly SVG_FEBLEND_MODE_HARD_LIGHT: number;
+ readonly SVG_FEBLEND_MODE_HUE: number;
+ readonly SVG_FEBLEND_MODE_LIGHTEN: number;
+ readonly SVG_FEBLEND_MODE_LUMINOSITY: number;
+ readonly SVG_FEBLEND_MODE_MULTIPLY: number;
+ readonly SVG_FEBLEND_MODE_NORMAL: number;
+ readonly SVG_FEBLEND_MODE_OVERLAY: number;
+ readonly SVG_FEBLEND_MODE_SATURATION: number;
+ readonly SVG_FEBLEND_MODE_SCREEN: number;
+ readonly SVG_FEBLEND_MODE_SOFT_LIGHT: number;
+ readonly SVG_FEBLEND_MODE_UNKNOWN: number;
+}
+
+interface SVGFEColorMatrixElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {
+ readonly in1: SVGAnimatedString;
+ readonly type: SVGAnimatedEnumeration;
+ readonly values: SVGAnimatedNumberList;
+ readonly SVG_FECOLORMATRIX_TYPE_HUEROTATE: number;
+ readonly SVG_FECOLORMATRIX_TYPE_LUMINANCETOALPHA: number;
+ readonly SVG_FECOLORMATRIX_TYPE_MATRIX: number;
+ readonly SVG_FECOLORMATRIX_TYPE_SATURATE: number;
+ readonly SVG_FECOLORMATRIX_TYPE_UNKNOWN: number;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var SVGFEColorMatrixElement: {
+ prototype: SVGFEColorMatrixElement;
+ new(): SVGFEColorMatrixElement;
+ readonly SVG_FECOLORMATRIX_TYPE_HUEROTATE: number;
+ readonly SVG_FECOLORMATRIX_TYPE_LUMINANCETOALPHA: number;
+ readonly SVG_FECOLORMATRIX_TYPE_MATRIX: number;
+ readonly SVG_FECOLORMATRIX_TYPE_SATURATE: number;
+ readonly SVG_FECOLORMATRIX_TYPE_UNKNOWN: number;
+}
+
+interface SVGFEComponentTransferElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {
+ readonly in1: SVGAnimatedString;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var SVGFEComponentTransferElement: {
+ prototype: SVGFEComponentTransferElement;
+ new(): SVGFEComponentTransferElement;
+}
+
+interface SVGFECompositeElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {
+ readonly in1: SVGAnimatedString;
+ readonly in2: SVGAnimatedString;
+ readonly k1: SVGAnimatedNumber;
+ readonly k2: SVGAnimatedNumber;
+ readonly k3: SVGAnimatedNumber;
+ readonly k4: SVGAnimatedNumber;
+ readonly operator: SVGAnimatedEnumeration;
+ readonly SVG_FECOMPOSITE_OPERATOR_ARITHMETIC: number;
+ readonly SVG_FECOMPOSITE_OPERATOR_ATOP: number;
+ readonly SVG_FECOMPOSITE_OPERATOR_IN: number;
+ readonly SVG_FECOMPOSITE_OPERATOR_OUT: number;
+ readonly SVG_FECOMPOSITE_OPERATOR_OVER: number;
+ readonly SVG_FECOMPOSITE_OPERATOR_UNKNOWN: number;
+ readonly SVG_FECOMPOSITE_OPERATOR_XOR: number;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var SVGFECompositeElement: {
+ prototype: SVGFECompositeElement;
+ new(): SVGFECompositeElement;
+ readonly SVG_FECOMPOSITE_OPERATOR_ARITHMETIC: number;
+ readonly SVG_FECOMPOSITE_OPERATOR_ATOP: number;
+ readonly SVG_FECOMPOSITE_OPERATOR_IN: number;
+ readonly SVG_FECOMPOSITE_OPERATOR_OUT: number;
+ readonly SVG_FECOMPOSITE_OPERATOR_OVER: number;
+ readonly SVG_FECOMPOSITE_OPERATOR_UNKNOWN: number;
+ readonly SVG_FECOMPOSITE_OPERATOR_XOR: number;
+}
+
+interface SVGFEConvolveMatrixElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {
+ readonly bias: SVGAnimatedNumber;
+ readonly divisor: SVGAnimatedNumber;
+ readonly edgeMode: SVGAnimatedEnumeration;
+ readonly in1: SVGAnimatedString;
+ readonly kernelMatrix: SVGAnimatedNumberList;
+ readonly kernelUnitLengthX: SVGAnimatedNumber;
+ readonly kernelUnitLengthY: SVGAnimatedNumber;
+ readonly orderX: SVGAnimatedInteger;
+ readonly orderY: SVGAnimatedInteger;
+ readonly preserveAlpha: SVGAnimatedBoolean;
+ readonly targetX: SVGAnimatedInteger;
+ readonly targetY: SVGAnimatedInteger;
+ readonly SVG_EDGEMODE_DUPLICATE: number;
+ readonly SVG_EDGEMODE_NONE: number;
+ readonly SVG_EDGEMODE_UNKNOWN: number;
+ readonly SVG_EDGEMODE_WRAP: number;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var SVGFEConvolveMatrixElement: {
+ prototype: SVGFEConvolveMatrixElement;
+ new(): SVGFEConvolveMatrixElement;
+ readonly SVG_EDGEMODE_DUPLICATE: number;
+ readonly SVG_EDGEMODE_NONE: number;
+ readonly SVG_EDGEMODE_UNKNOWN: number;
+ readonly SVG_EDGEMODE_WRAP: number;
+}
+
+interface SVGFEDiffuseLightingElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {
+ readonly diffuseConstant: SVGAnimatedNumber;
+ readonly in1: SVGAnimatedString;
+ readonly kernelUnitLengthX: SVGAnimatedNumber;
+ readonly kernelUnitLengthY: SVGAnimatedNumber;
+ readonly surfaceScale: SVGAnimatedNumber;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var SVGFEDiffuseLightingElement: {
+ prototype: SVGFEDiffuseLightingElement;
+ new(): SVGFEDiffuseLightingElement;
+}
+
+interface SVGFEDisplacementMapElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {
+ readonly in1: SVGAnimatedString;
+ readonly in2: SVGAnimatedString;
+ readonly scale: SVGAnimatedNumber;
+ readonly xChannelSelector: SVGAnimatedEnumeration;
+ readonly yChannelSelector: SVGAnimatedEnumeration;
+ readonly SVG_CHANNEL_A: number;
+ readonly SVG_CHANNEL_B: number;
+ readonly SVG_CHANNEL_G: number;
+ readonly SVG_CHANNEL_R: number;
+ readonly SVG_CHANNEL_UNKNOWN: number;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var SVGFEDisplacementMapElement: {
+ prototype: SVGFEDisplacementMapElement;
+ new(): SVGFEDisplacementMapElement;
+ readonly SVG_CHANNEL_A: number;
+ readonly SVG_CHANNEL_B: number;
+ readonly SVG_CHANNEL_G: number;
+ readonly SVG_CHANNEL_R: number;
+ readonly SVG_CHANNEL_UNKNOWN: number;
+}
+
+interface SVGFEDistantLightElement extends SVGElement {
+ readonly azimuth: SVGAnimatedNumber;
+ readonly elevation: SVGAnimatedNumber;
+}
+
+declare var SVGFEDistantLightElement: {
+ prototype: SVGFEDistantLightElement;
+ new(): SVGFEDistantLightElement;
+}
+
+interface SVGFEFloodElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var SVGFEFloodElement: {
+ prototype: SVGFEFloodElement;
+ new(): SVGFEFloodElement;
+}
+
+interface SVGFEFuncAElement extends SVGComponentTransferFunctionElement {
+}
+
+declare var SVGFEFuncAElement: {
+ prototype: SVGFEFuncAElement;
+ new(): SVGFEFuncAElement;
+}
+
+interface SVGFEFuncBElement extends SVGComponentTransferFunctionElement {
+}
+
+declare var SVGFEFuncBElement: {
+ prototype: SVGFEFuncBElement;
+ new(): SVGFEFuncBElement;
+}
+
+interface SVGFEFuncGElement extends SVGComponentTransferFunctionElement {
+}
+
+declare var SVGFEFuncGElement: {
+ prototype: SVGFEFuncGElement;
+ new(): SVGFEFuncGElement;
+}
+
+interface SVGFEFuncRElement extends SVGComponentTransferFunctionElement {
+}
+
+declare var SVGFEFuncRElement: {
+ prototype: SVGFEFuncRElement;
+ new(): SVGFEFuncRElement;
+}
+
+interface SVGFEGaussianBlurElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {
+ readonly in1: SVGAnimatedString;
+ readonly stdDeviationX: SVGAnimatedNumber;
+ readonly stdDeviationY: SVGAnimatedNumber;
+ setStdDeviation(stdDeviationX: number, stdDeviationY: number): void;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var SVGFEGaussianBlurElement: {
+ prototype: SVGFEGaussianBlurElement;
+ new(): SVGFEGaussianBlurElement;
+}
+
+interface SVGFEImageElement extends SVGElement, SVGFilterPrimitiveStandardAttributes, SVGLangSpace, SVGURIReference, SVGExternalResourcesRequired {
+ readonly preserveAspectRatio: SVGAnimatedPreserveAspectRatio;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var SVGFEImageElement: {
+ prototype: SVGFEImageElement;
+ new(): SVGFEImageElement;
+}
+
+interface SVGFEMergeElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var SVGFEMergeElement: {
+ prototype: SVGFEMergeElement;
+ new(): SVGFEMergeElement;
+}
+
+interface SVGFEMergeNodeElement extends SVGElement {
+ readonly in1: SVGAnimatedString;
+}
+
+declare var SVGFEMergeNodeElement: {
+ prototype: SVGFEMergeNodeElement;
+ new(): SVGFEMergeNodeElement;
+}
+
+interface SVGFEMorphologyElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {
+ readonly in1: SVGAnimatedString;
+ readonly operator: SVGAnimatedEnumeration;
+ readonly radiusX: SVGAnimatedNumber;
+ readonly radiusY: SVGAnimatedNumber;
+ readonly SVG_MORPHOLOGY_OPERATOR_DILATE: number;
+ readonly SVG_MORPHOLOGY_OPERATOR_ERODE: number;
+ readonly SVG_MORPHOLOGY_OPERATOR_UNKNOWN: number;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var SVGFEMorphologyElement: {
+ prototype: SVGFEMorphologyElement;
+ new(): SVGFEMorphologyElement;
+ readonly SVG_MORPHOLOGY_OPERATOR_DILATE: number;
+ readonly SVG_MORPHOLOGY_OPERATOR_ERODE: number;
+ readonly SVG_MORPHOLOGY_OPERATOR_UNKNOWN: number;
+}
+
+interface SVGFEOffsetElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {
+ readonly dx: SVGAnimatedNumber;
+ readonly dy: SVGAnimatedNumber;
+ readonly in1: SVGAnimatedString;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var SVGFEOffsetElement: {
+ prototype: SVGFEOffsetElement;
+ new(): SVGFEOffsetElement;
+}
+
+interface SVGFEPointLightElement extends SVGElement {
+ readonly x: SVGAnimatedNumber;
+ readonly y: SVGAnimatedNumber;
+ readonly z: SVGAnimatedNumber;
+}
+
+declare var SVGFEPointLightElement: {
+ prototype: SVGFEPointLightElement;
+ new(): SVGFEPointLightElement;
+}
+
+interface SVGFESpecularLightingElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {
+ readonly in1: SVGAnimatedString;
+ readonly kernelUnitLengthX: SVGAnimatedNumber;
+ readonly kernelUnitLengthY: SVGAnimatedNumber;
+ readonly specularConstant: SVGAnimatedNumber;
+ readonly specularExponent: SVGAnimatedNumber;
+ readonly surfaceScale: SVGAnimatedNumber;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var SVGFESpecularLightingElement: {
+ prototype: SVGFESpecularLightingElement;
+ new(): SVGFESpecularLightingElement;
+}
+
+interface SVGFESpotLightElement extends SVGElement {
+ readonly limitingConeAngle: SVGAnimatedNumber;
+ readonly pointsAtX: SVGAnimatedNumber;
+ readonly pointsAtY: SVGAnimatedNumber;
+ readonly pointsAtZ: SVGAnimatedNumber;
+ readonly specularExponent: SVGAnimatedNumber;
+ readonly x: SVGAnimatedNumber;
+ readonly y: SVGAnimatedNumber;
+ readonly z: SVGAnimatedNumber;
+}
+
+declare var SVGFESpotLightElement: {
+ prototype: SVGFESpotLightElement;
+ new(): SVGFESpotLightElement;
+}
+
+interface SVGFETileElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {
+ readonly in1: SVGAnimatedString;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var SVGFETileElement: {
+ prototype: SVGFETileElement;
+ new(): SVGFETileElement;
+}
+
+interface SVGFETurbulenceElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {
+ readonly baseFrequencyX: SVGAnimatedNumber;
+ readonly baseFrequencyY: SVGAnimatedNumber;
+ readonly numOctaves: SVGAnimatedInteger;
+ readonly seed: SVGAnimatedNumber;
+ readonly stitchTiles: SVGAnimatedEnumeration;
+ readonly type: SVGAnimatedEnumeration;
+ readonly SVG_STITCHTYPE_NOSTITCH: number;
+ readonly SVG_STITCHTYPE_STITCH: number;
+ readonly SVG_STITCHTYPE_UNKNOWN: number;
+ readonly SVG_TURBULENCE_TYPE_FRACTALNOISE: number;
+ readonly SVG_TURBULENCE_TYPE_TURBULENCE: number;
+ readonly SVG_TURBULENCE_TYPE_UNKNOWN: number;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var SVGFETurbulenceElement: {
+ prototype: SVGFETurbulenceElement;
+ new(): SVGFETurbulenceElement;
+ readonly SVG_STITCHTYPE_NOSTITCH: number;
+ readonly SVG_STITCHTYPE_STITCH: number;
+ readonly SVG_STITCHTYPE_UNKNOWN: number;
+ readonly SVG_TURBULENCE_TYPE_FRACTALNOISE: number;
+ readonly SVG_TURBULENCE_TYPE_TURBULENCE: number;
+ readonly SVG_TURBULENCE_TYPE_UNKNOWN: number;
+}
+
+interface SVGFilterElement extends SVGElement, SVGUnitTypes, SVGStylable, SVGLangSpace, SVGURIReference, SVGExternalResourcesRequired {
+ readonly filterResX: SVGAnimatedInteger;
+ readonly filterResY: SVGAnimatedInteger;
+ readonly filterUnits: SVGAnimatedEnumeration;
+ readonly height: SVGAnimatedLength;
+ readonly primitiveUnits: SVGAnimatedEnumeration;
+ readonly width: SVGAnimatedLength;
+ readonly x: SVGAnimatedLength;
+ readonly y: SVGAnimatedLength;
+ setFilterRes(filterResX: number, filterResY: number): void;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var SVGFilterElement: {
+ prototype: SVGFilterElement;
+ new(): SVGFilterElement;
+}
+
+interface SVGForeignObjectElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired {
+ readonly height: SVGAnimatedLength;
+ readonly width: SVGAnimatedLength;
+ readonly x: SVGAnimatedLength;
+ readonly y: SVGAnimatedLength;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var SVGForeignObjectElement: {
+ prototype: SVGForeignObjectElement;
+ new(): SVGForeignObjectElement;
+}
+
+interface SVGGElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired {
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var SVGGElement: {
+ prototype: SVGGElement;
+ new(): SVGGElement;
+}
+
+interface SVGGradientElement extends SVGElement, SVGStylable, SVGExternalResourcesRequired, SVGURIReference, SVGUnitTypes {
+ readonly gradientTransform: SVGAnimatedTransformList;
+ readonly gradientUnits: SVGAnimatedEnumeration;
+ readonly spreadMethod: SVGAnimatedEnumeration;
+ readonly SVG_SPREADMETHOD_PAD: number;
+ readonly SVG_SPREADMETHOD_REFLECT: number;
+ readonly SVG_SPREADMETHOD_REPEAT: number;
+ readonly SVG_SPREADMETHOD_UNKNOWN: number;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var SVGGradientElement: {
+ prototype: SVGGradientElement;
+ new(): SVGGradientElement;
+ readonly SVG_SPREADMETHOD_PAD: number;
+ readonly SVG_SPREADMETHOD_REFLECT: number;
+ readonly SVG_SPREADMETHOD_REPEAT: number;
+ readonly SVG_SPREADMETHOD_UNKNOWN: number;
+}
+
+interface SVGImageElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGURIReference {
+ readonly height: SVGAnimatedLength;
+ readonly preserveAspectRatio: SVGAnimatedPreserveAspectRatio;
+ readonly width: SVGAnimatedLength;
+ readonly x: SVGAnimatedLength;
+ readonly y: SVGAnimatedLength;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var SVGImageElement: {
+ prototype: SVGImageElement;
+ new(): SVGImageElement;
+}
+
+interface SVGLength {
+ readonly unitType: number;
+ value: number;
+ valueAsString: string;
+ valueInSpecifiedUnits: number;
+ convertToSpecifiedUnits(unitType: number): void;
+ newValueSpecifiedUnits(unitType: number, valueInSpecifiedUnits: number): void;
+ readonly SVG_LENGTHTYPE_CM: number;
+ readonly SVG_LENGTHTYPE_EMS: number;
+ readonly SVG_LENGTHTYPE_EXS: number;
+ readonly SVG_LENGTHTYPE_IN: number;
+ readonly SVG_LENGTHTYPE_MM: number;
+ readonly SVG_LENGTHTYPE_NUMBER: number;
+ readonly SVG_LENGTHTYPE_PC: number;
+ readonly SVG_LENGTHTYPE_PERCENTAGE: number;
+ readonly SVG_LENGTHTYPE_PT: number;
+ readonly SVG_LENGTHTYPE_PX: number;
+ readonly SVG_LENGTHTYPE_UNKNOWN: number;
+}
+
+declare var SVGLength: {
+ prototype: SVGLength;
+ new(): SVGLength;
+ readonly SVG_LENGTHTYPE_CM: number;
+ readonly SVG_LENGTHTYPE_EMS: number;
+ readonly SVG_LENGTHTYPE_EXS: number;
+ readonly SVG_LENGTHTYPE_IN: number;
+ readonly SVG_LENGTHTYPE_MM: number;
+ readonly SVG_LENGTHTYPE_NUMBER: number;
+ readonly SVG_LENGTHTYPE_PC: number;
+ readonly SVG_LENGTHTYPE_PERCENTAGE: number;
+ readonly SVG_LENGTHTYPE_PT: number;
+ readonly SVG_LENGTHTYPE_PX: number;
+ readonly SVG_LENGTHTYPE_UNKNOWN: number;
+}
+
+interface SVGLengthList {
+ readonly numberOfItems: number;
+ appendItem(newItem: SVGLength): SVGLength;
+ clear(): void;
+ getItem(index: number): SVGLength;
+ initialize(newItem: SVGLength): SVGLength;
+ insertItemBefore(newItem: SVGLength, index: number): SVGLength;
+ removeItem(index: number): SVGLength;
+ replaceItem(newItem: SVGLength, index: number): SVGLength;
+}
+
+declare var SVGLengthList: {
+ prototype: SVGLengthList;
+ new(): SVGLengthList;
+}
+
+interface SVGLineElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired {
+ readonly x1: SVGAnimatedLength;
+ readonly x2: SVGAnimatedLength;
+ readonly y1: SVGAnimatedLength;
+ readonly y2: SVGAnimatedLength;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var SVGLineElement: {
+ prototype: SVGLineElement;
+ new(): SVGLineElement;
+}
+
+interface SVGLinearGradientElement extends SVGGradientElement {
+ readonly x1: SVGAnimatedLength;
+ readonly x2: SVGAnimatedLength;
+ readonly y1: SVGAnimatedLength;
+ readonly y2: SVGAnimatedLength;
+}
+
+declare var SVGLinearGradientElement: {
+ prototype: SVGLinearGradientElement;
+ new(): SVGLinearGradientElement;
+}
+
+interface SVGMarkerElement extends SVGElement, SVGStylable, SVGLangSpace, SVGExternalResourcesRequired, SVGFitToViewBox {
+ readonly markerHeight: SVGAnimatedLength;
+ readonly markerUnits: SVGAnimatedEnumeration;
+ readonly markerWidth: SVGAnimatedLength;
+ readonly orientAngle: SVGAnimatedAngle;
+ readonly orientType: SVGAnimatedEnumeration;
+ readonly refX: SVGAnimatedLength;
+ readonly refY: SVGAnimatedLength;
+ setOrientToAngle(angle: SVGAngle): void;
+ setOrientToAuto(): void;
+ readonly SVG_MARKERUNITS_STROKEWIDTH: number;
+ readonly SVG_MARKERUNITS_UNKNOWN: number;
+ readonly SVG_MARKERUNITS_USERSPACEONUSE: number;
+ readonly SVG_MARKER_ORIENT_ANGLE: number;
+ readonly SVG_MARKER_ORIENT_AUTO: number;
+ readonly SVG_MARKER_ORIENT_UNKNOWN: number;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var SVGMarkerElement: {
+ prototype: SVGMarkerElement;
+ new(): SVGMarkerElement;
+ readonly SVG_MARKERUNITS_STROKEWIDTH: number;
+ readonly SVG_MARKERUNITS_UNKNOWN: number;
+ readonly SVG_MARKERUNITS_USERSPACEONUSE: number;
+ readonly SVG_MARKER_ORIENT_ANGLE: number;
+ readonly SVG_MARKER_ORIENT_AUTO: number;
+ readonly SVG_MARKER_ORIENT_UNKNOWN: number;
+}
+
+interface SVGMaskElement extends SVGElement, SVGStylable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGUnitTypes {
+ readonly height: SVGAnimatedLength;
+ readonly maskContentUnits: SVGAnimatedEnumeration;
+ readonly maskUnits: SVGAnimatedEnumeration;
+ readonly width: SVGAnimatedLength;
+ readonly x: SVGAnimatedLength;
+ readonly y: SVGAnimatedLength;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var SVGMaskElement: {
+ prototype: SVGMaskElement;
+ new(): SVGMaskElement;
+}
+
+interface SVGMatrix {
+ a: number;
+ b: number;
+ c: number;
+ d: number;
+ e: number;
+ f: number;
+ flipX(): SVGMatrix;
+ flipY(): SVGMatrix;
+ inverse(): SVGMatrix;
+ multiply(secondMatrix: SVGMatrix): SVGMatrix;
+ rotate(angle: number): SVGMatrix;
+ rotateFromVector(x: number, y: number): SVGMatrix;
+ scale(scaleFactor: number): SVGMatrix;
+ scaleNonUniform(scaleFactorX: number, scaleFactorY: number): SVGMatrix;
+ skewX(angle: number): SVGMatrix;
+ skewY(angle: number): SVGMatrix;
+ translate(x: number, y: number): SVGMatrix;
+}
+
+declare var SVGMatrix: {
+ prototype: SVGMatrix;
+ new(): SVGMatrix;
+}
+
+interface SVGMetadataElement extends SVGElement {
+}
+
+declare var SVGMetadataElement: {
+ prototype: SVGMetadataElement;
+ new(): SVGMetadataElement;
+}
+
+interface SVGNumber {
+ value: number;
+}
+
+declare var SVGNumber: {
+ prototype: SVGNumber;
+ new(): SVGNumber;
+}
+
+interface SVGNumberList {
+ readonly numberOfItems: number;
+ appendItem(newItem: SVGNumber): SVGNumber;
+ clear(): void;
+ getItem(index: number): SVGNumber;
+ initialize(newItem: SVGNumber): SVGNumber;
+ insertItemBefore(newItem: SVGNumber, index: number): SVGNumber;
+ removeItem(index: number): SVGNumber;
+ replaceItem(newItem: SVGNumber, index: number): SVGNumber;
+}
+
+declare var SVGNumberList: {
+ prototype: SVGNumberList;
+ new(): SVGNumberList;
+}
+
+interface SVGPathElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGAnimatedPathData {
+ createSVGPathSegArcAbs(x: number, y: number, r1: number, r2: number, angle: number, largeArcFlag: boolean, sweepFlag: boolean): SVGPathSegArcAbs;
+ createSVGPathSegArcRel(x: number, y: number, r1: number, r2: number, angle: number, largeArcFlag: boolean, sweepFlag: boolean): SVGPathSegArcRel;
+ createSVGPathSegClosePath(): SVGPathSegClosePath;
+ createSVGPathSegCurvetoCubicAbs(x: number, y: number, x1: number, y1: number, x2: number, y2: number): SVGPathSegCurvetoCubicAbs;
+ createSVGPathSegCurvetoCubicRel(x: number, y: number, x1: number, y1: number, x2: number, y2: number): SVGPathSegCurvetoCubicRel;
+ createSVGPathSegCurvetoCubicSmoothAbs(x: number, y: number, x2: number, y2: number): SVGPathSegCurvetoCubicSmoothAbs;
+ createSVGPathSegCurvetoCubicSmoothRel(x: number, y: number, x2: number, y2: number): SVGPathSegCurvetoCubicSmoothRel;
+ createSVGPathSegCurvetoQuadraticAbs(x: number, y: number, x1: number, y1: number): SVGPathSegCurvetoQuadraticAbs;
+ createSVGPathSegCurvetoQuadraticRel(x: number, y: number, x1: number, y1: number): SVGPathSegCurvetoQuadraticRel;
+ createSVGPathSegCurvetoQuadraticSmoothAbs(x: number, y: number): SVGPathSegCurvetoQuadraticSmoothAbs;
+ createSVGPathSegCurvetoQuadraticSmoothRel(x: number, y: number): SVGPathSegCurvetoQuadraticSmoothRel;
+ createSVGPathSegLinetoAbs(x: number, y: number): SVGPathSegLinetoAbs;
+ createSVGPathSegLinetoHorizontalAbs(x: number): SVGPathSegLinetoHorizontalAbs;
+ createSVGPathSegLinetoHorizontalRel(x: number): SVGPathSegLinetoHorizontalRel;
+ createSVGPathSegLinetoRel(x: number, y: number): SVGPathSegLinetoRel;
+ createSVGPathSegLinetoVerticalAbs(y: number): SVGPathSegLinetoVerticalAbs;
+ createSVGPathSegLinetoVerticalRel(y: number): SVGPathSegLinetoVerticalRel;
+ createSVGPathSegMovetoAbs(x: number, y: number): SVGPathSegMovetoAbs;
+ createSVGPathSegMovetoRel(x: number, y: number): SVGPathSegMovetoRel;
+ getPathSegAtLength(distance: number): number;
+ getPointAtLength(distance: number): SVGPoint;
+ getTotalLength(): number;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var SVGPathElement: {
+ prototype: SVGPathElement;
+ new(): SVGPathElement;
+}
+
+interface SVGPathSeg {
+ readonly pathSegType: number;
+ readonly pathSegTypeAsLetter: string;
+ readonly PATHSEG_ARC_ABS: number;
+ readonly PATHSEG_ARC_REL: number;
+ readonly PATHSEG_CLOSEPATH: number;
+ readonly PATHSEG_CURVETO_CUBIC_ABS: number;
+ readonly PATHSEG_CURVETO_CUBIC_REL: number;
+ readonly PATHSEG_CURVETO_CUBIC_SMOOTH_ABS: number;
+ readonly PATHSEG_CURVETO_CUBIC_SMOOTH_REL: number;
+ readonly PATHSEG_CURVETO_QUADRATIC_ABS: number;
+ readonly PATHSEG_CURVETO_QUADRATIC_REL: number;
+ readonly PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS: number;
+ readonly PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL: number;
+ readonly PATHSEG_LINETO_ABS: number;
+ readonly PATHSEG_LINETO_HORIZONTAL_ABS: number;
+ readonly PATHSEG_LINETO_HORIZONTAL_REL: number;
+ readonly PATHSEG_LINETO_REL: number;
+ readonly PATHSEG_LINETO_VERTICAL_ABS: number;
+ readonly PATHSEG_LINETO_VERTICAL_REL: number;
+ readonly PATHSEG_MOVETO_ABS: number;
+ readonly PATHSEG_MOVETO_REL: number;
+ readonly PATHSEG_UNKNOWN: number;
+}
+
+declare var SVGPathSeg: {
+ prototype: SVGPathSeg;
+ new(): SVGPathSeg;
+ readonly PATHSEG_ARC_ABS: number;
+ readonly PATHSEG_ARC_REL: number;
+ readonly PATHSEG_CLOSEPATH: number;
+ readonly PATHSEG_CURVETO_CUBIC_ABS: number;
+ readonly PATHSEG_CURVETO_CUBIC_REL: number;
+ readonly PATHSEG_CURVETO_CUBIC_SMOOTH_ABS: number;
+ readonly PATHSEG_CURVETO_CUBIC_SMOOTH_REL: number;
+ readonly PATHSEG_CURVETO_QUADRATIC_ABS: number;
+ readonly PATHSEG_CURVETO_QUADRATIC_REL: number;
+ readonly PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS: number;
+ readonly PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL: number;
+ readonly PATHSEG_LINETO_ABS: number;
+ readonly PATHSEG_LINETO_HORIZONTAL_ABS: number;
+ readonly PATHSEG_LINETO_HORIZONTAL_REL: number;
+ readonly PATHSEG_LINETO_REL: number;
+ readonly PATHSEG_LINETO_VERTICAL_ABS: number;
+ readonly PATHSEG_LINETO_VERTICAL_REL: number;
+ readonly PATHSEG_MOVETO_ABS: number;
+ readonly PATHSEG_MOVETO_REL: number;
+ readonly PATHSEG_UNKNOWN: number;
+}
+
+interface SVGPathSegArcAbs extends SVGPathSeg {
+ angle: number;
+ largeArcFlag: boolean;
+ r1: number;
+ r2: number;
+ sweepFlag: boolean;
+ x: number;
+ y: number;
+}
+
+declare var SVGPathSegArcAbs: {
+ prototype: SVGPathSegArcAbs;
+ new(): SVGPathSegArcAbs;
+}
+
+interface SVGPathSegArcRel extends SVGPathSeg {
+ angle: number;
+ largeArcFlag: boolean;
+ r1: number;
+ r2: number;
+ sweepFlag: boolean;
+ x: number;
+ y: number;
+}
+
+declare var SVGPathSegArcRel: {
+ prototype: SVGPathSegArcRel;
+ new(): SVGPathSegArcRel;
+}
+
+interface SVGPathSegClosePath extends SVGPathSeg {
+}
+
+declare var SVGPathSegClosePath: {
+ prototype: SVGPathSegClosePath;
+ new(): SVGPathSegClosePath;
+}
+
+interface SVGPathSegCurvetoCubicAbs extends SVGPathSeg {
+ x: number;
+ x1: number;
+ x2: number;
+ y: number;
+ y1: number;
+ y2: number;
+}
+
+declare var SVGPathSegCurvetoCubicAbs: {
+ prototype: SVGPathSegCurvetoCubicAbs;
+ new(): SVGPathSegCurvetoCubicAbs;
+}
+
+interface SVGPathSegCurvetoCubicRel extends SVGPathSeg {
+ x: number;
+ x1: number;
+ x2: number;
+ y: number;
+ y1: number;
+ y2: number;
+}
+
+declare var SVGPathSegCurvetoCubicRel: {
+ prototype: SVGPathSegCurvetoCubicRel;
+ new(): SVGPathSegCurvetoCubicRel;
+}
+
+interface SVGPathSegCurvetoCubicSmoothAbs extends SVGPathSeg {
+ x: number;
+ x2: number;
+ y: number;
+ y2: number;
+}
+
+declare var SVGPathSegCurvetoCubicSmoothAbs: {
+ prototype: SVGPathSegCurvetoCubicSmoothAbs;
+ new(): SVGPathSegCurvetoCubicSmoothAbs;
+}
+
+interface SVGPathSegCurvetoCubicSmoothRel extends SVGPathSeg {
+ x: number;
+ x2: number;
+ y: number;
+ y2: number;
+}
+
+declare var SVGPathSegCurvetoCubicSmoothRel: {
+ prototype: SVGPathSegCurvetoCubicSmoothRel;
+ new(): SVGPathSegCurvetoCubicSmoothRel;
+}
+
+interface SVGPathSegCurvetoQuadraticAbs extends SVGPathSeg {
+ x: number;
+ x1: number;
+ y: number;
+ y1: number;
+}
+
+declare var SVGPathSegCurvetoQuadraticAbs: {
+ prototype: SVGPathSegCurvetoQuadraticAbs;
+ new(): SVGPathSegCurvetoQuadraticAbs;
+}
+
+interface SVGPathSegCurvetoQuadraticRel extends SVGPathSeg {
+ x: number;
+ x1: number;
+ y: number;
+ y1: number;
+}
+
+declare var SVGPathSegCurvetoQuadraticRel: {
+ prototype: SVGPathSegCurvetoQuadraticRel;
+ new(): SVGPathSegCurvetoQuadraticRel;
+}
+
+interface SVGPathSegCurvetoQuadraticSmoothAbs extends SVGPathSeg {
+ x: number;
+ y: number;
+}
+
+declare var SVGPathSegCurvetoQuadraticSmoothAbs: {
+ prototype: SVGPathSegCurvetoQuadraticSmoothAbs;
+ new(): SVGPathSegCurvetoQuadraticSmoothAbs;
+}
+
+interface SVGPathSegCurvetoQuadraticSmoothRel extends SVGPathSeg {
+ x: number;
+ y: number;
+}
+
+declare var SVGPathSegCurvetoQuadraticSmoothRel: {
+ prototype: SVGPathSegCurvetoQuadraticSmoothRel;
+ new(): SVGPathSegCurvetoQuadraticSmoothRel;
+}
+
+interface SVGPathSegLinetoAbs extends SVGPathSeg {
+ x: number;
+ y: number;
+}
+
+declare var SVGPathSegLinetoAbs: {
+ prototype: SVGPathSegLinetoAbs;
+ new(): SVGPathSegLinetoAbs;
+}
+
+interface SVGPathSegLinetoHorizontalAbs extends SVGPathSeg {
+ x: number;
+}
+
+declare var SVGPathSegLinetoHorizontalAbs: {
+ prototype: SVGPathSegLinetoHorizontalAbs;
+ new(): SVGPathSegLinetoHorizontalAbs;
+}
+
+interface SVGPathSegLinetoHorizontalRel extends SVGPathSeg {
+ x: number;
+}
+
+declare var SVGPathSegLinetoHorizontalRel: {
+ prototype: SVGPathSegLinetoHorizontalRel;
+ new(): SVGPathSegLinetoHorizontalRel;
+}
+
+interface SVGPathSegLinetoRel extends SVGPathSeg {
+ x: number;
+ y: number;
+}
+
+declare var SVGPathSegLinetoRel: {
+ prototype: SVGPathSegLinetoRel;
+ new(): SVGPathSegLinetoRel;
+}
+
+interface SVGPathSegLinetoVerticalAbs extends SVGPathSeg {
+ y: number;
+}
+
+declare var SVGPathSegLinetoVerticalAbs: {
+ prototype: SVGPathSegLinetoVerticalAbs;
+ new(): SVGPathSegLinetoVerticalAbs;
+}
+
+interface SVGPathSegLinetoVerticalRel extends SVGPathSeg {
+ y: number;
+}
+
+declare var SVGPathSegLinetoVerticalRel: {
+ prototype: SVGPathSegLinetoVerticalRel;
+ new(): SVGPathSegLinetoVerticalRel;
+}
+
+interface SVGPathSegList {
+ readonly numberOfItems: number;
+ appendItem(newItem: SVGPathSeg): SVGPathSeg;
+ clear(): void;
+ getItem(index: number): SVGPathSeg;
+ initialize(newItem: SVGPathSeg): SVGPathSeg;
+ insertItemBefore(newItem: SVGPathSeg, index: number): SVGPathSeg;
+ removeItem(index: number): SVGPathSeg;
+ replaceItem(newItem: SVGPathSeg, index: number): SVGPathSeg;
+}
+
+declare var SVGPathSegList: {
+ prototype: SVGPathSegList;
+ new(): SVGPathSegList;
+}
+
+interface SVGPathSegMovetoAbs extends SVGPathSeg {
+ x: number;
+ y: number;
+}
+
+declare var SVGPathSegMovetoAbs: {
+ prototype: SVGPathSegMovetoAbs;
+ new(): SVGPathSegMovetoAbs;
+}
+
+interface SVGPathSegMovetoRel extends SVGPathSeg {
+ x: number;
+ y: number;
+}
+
+declare var SVGPathSegMovetoRel: {
+ prototype: SVGPathSegMovetoRel;
+ new(): SVGPathSegMovetoRel;
+}
+
+interface SVGPatternElement extends SVGElement, SVGStylable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGFitToViewBox, SVGURIReference, SVGUnitTypes {
+ readonly height: SVGAnimatedLength;
+ readonly patternContentUnits: SVGAnimatedEnumeration;
+ readonly patternTransform: SVGAnimatedTransformList;
+ readonly patternUnits: SVGAnimatedEnumeration;
+ readonly width: SVGAnimatedLength;
+ readonly x: SVGAnimatedLength;
+ readonly y: SVGAnimatedLength;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var SVGPatternElement: {
+ prototype: SVGPatternElement;
+ new(): SVGPatternElement;
+}
+
+interface SVGPoint {
+ x: number;
+ y: number;
+ matrixTransform(matrix: SVGMatrix): SVGPoint;
+}
+
+declare var SVGPoint: {
+ prototype: SVGPoint;
+ new(): SVGPoint;
+}
+
+interface SVGPointList {
+ readonly numberOfItems: number;
+ appendItem(newItem: SVGPoint): SVGPoint;
+ clear(): void;
+ getItem(index: number): SVGPoint;
+ initialize(newItem: SVGPoint): SVGPoint;
+ insertItemBefore(newItem: SVGPoint, index: number): SVGPoint;
+ removeItem(index: number): SVGPoint;
+ replaceItem(newItem: SVGPoint, index: number): SVGPoint;
+}
+
+declare var SVGPointList: {
+ prototype: SVGPointList;
+ new(): SVGPointList;
+}
+
+interface SVGPolygonElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGAnimatedPoints {
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var SVGPolygonElement: {
+ prototype: SVGPolygonElement;
+ new(): SVGPolygonElement;
+}
+
+interface SVGPolylineElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGAnimatedPoints {
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var SVGPolylineElement: {
+ prototype: SVGPolylineElement;
+ new(): SVGPolylineElement;
+}
+
+interface SVGPreserveAspectRatio {
+ align: number;
+ meetOrSlice: number;
+ readonly SVG_MEETORSLICE_MEET: number;
+ readonly SVG_MEETORSLICE_SLICE: number;
+ readonly SVG_MEETORSLICE_UNKNOWN: number;
+ readonly SVG_PRESERVEASPECTRATIO_NONE: number;
+ readonly SVG_PRESERVEASPECTRATIO_UNKNOWN: number;
+ readonly SVG_PRESERVEASPECTRATIO_XMAXYMAX: number;
+ readonly SVG_PRESERVEASPECTRATIO_XMAXYMID: number;
+ readonly SVG_PRESERVEASPECTRATIO_XMAXYMIN: number;
+ readonly SVG_PRESERVEASPECTRATIO_XMIDYMAX: number;
+ readonly SVG_PRESERVEASPECTRATIO_XMIDYMID: number;
+ readonly SVG_PRESERVEASPECTRATIO_XMIDYMIN: number;
+ readonly SVG_PRESERVEASPECTRATIO_XMINYMAX: number;
+ readonly SVG_PRESERVEASPECTRATIO_XMINYMID: number;
+ readonly SVG_PRESERVEASPECTRATIO_XMINYMIN: number;
+}
+
+declare var SVGPreserveAspectRatio: {
+ prototype: SVGPreserveAspectRatio;
+ new(): SVGPreserveAspectRatio;
+ readonly SVG_MEETORSLICE_MEET: number;
+ readonly SVG_MEETORSLICE_SLICE: number;
+ readonly SVG_MEETORSLICE_UNKNOWN: number;
+ readonly SVG_PRESERVEASPECTRATIO_NONE: number;
+ readonly SVG_PRESERVEASPECTRATIO_UNKNOWN: number;
+ readonly SVG_PRESERVEASPECTRATIO_XMAXYMAX: number;
+ readonly SVG_PRESERVEASPECTRATIO_XMAXYMID: number;
+ readonly SVG_PRESERVEASPECTRATIO_XMAXYMIN: number;
+ readonly SVG_PRESERVEASPECTRATIO_XMIDYMAX: number;
+ readonly SVG_PRESERVEASPECTRATIO_XMIDYMID: number;
+ readonly SVG_PRESERVEASPECTRATIO_XMIDYMIN: number;
+ readonly SVG_PRESERVEASPECTRATIO_XMINYMAX: number;
+ readonly SVG_PRESERVEASPECTRATIO_XMINYMID: number;
+ readonly SVG_PRESERVEASPECTRATIO_XMINYMIN: number;
+}
+
+interface SVGRadialGradientElement extends SVGGradientElement {
+ readonly cx: SVGAnimatedLength;
+ readonly cy: SVGAnimatedLength;
+ readonly fx: SVGAnimatedLength;
+ readonly fy: SVGAnimatedLength;
+ readonly r: SVGAnimatedLength;
+}
+
+declare var SVGRadialGradientElement: {
+ prototype: SVGRadialGradientElement;
+ new(): SVGRadialGradientElement;
+}
+
+interface SVGRect {
+ height: number;
+ width: number;
+ x: number;
+ y: number;
+}
+
+declare var SVGRect: {
+ prototype: SVGRect;
+ new(): SVGRect;
+}
+
+interface SVGRectElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired {
+ readonly height: SVGAnimatedLength;
+ readonly rx: SVGAnimatedLength;
+ readonly ry: SVGAnimatedLength;
+ readonly width: SVGAnimatedLength;
+ readonly x: SVGAnimatedLength;
+ readonly y: SVGAnimatedLength;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var SVGRectElement: {
+ prototype: SVGRectElement;
+ new(): SVGRectElement;
+}
+
+interface SVGSVGElement extends SVGElement, DocumentEvent, SVGLocatable, SVGTests, SVGStylable, SVGLangSpace, SVGExternalResourcesRequired, SVGFitToViewBox, SVGZoomAndPan {
+ contentScriptType: string;
+ contentStyleType: string;
+ currentScale: number;
+ readonly currentTranslate: SVGPoint;
+ readonly height: SVGAnimatedLength;
+ onabort: (this: this, ev: Event) => any;
+ onerror: (this: this, ev: Event) => any;
+ onresize: (this: this, ev: UIEvent) => any;
+ onscroll: (this: this, ev: UIEvent) => any;
+ onunload: (this: this, ev: Event) => any;
+ onzoom: (this: this, ev: SVGZoomEvent) => any;
+ readonly pixelUnitToMillimeterX: number;
+ readonly pixelUnitToMillimeterY: number;
+ readonly screenPixelToMillimeterX: number;
+ readonly screenPixelToMillimeterY: number;
+ readonly viewport: SVGRect;
+ readonly width: SVGAnimatedLength;
+ readonly x: SVGAnimatedLength;
+ readonly y: SVGAnimatedLength;
+ checkEnclosure(element: SVGElement, rect: SVGRect): boolean;
+ checkIntersection(element: SVGElement, rect: SVGRect): boolean;
+ createSVGAngle(): SVGAngle;
+ createSVGLength(): SVGLength;
+ createSVGMatrix(): SVGMatrix;
+ createSVGNumber(): SVGNumber;
+ createSVGPoint(): SVGPoint;
+ createSVGRect(): SVGRect;
+ createSVGTransform(): SVGTransform;
+ createSVGTransformFromMatrix(matrix: SVGMatrix): SVGTransform;
+ deselectAll(): void;
+ forceRedraw(): void;
+ getComputedStyle(elt: Element, pseudoElt?: string): CSSStyleDeclaration;
+ getCurrentTime(): number;
+ getElementById(elementId: string): Element;
+ getEnclosureList(rect: SVGRect, referenceElement: SVGElement): NodeListOf<SVGCircleElement | SVGEllipseElement | SVGImageElement | SVGLineElement | SVGPathElement | SVGPolygonElement | SVGPolylineElement | SVGRectElement | SVGTextElement | SVGUseElement>;
+ getIntersectionList(rect: SVGRect, referenceElement: SVGElement): NodeListOf<SVGCircleElement | SVGEllipseElement | SVGImageElement | SVGLineElement | SVGPathElement | SVGPolygonElement | SVGPolylineElement | SVGRectElement | SVGTextElement | SVGUseElement>;
+ pauseAnimations(): void;
+ setCurrentTime(seconds: number): void;
+ suspendRedraw(maxWaitMilliseconds: number): number;
+ unpauseAnimations(): void;
+ unsuspendRedraw(suspendHandleID: number): void;
+ unsuspendRedrawAll(): void;
+ addEventListener(type: "MSGestureChange", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureDoubleTap", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureEnd", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureHold", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureStart", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureTap", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGotPointerCapture", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSInertiaStart", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSLostPointerCapture", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerCancel", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerDown", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerEnter", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerLeave", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerMove", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerOut", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerOver", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerUp", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "SVGAbort", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "SVGError", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "SVGUnload", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "SVGZoom", listener: (this: this, ev: SVGZoomEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "ariarequest", listener: (this: this, ev: AriaRequestEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "click", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "command", listener: (this: this, ev: CommandEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dblclick", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "focusin", listener: (this: this, ev: FocusEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "focusout", listener: (this: this, ev: FocusEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "gotpointercapture", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "load", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "lostpointercapture", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mousedown", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mousemove", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mouseout", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mouseover", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mouseup", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointercancel", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerdown", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerenter", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerleave", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointermove", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerout", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerover", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerup", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "resize", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "scroll", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "touchcancel", listener: (this: this, ev: TouchEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "touchend", listener: (this: this, ev: TouchEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "touchmove", listener: (this: this, ev: TouchEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "touchstart", listener: (this: this, ev: TouchEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "webkitfullscreenchange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "webkitfullscreenerror", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "wheel", listener: (this: this, ev: WheelEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var SVGSVGElement: {
+ prototype: SVGSVGElement;
+ new(): SVGSVGElement;
+}
+
+interface SVGScriptElement extends SVGElement, SVGExternalResourcesRequired, SVGURIReference {
+ type: string;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var SVGScriptElement: {
+ prototype: SVGScriptElement;
+ new(): SVGScriptElement;
+}
+
+interface SVGStopElement extends SVGElement, SVGStylable {
+ readonly offset: SVGAnimatedNumber;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var SVGStopElement: {
+ prototype: SVGStopElement;
+ new(): SVGStopElement;
+}
+
+interface SVGStringList {
+ readonly numberOfItems: number;
+ appendItem(newItem: string): string;
+ clear(): void;
+ getItem(index: number): string;
+ initialize(newItem: string): string;
+ insertItemBefore(newItem: string, index: number): string;
+ removeItem(index: number): string;
+ replaceItem(newItem: string, index: number): string;
+}
+
+declare var SVGStringList: {
+ prototype: SVGStringList;
+ new(): SVGStringList;
+}
+
+interface SVGStyleElement extends SVGElement, SVGLangSpace {
+ disabled: boolean;
+ media: string;
+ title: string;
+ type: string;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var SVGStyleElement: {
+ prototype: SVGStyleElement;
+ new(): SVGStyleElement;
+}
+
+interface SVGSwitchElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired {
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var SVGSwitchElement: {
+ prototype: SVGSwitchElement;
+ new(): SVGSwitchElement;
+}
+
+interface SVGSymbolElement extends SVGElement, SVGStylable, SVGLangSpace, SVGExternalResourcesRequired, SVGFitToViewBox {
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var SVGSymbolElement: {
+ prototype: SVGSymbolElement;
+ new(): SVGSymbolElement;
+}
+
+interface SVGTSpanElement extends SVGTextPositioningElement {
+}
+
+declare var SVGTSpanElement: {
+ prototype: SVGTSpanElement;
+ new(): SVGTSpanElement;
+}
+
+interface SVGTextContentElement extends SVGElement, SVGStylable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired {
+ readonly lengthAdjust: SVGAnimatedEnumeration;
+ readonly textLength: SVGAnimatedLength;
+ getCharNumAtPosition(point: SVGPoint): number;
+ getComputedTextLength(): number;
+ getEndPositionOfChar(charnum: number): SVGPoint;
+ getExtentOfChar(charnum: number): SVGRect;
+ getNumberOfChars(): number;
+ getRotationOfChar(charnum: number): number;
+ getStartPositionOfChar(charnum: number): SVGPoint;
+ getSubStringLength(charnum: number, nchars: number): number;
+ selectSubString(charnum: number, nchars: number): void;
+ readonly LENGTHADJUST_SPACING: number;
+ readonly LENGTHADJUST_SPACINGANDGLYPHS: number;
+ readonly LENGTHADJUST_UNKNOWN: number;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var SVGTextContentElement: {
+ prototype: SVGTextContentElement;
+ new(): SVGTextContentElement;
+ readonly LENGTHADJUST_SPACING: number;
+ readonly LENGTHADJUST_SPACINGANDGLYPHS: number;
+ readonly LENGTHADJUST_UNKNOWN: number;
+}
+
+interface SVGTextElement extends SVGTextPositioningElement, SVGTransformable {
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var SVGTextElement: {
+ prototype: SVGTextElement;
+ new(): SVGTextElement;
+}
+
+interface SVGTextPathElement extends SVGTextContentElement, SVGURIReference {
+ readonly method: SVGAnimatedEnumeration;
+ readonly spacing: SVGAnimatedEnumeration;
+ readonly startOffset: SVGAnimatedLength;
+ readonly TEXTPATH_METHODTYPE_ALIGN: number;
+ readonly TEXTPATH_METHODTYPE_STRETCH: number;
+ readonly TEXTPATH_METHODTYPE_UNKNOWN: number;
+ readonly TEXTPATH_SPACINGTYPE_AUTO: number;
+ readonly TEXTPATH_SPACINGTYPE_EXACT: number;
+ readonly TEXTPATH_SPACINGTYPE_UNKNOWN: number;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var SVGTextPathElement: {
+ prototype: SVGTextPathElement;
+ new(): SVGTextPathElement;
+ readonly TEXTPATH_METHODTYPE_ALIGN: number;
+ readonly TEXTPATH_METHODTYPE_STRETCH: number;
+ readonly TEXTPATH_METHODTYPE_UNKNOWN: number;
+ readonly TEXTPATH_SPACINGTYPE_AUTO: number;
+ readonly TEXTPATH_SPACINGTYPE_EXACT: number;
+ readonly TEXTPATH_SPACINGTYPE_UNKNOWN: number;
+}
+
+interface SVGTextPositioningElement extends SVGTextContentElement {
+ readonly dx: SVGAnimatedLengthList;
+ readonly dy: SVGAnimatedLengthList;
+ readonly rotate: SVGAnimatedNumberList;
+ readonly x: SVGAnimatedLengthList;
+ readonly y: SVGAnimatedLengthList;
+}
+
+declare var SVGTextPositioningElement: {
+ prototype: SVGTextPositioningElement;
+ new(): SVGTextPositioningElement;
+}
+
+interface SVGTitleElement extends SVGElement, SVGStylable, SVGLangSpace {
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var SVGTitleElement: {
+ prototype: SVGTitleElement;
+ new(): SVGTitleElement;
+}
+
+interface SVGTransform {
+ readonly angle: number;
+ readonly matrix: SVGMatrix;
+ readonly type: number;
+ setMatrix(matrix: SVGMatrix): void;
+ setRotate(angle: number, cx: number, cy: number): void;
+ setScale(sx: number, sy: number): void;
+ setSkewX(angle: number): void;
+ setSkewY(angle: number): void;
+ setTranslate(tx: number, ty: number): void;
+ readonly SVG_TRANSFORM_MATRIX: number;
+ readonly SVG_TRANSFORM_ROTATE: number;
+ readonly SVG_TRANSFORM_SCALE: number;
+ readonly SVG_TRANSFORM_SKEWX: number;
+ readonly SVG_TRANSFORM_SKEWY: number;
+ readonly SVG_TRANSFORM_TRANSLATE: number;
+ readonly SVG_TRANSFORM_UNKNOWN: number;
+}
+
+declare var SVGTransform: {
+ prototype: SVGTransform;
+ new(): SVGTransform;
+ readonly SVG_TRANSFORM_MATRIX: number;
+ readonly SVG_TRANSFORM_ROTATE: number;
+ readonly SVG_TRANSFORM_SCALE: number;
+ readonly SVG_TRANSFORM_SKEWX: number;
+ readonly SVG_TRANSFORM_SKEWY: number;
+ readonly SVG_TRANSFORM_TRANSLATE: number;
+ readonly SVG_TRANSFORM_UNKNOWN: number;
+}
+
+interface SVGTransformList {
+ readonly numberOfItems: number;
+ appendItem(newItem: SVGTransform): SVGTransform;
+ clear(): void;
+ consolidate(): SVGTransform;
+ createSVGTransformFromMatrix(matrix: SVGMatrix): SVGTransform;
+ getItem(index: number): SVGTransform;
+ initialize(newItem: SVGTransform): SVGTransform;
+ insertItemBefore(newItem: SVGTransform, index: number): SVGTransform;
+ removeItem(index: number): SVGTransform;
+ replaceItem(newItem: SVGTransform, index: number): SVGTransform;
+}
+
+declare var SVGTransformList: {
+ prototype: SVGTransformList;
+ new(): SVGTransformList;
+}
+
+interface SVGUnitTypes {
+ readonly SVG_UNIT_TYPE_OBJECTBOUNDINGBOX: number;
+ readonly SVG_UNIT_TYPE_UNKNOWN: number;
+ readonly SVG_UNIT_TYPE_USERSPACEONUSE: number;
+}
+declare var SVGUnitTypes: SVGUnitTypes;
+
+interface SVGUseElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGURIReference {
+ readonly animatedInstanceRoot: SVGElementInstance;
+ readonly height: SVGAnimatedLength;
+ readonly instanceRoot: SVGElementInstance;
+ readonly width: SVGAnimatedLength;
+ readonly x: SVGAnimatedLength;
+ readonly y: SVGAnimatedLength;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var SVGUseElement: {
+ prototype: SVGUseElement;
+ new(): SVGUseElement;
+}
+
+interface SVGViewElement extends SVGElement, SVGExternalResourcesRequired, SVGFitToViewBox, SVGZoomAndPan {
+ readonly viewTarget: SVGStringList;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var SVGViewElement: {
+ prototype: SVGViewElement;
+ new(): SVGViewElement;
+}
+
+interface SVGZoomAndPan {
+ readonly zoomAndPan: number;
+}
+
+declare var SVGZoomAndPan: {
+ readonly SVG_ZOOMANDPAN_DISABLE: number;
+ readonly SVG_ZOOMANDPAN_MAGNIFY: number;
+ readonly SVG_ZOOMANDPAN_UNKNOWN: number;
+}
+
+interface SVGZoomEvent extends UIEvent {
+ readonly newScale: number;
+ readonly newTranslate: SVGPoint;
+ readonly previousScale: number;
+ readonly previousTranslate: SVGPoint;
+ readonly zoomRectScreen: SVGRect;
+}
+
+declare var SVGZoomEvent: {
+ prototype: SVGZoomEvent;
+ new(): SVGZoomEvent;
+}
+
+interface Screen extends EventTarget {
+ readonly availHeight: number;
+ readonly availWidth: number;
+ bufferDepth: number;
+ readonly colorDepth: number;
+ readonly deviceXDPI: number;
+ readonly deviceYDPI: number;
+ readonly fontSmoothingEnabled: boolean;
+ readonly height: number;
+ readonly logicalXDPI: number;
+ readonly logicalYDPI: number;
+ readonly msOrientation: string;
+ onmsorientationchange: (this: this, ev: Event) => any;
+ readonly pixelDepth: number;
+ readonly systemXDPI: number;
+ readonly systemYDPI: number;
+ readonly width: number;
+ msLockOrientation(orientations: string | string[]): boolean;
+ msUnlockOrientation(): void;
+ addEventListener(type: "MSOrientationChange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var Screen: {
+ prototype: Screen;
+ new(): Screen;
+}
+
+interface ScriptNotifyEvent extends Event {
+ readonly callingUri: string;
+ readonly value: string;
+}
+
+declare var ScriptNotifyEvent: {
+ prototype: ScriptNotifyEvent;
+ new(): ScriptNotifyEvent;
+}
+
+interface ScriptProcessorNode extends AudioNode {
+ readonly bufferSize: number;
+ onaudioprocess: (this: this, ev: AudioProcessingEvent) => any;
+ addEventListener(type: "audioprocess", listener: (this: this, ev: AudioProcessingEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var ScriptProcessorNode: {
+ prototype: ScriptProcessorNode;
+ new(): ScriptProcessorNode;
+}
+
+interface Selection {
+ readonly anchorNode: Node;
+ readonly anchorOffset: number;
+ readonly focusNode: Node;
+ readonly focusOffset: number;
+ readonly isCollapsed: boolean;
+ readonly rangeCount: number;
+ readonly type: string;
+ addRange(range: Range): void;
+ collapse(parentNode: Node, offset: number): void;
+ collapseToEnd(): void;
+ collapseToStart(): void;
+ containsNode(node: Node, partlyContained: boolean): boolean;
+ deleteFromDocument(): void;
+ empty(): void;
+ extend(newNode: Node, offset: number): void;
+ getRangeAt(index: number): Range;
+ removeAllRanges(): void;
+ removeRange(range: Range): void;
+ selectAllChildren(parentNode: Node): void;
+ setBaseAndExtent(baseNode: Node, baseOffset: number, extentNode: Node, extentOffset: number): void;
+ toString(): string;
+}
+
+declare var Selection: {
+ prototype: Selection;
+ new(): Selection;
+}
+
+interface SourceBuffer extends EventTarget {
+ appendWindowEnd: number;
+ appendWindowStart: number;
+ readonly audioTracks: AudioTrackList;
+ readonly buffered: TimeRanges;
+ mode: string;
+ timestampOffset: number;
+ readonly updating: boolean;
+ readonly videoTracks: VideoTrackList;
+ abort(): void;
+ appendBuffer(data: ArrayBuffer | ArrayBufferView): void;
+ appendStream(stream: MSStream, maxSize?: number): void;
+ remove(start: number, end: number): void;
+}
+
+declare var SourceBuffer: {
+ prototype: SourceBuffer;
+ new(): SourceBuffer;
+}
+
+interface SourceBufferList extends EventTarget {
+ readonly length: number;
+ item(index: number): SourceBuffer;
+ [index: number]: SourceBuffer;
+}
+
+declare var SourceBufferList: {
+ prototype: SourceBufferList;
+ new(): SourceBufferList;
+}
+
+interface StereoPannerNode extends AudioNode {
+ readonly pan: AudioParam;
+}
+
+declare var StereoPannerNode: {
+ prototype: StereoPannerNode;
+ new(): StereoPannerNode;
+}
+
+interface Storage {
+ readonly length: number;
+ clear(): void;
+ getItem(key: string): string | null;
+ key(index: number): string | null;
+ removeItem(key: string): void;
+ setItem(key: string, data: string): void;
+ [key: string]: any;
+ [index: number]: string;
+}
+
+declare var Storage: {
+ prototype: Storage;
+ new(): Storage;
+}
+
+interface StorageEvent extends Event {
+ readonly url: string;
+ key?: string;
+ oldValue?: string;
+ newValue?: string;
+ storageArea?: Storage;
+}
+
+declare var StorageEvent: {
+ prototype: StorageEvent;
+ new (type: string, eventInitDict?: StorageEventInit): StorageEvent;
+}
+
+interface StyleMedia {
+ readonly type: string;
+ matchMedium(mediaquery: string): boolean;
+}
+
+declare var StyleMedia: {
+ prototype: StyleMedia;
+ new(): StyleMedia;
+}
+
+interface StyleSheet {
+ disabled: boolean;
+ readonly href: string;
+ readonly media: MediaList;
+ readonly ownerNode: Node;
+ readonly parentStyleSheet: StyleSheet;
+ readonly title: string;
+ readonly type: string;
+}
+
+declare var StyleSheet: {
+ prototype: StyleSheet;
+ new(): StyleSheet;
+}
+
+interface StyleSheetList {
+ readonly length: number;
+ item(index?: number): StyleSheet;
+ [index: number]: StyleSheet;
+}
+
+declare var StyleSheetList: {
+ prototype: StyleSheetList;
+ new(): StyleSheetList;
+}
+
+interface StyleSheetPageList {
+ readonly length: number;
+ item(index: number): CSSPageRule;
+ [index: number]: CSSPageRule;
+}
+
+declare var StyleSheetPageList: {
+ prototype: StyleSheetPageList;
+ new(): StyleSheetPageList;
+}
+
+interface SubtleCrypto {
+ decrypt(algorithm: string | RsaOaepParams | AesCtrParams | AesCbcParams | AesCmacParams | AesGcmParams | AesCfbParams, key: CryptoKey, data: BufferSource): PromiseLike<ArrayBuffer>;
+ deriveBits(algorithm: string | EcdhKeyDeriveParams | DhKeyDeriveParams | ConcatParams | HkdfCtrParams | Pbkdf2Params, baseKey: CryptoKey, length: number): PromiseLike<ArrayBuffer>;
+ deriveKey(algorithm: string | EcdhKeyDeriveParams | DhKeyDeriveParams | ConcatParams | HkdfCtrParams | Pbkdf2Params, baseKey: CryptoKey, derivedKeyType: string | AesDerivedKeyParams | HmacImportParams | ConcatParams | HkdfCtrParams | Pbkdf2Params, extractable: boolean, keyUsages: string[]): PromiseLike<CryptoKey>;
+ digest(algorithm: AlgorithmIdentifier, data: BufferSource): PromiseLike<ArrayBuffer>;
+ encrypt(algorithm: string | RsaOaepParams | AesCtrParams | AesCbcParams | AesCmacParams | AesGcmParams | AesCfbParams, key: CryptoKey, data: BufferSource): PromiseLike<ArrayBuffer>;
+ exportKey(format: "jwk", key: CryptoKey): PromiseLike<JsonWebKey>;
+ exportKey(format: "raw" | "pkcs8" | "spki", key: CryptoKey): PromiseLike<ArrayBuffer>;
+ exportKey(format: string, key: CryptoKey): PromiseLike<JsonWebKey | ArrayBuffer>;
+ generateKey(algorithm: string, extractable: boolean, keyUsages: string[]): PromiseLike<CryptoKeyPair | CryptoKey>;
+ generateKey(algorithm: RsaHashedKeyGenParams | EcKeyGenParams | DhKeyGenParams, extractable: boolean, keyUsages: string[]): PromiseLike<CryptoKeyPair>;
+ generateKey(algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, extractable: boolean, keyUsages: string[]): PromiseLike<CryptoKey>;
+ importKey(format: "jwk", keyData: JsonWebKey, algorithm: string | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | DhImportKeyParams, extractable:boolean, keyUsages: string[]): PromiseLike<CryptoKey>;
+ importKey(format: "raw" | "pkcs8" | "spki", keyData: BufferSource, algorithm: string | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | DhImportKeyParams, extractable:boolean, keyUsages: string[]): PromiseLike<CryptoKey>;
+ importKey(format: string, keyData: JsonWebKey | BufferSource, algorithm: string | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | DhImportKeyParams, extractable:boolean, keyUsages: string[]): PromiseLike<CryptoKey>;
+ sign(algorithm: string | RsaPssParams | EcdsaParams | AesCmacParams, key: CryptoKey, data: BufferSource): PromiseLike<ArrayBuffer>;
+ unwrapKey(format: string, wrappedKey: BufferSource, unwrappingKey: CryptoKey, unwrapAlgorithm: AlgorithmIdentifier, unwrappedKeyAlgorithm: AlgorithmIdentifier, extractable: boolean, keyUsages: string[]): PromiseLike<CryptoKey>;
+ verify(algorithm: string | RsaPssParams | EcdsaParams | AesCmacParams, key: CryptoKey, signature: BufferSource, data: BufferSource): PromiseLike<boolean>;
+ wrapKey(format: string, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: AlgorithmIdentifier): PromiseLike<ArrayBuffer>;
+}
+
+declare var SubtleCrypto: {
+ prototype: SubtleCrypto;
+ new(): SubtleCrypto;
+}
+
+interface Text extends CharacterData {
+ readonly wholeText: string;
+ splitText(offset: number): Text;
+}
+
+declare var Text: {
+ prototype: Text;
+ new(): Text;
+}
+
+interface TextEvent extends UIEvent {
+ readonly data: string;
+ readonly inputMethod: number;
+ readonly locale: string;
+ initTextEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, dataArg: string, inputMethod: number, locale: string): void;
+ readonly DOM_INPUT_METHOD_DROP: number;
+ readonly DOM_INPUT_METHOD_HANDWRITING: number;
+ readonly DOM_INPUT_METHOD_IME: number;
+ readonly DOM_INPUT_METHOD_KEYBOARD: number;
+ readonly DOM_INPUT_METHOD_MULTIMODAL: number;
+ readonly DOM_INPUT_METHOD_OPTION: number;
+ readonly DOM_INPUT_METHOD_PASTE: number;
+ readonly DOM_INPUT_METHOD_SCRIPT: number;
+ readonly DOM_INPUT_METHOD_UNKNOWN: number;
+ readonly DOM_INPUT_METHOD_VOICE: number;
+}
+
+declare var TextEvent: {
+ prototype: TextEvent;
+ new(): TextEvent;
+ readonly DOM_INPUT_METHOD_DROP: number;
+ readonly DOM_INPUT_METHOD_HANDWRITING: number;
+ readonly DOM_INPUT_METHOD_IME: number;
+ readonly DOM_INPUT_METHOD_KEYBOARD: number;
+ readonly DOM_INPUT_METHOD_MULTIMODAL: number;
+ readonly DOM_INPUT_METHOD_OPTION: number;
+ readonly DOM_INPUT_METHOD_PASTE: number;
+ readonly DOM_INPUT_METHOD_SCRIPT: number;
+ readonly DOM_INPUT_METHOD_UNKNOWN: number;
+ readonly DOM_INPUT_METHOD_VOICE: number;
+}
+
+interface TextMetrics {
+ readonly width: number;
+}
+
+declare var TextMetrics: {
+ prototype: TextMetrics;
+ new(): TextMetrics;
+}
+
+interface TextTrack extends EventTarget {
+ readonly activeCues: TextTrackCueList;
+ readonly cues: TextTrackCueList;
+ readonly inBandMetadataTrackDispatchType: string;
+ readonly kind: string;
+ readonly label: string;
+ readonly language: string;
+ mode: any;
+ oncuechange: (this: this, ev: Event) => any;
+ onerror: (this: this, ev: ErrorEvent) => any;
+ onload: (this: this, ev: Event) => any;
+ readonly readyState: number;
+ addCue(cue: TextTrackCue): void;
+ removeCue(cue: TextTrackCue): void;
+ readonly DISABLED: number;
+ readonly ERROR: number;
+ readonly HIDDEN: number;
+ readonly LOADED: number;
+ readonly LOADING: number;
+ readonly NONE: number;
+ readonly SHOWING: number;
+ addEventListener(type: "cuechange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "error", listener: (this: this, ev: ErrorEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "load", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var TextTrack: {
+ prototype: TextTrack;
+ new(): TextTrack;
+ readonly DISABLED: number;
+ readonly ERROR: number;
+ readonly HIDDEN: number;
+ readonly LOADED: number;
+ readonly LOADING: number;
+ readonly NONE: number;
+ readonly SHOWING: number;
+}
+
+interface TextTrackCue extends EventTarget {
+ endTime: number;
+ id: string;
+ onenter: (this: this, ev: Event) => any;
+ onexit: (this: this, ev: Event) => any;
+ pauseOnExit: boolean;
+ startTime: number;
+ text: string;
+ readonly track: TextTrack;
+ getCueAsHTML(): DocumentFragment;
+ addEventListener(type: "enter", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "exit", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var TextTrackCue: {
+ prototype: TextTrackCue;
+ new(startTime: number, endTime: number, text: string): TextTrackCue;
+}
+
+interface TextTrackCueList {
+ readonly length: number;
+ getCueById(id: string): TextTrackCue;
+ item(index: number): TextTrackCue;
+ [index: number]: TextTrackCue;
+}
+
+declare var TextTrackCueList: {
+ prototype: TextTrackCueList;
+ new(): TextTrackCueList;
+}
+
+interface TextTrackList extends EventTarget {
+ readonly length: number;
+ onaddtrack: ((this: this, ev: TrackEvent) => any) | null;
+ item(index: number): TextTrack;
+ addEventListener(type: "addtrack", listener: (this: this, ev: TrackEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+ [index: number]: TextTrack;
+}
+
+declare var TextTrackList: {
+ prototype: TextTrackList;
+ new(): TextTrackList;
+}
+
+interface TimeRanges {
+ readonly length: number;
+ end(index: number): number;
+ start(index: number): number;
+}
+
+declare var TimeRanges: {
+ prototype: TimeRanges;
+ new(): TimeRanges;
+}
+
+interface Touch {
+ readonly clientX: number;
+ readonly clientY: number;
+ readonly identifier: number;
+ readonly pageX: number;
+ readonly pageY: number;
+ readonly screenX: number;
+ readonly screenY: number;
+ readonly target: EventTarget;
+}
+
+declare var Touch: {
+ prototype: Touch;
+ new(): Touch;
+}
+
+interface TouchEvent extends UIEvent {
+ readonly altKey: boolean;
+ readonly changedTouches: TouchList;
+ readonly ctrlKey: boolean;
+ readonly metaKey: boolean;
+ readonly shiftKey: boolean;
+ readonly targetTouches: TouchList;
+ readonly touches: TouchList;
+}
+
+declare var TouchEvent: {
+ prototype: TouchEvent;
+ new(): TouchEvent;
+}
+
+interface TouchList {
+ readonly length: number;
+ item(index: number): Touch | null;
+ [index: number]: Touch;
+}
+
+declare var TouchList: {
+ prototype: TouchList;
+ new(): TouchList;
+}
+
+interface TrackEvent extends Event {
+ readonly track: any;
+}
+
+declare var TrackEvent: {
+ prototype: TrackEvent;
+ new(): TrackEvent;
+}
+
+interface TransitionEvent extends Event {
+ readonly elapsedTime: number;
+ readonly propertyName: string;
+ initTransitionEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, propertyNameArg: string, elapsedTimeArg: number): void;
+}
+
+declare var TransitionEvent: {
+ prototype: TransitionEvent;
+ new(): TransitionEvent;
+}
+
+interface TreeWalker {
+ currentNode: Node;
+ readonly expandEntityReferences: boolean;
+ readonly filter: NodeFilter;
+ readonly root: Node;
+ readonly whatToShow: number;
+ firstChild(): Node;
+ lastChild(): Node;
+ nextNode(): Node;
+ nextSibling(): Node;
+ parentNode(): Node;
+ previousNode(): Node;
+ previousSibling(): Node;
+}
+
+declare var TreeWalker: {
+ prototype: TreeWalker;
+ new(): TreeWalker;
+}
+
+interface UIEvent extends Event {
+ readonly detail: number;
+ readonly view: Window;
+ initUIEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number): void;
+}
+
+declare var UIEvent: {
+ prototype: UIEvent;
+ new(type: string, eventInitDict?: UIEventInit): UIEvent;
+}
+
+interface URL {
+ hash: string;
+ host: string;
+ hostname: string;
+ href: string;
+ readonly origin: string;
+ password: string;
+ pathname: string;
+ port: string;
+ protocol: string;
+ search: string;
+ username: string;
+ toString(): string;
+}
+
+declare var URL: {
+ prototype: URL;
+ new(url: string, base?: string): URL;
+ createObjectURL(object: any, options?: ObjectURLOptions): string;
+ revokeObjectURL(url: string): void;
+}
+
+interface UnviewableContentIdentifiedEvent extends NavigationEventWithReferrer {
+ readonly mediaType: string;
+}
+
+declare var UnviewableContentIdentifiedEvent: {
+ prototype: UnviewableContentIdentifiedEvent;
+ new(): UnviewableContentIdentifiedEvent;
+}
+
+interface ValidityState {
+ readonly badInput: boolean;
+ readonly customError: boolean;
+ readonly patternMismatch: boolean;
+ readonly rangeOverflow: boolean;
+ readonly rangeUnderflow: boolean;
+ readonly stepMismatch: boolean;
+ readonly tooLong: boolean;
+ readonly typeMismatch: boolean;
+ readonly valid: boolean;
+ readonly valueMissing: boolean;
+}
+
+declare var ValidityState: {
+ prototype: ValidityState;
+ new(): ValidityState;
+}
+
+interface VideoPlaybackQuality {
+ readonly corruptedVideoFrames: number;
+ readonly creationTime: number;
+ readonly droppedVideoFrames: number;
+ readonly totalFrameDelay: number;
+ readonly totalVideoFrames: number;
+}
+
+declare var VideoPlaybackQuality: {
+ prototype: VideoPlaybackQuality;
+ new(): VideoPlaybackQuality;
+}
+
+interface VideoTrack {
+ readonly id: string;
+ kind: string;
+ readonly label: string;
+ language: string;
+ selected: boolean;
+ readonly sourceBuffer: SourceBuffer;
+}
+
+declare var VideoTrack: {
+ prototype: VideoTrack;
+ new(): VideoTrack;
+}
+
+interface VideoTrackList extends EventTarget {
+ readonly length: number;
+ onaddtrack: (this: this, ev: TrackEvent) => any;
+ onchange: (this: this, ev: Event) => any;
+ onremovetrack: (this: this, ev: TrackEvent) => any;
+ readonly selectedIndex: number;
+ getTrackById(id: string): VideoTrack | null;
+ item(index: number): VideoTrack;
+ addEventListener(type: "addtrack", listener: (this: this, ev: TrackEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "change", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "removetrack", listener: (this: this, ev: TrackEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+ [index: number]: VideoTrack;
+}
+
+declare var VideoTrackList: {
+ prototype: VideoTrackList;
+ new(): VideoTrackList;
+}
+
+interface WEBGL_compressed_texture_s3tc {
+ readonly COMPRESSED_RGBA_S3TC_DXT1_EXT: number;
+ readonly COMPRESSED_RGBA_S3TC_DXT3_EXT: number;
+ readonly COMPRESSED_RGBA_S3TC_DXT5_EXT: number;
+ readonly COMPRESSED_RGB_S3TC_DXT1_EXT: number;
+}
+
+declare var WEBGL_compressed_texture_s3tc: {
+ prototype: WEBGL_compressed_texture_s3tc;
+ new(): WEBGL_compressed_texture_s3tc;
+ readonly COMPRESSED_RGBA_S3TC_DXT1_EXT: number;
+ readonly COMPRESSED_RGBA_S3TC_DXT3_EXT: number;
+ readonly COMPRESSED_RGBA_S3TC_DXT5_EXT: number;
+ readonly COMPRESSED_RGB_S3TC_DXT1_EXT: number;
+}
+
+interface WEBGL_debug_renderer_info {
+ readonly UNMASKED_RENDERER_WEBGL: number;
+ readonly UNMASKED_VENDOR_WEBGL: number;
+}
+
+declare var WEBGL_debug_renderer_info: {
+ prototype: WEBGL_debug_renderer_info;
+ new(): WEBGL_debug_renderer_info;
+ readonly UNMASKED_RENDERER_WEBGL: number;
+ readonly UNMASKED_VENDOR_WEBGL: number;
+}
+
+interface WEBGL_depth_texture {
+ readonly UNSIGNED_INT_24_8_WEBGL: number;
+}
+
+declare var WEBGL_depth_texture: {
+ prototype: WEBGL_depth_texture;
+ new(): WEBGL_depth_texture;
+ readonly UNSIGNED_INT_24_8_WEBGL: number;
+}
+
+interface WaveShaperNode extends AudioNode {
+ curve: Float32Array | null;
+ oversample: string;
+}
+
+declare var WaveShaperNode: {
+ prototype: WaveShaperNode;
+ new(): WaveShaperNode;
+}
+
+interface WebGLActiveInfo {
+ readonly name: string;
+ readonly size: number;
+ readonly type: number;
+}
+
+declare var WebGLActiveInfo: {
+ prototype: WebGLActiveInfo;
+ new(): WebGLActiveInfo;
+}
+
+interface WebGLBuffer extends WebGLObject {
+}
+
+declare var WebGLBuffer: {
+ prototype: WebGLBuffer;
+ new(): WebGLBuffer;
+}
+
+interface WebGLContextEvent extends Event {
+ readonly statusMessage: string;
+}
+
+declare var WebGLContextEvent: {
+ prototype: WebGLContextEvent;
+ new(type: string, eventInitDict?: WebGLContextEventInit): WebGLContextEvent;
+}
+
+interface WebGLFramebuffer extends WebGLObject {
+}
+
+declare var WebGLFramebuffer: {
+ prototype: WebGLFramebuffer;
+ new(): WebGLFramebuffer;
+}
+
+interface WebGLObject {
+}
+
+declare var WebGLObject: {
+ prototype: WebGLObject;
+ new(): WebGLObject;
+}
+
+interface WebGLProgram extends WebGLObject {
+}
+
+declare var WebGLProgram: {
+ prototype: WebGLProgram;
+ new(): WebGLProgram;
+}
+
+interface WebGLRenderbuffer extends WebGLObject {
+}
+
+declare var WebGLRenderbuffer: {
+ prototype: WebGLRenderbuffer;
+ new(): WebGLRenderbuffer;
+}
+
+interface WebGLRenderingContext {
+ readonly canvas: HTMLCanvasElement;
+ readonly drawingBufferHeight: number;
+ readonly drawingBufferWidth: number;
+ activeTexture(texture: number): void;
+ attachShader(program: WebGLProgram | null, shader: WebGLShader | null): void;
+ bindAttribLocation(program: WebGLProgram | null, index: number, name: string): void;
+ bindBuffer(target: number, buffer: WebGLBuffer | null): void;
+ bindFramebuffer(target: number, framebuffer: WebGLFramebuffer | null): void;
+ bindRenderbuffer(target: number, renderbuffer: WebGLRenderbuffer | null): void;
+ bindTexture(target: number, texture: WebGLTexture | null): void;
+ blendColor(red: number, green: number, blue: number, alpha: number): void;
+ blendEquation(mode: number): void;
+ blendEquationSeparate(modeRGB: number, modeAlpha: number): void;
+ blendFunc(sfactor: number, dfactor: number): void;
+ blendFuncSeparate(srcRGB: number, dstRGB: number, srcAlpha: number, dstAlpha: number): void;
+ bufferData(target: number, size: number | ArrayBufferView | ArrayBuffer, usage: number): void;
+ bufferSubData(target: number, offset: number, data: ArrayBufferView | ArrayBuffer): void;
+ checkFramebufferStatus(target: number): number;
+ clear(mask: number): void;
+ clearColor(red: number, green: number, blue: number, alpha: number): void;
+ clearDepth(depth: number): void;
+ clearStencil(s: number): void;
+ colorMask(red: boolean, green: boolean, blue: boolean, alpha: boolean): void;
+ compileShader(shader: WebGLShader | null): void;
+ compressedTexImage2D(target: number, level: number, internalformat: number, width: number, height: number, border: number, data: ArrayBufferView): void;
+ compressedTexSubImage2D(target: number, level: number, xoffset: number, yoffset: number, width: number, height: number, format: number, data: ArrayBufferView): void;
+ copyTexImage2D(target: number, level: number, internalformat: number, x: number, y: number, width: number, height: number, border: number): void;
+ copyTexSubImage2D(target: number, level: number, xoffset: number, yoffset: number, x: number, y: number, width: number, height: number): void;
+ createBuffer(): WebGLBuffer | null;
+ createFramebuffer(): WebGLFramebuffer | null;
+ createProgram(): WebGLProgram | null;
+ createRenderbuffer(): WebGLRenderbuffer | null;
+ createShader(type: number): WebGLShader | null;
+ createTexture(): WebGLTexture | null;
+ cullFace(mode: number): void;
+ deleteBuffer(buffer: WebGLBuffer | null): void;
+ deleteFramebuffer(framebuffer: WebGLFramebuffer | null): void;
+ deleteProgram(program: WebGLProgram | null): void;
+ deleteRenderbuffer(renderbuffer: WebGLRenderbuffer | null): void;
+ deleteShader(shader: WebGLShader | null): void;
+ deleteTexture(texture: WebGLTexture | null): void;
+ depthFunc(func: number): void;
+ depthMask(flag: boolean): void;
+ depthRange(zNear: number, zFar: number): void;
+ detachShader(program: WebGLProgram | null, shader: WebGLShader | null): void;
+ disable(cap: number): void;
+ disableVertexAttribArray(index: number): void;
+ drawArrays(mode: number, first: number, count: number): void;
+ drawElements(mode: number, count: number, type: number, offset: number): void;
+ enable(cap: number): void;
+ enableVertexAttribArray(index: number): void;
+ finish(): void;
+ flush(): void;
+ framebufferRenderbuffer(target: number, attachment: number, renderbuffertarget: number, renderbuffer: WebGLRenderbuffer | null): void;
+ framebufferTexture2D(target: number, attachment: number, textarget: number, texture: WebGLTexture | null, level: number): void;
+ frontFace(mode: number): void;
+ generateMipmap(target: number): void;
+ getActiveAttrib(program: WebGLProgram | null, index: number): WebGLActiveInfo | null;
+ getActiveUniform(program: WebGLProgram | null, index: number): WebGLActiveInfo | null;
+ getAttachedShaders(program: WebGLProgram | null): WebGLShader[] | null;
+ getAttribLocation(program: WebGLProgram | null, name: string): number;
+ getBufferParameter(target: number, pname: number): any;
+ getContextAttributes(): WebGLContextAttributes;
+ getError(): number;
+ getExtension(name: string): any;
+ getFramebufferAttachmentParameter(target: number, attachment: number, pname: number): any;
+ getParameter(pname: number): any;
+ getProgramInfoLog(program: WebGLProgram | null): string | null;
+ getProgramParameter(program: WebGLProgram | null, pname: number): any;
+ getRenderbufferParameter(target: number, pname: number): any;
+ getShaderInfoLog(shader: WebGLShader | null): string | null;
+ getShaderParameter(shader: WebGLShader | null, pname: number): any;
+ getShaderPrecisionFormat(shadertype: number, precisiontype: number): WebGLShaderPrecisionFormat | null;
+ getShaderSource(shader: WebGLShader | null): string | null;
+ getSupportedExtensions(): string[] | null;
+ getTexParameter(target: number, pname: number): any;
+ getUniform(program: WebGLProgram | null, location: WebGLUniformLocation | null): any;
+ getUniformLocation(program: WebGLProgram | null, name: string): WebGLUniformLocation | null;
+ getVertexAttrib(index: number, pname: number): any;
+ getVertexAttribOffset(index: number, pname: number): number;
+ hint(target: number, mode: number): void;
+ isBuffer(buffer: WebGLBuffer | null): boolean;
+ isContextLost(): boolean;
+ isEnabled(cap: number): boolean;
+ isFramebuffer(framebuffer: WebGLFramebuffer | null): boolean;
+ isProgram(program: WebGLProgram | null): boolean;
+ isRenderbuffer(renderbuffer: WebGLRenderbuffer | null): boolean;
+ isShader(shader: WebGLShader | null): boolean;
+ isTexture(texture: WebGLTexture | null): boolean;
+ lineWidth(width: number): void;
+ linkProgram(program: WebGLProgram | null): void;
+ pixelStorei(pname: number, param: number): void;
+ polygonOffset(factor: number, units: number): void;
+ readPixels(x: number, y: number, width: number, height: number, format: number, type: number, pixels: ArrayBufferView | null): void;
+ renderbufferStorage(target: number, internalformat: number, width: number, height: number): void;
+ sampleCoverage(value: number, invert: boolean): void;
+ scissor(x: number, y: number, width: number, height: number): void;
+ shaderSource(shader: WebGLShader | null, source: string): void;
+ stencilFunc(func: number, ref: number, mask: number): void;
+ stencilFuncSeparate(face: number, func: number, ref: number, mask: number): void;
+ stencilMask(mask: number): void;
+ stencilMaskSeparate(face: number, mask: number): void;
+ stencilOp(fail: number, zfail: number, zpass: number): void;
+ stencilOpSeparate(face: number, fail: number, zfail: number, zpass: number): void;
+ texImage2D(target: number, level: number, internalformat: number, width: number, height: number, border: number, format: number, type: number, pixels?: ArrayBufferView): void;
+ texImage2D(target: number, level: number, internalformat: number, format: number, type: number, pixels?: ImageData | HTMLVideoElement | HTMLImageElement | HTMLCanvasElement): void;
+ texParameterf(target: number, pname: number, param: number): void;
+ texParameteri(target: number, pname: number, param: number): void;
+ texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, width: number, height: number, format: number, type: number, pixels?: ArrayBufferView): void;
+ texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, format: number, type: number, pixels?: ImageData | HTMLVideoElement | HTMLImageElement | HTMLCanvasElement): void;
+ uniform1f(location: WebGLUniformLocation | null, x: number): void;
+ uniform1fv(location: WebGLUniformLocation, v: Float32Array | number[]): void;
+ uniform1i(location: WebGLUniformLocation | null, x: number): void;
+ uniform1iv(location: WebGLUniformLocation, v: Int32Array | number[]): void;
+ uniform2f(location: WebGLUniformLocation | null, x: number, y: number): void;
+ uniform2fv(location: WebGLUniformLocation, v: Float32Array | number[]): void;
+ uniform2i(location: WebGLUniformLocation | null, x: number, y: number): void;
+ uniform2iv(location: WebGLUniformLocation, v: Int32Array | number[]): void;
+ uniform3f(location: WebGLUniformLocation | null, x: number, y: number, z: number): void;
+ uniform3fv(location: WebGLUniformLocation, v: Float32Array | number[]): void;
+ uniform3i(location: WebGLUniformLocation | null, x: number, y: number, z: number): void;
+ uniform3iv(location: WebGLUniformLocation, v: Int32Array | number[]): void;
+ uniform4f(location: WebGLUniformLocation | null, x: number, y: number, z: number, w: number): void;
+ uniform4fv(location: WebGLUniformLocation, v: Float32Array | number[]): void;
+ uniform4i(location: WebGLUniformLocation | null, x: number, y: number, z: number, w: number): void;
+ uniform4iv(location: WebGLUniformLocation, v: Int32Array | number[]): void;
+ uniformMatrix2fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array | number[]): void;
+ uniformMatrix3fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array | number[]): void;
+ uniformMatrix4fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array | number[]): void;
+ useProgram(program: WebGLProgram | null): void;
+ validateProgram(program: WebGLProgram | null): void;
+ vertexAttrib1f(indx: number, x: number): void;
+ vertexAttrib1fv(indx: number, values: Float32Array | number[]): void;
+ vertexAttrib2f(indx: number, x: number, y: number): void;
+ vertexAttrib2fv(indx: number, values: Float32Array | number[]): void;
+ vertexAttrib3f(indx: number, x: number, y: number, z: number): void;
+ vertexAttrib3fv(indx: number, values: Float32Array | number[]): void;
+ vertexAttrib4f(indx: number, x: number, y: number, z: number, w: number): void;
+ vertexAttrib4fv(indx: number, values: Float32Array | number[]): void;
+ vertexAttribPointer(indx: number, size: number, type: number, normalized: boolean, stride: number, offset: number): void;
+ viewport(x: number, y: number, width: number, height: number): void;
+ readonly ACTIVE_ATTRIBUTES: number;
+ readonly ACTIVE_TEXTURE: number;
+ readonly ACTIVE_UNIFORMS: number;
+ readonly ALIASED_LINE_WIDTH_RANGE: number;
+ readonly ALIASED_POINT_SIZE_RANGE: number;
+ readonly ALPHA: number;
+ readonly ALPHA_BITS: number;
+ readonly ALWAYS: number;
+ readonly ARRAY_BUFFER: number;
+ readonly ARRAY_BUFFER_BINDING: number;
+ readonly ATTACHED_SHADERS: number;
+ readonly BACK: number;
+ readonly BLEND: number;
+ readonly BLEND_COLOR: number;
+ readonly BLEND_DST_ALPHA: number;
+ readonly BLEND_DST_RGB: number;
+ readonly BLEND_EQUATION: number;
+ readonly BLEND_EQUATION_ALPHA: number;
+ readonly BLEND_EQUATION_RGB: number;
+ readonly BLEND_SRC_ALPHA: number;
+ readonly BLEND_SRC_RGB: number;
+ readonly BLUE_BITS: number;
+ readonly BOOL: number;
+ readonly BOOL_VEC2: number;
+ readonly BOOL_VEC3: number;
+ readonly BOOL_VEC4: number;
+ readonly BROWSER_DEFAULT_WEBGL: number;
+ readonly BUFFER_SIZE: number;
+ readonly BUFFER_USAGE: number;
+ readonly BYTE: number;
+ readonly CCW: number;
+ readonly CLAMP_TO_EDGE: number;
+ readonly COLOR_ATTACHMENT0: number;
+ readonly COLOR_BUFFER_BIT: number;
+ readonly COLOR_CLEAR_VALUE: number;
+ readonly COLOR_WRITEMASK: number;
+ readonly COMPILE_STATUS: number;
+ readonly COMPRESSED_TEXTURE_FORMATS: number;
+ readonly CONSTANT_ALPHA: number;
+ readonly CONSTANT_COLOR: number;
+ readonly CONTEXT_LOST_WEBGL: number;
+ readonly CULL_FACE: number;
+ readonly CULL_FACE_MODE: number;
+ readonly CURRENT_PROGRAM: number;
+ readonly CURRENT_VERTEX_ATTRIB: number;
+ readonly CW: number;
+ readonly DECR: number;
+ readonly DECR_WRAP: number;
+ readonly DELETE_STATUS: number;
+ readonly DEPTH_ATTACHMENT: number;
+ readonly DEPTH_BITS: number;
+ readonly DEPTH_BUFFER_BIT: number;
+ readonly DEPTH_CLEAR_VALUE: number;
+ readonly DEPTH_COMPONENT: number;
+ readonly DEPTH_COMPONENT16: number;
+ readonly DEPTH_FUNC: number;
+ readonly DEPTH_RANGE: number;
+ readonly DEPTH_STENCIL: number;
+ readonly DEPTH_STENCIL_ATTACHMENT: number;
+ readonly DEPTH_TEST: number;
+ readonly DEPTH_WRITEMASK: number;
+ readonly DITHER: number;
+ readonly DONT_CARE: number;
+ readonly DST_ALPHA: number;
+ readonly DST_COLOR: number;
+ readonly DYNAMIC_DRAW: number;
+ readonly ELEMENT_ARRAY_BUFFER: number;
+ readonly ELEMENT_ARRAY_BUFFER_BINDING: number;
+ readonly EQUAL: number;
+ readonly FASTEST: number;
+ readonly FLOAT: number;
+ readonly FLOAT_MAT2: number;
+ readonly FLOAT_MAT3: number;
+ readonly FLOAT_MAT4: number;
+ readonly FLOAT_VEC2: number;
+ readonly FLOAT_VEC3: number;
+ readonly FLOAT_VEC4: number;
+ readonly FRAGMENT_SHADER: number;
+ readonly FRAMEBUFFER: number;
+ readonly FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: number;
+ readonly FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: number;
+ readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: number;
+ readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: number;
+ readonly FRAMEBUFFER_BINDING: number;
+ readonly FRAMEBUFFER_COMPLETE: number;
+ readonly FRAMEBUFFER_INCOMPLETE_ATTACHMENT: number;
+ readonly FRAMEBUFFER_INCOMPLETE_DIMENSIONS: number;
+ readonly FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: number;
+ readonly FRAMEBUFFER_UNSUPPORTED: number;
+ readonly FRONT: number;
+ readonly FRONT_AND_BACK: number;
+ readonly FRONT_FACE: number;
+ readonly FUNC_ADD: number;
+ readonly FUNC_REVERSE_SUBTRACT: number;
+ readonly FUNC_SUBTRACT: number;
+ readonly GENERATE_MIPMAP_HINT: number;
+ readonly GEQUAL: number;
+ readonly GREATER: number;
+ readonly GREEN_BITS: number;
+ readonly HIGH_FLOAT: number;
+ readonly HIGH_INT: number;
+ readonly IMPLEMENTATION_COLOR_READ_FORMAT: number;
+ readonly IMPLEMENTATION_COLOR_READ_TYPE: number;
+ readonly INCR: number;
+ readonly INCR_WRAP: number;
+ readonly INT: number;
+ readonly INT_VEC2: number;
+ readonly INT_VEC3: number;
+ readonly INT_VEC4: number;
+ readonly INVALID_ENUM: number;
+ readonly INVALID_FRAMEBUFFER_OPERATION: number;
+ readonly INVALID_OPERATION: number;
+ readonly INVALID_VALUE: number;
+ readonly INVERT: number;
+ readonly KEEP: number;
+ readonly LEQUAL: number;
+ readonly LESS: number;
+ readonly LINEAR: number;
+ readonly LINEAR_MIPMAP_LINEAR: number;
+ readonly LINEAR_MIPMAP_NEAREST: number;
+ readonly LINES: number;
+ readonly LINE_LOOP: number;
+ readonly LINE_STRIP: number;
+ readonly LINE_WIDTH: number;
+ readonly LINK_STATUS: number;
+ readonly LOW_FLOAT: number;
+ readonly LOW_INT: number;
+ readonly LUMINANCE: number;
+ readonly LUMINANCE_ALPHA: number;
+ readonly MAX_COMBINED_TEXTURE_IMAGE_UNITS: number;
+ readonly MAX_CUBE_MAP_TEXTURE_SIZE: number;
+ readonly MAX_FRAGMENT_UNIFORM_VECTORS: number;
+ readonly MAX_RENDERBUFFER_SIZE: number;
+ readonly MAX_TEXTURE_IMAGE_UNITS: number;
+ readonly MAX_TEXTURE_SIZE: number;
+ readonly MAX_VARYING_VECTORS: number;
+ readonly MAX_VERTEX_ATTRIBS: number;
+ readonly MAX_VERTEX_TEXTURE_IMAGE_UNITS: number;
+ readonly MAX_VERTEX_UNIFORM_VECTORS: number;
+ readonly MAX_VIEWPORT_DIMS: number;
+ readonly MEDIUM_FLOAT: number;
+ readonly MEDIUM_INT: number;
+ readonly MIRRORED_REPEAT: number;
+ readonly NEAREST: number;
+ readonly NEAREST_MIPMAP_LINEAR: number;
+ readonly NEAREST_MIPMAP_NEAREST: number;
+ readonly NEVER: number;
+ readonly NICEST: number;
+ readonly NONE: number;
+ readonly NOTEQUAL: number;
+ readonly NO_ERROR: number;
+ readonly ONE: number;
+ readonly ONE_MINUS_CONSTANT_ALPHA: number;
+ readonly ONE_MINUS_CONSTANT_COLOR: number;
+ readonly ONE_MINUS_DST_ALPHA: number;
+ readonly ONE_MINUS_DST_COLOR: number;
+ readonly ONE_MINUS_SRC_ALPHA: number;
+ readonly ONE_MINUS_SRC_COLOR: number;
+ readonly OUT_OF_MEMORY: number;
+ readonly PACK_ALIGNMENT: number;
+ readonly POINTS: number;
+ readonly POLYGON_OFFSET_FACTOR: number;
+ readonly POLYGON_OFFSET_FILL: number;
+ readonly POLYGON_OFFSET_UNITS: number;
+ readonly RED_BITS: number;
+ readonly RENDERBUFFER: number;
+ readonly RENDERBUFFER_ALPHA_SIZE: number;
+ readonly RENDERBUFFER_BINDING: number;
+ readonly RENDERBUFFER_BLUE_SIZE: number;
+ readonly RENDERBUFFER_DEPTH_SIZE: number;
+ readonly RENDERBUFFER_GREEN_SIZE: number;
+ readonly RENDERBUFFER_HEIGHT: number;
+ readonly RENDERBUFFER_INTERNAL_FORMAT: number;
+ readonly RENDERBUFFER_RED_SIZE: number;
+ readonly RENDERBUFFER_STENCIL_SIZE: number;
+ readonly RENDERBUFFER_WIDTH: number;
+ readonly RENDERER: number;
+ readonly REPEAT: number;
+ readonly REPLACE: number;
+ readonly RGB: number;
+ readonly RGB565: number;
+ readonly RGB5_A1: number;
+ readonly RGBA: number;
+ readonly RGBA4: number;
+ readonly SAMPLER_2D: number;
+ readonly SAMPLER_CUBE: number;
+ readonly SAMPLES: number;
+ readonly SAMPLE_ALPHA_TO_COVERAGE: number;
+ readonly SAMPLE_BUFFERS: number;
+ readonly SAMPLE_COVERAGE: number;
+ readonly SAMPLE_COVERAGE_INVERT: number;
+ readonly SAMPLE_COVERAGE_VALUE: number;
+ readonly SCISSOR_BOX: number;
+ readonly SCISSOR_TEST: number;
+ readonly SHADER_TYPE: number;
+ readonly SHADING_LANGUAGE_VERSION: number;
+ readonly SHORT: number;
+ readonly SRC_ALPHA: number;
+ readonly SRC_ALPHA_SATURATE: number;
+ readonly SRC_COLOR: number;
+ readonly STATIC_DRAW: number;
+ readonly STENCIL_ATTACHMENT: number;
+ readonly STENCIL_BACK_FAIL: number;
+ readonly STENCIL_BACK_FUNC: number;
+ readonly STENCIL_BACK_PASS_DEPTH_FAIL: number;
+ readonly STENCIL_BACK_PASS_DEPTH_PASS: number;
+ readonly STENCIL_BACK_REF: number;
+ readonly STENCIL_BACK_VALUE_MASK: number;
+ readonly STENCIL_BACK_WRITEMASK: number;
+ readonly STENCIL_BITS: number;
+ readonly STENCIL_BUFFER_BIT: number;
+ readonly STENCIL_CLEAR_VALUE: number;
+ readonly STENCIL_FAIL: number;
+ readonly STENCIL_FUNC: number;
+ readonly STENCIL_INDEX: number;
+ readonly STENCIL_INDEX8: number;
+ readonly STENCIL_PASS_DEPTH_FAIL: number;
+ readonly STENCIL_PASS_DEPTH_PASS: number;
+ readonly STENCIL_REF: number;
+ readonly STENCIL_TEST: number;
+ readonly STENCIL_VALUE_MASK: number;
+ readonly STENCIL_WRITEMASK: number;
+ readonly STREAM_DRAW: number;
+ readonly SUBPIXEL_BITS: number;
+ readonly TEXTURE: number;
+ readonly TEXTURE0: number;
+ readonly TEXTURE1: number;
+ readonly TEXTURE10: number;
+ readonly TEXTURE11: number;
+ readonly TEXTURE12: number;
+ readonly TEXTURE13: number;
+ readonly TEXTURE14: number;
+ readonly TEXTURE15: number;
+ readonly TEXTURE16: number;
+ readonly TEXTURE17: number;
+ readonly TEXTURE18: number;
+ readonly TEXTURE19: number;
+ readonly TEXTURE2: number;
+ readonly TEXTURE20: number;
+ readonly TEXTURE21: number;
+ readonly TEXTURE22: number;
+ readonly TEXTURE23: number;
+ readonly TEXTURE24: number;
+ readonly TEXTURE25: number;
+ readonly TEXTURE26: number;
+ readonly TEXTURE27: number;
+ readonly TEXTURE28: number;
+ readonly TEXTURE29: number;
+ readonly TEXTURE3: number;
+ readonly TEXTURE30: number;
+ readonly TEXTURE31: number;
+ readonly TEXTURE4: number;
+ readonly TEXTURE5: number;
+ readonly TEXTURE6: number;
+ readonly TEXTURE7: number;
+ readonly TEXTURE8: number;
+ readonly TEXTURE9: number;
+ readonly TEXTURE_2D: number;
+ readonly TEXTURE_BINDING_2D: number;
+ readonly TEXTURE_BINDING_CUBE_MAP: number;
+ readonly TEXTURE_CUBE_MAP: number;
+ readonly TEXTURE_CUBE_MAP_NEGATIVE_X: number;
+ readonly TEXTURE_CUBE_MAP_NEGATIVE_Y: number;
+ readonly TEXTURE_CUBE_MAP_NEGATIVE_Z: number;
+ readonly TEXTURE_CUBE_MAP_POSITIVE_X: number;
+ readonly TEXTURE_CUBE_MAP_POSITIVE_Y: number;
+ readonly TEXTURE_CUBE_MAP_POSITIVE_Z: number;
+ readonly TEXTURE_MAG_FILTER: number;
+ readonly TEXTURE_MIN_FILTER: number;
+ readonly TEXTURE_WRAP_S: number;
+ readonly TEXTURE_WRAP_T: number;
+ readonly TRIANGLES: number;
+ readonly TRIANGLE_FAN: number;
+ readonly TRIANGLE_STRIP: number;
+ readonly UNPACK_ALIGNMENT: number;
+ readonly UNPACK_COLORSPACE_CONVERSION_WEBGL: number;
+ readonly UNPACK_FLIP_Y_WEBGL: number;
+ readonly UNPACK_PREMULTIPLY_ALPHA_WEBGL: number;
+ readonly UNSIGNED_BYTE: number;
+ readonly UNSIGNED_INT: number;
+ readonly UNSIGNED_SHORT: number;
+ readonly UNSIGNED_SHORT_4_4_4_4: number;
+ readonly UNSIGNED_SHORT_5_5_5_1: number;
+ readonly UNSIGNED_SHORT_5_6_5: number;
+ readonly VALIDATE_STATUS: number;
+ readonly VENDOR: number;
+ readonly VERSION: number;
+ readonly VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: number;
+ readonly VERTEX_ATTRIB_ARRAY_ENABLED: number;
+ readonly VERTEX_ATTRIB_ARRAY_NORMALIZED: number;
+ readonly VERTEX_ATTRIB_ARRAY_POINTER: number;
+ readonly VERTEX_ATTRIB_ARRAY_SIZE: number;
+ readonly VERTEX_ATTRIB_ARRAY_STRIDE: number;
+ readonly VERTEX_ATTRIB_ARRAY_TYPE: number;
+ readonly VERTEX_SHADER: number;
+ readonly VIEWPORT: number;
+ readonly ZERO: number;
+}
+
+declare var WebGLRenderingContext: {
+ prototype: WebGLRenderingContext;
+ new(): WebGLRenderingContext;
+ readonly ACTIVE_ATTRIBUTES: number;
+ readonly ACTIVE_TEXTURE: number;
+ readonly ACTIVE_UNIFORMS: number;
+ readonly ALIASED_LINE_WIDTH_RANGE: number;
+ readonly ALIASED_POINT_SIZE_RANGE: number;
+ readonly ALPHA: number;
+ readonly ALPHA_BITS: number;
+ readonly ALWAYS: number;
+ readonly ARRAY_BUFFER: number;
+ readonly ARRAY_BUFFER_BINDING: number;
+ readonly ATTACHED_SHADERS: number;
+ readonly BACK: number;
+ readonly BLEND: number;
+ readonly BLEND_COLOR: number;
+ readonly BLEND_DST_ALPHA: number;
+ readonly BLEND_DST_RGB: number;
+ readonly BLEND_EQUATION: number;
+ readonly BLEND_EQUATION_ALPHA: number;
+ readonly BLEND_EQUATION_RGB: number;
+ readonly BLEND_SRC_ALPHA: number;
+ readonly BLEND_SRC_RGB: number;
+ readonly BLUE_BITS: number;
+ readonly BOOL: number;
+ readonly BOOL_VEC2: number;
+ readonly BOOL_VEC3: number;
+ readonly BOOL_VEC4: number;
+ readonly BROWSER_DEFAULT_WEBGL: number;
+ readonly BUFFER_SIZE: number;
+ readonly BUFFER_USAGE: number;
+ readonly BYTE: number;
+ readonly CCW: number;
+ readonly CLAMP_TO_EDGE: number;
+ readonly COLOR_ATTACHMENT0: number;
+ readonly COLOR_BUFFER_BIT: number;
+ readonly COLOR_CLEAR_VALUE: number;
+ readonly COLOR_WRITEMASK: number;
+ readonly COMPILE_STATUS: number;
+ readonly COMPRESSED_TEXTURE_FORMATS: number;
+ readonly CONSTANT_ALPHA: number;
+ readonly CONSTANT_COLOR: number;
+ readonly CONTEXT_LOST_WEBGL: number;
+ readonly CULL_FACE: number;
+ readonly CULL_FACE_MODE: number;
+ readonly CURRENT_PROGRAM: number;
+ readonly CURRENT_VERTEX_ATTRIB: number;
+ readonly CW: number;
+ readonly DECR: number;
+ readonly DECR_WRAP: number;
+ readonly DELETE_STATUS: number;
+ readonly DEPTH_ATTACHMENT: number;
+ readonly DEPTH_BITS: number;
+ readonly DEPTH_BUFFER_BIT: number;
+ readonly DEPTH_CLEAR_VALUE: number;
+ readonly DEPTH_COMPONENT: number;
+ readonly DEPTH_COMPONENT16: number;
+ readonly DEPTH_FUNC: number;
+ readonly DEPTH_RANGE: number;
+ readonly DEPTH_STENCIL: number;
+ readonly DEPTH_STENCIL_ATTACHMENT: number;
+ readonly DEPTH_TEST: number;
+ readonly DEPTH_WRITEMASK: number;
+ readonly DITHER: number;
+ readonly DONT_CARE: number;
+ readonly DST_ALPHA: number;
+ readonly DST_COLOR: number;
+ readonly DYNAMIC_DRAW: number;
+ readonly ELEMENT_ARRAY_BUFFER: number;
+ readonly ELEMENT_ARRAY_BUFFER_BINDING: number;
+ readonly EQUAL: number;
+ readonly FASTEST: number;
+ readonly FLOAT: number;
+ readonly FLOAT_MAT2: number;
+ readonly FLOAT_MAT3: number;
+ readonly FLOAT_MAT4: number;
+ readonly FLOAT_VEC2: number;
+ readonly FLOAT_VEC3: number;
+ readonly FLOAT_VEC4: number;
+ readonly FRAGMENT_SHADER: number;
+ readonly FRAMEBUFFER: number;
+ readonly FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: number;
+ readonly FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: number;
+ readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: number;
+ readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: number;
+ readonly FRAMEBUFFER_BINDING: number;
+ readonly FRAMEBUFFER_COMPLETE: number;
+ readonly FRAMEBUFFER_INCOMPLETE_ATTACHMENT: number;
+ readonly FRAMEBUFFER_INCOMPLETE_DIMENSIONS: number;
+ readonly FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: number;
+ readonly FRAMEBUFFER_UNSUPPORTED: number;
+ readonly FRONT: number;
+ readonly FRONT_AND_BACK: number;
+ readonly FRONT_FACE: number;
+ readonly FUNC_ADD: number;
+ readonly FUNC_REVERSE_SUBTRACT: number;
+ readonly FUNC_SUBTRACT: number;
+ readonly GENERATE_MIPMAP_HINT: number;
+ readonly GEQUAL: number;
+ readonly GREATER: number;
+ readonly GREEN_BITS: number;
+ readonly HIGH_FLOAT: number;
+ readonly HIGH_INT: number;
+ readonly IMPLEMENTATION_COLOR_READ_FORMAT: number;
+ readonly IMPLEMENTATION_COLOR_READ_TYPE: number;
+ readonly INCR: number;
+ readonly INCR_WRAP: number;
+ readonly INT: number;
+ readonly INT_VEC2: number;
+ readonly INT_VEC3: number;
+ readonly INT_VEC4: number;
+ readonly INVALID_ENUM: number;
+ readonly INVALID_FRAMEBUFFER_OPERATION: number;
+ readonly INVALID_OPERATION: number;
+ readonly INVALID_VALUE: number;
+ readonly INVERT: number;
+ readonly KEEP: number;
+ readonly LEQUAL: number;
+ readonly LESS: number;
+ readonly LINEAR: number;
+ readonly LINEAR_MIPMAP_LINEAR: number;
+ readonly LINEAR_MIPMAP_NEAREST: number;
+ readonly LINES: number;
+ readonly LINE_LOOP: number;
+ readonly LINE_STRIP: number;
+ readonly LINE_WIDTH: number;
+ readonly LINK_STATUS: number;
+ readonly LOW_FLOAT: number;
+ readonly LOW_INT: number;
+ readonly LUMINANCE: number;
+ readonly LUMINANCE_ALPHA: number;
+ readonly MAX_COMBINED_TEXTURE_IMAGE_UNITS: number;
+ readonly MAX_CUBE_MAP_TEXTURE_SIZE: number;
+ readonly MAX_FRAGMENT_UNIFORM_VECTORS: number;
+ readonly MAX_RENDERBUFFER_SIZE: number;
+ readonly MAX_TEXTURE_IMAGE_UNITS: number;
+ readonly MAX_TEXTURE_SIZE: number;
+ readonly MAX_VARYING_VECTORS: number;
+ readonly MAX_VERTEX_ATTRIBS: number;
+ readonly MAX_VERTEX_TEXTURE_IMAGE_UNITS: number;
+ readonly MAX_VERTEX_UNIFORM_VECTORS: number;
+ readonly MAX_VIEWPORT_DIMS: number;
+ readonly MEDIUM_FLOAT: number;
+ readonly MEDIUM_INT: number;
+ readonly MIRRORED_REPEAT: number;
+ readonly NEAREST: number;
+ readonly NEAREST_MIPMAP_LINEAR: number;
+ readonly NEAREST_MIPMAP_NEAREST: number;
+ readonly NEVER: number;
+ readonly NICEST: number;
+ readonly NONE: number;
+ readonly NOTEQUAL: number;
+ readonly NO_ERROR: number;
+ readonly ONE: number;
+ readonly ONE_MINUS_CONSTANT_ALPHA: number;
+ readonly ONE_MINUS_CONSTANT_COLOR: number;
+ readonly ONE_MINUS_DST_ALPHA: number;
+ readonly ONE_MINUS_DST_COLOR: number;
+ readonly ONE_MINUS_SRC_ALPHA: number;
+ readonly ONE_MINUS_SRC_COLOR: number;
+ readonly OUT_OF_MEMORY: number;
+ readonly PACK_ALIGNMENT: number;
+ readonly POINTS: number;
+ readonly POLYGON_OFFSET_FACTOR: number;
+ readonly POLYGON_OFFSET_FILL: number;
+ readonly POLYGON_OFFSET_UNITS: number;
+ readonly RED_BITS: number;
+ readonly RENDERBUFFER: number;
+ readonly RENDERBUFFER_ALPHA_SIZE: number;
+ readonly RENDERBUFFER_BINDING: number;
+ readonly RENDERBUFFER_BLUE_SIZE: number;
+ readonly RENDERBUFFER_DEPTH_SIZE: number;
+ readonly RENDERBUFFER_GREEN_SIZE: number;
+ readonly RENDERBUFFER_HEIGHT: number;
+ readonly RENDERBUFFER_INTERNAL_FORMAT: number;
+ readonly RENDERBUFFER_RED_SIZE: number;
+ readonly RENDERBUFFER_STENCIL_SIZE: number;
+ readonly RENDERBUFFER_WIDTH: number;
+ readonly RENDERER: number;
+ readonly REPEAT: number;
+ readonly REPLACE: number;
+ readonly RGB: number;
+ readonly RGB565: number;
+ readonly RGB5_A1: number;
+ readonly RGBA: number;
+ readonly RGBA4: number;
+ readonly SAMPLER_2D: number;
+ readonly SAMPLER_CUBE: number;
+ readonly SAMPLES: number;
+ readonly SAMPLE_ALPHA_TO_COVERAGE: number;
+ readonly SAMPLE_BUFFERS: number;
+ readonly SAMPLE_COVERAGE: number;
+ readonly SAMPLE_COVERAGE_INVERT: number;
+ readonly SAMPLE_COVERAGE_VALUE: number;
+ readonly SCISSOR_BOX: number;
+ readonly SCISSOR_TEST: number;
+ readonly SHADER_TYPE: number;
+ readonly SHADING_LANGUAGE_VERSION: number;
+ readonly SHORT: number;
+ readonly SRC_ALPHA: number;
+ readonly SRC_ALPHA_SATURATE: number;
+ readonly SRC_COLOR: number;
+ readonly STATIC_DRAW: number;
+ readonly STENCIL_ATTACHMENT: number;
+ readonly STENCIL_BACK_FAIL: number;
+ readonly STENCIL_BACK_FUNC: number;
+ readonly STENCIL_BACK_PASS_DEPTH_FAIL: number;
+ readonly STENCIL_BACK_PASS_DEPTH_PASS: number;
+ readonly STENCIL_BACK_REF: number;
+ readonly STENCIL_BACK_VALUE_MASK: number;
+ readonly STENCIL_BACK_WRITEMASK: number;
+ readonly STENCIL_BITS: number;
+ readonly STENCIL_BUFFER_BIT: number;
+ readonly STENCIL_CLEAR_VALUE: number;
+ readonly STENCIL_FAIL: number;
+ readonly STENCIL_FUNC: number;
+ readonly STENCIL_INDEX: number;
+ readonly STENCIL_INDEX8: number;
+ readonly STENCIL_PASS_DEPTH_FAIL: number;
+ readonly STENCIL_PASS_DEPTH_PASS: number;
+ readonly STENCIL_REF: number;
+ readonly STENCIL_TEST: number;
+ readonly STENCIL_VALUE_MASK: number;
+ readonly STENCIL_WRITEMASK: number;
+ readonly STREAM_DRAW: number;
+ readonly SUBPIXEL_BITS: number;
+ readonly TEXTURE: number;
+ readonly TEXTURE0: number;
+ readonly TEXTURE1: number;
+ readonly TEXTURE10: number;
+ readonly TEXTURE11: number;
+ readonly TEXTURE12: number;
+ readonly TEXTURE13: number;
+ readonly TEXTURE14: number;
+ readonly TEXTURE15: number;
+ readonly TEXTURE16: number;
+ readonly TEXTURE17: number;
+ readonly TEXTURE18: number;
+ readonly TEXTURE19: number;
+ readonly TEXTURE2: number;
+ readonly TEXTURE20: number;
+ readonly TEXTURE21: number;
+ readonly TEXTURE22: number;
+ readonly TEXTURE23: number;
+ readonly TEXTURE24: number;
+ readonly TEXTURE25: number;
+ readonly TEXTURE26: number;
+ readonly TEXTURE27: number;
+ readonly TEXTURE28: number;
+ readonly TEXTURE29: number;
+ readonly TEXTURE3: number;
+ readonly TEXTURE30: number;
+ readonly TEXTURE31: number;
+ readonly TEXTURE4: number;
+ readonly TEXTURE5: number;
+ readonly TEXTURE6: number;
+ readonly TEXTURE7: number;
+ readonly TEXTURE8: number;
+ readonly TEXTURE9: number;
+ readonly TEXTURE_2D: number;
+ readonly TEXTURE_BINDING_2D: number;
+ readonly TEXTURE_BINDING_CUBE_MAP: number;
+ readonly TEXTURE_CUBE_MAP: number;
+ readonly TEXTURE_CUBE_MAP_NEGATIVE_X: number;
+ readonly TEXTURE_CUBE_MAP_NEGATIVE_Y: number;
+ readonly TEXTURE_CUBE_MAP_NEGATIVE_Z: number;
+ readonly TEXTURE_CUBE_MAP_POSITIVE_X: number;
+ readonly TEXTURE_CUBE_MAP_POSITIVE_Y: number;
+ readonly TEXTURE_CUBE_MAP_POSITIVE_Z: number;
+ readonly TEXTURE_MAG_FILTER: number;
+ readonly TEXTURE_MIN_FILTER: number;
+ readonly TEXTURE_WRAP_S: number;
+ readonly TEXTURE_WRAP_T: number;
+ readonly TRIANGLES: number;
+ readonly TRIANGLE_FAN: number;
+ readonly TRIANGLE_STRIP: number;
+ readonly UNPACK_ALIGNMENT: number;
+ readonly UNPACK_COLORSPACE_CONVERSION_WEBGL: number;
+ readonly UNPACK_FLIP_Y_WEBGL: number;
+ readonly UNPACK_PREMULTIPLY_ALPHA_WEBGL: number;
+ readonly UNSIGNED_BYTE: number;
+ readonly UNSIGNED_INT: number;
+ readonly UNSIGNED_SHORT: number;
+ readonly UNSIGNED_SHORT_4_4_4_4: number;
+ readonly UNSIGNED_SHORT_5_5_5_1: number;
+ readonly UNSIGNED_SHORT_5_6_5: number;
+ readonly VALIDATE_STATUS: number;
+ readonly VENDOR: number;
+ readonly VERSION: number;
+ readonly VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: number;
+ readonly VERTEX_ATTRIB_ARRAY_ENABLED: number;
+ readonly VERTEX_ATTRIB_ARRAY_NORMALIZED: number;
+ readonly VERTEX_ATTRIB_ARRAY_POINTER: number;
+ readonly VERTEX_ATTRIB_ARRAY_SIZE: number;
+ readonly VERTEX_ATTRIB_ARRAY_STRIDE: number;
+ readonly VERTEX_ATTRIB_ARRAY_TYPE: number;
+ readonly VERTEX_SHADER: number;
+ readonly VIEWPORT: number;
+ readonly ZERO: number;
+}
+
+interface WebGLShader extends WebGLObject {
+}
+
+declare var WebGLShader: {
+ prototype: WebGLShader;
+ new(): WebGLShader;
+}
+
+interface WebGLShaderPrecisionFormat {
+ readonly precision: number;
+ readonly rangeMax: number;
+ readonly rangeMin: number;
+}
+
+declare var WebGLShaderPrecisionFormat: {
+ prototype: WebGLShaderPrecisionFormat;
+ new(): WebGLShaderPrecisionFormat;
+}
+
+interface WebGLTexture extends WebGLObject {
+}
+
+declare var WebGLTexture: {
+ prototype: WebGLTexture;
+ new(): WebGLTexture;
+}
+
+interface WebGLUniformLocation {
+}
+
+declare var WebGLUniformLocation: {
+ prototype: WebGLUniformLocation;
+ new(): WebGLUniformLocation;
+}
+
+interface WebKitCSSMatrix {
+ a: number;
+ b: number;
+ c: number;
+ d: number;
+ e: number;
+ f: number;
+ m11: number;
+ m12: number;
+ m13: number;
+ m14: number;
+ m21: number;
+ m22: number;
+ m23: number;
+ m24: number;
+ m31: number;
+ m32: number;
+ m33: number;
+ m34: number;
+ m41: number;
+ m42: number;
+ m43: number;
+ m44: number;
+ inverse(): WebKitCSSMatrix;
+ multiply(secondMatrix: WebKitCSSMatrix): WebKitCSSMatrix;
+ rotate(angleX: number, angleY?: number, angleZ?: number): WebKitCSSMatrix;
+ rotateAxisAngle(x: number, y: number, z: number, angle: number): WebKitCSSMatrix;
+ scale(scaleX: number, scaleY?: number, scaleZ?: number): WebKitCSSMatrix;
+ setMatrixValue(value: string): void;
+ skewX(angle: number): WebKitCSSMatrix;
+ skewY(angle: number): WebKitCSSMatrix;
+ toString(): string;
+ translate(x: number, y: number, z?: number): WebKitCSSMatrix;
+}
+
+declare var WebKitCSSMatrix: {
+ prototype: WebKitCSSMatrix;
+ new(text?: string): WebKitCSSMatrix;
+}
+
+interface WebKitPoint {
+ x: number;
+ y: number;
+}
+
+declare var WebKitPoint: {
+ prototype: WebKitPoint;
+ new(x?: number, y?: number): WebKitPoint;
+}
+
+interface WebSocket extends EventTarget {
+ binaryType: string;
+ readonly bufferedAmount: number;
+ readonly extensions: string;
+ onclose: (this: this, ev: CloseEvent) => any;
+ onerror: (this: this, ev: ErrorEvent) => any;
+ onmessage: (this: this, ev: MessageEvent) => any;
+ onopen: (this: this, ev: Event) => any;
+ readonly protocol: string;
+ readonly readyState: number;
+ readonly url: string;
+ close(code?: number, reason?: string): void;
+ send(data: any): void;
+ readonly CLOSED: number;
+ readonly CLOSING: number;
+ readonly CONNECTING: number;
+ readonly OPEN: number;
+ addEventListener(type: "close", listener: (this: this, ev: CloseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "error", listener: (this: this, ev: ErrorEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "message", listener: (this: this, ev: MessageEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "open", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var WebSocket: {
+ prototype: WebSocket;
+ new(url: string, protocols?: string | string[]): WebSocket;
+ readonly CLOSED: number;
+ readonly CLOSING: number;
+ readonly CONNECTING: number;
+ readonly OPEN: number;
+}
+
+interface WheelEvent extends MouseEvent {
+ readonly deltaMode: number;
+ readonly deltaX: number;
+ readonly deltaY: number;
+ readonly deltaZ: number;
+ readonly wheelDelta: number;
+ readonly wheelDeltaX: number;
+ readonly wheelDeltaY: number;
+ getCurrentPoint(element: Element): void;
+ initWheelEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, buttonArg: number, relatedTargetArg: EventTarget, modifiersListArg: string, deltaXArg: number, deltaYArg: number, deltaZArg: number, deltaMode: number): void;
+ readonly DOM_DELTA_LINE: number;
+ readonly DOM_DELTA_PAGE: number;
+ readonly DOM_DELTA_PIXEL: number;
+}
+
+declare var WheelEvent: {
+ prototype: WheelEvent;
+ new(typeArg: string, eventInitDict?: WheelEventInit): WheelEvent;
+ readonly DOM_DELTA_LINE: number;
+ readonly DOM_DELTA_PAGE: number;
+ readonly DOM_DELTA_PIXEL: number;
+}
+
+interface Window extends EventTarget, WindowTimers, WindowSessionStorage, WindowLocalStorage, WindowConsole, GlobalEventHandlers, IDBEnvironment, WindowBase64 {
+ readonly applicationCache: ApplicationCache;
+ readonly clientInformation: Navigator;
+ readonly closed: boolean;
+ readonly crypto: Crypto;
+ defaultStatus: string;
+ readonly devicePixelRatio: number;
+ readonly doNotTrack: string;
+ readonly document: Document;
+ event: Event;
+ readonly external: External;
+ readonly frameElement: Element;
+ readonly frames: Window;
+ readonly history: History;
+ readonly innerHeight: number;
+ readonly innerWidth: number;
+ readonly length: number;
+ readonly location: Location;
+ readonly locationbar: BarProp;
+ readonly menubar: BarProp;
+ readonly msCredentials: MSCredentials;
+ name: string;
+ readonly navigator: Navigator;
+ offscreenBuffering: string | boolean;
+ onabort: (this: this, ev: UIEvent) => any;
+ onafterprint: (this: this, ev: Event) => any;
+ onbeforeprint: (this: this, ev: Event) => any;
+ onbeforeunload: (this: this, ev: BeforeUnloadEvent) => any;
+ onblur: (this: this, ev: FocusEvent) => any;
+ oncanplay: (this: this, ev: Event) => any;
+ oncanplaythrough: (this: this, ev: Event) => any;
+ onchange: (this: this, ev: Event) => any;
+ onclick: (this: this, ev: MouseEvent) => any;
+ oncompassneedscalibration: (this: this, ev: Event) => any;
+ oncontextmenu: (this: this, ev: PointerEvent) => any;
+ ondblclick: (this: this, ev: MouseEvent) => any;
+ ondevicelight: (this: this, ev: DeviceLightEvent) => any;
+ ondevicemotion: (this: this, ev: DeviceMotionEvent) => any;
+ ondeviceorientation: (this: this, ev: DeviceOrientationEvent) => any;
+ ondrag: (this: this, ev: DragEvent) => any;
+ ondragend: (this: this, ev: DragEvent) => any;
+ ondragenter: (this: this, ev: DragEvent) => any;
+ ondragleave: (this: this, ev: DragEvent) => any;
+ ondragover: (this: this, ev: DragEvent) => any;
+ ondragstart: (this: this, ev: DragEvent) => any;
+ ondrop: (this: this, ev: DragEvent) => any;
+ ondurationchange: (this: this, ev: Event) => any;
+ onemptied: (this: this, ev: Event) => any;
+ onended: (this: this, ev: MediaStreamErrorEvent) => any;
+ onerror: ErrorEventHandler;
+ onfocus: (this: this, ev: FocusEvent) => any;
+ onhashchange: (this: this, ev: HashChangeEvent) => any;
+ oninput: (this: this, ev: Event) => any;
+ oninvalid: (this: this, ev: Event) => any;
+ onkeydown: (this: this, ev: KeyboardEvent) => any;
+ onkeypress: (this: this, ev: KeyboardEvent) => any;
+ onkeyup: (this: this, ev: KeyboardEvent) => any;
+ onload: (this: this, ev: Event) => any;
+ onloadeddata: (this: this, ev: Event) => any;
+ onloadedmetadata: (this: this, ev: Event) => any;
+ onloadstart: (this: this, ev: Event) => any;
+ onmessage: (this: this, ev: MessageEvent) => any;
+ onmousedown: (this: this, ev: MouseEvent) => any;
+ onmouseenter: (this: this, ev: MouseEvent) => any;
+ onmouseleave: (this: this, ev: MouseEvent) => any;
+ onmousemove: (this: this, ev: MouseEvent) => any;
+ onmouseout: (this: this, ev: MouseEvent) => any;
+ onmouseover: (this: this, ev: MouseEvent) => any;
+ onmouseup: (this: this, ev: MouseEvent) => any;
+ onmousewheel: (this: this, ev: WheelEvent) => any;
+ onmsgesturechange: (this: this, ev: MSGestureEvent) => any;
+ onmsgesturedoubletap: (this: this, ev: MSGestureEvent) => any;
+ onmsgestureend: (this: this, ev: MSGestureEvent) => any;
+ onmsgesturehold: (this: this, ev: MSGestureEvent) => any;
+ onmsgesturestart: (this: this, ev: MSGestureEvent) => any;
+ onmsgesturetap: (this: this, ev: MSGestureEvent) => any;
+ onmsinertiastart: (this: this, ev: MSGestureEvent) => any;
+ onmspointercancel: (this: this, ev: MSPointerEvent) => any;
+ onmspointerdown: (this: this, ev: MSPointerEvent) => any;
+ onmspointerenter: (this: this, ev: MSPointerEvent) => any;
+ onmspointerleave: (this: this, ev: MSPointerEvent) => any;
+ onmspointermove: (this: this, ev: MSPointerEvent) => any;
+ onmspointerout: (this: this, ev: MSPointerEvent) => any;
+ onmspointerover: (this: this, ev: MSPointerEvent) => any;
+ onmspointerup: (this: this, ev: MSPointerEvent) => any;
+ onoffline: (this: this, ev: Event) => any;
+ ononline: (this: this, ev: Event) => any;
+ onorientationchange: (this: this, ev: Event) => any;
+ onpagehide: (this: this, ev: PageTransitionEvent) => any;
+ onpageshow: (this: this, ev: PageTransitionEvent) => any;
+ onpause: (this: this, ev: Event) => any;
+ onplay: (this: this, ev: Event) => any;
+ onplaying: (this: this, ev: Event) => any;
+ onpopstate: (this: this, ev: PopStateEvent) => any;
+ onprogress: (this: this, ev: ProgressEvent) => any;
+ onratechange: (this: this, ev: Event) => any;
+ onreadystatechange: (this: this, ev: ProgressEvent) => any;
+ onreset: (this: this, ev: Event) => any;
+ onresize: (this: this, ev: UIEvent) => any;
+ onscroll: (this: this, ev: UIEvent) => any;
+ onseeked: (this: this, ev: Event) => any;
+ onseeking: (this: this, ev: Event) => any;
+ onselect: (this: this, ev: UIEvent) => any;
+ onstalled: (this: this, ev: Event) => any;
+ onstorage: (this: this, ev: StorageEvent) => any;
+ onsubmit: (this: this, ev: Event) => any;
+ onsuspend: (this: this, ev: Event) => any;
+ ontimeupdate: (this: this, ev: Event) => any;
+ ontouchcancel: (ev: TouchEvent) => any;
+ ontouchend: (ev: TouchEvent) => any;
+ ontouchmove: (ev: TouchEvent) => any;
+ ontouchstart: (ev: TouchEvent) => any;
+ onunload: (this: this, ev: Event) => any;
+ onvolumechange: (this: this, ev: Event) => any;
+ onwaiting: (this: this, ev: Event) => any;
+ opener: any;
+ orientation: string | number;
+ readonly outerHeight: number;
+ readonly outerWidth: number;
+ readonly pageXOffset: number;
+ readonly pageYOffset: number;
+ readonly parent: Window;
+ readonly performance: Performance;
+ readonly personalbar: BarProp;
+ readonly screen: Screen;
+ readonly screenLeft: number;
+ readonly screenTop: number;
+ readonly screenX: number;
+ readonly screenY: number;
+ readonly scrollX: number;
+ readonly scrollY: number;
+ readonly scrollbars: BarProp;
+ readonly self: Window;
+ status: string;
+ readonly statusbar: BarProp;
+ readonly styleMedia: StyleMedia;
+ readonly toolbar: BarProp;
+ readonly top: Window;
+ readonly window: Window;
+ URL: typeof URL;
+ Blob: typeof Blob;
+ alert(message?: any): void;
+ blur(): void;
+ cancelAnimationFrame(handle: number): void;
+ captureEvents(): void;
+ close(): void;
+ confirm(message?: string): boolean;
+ focus(): void;
+ getComputedStyle(elt: Element, pseudoElt?: string): CSSStyleDeclaration;
+ getMatchedCSSRules(elt: Element, pseudoElt?: string): CSSRuleList;
+ getSelection(): Selection;
+ matchMedia(mediaQuery: string): MediaQueryList;
+ moveBy(x?: number, y?: number): void;
+ moveTo(x?: number, y?: number): void;
+ msWriteProfilerMark(profilerMarkName: string): void;
+ open(url?: string, target?: string, features?: string, replace?: boolean): Window;
+ postMessage(message: any, targetOrigin: string, transfer?: any[]): void;
+ print(): void;
+ prompt(message?: string, _default?: string): string | null;
+ releaseEvents(): void;
+ requestAnimationFrame(callback: FrameRequestCallback): number;
+ resizeBy(x?: number, y?: number): void;
+ resizeTo(x?: number, y?: number): void;
+ scroll(x?: number, y?: number): void;
+ scrollBy(x?: number, y?: number): void;
+ scrollTo(x?: number, y?: number): void;
+ webkitCancelAnimationFrame(handle: number): void;
+ webkitConvertPointFromNodeToPage(node: Node, pt: WebKitPoint): WebKitPoint;
+ webkitConvertPointFromPageToNode(node: Node, pt: WebKitPoint): WebKitPoint;
+ webkitRequestAnimationFrame(callback: FrameRequestCallback): number;
+ scroll(options?: ScrollToOptions): void;
+ scrollTo(options?: ScrollToOptions): void;
+ scrollBy(options?: ScrollToOptions): void;
+ addEventListener(type: "MSGestureChange", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureDoubleTap", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureEnd", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureHold", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureStart", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureTap", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSInertiaStart", listener: (this: this, ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerCancel", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerDown", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerEnter", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerLeave", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerMove", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerOut", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerOver", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerUp", listener: (this: this, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "abort", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "afterprint", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "beforeprint", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "beforeunload", listener: (this: this, ev: BeforeUnloadEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "blur", listener: (this: this, ev: FocusEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "canplay", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "canplaythrough", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "change", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "click", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "compassneedscalibration", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "contextmenu", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dblclick", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "devicelight", listener: (this: this, ev: DeviceLightEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "devicemotion", listener: (this: this, ev: DeviceMotionEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "deviceorientation", listener: (this: this, ev: DeviceOrientationEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "drag", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dragend", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dragenter", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dragleave", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dragover", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dragstart", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "drop", listener: (this: this, ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "durationchange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "emptied", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "ended", listener: (this: this, ev: MediaStreamErrorEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "focus", listener: (this: this, ev: FocusEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "hashchange", listener: (this: this, ev: HashChangeEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "input", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "invalid", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "keydown", listener: (this: this, ev: KeyboardEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "keypress", listener: (this: this, ev: KeyboardEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "keyup", listener: (this: this, ev: KeyboardEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "load", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "loadeddata", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "loadedmetadata", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "loadstart", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "message", listener: (this: this, ev: MessageEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mousedown", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mouseenter", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mouseleave", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mousemove", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mouseout", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mouseover", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mouseup", listener: (this: this, ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mousewheel", listener: (this: this, ev: WheelEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "offline", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "online", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "orientationchange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "pagehide", listener: (this: this, ev: PageTransitionEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pageshow", listener: (this: this, ev: PageTransitionEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pause", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "play", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "playing", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointercancel", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerdown", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerenter", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerleave", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointermove", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerout", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerover", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerup", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "popstate", listener: (this: this, ev: PopStateEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "progress", listener: (this: this, ev: ProgressEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "ratechange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "readystatechange", listener: (this: this, ev: ProgressEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "reset", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "resize", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "scroll", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "seeked", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "seeking", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "select", listener: (this: this, ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "stalled", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "storage", listener: (this: this, ev: StorageEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "submit", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "suspend", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "timeupdate", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "unload", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "volumechange", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "waiting", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "wheel", listener: (this: this, ev: WheelEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+ [index: number]: Window;
+}
+
+declare var Window: {
+ prototype: Window;
+ new(): Window;
+}
+
+interface Worker extends EventTarget, AbstractWorker {
+ onmessage: (this: this, ev: MessageEvent) => any;
+ postMessage(message: any, ports?: any): void;
+ terminate(): void;
+ addEventListener(type: "error", listener: (this: this, ev: ErrorEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "message", listener: (this: this, ev: MessageEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var Worker: {
+ prototype: Worker;
+ new(stringUrl: string): Worker;
+}
+
+interface XMLDocument extends Document {
+}
+
+declare var XMLDocument: {
+ prototype: XMLDocument;
+ new(): XMLDocument;
+}
+
+interface XMLHttpRequest extends EventTarget, XMLHttpRequestEventTarget {
+ onreadystatechange: (this: this, ev: ProgressEvent) => any;
+ readonly readyState: number;
+ readonly response: any;
+ readonly responseText: string;
+ responseType: string;
+ readonly responseXML: any;
+ readonly status: number;
+ readonly statusText: string;
+ timeout: number;
+ readonly upload: XMLHttpRequestUpload;
+ withCredentials: boolean;
+ msCaching?: string;
+ abort(): void;
+ getAllResponseHeaders(): string;
+ getResponseHeader(header: string): string | null;
+ msCachingEnabled(): boolean;
+ open(method: string, url: string, async?: boolean, user?: string, password?: string): void;
+ overrideMimeType(mime: string): void;
+ send(data?: Document): void;
+ send(data?: string): void;
+ send(data?: any): void;
+ setRequestHeader(header: string, value: string): void;
+ readonly DONE: number;
+ readonly HEADERS_RECEIVED: number;
+ readonly LOADING: number;
+ readonly OPENED: number;
+ readonly UNSENT: number;
+ addEventListener(type: "abort", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "error", listener: (this: this, ev: ErrorEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "load", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "loadend", listener: (this: this, ev: ProgressEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "loadstart", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "progress", listener: (this: this, ev: ProgressEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "readystatechange", listener: (this: this, ev: ProgressEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "timeout", listener: (this: this, ev: ProgressEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var XMLHttpRequest: {
+ prototype: XMLHttpRequest;
+ new(): XMLHttpRequest;
+ readonly DONE: number;
+ readonly HEADERS_RECEIVED: number;
+ readonly LOADING: number;
+ readonly OPENED: number;
+ readonly UNSENT: number;
+ create(): XMLHttpRequest;
+}
+
+interface XMLHttpRequestUpload extends EventTarget, XMLHttpRequestEventTarget {
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var XMLHttpRequestUpload: {
+ prototype: XMLHttpRequestUpload;
+ new(): XMLHttpRequestUpload;
+}
+
+interface XMLSerializer {
+ serializeToString(target: Node): string;
+}
+
+declare var XMLSerializer: {
+ prototype: XMLSerializer;
+ new(): XMLSerializer;
+}
+
+interface XPathEvaluator {
+ createExpression(expression: string, resolver: XPathNSResolver): XPathExpression;
+ createNSResolver(nodeResolver?: Node): XPathNSResolver;
+ evaluate(expression: string, contextNode: Node, resolver: XPathNSResolver, type: number, result: XPathResult): XPathResult;
+}
+
+declare var XPathEvaluator: {
+ prototype: XPathEvaluator;
+ new(): XPathEvaluator;
+}
+
+interface XPathExpression {
+ evaluate(contextNode: Node, type: number, result: XPathResult): XPathExpression;
+}
+
+declare var XPathExpression: {
+ prototype: XPathExpression;
+ new(): XPathExpression;
+}
+
+interface XPathNSResolver {
+ lookupNamespaceURI(prefix: string): string;
+}
+
+declare var XPathNSResolver: {
+ prototype: XPathNSResolver;
+ new(): XPathNSResolver;
+}
+
+interface XPathResult {
+ readonly booleanValue: boolean;
+ readonly invalidIteratorState: boolean;
+ readonly numberValue: number;
+ readonly resultType: number;
+ readonly singleNodeValue: Node;
+ readonly snapshotLength: number;
+ readonly stringValue: string;
+ iterateNext(): Node;
+ snapshotItem(index: number): Node;
+ readonly ANY_TYPE: number;
+ readonly ANY_UNORDERED_NODE_TYPE: number;
+ readonly BOOLEAN_TYPE: number;
+ readonly FIRST_ORDERED_NODE_TYPE: number;
+ readonly NUMBER_TYPE: number;
+ readonly ORDERED_NODE_ITERATOR_TYPE: number;
+ readonly ORDERED_NODE_SNAPSHOT_TYPE: number;
+ readonly STRING_TYPE: number;
+ readonly UNORDERED_NODE_ITERATOR_TYPE: number;
+ readonly UNORDERED_NODE_SNAPSHOT_TYPE: number;
+}
+
+declare var XPathResult: {
+ prototype: XPathResult;
+ new(): XPathResult;
+ readonly ANY_TYPE: number;
+ readonly ANY_UNORDERED_NODE_TYPE: number;
+ readonly BOOLEAN_TYPE: number;
+ readonly FIRST_ORDERED_NODE_TYPE: number;
+ readonly NUMBER_TYPE: number;
+ readonly ORDERED_NODE_ITERATOR_TYPE: number;
+ readonly ORDERED_NODE_SNAPSHOT_TYPE: number;
+ readonly STRING_TYPE: number;
+ readonly UNORDERED_NODE_ITERATOR_TYPE: number;
+ readonly UNORDERED_NODE_SNAPSHOT_TYPE: number;
+}
+
+interface XSLTProcessor {
+ clearParameters(): void;
+ getParameter(namespaceURI: string, localName: string): any;
+ importStylesheet(style: Node): void;
+ removeParameter(namespaceURI: string, localName: string): void;
+ reset(): void;
+ setParameter(namespaceURI: string, localName: string, value: any): void;
+ transformToDocument(source: Node): Document;
+ transformToFragment(source: Node, document: Document): DocumentFragment;
+}
+
+declare var XSLTProcessor: {
+ prototype: XSLTProcessor;
+ new(): XSLTProcessor;
+}
+
+interface AbstractWorker {
+ onerror: (this: this, ev: ErrorEvent) => any;
+ addEventListener(type: "error", listener: (this: this, ev: ErrorEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+interface CanvasPathMethods {
+ arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, anticlockwise?: boolean): void;
+ arcTo(x1: number, y1: number, x2: number, y2: number, radius: number): void;
+ bezierCurveTo(cp1x: number, cp1y: number, cp2x: number, cp2y: number, x: number, y: number): void;
+ closePath(): void;
+ ellipse(x: number, y: number, radiusX: number, radiusY: number, rotation: number, startAngle: number, endAngle: number, anticlockwise?: boolean): void;
+ lineTo(x: number, y: number): void;
+ moveTo(x: number, y: number): void;
+ quadraticCurveTo(cpx: number, cpy: number, x: number, y: number): void;
+ rect(x: number, y: number, w: number, h: number): void;
+}
+
+interface ChildNode {
+ remove(): void;
+}
+
+interface DOML2DeprecatedColorProperty {
+ color: string;
+}
+
+interface DOML2DeprecatedSizeProperty {
+ size: number;
+}
+
+interface DocumentEvent {
+ createEvent(eventInterface:"AnimationEvent"): AnimationEvent;
+ createEvent(eventInterface:"AriaRequestEvent"): AriaRequestEvent;
+ createEvent(eventInterface:"AudioProcessingEvent"): AudioProcessingEvent;
+ createEvent(eventInterface:"BeforeUnloadEvent"): BeforeUnloadEvent;
+ createEvent(eventInterface:"ClipboardEvent"): ClipboardEvent;
+ createEvent(eventInterface:"CloseEvent"): CloseEvent;
+ createEvent(eventInterface:"CommandEvent"): CommandEvent;
+ createEvent(eventInterface:"CompositionEvent"): CompositionEvent;
+ createEvent(eventInterface:"CustomEvent"): CustomEvent;
+ createEvent(eventInterface:"DeviceLightEvent"): DeviceLightEvent;
+ createEvent(eventInterface:"DeviceMotionEvent"): DeviceMotionEvent;
+ createEvent(eventInterface:"DeviceOrientationEvent"): DeviceOrientationEvent;
+ createEvent(eventInterface:"DragEvent"): DragEvent;
+ createEvent(eventInterface:"ErrorEvent"): ErrorEvent;
+ createEvent(eventInterface:"Event"): Event;
+ createEvent(eventInterface:"Events"): Event;
+ createEvent(eventInterface:"FocusEvent"): FocusEvent;
+ createEvent(eventInterface:"GamepadEvent"): GamepadEvent;
+ createEvent(eventInterface:"HashChangeEvent"): HashChangeEvent;
+ createEvent(eventInterface:"IDBVersionChangeEvent"): IDBVersionChangeEvent;
+ createEvent(eventInterface:"KeyboardEvent"): KeyboardEvent;
+ createEvent(eventInterface:"ListeningStateChangedEvent"): ListeningStateChangedEvent;
+ createEvent(eventInterface:"LongRunningScriptDetectedEvent"): LongRunningScriptDetectedEvent;
+ createEvent(eventInterface:"MSGestureEvent"): MSGestureEvent;
+ createEvent(eventInterface:"MSManipulationEvent"): MSManipulationEvent;
+ createEvent(eventInterface:"MSMediaKeyMessageEvent"): MSMediaKeyMessageEvent;
+ createEvent(eventInterface:"MSMediaKeyNeededEvent"): MSMediaKeyNeededEvent;
+ createEvent(eventInterface:"MSPointerEvent"): MSPointerEvent;
+ createEvent(eventInterface:"MSSiteModeEvent"): MSSiteModeEvent;
+ createEvent(eventInterface:"MediaEncryptedEvent"): MediaEncryptedEvent;
+ createEvent(eventInterface:"MediaKeyMessageEvent"): MediaKeyMessageEvent;
+ createEvent(eventInterface:"MediaStreamErrorEvent"): MediaStreamErrorEvent;
+ createEvent(eventInterface:"MediaStreamTrackEvent"): MediaStreamTrackEvent;
+ createEvent(eventInterface:"MessageEvent"): MessageEvent;
+ createEvent(eventInterface:"MouseEvent"): MouseEvent;
+ createEvent(eventInterface:"MouseEvents"): MouseEvent;
+ createEvent(eventInterface:"MutationEvent"): MutationEvent;
+ createEvent(eventInterface:"MutationEvents"): MutationEvent;
+ createEvent(eventInterface:"NavigationCompletedEvent"): NavigationCompletedEvent;
+ createEvent(eventInterface:"NavigationEvent"): NavigationEvent;
+ createEvent(eventInterface:"NavigationEventWithReferrer"): NavigationEventWithReferrer;
+ createEvent(eventInterface:"OfflineAudioCompletionEvent"): OfflineAudioCompletionEvent;
+ createEvent(eventInterface:"OverflowEvent"): OverflowEvent;
+ createEvent(eventInterface:"PageTransitionEvent"): PageTransitionEvent;
+ createEvent(eventInterface:"PermissionRequestedEvent"): PermissionRequestedEvent;
+ createEvent(eventInterface:"PointerEvent"): PointerEvent;
+ createEvent(eventInterface:"PopStateEvent"): PopStateEvent;
+ createEvent(eventInterface:"ProgressEvent"): ProgressEvent;
+ createEvent(eventInterface:"RTCDTMFToneChangeEvent"): RTCDTMFToneChangeEvent;
+ createEvent(eventInterface:"RTCDtlsTransportStateChangedEvent"): RTCDtlsTransportStateChangedEvent;
+ createEvent(eventInterface:"RTCIceCandidatePairChangedEvent"): RTCIceCandidatePairChangedEvent;
+ createEvent(eventInterface:"RTCIceGathererEvent"): RTCIceGathererEvent;
+ createEvent(eventInterface:"RTCIceTransportStateChangedEvent"): RTCIceTransportStateChangedEvent;
+ createEvent(eventInterface:"RTCSsrcConflictEvent"): RTCSsrcConflictEvent;
+ createEvent(eventInterface:"SVGZoomEvent"): SVGZoomEvent;
+ createEvent(eventInterface:"SVGZoomEvents"): SVGZoomEvent;
+ createEvent(eventInterface:"ScriptNotifyEvent"): ScriptNotifyEvent;
+ createEvent(eventInterface:"StorageEvent"): StorageEvent;
+ createEvent(eventInterface:"TextEvent"): TextEvent;
+ createEvent(eventInterface:"TouchEvent"): TouchEvent;
+ createEvent(eventInterface:"TrackEvent"): TrackEvent;
+ createEvent(eventInterface:"TransitionEvent"): TransitionEvent;
+ createEvent(eventInterface:"UIEvent"): UIEvent;
+ createEvent(eventInterface:"UIEvents"): UIEvent;
+ createEvent(eventInterface:"UnviewableContentIdentifiedEvent"): UnviewableContentIdentifiedEvent;
+ createEvent(eventInterface:"WebGLContextEvent"): WebGLContextEvent;
+ createEvent(eventInterface:"WheelEvent"): WheelEvent;
+ createEvent(eventInterface: string): Event;
+}
+
+interface ElementTraversal {
+ readonly childElementCount: number;
+ readonly firstElementChild: Element;
+ readonly lastElementChild: Element;
+ readonly nextElementSibling: Element;
+ readonly previousElementSibling: Element;
+}
+
+interface GetSVGDocument {
+ getSVGDocument(): Document;
+}
+
+interface GlobalEventHandlers {
+ onpointercancel: (this: this, ev: PointerEvent) => any;
+ onpointerdown: (this: this, ev: PointerEvent) => any;
+ onpointerenter: (this: this, ev: PointerEvent) => any;
+ onpointerleave: (this: this, ev: PointerEvent) => any;
+ onpointermove: (this: this, ev: PointerEvent) => any;
+ onpointerout: (this: this, ev: PointerEvent) => any;
+ onpointerover: (this: this, ev: PointerEvent) => any;
+ onpointerup: (this: this, ev: PointerEvent) => any;
+ onwheel: (this: this, ev: WheelEvent) => any;
+ addEventListener(type: "pointercancel", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerdown", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerenter", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerleave", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointermove", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerout", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerover", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerup", listener: (this: this, ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "wheel", listener: (this: this, ev: WheelEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+interface HTMLTableAlignment {
+ /**
+ * Sets or retrieves a value that you can use to implement your own ch functionality for the object.
+ */
+ ch: string;
+ /**
+ * Sets or retrieves a value that you can use to implement your own chOff functionality for the object.
+ */
+ chOff: string;
+ /**
+ * Sets or retrieves how text and other content are vertically aligned within the object that contains them.
+ */
+ vAlign: string;
+}
+
+interface IDBEnvironment {
+ readonly indexedDB: IDBFactory;
+}
+
+interface LinkStyle {
+ readonly sheet: StyleSheet;
+}
+
+interface MSBaseReader {
+ onabort: (this: this, ev: Event) => any;
+ onerror: (this: this, ev: ErrorEvent) => any;
+ onload: (this: this, ev: Event) => any;
+ onloadend: (this: this, ev: ProgressEvent) => any;
+ onloadstart: (this: this, ev: Event) => any;
+ onprogress: (this: this, ev: ProgressEvent) => any;
+ readonly readyState: number;
+ readonly result: any;
+ abort(): void;
+ readonly DONE: number;
+ readonly EMPTY: number;
+ readonly LOADING: number;
+ addEventListener(type: "abort", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "error", listener: (this: this, ev: ErrorEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "load", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "loadend", listener: (this: this, ev: ProgressEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "loadstart", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "progress", listener: (this: this, ev: ProgressEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+interface MSFileSaver {
+ msSaveBlob(blob: any, defaultName?: string): boolean;
+ msSaveOrOpenBlob(blob: any, defaultName?: string): boolean;
+}
+
+interface MSNavigatorDoNotTrack {
+ confirmSiteSpecificTrackingException(args: ConfirmSiteSpecificExceptionsInformation): boolean;
+ confirmWebWideTrackingException(args: ExceptionInformation): boolean;
+ removeSiteSpecificTrackingException(args: ExceptionInformation): void;
+ removeWebWideTrackingException(args: ExceptionInformation): void;
+ storeSiteSpecificTrackingException(args: StoreSiteSpecificExceptionsInformation): void;
+ storeWebWideTrackingException(args: StoreExceptionsInformation): void;
+}
+
+interface NavigatorContentUtils {
+}
+
+interface NavigatorGeolocation {
+ readonly geolocation: Geolocation;
+}
+
+interface NavigatorID {
+ readonly appName: string;
+ readonly appVersion: string;
+ readonly platform: string;
+ readonly product: string;
+ readonly productSub: string;
+ readonly userAgent: string;
+ readonly vendor: string;
+ readonly vendorSub: string;
+}
+
+interface NavigatorOnLine {
+ readonly onLine: boolean;
+}
+
+interface NavigatorStorageUtils {
+}
+
+interface NavigatorUserMedia {
+ readonly mediaDevices: MediaDevices;
+ getUserMedia(constraints: MediaStreamConstraints, successCallback: NavigatorUserMediaSuccessCallback, errorCallback: NavigatorUserMediaErrorCallback): void;
+}
+
+interface NodeSelector {
+ querySelector(selectors: "a"): HTMLAnchorElement;
+ querySelector(selectors: "abbr"): HTMLElement;
+ querySelector(selectors: "acronym"): HTMLElement;
+ querySelector(selectors: "address"): HTMLElement;
+ querySelector(selectors: "applet"): HTMLAppletElement;
+ querySelector(selectors: "area"): HTMLAreaElement;
+ querySelector(selectors: "article"): HTMLElement;
+ querySelector(selectors: "aside"): HTMLElement;
+ querySelector(selectors: "audio"): HTMLAudioElement;
+ querySelector(selectors: "b"): HTMLElement;
+ querySelector(selectors: "base"): HTMLBaseElement;
+ querySelector(selectors: "basefont"): HTMLBaseFontElement;
+ querySelector(selectors: "bdo"): HTMLElement;
+ querySelector(selectors: "big"): HTMLElement;
+ querySelector(selectors: "blockquote"): HTMLQuoteElement;
+ querySelector(selectors: "body"): HTMLBodyElement;
+ querySelector(selectors: "br"): HTMLBRElement;
+ querySelector(selectors: "button"): HTMLButtonElement;
+ querySelector(selectors: "canvas"): HTMLCanvasElement;
+ querySelector(selectors: "caption"): HTMLTableCaptionElement;
+ querySelector(selectors: "center"): HTMLElement;
+ querySelector(selectors: "circle"): SVGCircleElement;
+ querySelector(selectors: "cite"): HTMLElement;
+ querySelector(selectors: "clippath"): SVGClipPathElement;
+ querySelector(selectors: "code"): HTMLElement;
+ querySelector(selectors: "col"): HTMLTableColElement;
+ querySelector(selectors: "colgroup"): HTMLTableColElement;
+ querySelector(selectors: "datalist"): HTMLDataListElement;
+ querySelector(selectors: "dd"): HTMLElement;
+ querySelector(selectors: "defs"): SVGDefsElement;
+ querySelector(selectors: "del"): HTMLModElement;
+ querySelector(selectors: "desc"): SVGDescElement;
+ querySelector(selectors: "dfn"): HTMLElement;
+ querySelector(selectors: "dir"): HTMLDirectoryElement;
+ querySelector(selectors: "div"): HTMLDivElement;
+ querySelector(selectors: "dl"): HTMLDListElement;
+ querySelector(selectors: "dt"): HTMLElement;
+ querySelector(selectors: "ellipse"): SVGEllipseElement;
+ querySelector(selectors: "em"): HTMLElement;
+ querySelector(selectors: "embed"): HTMLEmbedElement;
+ querySelector(selectors: "feblend"): SVGFEBlendElement;
+ querySelector(selectors: "fecolormatrix"): SVGFEColorMatrixElement;
+ querySelector(selectors: "fecomponenttransfer"): SVGFEComponentTransferElement;
+ querySelector(selectors: "fecomposite"): SVGFECompositeElement;
+ querySelector(selectors: "feconvolvematrix"): SVGFEConvolveMatrixElement;
+ querySelector(selectors: "fediffuselighting"): SVGFEDiffuseLightingElement;
+ querySelector(selectors: "fedisplacementmap"): SVGFEDisplacementMapElement;
+ querySelector(selectors: "fedistantlight"): SVGFEDistantLightElement;
+ querySelector(selectors: "feflood"): SVGFEFloodElement;
+ querySelector(selectors: "fefunca"): SVGFEFuncAElement;
+ querySelector(selectors: "fefuncb"): SVGFEFuncBElement;
+ querySelector(selectors: "fefuncg"): SVGFEFuncGElement;
+ querySelector(selectors: "fefuncr"): SVGFEFuncRElement;
+ querySelector(selectors: "fegaussianblur"): SVGFEGaussianBlurElement;
+ querySelector(selectors: "feimage"): SVGFEImageElement;
+ querySelector(selectors: "femerge"): SVGFEMergeElement;
+ querySelector(selectors: "femergenode"): SVGFEMergeNodeElement;
+ querySelector(selectors: "femorphology"): SVGFEMorphologyElement;
+ querySelector(selectors: "feoffset"): SVGFEOffsetElement;
+ querySelector(selectors: "fepointlight"): SVGFEPointLightElement;
+ querySelector(selectors: "fespecularlighting"): SVGFESpecularLightingElement;
+ querySelector(selectors: "fespotlight"): SVGFESpotLightElement;
+ querySelector(selectors: "fetile"): SVGFETileElement;
+ querySelector(selectors: "feturbulence"): SVGFETurbulenceElement;
+ querySelector(selectors: "fieldset"): HTMLFieldSetElement;
+ querySelector(selectors: "figcaption"): HTMLElement;
+ querySelector(selectors: "figure"): HTMLElement;
+ querySelector(selectors: "filter"): SVGFilterElement;
+ querySelector(selectors: "font"): HTMLFontElement;
+ querySelector(selectors: "footer"): HTMLElement;
+ querySelector(selectors: "foreignobject"): SVGForeignObjectElement;
+ querySelector(selectors: "form"): HTMLFormElement;
+ querySelector(selectors: "frame"): HTMLFrameElement;
+ querySelector(selectors: "frameset"): HTMLFrameSetElement;
+ querySelector(selectors: "g"): SVGGElement;
+ querySelector(selectors: "h1"): HTMLHeadingElement;
+ querySelector(selectors: "h2"): HTMLHeadingElement;
+ querySelector(selectors: "h3"): HTMLHeadingElement;
+ querySelector(selectors: "h4"): HTMLHeadingElement;
+ querySelector(selectors: "h5"): HTMLHeadingElement;
+ querySelector(selectors: "h6"): HTMLHeadingElement;
+ querySelector(selectors: "head"): HTMLHeadElement;
+ querySelector(selectors: "header"): HTMLElement;
+ querySelector(selectors: "hgroup"): HTMLElement;
+ querySelector(selectors: "hr"): HTMLHRElement;
+ querySelector(selectors: "html"): HTMLHtmlElement;
+ querySelector(selectors: "i"): HTMLElement;
+ querySelector(selectors: "iframe"): HTMLIFrameElement;
+ querySelector(selectors: "image"): SVGImageElement;
+ querySelector(selectors: "img"): HTMLImageElement;
+ querySelector(selectors: "input"): HTMLInputElement;
+ querySelector(selectors: "ins"): HTMLModElement;
+ querySelector(selectors: "isindex"): HTMLUnknownElement;
+ querySelector(selectors: "kbd"): HTMLElement;
+ querySelector(selectors: "keygen"): HTMLElement;
+ querySelector(selectors: "label"): HTMLLabelElement;
+ querySelector(selectors: "legend"): HTMLLegendElement;
+ querySelector(selectors: "li"): HTMLLIElement;
+ querySelector(selectors: "line"): SVGLineElement;
+ querySelector(selectors: "lineargradient"): SVGLinearGradientElement;
+ querySelector(selectors: "link"): HTMLLinkElement;
+ querySelector(selectors: "listing"): HTMLPreElement;
+ querySelector(selectors: "map"): HTMLMapElement;
+ querySelector(selectors: "mark"): HTMLElement;
+ querySelector(selectors: "marker"): SVGMarkerElement;
+ querySelector(selectors: "marquee"): HTMLMarqueeElement;
+ querySelector(selectors: "mask"): SVGMaskElement;
+ querySelector(selectors: "menu"): HTMLMenuElement;
+ querySelector(selectors: "meta"): HTMLMetaElement;
+ querySelector(selectors: "metadata"): SVGMetadataElement;
+ querySelector(selectors: "meter"): HTMLMeterElement;
+ querySelector(selectors: "nav"): HTMLElement;
+ querySelector(selectors: "nextid"): HTMLUnknownElement;
+ querySelector(selectors: "nobr"): HTMLElement;
+ querySelector(selectors: "noframes"): HTMLElement;
+ querySelector(selectors: "noscript"): HTMLElement;
+ querySelector(selectors: "object"): HTMLObjectElement;
+ querySelector(selectors: "ol"): HTMLOListElement;
+ querySelector(selectors: "optgroup"): HTMLOptGroupElement;
+ querySelector(selectors: "option"): HTMLOptionElement;
+ querySelector(selectors: "p"): HTMLParagraphElement;
+ querySelector(selectors: "param"): HTMLParamElement;
+ querySelector(selectors: "path"): SVGPathElement;
+ querySelector(selectors: "pattern"): SVGPatternElement;
+ querySelector(selectors: "picture"): HTMLPictureElement;
+ querySelector(selectors: "plaintext"): HTMLElement;
+ querySelector(selectors: "polygon"): SVGPolygonElement;
+ querySelector(selectors: "polyline"): SVGPolylineElement;
+ querySelector(selectors: "pre"): HTMLPreElement;
+ querySelector(selectors: "progress"): HTMLProgressElement;
+ querySelector(selectors: "q"): HTMLQuoteElement;
+ querySelector(selectors: "radialgradient"): SVGRadialGradientElement;
+ querySelector(selectors: "rect"): SVGRectElement;
+ querySelector(selectors: "rt"): HTMLElement;
+ querySelector(selectors: "ruby"): HTMLElement;
+ querySelector(selectors: "s"): HTMLElement;
+ querySelector(selectors: "samp"): HTMLElement;
+ querySelector(selectors: "script"): HTMLScriptElement;
+ querySelector(selectors: "section"): HTMLElement;
+ querySelector(selectors: "select"): HTMLSelectElement;
+ querySelector(selectors: "small"): HTMLElement;
+ querySelector(selectors: "source"): HTMLSourceElement;
+ querySelector(selectors: "span"): HTMLSpanElement;
+ querySelector(selectors: "stop"): SVGStopElement;
+ querySelector(selectors: "strike"): HTMLElement;
+ querySelector(selectors: "strong"): HTMLElement;
+ querySelector(selectors: "style"): HTMLStyleElement;
+ querySelector(selectors: "sub"): HTMLElement;
+ querySelector(selectors: "sup"): HTMLElement;
+ querySelector(selectors: "svg"): SVGSVGElement;
+ querySelector(selectors: "switch"): SVGSwitchElement;
+ querySelector(selectors: "symbol"): SVGSymbolElement;
+ querySelector(selectors: "table"): HTMLTableElement;
+ querySelector(selectors: "tbody"): HTMLTableSectionElement;
+ querySelector(selectors: "td"): HTMLTableDataCellElement;
+ querySelector(selectors: "template"): HTMLTemplateElement;
+ querySelector(selectors: "text"): SVGTextElement;
+ querySelector(selectors: "textpath"): SVGTextPathElement;
+ querySelector(selectors: "textarea"): HTMLTextAreaElement;
+ querySelector(selectors: "tfoot"): HTMLTableSectionElement;
+ querySelector(selectors: "th"): HTMLTableHeaderCellElement;
+ querySelector(selectors: "thead"): HTMLTableSectionElement;
+ querySelector(selectors: "title"): HTMLTitleElement;
+ querySelector(selectors: "tr"): HTMLTableRowElement;
+ querySelector(selectors: "track"): HTMLTrackElement;
+ querySelector(selectors: "tspan"): SVGTSpanElement;
+ querySelector(selectors: "tt"): HTMLElement;
+ querySelector(selectors: "u"): HTMLElement;
+ querySelector(selectors: "ul"): HTMLUListElement;
+ querySelector(selectors: "use"): SVGUseElement;
+ querySelector(selectors: "var"): HTMLElement;
+ querySelector(selectors: "video"): HTMLVideoElement;
+ querySelector(selectors: "view"): SVGViewElement;
+ querySelector(selectors: "wbr"): HTMLElement;
+ querySelector(selectors: "x-ms-webview"): MSHTMLWebViewElement;
+ querySelector(selectors: "xmp"): HTMLPreElement;
+ querySelector(selectors: string): Element;
+ querySelectorAll(selectors: "a"): NodeListOf<HTMLAnchorElement>;
+ querySelectorAll(selectors: "abbr"): NodeListOf<HTMLElement>;
+ querySelectorAll(selectors: "acronym"): NodeListOf<HTMLElement>;
+ querySelectorAll(selectors: "address"): NodeListOf<HTMLElement>;
+ querySelectorAll(selectors: "applet"): NodeListOf<HTMLAppletElement>;
+ querySelectorAll(selectors: "area"): NodeListOf<HTMLAreaElement>;
+ querySelectorAll(selectors: "article"): NodeListOf<HTMLElement>;
+ querySelectorAll(selectors: "aside"): NodeListOf<HTMLElement>;
+ querySelectorAll(selectors: "audio"): NodeListOf<HTMLAudioElement>;
+ querySelectorAll(selectors: "b"): NodeListOf<HTMLElement>;
+ querySelectorAll(selectors: "base"): NodeListOf<HTMLBaseElement>;
+ querySelectorAll(selectors: "basefont"): NodeListOf<HTMLBaseFontElement>;
+ querySelectorAll(selectors: "bdo"): NodeListOf<HTMLElement>;
+ querySelectorAll(selectors: "big"): NodeListOf<HTMLElement>;
+ querySelectorAll(selectors: "blockquote"): NodeListOf<HTMLQuoteElement>;
+ querySelectorAll(selectors: "body"): NodeListOf<HTMLBodyElement>;
+ querySelectorAll(selectors: "br"): NodeListOf<HTMLBRElement>;
+ querySelectorAll(selectors: "button"): NodeListOf<HTMLButtonElement>;
+ querySelectorAll(selectors: "canvas"): NodeListOf<HTMLCanvasElement>;
+ querySelectorAll(selectors: "caption"): NodeListOf<HTMLTableCaptionElement>;
+ querySelectorAll(selectors: "center"): NodeListOf<HTMLElement>;
+ querySelectorAll(selectors: "circle"): NodeListOf<SVGCircleElement>;
+ querySelectorAll(selectors: "cite"): NodeListOf<HTMLElement>;
+ querySelectorAll(selectors: "clippath"): NodeListOf<SVGClipPathElement>;
+ querySelectorAll(selectors: "code"): NodeListOf<HTMLElement>;
+ querySelectorAll(selectors: "col"): NodeListOf<HTMLTableColElement>;
+ querySelectorAll(selectors: "colgroup"): NodeListOf<HTMLTableColElement>;
+ querySelectorAll(selectors: "datalist"): NodeListOf<HTMLDataListElement>;
+ querySelectorAll(selectors: "dd"): NodeListOf<HTMLElement>;
+ querySelectorAll(selectors: "defs"): NodeListOf<SVGDefsElement>;
+ querySelectorAll(selectors: "del"): NodeListOf<HTMLModElement>;
+ querySelectorAll(selectors: "desc"): NodeListOf<SVGDescElement>;
+ querySelectorAll(selectors: "dfn"): NodeListOf<HTMLElement>;
+ querySelectorAll(selectors: "dir"): NodeListOf<HTMLDirectoryElement>;
+ querySelectorAll(selectors: "div"): NodeListOf<HTMLDivElement>;
+ querySelectorAll(selectors: "dl"): NodeListOf<HTMLDListElement>;
+ querySelectorAll(selectors: "dt"): NodeListOf<HTMLElement>;
+ querySelectorAll(selectors: "ellipse"): NodeListOf<SVGEllipseElement>;
+ querySelectorAll(selectors: "em"): NodeListOf<HTMLElement>;
+ querySelectorAll(selectors: "embed"): NodeListOf<HTMLEmbedElement>;
+ querySelectorAll(selectors: "feblend"): NodeListOf<SVGFEBlendElement>;
+ querySelectorAll(selectors: "fecolormatrix"): NodeListOf<SVGFEColorMatrixElement>;
+ querySelectorAll(selectors: "fecomponenttransfer"): NodeListOf<SVGFEComponentTransferElement>;
+ querySelectorAll(selectors: "fecomposite"): NodeListOf<SVGFECompositeElement>;
+ querySelectorAll(selectors: "feconvolvematrix"): NodeListOf<SVGFEConvolveMatrixElement>;
+ querySelectorAll(selectors: "fediffuselighting"): NodeListOf<SVGFEDiffuseLightingElement>;
+ querySelectorAll(selectors: "fedisplacementmap"): NodeListOf<SVGFEDisplacementMapElement>;
+ querySelectorAll(selectors: "fedistantlight"): NodeListOf<SVGFEDistantLightElement>;
+ querySelectorAll(selectors: "feflood"): NodeListOf<SVGFEFloodElement>;
+ querySelectorAll(selectors: "fefunca"): NodeListOf<SVGFEFuncAElement>;
+ querySelectorAll(selectors: "fefuncb"): NodeListOf<SVGFEFuncBElement>;
+ querySelectorAll(selectors: "fefuncg"): NodeListOf<SVGFEFuncGElement>;
+ querySelectorAll(selectors: "fefuncr"): NodeListOf<SVGFEFuncRElement>;
+ querySelectorAll(selectors: "fegaussianblur"): NodeListOf<SVGFEGaussianBlurElement>;
+ querySelectorAll(selectors: "feimage"): NodeListOf<SVGFEImageElement>;
+ querySelectorAll(selectors: "femerge"): NodeListOf<SVGFEMergeElement>;
+ querySelectorAll(selectors: "femergenode"): NodeListOf<SVGFEMergeNodeElement>;
+ querySelectorAll(selectors: "femorphology"): NodeListOf<SVGFEMorphologyElement>;
+ querySelectorAll(selectors: "feoffset"): NodeListOf<SVGFEOffsetElement>;
+ querySelectorAll(selectors: "fepointlight"): NodeListOf<SVGFEPointLightElement>;
+ querySelectorAll(selectors: "fespecularlighting"): NodeListOf<SVGFESpecularLightingElement>;
+ querySelectorAll(selectors: "fespotlight"): NodeListOf<SVGFESpotLightElement>;
+ querySelectorAll(selectors: "fetile"): NodeListOf<SVGFETileElement>;
+ querySelectorAll(selectors: "feturbulence"): NodeListOf<SVGFETurbulenceElement>;
+ querySelectorAll(selectors: "fieldset"): NodeListOf<HTMLFieldSetElement>;
+ querySelectorAll(selectors: "figcaption"): NodeListOf<HTMLElement>;
+ querySelectorAll(selectors: "figure"): NodeListOf<HTMLElement>;
+ querySelectorAll(selectors: "filter"): NodeListOf<SVGFilterElement>;
+ querySelectorAll(selectors: "font"): NodeListOf<HTMLFontElement>;
+ querySelectorAll(selectors: "footer"): NodeListOf<HTMLElement>;
+ querySelectorAll(selectors: "foreignobject"): NodeListOf<SVGForeignObjectElement>;
+ querySelectorAll(selectors: "form"): NodeListOf<HTMLFormElement>;
+ querySelectorAll(selectors: "frame"): NodeListOf<HTMLFrameElement>;
+ querySelectorAll(selectors: "frameset"): NodeListOf<HTMLFrameSetElement>;
+ querySelectorAll(selectors: "g"): NodeListOf<SVGGElement>;
+ querySelectorAll(selectors: "h1"): NodeListOf<HTMLHeadingElement>;
+ querySelectorAll(selectors: "h2"): NodeListOf<HTMLHeadingElement>;
+ querySelectorAll(selectors: "h3"): NodeListOf<HTMLHeadingElement>;
+ querySelectorAll(selectors: "h4"): NodeListOf<HTMLHeadingElement>;
+ querySelectorAll(selectors: "h5"): NodeListOf<HTMLHeadingElement>;
+ querySelectorAll(selectors: "h6"): NodeListOf<HTMLHeadingElement>;
+ querySelectorAll(selectors: "head"): NodeListOf<HTMLHeadElement>;
+ querySelectorAll(selectors: "header"): NodeListOf<HTMLElement>;
+ querySelectorAll(selectors: "hgroup"): NodeListOf<HTMLElement>;
+ querySelectorAll(selectors: "hr"): NodeListOf<HTMLHRElement>;
+ querySelectorAll(selectors: "html"): NodeListOf<HTMLHtmlElement>;
+ querySelectorAll(selectors: "i"): NodeListOf<HTMLElement>;
+ querySelectorAll(selectors: "iframe"): NodeListOf<HTMLIFrameElement>;
+ querySelectorAll(selectors: "image"): NodeListOf<SVGImageElement>;
+ querySelectorAll(selectors: "img"): NodeListOf<HTMLImageElement>;
+ querySelectorAll(selectors: "input"): NodeListOf<HTMLInputElement>;
+ querySelectorAll(selectors: "ins"): NodeListOf<HTMLModElement>;
+ querySelectorAll(selectors: "isindex"): NodeListOf<HTMLUnknownElement>;
+ querySelectorAll(selectors: "kbd"): NodeListOf<HTMLElement>;
+ querySelectorAll(selectors: "keygen"): NodeListOf<HTMLElement>;
+ querySelectorAll(selectors: "label"): NodeListOf<HTMLLabelElement>;
+ querySelectorAll(selectors: "legend"): NodeListOf<HTMLLegendElement>;
+ querySelectorAll(selectors: "li"): NodeListOf<HTMLLIElement>;
+ querySelectorAll(selectors: "line"): NodeListOf<SVGLineElement>;
+ querySelectorAll(selectors: "lineargradient"): NodeListOf<SVGLinearGradientElement>;
+ querySelectorAll(selectors: "link"): NodeListOf<HTMLLinkElement>;
+ querySelectorAll(selectors: "listing"): NodeListOf<HTMLPreElement>;
+ querySelectorAll(selectors: "map"): NodeListOf<HTMLMapElement>;
+ querySelectorAll(selectors: "mark"): NodeListOf<HTMLElement>;
+ querySelectorAll(selectors: "marker"): NodeListOf<SVGMarkerElement>;
+ querySelectorAll(selectors: "marquee"): NodeListOf<HTMLMarqueeElement>;
+ querySelectorAll(selectors: "mask"): NodeListOf<SVGMaskElement>;
+ querySelectorAll(selectors: "menu"): NodeListOf<HTMLMenuElement>;
+ querySelectorAll(selectors: "meta"): NodeListOf<HTMLMetaElement>;
+ querySelectorAll(selectors: "metadata"): NodeListOf<SVGMetadataElement>;
+ querySelectorAll(selectors: "meter"): NodeListOf<HTMLMeterElement>;
+ querySelectorAll(selectors: "nav"): NodeListOf<HTMLElement>;
+ querySelectorAll(selectors: "nextid"): NodeListOf<HTMLUnknownElement>;
+ querySelectorAll(selectors: "nobr"): NodeListOf<HTMLElement>;
+ querySelectorAll(selectors: "noframes"): NodeListOf<HTMLElement>;
+ querySelectorAll(selectors: "noscript"): NodeListOf<HTMLElement>;
+ querySelectorAll(selectors: "object"): NodeListOf<HTMLObjectElement>;
+ querySelectorAll(selectors: "ol"): NodeListOf<HTMLOListElement>;
+ querySelectorAll(selectors: "optgroup"): NodeListOf<HTMLOptGroupElement>;
+ querySelectorAll(selectors: "option"): NodeListOf<HTMLOptionElement>;
+ querySelectorAll(selectors: "p"): NodeListOf<HTMLParagraphElement>;
+ querySelectorAll(selectors: "param"): NodeListOf<HTMLParamElement>;
+ querySelectorAll(selectors: "path"): NodeListOf<SVGPathElement>;
+ querySelectorAll(selectors: "pattern"): NodeListOf<SVGPatternElement>;
+ querySelectorAll(selectors: "picture"): NodeListOf<HTMLPictureElement>;
+ querySelectorAll(selectors: "plaintext"): NodeListOf<HTMLElement>;
+ querySelectorAll(selectors: "polygon"): NodeListOf<SVGPolygonElement>;
+ querySelectorAll(selectors: "polyline"): NodeListOf<SVGPolylineElement>;
+ querySelectorAll(selectors: "pre"): NodeListOf<HTMLPreElement>;
+ querySelectorAll(selectors: "progress"): NodeListOf<HTMLProgressElement>;
+ querySelectorAll(selectors: "q"): NodeListOf<HTMLQuoteElement>;
+ querySelectorAll(selectors: "radialgradient"): NodeListOf<SVGRadialGradientElement>;
+ querySelectorAll(selectors: "rect"): NodeListOf<SVGRectElement>;
+ querySelectorAll(selectors: "rt"): NodeListOf<HTMLElement>;
+ querySelectorAll(selectors: "ruby"): NodeListOf<HTMLElement>;
+ querySelectorAll(selectors: "s"): NodeListOf<HTMLElement>;
+ querySelectorAll(selectors: "samp"): NodeListOf<HTMLElement>;
+ querySelectorAll(selectors: "script"): NodeListOf<HTMLScriptElement>;
+ querySelectorAll(selectors: "section"): NodeListOf<HTMLElement>;
+ querySelectorAll(selectors: "select"): NodeListOf<HTMLSelectElement>;
+ querySelectorAll(selectors: "small"): NodeListOf<HTMLElement>;
+ querySelectorAll(selectors: "source"): NodeListOf<HTMLSourceElement>;
+ querySelectorAll(selectors: "span"): NodeListOf<HTMLSpanElement>;
+ querySelectorAll(selectors: "stop"): NodeListOf<SVGStopElement>;
+ querySelectorAll(selectors: "strike"): NodeListOf<HTMLElement>;
+ querySelectorAll(selectors: "strong"): NodeListOf<HTMLElement>;
+ querySelectorAll(selectors: "style"): NodeListOf<HTMLStyleElement>;
+ querySelectorAll(selectors: "sub"): NodeListOf<HTMLElement>;
+ querySelectorAll(selectors: "sup"): NodeListOf<HTMLElement>;
+ querySelectorAll(selectors: "svg"): NodeListOf<SVGSVGElement>;
+ querySelectorAll(selectors: "switch"): NodeListOf<SVGSwitchElement>;
+ querySelectorAll(selectors: "symbol"): NodeListOf<SVGSymbolElement>;
+ querySelectorAll(selectors: "table"): NodeListOf<HTMLTableElement>;
+ querySelectorAll(selectors: "tbody"): NodeListOf<HTMLTableSectionElement>;
+ querySelectorAll(selectors: "td"): NodeListOf<HTMLTableDataCellElement>;
+ querySelectorAll(selectors: "template"): NodeListOf<HTMLTemplateElement>;
+ querySelectorAll(selectors: "text"): NodeListOf<SVGTextElement>;
+ querySelectorAll(selectors: "textpath"): NodeListOf<SVGTextPathElement>;
+ querySelectorAll(selectors: "textarea"): NodeListOf<HTMLTextAreaElement>;
+ querySelectorAll(selectors: "tfoot"): NodeListOf<HTMLTableSectionElement>;
+ querySelectorAll(selectors: "th"): NodeListOf<HTMLTableHeaderCellElement>;
+ querySelectorAll(selectors: "thead"): NodeListOf<HTMLTableSectionElement>;
+ querySelectorAll(selectors: "title"): NodeListOf<HTMLTitleElement>;
+ querySelectorAll(selectors: "tr"): NodeListOf<HTMLTableRowElement>;
+ querySelectorAll(selectors: "track"): NodeListOf<HTMLTrackElement>;
+ querySelectorAll(selectors: "tspan"): NodeListOf<SVGTSpanElement>;
+ querySelectorAll(selectors: "tt"): NodeListOf<HTMLElement>;
+ querySelectorAll(selectors: "u"): NodeListOf<HTMLElement>;
+ querySelectorAll(selectors: "ul"): NodeListOf<HTMLUListElement>;
+ querySelectorAll(selectors: "use"): NodeListOf<SVGUseElement>;
+ querySelectorAll(selectors: "var"): NodeListOf<HTMLElement>;
+ querySelectorAll(selectors: "video"): NodeListOf<HTMLVideoElement>;
+ querySelectorAll(selectors: "view"): NodeListOf<SVGViewElement>;
+ querySelectorAll(selectors: "wbr"): NodeListOf<HTMLElement>;
+ querySelectorAll(selectors: "x-ms-webview"): NodeListOf<MSHTMLWebViewElement>;
+ querySelectorAll(selectors: "xmp"): NodeListOf<HTMLPreElement>;
+ querySelectorAll(selectors: string): NodeListOf<Element>;
+}
+
+interface RandomSource {
+ getRandomValues(array: ArrayBufferView): ArrayBufferView;
+}
+
+interface SVGAnimatedPathData {
+ readonly pathSegList: SVGPathSegList;
+}
+
+interface SVGAnimatedPoints {
+ readonly animatedPoints: SVGPointList;
+ readonly points: SVGPointList;
+}
+
+interface SVGExternalResourcesRequired {
+ readonly externalResourcesRequired: SVGAnimatedBoolean;
+}
+
+interface SVGFilterPrimitiveStandardAttributes extends SVGStylable {
+ readonly height: SVGAnimatedLength;
+ readonly result: SVGAnimatedString;
+ readonly width: SVGAnimatedLength;
+ readonly x: SVGAnimatedLength;
+ readonly y: SVGAnimatedLength;
+}
+
+interface SVGFitToViewBox {
+ readonly preserveAspectRatio: SVGAnimatedPreserveAspectRatio;
+ readonly viewBox: SVGAnimatedRect;
+}
+
+interface SVGLangSpace {
+ xmllang: string;
+ xmlspace: string;
+}
+
+interface SVGLocatable {
+ readonly farthestViewportElement: SVGElement;
+ readonly nearestViewportElement: SVGElement;
+ getBBox(): SVGRect;
+ getCTM(): SVGMatrix;
+ getScreenCTM(): SVGMatrix;
+ getTransformToElement(element: SVGElement): SVGMatrix;
+}
+
+interface SVGStylable {
+ className: any;
+ readonly style: CSSStyleDeclaration;
+}
+
+interface SVGTests {
+ readonly requiredExtensions: SVGStringList;
+ readonly requiredFeatures: SVGStringList;
+ readonly systemLanguage: SVGStringList;
+ hasExtension(extension: string): boolean;
+}
+
+interface SVGTransformable extends SVGLocatable {
+ readonly transform: SVGAnimatedTransformList;
+}
+
+interface SVGURIReference {
+ readonly href: SVGAnimatedString;
+}
+
+interface WindowBase64 {
+ atob(encodedString: string): string;
+ btoa(rawString: string): string;
+}
+
+interface WindowConsole {
+ readonly console: Console;
+}
+
+interface WindowLocalStorage {
+ readonly localStorage: Storage;
+}
+
+interface WindowSessionStorage {
+ readonly sessionStorage: Storage;
+}
+
+interface WindowTimers extends Object, WindowTimersExtension {
+ clearInterval(handle: number): void;
+ clearTimeout(handle: number): void;
+ setInterval(handler: (...args: any[]) => void, timeout: number): number;
+ setInterval(handler: any, timeout?: any, ...args: any[]): number;
+ setTimeout(handler: (...args: any[]) => void, timeout: number): number;
+ setTimeout(handler: any, timeout?: any, ...args: any[]): number;
+}
+
+interface WindowTimersExtension {
+ clearImmediate(handle: number): void;
+ setImmediate(handler: (...args: any[]) => void): number;
+ setImmediate(handler: any, ...args: any[]): number;
+}
+
+interface XMLHttpRequestEventTarget {
+ onabort: (this: this, ev: Event) => any;
+ onerror: (this: this, ev: ErrorEvent) => any;
+ onload: (this: this, ev: Event) => any;
+ onloadend: (this: this, ev: ProgressEvent) => any;
+ onloadstart: (this: this, ev: Event) => any;
+ onprogress: (this: this, ev: ProgressEvent) => any;
+ ontimeout: (this: this, ev: ProgressEvent) => any;
+ addEventListener(type: "abort", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "error", listener: (this: this, ev: ErrorEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "load", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "loadend", listener: (this: this, ev: ProgressEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "loadstart", listener: (this: this, ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "progress", listener: (this: this, ev: ProgressEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "timeout", listener: (this: this, ev: ProgressEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+interface StorageEventInit extends EventInit {
+ key?: string;
+ oldValue?: string;
+ newValue?: string;
+ url: string;
+ storageArea?: Storage;
+}
+
+interface Canvas2DContextAttributes {
+ alpha?: boolean;
+ willReadFrequently?: boolean;
+ storage?: boolean;
+ [attribute: string]: boolean | string | undefined;
+}
+
+interface NodeListOf<TNode extends Node> extends NodeList {
+ length: number;
+ item(index: number): TNode;
+ [index: number]: TNode;
+}
+
+interface HTMLCollectionOf<T extends Element> extends HTMLCollection {
+ item(index: number): T;
+ namedItem(name: string): T;
+ [index: number]: T;
+}
+
+interface BlobPropertyBag {
+ type?: string;
+ endings?: string;
+}
+
+interface FilePropertyBag {
+ type?: string;
+ lastModified?: number;
+}
+
+interface EventListenerObject {
+ handleEvent(evt: Event): void;
+}
+
+interface MessageEventInit extends EventInit {
+ data?: any;
+ origin?: string;
+ lastEventId?: string;
+ channel?: string;
+ source?: any;
+ ports?: MessagePort[];
+}
+
+interface ProgressEventInit extends EventInit {
+ lengthComputable?: boolean;
+ loaded?: number;
+ total?: number;
+}
+
+interface ScrollOptions {
+ behavior?: ScrollBehavior;
+}
+
+interface ScrollToOptions extends ScrollOptions {
+ left?: number;
+ top?: number;
+}
+
+interface ScrollIntoViewOptions extends ScrollOptions {
+ block?: ScrollLogicalPosition;
+ inline?: ScrollLogicalPosition;
+}
+
+interface ClipboardEventInit extends EventInit {
+ data?: string;
+ dataType?: string;
+}
+
+interface IDBArrayKey extends Array<IDBValidKey> {
+}
+
+interface RsaKeyGenParams extends Algorithm {
+ modulusLength: number;
+ publicExponent: Uint8Array;
+}
+
+interface RsaHashedKeyGenParams extends RsaKeyGenParams {
+ hash: AlgorithmIdentifier;
+}
+
+interface RsaKeyAlgorithm extends KeyAlgorithm {
+ modulusLength: number;
+ publicExponent: Uint8Array;
+}
+
+interface RsaHashedKeyAlgorithm extends RsaKeyAlgorithm {
+ hash: AlgorithmIdentifier;
+}
+
+interface RsaHashedImportParams {
+ hash: AlgorithmIdentifier;
+}
+
+interface RsaPssParams {
+ saltLength: number;
+}
+
+interface RsaOaepParams extends Algorithm {
+ label?: BufferSource;
+}
+
+interface EcdsaParams extends Algorithm {
+ hash: AlgorithmIdentifier;
+}
+
+interface EcKeyGenParams extends Algorithm {
+ namedCurve: string;
+}
+
+interface EcKeyAlgorithm extends KeyAlgorithm {
+ typedCurve: string;
+}
+
+interface EcKeyImportParams {
+ namedCurve: string;
+}
+
+interface EcdhKeyDeriveParams extends Algorithm {
+ public: CryptoKey;
+}
+
+interface AesCtrParams extends Algorithm {
+ counter: BufferSource;
+ length: number;
+}
+
+interface AesKeyAlgorithm extends KeyAlgorithm {
+ length: number;
+}
+
+interface AesKeyGenParams extends Algorithm {
+ length: number;
+}
+
+interface AesDerivedKeyParams extends Algorithm {
+ length: number;
+}
+
+interface AesCbcParams extends Algorithm {
+ iv: BufferSource;
+}
+
+interface AesCmacParams extends Algorithm {
+ length: number;
+}
+
+interface AesGcmParams extends Algorithm {
+ iv: BufferSource;
+ additionalData?: BufferSource;
+ tagLength?: number;
+}
+
+interface AesCfbParams extends Algorithm {
+ iv: BufferSource;
+}
+
+interface HmacImportParams extends Algorithm {
+ hash?: AlgorithmIdentifier;
+ length?: number;
+}
+
+interface HmacKeyAlgorithm extends KeyAlgorithm {
+ hash: AlgorithmIdentifier;
+ length: number;
+}
+
+interface HmacKeyGenParams extends Algorithm {
+ hash: AlgorithmIdentifier;
+ length?: number;
+}
+
+interface DhKeyGenParams extends Algorithm {
+ prime: Uint8Array;
+ generator: Uint8Array;
+}
+
+interface DhKeyAlgorithm extends KeyAlgorithm {
+ prime: Uint8Array;
+ generator: Uint8Array;
+}
+
+interface DhKeyDeriveParams extends Algorithm {
+ public: CryptoKey;
+}
+
+interface DhImportKeyParams extends Algorithm {
+ prime: Uint8Array;
+ generator: Uint8Array;
+}
+
+interface ConcatParams extends Algorithm {
+ hash?: AlgorithmIdentifier;
+ algorithmId: Uint8Array;
+ partyUInfo: Uint8Array;
+ partyVInfo: Uint8Array;
+ publicInfo?: Uint8Array;
+ privateInfo?: Uint8Array;
+}
+
+interface HkdfCtrParams extends Algorithm {
+ hash: AlgorithmIdentifier;
+ label: BufferSource;
+ context: BufferSource;
+}
+
+interface Pbkdf2Params extends Algorithm {
+ salt: BufferSource;
+ iterations: number;
+ hash: AlgorithmIdentifier;
+}
+
+interface RsaOtherPrimesInfo {
+ r: string;
+ d: string;
+ t: string;
+}
+
+interface JsonWebKey {
+ kty: string;
+ use?: string;
+ key_ops?: string[];
+ alg?: string;
+ kid?: string;
+ x5u?: string;
+ x5c?: string;
+ x5t?: string;
+ ext?: boolean;
+ crv?: string;
+ x?: string;
+ y?: string;
+ d?: string;
+ n?: string;
+ e?: string;
+ p?: string;
+ q?: string;
+ dp?: string;
+ dq?: string;
+ qi?: string;
+ oth?: RsaOtherPrimesInfo[];
+ k?: string;
+}
+
+interface ParentNode {
+ readonly children: HTMLCollection;
+ readonly firstElementChild: Element;
+ readonly lastElementChild: Element;
+ readonly childElementCount: number;
+}
+
+declare type EventListenerOrEventListenerObject = EventListener | EventListenerObject;
+
+interface ErrorEventHandler {
+ (message: string, filename?: string, lineno?: number, colno?: number, error?:Error): void;
+}
+interface PositionCallback {
+ (position: Position): void;
+}
+interface PositionErrorCallback {
+ (error: PositionError): void;
+}
+interface MediaQueryListListener {
+ (mql: MediaQueryList): void;
+}
+interface MSLaunchUriCallback {
+ (): void;
+}
+interface FrameRequestCallback {
+ (time: number): void;
+}
+interface MSUnsafeFunctionCallback {
+ (): any;
+}
+interface MSExecAtPriorityFunctionCallback {
+ (...args: any[]): any;
+}
+interface MutationCallback {
+ (mutations: MutationRecord[], observer: MutationObserver): void;
+}
+interface DecodeSuccessCallback {
+ (decodedData: AudioBuffer): void;
+}
+interface DecodeErrorCallback {
+ (error: DOMException): void;
+}
+interface FunctionStringCallback {
+ (data: string): void;
+}
+interface NavigatorUserMediaSuccessCallback {
+ (stream: MediaStream): void;
+}
+interface NavigatorUserMediaErrorCallback {
+ (error: MediaStreamError): void;
+}
+interface ForEachCallback {
+ (keyId: any, status: string): void;
+}
+declare var Audio: {new(src?: string): HTMLAudioElement; };
+declare var Image: {new(width?: number, height?: number): HTMLImageElement; };
+declare var Option: {new(text?: string, value?: string, defaultSelected?: boolean, selected?: boolean): HTMLOptionElement; };
+declare var applicationCache: ApplicationCache;
+declare var clientInformation: Navigator;
+declare var closed: boolean;
+declare var crypto: Crypto;
+declare var defaultStatus: string;
+declare var devicePixelRatio: number;
+declare var doNotTrack: string;
+declare var document: Document;
+declare var event: Event;
+declare var external: External;
+declare var frameElement: Element;
+declare var frames: Window;
+declare var history: History;
+declare var innerHeight: number;
+declare var innerWidth: number;
+declare var length: number;
+declare var location: Location;
+declare var locationbar: BarProp;
+declare var menubar: BarProp;
+declare var msCredentials: MSCredentials;
+declare const name: never;
+declare var navigator: Navigator;
+declare var offscreenBuffering: string | boolean;
+declare var onabort: (this: Window, ev: UIEvent) => any;
+declare var onafterprint: (this: Window, ev: Event) => any;
+declare var onbeforeprint: (this: Window, ev: Event) => any;
+declare var onbeforeunload: (this: Window, ev: BeforeUnloadEvent) => any;
+declare var onblur: (this: Window, ev: FocusEvent) => any;
+declare var oncanplay: (this: Window, ev: Event) => any;
+declare var oncanplaythrough: (this: Window, ev: Event) => any;
+declare var onchange: (this: Window, ev: Event) => any;
+declare var onclick: (this: Window, ev: MouseEvent) => any;
+declare var oncompassneedscalibration: (this: Window, ev: Event) => any;
+declare var oncontextmenu: (this: Window, ev: PointerEvent) => any;
+declare var ondblclick: (this: Window, ev: MouseEvent) => any;
+declare var ondevicelight: (this: Window, ev: DeviceLightEvent) => any;
+declare var ondevicemotion: (this: Window, ev: DeviceMotionEvent) => any;
+declare var ondeviceorientation: (this: Window, ev: DeviceOrientationEvent) => any;
+declare var ondrag: (this: Window, ev: DragEvent) => any;
+declare var ondragend: (this: Window, ev: DragEvent) => any;
+declare var ondragenter: (this: Window, ev: DragEvent) => any;
+declare var ondragleave: (this: Window, ev: DragEvent) => any;
+declare var ondragover: (this: Window, ev: DragEvent) => any;
+declare var ondragstart: (this: Window, ev: DragEvent) => any;
+declare var ondrop: (this: Window, ev: DragEvent) => any;
+declare var ondurationchange: (this: Window, ev: Event) => any;
+declare var onemptied: (this: Window, ev: Event) => any;
+declare var onended: (this: Window, ev: MediaStreamErrorEvent) => any;
+declare var onerror: ErrorEventHandler;
+declare var onfocus: (this: Window, ev: FocusEvent) => any;
+declare var onhashchange: (this: Window, ev: HashChangeEvent) => any;
+declare var oninput: (this: Window, ev: Event) => any;
+declare var oninvalid: (this: Window, ev: Event) => any;
+declare var onkeydown: (this: Window, ev: KeyboardEvent) => any;
+declare var onkeypress: (this: Window, ev: KeyboardEvent) => any;
+declare var onkeyup: (this: Window, ev: KeyboardEvent) => any;
+declare var onload: (this: Window, ev: Event) => any;
+declare var onloadeddata: (this: Window, ev: Event) => any;
+declare var onloadedmetadata: (this: Window, ev: Event) => any;
+declare var onloadstart: (this: Window, ev: Event) => any;
+declare var onmessage: (this: Window, ev: MessageEvent) => any;
+declare var onmousedown: (this: Window, ev: MouseEvent) => any;
+declare var onmouseenter: (this: Window, ev: MouseEvent) => any;
+declare var onmouseleave: (this: Window, ev: MouseEvent) => any;
+declare var onmousemove: (this: Window, ev: MouseEvent) => any;
+declare var onmouseout: (this: Window, ev: MouseEvent) => any;
+declare var onmouseover: (this: Window, ev: MouseEvent) => any;
+declare var onmouseup: (this: Window, ev: MouseEvent) => any;
+declare var onmousewheel: (this: Window, ev: WheelEvent) => any;
+declare var onmsgesturechange: (this: Window, ev: MSGestureEvent) => any;
+declare var onmsgesturedoubletap: (this: Window, ev: MSGestureEvent) => any;
+declare var onmsgestureend: (this: Window, ev: MSGestureEvent) => any;
+declare var onmsgesturehold: (this: Window, ev: MSGestureEvent) => any;
+declare var onmsgesturestart: (this: Window, ev: MSGestureEvent) => any;
+declare var onmsgesturetap: (this: Window, ev: MSGestureEvent) => any;
+declare var onmsinertiastart: (this: Window, ev: MSGestureEvent) => any;
+declare var onmspointercancel: (this: Window, ev: MSPointerEvent) => any;
+declare var onmspointerdown: (this: Window, ev: MSPointerEvent) => any;
+declare var onmspointerenter: (this: Window, ev: MSPointerEvent) => any;
+declare var onmspointerleave: (this: Window, ev: MSPointerEvent) => any;
+declare var onmspointermove: (this: Window, ev: MSPointerEvent) => any;
+declare var onmspointerout: (this: Window, ev: MSPointerEvent) => any;
+declare var onmspointerover: (this: Window, ev: MSPointerEvent) => any;
+declare var onmspointerup: (this: Window, ev: MSPointerEvent) => any;
+declare var onoffline: (this: Window, ev: Event) => any;
+declare var ononline: (this: Window, ev: Event) => any;
+declare var onorientationchange: (this: Window, ev: Event) => any;
+declare var onpagehide: (this: Window, ev: PageTransitionEvent) => any;
+declare var onpageshow: (this: Window, ev: PageTransitionEvent) => any;
+declare var onpause: (this: Window, ev: Event) => any;
+declare var onplay: (this: Window, ev: Event) => any;
+declare var onplaying: (this: Window, ev: Event) => any;
+declare var onpopstate: (this: Window, ev: PopStateEvent) => any;
+declare var onprogress: (this: Window, ev: ProgressEvent) => any;
+declare var onratechange: (this: Window, ev: Event) => any;
+declare var onreadystatechange: (this: Window, ev: ProgressEvent) => any;
+declare var onreset: (this: Window, ev: Event) => any;
+declare var onresize: (this: Window, ev: UIEvent) => any;
+declare var onscroll: (this: Window, ev: UIEvent) => any;
+declare var onseeked: (this: Window, ev: Event) => any;
+declare var onseeking: (this: Window, ev: Event) => any;
+declare var onselect: (this: Window, ev: UIEvent) => any;
+declare var onstalled: (this: Window, ev: Event) => any;
+declare var onstorage: (this: Window, ev: StorageEvent) => any;
+declare var onsubmit: (this: Window, ev: Event) => any;
+declare var onsuspend: (this: Window, ev: Event) => any;
+declare var ontimeupdate: (this: Window, ev: Event) => any;
+declare var ontouchcancel: (ev: TouchEvent) => any;
+declare var ontouchend: (ev: TouchEvent) => any;
+declare var ontouchmove: (ev: TouchEvent) => any;
+declare var ontouchstart: (ev: TouchEvent) => any;
+declare var onunload: (this: Window, ev: Event) => any;
+declare var onvolumechange: (this: Window, ev: Event) => any;
+declare var onwaiting: (this: Window, ev: Event) => any;
+declare var opener: any;
+declare var orientation: string | number;
+declare var outerHeight: number;
+declare var outerWidth: number;
+declare var pageXOffset: number;
+declare var pageYOffset: number;
+declare var parent: Window;
+declare var performance: Performance;
+declare var personalbar: BarProp;
+declare var screen: Screen;
+declare var screenLeft: number;
+declare var screenTop: number;
+declare var screenX: number;
+declare var screenY: number;
+declare var scrollX: number;
+declare var scrollY: number;
+declare var scrollbars: BarProp;
+declare var self: Window;
+declare var status: string;
+declare var statusbar: BarProp;
+declare var styleMedia: StyleMedia;
+declare var toolbar: BarProp;
+declare var top: Window;
+declare var window: Window;
+declare function alert(message?: any): void;
+declare function blur(): void;
+declare function cancelAnimationFrame(handle: number): void;
+declare function captureEvents(): void;
+declare function close(): void;
+declare function confirm(message?: string): boolean;
+declare function focus(): void;
+declare function getComputedStyle(elt: Element, pseudoElt?: string): CSSStyleDeclaration;
+declare function getMatchedCSSRules(elt: Element, pseudoElt?: string): CSSRuleList;
+declare function getSelection(): Selection;
+declare function matchMedia(mediaQuery: string): MediaQueryList;
+declare function moveBy(x?: number, y?: number): void;
+declare function moveTo(x?: number, y?: number): void;
+declare function msWriteProfilerMark(profilerMarkName: string): void;
+declare function open(url?: string, target?: string, features?: string, replace?: boolean): Window;
+declare function postMessage(message: any, targetOrigin: string, transfer?: any[]): void;
+declare function print(): void;
+declare function prompt(message?: string, _default?: string): string | null;
+declare function releaseEvents(): void;
+declare function requestAnimationFrame(callback: FrameRequestCallback): number;
+declare function resizeBy(x?: number, y?: number): void;
+declare function resizeTo(x?: number, y?: number): void;
+declare function scroll(x?: number, y?: number): void;
+declare function scrollBy(x?: number, y?: number): void;
+declare function scrollTo(x?: number, y?: number): void;
+declare function webkitCancelAnimationFrame(handle: number): void;
+declare function webkitConvertPointFromNodeToPage(node: Node, pt: WebKitPoint): WebKitPoint;
+declare function webkitConvertPointFromPageToNode(node: Node, pt: WebKitPoint): WebKitPoint;
+declare function webkitRequestAnimationFrame(callback: FrameRequestCallback): number;
+declare function scroll(options?: ScrollToOptions): void;
+declare function scrollTo(options?: ScrollToOptions): void;
+declare function scrollBy(options?: ScrollToOptions): void;
+declare function toString(): string;
+declare function addEventListener(type: string, listener?: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+declare function dispatchEvent(evt: Event): boolean;
+declare function removeEventListener(type: string, listener?: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+declare function clearInterval(handle: number): void;
+declare function clearTimeout(handle: number): void;
+declare function setInterval(handler: (...args: any[]) => void, timeout: number): number;
+declare function setInterval(handler: any, timeout?: any, ...args: any[]): number;
+declare function setTimeout(handler: (...args: any[]) => void, timeout: number): number;
+declare function setTimeout(handler: any, timeout?: any, ...args: any[]): number;
+declare function clearImmediate(handle: number): void;
+declare function setImmediate(handler: (...args: any[]) => void): number;
+declare function setImmediate(handler: any, ...args: any[]): number;
+declare var sessionStorage: Storage;
+declare var localStorage: Storage;
+declare var console: Console;
+declare var onpointercancel: (this: Window, ev: PointerEvent) => any;
+declare var onpointerdown: (this: Window, ev: PointerEvent) => any;
+declare var onpointerenter: (this: Window, ev: PointerEvent) => any;
+declare var onpointerleave: (this: Window, ev: PointerEvent) => any;
+declare var onpointermove: (this: Window, ev: PointerEvent) => any;
+declare var onpointerout: (this: Window, ev: PointerEvent) => any;
+declare var onpointerover: (this: Window, ev: PointerEvent) => any;
+declare var onpointerup: (this: Window, ev: PointerEvent) => any;
+declare var onwheel: (this: Window, ev: WheelEvent) => any;
+declare var indexedDB: IDBFactory;
+declare function atob(encodedString: string): string;
+declare function btoa(rawString: string): string;
+declare function addEventListener(type: "MSGestureChange", listener: (this: Window, ev: MSGestureEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "MSGestureDoubleTap", listener: (this: Window, ev: MSGestureEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "MSGestureEnd", listener: (this: Window, ev: MSGestureEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "MSGestureHold", listener: (this: Window, ev: MSGestureEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "MSGestureStart", listener: (this: Window, ev: MSGestureEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "MSGestureTap", listener: (this: Window, ev: MSGestureEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "MSInertiaStart", listener: (this: Window, ev: MSGestureEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "MSPointerCancel", listener: (this: Window, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "MSPointerDown", listener: (this: Window, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "MSPointerEnter", listener: (this: Window, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "MSPointerLeave", listener: (this: Window, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "MSPointerMove", listener: (this: Window, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "MSPointerOut", listener: (this: Window, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "MSPointerOver", listener: (this: Window, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "MSPointerUp", listener: (this: Window, ev: MSPointerEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "abort", listener: (this: Window, ev: UIEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "afterprint", listener: (this: Window, ev: Event) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "beforeprint", listener: (this: Window, ev: Event) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "beforeunload", listener: (this: Window, ev: BeforeUnloadEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "blur", listener: (this: Window, ev: FocusEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "canplay", listener: (this: Window, ev: Event) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "canplaythrough", listener: (this: Window, ev: Event) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "change", listener: (this: Window, ev: Event) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "click", listener: (this: Window, ev: MouseEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "compassneedscalibration", listener: (this: Window, ev: Event) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "contextmenu", listener: (this: Window, ev: PointerEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "dblclick", listener: (this: Window, ev: MouseEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "devicelight", listener: (this: Window, ev: DeviceLightEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "devicemotion", listener: (this: Window, ev: DeviceMotionEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "deviceorientation", listener: (this: Window, ev: DeviceOrientationEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "drag", listener: (this: Window, ev: DragEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "dragend", listener: (this: Window, ev: DragEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "dragenter", listener: (this: Window, ev: DragEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "dragleave", listener: (this: Window, ev: DragEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "dragover", listener: (this: Window, ev: DragEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "dragstart", listener: (this: Window, ev: DragEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "drop", listener: (this: Window, ev: DragEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "durationchange", listener: (this: Window, ev: Event) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "emptied", listener: (this: Window, ev: Event) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "ended", listener: (this: Window, ev: MediaStreamErrorEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "focus", listener: (this: Window, ev: FocusEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "hashchange", listener: (this: Window, ev: HashChangeEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "input", listener: (this: Window, ev: Event) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "invalid", listener: (this: Window, ev: Event) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "keydown", listener: (this: Window, ev: KeyboardEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "keypress", listener: (this: Window, ev: KeyboardEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "keyup", listener: (this: Window, ev: KeyboardEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "load", listener: (this: Window, ev: Event) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "loadeddata", listener: (this: Window, ev: Event) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "loadedmetadata", listener: (this: Window, ev: Event) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "loadstart", listener: (this: Window, ev: Event) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "message", listener: (this: Window, ev: MessageEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "mousedown", listener: (this: Window, ev: MouseEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "mouseenter", listener: (this: Window, ev: MouseEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "mouseleave", listener: (this: Window, ev: MouseEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "mousemove", listener: (this: Window, ev: MouseEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "mouseout", listener: (this: Window, ev: MouseEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "mouseover", listener: (this: Window, ev: MouseEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "mouseup", listener: (this: Window, ev: MouseEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "mousewheel", listener: (this: Window, ev: WheelEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "offline", listener: (this: Window, ev: Event) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "online", listener: (this: Window, ev: Event) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "orientationchange", listener: (this: Window, ev: Event) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "pagehide", listener: (this: Window, ev: PageTransitionEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "pageshow", listener: (this: Window, ev: PageTransitionEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "pause", listener: (this: Window, ev: Event) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "play", listener: (this: Window, ev: Event) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "playing", listener: (this: Window, ev: Event) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "pointercancel", listener: (this: Window, ev: PointerEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "pointerdown", listener: (this: Window, ev: PointerEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "pointerenter", listener: (this: Window, ev: PointerEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "pointerleave", listener: (this: Window, ev: PointerEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "pointermove", listener: (this: Window, ev: PointerEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "pointerout", listener: (this: Window, ev: PointerEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "pointerover", listener: (this: Window, ev: PointerEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "pointerup", listener: (this: Window, ev: PointerEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "popstate", listener: (this: Window, ev: PopStateEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "progress", listener: (this: Window, ev: ProgressEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "ratechange", listener: (this: Window, ev: Event) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "readystatechange", listener: (this: Window, ev: ProgressEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "reset", listener: (this: Window, ev: Event) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "resize", listener: (this: Window, ev: UIEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "scroll", listener: (this: Window, ev: UIEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "seeked", listener: (this: Window, ev: Event) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "seeking", listener: (this: Window, ev: Event) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "select", listener: (this: Window, ev: UIEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "stalled", listener: (this: Window, ev: Event) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "storage", listener: (this: Window, ev: StorageEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "submit", listener: (this: Window, ev: Event) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "suspend", listener: (this: Window, ev: Event) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "timeupdate", listener: (this: Window, ev: Event) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "unload", listener: (this: Window, ev: Event) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "volumechange", listener: (this: Window, ev: Event) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "waiting", listener: (this: Window, ev: Event) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "wheel", listener: (this: Window, ev: WheelEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+type AAGUID = string;
+type AlgorithmIdentifier = string | Algorithm;
+type ConstrainBoolean = boolean | ConstrainBooleanParameters;
+type ConstrainDOMString = string | string[] | ConstrainDOMStringParameters;
+type ConstrainDouble = number | ConstrainDoubleRange;
+type ConstrainLong = number | ConstrainLongRange;
+type CryptoOperationData = ArrayBufferView;
+type GLbitfield = number;
+type GLboolean = boolean;
+type GLbyte = number;
+type GLclampf = number;
+type GLenum = number;
+type GLfloat = number;
+type GLint = number;
+type GLintptr = number;
+type GLshort = number;
+type GLsizei = number;
+type GLsizeiptr = number;
+type GLubyte = number;
+type GLuint = number;
+type GLushort = number;
+type IDBKeyPath = string;
+type KeyFormat = string;
+type KeyType = string;
+type KeyUsage = string;
+type MSInboundPayload = MSVideoRecvPayload | MSAudioRecvPayload;
+type MSLocalClientEvent = MSLocalClientEventBase | MSAudioLocalClientEvent;
+type MSOutboundPayload = MSVideoSendPayload | MSAudioSendPayload;
+type RTCIceGatherCandidate = RTCIceCandidate | RTCIceCandidateComplete;
+type RTCTransport = RTCDtlsTransport | RTCSrtpSdesTransport;
+type payloadtype = number;
+type ScrollBehavior = "auto" | "instant" | "smooth";
+type ScrollLogicalPosition = "start" | "center" | "end" | "nearest";
+type IDBValidKey = number | string | Date | IDBArrayKey;
+type BufferSource = ArrayBuffer | ArrayBufferView;
+type MouseWheelEvent = WheelEvent;
+/////////////////////////////
+/// WorkerGlobalScope APIs
+/////////////////////////////
+// These are only available in a Web Worker
+declare function importScripts(...urls: string[]): void;
+
+
+/////////////////////////////
+/// Windows Script Host APIS
+/////////////////////////////
+
+
+interface ActiveXObject {
+ new (s: string): any;
+}
+declare var ActiveXObject: ActiveXObject;
+
+interface ITextWriter {
+ Write(s: string): void;
+ WriteLine(s: string): void;
+ Close(): void;
+}
+
+interface TextStreamBase {
+ /**
+ * The column number of the current character position in an input stream.
+ */
+ Column: number;
+
+ /**
+ * The current line number in an input stream.
+ */
+ Line: number;
+
+ /**
+ * Closes a text stream.
+ * It is not necessary to close standard streams; they close automatically when the process ends. If
+ * you close a standard stream, be aware that any other pointers to that standard stream become invalid.
+ */
+ Close(): void;
+}
+
+interface TextStreamWriter extends TextStreamBase {
+ /**
+ * Sends a string to an output stream.
+ */
+ Write(s: string): void;
+
+ /**
+ * Sends a specified number of blank lines (newline characters) to an output stream.
+ */
+ WriteBlankLines(intLines: number): void;
+
+ /**
+ * Sends a string followed by a newline character to an output stream.
+ */
+ WriteLine(s: string): void;
+}
+
+interface TextStreamReader extends TextStreamBase {
+ /**
+ * Returns a specified number of characters from an input stream, starting at the current pointer position.
+ * Does not return until the ENTER key is pressed.
+ * Can only be used on a stream in reading mode; causes an error in writing or appending mode.
+ */
+ Read(characters: number): string;
+
+ /**
+ * Returns all characters from an input stream.
+ * Can only be used on a stream in reading mode; causes an error in writing or appending mode.
+ */
+ ReadAll(): string;
+
+ /**
+ * Returns an entire line from an input stream.
+ * Although this method extracts the newline character, it does not add it to the returned string.
+ * Can only be used on a stream in reading mode; causes an error in writing or appending mode.
+ */
+ ReadLine(): string;
+
+ /**
+ * Skips a specified number of characters when reading from an input text stream.
+ * Can only be used on a stream in reading mode; causes an error in writing or appending mode.
+ * @param characters Positive number of characters to skip forward. (Backward skipping is not supported.)
+ */
+ Skip(characters: number): void;
+
+ /**
+ * Skips the next line when reading from an input text stream.
+ * Can only be used on a stream in reading mode, not writing or appending mode.
+ */
+ SkipLine(): void;
+
+ /**
+ * Indicates whether the stream pointer position is at the end of a line.
+ */
+ AtEndOfLine: boolean;
+
+ /**
+ * Indicates whether the stream pointer position is at the end of a stream.
+ */
+ AtEndOfStream: boolean;
+}
+
+declare var WScript: {
+ /**
+ * Outputs text to either a message box (under WScript.exe) or the command console window followed by
+ * a newline (under CScript.exe).
+ */
+ Echo(s: any): void;
+
+ /**
+ * Exposes the write-only error output stream for the current script.
+ * Can be accessed only while using CScript.exe.
+ */
+ StdErr: TextStreamWriter;
+
+ /**
+ * Exposes the write-only output stream for the current script.
+ * Can be accessed only while using CScript.exe.
+ */
+ StdOut: TextStreamWriter;
+ Arguments: { length: number; Item(n: number): string; };
+
+ /**
+ * The full path of the currently running script.
+ */
+ ScriptFullName: string;
+
+ /**
+ * Forces the script to stop immediately, with an optional exit code.
+ */
+ Quit(exitCode?: number): number;
+
+ /**
+ * The Windows Script Host build version number.
+ */
+ BuildVersion: number;
+
+ /**
+ * Fully qualified path of the host executable.
+ */
+ FullName: string;
+
+ /**
+ * Gets/sets the script mode - interactive(true) or batch(false).
+ */
+ Interactive: boolean;
+
+ /**
+ * The name of the host executable (WScript.exe or CScript.exe).
+ */
+ Name: string;
+
+ /**
+ * Path of the directory containing the host executable.
+ */
+ Path: string;
+
+ /**
+ * The filename of the currently running script.
+ */
+ ScriptName: string;
+
+ /**
+ * Exposes the read-only input stream for the current script.
+ * Can be accessed only while using CScript.exe.
+ */
+ StdIn: TextStreamReader;
+
+ /**
+ * Windows Script Host version
+ */
+ Version: string;
+
+ /**
+ * Connects a COM object's event sources to functions named with a given prefix, in the form prefix_event.
+ */
+ ConnectObject(objEventSource: any, strPrefix: string): void;
+
+ /**
+ * Creates a COM object.
+ * @param strProgiID
+ * @param strPrefix Function names in the form prefix_event will be bound to this object's COM events.
+ */
+ CreateObject(strProgID: string, strPrefix?: string): any;
+
+ /**
+ * Disconnects a COM object from its event sources.
+ */
+ DisconnectObject(obj: any): void;
+
+ /**
+ * Retrieves an existing object with the specified ProgID from memory, or creates a new one from a file.
+ * @param strPathname Fully qualified path to the file containing the object persisted to disk.
+ * For objects in memory, pass a zero-length string.
+ * @param strProgID
+ * @param strPrefix Function names in the form prefix_event will be bound to this object's COM events.
+ */
+ GetObject(strPathname: string, strProgID?: string, strPrefix?: string): any;
+
+ /**
+ * Suspends script execution for a specified length of time, then continues execution.
+ * @param intTime Interval (in milliseconds) to suspend script execution.
+ */
+ Sleep(intTime: number): void;
+};
+
+/**
+ * Allows enumerating over a COM collection, which may not have indexed item access.
+ */
+interface Enumerator<T> {
+ /**
+ * Returns true if the current item is the last one in the collection, or the collection is empty,
+ * or the current item is undefined.
+ */
+ atEnd(): boolean;
+
+ /**
+ * Returns the current item in the collection
+ */
+ item(): T;
+
+ /**
+ * Resets the current item in the collection to the first item. If there are no items in the collection,
+ * the current item is set to undefined.
+ */
+ moveFirst(): void;
+
+ /**
+ * Moves the current item to the next item in the collection. If the enumerator is at the end of
+ * the collection or the collection is empty, the current item is set to undefined.
+ */
+ moveNext(): void;
+}
+
+interface EnumeratorConstructor {
+ new <T>(collection: any): Enumerator<T>;
+ new (collection: any): Enumerator<any>;
+}
+
+declare var Enumerator: EnumeratorConstructor;
+
+/**
+ * Enables reading from a COM safe array, which might have an alternate lower bound, or multiple dimensions.
+ */
+interface VBArray<T> {
+ /**
+ * Returns the number of dimensions (1-based).
+ */
+ dimensions(): number;
+
+ /**
+ * Takes an index for each dimension in the array, and returns the item at the corresponding location.
+ */
+ getItem(dimension1Index: number, ...dimensionNIndexes: number[]): T;
+
+ /**
+ * Returns the smallest available index for a given dimension.
+ * @param dimension 1-based dimension (defaults to 1)
+ */
+ lbound(dimension?: number): number;
+
+ /**
+ * Returns the largest available index for a given dimension.
+ * @param dimension 1-based dimension (defaults to 1)
+ */
+ ubound(dimension?: number): number;
+
+ /**
+ * Returns a Javascript array with all the elements in the VBArray. If there are multiple dimensions,
+ * each successive dimension is appended to the end of the array.
+ * Example: [[1,2,3],[4,5,6]] becomes [1,2,3,4,5,6]
+ */
+ toArray(): T[];
+}
+
+interface VBArrayConstructor {
+ new <T>(safeArray: any): VBArray<T>;
+ new (safeArray: any): VBArray<any>;
+}
+
+declare var VBArray: VBArrayConstructor;
+
+/**
+ * Automation date (VT_DATE)
+ */
+interface VarDate { }
+
+interface DateConstructor {
+ new (vd: VarDate): Date;
+}
+
+interface Date {
+ getVarDate: () => VarDate;
+}
+/// <reference path="lib.dom.generated.d.ts" />
+
+interface DOMTokenList {
+ [Symbol.iterator](): IterableIterator<string>;
+}
+
+interface NodeList {
+ [Symbol.iterator](): IterableIterator<Node>
+}
+
+interface NodeListOf<TNode extends Node> {
+ [Symbol.iterator](): IterableIterator<TNode>
+}
diff --git a/lib/decl/lodash.d.ts b/lib/decl/lodash.d.ts
new file mode 100644
index 000000000..f9249d16b
--- /dev/null
+++ b/lib/decl/lodash.d.ts
@@ -0,0 +1,16525 @@
+// Type definitions for Lo-Dash
+// Project: http://lodash.com/
+// Definitions by: Brian Zengel <https://github.com/bczengel>, Ilya Mochalov <https://github.com/chrootsu>
+// Definitions: https://github.com/borisyankov/DefinitelyTyped
+
+
+/**
+### 4.0.0 Changelog (https://github.com/lodash/lodash/wiki/Changelog)
+
+#### TODO:
+removed:
+- [x] Removed _.support
+- [x] Removed _.findWhere in favor of _.find with iteratee shorthand
+- [x] Removed _.where in favor of _.filter with iteratee shorthand
+- [x] Removed _.pluck in favor of _.map with iteratee shorthand
+
+renamed:
+- [x] Renamed _.first to _.head
+- [x] Renamed _.indexBy to _.keyBy
+- [x] Renamed _.invoke to _.invokeMap
+- [x] Renamed _.overArgs to _.overArgs
+- [x] Renamed _.padLeft & _.padRight to _.padStart & _.padEnd
+- [x] Renamed _.pairs to _.toPairs
+- [x] Renamed _.rest to _.tail
+- [x] Renamed _.restParam to _.rest
+- [x] Renamed _.sortByOrder to _.orderBy
+- [x] Renamed _.trimLeft & _.trimRight to _.trimStart & _.trimEnd
+- [x] Renamed _.trunc to _.truncate
+
+split:
+- [x] Split _.indexOf & _.lastIndexOf into _.sortedIndexOf & _.sortedLastIndexOf
+- [x] Split _.max & _.min into _.maxBy & _.minBy
+- [x] Split _.omit & _.pick into _.omitBy & _.pickBy
+- [x] Split _.sample into _.sampleSize
+- [x] Split _.sortedIndex into _.sortedIndexBy
+- [x] Split _.sortedLastIndex into _.sortedLastIndexBy
+- [x] Split _.uniq into _.sortedUniq, _.sortedUniqBy, & _.uniqBy
+
+changes:
+- [x] Absorbed _.sortByAll into _.sortBy
+- [x] Changed the category of _.at to “Object”
+- [x] Changed the category of _.bindAll to “Utility”
+- [x] Made _.capitalize uppercase the first character & lowercase the rest
+- [x] Made _.functions return only own method names
+
+
+added 23 array methods:
+- [x] _.concat
+- [x] _.differenceBy
+- [x] _.differenceWith
+- [x] _.flatMap
+- [x] _.fromPairs
+- [x] _.intersectionBy
+- [x] _.intersectionWith
+- [x] _.join
+- [x] _.pullAll
+- [x] _.pullAllBy
+- [x] _.reverse
+- [x] _.sortedIndexBy
+- [x] _.sortedIndexOf
+- [x] _.sortedLastIndexBy
+- [x] _.sortedLastIndexOf
+- [x] _.sortedUniq
+- [x] _.sortedUniqBy
+- [x] _.unionBy
+- [x] _.unionWith
+- [x] _.uniqBy
+- [x] _.uniqWith
+- [x] _.xorBy
+- [x] _.xorWith
+
+added 18 lang methods:
+- [x] _.cloneDeepWith
+- [x] _.cloneWith
+- [x] _.eq
+- [x] _.isArrayLike
+- [x] _.isArrayLikeObject
+- [x] _.isEqualWith
+- [x] _.isInteger
+- [x] _.isLength
+- [x] _.isMatchWith
+- [x] _.isNil
+- [x] _.isObjectLike
+- [x] _.isSafeInteger
+- [x] _.isSymbol
+- [x] _.toInteger
+- [x] _.toLength
+- [x] _.toNumber
+- [x] _.toSafeInteger
+- [x] _.toString
+
+added 13 object methods:
+- [x] _.assignIn
+- [x] _.assignInWith
+- [x] _.assignWith
+- [x] _.functionsIn
+- [x] _.hasIn
+- [x] _.mergeWith
+- [x] _.omitBy
+- [x] _.pickBy
+
+
+added 8 string methods:
+- [x] _.lowerCase
+- [x] _.lowerFirst
+- [x] _.upperCase
+- [x] _.upperFirst
+- [x] _.toLower
+- [x] _.toUpper
+
+added 8 utility methods:
+- [x] _.toPath
+
+added 4 math methods:
+- [x] _.maxBy
+- [x] _.mean
+- [x] _.minBy
+- [x] _.sumBy
+
+added 2 function methods:
+- [x] _.flip
+- [x] _.unary
+
+added 2 number methods:
+- [x] _.clamp
+- [x] _.subtract
+
+added collection method:
+- [x] _.sampleSize
+
+Added 3 aliases
+
+- [x] _.first as an alias of _.head
+
+Removed 17 aliases
+- [x] Removed aliase _.all
+- [x] Removed aliase _.any
+- [x] Removed aliase _.backflow
+- [x] Removed aliase _.callback
+- [x] Removed aliase _.collect
+- [x] Removed aliase _.compose
+- [x] Removed aliase _.contains
+- [x] Removed aliase _.detect
+- [x] Removed aliase _.foldl
+- [x] Removed aliase _.foldr
+- [x] Removed aliase _.include
+- [x] Removed aliase _.inject
+- [x] Removed aliase _.methods
+- [x] Removed aliase _.object
+- [x] Removed aliase _.run
+- [x] Removed aliase _.select
+- [x] Removed aliase _.unique
+
+Other changes
+- [x] Added support for array buffers to _.isEqual
+- [x] Added support for converting iterators to _.toArray
+- [x] Added support for deep paths to _.zipObject
+- [x] Changed UMD to export to window or self when available regardless of other exports
+- [x] Ensured debounce cancel clears args & thisArg references
+- [x] Ensured _.add, _.subtract, & _.sum don’t skip NaN values
+- [x] Ensured _.clone treats generators like functions
+- [x] Ensured _.clone produces clones with the source’s [[Prototype]]
+- [x] Ensured _.defaults assigns properties that shadow Object.prototype
+- [x] Ensured _.defaultsDeep doesn’t merge a string into an array
+- [x] Ensured _.defaultsDeep & _.merge don’t modify sources
+- [x] Ensured _.defaultsDeep works with circular references
+- [x] Ensured _.keys skips “length” on strict mode arguments objects in Safari 9
+- [x] Ensured _.merge doesn’t convert strings to arrays
+- [x] Ensured _.merge merges plain-objects onto non plain-objects
+- [x] Ensured _#plant resets iterator data of cloned sequences
+- [x] Ensured _.random swaps min & max if min is greater than max
+- [x] Ensured _.range preserves the sign of start of -0
+- [x] Ensured _.reduce & _.reduceRight use getIteratee in their array branch
+- [x] Fixed rounding issue with the precision param of _.floor
+
+** LATER **
+Misc:
+- [ ] Made _.forEach, _.forIn, _.forOwn, & _.times implicitly end a chain sequence
+- [ ] Removed thisArg params from most methods
+- [ ] Made “By” methods provide a single param to iteratees
+- [ ] Made _.words chainable by default
+- [ ] Removed isDeep params from _.clone & _.flatten
+- [ ] Removed _.bindAll support for binding all methods when no names are provided
+- [ ] Removed func-first param signature from _.before & _.after
+- [ ] _.extend as an alias of _.assignIn
+- [ ] _.extendWith as an alias of _.assignInWith
+- [ ] Added clear method to _.memoize.Cache
+- [ ] Added flush method to debounced & throttled functions
+- [ ] Added support for ES6 maps, sets, & symbols to _.clone, _.isEqual, & _.toArray
+- [ ] Enabled _.flow & _.flowRight to accept an array of functions
+- [ ] Ensured “Collection” methods treat functions as objects
+- [ ] Ensured _.assign, _.defaults, & _.merge coerce object values to objects
+- [ ] Ensured _.bindKey bound functions call object[key] when called with the new operator
+- [ ] Ensured _.isFunction returns true for generator functions
+- [ ] Ensured _.merge assigns typed arrays directly
+- [ ] Made _(...) an iterator & iterable
+- [ ] Made _.drop, _.take, & right forms coerce n of undefined to 0
+
+Methods:
+- [ ] _.concat
+- [ ] _.differenceBy
+- [ ] _.differenceWith
+- [ ] _.flatMap
+- [ ] _.fromPairs
+- [ ] _.intersectionBy
+- [ ] _.intersectionWith
+- [ ] _.join
+- [ ] _.pullAll
+- [ ] _.pullAllBy
+- [ ] _.reverse
+- [ ] _.sortedLastIndexOf
+- [ ] _.unionBy
+- [ ] _.unionWith
+- [ ] _.uniqWith
+- [ ] _.xorBy
+- [ ] _.xorWith
+- [ ] _.toString
+
+- [ ] _.invoke
+- [ ] _.setWith
+- [ ] _.toPairs
+- [ ] _.toPairsIn
+- [ ] _.unset
+
+- [ ] _.replace
+- [ ] _.split
+
+- [ ] _.cond
+- [ ] _.conforms
+- [ ] _.nthArg
+- [ ] _.over
+- [ ] _.overEvery
+- [ ] _.overSome
+- [ ] _.rangeRight
+
+- [ ] _.next
+*/
+
+declare var _: _.LoDashStatic;
+
+declare module _ {
+ interface LoDashStatic {
+ /**
+ * Creates a lodash object which wraps the given value to enable intuitive method chaining.
+ *
+ * In addition to Lo-Dash methods, wrappers also have the following Array methods:
+ * concat, join, pop, push, reverse, shift, slice, sort, splice, and unshift
+ *
+ * Chaining is supported in custom builds as long as the value method is implicitly or
+ * explicitly included in the build.
+ *
+ * The chainable wrapper functions are:
+ * after, assign, bind, bindAll, bindKey, chain, chunk, compact, compose, concat, countBy,
+ * createCallback, curry, debounce, defaults, defer, delay, difference, filter, flatten,
+ * forEach, forEachRight, forIn, forInRight, forOwn, forOwnRight, functions, groupBy,
+ * keyBy, initial, intersection, invert, invoke, keys, map, max, memoize, merge, min,
+ * object, omit, once, pairs, partial, partialRight, pick, pluck, pull, push, range, reject,
+ * remove, rest, reverse, sample, shuffle, slice, sort, sortBy, splice, tap, throttle, times,
+ * toArray, transform, union, uniq, unshift, unzip, values, where, without, wrap, and zip
+ *
+ * The non-chainable wrapper functions are:
+ * clone, cloneDeep, contains, escape, every, find, findIndex, findKey, findLast,
+ * findLastIndex, findLastKey, has, identity, indexOf, isArguments, isArray, isBoolean,
+ * isDate, isElement, isEmpty, isEqual, isFinite, isFunction, isNaN, isNull, isNumber,
+ * isObject, isPlainObject, isRegExp, isString, isUndefined, join, lastIndexOf, mixin,
+ * noConflict, parseInt, pop, random, reduce, reduceRight, result, shift, size, some,
+ * sortedIndex, runInContext, template, unescape, uniqueId, and value
+ *
+ * The wrapper functions first and last return wrapped values when n is provided, otherwise
+ * they return unwrapped values.
+ *
+ * Explicit chaining can be enabled by using the _.chain method.
+ **/
+ (value: number): LoDashImplicitWrapper<number>;
+ (value: string): LoDashImplicitStringWrapper;
+ (value: boolean): LoDashImplicitWrapper<boolean>;
+ (value: Array<number>): LoDashImplicitNumberArrayWrapper;
+ <T>(value: Array<T>): LoDashImplicitArrayWrapper<T>;
+ <T extends {}>(value: T): LoDashImplicitObjectWrapper<T>;
+ (value: any): LoDashImplicitWrapper<any>;
+
+ /**
+ * The semantic version number.
+ **/
+ VERSION: string;
+
+ /**
+ * By default, the template delimiters used by Lo-Dash are similar to those in embedded Ruby
+ * (ERB). Change the following template settings to use alternative delimiters.
+ **/
+ templateSettings: TemplateSettings;
+ }
+
+ /**
+ * By default, the template delimiters used by Lo-Dash are similar to those in embedded Ruby
+ * (ERB). Change the following template settings to use alternative delimiters.
+ **/
+ interface TemplateSettings {
+ /**
+ * The "escape" delimiter.
+ **/
+ escape?: RegExp;
+
+ /**
+ * The "evaluate" delimiter.
+ **/
+ evaluate?: RegExp;
+
+ /**
+ * An object to import into the template as local variables.
+ **/
+ imports?: Dictionary<any>;
+
+ /**
+ * The "interpolate" delimiter.
+ **/
+ interpolate?: RegExp;
+
+ /**
+ * Used to reference the data object in the template text.
+ **/
+ variable?: string;
+ }
+
+ /**
+ * Creates a cache object to store key/value pairs.
+ */
+ interface MapCache {
+ /**
+ * Removes `key` and its value from the cache.
+ * @param key The key of the value to remove.
+ * @return Returns `true` if the entry was removed successfully, else `false`.
+ */
+ delete(key: string): boolean;
+
+ /**
+ * Gets the cached value for `key`.
+ * @param key The key of the value to get.
+ * @return Returns the cached value.
+ */
+ get(key: string): any;
+
+ /**
+ * Checks if a cached value for `key` exists.
+ * @param key The key of the entry to check.
+ * @return Returns `true` if an entry for `key` exists, else `false`.
+ */
+ has(key: string): boolean;
+
+ /**
+ * Sets `value` to `key` of the cache.
+ * @param key The key of the value to cache.
+ * @param value The value to cache.
+ * @return Returns the cache object.
+ */
+ set(key: string, value: any): _.Dictionary<any>;
+ }
+
+ interface LoDashWrapperBase<T, TWrapper> { }
+
+ interface LoDashImplicitWrapperBase<T, TWrapper> extends LoDashWrapperBase<T, TWrapper> { }
+
+ interface LoDashExplicitWrapperBase<T, TWrapper> extends LoDashWrapperBase<T, TWrapper> { }
+
+ interface LoDashImplicitWrapper<T> extends LoDashImplicitWrapperBase<T, LoDashImplicitWrapper<T>> { }
+
+ interface LoDashExplicitWrapper<T> extends LoDashExplicitWrapperBase<T, LoDashExplicitWrapper<T>> { }
+
+ interface LoDashImplicitStringWrapper extends LoDashImplicitWrapper<string> { }
+
+ interface LoDashExplicitStringWrapper extends LoDashExplicitWrapper<string> { }
+
+ interface LoDashImplicitObjectWrapper<T> extends LoDashImplicitWrapperBase<T, LoDashImplicitObjectWrapper<T>> { }
+
+ interface LoDashExplicitObjectWrapper<T> extends LoDashExplicitWrapperBase<T, LoDashExplicitObjectWrapper<T>> { }
+
+ interface LoDashImplicitArrayWrapper<T> extends LoDashImplicitWrapperBase<T[], LoDashImplicitArrayWrapper<T>> {
+ join(seperator?: string): string;
+ pop(): T;
+ push(...items: T[]): LoDashImplicitArrayWrapper<T>;
+ shift(): T;
+ sort(compareFn?: (a: T, b: T) => number): LoDashImplicitArrayWrapper<T>;
+ splice(start: number): LoDashImplicitArrayWrapper<T>;
+ splice(start: number, deleteCount: number, ...items: any[]): LoDashImplicitArrayWrapper<T>;
+ unshift(...items: T[]): LoDashImplicitArrayWrapper<T>;
+ }
+
+ interface LoDashExplicitArrayWrapper<T> extends LoDashExplicitWrapperBase<T[], LoDashExplicitArrayWrapper<T>> { }
+
+ interface LoDashImplicitNumberArrayWrapper extends LoDashImplicitArrayWrapper<number> { }
+
+ interface LoDashExplicitNumberArrayWrapper extends LoDashExplicitArrayWrapper<number> { }
+
+ /*********
+ * Array *
+ *********/
+
+ //_.chunk
+ interface LoDashStatic {
+ /**
+ * Creates an array of elements split into groups the length of size. If collection can’t be split evenly, the
+ * final chunk will be the remaining elements.
+ *
+ * @param array The array to process.
+ * @param size The length of each chunk.
+ * @return Returns the new array containing chunks.
+ */
+ chunk<T>(
+ array: List<T>,
+ size?: number
+ ): T[][];
+ }
+
+ interface LoDashImplicitArrayWrapper<T> {
+ /**
+ * @see _.chunk
+ */
+ chunk(size?: number): LoDashImplicitArrayWrapper<T[]>;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.chunk
+ */
+ chunk<TResult>(size?: number): LoDashImplicitArrayWrapper<TResult[]>;
+ }
+
+ interface LoDashExplicitArrayWrapper<T> {
+ /**
+ * @see _.chunk
+ */
+ chunk(size?: number): LoDashExplicitArrayWrapper<T[]>;
+ }
+
+ interface LoDashExplicitObjectWrapper<T> {
+ /**
+ * @see _.chunk
+ */
+ chunk<TResult>(size?: number): LoDashExplicitArrayWrapper<TResult[]>;
+ }
+
+ //_.compact
+ interface LoDashStatic {
+ /**
+ * Creates an array with all falsey values removed. The values false, null, 0, "", undefined, and NaN are
+ * falsey.
+ *
+ * @param array The array to compact.
+ * @return (Array) Returns the new array of filtered values.
+ */
+ compact<T>(array?: List<T>): T[];
+ }
+
+ interface LoDashImplicitArrayWrapper<T> {
+ /**
+ * @see _.compact
+ */
+ compact(): LoDashImplicitArrayWrapper<T>;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.compact
+ */
+ compact<TResult>(): LoDashImplicitArrayWrapper<TResult>;
+ }
+
+ interface LoDashExplicitArrayWrapper<T> {
+ /**
+ * @see _.compact
+ */
+ compact(): LoDashExplicitArrayWrapper<T>;
+ }
+
+ interface LoDashExplicitObjectWrapper<T> {
+ /**
+ * @see _.compact
+ */
+ compact<TResult>(): LoDashExplicitArrayWrapper<TResult>;
+ }
+
+ //_.concat DUMMY
+ interface LoDashStatic {
+ /**
+ * Creates a new array concatenating `array` with any additional arrays
+ * and/or values.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} array The array to concatenate.
+ * @param {...*} [values] The values to concatenate.
+ * @returns {Array} Returns the new concatenated array.
+ * @example
+ *
+ * var array = [1];
+ * var other = _.concat(array, 2, [3], [[4]]);
+ *
+ * console.log(other);
+ * // => [1, 2, 3, [4]]
+ *
+ * console.log(array);
+ * // => [1]
+ */
+ concat<T>(...values: (T[]|List<T>)[]) : T[];
+ }
+
+ //_.difference
+ interface LoDashStatic {
+ /**
+ * Creates an array of unique array values not included in the other provided arrays using SameValueZero for
+ * equality comparisons.
+ *
+ * @param array The array to inspect.
+ * @param values The arrays of values to exclude.
+ * @return Returns the new array of filtered values.
+ */
+ difference<T>(
+ array: any[]|List<any>,
+ ...values: any[]
+ ): T[];
+ }
+
+ interface LoDashImplicitArrayWrapper<T> {
+ /**
+ * @see _.difference
+ */
+ difference(...values: (T[]|List<T>)[]): LoDashImplicitArrayWrapper<T>;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.difference
+ */
+ difference<TValue>(...values: (TValue[]|List<TValue>)[]): LoDashImplicitArrayWrapper<TValue>;
+ }
+
+ interface LoDashExplicitArrayWrapper<T> {
+ /**
+ * @see _.difference
+ */
+ difference(...values: (T[]|List<T>)[]): LoDashExplicitArrayWrapper<T>;
+ }
+
+ interface LoDashExplicitObjectWrapper<T> {
+ /**
+ * @see _.difference
+ */
+ difference<TValue>(...values: (TValue[]|List<TValue>)[]): LoDashExplicitArrayWrapper<TValue>;
+ }
+
+ //_.differenceBy DUMMY
+ interface LoDashStatic {
+ /**
+ * Creates an array of unique `array` values not included in the other
+ * provided arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
+ * for equality comparisons.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} array The array to inspect.
+ * @param {...Array} [values] The values to exclude.
+ * @returns {Array} Returns the new array of filtered values.
+ * @example
+ *
+ * _.difference([3, 2, 1], [4, 2]);
+ * // => [3, 1]
+ */
+ differenceBy(
+ array: any[]|List<any>,
+ ...values: any[]
+ ): any[];
+ }
+
+ //_.differenceWith DUMMY
+ interface LoDashStatic {
+ /**
+ * Creates an array of unique `array` values not included in the other
+ * provided arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
+ * for equality comparisons.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} array The array to inspect.
+ * @param {...Array} [values] The values to exclude.
+ * @returns {Array} Returns the new array of filtered values.
+ * @example
+ *
+ * _.difference([3, 2, 1], [4, 2]);
+ * // => [3, 1]
+ */
+ differenceWith(
+ array: any[]|List<any>,
+ ...values: any[]
+ ): any[];
+ }
+
+ //_.drop
+ interface LoDashStatic {
+ /**
+ * Creates a slice of array with n elements dropped from the beginning.
+ *
+ * @param array The array to query.
+ * @param n The number of elements to drop.
+ * @return Returns the slice of array.
+ */
+ drop<T>(array: T[]|List<T>, n?: number): T[];
+ }
+
+ interface LoDashImplicitArrayWrapper<T> {
+ /**
+ * @see _.drop
+ */
+ drop(n?: number): LoDashImplicitArrayWrapper<T>;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.drop
+ */
+ drop<T>(n?: number): LoDashImplicitArrayWrapper<T>;
+ }
+
+ interface LoDashExplicitArrayWrapper<T> {
+ /**
+ * @see _.drop
+ */
+ drop(n?: number): LoDashExplicitArrayWrapper<T>;
+ }
+
+ interface LoDashExplicitObjectWrapper<T> {
+ /**
+ * @see _.drop
+ */
+ drop<T>(n?: number): LoDashExplicitArrayWrapper<T>;
+ }
+
+ //_.dropRight
+ interface LoDashStatic {
+ /**
+ * Creates a slice of array with n elements dropped from the end.
+ *
+ * @param array The array to query.
+ * @param n The number of elements to drop.
+ * @return Returns the slice of array.
+ */
+ dropRight<T>(
+ array: List<T>,
+ n?: number
+ ): T[];
+ }
+
+ interface LoDashImplicitArrayWrapper<T> {
+ /**
+ * @see _.dropRight
+ */
+ dropRight(n?: number): LoDashImplicitArrayWrapper<T>;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.dropRight
+ */
+ dropRight<TResult>(n?: number): LoDashImplicitArrayWrapper<TResult>;
+ }
+
+ interface LoDashExplicitArrayWrapper<T> {
+ /**
+ * @see _.dropRight
+ */
+ dropRight(n?: number): LoDashExplicitArrayWrapper<T>;
+ }
+
+ interface LoDashExplicitObjectWrapper<T> {
+ /**
+ * @see _.dropRight
+ */
+ dropRight<TResult>(n?: number): LoDashExplicitArrayWrapper<TResult>;
+ }
+
+ //_.dropRightWhile
+ interface LoDashStatic {
+ /**
+ * Creates a slice of array excluding elements dropped from the end. Elements are dropped until predicate
+ * returns falsey. The predicate is bound to thisArg and invoked with three arguments: (value, index, array).
+ *
+ * If a property name is provided for predicate the created _.property style callback returns the property
+ * value of the given element.
+ *
+ * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for
+ * elements that have a matching property value, else false.
+ *
+ * If an object is provided for predicate the created _.matches style callback returns true for elements that
+ * match the properties of the given object, else false.
+ *
+ * @param array The array to query.
+ * @param predicate The function invoked per iteration.
+ * @param thisArg The this binding of predicate.
+ * @return Returns the slice of array.
+ */
+ dropRightWhile<TValue>(
+ array: List<TValue>,
+ predicate?: ListIterator<TValue, boolean>,
+ thisArg?: any
+ ): TValue[];
+
+ /**
+ * @see _.dropRightWhile
+ */
+ dropRightWhile<TValue>(
+ array: List<TValue>,
+ predicate?: string,
+ thisArg?: any
+ ): TValue[];
+
+ /**
+ * @see _.dropRightWhile
+ */
+ dropRightWhile<TWhere, TValue>(
+ array: List<TValue>,
+ predicate?: TWhere
+ ): TValue[];
+ }
+
+ interface LoDashImplicitArrayWrapper<T> {
+ /**
+ * @see _.dropRightWhile
+ */
+ dropRightWhile(
+ predicate?: ListIterator<T, boolean>,
+ thisArg?: any
+ ): LoDashImplicitArrayWrapper<T>;
+
+ /**
+ * @see _.dropRightWhile
+ */
+ dropRightWhile(
+ predicate?: string,
+ thisArg?: any
+ ): LoDashImplicitArrayWrapper<T>;
+
+ /**
+ * @see _.dropRightWhile
+ */
+ dropRightWhile<TWhere>(
+ predicate?: TWhere
+ ): LoDashImplicitArrayWrapper<T>;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.dropRightWhile
+ */
+ dropRightWhile<TValue>(
+ predicate?: ListIterator<TValue, boolean>,
+ thisArg?: any
+ ): LoDashImplicitArrayWrapper<TValue>;
+
+ /**
+ * @see _.dropRightWhile
+ */
+ dropRightWhile<TValue>(
+ predicate?: string,
+ thisArg?: any
+ ): LoDashImplicitArrayWrapper<TValue>;
+
+ /**
+ * @see _.dropRightWhile
+ */
+ dropRightWhile<TWhere, TValue>(
+ predicate?: TWhere
+ ): LoDashImplicitArrayWrapper<TValue>;
+ }
+
+ interface LoDashExplicitArrayWrapper<T> {
+ /**
+ * @see _.dropRightWhile
+ */
+ dropRightWhile(
+ predicate?: ListIterator<T, boolean>,
+ thisArg?: any
+ ): LoDashExplicitArrayWrapper<T>;
+
+ /**
+ * @see _.dropRightWhile
+ */
+ dropRightWhile(
+ predicate?: string,
+ thisArg?: any
+ ): LoDashExplicitArrayWrapper<T>;
+
+ /**
+ * @see _.dropRightWhile
+ */
+ dropRightWhile<TWhere>(
+ predicate?: TWhere
+ ): LoDashExplicitArrayWrapper<T>;
+ }
+
+ interface LoDashExplicitObjectWrapper<T> {
+ /**
+ * @see _.dropRightWhile
+ */
+ dropRightWhile<TValue>(
+ predicate?: ListIterator<TValue, boolean>,
+ thisArg?: any
+ ): LoDashExplicitArrayWrapper<TValue>;
+
+ /**
+ * @see _.dropRightWhile
+ */
+ dropRightWhile<TValue>(
+ predicate?: string,
+ thisArg?: any
+ ): LoDashExplicitArrayWrapper<TValue>;
+
+ /**
+ * @see _.dropRightWhile
+ */
+ dropRightWhile<TWhere, TValue>(
+ predicate?: TWhere
+ ): LoDashExplicitArrayWrapper<TValue>;
+ }
+
+ //_.dropWhile
+ interface LoDashStatic {
+ /**
+ * Creates a slice of array excluding elements dropped from the beginning. Elements are dropped until predicate
+ * returns falsey. The predicate is bound to thisArg and invoked with three arguments: (value, index, array).
+ *
+ * If a property name is provided for predicate the created _.property style callback returns the property
+ * value of the given element.
+ *
+ * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for
+ * elements that have a matching property value, else false.
+ *
+ * If an object is provided for predicate the created _.matches style callback returns true for elements that
+ * have the properties of the given object, else false.
+ *
+ * @param array The array to query.
+ * @param predicate The function invoked per iteration.
+ * @param thisArg The this binding of predicate.
+ * @return Returns the slice of array.
+ */
+ dropWhile<TValue>(
+ array: List<TValue>,
+ predicate?: ListIterator<TValue, boolean>,
+ thisArg?: any
+ ): TValue[];
+
+ /**
+ * @see _.dropWhile
+ */
+ dropWhile<TValue>(
+ array: List<TValue>,
+ predicate?: string,
+ thisArg?: any
+ ): TValue[];
+
+ /**
+ * @see _.dropWhile
+ */
+ dropWhile<TWhere, TValue>(
+ array: List<TValue>,
+ predicate?: TWhere
+ ): TValue[];
+ }
+
+ interface LoDashImplicitArrayWrapper<T> {
+ /**
+ * @see _.dropWhile
+ */
+ dropWhile(
+ predicate?: ListIterator<T, boolean>,
+ thisArg?: any
+ ): LoDashImplicitArrayWrapper<T>;
+
+ /**
+ * @see _.dropWhile
+ */
+ dropWhile(
+ predicate?: string,
+ thisArg?: any
+ ): LoDashImplicitArrayWrapper<T>;
+
+ /**
+ * @see _.dropWhile
+ */
+ dropWhile<TWhere>(
+ predicate?: TWhere
+ ): LoDashImplicitArrayWrapper<T>;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.dropWhile
+ */
+ dropWhile<TValue>(
+ predicate?: ListIterator<TValue, boolean>,
+ thisArg?: any
+ ): LoDashImplicitArrayWrapper<TValue>;
+
+ /**
+ * @see _.dropWhile
+ */
+ dropWhile<TValue>(
+ predicate?: string,
+ thisArg?: any
+ ): LoDashImplicitArrayWrapper<TValue>;
+
+ /**
+ * @see _.dropWhile
+ */
+ dropWhile<TWhere, TValue>(
+ predicate?: TWhere
+ ): LoDashImplicitArrayWrapper<TValue>;
+ }
+
+ interface LoDashExplicitArrayWrapper<T> {
+ /**
+ * @see _.dropWhile
+ */
+ dropWhile(
+ predicate?: ListIterator<T, boolean>,
+ thisArg?: any
+ ): LoDashExplicitArrayWrapper<T>;
+
+ /**
+ * @see _.dropWhile
+ */
+ dropWhile(
+ predicate?: string,
+ thisArg?: any
+ ): LoDashExplicitArrayWrapper<T>;
+
+ /**
+ * @see _.dropWhile
+ */
+ dropWhile<TWhere>(
+ predicate?: TWhere
+ ): LoDashExplicitArrayWrapper<T>;
+ }
+
+ interface LoDashExplicitObjectWrapper<T> {
+ /**
+ * @see _.dropWhile
+ */
+ dropWhile<TValue>(
+ predicate?: ListIterator<TValue, boolean>,
+ thisArg?: any
+ ): LoDashExplicitArrayWrapper<TValue>;
+
+ /**
+ * @see _.dropWhile
+ */
+ dropWhile<TValue>(
+ predicate?: string,
+ thisArg?: any
+ ): LoDashExplicitArrayWrapper<TValue>;
+
+ /**
+ * @see _.dropWhile
+ */
+ dropWhile<TWhere, TValue>(
+ predicate?: TWhere
+ ): LoDashExplicitArrayWrapper<TValue>;
+ }
+
+ //_.fill
+ interface LoDashStatic {
+ /**
+ * Fills elements of array with value from start up to, but not including, end.
+ *
+ * Note: This method mutates array.
+ *
+ * @param array The array to fill.
+ * @param value The value to fill array with.
+ * @param start The start position.
+ * @param end The end position.
+ * @return Returns array.
+ */
+ fill<T>(
+ array: any[],
+ value: T,
+ start?: number,
+ end?: number
+ ): T[];
+
+ /**
+ * @see _.fill
+ */
+ fill<T>(
+ array: List<any>,
+ value: T,
+ start?: number,
+ end?: number
+ ): List<T>;
+ }
+
+ interface LoDashImplicitArrayWrapper<T> {
+ /**
+ * @see _.fill
+ */
+ fill<T>(
+ value: T,
+ start?: number,
+ end?: number
+ ): LoDashImplicitArrayWrapper<T>;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.fill
+ */
+ fill<T>(
+ value: T,
+ start?: number,
+ end?: number
+ ): LoDashImplicitObjectWrapper<List<T>>;
+ }
+
+ interface LoDashExplicitArrayWrapper<T> {
+ /**
+ * @see _.fill
+ */
+ fill<T>(
+ value: T,
+ start?: number,
+ end?: number
+ ): LoDashExplicitArrayWrapper<T>;
+ }
+
+ interface LoDashExplicitObjectWrapper<T> {
+ /**
+ * @see _.fill
+ */
+ fill<T>(
+ value: T,
+ start?: number,
+ end?: number
+ ): LoDashExplicitObjectWrapper<List<T>>;
+ }
+
+ //_.findIndex
+ interface LoDashStatic {
+ /**
+ * This method is like _.find except that it returns the index of the first element predicate returns truthy
+ * for instead of the element itself.
+ *
+ * If a property name is provided for predicate the created _.property style callback returns the property
+ * value of the given element.
+ *
+ * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for
+ * elements that have a matching property value, else false.
+ *
+ * If an object is provided for predicate the created _.matches style callback returns true for elements that
+ * have the properties of the given object, else false.
+ *
+ * @param array The array to search.
+ * @param predicate The function invoked per iteration.
+ * @param thisArg The this binding of predicate.
+ * @return Returns the index of the found element, else -1.
+ */
+ findIndex<T>(
+ array: List<T>,
+ predicate?: ListIterator<T, boolean>,
+ thisArg?: any
+ ): number;
+
+ /**
+ * @see _.findIndex
+ */
+ findIndex<T>(
+ array: List<T>,
+ predicate?: string,
+ thisArg?: any
+ ): number;
+
+ /**
+ * @see _.findIndex
+ */
+ findIndex<W, T>(
+ array: List<T>,
+ predicate?: W
+ ): number;
+ }
+
+ interface LoDashImplicitArrayWrapper<T> {
+ /**
+ * @see _.findIndex
+ */
+ findIndex(
+ predicate?: ListIterator<T, boolean>,
+ thisArg?: any
+ ): number;
+
+ /**
+ * @see _.findIndex
+ */
+ findIndex(
+ predicate?: string,
+ thisArg?: any
+ ): number;
+
+ /**
+ * @see _.findIndex
+ */
+ findIndex<W>(
+ predicate?: W
+ ): number;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.findIndex
+ */
+ findIndex<TResult>(
+ predicate?: ListIterator<TResult, boolean>,
+ thisArg?: any
+ ): number;
+
+ /**
+ * @see _.findIndex
+ */
+ findIndex(
+ predicate?: string,
+ thisArg?: any
+ ): number;
+
+ /**
+ * @see _.findIndex
+ */
+ findIndex<W>(
+ predicate?: W
+ ): number;
+ }
+
+ interface LoDashExplicitArrayWrapper<T> {
+ /**
+ * @see _.findIndex
+ */
+ findIndex(
+ predicate?: ListIterator<T, boolean>,
+ thisArg?: any
+ ): LoDashExplicitWrapper<number>;
+
+ /**
+ * @see _.findIndex
+ */
+ findIndex(
+ predicate?: string,
+ thisArg?: any
+ ): LoDashExplicitWrapper<number>;
+
+ /**
+ * @see _.findIndex
+ */
+ findIndex<W>(
+ predicate?: W
+ ): LoDashExplicitWrapper<number>;
+ }
+
+ interface LoDashExplicitObjectWrapper<T> {
+ /**
+ * @see _.findIndex
+ */
+ findIndex<TResult>(
+ predicate?: ListIterator<TResult, boolean>,
+ thisArg?: any
+ ): LoDashExplicitWrapper<number>;
+
+ /**
+ * @see _.findIndex
+ */
+ findIndex(
+ predicate?: string,
+ thisArg?: any
+ ): LoDashExplicitWrapper<number>;
+
+ /**
+ * @see _.findIndex
+ */
+ findIndex<W>(
+ predicate?: W
+ ): LoDashExplicitWrapper<number>;
+ }
+
+ //_.findLastIndex
+ interface LoDashStatic {
+ /**
+ * This method is like _.findIndex except that it iterates over elements of collection from right to left.
+ *
+ * If a property name is provided for predicate the created _.property style callback returns the property
+ * value of the given element.
+ *
+ * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for
+ * elements that have a matching property value, else false.
+ *
+ * If an object is provided for predicate the created _.matches style callback returns true for elements that
+ * have the properties of the given object, else false.
+ *
+ * @param array The array to search.
+ * @param predicate The function invoked per iteration.
+ * @param thisArg The function invoked per iteration.
+ * @return Returns the index of the found element, else -1.
+ */
+ findLastIndex<T>(
+ array: List<T>,
+ predicate?: ListIterator<T, boolean>,
+ thisArg?: any
+ ): number;
+
+ /**
+ * @see _.findLastIndex
+ */
+ findLastIndex<T>(
+ array: List<T>,
+ predicate?: string,
+ thisArg?: any
+ ): number;
+
+ /**
+ * @see _.findLastIndex
+ */
+ findLastIndex<W, T>(
+ array: List<T>,
+ predicate?: W
+ ): number;
+ }
+
+ interface LoDashImplicitArrayWrapper<T> {
+ /**
+ * @see _.findLastIndex
+ */
+ findLastIndex(
+ predicate?: ListIterator<T, boolean>,
+ thisArg?: any
+ ): number;
+
+ /**
+ * @see _.findLastIndex
+ */
+ findLastIndex(
+ predicate?: string,
+ thisArg?: any
+ ): number;
+
+ /**
+ * @see _.findLastIndex
+ */
+ findLastIndex<W>(
+ predicate?: W
+ ): number;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.findLastIndex
+ */
+ findLastIndex<TResult>(
+ predicate?: ListIterator<TResult, boolean>,
+ thisArg?: any
+ ): number;
+
+ /**
+ * @see _.findLastIndex
+ */
+ findLastIndex(
+ predicate?: string,
+ thisArg?: any
+ ): number;
+
+ /**
+ * @see _.findLastIndex
+ */
+ findLastIndex<W>(
+ predicate?: W
+ ): number;
+ }
+
+ interface LoDashExplicitArrayWrapper<T> {
+ /**
+ * @see _.findLastIndex
+ */
+ findLastIndex(
+ predicate?: ListIterator<T, boolean>,
+ thisArg?: any
+ ): LoDashExplicitWrapper<number>;
+
+ /**
+ * @see _.findLastIndex
+ */
+ findLastIndex(
+ predicate?: string,
+ thisArg?: any
+ ): LoDashExplicitWrapper<number>;
+
+ /**
+ * @see _.findLastIndex
+ */
+ findLastIndex<W>(
+ predicate?: W
+ ): LoDashExplicitWrapper<number>;
+ }
+
+ interface LoDashExplicitObjectWrapper<T> {
+ /**
+ * @see _.findLastIndex
+ */
+ findLastIndex<TResult>(
+ predicate?: ListIterator<TResult, boolean>,
+ thisArg?: any
+ ): LoDashExplicitWrapper<number>;
+
+ /**
+ * @see _.findLastIndex
+ */
+ findLastIndex(
+ predicate?: string,
+ thisArg?: any
+ ): LoDashExplicitWrapper<number>;
+
+ /**
+ * @see _.findLastIndex
+ */
+ findLastIndex<W>(
+ predicate?: W
+ ): LoDashExplicitWrapper<number>;
+ }
+
+ //_.first
+ interface LoDashStatic {
+ /**
+ * @see _.head
+ */
+ first<T>(array: List<T>): T;
+ }
+
+ interface LoDashImplicitArrayWrapper<T> {
+ /**
+ * @see _.head
+ */
+ first(): T;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.head
+ */
+ first<TResult>(): TResult;
+ }
+
+ interface RecursiveArray<T> extends Array<T|RecursiveArray<T>> {}
+ interface ListOfRecursiveArraysOrValues<T> extends List<T|RecursiveArray<T>> {}
+
+ //_.flatMap DUMMY
+ interface LoDashStatic {
+ /**
+ * Creates an array of flattened values by running each element in `array`
+ * through `iteratee` and concating its result to the other mapped values.
+ * The iteratee is invoked with three arguments: (value, index|key, array).
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} array The array to iterate over.
+ * @param {Function|Object|string} [iteratee=_.identity] The function invoked per iteration.
+ * @returns {Array} Returns the new array.
+ * @example
+ *
+ * function duplicate(n) {
+ * return [n, n];
+ * }
+ *
+ * _.flatMap([1, 2], duplicate);
+ * // => [1, 1, 2, 2]
+ */
+ flatMap(
+ array: any[]|List<any>,
+ ...values: any[]
+ ): any[];
+ }
+
+ //_.flatten
+ interface LoDashStatic {
+ /**
+ * Flattens a nested array. If isDeep is true the array is recursively flattened, otherwise it’s only
+ * flattened a single level.
+ *
+ * @param array The array to flatten.
+ * @param isDeep Specify a deep flatten.
+ * @return Returns the new flattened array.
+ */
+ flatten<T>(array: ListOfRecursiveArraysOrValues<T>, isDeep: boolean): T[];
+
+ /**
+ * @see _.flatten
+ */
+ flatten<T>(array: List<T|T[]>): T[];
+
+ /**
+ * @see _.flatten
+ */
+ flatten<T>(array: ListOfRecursiveArraysOrValues<T>): RecursiveArray<T>;
+ }
+
+ interface LoDashImplicitWrapper<T> {
+ /**
+ * @see _.flatten
+ */
+ flatten(): LoDashImplicitArrayWrapper<string>;
+ }
+
+ interface LoDashImplicitArrayWrapper<T> {
+ /**
+ * @see _.flatten
+ */
+ flatten<TResult>(isDeep?: boolean): LoDashImplicitArrayWrapper<TResult>;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.flatten
+ */
+ flatten<TResult>(isDeep?: boolean): LoDashImplicitArrayWrapper<TResult>;
+ }
+
+ interface LoDashExplicitWrapper<T> {
+ /**
+ * @see _.flatten
+ */
+ flatten(): LoDashExplicitArrayWrapper<string>;
+ }
+
+ interface LoDashExplicitArrayWrapper<T> {
+ /**
+ * @see _.flatten
+ */
+ flatten<TResult>(isDeep?: boolean): LoDashExplicitArrayWrapper<TResult>;
+ }
+
+ interface LoDashExplicitObjectWrapper<T> {
+ /**
+ * @see _.flatten
+ */
+ flatten<TResult>(isDeep?: boolean): LoDashExplicitArrayWrapper<TResult>;
+ }
+
+ //_.flattenDeep
+ interface LoDashStatic {
+ /**
+ * Recursively flattens a nested array.
+ *
+ * @param array The array to recursively flatten.
+ * @return Returns the new flattened array.
+ */
+ flattenDeep<T>(array: ListOfRecursiveArraysOrValues<T>): T[];
+ }
+
+ interface LoDashImplicitWrapper<T> {
+ /**
+ * @see _.flattenDeep
+ */
+ flattenDeep(): LoDashImplicitArrayWrapper<string>;
+ }
+
+ interface LoDashImplicitArrayWrapper<T> {
+ /**
+ * @see _.flattenDeep
+ */
+ flattenDeep<T>(): LoDashImplicitArrayWrapper<T>;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.flattenDeep
+ */
+ flattenDeep<T>(): LoDashImplicitArrayWrapper<T>;
+ }
+
+ interface LoDashExplicitWrapper<T> {
+ /**
+ * @see _.flattenDeep
+ */
+ flattenDeep(): LoDashExplicitArrayWrapper<string>;
+ }
+
+ interface LoDashExplicitArrayWrapper<T> {
+ /**
+ * @see _.flattenDeep
+ */
+ flattenDeep<T>(): LoDashExplicitArrayWrapper<T>;
+ }
+
+ interface LoDashExplicitObjectWrapper<T> {
+ /**
+ * @see _.flattenDeep
+ */
+ flattenDeep<T>(): LoDashExplicitArrayWrapper<T>;
+ }
+
+ //_.fromPairs DUMMY
+ interface LoDashStatic {
+ /**
+ * The inverse of `_.toPairs`; this method returns an object composed
+ * from key-value `pairs`.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} pairs The key-value pairs.
+ * @returns {Object} Returns the new object.
+ * @example
+ *
+ * _.fromPairs([['fred', 30], ['barney', 40]]);
+ * // => { 'fred': 30, 'barney': 40 }
+ */
+ fromPairs(
+ array: any[]|List<any>
+ ): any[];
+ }
+
+ //_.head
+ interface LoDashStatic {
+ /**
+ * Gets the first element of array.
+ *
+ * @alias _.first
+ *
+ * @param array The array to query.
+ * @return Returns the first element of array.
+ */
+ head<T>(array: List<T>): T;
+ }
+
+ interface LoDashImplicitArrayWrapper<T> {
+ /**
+ * @see _.first
+ */
+ head(): T;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.first
+ */
+ head<TResult>(): TResult;
+ }
+
+ //_.indexOf
+ interface LoDashStatic {
+ /**
+ * Gets the index at which the first occurrence of `value` is found in `array`
+ * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
+ * for equality comparisons. If `fromIndex` is negative, it's used as the offset
+ * from the end of `array`. If `array` is sorted providing `true` for `fromIndex`
+ * performs a faster binary search.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} array The array to search.
+ * @param {*} value The value to search for.
+ * @param {number} [fromIndex=0] The index to search from.
+ * @returns {number} Returns the index of the matched value, else `-1`.
+ * @example
+ *
+ * _.indexOf([1, 2, 1, 2], 2);
+ * // => 1
+ *
+ * // using `fromIndex`
+ * _.indexOf([1, 2, 1, 2], 2, 2);
+ * // => 3
+ */
+ indexOf<T>(
+ array: List<T>,
+ value: T,
+ fromIndex?: boolean|number
+ ): number;
+ }
+
+ interface LoDashImplicitArrayWrapper<T> {
+ /**
+ * @see _.indexOf
+ */
+ indexOf(
+ value: T,
+ fromIndex?: boolean|number
+ ): number;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.indexOf
+ */
+ indexOf<TValue>(
+ value: TValue,
+ fromIndex?: boolean|number
+ ): number;
+ }
+
+ interface LoDashExplicitArrayWrapper<T> {
+ /**
+ * @see _.indexOf
+ */
+ indexOf(
+ value: T,
+ fromIndex?: boolean|number
+ ): LoDashExplicitWrapper<number>;
+ }
+
+ interface LoDashExplicitObjectWrapper<T> {
+ /**
+ * @see _.indexOf
+ */
+ indexOf<TValue>(
+ value: TValue,
+ fromIndex?: boolean|number
+ ): LoDashExplicitWrapper<number>;
+ }
+
+ //_.intersectionBy DUMMY
+ interface LoDashStatic {
+ /**
+ * This method is like `_.intersection` except that it accepts `iteratee`
+ * which is invoked for each element of each `arrays` to generate the criterion
+ * by which uniqueness is computed. The iteratee is invoked with one argument: (value).
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {...Array} [arrays] The arrays to inspect.
+ * @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element.
+ * @returns {Array} Returns the new array of shared values.
+ * @example
+ *
+ * _.intersectionBy([2.1, 1.2], [4.3, 2.4], Math.floor);
+ * // => [2.1]
+ *
+ * // using the `_.property` iteratee shorthand
+ * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
+ * // => [{ 'x': 1 }]
+ */
+ intersectionBy(
+ array: any[]|List<any>,
+ ...values: any[]
+ ): any[];
+ }
+
+ //_.intersectionWith DUMMY
+ interface LoDashStatic {
+ /**
+ * This method is like `_.intersection` except that it accepts `comparator`
+ * which is invoked to compare elements of `arrays`. The comparator is invoked
+ * with two arguments: (arrVal, othVal).
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {...Array} [arrays] The arrays to inspect.
+ * @param {Function} [comparator] The comparator invoked per element.
+ * @returns {Array} Returns the new array of shared values.
+ * @example
+ *
+ * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
+ * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
+ *
+ * _.intersectionWith(objects, others, _.isEqual);
+ * // => [{ 'x': 1, 'y': 2 }]
+ */
+ intersectionWith(
+ array: any[]|List<any>,
+ ...values: any[]
+ ): any[];
+ }
+
+ //_.join DUMMY
+ interface LoDashStatic {
+ /**
+ * Converts all elements in `array` into a string separated by `separator`.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} array The array to convert.
+ * @param {string} [separator=','] The element separator.
+ * @returns {string} Returns the joined string.
+ * @example
+ *
+ * _.join(['a', 'b', 'c'], '~');
+ * // => 'a~b~c'
+ */
+ join(
+ array: any[]|List<any>,
+ ...values: any[]
+ ): any[];
+ }
+
+ //_.pullAll DUMMY
+ interface LoDashStatic {
+ /**
+ * This method is like `_.pull` except that it accepts an array of values to remove.
+ *
+ * **Note:** Unlike `_.difference`, this method mutates `array`.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} array The array to modify.
+ * @param {Array} values The values to remove.
+ * @returns {Array} Returns `array`.
+ * @example
+ *
+ * var array = [1, 2, 3, 1, 2, 3];
+ *
+ * _.pull(array, [2, 3]);
+ * console.log(array);
+ * // => [1, 1]
+ */
+ pullAll(
+ array: any[]|List<any>,
+ ...values: any[]
+ ): any[];
+ }
+
+ //_.pullAllBy DUMMY
+ interface LoDashStatic {
+ /**
+ * This method is like `_.pullAll` except that it accepts `iteratee` which is
+ * invoked for each element of `array` and `values` to to generate the criterion
+ * by which uniqueness is computed. The iteratee is invoked with one argument: (value).
+ *
+ * **Note:** Unlike `_.differenceBy`, this method mutates `array`.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} array The array to modify.
+ * @param {Array} values The values to remove.
+ * @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element.
+ * @returns {Array} Returns `array`.
+ * @example
+ *
+ * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];
+ *
+ * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');
+ * console.log(array);
+ * // => [{ 'x': 2 }]
+ */
+ pullAllBy(
+ array: any[]|List<any>,
+ ...values: any[]
+ ): any[];
+ }
+
+ //_.reverse DUMMY
+ interface LoDashStatic {
+ /**
+ * Reverses `array` so that the first element becomes the last, the second
+ * element becomes the second to last, and so on.
+ *
+ * **Note:** This method mutates `array` and is based on
+ * [`Array#reverse`](https://mdn.io/Array/reverse).
+ *
+ * @memberOf _
+ * @category Array
+ * @returns {Array} Returns `array`.
+ * @example
+ *
+ * var array = [1, 2, 3];
+ *
+ * _.reverse(array);
+ * // => [3, 2, 1]
+ *
+ * console.log(array);
+ * // => [3, 2, 1]
+ */
+ reverse(
+ array: any[]|List<any>,
+ ...values: any[]
+ ): any[];
+ }
+
+ //_.sortedIndexOf
+ interface LoDashStatic {
+ /**
+ * This method is like `_.indexOf` except that it performs a binary
+ * search on a sorted `array`.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} array The array to search.
+ * @param {*} value The value to search for.
+ * @returns {number} Returns the index of the matched value, else `-1`.
+ * @example
+ *
+ * _.sortedIndexOf([1, 1, 2, 2], 2);
+ * // => 2
+ */
+ sortedIndexOf<T>(
+ array: List<T>,
+ value: T
+ ): number;
+ }
+
+ interface LoDashImplicitArrayWrapper<T> {
+ /**
+ * @see _.sortedIndexOf
+ */
+ sortedIndexOf(
+ value: T
+ ): number;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.sortedIndexOf
+ */
+ sortedIndexOf<TValue>(
+ value: TValue
+ ): number;
+ }
+
+ interface LoDashExplicitArrayWrapper<T> {
+ /**
+ * @see _.sortedIndexOf
+ */
+ sortedIndexOf(
+ value: T
+ ): LoDashExplicitWrapper<number>;
+ }
+
+ interface LoDashExplicitObjectWrapper<T> {
+ /**
+ * @see _.sortedIndexOf
+ */
+ sortedIndexOf<TValue>(
+ value: TValue
+ ): LoDashExplicitWrapper<number>;
+ }
+
+ //_.initial
+ interface LoDashStatic {
+ /**
+ * Gets all but the last element of array.
+ *
+ * @param array The array to query.
+ * @return Returns the slice of array.
+ */
+ initial<T>(array: List<T>): T[];
+ }
+
+ interface LoDashImplicitArrayWrapper<T> {
+ /**
+ * @see _.initial
+ */
+ initial(): LoDashImplicitArrayWrapper<T>;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.initial
+ */
+ initial<T>(): LoDashImplicitArrayWrapper<T>;
+ }
+
+ interface LoDashExplicitArrayWrapper<T> {
+ /**
+ * @see _.initial
+ */
+ initial(): LoDashExplicitArrayWrapper<T>;
+ }
+
+ interface LoDashExplicitObjectWrapper<T> {
+ /**
+ * @see _.initial
+ */
+ initial<T>(): LoDashExplicitArrayWrapper<T>;
+ }
+
+ //_.intersection
+ interface LoDashStatic {
+ /**
+ * Creates an array of unique values that are included in all of the provided arrays using SameValueZero for
+ * equality comparisons.
+ *
+ * @param arrays The arrays to inspect.
+ * @return Returns the new array of shared values.
+ */
+ intersection<T>(...arrays: (T[]|List<T>)[]): T[];
+ }
+
+ interface LoDashImplicitArrayWrapper<T> {
+ /**
+ * @see _.intersection
+ */
+ intersection<TResult>(...arrays: (TResult[]|List<TResult>)[]): LoDashImplicitArrayWrapper<TResult>;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.intersection
+ */
+ intersection<TResult>(...arrays: (TResult[]|List<TResult>)[]): LoDashImplicitArrayWrapper<TResult>;
+ }
+
+ interface LoDashExplicitArrayWrapper<T> {
+ /**
+ * @see _.intersection
+ */
+ intersection<TResult>(...arrays: (TResult[]|List<TResult>)[]): LoDashExplicitArrayWrapper<TResult>;
+ }
+
+ interface LoDashExplicitObjectWrapper<T> {
+ /**
+ * @see _.intersection
+ */
+ intersection<TResult>(...arrays: (TResult[]|List<TResult>)[]): LoDashExplicitArrayWrapper<TResult>;
+ }
+
+ //_.last
+ interface LoDashStatic {
+ /**
+ * Gets the last element of array.
+ *
+ * @param array The array to query.
+ * @return Returns the last element of array.
+ */
+ last<T>(array: List<T>): T;
+ }
+
+ interface LoDashImplicitArrayWrapper<T> {
+ /**
+ * @see _.last
+ */
+ last(): T;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.last
+ */
+ last<T>(): T;
+ }
+
+ interface LoDashExplicitArrayWrapper<T> {
+ /**
+ * @see _.last
+ */
+ last(): LoDashExplicitArrayWrapper<T>;
+ }
+
+ interface LoDashExplicitObjectWrapper<T> {
+ /**
+ * @see _.last
+ */
+ last<T>(): LoDashExplicitObjectWrapper<T>;
+ }
+
+ //_.lastIndexOf
+ interface LoDashStatic {
+ /**
+ * This method is like _.indexOf except that it iterates over elements of array from right to left.
+ *
+ * @param array The array to search.
+ * @param value The value to search for.
+ * @param fromIndex The index to search from or true to perform a binary search on a sorted array.
+ * @return Returns the index of the matched value, else -1.
+ */
+ lastIndexOf<T>(
+ array: List<T>,
+ value: T,
+ fromIndex?: boolean|number
+ ): number;
+ }
+
+ interface LoDashImplicitArrayWrapper<T> {
+ /**
+ * @see _.lastIndexOf
+ */
+ lastIndexOf(
+ value: T,
+ fromIndex?: boolean|number
+ ): number;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.lastIndexOf
+ */
+ lastIndexOf<TResult>(
+ value: TResult,
+ fromIndex?: boolean|number
+ ): number;
+ }
+
+ interface LoDashExplicitArrayWrapper<T> {
+ /**
+ * @see _.lastIndexOf
+ */
+ lastIndexOf(
+ value: T,
+ fromIndex?: boolean|number
+ ): LoDashExplicitWrapper<number>;
+ }
+
+ interface LoDashExplicitObjectWrapper<T> {
+ /**
+ * @see _.lastIndexOf
+ */
+ lastIndexOf<TResult>(
+ value: TResult,
+ fromIndex?: boolean|number
+ ): LoDashExplicitWrapper<number>;
+ }
+
+ //_.pull
+ interface LoDashStatic {
+ /**
+ * Removes all provided values from array using SameValueZero for equality comparisons.
+ *
+ * Note: Unlike _.without, this method mutates array.
+ *
+ * @param array The array to modify.
+ * @param values The values to remove.
+ * @return Returns array.
+ */
+ pull<T>(
+ array: T[],
+ ...values: T[]
+ ): T[];
+
+ /**
+ * @see _.pull
+ */
+ pull<T>(
+ array: List<T>,
+ ...values: T[]
+ ): List<T>;
+ }
+
+ interface LoDashImplicitArrayWrapper<T> {
+ /**
+ * @see _.pull
+ */
+ pull(...values: T[]): LoDashImplicitArrayWrapper<T>;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.pull
+ */
+ pull<TValue>(...values: TValue[]): LoDashImplicitObjectWrapper<List<TValue>>;
+ }
+
+ interface LoDashExplicitArrayWrapper<T> {
+ /**
+ * @see _.pull
+ */
+ pull(...values: T[]): LoDashExplicitArrayWrapper<T>;
+ }
+
+ interface LoDashExplicitObjectWrapper<T> {
+ /**
+ * @see _.pull
+ */
+ pull<TValue>(...values: TValue[]): LoDashExplicitObjectWrapper<List<TValue>>;
+ }
+
+ //_.pullAt
+ interface LoDashStatic {
+ /**
+ * Removes elements from array corresponding to the given indexes and returns an array of the removed elements.
+ * Indexes may be specified as an array of indexes or as individual arguments.
+ *
+ * Note: Unlike _.at, this method mutates array.
+ *
+ * @param array The array to modify.
+ * @param indexes The indexes of elements to remove, specified as individual indexes or arrays of indexes.
+ * @return Returns the new array of removed elements.
+ */
+ pullAt<T>(
+ array: List<T>,
+ ...indexes: (number|number[])[]
+ ): T[];
+ }
+
+ interface LoDashImplicitArrayWrapper<T> {
+ /**
+ * @see _.pullAt
+ */
+ pullAt(...indexes: (number|number[])[]): LoDashImplicitArrayWrapper<T>;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.pullAt
+ */
+ pullAt<T>(...indexes: (number|number[])[]): LoDashImplicitArrayWrapper<T>;
+ }
+
+ interface LoDashExplicitArrayWrapper<T> {
+ /**
+ * @see _.pullAt
+ */
+ pullAt(...indexes: (number|number[])[]): LoDashExplicitArrayWrapper<T>;
+ }
+
+ interface LoDashExplicitObjectWrapper<T> {
+ /**
+ * @see _.pullAt
+ */
+ pullAt<T>(...indexes: (number|number[])[]): LoDashExplicitArrayWrapper<T>;
+ }
+
+ //_.remove
+ interface LoDashStatic {
+ /**
+ * Removes all elements from array that predicate returns truthy for and returns an array of the removed
+ * elements. The predicate is bound to thisArg and invoked with three arguments: (value, index, array).
+ *
+ * If a property name is provided for predicate the created _.property style callback returns the property
+ * value of the given element.
+ *
+ * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for
+ * elements that have a matching property value, else false.
+ *
+ * If an object is provided for predicate the created _.matches style callback returns true for elements that
+ * have the properties of the given object, else false.
+ *
+ * Note: Unlike _.filter, this method mutates array.
+ *
+ * @param array The array to modify.
+ * @param predicate The function invoked per iteration.
+ * @param thisArg The this binding of predicate.
+ * @return Returns the new array of removed elements.
+ */
+ remove<T>(
+ array: List<T>,
+ predicate?: ListIterator<T, boolean>,
+ thisArg?: any
+ ): T[];
+
+ /**
+ * @see _.remove
+ */
+ remove<T>(
+ array: List<T>,
+ predicate?: string,
+ thisArg?: any
+ ): T[];
+
+ /**
+ * @see _.remove
+ */
+ remove<W, T>(
+ array: List<T>,
+ predicate?: W
+ ): T[];
+ }
+
+ interface LoDashImplicitArrayWrapper<T> {
+ /**
+ * @see _.remove
+ */
+ remove(
+ predicate?: ListIterator<T, boolean>,
+ thisArg?: any
+ ): LoDashImplicitArrayWrapper<T>;
+
+ /**
+ * @see _.remove
+ */
+ remove(
+ predicate?: string,
+ thisArg?: any
+ ): LoDashImplicitArrayWrapper<T>;
+
+ /**
+ * @see _.remove
+ */
+ remove<W>(
+ predicate?: W
+ ): LoDashImplicitArrayWrapper<T>;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.remove
+ */
+ remove<TResult>(
+ predicate?: ListIterator<TResult, boolean>,
+ thisArg?: any
+ ): LoDashImplicitArrayWrapper<TResult>;
+
+ /**
+ * @see _.remove
+ */
+ remove<TResult>(
+ predicate?: string,
+ thisArg?: any
+ ): LoDashImplicitArrayWrapper<TResult>;
+
+ /**
+ * @see _.remove
+ */
+ remove<W, TResult>(
+ predicate?: W
+ ): LoDashImplicitArrayWrapper<TResult>;
+ }
+
+ interface LoDashExplicitArrayWrapper<T> {
+ /**
+ * @see _.remove
+ */
+ remove(
+ predicate?: ListIterator<T, boolean>,
+ thisArg?: any
+ ): LoDashExplicitArrayWrapper<T>;
+
+ /**
+ * @see _.remove
+ */
+ remove(
+ predicate?: string,
+ thisArg?: any
+ ): LoDashExplicitArrayWrapper<T>;
+
+ /**
+ * @see _.remove
+ */
+ remove<W>(
+ predicate?: W
+ ): LoDashExplicitArrayWrapper<T>;
+ }
+
+ interface LoDashExplicitObjectWrapper<T> {
+ /**
+ * @see _.remove
+ */
+ remove<TResult>(
+ predicate?: ListIterator<TResult, boolean>,
+ thisArg?: any
+ ): LoDashExplicitArrayWrapper<TResult>;
+
+ /**
+ * @see _.remove
+ */
+ remove<TResult>(
+ predicate?: string,
+ thisArg?: any
+ ): LoDashExplicitArrayWrapper<TResult>;
+
+ /**
+ * @see _.remove
+ */
+ remove<W, TResult>(
+ predicate?: W
+ ): LoDashExplicitArrayWrapper<TResult>;
+ }
+
+ //_.tail
+ interface LoDashStatic {
+ /**
+ * Gets all but the first element of array.
+ *
+ * @alias _.tail
+ *
+ * @param array The array to query.
+ * @return Returns the slice of array.
+ */
+ tail<T>(array: List<T>): T[];
+ }
+
+ interface LoDashImplicitArrayWrapper<T> {
+ /**
+ * @see _.tail
+ */
+ tail(): LoDashImplicitArrayWrapper<T>;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.tail
+ */
+ tail<T>(): LoDashImplicitArrayWrapper<T>;
+ }
+
+ interface LoDashExplicitArrayWrapper<T> {
+ /**
+ * @see _.tail
+ */
+ tail(): LoDashExplicitArrayWrapper<T>;
+ }
+
+ interface LoDashExplicitObjectWrapper<T> {
+ /**
+ * @see _.tail
+ */
+ tail<T>(): LoDashExplicitArrayWrapper<T>;
+ }
+
+ //_.slice
+ interface LoDashStatic {
+ /**
+ * Creates a slice of array from start up to, but not including, end.
+ *
+ * @param array The array to slice.
+ * @param start The start position.
+ * @param end The end position.
+ * @return Returns the slice of array.
+ */
+ slice<T>(
+ array: T[],
+ start?: number,
+ end?: number
+ ): T[];
+ }
+
+ interface LoDashImplicitArrayWrapper<T> {
+ /**
+ * @see _.slice
+ */
+ slice(
+ start?: number,
+ end?: number
+ ): LoDashImplicitArrayWrapper<T>;
+ }
+
+ interface LoDashExplicitArrayWrapper<T> {
+ /**
+ * @see _.slice
+ */
+ slice(
+ start?: number,
+ end?: number
+ ): LoDashExplicitArrayWrapper<T>;
+ }
+
+ //_.sortedIndex
+ interface LoDashStatic {
+ /**
+ * Uses a binary search to determine the lowest index at which `value` should
+ * be inserted into `array` in order to maintain its sort order.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} array The sorted array to inspect.
+ * @param {*} value The value to evaluate.
+ * @returns {number} Returns the index at which `value` should be inserted into `array`.
+ * @example
+ *
+ * _.sortedIndex([30, 50], 40);
+ * // => 1
+ *
+ * _.sortedIndex([4, 5], 4);
+ * // => 0
+ */
+ sortedIndex<T, TSort>(
+ array: List<T>,
+ value: T
+ ): number;
+
+ /**
+ * @see _.sortedIndex
+ */
+ sortedIndex<T>(
+ array: List<T>,
+ value: T
+ ): number;
+
+ /**
+ * @see _.sortedIndex
+ */
+ sortedIndex<T>(
+ array: List<T>,
+ value: T
+ ): number;
+
+ /**
+ * @see _.sortedIndex
+ */
+ sortedIndex<W, T>(
+ array: List<T>,
+ value: T
+ ): number;
+
+ /**
+ * @see _.sortedIndex
+ */
+ sortedIndex<T>(
+ array: List<T>,
+ value: T
+ ): number;
+ }
+
+ interface LoDashImplicitWrapper<T> {
+ /**
+ * @see _.sortedIndex
+ */
+ sortedIndex<TSort>(
+ value: string
+ ): number;
+ }
+
+ interface LoDashImplicitArrayWrapper<T> {
+ /**
+ * @see _.sortedIndex
+ */
+ sortedIndex<TSort>(
+ value: T
+ ): number;
+
+ /**
+ * @see _.sortedIndex
+ */
+ sortedIndex(
+ value: T
+ ): number;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.sortedIndex
+ */
+ sortedIndex<T, TSort>(
+ value: T
+ ): number;
+
+ /**
+ * @see _.sortedIndex
+ */
+ sortedIndex<T>(
+ value: T
+ ): number;
+
+ /**
+ * @see _.sortedIndex
+ */
+ sortedIndex<W, T>(
+ value: T
+ ): number;
+ }
+
+ interface LoDashExplicitWrapper<T> {
+ /**
+ * @see _.sortedIndex
+ */
+ sortedIndex<TSort>(
+ value: string
+ ): LoDashExplicitWrapper<number>;
+ }
+
+ interface LoDashExplicitArrayWrapper<T> {
+ /**
+ * @see _.sortedIndex
+ */
+ sortedIndex<TSort>(
+ value: T
+ ): LoDashExplicitWrapper<number>;
+
+ /**
+ * @see _.sortedIndex
+ */
+ sortedIndex(
+ value: T
+ ): LoDashExplicitWrapper<number>;
+
+ /**
+ * @see _.sortedIndex
+ */
+ sortedIndex<W>(
+ value: T
+ ): LoDashExplicitWrapper<number>;
+ }
+
+ interface LoDashExplicitObjectWrapper<T> {
+ /**
+ * @see _.sortedIndex
+ */
+ sortedIndex<T, TSort>(
+ value: T
+ ): LoDashExplicitWrapper<number>;
+
+ /**
+ * @see _.sortedIndex
+ */
+ sortedIndex<T>(
+ value: T
+ ): LoDashExplicitWrapper<number>;
+
+ /**
+ * @see _.sortedIndex
+ */
+ sortedIndex<W, T>(
+ value: T
+ ): LoDashExplicitWrapper<number>;
+
+
+ }
+
+ //_.sortedIndexBy
+ interface LoDashStatic {
+ /**
+ * This method is like `_.sortedIndex` except that it accepts `iteratee`
+ * which is invoked for `value` and each element of `array` to compute their
+ * sort ranking. The iteratee is invoked with one argument: (value).
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} array The sorted array to inspect.
+ * @param {*} value The value to evaluate.
+ * @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element.
+ * @returns {number} Returns the index at which `value` should be inserted into `array`.
+ * @example
+ *
+ * var dict = { 'thirty': 30, 'forty': 40, 'fifty': 50 };
+ *
+ * _.sortedIndexBy(['thirty', 'fifty'], 'forty', _.propertyOf(dict));
+ * // => 1
+ *
+ * // using the `_.property` iteratee shorthand
+ * _.sortedIndexBy([{ 'x': 4 }, { 'x': 5 }], { 'x': 4 }, 'x');
+ * // => 0
+ */
+ sortedIndexBy<T, TSort>(
+ array: List<T>,
+ value: T,
+ iteratee: (x: T) => TSort
+ ): number;
+
+ /**
+ * @see _.sortedIndexBy
+ */
+ sortedIndexBy<T>(
+ array: List<T>,
+ value: T,
+ iteratee: (x: T) => any
+ ): number;
+
+ /**
+ * @see _.sortedIndexBy
+ */
+ sortedIndexBy<T>(
+ array: List<T>,
+ value: T,
+ iteratee: string
+ ): number;
+
+ /**
+ * @see _.sortedIndexBy
+ */
+ sortedIndexBy<W, T>(
+ array: List<T>,
+ value: T,
+ iteratee: W
+ ): number;
+
+ /**
+ * @see _.sortedIndexBy
+ */
+ sortedIndexBy<T>(
+ array: List<T>,
+ value: T,
+ iteratee: Object
+ ): number;
+ }
+
+ interface LoDashImplicitWrapper<T> {
+ /**
+ * @see _.sortedIndexBy
+ */
+ sortedIndexBy<TSort>(
+ value: string,
+ iteratee: (x: string) => TSort
+ ): number;
+ }
+
+ interface LoDashImplicitArrayWrapper<T> {
+ /**
+ * @see _.sortedIndexBy
+ */
+ sortedIndexBy<TSort>(
+ value: T,
+ iteratee: (x: T) => TSort
+ ): number;
+
+ /**
+ * @see _.sortedIndexBy
+ */
+ sortedIndexBy(
+ value: T,
+ iteratee: string
+ ): number;
+
+ /**
+ * @see _.sortedIndexBy
+ */
+ sortedIndexBy<W>(
+ value: T,
+ iteratee: W
+ ): number;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.sortedIndexBy
+ */
+ sortedIndexBy<T, TSort>(
+ value: T,
+ iteratee: (x: T) => TSort
+ ): number;
+
+ /**
+ * @see _.sortedIndexBy
+ */
+ sortedIndexBy<T>(
+ value: T,
+ iteratee: (x: T) => any
+ ): number;
+
+ /**
+ * @see _.sortedIndexBy
+ */
+ sortedIndexBy<T>(
+ value: T,
+ iteratee: string
+ ): number;
+
+ /**
+ * @see _.sortedIndexBy
+ */
+ sortedIndexBy<W, T>(
+ value: T,
+ iteratee: W
+ ): number;
+
+ /**
+ * @see _.sortedIndexBy
+ */
+ sortedIndexBy<T>(
+ value: T,
+ iteratee: Object
+ ): number;
+ }
+
+ interface LoDashExplicitWrapper<T> {
+ /**
+ * @see _.sortedIndexBy
+ */
+ sortedIndexBy<TSort>(
+ value: string,
+ iteratee: (x: string) => TSort
+ ): LoDashExplicitWrapper<number>;
+ }
+
+ interface LoDashExplicitArrayWrapper<T> {
+ /**
+ * @see _.sortedIndexBy
+ */
+ sortedIndexBy<TSort>(
+ value: T,
+ iteratee: (x: T) => TSort
+ ): LoDashExplicitWrapper<number>;
+
+ /**
+ * @see _.sortedIndexBy
+ */
+ sortedIndexBy(
+ value: T,
+ iteratee: string
+ ): LoDashExplicitWrapper<number>;
+
+ /**
+ * @see _.sortedIndexBy
+ */
+ sortedIndexBy<W>(
+ value: T,
+ iteratee: W
+ ): LoDashExplicitWrapper<number>;
+ }
+
+ interface LoDashExplicitObjectWrapper<T> {
+ /**
+ * @see _.sortedIndexBy
+ */
+ sortedIndexBy<T, TSort>(
+ value: T,
+ iteratee: (x: T) => TSort
+ ): LoDashExplicitWrapper<number>;
+
+ /**
+ * @see _.sortedIndexBy
+ */
+ sortedIndexBy<T>(
+ value: T,
+ iteratee: (x: T) => any
+ ): LoDashExplicitWrapper<number>;
+
+ /**
+ * @see _.sortedIndexBy
+ */
+ sortedIndexBy<T>(
+ value: T,
+ iteratee: string
+ ): LoDashExplicitWrapper<number>;
+
+ /**
+ * @see _.sortedIndexBy
+ */
+ sortedIndexBy<W, T>(
+ value: T,
+ iteratee: W
+ ): LoDashExplicitWrapper<number>;
+
+ /**
+ * @see _.sortedIndexBy
+ */
+ sortedIndexBy<T>(
+ value: T,
+ iteratee: Object
+ ): LoDashExplicitWrapper<number>;
+ }
+
+ //_.sortedLastIndex
+ interface LoDashStatic {
+ /**
+ * This method is like `_.sortedIndex` except that it returns the highest
+ * index at which `value` should be inserted into `array` in order to
+ * maintain its sort order.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} array The sorted array to inspect.
+ * @param {*} value The value to evaluate.
+ * @returns {number} Returns the index at which `value` should be inserted into `array`.
+ * @example
+ *
+ * _.sortedLastIndex([4, 5], 4);
+ * // => 1
+ */
+ sortedLastIndex<T, TSort>(
+ array: List<T>,
+ value: T
+ ): number;
+
+ /**
+ * @see _.sortedLastIndex
+ */
+ sortedLastIndex<T>(
+ array: List<T>,
+ value: T
+ ): number;
+
+ /**
+ * @see _.sortedLastIndex
+ */
+ sortedLastIndex<T>(
+ array: List<T>,
+ value: T
+ ): number;
+
+ /**
+ * @see _.sortedLastIndex
+ */
+ sortedLastIndex<W, T>(
+ array: List<T>,
+ value: T
+ ): number;
+
+ /**
+ * @see _.sortedLastIndex
+ */
+ sortedLastIndex<T>(
+ array: List<T>,
+ value: T
+ ): number;
+ }
+
+ interface LoDashImplicitWrapper<T> {
+ /**
+ * @see _.sortedLastIndex
+ */
+ sortedLastIndex<TSort>(
+ value: string
+ ): number;
+ }
+
+ interface LoDashImplicitArrayWrapper<T> {
+ /**
+ * @see _.sortedLastIndex
+ */
+ sortedLastIndex<TSort>(
+ value: T
+ ): number;
+
+ /**
+ * @see _.sortedLastIndex
+ */
+ sortedLastIndex(
+ value: T
+ ): number;
+
+ /**
+ * @see _.sortedLastIndex
+ */
+ sortedLastIndex<W>(
+ value: T
+ ): number;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.sortedLastIndex
+ */
+ sortedLastIndex<T, TSort>(
+ value: T
+ ): number;
+
+ /**
+ * @see _.sortedLastIndex
+ */
+ sortedLastIndex<T>(
+ value: T
+ ): number;
+
+ /**
+ * @see _.sortedLastIndex
+ */
+ sortedLastIndex<W, T>(
+ value: T
+ ): number;
+ }
+
+ interface LoDashExplicitWrapper<T> {
+ /**
+ * @see _.sortedLastIndex
+ */
+ sortedLastIndex<TSort>(
+ value: string
+ ): LoDashExplicitWrapper<number>;
+ }
+
+ interface LoDashExplicitArrayWrapper<T> {
+ /**
+ * @see _.sortedLastIndex
+ */
+ sortedLastIndex<TSort>(
+ value: T
+ ): LoDashExplicitWrapper<number>;
+
+ /**
+ * @see _.sortedLastIndex
+ */
+ sortedLastIndex(
+ value: T
+ ): LoDashExplicitWrapper<number>;
+ }
+
+ interface LoDashExplicitObjectWrapper<T> {
+ /**
+ * @see _.sortedLastIndex
+ */
+ sortedLastIndex<T, TSort>(
+ value: T
+ ): LoDashExplicitWrapper<number>;
+
+ /**
+ * @see _.sortedLastIndex
+ */
+ sortedLastIndex<T>(
+ value: T
+ ): LoDashExplicitWrapper<number>;
+
+ /**
+ * @see _.sortedLastIndex
+ */
+ sortedLastIndex<W, T>(
+ value: T
+ ): LoDashExplicitWrapper<number>;
+ }
+
+ //_.sortedLastIndexBy
+ interface LoDashStatic {
+ /**
+ * This method is like `_.sortedLastIndex` except that it accepts `iteratee`
+ * which is invoked for `value` and each element of `array` to compute their
+ * sort ranking. The iteratee is invoked with one argument: (value).
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} array The sorted array to inspect.
+ * @param {*} value The value to evaluate.
+ * @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element.
+ * @returns {number} Returns the index at which `value` should be inserted into `array`.
+ * @example
+ *
+ * // using the `_.property` iteratee shorthand
+ * _.sortedLastIndexBy([{ 'x': 4 }, { 'x': 5 }], { 'x': 4 }, 'x');
+ * // => 1
+ */
+ sortedLastIndexBy<T, TSort>(
+ array: List<T>,
+ value: T,
+ iteratee: (x: T) => TSort
+ ): number;
+
+ /**
+ * @see _.sortedLastIndexBy
+ */
+ sortedLastIndexBy<T>(
+ array: List<T>,
+ value: T,
+ iteratee: (x: T) => any
+ ): number;
+
+ /**
+ * @see _.sortedLastIndexBy
+ */
+ sortedLastIndexBy<T>(
+ array: List<T>,
+ value: T,
+ iteratee: string
+ ): number;
+
+ /**
+ * @see _.sortedLastIndexBy
+ */
+ sortedLastIndexBy<W, T>(
+ array: List<T>,
+ value: T,
+ iteratee: W
+ ): number;
+
+ /**
+ * @see _.sortedLastIndexBy
+ */
+ sortedLastIndexBy<T>(
+ array: List<T>,
+ value: T,
+ iteratee: Object
+ ): number;
+ }
+
+ interface LoDashImplicitWrapper<T> {
+ /**
+ * @see _.sortedLastIndexBy
+ */
+ sortedLastIndexBy<TSort>(
+ value: string,
+ iteratee: (x: string) => TSort
+ ): number;
+ }
+
+ interface LoDashImplicitArrayWrapper<T> {
+ /**
+ * @see _.sortedLastIndexBy
+ */
+ sortedLastIndexBy<TSort>(
+ value: T,
+ iteratee: (x: T) => TSort
+ ): number;
+
+ /**
+ * @see _.sortedLastIndexBy
+ */
+ sortedLastIndexBy(
+ value: T,
+ iteratee: string
+ ): number;
+
+ /**
+ * @see _.sortedLastIndexBy
+ */
+ sortedLastIndexBy<W>(
+ value: T,
+ iteratee: W
+ ): number;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.sortedLastIndexBy
+ */
+ sortedLastIndexBy<T, TSort>(
+ value: T,
+ iteratee: (x: T) => TSort
+ ): number;
+
+ /**
+ * @see _.sortedLastIndexBy
+ */
+ sortedLastIndexBy<T>(
+ value: T,
+ iteratee: (x: T) => any
+ ): number;
+
+ /**
+ * @see _.sortedLastIndexBy
+ */
+ sortedLastIndexBy<T>(
+ value: T,
+ iteratee: string
+ ): number;
+
+ /**
+ * @see _.sortedLastIndexBy
+ */
+ sortedLastIndexBy<W, T>(
+ value: T,
+ iteratee: W
+ ): number;
+
+ /**
+ * @see _.sortedLastIndexBy
+ */
+ sortedLastIndexBy<T>(
+ value: T,
+ iteratee: Object
+ ): number;
+ }
+
+ interface LoDashExplicitWrapper<T> {
+ /**
+ * @see _.sortedLastIndexBy
+ */
+ sortedLastIndexBy<TSort>(
+ value: string,
+ iteratee: (x: string) => TSort
+ ): LoDashExplicitWrapper<number>;
+ }
+
+ interface LoDashExplicitArrayWrapper<T> {
+ /**
+ * @see _.sortedLastIndexBy
+ */
+ sortedLastIndexBy<TSort>(
+ value: T,
+ iteratee: (x: T) => TSort
+ ): LoDashExplicitWrapper<number>;
+
+ /**
+ * @see _.sortedLastIndexBy
+ */
+ sortedLastIndexBy(
+ value: T,
+ iteratee: string
+ ): LoDashExplicitWrapper<number>;
+
+ /**
+ * @see _.sortedLastIndexBy
+ */
+ sortedLastIndexBy<W>(
+ value: T,
+ iteratee: W
+ ): LoDashExplicitWrapper<number>;
+ }
+
+ interface LoDashExplicitObjectWrapper<T> {
+ /**
+ * @see _.sortedLastIndexBy
+ */
+ sortedLastIndexBy<T, TSort>(
+ value: T,
+ iteratee: (x: T) => TSort
+ ): LoDashExplicitWrapper<number>;
+
+ /**
+ * @see _.sortedLastIndexBy
+ */
+ sortedLastIndexBy<T>(
+ value: T,
+ iteratee: (x: T) => any
+ ): LoDashExplicitWrapper<number>;
+
+ /**
+ * @see _.sortedLastIndexBy
+ */
+ sortedLastIndexBy<T>(
+ value: T,
+ iteratee: string
+ ): LoDashExplicitWrapper<number>;
+
+ /**
+ * @see _.sortedLastIndexBy
+ */
+ sortedLastIndexBy<W, T>(
+ value: T,
+ iteratee: W
+ ): LoDashExplicitWrapper<number>;
+
+ /**
+ * @see _.sortedLastIndexBy
+ */
+ sortedLastIndexBy<T>(
+ value: T,
+ iteratee: Object
+ ): LoDashExplicitWrapper<number>;
+ }
+
+ //_.sortedLastIndexOf DUMMY
+ interface LoDashStatic {
+ /**
+ * This method is like `_.lastIndexOf` except that it performs a binary
+ * search on a sorted `array`.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} array The array to search.
+ * @param {*} value The value to search for.
+ * @returns {number} Returns the index of the matched value, else `-1`.
+ * @example
+ *
+ * _.sortedLastIndexOf([1, 1, 2, 2], 2);
+ * // => 3
+ */
+ sortedLastIndexOf(
+ array: any[]|List<any>,
+ ...values: any[]
+ ): any[];
+ }
+
+ //_.tail
+ interface LoDashStatic {
+ /**
+ * @see _.rest
+ */
+ tail<T>(array: List<T>): T[];
+ }
+
+ interface LoDashImplicitArrayWrapper<T> {
+ /**
+ * @see _.rest
+ */
+ tail(): LoDashImplicitArrayWrapper<T>;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.rest
+ */
+ tail<T>(): LoDashImplicitArrayWrapper<T>;
+ }
+
+ interface LoDashExplicitArrayWrapper<T> {
+ /**
+ * @see _.rest
+ */
+ tail(): LoDashExplicitArrayWrapper<T>;
+ }
+
+ interface LoDashExplicitObjectWrapper<T> {
+ /**
+ * @see _.rest
+ */
+ tail<T>(): LoDashExplicitArrayWrapper<T>;
+ }
+
+ //_.take
+ interface LoDashStatic {
+ /**
+ * Creates a slice of array with n elements taken from the beginning.
+ *
+ * @param array The array to query.
+ * @param n The number of elements to take.
+ * @return Returns the slice of array.
+ */
+ take<T>(
+ array: List<T>,
+ n?: number
+ ): T[];
+ }
+
+ interface LoDashImplicitArrayWrapper<T> {
+ /**
+ * @see _.take
+ */
+ take(n?: number): LoDashImplicitArrayWrapper<T>;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.take
+ */
+ take<TResult>(n?: number): LoDashImplicitArrayWrapper<TResult>;
+ }
+
+ interface LoDashExplicitArrayWrapper<T> {
+ /**
+ * @see _.take
+ */
+ take(n?: number): LoDashExplicitArrayWrapper<T>;
+ }
+
+ interface LoDashExplicitObjectWrapper<T> {
+ /**
+ * @see _.take
+ */
+ take<TResult>(n?: number): LoDashExplicitArrayWrapper<TResult>;
+ }
+
+ //_.takeRight
+ interface LoDashStatic {
+ /**
+ * Creates a slice of array with n elements taken from the end.
+ *
+ * @param array The array to query.
+ * @param n The number of elements to take.
+ * @return Returns the slice of array.
+ */
+ takeRight<T>(
+ array: List<T>,
+ n?: number
+ ): T[];
+ }
+
+ interface LoDashImplicitArrayWrapper<T> {
+ /**
+ * @see _.takeRight
+ */
+ takeRight(n?: number): LoDashImplicitArrayWrapper<T>;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.takeRight
+ */
+ takeRight<TResult>(n?: number): LoDashImplicitArrayWrapper<TResult>;
+ }
+
+ interface LoDashExplicitArrayWrapper<T> {
+ /**
+ * @see _.takeRight
+ */
+ takeRight(n?: number): LoDashExplicitArrayWrapper<T>;
+ }
+
+ interface LoDashExplicitObjectWrapper<T> {
+ /**
+ * @see _.takeRight
+ */
+ takeRight<TResult>(n?: number): LoDashExplicitArrayWrapper<TResult>;
+ }
+
+ //_.takeRightWhile
+ interface LoDashStatic {
+ /**
+ * Creates a slice of array with elements taken from the end. Elements are taken until predicate returns
+ * falsey. The predicate is bound to thisArg and invoked with three arguments: (value, index, array).
+ *
+ * If a property name is provided for predicate the created _.property style callback returns the property
+ * value of the given element.
+ *
+ * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for
+ * elements that have a matching property value, else false.
+ *
+ * If an object is provided for predicate the created _.matches style callback returns true for elements that
+ * have the properties of the given object, else false.
+ *
+ * @param array The array to query.
+ * @param predicate The function invoked per iteration.
+ * @param thisArg The this binding of predicate.
+ * @return Returns the slice of array.
+ */
+ takeRightWhile<TValue>(
+ array: List<TValue>,
+ predicate?: ListIterator<TValue, boolean>,
+ thisArg?: any
+ ): TValue[];
+
+ /**
+ * @see _.takeRightWhile
+ */
+ takeRightWhile<TValue>(
+ array: List<TValue>,
+ predicate?: string,
+ thisArg?: any
+ ): TValue[];
+
+ /**
+ * @see _.takeRightWhile
+ */
+ takeRightWhile<TWhere, TValue>(
+ array: List<TValue>,
+ predicate?: TWhere
+ ): TValue[];
+ }
+
+ interface LoDashImplicitArrayWrapper<T> {
+ /**
+ * @see _.takeRightWhile
+ */
+ takeRightWhile(
+ predicate?: ListIterator<T, boolean>,
+ thisArg?: any
+ ): LoDashImplicitArrayWrapper<T>;
+
+ /**
+ * @see _.takeRightWhile
+ */
+ takeRightWhile(
+ predicate?: string,
+ thisArg?: any
+ ): LoDashImplicitArrayWrapper<T>;
+
+ /**
+ * @see _.takeRightWhile
+ */
+ takeRightWhile<TWhere>(
+ predicate?: TWhere
+ ): LoDashImplicitArrayWrapper<T>;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.takeRightWhile
+ */
+ takeRightWhile<TValue>(
+ predicate?: ListIterator<TValue, boolean>,
+ thisArg?: any
+ ): LoDashImplicitArrayWrapper<TValue>;
+
+ /**
+ * @see _.takeRightWhile
+ */
+ takeRightWhile<TValue>(
+ predicate?: string,
+ thisArg?: any
+ ): LoDashImplicitArrayWrapper<TValue>;
+
+ /**
+ * @see _.takeRightWhile
+ */
+ takeRightWhile<TWhere, TValue>(
+ predicate?: TWhere
+ ): LoDashImplicitArrayWrapper<TValue>;
+ }
+
+ interface LoDashExplicitArrayWrapper<T> {
+ /**
+ * @see _.takeRightWhile
+ */
+ takeRightWhile(
+ predicate?: ListIterator<T, boolean>,
+ thisArg?: any
+ ): LoDashExplicitArrayWrapper<T>;
+
+ /**
+ * @see _.takeRightWhile
+ */
+ takeRightWhile(
+ predicate?: string,
+ thisArg?: any
+ ): LoDashExplicitArrayWrapper<T>;
+
+ /**
+ * @see _.takeRightWhile
+ */
+ takeRightWhile<TWhere>(
+ predicate?: TWhere
+ ): LoDashExplicitArrayWrapper<T>;
+ }
+
+ interface LoDashExplicitObjectWrapper<T> {
+ /**
+ * @see _.takeRightWhile
+ */
+ takeRightWhile<TValue>(
+ predicate?: ListIterator<TValue, boolean>,
+ thisArg?: any
+ ): LoDashExplicitArrayWrapper<TValue>;
+
+ /**
+ * @see _.takeRightWhile
+ */
+ takeRightWhile<TValue>(
+ predicate?: string,
+ thisArg?: any
+ ): LoDashExplicitArrayWrapper<TValue>;
+
+ /**
+ * @see _.takeRightWhile
+ */
+ takeRightWhile<TWhere, TValue>(
+ predicate?: TWhere
+ ): LoDashExplicitArrayWrapper<TValue>;
+ }
+
+ //_.takeWhile
+ interface LoDashStatic {
+ /**
+ * Creates a slice of array with elements taken from the beginning. Elements are taken until predicate returns
+ * falsey. The predicate is bound to thisArg and invoked with three arguments: (value, index, array).
+ *
+ * If a property name is provided for predicate the created _.property style callback returns the property
+ * value of the given element.
+ *
+ * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for
+ * elements that have a matching property value, else false.
+ *
+ * If an object is provided for predicate the created _.matches style callback returns true for elements that
+ * have the properties of the given object, else false.
+ *
+ * @param array The array to query.
+ * @param predicate The function invoked per iteration.
+ * @param thisArg The this binding of predicate.
+ * @return Returns the slice of array.
+ */
+ takeWhile<TValue>(
+ array: List<TValue>,
+ predicate?: ListIterator<TValue, boolean>,
+ thisArg?: any
+ ): TValue[];
+
+ /**
+ * @see _.takeWhile
+ */
+ takeWhile<TValue>(
+ array: List<TValue>,
+ predicate?: string,
+ thisArg?: any
+ ): TValue[];
+
+ /**
+ * @see _.takeWhile
+ */
+ takeWhile<TWhere, TValue>(
+ array: List<TValue>,
+ predicate?: TWhere
+ ): TValue[];
+ }
+
+ interface LoDashImplicitArrayWrapper<T> {
+ /**
+ * @see _.takeWhile
+ */
+ takeWhile(
+ predicate?: ListIterator<T, boolean>,
+ thisArg?: any
+ ): LoDashImplicitArrayWrapper<T>;
+
+ /**
+ * @see _.takeWhile
+ */
+ takeWhile(
+ predicate?: string,
+ thisArg?: any
+ ): LoDashImplicitArrayWrapper<T>;
+
+ /**
+ * @see _.takeWhile
+ */
+ takeWhile<TWhere>(
+ predicate?: TWhere
+ ): LoDashImplicitArrayWrapper<T>;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.takeWhile
+ */
+ takeWhile<TValue>(
+ predicate?: ListIterator<TValue, boolean>,
+ thisArg?: any
+ ): LoDashImplicitArrayWrapper<TValue>;
+
+ /**
+ * @see _.takeWhile
+ */
+ takeWhile<TValue>(
+ predicate?: string,
+ thisArg?: any
+ ): LoDashImplicitArrayWrapper<TValue>;
+
+ /**
+ * @see _.takeWhile
+ */
+ takeWhile<TWhere, TValue>(
+ predicate?: TWhere
+ ): LoDashImplicitArrayWrapper<TValue>;
+ }
+
+ interface LoDashExplicitArrayWrapper<T> {
+ /**
+ * @see _.takeWhile
+ */
+ takeWhile(
+ predicate?: ListIterator<T, boolean>,
+ thisArg?: any
+ ): LoDashExplicitArrayWrapper<T>;
+
+ /**
+ * @see _.takeWhile
+ */
+ takeWhile(
+ predicate?: string,
+ thisArg?: any
+ ): LoDashExplicitArrayWrapper<T>;
+
+ /**
+ * @see _.takeWhile
+ */
+ takeWhile<TWhere>(
+ predicate?: TWhere
+ ): LoDashExplicitArrayWrapper<T>;
+ }
+
+ interface LoDashExplicitObjectWrapper<T> {
+ /**
+ * @see _.takeWhile
+ */
+ takeWhile<TValue>(
+ predicate?: ListIterator<TValue, boolean>,
+ thisArg?: any
+ ): LoDashExplicitArrayWrapper<TValue>;
+
+ /**
+ * @see _.takeWhile
+ */
+ takeWhile<TValue>(
+ predicate?: string,
+ thisArg?: any
+ ): LoDashExplicitArrayWrapper<TValue>;
+
+ /**
+ * @see _.takeWhile
+ */
+ takeWhile<TWhere, TValue>(
+ predicate?: TWhere
+ ): LoDashExplicitArrayWrapper<TValue>;
+ }
+
+ //_.union
+ interface LoDashStatic {
+ /**
+ * Creates an array of unique values, in order, from all of the provided arrays using SameValueZero for
+ * equality comparisons.
+ *
+ * @param arrays The arrays to inspect.
+ * @return Returns the new array of combined values.
+ */
+ union<T>(...arrays: List<T>[]): T[];
+ }
+
+ interface LoDashImplicitArrayWrapper<T> {
+ /**
+ * @see _.union
+ */
+ union(...arrays: List<T>[]): LoDashImplicitArrayWrapper<T>;
+
+ /**
+ * @see _.union
+ */
+ union<T>(...arrays: List<T>[]): LoDashImplicitArrayWrapper<T>;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.union
+ */
+ union<T>(...arrays: List<T>[]): LoDashImplicitArrayWrapper<T>;
+ }
+
+ interface LoDashExplicitArrayWrapper<T> {
+ /**
+ * @see _.union
+ */
+ union(...arrays: List<T>[]): LoDashExplicitArrayWrapper<T>;
+
+ /**
+ * @see _.union
+ */
+ union<T>(...arrays: List<T>[]): LoDashExplicitArrayWrapper<T>;
+ }
+
+ interface LoDashExplicitObjectWrapper<T> {
+ /**
+ * @see _.union
+ */
+ union<T>(...arrays: List<T>[]): LoDashExplicitArrayWrapper<T>;
+ }
+
+ //_.uniq
+ interface LoDashStatic {
+ /**
+ * Creates a duplicate-free version of an array, using
+ * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
+ * for equality comparisons, in which only the first occurrence of each element
+ * is kept.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} array The array to inspect.
+ * @returns {Array} Returns the new duplicate free array.
+ * @example
+ *
+ * _.uniq([2, 1, 2]);
+ * // => [2, 1]
+ */
+ uniq<T>(
+ array: List<T>
+ ): T[];
+
+ /**
+ * @see _.uniq
+ */
+ uniq<T, TSort>(
+ array: List<T>
+ ): T[];
+ }
+
+ interface LoDashImplicitWrapper<T> {
+ /**
+ * @see _.uniq
+ */
+ uniq<TSort>(): LoDashImplicitArrayWrapper<T>;
+ }
+
+ interface LoDashImplicitArrayWrapper<T> {
+ /**
+ * @see _.uniq
+ */
+ uniq<TSort>(): LoDashImplicitArrayWrapper<T>;
+
+ /**
+ * @see _.uniq
+ */
+ uniq(): LoDashImplicitArrayWrapper<T>;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ uniq<T>(): LoDashImplicitArrayWrapper<T>;
+
+ /**
+ * @see _.uniq
+ */
+ uniq<T, TSort>(): LoDashImplicitArrayWrapper<T>;
+ }
+
+ interface LoDashExplicitWrapper<T> {
+ /**
+ * @see _.uniq
+ */
+ uniq<TSort>(): LoDashExplicitArrayWrapper<T>;
+ }
+
+ interface LoDashExplicitArrayWrapper<T> {
+ /**
+ * @see _.uniq
+ */
+ uniq<TSort>(): LoDashExplicitArrayWrapper<T>;
+
+ /**
+ * @see _.uniq
+ */
+ uniq(): LoDashExplicitArrayWrapper<T>;
+ }
+
+ interface LoDashExplicitObjectWrapper<T> {
+ /**
+ * @see _.uniq
+ */
+ uniq<T>(): LoDashExplicitArrayWrapper<T>;
+
+ /**
+ * @see _.uniq
+ */
+ uniq<T, TSort>(): LoDashExplicitArrayWrapper<T>;
+ }
+
+ //_.uniqBy
+ interface LoDashStatic {
+ /**
+ * This method is like `_.uniq` except that it accepts `iteratee` which is
+ * invoked for each element in `array` to generate the criterion by which
+ * uniqueness is computed. The iteratee is invoked with one argument: (value).
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} array The array to inspect.
+ * @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element.
+ * @returns {Array} Returns the new duplicate free array.
+ * @example
+ *
+ * _.uniqBy([2.1, 1.2, 2.3], Math.floor);
+ * // => [2.1, 1.2]
+ *
+ * // using the `_.property` iteratee shorthand
+ * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
+ * // => [{ 'x': 1 }, { 'x': 2 }]
+ */
+ uniqBy<T>(
+ array: List<T>,
+ iteratee: ListIterator<T, any>
+ ): T[];
+
+ /**
+ * @see _.uniqBy
+ */
+ uniqBy<T, TSort>(
+ array: List<T>,
+ iteratee: ListIterator<T, TSort>
+ ): T[];
+
+ /**
+ * @see _.uniqBy
+ */
+ uniqBy<T>(
+ array: List<T>,
+ iteratee: string
+ ): T[];
+
+ /**
+ * @see _.uniqBy
+ */
+ uniqBy<T>(
+ array: List<T>,
+ iteratee: Object
+ ): T[];
+
+ /**
+ * @see _.uniqBy
+ */
+ uniqBy<TWhere extends {}, T>(
+ array: List<T>,
+ iteratee: TWhere
+ ): T[];
+ }
+
+ interface LoDashImplicitWrapper<T> {
+ /**
+ * @see _.uniqBy
+ */
+ uniqBy<TSort>(
+ iteratee: ListIterator<T, TSort>
+ ): LoDashImplicitArrayWrapper<T>;
+ }
+
+ interface LoDashImplicitArrayWrapper<T> {
+ /**
+ * @see _.uniqBy
+ */
+ uniqBy<TSort>(
+ iteratee: ListIterator<T, TSort>
+ ): LoDashImplicitArrayWrapper<T>;
+
+ /**
+ * @see _.uniqBy
+ */
+ uniqBy(
+ iteratee: string
+ ): LoDashImplicitArrayWrapper<T>;
+
+ /**
+ * @see _.uniqBy
+ */
+ uniqBy<TWhere extends {}>(
+ iteratee: TWhere
+ ): LoDashImplicitArrayWrapper<T>;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.uniqBy
+ */
+ uniqBy<T>(
+ iteratee: ListIterator<T, any>
+ ): LoDashImplicitArrayWrapper<T>;
+
+ /**
+ * @see _.uniqBy
+ */
+ uniqBy<T, TSort>(
+ iteratee: ListIterator<T, TSort>
+ ): LoDashImplicitArrayWrapper<T>;
+
+ /**
+ * @see _.uniqBy
+ */
+ uniqBy<T>(
+ iteratee: string
+ ): LoDashImplicitArrayWrapper<T>;
+
+ /**
+ * @see _.uniqBy
+ */
+ uniqBy<T>(
+ iteratee: Object
+ ): LoDashImplicitArrayWrapper<T>;
+
+ /**
+ * @see _.uniqBy
+ */
+ uniqBy<TWhere extends {}, T>(
+ iteratee: TWhere
+ ): LoDashImplicitArrayWrapper<T>;
+ }
+
+ interface LoDashExplicitWrapper<T> {
+ /**
+ * @see _.uniqBy
+ */
+ uniqBy<TSort>(
+ iteratee: ListIterator<T, TSort>
+ ): LoDashExplicitArrayWrapper<T>;
+ }
+
+ interface LoDashExplicitArrayWrapper<T> {
+ /**
+ * @see _.uniqBy
+ */
+ uniqBy<TSort>(
+ iteratee: ListIterator<T, TSort>
+ ): LoDashExplicitArrayWrapper<T>;
+
+ /**
+ * @see _.uniqBy
+ */
+ uniqBy(
+ iteratee: string
+ ): LoDashExplicitArrayWrapper<T>;
+
+ /**
+ * @see _.uniqBy
+ */
+ uniqBy<TWhere extends {}>(
+ iteratee: TWhere
+ ): LoDashExplicitArrayWrapper<T>;
+ }
+
+ interface LoDashExplicitObjectWrapper<T> {
+ /**
+ * @see _.uniqBy
+ */
+ uniqBy<T>(
+ iteratee: ListIterator<T, any>
+ ): LoDashExplicitArrayWrapper<T>;
+
+ /**
+ * @see _.uniqBy
+ */
+ uniqBy<T, TSort>(
+ iteratee: ListIterator<T, TSort>
+ ): LoDashExplicitArrayWrapper<T>;
+
+ /**
+ * @see _.uniqBy
+ */
+ uniqBy<T>(
+ iteratee: string
+ ): LoDashExplicitArrayWrapper<T>;
+
+ /**
+ * @see _.uniqBy
+ */
+ uniqBy<T>(
+ iteratee: Object
+ ): LoDashExplicitArrayWrapper<T>;
+
+ /**
+ * @see _.uniqBy
+ */
+ uniqBy<TWhere extends {}, T>(
+ iteratee: TWhere
+ ): LoDashExplicitArrayWrapper<T>;
+ }
+
+ //_.sortedUniq
+ interface LoDashStatic {
+ /**
+ * This method is like `_.uniq` except that it's designed and optimized
+ * for sorted arrays.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} array The array to inspect.
+ * @returns {Array} Returns the new duplicate free array.
+ * @example
+ *
+ * _.sortedUniq([1, 1, 2]);
+ * // => [1, 2]
+ */
+ sortedUniq<T>(
+ array: List<T>
+ ): T[];
+
+ /**
+ * @see _.sortedUniq
+ */
+ sortedUniq<T, TSort>(
+ array: List<T>
+ ): T[];
+ }
+
+ interface LoDashImplicitWrapper<T> {
+ /**
+ * @see _.sortedUniq
+ */
+ sortedUniq<TSort>(): LoDashImplicitArrayWrapper<T>;
+ }
+
+ interface LoDashImplicitArrayWrapper<T> {
+ /**
+ * @see _.sortedUniq
+ */
+ sortedUniq<TSort>(): LoDashImplicitArrayWrapper<T>;
+
+ /**
+ * @see _.sortedUniq
+ */
+ sortedUniq(): LoDashImplicitArrayWrapper<T>;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ sortedUniq<T>(): LoDashImplicitArrayWrapper<T>;
+
+ /**
+ * @see _.sortedUniq
+ */
+ sortedUniq<T, TSort>(): LoDashImplicitArrayWrapper<T>;
+ }
+
+ interface LoDashExplicitWrapper<T> {
+ /**
+ * @see _.sortedUniq
+ */
+ sortedUniq<TSort>(): LoDashExplicitArrayWrapper<T>;
+ }
+
+ interface LoDashExplicitArrayWrapper<T> {
+ /**
+ * @see _.sortedUniq
+ */
+ sortedUniq<TSort>(): LoDashExplicitArrayWrapper<T>;
+
+ /**
+ * @see _.sortedUniq
+ */
+ sortedUniq(): LoDashExplicitArrayWrapper<T>;
+ }
+
+ interface LoDashExplicitObjectWrapper<T> {
+ /**
+ * @see _.sortedUniq
+ */
+ sortedUniq<T>(): LoDashExplicitArrayWrapper<T>;
+
+ /**
+ * @see _.sortedUniq
+ */
+ sortedUniq<T, TSort>(): LoDashExplicitArrayWrapper<T>;
+ }
+
+ //_.sortedUniqBy
+ interface LoDashStatic {
+ /**
+ * This method is like `_.uniqBy` except that it's designed and optimized
+ * for sorted arrays.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} array The array to inspect.
+ * @param {Function} [iteratee] The iteratee invoked per element.
+ * @returns {Array} Returns the new duplicate free array.
+ * @example
+ *
+ * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);
+ * // => [1.1, 2.2]
+ */
+ sortedUniqBy<T>(
+ array: List<T>,
+ iteratee: ListIterator<T, any>
+ ): T[];
+
+ /**
+ * @see _.sortedUniqBy
+ */
+ sortedUniqBy<T, TSort>(
+ array: List<T>,
+ iteratee: ListIterator<T, TSort>
+ ): T[];
+
+ /**
+ * @see _.sortedUniqBy
+ */
+ sortedUniqBy<T>(
+ array: List<T>,
+ iteratee: string
+ ): T[];
+
+ /**
+ * @see _.sortedUniqBy
+ */
+ sortedUniqBy<T>(
+ array: List<T>,
+ iteratee: Object
+ ): T[];
+
+ /**
+ * @see _.sortedUniqBy
+ */
+ sortedUniqBy<TWhere extends {}, T>(
+ array: List<T>,
+ iteratee: TWhere
+ ): T[];
+ }
+
+ interface LoDashImplicitWrapper<T> {
+ /**
+ * @see _.sortedUniqBy
+ */
+ sortedUniqBy<TSort>(
+ iteratee: ListIterator<T, TSort>
+ ): LoDashImplicitArrayWrapper<T>;
+ }
+
+ interface LoDashImplicitArrayWrapper<T> {
+ /**
+ * @see _.sortedUniqBy
+ */
+ sortedUniqBy<TSort>(
+ iteratee: ListIterator<T, TSort>
+ ): LoDashImplicitArrayWrapper<T>;
+
+ /**
+ * @see _.sortedUniqBy
+ */
+ sortedUniqBy(
+ iteratee: string
+ ): LoDashImplicitArrayWrapper<T>;
+
+ /**
+ * @see _.sortedUniqBy
+ */
+ sortedUniqBy<TWhere extends {}>(
+ iteratee: TWhere
+ ): LoDashImplicitArrayWrapper<T>;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.sortedUniqBy
+ */
+ sortedUniqBy<T>(
+ iteratee: ListIterator<T, any>
+ ): LoDashImplicitArrayWrapper<T>;
+
+ /**
+ * @see _.sortedUniqBy
+ */
+ sortedUniqBy<T, TSort>(
+ iteratee: ListIterator<T, TSort>
+ ): LoDashImplicitArrayWrapper<T>;
+
+ /**
+ * @see _.sortedUniqBy
+ */
+ sortedUniqBy<T>(
+ iteratee: string
+ ): LoDashImplicitArrayWrapper<T>;
+
+ /**
+ * @see _.sortedUniqBy
+ */
+ sortedUniqBy<T>(
+ iteratee: Object
+ ): LoDashImplicitArrayWrapper<T>;
+
+ /**
+ * @see _.sortedUniqBy
+ */
+ sortedUniqBy<TWhere extends {}, T>(
+ iteratee: TWhere
+ ): LoDashImplicitArrayWrapper<T>;
+ }
+
+ interface LoDashExplicitWrapper<T> {
+ /**
+ * @see _.sortedUniqBy
+ */
+ sortedUniqBy<TSort>(
+ iteratee: ListIterator<T, TSort>
+ ): LoDashExplicitArrayWrapper<T>;
+ }
+
+ interface LoDashExplicitArrayWrapper<T> {
+ /**
+ * @see _.sortedUniqBy
+ */
+ sortedUniqBy<TSort>(
+ iteratee: ListIterator<T, TSort>
+ ): LoDashExplicitArrayWrapper<T>;
+
+ /**
+ * @see _.sortedUniqBy
+ */
+ sortedUniqBy(
+ iteratee: string
+ ): LoDashExplicitArrayWrapper<T>;
+
+ /**
+ * @see _.sortedUniqBy
+ */
+ sortedUniqBy<TWhere extends {}>(
+ iteratee: TWhere
+ ): LoDashExplicitArrayWrapper<T>;
+ }
+
+ interface LoDashExplicitObjectWrapper<T> {
+ /**
+ * @see _.sortedUniqBy
+ */
+ sortedUniqBy<T>(
+ iteratee: ListIterator<T, any>
+ ): LoDashExplicitArrayWrapper<T>;
+
+ /**
+ * @see _.sortedUniqBy
+ */
+ sortedUniqBy<T, TSort>(
+ iteratee: ListIterator<T, TSort>
+ ): LoDashExplicitArrayWrapper<T>;
+
+ /**
+ * @see _.sortedUniqBy
+ */
+ sortedUniqBy<T>(
+ iteratee: string
+ ): LoDashExplicitArrayWrapper<T>;
+
+ /**
+ * @see _.sortedUniqBy
+ */
+ sortedUniqBy<T>(
+ iteratee: Object
+ ): LoDashExplicitArrayWrapper<T>;
+
+ /**
+ * @see _.sortedUniqBy
+ */
+ sortedUniqBy<TWhere extends {}, T>(
+ iteratee: TWhere
+ ): LoDashExplicitArrayWrapper<T>;
+ }
+
+ //_.unionBy DUMMY
+ interface LoDashStatic {
+ /**
+ * This method is like `_.union` except that it accepts `iteratee` which is
+ * invoked for each element of each `arrays` to generate the criterion by which
+ * uniqueness is computed. The iteratee is invoked with one argument: (value).
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {...Array} [arrays] The arrays to inspect.
+ * @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element.
+ * @returns {Array} Returns the new array of combined values.
+ * @example
+ *
+ * _.unionBy([2.1, 1.2], [4.3, 2.4], Math.floor);
+ * // => [2.1, 1.2, 4.3]
+ *
+ * // using the `_.property` iteratee shorthand
+ * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
+ * // => [{ 'x': 1 }, { 'x': 2 }]
+ */
+ unionBy(
+ array: any[]|List<any>,
+ ...values: any[]
+ ): any[];
+ }
+
+ //_.unionWith DUMMY
+ interface LoDashStatic {
+ /**
+ * This method is like `_.union` except that it accepts `comparator` which
+ * is invoked to compare elements of `arrays`. The comparator is invoked
+ * with two arguments: (arrVal, othVal).
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {...Array} [arrays] The arrays to inspect.
+ * @param {Function} [comparator] The comparator invoked per element.
+ * @returns {Array} Returns the new array of combined values.
+ * @example
+ *
+ * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
+ * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
+ *
+ * _.unionWith(objects, others, _.isEqual);
+ * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
+ */
+ unionWith(
+ array: any[]|List<any>,
+ ...values: any[]
+ ): any[];
+ }
+
+ //_.uniqWith DUMMY
+ interface LoDashStatic {
+ /**
+ * This method is like `_.uniq` except that it accepts `comparator` which
+ * is invoked to compare elements of `array`. The comparator is invoked with
+ * two arguments: (arrVal, othVal).
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} array The array to inspect.
+ * @param {Function} [comparator] The comparator invoked per element.
+ * @returns {Array} Returns the new duplicate free array.
+ * @example
+ *
+ * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }];
+ *
+ * _.uniqWith(objects, _.isEqual);
+ * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]
+ */
+ uniqWith(
+ array: any[]|List<any>,
+ ...values: any[]
+ ): any[];
+ }
+
+ //_.unzip
+ interface LoDashStatic {
+ /**
+ * This method is like _.zip except that it accepts an array of grouped elements and creates an array
+ * regrouping the elements to their pre-zip configuration.
+ *
+ * @param array The array of grouped elements to process.
+ * @return Returns the new array of regrouped elements.
+ */
+ unzip<T>(array: List<List<T>>): T[][];
+ }
+
+ interface LoDashImplicitArrayWrapper<T> {
+ /**
+ * @see _.unzip
+ */
+ unzip<T>(): LoDashImplicitArrayWrapper<T[]>;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.unzip
+ */
+ unzip<T>(): LoDashImplicitArrayWrapper<T[]>;
+ }
+
+ interface LoDashExplicitArrayWrapper<T> {
+ /**
+ * @see _.unzip
+ */
+ unzip<T>(): LoDashExplicitArrayWrapper<T[]>;
+ }
+
+ interface LoDashExplicitObjectWrapper<T> {
+ /**
+ * @see _.unzip
+ */
+ unzip<T>(): LoDashExplicitArrayWrapper<T[]>;
+ }
+
+ //_.unzipWith
+ interface LoDashStatic {
+ /**
+ * This method is like _.unzip except that it accepts an iteratee to specify how regrouped values should be
+ * combined. The iteratee is bound to thisArg and invoked with four arguments: (accumulator, value, index,
+ * group).
+ *
+ * @param array The array of grouped elements to process.
+ * @param iteratee The function to combine regrouped values.
+ * @param thisArg The this binding of iteratee.
+ * @return Returns the new array of regrouped elements.
+ */
+ unzipWith<TArray, TResult>(
+ array: List<List<TArray>>,
+ iteratee?: MemoIterator<TArray, TResult>,
+ thisArg?: any
+ ): TResult[];
+ }
+
+ interface LoDashImplicitArrayWrapper<T> {
+ /**
+ * @see _.unzipWith
+ */
+ unzipWith<TArr, TResult>(
+ iteratee?: MemoIterator<TArr, TResult>,
+ thisArg?: any
+ ): LoDashImplicitArrayWrapper<TResult>;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.unzipWith
+ */
+ unzipWith<TArr, TResult>(
+ iteratee?: MemoIterator<TArr, TResult>,
+ thisArg?: any
+ ): LoDashImplicitArrayWrapper<TResult>;
+ }
+
+ //_.without
+ interface LoDashStatic {
+ /**
+ * Creates an array excluding all provided values using SameValueZero for equality comparisons.
+ *
+ * @param array The array to filter.
+ * @param values The values to exclude.
+ * @return Returns the new array of filtered values.
+ */
+ without<T>(
+ array: List<T>,
+ ...values: T[]
+ ): T[];
+ }
+
+ interface LoDashImplicitArrayWrapper<T> {
+ /**
+ * @see _.without
+ */
+ without(...values: T[]): LoDashImplicitArrayWrapper<T>;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.without
+ */
+ without<T>(...values: T[]): LoDashImplicitArrayWrapper<T>;
+ }
+
+ interface LoDashExplicitArrayWrapper<T> {
+ /**
+ * @see _.without
+ */
+ without(...values: T[]): LoDashExplicitArrayWrapper<T>;
+ }
+
+ interface LoDashExplicitObjectWrapper<T> {
+ /**
+ * @see _.without
+ */
+ without<T>(...values: T[]): LoDashExplicitArrayWrapper<T>;
+ }
+
+ //_.xor
+ interface LoDashStatic {
+ /**
+ * Creates an array of unique values that is the symmetric difference of the provided arrays.
+ *
+ * @param arrays The arrays to inspect.
+ * @return Returns the new array of values.
+ */
+ xor<T>(...arrays: List<T>[]): T[];
+ }
+
+ interface LoDashImplicitArrayWrapper<T> {
+ /**
+ * @see _.xor
+ */
+ xor(...arrays: List<T>[]): LoDashImplicitArrayWrapper<T>;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.xor
+ */
+ xor<T>(...arrays: List<T>[]): LoDashImplicitArrayWrapper<T>;
+ }
+
+ interface LoDashExplicitArrayWrapper<T> {
+ /**
+ * @see _.xor
+ */
+ xor(...arrays: List<T>[]): LoDashExplicitArrayWrapper<T>;
+ }
+
+ interface LoDashExplicitObjectWrapper<T> {
+ /**
+ * @see _.xor
+ */
+ xor<T>(...arrays: List<T>[]): LoDashExplicitArrayWrapper<T>;
+ }
+
+ //_.xorBy DUMMY
+ interface LoDashStatic {
+ /**
+ * This method is like `_.xor` except that it accepts `iteratee` which is
+ * invoked for each element of each `arrays` to generate the criterion by which
+ * uniqueness is computed. The iteratee is invoked with one argument: (value).
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {...Array} [arrays] The arrays to inspect.
+ * @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element.
+ * @returns {Array} Returns the new array of values.
+ * @example
+ *
+ * _.xorBy([2.1, 1.2], [4.3, 2.4], Math.floor);
+ * // => [1.2, 4.3]
+ *
+ * // using the `_.property` iteratee shorthand
+ * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
+ * // => [{ 'x': 2 }]
+ */
+ xorBy(
+ array: any[]|List<any>,
+ ...values: any[]
+ ): any[];
+ }
+
+ //_.xorWith DUMMY
+ interface LoDashStatic {
+ /**
+ * This method is like `_.xor` except that it accepts `comparator` which is
+ * invoked to compare elements of `arrays`. The comparator is invoked with
+ * two arguments: (arrVal, othVal).
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {...Array} [arrays] The arrays to inspect.
+ * @param {Function} [comparator] The comparator invoked per element.
+ * @returns {Array} Returns the new array of values.
+ * @example
+ *
+ * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
+ * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
+ *
+ * _.xorWith(objects, others, _.isEqual);
+ * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
+ */
+ xorWith(
+ array: any[]|List<any>,
+ ...values: any[]
+ ): any[];
+ }
+
+ //_.zip
+ interface LoDashStatic {
+ /**
+ * Creates an array of grouped elements, the first of which contains the first elements of the given arrays,
+ * the second of which contains the second elements of the given arrays, and so on.
+ *
+ * @param arrays The arrays to process.
+ * @return Returns the new array of grouped elements.
+ */
+ zip<T>(...arrays: List<T>[]): T[][];
+ }
+
+ interface LoDashImplicitArrayWrapper<T> {
+ /**
+ * @see _.zip
+ */
+ zip<T>(...arrays: List<T>[]): _.LoDashImplicitArrayWrapper<T[]>;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.zip
+ */
+ zip<T>(...arrays: List<T>[]): _.LoDashImplicitArrayWrapper<T[]>;
+ }
+
+ interface LoDashExplicitArrayWrapper<T> {
+ /**
+ * @see _.zip
+ */
+ zip<T>(...arrays: List<T>[]): _.LoDashExplicitArrayWrapper<T[]>;
+ }
+
+ interface LoDashExplicitObjectWrapper<T> {
+ /**
+ * @see _.zip
+ */
+ zip<T>(...arrays: List<T>[]): _.LoDashExplicitArrayWrapper<T[]>;
+ }
+
+ //_.zipObject
+ interface LoDashStatic {
+ /**
+ * The inverse of _.pairs; this method returns an object composed from arrays of property names and values.
+ * Provide either a single two dimensional array, e.g. [[key1, value1], [key2, value2]] or two arrays, one of
+ * property names and one of corresponding values.
+ *
+ * @param props The property names.
+ * @param values The property values.
+ * @return Returns the new object.
+ */
+ zipObject<TValues, TResult extends {}>(
+ props: List<StringRepresentable>|List<List<any>>,
+ values?: List<TValues>
+ ): TResult;
+
+ /**
+ * @see _.zipObject
+ */
+ zipObject<TResult extends {}>(
+ props: List<StringRepresentable>|List<List<any>>,
+ values?: List<any>
+ ): TResult;
+
+ /**
+ * @see _.zipObject
+ */
+ zipObject(
+ props: List<StringRepresentable>|List<List<any>>,
+ values?: List<any>
+ ): _.Dictionary<any>;
+ }
+
+ interface LoDashImplicitArrayWrapper<T> {
+ /**
+ * @see _.zipObject
+ */
+ zipObject<TValues, TResult extends {}>(
+ values?: List<TValues>
+ ): _.LoDashImplicitObjectWrapper<TResult>;
+
+ /**
+ * @see _.zipObject
+ */
+ zipObject<TResult extends {}>(
+ values?: List<any>
+ ): _.LoDashImplicitObjectWrapper<TResult>;
+
+ /**
+ * @see _.zipObject
+ */
+ zipObject(
+ values?: List<any>
+ ): _.LoDashImplicitObjectWrapper<_.Dictionary<any>>;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.zipObject
+ */
+ zipObject<TValues, TResult extends {}>(
+ values?: List<TValues>
+ ): _.LoDashImplicitObjectWrapper<TResult>;
+
+ /**
+ * @see _.zipObject
+ */
+ zipObject<TResult extends {}>(
+ values?: List<any>
+ ): _.LoDashImplicitObjectWrapper<TResult>;
+
+ /**
+ * @see _.zipObject
+ */
+ zipObject(
+ values?: List<any>
+ ): _.LoDashImplicitObjectWrapper<_.Dictionary<any>>;
+ }
+
+ interface LoDashExplicitArrayWrapper<T> {
+ /**
+ * @see _.zipObject
+ */
+ zipObject<TValues, TResult extends {}>(
+ values?: List<TValues>
+ ): _.LoDashExplicitObjectWrapper<TResult>;
+
+ /**
+ * @see _.zipObject
+ */
+ zipObject<TResult extends {}>(
+ values?: List<any>
+ ): _.LoDashExplicitObjectWrapper<TResult>;
+
+ /**
+ * @see _.zipObject
+ */
+ zipObject(
+ values?: List<any>
+ ): _.LoDashExplicitObjectWrapper<_.Dictionary<any>>;
+ }
+
+ interface LoDashExplicitObjectWrapper<T> {
+ /**
+ * @see _.zipObject
+ */
+ zipObject<TValues, TResult extends {}>(
+ values?: List<TValues>
+ ): _.LoDashExplicitObjectWrapper<TResult>;
+
+ /**
+ * @see _.zipObject
+ */
+ zipObject<TResult extends {}>(
+ values?: List<any>
+ ): _.LoDashExplicitObjectWrapper<TResult>;
+
+ /**
+ * @see _.zipObject
+ */
+ zipObject(
+ values?: List<any>
+ ): _.LoDashExplicitObjectWrapper<_.Dictionary<any>>;
+ }
+
+ //_.zipWith
+ interface LoDashStatic {
+ /**
+ * This method is like _.zip except that it accepts an iteratee to specify how grouped values should be
+ * combined. The iteratee is bound to thisArg and invoked with four arguments: (accumulator, value, index,
+ * group).
+ * @param {...Array} [arrays] The arrays to process.
+ * @param {Function} [iteratee] The function to combine grouped values.
+ * @param {*} [thisArg] The `this` binding of `iteratee`.
+ * @return Returns the new array of grouped elements.
+ */
+ zipWith<TResult>(...args: any[]): TResult[];
+ }
+
+ interface LoDashImplicitArrayWrapper<T> {
+ /**
+ * @see _.zipWith
+ */
+ zipWith<TResult>(...args: any[]): LoDashImplicitArrayWrapper<TResult>;
+ }
+
+ /*********
+ * Chain *
+ *********/
+
+ //_.chain
+ interface LoDashStatic {
+ /**
+ * Creates a lodash object that wraps value with explicit method chaining enabled.
+ *
+ * @param value The value to wrap.
+ * @return Returns the new lodash wrapper instance.
+ */
+ chain(value: number): LoDashExplicitWrapper<number>;
+ chain(value: string): LoDashExplicitWrapper<string>;
+ chain(value: boolean): LoDashExplicitWrapper<boolean>;
+ chain<T>(value: T[]): LoDashExplicitArrayWrapper<T>;
+ chain<T extends {}>(value: T): LoDashExplicitObjectWrapper<T>;
+ chain(value: any): LoDashExplicitWrapper<any>;
+ }
+
+ interface LoDashImplicitWrapper<T> {
+ /**
+ * @see _.chain
+ */
+ chain(): LoDashExplicitWrapper<T>;
+ }
+
+ interface LoDashImplicitArrayWrapper<T> {
+ /**
+ * @see _.chain
+ */
+ chain(): LoDashExplicitArrayWrapper<T>;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.chain
+ */
+ chain(): LoDashExplicitObjectWrapper<T>;
+ }
+
+ interface LoDashExplicitWrapperBase<T, TWrapper> {
+ /**
+ * @see _.chain
+ */
+ chain(): TWrapper;
+ }
+
+ //_.tap
+ interface LoDashStatic {
+ /**
+ * This method invokes interceptor and returns value. The interceptor is bound to thisArg and invoked with one
+ * argument; (value). The purpose of this method is to "tap into" a method chain in order to perform operations
+ * on intermediate results within the chain.
+ *
+ * @param value The value to provide to interceptor.
+ * @param interceptor The function to invoke.
+ * @parem thisArg The this binding of interceptor.
+ * @return Returns value.
+ **/
+ tap<T>(
+ value: T,
+ interceptor: (value: T) => void,
+ thisArg?: any
+ ): T;
+ }
+
+ interface LoDashImplicitWrapperBase<T, TWrapper> {
+ /**
+ * @see _.tap
+ */
+ tap(
+ interceptor: (value: T) => void,
+ thisArg?: any
+ ): TWrapper;
+ }
+
+ interface LoDashExplicitWrapperBase<T, TWrapper> {
+ /**
+ * @see _.tap
+ */
+ tap(
+ interceptor: (value: T) => void,
+ thisArg?: any
+ ): TWrapper;
+ }
+
+ //_.thru
+ interface LoDashStatic {
+ /**
+ * This method is like _.tap except that it returns the result of interceptor.
+ *
+ * @param value The value to provide to interceptor.
+ * @param interceptor The function to invoke.
+ * @param thisArg The this binding of interceptor.
+ * @return Returns the result of interceptor.
+ */
+ thru<T, TResult>(
+ value: T,
+ interceptor: (value: T) => TResult,
+ thisArg?: any
+ ): TResult;
+ }
+
+ interface LoDashImplicitWrapperBase<T, TWrapper> {
+ /**
+ * @see _.thru
+ */
+ thru<TResult extends number>(
+ interceptor: (value: T) => TResult,
+ thisArg?: any): LoDashImplicitWrapper<TResult>;
+
+ /**
+ * @see _.thru
+ */
+ thru<TResult extends string>(
+ interceptor: (value: T) => TResult,
+ thisArg?: any): LoDashImplicitWrapper<TResult>;
+
+ /**
+ * @see _.thru
+ */
+ thru<TResult extends boolean>(
+ interceptor: (value: T) => TResult,
+ thisArg?: any): LoDashImplicitWrapper<TResult>;
+
+ /**
+ * @see _.thru
+ */
+ thru<TResult extends {}>(
+ interceptor: (value: T) => TResult,
+ thisArg?: any): LoDashImplicitObjectWrapper<TResult>;
+
+ /**
+ * @see _.thru
+ */
+ thru<TResult>(
+ interceptor: (value: T) => TResult[],
+ thisArg?: any): LoDashImplicitArrayWrapper<TResult>;
+ }
+
+ interface LoDashExplicitWrapperBase<T, TWrapper> {
+ /**
+ * @see _.thru
+ */
+ thru<TResult extends number>(
+ interceptor: (value: T) => TResult,
+ thisArg?: any
+ ): LoDashExplicitWrapper<TResult>;
+
+ /**
+ * @see _.thru
+ */
+ thru<TResult extends string>(
+ interceptor: (value: T) => TResult,
+ thisArg?: any
+ ): LoDashExplicitWrapper<TResult>;
+
+ /**
+ * @see _.thru
+ */
+ thru<TResult extends boolean>(
+ interceptor: (value: T) => TResult,
+ thisArg?: any
+ ): LoDashExplicitWrapper<TResult>;
+
+ /**
+ * @see _.thru
+ */
+ thru<TResult extends {}>(
+ interceptor: (value: T) => TResult,
+ thisArg?: any
+ ): LoDashExplicitObjectWrapper<TResult>;
+
+ /**
+ * @see _.thru
+ */
+ thru<TResult>(
+ interceptor: (value: T) => TResult[],
+ thisArg?: any
+ ): LoDashExplicitArrayWrapper<TResult>;
+ }
+
+ //_.prototype.commit
+ interface LoDashImplicitWrapperBase<T, TWrapper> {
+ /**
+ * Executes the chained sequence and returns the wrapped result.
+ *
+ * @return Returns the new lodash wrapper instance.
+ */
+ commit(): TWrapper;
+ }
+
+ interface LoDashExplicitWrapperBase<T, TWrapper> {
+ /**
+ * @see _.commit
+ */
+ commit(): TWrapper;
+ }
+
+ //_.prototype.concat
+ interface LoDashImplicitWrapperBase<T, TWrapper> {
+ /**
+ * Creates a new array joining a wrapped array with any additional arrays and/or values.
+ *
+ * @param items
+ * @return Returns the new concatenated array.
+ */
+ concat<TItem>(...items: Array<TItem|Array<TItem>>): LoDashImplicitArrayWrapper<TItem>;
+
+ /**
+ * @see _.concat
+ */
+ concat(...items: Array<T|Array<T>>): LoDashImplicitArrayWrapper<T>;
+ }
+
+ interface LoDashExplicitWrapperBase<T, TWrapper> {
+ /**
+ * @see _.concat
+ */
+ concat<TItem>(...items: Array<TItem|Array<TItem>>): LoDashExplicitArrayWrapper<TItem>;
+
+ /**
+ * @see _.concat
+ */
+ concat(...items: Array<T|Array<T>>): LoDashExplicitArrayWrapper<T>;
+ }
+
+ //_.prototype.plant
+ interface LoDashImplicitWrapperBase<T, TWrapper> {
+ /**
+ * Creates a clone of the chained sequence planting value as the wrapped value.
+ * @param value The value to plant as the wrapped value.
+ * @return Returns the new lodash wrapper instance.
+ */
+ plant(value: number): LoDashImplicitWrapper<number>;
+
+ /**
+ * @see _.plant
+ */
+ plant(value: string): LoDashImplicitStringWrapper;
+
+ /**
+ * @see _.plant
+ */
+ plant(value: boolean): LoDashImplicitWrapper<boolean>;
+
+ /**
+ * @see _.plant
+ */
+ plant(value: number[]): LoDashImplicitNumberArrayWrapper;
+
+ /**
+ * @see _.plant
+ */
+ plant<T>(value: T[]): LoDashImplicitArrayWrapper<T>;
+
+ /**
+ * @see _.plant
+ */
+ plant<T extends {}>(value: T): LoDashImplicitObjectWrapper<T>;
+
+ /**
+ * @see _.plant
+ */
+ plant(value: any): LoDashImplicitWrapper<any>;
+ }
+
+ interface LoDashExplicitWrapperBase<T, TWrapper> {
+ /**
+ * @see _.plant
+ */
+ plant(value: number): LoDashExplicitWrapper<number>;
+
+ /**
+ * @see _.plant
+ */
+ plant(value: string): LoDashExplicitStringWrapper;
+
+ /**
+ * @see _.plant
+ */
+ plant(value: boolean): LoDashExplicitWrapper<boolean>;
+
+ /**
+ * @see _.plant
+ */
+ plant(value: number[]): LoDashExplicitNumberArrayWrapper;
+
+ /**
+ * @see _.plant
+ */
+ plant<T>(value: T[]): LoDashExplicitArrayWrapper<T>;
+
+ /**
+ * @see _.plant
+ */
+ plant<T extends {}>(value: T): LoDashExplicitObjectWrapper<T>;
+
+ /**
+ * @see _.plant
+ */
+ plant(value: any): LoDashExplicitWrapper<any>;
+ }
+
+ //_.prototype.reverse
+ interface LoDashImplicitArrayWrapper<T> {
+ /**
+ * Reverses the wrapped array so the first element becomes the last, the second element becomes the second to
+ * last, and so on.
+ *
+ * Note: This method mutates the wrapped array.
+ *
+ * @return Returns the new reversed lodash wrapper instance.
+ */
+ reverse(): LoDashImplicitArrayWrapper<T>;
+ }
+
+ interface LoDashExplicitArrayWrapper<T> {
+ /**
+ * @see _.reverse
+ */
+ reverse(): LoDashExplicitArrayWrapper<T>;
+ }
+
+ //_.prototype.toJSON
+ interface LoDashWrapperBase<T, TWrapper> {
+ /**
+ * @see _.value
+ */
+ toJSON(): T;
+ }
+
+ //_.prototype.toString
+ interface LoDashWrapperBase<T, TWrapper> {
+ /**
+ * Produces the result of coercing the unwrapped value to a string.
+ *
+ * @return Returns the coerced string value.
+ */
+ toString(): string;
+ }
+
+ //_.prototype.value
+ interface LoDashWrapperBase<T, TWrapper> {
+ /**
+ * Executes the chained sequence to extract the unwrapped value.
+ *
+ * @alias _.toJSON, _.valueOf
+ *
+ * @return Returns the resolved unwrapped value.
+ */
+ value(): T;
+ }
+
+ //_.valueOf
+ interface LoDashWrapperBase<T, TWrapper> {
+ /**
+ * @see _.value
+ */
+ valueOf(): T;
+ }
+
+ /**************
+ * Collection *
+ **************/
+
+ //_.at
+ interface LoDashStatic {
+ /**
+ * Creates an array of elements corresponding to the given keys, or indexes, of collection. Keys may be
+ * specified as individual arguments or as arrays of keys.
+ *
+ * @param collection The collection to iterate over.
+ * @param props The property names or indexes of elements to pick, specified individually or in arrays.
+ * @return Returns the new array of picked elements.
+ */
+ at<T>(
+ collection: List<T>|Dictionary<T>,
+ ...props: (number|string|(number|string)[])[]
+ ): T[];
+ }
+
+ interface LoDashImplicitArrayWrapper<T> {
+ /**
+ * @see _.at
+ */
+ at(...props: (number|string|(number|string)[])[]): LoDashImplicitArrayWrapper<T>;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.at
+ */
+ at<T>(...props: (number|string|(number|string)[])[]): LoDashImplicitArrayWrapper<T>;
+ }
+
+ interface LoDashExplicitArrayWrapper<T> {
+ /**
+ * @see _.at
+ */
+ at(...props: (number|string|(number|string)[])[]): LoDashExplicitArrayWrapper<T>;
+ }
+
+ interface LoDashExplicitObjectWrapper<T> {
+ /**
+ * @see _.at
+ */
+ at<T>(...props: (number|string|(number|string)[])[]): LoDashExplicitArrayWrapper<T>;
+ }
+
+ //_.countBy
+ interface LoDashStatic {
+ /**
+ * Creates an object composed of keys generated from the results of running each element of collection through
+ * iteratee. The corresponding value of each key is the number of times the key was returned by iteratee. The
+ * iteratee is bound to thisArg and invoked with three arguments:
+ * (value, index|key, collection).
+ *
+ * If a property name is provided for iteratee the created _.property style callback returns the property
+ * value of the given element.
+ *
+ * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for
+ * elements that have a matching property value, else false.
+ *
+ * If an object is provided for iteratee the created _.matches style callback returns true for elements that
+ * have the properties of the given object, else false.
+ *
+ * @param collection The collection to iterate over.
+ * @param iteratee The function invoked per iteration.
+ * @param thisArg The this binding of iteratee.
+ * @return Returns the composed aggregate object.
+ */
+ countBy<T>(
+ collection: List<T>,
+ iteratee?: ListIterator<T, any>,
+ thisArg?: any
+ ): Dictionary<number>;
+
+ /**
+ * @see _.countBy
+ */
+ countBy<T>(
+ collection: Dictionary<T>,
+ iteratee?: DictionaryIterator<T, any>,
+ thisArg?: any
+ ): Dictionary<number>;
+
+ /**
+ * @see _.countBy
+ */
+ countBy<T>(
+ collection: NumericDictionary<T>,
+ iteratee?: NumericDictionaryIterator<T, any>,
+ thisArg?: any
+ ): Dictionary<number>;
+
+ /**
+ * @see _.countBy
+ */
+ countBy<T>(
+ collection: List<T>|Dictionary<T>|NumericDictionary<T>,
+ iteratee?: string,
+ thisArg?: any
+ ): Dictionary<number>;
+
+ /**
+ * @see _.countBy
+ */
+ countBy<W, T>(
+ collection: List<T>|Dictionary<T>|NumericDictionary<T>,
+ iteratee?: W
+ ): Dictionary<number>;
+
+ /**
+ * @see _.countBy
+ */
+ countBy<T>(
+ collection: List<T>|Dictionary<T>|NumericDictionary<T>,
+ iteratee?: Object
+ ): Dictionary<number>;
+ }
+
+ interface LoDashImplicitWrapper<T> {
+ /**
+ * @see _.countBy
+ */
+ countBy(
+ iteratee?: ListIterator<T, any>,
+ thisArg?: any
+ ): LoDashImplicitObjectWrapper<Dictionary<number>>;
+ }
+
+ interface LoDashImplicitArrayWrapper<T> {
+ /**
+ * @see _.countBy
+ */
+ countBy(
+ iteratee?: ListIterator<T, any>,
+ thisArg?: any
+ ): LoDashImplicitObjectWrapper<Dictionary<number>>;
+
+ /**
+ * @see _.countBy
+ */
+ countBy(
+ iteratee?: string,
+ thisArg?: any
+ ): LoDashImplicitObjectWrapper<Dictionary<number>>;
+
+ /**
+ * @see _.countBy
+ */
+ countBy<W>(
+ iteratee?: W
+ ): LoDashImplicitObjectWrapper<Dictionary<number>>;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.countBy
+ */
+ countBy<T>(
+ iteratee?: ListIterator<T, any>|DictionaryIterator<T, any>|NumericDictionaryIterator<T, any>,
+ thisArg?: any
+ ): LoDashImplicitObjectWrapper<Dictionary<number>>;
+
+ /**
+ * @see _.countBy
+ */
+ countBy(
+ iteratee?: string,
+ thisArg?: any
+ ): LoDashImplicitObjectWrapper<Dictionary<number>>;
+
+ /**
+ * @see _.countBy
+ */
+ countBy<W>(
+ iteratee?: W
+ ): LoDashImplicitObjectWrapper<Dictionary<number>>;
+ }
+
+ interface LoDashExplicitWrapper<T> {
+ /**
+ * @see _.countBy
+ */
+ countBy(
+ iteratee?: ListIterator<T, any>,
+ thisArg?: any
+ ): LoDashExplicitObjectWrapper<Dictionary<number>>;
+ }
+
+ interface LoDashExplicitArrayWrapper<T> {
+ /**
+ * @see _.countBy
+ */
+ countBy(
+ iteratee?: ListIterator<T, any>,
+ thisArg?: any
+ ): LoDashExplicitObjectWrapper<Dictionary<number>>;
+
+ /**
+ * @see _.countBy
+ */
+ countBy(
+ iteratee?: string,
+ thisArg?: any
+ ): LoDashExplicitObjectWrapper<Dictionary<number>>;
+
+ /**
+ * @see _.countBy
+ */
+ countBy<W>(
+ iteratee?: W
+ ): LoDashExplicitObjectWrapper<Dictionary<number>>;
+ }
+
+ interface LoDashExplicitObjectWrapper<T> {
+ /**
+ * @see _.countBy
+ */
+ countBy<T>(
+ iteratee?: ListIterator<T, any>|DictionaryIterator<T, any>|NumericDictionaryIterator<T, any>,
+ thisArg?: any
+ ): LoDashExplicitObjectWrapper<Dictionary<number>>;
+
+ /**
+ * @see _.countBy
+ */
+ countBy(
+ iteratee?: string,
+ thisArg?: any
+ ): LoDashExplicitObjectWrapper<Dictionary<number>>;
+
+ /**
+ * @see _.countBy
+ */
+ countBy<W>(
+ iteratee?: W
+ ): LoDashExplicitObjectWrapper<Dictionary<number>>;
+ }
+
+ //_.each
+ interface LoDashStatic {
+ /**
+ * @see _.forEach
+ */
+ each<T>(
+ collection: T[],
+ iteratee?: ListIterator<T, any>,
+ thisArg?: any
+ ): T[];
+
+ /**
+ * @see _.forEach
+ */
+ each<T>(
+ collection: List<T>,
+ iteratee?: ListIterator<T, any>,
+ thisArg?: any
+ ): List<T>;
+
+ /**
+ * @see _.forEach
+ */
+ each<T>(
+ collection: Dictionary<T>,
+ iteratee?: DictionaryIterator<T, any>,
+ thisArg?: any
+ ): Dictionary<T>;
+
+ /**
+ * @see _.forEach
+ */
+ each<T extends {}>(
+ collection: T,
+ iteratee?: ObjectIterator<any, any>,
+ thisArgs?: any
+ ): T;
+
+ /**
+ * @see _.forEach
+ */
+ each<T extends {}, TValue>(
+ collection: T,
+ iteratee?: ObjectIterator<TValue, any>,
+ thisArgs?: any
+ ): T;
+ }
+
+ interface LoDashImplicitWrapper<T> {
+ /**
+ * @see _.forEach
+ */
+ each(
+ iteratee: ListIterator<string, any>,
+ thisArg?: any
+ ): LoDashImplicitWrapper<string>;
+ }
+
+ interface LoDashImplicitArrayWrapper<T> {
+ /**
+ * @see _.forEach
+ */
+ each(
+ iteratee: ListIterator<T, any>,
+ thisArg?: any
+ ): LoDashImplicitArrayWrapper<T>;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.forEach
+ */
+ each<TValue>(
+ iteratee?: ListIterator<TValue, any>|DictionaryIterator<TValue, any>,
+ thisArg?: any
+ ): LoDashImplicitObjectWrapper<T>;
+ }
+
+ interface LoDashExplicitWrapper<T> {
+ /**
+ * @see _.forEach
+ */
+ each(
+ iteratee: ListIterator<string, any>,
+ thisArg?: any
+ ): LoDashExplicitWrapper<string>;
+ }
+
+ interface LoDashExplicitArrayWrapper<T> {
+ /**
+ * @see _.forEach
+ */
+ each(
+ iteratee: ListIterator<T, any>,
+ thisArg?: any
+ ): LoDashExplicitArrayWrapper<T>;
+ }
+
+ interface LoDashExplicitObjectWrapper<T> {
+ /**
+ * @see _.forEach
+ */
+ each<TValue>(
+ iteratee?: ListIterator<TValue, any>|DictionaryIterator<TValue, any>,
+ thisArg?: any
+ ): LoDashExplicitObjectWrapper<T>;
+ }
+
+ //_.eachRight
+ interface LoDashStatic {
+ /**
+ * @see _.forEachRight
+ */
+ eachRight<T>(
+ collection: T[],
+ iteratee?: ListIterator<T, any>,
+ thisArg?: any
+ ): T[];
+
+ /**
+ * @see _.forEachRight
+ */
+ eachRight<T>(
+ collection: List<T>,
+ iteratee?: ListIterator<T, any>,
+ thisArg?: any
+ ): List<T>;
+
+ /**
+ * @see _.forEachRight
+ */
+ eachRight<T>(
+ collection: Dictionary<T>,
+ iteratee?: DictionaryIterator<T, any>,
+ thisArg?: any
+ ): Dictionary<T>;
+
+ /**
+ * @see _.forEachRight
+ */
+ eachRight<T extends {}>(
+ collection: T,
+ iteratee?: ObjectIterator<any, any>,
+ thisArgs?: any
+ ): T;
+
+ /**
+ * @see _.forEachRight
+ */
+ eachRight<T extends {}, TValue>(
+ collection: T,
+ iteratee?: ObjectIterator<TValue, any>,
+ thisArgs?: any
+ ): T;
+ }
+
+ interface LoDashImplicitWrapper<T> {
+ /**
+ * @see _.forEachRight
+ */
+ eachRight(
+ iteratee: ListIterator<string, any>,
+ thisArg?: any
+ ): LoDashImplicitWrapper<string>;
+ }
+
+ interface LoDashImplicitArrayWrapper<T> {
+ /**
+ * @see _.forEachRight
+ */
+ eachRight(
+ iteratee: ListIterator<T, any>,
+ thisArg?: any
+ ): LoDashImplicitArrayWrapper<T>;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.forEachRight
+ */
+ eachRight<TValue>(
+ iteratee?: ListIterator<TValue, any>|DictionaryIterator<TValue, any>,
+ thisArg?: any
+ ): LoDashImplicitObjectWrapper<T>;
+ }
+
+ interface LoDashExplicitWrapper<T> {
+ /**
+ * @see _.forEachRight
+ */
+ eachRight(
+ iteratee: ListIterator<string, any>,
+ thisArg?: any
+ ): LoDashExplicitWrapper<string>;
+ }
+
+ interface LoDashExplicitArrayWrapper<T> {
+ /**
+ * @see _.forEachRight
+ */
+ eachRight(
+ iteratee: ListIterator<T, any>,
+ thisArg?: any
+ ): LoDashExplicitArrayWrapper<T>;
+ }
+
+ interface LoDashExplicitObjectWrapper<T> {
+ /**
+ * @see _.forEachRight
+ */
+ eachRight<TValue>(
+ iteratee?: ListIterator<TValue, any>|DictionaryIterator<TValue, any>,
+ thisArg?: any
+ ): LoDashExplicitObjectWrapper<T>;
+ }
+
+ //_.every
+ interface LoDashStatic {
+ /**
+ * Checks if predicate returns truthy for all elements of collection. The predicate is bound to thisArg and
+ * invoked with three arguments: (value, index|key, collection).
+ *
+ * If a property name is provided for predicate the created _.property style callback returns the property
+ * value of the given element.
+ *
+ * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for
+ * elements that have a matching property value, else false.
+ *
+ * If an object is provided for predicate the created _.matches style callback returns true for elements that
+ * have the properties of the given object, else false.
+ *
+ * @param collection The collection to iterate over.
+ * @param predicate The function invoked per iteration.
+ * @param thisArg The this binding of predicate.
+ * @return Returns true if all elements pass the predicate check, else false.
+ */
+ every<T>(
+ collection: List<T>,
+ predicate?: ListIterator<T, boolean>,
+ thisArg?: any
+ ): boolean;
+
+ /**
+ * @see _.every
+ */
+ every<T>(
+ collection: Dictionary<T>,
+ predicate?: DictionaryIterator<T, boolean>,
+ thisArg?: any
+ ): boolean;
+
+ /**
+ * @see _.every
+ */
+ every<T>(
+ collection: List<T>|Dictionary<T>,
+ predicate?: string,
+ thisArg?: any
+ ): boolean;
+
+ /**
+ * @see _.every
+ */
+ every<TObject extends {}, T>(
+ collection: List<T>|Dictionary<T>,
+ predicate?: TObject
+ ): boolean;
+ }
+
+ interface LoDashImplicitArrayWrapper<T> {
+ /**
+ * @see _.every
+ */
+ every(
+ predicate?: ListIterator<T, boolean>,
+ thisArg?: any
+ ): boolean;
+
+ /**
+ * @see _.every
+ */
+ every(
+ predicate?: string,
+ thisArg?: any
+ ): boolean;
+
+ /**
+ * @see _.every
+ */
+ every<TObject extends {}>(
+ predicate?: TObject
+ ): boolean;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.every
+ */
+ every<TResult>(
+ predicate?: ListIterator<TResult, boolean>|DictionaryIterator<TResult, boolean>,
+ thisArg?: any
+ ): boolean;
+
+ /**
+ * @see _.every
+ */
+ every(
+ predicate?: string,
+ thisArg?: any
+ ): boolean;
+
+ /**
+ * @see _.every
+ */
+ every<TObject extends {}>(
+ predicate?: TObject
+ ): boolean;
+ }
+
+ interface LoDashExplicitArrayWrapper<T> {
+ /**
+ * @see _.every
+ */
+ every(
+ predicate?: ListIterator<T, boolean>,
+ thisArg?: any
+ ): LoDashExplicitWrapper<boolean>;
+
+ /**
+ * @see _.every
+ */
+ every(
+ predicate?: string,
+ thisArg?: any
+ ): LoDashExplicitWrapper<boolean>;
+
+ /**
+ * @see _.every
+ */
+ every<TObject extends {}>(
+ predicate?: TObject
+ ): LoDashExplicitWrapper<boolean>;
+ }
+
+ interface LoDashExplicitObjectWrapper<T> {
+ /**
+ * @see _.every
+ */
+ every<TResult>(
+ predicate?: ListIterator<TResult, boolean>|DictionaryIterator<TResult, boolean>,
+ thisArg?: any
+ ): LoDashExplicitWrapper<boolean>;
+
+ /**
+ * @see _.every
+ */
+ every(
+ predicate?: string,
+ thisArg?: any
+ ): LoDashExplicitWrapper<boolean>;
+
+ /**
+ * @see _.every
+ */
+ every<TObject extends {}>(
+ predicate?: TObject
+ ): LoDashExplicitWrapper<boolean>;
+ }
+
+ //_.filter
+ interface LoDashStatic {
+ /**
+ * Iterates over elements of collection, returning an array of all elements predicate returns truthy for. The
+ * predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection).
+ *
+ * If a property name is provided for predicate the created _.property style callback returns the property
+ * value of the given element.
+ *
+ * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for
+ * elements that have a matching property value, else false.
+ *
+ * If an object is provided for predicate the created _.matches style callback returns true for elements that
+ * have the properties of the given object, else false.
+ *
+ * @param collection The collection to iterate over.
+ * @param predicate The function invoked per iteration.
+ * @param thisArg The this binding of predicate.
+ * @return Returns the new filtered array.
+ */
+ filter<T>(
+ collection: List<T>,
+ predicate?: ListIterator<T, boolean>,
+ thisArg?: any
+ ): T[];
+
+ /**
+ * @see _.filter
+ */
+ filter<T>(
+ collection: Dictionary<T>,
+ predicate?: DictionaryIterator<T, boolean>,
+ thisArg?: any
+ ): T[];
+
+ /**
+ * @see _.filter
+ */
+ filter(
+ collection: string,
+ predicate?: StringIterator<boolean>,
+ thisArg?: any
+ ): string[];
+
+ /**
+ * @see _.filter
+ */
+ filter<T>(
+ collection: List<T>|Dictionary<T>,
+ predicate: string,
+ thisArg?: any
+ ): T[];
+
+ /**
+ * @see _.filter
+ */
+ filter<W extends {}, T>(
+ collection: List<T>|Dictionary<T>,
+ predicate: W
+ ): T[];
+ }
+
+ interface LoDashImplicitWrapper<T> {
+ /**
+ * @see _.filter
+ */
+ filter(
+ predicate?: StringIterator<boolean>,
+ thisArg?: any
+ ): LoDashImplicitArrayWrapper<string>;
+ }
+
+ interface LoDashImplicitArrayWrapper<T> {
+ /**
+ * @see _.filter
+ */
+ filter(
+ predicate: ListIterator<T, boolean>,
+ thisArg?: any
+ ): LoDashImplicitArrayWrapper<T>;
+
+ /**
+ * @see _.filter
+ */
+ filter(
+ predicate: string,
+ thisArg?: any
+ ): LoDashImplicitArrayWrapper<T>;
+
+ /**
+ * @see _.filter
+ */
+ filter<W>(predicate: W): LoDashImplicitArrayWrapper<T>;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.filter
+ */
+ filter<T>(
+ predicate: ListIterator<T, boolean>|DictionaryIterator<T, boolean>,
+ thisArg?: any
+ ): LoDashImplicitArrayWrapper<T>;
+
+ /**
+ * @see _.filter
+ */
+ filter<T>(
+ predicate: string,
+ thisArg?: any
+ ): LoDashImplicitArrayWrapper<T>;
+
+ /**
+ * @see _.filter
+ */
+ filter<W, T>(predicate: W): LoDashImplicitArrayWrapper<T>;
+ }
+
+ interface LoDashExplicitWrapper<T> {
+ /**
+ * @see _.filter
+ */
+ filter(
+ predicate?: StringIterator<boolean>,
+ thisArg?: any
+ ): LoDashExplicitArrayWrapper<string>;
+ }
+
+ interface LoDashExplicitArrayWrapper<T> {
+ /**
+ * @see _.filter
+ */
+ filter(
+ predicate: ListIterator<T, boolean>,
+ thisArg?: any
+ ): LoDashExplicitArrayWrapper<T>;
+
+ /**
+ * @see _.filter
+ */
+ filter(
+ predicate: string,
+ thisArg?: any
+ ): LoDashExplicitArrayWrapper<T>;
+
+ /**
+ * @see _.filter
+ */
+ filter<W>(predicate: W): LoDashExplicitArrayWrapper<T>;
+ }
+
+ interface LoDashExplicitObjectWrapper<T> {
+ /**
+ * @see _.filter
+ */
+ filter<T>(
+ predicate: ListIterator<T, boolean>|DictionaryIterator<T, boolean>,
+ thisArg?: any
+ ): LoDashExplicitArrayWrapper<T>;
+
+ /**
+ * @see _.filter
+ */
+ filter<T>(
+ predicate: string,
+ thisArg?: any
+ ): LoDashExplicitArrayWrapper<T>;
+
+ /**
+ * @see _.filter
+ */
+ filter<W, T>(predicate: W): LoDashExplicitArrayWrapper<T>;
+ }
+
+ //_.find
+ interface LoDashStatic {
+ /**
+ * Iterates over elements of collection, returning the first element predicate returns truthy for.
+ * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection).
+ *
+ * If a property name is provided for predicate the created _.property style callback returns the property
+ * value of the given element.
+ *
+ * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for
+ * elements that have a matching property value, else false.
+ *
+ * If an object is provided for predicate the created _.matches style callback returns true for elements that
+ * have the properties of the given object, else false.
+ *
+ * @param collection The collection to search.
+ * @param predicate The function invoked per iteration.
+ * @param thisArg The this binding of predicate.
+ * @return Returns the matched element, else undefined.
+ */
+ find<T>(
+ collection: List<T>,
+ predicate?: ListIterator<T, boolean>,
+ thisArg?: any
+ ): T;
+
+ /**
+ * @see _.find
+ */
+ find<T>(
+ collection: Dictionary<T>,
+ predicate?: DictionaryIterator<T, boolean>,
+ thisArg?: any
+ ): T;
+
+ /**
+ * @see _.find
+ */
+ find<T>(
+ collection: List<T>|Dictionary<T>,
+ predicate?: string,
+ thisArg?: any
+ ): T;
+
+ /**
+ * @see _.find
+ */
+ find<TObject extends {}, T>(
+ collection: List<T>|Dictionary<T>,
+ predicate?: TObject
+ ): T;
+ }
+
+ interface LoDashImplicitArrayWrapper<T> {
+ /**
+ * @see _.find
+ */
+ find(
+ predicate?: ListIterator<T, boolean>,
+ thisArg?: any
+ ): T;
+
+ /**
+ * @see _.find
+ */
+ find(
+ predicate?: string,
+ thisArg?: any
+ ): T;
+
+ /**
+ * @see _.find
+ */
+ find<TObject extends {}>(
+ predicate?: TObject
+ ): T;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.find
+ */
+ find<TResult>(
+ predicate?: ListIterator<TResult, boolean>|DictionaryIterator<TResult, boolean>,
+ thisArg?: any
+ ): TResult;
+
+ /**
+ * @see _.find
+ */
+ find<TResult>(
+ predicate?: string,
+ thisArg?: any
+ ): TResult;
+
+ /**
+ * @see _.find
+ */
+ find<TObject extends {}, TResult>(
+ predicate?: TObject
+ ): TResult;
+ }
+
+ //_.findLast
+ interface LoDashStatic {
+ /**
+ * This method is like _.find except that it iterates over elements of a collection from
+ * right to left.
+ * @param collection Searches for a value in this list.
+ * @param callback The function called per iteration.
+ * @param thisArg The this binding of callback.
+ * @return The found element, else undefined.
+ **/
+ findLast<T>(
+ collection: Array<T>,
+ callback: ListIterator<T, boolean>,
+ thisArg?: any): T;
+
+ /**
+ * @see _.find
+ **/
+ findLast<T>(
+ collection: List<T>,
+ callback: ListIterator<T, boolean>,
+ thisArg?: any): T;
+
+ /**
+ * @see _.find
+ **/
+ findLast<T>(
+ collection: Dictionary<T>,
+ callback: DictionaryIterator<T, boolean>,
+ thisArg?: any): T;
+
+ /**
+ * @see _.find
+ * @param _.pluck style callback
+ **/
+ findLast<W, T>(
+ collection: Array<T>,
+ whereValue: W): T;
+
+ /**
+ * @see _.find
+ * @param _.pluck style callback
+ **/
+ findLast<W, T>(
+ collection: List<T>,
+ whereValue: W): T;
+
+ /**
+ * @see _.find
+ * @param _.pluck style callback
+ **/
+ findLast<W, T>(
+ collection: Dictionary<T>,
+ whereValue: W): T;
+
+ /**
+ * @see _.find
+ * @param _.where style callback
+ **/
+ findLast<T>(
+ collection: Array<T>,
+ pluckValue: string): T;
+
+ /**
+ * @see _.find
+ * @param _.where style callback
+ **/
+ findLast<T>(
+ collection: List<T>,
+ pluckValue: string): T;
+
+ /**
+ * @see _.find
+ * @param _.where style callback
+ **/
+ findLast<T>(
+ collection: Dictionary<T>,
+ pluckValue: string): T;
+ }
+
+ interface LoDashImplicitArrayWrapper<T> {
+ /**
+ * @see _.findLast
+ */
+ findLast(
+ callback: ListIterator<T, boolean>,
+ thisArg?: any): T;
+ /**
+ * @see _.findLast
+ * @param _.where style callback
+ */
+ findLast<W>(
+ whereValue: W): T;
+
+ /**
+ * @see _.findLast
+ * @param _.where style callback
+ */
+ findLast(
+ pluckValue: string): T;
+ }
+
+ //_.forEach
+ interface LoDashStatic {
+ /**
+ * Iterates over elements of collection invoking iteratee for each element. The iteratee is bound to thisArg
+ * and invoked with three arguments:
+ * (value, index|key, collection). Iteratee functions may exit iteration early by explicitly returning false.
+ *
+ * Note: As with other "Collections" methods, objects with a "length" property are iterated like arrays. To
+ * avoid this behavior _.forIn or _.forOwn may be used for object iteration.
+ *
+ * @alias _.each
+ *
+ * @param collection The collection to iterate over.
+ * @param iteratee The function invoked per iteration.
+ * @param thisArg The this binding of iteratee.
+ */
+ forEach<T>(
+ collection: T[],
+ iteratee?: ListIterator<T, any>,
+ thisArg?: any
+ ): T[];
+
+ /**
+ * @see _.forEach
+ */
+ forEach<T>(
+ collection: List<T>,
+ iteratee?: ListIterator<T, any>,
+ thisArg?: any
+ ): List<T>;
+
+ /**
+ * @see _.forEach
+ */
+ forEach<T>(
+ collection: Dictionary<T>,
+ iteratee?: DictionaryIterator<T, any>,
+ thisArg?: any
+ ): Dictionary<T>;
+
+ /**
+ * @see _.forEach
+ */
+ forEach<T extends {}>(
+ collection: T,
+ iteratee?: ObjectIterator<any, any>,
+ thisArgs?: any
+ ): T;
+
+ /**
+ * @see _.forEach
+ */
+ forEach<T extends {}, TValue>(
+ collection: T,
+ iteratee?: ObjectIterator<TValue, any>,
+ thisArgs?: any
+ ): T;
+ }
+
+ interface LoDashImplicitWrapper<T> {
+ /**
+ * @see _.forEach
+ */
+ forEach(
+ iteratee: ListIterator<string, any>,
+ thisArg?: any
+ ): LoDashImplicitWrapper<string>;
+ }
+
+ interface LoDashImplicitArrayWrapper<T> {
+ /**
+ * @see _.forEach
+ */
+ forEach(
+ iteratee: ListIterator<T, any>,
+ thisArg?: any
+ ): LoDashImplicitArrayWrapper<T>;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.forEach
+ */
+ forEach<TValue>(
+ iteratee?: ListIterator<TValue, any>|DictionaryIterator<TValue, any>,
+ thisArg?: any
+ ): LoDashImplicitObjectWrapper<T>;
+ }
+
+ interface LoDashExplicitWrapper<T> {
+ /**
+ * @see _.forEach
+ */
+ forEach(
+ iteratee: ListIterator<string, any>,
+ thisArg?: any
+ ): LoDashExplicitWrapper<string>;
+ }
+
+ interface LoDashExplicitArrayWrapper<T> {
+ /**
+ * @see _.forEach
+ */
+ forEach(
+ iteratee: ListIterator<T, any>,
+ thisArg?: any
+ ): LoDashExplicitArrayWrapper<T>;
+ }
+
+ interface LoDashExplicitObjectWrapper<T> {
+ /**
+ * @see _.forEach
+ */
+ forEach<TValue>(
+ iteratee?: ListIterator<TValue, any>|DictionaryIterator<TValue, any>,
+ thisArg?: any
+ ): LoDashExplicitObjectWrapper<T>;
+ }
+
+ //_.forEachRight
+ interface LoDashStatic {
+ /**
+ * This method is like _.forEach except that it iterates over elements of collection from right to left.
+ *
+ * @alias _.eachRight
+ *
+ * @param collection The collection to iterate over.
+ * @param iteratee The function called per iteration.
+ * @param thisArg The this binding of callback.
+ */
+ forEachRight<T>(
+ collection: T[],
+ iteratee?: ListIterator<T, any>,
+ thisArg?: any
+ ): T[];
+
+ /**
+ * @see _.forEachRight
+ */
+ forEachRight<T>(
+ collection: List<T>,
+ iteratee?: ListIterator<T, any>,
+ thisArg?: any
+ ): List<T>;
+
+ /**
+ * @see _.forEachRight
+ */
+ forEachRight<T>(
+ collection: Dictionary<T>,
+ iteratee?: DictionaryIterator<T, any>,
+ thisArg?: any
+ ): Dictionary<T>;
+
+ /**
+ * @see _.forEachRight
+ */
+ forEachRight<T extends {}>(
+ collection: T,
+ iteratee?: ObjectIterator<any, any>,
+ thisArgs?: any
+ ): T;
+
+ /**
+ * @see _.forEachRight
+ */
+ forEachRight<T extends {}, TValue>(
+ collection: T,
+ iteratee?: ObjectIterator<TValue, any>,
+ thisArgs?: any
+ ): T;
+ }
+
+ interface LoDashImplicitWrapper<T> {
+ /**
+ * @see _.forEachRight
+ */
+ forEachRight(
+ iteratee: ListIterator<string, any>,
+ thisArg?: any
+ ): LoDashImplicitWrapper<string>;
+ }
+
+ interface LoDashImplicitArrayWrapper<T> {
+ /**
+ * @see _.forEachRight
+ */
+ forEachRight(
+ iteratee: ListIterator<T, any>,
+ thisArg?: any
+ ): LoDashImplicitArrayWrapper<T>;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.forEachRight
+ */
+ forEachRight<TValue>(
+ iteratee?: ListIterator<TValue, any>|DictionaryIterator<TValue, any>,
+ thisArg?: any
+ ): LoDashImplicitObjectWrapper<T>;
+ }
+
+ interface LoDashExplicitWrapper<T> {
+ /**
+ * @see _.forEachRight
+ */
+ forEachRight(
+ iteratee: ListIterator<string, any>,
+ thisArg?: any
+ ): LoDashExplicitWrapper<string>;
+ }
+
+ interface LoDashExplicitArrayWrapper<T> {
+ /**
+ * @see _.forEachRight
+ */
+ forEachRight(
+ iteratee: ListIterator<T, any>,
+ thisArg?: any
+ ): LoDashExplicitArrayWrapper<T>;
+ }
+
+ interface LoDashExplicitObjectWrapper<T> {
+ /**
+ * @see _.forEachRight
+ */
+ forEachRight<TValue>(
+ iteratee?: ListIterator<TValue, any>|DictionaryIterator<TValue, any>,
+ thisArg?: any
+ ): LoDashExplicitObjectWrapper<T>;
+ }
+
+ //_.groupBy
+ interface LoDashStatic {
+ /**
+ * Creates an object composed of keys generated from the results of running each element of collection through
+ * iteratee. The corresponding value of each key is an array of the elements responsible for generating the
+ * key. The iteratee is bound to thisArg and invoked with three arguments:
+ * (value, index|key, collection).
+ *
+ * If a property name is provided for iteratee the created _.property style callback returns the property
+ * value of the given element.
+ *
+ * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for
+ * elements that have a matching property value, else false.
+ *
+ * If an object is provided for iteratee the created _.matches style callback returns true for elements that
+ * have the properties of the given object, else false.
+ *
+ * @param collection The collection to iterate over.
+ * @param iteratee The function invoked per iteration.
+ * @param thisArg The this binding of iteratee.
+ * @return Returns the composed aggregate object.
+ */
+ groupBy<T, TKey>(
+ collection: List<T>,
+ iteratee?: ListIterator<T, TKey>,
+ thisArg?: any
+ ): Dictionary<T[]>;
+
+ /**
+ * @see _.groupBy
+ */
+ groupBy<T>(
+ collection: List<any>,
+ iteratee?: ListIterator<T, any>,
+ thisArg?: any
+ ): Dictionary<T[]>;
+
+ /**
+ * @see _.groupBy
+ */
+ groupBy<T, TKey>(
+ collection: Dictionary<T>,
+ iteratee?: DictionaryIterator<T, TKey>,
+ thisArg?: any
+ ): Dictionary<T[]>;
+
+ /**
+ * @see _.groupBy
+ */
+ groupBy<T>(
+ collection: Dictionary<any>,
+ iteratee?: DictionaryIterator<T, any>,
+ thisArg?: any
+ ): Dictionary<T[]>;
+
+ /**
+ * @see _.groupBy
+ */
+ groupBy<T, TValue>(
+ collection: List<T>|Dictionary<T>,
+ iteratee?: string,
+ thisArg?: TValue
+ ): Dictionary<T[]>;
+
+ /**
+ * @see _.groupBy
+ */
+ groupBy<T>(
+ collection: List<T>|Dictionary<T>,
+ iteratee?: string,
+ thisArg?: any
+ ): Dictionary<T[]>;
+
+ /**
+ * @see _.groupBy
+ */
+ groupBy<TWhere, T>(
+ collection: List<T>|Dictionary<T>,
+ iteratee?: TWhere
+ ): Dictionary<T[]>;
+
+ /**
+ * @see _.groupBy
+ */
+ groupBy<T>(
+ collection: List<T>|Dictionary<T>,
+ iteratee?: Object
+ ): Dictionary<T[]>;
+ }
+
+ interface LoDashImplicitWrapper<T> {
+ /**
+ * @see _.groupBy
+ */
+ groupBy<TKey>(
+ iteratee?: ListIterator<T, TKey>,
+ thisArg?: any
+ ): LoDashImplicitObjectWrapper<Dictionary<T[]>>;
+ }
+
+ interface LoDashImplicitArrayWrapper<T> {
+ /**
+ * @see _.groupBy
+ */
+ groupBy<TKey>(
+ iteratee?: ListIterator<T, TKey>,
+ thisArg?: any
+ ): LoDashImplicitObjectWrapper<Dictionary<T[]>>;
+
+ /**
+ * @see _.groupBy
+ */
+ groupBy<TValue>(
+ iteratee?: string,
+ thisArg?: TValue
+ ): LoDashImplicitObjectWrapper<Dictionary<T[]>>;
+
+ /**
+ * @see _.groupBy
+ */
+ groupBy<TWhere>(
+ iteratee?: TWhere
+ ): LoDashImplicitObjectWrapper<Dictionary<T[]>>;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.groupBy
+ */
+ groupBy<T, TKey>(
+ iteratee?: ListIterator<T, TKey>|DictionaryIterator<T, TKey>,
+ thisArg?: any
+ ): LoDashImplicitObjectWrapper<Dictionary<T[]>>;
+
+ /**
+ * @see _.groupBy
+ */
+ groupBy<T>(
+ iteratee?: ListIterator<T, any>|DictionaryIterator<T, any>,
+ thisArg?: any
+ ): LoDashImplicitObjectWrapper<Dictionary<T[]>>;
+
+ /**
+ * @see _.groupBy
+ */
+ groupBy<T, TValue>(
+ iteratee?: string,
+ thisArg?: TValue
+ ): LoDashImplicitObjectWrapper<Dictionary<T[]>>;
+
+ /**
+ * @see _.groupBy
+ */
+ groupBy<T>(
+ iteratee?: string,
+ thisArg?: any
+ ): LoDashImplicitObjectWrapper<Dictionary<T[]>>;
+
+ /**
+ * @see _.groupBy
+ */
+ groupBy<TWhere, T>(
+ iteratee?: TWhere
+ ): LoDashImplicitObjectWrapper<Dictionary<T[]>>;
+
+ /**
+ * @see _.groupBy
+ */
+ groupBy<T>(
+ iteratee?: Object
+ ): LoDashImplicitObjectWrapper<Dictionary<T[]>>;
+ }
+
+ interface LoDashExplicitWrapper<T> {
+ /**
+ * @see _.groupBy
+ */
+ groupBy<TKey>(
+ iteratee?: ListIterator<T, TKey>,
+ thisArg?: any
+ ): LoDashExplicitObjectWrapper<Dictionary<T[]>>;
+ }
+
+ interface LoDashExplicitArrayWrapper<T> {
+ /**
+ * @see _.groupBy
+ */
+ groupBy<TKey>(
+ iteratee?: ListIterator<T, TKey>,
+ thisArg?: any
+ ): LoDashExplicitObjectWrapper<Dictionary<T[]>>;
+
+ /**
+ * @see _.groupBy
+ */
+ groupBy<TValue>(
+ iteratee?: string,
+ thisArg?: TValue
+ ): LoDashExplicitObjectWrapper<Dictionary<T[]>>;
+
+ /**
+ * @see _.groupBy
+ */
+ groupBy<TWhere>(
+ iteratee?: TWhere
+ ): LoDashExplicitObjectWrapper<Dictionary<T[]>>;
+ }
+
+ interface LoDashExplicitObjectWrapper<T> {
+ /**
+ * @see _.groupBy
+ */
+ groupBy<T, TKey>(
+ iteratee?: ListIterator<T, TKey>|DictionaryIterator<T, TKey>,
+ thisArg?: any
+ ): LoDashExplicitObjectWrapper<Dictionary<T[]>>;
+
+ /**
+ * @see _.groupBy
+ */
+ groupBy<T>(
+ iteratee?: ListIterator<T, any>|DictionaryIterator<T, any>,
+ thisArg?: any
+ ): LoDashExplicitObjectWrapper<Dictionary<T[]>>;
+
+ /**
+ * @see _.groupBy
+ */
+ groupBy<T, TValue>(
+ iteratee?: string,
+ thisArg?: TValue
+ ): LoDashExplicitObjectWrapper<Dictionary<T[]>>;
+
+ /**
+ * @see _.groupBy
+ */
+ groupBy<T>(
+ iteratee?: string,
+ thisArg?: any
+ ): LoDashExplicitObjectWrapper<Dictionary<T[]>>;
+
+ /**
+ * @see _.groupBy
+ */
+ groupBy<TWhere, T>(
+ iteratee?: TWhere
+ ): LoDashExplicitObjectWrapper<Dictionary<T[]>>;
+
+ /**
+ * @see _.groupBy
+ */
+ groupBy<T>(
+ iteratee?: Object
+ ): LoDashExplicitObjectWrapper<Dictionary<T[]>>;
+ }
+
+ //_.includes
+ interface LoDashStatic {
+ /**
+ * Checks if target is in collection using SameValueZero for equality comparisons. If fromIndex is negative,
+ * it’s used as the offset from the end of collection.
+ *
+ * @param collection The collection to search.
+ * @param target The value to search for.
+ * @param fromIndex The index to search from.
+ * @return True if the target element is found, else false.
+ */
+ includes<T>(
+ collection: List<T>|Dictionary<T>,
+ target: T,
+ fromIndex?: number
+ ): boolean;
+
+ /**
+ * @see _.includes
+ */
+ includes(
+ collection: string,
+ target: string,
+ fromIndex?: number
+ ): boolean;
+ }
+
+ interface LoDashImplicitArrayWrapper<T> {
+ /**
+ * @see _.includes
+ */
+ includes(
+ target: T,
+ fromIndex?: number
+ ): boolean;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.includes
+ */
+ includes<TValue>(
+ target: TValue,
+ fromIndex?: number
+ ): boolean;
+ }
+
+ interface LoDashImplicitWrapper<T> {
+ /**
+ * @see _.includes
+ */
+ includes(
+ target: string,
+ fromIndex?: number
+ ): boolean;
+ }
+
+ interface LoDashExplicitArrayWrapper<T> {
+ /**
+ * @see _.includes
+ */
+ includes(
+ target: T,
+ fromIndex?: number
+ ): LoDashExplicitWrapper<boolean>;
+ }
+
+ interface LoDashExplicitObjectWrapper<T> {
+ /**
+ * @see _.includes
+ */
+ includes<TValue>(
+ target: TValue,
+ fromIndex?: number
+ ): LoDashExplicitWrapper<boolean>;
+ }
+
+ interface LoDashExplicitWrapper<T> {
+ /**
+ * @see _.includes
+ */
+ includes(
+ target: string,
+ fromIndex?: number
+ ): LoDashExplicitWrapper<boolean>;
+ }
+
+ //_.keyBy
+ interface LoDashStatic {
+ /**
+ * Creates an object composed of keys generated from the results of running each element of collection through
+ * iteratee. The corresponding value of each key is the last element responsible for generating the key. The
+ * iteratee function is bound to thisArg and invoked with three arguments:
+ * (value, index|key, collection).
+ *
+ * If a property name is provided for iteratee the created _.property style callback returns the property
+ * value of the given element.
+ *
+ * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for
+ * elements that have a matching property value, else false.
+ *
+ * If an object is provided for iteratee the created _.matches style callback returns true for elements that
+ * have the properties of the given object, else false.
+ *
+ * @param collection The collection to iterate over.
+ * @param iteratee The function invoked per iteration.
+ * @param thisArg The this binding of iteratee.
+ * @return Returns the composed aggregate object.
+ */
+ keyBy<T>(
+ collection: List<T>,
+ iteratee?: ListIterator<T, any>,
+ thisArg?: any
+ ): Dictionary<T>;
+
+ /**
+ * @see _.keyBy
+ */
+ keyBy<T>(
+ collection: NumericDictionary<T>,
+ iteratee?: NumericDictionaryIterator<T, any>,
+ thisArg?: any
+ ): Dictionary<T>;
+
+ /**
+ * @see _.keyBy
+ */
+ keyBy<T>(
+ collection: Dictionary<T>,
+ iteratee?: DictionaryIterator<T, any>,
+ thisArg?: any
+ ): Dictionary<T>;
+
+ /**
+ * @see _.keyBy
+ */
+ keyBy<T>(
+ collection: List<T>|NumericDictionary<T>|Dictionary<T>,
+ iteratee?: string,
+ thisArg?: any
+ ): Dictionary<T>;
+
+ /**
+ * @see _.keyBy
+ */
+ keyBy<W extends Object, T>(
+ collection: List<T>|NumericDictionary<T>|Dictionary<T>,
+ iteratee?: W
+ ): Dictionary<T>;
+
+ /**
+ * @see _.keyBy
+ */
+ keyBy<T>(
+ collection: List<T>|NumericDictionary<T>|Dictionary<T>,
+ iteratee?: Object
+ ): Dictionary<T>;
+ }
+
+ interface LoDashImplicitWrapper<T> {
+ /**
+ * @see _.keyBy
+ */
+ keyBy(
+ iteratee?: ListIterator<T, any>,
+ thisArg?: any
+ ): LoDashImplicitObjectWrapper<Dictionary<T>>;
+ }
+
+ interface LoDashImplicitArrayWrapper<T> {
+ /**
+ * @see _.keyBy
+ */
+ keyBy(
+ iteratee?: ListIterator<T, any>,
+ thisArg?: any
+ ): LoDashImplicitObjectWrapper<Dictionary<T>>;
+
+ /**
+ * @see _.keyBy
+ */
+ keyBy(
+ iteratee?: string,
+ thisArg?: any
+ ): LoDashImplicitObjectWrapper<Dictionary<T>>;
+
+ /**
+ * @see _.keyBy
+ */
+ keyBy<W extends Object>(
+ iteratee?: W
+ ): LoDashImplicitObjectWrapper<Dictionary<T>>;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.keyBy
+ */
+ keyBy<T>(
+ iteratee?: ListIterator<T, any>|NumericDictionaryIterator<T, any>|DictionaryIterator<T, any>,
+ thisArg?: any
+ ): LoDashImplicitObjectWrapper<Dictionary<T>>;
+
+ /**
+ * @see _.keyBy
+ */
+ keyBy<T>(
+ iteratee?: string,
+ thisArg?: any
+ ): LoDashImplicitObjectWrapper<Dictionary<T>>;
+
+ /**
+ * @see _.keyBy
+ */
+ keyBy<W extends Object, T>(
+ iteratee?: W
+ ): LoDashImplicitObjectWrapper<Dictionary<T>>;
+
+ /**
+ * @see _.keyBy
+ */
+ keyBy<T>(
+ iteratee?: Object
+ ): LoDashImplicitObjectWrapper<Dictionary<T>>;
+ }
+
+ interface LoDashExplicitWrapper<T> {
+ /**
+ * @see _.keyBy
+ */
+ keyBy(
+ iteratee?: ListIterator<T, any>,
+ thisArg?: any
+ ): LoDashExplicitObjectWrapper<Dictionary<T>>;
+ }
+
+ interface LoDashExplicitArrayWrapper<T> {
+ /**
+ * @see _.keyBy
+ */
+ keyBy(
+ iteratee?: ListIterator<T, any>,
+ thisArg?: any
+ ): LoDashExplicitObjectWrapper<Dictionary<T>>;
+
+ /**
+ * @see _.keyBy
+ */
+ keyBy(
+ iteratee?: string,
+ thisArg?: any
+ ): LoDashExplicitObjectWrapper<Dictionary<T>>;
+
+ /**
+ * @see _.keyBy
+ */
+ keyBy<W extends Object>(
+ iteratee?: W
+ ): LoDashExplicitObjectWrapper<Dictionary<T>>;
+ }
+
+ interface LoDashExplicitObjectWrapper<T> {
+ /**
+ * @see _.keyBy
+ */
+ keyBy<T>(
+ iteratee?: ListIterator<T, any>|NumericDictionaryIterator<T, any>|DictionaryIterator<T, any>,
+ thisArg?: any
+ ): LoDashExplicitObjectWrapper<Dictionary<T>>;
+
+ /**
+ * @see _.keyBy
+ */
+ keyBy<T>(
+ iteratee?: string,
+ thisArg?: any
+ ): LoDashExplicitObjectWrapper<Dictionary<T>>;
+
+ /**
+ * @see _.keyBy
+ */
+ keyBy<W extends Object, T>(
+ iteratee?: W
+ ): LoDashExplicitObjectWrapper<Dictionary<T>>;
+
+ /**
+ * @see _.keyBy
+ */
+ keyBy<T>(
+ iteratee?: Object
+ ): LoDashExplicitObjectWrapper<Dictionary<T>>;
+ }
+
+ //_.invokeMap
+ interface LoDashStatic {
+ /**
+ * Invokes the method named by methodName on each element in the collection returning
+ * an array of the results of each invoked method. Additional arguments will be provided
+ * to each invoked method. If methodName is a function it will be invoked for, and this
+ * bound to, each element in the collection.
+ * @param collection The collection to iterate over.
+ * @param methodName The name of the method to invoke.
+ * @param args Arguments to invoke the method with.
+ **/
+ invokeMap<T extends {}>(
+ collection: Array<T>,
+ methodName: string,
+ ...args: any[]): any;
+
+ /**
+ * @see _.invokeMap
+ **/
+ invokeMap<T extends {}>(
+ collection: List<T>,
+ methodName: string,
+ ...args: any[]): any;
+
+ /**
+ * @see _.invokeMap
+ **/
+ invokeMap<T extends {}>(
+ collection: Dictionary<T>,
+ methodName: string,
+ ...args: any[]): any;
+
+ /**
+ * @see _.invokeMap
+ **/
+ invokeMap<T extends {}>(
+ collection: Array<T>,
+ method: Function,
+ ...args: any[]): any;
+
+ /**
+ * @see _.invokeMap
+ **/
+ invokeMap<T extends {}>(
+ collection: List<T>,
+ method: Function,
+ ...args: any[]): any;
+
+ /**
+ * @see _.invokeMap
+ **/
+ invokeMap<T extends {}>(
+ collection: Dictionary<T>,
+ method: Function,
+ ...args: any[]): any;
+ }
+
+ //_.map
+ interface LoDashStatic {
+ /**
+ * Creates an array of values by running each element in collection through iteratee. The iteratee is bound to
+ * thisArg and invoked with three arguments: (value, index|key, collection).
+ *
+ * If a property name is provided for iteratee the created _.property style callback returns the property value
+ * of the given element.
+ *
+ * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for
+ * elements that have a matching property value, else false.
+ *
+ * If an object is provided for iteratee the created _.matches style callback returns true for elements that
+ * have the properties of the given object, else false.
+ *
+ * Many lodash methods are guarded to work as iteratees for methods like _.every, _.filter, _.map, _.mapValues,
+ * _.reject, and _.some.
+ *
+ * The guarded methods are:
+ * ary, callback, chunk, clone, create, curry, curryRight, drop, dropRight, every, fill, flatten, invert, max,
+ * min, parseInt, slice, sortBy, take, takeRight, template, trim, trimLeft, trimRight, trunc, random, range,
+ * sample, some, sum, uniq, and words
+ *
+ * @param collection The collection to iterate over.
+ * @param iteratee The function invoked per iteration.
+ * @param thisArg The this binding of iteratee.
+ * @return Returns the new mapped array.
+ */
+ map<T, TResult>(
+ collection: List<T>,
+ iteratee?: ListIterator<T, TResult>,
+ thisArg?: any
+ ): TResult[];
+
+ /**
+ * @see _.map
+ */
+ map<T extends {}, TResult>(
+ collection: Dictionary<T>,
+ iteratee?: DictionaryIterator<T, TResult>,
+ thisArg?: any
+ ): TResult[];
+
+ /**
+ * @see _.map
+ */
+ map<T, TResult>(
+ collection: List<T>|Dictionary<T>,
+ iteratee?: string
+ ): TResult[];
+
+ /**
+ * @see _.map
+ */
+ map<T, TObject extends {}>(
+ collection: List<T>|Dictionary<T>,
+ iteratee?: TObject
+ ): boolean[];
+ }
+
+ interface LoDashImplicitArrayWrapper<T> {
+ /**
+ * @see _.map
+ */
+ map<TResult>(
+ iteratee?: ListIterator<T, TResult>,
+ thisArg?: any
+ ): LoDashImplicitArrayWrapper<TResult>;
+
+ /**
+ * @see _.map
+ */
+ map<TResult>(
+ iteratee?: string
+ ): LoDashImplicitArrayWrapper<TResult>;
+
+ /**
+ * @see _.map
+ */
+ map<TObject extends {}>(
+ iteratee?: TObject
+ ): LoDashImplicitArrayWrapper<boolean>;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.map
+ */
+ map<TValue, TResult>(
+ iteratee?: ListIterator<TValue, TResult>|DictionaryIterator<TValue, TResult>,
+ thisArg?: any
+ ): LoDashImplicitArrayWrapper<TResult>;
+
+ /**
+ * @see _.map
+ */
+ map<TValue, TResult>(
+ iteratee?: string
+ ): LoDashImplicitArrayWrapper<TResult>;
+
+ /**
+ * @see _.map
+ */
+ map<TObject extends {}>(
+ iteratee?: TObject
+ ): LoDashImplicitArrayWrapper<boolean>;
+ }
+
+ interface LoDashExplicitArrayWrapper<T> {
+ /**
+ * @see _.map
+ */
+ map<TResult>(
+ iteratee?: ListIterator<T, TResult>,
+ thisArg?: any
+ ): LoDashExplicitArrayWrapper<TResult>;
+
+ /**
+ * @see _.map
+ */
+ map<TResult>(
+ iteratee?: string
+ ): LoDashExplicitArrayWrapper<TResult>;
+
+ /**
+ * @see _.map
+ */
+ map<TObject extends {}>(
+ iteratee?: TObject
+ ): LoDashExplicitArrayWrapper<boolean>;
+ }
+
+ interface LoDashExplicitObjectWrapper<T> {
+ /**
+ * @see _.map
+ */
+ map<TValue, TResult>(
+ iteratee?: ListIterator<TValue, TResult>|DictionaryIterator<TValue, TResult>,
+ thisArg?: any
+ ): LoDashExplicitArrayWrapper<TResult>;
+
+ /**
+ * @see _.map
+ */
+ map<TValue, TResult>(
+ iteratee?: string
+ ): LoDashExplicitArrayWrapper<TResult>;
+
+ /**
+ * @see _.map
+ */
+ map<TObject extends {}>(
+ iteratee?: TObject
+ ): LoDashExplicitArrayWrapper<boolean>;
+ }
+
+ //_.partition
+ interface LoDashStatic {
+ /**
+ * Creates an array of elements split into two groups, the first of which contains elements predicate returns truthy for,
+ * while the second of which contains elements predicate returns falsey for.
+ * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection).
+ *
+ * If a property name is provided for predicate the created _.property style callback
+ * returns the property value of the given element.
+ *
+ * If a value is also provided for thisArg the created _.matchesProperty style callback
+ * returns true for elements that have a matching property value, else false.
+ *
+ * If an object is provided for predicate the created _.matches style callback returns
+ * true for elements that have the properties of the given object, else false.
+ *
+ * @param collection The collection to iterate over.
+ * @param callback The function called per iteration.
+ * @param thisArg The this binding of predicate.
+ * @return Returns the array of grouped elements.
+ **/
+ partition<T>(
+ collection: List<T>,
+ callback: ListIterator<T, boolean>,
+ thisArg?: any): T[][];
+
+ /**
+ * @see _.partition
+ **/
+ partition<T>(
+ collection: Dictionary<T>,
+ callback: DictionaryIterator<T, boolean>,
+ thisArg?: any): T[][];
+
+ /**
+ * @see _.partition
+ **/
+ partition<W, T>(
+ collection: List<T>,
+ whereValue: W): T[][];
+
+ /**
+ * @see _.partition
+ **/
+ partition<W, T>(
+ collection: Dictionary<T>,
+ whereValue: W): T[][];
+
+ /**
+ * @see _.partition
+ **/
+ partition<T>(
+ collection: List<T>,
+ path: string,
+ srcValue: any): T[][];
+
+ /**
+ * @see _.partition
+ **/
+ partition<T>(
+ collection: Dictionary<T>,
+ path: string,
+ srcValue: any): T[][];
+
+ /**
+ * @see _.partition
+ **/
+ partition<T>(
+ collection: List<T>,
+ pluckValue: string): T[][];
+
+ /**
+ * @see _.partition
+ **/
+ partition<T>(
+ collection: Dictionary<T>,
+ pluckValue: string): T[][];
+ }
+
+ interface LoDashImplicitStringWrapper {
+ /**
+ * @see _.partition
+ */
+ partition(
+ callback: ListIterator<string, boolean>,
+ thisArg?: any): LoDashImplicitArrayWrapper<string[]>;
+ }
+
+ interface LoDashImplicitArrayWrapper<T> {
+ /**
+ * @see _.partition
+ */
+ partition(
+ callback: ListIterator<T, boolean>,
+ thisArg?: any): LoDashImplicitArrayWrapper<T[]>;
+ /**
+ * @see _.partition
+ */
+ partition<W>(
+ whereValue: W): LoDashImplicitArrayWrapper<T[]>;
+ /**
+ * @see _.partition
+ */
+ partition(
+ path: string,
+ srcValue: any): LoDashImplicitArrayWrapper<T[]>;
+ /**
+ * @see _.partition
+ */
+ partition(
+ pluckValue: string): LoDashImplicitArrayWrapper<T[]>;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.partition
+ */
+ partition<TResult>(
+ callback: ListIterator<TResult, boolean>,
+ thisArg?: any): LoDashImplicitArrayWrapper<TResult[]>;
+
+ /**
+ * @see _.partition
+ */
+ partition<TResult>(
+ callback: DictionaryIterator<TResult, boolean>,
+ thisArg?: any): LoDashImplicitArrayWrapper<TResult[]>;
+
+ /**
+ * @see _.partition
+ */
+ partition<W, TResult>(
+ whereValue: W): LoDashImplicitArrayWrapper<TResult[]>;
+
+ /**
+ * @see _.partition
+ */
+ partition<TResult>(
+ path: string,
+ srcValue: any): LoDashImplicitArrayWrapper<TResult[]>;
+
+ /**
+ * @see _.partition
+ */
+ partition<TResult>(
+ pluckValue: string): LoDashImplicitArrayWrapper<TResult[]>;
+ }
+
+ //_.reduce
+ interface LoDashStatic {
+ /**
+ * Reduces a collection to a value which is the accumulated result of running each
+ * element in the collection through the callback, where each successive callback execution
+ * consumes the return value of the previous execution. If accumulator is not provided the
+ * first element of the collection will be used as the initial accumulator value. The callback
+ * is bound to thisArg and invoked with four arguments; (accumulator, value, index|key, collection).
+ * @param collection The collection to iterate over.
+ * @param callback The function called per iteration.
+ * @param accumulator Initial value of the accumulator.
+ * @param thisArg The this binding of callback.
+ * @return Returns the accumulated value.
+ **/
+ reduce<T, TResult>(
+ collection: Array<T>,
+ callback: MemoIterator<T, TResult>,
+ accumulator: TResult,
+ thisArg?: any): TResult;
+
+ /**
+ * @see _.reduce
+ **/
+ reduce<T, TResult>(
+ collection: List<T>,
+ callback: MemoIterator<T, TResult>,
+ accumulator: TResult,
+ thisArg?: any): TResult;
+
+ /**
+ * @see _.reduce
+ **/
+ reduce<T, TResult>(
+ collection: Dictionary<T>,
+ callback: MemoIterator<T, TResult>,
+ accumulator: TResult,
+ thisArg?: any): TResult;
+
+ /**
+ * @see _.reduce
+ **/
+ reduce<T, TResult>(
+ collection: Array<T>,
+ callback: MemoIterator<T, TResult>,
+ thisArg?: any): TResult;
+
+ /**
+ * @see _.reduce
+ **/
+ reduce<T, TResult>(
+ collection: List<T>,
+ callback: MemoIterator<T, TResult>,
+ thisArg?: any): TResult;
+
+ /**
+ * @see _.reduce
+ **/
+ reduce<T, TResult>(
+ collection: Dictionary<T>,
+ callback: MemoIterator<T, TResult>,
+ thisArg?: any): TResult;
+
+ }
+
+ interface LoDashImplicitArrayWrapper<T> {
+ /**
+ * @see _.reduce
+ **/
+ reduce<TResult>(
+ callback: MemoIterator<T, TResult>,
+ accumulator: TResult,
+ thisArg?: any): TResult;
+
+ /**
+ * @see _.reduce
+ **/
+ reduce<TResult>(
+ callback: MemoIterator<T, TResult>,
+ thisArg?: any): TResult;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.reduce
+ **/
+ reduce<TValue, TResult>(
+ callback: MemoIterator<TValue, TResult>,
+ accumulator: TResult,
+ thisArg?: any): TResult;
+
+ /**
+ * @see _.reduce
+ **/
+ reduce<TValue, TResult>(
+ callback: MemoIterator<TValue, TResult>,
+ thisArg?: any): TResult;
+ }
+
+ //_.reduceRight
+ interface LoDashStatic {
+ /**
+ * This method is like _.reduce except that it iterates over elements of a collection from
+ * right to left.
+ * @param collection The collection to iterate over.
+ * @param callback The function called per iteration.
+ * @param accumulator Initial value of the accumulator.
+ * @param thisArg The this binding of callback.
+ * @return The accumulated value.
+ **/
+ reduceRight<T, TResult>(
+ collection: Array<T>,
+ callback: MemoIterator<T, TResult>,
+ accumulator: TResult,
+ thisArg?: any): TResult;
+
+ /**
+ * @see _.reduceRight
+ **/
+ reduceRight<T, TResult>(
+ collection: List<T>,
+ callback: MemoIterator<T, TResult>,
+ accumulator: TResult,
+ thisArg?: any): TResult;
+
+ /**
+ * @see _.reduceRight
+ **/
+ reduceRight<T, TResult>(
+ collection: Dictionary<T>,
+ callback: MemoIterator<T, TResult>,
+ accumulator: TResult,
+ thisArg?: any): TResult;
+
+ /**
+ * @see _.reduceRight
+ **/
+ reduceRight<T, TResult>(
+ collection: Array<T>,
+ callback: MemoIterator<T, TResult>,
+ thisArg?: any): TResult;
+
+ /**
+ * @see _.reduceRight
+ **/
+ reduceRight<T, TResult>(
+ collection: List<T>,
+ callback: MemoIterator<T, TResult>,
+ thisArg?: any): TResult;
+
+ /**
+ * @see _.reduceRight
+ **/
+ reduceRight<T, TResult>(
+ collection: Dictionary<T>,
+ callback: MemoIterator<T, TResult>,
+ thisArg?: any): TResult;
+ }
+
+ //_.reject
+ interface LoDashStatic {
+ /**
+ * The opposite of _.filter; this method returns the elements of collection that predicate does not return
+ * truthy for.
+ *
+ * @param collection The collection to iterate over.
+ * @param predicate The function invoked per iteration.
+ * @param thisArg The this binding of predicate.
+ * @return Returns the new filtered array.
+ */
+ reject<T>(
+ collection: List<T>,
+ predicate?: ListIterator<T, boolean>,
+ thisArg?: any
+ ): T[];
+
+ /**
+ * @see _.reject
+ */
+ reject<T>(
+ collection: Dictionary<T>,
+ predicate?: DictionaryIterator<T, boolean>,
+ thisArg?: any
+ ): T[];
+
+ /**
+ * @see _.reject
+ */
+ reject(
+ collection: string,
+ predicate?: StringIterator<boolean>,
+ thisArg?: any
+ ): string[];
+
+ /**
+ * @see _.reject
+ */
+ reject<T>(
+ collection: List<T>|Dictionary<T>,
+ predicate: string,
+ thisArg?: any
+ ): T[];
+
+ /**
+ * @see _.reject
+ */
+ reject<W extends {}, T>(
+ collection: List<T>|Dictionary<T>,
+ predicate: W
+ ): T[];
+ }
+
+ interface LoDashImplicitWrapper<T> {
+ /**
+ * @see _.reject
+ */
+ reject(
+ predicate?: StringIterator<boolean>,
+ thisArg?: any
+ ): LoDashImplicitArrayWrapper<string>;
+ }
+
+ interface LoDashImplicitArrayWrapper<T> {
+ /**
+ * @see _.reject
+ */
+ reject(
+ predicate: ListIterator<T, boolean>,
+ thisArg?: any
+ ): LoDashImplicitArrayWrapper<T>;
+
+ /**
+ * @see _.reject
+ */
+ reject(
+ predicate: string,
+ thisArg?: any
+ ): LoDashImplicitArrayWrapper<T>;
+
+ /**
+ * @see _.reject
+ */
+ reject<W>(predicate: W): LoDashImplicitArrayWrapper<T>;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.reject
+ */
+ reject<T>(
+ predicate: ListIterator<T, boolean>|DictionaryIterator<T, boolean>,
+ thisArg?: any
+ ): LoDashImplicitArrayWrapper<T>;
+
+ /**
+ * @see _.reject
+ */
+ reject<T>(
+ predicate: string,
+ thisArg?: any
+ ): LoDashImplicitArrayWrapper<T>;
+
+ /**
+ * @see _.reject
+ */
+ reject<W, T>(predicate: W): LoDashImplicitArrayWrapper<T>;
+ }
+
+ interface LoDashExplicitWrapper<T> {
+ /**
+ * @see _.reject
+ */
+ reject(
+ predicate?: StringIterator<boolean>,
+ thisArg?: any
+ ): LoDashExplicitArrayWrapper<string>;
+ }
+
+ interface LoDashExplicitArrayWrapper<T> {
+ /**
+ * @see _.reject
+ */
+ reject(
+ predicate: ListIterator<T, boolean>,
+ thisArg?: any
+ ): LoDashExplicitArrayWrapper<T>;
+
+ /**
+ * @see _.reject
+ */
+ reject(
+ predicate: string,
+ thisArg?: any
+ ): LoDashExplicitArrayWrapper<T>;
+
+ /**
+ * @see _.reject
+ */
+ reject<W>(predicate: W): LoDashExplicitArrayWrapper<T>;
+ }
+
+ interface LoDashExplicitObjectWrapper<T> {
+ /**
+ * @see _.reject
+ */
+ reject<T>(
+ predicate: ListIterator<T, boolean>|DictionaryIterator<T, boolean>,
+ thisArg?: any
+ ): LoDashExplicitArrayWrapper<T>;
+
+ /**
+ * @see _.reject
+ */
+ reject<T>(
+ predicate: string,
+ thisArg?: any
+ ): LoDashExplicitArrayWrapper<T>;
+
+ /**
+ * @see _.reject
+ */
+ reject<W, T>(predicate: W): LoDashExplicitArrayWrapper<T>;
+ }
+
+ //_.sample
+ interface LoDashStatic {
+ /**
+ * Gets a random element from `collection`.
+ *
+ * @static
+ * @memberOf _
+ * @category Collection
+ * @param {Array|Object} collection The collection to sample.
+ * @returns {*} Returns the random element.
+ * @example
+ *
+ * _.sample([1, 2, 3, 4]);
+ * // => 2
+ */
+ sample<T>(collection: Array<T>): T;
+
+ /**
+ * @see _.sample
+ **/
+ sample<T>(collection: List<T>): T;
+
+ /**
+ * @see _.sample
+ **/
+ sample<T>(collection: Dictionary<T>): T;
+ }
+
+ interface LoDashImplicitArrayWrapper<T> {
+ /**
+ * @see _.sample
+ **/
+ sample(): LoDashImplicitWrapper<T>;
+ }
+
+ //_.sampleSize
+ interface LoDashStatic {
+ /**
+ * Gets `n` random elements from `collection`.
+ *
+ * @static
+ * @memberOf _
+ * @category Collection
+ * @param {Array|Object} collection The collection to sample.
+ * @param {number} [n=0] The number of elements to sample.
+ * @returns {Array} Returns the random elements.
+ * @example
+ *
+ * _.sampleSize([1, 2, 3, 4], 2);
+ * // => [3, 1]
+ */
+ sampleSize<T>(collection: Array<T>, n: number): T[];
+
+ /**
+ * @see _.sampleSize
+ **/
+ sampleSize<T>(collection: List<T>, n: number): T[];
+
+ /**
+ * @see _.sampleSize
+ **/
+ sampleSize<T>(collection: Dictionary<T>, n: number): T[];
+ }
+
+ interface LoDashImplicitArrayWrapper<T> {
+ /**
+ * @see _.sampleSize
+ **/
+ sampleSize(n: number): LoDashImplicitArrayWrapper<T>;
+
+ /**
+ * @see _.sampleSize
+ **/
+ sampleSize(): LoDashImplicitWrapper<T>;
+ }
+
+ //_.shuffle
+ interface LoDashStatic {
+ /**
+ * Creates an array of shuffled values, using a version of the Fisher-Yates shuffle.
+ *
+ * @param collection The collection to shuffle.
+ * @return Returns the new shuffled array.
+ */
+ shuffle<T>(collection: List<T>|Dictionary<T>): T[];
+
+ /**
+ * @see _.shuffle
+ */
+ shuffle(collection: string): string[];
+ }
+
+ interface LoDashImplicitWrapper<T> {
+ /**
+ * @see _.shuffle
+ */
+ shuffle(): LoDashImplicitArrayWrapper<string>;
+ }
+
+ interface LoDashImplicitArrayWrapper<T> {
+ /**
+ * @see _.shuffle
+ */
+ shuffle(): LoDashImplicitArrayWrapper<T>;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.shuffle
+ */
+ shuffle<T>(): LoDashImplicitArrayWrapper<T>;
+ }
+
+ interface LoDashExplicitWrapper<T> {
+ /**
+ * @see _.shuffle
+ */
+ shuffle(): LoDashExplicitArrayWrapper<string>;
+ }
+
+ interface LoDashExplicitArrayWrapper<T> {
+ /**
+ * @see _.shuffle
+ */
+ shuffle(): LoDashExplicitArrayWrapper<T>;
+ }
+
+ interface LoDashExplicitObjectWrapper<T> {
+ /**
+ * @see _.shuffle
+ */
+ shuffle<T>(): LoDashExplicitArrayWrapper<T>;
+ }
+
+ //_.size
+ interface LoDashStatic {
+ /**
+ * Gets the size of collection by returning its length for array-like values or the number of own enumerable
+ * properties for objects.
+ *
+ * @param collection The collection to inspect.
+ * @return Returns the size of collection.
+ */
+ size<T>(collection: List<T>|Dictionary<T>): number;
+
+ /**
+ * @see _.size
+ */
+ size(collection: string): number;
+ }
+
+ interface LoDashImplicitWrapper<T> {
+ /**
+ * @see _.size
+ */
+ size(): number;
+ }
+
+ interface LoDashImplicitArrayWrapper<T> {
+ /**
+ * @see _.size
+ */
+ size(): number;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.size
+ */
+ size(): number;
+ }
+
+ interface LoDashExplicitWrapper<T> {
+ /**
+ * @see _.size
+ */
+ size(): LoDashExplicitWrapper<number>;
+ }
+
+ interface LoDashExplicitArrayWrapper<T> {
+ /**
+ * @see _.size
+ */
+ size(): LoDashExplicitWrapper<number>;
+ }
+
+ interface LoDashExplicitObjectWrapper<T> {
+ /**
+ * @see _.size
+ */
+ size(): LoDashExplicitWrapper<number>;
+ }
+
+ //_.some
+ interface LoDashStatic {
+ /**
+ * Checks if predicate returns truthy for any element of collection. The function returns as soon as it finds
+ * a passing value and does not iterate over the entire collection. The predicate is bound to thisArg and
+ * invoked with three arguments: (value, index|key, collection).
+ *
+ * If a property name is provided for predicate the created _.property style callback returns the property
+ * value of the given element.
+ *
+ * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for
+ * elements that have a matching property value, else false.
+ *
+ * If an object is provided for predicate the created _.matches style callback returns true for elements that
+ * have the properties of the given object, else false.
+ *
+ * @param collection The collection to iterate over.
+ * @param predicate The function invoked per iteration.
+ * @param thisArg The this binding of predicate.
+ * @return Returns true if any element passes the predicate check, else false.
+ */
+ some<T>(
+ collection: List<T>,
+ predicate?: ListIterator<T, boolean>,
+ thisArg?: any
+ ): boolean;
+
+ /**
+ * @see _.some
+ */
+ some<T>(
+ collection: Dictionary<T>,
+ predicate?: DictionaryIterator<T, boolean>,
+ thisArg?: any
+ ): boolean;
+
+ /**
+ * @see _.some
+ */
+ some<T>(
+ collection: NumericDictionary<T>,
+ predicate?: NumericDictionaryIterator<T, boolean>,
+ thisArg?: any
+ ): boolean;
+
+ /**
+ * @see _.some
+ */
+ some<T>(
+ collection: List<T>|Dictionary<T>|NumericDictionary<T>,
+ predicate?: string,
+ thisArg?: any
+ ): boolean;
+
+ /**
+ * @see _.some
+ */
+ some<TObject extends {}, T>(
+ collection: List<T>|Dictionary<T>|NumericDictionary<T>,
+ predicate?: TObject
+ ): boolean;
+ }
+
+ interface LoDashImplicitArrayWrapper<T> {
+ /**
+ * @see _.some
+ */
+ some(
+ predicate?: ListIterator<T, boolean>|NumericDictionaryIterator<T, boolean>,
+ thisArg?: any
+ ): boolean;
+
+ /**
+ * @see _.some
+ */
+ some(
+ predicate?: string,
+ thisArg?: any
+ ): boolean;
+
+ /**
+ * @see _.some
+ */
+ some<TObject extends {}>(
+ predicate?: TObject
+ ): boolean;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.some
+ */
+ some<TResult>(
+ predicate?: ListIterator<TResult, boolean>|DictionaryIterator<TResult, boolean>|NumericDictionaryIterator<T, boolean>,
+ thisArg?: any
+ ): boolean;
+
+ /**
+ * @see _.some
+ */
+ some(
+ predicate?: string,
+ thisArg?: any
+ ): boolean;
+
+ /**
+ * @see _.some
+ */
+ some<TObject extends {}>(
+ predicate?: TObject
+ ): boolean;
+ }
+
+ interface LoDashExplicitArrayWrapper<T> {
+ /**
+ * @see _.some
+ */
+ some(
+ predicate?: ListIterator<T, boolean>|NumericDictionaryIterator<T, boolean>,
+ thisArg?: any
+ ): LoDashExplicitWrapper<boolean>;
+
+ /**
+ * @see _.some
+ */
+ some(
+ predicate?: string,
+ thisArg?: any
+ ): LoDashExplicitWrapper<boolean>;
+
+ /**
+ * @see _.some
+ */
+ some<TObject extends {}>(
+ predicate?: TObject
+ ): LoDashExplicitWrapper<boolean>;
+ }
+
+ interface LoDashExplicitObjectWrapper<T> {
+ /**
+ * @see _.some
+ */
+ some<TResult>(
+ predicate?: ListIterator<TResult, boolean>|DictionaryIterator<TResult, boolean>|NumericDictionaryIterator<T, boolean>,
+ thisArg?: any
+ ): LoDashExplicitWrapper<boolean>;
+
+ /**
+ * @see _.some
+ */
+ some(
+ predicate?: string,
+ thisArg?: any
+ ): LoDashExplicitWrapper<boolean>;
+
+ /**
+ * @see _.some
+ */
+ some<TObject extends {}>(
+ predicate?: TObject
+ ): LoDashExplicitWrapper<boolean>;
+ }
+
+ //_.sortBy
+ interface LoDashStatic {
+ /**
+ * Creates an array of elements, sorted in ascending order by the results of
+ * running each element in a collection through each iteratee. This method
+ * performs a stable sort, that is, it preserves the original sort order of
+ * equal elements. The iteratees are invoked with one argument: (value).
+ *
+ * @static
+ * @memberOf _
+ * @category Collection
+ * @param {Array|Object} collection The collection to iterate over.
+ * @param {...(Function|Function[]|Object|Object[]|string|string[])} [iteratees=[_.identity]]
+ * The iteratees to sort by, specified individually or in arrays.
+ * @returns {Array} Returns the new sorted array.
+ * @example
+ *
+ * var users = [
+ * { 'user': 'fred', 'age': 48 },
+ * { 'user': 'barney', 'age': 36 },
+ * { 'user': 'fred', 'age': 42 },
+ * { 'user': 'barney', 'age': 34 }
+ * ];
+ *
+ * _.sortBy(users, function(o) { return o.user; });
+ * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]]
+ *
+ * _.sortBy(users, ['user', 'age']);
+ * // => objects for [['barney', 34], ['barney', 36], ['fred', 42], ['fred', 48]]
+ *
+ * _.sortBy(users, 'user', function(o) {
+ * return Math.floor(o.age / 10);
+ * });
+ * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]]
+ */
+ sortBy<T, TSort>(
+ collection: List<T>,
+ iteratee?: ListIterator<T, TSort>
+ ): T[];
+
+ /**
+ * @see _.sortBy
+ */
+ sortBy<T, TSort>(
+ collection: Dictionary<T>,
+ iteratee?: DictionaryIterator<T, TSort>
+ ): T[];
+
+ /**
+ * @see _.sortBy
+ */
+ sortBy<T>(
+ collection: List<T>|Dictionary<T>,
+ iteratee: string
+ ): T[];
+
+ /**
+ * @see _.sortBy
+ */
+ sortBy<W extends {}, T>(
+ collection: List<T>|Dictionary<T>,
+ whereValue: W
+ ): T[];
+
+ /**
+ * @see _.sortBy
+ */
+ sortBy<T>(
+ collection: List<T>|Dictionary<T>
+ ): T[];
+
+ /**
+ * @see _.sortBy
+ */
+ sortBy<T>(
+ collection: (Array<T>|List<T>),
+ iteratees: (ListIterator<T, any>|string|Object)[]): T[];
+
+ /**
+ * @see _.sortBy
+ */
+ sortBy<T>(
+ collection: (Array<T>|List<T>),
+ ...iteratees: (ListIterator<T, boolean>|Object|string)[]): T[];
+ }
+
+ interface LoDashImplicitArrayWrapper<T> {
+ /**
+ * @see _.sortBy
+ */
+ sortBy<TSort>(
+ iteratee?: ListIterator<T, TSort>
+ ): LoDashImplicitArrayWrapper<T>;
+
+ /**
+ * @see _.sortBy
+ */
+ sortBy(iteratee: string): LoDashImplicitArrayWrapper<T>;
+
+ /**
+ * @see _.sortBy
+ */
+ sortBy<W extends {}>(whereValue: W): LoDashImplicitArrayWrapper<T>;
+
+ /**
+ * @see _.sortBy
+ */
+ sortBy(): LoDashImplicitArrayWrapper<T>;
+
+ /**
+ * @see _.sortBy
+ */
+ sortBy(...iteratees: (ListIterator<T, boolean>|Object|string)[]): LoDashImplicitArrayWrapper<T>;
+
+ /**
+ * @see _.sortBy
+ **/
+ sortBy(iteratees: (ListIterator<T, any>|string|Object)[]): LoDashImplicitArrayWrapper<T>;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.sortBy
+ */
+ sortBy<T, TSort>(
+ iteratee?: ListIterator<T, TSort>|DictionaryIterator<T, TSort>
+ ): LoDashImplicitArrayWrapper<T>;
+
+ /**
+ * @see _.sortBy
+ */
+ sortBy<T>(iteratee: string): LoDashImplicitArrayWrapper<T>;
+
+ /**
+ * @see _.sortBy
+ */
+ sortBy<W extends {}, T>(whereValue: W): LoDashImplicitArrayWrapper<T>;
+
+ /**
+ * @see _.sortBy
+ */
+ sortBy<T>(): LoDashImplicitArrayWrapper<T>;
+ }
+
+ interface LoDashExplicitArrayWrapper<T> {
+ /**
+ * @see _.sortBy
+ */
+ sortBy<TSort>(
+ iteratee?: ListIterator<T, TSort>
+ ): LoDashExplicitArrayWrapper<T>;
+
+ /**
+ * @see _.sortBy
+ */
+ sortBy(iteratee: string): LoDashExplicitArrayWrapper<T>;
+
+ /**
+ * @see _.sortBy
+ */
+ sortBy<W extends {}>(whereValue: W): LoDashExplicitArrayWrapper<T>;
+
+ /**
+ * @see _.sortBy
+ */
+ sortBy(): LoDashExplicitArrayWrapper<T>;
+ }
+
+ interface LoDashExplicitObjectWrapper<T> {
+ /**
+ * @see _.sortBy
+ */
+ sortBy<T, TSort>(
+ iteratee?: ListIterator<T, TSort>|DictionaryIterator<T, TSort>
+ ): LoDashExplicitArrayWrapper<T>;
+
+ /**
+ * @see _.sortBy
+ */
+ sortBy<T>(iteratee: string): LoDashExplicitArrayWrapper<T>;
+
+ /**
+ * @see _.sortBy
+ */
+ sortBy<W extends {}, T>(whereValue: W): LoDashExplicitArrayWrapper<T>;
+
+ /**
+ * @see _.sortBy
+ */
+ sortBy<T>(): LoDashExplicitArrayWrapper<T>;
+ }
+
+ //_.orderBy
+ interface LoDashStatic {
+ /**
+ * This method is like `_.sortBy` except that it allows specifying the sort
+ * orders of the iteratees to sort by. If `orders` is unspecified, all values
+ * are sorted in ascending order. Otherwise, specify an order of "desc" for
+ * descending or "asc" for ascending sort order of corresponding values.
+ *
+ * @static
+ * @memberOf _
+ * @category Collection
+ * @param {Array|Object} collection The collection to iterate over.
+ * @param {Function[]|Object[]|string[]} [iteratees=[_.identity]] The iteratees to sort by.
+ * @param {string[]} [orders] The sort orders of `iteratees`.
+ * @param- {Object} [guard] Enables use as an iteratee for functions like `_.reduce`.
+ * @returns {Array} Returns the new sorted array.
+ * @example
+ *
+ * var users = [
+ * { 'user': 'fred', 'age': 48 },
+ * { 'user': 'barney', 'age': 34 },
+ * { 'user': 'fred', 'age': 42 },
+ * { 'user': 'barney', 'age': 36 }
+ * ];
+ *
+ * // sort by `user` in ascending order and by `age` in descending order
+ * _.orderBy(users, ['user', 'age'], ['asc', 'desc']);
+ * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]]
+ */
+ orderBy<W extends Object, T>(
+ collection: List<T>,
+ iteratees: ListIterator<T, any>|string|W|(ListIterator<T, any>|string|W)[],
+ orders?: boolean|string|(boolean|string)[]
+ ): T[];
+
+ /**
+ * @see _.orderBy
+ */
+ orderBy<T>(
+ collection: List<T>,
+ iteratees: ListIterator<T, any>|string|Object|(ListIterator<T, any>|string|Object)[],
+ orders?: boolean|string|(boolean|string)[]
+ ): T[];
+
+ /**
+ * @see _.orderBy
+ */
+ orderBy<W extends Object, T>(
+ collection: NumericDictionary<T>,
+ iteratees: NumericDictionaryIterator<T, any>|string|W|(NumericDictionaryIterator<T, any>|string|W)[],
+ orders?: boolean|string|(boolean|string)[]
+ ): T[];
+
+ /**
+ * @see _.orderBy
+ */
+ orderBy<T>(
+ collection: NumericDictionary<T>,
+ iteratees: NumericDictionaryIterator<T, any>|string|Object|(NumericDictionaryIterator<T, any>|string|Object)[],
+ orders?: boolean|string|(boolean|string)[]
+ ): T[];
+
+ /**
+ * @see _.orderBy
+ */
+ orderBy<W extends Object, T>(
+ collection: Dictionary<T>,
+ iteratees: DictionaryIterator<T, any>|string|W|(DictionaryIterator<T, any>|string|W)[],
+ orders?: boolean|string|(boolean|string)[]
+ ): T[];
+
+ /**
+ * @see _.orderBy
+ */
+ orderBy<T>(
+ collection: Dictionary<T>,
+ iteratees: DictionaryIterator<T, any>|string|Object|(DictionaryIterator<T, any>|string|Object)[],
+ orders?: boolean|string|(boolean|string)[]
+ ): T[];
+ }
+
+ interface LoDashImplicitWrapper<T> {
+ /**
+ * @see _.orderBy
+ */
+ orderBy(
+ iteratees: ListIterator<T, any>|string|(ListIterator<T, any>|string)[],
+ orders?: boolean|string|(boolean|string)[]
+ ): LoDashImplicitArrayWrapper<T>;
+ }
+
+ interface LoDashImplicitArrayWrapper<T> {
+ /**
+ * @see _.orderBy
+ */
+ orderBy<W extends Object>(
+ iteratees: ListIterator<T, any>|string|W|(ListIterator<T, any>|string|W)[],
+ orders?: boolean|string|(boolean|string)[]
+ ): LoDashImplicitArrayWrapper<T>;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.orderBy
+ */
+ orderBy<W extends Object, T>(
+ iteratees: ListIterator<T, any>|string|W|(ListIterator<T, any>|string|W)[],
+ orders?: boolean|string|(boolean|string)[]
+ ): LoDashImplicitArrayWrapper<T>;
+
+ /**
+ * @see _.orderBy
+ */
+ orderBy<T>(
+ iteratees: ListIterator<T, any>|string|Object|(ListIterator<T, any>|string|Object)[],
+ orders?: boolean|string|(boolean|string)[]
+ ): LoDashImplicitArrayWrapper<T>;
+
+ /**
+ * @see _.orderBy
+ */
+ orderBy<W extends Object, T>(
+ iteratees: NumericDictionaryIterator<T, any>|string|W|(NumericDictionaryIterator<T, any>|string|W)[],
+ orders?: boolean|string|(boolean|string)[]
+ ): LoDashImplicitArrayWrapper<T>;
+
+ /**
+ * @see _.orderBy
+ */
+ orderBy<T>(
+ iteratees: NumericDictionaryIterator<T, any>|string|Object|(NumericDictionaryIterator<T, any>|string|Object)[],
+ orders?: boolean|string|(boolean|string)[]
+ ): LoDashImplicitArrayWrapper<T>;
+
+ /**
+ * @see _.orderBy
+ */
+ orderBy<W extends Object, T>(
+ iteratees: DictionaryIterator<T, any>|string|W|(DictionaryIterator<T, any>|string|W)[],
+ orders?: boolean|string|(boolean|string)[]
+ ): LoDashImplicitArrayWrapper<T>;
+
+ /**
+ * @see _.orderBy
+ */
+ orderBy<T>(
+ iteratees: DictionaryIterator<T, any>|string|Object|(DictionaryIterator<T, any>|string|Object)[],
+ orders?: boolean|string|(boolean|string)[]
+ ): LoDashImplicitArrayWrapper<T>;
+ }
+
+ interface LoDashExplicitWrapper<T> {
+ /**
+ * @see _.orderBy
+ */
+ orderBy(
+ iteratees: ListIterator<T, any>|string|(ListIterator<T, any>|string)[],
+ orders?: boolean|string|(boolean|string)[]
+ ): LoDashExplicitArrayWrapper<T>;
+ }
+
+ interface LoDashExplicitArrayWrapper<T> {
+ /**
+ * @see _.orderBy
+ */
+ orderBy<W extends Object>(
+ iteratees: ListIterator<T, any>|string|W|(ListIterator<T, any>|string|W)[],
+ orders?: boolean|string|(boolean|string)[]
+ ): LoDashExplicitArrayWrapper<T>;
+ }
+
+ interface LoDashExplicitObjectWrapper<T> {
+ /**
+ * @see _.orderBy
+ */
+ orderBy<W extends Object, T>(
+ iteratees: ListIterator<T, any>|string|W|(ListIterator<T, any>|string|W)[],
+ orders?: boolean|string|(boolean|string)[]
+ ): LoDashExplicitArrayWrapper<T>;
+
+ /**
+ * @see _.orderBy
+ */
+ orderBy<T>(
+ iteratees: ListIterator<T, any>|string|Object|(ListIterator<T, any>|string|Object)[],
+ orders?: boolean|string|(boolean|string)[]
+ ): LoDashExplicitArrayWrapper<T>;
+
+ /**
+ * @see _.orderBy
+ */
+ orderBy<W extends Object, T>(
+ iteratees: NumericDictionaryIterator<T, any>|string|W|(NumericDictionaryIterator<T, any>|string|W)[],
+ orders?: boolean|string|(boolean|string)[]
+ ): LoDashExplicitArrayWrapper<T>;
+
+ /**
+ * @see _.orderBy
+ */
+ orderBy<T>(
+ iteratees: NumericDictionaryIterator<T, any>|string|Object|(NumericDictionaryIterator<T, any>|string|Object)[],
+ orders?: boolean|string|(boolean|string)[]
+ ): LoDashExplicitArrayWrapper<T>;
+
+ /**
+ * @see _.orderBy
+ */
+ orderBy<W extends Object, T>(
+ iteratees: DictionaryIterator<T, any>|string|W|(DictionaryIterator<T, any>|string|W)[],
+ orders?: boolean|string|(boolean|string)[]
+ ): LoDashExplicitArrayWrapper<T>;
+
+ /**
+ * @see _.orderBy
+ */
+ orderBy<T>(
+ iteratees: DictionaryIterator<T, any>|string|Object|(DictionaryIterator<T, any>|string|Object)[],
+ orders?: boolean|string|(boolean|string)[]
+ ): LoDashExplicitArrayWrapper<T>;
+ }
+
+ /********
+ * Date *
+ ********/
+
+ //_.now
+ interface LoDashStatic {
+ /**
+ * Gets the number of milliseconds that have elapsed since the Unix epoch (1 January 1970 00:00:00 UTC).
+ *
+ * @return The number of milliseconds.
+ */
+ now(): number;
+ }
+
+ interface LoDashImplicitWrapperBase<T, TWrapper> {
+ /**
+ * @see _.now
+ */
+ now(): number;
+ }
+
+ interface LoDashExplicitWrapperBase<T, TWrapper> {
+ /**
+ * @see _.now
+ */
+ now(): LoDashExplicitWrapper<number>;
+ }
+
+ /*************
+ * Functions *
+ *************/
+
+ //_.after
+ interface LoDashStatic {
+ /**
+ * The opposite of _.before; this method creates a function that invokes func once it’s called n or more times.
+ *
+ * @param n The number of calls before func is invoked.
+ * @param func The function to restrict.
+ * @return Returns the new restricted function.
+ */
+ after<TFunc extends Function>(
+ n: number,
+ func: TFunc
+ ): TFunc;
+ }
+
+ interface LoDashImplicitWrapper<T> {
+ /**
+ * @see _.after
+ **/
+ after<TFunc extends Function>(func: TFunc): LoDashImplicitObjectWrapper<TFunc>;
+ }
+
+ interface LoDashExplicitWrapper<T> {
+ /**
+ * @see _.after
+ **/
+ after<TFunc extends Function>(func: TFunc): LoDashExplicitObjectWrapper<TFunc>;
+ }
+
+ //_.ary
+ interface LoDashStatic {
+ /**
+ * Creates a function that accepts up to n arguments ignoring any additional arguments.
+ *
+ * @param func The function to cap arguments for.
+ * @param n The arity cap.
+ * @returns Returns the new function.
+ */
+ ary<TResult extends Function>(
+ func: Function,
+ n?: number
+ ): TResult;
+
+ ary<T extends Function, TResult extends Function>(
+ func: T,
+ n?: number
+ ): TResult;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.ary
+ */
+ ary<TResult extends Function>(n?: number): LoDashImplicitObjectWrapper<TResult>;
+ }
+
+ interface LoDashExplicitObjectWrapper<T> {
+ /**
+ * @see _.ary
+ */
+ ary<TResult extends Function>(n?: number): LoDashExplicitObjectWrapper<TResult>;
+ }
+
+ //_.before
+ interface LoDashStatic {
+ /**
+ * Creates a function that invokes func, with the this binding and arguments of the created function, while
+ * it’s called less than n times. Subsequent calls to the created function return the result of the last func
+ * invocation.
+ *
+ * @param n The number of calls at which func is no longer invoked.
+ * @param func The function to restrict.
+ * @return Returns the new restricted function.
+ */
+ before<TFunc extends Function>(
+ n: number,
+ func: TFunc
+ ): TFunc;
+ }
+
+ interface LoDashImplicitWrapper<T> {
+ /**
+ * @see _.before
+ **/
+ before<TFunc extends Function>(func: TFunc): LoDashImplicitObjectWrapper<TFunc>;
+ }
+
+ interface LoDashExplicitWrapper<T> {
+ /**
+ * @see _.before
+ **/
+ before<TFunc extends Function>(func: TFunc): LoDashExplicitObjectWrapper<TFunc>;
+ }
+
+ //_.bind
+ interface FunctionBind {
+ placeholder: any;
+
+ <T extends Function, TResult extends Function>(
+ func: T,
+ thisArg: any,
+ ...partials: any[]
+ ): TResult;
+
+ <TResult extends Function>(
+ func: Function,
+ thisArg: any,
+ ...partials: any[]
+ ): TResult;
+ }
+
+ interface LoDashStatic {
+ /**
+ * Creates a function that invokes func with the this binding of thisArg and prepends any additional _.bind
+ * arguments to those provided to the bound function.
+ *
+ * The _.bind.placeholder value, which defaults to _ in monolithic builds, may be used as a placeholder for
+ * partially applied arguments.
+ *
+ * Note: Unlike native Function#bind this method does not set the "length" property of bound functions.
+ *
+ * @param func The function to bind.
+ * @param thisArg The this binding of func.
+ * @param partials The arguments to be partially applied.
+ * @return Returns the new bound function.
+ */
+ bind: FunctionBind;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.bind
+ */
+ bind<TResult extends Function>(
+ thisArg: any,
+ ...partials: any[]
+ ): LoDashImplicitObjectWrapper<TResult>;
+ }
+
+ interface LoDashExplicitObjectWrapper<T> {
+ /**
+ * @see _.bind
+ */
+ bind<TResult extends Function>(
+ thisArg: any,
+ ...partials: any[]
+ ): LoDashExplicitObjectWrapper<TResult>;
+ }
+
+ //_.bindAll
+ interface LoDashStatic {
+ /**
+ * Binds methods of an object to the object itself, overwriting the existing method. Method names may be
+ * specified as individual arguments or as arrays of method names. If no method names are provided all
+ * enumerable function properties, own and inherited, of object are bound.
+ *
+ * Note: This method does not set the "length" property of bound functions.
+ *
+ * @param object The object to bind and assign the bound methods to.
+ * @param methodNames The object method names to bind, specified as individual method names or arrays of
+ * method names.
+ * @return Returns object.
+ */
+ bindAll<T>(
+ object: T,
+ ...methodNames: (string|string[])[]
+ ): T;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.bindAll
+ */
+ bindAll(...methodNames: (string|string[])[]): LoDashImplicitObjectWrapper<T>;
+ }
+
+ interface LoDashExplicitObjectWrapper<T> {
+ /**
+ * @see _.bindAll
+ */
+ bindAll(...methodNames: (string|string[])[]): LoDashExplicitObjectWrapper<T>;
+ }
+
+ //_.bindKey
+ interface FunctionBindKey {
+ placeholder: any;
+
+ <T extends Object, TResult extends Function>(
+ object: T,
+ key: any,
+ ...partials: any[]
+ ): TResult;
+
+ <TResult extends Function>(
+ object: Object,
+ key: any,
+ ...partials: any[]
+ ): TResult;
+ }
+
+ interface LoDashStatic {
+ /**
+ * Creates a function that invokes the method at object[key] and prepends any additional _.bindKey arguments
+ * to those provided to the bound function.
+ *
+ * This method differs from _.bind by allowing bound functions to reference methods that may be redefined
+ * or don’t yet exist. See Peter Michaux’s article for more details.
+ *
+ * The _.bindKey.placeholder value, which defaults to _ in monolithic builds, may be used as a placeholder
+ * for partially applied arguments.
+ *
+ * @param object The object the method belongs to.
+ * @param key The key of the method.
+ * @param partials The arguments to be partially applied.
+ * @return Returns the new bound function.
+ */
+ bindKey: FunctionBindKey;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.bindKey
+ */
+ bindKey<TResult extends Function>(
+ key: any,
+ ...partials: any[]
+ ): LoDashImplicitObjectWrapper<TResult>;
+ }
+
+ interface LoDashExplicitObjectWrapper<T> {
+ /**
+ * @see _.bindKey
+ */
+ bindKey<TResult extends Function>(
+ key: any,
+ ...partials: any[]
+ ): LoDashExplicitObjectWrapper<TResult>;
+ }
+
+ //_.createCallback
+ interface LoDashStatic {
+ /**
+ * Produces a callback bound to an optional thisArg. If func is a property name the created
+ * callback will return the property value for a given element. If func is an object the created
+ * callback will return true for elements that contain the equivalent object properties,
+ * otherwise it will return false.
+ * @param func The value to convert to a callback.
+ * @param thisArg The this binding of the created callback.
+ * @param argCount The number of arguments the callback accepts.
+ * @return A callback function.
+ **/
+ createCallback(
+ func: string,
+ thisArg?: any,
+ argCount?: number): () => any;
+
+ /**
+ * @see _.createCallback
+ **/
+ createCallback(
+ func: Dictionary<any>,
+ thisArg?: any,
+ argCount?: number): () => boolean;
+ }
+
+ interface LoDashImplicitWrapper<T> {
+ /**
+ * @see _.createCallback
+ **/
+ createCallback(
+ thisArg?: any,
+ argCount?: number): LoDashImplicitObjectWrapper<() => any>;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.createCallback
+ **/
+ createCallback(
+ thisArg?: any,
+ argCount?: number): LoDashImplicitObjectWrapper<() => any>;
+ }
+
+ //_.curry
+ interface LoDashStatic {
+ /**
+ * Creates a function that accepts one or more arguments of func that when called either invokes func returning
+ * its result, if all func arguments have been provided, or returns a function that accepts one or more of the
+ * remaining func arguments, and so on. The arity of func may be specified if func.length is not sufficient.
+ * @param func The function to curry.
+ * @return Returns the new curried function.
+ */
+ curry<T1, R>(func: (t1: T1) => R):
+ CurriedFunction1<T1, R>;
+ /**
+ * Creates a function that accepts one or more arguments of func that when called either invokes func returning
+ * its result, if all func arguments have been provided, or returns a function that accepts one or more of the
+ * remaining func arguments, and so on. The arity of func may be specified if func.length is not sufficient.
+ * @param func The function to curry.
+ * @return Returns the new curried function.
+ */
+ curry<T1, T2, R>(func: (t1: T1, t2: T2) => R):
+ CurriedFunction2<T1, T2, R>;
+ /**
+ * Creates a function that accepts one or more arguments of func that when called either invokes func returning
+ * its result, if all func arguments have been provided, or returns a function that accepts one or more of the
+ * remaining func arguments, and so on. The arity of func may be specified if func.length is not sufficient.
+ * @param func The function to curry.
+ * @return Returns the new curried function.
+ */
+ curry<T1, T2, T3, R>(func: (t1: T1, t2: T2, t3: T3) => R):
+ CurriedFunction3<T1, T2, T3, R>;
+ /**
+ * Creates a function that accepts one or more arguments of func that when called either invokes func returning
+ * its result, if all func arguments have been provided, or returns a function that accepts one or more of the
+ * remaining func arguments, and so on. The arity of func may be specified if func.length is not sufficient.
+ * @param func The function to curry.
+ * @return Returns the new curried function.
+ */
+ curry<T1, T2, T3, T4, R>(func: (t1: T1, t2: T2, t3: T3, t4: T4) => R):
+ CurriedFunction4<T1, T2, T3, T4, R>;
+ /**
+ * Creates a function that accepts one or more arguments of func that when called either invokes func returning
+ * its result, if all func arguments have been provided, or returns a function that accepts one or more of the
+ * remaining func arguments, and so on. The arity of func may be specified if func.length is not sufficient.
+ * @param func The function to curry.
+ * @return Returns the new curried function.
+ */
+ curry<T1, T2, T3, T4, T5, R>(func: (t1: T1, t2: T2, t3: T3, t4: T4, t5: T5) => R):
+ CurriedFunction5<T1, T2, T3, T4, T5, R>;
+ /**
+ * Creates a function that accepts one or more arguments of func that when called either invokes func returning
+ * its result, if all func arguments have been provided, or returns a function that accepts one or more of the
+ * remaining func arguments, and so on. The arity of func may be specified if func.length is not sufficient.
+ * @param func The function to curry.
+ * @param arity The arity of func.
+ * @return Returns the new curried function.
+ */
+ curry<TResult extends Function>(
+ func: Function,
+ arity?: number): TResult;
+ }
+
+ interface CurriedFunction1<T1, R> {
+ (): CurriedFunction1<T1, R>;
+ (t1: T1): R;
+ }
+
+ interface CurriedFunction2<T1, T2, R> {
+ (): CurriedFunction2<T1, T2, R>;
+ (t1: T1): CurriedFunction1<T2, R>;
+ (t1: T1, t2: T2): R;
+ }
+
+ interface CurriedFunction3<T1, T2, T3, R> {
+ (): CurriedFunction3<T1, T2, T3, R>;
+ (t1: T1): CurriedFunction2<T2, T3, R>;
+ (t1: T1, t2: T2): CurriedFunction1<T3, R>;
+ (t1: T1, t2: T2, t3: T3): R;
+ }
+
+ interface CurriedFunction4<T1, T2, T3, T4, R> {
+ (): CurriedFunction4<T1, T2, T3, T4, R>;
+ (t1: T1): CurriedFunction3<T2, T3, T4, R>;
+ (t1: T1, t2: T2): CurriedFunction2<T3, T4, R>;
+ (t1: T1, t2: T2, t3: T3): CurriedFunction1<T4, R>;
+ (t1: T1, t2: T2, t3: T3, t4: T4): R;
+ }
+
+ interface CurriedFunction5<T1, T2, T3, T4, T5, R> {
+ (): CurriedFunction5<T1, T2, T3, T4, T5, R>;
+ (t1: T1): CurriedFunction4<T2, T3, T4, T5, R>;
+ (t1: T1, t2: T2): CurriedFunction3<T3, T4, T5, R>;
+ (t1: T1, t2: T2, t3: T3): CurriedFunction2<T4, T5, R>;
+ (t1: T1, t2: T2, t3: T3, t4: T4): CurriedFunction1<T5, R>;
+ (t1: T1, t2: T2, t3: T3, t4: T4, t5: T5): R;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.curry
+ **/
+ curry<TResult extends Function>(arity?: number): LoDashImplicitObjectWrapper<TResult>;
+ }
+
+ //_.curryRight
+ interface LoDashStatic {
+ /**
+ * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight
+ * instead of _.partial.
+ * @param func The function to curry.
+ * @return Returns the new curried function.
+ */
+ curryRight<T1, R>(func: (t1: T1) => R):
+ CurriedFunction1<T1, R>;
+ /**
+ * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight
+ * instead of _.partial.
+ * @param func The function to curry.
+ * @return Returns the new curried function.
+ */
+ curryRight<T1, T2, R>(func: (t1: T1, t2: T2) => R):
+ CurriedFunction2<T2, T1, R>;
+ /**
+ * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight
+ * instead of _.partial.
+ * @param func The function to curry.
+ * @return Returns the new curried function.
+ */
+ curryRight<T1, T2, T3, R>(func: (t1: T1, t2: T2, t3: T3) => R):
+ CurriedFunction3<T3, T2, T1, R>;
+ /**
+ * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight
+ * instead of _.partial.
+ * @param func The function to curry.
+ * @return Returns the new curried function.
+ */
+ curryRight<T1, T2, T3, T4, R>(func: (t1: T1, t2: T2, t3: T3, t4: T4) => R):
+ CurriedFunction4<T4, T3, T2, T1, R>;
+ /**
+ * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight
+ * instead of _.partial.
+ * @param func The function to curry.
+ * @return Returns the new curried function.
+ */
+ curryRight<T1, T2, T3, T4, T5, R>(func: (t1: T1, t2: T2, t3: T3, t4: T4, t5: T5) => R):
+ CurriedFunction5<T5, T4, T3, T2, T1, R>;
+ /**
+ * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight
+ * instead of _.partial.
+ * @param func The function to curry.
+ * @param arity The arity of func.
+ * @return Returns the new curried function.
+ */
+ curryRight<TResult extends Function>(
+ func: Function,
+ arity?: number): TResult;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.curryRight
+ **/
+ curryRight<TResult extends Function>(arity?: number): LoDashImplicitObjectWrapper<TResult>;
+ }
+
+ //_.debounce
+ interface DebounceSettings {
+ /**
+ * Specify invoking on the leading edge of the timeout.
+ */
+ leading?: boolean;
+
+ /**
+ * The maximum time func is allowed to be delayed before it’s invoked.
+ */
+ maxWait?: number;
+
+ /**
+ * Specify invoking on the trailing edge of the timeout.
+ */
+ trailing?: boolean;
+ }
+
+ interface LoDashStatic {
+ /**
+ * Creates a debounced function that delays invoking func until after wait milliseconds have elapsed since
+ * the last time the debounced function was invoked. The debounced function comes with a cancel method to
+ * cancel delayed invocations. Provide an options object to indicate that func should be invoked on the
+ * leading and/or trailing edge of the wait timeout. Subsequent calls to the debounced function return the
+ * result of the last func invocation.
+ *
+ * Note: If leading and trailing options are true, func is invoked on the trailing edge of the timeout only
+ * if the the debounced function is invoked more than once during the wait timeout.
+ *
+ * See David Corbacho’s article for details over the differences between _.debounce and _.throttle.
+ *
+ * @param func The function to debounce.
+ * @param wait The number of milliseconds to delay.
+ * @param options The options object.
+ * @param options.leading Specify invoking on the leading edge of the timeout.
+ * @param options.maxWait The maximum time func is allowed to be delayed before it’s invoked.
+ * @param options.trailing Specify invoking on the trailing edge of the timeout.
+ * @return Returns the new debounced function.
+ */
+ debounce<T extends Function>(
+ func: T,
+ wait?: number,
+ options?: DebounceSettings
+ ): T & Cancelable;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.debounce
+ */
+ debounce(
+ wait?: number,
+ options?: DebounceSettings
+ ): LoDashImplicitObjectWrapper<T & Cancelable>;
+ }
+
+ interface LoDashExplicitObjectWrapper<T> {
+ /**
+ * @see _.debounce
+ */
+ debounce(
+ wait?: number,
+ options?: DebounceSettings
+ ): LoDashExplicitObjectWrapper<T & Cancelable>;
+ }
+
+ //_.defer
+ interface LoDashStatic {
+ /**
+ * Defers invoking the func until the current call stack has cleared. Any additional arguments are provided to
+ * func when it’s invoked.
+ *
+ * @param func The function to defer.
+ * @param args The arguments to invoke the function with.
+ * @return Returns the timer id.
+ */
+ defer<T extends Function>(
+ func: T,
+ ...args: any[]
+ ): number;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.defer
+ */
+ defer(...args: any[]): LoDashImplicitWrapper<number>;
+ }
+
+ interface LoDashExplicitObjectWrapper<T> {
+ /**
+ * @see _.defer
+ */
+ defer(...args: any[]): LoDashExplicitWrapper<number>;
+ }
+
+ //_.delay
+ interface LoDashStatic {
+ /**
+ * Invokes func after wait milliseconds. Any additional arguments are provided to func when it’s invoked.
+ *
+ * @param func The function to delay.
+ * @param wait The number of milliseconds to delay invocation.
+ * @param args The arguments to invoke the function with.
+ * @return Returns the timer id.
+ */
+ delay<T extends Function>(
+ func: T,
+ wait: number,
+ ...args: any[]
+ ): number;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.delay
+ */
+ delay(
+ wait: number,
+ ...args: any[]
+ ): LoDashImplicitWrapper<number>;
+ }
+
+ interface LoDashExplicitObjectWrapper<T> {
+ /**
+ * @see _.delay
+ */
+ delay(
+ wait: number,
+ ...args: any[]
+ ): LoDashExplicitWrapper<number>;
+ }
+
+ interface LoDashStatic {
+ /**
+ * Creates a function that invokes `func` with arguments reversed.
+ *
+ * @static
+ * @memberOf _
+ * @category Function
+ * @param {Function} func The function to flip arguments for.
+ * @returns {Function} Returns the new function.
+ * @example
+ *
+ * var flipped = _.flip(function() {
+ * return _.toArray(arguments);
+ * });
+ *
+ * flipped('a', 'b', 'c', 'd');
+ * // => ['d', 'c', 'b', 'a']
+ */
+ flip<T extends Function>(func: T): T;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.flip
+ */
+ flip(): LoDashImplicitObjectWrapper<T>;
+ }
+
+ interface LoDashExplicitObjectWrapper<T> {
+ /**
+ * @see _.flip
+ */
+ flip(): LoDashExplicitObjectWrapper<T>;
+ }
+
+ //_.flow
+ interface LoDashStatic {
+ /**
+ * Creates a function that returns the result of invoking the provided functions with the this binding of the
+ * created function, where each successive invocation is supplied the return value of the previous.
+ *
+ * @param funcs Functions to invoke.
+ * @return Returns the new function.
+ */
+ flow<TResult extends Function>(...funcs: Function[]): TResult;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.flow
+ */
+ flow<TResult extends Function>(...funcs: Function[]): LoDashImplicitObjectWrapper<TResult>;
+ }
+
+ interface LoDashExplicitObjectWrapper<T> {
+ /**
+ * @see _.flow
+ */
+ flow<TResult extends Function>(...funcs: Function[]): LoDashExplicitObjectWrapper<TResult>;
+ }
+
+ //_.flowRight
+ interface LoDashStatic {
+ /**
+ * This method is like _.flow except that it creates a function that invokes the provided functions from right
+ * to left.
+ *
+ * @param funcs Functions to invoke.
+ * @return Returns the new function.
+ */
+ flowRight<TResult extends Function>(...funcs: Function[]): TResult;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.flowRight
+ */
+ flowRight<TResult extends Function>(...funcs: Function[]): LoDashImplicitObjectWrapper<TResult>;
+ }
+
+ interface LoDashExplicitObjectWrapper<T> {
+ /**
+ * @see _.flowRight
+ */
+ flowRight<TResult extends Function>(...funcs: Function[]): LoDashExplicitObjectWrapper<TResult>;
+ }
+
+
+ //_.memoize
+ interface MemoizedFunction extends Function {
+ cache: MapCache;
+ }
+
+ interface LoDashStatic {
+ /**
+ * Creates a function that memoizes the result of func. If resolver is provided it determines the cache key for
+ * storing the result based on the arguments provided to the memoized function. By default, the first argument
+ * provided to the memoized function is coerced to a string and used as the cache key. The func is invoked with
+ * the this binding of the memoized function.
+ * @param func The function to have its output memoized.
+ * @param resolver The function to resolve the cache key.
+ * @return Returns the new memoizing function.
+ */
+ memoize<TResult extends MemoizedFunction>(
+ func: Function,
+ resolver?: Function): TResult;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.memoize
+ */
+ memoize<TResult extends MemoizedFunction>(resolver?: Function): LoDashImplicitObjectWrapper<TResult>;
+ }
+
+ //_.overArgs (was _.modArgs)
+ interface LoDashStatic {
+ /**
+ * Creates a function that runs each argument through a corresponding transform function.
+ *
+ * @param func The function to wrap.
+ * @param transforms The functions to transform arguments, specified as individual functions or arrays
+ * of functions.
+ * @return Returns the new function.
+ */
+ overArgs<T extends Function, TResult extends Function>(
+ func: T,
+ ...transforms: Function[]
+ ): TResult;
+
+ /**
+ * @see _.overArgs
+ */
+ overArgs<T extends Function, TResult extends Function>(
+ func: T,
+ transforms: Function[]
+ ): TResult;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.overArgs
+ */
+ overArgs<TResult extends Function>(...transforms: Function[]): LoDashImplicitObjectWrapper<TResult>;
+
+ /**
+ * @see _.overArgs
+ */
+ overArgs<TResult extends Function>(transforms: Function[]): LoDashImplicitObjectWrapper<TResult>;
+ }
+
+ interface LoDashExplicitObjectWrapper<T> {
+ /**
+ * @see _.overArgs
+ */
+ overArgs<TResult extends Function>(...transforms: Function[]): LoDashExplicitObjectWrapper<TResult>;
+
+ /**
+ * @see _.overArgs
+ */
+ overArgs<TResult extends Function>(transforms: Function[]): LoDashExplicitObjectWrapper<TResult>;
+ }
+
+ //_.negate
+ interface LoDashStatic {
+ /**
+ * Creates a function that negates the result of the predicate func. The func predicate is invoked with
+ * the this binding and arguments of the created function.
+ *
+ * @param predicate The predicate to negate.
+ * @return Returns the new function.
+ */
+ negate<T extends Function>(predicate: T): (...args: any[]) => boolean;
+
+ /**
+ * @see _.negate
+ */
+ negate<T extends Function, TResult extends Function>(predicate: T): TResult;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.negate
+ */
+ negate(): LoDashImplicitObjectWrapper<(...args: any[]) => boolean>;
+
+ /**
+ * @see _.negate
+ */
+ negate<TResult extends Function>(): LoDashImplicitObjectWrapper<TResult>;
+ }
+
+ interface LoDashExplicitObjectWrapper<T> {
+ /**
+ * @see _.negate
+ */
+ negate(): LoDashExplicitObjectWrapper<(...args: any[]) => boolean>;
+
+ /**
+ * @see _.negate
+ */
+ negate<TResult extends Function>(): LoDashExplicitObjectWrapper<TResult>;
+ }
+
+ //_.once
+ interface LoDashStatic {
+ /**
+ * Creates a function that is restricted to invoking func once. Repeat calls to the function return the value
+ * of the first call. The func is invoked with the this binding and arguments of the created function.
+ *
+ * @param func The function to restrict.
+ * @return Returns the new restricted function.
+ */
+ once<T extends Function>(func: T): T;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.once
+ */
+ once(): LoDashImplicitObjectWrapper<T>;
+ }
+
+ interface LoDashExplicitObjectWrapper<T> {
+ /**
+ * @see _.once
+ */
+ once(): LoDashExplicitObjectWrapper<T>;
+ }
+
+ //_.partial
+ interface LoDashStatic {
+ /**
+ * Creates a function that, when called, invokes func with any additional partial arguments
+ * prepended to those provided to the new function. This method is similar to _.bind except
+ * it does not alter the this binding.
+ * @param func The function to partially apply arguments to.
+ * @param args Arguments to be partially applied.
+ * @return The new partially applied function.
+ **/
+ partial: Partial;
+ }
+
+ type PH = LoDashStatic;
+
+ interface Function0<R> {
+ (): R;
+ }
+ interface Function1<T1, R> {
+ (t1: T1): R;
+ }
+ interface Function2<T1, T2, R> {
+ (t1: T1, t2: T2): R;
+ }
+ interface Function3<T1, T2, T3, R> {
+ (t1: T1, t2: T2, t3: T3): R;
+ }
+ interface Function4<T1, T2, T3, T4, R> {
+ (t1: T1, t2: T2, t3: T3, t4: T4): R;
+ }
+
+ interface Partial {
+ // arity 0
+ <R>(func: Function0<R>): Function0<R>;
+ // arity 1
+ <T1, R>(func: Function1<T1, R>): Function1<T1, R>;
+ <T1, R>(func: Function1<T1, R>, arg1: T1): Function0<R>;
+ // arity 2
+ <T1, T2, R>(func: Function2<T1, T2, R>): Function2<T1, T2, R>;
+ <T1, T2, R>(func: Function2<T1, T2, R>, arg1: T1): Function1< T2, R>;
+ <T1, T2, R>(func: Function2<T1, T2, R>, plc1: PH, arg2: T2): Function1<T1, R>;
+ <T1, T2, R>(func: Function2<T1, T2, R>, arg1: T1, arg2: T2): Function0< R>;
+ // arity 3
+ <T1, T2, T3, R>(func: Function3<T1, T2, T3, R>): Function3<T1, T2, T3, R>;
+ <T1, T2, T3, R>(func: Function3<T1, T2, T3, R>, arg1: T1): Function2< T2, T3, R>;
+ <T1, T2, T3, R>(func: Function3<T1, T2, T3, R>, plc1: PH, arg2: T2): Function2<T1, T3, R>;
+ <T1, T2, T3, R>(func: Function3<T1, T2, T3, R>, arg1: T1, arg2: T2): Function1< T3, R>;
+ <T1, T2, T3, R>(func: Function3<T1, T2, T3, R>, plc1: PH, plc2: PH, arg3: T3): Function2<T1, T2, R>;
+ <T1, T2, T3, R>(func: Function3<T1, T2, T3, R>, arg1: T1, plc2: PH, arg3: T3): Function1< T2, R>;
+ <T1, T2, T3, R>(func: Function3<T1, T2, T3, R>, plc1: PH, arg2: T2, arg3: T3): Function1<T1, R>;
+ <T1, T2, T3, R>(func: Function3<T1, T2, T3, R>, arg1: T1, arg2: T2, arg3: T3): Function0< R>;
+ // arity 4
+ <T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>): Function4<T1, T2, T3, T4, R>;
+ <T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, arg1: T1): Function3< T2, T3, T4, R>;
+ <T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, plc1: PH, arg2: T2): Function3<T1, T3, T4, R>;
+ <T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, arg1: T1, arg2: T2): Function2< T3, T4, R>;
+ <T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, plc1: PH, plc2: PH, arg3: T3): Function3<T1, T2, T4, R>;
+ <T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, arg1: T1, plc2: PH, arg3: T3): Function2< T2, T4, R>;
+ <T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, plc1: PH, arg2: T2, arg3: T3): Function2<T1, T4, R>;
+ <T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, arg1: T1, arg2: T2, arg3: T3): Function1< T4, R>;
+ <T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, plc1: PH, plc2: PH, plc3: PH, arg4: T4): Function3<T1, T2, T3, R>;
+ <T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, arg1: T1, plc2: PH, plc3: PH, arg4: T4): Function2< T2, T3, R>;
+ <T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, plc1: PH, arg2: T2, plc3: PH, arg4: T4): Function2<T1, T3, R>;
+ <T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, arg1: T1, arg2: T2, plc3: PH, arg4: T4): Function1< T3, R>;
+ <T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, plc1: PH, plc2: PH, arg3: T3, arg4: T4): Function2<T1, T2, R>;
+ <T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, arg1: T1, plc2: PH, arg3: T3, arg4: T4): Function1< T2, R>;
+ <T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, plc1: PH, arg2: T2, arg3: T3, arg4: T4): Function1<T1, R>;
+ <T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, arg1: T1, arg2: T2, arg3: T3, arg4: T4): Function0< R>;
+ // catch-all
+ (func: Function, ...args: any[]): Function;
+ }
+
+ //_.partialRight
+ interface LoDashStatic {
+ /**
+ * This method is like _.partial except that partial arguments are appended to those provided
+ * to the new function.
+ * @param func The function to partially apply arguments to.
+ * @param args Arguments to be partially applied.
+ * @return The new partially applied function.
+ **/
+ partialRight: PartialRight
+ }
+
+ interface PartialRight {
+ // arity 0
+ <R>(func: Function0<R>): Function0<R>;
+ // arity 1
+ <T1, R>(func: Function1<T1, R>): Function1<T1, R>;
+ <T1, R>(func: Function1<T1, R>, arg1: T1): Function0<R>;
+ // arity 2
+ <T1, T2, R>(func: Function2<T1, T2, R>): Function2<T1, T2, R>;
+ <T1, T2, R>(func: Function2<T1, T2, R>, arg1: T1, plc2: PH): Function1< T2, R>;
+ <T1, T2, R>(func: Function2<T1, T2, R>, arg2: T2): Function1<T1, R>;
+ <T1, T2, R>(func: Function2<T1, T2, R>, arg1: T1, arg2: T2): Function0< R>;
+ // arity 3
+ <T1, T2, T3, R>(func: Function3<T1, T2, T3, R>): Function3<T1, T2, T3, R>;
+ <T1, T2, T3, R>(func: Function3<T1, T2, T3, R>, arg1: T1, plc2: PH, plc3: PH): Function2< T2, T3, R>;
+ <T1, T2, T3, R>(func: Function3<T1, T2, T3, R>, arg2: T2, plc3: PH): Function2<T1, T3, R>;
+ <T1, T2, T3, R>(func: Function3<T1, T2, T3, R>, arg1: T1, arg2: T2, plc3: PH): Function1< T3, R>;
+ <T1, T2, T3, R>(func: Function3<T1, T2, T3, R>, arg3: T3): Function2<T1, T2, R>;
+ <T1, T2, T3, R>(func: Function3<T1, T2, T3, R>, arg1: T1, plc2: PH, arg3: T3): Function1< T2, R>;
+ <T1, T2, T3, R>(func: Function3<T1, T2, T3, R>, arg2: T2, arg3: T3): Function1<T1, R>;
+ <T1, T2, T3, R>(func: Function3<T1, T2, T3, R>, arg1: T1, arg2: T2, arg3: T3): Function0< R>;
+ // arity 4
+ <T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>): Function4<T1, T2, T3, T4, R>;
+ <T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, arg1: T1, plc2: PH, plc3: PH, plc4: PH): Function3< T2, T3, T4, R>;
+ <T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, arg2: T2, plc3: PH, plc4: PH): Function3<T1, T3, T4, R>;
+ <T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, arg1: T1, arg2: T2, plc3: PH, plc4: PH): Function2< T3, T4, R>;
+ <T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, arg3: T3, plc4: PH): Function3<T1, T2, T4, R>;
+ <T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, arg1: T1, plc2: PH, arg3: T3, plc4: PH): Function2< T2, T4, R>;
+ <T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, arg2: T2, arg3: T3, plc4: PH): Function2<T1, T4, R>;
+ <T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, arg1: T1, arg2: T2, arg3: T3, plc4: PH): Function1< T4, R>;
+ <T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, arg4: T4): Function3<T1, T2, T3, R>;
+ <T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, arg1: T1, plc2: PH, plc3: PH, arg4: T4): Function2< T2, T3, R>;
+ <T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, arg2: T2, plc3: PH, arg4: T4): Function2<T1, T3, R>;
+ <T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, arg1: T1, arg2: T2, plc3: PH, arg4: T4): Function1< T3, R>;
+ <T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, arg3: T3, arg4: T4): Function2<T1, T2, R>;
+ <T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, arg1: T1, plc2: PH, arg3: T3, arg4: T4): Function1< T2, R>;
+ <T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, arg2: T2, arg3: T3, arg4: T4): Function1<T1, R>;
+ <T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, arg1: T1, arg2: T2, arg3: T3, arg4: T4): Function0< R>;
+ // catch-all
+ (func: Function, ...args: any[]): Function;
+ }
+
+ //_.rearg
+ interface LoDashStatic {
+ /**
+ * Creates a function that invokes func with arguments arranged according to the specified indexes where the
+ * argument value at the first index is provided as the first argument, the argument value at the second index
+ * is provided as the second argument, and so on.
+ * @param func The function to rearrange arguments for.
+ * @param indexes The arranged argument indexes, specified as individual indexes or arrays of indexes.
+ * @return Returns the new function.
+ */
+ rearg<TResult extends Function>(func: Function, indexes: number[]): TResult;
+
+ /**
+ * @see _.rearg
+ */
+ rearg<TResult extends Function>(func: Function, ...indexes: number[]): TResult;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.rearg
+ */
+ rearg<TResult extends Function>(indexes: number[]): LoDashImplicitObjectWrapper<TResult>;
+
+ /**
+ * @see _.rearg
+ */
+ rearg<TResult extends Function>(...indexes: number[]): LoDashImplicitObjectWrapper<TResult>;
+ }
+
+ //_.rest
+ interface LoDashStatic {
+ /**
+ * Creates a function that invokes func with the this binding of the created function and arguments from start
+ * and beyond provided as an array.
+ *
+ * Note: This method is based on the rest parameter.
+ *
+ * @param func The function to apply a rest parameter to.
+ * @param start The start position of the rest parameter.
+ * @return Returns the new function.
+ */
+ rest<TResult extends Function>(
+ func: Function,
+ start?: number
+ ): TResult;
+
+ /**
+ * @see _.rest
+ */
+ rest<TResult extends Function, TFunc extends Function>(
+ func: TFunc,
+ start?: number
+ ): TResult;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.rest
+ */
+ rest<TResult extends Function>(start?: number): LoDashImplicitObjectWrapper<TResult>;
+ }
+
+ interface LoDashExplicitObjectWrapper<T> {
+ /**
+ * @see _.rest
+ */
+ rest<TResult extends Function>(start?: number): LoDashExplicitObjectWrapper<TResult>;
+ }
+
+ //_.spread
+ interface LoDashStatic {
+ /**
+ * Creates a function that invokes func with the this binding of the created function and an array of arguments
+ * much like Function#apply.
+ *
+ * Note: This method is based on the spread operator.
+ *
+ * @param func The function to spread arguments over.
+ * @return Returns the new function.
+ */
+ spread<F extends Function, T extends Function>(func: F): T;
+
+ /**
+ * @see _.spread
+ */
+ spread<T extends Function>(func: Function): T;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.spread
+ */
+ spread<T extends Function>(): LoDashImplicitObjectWrapper<T>;
+ }
+
+ interface LoDashExplicitObjectWrapper<T> {
+ /**
+ * @see _.spread
+ */
+ spread<T extends Function>(): LoDashExplicitObjectWrapper<T>;
+ }
+
+ //_.throttle
+ interface ThrottleSettings {
+ /**
+ * If you'd like to disable the leading-edge call, pass this as false.
+ */
+ leading?: boolean;
+
+ /**
+ * If you'd like to disable the execution on the trailing-edge, pass false.
+ */
+ trailing?: boolean;
+ }
+
+ interface LoDashStatic {
+ /**
+ * Creates a throttled function that only invokes func at most once per every wait milliseconds. The throttled
+ * function comes with a cancel method to cancel delayed invocations. Provide an options object to indicate
+ * that func should be invoked on the leading and/or trailing edge of the wait timeout. Subsequent calls to
+ * the throttled function return the result of the last func call.
+ *
+ * Note: If leading and trailing options are true, func is invoked on the trailing edge of the timeout only if
+ * the the throttled function is invoked more than once during the wait timeout.
+ *
+ * @param func The function to throttle.
+ * @param wait The number of milliseconds to throttle invocations to.
+ * @param options The options object.
+ * @param options.leading Specify invoking on the leading edge of the timeout.
+ * @param options.trailing Specify invoking on the trailing edge of the timeout.
+ * @return Returns the new throttled function.
+ */
+ throttle<T extends Function>(
+ func: T,
+ wait?: number,
+ options?: ThrottleSettings
+ ): T & Cancelable;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.throttle
+ */
+ throttle(
+ wait?: number,
+ options?: ThrottleSettings
+ ): LoDashImplicitObjectWrapper<T & Cancelable>;
+ }
+
+ interface LoDashExplicitObjectWrapper<T> {
+ /**
+ * @see _.throttle
+ */
+ throttle(
+ wait?: number,
+ options?: ThrottleSettings
+ ): LoDashExplicitObjectWrapper<T & Cancelable>;
+ }
+
+ //_.unary
+ interface LoDashStatic {
+ /**
+ * Creates a function that accepts up to one argument, ignoring any
+ * additional arguments.
+ *
+ * @static
+ * @memberOf _
+ * @category Function
+ * @param {Function} func The function to cap arguments for.
+ * @returns {Function} Returns the new function.
+ * @example
+ *
+ * _.map(['6', '8', '10'], _.unary(parseInt));
+ * // => [6, 8, 10]
+ */
+ unary<T extends Function>(func: T): T;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.unary
+ */
+ unary(): LoDashImplicitObjectWrapper<T>;
+ }
+
+ interface LoDashExplicitObjectWrapper<T> {
+ /**
+ * @see _.unary
+ */
+ unary(): LoDashExplicitObjectWrapper<T>;
+ }
+
+ //_.wrap
+ interface LoDashStatic {
+ /**
+ * Creates a function that provides value to the wrapper function as its first argument. Any additional
+ * arguments provided to the function are appended to those provided to the wrapper function. The wrapper is
+ * invoked with the this binding of the created function.
+ *
+ * @param value The value to wrap.
+ * @param wrapper The wrapper function.
+ * @return Returns the new function.
+ */
+ wrap<V, W extends Function, R extends Function>(
+ value: V,
+ wrapper: W
+ ): R;
+
+ /**
+ * @see _.wrap
+ */
+ wrap<V, R extends Function>(
+ value: V,
+ wrapper: Function
+ ): R;
+
+ /**
+ * @see _.wrap
+ */
+ wrap<R extends Function>(
+ value: any,
+ wrapper: Function
+ ): R;
+ }
+
+ interface LoDashImplicitWrapper<T> {
+ /**
+ * @see _.wrap
+ */
+ wrap<W extends Function, R extends Function>(wrapper: W): LoDashImplicitObjectWrapper<R>;
+
+ /**
+ * @see _.wrap
+ */
+ wrap<R extends Function>(wrapper: Function): LoDashImplicitObjectWrapper<R>;
+ }
+
+ interface LoDashImplicitArrayWrapper<T> {
+ /**
+ * @see _.wrap
+ */
+ wrap<W extends Function, R extends Function>(wrapper: W): LoDashImplicitObjectWrapper<R>;
+
+ /**
+ * @see _.wrap
+ */
+ wrap<R extends Function>(wrapper: Function): LoDashImplicitObjectWrapper<R>;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.wrap
+ */
+ wrap<W extends Function, R extends Function>(wrapper: W): LoDashImplicitObjectWrapper<R>;
+
+ /**
+ * @see _.wrap
+ */
+ wrap<R extends Function>(wrapper: Function): LoDashImplicitObjectWrapper<R>;
+ }
+
+ interface LoDashExplicitWrapper<T> {
+ /**
+ * @see _.wrap
+ */
+ wrap<W extends Function, R extends Function>(wrapper: W): LoDashExplicitObjectWrapper<R>;
+
+ /**
+ * @see _.wrap
+ */
+ wrap<R extends Function>(wrapper: Function): LoDashExplicitObjectWrapper<R>;
+ }
+
+ interface LoDashExplicitArrayWrapper<T> {
+ /**
+ * @see _.wrap
+ */
+ wrap<W extends Function, R extends Function>(wrapper: W): LoDashExplicitObjectWrapper<R>;
+
+ /**
+ * @see _.wrap
+ */
+ wrap<R extends Function>(wrapper: Function): LoDashExplicitObjectWrapper<R>;
+ }
+
+ interface LoDashExplicitObjectWrapper<T> {
+ /**
+ * @see _.wrap
+ */
+ wrap<W extends Function, R extends Function>(wrapper: W): LoDashExplicitObjectWrapper<R>;
+
+ /**
+ * @see _.wrap
+ */
+ wrap<R extends Function>(wrapper: Function): LoDashExplicitObjectWrapper<R>;
+ }
+
+ /********
+ * Lang *
+ ********/
+
+ //_.clone
+ interface LoDashStatic {
+ /**
+ * Creates a shallow clone of `value`.
+ *
+ * **Note:** This method is loosely based on the
+ * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)
+ * and supports cloning arrays, array buffers, booleans, date objects, maps,
+ * numbers, `Object` objects, regexes, sets, strings, symbols, and typed
+ * arrays. The own enumerable properties of `arguments` objects are cloned
+ * as plain objects. An empty object is returned for uncloneable values such
+ * as error objects, functions, DOM nodes, and WeakMaps.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to clone.
+ * @returns {*} Returns the cloned value.
+ * @example
+ *
+ * var objects = [{ 'a': 1 }, { 'b': 2 }];
+ *
+ * var shallow = _.clone(objects);
+ * console.log(shallow[0] === objects[0]);
+ * // => true
+ */
+ clone<T>(value: T): T;
+ }
+
+ interface LoDashImplicitWrapper<T> {
+ /**
+ * @see _.clone
+ */
+ clone(): T;
+ }
+
+ interface LoDashImplicitArrayWrapper<T> {
+
+ /**
+ * @see _.clone
+ */
+ clone(): T[];
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.clone
+ */
+ clone(): T;
+ }
+
+ //_.cloneDeep
+ interface LoDashStatic {
+ /**
+ * This method is like `_.clone` except that it recursively clones `value`.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to recursively clone.
+ * @returns {*} Returns the deep cloned value.
+ * @example
+ *
+ * var objects = [{ 'a': 1 }, { 'b': 2 }];
+ *
+ * var deep = _.cloneDeep(objects);
+ * console.log(deep[0] === objects[0]);
+ * // => false
+ */
+ cloneDeep<T>(value: T): T;
+ }
+
+ interface LoDashImplicitWrapper<T> {
+ /**
+ * @see _.cloneDeep
+ */
+ cloneDeep(): T;
+ }
+
+ interface LoDashImplicitArrayWrapper<T> {
+ /**
+ * @see _.cloneDeep
+ */
+ cloneDeep(): T[];
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.cloneDeep
+ */
+ cloneDeep(): T;
+ }
+
+ //_.cloneWith
+ interface LoDashStatic {
+ /**
+ * Creates a shallow clone of `value`.
+ *
+ * **Note:** This method is loosely based on the
+ * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)
+ * and supports cloning arrays, array buffers, booleans, date objects, maps,
+ * numbers, `Object` objects, regexes, sets, strings, symbols, and typed
+ * arrays. The own enumerable properties of `arguments` objects are cloned
+ * as plain objects. An empty object is returned for uncloneable values such
+ * as error objects, functions, DOM nodes, and WeakMaps.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to clone.
+ * @returns {*} Returns the cloned value.
+ * @example
+ *
+ * var objects = [{ 'a': 1 }, { 'b': 2 }];
+ *
+ * var shallow = _.clone(objects);
+ * console.log(shallow[0] === objects[0]);
+ * // => true
+ */
+ clone<T>(
+ value: T,
+ customizer: (value: any) => any): T;
+ }
+
+ interface LoDashImplicitWrapper<T> {
+ /**
+ * @see _.clone
+ */
+ clone(customizer: (value: any) => any): T;
+ }
+
+ interface LoDashImplicitArrayWrapper<T> {
+
+ /**
+ * @see _.clone
+ */
+ clone(customizer: (value: any) => any): T[];
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.clone
+ */
+ clone(customizer: (value: any) => any): T;
+ }
+
+ //_.cloneDeepWith
+ interface LoDashStatic {
+ /**
+ * Creates a deep clone of value. If customizer is provided it’s invoked to produce the cloned values. If
+ * customizer returns undefined cloning is handled by the method instead. The customizer is bound to thisArg
+ * and invoked with up to three argument; (value [, index|key, object]).
+ * Note: This method is loosely based on the structured clone algorithm. The enumerable properties of arguments
+ * objects and objects created by constructors other than Object are cloned to plain Object objects. An empty
+ * object is returned for uncloneable values such as functions, DOM nodes, Maps, Sets, and WeakMaps.
+ * @param value The value to deep clone.
+ * @param customizer The function to customize cloning values.
+ * @param thisArg The this binding of customizer.
+ * @return Returns the deep cloned value.
+ */
+ cloneDeep<T>(
+ value: T,
+ customizer: (value: any) => any): T;
+ }
+
+ interface LoDashImplicitWrapper<T> {
+ /**
+ * @see _.cloneDeep
+ */
+ cloneDeep(customizer: (value: any) => any): T;
+ }
+
+ interface LoDashImplicitArrayWrapper<T> {
+ /**
+ * @see _.cloneDeep
+ */
+ cloneDeep(customizer: (value: any) => any): T[];
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.cloneDeep
+ */
+ cloneDeep(customizer: (value: any) => any): T;
+ }
+
+ //_.eq
+ interface LoDashStatic {
+ /**
+ * Performs a [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
+ * comparison between two values to determine if they are equivalent.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to compare.
+ * @param {*} other The other value to compare.
+ * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
+ * @example
+ *
+ * var object = { 'user': 'fred' };
+ * var other = { 'user': 'fred' };
+ *
+ * _.eq(object, object);
+ * // => true
+ *
+ * _.eq(object, other);
+ * // => false
+ *
+ * _.eq('a', 'a');
+ * // => true
+ *
+ * _.eq('a', Object('a'));
+ * // => false
+ *
+ * _.eq(NaN, NaN);
+ * // => true
+ */
+ eq(
+ value: any,
+ other: any
+ ): boolean;
+ }
+
+ interface LoDashImplicitWrapperBase<T, TWrapper> {
+ /**
+ * @see _.isEqual
+ */
+ eq(
+ other: any
+ ): boolean;
+ }
+
+ interface LoDashExplicitWrapperBase<T, TWrapper> {
+ /**
+ * @see _.isEqual
+ */
+ eq(
+ other: any
+ ): LoDashExplicitWrapper<boolean>;
+ }
+
+ //_.gt
+ interface LoDashStatic {
+ /**
+ * Checks if value is greater than other.
+ *
+ * @param value The value to compare.
+ * @param other The other value to compare.
+ * @return Returns true if value is greater than other, else false.
+ */
+ gt(
+ value: any,
+ other: any
+ ): boolean;
+ }
+
+ interface LoDashImplicitWrapperBase<T, TWrapper> {
+ /**
+ * @see _.gt
+ */
+ gt(other: any): boolean;
+ }
+
+ interface LoDashExplicitWrapperBase<T, TWrapper> {
+ /**
+ * @see _.gt
+ */
+ gt(other: any): LoDashExplicitWrapper<boolean>;
+ }
+
+ //_.gte
+ interface LoDashStatic {
+ /**
+ * Checks if value is greater than or equal to other.
+ *
+ * @param value The value to compare.
+ * @param other The other value to compare.
+ * @return Returns true if value is greater than or equal to other, else false.
+ */
+ gte(
+ value: any,
+ other: any
+ ): boolean;
+ }
+
+ interface LoDashImplicitWrapperBase<T, TWrapper> {
+ /**
+ * @see _.gte
+ */
+ gte(other: any): boolean;
+ }
+
+ interface LoDashExplicitWrapperBase<T, TWrapper> {
+ /**
+ * @see _.gte
+ */
+ gte(other: any): LoDashExplicitWrapper<boolean>;
+ }
+
+ //_.isArguments
+ interface LoDashStatic {
+ /**
+ * Checks if value is classified as an arguments object.
+ *
+ * @param value The value to check.
+ * @return Returns true if value is correctly classified, else false.
+ */
+ isArguments(value?: any): value is IArguments;
+ }
+
+ interface LoDashImplicitWrapperBase<T, TWrapper> {
+ /**
+ * @see _.isArguments
+ */
+ isArguments(): boolean;
+ }
+
+ interface LoDashExplicitWrapperBase<T, TWrapper> {
+ /**
+ * @see _.isArguments
+ */
+ isArguments(): LoDashExplicitWrapper<boolean>;
+ }
+
+ //_.isArray
+ interface LoDashStatic {
+ /**
+ * Checks if value is classified as an Array object.
+ * @param value The value to check.
+ *
+ * @return Returns true if value is correctly classified, else false.
+ */
+ isArray<T>(value?: any): value is T[];
+ }
+
+ interface LoDashImplicitWrapperBase<T,TWrapper> {
+ /**
+ * @see _.isArray
+ */
+ isArray(): boolean;
+ }
+
+ interface LoDashExplicitWrapperBase<T,TWrapper> {
+ /**
+ * @see _.isArray
+ */
+ isArray(): LoDashExplicitWrapper<boolean>;
+ }
+
+ //_.isArrayLike
+ interface LoDashStatic {
+ /**
+ * Checks if `value` is array-like. A value is considered array-like if it's
+ * not a function and has a `value.length` that's an integer greater than or
+ * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
+ *
+ * @static
+ * @memberOf _
+ * @type Function
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
+ * @example
+ *
+ * _.isArrayLike([1, 2, 3]);
+ * // => true
+ *
+ * _.isArrayLike(document.body.children);
+ * // => true
+ *
+ * _.isArrayLike('abc');
+ * // => true
+ *
+ * _.isArrayLike(_.noop);
+ * // => false
+ */
+ isArrayLike<T>(value?: any): value is T[];
+ }
+
+ interface LoDashImplicitWrapperBase<T,TWrapper> {
+ /**
+ * @see _.isArrayLike
+ */
+ isArrayLike(): boolean;
+ }
+
+ interface LoDashExplicitWrapperBase<T,TWrapper> {
+ /**
+ * @see _.isArrayLike
+ */
+ isArrayLike(): LoDashExplicitWrapper<boolean>;
+ }
+
+ //_.isArrayLikeObject
+ interface LoDashStatic {
+ /**
+ * This method is like `_.isArrayLike` except that it also checks if `value`
+ * is an object.
+ *
+ * @static
+ * @memberOf _
+ * @type Function
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is an array-like object, else `false`.
+ * @example
+ *
+ * _.isArrayLikeObject([1, 2, 3]);
+ * // => true
+ *
+ * _.isArrayLikeObject(document.body.children);
+ * // => true
+ *
+ * _.isArrayLikeObject('abc');
+ * // => false
+ *
+ * _.isArrayLikeObject(_.noop);
+ * // => false
+ */
+ isArrayLikeObject<T>(value?: any): value is T[];
+ }
+
+ interface LoDashImplicitWrapperBase<T,TWrapper> {
+ /**
+ * @see _.isArrayLikeObject
+ */
+ isArrayLikeObject(): boolean;
+ }
+
+ interface LoDashExplicitWrapperBase<T,TWrapper> {
+ /**
+ * @see _.isArrayLikeObject
+ */
+ isArrayLikeObject(): LoDashExplicitWrapper<boolean>;
+ }
+
+ //_.isBoolean
+ interface LoDashStatic {
+ /**
+ * Checks if value is classified as a boolean primitive or object.
+ *
+ * @param value The value to check.
+ * @return Returns true if value is correctly classified, else false.
+ */
+ isBoolean(value?: any): value is boolean;
+ }
+
+ interface LoDashImplicitWrapperBase<T, TWrapper> {
+ /**
+ * @see _.isBoolean
+ */
+ isBoolean(): boolean;
+ }
+
+ interface LoDashExplicitWrapperBase<T, TWrapper> {
+ /**
+ * @see _.isBoolean
+ */
+ isBoolean(): LoDashExplicitWrapper<boolean>;
+ }
+
+ //_.isDate
+ interface LoDashStatic {
+ /**
+ * Checks if value is classified as a Date object.
+ * @param value The value to check.
+ *
+ * @return Returns true if value is correctly classified, else false.
+ */
+ isDate(value?: any): value is Date;
+ }
+
+ interface LoDashImplicitWrapperBase<T, TWrapper> {
+ /**
+ * @see _.isDate
+ */
+ isDate(): boolean;
+ }
+
+ interface LoDashExplicitWrapperBase<T, TWrapper> {
+ /**
+ * @see _.isDate
+ */
+ isDate(): LoDashExplicitWrapper<boolean>;
+ }
+
+ //_.isElement
+ interface LoDashStatic {
+ /**
+ * Checks if value is a DOM element.
+ *
+ * @param value The value to check.
+ * @return Returns true if value is a DOM element, else false.
+ */
+ isElement(value?: any): boolean;
+ }
+
+ interface LoDashImplicitWrapperBase<T, TWrapper> {
+ /**
+ * @see _.isElement
+ */
+ isElement(): boolean;
+ }
+
+ interface LoDashExplicitWrapperBase<T, TWrapper> {
+ /**
+ * @see _.isElement
+ */
+ isElement(): LoDashExplicitWrapper<boolean>;
+ }
+
+ //_.isEmpty
+ interface LoDashStatic {
+ /**
+ * Checks if value is empty. A value is considered empty unless it’s an arguments object, array, string, or
+ * jQuery-like collection with a length greater than 0 or an object with own enumerable properties.
+ * @param value The value to inspect.
+ * @return Returns true if value is empty, else false.
+ **/
+ isEmpty(value?: any[]|Dictionary<any>|string|any): boolean;
+ }
+
+ interface LoDashImplicitWrapperBase<T,TWrapper> {
+ /**
+ * @see _.isEmpty
+ */
+ isEmpty(): boolean;
+ }
+
+ //_.isEqual
+ interface LoDashStatic {
+ /**
+ * Performs a deep comparison between two values to determine if they are
+ * equivalent.
+ *
+ * **Note:** This method supports comparing arrays, array buffers, booleans,
+ * date objects, error objects, maps, numbers, `Object` objects, regexes,
+ * sets, strings, symbols, and typed arrays. `Object` objects are compared
+ * by their own, not inherited, enumerable properties. Functions and DOM
+ * nodes are **not** supported.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to compare.
+ * @param {*} other The other value to compare.
+ * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
+ * @example
+ *
+ * var object = { 'user': 'fred' };
+ * var other = { 'user': 'fred' };
+ *
+ * _.isEqual(object, other);
+ * // => true
+ *
+ * object === other;
+ * // => false
+ */
+ isEqual(
+ value: any,
+ other: any
+ ): boolean;
+ }
+
+ interface LoDashImplicitWrapperBase<T, TWrapper> {
+ /**
+ * @see _.isEqual
+ */
+ isEqual(
+ other: any
+ ): boolean;
+ }
+
+ interface LoDashExplicitWrapperBase<T, TWrapper> {
+ /**
+ * @see _.isEqual
+ */
+ isEqual(
+ other: any
+ ): LoDashExplicitWrapper<boolean>;
+ }
+
+ // _.isEqualWith
+ interface IsEqualCustomizer {
+ (value: any, other: any, indexOrKey?: number|string): boolean;
+ }
+
+ interface LoDashStatic {
+ /**
+ * This method is like `_.isEqual` except that it accepts `customizer` which is
+ * invoked to compare values. If `customizer` returns `undefined` comparisons are
+ * handled by the method instead. The `customizer` is invoked with up to seven arguments:
+ * (objValue, othValue [, index|key, object, other, stack]).
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to compare.
+ * @param {*} other The other value to compare.
+ * @param {Function} [customizer] The function to customize comparisons.
+ * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
+ * @example
+ *
+ * function isGreeting(value) {
+ * return /^h(?:i|ello)$/.test(value);
+ * }
+ *
+ * function customizer(objValue, othValue) {
+ * if (isGreeting(objValue) && isGreeting(othValue)) {
+ * return true;
+ * }
+ * }
+ *
+ * var array = ['hello', 'goodbye'];
+ * var other = ['hi', 'goodbye'];
+ *
+ * _.isEqualWith(array, other, customizer);
+ * // => true
+ */
+ isEqualWith(
+ value: any,
+ other: any,
+ customizer: IsEqualCustomizer
+ ): boolean;
+ }
+
+ interface LoDashImplicitWrapperBase<T, TWrapper> {
+ /**
+ * @see _.isEqualWith
+ */
+ isEqualWith(
+ other: any,
+ customizer: IsEqualCustomizer
+ ): boolean;
+ }
+
+ interface LoDashExplicitWrapperBase<T, TWrapper> {
+ /**
+ * @see _.isEqualWith
+ */
+ isEqualWith(
+ other: any,
+ customizer: IsEqualCustomizer
+ ): LoDashExplicitWrapper<boolean>;
+ }
+
+ //_.isError
+ interface LoDashStatic {
+ /**
+ * Checks if value is an Error, EvalError, RangeError, ReferenceError, SyntaxError, TypeError, or URIError
+ * object.
+ *
+ * @param value The value to check.
+ * @return Returns true if value is an error object, else false.
+ */
+ isError(value: any): value is Error;
+ }
+
+ interface LoDashImplicitWrapperBase<T, TWrapper> {
+ /**
+ * @see _.isError
+ */
+ isError(): boolean;
+ }
+
+ interface LoDashExplicitWrapperBase<T, TWrapper> {
+ /**
+ * @see _.isError
+ */
+ isError(): LoDashExplicitWrapper<boolean>;
+ }
+
+ //_.isFinite
+ interface LoDashStatic {
+ /**
+ * Checks if value is a finite primitive number.
+ *
+ * Note: This method is based on Number.isFinite.
+ *
+ * @param value The value to check.
+ * @return Returns true if value is a finite number, else false.
+ */
+ isFinite(value?: any): boolean;
+ }
+
+ interface LoDashImplicitWrapperBase<T, TWrapper> {
+ /**
+ * @see _.isFinite
+ */
+ isFinite(): boolean;
+ }
+
+ interface LoDashExplicitWrapperBase<T, TWrapper> {
+ /**
+ * @see _.isFinite
+ */
+ isFinite(): LoDashExplicitWrapper<boolean>;
+ }
+
+ //_.isFunction
+ interface LoDashStatic {
+ /**
+ * Checks if value is classified as a Function object.
+ *
+ * @param value The value to check.
+ * @return Returns true if value is correctly classified, else false.
+ */
+ isFunction(value?: any): value is Function;
+ }
+
+ interface LoDashImplicitWrapperBase<T, TWrapper> {
+ /**
+ * @see _.isFunction
+ */
+ isFunction(): boolean;
+ }
+
+ interface LoDashExplicitWrapperBase<T, TWrapper> {
+ /**
+ * @see _.isFunction
+ */
+ isFunction(): LoDashExplicitWrapper<boolean>;
+ }
+
+ //_.isInteger
+ interface LoDashStatic {
+ /**
+ * Checks if `value` is an integer.
+ *
+ * **Note:** This method is based on [`Number.isInteger`](https://mdn.io/Number/isInteger).
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is an integer, else `false`.
+ * @example
+ *
+ * _.isInteger(3);
+ * // => true
+ *
+ * _.isInteger(Number.MIN_VALUE);
+ * // => false
+ *
+ * _.isInteger(Infinity);
+ * // => false
+ *
+ * _.isInteger('3');
+ * // => false
+ */
+ isInteger(value?: any): boolean;
+ }
+
+ interface LoDashImplicitWrapperBase<T, TWrapper> {
+ /**
+ * @see _.isInteger
+ */
+ isInteger(): boolean;
+ }
+
+ interface LoDashExplicitWrapperBase<T, TWrapper> {
+ /**
+ * @see _.isInteger
+ */
+ isInteger(): LoDashExplicitWrapper<boolean>;
+ }
+
+ //_.isLength
+ interface LoDashStatic {
+ /**
+ * Checks if `value` is a valid array-like length.
+ *
+ * **Note:** This function is loosely based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength).
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
+ * @example
+ *
+ * _.isLength(3);
+ * // => true
+ *
+ * _.isLength(Number.MIN_VALUE);
+ * // => false
+ *
+ * _.isLength(Infinity);
+ * // => false
+ *
+ * _.isLength('3');
+ * // => false
+ */
+ isLength(value?: any): boolean;
+ }
+
+ interface LoDashImplicitWrapperBase<T, TWrapper> {
+ /**
+ * @see _.isLength
+ */
+ isLength(): boolean;
+ }
+
+ interface LoDashExplicitWrapperBase<T, TWrapper> {
+ /**
+ * @see _.isLength
+ */
+ isLength(): LoDashExplicitWrapper<boolean>;
+ }
+
+ //_.isMatch
+ interface isMatchCustomizer {
+ (value: any, other: any, indexOrKey?: number|string): boolean;
+ }
+
+ interface LoDashStatic {
+ /**
+ * Performs a deep comparison between `object` and `source` to determine if
+ * `object` contains equivalent property values.
+ *
+ * **Note:** This method supports comparing the same values as `_.isEqual`.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {Object} object The object to inspect.
+ * @param {Object} source The object of property values to match.
+ * @returns {boolean} Returns `true` if `object` is a match, else `false`.
+ * @example
+ *
+ * var object = { 'user': 'fred', 'age': 40 };
+ *
+ * _.isMatch(object, { 'age': 40 });
+ * // => true
+ *
+ * _.isMatch(object, { 'age': 36 });
+ * // => false
+ */
+ isMatch(object: Object, source: Object): boolean;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.isMatch
+ */
+ isMatch(source: Object): boolean;
+ }
+
+ //_.isMatchWith
+ interface isMatchWithCustomizer {
+ (value: any, other: any, indexOrKey?: number|string): boolean;
+ }
+
+ interface LoDashStatic {
+ /**
+ * This method is like `_.isMatch` except that it accepts `customizer` which
+ * is invoked to compare values. If `customizer` returns `undefined` comparisons
+ * are handled by the method instead. The `customizer` is invoked with three
+ * arguments: (objValue, srcValue, index|key, object, source).
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {Object} object The object to inspect.
+ * @param {Object} source The object of property values to match.
+ * @param {Function} [customizer] The function to customize comparisons.
+ * @returns {boolean} Returns `true` if `object` is a match, else `false`.
+ * @example
+ *
+ * function isGreeting(value) {
+ * return /^h(?:i|ello)$/.test(value);
+ * }
+ *
+ * function customizer(objValue, srcValue) {
+ * if (isGreeting(objValue) && isGreeting(srcValue)) {
+ * return true;
+ * }
+ * }
+ *
+ * var object = { 'greeting': 'hello' };
+ * var source = { 'greeting': 'hi' };
+ *
+ * _.isMatchWith(object, source, customizer);
+ * // => true
+ */
+ isMatchWith(object: Object, source: Object, customizer: isMatchWithCustomizer): boolean;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.isMatchWith
+ */
+ isMatchWith(source: Object, customizer: isMatchWithCustomizer): boolean;
+ }
+
+ //_.isNaN
+ interface LoDashStatic {
+ /**
+ * Checks if value is NaN.
+ *
+ * Note: This method is not the same as isNaN which returns true for undefined and other non-numeric values.
+ *
+ * @param value The value to check.
+ * @return Returns true if value is NaN, else false.
+ */
+ isNaN(value?: any): boolean;
+ }
+
+ interface LoDashImplicitWrapperBase<T, TWrapper> {
+ /**
+ * @see _.isNaN
+ */
+ isNaN(): boolean;
+ }
+
+ interface LoDashExplicitWrapperBase<T, TWrapper> {
+ /**
+ * @see _.isNaN
+ */
+ isNaN(): LoDashExplicitWrapper<boolean>;
+ }
+
+ //_.isNative
+ interface LoDashStatic {
+ /**
+ * Checks if value is a native function.
+ * @param value The value to check.
+ *
+ * @retrun Returns true if value is a native function, else false.
+ */
+ isNative(value: any): value is Function;
+ }
+
+ interface LoDashImplicitWrapperBase<T, TWrapper> {
+ /**
+ * see _.isNative
+ */
+ isNative(): boolean;
+ }
+
+ interface LoDashExplicitWrapperBase<T, TWrapper> {
+ /**
+ * see _.isNative
+ */
+ isNative(): LoDashExplicitWrapper<boolean>;
+ }
+
+ //_.isNil
+ interface LoDashStatic {
+ /**
+ * Checks if `value` is `null` or `undefined`.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is nullish, else `false`.
+ * @example
+ *
+ * _.isNil(null);
+ * // => true
+ *
+ * _.isNil(void 0);
+ * // => true
+ *
+ * _.isNil(NaN);
+ * // => false
+ */
+ isNil(value?: any): boolean;
+ }
+
+ interface LoDashImplicitWrapperBase<T, TWrapper> {
+ /**
+ * see _.isNil
+ */
+ isNil(): boolean;
+ }
+
+ interface LoDashExplicitWrapperBase<T, TWrapper> {
+ /**
+ * see _.isNil
+ */
+ isNil(): LoDashExplicitWrapper<boolean>;
+ }
+
+ //_.isNull
+ interface LoDashStatic {
+ /**
+ * Checks if value is null.
+ *
+ * @param value The value to check.
+ * @return Returns true if value is null, else false.
+ */
+ isNull(value?: any): boolean;
+ }
+
+ interface LoDashImplicitWrapperBase<T, TWrapper> {
+ /**
+ * see _.isNull
+ */
+ isNull(): boolean;
+ }
+
+ interface LoDashExplicitWrapperBase<T, TWrapper> {
+ /**
+ * see _.isNull
+ */
+ isNull(): LoDashExplicitWrapper<boolean>;
+ }
+
+ //_.isNumber
+ interface LoDashStatic {
+ /**
+ * Checks if value is classified as a Number primitive or object.
+ *
+ * Note: To exclude Infinity, -Infinity, and NaN, which are classified as numbers, use the _.isFinite method.
+ *
+ * @param value The value to check.
+ * @return Returns true if value is correctly classified, else false.
+ */
+ isNumber(value?: any): value is number;
+ }
+
+ interface LoDashImplicitWrapperBase<T, TWrapper> {
+ /**
+ * see _.isNumber
+ */
+ isNumber(): boolean;
+ }
+
+ interface LoDashExplicitWrapperBase<T, TWrapper> {
+ /**
+ * see _.isNumber
+ */
+ isNumber(): LoDashExplicitWrapper<boolean>;
+ }
+
+ //_.isObject
+ interface LoDashStatic {
+ /**
+ * Checks if value is the language type of Object. (e.g. arrays, functions, objects, regexes, new Number(0),
+ * and new String(''))
+ *
+ * @param value The value to check.
+ * @return Returns true if value is an object, else false.
+ */
+ isObject(value?: any): boolean;
+ }
+
+ interface LoDashImplicitWrapperBase<T, TWrapper> {
+ /**
+ * see _.isObject
+ */
+ isObject(): boolean;
+ }
+
+ interface LoDashExplicitWrapperBase<T, TWrapper> {
+ /**
+ * see _.isObject
+ */
+ isObject(): LoDashExplicitWrapper<boolean>;
+ }
+
+ //_.isObjectLike
+ interface LoDashStatic {
+ /**
+ * Checks if `value` is object-like. A value is object-like if it's not `null`
+ * and has a `typeof` result of "object".
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
+ * @example
+ *
+ * _.isObjectLike({});
+ * // => true
+ *
+ * _.isObjectLike([1, 2, 3]);
+ * // => true
+ *
+ * _.isObjectLike(_.noop);
+ * // => false
+ *
+ * _.isObjectLike(null);
+ * // => false
+ */
+ isObjectLike(value?: any): boolean;
+ }
+
+ interface LoDashImplicitWrapperBase<T, TWrapper> {
+ /**
+ * see _.isObjectLike
+ */
+ isObjectLike(): boolean;
+ }
+
+ interface LoDashExplicitWrapperBase<T, TWrapper> {
+ /**
+ * see _.isObjectLike
+ */
+ isObjectLike(): LoDashExplicitWrapper<boolean>;
+ }
+
+ //_.isPlainObject
+ interface LoDashStatic {
+ /**
+ * Checks if value is a plain object, that is, an object created by the Object constructor or one with a
+ * [[Prototype]] of null.
+ *
+ * Note: This method assumes objects created by the Object constructor have no inherited enumerable properties.
+ *
+ * @param value The value to check.
+ * @return Returns true if value is a plain object, else false.
+ */
+ isPlainObject(value?: any): boolean;
+ }
+
+ interface LoDashImplicitWrapperBase<T, TWrapper> {
+ /**
+ * see _.isPlainObject
+ */
+ isPlainObject(): boolean;
+ }
+
+ interface LoDashExplicitWrapperBase<T, TWrapper> {
+ /**
+ * see _.isPlainObject
+ */
+ isPlainObject(): LoDashExplicitWrapper<boolean>;
+ }
+
+ //_.isRegExp
+ interface LoDashStatic {
+ /**
+ * Checks if value is classified as a RegExp object.
+ * @param value The value to check.
+ *
+ * @return Returns true if value is correctly classified, else false.
+ */
+ isRegExp(value?: any): value is RegExp;
+ }
+
+ interface LoDashImplicitWrapperBase<T, TWrapper> {
+ /**
+ * see _.isRegExp
+ */
+ isRegExp(): boolean;
+ }
+
+ interface LoDashExplicitWrapperBase<T, TWrapper> {
+ /**
+ * see _.isRegExp
+ */
+ isRegExp(): LoDashExplicitWrapper<boolean>;
+ }
+
+ //_.isSafeInteger
+ interface LoDashStatic {
+ /**
+ * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754
+ * double precision number which isn't the result of a rounded unsafe integer.
+ *
+ * **Note:** This method is based on [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger).
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`.
+ * @example
+ *
+ * _.isSafeInteger(3);
+ * // => true
+ *
+ * _.isSafeInteger(Number.MIN_VALUE);
+ * // => false
+ *
+ * _.isSafeInteger(Infinity);
+ * // => false
+ *
+ * _.isSafeInteger('3');
+ * // => false
+ */
+ isSafeInteger(value: any): boolean;
+ }
+
+ interface LoDashImplicitWrapperBase<T, TWrapper> {
+ /**
+ * see _.isSafeInteger
+ */
+ isSafeInteger(): boolean;
+ }
+
+ interface LoDashExplicitWrapperBase<T, TWrapper> {
+ /**
+ * see _.isSafeInteger
+ */
+ isSafeInteger(): LoDashExplicitWrapper<boolean>;
+ }
+
+ //_.isString
+ interface LoDashStatic {
+ /**
+ * Checks if value is classified as a String primitive or object.
+ *
+ * @param value The value to check.
+ * @return Returns true if value is correctly classified, else false.
+ */
+ isString(value?: any): value is string;
+ }
+
+ interface LoDashImplicitWrapperBase<T, TWrapper> {
+ /**
+ * see _.isString
+ */
+ isString(): boolean;
+ }
+
+ interface LoDashExplicitWrapperBase<T, TWrapper> {
+ /**
+ * see _.isString
+ */
+ isString(): LoDashExplicitWrapper<boolean>;
+ }
+
+ //_.isSymbol
+ interface LoDashStatic {
+ /**
+ * Checks if `value` is classified as a `Symbol` primitive or object.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
+ * @example
+ *
+ * _.isSymbol(Symbol.iterator);
+ * // => true
+ *
+ * _.isSymbol('abc');
+ * // => false
+ */
+ isSymbol(value: any): boolean;
+ }
+
+ interface LoDashImplicitWrapperBase<T, TWrapper> {
+ /**
+ * see _.isSymbol
+ */
+ isSymbol(): boolean;
+ }
+
+ interface LoDashExplicitWrapperBase<T, TWrapper> {
+ /**
+ * see _.isSymbol
+ */
+ isSymbol(): LoDashExplicitWrapper<boolean>;
+ }
+
+ //_.isTypedArray
+ interface LoDashStatic {
+ /**
+ * Checks if value is classified as a typed array.
+ *
+ * @param value The value to check.
+ * @return Returns true if value is correctly classified, else false.
+ */
+ isTypedArray(value: any): boolean;
+ }
+
+ interface LoDashImplicitWrapperBase<T, TWrapper> {
+ /**
+ * see _.isTypedArray
+ */
+ isTypedArray(): boolean;
+ }
+
+ interface LoDashExplicitWrapperBase<T, TWrapper> {
+ /**
+ * see _.isTypedArray
+ */
+ isTypedArray(): LoDashExplicitWrapper<boolean>;
+ }
+
+ //_.isUndefined
+ interface LoDashStatic {
+ /**
+ * Checks if value is undefined.
+ *
+ * @param value The value to check.
+ * @return Returns true if value is undefined, else false.
+ */
+ isUndefined(value: any): boolean;
+ }
+
+ interface LoDashImplicitWrapperBase<T, TWrapper> {
+ /**
+ * see _.isUndefined
+ */
+ isUndefined(): boolean;
+ }
+
+ interface LoDashExplicitWrapperBase<T, TWrapper> {
+ /**
+ * see _.isUndefined
+ */
+ isUndefined(): LoDashExplicitWrapper<boolean>;
+ }
+
+ //_.lt
+ interface LoDashStatic {
+ /**
+ * Checks if value is less than other.
+ *
+ * @param value The value to compare.
+ * @param other The other value to compare.
+ * @return Returns true if value is less than other, else false.
+ */
+ lt(
+ value: any,
+ other: any
+ ): boolean;
+ }
+
+ interface LoDashImplicitWrapperBase<T, TWrapper> {
+ /**
+ * @see _.lt
+ */
+ lt(other: any): boolean;
+ }
+
+ interface LoDashExplicitWrapperBase<T, TWrapper> {
+ /**
+ * @see _.lt
+ */
+ lt(other: any): LoDashExplicitWrapper<boolean>;
+ }
+
+ //_.lte
+ interface LoDashStatic {
+ /**
+ * Checks if value is less than or equal to other.
+ *
+ * @param value The value to compare.
+ * @param other The other value to compare.
+ * @return Returns true if value is less than or equal to other, else false.
+ */
+ lte(
+ value: any,
+ other: any
+ ): boolean;
+ }
+
+ interface LoDashImplicitWrapperBase<T, TWrapper> {
+ /**
+ * @see _.lte
+ */
+ lte(other: any): boolean;
+ }
+
+ interface LoDashExplicitWrapperBase<T, TWrapper> {
+ /**
+ * @see _.lte
+ */
+ lte(other: any): LoDashExplicitWrapper<boolean>;
+ }
+
+ //_.toArray
+ interface LoDashStatic {
+ /**
+ * Converts value to an array.
+ *
+ * @param value The value to convert.
+ * @return Returns the converted array.
+ */
+ toArray<T>(value: List<T>|Dictionary<T>|NumericDictionary<T>): T[];
+
+ /**
+ * @see _.toArray
+ */
+ toArray<TValue, TResult>(value: TValue): TResult[];
+
+ /**
+ * @see _.toArray
+ */
+ toArray<TResult>(value?: any): TResult[];
+ }
+
+ interface LoDashImplicitWrapper<T> {
+ /**
+ * @see _.toArray
+ */
+ toArray<TResult>(): LoDashImplicitArrayWrapper<TResult>;
+ }
+
+ interface LoDashImplicitArrayWrapper<T> {
+ /**
+ * @see _.toArray
+ */
+ toArray(): LoDashImplicitArrayWrapper<T>;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.toArray
+ */
+ toArray<TResult>(): LoDashImplicitArrayWrapper<TResult>;
+ }
+
+ interface LoDashExplicitWrapper<T> {
+ /**
+ * @see _.toArray
+ */
+ toArray<TResult>(): LoDashExplicitArrayWrapper<TResult>;
+ }
+
+ interface LoDashExplicitArrayWrapper<T> {
+ /**
+ * @see _.toArray
+ */
+ toArray(): LoDashExplicitArrayWrapper<T>;
+ }
+
+ interface LoDashExplicitObjectWrapper<T> {
+ /**
+ * @see _.toArray
+ */
+ toArray<TResult>(): LoDashExplicitArrayWrapper<TResult>;
+ }
+
+ //_.toPlainObject
+ interface LoDashStatic {
+ /**
+ * Converts value to a plain object flattening inherited enumerable properties of value to own properties
+ * of the plain object.
+ *
+ * @param value The value to convert.
+ * @return Returns the converted plain object.
+ */
+ toPlainObject<TResult extends {}>(value?: any): TResult;
+ }
+
+ interface LoDashImplicitWrapperBase<T, TWrapper> {
+ /**
+ * @see _.toPlainObject
+ */
+ toPlainObject<TResult extends {}>(): LoDashImplicitObjectWrapper<TResult>;
+ }
+
+ //_.toInteger
+ interface LoDashStatic {
+ /**
+ * Converts `value` to an integer.
+ *
+ * **Note:** This function is loosely based on [`ToInteger`](http://www.ecma-international.org/ecma-262/6.0/#sec-tointeger).
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to convert.
+ * @returns {number} Returns the converted integer.
+ * @example
+ *
+ * _.toInteger(3);
+ * // => 3
+ *
+ * _.toInteger(Number.MIN_VALUE);
+ * // => 0
+ *
+ * _.toInteger(Infinity);
+ * // => 1.7976931348623157e+308
+ *
+ * _.toInteger('3');
+ * // => 3
+ */
+ toInteger(value: any): number;
+ }
+
+ interface LoDashImplicitWrapperBase<T, TWrapper> {
+ /**
+ * @see _.toInteger
+ */
+ toInteger(): LoDashImplicitWrapper<number>;
+ }
+
+ interface LoDashExplicitWrapperBase<T, TWrapper> {
+ /**
+ * @see _.toInteger
+ */
+ toInteger(): LoDashExplicitWrapper<number>;
+ }
+
+ //_.toLength
+ interface LoDashStatic {
+ /**
+ * Converts `value` to an integer suitable for use as the length of an
+ * array-like object.
+ *
+ * **Note:** This method is based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength).
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to convert.
+ * @return {number} Returns the converted integer.
+ * @example
+ *
+ * _.toLength(3);
+ * // => 3
+ *
+ * _.toLength(Number.MIN_VALUE);
+ * // => 0
+ *
+ * _.toLength(Infinity);
+ * // => 4294967295
+ *
+ * _.toLength('3');
+ * // => 3
+ */
+ toLength(value: any): number;
+ }
+
+ interface LoDashImplicitWrapperBase<T, TWrapper> {
+ /**
+ * @see _.toLength
+ */
+ toLength(): LoDashImplicitWrapper<number>;
+ }
+
+ interface LoDashExplicitWrapperBase<T, TWrapper> {
+ /**
+ * @see _.toLength
+ */
+ toLength(): LoDashExplicitWrapper<number>;
+ }
+
+ //_.toNumber
+ interface LoDashStatic {
+ /**
+ * Converts `value` to a number.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to process.
+ * @returns {number} Returns the number.
+ * @example
+ *
+ * _.toNumber(3);
+ * // => 3
+ *
+ * _.toNumber(Number.MIN_VALUE);
+ * // => 5e-324
+ *
+ * _.toNumber(Infinity);
+ * // => Infinity
+ *
+ * _.toNumber('3');
+ * // => 3
+ */
+ toNumber(value: any): number;
+ }
+
+ interface LoDashImplicitWrapperBase<T, TWrapper> {
+ /**
+ * @see _.toNumber
+ */
+ toNumber(): LoDashImplicitWrapper<number>;
+ }
+
+ interface LoDashExplicitWrapperBase<T, TWrapper> {
+ /**
+ * @see _.toNumber
+ */
+ toNumber(): LoDashExplicitWrapper<number>;
+ }
+
+ //_.toSafeInteger
+ interface LoDashStatic {
+ /**
+ * Converts `value` to a safe integer. A safe integer can be compared and
+ * represented correctly.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to convert.
+ * @returns {number} Returns the converted integer.
+ * @example
+ *
+ * _.toSafeInteger(3);
+ * // => 3
+ *
+ * _.toSafeInteger(Number.MIN_VALUE);
+ * // => 0
+ *
+ * _.toSafeInteger(Infinity);
+ * // => 9007199254740991
+ *
+ * _.toSafeInteger('3');
+ * // => 3
+ */
+ toSafeInteger(value: any): number;
+ }
+
+ interface LoDashImplicitWrapperBase<T, TWrapper> {
+ /**
+ * @see _.toSafeInteger
+ */
+ toSafeInteger(): LoDashImplicitWrapper<number>;
+ }
+
+ interface LoDashExplicitWrapperBase<T, TWrapper> {
+ /**
+ * @see _.toSafeInteger
+ */
+ toSafeInteger(): LoDashExplicitWrapper<number>;
+ }
+
+ //_.toString DUMMY
+ interface LoDashStatic {
+ /**
+ * Converts `value` to a string if it's not one. An empty string is returned
+ * for `null` and `undefined` values. The sign of `-0` is preserved.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to process.
+ * @returns {string} Returns the string.
+ * @example
+ *
+ * _.toString(null);
+ * // => ''
+ *
+ * _.toString(-0);
+ * // => '-0'
+ *
+ * _.toString([1, 2, 3]);
+ * // => '1,2,3'
+ */
+ toString(value: any): string;
+ }
+
+ /********
+ * Math *
+ ********/
+
+ //_.add
+ interface LoDashStatic {
+ /**
+ * Adds two numbers.
+ *
+ * @param augend The first number to add.
+ * @param addend The second number to add.
+ * @return Returns the sum.
+ */
+ add(
+ augend: number,
+ addend: number
+ ): number;
+ }
+
+ interface LoDashImplicitWrapper<T> {
+ /**
+ * @see _.add
+ */
+ add(addend: number): number;
+ }
+
+ interface LoDashExplicitWrapper<T> {
+ /**
+ * @see _.add
+ */
+ add(addend: number): LoDashExplicitWrapper<number>;
+ }
+
+ //_.ceil
+ interface LoDashStatic {
+ /**
+ * Calculates n rounded up to precision.
+ *
+ * @param n The number to round up.
+ * @param precision The precision to round up to.
+ * @return Returns the rounded up number.
+ */
+ ceil(
+ n: number,
+ precision?: number
+ ): number;
+ }
+
+ interface LoDashImplicitWrapper<T> {
+ /**
+ * @see _.ceil
+ */
+ ceil(precision?: number): number;
+ }
+
+ interface LoDashExplicitWrapper<T> {
+ /**
+ * @see _.ceil
+ */
+ ceil(precision?: number): LoDashExplicitWrapper<number>;
+ }
+
+ //_.floor
+ interface LoDashStatic {
+ /**
+ * Calculates n rounded down to precision.
+ *
+ * @param n The number to round down.
+ * @param precision The precision to round down to.
+ * @return Returns the rounded down number.
+ */
+ floor(
+ n: number,
+ precision?: number
+ ): number;
+ }
+
+ interface LoDashImplicitWrapper<T> {
+ /**
+ * @see _.floor
+ */
+ floor(precision?: number): number;
+ }
+
+ interface LoDashExplicitWrapper<T> {
+ /**
+ * @see _.floor
+ */
+ floor(precision?: number): LoDashExplicitWrapper<number>;
+ }
+
+ //_.max
+ interface LoDashStatic {
+ /**
+ * Computes the maximum value of `array`. If `array` is empty or falsey
+ * `undefined` is returned.
+ *
+ * @static
+ * @memberOf _
+ * @category Math
+ * @param {Array} array The array to iterate over.
+ * @returns {*} Returns the maximum value.
+ */
+ max<T>(
+ collection: List<T>
+ ): T;
+ }
+
+ interface LoDashImplicitArrayWrapper<T> {
+ /**
+ * @see _.max
+ */
+ max(): T;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.max
+ */
+ max<T>(): T;
+ }
+
+ //_.maxBy
+ interface LoDashStatic {
+ /**
+ * This method is like `_.max` except that it accepts `iteratee` which is
+ * invoked for each element in `array` to generate the criterion by which
+ * the value is ranked. The iteratee is invoked with one argument: (value).
+ *
+ * @static
+ * @memberOf _
+ * @category Math
+ * @param {Array} array The array to iterate over.
+ * @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element.
+ * @returns {*} Returns the maximum value.
+ * @example
+ *
+ * var objects = [{ 'n': 1 }, { 'n': 2 }];
+ *
+ * _.maxBy(objects, function(o) { return o.a; });
+ * // => { 'n': 2 }
+ *
+ * // using the `_.property` iteratee shorthand
+ * _.maxBy(objects, 'n');
+ * // => { 'n': 2 }
+ */
+ maxBy<T>(
+ collection: List<T>,
+ iteratee?: ListIterator<T, any>
+ ): T;
+
+ /**
+ * @see _.maxBy
+ */
+ maxBy<T>(
+ collection: Dictionary<T>,
+ iteratee?: DictionaryIterator<T, any>
+ ): T;
+
+ /**
+ * @see _.maxBy
+ */
+ maxBy<T>(
+ collection: List<T>|Dictionary<T>,
+ iteratee?: string
+ ): T;
+
+ /**
+ * @see _.maxBy
+ */
+ maxBy<TObject extends {}, T>(
+ collection: List<T>|Dictionary<T>,
+ whereValue?: TObject
+ ): T;
+ }
+
+ interface LoDashImplicitArrayWrapper<T> {
+ /**
+ * @see _.maxBy
+ */
+ maxBy(
+ iteratee?: ListIterator<T, any>
+ ): T;
+
+ /**
+ * @see _.maxBy
+ */
+ maxBy(
+ iteratee?: string
+ ): T;
+
+ /**
+ * @see _.maxBy
+ */
+ maxBy<TObject extends {}>(
+ whereValue?: TObject
+ ): T;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.maxBy
+ */
+ maxBy<T>(
+ iteratee?: ListIterator<T, any>|DictionaryIterator<T, any>,
+ thisArg?: any
+ ): T;
+
+ /**
+ * @see _.maxBy
+ */
+ maxBy<T>(
+ iteratee?: string,
+ thisArg?: any
+ ): T;
+
+ /**
+ * @see _.maxBy
+ */
+ maxBy<TObject extends {}, T>(
+ whereValue?: TObject
+ ): T;
+ }
+
+ //_.mean
+ interface LoDashStatic {
+ /**
+ * Computes the mean of the values in `array`.
+ *
+ * @static
+ * @memberOf _
+ * @category Math
+ * @param {Array} array The array to iterate over.
+ * @returns {number} Returns the mean.
+ * @example
+ *
+ * _.mean([4, 2, 8, 6]);
+ * // => 5
+ */
+ mean<T>(
+ collection: List<T>
+ ): number;
+ }
+
+ interface LoDashImplicitArrayWrapper<T> {
+ /**
+ * @see _.mean
+ */
+ mean<T>(): number;
+
+ /**
+ * @see _.mean
+ */
+ mean(): number;
+ }
+
+ //_.min
+ interface LoDashStatic {
+ /**
+ * Computes the minimum value of `array`. If `array` is empty or falsey
+ * `undefined` is returned.
+ *
+ * @static
+ * @memberOf _
+ * @category Math
+ * @param {Array} array The array to iterate over.
+ * @returns {*} Returns the minimum value.
+ */
+ min<T>(
+ collection: List<T>
+ ): T;
+ }
+
+ interface LoDashImplicitArrayWrapper<T> {
+ /**
+ * @see _.min
+ */
+ min(): T;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.min
+ */
+ min<T>(): T;
+ }
+
+ //_.minBy
+ interface LoDashStatic {
+ /**
+ * This method is like `_.min` except that it accepts `iteratee` which is
+ * invoked for each element in `array` to generate the criterion by which
+ * the value is ranked. The iteratee is invoked with one argument: (value).
+ *
+ * @static
+ * @memberOf _
+ * @category Math
+ * @param {Array} array The array to iterate over.
+ * @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element.
+ * @returns {*} Returns the minimum value.
+ * @example
+ *
+ * var objects = [{ 'n': 1 }, { 'n': 2 }];
+ *
+ * _.minBy(objects, function(o) { return o.a; });
+ * // => { 'n': 1 }
+ *
+ * // using the `_.property` iteratee shorthand
+ * _.minBy(objects, 'n');
+ * // => { 'n': 1 }
+ */
+ minBy<T>(
+ collection: List<T>,
+ iteratee?: ListIterator<T, any>
+ ): T;
+
+ /**
+ * @see _.minBy
+ */
+ minBy<T>(
+ collection: Dictionary<T>,
+ iteratee?: DictionaryIterator<T, any>
+ ): T;
+
+ /**
+ * @see _.minBy
+ */
+ minBy<T>(
+ collection: List<T>|Dictionary<T>,
+ iteratee?: string
+ ): T;
+
+ /**
+ * @see _.minBy
+ */
+ minBy<TObject extends {}, T>(
+ collection: List<T>|Dictionary<T>,
+ whereValue?: TObject
+ ): T;
+ }
+
+ interface LoDashImplicitArrayWrapper<T> {
+ /**
+ * @see _.minBy
+ */
+ minBy(
+ iteratee?: ListIterator<T, any>
+ ): T;
+
+ /**
+ * @see _.minBy
+ */
+ minBy(
+ iteratee?: string
+ ): T;
+
+ /**
+ * @see _.minBy
+ */
+ minBy<TObject extends {}>(
+ whereValue?: TObject
+ ): T;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.minBy
+ */
+ minBy<T>(
+ iteratee?: ListIterator<T, any>|DictionaryIterator<T, any>,
+ thisArg?: any
+ ): T;
+
+ /**
+ * @see _.minBy
+ */
+ minBy<T>(
+ iteratee?: string,
+ thisArg?: any
+ ): T;
+
+ /**
+ * @see _.minBy
+ */
+ minBy<TObject extends {}, T>(
+ whereValue?: TObject
+ ): T;
+ }
+
+ //_.round
+ interface LoDashStatic {
+ /**
+ * Calculates n rounded to precision.
+ *
+ * @param n The number to round.
+ * @param precision The precision to round to.
+ * @return Returns the rounded number.
+ */
+ round(
+ n: number,
+ precision?: number
+ ): number;
+ }
+
+ interface LoDashImplicitWrapper<T> {
+ /**
+ * @see _.round
+ */
+ round(precision?: number): number;
+ }
+
+ interface LoDashExplicitWrapper<T> {
+ /**
+ * @see _.round
+ */
+ round(precision?: number): LoDashExplicitWrapper<number>;
+ }
+
+ //_.sum
+ interface LoDashStatic {
+ /**
+ * Computes the sum of the values in `array`.
+ *
+ * @static
+ * @memberOf _
+ * @category Math
+ * @param {Array} array The array to iterate over.
+ * @returns {number} Returns the sum.
+ * @example
+ *
+ * _.sum([4, 2, 8, 6]);
+ * // => 20
+ */
+ sum<T>(collection: List<T>): number;
+
+ /**
+ * @see _.sum
+ */
+ sum(collection: List<number>|Dictionary<number>): number;
+ }
+
+ interface LoDashImplicitArrayWrapper<T> {
+ /**
+ * @see _.sum
+ */
+ sum(): number;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.sum
+ **/
+ sum<TValue>(): number;
+
+ /**
+ * @see _.sum
+ */
+ sum(): number;
+ }
+
+ interface LoDashExplicitArrayWrapper<T> {
+ /**
+ * @see _.sum
+ */
+ sum(): LoDashExplicitWrapper<number>;
+ }
+
+ interface LoDashExplicitObjectWrapper<T> {
+ /**
+ * @see _.sum
+ */
+ sum<TValue>(): LoDashExplicitWrapper<number>;
+
+ /**
+ * @see _.sum
+ */
+ sum(): LoDashExplicitWrapper<number>;
+ }
+
+ //_.sumBy
+ interface LoDashStatic {
+ /**
+ * This method is like `_.sum` except that it accepts `iteratee` which is
+ * invoked for each element in `array` to generate the value to be summed.
+ * The iteratee is invoked with one argument: (value).
+ *
+ * @static
+ * @memberOf _
+ * @category Math
+ * @param {Array} array The array to iterate over.
+ * @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element.
+ * @returns {number} Returns the sum.
+ * @example
+ *
+ * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
+ *
+ * _.sumBy(objects, function(o) { return o.n; });
+ * // => 20
+ *
+ * // using the `_.property` iteratee shorthand
+ * _.sumBy(objects, 'n');
+ * // => 20
+ */
+ sumBy<T>(
+ collection: List<T>,
+ iteratee: ListIterator<T, number>
+ ): number;
+
+ /**
+ * @see _.sumBy
+ **/
+ sumBy<T>(
+ collection: Dictionary<T>,
+ iteratee: DictionaryIterator<T, number>
+ ): number;
+
+ /**
+ * @see _.sumBy
+ */
+ sumBy<T>(
+ collection: List<number>|Dictionary<number>,
+ iteratee: string
+ ): number;
+
+ /**
+ * @see _.sumBy
+ */
+ sumBy<T>(collection: List<T>|Dictionary<T>): number;
+
+ /**
+ * @see _.sumBy
+ */
+ sumBy(collection: List<number>|Dictionary<number>): number;
+ }
+
+ interface LoDashImplicitArrayWrapper<T> {
+ /**
+ * @see _.sumBy
+ */
+ sumBy(
+ iteratee: ListIterator<T, number>
+ ): number;
+
+ /**
+ * @see _.sumBy
+ */
+ sumBy(iteratee: string): number;
+
+ /**
+ * @see _.sumBy
+ */
+ sumBy(): number;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.sumBy
+ **/
+ sumBy<TValue>(
+ iteratee: ListIterator<TValue, number>|DictionaryIterator<TValue, number>
+ ): number;
+
+ /**
+ * @see _.sumBy
+ */
+ sumBy(iteratee: string): number;
+
+ /**
+ * @see _.sumBy
+ */
+ sumBy(): number;
+ }
+
+ interface LoDashExplicitArrayWrapper<T> {
+ /**
+ * @see _.sumBy
+ */
+ sumBy(
+ iteratee: ListIterator<T, number>
+ ): LoDashExplicitWrapper<number>;
+
+ /**
+ * @see _.sumBy
+ */
+ sumBy(iteratee: string): LoDashExplicitWrapper<number>;
+
+ /**
+ * @see _.sumBy
+ */
+ sumBy(): LoDashExplicitWrapper<number>;
+ }
+
+ interface LoDashExplicitObjectWrapper<T> {
+ /**
+ * @see _.sumBy
+ */
+ sumBy<TValue>(
+ iteratee: ListIterator<TValue, number>|DictionaryIterator<TValue, number>
+ ): LoDashExplicitWrapper<number>;
+
+ /**
+ * @see _.sumBy
+ */
+ sumBy(iteratee: string): LoDashExplicitWrapper<number>;
+
+ /**
+ * @see _.sumBy
+ */
+ sumBy(): LoDashExplicitWrapper<number>;
+ }
+
+ /**********
+ * Number *
+ **********/
+
+ //_.subtract
+ interface LoDashStatic {
+ /**
+ * Subtract two numbers.
+ *
+ * @static
+ * @memberOf _
+ * @category Math
+ * @param {number} minuend The first number in a subtraction.
+ * @param {number} subtrahend The second number in a subtraction.
+ * @returns {number} Returns the difference.
+ * @example
+ *
+ * _.subtract(6, 4);
+ * // => 2
+ */
+ subtract(
+ minuend: number,
+ subtrahend: number
+ ): number;
+ }
+
+ interface LoDashImplicitWrapper<T> {
+ /**
+ * @see _.subtract
+ */
+ subtract(
+ subtrahend: number
+ ): number;
+ }
+
+ interface LoDashExplicitWrapper<T> {
+ /**
+ * @see _.subtract
+ */
+ subtract(
+ subtrahend: number
+ ): LoDashExplicitWrapper<number>;
+ }
+
+ //_.clamp
+ interface LoDashStatic {
+ /**
+ * Clamps `number` within the inclusive `lower` and `upper` bounds.
+ *
+ * @static
+ * @memberOf _
+ * @category Number
+ * @param {number} number The number to clamp.
+ * @param {number} [lower] The lower bound.
+ * @param {number} upper The upper bound.
+ * @returns {number} Returns the clamped number.
+ * @example
+ *
+ * _.clamp(-10, -5, 5);
+ * // => -5
+ *
+ * _.clamp(10, -5, 5);
+ * // => 5
+ */
+ clamp(
+ number: number,
+ lower: number,
+ upper: number
+ ): number;
+ }
+
+ interface LoDashImplicitWrapper<T> {
+ /**
+ * @see _.clamp
+ */
+ clamp(
+ lower: number,
+ upper: number
+ ): number;
+ }
+
+ interface LoDashExplicitWrapper<T> {
+ /**
+ * @see _.clamp
+ */
+ clamp(
+ lower: number,
+ upper: number
+ ): LoDashExplicitWrapper<number>;
+ }
+
+ //_.inRange
+ interface LoDashStatic {
+ /**
+ * Checks if n is between start and up to but not including, end. If end is not specified it’s set to start
+ * with start then set to 0.
+ *
+ * @param n The number to check.
+ * @param start The start of the range.
+ * @param end The end of the range.
+ * @return Returns true if n is in the range, else false.
+ */
+ inRange(
+ n: number,
+ start: number,
+ end: number
+ ): boolean;
+
+
+ /**
+ * @see _.inRange
+ */
+ inRange(
+ n: number,
+ end: number
+ ): boolean;
+ }
+
+ interface LoDashImplicitWrapper<T> {
+ /**
+ * @see _.inRange
+ */
+ inRange(
+ start: number,
+ end: number
+ ): boolean;
+
+ /**
+ * @see _.inRange
+ */
+ inRange(end: number): boolean;
+ }
+
+ interface LoDashExplicitWrapper<T> {
+ /**
+ * @see _.inRange
+ */
+ inRange(
+ start: number,
+ end: number
+ ): LoDashExplicitWrapper<boolean>;
+
+ /**
+ * @see _.inRange
+ */
+ inRange(end: number): LoDashExplicitWrapper<boolean>;
+ }
+
+ //_.random
+ interface LoDashStatic {
+ /**
+ * Produces a random number between min and max (inclusive). If only one argument is provided a number between
+ * 0 and the given number is returned. If floating is true, or either min or max are floats, a floating-point
+ * number is returned instead of an integer.
+ *
+ * @param min The minimum possible value.
+ * @param max The maximum possible value.
+ * @param floating Specify returning a floating-point number.
+ * @return Returns the random number.
+ */
+ random(
+ min?: number,
+ max?: number,
+ floating?: boolean
+ ): number;
+
+ /**
+ * @see _.random
+ */
+ random(
+ min?: number,
+ floating?: boolean
+ ): number;
+
+ /**
+ * @see _.random
+ */
+ random(floating?: boolean): number;
+ }
+
+ interface LoDashImplicitWrapper<T> {
+ /**
+ * @see _.random
+ */
+ random(
+ max?: number,
+ floating?: boolean
+ ): number;
+
+ /**
+ * @see _.random
+ */
+ random(floating?: boolean): number;
+ }
+
+ interface LoDashExplicitWrapper<T> {
+ /**
+ * @see _.random
+ */
+ random(
+ max?: number,
+ floating?: boolean
+ ): LoDashExplicitWrapper<number>;
+
+ /**
+ * @see _.random
+ */
+ random(floating?: boolean): LoDashExplicitWrapper<number>;
+ }
+
+ /**********
+ * Object *
+ **********/
+
+ //_.assign
+ interface LoDashStatic {
+ /**
+ * Assigns own enumerable properties of source objects to the destination
+ * object. Source objects are applied from left to right. Subsequent sources
+ * overwrite property assignments of previous sources.
+ *
+ * **Note:** This method mutates `object` and is loosely based on
+ * [`Object.assign`](https://mdn.io/Object/assign).
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The destination object.
+ * @param {...Object} [sources] The source objects.
+ * @returns {Object} Returns `object`.
+ * @example
+ *
+ * function Foo() {
+ * this.c = 3;
+ * }
+ *
+ * function Bar() {
+ * this.e = 5;
+ * }
+ *
+ * Foo.prototype.d = 4;
+ * Bar.prototype.f = 6;
+ *
+ * _.assign({ 'a': 1 }, new Foo, new Bar);
+ * // => { 'a': 1, 'c': 3, 'e': 5 }
+ */
+ assign<TObject extends {}, TSource extends {}, TResult extends {}>(
+ object: TObject,
+ source: TSource
+ ): TResult;
+
+ /**
+ * @see assign
+ */
+ assign<TObject extends {}, TSource1 extends {}, TSource2 extends {}, TResult extends {}>(
+ object: TObject,
+ source1: TSource1,
+ source2: TSource2
+ ): TResult;
+
+ /**
+ * @see assign
+ */
+ assign<TObject extends {}, TSource1 extends {}, TSource2 extends {}, TSource3 extends {}, TResult extends {}>(
+ object: TObject,
+ source1: TSource1,
+ source2: TSource2,
+ source3: TSource3
+ ): TResult;
+
+ /**
+ * @see assign
+ */
+ assign<TObject extends {}, TSource1 extends {}, TSource2 extends {}, TSource3 extends {}, TSource4 extends {},
+ TResult extends {}>
+ (
+ object: TObject,
+ source1: TSource1,
+ source2: TSource2,
+ source3: TSource3,
+ source4: TSource4
+ ): TResult;
+
+ /**
+ * @see _.assign
+ */
+ assign<TObject extends {}>(object: TObject): TObject;
+
+ /**
+ * @see _.assign
+ */
+ assign<TObject extends {}, TResult extends {}>(
+ object: TObject, ...otherArgs: any[]
+ ): TResult;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.assign
+ */
+ assign<TSource extends {}, TResult extends {}>(
+ source: TSource
+ ): LoDashImplicitObjectWrapper<TResult>;
+
+ /**
+ * @see assign
+ */
+ assign<TSource1 extends {}, TSource2 extends {}, TResult extends {}>(
+ source1: TSource1,
+ source2: TSource2
+ ): LoDashImplicitObjectWrapper<TResult>;
+
+ /**
+ * @see assign
+ */
+ assign<TSource1 extends {}, TSource2 extends {}, TSource3 extends {}, TResult extends {}>(
+ source1: TSource1,
+ source2: TSource2,
+ source3: TSource3
+ ): LoDashImplicitObjectWrapper<TResult>;
+
+ /**
+ * @see assign
+ */
+ assign<TSource1 extends {}, TSource2 extends {}, TSource3 extends {}, TSource4 extends {}, TResult extends {}>(
+ source1: TSource1,
+ source2: TSource2,
+ source3: TSource3,
+ source4: TSource4
+ ): LoDashImplicitObjectWrapper<TResult>;
+
+ /**
+ * @see _.assign
+ */
+ assign(): LoDashImplicitObjectWrapper<T>;
+
+ /**
+ * @see _.assign
+ */
+ assign<TResult extends {}>(...otherArgs: any[]): LoDashImplicitObjectWrapper<TResult>;
+ }
+
+ interface LoDashExplicitObjectWrapper<T> {
+ /**
+ * @see _.assign
+ */
+ assign<TSource extends {}, TResult extends {}>(
+ source: TSource
+ ): LoDashExplicitObjectWrapper<TResult>;
+
+ /**
+ * @see assign
+ */
+ assign<TSource1 extends {}, TSource2 extends {}, TResult extends {}>(
+ source1: TSource1,
+ source2: TSource2
+ ): LoDashExplicitObjectWrapper<TResult>;
+
+ /**
+ * @see assign
+ */
+ assign<TSource1 extends {}, TSource2 extends {}, TSource3 extends {}, TResult extends {}>(
+ source1: TSource1,
+ source2: TSource2,
+ source3: TSource3
+ ): LoDashExplicitObjectWrapper<TResult>;
+
+ /**
+ * @see assign
+ */
+ assign<TSource1 extends {}, TSource2 extends {}, TSource3 extends {}, TSource4 extends {}, TResult extends {}>(
+ source1: TSource1,
+ source2: TSource2,
+ source3: TSource3,
+ source4: TSource4
+ ): LoDashExplicitObjectWrapper<TResult>;
+
+ /**
+ * @see _.assign
+ */
+ assign(): LoDashExplicitObjectWrapper<T>;
+
+ /**
+ * @see _.assign
+ */
+ assign<TResult extends {}>(...otherArgs: any[]): LoDashExplicitObjectWrapper<TResult>;
+ }
+
+ //_.assignWith
+ interface AssignCustomizer {
+ (objectValue: any, sourceValue: any, key?: string, object?: {}, source?: {}): any;
+ }
+
+ interface LoDashStatic {
+ /**
+ * This method is like `_.assign` except that it accepts `customizer` which
+ * is invoked to produce the assigned values. If `customizer` returns `undefined`
+ * assignment is handled by the method instead. The `customizer` is invoked
+ * with five arguments: (objValue, srcValue, key, object, source).
+ *
+ * **Note:** This method mutates `object`.
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The destination object.
+ * @param {...Object} sources The source objects.
+ * @param {Function} [customizer] The function to customize assigned values.
+ * @returns {Object} Returns `object`.
+ * @example
+ *
+ * function customizer(objValue, srcValue) {
+ * return _.isUndefined(objValue) ? srcValue : objValue;
+ * }
+ *
+ * var defaults = _.partialRight(_.assignWith, customizer);
+ *
+ * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
+ * // => { 'a': 1, 'b': 2 }
+ */
+ assignWith<TObject extends {}, TSource extends {}, TResult extends {}>(
+ object: TObject,
+ source: TSource,
+ customizer: AssignCustomizer
+ ): TResult;
+
+ /**
+ * @see assignWith
+ */
+ assignWith<TObject extends {}, TSource1 extends {}, TSource2 extends {}, TResult extends {}>(
+ object: TObject,
+ source1: TSource1,
+ source2: TSource2,
+ customizer: AssignCustomizer
+ ): TResult;
+
+ /**
+ * @see assignWith
+ */
+ assignWith<TObject extends {}, TSource1 extends {}, TSource2 extends {}, TSource3 extends {}, TResult extends {}>(
+ object: TObject,
+ source1: TSource1,
+ source2: TSource2,
+ source3: TSource3,
+ customizer: AssignCustomizer
+ ): TResult;
+
+ /**
+ * @see assignWith
+ */
+ assignWith<TObject extends {}, TSource1 extends {}, TSource2 extends {}, TSource3 extends {}, TSource4 extends {},
+ TResult extends {}>
+ (
+ object: TObject,
+ source1: TSource1,
+ source2: TSource2,
+ source3: TSource3,
+ source4: TSource4,
+ customizer: AssignCustomizer
+ ): TResult;
+
+ /**
+ * @see _.assignWith
+ */
+ assignWith<TObject extends {}>(object: TObject): TObject;
+
+ /**
+ * @see _.assignWith
+ */
+ assignWith<TObject extends {}, TResult extends {}>(
+ object: TObject, ...otherArgs: any[]
+ ): TResult;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.assignWith
+ */
+ assignWith<TSource extends {}, TResult extends {}>(
+ source: TSource,
+ customizer: AssignCustomizer
+ ): LoDashImplicitObjectWrapper<TResult>;
+
+ /**
+ * @see assignWith
+ */
+ assignWith<TSource1 extends {}, TSource2 extends {}, TResult extends {}>(
+ source1: TSource1,
+ source2: TSource2,
+ customizer: AssignCustomizer
+ ): LoDashImplicitObjectWrapper<TResult>;
+
+ /**
+ * @see assignWith
+ */
+ assignWith<TSource1 extends {}, TSource2 extends {}, TSource3 extends {}, TResult extends {}>(
+ source1: TSource1,
+ source2: TSource2,
+ source3: TSource3,
+ customizer: AssignCustomizer
+ ): LoDashImplicitObjectWrapper<TResult>;
+
+ /**
+ * @see assignWith
+ */
+ assignWith<TSource1 extends {}, TSource2 extends {}, TSource3 extends {}, TSource4 extends {}, TResult extends {}>(
+ source1: TSource1,
+ source2: TSource2,
+ source3: TSource3,
+ source4: TSource4,
+ customizer: AssignCustomizer
+ ): LoDashImplicitObjectWrapper<TResult>;
+
+ /**
+ * @see _.assignWith
+ */
+ assignWith(): LoDashImplicitObjectWrapper<T>;
+
+ /**
+ * @see _.assignWith
+ */
+ assignWith<TResult extends {}>(...otherArgs: any[]): LoDashImplicitObjectWrapper<TResult>;
+ }
+
+ interface LoDashExplicitObjectWrapper<T> {
+ /**
+ * @see _.assignWith
+ */
+ assignWith<TSource extends {}, TResult extends {}>(
+ source: TSource,
+ customizer: AssignCustomizer
+ ): LoDashExplicitObjectWrapper<TResult>;
+
+ /**
+ * @see assignWith
+ */
+ assignWith<TSource1 extends {}, TSource2 extends {}, TResult extends {}>(
+ source1: TSource1,
+ source2: TSource2,
+ customizer: AssignCustomizer
+ ): LoDashExplicitObjectWrapper<TResult>;
+
+ /**
+ * @see assignWith
+ */
+ assignWith<TSource1 extends {}, TSource2 extends {}, TSource3 extends {}, TResult extends {}>(
+ source1: TSource1,
+ source2: TSource2,
+ source3: TSource3,
+ customizer: AssignCustomizer
+ ): LoDashExplicitObjectWrapper<TResult>;
+
+ /**
+ * @see assignWith
+ */
+ assignWith<TSource1 extends {}, TSource2 extends {}, TSource3 extends {}, TSource4 extends {}, TResult extends {}>(
+ source1: TSource1,
+ source2: TSource2,
+ source3: TSource3,
+ source4: TSource4,
+ customizer: AssignCustomizer
+ ): LoDashExplicitObjectWrapper<TResult>;
+
+ /**
+ * @see _.assignWith
+ */
+ assignWith(): LoDashExplicitObjectWrapper<T>;
+
+ /**
+ * @see _.assignWith
+ */
+ assignWith<TResult extends {}>(...otherArgs: any[]): LoDashExplicitObjectWrapper<TResult>;
+ }
+
+ //_.assignIn
+ interface LoDashStatic {
+ /**
+ * This method is like `_.assign` except that it iterates over own and
+ * inherited source properties.
+ *
+ * **Note:** This method mutates `object`.
+ *
+ * @static
+ * @memberOf _
+ * @alias extend
+ * @category Object
+ * @param {Object} object The destination object.
+ * @param {...Object} [sources] The source objects.
+ * @returns {Object} Returns `object`.
+ * @example
+ *
+ * function Foo() {
+ * this.b = 2;
+ * }
+ *
+ * function Bar() {
+ * this.d = 4;
+ * }
+ *
+ * Foo.prototype.c = 3;
+ * Bar.prototype.e = 5;
+ *
+ * _.assignIn({ 'a': 1 }, new Foo, new Bar);
+ * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5 }
+ */
+ assignIn<TObject extends {}, TSource extends {}, TResult extends {}>(
+ object: TObject,
+ source: TSource
+ ): TResult;
+
+ /**
+ * @see assignIn
+ */
+ assignIn<TObject extends {}, TSource1 extends {}, TSource2 extends {}, TResult extends {}>(
+ object: TObject,
+ source1: TSource1,
+ source2: TSource2
+ ): TResult;
+
+ /**
+ * @see assignIn
+ */
+ assignIn<TObject extends {}, TSource1 extends {}, TSource2 extends {}, TSource3 extends {}, TResult extends {}>(
+ object: TObject,
+ source1: TSource1,
+ source2: TSource2,
+ source3: TSource3
+ ): TResult;
+
+ /**
+ * @see assignIn
+ */
+ assignIn<TObject extends {}, TSource1 extends {}, TSource2 extends {}, TSource3 extends {}, TSource4 extends {},
+ TResult extends {}>
+ (
+ object: TObject,
+ source1: TSource1,
+ source2: TSource2,
+ source3: TSource3,
+ source4: TSource4
+ ): TResult;
+
+ /**
+ * @see _.assignIn
+ */
+ assignIn<TObject extends {}>(object: TObject): TObject;
+
+ /**
+ * @see _.assignIn
+ */
+ assignIn<TObject extends {}, TResult extends {}>(
+ object: TObject, ...otherArgs: any[]
+ ): TResult;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.assignIn
+ */
+ assignIn<TSource extends {}, TResult extends {}>(
+ source: TSource
+ ): LoDashImplicitObjectWrapper<TResult>;
+
+ /**
+ * @see assignIn
+ */
+ assignIn<TSource1 extends {}, TSource2 extends {}, TResult extends {}>(
+ source1: TSource1,
+ source2: TSource2
+ ): LoDashImplicitObjectWrapper<TResult>;
+
+ /**
+ * @see assignIn
+ */
+ assignIn<TSource1 extends {}, TSource2 extends {}, TSource3 extends {}, TResult extends {}>(
+ source1: TSource1,
+ source2: TSource2,
+ source3: TSource3
+ ): LoDashImplicitObjectWrapper<TResult>;
+
+ /**
+ * @see assignIn
+ */
+ assignIn<TSource1 extends {}, TSource2 extends {}, TSource3 extends {}, TSource4 extends {}, TResult extends {}>(
+ source1: TSource1,
+ source2: TSource2,
+ source3: TSource3,
+ source4: TSource4
+ ): LoDashImplicitObjectWrapper<TResult>;
+
+ /**
+ * @see _.assignIn
+ */
+ assignIn(): LoDashImplicitObjectWrapper<T>;
+
+ /**
+ * @see _.assignIn
+ */
+ assignIn<TResult extends {}>(...otherArgs: any[]): LoDashImplicitObjectWrapper<TResult>;
+ }
+
+ interface LoDashExplicitObjectWrapper<T> {
+ /**
+ * @see _.assignIn
+ */
+ assignIn<TSource extends {}, TResult extends {}>(
+ source: TSource
+ ): LoDashExplicitObjectWrapper<TResult>;
+
+ /**
+ * @see assignIn
+ */
+ assignIn<TSource1 extends {}, TSource2 extends {}, TResult extends {}>(
+ source1: TSource1,
+ source2: TSource2
+ ): LoDashExplicitObjectWrapper<TResult>;
+
+ /**
+ * @see assignIn
+ */
+ assignIn<TSource1 extends {}, TSource2 extends {}, TSource3 extends {}, TResult extends {}>(
+ source1: TSource1,
+ source2: TSource2,
+ source3: TSource3
+ ): LoDashExplicitObjectWrapper<TResult>;
+
+ /**
+ * @see assignIn
+ */
+ assignIn<TSource1 extends {}, TSource2 extends {}, TSource3 extends {}, TSource4 extends {}, TResult extends {}>(
+ source1: TSource1,
+ source2: TSource2,
+ source3: TSource3,
+ source4: TSource4
+ ): LoDashExplicitObjectWrapper<TResult>;
+
+ /**
+ * @see _.assignIn
+ */
+ assignIn(): LoDashExplicitObjectWrapper<T>;
+
+ /**
+ * @see _.assignIn
+ */
+ assignIn<TResult extends {}>(...otherArgs: any[]): LoDashExplicitObjectWrapper<TResult>;
+ }
+
+ //_.assignInWith
+ interface AssignCustomizer {
+ (objectValue: any, sourceValue: any, key?: string, object?: {}, source?: {}): any;
+ }
+
+ interface LoDashStatic {
+ /**
+ * This method is like `_.assignIn` except that it accepts `customizer` which
+ * is invoked to produce the assigned values. If `customizer` returns `undefined`
+ * assignment is handled by the method instead. The `customizer` is invoked
+ * with five arguments: (objValue, srcValue, key, object, source).
+ *
+ * **Note:** This method mutates `object`.
+ *
+ * @static
+ * @memberOf _
+ * @alias extendWith
+ * @category Object
+ * @param {Object} object The destination object.
+ * @param {...Object} sources The source objects.
+ * @param {Function} [customizer] The function to customize assigned values.
+ * @returns {Object} Returns `object`.
+ * @example
+ *
+ * function customizer(objValue, srcValue) {
+ * return _.isUndefined(objValue) ? srcValue : objValue;
+ * }
+ *
+ * var defaults = _.partialRight(_.assignInWith, customizer);
+ *
+ * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
+ * // => { 'a': 1, 'b': 2 }
+ */
+ assignInWith<TObject extends {}, TSource extends {}, TResult extends {}>(
+ object: TObject,
+ source: TSource,
+ customizer: AssignCustomizer
+ ): TResult;
+
+ /**
+ * @see assignInWith
+ */
+ assignInWith<TObject extends {}, TSource1 extends {}, TSource2 extends {}, TResult extends {}>(
+ object: TObject,
+ source1: TSource1,
+ source2: TSource2,
+ customizer: AssignCustomizer
+ ): TResult;
+
+ /**
+ * @see assignInWith
+ */
+ assignInWith<TObject extends {}, TSource1 extends {}, TSource2 extends {}, TSource3 extends {}, TResult extends {}>(
+ object: TObject,
+ source1: TSource1,
+ source2: TSource2,
+ source3: TSource3,
+ customizer: AssignCustomizer
+ ): TResult;
+
+ /**
+ * @see assignInWith
+ */
+ assignInWith<TObject extends {}, TSource1 extends {}, TSource2 extends {}, TSource3 extends {}, TSource4 extends {},
+ TResult extends {}>
+ (
+ object: TObject,
+ source1: TSource1,
+ source2: TSource2,
+ source3: TSource3,
+ source4: TSource4,
+ customizer: AssignCustomizer
+ ): TResult;
+
+ /**
+ * @see _.assignInWith
+ */
+ assignInWith<TObject extends {}>(object: TObject): TObject;
+
+ /**
+ * @see _.assignInWith
+ */
+ assignInWith<TObject extends {}, TResult extends {}>(
+ object: TObject, ...otherArgs: any[]
+ ): TResult;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.assignInWith
+ */
+ assignInWith<TSource extends {}, TResult extends {}>(
+ source: TSource,
+ customizer: AssignCustomizer
+ ): LoDashImplicitObjectWrapper<TResult>;
+
+ /**
+ * @see assignInWith
+ */
+ assignInWith<TSource1 extends {}, TSource2 extends {}, TResult extends {}>(
+ source1: TSource1,
+ source2: TSource2,
+ customizer: AssignCustomizer
+ ): LoDashImplicitObjectWrapper<TResult>;
+
+ /**
+ * @see assignInWith
+ */
+ assignInWith<TSource1 extends {}, TSource2 extends {}, TSource3 extends {}, TResult extends {}>(
+ source1: TSource1,
+ source2: TSource2,
+ source3: TSource3,
+ customizer: AssignCustomizer
+ ): LoDashImplicitObjectWrapper<TResult>;
+
+ /**
+ * @see assignInWith
+ */
+ assignInWith<TSource1 extends {}, TSource2 extends {}, TSource3 extends {}, TSource4 extends {}, TResult extends {}>(
+ source1: TSource1,
+ source2: TSource2,
+ source3: TSource3,
+ source4: TSource4,
+ customizer: AssignCustomizer
+ ): LoDashImplicitObjectWrapper<TResult>;
+
+ /**
+ * @see _.assignInWith
+ */
+ assignInWith(): LoDashImplicitObjectWrapper<T>;
+
+ /**
+ * @see _.assignInWith
+ */
+ assignInWith<TResult extends {}>(...otherArgs: any[]): LoDashImplicitObjectWrapper<TResult>;
+ }
+
+ interface LoDashExplicitObjectWrapper<T> {
+ /**
+ * @see _.assignInWith
+ */
+ assignInWith<TSource extends {}, TResult extends {}>(
+ source: TSource,
+ customizer: AssignCustomizer
+ ): LoDashExplicitObjectWrapper<TResult>;
+
+ /**
+ * @see assignInWith
+ */
+ assignInWith<TSource1 extends {}, TSource2 extends {}, TResult extends {}>(
+ source1: TSource1,
+ source2: TSource2,
+ customizer: AssignCustomizer
+ ): LoDashExplicitObjectWrapper<TResult>;
+
+ /**
+ * @see assignInWith
+ */
+ assignInWith<TSource1 extends {}, TSource2 extends {}, TSource3 extends {}, TResult extends {}>(
+ source1: TSource1,
+ source2: TSource2,
+ source3: TSource3,
+ customizer: AssignCustomizer
+ ): LoDashExplicitObjectWrapper<TResult>;
+
+ /**
+ * @see assignInWith
+ */
+ assignInWith<TSource1 extends {}, TSource2 extends {}, TSource3 extends {}, TSource4 extends {}, TResult extends {}>(
+ source1: TSource1,
+ source2: TSource2,
+ source3: TSource3,
+ source4: TSource4,
+ customizer: AssignCustomizer
+ ): LoDashExplicitObjectWrapper<TResult>;
+
+ /**
+ * @see _.assignInWith
+ */
+ assignInWith(): LoDashExplicitObjectWrapper<T>;
+
+ /**
+ * @see _.assignInWith
+ */
+ assignInWith<TResult extends {}>(...otherArgs: any[]): LoDashExplicitObjectWrapper<TResult>;
+ }
+
+ //_.create
+ interface LoDashStatic {
+ /**
+ * Creates an object that inherits from the given prototype object. If a properties object is provided its own
+ * enumerable properties are assigned to the created object.
+ *
+ * @param prototype The object to inherit from.
+ * @param properties The properties to assign to the object.
+ * @return Returns the new object.
+ */
+ create<T extends Object, U extends Object>(
+ prototype: T,
+ properties?: U
+ ): T & U;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.create
+ */
+ create<U extends Object>(properties?: U): LoDashImplicitObjectWrapper<T & U>;
+ }
+
+ interface LoDashExplicitObjectWrapper<T> {
+ /**
+ * @see _.create
+ */
+ create<U extends Object>(properties?: U): LoDashExplicitObjectWrapper<T & U>;
+ }
+
+ //_.defaults
+ interface LoDashStatic {
+ /**
+ * Assigns own enumerable properties of source object(s) to the destination object for all destination
+ * properties that resolve to undefined. Once a property is set, additional values of the same property are
+ * ignored.
+ *
+ * Note: This method mutates object.
+ *
+ * @param object The destination object.
+ * @param sources The source objects.
+ * @return The destination object.
+ */
+ defaults<Obj extends {}, TResult extends {}>(
+ object: Obj,
+ ...sources: {}[]
+ ): TResult;
+
+ /**
+ * @see _.defaults
+ */
+ defaults<Obj extends {}, S1 extends {}, TResult extends {}>(
+ object: Obj,
+ source1: S1,
+ ...sources: {}[]
+ ): TResult;
+
+ /**
+ * @see _.defaults
+ */
+ defaults<Obj extends {}, S1 extends {}, S2 extends {}, TResult extends {}>(
+ object: Obj,
+ source1: S1,
+ source2: S2,
+ ...sources: {}[]
+ ): TResult;
+
+ /**
+ * @see _.defaults
+ */
+ defaults<Obj extends {}, S1 extends {}, S2 extends {}, S3 extends {}, TResult extends {}>(
+ object: Obj,
+ source1: S1,
+ source2: S2,
+ source3: S3,
+ ...sources: {}[]
+ ): TResult;
+
+ /**
+ * @see _.defaults
+ */
+ defaults<Obj extends {}, S1 extends {}, S2 extends {}, S3 extends {}, S4 extends {}, TResult extends {}>(
+ object: Obj,
+ source1: S1,
+ source2: S2,
+ source3: S3,
+ source4: S4,
+ ...sources: {}[]
+ ): TResult;
+
+ /**
+ * @see _.defaults
+ */
+ defaults<TResult extends {}>(
+ object: {},
+ ...sources: {}[]
+ ): TResult;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.defaults
+ */
+ defaults<S1 extends {}, TResult extends {}>(
+ source1: S1,
+ ...sources: {}[]
+ ): LoDashImplicitObjectWrapper<TResult>;
+
+ /**
+ * @see _.defaults
+ */
+ defaults<S1 extends {}, S2 extends {}, TResult extends {}>(
+ source1: S1,
+ source2: S2,
+ ...sources: {}[]
+ ): LoDashImplicitObjectWrapper<TResult>;
+
+ /**
+ * @see _.defaults
+ */
+ defaults<S1 extends {}, S2 extends {}, S3 extends {}, TResult extends {}>(
+ source1: S1,
+ source2: S2,
+ source3: S3,
+ ...sources: {}[]
+ ): LoDashImplicitObjectWrapper<TResult>;
+
+ /**
+ * @see _.defaults
+ */
+ defaults<S1 extends {}, S2 extends {}, S3 extends {}, S4 extends {}, TResult extends {}>(
+ source1: S1,
+ source2: S2,
+ source3: S3,
+ source4: S4,
+ ...sources: {}[]
+ ): LoDashImplicitObjectWrapper<TResult>;
+
+ /**
+ * @see _.defaults
+ */
+ defaults(): LoDashImplicitObjectWrapper<T>;
+
+ /**
+ * @see _.defaults
+ */
+ defaults<TResult>(...sources: {}[]): LoDashImplicitObjectWrapper<TResult>;
+ }
+
+ interface LoDashExplicitObjectWrapper<T> {
+ /**
+ * @see _.defaults
+ */
+ defaults<S1 extends {}, TResult extends {}>(
+ source1: S1,
+ ...sources: {}[]
+ ): LoDashExplicitObjectWrapper<TResult>;
+
+ /**
+ * @see _.defaults
+ */
+ defaults<S1 extends {}, S2 extends {}, TResult extends {}>(
+ source1: S1,
+ source2: S2,
+ ...sources: {}[]
+ ): LoDashExplicitObjectWrapper<TResult>;
+
+ /**
+ * @see _.defaults
+ */
+ defaults<S1 extends {}, S2 extends {}, S3 extends {}, TResult extends {}>(
+ source1: S1,
+ source2: S2,
+ source3: S3,
+ ...sources: {}[]
+ ): LoDashExplicitObjectWrapper<TResult>;
+
+ /**
+ * @see _.defaults
+ */
+ defaults<S1 extends {}, S2 extends {}, S3 extends {}, S4 extends {}, TResult extends {}>(
+ source1: S1,
+ source2: S2,
+ source3: S3,
+ source4: S4,
+ ...sources: {}[]
+ ): LoDashExplicitObjectWrapper<TResult>;
+
+ /**
+ * @see _.defaults
+ */
+ defaults(): LoDashExplicitObjectWrapper<T>;
+
+ /**
+ * @see _.defaults
+ */
+ defaults<TResult>(...sources: {}[]): LoDashExplicitObjectWrapper<TResult>;
+ }
+
+ //_.defaultsDeep
+ interface LoDashStatic {
+ /**
+ * This method is like _.defaults except that it recursively assigns default properties.
+ * @param object The destination object.
+ * @param sources The source objects.
+ * @return Returns object.
+ **/
+ defaultsDeep<T, TResult>(
+ object: T,
+ ...sources: any[]): TResult;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.defaultsDeep
+ **/
+ defaultsDeep<TResult>(...sources: any[]): LoDashImplicitObjectWrapper<TResult>
+ }
+
+ //_.extend
+ interface LoDashStatic {
+ /**
+ * @see assign
+ */
+ extend<TObject extends {}, TSource extends {}, TResult extends {}>(
+ object: TObject,
+ source: TSource,
+ customizer?: AssignCustomizer,
+ thisArg?: any
+ ): TResult;
+
+ /**
+ * @see assign
+ */
+ extend<TObject extends {}, TSource1 extends {}, TSource2 extends {}, TResult extends {}>(
+ object: TObject,
+ source1: TSource1,
+ source2: TSource2,
+ customizer?: AssignCustomizer,
+ thisArg?: any
+ ): TResult;
+
+ /**
+ * @see assign
+ */
+ extend<TObject extends {}, TSource1 extends {}, TSource2 extends {}, TSource3 extends {}, TResult extends {}>(
+ object: TObject,
+ source1: TSource1,
+ source2: TSource2,
+ source3: TSource3,
+ customizer?: AssignCustomizer,
+ thisArg?: any
+ ): TResult;
+
+ /**
+ * @see assign
+ */
+ extend<TObject extends {}, TSource1 extends {}, TSource2 extends {}, TSource3 extends {}, TSource4 extends {},
+ TResult extends {}>
+ (
+ object: TObject,
+ source1: TSource1,
+ source2: TSource2,
+ source3: TSource3,
+ source4: TSource4,
+ customizer?: AssignCustomizer,
+ thisArg?: any
+ ): TResult;
+
+ /**
+ * @see _.assign
+ */
+ extend<TObject extends {}>(object: TObject): TObject;
+
+ /**
+ * @see _.assign
+ */
+ extend<TObject extends {}, TResult extends {}>(
+ object: TObject, ...otherArgs: any[]
+ ): TResult;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.assign
+ */
+ extend<TSource extends {}, TResult extends {}>(
+ source: TSource,
+ customizer?: AssignCustomizer,
+ thisArg?: any
+ ): LoDashImplicitObjectWrapper<TResult>;
+
+ /**
+ * @see assign
+ */
+ extend<TSource1 extends {}, TSource2 extends {}, TResult extends {}>(
+ source1: TSource1,
+ source2: TSource2,
+ customizer?: AssignCustomizer,
+ thisArg?: any
+ ): LoDashImplicitObjectWrapper<TResult>;
+
+ /**
+ * @see assign
+ */
+ extend<TSource1 extends {}, TSource2 extends {}, TSource3 extends {}, TResult extends {}>(
+ source1: TSource1,
+ source2: TSource2,
+ source3: TSource3,
+ customizer?: AssignCustomizer,
+ thisArg?: any
+ ): LoDashImplicitObjectWrapper<TResult>;
+
+ /**
+ * @see assign
+ */
+ extend<TSource1 extends {}, TSource2 extends {}, TSource3 extends {}, TSource4 extends {}, TResult extends {}>(
+ source1: TSource1,
+ source2: TSource2,
+ source3: TSource3,
+ source4: TSource4,
+ customizer?: AssignCustomizer,
+ thisArg?: any
+ ): LoDashImplicitObjectWrapper<TResult>;
+
+ /**
+ * @see _.assign
+ */
+ extend(): LoDashImplicitObjectWrapper<T>;
+
+ /**
+ * @see _.assign
+ */
+ extend<TResult extends {}>(...otherArgs: any[]): LoDashImplicitObjectWrapper<TResult>;
+ }
+
+ interface LoDashExplicitObjectWrapper<T> {
+ /**
+ * @see _.assign
+ */
+ extend<TSource extends {}, TResult extends {}>(
+ source: TSource,
+ customizer?: AssignCustomizer,
+ thisArg?: any
+ ): LoDashExplicitObjectWrapper<TResult>;
+
+ /**
+ * @see assign
+ */
+ extend<TSource1 extends {}, TSource2 extends {}, TResult extends {}>(
+ source1: TSource1,
+ source2: TSource2,
+ customizer?: AssignCustomizer,
+ thisArg?: any
+ ): LoDashExplicitObjectWrapper<TResult>;
+
+ /**
+ * @see assign
+ */
+ extend<TSource1 extends {}, TSource2 extends {}, TSource3 extends {}, TResult extends {}>(
+ source1: TSource1,
+ source2: TSource2,
+ source3: TSource3,
+ customizer?: AssignCustomizer,
+ thisArg?: any
+ ): LoDashExplicitObjectWrapper<TResult>;
+
+ /**
+ * @see assign
+ */
+ extend<TSource1 extends {}, TSource2 extends {}, TSource3 extends {}, TSource4 extends {}, TResult extends {}>(
+ source1: TSource1,
+ source2: TSource2,
+ source3: TSource3,
+ source4: TSource4,
+ customizer?: AssignCustomizer,
+ thisArg?: any
+ ): LoDashExplicitObjectWrapper<TResult>;
+
+ /**
+ * @see _.assign
+ */
+ extend(): LoDashExplicitObjectWrapper<T>;
+
+ /**
+ * @see _.assign
+ */
+ extend<TResult extends {}>(...otherArgs: any[]): LoDashExplicitObjectWrapper<TResult>;
+ }
+
+ //_.findKey
+ interface LoDashStatic {
+ /**
+ * This method is like _.find except that it returns the key of the first element predicate returns truthy for
+ * instead of the element itself.
+ *
+ * If a property name is provided for predicate the created _.property style callback returns the property
+ * value of the given element.
+ *
+ * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for
+ * elements that have a matching property value, else false.
+ *
+ * If an object is provided for predicate the created _.matches style callback returns true for elements that
+ * have the properties of the given object, else false.
+ *
+ * @param object The object to search.
+ * @param predicate The function invoked per iteration.
+ * @param thisArg The this binding of predicate.
+ * @return Returns the key of the matched element, else undefined.
+ */
+ findKey<TValues, TObject>(
+ object: TObject,
+ predicate?: DictionaryIterator<TValues, boolean>,
+ thisArg?: any
+ ): string;
+
+ /**
+ * @see _.findKey
+ */
+ findKey<TObject>(
+ object: TObject,
+ predicate?: ObjectIterator<any, boolean>,
+ thisArg?: any
+ ): string;
+
+ /**
+ * @see _.findKey
+ */
+ findKey<TObject>(
+ object: TObject,
+ predicate?: string,
+ thisArg?: any
+ ): string;
+
+ /**
+ * @see _.findKey
+ */
+ findKey<TWhere extends Dictionary<any>, TObject>(
+ object: TObject,
+ predicate?: TWhere
+ ): string;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.findKey
+ */
+ findKey<TValues>(
+ predicate?: DictionaryIterator<TValues, boolean>,
+ thisArg?: any
+ ): string;
+
+ /**
+ * @see _.findKey
+ */
+ findKey(
+ predicate?: ObjectIterator<any, boolean>,
+ thisArg?: any
+ ): string;
+
+ /**
+ * @see _.findKey
+ */
+ findKey(
+ predicate?: string,
+ thisArg?: any
+ ): string;
+
+ /**
+ * @see _.findKey
+ */
+ findKey<TWhere extends Dictionary<any>>(
+ predicate?: TWhere
+ ): string;
+ }
+
+ interface LoDashExplicitObjectWrapper<T> {
+ /**
+ * @see _.findKey
+ */
+ findKey<TValues>(
+ predicate?: DictionaryIterator<TValues, boolean>,
+ thisArg?: any
+ ): LoDashExplicitWrapper<string>;
+
+ /**
+ * @see _.findKey
+ */
+ findKey(
+ predicate?: ObjectIterator<any, boolean>,
+ thisArg?: any
+ ): LoDashExplicitWrapper<string>;
+
+ /**
+ * @see _.findKey
+ */
+ findKey(
+ predicate?: string,
+ thisArg?: any
+ ): LoDashExplicitWrapper<string>;
+
+ /**
+ * @see _.findKey
+ */
+ findKey<TWhere extends Dictionary<any>>(
+ predicate?: TWhere
+ ): LoDashExplicitWrapper<string>;
+ }
+
+ //_.findLastKey
+ interface LoDashStatic {
+ /**
+ * This method is like _.findKey except that it iterates over elements of a collection in the opposite order.
+ *
+ * If a property name is provided for predicate the created _.property style callback returns the property
+ * value of the given element.
+ *
+ * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for
+ * elements that have a matching property value, else false.
+ *
+ * If an object is provided for predicate the created _.matches style callback returns true for elements that
+ * have the properties of the given object, else false.
+ *
+ * @param object The object to search.
+ * @param predicate The function invoked per iteration.
+ * @param thisArg The this binding of predicate.
+ * @return Returns the key of the matched element, else undefined.
+ */
+ findLastKey<TValues, TObject>(
+ object: TObject,
+ predicate?: DictionaryIterator<TValues, boolean>,
+ thisArg?: any
+ ): string;
+
+ /**
+ * @see _.findLastKey
+ */
+ findLastKey<TObject>(
+ object: TObject,
+ predicate?: ObjectIterator<any, boolean>,
+ thisArg?: any
+ ): string;
+
+ /**
+ * @see _.findLastKey
+ */
+ findLastKey<TObject>(
+ object: TObject,
+ predicate?: string,
+ thisArg?: any
+ ): string;
+
+ /**
+ * @see _.findLastKey
+ */
+ findLastKey<TWhere extends Dictionary<any>, TObject>(
+ object: TObject,
+ predicate?: TWhere
+ ): string;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.findLastKey
+ */
+ findLastKey<TValues>(
+ predicate?: DictionaryIterator<TValues, boolean>,
+ thisArg?: any
+ ): string;
+
+ /**
+ * @see _.findLastKey
+ */
+ findLastKey(
+ predicate?: ObjectIterator<any, boolean>,
+ thisArg?: any
+ ): string;
+
+ /**
+ * @see _.findLastKey
+ */
+ findLastKey(
+ predicate?: string,
+ thisArg?: any
+ ): string;
+
+ /**
+ * @see _.findLastKey
+ */
+ findLastKey<TWhere extends Dictionary<any>>(
+ predicate?: TWhere
+ ): string;
+ }
+
+ interface LoDashExplicitObjectWrapper<T> {
+ /**
+ * @see _.findLastKey
+ */
+ findLastKey<TValues>(
+ predicate?: DictionaryIterator<TValues, boolean>,
+ thisArg?: any
+ ): LoDashExplicitWrapper<string>;
+
+ /**
+ * @see _.findLastKey
+ */
+ findLastKey(
+ predicate?: ObjectIterator<any, boolean>,
+ thisArg?: any
+ ): LoDashExplicitWrapper<string>;
+
+ /**
+ * @see _.findLastKey
+ */
+ findLastKey(
+ predicate?: string,
+ thisArg?: any
+ ): LoDashExplicitWrapper<string>;
+
+ /**
+ * @see _.findLastKey
+ */
+ findLastKey<TWhere extends Dictionary<any>>(
+ predicate?: TWhere
+ ): LoDashExplicitWrapper<string>;
+ }
+
+ //_.forIn
+ interface LoDashStatic {
+ /**
+ * Iterates over own and inherited enumerable properties of an object invoking iteratee for each property. The
+ * iteratee is bound to thisArg and invoked with three arguments: (value, key, object). Iteratee functions may
+ * exit iteration early by explicitly returning false.
+ *
+ * @param object The object to iterate over.
+ * @param iteratee The function invoked per iteration.
+ * @param thisArg The this binding of iteratee.
+ * @return Returns object.
+ */
+ forIn<T>(
+ object: Dictionary<T>,
+ iteratee?: DictionaryIterator<T, any>,
+ thisArg?: any
+ ): Dictionary<T>;
+
+ /**
+ * @see _.forIn
+ */
+ forIn<T extends {}>(
+ object: T,
+ iteratee?: ObjectIterator<any, any>,
+ thisArg?: any
+ ): T;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.forIn
+ */
+ forIn<TValue>(
+ iteratee?: DictionaryIterator<TValue, any>,
+ thisArg?: any
+ ): _.LoDashImplicitObjectWrapper<T>;
+ }
+
+ interface LoDashExplicitObjectWrapper<T> {
+ /**
+ * @see _.forIn
+ */
+ forIn<TValue>(
+ iteratee?: DictionaryIterator<TValue, any>,
+ thisArg?: any
+ ): _.LoDashExplicitObjectWrapper<T>;
+ }
+
+ //_.forInRight
+ interface LoDashStatic {
+ /**
+ * This method is like _.forIn except that it iterates over properties of object in the opposite order.
+ *
+ * @param object The object to iterate over.
+ * @param iteratee The function invoked per iteration.
+ * @param thisArg The this binding of iteratee.
+ * @return Returns object.
+ */
+ forInRight<T>(
+ object: Dictionary<T>,
+ iteratee?: DictionaryIterator<T, any>,
+ thisArg?: any
+ ): Dictionary<T>;
+
+ /**
+ * @see _.forInRight
+ */
+ forInRight<T extends {}>(
+ object: T,
+ iteratee?: ObjectIterator<any, any>,
+ thisArg?: any
+ ): T;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.forInRight
+ */
+ forInRight<TValue>(
+ iteratee?: DictionaryIterator<TValue, any>,
+ thisArg?: any
+ ): _.LoDashImplicitObjectWrapper<T>;
+ }
+
+ interface LoDashExplicitObjectWrapper<T> {
+ /**
+ * @see _.forInRight
+ */
+ forInRight<TValue>(
+ iteratee?: DictionaryIterator<TValue, any>,
+ thisArg?: any
+ ): _.LoDashExplicitObjectWrapper<T>;
+ }
+
+ //_.forOwn
+ interface LoDashStatic {
+ /**
+ * Iterates over own enumerable properties of an object invoking iteratee for each property. The iteratee is
+ * bound to thisArg and invoked with three arguments: (value, key, object). Iteratee functions may exit
+ * iteration early by explicitly returning false.
+ *
+ * @param object The object to iterate over.
+ * @param iteratee The function invoked per iteration.
+ * @param thisArg The this binding of iteratee.
+ * @return Returns object.
+ */
+ forOwn<T>(
+ object: Dictionary<T>,
+ iteratee?: DictionaryIterator<T, any>,
+ thisArg?: any
+ ): Dictionary<T>;
+
+ /**
+ * @see _.forOwn
+ */
+ forOwn<T extends {}>(
+ object: T,
+ iteratee?: ObjectIterator<any, any>,
+ thisArg?: any
+ ): T;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.forOwn
+ */
+ forOwn<TValue>(
+ iteratee?: DictionaryIterator<TValue, any>,
+ thisArg?: any
+ ): _.LoDashImplicitObjectWrapper<T>;
+ }
+
+ interface LoDashExplicitObjectWrapper<T> {
+ /**
+ * @see _.forOwn
+ */
+ forOwn<TValue>(
+ iteratee?: DictionaryIterator<TValue, any>,
+ thisArg?: any
+ ): _.LoDashExplicitObjectWrapper<T>;
+ }
+
+ //_.forOwnRight
+ interface LoDashStatic {
+ /**
+ * This method is like _.forOwn except that it iterates over properties of object in the opposite order.
+ *
+ * @param object The object to iterate over.
+ * @param iteratee The function invoked per iteration.
+ * @param thisArg The this binding of iteratee.
+ * @return Returns object.
+ */
+ forOwnRight<T>(
+ object: Dictionary<T>,
+ iteratee?: DictionaryIterator<T, any>,
+ thisArg?: any
+ ): Dictionary<T>;
+
+ /**
+ * @see _.forOwnRight
+ */
+ forOwnRight<T extends {}>(
+ object: T,
+ iteratee?: ObjectIterator<any, any>,
+ thisArg?: any
+ ): T;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.forOwnRight
+ */
+ forOwnRight<TValue>(
+ iteratee?: DictionaryIterator<TValue, any>,
+ thisArg?: any
+ ): _.LoDashImplicitObjectWrapper<T>;
+ }
+
+ interface LoDashExplicitObjectWrapper<T> {
+ /**
+ * @see _.forOwnRight
+ */
+ forOwnRight<TValue>(
+ iteratee?: DictionaryIterator<TValue, any>,
+ thisArg?: any
+ ): _.LoDashExplicitObjectWrapper<T>;
+ }
+
+ //_.functions
+ interface LoDashStatic {
+ /**
+ * Creates an array of function property names from own enumerable properties
+ * of `object`.
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The object to inspect.
+ * @returns {Array} Returns the new array of property names.
+ * @example
+ *
+ * function Foo() {
+ * this.a = _.constant('a');
+ * this.b = _.constant('b');
+ * }
+ *
+ * Foo.prototype.c = _.constant('c');
+ *
+ * _.functions(new Foo);
+ * // => ['a', 'b']
+ */
+ functions<T extends {}>(object: any): string[];
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.functions
+ */
+ functions(): _.LoDashImplicitArrayWrapper<string>;
+ }
+
+ interface LoDashExplicitObjectWrapper<T> {
+ /**
+ * @see _.functions
+ */
+ functions(): _.LoDashExplicitArrayWrapper<string>;
+ }
+
+ //_.functionsIn
+ interface LoDashStatic {
+ /**
+ * Creates an array of function property names from own and inherited
+ * enumerable properties of `object`.
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The object to inspect.
+ * @returns {Array} Returns the new array of property names.
+ * @example
+ *
+ * function Foo() {
+ * this.a = _.constant('a');
+ * this.b = _.constant('b');
+ * }
+ *
+ * Foo.prototype.c = _.constant('c');
+ *
+ * _.functionsIn(new Foo);
+ * // => ['a', 'b', 'c']
+ */
+ functionsIn<T extends {}>(object: any): string[];
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.functionsIn
+ */
+ functionsIn(): _.LoDashImplicitArrayWrapper<string>;
+ }
+
+ interface LoDashExplicitObjectWrapper<T> {
+ /**
+ * @see _.functionsIn
+ */
+ functionsIn(): _.LoDashExplicitArrayWrapper<string>;
+ }
+
+ //_.get
+ interface LoDashStatic {
+ /**
+ * Gets the property value at path of object. If the resolved
+ * value is undefined the defaultValue is used in its place.
+ * @param object The object to query.
+ * @param path The path of the property to get.
+ * @param defaultValue The value returned if the resolved value is undefined.
+ * @return Returns the resolved value.
+ **/
+ get<TResult>(object: Object,
+ path: string|number|boolean|Array<string|number|boolean>,
+ defaultValue?:TResult
+ ): TResult;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.get
+ **/
+ get<TResult>(path: string|number|boolean|Array<string|number|boolean>,
+ defaultValue?: TResult
+ ): TResult;
+ }
+
+ //_.has
+ interface LoDashStatic {
+ /**
+ * Checks if `path` is a direct property of `object`.
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The object to query.
+ * @param {Array|string} path The path to check.
+ * @returns {boolean} Returns `true` if `path` exists, else `false`.
+ * @example
+ *
+ * var object = { 'a': { 'b': { 'c': 3 } } };
+ * var other = _.create({ 'a': _.create({ 'b': _.create({ 'c': 3 }) }) });
+ *
+ * _.has(object, 'a');
+ * // => true
+ *
+ * _.has(object, 'a.b.c');
+ * // => true
+ *
+ * _.has(object, ['a', 'b', 'c']);
+ * // => true
+ *
+ * _.has(other, 'a');
+ * // => false
+ */
+ has<T extends {}>(
+ object: T,
+ path: StringRepresentable|StringRepresentable[]
+ ): boolean;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.has
+ */
+ has(path: StringRepresentable|StringRepresentable[]): boolean;
+ }
+
+ interface LoDashExplicitObjectWrapper<T> {
+ /**
+ * @see _.has
+ */
+ has(path: StringRepresentable|StringRepresentable[]): LoDashExplicitWrapper<boolean>;
+ }
+
+ //_.hasIn
+ interface LoDashStatic {
+ /**
+ * Checks if `path` is a direct or inherited property of `object`.
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The object to query.
+ * @param {Array|string} path The path to check.
+ * @returns {boolean} Returns `true` if `path` exists, else `false`.
+ * @example
+ *
+ * var object = _.create({ 'a': _.create({ 'b': _.create({ 'c': 3 }) }) });
+ *
+ * _.hasIn(object, 'a');
+ * // => true
+ *
+ * _.hasIn(object, 'a.b.c');
+ * // => true
+ *
+ * _.hasIn(object, ['a', 'b', 'c']);
+ * // => true
+ *
+ * _.hasIn(object, 'b');
+ * // => false
+ */
+ hasIn<T extends {}>(
+ object: T,
+ path: StringRepresentable|StringRepresentable[]
+ ): boolean;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.hasIn
+ */
+ hasIn(path: StringRepresentable|StringRepresentable[]): boolean;
+ }
+
+ interface LoDashExplicitObjectWrapper<T> {
+ /**
+ * @see _.hasIn
+ */
+ hasIn(path: StringRepresentable|StringRepresentable[]): LoDashExplicitWrapper<boolean>;
+ }
+
+ //_.invert
+ interface LoDashStatic {
+ /**
+ * Creates an object composed of the inverted keys and values of object. If object contains duplicate values,
+ * subsequent values overwrite property assignments of previous values unless multiValue is true.
+ *
+ * @param object The object to invert.
+ * @param multiValue Allow multiple values per key.
+ * @return Returns the new inverted object.
+ */
+ invert<T extends {}, TResult extends {}>(
+ object: T,
+ multiValue?: boolean
+ ): TResult;
+
+ /**
+ * @see _.invert
+ */
+ invert<TResult extends {}>(
+ object: Object,
+ multiValue?: boolean
+ ): TResult;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.invert
+ */
+ invert<TResult extends {}>(multiValue?: boolean): LoDashImplicitObjectWrapper<TResult>;
+ }
+
+ interface LoDashExplicitObjectWrapper<T> {
+ /**
+ * @see _.invert
+ */
+ invert<TResult extends {}>(multiValue?: boolean): LoDashExplicitObjectWrapper<TResult>;
+ }
+
+ //_.keys
+ interface LoDashStatic {
+ /**
+ * Creates an array of the own enumerable property names of object.
+ *
+ * Note: Non-object values are coerced to objects. See the ES spec for more details.
+ *
+ * @param object The object to query.
+ * @return Returns the array of property names.
+ */
+ keys(object?: any): string[];
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.keys
+ */
+ keys(): LoDashImplicitArrayWrapper<string>;
+ }
+
+ interface LoDashExplicitObjectWrapper<T> {
+ /**
+ * @see _.keys
+ */
+ keys(): LoDashExplicitArrayWrapper<string>;
+ }
+
+ //_.keysIn
+ interface LoDashStatic {
+ /**
+ * Creates an array of the own and inherited enumerable property names of object.
+ *
+ * Note: Non-object values are coerced to objects.
+ *
+ * @param object The object to query.
+ * @return An array of property names.
+ */
+ keysIn(object?: any): string[];
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.keysIn
+ */
+ keysIn(): LoDashImplicitArrayWrapper<string>;
+ }
+
+ interface LoDashExplicitObjectWrapper<T> {
+ /**
+ * @see _.keysIn
+ */
+ keysIn(): LoDashExplicitArrayWrapper<string>;
+ }
+
+ //_.mapKeys
+ interface LoDashStatic {
+ /**
+ * The opposite of _.mapValues; this method creates an object with the same values as object and keys generated
+ * by running each own enumerable property of object through iteratee.
+ *
+ * @param object The object to iterate over.
+ * @param iteratee The function invoked per iteration.
+ * @param thisArg The this binding of iteratee.
+ * @return Returns the new mapped object.
+ */
+ mapKeys<T, TKey>(
+ object: List<T>,
+ iteratee?: ListIterator<T, TKey>,
+ thisArg?: any
+ ): Dictionary<T>;
+
+ /**
+ * @see _.mapKeys
+ */
+ mapKeys<T, TKey>(
+ object: Dictionary<T>,
+ iteratee?: DictionaryIterator<T, TKey>,
+ thisArg?: any
+ ): Dictionary<T>;
+
+ /**
+ * @see _.mapKeys
+ */
+ mapKeys<T, TObject extends {}>(
+ object: List<T>|Dictionary<T>,
+ iteratee?: TObject
+ ): Dictionary<T>;
+
+ /**
+ * @see _.mapKeys
+ */
+ mapKeys<T>(
+ object: List<T>|Dictionary<T>,
+ iteratee?: string,
+ thisArg?: any
+ ): Dictionary<T>;
+ }
+
+ interface LoDashImplicitArrayWrapper<T> {
+ /**
+ * @see _.mapKeys
+ */
+ mapKeys<TKey>(
+ iteratee?: ListIterator<T, TKey>,
+ thisArg?: any
+ ): LoDashImplicitObjectWrapper<Dictionary<T>>;
+
+ /**
+ * @see _.mapKeys
+ */
+ mapKeys<TObject extends {}>(
+ iteratee?: TObject
+ ): LoDashImplicitObjectWrapper<Dictionary<T>>;
+
+ /**
+ * @see _.mapKeys
+ */
+ mapKeys(
+ iteratee?: string,
+ thisArg?: any
+ ): LoDashImplicitObjectWrapper<Dictionary<T>>;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.mapKeys
+ */
+ mapKeys<TResult, TKey>(
+ iteratee?: ListIterator<TResult, TKey>|DictionaryIterator<TResult, TKey>,
+ thisArg?: any
+ ): LoDashImplicitObjectWrapper<Dictionary<TResult>>;
+
+ /**
+ * @see _.mapKeys
+ */
+ mapKeys<TResult, TObject extends {}>(
+ iteratee?: TObject
+ ): LoDashImplicitObjectWrapper<Dictionary<TResult>>;
+
+ /**
+ * @see _.mapKeys
+ */
+ mapKeys<TResult>(
+ iteratee?: string,
+ thisArg?: any
+ ): LoDashImplicitObjectWrapper<Dictionary<TResult>>;
+ }
+
+ interface LoDashExplicitArrayWrapper<T> {
+ /**
+ * @see _.mapKeys
+ */
+ mapKeys<TKey>(
+ iteratee?: ListIterator<T, TKey>,
+ thisArg?: any
+ ): LoDashExplicitObjectWrapper<Dictionary<T>>;
+
+ /**
+ * @see _.mapKeys
+ */
+ mapKeys<TObject extends {}>(
+ iteratee?: TObject
+ ): LoDashExplicitObjectWrapper<Dictionary<T>>;
+
+ /**
+ * @see _.mapKeys
+ */
+ mapKeys(
+ iteratee?: string,
+ thisArg?: any
+ ): LoDashExplicitObjectWrapper<Dictionary<T>>;
+ }
+
+ interface LoDashExplicitObjectWrapper<T> {
+ /**
+ * @see _.mapKeys
+ */
+ mapKeys<TResult, TKey>(
+ iteratee?: ListIterator<TResult, TKey>|DictionaryIterator<TResult, TKey>,
+ thisArg?: any
+ ): LoDashExplicitObjectWrapper<Dictionary<TResult>>;
+
+ /**
+ * @see _.mapKeys
+ */
+ mapKeys<TResult, TObject extends {}>(
+ iteratee?: TObject
+ ): LoDashExplicitObjectWrapper<Dictionary<TResult>>;
+
+ /**
+ * @see _.mapKeys
+ */
+ mapKeys<TResult>(
+ iteratee?: string,
+ thisArg?: any
+ ): LoDashExplicitObjectWrapper<Dictionary<TResult>>;
+ }
+
+ //_.mapValues
+ interface LoDashStatic {
+ /**
+ * Creates an object with the same keys as object and values generated by running each own
+ * enumerable property of object through iteratee. The iteratee function is bound to thisArg
+ * and invoked with three arguments: (value, key, object).
+ *
+ * If a property name is provided iteratee the created "_.property" style callback returns
+ * the property value of the given element.
+ *
+ * If a value is also provided for thisArg the creted "_.matchesProperty" style callback returns
+ * true for elements that have a matching property value, else false;.
+ *
+ * If an object is provided for iteratee the created "_.matches" style callback returns true
+ * for elements that have the properties of the given object, else false.
+ *
+ * @param {Object} object The object to iterate over.
+ * @param {Function|Object|string} [iteratee=_.identity] The function invoked per iteration.
+ * @param {Object} [thisArg] The `this` binding of `iteratee`.
+ * @return {Object} Returns the new mapped object.
+ */
+ mapValues<T, TResult>(obj: Dictionary<T>, callback: ObjectIterator<T, TResult>, thisArg?: any): Dictionary<TResult>;
+ mapValues<T>(obj: Dictionary<T>, where: Dictionary<T>): Dictionary<boolean>;
+ mapValues<T, TMapped>(obj: T, pluck: string): TMapped;
+ mapValues<T>(obj: T, callback: ObjectIterator<any, any>, thisArg?: any): T;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.mapValues
+ * TValue is the type of the property values of T.
+ * TResult is the type output by the ObjectIterator function
+ */
+ mapValues<TValue, TResult>(callback: ObjectIterator<TValue, TResult>, thisArg?: any): LoDashImplicitObjectWrapper<Dictionary<TResult>>;
+
+ /**
+ * @see _.mapValues
+ * TResult is the type of the property specified by pluck.
+ * T should be a Dictionary<Dictionary<TResult>>
+ */
+ mapValues<TResult>(pluck: string): LoDashImplicitObjectWrapper<Dictionary<TResult>>;
+
+ /**
+ * @see _.mapValues
+ * TResult is the type of the properties on the object specified by pluck.
+ * T should be a Dictionary<Dictionary<Dictionary<TResult>>>
+ */
+ mapValues<TResult>(pluck: string, where: Dictionary<TResult>): LoDashImplicitArrayWrapper<Dictionary<boolean>>;
+
+ /**
+ * @see _.mapValues
+ * TResult is the type of the properties of each object in the values of T
+ * T should be a Dictionary<Dictionary<TResult>>
+ */
+ mapValues<TResult>(where: Dictionary<TResult>): LoDashImplicitArrayWrapper<boolean>;
+ }
+
+ //_.merge
+ interface LoDashStatic {
+ /**
+ * Recursively merges own and inherited enumerable properties of source
+ * objects into the destination object, skipping source properties that resolve
+ * to `undefined`. Array and plain object properties are merged recursively.
+ * Other objects and value types are overridden by assignment. Source objects
+ * are applied from left to right. Subsequent sources overwrite property
+ * assignments of previous sources.
+ *
+ * **Note:** This method mutates `object`.
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The destination object.
+ * @param {...Object} [sources] The source objects.
+ * @returns {Object} Returns `object`.
+ * @example
+ *
+ * var users = {
+ * 'data': [{ 'user': 'barney' }, { 'user': 'fred' }]
+ * };
+ *
+ * var ages = {
+ * 'data': [{ 'age': 36 }, { 'age': 40 }]
+ * };
+ *
+ * _.merge(users, ages);
+ * // => { 'data': [{ 'user': 'barney', 'age': 36 }, { 'user': 'fred', 'age': 40 }] }
+ */
+ merge<TObject, TSource>(
+ object: TObject,
+ source: TSource
+ ): TObject & TSource;
+
+ /**
+ * @see _.merge
+ */
+ merge<TObject, TSource1, TSource2>(
+ object: TObject,
+ source1: TSource1,
+ source2: TSource2
+ ): TObject & TSource1 & TSource2;
+
+ /**
+ * @see _.merge
+ */
+ merge<TObject, TSource1, TSource2, TSource3>(
+ object: TObject,
+ source1: TSource1,
+ source2: TSource2,
+ source3: TSource3
+ ): TObject & TSource1 & TSource2 & TSource3;
+
+ /**
+ * @see _.merge
+ */
+ merge<TObject, TSource1, TSource2, TSource3, TSource4>(
+ object: TObject,
+ source1: TSource1,
+ source2: TSource2,
+ source3: TSource3,
+ source4: TSource4
+ ): TObject & TSource1 & TSource2 & TSource3 & TSource4;
+
+ /**
+ * @see _.merge
+ */
+ merge<TResult>(
+ object: any,
+ ...otherArgs: any[]
+ ): TResult;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.merge
+ */
+ merge<TSource>(
+ source: TSource
+ ): LoDashImplicitObjectWrapper<T & TSource>;
+
+ /**
+ * @see _.merge
+ */
+ merge<TSource1, TSource2>(
+ source1: TSource1,
+ source2: TSource2
+ ): LoDashImplicitObjectWrapper<T & TSource1 & TSource2>;
+
+ /**
+ * @see _.merge
+ */
+ merge<TSource1, TSource2, TSource3>(
+ source1: TSource1,
+ source2: TSource2,
+ source3: TSource3
+ ): LoDashImplicitObjectWrapper<T & TSource1 & TSource2 & TSource3>;
+
+ /**
+ * @see _.merge
+ */
+ merge<TSource1, TSource2, TSource3, TSource4>(
+ source1: TSource1,
+ source2: TSource2,
+ source3: TSource3,
+ source4: TSource4
+ ): LoDashImplicitObjectWrapper<T & TSource1 & TSource2 & TSource3 & TSource4>;
+
+ /**
+ * @see _.merge
+ */
+ merge<TResult>(
+ ...otherArgs: any[]
+ ): LoDashImplicitObjectWrapper<TResult>;
+ }
+
+ interface LoDashExplicitObjectWrapper<T> {
+ /**
+ * @see _.merge
+ */
+ merge<TSource>(
+ source: TSource
+ ): LoDashExplicitObjectWrapper<T & TSource>;
+
+ /**
+ * @see _.merge
+ */
+ merge<TSource1, TSource2>(
+ source1: TSource1,
+ source2: TSource2
+ ): LoDashExplicitObjectWrapper<T & TSource1 & TSource2>;
+
+ /**
+ * @see _.merge
+ */
+ merge<TSource1, TSource2, TSource3>(
+ source1: TSource1,
+ source2: TSource2,
+ source3: TSource3
+ ): LoDashExplicitObjectWrapper<T & TSource1 & TSource2 & TSource3>;
+
+ /**
+ * @see _.merge
+ */
+ merge<TSource1, TSource2, TSource3, TSource4>(
+ ): LoDashExplicitObjectWrapper<T & TSource1 & TSource2 & TSource3 & TSource4>;
+
+ /**
+ * @see _.merge
+ */
+ merge<TResult>(
+ ...otherArgs: any[]
+ ): LoDashExplicitObjectWrapper<TResult>;
+ }
+
+ //_.mergeWith
+ interface MergeWithCustomizer {
+ (value: any, srcValue: any, key?: string, object?: Object, source?: Object): any;
+ }
+
+ interface LoDashStatic {
+ /**
+ * This method is like `_.merge` except that it accepts `customizer` which
+ * is invoked to produce the merged values of the destination and source
+ * properties. If `customizer` returns `undefined` merging is handled by the
+ * method instead. The `customizer` is invoked with seven arguments:
+ * (objValue, srcValue, key, object, source, stack).
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The destination object.
+ * @param {...Object} sources The source objects.
+ * @param {Function} customizer The function to customize assigned values.
+ * @returns {Object} Returns `object`.
+ * @example
+ *
+ * function customizer(objValue, srcValue) {
+ * if (_.isArray(objValue)) {
+ * return objValue.concat(srcValue);
+ * }
+ * }
+ *
+ * var object = {
+ * 'fruits': ['apple'],
+ * 'vegetables': ['beet']
+ * };
+ *
+ * var other = {
+ * 'fruits': ['banana'],
+ * 'vegetables': ['carrot']
+ * };
+ *
+ * _.merge(object, other, customizer);
+ * // => { 'fruits': ['apple', 'banana'], 'vegetables': ['beet', 'carrot'] }
+ */
+ mergeWith<TObject, TSource>(
+ object: TObject,
+ source: TSource,
+ customizer: MergeWithCustomizer
+ ): TObject & TSource;
+
+ /**
+ * @see _.mergeWith
+ */
+ mergeWith<TObject, TSource1, TSource2>(
+ object: TObject,
+ source1: TSource1,
+ source2: TSource2,
+ customizer: MergeWithCustomizer
+ ): TObject & TSource1 & TSource2;
+
+ /**
+ * @see _.mergeWith
+ */
+ mergeWith<TObject, TSource1, TSource2, TSource3>(
+ object: TObject,
+ source1: TSource1,
+ source2: TSource2,
+ source3: TSource3,
+ customizer: MergeWithCustomizer
+ ): TObject & TSource1 & TSource2 & TSource3;
+
+ /**
+ * @see _.mergeWith
+ */
+ mergeWith<TObject, TSource1, TSource2, TSource3, TSource4>(
+ object: TObject,
+ source1: TSource1,
+ source2: TSource2,
+ source3: TSource3,
+ source4: TSource4,
+ customizer: MergeWithCustomizer
+ ): TObject & TSource1 & TSource2 & TSource3 & TSource4;
+
+ /**
+ * @see _.mergeWith
+ */
+ mergeWith<TResult>(
+ object: any,
+ ...otherArgs: any[]
+ ): TResult;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.mergeWith
+ */
+ mergeWith<TSource>(
+ source: TSource,
+ customizer: MergeWithCustomizer
+ ): LoDashImplicitObjectWrapper<T & TSource>;
+
+ /**
+ * @see _.mergeWith
+ */
+ mergeWith<TSource1, TSource2>(
+ source1: TSource1,
+ source2: TSource2,
+ customizer: MergeWithCustomizer
+ ): LoDashImplicitObjectWrapper<T & TSource1 & TSource2>;
+
+ /**
+ * @see _.mergeWith
+ */
+ mergeWith<TSource1, TSource2, TSource3>(
+ source1: TSource1,
+ source2: TSource2,
+ source3: TSource3,
+ customizer: MergeWithCustomizer
+ ): LoDashImplicitObjectWrapper<T & TSource1 & TSource2 & TSource3>;
+
+ /**
+ * @see _.mergeWith
+ */
+ mergeWith<TSource1, TSource2, TSource3, TSource4>(
+ source1: TSource1,
+ source2: TSource2,
+ source3: TSource3,
+ source4: TSource4,
+ customizer: MergeWithCustomizer
+ ): LoDashImplicitObjectWrapper<T & TSource1 & TSource2 & TSource3 & TSource4>;
+
+ /**
+ * @see _.mergeWith
+ */
+ mergeWith<TResult>(
+ ...otherArgs: any[]
+ ): LoDashImplicitObjectWrapper<TResult>;
+ }
+
+ //_.omit
+ interface LoDashStatic {
+ /**
+ * The opposite of `_.pick`; this method creates an object composed of the
+ * own and inherited enumerable properties of `object` that are not omitted.
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The source object.
+ * @param {...(string|string[])} [props] The property names to omit, specified
+ * individually or in arrays..
+ * @returns {Object} Returns the new object.
+ * @example
+ *
+ * var object = { 'a': 1, 'b': '2', 'c': 3 };
+ *
+ * _.omit(object, ['a', 'c']);
+ * // => { 'b': '2' }
+ */
+
+ omit<TResult extends {}, T extends {}>(
+ object: T,
+ ...predicate: (StringRepresentable|StringRepresentable[])[]
+ ): TResult;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+
+ /**
+ * @see _.omit
+ */
+ omit<TResult extends {}>(
+ ...predicate: (StringRepresentable|StringRepresentable[])[]
+ ): LoDashImplicitObjectWrapper<TResult>;
+ }
+
+ interface LoDashExplicitObjectWrapper<T> {
+
+ /**
+ * @see _.omit
+ */
+ omit<TResult extends {}>(
+ ...predicate: (StringRepresentable|StringRepresentable[])[]
+ ): LoDashExplicitObjectWrapper<TResult>;
+ }
+
+ //_.omitBy
+ interface LoDashStatic {
+ /**
+ * The opposite of `_.pickBy`; this method creates an object composed of the
+ * own and inherited enumerable properties of `object` that `predicate`
+ * doesn't return truthy for.
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The source object.
+ * @param {Function|Object|string} [predicate=_.identity] The function invoked per property.
+ * @returns {Object} Returns the new object.
+ * @example
+ *
+ * var object = { 'a': 1, 'b': '2', 'c': 3 };
+ *
+ * _.omitBy(object, _.isNumber);
+ * // => { 'b': '2' }
+ */
+ omitBy<TResult extends {}, T extends {}>(
+ object: T,
+ predicate: ObjectIterator<any, boolean>
+ ): TResult;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.omitBy
+ */
+ omitBy<TResult extends {}>(
+ predicate: ObjectIterator<any, boolean>
+ ): LoDashImplicitObjectWrapper<TResult>;
+ }
+
+ interface LoDashExplicitObjectWrapper<T> {
+ /**
+ * @see _.omitBy
+ */
+ omitBy<TResult extends {}>(
+ predicate: ObjectIterator<any, boolean>
+ ): LoDashExplicitObjectWrapper<TResult>;
+ }
+
+ //_.toPairs
+ interface LoDashStatic {
+ /**
+ * Creates a two dimensional array of the key-value pairs for object, e.g. [[key1, value1], [key2, value2]].
+ *
+ * @param object The object to query.
+ * @return Returns the new array of key-value pairs.
+ */
+ toPairs<T extends {}>(object?: T): any[][];
+
+ toPairs<T extends {}, TResult>(object?: T): TResult[][];
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.toPairs
+ */
+ toPairs<TResult>(): LoDashImplicitArrayWrapper<TResult[]>;
+ }
+
+ interface LoDashExplicitObjectWrapper<T> {
+ /**
+ * @see _.toPairs
+ */
+ toPairs<TResult>(): LoDashExplicitArrayWrapper<TResult[]>;
+ }
+
+ //_.pick
+ interface LoDashStatic {
+ /**
+ * Creates an object composed of the picked `object` properties.
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The source object.
+ * @param {...(string|string[])} [props] The property names to pick, specified
+ * individually or in arrays.
+ * @returns {Object} Returns the new object.
+ * @example
+ *
+ * var object = { 'a': 1, 'b': '2', 'c': 3 };
+ *
+ * _.pick(object, ['a', 'c']);
+ * // => { 'a': 1, 'c': 3 }
+ */
+ pick<TResult extends {}, T extends {}>(
+ object: T,
+ ...predicate: (StringRepresentable|StringRepresentable[])[]
+ ): TResult;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.pick
+ */
+ pick<TResult extends {}>(
+ ...predicate: (StringRepresentable|StringRepresentable[])[]
+ ): LoDashImplicitObjectWrapper<TResult>;
+ }
+
+ interface LoDashExplicitObjectWrapper<T> {
+ /**
+ * @see _.pick
+ */
+ pick<TResult extends {}>(
+ ...predicate: (StringRepresentable|StringRepresentable[])[]
+ ): LoDashExplicitObjectWrapper<TResult>;
+ }
+
+ //_.pickBy
+ interface LoDashStatic {
+ /**
+ * Creates an object composed of the `object` properties `predicate` returns
+ * truthy for. The predicate is invoked with one argument: (value).
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The source object.
+ * @param {Function|Object|string} [predicate=_.identity] The function invoked per property.
+ * @returns {Object} Returns the new object.
+ * @example
+ *
+ * var object = { 'a': 1, 'b': '2', 'c': 3 };
+ *
+ * _.pickBy(object, _.isNumber);
+ * // => { 'a': 1, 'c': 3 }
+ */
+ pickBy<TResult extends {}, T extends {}>(
+ object: T,
+ predicate: ObjectIterator<any, boolean>
+ ): TResult;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.pickBy
+ */
+ pickBy<TResult extends {}>(
+ predicate: ObjectIterator<any, boolean>
+ ): LoDashImplicitObjectWrapper<TResult>;
+ }
+
+ interface LoDashExplicitObjectWrapper<T> {
+ /**
+ * @see _.pickBy
+ */
+ pickBy<TResult extends {}>(
+ predicate: ObjectIterator<any, boolean>
+ ): LoDashExplicitObjectWrapper<TResult>;
+ }
+
+ //_.result
+ interface LoDashStatic {
+ /**
+ * This method is like _.get except that if the resolved value is a function it’s invoked with the this binding
+ * of its parent object and its result is returned.
+ *
+ * @param object The object to query.
+ * @param path The path of the property to resolve.
+ * @param defaultValue The value returned if the resolved value is undefined.
+ * @return Returns the resolved value.
+ */
+ result<TObject, TResult>(
+ object: TObject,
+ path: number|string|boolean|Array<number|string|boolean>,
+ defaultValue?: TResult
+ ): TResult;
+ }
+
+ interface LoDashImplicitWrapperBase<T, TWrapper> {
+ /**
+ * @see _.result
+ */
+ result<TResult>(
+ path: number|string|boolean|Array<number|string|boolean>,
+ defaultValue?: TResult
+ ): TResult;
+ }
+
+ //_.set
+ interface LoDashStatic {
+ /**
+ * Sets the property value of path on object. If a portion of path does not exist it’s created.
+ *
+ * @param object The object to augment.
+ * @param path The path of the property to set.
+ * @param value The value to set.
+ * @return Returns object.
+ */
+ set<T>(
+ object: T,
+ path: StringRepresentable|StringRepresentable[],
+ value: any
+ ): T;
+
+ /**
+ * @see _.set
+ */
+ set<V, T>(
+ object: T,
+ path: StringRepresentable|StringRepresentable[],
+ value: V
+ ): T;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.set
+ */
+ set<V>(
+ path: StringRepresentable|StringRepresentable[],
+ value: V
+ ): LoDashImplicitObjectWrapper<T>;
+ }
+
+ interface LoDashExplicitObjectWrapper<T> {
+ /**
+ * @see _.set
+ */
+ set<V>(
+ path: StringRepresentable|StringRepresentable[],
+ value: V
+ ): LoDashExplicitObjectWrapper<T>;
+ }
+
+ //_.transform
+ interface LoDashStatic {
+ /**
+ * An alternative to _.reduce; this method transforms object to a new accumulator object which is the result of
+ * running each of its own enumerable properties through iteratee, with each invocation potentially mutating
+ * the accumulator object. The iteratee is bound to thisArg and invoked with four arguments: (accumulator,
+ * value, key, object). Iteratee functions may exit iteration early by explicitly returning false.
+ *
+ * @param object The object to iterate over.
+ * @param iteratee The function invoked per iteration.
+ * @param accumulator The custom accumulator value.
+ * @param thisArg The this binding of iteratee.
+ * @return Returns the accumulated value.
+ */
+ transform<T, TResult>(
+ object: T[],
+ iteratee?: MemoVoidArrayIterator<T, TResult[]>,
+ accumulator?: TResult[],
+ thisArg?: any
+ ): TResult[];
+
+ /**
+ * @see _.transform
+ */
+ transform<T, TResult>(
+ object: T[],
+ iteratee?: MemoVoidArrayIterator<T, Dictionary<TResult>>,
+ accumulator?: Dictionary<TResult>,
+ thisArg?: any
+ ): Dictionary<TResult>;
+
+ /**
+ * @see _.transform
+ */
+ transform<T, TResult>(
+ object: Dictionary<T>,
+ iteratee?: MemoVoidDictionaryIterator<T, Dictionary<TResult>>,
+ accumulator?: Dictionary<TResult>,
+ thisArg?: any
+ ): Dictionary<TResult>;
+
+ /**
+ * @see _.transform
+ */
+ transform<T, TResult>(
+ object: Dictionary<T>,
+ iteratee?: MemoVoidDictionaryIterator<T, TResult[]>,
+ accumulator?: TResult[],
+ thisArg?: any
+ ): TResult[];
+ }
+
+ interface LoDashImplicitArrayWrapper<T> {
+ /**
+ * @see _.transform
+ */
+ transform<TResult>(
+ iteratee?: MemoVoidArrayIterator<T, TResult[]>,
+ accumulator?: TResult[],
+ thisArg?: any
+ ): LoDashImplicitArrayWrapper<TResult>;
+
+ /**
+ * @see _.transform
+ */
+ transform<TResult>(
+ iteratee?: MemoVoidArrayIterator<T, Dictionary<TResult>>,
+ accumulator?: Dictionary<TResult>,
+ thisArg?: any
+ ): LoDashImplicitObjectWrapper<Dictionary<TResult>>;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.transform
+ */
+ transform<T, TResult>(
+ iteratee?: MemoVoidDictionaryIterator<T, Dictionary<TResult>>,
+ accumulator?: Dictionary<TResult>,
+ thisArg?: any
+ ): LoDashImplicitObjectWrapper<Dictionary<TResult>>;
+
+ /**
+ * @see _.transform
+ */
+ transform<T, TResult>(
+ iteratee?: MemoVoidDictionaryIterator<T, TResult[]>,
+ accumulator?: TResult[],
+ thisArg?: any
+ ): LoDashImplicitArrayWrapper<TResult>;
+ }
+
+ //_.values
+ interface LoDashStatic {
+ /**
+ * Creates an array of the own enumerable property values of object.
+ *
+ * @param object The object to query.
+ * @return Returns an array of property values.
+ */
+ values<T>(object?: any): T[];
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.values
+ */
+ values<T>(): LoDashImplicitArrayWrapper<T>;
+ }
+
+ interface LoDashExplicitObjectWrapper<T> {
+ /**
+ * @see _.values
+ */
+ values<T>(): LoDashExplicitArrayWrapper<T>;
+ }
+
+ //_.valuesIn
+ interface LoDashStatic {
+ /**
+ * Creates an array of the own and inherited enumerable property values of object.
+ *
+ * @param object The object to query.
+ * @return Returns the array of property values.
+ */
+ valuesIn<T>(object?: any): T[];
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.valuesIn
+ */
+ valuesIn<T>(): LoDashImplicitArrayWrapper<T>;
+ }
+
+ interface LoDashExplicitObjectWrapper<T> {
+ /**
+ * @see _.valuesIn
+ */
+ valuesIn<T>(): LoDashExplicitArrayWrapper<T>;
+ }
+
+ /**********
+ * String *
+ **********/
+
+ //_.camelCase
+ interface LoDashStatic {
+ /**
+ * Converts string to camel case.
+ *
+ * @param string The string to convert.
+ * @return Returns the camel cased string.
+ */
+ camelCase(string?: string): string;
+ }
+
+ interface LoDashImplicitWrapper<T> {
+ /**
+ * @see _.camelCase
+ */
+ camelCase(): string;
+ }
+
+ interface LoDashExplicitWrapper<T> {
+ /**
+ * @see _.camelCase
+ */
+ camelCase(): LoDashExplicitWrapper<string>;
+ }
+
+ //_.capitalize
+ interface LoDashStatic {
+ capitalize(string?: string): string;
+ }
+
+ interface LoDashImplicitWrapper<T> {
+ /**
+ * @see _.capitalize
+ */
+ capitalize(): string;
+ }
+
+ interface LoDashExplicitWrapper<T> {
+ /**
+ * @see _.capitalize
+ */
+ capitalize(): LoDashExplicitWrapper<string>;
+ }
+
+ //_.deburr
+ interface LoDashStatic {
+ /**
+ * Deburrs string by converting latin-1 supplementary letters to basic latin letters and removing combining
+ * diacritical marks.
+ *
+ * @param string The string to deburr.
+ * @return Returns the deburred string.
+ */
+ deburr(string?: string): string;
+ }
+
+ interface LoDashImplicitWrapper<T> {
+ /**
+ * @see _.deburr
+ */
+ deburr(): string;
+ }
+
+ interface LoDashExplicitWrapper<T> {
+ /**
+ * @see _.deburr
+ */
+ deburr(): LoDashExplicitWrapper<string>;
+ }
+
+ //_.endsWith
+ interface LoDashStatic {
+ /**
+ * Checks if string ends with the given target string.
+ *
+ * @param string The string to search.
+ * @param target The string to search for.
+ * @param position The position to search from.
+ * @return Returns true if string ends with target, else false.
+ */
+ endsWith(
+ string?: string,
+ target?: string,
+ position?: number
+ ): boolean;
+ }
+
+ interface LoDashImplicitWrapper<T> {
+ /**
+ * @see _.endsWith
+ */
+ endsWith(
+ target?: string,
+ position?: number
+ ): boolean;
+ }
+
+ interface LoDashExplicitWrapper<T> {
+ /**
+ * @see _.endsWith
+ */
+ endsWith(
+ target?: string,
+ position?: number
+ ): LoDashExplicitWrapper<boolean>;
+ }
+
+ // _.escape
+ interface LoDashStatic {
+ /**
+ * Converts the characters "&", "<", ">", '"', "'", and "`", in string to their corresponding HTML entities.
+ *
+ * Note: No other characters are escaped. To escape additional characters use a third-party library like he.
+ *
+ * Though the ">" character is escaped for symmetry, characters like ">" and "/" don’t need escaping in HTML
+ * and have no special meaning unless they're part of a tag or unquoted attribute value. See Mathias Bynens’s
+ * article (under "semi-related fun fact") for more details.
+ *
+ * Backticks are escaped because in Internet Explorer < 9, they can break out of attribute values or HTML
+ * comments. See #59, #102, #108, and #133 of the HTML5 Security Cheatsheet for more details.
+ *
+ * When working with HTML you should always quote attribute values to reduce XSS vectors.
+ *
+ * @param string The string to escape.
+ * @return Returns the escaped string.
+ */
+ escape(string?: string): string;
+ }
+
+ interface LoDashImplicitWrapper<T> {
+ /**
+ * @see _.escape
+ */
+ escape(): string;
+ }
+
+ interface LoDashExplicitWrapper<T> {
+ /**
+ * @see _.escape
+ */
+ escape(): LoDashExplicitWrapper<string>;
+ }
+
+ // _.escapeRegExp
+ interface LoDashStatic {
+ /**
+ * Escapes the RegExp special characters "\", "/", "^", "$", ".", "|", "?", "*", "+", "(", ")", "[", "]",
+ * "{" and "}" in string.
+ *
+ * @param string The string to escape.
+ * @return Returns the escaped string.
+ */
+ escapeRegExp(string?: string): string;
+ }
+
+ interface LoDashImplicitWrapper<T> {
+ /**
+ * @see _.escapeRegExp
+ */
+ escapeRegExp(): string;
+ }
+
+ interface LoDashExplicitWrapper<T> {
+ /**
+ * @see _.escapeRegExp
+ */
+ escapeRegExp(): LoDashExplicitWrapper<string>;
+ }
+
+ //_.kebabCase
+ interface LoDashStatic {
+ /**
+ * Converts string to kebab case.
+ *
+ * @param string The string to convert.
+ * @return Returns the kebab cased string.
+ */
+ kebabCase(string?: string): string;
+ }
+
+ interface LoDashImplicitWrapper<T> {
+ /**
+ * @see _.kebabCase
+ */
+ kebabCase(): string;
+ }
+
+ interface LoDashExplicitWrapper<T> {
+ /**
+ * @see _.kebabCase
+ */
+ kebabCase(): LoDashExplicitWrapper<string>;
+ }
+
+ //_.lowerCase
+ interface LoDashStatic {
+ /**
+ * Converts `string`, as space separated words, to lower case.
+ *
+ * @static
+ * @memberOf _
+ * @category String
+ * @param {string} [string=''] The string to convert.
+ * @returns {string} Returns the lower cased string.
+ * @example
+ *
+ * _.lowerCase('--Foo-Bar');
+ * // => 'foo bar'
+ *
+ * _.lowerCase('fooBar');
+ * // => 'foo bar'
+ *
+ * _.lowerCase('__FOO_BAR__');
+ * // => 'foo bar'
+ */
+ lowerCase(string?: string): string;
+ }
+
+ interface LoDashImplicitWrapper<T> {
+ /**
+ * @see _.lowerCase
+ */
+ lowerCase(): string;
+ }
+
+ interface LoDashExplicitWrapper<T> {
+ /**
+ * @see _.lowerCase
+ */
+ lowerCase(): LoDashExplicitWrapper<string>;
+ }
+
+ //_.lowerFirst
+ interface LoDashStatic {
+ /**
+ * Converts the first character of `string` to lower case.
+ *
+ * @static
+ * @memberOf _
+ * @category String
+ * @param {string} [string=''] The string to convert.
+ * @returns {string} Returns the converted string.
+ * @example
+ *
+ * _.lowerFirst('Fred');
+ * // => 'fred'
+ *
+ * _.lowerFirst('FRED');
+ * // => 'fRED'
+ */
+ lowerFirst(string?: string): string;
+ }
+
+ interface LoDashImplicitWrapper<T> {
+ /**
+ * @see _.lowerFirst
+ */
+ lowerFirst(): string;
+ }
+
+ interface LoDashExplicitWrapper<T> {
+ /**
+ * @see _.lowerFirst
+ */
+ lowerFirst(): LoDashExplicitWrapper<string>;
+ }
+
+ //_.pad
+ interface LoDashStatic {
+ /**
+ * Pads string on the left and right sides if it’s shorter than length. Padding characters are truncated if
+ * they can’t be evenly divided by length.
+ *
+ * @param string The string to pad.
+ * @param length The padding length.
+ * @param chars The string used as padding.
+ * @return Returns the padded string.
+ */
+ pad(
+ string?: string,
+ length?: number,
+ chars?: string
+ ): string;
+ }
+
+ interface LoDashImplicitWrapper<T> {
+ /**
+ * @see _.pad
+ */
+ pad(
+ length?: number,
+ chars?: string
+ ): string;
+ }
+
+ interface LoDashExplicitWrapper<T> {
+ /**
+ * @see _.pad
+ */
+ pad(
+ length?: number,
+ chars?: string
+ ): LoDashExplicitWrapper<string>;
+ }
+
+ //_.padStart
+ interface LoDashStatic {
+ /**
+ * Pads string on the left side if it’s shorter than length. Padding characters are truncated if they exceed
+ * length.
+ *
+ * @param string The string to pad.
+ * @param length The padding length.
+ * @param chars The string used as padding.
+ * @return Returns the padded string.
+ */
+ padStart(
+ string?: string,
+ length?: number,
+ chars?: string
+ ): string;
+ }
+
+ interface LoDashImplicitWrapper<T> {
+ /**
+ * @see _.padStart
+ */
+ padStart(
+ length?: number,
+ chars?: string
+ ): string;
+ }
+
+ interface LoDashExplicitWrapper<T> {
+ /**
+ * @see _.padStart
+ */
+ padStart(
+ length?: number,
+ chars?: string
+ ): LoDashExplicitWrapper<string>;
+ }
+
+ //_.padEnd
+ interface LoDashStatic {
+ /**
+ * Pads string on the right side if it’s shorter than length. Padding characters are truncated if they exceed
+ * length.
+ *
+ * @param string The string to pad.
+ * @param length The padding length.
+ * @param chars The string used as padding.
+ * @return Returns the padded string.
+ */
+ padEnd(
+ string?: string,
+ length?: number,
+ chars?: string
+ ): string;
+ }
+
+ interface LoDashImplicitWrapper<T> {
+ /**
+ * @see _.padEnd
+ */
+ padEnd(
+ length?: number,
+ chars?: string
+ ): string;
+ }
+
+ interface LoDashExplicitWrapper<T> {
+ /**
+ * @see _.padEnd
+ */
+ padEnd(
+ length?: number,
+ chars?: string
+ ): LoDashExplicitWrapper<string>;
+ }
+
+ //_.parseInt
+ interface LoDashStatic {
+ /**
+ * Converts string to an integer of the specified radix. If radix is undefined or 0, a radix of 10 is used
+ * unless value is a hexadecimal, in which case a radix of 16 is used.
+ *
+ * Note: This method aligns with the ES5 implementation of parseInt.
+ *
+ * @param string The string to convert.
+ * @param radix The radix to interpret value by.
+ * @return Returns the converted integer.
+ */
+ parseInt(
+ string: string,
+ radix?: number
+ ): number;
+ }
+
+ interface LoDashImplicitWrapper<T> {
+ /**
+ * @see _.parseInt
+ */
+ parseInt(radix?: number): number;
+ }
+
+ interface LoDashExplicitWrapper<T> {
+ /**
+ * @see _.parseInt
+ */
+ parseInt(radix?: number): LoDashExplicitWrapper<number>;
+ }
+
+ //_.repeat
+ interface LoDashStatic {
+ /**
+ * Repeats the given string n times.
+ *
+ * @param string The string to repeat.
+ * @param n The number of times to repeat the string.
+ * @return Returns the repeated string.
+ */
+ repeat(
+ string?: string,
+ n?: number
+ ): string;
+ }
+
+ interface LoDashImplicitWrapper<T> {
+ /**
+ * @see _.repeat
+ */
+ repeat(n?: number): string;
+ }
+
+ interface LoDashExplicitWrapper<T> {
+ /**
+ * @see _.repeat
+ */
+ repeat(n?: number): LoDashExplicitWrapper<string>;
+ }
+
+ //_.snakeCase
+ interface LoDashStatic {
+ /**
+ * Converts string to snake case.
+ *
+ * @param string The string to convert.
+ * @return Returns the snake cased string.
+ */
+ snakeCase(string?: string): string;
+ }
+
+ interface LoDashImplicitWrapper<T> {
+ /**
+ * @see _.snakeCase
+ */
+ snakeCase(): string;
+ }
+
+ interface LoDashExplicitWrapper<T> {
+ /**
+ * @see _.snakeCase
+ */
+ snakeCase(): LoDashExplicitWrapper<string>;
+ }
+
+ //_.startCase
+ interface LoDashStatic {
+ /**
+ * Converts string to start case.
+ *
+ * @param string The string to convert.
+ * @return Returns the start cased string.
+ */
+ startCase(string?: string): string;
+ }
+
+ interface LoDashImplicitWrapper<T> {
+ /**
+ * @see _.startCase
+ */
+ startCase(): string;
+ }
+
+ interface LoDashExplicitWrapper<T> {
+ /**
+ * @see _.startCase
+ */
+ startCase(): LoDashExplicitWrapper<string>;
+ }
+
+ //_.startsWith
+ interface LoDashStatic {
+ /**
+ * Checks if string starts with the given target string.
+ *
+ * @param string The string to search.
+ * @param target The string to search for.
+ * @param position The position to search from.
+ * @return Returns true if string starts with target, else false.
+ */
+ startsWith(
+ string?: string,
+ target?: string,
+ position?: number
+ ): boolean;
+ }
+
+ interface LoDashImplicitWrapper<T> {
+ /**
+ * @see _.startsWith
+ */
+ startsWith(
+ target?: string,
+ position?: number
+ ): boolean;
+ }
+
+ interface LoDashExplicitWrapper<T> {
+ /**
+ * @see _.startsWith
+ */
+ startsWith(
+ target?: string,
+ position?: number
+ ): LoDashExplicitWrapper<boolean>;
+ }
+
+ //_.template
+ interface TemplateOptions extends TemplateSettings {
+ /**
+ * The sourceURL of the template's compiled source.
+ */
+ sourceURL?: string;
+ }
+
+ interface TemplateExecutor {
+ (data?: Object): string;
+ source: string;
+ }
+
+ interface LoDashStatic {
+ /**
+ * Creates a compiled template function that can interpolate data properties in "interpolate" delimiters,
+ * HTML-escape interpolated data properties in "escape" delimiters, and execute JavaScript in "evaluate"
+ * delimiters. Data properties may be accessed as free variables in the template. If a setting object is
+ * provided it takes precedence over _.templateSettings values.
+ *
+ * Note: In the development build _.template utilizes
+ * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl) for easier
+ * debugging.
+ *
+ * For more information on precompiling templates see
+ * [lodash's custom builds documentation](https://lodash.com/custom-builds).
+ *
+ * For more information on Chrome extension sandboxes see
+ * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).
+ *
+ * @param string The template string.
+ * @param options The options object.
+ * @param options.escape The HTML "escape" delimiter.
+ * @param options.evaluate The "evaluate" delimiter.
+ * @param options.imports An object to import into the template as free variables.
+ * @param options.interpolate The "interpolate" delimiter.
+ * @param options.sourceURL The sourceURL of the template's compiled source.
+ * @param options.variable The data object variable name.
+ * @return Returns the compiled template function.
+ */
+ template(
+ string: string,
+ options?: TemplateOptions
+ ): TemplateExecutor;
+ }
+
+ interface LoDashImplicitWrapper<T> {
+ /**
+ * @see _.template
+ */
+ template(options?: TemplateOptions): TemplateExecutor;
+ }
+
+ interface LoDashExplicitWrapper<T> {
+ /**
+ * @see _.template
+ */
+ template(options?: TemplateOptions): LoDashExplicitObjectWrapper<TemplateExecutor>;
+ }
+
+ //_.toLower
+ interface LoDashStatic {
+ /**
+ * Converts `string`, as a whole, to lower case.
+ *
+ * @static
+ * @memberOf _
+ * @category String
+ * @param {string} [string=''] The string to convert.
+ * @returns {string} Returns the lower cased string.
+ * @example
+ *
+ * _.toLower('--Foo-Bar');
+ * // => '--foo-bar'
+ *
+ * _.toLower('fooBar');
+ * // => 'foobar'
+ *
+ * _.toLower('__FOO_BAR__');
+ * // => '__foo_bar__'
+ */
+ toLower(string?: string): string;
+ }
+
+ interface LoDashImplicitWrapper<T> {
+ /**
+ * @see _.toLower
+ */
+ toLower(): string;
+ }
+
+ interface LoDashExplicitWrapper<T> {
+ /**
+ * @see _.toLower
+ */
+ toLower(): LoDashExplicitWrapper<string>;
+ }
+
+ //_.toUpper
+ interface LoDashStatic {
+ /**
+ * Converts `string`, as a whole, to upper case.
+ *
+ * @static
+ * @memberOf _
+ * @category String
+ * @param {string} [string=''] The string to convert.
+ * @returns {string} Returns the upper cased string.
+ * @example
+ *
+ * _.toUpper('--foo-bar');
+ * // => '--FOO-BAR'
+ *
+ * _.toUpper('fooBar');
+ * // => 'FOOBAR'
+ *
+ * _.toUpper('__foo_bar__');
+ * // => '__FOO_BAR__'
+ */
+ toUpper(string?: string): string;
+ }
+
+ interface LoDashImplicitWrapper<T> {
+ /**
+ * @see _.toUpper
+ */
+ toUpper(): string;
+ }
+
+ interface LoDashExplicitWrapper<T> {
+ /**
+ * @see _.toUpper
+ */
+ toUpper(): LoDashExplicitWrapper<string>;
+ }
+
+ //_.trim
+ interface LoDashStatic {
+ /**
+ * Removes leading and trailing whitespace or specified characters from string.
+ *
+ * @param string The string to trim.
+ * @param chars The characters to trim.
+ * @return Returns the trimmed string.
+ */
+ trim(
+ string?: string,
+ chars?: string
+ ): string;
+ }
+
+ interface LoDashImplicitWrapper<T> {
+ /**
+ * @see _.trim
+ */
+ trim(chars?: string): string;
+ }
+
+ interface LoDashExplicitWrapper<T> {
+ /**
+ * @see _.trim
+ */
+ trim(chars?: string): LoDashExplicitWrapper<string>;
+ }
+
+ //_.trimStart
+ interface LoDashStatic {
+ /**
+ * Removes leading whitespace or specified characters from string.
+ *
+ * @param string The string to trim.
+ * @param chars The characters to trim.
+ * @return Returns the trimmed string.
+ */
+ trimStart(
+ string?: string,
+ chars?: string
+ ): string;
+ }
+
+ interface LoDashImplicitWrapper<T> {
+ /**
+ * @see _.trimStart
+ */
+ trimStart(chars?: string): string;
+ }
+
+ interface LoDashExplicitWrapper<T> {
+ /**
+ * @see _.trimStart
+ */
+ trimStart(chars?: string): LoDashExplicitWrapper<string>;
+ }
+
+ //_.trimEnd
+ interface LoDashStatic {
+ /**
+ * Removes trailing whitespace or specified characters from string.
+ *
+ * @param string The string to trim.
+ * @param chars The characters to trim.
+ * @return Returns the trimmed string.
+ */
+ trimEnd(
+ string?: string,
+ chars?: string
+ ): string;
+ }
+
+ interface LoDashImplicitWrapper<T> {
+ /**
+ * @see _.trimEnd
+ */
+ trimEnd(chars?: string): string;
+ }
+
+ interface LoDashExplicitWrapper<T> {
+ /**
+ * @see _.trimEnd
+ */
+ trimEnd(chars?: string): LoDashExplicitWrapper<string>;
+ }
+
+ //_.truncate
+ interface TruncateOptions {
+ /** The maximum string length. */
+ length?: number;
+ /** The string to indicate text is omitted. */
+ omission?: string;
+ /** The separator pattern to truncate to. */
+ separator?: string|RegExp;
+ }
+
+ interface LoDashStatic {
+ /**
+ * Truncates string if it’s longer than the given maximum string length. The last characters of the truncated
+ * string are replaced with the omission string which defaults to "…".
+ *
+ * @param string The string to truncate.
+ * @param options The options object or maximum string length.
+ * @return Returns the truncated string.
+ */
+ truncate(
+ string?: string,
+ options?: TruncateOptions|number
+ ): string;
+ }
+
+ interface LoDashImplicitWrapper<T> {
+ /**
+ * @see _.truncate
+ */
+ truncate(options?: TruncateOptions|number): string;
+ }
+
+ interface LoDashExplicitWrapper<T> {
+ /**
+ * @see _.truncate
+ */
+ truncate(options?: TruncateOptions|number): LoDashExplicitWrapper<string>;
+ }
+
+ //_.upperCase
+ interface LoDashStatic {
+ /**
+ * Converts `string`, as space separated words, to upper case.
+ *
+ * @static
+ * @memberOf _
+ * @category String
+ * @param {string} [string=''] The string to convert.
+ * @returns {string} Returns the upper cased string.
+ * @example
+ *
+ * _.upperCase('--foo-bar');
+ * // => 'FOO BAR'
+ *
+ * _.upperCase('fooBar');
+ * // => 'FOO BAR'
+ *
+ * _.upperCase('__foo_bar__');
+ * // => 'FOO BAR'
+ */
+ upperCase(string?: string): string;
+ }
+
+ interface LoDashImplicitWrapper<T> {
+ /**
+ * @see _.upperCase
+ */
+ upperCase(): string;
+ }
+
+ interface LoDashExplicitWrapper<T> {
+ /**
+ * @see _.upperCase
+ */
+ upperCase(): LoDashExplicitWrapper<string>;
+ }
+
+ //_.upperFirst
+ interface LoDashStatic {
+ /**
+ * Converts the first character of `string` to upper case.
+ *
+ * @static
+ * @memberOf _
+ * @category String
+ * @param {string} [string=''] The string to convert.
+ * @returns {string} Returns the converted string.
+ * @example
+ *
+ * _.upperFirst('fred');
+ * // => 'Fred'
+ *
+ * _.upperFirst('FRED');
+ * // => 'FRED'
+ */
+ upperFirst(string?: string): string;
+ }
+
+ interface LoDashImplicitWrapper<T> {
+ /**
+ * @see _.upperFirst
+ */
+ upperFirst(): string;
+ }
+
+ interface LoDashExplicitWrapper<T> {
+ /**
+ * @see _.upperFirst
+ */
+ upperFirst(): LoDashExplicitWrapper<string>;
+ }
+
+ //_.unescape
+ interface LoDashStatic {
+ /**
+ * The inverse of _.escape; this method converts the HTML entities &amp;, &lt;, &gt;, &quot;, &#39;, and &#96;
+ * in string to their corresponding characters.
+ *
+ * @param string The string to unescape.
+ * @return Returns the unescaped string.
+ */
+ unescape(string?: string): string;
+ }
+
+ interface LoDashImplicitWrapper<T> {
+ /**
+ * @see _.unescape
+ */
+ unescape(): string;
+ }
+
+ interface LoDashExplicitWrapper<T> {
+ /**
+ * @see _.unescape
+ */
+ unescape(): LoDashExplicitWrapper<string>;
+ }
+
+ //_.words
+ interface LoDashStatic {
+ /**
+ * Splits `string` into an array of its words.
+ *
+ * @static
+ * @memberOf _
+ * @category String
+ * @param {string} [string=''] The string to inspect.
+ * @param {RegExp|string} [pattern] The pattern to match words.
+ * @param- {Object} [guard] Enables use as an iteratee for functions like `_.map`.
+ * @returns {Array} Returns the words of `string`.
+ * @example
+ *
+ * _.words('fred, barney, & pebbles');
+ * // => ['fred', 'barney', 'pebbles']
+ *
+ * _.words('fred, barney, & pebbles', /[^, ]+/g);
+ * // => ['fred', 'barney', '&', 'pebbles']
+ */
+ words(
+ string?: string,
+ pattern?: string|RegExp
+ ): string[];
+ }
+
+ interface LoDashImplicitWrapper<T> {
+ /**
+ * @see _.words
+ */
+ words(pattern?: string|RegExp): string[];
+ }
+
+ interface LoDashExplicitWrapper<T> {
+ /**
+ * @see _.words
+ */
+ words(pattern?: string|RegExp): LoDashExplicitArrayWrapper<string>;
+ }
+
+ /***********
+ * Utility *
+ ***********/
+
+ //_.attempt
+ interface LoDashStatic {
+ /**
+ * Attempts to invoke func, returning either the result or the caught error object. Any additional arguments
+ * are provided to func when it’s invoked.
+ *
+ * @param func The function to attempt.
+ * @return Returns the func result or error object.
+ */
+ attempt<TResult>(func: (...args: any[]) => TResult): TResult|Error;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.attempt
+ */
+ attempt<TResult>(): TResult|Error;
+ }
+
+ interface LoDashExplicitObjectWrapper<T> {
+ /**
+ * @see _.attempt
+ */
+ attempt<TResult>(): LoDashExplicitObjectWrapper<TResult|Error>;
+ }
+
+ //_.constant
+ interface LoDashStatic {
+ /**
+ * Creates a function that returns value.
+ *
+ * @param value The value to return from the new function.
+ * @return Returns the new function.
+ */
+ constant<T>(value: T): () => T;
+ }
+
+ interface LoDashImplicitWrapperBase<T, TWrapper> {
+ /**
+ * @see _.constant
+ */
+ constant<TResult>(): LoDashImplicitObjectWrapper<() => TResult>;
+ }
+
+ interface LoDashExplicitWrapperBase<T, TWrapper> {
+ /**
+ * @see _.constant
+ */
+ constant<TResult>(): LoDashExplicitObjectWrapper<() => TResult>;
+ }
+
+ //_.identity
+ interface LoDashStatic {
+ /**
+ * This method returns the first argument provided to it.
+ * @param value Any value.
+ * @return Returns value.
+ */
+ identity<T>(value?: T): T;
+ }
+
+ interface LoDashImplicitWrapper<T> {
+ /**
+ * @see _.identity
+ */
+ identity(): T;
+ }
+
+ interface LoDashImplicitArrayWrapper<T> {
+ /**
+ * @see _.identity
+ */
+ identity(): T[];
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.identity
+ */
+ identity(): T;
+ }
+
+ //_.iteratee
+ interface LoDashStatic {
+ /**
+ * Creates a function that invokes `func` with the arguments of the created
+ * function. If `func` is a property name the created callback returns the
+ * property value for a given element. If `func` is an object the created
+ * callback returns `true` for elements that contain the equivalent object properties, otherwise it returns `false`.
+ *
+ * @static
+ * @memberOf _
+ * @category Util
+ * @param {*} [func=_.identity] The value to convert to a callback.
+ * @returns {Function} Returns the callback.
+ * @example
+ *
+ * var users = [
+ * { 'user': 'barney', 'age': 36 },
+ * { 'user': 'fred', 'age': 40 }
+ * ];
+ *
+ * // create custom iteratee shorthands
+ * _.iteratee = _.wrap(_.iteratee, function(callback, func) {
+ * var p = /^(\S+)\s*([<>])\s*(\S+)$/.exec(func);
+ * return !p ? callback(func) : function(object) {
+ * return (p[2] == '>' ? object[p[1]] > p[3] : object[p[1]] < p[3]);
+ * };
+ * });
+ *
+ * _.filter(users, 'age > 36');
+ * // => [{ 'user': 'fred', 'age': 40 }]
+ */
+ iteratee<TResult>(
+ func: Function,
+ thisArg?: any
+ ): (...args: any[]) => TResult;
+
+ /**
+ * @see _.iteratee
+ */
+ iteratee<TResult>(
+ func: string,
+ thisArg?: any
+ ): (object: any) => TResult;
+
+ /**
+ * @see _.iteratee
+ */
+ iteratee(
+ func: Object,
+ thisArg?: any
+ ): (object: any) => boolean;
+
+ /**
+ * @see _.iteratee
+ */
+ iteratee<TResult>(): (value: TResult) => TResult;
+ }
+
+ interface LoDashImplicitWrapper<T> {
+ /**
+ * @see _.iteratee
+ */
+ iteratee<TResult>(thisArg?: any): LoDashImplicitObjectWrapper<(object: any) => TResult>;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.iteratee
+ */
+ iteratee(thisArg?: any): LoDashImplicitObjectWrapper<(object: any) => boolean>;
+
+ /**
+ * @see _.iteratee
+ */
+ iteratee<TResult>(thisArg?: any): LoDashImplicitObjectWrapper<(...args: any[]) => TResult>;
+ }
+
+ interface LoDashExplicitWrapper<T> {
+ /**
+ * @see _.iteratee
+ */
+ iteratee<TResult>(thisArg?: any): LoDashExplicitObjectWrapper<(object: any) => TResult>;
+ }
+
+ interface LoDashExplicitObjectWrapper<T> {
+ /**
+ * @see _.iteratee
+ */
+ iteratee(thisArg?: any): LoDashExplicitObjectWrapper<(object: any) => boolean>;
+
+ /**
+ * @see _.iteratee
+ */
+ iteratee<TResult>(thisArg?: any): LoDashExplicitObjectWrapper<(...args: any[]) => TResult>;
+ }
+
+ //_.matches
+ interface LoDashStatic {
+ /**
+ * Creates a function that performs a deep comparison between a given object and source, returning true if the
+ * given object has equivalent property values, else false.
+ *
+ * Note: This method supports comparing arrays, booleans, Date objects, numbers, Object objects, regexes, and
+ * strings. Objects are compared by their own, not inherited, enumerable properties. For comparing a single own
+ * or inherited property value see _.matchesProperty.
+ *
+ * @param source The object of property values to match.
+ * @return Returns the new function.
+ */
+ matches<T>(source: T): (value: any) => boolean;
+
+ /**
+ * @see _.matches
+ */
+ matches<T, V>(source: T): (value: V) => boolean;
+ }
+
+ interface LoDashImplicitWrapperBase<T, TWrapper> {
+ /**
+ * @see _.matches
+ */
+ matches<V>(): LoDashImplicitObjectWrapper<(value: V) => boolean>;
+ }
+
+ interface LoDashExplicitWrapperBase<T, TWrapper> {
+ /**
+ * @see _.matches
+ */
+ matches<V>(): LoDashExplicitObjectWrapper<(value: V) => boolean>;
+ }
+
+ //_.matchesProperty
+ interface LoDashStatic {
+ /**
+ * Creates a function that compares the property value of path on a given object to value.
+ *
+ * Note: This method supports comparing arrays, booleans, Date objects, numbers, Object objects, regexes, and
+ * strings. Objects are compared by their own, not inherited, enumerable properties.
+ *
+ * @param path The path of the property to get.
+ * @param srcValue The value to match.
+ * @return Returns the new function.
+ */
+ matchesProperty<T>(
+ path: StringRepresentable|StringRepresentable[],
+ srcValue: T
+ ): (value: any) => boolean;
+
+ /**
+ * @see _.matchesProperty
+ */
+ matchesProperty<T, V>(
+ path: StringRepresentable|StringRepresentable[],
+ srcValue: T
+ ): (value: V) => boolean;
+ }
+
+ interface LoDashImplicitWrapperBase<T, TWrapper> {
+ /**
+ * @see _.matchesProperty
+ */
+ matchesProperty<SrcValue>(
+ srcValue: SrcValue
+ ): LoDashImplicitObjectWrapper<(value: any) => boolean>;
+
+ /**
+ * @see _.matchesProperty
+ */
+ matchesProperty<SrcValue, Value>(
+ srcValue: SrcValue
+ ): LoDashImplicitObjectWrapper<(value: Value) => boolean>;
+ }
+
+ interface LoDashExplicitWrapperBase<T, TWrapper> {
+ /**
+ * @see _.matchesProperty
+ */
+ matchesProperty<SrcValue>(
+ srcValue: SrcValue
+ ): LoDashExplicitObjectWrapper<(value: any) => boolean>;
+
+ /**
+ * @see _.matchesProperty
+ */
+ matchesProperty<SrcValue, Value>(
+ srcValue: SrcValue
+ ): LoDashExplicitObjectWrapper<(value: Value) => boolean>;
+ }
+
+ //_.method
+ interface LoDashStatic {
+ /**
+ * Creates a function that invokes the method at path on a given object. Any additional arguments are provided
+ * to the invoked method.
+ *
+ * @param path The path of the method to invoke.
+ * @param args The arguments to invoke the method with.
+ * @return Returns the new function.
+ */
+ method<TObject, TResult>(
+ path: string|StringRepresentable[],
+ ...args: any[]
+ ): (object: TObject) => TResult;
+
+ /**
+ * @see _.method
+ */
+ method<TResult>(
+ path: string|StringRepresentable[],
+ ...args: any[]
+ ): (object: any) => TResult;
+ }
+
+ interface LoDashImplicitWrapper<T> {
+ /**
+ * @see _.method
+ */
+ method<TObject, TResult>(...args: any[]): LoDashImplicitObjectWrapper<(object: TObject) => TResult>;
+
+ /**
+ * @see _.method
+ */
+ method<TResult>(...args: any[]): LoDashImplicitObjectWrapper<(object: any) => TResult>;
+ }
+
+ interface LoDashImplicitArrayWrapper<T> {
+ /**
+ * @see _.method
+ */
+ method<TObject, TResult>(...args: any[]): LoDashImplicitObjectWrapper<(object: TObject) => TResult>;
+
+ /**
+ * @see _.method
+ */
+ method<TResult>(...args: any[]): LoDashImplicitObjectWrapper<(object: any) => TResult>;
+ }
+
+ interface LoDashExplicitWrapper<T> {
+ /**
+ * @see _.method
+ */
+ method<TObject, TResult>(...args: any[]): LoDashExplicitObjectWrapper<(object: TObject) => TResult>;
+
+ /**
+ * @see _.method
+ */
+ method<TResult>(...args: any[]): LoDashExplicitObjectWrapper<(object: any) => TResult>;
+ }
+
+ interface LoDashExplicitArrayWrapper<T> {
+ /**
+ * @see _.method
+ */
+ method<TObject, TResult>(...args: any[]): LoDashExplicitObjectWrapper<(object: TObject) => TResult>;
+
+ /**
+ * @see _.method
+ */
+ method<TResult>(...args: any[]): LoDashExplicitObjectWrapper<(object: any) => TResult>;
+ }
+
+ //_.methodOf
+ interface LoDashStatic {
+ /**
+ * The opposite of _.method; this method creates a function that invokes the method at a given path on object.
+ * Any additional arguments are provided to the invoked method.
+ *
+ * @param object The object to query.
+ * @param args The arguments to invoke the method with.
+ * @return Returns the new function.
+ */
+ methodOf<TObject extends {}, TResult>(
+ object: TObject,
+ ...args: any[]
+ ): (path: StringRepresentable|StringRepresentable[]) => TResult;
+
+ /**
+ * @see _.methodOf
+ */
+ methodOf<TResult>(
+ object: {},
+ ...args: any[]
+ ): (path: StringRepresentable|StringRepresentable[]) => TResult;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.methodOf
+ */
+ methodOf<TResult>(
+ ...args: any[]
+ ): LoDashImplicitObjectWrapper<(path: StringRepresentable|StringRepresentable[]) => TResult>;
+ }
+
+ interface LoDashExplicitObjectWrapper<T> {
+ /**
+ * @see _.methodOf
+ */
+ methodOf<TResult>(
+ ...args: any[]
+ ): LoDashExplicitObjectWrapper<(path: StringRepresentable|StringRepresentable[]) => TResult>;
+ }
+
+ //_.mixin
+ interface MixinOptions {
+ chain?: boolean;
+ }
+
+ interface LoDashStatic {
+ /**
+ * Adds all own enumerable function properties of a source object to the destination object. If object is a
+ * function then methods are added to its prototype as well.
+ *
+ * Note: Use _.runInContext to create a pristine lodash function to avoid conflicts caused by modifying
+ * the original.
+ *
+ * @param object The destination object.
+ * @param source The object of functions to add.
+ * @param options The options object.
+ * @param options.chain Specify whether the functions added are chainable.
+ * @return Returns object.
+ */
+ mixin<TResult, TObject>(
+ object: TObject,
+ source: Dictionary<Function>,
+ options?: MixinOptions
+ ): TResult;
+
+ /**
+ * @see _.mixin
+ */
+ mixin<TResult>(
+ source: Dictionary<Function>,
+ options?: MixinOptions
+ ): TResult;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.mixin
+ */
+ mixin<TResult>(
+ source: Dictionary<Function>,
+ options?: MixinOptions
+ ): LoDashImplicitObjectWrapper<TResult>;
+
+ /**
+ * @see _.mixin
+ */
+ mixin<TResult>(
+ options?: MixinOptions
+ ): LoDashImplicitObjectWrapper<TResult>;
+ }
+
+ interface LoDashExplicitObjectWrapper<T> {
+ /**
+ * @see _.mixin
+ */
+ mixin<TResult>(
+ source: Dictionary<Function>,
+ options?: MixinOptions
+ ): LoDashExplicitObjectWrapper<TResult>;
+
+ /**
+ * @see _.mixin
+ */
+ mixin<TResult>(
+ options?: MixinOptions
+ ): LoDashExplicitObjectWrapper<TResult>;
+ }
+
+ //_.noConflict
+ interface LoDashStatic {
+ /**
+ * Reverts the _ variable to its previous value and returns a reference to the lodash function.
+ *
+ * @return Returns the lodash function.
+ */
+ noConflict(): typeof _;
+ }
+
+ interface LoDashImplicitWrapperBase<T, TWrapper> {
+ /**
+ * @see _.noConflict
+ */
+ noConflict(): typeof _;
+ }
+
+ //_.noop
+ interface LoDashStatic {
+ /**
+ * A no-operation function that returns undefined regardless of the arguments it receives.
+ *
+ * @return undefined
+ */
+ noop(...args: any[]): void;
+ }
+
+ interface LoDashImplicitWrapperBase<T, TWrapper> {
+ /**
+ * @see _.noop
+ */
+ noop(...args: any[]): void;
+ }
+
+ interface LoDashExplicitWrapperBase<T, TWrapper> {
+ /**
+ * @see _.noop
+ */
+ noop(...args: any[]): _.LoDashExplicitWrapper<void>;
+ }
+
+ //_.property
+ interface LoDashStatic {
+ /**
+ * Creates a function that returns the property value at path on a given object.
+ *
+ * @param path The path of the property to get.
+ * @return Returns the new function.
+ */
+ property<TObj, TResult>(path: StringRepresentable|StringRepresentable[]): (obj: TObj) => TResult;
+ }
+
+ interface LoDashImplicitWrapper<T> {
+ /**
+ * @see _.property
+ */
+ property<TObj, TResult>(): LoDashImplicitObjectWrapper<(obj: TObj) => TResult>;
+ }
+
+ interface LoDashImplicitArrayWrapper<T> {
+ /**
+ * @see _.property
+ */
+ property<TObj, TResult>(): LoDashImplicitObjectWrapper<(obj: TObj) => TResult>;
+ }
+
+ interface LoDashExplicitWrapper<T> {
+ /**
+ * @see _.property
+ */
+ property<TObj, TResult>(): LoDashExplicitObjectWrapper<(obj: TObj) => TResult>;
+ }
+
+ interface LoDashExplicitArrayWrapper<T> {
+ /**
+ * @see _.property
+ */
+ property<TObj, TResult>(): LoDashExplicitObjectWrapper<(obj: TObj) => TResult>;
+ }
+
+ //_.propertyOf
+ interface LoDashStatic {
+ /**
+ * The opposite of _.property; this method creates a function that returns the property value at a given path
+ * on object.
+ *
+ * @param object The object to query.
+ * @return Returns the new function.
+ */
+ propertyOf<T extends {}>(object: T): (path: string|string[]) => any;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.propertyOf
+ */
+ propertyOf(): LoDashImplicitObjectWrapper<(path: string|string[]) => any>;
+ }
+
+ interface LoDashExplicitObjectWrapper<T> {
+ /**
+ * @see _.propertyOf
+ */
+ propertyOf(): LoDashExplicitObjectWrapper<(path: string|string[]) => any>;
+ }
+
+ //_.range
+ interface LoDashStatic {
+ /**
+ * Creates an array of numbers (positive and/or negative) progressing from start up to, but not including, end.
+ * If end is not specified it’s set to start with start then set to 0. If end is less than start a zero-length
+ * range is created unless a negative step is specified.
+ *
+ * @param start The start of the range.
+ * @param end The end of the range.
+ * @param step The value to increment or decrement by.
+ * @return Returns a new range array.
+ */
+ range(
+ start: number,
+ end: number,
+ step?: number
+ ): number[];
+
+ /**
+ * @see _.range
+ */
+ range(
+ end: number,
+ step?: number
+ ): number[];
+ }
+
+ interface LoDashImplicitWrapper<T> {
+ /**
+ * @see _.range
+ */
+ range(
+ end?: number,
+ step?: number
+ ): LoDashImplicitArrayWrapper<number>;
+ }
+
+ interface LoDashExplicitWrapper<T> {
+ /**
+ * @see _.range
+ */
+ range(
+ end?: number,
+ step?: number
+ ): LoDashExplicitArrayWrapper<number>;
+ }
+
+ //_.rangeRight
+ interface LoDashStatic {
+ /**
+ * This method is like `_.range` except that it populates values in
+ * descending order.
+ *
+ * @static
+ * @memberOf _
+ * @category Util
+ * @param {number} [start=0] The start of the range.
+ * @param {number} end The end of the range.
+ * @param {number} [step=1] The value to increment or decrement by.
+ * @returns {Array} Returns the new array of numbers.
+ * @example
+ *
+ * _.rangeRight(4);
+ * // => [3, 2, 1, 0]
+ *
+ * _.rangeRight(-4);
+ * // => [-3, -2, -1, 0]
+ *
+ * _.rangeRight(1, 5);
+ * // => [4, 3, 2, 1]
+ *
+ * _.rangeRight(0, 20, 5);
+ * // => [15, 10, 5, 0]
+ *
+ * _.rangeRight(0, -4, -1);
+ * // => [-3, -2, -1, 0]
+ *
+ * _.rangeRight(1, 4, 0);
+ * // => [1, 1, 1]
+ *
+ * _.rangeRight(0);
+ * // => []
+ */
+ rangeRight(
+ start: number,
+ end: number,
+ step?: number
+ ): number[];
+
+ /**
+ * @see _.rangeRight
+ */
+ rangeRight(
+ end: number,
+ step?: number
+ ): number[];
+ }
+
+ interface LoDashImplicitWrapper<T> {
+ /**
+ * @see _.rangeRight
+ */
+ rangeRight(
+ end?: number,
+ step?: number
+ ): LoDashImplicitArrayWrapper<number>;
+ }
+
+ interface LoDashExplicitWrapper<T> {
+ /**
+ * @see _.rangeRight
+ */
+ rangeRight(
+ end?: number,
+ step?: number
+ ): LoDashExplicitArrayWrapper<number>;
+ }
+
+ //_.runInContext
+ interface LoDashStatic {
+ /**
+ * Create a new pristine lodash function using the given context object.
+ *
+ * @param context The context object.
+ * @return Returns a new lodash function.
+ */
+ runInContext(context?: Object): typeof _;
+ }
+
+ interface LoDashImplicitObjectWrapper<T> {
+ /**
+ * @see _.runInContext
+ */
+ runInContext(): typeof _;
+ }
+
+ //_.times
+ interface LoDashStatic {
+ /**
+ * Invokes the iteratee function n times, returning an array of the results of each invocation. The iteratee is
+ * bound to thisArg and invoked with one argument; (index).
+ *
+ * @param n The number of times to invoke iteratee.
+ * @param iteratee The function invoked per iteration.
+ * @param thisArg The this binding of iteratee.
+ * @return Returns the array of results.
+ */
+ times<TResult>(
+ n: number,
+ iteratee: (num: number) => TResult,
+ thisArg?: any
+ ): TResult[];
+
+ /**
+ * @see _.times
+ */
+ times(n: number): number[];
+ }
+
+ interface LoDashImplicitWrapper<T> {
+ /**
+ * @see _.times
+ */
+ times<TResult>(
+ iteratee: (num: number) => TResult,
+ thisArgs?: any
+ ): LoDashImplicitArrayWrapper<TResult>;
+
+ /**
+ * @see _.times
+ */
+ times(): LoDashImplicitArrayWrapper<number>;
+ }
+
+ interface LoDashExplicitWrapper<T> {
+ /**
+ * @see _.times
+ */
+ times<TResult>(
+ iteratee: (num: number) => TResult,
+ thisArgs?: any
+ ): LoDashExplicitArrayWrapper<TResult>;
+
+ /**
+ * @see _.times
+ */
+ times(): LoDashExplicitArrayWrapper<number>;
+ }
+
+ //_.toPath
+ interface LoDashStatic {
+ /**
+ * Converts `value` to a property path array.
+ *
+ * @static
+ * @memberOf _
+ * @category Util
+ * @param {*} value The value to convert.
+ * @returns {Array} Returns the new property path array.
+ * @example
+ *
+ * _.toPath('a.b.c');
+ * // => ['a', 'b', 'c']
+ *
+ * _.toPath('a[0].b.c');
+ * // => ['a', '0', 'b', 'c']
+ *
+ * var path = ['a', 'b', 'c'],
+ * newPath = _.toPath(path);
+ *
+ * console.log(newPath);
+ * // => ['a', 'b', 'c']
+ *
+ * console.log(path === newPath);
+ * // => false
+ */
+ toPath(value: any): string[];
+ }
+
+ interface LoDashImplicitWrapperBase<T, TWrapper> {
+ /**
+ * @see _.toPath
+ */
+ toPath(): LoDashImplicitWrapper<string[]>;
+ }
+
+ interface LoDashExplicitWrapperBase<T, TWrapper> {
+ /**
+ * @see _.toPath
+ */
+ toPath(): LoDashExplicitWrapper<string[]>;
+ }
+
+ //_.uniqueId
+ interface LoDashStatic {
+ /**
+ * Generates a unique ID. If prefix is provided the ID is appended to it.
+ *
+ * @param prefix The value to prefix the ID with.
+ * @return Returns the unique ID.
+ */
+ uniqueId(prefix?: string): string;
+ }
+
+ interface LoDashImplicitWrapper<T> {
+ /**
+ * @see _.uniqueId
+ */
+ uniqueId(): string;
+ }
+
+ interface LoDashExplicitWrapper<T> {
+ /**
+ * @see _.uniqueId
+ */
+ uniqueId(): LoDashExplicitWrapper<string>;
+ }
+
+ interface ListIterator<T, TResult> {
+ (value: T, index: number, collection: List<T>): TResult;
+ }
+
+ interface DictionaryIterator<T, TResult> {
+ (value: T, key?: string, collection?: Dictionary<T>): TResult;
+ }
+
+ interface NumericDictionaryIterator<T, TResult> {
+ (value: T, key?: number, collection?: Dictionary<T>): TResult;
+ }
+
+ interface ObjectIterator<T, TResult> {
+ (element: T, key?: string, collection?: any): TResult;
+ }
+
+ interface StringIterator<TResult> {
+ (char: string, index?: number, string?: string): TResult;
+ }
+
+ interface MemoVoidIterator<T, TResult> {
+ (prev: TResult, curr: T, indexOrKey?: any, list?: T[]): void;
+ }
+ interface MemoIterator<T, TResult> {
+ (prev: TResult, curr: T, indexOrKey?: any, list?: T[]): TResult;
+ }
+
+ interface MemoVoidArrayIterator<T, TResult> {
+ (acc: TResult, curr: T, index?: number, arr?: T[]): void;
+ }
+ interface MemoVoidDictionaryIterator<T, TResult> {
+ (acc: TResult, curr: T, key?: string, dict?: Dictionary<T>): void;
+ }
+
+ //interface Collection<T> {}
+
+ // Common interface between Arrays and jQuery objects
+ interface List<T> {
+ [index: number]: T;
+ length: number;
+ }
+
+ interface Dictionary<T> {
+ [index: string]: T;
+ }
+
+ interface NumericDictionary<T> {
+ [index: number]: T;
+ }
+
+ interface StringRepresentable {
+ toString(): string;
+ }
+
+ interface Cancelable {
+ cancel(): void;
+ }
+}
+
+declare module "lodash" {
+ export = _;
+}
diff --git a/lib/decl/mithril.d.ts b/lib/decl/mithril.d.ts
new file mode 100644
index 000000000..c45633490
--- /dev/null
+++ b/lib/decl/mithril.d.ts
@@ -0,0 +1,926 @@
+// Mithril type definitions for Typescript
+
+/**
+* This is the module containing all the types/declarations/etc. for Mithril
+*/
+declare module _mithril {
+ interface MithrilStatic {
+ /**
+ * Creates a virtual element for use with m.render, m.mount, etc.
+ *
+ * @param selector A simple CSS selector. May include SVG tags. Nested
+ * selectors are not supported.
+ * @param attributes Attributes to add. Any DOM attribute may be used
+ * as an attribute, although innerHTML and the like may be overwritten
+ * silently.
+ * @param children Child elements, components, and text to add.
+ * @return A virtual element.
+ *
+ * @see m.render
+ * @see m.mount
+ * @see m.component
+ */
+ <T extends MithrilController>(
+ selector: string,
+ attributes: MithrilAttributes,
+ ...children: Array<string |
+ MithrilVirtualElement<T> |
+ MithrilComponent<T>>
+ ): MithrilVirtualElement<T>;
+
+ /**
+ * Initializes a component for use with m.render, m.mount, etc.
+ *
+ * @param component A component.
+ * @param args Arguments to optionally pass to the component.
+ * @return A component.
+ *
+ * @see m.render
+ * @see m.mount
+ * @see m
+ */
+ <T extends MithrilController>(
+ component: MithrilComponent<T>,
+ ...args: any[]
+ ): MithrilComponent<T>;
+
+ /**
+ * Creates a virtual element for use with m.render, m.mount, etc.
+ *
+ * @param selector A simple CSS selector. Nested selectors are not
+ * supported.
+ * @param children Child elements, components, and text to add.
+ * @return A virtual element.
+ *
+ * @see m.render
+ * @see m.mount
+ * @see m.component
+ */
+ <T extends MithrilController>(
+ selector: string,
+ ...children: Array<string |
+ MithrilVirtualElement<T> |
+ MithrilComponent<T>>
+ ): MithrilVirtualElement<T>;
+
+ /**
+ * Initializes a component for use with m.render, m.mount, etc.
+ * Shorthand for m.component.
+ *
+ * @param selector A component.
+ * @param args Arguments to optionally pass to the component.
+ * @return A component.
+ *
+ * @see m.render
+ * @see m.mount
+ * @see m.component
+ */
+ <T extends MithrilController>(
+ component: MithrilComponent<T>,
+ ...args: any[]
+ ): MithrilComponent<T>;
+
+ /**
+ * Creates a getter-setter function that wraps a Mithril promise. Useful
+ * for uniform data access, m.withAttr, etc.
+ *
+ * @param promise A thennable to initialize the property with. It may
+ * optionally be a Mithril promise.
+ * @return A getter-setter function wrapping the promise.
+ *
+ * @see m.withAttr
+ */
+ prop<T>(promise: Thennable<T>) : MithrilPromiseProperty<T>;
+
+ /**
+ * Creates a getter-setter function that wraps a simple value. Useful
+ * for uniform data access, m.withAttr, etc.
+ *
+ * @param value A value to initialize the property with
+ * @return A getter-setter function wrapping the value.
+ *
+ * @see m.withAttr
+ */
+ prop<T>(value: T): MithrilBasicProperty<T>;
+
+ /**
+ * Creates a getter-setter function that wraps a simple value. Useful
+ * for uniform data access, m.withAttr, etc.
+ *
+ * @return A getter-setter function wrapping the value.
+ *
+ * @see m.withAttr
+ */
+ prop<T>(): MithrilBasicProperty<T>;
+
+ /**
+ * Returns a event handler that can be bound to an element, firing with
+ * the specified property.
+ *
+ * @param property The property to get from the event.
+ * @param callback The handler to use the value from the event.
+ * @return A function suitable for listening to an event.
+ */
+ withAttr(
+ property: string,
+ callback: (value: any) => void,
+ callbackThis: any
+ ): (e: Event) => any;
+
+ /**
+ * Returns a event handler that can be bound to an element, firing with
+ * the specified property.
+ *
+ * @param attributeName Name of the element's attribute to bind to.
+ * @param property The property to bind.
+ * @return A function suitable for listening to an event.
+ */
+ withAttr<T>(
+ attributeName: string,
+ property: MithrilBasicProperty<T>
+ ) : (e: Event) => any;
+
+ /**
+ * @deprecated Use m.mount instead
+ */
+ module<T extends MithrilController>(
+ rootElement: Node,
+ component: MithrilComponent<T>
+ ): T;
+
+ /**
+ * Mounts a component to a base DOM node.
+ *
+ * @param rootElement The base node.
+ * @param component The component to mount.
+ * @return An instance of the top-level component's controller
+ */
+ mount<T extends MithrilController>(
+ rootElement: Node,
+ component: MithrilComponent<T>
+ ): T;
+
+ /**
+ * Initializes a component for use with m.render, m.mount, etc.
+ *
+ * @param selector A component.
+ * @param args Arguments to optionally pass to the component.
+ * @return A component.
+ *
+ * @see m.render
+ * @see m.mount
+ * @see m
+ */
+ component<T extends MithrilController>(
+ component: MithrilComponent<T>,
+ ...args: any[]
+ ): MithrilComponent<T>;
+
+ /**
+ * Trust this string of HTML.
+ *
+ * @param html The HTML to trust
+ * @return A String object instance with an added internal flag to mark
+ * it as trusted.
+ */
+ trust(html: string): MithrilTrustedString;
+
+ /**
+ * Render a virtual DOM tree.
+ *
+ * @param rootElement The base element/node to render the tree from.
+ * @param children One or more child nodes to add to the tree.
+ * @param forceRecreation If true, overwrite the entire tree without
+ * diffing against it.
+ */
+ render<T extends MithrilController>(
+ rootElement: Element,
+ children: MithrilVirtualElement<T>|MithrilVirtualElement<T>[],
+ forceRecreation?: boolean
+ ): void;
+
+ redraw: {
+ /**
+ * Force a redraw the active component. It redraws asynchronously by
+ * default to allow for simultaneous events to run before redrawing,
+ * such as the event combination keypress + input frequently used for
+ * input.
+ *
+ * @param force If true, redraw synchronously.
+ */
+ (force?: boolean): void;
+
+ strategy: {
+ /**
+ * Gets the current redraw strategy, which returns one of the
+ * following:
+ *
+ * "all" - recreates the DOM tree from scratch
+ * "diff" - recreates the DOM tree from scratch
+ * "none" - leaves the DOM tree intact
+ *
+ * This is useful for event handlers, which may want to cancel
+ * the next redraw if the event doesn't update the UI.
+ *
+ * @return The current strategy
+ */
+ (): string;
+
+ /**
+ * Sets the current redraw strategy. The parameter must be one of
+ * the following values:
+ *
+ * "all" - recreates the DOM tree from scratch
+ * "diff" - recreates the DOM tree from scratch
+ * "none" - leaves the DOM tree intact
+ *
+ * This is useful for event handlers, which may want to cancel
+ * the next redraw if the event doesn't update the UI.
+ *
+ * @param value The value to set
+ * @return The new strategy
+ */
+ (value: string): string;
+
+ /**
+ * @private
+ * Implementation detail - it's a MithrilBasicProperty instance
+ */
+ toJSON(): string;
+ }
+ }
+
+ route: {
+ /**
+ * Enable routing, mounting a controller based on the route. It
+ * automatically mounts the components for you, starting with the one
+ * specified by the default route.
+ *
+ * @param rootElement The element to mount the active controller to.
+ * @param defaultRoute The route to start with.
+ * @param routes A key-value mapping of pathname to controller.
+ */
+ <T extends MithrilController>(
+ rootElement: Element,
+ defaultRoute: string,
+ routes: MithrilRoutes
+ ): void;
+
+ /**
+ * This allows m.route to be used as the `config` attribute for a
+ * virtual element, particularly useful for cases like this:
+ *
+ * ```ts
+ * // Note that the '#' is not required in `href`, thanks to the
+ * `config` setting.
+ * m("a[href='/dashboard/alicesmith']", {config: m.route});
+ * ```
+ */
+ <T extends MithrilController>(
+ element: Element,
+ isInitialized: boolean,
+ context?: MithrilContext,
+ vdom?: MithrilVirtualElement<T>
+ ): void;
+
+ /**
+ * Programmatically redirect to another route.
+ *
+ * @param path The route to go to.
+ * @param params Parameters to pass as a query string.
+ * @param shouldReplaceHistory Whether to replace the current history
+ * instead of adding a new one.
+ */
+ (path: string, params?: any, shouldReplaceHistory?: boolean): void;
+
+ /**
+ * Gets the current route.
+ *
+ * @return The current route.
+ */
+ (): string;
+
+ /**
+ * Gets a route parameter.
+ *
+ * @param key The key to get.
+ * @return The value associated with the parameter key.
+ */
+ param(key: string): string;
+
+ /**
+ * The current routing mode. This may be changed before calling
+ * m.route to change the part of the URL used to perform the routing.
+ *
+ * The value can be set to one of the following, defaulting to
+ * "hash":
+ *
+ * "search" - Uses the query string. This allows for named anchors to
+ * work on the page, but changes cause IE8 and lower to refresh the
+ * page.
+ *
+ * "hash" - Uses the hash. This is the only routing mode that does
+ * not cause page refreshes on any browser, but it does not support
+ * named anchors.
+ *
+ * "pathname" - Uses the URL pathname. This requires server-side
+ * setup to support bookmarking and page refreshes. It always causes
+ * page refreshes on IE8 and lower. Note that this requires that the
+ * application to be run from the root of the URL.
+ */
+ mode: string;
+
+ /**
+ * Serialize an object into a query string.
+ *
+ * @param data The data to serialize.
+ * @return The serialized string.
+ */
+ buildQueryString(data: Object): String
+
+ /**
+ * Parse a query string into an object.
+ *
+ * @param data The data to parse.
+ * @return The parsed object data.
+ */
+ parseQueryString(data: String): Object
+ }
+
+ /**
+ * Send a request to a server to server. Note that the `url` option is
+ * required.
+ *
+ * @param options The options to use
+ * @return A promise to the returned data for "GET" requests, or a void
+ * promise for any other request type.
+ *
+ * @see MithrilXHROptions for the available options.
+ */
+ request<T>(options: MithrilXHROptions<T>): MithrilPromise<T>;
+
+ deferred: {
+ /**
+ * Create a Mithril deferred object. It behaves synchronously if
+ * possible, an intentional deviation from Promises/A+. Note that
+ * deferreds are completely separate from the redrawing system, and
+ * never trigger a redraw on their own.
+ *
+ * @return A new Mithril deferred instance.
+ *
+ * @see m.deferred.onerror for the error callback called for Error
+ * subclasses
+ */
+ <T>(): MithrilDeferred<T>;
+
+ /**
+ * A callback for all uncaught native Error subclasses in deferreds.
+ * This defaults to synchronously rethrowing all errors, a deviation
+ * from Promises/A+, but the behavior is configurable. To restore
+ * Promises/A+-compatible behavior. simply set this to a no-op.
+ */
+ onerror(e: Error): void;
+ }
+
+ /**
+ * Takes a list of promises or thennables and returns a Mithril promise
+ * that resolves once all in the list are resolved, or rejects if any of
+ * them reject.
+ *
+ * @param promises A list of promises to try to resolve.
+ * @return A promise that resolves to all the promises if all resolve, or
+ * rejects with the error contained in the first rejection.
+ */
+ sync<T>(promises: Thennable<T>[]): MithrilPromise<T[]>;
+
+ /**
+ * Use this and endComputation if your views aren't redrawing after
+ * calls to third-party libraries. For integrating asynchronous code,
+ * this should be called before any asynchronous work is done. For
+ * synchronous code, this should be called at the beginning of the
+ * problematic segment. Note that these calls must be balanced, much like
+ * braces and parentheses. This is mostly used internally. Prefer
+ * m.redraw where possible, especially when making repeated calls.
+ *
+ * @see endComputation
+ * @see m.render
+ */
+ startComputation(): void;
+
+ /**
+ * Use startComputation and this if your views aren't redrawing after
+ * calls to third-party libraries. For integrating asynchronous code,
+ * this should be called after all asynchronous work completes. For
+ * synchronous code, this should be called at the end of the problematic
+ * segment. Note that these calls must be balanced, much like braces and
+ * parentheses. This is mostly used internally. Prefer m.redraw where
+ * possible, especially when making repeated calls.
+ *
+ * @see startComputation
+ * @see m.render
+ */
+ endComputation(): void;
+
+ /**
+ * This overwrites the internal version of window used by Mithril.
+ * It's mostly useful for testing, and is also used internally by
+ * Mithril to test itself. By default Mithril uses `window` for the
+ * dependency.
+ *
+ * @param mockWindow The mock to use for the window.
+ * @return The mock that was passed in.
+ */
+ deps(mockWindow: Window): Window;
+ }
+
+ interface MithrilTrustedString extends String {
+ /** @private Implementation detail. Don't depend on it. */
+ $trusted: boolean;
+ }
+
+ /**
+ * The interface for a virtual element. It's best to consider this immutable
+ * for most use cases.
+ *
+ * @see m
+ */
+ interface MithrilVirtualElement<T extends MithrilController> {
+ /**
+ * A key to optionally associate with this element.
+ */
+ key?: number;
+
+ /**
+ * The tag name of this element.
+ */
+ tag?: string;
+
+ /**
+ * The attributes of this element.
+ */
+ attrs?: MithrilAttributes;
+
+ /**
+ * The children of this element.
+ */
+ children?: Array<string|MithrilVirtualElement<T>|MithrilComponent<T>>;
+ }
+
+ /**
+ * An event passed by Mithril to unload event handlers.
+ */
+ interface MithrilEvent {
+ /**
+ * Prevent the default behavior of scrolling the page and updating the
+ * URL on next route change.
+ */
+ preventDefault(): void;
+ }
+
+ /**
+ * A context object for configuration functions.
+ *
+ * @see MithrilElementConfig
+ */
+ interface MithrilContext {
+ /**
+ * A function to call when the node is unloaded. Useful for cleanup.
+ */
+ onunload?(): any;
+
+ /**
+ * Set true if the backing DOM node needs to be retained between route
+ * changes if possible. Set false if this node needs to be recreated
+ * every single time, regardless of how "different" it is.
+ */
+ retain?: boolean;
+ }
+
+ /**
+ * This represents a callback function for a virtual element's config
+ * attribute. It's a low-level function useful for extra cleanup after
+ * removal from the tree, storing instances of third-party classes that
+ * need to be associated with the DOM, etc.
+ *
+ * @see MithrilAttributes
+ * @see MithrilContext
+ */
+ interface MithrilElementConfig {
+ /**
+ * A callback function for a virtual element's config attribute.
+ *
+ * @param element The associated DOM element.
+ * @param isInitialized Whether this is the first call for the virtual
+ * element or not.
+ * @param context The associated context for this element.
+ * @param vdom The associated virtual element.
+ */
+ <T extends MithrilController>(
+ element: Element,
+ isInitialized: boolean,
+ context: MithrilContext,
+ vdom: MithrilVirtualElement<T>
+ ): void;
+ }
+
+ /**
+ * This represents the attributes available for configuring virtual elements,
+ * beyond the applicable DOM attributes.
+ *
+ * @see m
+ */
+ interface MithrilAttributes {
+ /**
+ * The class name(s) for this virtual element, as a space-separated list.
+ */
+ className?: string;
+
+ /**
+ * The class name(s) for this virtual element, as a space-separated list.
+ */
+ class?: string;
+
+ /**
+ * A custom, low-level configuration in case this element needs special
+ * cleanup after removal from the tree.
+ *
+ * @see MithrilElementConfig
+ */
+ config?: MithrilElementConfig;
+
+ /**
+ * Any other virtual element properties including attributes and
+ * event handlers
+ */
+ [property: string]: any;
+ }
+
+ /**
+ * The basis of a Mithril controller instance.
+ */
+ interface MithrilController {
+ /**
+ * An optional handler to call when the associated virtual element is
+ * destroyed.
+ *
+ * @param evt An associated event.
+ */
+ onunload?(evt: MithrilEvent): any;
+ }
+
+ /**
+ * This represents a controller function.
+ *
+ * @see MithrilControllerConstructor
+ */
+ interface MithrilControllerFunction<T extends MithrilController> {
+ (opts?: any): T;
+ }
+
+ /**
+ * This represents a controller constructor.
+ *
+ * @see MithrilControllerFunction
+ */
+ interface MithrilControllerConstructor<T extends MithrilController> {
+ new(): T;
+ }
+
+ /**
+ * This represents a view factory.
+ */
+ interface MithrilView<T extends MithrilController> {
+ /**
+ * Creates a view out of virtual elements.
+ */
+ (ctrl: T): MithrilVirtualElement<T>;
+ }
+
+ /**
+ * This represents a Mithril component.
+ *
+ * @see m
+ * @see m.component
+ */
+ interface MithrilComponent<T extends MithrilController> {
+ /**
+ * The component's controller.
+ *
+ * @see m.component
+ */
+ controller?: MithrilControllerFunction<T> |
+ MithrilControllerConstructor<T>;
+
+ /**
+ * Creates a view out of virtual elements.
+ *
+ * @see m.component
+ */
+ view(ctrl?: T, opts?: any): MithrilVirtualElement<T>;
+ }
+
+ /**
+ * This is the base interface for property getter-setters
+ *
+ * @see m.prop
+ */
+ interface MithrilProperty<T> {
+ /**
+ * Gets the contained value.
+ *
+ * @return The contained value.
+ */
+ (): T;
+
+ /**
+ * Sets the contained value.
+ *
+ * @param value The new value to set.
+ * @return The newly set value.
+ */
+ (value: T): T;
+ }
+
+ /**
+ * This represents a non-promise getter-setter functions.
+ *
+ * @see m.prop which returns objects that implement this interface.
+ */
+ interface MithrilBasicProperty<T> extends MithrilProperty<T> {
+ /**
+ * Makes this serializable to JSON.
+ */
+ toJSON(): T;
+ }
+
+ /**
+ * This represents a promise getter-setter function.
+ *
+ * @see m.prop which returns objects that implement this interface.
+ */
+ interface MithrilPromiseProperty<T> extends MithrilPromise<T>,
+ MithrilProperty<MithrilPromise<T>> {
+ /**
+ * Gets the contained promise.
+ *
+ * @return The contained value.
+ */
+ (): MithrilPromise<T>;
+
+ /**
+ * Sets the contained promise.
+ *
+ * @param value The new value to set.
+ * @return The newly set value.
+ */
+ (value: MithrilPromise<T>): MithrilPromise<T>;
+
+ /**
+ * Sets the contained wrapped value.
+ *
+ * @param value The new value to set.
+ * @return The newly set value.
+ */
+ (value: T): MithrilPromise<T>;
+ }
+
+ /**
+ * This represents a key-value mapping linking routes to components.
+ */
+ interface MithrilRoutes {
+ /**
+ * The key represents the route. The value represents the corresponding
+ * component.
+ */
+ [key: string]: MithrilComponent<MithrilController>;
+ }
+
+ /**
+ * This represents a Mithril deferred object.
+ */
+ interface MithrilDeferred<T> {
+ /**
+ * Resolve this deferred's promise with a value.
+ *
+ * @param value The value to resolve the promise with.
+ */
+ resolve(value?: T): void;
+
+ /**
+ * Reject this deferred with an error.
+ *
+ * @param value The reason for rejecting the promise.
+ */
+ reject(reason?: any): void;
+
+ /**
+ * The backing promise.
+ *
+ * @see MithrilPromise
+ */
+ promise: MithrilPromise<T>;
+ }
+
+ /**
+ * This represents a thennable success callback.
+ */
+ interface MithrilSuccessCallback<T, U> {
+ (value: T): U | Thennable<U>;
+ }
+
+ /**
+ * This represents a thennable error callback.
+ */
+ interface MithrilErrorCallback<T> {
+ (value: Error): T | Thennable<T>;
+ }
+
+ /**
+ * This represents a thennable.
+ */
+ interface Thennable<T> {
+ then<U>(success: (value: T) => U): Thennable<U>;
+ then<U,V>(success: (value: T) => U, error: (value: Error) => V): Thennable<U>|Thennable<V>;
+ catch?: <U>(error: (value: Error) => U) => Thennable<U>;
+ }
+
+ /**
+ * This represents a Mithril promise object.
+ */
+ interface MithrilPromise<T> extends Thennable<T>, MithrilProperty<MithrilPromise<T>> {
+ /**
+ * Chain this promise with a simple success callback, propogating
+ * rejections.
+ *
+ * @param success The callback to call when the promise is resolved.
+ * @return The chained promise.
+ */
+ then<U>(success: MithrilSuccessCallback<T,U>): MithrilPromise<U>;
+
+ /**
+ * Chain this promise with a success callback and error callback, without
+ * propogating rejections.
+ *
+ * @param success The callback to call when the promise is resolved.
+ * @param error The callback to call when the promise is rejected.
+ * @return The chained promise.
+ */
+ then<U, V>(
+ success: MithrilSuccessCallback<T, U>,
+ error: MithrilErrorCallback<V>
+ ): MithrilPromise<U> | MithrilPromise<V>;
+
+ /**
+ * Chain this promise with a single error callback, without propogating
+ * rejections.
+ *
+ * @param error The callback to call when the promise is rejected.
+ * @return The chained promise.
+ */
+ catch<U>(error: MithrilErrorCallback<U>): MithrilPromise<T> |
+ MithrilPromise<U>;
+ }
+
+ /**
+ * This represents the available options for configuring m.request.
+ *
+ * @see m.request
+ */
+ interface MithrilXHROptions<T> {
+ /**
+ * This represents the HTTP method used, one of the following:
+ *
+ * - "GET" (default)
+ * - "POST"
+ * - "PUT"
+ * - "DELETE"
+ * - "HEAD"
+ * - "OPTIONS"
+ */
+ method?: string;
+
+ /**
+ * The URL to send the request to.
+ */
+ url: string;
+
+ /**
+ * The username for HTTP authentication.
+ */
+ user?: string;
+
+ /**
+ * The password for HTTP authentication.
+ */
+ password?: string;
+
+ /**
+ * The data to be sent. It's automatically serialized in the right format
+ * depending on the method (with exception of HTML5 FormData), and put in
+ * the appropriate section of the request.
+ */
+ data?: any;
+
+ /**
+ * Whether to run it in the background, i.e. true if it doesn't affect
+ * template rendering.
+ */
+ background?: boolean;
+
+ /**
+ * Set an initial value while the request is working, to populate the
+ * promise getter-setter.
+ */
+ initialValue?: T;
+
+ /**
+ * An optional preprocessor function to unwrap a successful response, in
+ * case the response contains metadata wrapping the data.
+ *
+ * @param data The data to unwrap.
+ * @return The unwrapped result.
+ */
+ unwrapSuccess?(data: any): T;
+
+ /**
+ * An optional preprocessor function to unwrap an unsuccessful response,
+ * in case the response contains metadata wrapping the data.
+ *
+ * @param data The data to unwrap.
+ * @return The unwrapped result.
+ */
+ unwrapError?(data: any): T;
+
+ /**
+ * An optional function to serialize the data. This defaults to
+ * `JSON.stringify`.
+ *
+ * @param dataToSerialize The data to serialize.
+ * @return The serialized form as a string.
+ */
+ serialize?(dataToSerialize: any): string;
+
+ /**
+ * An optional function to deserialize the data. This defaults to
+ * `JSON.parse`.
+ *
+ * @param dataToSerialize The data to parse.
+ * @return The parsed form.
+ */
+ deserialize?(dataToDeserialize: string): any;
+
+ /**
+ * An optional function to extract the data from a raw XMLHttpRequest,
+ * useful if the relevant data is in a response header or the status
+ * field.
+ *
+ * @param xhr The associated XMLHttpRequest.
+ * @param options The options passed to this request.
+ * @return string The serialized format.
+ */
+ extract?(xhr: XMLHttpRequest, options: MithrilXHROptions<T>): string;
+
+ /**
+ * The parsed data, or its children if it's an array, will be passed to
+ * this class constructor if it's given, to parse it into classes.
+ *
+ * @param data The data to parse.
+ * @return The new instance for the list.
+ */
+ type?: new (data: Object) => any;
+
+ /**
+ * An optional function to run between `open` and `send`, useful for
+ * adding request headers or using XHR2 features such as the `upload`
+ * property. It is even possible to override the XHR altogether with a
+ * similar object, such as an XDomainRequest instance.
+ *
+ * @param xhr The associated XMLHttpRequest.
+ * @param options The options passed to this request.
+ * @return The new XMLHttpRequest, or nothing if the same one is kept.
+ */
+ config?(xhr: XMLHttpRequest, options: MithrilXHROptions<T>): any;
+
+ /**
+ * For JSONP requests, this must be the string "jsonp". Otherwise, it's
+ * ignored.
+ */
+ dataType?: string;
+
+ /**
+ * For JSONP requests, this is the query string key for the JSONP
+ * request. This is useful for APIs that don't use common conventions,
+ * such as `www.example.com/?jsonpCallback=doSomething`. It defaults to
+ * `callback` for JSONP requests, and is ignored for any other kind of
+ * request.
+ */
+ callbackKey?: string;
+ }
+}
+
+declare var Mithril: _mithril.MithrilStatic;
+declare var m: _mithril.MithrilStatic;
+
+declare module "mithril" {
+ export = m;
+}
diff --git a/lib/decl/node.d.ts b/lib/decl/node.d.ts
new file mode 100644
index 000000000..8df3d16a7
--- /dev/null
+++ b/lib/decl/node.d.ts
@@ -0,0 +1,2178 @@
+// Type definitions for Node.js v4.x
+// Project: http://nodejs.org/
+// Definitions by: Microsoft TypeScript <http://typescriptlang.org>, DefinitelyTyped <https://github.com/borisyankov/DefinitelyTyped>
+// Definitions: https://github.com/borisyankov/DefinitelyTyped
+
+/************************************************
+* *
+* Node.js v4.x API *
+* *
+************************************************/
+
+interface Error {
+ stack?: string;
+}
+
+
+// compat for TypeScript 1.5.3
+// if you use with --target es3 or --target es5 and use below definitions,
+// use the lib.es6.d.ts that is bundled with TypeScript 1.5.3.
+interface MapConstructor {}
+interface WeakMapConstructor {}
+interface SetConstructor {}
+interface WeakSetConstructor {}
+
+/************************************************
+* *
+* GLOBAL *
+* *
+************************************************/
+declare var process: NodeJS.Process;
+declare var global: NodeJS.Global;
+
+declare var __filename: string;
+declare var __dirname: string;
+
+declare function setTimeout(callback: (...args: any[]) => void, ms: number, ...args: any[]): NodeJS.Timer;
+declare function clearTimeout(timeoutId: NodeJS.Timer): void;
+declare function setInterval(callback: (...args: any[]) => void, ms: number, ...args: any[]): NodeJS.Timer;
+declare function clearInterval(intervalId: NodeJS.Timer): void;
+declare function setImmediate(callback: (...args: any[]) => void, ...args: any[]): any;
+declare function clearImmediate(immediateId: any): void;
+
+interface NodeRequireFunction {
+ (id: string): any;
+}
+
+interface NodeRequire extends NodeRequireFunction {
+ resolve(id:string): string;
+ cache: any;
+ extensions: any;
+ main: any;
+}
+
+declare var require: NodeRequire;
+
+interface NodeModule {
+ exports: any;
+ require: NodeRequireFunction;
+ id: string;
+ filename: string;
+ loaded: boolean;
+ parent: any;
+ children: any[];
+}
+
+declare var module: NodeModule;
+
+// Same as module.exports
+declare var exports: any;
+declare var SlowBuffer: {
+ new (str: string, encoding?: string): Buffer;
+ new (size: number): Buffer;
+ new (size: Uint8Array): Buffer;
+ new (array: any[]): Buffer;
+ prototype: Buffer;
+ isBuffer(obj: any): boolean;
+ byteLength(string: string, encoding?: string): number;
+ concat(list: Buffer[], totalLength?: number): Buffer;
+};
+
+
+// Buffer class
+interface Buffer extends NodeBuffer {}
+
+/**
+ * Raw data is stored in instances of the Buffer class.
+ * A Buffer is similar to an array of integers but corresponds to a raw memory allocation outside the V8 heap. A Buffer cannot be resized.
+ * Valid string encodings: 'ascii'|'utf8'|'utf16le'|'ucs2'(alias of 'utf16le')|'base64'|'binary'(deprecated)|'hex'
+ */
+declare var Buffer: {
+ /**
+ * Allocates a new buffer containing the given {str}.
+ *
+ * @param str String to store in buffer.
+ * @param encoding encoding to use, optional. Default is 'utf8'
+ */
+ new (str: string, encoding?: string): Buffer;
+ /**
+ * Allocates a new buffer of {size} octets.
+ *
+ * @param size count of octets to allocate.
+ */
+ new (size: number): Buffer;
+ /**
+ * Allocates a new buffer containing the given {array} of octets.
+ *
+ * @param array The octets to store.
+ */
+ new (array: Uint8Array): Buffer;
+ /**
+ * Allocates a new buffer containing the given {array} of octets.
+ *
+ * @param array The octets to store.
+ */
+ new (array: any[]): Buffer;
+ /**
+ * Copies the passed {buffer} data onto a new {Buffer} instance.
+ *
+ * @param buffer The buffer to copy.
+ */
+ new (buffer: Buffer): Buffer;
+ prototype: Buffer;
+ /**
+ * Returns true if {obj} is a Buffer
+ *
+ * @param obj object to test.
+ */
+ isBuffer(obj: any): obj is Buffer;
+ /**
+ * Returns true if {encoding} is a valid encoding argument.
+ * Valid string encodings in Node 0.12: 'ascii'|'utf8'|'utf16le'|'ucs2'(alias of 'utf16le')|'base64'|'binary'(deprecated)|'hex'
+ *
+ * @param encoding string to test.
+ */
+ isEncoding(encoding: string): boolean;
+ /**
+ * Gives the actual byte length of a string. encoding defaults to 'utf8'.
+ * This is not the same as String.prototype.length since that returns the number of characters in a string.
+ *
+ * @param string string to test.
+ * @param encoding encoding used to evaluate (defaults to 'utf8')
+ */
+ byteLength(string: string, encoding?: string): number;
+ /**
+ * Returns a buffer which is the result of concatenating all the buffers in the list together.
+ *
+ * If the list has no items, or if the totalLength is 0, then it returns a zero-length buffer.
+ * If the list has exactly one item, then the first item of the list is returned.
+ * If the list has more than one item, then a new Buffer is created.
+ *
+ * @param list An array of Buffer objects to concatenate
+ * @param totalLength Total length of the buffers when concatenated.
+ * If totalLength is not provided, it is read from the buffers in the list. However, this adds an additional loop to the function, so it is faster to provide the length explicitly.
+ */
+ concat(list: Buffer[], totalLength?: number): Buffer;
+ /**
+ * The same as buf1.compare(buf2).
+ */
+ compare(buf1: Buffer, buf2: Buffer): number;
+};
+
+/************************************************
+* *
+* GLOBAL INTERFACES *
+* *
+************************************************/
+declare module NodeJS {
+ export interface ErrnoException extends Error {
+ errno?: number;
+ code?: string;
+ path?: string;
+ syscall?: string;
+ stack?: string;
+ }
+
+ export interface EventEmitter {
+ addListener(event: string, listener: Function): EventEmitter;
+ on(event: string, listener: Function): EventEmitter;
+ once(event: string, listener: Function): EventEmitter;
+ removeListener(event: string, listener: Function): EventEmitter;
+ removeAllListeners(event?: string): EventEmitter;
+ setMaxListeners(n: number): EventEmitter;
+ getMaxListeners(): number;
+ listeners(event: string): Function[];
+ emit(event: string, ...args: any[]): boolean;
+ listenerCount(type: string): number;
+ }
+
+ export interface ReadableStream extends EventEmitter {
+ readable: boolean;
+ read(size?: number): string|Buffer;
+ setEncoding(encoding: string): void;
+ pause(): void;
+ resume(): void;
+ pipe<T extends WritableStream>(destination: T, options?: { end?: boolean; }): T;
+ unpipe<T extends WritableStream>(destination?: T): void;
+ unshift(chunk: string): void;
+ unshift(chunk: Buffer): void;
+ wrap(oldStream: ReadableStream): ReadableStream;
+ }
+
+ export interface WritableStream extends EventEmitter {
+ writable: boolean;
+ write(buffer: Buffer|string, cb?: Function): boolean;
+ write(str: string, encoding?: string, cb?: Function): boolean;
+ end(): void;
+ end(buffer: Buffer, cb?: Function): void;
+ end(str: string, cb?: Function): void;
+ end(str: string, encoding?: string, cb?: Function): void;
+ }
+
+ export interface ReadWriteStream extends ReadableStream, WritableStream {}
+
+ export interface Process extends EventEmitter {
+ stdout: WritableStream;
+ stderr: WritableStream;
+ stdin: ReadableStream;
+ argv: string[];
+ execPath: string;
+ abort(): void;
+ chdir(directory: string): void;
+ cwd(): string;
+ env: any;
+ exit(code?: number): void;
+ getgid(): number;
+ setgid(id: number): void;
+ setgid(id: string): void;
+ getuid(): number;
+ setuid(id: number): void;
+ setuid(id: string): void;
+ version: string;
+ versions: {
+ http_parser: string;
+ node: string;
+ v8: string;
+ ares: string;
+ uv: string;
+ zlib: string;
+ openssl: string;
+ };
+ config: {
+ target_defaults: {
+ cflags: any[];
+ default_configuration: string;
+ defines: string[];
+ include_dirs: string[];
+ libraries: string[];
+ };
+ variables: {
+ clang: number;
+ host_arch: string;
+ node_install_npm: boolean;
+ node_install_waf: boolean;
+ node_prefix: string;
+ node_shared_openssl: boolean;
+ node_shared_v8: boolean;
+ node_shared_zlib: boolean;
+ node_use_dtrace: boolean;
+ node_use_etw: boolean;
+ node_use_openssl: boolean;
+ target_arch: string;
+ v8_no_strict_aliasing: number;
+ v8_use_snapshot: boolean;
+ visibility: string;
+ };
+ };
+ kill(pid:number, signal?: string|number): void;
+ pid: number;
+ title: string;
+ arch: string;
+ platform: string;
+ memoryUsage(): { rss: number; heapTotal: number; heapUsed: number; };
+ nextTick(callback: Function): void;
+ umask(mask?: number): number;
+ uptime(): number;
+ hrtime(time?:number[]): number[];
+
+ // Worker
+ send?(message: any, sendHandle?: any): void;
+ }
+
+ export interface Global {
+ Array: typeof Array;
+ ArrayBuffer: typeof ArrayBuffer;
+ Boolean: typeof Boolean;
+ Buffer: typeof Buffer;
+ DataView: typeof DataView;
+ Date: typeof Date;
+ Error: typeof Error;
+ EvalError: typeof EvalError;
+ Float32Array: typeof Float32Array;
+ Float64Array: typeof Float64Array;
+ Function: typeof Function;
+ GLOBAL: Global;
+ Infinity: typeof Infinity;
+ Int16Array: typeof Int16Array;
+ Int32Array: typeof Int32Array;
+ Int8Array: typeof Int8Array;
+ Intl: typeof Intl;
+ JSON: typeof JSON;
+ Map: MapConstructor;
+ Math: typeof Math;
+ NaN: typeof NaN;
+ Number: typeof Number;
+ Object: typeof Object;
+ Promise: Function;
+ RangeError: typeof RangeError;
+ ReferenceError: typeof ReferenceError;
+ RegExp: typeof RegExp;
+ Set: SetConstructor;
+ String: typeof String;
+ Symbol: Function;
+ SyntaxError: typeof SyntaxError;
+ TypeError: typeof TypeError;
+ URIError: typeof URIError;
+ Uint16Array: typeof Uint16Array;
+ Uint32Array: typeof Uint32Array;
+ Uint8Array: typeof Uint8Array;
+ Uint8ClampedArray: Function;
+ WeakMap: WeakMapConstructor;
+ WeakSet: WeakSetConstructor;
+ clearImmediate: (immediateId: any) => void;
+ clearInterval: (intervalId: NodeJS.Timer) => void;
+ clearTimeout: (timeoutId: NodeJS.Timer) => void;
+ console: typeof console;
+ decodeURI: typeof decodeURI;
+ decodeURIComponent: typeof decodeURIComponent;
+ encodeURI: typeof encodeURI;
+ encodeURIComponent: typeof encodeURIComponent;
+ escape: (str: string) => string;
+ eval: typeof eval;
+ global: Global;
+ isFinite: typeof isFinite;
+ isNaN: typeof isNaN;
+ parseFloat: typeof parseFloat;
+ parseInt: typeof parseInt;
+ process: Process;
+ root: Global;
+ setImmediate: (callback: (...args: any[]) => void, ...args: any[]) => any;
+ setInterval: (callback: (...args: any[]) => void, ms: number, ...args: any[]) => NodeJS.Timer;
+ setTimeout: (callback: (...args: any[]) => void, ms: number, ...args: any[]) => NodeJS.Timer;
+ undefined: typeof undefined;
+ unescape: (str: string) => string;
+ gc: () => void;
+ v8debug?: any;
+ }
+
+ export interface Timer {
+ ref() : void;
+ unref() : void;
+ }
+}
+
+/**
+ * @deprecated
+ */
+interface NodeBuffer {
+ [index: number]: number;
+ write(string: string, offset?: number, length?: number, encoding?: string): number;
+ toString(encoding?: string, start?: number, end?: number): string;
+ toJSON(): any;
+ length: number;
+ equals(otherBuffer: Buffer): boolean;
+ compare(otherBuffer: Buffer): number;
+ copy(targetBuffer: Buffer, targetStart?: number, sourceStart?: number, sourceEnd?: number): number;
+ slice(start?: number, end?: number): Buffer;
+ writeUIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number;
+ writeUIntBE(value: number, offset: number, byteLength: number, noAssert?: boolean): number;
+ writeIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number;
+ writeIntBE(value: number, offset: number, byteLength: number, noAssert?: boolean): number;
+ readUIntLE(offset: number, byteLength: number, noAssert?: boolean): number;
+ readUIntBE(offset: number, byteLength: number, noAssert?: boolean): number;
+ readIntLE(offset: number, byteLength: number, noAssert?: boolean): number;
+ readIntBE(offset: number, byteLength: number, noAssert?: boolean): number;
+ readUInt8(offset: number, noAsset?: boolean): number;
+ readUInt16LE(offset: number, noAssert?: boolean): number;
+ readUInt16BE(offset: number, noAssert?: boolean): number;
+ readUInt32LE(offset: number, noAssert?: boolean): number;
+ readUInt32BE(offset: number, noAssert?: boolean): number;
+ readInt8(offset: number, noAssert?: boolean): number;
+ readInt16LE(offset: number, noAssert?: boolean): number;
+ readInt16BE(offset: number, noAssert?: boolean): number;
+ readInt32LE(offset: number, noAssert?: boolean): number;
+ readInt32BE(offset: number, noAssert?: boolean): number;
+ readFloatLE(offset: number, noAssert?: boolean): number;
+ readFloatBE(offset: number, noAssert?: boolean): number;
+ readDoubleLE(offset: number, noAssert?: boolean): number;
+ readDoubleBE(offset: number, noAssert?: boolean): number;
+ writeUInt8(value: number, offset: number, noAssert?: boolean): number;
+ writeUInt16LE(value: number, offset: number, noAssert?: boolean): number;
+ writeUInt16BE(value: number, offset: number, noAssert?: boolean): number;
+ writeUInt32LE(value: number, offset: number, noAssert?: boolean): number;
+ writeUInt32BE(value: number, offset: number, noAssert?: boolean): number;
+ writeInt8(value: number, offset: number, noAssert?: boolean): number;
+ writeInt16LE(value: number, offset: number, noAssert?: boolean): number;
+ writeInt16BE(value: number, offset: number, noAssert?: boolean): number;
+ writeInt32LE(value: number, offset: number, noAssert?: boolean): number;
+ writeInt32BE(value: number, offset: number, noAssert?: boolean): number;
+ writeFloatLE(value: number, offset: number, noAssert?: boolean): number;
+ writeFloatBE(value: number, offset: number, noAssert?: boolean): number;
+ writeDoubleLE(value: number, offset: number, noAssert?: boolean): number;
+ writeDoubleBE(value: number, offset: number, noAssert?: boolean): number;
+ fill(value: any, offset?: number, end?: number): Buffer;
+ indexOf(value: string | number | Buffer, byteOffset?: number): number;
+}
+
+/************************************************
+* *
+* MODULES *
+* *
+************************************************/
+declare module "buffer" {
+ export var INSPECT_MAX_BYTES: number;
+}
+
+declare module "querystring" {
+ export interface StringifyOptions {
+ encodeURIComponent?: Function;
+ }
+
+ export interface ParseOptions {
+ maxKeys?: number;
+ decodeURIComponent?: Function;
+ }
+
+ export function stringify<T>(obj: T, sep?: string, eq?: string, options?: StringifyOptions): string;
+ export function parse(str: string, sep?: string, eq?: string, options?: ParseOptions): any;
+ export function parse<T extends {}>(str: string, sep?: string, eq?: string, options?: ParseOptions): T;
+ export function escape(str: string): string;
+ export function unescape(str: string): string;
+}
+
+declare module "events" {
+ export class EventEmitter implements NodeJS.EventEmitter {
+ static EventEmitter: EventEmitter;
+ static listenerCount(emitter: EventEmitter, event: string): number; // deprecated
+ static defaultMaxListeners: number;
+
+ addListener(event: string, listener: Function): EventEmitter;
+ on(event: string, listener: Function): EventEmitter;
+ once(event: string, listener: Function): EventEmitter;
+ removeListener(event: string, listener: Function): EventEmitter;
+ removeAllListeners(event?: string): EventEmitter;
+ setMaxListeners(n: number): EventEmitter;
+ getMaxListeners(): number;
+ listeners(event: string): Function[];
+ emit(event: string, ...args: any[]): boolean;
+ listenerCount(type: string): number;
+ }
+}
+
+declare module "http" {
+ import * as events from "events";
+ import * as net from "net";
+ import * as stream from "stream";
+
+ export interface RequestOptions {
+ protocol?: string;
+ host?: string;
+ hostname?: string;
+ family?: number;
+ port?: number;
+ localAddress?: string;
+ socketPath?: string;
+ method?: string;
+ path?: string;
+ headers?: { [key: string]: any };
+ auth?: string;
+ agent?: Agent|boolean;
+ }
+
+ export interface Server extends events.EventEmitter {
+ listen(port: number, hostname?: string, backlog?: number, callback?: Function): Server;
+ listen(port: number, hostname?: string, callback?: Function): Server;
+ listen(path: string, callback?: Function): Server;
+ listen(handle: any, listeningListener?: Function): Server;
+ close(cb?: any): Server;
+ address(): { port: number; family: string; address: string; };
+ maxHeadersCount: number;
+ }
+ /**
+ * @deprecated Use IncomingMessage
+ */
+ export interface ServerRequest extends IncomingMessage {
+ connection: net.Socket;
+ }
+ export interface ServerResponse extends events.EventEmitter, stream.Writable {
+ // Extended base methods
+ write(buffer: Buffer): boolean;
+ write(buffer: Buffer, cb?: Function): boolean;
+ write(str: string, cb?: Function): boolean;
+ write(str: string, encoding?: string, cb?: Function): boolean;
+ write(str: string, encoding?: string, fd?: string): boolean;
+
+ writeContinue(): void;
+ writeHead(statusCode: number, reasonPhrase?: string, headers?: any): void;
+ writeHead(statusCode: number, headers?: any): void;
+ statusCode: number;
+ statusMessage: string;
+ headersSent: boolean;
+ setHeader(name: string, value: string): void;
+ sendDate: boolean;
+ getHeader(name: string): string;
+ removeHeader(name: string): void;
+ write(chunk: any, encoding?: string): any;
+ addTrailers(headers: any): void;
+
+ // Extended base methods
+ end(): void;
+ end(buffer: Buffer, cb?: Function): void;
+ end(str: string, cb?: Function): void;
+ end(str: string, encoding?: string, cb?: Function): void;
+ end(data?: any, encoding?: string): void;
+ }
+ export interface ClientRequest extends events.EventEmitter, stream.Writable {
+ // Extended base methods
+ write(buffer: Buffer): boolean;
+ write(buffer: Buffer, cb?: Function): boolean;
+ write(str: string, cb?: Function): boolean;
+ write(str: string, encoding?: string, cb?: Function): boolean;
+ write(str: string, encoding?: string, fd?: string): boolean;
+
+ write(chunk: any, encoding?: string): void;
+ abort(): void;
+ setTimeout(timeout: number, callback?: Function): void;
+ setNoDelay(noDelay?: boolean): void;
+ setSocketKeepAlive(enable?: boolean, initialDelay?: number): void;
+
+ // Extended base methods
+ end(): void;
+ end(buffer: Buffer, cb?: Function): void;
+ end(str: string, cb?: Function): void;
+ end(str: string, encoding?: string, cb?: Function): void;
+ end(data?: any, encoding?: string): void;
+ }
+ export interface IncomingMessage extends events.EventEmitter, stream.Readable {
+ httpVersion: string;
+ headers: any;
+ rawHeaders: string[];
+ trailers: any;
+ rawTrailers: any;
+ setTimeout(msecs: number, callback: Function): NodeJS.Timer;
+ /**
+ * Only valid for request obtained from http.Server.
+ */
+ method?: string;
+ /**
+ * Only valid for request obtained from http.Server.
+ */
+ url?: string;
+ /**
+ * Only valid for response obtained from http.ClientRequest.
+ */
+ statusCode?: number;
+ /**
+ * Only valid for response obtained from http.ClientRequest.
+ */
+ statusMessage?: string;
+ socket: net.Socket;
+ }
+ /**
+ * @deprecated Use IncomingMessage
+ */
+ export interface ClientResponse extends IncomingMessage { }
+
+ export interface AgentOptions {
+ /**
+ * Keep sockets around in a pool to be used by other requests in the future. Default = false
+ */
+ keepAlive?: boolean;
+ /**
+ * When using HTTP KeepAlive, how often to send TCP KeepAlive packets over sockets being kept alive. Default = 1000.
+ * Only relevant if keepAlive is set to true.
+ */
+ keepAliveMsecs?: number;
+ /**
+ * Maximum number of sockets to allow per host. Default for Node 0.10 is 5, default for Node 0.12 is Infinity
+ */
+ maxSockets?: number;
+ /**
+ * Maximum number of sockets to leave open in a free state. Only relevant if keepAlive is set to true. Default = 256.
+ */
+ maxFreeSockets?: number;
+ }
+
+ export class Agent {
+ maxSockets: number;
+ sockets: any;
+ requests: any;
+
+ constructor(opts?: AgentOptions);
+
+ /**
+ * Destroy any sockets that are currently in use by the agent.
+ * It is usually not necessary to do this. However, if you are using an agent with KeepAlive enabled,
+ * then it is best to explicitly shut down the agent when you know that it will no longer be used. Otherwise,
+ * sockets may hang open for quite a long time before the server terminates them.
+ */
+ destroy(): void;
+ }
+
+ export var METHODS: string[];
+
+ export var STATUS_CODES: {
+ [errorCode: number]: string;
+ [errorCode: string]: string;
+ };
+ export function createServer(requestListener?: (request: IncomingMessage, response: ServerResponse) =>void ): Server;
+ export function createClient(port?: number, host?: string): any;
+ export function request(options: RequestOptions, callback?: (res: IncomingMessage) => void): ClientRequest;
+ export function get(options: any, callback?: (res: IncomingMessage) => void): ClientRequest;
+ export var globalAgent: Agent;
+}
+
+declare module "cluster" {
+ import * as child from "child_process";
+ import * as events from "events";
+
+ export interface ClusterSettings {
+ exec?: string;
+ args?: string[];
+ silent?: boolean;
+ }
+
+ export class Worker extends events.EventEmitter {
+ id: string;
+ process: child.ChildProcess;
+ suicide: boolean;
+ send(message: any, sendHandle?: any): void;
+ kill(signal?: string): void;
+ destroy(signal?: string): void;
+ disconnect(): void;
+ }
+
+ export var settings: ClusterSettings;
+ export var isMaster: boolean;
+ export var isWorker: boolean;
+ export function setupMaster(settings?: ClusterSettings): void;
+ export function fork(env?: any): Worker;
+ export function disconnect(callback?: Function): void;
+ export var worker: Worker;
+ export var workers: Worker[];
+
+ // Event emitter
+ export function addListener(event: string, listener: Function): void;
+ export function on(event: "disconnect", listener: (worker: Worker) => void): void;
+ export function on(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): void;
+ export function on(event: "fork", listener: (worker: Worker) => void): void;
+ export function on(event: "listening", listener: (worker: Worker, address: any) => void): void;
+ export function on(event: "message", listener: (worker: Worker, message: any) => void): void;
+ export function on(event: "online", listener: (worker: Worker) => void): void;
+ export function on(event: "setup", listener: (settings: any) => void): void;
+ export function on(event: string, listener: Function): any;
+ export function once(event: string, listener: Function): void;
+ export function removeListener(event: string, listener: Function): void;
+ export function removeAllListeners(event?: string): void;
+ export function setMaxListeners(n: number): void;
+ export function listeners(event: string): Function[];
+ export function emit(event: string, ...args: any[]): boolean;
+}
+
+declare module "zlib" {
+ import * as stream from "stream";
+ export interface ZlibOptions { chunkSize?: number; windowBits?: number; level?: number; memLevel?: number; strategy?: number; dictionary?: any; }
+
+ export interface Gzip extends stream.Transform { }
+ export interface Gunzip extends stream.Transform { }
+ export interface Deflate extends stream.Transform { }
+ export interface Inflate extends stream.Transform { }
+ export interface DeflateRaw extends stream.Transform { }
+ export interface InflateRaw extends stream.Transform { }
+ export interface Unzip extends stream.Transform { }
+
+ export function createGzip(options?: ZlibOptions): Gzip;
+ export function createGunzip(options?: ZlibOptions): Gunzip;
+ export function createDeflate(options?: ZlibOptions): Deflate;
+ export function createInflate(options?: ZlibOptions): Inflate;
+ export function createDeflateRaw(options?: ZlibOptions): DeflateRaw;
+ export function createInflateRaw(options?: ZlibOptions): InflateRaw;
+ export function createUnzip(options?: ZlibOptions): Unzip;
+
+ export function deflate(buf: Buffer, callback: (error: Error, result: any) =>void ): void;
+ export function deflateSync(buf: Buffer, options?: ZlibOptions): any;
+ export function deflateRaw(buf: Buffer, callback: (error: Error, result: any) =>void ): void;
+ export function deflateRawSync(buf: Buffer, options?: ZlibOptions): any;
+ export function gzip(buf: Buffer, callback: (error: Error, result: any) =>void ): void;
+ export function gzipSync(buf: Buffer, options?: ZlibOptions): any;
+ export function gunzip(buf: Buffer, callback: (error: Error, result: any) =>void ): void;
+ export function gunzipSync(buf: Buffer, options?: ZlibOptions): any;
+ export function inflate(buf: Buffer, callback: (error: Error, result: any) =>void ): void;
+ export function inflateSync(buf: Buffer, options?: ZlibOptions): any;
+ export function inflateRaw(buf: Buffer, callback: (error: Error, result: any) =>void ): void;
+ export function inflateRawSync(buf: Buffer, options?: ZlibOptions): any;
+ export function unzip(buf: Buffer, callback: (error: Error, result: any) =>void ): void;
+ export function unzipSync(buf: Buffer, options?: ZlibOptions): any;
+
+ // Constants
+ export var Z_NO_FLUSH: number;
+ export var Z_PARTIAL_FLUSH: number;
+ export var Z_SYNC_FLUSH: number;
+ export var Z_FULL_FLUSH: number;
+ export var Z_FINISH: number;
+ export var Z_BLOCK: number;
+ export var Z_TREES: number;
+ export var Z_OK: number;
+ export var Z_STREAM_END: number;
+ export var Z_NEED_DICT: number;
+ export var Z_ERRNO: number;
+ export var Z_STREAM_ERROR: number;
+ export var Z_DATA_ERROR: number;
+ export var Z_MEM_ERROR: number;
+ export var Z_BUF_ERROR: number;
+ export var Z_VERSION_ERROR: number;
+ export var Z_NO_COMPRESSION: number;
+ export var Z_BEST_SPEED: number;
+ export var Z_BEST_COMPRESSION: number;
+ export var Z_DEFAULT_COMPRESSION: number;
+ export var Z_FILTERED: number;
+ export var Z_HUFFMAN_ONLY: number;
+ export var Z_RLE: number;
+ export var Z_FIXED: number;
+ export var Z_DEFAULT_STRATEGY: number;
+ export var Z_BINARY: number;
+ export var Z_TEXT: number;
+ export var Z_ASCII: number;
+ export var Z_UNKNOWN: number;
+ export var Z_DEFLATED: number;
+ export var Z_NULL: number;
+}
+
+declare module "os" {
+ export interface CpuInfo {
+ model: string;
+ speed: number;
+ times: {
+ user: number;
+ nice: number;
+ sys: number;
+ idle: number;
+ irq: number;
+ };
+ }
+
+ export interface NetworkInterfaceInfo {
+ address: string;
+ netmask: string;
+ family: string;
+ mac: string;
+ internal: boolean;
+ }
+
+ export function tmpdir(): string;
+ export function homedir(): string;
+ export function endianness(): string;
+ export function hostname(): string;
+ export function type(): string;
+ export function platform(): string;
+ export function arch(): string;
+ export function release(): string;
+ export function uptime(): number;
+ export function loadavg(): number[];
+ export function totalmem(): number;
+ export function freemem(): number;
+ export function cpus(): CpuInfo[];
+ export function networkInterfaces(): {[index: string]: NetworkInterfaceInfo[]};
+ export var EOL: string;
+}
+
+declare module "https" {
+ import * as tls from "tls";
+ import * as events from "events";
+ import * as http from "http";
+
+ export interface ServerOptions {
+ pfx?: any;
+ key?: any;
+ passphrase?: string;
+ cert?: any;
+ ca?: any;
+ crl?: any;
+ ciphers?: string;
+ honorCipherOrder?: boolean;
+ requestCert?: boolean;
+ rejectUnauthorized?: boolean;
+ NPNProtocols?: any;
+ SNICallback?: (servername: string) => any;
+ }
+
+ export interface RequestOptions extends http.RequestOptions{
+ pfx?: any;
+ key?: any;
+ passphrase?: string;
+ cert?: any;
+ ca?: any;
+ ciphers?: string;
+ rejectUnauthorized?: boolean;
+ secureProtocol?: string;
+ }
+
+ export interface Agent {
+ maxSockets: number;
+ sockets: any;
+ requests: any;
+ }
+ export var Agent: {
+ new (options?: RequestOptions): Agent;
+ };
+ export interface Server extends tls.Server { }
+ export function createServer(options: ServerOptions, requestListener?: Function): Server;
+ export function request(options: RequestOptions, callback?: (res: http.IncomingMessage) =>void ): http.ClientRequest;
+ export function get(options: RequestOptions, callback?: (res: http.IncomingMessage) =>void ): http.ClientRequest;
+ export var globalAgent: Agent;
+}
+
+declare module "punycode" {
+ export function decode(string: string): string;
+ export function encode(string: string): string;
+ export function toUnicode(domain: string): string;
+ export function toASCII(domain: string): string;
+ export var ucs2: ucs2;
+ interface ucs2 {
+ decode(string: string): number[];
+ encode(codePoints: number[]): string;
+ }
+ export var version: any;
+}
+
+declare module "repl" {
+ import * as stream from "stream";
+ import * as events from "events";
+
+ export interface ReplOptions {
+ prompt?: string;
+ input?: NodeJS.ReadableStream;
+ output?: NodeJS.WritableStream;
+ terminal?: boolean;
+ eval?: Function;
+ useColors?: boolean;
+ useGlobal?: boolean;
+ ignoreUndefined?: boolean;
+ writer?: Function;
+ }
+ export function start(options: ReplOptions): events.EventEmitter;
+}
+
+declare module "readline" {
+ import * as events from "events";
+ import * as stream from "stream";
+
+ export interface Key {
+ sequence?: string;
+ name?: string;
+ ctrl?: boolean;
+ meta?: boolean;
+ shift?: boolean;
+ }
+
+ export interface ReadLine extends events.EventEmitter {
+ setPrompt(prompt: string): void;
+ prompt(preserveCursor?: boolean): void;
+ question(query: string, callback: (answer: string) => void): void;
+ pause(): ReadLine;
+ resume(): ReadLine;
+ close(): void;
+ write(data: string|Buffer, key?: Key): void;
+ }
+
+ export interface Completer {
+ (line: string): CompleterResult;
+ (line: string, callback: (err: any, result: CompleterResult) => void): any;
+ }
+
+ export interface CompleterResult {
+ completions: string[];
+ line: string;
+ }
+
+ export interface ReadLineOptions {
+ input: NodeJS.ReadableStream;
+ output?: NodeJS.WritableStream;
+ completer?: Completer;
+ terminal?: boolean;
+ historySize?: number;
+ }
+
+ export function createInterface(input: NodeJS.ReadableStream, output?: NodeJS.WritableStream, completer?: Completer, terminal?: boolean): ReadLine;
+ export function createInterface(options: ReadLineOptions): ReadLine;
+
+ export function cursorTo(stream: NodeJS.WritableStream, x: number, y: number): void;
+ export function moveCursor(stream: NodeJS.WritableStream, dx: number|string, dy: number|string): void;
+ export function clearLine(stream: NodeJS.WritableStream, dir: number): void;
+ export function clearScreenDown(stream: NodeJS.WritableStream): void;
+}
+
+declare module "vm" {
+ export interface Context { }
+ export interface Script {
+ runInThisContext(): void;
+ runInNewContext(sandbox?: Context): void;
+ }
+ export function runInThisContext(code: string, filename?: string): void;
+ export function runInNewContext(code: string, sandbox?: Context, filename?: string): void;
+ export function runInContext(code: string, context: Context, filename?: string): void;
+ export function createContext(initSandbox?: Context): Context;
+ export function createScript(code: string, filename?: string): Script;
+}
+
+declare module "child_process" {
+ import * as events from "events";
+ import * as stream from "stream";
+
+ export interface ChildProcess extends events.EventEmitter {
+ stdin: stream.Writable;
+ stdout: stream.Readable;
+ stderr: stream.Readable;
+ pid: number;
+ kill(signal?: string): void;
+ send(message: any, sendHandle?: any): void;
+ disconnect(): void;
+ unref(): void;
+ }
+
+ export function spawn(command: string, args?: string[], options?: {
+ cwd?: string;
+ stdio?: any;
+ custom?: any;
+ env?: any;
+ detached?: boolean;
+ }): ChildProcess;
+ export function exec(command: string, options: {
+ cwd?: string;
+ stdio?: any;
+ customFds?: any;
+ env?: any;
+ encoding?: string;
+ timeout?: number;
+ maxBuffer?: number;
+ killSignal?: string;
+ }, callback?: (error: Error, stdout: Buffer, stderr: Buffer) =>void ): ChildProcess;
+ export function exec(command: string, callback?: (error: Error, stdout: Buffer, stderr: Buffer) =>void ): ChildProcess;
+ export function execFile(file: string,
+ callback?: (error: Error, stdout: Buffer, stderr: Buffer) =>void ): ChildProcess;
+ export function execFile(file: string, args?: string[],
+ callback?: (error: Error, stdout: Buffer, stderr: Buffer) =>void ): ChildProcess;
+ export function execFile(file: string, args?: string[], options?: {
+ cwd?: string;
+ stdio?: any;
+ customFds?: any;
+ env?: any;
+ encoding?: string;
+ timeout?: number;
+ maxBuffer?: number;
+ killSignal?: string;
+ }, callback?: (error: Error, stdout: Buffer, stderr: Buffer) =>void ): ChildProcess;
+ export function fork(modulePath: string, args?: string[], options?: {
+ cwd?: string;
+ env?: any;
+ execPath?: string;
+ execArgv?: string[];
+ silent?: boolean;
+ uid?: number;
+ gid?: number;
+ }): ChildProcess;
+ export function spawnSync(command: string, args?: string[], options?: {
+ cwd?: string;
+ input?: string | Buffer;
+ stdio?: any;
+ env?: any;
+ uid?: number;
+ gid?: number;
+ timeout?: number;
+ maxBuffer?: number;
+ killSignal?: string;
+ encoding?: string;
+ }): {
+ pid: number;
+ output: string[];
+ stdout: string | Buffer;
+ stderr: string | Buffer;
+ status: number;
+ signal: string;
+ error: Error;
+ };
+ export function execSync(command: string, options?: {
+ cwd?: string;
+ input?: string|Buffer;
+ stdio?: any;
+ env?: any;
+ uid?: number;
+ gid?: number;
+ timeout?: number;
+ maxBuffer?: number;
+ killSignal?: string;
+ encoding?: string;
+ }): string | Buffer;
+ export function execFileSync(command: string, args?: string[], options?: {
+ cwd?: string;
+ input?: string|Buffer;
+ stdio?: any;
+ env?: any;
+ uid?: number;
+ gid?: number;
+ timeout?: number;
+ maxBuffer?: number;
+ killSignal?: string;
+ encoding?: string;
+ }): string | Buffer;
+}
+
+declare module "url" {
+ export interface Url {
+ href?: string;
+ protocol?: string;
+ auth?: string;
+ hostname?: string;
+ port?: string;
+ host?: string;
+ pathname?: string;
+ search?: string;
+ query?: any; // string | Object
+ slashes?: boolean;
+ hash?: string;
+ path?: string;
+ }
+
+ export function parse(urlStr: string, parseQueryString?: boolean , slashesDenoteHost?: boolean ): Url;
+ export function format(url: Url): string;
+ export function resolve(from: string, to: string): string;
+}
+
+declare module "dns" {
+ export function lookup(domain: string, family: number, callback: (err: Error, address: string, family: number) =>void ): string;
+ export function lookup(domain: string, callback: (err: Error, address: string, family: number) =>void ): string;
+ export function resolve(domain: string, rrtype: string, callback: (err: Error, addresses: string[]) =>void ): string[];
+ export function resolve(domain: string, callback: (err: Error, addresses: string[]) =>void ): string[];
+ export function resolve4(domain: string, callback: (err: Error, addresses: string[]) =>void ): string[];
+ export function resolve6(domain: string, callback: (err: Error, addresses: string[]) =>void ): string[];
+ export function resolveMx(domain: string, callback: (err: Error, addresses: string[]) =>void ): string[];
+ export function resolveTxt(domain: string, callback: (err: Error, addresses: string[]) =>void ): string[];
+ export function resolveSrv(domain: string, callback: (err: Error, addresses: string[]) =>void ): string[];
+ export function resolveNs(domain: string, callback: (err: Error, addresses: string[]) =>void ): string[];
+ export function resolveCname(domain: string, callback: (err: Error, addresses: string[]) =>void ): string[];
+ export function reverse(ip: string, callback: (err: Error, domains: string[]) =>void ): string[];
+}
+
+declare module "net" {
+ import * as stream from "stream";
+
+ export interface Socket extends stream.Duplex {
+ // Extended base methods
+ write(buffer: Buffer): boolean;
+ write(buffer: Buffer, cb?: Function): boolean;
+ write(str: string, cb?: Function): boolean;
+ write(str: string, encoding?: string, cb?: Function): boolean;
+ write(str: string, encoding?: string, fd?: string): boolean;
+
+ connect(port: number, host?: string, connectionListener?: Function): void;
+ connect(path: string, connectionListener?: Function): void;
+ bufferSize: number;
+ setEncoding(encoding?: string): void;
+ write(data: any, encoding?: string, callback?: Function): void;
+ destroy(): void;
+ pause(): void;
+ resume(): void;
+ setTimeout(timeout: number, callback?: Function): void;
+ setNoDelay(noDelay?: boolean): void;
+ setKeepAlive(enable?: boolean, initialDelay?: number): void;
+ address(): { port: number; family: string; address: string; };
+ unref(): void;
+ ref(): void;
+
+ remoteAddress: string;
+ remoteFamily: string;
+ remotePort: number;
+ localAddress: string;
+ localPort: number;
+ bytesRead: number;
+ bytesWritten: number;
+
+ // Extended base methods
+ end(): void;
+ end(buffer: Buffer, cb?: Function): void;
+ end(str: string, cb?: Function): void;
+ end(str: string, encoding?: string, cb?: Function): void;
+ end(data?: any, encoding?: string): void;
+ }
+
+ export var Socket: {
+ new (options?: { fd?: string; type?: string; allowHalfOpen?: boolean; }): Socket;
+ };
+
+ export interface Server extends Socket {
+ listen(port: number, host?: string, backlog?: number, listeningListener?: Function): Server;
+ listen(path: string, listeningListener?: Function): Server;
+ listen(handle: any, listeningListener?: Function): Server;
+ close(callback?: Function): Server;
+ address(): { port: number; family: string; address: string; };
+ maxConnections: number;
+ connections: number;
+ }
+ export function createServer(connectionListener?: (socket: Socket) =>void ): Server;
+ export function createServer(options?: { allowHalfOpen?: boolean; }, connectionListener?: (socket: Socket) =>void ): Server;
+ export function connect(options: { port: number, host?: string, localAddress? : string, localPort? : string, family? : number, allowHalfOpen?: boolean; }, connectionListener?: Function): Socket;
+ export function connect(port: number, host?: string, connectionListener?: Function): Socket;
+ export function connect(path: string, connectionListener?: Function): Socket;
+ export function createConnection(options: { port: number, host?: string, localAddress? : string, localPort? : string, family? : number, allowHalfOpen?: boolean; }, connectionListener?: Function): Socket;
+ export function createConnection(port: number, host?: string, connectionListener?: Function): Socket;
+ export function createConnection(path: string, connectionListener?: Function): Socket;
+ export function isIP(input: string): number;
+ export function isIPv4(input: string): boolean;
+ export function isIPv6(input: string): boolean;
+}
+
+declare module "dgram" {
+ import * as events from "events";
+
+ interface RemoteInfo {
+ address: string;
+ port: number;
+ size: number;
+ }
+
+ interface AddressInfo {
+ address: string;
+ family: string;
+ port: number;
+ }
+
+ export function createSocket(type: string, callback?: (msg: Buffer, rinfo: RemoteInfo) => void): Socket;
+
+ interface Socket extends events.EventEmitter {
+ send(buf: Buffer, offset: number, length: number, port: number, address: string, callback?: (error: Error, bytes: number) => void): void;
+ bind(port: number, address?: string, callback?: () => void): void;
+ close(): void;
+ address(): AddressInfo;
+ setBroadcast(flag: boolean): void;
+ setMulticastTTL(ttl: number): void;
+ setMulticastLoopback(flag: boolean): void;
+ addMembership(multicastAddress: string, multicastInterface?: string): void;
+ dropMembership(multicastAddress: string, multicastInterface?: string): void;
+ }
+}
+
+declare module "fs" {
+ import * as stream from "stream";
+ import * as events from "events";
+
+ interface Stats {
+ isFile(): boolean;
+ isDirectory(): boolean;
+ isBlockDevice(): boolean;
+ isCharacterDevice(): boolean;
+ isSymbolicLink(): boolean;
+ isFIFO(): boolean;
+ isSocket(): boolean;
+ dev: number;
+ ino: number;
+ mode: number;
+ nlink: number;
+ uid: number;
+ gid: number;
+ rdev: number;
+ size: number;
+ blksize: number;
+ blocks: number;
+ atime: Date;
+ mtime: Date;
+ ctime: Date;
+ birthtime: Date;
+ }
+
+ interface FSWatcher extends events.EventEmitter {
+ close(): void;
+ }
+
+ export interface ReadStream extends stream.Readable {
+ close(): void;
+ }
+ export interface WriteStream extends stream.Writable {
+ close(): void;
+ bytesWritten: number;
+ }
+
+ /**
+ * Asynchronous rename.
+ * @param oldPath
+ * @param newPath
+ * @param callback No arguments other than a possible exception are given to the completion callback.
+ */
+ export function rename(oldPath: string, newPath: string, callback?: (err?: NodeJS.ErrnoException) => void): void;
+ /**
+ * Synchronous rename
+ * @param oldPath
+ * @param newPath
+ */
+ export function renameSync(oldPath: string, newPath: string): void;
+ export function truncate(path: string, callback?: (err?: NodeJS.ErrnoException) => void): void;
+ export function truncate(path: string, len: number, callback?: (err?: NodeJS.ErrnoException) => void): void;
+ export function truncateSync(path: string, len?: number): void;
+ export function ftruncate(fd: number, callback?: (err?: NodeJS.ErrnoException) => void): void;
+ export function ftruncate(fd: number, len: number, callback?: (err?: NodeJS.ErrnoException) => void): void;
+ export function ftruncateSync(fd: number, len?: number): void;
+ export function chown(path: string, uid: number, gid: number, callback?: (err?: NodeJS.ErrnoException) => void): void;
+ export function chownSync(path: string, uid: number, gid: number): void;
+ export function fchown(fd: number, uid: number, gid: number, callback?: (err?: NodeJS.ErrnoException) => void): void;
+ export function fchownSync(fd: number, uid: number, gid: number): void;
+ export function lchown(path: string, uid: number, gid: number, callback?: (err?: NodeJS.ErrnoException) => void): void;
+ export function lchownSync(path: string, uid: number, gid: number): void;
+ export function chmod(path: string, mode: number, callback?: (err?: NodeJS.ErrnoException) => void): void;
+ export function chmod(path: string, mode: string, callback?: (err?: NodeJS.ErrnoException) => void): void;
+ export function chmodSync(path: string, mode: number): void;
+ export function chmodSync(path: string, mode: string): void;
+ export function fchmod(fd: number, mode: number, callback?: (err?: NodeJS.ErrnoException) => void): void;
+ export function fchmod(fd: number, mode: string, callback?: (err?: NodeJS.ErrnoException) => void): void;
+ export function fchmodSync(fd: number, mode: number): void;
+ export function fchmodSync(fd: number, mode: string): void;
+ export function lchmod(path: string, mode: number, callback?: (err?: NodeJS.ErrnoException) => void): void;
+ export function lchmod(path: string, mode: string, callback?: (err?: NodeJS.ErrnoException) => void): void;
+ export function lchmodSync(path: string, mode: number): void;
+ export function lchmodSync(path: string, mode: string): void;
+ export function stat(path: string, callback?: (err: NodeJS.ErrnoException, stats: Stats) => any): void;
+ export function lstat(path: string, callback?: (err: NodeJS.ErrnoException, stats: Stats) => any): void;
+ export function fstat(fd: number, callback?: (err: NodeJS.ErrnoException, stats: Stats) => any): void;
+ export function statSync(path: string): Stats;
+ export function lstatSync(path: string): Stats;
+ export function fstatSync(fd: number): Stats;
+ export function link(srcpath: string, dstpath: string, callback?: (err?: NodeJS.ErrnoException) => void): void;
+ export function linkSync(srcpath: string, dstpath: string): void;
+ export function symlink(srcpath: string, dstpath: string, type?: string, callback?: (err?: NodeJS.ErrnoException) => void): void;
+ export function symlinkSync(srcpath: string, dstpath: string, type?: string): void;
+ export function readlink(path: string, callback?: (err: NodeJS.ErrnoException, linkString: string) => any): void;
+ export function readlinkSync(path: string): string;
+ export function realpath(path: string, callback?: (err: NodeJS.ErrnoException, resolvedPath: string) => any): void;
+ export function realpath(path: string, cache: {[path: string]: string}, callback: (err: NodeJS.ErrnoException, resolvedPath: string) =>any): void;
+ export function realpathSync(path: string, cache?: { [path: string]: string }): string;
+ /*
+ * Asynchronous unlink - deletes the file specified in {path}
+ *
+ * @param path
+ * @param callback No arguments other than a possible exception are given to the completion callback.
+ */
+ export function unlink(path: string, callback?: (err?: NodeJS.ErrnoException) => void): void;
+ /*
+ * Synchronous unlink - deletes the file specified in {path}
+ *
+ * @param path
+ */
+ export function unlinkSync(path: string): void;
+ /*
+ * Asynchronous rmdir - removes the directory specified in {path}
+ *
+ * @param path
+ * @param callback No arguments other than a possible exception are given to the completion callback.
+ */
+ export function rmdir(path: string, callback?: (err?: NodeJS.ErrnoException) => void): void;
+ /*
+ * Synchronous rmdir - removes the directory specified in {path}
+ *
+ * @param path
+ */
+ export function rmdirSync(path: string): void;
+ /*
+ * Asynchronous mkdir - creates the directory specified in {path}. Parameter {mode} defaults to 0777.
+ *
+ * @param path
+ * @param callback No arguments other than a possible exception are given to the completion callback.
+ */
+ export function mkdir(path: string, callback?: (err?: NodeJS.ErrnoException) => void): void;
+ /*
+ * Asynchronous mkdir - creates the directory specified in {path}. Parameter {mode} defaults to 0777.
+ *
+ * @param path
+ * @param mode
+ * @param callback No arguments other than a possible exception are given to the completion callback.
+ */
+ export function mkdir(path: string, mode: number, callback?: (err?: NodeJS.ErrnoException) => void): void;
+ /*
+ * Asynchronous mkdir - creates the directory specified in {path}. Parameter {mode} defaults to 0777.
+ *
+ * @param path
+ * @param mode
+ * @param callback No arguments other than a possible exception are given to the completion callback.
+ */
+ export function mkdir(path: string, mode: string, callback?: (err?: NodeJS.ErrnoException) => void): void;
+ /*
+ * Synchronous mkdir - creates the directory specified in {path}. Parameter {mode} defaults to 0777.
+ *
+ * @param path
+ * @param mode
+ * @param callback No arguments other than a possible exception are given to the completion callback.
+ */
+ export function mkdirSync(path: string, mode?: number): void;
+ /*
+ * Synchronous mkdir - creates the directory specified in {path}. Parameter {mode} defaults to 0777.
+ *
+ * @param path
+ * @param mode
+ * @param callback No arguments other than a possible exception are given to the completion callback.
+ */
+ export function mkdirSync(path: string, mode?: string): void;
+ export function readdir(path: string, callback?: (err: NodeJS.ErrnoException, files: string[]) => void): void;
+ export function readdirSync(path: string): string[];
+ export function close(fd: number, callback?: (err?: NodeJS.ErrnoException) => void): void;
+ export function closeSync(fd: number): void;
+ export function open(path: string, flags: string, callback?: (err: NodeJS.ErrnoException, fd: number) => any): void;
+ export function open(path: string, flags: string, mode: number, callback?: (err: NodeJS.ErrnoException, fd: number) => any): void;
+ export function open(path: string, flags: string, mode: string, callback?: (err: NodeJS.ErrnoException, fd: number) => any): void;
+ export function openSync(path: string, flags: string, mode?: number): number;
+ export function openSync(path: string, flags: string, mode?: string): number;
+ export function utimes(path: string, atime: number, mtime: number, callback?: (err?: NodeJS.ErrnoException) => void): void;
+ export function utimes(path: string, atime: Date, mtime: Date, callback?: (err?: NodeJS.ErrnoException) => void): void;
+ export function utimesSync(path: string, atime: number, mtime: number): void;
+ export function utimesSync(path: string, atime: Date, mtime: Date): void;
+ export function futimes(fd: number, atime: number, mtime: number, callback?: (err?: NodeJS.ErrnoException) => void): void;
+ export function futimes(fd: number, atime: Date, mtime: Date, callback?: (err?: NodeJS.ErrnoException) => void): void;
+ export function futimesSync(fd: number, atime: number, mtime: number): void;
+ export function futimesSync(fd: number, atime: Date, mtime: Date): void;
+ export function fsync(fd: number, callback?: (err?: NodeJS.ErrnoException) => void): void;
+ export function fsyncSync(fd: number): void;
+ export function write(fd: number, buffer: Buffer, offset: number, length: number, position: number, callback?: (err: NodeJS.ErrnoException, written: number, buffer: Buffer) => void): void;
+ export function write(fd: number, buffer: Buffer, offset: number, length: number, callback?: (err: NodeJS.ErrnoException, written: number, buffer: Buffer) => void): void;
+ export function write(fd: number, data: any, callback?: (err: NodeJS.ErrnoException, written: number, str: string) => void): void;
+ export function write(fd: number, data: any, offset: number, callback?: (err: NodeJS.ErrnoException, written: number, str: string) => void): void;
+ export function write(fd: number, data: any, offset: number, encoding: string, callback?: (err: NodeJS.ErrnoException, written: number, str: string) => void): void;
+ export function writeSync(fd: number, buffer: Buffer, offset: number, length: number, position: number): number;
+ export function read(fd: number, buffer: Buffer, offset: number, length: number, position: number, callback?: (err: NodeJS.ErrnoException, bytesRead: number, buffer: Buffer) => void): void;
+ export function readSync(fd: number, buffer: Buffer, offset: number, length: number, position: number): number;
+ /*
+ * Asynchronous readFile - Asynchronously reads the entire contents of a file.
+ *
+ * @param fileName
+ * @param encoding
+ * @param callback - The callback is passed two arguments (err, data), where data is the contents of the file.
+ */
+ export function readFile(filename: string, encoding: string, callback: (err: NodeJS.ErrnoException, data: string) => void): void;
+ /*
+ * Asynchronous readFile - Asynchronously reads the entire contents of a file.
+ *
+ * @param fileName
+ * @param options An object with optional {encoding} and {flag} properties. If {encoding} is specified, readFile returns a string; otherwise it returns a Buffer.
+ * @param callback - The callback is passed two arguments (err, data), where data is the contents of the file.
+ */
+ export function readFile(filename: string, options: { encoding: string; flag?: string; }, callback: (err: NodeJS.ErrnoException, data: string) => void): void;
+ /*
+ * Asynchronous readFile - Asynchronously reads the entire contents of a file.
+ *
+ * @param fileName
+ * @param options An object with optional {encoding} and {flag} properties. If {encoding} is specified, readFile returns a string; otherwise it returns a Buffer.
+ * @param callback - The callback is passed two arguments (err, data), where data is the contents of the file.
+ */
+ export function readFile(filename: string, options: { flag?: string; }, callback: (err: NodeJS.ErrnoException, data: Buffer) => void): void;
+ /*
+ * Asynchronous readFile - Asynchronously reads the entire contents of a file.
+ *
+ * @param fileName
+ * @param callback - The callback is passed two arguments (err, data), where data is the contents of the file.
+ */
+ export function readFile(filename: string, callback: (err: NodeJS.ErrnoException, data: Buffer) => void): void;
+ /*
+ * Synchronous readFile - Synchronously reads the entire contents of a file.
+ *
+ * @param fileName
+ * @param encoding
+ */
+ export function readFileSync(filename: string, encoding: string): string;
+ /*
+ * Synchronous readFile - Synchronously reads the entire contents of a file.
+ *
+ * @param fileName
+ * @param options An object with optional {encoding} and {flag} properties. If {encoding} is specified, readFileSync returns a string; otherwise it returns a Buffer.
+ */
+ export function readFileSync(filename: string, options: { encoding: string; flag?: string; }): string;
+ /*
+ * Synchronous readFile - Synchronously reads the entire contents of a file.
+ *
+ * @param fileName
+ * @param options An object with optional {encoding} and {flag} properties. If {encoding} is specified, readFileSync returns a string; otherwise it returns a Buffer.
+ */
+ export function readFileSync(filename: string, options?: { flag?: string; }): Buffer;
+ export function writeFile(filename: string, data: any, callback?: (err: NodeJS.ErrnoException) => void): void;
+ export function writeFile(filename: string, data: any, options: { encoding?: string; mode?: number; flag?: string; }, callback?: (err: NodeJS.ErrnoException) => void): void;
+ export function writeFile(filename: string, data: any, options: { encoding?: string; mode?: string; flag?: string; }, callback?: (err: NodeJS.ErrnoException) => void): void;
+ export function writeFileSync(filename: string, data: any, options?: { encoding?: string; mode?: number; flag?: string; }): void;
+ export function writeFileSync(filename: string, data: any, options?: { encoding?: string; mode?: string; flag?: string; }): void;
+ export function appendFile(filename: string, data: any, options: { encoding?: string; mode?: number; flag?: string; }, callback?: (err: NodeJS.ErrnoException) => void): void;
+ export function appendFile(filename: string, data: any, options: { encoding?: string; mode?: string; flag?: string; }, callback?: (err: NodeJS.ErrnoException) => void): void;
+ export function appendFile(filename: string, data: any, callback?: (err: NodeJS.ErrnoException) => void): void;
+ export function appendFileSync(filename: string, data: any, options?: { encoding?: string; mode?: number; flag?: string; }): void;
+ export function appendFileSync(filename: string, data: any, options?: { encoding?: string; mode?: string; flag?: string; }): void;
+ export function watchFile(filename: string, listener: (curr: Stats, prev: Stats) => void): void;
+ export function watchFile(filename: string, options: { persistent?: boolean; interval?: number; }, listener: (curr: Stats, prev: Stats) => void): void;
+ export function unwatchFile(filename: string, listener?: (curr: Stats, prev: Stats) => void): void;
+ export function watch(filename: string, listener?: (event: string, filename: string) => any): FSWatcher;
+ export function watch(filename: string, options: { persistent?: boolean; }, listener?: (event: string, filename: string) => any): FSWatcher;
+ export function exists(path: string, callback?: (exists: boolean) => void): void;
+ export function existsSync(path: string): boolean;
+ /** Constant for fs.access(). File is visible to the calling process. */
+ export var F_OK: number;
+ /** Constant for fs.access(). File can be read by the calling process. */
+ export var R_OK: number;
+ /** Constant for fs.access(). File can be written by the calling process. */
+ export var W_OK: number;
+ /** Constant for fs.access(). File can be executed by the calling process. */
+ export var X_OK: number;
+ /** Tests a user's permissions for the file specified by path. */
+ export function access(path: string, callback: (err: NodeJS.ErrnoException) => void): void;
+ export function access(path: string, mode: number, callback: (err: NodeJS.ErrnoException) => void): void;
+ /** Synchronous version of fs.access. This throws if any accessibility checks fail, and does nothing otherwise. */
+ export function accessSync(path: string, mode ?: number): void;
+ export function createReadStream(path: string, options?: {
+ flags?: string;
+ encoding?: string;
+ fd?: number;
+ mode?: number;
+ autoClose?: boolean;
+ }): ReadStream;
+ export function createWriteStream(path: string, options?: {
+ flags?: string;
+ encoding?: string;
+ fd?: number;
+ mode?: number;
+ }): WriteStream;
+}
+
+declare module "path" {
+
+ /**
+ * A parsed path object generated by path.parse() or consumed by path.format().
+ */
+ export interface ParsedPath {
+ /**
+ * The root of the path such as '/' or 'c:\'
+ */
+ root: string;
+ /**
+ * The full directory path such as '/home/user/dir' or 'c:\path\dir'
+ */
+ dir: string;
+ /**
+ * The file name including extension (if any) such as 'index.html'
+ */
+ base: string;
+ /**
+ * The file extension (if any) such as '.html'
+ */
+ ext: string;
+ /**
+ * The file name without extension (if any) such as 'index'
+ */
+ name: string;
+ }
+
+ /**
+ * Normalize a string path, reducing '..' and '.' parts.
+ * When multiple slashes are found, they're replaced by a single one; when the path contains a trailing slash, it is preserved. On Windows backslashes are used.
+ *
+ * @param p string path to normalize.
+ */
+ export function normalize(p: string): string;
+ /**
+ * Join all arguments together and normalize the resulting path.
+ * Arguments must be strings. In v0.8, non-string arguments were silently ignored. In v0.10 and up, an exception is thrown.
+ *
+ * @param paths string paths to join.
+ */
+ export function join(...paths: any[]): string;
+ /**
+ * Join all arguments together and normalize the resulting path.
+ * Arguments must be strings. In v0.8, non-string arguments were silently ignored. In v0.10 and up, an exception is thrown.
+ *
+ * @param paths string paths to join.
+ */
+ export function join(...paths: string[]): string;
+ /**
+ * The right-most parameter is considered {to}. Other parameters are considered an array of {from}.
+ *
+ * Starting from leftmost {from} paramter, resolves {to} to an absolute path.
+ *
+ * If {to} isn't already absolute, {from} arguments are prepended in right to left order, until an absolute path is found. If after using all {from} paths still no absolute path is found, the current working directory is used as well. The resulting path is normalized, and trailing slashes are removed unless the path gets resolved to the root directory.
+ *
+ * @param pathSegments string paths to join. Non-string arguments are ignored.
+ */
+ export function resolve(...pathSegments: any[]): string;
+ /**
+ * Determines whether {path} is an absolute path. An absolute path will always resolve to the same location, regardless of the working directory.
+ *
+ * @param path path to test.
+ */
+ export function isAbsolute(path: string): boolean;
+ /**
+ * Solve the relative path from {from} to {to}.
+ * At times we have two absolute paths, and we need to derive the relative path from one to the other. This is actually the reverse transform of path.resolve.
+ *
+ * @param from
+ * @param to
+ */
+ export function relative(from: string, to: string): string;
+ /**
+ * Return the directory name of a path. Similar to the Unix dirname command.
+ *
+ * @param p the path to evaluate.
+ */
+ export function dirname(p: string): string;
+ /**
+ * Return the last portion of a path. Similar to the Unix basename command.
+ * Often used to extract the file name from a fully qualified path.
+ *
+ * @param p the path to evaluate.
+ * @param ext optionally, an extension to remove from the result.
+ */
+ export function basename(p: string, ext?: string): string;
+ /**
+ * Return the extension of the path, from the last '.' to end of string in the last portion of the path.
+ * If there is no '.' in the last portion of the path or the first character of it is '.', then it returns an empty string
+ *
+ * @param p the path to evaluate.
+ */
+ export function extname(p: string): string;
+ /**
+ * The platform-specific file separator. '\\' or '/'.
+ */
+ export var sep: string;
+ /**
+ * The platform-specific file delimiter. ';' or ':'.
+ */
+ export var delimiter: string;
+ /**
+ * Returns an object from a path string - the opposite of format().
+ *
+ * @param pathString path to evaluate.
+ */
+ export function parse(pathString: string): ParsedPath;
+ /**
+ * Returns a path string from an object - the opposite of parse().
+ *
+ * @param pathString path to evaluate.
+ */
+ export function format(pathObject: ParsedPath): string;
+
+ export module posix {
+ export function normalize(p: string): string;
+ export function join(...paths: any[]): string;
+ export function resolve(...pathSegments: any[]): string;
+ export function isAbsolute(p: string): boolean;
+ export function relative(from: string, to: string): string;
+ export function dirname(p: string): string;
+ export function basename(p: string, ext?: string): string;
+ export function extname(p: string): string;
+ export var sep: string;
+ export var delimiter: string;
+ export function parse(p: string): ParsedPath;
+ export function format(pP: ParsedPath): string;
+ }
+
+ export module win32 {
+ export function normalize(p: string): string;
+ export function join(...paths: any[]): string;
+ export function resolve(...pathSegments: any[]): string;
+ export function isAbsolute(p: string): boolean;
+ export function relative(from: string, to: string): string;
+ export function dirname(p: string): string;
+ export function basename(p: string, ext?: string): string;
+ export function extname(p: string): string;
+ export var sep: string;
+ export var delimiter: string;
+ export function parse(p: string): ParsedPath;
+ export function format(pP: ParsedPath): string;
+ }
+}
+
+declare module "string_decoder" {
+ export interface NodeStringDecoder {
+ write(buffer: Buffer): string;
+ detectIncompleteChar(buffer: Buffer): number;
+ }
+ export var StringDecoder: {
+ new (encoding: string): NodeStringDecoder;
+ };
+}
+
+declare module "tls" {
+ import * as crypto from "crypto";
+ import * as net from "net";
+ import * as stream from "stream";
+
+ var CLIENT_RENEG_LIMIT: number;
+ var CLIENT_RENEG_WINDOW: number;
+
+ export interface TlsOptions {
+ host?: string;
+ port?: number;
+ pfx?: any; //string or buffer
+ key?: any; //string or buffer
+ passphrase?: string;
+ cert?: any;
+ ca?: any; //string or buffer
+ crl?: any; //string or string array
+ ciphers?: string;
+ honorCipherOrder?: any;
+ requestCert?: boolean;
+ rejectUnauthorized?: boolean;
+ NPNProtocols?: any; //array or Buffer;
+ SNICallback?: (servername: string) => any;
+ }
+
+ export interface ConnectionOptions {
+ host?: string;
+ port?: number;
+ socket?: net.Socket;
+ pfx?: any; //string | Buffer
+ key?: any; //string | Buffer
+ passphrase?: string;
+ cert?: any; //string | Buffer
+ ca?: any; //Array of string | Buffer
+ rejectUnauthorized?: boolean;
+ NPNProtocols?: any; //Array of string | Buffer
+ servername?: string;
+ }
+
+ export interface Server extends net.Server {
+ // Extended base methods
+ listen(port: number, host?: string, backlog?: number, listeningListener?: Function): Server;
+ listen(path: string, listeningListener?: Function): Server;
+ listen(handle: any, listeningListener?: Function): Server;
+
+ listen(port: number, host?: string, callback?: Function): Server;
+ close(): Server;
+ address(): { port: number; family: string; address: string; };
+ addContext(hostName: string, credentials: {
+ key: string;
+ cert: string;
+ ca: string;
+ }): void;
+ maxConnections: number;
+ connections: number;
+ }
+
+ export interface ClearTextStream extends stream.Duplex {
+ authorized: boolean;
+ authorizationError: Error;
+ getPeerCertificate(): any;
+ getCipher: {
+ name: string;
+ version: string;
+ };
+ address: {
+ port: number;
+ family: string;
+ address: string;
+ };
+ remoteAddress: string;
+ remotePort: number;
+ }
+
+ export interface SecurePair {
+ encrypted: any;
+ cleartext: any;
+ }
+
+ export interface SecureContextOptions {
+ pfx?: any; //string | buffer
+ key?: any; //string | buffer
+ passphrase?: string;
+ cert?: any; // string | buffer
+ ca?: any; // string | buffer
+ crl?: any; // string | string[]
+ ciphers?: string;
+ honorCipherOrder?: boolean;
+ }
+
+ export interface SecureContext {
+ context: any;
+ }
+
+ export function createServer(options: TlsOptions, secureConnectionListener?: (cleartextStream: ClearTextStream) =>void ): Server;
+ export function connect(options: TlsOptions, secureConnectionListener?: () =>void ): ClearTextStream;
+ export function connect(port: number, host?: string, options?: ConnectionOptions, secureConnectListener?: () =>void ): ClearTextStream;
+ export function connect(port: number, options?: ConnectionOptions, secureConnectListener?: () =>void ): ClearTextStream;
+ export function createSecurePair(credentials?: crypto.Credentials, isServer?: boolean, requestCert?: boolean, rejectUnauthorized?: boolean): SecurePair;
+ export function createSecureContext(details: SecureContextOptions): SecureContext;
+}
+
+declare module "crypto" {
+ export interface CredentialDetails {
+ pfx: string;
+ key: string;
+ passphrase: string;
+ cert: string;
+ ca: any; //string | string array
+ crl: any; //string | string array
+ ciphers: string;
+ }
+ export interface Credentials { context?: any; }
+ export function createCredentials(details: CredentialDetails): Credentials;
+ export function createHash(algorithm: string): Hash;
+ export function createHmac(algorithm: string, key: string): Hmac;
+ export function createHmac(algorithm: string, key: Buffer): Hmac;
+ export interface Hash {
+ update(data: any, input_encoding?: string): Hash;
+ digest(encoding: 'buffer'): Buffer;
+ digest(encoding: string): any;
+ digest(): Buffer;
+ }
+ export interface Hmac extends NodeJS.ReadWriteStream {
+ update(data: any, input_encoding?: string): Hmac;
+ digest(encoding: 'buffer'): Buffer;
+ digest(encoding: string): any;
+ digest(): Buffer;
+ }
+ export function createCipher(algorithm: string, password: any): Cipher;
+ export function createCipheriv(algorithm: string, key: any, iv: any): Cipher;
+ export interface Cipher {
+ update(data: Buffer): Buffer;
+ update(data: string, input_encoding?: string, output_encoding?: string): string;
+ final(): Buffer;
+ final(output_encoding: string): string;
+ setAutoPadding(auto_padding: boolean): void;
+ }
+ export function createDecipher(algorithm: string, password: any): Decipher;
+ export function createDecipheriv(algorithm: string, key: any, iv: any): Decipher;
+ export interface Decipher {
+ update(data: Buffer): Buffer;
+ update(data: string, input_encoding?: string, output_encoding?: string): string;
+ final(): Buffer;
+ final(output_encoding: string): string;
+ setAutoPadding(auto_padding: boolean): void;
+ }
+ export function createSign(algorithm: string): Signer;
+ export interface Signer extends NodeJS.WritableStream {
+ update(data: any): void;
+ sign(private_key: string, output_format: string): string;
+ }
+ export function createVerify(algorith: string): Verify;
+ export interface Verify extends NodeJS.WritableStream {
+ update(data: any): void;
+ verify(object: string, signature: string, signature_format?: string): boolean;
+ }
+ export function createDiffieHellman(prime_length: number): DiffieHellman;
+ export function createDiffieHellman(prime: number, encoding?: string): DiffieHellman;
+ export interface DiffieHellman {
+ generateKeys(encoding?: string): string;
+ computeSecret(other_public_key: string, input_encoding?: string, output_encoding?: string): string;
+ getPrime(encoding?: string): string;
+ getGenerator(encoding: string): string;
+ getPublicKey(encoding?: string): string;
+ getPrivateKey(encoding?: string): string;
+ setPublicKey(public_key: string, encoding?: string): void;
+ setPrivateKey(public_key: string, encoding?: string): void;
+ }
+ export function getDiffieHellman(group_name: string): DiffieHellman;
+ export function pbkdf2(password: string|Buffer, salt: string|Buffer, iterations: number, keylen: number, callback: (err: Error, derivedKey: Buffer) => any): void;
+ export function pbkdf2(password: string|Buffer, salt: string|Buffer, iterations: number, keylen: number, digest: string, callback: (err: Error, derivedKey: Buffer) => any): void;
+ export function pbkdf2Sync(password: string|Buffer, salt: string|Buffer, iterations: number, keylen: number) : Buffer;
+ export function pbkdf2Sync(password: string|Buffer, salt: string|Buffer, iterations: number, keylen: number, digest: string) : Buffer;
+ export function randomBytes(size: number): Buffer;
+ export function randomBytes(size: number, callback: (err: Error, buf: Buffer) =>void ): void;
+ export function pseudoRandomBytes(size: number): Buffer;
+ export function pseudoRandomBytes(size: number, callback: (err: Error, buf: Buffer) =>void ): void;
+}
+
+declare module "stream" {
+ import * as events from "events";
+
+ export class Stream extends events.EventEmitter {
+ pipe<T extends NodeJS.WritableStream>(destination: T, options?: { end?: boolean; }): T;
+ }
+
+ export interface ReadableOptions {
+ highWaterMark?: number;
+ encoding?: string;
+ objectMode?: boolean;
+ }
+
+ export class Readable extends events.EventEmitter implements NodeJS.ReadableStream {
+ readable: boolean;
+ constructor(opts?: ReadableOptions);
+ _read(size: number): void;
+ read(size?: number): any;
+ setEncoding(encoding: string): void;
+ pause(): void;
+ resume(): void;
+ pipe<T extends NodeJS.WritableStream>(destination: T, options?: { end?: boolean; }): T;
+ unpipe<T extends NodeJS.WritableStream>(destination?: T): void;
+ unshift(chunk: any): void;
+ wrap(oldStream: NodeJS.ReadableStream): NodeJS.ReadableStream;
+ push(chunk: any, encoding?: string): boolean;
+ }
+
+ export interface WritableOptions {
+ highWaterMark?: number;
+ decodeStrings?: boolean;
+ objectMode?: boolean;
+ }
+
+ export class Writable extends events.EventEmitter implements NodeJS.WritableStream {
+ writable: boolean;
+ constructor(opts?: WritableOptions);
+ _write(chunk: any, encoding: string, callback: Function): void;
+ write(chunk: any, cb?: Function): boolean;
+ write(chunk: any, encoding?: string, cb?: Function): boolean;
+ end(): void;
+ end(chunk: any, cb?: Function): void;
+ end(chunk: any, encoding?: string, cb?: Function): void;
+ }
+
+ export interface DuplexOptions extends ReadableOptions, WritableOptions {
+ allowHalfOpen?: boolean;
+ }
+
+ // Note: Duplex extends both Readable and Writable.
+ export class Duplex extends Readable implements NodeJS.ReadWriteStream {
+ writable: boolean;
+ constructor(opts?: DuplexOptions);
+ _write(chunk: any, encoding: string, callback: Function): void;
+ write(chunk: any, cb?: Function): boolean;
+ write(chunk: any, encoding?: string, cb?: Function): boolean;
+ end(): void;
+ end(chunk: any, cb?: Function): void;
+ end(chunk: any, encoding?: string, cb?: Function): void;
+ }
+
+ export interface TransformOptions extends ReadableOptions, WritableOptions {}
+
+ // Note: Transform lacks the _read and _write methods of Readable/Writable.
+ export class Transform extends events.EventEmitter implements NodeJS.ReadWriteStream {
+ readable: boolean;
+ writable: boolean;
+ constructor(opts?: TransformOptions);
+ _transform(chunk: any, encoding: string, callback: Function): void;
+ _flush(callback: Function): void;
+ read(size?: number): any;
+ setEncoding(encoding: string): void;
+ pause(): void;
+ resume(): void;
+ pipe<T extends NodeJS.WritableStream>(destination: T, options?: { end?: boolean; }): T;
+ unpipe<T extends NodeJS.WritableStream>(destination?: T): void;
+ unshift(chunk: any): void;
+ wrap(oldStream: NodeJS.ReadableStream): NodeJS.ReadableStream;
+ push(chunk: any, encoding?: string): boolean;
+ write(chunk: any, cb?: Function): boolean;
+ write(chunk: any, encoding?: string, cb?: Function): boolean;
+ end(): void;
+ end(chunk: any, cb?: Function): void;
+ end(chunk: any, encoding?: string, cb?: Function): void;
+ }
+
+ export class PassThrough extends Transform {}
+}
+
+declare module "util" {
+ export interface InspectOptions {
+ showHidden?: boolean;
+ depth?: number;
+ colors?: boolean;
+ customInspect?: boolean;
+ }
+
+ export function format(format: any, ...param: any[]): string;
+ export function debug(string: string): void;
+ export function error(...param: any[]): void;
+ export function puts(...param: any[]): void;
+ export function print(...param: any[]): void;
+ export function log(string: string): void;
+ export function inspect(object: any, showHidden?: boolean, depth?: number, color?: boolean): string;
+ export function inspect(object: any, options: InspectOptions): string;
+ export function isArray(object: any): boolean;
+ export function isRegExp(object: any): boolean;
+ export function isDate(object: any): boolean;
+ export function isError(object: any): boolean;
+ export function inherits(constructor: any, superConstructor: any): void;
+ export function debuglog(key:string): (msg:string,...param: any[])=>void;
+}
+
+declare module "assert" {
+ function internal (value: any, message?: string): void;
+ module internal {
+ export class AssertionError implements Error {
+ name: string;
+ message: string;
+ actual: any;
+ expected: any;
+ operator: string;
+ generatedMessage: boolean;
+
+ constructor(options?: {message?: string; actual?: any; expected?: any;
+ operator?: string; stackStartFunction?: Function});
+ }
+
+ export function fail(actual?: any, expected?: any, message?: string, operator?: string): void;
+ export function ok(value: any, message?: string): void;
+ export function equal(actual: any, expected: any, message?: string): void;
+ export function notEqual(actual: any, expected: any, message?: string): void;
+ export function deepEqual(actual: any, expected: any, message?: string): void;
+ export function notDeepEqual(acutal: any, expected: any, message?: string): void;
+ export function strictEqual(actual: any, expected: any, message?: string): void;
+ export function notStrictEqual(actual: any, expected: any, message?: string): void;
+ export function deepStrictEqual(actual: any, expected: any, message?: string): void;
+ export function notDeepStrictEqual(actual: any, expected: any, message?: string): void;
+ export var throws: {
+ (block: Function, message?: string): void;
+ (block: Function, error: Function, message?: string): void;
+ (block: Function, error: RegExp, message?: string): void;
+ (block: Function, error: (err: any) => boolean, message?: string): void;
+ };
+
+ export var doesNotThrow: {
+ (block: Function, message?: string): void;
+ (block: Function, error: Function, message?: string): void;
+ (block: Function, error: RegExp, message?: string): void;
+ (block: Function, error: (err: any) => boolean, message?: string): void;
+ };
+
+ export function ifError(value: any): void;
+ }
+
+ export = internal;
+}
+
+declare module "tty" {
+ import * as net from "net";
+
+ export function isatty(fd: number): boolean;
+ export interface ReadStream extends net.Socket {
+ isRaw: boolean;
+ setRawMode(mode: boolean): void;
+ isTTY: boolean;
+ }
+ export interface WriteStream extends net.Socket {
+ columns: number;
+ rows: number;
+ isTTY: boolean;
+ }
+}
+
+declare module "domain" {
+ import * as events from "events";
+
+ export class Domain extends events.EventEmitter {
+ run(fn: Function): void;
+ add(emitter: events.EventEmitter): void;
+ remove(emitter: events.EventEmitter): void;
+ bind(cb: (err: Error, data: any) => any): any;
+ intercept(cb: (data: any) => any): any;
+ dispose(): void;
+
+ addListener(event: string, listener: Function): Domain;
+ on(event: string, listener: Function): Domain;
+ once(event: string, listener: Function): Domain;
+ removeListener(event: string, listener: Function): Domain;
+ removeAllListeners(event?: string): Domain;
+ }
+
+ export function create(): Domain;
+}
+
+declare module "constants" {
+ export var E2BIG: number;
+ export var EACCES: number;
+ export var EADDRINUSE: number;
+ export var EADDRNOTAVAIL: number;
+ export var EAFNOSUPPORT: number;
+ export var EAGAIN: number;
+ export var EALREADY: number;
+ export var EBADF: number;
+ export var EBADMSG: number;
+ export var EBUSY: number;
+ export var ECANCELED: number;
+ export var ECHILD: number;
+ export var ECONNABORTED: number;
+ export var ECONNREFUSED: number;
+ export var ECONNRESET: number;
+ export var EDEADLK: number;
+ export var EDESTADDRREQ: number;
+ export var EDOM: number;
+ export var EEXIST: number;
+ export var EFAULT: number;
+ export var EFBIG: number;
+ export var EHOSTUNREACH: number;
+ export var EIDRM: number;
+ export var EILSEQ: number;
+ export var EINPROGRESS: number;
+ export var EINTR: number;
+ export var EINVAL: number;
+ export var EIO: number;
+ export var EISCONN: number;
+ export var EISDIR: number;
+ export var ELOOP: number;
+ export var EMFILE: number;
+ export var EMLINK: number;
+ export var EMSGSIZE: number;
+ export var ENAMETOOLONG: number;
+ export var ENETDOWN: number;
+ export var ENETRESET: number;
+ export var ENETUNREACH: number;
+ export var ENFILE: number;
+ export var ENOBUFS: number;
+ export var ENODATA: number;
+ export var ENODEV: number;
+ export var ENOENT: number;
+ export var ENOEXEC: number;
+ export var ENOLCK: number;
+ export var ENOLINK: number;
+ export var ENOMEM: number;
+ export var ENOMSG: number;
+ export var ENOPROTOOPT: number;
+ export var ENOSPC: number;
+ export var ENOSR: number;
+ export var ENOSTR: number;
+ export var ENOSYS: number;
+ export var ENOTCONN: number;
+ export var ENOTDIR: number;
+ export var ENOTEMPTY: number;
+ export var ENOTSOCK: number;
+ export var ENOTSUP: number;
+ export var ENOTTY: number;
+ export var ENXIO: number;
+ export var EOPNOTSUPP: number;
+ export var EOVERFLOW: number;
+ export var EPERM: number;
+ export var EPIPE: number;
+ export var EPROTO: number;
+ export var EPROTONOSUPPORT: number;
+ export var EPROTOTYPE: number;
+ export var ERANGE: number;
+ export var EROFS: number;
+ export var ESPIPE: number;
+ export var ESRCH: number;
+ export var ETIME: number;
+ export var ETIMEDOUT: number;
+ export var ETXTBSY: number;
+ export var EWOULDBLOCK: number;
+ export var EXDEV: number;
+ export var WSAEINTR: number;
+ export var WSAEBADF: number;
+ export var WSAEACCES: number;
+ export var WSAEFAULT: number;
+ export var WSAEINVAL: number;
+ export var WSAEMFILE: number;
+ export var WSAEWOULDBLOCK: number;
+ export var WSAEINPROGRESS: number;
+ export var WSAEALREADY: number;
+ export var WSAENOTSOCK: number;
+ export var WSAEDESTADDRREQ: number;
+ export var WSAEMSGSIZE: number;
+ export var WSAEPROTOTYPE: number;
+ export var WSAENOPROTOOPT: number;
+ export var WSAEPROTONOSUPPORT: number;
+ export var WSAESOCKTNOSUPPORT: number;
+ export var WSAEOPNOTSUPP: number;
+ export var WSAEPFNOSUPPORT: number;
+ export var WSAEAFNOSUPPORT: number;
+ export var WSAEADDRINUSE: number;
+ export var WSAEADDRNOTAVAIL: number;
+ export var WSAENETDOWN: number;
+ export var WSAENETUNREACH: number;
+ export var WSAENETRESET: number;
+ export var WSAECONNABORTED: number;
+ export var WSAECONNRESET: number;
+ export var WSAENOBUFS: number;
+ export var WSAEISCONN: number;
+ export var WSAENOTCONN: number;
+ export var WSAESHUTDOWN: number;
+ export var WSAETOOMANYREFS: number;
+ export var WSAETIMEDOUT: number;
+ export var WSAECONNREFUSED: number;
+ export var WSAELOOP: number;
+ export var WSAENAMETOOLONG: number;
+ export var WSAEHOSTDOWN: number;
+ export var WSAEHOSTUNREACH: number;
+ export var WSAENOTEMPTY: number;
+ export var WSAEPROCLIM: number;
+ export var WSAEUSERS: number;
+ export var WSAEDQUOT: number;
+ export var WSAESTALE: number;
+ export var WSAEREMOTE: number;
+ export var WSASYSNOTREADY: number;
+ export var WSAVERNOTSUPPORTED: number;
+ export var WSANOTINITIALISED: number;
+ export var WSAEDISCON: number;
+ export var WSAENOMORE: number;
+ export var WSAECANCELLED: number;
+ export var WSAEINVALIDPROCTABLE: number;
+ export var WSAEINVALIDPROVIDER: number;
+ export var WSAEPROVIDERFAILEDINIT: number;
+ export var WSASYSCALLFAILURE: number;
+ export var WSASERVICE_NOT_FOUND: number;
+ export var WSATYPE_NOT_FOUND: number;
+ export var WSA_E_NO_MORE: number;
+ export var WSA_E_CANCELLED: number;
+ export var WSAEREFUSED: number;
+ export var SIGHUP: number;
+ export var SIGINT: number;
+ export var SIGILL: number;
+ export var SIGABRT: number;
+ export var SIGFPE: number;
+ export var SIGKILL: number;
+ export var SIGSEGV: number;
+ export var SIGTERM: number;
+ export var SIGBREAK: number;
+ export var SIGWINCH: number;
+ export var SSL_OP_ALL: number;
+ export var SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION: number;
+ export var SSL_OP_CIPHER_SERVER_PREFERENCE: number;
+ export var SSL_OP_CISCO_ANYCONNECT: number;
+ export var SSL_OP_COOKIE_EXCHANGE: number;
+ export var SSL_OP_CRYPTOPRO_TLSEXT_BUG: number;
+ export var SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS: number;
+ export var SSL_OP_EPHEMERAL_RSA: number;
+ export var SSL_OP_LEGACY_SERVER_CONNECT: number;
+ export var SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER: number;
+ export var SSL_OP_MICROSOFT_SESS_ID_BUG: number;
+ export var SSL_OP_MSIE_SSLV2_RSA_PADDING: number;
+ export var SSL_OP_NETSCAPE_CA_DN_BUG: number;
+ export var SSL_OP_NETSCAPE_CHALLENGE_BUG: number;
+ export var SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG: number;
+ export var SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG: number;
+ export var SSL_OP_NO_COMPRESSION: number;
+ export var SSL_OP_NO_QUERY_MTU: number;
+ export var SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION: number;
+ export var SSL_OP_NO_SSLv2: number;
+ export var SSL_OP_NO_SSLv3: number;
+ export var SSL_OP_NO_TICKET: number;
+ export var SSL_OP_NO_TLSv1: number;
+ export var SSL_OP_NO_TLSv1_1: number;
+ export var SSL_OP_NO_TLSv1_2: number;
+ export var SSL_OP_PKCS1_CHECK_1: number;
+ export var SSL_OP_PKCS1_CHECK_2: number;
+ export var SSL_OP_SINGLE_DH_USE: number;
+ export var SSL_OP_SINGLE_ECDH_USE: number;
+ export var SSL_OP_SSLEAY_080_CLIENT_DH_BUG: number;
+ export var SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG: number;
+ export var SSL_OP_TLS_BLOCK_PADDING_BUG: number;
+ export var SSL_OP_TLS_D5_BUG: number;
+ export var SSL_OP_TLS_ROLLBACK_BUG: number;
+ export var ENGINE_METHOD_DSA: number;
+ export var ENGINE_METHOD_DH: number;
+ export var ENGINE_METHOD_RAND: number;
+ export var ENGINE_METHOD_ECDH: number;
+ export var ENGINE_METHOD_ECDSA: number;
+ export var ENGINE_METHOD_CIPHERS: number;
+ export var ENGINE_METHOD_DIGESTS: number;
+ export var ENGINE_METHOD_STORE: number;
+ export var ENGINE_METHOD_PKEY_METHS: number;
+ export var ENGINE_METHOD_PKEY_ASN1_METHS: number;
+ export var ENGINE_METHOD_ALL: number;
+ export var ENGINE_METHOD_NONE: number;
+ export var DH_CHECK_P_NOT_SAFE_PRIME: number;
+ export var DH_CHECK_P_NOT_PRIME: number;
+ export var DH_UNABLE_TO_CHECK_GENERATOR: number;
+ export var DH_NOT_SUITABLE_GENERATOR: number;
+ export var NPN_ENABLED: number;
+ export var RSA_PKCS1_PADDING: number;
+ export var RSA_SSLV23_PADDING: number;
+ export var RSA_NO_PADDING: number;
+ export var RSA_PKCS1_OAEP_PADDING: number;
+ export var RSA_X931_PADDING: number;
+ export var RSA_PKCS1_PSS_PADDING: number;
+ export var POINT_CONVERSION_COMPRESSED: number;
+ export var POINT_CONVERSION_UNCOMPRESSED: number;
+ export var POINT_CONVERSION_HYBRID: number;
+ export var O_RDONLY: number;
+ export var O_WRONLY: number;
+ export var O_RDWR: number;
+ export var S_IFMT: number;
+ export var S_IFREG: number;
+ export var S_IFDIR: number;
+ export var S_IFCHR: number;
+ export var S_IFLNK: number;
+ export var O_CREAT: number;
+ export var O_EXCL: number;
+ export var O_TRUNC: number;
+ export var O_APPEND: number;
+ export var F_OK: number;
+ export var R_OK: number;
+ export var W_OK: number;
+ export var X_OK: number;
+ export var UV_UDP_REUSEADDR: number;
+}
diff --git a/lib/decl/systemjs/systemjs.d.ts b/lib/decl/systemjs/systemjs.d.ts
new file mode 100644
index 000000000..4d84b399c
--- /dev/null
+++ b/lib/decl/systemjs/systemjs.d.ts
@@ -0,0 +1,20 @@
+interface System {
+ import(name: string): Promise<any>;
+ defined: any;
+ amdDefine: () => void;
+ amdRequire: () => void;
+ baseURL: string;
+ paths: { [key: string]: string };
+ meta: { [key: string]: Object };
+ config: any;
+ newModule(obj: Object): any;
+ normalizeSync(name: string): string;
+ set(moduleName: string, module: any): void;
+}
+
+
+declare var System: System;
+
+declare module "systemjs" {
+ export = System;
+} \ No newline at end of file
diff --git a/lib/decl/urijs/URIjs.d.ts b/lib/decl/urijs/URIjs.d.ts
new file mode 100644
index 000000000..23d79218b
--- /dev/null
+++ b/lib/decl/urijs/URIjs.d.ts
@@ -0,0 +1,236 @@
+// Type definitions for URI.js 1.15.1
+// Project: https://github.com/medialize/URI.js
+// Definitions by: RodneyJT <https://github.com/RodneyJT>, Brian Surowiec <https://github.com/xt0rted>
+// Definitions: https://github.com/borisyankov/DefinitelyTyped
+
+/// <reference path="../jquery/jquery.d.ts" />
+
+declare module uri {
+
+ interface URI {
+ absoluteTo(path: string): URI;
+ absoluteTo(path: URI): URI;
+ addFragment(fragment: string): URI;
+ addQuery(qry: string): URI;
+ addQuery(qry: Object): URI;
+ addSearch(qry: string): URI;
+ addSearch(key: string, value:any): URI;
+ addSearch(qry: Object): URI;
+ authority(): string;
+ authority(authority: string): URI;
+
+ clone(): URI;
+
+ directory(): string;
+ directory(dir: boolean): string;
+ directory(dir: string): URI;
+ domain(): string;
+ domain(domain: boolean): string;
+ domain(domain: string): URI;
+
+ duplicateQueryParameters(val: boolean): URI;
+
+ equals(): boolean;
+ equals(url: string): boolean;
+
+ filename(): string;
+ filename(file: boolean): string;
+ filename(file: string): URI;
+ fragment(): string;
+ fragment(fragment: string): URI;
+ fragmentPrefix(prefix: string): URI;
+
+ hash(): string;
+ hash(hash: string): URI;
+ host(): string;
+ host(host: string): URI;
+ hostname(): string;
+ hostname(hostname: string): URI;
+ href(): string;
+ href(url: string): void;
+
+ is(qry: string): boolean;
+ iso8859(): URI;
+
+ normalize(): URI;
+ normalizeFragment(): URI;
+ normalizeHash(): URI;
+ normalizeHostname(): URI;
+ normalizePath(): URI;
+ normalizePathname(): URI;
+ normalizePort(): URI;
+ normalizeProtocol(): URI;
+ normalizeQuery(): URI;
+ normalizeSearch(): URI;
+
+ password(): string;
+ password(pw: string): URI;
+ path(): string;
+ path(path: boolean): string;
+ path(path: string): URI;
+ pathname(): string;
+ pathname(path: boolean): string;
+ pathname(path: string): URI;
+ port(): string;
+ port(port: string): URI;
+ protocol(): string;
+ protocol(protocol: string): URI;
+
+ query(): string;
+ query(qry: string): URI;
+ query(qry: boolean): Object;
+ query(qry: Object): URI;
+
+ readable(): string;
+ relativeTo(path: string): URI;
+ removeQuery(qry: string): URI;
+ removeQuery(qry: Object): URI;
+ removeSearch(qry: string): URI;
+ removeSearch(qry: Object): URI;
+ resource(): string;
+ resource(resource: string): URI;
+
+ scheme(): string;
+ scheme(protocol: string): URI;
+ search(): string;
+ search(qry: string): URI;
+ search(qry: boolean): any;
+ search(qry: Object): URI;
+ segment(): string[];
+ segment(segments: string[]): URI;
+ segment(position: number): string;
+ segment(position: number, level: string): URI;
+ segment(segment: string): URI;
+ setQuery(key: string, value: string): URI;
+ setQuery(qry: Object): URI;
+ setSearch(key: string, value: string): URI;
+ setSearch(qry: Object): URI;
+ subdomain(): string;
+ subdomain(subdomain: string): URI;
+ suffix(): string;
+ suffix(suffix: boolean): string;
+ suffix(suffix: string): URI;
+
+ tld(): string;
+ tld(tld: boolean): string;
+ tld(tld: string): URI;
+
+ unicode(): URI;
+ userinfo(): string;
+ userinfo(userinfo: string): URI;
+ username(): string;
+ username(uname: string): URI;
+
+ valueOf(): string;
+ }
+
+ interface URIOptions {
+ protocol?: string;
+ username?: string;
+ password?: string;
+ hostname?: string;
+ port?: string;
+ path?: string;
+ query?: string;
+ fragment?: string;
+ }
+
+ interface URIStatic {
+ (): URI;
+ (value: string | URIOptions | HTMLElement): URI;
+
+ new (): URI;
+ new (value: string | URIOptions | HTMLElement): URI;
+
+ addQuery(data: Object, prop: string, value: string): Object;
+ addQuery(data: Object, qryObj: Object): Object;
+
+ build(parts: {
+ protocol: string;
+ username: string;
+ password: string;
+ hostname: string;
+ port: string;
+ path: string;
+ query: string;
+ fragment: string;
+ }): string;
+ buildAuthority(parts: {
+ username?: string;
+ password?: string;
+ hostname?: string;
+ port?: string;
+ }): string;
+ buildHost(parts: {
+ hostname?: string;
+ port?: string;
+ }): string;
+ buildQuery(qry: Object): string;
+ buildQuery(qry: Object, duplicates: boolean): string;
+ buildUserinfo(parts: {
+ username?: string;
+ password?: string;
+ }): string;
+
+ commonPath(path1: string, path2: string): string;
+
+ decode(str: string): string;
+ decodeQuery(qry: string): string;
+
+ encode(str: string): string;
+ encodeQuery(qry: string): string;
+ encodeReserved(str: string): string;
+ expand(template: string, vals: Object): URI;
+
+ iso8859(): void;
+
+ parse(url: string): {
+ protocol: string;
+ username: string;
+ password: string;
+ hostname: string;
+ port: string;
+ path: string;
+ query: string;
+ fragment: string;
+ };
+ parseAuthority(url: string, parts: {
+ username?: string;
+ password?: string;
+ hostname?: string;
+ port?: string;
+ }): string;
+ parseHost(url: string, parts: {
+ hostname?: string;
+ port?: string;
+ }): string;
+ parseQuery(url: string): Object;
+ parseUserinfo(url: string, parts: {
+ username?: string;
+ password?: string;
+ }): string;
+
+ removeQuery(data: Object, prop: string, value: string): Object;
+ removeQuery(data: Object, props: string[]): Object;
+ removeQuery(data: Object, props: Object): Object;
+
+ unicode(): void;
+
+ withinString(source: string, func: (url: string) => string): string;
+ }
+
+}
+
+interface JQuery {
+ uri(): uri.URI;
+}
+
+declare var URI: uri.URIStatic;
+
+declare module 'URI' {
+ export = URI;
+}
+
+declare module 'urijs' {
+ export = URI;
+}
diff --git a/lib/emscripten/emsc.d.ts b/lib/emscripten/emsc.d.ts
new file mode 100644
index 000000000..b9690433f
--- /dev/null
+++ b/lib/emscripten/emsc.d.ts
@@ -0,0 +1,52 @@
+/*
+ This file is part of TALER
+ (C) 2016 GNUnet e.V.
+
+ TALER is free software; you can redistribute it and/or modify it under the
+ terms of the GNU General Public License as published by the Free Software
+ Foundation; either version 3, or (at your option) any later version.
+
+ TALER is distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along with
+ TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
+ */
+
+export interface EmscFunGen {
+ (name: string,
+ ret: string,
+ args: string[]): ((...x: (number|string)[]) => any);
+ (name: string,
+ ret: "number",
+ args: string[]): ((...x: (number|string)[]) => number);
+ (name: string,
+ ret: "void",
+ args: string[]): ((...x: (number|string)[]) => void);
+ (name: string,
+ ret: "string",
+ args: string[]): ((...x: (number|string)[]) => string);
+}
+
+
+export declare namespace Module {
+ var cwrap: EmscFunGen;
+
+ function stringToUTF8(s: string, addr: number, maxLength: number): void
+
+ function _free(ptr: number): void;
+
+ function _malloc(n: number): number;
+
+ function Pointer_stringify(p: number, len?: number): string;
+
+ function getValue(ptr: number, type: string, noSafe?: boolean): number;
+
+ function setValue(ptr: number, value: number, type: string,
+ noSafe?: boolean): void;
+
+ function writeStringToMemory(s: string,
+ buffer: number,
+ dontAddNull?: boolean): void;
+} \ No newline at end of file
diff --git a/lib/emscripten/libwrapper.js b/lib/emscripten/libwrapper.js
new file mode 100644
index 000000000..9e97ae6eb
--- /dev/null
+++ b/lib/emscripten/libwrapper.js
@@ -0,0 +1,24 @@
+var Module;if(!Module)Module=(typeof Module!=="undefined"?Module:null)||{};var moduleOverrides={};for(var key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;if(Module["ENVIRONMENT"]){if(Module["ENVIRONMENT"]==="WEB"){ENVIRONMENT_IS_WEB=true}else if(Module["ENVIRONMENT"]==="WORKER"){ENVIRONMENT_IS_WORKER=true}else if(Module["ENVIRONMENT"]==="NODE"){ENVIRONMENT_IS_NODE=true}else if(Module["ENVIRONMENT"]==="SHELL"){ENVIRONMENT_IS_SHELL=true}else{throw new Error("The provided Module['ENVIRONMENT'] value is not valid. It must be one of: WEB|WORKER|NODE|SHELL.")}}else{ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof require==="function"&&!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_WORKER;ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER}if(ENVIRONMENT_IS_NODE){if(!Module["print"])Module["print"]=console.log;if(!Module["printErr"])Module["printErr"]=console.warn;var nodeFS;var nodePath;Module["read"]=function read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);var ret=nodeFS["readFileSync"](filename);return binary?ret:ret.toString()};Module["readBinary"]=function readBinary(filename){var ret=Module["read"](filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};Module["load"]=function load(f){globalEval(read(f))};if(!Module["thisProgram"]){if(process["argv"].length>1){Module["thisProgram"]=process["argv"][1].replace(/\\/g,"/")}else{Module["thisProgram"]="unknown-program"}}Module["arguments"]=process["argv"].slice(2);if(typeof module!=="undefined"){module["exports"]=Module}process["on"]("uncaughtException",(function(ex){if(!(ex instanceof ExitStatus)){throw ex}}));Module["inspect"]=(function(){return"[Emscripten Module object]"})}else if(ENVIRONMENT_IS_SHELL){if(!Module["print"])Module["print"]=print;if(typeof printErr!="undefined")Module["printErr"]=printErr;if(typeof read!="undefined"){Module["read"]=read}else{Module["read"]=function read(){throw"no read() available (jsc?)"}}Module["readBinary"]=function readBinary(f){if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}var data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){Module["arguments"]=scriptArgs}else if(typeof arguments!="undefined"){Module["arguments"]=arguments}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){Module["read"]=function read(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};Module["readAsync"]=function readAsync(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function xhr_onload(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response)}else{onerror()}};xhr.onerror=onerror;xhr.send(null)};if(typeof arguments!="undefined"){Module["arguments"]=arguments}if(typeof console!=="undefined"){if(!Module["print"])Module["print"]=function print(x){console.log(x)};if(!Module["printErr"])Module["printErr"]=function printErr(x){console.warn(x)}}else{var TRY_USE_DUMP=false;if(!Module["print"])Module["print"]=TRY_USE_DUMP&&typeof dump!=="undefined"?(function(x){dump(x)}):(function(x){})}if(ENVIRONMENT_IS_WORKER){Module["load"]=importScripts}if(typeof Module["setWindowTitle"]==="undefined"){Module["setWindowTitle"]=(function(title){document.title=title})}}else{throw"Unknown runtime environment. Where are we?"}function globalEval(x){abort("NO_DYNAMIC_EXECUTION=1 was set, cannot eval")}if(!Module["load"]&&Module["read"]){Module["load"]=function load(f){globalEval(Module["read"](f))}}if(!Module["print"]){Module["print"]=(function(){})}if(!Module["printErr"]){Module["printErr"]=Module["print"]}if(!Module["arguments"]){Module["arguments"]=[]}if(!Module["thisProgram"]){Module["thisProgram"]="./this.program"}Module.print=Module["print"];Module.printErr=Module["printErr"];Module["preRun"]=[];Module["postRun"]=[];for(var key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=undefined;var Runtime={setTempRet0:(function(value){tempRet0=value}),getTempRet0:(function(){return tempRet0}),stackSave:(function(){return STACKTOP}),stackRestore:(function(stackTop){STACKTOP=stackTop}),getNativeTypeSize:(function(type){switch(type){case"i1":case"i8":return 1;case"i16":return 2;case"i32":return 4;case"i64":return 8;case"float":return 4;case"double":return 8;default:{if(type[type.length-1]==="*"){return Runtime.QUANTUM_SIZE}else if(type[0]==="i"){var bits=parseInt(type.substr(1));assert(bits%8===0);return bits/8}else{return 0}}}}),getNativeFieldSize:(function(type){return Math.max(Runtime.getNativeTypeSize(type),Runtime.QUANTUM_SIZE)}),STACK_ALIGN:16,prepVararg:(function(ptr,type){if(type==="double"||type==="i64"){if(ptr&7){assert((ptr&7)===4);ptr+=4}}else{assert((ptr&3)===0)}return ptr}),getAlignSize:(function(type,size,vararg){if(!vararg&&(type=="i64"||type=="double"))return 8;if(!type)return Math.min(size,8);return Math.min(size||(type?Runtime.getNativeFieldSize(type):0),Runtime.QUANTUM_SIZE)}),dynCall:(function(sig,ptr,args){if(args&&args.length){assert(args.length==sig.length-1);assert("dynCall_"+sig in Module,"bad function pointer type - no table for sig '"+sig+"'");return Module["dynCall_"+sig].apply(null,[ptr].concat(args))}else{assert(sig.length==1);assert("dynCall_"+sig in Module,"bad function pointer type - no table for sig '"+sig+"'");return Module["dynCall_"+sig].call(null,ptr)}}),functionPointers:[],addFunction:(function(func){for(var i=0;i<Runtime.functionPointers.length;i++){if(!Runtime.functionPointers[i]){Runtime.functionPointers[i]=func;return 2*(1+i)}}throw"Finished up all reserved function pointers. Use a higher value for RESERVED_FUNCTION_POINTERS."}),removeFunction:(function(index){Runtime.functionPointers[(index-2)/2]=null}),warnOnce:(function(text){if(!Runtime.warnOnce.shown)Runtime.warnOnce.shown={};if(!Runtime.warnOnce.shown[text]){Runtime.warnOnce.shown[text]=1;Module.printErr(text)}}),funcWrappers:{},getFuncWrapper:(function(func,sig){assert(sig);if(!Runtime.funcWrappers[sig]){Runtime.funcWrappers[sig]={}}var sigCache=Runtime.funcWrappers[sig];if(!sigCache[func]){if(sig.length===1){sigCache[func]=function dynCall_wrapper(){return Runtime.dynCall(sig,func)}}else if(sig.length===2){sigCache[func]=function dynCall_wrapper(arg){return Runtime.dynCall(sig,func,[arg])}}else{sigCache[func]=function dynCall_wrapper(){return Runtime.dynCall(sig,func,Array.prototype.slice.call(arguments))}}}return sigCache[func]}),getCompilerSetting:(function(name){throw"You must build with -s RETAIN_COMPILER_SETTINGS=1 for Runtime.getCompilerSetting or emscripten_get_compiler_setting to work"}),stackAlloc:(function(size){var ret=STACKTOP;STACKTOP=STACKTOP+size|0;STACKTOP=STACKTOP+15&-16;assert((STACKTOP|0)<(STACK_MAX|0)|0)|0;return ret}),staticAlloc:(function(size){var ret=STATICTOP;STATICTOP=STATICTOP+(assert(!staticSealed),size)|0;STATICTOP=STATICTOP+15&-16;return ret}),dynamicAlloc:(function(size){var ret=DYNAMICTOP;DYNAMICTOP=DYNAMICTOP+(assert(DYNAMICTOP>0),size)|0;DYNAMICTOP=DYNAMICTOP+15&-16;if(DYNAMICTOP>=TOTAL_MEMORY){var success=enlargeMemory();if(!success){DYNAMICTOP=ret;return 0}}return ret}),alignMemory:(function(size,quantum){var ret=size=Math.ceil(size/(quantum?quantum:16))*(quantum?quantum:16);return ret}),makeBigInt:(function(low,high,unsigned){var ret=unsigned?+(low>>>0)+ +(high>>>0)*+4294967296:+(low>>>0)+ +(high|0)*+4294967296;return ret}),GLOBAL_BASE:8,QUANTUM_SIZE:4,__dummy__:0};Module["Runtime"]=Runtime;var ABORT=false;var EXITSTATUS=0;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}function getCFunc(ident){var func=Module["_"+ident];if(!func){abort("NO_DYNAMIC_EXECUTION=1 was set, cannot eval")}assert(func,"Cannot call unknown function "+ident+" (perhaps LLVM optimizations or closure removed it?)");return func}var cwrap,ccall;((function(){var JSfuncs={"stackSave":(function(){Runtime.stackSave()}),"stackRestore":(function(){Runtime.stackRestore()}),"arrayToC":(function(arr){var ret=Runtime.stackAlloc(arr.length);writeArrayToMemory(arr,ret);return ret}),"stringToC":(function(str){var ret=0;if(str!==null&&str!==undefined&&str!==0){ret=Runtime.stackAlloc((str.length<<2)+1);writeStringToMemory(str,ret)}return ret})};var toC={"string":JSfuncs["stringToC"],"array":JSfuncs["arrayToC"]};ccall=function ccallFunc(ident,returnType,argTypes,args,opts){var func=getCFunc(ident);var cArgs=[];var stack=0;assert(returnType!=="array",'Return type should not be "array".');if(args){for(var i=0;i<args.length;i++){var converter=toC[argTypes[i]];if(converter){if(stack===0)stack=Runtime.stackSave();cArgs[i]=converter(args[i])}else{cArgs[i]=args[i]}}}var ret=func.apply(null,cArgs);if((!opts||!opts.async)&&typeof EmterpreterAsync==="object"){assert(!EmterpreterAsync.state,"cannot start async op with normal JS calling ccall")}if(opts&&opts.async)assert(!returnType,"async ccalls cannot return values");if(returnType==="string")ret=Pointer_stringify(ret);if(stack!==0){if(opts&&opts.async){EmterpreterAsync.asyncFinalizers.push((function(){Runtime.stackRestore(stack)}));return}Runtime.stackRestore(stack)}return ret};cwrap=function cwrap(ident,returnType,argTypes){return(function(){Runtime.warnOnce("NO_DYNAMIC_EXECUTION was set, "+"using slow cwrap implementation");return ccall(ident,returnType,argTypes,arguments)})}}))();Module["ccall"]=ccall;Module["cwrap"]=cwrap;function setValue(ptr,value,type,noSafe){type=type||"i8";if(type.charAt(type.length-1)==="*")type="i32";switch(type){case"i1":HEAP8[ptr>>0]=value;break;case"i8":HEAP8[ptr>>0]=value;break;case"i16":HEAP16[ptr>>1]=value;break;case"i32":HEAP32[ptr>>2]=value;break;case"i64":tempI64=[value>>>0,(tempDouble=value,+Math_abs(tempDouble)>=+1?tempDouble>+0?(Math_min(+Math_floor(tempDouble/+4294967296),+4294967295)|0)>>>0:~~+Math_ceil((tempDouble- +(~~tempDouble>>>0))/+4294967296)>>>0:0)],HEAP32[ptr>>2]=tempI64[0],HEAP32[ptr+4>>2]=tempI64[1];break;case"float":HEAPF32[ptr>>2]=value;break;case"double":HEAPF64[ptr>>3]=value;break;default:abort("invalid type for setValue: "+type)}}Module["setValue"]=setValue;function getValue(ptr,type,noSafe){type=type||"i8";if(type.charAt(type.length-1)==="*")type="i32";switch(type){case"i1":return HEAP8[ptr>>0];case"i8":return HEAP8[ptr>>0];case"i16":return HEAP16[ptr>>1];case"i32":return HEAP32[ptr>>2];case"i64":return HEAP32[ptr>>2];case"float":return HEAPF32[ptr>>2];case"double":return HEAPF64[ptr>>3];default:abort("invalid type for setValue: "+type)}return null}Module["getValue"]=getValue;var ALLOC_NORMAL=0;var ALLOC_STACK=1;var ALLOC_STATIC=2;var ALLOC_DYNAMIC=3;var ALLOC_NONE=4;Module["ALLOC_NORMAL"]=ALLOC_NORMAL;Module["ALLOC_STACK"]=ALLOC_STACK;Module["ALLOC_STATIC"]=ALLOC_STATIC;Module["ALLOC_DYNAMIC"]=ALLOC_DYNAMIC;Module["ALLOC_NONE"]=ALLOC_NONE;function allocate(slab,types,allocator,ptr){var zeroinit,size;if(typeof slab==="number"){zeroinit=true;size=slab}else{zeroinit=false;size=slab.length}var singleType=typeof types==="string"?types:null;var ret;if(allocator==ALLOC_NONE){ret=ptr}else{ret=[typeof _malloc==="function"?_malloc:Runtime.staticAlloc,Runtime.stackAlloc,Runtime.staticAlloc,Runtime.dynamicAlloc][allocator===undefined?ALLOC_STATIC:allocator](Math.max(size,singleType?1:types.length))}if(zeroinit){var ptr=ret,stop;assert((ret&3)==0);stop=ret+(size&~3);for(;ptr<stop;ptr+=4){HEAP32[ptr>>2]=0}stop=ret+size;while(ptr<stop){HEAP8[ptr++>>0]=0}return ret}if(singleType==="i8"){if(slab.subarray||slab.slice){HEAPU8.set(slab,ret)}else{HEAPU8.set(new Uint8Array(slab),ret)}return ret}var i=0,type,typeSize,previousType;while(i<size){var curr=slab[i];if(typeof curr==="function"){curr=Runtime.getFunctionIndex(curr)}type=singleType||types[i];if(type===0){i++;continue}assert(type,"Must know what type to store in allocate!");if(type=="i64")type="i32";setValue(ret+i,curr,type);if(previousType!==type){typeSize=Runtime.getNativeTypeSize(type);previousType=type}i+=typeSize}return ret}Module["allocate"]=allocate;function getMemory(size){if(!staticSealed)return Runtime.staticAlloc(size);if(typeof _sbrk!=="undefined"&&!_sbrk.called||!runtimeInitialized)return Runtime.dynamicAlloc(size);return _malloc(size)}Module["getMemory"]=getMemory;function Pointer_stringify(ptr,length){if(length===0||!ptr)return"";var hasUtf=0;var t;var i=0;while(1){assert(ptr+i<TOTAL_MEMORY);t=HEAPU8[ptr+i>>0];hasUtf|=t;if(t==0&&!length)break;i++;if(length&&i==length)break}if(!length)length=i;var ret="";if(hasUtf<128){var MAX_CHUNK=1024;var curr;while(length>0){curr=String.fromCharCode.apply(String,HEAPU8.subarray(ptr,ptr+Math.min(length,MAX_CHUNK)));ret=ret?ret+curr:curr;ptr+=MAX_CHUNK;length-=MAX_CHUNK}return ret}return Module["UTF8ToString"](ptr)}Module["Pointer_stringify"]=Pointer_stringify;function AsciiToString(ptr){var str="";while(1){var ch=HEAP8[ptr++>>0];if(!ch)return str;str+=String.fromCharCode(ch)}}Module["AsciiToString"]=AsciiToString;function stringToAscii(str,outPtr){return writeAsciiToMemory(str,outPtr,false)}Module["stringToAscii"]=stringToAscii;function UTF8ArrayToString(u8Array,idx){var u0,u1,u2,u3,u4,u5;var str="";while(1){u0=u8Array[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}u1=u8Array[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}u2=u8Array[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u3=u8Array[idx++]&63;if((u0&248)==240){u0=(u0&7)<<18|u1<<12|u2<<6|u3}else{u4=u8Array[idx++]&63;if((u0&252)==248){u0=(u0&3)<<24|u1<<18|u2<<12|u3<<6|u4}else{u5=u8Array[idx++]&63;u0=(u0&1)<<30|u1<<24|u2<<18|u3<<12|u4<<6|u5}}}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}}Module["UTF8ArrayToString"]=UTF8ArrayToString;function UTF8ToString(ptr){return UTF8ArrayToString(HEAPU8,ptr)}Module["UTF8ToString"]=UTF8ToString;function stringToUTF8Array(str,outU8Array,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i<str.length;++i){var u=str.charCodeAt(i);if(u>=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127){if(outIdx>=endIdx)break;outU8Array[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;outU8Array[outIdx++]=192|u>>6;outU8Array[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;outU8Array[outIdx++]=224|u>>12;outU8Array[outIdx++]=128|u>>6&63;outU8Array[outIdx++]=128|u&63}else if(u<=2097151){if(outIdx+3>=endIdx)break;outU8Array[outIdx++]=240|u>>18;outU8Array[outIdx++]=128|u>>12&63;outU8Array[outIdx++]=128|u>>6&63;outU8Array[outIdx++]=128|u&63}else if(u<=67108863){if(outIdx+4>=endIdx)break;outU8Array[outIdx++]=248|u>>24;outU8Array[outIdx++]=128|u>>18&63;outU8Array[outIdx++]=128|u>>12&63;outU8Array[outIdx++]=128|u>>6&63;outU8Array[outIdx++]=128|u&63}else{if(outIdx+5>=endIdx)break;outU8Array[outIdx++]=252|u>>30;outU8Array[outIdx++]=128|u>>24&63;outU8Array[outIdx++]=128|u>>18&63;outU8Array[outIdx++]=128|u>>12&63;outU8Array[outIdx++]=128|u>>6&63;outU8Array[outIdx++]=128|u&63}}outU8Array[outIdx]=0;return outIdx-startIdx}Module["stringToUTF8Array"]=stringToUTF8Array;function stringToUTF8(str,outPtr,maxBytesToWrite){assert(typeof maxBytesToWrite=="number","stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!");return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}Module["stringToUTF8"]=stringToUTF8;function lengthBytesUTF8(str){var len=0;for(var i=0;i<str.length;++i){var u=str.charCodeAt(i);if(u>=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127){++len}else if(u<=2047){len+=2}else if(u<=65535){len+=3}else if(u<=2097151){len+=4}else if(u<=67108863){len+=5}else{len+=6}}return len}Module["lengthBytesUTF8"]=lengthBytesUTF8;function demangle(func){var hasLibcxxabi=!!Module["___cxa_demangle"];if(hasLibcxxabi){try{var buf=_malloc(func.length);writeStringToMemory(func.substr(1),buf);var status=_malloc(4);var ret=Module["___cxa_demangle"](buf,0,0,status);if(getValue(status,"i32")===0&&ret){return Pointer_stringify(ret)}}catch(e){}finally{if(buf)_free(buf);if(status)_free(status);if(ret)_free(ret)}return func}Runtime.warnOnce("warning: build with -s DEMANGLE_SUPPORT=1 to link in libcxxabi demangling");return func}function demangleAll(text){return text.replace(/__Z[\w\d_]+/g,(function(x){var y=demangle(x);return x===y?x:x+" ["+y+"]"}))}function jsStackTrace(){var err=new Error;if(!err.stack){try{throw new Error(0)}catch(e){err=e}if(!err.stack){return"(no stack trace available)"}}return err.stack.toString()}function stackTrace(){var js=jsStackTrace();if(Module["extraStackTrace"])js+="\n"+Module["extraStackTrace"]();return demangleAll(js)}Module["stackTrace"]=stackTrace;var PAGE_SIZE=4096;function alignMemoryPage(x){if(x%4096>0){x+=4096-x%4096}return x}var HEAP;var buffer;var HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;function updateGlobalBufferViews(){Module["HEAP8"]=HEAP8=new Int8Array(buffer);Module["HEAP16"]=HEAP16=new Int16Array(buffer);Module["HEAP32"]=HEAP32=new Int32Array(buffer);Module["HEAPU8"]=HEAPU8=new Uint8Array(buffer);Module["HEAPU16"]=HEAPU16=new Uint16Array(buffer);Module["HEAPU32"]=HEAPU32=new Uint32Array(buffer);Module["HEAPF32"]=HEAPF32=new Float32Array(buffer);Module["HEAPF64"]=HEAPF64=new Float64Array(buffer)}var STATIC_BASE=0,STATICTOP=0,staticSealed=false;var STACK_BASE=0,STACKTOP=0,STACK_MAX=0;var DYNAMIC_BASE=0,DYNAMICTOP=0;function writeStackCookie(){assert((STACK_MAX&3)==0);HEAPU32[(STACK_MAX>>2)-1]=34821223;HEAPU32[(STACK_MAX>>2)-2]=2310721022}function checkStackCookie(){if(HEAPU32[(STACK_MAX>>2)-1]!=34821223||HEAPU32[(STACK_MAX>>2)-2]!=2310721022){abort("Stack overflow! Stack cookie has been overwritten, expected hex dwords 0x89BACDFE and 0x02135467, but received 0x"+HEAPU32[(STACK_MAX>>2)-2].toString(16)+" "+HEAPU32[(STACK_MAX>>2)-1].toString(16))}}function abortStackOverflow(allocSize){abort("Stack overflow! Attempted to allocate "+allocSize+" bytes on the stack, but stack has only "+(STACK_MAX-asm.stackSave()+allocSize)+" bytes available!")}function abortOnCannotGrowMemory(){abort("Cannot enlarge memory arrays. Either (1) compile with -s TOTAL_MEMORY=X with X higher than the current value "+TOTAL_MEMORY+", (2) compile with -s ALLOW_MEMORY_GROWTH=1 which adjusts the size at runtime but prevents some optimizations, (3) set Module.TOTAL_MEMORY to a higher value before the program runs, or if you want malloc to return NULL (0) instead of this abort, compile with -s ABORTING_MALLOC=0 ")}function enlargeMemory(){abortOnCannotGrowMemory()}var TOTAL_STACK=Module["TOTAL_STACK"]||5242880;var TOTAL_MEMORY=Module["TOTAL_MEMORY"]||16777216;var totalMemory=64*1024;while(totalMemory<TOTAL_MEMORY||totalMemory<2*TOTAL_STACK){if(totalMemory<16*1024*1024){totalMemory*=2}else{totalMemory+=16*1024*1024}}if(totalMemory!==TOTAL_MEMORY){Module.printErr("increasing TOTAL_MEMORY to "+totalMemory+" to be compliant with the asm.js spec (and given that TOTAL_STACK="+TOTAL_STACK+")");TOTAL_MEMORY=totalMemory}assert(typeof Int32Array!=="undefined"&&typeof Float64Array!=="undefined"&&!!(new Int32Array(1))["subarray"]&&!!(new Int32Array(1))["set"],"JS engine does not provide full typed array support");if(Module["buffer"]){buffer=Module["buffer"];assert(buffer.byteLength===TOTAL_MEMORY,"provided buffer should be "+TOTAL_MEMORY+" bytes, but it is "+buffer.byteLength)}else{buffer=new ArrayBuffer(TOTAL_MEMORY)}updateGlobalBufferViews();HEAP32[0]=255;if(HEAPU8[0]!==255||HEAPU8[3]!==0)throw"Typed arrays 2 must be run on a little-endian system";Module["HEAP"]=HEAP;Module["buffer"]=buffer;Module["HEAP8"]=HEAP8;Module["HEAP16"]=HEAP16;Module["HEAP32"]=HEAP32;Module["HEAPU8"]=HEAPU8;Module["HEAPU16"]=HEAPU16;Module["HEAPU32"]=HEAPU32;Module["HEAPF32"]=HEAPF32;Module["HEAPF64"]=HEAPF64;function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback();continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){Runtime.dynCall("v",func)}else{Runtime.dynCall("vi",func,[callback.arg])}}else{func(callback.arg===undefined?null:callback.arg)}}}var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;function preRun(){if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function ensureInitRuntime(){checkStackCookie();if(runtimeInitialized)return;runtimeInitialized=true;callRuntimeCallbacks(__ATINIT__)}function preMain(){checkStackCookie();callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){checkStackCookie();callRuntimeCallbacks(__ATEXIT__);runtimeExited=true}function postRun(){checkStackCookie();if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}Module["addOnPreRun"]=addOnPreRun;function addOnInit(cb){__ATINIT__.unshift(cb)}Module["addOnInit"]=addOnInit;function addOnPreMain(cb){__ATMAIN__.unshift(cb)}Module["addOnPreMain"]=addOnPreMain;function addOnExit(cb){__ATEXIT__.unshift(cb)}Module["addOnExit"]=addOnExit;function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}Module["addOnPostRun"]=addOnPostRun;function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}Module["intArrayFromString"]=intArrayFromString;function intArrayToString(array){var ret=[];for(var i=0;i<array.length;i++){var chr=array[i];if(chr>255){assert(false,"Character code "+chr+" ("+String.fromCharCode(chr)+") at offset "+i+" not in 0x00-0xFF.");chr&=255}ret.push(String.fromCharCode(chr))}return ret.join("")}Module["intArrayToString"]=intArrayToString;function writeStringToMemory(string,buffer,dontAddNull){var array=intArrayFromString(string,dontAddNull);var i=0;while(i<array.length){var chr=array[i];HEAP8[buffer+i>>0]=chr;i=i+1}}Module["writeStringToMemory"]=writeStringToMemory;function writeArrayToMemory(array,buffer){for(var i=0;i<array.length;i++){HEAP8[buffer++>>0]=array[i]}}Module["writeArrayToMemory"]=writeArrayToMemory;function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i<str.length;++i){assert(str.charCodeAt(i)===str.charCodeAt(i)&255);HEAP8[buffer++>>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}Module["writeAsciiToMemory"]=writeAsciiToMemory;if(!Math["imul"]||Math["imul"](4294967295,5)!==-5)Math["imul"]=function imul(a,b){var ah=a>>>16;var al=a&65535;var bh=b>>>16;var bl=b&65535;return al*bl+(ah*bl+al*bh<<16)|0};Math.imul=Math["imul"];if(!Math["clz32"])Math["clz32"]=(function(x){x=x>>>0;for(var i=0;i<32;i++){if(x&1<<31-i)return i}return 32});Math.clz32=Math["clz32"];if(!Math["trunc"])Math["trunc"]=(function(x){return x<0?Math.ceil(x):Math.floor(x)});Math.trunc=Math["trunc"];var Math_abs=Math.abs;var Math_cos=Math.cos;var Math_sin=Math.sin;var Math_tan=Math.tan;var Math_acos=Math.acos;var Math_asin=Math.asin;var Math_atan=Math.atan;var Math_atan2=Math.atan2;var Math_exp=Math.exp;var Math_log=Math.log;var Math_sqrt=Math.sqrt;var Math_ceil=Math.ceil;var Math_floor=Math.floor;var Math_pow=Math.pow;var Math_imul=Math.imul;var Math_fround=Math.fround;var Math_min=Math.min;var Math_clz32=Math.clz32;var Math_trunc=Math.trunc;var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;var runDependencyTracking={};function getUniqueRunDependency(id){var orig=id;while(1){if(!runDependencyTracking[id])return id;id=orig+Math.random()}return id}function addRunDependency(id){runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(id){assert(!runDependencyTracking[id]);runDependencyTracking[id]=1;if(runDependencyWatcher===null&&typeof setInterval!=="undefined"){runDependencyWatcher=setInterval((function(){if(ABORT){clearInterval(runDependencyWatcher);runDependencyWatcher=null;return}var shown=false;for(var dep in runDependencyTracking){if(!shown){shown=true;Module.printErr("still waiting on run dependencies:")}Module.printErr("dependency: "+dep)}if(shown){Module.printErr("(end of list)")}}),1e4)}}else{Module.printErr("warning: run dependency added without ID")}}Module["addRunDependency"]=addRunDependency;function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(id){assert(runDependencyTracking[id]);delete runDependencyTracking[id]}else{Module.printErr("warning: run dependency removed without ID")}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["removeRunDependency"]=removeRunDependency;Module["preloadedImages"]={};Module["preloadedAudios"]={};var ASM_CONSTS=[];STATIC_BASE=8;STATICTOP=STATIC_BASE+77136;__ATINIT__.push({func:(function(){_GNUNET_util_cl_init()})},{func:(function(){_GNUNET_CRYPTO_random_init()})},{func:(function(){_gpg_err_init()})});allocate([0,0,0,0,0,0,0,0,102,154,0,127,199,106,69,159,152,186,249,23,254,223,149,34,17,154,0,127,199,106,69,159,152,186,249,23,254,223,149,51,6,154,0,127,199,106,69,159,152,186,249,23,254,223,149,33,255,255,255,255,255,255,255,255,34,174,40,215,152,47,138,66,205,101,239,35,145,68,55,113,47,59,77,236,207,251,192,181,188,219,137,129,165,219,181,233,56,181,72,243,91,194,86,57,25,208,5,182,241,17,241,89,155,79,25,175,164,130,63,146,24,129,109,218,213,94,28,171,66,2,3,163,152,170,7,216,190,111,112,69,1,91,131,18,140,178,228,78,190,133,49,36,226,180,255,213,195,125,12,85,111,137,123,242,116,93,190,114,177,150,22,59,254,177,222,128,53,18,199,37,167,6,220,155,148,38,105,207,116,241,155,193,210,74,241,158,193,105,155,228,227,37,79,56,134,71,190,239,181,213,140,139,198,157,193,15,101,156,172,119,204,161,12,36,117,2,43,89,111,44,233,45,131,228,166,110,170,132,116,74,212,251,65,189,220,169,176,92,181,83,17,131,218,136,249,118,171,223,102,238,82,81,62,152,16,50,180,45,109,198,49,168,63,33,251,152,200,39,3,176,228,14,239,190,199,127,89,191,194,143,168,61,243,11,224,198,37,167,10,147,71,145,167,213,111,130,3,224,81,99,202,6,112,110,14,10,103,41,41,20,252,47,210,70,133,10,183,39,38,201,38,92,56,33,27,46,237,42,196,90,252,109,44,77,223,179,149,157,19,13,56,83,222,99,175,139,84,115,10,101,168,178,119,60,187,10,106,118,230,174,237,71,46,201,194,129,59,53,130,20,133,44,114,146,100,3,241,76,161,232,191,162,1,48,66,188,75,102,26,168,145,151,248,208,112,139,75,194,48,190,84,6,163,81,108,199,24,82,239,214,25,232,146,209,16,169,101,85,36,6,153,214,42,32,113,87,133,53,14,244,184,209,187,50,112,160,106,16,200,208,210,184,22,193,164,25,83,171,65,81,8,108,55,30,153,235,142,223,76,119,72,39,168,72,155,225,181,188,176,52,99,90,201,197,179,12,28,57,203,138,65,227,74,170,216,78,115,227,99,119,79,202,156,91,163,184,178,214,243,111,46,104,252,178,239,93,238,130,143,116,96,47,23,67,111,99,165,120,114,171,240,161,20,120,200,132,236,57,100,26,8,2,199,140,40,30,99,35,250,255,190,144,233,189,130,222,235,108,80,164,21,121,198,178,247,163,249,190,43,83,114,227,242,120,113,198,156,97,38,234,206,62,39,202,7,194,192,33,199,184,134,209,30,235,224,205,214,125,218,234,120,209,110,238,127,79,125,245,186,111,23,114,170,103,240,6,166,152,200,162,197,125,99,10,174,13,249,190,4,152,63,17,27,71,28,19,53,11,113,27,132,125,4,35,245,119,219,40,147,36,199,64,123,171,202,50,188,190,201,21,10,190,158,60,76,13,16,156,196,103,29,67,182,66,62,203,190,212,197,76,42,126,101,252,156,41,127,89,236,250,214,58,171,111,203,95,23,88,71,74,140,25,68,108,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,133,84,0,0,255,255,255,255,255,255,255,255,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,68,88,0,0,2,0,0,0,80,88,0,0,4,0,0,0,92,88,0,0,8,0,0,0,104,88,0,0,16,0,0,0,117,88,0,0,32,0,0,0,127,88,0,0,64,0,0,0,138,88,0,0,128,0,0,0,150,88,0,0,0,1,0,0,163,88,0,0,0,2,0,0,175,88,0,0,0,4,0,0,188,88,0,0,0,8,0,0,198,88,0,0,0,16,0,0,209,88,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,7,0,0,0,8,0,0,0,9,0,0,0,0,0,0,0,2,0,0,0,11,0,0,0,8,0,0,0,9,0,0,0,10,0,0,0,0,0,0,0,2,0,0,0,11,0,0,0,8,0,0,0,9,0,0,0,10,0,0,0,0,0,0,0,1,0,0,0,17,0,0,0,0,0,0,0,100,17,0,0,156,28,0,0,16,29,0,0,112,32,0,0,176,48,0,0,0,0,0,0,241,139,0,0,0,1,0,0,0,0,0,0,2,0,0,0,1,0,0,0,133,95,0,0,200,95,0,0,206,95,0,0,18,96,0,0,85,96,0,0,152,96,0,0,219,96,0,0,224,96,0,0,192,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,235,96,0,0,30,97,0,0,81,97,0,0,132,97,0,0,183,97,0,0,234,97,0,0,29,98,0,0,34,98,0,0,224,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,45,98,0,0,104,98,0,0,163,98,0,0,222,98,0,0,25,99,0,0,84,99,0,0,29,98,0,0,143,99,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,154,99,0,0,221,99,0,0,32,100,0,0,99,100,0,0,166,100,0,0,233,100,0,0,29,98,0,0,44,101,0,0,128,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,55,101,0,0,154,101,0,0,253,101,0,0,96,102,0,0,195,102,0,0,38,103,0,0,29,98,0,0,137,103,0,0,9,2,0,0,1,0,0,0,0,0,0,0,0,0,0,0,148,103,0,0,27,104,0,0,162,104,0,0,40,105,0,0,174,105,0,0,53,106,0,0,29,98,0,0,188,106,0,0,160,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,204,106,0,0,247,106,0,0,34,107,0,0,77,107,0,0,120,107,0,0,163,107,0,0,29,98,0,0,206,107,0,0,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,222,107,0,0,17,108,0,0,68,108,0,0,119,108,0,0,170,108,0,0,221,108,0,0,29,98,0,0,16,109,0,0,224,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,109,0,0,91,109,0,0,150,109,0,0,209,109,0,0,12,110,0,0,71,110,0,0,29,98,0,0,130,110,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,146,110,0,0,213,110,0,0,24,111,0,0,91,111,0,0,158,111,0,0,225,111,0,0,29,98,0,0,36,112,0,0,64,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,112,0,0,135,112,0,0,218,112,0,0,45,113,0,0,128,113,0,0,211,113,0,0,29,98,0,0,38,114,0,0,128,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,114,0,0,153,114,0,0,252,114,0,0,95,115,0,0,194,115,0,0,37,116,0,0,29,98,0,0,136,116,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,152,116,0,0,27,117,0,0,158,117,0,0,33,118,0,0,164,118,0,0,39,119,0,0,29,98,0,0,170,119,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,184,119,0,0,251,119,0,0,62,120,0,0,129,120,0,0,196,120,0,0,7,121,0,0,29,98,0,0,74,121,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,95,121,0,0,162,121,0,0,229,121,0,0,40,122,0,0,107,122,0,0,174,122,0,0,29,98,0,0,241,122,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,123,0,0,73,123,0,0,140,123,0,0,207,123,0,0,107,122,0,0,18,124,0,0,29,98,0,0,85,124,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,106,124,0,0,173,124,0,0,240,124,0,0,51,125,0,0,118,125,0,0,185,125,0,0,29,98,0,0,252,125,0,0,255,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,126,0,0,251,119,0,0,141,126,0,0,16,127,0,0,147,127,0,0,22,128,0,0,29,98,0,0,153,128,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,169,128,0,0,44,129,0,0,175,129,0,0,50,130,0,0,181,130,0,0,56,131,0,0,29,98,0,0,187,131,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,131,0,0,78,132,0,0,209,132,0,0,84,133,0,0,215,133,0,0,90,134,0,0,29,98,0,0,221,134,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,231,134,0,0,118,125,0,0,251,119,0,0,42,135,0,0,109,135,0,0,176,135,0,0,29,98,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,241,139,0,0,243,135,0,0,224,96,0,0,10,136,0,0,224,96,0,0,30,136,0,0,224,96,0,0,41,136,0,0,224,96,0,0,51,136,0,0,34,98,0,0,60,136,0,0,34,98,0,0,70,136,0,0,34,98,0,0,83,136,0,0,143,99,0,0,92,136,0,0,143,99,0,0,112,136,0,0,143,99,0,0,123,136,0,0,143,99,0,0,133,136,0,0,44,101,0,0,142,136,0,0,44,101,0,0,152,136,0,0,44,101,0,0,165,136,0,0,137,103,0,0,174,136,0,0,137,103,0,0,184,136,0,0,137,103,0,0,197,136,0,0,188,106,0,0,206,136,0,0,206,107,0,0,227,136,0,0,16,109,0,0,248,136,0,0,130,110,0,0,13,137,0,0,36,112,0,0,34,137,0,0,38,114,0,0,55,137,0,0,136,116,0,0,77,137,0,0,170,119,0,0,99,137,0,0,74,121,0,0,116,137,0,0,241,122,0,0,133,137,0,0,85,124,0,0,150,137,0,0,74,121,0,0,167,137,0,0,85,124,0,0,191,137,0,0,74,121,0,0,215,137,0,0,85,124,0,0,232,137,0,0,153,128,0,0,249,137,0,0,187,131,0,0,13,138,0,0,221,134,0,0,33,138,0,0,0,0,0,0,0,0,0,0,45,141,0,0,59,141,0,0,88,141,0,0,163,14,1,9,139,198,219,191,69,105,15,58,126,158,109,15,139,190,162,163,158,97,72,0,143,208,94,68,93,141,0,0,107,141,0,0,116,141,0,0,137,111,177,18,138,187,223,25,104,50,16,124,212,157,243,63,71,180,177,22,153,18,186,79,83,104,75,34,137,141,0,0,152,141,0,0,203,141,0,0,127,179,203,53,136,198,193,246,255,169,105,77,125,106,210,100,147,101,176,193,246,93,105,209,236,131,51,234,224,141,0,0,239,141,0,0,34,142,0,0,108,17,80,104,116,1,60,172,106,42,188,27,179,130,98,124,236,106,144,216,110,252,1,45,231,175,236,90,60,142,0,0,76,142,0,0,131,142,0,0,149,233,160,219,150,32,149,173,174,190,155,45,111,13,188,226,212,153,241,18,242,210,183,39,63,166,135,14,7,143,0,0,24,143,0,0,131,142,0,0,58,133,65,102,172,93,159,2,63,84,213,23,208,179,157,189,148,103,112,219,156,43,149,201,246,245,101,209,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,45,141,0,0,59,141,0,0,88,141,0,0,91,220,193,70,191,96,117,78,106,4,36,38,8,149,117,199,90,0,63,8,157,39,57,131,157,236,88,185,100,236,56,67,93,141,0,0,107,141,0,0,116,141,0,0,176,52,76,97,216,219,56,83,92,168,175,206,175,11,241,43,136,29,194,0,201,131,61,167,38,233,55,108,46,50,207,247,137,141,0,0,152,141,0,0,203,141,0,0,119,62,169,30,54,128,14,70,133,77,184,235,208,145,129,167,41,89,9,139,62,248,193,34,217,99,85,20,206,213,101,254,224,141,0,0,239,141,0,0,34,142,0,0,130,85,138,56,154,68,60,14,164,204,129,152,153,242,8,58,133,240,250,163,229,120,248,7,122,46,63,244,103,41,102,91,60,142,0,0,76,142,0,0,131,142,0,0,96,228,49,89,30,224,182,127,13,138,38,170,203,245,183,127,142,11,198,33,55,40,197,20,5,70,4,15,14,227,127,84,7,143,0,0,24,143,0,0,131,142,0,0,155,9,255,167,27,148,47,203,39,99,95,188,213,176,233,68,191,220,99,100,79,7,19,147,138,127,81,83,92,58,53,226,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,45,141,0,0,59,141,0,0,88,141,0,0,175,69,210,227,118,72,64,49,97,127,120,210,181,138,107,27,156,126,244,100,245,160,27,71,228,46,195,115,99,34,68,94,142,34,64,202,94,105,226,199,139,50,57,236,250,178,22,73,93,141,0,0,107,141,0,0,116,141,0,0,175,208,57,68,216,72,149,98,107,8,37,244,171,70,144,127,21,249,218,219,228,16,30,198,130,170,3,76,124,235,197,156,250,234,158,169,7,110,222,127,74,241,82,232,178,250,156,182,137,141,0,0,152,141,0,0,203,141,0,0,136,6,38,8,211,230,173,138,10,162,172,224,20,200,168,111,10,166,53,217,71,172,159,235,232,62,244,229,89,102,20,75,42,90,179,157,193,56,20,185,78,58,182,225,1,163,79,39,224,141,0,0,239,141,0,0,34,142,0,0,62,138,105,183,120,60,37,133,25,51,171,98,144,175,108,167,122,153,129,72,8,80,0,156,197,87,124,110,31,87,59,78,104,1,221,35,196,167,214,121,204,248,163,134,198,116,207,251,60,142,0,0,76,142,0,0,131,142,0,0,78,206,8,68,133,129,62,144,136,210,198,58,4,27,197,180,79,158,241,1,42,43,88,143,60,209,31,5,3,58,196,198,12,46,246,171,64,48,254,130,150,36,141,241,99,244,73,82,7,143,0,0,24,143,0,0,131,142,0,0,102,23,23,142,148,31,2,13,53,30,47,37,78,143,211,44,96,36,32,254,176,184,251,154,220,206,187,130,70,30,153,197,166,120,204,49,231,153,23,109,56,96,230,17,12,70,82,62,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,45,141,0,0,59,141,0,0,88,141,0,0,22,75,122,123,252,248,25,226,227,149,251,231,59,86,224,163,135,189,100,34,46,131,31,214,16,39,12,215,234,37,5,84,151,88,191,117,192,90,153,74,109,3,79,101,248,240,230,253,202,234,177,163,77,74,107,75,99,110,7,10,56,188,231,55,93,141,0,0,107,141,0,0,116,141,0,0,135,170,124,222,165,239,97,157,79,240,180,36,26,29,108,176,35,121,244,226,206,78,194,120,122,208,179,5,69,225,124,222,218,168,51,183,214,184,167,2,3,139,39,78,174,163,244,228,190,157,145,78,235,97,241,112,46,105,108,32,58,18,104,84,137,141,0,0,152,141,0,0,203,141,0,0,250,115,176,8,157,86,162,132,239,176,240,117,108,137,11,233,177,181,219,221,142,232,26,54,85,248,62,51,178,39,157,57,191,62,132,130,121,167,34,200,6,180,133,164,126,103,200,7,185,70,163,55,190,232,148,38,116,39,136,89,225,50,146,251,224,141,0,0,239,141,0,0,34,142,0,0,176,186,70,86,55,69,140,105,144,229,168,197,246,29,74,247,229,118,217,127,249,75,135,45,231,111,128,80,54,30,227,219,169,28,165,193,26,162,94,180,214,121,39,92,197,120,128,99,165,241,151,65,18,12,79,45,226,173,235,235,16,162,152,221,60,142,0,0,76,142,0,0,131,142,0,0,128,178,66,99,199,193,163,235,183,20,147,193,221,123,232,180,155,70,209,244,27,74,238,193,18,27,1,55,131,248,243,82,107,86,208,55,224,95,37,152,189,15,210,33,93,106,30,82,149,230,79,115,246,63,10,236,139,145,90,152,93,120,101,152,7,143,0,0,24,143,0,0,131,142,0,0,227,123,106,119,93,200,125,186,164,223,169,249,110,94,63,253,222,189,113,248,134,114,137,134,93,245,163,45,32,205,201,68,182,2,44,172,60,73,130,177,13,94,235,85,195,228,222,21,19,70,118,251,109,224,68,96,101,201,116,64,250,140,106,88,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40,30,0,0,176,31,0,0,116,30,0,0,240,31,0,0,48,32,0,0,132,29,0,0,0,0,0,0,156,2,0,0,0,147,0,0,2,0,0,0,5,147,0,0,1,0,0,0,9,147,0,0,8,0,0,0,16,147,0,0,3,0,0,0,26,147,0,0,3,0,0,0,33,147,0,0,9,0,0,0,40,147,0,0,10,0,0,0,47,147,0,0,11,0,0,0,54,147,0,0,5,0,0,0,58,147,0,0,45,1,0,0,62,147,0,0,6,0,0,0,68,147,0,0,7,0,0,0,0,0,0,0,0,0,0,0,28,50,0,0,196,29,0,0,0,0,0,0,7,0,0,0,2,0,0,0,218,147,0,0,164,17,0,0,180,17,0,0,16,0,0,0,128,0,0,0,248,1,0,0,1,0,0,0,2,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,222,147,0,0,231,147,0,0,238,147,0,0,0,0,0,0,246,147,0,0,1,0,0,0,13,148,0,0,3,0,0,0,36,148,0,0,5,0,0,0,59,148,0,0,2,0,0,0,0,0,0,0,0,0,0,0,198,99,99,165,248,124,124,132,238,119,119,153,246,123,123,141,255,242,242,13,214,107,107,189,222,111,111,177,145,197,197,84,96,48,48,80,2,1,1,3,206,103,103,169,86,43,43,125,231,254,254,25,181,215,215,98,77,171,171,230,236,118,118,154,143,202,202,69,31,130,130,157,137,201,201,64,250,125,125,135,239,250,250,21,178,89,89,235,142,71,71,201,251,240,240,11,65,173,173,236,179,212,212,103,95,162,162,253,69,175,175,234,35,156,156,191,83,164,164,247,228,114,114,150,155,192,192,91,117,183,183,194,225,253,253,28,61,147,147,174,76,38,38,106,108,54,54,90,126,63,63,65,245,247,247,2,131,204,204,79,104,52,52,92,81,165,165,244,209,229,229,52,249,241,241,8,226,113,113,147,171,216,216,115,98,49,49,83,42,21,21,63,8,4,4,12,149,199,199,82,70,35,35,101,157,195,195,94,48,24,24,40,55,150,150,161,10,5,5,15,47,154,154,181,14,7,7,9,36,18,18,54,27,128,128,155,223,226,226,61,205,235,235,38,78,39,39,105,127,178,178,205,234,117,117,159,18,9,9,27,29,131,131,158,88,44,44,116,52,26,26,46,54,27,27,45,220,110,110,178,180,90,90,238,91,160,160,251,164,82,82,246,118,59,59,77,183,214,214,97,125,179,179,206,82,41,41,123,221,227,227,62,94,47,47,113,19,132,132,151,166,83,83,245,185,209,209,104,0,0,0,0,193,237,237,44,64,32,32,96,227,252,252,31,121,177,177,200,182,91,91,237,212,106,106,190,141,203,203,70,103,190,190,217,114,57,57,75,148,74,74,222,152,76,76,212,176,88,88,232,133,207,207,74,187,208,208,107,197,239,239,42,79,170,170,229,237,251,251,22,134,67,67,197,154,77,77,215,102,51,51,85,17,133,133,148,138,69,69,207,233,249,249,16,4,2,2,6,254,127,127,129,160,80,80,240,120,60,60,68,37,159,159,186,75,168,168,227,162,81,81,243,93,163,163,254,128,64,64,192,5,143,143,138,63,146,146,173,33,157,157,188,112,56,56,72,241,245,245,4,99,188,188,223,119,182,182,193,175,218,218,117,66,33,33,99,32,16,16,48,229,255,255,26,253,243,243,14,191,210,210,109,129,205,205,76,24,12,12,20,38,19,19,53,195,236,236,47,190,95,95,225,53,151,151,162,136,68,68,204,46,23,23,57,147,196,196,87,85,167,167,242,252,126,126,130,122,61,61,71,200,100,100,172,186,93,93,231,50,25,25,43,230,115,115,149,192,96,96,160,25,129,129,152,158,79,79,209,163,220,220,127,68,34,34,102,84,42,42,126,59,144,144,171,11,136,136,131,140,70,70,202,199,238,238,41,107,184,184,211,40,20,20,60,167,222,222,121,188,94,94,226,22,11,11,29,173,219,219,118,219,224,224,59,100,50,50,86,116,58,58,78,20,10,10,30,146,73,73,219,12,6,6,10,72,36,36,108,184,92,92,228,159,194,194,93,189,211,211,110,67,172,172,239,196,98,98,166,57,145,145,168,49,149,149,164,211,228,228,55,242,121,121,139,213,231,231,50,139,200,200,67,110,55,55,89,218,109,109,183,1,141,141,140,177,213,213,100,156,78,78,210,73,169,169,224,216,108,108,180,172,86,86,250,243,244,244,7,207,234,234,37,202,101,101,175,244,122,122,142,71,174,174,233,16,8,8,24,111,186,186,213,240,120,120,136,74,37,37,111,92,46,46,114,56,28,28,36,87,166,166,241,115,180,180,199,151,198,198,81,203,232,232,35,161,221,221,124,232,116,116,156,62,31,31,33,150,75,75,221,97,189,189,220,13,139,139,134,15,138,138,133,224,112,112,144,124,62,62,66,113,181,181,196,204,102,102,170,144,72,72,216,6,3,3,5,247,246,246,1,28,14,14,18,194,97,97,163,106,53,53,95,174,87,87,249,105,185,185,208,23,134,134,145,153,193,193,88,58,29,29,39,39,158,158,185,217,225,225,56,235,248,248,19,43,152,152,179,34,17,17,51,210,105,105,187,169,217,217,112,7,142,142,137,51,148,148,167,45,155,155,182,60,30,30,34,21,135,135,146,201,233,233,32,135,206,206,73,170,85,85,255,80,40,40,120,165,223,223,122,3,140,140,143,89,161,161,248,9,137,137,128,26,13,13,23,101,191,191,218,215,230,230,49,132,66,66,198,208,104,104,184,130,65,65,195,41,153,153,176,90,45,45,119,30,15,15,17,123,176,176,203,168,84,84,252,109,187,187,214,44,22,22,58,81,244,167,80,126,65,101,83,26,23,164,195,58,39,94,150,59,171,107,203,31,157,69,241,172,250,88,171,75,227,3,147,32,48,250,85,173,118,109,246,136,204,118,145,245,2,76,37,79,229,215,252,197,42,203,215,38,53,68,128,181,98,163,143,222,177,90,73,37,186,27,103,69,234,14,152,93,254,192,225,195,47,117,2,129,76,240,18,141,70,151,163,107,211,249,198,3,143,95,231,21,146,156,149,191,109,122,235,149,82,89,218,212,190,131,45,88,116,33,211,73,224,105,41,142,201,200,68,117,194,137,106,244,142,121,120,153,88,62,107,39,185,113,221,190,225,79,182,240,136,173,23,201,32,172,102,125,206,58,180,99,223,74,24,229,26,49,130,151,81,51,96,98,83,127,69,177,100,119,224,187,107,174,132,254,129,160,28,249,8,43,148,112,72,104,88,143,69,253,25,148,222,108,135,82,123,248,183,171,115,211,35,114,75,2,226,227,31,143,87,102,85,171,42,178,235,40,7,47,181,194,3,134,197,123,154,211,55,8,165,48,40,135,242,35,191,165,178,2,3,106,186,237,22,130,92,138,207,28,43,167,121,180,146,243,7,242,240,78,105,226,161,101,218,244,205,6,5,190,213,209,52,98,31,196,166,254,138,52,46,83,157,162,243,85,160,5,138,225,50,164,246,235,117,11,131,236,57,64,96,239,170,94,113,159,6,189,110,16,81,62,33,138,249,150,221,6,61,221,62,5,174,77,230,189,70,145,84,141,181,113,196,93,5,4,6,212,111,96,80,21,255,25,152,251,36,214,189,233,151,137,64,67,204,103,217,158,119,176,232,66,189,7,137,139,136,231,25,91,56,121,200,238,219,161,124,10,71,124,66,15,233,248,132,30,201,0,0,0,0,9,128,134,131,50,43,237,72,30,17,112,172,108,90,114,78,253,14,255,251,15,133,56,86,61,174,213,30,54,45,57,39,10,15,217,100,104,92,166,33,155,91,84,209,36,54,46,58,12,10,103,177,147,87,231,15,180,238,150,210,27,155,145,158,128,192,197,79,97,220,32,162,90,119,75,105,28,18,26,22,226,147,186,10,192,160,42,229,60,34,224,67,18,27,23,29,14,9,13,11,242,139,199,173,45,182,168,185,20,30,169,200,87,241,25,133,175,117,7,76,238,153,221,187,163,127,96,253,247,1,38,159,92,114,245,188,68,102,59,197,91,251,126,52,139,67,41,118,203,35,198,220,182,237,252,104,184,228,241,99,215,49,220,202,66,99,133,16,19,151,34,64,132,198,17,32,133,74,36,125,210,187,61,248,174,249,50,17,199,41,161,109,29,158,47,75,220,178,48,243,13,134,82,236,119,193,227,208,43,179,22,108,169,112,185,153,17,148,72,250,71,233,100,34,168,252,140,196,160,240,63,26,86,125,44,216,34,51,144,239,135,73,78,199,217,56,209,193,140,202,162,254,152,212,11,54,166,245,129,207,165,122,222,40,218,183,142,38,63,173,191,164,44,58,157,228,80,120,146,13,106,95,204,155,84,126,70,98,246,141,19,194,144,216,184,232,46,57,247,94,130,195,175,245,159,93,128,190,105,208,147,124,111,213,45,169,207,37,18,179,200,172,153,59,16,24,125,167,232,156,99,110,219,59,187,123,205,38,120,9,110,89,24,244,236,154,183,1,131,79,154,168,230,149,110,101,170,255,230,126,33,188,207,8,239,21,232,230,186,231,155,217,74,111,54,206,234,159,9,212,41,176,124,214,49,164,178,175,42,63,35,49,198,165,148,48,53,162,102,192,116,78,188,55,252,130,202,166,224,144,208,176,51,167,216,21,241,4,152,74,65,236,218,247,127,205,80,14,23,145,246,47,118,77,214,141,67,239,176,77,204,170,77,84,228,150,4,223,158,209,181,227,76,106,136,27,193,44,31,184,70,101,81,127,157,94,234,4,1,140,53,93,250,135,116,115,251,11,65,46,179,103,29,90,146,219,210,82,233,16,86,51,109,214,71,19,154,215,97,140,55,161,12,122,89,248,20,142,235,19,60,137,206,169,39,238,183,97,201,53,225,28,229,237,122,71,177,60,156,210,223,89,85,242,115,63,24,20,206,121,115,199,55,191,83,247,205,234,95,253,170,91,223,61,111,20,120,68,219,134,202,175,243,129,185,104,196,62,56,36,52,44,194,163,64,95,22,29,195,114,188,226,37,12,40,60,73,139,255,13,149,65,57,168,1,113,8,12,179,222,216,180,228,156,100,86,193,144,123,203,132,97,213,50,182,112,72,108,92,116,208,184,87,66,82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125,1,0,0,0,2,0,0,0,4,0,0,0,8,0,0,0,16,0,0,0,32,0,0,0,64,0,0,0,128,0,0,0,27,0,0,0,54,0,0,0,108,0,0,0,216,0,0,0,171,0,0,0,77,0,0,0,154,0,0,0,47,0,0,0,94,0,0,0,188,0,0,0,99,0,0,0,198,0,0,0,151,0,0,0,53,0,0,0,106,0,0,0,212,0,0,0,179,0,0,0,125,0,0,0,250,0,0,0,239,0,0,0,197,0,0,0,145,0,0,0,2,0,0,0,43,126,21,22,40,174,210,166,171,247,21,136,9,207,79,60,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,107,193,190,226,46,64,159,150,233,61,126,17,115,147,23,42,59,63,217,46,183,45,173,32,51,52,73,248,232,60,251,74,174,45,138,87,30,3,172,156,158,183,111,172,69,175,142,81,200,166,69,55,160,179,169,63,205,227,205,173,159,28,229,139,48,200,28,70,163,92,228,17,229,251,193,25,26,10,82,239,38,117,31,103,163,203,177,64,177,128,140,241,135,164,244,223,246,159,36,69,223,79,155,23,173,43,65,123,230,108,55,16,192,75,5,53,124,93,28,14,234,196,198,111,159,247,242,230,5,0,0,0,43,126,21,22,40,174,210,166,171,247,21,136,9,207,79,60,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,107,193,190,226,46,64,159,150,233,61,126,17,115,147,23,42,59,63,217,46,183,45,173,32,51,52,73,248,232,60,251,74,174,45,138,87,30,3,172,156,158,183,111,172,69,175,142,81,119,137,80,141,22,145,143,3,245,60,82,218,197,78,216,37,48,200,28,70,163,92,228,17,229,251,193,25,26,10,82,239,151,64,5,30,156,95,236,246,67,68,247,168,34,96,237,204,246,159,36,69,223,79,155,23,173,43,65,123,230,108,55,16,48,76,101,40,246,89,199,120,102,165,16,217,193,214,174,94,8,0,0,0,2,0,0,0,58,150,0,0,220,28,0,0,232,28,0,0,16,0,0,0,192,0,0,0,248,1,0,0,1,0,0,0,2,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,65,150,0,0,77,150,0,0,0,0,0,0,85,150,0,0,1,0,0,0,109,150,0,0,3,0,0,0,133,150,0,0,5,0,0,0,157,150,0,0,2,0,0,0,0,0,0,0,0,0,0,0,9,0,0,0,2,0,0,0,181,150,0,0,80,29,0,0,92,29,0,0,16,0,0,0,0,1,0,0,248,1,0,0,1,0,0,0,2,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,188,150,0,0,200,150,0,0,0,0,0,0,208,150,0,0,1,0,0,0,232,150,0,0,3,0,0,0,0,151,0,0,5,0,0,0,24,151,0,0,2,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,48,151,0,0,58,151,0,0,15,0,0,0,184,29,0,0,20,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,184,0,0,0,0,0,0,0,73,151,0,0,88,151,0,0,0,0,0,0,1,0,0,0,2,0,0,0,3,0,0,0,220,152,0,0,24,30,0,0,9,153,0,0,12,153,0,0,19,153,0,0,21,153,0,0,23,153,0,0,1,0,0,0,2,0,0,0,5,0,0,0,6,0,0,0,7,0,0,0,8,0,0,0,3,0,0,0,9,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,224,152,0,0,228,152,0,0,240,152,0,0,0,0,0,0,2,0,0,0,2,0,0,0,95,164,0,0,100,164,0,0,15,0,0,0,92,30,0,0,20,0,0,0,2,0,0,0,1,0,0,0,2,0,0,0,4,0,0,0,184,0,0,0,10,0,0,0,115,164,0,0,136,164,0,0,154,164,0,0,168,164,0,0,182,164,0,0,0,0,0,0,11,0,0,0,2,0,0,0,7,165,0,0,14,165,0,0,19,0,0,0,168,30,0,0,28,0,0,0,3,0,0,0,1,0,0,0,3,0,0,0,5,0,0,0,192,0,0,0,11,0,0,0,33,165,0,0,0,0,0,0,152,47,138,66,145,68,55,113,207,251,192,181,165,219,181,233,91,194,86,57,241,17,241,89,164,130,63,146,213,94,28,171,152,170,7,216,1,91,131,18,190,133,49,36,195,125,12,85,116,93,190,114,254,177,222,128,167,6,220,155,116,241,155,193,193,105,155,228,134,71,190,239,198,157,193,15,204,161,12,36,111,44,233,45,170,132,116,74,220,169,176,92,218,136,249,118,82,81,62,152,109,198,49,168,200,39,3,176,199,127,89,191,243,11,224,198,71,145,167,213,81,99,202,6,103,41,41,20,133,10,183,39,56,33,27,46,252,109,44,77,19,13,56,83,84,115,10,101,187,10,106,118,46,201,194,129,133,44,114,146,161,232,191,162,75,102,26,168,112,139,75,194,163,81,108,199,25,232,146,209,36,6,153,214,133,53,14,244,112,160,106,16,22,193,164,25,8,108,55,30,76,119,72,39,181,188,176,52,179,12,28,57,74,170,216,78,79,202,156,91,243,111,46,104,238,130,143,116,111,99,165,120,20,120,200,132,8,2,199,140,250,255,190,144,235,108,80,164,247,163,249,190,242,120,113,198,8,0,0,0,2,0,0,0,43,166,0,0,50,166,0,0,19,0,0,0,228,31,0,0,32,0,0,0,4,0,0,0,1,0,0,0,3,0,0,0,5,0,0,0,192,0,0,0,11,0,0,0,69,166,0,0,92,166,0,0,0,0,0,0,10,0,0,0,2,0,0,0,114,166,0,0,121,166,0,0,19,0,0,0,36,32,0,0,64,0,0,0,5,0,0,0,1,0,0,0,4,0,0,0,6,0,0,0,224,0,0,0,12,0,0,0,140,166,0,0,163,166,0,0,0,0,0,0,9,0,0,0,2,0,0,0,180,168,0,0,187,168,0,0,19,0,0,0,100,32,0,0,48,0,0,0,6,0,0,0,1,0,0,0,4,0,0,0,6,0,0,0,224,0,0,0,12,0,0,0,206,168,0,0,229,168,0,0,0,0,0,0,10,0,0,0,0,0,0,0,251,168,0,0,0,0,0,0,0,0,0,0,16,0,0,0,0,1,0,0,160,16,0,0,13,0,0,0,14,0,0,0,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,117,50,188,188,243,33,236,236,198,67,32,32,244,201,179,179,219,3,218,218,123,139,2,2,251,43,226,226,200,250,158,158,74,236,201,201,211,9,212,212,230,107,24,24,107,159,30,30,69,14,152,152,125,56,178,178,232,210,166,166,75,183,38,38,214,87,60,60,50,138,147,147,216,238,130,130,253,152,82,82,55,212,123,123,113,55,187,187,241,151,91,91,225,131,71,71,48,60,36,36,15,226,81,81,248,198,186,186,27,243,74,74,135,72,191,191,250,112,13,13,6,179,176,176,63,222,117,117,94,253,210,210,186,32,125,125,174,49,102,102,91,163,58,58,138,28,89,89,0,0,0,0,188,147,205,205,157,224,26,26,109,44,174,174,193,171,127,127,177,199,43,43,14,185,190,190,128,160,224,224,93,16,138,138,210,82,59,59,213,186,100,100,160,136,216,216,132,165,231,231,7,232,95,95,20,17,27,27,181,194,44,44,144,180,252,252,44,39,49,49,163,101,128,128,178,42,115,115,115,129,12,12,76,95,121,121,84,65,107,107,146,2,75,75,116,105,83,83,54,143,148,148,81,31,131,131,56,54,42,42,176,156,196,196,189,200,34,34,90,248,213,213,252,195,189,189,96,120,72,72,98,206,255,255,150,7,76,76,108,119,65,65,66,230,199,199,247,36,235,235,16,20,28,28,124,99,93,93,40,34,54,54,39,192,103,103,140,175,233,233,19,249,68,68,149,234,20,20,156,187,245,245,199,24,207,207,36,45,63,63,70,227,192,192,59,219,114,114,112,108,84,84,202,76,41,41,227,53,240,240,133,254,8,8,203,23,198,198,17,79,243,243,208,228,140,140,147,89,164,164,184,150,202,202,166,59,104,104,131,77,184,184,32,40,56,56,255,46,229,229,159,86,173,173,119,132,11,11,195,29,200,200,204,255,153,153,3,237,88,88,111,154,25,25,8,10,14,14,191,126,149,149,64,80,112,112,231,48,247,247,43,207,110,110,226,110,31,31,121,61,181,181,12,15,9,9,170,52,97,97,130,22,87,87,65,11,159,159,58,128,157,157,234,100,17,17,185,205,37,37,228,221,175,175,154,8,69,69,164,141,223,223,151,92,163,163,126,213,234,234,218,88,53,53,122,208,237,237,23,252,67,67,102,203,248,248,148,177,251,251,161,211,55,55,29,64,250,250,61,104,194,194,240,204,180,180,222,93,50,50,179,113,156,156,11,231,86,86,114,218,227,227,167,96,135,135,28,27,21,21,239,58,249,249,209,191,99,99,83,169,52,52,62,133,154,154,143,66,177,177,51,209,124,124,38,155,136,136,95,166,61,61,236,215,161,161,118,223,228,228,42,148,129,129,73,1,145,145,129,251,15,15,136,170,238,238,238,97,22,22,33,115,215,215,196,245,151,151,26,168,165,165,235,63,254,254,217,181,109,109,197,174,120,120,57,109,197,197,153,229,29,29,205,164,118,118,173,220,62,62,49,103,203,203,139,71,182,182,1,91,239,239,24,30,18,18,35,197,96,96,221,176,106,106,31,246,77,77,78,233,206,206,45,124,222,222,249,157,85,85,72,90,126,126,79,178,33,33,242,122,3,3,101,38,160,160,142,25,94,94,120,102,90,90,92,75,101,101,88,78,98,98,25,69,253,253,141,244,6,6,229,134,64,64,152,190,242,242,87,172,51,51,103,144,23,23,127,142,5,5,5,94,232,232,100,125,79,79,175,106,137,137,99,149,16,16,182,47,116,116,254,117,10,10,245,146,92,92,183,116,155,155,60,51,45,45,165,214,48,48,206,73,46,46,233,137,73,73,104,114,70,70,68,85,119,119,224,216,168,168,77,4,150,150,67,189,40,40,105,41,169,169,41,121,217,217,46,145,134,134,172,135,209,209,21,74,244,244,89,21,141,141,168,130,214,214,10,188,185,185,158,13,66,66,110,193,246,246,71,184,47,47,223,6,221,221,52,57,35,35,53,98,204,204,106,196,241,241,207,18,193,193,220,235,133,133,34,158,143,143,201,161,113,113,192,240,144,144,155,83,170,170,137,241,1,1,212,225,139,139,237,140,78,78,171,111,142,142,18,162,171,171,162,62,111,111,13,84,230,230,82,242,219,219,187,123,146,146,2,182,183,183,47,202,105,105,169,217,57,57,215,12,211,211,97,35,167,167,30,173,162,162,180,153,195,195,80,68,108,108,4,5,7,7,246,127,4,4,194,70,39,39,22,167,172,172,37,118,208,208,134,19,80,80,86,247,220,220,85,26,132,132,9,81,225,225,190,37,122,122,145,239,19,19,57,57,217,169,23,23,144,103,156,156,113,179,166,166,210,232,7,7,5,4,82,82,152,253,128,128,101,163,228,228,223,118,69,69,8,154,75,75,2,146,224,224,160,128,90,90,102,120,175,175,221,228,106,106,176,221,99,99,191,209,42,42,54,56,230,230,84,13,32,32,67,198,204,204,98,53,242,242,190,152,18,18,30,24,235,235,36,247,161,161,215,236,65,65,119,108,40,40,189,67,188,188,50,117,123,123,212,55,136,136,155,38,13,13,112,250,68,68,249,19,251,251,177,148,126,126,90,72,3,3,122,242,140,140,228,208,182,182,71,139,36,36,60,48,231,231,165,132,107,107,65,84,221,221,6,223,96,96,197,35,253,253,69,25,58,58,163,91,194,194,104,61,141,141,21,89,236,236,33,243,102,102,49,174,111,111,62,162,87,87,22,130,16,16,149,99,239,239,91,1,184,184,77,131,134,134,145,46,109,109,181,217,131,131,31,81,170,170,83,155,93,93,99,124,104,104,59,166,254,254,63,235,48,48,214,165,122,122,37,190,172,172,167,22,9,9,15,12,240,240,53,227,167,167,35,97,144,144,240,192,233,233,175,140,157,157,128,58,92,92,146,245,12,12,129,115,49,49,39,44,208,208,118,37,86,86,231,11,146,146,123,187,206,206,233,78,1,1,241,137,30,30,159,107,52,52,169,83,241,241,196,106,195,195,153,180,91,91,151,241,71,71,131,225,24,24,107,230,34,34,200,189,152,152,14,69,31,31,110,226,179,179,201,244,116,116,47,182,248,248,203,102,153,153,255,204,20,20,234,149,88,88,237,3,220,220,247,86,139,139,225,212,21,21,27,28,162,162,173,30,211,211,12,215,226,226,43,251,200,200,29,195,94,94,25,142,44,44,194,181,73,73,137,233,193,193,18,207,149,149,126,191,125,125,32,186,17,17,100,234,11,11,132,119,197,197,109,57,137,137,106,175,124,124,209,51,113,113,161,201,255,255,206,98,187,187,55,113,15,15,251,129,181,181,61,121,225,225,81,9,62,62,220,173,63,63,45,36,118,118,164,205,85,85,157,249,130,130,238,216,64,64,134,229,120,120,174,197,37,37,205,185,150,150,4,77,119,119,85,68,14,14,10,8,80,80,19,134,247,247,48,231,55,55,211,161,250,250,64,29,97,97,52,170,78,78,140,237,176,176,179,6,84,84,108,112,115,115,42,178,59,59,82,210,159,159,11,65,2,2,139,123,216,216,136,160,243,243,79,17,203,203,103,49,39,39,70,194,103,103,192,39,252,252,180,144,56,56,40,32,4,4,127,246,72,72,120,96,229,229,46,255,76,76,7,150,101,101,75,92,43,43,199,177,142,142,111,171,66,66,13,158,245,245,187,156,219,219,242,82,74,74,243,27,61,61,166,95,164,164,89,147,185,185,188,10,249,249,58,239,19,19,239,145,8,8,254,133,145,145,1,73,22,22,97,238,222,222,124,45,33,33,178,79,177,177,66,143,114,114,219,59,47,47,184,71,191,191,72,135,174,174,44,109,192,192,227,70,60,60,87,214,154,154,133,62,169,169,41,105,79,79,125,100,129,129,148,42,46,46,73,206,198,198,23,203,105,105,202,47,189,189,195,252,163,163,92,151,232,232,94,5,237,237,208,122,209,209,135,172,5,5,142,127,100,100,186,213,165,165,168,26,38,38,183,75,190,190,185,14,135,135,96,167,213,213,248,90,54,54,34,40,27,27,17,20,117,117,222,63,217,217,121,41,238,238,170,136,45,45,51,60,121,121,95,76,183,183,182,2,202,202,150,184,53,53,88,218,196,196,156,176,67,67,252,23,132,132,26,85,77,77,246,31,89,89,28,138,178,178,56,125,51,51,172,87,207,207,24,199,6,6,244,141,83,83,105,116,155,155,116,183,151,151,245,196],"i8",ALLOC_NONE,Runtime.GLOBAL_BASE);allocate([173,173,86,159,227,227,218,114,234,234,213,126,244,244,74,21,143,143,158,34,171,171,162,18,98,98,78,88,95,95,232,7,29,29,229,153,35,35,57,52,246,246,193,110,108,108,68,80,50,50,93,222,70,70,114,104,160,160,38,101,205,205,147,188,218,218,3,219,186,186,198,248,158,158,250,200,214,214,130,168,110,110,207,43,112,112,80,64,133,133,235,220,10,10,117,254,147,147,138,50,223,223,141,164,41,41,76,202,28,28,20,16,215,215,115,33,180,180,204,240,212,212,9,211,138,138,16,93,81,81,226,15,0,0,0,0,25,25,154,111,26,26,224,157,148,148,143,54,199,199,230,66,201,201,236,74,210,210,253,94,127,127,171,193,168,168,216,224,50,188,117,188,33,236,243,236,67,32,198,32,201,179,244,179,3,218,219,218,139,2,123,2,43,226,251,226,250,158,200,158,236,201,74,201,9,212,211,212,107,24,230,24,159,30,107,30,14,152,69,152,56,178,125,178,210,166,232,166,183,38,75,38,87,60,214,60,138,147,50,147,238,130,216,130,152,82,253,82,212,123,55,123,55,187,113,187,151,91,241,91,131,71,225,71,60,36,48,36,226,81,15,81,198,186,248,186,243,74,27,74,72,191,135,191,112,13,250,13,179,176,6,176,222,117,63,117,253,210,94,210,32,125,186,125,49,102,174,102,163,58,91,58,28,89,138,89,0,0,0,0,147,205,188,205,224,26,157,26,44,174,109,174,171,127,193,127,199,43,177,43,185,190,14,190,160,224,128,224,16,138,93,138,82,59,210,59,186,100,213,100,136,216,160,216,165,231,132,231,232,95,7,95,17,27,20,27,194,44,181,44,180,252,144,252,39,49,44,49,101,128,163,128,42,115,178,115,129,12,115,12,95,121,76,121,65,107,84,107,2,75,146,75,105,83,116,83,143,148,54,148,31,131,81,131,54,42,56,42,156,196,176,196,200,34,189,34,248,213,90,213,195,189,252,189,120,72,96,72,206,255,98,255,7,76,150,76,119,65,108,65,230,199,66,199,36,235,247,235,20,28,16,28,99,93,124,93,34,54,40,54,192,103,39,103,175,233,140,233,249,68,19,68,234,20,149,20,187,245,156,245,24,207,199,207,45,63,36,63,227,192,70,192,219,114,59,114,108,84,112,84,76,41,202,41,53,240,227,240,254,8,133,8,23,198,203,198,79,243,17,243,228,140,208,140,89,164,147,164,150,202,184,202,59,104,166,104,77,184,131,184,40,56,32,56,46,229,255,229,86,173,159,173,132,11,119,11,29,200,195,200,255,153,204,153,237,88,3,88,154,25,111,25,10,14,8,14,126,149,191,149,80,112,64,112,48,247,231,247,207,110,43,110,110,31,226,31,61,181,121,181,15,9,12,9,52,97,170,97,22,87,130,87,11,159,65,159,128,157,58,157,100,17,234,17,205,37,185,37,221,175,228,175,8,69,154,69,141,223,164,223,92,163,151,163,213,234,126,234,88,53,218,53,208,237,122,237,252,67,23,67,203,248,102,248,177,251,148,251,211,55,161,55,64,250,29,250,104,194,61,194,204,180,240,180,93,50,222,50,113,156,179,156,231,86,11,86,218,227,114,227,96,135,167,135,27,21,28,21,58,249,239,249,191,99,209,99,169,52,83,52,133,154,62,154,66,177,143,177,209,124,51,124,155,136,38,136,166,61,95,61,215,161,236,161,223,228,118,228,148,129,42,129,1,145,73,145,251,15,129,15,170,238,136,238,97,22,238,22,115,215,33,215,245,151,196,151,168,165,26,165,63,254,235,254,181,109,217,109,174,120,197,120,109,197,57,197,229,29,153,29,164,118,205,118,220,62,173,62,103,203,49,203,71,182,139,182,91,239,1,239,30,18,24,18,197,96,35,96,176,106,221,106,246,77,31,77,233,206,78,206,124,222,45,222,157,85,249,85,90,126,72,126,178,33,79,33,122,3,242,3,38,160,101,160,25,94,142,94,102,90,120,90,75,101,92,101,78,98,88,98,69,253,25,253,244,6,141,6,134,64,229,64,190,242,152,242,172,51,87,51,144,23,103,23,142,5,127,5,94,232,5,232,125,79,100,79,106,137,175,137,149,16,99,16,47,116,182,116,117,10,254,10,146,92,245,92,116,155,183,155,51,45,60,45,214,48,165,48,73,46,206,46,137,73,233,73,114,70,104,70,85,119,68,119,216,168,224,168,4,150,77,150,189,40,67,40,41,169,105,169,121,217,41,217,145,134,46,134,135,209,172,209,74,244,21,244,21,141,89,141,130,214,168,214,188,185,10,185,13,66,158,66,193,246,110,246,184,47,71,47,6,221,223,221,57,35,52,35,98,204,53,204,196,241,106,241,18,193,207,193,235,133,220,133,158,143,34,143,161,113,201,113,240,144,192,144,83,170,155,170,241,1,137,1,225,139,212,139,140,78,237,78,111,142,171,142,162,171,18,171,62,111,162,111,84,230,13,230,242,219,82,219,123,146,187,146,182,183,2,183,202,105,47,105,217,57,169,57,12,211,215,211,35,167,97,167,173,162,30,162,153,195,180,195,68,108,80,108,5,7,4,7,127,4,246,4,70,39,194,39,167,172,22,172,118,208,37,208,19,80,134,80,247,220,86,220,26,132,85,132,81,225,9,225,37,122,190,122,239,19,145,19,217,169,57,217,144,103,23,144,113,179,156,113,210,232,166,210,5,4,7,5,152,253,82,152,101,163,128,101,223,118,228,223,8,154,69,8,2,146,75,2,160,128,224,160,102,120,90,102,221,228,175,221,176,221,106,176,191,209,99,191,54,56,42,54,84,13,230,84,67,198,32,67,98,53,204,98,190,152,242,190,30,24,18,30,36,247,235,36,215,236,161,215,119,108,65,119,189,67,40,189,50,117,188,50,212,55,123,212,155,38,136,155,112,250,13,112,249,19,68,249,177,148,251,177,90,72,126,90,122,242,3,122,228,208,140,228,71,139,182,71,60,48,36,60,165,132,231,165,65,84,107,65,6,223,221,6,197,35,96,197,69,25,253,69,163,91,58,163,104,61,194,104,21,89,141,21,33,243,236,33,49,174,102,49,62,162,111,62,22,130,87,22,149,99,16,149,91,1,239,91,77,131,184,77,145,46,134,145,181,217,109,181,31,81,131,31,83,155,170,83,99,124,93,99,59,166,104,59,63,235,254,63,214,165,48,214,37,190,122,37,167,22,172,167,15,12,9,15,53,227,240,53,35,97,167,35,240,192,144,240,175,140,233,175,128,58,157,128,146,245,92,146,129,115,12,129,39,44,49,39,118,37,208,118,231,11,86,231,123,187,146,123,233,78,206,233,241,137,1,241,159,107,30,159,169,83,52,169,196,106,241,196,153,180,195,153,151,241,91,151,131,225,71,131,107,230,24,107,200,189,34,200,14,69,152,14,110,226,31,110,201,244,179,201,47,182,116,47,203,102,248,203,255,204,153,255,234,149,20,234,237,3,88,237,247,86,220,247,225,212,139,225,27,28,21,27,173,30,162,173,12,215,211,12,43,251,226,43,29,195,200,29,25,142,94,25,194,181,44,194,137,233,73,137,18,207,193,18,126,191,149,126,32,186,125,32,100,234,17,100,132,119,11,132,109,57,197,109,106,175,137,106,209,51,124,209,161,201,113,161,206,98,255,206,55,113,187,55,251,129,15,251,61,121,181,61,81,9,225,81,220,173,62,220,45,36,63,45,164,205,118,164,157,249,85,157,238,216,130,238,134,229,64,134,174,197,120,174,205,185,37,205,4,77,150,4,85,68,119,85,10,8,14,10,19,134,80,19,48,231,247,48,211,161,55,211,64,29,250,64,52,170,97,52,140,237,78,140,179,6,176,179,108,112,84,108,42,178,115,42,82,210,59,82,11,65,159,11,139,123,2,139,136,160,216,136,79,17,243,79,103,49,203,103,70,194,39,70,192,39,103,192,180,144,252,180,40,32,56,40,127,246,4,127,120,96,72,120,46,255,229,46,7,150,76,7,75,92,101,75,199,177,43,199,111,171,142,111,13,158,66,13,187,156,245,187,242,82,219,242,243,27,74,243,166,95,61,166,89,147,164,89,188,10,185,188,58,239,249,58,239,145,19,239,254,133,8,254,1,73,145,1,97,238,22,97,124,45,222,124,178,79,33,178,66,143,177,66,219,59,114,219,184,71,47,184,72,135,191,72,44,109,174,44,227,70,192,227,87,214,60,87,133,62,154,133,41,105,169,41,125,100,79,125,148,42,129,148,73,206,46,73,23,203,198,23,202,47,105,202,195,252,189,195,92,151,163,92,94,5,232,94,208,122,237,208,135,172,209,135,142,127,5,142,186,213,100,186,168,26,165,168,183,75,38,183,185,14,190,185,96,167,135,96,248,90,213,248,34,40,54,34,17,20,27,17,222,63,117,222,121,41,217,121,170,136,238,170,51,60,45,51,95,76,121,95,182,2,183,182,150,184,202,150,88,218,53,88,156,176,196,156,252,23,67,252,26,85,132,26,246,31,77,246,28,138,89,28,56,125,178,56,172,87,51,172,24,199,207,24,244,141,6,244,105,116,83,105,116,183,155,116,245,196,151,245,86,159,173,86,218,114,227,218,213,126,234,213,74,21,244,74,158,34,143,158,162,18,171,162,78,88,98,78,232,7,95,232,229,153,29,229,57,52,35,57,193,110,246,193,68,80,108,68,93,222,50,93,114,104,70,114,38,101,160,38,147,188,205,147,3,219,218,3,198,248,186,198,250,200,158,250,130,168,214,130,207,43,110,207,80,64,112,80,235,220,133,235,117,254,10,117,138,50,147,138,141,164,223,141,76,202,41,76,20,16,28,20,115,33,215,115,204,240,180,204,9,211,212,9,16,93,138,16,226,15,81,226,0,0,0,0,154,111,25,154,224,157,26,224,143,54,148,143,230,66,199,230,236,74,201,236,253,94,210,253,171,193,127,171,216,224,168,216,47,1,0,0,0,0,0,0,242,176,0,0,0,0,0,0,0,0,0,0,16,0,0,0,128,0,0,0,160,16,0,0,13,0,0,0,14,0,0,0,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,152,47,138,66,145,68,55,113,207,251,192,181,165,219,181,233,91,194,86,57,241,17,241,89,164,130,63,146,213,94,28,171,152,170,7,216,1,91,131,18,190,133,49,36,195,125,12,85,116,93,190,114,254,177,222,128,167,6,220,155,116,241,155,193,193,105,155,228,134,71,190,239,198,157,193,15,204,161,12,36,111,44,233,45,170,132,116,74,220,169,176,92,218,136,249,118,82,81,62,152,109,198,49,168,200,39,3,176,199,127,89,191,243,11,224,198,71,145,167,213,81,99,202,6,103,41,41,20,133,10,183,39,56,33,27,46,252,109,44,77,19,13,56,83,84,115,10,101,187,10,106,118,46,201,194,129,133,44,114,146,161,232,191,162,75,102,26,168,112,139,75,194,163,81,108,199,25,232,146,209,36,6,153,214,133,53,14,244,112,160,106,16,22,193,164,25,8,108,55,30,76,119,72,39,181,188,176,52,179,12,28,57,74,170,216,78,79,202,156,91,243,111,46,104,238,130,143,116,111,99,165,120,20,120,200,132,8,2,199,140,250,255,190,144,235,108,80,164,247,163,249,190,242,120,113,198,18,0,0,0,0,0,0,0,3,0,0,0,77,183,0,0,112,50,0,0,107,183,0,0,115,183,0,0,124,183,0,0,127,183,0,0,107,183,0,0,3,0,0,0,7,0,0,0,16,0,0,0,17,0,0,0,18,0,0,0,19,0,0,0,8,0,0,0,20,0,0,0,4,0,0,0,21,0,0,0,9,0,0,0,81,183,0,0,85,183,0,0,91,183,0,0,96,183,0,0,102,183,0,0,0,0,0,0,16,0,0,0,7,0,0,0,22,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,0,0,0,22,0,0,0,37,0,0,0,63,0,0,0,92,0,0,0,117,0,0,0,132,0,0,0,147,0,0,0,161,0,0,0,175,0,0,0,190,0,0,0,205,0,0,0,230,0,0,0,243,0,0,0,2,1,0,0,16,1,0,0,27,1,0,0,41,1,0,0,63,1,0,0,79,1,0,0,109,1,0,0,129,1,0,0,153,1,0,0,179,1,0,0,204,1,0,0,222,1,0,0,231,1,0,0,241,1,0,0,1,2,0,0,14,2,0,0,28,2,0,0,47,2,0,0,71,2,0,0,91,2,0,0,107,2,0,0,122,2,0,0,138,2,0,0,154,2,0,0,171,2,0,0,185,2,0,0,201,2,0,0,228,2,0,0,245,2,0,0,9,3,0,0,28,3,0,0,45,3,0,0,65,3,0,0,77,3,0,0,91,3,0,0,104,3,0,0,120,3,0,0,139,3,0,0,158,3,0,0,178,3,0,0,198,3,0,0,212,3,0,0,234,3,0,0,254,3,0,0,6,4,0,0,10,4,0,0,24,4,0,0,47,4,0,0,55,4,0,0,70,4,0,0,83,4,0,0,98,4,0,0,127,4,0,0,156,4,0,0,179,4,0,0,195,4,0,0,211,4,0,0,231,4,0,0,244,4,0,0,3,5,0,0,20,5,0,0,36,5,0,0,53,5,0,0,70,5,0,0,82,5,0,0,95,5,0,0,126,5,0,0,147,5,0,0,167,5,0,0,188,5,0,0,210,5,0,0,222,5,0,0,237,5,0,0,245,5,0,0,2,6,0,0,11,6,0,0,29,6,0,0,40,6,0,0,51,6,0,0,65,6,0,0,85,6,0,0,98,6,0,0,110,6,0,0,124,6,0,0,136,6,0,0,156,6,0,0,175,6,0,0,195,6,0,0,217,6,0,0,241,6,0,0,6,7,0,0,29,7,0,0,50,7,0,0,65,7,0,0,76,7,0,0,96,7,0,0,109,7,0,0,122,7,0,0,139,7,0,0,161,7,0,0,175,7,0,0,195,7,0,0,211,7,0,0,225,7,0,0,236,7,0,0,0,8,0,0,23,8,0,0,44,8,0,0,59,8,0,0,80,8,0,0,102,8,0,0,118,8,0,0,132,8,0,0,148,8,0,0,162,8,0,0,179,8,0,0,191,8,0,0,223,8,0,0,243,8,0,0,255,8,0,0,9,9,0,0,21,9,0,0,39,9,0,0,60,9,0,0,72,9,0,0,87,9,0,0,104,9,0,0,119,9,0,0,135,9,0,0,149,9,0,0,168,9,0,0,187,9,0,0,210,9,0,0,231,9,0,0,255,9,0,0,17,10,0,0,39,10,0,0,62,10,0,0,80,10,0,0,92,10,0,0,110,10,0,0,127,10,0,0,141,10,0,0,158,10,0,0,173,10,0,0,196,10,0,0,215,10,0,0,228,10,0,0,247,10,0,0,15,11,0,0,42,11,0,0,55,11,0,0,80,11,0,0,91,11,0,0,110,11,0,0,122,11,0,0,138,11,0,0,156,11,0,0,183,11,0,0,190,11,0,0,205,11,0,0,221,11,0,0,237,11,0,0,1,12,0,0,14,12,0,0,26,12,0,0,43,12,0,0,55,12,0,0,72,12,0,0,86,12,0,0,102,12,0,0,129,12,0,0,152,12,0,0,175,12,0,0,198,12,0,0,213,12,0,0,230,12,0,0,248,12,0,0,13,13,0,0,32,13,0,0,63,13,0,0,81,13,0,0,99,13,0,0,121,13,0,0,147,13,0,0,174,13,0,0,191,13,0,0,232,13,0,0,8,14,0,0,46,14,0,0,73,14,0,0,103,14,0,0,133,14,0,0,161,14,0,0,198,14,0,0,222,14,0,0,14,15,0,0,56,15,0,0,96,15,0,0,132,15,0,0,143,15,0,0,161,15,0,0,178,15,0,0,209,15,0,0,230,15,0,0,255,15,0,0,14,16,0,0,38,16,0,0,57,16,0,0,93,16,0,0,114,16,0,0,143,16,0,0,163,16,0,0,190,16,0,0,218,16,0,0,233,16,0,0,244,16,0,0,5,17,0,0,42,17,0,0,87,17,0,0,131,17,0,0,171,17,0,0,209,17,0,0,247,17,0,0,33,18,0,0,67,18,0,0,112,18,0,0,157,18,0,0,170,18,0,0,180,18,0,0,193,18,0,0,228,18,0,0,248,18,0,0,10,19,0,0,33,19,0,0,57,19,0,0,78,19,0,0,106,19,0,0,136,19,0,0,164,19,0,0,184,19,0,0,208,19,0,0,235,19,0,0,253,19,0,0,15,20,0,0,43,20,0,0,58,20,0,0,74,20,0,0,102,20,0,0,125,20,0,0,145,20,0,0,162,20,0,0,190,20,0,0,214,20,0,0,239,20,0,0,3,21,0,0,23,21,0,0,42,21,0,0,71,21,0,0,95,21,0,0,123,21,0,0,150,21,0,0,176,21,0,0,205,21,0,0,229,21,0,0,254,21,0,0,25,22,0,0,54,22,0,0,71,22,0,0,96,22,0,0,119,22,0,0,141,22,0,0,160,22,0,0,182,22,0,0,215,22,0,0,245,22,0,0,12,23,0,0,47,23,0,0,63,23,0,0,83,23,0,0,103,23,0,0,120,23,0,0,147,23,0,0,160,23,0,0,182,23,0,0,202,23,0,0,230,23,0,0,2,24,0,0,21,24,0,0,39,24,0,0,80,24,0,0,120,24,0,0,159,24,0,0,173,24,0,0,208,24,0,0,247,24,0,0,24,25,0,0,51,25,0,0,74,25,0,0,104,25,0,0,135,25,0,0,164,25,0,0,190,25,0,0,213,25,0,0,233,25,0,0,252,25,0,0,22,26,0,0,43,26,0,0,76,26,0,0,113,26,0,0,147,26,0,0,172,26,0,0,201,26,0,0,221,26,0,0,248,26,0,0,28,27,0,0,50,27,0,0,72,27,0,0,100,27,0,0,139,27,0,0,173,27,0,0,195,27,0,0,227,27,0,0,250,27,0,0,31,28,0,0,60,28,0,0,77,28,0,0,105,28,0,0,132,28,0,0,153,28,0,0,180,28,0,0,204,28,0,0,219,28,0,0,247,28,0,0,15,29,0,0,34,29,0,0,56,29,0,0,93,29,0,0,119,29,0,0,145,29,0,0,171,29,0,0,197,29,0,0,223,29,0,0,249,29,0,0,19,30,0,0,45,30,0,0,71,30,0,0,98,30,0,0,125,30,0,0,152,30,0,0,179,30,0,0,206,30,0,0,233,30,0,0,4,31,0,0,27,31,0,0,48,31,0,0,60,31,0,0,7,0,0,0,13,0,0,0,98,0,0,0,99,0,0,0,68,0,0,0,97,0,0,0,11,0,0,0,114,0,0,0,0,0,0,0,0,0,0,0,52,0,0,0,9,0,0,0,77,0,0,0,74,0,0,0,53,0,0,0,0,0,0,0,56,0,0,0,57,0,0,0,59,0,0,0,16,0,0,0,125,0,0,0,10,0,0,0,44,0,0,0,70,0,0,0,103,0,0,0,111,0,0,0,104,0,0,0,0,0,0,0,35,0,0,0,35,0,0,0,89,0,0,0,0,0,0,0,33,0,0,0,73,0,0,0,122,0,0,0,17,0,0,0,14,0,0,0,27,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,112,0,0,0,113,0,0,0,43,0,0,0,0,0,0,0,84,0,0,0,115,0,0,0,4,0,0,0,22,0,0,0,5,0,0,0,106,0,0,0,21,0,0,0,120,0,0,0,51,0,0,0,45,0,0,0,46,0,0,0,47,0,0,0,79,0,0,0,80,0,0,0,83,0,0,0,82,0,0,0,81,0,0,0,48,0,0,0,40,0,0,0,124,0,0,0,24,0,0,0,31,0,0,0,90,0,0,0,72,0,0,0,36,0,0,0,119,0,0,0,0,0,0,0,100,0,0,0,102,0,0,0,101,0,0,0,23,0,0,0,55,0,0,0,105,0,0,0,50,0,0,0,61,0,0,0,19,0,0,0,2,0,0,0,8,0,0,0,37,0,0,0,67,0,0,0,123,0,0,0,12,0,0,0,42,0,0,0,64,0,0,0,65,0,0,0,92,0,0,0,28,0,0,0,63,0,0,0,60,0,0,0,38,0,0,0,15,0,0,0,107,0,0,0,20,0,0,0,39,0,0,0,118,0,0,0,88,0,0,0,95,0,0,0,25,0,0,0,76,0,0,0,6,0,0,0,95,0,0,0,75,0,0,0,1,0,0,0,96,0,0,0,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,71,0,0,0,93,0,0,0,91,0,0,0,34,0,0,0,78,0,0,0,66,0,0,0,121,0,0,0,85,0,0,0,30,0,0,0,0,0,0,0,108,0,0,0,94,0,0,0,29,0,0,0,3,0,0,0,69,0,0,0,116,0,0,0,86,0,0,0,62,0,0,0,110,0,0,0,109,0,0,0,26,0,0,0,117,0,0,0,49,0,0,0,87,0,0,0,11,0,0,0,18,0,0,0,54,0,0,0,107,128,0,0,81,128,0,0,127,128,0,0,47,128,0,0,49,128,0,0,104,128,0,0,0,128,0,0,82,128,0,0,11,128,0,0,21,128,0,0,6,128,0,0,138,128,0,0,86,128,0,0,1,128,0,0,36,128,0,0,95,128,0,0,19,128,0,0,35,128,0,0,139,128,0,0,80,128,0,0,97,128,0,0,51,128,0,0,48,128,0,0,75,128,0,0,65,128,0,0,102,128,0,0,134,128,0,0,37,128,0,0,91,128,0,0,126,128,0,0,122,128,0,0,66,128,0,0,109,128,0,0,32,128,0,0,117,128,0,0,28,128,0,0,29,128,0,0,69,128,0,0,83,128,0,0,94,128,0,0,98,128,0,0,63,128,0,0,87,128,0,0,43,128,0,0,22,128,0,0,54,128,0,0,55,128,0,0,56,128,0,0,62,128,0,0,136,128,0,0,78,128,0,0,53,128,0,0,10,128,0,0,14,128,0,0,140,128,0,0,76,128,0,0,16,128,0,0,17,128,0,0,18,128,0,0,93,128,0,0,79,128,0,0,131,128,0,0,92,128,0,0,88,128,0,0,89,128,0,0,119,128,0,0,84,128,0,0,4,128,0,0,128,128,0,0,23,128,0,0,114,128,0,0,68,128,0,0,33,128,0,0,13,128,0,0,106,128,0,0,103,128,0,0,12,128,0,0,118,128,0,0,57,128,0,0,58,128,0,0,61,128,0,0,60,128,0,0,59,128,0,0,45,128,0,0,121,128,0,0,130,128,0,0,137,128,0,0,100,128,0,0,30,128,0,0,67,128,0,0,116,128,0,0,90,128,0,0,115,128,0,0,125,128,0,0,101,128,0,0,105,128,0,0,108,128,0,0,5,128,0,0,2,128,0,0,3,128,0,0,72,128,0,0,74,128,0,0,73,128,0,0,24,128,0,0,26,128,0,0,77,128,0,0,50,128,0,0,96,128,0,0,124,128,0,0,133,128,0,0,132,128,0,0,25,128,0,0,41,128,0,0,42,128,0,0,7,128,0,0,46,128,0,0,129,128,0,0,135,128,0,0,99,128,0,0,70,128,0,0,52,128,0,0,120,128,0,0,34,128,0,0,85,128,0,0,64,128,0,0,20,128,0,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,5,0,0,0,0,0,0,0,0,0,0,0,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,23,0,0,0,24,0,0,0,61,41,1,0,0,4,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,108,61,0,0,228,61,0,0,5,0,0,0,0,0,0,0,0,0,0,0,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,25,0,0,0,24,0,0,0,69,45,1,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,192,3,0,0,192,4,0,0,192,5,0,0,192,6,0,0,192,7,0,0,192,8,0,0,192,9,0,0,192,10,0,0,192,11,0,0,192,12,0,0,192,13,0,0,192,14,0,0,192,15,0,0,192,16,0,0,192,17,0,0,192,18,0,0,192,19,0,0,192,20,0,0,192,21,0,0,192,22,0,0,192,23,0,0,192,24,0,0,192,25,0,0,192,26,0,0,192,27,0,0,192,28,0,0,192,29,0,0,192,30,0,0,192,31,0,0,192,0,0,0,179,1,0,0,195,2,0,0,195,3,0,0,195,4,0,0,195,5,0,0,195,6,0,0,195,7,0,0,195,8,0,0,195,9,0,0,195,10,0,0,195,11,0,0,195,12,0,0,195,13,0,0,211,14,0,0,195,15,0,0,195,0,0,12,187,1,0,12,195,2,0,12,195,3,0,12,195,4,0,12,211,32,0,0,0,9,0,0,0,10,0,0,0,13,0,0,0,11,0,0,0,12,0,0,0,133,0,0,0,0,32,0,0,1,32,0,0,2,32,0,0,3,32,0,0,4,32,0,0,5,32,0,0,6,32,0,0,8,32,0,0,9,32,0,0,10,32,0,0,40,32,0,0,41,32,0,0,95,32,0,0,0,48,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,26,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,31,0,0,0,244,63,0,0,0,0,0,0,45,244,81,88,207,140,177,192,70,246,181,203,41,49,3,199,4,91,112,48,180,93,253,32,120,127,139,154,216,89,41,80,104,72,137,171,167,86,3,108,255,183,205,136,63,212,119,180,43,165,163,112,241,186,228,168,252,65,131,253,217,111,225,138,122,47,45,116,150,7,31,13,9,94,3,118,44,112,247,64,165,44,167,111,87,65,168,170,116,223,160,88,100,3,74,199,196,60,83,174,175,95,24,4,21,177,227,109,40,134,171,12,164,191,67,240,233,80,129,57,87,22,82,55,3,0,0,0,3,0,5,0,7,0,11,0,13,0,17,0,19,0,23,0,29,0,31,0,37,0,41,0,43,0,47,0,53,0,59,0,61,0,67,0,71,0,73,0,79,0,83,0,89,0,97,0,101,0,103,0,107,0,109,0,113,0,127,0,131,0,137,0,139,0,149,0,151,0,157,0,163,0,167,0,173,0,179,0,181,0,191,0,193,0,197,0,199,0,211,0,223,0,227,0,229,0,233,0,239,0,241,0,251,0,1,1,7,1,13,1,15,1,21,1,25,1,27,1,37,1,51,1,55,1,57,1,61,1,75,1,81,1,91,1,93,1,97,1,103,1,111,1,117,1,123,1,127,1,133,1,141,1,145,1,153,1,163,1,165,1,175,1,177,1,183,1,187,1,193,1,201,1,205,1,207,1,211,1,223,1,231,1,235,1,243,1,247,1,253,1,9,2,11,2,29,2,35,2,45,2,51,2,57,2,59,2,65,2,75,2,81,2,87,2,89,2,95,2,101,2,105,2,107,2,119,2,129,2,131,2,135,2,141,2,147,2,149,2,161,2,165,2,171,2,179,2,189,2,197,2,207,2,215,2,221,2,227,2,231,2,239,2,245,2,249,2,1,3,5,3,19,3,29,3,41,3,43,3,53,3,55,3,59,3,61,3,71,3,85,3,89,3,91,3,95,3,109,3,113,3,115,3,119,3,139,3,143,3,151,3,161,3,169,3,173,3,179,3,185,3,199,3,203,3,209,3,215,3,223,3,229,3,241,3,245,3,251,3,253,3,7,4,9,4,15,4,25,4,27,4,37,4,39,4,45,4,63,4,67,4,69,4,73,4,79,4,85,4,93,4,99,4,105,4,127,4,129,4,139,4,147,4,157,4,163,4,169,4,177,4,189,4,193,4,199,4,205,4,207,4,213,4,225,4,235,4,253,4,255,4,3,5,9,5,11,5,17,5,21,5,23,5,27,5,39,5,41,5,47,5,81,5,87,5,93,5,101,5,119,5,129,5,143,5,147,5,149,5,153,5,159,5,167,5,171,5,173,5,179,5,191,5,201,5,203,5,207,5,209,5,213,5,219,5,231,5,243,5,251,5,7,6,13,6,17,6,23,6,31,6,35,6,43,6,47,6,61,6,65,6,71,6,73,6,77,6,83,6,85,6,91,6,101,6,121,6,127,6,131,6,133,6,157,6,161,6,163,6,173,6,185,6,187,6,197,6,205,6,211,6,217,6,223,6,241,6,247,6,251,6,253,6,9,7,19,7,31,7,39,7,55,7,69,7,75,7,79,7,81,7,85,7,87,7,97,7,109,7,115,7,121,7,139,7,141,7,157,7,159,7,181,7,187,7,195,7,201,7,205,7,207,7,211,7,219,7,225,7,235,7,237,7,247,7,5,8,15,8,21,8,33,8,35,8,39,8,41,8,51,8,63,8,65,8,81,8,83,8,89,8,93,8,95,8,105,8,113,8,131,8,155,8,159,8,165,8,173,8,189,8,191,8,195,8,203,8,219,8,221,8,225,8,233,8,239,8,245,8,249,8,5,9,7,9,29,9,35,9,37,9,43,9,47,9,53,9,67,9,73,9,77,9,79,9,85,9,89,9,95,9,107,9,113,9,119,9,133,9,137,9,143,9,155,9,163,9,169,9,173,9,199,9,217,9,227,9,235,9,239,9,245,9,247,9,253,9,19,10,31,10,33,10,49,10,57,10,61,10,73,10,87,10,97,10,99,10,103,10,111,10,117,10,123,10,127,10,129,10,133,10,139,10,147,10,151,10,153,10,159,10,169,10,171,10,181,10,189,10,193,10,207,10,217,10,229,10,231,10,237,10,241,10,243,10,3,11,17,11,21,11,27,11,35,11,41,11,45,11,63,11,71,11,81,11,87,11,93,11,101,11,111,11,123,11,137,11,141,11,147,11,153,11,155,11,183,11,185,11,195,11,203,11,207,11,221,11,225,11,233,11,245,11,251,11,7,12,11,12,17,12,37,12,47,12,49,12,65,12,91,12,95,12,97,12,109,12,115,12,119,12,131,12,137,12,145,12,149,12,157,12,179,12,181,12,185,12,187,12,199,12,227,12,229,12,235,12,241,12,247,12,251,12,1,13,3,13,15,13,19,13,31,13,33,13,43,13,45,13,61,13,63,13,79,13,85,13,105,13,121,13,129,13,133,13,135,13,139,13,141,13,163,13,171,13,183,13,189,13,199,13,201,13,205,13,211,13,213,13,219,13,229,13,231,13,243,13,253,13,255,13,9,14,23,14,29,14,33,14,39,14,47,14,53,14,59,14,75,14,87,14,89,14,93,14,107,14,113,14,117,14,125,14,135,14,143,14,149,14,155,14,177,14,183,14,185,14,195,14,209,14,213,14,219,14,237,14,239,14,249,14,7,15,11,15,13,15,23,15,37,15,41,15,49,15,67,15,71,15,77,15,79,15,83,15,89,15,91,15,103,15,107,15,127,15,149,15,161,15,163,15,167,15,173,15,179,15,181,15,187,15,209,15,211,15,217,15,233,15,239,15,251,15,253,15,3,16,15,16,31,16,33,16,37,16,43,16,57,16,61,16,63,16,81,16,105,16,115,16,121,16,123,16,133,16,135,16,145,16,147,16,157,16,163,16,165,16,175,16,177,16,187,16,193,16,201,16,231,16,241,16,243,16,253,16,5,17,11,17,21,17,39,17,45,17,57,17,69,17,71,17,89,17,95,17,99,17,105,17,111,17,129,17,131,17,141,17,155,17,161,17,165,17,167,17,171,17,195,17,197,17,209,17,215,17,231,17,239,17,245,17,251,17,13,18,29,18,31,18,35,18,41,18,43,18,49,18,55,18,65,18,71,18,83,18,95,18,113,18,115,18,121,18,125,18,143,18,151,18,175,18,179,18,181,18,185,18,191,18,193,18,205,18,209,18,223,18,253,18,7,19,13,19,25,19,39,19,45,19,55,19,67,19,69,19,73,19,79,19,87,19,93,19,103,19,105,19,109,19,123,19,129,19,135,19,0,0,0,0,194,1,132,3,70,2,8,7,202,6,140,4,78,5,16,14,210,15,148,13,86,12,24,9,218,8,156,10,94,11,32,28,226,29,164,31,102,30,40,27,234,26,172,24,110,25,48,18,242,19,180,17,118,16,56,21,250,20,188,22,126,23,64,56,130,57,196,59,6,58,72,63,138,62,204,60,14,61,80,54,146,55,212,53,22,52,88,49,154,48,220,50,30,51,96,36,162,37,228,39,38,38,104,35,170,34,236,32,46,33,112,42,178,43,244,41,54,40,120,45,186,44,252,46,62,47,128,112,66,113,4,115,198,114,136,119,74,118,12,116,206,117,144,126,82,127,20,125,214,124,152,121,90,120,28,122,222,123,160,108,98,109,36,111,230,110,168,107,106,106,44,104,238,105,176,98,114,99,52,97,246,96,184,101,122,100,60,102,254,103,192,72,2,73,68,75,134,74,200,79,10,78,76,76,142,77,208,70,18,71,84,69,150,68,216,65,26,64,92,66,158,67,224,84,34,85,100,87,166,86,232,83,42,82,108,80,174,81,240,90,50,91,116,89,182,88,248,93,58,92,124,94,190,95,0,225,194,224,132,226,70,227,8,230,202,231,140,229,78,228,16,239,210,238,148,236,86,237,24,232,218,233,156,235,94,234,32,253,226,252,164,254,102,255,40,250,234,251,172,249,110,248,48,243,242,242,180,240,118,241,56,244,250,245,188,247,126,246,64,217,130,216,196,218,6,219,72,222,138,223,204,221,14,220,80,215,146,214,212,212,22,213,88,208,154,209,220,211,30,210,96,197,162,196,228,198,38,199,104,194,170,195,236,193,46,192,112,203,178,202,244,200,54,201,120,204,186,205,252,207,62,206,128,145,66,144,4,146,198,147,136,150,74,151,12,149,206,148,144,159,82,158,20,156,214,157,152,152,90,153,28,155,222,154,160,141,98,140,36,142,230,143,168,138,106,139,44,137,238,136,176,131,114,130,52,128,246,129,184,132,122,133,60,135,254,134,192,169,2,168,68,170,134,171,200,174,10,175,76,173,142,172,208,167,18,166,84,164,150,165,216,160,26,161,92,163,158,162,224,181,34,180,100,182,166,183,232,178,42,179,108,177,174,176,240,187,50,186,116,184,182,185,248,188,58,189,124,191,190,190,73,0,49,1,83,0,127,1,48,1,105,0,120,1,255,0,129,1,83,2,130,1,131,1,132,1,133,1,134,1,84,2,135,1,136,1,137,1,86,2,138,1,87,2,139,1,140,1,142,1,221,1,143,1,89,2,144,1,91,2,145,1,146,1,147,1,96,2,148,1,99,2,150,1,105,2,151,1,104,2,152,1,153,1,156,1,111,2,157,1,114,2,159,1,117,2,166,1,128,2,167,1,168,1,169,1,131,2,172,1,173,1,174,1,136,2,175,1,176,1,177,1,138,2,178,1,139,2,183,1,146,2,184,1,185,1,188,1,189,1,196,1,198,1,196,1,197,1,197,1,198,1,199,1,201,1,199,1,200,1,200,1,201,1,202,1,204,1,202,1,203,1,203,1,204,1,241,1,243,1,241,1,242,1,242,1,243,1,244,1,245,1,246,1,149,1,247,1,191,1,32,2,158,1,134,3,172,3,136,3,173,3,137,3,174,3,138,3,175,3,140,3,204,3,142,3,205,3,143,3,206,3,153,3,69,3,153,3,190,31,163,3,194,3,247,3,248,3,250,3,251,3,96,30,155,30,223,0,223,0,158,30,223,0,89,31,81,31,91,31,83,31,93,31,85,31,95,31,87,31,188,31,179,31,204,31,195,31,236,31,229,31,252,31,243,31,58,2,101,44,59,2,60,2,61,2,154,1,62,2,102,44,65,2,66,2,67,2,128,1,68,2,137,2,69,2,140,2,244,3,184,3,249,3,242,3,253,3,123,3,254,3,124,3,255,3,125,3,192,4,207,4,38,33,201,3,42,33,107,0,43,33,229,0,50,33,78,33,131,33,132,33,96,44,97,44,98,44,107,2,99,44,125,29,100,44,125,2,109,44,81,2,110,44,113,2,111,44,80,2,112,44,82,2,114,44,115,44,117,44,118,44,126,44,63,2,127,44,64,2,242,44,243,44,125,167,121,29,139,167,140,167,141,167,101,2,170,167,102,2,199,16,39,45,205,16,45,45,118,3,119,3,156,3,181,0,146,3,208,3,152,3,209,3,166,3,213,3,160,3,214,3,154,3,240,3,161,3,241,3,149,3,245,3,207,3,215,3,0,0,0,0,65,0,32,26,192,0,32,31,0,1,1,47,50,1,1,5,57,1,1,15,74,1,1,45,121,1,1,5,112,3,1,3,145,3,32,17,163,3,32,9,0,4,80,16,16,4,32,32,96,4,1,33,138,4,1,53,193,4,1,13,208,4,1,63,20,5,1,19,49,5,48,38,160,1,1,5,179,1,1,3,205,1,1,15,222,1,1,17,248,1,1,39,34,2,1,17,216,3,1,23,0,30,1,149,160,30,1,95,8,31,248,8,24,31,248,6,40,31,248,8,56,31,248,8,72,31,248,6,104,31,248,8,136,31,248,8,152,31,248,8,168,31,248,8,184,31,248,2,186,31,182,2,200,31,170,4,216,31,248,2,218,31,156,2,232,31,248,2,234,31,144,2,248,31,128,2,250,31,130,2,70,2,1,9,16,5,1,3,96,33,16,16,0,44,48,47,103,44,1,5,128,44,1,99,235,44,1,3,64,166,1,45,128,166,1,23,34,167,1,13,50,167,1,61,121,167,1,3,126,167,1,9,144,167,1,3,160,167,1,9,33,255,32,26,0,0,0,0,119,114,97,112,46,99,0,99,111,109,109,111,110,95,97,108,108,111,99,97,116,105,111,110,46,99,0,71,78,85,78,69,84,95,120,109,97,108,108,111,99,95,0,109,97,108,108,111,99,0,71,78,85,78,69,84,95,120,102,114,101,101,95,0,71,78,85,78,69,84,95,120,115,116,114,100,117,112,95,0,71,78,85,78,69,84,95,115,110,112,114,105,110,116,102,0,68,69,66,85,71,0,73,78,70,79,0,87,65,82,78,73,78,71,0,69,82,82,79,82,0,78,79,78,69,0,99,111,109,109,111,110,95,108,111,103,103,105,110,103,46,99,0,37,115,45,37,100,0,37,115,37,100,37,115,0,97,98,0,115,101,116,117,112,95,108,111,103,95,102,105,108,101,0,71,78,85,78,69,84,95,108,111,103,95,115,107,105,112,0,109,121,108,111,103,0,108,111,99,97,108,116,105,109,101,32,101,114,114,111,114,0,37,98,32,37,100,32,37,72,58,37,77,58,37,83,45,37,37,48,54,117,0,77,101,115,115,97,103,101,32,96,37,46,42,115,39,32,114,101,112,101,97,116,101,100,32,37,117,32,116,105,109,101,115,32,105,110,32,116,104,101,32,108,97,115,116,32,37,115,10,0,73,78,86,65,76,73,68,0,37,115,32,37,115,32,37,115,32,37,115,0,96,37,115,39,32,102,97,105,108,101,100,32,111,110,32,102,105,108,101,32,96,37,115,39,32,97,116,32,37,115,58,37,100,32,119,105,116,104,32,101,114,114,111,114,58,32,37,115,10,0,99,114,121,112,116,111,95,115,121,109,109,101,116,114,105,99,46,99,0,115,101,116,117,112,95,99,105,112,104,101,114,95,97,101,115,0,71,78,85,78,69,84,95,67,82,89,80,84,79,95,115,121,109,109,101,116,114,105,99,95,101,110,99,114,121,112,116,0,115,101,116,117,112,95,99,105,112,104,101,114,95,116,119,111,102,105,115,104,0,71,78,85,78,69,84,95,67,82,89,80,84,79,95,115,121,109,109,101,116,114,105,99,95,100,101,99,114,121,112,116,0,40,112,114,105,118,97,116,101,45,107,101,121,40,101,99,99,40,99,117,114,118,101,32,34,69,100,50,53,53,49,57,34,41,40,100,32,37,98,41,41,41,0,99,114,121,112,116,111,95,101,99,99,46,99,0,103,99,114,121,95,115,101,120,112,95,98,117,105,108,100,0,113,64,101,100,100,115,97,0,40,112,114,105,118,97,116,101,45,107,101,121,40,101,99,99,40,99,117,114,118,101,32,34,69,100,50,53,53,49,57,34,41,40,102,108,97,103,115,32,101,100,100,115,97,41,40,100,32,37,98,41,41,41,0,100,101,99,111,100,101,95,112,114,105,118,97,116,101,95,101,100,100,115,97,95,107,101,121,0,71,78,85,78,69,84,95,67,82,89,80,84,79,95,101,100,100,115,97,95,107,101,121,95,103,101,116,95,112,117,98,108,105,99,0,100,101,99,111,100,101,95,112,114,105,118,97,116,101,95,101,99,100,104,101,95,107,101,121,0,71,78,85,78,69,84,95,67,82,89,80,84,79,95,101,99,100,104,101,95,107,101,121,95,103,101,116,95,112,117,98,108,105,99,0,40,103,101,110,107,101,121,40,101,99,99,40,99,117,114,118,101,32,34,69,100,50,53,53,49,57,34,41,40,102,108,97,103,115,32,101,100,100,115,97,32,110,111,45,107,101,121,116,101,115,116,41,41,41,0,71,78,85,78,69,84,95,67,82,89,80,84,79,95,101,99,100,104,101,95,107,101,121,95,99,114,101,97,116,101,0,103,99,114,121,95,112,107,95,103,101,110,107,101,121,0,107,101,121,95,102,114,111,109,95,115,101,120,112,0,40,103,101,110,107,101,121,40,101,99,99,40,99,117,114,118,101,32,34,69,100,50,53,53,49,57,34,41,40,102,108,97,103,115,32,101,100,100,115,97,41,41,41,0,71,78,85,78,69,84,95,67,82,89,80,84,79,95,101,100,100,115,97,95,107,101,121,95,99,114,101,97,116,101,0,40,100,97,116,97,40,102,108,97,103,115,32,101,100,100,115,97,41,40,104,97,115,104,45,97,108,103,111,32,37,115,41,40,118,97,108,117,101,32,37,98,41,41,0,100,97,116,97,95,116,111,95,101,100,100,115,97,95,118,97,108,117,101,0,71,78,85,78,69,84,95,67,82,89,80,84,79,95,101,100,100,115,97,95,115,105,103,110,0,69,100,68,83,65,32,115,105,103,110,105,110,103,32,102,97,105,108,101,100,32,97,116,32,37,115,58,37,100,58,32,37,115,10,0,40,112,117,98,108,105,99,45,107,101,121,40,101,99,99,40,99,117,114,118,101,32,69,100,50,53,53,49,57,41,40,113,32,37,98,41,41,41,0,40,115,105,103,45,118,97,108,40,101,100,100,115,97,40,114,32,37,98,41,40,115,32,37,98,41,41,41,0,71,78,85,78,69,84,95,67,82,89,80,84,79,95,101,100,100,115,97,95,118,101,114,105,102,121,0,40,112,117,98,108,105,99,45,107,101,121,40,101,99,99,40,99,117,114,118,101,32,69,100,50,53,53,49,57,41,40,102,108,97,103,115,32,101,100,100,115,97,41,40,113,32,37,98,41,41,41,0,69,100,68,83,65,32,115,105,103,110,97,116,117,114,101,32,118,101,114,105,102,105,99,97,116,105,111,110,32,102,97,105,108,101,100,32,97,116,32,37,115,58,37,100,58,32,37,115,10,0,71,78,85,78,69,84,95,67,82,89,80,84,79,95,101,99,99,95,101,99,100,104,0,103,101,116,95,97,102,102,105,110,101,32,102,97,105,108,101,100,0,99,114,121,112,116,111,95,107,100,102,46,99,0,71,78,85,78,69,84,95,67,82,89,80,84,79,95,107,100,102,95,109,111,100,95,109,112,105,0,99,114,121,112,116,111,95,109,112,105,46,99,0,71,78,85,78,69,84,95,67,82,89,80,84,79,95,109,112,105,95,112,114,105,110,116,95,117,110,115,105,103,110,101,100,0,96,37,115,39,32,102,97,105,108,101,100,32,97,116,32,37,115,58,37,100,32,119,105,116,104,32,101,114,114,111,114,58,32,37],"i8",ALLOC_NONE,Runtime.GLOBAL_BASE+10240);allocate([115,10,0,103,99,114,121,95,109,112,105,95,112,114,105,110,116,0,71,78,85,78,69,84,95,67,82,89,80,84,79,95,109,112,105,95,115,99,97,110,95,117,110,115,105,103,110,101,100,0,103,99,114,121,95,109,112,105,95,115,99,97,110,0,49,46,54,46,48,0,108,105,98,103,99,114,121,112,116,32,104,97,115,32,110,111,116,32,116,104,101,32,101,120,112,101,99,116,101,100,32,118,101,114,115,105,111,110,32,40,118,101,114,115,105,111,110,32,37,115,32,105,115,32,114,101,113,117,105,114,101,100,41,46,10,0,99,114,121,112,116,111,95,114,97,110,100,111,109,46,99,0,71,78,85,78,69,84,95,67,82,89,80,84,79,95,114,97,110,100,111,109,95,105,110,105,116,0,70,97,105,108,101,100,32,116,111,32,115,101,116,32,108,105,98,103,99,114,121,112,116,32,111,112,116,105,111,110,32,37,115,58,32,37,115,10,0,68,73,83,65,66,76,69,95,83,69,67,77,69,77,0,69,78,65,66,76,69,95,81,85,73,67,75,95,82,65,78,68,79,77,0,71,78,85,78,69,84,95,67,82,89,80,84,79,95,114,97,110,100,111,109,95,117,51,50,0,71,78,85,78,69,84,95,67,82,89,80,84,79,95,114,97,110,100,111,109,95,98,108,111,99,107,0,40,103,101,110,107,101,121,40,114,115,97,40,110,98,105,116,115,32,37,100,41,41,41,0,99,114,121,112,116,111,95,114,115,97,46,99,0,71,78,85,78,69,84,95,67,82,89,80,84,79,95,114,115,97,95,112,114,105,118,97,116,101,95,107,101,121,95,99,114,101,97,116,101,0,71,78,85,78,69,84,95,67,82,89,80,84,79,95,114,115,97,95,112,114,105,118,97,116,101,95,107,101,121,95,101,110,99,111,100,101,0,117,116,105,108,0,71,78,85,78,69,84,95,67,82,89,80,84,79,95,114,115,97,95,112,114,105,118,97,116,101,95,107,101,121,95,100,101,99,111,100,101,0,68,101,99,111,100,101,100,32,112,114,105,118,97,116,101,32,107,101,121,32,105,115,32,110,111,116,32,118,97,108,105,100,10,0,71,78,85,78,69,84,95,67,82,89,80,84,79,95,114,115,97,95,112,114,105,118,97,116,101,95,107,101,121,95,103,101,116,95,112,117,98,108,105,99,0,69,120,116,101,114,110,97,108,32,112,114,111,116,111,99,111,108,32,118,105,111,108,97,116,105,111,110,32,100,101,116,101,99,116,101,100,32,97,116,32,37,115,58,37,100,46,10,0,40,112,117,98,108,105,99,45,107,101,121,40,114,115,97,40,110,32,37,109,41,40,101,32,37,109,41,41,41,0,71,78,85,78,69,84,95,67,82,89,80,84,79,95,114,115,97,95,112,117,98,108,105,99,95,107,101,121,95,101,110,99,111,100,101,0,71,78,85,78,69,84,95,67,82,89,80,84,79,95,114,115,97,95,112,117,98,108,105,99,95,107,101,121,95,100,101,99,111,100,101,0,71,78,85,78,69,84,95,67,82,89,80,84,79,95,114,115,97,95,115,105,103,110,97,116,117,114,101,95,101,110,99,111,100,101,0,71,78,85,78,69,84,95,67,82,89,80,84,79,95,114,115,97,95,98,108,105,110,100,0,114,115,97,95,102,117,108,108,95,100,111,109,97,105,110,95,104,97,115,104,0,82,83,65,45,70,68,65,32,70,84,112,115,87,33,0,66,108,105,110,100,105,110,103,32,75,68,70,32,101,120,116,114,97,116,111,114,32,72,77,65,67,32,107,101,121,0,114,115,97,95,98,108,105,110,100,105,110,103,95,107,101,121,95,100,101,114,105,118,101,0,66,108,105,110,100,105,110,103,32,75,68,70,0,110,117,109,101,114,105,99,95,109,112,105,95,97,108,108,111,99,95,110,95,112,114,105,110,116,0,40,100,97,116,97,32,40,102,108,97,103,115,32,114,97,119,41,32,40,118,97,108,117,101,32,37,77,41,41,0,109,112,105,95,116,111,95,115,101,120,112,0,71,78,85,78,69,84,95,67,82,89,80,84,79,95,114,115,97,95,115,105,103,110,97,116,117,114,101,95,100,101,99,111,100,101,0,71,78,85,78,69,84,95,67,82,89,80,84,79,95,114,115,97,95,117,110,98,108,105,110,100,0,40,115,105,103,45,118,97,108,32,40,114,115,97,32,40,115,32,37,77,41,41,41,0,71,78,85,78,69,84,95,67,82,89,80,84,79,95,114,115,97,95,118,101,114,105,102,121,0,82,83,65,32,115,105,103,110,97,116,117,114,101,32,118,101,114,105,102,105,99,97,116,105,111,110,32,102,97,105,108,101,100,32,97,116,32,37,115,58,37,100,58,32,37,115,10,0,115,116,114,105,110,103,115,46,99,0,37,108,108,117,32,37,115,0,102,111,114,101,118,101,114,0,109,115,0,109,0,100,97,121,0,100,97,121,115,0,194,181,115,0,48,32,109,115,0,71,78,85,78,69,84,95,83,84,82,73,78,71,83,95,100,97,116,97,95,116,111,95,115,116,114,105,110,103,0,48,49,50,51,52,53,54,55,56,57,65,66,67,68,69,70,71,72,74,75,77,78,80,81,82,83,84,86,87,88,89,90,0,71,78,85,78,69,84,95,83,84,82,73,78,71,83,95,115,116,114,105,110,103,95,116,111,95,100,97,116,97,0,118,105,115,105,98,105,108,105,116,121,46,99,0,103,99,114,121,95,109,100,95,104,97,115,104,95,98,117,102,102,101,114,0,99,97,108,108,101,100,32,105,110,32,110,111,110,45,111,112,101,114,97,116,105,111,110,97,108,32,115,116,97,116,101,0,103,99,114,121,95,109,100,95,103,101,116,95,97,108,103,111,0,117,115,101,100,32,105,110,32,110,111,110,45,111,112,101,114,97,116,105,111,110,97,108,32,115,116,97,116,101,0,103,99,114,121,95,114,97,110,100,111,109,105,122,101,0,103,99,114,121,95,99,114,101,97,116,101,95,110,111,110,99,101,0,109,105,115,99,46,99,0,95,103,99,114,121,95,102,97,116,97,108,95,101,114,114,111,114,0,10,70,97,116,97,108,32,101,114,114,111,114,58,32,0,70,97,116,97,108,58,32,0,79,104,104,104,104,32,106,101,101,101,101,58,32,0,68,66,71,58,32,0,91,85,110,107,110,111,119,110,32,108,111,103,32,108,101,118,101,108,32,37,100,93,58,32,0,95,103,99,114,121,95,108,111,103,118,0,105,110,116,101,114,110,97,108,32,101,114,114,111,114,32,40,102,97,116,97,108,32,111,114,32,98,117,103,41,0,46,46,46,32,116,104,105,115,32,105,115,32,97,32,98,117,103,32,40,37,115,58,37,100,58,37,115,41,10,0,65,115,115,101,114,116,105,111,110,32,96,37,115,39,32,102,97,105,108,101,100,32,40,37,115,58,37,100,58,37,115,41,10,0,32,0,37,115,58,37,115,0,37,42,115,32,32,0,37,48,50,120,0,32,92,10,0,37,42,115,32,37,42,115,0,32,40,110,117,108,108,41,0,32,91,37,117,32,98,105,116,93,0,32,91,111,117,116,32,111,102,32,99,111,114,101,93,0,45,0,43,0,100,105,118,105,100,101,32,98,121,32,122,101,114,111,0,103,108,111,98,97,108,46,99,0,103,108,111,98,97,108,95,105,110,105,116,0,49,46,55,46,48,45,98,101,116,97,50,51,48,0,118,101,114,115,105,111,110,58,37,115,58,10,0,99,105,112,104,101,114,115,58,37,115,58,10,0,97,101,115,58,116,119,111,102,105,115,104,0,112,117,98,107,101,121,115,58,37,115,58,10,0,114,115,97,58,101,99,99,0,100,105,103,101,115,116,115,58,37,115,58,10,0,115,104,97,50,53,54,58,115,104,97,53,49,50,0,114,110,100,45,109,111,100,58,108,105,110,117,120,58,10,0,99,112,117,45,97,114,99,104,58,58,10,0,109,112,105,45,97,115,109,58,37,115,58,10,0,104,119,102,108,105,115,116,58,0,37,115,58,0,10,0,102,105,112,115,45,109,111,100,101,58,37,99,58,37,99,58,10,0,115,116,97,110,100,97,114,100,0,102,105,112,115,0,115,121,115,116,101,109,0,112,114,105,110,116,95,99,111,110,102,105,103,0,114,110,103,45,116,121,112,101,58,37,115,58,37,100,58,10,0,111,117,116,32,111,102,32,99,111,114,101,32,105,110,32,115,101,99,117,114,101,32,109,101,109,111,114,121,0,92,120,37,48,50,120,0,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,48,49,50,51,52,53,54,55,56,57,45,46,47,95,58,42,43,61,0,115,101,120,112,46,99,0,100,111,95,118,115,101,120,112,95,115,115,99,97,110,0,37,100,0,37,117,0,38,92,0,95,103,99,114,121,95,115,101,120,112,95,102,105,110,100,95,116,111,107,101,110,0,95,103,99,114,121,95,115,101,120,112,95,110,116,104,0,3,4,0,8,9,11,10,12,13,34,39,92,0,45,46,47,95,58,42,43,61,0,37,48,50,88,0,37,117,58,0,95,103,99,114,121,95,115,101,120,112,95,115,112,114,105,110,116,0,112,97,100,108,111,99,107,45,114,110,103,0,112,97,100,108,111,99,107,45,97,101,115,0,112,97,100,108,111,99,107,45,115,104,97,0,112,97,100,108,111,99,107,45,109,109,117,108,0,105,110,116,101,108,45,99,112,117,0,105,110,116,101,108,45,98,109,105,50,0,105,110,116,101,108,45,115,115,115,101,51,0,105,110,116,101,108,45,112,99,108,109,117,108,0,105,110,116,101,108,45,97,101,115,110,105,0,105,110,116,101,108,45,114,100,114,97,110,100,0,105,110,116,101,108,45,97,118,120,0,105,110,116,101,108,45,97,118,120,50,0,97,114,109,45,110,101,111,110,0,47,101,116,99,47,103,99,114,121,112,116,47,104,119,102,46,100,101,110,121,0,109,101,109,111,114,121,32,97,116,32,37,112,32,99,111,114,114,117,112,116,101,100,32,40,117,110,100,101,114,102,108,111,119,61,37,48,50,120,41,10,0,109,101,109,111,114,121,32,97,116,32,37,112,32,99,111,114,114,117,112,116,101,100,32,40,111,118,101,114,102,108,111,119,61,37,48,50,120,41,10,0,87,97,114,110,105,110,103,58,32,117,115,105,110,103,32,105,110,115,101,99,117,114,101,32,109,101,109,111,114,121,33,10,0,102,97,105,108,101,100,32,116,111,32,100,114,111,112,32,115,101,116,117,105,100,10,0,115,101,99,117,114,101,32,109,101,109,111,114,121,32,105,115,32,100,105,115,97,98,108,101,100,0,99,97,110,39,116,32,109,109,97,112,32,112,111,111,108,32,111,102,32,37,117,32,98,121,116,101,115,58,32,37,115,32,45,32,117,115,105,110,103,32,109,97,108,108,111,99,10,0,99,97,110,39,116,32,97,108,108,111,99,97,116,101,32,109,101,109,111,114,121,32,112,111,111,108,32,111,102,32,37,117,32,98,121,116,101,115,10,0,80,108,101,97,115,101,32,110,111,116,101,32,116,104,97,116,32,121,111,117,32,100,111,110,39,116,32,104,97,118,101,32,115,101,99,117,114,101,32,109,101,109,111,114,121,32,111,110,32,116,104,105,115,32,115,121,115,116,101,109,10,0,79,111,112,115,44,32,115,101,99,117,114,101,32,109,101,109,111,114,121,32,112,111,111,108,32,97,108,114,101,97,100,121,32,105,110,105,116,105,97,108,105,122,101,100,10,0,111,112,101,114,97,116,105,111,110,32,105,115,32,110,111,116,32,112,111,115,115,105,98,108,101,32,119,105,116,104,111,117,116,32,105,110,105,116,105,97,108,105,122,101,100,32,115,101,99,117,114,101,32,109,101,109,111,114,121,10,0,115,101,99,117,114,101,32,109,101,109,111,114,121,32,112,111,111,108,32,105,115,32,110,111,116,32,108,111,99,107,101,100,32,119,104,105,108,101,32,105,110,32,70,73,80,83,32,109,111,100,101,10,0,115,101,99,109,101,109,32,117,115,97,103,101,58,32,37,117,47,37,108,117,32,98,121,116,101,115,32,105,110,32,37,117,32,98,108,111,99,107,115,10,0,70,65,84,65,76,58,32,102,97,105,108,101,100,32,116,111,32,97,99,113,117,105,114,101,32,116,104,101,32,70,83,77,32,108,111,99,107,32,105,110,32,108,105,98,103,114,121,112,116,58,32,37,115,10,0,70,65,84,65,76,58,32,102,97,105,108,101,100,32,116,111,32,114,101,108,101,97,115,101,32,116,104,101,32,70,83,77,32,108,111,99,107,32,105,110,32,108,105,98,103,114,121,112,116,58,32,37,115,10,0,80,111,119,101,114,45,79,110,0,73,110,105,116,0,83,101,108,102,45,84,101,115,116,0,79,112,101,114,97,116,105,111,110,97,108,0,69,114,114,111,114,0,70,97,116,97,108,45,69,114,114,111,114,0,83,104,117,116,100,111,119,110,0,103,114,97,110,116,101,100,0,100,101,110,105,101,100,0,108,105,98,103,99,114,121,112,116,32,115,116,97,116,101,32,116,114,97,110,115,105,116,105,111,110,32,37,115,32,61,62,32,37,115,32,37,115,10,0,33,100,111,110,101,0,102,105,112,115,46,99,0,95,103,99,114,121,95,105,110,105,116,105,97,108,105,122,101,95,102,105,112,115,95,109,111,100,101,0,33,110,111,95,102,105,112,115,95,109,111,100,101,95,114,101,113,117,105,114,101,100,0,47,101,116,99,47,103,99,114,121,112,116,47,102,105,112,115,95,101,110,97,98,108,101,100,0,47,112,114,111,99,47,115,121,115,47,99,114,121,112,116,111,47,102,105,112,115,95,101,110,97,98,108,101,100,0,114,0,47,112,114,111,99,47,118,101,114,115,105,111,110,0,70,65,84,65,76,58,32,101,114,114,111,114,32,114,101,97,100,105,110,103,32,96,37,115,39,32,105,110,32,108,105,98,103,99,114,121,112,116,58,32,37,115,10,0,70,65,84,65,76,58,32,102,97,105,108,101,100,32,116,111,32,99,114,101,97,116,101,32,116,104,101,32,70,83,77,32,108,111,99,107,32,105,110,32,108,105,98,103,99,114,121,112,116,58,32,37,115,10,0,95,103,99,114,121,95,102,105,112,115,95,109,111,100,101,32,40,41,0,95,103,99,114,121,95,105,110,97,99,116,105,118,97,116,101,95,102,105,112,115,95,109,111,100,101,0,102,97,116,97,108,32,0,44,32,102,117,110,99,116,105,111,110,32,0,110,111,32,100,101,115,99,114,105,112,116,105,111,110,32,97,118,97,105,108,97,98,108,101,0,37,115,101,114,114,111,114,32,105,110,32,108,105,98,103,99,114,121,112,116,44,32,102,105,108,101,32,37,115,44,32,108,105,110,101,32,37,100,37,115,37,115,58,32,37,115,10,0,72,77,65,67,45,0,79,107,97,121,0,32,40,0,108,105,98,103,99,114,121,112,116,32,115,101,108,102,116,101,115,116,58,32,37,115,32,37,115,37,115,32,40,37,100,41,58,32,37,115,37,115,37,115,37,115,10,0,98,97,100,32,99,111,110,116,101,120,116,32,116,121,112,101,32,37,100,32,103,105,118,101,110,32,116,111,32,95,103,99,114,121,95,99,116,120,95,97,108,108,111,99,10,0,99,84,120,0,98,97,100,32,112,111,105,110,116,101,114,32,37,112,32,112,97,115,115,101,100,32,116,111,32,95,103,99,114,121,95,99,116,120,95,103,101,116,95,112,111,105,110,116,101,114,10,0,119,114,111,110,103,32,99,111,110,116,101,120,116,32,116,121,112,101,32,37,100,32,114,101,113,117,101,115,116,32,102,111,114,32,99,111,110,116,101,120,116,32,37,112,32,111,102,32,116,121,112,101,32,37,100,10,0,98,97,100,32,112,111,105,110,116,101,114,32,37,112,32,112,97,115,115,101,100,32,116,111,32,103,99,114,121,95,99,116,120,95,114,101,108,97,115,101,10,0,98,97,100,32,99,111,110,116,101,120,116,32,116,121,112,101,32,37,100,32,100,101,116,101,99,116,101,100,32,105,110,32,103,99,114,121,95,99,116,120,95,114,101,108,97,115,101,10,0,103,99,114,121,95,99,105,112,104,101,114,95,99,108,111,115,101,58,32,97,108,114,101,97,100,121,32,99,108,111,115,101,100,47,105,110,118,97,108,105,100,32,104,97,110,100,108,101,0,99,105,112,104,101,114,46,99,0,99,105,112,104,101,114,95,101,110,99,114,121,112,116,0,99,105,112,104,101,114,32,109,111,100,101,32,78,79,78,69,32,117,115,101,100,0,99,105,112,104,101,114,95,101,110,99,114,121,112,116,58,32,105,110,118,97,108,105,100,32,109,111,100,101,32,37,100,10,0,99,105,112,104,101,114,95,100,101,99,114,121,112,116,0,99,105,112,104,101,114,95,100,101,99,114,121,112,116,58,32,105,110,118,97,108,105,100,32,109,111,100,101,32,37,100,10,0,87,65,82,78,73,78,71,58,32,99,105,112,104,101,114,95,115,101,116,105,118,58,32,105,118,108,101,110,61,37,117,32,98,108,107,108,101,110,61,37,117,10,0,99,105,112,104,101,114,95,115,101,116,105,118,0,73,86,32,108,101,110,103,116,104,32,100,111,101,115,32,110,111,116,32,109,97,116,99,104,32,98,108,111,99,107,108,101,110,103,116,104,0,48,120,55,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,69,68,0,45,48,120,48,49,0,45,48,120,50,68,70,67,57,51,49,49,68,52,57,48,48,49,56,67,55,51,51,56,66,70,56,54,56,56,56,54,49,55,54,55,70,70,56,70,70,53,66,50,66,69,66,69,50,55,53,52,56,65,49,52,66,50,51,53,69,67,65,54,56,55,52,65,0,48,120,49,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,49,52,68,69,70,57,68,69,65,50,70,55,57,67,68,54,53,56,49,50,54,51,49,65,53,67,70,53,68,51,69,68,0,48,120,50,49,54,57,51,54,68,51,67,68,54,69,53,51,70,69,67,48,65,52,69,50,51,49,70,68,68,54,68,67,53,67,54,57,50,67,67,55,54,48,57,53,50,53,65,55,66,50,67,57,53,54,50,68,54,48,56,70,50,53,68,53,49,65,0,48,120,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,53,56,0,48,120,48,56,0,78,73,83,84,32,80,45,49,57,50,0,48,120,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,101,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,0,48,120,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,101,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,99,0,48,120,54,52,50,49,48,53,49,57,101,53,57,99,56,48,101,55,48,102,97,55,101,57,97,98,55,50,50,52,51,48,52,57,102,101,98,56,100,101,101,99,99,49,52,54,98,57,98,49,0,48,120,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,57,57,100,101,102,56,51,54,49,52,54,98,99,57,98,49,98,52,100,50,50,56,51,49,0,48,120,49,56,56,100,97,56,48,101,98,48,51,48,57,48,102,54,55,99,98,102,50,48,101,98,52,51,97,49,56,56,48,48,102,52,102,102,48,97,102,100,56,50,102,102,49,48,49,50,0,48,120,48,55,49,57,50,98,57,53,102,102,99,56,100,97,55,56,54,51,49,48,49,49,101,100,54,98,50,52,99,100,100,53,55,51,102,57,55,55,97,49,49,101,55,57,52,56,49,49,0,48,120,48,49,0,78,73,83,84,32,80,45,50,50,52,0,48,120,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,49,0,48,120,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,101,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,101,0,48,120,98,52,48,53,48,97,56,53,48,99,48,52,98,51,97,98,102,53,52,49,51,50,53,54,53,48,52,52,98,48,98,55,100,55,98,102,100,56,98,97,50,55,48,98,51,57,52,51,50,51,53,53,102,102,98,52,0,48,120,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,49,54,97,50,101,48,98,56,102,48,51,101,49,51,100,100,50,57,52,53,53,99,53,99,50,97,51,100,0,48,120,98,55,48,101,48,99,98,100,54,98,98,52,98,102,55,102,51,50,49,51,57,48,98,57,52,97,48,51,99,49,100,51,53,54,99,50,49,49,50,50,51,52,51,50,56,48,100,54,49,49,53,99,49,100,50,49,0,48,120,98,100,51,55,54,51,56,56,98,53,102,55,50,51,102,98,52,99,50,50,100,102,101,54,99,100,52,51,55,53,97,48,53,97,48,55,52,55,54,52,52,52,100,53,56,49,57,57,56,53,48,48,55,101,51,52,0,78,73,83,84,32,80,45,50,53,54,0,48,120,102,102,102,102,102,102,102,102,48,48,48,48,48,48,48,49,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,0,48,120,102,102,102,102,102,102,102,102,48,48,48,48,48,48,48,49,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,99,0,48,120,53,97,99,54,51,53,100,56,97,97,51,97,57,51,101,55,98,51,101,98,98,100,53,53,55,54,57,56,56,54,98,99,54,53,49,100,48,54,98,48,99,99,53,51,98,48,102,54,51,98,99,101,51,99,51,101,50,55,100,50,54,48,52,98,0,48,120,102,102,102,102,102,102,102,102,48,48,48,48,48,48,48,48,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,98,99,101,54,102,97,97,100,97,55,49,55,57,101,56,52,102,51,98,57,99,97,99,50,102,99,54,51,50,53,53,49,0,48,120,54,98,49,55,100,49,102,50,101,49,50,99,52,50,52,55,102,56,98,99,101,54,101,53,54,51,97,52,52,48,102,50,55,55,48,51,55,100,56,49,50,100,101,98,51,51,97,48,102,52,97,49,51,57,52,53,100,56,57,56,99,50,57,54,0,48,120,52,102,101,51,52,50,101,50,102,101,49,97,55,102,57,98,56,101,101,55,101,98,52,97,55,99,48,102,57,101,49,54,50,98,99,101,51,51,53,55,54,98,51,49,53,101,99,101,99,98,98,54,52,48,54,56,51,55,98,102,53,49,102,53,0,78,73,83,84,32,80,45,51,56,52,0,48,120,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,101,102,102,102,102,102,102,102,102,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,102,102,102,102,102,102,102,102,0,48,120,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,101,102,102,102,102,102,102,102,102,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,102,102,102,102,102,102,102,99,0,48,120,98,51,51,49,50,102,97,55,101,50,51,101,101,55,101,52,57,56,56,101,48,53,54,98,101,51,102,56,50,100,49,57,49,56,49,100,57,99,54,101,102,101,56,49,52,49,49,50,48,51,49,52,48,56,56,102,53,48,49,51,56,55,53,97,99,54,53,54,51,57,56,100,56,97,50,101,100,49,57,100,50,97,56,53,99,56,101,100,100,51,101,99,50,97,101,102,0,48,120,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,99,55,54,51,52,100,56,49,102,52,51,55,50,100,100,102,53,56,49,97,48,100,98,50,52,56,98,48,97,55,55,97,101,99,101,99,49,57,54,97,99,99,99,53,50,57,55,51,0,48,120,97,97,56,55,99,97,50,50,98,101,56,98,48,53,51,55,56,101,98,49,99,55,49,101,102,51,50,48,97,100,55,52,54,101,49,100,51,98,54,50,56,98,97,55,57,98,57,56,53,57,102,55,52,49,101,48,56,50,53,52,50,97,51,56,53,53,48,50,102,50,53,100,98,102,53,53,50,57,54,99,51,97,53,52,53,101,51,56,55,50,55,54,48,97,98,55,0,48,120,51,54,49,55,100,101,52,97,57,54,50,54,50,99,54,102,53,100,57,101,57,56,98,102,57,50,57,50,100,99,50,57,102,56,102,52,49,100,98,100,50,56,57,97,49,52,55,99,101,57,100,97,51,49,49,51,98,53,102,48,98,56,99,48,48,97,54,48,98,49,99,101,49,100,55,101,56,49,57,100,55,97,52,51,49,100,55,99,57,48,101,97,48,101,53,102,0,78,73,83,84,32,80,45,53,50,49,0,48,120,48,49,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,0,48,120,48,49,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,99,0,48,120,48,53,49,57,53,51,101,98,57,54,49,56,101,49,99,57,97,49,102,57,50,57,97,50,49,97,48,98,54,56,53,52,48,101,101,97,50,100,97,55,50,53,98,57,57,98,51,49,53,102,51,98,56,98,52,56,57,57,49,56,101,102,49,48,57,101,49,53,54,49,57,51,57,53,49,101,99,55,101,57,51,55,98,49,54,53,50,99,48,98,100,51,98,98,49,98,102,48,55,51,53,55,51,100,102,56,56,51,100,50,99,51,52,102,49,101,102,52,53,49,102,100,52,54,98,53,48,51,102,48,48,0,48,120,49,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,97,53,49,56,54,56,55,56,51,98,102,50,102,57,54,54,98,55,102,99,99,48,49,52,56,102,55,48,57,97,53,100,48,51,98,98,53,99,57,98,56,56,57,57,99,52,55,97,101,98,98,54,102,98,55,49,101,57,49,51,56,54,52,48,57,0,48,120,48,48,99,54,56,53,56,101,48,54,98,55,48,52,48,52,101,57,99,100,57,101,51,101,99,98,54,54,50,51,57,53,98,52,52,50,57,99,54,52,56,49,51,57,48,53,51,102,98,53,50,49,102,56,50,56,97,102,54,48,54,98,52,100,51,100,98,97,97,49,52,98,53,101,55,55,101,102,101,55,53,57,50,56,102,101,49,100,99,49,50,55,97,50,102,102,97,56,100,101,51,51,52,56,98,51,99,49,56,53,54,97,52,50,57,98,102,57,55,101,55,101,51,49,99,50,101,53,98,100,54,54,0,48,120,48,49,49,56,51,57,50,57,54,97,55,56,57,97,51,98,99,48,48,52,53,99,56,97,53,102,98,52,50,99,55,100,49,98,100,57,57,56,102,53,52,52,52,57,53,55,57,98,52,52,54,56,49,55,97,102,98,100,49,55,50,55,51,101,54,54,50,99,57,55,101,101,55,50,57,57,53,101,102,52,50,54,52,48,99,53,53,48,98,57,48,49,51,102,97,100,48,55,54,49,51,53,51,99,55,48,56,54,97,50,55,50,99,50,52,48,56,56,98,101,57,52,55,54,57,102,100,49,54,54,53,48,0,98,114,97,105,110,112,111,111,108,80,49,54,48,114,49,0,48,120,101,57,53,101,52,97,53,102,55,51,55,48,53,57,100,99,54,48,100,102,99,55,97,100,57,53,98,51,100,56,49,51,57,53,49,53,54,50,48,102,0,48,120,51,52,48,101,55,98,101,50,97,50,56,48,101,98,55,52,101,50,98,101,54,49,98,97,100,97,55,52,53,100,57,55,101,56,102,55,99,51,48,48,0,48,120,49,101,53,56,57,97,56,53,57,53,52,50,51,52,49,50,49,51,52,102,97,97,50,100,98,100,101,99,57,53,99,56,100,56,54,55,53,101,53,56,0,48,120,101,57,53,101,52,97,53,102,55,51,55,48,53,57,100,99,54,48,100,102,53,57,57,49,100,52,53,48,50,57,52,48,57,101,54,48,102,99,48,57,0,48,120,98,101,100,53,97,102,49,54,101,97,51,102,54,97,52,102,54,50,57,51,56,99,52,54,51,49,101,98,53,97,102,55,98,100,98,99,100,98,99,51,0,48,120,49,54,54,55,99,98,52,55,55,97,49,97,56,101,99,51,51,56,102,57,52,55,52,49,54,54,57,99,57,55,54,51,49,54,100,97,54,51,50,49,0,98,114,97,105,110,112,111,111,108,80,49,57,50,114,49,0,48,120,99,51,48,50,102,52,49,100,57,51,50,97,51,54,99,100,97,55,97,51,52,54,51,48,57,51,100,49,56,100,98,55,56,102,99,101,52,55,54,100,101,49,97,56,54,50,57,55,0,48,120,54,97,57,49,49,55,52,48,55,54,98,49,101,48,101,49,57,99,51,57,99,48,51,49,102,101,56,54,56,53,99,49,99,97,101,48,52,48,101,53,99,54,57,97,50,56,101,102,0,48,120,52,54,57,97,50,56,101,102,55,99,50,56,99,99,97,51,100,99,55,50,49,100,48,52,52,102,52,52,57,54,98,99,99,97,55,101,102,52,49,52,54,102,98,102,50,53,99,57,0,48,120,99,51,48,50,102,52,49,100,57,51,50,97,51,54,99,100,97,55,97,51,52,54,50,102,57,101,57,101,57,49,54,98,53,98,101,56,102,49,48,50,57,97,99,52,97,99,99,49,0,48,120,99,48,97,48,54,52,55,101,97,97,98,54,97,52,56,55,53,51,98,48,51,51,99,53,54,99,98,48,102,48,57,48,48,97,50,102,53,99,52,56,53,51,51,55,53,102,100,54,0,48,120,49,52,98,54,57,48,56,54,54,97,98,100,53,98,98,56,56,98,53,102,52,56,50,56,99,49,52,57,48,48,48,50,101,54,55,55,51,102,97,50,102,97,50,57,57,98,56,102,0,98,114,97,105,110,112,111,111,108,80,50,50,52,114,49,0,48,120,100,55,99,49,51,52,97,97,50,54,52,51,54,54,56,54,50,97,49,56,51,48,50,53,55,53,100,49,100,55,56,55,98,48,57,102,48,55,53,55,57,55,100,97,56,57,102,53,55,101,99,56,99,48,102,102,0,48,120,54,56,97,53,101,54,50,99,97,57,99,101,54,99,49,99,50,57,57,56,48,51,97,54,99,49,53,51,48,98,53,49,52,101,49,56,50,97,100,56,98,48,48,52,50,97,53,57,99,97,100,50,57,102,52,51,0,48,120,50,53,56,48,102,54,51,99,99,102,101,52,52,49,51,56,56,55,48,55,49,51,98,49,97,57,50,51,54,57,101,51,51,101,50,49,51,53,100,50,54,54,100,98,98,51,55,50,51,56,54,99,52,48,48,98,0,48,120,100,55,99,49,51,52,97,97,50,54,52,51,54,54,56,54,50,97,49,56,51,48,50,53,55,53,100,48,102,98,57,56,100,49,49,54,98,99,52,98,54,100,100,101,98,99,97,51,97,53,97,55,57,51,57,102,0,48,120,48,100,57,48,50,57,97,100,50,99,55,101,53,99,102,52,51,52,48,56,50,51,98,50,97,56,55,100,99,54,56,99,57,101,52,99,101,51,49,55,52,99,49,101,54,101,102,100,101,101,49,50,99,48,55,100,0,48,120,53,56,97,97,53,54,102,55,55,50,99,48,55,50,54,102,50,52,99,54,98,56,57,101,52,101,99,100,97,99,50,52,51,53,52,98,57,101,57,57,99,97,97,51,102,54,100,51,55,54,49,52,48,50,99,100,0,98,114,97,105,110,112,111,111,108,80,50,53,54,114,49,0,48,120,97,57,102,98,53,55,100,98,97,49,101,101,97,57,98,99,51,101,54,54,48,97,57,48,57,100,56,51,56,100,55,50,54,101,51,98,102,54,50,51,100,53,50,54,50,48,50,56,50,48,49,51,52,56,49,100,49,102,54,101,53,51,55,55,0,48,120,55,100,53,97,48,57,55,53,102,99,50,99,51,48,53,55,101,101,102,54,55,53,51,48,52,49,55,97,102,102,101,55,102,98,56,48,53,53,99,49,50,54,100,99,53,99,54,99,101,57,52,97,52,98,52,52,102,51,51,48,98,53,100,57,0,48,120,50,54,100,99,53,99,54,99,101,57,52,97,52,98,52,52,102,51,51,48,98,53,100,57,98,98,100,55,55,99,98,102,57,53,56,52,49,54,50,57,53,99,102,55,101,49,99,101,54,98,99,99,100,99,49,56,102,102,56,99,48,55,98,54,0,48,120,97,57,102,98,53,55,100,98,97,49,101,101,97,57,98,99,51,101,54,54,48,97,57,48,57,100,56,51,56,100,55,49,56,99,51,57,55,97,97,51,98,53,54,49,97,54,102,55,57,48,49,101,48,101,56,50,57,55,52,56,53,54,97,55,0,48,120,56,98,100,50,97,101,98,57,99,98,55,101,53,55,99,98,50,99,52,98,52,56,50,102,102,99,56,49,98,55,97,102,98,57,100,101,50,55,101,49,101,51,98,100,50,51,99,50,51,97,52,52,53,51,98,100,57,97,99,101,51,50,54,50,0,48,120,53,52,55,101,102,56,51,53,99,51,100,97,99,52,102,100,57,55,102,56,52,54,49,97,49,52,54,49,49,100,99,57,99,50,55,55,52,53,49,51,50,100,101,100,56,101,53,52,53,99,49,100,53,52,99,55,50,102,48,52,54,57,57,55,0,98,114,97,105,110,112,111,111,108,80,51,50,48,114,49,0,48,120,100,51,53,101,52,55,50,48,51,54,98,99,52,102,98,55,101,49,51,99,55,56,53,101,100,50,48,49,101,48,54,53,102,57,56,102,99,102,97,54,102,54,102,52,48,100,101,102,52,102,57,50,98,57,101,99,55,56,57,51,101,99,50,56,102,99,100,52,49,50,98,49,102,49,98,51,50,101,50,55,0,48,120,51,101,101,51,48,98,53,54,56,102,98,97,98,48,102,56,56,51,99,99,101,98,100,52,54,100,51,102,51,98,98,56,97,50,97,55,51,53,49,51,102,53,101,98,55,57,100,97,54,54,49,57,48,101,98,48,56,53,102,102,97,57,102,52,57,50,102,51,55,53,97,57,55,100,56,54,48,101,98,52,0,48,120,53,50,48,56,56,51,57,52,57,100,102,100,98,99,52,50,100,51,97,100,49,57,56,54,52,48,54,56,56,97,54,102,101,49,51,102,52,49,51,52,57,53,53,52,98,52,57,97,99,99,51,49,100,99,99,100,56,56,52,53,51,57,56,49,54,102,53,101,98,52,97,99,56,102,98,49,102,49,97,54,0,48,120,100,51,53,101,52,55,50,48,51,54,98,99,52,102,98,55,101,49,51,99,55,56,53,101,100,50,48,49,101,48,54,53,102,57,56,102,99,102,97,53,98,54,56,102,49,50,97,51,50,100,52,56,50,101,99,55,101,101,56,54,53,56,101,57,56,54,57,49,53,53,53,98,52,52,99,53,57,51,49,49,0,48,120,52,51,98,100,55,101,57,97,102,98,53,51,100,56,98,56,53,50,56,57,98,99,99,52,56,101,101,53,98,102,101,54,102,50,48,49,51,55,100,49,48,97,48,56,55,101,98,54,101,55,56,55,49,101,50,97,49,48,97,53,57,57,99,55,49,48,97,102,56,100,48,100,51,57,101,50,48,54,49,49,0,48,120,49,52,102,100,100,48,53,53,52,53,101,99,49,99,99,56,97,98,52,48,57,51,50,52,55,102,55,55,50,55,53,101,48,55,52,51,102,102,101,100,49,49,55,49,56,50,101,97,97,57,99,55,55,56,55,55,97,97,97,99,54,97,99,55,100,51,53,50,52,53,100,49,54,57,50,101,56,101,101,49,0,98,114,97,105,110,112,111,111,108,80,51,56,52,114,49,0,48,120,56,99,98,57,49,101,56,50,97,51,51,56,54,100,50,56,48,102,53,100,54,102,55,101,53,48,101,54,52,49,100,102,49,53,50,102,55,49,48,57,101,100,53,52,53,54,98,52,49,50,98,49,100,97,49,57,55,102,98,55,49,49,50,51,97,99,100,51,97,55,50,57,57,48,49,100,49,97,55,49,56,55,52,55,48,48,49,51,51,49,48,55,101,99,53,51,0,48,120,55,98,99,51,56,50,99,54,51,100,56,99,49,53,48,99,51,99,55,50,48,56,48,97,99,101,48,53,97,102,97,48,99,50,98,101,97,50,56,101,52,102,98,50,50,55,56,55,49,51,57,49,54,53,101,102,98,97,57,49,102,57,48,102,56,97,97,53,56,49,52,97,53,48,51,97,100,52,101,98,48,52,97,56,99,55,100,100,50,50,99,101,50,56,50,54,0,48,120,48,52,97,56,99,55,100,100,50,50,99,101,50,56,50,54,56,98,51,57,98,53,53,52,49,54,102,48,52,52,55,99,50,102,98,55,55,100,101,49,48,55,100,99,100,50,97,54,50,101,56,56,48,101,97,53,51,101,101,98,54,50,100,53,55,99,98,52,51,57,48,50,57,53,100,98,99,57,57,52,51,97,98,55,56,54,57,54,102,97,53,48,52,99,49,49,0,48,120,56,99,98,57,49,101,56,50,97,51,51,56,54,100,50,56,48,102,53,100,54,102,55,101,53,48,101,54,52,49,100,102,49,53,50,102,55,49,48,57,101,100,53,52,53,54,98,51,49,102,49,54,54,101,54,99,97,99,48,52,50,53,97,55,99,102,51,97,98,54,97,102,54,98,55,102,99,51,49,48,51,98,56,56,51,50,48,50,101,57,48,52,54,53,54,53,0,48,120,49,100,49,99,54,52,102,48,54,56,99,102,52,53,102,102,97,50,97,54,51,97,56,49,98,55,99,49,51,102,54,98,56,56,52,55,97,51,101,55,55,101,102,49,52,102,101,51,100,98,55,102,99,97,102,101,48,99,98,100,49,48,101,56,101,56,50,54,101,48,51,52,51,54,100,54,52,54,97,97,101,102,56,55,98,50,101,50,52,55,100,52,97,102,49,101,0,48,120,56,97,98,101,49,100,55,53,50,48,102,57,99,50,97,52,53,99,98,49,101,98,56,101,57,53,99,102,100,53,53,50,54,50,98,55,48,98,50,57,102,101,101,99,53,56,54,52,101,49,57,99,48,53,52,102,102,57,57,49,50,57,50,56,48,101,52,54,52,54,50,49,55,55,57,49,56,49,49,49,52,50,56,50,48,51,52,49,50,54,51,99,53,51,49,53,0,98,114,97,105,110,112,111,111,108,80,53,49,50,114,49,0,48,120,97,97,100,100,57,100,98,56,100,98,101,57,99,52,56,98,51,102,100,52,101,54,97,101,51,51,99,57,102,99,48,55,99,98,51,48,56,100,98,51,98,51,99,57,100,50,48,101,100,54,54,51,57,99,99,97,55,48,51,51,48,56,55,49,55,100,52,100,57,98,48,48,57,98,99,54,54,56,52,50,97,101,99,100,97,49,50,97,101,54,97,51,56,48,101,54,50,56,56,49,102,102,50,102,50,100,56,50,99,54,56,53,50,56,97,97,54,48,53,54,53,56,51,97,52,56,102,51,0,48,120,55,56,51,48,97,51,51,49,56,98,54,48,51,98,56,57,101,50,51,50,55,49,52,53,97,99,50,51,52,99,99,53,57,52,99,98,100,100,56,100,51,100,102,57,49,54,49,48,97,56,51,52,52,49,99,97,101,97,57,56,54,51,98,99,50,100,101,100,53,100,53,97,97,56,50,53,51,97,97,49,48,97,50,101,102,49,99,57,56,98,57,97,99,56,98,53,55,102,49,49,49,55,97,55,50,98,102,50,99,55,98,57,101,55,99,49,97,99,52,100,55,55,102,99,57,52,99,97,0,48,120,51,100,102,57,49,54,49,48,97,56,51,52,52,49,99,97,101,97,57,56,54,51,98,99,50,100,101,100,53,100,53,97,97,56,50,53,51,97,97,49,48,97,50,101,102,49,99,57,56,98,57,97,99,56,98,53,55,102,49,49,49,55,97,55,50,98,102,50,99,55,98,57,101,55,99,49,97,99,52,100,55,55,102,99,57,52,99,97,100,99,48,56,51,101,54,55,57,56,52,48,53,48,98,55,53,101,98,97,101,53,100,100,50,56,48,57,98,100,54,51,56,48,49,54,102,55,50,51,0,48,120,97,97,100,100,57,100,98,56,100,98,101,57,99,52,56,98,51,102,100,52,101,54,97,101,51,51,99,57,102,99,48,55,99,98,51,48,56,100,98,51,98,51,99,57,100,50,48,101,100,54,54,51,57,99,99,97,55,48,51,51,48,56,55,48,53,53,51,101,53,99,52,49,52,99,97,57,50,54,49,57,52,49,56,54,54,49,49,57,55,102,97,99,49,48,52,55,49,100,98,49,100,51,56,49,48,56,53,100,100,97,100,100,98,53,56,55,57,54,56,50,57,99,97,57,48,48,54,57,0,48,120,56,49,97,101,101,52,98,100,100,56,50,101,100,57,54,52,53,97,50,49,51,50,50,101,57,99,52,99,54,97,57,51,56,53,101,100,57,102,55,48,98,53,100,57,49,54,99,49,98,52,51,98,54,50,101,101,102,52,100,48,48,57,56,101,102,102,51,98,49,102,55,56,101,50,100,48,100,52,56,100,53,48,100,49,54,56,55,98,57,51,98,57,55,100,53,102,55,99,54,100,53,48,52,55,52,48,54,97,53,101,54,56,56,98,51,53,50,50,48,57,98,99,98,57,102,56,50,50,0,48,120,55,100,100,101,51,56,53,100,53,54,54,51,51,50,101,99,99,48,101,97,98,102,97,57,99,102,55,56,50,50,102,100,102,50,48,57,102,55,48,48,50,52,97,53,55,98,49,97,97,48,48,48,99,53,53,98,56,56,49,102,56,49,49,49,98,50,100,99,100,101,52,57,52,97,53,102,52,56,53,101,53,98,99,97,52,98,100,56,56,97,50,55,54,51,97,101,100,49,99,97,50,98,50,102,97,56,102,48,53,52,48,54,55,56,99,100,49,101,48,102,51,97,100,56,48,56,57,50,0,71,79,83,84,50,48,48,49,45,116,101,115,116,0,48,120,56,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,52,51,49,0,48,120,48,48,48,48,48,48,48,48,48,48,48],"i8",ALLOC_NONE,Runtime.GLOBAL_BASE+20480);allocate([48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,55,0,48,120,53,102,98,102,102,52,57,56,97,97,57,51,56,99,101,55,51,57,98,56,101,48,50,50,102,98,97,102,101,102,52,48,53,54,51,102,54,101,54,97,51,52,55,50,102,99,50,97,53,49,52,99,48,99,101,57,100,97,101,50,51,98,55,101,0,48,120,56,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,49,53,48,102,101,56,97,49,56,57,50,57,55,54,49,53,52,99,53,57,99,102,99,49,57,51,97,99,99,102,53,98,51,0,48,120,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,50,0,48,120,48,56,101,50,97,56,97,48,101,54,53,49,52,55,100,52,98,100,54,51,49,54,48,51,48,101,49,54,100,49,57,99,56,53,99,57,55,102,48,97,57,99,97,50,54,55,49,50,50,98,57,54,97,98,98,99,101,97,55,101,56,102,99,56,0,71,79,83,84,50,48,48,49,45,67,114,121,112,116,111,80,114,111,45,65,0,48,120,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,100,57,55,0,48,120,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,100,57,52,0,48,120,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,97,54,0,48,120,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,54,99,54,49,49,48,55,48,57,57,53,97,100,49,48,48,52,53,56,52,49,98,48,57,98,55,54,49,98,56,57,51,0,48,120,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,49,0,48,120,56,100,57,49,101,52,55,49,101,48,57,56,57,99,100,97,50,55,100,102,53,48,53,97,52,53,51,102,50,98,55,54,51,53,50,57,52,102,50,100,100,102,50,51,101,51,98,49,50,50,97,99,99,57,57,99,57,101,57,102,49,101,49,52,0,71,79,83,84,50,48,48,49,45,67,114,121,112,116,111,80,114,111,45,66,0,48,120,56,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,99,57,57,0,48,120,56,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,99,57,54,0,48,120,51,101,49,97,102,52,49,57,97,50,54,57,97,53,102,56,54,54,97,55,100,51,99,50,53,99,51,100,102,56,48,97,101,57,55,57,50,53,57,51,55,51,102,102,50,98,49,56,50,102,52,57,100,52,99,101,55,101,49,98,98,99,56,98,0,48,120,56,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,49,53,102,55,48,48,99,102,102,102,49,97,54,50,52,101,53,101,52,57,55,49,54,49,98,99,99,56,97,49,57,56,102,0,48,120,51,102,97,56,49,50,52,51,53,57,102,57,54,54,56,48,98,56,51,100,49,99,51,101,98,50,99,48,55,48,101,53,99,53,52,53,99,57,56,53,56,100,48,51,101,99,102,98,55,52,52,98,102,56,100,55,49,55,55,49,55,101,102,99,0,71,79,83,84,50,48,48,49,45,67,114,121,112,116,111,80,114,111,45,67,0,48,120,57,98,57,102,54,48,53,102,53,97,56,53,56,49,48,55,97,98,49,101,99,56,53,101,54,98,52,49,99,56,97,97,99,102,56,52,54,101,56,54,55,56,57,48,53,49,100,51,55,57,57,56,102,55,98,57,48,50,50,100,55,53,57,98,0,48,120,57,98,57,102,54,48,53,102,53,97,56,53,56,49,48,55,97,98,49,101,99,56,53,101,54,98,52,49,99,56,97,97,99,102,56,52,54,101,56,54,55,56,57,48,53,49,100,51,55,57,57,56,102,55,98,57,48,50,50,100,55,53,57,56,0,48,120,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,56,48,53,97,0,48,120,57,98,57,102,54,48,53,102,53,97,56,53,56,49,48,55,97,98,49,101,99,56,53,101,54,98,52,49,99,56,97,97,53,56,50,99,97,51,53,49,49,101,100,100,102,98,55,52,102,48,50,102,51,97,54,53,57,56,57,56,48,98,98,57,0,48,120,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,0,48,120,52,49,101,99,101,53,53,55,52,51,55,49,49,97,56,99,51,99,98,102,51,55,56,51,99,100,48,56,99,48,101,101,52,100,52,100,99,52,52,48,100,52,54,52,49,97,56,102,51,54,54,101,53,53,48,100,102,100,98,51,98,98,54,55,0,71,79,83,84,50,48,49,50,45,116,101,115,116,0,48,120,52,53,51,49,97,99,100,49,102,101,48,48,50,51,99,55,53,53,48,100,50,54,55,98,54,98,50,102,101,101,56,48,57,50,50,98,49,52,98,50,102,102,98,57,48,102,48,52,100,52,101,98,55,99,48,57,98,53,100,50,100,49,53,100,102,49,100,56,53,50,55,52,49,97,102,52,55,48,52,97,48,52,53,56,48,52,55,101,56,48,101,52,53,52,54,100,51,53,98,56,51,51,54,102,97,99,50,50,52,100,100,56,49,54,54,52,98,98,102,53,50,56,98,101,54,51,55,51,0,48,120,49,99,102,102,48,56,48,54,97,51,49,49,49,54,100,97,50,57,100,56,99,102,97,53,52,101,53,55,101,98,55,52,56,98,99,53,102,51,55,55,101,52,57,52,48,48,102,100,100,55,56,56,98,54,52,57,101,99,97,49,97,99,52,51,54,49,56,51,52,48,49,51,98,50,97,100,55,51,50,50,52,56,48,97,56,57,99,97,53,56,101,48,99,102,55,52,98,99,57,101,53,52,48,99,50,97,100,100,54,56,57,55,102,97,100,48,97,51,48,56,52,102,51,48,50,97,100,99,0,48,120,52,53,51,49,97,99,100,49,102,101,48,48,50,51,99,55,53,53,48,100,50,54,55,98,54,98,50,102,101,101,56,48,57,50,50,98,49,52,98,50,102,102,98,57,48,102,48,52,100,52,101,98,55,99,48,57,98,53,100,50,100,49,53,100,97,56,50,102,50,100,55,101,99,98,49,100,98,97,99,55,49,57,57,48,53,99,53,101,101,99,99,52,50,51,102,49,100,56,54,101,50,53,101,100,98,101,50,51,99,53,57,53,100,54,52,52,97,97,102,49,56,55,101,54,101,54,100,102,0,48,120,50,52,100,49,57,99,99,54,52,53,55,50,101,101,51,48,102,51,57,54,98,102,54,101,98,98,102,100,55,97,54,99,53,50,49,51,98,51,98,51,100,55,48,53,55,99,99,56,50,53,102,57,49,48,57,51,97,54,56,99,100,55,54,50,102,100,54,48,54,49,49,50,54,50,99,100,56,51,56,100,99,54,98,54,48,97,97,55,101,101,101,56,48,52,101,50,56,98,99,56,52,57,57,55,55,102,97,99,51,51,98,52,98,53,51,48,102,49,98,49,50,48,50,52,56,97,57,97,0,48,120,50,98,98,51,49,50,97,52,51,98,100,50,99,101,54,101,48,100,48,50,48,54,49,51,99,56,53,55,97,99,100,100,99,102,98,102,48,54,49,101,57,49,101,53,102,50,99,51,102,51,50,52,52,55,99,50,53,57,102,51,57,98,50,99,56,51,97,98,49,53,54,100,55,55,102,49,52,57,54,98,102,55,101,98,51,51,53,49,101,49,101,101,52,101,52,51,100,99,49,97,49,56,98,57,49,98,50,52,54,52,48,98,54,100,98,98,57,50,99,98,49,97,100,100,51,55,49,101,0,71,79,83,84,50,48,49,50,45,116,99,50,54,45,65,0,48,120,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,100,99,55,0,48,120,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,100,99,52,0,48,120,101,56,99,50,53,48,53,100,101,100,102,99,56,54,100,100,99,49,98,100,48,98,50,98,54,54,54,55,102,49,100,97,51,52,98,56,50,53,55,52,55,54,49,99,98,48,101,56,55,57,98,100,48,56,49,99,102,100,48,98,54,50,54,53,101,101,51,99,98,48,57,48,102,51,48,100,50,55,54,49,52,99,98,52,53,55,52,48,49,48,100,97,57,48,100,100,56,54,50,101,102,57,100,52,101,98,101,101,52,55,54,49,53,48,51,49,57,48,55,56,53,97,55,49,99,55,54,48,0,48,120,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,50,55,101,54,57,53,51,50,102,52,56,100,56,57,49,49,54,102,102,50,50,98,56,100,52,101,48,53,54,48,54,48,57,98,52,98,51,56,97,98,102,97,100,50,98,56,53,100,99,97,99,100,98,49,52,49,49,102,49,48,98,50,55,53,0,48,120,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,51,0,48,120,55,53,48,51,99,102,101,56,55,97,56,51,54,97,101,51,97,54,49,98,56,56,49,54,101,50,53,52,53,48,101,54,99,101,53,101,49,99,57,51,97,99,102,49,97,98,99,49,55,55,56,48,54,52,102,100,99,98,101,102,97,57,50,49,100,102,49,54,50,54,98,101,52,102,100,48,51,54,101,57,51,100,55,53,101,54,97,53,48,101,51,97,52,49,101,57,56,48,50,56,102,101,53,102,99,50,51,53,102,53,98,56,56,57,97,53,56,57,99,98,53,50,49,53,102,50,97,52,0,71,79,83,84,50,48,49,50,45,116,99,50,54,45,66,0,48,120,56,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,54,102,0,48,120,56,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,54,99,0,48,120,54,56,55,100,49,98,52,53,57,100,99,56,52,49,52,53,55,101,51,101,48,54,99,102,54,102,53,101,50,53,49,55,98,57,55,99,55,100,54,49,52,97,102,49,51,56,98,99,98,102,56,53,100,99,56,48,54,99,52,98,50,56,57,102,51,101,57,54,53,100,50,100,98,49,52,49,54,100,50,49,55,102,56,98,50,55,54,102,97,100,49,97,98,54,57,99,53,48,102,55,56,98,101,101,49,102,97,51,49,48,54,101,102,98,56,99,99,98,99,55,99,53,49,52,48,49,49,54,0,48,120,56,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,49,52,57,97,49,101,99,49,52,50,53,54,53,97,53,52,53,97,99,102,100,98,55,55,98,100,57,100,52,48,99,102,97,56,98,57,57,54,55,49,50,49,48,49,98,101,97,48,101,99,54,51,52,54,99,53,52,51,55,52,102,50,53,98,100,0,48,120,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,50,0,48,120,49,97,56,102,55,101,100,97,51,56,57,98,48,57,52,99,50,99,48,55,49,101,51,54,52,55,97,56,57,52,48,102,51,99,49,50,51,98,54,57,55,53,55,56,99,50,49,51,98,101,54,100,100,57,101,54,99,56,101,99,55,51,51,53,100,99,98,50,50,56,102,100,49,101,100,102,52,97,51,57,49,53,50,99,98,99,97,97,102,56,99,48,51,57,56,56,50,56,48,52,49,48,53,53,102,57,52,99,101,101,101,99,55,101,50,49,51,52,48,55,56,48,102,101,52,49,98,100,0,115,101,99,112,50,53,54,107,49,0,48,120,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,69,70,70,70,70,70,67,50,70,0,48,120,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,69,66,65,65,69,68,67,69,54,65,70,52,56,65,48,51,66,66,70,68,50,53,69,56,67,68,48,51,54,52,49,52,49,0,48,120,55,57,66,69,54,54,55,69,70,57,68,67,66,66,65,67,53,53,65,48,54,50,57,53,67,69,56,55,48,66,48,55,48,50,57,66,70,67,68,66,50,68,67,69,50,56,68,57,53,57,70,50,56,49,53,66,49,54,70,56,49,55,57,56,0,48,120,52,56,51,65,68,65,55,55,50,54,65,51,67,52,54,53,53,68,65,52,70,66,70,67,48,69,49,49,48,56,65,56,70,68,49,55,66,52,52,56,65,54,56,53,53,52,49,57,57,67,52,55,68,48,56,70,70,66,49,48,68,52,66,56,0,49,46,51,46,54,46,49,46,52,46,49,46,49,49,53,57,49,46,49,53,46,49,0,49,46,50,46,56,52,48,46,49,48,48,52,53,46,51,46,49,46,49,0,112,114,105,109,101,49,57,50,118,49,0,115,101,99,112,49,57,50,114,49,0,110,105,115,116,112,49,57,50,0,115,101,99,112,50,50,52,114,49,0,49,46,51,46,49,51,50,46,48,46,51,51,0,110,105,115,116,112,50,50,52,0,49,46,50,46,56,52,48,46,49,48,48,52,53,46,51,46,49,46,55,0,112,114,105,109,101,50,53,54,118,49,0,115,101,99,112,50,53,54,114,49,0,110,105,115,116,112,50,53,54,0,115,101,99,112,51,56,52,114,49,0,49,46,51,46,49,51,50,46,48,46,51,52,0,110,105,115,116,112,51,56,52,0,115,101,99,112,53,50,49,114,49,0,49,46,51,46,49,51,50,46,48,46,51,53,0,110,105,115,116,112,53,50,49,0,49,46,51,46,51,54,46,51,46,51,46,50,46,56,46,49,46,49,46,49,0,49,46,51,46,51,54,46,51,46,51,46,50,46,56,46,49,46,49,46,51,0,49,46,51,46,51,54,46,51,46,51,46,50,46,56,46,49,46,49,46,53,0,49,46,51,46,51,54,46,51,46,51,46,50,46,56,46,49,46,49,46,55,0,49,46,51,46,51,54,46,51,46,51,46,50,46,56,46,49,46,49,46,57,0,49,46,51,46,51,54,46,51,46,51,46,50,46,56,46,49,46,49,46,49,49,0,49,46,51,46,51,54,46,51,46,51,46,50,46,56,46,49,46,49,46,49,51,0,49,46,50,46,54,52,51,46,50,46,50,46,51,53,46,48,0,49,46,50,46,54,52,51,46,50,46,50,46,51,53,46,49,0,49,46,50,46,54,52,51,46,50,46,50,46,51,53,46,50,0,49,46,50,46,54,52,51,46,50,46,50,46,51,53,46,51,0,71,79,83,84,50,48,48,49,45,67,114,121,112,116,111,80,114,111,45,88,99,104,65,0,71,79,83,84,50,48,48,49,45,67,114,121,112,116,111,80,114,111,45,88,99,104,66,0,49,46,50,46,54,52,51,46,50,46,50,46,51,54,46,48,0,49,46,50,46,54,52,51,46,50,46,50,46,51,54,46,49,0,49,46,50,46,54,52,51,46,55,46,49,46,50,46,49,46,50,46,49,0,49,46,50,46,54,52,51,46,55,46,49,46,50,46,49,46,50,46,50,0,49,46,51,46,49,51,50,46,48,46,49,48,0,48,120,48,52,0,45,112,97,98,103,110,104,0,98,0,103,0,46,120,0,46,121,0,46,122,0,104,0,100,0,101,99,99,32,103,101,116,32,112,97,114,97,109,58,32,70,97,105,108,101,100,32,116,111,32,103,101,116,32,97,102,102,105,110,101,32,99,111,111,114,100,105,110,97,116,101,115,10,0,40,112,117,98,108,105,99,45,107,101,121,40,101,99,99,40,112,37,109,41,40,97,37,109,41,40,98,37,109,41,40,103,37,109,41,40,110,37,109,41,40,104,37,109,41,41,41,0,103,46,120,0,103,46,121,0,113,46,120,0,113,46,121,0,101,100,100,115,97,95,101,110,99,111,100,101,112,111,105,110,116,58,32,70,97,105,108,101,100,32,116,111,32,103,101,116,32,97,102,102,105,110,101,32,99,111,111,114,100,105,110,97,116,101,115,10,0,48,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,68,0,115,99,97,110,110,105,110,103,32,69,67,67,32,112,97,114,97,109,101,116,101,114,32,102,97,105,108,101,100,58,32,37,115,10,0,50,66,56,51,50,52,56,48,52,70,67,49,68,70,48,66,50,66,52,68,48,48,57,57,51,68,70,66,68,55,65,55,50,70,52,51,49,56,48,54,65,68,50,70,69,52,55,56,67,52,69,69,49,66,50,55,52,65,48,69,65,48,66,48,0,101,99,103,101,110,32,32,32,32,32,32,112,107,0,42,32,101,95,112,107,0,32,32,101,95,112,107,0,32,32,32,32,32,109,0,32,32,32,114,0,32,32,32,101,95,114,0,32,72,40,82,43,41,0,32,32,32,101,95,115,0,87,101,105,101,114,115,116,114,97,115,115,0,69,100,119,97,114,100,115,0,83,116,97,110,100,97,114,100,0,69,100,50,53,53,49,57,0,109,112,105,95,112,114,105,110,116,32,102,97,105,108,101,100,58,32,37,115,10,0,109,112,105,95,115,99,97,110,32,102,97,105,108,101,100,58,32,37,115,10,0,70,73,80,83,45,49,57,56,97,44,32,65,46,49,0,83,97,109,112,108,101,32,35,49,0,79,76,163,213,214,139,167,204,10,18,8,201,198,30,156,93,160,64,60,10,0,105,110,118,97,108,105,100,32,116,101,115,116,115,32,100,97,116,97,0,103,99,114,121,95,109,100,95,115,101,116,107,101,121,32,102,97,105,108,101,100,0,103,99,114,121,95,109,100,95,114,101,97,100,32,102,97,105,108,101,100,0,100,111,101,115,32,110,111,116,32,109,97,116,99,104,0,70,73,80,83,45,49,57,56,97,44,32,65,46,50,0,83,97,109,112,108,101,32,35,50,0,9,34,211,64,95,170,61,25,79,130,164,88,48,115,125,92,198,199,93,36,0,70,73,80,83,45,49,57,56,97,44,32,65,46,51,0,83,97,109,112,108,101,32,35,51,0,188,244,30,171,139,178,216,2,243,208,92,175,124,176,146,236,248,209,163,170,0,70,73,80,83,45,49,57,56,97,44,32,65,46,52,0,83,97,109,112,108,101,32,35,52,0,158,168,134,239,226,104,219,236,206,66,12,117,36,223,50,224,117,26,42,38,0,104,109,97,99,0,100,97,116,97,45,50,56,32,107,101,121,45,52,0,119,104,97,116,32,100,111,32,121,97,32,119,97,110,116,32,102,111,114,32,110,111,116,104,105,110,103,63,0,74,101,102,101,0,100,97,116,97,45,57,32,107,101,121,45,50,48,0,72,105,32,84,104,101,114,101,0,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,100,97,116,97,45,53,48,32,107,101,121,45,50,48,0,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,0,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,0,100,97,116,97,45,53,48,32,107,101,121,45,50,54,0,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,0,100,97,116,97,45,53,52,32,107,101,121,45,49,51,49,0,84,101,115,116,32,85,115,105,110,103,32,76,97,114,103,101,114,32,84,104,97,110,32,66,108,111,99,107,45,83,105,122,101,32,75,101,121,32,45,32,72,97,115,104,32,75,101,121,32,70,105,114,115,116,0,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,0,100,97,116,97,45,49,53,50,32,107,101,121,45,49,51,49,0,84,104,105,115,32,105,115,32,97,32,116,101,115,116,32,117,115,105,110,103,32,97,32,108,97,114,103,101,114,32,116,104,97,110,32,98,108,111,99,107,45,115,105,122,101,32,107,101,121,32,97,110,100,32,97,32,108,97,114,103,101,114,32,116,104,97,110,32,98,108,111,99,107,45,115,105,122,101,32,100,97,116,97,46,32,84,104,101,32,107,101,121,32,110,101,101,100,115,32,116,111,32,98,101,32,104,97,115,104,101,100,32,98,101,102,111,114,101,32,98,101,105,110,103,32,117,115,101,100,32,98,121,32,116,104,101,32,72,77,65,67,32,97,108,103,111,114,105,116,104,109,46,0,95,103,99,114,121,95,104,109,97,99,50,53,54,95,110,101,119,32,102,97,105,108,101,100,0,95,103,99,114,121,95,104,109,97,99,50,53,54,95,102,105,110,97,108,105,122,101,32,102,97,105,108,101,100,0,100,111,101,115,32,110,111,116,32,109,97,116,99,104,32,105,110,32,115,101,99,111,110,100,32,105,109,112,108,101,109,101,110,116,97,116,105,111,110,0,97,108,103,111,114,105,116,104,109,32,110,111,116,32,97,118,97,105,108,97,98,108,101,0,111,105,100,46,0,79,73,68,46,0,109,100,46,99,0,109,100,95,119,114,105,116,101,0,109,100,95,101,110,97,98,108,101,58,32,97,108,103,111,114,105,116,104,109,32,37,100,32,110,111,116,32,97,118,97,105,108,97,98,108,101,10,0,77,68,53,32,117,115,101,100,0,79,111,112,115,58,32,109,100,32,100,101,98,117,103,32,97,108,114,101,97,100,121,32,115,116,97,114,116,101,100,10,0,100,98,103,109,100,45,37,48,53,100,46,37,46,49,48,115,0,119,0,109,100,32,100,101,98,117,103,58,32,99,97,110,39,116,32,111,112,101,110,32,37,115,10,0,109,100,95,103,101,116,95,97,108,103,111,0,112,111,115,115,105,98,108,101,32,117,115,97,103,101,32,101,114,114,111,114,0,87,65,82,78,73,78,71,58,32,109,111,114,101,32,116,104,97,110,32,111,110,101,32,97,108,103,111,114,105,116,104,109,32,105,110,32,109,100,95,103,101,116,95,97,108,103,111,40,41,10,0,109,111,114,101,32,116,104,97,110,32,111,110,101,32,97,108,103,111,114,105,116,104,109,32,105,110,32,109,100,95,114,101,97,100,40,48,41,10,0,109,100,95,114,101,97,100,0,103,99,114,121,95,109,100,95,111,112,101,110,32,102,97,105,108,101,100,32,102,111,114,32,97,108,103,111,32,37,100,58,32,37,115,0,107,101,121,108,101,110,32,60,61,32,104,100,45,62,99,116,120,45,62,109,97,99,112,97,100,115,95,66,115,105,122,101,0,112,114,101,112,97,114,101,95,109,97,99,112,97,100,115,0,110,111,32,65,83,78,46,49,32,79,73,68,32,102,111,114,32,109,100,32,97,108,103,111,32,37,100,10,0,99,97,110,39,116,32,103,101,110,101,114,97,116,101,32,97,32,112,114,105,109,101,32,119,105,116,104,32,108,101,115,115,32,116,104,97,110,32,37,100,32,98,105,116,115,10,0,95,103,99,114,121,95,109,112,105,95,99,109,112,40,32,40,120,41,44,32,40,110,109,105,110,117,115,49,41,32,41,32,60,32,48,32,38,38,32,95,103,99,114,121,95,109,112,105,95,99,109,112,95,117,105,40,32,40,120,41,44,32,40,49,41,32,41,32,62,32,48,0,112,114,105,109,101,103,101,110,46,99,0,105,115,95,112,114,105,109,101,0,112,114,105,109,101,103,101,110,0,111,118,101,114,102,108,111,119,32,105,110,32,112,114,105,109,101,32,103,101,110,101,114,97,116,105,111,110,10,0,112,115,115,0,114,97,119,0,99,111,109,112,0,111,97,101,112,0,112,107,99,115,49,0,112,97,114,97,109,0,110,111,99,111,109,112,0,114,102,99,54,57,55,57,0,110,111,112,97,114,97,109,0,112,107,99,115,49,45,114,97,119,0,105,103,110,105,110,118,102,108,97,103,0,110,111,45,107,101,121,116,101,115,116,0,110,111,45,98,108,105,110,100,105,110,103,0,117,115,101,45,102,105,112,115,49,56,54,0,117,115,101,45,102,105,112,115,49,56,54,45,50,0,110,98,105,116,115,0,114,115,97,45,117,115,101,45,101,0,115,105,103,45,118,97,108,0,104,97,115,104,45,97,108,103,111,0,115,104,97,49,0,109,100,53,0,115,104,97,50,53,54,0,114,105,112,101,109,100,49,54,48,0,114,109,100,49,54,48,0,115,104,97,51,56,52,0,115,104,97,53,49,50,0,115,104,97,50,50,52,0,109,100,50,0,109,100,52,0,116,105,103,101,114,0,104,97,118,97,108,0,108,97,98,101,108,0,114,97,110,100,111,109,45,111,118,101,114,114,105,100,101,0,100,97,116,97,0,104,97,115,104,0,115,97,108,116,45,108,101,110,103,116,104,0,63,0,112,114,105,118,97,116,101,45,107,101,121,0,112,117,98,108,105,99,45,107,101,121,0,103,101,110,107,101,121,0,97,108,103,111,114,105,116,104,109,32,100,105,115,97,98,108,101,100,0,97,108,103,111,114,105,116,104,109,32,110,111,116,32,102,111,117,110,100,0,110,111,32,115,101,108,102,116,101,115,116,32,97,118,97,105,108,97,98,108,101,0,109,111,100,117,108,101,0,65,69,83,0,82,73,74,78,68,65,69,76,0,65,69,83,49,50,56,0,65,69,83,45,49,50,56,0,50,46,49,54,46,56,52,48,46,49,46,49,48,49,46,51,46,52,46,49,46,49,0,50,46,49,54,46,56,52,48,46,49,46,49,48,49,46,51,46,52,46,49,46,50,0,50,46,49,54,46,56,52,48,46,49,46,49,48,49,46,51,46,52,46,49,46,51,0,50,46,49,54,46,56,52,48,46,49,46,49,48,49,46,51,46,52,46,49,46,52,0,232,233,234,235,237,238,239,240,242,243,244,245,247,248,249,250,1,75,175,34,120,166,157,51,29,81,128,16,54,67,233,154,103,67,195,209,81,154,180,242,205,154,120,171,9,165,17,189,65,69,83,45,49,50,56,32,116,101,115,116,32,101,110,99,114,121,112,116,105,111,110,32,102,97,105,108,101,100,46,0,65,69,83,45,49,50,56,32,116,101,115,116,32,100,101,99,114,121,112,116,105,111,110,32,102,97,105,108,101,100,46,0,4,5,6,7,9,10,11,12,14,15,16,17,19,20,21,22,24,25,26,27,29,30,31,32,118,119,116,117,241,242,243,244,248,249,230,231,119,112,113,114,93,30,242,13,206,214,188,188,18,19,26,199,197,71,136,170,65,69,83,45,49,57,50,32,116,101,115,116,32,101,110,99,114,121,112,116,105,111,110,32,102,97,105,108,101,100,46,0,65,69,83,45,49,57,50,32,116,101,115,116,32,100,101,99,114,121,112,116,105,111,110,32,102,97,105,108,101,100,46,0,8,9,10,11,13,14,15,16,18,19,20,21,23,24,25,26,28,29,30,31,33,34,35,36,38,39,40,41,43,44,45,46,6,154,0,127,199,106,69,159,152,186,249,23,254,223,149,33,8,14,149,23,235,22,119,113,154,207,114,128,134,4,10,227,65,69,83,45,50,53,54,32,116,101,115,116,32,101,110,99,114,121,112,116,105,111,110,32,102,97,105,108,101,100,46,0,65,69,83,45,50,53,54,32,116,101,115,116,32,100,101,99,114,121,112,116,105,111,110,32,102,97,105,108,101,100,46,0,99,102,98,0,110,111,32,116,101,115,116,32,100,97,116,97,32,102,111,114,32,116,104,105,115,32,109,111,100,101,0,111,112,101,110,0,115,101,116,32,107,101,121,0,115,101,116,32,73,86,0,101,110,99,114,121,112,116,32,99,111,109,109,97,110,100,0,101,110,99,114,121,112,116,32,109,105,115,109,97,116,99,104,0,100,101,99,114,121,112,116,32,99,111,109,109,97,110,100,0,100,101,99,114,121,112,116,32,109,105,115,109,97,116,99,104,0,111,102,98,0,99,105,112,104,101,114,0,65,69,83,49,57,50,0,82,73,74,78,68,65,69,76,49,57,50,0,65,69,83,45,49,57,50,0,50,46,49,54,46,56,52,48,46,49,46,49,48,49,46,51,46,52,46,49,46,50,49,0,50,46,49,54,46,56,52,48,46,49,46,49,48,49,46,51,46,52,46,49,46,50,50,0,50,46,49,54,46,56,52,48,46,49,46,49,48,49,46,51,46,52,46,49,46,50,51,0,50,46,49,54,46,56,52,48,46,49,46,49,48,49,46,51,46,52,46,49,46,50,52,0,65,69,83,50,53,54,0,82,73,74,78,68,65,69,76,50,53,54,0,65,69,83,45,50,53,54,0,50,46,49,54,46,56,52,48,46,49,46,49,48,49,46,51,46,52,46,49,46,52,49,0,50,46,49,54,46,56,52,48,46,49,46,49,48,49,46,51,46,52,46,49,46,52,50,0,50,46,49,54,46,56,52,48,46,49,46,49,48,49,46,51,46,52,46,49,46,52,51,0,50,46,49,54,46,56,52,48,46,49,46,49,48,49,46,51,46,52,46,49,46,52,52,0,82,73,80,69,77,68,49,54,48,0,48,33,48,9,6,5,43,36,3,2,1,5,0,4,20,49,46,51,46,51,54,46,51,46,51,46,49,46,50,0,49,46,51,46,51,54,46,51,46,50,46,49,0,105,32,62,32,48,0,114,115,97,45,99,111,109,109,111,110,46,99,0,95,103,99,114,121,95,114,115,97,95,112,107,99,115,49,95,101,110,99,111,100,101,95,102,111,114,95,101,110,99,0,110,32,61,61,32,110,102,114,97,109,101,0,80,75,67,83,35,49,32,98,108,111,99,107,32,116,121,112,101,32,50,32,101,110,99,111,100,101,100,32,100,97,116,97,0,118,97,108,117,101,32,101,120,116,114,97,99,116,101,100,32,102,114,111,109,32,80,75,67,83,35,49,32,98,108,111,99,107,32,116,121,112,101,32,50,32,101,110,99,111,100,101,100,32,100,97,116,97,0,105,32,62,32,49,0,95,103,99,114,121,95,114,115,97,95,112,107,99,115,49,95,101,110,99,111,100,101,95,102,111,114,95,115,105,103,0,80,75,67,83,35,49,32,98,108,111,99,107,32,116,121,112,101,32,49,32,101,110,99,111,100,101,100,32,100,97,116,97,0,95,103,99,114,121,95,114,115,97,95,112,107,99,115,49,95,101,110,99,111,100,101,95,114,97,119,95,102,111,114,95,115,105,103,0,79,65,69,80,32,101,110,99,111,100,101,100,32,100,97,116,97,0,118,97,108,117,101,32,101,120,116,114,97,99,116,101,100,32,102,114,111,109,32,79,65,69,80,32,101,110,99,111,100,101,100,32,100,97,116,97,0,104,108,101,110,0,95,103,99,114,121,95,114,115,97,95,112,115,115,95,101,110,99,111,100,101,0,80,83,83,32,101,110,99,111,100,101,100,32,100,97,116,97,0,95,103,99,114,121,95,114,115,97,95,112,115,115,95,118,101,114,105,102,121,0,82,83,65,0,114,115,97,0,111,112,101,110,112,103,112,45,114,115,97,0,111,105,100,46,49,46,50,46,56,52,48,46,49,49,51,53,52,57,46,49,46,49,46,49,0,110,101,0,110,101,100,112,113,117,0,97,0,115,0,110,0,100,101,114,105,118,101,45,112,97,114,109,115,0,117,115,101,45,120,57,51,49,0,95,103,99,114,121,95,109,112,105,95,103,101,116,95,110,98,105,116,115,32,40,40,120,112,41,41,32,61,61,32,110,98,105,116,115,0,114,115,97,46,99,0,103,101,110,95,120,57,51,49,95,112,97,114,109,95,120,112,0,95,103,99,114,121,95,109,112,105,95,103,101,116,95,110,98,105,116,115,32,40,40,120,105,41,41,32,61,61,32,49,48,49,0,103,101,110,95,120,57,51,49,95,112,97,114,109,95,120,105,0,88,112,49,0,88,112,50,0,88,112,0,88,113,49,0,88,113,50,0,88,113,0,95,103,99,114,121,95,109,112,105,95,103,99,100,32,40,32,40,103,41,44,32,40,101,41,44,32,40,112,104,105,41,32,41,0,103,101,110,101,114,97,116,101,95,120,57,51,49,0,112,32,97,110,100,32,113,32,97,114,101,32,115,119,97,112,112,101,100,10,0,32,32,113,0,32,32,110,0,32,32,101,0,32,32,100,0,32,32,117,0,115,101,108,102,45,116,101,115,116,32,97,102,116,101,114,32,107,101,121,32,103,101,110,101,114,97,116,105,111,110,32,102,97,105,108,101,100,0,40,109,105,115,99,45,107,101,121,45,105,110,102,111,40,112,45,113,45,115,119,97,112,112,101,100,41,41,0,103,101,110,101,114,97,116,101,95,115,116,100,0,32,32,112,61,32,0,32,32,113,61,32,0,112,104,105,61,32,0,32,32,103,61,32,0,32,32,102,61,32,0,32,32,110,61,32,0,32,32,101,61,32,0,32,32,100,61,32,0,32,32,117,61,32,0,40,107,101,121,45,100,97,116,97,32,40,112,117,98,108,105,99,45,107,101,121,32,32,40,114,115,97,40,110,37,109,41,40,101,37,109,41,41,41,32,40,112,114,105,118,97,116,101,45,107,101,121,32,32,40,114,115,97,40,110,37,109,41,40,101,37,109,41,40,100,37,109,41,40,112,37,109,41,40,113,37,109,41,40,117,37,109,41,41,41,32,37,83,41,0,114,115,97,95,116,101,115,116,107,101,121,32,32,32,32,61,62,32,37,115,10,0,114,115,97,95,101,110,99,114,121,112,116,32,100,97,116,97,0,114,115,97,95,101,110,99,114,121,112,116,32,32,32,32,110,0,114,115,97,95,101,110,99,114,121,112,116,32,32,32,32,101,0,114,115,97,95,101,110,99,114,121,112,116,32,32,114,101,115,0,40,101,110,99,45,118,97,108,40,114,115,97,40,97,37,98,41,41,41,0,40,101,110,99,45,118,97,108,40,114,115,97,40,97,37,109,41,41,41,0,114,115,97,95,101,110,99,114,121,112,116,32,32,32,32,61,62,32,37,115,10,0,114,115,97,95,100,101,99,114,121,112,116,32,100,97,116,97,0,110,101,100,112,63,113,63,117,63,0,114,115,97,95,100,101,99,114,121,112,116,32,32,32,32,110,0,114,115,97,95,100,101,99,114,121,112,116,32,32,32,32,101,0,114,115,97,95,100,101,99,114,121,112,116,32,32,32,32,100,0,114,115,97,95,100,101,99,114,121,112,116,32,32,32,32,112,0,114,115,97,95,100,101,99,114,121,112,116,32,32,32,32,113,0,114,115,97,95,100,101,99,114,121,112,116,32,32,32,32,117,0,114,115,97,95,100,101,99,114,121,112,116,32,32,114,101,115,0,40,118,97,108,117,101,32,37,98,41,0,37,109,0,114,115,97,95,100,101,99,114,121,112,116,32,32,32,32,61,62,32,37,115,10,0,114,115,97,95,115,105,103,110,32,32,32,100,97,116,97,0,114,115,97,95,115,105,103,110,32,32,32,32,32,32,110,0,114,115,97,95,115,105,103,110,32,32,32,32,32,32,101,0,114,115,97,95,115,105,103,110,32,32,32,32,32,32,100,0,114,115,97,95,115,105,103,110,32,32,32,32,32,32,112,0,114,115,97,95,115,105,103,110,32,32,32,32,32,32,113,0,114,115,97,95,115,105,103,110,32,32,32,32,32,32,117,0,114,115,97,95,115,105,103,110,32,32,32,32,114,101,115,0,40,115,105,103,45,118,97,108,40,114,115,97,40,115,37,98,41,41,41,0,40,115,105,103,45,118,97,108,40,114,115,97,40,115,37,77,41,41,41,0,114,115,97,95,115,105,103,110,32,32,32,32,32,32,61,62,32,37,115,10,0,114,115,97,95,118,101,114,105,102,121,32,100,97,116,97,0,114,115,97,95,118,101,114,105,102,121,32,32,115,105,103,0,114,115,97,95,118,101,114,105,102,121,32,32,32,32,110,0,114,115,97,95,118,101,114,105,102,121,32,32,32,32,101,0,114,115,97,95,118,101,114,105,102,121,32,32,99,109,112,0,114,115,97,95,118,101,114,105,102,121,32,32,32,32,61,62,32,37,115,10,0,99,111,110,118,101,114,116,0,40,112,114,105,118,97,116,101,45,107,101,121,32,40,114,115,97,32,32,40,110,32,35,48,48,101,48,99,101,57,54,102,57,48,98,54,99,57,101,48,50,102,51,57,50,50,98,101,97,100,97,57,51,102,101,53,48,97,56,55,53,101,97,99,54,98,99,99,49,56,98,98,57,97,57,99,102,50,101,56,52,57,54,53,99,97,97,32,32,32,32,32,32,50,100,49,102,102,57,53,97,55,102,53,52,50,52,54,53,99,54,99,48,99,49,57,100,50,55,54,101,52,53,50,54,99,101,48,52,56,56,54,56,97,55,97,57,49,52,102,100,51,52,51,99,99,51,97,56,55,100,100,55,52,50,57,49,32,32,32,32,32,32,102,102,99,53,54,53,53,48,54,100,53,98,98,98,50,53,99,98,97,99,54,97,48,101,50,100,100,49,102,56,98,99,97,97,98,48,100,52,97,50,57,99,50,102,51,55,99,57,53,48,102,51,54,51,52,56,52,98,102,50,54,57,102,55,32,32,32,32,32,32,56,57,49,52,52,48,52,54,52,98,97,102,55,57,56,50,55,101,48,51,97,51,54,101,55,48,98,56,49,52,57,51,56,101,101,98,100,99,54,51,101,57,54,52,50,52,55,98,101,55,53,100,99,53,56,98,48,49,52,98,55,101,97,50,53,49,35,41,32,32,40,101,32,35,48,49,48,48,48,49,35,41,32,32,40,100,32,35,48,52,54,49,50,57,102,50,52,56,57,100,55,49,53,55,57,98,101,48,97,55,53,102,101,48,50,57,98,100,54,99,100,98,53,55,52,101,98,102,53,55,101,97,56,97,53,98,48,102,100,97,57,52,50,99,97,98,57,52,51,98,49,49,32,32,32,32,32,32,55,100,55,98,98,57,53,101,53,100,50,56,56,55,53,101,48,102,57,102,99,53,102,99,99,48,54,97,55,50,102,54,100,53,48,50,52,54,52,100,97,98,100,101,100,55,56,101,102,54,98,55,49,54,49,55,55,98,56,51,100,53,98,100,32,32,32,32,32,32,99,53,52,51,100,99,53,100,51,102,101,100,57,51,50,101,53,57,102,53,56,57,55,101,57,50,101,54,102,53,56,97,48,102,51,51,52,50,52,49,48,54,97,51,98,54,102,97,50,99,98,102,56,55,55,53,49,48,101,52,97,99,50,49,32,32,32,32,32,32,99,51,101,101,52,55,56,53,49,101,57,55,100,49,50,57,57,54,50,50,50,97,99,51,53,54,54,100,52,99,99,98,48,98,56,51,100,49,54,52,48,55,52,97,98,102,55,100,101,54,53,53,102,99,50,52,52,54,100,97,49,55,56,49,35,41,32,32,40,112,32,35,48,48,101,56,54,49,98,55,48,48,101,49,55,101,56,97,102,101,54,56,51,55,101,55,53,49,50,101,51,53,98,54,99,97,49,49,100,48,97,101,52,55,100,56,98,56,53,49,54,49,99,54,55,98,97,102,54,52,51,55,55,50,49,51,32,32,32,32],"i8",ALLOC_NONE,Runtime.GLOBAL_BASE+30720);allocate([32,32,102,101,53,50,100,55,55,50,102,50,48,51,53,98,51,99,97,56,51,48,97,102,52,49,100,56,97,52,49,50,48,101,49,99,49,99,55,48,100,49,50,99,99,50,50,102,48,48,100,50,56,100,51,49,100,100,52,56,97,56,100,52,50,52,102,49,35,41,32,32,40,113,32,35,48,48,102,55,97,55,99,97,53,51,54,55,99,54,54,49,102,56,101,54,50,100,102,51,52,102,48,100,48,53,99,49,48,99,56,56,101,53,52,57,50,51,52,56,100,100,55,98,100,100,99,57,52,50,99,57,97,56,102,51,54,57,102,57,32,32,32,32,32,32,51,53,97,48,55,55,56,53,100,50,100,98,56,48,53,50,49,53,101,100,55,56,54,101,52,50,56,53,100,102,49,54,53,56,101,101,100,51,99,101,56,52,102,52,54,57,98,56,49,98,53,48,100,51,53,56,52,48,55,98,52,97,100,51,54,49,35,41,32,32,40,117,32,35,51,48,52,53,53,57,97,57,101,97,100,53,54,100,50,51,48,57,100,50,48,51,56,49,49,97,54,52,49,98,98,49,97,48,57,54,50,54,98,99,56,101,98,51,54,102,102,102,97,50,51,99,57,54,56,101,99,53,98,100,56,57,49,101,32,32,32,32,32,32,101,98,98,97,102,99,55,51,97,101,54,54,54,101,48,49,98,97,55,99,56,57,57,48,98,97,101,48,54,99,99,50,98,98,101,49,48,98,55,53,101,54,57,102,99,97,99,98,51,53,51,97,54,52,55,51,48,55,57,100,56,101,57,98,35,41,41,41,0,40,112,117,98,108,105,99,45,107,101,121,32,40,114,115,97,32,32,40,110,32,35,48,48,101,48,99,101,57,54,102,57,48,98,54,99,57,101,48,50,102,51,57,50,50,98,101,97,100,97,57,51,102,101,53,48,97,56,55,53,101,97,99,54,98,99,99,49,56,98,98,57,97,57,99,102,50,101,56,52,57,54,53,99,97,97,32,32,32,32,32,32,50,100,49,102,102,57,53,97,55,102,53,52,50,52,54,53,99,54,99,48,99,49,57,100,50,55,54,101,52,53,50,54,99,101,48,52,56,56,54,56,97,55,97,57,49,52,102,100,51,52,51,99,99,51,97,56,55,100,100,55,52,50,57,49,32,32,32,32,32,32,102,102,99,53,54,53,53,48,54,100,53,98,98,98,50,53,99,98,97,99,54,97,48,101,50,100,100,49,102,56,98,99,97,97,98,48,100,52,97,50,57,99,50,102,51,55,99,57,53,48,102,51,54,51,52,56,52,98,102,50,54,57,102,55,32,32,32,32,32,32,56,57,49,52,52,48,52,54,52,98,97,102,55,57,56,50,55,101,48,51,97,51,54,101,55,48,98,56,49,52,57,51,56,101,101,98,100,99,54,51,101,57,54,52,50,52,55,98,101,55,53,100,99,53,56,98,48,49,52,98,55,101,97,50,53,49,35,41,32,32,40,101,32,35,48,49,48,48,48,49,35,41,41,41,0,107,101,121,32,99,111,110,115,105,115,116,101,110,99,121,0,115,105,103,110,0,40,100,97,116,97,32,40,102,108,97,103,115,32,112,107,99,115,49,41,32,40,104,97,115,104,32,115,104,97,49,32,35,49,49,50,50,51,51,52,52,53,53,54,54,55,55,56,56,57,57,48,48,97,97,98,98,99,99,100,100,101,101,102,102,49,48,50,48,51,48,52,48,35,41,41,0,40,100,97,116,97,32,40,102,108,97,103,115,32,112,107,99,115,49,41,32,40,104,97,115,104,32,115,104,97,49,32,35,49,49,50,50,51,51,52,52,53,53,54,54,55,55,56,56,57,57,48,48,97,97,98,98,99,99,100,100,101,101,102,102,56,48,50,48,51,48,52,48,35,41,41,0,99,111,110,118,101,114,116,105,110,103,32,100,97,116,97,32,102,97,105,108,101,100,0,115,105,103,110,105,110,103,32,102,97,105,108,101,100,0,118,101,114,105,102,121,32,102,97,105,108,101,100,0,98,97,100,32,115,105,103,110,97,116,117,114,101,32,110,111,116,32,100,101,116,101,99,116,101,100,0,101,110,99,114,121,112,116,0,40,100,97,116,97,32,40,102,108,97,103,115,32,114,97,119,41,32,40,118,97,108,117,101,32,37,109,41,41,0,101,110,99,114,121,112,116,32,102,97,105,108,101,100,0,101,110,99,45,118,97,108,0,103,99,114,121,95,112,107,95,100,101,99,114,121,112,116,32,114,101,116,117,114,110,101,100,32,103,97,114,98,97,103,101,0,99,105,112,104,101,114,116,101,120,116,32,109,97,116,99,104,101,115,32,112,108,97,105,110,116,101,120,116,0,100,101,99,114,121,112,116,32,102,97,105,108,101,100,0,118,97,108,117,101,0,100,101,99,114,121,112,116,32,114,101,116,117,114,110,101,100,32,110,111,32,112,108,97,105,110,116,101,120,116,0,109,105,115,109,97,116,99,104,0,83,72,65,49,0,48,33,48,9,6,5,43,14,3,2,26,5,0,4,20,49,46,50,46,56,52,48,46,49,49,51,53,52,57,46,49,46,49,46,53,0,49,46,50,46,56,52,48,46,49,48,48,52,48,46,52,46,51,0,49,46,51,46,49,52,46,51,46,50,46,50,54,0,49,46,51,46,49,52,46,51,46,50,46,50,57,0,49,46,50,46,56,52,48,46,49,48,48,52,53,46,52,46,49,0,169,153,62,54,71,6,129,106,186,62,37,113,120,80,194,108,156,208,216,157,0,132,152,62,68,28,59,210,110,186,174,74,161,249,81,41,229,229,70,112,241,0,52,170,151,60,212,196,218,164,246,30,235,43,219,173,39,49,101,52,1,111,0,83,72,65,50,50,52,0,48,45,48,13,6,9,96,134,72,1,101,3,4,2,4,5,0,4,28,50,46,49,54,46,56,52,48,46,49,46,49,48,49,46,51,46,52,46,50,46,52,0,35,9,125,34,52,5,216,34,134,66,164,119,189,162,85,179,42,173,188,228,189,160,179,247,227,108,157,167,0,97,98,99,100,98,99,100,101,99,100,101,102,100,101,102,103,101,102,103,104,102,103,104,105,103,104,105,106,104,105,106,107,105,106,107,108,106,107,108,109,107,108,109,110,108,109,110,111,109,110,111,112,110,111,112,113,0,117,56,139,22,81,39,118,204,93,186,93,161,253,137,1,80,176,198,69,92,180,245,139,25,82,82,37,37,0,32,121,70,85,152,12,145,216,187,180,193,234,151,97,138,75,240,63,66,88,25,72,178,238,78,231,173,103,0,186,120,22,191,143,1,207,234,65,65,64,222,93,174,34,35,176,3,97,163,150,23,122,156,180,16,255,97,242,0,21,173,0,36,141,106,97,210,6,56,184,229,192,38,147,12,62,96,57,163,60,228,89,100,255,33,103,246,236,237,212,25,219,6,193,0,205,199,110,92,153,20,251,146,129,161,199,226,132,215,62,103,241,128,154,72,164,151,32,14,4,109,57,204,199,17,44,208,0,83,72,65,50,53,54,0,48,49,48,13,6,9,96,134,72,1,101,3,4,2,1,5,0,4,32,50,46,49,54,46,56,52,48,46,49,46,49,48,49,46,51,46,52,46,50,46,49,0,49,46,50,46,56,52,48,46,49,49,51,53,52,57,46,49,46,49,46,49,49,0,83,72,65,53,49,50,0,48,81,48,13,6,9,96,134,72,1,101,3,4,2,3,5,0,4,64,50,46,49,54,46,56,52,48,46,49,46,49,48,49,46,51,46,52,46,50,46,51,0,49,46,50,46,56,52,48,46,49,49,51,53,52,57,46,49,46,49,46,49,51,0,115,104,111,114,116,32,115,116,114,105,110,103,0,97,98,99,0,203,0,117,63,69,163,94,139,181,160,61,105,154,198,80,7,39,44,50,171,14,222,209,99,26,139,96,90,67,255,91,237,128,134,7,43,161,231,204,35,88,186,236,161,52,200,37,167,0,108,111,110,103,32,115,116,114,105,110,103,0,97,98,99,100,101,102,103,104,98,99,100,101,102,103,104,105,99,100,101,102,103,104,105,106,100,101,102,103,104,105,106,107,101,102,103,104,105,106,107,108,102,103,104,105,106,107,108,109,103,104,105,106,107,108,109,110,104,105,106,107,108,109,110,111,105,106,107,108,109,110,111,112,106,107,108,109,110,111,112,113,107,108,109,110,111,112,113,114,108,109,110,111,112,113,114,115,109,110,111,112,113,114,115,116,110,111,112,113,114,115,116,117,0,9,51,12,51,247,17,71,232,61,25,47,199,130,205,27,71,83,17,27,23,59,59,5,210,47,160,128,134,227,176,247,18,252,199,199,26,85,126,45,185,102,195,233,250,145,116,96,57,0,111,110,101,32,109,105,108,108,105,111,110,32,34,97,34,0,157,14,24,9,113,100,116,203,8,110,131,78,49,10,74,28,237,20,158,156,0,242,72,82,121,114,206,197,112,76,42,91,7,184,179,220,56,236,196,235,174,151,221,216,127,61,137,133,0,100,105,103,101,115,116,0,221,175,53,161,147,97,122,186,204,65,115,73,174,32,65,49,18,230,250,78,137,169,126,162,10,158,238,230,75,85,211,154,33,146,153,42,39,79,193,168,54,186,60,35,163,254,235,189,69,77,68,35,100,60,232,14,42,154,201,79,165,76,164,159,0,142,149,155,117,218,227,19,218,140,244,247,40,20,252,20,63,143,119,121,198,235,159,127,161,114,153,174,173,182,136,144,24,80,29,40,158,73,0,247,228,51,27,153,222,196,181,67,58,199,211,41,238,182,221,38,84,94,150,229,91,135,75,233,9,0,231,24,72,61,12,231,105,100,78,46,66,199,188,21,180,99,142,31,152,177,59,32,68,40,86,50,168,3,175,169,115,235,222,15,242,68,135,126,166,10,76,176,67,44,229,119,195,27,235,0,156,92,44,73,170,46,78,173,178,23,173,140,192,155,0,83,72,65,51,56,52,0,48,65,48,13,6,9,96,134,72,1,101,3,4,2,2,5,0,4,48,50,46,49,54,46,56,52,48,46,49,46,49,48,49,46,51,46,52,46,50,46,50,0,49,46,50,46,56,52,48,46,49,49,51,53,52,57,46,49,46,49,46,49,50,0,84,87,79,70,73,83,72,0,159,88,159,92,246,18,44,50,182,191,236,47,42,232,195,90,212,145,219,22,231,177,195,158,134,203,8,107,120,159,84,25,1,159,152,9,222,23,17,133,143,170,195,163,186,32,251,195,84,119,111,102,105,115,104,45,49,50,56,32,116,101,115,116,32,101,110,99,114,121,112,116,105,111,110,32,102,97,105,108,101,100,46,0,84,119,111,102,105,115,104,45,49,50,56,32,116,101,115,116,32,100,101,99,114,121,112,116,105,111,110,32,102,97,105,108,101,100,46,0,212,59,183,85,110,163,46,70,242,162,130,183,212,91,78,13,87,255,115,157,77,201,44,27,215,252,1,112,12,200,33,111,144,175,233,27,178,136,84,79,44,50,220,35,155,38,53,230,108,180,86,28,64,191,10,151,5,147,28,182,212,8,231,250,84,119,111,102,105,115,104,45,50,53,54,32,116,101,115,116,32,101,110,99,114,121,112,116,105,111,110,32,102,97,105,108,101,100,46,0,84,119,111,102,105,115,104,45,50,53,54,32,116,101,115,116,32,100,101,99,114,121,112,116,105,111,110,32,102,97,105,108,101,100,46,0,37,115,10,0,0,1,23,2,46,24,83,3,106,47,147,25,52,84,69,4,92,107,182,48,166,148,75,26,140,53,129,85,170,70,13,5,36,93,135,108,155,183,193,49,43,167,163,149,152,76,202,27,230,141,115,54,205,130,18,86,98,171,240,71,79,14,189,6,212,37,210,94,39,136,102,109,214,156,121,184,8,194,223,50,104,44,253,168,138,164,90,150,41,153,34,77,96,203,228,28,123,231,59,142,158,116,244,55,216,206,249,131,111,19,178,87,225,99,220,172,196,241,175,72,10,80,66,15,186,190,199,7,222,213,120,38,101,211,209,95,227,40,33,137,89,103,252,110,177,215,248,157,243,122,58,185,198,9,65,195,174,224,219,51,68,105,146,45,82,254,22,169,12,139,128,165,74,91,181,151,201,42,162,154,192,35,134,78,188,97,239,204,17,229,114,29,61,124,235,232,233,60,234,143,125,159,236,117,30,245,62,56,246,217,63,207,118,250,31,132,160,112,237,20,144,179,126,88,251,226,32,100,208,221,119,173,218,197,64,242,57,176,247,73,180,11,127,81,21,67,145,16,113,187,238,191,133,200,161,1,2,4,8,16,32,64,128,77,154,121,242,169,31,62,124,248,189,55,110,220,245,167,3,6,12,24,48,96,192,205,215,227,139,91,182,33,66,132,69,138,89,178,41,82,164,5,10,20,40,80,160,13,26,52,104,208,237,151,99,198,193,207,211,235,155,123,246,161,15,30,60,120,240,173,23,46,92,184,61,122,244,165,7,14,28,56,112,224,141,87,174,17,34,68,136,93,186,57,114,228,133,71,142,81,162,9,18,36,72,144,109,218,249,191,51,102,204,213,231,131,75,150,97,194,201,223,243,171,27,54,108,216,253,183,35,70,140,85,170,25,50,100,200,221,247,163,11,22,44,88,176,45,90,180,37,74,148,101,202,217,255,179,43,86,172,21,42,84,168,29,58,116,232,157,119,238,145,111,222,241,175,19,38,76,152,125,250,185,63,126,252,181,39,78,156,117,234,153,127,254,177,47,94,188,53,106,212,229,135,67,134,65,130,73,146,105,210,233,159,115,230,129,79,158,113,226,137,95,190,49,98,196,197,199,195,203,219,251,187,59,118,236,149,103,206,209,239,147,107,214,225,143,83,166,1,2,4,8,16,32,64,128,77,154,121,242,169,31,62,124,248,189,55,110,220,245,167,3,6,12,24,48,96,192,205,215,227,139,91,182,33,66,132,69,138,89,178,41,82,164,5,10,20,40,80,160,13,26,52,104,208,237,151,99,198,193,207,211,235,155,123,246,161,15,30,60,120,240,173,23,46,92,184,61,122,244,165,7,14,28,56,112,224,141,87,174,17,34,68,136,93,186,57,114,228,133,71,142,81,162,9,18,36,72,144,109,218,249,191,51,102,204,213,231,131,75,150,97,194,201,223,243,171,27,54,108,216,253,183,35,70,140,85,170,25,50,100,200,221,247,163,11,22,44,88,176,45,90,180,37,74,148,101,202,217,255,179,43,86,172,21,42,84,168,29,58,116,232,157,119,238,145,111,222,241,175,19,38,76,152,125,250,185,63,126,252,181,39,78,156,117,234,153,127,254,177,47,94,188,53,106,212,229,135,67,134,65,130,73,146,105,210,233,159,115,230,129,79,158,113,226,137,95,190,49,98,196,197,199,195,203,169,117,103,243,179,198,232,244,4,219,253,123,163,251,118,200,154,74,146,211,128,230,120,107,228,69,221,125,209,232,56,75,13,214,198,50,53,216,152,253,24,55,247,113,236,241,108,225,67,48,117,15,55,248,38,27,250,135,19,250,148,6,72,63,242,94,208,186,139,174,48,91,132,138,84,0,223,188,35,157,25,109,91,193,61,177,89,14,243,128,174,93,162,210,130,213,99,160,1,132,131,7,46,20,217,181,81,144,155,44,124,163,166,178,235,115,165,76,190,84,22,146,12,116,227,54,97,81,192,56,140,176,58,189,245,90,115,252,44,96,37,98,11,150,187,108,78,66,137,247,107,16,83,124,106,40,180,39,241,140,225,19,230,149,189,156,69,199,226,36,244,70,182,59,102,112,204,202,149,227,3,133,86,203,212,17,28,208,30,147,215,184,251,166,195,131,142,32,181,255,233,159,207,119,191,195,186,204,234,3,119,111,57,8,175,191,51,64,201,231,98,43,113,226,129,121,121,12,9,170,173,130,36,65,205,58,249,234,216,185,229,228,197,154,185,164,77,151,68,126,8,218,134,122,231,23,161,102,29,148,170,161,237,29,6,61,112,240,178,222,210,179,65,11,123,114,160,167,17,28,49,239,194,209,39,83,144,62,32,143,246,51,96,38,255,95,150,236,92,118,177,42,171,73,158,129,156,136,82,238,27,33,95,196,147,26,10,235,239,217,145,197,133,57,73,153,238,205,45,173,79,49,143,139,59,1,71,24,135,35,109,221,70,31,214,78,62,45,105,249,100,72,42,79,206,242,203,101,47,142,252,120,151,92,5,88,122,25,172,141,127,229,213,152,26,87,75,103,14,127,167,5,90,100,40,175,20,99,63,182,41,254,136,245,60,183,76,60,2,165,184,206,218,233,176,104,23,68,85,224,31,77,138,67,125,105,87,41,199,46,141,172,116,21,183,89,196,168,159,10,114,158,126,110,21,71,34,223,18,52,88,53,7,106,153,207,52,220,110,34,80,201,222,192,104,155,101,137,188,212,219,237,248,171,200,18,168,162,43,13,64,82,220,187,254,2,50,47,164,169,202,215,16,97,33,30,240,180,211,80,93,4,15,246,0,194,111,22,157,37,54,134,66,86,74,85,94,9,193,190,224,145,117,243,198,244,219,123,251,200,74,211,230,107,69,125,232,75,214,50,216,253,55,113,241,225,48,15,248,27,135,250,6,63,94,186,174,91,138,0,188,157,109,193,177,14,128,93,210,213,160,132,7,20,181,144,44,163,178,115,76,84,146,116,54,81,56,176,189,90,252,96,98,150,108,66,247,16,124,40,39,140,19,149,156,199,36,70,59,112,202,227,133,203,17,208,147,184,166,131,32,255,159,119,195,204,3,111,8,191,64,231,43,226,121,12,170,130,65,58,234,185,228,154,164,151,126,218,122,23,102,148,161,29,61,240,222,179,11,114,167,28,239,209,83,62,143,51,38,95,236,118,42,73,129,136,238,33,196,26,235,217,197,57,153,205,173,49,139,1,24,35,221,31,78,45,249,72,79,242,101,142,120,92,88,25,141,229,152,87,103,127,5,100,175,99,182,254,245,183,60,165,206,233,104,68,224,77,67,105,41,46,172,21,89,168,10,158,110,71,223,52,53,106,207,220,34,201,192,155,137,212,237,171,18,162,13,82,187,2,47,169,215,97,30,180,80,4,246,194,22,37,134,86,85,9,190,145,169,103,179,232,4,253,163,118,154,146,128,120,228,221,209,56,13,198,53,152,24,247,236,108,67,117,55,38,250,19,148,72,242,208,139,48,132,84,223,35,25,91,61,89,243,174,162,130,99,1,131,46,217,81,155,124,166,235,165,190,22,12,227,97,192,140,58,245,115,44,37,11,187,78,137,107,83,106,180,241,225,230,189,69,226,244,182,102,204,149,3,86,212,28,30,215,251,195,142,181,233,207,191,186,234,119,57,175,51,201,98,113,129,121,9,173,36,205,249,216,229,197,185,77,68,8,134,231,161,29,170,237,6,112,178,210,65,123,160,17,49,194,39,144,32,246,96,255,150,92,177,171,158,156,82,27,95,147,10,239,145,133,73,238,45,79,143,59,71,135,109,70,214,62,105,100,42,206,203,47,252,151,5,122,172,127,213,26,75,14,167,90,40,20,63,41,136,60,76,2,184,218,176,23,85,31,138,125,87,199,141,116,183,196,159,114,126,21,34,18,88,7,153,52,110,80,222,104,101,188,219,248,200,168,43,64,220,254,50,164,202,16,33,240,211,93,15,0,111,157,54,66,74,94,193,224,84,87,79,70,73,83,72,49,50,56,0,102,97,105,108,101,100,32,116,111,32,97,99,113,117,105,114,101,32,116,104,101,32,110,111,110,99,101,32,98,117,102,102,101,114,32,108,111,99,107,58,32,37,115,10,0,102,97,105,108,101,100,32,116,111,32,114,101,108,101,97,115,101,32,116,104,101,32,110,111,110,99,101,32,98,117,102,102,101,114,32,108,111,99,107,58,32,37,115,10,0,37,115,46,42,0,37,115,46,88,0,101,99,95,105,110,118,109,58,32,105,110,118,101,114,115,101,32,100,111,101,115,32,110,111,116,32,101,120,105,115,116,58,10,0,32,32,97,0,32,32,112,0,37,115,58,32,71,101,116,116,105,110,103,32,89,45,99,111,111,114,100,105,110,97,116,101,32,111,110,32,37,115,32,105,115,32,110,111,116,32,115,117,112,112,111,114,116,101,100,10,0,95,103,99,114,121,95,109,112,105,95,101,99,95,103,101,116,95,97,102,102,105,110,101,0,77,111,110,116,103,111,109,101,114,121,0,71,67,82,89,80,84,95,66,65,82,82,69,84,84,0,37,115,58,32,37,115,32,110,111,116,32,121,101,116,32,115,117,112,112,111,114,116,101,100,10,0,95,103,99,114,121,95,109,112,105,95,101,99,95,100,117,112,95,112,111,105,110,116,0,95,103,99,114,121,95,109,112,105,95,101,99,95,97,100,100,95,112,111,105,110,116,115,0,0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,33,98,112,95,109,97,114,107,101,114,0,109,112,105,45,112,111,119,46,99,0,95,103,99,114,121,95,109,112,105,95,112,111,119,109,0,114,101,115,45,62,100,32,61,61,32,114,112,0,105,32,61,61,32,110,108,105,109,98,115,0,109,112,105,99,111,100,101,114,46,99,0,95,103,99,114,121,95,109,112,105,95,115,101,116,95,98,117,102,102,101,114,0,58,103,101,110,101,114,105,99,47,109,112,105,104,45,97,100,100,49,46,99,58,103,101,110,101,114,105,99,47,109,112,105,104,45,115,117,98,49,46,99,58,103,101,110,101,114,105,99,47,109,112,105,104,45,109,117,108,49,46,99,58,103,101,110,101,114,105,99,47,109,112,105,104,45,109,117,108,50,46,99,58,103,101,110,101,114,105,99,47,109,112,105,104,45,109,117,108,51,46,99,58,103,101,110,101,114,105,99,47,109,112,105,104,45,108,115,104,105,102,116,46,99,58,103,101,110,101,114,105,99,47,109,112,105,104,45,114,115,104,105,102,116,46,99,0,105,110,118,97,108,105,100,32,109,112,105,95,99,111,110,115,116,32,115,101,108,101,99,116,111,114,32,37,100,10,0,87,97,114,110,105,110,103,58,32,116,114,121,105,110,103,32,116,111,32,99,104,97,110,103,101,32,97,110,32,105,109,109,117,116,97,98,108,101,32,77,80,73,10,0,105,110,118,97,108,105,100,32,102,108,97,103,32,118,97,108,117,101,32,105,110,32,109,112,105,95,102,114,101,101,10,0,109,112,105,95,103,101,116,95,111,112,97,113,117,101,32,111,110,32,110,111,114,109,97,108,32,109,112,105,10,0,109,112,105,95,115,101,116,95,99,111,110,100,58,32,100,105,102,102,101,114,101,110,116,32,115,105,122,101,115,10,0,109,112,105,95,115,119,97,112,95,99,111,110,100,58,32,100,105,102,102,101,114,101,110,116,32,115,105,122,101,115,10,0,105,110,118,97,108,105,100,32,102,108,97,103,32,118,97,108,117,101,10,0,77,80,73,32,115,117,98,115,121,115,116,101,109,32,110,111,116,32,105,110,105,116,105,97,108,105,122,101,100,10,0,10,10,84,104,105,115,32,105,115,32,76,105,98,103,99,114,121,112,116,32,49,46,55,46,48,45,98,101,116,97,50,51,48,32,45,32,84,104,101,32,71,78,85,32,67,114,121,112,116,111,32,76,105,98,114,97,114,121,10,67,111,112,121,114,105,103,104,116,32,40,67,41,32,50,48,48,48,45,50,48,49,50,32,70,114,101,101,32,83,111,102,116,119,97,114,101,32,70,111,117,110,100,97,116,105,111,110,44,32,73,110,99,46,10,67,111,112,121,114,105,103,104,116,32,40,67,41,32,50,48,49,50,45,50,48,49,52,32,103,49,48,32,67,111,100,101,32,71,109,98,72,10,67,111,112,121,114,105,103,104,116,32,40,67,41,32,50,48,49,51,45,50,48,49,52,32,74,117,115,115,105,32,75,105,118,105,108,105,110,110,97,10,10,40,97,51,54,101,101,55,53,32,50,48,49,54,45,48,53,45,50,53,84,49,53,58,49,55,43,48,48,48,48,41,10,10,10,0,99,105,112,104,101,114,45,99,109,97,99,46,99,0,99,109,97,99,95,103,101,110,101,114,97,116,101,95,115,117,98,107,101,121,115,0,99,45,62,117,110,117,115,101,100,32,60,32,98,108,111,99,107,115,105,122,101,0,99,105,112,104,101,114,45,99,116,114,46,99,0,95,103,99,114,121,95,99,105,112,104,101,114,95,99,116,114,95,101,110,99,114,121,112,116,0,117,110,117,115,101,100,32,61,61,32,98,108,111,99,107,115,105,122,101,0,99,105,112,104,101,114,45,103,99,109,46,99,0,100,111,95,103,104,97,115,104,95,98,117,102,0,102,97,105,108,101,100,32,116,111,32,97,108,108,111,99,97,116,101,32,109,101,109,111,114,121,0,115,101,116,107,101,121,32,102,97,105,108,101,100,0,115,101,108,102,116,101,115,116,32,102,111,114,32,67,66,67,32,102,97,105,108,101,100,32,45,32,115,101,101,32,115,121,115,108,111,103,32,102,111,114,32,100,101,116,97,105,108,115,0,115,101,108,102,116,101,115,116,32,102,111,114,32,67,70,66,32,102,97,105,108,101,100,32,45,32,115,101,101,32,115,121,115,108,111,103,32,102,111,114,32,100,101,116,97,105,108,115,0,115,101,108,102,116,101,115,116,32,102,111,114,32,67,84,82,32,102,97,105,108,101,100,32,45,32,115,101,101,32,115,121,115,108,111,103,32,102,111,114,32,100,101,116,97,105,108,115,0,69,67,67,0,101,99,99,0,101,99,100,115,97,0,101,99,100,104,0,101,100,100,115,97,0,103,111,115,116,0,112,97,98,103,110,104,113,0,112,97,98,103,110,104,113,100,0,115,119,0,114,115,0,99,117,114,118,101,0,102,108,97,103,115,0,116,114,97,110,115,105,101,110,116,45,107,101,121,0,101,99,103,101,110,32,99,117,114,118,101,32,105,110,102,111,58,32,37,115,47,37,115,10,0,101,99,103,101,110,32,99,117,114,118,101,32,117,115,101,100,58,32,37,115,10,0,101,99,103,101,110,32,99,117,114,118,101,32,32,32,112,0,101,99,103,101,110,32,99,117,114,118,101,32,32,32,97,0,101,99,103,101,110,32,99,117,114,118,101,32,32,32,98,0,101,99,103,101,110,32,99,117,114,118,101,32,32,32,110,0,101,99,103,101,110,32,99,117,114,118,101,32,32,32,104,0,101,99,103,101,110,32,99,117,114,118,101,32,71,0,101,99,103,101,110,58,32,70,97,105,108,101,100,32,116,111,32,103,101,116,32,97,102,102,105,110,101,32,99,111,111,114,100,105,110,97,116,101,115,32,102,111,114,32,37,115,10,0,81,0,101,99,103,101,110,32,99,111,110,118,101,114,116,101,100,32,81,32,116,111,32,97,32,99,111,109,112,108,105,97,110,116,32,112,111,105,110,116,10,0,101,99,103,101,110,32,100,105,100,110,39,116,32,110,101,101,100,32,116,111,32,99,111,110,118,101,114,116,32,81,32,116,111,32,97,32,99,111,109,112,108,105,97,110,116,32,112,111,105,110,116,10,0,84,101,115,116,105,110,103,32,107,101,121,46,10,0,69,67,68,83,65,32,111,112,101,114,97,116,105,111,110,58,32,115,105,103,110,32,102,97,105,108,101,100,10,0,69,67,68,83,65,32,111,112,101,114,97,116,105,111,110,58,32,115,105,103,110,44,32,118,101,114,105,102,121,32,102,97,105,108,101,100,10,0,69,67,68,83,65,32,111,112,101,114,97,116,105,111,110,58,32,115,105,103,110,44,32,118,101,114,105,102,121,32,111,107,46,10,0,101,99,100,104,58,32,70,97,105,108,101,100,32,116,111,32,103,101,116,32,97,102,102,105,110,101,32,99,111,111,114,100,105,110,97,116,101,115,32,102,111,114,32,104,107,81,10,0,101,99,100,104,58,32,70,97,105,108,101,100,32,116,111,32,103,101,116,32,97,102,102,105,110,101,32,99,111,111,114,100,105,110,97,116,101,115,32,102,111,114,32,104,100,107,71,10,0,69,67,68,72,32,116,101,115,116,32,102,97,105,108,101,100,46,10,0,71,0,40,99,117,114,118,101,32,37,115,41,0,40,102,108,97,103,115,32,112,97,114,97,109,41,0,40,102,108,97,103,115,32,101,100,100,115,97,41,0,40,102,108,97,103,115,32,112,97,114,97,109,32,101,100,100,115,97,41,0,40,107,101,121,45,100,97,116,97,32,40,112,117,98,108,105,99,45,107,101,121,32,32,40,101,99,99,37,83,37,83,40,112,37,109,41,40,97,37,109,41,40,98,37,109,41,40,103,37,109,41,40,110,37,109,41,40,104,37,109,41,40,113,37,109,41,41,41,32,40,112,114,105,118,97,116,101,45,107,101,121,32,32,40,101,99,99,37,83,37,83,40,112,37,109,41,40,97,37,109,41,40,98,37,109,41,40,103,37,109,41,40,110,37,109,41,40,104,37,109,41,40,113,37,109,41,40,100,37,109,41,41,41,32,41,0,40,107,101,121,45,100,97,116,97,32,40,112,117,98,108,105,99,45,107,101,121,32,32,40,101,99,99,37,83,37,83,40,113,37,109,41,41,41,32,40,112,114,105,118,97,116,101,45,107,101,121,32,32,40,101,99,99,37,83,37,83,40,113,37,109,41,40,100,37,109,41,41,41,32,41,0,101,99,103,101,110,32,114,101,115,117,108,116,32,32,112,0,101,99,103,101,110,32,114,101,115,117,108,116,32,32,97,0,101,99,103,101,110,32,114,101,115,117,108,116,32,32,98,0,101,99,103,101,110,32,114,101,115,117,108,116,32,32,71,0,101,99,103,101,110,32,114,101,115,117,108,116,32,32,110,0,101,99,103,101,110,32,114,101,115,117,108,116,32,32,104,0,101,99,103,101,110,32,114,101,115,117,108,116,32,32,81,0,101,99,103,101,110,32,114,101,115,117,108,116,32,32,100,0,101,99,103,101,110,32,114,101,115,117,108,116,32,32,117,115,105,110,103,32,69,100,50,53,53,49,57,43,69,100,68,83,65,10,0,45,112,63,97,63,98,63,103,63,110,63,104,63,47,113,63,43,100,0,47,113,63,43,100,0,101,99,99,95,116,101,115,116,107,101,121,32,105,110,102,58,32,37,115,47,37,115,10,0,101,99,99,95,116,101,115,116,107,101,121,32,110,97,109,58,32,37,115,10,0,101,99,99,95,116,101,115,116,107,101,121,32,32,32,112,0,101,99,99,95,116,101,115,116,107,101,121,32,32,32,97,0,101,99,99,95,116,101,115,116,107,101,121,32,32,32,98,0,101,99,99,95,116,101,115,116,107,101,121,32,103,0,101,99,99,95,116,101,115,116,107,101,121,32,32,32,110,0,101,99,99,95,116,101,115,116,107,101,121,32,32,32,104,0,101,99,99,95,116,101,115,116,107,101,121,32,32,32,113,0,101,99,99,95,116,101,115,116,107,101,121,32,32,32,100,0,66,97,100,32,99,104,101,99,107,58,32,80,111,105,110,116,32,39,71,39,32,100,111,101,115,32,110,111,116,32,98,101,108,111,110,103,32,116,111,32,99,117,114,118,101,32,39,69,39,33,10,0,66,97,100,32,99,104,101,99,107,58,32,39,71,39,32,99,97,110,110,111,116,32,98,101,32,80,111,105,110,116,32,97,116,32,73,110,102,105,110,105,116,121,33,10,0,99,104,101,99,107,95,115,101,99,114,101,116,95,107,101,121,58,32,69,32,105,115,32,110,111,116,32,97,32,99,117,114,118,101,32,111,102,32,111,114,100,101,114,32,110,10,0,66,97,100,32,99,104,101,99,107,58,32,81,32,99,97,110,32,110,111,116,32,98,101,32,97,32,80,111,105,110,116,32,97,116,32,73,110,102,105,110,105,116,121,33,10,0,66,97,100,32,99,104,101,99,107,58,32,99,111,109,112,117,116,97,116,105,111,110,32,111,102,32,100,71,32,102,97,105,108,101,100,10,0,66,97,100,32,99,104,101,99,107,58,32,84,104,101,114,101,32,105,115,32,78,79,32,99,111,114,114,101,115,112,111,110,100,101,110,99,101,32,98,101,116,119,101,101,110,32,39,100,39,32,97,110,100,32,39,81,39,33,10,0,101,99,99,95,116,101,115,116,107,101,121,32,32,32,61,62,32,37,115,10,0,112,0,101,99,99,95,101,110,99,114,121,112,116,32,100,97,116,97,0,45,112,63,97,63,98,63,103,63,110,63,104,63,43,113,0,101,99,99,95,101,110,99,114,121,112,116,32,105,110,102,111,58,32,37,115,47,37,115,10,0,101,99,99,95,101,110,99,114,121,112,116,32,110,97,109,101,58,32,37,115,10,0,101,99,99,95,101,110,99,114,121,112,116,32,32,32,32,112,0,101,99,99,95,101,110,99,114,121,112,116,32,32,32,32,97,0,101,99,99,95,101,110,99,114,121,112,116,32,32,32,32,98,0,101,99,99,95,101,110,99,114,121,112,116,32,32,103,0,101,99,99,95,101,110,99,114,121,112,116,32,32,32,32,110,0,101,99,99,95,101,110,99,114,121,112,116,32,32,32,32,104,0,101,99,99,95,101,110,99,114,121,112,116,32,32,32,32,113,0,101,99,100,104,58,32,70,97,105,108,101,100,32,116,111,32,103,101,116,32,97,102,102,105,110,101,32,99,111,111,114,100,105,110,97,116,101,115,32,102,111,114,32,107,100,71,10,0,101,99,100,104,58,32,70,97,105,108,101,100,32,116,111,32,103,101,116,32,97,102,102,105,110,101,32,99,111,111,114,100,105,110,97,116,101,115,32,102,111,114,32,107,71,10,0,40,101,110,99,45,118,97,108,40,101,99,100,104,40,115,37,109,41,40,101,37,109,41,41,41,0,101,99,99,95,101,110,99,114,121,112,116,32,32,32,32,61,62,32,37,115,10,0,101,0,101,99,99,95,100,101,99,114,121,112,116,32,32,100,95,101,0,45,112,63,97,63,98,63,103,63,110,63,104,63,43,100,0,101,99,99,95,100,101,99,114,121,112,116,32,105,110,102,111,58,32,37,115,47,37,115,10,0,101,99,99,95,100,101,99,114,121,112,116,32,110,97,109,101,58,32,37,115,10,0,101,99,99,95,100,101,99,114,121,112,116,32,32,32,32,112,0,101,99,99,95,100,101,99,114,121,112,116,32,32,32,32,97,0,101,99,99,95,100,101,99,114,121,112,116,32,32,32,32,98,0,101,99,99,95,100,101,99,114,121,112,116,32,32,103,0,101,99,99,95,100,101,99,114,121,112,116,32,32,32,32,110,0,101,99,99,95,100,101,99,114,121,112,116,32,32,32,32,104,0,101,99,99,95,100,101,99,114,121,112,116,32,32,32,32,100,0,101,99,100,104,58,32,70,97,105,108,101,100,32,116,111,32,103,101,116,32,97,102,102,105,110,101,32,99,111,111,114,100,105,110,97,116,101,115,10,0,101,99,99,95,100,101,99,114,121,112,116,32,32,114,101,115,0,40,118,97,108,117,101,32,37,109,41,0,101,99,99,95,100,101,99,114,121,112,116,32,32,32,32,61,62,32,37,115,10,0,101,99,99,95,115,105,103,110,32,32,32,100,97,116,97,0,43,69,100,68,83,65,0,101,99,99,95,115,105,103,110,32,32,32,105,110,102,111,58,32,37,115,47,37,115,37,115,10,0,101,99,99,95,115,105,103,110,32,32,32,110,97,109,101,58,32,37,115,10,0,101,99,99,95,115,105,103,110,32,32,32,32,32,32,112,0,101,99,99,95,115,105,103,110,32,32,32,32,32,32,97,0,101,99,99,95,115,105,103,110,32,32,32,32,32,32,98,0,101,99,99,95,115,105,103,110,32,32,32,32,103,0,101,99,99,95,115,105,103,110,32,32,32,32,32,32,110,0,101,99,99,95,115,105,103,110,32,32,32,32,32,32,104,0,101,99,99,95,115,105,103,110,32,32,32,32,32,32,113,0,101,99,99,95,115,105,103,110,32,32,32,32,32,32,100,0,40,115,105,103,45,118,97,108,40,101,100,100,115,97,40,114,37,77,41,40,115,37,77,41,41,41,0,40,115,105,103,45,118,97,108,40,103,111,115,116,40,114,37,77,41,40,115,37,77,41,41,41,0,40,115,105,103,45,118,97,108,40,101,99,100,115,97,40,114,37,77,41,40,115,37,77,41,41,41,0,101,99,99,95,115,105,103,110,32,32,32,32,32,32,61,62,32,37,115,10,0,101,99,99,95,118,101,114,105,102,121,32,100,97,116,97,0,47,114,115,0,101,99,99,95,118,101,114,105,102,121,32,32,115,95,114,0,101,99,99,95,118,101,114,105,102,121,32,32,115,95,115,0,45,112,63,97,63,98,63,103,63,110,63,104,63,47,113,0,47,113,0,101,99,99,95,118,101,114,105,102,121,32,105,110,102,111,58,32,37,115,47,37,115,37,115,10,0,101,99,99,95,118,101,114,105,102,121,32,110,97,109,101,58,32,37,115,10,0,101,99,99,95,118,101,114,105,102,121,32,32,32,32,112,0,101,99,99,95,118,101,114,105,102,121,32,32,32,32,97,0,101,99,99,95,118,101,114,105,102,121,32,32,32,32,98,0,101,99,99,95,118,101,114,105,102,121,32,32,103,0,101,99,99,95,118,101,114,105,102,121,32,32,32,32,110,0,101,99,99,95,118,101,114,105,102,121,32,32,32,32,104,0,101,99,99,95,118,101,114,105,102,121,32,32,32,32,113,0,71,111,111,100,0,101,99,99,95,118,101,114,105,102,121,32,32,32,32,61,62,32,37,115,10,0,108,111,119,45,108,101,118,101,108,0,112,117,98,107,101,121,0,112,63,97,63,98,63,103,63,110,63,104,63,47,113,0,112,63,97,63,98,63,103,63,110,63,104,63,113,0,113,0,112,97,98,103,110,104,113,40,49,58,37,99,37,117,58,0,41,0,100,105,103,101,115,116,32,115,105,122,101,32,100,111,101,115,32,110,111,116,32,109,97,116,99,104,32,101,120,112,101,99,116,101,100,32,115,105,122,101,0,103,99,114,121,95,109,100,95,111,112,101,110,32,102,97,105,108,101,100,0,105,110,118,97,108,105,100,32,68,65,84,65,77,79,68,69,0,100,105,103,101,115,116,32,109,105,115,109,97,116,99,104,0,104,97,115,104,45,99,111,109,109,111,110,46,99,0,95,103,99,114,121,95,109,100,95,98,108,111,99,107,95,119,114,105,116,101,0,142,153,59,159,72,104,18,115,194,150,80,186,50,252,118,206,72,51,46,167,22,77,150,164,71,111,184,197,49,161,24,106,192,223,193,124,152,220,232,123,77,167,240,17,236,72,201,114,113,210,194,15,155,146,143,226,39,13,111,184,99,213,23,56,180,142,238,227,20,167,204,138,185,50,22,69,72,229,38,174,144,34,67,104,81,122,207,234,189,107,179,115,43,192,233,218,153,131,43,97,202,1,182,222,86,36,74,158,136,213,249,179,121,115,246,34,164,61,20,166,89,155,31,101,76,180,90,116,227,85,165,238,166,167,37,28,30,114,145,109,17,194,203,33,77,60,37,37,57,18,29,142,35,78,101,45,101,31,164,200,207,248,128,243,255,199,112,63,148,0,229,42,125,251,75,61,51,5,217,80,111,108,121,49,51,48,53,32,116,101,115,116,32,49,32,102,97,105,108,101,100,46,0,80,111,108,121,49,51,48,53,32,116,101,115,116,32,50,32,102,97,105,108,101,100,46,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,80,111,108,121,49,51,48,53,32,116,101,115,116,32,51,32,102,97,105,108,101,100,46,0,1,2,3,4,5,6,7,255,254,253,252,251,250,249,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,0,0,0,100,175,226,232,214,173,123,189,210,135,249,124,68,98,61,57,80,111,108,121,49,51,48,53,32,116,101,115,116,32,52,32,102,97,105,108,101,100,46,0,80,111,108,121,49,51,48,53,32,115,101,108,102,116,101,115,116,32,102,97,105,108,101,100,32,40,37,115,41,10,0,102,97,105,108,101,100,32,116,111,32,97,99,113,117,105,114,101,32,116,104,101,32,112,111,111,108,32,108,111,99,107,58,32,37,115,10,0,110,111,32,101,110,116,114,111,112,121,32,103,97,116,104,101,114,105,110,103,32,109,111,100,117,108,101,32,100,101,116,101,99,116,101,100,10,0,87,65,82,78,73,78,71,58,32,117,115,105,110,103,32,105,110,115,101,99,117,114,101,32,114,97,110,100,111,109,32,110,117,109,98,101,114,32,103,101,110,101,114,97,116,111,114,33,33,10,0,112,111,111,108,95,105,115,95,108,111,99,107,101,100,0,114,97,110,100,111,109,45,99,115,112,114,110,103,46,99,0,97,100,100,95,114,97,110,100,111,109,110,101,115,115,0,109,105,120,95,112,111,111,108,0,102,97,105,108,101,100,32,116,111,32,114,101,108,101,97,115,101,32,116,104,101,32,112,111,111,108,32,108,111,99,107,58,32,37,115,10,0,32,40,104,119,114,110,103,32,102,97,105,108,101,100,41,0,114,97,110,100,111,109,32,117,115,97,103,101,58,32,112,111,111,108,115,105,122,101,61,37,100,32,109,105,120,101,100,61,37,108,117,32,112,111,108,108,115,61,37,108,117,47,37,108,117,32,97,100,100,101,100,61,37,108,117,47,37,108,117,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,111,117,116,109,105,120,61,37,108,117,32,103,101,116,108,118,108,49,61,37,108,117,47,37,108,117,32,103,101,116,108,118,108,50,61,37,108,117,47,37,108,117,37,115,10,0,114,101,97,100,95,112,111,111,108,0,116,111,111,32,109,97,110,121,32,114,97,110,100,111,109,32,98,105,116,115,32,114,101,113,117,101,115,116,101,100,10,0,114,101,97,100,95,115,101,101,100,95,102,105,108,101,0,99,97,110,39,116,32,111,112,101,110,32,96,37,115,39,58,32,37,115,10,0,99,97,110,39,116,32,108,111,99,107,32,96,37,115,39,58,32,37,115,10,0,119,97,105,116,105,110,103,32,102,111,114,32,108,111,99,107,32,111,110,32,96,37,115,39,46,46,46,10,0,99,97,110,39,116,32,115,116,97,116,32,96,37,115,39,58,32,37,115,10,0,96,37,115,39,32,105,115,32,110,111,116,32,97,32,114,101,103,117,108,97,114,32,102,105,108,101,32,45,32,105,103,110,111,114,101,100,10,0,110,111,116,101,58,32,114,97,110,100,111,109,95,115,101,101,100,32,102,105,108,101,32,105,115,32,101,109,112,116,121,10,0,119,97,114,110,105,110,103,58,32,105,110,118,97,108,105,100,32,115,105,122,101,32,111,102,32,114,97,110,100,111,109,95,115,101,101,100,32,102,105,108,101,32,45,32,110,111,116,32,117,115,101,100,10,0,99,97,110,39,116,32,114,101,97,100,32,96,37,115,39,58,32,37,115,10,0,83,108,111,119,32,101,110,116,114,111,112,121,32,103,97,116,104,101,114,105,110,103,32,109,111,100,117,108,101,32,110,111,116,32,121,101,116,32,105,110,105,116,105,97,108,105,122,101,100,10,0,78,111,32,119,97,121,32,116,111,32,103,97,116,104,101,114,32,101,110,116,114,111,112,121,32,102,111,114,32,116,104,101,32,82,78,71,10,0,100,111,95,102,97,115,116,95,114,97,110,100,111,109,95,112,111,108,108,0,95,103,99,114,121,95,114,110,103,99,115,112,114,110,103,95,115,101,116,95,115,101,101,100,95,102,105,108,101,0,110,111,116,101,58,32,114,97,110,100,111,109,95,115,101,101,100,32,102,105,108,101,32,110,111,116,32,117,112,100,97,116,101,100,10,0,99,97,110,39,116,32,99,114,101,97,116,101,32,96,37,115,39,58,32,37,115,10,0,99,97,110,39,116,32,119,114,105,116,101,32,96,37,115,39,58,32,37,115,10,0,99,97,110,39,116,32,99,108,111,115,101,32,96,37,115,39,58,32,37,115,10,0,102,97,105,108,101,100,32,116,111,32,97,99,113,117,105,114,101,32,116,104,101,32,82,78,71,32,108,111,99,107,58,32,37,115,10,0,33,110,111,110,99,101,95,99,111,110,116,101,120,116,45,62,116,101,115,116,95],"i8",ALLOC_NONE,Runtime.GLOBAL_BASE+40960);allocate([100,116,95,112,116,114,0,114,97,110,100,111,109,45,102,105,112,115,46,99,0,95,103,99,114,121,95,114,110,103,102,105,112,115,95,105,110,105,116,105,97,108,105,122,101,0,33,115,116,100,95,114,110,103,95,99,111,110,116,101,120,116,45,62,116,101,115,116,95,100,116,95,112,116,114,0,33,115,116,114,111,110,103,95,114,110,103,95,99,111,110,116,101,120,116,45,62,116,101,115,116,95,100,116,95,112,116,114,0,109,101,109,111,114,121,32,99,111,114,114,117,112,116,105,111,110,32,100,101,116,101,99,116,101,100,32,105,110,32,82,78,71,32,99,111,110,116,101,120,116,32,37,112,10,0,102,97,105,108,101,100,32,116,111,32,114,101,108,101,97,115,101,32,116,104,101,32,82,78,71,32,108,111,99,107,58,32,37,115,10,0,114,110,103,95,99,116,120,0,102,105,112,115,95,114,110,103,95,105,115,95,108,111,99,107,101,100,0,120,57,51,49,95,103,101,110,101,114,97,116,101,95,107,101,121,0,101,114,114,111,114,32,99,114,101,97,116,105,110,103,32,99,105,112,104,101,114,32,99,111,110,116,101,120,116,32,102,111,114,32,82,78,71,58,32,37,115,10,0,33,101,110,116,114,111,112,121,95,99,111,108,108,101,99,116,95,98,117,102,102,101,114,0,103,101,116,95,101,110,116,114,111,112,121,0,101,110,116,114,111,112,121,95,99,111,108,108,101,99,116,95,99,98,0,101,110,116,114,111,112,121,95,99,111,108,108,101,99,116,95,98,117,102,102,101,114,0,101,114,114,111,114,32,103,101,116,116,105,110,103,32,101,110,116,114,111,112,121,32,100,97,116,97,10,0,101,114,114,111,114,32,99,114,101,97,116,105,110,103,32,107,101,121,32,102,111,114,32,82,78,71,58,32,37,115,10,0,120,57,51,49,95,114,101,115,101,101,100,0,120,57,51,49,95,103,101,110,101,114,97,116,101,95,115,101,101,100,0,108,101,110,103,116,104,32,61,61,32,49,54,0,102,111,114,107,32,119,105,116,104,111,117,116,32,112,114,111,112,101,114,32,114,101,45,105,110,105,116,105,97,108,105,122,97,116,105,111,110,32,100,101,116,101,99,116,101,100,32,105,110,32,82,78,71,0,120,57,51,49,95,97,101,115,95,100,114,105,118,101,114,0,114,110,103,95,99,116,120,45,62,99,105,112,104,101,114,95,104,100,0,114,110,103,95,99,116,120,45,62,105,115,95,115,101,101,100,101,100,0,116,101,109,112,118,97,108,117,101,95,102,111,114,95,120,57,51,49,95,97,101,115,95,100,114,105,118,101,114,0,120,57,51,49,95,103,101,116,95,100,116,0,103,101,116,116,105,109,101,111,102,100,97,121,40,41,32,102,97,105,108,101,100,58,32,37,115,10,0,101,110,99,114,121,112,116,95,97,101,115,0,65,69,83,32,101,110,99,114,121,112,116,105,111,110,32,105,110,32,82,78,71,32,102,97,105,108,101,100,58,32,37,115,10,0,100,117,112,108,105,99,97,116,101,32,49,50,56,32,98,105,116,32,98,108,111,99,107,32,114,101,116,117,114,110,101,100,32,98,121,32,82,78,71,0,115,101,118,101,114,101,32,101,114,114,111,114,32,103,101,116,116,105,110,103,32,114,97,110,100,111,109,10,0,115,101,108,102,116,101,115,116,95,107,97,116,0,101,114,114,111,114,32,99,114,101,97,116,105,110,103,32,99,105,112,104,101,114,32,99,111,110,116,101,120,116,32,102,111,114,32,82,78,71,0,185,202,127,214,160,245,211,66,25,109,132,145,118,28,59,190,72,178,130,152,104,194,128,0,0,0,40,24,0,0,37,0,82,23,141,41,162,213,132,18,157,137,154,69,130,2,247,119,66,156,8,61,130,244,138,64,102,181,73,39,171,66,199,195,14,183,97,60,254,176,190,115,247,110,109,111,29,163,20,250,187,75,193,14,197,251,205,70,190,40,97,231,3,43,55,125,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,247,149,189,74,82,226,158,215,19,211,19,250,32,233,141,188,200,209,229,17,89,82,247,250,55,56,180,197,206,178,176,154,13,156,197,13,22,225,188,237,207,96,98,9,157,32,131,126,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,128,0,129,1,130,2,131,3,160,32,161,33,162,34,163,35,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,150,237,204,195,221,4,127,117,99,25,55,111,21,34,87,86,122,20,118,119,149,23,126,200,146,232,221,21,203,31,188,177,37,62,46,162,65,27,221,245,33,72,65,113,179,141,47,76,101,114,114,111,114,32,115,101,116,116,105,110,103,32,107,101,121,32,102,111,114,32,82,78,71,0,88,57,46,51,49,32,82,78,71,32,99,111,114,101,32,102,117,110,99,116,105,111,110,32,102,97,105,108,101,100,0,82,78,71,32,111,117,116,112,117,116,32,100,111,101,115,32,110,111,116,32,109,97,116,99,104,32,107,110,111,119,110,32,118,97,108,117,101,0,102,111,114,107,32,100,101,116,101,99,116,105,111,110,32,102,97,105,108,101,100,0,114,97,110,100,111,109,0,75,65,84,0,102,97,105,108,101,100,32,116,111,32,97,99,113,117,105,114,101,32,116,104,101,32,83,121,115,116,101,109,32,82,78,71,32,108,111,99,107,58,32,37,115,10,0,102,97,105,108,101,100,32,116,111,32,114,101,108,101,97,115,101,32,116,104,101,32,83,121,115,116,101,109,32,82,78,71,32,108,111,99,107,58,32,37,115,10,0,98,117,102,102,101,114,0,114,97,110,100,111,109,45,115,121,115,116,101,109,46,99,0,103,101,116,95,114,97,110,100,111,109,0,115,121,115,116,101,109,95,114,110,103,95,105,115,95,108,111,99,107,101,100,0,114,101,97,100,95,99,98,0,114,101,97,100,95,99,98,95,98,117,102,102,101,114,0,101,114,114,111,114,32,114,101,97,100,105,110,103,32,114,97,110,100,111,109,32,102,114,111,109,32,115,121,115,116,101,109,32,82,78,71,32,40,114,99,61,37,100,41,10,0,47,100,101,118,47,114,97,110,100,111,109,0,111,112,101,110,95,100,101,118,95,114,97,110,100,111,109,0,119,97,105,116,95,100,101,118,95,114,97,110,100,111,109,0,99,97,110,39,116,32,111,112,101,110,32,37,115,58,32,37,115,10,0,101,114,114,111,114,32,115,101,116,116,105,110,103,32,70,68,95,67,76,79,69,88,69,67,32,111,110,32,102,100,32,37,100,58,32,37,115,10,0,47,100,101,118,47,117,114,97,110,100,111,109,0,110,101,101,100,95,101,110,116,114,111,112,121,0,115,101,108,101,99,116,40,41,32,101,114,114,111,114,58,32,37,115,10,0,98,111,103,117,115,32,114,101,97,100,32,102,114,111,109,32,114,97,110,100,111,109,32,100,101,118,105,99,101,32,40,110,61,37,100,41,10,0,114,101,97,100,32,101,114,114,111,114,32,111,110,32,114,97,110,100,111,109,32,100,101,118,105,99,101,58,32,37,115,10,0,99,104,111,111,115,105,110,103,32,97,32,114,97,110,100,111,109,32,107,32,111,102,32,37,117,32,98,105,116,115,32,97,116,32,115,101,99,108,101,118,101,108,32,37,100,10,0,9,107,32,116,111,111,32,108,97,114,103,101,32,45,32,97,103,97,105,110,10,0,9,107,32,105,115,32,122,101,114,111,32,45,32,97,103,97,105,110,10,0,1,0,101,99,100,115,97,32,115,105,103,110,32,104,97,115,104,32,32,0,101,99,100,115,97,32,115,105,103,110,32,114,101,115,117,108,116,32,114,32,0,101,99,100,115,97,32,115,105,103,110,32,114,101,115,117,108,116,32,115,32,0,103,111,115,116,32,115,105,103,110,32,104,97,115,104,32,32,0,101,99,99,32,115,105,103,110,58,32,70,97,105,108,101,100,32,116,111,32,103,101,116,32,97,102,102,105,110,101,32,99,111,111,114,100,105,110,97,116,101,115,10,0,103,111,115,116,32,115,105,103,110,32,114,101,115,117,108,116,32,114,32,0,103,111,115,116,32,115,105,103,110,32,114,101,115,117,108,116,32,115,32,0,101,99,99,32,118,101,114,105,102,121,58,32,82,101,106,101,99,116,101,100,10,0,101,99,99,32,118,101,114,105,102,121,58,32,70,97,105,108,101,100,32,116,111,32,103,101,116,32,97,102,102,105,110,101,32,99,111,111,114,100,105,110,97,116,101,115,10,0,32,32,32,32,32,120,0,32,32,32,32,32,114,0,32,32,32,32,32,115,0,101,99,99,32,118,101,114,105,102,121,58,32,78,111,116,32,118,101,114,105,102,105,101,100,10,0,101,99,99,32,118,101,114,105,102,121,58,32,65,99,99,101,112,116,101,100,10,0,33,34,108,111,99,107,32,65,66,73,32,118,101,114,115,105,111,110,34,0,112,111,115,105,120,45,108,111,99,107,46,99,0,103,101,116,95,108,111,99,107,95,111,98,106,101,99,116,0,115,116,114,101,97,109,45,62,102,108,97,103,115,46,119,114,105,116,105,110,103,0,101,115,116,114,101,97,109,46,99,0,101,115,95,102,108,117,115,104,0,33,115,116,114,101,97,109,45,62,102,108,97,103,115,46,119,114,105,116,105,110,103,0,101,115,95,101,109,112,116,121,0,83,117,99,99,101,115,115,0,71,101,110,101,114,97,108,32,101,114,114,111,114,0,85,110,107,110,111,119,110,32,112,97,99,107,101,116,0,85,110,107,110,111,119,110,32,118,101,114,115,105,111,110,32,105,110,32,112,97,99,107,101,116,0,73,110,118,97,108,105,100,32,112,117,98,108,105,99,32,107,101,121,32,97,108,103,111,114,105,116,104,109,0,73,110,118,97,108,105,100,32,100,105,103,101,115,116,32,97,108,103,111,114,105,116,104,109,0,66,97,100,32,112,117,98,108,105,99,32,107,101,121,0,66,97,100,32,115,101,99,114,101,116,32,107,101,121,0,66,97,100,32,115,105,103,110,97,116,117,114,101,0,78,111,32,112,117,98,108,105,99,32,107,101,121,0,67,104,101,99,107,115,117,109,32,101,114,114,111,114,0,66,97,100,32,112,97,115,115,112,104,114,97,115,101,0,73,110,118,97,108,105,100,32,99,105,112,104,101,114,32,97,108,103,111,114,105,116,104,109,0,75,101,121,114,105,110,103,32,111,112,101,110,0,73,110,118,97,108,105,100,32,112,97,99,107,101,116,0,73,110,118,97,108,105,100,32,97,114,109,111,114,0,78,111,32,117,115,101,114,32,73,68,0,78,111,32,115,101,99,114,101,116,32,107,101,121,0,87,114,111,110,103,32,115,101,99,114,101,116,32,107,101,121,32,117,115,101,100,0,66,97,100,32,115,101,115,115,105,111,110,32,107,101,121,0,85,110,107,110,111,119,110,32,99,111,109,112,114,101,115,115,105,111,110,32,97,108,103,111,114,105,116,104,109,0,78,117,109,98,101,114,32,105,115,32,110,111,116,32,112,114,105,109,101,0,73,110,118,97,108,105,100,32,101,110,99,111,100,105,110,103,32,109,101,116,104,111,100,0,73,110,118,97,108,105,100,32,101,110,99,114,121,112,116,105,111,110,32,115,99,104,101,109,101,0,73,110,118,97,108,105,100,32,115,105,103,110,97,116,117,114,101,32,115,99,104,101,109,101,0,73,110,118,97,108,105,100,32,97,116,116,114,105,98,117,116,101,0,78,111,32,118,97,108,117,101,0,78,111,116,32,102,111,117,110,100,0,86,97,108,117,101,32,110,111,116,32,102,111,117,110,100,0,83,121,110,116,97,120,32,101,114,114,111,114,0,66,97,100,32,77,80,73,32,118,97,108,117,101,0,73,110,118,97,108,105,100,32,112,97,115,115,112,104,114,97,115,101,0,73,110,118,97,108,105,100,32,115,105,103,110,97,116,117,114,101,32,99,108,97,115,115,0,82,101,115,111,117,114,99,101,115,32,101,120,104,97,117,115,116,101,100,0,73,110,118,97,108,105,100,32,107,101,121,114,105,110,103,0,84,114,117,115,116,32,68,66,32,101,114,114,111,114,0,66,97,100,32,99,101,114,116,105,102,105,99,97,116,101,0,73,110,118,97,108,105,100,32,117,115,101,114,32,73,68,0,85,110,101,120,112,101,99,116,101,100,32,101,114,114,111,114,0,84,105,109,101,32,99,111,110,102,108,105,99,116,0,75,101,121,115,101,114,118,101,114,32,101,114,114,111,114,0,87,114,111,110,103,32,112,117,98,108,105,99,32,107,101,121,32,97,108,103,111,114,105,116,104,109,0,84,114,105,98,117,116,101,32,116,111,32,68,46,32,65,46,0,87,101,97,107,32,101,110,99,114,121,112,116,105,111,110,32,107,101,121,0,73,110,118,97,108,105,100,32,107,101,121,32,108,101,110,103,116,104,0,73,110,118,97,108,105,100,32,97,114,103,117,109,101,110,116,0,83,121,110,116,97,120,32,101,114,114,111,114,32,105,110,32,85,82,73,0,73,110,118,97,108,105,100,32,85,82,73,0,78,101,116,119,111,114,107,32,101,114,114,111,114,0,85,110,107,110,111,119,110,32,104,111,115,116,0,83,101,108,102,116,101,115,116,32,102,97,105,108,101,100,0,68,97,116,97,32,110,111,116,32,101,110,99,114,121,112,116,101,100,0,68,97,116,97,32,110,111,116,32,112,114,111,99,101,115,115,101,100,0,85,110,117,115,97,98,108,101,32,112,117,98,108,105,99,32,107,101,121,0,85,110,117,115,97,98,108,101,32,115,101,99,114,101,116,32,107,101,121,0,73,110,118,97,108,105,100,32,118,97,108,117,101,0,66,97,100,32,99,101,114,116,105,102,105,99,97,116,101,32,99,104,97,105,110,0,77,105,115,115,105,110,103,32,99,101,114,116,105,102,105,99,97,116,101,0,78,111,32,100,97,116,97,0,66,117,103,0,78,111,116,32,115,117,112,112,111,114,116,101,100,0,73,110,118,97,108,105,100,32,111,112,101,114,97,116,105,111,110,32,99,111,100,101,0,84,105,109,101,111,117,116,0,73,110,116,101,114,110,97,108,32,101,114,114,111,114,0,69,79,70,32,40,103,99,114,121,112,116,41,0,73,110,118,97,108,105,100,32,111,98,106,101,99,116,0,80,114,111,118,105,100,101,100,32,111,98,106,101,99,116,32,105,115,32,116,111,111,32,115,104,111,114,116,0,80,114,111,118,105,100,101,100,32,111,98,106,101,99,116,32,105,115,32,116,111,111,32,108,97,114,103,101,0,77,105,115,115,105,110,103,32,105,116,101,109,32,105,110,32,111,98,106,101,99,116,0,78,111,116,32,105,109,112,108,101,109,101,110,116,101,100,0,67,111,110,102,108,105,99,116,105,110,103,32,117,115,101,0,73,110,118,97,108,105,100,32,99,105,112,104,101,114,32,109,111,100,101,0,73,110,118,97,108,105,100,32,102,108,97,103,0,73,110,118,97,108,105,100,32,104,97,110,100,108,101,0,82,101,115,117,108,116,32,116,114,117,110,99,97,116,101,100,0,73,110,99,111,109,112,108,101,116,101,32,108,105,110,101,0,73,110,118,97,108,105,100,32,114,101,115,112,111,110,115,101,0,78,111,32,97,103,101,110,116,32,114,117,110,110,105,110,103,0,65,103,101,110,116,32,101,114,114,111,114,0,73,110,118,97,108,105,100,32,100,97,116,97,0,85,110,115,112,101,99,105,102,105,99,32,65,115,115,117,97,110,32,115,101,114,118,101,114,32,102,97,117,108,116,0,71,101,110,101,114,97,108,32,65,115,115,117,97,110,32,101,114,114,111,114,0,73,110,118,97,108,105,100,32,115,101,115,115,105,111,110,32,107,101,121,0,73,110,118,97,108,105,100,32,83,45,101,120,112,114,101,115,115,105,111,110,0,85,110,115,117,112,112,111,114,116,101,100,32,97,108,103,111,114,105,116,104,109,0,78,111,32,112,105,110,101,110,116,114,121,0,112,105,110,101,110,116,114,121,32,101,114,114,111,114,0,66,97,100,32,80,73,78,0,73,110,118,97,108,105,100,32,110,97,109,101,0,66,97,100,32,100,97,116,97,0,73,110,118,97,108,105,100,32,112,97,114,97,109,101,116,101,114,0,87,114,111,110,103,32,99,97,114,100,0,78,111,32,100,105,114,109,110,103,114,0,100,105,114,109,110,103,114,32,101,114,114,111,114,0,67,101,114,116,105,102,105,99,97,116,101,32,114,101,118,111,107,101,100,0,78,111,32,67,82,76,32,107,110,111,119,110,0,67,82,76,32,116,111,111,32,111,108,100,0,76,105,110,101,32,116,111,111,32,108,111,110,103,0,78,111,116,32,116,114,117,115,116,101,100,0,79,112,101,114,97,116,105,111,110,32,99,97,110,99,101,108,108,101,100,0,66,97,100,32,67,65,32,99,101,114,116,105,102,105,99,97,116,101,0,67,101,114,116,105,102,105,99,97,116,101,32,101,120,112,105,114,101,100,0,67,101,114,116,105,102,105,99,97,116,101,32,116,111,111,32,121,111,117,110,103,0,85,110,115,117,112,112,111,114,116,101,100,32,99,101,114,116,105,102,105,99,97,116,101,0,85,110,107,110,111,119,110,32,83,45,101,120,112,114,101,115,115,105,111,110,0,85,110,115,117,112,112,111,114,116,101,100,32,112,114,111,116,101,99,116,105,111,110,0,67,111,114,114,117,112,116,101,100,32,112,114,111,116,101,99,116,105,111,110,0,65,109,98,105,103,117,111,117,115,32,110,97,109,101,0,67,97,114,100,32,101,114,114,111,114,0,67,97,114,100,32,114,101,115,101,116,32,114,101,113,117,105,114,101,100,0,67,97,114,100,32,114,101,109,111,118,101,100,0,73,110,118,97,108,105,100,32,99,97,114,100,0,67,97,114,100,32,110,111,116,32,112,114,101,115,101,110,116,0,78,111,32,80,75,67,83,49,53,32,97,112,112,108,105,99,97,116,105,111,110,0,78,111,116,32,99,111,110,102,105,114,109,101,100,0,67,111,110,102,105,103,117,114,97,116,105,111,110,32,101,114,114,111,114,0,78,111,32,112,111,108,105,99,121,32,109,97,116,99,104,0,73,110,118,97,108,105,100,32,105,110,100,101,120,0,73,110,118,97,108,105,100,32,73,68,0,78,111,32,83,109,97,114,116,67,97,114,100,32,100,97,101,109,111,110,0,83,109,97,114,116,67,97,114,100,32,100,97,101,109,111,110,32,101,114,114,111,114,0,85,110,115,117,112,112,111,114,116,101,100,32,112,114,111,116,111,99,111,108,0,66,97,100,32,80,73,78,32,109,101,116,104,111,100,0,67,97,114,100,32,110,111,116,32,105,110,105,116,105,97,108,105,122,101,100,0,85,110,115,117,112,112,111,114,116,101,100,32,111,112,101,114,97,116,105,111,110,0,87,114,111,110,103,32,107,101,121,32,117,115,97,103,101,0,78,111,116,104,105,110,103,32,102,111,117,110,100,0,87,114,111,110,103,32,98,108,111,98,32,116,121,112,101,0,77,105,115,115,105,110,103,32,118,97,108,117,101,0,72,97,114,100,119,97,114,101,32,112,114,111,98,108,101,109,0,80,73,78,32,98,108,111,99,107,101,100,0,67,111,110,100,105,116,105,111,110,115,32,111,102,32,117,115,101,32,110,111,116,32,115,97,116,105,115,102,105,101,100,0,80,73,78,115,32,97,114,101,32,110,111,116,32,115,121,110,99,101,100,0,73,110,118,97,108,105,100,32,67,82,76,0,66,69,82,32,101,114,114,111,114,0,73,110,118,97,108,105,100,32,66,69,82,0,69,108,101,109,101,110,116,32,110,111,116,32,102,111,117,110,100,0,73,100,101,110,116,105,102,105,101,114,32,110,111,116,32,102,111,117,110,100,0,73,110,118,97,108,105,100,32,116,97,103,0,73,110,118,97,108,105,100,32,108,101,110,103,116,104,0,73,110,118,97,108,105,100,32,107,101,121,32,105,110,102,111,0,85,110,101,120,112,101,99,116,101,100,32,116,97,103,0,78,111,116,32,68,69,82,32,101,110,99,111,100,101,100,0,78,111,32,67,77,83,32,111,98,106,101,99,116,0,73,110,118,97,108,105,100,32,67,77,83,32,111,98,106,101,99,116,0,85,110,107,110,111,119,110,32,67,77,83,32,111,98,106,101,99,116,0,85,110,115,117,112,112,111,114,116,101,100,32,67,77,83,32,111,98,106,101,99,116,0,85,110,115,117,112,112,111,114,116,101,100,32,101,110,99,111,100,105,110,103,0,85,110,115,117,112,112,111,114,116,101,100,32,67,77,83,32,118,101,114,115,105,111,110,0,85,110,107,110,111,119,110,32,97,108,103,111,114,105,116,104,109,0,73,110,118,97,108,105,100,32,99,114,121,112,116,111,32,101,110,103,105,110,101,0,80,117,98,108,105,99,32,107,101,121,32,110,111,116,32,116,114,117,115,116,101,100,0,68,101,99,114,121,112,116,105,111,110,32,102,97,105,108,101,100,0,75,101,121,32,101,120,112,105,114,101,100,0,83,105,103,110,97,116,117,114,101,32,101,120,112,105,114,101,100,0,69,110,99,111,100,105,110,103,32,112,114,111,98,108,101,109,0,73,110,118,97,108,105,100,32,115,116,97,116,101,0,68,117,112,108,105,99,97,116,101,100,32,118,97,108,117,101,0,77,105,115,115,105,110,103,32,97,99,116,105,111,110,0,65,83,78,46,49,32,109,111,100,117,108,101,32,110,111,116,32,102,111,117,110,100,0,73,110,118,97,108,105,100,32,79,73,68,32,115,116,114,105,110,103,0,73,110,118,97,108,105,100,32,116,105,109,101,0,73,110,118,97,108,105,100,32,67,82,76,32,111,98,106,101,99,116,0,85,110,115,117,112,112,111,114,116,101,100,32,67,82,76,32,118,101,114,115,105,111,110,0,73,110,118,97,108,105,100,32,99,101,114,116,105,102,105,99,97,116,101,32,111,98,106,101,99,116,0,85,110,107,110,111,119,110,32,110,97,109,101,0,65,32,108,111,99,97,108,101,32,102,117,110,99,116,105,111,110,32,102,97,105,108,101,100,0,78,111,116,32,108,111,99,107,101,100,0,80,114,111,116,111,99,111,108,32,118,105,111,108,97,116,105,111,110,0,73,110,118,97,108,105,100,32,77,65,67,0,73,110,118,97,108,105,100,32,114,101,113,117,101,115,116,0,85,110,107,110,111,119,110,32,101,120,116,101,110,115,105,111,110,0,85,110,107,110,111,119,110,32,99,114,105,116,105,99,97,108,32,101,120,116,101,110,115,105,111,110,0,76,111,99,107,101,100,0,85,110,107,110,111,119,110,32,111,112,116,105,111,110,0,85,110,107,110,111,119,110,32,99,111,109,109,97,110,100,0,78,111,116,32,111,112,101,114,97,116,105,111,110,97,108,0,78,111,32,112,97,115,115,112,104,114,97,115,101,32,103,105,118,101,110,0,78,111,32,80,73,78,32,103,105,118,101,110,0,78,111,116,32,101,110,97,98,108,101,100,0,78,111,32,99,114,121,112,116,111,32,101,110,103,105,110,101,0,77,105,115,115,105,110,103,32,107,101,121,0,84,111,111,32,109,97,110,121,32,111,98,106,101,99,116,115,0,76,105,109,105,116,32,114,101,97,99,104,101,100,0,78,111,116,32,105,110,105,116,105,97,108,105,122,101,100,0,77,105,115,115,105,110,103,32,105,115,115,117,101,114,32,99,101,114,116,105,102,105,99,97,116,101,0,78,111,32,107,101,121,115,101,114,118,101,114,32,97,118,97,105,108,97,98,108,101,0,73,110,118,97,108,105,100,32,101,108,108,105,112,116,105,99,32,99,117,114,118,101,0,85,110,107,110,111,119,110,32,101,108,108,105,112,116,105,99,32,99,117,114,118,101,0,68,117,112,108,105,99,97,116,101,100,32,107,101,121,0,65,109,98,105,103,117,111,117,115,32,114,101,115,117,108,116,0,78,111,32,99,114,121,112,116,111,32,99,111,110,116,101,120,116,0,87,114,111,110,103,32,99,114,121,112,116,111,32,99,111,110,116,101,120,116,0,66,97,100,32,99,114,121,112,116,111,32,99,111,110,116,101,120,116,0,67,111,110,102,108,105,99,116,32,105,110,32,116,104,101,32,99,114,121,112,116,111,32,99,111,110,116,101,120,116,0,66,114,111,107,101,110,32,112,117,98,108,105,99,32,107,101,121,0,66,114,111,107,101,110,32,115,101,99,114,101,116,32,107,101,121,0,73,110,118,97,108,105,100,32,77,65,67,32,97,108,103,111,114,105,116,104,109,0,79,112,101,114,97,116,105,111,110,32,102,117,108,108,121,32,99,97,110,99,101,108,108,101,100,0,79,112,101,114,97,116,105,111,110,32,110,111,116,32,121,101,116,32,102,105,110,105,115,104,101,100,0,66,117,102,102,101,114,32,116,111,111,32,115,104,111,114,116,0,73,110,118,97,108,105,100,32,108,101,110,103,116,104,32,115,112,101,99,105,102,105,101,114,32,105,110,32,83,45,101,120,112,114,101,115,115,105,111,110,0,83,116,114,105,110,103,32,116,111,111,32,108,111,110,103,32,105,110,32,83,45,101,120,112,114,101,115,115,105,111,110,0,85,110,109,97,116,99,104,101,100,32,112,97,114,101,110,116,104,101,115,101,115,32,105,110,32,83,45,101,120,112,114,101,115,115,105,111,110,0,83,45,101,120,112,114,101,115,115,105,111,110,32,110,111,116,32,99,97,110,111,110,105,99,97,108,0,66,97,100,32,99,104,97,114,97,99,116,101,114,32,105,110,32,83,45,101,120,112,114,101,115,115,105,111,110,0,66,97,100,32,113,117,111,116,97,116,105,111,110,32,105,110,32,83,45,101,120,112,114,101,115,115,105,111,110,0,90,101,114,111,32,112,114,101,102,105,120,32,105,110,32,83,45,101,120,112,114,101,115,115,105,111,110,0,78,101,115,116,101,100,32,100,105,115,112,108,97,121,32,104,105,110,116,115,32,105,110,32,83,45,101,120,112,114,101,115,115,105,111,110,0,85,110,109,97,116,99,104,101,100,32,100,105,115,112,108,97,121,32,104,105,110,116,115,0,85,110,101,120,112,101,99,116,101,100,32,114,101,115,101,114,118,101,100,32,112,117,110,99,116,117,97,116,105,111,110,32,105,110,32,83,45,101,120,112,114,101,115,115,105,111,110,0,66,97,100,32,104,101,120,97,100,101,99,105,109,97,108,32,99,104,97,114,97,99,116,101,114,32,105,110,32,83,45,101,120,112,114,101,115,115,105,111,110,0,79,100,100,32,104,101,120,97,100,101,99,105,109,97,108,32,110,117,109,98,101,114,115,32,105,110,32,83,45,101,120,112,114,101,115,115,105,111,110,0,66,97,100,32,111,99,116,97,108,32,99,104,97,114,97,99,116,101,114,32,105,110,32,83,45,101,120,112,114,101,115,115,105,111,110,0,76,101,103,97,99,121,32,107,101,121,0,82,101,113,117,101,115,116,32,116,111,111,32,115,104,111,114,116,0,82,101,113,117,101,115,116,32,116,111,111,32,108,111,110,103,0,79,98,106,101,99,116,32,105,115,32,105,110,32,116,101,114,109,105,110,97,116,105,111,110,32,115,116,97,116,101,0,78,111,32,99,101,114,116,105,102,105,99,97,116,101,32,99,104,97,105,110,0,67,101,114,116,105,102,105,99,97,116,101,32,105,115,32,116,111,111,32,108,97,114,103,101,0,73,110,118,97,108,105,100,32,114,101,99,111,114,100,0,84,104,101,32,77,65,67,32,100,111,101,115,32,110,111,116,32,118,101,114,105,102,121,0,85,110,101,120,112,101,99,116,101,100,32,109,101,115,115,97,103,101,0,67,111,109,112,114,101,115,115,105,111,110,32,111,114,32,100,101,99,111,109,112,114,101,115,115,105,111,110,32,102,97,105,108,101,100,0,65,32,99,111,117,110,116,101,114,32,119,111,117,108,100,32,119,114,97,112,0,70,97,116,97,108,32,97,108,101,114,116,32,109,101,115,115,97,103,101,32,114,101,99,101,105,118,101,100,0,78,111,32,99,105,112,104,101,114,32,97,108,103,111,114,105,116,104,109,0,77,105,115,115,105,110,103,32,99,108,105,101,110,116,32,99,101,114,116,105,102,105,99,97,116,101,0,67,108,111,115,101,32,110,111,116,105,102,105,99,97,116,105,111,110,32,114,101,99,101,105,118,101,100,0,84,105,99,107,101,116,32,101,120,112,105,114,101,100,0,66,97,100,32,116,105,99,107,101,116,0,85,110,107,110,111,119,110,32,105,100,101,110,116,105,116,121,0,66,97,100,32,99,101,114,116,105,102,105,99,97,116,101,32,109,101,115,115,97,103,101,32,105,110,32,104,97,110,100,115,104,97,107,101,0,66,97,100,32,99,101,114,116,105,102,105,99,97,116,101,32,114,101,113,117,101,115,116,32,109,101,115,115,97,103,101,32,105,110,32,104,97,110,100,115,104,97,107,101,0,66,97,100,32,99,101,114,116,105,102,105,99,97,116,101,32,118,101,114,105,102,121,32,109,101,115,115,97,103,101,32,105,110,32,104,97,110,100,115,104,97,107,101,0,66,97,100,32,99,104,97,110,103,101,32,99,105,112,104,101,114,32,109,101,115,115,115,97,103,101,32,105,110,32,104,97,110,100,115,104,97,107,101,0,66,97,100,32,99,108,105,101,110,116,32,104,101,108,108,111,32,109,101,115,115,97,103,101,32,105,110,32,104,97,110,100,115,104,97,107,101,0,66,97,100,32,115,101,114,118,101,114,32,104,101,108,108,111,32,109,101,115,115,97,103,101,32,105,110,32,104,97,110,100,115,104,97,107,101,0,66,97,100,32,115,101,114,118,101,114,32,104,101,108,108,111,32,100,111,110,101,32,109,101,115,115,97,103,101,32,105,110,32,104,97,110,115,104,97,107,101,0,66,97,100,32,102,105,110,105,115,104,101,100,32,109,101,115,115,97,103,101,32,105,110,32,104,97,110,100,115,104,97,107,101,0,66,97,100,32,115,101,114,118,101,114,32,107,101,121,32,101,120,99,104,97,110,103,101,32,109,101,115,115,97,103,101,32,105,110,32,104,97,110,100,115,104,97,107,101,0,66,97,100,32,99,108,105,101,110,116,32,107,101,121,32,101,120,99,104,97,110,103,101,32,109,101,115,115,97,103,101,32,105,110,32,104,97,110,100,115,104,97,107,101,0,66,111,103,117,115,32,115,116,114,105,110,103,0,70,111,114,98,105,100,100,101,110,0,75,101,121,32,100,105,115,97,98,108,101,100,0,78,111,116,32,112,111,115,115,105,98,108,101,32,119,105,116,104,32,97,32,99,97,114,100,32,98,97,115,101,100,32,107,101,121,0,73,110,118,97,108,105,100,32,108,111,99,107,32,111,98,106,101,99,116,0,71,101,110,101,114,97,108,32,73,80,67,32,101,114,114,111,114,0,73,80,67,32,97,99,99,101,112,116,32,99,97,108,108,32,102,97,105,108,101,100,0,73,80,67,32,99,111,110,110,101,99,116,32,99,97,108,108,32,102,97,105,108,101,100,0,73,110,118,97,108,105,100,32,73,80,67,32,114,101,115,112,111,110,115,101,0,73,110,118,97,108,105,100,32,118,97,108,117,101,32,112,97,115,115,101,100,32,116,111,32,73,80,67,0,73,110,99,111,109,112,108,101,116,101,32,108,105,110,101,32,112,97,115,115,101,100,32,116,111,32,73,80,67,0,76,105,110,101,32,112,97,115,115,101,100,32,116,111,32,73,80,67,32,116,111,111,32,108,111,110,103,0,78,101,115,116,101,100,32,73,80,67,32,99,111,109,109,97,110,100,115,0,78,111,32,100,97,116,97,32,99,97,108,108,98,97,99,107,32,105,110,32,73,80,67,0,78,111,32,105,110,113,117,105,114,101,32,99,97,108,108,98,97,99,107,32,105,110,32,73,80,67,0,78,111,116,32,97,110,32,73,80,67,32,115,101,114,118,101,114,0,78,111,116,32,97,110,32,73,80,67,32,99,108,105,101,110,116,0,80,114,111,98,108,101,109,32,115,116,97,114,116,105,110,103,32,73,80,67,32,115,101,114,118,101,114,0,73,80,67,32,114,101,97,100,32,101,114,114,111,114,0,73,80,67,32,119,114,105,116,101,32,101,114,114,111,114,0,84,111,111,32,109,117,99,104,32,100,97,116,97,32,102,111,114,32,73,80,67,32,108,97,121,101,114,0,85,110,101,120,112,101,99,116,101,100,32,73,80,67,32,99,111,109,109,97,110,100,0,85,110,107,110,111,119,110,32,73,80,67,32,99,111,109,109,97,110,100,0,73,80,67,32,115,121,110,116,97,120,32,101,114,114,111,114,0,73,80,67,32,99,97,108,108,32,104,97,115,32,98,101,101,110,32,99,97,110,99,101,108,108,101,100,0,78,111,32,105,110,112,117,116,32,115,111,117,114,99,101,32,102,111,114,32,73,80,67,0,78,111,32,111,117,116,112,117,116,32,115,111,117,114,99,101,32,102,111,114,32,73,80,67,0,73,80,67,32,112,97,114,97,109,101,116,101,114,32,101,114,114,111,114,0,85,110,107,110,111,119,110,32,73,80,67,32,105,110,113,117,105,114,101,0,71,101,110,101,114,97,108,32,76,68,65,80,32,101,114,114,111,114,0,71,101,110,101,114,97,108,32,76,68,65,80,32,97,116,116,114,105,98,117,116,101,32,101,114,114,111,114,0,71,101,110,101,114,97,108,32,76,68,65,80,32,110,97,109,101,32,101,114,114,111,114,0,71,101,110,101,114,97,108,32,76,68,65,80,32,115,101,99,117,114,105,116,121,32,101,114,114,111,114,0,71,101,110,101,114,97,108,32,76,68,65,80,32,115,101,114,118,105,99,101,32,101,114,114,111,114,0,71,101,110,101,114,97,108,32,76,68,65,80,32,117,112,100,97,116,101,32,101,114,114,111,114,0,69,120,112,101,114,105,109,101,110,116,97,108,32,76,68,65,80,32,101,114,114,111,114,32,99,111,100,101,0,80,114,105,118,97,116,101,32,76,68,65,80,32,101,114,114,111,114,32,99,111,100,101,0,79,116,104,101,114,32,103,101,110,101,114,97,108,32,76,68,65,80,32,101,114,114,111,114,0,76,68,65,80,32,99,111,110,110,101,99,116,105,110,103,32,102,97,105,108,101,100,32,40,88,41,0,76,68,65,80,32,114,101,102,101,114,114,97,108,32,108,105,109,105,116,32,101,120,99,101,101,100,101,100,0,76,68,65,80,32,99,108,105,101,110,116,32,108,111,111,112,0,78,111,32,76,68,65,80,32,114,101,115,117,108,116,115,32,114,101,116,117,114,110,101,100,0,76,68,65,80,32,99,111,110,116,114,111,108,32,110,111,116,32,102,111,117,110,100,0,78,111,116,32,115,117,112,112,111,114,116,101,100,32,98,121,32,76,68,65,80,0,76,68,65,80,32,99,111,110,110,101,99,116,32,101,114,114,111,114,0,79,117,116,32,111,102,32,109,101,109,111,114,121,32,105,110,32,76,68,65,80,0,66,97,100,32,112,97,114,97,109,101,116,101,114,32,116,111,32,97,110,32,76,68,65,80,32,114,111,117,116,105,110,101,0,85,115,101,114,32,99,97,110,99,101,108,108,101,100,32,76,68,65,80,32,111,112,101,114,97,116,105,111,110,0,66,97,100,32,76,68,65,80,32,115,101,97,114,99,104,32,102,105,108,116,101,114,0,85,110,107,110,111,119,110,32,76,68,65,80,32,97,117,116,104,101,110,116,105,99,97,116,105,111,110,32,109,101,116,104,111,100,0,84,105,109,101,111,117,116,32,105,110,32,76,68,65,80,0,76,68,65,80,32,100,101,99,111,100,105,110,103,32,101,114,114,111,114,0,76,68,65,80,32,101,110,99,111,100,105,110,103,32,101,114,114,111,114,0,76,68,65,80,32,108,111,99,97,108,32,101,114,114,111,114,0,67,97,110,110,111,116,32,99,111,110,116,97,99,116,32,76,68,65,80,32,115,101,114,118,101,114,0,76,68,65,80,32,115,117,99,99,101,115,115,0,76,68,65,80,32,111,112,101,114,97,116,105,111,110,115,32,101,114,114,111,114,0,76,68,65,80,32,112,114,111,116,111,99,111,108,32,101,114,114,111,114,0,84,105,109,101,32,108,105,109,105,116,32,101,120,99,101,101,100,101,100,32,105,110,32,76,68,65,80,0,83,105,122,101,32,108,105,109,105,116,32,101,120,99,101,101,100,101,100,32,105,110,32,76,68,65,80,0,76,68,65,80,32,99,111,109,112,97,114,101,32,102,97,108,115,101,0,76,68,65,80,32,99,111,109,112,97,114,101,32,116,114,117,101,0,76,68,65,80,32,97,117,116,104,101,110,116,105,99,97,116,105,111,110,32,109,101,116,104,111,100,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,83,116,114,111,110,103,40,101,114,41,32,76,68,65,80,32,97,117,116,104,101,110,116,105,99,97,116,105,111,110,32,114,101,113,117,105,114,101,100,0,80,97,114,116,105,97,108,32,76,68,65,80,32,114,101,115,117,108,116,115,43,114,101,102,101,114,114,97,108,32,114,101,99,101,105,118,101,100,0,76,68,65,80,32,114,101,102,101,114,114,97,108,0,65,100,109,105,110,105,115,116,114,97,116,105,118,101,32,76,68,65,80,32,108,105,109,105,116,32,101,120,99,101,101,100,101,100,0,67,114,105,116,105,99,97,108,32,76,68,65,80,32,101,120,116,101,110,115,105,111,110,32,105,115,32,117,110,97,118,97,105,108,97,98,108,101,0,67,111,110,102,105,100,101,110,116,105,97,108,105,116,121,32,114,101,113,117,105,114,101,100,32,98,121,32,76,68,65,80,0,76,68,65,80,32,83,65,83,76,32,98,105,110,100,32,105,110,32,112,114,111,103,114,101,115,115,0,78,111,32,115,117,99,104,32,76,68,65,80,32,97,116,116,114,105,98,117,116,101,0,85,110,100,101,102,105,110,101,100,32,76,68,65,80,32,97,116,116,114,105,98,117,116,101,32,116,121,112,101,0,73,110,97,112,112,114,111,112,114,105,97,116,101,32,109,97,116,99,104,105,110,103,32,105,110,32,76,68,65,80,0,67,111,110,115,116,114,97,105,110,116,32,118,105,111,108,97,116,105,111,110,32,105,110,32,76,68,65,80,0,76,68,65,80,32,116,121,112,101,32,111,114,32,118,97,108,117,101,32,101,120,105,115,116,115,0,73,110,118,97,108,105,100,32,115,121,110,116,97,120,32,105,110,32,76,68,65,80,0,78,111,32,115,117,99,104,32,76,68,65,80,32,111,98,106,101,99,116,0,76,68,65,80,32,97,108,105,97,115,32,112,114,111,98,108,101,109,0,73,110,118,97,108,105,100,32,68,78,32,115,121,110,116,97,120,32,105,110,32,76,68,65,80,0,76,68,65,80,32,101,110,116,114,121,32,105,115,32,97,32,108,101,97,102,0,76,68,65,80,32,97,108,105,97,115,32,100,101,114,101,102,101,114,101,110,99,105,110,103,32,112,114,111,98,108,101,109,0,76,68,65,80,32,112,114,111,120,121,32,97,117,116,104,111,114,105,122,97,116,105,111,110,32,102,97,105,108,117,114,101,32,40,88,41,0,73,110,97,112,112,114,111,112,114,105,97,116,101,32,76,68,65,80,32,97,117,116,104,101,110,116,105,99,97,116,105,111,110,0,73,110,118,97,108,105,100,32,76,68,65,80,32,99,114,101,100,101,110,116,105,97,108,115,0,73,110,115,117,102,102,105,99,105,101,110,116,32,97,99,99,101,115,115,32,102,111,114,32,76,68,65,80,0,76,68,65,80,32,115,101,114,118,101,114,32,105,115,32,98,117,115,121,0,76,68,65,80,32,115,101,114,118,101,114,32,105,115,32,117,110,97,118,97,105,108,97,98,108,101,0,76,68,65,80,32,115,101,114,118,101,114,32,105,115,32,117,110,119,105,108,108,105,110,103,32,116,111,32,112,101,114,102,111,114,109,0,76,111,111,112,32,100,101,116,101,99,116,101,100,32,98,121,32,76,68,65,80,0,76,68,65,80,32,110,97,109,105,110,103,32,118,105,111,108,97,116,105,111,110,0,76,68,65,80,32,111,98,106,101,99,116,32,99,108,97,115,115,32,118,105,111,108,97,116,105,111,110,0,76,68,65,80,32,111,112,101,114,97,116,105,111,110,32,110,111,116,32,97,108,108,111,119,101,100,32,111,110,32,110,111,110,45,108,101,97,102,0,76,68,65,80,32,111,112,101,114,97,116,105,111,110,32,110,111,116,32,97,108,108,111,119,101,100,32,111,110,32,82,68,78,0,65,108,114,101,97,100,121,32,101,120,105,115,116,115,32,40,76,68,65,80,41,0,67,97,110,110,111,116,32,109,111,100,105,102,121,32,76,68,65,80,32,111,98,106,101,99,116,32,99,108,97,115,115,0,76,68,65,80,32,114,101,115,117,108,116,115,32,116,111,111,32,108,97,114,103,101,0,76,68,65,80,32,111,112,101,114,97,116,105,111,110,32,97,102,102,101,99,116,115,32,109,117,108,116,105,112,108,101,32,68,83,65,115,0,86,105,114,116,117,97,108,32,76,68,65,80,32,108,105,115,116,32,118,105,101,119,32,101,114,114,111,114,0,79,116,104,101,114,32,76,68,65,80,32,101,114,114,111,114,0,82,101,115,111,117,114,99,101,115,32,101,120,104,97,117,115,116,101,100,32,105,110,32,76,67,85,80,0,83,101,99,117,114,105,116,121,32,118,105,111,108,97,116,105,111,110,32,105,110,32,76,67,85,80,0,73,110,118,97,108,105,100,32,100,97,116,97,32,105,110,32,76,67,85,80,0,85,110,115,117,112,112,111,114,116,101,100,32,115,99,104,101,109,101,32,105,110,32,76,67,85,80,0,82,101,108,111,97,100,32,114,101,113,117,105,114,101,100,32,105,110,32,76,67,85,80,0,76,68,65,80,32,99,97,110,99,101,108,108,101,100,0,78,111,32,76,68,65,80,32,111,112,101,114,97,116,105,111,110,32,116,111,32,99,97,110,99,101,108,0,84,111,111,32,108,97,116,101,32,116,111,32,99,97,110,99,101,108,32,76,68,65,80,0,67,97,110,110,111,116,32,99,97,110,99,101,108,32,76,68,65,80,0,76,68,65,80,32,97,115,115,101,114,116,105,111,110,32,102,97,105,108,101,100,0,80,114,111,120,105,101,100,32,97,117,116,104,111,114,105,122,97,116,105,111,110,32,100,101,110,105,101,100,32,98,121,32,76,68,65,80,0,85,115,101,114,32,100,101,102,105,110,101,100,32,101,114,114,111,114,32,99,111,100,101,32,49,0,85,115,101,114,32,100,101,102,105,110,101,100,32,101,114,114,111,114,32,99,111,100,101,32,50,0,85,115,101,114,32,100,101,102,105,110,101,100,32,101,114,114,111,114,32,99,111,100,101,32,51,0,85,115,101,114,32,100,101,102,105,110,101,100,32,101,114,114,111,114,32,99,111,100,101,32,52,0,85,115,101,114,32,100,101,102,105,110,101,100,32,101,114,114,111,114,32,99,111,100,101,32,53,0,85,115,101,114,32,100,101,102,105,110,101,100,32,101,114,114,111,114,32,99,111,100,101,32,54,0,85,115,101,114,32,100,101,102,105,110,101,100,32,101,114,114,111,114,32,99,111,100,101,32,55,0,85,115,101,114,32,100,101,102,105,110,101,100,32,101,114,114,111,114,32,99,111,100,101,32,56,0,85,115,101,114,32,100,101,102,105,110,101,100,32,101,114,114,111,114,32,99,111,100,101,32,57,0,85,115,101,114,32,100,101,102,105,110,101,100,32,101,114,114,111,114,32,99,111,100,101,32,49,48,0,85,115,101,114,32,100,101,102,105,110,101,100,32,101,114,114,111,114,32,99,111,100,101,32,49,49,0,85,115,101,114,32,100,101,102,105,110,101,100,32,101,114,114,111,114,32,99,111,100,101,32,49,50,0,85,115,101,114,32,100,101,102,105,110,101,100,32,101,114,114,111,114,32,99,111,100,101,32,49,51,0,85,115,101,114,32,100,101,102,105,110,101,100,32,101,114,114,111,114,32,99,111,100,101,32,49,52,0,85,115,101,114,32,100,101,102,105,110,101,100,32,101,114,114,111,114,32,99,111,100,101,32,49,53,0,85,115,101,114,32,100,101,102,105,110,101,100,32,101,114,114,111,114,32,99,111,100,101,32,49,54,0,83,121,115,116,101,109,32,101,114,114,111,114,32,119,47,111,32,101,114,114,110,111,0,85,110,107,110,111,119,110,32,115,121,115,116,101,109,32,101,114,114,111,114,0,69,110,100,32,111,102,32,102,105,108,101,0,85,110,107,110,111,119,110,32,101,114,114,111,114,32,99,111,100,101,0,97,109,111,117,110,116,46,99,0,84,65,76,69,82,95,97,109,111,117,110,116,95,99,109,112,0,65,115,115,101,114,116,105,111,110,32,102,97,105,108,101,100,32,97,116,32,37,115,58,37,100,46,10,0,84,65,76,69,82,95,97,109,111,117,110],"i8",ALLOC_NONE,Runtime.GLOBAL_BASE+51200);allocate([116,95,115,117,98,116,114,97,99,116,0,84,65,76,69,82,95,97,109,111,117,110,116,95,97,100,100,0,18,17,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,17,34,35,36,17,37,38,39,40,41,42,43,44,17,45,46,47,16,16,48,16,16,16,16,16,16,16,49,50,51,16,52,53,16,16,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,54,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,55,17,17,17,17,56,17,57,58,59,60,61,62,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,63,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,17,64,65,17,66,67,68,69,70,71,72,73,16,16,16,74,75,76,77,78,16,16,16,79,80,16,16,16,16,81,16,16,16,16,16,16,16,16,16,17,17,17,82,83,16,16,16,16,16,16,16,16,16,16,16,17,17,17,17,84,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,17,17,85,16,16,16,16,86,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,87,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,88,89,90,91,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,92,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,0,0,0,0,0,0,0,254,255,255,7,254,255,255,7,0,0,0,0,0,4,32,4,255,255,127,255,255,255,127,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,195,255,3,0,31,80,0,0,0,0,0,0,0,0,0,0,32,0,0,0,0,0,223,60,64,215,255,255,251,255,255,255,255,255,255,255,255,255,191,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,3,252,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,254,255,255,255,127,2,254,255,255,255,255,0,0,0,0,0,255,191,182,0,255,255,255,7,7,0,0,0,255,7,255,255,255,255,255,255,255,254,255,195,255,255,255,255,255,255,255,255,255,255,255,255,239,31,254,225,255,159,0,0,255,255,255,255,255,255,0,224,255,255,255,255,255,255,255,255,255,255,255,255,3,0,255,255,255,255,255,7,48,4,255,255,255,252,255,31,0,0,255,255,255,1,0,0,0,0,0,0,0,0,253,31,0,0,0,0,0,0,240,3,255,127,255,255,255,255,255,255,255,239,255,223,225,255,207,255,254,254,238,159,249,255,255,253,197,227,159,89,128,176,207,255,3,0,238,135,249,255,255,253,109,195,135,25,2,94,192,255,63,0,238,191,251,255,255,253,237,227,191,27,1,0,207,255,0,0,238,159,249,255,255,253,237,227,159,25,192,176,207,255,2,0,236,199,61,214,24,199,255,195,199,29,129,0,192,255,0,0,238,223,253,255,255,253,239,227,223,29,96,3,207,255,0,0,236,223,253,255,255,253,239,227,223,29,96,64,207,255,6,0,236,223,253,255,255,255,255,231,223,93,128,0,207,255,0,252,236,255,127,252,255,255,251,47,127,128,95,255,0,0,12,0,254,255,255,255,255,127,255,7,63,32,255,3,0,0,0,0,150,37,240,254,174,236,255,59,95,32,255,243,0,0,0,0,1,0,0,0,255,3,0,0,255,254,255,255,255,31,254,255,3,255,255,254,255,255,255,31,0,0,0,0,0,0,0,0,255,255,255,255,255,255,127,249,255,3,255,255,231,193,255,255,127,64,255,51,255,255,255,255,191,32,255,255,255,255,255,247,255,255,255,255,255,255,255,255,255,61,127,61,255,255,255,255,255,61,255,255,255,255,61,127,61,255,127,255,255,255,255,255,255,255,61,255,255,255,255,255,255,255,255,135,0,0,0,0,255,255,0,0,255,255,255,255,255,255,255,255,255,255,31,0,254,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,159,255,255,254,255,255,7,255,255,255,255,255,255,255,255,255,199,1,0,255,223,15,0,255,255,15,0,255,255,15,0,255,223,13,0,255,255,255,255,255,255,207,255,255,1,128,16,255,3,0,0,0,0,255,3,255,255,255,255,255,255,255,255,255,255,255,0,255,255,255,255,255,7,255,255,255,255,255,255,255,255,63,0,255,255,255,31,255,15,255,1,192,255,255,255,255,63,31,0,255,255,255,255,255,15,255,255,255,3,255,3,0,0,0,0,255,255,255,15,255,255,255,255,255,255,255,127,254,255,31,0,255,3,255,3,128,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,239,255,239,15,255,3,0,0,0,0,255,255,255,255,255,243,255,255,255,255,255,255,191,255,3,0,255,255,255,255,255,255,63,0,255,227,255,255,255,255,255,63,0,0,0,0,0,0,0,0,0,0,0,0,0,222,111,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,0,0,0,0,0,0,0,255,255,63,63,255,255,255,255,63,63,255,170,255,255,255,63,255,255,255,255,255,255,223,95,220,31,207,15,255,31,220,31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,128,0,0,255,31,0,0,0,0,0,0,0,0,0,0,0,0,132,252,47,62,80,189,255,243,224,67,0,0,255,255,255,255,255,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,255,255,255,255,255,255,3,0,0,255,255,255,255,255,127,255,255,255,255,255,127,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,31,120,12,0,255,255,255,255,191,32,255,255,255,255,255,255,255,128,0,0,255,255,127,0,127,127,127,127,127,127,127,127,255,255,255,255,0,0,0,0,0,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,224,0,0,0,254,3,62,31,254,255,255,255,255,255,255,255,255,255,127,224,254,255,255,255,255,255,255,255,255,255,255,247,224,255,255,255,255,63,254,255,255,255,255,255,255,255,255,255,255,127,0,0,255,255,255,7,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,63,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,31,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,31,0,0,0,0,0,0,0,0,255,255,255,255,255,63,255,31,255,255,255,15,0,0,255,255,255,255,255,127,240,143,255,255,255,128,255,255,255,255,255,255,255,255,255,255,0,0,0,0,128,255,252,255,255,255,255,255,255,255,255,255,255,255,255,121,15,0,255,7,0,0,0,0,0,0,0,0,0,255,187,247,255,255,255,0,0,0,255,255,255,255,255,255,15,0,255,255,255,255,255,255,255,255,15,0,255,3,0,0,252,8,255,255,255,255,255,7,255,255,255,255,7,0,255,255,255,31,255,255,255,255,255,255,247,255,0,128,255,3,0,0,0,0,255,255,255,255,255,255,127,0,255,63,255,3,255,255,127,4,255,255,255,255,255,255,255,127,5,0,0,56,255,255,60,0,126,126,126,0,127,127,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,7,255,3,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,15,0,255,255,127,248,255,255,255,255,255,15,255,255,255,255,255,255,255,255,255,255,255,255,255,63,255,255,255,255,255,255,255,255,255,255,255,255,255,3,0,0,0,0,127,0,248,224,255,253,127,95,219,255,255,255,255,255,255,255,255,255,255,255,255,255,3,0,0,0,248,255,255,255,255,255,255,255,255,255,255,255,255,63,0,0,255,255,255,255,255,255,255,255,252,255,255,255,255,255,255,0,0,0,0,0,255,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,223,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,31,0,0,255,3,254,255,255,7,254,255,255,7,192,255,255,255,255,255,255,255,255,255,255,127,252,252,252,28,0,0,0,0,255,239,255,255,127,255,255,183,255,63,255,63,0,0,0,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,7,0,0,0,0,0,0,0,0,255,255,255,255,255,255,31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,31,255,255,255,255,255,255,1,0,0,0,0,0,255,255,255,127,0,0,255,255,255,7,0,0,0,0,0,0,255,255,255,63,255,255,255,255,15,255,62,0,0,0,0,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,63,255,3,0,0,0,0,0,0,0,0,0,0,63,253,255,255,255,255,191,145,255,255,63,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,63,0,255,255,255,3,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,192,0,0,0,0,0,0,0,0,111,240,239,254,255,255,15,0,0,0,0,0,255,255,255,31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,63,0,255,255,63,0,255,255,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,63,0,0,0,192,255,0,0,252,255,255,255,255,255,255,1,0,0,255,255,255,1,255,3,255,255,255,255,255,255,199,255,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,30,0,255,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,63,0,255,3,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,255,255,255,255,127,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,255,255,255,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,127,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,31,0,255,255,255,255,255,127,0,0,248,255,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,255,223,255,255,255,255,255,255,255,255,223,100,222,255,235,239,255,255,255,255,255,255,255,191,231,223,223,255,255,255,123,95,252,253,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,63,255,255,255,253,255,255,247,255,255,255,247,255,255,223,255,255,255,223,255,255,127,255,255,255,127,255,255,255,253,255,255,255,253,255,255,247,207,255,255,255,255,255,255,239,255,255,255,150,254,247,10,132,234,150,170,150,247,247,94,255,251,255,15,238,251,255,15,0,0,0,0,0,0,0,0,84,33,34,25,13,1,2,3,17,75,28,12,16,4,11,29,18,30,39,104,110,111,112,113,98,32,5,6,15,19,20,21,26,8,22,7,40,36,23,24,9,10,14,27,31,37,35,131,130,125,38,42,43,60,61,62,63,67,71,74,77,88,89,90,91,92,93,94,95,96,97,99,100,101,102,103,105,106,107,108,114,115,116,121,122,123,124,0,73,108,108,101,103,97,108,32,98,121,116,101,32,115,101,113,117,101,110,99,101,0,68,111,109,97,105,110,32,101,114,114,111,114,0,82,101,115,117,108,116,32,110,111,116,32,114,101,112,114,101,115,101,110,116,97,98,108,101,0,78,111,116,32,97,32,116,116,121,0,80,101,114,109,105,115,115,105,111,110,32,100,101,110,105,101,100,0,79,112,101,114,97,116,105,111,110,32,110,111,116,32,112,101,114,109,105,116,116,101,100,0,78,111,32,115,117,99,104,32,102,105,108,101,32,111,114,32,100,105,114,101,99,116,111,114,121,0,78,111,32,115,117,99,104,32,112,114,111,99,101,115,115,0,70,105,108,101,32,101,120,105,115,116,115,0,86,97,108,117,101,32,116,111,111,32,108,97,114,103,101,32,102,111,114,32,100,97,116,97,32,116,121,112,101,0,78,111,32,115,112,97,99,101,32,108,101,102,116,32,111,110,32,100,101,118,105,99,101,0,79,117,116,32,111,102,32,109,101,109,111,114,121,0,82,101,115,111,117,114,99,101,32,98,117,115,121,0,73,110,116,101,114,114,117,112,116,101,100,32,115,121,115,116,101,109,32,99,97,108,108,0,82,101,115,111,117,114,99,101,32,116,101,109,112,111,114,97,114,105,108,121,32,117,110,97,118,97,105,108,97,98,108,101,0,73,110,118,97,108,105,100,32,115,101,101,107,0,67,114,111,115,115,45,100,101,118,105,99,101,32,108,105,110,107,0,82,101,97,100,45,111,110,108,121,32,102,105,108,101,32,115,121,115,116,101,109,0,68,105,114,101,99,116,111,114,121,32,110,111,116,32,101,109,112,116,121,0,67,111,110,110,101,99,116,105,111,110,32,114,101,115,101,116,32,98,121,32,112,101,101,114,0,79,112,101,114,97,116,105,111,110,32,116,105,109,101,100,32,111,117,116,0,67,111,110,110,101,99,116,105,111,110,32,114,101,102,117,115,101,100,0,72,111,115,116,32,105,115,32,100,111,119,110,0,72,111,115,116,32,105,115,32,117,110,114,101,97,99,104,97,98,108,101,0,65,100,100,114,101,115,115,32,105,110,32,117,115,101,0,66,114,111,107,101,110,32,112,105,112,101,0,73,47,79,32,101,114,114,111,114,0,78,111,32,115,117,99,104,32,100,101,118,105,99,101,32,111,114,32,97,100,100,114,101,115,115,0,66,108,111,99,107,32,100,101,118,105,99,101,32,114,101,113,117,105,114,101,100,0,78,111,32,115,117,99,104,32,100,101,118,105,99,101,0,78,111,116,32,97,32,100,105,114,101,99,116,111,114,121,0,73,115,32,97,32,100,105,114,101,99,116,111,114,121,0,84,101,120,116,32,102,105,108,101,32,98,117,115,121,0,69,120,101,99,32,102,111,114,109,97,116,32,101,114,114,111,114,0,73,110,118,97,108,105,100,32,97,114,103,117,109,101,110,116,0,65,114,103,117,109,101,110,116,32,108,105,115,116,32,116,111,111,32,108,111,110,103,0,83,121,109,98,111,108,105,99,32,108,105,110,107,32,108,111,111,112,0,70,105,108,101,110,97,109,101,32,116,111,111,32,108,111,110,103,0,84,111,111,32,109,97,110,121,32,111,112,101,110,32,102,105,108,101,115,32,105,110,32,115,121,115,116,101,109,0,78,111,32,102,105,108,101,32,100,101,115,99,114,105,112,116,111,114,115,32,97,118,97,105,108,97,98,108,101,0,66,97,100,32,102,105,108,101,32,100,101,115,99,114,105,112,116,111,114,0,78,111,32,99,104,105,108,100,32,112,114,111,99,101,115,115,0,66,97,100,32,97,100,100,114,101,115,115,0,70,105,108,101,32,116,111,111,32,108,97,114,103,101,0,84,111,111,32,109,97,110,121,32,108,105,110,107,115,0,78,111,32,108,111,99,107,115,32,97,118,97,105,108,97,98,108,101,0,82,101,115,111,117,114,99,101,32,100,101,97,100,108,111,99,107,32,119,111,117,108,100,32,111,99,99,117,114,0,83,116,97,116,101,32,110,111,116,32,114,101,99,111,118,101,114,97,98,108,101,0,80,114,101,118,105,111,117,115,32,111,119,110,101,114,32,100,105,101,100,0,79,112,101,114,97,116,105,111,110,32,99,97,110,99,101,108,101,100,0,70,117,110,99,116,105,111,110,32,110,111,116,32,105,109,112,108,101,109,101,110,116,101,100,0,78,111,32,109,101,115,115,97,103,101,32,111,102,32,100,101,115,105,114,101,100,32,116,121,112,101,0,73,100,101,110,116,105,102,105,101,114,32,114,101,109,111,118,101,100,0,68,101,118,105,99,101,32,110,111,116,32,97,32,115,116,114,101,97,109,0,78,111,32,100,97,116,97,32,97,118,97,105,108,97,98,108,101,0,68,101,118,105,99,101,32,116,105,109,101,111,117,116,0,79,117,116,32,111,102,32,115,116,114,101,97,109,115,32,114,101,115,111,117,114,99,101,115,0,76,105,110,107,32,104,97,115,32,98,101,101,110,32,115,101,118,101,114,101,100,0,80,114,111,116,111,99,111,108,32,101,114,114,111,114,0,66,97,100,32,109,101,115,115,97,103,101,0,70,105,108,101,32,100,101,115,99,114,105,112,116,111,114,32,105,110,32,98,97,100,32,115,116,97,116,101,0,78,111,116,32,97,32,115,111,99,107,101,116,0,68,101,115,116,105,110,97,116,105,111,110,32,97,100,100,114,101,115,115,32,114,101,113,117,105,114,101,100,0,77,101,115,115,97,103,101,32,116,111,111,32,108,97,114,103,101,0,80,114,111,116,111,99,111,108,32,119,114,111,110,103,32,116,121,112,101,32,102,111,114,32,115,111,99,107,101,116,0,80,114,111,116,111,99,111,108,32,110,111,116,32,97,118,97,105,108,97,98,108,101,0,80,114,111,116,111,99,111,108,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,83,111,99,107,101,116,32,116,121,112,101,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,78,111,116,32,115,117,112,112,111,114,116,101,100,0,80,114,111,116,111,99,111,108,32,102,97,109,105,108,121,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,65,100,100,114,101,115,115,32,102,97,109,105,108,121,32,110,111,116,32,115,117,112,112,111,114,116,101,100,32,98,121,32,112,114,111,116,111,99,111,108,0,65,100,100,114,101,115,115,32,110,111,116,32,97,118,97,105,108,97,98,108,101,0,78,101,116,119,111,114,107,32,105,115,32,100,111,119,110,0,78,101,116,119,111,114,107,32,117,110,114,101,97,99,104,97,98,108,101,0,67,111,110,110,101,99,116,105,111,110,32,114,101,115,101,116,32,98,121,32,110,101,116,119,111,114,107,0,67,111,110,110,101,99,116,105,111,110,32,97,98,111,114,116,101,100,0,78,111,32,98,117,102,102,101,114,32,115,112,97,99,101,32,97,118,97,105,108,97,98,108,101,0,83,111,99,107,101,116,32,105,115,32,99,111,110,110,101,99,116,101,100,0,83,111,99,107,101,116,32,110,111,116,32,99,111,110,110,101,99,116,101,100,0,67,97,110,110,111,116,32,115,101,110,100,32,97,102,116,101,114,32,115,111,99,107,101,116,32,115,104,117,116,100,111,119,110,0,79,112,101,114,97,116,105,111,110,32,97,108,114,101,97,100,121,32,105,110,32,112,114,111,103,114,101,115,115,0,79,112,101,114,97,116,105,111,110,32,105,110,32,112,114,111,103,114,101,115,115,0,83,116,97,108,101,32,102,105,108,101,32,104,97,110,100,108,101,0,82,101,109,111,116,101,32,73,47,79,32,101,114,114,111,114,0,81,117,111,116,97,32,101,120,99,101,101,100,101,100,0,78,111,32,109,101,100,105,117,109,32,102,111,117,110,100,0,87,114,111,110,103,32,109,101,100,105,117,109,32,116,121,112,101,0,78,111,32,101,114,114,111,114,32,105,110,102,111,114,109,97,116,105,111,110,0,0,17,0,10,0,17,17,17,0,0,0,0,5,0,0,0,0,0,0,9,0,0,0,0,11,0,0,0,0,0,0,0,0,17,0,15,10,17,17,17,3,10,7,0,1,19,9,11,11,0,0,9,6,11,0,0,11,0,6,17,0,0,0,17,17,17,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,0,0,0,0,0,0,0,0,17,0,10,10,17,17,17,0,10,0,0,2,0,9,11,0,0,0,9,0,11,0,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,12,0,0,0,0,9,12,0,0,0,0,0,12,0,0,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14,0,0,0,0,0,0,0,0,0,0,0,13,0,0,0,4,13,0,0,0,0,9,14,0,0,0,0,0,14,0,0,14,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,0,0,0,0,15,0,0,0,0,15,0,0,0,0,9,16,0,0,0,0,0,16,0,0,16,0,0,18,0,0,0,18,18,18,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,0,0,0,18,18,18,0,0,0,0,0,0,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,0,0,0,0,0,0,0,0,0,0,0,10,0,0,0,0,10,0,0,0,0,9,11,0,0,0,0,0,11,0,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,12,0,0,0,0,9,12,0,0,0,0,0,12,0,0,12,0,0,48,49,50,51,52,53,54,55,56,57,65,66,67,68,69,70,45,43,32,32,32,48,88,48,120,0,40,110,117,108,108,41,0,45,48,88,43,48,88,32,48,88,45,48,120,43,48,120,32,48,120,0,105,110,102,0,73,78,70,0,110,97,110,0,78,65,78,0,46,0,18,16,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,16,16,34,35,16,36,37,38,39,40,41,42,43,16,44,45,46,17,47,48,17,17,49,17,17,17,50,51,52,53,54,55,56,57,17,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,58,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,59,16,60,61,62,63,64,65,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,66,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,67,16,16,68,16,69,70,71,16,72,16,73,16,16,16,16,74,75,76,77,16,16,78,16,79,80,16,16,16,16,81,16,16,16,16,16,16,16,16,16,16,16,16,16,82,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,83,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,84,85,86,87,16,16,88,89,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,90,16,91,92,93,94,95,96,97,98,16,16,16,16,16,16,16,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,0,0,0,254,255,0,252,1,0,0,248,1,0,0,120,0,0,0,0,255,251,223,251,0,0,128,0,0,0,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,0,252,255,224,175,255,255,255,255,255,255,255,255,255,255,223,255,255,255,255,255,32,64,176,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,252,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,252,0,0,0,0,0,134,254,255,255,255,0,64,73,0,0,0,0,0,24,0,223,255,0,200,0,0,0,0,0,0,0,1,0,60,0,0,0,0,0,0,0,0,0,0,0,0,16,224,1,30,0,96,255,191,0,0,0,0,0,0,255,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,248,207,3,0,0,0,3,0,32,255,127,0,0,0,78,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,252,0,0,0,0,0,0,0,0,0,16,0,32,30,0,48,0,1,0,0,0,0,0,0,0,0,16,0,32,0,0,0,0,252,15,0,0,0,0,0,0,0,16,0,32,0,0,0,0,0,0,0,0,0,0,0,0,0,16,0,32,0,0,0,0,3,0,0,0,0,0,0,0,0,16,0,32,0,0,0,0,253,0,0,0,0,0,0,0,0,0,0,32,0,0,0,0,255,7,0,0,0,0,0,0,0,0,0,32,0,0,0,0,0,255,0,0,0,0,0,0,0,16,0,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,0,0,0,0,63,2,0,0,0,0,0,0,0,0,0,4,0,0,0,0,16,0,0,0,0,0,0,128,0,128,192,223,0,12,0,0,0,0,0,0,0,0,0,0,0,0,0,31,0,0,0,0,0,0,254,255,255,255,0,252,255,255,0,0,0,0,0,0,0,0,252,0,0,0,0,0,0,192,255,223,255,7,0,0,0,0,0,0,0,0,0,0,128,6,0,252,0,0,24,62,0,0,128,191,0,204,0,0,0,0,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,96,255,255,255,31,0,0,255,3,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,96,0,0,1,0,0,24,0,0,0,0,0,0,0,0,0,56,0,0,0,0,16,0,0,0,112,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,48,0,0,254,127,47,0,0,255,3,255,127,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14,49,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,196,255,255,255,255,0,0,0,192,0,0,0,0,0,0,0,0,1,0,224,159,0,0,0,0,127,63,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,0,16,0,0,252,255,255,255,31,0,0,0,0,0,12,0,0,0,0,0,0,64,0,12,240,0,0,0,0,0,0,192,248,0,0,0,0,0,0,0,192,0,0,0,0,0,0,0,0,255,0,255,255,255,33,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,127,0,0,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,160,3,224,0,224,0,224,0,96,128,248,255,255,255,252,255,255,255,255,255,127,31,252,241,127,255,127,0,0,255,255,255,3,0,0,255,255,255,255,1,0,123,3,208,193,175,66,0,12,31,188,255,255,0,0,0,0,0,2,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,15,0,255,255,255,255,127,0,0,0,255,7,0,0,255,255,255,255,255,255,255,255,255,255,63,0,0,0,0,0,0,252,255,255,254,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,31,255,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,224,135,3,254,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,127,255,15,0,0,0,0,0,0,0,0,255,255,255,251,255,255,255,255,255,255,255,255,255,255,15,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,63,0,0,0,255,15,30,255,255,255,1,252,193,224,0,0,0,0,0,0,0,0,0,0,0,30,1,0,0,0,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,0,0,0,0,255,255,255,255,15,0,0,0,255,255,255,127,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,127,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,127,0,0,0,0,0,0,192,0,224,0,0,0,0,0,0,0,0,0,0,0,128,15,112,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,0,255,255,127,0,3,0,0,0,0,0,0,0,0,0,0,0,0,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,68,8,0,0,0,15,255,3,0,0,0,0,0,0,240,0,0,0,0,0,0,0,0,0,16,192,0,0,255,255,3,7,0,0,0,0,0,248,0,0,0,0,8,128,0,0,0,0,0,0,0,0,0,0,8,0,255,63,0,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,240,0,0,128,11,0,0,0,0,0,0,0,128,2,0,0,192,0,0,67,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,56,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,252,255,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,48,255,255,255,3,127,0,255,255,255,255,247,255,127,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,254,255,0,252,1,0,0,248,1,0,0,248,63,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,127,127,0,48,135,255,255,255,255,255,143,255,0,0,0,0,0,0,224,255,255,7,255,15,0,0,0,0,0,0,255,255,255,255,255,63,0,0,0,0,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,143,0,0,0,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,135,255,0,255,1,0,0,0,224,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,254,0,0,0,255,0,0,0,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,127,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,63,252,255,63,0,0,0,3,0,0,0,0,0,0,254,3,0,0,0,0,0,0,0,0,0,0,0,0,0,24,0,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,225,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,7,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,63,0,255,255,255,255,127,254,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,63,0,0,0,0,255,255,255,255,255,255,255,255,63,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,255,127,0,255,255,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,8,0,0,0,8,0,0,32,0,0,0,32,0,0,128,0,0,0,128,0,0,0,2,0,0,0,2,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,255,255,255,255,255,15,255,255,255,255,255,255,255,255,255,255,255,255,15,0,255,127,254,127,254,255,254,255,0,0,0,0,255,7,255,255,255,127,255,255,255,255,255,255,255,15,255,255,255,255,255,7,0,0,0,0,0,0,0,0,192,255,255,255,7,0,255,255,255,255,255,7,255,1,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,1,0,191,255,255,255,255,255,255,255,255,31,255,255,15,0,255,255,255,255,223,7,0,0,255,255,1,0,255,255,255,255,255,255,255,127,253,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,30,255,255,255,255,255,255,255,63,15,0,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,248,255,255,255,255,255,255,255,255,225,255,0,0,0,0,0,0,255,255,255,255,255,255,255,255,63,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,1,2,3,4,5,6,7,8,9,255,255,255,255,255,255,255,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,255,255,255,255,255,255,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,1,2,4,7,3,6,5,0,114,119,97,0,47,112,114,111,99,47,115,101,108,102,47,102,100,47,0],"i8",ALLOC_NONE,Runtime.GLOBAL_BASE+61440);var tempDoublePtr=STATICTOP;STATICTOP+=16;assert(tempDoublePtr%8==0);Module["_i64Subtract"]=_i64Subtract;Module["_i64Add"]=_i64Add;Module["_pthread_mutex_lock"]=_pthread_mutex_lock;var ERRNO_CODES={EPERM:1,ENOENT:2,ESRCH:3,EINTR:4,EIO:5,ENXIO:6,E2BIG:7,ENOEXEC:8,EBADF:9,ECHILD:10,EAGAIN:11,EWOULDBLOCK:11,ENOMEM:12,EACCES:13,EFAULT:14,ENOTBLK:15,EBUSY:16,EEXIST:17,EXDEV:18,ENODEV:19,ENOTDIR:20,EISDIR:21,EINVAL:22,ENFILE:23,EMFILE:24,ENOTTY:25,ETXTBSY:26,EFBIG:27,ENOSPC:28,ESPIPE:29,EROFS:30,EMLINK:31,EPIPE:32,EDOM:33,ERANGE:34,ENOMSG:42,EIDRM:43,ECHRNG:44,EL2NSYNC:45,EL3HLT:46,EL3RST:47,ELNRNG:48,EUNATCH:49,ENOCSI:50,EL2HLT:51,EDEADLK:35,ENOLCK:37,EBADE:52,EBADR:53,EXFULL:54,ENOANO:55,EBADRQC:56,EBADSLT:57,EDEADLOCK:35,EBFONT:59,ENOSTR:60,ENODATA:61,ETIME:62,ENOSR:63,ENONET:64,ENOPKG:65,EREMOTE:66,ENOLINK:67,EADV:68,ESRMNT:69,ECOMM:70,EPROTO:71,EMULTIHOP:72,EDOTDOT:73,EBADMSG:74,ENOTUNIQ:76,EBADFD:77,EREMCHG:78,ELIBACC:79,ELIBBAD:80,ELIBSCN:81,ELIBMAX:82,ELIBEXEC:83,ENOSYS:38,ENOTEMPTY:39,ENAMETOOLONG:36,ELOOP:40,EOPNOTSUPP:95,EPFNOSUPPORT:96,ECONNRESET:104,ENOBUFS:105,EAFNOSUPPORT:97,EPROTOTYPE:91,ENOTSOCK:88,ENOPROTOOPT:92,ESHUTDOWN:108,ECONNREFUSED:111,EADDRINUSE:98,ECONNABORTED:103,ENETUNREACH:101,ENETDOWN:100,ETIMEDOUT:110,EHOSTDOWN:112,EHOSTUNREACH:113,EINPROGRESS:115,EALREADY:114,EDESTADDRREQ:89,EMSGSIZE:90,EPROTONOSUPPORT:93,ESOCKTNOSUPPORT:94,EADDRNOTAVAIL:99,ENETRESET:102,EISCONN:106,ENOTCONN:107,ETOOMANYREFS:109,EUSERS:87,EDQUOT:122,ESTALE:116,ENOTSUP:95,ENOMEDIUM:123,EILSEQ:84,EOVERFLOW:75,ECANCELED:125,ENOTRECOVERABLE:131,EOWNERDEAD:130,ESTRPIPE:86};var ERRNO_MESSAGES={0:"Success",1:"Not super-user",2:"No such file or directory",3:"No such process",4:"Interrupted system call",5:"I/O error",6:"No such device or address",7:"Arg list too long",8:"Exec format error",9:"Bad file number",10:"No children",11:"No more processes",12:"Not enough core",13:"Permission denied",14:"Bad address",15:"Block device required",16:"Mount device busy",17:"File exists",18:"Cross-device link",19:"No such device",20:"Not a directory",21:"Is a directory",22:"Invalid argument",23:"Too many open files in system",24:"Too many open files",25:"Not a typewriter",26:"Text file busy",27:"File too large",28:"No space left on device",29:"Illegal seek",30:"Read only file system",31:"Too many links",32:"Broken pipe",33:"Math arg out of domain of func",34:"Math result not representable",35:"File locking deadlock error",36:"File or path name too long",37:"No record locks available",38:"Function not implemented",39:"Directory not empty",40:"Too many symbolic links",42:"No message of desired type",43:"Identifier removed",44:"Channel number out of range",45:"Level 2 not synchronized",46:"Level 3 halted",47:"Level 3 reset",48:"Link number out of range",49:"Protocol driver not attached",50:"No CSI structure available",51:"Level 2 halted",52:"Invalid exchange",53:"Invalid request descriptor",54:"Exchange full",55:"No anode",56:"Invalid request code",57:"Invalid slot",59:"Bad font file fmt",60:"Device not a stream",61:"No data (for no delay io)",62:"Timer expired",63:"Out of streams resources",64:"Machine is not on the network",65:"Package not installed",66:"The object is remote",67:"The link has been severed",68:"Advertise error",69:"Srmount error",70:"Communication error on send",71:"Protocol error",72:"Multihop attempted",73:"Cross mount point (not really error)",74:"Trying to read unreadable message",75:"Value too large for defined data type",76:"Given log. name not unique",77:"f.d. invalid for this operation",78:"Remote address changed",79:"Can access a needed shared lib",80:"Accessing a corrupted shared lib",81:".lib section in a.out corrupted",82:"Attempting to link in too many libs",83:"Attempting to exec a shared library",84:"Illegal byte sequence",86:"Streams pipe error",87:"Too many users",88:"Socket operation on non-socket",89:"Destination address required",90:"Message too long",91:"Protocol wrong type for socket",92:"Protocol not available",93:"Unknown protocol",94:"Socket type not supported",95:"Not supported",96:"Protocol family not supported",97:"Address family not supported by protocol family",98:"Address already in use",99:"Address not available",100:"Network interface is not configured",101:"Network is unreachable",102:"Connection reset by network",103:"Connection aborted",104:"Connection reset by peer",105:"No buffer space available",106:"Socket is already connected",107:"Socket is not connected",108:"Can't send after socket shutdown",109:"Too many references",110:"Connection timed out",111:"Connection refused",112:"Host is down",113:"Host is unreachable",114:"Socket already connected",115:"Connection already in progress",116:"Stale file handle",122:"Quota exceeded",123:"No medium (in tape drive)",125:"Operation canceled",130:"Previous owner died",131:"State not recoverable"};function ___setErrNo(value){if(Module["___errno_location"])HEAP32[Module["___errno_location"]()>>2]=value;else Module.printErr("failed to set errno from JS");return value}var PATH={splitPath:(function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)}),normalizeArray:(function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up--;up){parts.unshift("..")}}return parts}),normalize:(function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter((function(p){return!!p})),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path}),dirname:(function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir}),basename:(function(path){if(path==="/")return"/";var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)}),extname:(function(path){return PATH.splitPath(path)[3]}),join:(function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))}),join2:(function(l,r){return PATH.normalize(l+"/"+r)}),resolve:(function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter((function(p){return!!p})),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."}),relative:(function(from,to){from=PATH.resolve(from).substr(1);to=PATH.resolve(to).substr(1);function trim(arr){var start=0;for(;start<arr.length;start++){if(arr[start]!=="")break}var end=arr.length-1;for(;end>=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i<length;i++){if(fromParts[i]!==toParts[i]){samePartsLength=i;break}}var outputParts=[];for(var i=samePartsLength;i<fromParts.length;i++){outputParts.push("..")}outputParts=outputParts.concat(toParts.slice(samePartsLength));return outputParts.join("/")})};var TTY={ttys:[],init:(function(){}),shutdown:(function(){}),register:(function(dev,ops){TTY.ttys[dev]={input:[],output:[],ops:ops};FS.registerDevice(dev,TTY.stream_ops)}),stream_ops:{open:(function(stream){var tty=TTY.ttys[stream.node.rdev];if(!tty){throw new FS.ErrnoError(ERRNO_CODES.ENODEV)}stream.tty=tty;stream.seekable=false}),close:(function(stream){stream.tty.ops.flush(stream.tty)}),flush:(function(stream){stream.tty.ops.flush(stream.tty)}),read:(function(stream,buffer,offset,length,pos){if(!stream.tty||!stream.tty.ops.get_char){throw new FS.ErrnoError(ERRNO_CODES.ENXIO)}var bytesRead=0;for(var i=0;i<length;i++){var result;try{result=stream.tty.ops.get_char(stream.tty)}catch(e){throw new FS.ErrnoError(ERRNO_CODES.EIO)}if(result===undefined&&bytesRead===0){throw new FS.ErrnoError(ERRNO_CODES.EAGAIN)}if(result===null||result===undefined)break;bytesRead++;buffer[offset+i]=result}if(bytesRead){stream.node.timestamp=Date.now()}return bytesRead}),write:(function(stream,buffer,offset,length,pos){if(!stream.tty||!stream.tty.ops.put_char){throw new FS.ErrnoError(ERRNO_CODES.ENXIO)}for(var i=0;i<length;i++){try{stream.tty.ops.put_char(stream.tty,buffer[offset+i])}catch(e){throw new FS.ErrnoError(ERRNO_CODES.EIO)}}if(length){stream.node.timestamp=Date.now()}return i})},default_tty_ops:{get_char:(function(tty){if(!tty.input.length){var result=null;if(ENVIRONMENT_IS_NODE){var BUFSIZE=256;var buf=new Buffer(BUFSIZE);var bytesRead=0;var fd=process.stdin.fd;var usingDevice=false;try{fd=fs.openSync("/dev/stdin","r");usingDevice=true}catch(e){}bytesRead=fs.readSync(fd,buf,0,BUFSIZE,null);if(usingDevice){fs.closeSync(fd)}if(bytesRead>0){result=buf.slice(0,bytesRead).toString("utf-8")}else{result=null}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}tty.input=intArrayFromString(result,true)}return tty.input.shift()}),put_char:(function(tty,val){if(val===null||val===10){Module["print"](UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}}),flush:(function(tty){if(tty.output&&tty.output.length>0){Module["print"](UTF8ArrayToString(tty.output,0));tty.output=[]}})},default_tty1_ops:{put_char:(function(tty,val){if(val===null||val===10){Module["printErr"](UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}}),flush:(function(tty){if(tty.output&&tty.output.length>0){Module["printErr"](UTF8ArrayToString(tty.output,0));tty.output=[]}})}};var MEMFS={ops_table:null,mount:(function(mount){return MEMFS.createNode(null,"/",16384|511,0)}),createNode:(function(parent,name,mode,dev){if(FS.isBlkdev(mode)||FS.isFIFO(mode)){throw new FS.ErrnoError(ERRNO_CODES.EPERM)}if(!MEMFS.ops_table){MEMFS.ops_table={dir:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr,lookup:MEMFS.node_ops.lookup,mknod:MEMFS.node_ops.mknod,rename:MEMFS.node_ops.rename,unlink:MEMFS.node_ops.unlink,rmdir:MEMFS.node_ops.rmdir,readdir:MEMFS.node_ops.readdir,symlink:MEMFS.node_ops.symlink},stream:{llseek:MEMFS.stream_ops.llseek}},file:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr},stream:{llseek:MEMFS.stream_ops.llseek,read:MEMFS.stream_ops.read,write:MEMFS.stream_ops.write,allocate:MEMFS.stream_ops.allocate,mmap:MEMFS.stream_ops.mmap,msync:MEMFS.stream_ops.msync}},link:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr,readlink:MEMFS.node_ops.readlink},stream:{}},chrdev:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr},stream:FS.chrdev_stream_ops}}}var node=FS.createNode(parent,name,mode,dev);if(FS.isDir(node.mode)){node.node_ops=MEMFS.ops_table.dir.node;node.stream_ops=MEMFS.ops_table.dir.stream;node.contents={}}else if(FS.isFile(node.mode)){node.node_ops=MEMFS.ops_table.file.node;node.stream_ops=MEMFS.ops_table.file.stream;node.usedBytes=0;node.contents=null}else if(FS.isLink(node.mode)){node.node_ops=MEMFS.ops_table.link.node;node.stream_ops=MEMFS.ops_table.link.stream}else if(FS.isChrdev(node.mode)){node.node_ops=MEMFS.ops_table.chrdev.node;node.stream_ops=MEMFS.ops_table.chrdev.stream}node.timestamp=Date.now();if(parent){parent.contents[name]=node}return node}),getFileDataAsRegularArray:(function(node){if(node.contents&&node.contents.subarray){var arr=[];for(var i=0;i<node.usedBytes;++i)arr.push(node.contents[i]);return arr}return node.contents}),getFileDataAsTypedArray:(function(node){if(!node.contents)return new Uint8Array;if(node.contents.subarray)return node.contents.subarray(0,node.usedBytes);return new Uint8Array(node.contents)}),expandFileStorage:(function(node,newCapacity){if(node.contents&&node.contents.subarray&&newCapacity>node.contents.length){node.contents=MEMFS.getFileDataAsRegularArray(node);node.usedBytes=node.contents.length}if(!node.contents||node.contents.subarray){var prevCapacity=node.contents?node.contents.buffer.byteLength:0;if(prevCapacity>=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity<CAPACITY_DOUBLING_MAX?2:1.125)|0);if(prevCapacity!=0)newCapacity=Math.max(newCapacity,256);var oldContents=node.contents;node.contents=new Uint8Array(newCapacity);if(node.usedBytes>0)node.contents.set(oldContents.subarray(0,node.usedBytes),0);return}if(!node.contents&&newCapacity>0)node.contents=[];while(node.contents.length<newCapacity)node.contents.push(0)}),resizeFileStorage:(function(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0;return}if(!node.contents||node.contents.subarray){var oldContents=node.contents;node.contents=new Uint8Array(new ArrayBuffer(newSize));if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)))}node.usedBytes=newSize;return}if(!node.contents)node.contents=[];if(node.contents.length>newSize)node.contents.length=newSize;else while(node.contents.length<newSize)node.contents.push(0);node.usedBytes=newSize}),node_ops:{getattr:(function(node){var attr={};attr.dev=FS.isChrdev(node.mode)?node.id:1;attr.ino=node.id;attr.mode=node.mode;attr.nlink=1;attr.uid=0;attr.gid=0;attr.rdev=node.rdev;if(FS.isDir(node.mode)){attr.size=4096}else if(FS.isFile(node.mode)){attr.size=node.usedBytes}else if(FS.isLink(node.mode)){attr.size=node.link.length}else{attr.size=0}attr.atime=new Date(node.timestamp);attr.mtime=new Date(node.timestamp);attr.ctime=new Date(node.timestamp);attr.blksize=4096;attr.blocks=Math.ceil(attr.size/attr.blksize);return attr}),setattr:(function(node,attr){if(attr.mode!==undefined){node.mode=attr.mode}if(attr.timestamp!==undefined){node.timestamp=attr.timestamp}if(attr.size!==undefined){MEMFS.resizeFileStorage(node,attr.size)}}),lookup:(function(parent,name){throw FS.genericErrors[ERRNO_CODES.ENOENT]}),mknod:(function(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev)}),rename:(function(old_node,new_dir,new_name){if(FS.isDir(old_node.mode)){var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(new_node){for(var i in new_node.contents){throw new FS.ErrnoError(ERRNO_CODES.ENOTEMPTY)}}}delete old_node.parent.contents[old_node.name];old_node.name=new_name;new_dir.contents[new_name]=old_node;old_node.parent=new_dir}),unlink:(function(parent,name){delete parent.contents[name]}),rmdir:(function(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(ERRNO_CODES.ENOTEMPTY)}delete parent.contents[name]}),readdir:(function(node){var entries=[".",".."];for(var key in node.contents){if(!node.contents.hasOwnProperty(key)){continue}entries.push(key)}return entries}),symlink:(function(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511|40960,0);node.link=oldpath;return node}),readlink:(function(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}return node.link})},stream_ops:{read:(function(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);assert(size>=0);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i<size;i++)buffer[offset+i]=contents[position+i]}return size}),write:(function(stream,buffer,offset,length,position,canOwn){if(!length)return 0;var node=stream.node;node.timestamp=Date.now();if(buffer.subarray&&(!node.contents||node.contents.subarray)){if(canOwn){assert(position===0,"canOwn must imply no weird position inside the file");node.contents=buffer.subarray(offset,offset+length);node.usedBytes=length;return length}else if(node.usedBytes===0&&position===0){node.contents=new Uint8Array(buffer.subarray(offset,offset+length));node.usedBytes=length;return length}else if(position+length<=node.usedBytes){node.contents.set(buffer.subarray(offset,offset+length),position);return length}}MEMFS.expandFileStorage(node,position+length);if(node.contents.subarray&&buffer.subarray)node.contents.set(buffer.subarray(offset,offset+length),position);else{for(var i=0;i<length;i++){node.contents[position+i]=buffer[offset+i]}}node.usedBytes=Math.max(node.usedBytes,position+length);return length}),llseek:(function(stream,offset,whence){var position=offset;if(whence===1){position+=stream.position}else if(whence===2){if(FS.isFile(stream.node.mode)){position+=stream.node.usedBytes}}if(position<0){throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}return position}),allocate:(function(stream,offset,length){MEMFS.expandFileStorage(stream.node,offset+length);stream.node.usedBytes=Math.max(stream.node.usedBytes,offset+length)}),mmap:(function(stream,buffer,offset,length,position,prot,flags){if(!FS.isFile(stream.node.mode)){throw new FS.ErrnoError(ERRNO_CODES.ENODEV)}var ptr;var allocated;var contents=stream.node.contents;if(!(flags&2)&&(contents.buffer===buffer||contents.buffer===buffer.buffer)){allocated=false;ptr=contents.byteOffset}else{if(position>0||position+length<stream.node.usedBytes){if(contents.subarray){contents=contents.subarray(position,position+length)}else{contents=Array.prototype.slice.call(contents,position,position+length)}}allocated=true;ptr=_malloc(length);if(!ptr){throw new FS.ErrnoError(ERRNO_CODES.ENOMEM)}buffer.set(contents,ptr)}return{ptr:ptr,allocated:allocated}}),msync:(function(stream,buffer,offset,length,mmapFlags){if(!FS.isFile(stream.node.mode)){throw new FS.ErrnoError(ERRNO_CODES.ENODEV)}if(mmapFlags&2){return 0}var bytesWritten=MEMFS.stream_ops.write(stream,buffer,0,length,offset,false);return 0})}};var IDBFS={dbs:{},indexedDB:(function(){if(typeof indexedDB!=="undefined")return indexedDB;var ret=null;if(typeof window==="object")ret=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB;assert(ret,"IDBFS used, but indexedDB not supported");return ret}),DB_VERSION:21,DB_STORE_NAME:"FILE_DATA",mount:(function(mount){return MEMFS.mount.apply(null,arguments)}),syncfs:(function(mount,populate,callback){IDBFS.getLocalSet(mount,(function(err,local){if(err)return callback(err);IDBFS.getRemoteSet(mount,(function(err,remote){if(err)return callback(err);var src=populate?remote:local;var dst=populate?local:remote;IDBFS.reconcile(src,dst,callback)}))}))}),getDB:(function(name,callback){var db=IDBFS.dbs[name];if(db){return callback(null,db)}var req;try{req=IDBFS.indexedDB().open(name,IDBFS.DB_VERSION)}catch(e){return callback(e)}req.onupgradeneeded=(function(e){var db=e.target.result;var transaction=e.target.transaction;var fileStore;if(db.objectStoreNames.contains(IDBFS.DB_STORE_NAME)){fileStore=transaction.objectStore(IDBFS.DB_STORE_NAME)}else{fileStore=db.createObjectStore(IDBFS.DB_STORE_NAME)}if(!fileStore.indexNames.contains("timestamp")){fileStore.createIndex("timestamp","timestamp",{unique:false})}});req.onsuccess=(function(){db=req.result;IDBFS.dbs[name]=db;callback(null,db)});req.onerror=(function(e){callback(this.error);e.preventDefault()})}),getLocalSet:(function(mount,callback){var entries={};function isRealDir(p){return p!=="."&&p!==".."}function toAbsolute(root){return(function(p){return PATH.join2(root,p)})}var check=FS.readdir(mount.mountpoint).filter(isRealDir).map(toAbsolute(mount.mountpoint));while(check.length){var path=check.pop();var stat;try{stat=FS.stat(path)}catch(e){return callback(e)}if(FS.isDir(stat.mode)){check.push.apply(check,FS.readdir(path).filter(isRealDir).map(toAbsolute(path)))}entries[path]={timestamp:stat.mtime}}return callback(null,{type:"local",entries:entries})}),getRemoteSet:(function(mount,callback){var entries={};IDBFS.getDB(mount.mountpoint,(function(err,db){if(err)return callback(err);var transaction=db.transaction([IDBFS.DB_STORE_NAME],"readonly");transaction.onerror=(function(e){callback(this.error);e.preventDefault()});var store=transaction.objectStore(IDBFS.DB_STORE_NAME);var index=store.index("timestamp");index.openKeyCursor().onsuccess=(function(event){var cursor=event.target.result;if(!cursor){return callback(null,{type:"remote",db:db,entries:entries})}entries[cursor.primaryKey]={timestamp:cursor.key};cursor.continue()})}))}),loadLocalEntry:(function(path,callback){var stat,node;try{var lookup=FS.lookupPath(path);node=lookup.node;stat=FS.stat(path)}catch(e){return callback(e)}if(FS.isDir(stat.mode)){return callback(null,{timestamp:stat.mtime,mode:stat.mode})}else if(FS.isFile(stat.mode)){node.contents=MEMFS.getFileDataAsTypedArray(node);return callback(null,{timestamp:stat.mtime,mode:stat.mode,contents:node.contents})}else{return callback(new Error("node type not supported"))}}),storeLocalEntry:(function(path,entry,callback){try{if(FS.isDir(entry.mode)){FS.mkdir(path,entry.mode)}else if(FS.isFile(entry.mode)){FS.writeFile(path,entry.contents,{encoding:"binary",canOwn:true})}else{return callback(new Error("node type not supported"))}FS.chmod(path,entry.mode);FS.utime(path,entry.timestamp,entry.timestamp)}catch(e){return callback(e)}callback(null)}),removeLocalEntry:(function(path,callback){try{var lookup=FS.lookupPath(path);var stat=FS.stat(path);if(FS.isDir(stat.mode)){FS.rmdir(path)}else if(FS.isFile(stat.mode)){FS.unlink(path)}}catch(e){return callback(e)}callback(null)}),loadRemoteEntry:(function(store,path,callback){var req=store.get(path);req.onsuccess=(function(event){callback(null,event.target.result)});req.onerror=(function(e){callback(this.error);e.preventDefault()})}),storeRemoteEntry:(function(store,path,entry,callback){var req=store.put(entry,path);req.onsuccess=(function(){callback(null)});req.onerror=(function(e){callback(this.error);e.preventDefault()})}),removeRemoteEntry:(function(store,path,callback){var req=store.delete(path);req.onsuccess=(function(){callback(null)});req.onerror=(function(e){callback(this.error);e.preventDefault()})}),reconcile:(function(src,dst,callback){var total=0;var create=[];Object.keys(src.entries).forEach((function(key){var e=src.entries[key];var e2=dst.entries[key];if(!e2||e.timestamp>e2.timestamp){create.push(key);total++}}));var remove=[];Object.keys(dst.entries).forEach((function(key){var e=dst.entries[key];var e2=src.entries[key];if(!e2){remove.push(key);total++}}));if(!total){return callback(null)}var completed=0;var db=src.type==="remote"?src.db:dst.db;var transaction=db.transaction([IDBFS.DB_STORE_NAME],"readwrite");var store=transaction.objectStore(IDBFS.DB_STORE_NAME);function done(err){if(err){if(!done.errored){done.errored=true;return callback(err)}return}if(++completed>=total){return callback(null)}}transaction.onerror=(function(e){done(this.error);e.preventDefault()});create.sort().forEach((function(path){if(dst.type==="local"){IDBFS.loadRemoteEntry(store,path,(function(err,entry){if(err)return done(err);IDBFS.storeLocalEntry(path,entry,done)}))}else{IDBFS.loadLocalEntry(path,(function(err,entry){if(err)return done(err);IDBFS.storeRemoteEntry(store,path,entry,done)}))}}));remove.sort().reverse().forEach((function(path){if(dst.type==="local"){IDBFS.removeLocalEntry(path,done)}else{IDBFS.removeRemoteEntry(store,path,done)}}))})};var NODEFS={isWindows:false,staticInit:(function(){NODEFS.isWindows=!!process.platform.match(/^win/)}),mount:(function(mount){assert(ENVIRONMENT_IS_NODE);return NODEFS.createNode(null,"/",NODEFS.getMode(mount.opts.root),0)}),createNode:(function(parent,name,mode,dev){if(!FS.isDir(mode)&&!FS.isFile(mode)&&!FS.isLink(mode)){throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}var node=FS.createNode(parent,name,mode);node.node_ops=NODEFS.node_ops;node.stream_ops=NODEFS.stream_ops;return node}),getMode:(function(path){var stat;try{stat=fs.lstatSync(path);if(NODEFS.isWindows){stat.mode=stat.mode|(stat.mode&146)>>1}}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}return stat.mode}),realPath:(function(node){var parts=[];while(node.parent!==node){parts.push(node.name);node=node.parent}parts.push(node.mount.opts.root);parts.reverse();return PATH.join.apply(null,parts)}),flagsToPermissionStringMap:{0:"r",1:"r+",2:"r+",64:"r",65:"r+",66:"r+",129:"rx+",193:"rx+",514:"w+",577:"w",578:"w+",705:"wx",706:"wx+",1024:"a",1025:"a",1026:"a+",1089:"a",1090:"a+",1153:"ax",1154:"ax+",1217:"ax",1218:"ax+",4096:"rs",4098:"rs+"},flagsToPermissionString:(function(flags){flags&=~32768;flags&=~524288;if(flags in NODEFS.flagsToPermissionStringMap){return NODEFS.flagsToPermissionStringMap[flags]}else{throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}}),node_ops:{getattr:(function(node){var path=NODEFS.realPath(node);var stat;try{stat=fs.lstatSync(path)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}if(NODEFS.isWindows&&!stat.blksize){stat.blksize=4096}if(NODEFS.isWindows&&!stat.blocks){stat.blocks=(stat.size+stat.blksize-1)/stat.blksize|0}return{dev:stat.dev,ino:stat.ino,mode:stat.mode,nlink:stat.nlink,uid:stat.uid,gid:stat.gid,rdev:stat.rdev,size:stat.size,atime:stat.atime,mtime:stat.mtime,ctime:stat.ctime,blksize:stat.blksize,blocks:stat.blocks}}),setattr:(function(node,attr){var path=NODEFS.realPath(node);try{if(attr.mode!==undefined){fs.chmodSync(path,attr.mode);node.mode=attr.mode}if(attr.timestamp!==undefined){var date=new Date(attr.timestamp);fs.utimesSync(path,date,date)}if(attr.size!==undefined){fs.truncateSync(path,attr.size)}}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}}),lookup:(function(parent,name){var path=PATH.join2(NODEFS.realPath(parent),name);var mode=NODEFS.getMode(path);return NODEFS.createNode(parent,name,mode)}),mknod:(function(parent,name,mode,dev){var node=NODEFS.createNode(parent,name,mode,dev);var path=NODEFS.realPath(node);try{if(FS.isDir(node.mode)){fs.mkdirSync(path,node.mode)}else{fs.writeFileSync(path,"",{mode:node.mode})}}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}return node}),rename:(function(oldNode,newDir,newName){var oldPath=NODEFS.realPath(oldNode);var newPath=PATH.join2(NODEFS.realPath(newDir),newName);try{fs.renameSync(oldPath,newPath)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}}),unlink:(function(parent,name){var path=PATH.join2(NODEFS.realPath(parent),name);try{fs.unlinkSync(path)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}}),rmdir:(function(parent,name){var path=PATH.join2(NODEFS.realPath(parent),name);try{fs.rmdirSync(path)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}}),readdir:(function(node){var path=NODEFS.realPath(node);try{return fs.readdirSync(path)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}}),symlink:(function(parent,newName,oldPath){var newPath=PATH.join2(NODEFS.realPath(parent),newName);try{fs.symlinkSync(oldPath,newPath)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}}),readlink:(function(node){var path=NODEFS.realPath(node);try{path=fs.readlinkSync(path);path=NODEJS_PATH.relative(NODEJS_PATH.resolve(node.mount.opts.root),path);return path}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}})},stream_ops:{open:(function(stream){var path=NODEFS.realPath(stream.node);try{if(FS.isFile(stream.node.mode)){stream.nfd=fs.openSync(path,NODEFS.flagsToPermissionString(stream.flags))}}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}}),close:(function(stream){try{if(FS.isFile(stream.node.mode)&&stream.nfd){fs.closeSync(stream.nfd)}}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}}),read:(function(stream,buffer,offset,length,position){if(length===0)return 0;var nbuffer=new Buffer(length);var res;try{res=fs.readSync(stream.nfd,nbuffer,0,length,position)}catch(e){throw new FS.ErrnoError(ERRNO_CODES[e.code])}if(res>0){for(var i=0;i<res;i++){buffer[offset+i]=nbuffer[i]}}return res}),write:(function(stream,buffer,offset,length,position){var nbuffer=new Buffer(buffer.subarray(offset,offset+length));var res;try{res=fs.writeSync(stream.nfd,nbuffer,0,length,position)}catch(e){throw new FS.ErrnoError(ERRNO_CODES[e.code])}return res}),llseek:(function(stream,offset,whence){var position=offset;if(whence===1){position+=stream.position}else if(whence===2){if(FS.isFile(stream.node.mode)){try{var stat=fs.fstatSync(stream.nfd);position+=stat.size}catch(e){throw new FS.ErrnoError(ERRNO_CODES[e.code])}}}if(position<0){throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}return position})}};var WORKERFS={DIR_MODE:16895,FILE_MODE:33279,reader:null,mount:(function(mount){assert(ENVIRONMENT_IS_WORKER);if(!WORKERFS.reader)WORKERFS.reader=new FileReaderSync;var root=WORKERFS.createNode(null,"/",WORKERFS.DIR_MODE,0);var createdParents={};function ensureParent(path){var parts=path.split("/");var parent=root;for(var i=0;i<parts.length-1;i++){var curr=parts.slice(0,i+1).join("/");if(!createdParents[curr]){createdParents[curr]=WORKERFS.createNode(parent,parts[i],WORKERFS.DIR_MODE,0)}parent=createdParents[curr]}return parent}function base(path){var parts=path.split("/");return parts[parts.length-1]}Array.prototype.forEach.call(mount.opts["files"]||[],(function(file){WORKERFS.createNode(ensureParent(file.name),base(file.name),WORKERFS.FILE_MODE,0,file,file.lastModifiedDate)}));(mount.opts["blobs"]||[]).forEach((function(obj){WORKERFS.createNode(ensureParent(obj["name"]),base(obj["name"]),WORKERFS.FILE_MODE,0,obj["data"])}));(mount.opts["packages"]||[]).forEach((function(pack){pack["metadata"].files.forEach((function(file){var name=file.filename.substr(1);WORKERFS.createNode(ensureParent(name),base(name),WORKERFS.FILE_MODE,0,pack["blob"].slice(file.start,file.end))}))}));return root}),createNode:(function(parent,name,mode,dev,contents,mtime){var node=FS.createNode(parent,name,mode);node.mode=mode;node.node_ops=WORKERFS.node_ops;node.stream_ops=WORKERFS.stream_ops;node.timestamp=(mtime||new Date).getTime();assert(WORKERFS.FILE_MODE!==WORKERFS.DIR_MODE);if(mode===WORKERFS.FILE_MODE){node.size=contents.size;node.contents=contents}else{node.size=4096;node.contents={}}if(parent){parent.contents[name]=node}return node}),node_ops:{getattr:(function(node){return{dev:1,ino:undefined,mode:node.mode,nlink:1,uid:0,gid:0,rdev:undefined,size:node.size,atime:new Date(node.timestamp),mtime:new Date(node.timestamp),ctime:new Date(node.timestamp),blksize:4096,blocks:Math.ceil(node.size/4096)}}),setattr:(function(node,attr){if(attr.mode!==undefined){node.mode=attr.mode}if(attr.timestamp!==undefined){node.timestamp=attr.timestamp}}),lookup:(function(parent,name){throw new FS.ErrnoError(ERRNO_CODES.ENOENT)}),mknod:(function(parent,name,mode,dev){throw new FS.ErrnoError(ERRNO_CODES.EPERM)}),rename:(function(oldNode,newDir,newName){throw new FS.ErrnoError(ERRNO_CODES.EPERM)}),unlink:(function(parent,name){throw new FS.ErrnoError(ERRNO_CODES.EPERM)}),rmdir:(function(parent,name){throw new FS.ErrnoError(ERRNO_CODES.EPERM)}),readdir:(function(node){throw new FS.ErrnoError(ERRNO_CODES.EPERM)}),symlink:(function(parent,newName,oldPath){throw new FS.ErrnoError(ERRNO_CODES.EPERM)}),readlink:(function(node){throw new FS.ErrnoError(ERRNO_CODES.EPERM)})},stream_ops:{read:(function(stream,buffer,offset,length,position){if(position>=stream.node.size)return 0;var chunk=stream.node.contents.slice(position,position+length);var ab=WORKERFS.reader.readAsArrayBuffer(chunk);buffer.set(new Uint8Array(ab),offset);return chunk.size}),write:(function(stream,buffer,offset,length,position){throw new FS.ErrnoError(ERRNO_CODES.EIO)}),llseek:(function(stream,offset,whence){var position=offset;if(whence===1){position+=stream.position}else if(whence===2){if(FS.isFile(stream.node.mode)){position+=stream.node.size}}if(position<0){throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}return position})}};STATICTOP+=16;STATICTOP+=16;STATICTOP+=16;var FS={root:null,mounts:[],devices:[null],streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:false,ignorePermissions:true,trackingDelegate:{},tracking:{openFlags:{READ:1,WRITE:2}},ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,handleFSError:(function(e){if(!(e instanceof FS.ErrnoError))throw e+" : "+stackTrace();return ___setErrNo(e.errno)}),lookupPath:(function(path,opts){path=PATH.resolve(FS.cwd(),path);opts=opts||{};if(!path)return{path:"",node:null};var defaults={follow_mount:true,recurse_count:0};for(var key in defaults){if(opts[key]===undefined){opts[key]=defaults[key]}}if(opts.recurse_count>8){throw new FS.ErrnoError(ERRNO_CODES.ELOOP)}var parts=PATH.normalizeArray(path.split("/").filter((function(p){return!!p})),false);var current=FS.root;var current_path="/";for(var i=0;i<parts.length;i++){var islast=i===parts.length-1;if(islast&&opts.parent){break}current=FS.lookupNode(current,parts[i]);current_path=PATH.join2(current_path,parts[i]);if(FS.isMountpoint(current)){if(!islast||islast&&opts.follow_mount){current=current.mounted.root}}if(!islast||opts.follow){var count=0;while(FS.isLink(current.mode)){var link=FS.readlink(current_path);current_path=PATH.resolve(PATH.dirname(current_path),link);var lookup=FS.lookupPath(current_path,{recurse_count:opts.recurse_count});current=lookup.node;if(count++>40){throw new FS.ErrnoError(ERRNO_CODES.ELOOP)}}}}return{path:current_path,node:current}}),getPath:(function(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?mount+"/"+path:mount+path}path=path?node.name+"/"+path:node.name;node=node.parent}}),hashName:(function(parentid,name){var hash=0;for(var i=0;i<name.length;i++){hash=(hash<<5)-hash+name.charCodeAt(i)|0}return(parentid+hash>>>0)%FS.nameTable.length}),hashAddNode:(function(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node}),hashRemoveNode:(function(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}}),lookupNode:(function(parent,name){var err=FS.mayLookup(parent);if(err){throw new FS.ErrnoError(err,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)}),createNode:(function(parent,name,mode,rdev){if(!FS.FSNode){FS.FSNode=(function(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev});FS.FSNode.prototype={};var readMode=292|73;var writeMode=146;Object.defineProperties(FS.FSNode.prototype,{read:{get:(function(){return(this.mode&readMode)===readMode}),set:(function(val){val?this.mode|=readMode:this.mode&=~readMode})},write:{get:(function(){return(this.mode&writeMode)===writeMode}),set:(function(val){val?this.mode|=writeMode:this.mode&=~writeMode})},isFolder:{get:(function(){return FS.isDir(this.mode)})},isDevice:{get:(function(){return FS.isChrdev(this.mode)})}})}var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node}),destroyNode:(function(node){FS.hashRemoveNode(node)}),isRoot:(function(node){return node===node.parent}),isMountpoint:(function(node){return!!node.mounted}),isFile:(function(mode){return(mode&61440)===32768}),isDir:(function(mode){return(mode&61440)===16384}),isLink:(function(mode){return(mode&61440)===40960}),isChrdev:(function(mode){return(mode&61440)===8192}),isBlkdev:(function(mode){return(mode&61440)===24576}),isFIFO:(function(mode){return(mode&61440)===4096}),isSocket:(function(mode){return(mode&49152)===49152}),flagModes:{"r":0,"rs":1052672,"r+":2,"w":577,"wx":705,"xw":705,"w+":578,"wx+":706,"xw+":706,"a":1089,"ax":1217,"xa":1217,"a+":1090,"ax+":1218,"xa+":1218},modeStringToFlags:(function(str){var flags=FS.flagModes[str];if(typeof flags==="undefined"){throw new Error("Unknown file open mode: "+str)}return flags}),flagsToPermissionString:(function(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms}),nodePermissions:(function(node,perms){if(FS.ignorePermissions){return 0}if(perms.indexOf("r")!==-1&&!(node.mode&292)){return ERRNO_CODES.EACCES}else if(perms.indexOf("w")!==-1&&!(node.mode&146)){return ERRNO_CODES.EACCES}else if(perms.indexOf("x")!==-1&&!(node.mode&73)){return ERRNO_CODES.EACCES}return 0}),mayLookup:(function(dir){var err=FS.nodePermissions(dir,"x");if(err)return err;if(!dir.node_ops.lookup)return ERRNO_CODES.EACCES;return 0}),mayCreate:(function(dir,name){try{var node=FS.lookupNode(dir,name);return ERRNO_CODES.EEXIST}catch(e){}return FS.nodePermissions(dir,"wx")}),mayDelete:(function(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var err=FS.nodePermissions(dir,"wx");if(err){return err}if(isdir){if(!FS.isDir(node.mode)){return ERRNO_CODES.ENOTDIR}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return ERRNO_CODES.EBUSY}}else{if(FS.isDir(node.mode)){return ERRNO_CODES.EISDIR}}return 0}),mayOpen:(function(node,flags){if(!node){return ERRNO_CODES.ENOENT}if(FS.isLink(node.mode)){return ERRNO_CODES.ELOOP}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return ERRNO_CODES.EISDIR}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))}),MAX_OPEN_FDS:4096,nextfd:(function(fd_start,fd_end){fd_start=fd_start||0;fd_end=fd_end||FS.MAX_OPEN_FDS;for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(ERRNO_CODES.EMFILE)}),getStream:(function(fd){return FS.streams[fd]}),createStream:(function(stream,fd_start,fd_end){if(!FS.FSStream){FS.FSStream=(function(){});FS.FSStream.prototype={};Object.defineProperties(FS.FSStream.prototype,{object:{get:(function(){return this.node}),set:(function(val){this.node=val})},isRead:{get:(function(){return(this.flags&2097155)!==1})},isWrite:{get:(function(){return(this.flags&2097155)!==0})},isAppend:{get:(function(){return this.flags&1024})}})}var newStream=new FS.FSStream;for(var p in stream){newStream[p]=stream[p]}stream=newStream;var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;FS.streams[fd]=stream;return stream}),closeStream:(function(fd){FS.streams[fd]=null}),chrdev_stream_ops:{open:(function(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream)}}),llseek:(function(){throw new FS.ErrnoError(ERRNO_CODES.ESPIPE)})},major:(function(dev){return dev>>8}),minor:(function(dev){return dev&255}),makedev:(function(ma,mi){return ma<<8|mi}),registerDevice:(function(dev,ops){FS.devices[dev]={stream_ops:ops}}),getDevice:(function(dev){return FS.devices[dev]}),getMounts:(function(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts)}return mounts}),syncfs:(function(populate,callback){if(typeof populate==="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){console.log("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work")}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(err){assert(FS.syncFSRequests>0);FS.syncFSRequests--;return callback(err)}function done(err){if(err){if(!done.errored){done.errored=true;return doCallback(err)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach((function(mount){if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)}))}),mount:(function(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(ERRNO_CODES.EBUSY)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(ERRNO_CODES.EBUSY)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(ERRNO_CODES.ENOTDIR)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot}),unmount:(function(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach((function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.indexOf(current.mount)!==-1){FS.destroyNode(current)}current=next}}));node.mounted=null;var idx=node.mount.mounts.indexOf(mount);assert(idx!==-1);node.mount.mounts.splice(idx,1)}),lookup:(function(parent,name){return parent.node_ops.lookup(parent,name)}),mknod:(function(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}var err=FS.mayCreate(parent,name);if(err){throw new FS.ErrnoError(err)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(ERRNO_CODES.EPERM)}return parent.node_ops.mknod(parent,name,mode,dev)}),create:(function(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)}),mkdir:(function(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)}),mkdev:(function(path,mode,dev){if(typeof dev==="undefined"){dev=mode;mode=438}mode|=8192;return FS.mknod(path,mode,dev)}),symlink:(function(oldpath,newpath){if(!PATH.resolve(oldpath)){throw new FS.ErrnoError(ERRNO_CODES.ENOENT)}var lookup=FS.lookupPath(newpath,{parent:true});var parent=lookup.node;if(!parent){throw new FS.ErrnoError(ERRNO_CODES.ENOENT)}var newname=PATH.basename(newpath);var err=FS.mayCreate(parent,newname);if(err){throw new FS.ErrnoError(err)}if(!parent.node_ops.symlink){throw new FS.ErrnoError(ERRNO_CODES.EPERM)}return parent.node_ops.symlink(parent,newname,oldpath)}),rename:(function(old_path,new_path){var old_dirname=PATH.dirname(old_path);var new_dirname=PATH.dirname(new_path);var old_name=PATH.basename(old_path);var new_name=PATH.basename(new_path);var lookup,old_dir,new_dir;try{lookup=FS.lookupPath(old_path,{parent:true});old_dir=lookup.node;lookup=FS.lookupPath(new_path,{parent:true});new_dir=lookup.node}catch(e){throw new FS.ErrnoError(ERRNO_CODES.EBUSY)}if(!old_dir||!new_dir)throw new FS.ErrnoError(ERRNO_CODES.ENOENT);if(old_dir.mount!==new_dir.mount){throw new FS.ErrnoError(ERRNO_CODES.EXDEV)}var old_node=FS.lookupNode(old_dir,old_name);var relative=PATH.relative(old_path,new_dirname);if(relative.charAt(0)!=="."){throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}relative=PATH.relative(new_path,old_dirname);if(relative.charAt(0)!=="."){throw new FS.ErrnoError(ERRNO_CODES.ENOTEMPTY)}var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(old_node===new_node){return}var isdir=FS.isDir(old_node.mode);var err=FS.mayDelete(old_dir,old_name,isdir);if(err){throw new FS.ErrnoError(err)}err=new_node?FS.mayDelete(new_dir,new_name,isdir):FS.mayCreate(new_dir,new_name);if(err){throw new FS.ErrnoError(err)}if(!old_dir.node_ops.rename){throw new FS.ErrnoError(ERRNO_CODES.EPERM)}if(FS.isMountpoint(old_node)||new_node&&FS.isMountpoint(new_node)){throw new FS.ErrnoError(ERRNO_CODES.EBUSY)}if(new_dir!==old_dir){err=FS.nodePermissions(old_dir,"w");if(err){throw new FS.ErrnoError(err)}}try{if(FS.trackingDelegate["willMovePath"]){FS.trackingDelegate["willMovePath"](old_path,new_path)}}catch(e){console.log("FS.trackingDelegate['willMovePath']('"+old_path+"', '"+new_path+"') threw an exception: "+e.message)}FS.hashRemoveNode(old_node);try{old_dir.node_ops.rename(old_node,new_dir,new_name)}catch(e){throw e}finally{FS.hashAddNode(old_node)}try{if(FS.trackingDelegate["onMovePath"])FS.trackingDelegate["onMovePath"](old_path,new_path)}catch(e){console.log("FS.trackingDelegate['onMovePath']('"+old_path+"', '"+new_path+"') threw an exception: "+e.message)}}),rmdir:(function(path){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);var node=FS.lookupNode(parent,name);var err=FS.mayDelete(parent,name,true);if(err){throw new FS.ErrnoError(err)}if(!parent.node_ops.rmdir){throw new FS.ErrnoError(ERRNO_CODES.EPERM)}if(FS.isMountpoint(node)){throw new FS.ErrnoError(ERRNO_CODES.EBUSY)}try{if(FS.trackingDelegate["willDeletePath"]){FS.trackingDelegate["willDeletePath"](path)}}catch(e){console.log("FS.trackingDelegate['willDeletePath']('"+path+"') threw an exception: "+e.message)}parent.node_ops.rmdir(parent,name);FS.destroyNode(node);try{if(FS.trackingDelegate["onDeletePath"])FS.trackingDelegate["onDeletePath"](path)}catch(e){console.log("FS.trackingDelegate['onDeletePath']('"+path+"') threw an exception: "+e.message)}}),readdir:(function(path){var lookup=FS.lookupPath(path,{follow:true});var node=lookup.node;if(!node.node_ops.readdir){throw new FS.ErrnoError(ERRNO_CODES.ENOTDIR)}return node.node_ops.readdir(node)}),unlink:(function(path){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);var node=FS.lookupNode(parent,name);var err=FS.mayDelete(parent,name,false);if(err){if(err===ERRNO_CODES.EISDIR)err=ERRNO_CODES.EPERM;throw new FS.ErrnoError(err)}if(!parent.node_ops.unlink){throw new FS.ErrnoError(ERRNO_CODES.EPERM)}if(FS.isMountpoint(node)){throw new FS.ErrnoError(ERRNO_CODES.EBUSY)}try{if(FS.trackingDelegate["willDeletePath"]){FS.trackingDelegate["willDeletePath"](path)}}catch(e){console.log("FS.trackingDelegate['willDeletePath']('"+path+"') threw an exception: "+e.message)}parent.node_ops.unlink(parent,name);FS.destroyNode(node);try{if(FS.trackingDelegate["onDeletePath"])FS.trackingDelegate["onDeletePath"](path)}catch(e){console.log("FS.trackingDelegate['onDeletePath']('"+path+"') threw an exception: "+e.message)}}),readlink:(function(path){var lookup=FS.lookupPath(path);var link=lookup.node;if(!link){throw new FS.ErrnoError(ERRNO_CODES.ENOENT)}if(!link.node_ops.readlink){throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}return PATH.resolve(FS.getPath(link.parent),link.node_ops.readlink(link))}),stat:(function(path,dontFollow){var lookup=FS.lookupPath(path,{follow:!dontFollow});var node=lookup.node;if(!node){throw new FS.ErrnoError(ERRNO_CODES.ENOENT)}if(!node.node_ops.getattr){throw new FS.ErrnoError(ERRNO_CODES.EPERM)}return node.node_ops.getattr(node)}),lstat:(function(path){return FS.stat(path,true)}),chmod:(function(path,mode,dontFollow){var node;if(typeof path==="string"){var lookup=FS.lookupPath(path,{follow:!dontFollow});node=lookup.node}else{node=path}if(!node.node_ops.setattr){throw new FS.ErrnoError(ERRNO_CODES.EPERM)}node.node_ops.setattr(node,{mode:mode&4095|node.mode&~4095,timestamp:Date.now()})}),lchmod:(function(path,mode){FS.chmod(path,mode,true)}),fchmod:(function(fd,mode){var stream=FS.getStream(fd);if(!stream){throw new FS.ErrnoError(ERRNO_CODES.EBADF)}FS.chmod(stream.node,mode)}),chown:(function(path,uid,gid,dontFollow){var node;if(typeof path==="string"){var lookup=FS.lookupPath(path,{follow:!dontFollow});node=lookup.node}else{node=path}if(!node.node_ops.setattr){throw new FS.ErrnoError(ERRNO_CODES.EPERM)}node.node_ops.setattr(node,{timestamp:Date.now()})}),lchown:(function(path,uid,gid){FS.chown(path,uid,gid,true)}),fchown:(function(fd,uid,gid){var stream=FS.getStream(fd);if(!stream){throw new FS.ErrnoError(ERRNO_CODES.EBADF)}FS.chown(stream.node,uid,gid)}),truncate:(function(path,len){if(len<0){throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}var node;if(typeof path==="string"){var lookup=FS.lookupPath(path,{follow:true});node=lookup.node}else{node=path}if(!node.node_ops.setattr){throw new FS.ErrnoError(ERRNO_CODES.EPERM)}if(FS.isDir(node.mode)){throw new FS.ErrnoError(ERRNO_CODES.EISDIR)}if(!FS.isFile(node.mode)){throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}var err=FS.nodePermissions(node,"w");if(err){throw new FS.ErrnoError(err)}node.node_ops.setattr(node,{size:len,timestamp:Date.now()})}),ftruncate:(function(fd,len){var stream=FS.getStream(fd);if(!stream){throw new FS.ErrnoError(ERRNO_CODES.EBADF)}if((stream.flags&2097155)===0){throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}FS.truncate(stream.node,len)}),utime:(function(path,atime,mtime){var lookup=FS.lookupPath(path,{follow:true});var node=lookup.node;node.node_ops.setattr(node,{timestamp:Math.max(atime,mtime)})}),open:(function(path,flags,mode,fd_start,fd_end){if(path===""){throw new FS.ErrnoError(ERRNO_CODES.ENOENT)}flags=typeof flags==="string"?FS.modeStringToFlags(flags):flags;mode=typeof mode==="undefined"?438:mode;if(flags&64){mode=mode&4095|32768}else{mode=0}var node;if(typeof path==="object"){node=path}else{path=PATH.normalize(path);try{var lookup=FS.lookupPath(path,{follow:!(flags&131072)});node=lookup.node}catch(e){}}var created=false;if(flags&64){if(node){if(flags&128){throw new FS.ErrnoError(ERRNO_CODES.EEXIST)}}else{node=FS.mknod(path,mode,0);created=true}}if(!node){throw new FS.ErrnoError(ERRNO_CODES.ENOENT)}if(FS.isChrdev(node.mode)){flags&=~512}if(flags&65536&&!FS.isDir(node.mode)){throw new FS.ErrnoError(ERRNO_CODES.ENOTDIR)}if(!created){var err=FS.mayOpen(node,flags);if(err){throw new FS.ErrnoError(err)}}if(flags&512){FS.truncate(node,0)}flags&=~(128|512);var stream=FS.createStream({node:node,path:FS.getPath(node),flags:flags,seekable:true,position:0,stream_ops:node.stream_ops,ungotten:[],error:false},fd_start,fd_end);if(stream.stream_ops.open){stream.stream_ops.open(stream)}if(Module["logReadFiles"]&&!(flags&1)){if(!FS.readFiles)FS.readFiles={};if(!(path in FS.readFiles)){FS.readFiles[path]=1;Module["printErr"]("read file: "+path)}}try{if(FS.trackingDelegate["onOpenFile"]){var trackingFlags=0;if((flags&2097155)!==1){trackingFlags|=FS.tracking.openFlags.READ}if((flags&2097155)!==0){trackingFlags|=FS.tracking.openFlags.WRITE}FS.trackingDelegate["onOpenFile"](path,trackingFlags)}}catch(e){console.log("FS.trackingDelegate['onOpenFile']('"+path+"', flags) threw an exception: "+e.message)}return stream}),close:(function(stream){if(stream.getdents)stream.getdents=null;try{if(stream.stream_ops.close){stream.stream_ops.close(stream)}}catch(e){throw e}finally{FS.closeStream(stream.fd)}}),llseek:(function(stream,offset,whence){if(!stream.seekable||!stream.stream_ops.llseek){throw new FS.ErrnoError(ERRNO_CODES.ESPIPE)}stream.position=stream.stream_ops.llseek(stream,offset,whence);stream.ungotten=[];return stream.position}),read:(function(stream,buffer,offset,length,position){if(length<0||position<0){throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}if((stream.flags&2097155)===1){throw new FS.ErrnoError(ERRNO_CODES.EBADF)}if(FS.isDir(stream.node.mode)){throw new FS.ErrnoError(ERRNO_CODES.EISDIR)}if(!stream.stream_ops.read){throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}var seeking=true;if(typeof position==="undefined"){position=stream.position;seeking=false}else if(!stream.seekable){throw new FS.ErrnoError(ERRNO_CODES.ESPIPE)}var bytesRead=stream.stream_ops.read(stream,buffer,offset,length,position);if(!seeking)stream.position+=bytesRead;return bytesRead}),write:(function(stream,buffer,offset,length,position,canOwn){if(length<0||position<0){throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}if((stream.flags&2097155)===0){throw new FS.ErrnoError(ERRNO_CODES.EBADF)}if(FS.isDir(stream.node.mode)){throw new FS.ErrnoError(ERRNO_CODES.EISDIR)}if(!stream.stream_ops.write){throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}if(stream.flags&1024){FS.llseek(stream,0,2)}var seeking=true;if(typeof position==="undefined"){position=stream.position;seeking=false}else if(!stream.seekable){throw new FS.ErrnoError(ERRNO_CODES.ESPIPE)}var bytesWritten=stream.stream_ops.write(stream,buffer,offset,length,position,canOwn);if(!seeking)stream.position+=bytesWritten;try{if(stream.path&&FS.trackingDelegate["onWriteToFile"])FS.trackingDelegate["onWriteToFile"](stream.path)}catch(e){console.log("FS.trackingDelegate['onWriteToFile']('"+path+"') threw an exception: "+e.message)}return bytesWritten}),allocate:(function(stream,offset,length){if(offset<0||length<=0){throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}if((stream.flags&2097155)===0){throw new FS.ErrnoError(ERRNO_CODES.EBADF)}if(!FS.isFile(stream.node.mode)&&!FS.isDir(node.mode)){throw new FS.ErrnoError(ERRNO_CODES.ENODEV)}if(!stream.stream_ops.allocate){throw new FS.ErrnoError(ERRNO_CODES.EOPNOTSUPP)}stream.stream_ops.allocate(stream,offset,length)}),mmap:(function(stream,buffer,offset,length,position,prot,flags){if((stream.flags&2097155)===1){throw new FS.ErrnoError(ERRNO_CODES.EACCES)}if(!stream.stream_ops.mmap){throw new FS.ErrnoError(ERRNO_CODES.ENODEV)}return stream.stream_ops.mmap(stream,buffer,offset,length,position,prot,flags)}),msync:(function(stream,buffer,offset,length,mmapFlags){if(!stream||!stream.stream_ops.msync){return 0}return stream.stream_ops.msync(stream,buffer,offset,length,mmapFlags)}),munmap:(function(stream){return 0}),ioctl:(function(stream,cmd,arg){if(!stream.stream_ops.ioctl){throw new FS.ErrnoError(ERRNO_CODES.ENOTTY)}return stream.stream_ops.ioctl(stream,cmd,arg)}),readFile:(function(path,opts){opts=opts||{};opts.flags=opts.flags||"r";opts.encoding=opts.encoding||"binary";if(opts.encoding!=="utf8"&&opts.encoding!=="binary"){throw new Error('Invalid encoding type "'+opts.encoding+'"')}var ret;var stream=FS.open(path,opts.flags);var stat=FS.stat(path);var length=stat.size;var buf=new Uint8Array(length);FS.read(stream,buf,0,length,0);if(opts.encoding==="utf8"){ret=UTF8ArrayToString(buf,0)}else if(opts.encoding==="binary"){ret=buf}FS.close(stream);return ret}),writeFile:(function(path,data,opts){opts=opts||{};opts.flags=opts.flags||"w";opts.encoding=opts.encoding||"utf8";if(opts.encoding!=="utf8"&&opts.encoding!=="binary"){throw new Error('Invalid encoding type "'+opts.encoding+'"')}var stream=FS.open(path,opts.flags,opts.mode);if(opts.encoding==="utf8"){var buf=new Uint8Array(lengthBytesUTF8(data)+1);var actualNumBytes=stringToUTF8Array(data,buf,0,buf.length);FS.write(stream,buf,0,actualNumBytes,0,opts.canOwn)}else if(opts.encoding==="binary"){FS.write(stream,data,0,data.length,0,opts.canOwn)}FS.close(stream)}),cwd:(function(){return FS.currentPath}),chdir:(function(path){var lookup=FS.lookupPath(path,{follow:true});if(!FS.isDir(lookup.node.mode)){throw new FS.ErrnoError(ERRNO_CODES.ENOTDIR)}var err=FS.nodePermissions(lookup.node,"x");if(err){throw new FS.ErrnoError(err)}FS.currentPath=lookup.path}),createDefaultDirectories:(function(){FS.mkdir("/tmp");FS.mkdir("/home");FS.mkdir("/home/web_user")}),createDefaultDevices:(function(){FS.mkdir("/dev");FS.registerDevice(FS.makedev(1,3),{read:(function(){return 0}),write:(function(stream,buffer,offset,length,pos){return length})});FS.mkdev("/dev/null",FS.makedev(1,3));TTY.register(FS.makedev(5,0),TTY.default_tty_ops);TTY.register(FS.makedev(6,0),TTY.default_tty1_ops);FS.mkdev("/dev/tty",FS.makedev(5,0));FS.mkdev("/dev/tty1",FS.makedev(6,0));var random_device;if(typeof crypto!=="undefined"){var randomBuffer=new Uint8Array(1);random_device=(function(){crypto.getRandomValues(randomBuffer);return randomBuffer[0]})}else if(ENVIRONMENT_IS_NODE){random_device=(function(){return require("crypto").randomBytes(1)[0]})}else{random_device=(function(){return Math.random()*256|0})}FS.createDevice("/dev","random",random_device);FS.createDevice("/dev","urandom",random_device);FS.mkdir("/dev/shm");FS.mkdir("/dev/shm/tmp")}),createSpecialDirectories:(function(){FS.mkdir("/proc");FS.mkdir("/proc/self");FS.mkdir("/proc/self/fd");FS.mount({mount:(function(){var node=FS.createNode("/proc/self","fd",16384|511,73);node.node_ops={lookup:(function(parent,name){var fd=+name;var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(ERRNO_CODES.EBADF);var ret={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:(function(){return stream.path})}};ret.parent=ret;return ret})};return node})},{},"/proc/self/fd")}),createStandardStreams:(function(){if(Module["stdin"]){FS.createDevice("/dev","stdin",Module["stdin"])}else{FS.symlink("/dev/tty","/dev/stdin")}if(Module["stdout"]){FS.createDevice("/dev","stdout",null,Module["stdout"])}else{FS.symlink("/dev/tty","/dev/stdout")}if(Module["stderr"]){FS.createDevice("/dev","stderr",null,Module["stderr"])}else{FS.symlink("/dev/tty1","/dev/stderr")}var stdin=FS.open("/dev/stdin","r");assert(stdin.fd===0,"invalid handle for stdin ("+stdin.fd+")");var stdout=FS.open("/dev/stdout","w");assert(stdout.fd===1,"invalid handle for stdout ("+stdout.fd+")");var stderr=FS.open("/dev/stderr","w");assert(stderr.fd===2,"invalid handle for stderr ("+stderr.fd+")")}),ensureErrnoError:(function(){if(FS.ErrnoError)return;FS.ErrnoError=function ErrnoError(errno,node){this.node=node;this.setErrno=(function(errno){this.errno=errno;for(var key in ERRNO_CODES){if(ERRNO_CODES[key]===errno){this.code=key;break}}});this.setErrno(errno);this.message=ERRNO_MESSAGES[errno];if(this.stack)this.stack=demangleAll(this.stack)};FS.ErrnoError.prototype=new Error;FS.ErrnoError.prototype.constructor=FS.ErrnoError;[ERRNO_CODES.ENOENT].forEach((function(code){FS.genericErrors[code]=new FS.ErrnoError(code);FS.genericErrors[code].stack="<generic error, no stack>"}))}),staticInit:(function(){FS.ensureErrnoError();FS.nameTable=new Array(4096);FS.mount(MEMFS,{},"/");FS.createDefaultDirectories();FS.createDefaultDevices();FS.createSpecialDirectories();FS.filesystems={"MEMFS":MEMFS,"IDBFS":IDBFS,"NODEFS":NODEFS,"WORKERFS":WORKERFS}}),init:(function(input,output,error){assert(!FS.init.initialized,"FS.init was previously called. If you want to initialize later with custom parameters, remove any earlier calls (note that one is automatically added to the generated code)");FS.init.initialized=true;FS.ensureErrnoError();Module["stdin"]=input||Module["stdin"];Module["stdout"]=output||Module["stdout"];Module["stderr"]=error||Module["stderr"];FS.createStandardStreams()}),quit:(function(){FS.init.initialized=false;var fflush=Module["_fflush"];if(fflush)fflush(0);for(var i=0;i<FS.streams.length;i++){var stream=FS.streams[i];if(!stream){continue}FS.close(stream)}}),getMode:(function(canRead,canWrite){var mode=0;if(canRead)mode|=292|73;if(canWrite)mode|=146;return mode}),joinPath:(function(parts,forceRelative){var path=PATH.join.apply(null,parts);if(forceRelative&&path[0]=="/")path=path.substr(1);return path}),absolutePath:(function(relative,base){return PATH.resolve(base,relative)}),standardizePath:(function(path){return PATH.normalize(path)}),findObject:(function(path,dontResolveLastLink){var ret=FS.analyzePath(path,dontResolveLastLink);if(ret.exists){return ret.object}else{___setErrNo(ret.error);return null}}),analyzePath:(function(path,dontResolveLastLink){try{var lookup=FS.lookupPath(path,{follow:!dontResolveLastLink});path=lookup.path}catch(e){}var ret={isRoot:false,exists:false,error:0,name:null,path:null,object:null,parentExists:false,parentPath:null,parentObject:null};try{var lookup=FS.lookupPath(path,{parent:true});ret.parentExists=true;ret.parentPath=lookup.path;ret.parentObject=lookup.node;ret.name=PATH.basename(path);lookup=FS.lookupPath(path,{follow:!dontResolveLastLink});ret.exists=true;ret.path=lookup.path;ret.object=lookup.node;ret.name=lookup.node.name;ret.isRoot=lookup.path==="/"}catch(e){ret.error=e.errno}return ret}),createFolder:(function(parent,name,canRead,canWrite){var path=PATH.join2(typeof parent==="string"?parent:FS.getPath(parent),name);var mode=FS.getMode(canRead,canWrite);return FS.mkdir(path,mode)}),createPath:(function(parent,path,canRead,canWrite){parent=typeof parent==="string"?parent:FS.getPath(parent);var parts=path.split("/").reverse();while(parts.length){var part=parts.pop();if(!part)continue;var current=PATH.join2(parent,part);try{FS.mkdir(current)}catch(e){}parent=current}return current}),createFile:(function(parent,name,properties,canRead,canWrite){var path=PATH.join2(typeof parent==="string"?parent:FS.getPath(parent),name);var mode=FS.getMode(canRead,canWrite);return FS.create(path,mode)}),createDataFile:(function(parent,name,data,canRead,canWrite,canOwn){var path=name?PATH.join2(typeof parent==="string"?parent:FS.getPath(parent),name):parent;var mode=FS.getMode(canRead,canWrite);var node=FS.create(path,mode);if(data){if(typeof data==="string"){var arr=new Array(data.length);for(var i=0,len=data.length;i<len;++i)arr[i]=data.charCodeAt(i);data=arr}FS.chmod(node,mode|146);var stream=FS.open(node,"w");FS.write(stream,data,0,data.length,0,canOwn);FS.close(stream);FS.chmod(node,mode)}return node}),createDevice:(function(parent,name,input,output){var path=PATH.join2(typeof parent==="string"?parent:FS.getPath(parent),name);var mode=FS.getMode(!!input,!!output);if(!FS.createDevice.major)FS.createDevice.major=64;var dev=FS.makedev(FS.createDevice.major++,0);FS.registerDevice(dev,{open:(function(stream){stream.seekable=false}),close:(function(stream){if(output&&output.buffer&&output.buffer.length){output(10)}}),read:(function(stream,buffer,offset,length,pos){var bytesRead=0;for(var i=0;i<length;i++){var result;try{result=input()}catch(e){throw new FS.ErrnoError(ERRNO_CODES.EIO)}if(result===undefined&&bytesRead===0){throw new FS.ErrnoError(ERRNO_CODES.EAGAIN)}if(result===null||result===undefined)break;bytesRead++;buffer[offset+i]=result}if(bytesRead){stream.node.timestamp=Date.now()}return bytesRead}),write:(function(stream,buffer,offset,length,pos){for(var i=0;i<length;i++){try{output(buffer[offset+i])}catch(e){throw new FS.ErrnoError(ERRNO_CODES.EIO)}}if(length){stream.node.timestamp=Date.now()}return i})});return FS.mkdev(path,mode,dev)}),createLink:(function(parent,name,target,canRead,canWrite){var path=PATH.join2(typeof parent==="string"?parent:FS.getPath(parent),name);return FS.symlink(target,path)}),forceLoadFile:(function(obj){if(obj.isDevice||obj.isFolder||obj.link||obj.contents)return true;var success=true;if(typeof XMLHttpRequest!=="undefined"){throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.")}else if(Module["read"]){try{obj.contents=intArrayFromString(Module["read"](obj.url),true);obj.usedBytes=obj.contents.length}catch(e){success=false}}else{throw new Error("Cannot load without read() or XMLHttpRequest.")}if(!success)___setErrNo(ERRNO_CODES.EIO);return success}),createLazyFile:(function(parent,name,url,canRead,canWrite){function LazyUint8Array(){this.lengthKnown=false;this.chunks=[]}LazyUint8Array.prototype.get=function LazyUint8Array_get(idx){if(idx>this.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=(function(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);if(typeof Uint8Array!="undefined")xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}else{return intArrayFromString(xhr.responseText||"",true)}});var lazyArray=this;lazyArray.setDataGetter((function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]==="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]==="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]}));if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;console.log("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};if(typeof XMLHttpRequest!=="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperties(lazyArray,{length:{get:(function(){if(!this.lengthKnown){this.cacheLength()}return this._length})},chunkSize:{get:(function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize})}});var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:(function(){return this.contents.length})}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach((function(key){var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){if(!FS.forceLoadFile(node)){throw new FS.ErrnoError(ERRNO_CODES.EIO)}return fn.apply(null,arguments)}}));stream_ops.read=function stream_ops_read(stream,buffer,offset,length,position){if(!FS.forceLoadFile(node)){throw new FS.ErrnoError(ERRNO_CODES.EIO)}var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);assert(size>=0);if(contents.slice){for(var i=0;i<size;i++){buffer[offset+i]=contents[position+i]}}else{for(var i=0;i<size;i++){buffer[offset+i]=contents.get(position+i)}}return size};node.stream_ops=stream_ops;return node}),createPreloadedFile:(function(parent,name,url,canRead,canWrite,onload,onerror,dontCreateFile,canOwn,preFinish){Browser.init();var fullname=name?PATH.resolve(PATH.join2(parent,name)):parent;var dep=getUniqueRunDependency("cp "+fullname);function processData(byteArray){function finish(byteArray){if(preFinish)preFinish();if(!dontCreateFile){FS.createDataFile(parent,name,byteArray,canRead,canWrite,canOwn)}if(onload)onload();removeRunDependency(dep)}var handled=false;Module["preloadPlugins"].forEach((function(plugin){if(handled)return;if(plugin["canHandle"](fullname)){plugin["handle"](byteArray,fullname,finish,(function(){if(onerror)onerror();removeRunDependency(dep)}));handled=true}}));if(!handled)finish(byteArray)}addRunDependency(dep);if(typeof url=="string"){Browser.asyncLoad(url,(function(byteArray){processData(byteArray)}),onerror)}else{processData(url)}}),indexedDB:(function(){return window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB}),DB_NAME:(function(){return"EM_FS_"+window.location.pathname}),DB_VERSION:20,DB_STORE_NAME:"FILE_DATA",saveFilesToDB:(function(paths,onload,onerror){onload=onload||(function(){});onerror=onerror||(function(){});var indexedDB=FS.indexedDB();try{var openRequest=indexedDB.open(FS.DB_NAME(),FS.DB_VERSION)}catch(e){return onerror(e)}openRequest.onupgradeneeded=function openRequest_onupgradeneeded(){console.log("creating db");var db=openRequest.result;db.createObjectStore(FS.DB_STORE_NAME)};openRequest.onsuccess=function openRequest_onsuccess(){var db=openRequest.result;var transaction=db.transaction([FS.DB_STORE_NAME],"readwrite");var files=transaction.objectStore(FS.DB_STORE_NAME);var ok=0,fail=0,total=paths.length;function finish(){if(fail==0)onload();else onerror()}paths.forEach((function(path){var putRequest=files.put(FS.analyzePath(path).object.contents,path);putRequest.onsuccess=function putRequest_onsuccess(){ok++;if(ok+fail==total)finish()};putRequest.onerror=function putRequest_onerror(){fail++;if(ok+fail==total)finish()}}));transaction.onerror=onerror};openRequest.onerror=onerror}),loadFilesFromDB:(function(paths,onload,onerror){onload=onload||(function(){});onerror=onerror||(function(){});var indexedDB=FS.indexedDB();try{var openRequest=indexedDB.open(FS.DB_NAME(),FS.DB_VERSION)}catch(e){return onerror(e)}openRequest.onupgradeneeded=onerror;openRequest.onsuccess=function openRequest_onsuccess(){var db=openRequest.result;try{var transaction=db.transaction([FS.DB_STORE_NAME],"readonly")}catch(e){onerror(e);return}var files=transaction.objectStore(FS.DB_STORE_NAME);var ok=0,fail=0,total=paths.length;function finish(){if(fail==0)onload();else onerror()}paths.forEach((function(path){var getRequest=files.get(path);getRequest.onsuccess=function getRequest_onsuccess(){if(FS.analyzePath(path).exists){FS.unlink(path)}FS.createDataFile(PATH.dirname(path),PATH.basename(path),getRequest.result,true,true,true);ok++;if(ok+fail==total)finish()};getRequest.onerror=function getRequest_onerror(){fail++;if(ok+fail==total)finish()}}));transaction.onerror=onerror};openRequest.onerror=onerror})};var SYSCALLS={DEFAULT_POLLMASK:5,mappings:{},umask:511,calculateAt:(function(dirfd,path){if(path[0]!=="/"){var dir;if(dirfd===-100){dir=FS.cwd()}else{var dirstream=FS.getStream(dirfd);if(!dirstream)throw new FS.ErrnoError(ERRNO_CODES.EBADF);dir=dirstream.path}path=PATH.join2(dir,path)}return path}),doStat:(function(func,path,buf){try{var stat=func(path)}catch(e){if(e&&e.node&&PATH.normalize(path)!==PATH.normalize(FS.getPath(e.node))){return-ERRNO_CODES.ENOTDIR}throw e}HEAP32[buf>>2]=stat.dev;HEAP32[buf+4>>2]=0;HEAP32[buf+8>>2]=stat.ino;HEAP32[buf+12>>2]=stat.mode;HEAP32[buf+16>>2]=stat.nlink;HEAP32[buf+20>>2]=stat.uid;HEAP32[buf+24>>2]=stat.gid;HEAP32[buf+28>>2]=stat.rdev;HEAP32[buf+32>>2]=0;HEAP32[buf+36>>2]=stat.size;HEAP32[buf+40>>2]=4096;HEAP32[buf+44>>2]=stat.blocks;HEAP32[buf+48>>2]=stat.atime.getTime()/1e3|0;HEAP32[buf+52>>2]=0;HEAP32[buf+56>>2]=stat.mtime.getTime()/1e3|0;HEAP32[buf+60>>2]=0;HEAP32[buf+64>>2]=stat.ctime.getTime()/1e3|0;HEAP32[buf+68>>2]=0;HEAP32[buf+72>>2]=stat.ino;return 0}),doMsync:(function(addr,stream,len,flags){var buffer=new Uint8Array(HEAPU8.subarray(addr,addr+len));FS.msync(stream,buffer,0,len,flags)}),doMkdir:(function(path,mode){path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0}),doMknod:(function(path,mode,dev){switch(mode&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-ERRNO_CODES.EINVAL}FS.mknod(path,mode,dev);return 0}),doReadlink:(function(path,buf,bufsize){if(bufsize<=0)return-ERRNO_CODES.EINVAL;var ret=FS.readlink(path);ret=ret.slice(0,Math.max(0,bufsize));writeStringToMemory(ret,buf,true);return ret.length}),doAccess:(function(path,amode){if(amode&~7){return-ERRNO_CODES.EINVAL}var node;var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms&&FS.nodePermissions(node,perms)){return-ERRNO_CODES.EACCES}return 0}),doDup:(function(path,flags,suggestFD){var suggest=FS.getStream(suggestFD);if(suggest)FS.close(suggest);return FS.open(path,flags,0,suggestFD,suggestFD).fd}),doReadv:(function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i<iovcnt;i++){var ptr=HEAP32[iov+i*8>>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr<len)break}return ret}),doWritev:(function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i<iovcnt;i++){var ptr=HEAP32[iov+i*8>>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr}return ret}),varargs:0,get:(function(varargs){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret}),getStr:(function(){var ret=Pointer_stringify(SYSCALLS.get());return ret}),getStreamFromFD:(function(){var stream=FS.getStream(SYSCALLS.get());if(!stream)throw new FS.ErrnoError(ERRNO_CODES.EBADF);return stream}),getSocketFromFD:(function(){var socket=SOCKFS.getSocket(SYSCALLS.get());if(!socket)throw new FS.ErrnoError(ERRNO_CODES.EBADF);return socket}),getSocketAddress:(function(allowNull){var addrp=SYSCALLS.get(),addrlen=SYSCALLS.get();if(allowNull&&addrp===0)return null;var info=__read_sockaddr(addrp,addrlen);if(info.errno)throw new FS.ErrnoError(info.errno);info.addr=DNS.lookup_addr(info.addr)||info.addr;return info}),get64:(function(){var low=SYSCALLS.get(),high=SYSCALLS.get();if(low>=0)assert(high===0);else assert(high===-1);return low}),getZero:(function(){assert(SYSCALLS.get()===0)})};function ___syscall192(which,varargs){SYSCALLS.varargs=varargs;try{var addr=SYSCALLS.get(),len=SYSCALLS.get(),prot=SYSCALLS.get(),flags=SYSCALLS.get(),fd=SYSCALLS.get(),off=SYSCALLS.get();off<<=12;var ptr;var allocated=false;if(fd===-1){ptr=_malloc(len);if(!ptr)return-ERRNO_CODES.ENOMEM;_memset(ptr,0,len);allocated=true}else{var info=FS.getStream(fd);if(!info)return-ERRNO_CODES.EBADF;var res=FS.mmap(info,HEAPU8,addr,len,off,prot,flags);ptr=res.ptr;allocated=res.allocated}SYSCALLS.mappings[ptr]={malloc:ptr,len:len,allocated:allocated,fd:fd,flags:flags};return ptr}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall195(which,varargs){SYSCALLS.varargs=varargs;try{var path=SYSCALLS.getStr(),buf=SYSCALLS.get();return SYSCALLS.doStat(FS.stat,path,buf)}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall194(which,varargs){SYSCALLS.varargs=varargs;try{var fd=SYSCALLS.get(),zero=SYSCALLS.getZero(),length=SYSCALLS.get64();FS.ftruncate(fd,length);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall197(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(),buf=SYSCALLS.get();return SYSCALLS.doStat(FS.stat,stream.path,buf)}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall202(which,varargs){SYSCALLS.varargs=varargs;try{return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall199(){return ___syscall202.apply(null,arguments)}var cttz_i8=allocate([8,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,6,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,7,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,6,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0],"i8",ALLOC_STATIC);Module["_llvm_cttz_i32"]=_llvm_cttz_i32;Module["___udivmoddi4"]=___udivmoddi4;Module["___remdi3"]=___remdi3;function ___assert_fail(condition,filename,line,func){ABORT=true;throw"Assertion failed: "+Pointer_stringify(condition)+", at: "+[filename?Pointer_stringify(filename):"unknown filename",line,func?Pointer_stringify(func):"unknown function"]+" at "+stackTrace()}function _pthread_mutex_init(){}function ___syscall91(which,varargs){SYSCALLS.varargs=varargs;try{var addr=SYSCALLS.get(),len=SYSCALLS.get();var info=SYSCALLS.mappings[addr];if(!info)return 0;if(len===info.len){var stream=FS.getStream(info.fd);SYSCALLS.doMsync(addr,stream,len,info.flags);FS.munmap(stream);SYSCALLS.mappings[addr]=null;if(info.allocated){_free(info.malloc)}}return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall6(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD();FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall54(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(),op=SYSCALLS.get();switch(op){case 21505:{if(!stream.tty)return-ERRNO_CODES.ENOTTY;return 0};case 21506:{if(!stream.tty)return-ERRNO_CODES.ENOTTY;return 0};case 21519:{if(!stream.tty)return-ERRNO_CODES.ENOTTY;var argp=SYSCALLS.get();HEAP32[argp>>2]=0;return 0};case 21520:{if(!stream.tty)return-ERRNO_CODES.ENOTTY;return-ERRNO_CODES.EINVAL};case 21531:{var argp=SYSCALLS.get();return FS.ioctl(stream,op,argp)};default:abort("bad ioctl syscall "+op)}}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}var ___tm_current=STATICTOP;STATICTOP+=48;var ___tm_timezone=allocate(intArrayFromString("GMT"),"i8",ALLOC_STATIC);var _tzname=STATICTOP;STATICTOP+=16;var _daylight=STATICTOP;STATICTOP+=16;var _timezone=STATICTOP;STATICTOP+=16;function _tzset(){if(_tzset.called)return;_tzset.called=true;HEAP32[_timezone>>2]=-(new Date).getTimezoneOffset()*60;var winter=new Date(2e3,0,1);var summer=new Date(2e3,6,1);HEAP32[_daylight>>2]=Number(winter.getTimezoneOffset()!=summer.getTimezoneOffset());function extractZone(date){var match=date.toTimeString().match(/\(([A-Za-z ]+)\)$/);return match?match[1]:"GMT"}var winterName=extractZone(winter);var summerName=extractZone(summer);var winterNamePtr=allocate(intArrayFromString(winterName),"i8",ALLOC_NORMAL);var summerNamePtr=allocate(intArrayFromString(summerName),"i8",ALLOC_NORMAL);if(summer.getTimezoneOffset()<winter.getTimezoneOffset()){HEAP32[_tzname>>2]=winterNamePtr;HEAP32[_tzname+4>>2]=summerNamePtr}else{HEAP32[_tzname>>2]=summerNamePtr;HEAP32[_tzname+4>>2]=winterNamePtr}}function _localtime_r(time,tmPtr){_tzset();var date=new Date(HEAP32[time>>2]*1e3);HEAP32[tmPtr>>2]=date.getSeconds();HEAP32[tmPtr+4>>2]=date.getMinutes();HEAP32[tmPtr+8>>2]=date.getHours();HEAP32[tmPtr+12>>2]=date.getDate();HEAP32[tmPtr+16>>2]=date.getMonth();HEAP32[tmPtr+20>>2]=date.getFullYear()-1900;HEAP32[tmPtr+24>>2]=date.getDay();var start=new Date(date.getFullYear(),0,1);var yday=(date.getTime()-start.getTime())/(1e3*60*60*24)|0;HEAP32[tmPtr+28>>2]=yday;HEAP32[tmPtr+36>>2]=-(date.getTimezoneOffset()*60);var summerOffset=(new Date(2e3,6,1)).getTimezoneOffset();var winterOffset=start.getTimezoneOffset();var dst=date.getTimezoneOffset()==Math.min(winterOffset,summerOffset)|0;HEAP32[tmPtr+32>>2]=dst;var zonePtr=HEAP32[_tzname+(dst?Runtime.QUANTUM_SIZE:0)>>2];HEAP32[tmPtr+40>>2]=zonePtr;return tmPtr}function _localtime(time){return _localtime_r(time,___tm_current)}function ___syscall77(which,varargs){SYSCALLS.varargs=varargs;try{var who=SYSCALLS.get(),usage=SYSCALLS.get();_memset(usage,0,136);HEAP32[usage>>2]=1;HEAP32[usage+4>>2]=2;HEAP32[usage+8>>2]=3;HEAP32[usage+12>>2]=4;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}Module["_bitshift64Ashr"]=_bitshift64Ashr;Module["_bitshift64Lshr"]=_bitshift64Lshr;function ___syscall33(which,varargs){SYSCALLS.varargs=varargs;try{var path=SYSCALLS.getStr(),amode=SYSCALLS.get();return SYSCALLS.doAccess(path,amode)}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function _pthread_cleanup_push(routine,arg){__ATEXIT__.push((function(){Runtime.dynCall("vi",routine,[arg])}));_pthread_cleanup_push.level=__ATEXIT__.length}var _environ=STATICTOP;STATICTOP+=16;function ___buildEnvironment(env){var MAX_ENV_VALUES=64;var TOTAL_ENV_SIZE=1024;var poolPtr;var envPtr;if(!___buildEnvironment.called){___buildEnvironment.called=true;ENV["USER"]=ENV["LOGNAME"]="web_user";ENV["PATH"]="/";ENV["PWD"]="/";ENV["HOME"]="/home/web_user";ENV["LANG"]="C";ENV["_"]=Module["thisProgram"];poolPtr=allocate(TOTAL_ENV_SIZE,"i8",ALLOC_STATIC);envPtr=allocate(MAX_ENV_VALUES*4,"i8*",ALLOC_STATIC);HEAP32[envPtr>>2]=poolPtr;HEAP32[_environ>>2]=envPtr}else{envPtr=HEAP32[_environ>>2];poolPtr=HEAP32[envPtr>>2]}var strings=[];var totalSize=0;for(var key in env){if(typeof env[key]==="string"){var line=key+"="+env[key];strings.push(line);totalSize+=line.length}}if(totalSize>TOTAL_ENV_SIZE){throw new Error("Environment size exceeded TOTAL_ENV_SIZE!")}var ptrSize=4;for(var i=0;i<strings.length;i++){var line=strings[i];writeAsciiToMemory(line,poolPtr);HEAP32[envPtr+i*ptrSize>>2]=poolPtr;poolPtr+=line.length+1}HEAP32[envPtr+strings.length*ptrSize>>2]=0}var ENV={};function _getenv(name){if(name===0)return 0;name=Pointer_stringify(name);if(!ENV.hasOwnProperty(name))return 0;if(_getenv.ret)_free(_getenv.ret);_getenv.ret=allocate(intArrayFromString(ENV[name]),"i8",ALLOC_NORMAL);return _getenv.ret}function _gettimeofday(ptr){var now=Date.now();HEAP32[ptr>>2]=now/1e3|0;HEAP32[ptr+4>>2]=now%1e3*1e3|0;return 0}Module["_pthread_mutex_unlock"]=_pthread_mutex_unlock;function _emscripten_memcpy_big(dest,src,num){HEAPU8.set(HEAPU8.subarray(src,src+num),dest);return dest}Module["_memcpy"]=_memcpy;function ___syscall191(which,varargs){SYSCALLS.varargs=varargs;try{var resource=SYSCALLS.get(),rlim=SYSCALLS.get();HEAP32[rlim>>2]=-1;HEAP32[rlim+4>>2]=-1;HEAP32[rlim+8>>2]=-1;HEAP32[rlim+12>>2]=-1;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function _sbrk(bytes){var self=_sbrk;if(!self.called){DYNAMICTOP=alignMemoryPage(DYNAMICTOP);self.called=true;assert(Runtime.dynamicAlloc);self.alloc=Runtime.dynamicAlloc;Runtime.dynamicAlloc=(function(){abort("cannot dynamically allocate, sbrk now has control")})}var ret=DYNAMICTOP;if(bytes!=0){var success=self.alloc(bytes);if(!success)return-1>>>0}return ret}Module["_bitshift64Shl"]=_bitshift64Shl;Module["_memmove"]=_memmove;Module["___uremdi3"]=___uremdi3;function ___syscall201(){return ___syscall202.apply(null,arguments)}var PROCINFO={ppid:1,pid:42,sid:42,pgid:42};function ___syscall64(which,varargs){SYSCALLS.varargs=varargs;try{return PROCINFO.ppid}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function _sysconf(name){switch(name){case 30:return PAGE_SIZE;case 85:return totalMemory/PAGE_SIZE;case 132:case 133:case 12:case 137:case 138:case 15:case 235:case 16:case 17:case 18:case 19:case 20:case 149:case 13:case 10:case 236:case 153:case 9:case 21:case 22:case 159:case 154:case 14:case 77:case 78:case 139:case 80:case 81:case 82:case 68:case 67:case 164:case 11:case 29:case 47:case 48:case 95:case 52:case 51:case 46:return 200809;case 79:return 0;case 27:case 246:case 127:case 128:case 23:case 24:case 160:case 161:case 181:case 182:case 242:case 183:case 184:case 243:case 244:case 245:case 165:case 178:case 179:case 49:case 50:case 168:case 169:case 175:case 170:case 171:case 172:case 97:case 76:case 32:case 173:case 35:return-1;case 176:case 177:case 7:case 155:case 8:case 157:case 125:case 126:case 92:case 93:case 129:case 130:case 131:case 94:case 91:return 1;case 74:case 60:case 69:case 70:case 4:return 1024;case 31:case 42:case 72:return 32;case 87:case 26:case 33:return 2147483647;case 34:case 1:return 47839;case 38:case 36:return 99;case 43:case 37:return 2048;case 0:return 2097152;case 3:return 65536;case 28:return 32768;case 44:return 32767;case 75:return 16384;case 39:return 1e3;case 89:return 700;case 71:return 256;case 40:return 255;case 2:return 100;case 180:return 64;case 25:return 20;case 5:return 16;case 6:return 6;case 73:return 4;case 84:{if(typeof navigator==="object")return navigator["hardwareConcurrency"]||1;return 1}}___setErrNo(ERRNO_CODES.EINVAL);return-1}function ___syscall63(which,varargs){SYSCALLS.varargs=varargs;try{var old=SYSCALLS.getStreamFromFD(),suggestFD=SYSCALLS.get();if(old.fd===suggestFD)return suggestFD;return SYSCALLS.doDup(old.path,old.flags,suggestFD)}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall20(which,varargs){SYSCALLS.varargs=varargs;try{return PROCINFO.pid}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}Module["_memset"]=_memset;function ___syscall75(which,varargs){SYSCALLS.varargs=varargs;try{return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function _atexit(func,arg){__ATEXIT__.unshift({func:func,arg:arg})}function _abort(){Module["abort"]()}function _pthread_mutex_destroy(){}Module["___divdi3"]=___divdi3;function ___lock(){}function ___unlock(){}function _clock(){if(_clock.start===undefined)_clock.start=Date.now();return(Date.now()-_clock.start)*(1e6/1e3)|0}Module["_llvm_bswap_i32"]=_llvm_bswap_i32;function ___syscall10(which,varargs){SYSCALLS.varargs=varargs;try{var path=SYSCALLS.getStr();FS.unlink(path);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall3(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(),buf=SYSCALLS.get(),count=SYSCALLS.get();return FS.read(stream,HEAP8,buf,count)}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall5(which,varargs){SYSCALLS.varargs=varargs;try{var pathname=SYSCALLS.getStr(),flags=SYSCALLS.get(),mode=SYSCALLS.get();var stream=FS.open(pathname,flags,mode);return stream.fd}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall4(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(),buf=SYSCALLS.get(),count=SYSCALLS.get();return FS.write(stream,HEAP8,buf,count)}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function _llvm_stackrestore(p){var self=_llvm_stacksave;var ret=self.LLVM_SAVEDSTACKS[p];self.LLVM_SAVEDSTACKS.splice(p,1);Runtime.stackRestore(ret)}Module["___udivdi3"]=___udivdi3;Module["___muldsi3"]=___muldsi3;Module["___muldi3"]=___muldi3;function _llvm_stacksave(){var self=_llvm_stacksave;if(!self.LLVM_SAVEDSTACKS){self.LLVM_SAVEDSTACKS=[]}self.LLVM_SAVEDSTACKS.push(Runtime.stackSave());return self.LLVM_SAVEDSTACKS.length-1}function _pthread_cleanup_pop(){assert(_pthread_cleanup_push.level==__ATEXIT__.length,"cannot pop if something else added meanwhile!");__ATEXIT__.pop();_pthread_cleanup_push.level=__ATEXIT__.length}function ___syscall340(which,varargs){SYSCALLS.varargs=varargs;try{var pid=SYSCALLS.get(),resource=SYSCALLS.get(),new_limit=SYSCALLS.get(),old_limit=SYSCALLS.get();if(old_limit){HEAP32[old_limit>>2]=-1;HEAP32[old_limit+4>>2]=-1;HEAP32[old_limit+8>>2]=-1;HEAP32[old_limit+12>>2]=-1}return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function __isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0)}function __arraySum(array,index){var sum=0;for(var i=0;i<=index;sum+=array[i++]);return sum}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];var __MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(date,days){var newDate=new Date(date.getTime());while(days>0){var leap=__isLeapYear(newDate.getFullYear());var currentMonth=newDate.getMonth();var daysInCurrentMonth=(leap?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[currentMonth];if(days>daysInCurrentMonth-newDate.getDate()){days-=daysInCurrentMonth-newDate.getDate()+1;newDate.setDate(1);if(currentMonth<11){newDate.setMonth(currentMonth+1)}else{newDate.setMonth(0);newDate.setFullYear(newDate.getFullYear()+1)}}else{newDate.setDate(newDate.getDate()+days);return newDate}}return newDate}function _strftime(s,maxsize,format,tm){var tm_zone=HEAP32[tm+40>>2];var date={tm_sec:HEAP32[tm>>2],tm_min:HEAP32[tm+4>>2],tm_hour:HEAP32[tm+8>>2],tm_mday:HEAP32[tm+12>>2],tm_mon:HEAP32[tm+16>>2],tm_year:HEAP32[tm+20>>2],tm_wday:HEAP32[tm+24>>2],tm_yday:HEAP32[tm+28>>2],tm_isdst:HEAP32[tm+32>>2],tm_gmtoff:HEAP32[tm+36>>2],tm_zone:tm_zone?Pointer_stringify(tm_zone):""};var pattern=Pointer_stringify(format);var EXPANSION_RULES_1={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S"};for(var rule in EXPANSION_RULES_1){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_1[rule])}var WEEKDAYS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(value,digits,character){var str=typeof value==="number"?value.toString():value||"";while(str.length<digits){str=character[0]+str}return str}function leadingNulls(value,digits){return leadingSomething(value,digits,"0")}function compareByDay(date1,date2){function sgn(value){return value<0?-1:value>0?1:0}var compare;if((compare=sgn(date1.getFullYear()-date2.getFullYear()))===0){if((compare=sgn(date1.getMonth()-date2.getMonth()))===0){compare=sgn(date1.getDate()-date2.getDate())}}return compare}function getFirstWeekStartDate(janFourth){switch(janFourth.getDay()){case 0:return new Date(janFourth.getFullYear()-1,11,29);case 1:return janFourth;case 2:return new Date(janFourth.getFullYear(),0,3);case 3:return new Date(janFourth.getFullYear(),0,2);case 4:return new Date(janFourth.getFullYear(),0,1);case 5:return new Date(janFourth.getFullYear()-1,11,31);case 6:return new Date(janFourth.getFullYear()-1,11,30)}}function getWeekBasedYear(date){var thisDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);var janFourthThisYear=new Date(thisDate.getFullYear(),0,4);var janFourthNextYear=new Date(thisDate.getFullYear()+1,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);if(compareByDay(firstWeekStartThisYear,thisDate)<=0){if(compareByDay(firstWeekStartNextYear,thisDate)<=0){return thisDate.getFullYear()+1}else{return thisDate.getFullYear()}}else{return thisDate.getFullYear()-1}}var EXPANSION_RULES_2={"%a":(function(date){return WEEKDAYS[date.tm_wday].substring(0,3)}),"%A":(function(date){return WEEKDAYS[date.tm_wday]}),"%b":(function(date){return MONTHS[date.tm_mon].substring(0,3)}),"%B":(function(date){return MONTHS[date.tm_mon]}),"%C":(function(date){var year=date.tm_year+1900;return leadingNulls(year/100|0,2)}),"%d":(function(date){return leadingNulls(date.tm_mday,2)}),"%e":(function(date){return leadingSomething(date.tm_mday,2," ")}),"%g":(function(date){return getWeekBasedYear(date).toString().substring(2)}),"%G":(function(date){return getWeekBasedYear(date)}),"%H":(function(date){return leadingNulls(date.tm_hour,2)}),"%I":(function(date){var twelveHour=date.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2)}),"%j":(function(date){return leadingNulls(date.tm_mday+__arraySum(__isLeapYear(date.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,date.tm_mon-1),3)}),"%m":(function(date){return leadingNulls(date.tm_mon+1,2)}),"%M":(function(date){return leadingNulls(date.tm_min,2)}),"%n":(function(){return"\n"}),"%p":(function(date){if(date.tm_hour>=0&&date.tm_hour<12){return"AM"}else{return"PM"}}),"%S":(function(date){return leadingNulls(date.tm_sec,2)}),"%t":(function(){return"\t"}),"%u":(function(date){var day=new Date(date.tm_year+1900,date.tm_mon+1,date.tm_mday,0,0,0,0);return day.getDay()||7}),"%U":(function(date){var janFirst=new Date(date.tm_year+1900,0,1);var firstSunday=janFirst.getDay()===0?janFirst:__addDays(janFirst,7-janFirst.getDay());var endDate=new Date(date.tm_year+1900,date.tm_mon,date.tm_mday);if(compareByDay(firstSunday,endDate)<0){var februaryFirstUntilEndMonth=__arraySum(__isLeapYear(endDate.getFullYear())?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,endDate.getMonth()-1)-31;var firstSundayUntilEndJanuary=31-firstSunday.getDate();var days=firstSundayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();return leadingNulls(Math.ceil(days/7),2)}return compareByDay(firstSunday,janFirst)===0?"01":"00"}),"%V":(function(date){var janFourthThisYear=new Date(date.tm_year+1900,0,4);var janFourthNextYear=new Date(date.tm_year+1901,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);var endDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);if(compareByDay(endDate,firstWeekStartThisYear)<0){return"53"}if(compareByDay(firstWeekStartNextYear,endDate)<=0){return"01"}var daysDifference;if(firstWeekStartThisYear.getFullYear()<date.tm_year+1900){daysDifference=date.tm_yday+32-firstWeekStartThisYear.getDate()}else{daysDifference=date.tm_yday+1-firstWeekStartThisYear.getDate()}return leadingNulls(Math.ceil(daysDifference/7),2)}),"%w":(function(date){var day=new Date(date.tm_year+1900,date.tm_mon+1,date.tm_mday,0,0,0,0);return day.getDay()}),"%W":(function(date){var janFirst=new Date(date.tm_year,0,1);var firstMonday=janFirst.getDay()===1?janFirst:__addDays(janFirst,janFirst.getDay()===0?1:7-janFirst.getDay()+1);var endDate=new Date(date.tm_year+1900,date.tm_mon,date.tm_mday);if(compareByDay(firstMonday,endDate)<0){var februaryFirstUntilEndMonth=__arraySum(__isLeapYear(endDate.getFullYear())?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,endDate.getMonth()-1)-31;var firstMondayUntilEndJanuary=31-firstMonday.getDate();var days=firstMondayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();return leadingNulls(Math.ceil(days/7),2)}return compareByDay(firstMonday,janFirst)===0?"01":"00"}),"%y":(function(date){return(date.tm_year+1900).toString().substring(2)}),"%Y":(function(date){return date.tm_year+1900}),"%z":(function(date){var off=date.tm_gmtoff;var ahead=off>=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4)}),"%Z":(function(date){return date.tm_zone}),"%%":(function(){return"%"})};for(var rule in EXPANSION_RULES_2){if(pattern.indexOf(rule)>=0){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date))}}var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1}function _time(ptr){var ret=Date.now()/1e3|0;if(ptr){HEAP32[ptr>>2]=ret}return ret}function ___syscall142(which,varargs){SYSCALLS.varargs=varargs;try{var nfds=SYSCALLS.get(),readfds=SYSCALLS.get(),writefds=SYSCALLS.get(),exceptfds=SYSCALLS.get(),timeout=SYSCALLS.get();assert(nfds<=64,"nfds must be less than or equal to 64");assert(!exceptfds,"exceptfds not supported");var total=0;var srcReadLow=readfds?HEAP32[readfds>>2]:0,srcReadHigh=readfds?HEAP32[readfds+4>>2]:0;var srcWriteLow=writefds?HEAP32[writefds>>2]:0,srcWriteHigh=writefds?HEAP32[writefds+4>>2]:0;var srcExceptLow=exceptfds?HEAP32[exceptfds>>2]:0,srcExceptHigh=exceptfds?HEAP32[exceptfds+4>>2]:0;var dstReadLow=0,dstReadHigh=0;var dstWriteLow=0,dstWriteHigh=0;var dstExceptLow=0,dstExceptHigh=0;var allLow=(readfds?HEAP32[readfds>>2]:0)|(writefds?HEAP32[writefds>>2]:0)|(exceptfds?HEAP32[exceptfds>>2]:0);var allHigh=(readfds?HEAP32[readfds+4>>2]:0)|(writefds?HEAP32[writefds+4>>2]:0)|(exceptfds?HEAP32[exceptfds+4>>2]:0);function check(fd,low,high,val){return fd<32?low&val:high&val}for(var fd=0;fd<nfds;fd++){var mask=1<<fd%32;if(!check(fd,allLow,allHigh,mask)){continue}var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(ERRNO_CODES.EBADF);var flags=SYSCALLS.DEFAULT_POLLMASK;if(stream.stream_ops.poll){flags=stream.stream_ops.poll(stream)}if(flags&1&&check(fd,srcReadLow,srcReadHigh,mask)){fd<32?dstReadLow=dstReadLow|mask:dstReadHigh=dstReadHigh|mask;total++}if(flags&4&&check(fd,srcWriteLow,srcWriteHigh,mask)){fd<32?dstWriteLow=dstWriteLow|mask:dstWriteHigh=dstWriteHigh|mask;total++}if(flags&2&&check(fd,srcExceptLow,srcExceptHigh,mask)){fd<32?dstExceptLow=dstExceptLow|mask:dstExceptHigh=dstExceptHigh|mask;total++}}if(readfds){HEAP32[readfds>>2]=dstReadLow;HEAP32[readfds+4>>2]=dstReadHigh}if(writefds){HEAP32[writefds>>2]=dstWriteLow;HEAP32[writefds+4>>2]=dstWriteHigh}if(exceptfds){HEAP32[exceptfds>>2]=dstExceptLow;HEAP32[exceptfds+4>>2]=dstExceptHigh}return total}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}Module["_pthread_self"]=_pthread_self;function ___syscall140(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(),offset_high=SYSCALLS.get(),offset_low=SYSCALLS.get(),result=SYSCALLS.get(),whence=SYSCALLS.get();var offset=offset_low;assert(offset_high===0);FS.llseek(stream,offset,whence);HEAP32[result>>2]=stream.position;if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall146(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(),iov=SYSCALLS.get(),iovcnt=SYSCALLS.get();return SYSCALLS.doWritev(stream,iov,iovcnt)}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall221(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(),cmd=SYSCALLS.get();switch(cmd){case 0:{var arg=SYSCALLS.get();if(arg<0){return-ERRNO_CODES.EINVAL}var newStream;newStream=FS.open(stream.path,stream.flags,0,arg);return newStream.fd};case 1:case 2:return 0;case 3:return stream.flags;case 4:{var arg=SYSCALLS.get();stream.flags|=arg;return 0};case 12:case 12:{var arg=SYSCALLS.get();var offset=0;HEAP16[arg+offset>>1]=2;return 0};case 13:case 14:case 13:case 14:return 0;case 16:case 8:return-ERRNO_CODES.EINVAL;case 9:___setErrNo(ERRNO_CODES.EINVAL);return-1;default:{return-ERRNO_CODES.EINVAL}}}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall145(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(),iov=SYSCALLS.get(),iovcnt=SYSCALLS.get();return SYSCALLS.doReadv(stream,iov,iovcnt)}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}FS.staticInit();__ATINIT__.unshift((function(){if(!Module["noFSInit"]&&!FS.init.initialized)FS.init()}));__ATMAIN__.push((function(){FS.ignorePermissions=false}));__ATEXIT__.push((function(){FS.quit()}));Module["FS_createFolder"]=FS.createFolder;Module["FS_createPath"]=FS.createPath;Module["FS_createDataFile"]=FS.createDataFile;Module["FS_createPreloadedFile"]=FS.createPreloadedFile;Module["FS_createLazyFile"]=FS.createLazyFile;Module["FS_createLink"]=FS.createLink;Module["FS_createDevice"]=FS.createDevice;Module["FS_unlink"]=FS.unlink;__ATINIT__.unshift((function(){TTY.init()}));__ATEXIT__.push((function(){TTY.shutdown()}));if(ENVIRONMENT_IS_NODE){var fs=require("fs");var NODEJS_PATH=require("path");NODEFS.staticInit()}___buildEnvironment(ENV);STACK_BASE=STACKTOP=Runtime.alignMemory(STATICTOP);staticSealed=true;STACK_MAX=STACK_BASE+TOTAL_STACK;DYNAMIC_BASE=DYNAMICTOP=Runtime.alignMemory(STACK_MAX);assert(DYNAMIC_BASE<TOTAL_MEMORY,"TOTAL_MEMORY not big enough for stack");function nullFunc_iiii(x){Module["printErr"]("Invalid function pointer called with signature 'iiii'. Perhaps this is an invalid value (e.g. caused by calling a virtual method on a NULL pointer)? Or calling a function with an incorrect type, which will fail? (it is worth building your source files with -Werror (warnings are errors), as warnings can indicate undefined behavior which can cause this)");Module["printErr"]("Build with ASSERTIONS=2 for more info.");abort(x)}function nullFunc_viiiii(x){Module["printErr"]("Invalid function pointer called with signature 'viiiii'. Perhaps this is an invalid value (e.g. caused by calling a virtual method on a NULL pointer)? Or calling a function with an incorrect type, which will fail? (it is worth building your source files with -Werror (warnings are errors), as warnings can indicate undefined behavior which can cause this)");Module["printErr"]("Build with ASSERTIONS=2 for more info.");abort(x)}function nullFunc_vi(x){Module["printErr"]("Invalid function pointer called with signature 'vi'. Perhaps this is an invalid value (e.g. caused by calling a virtual method on a NULL pointer)? Or calling a function with an incorrect type, which will fail? (it is worth building your source files with -Werror (warnings are errors), as warnings can indicate undefined behavior which can cause this)");Module["printErr"]("Build with ASSERTIONS=2 for more info.");abort(x)}function nullFunc_vii(x){Module["printErr"]("Invalid function pointer called with signature 'vii'. Perhaps this is an invalid value (e.g. caused by calling a virtual method on a NULL pointer)? Or calling a function with an incorrect type, which will fail? (it is worth building your source files with -Werror (warnings are errors), as warnings can indicate undefined behavior which can cause this)");Module["printErr"]("Build with ASSERTIONS=2 for more info.");abort(x)}function nullFunc_ii(x){Module["printErr"]("Invalid function pointer called with signature 'ii'. Perhaps this is an invalid value (e.g. caused by calling a virtual method on a NULL pointer)? Or calling a function with an incorrect type, which will fail? (it is worth building your source files with -Werror (warnings are errors), as warnings can indicate undefined behavior which can cause this)");Module["printErr"]("Build with ASSERTIONS=2 for more info.");abort(x)}function nullFunc_viii(x){Module["printErr"]("Invalid function pointer called with signature 'viii'. Perhaps this is an invalid value (e.g. caused by calling a virtual method on a NULL pointer)? Or calling a function with an incorrect type, which will fail? (it is worth building your source files with -Werror (warnings are errors), as warnings can indicate undefined behavior which can cause this)");Module["printErr"]("Build with ASSERTIONS=2 for more info.");abort(x)}function nullFunc_v(x){Module["printErr"]("Invalid function pointer called with signature 'v'. Perhaps this is an invalid value (e.g. caused by calling a virtual method on a NULL pointer)? Or calling a function with an incorrect type, which will fail? (it is worth building your source files with -Werror (warnings are errors), as warnings can indicate undefined behavior which can cause this)");Module["printErr"]("Build with ASSERTIONS=2 for more info.");abort(x)}function nullFunc_iiiii(x){Module["printErr"]("Invalid function pointer called with signature 'iiiii'. Perhaps this is an invalid value (e.g. caused by calling a virtual method on a NULL pointer)? Or calling a function with an incorrect type, which will fail? (it is worth building your source files with -Werror (warnings are errors), as warnings can indicate undefined behavior which can cause this)");Module["printErr"]("Build with ASSERTIONS=2 for more info.");abort(x)}function nullFunc_viiiiii(x){Module["printErr"]("Invalid function pointer called with signature 'viiiiii'. Perhaps this is an invalid value (e.g. caused by calling a virtual method on a NULL pointer)? Or calling a function with an incorrect type, which will fail? (it is worth building your source files with -Werror (warnings are errors), as warnings can indicate undefined behavior which can cause this)");Module["printErr"]("Build with ASSERTIONS=2 for more info.");abort(x)}function nullFunc_iii(x){Module["printErr"]("Invalid function pointer called with signature 'iii'. Perhaps this is an invalid value (e.g. caused by calling a virtual method on a NULL pointer)? Or calling a function with an incorrect type, which will fail? (it is worth building your source files with -Werror (warnings are errors), as warnings can indicate undefined behavior which can cause this)");Module["printErr"]("Build with ASSERTIONS=2 for more info.");abort(x)}function nullFunc_viiii(x){Module["printErr"]("Invalid function pointer called with signature 'viiii'. Perhaps this is an invalid value (e.g. caused by calling a virtual method on a NULL pointer)? Or calling a function with an incorrect type, which will fail? (it is worth building your source files with -Werror (warnings are errors), as warnings can indicate undefined behavior which can cause this)");Module["printErr"]("Build with ASSERTIONS=2 for more info.");abort(x)}function invoke_iiii(index,a1,a2,a3){try{return Module["dynCall_iiii"](index,a1,a2,a3)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;asm["setThrew"](1,0)}}function invoke_viiiii(index,a1,a2,a3,a4,a5){try{Module["dynCall_viiiii"](index,a1,a2,a3,a4,a5)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;asm["setThrew"](1,0)}}function invoke_vi(index,a1){try{Module["dynCall_vi"](index,a1)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;asm["setThrew"](1,0)}}function invoke_vii(index,a1,a2){try{Module["dynCall_vii"](index,a1,a2)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;asm["setThrew"](1,0)}}function invoke_ii(index,a1){try{return Module["dynCall_ii"](index,a1)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;asm["setThrew"](1,0)}}function invoke_viii(index,a1,a2,a3){try{Module["dynCall_viii"](index,a1,a2,a3)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;asm["setThrew"](1,0)}}function invoke_v(index){try{Module["dynCall_v"](index)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;asm["setThrew"](1,0)}}function invoke_iiiii(index,a1,a2,a3,a4){try{return Module["dynCall_iiiii"](index,a1,a2,a3,a4)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;asm["setThrew"](1,0)}}function invoke_viiiiii(index,a1,a2,a3,a4,a5,a6){try{Module["dynCall_viiiiii"](index,a1,a2,a3,a4,a5,a6)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;asm["setThrew"](1,0)}}function invoke_iii(index,a1,a2){try{return Module["dynCall_iii"](index,a1,a2)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;asm["setThrew"](1,0)}}function invoke_viiii(index,a1,a2,a3,a4){try{Module["dynCall_viiii"](index,a1,a2,a3,a4)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;asm["setThrew"](1,0)}}Module.asmGlobalArg={"Math":Math,"Int8Array":Int8Array,"Int16Array":Int16Array,"Int32Array":Int32Array,"Uint8Array":Uint8Array,"Uint16Array":Uint16Array,"Uint32Array":Uint32Array,"Float32Array":Float32Array,"Float64Array":Float64Array,"NaN":NaN,"Infinity":Infinity};Module.asmLibraryArg={"abort":abort,"assert":assert,"abortStackOverflow":abortStackOverflow,"nullFunc_iiii":nullFunc_iiii,"nullFunc_viiiii":nullFunc_viiiii,"nullFunc_vi":nullFunc_vi,"nullFunc_vii":nullFunc_vii,"nullFunc_ii":nullFunc_ii,"nullFunc_viii":nullFunc_viii,"nullFunc_v":nullFunc_v,"nullFunc_iiiii":nullFunc_iiiii,"nullFunc_viiiiii":nullFunc_viiiiii,"nullFunc_iii":nullFunc_iii,"nullFunc_viiii":nullFunc_viiii,"invoke_iiii":invoke_iiii,"invoke_viiiii":invoke_viiiii,"invoke_vi":invoke_vi,"invoke_vii":invoke_vii,"invoke_ii":invoke_ii,"invoke_viii":invoke_viii,"invoke_v":invoke_v,"invoke_iiiii":invoke_iiiii,"invoke_viiiiii":invoke_viiiiii,"invoke_iii":invoke_iii,"invoke_viiii":invoke_viiii,"_pthread_cleanup_pop":_pthread_cleanup_pop,"___syscall221":___syscall221,"_pthread_mutex_init":_pthread_mutex_init,"___syscall64":___syscall64,"___syscall63":___syscall63,"___syscall6":___syscall6,"___syscall202":___syscall202,"_pthread_cleanup_push":_pthread_cleanup_push,"___syscall20":___syscall20,"_llvm_stackrestore":_llvm_stackrestore,"___assert_fail":___assert_fail,"___buildEnvironment":___buildEnvironment,"__addDays":__addDays,"_localtime_r":_localtime_r,"_tzset":_tzset,"___setErrNo":___setErrNo,"_sbrk":_sbrk,"___syscall192":___syscall192,"___syscall191":___syscall191,"___syscall197":___syscall197,"___syscall195":___syscall195,"___syscall194":___syscall194,"___syscall199":___syscall199,"_sysconf":_sysconf,"_strftime":_strftime,"_clock":_clock,"__arraySum":__arraySum,"_emscripten_memcpy_big":_emscripten_memcpy_big,"___syscall91":___syscall91,"___syscall75":___syscall75,"_pthread_mutex_destroy":_pthread_mutex_destroy,"_llvm_stacksave":_llvm_stacksave,"___syscall77":___syscall77,"_getenv":_getenv,"___syscall33":___syscall33,"___syscall54":___syscall54,"___unlock":___unlock,"__isLeapYear":__isLeapYear,"___syscall10":___syscall10,"___syscall3":___syscall3,"___syscall340":___syscall340,"___lock":___lock,"_abort":_abort,"___syscall5":___syscall5,"___syscall4":___syscall4,"_time":_time,"_gettimeofday":_gettimeofday,"___syscall201":___syscall201,"_atexit":_atexit,"___syscall140":___syscall140,"_localtime":_localtime,"___syscall142":___syscall142,"___syscall145":___syscall145,"___syscall146":___syscall146,"STACKTOP":STACKTOP,"STACK_MAX":STACK_MAX,"tempDoublePtr":tempDoublePtr,"ABORT":ABORT,"cttz_i8":cttz_i8};// EMSCRIPTEN_START_ASM
+var asm=(function(global,env,buffer) {
+"use asm";var a=new global.Int8Array(buffer);var b=new global.Int16Array(buffer);var c=new global.Int32Array(buffer);var d=new global.Uint8Array(buffer);var e=new global.Uint16Array(buffer);var f=new global.Uint32Array(buffer);var g=new global.Float32Array(buffer);var h=new global.Float64Array(buffer);var i=env.STACKTOP|0;var j=env.STACK_MAX|0;var k=env.tempDoublePtr|0;var l=env.ABORT|0;var m=env.cttz_i8|0;var n=0;var o=0;var p=0;var q=0;var r=global.NaN,s=global.Infinity;var t=0,u=0,v=0,w=0,x=0.0,y=0,z=0,A=0,B=0.0;var C=0;var D=global.Math.floor;var E=global.Math.abs;var F=global.Math.sqrt;var G=global.Math.pow;var H=global.Math.cos;var I=global.Math.sin;var J=global.Math.tan;var K=global.Math.acos;var L=global.Math.asin;var M=global.Math.atan;var N=global.Math.atan2;var O=global.Math.exp;var P=global.Math.log;var Q=global.Math.ceil;var R=global.Math.imul;var S=global.Math.min;var T=global.Math.clz32;var U=env.abort;var V=env.assert;var W=env.abortStackOverflow;var X=env.nullFunc_iiii;var Y=env.nullFunc_viiiii;var Z=env.nullFunc_vi;var _=env.nullFunc_vii;var $=env.nullFunc_ii;var aa=env.nullFunc_viii;var ba=env.nullFunc_v;var ca=env.nullFunc_iiiii;var da=env.nullFunc_viiiiii;var ea=env.nullFunc_iii;var fa=env.nullFunc_viiii;var ga=env.invoke_iiii;var ha=env.invoke_viiiii;var ia=env.invoke_vi;var ja=env.invoke_vii;var ka=env.invoke_ii;var la=env.invoke_viii;var ma=env.invoke_v;var na=env.invoke_iiiii;var oa=env.invoke_viiiiii;var pa=env.invoke_iii;var qa=env.invoke_viiii;var ra=env._pthread_cleanup_pop;var sa=env.___syscall221;var ta=env._pthread_mutex_init;var ua=env.___syscall64;var va=env.___syscall63;var wa=env.___syscall6;var xa=env.___syscall202;var ya=env._pthread_cleanup_push;var za=env.___syscall20;var Aa=env._llvm_stackrestore;var Ba=env.___assert_fail;var Ca=env.___buildEnvironment;var Da=env.__addDays;var Ea=env._localtime_r;var Fa=env._tzset;var Ga=env.___setErrNo;var Ha=env._sbrk;var Ia=env.___syscall192;var Ja=env.___syscall191;var Ka=env.___syscall197;var La=env.___syscall195;var Ma=env.___syscall194;var Na=env.___syscall199;var Oa=env._sysconf;var Pa=env._strftime;var Qa=env._clock;var Ra=env.__arraySum;var Sa=env._emscripten_memcpy_big;var Ta=env.___syscall91;var Ua=env.___syscall75;var Va=env._pthread_mutex_destroy;var Wa=env._llvm_stacksave;var Xa=env.___syscall77;var Ya=env._getenv;var Za=env.___syscall33;var _a=env.___syscall54;var $a=env.___unlock;var ab=env.__isLeapYear;var bb=env.___syscall10;var cb=env.___syscall3;var db=env.___syscall340;var eb=env.___lock;var fb=env._abort;var gb=env.___syscall5;var hb=env.___syscall4;var ib=env._time;var jb=env._gettimeofday;var kb=env.___syscall201;var lb=env._atexit;var mb=env.___syscall140;var nb=env._localtime;var ob=env.___syscall142;var pb=env.___syscall145;var qb=env.___syscall146;var rb=0.0;
+// EMSCRIPTEN_START_FUNCS
+function Db(a){a=a|0;var b=0;b=i;i=i+a|0;i=i+15&-16;if((i|0)>=(j|0))W(a|0);return b|0}function Eb(){return i|0}function Fb(a){a=a|0;i=a}function Gb(a,b){a=a|0;b=b|0;i=a;j=b}function Hb(a,b){a=a|0;b=b|0;if(!n){n=a;o=b}}function Ib(a){a=a|0;C=a}function Jb(){return C|0}function Kb(a){a=a|0;var b=0;b=Qb(32,19090,38)|0;lc(a,b);return b|0}function Lb(b,c,d){b=b|0;c=c|0;d=d|0;var e=0,f=0;e=d+8|0;f=Qb(e,19090,52)|0;Ow(f+8|0,c|0,d|0)|0;d=sv(b)|0;b=f+4|0;a[b>>0]=d;a[b+1>>0]=d>>8;a[b+2>>0]=d>>16;a[b+3>>0]=d>>24;d=sv(e)|0;a[f>>0]=d;a[f+1>>0]=d>>8;a[f+2>>0]=d>>16;a[f+3>>0]=d>>24;return f|0}function Mb(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0;f=i;i=i+32|0;if((i|0)>=(j|0))U();g=f;if((Xt(e,g)|0)!=1){h=0;i=f;return h|0}e=g;c[e>>2]=a;c[e+4>>2]=b;c[g+8>>2]=d;d=Qb(24,19090,82)|0;c[d>>2]=c[g>>2];c[d+4>>2]=c[g+4>>2];c[d+8>>2]=c[g+8>>2];c[d+12>>2]=c[g+12>>2];c[d+16>>2]=c[g+16>>2];c[d+20>>2]=c[g+20>>2];h=d;i=f;return h|0}function Nb(a){a=a|0;var b=0;b=a;C=c[b+4>>2]|0;return c[b>>2]|0}function Ob(a){a=a|0;return c[a+8>>2]|0}function Pb(a){a=a|0;return a+12|0}function Qb(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;e=i;i=i+64|0;if((i|0)>=(j|0))U();f=e+24|0;g=e+8|0;h=e;k=e+56|0;l=e+52|0;m=e+48|0;n=e+44|0;o=e+40|0;p=e+36|0;q=e+32|0;c[k>>2]=a;c[l>>2]=b;c[m>>2]=d;if((c[k>>2]|0)>>>0>41943040){c[o>>2]=74;if((c[182]|0)==-1)c[182]=Yb(1,0,19097,19117,c[o>>2]|0)|0;if(($b()|0)>0){ac(-1,0);Xb()}if(!(c[182]|0))Xb();o=c[m>>2]|0;c[h>>2]=c[l>>2];c[h+4>>2]=o;bc(1,61409,h);Xb()}c[n>>2]=Rb(c[k>>2]|0,c[l>>2]|0,c[m>>2]|0)|0;if(c[n>>2]|0){i=e;return c[n>>2]|0}c[p>>2]=81;if((c[183]|0)==-1)c[183]=Yb(1,20903,19097,19117,c[p>>2]|0)|0;if(($b()|0)<=0){if(c[183]|0){p=xu(c[(fu()|0)>>2]|0)|0;c[g>>2]=19133;c[g+4>>2]=19097;c[g+8>>2]=81;c[g+12>>2]=p;gc(1,20903,20454,g)}}else ac(-1,0);c[q>>2]=82;if((c[184]|0)==-1)c[184]=Yb(1,0,19097,19117,c[q>>2]|0)|0;if(($b()|0)>0){ac(-1,0);Xb()}if(!(c[184]|0))Xb();c[f>>2]=19097;c[f+4>>2]=82;bc(1,61409,f);Xb();return 0}function Rb(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,k=0;e=i;i=i+32|0;if((i|0)>=(j|0))U();f=e+16|0;g=e+12|0;h=e;c[g>>2]=a;c[e+8>>2]=b;c[e+4>>2]=d;c[h>>2]=yw(c[g>>2]|0)|0;if(!(c[h>>2]|0)){c[f>>2]=0;k=c[f>>2]|0;i=e;return k|0}else{Sw(c[h>>2]|0,0,c[g>>2]|0)|0;c[f>>2]=c[h>>2];k=c[f>>2]|0;i=e;return k|0}return 0}function Sb(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,k=0,l=0;e=i;i=i+32|0;if((i|0)>=(j|0))U();f=e;g=e+20|0;h=e+16|0;k=e+12|0;l=e+8|0;c[g>>2]=a;c[h>>2]=b;c[k>>2]=d;if(c[g>>2]|0){zw(c[g>>2]|0);i=e;return}c[l>>2]=237;if((c[185]|0)==-1)c[185]=Yb(1,0,19097,19140,c[l>>2]|0)|0;if(($b()|0)>0){ac(-1,0);Xb()}if(!(c[185]|0))Xb();l=c[k>>2]|0;c[f>>2]=c[h>>2];c[f+4>>2]=l;bc(1,61409,f);Xb()}function Tb(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0;e=i;i=i+32|0;if((i|0)>=(j|0))U();f=e;g=e+28|0;h=e+24|0;k=e+20|0;l=e+16|0;m=e+12|0;n=e+8|0;c[g>>2]=a;c[h>>2]=b;c[k>>2]=d;if(c[g>>2]|0){c[m>>2]=(Tu(c[g>>2]|0)|0)+1;c[l>>2]=Qb(c[m>>2]|0,c[h>>2]|0,c[k>>2]|0)|0;Ow(c[l>>2]|0,c[g>>2]|0,c[m>>2]|0)|0;i=e;return c[l>>2]|0}c[n>>2]=278;if((c[186]|0)==-1)c[186]=Yb(1,0,19097,19154,c[n>>2]|0)|0;if(($b()|0)>0){ac(-1,0);Xb()}if(!(c[186]|0))Xb();n=c[k>>2]|0;c[f>>2]=c[h>>2];c[f+4>>2]=n;bc(1,61409,f);Xb();return 0}function Ub(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0;f=i;i=i+48|0;if((i|0)>=(j|0))U();g=f;h=f+44|0;k=f+40|0;l=f+36|0;m=f+32|0;n=f+16|0;o=f+8|0;c[h>>2]=a;c[k>>2]=b;c[l>>2]=d;c[n>>2]=e;c[m>>2]=Du(c[h>>2]|0,c[k>>2]|0,c[l>>2]|0,n)|0;if((c[m>>2]|0)>>>0<(c[k>>2]|0)>>>0){i=f;return c[m>>2]|0}c[o>>2]=433;if((c[187]|0)==-1)c[187]=Yb(1,0,19097,19170,c[o>>2]|0)|0;if(($b()|0)>0){ac(-1,0);Xb()}if(!(c[187]|0))Xb();c[g>>2]=19097;c[g+4>>2]=433;bc(1,61409,g);Xb();return 0}function Vb(){c[17592]=c[3960];return}function Wb(){return}function Xb(){fb()}function Yb(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;g=i;i=i+48|0;if((i|0)>=(j|0))U();h=g+32|0;k=g+28|0;l=g+24|0;m=g+20|0;n=g+16|0;o=g+12|0;p=g+8|0;q=g+4|0;r=g;c[k>>2]=a;c[l>>2]=b;c[m>>2]=d;c[n>>2]=e;c[o>>2]=f;if(!(c[l>>2]|0))c[l>>2]=c[17593];if((c[17594]|0)>=0&0==(c[17595]|0)){c[h>>2]=(c[k>>2]|0)<=(c[17594]|0)&1;s=c[h>>2]|0;i=g;return s|0}c[r>>2]=(c[17594]|0)>=0&1;c[q>>2]=0;while(1){if((c[q>>2]|0)>=(c[17596]|0))break;c[p>>2]=(c[17597]|0)+((c[q>>2]|0)*112|0);if(!(c[r>>2]|0?!(c[(c[p>>2]|0)+108>>2]|0):0))t=9;if((((((t|0)==9?(t=0,(c[o>>2]|0)>=(c[(c[p>>2]|0)+96>>2]|0)):0)?(c[o>>2]|0)<=(c[(c[p>>2]|0)+100>>2]|0):0)?0==(uw(c[p>>2]|0,c[l>>2]|0,0,0,0)|0):0)?0==(uw((c[p>>2]|0)+32|0,c[m>>2]|0,0,0,0)|0):0)?0==(uw((c[p>>2]|0)+64|0,c[n>>2]|0,0,0,0)|0):0){t=14;break}c[q>>2]=(c[q>>2]|0)+1}if((t|0)==14){c[h>>2]=(c[k>>2]|0)<=(c[(c[p>>2]|0)+104>>2]|0)&1;s=c[h>>2]|0;i=g;return s|0}p=c[k>>2]|0;if((c[17594]|0)>=0){c[h>>2]=(p|0)<=(c[17594]|0)&1;s=c[h>>2]|0;i=g;return s|0}else{c[h>>2]=(p|0)<=2&1;s=c[h>>2]|0;i=g;return s|0}return 0}function Zb(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;d=i;i=i+4176|0;if((i|0)>=(j|0))U();e=d+24|0;f=d+16|0;g=d;h=d+72|0;k=d+68|0;l=d+76|0;m=d+64|0;n=d+60|0;o=d+56|0;p=d+52|0;q=d+48|0;r=d+44|0;c[k>>2]=b;if(!(c[17599]|0)){c[h>>2]=-1;s=c[h>>2]|0;i=d;return s|0}if(!(Pa(l|0,4097,c[17599]|0,c[k>>2]|0)|0)){c[h>>2]=-1;s=c[h>>2]|0;i=d;return s|0}c[p>>2]=ow(l,91)|0;if(0!=(c[p>>2]|0)?93==(a[(c[p>>2]|0)+1>>0]|0):0){c[q>>2]=Tb(l,19216,344)|0;a[(c[q>>2]|0)+((c[p>>2]|0)-l)>>0]=0;a[(c[q>>2]|0)+((c[p>>2]|0)-l+1)>>0]=0;k=c[q>>2]|0;b=Kv()|0;t=(c[q>>2]|0)+((c[p>>2]|0)-l+2)|0;c[g>>2]=k;c[g+4>>2]=b;c[g+8>>2]=t;Cu(l,4096,19239,g)|0;Sb(c[q>>2]|0,19216,354)}if(!(pu(l,71474)|0)){c[h>>2]=1;s=c[h>>2]|0;i=d;return s|0}_b(71474);dv(71474,l)|0;c[f>>2]=420;c[m>>2]=Sv(l,1089,f)|0;do if(-1!=(c[m>>2]|0)){if(c[17592]|0)Ev(c[17592]|0)|0;c[n>>2]=cw(c[m>>2]|0,2)|0;uv(c[m>>2]|0)|0;if(-1==(c[n>>2]|0)){c[m>>2]=-1;break}c[o>>2]=Dv(2,19246)|0;if(!(c[o>>2]|0)){uv(2)|0;c[m>>2]=-1}}while(0);if(-1!=(c[m>>2]|0)){c[17592]=c[o>>2];c[h>>2]=1;s=c[h>>2]|0;i=d;return s|0}c[r>>2]=392;if((c[188]|0)==-1)c[188]=Yb(1,0,19216,19249,c[r>>2]|0)|0;if(($b()|0)<=0){if(c[188]|0){r=xu(c[(fu()|0)>>2]|0)|0;c[e>>2]=38361;c[e+4>>2]=l;c[e+8>>2]=19216;c[e+12>>2]=392;c[e+16>>2]=r;bc(1,19392,e)}}else ac(-1,0);c[h>>2]=-1;s=c[h>>2]|0;i=d;return s|0}function _b(b){b=b|0;var d=0,e=0,f=0;d=i;i=i+16|0;if((i|0)>=(j|0))U();e=d+4|0;f=d;c[e>>2]=b;if(!(a[c[e>>2]>>0]|0)){i=d;return}c[f>>2]=c[70404+((((c[17600]|0)>>>0)%3|0)<<2)>>2];if(c[f>>2]|0){Tv(c[f>>2]|0)|0;Sb(c[f>>2]|0,19216,314)}f=Tb(c[e>>2]|0,19216,316)|0;c[70404+((((c[17600]|0)>>>0)%3|0)<<2)>>2]=f;c[17600]=(c[17600]|0)+1;i=d;return}function $b(){return c[17604]|0}function ac(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,k=0;d=i;i=i+32|0;if((i|0)>=(j|0))U();e=d;f=d+20|0;g=d+16|0;h=d+12|0;k=d+8|0;c[f>>2]=a;c[g>>2]=b;if(c[f>>2]|0){c[17604]=(c[17604]|0)+(c[f>>2]|0);i=d;return}c[h>>2]=0==(c[17604]|0)&1;c[17604]=0;if((c[g>>2]|0)==0|(c[h>>2]|0)!=0){i=d;return}c[k>>2]=867;if((c[189]|0)==-1)c[189]=Yb(1,0,19216,19264,c[k>>2]|0)|0;if(($b()|0)>0){ac(-1,0);i=d;return}if(!(c[189]|0)){i=d;return}c[e>>2]=19216;c[e+4>>2]=867;bc(1,61409,e);i=d;return}function bc(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=i;i=i+32|0;if((i|0)>=(j|0))U();f=e+20|0;g=e+16|0;h=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;cc(c[f>>2]|0,c[17598]|0,c[g>>2]|0,h);i=e;return}function cc(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,D=0,E=0;g=i;i=i+240|0;if((i|0)>=(j|0))U();h=g+40|0;k=g+32|0;l=g+24|0;m=g+108|0;n=g+104|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fw(0,0,u|0,C|0)|0;u=Xw(l|0,C|0,1e3,0)|0;l=C;b=x;D=Kw(c[b>>2]|0,c[b+4>>2]|0,1e3,0)|0;b=Xw(D|0,C|0,1e3,0)|0;D=C;if((d|0)>(l|0)|(d|0)==(l|0)&e>>>0>u>>>0){u=y+4|0;e=c[u>>2]|0;l=Gw(e|0,((e|0)<0)<<31>>31|0,b|0,D|0)|0;c[u>>2]=l;break}else{l=Gw(1e6,0,b|0,D|0)|0;D=y+4|0;b=c[D>>2]|0;u=Gw(b|0,((b|0)<0)<<31>>31|0,l|0,C|0)|0;c[D>>2]=u;c[y>>2]=(c[y>>2]|0)+-1;break}}while(0);c[s>>2]=nb(y|0)|0;if(!(c[s>>2]|0))dv(q,19286)|0;else{Pa(r|0,64,19302,c[s>>2]|0)|0;c[k>>2]=c[y+4>>2];Cu(q,64,r,k)|0}Du(v,c[t>>2]|0,c[o>>2]|0,c[p>>2]|0)|0;if(c[s>>2]|0)Zb(c[s>>2]|0)|0;s=70336;if(0!=(c[m>>2]&32|0)&(0!=(c[s>>2]|0)?1:0!=(c[s+4>>2]|0))?0==(rv(v,75571,256)|0):0){c[17605]=(c[17605]|0)+1;c[h>>2]=c[17584];c[h+4>>2]=c[17585];s=pd(h)|0;h=z;c[h>>2]=s;c[h+4>>2]=C;h=z;z=c[h+4>>2]|0;if(z>>>0>10|(z|0)==10&(c[h>>2]|0)>>>0>250327040|(c[17605]|0)>>>0>1e3)dc(q);c[A>>2]=1;E=c[w>>2]|0;Aa(E|0);i=g;return}dc(q);xv(75571,v,256)|0;c[17605]=0;c[17606]=c[m>>2];h=nd()|0;z=B;c[z>>2]=h;c[z+4>>2]=C;c[17584]=c[B>>2];c[17585]=c[B+4>>2];xv(75827,c[n>>2]|0,32)|0;ec(c[m>>2]|0,c[n>>2]|0,q,v);c[A>>2]=0;E=c[w>>2]|0;Aa(E|0);i=g;return}function dc(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0;d=i;i=i+640|0;if((i|0)>=(j|0))U();e=d+32|0;f=d+16|0;g=d+52|0;h=d+56|0;k=d+48|0;l=d+44|0;m=d+40|0;n=d+8|0;o=d;c[g>>2]=b;b=70336;if((0==(c[b>>2]|0)?0==(c[b+4>>2]|0):0)|0==(c[17605]|0)){i=d;return}c[k>>2]=0;c[l>>2]=Lu(75571,0,256)|0;if(c[l>>2]|0){if((c[l>>2]|0)!=75571)c[l>>2]=(c[l>>2]|0)+-1}else c[l>>2]=75826;if((a[c[l>>2]>>0]|0)==10){c[k>>2]=1;a[c[l>>2]>>0]=0};c[e>>2]=c[17584];c[e+4>>2]=c[17585];b=pd(e)|0;p=n;c[p>>2]=b;c[p+4>>2]=C;c[e>>2]=c[n>>2];c[e+4>>2]=c[n+4>>2];c[m>>2]=gd(e,1)|0;e=c[17605]|0;n=c[m>>2]|0;c[f>>2]=256;c[f+4>>2]=75571;c[f+8>>2]=e;c[f+12>>2]=n;Cu(h,576,19323,f)|0;if((c[k>>2]|0)==1)a[c[l>>2]>>0]=10;ec(c[17606]|0,75827,c[g>>2]|0,h);h=nd()|0;g=o;c[g>>2]=h;c[g+4>>2]=C;c[17584]=c[o>>2];c[17585]=c[o+4>>2];c[17605]=0;i=d;return}function ec(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0;f=i;i=i+48|0;if((i|0)>=(j|0))U();g=f;h=f+32|0;k=f+28|0;l=f+24|0;m=f+20|0;n=f+16|0;c[h>>2]=a;c[k>>2]=b;c[l>>2]=d;c[m>>2]=e;if(0!=(c[17592]|0)&0==(c[17607]|0)){e=c[17592]|0;d=c[l>>2]|0;b=c[k>>2]|0;a=fc(c[h>>2]|0)|0;o=c[m>>2]|0;c[g>>2]=d;c[g+4>>2]=b;c[g+8>>2]=a;c[g+12>>2]=o;pv(e,19380,g)|0;Fv(c[17592]|0)|0}c[n>>2]=c[17607];while(1){if(!(c[n>>2]|0))break;tb[c[(c[n>>2]|0)+4>>2]&15](c[(c[n>>2]|0)+8>>2]|0,c[h>>2]|0,c[k>>2]|0,c[l>>2]|0,c[m>>2]|0);c[n>>2]=c[c[n>>2]>>2]}i=f;return}function fc(a){a=a|0;var b=0,d=0,e=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b+4|0;e=b;c[e>>2]=a;do if((c[e>>2]&1|0)<=0){if((c[e>>2]&2|0)>0){c[d>>2]=19197;break}if((c[e>>2]&4|0)>0){c[d>>2]=19192;break}if((c[e>>2]&8|0)>0){c[d>>2]=19186;break}if(!(c[e>>2]&-33)){c[d>>2]=19211;break}else{c[d>>2]=19372;break}}else c[d>>2]=19205;while(0);i=b;return c[d>>2]|0}function gc(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,k=0,l=0,m=0,n=0;f=i;i=i+176|0;if((i|0)>=(j|0))U();g=f;h=f+32|0;k=f+28|0;l=f+24|0;m=f+8|0;n=f+40|0;c[h>>2]=a;c[k>>2]=b;c[l>>2]=d;if(!(c[k>>2]|0))c[k>>2]=c[17593];c[m>>2]=e;e=c[k>>2]|0;k=Kv()|0;c[g>>2]=e;c[g+4>>2]=k;Ub(n,128,19233,g)|0;cc(c[h>>2]|0,n,c[l>>2]|0,m);i=f;return}function hc(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0;g=i;i=i+64|0;if((i|0)>=(j|0))U();h=g+8|0;k=g;l=g+56|0;m=g+52|0;n=g+48|0;o=g+44|0;p=g+40|0;q=g+36|0;r=g+32|0;s=g+28|0;t=g+24|0;u=g+20|0;v=g+16|0;c[m>>2]=a;c[n>>2]=b;c[o>>2]=d;c[p>>2]=e;c[q>>2]=f;f=c[n>>2]|0;c[s>>2]=Wa()|0;e=i;i=i+((1*f|0)+15&-16)|0;if((i|0)>=(j|0))U();if(1!=(ic(r,c[o>>2]|0,c[p>>2]|0)|0)){c[l>>2]=-1;c[t>>2]=1;w=c[s>>2]|0;Aa(w|0);x=c[l>>2]|0;i=g;return x|0}if(de(c[r>>2]|0,e,c[n>>2]|0,c[m>>2]|0,c[n>>2]|0)|0){c[u>>2]=136;if((c[194]|0)==-1)c[194]=Yb(1,0,19442,19478,c[u>>2]|0)|0;if(($b()|0)>0){ac(-1,0);Xb()}if(!(c[194]|0))Xb();c[k>>2]=19442;c[k+4>>2]=136;bc(1,61409,k);Xb()}_d(c[r>>2]|0);if(1!=(jc(r,c[o>>2]|0,c[p>>2]|0)|0)){c[l>>2]=-1;c[t>>2]=1;w=c[s>>2]|0;Aa(w|0);x=c[l>>2]|0;i=g;return x|0}if(!(de(c[r>>2]|0,c[q>>2]|0,c[n>>2]|0,e,c[n>>2]|0)|0)){_d(c[r>>2]|0);Sw(e|0,0,f|0)|0;c[l>>2]=c[n>>2];c[t>>2]=1;w=c[s>>2]|0;Aa(w|0);x=c[l>>2]|0;i=g;return x|0}c[v>>2]=140;if((c[198]|0)==-1)c[198]=Yb(1,0,19442,19478,c[v>>2]|0)|0;if(($b()|0)>0){ac(-1,0);Xb()}if(!(c[198]|0))Xb();c[h>>2]=19442;c[h+4>>2]=140;bc(1,61409,h);Xb();return 0}function ic(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;e=i;i=i+64|0;if((i|0)>=(j|0))U();f=e+16|0;g=e+8|0;h=e;k=e+48|0;l=e+44|0;m=e+40|0;n=e+36|0;o=e+32|0;p=e+28|0;q=e+24|0;c[k>>2]=a;c[l>>2]=b;c[m>>2]=d;if(Zd(c[k>>2]|0,9,2,0)|0){c[o>>2]=68;if((c[191]|0)==-1)c[191]=Yb(1,0,19442,19461,c[o>>2]|0)|0;if(($b()|0)>0){ac(-1,0);Xb()}if(!(c[191]|0))Xb();c[h>>2]=19442;c[h+4>>2]=68;bc(1,61409,h);Xb()}c[n>>2]=$d(c[c[k>>2]>>2]|0,c[l>>2]|0,32)|0;if(0!=(c[n>>2]|0)?((c[n>>2]&255)<<24>>24|0)!=43:0){c[p>>2]=72;if((c[192]|0)==-1)c[192]=Yb(1,0,19442,19461,c[p>>2]|0)|0;if(($b()|0)>0){ac(-1,0);Xb()}if(!(c[192]|0))Xb();c[g>>2]=19442;c[g+4>>2]=72;bc(1,61409,g);Xb()}c[n>>2]=ce(c[c[k>>2]>>2]|0,c[m>>2]|0,16)|0;if(!(c[n>>2]|0)){i=e;return 1}if(((c[n>>2]&255)<<24>>24|0)==43){i=e;return 1}c[q>>2]=76;if((c[193]|0)==-1)c[193]=Yb(1,0,19442,19461,c[q>>2]|0)|0;if(($b()|0)>0){ac(-1,0);Xb()}if(!(c[193]|0))Xb();c[f>>2]=19442;c[f+4>>2]=76;bc(1,61409,f);Xb();return 0}function jc(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;e=i;i=i+64|0;if((i|0)>=(j|0))U();f=e+16|0;g=e+8|0;h=e;k=e+48|0;l=e+44|0;m=e+40|0;n=e+36|0;o=e+32|0;p=e+28|0;q=e+24|0;c[k>>2]=a;c[l>>2]=b;c[m>>2]=d;if(Zd(c[k>>2]|0,10,2,0)|0){c[o>>2]=98;if((c[195]|0)==-1)c[195]=Yb(1,0,19442,19510,c[o>>2]|0)|0;if(($b()|0)>0){ac(-1,0);Xb()}if(!(c[195]|0))Xb();c[h>>2]=19442;c[h+4>>2]=98;bc(1,61409,h);Xb()}c[n>>2]=$d(c[c[k>>2]>>2]|0,(c[l>>2]|0)+32|0,32)|0;if(0!=(c[n>>2]|0)?((c[n>>2]&255)<<24>>24|0)!=43:0){c[p>>2]=102;if((c[196]|0)==-1)c[196]=Yb(1,0,19442,19510,c[p>>2]|0)|0;if(($b()|0)>0){ac(-1,0);Xb()}if(!(c[196]|0))Xb();c[g>>2]=19442;c[g+4>>2]=102;bc(1,61409,g);Xb()}c[n>>2]=ce(c[c[k>>2]>>2]|0,(c[m>>2]|0)+16|0,16)|0;if(!(c[n>>2]|0)){i=e;return 1}if(((c[n>>2]&255)<<24>>24|0)==43){i=e;return 1}c[q>>2]=106;if((c[197]|0)==-1)c[197]=Yb(1,0,19442,19510,c[q>>2]|0)|0;if(($b()|0)>0){ac(-1,0);Xb()}if(!(c[197]|0))Xb();c[f>>2]=19442;c[f+4>>2]=106;bc(1,61409,f);Xb();return 0}function kc(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0;g=i;i=i+64|0;if((i|0)>=(j|0))U();h=g+8|0;k=g;l=g+56|0;m=g+52|0;n=g+48|0;o=g+44|0;p=g+40|0;q=g+36|0;r=g+32|0;s=g+28|0;t=g+24|0;u=g+20|0;v=g+16|0;c[m>>2]=a;c[n>>2]=b;c[o>>2]=d;c[p>>2]=e;c[q>>2]=f;f=c[n>>2]|0;c[s>>2]=Wa()|0;e=i;i=i+((1*f|0)+15&-16)|0;if((i|0)>=(j|0))U();if(1!=(jc(r,c[o>>2]|0,c[p>>2]|0)|0)){c[l>>2]=-1;c[t>>2]=1;w=c[s>>2]|0;Aa(w|0);x=c[l>>2]|0;i=g;return x|0}if(ee(c[r>>2]|0,e,c[n>>2]|0,c[m>>2]|0,c[n>>2]|0)|0){c[u>>2]=171;if((c[199]|0)==-1)c[199]=Yb(1,0,19442,19531,c[u>>2]|0)|0;if(($b()|0)>0){ac(-1,0);Xb()}if(!(c[199]|0))Xb();c[k>>2]=19442;c[k+4>>2]=171;bc(1,61409,k);Xb()}_d(c[r>>2]|0);if(1!=(ic(r,c[o>>2]|0,c[p>>2]|0)|0)){c[l>>2]=-1;c[t>>2]=1;w=c[s>>2]|0;Aa(w|0);x=c[l>>2]|0;i=g;return x|0}if(!(ee(c[r>>2]|0,c[q>>2]|0,c[n>>2]|0,e,c[n>>2]|0)|0)){_d(c[r>>2]|0);Sw(e|0,0,f|0)|0;c[l>>2]=c[n>>2];c[t>>2]=1;w=c[s>>2]|0;Aa(w|0);x=c[l>>2]|0;i=g;return x|0}c[v>>2]=175;if((c[200]|0)==-1)c[200]=Yb(1,0,19442,19531,c[v>>2]|0)|0;if(($b()|0)>0){ac(-1,0);Xb()}if(!(c[200]|0))Xb();c[h>>2]=19442;c[h+4>>2]=175;bc(1,61409,h);Xb();return 0}function lc(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;d=i;i=i+64|0;if((i|0)>=(j|0))U();e=d+16|0;f=d+8|0;g=d;h=d+52|0;k=d+48|0;l=d+44|0;m=d+40|0;n=d+36|0;o=d+32|0;p=d+28|0;q=d+24|0;c[h>>2]=a;c[k>>2]=b;c[l>>2]=mc(c[h>>2]|0)|0;if(!(c[l>>2]|0)){c[o>>2]=257;if((c[203]|0)==-1)c[203]=Yb(1,0,19605,19722,c[o>>2]|0)|0;if(($b()|0)>0){ac(-1,0);Xb()}if(!(c[203]|0))Xb();c[g>>2]=19605;c[g+4>>2]=257;bc(1,61409,g);Xb()}if(Pd(m,c[l>>2]|0,0)|0){c[p>>2]=258;if((c[204]|0)==-1)c[204]=Yb(1,0,19605,19722,c[p>>2]|0)|0;if(($b()|0)>0){ac(-1,0);Xb()}if(!(c[204]|0))Xb();c[f>>2]=19605;c[f+4>>2]=258;bc(1,61409,f);Xb()}Ad(c[l>>2]|0);c[n>>2]=Qd(19634,c[m>>2]|0,0)|0;if(c[n>>2]|0){Fc(c[k>>2]|0,32,c[n>>2]|0);Gd(c[n>>2]|0);ue(c[m>>2]|0);i=d;return}c[q>>2]=261;if((c[205]|0)==-1)c[205]=Yb(1,0,19605,19722,c[q>>2]|0)|0;if(($b()|0)>0){ac(-1,0);Xb()}if(!(c[205]|0))Xb();c[e>>2]=19605;c[e+4>>2]=261;bc(1,61409,e);Xb()}function mc(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,k=0,l=0,m=0;b=i;i=i+64|0;if((i|0)>=(j|0))U();d=b+24|0;e=b+8|0;f=b;g=b+48|0;h=b+44|0;k=b+40|0;l=b+36|0;m=b+32|0;c[g>>2]=a;a=c[g>>2]|0;c[f>>2]=32;c[f+4>>2]=a;c[k>>2]=zd(h,0,19642,f)|0;if(!(c[k>>2]|0)){i=b;return c[h>>2]|0}c[l>>2]=169;if((c[201]|0)==-1)c[201]=Yb(1,20903,19605,19697,c[l>>2]|0)|0;if(($b()|0)<=0){if(c[201]|0){l=sd(c[k>>2]|0)|0;c[e>>2]=19618;c[e+4>>2]=19605;c[e+8>>2]=169;c[e+12>>2]=l;gc(1,20903,20454,e)}}else ac(-1,0);c[m>>2]=170;if((c[202]|0)==-1)c[202]=Yb(1,0,19605,19697,c[m>>2]|0)|0;if(($b()|0)>0){ac(-1,0);Xb()}if(!(c[202]|0))Xb();c[d>>2]=19605;c[d+4>>2]=170;bc(1,61409,d);Xb();return 0}function nc(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;d=i;i=i+64|0;if((i|0)>=(j|0))U();e=d+16|0;f=d+8|0;g=d;h=d+52|0;k=d+48|0;l=d+44|0;m=d+40|0;n=d+36|0;o=d+32|0;p=d+28|0;q=d+24|0;c[h>>2]=a;c[k>>2]=b;c[l>>2]=oc(c[h>>2]|0)|0;if(!(c[l>>2]|0)){c[o>>2]=283;if((c[208]|0)==-1)c[208]=Yb(1,0,19605,19782,c[o>>2]|0)|0;if(($b()|0)>0){ac(-1,0);Xb()}if(!(c[208]|0))Xb();c[g>>2]=19605;c[g+4>>2]=283;bc(1,61409,g);Xb()}if(Pd(m,c[l>>2]|0,0)|0){c[p>>2]=284;if((c[209]|0)==-1)c[209]=Yb(1,0,19605,19782,c[p>>2]|0)|0;if(($b()|0)>0){ac(-1,0);Xb()}if(!(c[209]|0))Xb();c[f>>2]=19605;c[f+4>>2]=284;bc(1,61409,f);Xb()}Ad(c[l>>2]|0);c[n>>2]=Qd(19634,c[m>>2]|0,0)|0;if(c[n>>2]|0){Fc(c[k>>2]|0,32,c[n>>2]|0);Gd(c[n>>2]|0);ue(c[m>>2]|0);i=d;return}c[q>>2]=287;if((c[210]|0)==-1)c[210]=Yb(1,0,19605,19782,c[q>>2]|0)|0;if(($b()|0)>0){ac(-1,0);Xb()}if(!(c[210]|0))Xb();c[e>>2]=19605;c[e+4>>2]=287;bc(1,61409,e);Xb()}function oc(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,k=0,l=0,m=0;b=i;i=i+64|0;if((i|0)>=(j|0))U();d=b+24|0;e=b+8|0;f=b;g=b+48|0;h=b+44|0;k=b+40|0;l=b+36|0;m=b+32|0;c[g>>2]=a;a=c[g>>2]|0;c[f>>2]=32;c[f+4>>2]=a;c[k>>2]=zd(h,0,19563,f)|0;if(!(c[k>>2]|0)){i=b;return c[h>>2]|0}c[l>>2]=202;if((c[206]|0)==-1)c[206]=Yb(1,20903,19605,19757,c[l>>2]|0)|0;if(($b()|0)<=0){if(c[206]|0){l=sd(c[k>>2]|0)|0;c[e>>2]=19618;c[e+4>>2]=19605;c[e+8>>2]=202;c[e+12>>2]=l;gc(1,20903,20454,e)}}else ac(-1,0);c[m>>2]=203;if((c[207]|0)==-1)c[207]=Yb(1,0,19605,19757,c[m>>2]|0)|0;if(($b()|0)>0){ac(-1,0);Xb()}if(!(c[207]|0))Xb();c[d>>2]=19605;c[d+4>>2]=203;bc(1,61409,d);Xb();return 0}function pc(){var a=0,b=0,d=0,e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;a=i;i=i+96|0;if((i|0)>=(j|0))U();b=a+40|0;d=a+24|0;e=a+8|0;f=a+88|0;g=a+84|0;h=a+80|0;k=a+76|0;l=a+72|0;m=a+68|0;n=a+64|0;o=a+60|0;p=a+56|0;q=zd(k,0,19817,a)|0;c[m>>2]=q;if(q){c[n>>2]=505;if((c[211]|0)==-1)c[211]=Yb(1,20903,19605,19872,c[n>>2]|0)|0;if(($b()|0)<=0){if(c[211]|0){n=sd(c[m>>2]|0)|0;c[e>>2]=19618;c[e+4>>2]=19605;c[e+8>>2]=505;c[e+12>>2]=n;gc(1,20903,20454,e)}}else ac(-1,0);c[f>>2]=0;r=c[f>>2]|0;i=a;return r|0}e=ie(h,c[k>>2]|0)|0;c[m>>2]=e;if(e){c[o>>2]=510;if((c[212]|0)==-1)c[212]=Yb(1,20903,19605,19872,c[o>>2]|0)|0;if(($b()|0)<=0){if(c[212]|0){o=sd(c[m>>2]|0)|0;c[d>>2]=19903;c[d+4>>2]=19605;c[d+8>>2]=510;c[d+12>>2]=o;gc(1,20903,20454,d)}}else ac(-1,0);Ad(c[k>>2]|0);c[f>>2]=0;r=c[f>>2]|0;i=a;return r|0}Ad(c[k>>2]|0);k=qc(l,c[h>>2]|0,37752,35402)|0;c[m>>2]=k;if(!k){Ad(c[h>>2]|0);c[g>>2]=Qb(32,19605,530)|0;Fc(c[g>>2]|0,32,c[l>>2]|0);Gd(c[l>>2]|0);c[f>>2]=c[g>>2];r=c[f>>2]|0;i=a;return r|0}c[p>>2]=525;if((c[213]|0)==-1)c[213]=Yb(1,20903,19605,19872,c[p>>2]|0)|0;if(($b()|0)<=0){if(c[213]|0){p=sd(c[m>>2]|0)|0;c[b>>2]=19918;c[b+4>>2]=19605;c[b+8>>2]=525;c[b+12>>2]=p;gc(1,20903,20454,b)}}else ac(-1,0);Ad(c[h>>2]|0);c[f>>2]=0;r=c[f>>2]|0;i=a;return r|0}function qc(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0;g=i;i=i+48|0;if((i|0)>=(j|0))U();h=g+36|0;k=g+32|0;l=g+28|0;m=g+24|0;n=g+20|0;o=g+16|0;p=g+12|0;q=g+8|0;r=g+4|0;s=g;c[k>>2]=b;c[l>>2]=d;c[m>>2]=e;c[n>>2]=f;c[o>>2]=Cd(c[l>>2]|0,c[m>>2]|0,0)|0;if(!(c[o>>2]|0)){c[h>>2]=1;t=c[h>>2]|0;i=g;return t|0}c[p>>2]=Dd(c[o>>2]|0)|0;Ad(c[o>>2]|0);c[o>>2]=c[p>>2];if(!(c[o>>2]|0)){c[h>>2]=2;t=c[h>>2]|0;i=g;return t|0}c[s>>2]=0;c[q>>2]=c[n>>2];while(1){u=c[o>>2]|0;if(!(a[c[q>>2]>>0]|0)){v=18;break}c[p>>2]=Cd(u,c[q>>2]|0,1)|0;if(!(c[p>>2]|0)){v=8;break}n=Ed(c[p>>2]|0,1,5)|0;c[(c[k>>2]|0)+(c[s>>2]<<2)>>2]=n;Ad(c[p>>2]|0);if(!(c[(c[k>>2]|0)+(c[s>>2]<<2)>>2]|0)){v=13;break}c[q>>2]=(c[q>>2]|0)+1;c[s>>2]=(c[s>>2]|0)+1}if((v|0)==8){c[r>>2]=0;while(1){if((c[r>>2]|0)>>>0>=(c[s>>2]|0)>>>0)break;we(c[(c[k>>2]|0)+(c[r>>2]<<2)>>2]|0);c[(c[k>>2]|0)+(c[r>>2]<<2)>>2]=0;c[r>>2]=(c[r>>2]|0)+1}Ad(c[o>>2]|0);c[h>>2]=3;t=c[h>>2]|0;i=g;return t|0}else if((v|0)==13){c[r>>2]=0;while(1){if((c[r>>2]|0)>>>0>=(c[s>>2]|0)>>>0)break;we(c[(c[k>>2]|0)+(c[r>>2]<<2)>>2]|0);c[(c[k>>2]|0)+(c[r>>2]<<2)>>2]=0;c[r>>2]=(c[r>>2]|0)+1}Ad(c[o>>2]|0);c[h>>2]=4;t=c[h>>2]|0;i=g;return t|0}else if((v|0)==18){Ad(u);c[h>>2]=0;t=c[h>>2]|0;i=g;return t|0}return 0}function rc(){var a=0,b=0,d=0,e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;a=i;i=i+96|0;if((i|0)>=(j|0))U();b=a+40|0;d=a+24|0;e=a+8|0;f=a+88|0;g=a+84|0;h=a+80|0;k=a+76|0;l=a+72|0;m=a+68|0;n=a+64|0;o=a+60|0;p=a+56|0;q=zd(k,0,19932,a)|0;c[m>>2]=q;if(q){c[n>>2]=604;if((c[214]|0)==-1)c[214]=Yb(1,20903,19605,19976,c[n>>2]|0)|0;if(($b()|0)<=0){if(c[214]|0){n=sd(c[m>>2]|0)|0;c[e>>2]=19618;c[e+4>>2]=19605;c[e+8>>2]=604;c[e+12>>2]=n;gc(1,20903,20454,e)}}else ac(-1,0);c[f>>2]=0;r=c[f>>2]|0;i=a;return r|0}e=ie(h,c[k>>2]|0)|0;c[m>>2]=e;if(e){c[o>>2]=609;if((c[215]|0)==-1)c[215]=Yb(1,20903,19605,19976,c[o>>2]|0)|0;if(($b()|0)<=0){if(c[215]|0){o=sd(c[m>>2]|0)|0;c[d>>2]=19903;c[d+4>>2]=19605;c[d+8>>2]=609;c[d+12>>2]=o;gc(1,20903,20454,d)}}else ac(-1,0);Ad(c[k>>2]|0);c[f>>2]=0;r=c[f>>2]|0;i=a;return r|0}Ad(c[k>>2]|0);k=qc(l,c[h>>2]|0,37752,35402)|0;c[m>>2]=k;if(!k){Ad(c[h>>2]|0);c[g>>2]=Qb(32,19605,629)|0;Fc(c[g>>2]|0,32,c[l>>2]|0);Gd(c[l>>2]|0);c[f>>2]=c[g>>2];r=c[f>>2]|0;i=a;return r|0}c[p>>2]=624;if((c[216]|0)==-1)c[216]=Yb(1,20903,19605,19976,c[p>>2]|0)|0;if(($b()|0)<=0){if(c[216]|0){p=sd(c[m>>2]|0)|0;c[b>>2]=19918;c[b+4>>2]=19605;c[b+8>>2]=624;c[b+12>>2]=p;gc(1,20903,20454,b)}}else ac(-1,0);Ad(c[h>>2]|0);c[f>>2]=0;r=c[f>>2]|0;i=a;return r|0}function sc(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0;e=i;i=i+80|0;if((i|0)>=(j|0))U();f=e+16|0;g=e;h=e+68|0;k=e+64|0;l=e+60|0;m=e+56|0;n=e+52|0;o=e+48|0;p=e+44|0;q=e+40|0;r=e+32|0;s=e+28|0;t=e+24|0;c[k>>2]=a;c[l>>2]=b;c[m>>2]=d;c[n>>2]=mc(c[k>>2]|0)|0;c[p>>2]=tc(c[l>>2]|0)|0;l=fe(o,c[p>>2]|0,c[n>>2]|0)|0;c[q>>2]=l;if(l){c[s>>2]=807;if((c[218]|0)==-1)c[218]=Yb(2,20903,19605,20071,c[s>>2]|0)|0;if(($b()|0)<=0){if(c[218]|0){s=sd(c[q>>2]|0)|0;c[g>>2]=19605;c[g+4>>2]=807;c[g+8>>2]=s;gc(2,20903,20096,g)}}else ac(-1,0);Ad(c[p>>2]|0);Ad(c[n>>2]|0);c[h>>2]=-1;u=c[h>>2]|0;i=e;return u|0}Ad(c[n>>2]|0);Ad(c[p>>2]|0);p=qc(r,c[o>>2]|0,37614,46975)|0;c[q>>2]=p;if(!p){Ad(c[o>>2]|0);Fc(c[m>>2]|0,32,c[r>>2]|0);Fc((c[m>>2]|0)+32|0,32,c[r+4>>2]|0);Gd(c[r>>2]|0);Gd(c[r+4>>2]|0);c[h>>2]=1;u=c[h>>2]|0;i=e;return u|0}c[t>>2]=819;if((c[219]|0)==-1)c[219]=Yb(1,0,19605,20071,c[t>>2]|0)|0;if(($b()|0)<=0){if(c[219]|0){c[f>>2]=19605;c[f+4>>2]=819;bc(1,61409,f)}}else ac(-1,0);Ad(c[o>>2]|0);c[h>>2]=-1;u=c[h>>2]|0;i=e;return u|0}function tc(a){a=a|0;var b=0,e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0;b=i;i=i+128|0;if((i|0)>=(j|0))U();e=b+16|0;f=b;g=b+116|0;h=b+112|0;k=b+48|0;l=b+40|0;m=b+36|0;n=b+32|0;c[h>>2]=a;a=c[h>>2]|0;o=c[h>>2]|0;wc(a,wv(d[o>>0]|d[o+1>>0]<<8|d[o+2>>0]<<16|d[o+3>>0]<<24)|0,k);c[f>>2]=37672;c[f+4>>2]=64;c[f+8>>2]=k;k=zd(l,0,20007,f)|0;c[m>>2]=k;if(!k){c[g>>2]=c[l>>2];p=c[g>>2]|0;i=b;return p|0}c[n>>2]=698;if((c[217]|0)==-1)c[217]=Yb(1,20903,19605,20051,c[n>>2]|0)|0;if(($b()|0)<=0){if(c[217]|0){n=sd(c[m>>2]|0)|0;c[e>>2]=19618;c[e+4>>2]=19605;c[e+8>>2]=698;c[e+12>>2]=n;gc(1,20903,20454,e)}}else ac(-1,0);c[g>>2]=0;p=c[g>>2]|0;i=b;return p|0}function uc(a,b,e,f){a=a|0;b=b|0;e=e|0;f=f|0;var g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0;g=i;i=i+96|0;if((i|0)>=(j|0))U();h=g+40|0;k=g+32|0;l=g+16|0;m=g;n=g+92|0;o=g+88|0;p=g+84|0;q=g+80|0;r=g+76|0;s=g+72|0;t=g+68|0;u=g+64|0;v=g+60|0;w=g+56|0;x=g+52|0;c[o>>2]=a;c[p>>2]=b;c[q>>2]=e;c[r>>2]=f;f=c[o>>2]|0;o=(c[p>>2]|0)+4|0;if((f|0)!=(wv(d[o>>0]|d[o+1>>0]<<8|d[o+2>>0]<<16|d[o+3>>0]<<24)|0)){c[n>>2]=-1;y=c[n>>2]|0;i=g;return y|0}o=c[q>>2]|0;f=(c[q>>2]|0)+32|0;c[m>>2]=32;c[m+4>>2]=o;c[m+8>>2]=32;c[m+12>>2]=f;f=zd(t,0,20170,m)|0;c[v>>2]=f;if(f){c[w>>2]=918;if((c[220]|0)==-1)c[220]=Yb(1,20903,19605,20199,c[w>>2]|0)|0;if(($b()|0)<=0){if(c[220]|0){w=sd(c[v>>2]|0)|0;c[l>>2]=19618;c[l+4>>2]=19605;c[l+8>>2]=918;c[l+12>>2]=w;gc(1,20903,20454,l)}}else ac(-1,0);c[n>>2]=-1;y=c[n>>2]|0;i=g;return y|0}c[s>>2]=tc(c[p>>2]|0)|0;p=c[r>>2]|0;c[k>>2]=32;c[k+4>>2]=p;p=zd(u,0,20226,k)|0;c[v>>2]=p;if(p){Ad(c[s>>2]|0);Ad(c[t>>2]|0);c[n>>2]=-1;y=c[n>>2]|0;i=g;return y|0}c[v>>2]=ge(c[t>>2]|0,c[s>>2]|0,c[u>>2]|0)|0;Ad(c[u>>2]|0);Ad(c[s>>2]|0);Ad(c[t>>2]|0);if(!(c[v>>2]|0)){c[n>>2]=1;y=c[n>>2]|0;i=g;return y|0}c[x>>2]=938;if((c[221]|0)==-1)c[221]=Yb(4,20903,19605,20199,c[x>>2]|0)|0;if(($b()|0)<=0){if(c[221]|0){x=sd(c[v>>2]|0)|0;c[h>>2]=19605;c[h+4>>2]=938;c[h+8>>2]=x;gc(4,20903,20278,h)}}else ac(-1,0);c[n>>2]=-1;y=c[n>>2]|0;i=g;return y|0}function vc(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0;e=i;i=i+144|0;if((i|0)>=(j|0))U();f=e+40|0;g=e+32|0;h=e+16|0;k=e+8|0;l=e;m=e+104|0;n=e+100|0;o=e+96|0;p=e+92|0;q=e+88|0;r=e+84|0;s=e+80|0;t=e+76|0;u=e+72|0;v=e+68|0;w=e+112|0;x=e+64|0;y=e+60|0;z=e+56|0;A=e+52|0;B=e+48|0;c[n>>2]=a;c[o>>2]=b;c[p>>2]=d;d=c[o>>2]|0;c[l>>2]=32;c[l+4>>2]=d;if(zd(u,0,20131,l)|0){c[m>>2]=-1;C=c[m>>2]|0;i=e;return C|0}if(Pd(t,c[u>>2]|0,0)|0){c[y>>2]=972;if((c[222]|0)==-1)c[222]=Yb(1,0,19605,20328,c[y>>2]|0)|0;if(($b()|0)>0){ac(-1,0);Xb()}if(!(c[222]|0))Xb();c[k>>2]=19605;c[k+4>>2]=972;bc(1,61409,k);Xb()}Ad(c[u>>2]|0);c[r>>2]=Rd(49689,c[t>>2]|0,0)|0;Hc(s,c[n>>2]|0,32);c[q>>2]=Nd(0)|0;Td(c[q>>2]|0,c[s>>2]|0,c[r>>2]|0,c[t>>2]|0);Od(c[r>>2]|0);Gd(c[s>>2]|0);c[v>>2]=Fd(256)|0;if(Sd(c[v>>2]|0,0,c[q>>2]|0,c[t>>2]|0)|0){c[z>>2]=989;if((c[223]|0)==-1)c[223]=Yb(1,20903,19605,20328,c[z>>2]|0)|0;if(($b()|0)<=0){if(c[223]|0){z=sd(0)|0;c[h>>2]=20351;c[h+4>>2]=19605;c[h+8>>2]=989;c[h+12>>2]=z;gc(1,20903,20454,h)}}else ac(-1,0);Od(c[q>>2]|0);ue(c[t>>2]|0);c[m>>2]=-1;C=c[m>>2]|0;i=e;return C|0}Od(c[q>>2]|0);ue(c[t>>2]|0);c[x>>2]=32;if(Yd(c[v>>2]|0,2)|0){c[A>>2]=998;if((c[224]|0)==-1)c[224]=Yb(1,0,19605,20328,c[A>>2]|0)|0;if(($b()|0)>0){ac(-1,0);Xb()}if(!(c[224]|0))Xb();c[g>>2]=19605;c[g+4>>2]=998;bc(1,61409,g);Xb()}if(!(Jd(1,w,c[x>>2]|0,x,c[v>>2]|0)|0)){wc(w,c[x>>2]|0,c[p>>2]|0);Gd(c[v>>2]|0);c[m>>2]=1;C=c[m>>2]|0;i=e;return C|0}c[B>>2]=1005;if((c[225]|0)==-1)c[225]=Yb(1,0,19605,20328,c[B>>2]|0)|0;if(($b()|0)>0){ac(-1,0);Xb()}if(!(c[225]|0))Xb();c[f>>2]=19605;c[f+4>>2]=1005;bc(1,61409,f);Xb();return 0}function wc(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=i;i=i+16|0;if((i|0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0)+1|0)|0;if(!(c[A>>2]|0)){c[K>>2]=4;break}else{Ow(c[p>>2]|0,c[A>>2]|0,c[E>>2]|0)|0;c[p>>2]=(c[p>>2]|0)+(c[E>>2]|0);S=18;break}}else S=18;while(0);b:do if((S|0)==18){c[B>>2]=1;while(1){if((c[B>>2]|0)>>>0>=(c[C>>2]|0)>>>0)break;Ow(r|0,(c[p>>2]|0)+(0-(c[E>>2]|0))|0,c[E>>2]|0)|0;Sw(r+(c[E>>2]|0)+(c[I>>2]|0)|0,(c[B>>2]|0)+1&255|0,1)|0;le(c[z>>2]|0);c[A>>2]=Ac(c[z>>2]|0,l,c[F>>2]|0,r,c[L>>2]|0)|0;if(!(c[A>>2]|0)){S=21;break}Ow(c[p>>2]|0,c[A>>2]|0,c[E>>2]|0)|0;c[p>>2]=(c[p>>2]|0)+(c[E>>2]|0);c[B>>2]=(c[B>>2]|0)+1}if((S|0)==21){c[K>>2]=4;break}do if((c[D>>2]|0)>>>0>0){if((c[C>>2]|0)>>>0>0){Ow(r|0,(c[p>>2]|0)+(0-(c[E>>2]|0))|0,c[E>>2]|0)|0;c[B>>2]=(c[B>>2]|0)+1}Sw(r+(c[E>>2]|0)+(c[I>>2]|0)|0,c[B>>2]&255|0,1)|0;le(c[z>>2]|0);s=c[z>>2]|0;m=c[F>>2]|0;if((c[C>>2]|0)>>>0>0)c[A>>2]=Ac(s,l,m,r,c[L>>2]|0)|0;else c[A>>2]=Ac(s,l,m,r+(c[E>>2]|0)|0,(c[L>>2]|0)-(c[E>>2]|0)|0)|0;if(!(c[A>>2]|0)){c[K>>2]=4;break b}else{Ow(c[p>>2]|0,c[A>>2]|0,c[D>>2]|0)|0;break}}while(0);c[H>>2]=1;c[K>>2]=10}while(0);Aa(c[M>>2]|0);switch(c[K>>2]|0){case 4:{S=34;break a;break}case 10:{break a;break}default:{}}Q=c[G>>2]|0;Aa(Q|0);R=c[o>>2]|0;i=n;return R|0}while(0);if((S|0)==34)c[H>>2]=-1;ke(c[y>>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A=0,B=0,C=0,D=0,E=0,F=0;k=i;i=i+112|0;if((i|0)>=(j|0))U();l=k+40|0;m=k+32|0;n=k+24|0;o=k;p=k+104|0;q=k+100|0;r=k+96|0;s=k+92|0;t=k+88|0;u=k+84|0;v=k+80|0;w=k+76|0;x=k+72|0;y=k+68|0;z=k+64|0;A=k+60|0;B=k+56|0;C=k+52|0;D=k+48|0;c[p>>2]=a;c[q>>2]=b;c[r>>2]=d;c[s>>2]=e;c[t>>2]=f;c[u>>2]=g;c[v>>2]=h;c[x>>2]=Ud(c[q>>2]|0)|0;c[z>>2]=0;while(1){h=((((c[x>>2]|0)-1|0)>>>0)/8|0)+1|0;c[A>>2]=Wa()|0;g=i;i=i+((1*h|0)+15&-16)|0;if((i|0)>=(j|0))U();f=c[r>>2]|0;e=c[s>>2]|0;d=c[t>>2]|0;b=c[u>>2]|0;a=c[v>>2]|0;E=Tu(c[v>>2]|0)|0;c[o>>2]=a;c[o+4>>2]=E;c[o+8>>2]=z;c[o+12>>2]=4;c[o+16>>2]=0;c[o+20>>2]=0;c[w>>2]=Dc(g,h,f,e,d,b,o)|0;if(1!=(c[w>>2]|0)){F=3;break}c[w>>2]=Id(c[p>>2]|0,5,g,h,y)|0;if(c[w>>2]|0){F=11;break}Wd(c[c[p>>2]>>2]|0,c[x>>2]|0);if(Vd(c[c[p>>2]>>2]|0,c[x>>2]|0)|0){F=19;break}c[z>>2]=(c[z>>2]|0)+1;Aa(c[A>>2]|0);if(0>(Hd(c[c[p>>2]>>2]|0,c[q>>2]|0)|0)){F=27;break}}if((F|0)==3){c[B>>2]=135;if((c[226]|0)==-1)c[226]=Yb(1,0,20369,20382,c[B>>2]|0)|0;if(($b()|0)>0){ac(-1,0);Xb()}if(!(c[226]|0))Xb();c[n>>2]=20369;c[n+4>>2]=135;bc(1,61409,n);Xb()}else if((F|0)==11){c[C>>2]=142;if((c[227]|0)==-1)c[227]=Yb(1,0,20369,20382,c[C>>2]|0)|0;if(($b()|0)>0){ac(-1,0);Xb()}if(!(c[227]|0))Xb();c[m>>2]=20369;c[m+4>>2]=142;bc(1,61409,m);Xb()}else if((F|0)==19){c[D>>2]=145;if((c[228]|0)==-1)c[228]=Yb(1,0,20369,20382,c[D>>2]|0)|0;if(($b()|0)>0){ac(-1,0);Xb()}if(!(c[228]|0))Xb();c[l>>2]=20369;c[l+4>>2]=145;bc(1,61409,l);Xb()}else if((F|0)==27){i=k;return}}function Fc(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;e=i;i=i+80|0;if((i|0)>=(j|0))U();f=e+24|0;g=e+8|0;h=e;k=e+68|0;l=e+64|0;m=e+60|0;n=e+56|0;o=e+52|0;p=e+48|0;q=e+44|0;r=e+40|0;s=e+36|0;t=e+32|0;c[k>>2]=a;c[l>>2]=b;c[m>>2]=d;if(Yd(c[m>>2]|0,2)|0){c[q>>2]=Xd(c[m>>2]|0,p)|0;if(c[q>>2]|0){c[n>>2]=(((c[p>>2]|0)+7|0)>>>0)/8|0;if((c[n>>2]|0)>>>0>(c[l>>2]|0)>>>0)c[n>>2]=c[l>>2];Ow(c[k>>2]|0,c[q>>2]|0,c[n>>2]|0)|0;if((c[n>>2]|0)>>>0>=(c[l>>2]|0)>>>0){i=e;return}Sw((c[k>>2]|0)+(c[n>>2]|0)|0,0,(c[l>>2]|0)-(c[n>>2]|0)|0)|0;i=e;return}c[r>>2]=89;if((c[229]|0)==-1)c[229]=Yb(1,0,20408,20421,c[r>>2]|0)|0;if(($b()|0)>0){ac(-1,0);Xb()}if(!(c[229]|0))Xb();c[h>>2]=20408;c[h+4>>2]=89;bc(1,61409,h);Xb()}c[n>>2]=c[l>>2];h=Jd(5,c[k>>2]|0,c[n>>2]|0,n,c[m>>2]|0)|0;c[o>>2]=h;if(!h){Gc(c[k>>2]|0,c[n>>2]|0,c[l>>2]|0);i=e;return}c[s>>2]=110;if((c[230]|0)==-1)c[230]=Yb(1,20903,20408,20421,c[s>>2]|0)|0;if(($b()|0)<=0){if(c[230]|0){s=sd(c[o>>2]|0)|0;c[g>>2]=20491;c[g+4>>2]=20408;c[g+8>>2]=110;c[g+12>>2]=s;gc(1,20903,20454,g)}}else ac(-1,0);c[t>>2]=111;if((c[231]|0)==-1)c[231]=Yb(1,0,20408,20421,c[t>>2]|0)|0;if(($b()|0)>0){ac(-1,0);Xb()}if(!(c[231]|0))Xb();c[f>>2]=20408;c[f+4>>2]=111;bc(1,61409,f);Xb()}function Gc(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,k=0;e=i;i=i+16|0;if((i|0)>=(j|0))U();f=e+12|0;g=e+8|0;h=e+4|0;k=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;c[k>>2]=c[f>>2];if((c[g>>2]|0)>>>0>=(c[h>>2]|0)>>>0){i=e;return}Qw((c[k>>2]|0)+((c[h>>2]|0)-(c[g>>2]|0))|0,c[f>>2]|0,c[g>>2]|0)|0;Sw(c[f>>2]|0,0,(c[h>>2]|0)-(c[g>>2]|0)|0)|0;i=e;return}function Hc(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0;e=i;i=i+48|0;if((i|0)>=(j|0))U();f=e+16|0;g=e;h=e+44|0;k=e+40|0;l=e+36|0;m=e+32|0;n=e+28|0;o=e+24|0;c[h>>2]=a;c[k>>2]=b;c[l>>2]=d;d=Id(c[h>>2]|0,5,c[k>>2]|0,c[l>>2]|0,l)|0;c[m>>2]=d;if(!d){i=e;return}c[n>>2]=140;if((c[232]|0)==-1)c[232]=Yb(1,20903,20408,20506,c[n>>2]|0)|0;if(($b()|0)<=0){if(c[232]|0){n=sd(c[m>>2]|0)|0;c[g>>2]=20538;c[g+4>>2]=20408;c[g+8>>2]=140;c[g+12>>2]=n;gc(1,20903,20454,g)}}else ac(-1,0);c[o>>2]=141;if((c[233]|0)==-1)c[233]=Yb(1,0,20408,20506,c[o>>2]|0)|0;if(($b()|0)>0){ac(-1,0);Xb()}if(!(c[233]|0))Xb();c[f>>2]=20408;c[f+4>>2]=141;bc(1,61409,f);Xb()}function Ic(){var a=0,b=0,d=0,e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;a=i;i=i+80|0;if((i|0)>=(j|0))U();b=a+56|0;d=a+48|0;e=a+40|0;f=a+32|0;g=a+24|0;h=a+16|0;k=a+8|0;l=a;m=a+64|0;n=a+60|0;if(wd(20552)|0){c[h>>2]=0;o=xd(37,h)|0;c[m>>2]=o;if(o|0){o=c[3960]|0;h=sd(c[m>>2]|0)|0;c[g>>2]=20705;c[g+4>>2]=h;pv(o,20666,g)|0}c[f>>2]=0;g=xd(44,f)|0;c[m>>2]=g;if(!g){c[d>>2]=0;xd(38,d)|0;c[b>>2]=0;xd(48,b)|0;p=ib(0)|0;q=Jc(2,-1)|0;r=p^q;Lc(r);i=a;return}g=c[3960]|0;f=sd(c[m>>2]|0)|0;c[e>>2]=20720;c[e+4>>2]=f;pv(g,20666,e)|0;c[d>>2]=0;xd(38,d)|0;c[b>>2]=0;xd(48,b)|0;p=ib(0)|0;q=Jc(2,-1)|0;r=p^q;Lc(r);i=a;return}a=c[3960]|0;c[l>>2]=20552;pv(a,20558,l)|0;c[n>>2]=286;if((c[234]|0)==-1)c[234]=Yb(1,0,20624,20640,c[n>>2]|0)|0;if(($b()|0)>0){ac(-1,0);Xb()}if(!(c[234]|0))Xb();c[k>>2]=20624;c[k+4>>2]=286;bc(1,61409,k);Xb()}function Jc(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0.0;d=i;i=i+64|0;if((i|0)>=(j|0))U();e=d+16|0;f=d+8|0;g=d;h=d+48|0;k=d+44|0;l=d+40|0;m=d+36|0;n=d+32|0;o=d+28|0;p=d+24|0;c[k>>2]=a;c[l>>2]=b;if((c[l>>2]|0)>>>0<=0){c[o>>2]=157;if((c[235]|0)==-1)c[235]=Yb(1,0,20624,20740,c[o>>2]|0)|0;if(($b()|0)>0){ac(-1,0);Xb()}if(!(c[235]|0))Xb();c[g>>2]=20624;c[g+4>>2]=157;bc(1,61409,g);Xb()}switch(c[k>>2]|0){case 1:{k=c[17608]|0;c[17608]=k+1;if(!((k>>>0)%256|0)){c[f>>2]=0;xd(48,f)|0}c[n>>2]=-1-(4294967295%((c[l>>2]|0)>>>0)|0);do se(m,4,1);while((c[m>>2]|0)>>>0>=(c[n>>2]|0)>>>0);c[h>>2]=((c[m>>2]|0)>>>0)%((c[l>>2]|0)>>>0)|0;q=c[h>>2]|0;i=d;return q|0}case 2:{c[n>>2]=-1-(4294967295%((c[l>>2]|0)>>>0)|0);do te(m,4);while((c[m>>2]|0)>>>0>=(c[n>>2]|0)>>>0);c[h>>2]=((c[m>>2]|0)>>>0)%((c[l>>2]|0)>>>0)|0;q=c[h>>2]|0;i=d;return q|0}case 0:{r=+((c[l>>2]|0)>>>0);c[m>>2]=~~(r*+Kc())>>>0;if((c[m>>2]|0)>>>0>=(c[l>>2]|0)>>>0)c[m>>2]=(c[l>>2]|0)-1;c[h>>2]=c[m>>2];q=c[h>>2]|0;i=d;return q|0}default:{c[p>>2]=189;if((c[236]|0)==-1)c[236]=Yb(1,0,20624,20740,c[p>>2]|0)|0;if(($b()|0)>0){ac(-1,0);Xb()}if(!(c[236]|0))Xb();c[e>>2]=20624;c[e+4>>2]=189;bc(1,61409,e);Xb()}}return 0}function Kc(){return +(+(lw()|0)/2147483647.0)}function Lc(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b;c[d>>2]=a;jw(c[d>>2]|0);i=b;return}function Mc(){ve(0,0);return}function Nc(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0;e=i;i=i+48|0;if((i|0)>=(j|0))U();f=e+16|0;g=e+8|0;h=e;k=e+36|0;l=e+32|0;m=e+28|0;n=e+24|0;c[k>>2]=a;c[l>>2]=b;c[m>>2]=d;switch(c[k>>2]|0){case 1:{k=c[17609]|0;c[17609]=k+1;if(!((k>>>0)%256|0)){c[h>>2]=0;xd(48,h)|0}se(c[l>>2]|0,c[m>>2]|0,1);i=e;return}case 2:{te(c[l>>2]|0,c[m>>2]|0);i=e;return}case 0:{h=c[17609]|0;c[17609]=h+1;if(!((h>>>0)%256|0)){c[g>>2]=0;xd(48,g)|0}se(c[l>>2]|0,c[m>>2]|0,0);i=e;return}default:{c[n>>2]=135;if((c[237]|0)==-1)c[237]=Yb(1,0,20624,20765,c[n>>2]|0)|0;if(($b()|0)>0){ac(-1,0);Xb()}if(!(c[237]|0))Xb();c[f>>2]=20624;c[f+4>>2]=135;bc(1,61409,f);Xb()}}}function Oc(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0;b=i;i=i+48|0;if((i|0)>=(j|0))U();d=b+16|0;e=b+8|0;f=b;g=b+44|0;h=b+40|0;k=b+36|0;l=b+32|0;m=b+28|0;n=b+24|0;c[g>>2]=a;c[f>>2]=c[g>>2];if(zd(l,0,20792,f)|0){c[m>>2]=155;if((c[238]|0)==-1)c[238]=Yb(1,0,20816,20829,c[m>>2]|0)|0;if(($b()|0)>0){ac(-1,0);Xb()}if(!(c[238]|0))Xb();c[e>>2]=20816;c[e+4>>2]=155;bc(1,61409,e);Xb()}if(!(ie(k,c[l>>2]|0)|0)){Ad(c[l>>2]|0);c[h>>2]=Qb(4,20816,164)|0;c[c[h>>2]>>2]=c[k>>2];i=b;return c[h>>2]|0}c[n>>2]=158;if((c[239]|0)==-1)c[239]=Yb(1,0,20816,20829,c[n>>2]|0)|0;if(($b()|0)>0){ac(-1,0);Xb()}if(!(c[239]|0))Xb();c[d>>2]=20816;c[d+4>>2]=158;bc(1,61409,d);Xb();return 0}function Pc(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b;c[d>>2]=a;Ad(c[c[d>>2]>>2]|0);Sb(c[d>>2]|0,20816,179);i=b;return}function Qc(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,k=0,l=0;d=i;i=i+32|0;if((i|0)>=(j|0))U();e=d;f=d+24|0;g=d+20|0;h=d+16|0;k=d+12|0;l=d+8|0;c[f>>2]=a;c[g>>2]=b;c[h>>2]=Bd(c[c[f>>2]>>2]|0,0,0,0)|0;c[k>>2]=Qb(c[h>>2]|0,20816,202)|0;b=(c[h>>2]|0)-1|0;if((b|0)==(Bd(c[c[f>>2]>>2]|0,0,c[k>>2]|0,c[h>>2]|0)|0)){c[c[g>>2]>>2]=c[k>>2];i=d;return c[h>>2]|0}c[l>>2]=207;if((c[240]|0)==-1)c[240]=Yb(1,0,20816,20866,c[l>>2]|0)|0;if(($b()|0)>0){ac(-1,0);Xb()}if(!(c[240]|0))Xb();c[e>>2]=20816;c[e+4>>2]=207;bc(1,61409,e);Xb();return 0}function Rc(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0;d=i;i=i+48|0;if((i|0)>=(j|0))U();e=d+8|0;f=d;g=d+32|0;h=d+28|0;k=d+24|0;l=d+20|0;m=d+16|0;n=d+12|0;c[h>>2]=a;c[k>>2]=b;c[l>>2]=Qb(4,20816,226)|0;if(yd(c[l>>2]|0,c[h>>2]|0,c[k>>2]|0,0)|0){c[m>>2]=234;if((c[241]|0)==-1)c[241]=Yb(2,20903,20816,20908,c[m>>2]|0)|0;if(($b()|0)<=0){if(c[241]|0)gc(2,20903,20945,f)}else ac(-1,0);Sb(c[l>>2]|0,20816,235);c[g>>2]=0;o=c[g>>2]|0;i=d;return o|0}if(!(he(c[c[l>>2]>>2]|0)|0)){c[g>>2]=c[l>>2];o=c[g>>2]|0;i=d;return o|0}c[n>>2]=241;if((c[242]|0)==-1)c[242]=Yb(2,20903,20816,20908,c[n>>2]|0)|0;if(($b()|0)<=0){if(c[242]|0)gc(2,20903,20945,e)}else ac(-1,0);Pc(c[l>>2]|0);c[g>>2]=0;o=c[g>>2]|0;i=d;return o|0}function Sc(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0;b=i;i=i+64|0;if((i|0)>=(j|0))U();d=b+8|0;e=b;f=b+48|0;g=b+44|0;h=b+40|0;k=b+32|0;l=b+24|0;m=b+20|0;n=b+16|0;c[g>>2]=a;c[l>>2]=Tc(k,c[c[g>>2]>>2]|0,37764,39177)|0;if(c[l>>2]|0)c[l>>2]=Tc(k,c[c[g>>2]>>2]|0,37752,39177)|0;if(c[l>>2]|0)c[l>>2]=Tc(k,c[c[g>>2]>>2]|0,39136,39177)|0;if(!(c[l>>2]|0)){g=c[k+4>>2]|0;c[d>>2]=c[k>>2];c[d+4>>2]=g;c[l>>2]=zd(m,0,21068,d)|0;Gd(c[k>>2]|0);Gd(c[k+4>>2]|0);c[h>>2]=Qb(4,20816,280)|0;c[c[h>>2]>>2]=c[m>>2];c[f>>2]=c[h>>2];o=c[f>>2]|0;i=b;return o|0}c[n>>2]=270;if((c[243]|0)==-1)c[243]=Yb(2,0,20816,20979,c[n>>2]|0)|0;if(($b()|0)<=0){if(c[243]|0){c[e>>2]=20816;c[e+4>>2]=270;bc(34,21020,e)}}else ac(-1,0);c[f>>2]=0;o=c[f>>2]|0;i=b;return o|0}function Tc(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0;g=i;i=i+48|0;if((i|0)>=(j|0))U();h=g+36|0;k=g+32|0;l=g+28|0;m=g+24|0;n=g+20|0;o=g+16|0;p=g+12|0;q=g+8|0;r=g+4|0;s=g;c[k>>2]=b;c[l>>2]=d;c[m>>2]=e;c[n>>2]=f;f=Cd(c[l>>2]|0,c[m>>2]|0,0)|0;c[o>>2]=f;if(!f){c[h>>2]=1;t=c[h>>2]|0;i=g;return t|0}c[p>>2]=Dd(c[o>>2]|0)|0;Ad(c[o>>2]|0);c[o>>2]=c[p>>2];if(!(c[o>>2]|0)){c[h>>2]=2;t=c[h>>2]|0;i=g;return t|0}c[s>>2]=0;c[q>>2]=c[n>>2];while(1){u=c[o>>2]|0;if(!(a[c[q>>2]>>0]|0)){v=18;break}n=Cd(u,c[q>>2]|0,1)|0;c[p>>2]=n;if(!n){v=8;break}n=Ed(c[p>>2]|0,1,5)|0;c[(c[k>>2]|0)+(c[s>>2]<<2)>>2]=n;Ad(c[p>>2]|0);if(!(c[(c[k>>2]|0)+(c[s>>2]<<2)>>2]|0)){v=13;break}c[q>>2]=(c[q>>2]|0)+1;c[s>>2]=(c[s>>2]|0)+1}if((v|0)==8){c[r>>2]=0;while(1){if((c[r>>2]|0)>>>0>=(c[s>>2]|0)>>>0)break;we(c[(c[k>>2]|0)+(c[r>>2]<<2)>>2]|0);c[(c[k>>2]|0)+(c[r>>2]<<2)>>2]=0;c[r>>2]=(c[r>>2]|0)+1}Ad(c[o>>2]|0);c[h>>2]=3;t=c[h>>2]|0;i=g;return t|0}else if((v|0)==13){c[r>>2]=0;while(1){if((c[r>>2]|0)>>>0>=(c[s>>2]|0)>>>0)break;we(c[(c[k>>2]|0)+(c[r>>2]<<2)>>2]|0);c[(c[k>>2]|0)+(c[r>>2]<<2)>>2]=0;c[r>>2]=(c[r>>2]|0)+1}Ad(c[o>>2]|0);c[h>>2]=4;t=c[h>>2]|0;i=g;return t|0}else if((v|0)==18){Ad(u);c[h>>2]=0;t=c[h>>2]|0;i=g;return t|0}return 0}function Uc(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b;c[d>>2]=a;Ad(c[c[d>>2]>>2]|0);Sb(c[d>>2]|0,20816,295);i=b;return}function Vc(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,k=0,l=0;d=i;i=i+32|0;if((i|0)>=(j|0))U();e=d;f=d+24|0;g=d+20|0;h=d+16|0;k=d+12|0;l=d+8|0;c[f>>2]=a;c[g>>2]=b;c[h>>2]=Bd(c[c[f>>2]>>2]|0,3,0,0)|0;c[k>>2]=Qb(c[h>>2]|0,20816,318)|0;b=(c[h>>2]|0)-1|0;if((b|0)==(Bd(c[c[f>>2]>>2]|0,3,c[k>>2]|0,c[h>>2]|0)|0)){c[c[g>>2]>>2]=c[k>>2];i=d;return c[h>>2]|0}c[l>>2]=323;if((c[244]|0)==-1)c[244]=Yb(1,0,20816,21098,c[l>>2]|0)|0;if(($b()|0)>0){ac(-1,0);Xb()}if(!(c[244]|0))Xb();c[e>>2]=20816;c[e+4>>2]=323;bc(1,61409,e);Xb();return 0}function Wc(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;d=i;i=i+48|0;if((i|0)>=(j|0))U();e=d+8|0;f=d;g=d+44|0;h=d+40|0;k=d+36|0;l=d+32|0;m=d+28|0;n=d+24|0;o=d+20|0;p=d+16|0;c[h>>2]=a;c[k>>2]=b;c[l>>2]=Qb(4,20816,367)|0;if(yd(c[l>>2]|0,c[h>>2]|0,c[k>>2]|0,0)|0){c[o>>2]=374;if((c[245]|0)==-1)c[245]=Yb(2,0,20816,21134,c[o>>2]|0)|0;if(($b()|0)<=0){if(c[245]|0){c[f>>2]=20816;c[f+4>>2]=374;bc(34,21020,f)}}else ac(-1,0);Sb(c[l>>2]|0,20816,375);c[g>>2]=0;q=c[g>>2]|0;i=d;return q|0}c[n>>2]=Tc(m,c[c[l>>2]>>2]|0,37764,39191)|0;if(c[n>>2]|0)c[n>>2]=Tc(m,c[c[l>>2]>>2]|0,39136,39191)|0;if(!(c[n>>2]|0)){Gd(c[m>>2]|0);c[g>>2]=c[l>>2];q=c[g>>2]|0;i=d;return q|0}c[p>>2]=385;if((c[246]|0)==-1)c[246]=Yb(1,0,20816,21134,c[p>>2]|0)|0;if(($b()|0)<=0){if(c[246]|0){c[e>>2]=20816;c[e+4>>2]=385;bc(1,61409,e)}}else ac(-1,0);Ad(c[c[l>>2]>>2]|0);Sb(c[l>>2]|0,20816,387);c[g>>2]=0;q=c[g>>2]|0;i=d;return q|0}function Xc(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,k=0,l=0;d=i;i=i+32|0;if((i|0)>=(j|0))U();e=d;f=d+24|0;g=d+20|0;h=d+16|0;k=d+12|0;l=d+8|0;c[f>>2]=a;c[g>>2]=b;c[h>>2]=Bd(c[c[f>>2]>>2]|0,3,0,0)|0;c[k>>2]=Qb(c[h>>2]|0,20816,896)|0;b=(c[h>>2]|0)-1|0;if((b|0)==(Bd(c[c[f>>2]>>2]|0,3,c[k>>2]|0,c[h>>2]|0)|0)){c[c[g>>2]>>2]=c[k>>2];i=d;return c[h>>2]|0}c[l>>2]=901;if((c[247]|0)==-1)c[247]=Yb(1,0,20816,21170,c[l>>2]|0)|0;if(($b()|0)>0){ac(-1,0);Xb()}if(!(c[247]|0))Xb();c[e>>2]=20816;c[e+4>>2]=901;bc(1,61409,e);Xb();return 0}function Yc(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0;f=i;i=i+80|0;if((i|0)>=(j|0))U();g=f;h=f+64|0;k=f+60|0;l=f+56|0;m=f+52|0;n=f+48|0;o=f+44|0;p=f+40|0;q=f+32|0;r=f+24|0;s=f+20|0;t=f+16|0;u=f+12|0;v=f+8|0;c[k>>2]=a;c[l>>2]=b;c[m>>2]=d;c[n>>2]=e;c[u>>2]=Tc(q,c[c[m>>2]>>2]|0,37764,39177)|0;if(c[u>>2]|0)c[u>>2]=Tc(q,c[c[m>>2]>>2]|0,39136,39177)|0;if(!(c[u>>2]|0)){Zc(p,c[k>>2]|0,c[m>>2]|0);c[o>>2]=_c(c[m>>2]|0,c[l>>2]|0)|0;c[r>>2]=Fd(0)|0;Ld(c[r>>2]|0,c[c[o>>2]>>2]|0,c[q+4>>2]|0,c[q>>2]|0);c[s>>2]=Fd(0)|0;Kd(c[s>>2]|0,c[p>>2]|0,c[r>>2]|0,c[q>>2]|0);Gd(c[p>>2]|0);Gd(c[q>>2]|0);Gd(c[q+4>>2]|0);Gd(c[r>>2]|0);$c(c[o>>2]|0);c[t>>2]=ad(c[s>>2]|0,c[n>>2]|0)|0;Gd(c[s>>2]|0);c[h>>2]=c[t>>2];w=c[h>>2]|0;i=f;return w|0}c[v>>2]=704;if((c[248]|0)==-1)c[248]=Yb(1,0,20816,21205,c[v>>2]|0)|0;if(($b()|0)<=0){if(c[248]|0){c[g>>2]=20816;c[g+4>>2]=704;bc(1,61409,g)}}else ac(-1,0);c[c[n>>2]>>2]=0;c[h>>2]=0;w=c[h>>2]|0;i=f;return w|0}function Zc(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;e=i;i=i+48|0;if((i|0)>=(j|0))U();f=e+8|0;g=e;h=e+44|0;k=e+40|0;l=e+36|0;m=e+32|0;n=e+28|0;o=e+24|0;p=e+20|0;q=e+16|0;c[h>>2]=a;c[k>>2]=b;c[l>>2]=d;if(Tc(m,c[c[l>>2]>>2]|0,39136,39191)|0){c[p>>2]=657;if((c[249]|0)==-1)c[249]=Yb(1,0,20816,21229,c[p>>2]|0)|0;if(($b()|0)>0){ac(-1,0);Xb()}if(!(c[249]|0))Xb();c[g>>2]=20816;c[g+4>>2]=657;bc(1,61409,g);Xb()}if(!(Yd(c[m>>2]|0,2)|0)){c[o>>2]=Vc(c[l>>2]|0,n)|0;Ec(c[h>>2]|0,c[m>>2]|0,c[n>>2]|0,c[o>>2]|0,c[k>>2]|0,64,21250);Sb(c[n>>2]|0,20816,672);i=e;return}c[q>>2]=658;if((c[250]|0)==-1)c[250]=Yb(1,0,20816,21229,c[q>>2]|0)|0;if(($b()|0)>0){ac(-1,0);Xb()}if(!(c[250]|0))Xb();c[f>>2]=20816;c[f+4>>2]=658;bc(1,61409,f);Xb()}function _c(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0;d=i;i=i+48|0;if((i|0)>=(j|0))U();e=d+8|0;f=d;g=d+40|0;h=d+36|0;k=d+32|0;l=d+28|0;m=d+24|0;n=d+20|0;o=d+16|0;c[g>>2]=a;c[h>>2]=b;c[k>>2]=21265;c[l>>2]=Qb(4,20816,410)|0;if(Tc(m,c[c[g>>2]>>2]|0,39136,39191)|0){c[n>>2]=413;if((c[251]|0)==-1)c[251]=Yb(1,0,20816,21296,c[n>>2]|0)|0;if(($b()|0)>0){ac(-1,0);Xb()}if(!(c[251]|0))Xb();c[f>>2]=20816;c[f+4>>2]=413;bc(1,61409,f);Xb()}if(!(Yd(c[m>>2]|0,2)|0)){f=c[l>>2]|0;n=c[m>>2]|0;m=c[k>>2]|0;g=Tu(c[k>>2]|0)|0;Ec(f,n,m,g,c[h>>2]|0,32,21320);i=d;return c[l>>2]|0}c[o>>2]=414;if((c[252]|0)==-1)c[252]=Yb(1,0,20816,21296,c[o>>2]|0)|0;if(($b()|0)>0){ac(-1,0);Xb()}if(!(c[252]|0))Xb();c[e>>2]=20816;c[e+4>>2]=414;bc(1,61409,e);Xb();return 0}function $c(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b;c[d>>2]=a;Gd(c[c[d>>2]>>2]|0);Sb(c[d>>2]|0,20816,599);i=b;return}function ad(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,k=0,l=0;d=i;i=i+32|0;if((i|0)>=(j|0))U();e=d;f=d+28|0;g=d+24|0;h=d+20|0;k=d+16|0;l=d+8|0;c[f>>2]=a;c[g>>2]=b;Jd(5,0,0,h,c[f>>2]|0)|0;c[k>>2]=Qb(c[h>>2]|0,20816,623)|0;if(!(Jd(5,c[k>>2]|0,c[h>>2]|0,d+12|0,c[f>>2]|0)|0)){c[c[g>>2]>>2]=c[k>>2];i=d;return c[h>>2]|0}c[l>>2]=629;if((c[253]|0)==-1)c[253]=Yb(1,0,20816,21333,c[l>>2]|0)|0;if(($b()|0)>0){ac(-1,0);Xb()}if(!(c[253]|0))Xb();c[e>>2]=20816;c[e+4>>2]=629;bc(1,61409,e);Xb();return 0}function bd(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0;b=i;i=i+32|0;if((i|0)>=(j|0))U();d=b+8|0;e=b;f=b+24|0;g=b+20|0;h=b+16|0;c[f>>2]=a;c[g>>2]=0;c[e>>2]=c[f>>2];if(!(zd(g,0,21359,e)|0)){i=b;return c[g>>2]|0}c[h>>2]=749;if((c[254]|0)==-1)c[254]=Yb(1,0,20816,21389,c[h>>2]|0)|0;if(($b()|0)>0){ac(-1,0);Xb()}if(!(c[254]|0))Xb();c[d>>2]=20816;c[d+4>>2]=749;bc(1,61409,d);Xb();return 0}function cd(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b;c[d>>2]=a;Ad(c[c[d>>2]>>2]|0);Sb(c[d>>2]|0,20816,874);i=b;return}function dd(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;d=i;i=i+48|0;if((i|0)>=(j|0))U();e=d+8|0;f=d;g=d+44|0;h=d+40|0;k=d+36|0;l=d+32|0;m=d+28|0;n=d+24|0;o=d+20|0;p=d+16|0;c[h>>2]=a;c[k>>2]=b;c[l>>2]=Qb(4,20816,923)|0;if(yd(c[l>>2]|0,c[h>>2]|0,c[k>>2]|0,0)|0){c[o>>2]=930;if((c[255]|0)==-1)c[255]=Yb(2,0,20816,21401,c[o>>2]|0)|0;if(($b()|0)<=0){if(c[255]|0){c[f>>2]=20816;c[f+4>>2]=930;bc(34,21020,f)}}else ac(-1,0);Sb(c[l>>2]|0,20816,931);c[g>>2]=0;q=c[g>>2]|0;i=d;return q|0}c[m>>2]=Tc(n,c[c[l>>2]>>2]|0,37614,39189)|0;if(c[m>>2]|0)c[m>>2]=Tc(n,c[c[l>>2]>>2]|0,39136,39189)|0;if(!(c[m>>2]|0)){Gd(c[n>>2]|0);c[g>>2]=c[l>>2];q=c[g>>2]|0;i=d;return q|0}c[p>>2]=941;if((c[256]|0)==-1)c[256]=Yb(2,0,20816,21401,c[p>>2]|0)|0;if(($b()|0)<=0){if(c[256]|0){c[e>>2]=20816;c[e+4>>2]=941;bc(34,21020,e)}}else ac(-1,0);Ad(c[c[l>>2]>>2]|0);Sb(c[l>>2]|0,20816,943);c[g>>2]=0;q=c[g>>2]|0;i=d;return q|0}function ed(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0;e=i;i=i+112|0;if((i|0)>=(j|0))U();f=e+32|0;g=e+24|0;h=e+16|0;k=e+8|0;l=e;m=e+96|0;n=e+92|0;o=e+88|0;p=e+84|0;q=e+80|0;r=e+76|0;s=e+72|0;t=e+68|0;u=e+64|0;v=e+60|0;w=e+56|0;x=e+52|0;y=e+48|0;z=e+44|0;A=e+40|0;c[n>>2]=a;c[o>>2]=b;c[p>>2]=d;c[v>>2]=Tc(r,c[c[p>>2]>>2]|0,37764,39191)|0;if(c[v>>2]|0)c[v>>2]=Tc(r,c[c[p>>2]>>2]|0,39136,39191)|0;if(c[v>>2]|0){c[x>>2]=1004;if((c[257]|0)==-1)c[257]=Yb(2,0,20816,21436,c[x>>2]|0)|0;if(($b()|0)<=0){if(c[257]|0){c[l>>2]=20816;c[l+4>>2]=1004;bc(34,21020,l)}}else ac(-1,0);c[m>>2]=0;B=c[m>>2]|0;i=e;return B|0}c[v>>2]=Tc(s,c[c[n>>2]>>2]|0,37614,39189)|0;if(c[v>>2]|0)c[v>>2]=Tc(s,c[c[n>>2]>>2]|0,39136,39189)|0;if(c[v>>2]|0){Gd(c[r>>2]|0);c[y>>2]=1013;if((c[258]|0)==-1)c[258]=Yb(2,0,20816,21436,c[y>>2]|0)|0;if(($b()|0)<=0){if(c[258]|0){c[k>>2]=20816;c[k+4>>2]=1013;bc(34,21020,k)}}else ac(-1,0);c[m>>2]=0;B=c[m>>2]|0;i=e;return B|0}c[q>>2]=_c(c[p>>2]|0,c[o>>2]|0)|0;c[t>>2]=Fd(0)|0;if(1!=(Md(c[t>>2]|0,c[c[q>>2]>>2]|0,c[r>>2]|0)|0)){c[z>>2]=1025;if((c[259]|0)==-1)c[259]=Yb(2,0,20816,21436,c[z>>2]|0)|0;if(($b()|0)<=0){if(c[259]|0){c[h>>2]=20816;c[h+4>>2]=1025;bc(34,21020,h)}}else ac(-1,0);Gd(c[r>>2]|0);Gd(c[t>>2]|0);Gd(c[s>>2]|0);$c(c[q>>2]|0);c[m>>2]=0;B=c[m>>2]|0;i=e;return B|0}c[u>>2]=Fd(0)|0;Kd(c[u>>2]|0,c[s>>2]|0,c[t>>2]|0,c[r>>2]|0);Gd(c[r>>2]|0);Gd(c[t>>2]|0);Gd(c[s>>2]|0);$c(c[q>>2]|0);c[w>>2]=Qb(4,20816,1039)|0;q=c[w>>2]|0;c[g>>2]=c[u>>2];if(!(zd(q,0,21462,g)|0)){Gd(c[u>>2]|0);c[m>>2]=c[w>>2];B=c[m>>2]|0;i=e;return B|0}c[A>>2]=1044;if((c[260]|0)==-1)c[260]=Yb(1,0,20816,21436,c[A>>2]|0)|0;if(($b()|0)>0){ac(-1,0);Xb()}if(!(c[260]|0))Xb();c[f>>2]=20816;c[f+4>>2]=1044;bc(1,61409,f);Xb();return 0}function fd(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;e=i;i=i+48|0;if((i|0)>=(j|0))U();f=e;g=e+40|0;h=e+36|0;k=e+32|0;l=e+28|0;m=e+24|0;n=e+20|0;o=e+16|0;p=e+12|0;c[h>>2]=a;c[k>>2]=b;c[l>>2]=d;Zc(n,c[h>>2]|0,c[l>>2]|0);c[m>>2]=bd(c[n>>2]|0)|0;Gd(c[n>>2]|0);c[o>>2]=ge(c[c[k>>2]>>2]|0,c[m>>2]|0,c[c[l>>2]>>2]|0)|0;Ad(c[m>>2]|0);if(!(c[o>>2]|0)){c[g>>2]=1;q=c[g>>2]|0;i=e;return q|0}c[p>>2]=1082;if((c[261]|0)==-1)c[261]=Yb(2,20903,20816,21485,c[p>>2]|0)|0;if(($b()|0)<=0){if(c[261]|0){p=sd(c[o>>2]|0)|0;c[f>>2]=20816;c[f+4>>2]=1081;c[f+8>>2]=p;gc(2,20903,21510,f)}}else ac(-1,0);c[g>>2]=-1;q=c[g>>2]|0;i=e;return q|0}function gd(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0;d=i;i=i+48|0;if((i|0)>=(j|0))U();e=d+16|0;f=d+40|0;g=d+36|0;h=d+32|0;k=d+8|0;l=d;c[g>>2]=b;c[h>>2]=21598;b=a;m=c[b+4>>2]|0;n=k;c[n>>2]=c[b>>2];c[n+4>>2]=m;m=md()|0;n=l;c[n>>2]=m;c[n+4>>2]=C;n=l;l=a;if((c[n>>2]|0)==(c[l>>2]|0)?(c[n+4>>2]|0)==(c[l+4>>2]|0):0){c[f>>2]=21576;o=c[f>>2]|0;i=d;return o|0}l=a;if(0==(c[l>>2]|0)?0==(c[l+4>>2]|0):0){c[f>>2]=21602;o=c[f>>2]|0;i=d;return o|0}l=k;a=c[l+4>>2]|0;if(!(!(1==(c[g>>2]|0)&(a>>>0>0|(a|0)==0&(c[l>>2]|0)>>>0>5e3))?(l=k,a=Rw(c[l>>2]|0,c[l+4>>2]|0,1e3,0)|0,!(0==(a|0)&0==(C|0))):0))p=7;do if((p|0)==7){a=k;l=Vw(c[a>>2]|0,c[a+4>>2]|0,1e3,0)|0;a=k;c[a>>2]=l;c[a+4>>2]=C;c[h>>2]=21584;a=k;l=c[a+4>>2]|0;if(!(1==(c[g>>2]|0)&(l>>>0>0|(l|0)==0&(c[a>>2]|0)>>>0>5e3))?(a=k,l=Rw(c[a>>2]|0,c[a+4>>2]|0,1e3,0)|0,!(0==(l|0)&0==(C|0))):0)break;l=k;a=Vw(c[l>>2]|0,c[l+4>>2]|0,1e3,0)|0;l=k;c[l>>2]=a;c[l+4>>2]=C;c[h>>2]=39189;l=k;a=c[l+4>>2]|0;if(!(1==(c[g>>2]|0)&(a>>>0>0|(a|0)==0&(c[l>>2]|0)>>>0>300))?(l=k,a=Rw(c[l>>2]|0,c[l+4>>2]|0,60,0)|0,!(0==(a|0)&0==(C|0))):0)break;a=k;l=Vw(c[a>>2]|0,c[a+4>>2]|0,60,0)|0;a=k;c[a>>2]=l;c[a+4>>2]=C;c[h>>2]=21587;a=k;l=c[a+4>>2]|0;if(!(1==(c[g>>2]|0)&(l>>>0>0|(l|0)==0&(c[a>>2]|0)>>>0>300))?(a=k,l=Rw(c[a>>2]|0,c[a+4>>2]|0,60,0)|0,!(0==(l|0)&0==(C|0))):0)break;l=k;a=Vw(c[l>>2]|0,c[l+4>>2]|0,60,0)|0;l=k;c[l>>2]=a;c[l+4>>2]=C;c[h>>2]=35400;l=k;a=c[l+4>>2]|0;if(!(1==(c[g>>2]|0)&(a>>>0>0|(a|0)==0&(c[l>>2]|0)>>>0>120))?(l=k,a=Rw(c[l>>2]|0,c[l+4>>2]|0,24,0)|0,!(0==(a|0)&0==(C|0))):0)break;a=k;l=Vw(c[a>>2]|0,c[a+4>>2]|0,24,0)|0;a=k;c[a>>2]=l;c[a+4>>2]=C;a=k;if(1==(c[a>>2]|0)?0==(c[a+4>>2]|0):0){c[h>>2]=21589;break}else{c[h>>2]=21593;break}}while(0);g=k;k=c[g+4>>2]|0;p=c[h>>2]|0;h=e;c[h>>2]=c[g>>2];c[h+4>>2]=k;c[e+8>>2]=p;Ub(75860,128,21568,e)|0;c[f>>2]=75860;o=c[f>>2]|0;i=d;return o|0}function hd(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0;h=i;i=i+96|0;if((i|0)>=(j|0))U();k=h+24|0;l=h+16|0;m=h+8|0;n=h;o=h+84|0;p=h+80|0;q=h+76|0;r=h+72|0;s=h+68|0;t=h+64|0;u=h+60|0;v=h+56|0;w=h+52|0;x=h+48|0;y=h+44|0;z=h+40|0;A=h+36|0;B=h+32|0;c[p>>2]=b;c[q>>2]=e;c[r>>2]=f;c[s>>2]=g;c[x>>2]=c[p>>2];if((c[s>>2]|0)>>>0<((((c[q>>2]<<3)+4|0)>>>0)/5|0)>>>0){c[y>>2]=873;if((c[262]|0)==-1)c[262]=Yb(1,0,21558,21607,c[y>>2]|0)|0;if(($b()|0)<=0){if(c[262]|0){c[n>>2]=21558;c[n+4>>2]=873;bc(1,61409,n)}}else ac(-1,0);c[o>>2]=0;C=c[o>>2]|0;i=h;return C|0}c[w>>2]=0;c[t>>2]=0;c[u>>2]=0;c[v>>2]=0;while(1){if(!((c[u>>2]|0)>>>0<(c[q>>2]|0)>>>0?1:(c[w>>2]|0)>>>0>0)){D=32;break}if((c[w>>2]|0)>>>0<5?(c[u>>2]|0)>>>0<(c[q>>2]|0)>>>0:0){n=c[v>>2]<<8;y=c[u>>2]|0;c[u>>2]=y+1;c[v>>2]=n|(d[(c[x>>2]|0)+y>>0]|0);c[w>>2]=(c[w>>2]|0)+8}if((c[w>>2]|0)>>>0<5){c[v>>2]=c[v>>2]<<5-(c[w>>2]|0);if((c[w>>2]|0)!=((c[q>>2]<<3>>>0)%5|0|0)){D=15;break}c[w>>2]=5}if((c[t>>2]|0)>>>0>=(c[s>>2]|0)>>>0){D=24;break}y=a[(c[265]|0)+((c[v>>2]|0)>>>((c[w>>2]|0)-5|0)&31)>>0]|0;n=c[t>>2]|0;c[t>>2]=n+1;a[(c[r>>2]|0)+n>>0]=y;c[w>>2]=(c[w>>2]|0)-5}if((D|0)==15){c[z>>2]=890;if((c[263]|0)==-1)c[263]=Yb(1,0,21558,21607,c[z>>2]|0)|0;if(($b()|0)>0){ac(-1,0);Xb()}if(!(c[263]|0))Xb();c[m>>2]=21558;c[m+4>>2]=890;bc(1,61409,m);Xb()}else if((D|0)==24){c[A>>2]=895;if((c[264]|0)==-1)c[264]=Yb(1,0,21558,21607,c[A>>2]|0)|0;if(($b()|0)<=0){if(c[264]|0){c[l>>2]=21558;c[l+4>>2]=895;bc(1,61409,l)}}else ac(-1,0);c[o>>2]=0;C=c[o>>2]|0;i=h;return C|0}else if((D|0)==32){if(!(c[w>>2]|0)){if((c[t>>2]|0)>>>0<(c[s>>2]|0)>>>0)a[(c[r>>2]|0)+(c[t>>2]|0)>>0]=0;c[o>>2]=(c[r>>2]|0)+(c[t>>2]|0);C=c[o>>2]|0;i=h;return C|0}c[B>>2]=901;if((c[266]|0)==-1)c[266]=Yb(1,0,21558,21607,c[B>>2]|0)|0;if(($b()|0)>0){ac(-1,0);Xb()}if(!(c[266]|0))Xb();c[k>>2]=21558;c[k+4>>2]=901;bc(1,61409,k);Xb()}return 0}function id(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0;e=i;i=i+32|0;if((i|0)>=(j|0))U();f=e+20|0;g=e+16|0;h=e+12|0;k=e+8|0;l=e+4|0;m=e;c[g>>2]=b;c[h>>2]=d;c[l>>2]=c[h>>2]<<3;if((((c[l>>2]|0)>>>0)%5|0)>>>0>0)c[l>>2]=(c[l>>2]|0)+(5-(((c[l>>2]|0)>>>0)%5|0));c[l>>2]=((c[l>>2]|0)>>>0)/5|0;c[k>>2]=Qb((c[l>>2]|0)+1|0,21558,929)|0;c[m>>2]=hd(c[g>>2]|0,c[h>>2]|0,c[k>>2]|0,c[l>>2]|0)|0;if(!(c[m>>2]|0)){Sb(c[k>>2]|0,21558,933);c[f>>2]=0;n=c[f>>2]|0;i=e;return n|0}else{a[c[m>>2]>>0]=0;c[f>>2]=c[k>>2];n=c[f>>2]|0;i=e;return n|0}return 0}function jd(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0;g=i;i=i+64|0;if((i|0)>=(j|0))U();h=g;k=g+60|0;l=g+56|0;m=g+52|0;n=g+48|0;o=g+44|0;p=g+40|0;q=g+36|0;r=g+32|0;s=g+28|0;t=g+24|0;u=g+20|0;v=g+16|0;w=g+12|0;x=g+8|0;c[l>>2]=b;c[m>>2]=d;c[n>>2]=e;c[o>>2]=f;c[w>>2]=c[o>>2]<<3;if(!(c[m>>2]|0))if(!(c[o>>2]|0)){c[k>>2]=1;y=c[k>>2]|0;i=g;return y|0}else{c[k>>2]=-1;y=c[k>>2]|0;i=g;return y|0}c[v>>2]=c[n>>2];c[q>>2]=c[o>>2];c[p>>2]=c[m>>2];if((((c[w>>2]|0)>>>0)%5|0)>>>0>0){c[s>>2]=((c[w>>2]|0)>>>0)%5|0;c[u>>2]=5-(c[s>>2]|0);o=(c[p>>2]|0)+-1|0;c[p>>2]=o;n=kd(a[(c[l>>2]|0)+o>>0]|0)|0;c[t>>2]=n;c[r>>2]=n>>c[u>>2]}else{c[s>>2]=5;c[u>>2]=0;n=(c[p>>2]|0)+-1|0;c[p>>2]=n;o=kd(a[(c[l>>2]|0)+n>>0]|0)|0;c[t>>2]=o;c[r>>2]=o}if(((((c[w>>2]|0)+(c[u>>2]|0)|0)>>>0)/5|0|0)!=(c[m>>2]|0)){c[k>>2]=-1;y=c[k>>2]|0;i=g;return y|0}if(-1==(c[t>>2]|0)){c[k>>2]=-1;y=c[k>>2]|0;i=g;return y|0}while(1){z=c[p>>2]|0;if((c[q>>2]|0)>>>0<=0){A=25;break}if(!z){A=14;break}m=(c[p>>2]|0)+-1|0;c[p>>2]=m;u=kd(a[(c[l>>2]|0)+m>>0]|0)|0;c[t>>2]=u;c[r>>2]=u<<c[s>>2]|c[r>>2];if(-1==(c[t>>2]|0)){A=22;break}c[s>>2]=(c[s>>2]|0)+5;if((c[s>>2]|0)>>>0<8)continue;u=c[r>>2]&255;m=(c[q>>2]|0)+-1|0;c[q>>2]=m;a[(c[v>>2]|0)+m>>0]=u;c[r>>2]=(c[r>>2]|0)>>>8;c[s>>2]=(c[s>>2]|0)-8}if((A|0)==14){c[x>>2]=993;if((c[267]|0)==-1)c[267]=Yb(1,0,21558,21670,c[x>>2]|0)|0;if(($b()|0)<=0){if(c[267]|0){c[h>>2]=21558;c[h+4>>2]=993;bc(1,61409,h)}}else ac(-1,0);c[k>>2]=-1;y=c[k>>2]|0;i=g;return y|0}else if((A|0)==22){c[k>>2]=-1;y=c[k>>2]|0;i=g;return y|0}else if((A|0)==25)if(0!=(z|0)|0!=(c[s>>2]|0)){c[k>>2]=-1;y=c[k>>2]|0;i=g;return y|0}else{c[k>>2]=1;y=c[k>>2]|0;i=g;return y|0}return 0}function kd(b){b=b|0;var e=0,f=0,g=0,h=0,k=0;e=i;i=i+16|0;if((i|0)>=(j|0))U();f=e+4|0;g=e+8|0;h=e;a[g>>0]=b;switch(d[g>>0]|0|0){case 111:case 79:{a[g>>0]=48;break}case 76:case 108:case 73:case 105:{a[g>>0]=49;break}case 85:case 117:{a[g>>0]=86;break}default:{}}if((d[g>>0]|0|0)>=48?(d[g>>0]|0|0)<=57:0){c[f>>2]=(d[g>>0]|0)-48;k=c[f>>2]|0;i=e;return k|0}if((d[g>>0]|0|0)>=97?(d[g>>0]|0|0)<=122:0)a[g>>0]=Su(d[g>>0]|0)|0;c[h>>2]=0;if((d[g>>0]|0|0)>=65?(d[g>>0]|0|0)<=90:0){if(73<(d[g>>0]|0|0))c[h>>2]=(c[h>>2]|0)+1;if(76<(d[g>>0]|0|0))c[h>>2]=(c[h>>2]|0)+1;if(79<(d[g>>0]|0|0))c[h>>2]=(c[h>>2]|0)+1;if(85<(d[g>>0]|0|0))c[h>>2]=(c[h>>2]|0)+1;c[f>>2]=(d[g>>0]|0)-65+10-(c[h>>2]|0);k=c[f>>2]|0;i=e;return k|0}c[f>>2]=-1;k=c[f>>2]|0;i=e;return k|0}function ld(){var a=0;a=70344;C=c[a+4>>2]|0;return c[a>>2]|0}function md(){var a=0,b=0,d=0;a=i;i=i+16|0;if((i|0)>=(j|0))U();b=a;c[b>>2]=c[16];c[b+4>>2]=c[17];d=b;C=c[d+4>>2]|0;i=a;return c[d>>2]|0}function nd(){var a=0,b=0,d=0,e=0,f=0,g=0;a=i;i=i+32|0;if((i|0)>=(j|0))U();b=a+8|0;d=a;e=a+16|0;jb(e|0,0)|0;f=c[e>>2]|0;g=Xw(f|0,((f|0)<0)<<31>>31|0,1e3,0)|0;f=Xw(g|0,C|0,1e3,0)|0;g=c[e+4>>2]|0;e=Gw(f|0,C|0,g|0,((g|0)<0)<<31>>31|0)|0;g=70344;f=Gw(e|0,C|0,c[g>>2]|0,c[g+4>>2]|0)|0;g=d;c[g>>2]=f;c[g+4>>2]=C;c[b>>2]=c[d>>2];c[b+4>>2]=c[d+4>>2];d=b;C=c[d+4>>2]|0;i=a;return c[d>>2]|0}function od(){var a=0,b=0,d=0;a=i;i=i+16|0;if((i|0)>=(j|0))U();b=a;c[b>>2]=c[17588];c[b+4>>2]=c[17589];d=b;C=c[d+4>>2]|0;i=a;return c[d>>2]|0}function pd(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;b=i;i=i+32|0;if((i|0)>=(j|0))U();d=b+24|0;e=b+16|0;f=b+8|0;g=b;h=nd()|0;k=g;c[k>>2]=h;c[k+4>>2]=C;c[e>>2]=c[g>>2];c[e+4>>2]=c[g+4>>2];g=a;k=c[g+4>>2]|0;h=e;l=c[h+4>>2]|0;if(k>>>0>l>>>0|((k|0)==(l|0)?(c[g>>2]|0)>>>0>(c[h>>2]|0)>>>0:0)){h=od()|0;g=d;c[g>>2]=h;c[g+4>>2]=C;m=d;n=m;o=c[n>>2]|0;p=m+4|0;q=p;r=c[q>>2]|0;C=r;i=b;return o|0}else{g=e;e=a;a=Fw(c[g>>2]|0,c[g+4>>2]|0,c[e>>2]|0,c[e+4>>2]|0)|0;e=f;c[e>>2]=a;c[e+4>>2]=C;c[d>>2]=c[f>>2];c[d+4>>2]=c[f+4>>2];m=d;n=m;o=c[n>>2]|0;p=m+4|0;q=p;r=c[q>>2]|0;C=r;i=b;return o|0}return 0}function qd(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=i;i=i+16|0;if((i|0)>=(j|0))U();e=d;f=e;c[f>>2]=a;c[f+4>>2]=b;b=sv(c[e>>2]|0)|0;f=Gw(0,b|0,sv(c[e+4>>2]|0)|0,0)|0;i=d;return f|0}function rd(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=i;i=i+16|0;if((i|0)>=(j|0))U();e=d;f=e;c[f>>2]=a;c[f+4>>2]=b;b=wv(c[e>>2]|0)|0;f=Gw(0,b|0,wv(c[e+4>>2]|0)|0,0)|0;i=d;return f|0}function sd(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b;c[d>>2]=a;a=td(c[d>>2]|0)|0;i=b;return a|0}function td(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b;c[d>>2]=a;a=ot(c[d>>2]|0)|0;i=b;return a|0}function ud(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=i;i=i+16|0;if((i|0)>=(j|0))U();e=d+4|0;f=d;c[e>>2]=a;c[f>>2]=b;if(!(c[f>>2]|0)){g=0;i=d;return g|0}g=(c[e>>2]&127)<<24|c[f>>2]&65535;i=d;return g|0}function vd(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b;c[d>>2]=a;a=ud(1,c[d>>2]|0)|0;i=b;return a|0}function wd(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b;c[d>>2]=a;a=Ve(c[d>>2]|0)|0;i=b;return a|0}function xd(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=i;i=i+32|0;if((i|0)>=(j|0))U();e=d+20|0;f=d+16|0;g=d;c[e>>2]=a;c[g>>2]=b;c[f>>2]=vd(Ye(c[e>>2]|0,g)|0)|0;i=d;return c[f>>2]|0}function yd(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,k=0,l=0;f=i;i=i+16|0;if((i|0)>=(j|0))U();g=f+12|0;h=f+8|0;k=f+4|0;l=f;c[g>>2]=a;c[h>>2]=b;c[k>>2]=d;c[l>>2]=e;e=vd(Ff(c[g>>2]|0,c[h>>2]|0,c[k>>2]|0,c[l>>2]|0)|0)|0;i=f;return e|0}function zd(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,k=0,l=0,m=0;f=i;i=i+32|0;if((i|0)>=(j|0))U();g=f+28|0;h=f+24|0;k=f+20|0;l=f+16|0;m=f;c[g>>2]=a;c[h>>2]=b;c[k>>2]=d;c[m>>2]=e;c[l>>2]=Sf(c[g>>2]|0,c[h>>2]|0,c[k>>2]|0,m)|0;m=vd(c[l>>2]|0)|0;i=f;return m|0}function Ad(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b;c[d>>2]=a;Ef(c[d>>2]|0);i=b;return}function Bd(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,k=0,l=0;f=i;i=i+16|0;if((i|0)>=(j|0))U();g=f+12|0;h=f+8|0;k=f+4|0;l=f;c[g>>2]=a;c[h>>2]=b;c[k>>2]=d;c[l>>2]=e;e=Uf(c[g>>2]|0,c[h>>2]|0,c[k>>2]|0,c[l>>2]|0)|0;i=f;return e|0}function Cd(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=i;i=i+16|0;if((i|0)>=(j|0))U();f=e+8|0;g=e+4|0;h=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;d=Gf(c[f>>2]|0,c[g>>2]|0,c[h>>2]|0)|0;i=e;return d|0}function Dd(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b;c[d>>2]=a;a=Qf(c[d>>2]|0)|0;i=b;return a|0}function Ed(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=i;i=i+16|0;if((i|0)>=(j|0))U();f=e+8|0;g=e+4|0;h=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;d=Of(c[f>>2]|0,c[g>>2]|0,c[h>>2]|0)|0;i=e;return d|0}function Fd(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b;c[d>>2]=a;a=Ep(c[d>>2]|0)|0;i=b;return a|0}function Gd(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b;c[d>>2]=a;Gp(c[d>>2]|0);i=b;return}function Hd(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=i;i=i+16|0;if((i|0)>=(j|0))U();e=d+4|0;f=d;c[e>>2]=a;c[f>>2]=b;b=jo(c[e>>2]|0,c[f>>2]|0)|0;i=d;return b|0}function Id(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,k=0,l=0,m=0,n=0;g=i;i=i+32|0;if((i|0)>=(j|0))U();h=g+16|0;k=g+12|0;l=g+8|0;m=g+4|0;n=g;c[h>>2]=a;c[k>>2]=b;c[l>>2]=d;c[m>>2]=e;c[n>>2]=f;f=vd(Mo(c[h>>2]|0,c[k>>2]|0,c[l>>2]|0,c[m>>2]|0,c[n>>2]|0)|0)|0;i=g;return f|0}function Jd(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,k=0,l=0,m=0,n=0;g=i;i=i+32|0;if((i|0)>=(j|0))U();h=g+16|0;k=g+12|0;l=g+8|0;m=g+4|0;n=g;c[h>>2]=a;c[k>>2]=b;c[l>>2]=d;c[m>>2]=e;c[n>>2]=f;f=vd(Qo(c[h>>2]|0,c[k>>2]|0,c[l>>2]|0,c[m>>2]|0,c[n>>2]|0)|0)|0;i=g;return f|0}function Kd(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,k=0,l=0;f=i;i=i+16|0;if((i|0)>=(j|0))U();g=f+12|0;h=f+8|0;k=f+4|0;l=f;c[g>>2]=a;c[h>>2]=b;c[k>>2]=d;c[l>>2]=e;Eo(c[g>>2]|0,c[h>>2]|0,c[k>>2]|0,c[l>>2]|0);i=f;return}function Ld(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,k=0,l=0;f=i;i=i+16|0;if((i|0)>=(j|0))U();g=f+12|0;h=f+8|0;k=f+4|0;l=f;c[g>>2]=a;c[h>>2]=b;c[k>>2]=d;c[l>>2]=e;Fo(c[g>>2]|0,c[h>>2]|0,c[k>>2]|0,c[l>>2]|0);i=f;return}function Md(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=i;i=i+16|0;if((i|0)>=(j|0))U();f=e+8|0;g=e+4|0;h=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;d=yo(c[f>>2]|0,c[g>>2]|0,c[h>>2]|0)|0;i=e;return d|0}function Nd(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b;c[d>>2]=a;a=kn(c[d>>2]|0)|0;i=b;return a|0}function Od(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b;c[d>>2]=a;mn(c[d>>2]|0);i=b;return}function Pd(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=i;i=i+16|0;if((i|0)>=(j|0))U();f=e+8|0;g=e+4|0;h=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;d=vd(Jh(c[f>>2]|0,c[g>>2]|0,c[h>>2]|0)|0)|0;i=e;return d|0}function Qd(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=i;i=i+16|0;if((i|0)>=(j|0))U();f=e+8|0;g=e+4|0;h=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;d=wn(c[f>>2]|0,c[g>>2]|0,c[h>>2]|0)|0;i=e;return d|0}function Rd(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=i;i=i+16|0;if((i|0)>=(j|0))U();f=e+8|0;g=e+4|0;h=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;d=xn(c[f>>2]|0,c[g>>2]|0,c[h>>2]|0)|0;i=e;return d|0}function Sd(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,k=0,l=0;f=i;i=i+16|0;if((i|0)>=(j|0))U();g=f+12|0;h=f+8|0;k=f+4|0;l=f;c[g>>2]=a;c[h>>2]=b;c[k>>2]=d;c[l>>2]=e;e=c[g>>2]|0;g=c[h>>2]|0;h=c[k>>2]|0;k=fn(e,g,h,eh(c[l>>2]|0,1)|0)|0;i=f;return k|0}function Td(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,k=0,l=0;f=i;i=i+16|0;if((i|0)>=(j|0))U();g=f+12|0;h=f+8|0;k=f+4|0;l=f;c[g>>2]=a;c[h>>2]=b;c[k>>2]=d;c[l>>2]=e;e=c[g>>2]|0;g=c[h>>2]|0;h=c[k>>2]|0;On(e,g,h,eh(c[l>>2]|0,1)|0);i=f;return}function Ud(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b;c[d>>2]=a;a=Zn(c[d>>2]|0)|0;i=b;return a|0}function Vd(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=i;i=i+16|0;if((i|0)>=(j|0))U();e=d+4|0;f=d;c[e>>2]=a;c[f>>2]=b;b=_n(c[e>>2]|0,c[f>>2]|0)|0;i=d;return b|0}function Wd(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=i;i=i+16|0;if((i|0)>=(j|0))U();e=d+4|0;f=d;c[e>>2]=a;c[f>>2]=b;bo(c[e>>2]|0,c[f>>2]|0);i=d;return}function Xd(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=i;i=i+16|0;if((i|0)>=(j|0))U();e=d+4|0;f=d;c[e>>2]=a;c[f>>2]=b;b=tp(c[e>>2]|0,c[f>>2]|0)|0;i=d;return b|0}function Yd(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=i;i=i+16|0;if((i|0)>=(j|0))U();e=d+4|0;f=d;c[e>>2]=a;c[f>>2]=b;b=Ip(c[e>>2]|0,c[f>>2]|0)|0;i=d;return b|0}function Zd(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,k=0,l=0,m=0,n=0;f=i;i=i+32|0;if((i|0)>=(j|0))U();g=f+16|0;h=f+12|0;k=f+8|0;l=f+4|0;m=f;c[h>>2]=a;c[k>>2]=b;c[l>>2]=d;c[m>>2]=e;e=(Te()|0)!=0;d=c[h>>2]|0;if(e){c[g>>2]=vd(jh(d,c[k>>2]|0,c[l>>2]|0,c[m>>2]|0)|0)|0;n=c[g>>2]|0;i=f;return n|0}else{c[d>>2]=0;c[g>>2]=vd(176)|0;n=c[g>>2]|0;i=f;return n|0}return 0}function _d(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b;c[d>>2]=a;oh(c[d>>2]|0);i=b;return}function $d(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,k=0,l=0;e=i;i=i+16|0;if((i|0)>=(j|0))U();f=e+12|0;g=e+8|0;h=e+4|0;k=e;c[g>>2]=a;c[h>>2]=b;c[k>>2]=d;if(Te()|0){c[f>>2]=ae(wh(c[g>>2]|0,c[h>>2]|0,c[k>>2]|0)|0)|0;l=c[f>>2]|0;i=e;return l|0}else{c[f>>2]=vd(176)|0;l=c[f>>2]|0;i=e;return l|0}return 0}function ae(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b;c[d>>2]=a;a=be(32,c[d>>2]|0)|0;i=b;return a|0}function be(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=i;i=i+16|0;if((i|0)>=(j|0))U();e=d+4|0;f=d;c[e>>2]=a;c[f>>2]=b;b=ud(c[e>>2]|0,c[f>>2]|0)|0;i=d;return b|0}function ce(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,k=0,l=0;e=i;i=i+16|0;if((i|0)>=(j|0))U();f=e+12|0;g=e+8|0;h=e+4|0;k=e;c[g>>2]=a;c[h>>2]=b;c[k>>2]=d;if(Te()|0){c[f>>2]=ae(yh(c[g>>2]|0,c[h>>2]|0,c[k>>2]|0)|0)|0;l=c[f>>2]|0;i=e;return l|0}else{c[f>>2]=vd(176)|0;l=c[f>>2]|0;i=e;return l|0}return 0}function de(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0;g=i;i=i+32|0;if((i|0)>=(j|0))U();h=g+20|0;k=g+16|0;l=g+12|0;m=g+8|0;n=g+4|0;o=g;c[k>>2]=a;c[l>>2]=b;c[m>>2]=d;c[n>>2]=e;c[o>>2]=f;if(Te()|0){c[h>>2]=vd(ph(c[k>>2]|0,c[l>>2]|0,c[m>>2]|0,c[n>>2]|0,c[o>>2]|0)|0)|0;p=c[h>>2]|0;i=g;return p|0}if(c[l>>2]|0)Sw(c[l>>2]|0,66,c[m>>2]|0)|0;c[h>>2]=vd(176)|0;p=c[h>>2]|0;i=g;return p|0}function ee(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0;g=i;i=i+32|0;if((i|0)>=(j|0))U();h=g+20|0;k=g+16|0;l=g+12|0;m=g+8|0;n=g+4|0;o=g;c[k>>2]=a;c[l>>2]=b;c[m>>2]=d;c[n>>2]=e;c[o>>2]=f;if(Te()|0){c[h>>2]=vd(th(c[k>>2]|0,c[l>>2]|0,c[m>>2]|0,c[n>>2]|0,c[o>>2]|0)|0)|0;p=c[h>>2]|0;i=g;return p|0}else{c[h>>2]=vd(176)|0;p=c[h>>2]|0;i=g;return p|0}return 0}function fe(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,k=0,l=0;e=i;i=i+16|0;if((i|0)>=(j|0))U();f=e+12|0;g=e+8|0;h=e+4|0;k=e;c[g>>2]=a;c[h>>2]=b;c[k>>2]=d;d=(Te()|0)!=0;b=c[g>>2]|0;if(d){c[f>>2]=vd(Jj(b,c[h>>2]|0,c[k>>2]|0)|0)|0;l=c[f>>2]|0;i=e;return l|0}else{c[b>>2]=0;c[f>>2]=vd(176)|0;l=c[f>>2]|0;i=e;return l|0}return 0}function ge(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,k=0,l=0;e=i;i=i+16|0;if((i|0)>=(j|0))U();f=e+12|0;g=e+8|0;h=e+4|0;k=e;c[g>>2]=a;c[h>>2]=b;c[k>>2]=d;if(Te()|0){c[f>>2]=vd(Kj(c[g>>2]|0,c[h>>2]|0,c[k>>2]|0)|0)|0;l=c[f>>2]|0;i=e;return l|0}else{c[f>>2]=vd(176)|0;l=c[f>>2]|0;i=e;return l|0}return 0}function he(a){a=a|0;var b=0,d=0,e=0,f=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b+4|0;e=b;c[e>>2]=a;if(Te()|0){c[d>>2]=vd(Lj(c[e>>2]|0)|0)|0;f=c[d>>2]|0;i=b;return f|0}else{c[d>>2]=vd(176)|0;f=c[d>>2]|0;i=b;return f|0}return 0}function ie(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;d=i;i=i+16|0;if((i|0)>=(j|0))U();e=d+8|0;f=d+4|0;g=d;c[f>>2]=a;c[g>>2]=b;b=(Te()|0)!=0;a=c[f>>2]|0;if(b){c[e>>2]=vd(Mj(a,c[g>>2]|0)|0)|0;h=c[e>>2]|0;i=d;return h|0}else{c[a>>2]=0;c[e>>2]=vd(176)|0;h=c[e>>2]|0;i=d;return h|0}return 0}function je(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,k=0,l=0;e=i;i=i+16|0;if((i|0)>=(j|0))U();f=e+12|0;g=e+8|0;h=e+4|0;k=e;c[g>>2]=a;c[h>>2]=b;c[k>>2]=d;d=(Te()|0)!=0;b=c[g>>2]|0;if(d){c[f>>2]=vd(Fi(b,c[h>>2]|0,c[k>>2]|0)|0)|0;l=c[f>>2]|0;i=e;return l|0}else{c[b>>2]=0;c[f>>2]=vd(176)|0;l=c[f>>2]|0;i=e;return l|0}return 0}function ke(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b;c[d>>2]=a;Ni(c[d>>2]|0);i=b;return}function le(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b;c[d>>2]=a;Mi(c[d>>2]|0);i=b;return}function me(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=i;i=i+16|0;if((i|0)>=(j|0))U();f=e+8|0;g=e+4|0;h=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;if(!(Te()|0)){i=e;return}Oi(c[f>>2]|0,c[g>>2]|0,c[h>>2]|0);i=e;return}function ne(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=i;i=i+16|0;if((i|0)>=(j|0))U();e=d+4|0;f=d;c[e>>2]=a;c[f>>2]=b;b=_i(c[e>>2]|0,c[f>>2]|0)|0;i=d;return b|0}function oe(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,k=0,l=0;f=i;i=i+16|0;if((i|0)>=(j|0))U();g=f+12|0;h=f+8|0;k=f+4|0;l=f;c[g>>2]=a;c[h>>2]=b;c[k>>2]=d;c[l>>2]=e;if(!(Te()|0))Sg(21700,1175,21713,0,21733);Wi(c[g>>2]|0,c[h>>2]|0,c[k>>2]|0,c[l>>2]|0);i=f;return}function pe(a){a=a|0;var b=0,d=0,e=0,f=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b+4|0;e=b;c[e>>2]=a;if(Te()|0){c[d>>2]=aj(c[e>>2]|0)|0;f=c[d>>2]|0;i=b;return f|0}else{Sg(21700,1198,21765,0,21782);c[d>>2]=0;f=c[d>>2]|0;i=b;return f|0}return 0}function qe(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b;c[d>>2]=a;a=bj(c[d>>2]|0)|0;i=b;return a|0}function re(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,k=0,l=0;e=i;i=i+16|0;if((i|0)>=(j|0))U();f=e+12|0;g=e+8|0;h=e+4|0;k=e;c[g>>2]=a;c[h>>2]=b;c[k>>2]=d;if(Te()|0){c[f>>2]=vd(Ui(c[g>>2]|0,c[h>>2]|0,c[k>>2]|0)|0)|0;l=c[f>>2]|0;i=e;return l|0}else{c[f>>2]=vd(176)|0;l=c[f>>2]|0;i=e;return l|0}return 0}function se(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=i;i=i+16|0;if((i|0)>=(j|0))U();f=e+8|0;g=e+4|0;h=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;if(!(Te()|0)){Sg(21700,1287,21812,1,21733);Og()}Xm(c[f>>2]|0,c[g>>2]|0,c[h>>2]|0);i=e;return}function te(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=i;i=i+16|0;if((i|0)>=(j|0))U();e=d+4|0;f=d;c[e>>2]=a;c[f>>2]=b;if(!(Te()|0)){Sg(21700,1340,21827,1,21733);Og()}$m(c[e>>2]|0,c[f>>2]|0);i=d;return}function ue(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b;c[d>>2]=a;fh(c[d>>2]|0);i=b;return}function ve(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=i;i=i+16|0;if((i|0)>=(j|0))U();e=d+4|0;f=d;c[e>>2]=a;c[f>>2]=b;tf(c[e>>2]|0,c[f>>2]|0);i=d;return}function we(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b;c[d>>2]=a;hf(c[d>>2]|0);i=b;return}function xe(a){a=a|0;var b=0,d=0,e=0,f=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b+4|0;e=b;c[e>>2]=a;if(c[17610]|0){c[d>>2]=wb[c[17610]&15](c[e>>2]|0)|0;f=c[d>>2]|0;i=b;return f|0}else{c[d>>2]=c[e>>2];f=c[d>>2]|0;i=b;return f|0}return 0}function ye(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=i;i=i+16|0;if((i|0)>=(j|0))U();e=d+4|0;f=d;c[e>>2]=a;c[f>>2]=b;if(!(c[f>>2]|0))c[f>>2]=ot(c[e>>2]|0)|0;if(c[17612]|0?(Jg()|0)==0:0)xb[c[17612]&7](c[17611]|0,c[e>>2]|0,c[f>>2]|0);Sg(21845,86,21852,1,c[f>>2]|0);ze(21870);ze(c[f>>2]|0);ze(22301);Gg();fb()}function ze(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b+4|0;c[d>>2]=a;a=c[d>>2]|0;c[b>>2]=Qv(2,a,Tu(c[d>>2]|0)|0)|0;i=b;return}function Ae(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b;c[d>>2]=a;c[17615]=c[d>>2];i=b;return}function Be(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b;c[d>>2]=a;i=b;return (c[17615]|0)>=(c[d>>2]|0)|0}function Ce(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,k=0;e=i;i=i+16|0;if((i|0)>=(j|0))U();f=e;g=e+12|0;h=e+8|0;k=e+4|0;c[g>>2]=a;c[h>>2]=b;c[k>>2]=d;if(c[17613]|0)Cb[c[17613]&1](c[17614]|0,c[g>>2]|0,c[h>>2]|0,c[k>>2]|0);else{switch(c[g>>2]|0){case 30:case 20:case 10:case 0:break;case 40:{Iv(21885,c[3960]|0)|0;break}case 50:{Iv(21893,c[3960]|0)|0;break}case 100:{Iv(21907,c[3960]|0)|0;break}default:{d=c[3960]|0;c[f>>2]=c[g>>2];pv(d,21913,f)|0}}Fu(c[3960]|0,c[h>>2]|0,c[k>>2]|0)|0}if((c[g>>2]|0)==40|(c[g>>2]|0)==50){Sg(21845,140,21938,1,21949);Gg();fb()}else{i=e;return}}function De(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=i;i=i+32|0;if((i|0)>=(j|0))U();f=e+20|0;g=e+16|0;h=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;Ce(c[f>>2]|0,c[g>>2]|0,h);i=e;return}function Ee(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,k=0;e=i;i=i+32|0;if((i|0)>=(j|0))U();f=e;g=e+20|0;h=e+16|0;k=e+12|0;c[g>>2]=a;c[h>>2]=b;c[k>>2]=d;d=c[h>>2]|0;h=c[k>>2]|0;c[f>>2]=c[g>>2];c[f+4>>2]=d;c[f+8>>2]=h;De(50,21979,f);fb()}function Fe(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,k=0,l=0,m=0;f=i;i=i+32|0;if((i|0)>=(j|0))U();g=f;h=f+28|0;k=f+24|0;l=f+20|0;m=f+16|0;c[h>>2]=a;c[k>>2]=b;c[l>>2]=d;c[m>>2]=e;e=c[k>>2]|0;k=c[l>>2]|0;l=c[m>>2]|0;c[g>>2]=c[h>>2];c[g+4>>2]=e;c[g+8>>2]=k;c[g+12>>2]=l;De(50,22009,g);fb()}function Ge(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=i;i=i+32|0;if((i|0)>=(j|0))U();e=d+16|0;f=d;c[e>>2]=a;c[f>>2]=b;Ce(10,c[e>>2]|0,f);i=d;return}function He(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0;e=i;i=i+32|0;if((i|0)>=(j|0))U();f=e+16|0;g=e;c[e+20>>2]=a;c[f>>2]=b;c[g>>2]=d;Ce(10,c[f>>2]|0,g);i=e;return 0}function Ie(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=i;i=i+32|0;if((i|0)>=(j|0))U();e=d+16|0;f=d;c[e>>2]=a;c[f>>2]=b;Ce(30,c[e>>2]|0,f);i=d;return}function Je(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=i;i=i+32|0;if((i|0)>=(j|0))U();e=d+16|0;f=d;c[e>>2]=a;c[f>>2]=b;Ce(40,c[e>>2]|0,f);fb()}function Ke(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=i;i=i+32|0;if((i|0)>=(j|0))U();e=d+16|0;f=d;c[e>>2]=a;c[f>>2]=b;Ce(50,c[e>>2]|0,f);fb()}function Le(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=i;i=i+32|0;if((i|0)>=(j|0))U();e=d+16|0;f=d;c[e>>2]=a;c[f>>2]=b;Ce(100,c[e>>2]|0,f);i=d;return}function Me(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=i;i=i+32|0;if((i|0)>=(j|0))U();e=d+16|0;f=d;c[e>>2]=a;if(!(c[e>>2]|0)){i=d;return}c[f>>2]=b;Ce(0,c[e>>2]|0,f);i=d;return}function Ne(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=i;i=i+16|0;if((i|0)>=(j|0))U();f=e+8|0;g=e+4|0;h=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;Oe(c[f>>2]|0,22043,c[g>>2]|0,c[h>>2]|0);i=e;return}function Oe(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0;h=i;i=i+96|0;if((i|0)>=(j|0))U();k=h+56|0;l=h+40|0;m=h+32|0;n=h+24|0;o=h+16|0;p=h+8|0;q=h;r=h+84|0;s=h+80|0;t=h+76|0;u=h+72|0;v=h+68|0;w=h+64|0;x=h+60|0;c[r>>2]=b;c[s>>2]=e;c[t>>2]=f;c[u>>2]=g;c[v>>2]=0;c[w>>2]=0;if((c[r>>2]|0?a[c[r>>2]>>0]|0:0)?(c[v>>2]=1,g=c[s>>2]|0,c[q>>2]=c[r>>2],c[q+4>>2]=g,Le(22045,q),(c[u>>2]|0?(a[(c[s>>2]|0)+1>>0]|0)==91:0)&(c[t>>2]|0)!=0):0){Me(22301,p);c[s>>2]=22043;c[o>>2]=Tu(c[r>>2]|0)|0;c[o+4>>2]=76084;Le(22051,o)}a:do if(c[u>>2]|0){c[x>>2]=c[t>>2];while(1){o=c[u>>2]|0;c[u>>2]=o+-1;if(!o)break a;c[n>>2]=d[c[x>>2]>>0];Me(22057,n);if(c[v>>2]|0?(o=(c[w>>2]|0)+1|0,c[w>>2]=o,(o|0)==32&(c[u>>2]|0)!=0):0){c[w>>2]=0;Me(22062,m);o=Tu(c[r>>2]|0)|0;p=Tu(c[s>>2]|0)|0;c[l>>2]=o;c[l+4>>2]=76084;c[l+8>>2]=p;c[l+12>>2]=76084;Le(22066,l)}c[x>>2]=(c[x>>2]|0)+1}}while(0);if(!(c[r>>2]|0)){i=h;return}Me(22301,k);i=h;return}function Pe(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0;d=i;i=i+64|0;if((i|0)>=(j|0))U();e=d;f=d+28|0;g=d+24|0;h=d+20|0;k=d+16|0;l=d+12|0;m=d+8|0;n=d+4|0;o=d+32|0;c[f>>2]=a;c[g>>2]=b;if(!(c[g>>2]|0)){Oe(c[f>>2]|0?c[f>>2]|0:22043,22074,0,0);i=d;return}if(c[g>>2]|0?c[(c[g>>2]|0)+12>>2]&4|0:0){c[n>>2]=tp(c[g>>2]|0,m)|0;c[e>>2]=c[m>>2];Cu(o,30,22082,e)|0;Oe(c[f>>2]|0?c[f>>2]|0:22043,o,c[n>>2]|0,(((c[m>>2]|0)+7|0)>>>0)/8|0);i=d;return}c[h>>2]=Io(c[g>>2]|0,0,k,l)|0;if(!(c[h>>2]|0)){Oe(c[f>>2]|0?c[f>>2]|0:22043,22092,0,0);i=d;return}g=c[f>>2]|0;f=c[l>>2]|0?22107:22109;if(c[k>>2]|0)Oe(g,f,c[h>>2]|0,c[k>>2]|0);else Oe(g,f,76084,1);hf(c[h>>2]|0);i=d;return}function Qe(b){b=b|0;var e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0;e=i;i=i+48|0;if((i|0)>=(j|0))U();f=e+28|0;g=e+24|0;h=e+20|0;k=e+16|0;l=e+12|0;m=e+32|0;n=e;o=e+8|0;c[f>>2]=b;c[g>>2]=(((c[f>>2]|0)!=0^1)&1)+(c[f>>2]|0)+63&-64;f=c[g>>2]|0;c[h>>2]=Wa()|0;g=i;i=i+((1*f|0)+15&-16)|0;if((i|0)>=(j|0))U();c[k>>2]=g;c[l>>2]=f;a[m>>0]=0;f=n;c[f>>2]=d[m>>0];c[f+4>>2]=0;while(1){if(!(c[k>>2]&7|0?(c[l>>2]|0)!=0:0))break;a[c[k>>2]>>0]=a[m>>0]|0;c[k>>2]=(c[k>>2]|0)+1;c[l>>2]=(c[l>>2]|0)+-1}if((c[l>>2]|0)>>>0>=8){f=n;g=Xw(c[f>>2]|0,c[f+4>>2]|0,16843009,16843009)|0;f=n;c[f>>2]=g;c[f+4>>2]=C;do{c[o>>2]=c[k>>2];f=n;g=c[f+4>>2]|0;b=c[o>>2]|0;c[b>>2]=c[f>>2];c[b+4>>2]=g;c[l>>2]=(c[l>>2]|0)-8;c[k>>2]=(c[k>>2]|0)+8}while((c[l>>2]|0)>>>0>=8)}while(1){if(!(c[l>>2]|0))break;a[c[k>>2]>>0]=a[m>>0]|0;c[k>>2]=(c[k>>2]|0)+1;c[l>>2]=(c[l>>2]|0)+-1}Aa(c[h>>2]|0);i=e;return}function Re(){return}function Se(){st(33);ye(pt(c[(fu()|0)>>2]|0)|0,22111)}function Te(){if(!(c[17616]|0))Ue();return Ug()|0}function Ue(){var a=0,b=0;a=i;i=i+16|0;if((i|0)>=(j|0))U();b=a;c[b>>2]=0;if(c[17616]|0){i=a;return}c[17616]=1;Km(0);Ig(c[17617]|0);eg();c[b>>2]=Ah()|0;if((((((c[b>>2]|0)==0?(c[b>>2]=ij()|0,(c[b>>2]|0)==0):0)?(c[b>>2]=Nj()|0,(c[b>>2]|0)==0):0)?(c[b>>2]=jj()|0,(c[b>>2]|0)==0):0)?(c[b>>2]=tg()|0,(c[b>>2]|0)==0):0)?(c[b>>2]=gp()|0,(c[b>>2]|0)==0):0){i=a;return}Ee(22126,123,22135)}function Ve(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;d=i;i=i+48|0;if((i|0)>=(j|0))U();e=d+36|0;f=d+32|0;g=d+28|0;h=d+24|0;k=d+20|0;l=d+16|0;m=d+12|0;n=d+8|0;o=d+4|0;p=d;c[f>>2]=b;c[g>>2]=22147;if((c[f>>2]|0?(a[c[f>>2]>>0]|0)==1:0)?(a[(c[f>>2]|0)+1>>0]|0)==1:0){c[e>>2]=Kp()|0;q=c[e>>2]|0;i=d;return q|0}Ue();b=c[g>>2]|0;if(!(c[f>>2]|0)){c[e>>2]=b;q=c[e>>2]|0;i=d;return q|0}c[p>>2]=We(b,h,k,l)|0;if(!(c[p>>2]|0)){c[e>>2]=0;q=c[e>>2]|0;i=d;return q|0}if(!(We(c[f>>2]|0,m,n,o)|0)){c[e>>2]=0;q=c[e>>2]|0;i=d;return q|0}do if((c[h>>2]|0)<=(c[m>>2]|0)){if((c[h>>2]|0)==(c[m>>2]|0)?(c[k>>2]|0)>(c[n>>2]|0):0)break;if(((c[h>>2]|0)==(c[m>>2]|0)?(c[k>>2]|0)==(c[n>>2]|0):0)?(c[l>>2]|0)>(c[o>>2]|0):0)break;if(((c[h>>2]|0)==(c[m>>2]|0)?(c[k>>2]|0)==(c[n>>2]|0):0)?(c[l>>2]|0)==(c[o>>2]|0):0)break;c[e>>2]=0;q=c[e>>2]|0;i=d;return q|0}while(0);c[e>>2]=c[g>>2];q=c[e>>2]|0;i=d;return q|0}function We(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,k=0,l=0,m=0,n=0,o=0;g=i;i=i+32|0;if((i|0)>=(j|0))U();h=g+16|0;k=g+12|0;l=g+8|0;m=g+4|0;n=g;c[k>>2]=b;c[l>>2]=d;c[m>>2]=e;c[n>>2]=f;c[k>>2]=Xe(c[k>>2]|0,c[l>>2]|0)|0;if(c[k>>2]|0?(a[c[k>>2]>>0]|0)==46:0){c[k>>2]=(c[k>>2]|0)+1;c[k>>2]=Xe(c[k>>2]|0,c[m>>2]|0)|0;if(c[k>>2]|0?(a[c[k>>2]>>0]|0)==46:0){c[k>>2]=(c[k>>2]|0)+1;c[k>>2]=Xe(c[k>>2]|0,c[n>>2]|0)|0;if(c[k>>2]|0){c[h>>2]=c[k>>2];o=c[h>>2]|0;i=g;return o|0}else{c[h>>2]=0;o=c[h>>2]|0;i=g;return o|0}}c[h>>2]=0;o=c[h>>2]|0;i=g;return o|0}c[h>>2]=0;o=c[h>>2]|0;i=g;return o|0}function Xe(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,k=0,l=0,m=0;e=i;i=i+16|0;if((i|0)>=(j|0))U();f=e+12|0;g=e+8|0;h=e+4|0;k=e;c[g>>2]=b;c[h>>2]=d;c[k>>2]=0;if((a[c[g>>2]>>0]|0)==48?qw(a[(c[g>>2]|0)+1>>0]|0)|0:0){c[f>>2]=0;l=c[f>>2]|0;i=e;return l|0}while(1){d=(qw(a[c[g>>2]>>0]|0)|0)!=0;m=c[k>>2]|0;if(!d)break;c[k>>2]=m*10;c[k>>2]=(c[k>>2]|0)+((a[c[g>>2]>>0]|0)-48);c[g>>2]=(c[g>>2]|0)+1}c[c[h>>2]>>2]=m;c[f>>2]=(c[k>>2]|0)<0?0:c[g>>2]|0;l=c[f>>2]|0;i=e;return l|0}function Ye(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0;d=i;i=i+80|0;if((i|0)>=(j|0))U();e=d+72|0;f=d+68|0;g=d+64|0;h=d+60|0;k=d+56|0;l=d+52|0;m=d+48|0;n=d+44|0;o=d+40|0;p=d+36|0;q=d+32|0;r=d+28|0;s=d+24|0;t=d+20|0;u=d+16|0;v=d+12|0;w=d+8|0;x=d+4|0;y=d;c[e>>2]=a;c[f>>2]=b;c[g>>2]=0;a:do switch(c[e>>2]|0){case 31:{gg();break}case 44:{Km(0);Qm();break}case 51:{if(Tm()|0)c[g>>2]=1;break}case 13:{Om();break}case 62:case 23:break;case 14:{Hg();break}case 30:{Ue();pg(0);break}case 37:{Ue();c[17618]=1;break}case 24:{Ue();b=c[f>>2]|0;a=(c[b>>2]|0)+(4-1)&~(4-1);z=c[a>>2]|0;c[b>>2]=a+4;pg(z);if((og()|0)&4|0)c[g>>2]=1;break}case 25:{Ue();Gg();break}case 27:{Km(0);mg(og()|0|1);break}case 28:{Km(0);mg(og()|0|2);break}case 29:{Km(0);mg((og()|0)&-3);break}case 22:{Ue();Pm();break}case 45:{Km(0);z=c[f>>2]|0;a=(c[z>>2]|0)+(4-1)&~(4-1);b=c[a>>2]|0;c[z>>2]=a+4;Ym(b);break}case 46:{Km(0);if(Te()|0)Zm();break}case 19:{Km(0);b=c[f>>2]|0;a=(c[b>>2]|0)+(4-1)&~(4-1);z=c[a>>2]|0;c[b>>2]=a+4;Ae(z);break}case 20:{z=c[f>>2]|0;a=(c[z>>2]|0)+(4-1)&~(4-1);b=c[a>>2]|0;c[z>>2]=a+4;c[17619]=c[17619]|b;break}case 21:{b=c[f>>2]|0;a=(c[b>>2]|0)+(4-1)&~(4-1);z=c[a>>2]|0;c[b>>2]=a+4;c[17619]=c[17619]&~z;break}case 36:{Ue();break}case 40:{if(c[17616]|0)c[g>>2]=1;break}case 39:{if(c[17620]|0)c[g>>2]=1;break}case 38:{if(!(c[17620]|0)){Ue();Lm(0);c[17620]=1;Te()|0}break}case 47:{Km(0);Ue();break}case 48:{Km(0);Lm(1);if(Te()|0)_m();break}case 52:{c[g>>2]=Ze(60)|0;break}case 49:{Km(0);z=c[f>>2]|0;a=(c[z>>2]|0)+(4-1)&~(4-1);b=c[a>>2]|0;c[z>>2]=a+4;Rm(b);break}case 50:{Km(0);Lm(1);b=c[f>>2]|0;a=(c[b>>2]|0)+(4-1)&~(4-1);z=c[a>>2]|0;c[b>>2]=a+4;Sm(((z|0)!=0^1^1)&1)|0;break}case 70:{Mm();break}case 53:{z=c[f>>2]|0;a=(c[z>>2]|0)+(4-1)&~(4-1);b=c[a>>2]|0;c[z>>2]=a+4;c[h>>2]=b;Km(0);$e(c[h>>2]|0?28:27,c[h>>2]|0);break}case 54:{Km(0);if(bh()|0)c[g>>2]=1;break}case 55:{if(Jg()|0?(b=(Tg()|0)!=0,!(b|(c[17618]|0)!=0)):0)c[g>>2]=1;break}case 56:{Km(0);if(!(c[17616]|0)){c[17617]=1;break a}if(ch()|0)Vg(1)|0;if(Ug()|0)c[g>>2]=1;break}case 57:{Ue();c[g>>2]=Vg(1)|0;break}case 58:{b=c[f>>2]|0;a=(c[b>>2]|0)+(4-1)&~(4-1);z=c[a>>2]|0;c[b>>2]=a+4;c[k>>2]=z;z=c[f>>2]|0;a=(c[z>>2]|0)+(4-1)&~(4-1);b=c[a>>2]|0;c[z>>2]=a+4;c[l>>2]=b;b=c[f>>2]|0;a=(c[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=(c[z>>2]|0)+(4-1)&~(4-1);b=c[a>>2]|0;c[z>>2]=a+4;c[w>>2]=b;c[g>>2]=bg(c[w>>2]|0)|0;break}case 64:{if(c[17616]|0){c[g>>2]=1;break a}else{Km(0);Qg();break a}break}case 65:{b=c[f>>2]|0;a=(c[b>>2]|0)+(4-1)&~(4-1);z=c[a>>2]|0;c[b>>2]=a+4;c[x>>2]=z;if((c[x>>2]|0)>0)Km(c[x>>2]|0);break}case 66:{z=c[f>>2]|0;a=(c[z>>2]|0)+(4-1)&~(4-1);b=c[a>>2]|0;c[z>>2]=a+4;c[y>>2]=b;if(c[y>>2]|0){b=Nm(((c[17616]|0)!=0^1)&1)|0;c[c[y>>2]>>2]=b}break}case 67:{Km(0);mg(og()|0|8);break}case 68:{Km(0);mg(og()|0|16);break}case 72:case 71:{c[g>>2]=69;break}default:{Km(0);c[g>>2]=61}}while(0);i=d;return c[g>>2]|0}function Ze(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b;c[d>>2]=a;a=_e(1,c[d>>2]|0)|0;i=b;return a|0}function _e(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=i;i=i+16|0;if((i|0)>=(j|0))U();e=d+4|0;f=d;c[e>>2]=a;c[f>>2]=b;if(!(c[f>>2]|0)){g=0;i=d;return g|0}g=(c[e>>2]&127)<<24|c[f>>2]&65535;i=d;return g|0}function $e(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0;d=i;i=i+128|0;if((i|0)>=(j|0))U();e=d+88|0;f=d+80|0;g=d+72|0;h=d+64|0;k=d+48|0;l=d+24|0;m=d+16|0;n=d+8|0;o=d;p=d+116|0;q=d+112|0;r=d+108|0;s=d+104|0;t=d+100|0;u=d+96|0;c[p>>2]=a;c[q>>2]=b;b=c[p>>2]|0;a=c[q>>2]|0;c[o>>2]=22147;sb[b&63](a,22161,o)|0;o=c[p>>2]|0;a=c[q>>2]|0;c[n>>2]=22187;sb[o&63](a,22174,n)|0;n=c[p>>2]|0;a=c[q>>2]|0;c[m>>2]=22212;sb[n&63](a,22199,m)|0;m=c[p>>2]|0;a=c[q>>2]|0;c[l>>2]=22233;sb[m&63](a,22220,l)|0;sb[c[p>>2]&63](c[q>>2]|0,22247,d+32|0)|0;sb[c[p>>2]&63](c[q>>2]|0,22263,d+40|0)|0;l=c[p>>2]|0;a=c[q>>2]|0;c[k>>2]=fp()|0;sb[l&63](a,22275,k)|0;c[r>>2]=cg()|0;sb[c[p>>2]&63](c[q>>2]|0,22288,d+56|0)|0;c[t>>2]=0;while(1){k=dg(c[t>>2]|0,s)|0;c[u>>2]=k;if(!k)break;if(c[r>>2]&c[s>>2]|0){k=c[p>>2]|0;a=c[q>>2]|0;c[h>>2]=c[u>>2];sb[k&63](a,22297,h)|0}c[t>>2]=(c[t>>2]|0)+1}sb[c[p>>2]&63](c[q>>2]|0,22301,g)|0;g=c[p>>2]|0;h=c[q>>2]|0;s=(Jg()|0)!=0;r=(Pg()|0)!=0;c[f>>2]=s?121:110;c[f+4>>2]=r?121:110;sb[g&63](h,22303,f)|0;c[t>>2]=Nm(0)|0;switch(c[t>>2]|0){case 1:{c[u>>2]=22321;v=c[p>>2]|0;w=c[q>>2]|0;x=c[u>>2]|0;y=c[t>>2]|0;c[e>>2]=x;z=e+4|0;c[z>>2]=y;sb[v&63](w,22355,e)|0;i=d;return}case 2:{c[u>>2]=22330;v=c[p>>2]|0;w=c[q>>2]|0;x=c[u>>2]|0;y=c[t>>2]|0;c[e>>2]=x;z=e+4|0;c[z>>2]=y;sb[v&63](w,22355,e)|0;i=d;return}case 3:{c[u>>2]=22335;v=c[p>>2]|0;w=c[q>>2]|0;x=c[u>>2]|0;y=c[t>>2]|0;c[e>>2]=x;z=e+4|0;c[z>>2]=y;sb[v&63](w,22355,e)|0;i=d;return}default:Ee(22126,321,22342)}}function af(a){a=a|0;var b=0,d=0,e=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b+4|0;e=b;c[d>>2]=a;c[e>>2]=0;switch(c[d>>2]|0){case 30111:{c[e>>2]=tt(1072)|0;break}case 30112:{c[e>>2]=ut(1072)|0;break}case 30113:{c[e>>2]=vt(1072)|0;break}case 30114:{c[e>>2]=wt(1072)|0;break}default:c[e>>2]=61}i=b;return c[e>>2]|0}function bf(a){a=a|0;var b=0,d=0,e=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b+4|0;e=b;c[d>>2]=a;c[e>>2]=0;cf(c[d>>2]|0,0,e)|0;i=b;return c[e>>2]|0}function cf(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0;e=i;i=i+32|0;if((i|0)>=(j|0))U();f=e+16|0;g=e+12|0;h=e+8|0;k=e+4|0;l=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;c[k>>2]=0;do if(c[g>>2]&1|0?!(df()|0):0)if(c[17622]|0){c[l>>2]=wb[c[17622]&15](c[f>>2]|0)|0;break}else{c[l>>2]=ig(c[f>>2]|0)|0;break}else m=6;while(0);do if((m|0)==6)if(c[17621]|0){c[l>>2]=wb[c[17621]&15](c[f>>2]|0)|0;break}else{c[l>>2]=hg(c[f>>2]|0)|0;break}while(0);if(c[l>>2]|0){c[c[h>>2]>>2]=c[l>>2];n=c[k>>2]|0;i=e;return n|0}if(!(c[(fu()|0)>>2]|0))st(12);c[k>>2]=pt(c[(fu()|0)>>2]|0)|0;n=c[k>>2]|0;i=e;return n|0}function df(){var a=0,b=0;a=i;i=i+16|0;if((i|0)>=(j|0))U();b=a;do if(c[17618]|0)if(Pg()|0){c[17618]=0;c[b>>2]=0;break}else{c[b>>2]=c[17618];break}else c[b>>2]=0;while(0);i=a;return c[b>>2]|0}function ef(a){a=a|0;var b=0,d=0,e=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b+4|0;e=b;c[d>>2]=a;c[e>>2]=0;cf(c[d>>2]|0,1,e)|0;i=b;return c[e>>2]|0}function ff(a){a=a|0;var b=0,d=0,e=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b+4|0;e=b;c[e>>2]=a;do if(!(df()|0))if(c[17623]|0){c[d>>2]=wb[c[17623]&15](c[e>>2]|0)|0;break}else{c[d>>2]=Fg(c[e>>2]|0)|0;break}else c[d>>2]=0;while(0);i=b;return c[d>>2]|0}function gf(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,k=0;d=i;i=i+16|0;if((i|0)>=(j|0))U();e=d+12|0;f=d+8|0;g=d+4|0;h=d;c[f>>2]=a;c[g>>2]=b;b=c[g>>2]|0;if(!(c[f>>2]|0)){c[e>>2]=bf(b)|0;k=c[e>>2]|0;i=d;return k|0}if(!b){hf(c[f>>2]|0);c[e>>2]=0;k=c[e>>2]|0;i=d;return k|0}if(c[17624]|0)c[h>>2]=Bb[c[17624]&7](c[f>>2]|0,c[g>>2]|0)|0;else c[h>>2]=jg(c[f>>2]|0,c[g>>2]|0)|0;if((c[h>>2]|0)==0?(c[(fu()|0)>>2]|0)==0:0)st(12);c[e>>2]=c[h>>2];k=c[e>>2]|0;i=d;return k|0}function hf(a){a=a|0;var b=0,d=0,e=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b+4|0;e=b;c[d>>2]=a;if(!(c[d>>2]|0)){i=b;return}c[e>>2]=c[(fu()|0)>>2];if(c[17625]|0)ub[c[17625]&15](c[d>>2]|0);else lg(c[d>>2]|0);if(!(c[e>>2]|0)){i=b;return}st(c[e>>2]|0);i=b;return}function jf(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,k=0,l=0;d=i;i=i+32|0;if((i|0)>=(j|0))U();e=d+16|0;f=d+12|0;g=d+8|0;h=d+4|0;k=d;c[f>>2]=a;c[g>>2]=b;c[h>>2]=R(c[f>>2]|0,c[g>>2]|0)|0;if(c[g>>2]|0?(((c[h>>2]|0)>>>0)/((c[g>>2]|0)>>>0)|0|0)!=(c[f>>2]|0):0){st(12);c[e>>2]=0;l=c[e>>2]|0;i=d;return l|0}c[k>>2]=bf(c[h>>2]|0)|0;if(c[k>>2]|0)Sw(c[k>>2]|0,0,c[h>>2]|0)|0;c[e>>2]=c[k>>2];l=c[e>>2]|0;i=d;return l|0}function kf(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,k=0,l=0;d=i;i=i+32|0;if((i|0)>=(j|0))U();e=d+16|0;f=d+12|0;g=d+8|0;h=d+4|0;k=d;c[f>>2]=a;c[g>>2]=b;c[h>>2]=R(c[f>>2]|0,c[g>>2]|0)|0;if(c[g>>2]|0?(((c[h>>2]|0)>>>0)/((c[g>>2]|0)>>>0)|0|0)!=(c[f>>2]|0):0){st(12);c[e>>2]=0;l=c[e>>2]|0;i=d;return l|0}c[k>>2]=ef(c[h>>2]|0)|0;if(c[k>>2]|0)Sw(c[k>>2]|0,0,c[h>>2]|0)|0;c[e>>2]=c[k>>2];l=c[e>>2]|0;i=d;return l|0}function lf(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b+8|0;e=b+4|0;f=b;c[d>>2]=a;c[e>>2]=0;c[f>>2]=0;c[f>>2]=Tu(c[d>>2]|0)|0;a=(ff(c[d>>2]|0)|0)!=0;g=(c[f>>2]|0)+1|0;if(a)c[e>>2]=ef(g)|0;else c[e>>2]=bf(g)|0;if(!(c[e>>2]|0)){h=c[e>>2]|0;i=b;return h|0}dv(c[e>>2]|0,c[d>>2]|0)|0;h=c[e>>2]|0;i=b;return h|0}function mf(a){a=a|0;var b=0,d=0,e=0,f=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b+4|0;e=b;c[d>>2]=a;while(1){a=bf(c[d>>2]|0)|0;c[e>>2]=a;if(!((a|0)!=0^1)){f=6;break}a=(Jg()|0)==0;if(!(a&(c[17626]|0)!=0)){f=5;break}if(!(sb[c[17626]&63](c[17627]|0,c[d>>2]|0,0)|0)){f=5;break}}if((f|0)==5)ye(pt(c[(fu()|0)>>2]|0)|0,0);else if((f|0)==6){i=b;return c[e>>2]|0}return 0}function nf(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,k=0,l=0;d=i;i=i+16|0;if((i|0)>=(j|0))U();e=d+8|0;f=d+4|0;g=d;c[e>>2]=a;c[f>>2]=b;while(1){b=gf(c[e>>2]|0,c[f>>2]|0)|0;c[g>>2]=b;if(!((b|0)!=0^1)){h=6;break}b=(Jg()|0)==0;if(!(b&(c[17626]|0)!=0)){h=5;break}b=c[17626]|0;a=c[17627]|0;k=c[f>>2]|0;l=(ff(c[e>>2]|0)|0)!=0;if(!(sb[b&63](a,k,l?3:2)|0)){h=5;break}}if((h|0)==5)ye(pt(c[(fu()|0)>>2]|0)|0,0);else if((h|0)==6){i=d;return c[g>>2]|0}return 0}function of(a){a=a|0;var b=0,d=0,e=0,f=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b+4|0;e=b;c[d>>2]=a;while(1){a=ef(c[d>>2]|0)|0;c[e>>2]=a;if(!((a|0)!=0^1)){f=6;break}a=(Jg()|0)==0;if(!(a&(c[17626]|0)!=0)){f=5;break}if(!(sb[c[17626]&63](c[17627]|0,c[d>>2]|0,1)|0)){f=5;break}}if((f|0)==5){d=pt(c[(fu()|0)>>2]|0)|0;ye(d,xe(22372)|0)}else if((f|0)==6){i=b;return c[e>>2]|0}return 0}function pf(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;d=i;i=i+16|0;if((i|0)>=(j|0))U();e=d+12|0;f=d+8|0;g=d+4|0;h=d;c[e>>2]=a;c[f>>2]=b;c[g>>2]=R(c[e>>2]|0,c[f>>2]|0)|0;if(c[f>>2]|0?(((c[g>>2]|0)>>>0)/((c[f>>2]|0)>>>0)|0|0)!=(c[e>>2]|0):0){st(12);ye(pt(c[(fu()|0)>>2]|0)|0,0)}c[h>>2]=mf(c[g>>2]|0)|0;Sw(c[h>>2]|0,0,c[g>>2]|0)|0;i=d;return c[h>>2]|0}function qf(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;d=i;i=i+16|0;if((i|0)>=(j|0))U();e=d+12|0;f=d+8|0;g=d+4|0;h=d;c[e>>2]=a;c[f>>2]=b;c[g>>2]=R(c[e>>2]|0,c[f>>2]|0)|0;if(c[f>>2]|0?(((c[g>>2]|0)>>>0)/((c[f>>2]|0)>>>0)|0|0)!=(c[e>>2]|0):0){st(12);ye(pt(c[(fu()|0)>>2]|0)|0,0)}c[h>>2]=of(c[g>>2]|0)|0;Sw(c[h>>2]|0,0,c[g>>2]|0)|0;i=d;return c[h>>2]|0}function rf(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,k=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b+12|0;e=b+8|0;f=b+4|0;g=b;c[d>>2]=a;do{a=lf(c[d>>2]|0)|0;c[e>>2]=a;if(!((a|0)!=0^1)){h=8;break}c[f>>2]=Tu(c[d>>2]|0)|0;c[g>>2]=((ff(c[d>>2]|0)|0)!=0^1^1)&1;a=(Jg()|0)==0;if(!(a&(c[17626]|0)!=0))break}while((sb[c[17626]&63](c[17627]|0,c[f>>2]|0,c[g>>2]|0)|0)!=0);if((h|0)==8){i=b;return c[e>>2]|0}e=pt(c[(fu()|0)>>2]|0)|0;if(!(c[g>>2]|0)){k=0;ye(e,k)}k=xe(22372)|0;ye(e,k);return 0}function sf(a){a=a|0;var b=0,d=0,e=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b+4|0;e=b;c[e>>2]=a;if(Jg()|0)c[d>>2]=0;else c[d>>2]=c[17619]&c[e>>2];i=b;return c[d>>2]|0}function tf(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=i;i=i+16|0;if((i|0)>=(j|0))U();e=d+4|0;f=d;c[e>>2]=a;c[f>>2]=b;kj(c[e>>2]|0,c[f>>2]|0);Im(c[e>>2]|0,c[f>>2]|0);i=d;return}function uf(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;g=i;i=i+48|0;if((i|0)>=(j|0))U();h=g;k=g+32|0;l=g+28|0;m=g+24|0;n=g+20|0;o=g+16|0;p=g+12|0;q=g+8|0;r=g+4|0;c[l>>2]=a;c[m>>2]=b;c[n>>2]=d;c[o>>2]=e;c[p>>2]=f;if(!(c[l>>2]|0)){c[k>>2]=45;s=c[k>>2]|0;i=g;return s|0}c[c[l>>2]>>2]=0;if(!((((c[o>>2]|0)<0|(c[o>>2]|0)>1)^1)&(c[m>>2]|0)!=0)){c[k>>2]=45;s=c[k>>2]|0;i=g;return s|0}if((c[n>>2]|0)!=0|(c[o>>2]|0)!=0){if((c[n>>2]|0)==0&(c[o>>2]|0)!=0)c[n>>2]=Tu(c[m>>2]|0)|0}else{c[n>>2]=vf(c[m>>2]|0,0,0,q)|0;if(!(c[n>>2]|0)){c[k>>2]=c[q>>2];s=c[k>>2]|0;i=g;return s|0}}c[q>>2]=wf(r,0,c[m>>2]|0,c[n>>2]|0,0,0,h)|0;if(c[q>>2]|0){c[k>>2]=c[q>>2];s=c[k>>2]|0;i=g;return s|0}c[c[l>>2]>>2]=c[r>>2];if(c[p>>2]|0)ub[c[p>>2]&15](c[m>>2]|0);c[k>>2]=0;s=c[k>>2]|0;i=g;return s|0}function vf(a,b,e,f){a=a|0;b=b|0;e=e|0;f=f|0;var g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0;g=i;i=i+48|0;if((i|0)>=(j|0))U();h=g+44|0;k=g+40|0;l=g+36|0;m=g+32|0;n=g+28|0;o=g+24|0;p=g+20|0;q=g+16|0;r=g+4|0;s=g;c[k>>2]=a;c[l>>2]=b;c[m>>2]=e;c[n>>2]=f;c[p>>2]=0;c[q>>2]=0;c[r>>2]=0;c[s>>2]=0;if(!(c[m>>2]|0))c[m>>2]=g+12;if(!(c[n>>2]|0))c[n>>2]=g+8;c[c[n>>2]>>2]=0;c[c[m>>2]>>2]=0;if(!(c[k>>2]|0)){c[h>>2]=0;t=c[h>>2]|0;i=g;return t|0}if((d[c[k>>2]>>0]|0|0)!=40){c[c[n>>2]>>2]=204;c[h>>2]=0;t=c[h>>2]|0;i=g;return t|0}c[o>>2]=c[k>>2];a:while(1){if(c[l>>2]|0?(c[r>>2]|0)>>>0>=(c[l>>2]|0)>>>0:0){u=12;break}k=d[c[o>>2]>>0]|0;do if(c[q>>2]|0)if((k|0)==58){if(c[l>>2]|0?((c[r>>2]|0)+(c[q>>2]|0)|0)>>>0>=(c[l>>2]|0)>>>0:0){u=17;break a}c[r>>2]=(c[r>>2]|0)+(c[q>>2]|0);c[o>>2]=(c[o>>2]|0)+(c[q>>2]|0);c[q>>2]=0;break}else{if((d[c[o>>2]>>0]|0|0)<48){u=22;break a}if((d[c[o>>2]>>0]|0|0)>57){u=22;break a}c[q>>2]=((c[q>>2]|0)*10|0)+((d[c[o>>2]>>0]|0)-48);break}else{if((k|0)==40){if(c[p>>2]|0){u=25;break a}c[s>>2]=(c[s>>2]|0)+1;break}if((d[c[o>>2]>>0]|0|0)==41){if(!(c[s>>2]|0)){u=29;break a}if(c[p>>2]|0){u=31;break a}f=(c[s>>2]|0)+-1|0;c[s>>2]=f;if(f|0)break;else{u=33;break a}}if((d[c[o>>2]>>0]|0|0)==91){if(c[p>>2]|0){u=36;break a}c[p>>2]=c[o>>2];break}if((d[c[o>>2]>>0]|0|0)==93){if(!(c[p>>2]|0)){u=40;break a}c[p>>2]=0;break}if((d[c[o>>2]>>0]|0|0)<48){u=47;break a}if((d[c[o>>2]>>0]|0|0)>57){u=47;break a}if((d[c[o>>2]>>0]|0|0)==48){u=45;break a}c[q>>2]=(d[c[o>>2]>>0]|0)-48}while(0);c[o>>2]=(c[o>>2]|0)+1;c[r>>2]=(c[r>>2]|0)+1}switch(u|0){case 12:{c[c[m>>2]>>2]=c[r>>2];c[c[n>>2]>>2]=202;c[h>>2]=0;t=c[h>>2]|0;i=g;return t|0}case 17:{c[c[m>>2]>>2]=c[r>>2];c[c[n>>2]>>2]=202;c[h>>2]=0;t=c[h>>2]|0;i=g;return t|0}case 22:{c[c[m>>2]>>2]=c[r>>2];c[c[n>>2]>>2]=201;c[h>>2]=0;t=c[h>>2]|0;i=g;return t|0}case 25:{c[c[m>>2]>>2]=c[r>>2];c[c[n>>2]>>2]=209;c[h>>2]=0;t=c[h>>2]|0;i=g;return t|0}case 29:{c[c[m>>2]>>2]=c[r>>2];c[c[n>>2]>>2]=203;c[h>>2]=0;t=c[h>>2]|0;i=g;return t|0}case 31:{c[c[m>>2]>>2]=c[r>>2];c[c[n>>2]>>2]=209;c[h>>2]=0;t=c[h>>2]|0;i=g;return t|0}case 33:{u=(c[r>>2]|0)+1|0;c[r>>2]=u;c[h>>2]=u;t=c[h>>2]|0;i=g;return t|0}case 36:{c[c[m>>2]>>2]=c[r>>2];c[c[n>>2]>>2]=208;c[h>>2]=0;t=c[h>>2]|0;i=g;return t|0}case 40:{c[c[m>>2]>>2]=c[r>>2];c[c[n>>2]>>2]=209;c[h>>2]=0;t=c[h>>2]|0;i=g;return t|0}case 45:{c[c[m>>2]>>2]=c[r>>2];c[c[n>>2]>>2]=207;c[h>>2]=0;t=c[h>>2]|0;i=g;return t|0}case 47:{if((d[c[o>>2]>>0]|0|0)!=38?(d[c[o>>2]>>0]|0|0)!=92:0){c[c[m>>2]>>2]=c[r>>2];c[c[n>>2]>>2]=205;c[h>>2]=0;t=c[h>>2]|0;i=g;return t|0}c[c[m>>2]>>2]=c[r>>2];c[c[n>>2]>>2]=210;c[h>>2]=0;t=c[h>>2]|0;i=g;return t|0}}return 0}function wf(a,b,d,e,f,g,h){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;k=i;i=i+48|0;if((i|0)>=(j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164|0;_=n+160|0;$=n+308|0;aa=n+156|0;ba=n+152|0;ca=n+148|0;da=n+144|0;ea=n+140|0;fa=n+136|0;ga=n+132|0;ha=n+128|0;ia=n+306|0;ja=n+124|0;ka=n+120|0;la=n+116|0;ma=n+304|0;na=n+112|0;oa=n+108|0;pa=n+104|0;qa=n+302|0;ra=n+100|0;sa=n+96|0;ta=n+92|0;ua=n+88|0;va=n+84|0;wa=n+300|0;xa=n+80|0;ya=n+76|0;za=n+354|0;Aa=n+72|0;Ba=n+298|0;Ca=n+68|0;Da=n+64|0;Ea=n+319|0;Fa=n+60|0;Ga=n+296|0;Ha=n+56|0;Ia=n+52|0;Ja=n+48|0;Ka=n+44|0;La=n+40|0;Ma=n+36|0;Na=n+32|0;Oa=n+28|0;Pa=n+24|0;Qa=n+318|0;Ra=n;Sa=n+20|0;c[r>>2]=e;c[s>>2]=f;c[t>>2]=g;c[u>>2]=h;c[v>>2]=k;c[w>>2]=l;c[x>>2]=m;c[y>>2]=0;c[B>>2]=0;c[D>>2]=0;c[E>>2]=0;c[F>>2]=0;c[G>>2]=0;c[H>>2]=0;c[I>>2]=0;c[J>>2]=0;c[K>>2]=0;c[L>>2]=0;c[N>>2]=0;c[O>>2]=0;if(!(c[r>>2]|0)){c[q>>2]=45;Ta=c[q>>2]|0;i=n;return Ta|0}c[c[r>>2]>>2]=0;if(!(c[t>>2]|0)){c[q>>2]=45;Ta=c[q>>2]|0;i=n;return Ta|0}if(!(c[s>>2]|0))c[s>>2]=n+208;c[M+4>>2]=(c[u>>2]|0)+2;if(c[u>>2]|0?ff(c[t>>2]|0)|0:0)c[M>>2]=ef(1+(c[M+4>>2]|0)-1|0)|0;else c[M>>2]=bf(1+(c[M+4>>2]|0)-1|0)|0;a:do if(c[M>>2]|0){c[M+8>>2]=c[M>>2];c[z>>2]=c[t>>2];c[A>>2]=c[u>>2];b:while(1){if(!(c[A>>2]|0)){Ua=220;break}if(!((c[E>>2]|0)==0|(c[F>>2]|0)!=0)){if(!(Bv(22408,a[c[z>>2]>>0]|0)|0)){c[L>>2]=(c[z>>2]|0)-(c[E>>2]|0);c[P>>2]=yf(M,c[L>>2]|0)|0;if(c[P>>2]|0){Ua=18;break}m=M+8|0;l=c[m>>2]|0;c[m>>2]=l+1;a[l>>0]=1;b[Q>>1]=c[L>>2];l=c[M+8>>2]|0;a[l>>0]=a[Q>>0]|0;a[l+1>>0]=a[Q+1>>0]|0;l=M+8|0;c[l>>2]=(c[l>>2]|0)+2;Ow(c[M+8>>2]|0,c[E>>2]|0,c[L>>2]|0)|0;l=M+8|0;c[l>>2]=(c[l>>2]|0)+(c[L>>2]|0);c[E>>2]=0;Ua=20}}else Ua=20;c:do if((Ua|0)==20){Ua=0;if(c[D>>2]|0){l=a[c[z>>2]>>0]|0;if(!(c[K>>2]|0)){if((l|0)==92){c[K>>2]=1;break}if((a[c[z>>2]>>0]|0)!=34)break;c[D>>2]=(c[D>>2]|0)+1;c[T>>2]=yf(M,(c[z>>2]|0)-(c[D>>2]|0)|0)|0;if(c[T>>2]|0){Ua=59;break b}m=M+8|0;k=c[m>>2]|0;c[m>>2]=k+1;a[k>>0]=1;c[R>>2]=c[M+8>>2];b[V>>1]=0;k=c[M+8>>2]|0;a[k>>0]=a[V>>0]|0;a[k+1>>0]=a[V+1>>0]|0;k=M+8|0;c[k>>2]=(c[k>>2]|0)+2;c[S>>2]=zf(c[D>>2]|0,(c[z>>2]|0)-(c[D>>2]|0)|0,c[M+8>>2]|0)|0;k=M+8|0;c[k>>2]=(c[k>>2]|0)+(c[S>>2]|0);b[W>>1]=c[S>>2];k=c[R>>2]|0;a[k>>0]=a[W>>0]|0;a[k+1>>0]=a[W+1>>0]|0;c[R>>2]=(c[R>>2]|0)+2;c[D>>2]=0;break}switch(l|0){case 92:case 39:case 34:case 114:case 102:case 110:case 118:case 116:case 98:{c[K>>2]=0;break c;break}case 55:case 54:case 53:case 52:case 51:case 50:case 49:case 48:{if((c[A>>2]|0)>>>0<=2){Ua=29;break b}if((a[(c[z>>2]|0)+1>>0]|0)<48){Ua=29;break b}if((a[(c[z>>2]|0)+1>>0]|0)>55){Ua=29;break b}if((a[(c[z>>2]|0)+2>>0]|0)<48){Ua=29;break b}if((a[(c[z>>2]|0)+2>>0]|0)>55){Ua=29;break b}c[z>>2]=(c[z>>2]|0)+2;c[A>>2]=(c[A>>2]|0)-2;c[K>>2]=0;break c;break}case 120:{if((c[A>>2]|0)>>>0<=2){Ua=44;break b}if(!((a[(c[z>>2]|0)+1>>0]|0)>=48?(a[(c[z>>2]|0)+1>>0]|0)<=57:0))Ua=34;do if((Ua|0)==34){Ua=0;if((a[(c[z>>2]|0)+1>>0]|0)>=65?(a[(c[z>>2]|0)+1>>0]|0)<=70:0)break;if((a[(c[z>>2]|0)+1>>0]|0)<97){Ua=44;break b}if((a[(c[z>>2]|0)+1>>0]|0)>102){Ua=44;break b}}while(0);if(!((a[(c[z>>2]|0)+2>>0]|0)>=48?(a[(c[z>>2]|0)+2>>0]|0)<=57:0))Ua=40;do if((Ua|0)==40){Ua=0;if((a[(c[z>>2]|0)+2>>0]|0)>=65?(a[(c[z>>2]|0)+2>>0]|0)<=70:0)break;if((a[(c[z>>2]|0)+2>>0]|0)<97){Ua=44;break b}if((a[(c[z>>2]|0)+2>>0]|0)>102){Ua=44;break b}}while(0);c[z>>2]=(c[z>>2]|0)+2;c[A>>2]=(c[A>>2]|0)-2;c[K>>2]=0;break c;break}case 13:{if(c[A>>2]|0?(a[(c[z>>2]|0)+1>>0]|0)==10:0){c[z>>2]=(c[z>>2]|0)+1;c[A>>2]=(c[A>>2]|0)+-1}c[K>>2]=0;break c;break}case 10:{if(c[A>>2]|0?(a[(c[z>>2]|0)+1>>0]|0)==13:0){c[z>>2]=(c[z>>2]|0)+1;c[A>>2]=(c[A>>2]|0)+-1}c[K>>2]=0;break c;break}default:{Ua=54;break b}}}if(c[F>>2]|0){if(Bu(a[c[z>>2]>>0]|0)|0){c[J>>2]=(c[J>>2]|0)+1;break}if((a[c[z>>2]>>0]|0)!=35)if(Af(c[z>>2]|0)|0)break;else{Ua=82;break b}if(c[J>>2]&1|0){Ua=66;break b}c[L>>2]=(c[J>>2]|0)/2|0;c[X>>2]=yf(M,c[L>>2]|0)|0;if(c[X>>2]|0){Ua=68;break b}l=M+8|0;k=c[l>>2]|0;c[l>>2]=k+1;a[k>>0]=1;b[Y>>1]=c[L>>2];k=c[M+8>>2]|0;a[k>>0]=a[Y>>0]|0;a[k+1>>0]=a[Y+1>>0]|0;k=M+8|0;c[k>>2]=(c[k>>2]|0)+2;c[F>>2]=(c[F>>2]|0)+1;while(1){if((c[F>>2]|0)>>>0>=(c[z>>2]|0)>>>0)break;if(!(Af(c[F>>2]|0)|0)){c[Z>>2]=Bf(d[c[F>>2]>>0]|0)|0;c[F>>2]=(c[F>>2]|0)+1;while(1){if((c[F>>2]|0)>>>0>=(c[z>>2]|0)>>>0)break;if(!(Af(c[F>>2]|0)|0))break;c[F>>2]=(c[F>>2]|0)+1}if((c[F>>2]|0)>>>0<(c[z>>2]|0)>>>0){c[Z>>2]=c[Z>>2]<<4;k=Bf(d[c[F>>2]>>0]|0)|0;c[Z>>2]=(c[Z>>2]|0)+k}k=c[Z>>2]&255;l=M+8|0;m=c[l>>2]|0;c[l>>2]=m+1;a[m>>0]=k}c[F>>2]=(c[F>>2]|0)+1}c[F>>2]=0;break}if(c[G>>2]|0){if((a[c[z>>2]>>0]|0)!=124)break;c[G>>2]=0;break}if(c[B>>2]|0){if((a[c[z>>2]>>0]|0)>=48?(a[c[z>>2]>>0]|0)<=57:0)break;if((a[c[z>>2]>>0]|0)==58){c[L>>2]=mw(c[B>>2]|0)|0;c[B>>2]=0;if((c[L>>2]|0)>>>0>((c[A>>2]|0)-1|0)>>>0){Ua=91;break b}c[_>>2]=yf(M,c[L>>2]|0)|0;if(c[_>>2]|0){Ua=93;break b}k=M+8|0;m=c[k>>2]|0;c[k>>2]=m+1;a[m>>0]=1;b[$>>1]=c[L>>2];m=c[M+8>>2]|0;a[m>>0]=a[$>>0]|0;a[m+1>>0]=a[$+1>>0]|0;m=M+8|0;c[m>>2]=(c[m>>2]|0)+2;Ow(c[M+8>>2]|0,(c[z>>2]|0)+1|0,c[L>>2]|0)|0;m=M+8|0;c[m>>2]=(c[m>>2]|0)+(c[L>>2]|0);c[A>>2]=(c[A>>2]|0)-(c[L>>2]|0);c[z>>2]=(c[z>>2]|0)+(c[L>>2]|0);break}if((a[c[z>>2]>>0]|0)==34){c[B>>2]=0;c[D>>2]=c[z>>2];c[K>>2]=0;break}if((a[c[z>>2]>>0]|0)==35){c[B>>2]=0;c[F>>2]=c[z>>2];c[J>>2]=0;break}if((a[c[z>>2]>>0]|0)!=124){Ua=101;break b}c[B>>2]=0;c[G>>2]=c[z>>2];break}m=a[c[z>>2]>>0]|0;if(!(c[I>>2]|0)){if((m|0)==40){if(c[H>>2]|0){Ua=179;break b}c[La>>2]=yf(M,0)|0;if(c[La>>2]|0){Ua=181;break b}k=M+8|0;l=c[k>>2]|0;c[k>>2]=l+1;a[l>>0]=3;c[O>>2]=(c[O>>2]|0)+1;break}if((a[c[z>>2]>>0]|0)==41){if(c[H>>2]|0){Ua=185;break b}c[Ma>>2]=yf(M,0)|0;if(c[Ma>>2]|0){Ua=187;break b}l=M+8|0;k=c[l>>2]|0;c[l>>2]=k+1;a[k>>0]=4;c[O>>2]=(c[O>>2]|0)+-1;break}k=c[z>>2]|0;if((a[c[z>>2]>>0]|0)==34){c[D>>2]=k;c[K>>2]=0;break}l=c[z>>2]|0;if((a[k>>0]|0)==35){c[F>>2]=l;c[J>>2]=0;break}k=c[z>>2]|0;if((a[l>>0]|0)==124){c[G>>2]=k;break}if((a[k>>0]|0)==91){Va=c[z>>2]|0;if(c[H>>2]|0){Ua=197;break b}c[H>>2]=Va;break}if((a[c[z>>2]>>0]|0)==93){if(!(c[H>>2]|0)){Ua=201;break b}c[H>>2]=0;break}do if((a[c[z>>2]>>0]|0)>=48){if((a[c[z>>2]>>0]|0)>57)break;Wa=c[z>>2]|0;if((a[c[z>>2]>>0]|0)==48){Ua=206;break b}c[B>>2]=Wa;break c}while(0);k=(Bv(22408,a[c[z>>2]>>0]|0)|0)!=0;l=c[z>>2]|0;if(k){c[E>>2]=l;break}if(Af(l)|0)break;Xa=c[z>>2]|0;if((a[c[z>>2]>>0]|0)==123){Ua=212;break b}if(Bv(22507,a[Xa>>0]|0)|0){Ua=214;break b}if(!(c[v>>2]|0)){Ua=218;break b}if((a[c[z>>2]>>0]|0)!=37){Ua=218;break b}c[I>>2]=c[z>>2];break}do if((m|0)!=109?(a[c[z>>2]>>0]|0)!=77:0){if((a[c[z>>2]>>0]|0)==115){if(c[w>>2]|0){l=c[N>>2]|0;c[N>>2]=l+1;c[na>>2]=c[c[(c[w>>2]|0)+(l<<2)>>2]>>2]}else{l=c[x>>2]|0;k=(c[l>>2]|0)+(4-1)&~(4-1);h=c[k>>2]|0;c[l>>2]=k+4;c[na>>2]=h}c[oa>>2]=Tu(c[na>>2]|0)|0;c[pa>>2]=yf(M,c[oa>>2]|0)|0;if(c[pa>>2]|0){Ua=135;break b}h=M+8|0;k=c[h>>2]|0;c[h>>2]=k+1;a[k>>0]=1;b[qa>>1]=c[oa>>2];k=c[M+8>>2]|0;a[k>>0]=a[qa>>0]|0;a[k+1>>0]=a[qa+1>>0]|0;k=M+8|0;c[k>>2]=(c[k>>2]|0)+2;Ow(c[M+8>>2]|0,c[na>>2]|0,c[oa>>2]|0)|0;k=M+8|0;c[k>>2]=(c[k>>2]|0)+(c[oa>>2]|0);break}if((a[c[z>>2]>>0]|0)==98){if(c[w>>2]|0){k=c[N>>2]|0;c[N>>2]=k+1;c[sa>>2]=c[c[(c[w>>2]|0)+(k<<2)>>2]>>2]}else{k=c[x>>2]|0;h=(c[k>>2]|0)+(4-1)&~(4-1);l=c[h>>2]|0;c[k>>2]=h+4;c[sa>>2]=l}if(c[w>>2]|0){l=c[N>>2]|0;c[N>>2]=l+1;c[ra>>2]=c[c[(c[w>>2]|0)+(l<<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M+4>>2]|0)-1|0)|0;if(!(c[ka>>2]|0)){Ua=125;break b}c[la>>2]=c[ka>>2];Ow(c[la>>2]|0,c[M>>2]|0,(c[M+8>>2]|0)-(c[M>>2]|0)|0)|0;c[M+8>>2]=(c[la>>2]|0)+((c[M+8>>2]|0)-(c[M>>2]|0));hf(c[M>>2]|0);c[M>>2]=c[ka>>2]}while(0);k=M+8|0;h=c[k>>2]|0;c[k>>2]=h+1;a[h>>0]=1;b[ma>>1]=c[ba>>2];h=c[M+8>>2]|0;a[h>>0]=a[ma>>0]|0;a[h+1>>0]=a[ma+1>>0]|0;h=M+8|0;c[h>>2]=(c[h>>2]|0)+2;if(Qo(c[ca>>2]|0,c[M+8>>2]|0,c[ba>>2]|0,ba,c[aa>>2]|0)|0){Ua=128;break b}h=M+8|0;c[h>>2]=(c[h>>2]|0)+(c[ba>>2]|0)}while(0);c[I>>2]=0}while(0);c[z>>2]=(c[z>>2]|0)+1;c[A>>2]=(c[A>>2]|0)+-1}switch(Ua|0){case 18:{c[y>>2]=c[P>>2];c[c[s>>2]>>2]=(c[z>>2]|0)-(c[t>>2]|0);break a;break}case 29:{c[c[s>>2]>>2]=(c[z>>2]|0)-(c[t>>2]|0);c[y>>2]=206;break a;break}case 44:{c[c[s>>2]>>2]=(c[z>>2]|0)-(c[t>>2]|0);c[y>>2]=206;break a;break}case 54:{c[c[s>>2]>>2]=(c[z>>2]|0)-(c[t>>2]|0);c[y>>2]=206;break a;break}case 59:{c[y>>2]=c[T>>2];c[c[s>>2]>>2]=(c[z>>2]|0)-(c[t>>2]|0);break a;break}case 66:{c[c[s>>2]>>2]=(c[z>>2]|0)-(c[t>>2]|0);c[y>>2]=212;break a;break}case 68:{c[y>>2]=c[X>>2];c[c[s>>2]>>2]=(c[z>>2]|0)-(c[t>>2]|0);break a;break}case 82:{c[c[s>>2]>>2]=(c[z>>2]|0)-(c[t>>2]|0);c[y>>2]=211;break a;break}case 91:{c[c[s>>2]>>2]=(c[z>>2]|0)-(c[t>>2]|0);c[y>>2]=202;break a;break}case 93:{c[y>>2]=c[_>>2];c[c[s>>2]>>2]=(c[z>>2]|0)-(c[t>>2]|0);break a;break}case 101:{c[c[s>>2]>>2]=(c[z>>2]|0)-(c[t>>2]|0);c[y>>2]=201;break a;break}case 111:{c[y>>2]=c[fa>>2];c[c[s>>2]>>2]=(c[z>>2]|0)-(c[t>>2]|0);break a;break}case 115:{c[y>>2]=pt(c[(fu()|0)>>2]|0)|0;break a;break}case 119:{Ee(22479,1433,22486);break}case 121:{c[y>>2]=c[ja>>2];c[c[s>>2]>>2]=(c[z>>2]|0)-(c[t>>2]|0);break a;break}case 125:{c[y>>2]=pt(c[(fu()|0)>>2]|0)|0;break a;break}case 128:{Ee(22479,1460,22486);break}case 135:{c[y>>2]=c[pa>>2];c[c[s>>2]>>2]=(c[z>>2]|0)-(c[t>>2]|0);break a;break}case 145:{c[y>>2]=c[ta>>2];c[c[s>>2]>>2]=(c[z>>2]|0)-(c[t>>2]|0);break a;break}case 150:{c[y>>2]=pt(c[(fu()|0)>>2]|0)|0;break a;break}case 158:{c[y>>2]=c[Aa>>2];c[c[s>>2]>>2]=(c[z>>2]|0)-(c[t>>2]|0);break a;break}case 165:{c[y>>2]=c[Fa>>2];c[c[s>>2]>>2]=(c[z>>2]|0)-(c[t>>2]|0);break a;break}case 173:{c[y>>2]=c[Ka>>2];c[c[s>>2]>>2]=(c[z>>2]|0)-(c[t>>2]|0);break a;break}case 175:{c[c[s>>2]>>2]=(c[z>>2]|0)-(c[t>>2]|0);c[y>>2]=201;break a;break}case 179:{c[c[s>>2]>>2]=(c[z>>2]|0)-(c[t>>2]|0);c[y>>2]=209;break a;break}case 181:{c[y>>2]=c[La>>2];c[c[s>>2]>>2]=(c[z>>2]|0)-(c[t>>2]|0);break a;break}case 185:{c[c[s>>2]>>2]=(c[z>>2]|0)-(c[t>>2]|0);c[y>>2]=209;break a;break}case 187:{c[y>>2]=c[Ma>>2];c[c[s>>2]>>2]=(c[z>>2]|0)-(c[t>>2]|0);break a;break}case 197:{c[c[s>>2]>>2]=Va-(c[t>>2]|0);c[y>>2]=208;break a;break}case 201:{c[c[s>>2]>>2]=(c[z>>2]|0)-(c[t>>2]|0);c[y>>2]=209;break a;break}case 206:{c[c[s>>2]>>2]=Wa-(c[t>>2]|0);c[y>>2]=207;break a;break}case 212:{c[c[s>>2]>>2]=Xa-(c[t>>2]|0);c[y>>2]=210;break a;break}case 214:{c[c[s>>2]>>2]=(c[z>>2]|0)-(c[t>>2]|0);c[y>>2]=210;break a;break}case 218:{c[c[s>>2]>>2]=(c[z>>2]|0)-(c[t>>2]|0);c[y>>2]=205;break a;break}case 220:{c[Na>>2]=yf(M,0)|0;if(c[Na>>2]|0){c[y>>2]=c[Na>>2];c[c[s>>2]>>2]=(c[z>>2]|0)-(c[t>>2]|0);break a}h=M+8|0;k=c[h>>2]|0;c[h>>2]=k+1;a[k>>0]=0;if((c[O>>2]|0)==0|(c[y>>2]|0)!=0)break a;c[y>>2]=203;break a;break}}}else{c[y>>2]=pt(c[(fu()|0)>>2]|0)|0;c[c[s>>2]>>2]=0}while(0);s=c[M>>2]|0;if(c[y>>2]|0){if(s|0){d:do if(ff(c[M>>2]|0)|0){c[Oa>>2]=c[M>>2];c[Pa>>2]=1+(c[M+4>>2]|0)-1;a[Qa>>0]=0;O=Ra;c[O>>2]=d[Qa>>0];c[O+4>>2]=0;while(1){if(!(c[Oa>>2]&7|0?(c[Pa>>2]|0)!=0:0))break;a[c[Oa>>2]>>0]=a[Qa>>0]|0;c[Oa>>2]=(c[Oa>>2]|0)+1;c[Pa>>2]=(c[Pa>>2]|0)+-1}if((c[Pa>>2]|0)>>>0>=8){O=Ra;t=Xw(c[O>>2]|0,c[O+4>>2]|0,16843009,16843009)|0;O=Ra;c[O>>2]=t;c[O+4>>2]=C;do{c[Sa>>2]=c[Oa>>2];O=Ra;t=c[O+4>>2]|0;z=c[Sa>>2]|0;c[z>>2]=c[O>>2];c[z+4>>2]=t;c[Pa>>2]=(c[Pa>>2]|0)-8;c[Oa>>2]=(c[Oa>>2]|0)+8}while((c[Pa>>2]|0)>>>0>=8)}while(1){if(!(c[Pa>>2]|0))break d;a[c[Oa>>2]>>0]=a[Qa>>0]|0;c[Oa>>2]=(c[Oa>>2]|0)+1;c[Pa>>2]=(c[Pa>>2]|0)+-1}}while(0);hf(c[M>>2]|0)}}else{M=Df(s)|0;c[c[r>>2]>>2]=M}c[q>>2]=c[y>>2];Ta=c[q>>2]|0;i=n;return Ta|0}function yf(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0;d=i;i=i+32|0;if((i|0)>=(j|0))U();e=d+24|0;f=d+20|0;g=d+16|0;h=d+12|0;k=d+8|0;l=d+4|0;m=d;c[f>>2]=a;c[g>>2]=b;c[h>>2]=(c[(c[f>>2]|0)+8>>2]|0)-(c[c[f>>2]>>2]|0);do if(((c[h>>2]|0)+(c[g>>2]|0)+2+1|0)>>>0>=(c[(c[f>>2]|0)+4>>2]|0)>>>0){c[m>>2]=(c[(c[f>>2]|0)+4>>2]|0)+((c[g>>2]|0)+2+1<<1);if((c[m>>2]|0)>>>0<=(c[(c[f>>2]|0)+4>>2]|0)>>>0){c[e>>2]=67;n=c[e>>2]|0;i=d;return n|0}c[k>>2]=gf(c[c[f>>2]>>2]|0,1+(c[m>>2]|0)-1|0)|0;if(c[k>>2]|0){c[(c[f>>2]|0)+4>>2]=c[m>>2];c[l>>2]=c[k>>2];c[(c[f>>2]|0)+8>>2]=(c[l>>2]|0)+(c[h>>2]|0);c[c[f>>2]>>2]=c[k>>2];break}c[e>>2]=pt(c[(fu()|0)>>2]|0)|0;n=c[e>>2]|0;i=d;return n|0}while(0);c[e>>2]=0;n=c[e>>2]|0;i=d;return n|0}function zf(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;g=i;i=i+32|0;if((i|0)>=(j|0))U();h=g+24|0;k=g+20|0;l=g+16|0;m=g+12|0;n=g+8|0;o=g+4|0;p=g;c[h>>2]=b;c[k>>2]=e;c[l>>2]=f;c[m>>2]=0;c[n>>2]=c[h>>2];c[o>>2]=c[l>>2];c[p>>2]=c[k>>2];while(1){if(!(c[p>>2]|0))break;k=d[c[n>>2]>>0]|0;do if(!(c[m>>2]|0))if((k|0)==92){c[m>>2]=1;break}else{h=a[c[n>>2]>>0]|0;f=c[o>>2]|0;c[o>>2]=f+1;a[f>>0]=h;break}else{a:do switch(k|0){case 98:{h=c[o>>2]|0;c[o>>2]=h+1;a[h>>0]=8;break}case 116:{h=c[o>>2]|0;c[o>>2]=h+1;a[h>>0]=9;break}case 118:{h=c[o>>2]|0;c[o>>2]=h+1;a[h>>0]=11;break}case 110:{h=c[o>>2]|0;c[o>>2]=h+1;a[h>>0]=10;break}case 102:{h=c[o>>2]|0;c[o>>2]=h+1;a[h>>0]=12;break}case 114:{h=c[o>>2]|0;c[o>>2]=h+1;a[h>>0]=13;break}case 34:{h=c[o>>2]|0;c[o>>2]=h+1;a[h>>0]=34;break}case 39:{h=c[o>>2]|0;c[o>>2]=h+1;a[h>>0]=39;break}case 92:{h=c[o>>2]|0;c[o>>2]=h+1;a[h>>0]=92;break}case 13:{if((c[p>>2]|0)>>>0>1?(d[(c[n>>2]|0)+1>>0]|0|0)==10:0){c[n>>2]=(c[n>>2]|0)+1;c[p>>2]=(c[p>>2]|0)+-1}break}case 10:{if((c[p>>2]|0)>>>0>1?(d[(c[n>>2]|0)+1>>0]|0|0)==13:0){c[n>>2]=(c[n>>2]|0)+1;c[p>>2]=(c[p>>2]|0)+-1}break}case 120:{if((c[p>>2]|0)>>>0>2){if(!((d[(c[n>>2]|0)+1>>0]|0|0)>=48?(d[(c[n>>2]|0)+1>>0]|0|0)<=57:0))q=23;do if((q|0)==23){q=0;if((d[(c[n>>2]|0)+1>>0]|0|0)>=65?(d[(c[n>>2]|0)+1>>0]|0|0)<=70:0)break;if((d[(c[n>>2]|0)+1>>0]|0|0)<97)break a;if((d[(c[n>>2]|0)+1>>0]|0|0)>102)break a}while(0);if(!((d[(c[n>>2]|0)+2>>0]|0|0)>=48?(d[(c[n>>2]|0)+2>>0]|0|0)<=57:0))q=29;do if((q|0)==29){q=0;if((d[(c[n>>2]|0)+2>>0]|0|0)>=65?(d[(c[n>>2]|0)+2>>0]|0|0)<=70:0)break;if((d[(c[n>>2]|0)+2>>0]|0|0)<97)break a;if((d[(c[n>>2]|0)+2>>0]|0|0)>102)break a}while(0);c[n>>2]=(c[n>>2]|0)+1;c[p>>2]=(c[p>>2]|0)+-1;h=d[c[n>>2]>>0]|0;if((d[c[n>>2]>>0]|0|0)<=57)r=h-48|0;else{f=d[c[n>>2]>>0]|0;r=((h|0)<=70?f-65|0:f-97|0)+10|0}f=d[(c[n>>2]|0)+1>>0]|0;if((d[(c[n>>2]|0)+1>>0]|0|0)<=57)s=f-48|0;else{h=d[(c[n>>2]|0)+1>>0]|0;s=((f|0)<=70?h-65|0:h-97|0)+10|0}h=c[o>>2]|0;c[o>>2]=h+1;a[h>>0]=(r<<4)+s;c[n>>2]=(c[n>>2]|0)+1;c[p>>2]=(c[p>>2]|0)+-1}break}default:if(((((((c[p>>2]|0)>>>0>2?(d[c[n>>2]>>0]|0|0)>=48:0)?(d[c[n>>2]>>0]|0|0)<=55:0)?(d[(c[n>>2]|0)+1>>0]|0|0)>=48:0)?(d[(c[n>>2]|0)+1>>0]|0|0)<=55:0)?(d[(c[n>>2]|0)+2>>0]|0|0)>=48:0)?(d[(c[n>>2]|0)+2>>0]|0|0)<=55:0){h=((d[c[n>>2]>>0]|0)-48<<6)+((d[(c[n>>2]|0)+1>>0]|0)-48<<3)+((d[(c[n>>2]|0)+2>>0]|0)-48)&255;f=c[o>>2]|0;c[o>>2]=f+1;a[f>>0]=h;c[n>>2]=(c[n>>2]|0)+2;c[p>>2]=(c[p>>2]|0)-2}}while(0);c[m>>2]=0}while(0);c[p>>2]=(c[p>>2]|0)+-1;c[n>>2]=(c[n>>2]|0)+1}i=g;return (c[o>>2]|0)-(c[l>>2]|0)|0}function Af(b){b=b|0;var d=0,e=0,f=0;d=i;i=i+16|0;if((i|0)>=(j|0))U();e=d+4|0;f=d;c[f>>2]=b;switch(a[c[f>>2]>>0]|0){case 10:case 13:case 12:case 11:case 9:case 32:{c[e>>2]=1;break}default:c[e>>2]=0}i=d;return c[e>>2]|0}function Bf(a){a=a|0;var b=0,d=0,e=0,f=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b+4|0;e=b;c[e>>2]=a;a=c[e>>2]|0;do if(!((c[e>>2]|0)>=48&(c[e>>2]|0)<=57)){f=c[e>>2]|0;if((a|0)>=65&(c[e>>2]|0)<=70){c[d>>2]=10+f-65;break}if((f|0)>=97&(c[e>>2]|0)<=102){c[d>>2]=10+(c[e>>2]|0)-97;break}else{c[d>>2]=0;break}}else c[d>>2]=a-48;while(0);i=b;return c[d>>2]|0}function Cf(b,f){b=b|0;f=f|0;var g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;g=i;i=i+32|0;if((i|0)>=(j|0))U();h=g+20|0;k=g+16|0;l=g+12|0;m=g+8|0;n=g+24|0;o=g+4|0;p=g;c[k>>2]=b;c[l>>2]=f;c[p>>2]=0;c[c[l>>2]>>2]=0;a:do if(c[k>>2]|0){c[m>>2]=c[k>>2];while(1){f=d[c[m>>2]>>0]|0;c[o>>2]=f;if(!f)break a;c[m>>2]=(c[m>>2]|0)+1;if((c[o>>2]|0)==1){f=c[m>>2]|0;a[n>>0]=a[f>>0]|0;a[n+1>>0]=a[f+1>>0]|0;c[m>>2]=(c[m>>2]|0)+(2+(e[n>>1]|0));continue}if((c[o>>2]|0)!=3){if((c[o>>2]|0)!=4)continue;c[p>>2]=(c[p>>2]|0)+-1;if(c[p>>2]|0)continue;else break}if(!(c[p>>2]|0))c[c[l>>2]>>2]=(c[m>>2]|0)+-1-(c[k>>2]|0);c[p>>2]=(c[p>>2]|0)+1}c[h>>2]=(c[m>>2]|0)-(c[k>>2]|0);q=c[h>>2]|0;i=g;return q|0}while(0);c[h>>2]=0;q=c[h>>2]|0;i=g;return q|0}function Df(a){a=a|0;var b=0,e=0,f=0,g=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();e=b+8|0;f=b+4|0;g=b;c[f>>2]=a;do if(c[f>>2]|0){c[g>>2]=c[f>>2];if(!(d[c[g>>2]>>0]|0)){Ef(c[f>>2]|0);c[e>>2]=0;break}if((d[c[g>>2]>>0]|0|0)==3?(d[(c[g>>2]|0)+1>>0]|0|0)==4:0){Ef(c[f>>2]|0);c[e>>2]=0;break}c[e>>2]=c[f>>2]}else c[e>>2]=0;while(0);i=b;return c[e>>2]|0}function Ef(b){b=b|0;var f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;f=i;i=i+48|0;if((i|0)>=(j|0))U();g=f+28|0;h=f+24|0;k=f+20|0;l=f+32|0;m=f+16|0;n=f+12|0;o=f+34|0;p=f;q=f+8|0;c[g>>2]=b;if(!(c[g>>2]|0)){i=f;return}a:do if(ff(c[g>>2]|0)|0){c[h>>2]=c[g>>2];while(1){b=d[c[h>>2]>>0]|0;c[k>>2]=b;if(!b)break;c[h>>2]=(c[h>>2]|0)+1;if((c[k>>2]|0)!=1)continue;b=c[h>>2]|0;a[l>>0]=a[b>>0]|0;a[l+1>>0]=a[b+1>>0]|0;c[h>>2]=(c[h>>2]|0)+2;c[h>>2]=(c[h>>2]|0)+(e[l>>1]|0)}c[m>>2]=c[g>>2];c[n>>2]=(c[h>>2]|0)-(c[g>>2]|0);a[o>>0]=0;b=p;c[b>>2]=d[o>>0];c[b+4>>2]=0;while(1){if(!(c[m>>2]&7|0?(c[n>>2]|0)!=0:0))break;a[c[m>>2]>>0]=a[o>>0]|0;c[m>>2]=(c[m>>2]|0)+1;c[n>>2]=(c[n>>2]|0)+-1}if((c[n>>2]|0)>>>0>=8){b=p;r=Xw(c[b>>2]|0,c[b+4>>2]|0,16843009,16843009)|0;b=p;c[b>>2]=r;c[b+4>>2]=C;do{c[q>>2]=c[m>>2];b=p;r=c[b+4>>2]|0;s=c[q>>2]|0;c[s>>2]=c[b>>2];c[s+4>>2]=r;c[n>>2]=(c[n>>2]|0)-8;c[m>>2]=(c[m>>2]|0)+8}while((c[n>>2]|0)>>>0>=8)}while(1){if(!(c[n>>2]|0))break a;a[c[m>>2]>>0]=a[o>>0]|0;c[m>>2]=(c[m>>2]|0)+1;c[n>>2]=(c[n>>2]|0)+-1}}while(0);hf(c[g>>2]|0);i=f;return}function Ff(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,k=0,l=0;f=i;i=i+16|0;if((i|0)>=(j|0))U();g=f+12|0;h=f+8|0;k=f+4|0;l=f;c[g>>2]=a;c[h>>2]=b;c[k>>2]=d;c[l>>2]=e;e=uf(c[g>>2]|0,c[h>>2]|0,c[k>>2]|0,c[l>>2]|0,0)|0;i=f;return e|0}function Gf(f,g,h){f=f|0;g=g|0;h=h|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0;k=i;i=i+48|0;if((i|0)>=(j|0))U();l=k+32|0;m=k+28|0;n=k+24|0;o=k+20|0;p=k+16|0;q=k+36|0;r=k+12|0;s=k+8|0;t=k+4|0;u=k;c[m>>2]=f;c[n>>2]=g;c[o>>2]=h;if(!(c[m>>2]|0)){c[l>>2]=0;v=c[l>>2]|0;i=k;return v|0}if(!(c[o>>2]|0))c[o>>2]=Tu(c[n>>2]|0)|0;c[p>>2]=c[m>>2];while(1){if(!(d[c[p>>2]>>0]|0)){w=29;break}if((d[c[p>>2]>>0]|0|0)==3?(d[(c[p>>2]|0)+1>>0]|0|0)==1:0){c[r>>2]=c[p>>2];c[p>>2]=(c[p>>2]|0)+2;m=c[p>>2]|0;a[q>>0]=a[m>>0]|0;a[q+1>>0]=a[m+1>>0]|0;c[p>>2]=(c[p>>2]|0)+2;if((e[q>>1]|0|0)==(c[o>>2]|0)?(vv(c[p>>2]|0,c[n>>2]|0,c[o>>2]|0)|0)==0:0)break;c[p>>2]=(c[p>>2]|0)+(e[q>>1]|0);continue}if((d[c[p>>2]>>0]|0|0)==1){m=(c[p>>2]|0)+1|0;c[p>>2]=m;a[q>>0]=a[m>>0]|0;a[q+1>>0]=a[m+1>>0]|0;c[p>>2]=(c[p>>2]|0)+2;c[p>>2]=(c[p>>2]|0)+(e[q>>1]|0);continue}else{c[p>>2]=(c[p>>2]|0)+1;continue}}if((w|0)==29){c[l>>2]=0;v=c[l>>2]|0;i=k;return v|0}c[u>>2]=1;c[p>>2]=(c[p>>2]|0)+(e[q>>1]|0);a:while(1){x=c[p>>2]|0;if(!(c[u>>2]|0))break;do if((d[x>>0]|0|0)!=1){if((d[c[p>>2]>>0]|0|0)==3){c[u>>2]=(c[u>>2]|0)+1;break}if((d[c[p>>2]>>0]|0|0)!=4)if(!(d[c[p>>2]>>0]|0)){w=20;break a}else break;else{c[u>>2]=(c[u>>2]|0)+-1;break}}else{o=(c[p>>2]|0)+1|0;c[p>>2]=o;a[q>>0]=a[o>>0]|0;a[q+1>>0]=a[o+1>>0]|0;c[p>>2]=(c[p>>2]|0)+(2+(e[q>>1]|0));c[p>>2]=(c[p>>2]|0)+-1}while(0);c[p>>2]=(c[p>>2]|0)+1}if((w|0)==20)Ee(22479,481,22510);b[q>>1]=x-(c[r>>2]|0);c[s>>2]=bf(1+(e[q>>1]|0)|0)|0;if(c[s>>2]|0){c[t>>2]=c[s>>2];Ow(c[t>>2]|0,c[r>>2]|0,e[q>>1]|0|0)|0;c[t>>2]=(c[t>>2]|0)+(e[q>>1]|0);q=c[t>>2]|0;c[t>>2]=q+1;a[q>>0]=0;c[l>>2]=Df(c[s>>2]|0)|0;v=c[l>>2]|0;i=k;return v|0}else{c[l>>2]=0;v=c[l>>2]|0;i=k;return v|0}return 0}function Hf(b){b=b|0;var f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0;f=i;i=i+32|0;if((i|0)>=(j|0))U();g=f+20|0;h=f+16|0;k=f+12|0;l=f+24|0;m=f+8|0;n=f+4|0;o=f;c[h>>2]=b;c[n>>2]=0;c[o>>2]=0;if(!(c[h>>2]|0)){c[g>>2]=0;p=c[g>>2]|0;i=f;return p|0}c[k>>2]=c[h>>2];while(1){h=d[c[k>>2]>>0]|0;c[m>>2]=h;if(!h)break;c[k>>2]=(c[k>>2]|0)+1;if((c[m>>2]|0)==1){h=c[k>>2]|0;a[l>>0]=a[h>>0]|0;a[l+1>>0]=a[h+1>>0]|0;c[k>>2]=(c[k>>2]|0)+(2+(e[l>>1]|0));if((c[o>>2]|0)!=1)continue;c[n>>2]=(c[n>>2]|0)+1;continue}if((c[m>>2]|0)!=3){if((c[m>>2]|0)!=4)continue;c[o>>2]=(c[o>>2]|0)+-1;continue}if((c[o>>2]|0)==1)c[n>>2]=(c[n>>2]|0)+1;c[o>>2]=(c[o>>2]|0)+1}c[g>>2]=c[n>>2];p=c[g>>2]|0;i=f;return p|0}function If(f,g){f=f|0;g=g|0;var h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0;h=i;i=i+48|0;if((i|0)>=(j|0))U();k=h+28|0;l=h+24|0;m=h+20|0;n=h+16|0;o=h+32|0;p=h+12|0;q=h+8|0;r=h+4|0;s=h;c[l>>2]=f;c[m>>2]=g;c[r>>2]=0;if(c[l>>2]|0?(d[c[l>>2]>>0]|0|0)==3:0){c[n>>2]=c[l>>2];while(1){l=(c[m>>2]|0)>0;c[n>>2]=(c[n>>2]|0)+1;t=(d[c[n>>2]>>0]|0|0)==1;if(!l)break;if(t){l=(c[n>>2]|0)+1|0;c[n>>2]=l;a[o>>0]=a[l>>0]|0;a[o+1>>0]=a[l+1>>0]|0;c[n>>2]=(c[n>>2]|0)+(2+(e[o>>1]|0));c[n>>2]=(c[n>>2]|0)+-1;if(c[r>>2]|0)continue;c[m>>2]=(c[m>>2]|0)+-1;continue}if((d[c[n>>2]>>0]|0|0)==3){c[r>>2]=(c[r>>2]|0)+1;continue}if((d[c[n>>2]>>0]|0|0)!=4)if(!(d[c[n>>2]>>0]|0)){u=15;break}else continue;c[r>>2]=(c[r>>2]|0)+-1;if(c[r>>2]|0)continue;c[m>>2]=(c[m>>2]|0)+-1}if((u|0)==15){c[k>>2]=0;v=c[k>>2]|0;i=h;return v|0}do if(t){m=(c[n>>2]|0)+1|0;a[o>>0]=a[m>>0]|0;a[o+1>>0]=a[m+1>>0]|0;c[p>>2]=bf(5+(e[o>>1]|0)+1|0)|0;if(c[p>>2]|0){c[q>>2]=c[p>>2];m=c[q>>2]|0;c[q>>2]=m+1;a[m>>0]=3;Ow(c[q>>2]|0,c[n>>2]|0,3+(e[o>>1]|0)|0)|0;c[q>>2]=(c[q>>2]|0)+(3+(e[o>>1]|0));m=c[q>>2]|0;c[q>>2]=m+1;a[m>>0]=4;a[c[q>>2]>>0]=0;break}c[k>>2]=0;v=c[k>>2]|0;i=h;return v|0}else{if((d[c[n>>2]>>0]|0|0)!=3){c[p>>2]=0;break}c[s>>2]=c[n>>2];c[r>>2]=1;a:do{c[n>>2]=(c[n>>2]|0)+1;do if((d[c[n>>2]>>0]|0|0)!=1){if((d[c[n>>2]>>0]|0|0)==3){c[r>>2]=(c[r>>2]|0)+1;break}if((d[c[n>>2]>>0]|0|0)!=4)if(!(d[c[n>>2]>>0]|0)){u=29;break a}else break;else{c[r>>2]=(c[r>>2]|0)+-1;break}}else{m=(c[n>>2]|0)+1|0;c[n>>2]=m;a[o>>0]=a[m>>0]|0;a[o+1>>0]=a[m+1>>0]|0;c[n>>2]=(c[n>>2]|0)+(2+(e[o>>1]|0));c[n>>2]=(c[n>>2]|0)+-1}while(0)}while((c[r>>2]|0)!=0);if((u|0)==29)Ee(22479,673,22532);b[o>>1]=(c[n>>2]|0)+1-(c[s>>2]|0);c[p>>2]=bf(1+(e[o>>1]|0)|0)|0;if(c[p>>2]|0){c[q>>2]=c[p>>2];Ow(c[q>>2]|0,c[s>>2]|0,e[o>>1]|0|0)|0;c[q>>2]=(c[q>>2]|0)+(e[o>>1]|0);m=c[q>>2]|0;c[q>>2]=m+1;a[m>>0]=0;break}c[k>>2]=0;v=c[k>>2]|0;i=h;return v|0}while(0);c[k>>2]=Df(c[p>>2]|0)|0;v=c[k>>2]|0;i=h;return v|0}c[k>>2]=0;v=c[k>>2]|0;i=h;return v|0}function Jf(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b;c[d>>2]=a;a=If(c[d>>2]|0,0)|0;i=b;return a|0}function Kf(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=i;i=i+16|0;if((i|0)>=(j|0))U();f=e+8|0;g=e+4|0;h=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;d=Lf(c[f>>2]|0,c[g>>2]|0,c[h>>2]|0)|0;i=e;return d|0}function Lf(b,f,g){b=b|0;f=f|0;g=g|0;var h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;h=i;i=i+32|0;if((i|0)>=(j|0))U();k=h+20|0;l=h+16|0;m=h+12|0;n=h+8|0;o=h+4|0;p=h+24|0;q=h;c[l>>2]=b;c[m>>2]=f;c[n>>2]=g;c[q>>2]=0;c[c[n>>2]>>2]=0;if(!(c[l>>2]|0)){c[k>>2]=0;r=c[k>>2]|0;i=h;return r|0}c[o>>2]=c[l>>2];if((d[c[o>>2]>>0]|0|0)!=3){if(c[m>>2]|0){c[k>>2]=0;r=c[k>>2]|0;i=h;return r|0}}else c[o>>2]=(c[o>>2]|0)+1;a:while(1){s=(d[c[o>>2]>>0]|0|0)==1;if((c[m>>2]|0)<=0)break;do if(s){l=(c[o>>2]|0)+1|0;c[o>>2]=l;a[p>>0]=a[l>>0]|0;a[p+1>>0]=a[l+1>>0]|0;c[o>>2]=(c[o>>2]|0)+(2+(e[p>>1]|0));c[o>>2]=(c[o>>2]|0)+-1;if(!(c[q>>2]|0))c[m>>2]=(c[m>>2]|0)+-1}else{if((d[c[o>>2]>>0]|0|0)==3){c[q>>2]=(c[q>>2]|0)+1;break}if((d[c[o>>2]>>0]|0|0)!=4)if(!(d[c[o>>2]>>0]|0)){t=17;break a}else break;c[q>>2]=(c[q>>2]|0)+-1;if(!(c[q>>2]|0))c[m>>2]=(c[m>>2]|0)+-1}while(0);c[o>>2]=(c[o>>2]|0)+1}if((t|0)==17){c[k>>2]=0;r=c[k>>2]|0;i=h;return r|0}if(s){s=(c[o>>2]|0)+1|0;c[o>>2]=s;a[p>>0]=a[s>>0]|0;a[p+1>>0]=a[s+1>>0]|0;c[c[n>>2]>>2]=e[p>>1];c[k>>2]=(c[o>>2]|0)+2;r=c[k>>2]|0;i=h;return r|0}else{c[k>>2]=0;r=c[k>>2]|0;i=h;return r|0}return 0}function Mf(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0;e=i;i=i+32|0;if((i|0)>=(j|0))U();f=e+24|0;g=e+20|0;h=e+16|0;k=e+12|0;l=e+8|0;m=e+4|0;n=e;c[g>>2]=a;c[h>>2]=b;c[k>>2]=d;c[c[k>>2]>>2]=0;c[l>>2]=Lf(c[g>>2]|0,c[h>>2]|0,m)|0;if(!((c[l>>2]|0)!=0&(c[m>>2]|0)!=0)){c[f>>2]=0;o=c[f>>2]|0;i=e;return o|0}c[n>>2]=bf(c[m>>2]|0)|0;if(c[n>>2]|0){Ow(c[n>>2]|0,c[l>>2]|0,c[m>>2]|0)|0;c[c[k>>2]>>2]=c[m>>2];c[f>>2]=c[n>>2];o=c[f>>2]|0;i=e;return o|0}else{c[f>>2]=0;o=c[f>>2]|0;i=e;return o|0}return 0}function Nf(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0;e=i;i=i+32|0;if((i|0)>=(j|0))U();f=e+20|0;g=e+16|0;h=e+12|0;k=e+8|0;l=e+4|0;m=e;c[g>>2]=b;c[h>>2]=d;c[k>>2]=Lf(c[g>>2]|0,c[h>>2]|0,l)|0;if(!((c[k>>2]|0)==0|(c[l>>2]|0)>>>0<1)?((c[l>>2]|0)+1|0)>>>0>=1:0){c[m>>2]=bf((c[l>>2]|0)+1|0)|0;if(c[m>>2]|0){Ow(c[m>>2]|0,c[k>>2]|0,c[l>>2]|0)|0;a[(c[m>>2]|0)+(c[l>>2]|0)>>0]=0;c[f>>2]=c[m>>2];n=c[f>>2]|0;i=e;return n|0}else{c[f>>2]=0;n=c[f>>2]|0;i=e;return n|0}}c[f>>2]=0;n=c[f>>2]|0;i=e;return n|0}function Of(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;e=i;i=i+32|0;if((i|0)>=(j|0))U();f=e+28|0;g=e+24|0;h=e+20|0;k=e+16|0;l=e+12|0;m=e+8|0;n=e+4|0;o=e;c[g>>2]=a;c[h>>2]=b;c[k>>2]=d;do if((c[k>>2]|0)==8){c[n>>2]=Mf(c[g>>2]|0,c[h>>2]|0,l)|0;if(!(c[n>>2]|0)){c[f>>2]=0;p=c[f>>2]|0;i=e;return p|0}if(ff(c[g>>2]|0)|0)q=Fp(0)|0;else q=Ep(0)|0;c[m>>2]=q;if(c[m>>2]|0){rp(c[m>>2]|0,c[n>>2]|0,c[l>>2]<<3)|0;break}else{hf(c[n>>2]|0);break}}else{if(!(c[k>>2]|0))c[k>>2]=1;c[o>>2]=Lf(c[g>>2]|0,c[h>>2]|0,l)|0;if(!(c[o>>2]|0)){c[f>>2]=0;p=c[f>>2]|0;i=e;return p|0}if(Mo(m,c[k>>2]|0,c[o>>2]|0,c[l>>2]|0,0)|0){c[f>>2]=0;p=c[f>>2]|0;i=e;return p|0}}while(0);c[f>>2]=c[m>>2];p=c[f>>2]|0;i=e;return p|0}function Pf(f){f=f|0;var g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0;g=i;i=i+48|0;if((i|0)>=(j|0))U();h=g+28|0;k=g+24|0;l=g+20|0;m=g+16|0;n=g+32|0;o=g+12|0;p=g+8|0;q=g+4|0;r=g;c[k>>2]=f;c[q>>2]=0;c[r>>2]=1;if(c[k>>2]|0?(d[c[k>>2]>>0]|0|0)==3:0){c[l>>2]=c[k>>2];while(1){k=(c[r>>2]|0)>0;c[l>>2]=(c[l>>2]|0)+1;s=c[l>>2]|0;if(!k)break;if((d[s>>0]|0|0)==1){k=(c[l>>2]|0)+1|0;c[l>>2]=k;a[n>>0]=a[k>>0]|0;a[n+1>>0]=a[k+1>>0]|0;c[l>>2]=(c[l>>2]|0)+(2+(e[n>>1]|0));c[l>>2]=(c[l>>2]|0)+-1;if(c[q>>2]|0)continue;c[r>>2]=(c[r>>2]|0)+-1;continue}if((d[c[l>>2]>>0]|0|0)==3){c[q>>2]=(c[q>>2]|0)+1;continue}if((d[c[l>>2]>>0]|0|0)!=4)if(!(d[c[l>>2]>>0]|0)){t=15;break}else continue;c[q>>2]=(c[q>>2]|0)+-1;if(c[q>>2]|0)continue;c[r>>2]=(c[r>>2]|0)+-1}if((t|0)==15){c[h>>2]=0;u=c[h>>2]|0;i=g;return u|0}c[m>>2]=s;c[q>>2]=0;a:do{do if((d[c[l>>2]>>0]|0|0)!=1){if((d[c[l>>2]>>0]|0|0)==3){c[q>>2]=(c[q>>2]|0)+1;break}if((d[c[l>>2]>>0]|0|0)!=4)if(!(d[c[l>>2]>>0]|0)){t=24;break a}else break;else{c[q>>2]=(c[q>>2]|0)+-1;break}}else{s=(c[l>>2]|0)+1|0;c[l>>2]=s;a[n>>0]=a[s>>0]|0;a[n+1>>0]=a[s+1>>0]|0;c[l>>2]=(c[l>>2]|0)+(2+(e[n>>1]|0));c[l>>2]=(c[l>>2]|0)+-1}while(0);c[l>>2]=(c[l>>2]|0)+1}while((c[q>>2]|0)!=0);if((t|0)==24){c[h>>2]=0;u=c[h>>2]|0;i=g;return u|0}b[n>>1]=(c[l>>2]|0)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}function Tf(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,k=0,l=0;f=i;i=i+32|0;if((i|0)>=(j|0))U();g=f+16|0;h=f+12|0;k=f+8|0;l=f+4|0;c[g>>2]=a;c[h>>2]=b;c[k>>2]=d;c[l>>2]=e;e=wf(c[g>>2]|0,c[h>>2]|0,c[k>>2]|0,c[l>>2]|0,0,0,f)|0;i=f;return e|0}function Uf(b,f,g,h){b=b|0;f=f|0;g=g|0;h=h|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0;k=i;i=i+80|0;if((i|0)>=(j|0))U();l=k;m=k+48|0;n=k+44|0;o=k+40|0;p=k+36|0;q=k+32|0;r=k+28|0;s=k+24|0;t=k+52|0;u=k+56|0;v=k+20|0;w=k+16|0;x=k+12|0;y=k+8|0;z=k+4|0;c[n>>2]=b;c[o>>2]=f;c[p>>2]=g;c[q>>2]=h;c[v>>2]=0;c[x>>2]=0;c[r>>2]=c[n>>2]|0?c[n>>2]|0:22547;c[s>>2]=c[p>>2];a:while(1){if(!(d[c[r>>2]>>0]|0)){A=55;break}switch(d[c[r>>2]>>0]|0|0){case 3:{c[r>>2]=(c[r>>2]|0)+1;if((c[o>>2]|0)!=1){if(c[x>>2]|0)c[v>>2]=(c[v>>2]|0)+1;c[v>>2]=(c[v>>2]|0)+(c[x>>2]|0)}c[v>>2]=(c[v>>2]|0)+1;if(c[p>>2]|0){if((c[v>>2]|0)>>>0>=(c[q>>2]|0)>>>0){A=10;break a}b:do if((c[o>>2]|0)!=1){if(c[x>>2]|0){n=c[s>>2]|0;c[s>>2]=n+1;a[n>>0]=10}c[w>>2]=0;while(1){if((c[w>>2]|0)>=(c[x>>2]|0))break b;n=c[s>>2]|0;c[s>>2]=n+1;a[n>>0]=32;c[w>>2]=(c[w>>2]|0)+1}}while(0);n=c[s>>2]|0;c[s>>2]=n+1;a[n>>0]=40}c[x>>2]=(c[x>>2]|0)+1;continue a;break}case 4:{c[r>>2]=(c[r>>2]|0)+1;c[v>>2]=(c[v>>2]|0)+1;if(c[p>>2]|0){if((c[v>>2]|0)>>>0>=(c[q>>2]|0)>>>0){A=21;break a}n=c[s>>2]|0;c[s>>2]=n+1;a[n>>0]=41}c[x>>2]=(c[x>>2]|0)+-1;if((d[c[r>>2]>>0]|0|0)==3)continue a;if(!((c[o>>2]|0)!=1?(d[c[r>>2]>>0]|0|0)!=0:0))continue a;c[v>>2]=(c[v>>2]|0)+1;c[v>>2]=(c[v>>2]|0)+(c[x>>2]|0);if(!(c[p>>2]|0))continue a;if((c[v>>2]|0)>>>0>=(c[q>>2]|0)>>>0){A=27;break a}n=c[s>>2]|0;c[s>>2]=n+1;a[n>>0]=10;c[w>>2]=0;while(1){if((c[w>>2]|0)>=(c[x>>2]|0))continue a;n=c[s>>2]|0;c[s>>2]=n+1;a[n>>0]=32;c[w>>2]=(c[w>>2]|0)+1}break}case 1:{c[r>>2]=(c[r>>2]|0)+1;n=c[r>>2]|0;a[t>>0]=a[n>>0]|0;a[t+1>>0]=a[n+1>>0]|0;c[r>>2]=(c[r>>2]|0)+2;if((c[o>>2]|0)==3){n=Vf(c[r>>2]|0,e[t>>1]|0)|0;c[y>>2]=n;switch(n|0){case 1:{c[z>>2]=Wf(c[r>>2]|0,e[t>>1]|0,0)|0;break}case 2:{c[z>>2]=Xf(c[r>>2]|0,e[t>>1]|0,0)|0;break}default:c[z>>2]=Yf(c[r>>2]|0,e[t>>1]|0,0)|0}c[v>>2]=(c[v>>2]|0)+(c[z>>2]|0);if(c[p>>2]|0){if((c[v>>2]|0)>>>0>=(c[q>>2]|0)>>>0){A=38;break a}switch(c[y>>2]|0){case 1:{Wf(c[r>>2]|0,e[t>>1]|0,c[s>>2]|0)|0;break}case 2:{Xf(c[r>>2]|0,e[t>>1]|0,c[s>>2]|0)|0;break}default:Yf(c[r>>2]|0,e[t>>1]|0,c[s>>2]|0)|0}c[s>>2]=(c[s>>2]|0)+(c[z>>2]|0)}if((d[(c[r>>2]|0)+(e[t>>1]|0)>>0]|0|0)!=4?(c[v>>2]=(c[v>>2]|0)+1,c[p>>2]|0):0){if((c[v>>2]|0)>>>0>=(c[q>>2]|0)>>>0){A=47;break a}n=c[s>>2]|0;c[s>>2]=n+1;a[n>>0]=32}}else{c[l>>2]=e[t>>1];nv(u,22574,l)|0;n=Tu(u)|0;c[v>>2]=(c[v>>2]|0)+(n+(e[t>>1]|0));if(c[p>>2]|0){if((c[v>>2]|0)>>>0>=(c[q>>2]|0)>>>0){A=51;break a}c[s>>2]=ev(c[s>>2]|0,u)|0;Ow(c[s>>2]|0,c[r>>2]|0,e[t>>1]|0|0)|0;c[s>>2]=(c[s>>2]|0)+(e[t>>1]|0)}}c[r>>2]=(c[r>>2]|0)+(e[t>>1]|0);continue a;break}default:{A=54;break a}}}if((A|0)==10){c[m>>2]=0;B=c[m>>2]|0;i=k;return B|0}else if((A|0)==21){c[m>>2]=0;B=c[m>>2]|0;i=k;return B|0}else if((A|0)==27){c[m>>2]=0;B=c[m>>2]|0;i=k;return B|0}else if((A|0)==38){c[m>>2]=0;B=c[m>>2]|0;i=k;return B|0}else if((A|0)==47){c[m>>2]=0;B=c[m>>2]|0;i=k;return B|0}else if((A|0)==51){c[m>>2]=0;B=c[m>>2]|0;i=k;return B|0}else if((A|0)==54)Ee(22479,2008,22578);else if((A|0)==55){do if((c[o>>2]|0)!=1?(c[v>>2]=(c[v>>2]|0)+1,c[p>>2]|0):0){if((c[v>>2]|0)>>>0<(c[q>>2]|0)>>>0){A=c[s>>2]|0;c[s>>2]=A+1;a[A>>0]=10;break}c[m>>2]=0;B=c[m>>2]|0;i=k;return B|0}while(0);o=c[v>>2]|0;do if(c[p>>2]|0){if(o>>>0<(c[q>>2]|0)>>>0){A=c[s>>2]|0;c[s>>2]=A+1;a[A>>0]=0;break}c[m>>2]=0;B=c[m>>2]|0;i=k;return B|0}else c[v>>2]=o+1;while(0);c[m>>2]=c[v>>2];B=c[m>>2]|0;i=k;return B|0}return 0}function Vf(b,e){b=b|0;e=e|0;var f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0;f=i;i=i+32|0;if((i|0)>=(j|0))U();g=f+16|0;h=f+12|0;k=f+8|0;l=f+4|0;m=f;c[h>>2]=b;c[k>>2]=e;c[m>>2]=1;if(!(c[k>>2]|0)){c[g>>2]=1;n=c[g>>2]|0;i=f;return n|0}if(d[c[h>>2]>>0]&128|0){c[g>>2]=0;n=c[g>>2]|0;i=f;return n|0}if(!(a[c[h>>2]>>0]|0)){c[g>>2]=0;n=c[g>>2]|0;i=f;return n|0}c[l>>2]=c[h>>2];while(1){if(!(c[k>>2]|0))break;if((d[c[l>>2]>>0]|0)>=32){if((d[c[l>>2]>>0]|0)>=127?(d[c[l>>2]>>0]|0)<=160:0)o=12}else o=12;if((o|0)==12?(o=0,(Bv(22550,d[c[l>>2]>>0]|0)|0)==0):0){o=13;break}do if(c[m>>2]|0){if((d[c[l>>2]>>0]|0)>=65?(d[c[l>>2]>>0]|0)<=90:0)break;if((d[c[l>>2]>>0]|0)>=97?(d[c[l>>2]>>0]|0)<=122:0)break;if((d[c[l>>2]>>0]|0)>=48?(d[c[l>>2]>>0]|0)<=57:0)break;if(!(Bv(22560,d[c[l>>2]>>0]|0)|0))c[m>>2]=0}while(0);c[l>>2]=(c[l>>2]|0)+1;c[k>>2]=(c[k>>2]|0)+-1}if((o|0)==13){c[g>>2]=0;n=c[g>>2]|0;i=f;return n|0}c[l>>2]=c[h>>2];do if(c[m>>2]|0){if((d[c[l>>2]>>0]|0)>=48?(d[c[l>>2]>>0]|0)<=57:0)break;c[g>>2]=2;n=c[g>>2]|0;i=f;return n|0}while(0);c[g>>2]=1;n=c[g>>2]|0;i=f;return n|0}function Wf(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;g=i;i=i+32|0;if((i|0)>=(j|0))U();h=g;k=g+24|0;l=g+20|0;m=g+16|0;n=g+12|0;o=g+8|0;p=g+4|0;c[l>>2]=b;c[m>>2]=e;c[n>>2]=f;if(!(c[n>>2]|0)){c[p>>2]=2;while(1){if(!(c[m>>2]|0))break;a:do switch(d[c[l>>2]>>0]|0|0){case 92:case 39:case 34:case 13:case 12:case 10:case 11:case 9:case 8:{c[p>>2]=(c[p>>2]|0)+2;break}default:{do if((d[c[l>>2]>>0]|0|0)>=32){if((d[c[l>>2]>>0]|0|0)>=127?(d[c[l>>2]>>0]|0|0)<=160:0)break;c[p>>2]=(c[p>>2]|0)+1;break a}while(0);c[p>>2]=(c[p>>2]|0)+4}}while(0);c[m>>2]=(c[m>>2]|0)+-1;c[l>>2]=(c[l>>2]|0)+1}c[k>>2]=c[p>>2];q=c[k>>2]|0;i=g;return q|0}c[o>>2]=c[n>>2];p=c[o>>2]|0;c[o>>2]=p+1;a[p>>0]=34;while(1){if(!(c[m>>2]|0))break;b:do switch(d[c[l>>2]>>0]|0|0){case 8:{p=c[o>>2]|0;c[o>>2]=p+1;a[p>>0]=92;p=c[o>>2]|0;c[o>>2]=p+1;a[p>>0]=98;break}case 9:{p=c[o>>2]|0;c[o>>2]=p+1;a[p>>0]=92;p=c[o>>2]|0;c[o>>2]=p+1;a[p>>0]=116;break}case 11:{p=c[o>>2]|0;c[o>>2]=p+1;a[p>>0]=92;p=c[o>>2]|0;c[o>>2]=p+1;a[p>>0]=118;break}case 10:{p=c[o>>2]|0;c[o>>2]=p+1;a[p>>0]=92;p=c[o>>2]|0;c[o>>2]=p+1;a[p>>0]=110;break}case 12:{p=c[o>>2]|0;c[o>>2]=p+1;a[p>>0]=92;p=c[o>>2]|0;c[o>>2]=p+1;a[p>>0]=102;break}case 13:{p=c[o>>2]|0;c[o>>2]=p+1;a[p>>0]=92;p=c[o>>2]|0;c[o>>2]=p+1;a[p>>0]=114;break}case 34:{p=c[o>>2]|0;c[o>>2]=p+1;a[p>>0]=92;p=c[o>>2]|0;c[o>>2]=p+1;a[p>>0]=34;break}case 39:{p=c[o>>2]|0;c[o>>2]=p+1;a[p>>0]=92;p=c[o>>2]|0;c[o>>2]=p+1;a[p>>0]=39;break}case 92:{p=c[o>>2]|0;c[o>>2]=p+1;a[p>>0]=92;p=c[o>>2]|0;c[o>>2]=p+1;a[p>>0]=92;break}default:{do if((d[c[l>>2]>>0]|0|0)>=32){if((d[c[l>>2]>>0]|0|0)>=127?(d[c[l>>2]>>0]|0|0)<=160:0)break;p=a[c[l>>2]>>0]|0;f=c[o>>2]|0;c[o>>2]=f+1;a[f>>0]=p;break b}while(0);p=c[o>>2]|0;c[h>>2]=d[c[l>>2]>>0];nv(p,22401,h)|0;c[o>>2]=(c[o>>2]|0)+4}}while(0);c[m>>2]=(c[m>>2]|0)+-1;c[l>>2]=(c[l>>2]|0)+1}l=c[o>>2]|0;c[o>>2]=l+1;a[l>>0]=34;c[k>>2]=(c[o>>2]|0)-(c[n>>2]|0);q=c[k>>2]|0;i=g;return q|0}function Xf(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,k=0;e=i;i=i+16|0;if((i|0)>=(j|0))U();f=e+8|0;g=e+4|0;h=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;if(!(c[h>>2]|0)){k=c[g>>2]|0;i=e;return k|0}Ow(c[h>>2]|0,c[f>>2]|0,c[g>>2]|0)|0;k=c[g>>2]|0;i=e;return k|0}function Yf(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;g=i;i=i+32|0;if((i|0)>=(j|0))U();h=g;k=g+16|0;l=g+12|0;m=g+8|0;n=g+4|0;c[k>>2]=b;c[l>>2]=e;c[m>>2]=f;if(!(c[m>>2]|0)){o=c[l>>2]|0;p=o<<1;q=p+2|0;i=g;return q|0}f=c[m>>2]|0;c[m>>2]=f+1;a[f>>0]=35;c[n>>2]=0;while(1){r=c[m>>2]|0;if((c[n>>2]|0)>>>0>=(c[l>>2]|0)>>>0)break;c[h>>2]=d[(c[k>>2]|0)+(c[n>>2]|0)>>0];nv(r,22569,h)|0;c[n>>2]=(c[n>>2]|0)+1;c[m>>2]=(c[m>>2]|0)+2}c[m>>2]=r+1;a[r>>0]=35;o=c[l>>2]|0;p=o<<1;q=p+2|0;i=g;return q|0}
+function Zf(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0;g=i;i=i+192|0;if((i|0)>=(j|0))U();h=g+156|0;k=g+152|0;l=g+148|0;m=g+144|0;n=g+140|0;o=g+136|0;p=g+132|0;q=g+128|0;r=g+48|0;s=g+160|0;t=g+40|0;u=g+36|0;v=g+32|0;w=g+28|0;x=g+24|0;y=g+20|0;z=g+16|0;A=g+12|0;B=g+8|0;C=g+4|0;D=g;c[k>>2]=b;c[l>>2]=d;c[m>>2]=e;c[n>>2]=f;c[v>>2]=43;c[w>>2]=0;f=s;e=f+20|0;do{a[f>>0]=0;f=f+1|0}while((f|0)<(e|0));c[p>>2]=c[m>>2];c[t>>2]=0;while(1){E=a[c[p>>2]>>0]|0;if(!(a[c[p>>2]>>0]|0?(c[t>>2]|0)>>>0<20:0)){F=18;break}if((((((E<<24>>24|0)!=38?(a[c[p>>2]>>0]|0)!=43:0)?(a[c[p>>2]>>0]|0)!=45:0)?(a[c[p>>2]>>0]|0)!=47:0)?(a[c[p>>2]>>0]|0)!=63:0)?(Af(c[p>>2]|0)|0)==0:0){if((a[c[p>>2]>>0]|0)==39){c[p>>2]=(c[p>>2]|0)+1;c[q>>2]=Bv(c[p>>2]|0,39)|0;if(!(c[q>>2]|0)){F=12;break}if((c[q>>2]|0)==(c[p>>2]|0)){F=12;break}c[p>>2]=c[q>>2]}f=c[n>>2]|0;e=(c[f>>2]|0)+(4-1)&~(4-1);d=c[e>>2]|0;c[f>>2]=e+4;c[r+(c[t>>2]<<2)>>2]=d;if(!(c[r+(c[t>>2]<<2)>>2]|0)){F=15;break}c[t>>2]=(c[t>>2]|0)+1}c[p>>2]=(c[p>>2]|0)+1}if((F|0)==12){c[h>>2]=29;G=c[h>>2]|0;i=g;return G|0}else if((F|0)==15){c[h>>2]=128;G=c[h>>2]|0;i=g;return G|0}else if((F|0)==18){if(E<<24>>24){c[h>>2]=183;G=c[h>>2]|0;i=g;return G|0}E=c[n>>2]|0;n=(c[E>>2]|0)+(4-1)&~(4-1);d=c[n>>2]|0;c[E>>2]=n+4;if(d|0){c[h>>2]=45;G=c[h>>2]|0;i=g;return G|0}while(1){if(!(c[l>>2]|0)){F=33;break}if(!(a[c[l>>2]>>0]|0)){F=33;break}c[p>>2]=Bv(c[l>>2]|0,33)|0;if((c[p>>2]|0)==(c[l>>2]|0)){F=25;break}if(c[p>>2]|0)H=(c[p>>2]|0)-(c[l>>2]|0)|0;else H=0;c[x>>2]=H;c[u>>2]=Gf(c[k>>2]|0,c[l>>2]|0,c[x>>2]|0)|0;if(!(c[u>>2]|0)){F=29;break}c[k>>2]=c[u>>2];c[u>>2]=0;Ef(c[w>>2]|0);c[w>>2]=c[k>>2];if(c[x>>2]|0){c[l>>2]=(c[l>>2]|0)+((c[x>>2]|0)+1);continue}else{c[l>>2]=0;continue}}do if((F|0)==25)c[o>>2]=27;else if((F|0)==29)c[o>>2]=27;else if((F|0)==33){c[p>>2]=c[m>>2];c[t>>2]=0;a:while(1){if(!(a[c[p>>2]>>0]|0)){F=76;break}if((((a[c[p>>2]>>0]|0)!=38?(a[c[p>>2]>>0]|0)!=43:0)?(a[c[p>>2]>>0]|0)!=45:0)?(a[c[p>>2]>>0]|0)!=47:0){if((Af(c[p>>2]|0)|0)==0?(a[c[p>>2]>>0]|0)!=63:0){if((a[c[p>>2]>>0]|0)==39){c[p>>2]=(c[p>>2]|0)+1;c[q>>2]=Bv(c[p>>2]|0,39)|0;if(!(c[q>>2]|0)){F=45;break}if((c[q>>2]|0)==(c[p>>2]|0)){F=45;break}c[u>>2]=Gf(c[k>>2]|0,c[p>>2]|0,(c[q>>2]|0)-(c[p>>2]|0)|0)|0;c[p>>2]=c[q>>2]}else c[u>>2]=Gf(c[k>>2]|0,c[p>>2]|0,1)|0;do if(!(c[u>>2]|0)?(a[(c[p>>2]|0)+1>>0]|0)==63:0){l=c[r+(c[t>>2]<<2)>>2]|0;if((c[v>>2]|0)!=38){c[l>>2]=0;break}c[y>>2]=l;if(!(c[(c[y>>2]|0)+12>>2]|0)){c[c[y>>2]>>2]=0;c[(c[y>>2]|0)+4>>2]=0}c[(c[y>>2]|0)+8>>2]=0}else F=55;while(0);if((F|0)==55){F=0;if(!(c[u>>2]|0)){F=56;break}do if((c[v>>2]|0)!=38){if((c[v>>2]|0)==47){l=Of(c[u>>2]|0,1,8)|0;c[c[r+(c[t>>2]<<2)>>2]>>2]=l;break}l=c[u>>2]|0;if((c[v>>2]|0)==45){x=Of(l,1,1)|0;c[c[r+(c[t>>2]<<2)>>2]>>2]=x;break}else{x=Of(l,1,5)|0;c[c[r+(c[t>>2]<<2)>>2]>>2]=x;break}}else{c[z>>2]=c[r+(c[t>>2]<<2)>>2];x=c[u>>2]|0;if(!(c[(c[z>>2]|0)+12>>2]|0)){l=Mf(x,1,c[z>>2]|0)|0;c[(c[z>>2]|0)+12>>2]=l;if(!(c[(c[z>>2]|0)+12>>2]|0)){F=65;break a}c[(c[z>>2]|0)+8>>2]=c[c[z>>2]>>2];c[(c[z>>2]|0)+4>>2]=0;a[s+(c[t>>2]|0)>>0]=2;break}c[A>>2]=Kf(x,1,B)|0;if(!((c[A>>2]|0)!=0&(c[B>>2]|0)!=0)){F=60;break a}if(((c[(c[z>>2]|0)+4>>2]|0)+(c[B>>2]|0)|0)>>>0>(c[c[z>>2]>>2]|0)>>>0){F=62;break a}Ow((c[(c[z>>2]|0)+12>>2]|0)+(c[(c[z>>2]|0)+4>>2]|0)|0,c[A>>2]|0,c[B>>2]|0)|0;c[(c[z>>2]|0)+8>>2]=c[B>>2];a[s+(c[t>>2]|0)>>0]=1}while(0);Ef(c[u>>2]|0);c[u>>2]=0;if(!(c[c[r+(c[t>>2]<<2)>>2]>>2]|0)){F=73;break}}c[t>>2]=(c[t>>2]|0)+1}}else c[v>>2]=a[c[p>>2]>>0];c[p>>2]=(c[p>>2]|0)+1}if((F|0)==45){c[o>>2]=29;break}else if((F|0)==56){c[o>>2]=68;break}else if((F|0)==60){c[o>>2]=65;break}else if((F|0)==62){c[o>>2]=200;break}else if((F|0)==65){c[o>>2]=65;break}else if((F|0)==73){c[o>>2]=65;break}else if((F|0)==76){Ef(c[w>>2]|0);c[h>>2]=0;G=c[h>>2]|0;i=g;return G|0}}while(0);Ef(c[w>>2]|0);Ef(c[u>>2]|0);while(1){u=c[t>>2]|0;c[t>>2]=u+-1;if(!u)break;u=c[t>>2]|0;if(!(a[s+(c[t>>2]|0)>>0]|0)){Gp(c[c[r+(u<<2)>>2]>>2]|0);c[c[r+(c[t>>2]<<2)>>2]>>2]=0;continue}w=c[r+(c[t>>2]<<2)>>2]|0;if((((a[s+u>>0]|0)!=0^1)&1|0)==1){c[C>>2]=w;c[(c[C>>2]|0)+8>>2]=0;continue}else{c[D>>2]=w;hf(c[(c[D>>2]|0)+12>>2]|0);c[(c[D>>2]|0)+12>>2]=0;c[(c[D>>2]|0)+8>>2]=0;c[(c[D>>2]|0)+4>>2]=0;c[c[D>>2]>>2]=0;continue}}c[h>>2]=c[o>>2];G=c[h>>2]|0;i=g;return G|0}return 0}function _f(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,k=0,l=0,m=0;f=i;i=i+32|0;if((i|0)>=(j|0))U();g=f+28|0;h=f+24|0;k=f+20|0;l=f+16|0;m=f;c[g>>2]=a;c[h>>2]=b;c[k>>2]=d;c[m>>2]=e;c[l>>2]=Zf(c[g>>2]|0,c[h>>2]|0,c[k>>2]|0,m)|0;m=$f(c[l>>2]|0)|0;i=f;return m|0}function $f(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b;c[d>>2]=a;a=ag(1,c[d>>2]|0)|0;i=b;return a|0}function ag(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=i;i=i+16|0;if((i|0)>=(j|0))U();e=d+4|0;f=d;c[e>>2]=a;c[f>>2]=b;if(!(c[f>>2]|0)){g=0;i=d;return g|0}g=(c[e>>2]&127)<<24|c[f>>2]&65535;i=d;return g|0}function bg(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,k=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b+8|0;e=b+4|0;f=b;c[e>>2]=a;c[f>>2]=0;while(1){if((c[f>>2]|0)>>>0>=13){g=6;break}a=(pu(c[1116+(c[f>>2]<<3)+4>>2]|0,c[e>>2]|0)|0)!=0;h=c[f>>2]|0;if(!a){g=4;break}c[f>>2]=h+1}if((g|0)==4){c[17628]=c[17628]|c[1116+(h<<3)>>2];c[d>>2]=0;k=c[d>>2]|0;i=b;return k|0}else if((g|0)==6){c[d>>2]=88;k=c[d>>2]|0;i=b;return k|0}return 0}function cg(){return c[17629]|0}function dg(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;d=i;i=i+16|0;if((i|0)>=(j|0))U();e=d+8|0;f=d+4|0;g=d;c[f>>2]=a;c[g>>2]=b;if((c[f>>2]|0)<0|(c[f>>2]|0)>>>0>=13){c[e>>2]=0;h=c[e>>2]|0;i=d;return h|0}if(c[g>>2]|0)c[c[g>>2]>>2]=c[1116+(c[f>>2]<<3)>>2];c[e>>2]=c[1116+(c[f>>2]<<3)+4>>2];h=c[e>>2]|0;i=d;return h|0}function eg(){c[17629]=0;if(Jg()|0)return;fg();c[17629]=c[17629]&~c[17628];return}function fg(){var b=0,d=0,e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0;b=i;i=i+288|0;if((i|0)>=(j|0))U();d=b+20|0;e=b+16|0;f=b+24|0;g=b+12|0;h=b+8|0;k=b+4|0;l=b;c[d>>2]=22746;c[l>>2]=0;c[e>>2]=zv(c[d>>2]|0,23627)|0;if(!(c[e>>2]|0)){i=b;return}while(1){if(!(qv(f,256,c[e>>2]|0)|0))break;c[l>>2]=(c[l>>2]|0)+1;c[g>>2]=f;while(1){if(a[c[g>>2]>>0]&128|0)break;if(!(fv(a[c[g>>2]>>0]|0)|0))break;c[g>>2]=(c[g>>2]|0)+1}c[h>>2]=Bv(c[g>>2]|0,10)|0;if(c[h>>2]|0)a[c[h>>2]>>0]=0;d=c[g>>2]|0;if(a[c[g>>2]>>0]|0)m=(Tu(c[g>>2]|0)|0)-1|0;else m=0;c[h>>2]=d+m;while(1){if((c[h>>2]|0)>>>0<=(c[g>>2]|0)>>>0)break;if((a[c[h>>2]>>0]&128|0)==0?fv(a[c[h>>2]>>0]|0)|0:0)a[c[h>>2]>>0]=0;c[h>>2]=(c[h>>2]|0)+-1}if(!(a[c[g>>2]>>0]|0))continue;if((a[c[g>>2]>>0]|0)==35)continue;c[k>>2]=0;while(1){if((c[k>>2]|0)>>>0>=13)break;d=(pu(c[1116+(c[k>>2]<<3)+4>>2]|0,c[g>>2]|0)|0)!=0;n=c[k>>2]|0;if(!d){o=23;break}c[k>>2]=n+1}if((o|0)==23){o=0;c[17628]=c[17628]|c[1116+(n<<3)>>2]}}Mv(c[e>>2]|0)|0;Ev(c[e>>2]|0)|0;i=b;return}function gg(){c[17630]=1;return}function hg(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,k=0;d=i;i=i+16|0;if((i|0)>=(j|0))U();e=d+8|0;f=d+4|0;g=d;c[f>>2]=b;if(!(c[f>>2]|0)){st(22);c[e>>2]=0;h=c[e>>2]|0;i=d;return h|0}b=c[f>>2]|0;if(!(c[17630]|0)){c[e>>2]=yw(b)|0;h=c[e>>2]|0;i=d;return h|0}k=yw(b+0+5|0)|0;c[g>>2]=k;if(k|0){a[c[g>>2]>>0]=c[f>>2];a[(c[g>>2]|0)+1>>0]=(c[f>>2]|0)>>>8;a[(c[g>>2]|0)+2>>0]=(c[f>>2]|0)>>>16;a[(c[g>>2]|0)+3>>0]=85;a[(c[g>>2]|0)+(4+(c[f>>2]|0))>>0]=-86;c[e>>2]=(c[g>>2]|0)+4;h=c[e>>2]|0;i=d;return h|0}else{c[e>>2]=0;h=c[e>>2]|0;i=d;return h|0}return 0}function ig(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,k=0;d=i;i=i+16|0;if((i|0)>=(j|0))U();e=d+8|0;f=d+4|0;g=d;c[f>>2]=b;if(!(c[f>>2]|0)){st(22);c[e>>2]=0;h=c[e>>2]|0;i=d;return h|0}b=c[f>>2]|0;if(!(c[17630]|0)){c[e>>2]=ug(b)|0;h=c[e>>2]|0;i=d;return h|0}k=ug(b+0+5|0)|0;c[g>>2]=k;if(k|0){a[c[g>>2]>>0]=c[f>>2];a[(c[g>>2]|0)+1>>0]=(c[f>>2]|0)>>>8;a[(c[g>>2]|0)+2>>0]=(c[f>>2]|0)>>>16;a[(c[g>>2]|0)+3>>0]=-52;a[(c[g>>2]|0)+(4+(c[f>>2]|0))>>0]=-86;c[e>>2]=(c[g>>2]|0)+4;h=c[e>>2]|0;i=d;return h|0}else{c[e>>2]=0;h=c[e>>2]|0;i=d;return h|0}return 0}function jg(a,b){a=a|0;b=b|0;var e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0;e=i;i=i+32|0;if((i|0)>=(j|0))U();f=e+20|0;g=e+16|0;h=e+12|0;k=e+8|0;l=e+4|0;m=e;c[g>>2]=a;c[h>>2]=b;b=c[g>>2]|0;if(!(c[17630]|0)){a=(Fg(b)|0)!=0;n=c[g>>2]|0;o=c[h>>2]|0;if(a){c[f>>2]=Eg(n,o)|0;p=c[f>>2]|0;i=e;return p|0}else{c[f>>2]=Bw(n,o)|0;p=c[f>>2]|0;i=e;return p|0}}c[k>>2]=b;if(!(c[g>>2]|0)){c[f>>2]=hg(c[h>>2]|0)|0;p=c[f>>2]|0;i=e;return p|0}kg(c[k>>2]|0);c[m>>2]=d[(c[k>>2]|0)+-4>>0];c[m>>2]=c[m>>2]|(d[(c[k>>2]|0)+-3>>0]|0)<<8;c[m>>2]=c[m>>2]|(d[(c[k>>2]|0)+-2>>0]|0)<<16;if((c[m>>2]|0)>>>0>=(c[h>>2]|0)>>>0){c[f>>2]=c[g>>2];p=c[f>>2]|0;i=e;return p|0}b=c[h>>2]|0;if((d[(c[k>>2]|0)+-1>>0]|0|0)==204)c[l>>2]=ig(b)|0;else c[l>>2]=hg(b)|0;if(c[l>>2]|0){Ow(c[l>>2]|0,c[g>>2]|0,c[m>>2]|0)|0;Sw((c[l>>2]|0)+(c[m>>2]|0)|0,0,(c[h>>2]|0)-(c[m>>2]|0)|0)|0;lg(c[k>>2]|0);c[f>>2]=c[l>>2];p=c[f>>2]|0;i=e;return p|0}else{c[f>>2]=0;p=c[f>>2]|0;i=e;return p|0}return 0}function kg(a){a=a|0;var b=0,e=0,f=0,g=0,h=0,k=0;b=i;i=i+32|0;if((i|0)>=(j|0))U();e=b+8|0;f=b;g=b+24|0;h=b+20|0;k=b+16|0;c[g>>2]=a;if(!(c[17630]|0)){i=b;return}c[h>>2]=c[g>>2];if(!(c[h>>2]|0)){i=b;return}if((d[(c[h>>2]|0)+-1>>0]|0|0)!=85?(d[(c[h>>2]|0)+-1>>0]|0|0)!=204:0){g=d[(c[h>>2]|0)+-1>>0]|0;c[f>>2]=c[h>>2];c[f+4>>2]=g;Je(22767,f)}c[k>>2]=d[(c[h>>2]|0)+-4>>0];c[k>>2]=c[k>>2]|(d[(c[h>>2]|0)+-3>>0]|0)<<8;c[k>>2]=c[k>>2]|(d[(c[h>>2]|0)+-2>>0]|0)<<16;if((d[(c[h>>2]|0)+(c[k>>2]|0)>>0]|0|0)!=170){k=d[(c[h>>2]|0)+-1>>0]|0;c[e>>2]=c[h>>2];c[e+4>>2]=k;Je(22808,e)}else{i=b;return}}function lg(a){a=a|0;var b=0,d=0,e=0,f=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b+4|0;e=b;c[d>>2]=a;c[e>>2]=c[d>>2];if(!(c[e>>2]|0)){i=b;return}if(c[17630]|0){kg(c[e>>2]|0);a=(Fg(c[d>>2]|0)|0)!=0;f=(c[e>>2]|0)+-4|0;if(a){Cg(f);i=b;return}else{zw(f);i=b;return}}else{f=(Fg(c[d>>2]|0)|0)!=0;d=c[e>>2]|0;if(f){Cg(d);i=b;return}else{zw(d);i=b;return}}}function mg(a){a=a|0;var b=0,d=0,e=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b+4|0;e=b;c[d>>2]=a;ut(1220)|0;c[e>>2]=c[17631];c[17632]=c[d>>2]&1;c[17631]=c[d>>2]&2;c[17633]=c[d>>2]&8;c[17634]=c[d>>2]&16;if(!((((c[e>>2]|0)==0|(c[17631]|0)!=0)^1)&(c[17635]|0)!=0)){vt(1220)|0;i=b;return}c[17635]=0;ng();vt(1220)|0;i=b;return}function ng(){var a=0;a=i;i=i+16|0;if((i|0)>=(j|0))U();if(c[17632]|0){i=a;return}Ge(xe(22848)|0,a);i=a;return}function og(){var a=0,b=0;a=i;i=i+16|0;if((i|0)>=(j|0))U();b=a;ut(1220)|0;c[b>>2]=c[17632]|0?1:0;c[b>>2]=c[b>>2]|(c[17631]|0?2:0);c[b>>2]=c[b>>2]|(c[17636]|0?4:0);c[b>>2]=c[b>>2]|(c[17633]|0?8:0);c[b>>2]=c[b>>2]|(c[17634]|0?16:0);vt(1220)|0;i=a;return c[b>>2]|0}function pg(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b;c[d>>2]=a;ut(1220)|0;qg(c[d>>2]|0);vt(1220)|0;i=b;return}function qg(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;b=i;i=i+32|0;if((i|0)>=(j|0))U();d=b+8|0;e=b;f=b+16|0;g=b+12|0;c[f>>2]=a;if(c[f>>2]|0){if((c[f>>2]|0)>>>0<16384)c[f>>2]=16384;if(c[17638]|0){Ie(23080,d);i=b;return}else{rg(c[f>>2]|0);sg(c[17640]|0,c[f>>2]|0);i=b;return}}c[17637]=1;c[g>>2]=Wv()|0;f=c[g>>2]|0;if((f|0)==(_v()|0)){i=b;return}if($v(c[g>>2]|0)|0)Je(22881,e);g=Wv()|0;if((g|0)!=(_v()|0))Je(22881,e);if($v(0)|0){i=b;return}else Je(22881,e)}function rg(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0;b=i;i=i+48|0;if((i|0)>=(j|0))U();d=b+16|0;e=b+8|0;f=b+32|0;g=b+28|0;h=b+24|0;k=b+20|0;c[f>>2]=a;c[17639]=c[f>>2];if(c[17637]|0)Ke(22904,b);c[h>>2]=Oa(30)|0;c[g>>2]=(c[h>>2]|0)!=-1&(c[h>>2]|0)>0?c[h>>2]|0:4096;c[17639]=(c[17639]|0)+(c[g>>2]|0)-1&~((c[g>>2]|0)-1);c[17640]=dw(0,c[17639]|0,3,34,-1,0)|0;if((c[17640]|0)==(-1|0)){g=c[17639]|0;h=xu(c[(fu()|0)>>2]|0)|0;c[e>>2]=g;c[e+4>>2]=h;Ge(22930,e)}else{c[17641]=1;c[17638]=1}if(c[17638]|0){l=c[17640]|0;c[k>>2]=l;m=c[17639]|0;n=c[k>>2]|0;c[n>>2]=m;o=c[k>>2]|0;p=o+4|0;c[p>>2]=0;i=b;return}c[17640]=yw(c[17639]|0)|0;if(!(c[17640]|0)){c[d>>2]=c[17639];Je(22978,d)}c[17638]=1;l=c[17640]|0;c[k>>2]=l;m=c[17639]|0;n=c[k>>2]|0;c[n>>2]=m;o=c[k>>2]|0;p=o+4|0;c[p>>2]=0;i=b;return}function sg(a,b){a=a|0;b=b|0;var d=0;d=i;i=i+16|0;if((i|0)>=(j|0))U();c[d+8>>2]=a;c[d+4>>2]=b;if(c[17633]|0){i=d;return}Ge(23018,d);i=d;return}function tg(){return 0}function ug(a){a=a|0;var b=0,d=0,e=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b+4|0;e=b;c[d>>2]=a;ut(1220)|0;c[e>>2]=vg(c[d>>2]|0)|0;vt(1220)|0;i=b;return c[e>>2]|0}function vg(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,k=0;b=i;i=i+32|0;if((i|0)>=(j|0))U();d=b+8|0;e=b;f=b+20|0;g=b+16|0;h=b+12|0;c[g>>2]=a;if((c[17638]|0)==0?(qg(32768),(c[17638]|0)==0):0){Ge(xe(23126)|0,e);st(12);c[f>>2]=0;k=c[f>>2]|0;i=b;return k|0}if(c[17636]|0?Jg()|0:0){Ge(xe(23187)|0,d);st(12);c[f>>2]=0;k=c[f>>2]|0;i=b;return k|0}if(!((c[17635]|0)==0|(c[17631]|0)!=0)){c[17635]=0;ng()}c[g>>2]=((((c[g>>2]|0)+31|0)>>>0)/32|0)<<5;c[h>>2]=wg(c[17640]|0,c[g>>2]|0)|0;if(c[h>>2]|0)Bg(c[g>>2]|0,0);c[f>>2]=c[h>>2]|0?(c[h>>2]|0)+8|0:0;k=c[f>>2]|0;i=b;return k|0}function wg(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,k=0,l=0;d=i;i=i+16|0;if((i|0)>=(j|0))U();e=d+12|0;f=d+8|0;g=d+4|0;h=d;c[e>>2]=a;c[f>>2]=b;c[g>>2]=c[e>>2];while(1){if(!(xg(c[g>>2]|0)|0))break;if((c[(c[g>>2]|0)+4>>2]&1|0)==0?(c[c[g>>2]>>2]|0)>>>0>=(c[f>>2]|0)>>>0:0){k=5;break}c[g>>2]=Ag(c[g>>2]|0)|0}if((k|0)==5?(k=(c[g>>2]|0)+4|0,c[k>>2]=c[k>>2]|1,((c[c[g>>2]>>2]|0)-(c[f>>2]|0)|0)>>>0>8):0){c[h>>2]=(c[g>>2]|0)+8+(c[f>>2]|0);c[c[h>>2]>>2]=(c[c[g>>2]>>2]|0)-(c[f>>2]|0)-8;c[(c[h>>2]|0)+4>>2]=0;c[c[g>>2]>>2]=c[f>>2];yg(c[h>>2]|0)}if(xg(c[g>>2]|0)|0){l=c[g>>2]|0;i=d;return l|0}st(12);c[g>>2]=0;l=c[g>>2]|0;i=d;return l|0}function xg(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b+8|0;e=b+4|0;f=b;c[d>>2]=a;c[e>>2]=c[d>>2];c[f>>2]=c[17640];if((c[e>>2]|0)>>>0<(c[f>>2]|0)>>>0){g=0;h=g&1;i=b;return h|0}g=(c[e>>2]|0)>>>0<((c[f>>2]|0)+(c[17639]|0)|0)>>>0;h=g&1;i=b;return h|0}function yg(a){a=a|0;var b=0,d=0,e=0,f=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b+8|0;e=b+4|0;f=b;c[d>>2]=a;c[e>>2]=zg(c[d>>2]|0)|0;c[f>>2]=Ag(c[d>>2]|0)|0;if(c[e>>2]|0?(c[(c[e>>2]|0)+4>>2]&1|0)==0:0){a=c[e>>2]|0;c[a>>2]=(c[a>>2]|0)+(8+(c[c[d>>2]>>2]|0));c[d>>2]=c[e>>2]}if(!(c[f>>2]|0)){i=b;return}if(c[(c[f>>2]|0)+4>>2]&1|0){i=b;return}e=c[d>>2]|0;c[e>>2]=(c[e>>2]|0)+(8+(c[c[f>>2]>>2]|0));i=b;return}function zg(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b+8|0;e=b+4|0;f=b;c[d>>2]=a;if((c[d>>2]|0)==(c[17640]|0)){c[e>>2]=0;g=c[e>>2]|0;i=b;return g|0}c[e>>2]=c[17640];while(1){c[f>>2]=Ag(c[e>>2]|0)|0;if((c[f>>2]|0)==(c[d>>2]|0))break;c[e>>2]=c[f>>2]}g=c[e>>2]|0;i=b;return g|0}function Ag(a){a=a|0;var b=0,d=0,e=0,f=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b+4|0;e=b;c[d>>2]=a;c[e>>2]=(c[d>>2]|0)+8+(c[c[d>>2]>>2]|0);if(xg(c[e>>2]|0)|0){f=c[e>>2]|0;i=b;return f|0}c[e>>2]=0;f=c[e>>2]|0;i=b;return f|0}function Bg(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=i;i=i+16|0;if((i|0)>=(j|0))U();e=d+4|0;f=d;c[e>>2]=a;c[f>>2]=b;if(c[e>>2]|0){c[17642]=(c[17642]|0)+(c[e>>2]|0);c[17643]=(c[17643]|0)+1}if(!(c[f>>2]|0)){i=d;return}c[17642]=(c[17642]|0)-(c[f>>2]|0);c[17643]=(c[17643]|0)+-1;i=d;return}function Cg(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b;c[d>>2]=a;ut(1220)|0;Dg(c[d>>2]|0);vt(1220)|0;i=b;return}function Dg(b){b=b|0;var e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,D=0,E=0,F=0;e=i;i=i+96|0;if((i|0)>=(j|0))U();f=e+88|0;g=e+84|0;h=e+80|0;k=e+76|0;l=e+72|0;m=e+95|0;n=e+24|0;o=e+68|0;p=e+64|0;q=e+60|0;r=e+94|0;s=e+16|0;t=e+56|0;u=e+52|0;v=e+48|0;w=e+93|0;x=e+8|0;y=e+44|0;z=e+40|0;A=e+36|0;B=e+92|0;D=e;E=e+32|0;c[f>>2]=b;if(!(c[f>>2]|0)){i=e;return}c[g>>2]=(c[f>>2]|0)+-8;c[h>>2]=c[c[g>>2]>>2];c[k>>2]=(c[g>>2]|0)+8;c[l>>2]=c[h>>2];a[m>>0]=-1;f=n;c[f>>2]=d[m>>0];c[f+4>>2]=0;while(1){if(!(c[k>>2]&7|0?(c[l>>2]|0)!=0:0))break;a[c[k>>2]>>0]=a[m>>0]|0;c[k>>2]=(c[k>>2]|0)+1;c[l>>2]=(c[l>>2]|0)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>>2]=(c[e>>2]|0)+(0-8);c[h>>2]=c[c[g>>2]>>2];if((c[f>>2]|0)>>>0<(c[h>>2]|0)>>>0){c[k>>2]=c[e>>2];vt(1220)|0;l=c[k>>2]|0;i=d;return l|0}c[k>>2]=vg(c[f>>2]|0)|0;if(!(c[k>>2]|0)){vt(1220)|0;l=c[k>>2]|0;i=d;return l|0}Ow(c[k>>2]|0,c[e>>2]|0,c[h>>2]|0)|0;Sw((c[k>>2]|0)+(c[h>>2]|0)|0,0,(c[f>>2]|0)-(c[h>>2]|0)|0)|0;Dg(c[e>>2]|0);vt(1220)|0;l=c[k>>2]|0;i=d;return l|0}function Fg(a){a=a|0;var b=0,d=0,e=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b;c[d>>2]=a;if(c[17638]|0)e=(xg(c[d>>2]|0)|0)!=0;else e=0;i=b;return e&1|0}function Gg(){var b=0,e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,D=0;b=i;i=i+96|0;if((i|0)>=(j|0))U();e=b+76|0;f=b+72|0;g=b+83|0;h=b+24|0;k=b+68|0;l=b+64|0;m=b+60|0;n=b+82|0;o=b+16|0;p=b+56|0;q=b+52|0;r=b+48|0;s=b+81|0;t=b+8|0;u=b+44|0;v=b+40|0;w=b+36|0;x=b+80|0;y=b;z=b+32|0;if(!(c[17638]|0)){i=b;return}c[e>>2]=c[17640];c[f>>2]=c[17639];a[g>>0]=-1;A=h;c[A>>2]=d[g>>0];c[A+4>>2]=0;while(1){if(!(c[e>>2]&7|0?(c[f>>2]|0)!=0:0))break;a[c[e>>2]>>0]=a[g>>0]|0;c[e>>2]=(c[e>>2]|0)+1;c[f>>2]=(c[f>>2]|0)+-1}if((c[f>>2]|0)>>>0>=8){A=h;B=Xw(c[A>>2]|0,c[A+4>>2]|0,16843009,16843009)|0;A=h;c[A>>2]=B;c[A+4>>2]=C;do{c[k>>2]=c[e>>2];A=h;B=c[A+4>>2]|0;D=c[k>>2]|0;c[D>>2]=c[A>>2];c[D+4>>2]=B;c[f>>2]=(c[f>>2]|0)-8;c[e>>2]=(c[e>>2]|0)+8}while((c[f>>2]|0)>>>0>=8)}while(1){if(!(c[f>>2]|0))break;a[c[e>>2]>>0]=a[g>>0]|0;c[e>>2]=(c[e>>2]|0)+1;c[f>>2]=(c[f>>2]|0)+-1}c[l>>2]=c[17640];c[m>>2]=c[17639];a[n>>0]=-86;f=o;c[f>>2]=d[n>>0];c[f+4>>2]=0;while(1){if(!(c[l>>2]&7|0?(c[m>>2]|0)!=0:0))break;a[c[l>>2]>>0]=a[n>>0]|0;c[l>>2]=(c[l>>2]|0)+1;c[m>>2]=(c[m>>2]|0)+-1}if((c[m>>2]|0)>>>0>=8){f=o;e=Xw(c[f>>2]|0,c[f+4>>2]|0,16843009,16843009)|0;f=o;c[f>>2]=e;c[f+4>>2]=C;do{c[p>>2]=c[l>>2];f=o;e=c[f+4>>2]|0;g=c[p>>2]|0;c[g>>2]=c[f>>2];c[g+4>>2]=e;c[m>>2]=(c[m>>2]|0)-8;c[l>>2]=(c[l>>2]|0)+8}while((c[m>>2]|0)>>>0>=8)}while(1){if(!(c[m>>2]|0))break;a[c[l>>2]>>0]=a[n>>0]|0;c[l>>2]=(c[l>>2]|0)+1;c[m>>2]=(c[m>>2]|0)+-1}c[q>>2]=c[17640];c[r>>2]=c[17639];a[s>>0]=85;m=t;c[m>>2]=d[s>>0];c[m+4>>2]=0;while(1){if(!(c[q>>2]&7|0?(c[r>>2]|0)!=0:0))break;a[c[q>>2]>>0]=a[s>>0]|0;c[q>>2]=(c[q>>2]|0)+1;c[r>>2]=(c[r>>2]|0)+-1}if((c[r>>2]|0)>>>0>=8){m=t;l=Xw(c[m>>2]|0,c[m+4>>2]|0,16843009,16843009)|0;m=t;c[m>>2]=l;c[m+4>>2]=C;do{c[u>>2]=c[q>>2];m=t;l=c[m+4>>2]|0;n=c[u>>2]|0;c[n>>2]=c[m>>2];c[n+4>>2]=l;c[r>>2]=(c[r>>2]|0)-8;c[q>>2]=(c[q>>2]|0)+8}while((c[r>>2]|0)>>>0>=8)}while(1){if(!(c[r>>2]|0))break;a[c[q>>2]>>0]=a[s>>0]|0;c[q>>2]=(c[q>>2]|0)+1;c[r>>2]=(c[r>>2]|0)+-1}c[v>>2]=c[17640];c[w>>2]=c[17639];a[x>>0]=0;r=y;c[r>>2]=d[x>>0];c[r+4>>2]=0;while(1){if(!(c[v>>2]&7|0?(c[w>>2]|0)!=0:0))break;a[c[v>>2]>>0]=a[x>>0]|0;c[v>>2]=(c[v>>2]|0)+1;c[w>>2]=(c[w>>2]|0)+-1}if((c[w>>2]|0)>>>0>=8){r=y;q=Xw(c[r>>2]|0,c[r+4>>2]|0,16843009,16843009)|0;r=y;c[r>>2]=q;c[r+4>>2]=C;do{c[z>>2]=c[v>>2];r=y;q=c[r+4>>2]|0;s=c[z>>2]|0;c[s>>2]=c[r>>2];c[s+4>>2]=q;c[w>>2]=(c[w>>2]|0)-8;c[v>>2]=(c[v>>2]|0)+8}while((c[w>>2]|0)>>>0>=8)}while(1){if(!(c[w>>2]|0))break;a[c[v>>2]>>0]=a[x>>0]|0;c[v>>2]=(c[v>>2]|0)+1;c[w>>2]=(c[w>>2]|0)+-1}if(c[17641]|0)gw(c[17640]|0,c[17639]|0)|0;c[17640]=0;c[17638]=0;c[17639]=0;c[17636]=0;i=b;return}function Hg(){var a=0,b=0,d=0,e=0;a=i;i=i+16|0;if((i|0)>=(j|0))U();b=a;ut(1220)|0;if(!(c[17638]|0)){vt(1220)|0;i=a;return}d=c[17639]|0;e=c[17643]|0;c[b>>2]=c[17642];c[b+4>>2]=d;c[b+8>>2]=e;Ge(23240,b);vt(1220)|0;i=a;return}function Ig(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0;b=i;i=i+544|0;if((i|0)>=(j|0))U();d=b+8|0;e=b;f=b+28|0;g=b+24|0;h=b+20|0;k=b+16|0;l=b+288|0;m=b+12|0;n=b+32|0;c[f>>2]=a;if(c[17644]|0){if(Jg()|0){Kg(5);Og()}if(c[17644]|0)Fe(23509,23515,114,23522)}c[17644]=1;do if(c[f>>2]|0){if(c[17645]|0)Fe(23549,23515,121,23522)}else{if(!(Lv(23572,0)|0)){if(!(c[17645]|0))break;Fe(23549,23515,132,23522)}c[h>>2]=zv(23597,23627)|0;if(!(c[h>>2]|0)){a=c[(fu()|0)>>2]|0;c[k>>2]=a;if((a|0)!=2&(c[k>>2]|0)!=13?(Lv(23629,0)|0)==0:0){a=xu(c[k>>2]|0)|0;c[e>>2]=23597;c[e+4>>2]=a;Ge(23643,e);fb()}}else{if(qv(l,256,c[h>>2]|0)|0?mw(l)|0:0){Ev(c[h>>2]|0)|0;if(!(c[17645]|0))break;Fe(23549,23515,151,23522)}Ev(c[h>>2]|0)|0}c[17645]=1}while(0);if(c[17645]|0){i=b;return}c[g>>2]=tt(1264)|0;if(c[g>>2]|0){c[d>>2]=ot(c[g>>2]|0)|0;Ge(23687,d);fb()}c[m>>2]=zv(23572,23627)|0;if(c[m>>2]|0){if(qv(n,256,c[m>>2]|0)|0?mw(n)|0:0)c[17647]=1;Ev(c[m>>2]|0)|0}Kg(1);i=b;return}function Jg(){return ((c[17645]|0)!=0^1)&1|0}function Kg(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;b=i;i=i+32|0;if((i|0)>=(j|0))U();d=b;e=b+20|0;f=b+16|0;g=b+12|0;c[e>>2]=a;c[f>>2]=0;Lg();c[g>>2]=c[17646];switch(c[17646]|0){case 0:{if((c[e>>2]|0)==1|(c[e>>2]|0)==4|(c[e>>2]|0)==5)c[f>>2]=1;break}case 1:{if((c[e>>2]|0)==2|(c[e>>2]|0)==4|(c[e>>2]|0)==5)c[f>>2]=1;break}case 2:{if((c[e>>2]|0)==3|(c[e>>2]|0)==4|(c[e>>2]|0)==5)c[f>>2]=1;break}case 3:{if((c[e>>2]|0)==6|(c[e>>2]|0)==2|(c[e>>2]|0)==4|(c[e>>2]|0)==5)c[f>>2]=1;break}case 4:{if((c[e>>2]|0)==6|(c[e>>2]|0)==4|(c[e>>2]|0)==5|(c[e>>2]|0)==2)c[f>>2]=1;break}case 5:{if((c[e>>2]|0)==6)c[f>>2]=1;break}default:{}}if(c[f>>2]|0)c[17646]=c[e>>2];Mg();if(!(c[f>>2]|0?!(Be(2)|0):0)){a=Ng(c[g>>2]|0)|0;g=Ng(c[e>>2]|0)|0;e=c[f>>2]|0?23454:23462;c[d>>2]=a;c[d+4>>2]=g;c[d+8>>2]=e;Ge(23469,d)}if(c[f>>2]|0){i=b;return}else{Og();i=b;return}}function Lg(){var a=0,b=0,d=0;a=i;i=i+16|0;if((i|0)>=(j|0))U();b=a;d=a+4|0;c[d>>2]=ut(1264)|0;if(c[d>>2]|0){c[b>>2]=ot(c[d>>2]|0)|0;Ge(23281,b);fb()}else{i=a;return}}function Mg(){var a=0,b=0,d=0;a=i;i=i+16|0;if((i|0)>=(j|0))U();b=a;d=a+4|0;c[d>>2]=vt(1264)|0;if(c[d>>2]|0){c[b>>2]=ot(c[d>>2]|0)|0;Ge(23336,b);fb()}else{i=a;return}}function Ng(a){a=a|0;var b=0,d=0,e=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b+4|0;e=b;c[d>>2]=a;switch(c[d>>2]|0){case 0:{c[e>>2]=23391;break}case 1:{c[e>>2]=23400;break}case 2:{c[e>>2]=23405;break}case 3:{c[e>>2]=23415;break}case 4:{c[e>>2]=23427;break}case 5:{c[e>>2]=23433;break}case 6:{c[e>>2]=23445;break}default:c[e>>2]=37750}i=b;return c[e>>2]|0}function Og(){Fv(0)|0;fb()}function Pg(){var a=0,b=0;a=i;i=i+16|0;if((i|0)>=(j|0))U();b=a;if(Jg()|0)c[b>>2]=c[17647];else c[b>>2]=0;i=a;return c[b>>2]|0}function Qg(){c[17647]=1;return}function Rg(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b;c[d>>2]=a;if(!(Jg()|0))Fe(23742,23515,295,23761);if(Pg()|0){Sg(23515,300,23761,0,c[d>>2]|0);i=b;return}Lg();if(c[17648]|0){Mg();i=b;return}else{c[17648]=1;Mg();i=b;return}}function Sg(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,k=0,l=0,m=0,n=0,o=0;g=i;i=i+48|0;if((i|0)>=(j|0))U();h=g;k=g+40|0;l=g+36|0;m=g+32|0;n=g+28|0;o=g+24|0;c[k>>2]=a;c[l>>2]=b;c[m>>2]=d;c[n>>2]=e;c[o>>2]=f;if(!(Jg()|0)){i=g;return}Kg(c[n>>2]|0?5:4);f=c[k>>2]|0;k=c[l>>2]|0;l=c[m>>2]|0?23795:76084;e=c[m>>2]|0?c[m>>2]|0:76084;m=c[o>>2]|0?c[o>>2]|0:23807;c[h>>2]=c[n>>2]|0?23788:76084;c[h+4>>2]=f;c[h+8>>2]=k;c[h+12>>2]=l;c[h+16>>2]=e;c[h+20>>2]=m;Ge(23832,h);i=g;return}function Tg(){var a=0,b=0,d=0,e=0;a=i;i=i+16|0;if((i|0)>=(j|0))U();b=a+4|0;d=a;if(Jg()|0){Lg();c[d>>2]=c[17648];Mg();c[b>>2]=c[d>>2];e=c[b>>2]|0;i=a;return e|0}else{c[b>>2]=0;e=c[b>>2]|0;i=a;return e|0}return 0}function Ug(){var a=0,b=0,d=0;a=i;i=i+16|0;if((i|0)>=(j|0))U();b=a;if(!(Jg()|0)){c[b>>2]=1;d=c[b>>2]|0;i=a;return d|0}Lg();if((c[17646]|0)==1){Mg();Vg(0)|0;Lg()}c[b>>2]=(c[17646]|0)==3&1;Mg();d=c[b>>2]|0;i=a;return d|0}function Vg(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b+8|0;e=b+4|0;f=b;c[d>>2]=a;c[e>>2]=4;c[f>>2]=50;if(Jg()|0)Kg(2);if((((((Wg(c[d>>2]|0)|0)==0?(Yg(c[d>>2]|0)|0)==0:0)?(Zg(c[d>>2]|0)|0)==0:0)?(_g()|0)==0:0)?($g(c[d>>2]|0)|0)==0:0)?(ah()|0)==0:0){c[e>>2]=3;c[f>>2]=0}if(!(Jg()|0)){g=c[f>>2]|0;i=b;return g|0}Kg(c[e>>2]|0);g=c[f>>2]|0;i=b;return g|0}function Wg(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b+12|0;e=b+8|0;f=b+4|0;g=b;c[d>>2]=a;c[g>>2]=0;c[e>>2]=0;while(1){if(!(c[1308+(c[e>>2]<<2)>>2]|0))break;c[f>>2]=Bh(c[1308+(c[e>>2]<<2)>>2]|0,c[d>>2]|0,1)|0;a=c[1308+(c[e>>2]<<2)>>2]|0;if(c[f>>2]|0)h=ot(c[f>>2]|0)|0;else h=0;Xg(38451,a,0,h);if(c[f>>2]|0)c[g>>2]=1;c[e>>2]=(c[e>>2]|0)+1}i=b;return c[g>>2]|0}function Xg(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,k=0,l=0,m=0,n=0;f=i;i=i+48|0;if((i|0)>=(j|0))U();g=f;h=f+44|0;k=f+40|0;l=f+36|0;m=f+32|0;c[h>>2]=a;c[k>>2]=b;c[l>>2]=d;c[m>>2]=e;if((c[m>>2]|0)==0?(Be(2)|0)==0:0){i=f;return}e=(pu(c[h>>2]|0,36136)|0)!=0;d=e?c[h>>2]|0:42986;e=(pu(c[h>>2]|0,36136)|0)!=0^1;b=e?23880:76084;do if(pu(c[h>>2]|0,38451)|0){if(!(pu(c[h>>2]|0,42986)|0)){n=Ci(c[k>>2]|0)|0;break}if(!(pu(c[h>>2]|0,36136)|0)){n=Ci(c[k>>2]|0)|0;break}if(pu(c[h>>2]|0,49653)|0)n=76084;else n=Dj(c[k>>2]|0)|0}else n=gh(c[k>>2]|0)|0;while(0);h=c[k>>2]|0;k=c[m>>2]|0?c[m>>2]|0:23886;m=c[l>>2]|0?23891:76084;e=c[l>>2]|0?c[l>>2]|0:76084;a=c[l>>2]|0?49707:76084;c[g>>2]=d;c[g+4>>2]=b;c[g+8>>2]=n;c[g+12>>2]=h;c[g+16>>2]=k;c[g+20>>2]=m;c[g+24>>2]=e;c[g+28>>2]=a;Ge(23894,g);i=f;return}function Yg(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b+12|0;e=b+8|0;f=b+4|0;g=b;c[d>>2]=a;c[g>>2]=0;c[e>>2]=0;while(1){if(!(c[1328+(c[e>>2]<<2)>>2]|0))break;c[f>>2]=fj(c[1328+(c[e>>2]<<2)>>2]|0,c[d>>2]|0,1)|0;a=c[1328+(c[e>>2]<<2)>>2]|0;if(c[f>>2]|0)h=ot(c[f>>2]|0)|0;else h=0;Xg(42986,a,0,h);if(c[f>>2]|0)c[g>>2]=1;c[e>>2]=(c[e>>2]|0)+1}i=b;return c[g>>2]|0}function Zg(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b+12|0;e=b+8|0;f=b+4|0;g=b;c[d>>2]=a;c[g>>2]=0;c[e>>2]=0;while(1){if(!(c[1352+(c[e>>2]<<2)>>2]|0))break;c[f>>2]=oi(c[1352+(c[e>>2]<<2)>>2]|0,c[d>>2]|0,1)|0;a=c[1352+(c[e>>2]<<2)>>2]|0;if(c[f>>2]|0)h=ot(c[f>>2]|0)|0;else h=0;Xg(36136,a,0,h);if(c[f>>2]|0)c[g>>2]=1;c[e>>2]=(c[e>>2]|0)+1}i=b;return c[g>>2]|0}function _g(){var a=0,b=0,d=0;a=i;i=i+16|0;if((i|0)>=(j|0))U();b=a;c[b>>2]=an(1)|0;if(c[b>>2]|0)d=ot(c[b>>2]|0)|0;else d=0;Xg(52417,0,0,d);i=a;return ((c[b>>2]|0)!=0^1^1)&1|0}function $g(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b+12|0;e=b+8|0;f=b+4|0;g=b;c[d>>2]=a;c[g>>2]=0;c[e>>2]=0;while(1){if(!(c[1376+(c[e>>2]<<2)>>2]|0))break;c[f>>2]=Oj(c[1376+(c[e>>2]<<2)>>2]|0,c[d>>2]|0,1)|0;a=c[1376+(c[e>>2]<<2)>>2]|0;if(c[f>>2]|0)h=ot(c[f>>2]|0)|0;else h=0;Xg(49653,a,0,h);if(c[f>>2]|0)c[g>>2]=1;c[e>>2]=(c[e>>2]|0)+1}i=b;return c[g>>2]|0}function ah(){return 0}function bh(){var a=0,b=0;a=i;i=i+16|0;if((i|0)>=(j|0))U();b=a;if(Jg()|0){Lg();c[b>>2]=(c[17646]|0)==3&1;Mg()}else c[b>>2]=1;i=a;return c[b>>2]|0}function ch(){var a=0,b=0,d=0;a=i;i=i+16|0;if((i|0)>=(j|0))U();b=a;if(Jg()|0){Lg();c[b>>2]=((c[17646]|0)==3?1:(c[17646]|0)==4)&1;Mg();d=c[b>>2]|0;i=a;return d|0}else{c[b>>2]=1;d=c[b>>2]|0;i=a;return d|0}return 0}function dh(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0;f=i;i=i+32|0;if((i|0)>=(j|0))U();g=f;h=f+20|0;k=f+16|0;l=f+12|0;m=f+8|0;n=f+4|0;c[k>>2]=b;c[l>>2]=d;c[m>>2]=e;if((c[k>>2]|0)!=1){c[g>>2]=c[k>>2];Ke(23938,g)}if((c[l>>2]|0)>>>0<8)c[l>>2]=8;c[n>>2]=jf(1,8+(c[l>>2]|0)|0)|0;if(c[n>>2]|0){l=c[n>>2]|0;a[l>>0]=a[23984]|0;a[l+1>>0]=a[23985]|0;a[l+2>>0]=a[23986]|0;a[(c[n>>2]|0)+3>>0]=c[k>>2];c[(c[n>>2]|0)+4>>2]=c[m>>2];c[h>>2]=c[n>>2];o=c[h>>2]|0;i=f;return o|0}else{c[h>>2]=0;o=c[h>>2]|0;i=f;return o|0}return 0}function eh(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,k=0,l=0;e=i;i=i+32|0;if((i|0)>=(j|0))U();f=e+8|0;g=e;h=e+24|0;k=e+20|0;c[h>>2]=b;c[k>>2]=d;if(!(c[h>>2]|0)){l=c[h>>2]|0;c[g>>2]=l;Je(23988,g)}if(vv(c[h>>2]|0,23984,3)|0){l=c[h>>2]|0;c[g>>2]=l;Je(23988,g)}if((a[(c[h>>2]|0)+3>>0]|0)!=(c[k>>2]|0)){g=c[h>>2]|0;l=a[(c[h>>2]|0)+3>>0]|0;c[f>>2]=c[k>>2];c[f+4>>2]=g;c[f+8>>2]=l;Je(24036,f)}else{i=e;return (c[h>>2]|0)+8|0}return 0}function fh(b){b=b|0;var d=0,e=0,f=0,g=0,h=0;d=i;i=i+16|0;if((i|0)>=(j|0))U();e=d+8|0;f=d;g=d+12|0;c[g>>2]=b;if(!(c[g>>2]|0)){i=d;return}b=(vv(c[g>>2]|0,23984,3)|0)!=0;h=c[g>>2]|0;if(b){c[f>>2]=h;Je(24093,f)}f=c[g>>2]|0;if((a[h+3>>0]|0)!=1){c[e>>2]=a[f+3>>0];Je(24135,e)}if(c[f+4>>2]|0)ub[c[(c[g>>2]|0)+4>>2]&15]((c[g>>2]|0)+8|0);hf(c[g>>2]|0);i=d;return}function gh(a){a=a|0;var b=0,d=0,e=0,f=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b+4|0;e=b;c[d>>2]=a;c[e>>2]=hh(c[d>>2]|0)|0;if(!(c[e>>2]|0)){f=37750;i=b;return f|0}f=c[(c[e>>2]|0)+8>>2]|0;i=b;return f|0}function hh(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,k=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b+12|0;e=b+8|0;f=b+4|0;g=b;c[e>>2]=a;c[e>>2]=ih(c[e>>2]|0)|0;c[f>>2]=0;while(1){a=c[1388+(c[f>>2]<<2)>>2]|0;c[g>>2]=a;if(!a){h=6;break}if((c[e>>2]|0)==(c[c[g>>2]>>2]|0)){h=4;break}c[f>>2]=(c[f>>2]|0)+1}if((h|0)==4){c[d>>2]=c[g>>2];k=c[d>>2]|0;i=b;return k|0}else if((h|0)==6){c[d>>2]=0;k=c[d>>2]|0;i=b;return k|0}return 0}function ih(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b;c[d>>2]=a;i=b;return c[d>>2]|0}function jh(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,k=0,l=0,m=0,n=0;f=i;i=i+32|0;if((i|0)>=(j|0))U();g=f+20|0;h=f+16|0;k=f+12|0;l=f+8|0;m=f+4|0;n=f;c[g>>2]=a;c[h>>2]=b;c[k>>2]=d;c[l>>2]=e;c[n>>2]=0;if((c[k>>2]|0)>=65536)c[m>>2]=71;else c[m>>2]=kh(n,c[h>>2]|0,c[k>>2]|0,c[l>>2]|0)|0;c[c[g>>2]>>2]=c[m>>2]|0?0:c[n>>2]|0;i=f;return c[m>>2]|0}function kh(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0;g=i;i=i+48|0;if((i|0)>=(j|0))U();h=g+36|0;k=g+32|0;l=g+28|0;m=g+24|0;n=g+20|0;o=g+16|0;p=g+12|0;q=g+8|0;r=g+4|0;s=g;c[h>>2]=b;c[k>>2]=d;c[l>>2]=e;c[m>>2]=f;c[n>>2]=c[m>>2]&1;c[p>>2]=0;_m();c[o>>2]=hh(c[k>>2]|0)|0;do if(c[o>>2]|0)if(a[(c[o>>2]|0)+4>>0]&1|0){c[q>>2]=12;break}else{c[q>>2]=0;break}else c[q>>2]=12;while(0);do if(!(c[q>>2]|0)){if((c[m>>2]&-16|0)==0?(c[m>>2]&0|0)==0:0)break;c[q>>2]=12}while(0);a:do if(!(c[q>>2]|0)){f=c[l>>2]|0;b:do if((f|0)<6)switch(f|0){case 5:case 2:case 3:case 1:{break b;break}case 4:{if(c[(c[o>>2]|0)+44>>2]|0?c[(c[o>>2]|0)+48>>2]|0:0)break a;c[q>>2]=71;break a;break}case 0:{if((Jg()|0)==0?sf(0)|0:0)break a;c[q>>2]=71;break a;break}default:{t=37;break b}}else{if((f|0)<9){switch(f|0){case 7:case 6:{break b;break}case 8:break;default:{t=37;break b}}if((c[(c[o>>2]|0)+20>>2]|0)!=16)c[q>>2]=71;if(c[(c[o>>2]|0)+36>>2]|0?c[(c[o>>2]|0)+40>>2]|0:0)break a;c[q>>2]=71;break a}if((f|0)<11){switch(f|0){case 9:{break b;break}case 10:break;default:{t=37;break b}}if((c[(c[o>>2]|0)+44>>2]|0?c[(c[o>>2]|0)+48>>2]|0:0)?c[(c[o>>2]|0)+60>>2]|0:0){if((c[c[o>>2]>>2]|0)==316)break a;c[q>>2]=71;break a}c[q>>2]=71;break a}if((f|0)>=65537)switch(f|0){case 65537:{break b;break}default:{t=37;break b}}switch(f|0){case 11:break;default:{t=37;break b}}if(c[(c[o>>2]|0)+36>>2]|0?c[(c[o>>2]|0)+40>>2]|0:0){if((c[(c[o>>2]|0)+20>>2]|0)==16)break a;c[q>>2]=71;break a}c[q>>2]=71;break a}while(0);if((t|0)==37){c[q>>2]=71;break}if(c[(c[o>>2]|0)+36>>2]|0?c[(c[o>>2]|0)+40>>2]|0:0)break;c[q>>2]=71}while(0);if(c[q>>2]|0){u=c[q>>2]|0;v=(u|0)!=0;w=c[p>>2]|0;x=v?0:w;y=c[h>>2]|0;c[y>>2]=x;z=c[q>>2]|0;A=lh(z)|0;i=g;return A|0}c[r>>2]=512+(c[(c[o>>2]|0)+28>>2]<<1)-16+15;t=c[r>>2]|0;if(c[n>>2]|0)c[p>>2]=kf(1,t)|0;else c[p>>2]=jf(1,t)|0;if(!(c[p>>2]|0)){c[q>>2]=rt()|0;u=c[q>>2]|0;v=(u|0)!=0;w=c[p>>2]|0;x=v?0:w;y=c[h>>2]|0;c[y>>2]=x;z=c[q>>2]|0;A=lh(z)|0;i=g;return A|0}c[s>>2]=0;if(c[p>>2]&15|0){c[s>>2]=16-(c[p>>2]&15);c[p>>2]=(c[p>>2]|0)+(c[s>>2]|0)}c[c[p>>2]>>2]=c[n>>2]|0?1183944770:604576100;c[(c[p>>2]|0)+4>>2]=(c[r>>2]|0)-(c[s>>2]|0);c[(c[p>>2]|0)+8>>2]=c[s>>2];c[(c[p>>2]|0)+12>>2]=c[o>>2];c[(c[p>>2]|0)+16>>2]=c[k>>2];c[(c[p>>2]|0)+48>>2]=c[l>>2];c[(c[p>>2]|0)+52>>2]=c[m>>2];switch(c[k>>2]|0){case 9:case 8:case 7:{c[(c[p>>2]|0)+20>>2]=1;c[(c[p>>2]|0)+20+4>>2]=2;c[(c[p>>2]|0)+20+8>>2]=1;c[(c[p>>2]|0)+20+12>>2]=3;c[(c[p>>2]|0)+20+16>>2]=4;c[(c[p>>2]|0)+20+20>>2]=5;c[(c[p>>2]|0)+20+24>>2]=2;break}case 303:case 10:{c[(c[p>>2]|0)+20+12>>2]=6;c[(c[p>>2]|0)+20+4>>2]=7;c[(c[p>>2]|0)+20+16>>2]=8;break}default:{}}if((c[l>>2]|0)!=11){u=c[q>>2]|0;v=(u|0)!=0;w=c[p>>2]|0;x=v?0:w;y=c[h>>2]|0;c[y>>2]=x;z=c[q>>2]|0;A=lh(z)|0;i=g;return A|0}a[(c[p>>2]|0)+128+352>>0]=16;u=c[q>>2]|0;v=(u|0)!=0;w=c[p>>2]|0;x=v?0:w;y=c[h>>2]|0;c[y>>2]=x;z=c[q>>2]|0;A=lh(z)|0;i=g;return A|0}function lh(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b;c[d>>2]=a;a=mh(32,c[d>>2]|0)|0;i=b;return a|0}function mh(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=i;i=i+16|0;if((i|0)>=(j|0))U();e=d+4|0;f=d;c[e>>2]=a;c[f>>2]=b;b=nh(c[e>>2]|0,c[f>>2]|0)|0;i=d;return b|0}function nh(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=i;i=i+16|0;if((i|0)>=(j|0))U();e=d+4|0;f=d;c[e>>2]=a;c[f>>2]=b;if(!(c[f>>2]|0)){g=0;i=d;return g|0}g=(c[e>>2]&127)<<24|c[f>>2]&65535;i=d;return g|0}function oh(b){b=b|0;var e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0;e=i;i=i+32|0;if((i|0)>=(j|0))U();f=e+24|0;g=e+20|0;h=e+16|0;k=e+12|0;l=e+28|0;m=e;n=e+8|0;c[f>>2]=b;if(!(c[f>>2]|0)){i=e;return}if((c[c[f>>2]>>2]|0)!=1183944770?(c[c[f>>2]>>2]|0)!=604576100:0)ye(63,24184);c[c[f>>2]>>2]=0;c[g>>2]=c[(c[f>>2]|0)+8>>2];c[h>>2]=c[f>>2];c[k>>2]=c[(c[f>>2]|0)+4>>2];a[l>>0]=0;b=m;c[b>>2]=d[l>>0];c[b+4>>2]=0;while(1){if(!(c[h>>2]&7|0?(c[k>>2]|0)!=0:0))break;a[c[h>>2]>>0]=a[l>>0]|0;c[h>>2]=(c[h>>2]|0)+1;c[k>>2]=(c[k>>2]|0)+-1}if((c[k>>2]|0)>>>0>=8){b=m;o=Xw(c[b>>2]|0,c[b+4>>2]|0,16843009,16843009)|0;b=m;c[b>>2]=o;c[b+4>>2]=C;do{c[n>>2]=c[h>>2];b=m;o=c[b+4>>2]|0;p=c[n>>2]|0;c[p>>2]=c[b>>2];c[p+4>>2]=o;c[k>>2]=(c[k>>2]|0)-8;c[h>>2]=(c[h>>2]|0)+8}while((c[k>>2]|0)>>>0>=8)}while(1){if(!(c[k>>2]|0))break;a[c[h>>2]>>0]=a[l>>0]|0;c[h>>2]=(c[h>>2]|0)+1;c[k>>2]=(c[k>>2]|0)+-1}hf((c[f>>2]|0)+(0-(c[g>>2]|0))|0);i=e;return}function ph(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0;g=i;i=i+32|0;if((i|0)>=(j|0))U();h=g+20|0;k=g+16|0;l=g+12|0;m=g+8|0;n=g+4|0;o=g;c[h>>2]=a;c[k>>2]=b;c[l>>2]=d;c[m>>2]=e;c[n>>2]=f;if(!(c[m>>2]|0)){c[m>>2]=c[k>>2];c[n>>2]=c[l>>2]}c[o>>2]=qh(c[h>>2]|0,c[k>>2]|0,c[l>>2]|0,c[m>>2]|0,c[n>>2]|0)|0;if(!((c[o>>2]|0)!=0&(c[k>>2]|0)!=0)){p=c[o>>2]|0;i=g;return p|0}Sw(c[k>>2]|0,66,c[l>>2]|0)|0;p=c[o>>2]|0;i=g;return p|0}function qh(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;g=i;i=i+32|0;if((i|0)>=(j|0))U();h=g;k=g+24|0;l=g+20|0;m=g+16|0;n=g+12|0;o=g+8|0;p=g+4|0;c[k>>2]=a;c[l>>2]=b;c[m>>2]=d;c[n>>2]=e;c[o>>2]=f;f=c[(c[k>>2]|0)+48>>2]|0;a:do if((f|0)>=6){if((f|0)<9)switch(f|0){case 6:{c[p>>2]=lq(c[k>>2]|0,c[l>>2]|0,c[m>>2]|0,c[n>>2]|0,c[o>>2]|0)|0;break a;break}case 7:{c[p>>2]=Sp(c[k>>2]|0,c[l>>2]|0,c[m>>2]|0,c[n>>2]|0,c[o>>2]|0)|0;break a;break}case 8:{c[p>>2]=bq(c[k>>2]|0,c[l>>2]|0,c[m>>2]|0,c[n>>2]|0,c[o>>2]|0)|0;break a;break}default:{q=c[k>>2]|0;r=q+48|0;s=c[r>>2]|0;c[h>>2]=s;Je(24279,h)}}if((f|0)<11)switch(f|0){case 9:{c[p>>2]=oq(c[k>>2]|0,c[l>>2]|0,c[m>>2]|0,c[n>>2]|0,c[o>>2]|0)|0;break a;break}case 10:{c[p>>2]=ar(c[k>>2]|0,c[l>>2]|0,c[m>>2]|0,c[n>>2]|0,c[o>>2]|0)|0;break a;break}default:{q=c[k>>2]|0;r=q+48|0;s=c[r>>2]|0;c[h>>2]=s;Je(24279,h)}}if((f|0)<65537)switch(f|0){case 11:{c[p>>2]=Tq(c[k>>2]|0,c[l>>2]|0,c[m>>2]|0,c[n>>2]|0,c[o>>2]|0)|0;break a;break}default:{q=c[k>>2]|0;r=q+48|0;s=c[r>>2]|0;c[h>>2]=s;Je(24279,h)}}else switch(f|0){case 65537:{c[p>>2]=71;break a;break}default:{q=c[k>>2]|0;r=q+48|0;s=c[r>>2]|0;c[h>>2]=s;Je(24279,h)}}}else switch(f|0){case 1:{c[p>>2]=rh(c[k>>2]|0,c[l>>2]|0,c[m>>2]|0,c[n>>2]|0,c[o>>2]|0)|0;break a;break}case 3:{c[p>>2]=Vp(c[k>>2]|0,c[l>>2]|0,c[m>>2]|0,c[n>>2]|0,c[o>>2]|0)|0;break a;break}case 2:{c[p>>2]=dq(c[k>>2]|0,c[l>>2]|0,c[m>>2]|0,c[n>>2]|0,c[o>>2]|0)|0;break a;break}case 5:{c[p>>2]=Xq(c[k>>2]|0,c[l>>2]|0,c[m>>2]|0,c[n>>2]|0,c[o>>2]|0)|0;break a;break}case 4:{Cb[c[(c[(c[k>>2]|0)+12>>2]|0)+44>>2]&1]((c[k>>2]|0)+496|0,c[l>>2]|0,c[n>>2]|0,c[o>>2]|0);c[p>>2]=0;break a;break}case 0:{if((Jg()|0)==0?sf(0)|0:0){if((c[n>>2]|0)!=(c[l>>2]|0))Qw(c[l>>2]|0,c[n>>2]|0,c[o>>2]|0)|0;c[p>>2]=0;break a}Sg(24233,875,24242,0,24257);c[p>>2]=71;break a;break}default:{q=c[k>>2]|0;r=q+48|0;s=c[r>>2]|0;c[h>>2]=s;Je(24279,h)}}while(0);i=g;return c[p>>2]|0}function rh(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,k=0,l=0,m=0,n=0;g=i;i=i+32|0;if((i|0)>=(j|0))U();h=g+16|0;k=g+12|0;l=g+8|0;m=g+4|0;n=g;c[h>>2]=a;c[k>>2]=b;c[l>>2]=d;c[m>>2]=e;c[n>>2]=f;f=sh(c[h>>2]|0,c[k>>2]|0,c[l>>2]|0,c[m>>2]|0,c[n>>2]|0,c[(c[(c[h>>2]|0)+12>>2]|0)+36>>2]|0)|0;i=g;return f|0}function sh(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0;h=i;i=i+48|0;if((i|0)>=(j|0))U();k=h+44|0;l=h+40|0;m=h+36|0;n=h+32|0;o=h+28|0;p=h+24|0;q=h+20|0;r=h+16|0;s=h+12|0;t=h+8|0;u=h+4|0;v=h;c[l>>2]=a;c[m>>2]=b;c[n>>2]=d;c[o>>2]=e;c[p>>2]=f;c[q>>2]=g;c[r>>2]=c[(c[(c[l>>2]|0)+12>>2]|0)+20>>2];if((c[n>>2]|0)>>>0<(c[p>>2]|0)>>>0){c[k>>2]=200;w=c[k>>2]|0;i=h;return w|0}if(((c[p>>2]|0)>>>0)%((c[r>>2]|0)>>>0)|0|0){c[k>>2]=139;w=c[k>>2]|0;i=h;return w|0}c[t>>2]=((c[p>>2]|0)>>>0)/((c[r>>2]|0)>>>0)|0;c[u>>2]=0;c[s>>2]=0;while(1){if((c[s>>2]|0)>>>0>=(c[t>>2]|0)>>>0)break;c[v>>2]=sb[c[q>>2]&63]((c[l>>2]|0)+496|0,c[m>>2]|0,c[o>>2]|0)|0;c[u>>2]=(c[v>>2]|0)>>>0>(c[u>>2]|0)>>>0?c[v>>2]|0:c[u>>2]|0;c[o>>2]=(c[o>>2]|0)+(c[r>>2]|0);c[m>>2]=(c[m>>2]|0)+(c[r>>2]|0);c[s>>2]=(c[s>>2]|0)+1}if((c[u>>2]|0)>>>0>0){Qe((c[u>>2]|0)+16|0);Re()}c[k>>2]=0;w=c[k>>2]|0;i=h;return w|0}function th(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,k=0,l=0,m=0,n=0;g=i;i=i+32|0;if((i|0)>=(j|0))U();h=g+16|0;k=g+12|0;l=g+8|0;m=g+4|0;n=g;c[h>>2]=a;c[k>>2]=b;c[l>>2]=d;c[m>>2]=e;c[n>>2]=f;if(!(c[m>>2]|0)){c[m>>2]=c[k>>2];c[n>>2]=c[l>>2]}f=uh(c[h>>2]|0,c[k>>2]|0,c[l>>2]|0,c[m>>2]|0,c[n>>2]|0)|0;i=g;return f|0}function uh(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;g=i;i=i+32|0;if((i|0)>=(j|0))U();h=g;k=g+24|0;l=g+20|0;m=g+16|0;n=g+12|0;o=g+8|0;p=g+4|0;c[k>>2]=a;c[l>>2]=b;c[m>>2]=d;c[n>>2]=e;c[o>>2]=f;f=c[(c[k>>2]|0)+48>>2]|0;a:do if((f|0)>=6){if((f|0)<9)switch(f|0){case 6:{c[p>>2]=lq(c[k>>2]|0,c[l>>2]|0,c[m>>2]|0,c[n>>2]|0,c[o>>2]|0)|0;break a;break}case 7:{c[p>>2]=Up(c[k>>2]|0,c[l>>2]|0,c[m>>2]|0,c[n>>2]|0,c[o>>2]|0)|0;break a;break}case 8:{c[p>>2]=cq(c[k>>2]|0,c[l>>2]|0,c[m>>2]|0,c[n>>2]|0,c[o>>2]|0)|0;break a;break}default:{q=c[k>>2]|0;r=q+48|0;s=c[r>>2]|0;c[h>>2]=s;Je(24327,h)}}if((f|0)<11)switch(f|0){case 9:{c[p>>2]=xq(c[k>>2]|0,c[l>>2]|0,c[m>>2]|0,c[n>>2]|0,c[o>>2]|0)|0;break a;break}case 10:{c[p>>2]=dr(c[k>>2]|0,c[l>>2]|0,c[m>>2]|0,c[n>>2]|0,c[o>>2]|0)|0;break a;break}default:{q=c[k>>2]|0;r=q+48|0;s=c[r>>2]|0;c[h>>2]=s;Je(24327,h)}}if((f|0)<65537)switch(f|0){case 11:{c[p>>2]=Wq(c[k>>2]|0,c[l>>2]|0,c[m>>2]|0,c[n>>2]|0,c[o>>2]|0)|0;break a;break}default:{q=c[k>>2]|0;r=q+48|0;s=c[r>>2]|0;c[h>>2]=s;Je(24327,h)}}else switch(f|0){case 65537:{c[p>>2]=71;break a;break}default:{q=c[k>>2]|0;r=q+48|0;s=c[r>>2]|0;c[h>>2]=s;Je(24327,h)}}}else switch(f|0){case 1:{c[p>>2]=vh(c[k>>2]|0,c[l>>2]|0,c[m>>2]|0,c[n>>2]|0,c[o>>2]|0)|0;break a;break}case 3:{c[p>>2]=Yp(c[k>>2]|0,c[l>>2]|0,c[m>>2]|0,c[n>>2]|0,c[o>>2]|0)|0;break a;break}case 2:{c[p>>2]=gq(c[k>>2]|0,c[l>>2]|0,c[m>>2]|0,c[n>>2]|0,c[o>>2]|0)|0;break a;break}case 5:{c[p>>2]=Xq(c[k>>2]|0,c[l>>2]|0,c[m>>2]|0,c[n>>2]|0,c[o>>2]|0)|0;break a;break}case 4:{Cb[c[(c[(c[k>>2]|0)+12>>2]|0)+48>>2]&1]((c[k>>2]|0)+496|0,c[l>>2]|0,c[n>>2]|0,c[o>>2]|0);c[p>>2]=0;break a;break}case 0:{if((Jg()|0)==0?sf(0)|0:0){if((c[n>>2]|0)!=(c[l>>2]|0))Qw(c[l>>2]|0,c[n>>2]|0,c[o>>2]|0)|0;c[p>>2]=0;break a}Sg(24233,992,24312,0,24257);c[p>>2]=71;break a;break}default:{q=c[k>>2]|0;r=q+48|0;s=c[r>>2]|0;c[h>>2]=s;Je(24327,h)}}while(0);i=g;return c[p>>2]|0}function vh(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,k=0,l=0,m=0,n=0;g=i;i=i+32|0;if((i|0)>=(j|0))U();h=g+16|0;k=g+12|0;l=g+8|0;m=g+4|0;n=g;c[h>>2]=a;c[k>>2]=b;c[l>>2]=d;c[m>>2]=e;c[n>>2]=f;f=sh(c[h>>2]|0,c[k>>2]|0,c[l>>2]|0,c[m>>2]|0,c[n>>2]|0,c[(c[(c[h>>2]|0)+12>>2]|0)+40>>2]|0)|0;i=g;return f|0}function wh(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=i;i=i+16|0;if((i|0)>=(j|0))U();f=e+8|0;g=e+4|0;h=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;d=xh(c[f>>2]|0,c[g>>2]|0,c[h>>2]|0)|0;i=e;return d|0}function xh(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,k=0,l=0;f=i;i=i+16|0;if((i|0)>=(j|0))U();g=f+12|0;h=f+8|0;k=f+4|0;l=f;c[g>>2]=b;c[h>>2]=d;c[k>>2]=e;c[l>>2]=sb[c[(c[(c[g>>2]|0)+12>>2]|0)+32>>2]&63]((c[g>>2]|0)+496|0,c[h>>2]|0,c[k>>2]|0)|0;k=c[g>>2]|0;a:do if(!(c[l>>2]|0)){Ow(k+496+(c[(c[(c[g>>2]|0)+12>>2]|0)+28>>2]|0)|0,(c[g>>2]|0)+496|0,c[(c[(c[g>>2]|0)+12>>2]|0)+28>>2]|0)|0;h=(c[g>>2]|0)+56|0;a[h>>0]=a[h>>0]&-2|1;h=c[(c[g>>2]|0)+48>>2]|0;if((h|0)<10){switch(h|0){case 9:break;default:break a}yq(c[g>>2]|0);break}if((h|0)<65537){switch(h|0){case 10:break;default:break a}er(c[g>>2]|0);break}else{switch(h|0){case 65537:break;default:break a}jq(c[g>>2]|0)|0;break}}else{h=k+56|0;a[h>>0]=a[h>>0]&-2}while(0);i=f;return c[l>>2]|0}function yh(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,k=0;e=i;i=i+16|0;if((i|0)>=(j|0))U();f=e+12|0;g=e+8|0;h=e+4|0;k=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;c[k>>2]=0;switch(c[(c[f>>2]|0)+48>>2]|0){case 8:{c[k>>2]=_p(c[f>>2]|0,c[g>>2]|0,c[h>>2]|0)|0;break}case 9:{c[k>>2]=pq(c[f>>2]|0,c[g>>2]|0,c[h>>2]|0)|0;break}case 10:{c[k>>2]=_q(c[f>>2]|0,c[g>>2]|0,c[h>>2]|0)|0;break}case 11:{c[k>>2]=Pq(c[f>>2]|0,c[g>>2]|0,c[h>>2]|0)|0;break}default:c[k>>2]=zh(c[f>>2]|0,c[g>>2]|0,c[h>>2]|0)|0}i=e;return c[k>>2]|0}function zh(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,k=0,l=0,m=0,n=0;f=i;i=i+32|0;if((i|0)>=(j|0))U();g=f;h=f+20|0;k=f+16|0;l=f+12|0;m=f+8|0;c[k>>2]=b;c[l>>2]=d;c[m>>2]=e;e=c[k>>2]|0;if(c[(c[(c[k>>2]|0)+12>>2]|0)+60>>2]|0){xb[c[(c[e+12>>2]|0)+60>>2]&7]((c[k>>2]|0)+496|0,c[l>>2]|0,c[m>>2]|0);c[h>>2]=0;n=c[h>>2]|0;i=f;return n|0}Sw(e+64|0,0,c[(c[(c[k>>2]|0)+12>>2]|0)+20>>2]|0)|0;if(c[l>>2]|0){if((c[m>>2]|0)!=(c[(c[(c[k>>2]|0)+12>>2]|0)+20>>2]|0)){e=c[(c[(c[k>>2]|0)+12>>2]|0)+20>>2]|0;c[g>>2]=c[m>>2];c[g+4>>2]=e;Ge(24360,g);Sg(24233,682,24403,0,24416)}if((c[m>>2]|0)>>>0>(c[(c[(c[k>>2]|0)+12>>2]|0)+20>>2]|0)>>>0)c[m>>2]=c[(c[(c[k>>2]|0)+12>>2]|0)+20>>2];Ow((c[k>>2]|0)+64|0,c[l>>2]|0,c[m>>2]|0)|0;m=(c[k>>2]|0)+56|0;a[m>>0]=a[m>>0]&-3|2}else{m=(c[k>>2]|0)+56|0;a[m>>0]=a[m>>0]&-3}c[(c[k>>2]|0)+112>>2]=0;c[h>>2]=0;n=c[h>>2]|0;i=f;return n|0}function Ah(){return 0}function Bh(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0;f=i;i=i+32|0;if((i|0)>=(j|0))U();g=f+16|0;h=f+12|0;k=f+8|0;l=f+4|0;m=f;c[g>>2]=b;c[h>>2]=d;c[k>>2]=e;c[l>>2]=0;c[m>>2]=hh(c[g>>2]|0)|0;if((c[m>>2]|0?(a[(c[m>>2]|0)+4>>0]&1|0)==0:0)?c[(c[m>>2]|0)+52>>2]|0:0){c[l>>2]=sb[c[(c[m>>2]|0)+52>>2]&63](c[g>>2]|0,c[h>>2]|0,c[k>>2]|0)|0;n=c[l>>2]|0;o=Ch(n)|0;i=f;return o|0}c[l>>2]=12;if(!(c[k>>2]|0)){n=c[l>>2]|0;o=Ch(n)|0;i=f;return o|0}h=c[k>>2]|0;k=c[g>>2]|0;if(c[m>>2]|0?!(a[(c[m>>2]|0)+4>>0]&1|0):0)p=37821;else p=c[m>>2]|0?37782:37801;Cb[h&1](38451,k,37843,p);n=c[l>>2]|0;o=Ch(n)|0;i=f;return o|0}function Ch(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b;c[d>>2]=a;a=nh(1,c[d>>2]|0)|0;i=b;return a|0}function Dh(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;g=i;i=i+32|0;if((i|0)>=(j|0))U();h=g+24|0;k=g+20|0;l=g+16|0;m=g+12|0;n=g+8|0;o=g+4|0;p=g;c[k>>2]=b;c[l>>2]=d;c[m>>2]=e;c[n>>2]=f;c[p>>2]=0;if(!(c[l>>2]|0)){c[o>>2]=0;while(1){if(!(c[1412+((c[o>>2]|0)*48|0)>>2]|0))break;if((c[k>>2]|0)==(c[1412+((c[o>>2]|0)*48|0)+4>>2]|0)?(c[1412+((c[o>>2]|0)*48|0)+12>>2]|0)==0:0)break;c[o>>2]=(c[o>>2]|0)+1}if(!(c[1412+((c[o>>2]|0)*48|0)>>2]|0))c[o>>2]=-1}else c[o>>2]=Eh(c[l>>2]|0)|0;if((c[o>>2]|0)<0){c[h>>2]=188;q=c[h>>2]|0;i=g;return q|0}c[p>>2]=c[1412+((c[o>>2]|0)*48|0)>>2];if(Jg()|0?(a[1412+((c[o>>2]|0)*48|0)+8>>0]&1|0)==0:0){c[h>>2]=60;q=c[h>>2]|0;i=g;return q|0}if((c[1412+((c[o>>2]|0)*48|0)+12>>2]|0)>>>0>=3){c[h>>2]=59;q=c[h>>2]|0;i=g;return q|0}if(c[n>>2]|0)c[c[n>>2]>>2]=c[1412+((c[o>>2]|0)*48|0)+4>>2];if(c[m>>2]|0){c[c[m>>2]>>2]=c[1412+((c[o>>2]|0)*48|0)+12>>2];c[(c[m>>2]|0)+4>>2]=c[1412+((c[o>>2]|0)*48|0)+16>>2];if(!(c[(c[m>>2]|0)+8>>2]|0)){n=Fh(c[1412+((c[o>>2]|0)*48|0)+20>>2]|0)|0;c[(c[m>>2]|0)+8>>2]=n}if(!(c[(c[m>>2]|0)+12>>2]|0)){n=Fh(c[1412+((c[o>>2]|0)*48|0)+24>>2]|0)|0;c[(c[m>>2]|0)+12>>2]=n}if(!(c[(c[m>>2]|0)+16>>2]|0)){n=Fh(c[1412+((c[o>>2]|0)*48|0)+28>>2]|0)|0;c[(c[m>>2]|0)+16>>2]=n}if(!(c[(c[m>>2]|0)+32>>2]|0)){n=Fh(c[1412+((c[o>>2]|0)*48|0)+32>>2]|0)|0;c[(c[m>>2]|0)+32>>2]=n}if(!(c[(c[m>>2]|0)+36>>2]|0)){n=Fh(c[1412+((c[o>>2]|0)*48|0)+44>>2]|0)|0;c[(c[m>>2]|0)+36>>2]=n}if(!(c[(c[m>>2]|0)+20>>2]|0)){n=Fh(c[1412+((c[o>>2]|0)*48|0)+36>>2]|0)|0;c[(c[m>>2]|0)+20>>2]=n}if(!(c[(c[m>>2]|0)+20+4>>2]|0)){n=Fh(c[1412+((c[o>>2]|0)*48|0)+40>>2]|0)|0;c[(c[m>>2]|0)+20+4>>2]=n}if(!(c[(c[m>>2]|0)+20+8>>2]|0)){n=hp(1)|0;c[(c[m>>2]|0)+20+8>>2]=n}if(!(c[(c[m>>2]|0)+40>>2]|0))c[(c[m>>2]|0)+40>>2]=c[p>>2]}c[h>>2]=0;q=c[h>>2]|0;i=g;return q|0}function Eh(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,k=0,l=0,m=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b+12|0;e=b+8|0;f=b+4|0;g=b;c[e>>2]=a;c[f>>2]=0;while(1){if(!(c[1412+((c[f>>2]|0)*48|0)>>2]|0))break;a=(pu(c[e>>2]|0,c[1412+((c[f>>2]|0)*48|0)>>2]|0)|0)!=0;h=c[f>>2]|0;if(!a){k=4;break}c[f>>2]=h+1}if((k|0)==4){c[d>>2]=h;l=c[d>>2]|0;i=b;return l|0}a:do if(!(c[1412+((c[f>>2]|0)*48|0)>>2]|0)){c[g>>2]=0;while(1){if(!(c[2468+(c[g>>2]<<3)>>2]|0))break;if(!(pu(c[e>>2]|0,c[2468+(c[g>>2]<<3)+4>>2]|0)|0))break;c[g>>2]=(c[g>>2]|0)+1}if(c[2468+(c[g>>2]<<3)>>2]|0){c[f>>2]=0;while(1){if(!(c[1412+((c[f>>2]|0)*48|0)>>2]|0))break a;h=(pu(c[2468+(c[g>>2]<<3)>>2]|0,c[1412+((c[f>>2]|0)*48|0)>>2]|0)|0)!=0;m=c[f>>2]|0;if(!h)break;c[f>>2]=m+1}c[d>>2]=m;l=c[d>>2]|0;i=b;return l|0}}while(0);c[d>>2]=-1;l=c[d>>2]|0;i=b;return l|0}function Fh(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b;e=b+12|0;f=b+8|0;g=b+4|0;c[e>>2]=a;c[f>>2]=Mo(g,4,c[e>>2]|0,0,0)|0;if(c[f>>2]|0){c[d>>2]=ot(c[f>>2]|0)|0;Je(35635,d)}else{i=b;return c[g>>2]|0}return 0}function Gh(a,b,d,e,f,g,h,k,l){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;k=k|0;l=l|0;var m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0;m=i;i=i+64|0;if((i|0)>=(j|0))U();n=m+48|0;o=m+44|0;p=m+40|0;q=m+36|0;r=m+32|0;s=m+28|0;t=m+24|0;u=m+20|0;v=m+16|0;w=m+12|0;x=m+8|0;y=m+4|0;z=m;c[o>>2]=a;c[p>>2]=b;c[q>>2]=d;c[r>>2]=e;c[s>>2]=f;c[t>>2]=g;c[u>>2]=h;c[v>>2]=k;c[w>>2]=l;c[x>>2]=Eh(c[o>>2]|0)|0;if((c[x>>2]|0)<0){c[n>>2]=188;A=c[n>>2]|0;i=m;return A|0}do if(c[u>>2]|0){c[z>>2]=4;o=Tu((c[1412+((c[x>>2]|0)*48|0)+36>>2]|0)+2|0)|0;c[z>>2]=(c[z>>2]|0)+o;o=Tu((c[1412+((c[x>>2]|0)*48|0)+40>>2]|0)+2|0)|0;c[z>>2]=(c[z>>2]|0)+o;c[z>>2]=(c[z>>2]|0)+1;c[y>>2]=bf(c[z>>2]|0)|0;if(c[y>>2]|0){o=ev(c[y>>2]|0,35374)|0;l=ev(o,(c[1412+((c[x>>2]|0)*48|0)+36>>2]|0)+2|0)|0;dv(l,(c[1412+((c[x>>2]|0)*48|0)+40>>2]|0)+2|0)|0;Gp(c[c[u>>2]>>2]|0);l=Fh(c[y>>2]|0)|0;c[c[u>>2]>>2]=l;hf(c[y>>2]|0);break}c[n>>2]=rt()|0;A=c[n>>2]|0;i=m;return A|0}while(0);if(c[p>>2]|0)c[c[p>>2]>>2]=c[1412+((c[x>>2]|0)*48|0)+12>>2];if(c[q>>2]|0)c[c[q>>2]>>2]=c[1412+((c[x>>2]|0)*48|0)+16>>2];if(c[r>>2]|0){Gp(c[c[r>>2]>>2]|0);q=Fh(c[1412+((c[x>>2]|0)*48|0)+20>>2]|0)|0;c[c[r>>2]>>2]=q}if(c[s>>2]|0){Gp(c[c[s>>2]>>2]|0);q=Fh(c[1412+((c[x>>2]|0)*48|0)+24>>2]|0)|0;c[c[s>>2]>>2]=q}if(c[t>>2]|0){Gp(c[c[t>>2]>>2]|0);q=Fh(c[1412+((c[x>>2]|0)*48|0)+28>>2]|0)|0;c[c[t>>2]>>2]=q}if(c[v>>2]|0){Gp(c[c[v>>2]>>2]|0);q=Fh(c[1412+((c[x>>2]|0)*48|0)+32>>2]|0)|0;c[c[v>>2]>>2]=q}if(c[w>>2]|0){Gp(c[c[w>>2]>>2]|0);q=Fh(c[1412+((c[x>>2]|0)*48|0)+44>>2]|0)|0;c[c[w>>2]>>2]=q}c[n>>2]=0;A=c[n>>2]|0;i=m;return A|0}function Hh(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0;e=i;i=i+128|0;if((i|0)>=(j|0))U();f=e;g=e+112|0;h=e+108|0;k=e+104|0;l=e+100|0;m=e+96|0;n=e+92|0;o=e+48|0;p=e+44|0;q=e+40|0;r=e+36|0;s=e+32|0;t=e+28|0;c[h>>2]=a;c[k>>2]=b;c[l>>2]=d;c[n>>2]=0;c[p>>2]=0;c[q>>2]=0;d=o;b=d+44|0;do{c[d>>2]=0;d=d+4|0}while((d|0)<(b|0));if(c[l>>2]|0)c[c[l>>2]>>2]=0;if(!(c[h>>2]|0)){c[r>>2]=c[k>>2];if((c[r>>2]|0)>=0&(c[r>>2]|0)>>>0<22?(c[n>>2]=c[1412+((c[r>>2]|0)*48|0)>>2],c[l>>2]|0):0)c[c[l>>2]>>2]=c[1412+((c[r>>2]|0)*48|0)+4>>2];c[g>>2]=c[n>>2];u=c[g>>2]|0;i=e;return u|0}k=c[h>>2]|0;c[f>>2]=o+8;c[f+4>>2]=o+12;c[f+8>>2]=o+16;c[f+12>>2]=p;c[f+16>>2]=o+32;c[f+20>>2]=o+36;c[f+24>>2]=0;c[m>>2]=Ih(_f(k,0,35379,f)|0)|0;a:do if((c[m>>2]|0)==68){c[s>>2]=Gf(c[h>>2]|0,46978,5)|0;if(c[s>>2]|0?(c[t>>2]=Nf(c[s>>2]|0,1)|0,Ef(c[s>>2]|0),c[t>>2]|0):0){c[r>>2]=Eh(c[t>>2]|0)|0;hf(c[t>>2]|0);if((c[r>>2]|0)>=0?(c[n>>2]=c[1412+((c[r>>2]|0)*48|0)>>2],c[l>>2]|0):0)c[c[l>>2]>>2]=c[1412+((c[r>>2]|0)*48|0)+4>>2];c[g>>2]=c[n>>2];u=c[g>>2]|0;i=e;return u|0}}else if(!(c[m>>2]|0)){if(c[p>>2]|0?(ln(o+20|0),mi(o+20|0,c[p>>2]|0)|0):0)break;c[r>>2]=0;while(1){if(!(c[1412+((c[r>>2]|0)*48|0)>>2]|0))break a;qp(c[q>>2]|0);c[q>>2]=Fh(c[1412+((c[r>>2]|0)*48|0)+20>>2]|0)|0;if(((((((jo(c[q>>2]|0,c[o+8>>2]|0)|0)==0?(qp(c[q>>2]|0),c[q>>2]=Fh(c[1412+((c[r>>2]|0)*48|0)+24>>2]|0)|0,(jo(c[q>>2]|0,c[o+12>>2]|0)|0)==0):0)?(qp(c[q>>2]|0),c[q>>2]=Fh(c[1412+((c[r>>2]|0)*48|0)+28>>2]|0)|0,(jo(c[q>>2]|0,c[o+16>>2]|0)|0)==0):0)?(qp(c[q>>2]|0),c[q>>2]=Fh(c[1412+((c[r>>2]|0)*48|0)+32>>2]|0)|0,(jo(c[q>>2]|0,c[o+32>>2]|0)|0)==0):0)?(qp(c[q>>2]|0),c[q>>2]=Fh(c[1412+((c[r>>2]|0)*48|0)+44>>2]|0)|0,(jo(c[q>>2]|0,c[o+36>>2]|0)|0)==0):0)?(qp(c[q>>2]|0),c[q>>2]=Fh(c[1412+((c[r>>2]|0)*48|0)+36>>2]|0)|0,(jo(c[q>>2]|0,c[o+20>>2]|0)|0)==0):0)?(qp(c[q>>2]|0),c[q>>2]=Fh(c[1412+((c[r>>2]|0)*48|0)+40>>2]|0)|0,(jo(c[q>>2]|0,c[o+20+4>>2]|0)|0)==0):0)break;c[r>>2]=(c[r>>2]|0)+1}c[n>>2]=c[1412+((c[r>>2]|0)*48|0)>>2];if(c[l>>2]|0)c[c[l>>2]>>2]=c[1412+((c[r>>2]|0)*48|0)+4>>2]}while(0);Gp(c[q>>2]|0);Gp(c[o+8>>2]|0);Gp(c[o+12>>2]|0);Gp(c[o+16>>2]|0);Gp(c[p>>2]|0);nn(o+20|0);Gp(c[o+32>>2]|0);Gp(c[o+36>>2]|0);c[g>>2]=c[n>>2];u=c[g>>2]|0;i=e;return u|0}function Ih(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b;c[d>>2]=a;i=b;return c[d>>2]&65535|0}function Jh(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0;e=i;i=i+80|0;if((i|0)>=(j|0))U();f=e+76|0;g=e+72|0;h=e+68|0;k=e+64|0;l=e+60|0;m=e+56|0;n=e+52|0;o=e+48|0;p=e+44|0;q=e+40|0;r=e+36|0;s=e+32|0;t=e+28|0;u=e+24|0;v=e+20|0;w=e+16|0;x=e+12|0;y=e+8|0;z=e+4|0;A=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;c[l>>2]=0;c[m>>2]=0;c[n>>2]=0;c[o>>2]=0;c[p>>2]=0;c[q>>2]=0;c[r>>2]=0;c[s>>2]=0;c[t>>2]=0;c[u>>2]=0;c[v>>2]=0;c[w>>2]=0;c[c[f>>2]>>2]=0;do if(c[g>>2]|0){c[x>>2]=Gf(c[g>>2]|0,46984,0)|0;if(c[x>>2]|0?(c[k>>2]=sj(c[x>>2]|0,w,0)|0,Ef(c[x>>2]|0),c[x>>2]=0,c[k>>2]|0):0)break;c[x>>2]=Gf(c[g>>2]|0,46978,5)|0;if(c[x>>2]|0?(c[w>>2]&512|0)==0:0){B=13;break}c[k>>2]=Kh(o,c[g>>2]|0,48461)|0;if((((((c[k>>2]|0)==0?(c[k>>2]=Kh(p,c[g>>2]|0,39187)|0,(c[k>>2]|0)==0):0)?(c[k>>2]=Kh(q,c[g>>2]|0,35387)|0,(c[k>>2]|0)==0):0)?(c[k>>2]=Lh(r,c[g>>2]|0,35389,0)|0,(c[k>>2]|0)==0):0)?(c[k>>2]=Kh(s,c[g>>2]|0,39191)|0,(c[k>>2]|0)==0):0)?(c[k>>2]=Kh(t,c[g>>2]|0,35400)|0,(c[k>>2]|0)==0):0)B=13}else{c[x>>2]=0;B=13}while(0);do if((B|0)==13){if((c[x>>2]|0)!=0|(c[h>>2]|0)!=0){if(c[x>>2]|0){c[y>>2]=Nf(c[x>>2]|0,1)|0;Ef(c[x>>2]|0);if(!(c[y>>2]|0)){c[k>>2]=65;break}}else c[y>>2]=0;c[z>>2]=jf(1,44)|0;if(!(c[z>>2]|0)){c[k>>2]=rt()|0;hf(c[y>>2]|0);break}c[k>>2]=Dh(0,c[y>>2]|0?c[y>>2]|0:c[h>>2]|0,c[z>>2]|0,0)|0;hf(c[y>>2]|0);d=c[z>>2]|0;if(c[k>>2]|0){hf(d);break}c[m>>2]=c[d>>2];c[n>>2]=c[(c[z>>2]|0)+4>>2];if(!(c[o>>2]|0)){c[o>>2]=c[(c[z>>2]|0)+8>>2];c[(c[z>>2]|0)+8>>2]=0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l>>2]=0}}while(0);fh(c[l>>2]|0);qp(c[o>>2]|0);qp(c[p>>2]|0);qp(c[q>>2]|0);mn(c[r>>2]|0);qp(c[s>>2]|0);qp(c[t>>2]|0);mn(c[u>>2]|0);qp(c[v>>2]|0);i=e;return c[k>>2]|0}function Kh(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,k=0,l=0,m=0;e=i;i=i+32|0;if((i|0)>=(j|0))U();f=e+16|0;g=e+12|0;h=e+8|0;k=e+4|0;l=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;c[k>>2]=0;c[l>>2]=Gf(c[g>>2]|0,c[h>>2]|0,0)|0;if(!(c[l>>2]|0)){m=c[k>>2]|0;i=e;return m|0}h=Of(c[l>>2]|0,1,5)|0;c[c[f>>2]>>2]=h;Ef(c[l>>2]|0);if(c[c[f>>2]>>2]|0){m=c[k>>2]|0;i=e;return m|0}c[k>>2]=65;m=c[k>>2]|0;i=e;return m|0}function Lh(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0;f=i;i=i+64|0;if((i|0)>=(j|0))U();g=f+48|0;h=f+44|0;k=f+40|0;l=f+36|0;m=f+32|0;n=f+28|0;o=f+24|0;p=f+20|0;q=f+16|0;r=f+12|0;s=f+8|0;t=f+4|0;u=f;c[h>>2]=a;c[k>>2]=b;c[l>>2]=d;c[m>>2]=e;c[o>>2]=Gf(c[k>>2]|0,c[l>>2]|0,0)|0;if(c[o>>2]|0){c[q>>2]=Of(c[o>>2]|0,1,8)|0;Ef(c[o>>2]|0);if(!(c[q>>2]|0)){c[g>>2]=65;v=c[g>>2]|0;i=f;return v|0}c[p>>2]=kn(0)|0;if(c[m>>2]|0?(c[(c[m>>2]|0)+4>>2]|0)==1:0)c[n>>2]=Wh(c[q>>2]|0,c[m>>2]|0,c[p>>2]|0,0,0)|0;else c[n>>2]=mi(c[p>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0]|0)){c[g>>2]=0;o=c[g>>2]|0;i=f;return o|0}if((pu(c[h>>2]|0,48461)|0)==0?c[(c[k>>2]|0)+16>>2]|0:0){if(c[(c[k>>2]|0)+16>>2]|0?!(c[l>>2]|0?1:(c[(c[(c[k>>2]|0)+16>>2]|0)+12>>2]&32|0)==0):0)p=c[(c[k>>2]|0)+16>>2]|0;else p=vp(c[(c[k>>2]|0)+16>>2]|0)|0;c[g>>2]=p;o=c[g>>2]|0;i=f;return o|0}if((pu(c[h>>2]|0,39187)|0)==0?c[(c[k>>2]|0)+20>>2]|0:0){if(c[(c[k>>2]|0)+20>>2]|0?!(c[l>>2]|0?1:(c[(c[(c[k>>2]|0)+20>>2]|0)+12>>2]&32|0)==0):0)q=c[(c[k>>2]|0)+20>>2]|0;else q=vp(c[(c[k>>2]|0)+20>>2]|0)|0;c[g>>2]=q;o=c[g>>2]|0;i=f;return o|0}if((pu(c[h>>2]|0,35387)|0)==0?c[(c[k>>2]|0)+24>>2]|0:0){if(c[(c[k>>2]|0)+24>>2]|0?!(c[l>>2]|0?1:(c[(c[(c[k>>2]|0)+24>>2]|0)+12>>2]&32|0)==0):0)r=c[(c[k>>2]|0)+24>>2]|0;else r=vp(c[(c[k>>2]|0)+24>>2]|0)|0;c[g>>2]=r;o=c[g>>2]|0;i=f;return o|0}if((pu(c[h>>2]|0,39191)|0)==0?c[(c[k>>2]|0)+32>>2]|0:0){if(c[(c[k>>2]|0)+32>>2]|0?!(c[l>>2]|0?1:(c[(c[(c[k>>2]|0)+32>>2]|0)+12>>2]&32|0)==0):0)s=c[(c[k>>2]|0)+32>>2]|0;else s=vp(c[(c[k>>2]|0)+32>>2]|0)|0;c[g>>2]=s;o=c[g>>2]|0;i=f;return o|0}if((pu(c[h>>2]|0,35400)|0)==0?c[(c[k>>2]|0)+36>>2]|0:0){if(c[(c[k>>2]|0)+36>>2]|0?!(c[l>>2]|0?1:(c[(c[(c[k>>2]|0)+36>>2]|0)+12>>2]&32|0)==0):0)t=c[(c[k>>2]|0)+36>>2]|0;else t=vp(c[(c[k>>2]|0)+36>>2]|0)|0;c[g>>2]=t;o=c[g>>2]|0;i=f;return o|0}if((pu(c[h>>2]|0,35402)|0)==0?c[(c[k>>2]|0)+44>>2]|0:0){if(c[(c[k>>2]|0)+44>>2]|0?!(c[l>>2]|0?1:(c[(c[(c[k>>2]|0)+44>>2]|0)+12>>2]&32|0)==0):0)u=c[(c[k>>2]|0)+44>>2]|0;else u=vp(c[(c[k>>2]|0)+44>>2]|0)|0;c[g>>2]=u;o=c[g>>2]|0;i=f;return o|0}if(((pu(c[h>>2]|0,35501)|0)==0?c[(c[k>>2]|0)+28>>2]|0:0)?c[c[(c[k>>2]|0)+28>>2]>>2]|0:0){if(c[c[(c[k>>2]|0)+28>>2]>>2]|0?!(c[l>>2]|0?1:(c[(c[c[(c[k>>2]|0)+28>>2]>>2]|0)+12>>2]&32|0)==0):0)v=c[c[(c[k>>2]|0)+28>>2]>>2]|0;else v=vp(c[c[(c[k>>2]|0)+28>>2]>>2]|0)|0;c[g>>2]=v;o=c[g>>2]|0;i=f;return o|0}if(((pu(c[h>>2]|0,35505)|0)==0?c[(c[k>>2]|0)+28>>2]|0:0)?c[(c[(c[k>>2]|0)+28>>2]|0)+4>>2]|0:0){if(c[(c[(c[k>>2]|0)+28>>2]|0)+4>>2]|0?!(c[l>>2]|0?1:(c[(c[(c[(c[k>>2]|0)+28>>2]|0)+4>>2]|0)+12>>2]&32|0)==0):0)w=c[(c[(c[k>>2]|0)+28>>2]|0)+4>>2]|0;else w=vp(c[(c[(c[k>>2]|0)+28>>2]|0)+4>>2]|0)|0;c[g>>2]=w;o=c[g>>2]|0;i=f;return o|0}if(((pu(c[h>>2]|0,35509)|0)==0?c[(c[k>>2]|0)+40>>2]|0:0)?c[c[(c[k>>2]|0)+40>>2]>>2]|0:0){if(c[c[(c[k>>2]|0)+40>>2]>>2]|0?!(c[l>>2]|0?1:(c[(c[c[(c[k>>2]|0)+40>>2]>>2]|0)+12>>2]&32|0)==0):0)x=c[c[(c[k>>2]|0)+40>>2]>>2]|0;else x=vp(c[c[(c[k>>2]|0)+40>>2]>>2]|0)|0;c[g>>2]=x;o=c[g>>2]|0;i=f;return o|0}if(((pu(c[h>>2]|0,35513)|0)==0?c[(c[k>>2]|0)+40>>2]|0:0)?c[(c[(c[k>>2]|0)+40>>2]|0)+4>>2]|0:0){if(c[(c[(c[k>>2]|0)+28>>2]|0)+4>>2]|0?!(c[l>>2]|0?1:(c[(c[(c[(c[k>>2]|0)+28>>2]|0)+4>>2]|0)+12>>2]&32|0)==0):0)y=c[(c[(c[k>>2]|0)+40>>2]|0)+4>>2]|0;else y=vp(c[(c[(c[k>>2]|0)+40>>2]|0)+4>>2]|0)|0;c[g>>2]=y;o=c[g>>2]|0;i=f;return o|0}if((pu(c[h>>2]|0,35389)|0)==0?c[(c[k>>2]|0)+28>>2]|0:0){c[g>>2]=li(c[(c[k>>2]|0)+28>>2]|0,c[k>>2]|0)|0;o=c[g>>2]|0;i=f;return o|0}do if((a[c[h>>2]>>0]|0)==113){if(a[(c[h>>2]|0)+1>>0]|0?(a[(c[h>>2]|0)+1>>0]|0)!=64:0)break;if(!(c[(c[k>>2]|0)+40>>2]|0)){y=ni(0,c[k>>2]|0,0,0)|0;c[(c[k>>2]|0)+40>>2]=y}if(!(c[(c[k>>2]|0)+40>>2]|0)){c[g>>2]=0;o=c[g>>2]|0;i=f;return o|0}if((a[(c[h>>2]|0)+1>>0]|0)!=64){c[g>>2]=li(c[(c[k>>2]|0)+40>>2]|0,c[k>>2]|0)|0;o=c[g>>2]|0;i=f;return o|0}if((pu((c[h>>2]|0)+2|0,46944)|0)==0?(c[c[k>>2]>>2]|0)==2:0){if(Rh(c[(c[k>>2]|0)+40>>2]|0,c[k>>2]|0,0,0,0,m,n)|0)break;c[g>>2]=rp(0,c[m>>2]|0,c[n>>2]<<3)|0;o=c[g>>2]|0;i=f;return o|0}}while(0);c[g>>2]=0;o=c[g>>2]|0;i=f;return o|0}function Oh(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;d=i;i=i+16|0;if((i|0)>=(j|0))U();e=d+8|0;f=d+4|0;g=d;c[f>>2]=a;c[g>>2]=b;if((pu(c[f>>2]|0,35389)|0)==0?c[(c[g>>2]|0)+28>>2]|0:0){c[e>>2]=Ph(c[(c[g>>2]|0)+28>>2]|0)|0;h=c[e>>2]|0;i=d;return h|0}if(!(pu(c[f>>2]|0,49689)|0)){if(!(c[(c[g>>2]|0)+40>>2]|0)){f=ni(0,c[g>>2]|0,0,0)|0;c[(c[g>>2]|0)+40>>2]=f}if(c[(c[g>>2]|0)+40>>2]|0){c[e>>2]=Ph(c[(c[g>>2]|0)+40>>2]|0)|0;h=c[e>>2]|0;i=d;return h|0}}c[e>>2]=0;h=c[e>>2]|0;i=d;return h|0}function Ph(a){a=a|0;var b=0,d=0,e=0,f=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b+4|0;e=b;c[d>>2]=a;if(c[d>>2]|0){c[e>>2]=kn(0)|0;Qh(c[e>>2]|0,c[d>>2]|0);f=c[e>>2]|0;i=b;return f|0}else{c[e>>2]=0;f=c[e>>2]|0;i=b;return f|0}return 0}function Qh(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=i;i=i+16|0;if((i|0)>=(j|0))U();e=d+4|0;f=d;c[e>>2]=a;c[f>>2]=b;xp(c[c[e>>2]>>2]|0,c[c[f>>2]>>2]|0)|0;xp(c[(c[e>>2]|0)+4>>2]|0,c[(c[f>>2]|0)+4>>2]|0)|0;xp(c[(c[e>>2]|0)+8>>2]|0,c[(c[f>>2]|0)+8>>2]|0)|0;i=d;return}function Rh(a,b,d,e,f,g,h){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0;k=i;i=i+48|0;if((i|0)>=(j|0))U();l=k+40|0;m=k+36|0;n=k+32|0;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];c[c[s>>2]>>2]=(c[u>>2]|0)+(c[v>>2]|0);c[m>>2]=0;w=c[m>>2]|0;i=l;return w|0}function Th(a,b){a=a|0;b=b|0;var e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;e=i;i=i+48|0;if((i|0)>=(j|0))U();f=e+36|0;g=e+32|0;h=e+28|0;k=e+24|0;l=e+20|0;m=e+16|0;n=e+12|0;o=e+8|0;p=e+4|0;q=e;c[g>>2]=a;c[h>>2]=b;if(c[g>>2]|0?c[(c[g>>2]|0)+12>>2]&4|0:0){c[l>>2]=tp(c[g>>2]|0,m)|0;if(!(c[l>>2]|0)){c[f>>2]=65;r=c[f>>2]|0;i=e;return r|0}c[m>>2]=(((c[m>>2]|0)+7|0)>>>0)/8|0;do if((c[m>>2]|0)>>>0>1?((c[m>>2]|0)>>>0)%2|0|0:0){b=c[l>>2]|0;if((d[c[l>>2]>>0]|0|0)!=4){if((d[b>>0]|0|0)!=64)break;if(sp(c[g>>2]|0,(c[l>>2]|0)+1|0,(c[m>>2]|0)-1<<3)|0)break;c[f>>2]=rt()|0;r=c[f>>2]|0;i=e;return r|0}c[k>>2]=Mo(n,1,b+1|0,(((c[m>>2]|0)-1|0)>>>0)/2|0,0)|0;if(c[k>>2]|0){c[f>>2]=c[k>>2];r=c[f>>2]|0;i=e;return r|0}c[k>>2]=Mo(o,1,(c[l>>2]|0)+1+((((c[m>>2]|0)-1|0)>>>0)/2|0)|0,(((c[m>>2]|0)-1|0)>>>0)/2|0,0)|0;b=c[n>>2]|0;if(c[k>>2]|0){qp(b);c[f>>2]=c[k>>2];r=c[f>>2]|0;i=e;return r|0}c[k>>2]=Sh(b,c[o>>2]|0,((c[h>>2]|0)>>>0)/8|0,0,p,q)|0;qp(c[n>>2]|0);qp(c[o>>2]|0);if(!(c[k>>2]|0)){rp(c[g>>2]|0,c[p>>2]|0,c[q>>2]<<3)|0;break}c[f>>2]=c[k>>2];r=c[f>>2]|0;i=e;return r|0}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>>2]|0,c[h>>2]|0,c[(c[m>>2]|0)+16>>2]|0);Eo(c[r>>2]|0,c[r>>2]|0,c[p>>2]|0,c[(c[m>>2]|0)+16>>2]|0);wp(c[r>>2]|0,c[r>>2]|0);if(!(jo(c[r>>2]|0,c[o>>2]|0)|0)){if(!(c[17651]|0))c[17651]=Vh(35670)|0;Eo(c[h>>2]|0,c[h>>2]|0,c[17651]|0,c[(c[m>>2]|0)+16>>2]|0);Eo(c[r>>2]|0,c[h>>2]|0,c[h>>2]|0,c[(c[m>>2]|0)+16>>2]|0);Eo(c[r>>2]|0,c[r>>2]|0,c[p>>2]|0,c[(c[m>>2]|0)+16>>2]|0);wp(c[r>>2]|0,c[r>>2]|0);if(!(jo(c[r>>2]|0,c[o>>2]|0)|0))c[n>>2]=65}d=_n(c[h>>2]|0,0)|0;if((d|0)!=(((c[l>>2]|0)!=0^1^1)&1|0))Vn(c[h>>2]|0,c[(c[m>>2]|0)+16>>2]|0,c[h>>2]|0);qp(c[r>>2]|0);qp(c[q>>2]|0);qp(c[p>>2]|0);qp(c[o>>2]|0);c[g>>2]=c[n>>2];s=c[g>>2]|0;i=f;return s|0}function Vh(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b;e=b+12|0;f=b+8|0;g=b+4|0;c[e>>2]=a;c[f>>2]=Mo(g,4,c[e>>2]|0,0,0)|0;if(c[f>>2]|0){c[d>>2]=ot(c[f>>2]|0)|0;Je(35635,d)}else{i=b;return c[g>>2]|0}return 0}function Wh(b,e,f,g,h){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0;k=i;i=i+64|0;if((i|0)>=(j|0))U();l=k+48|0;m=k+44|0;n=k+40|0;o=k+36|0;p=k+32|0;q=k+28|0;r=k+24|0;s=k+20|0;t=k+16|0;u=k+12|0;v=k+8|0;w=k+4|0;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>>2]=rt()|0;y=c[l>>2]|0;i=k;return y|0}else z=21;while(0);if((z|0)==21?(c[s>>2]=Io(c[m>>2]|0,((c[(c[n>>2]|0)+12>>2]|0)>>>0)/8|0,t,0)|0,(c[s>>2]|0)==0):0){c[l>>2]=rt()|0;y=c[l>>2]|0;i=k;return y|0}if(c[t>>2]|0){c[u>>2]=(((d[c[s>>2]>>0]|0)&128|0)!=0^1^1)&1;m=c[s>>2]|0;a[m>>0]=(d[m>>0]|0)&127}else c[u>>2]=0;Lo(c[(c[o>>2]|0)+4>>2]|0,c[s>>2]|0,c[t>>2]|0,0);if(c[p>>2]|0){if((c[u>>2]|0)!=0&(c[t>>2]|0)!=0){m=c[s>>2]|0;a[m>>0]=d[m>>0]|0|128}Xh(c[s>>2]|0,c[t>>2]|0);c[c[p>>2]>>2]=c[s>>2];if(c[q>>2]|0)c[c[q>>2]>>2]=c[t>>2]}else hf(c[s>>2]|0);c[r>>2]=Uh(c[c[o>>2]>>2]|0,c[(c[o>>2]|0)+4>>2]|0,c[u>>2]|0,c[n>>2]|0)|0;Bp(c[(c[o>>2]|0)+8>>2]|0,1)|0;c[l>>2]=c[r>>2];y=c[l>>2]|0;i=k;return y|0}function Xh(b,e){b=b|0;e=e|0;var f=0,g=0,h=0,k=0,l=0;f=i;i=i+16|0;if((i|0)>=(j|0))U();g=f+12|0;h=f+8|0;k=f+4|0;l=f;c[g>>2]=b;c[h>>2]=e;c[l>>2]=0;while(1){if((c[l>>2]|0)>>>0>=(((c[h>>2]|0)>>>0)/2|0)>>>0)break;c[k>>2]=d[(c[g>>2]|0)+(c[l>>2]|0)>>0];a[(c[g>>2]|0)+(c[l>>2]|0)>>0]=a[(c[g>>2]|0)+((c[h>>2]|0)-1-(c[l>>2]|0))>>0]|0;a[(c[g>>2]|0)+((c[h>>2]|0)-1-(c[l>>2]|0))>>0]=c[k>>2];c[l>>2]=(c[l>>2]|0)+1}i=f;return}function Yh(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=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q>>2]|0,c[y>>2]|0,32,0);hf(c[y>>2]|0);c[y>>2]=0;On(t,c[q>>2]|0,(c[l>>2]|0)+20|0,c[m>>2]|0);if(sf(1)|0)en(35735,t,c[m>>2]|0);c[c[k>>2]>>2]=c[c[l>>2]>>2];c[(c[k>>2]|0)+4>>2]=c[(c[l>>2]|0)+4>>2];m=vp(c[(c[l>>2]|0)+8>>2]|0)|0;c[(c[k>>2]|0)+8>>2]=m;m=vp(c[(c[l>>2]|0)+12>>2]|0)|0;c[(c[k>>2]|0)+12>>2]=m;m=vp(c[(c[l>>2]|0)+16>>2]|0)|0;c[(c[k>>2]|0)+16>>2]=m;ln((c[k>>2]|0)+20|0);bi((c[k>>2]|0)+20|0,(c[l>>2]|0)+20|0);m=vp(c[(c[l>>2]|0)+32>>2]|0)|0;c[(c[k>>2]|0)+32>>2]=m;m=vp(c[(c[l>>2]|0)+36>>2]|0)|0;c[(c[k>>2]|0)+36>>2]=m;ln((c[k>>2]|0)+44|0);bi((c[k>>2]|0)+44|0,t);nn(t);z=c[q>>2]|0;Gp(z);A=c[r>>2]|0;Gp(A);B=c[s>>2]|0;Gp(B);C=c[y>>2]|0;hf(C);D=c[o>>2]|0;i=h;return D|0}function _h(){return $h(rt()|0)|0}function $h(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b;c[d>>2]=a;a=ai(1,c[d>>2]|0)|0;i=b;return a|0}function ai(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=i;i=i+16|0;if((i|0)>=(j|0))U();e=d+4|0;f=d;c[e>>2]=a;c[f>>2]=b;if(!(c[f>>2]|0)){g=0;i=d;return g|0}g=(c[e>>2]&127)<<24|c[f>>2]&65535;i=d;return g|0}function bi(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=i;i=i+16|0;if((i|0)>=(j|0))U();e=d+4|0;f=d;c[e>>2]=a;c[f>>2]=b;xp(c[c[e>>2]>>2]|0,c[c[f>>2]>>2]|0)|0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,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0;h=i;i=i+240|0;if((i|0)>=(j|0))U();k=h+172|0;l=h+168|0;m=h+164|0;n=h+160|0;o=h+156|0;p=h+152|0;q=h+148|0;r=h+144|0;s=h+140|0;t=h+136|0;u=h+132|0;v=h+120|0;w=h+116|0;x=h+112|0;y=h+108|0;z=h+104|0;A=h+100|0;B=h+96|0;C=h+92|0;D=h+88|0;E=h+176|0;F=h+40|0;G=h+36|0;H=h+32|0;I=h+20|0;J=h+8|0;K=h+4|0;L=h;c[l>>2]=a;c[m>>2]=b;c[n>>2]=d;c[o>>2]=e;c[p>>2]=f;c[q>>2]=g;c[s>>2]=0;c[w>>2]=0;c[A>>2]=0;if(((c[l>>2]|0?(c[n>>2]|0?(c[(c[l>>2]|0)+12>>2]&4|0)!=0:0):0)?(c[o>>2]|0?(c[(c[n>>2]|0)+12>>2]&4|0)!=0:0):0)?c[(c[o>>2]|0)+12>>2]&4|0:0){if((c[p>>2]|0)!=10){c[k>>2]=5;M=c[k>>2]|0;i=h;return M|0}ln(v);ln(I);ln(J);c[G>>2]=Ep(0)|0;c[H>>2]=Ep(0)|0;c[s>>2]=rn(c[c[m>>2]>>2]|0,c[(c[m>>2]|0)+4>>2]|0,0,c[(c[m>>2]|0)+8>>2]|0,c[(c[m>>2]|0)+12>>2]|0,c[(c[m>>2]|0)+16>>2]|0)|0;c[t>>2]=((c[(c[s>>2]|0)+12>>2]|0)>>>0)/8|0;if((c[t>>2]|0)!=32){c[k>>2]=63;M=c[k>>2]|0;i=h;return M|0}c[r>>2]=Wh(c[q>>2]|0,c[s>>2]|0,v,w,x)|0;a:do if(!(c[r>>2]|0)){if(!(Qn(v,c[s>>2]|0)|0)){c[r>>2]=195;break}if(sf(1)|0)Ne(35756,c[w>>2]|0,c[x>>2]|0);if((c[x>>2]|0)!=(c[t>>2]|0)){c[r>>2]=139;break}c[y>>2]=tp(c[l>>2]|0,u)|0;c[B>>2]=(((c[u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k>>2]|0;i=h;return M|0}c[k>>2]=79;M=c[k>>2]|0;i=h;return M|0}function fi(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b;c[d>>2]=a;qp(c[(c[d>>2]|0)+8>>2]|0);c[(c[d>>2]|0)+8>>2]=0;qp(c[(c[d>>2]|0)+12>>2]|0);c[(c[d>>2]|0)+12>>2]=0;qp(c[(c[d>>2]|0)+16>>2]|0);c[(c[d>>2]|0)+16>>2]=0;nn((c[d>>2]|0)+20|0);qp(c[(c[d>>2]|0)+32>>2]|0);c[(c[d>>2]|0)+32>>2]=0;qp(c[(c[d>>2]|0)+36>>2]|0);c[(c[d>>2]|0)+36>>2]=0;i=b;return}function gi(a,b){a=a|0;b=b|0;var d=0,e=0;d=i;i=i+48|0;if((i|0)>=(j|0))U();e=d;c[e>>2]=c[b>>2];c[e+4>>2]=c[b+4>>2];c[e+40>>2]=c[b+40>>2];c[e+8>>2]=vp(c[b+8>>2]|0)|0;c[e+12>>2]=vp(c[b+12>>2]|0)|0;c[e+16>>2]=vp(c[b+16>>2]|0)|0;ln(e+20|0);hi(e+20|0,b+20|0);c[e+32>>2]=vp(c[b+32>>2]|0)|0;c[e+36>>2]=vp(c[b+36>>2]|0)|0;b=a;a=e;e=b+44|0;do{c[b>>2]=c[a>>2];b=b+4|0;a=a+4|0}while((b|0)<(e|0));i=d;return}function hi(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=i;i=i+16|0;if((i|0)>=(j|0))U();e=d+4|0;f=d;c[e>>2]=a;c[f>>2]=b;xp(c[c[e>>2]>>2]|0,c[c[f>>2]>>2]|0)|0;xp(c[(c[e>>2]|0)+4>>2]|0,c[(c[f>>2]|0)+4>>2]|0)|0;xp(c[(c[e>>2]|0)+8>>2]|0,c[(c[f>>2]|0)+8>>2]|0)|0;i=d;return}function ii(a){a=a|0;var b=0,d=0,e=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b+4|0;e=b;c[d>>2]=a;c[e>>2]=37750;switch(c[d>>2]|0){case 0:{c[e>>2]=35796;break}case 1:{c[e>>2]=45524;break}case 2:{c[e>>2]=35808;break}default:{}}i=b;return c[e>>2]|0}function ji(a){a=a|0;var b=0,d=0,e=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b+4|0;e=b;c[d>>2]=a;c[e>>2]=37750;switch(c[d>>2]|0){case 0:{c[e>>2]=35816;break}case 1:{c[e>>2]=35825;break}default:{}}i=b;return c[e>>2]|0}function ki(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;f=i;i=i+64|0;if((i|0)>=(j|0))U();g=f+16|0;h=f+8|0;k=f;l=f+52|0;m=f+48|0;n=f+44|0;o=f+40|0;p=f+36|0;q=f+32|0;r=f+28|0;s=f+24|0;t=f+20|0;c[l>>2]=b;c[m>>2]=d;c[n>>2]=e;c[p>>2]=(((Zn(c[n>>2]|0)|0)+7|0)>>>0)/8|0;c[r>>2]=mf(1+(c[p>>2]<<1)|0)|0;a[c[r>>2]>>0]=4;c[s>>2]=(c[r>>2]|0)+1;c[o>>2]=Qo(5,c[s>>2]|0,c[p>>2]|0,q,c[l>>2]|0)|0;if(c[o>>2]|0){c[k>>2]=ot(c[o>>2]|0)|0;Je(35833,k)}if((c[q>>2]|0)>>>0<(c[p>>2]|0)>>>0){Qw((c[s>>2]|0)+((c[p>>2]|0)-(c[q>>2]|0))|0,c[s>>2]|0,c[q>>2]|0)|0;Sw(c[s>>2]|0,0,(c[p>>2]|0)-(c[q>>2]|0)|0)|0}c[s>>2]=(c[s>>2]|0)+(c[p>>2]|0);c[o>>2]=Qo(5,c[s>>2]|0,c[p>>2]|0,q,c[m>>2]|0)|0;if(c[o>>2]|0){c[h>>2]=ot(c[o>>2]|0)|0;Je(35833,h)}if((c[q>>2]|0)>>>0<(c[p>>2]|0)>>>0){Qw((c[s>>2]|0)+((c[p>>2]|0)-(c[q>>2]|0))|0,c[s>>2]|0,c[q>>2]|0)|0;Sw(c[s>>2]|0,0,(c[p>>2]|0)-(c[q>>2]|0)|0)|0}c[o>>2]=Mo(t,5,c[r>>2]|0,1+(c[p>>2]<<1)|0,0)|0;if(c[o>>2]|0){c[g>>2]=ot(c[o>>2]|0)|0;Je(35855,g)}else{hf(c[r>>2]|0);i=f;return c[t>>2]|0}return 0}function li(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,k=0;d=i;i=i+32|0;if((i|0)>=(j|0))U();e=d+16|0;f=d+12|0;g=d+8|0;h=d+4|0;k=d;c[e>>2]=a;c[f>>2]=b;c[g>>2]=Ep(0)|0;c[h>>2]=Ep(0)|0;if(fn(c[g>>2]|0,c[h>>2]|0,c[e>>2]|0,c[f>>2]|0)|0)c[k>>2]=0;else c[k>>2]=ki(c[g>>2]|0,c[h>>2]|0,c[(c[f>>2]|0)+16>>2]|0)|0;qp(c[g>>2]|0);qp(c[h>>2]|0);i=d;return c[k>>2]|0}function mi(a,b){a=a|0;b=b|0;var e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;e=i;i=i+48|0;if((i|0)>=(j|0))U();f=e+36|0;g=e+32|0;h=e+28|0;k=e+24|0;l=e+20|0;m=e+16|0;n=e+12|0;o=e+8|0;p=e+4|0;q=e;c[g>>2]=a;c[h>>2]=b;do if(c[h>>2]|0?c[(c[h>>2]|0)+12>>2]&4|0:0){c[m>>2]=tp(c[h>>2]|0,q)|0;if(c[m>>2]|0){c[l>>2]=(((c[q>>2]|0)+7|0)>>>0)/8|0;c[n>>2]=0;break}c[f>>2]=65;r=c[f>>2]|0;i=e;return r|0}else s=6;while(0);do if((s|0)==6){c[l>>2]=(((Zn(c[h>>2]|0)|0)+7|0)>>>0)/8|0;c[n>>2]=mf(c[l>>2]|0)|0;c[k>>2]=Qo(5,c[n>>2]|0,c[l>>2]|0,l,c[h>>2]|0)|0;q=c[n>>2]|0;if(!(c[k>>2]|0)){c[m>>2]=q;break}hf(q);c[f>>2]=c[k>>2];r=c[f>>2]|0;i=e;return r|0}while(0);if((c[l>>2]|0)>>>0<1){hf(c[n>>2]|0);c[f>>2]=65;r=c[f>>2]|0;i=e;return r|0}if((d[c[m>>2]>>0]|0|0)!=4){hf(c[n>>2]|0);c[f>>2]=69;r=c[f>>2]|0;i=e;return r|0}if((((c[l>>2]|0)-1|0)>>>0)%2|0|0){hf(c[n>>2]|0);c[f>>2]=65;r=c[f>>2]|0;i=e;return r|0}c[l>>2]=(((c[l>>2]|0)-1|0)>>>0)/2|0;c[k>>2]=Mo(o,5,(c[m>>2]|0)+1|0,c[l>>2]|0,0)|0;if(c[k>>2]|0){hf(c[n>>2]|0);c[f>>2]=c[k>>2];r=c[f>>2]|0;i=e;return r|0}c[k>>2]=Mo(p,5,(c[m>>2]|0)+1+(c[l>>2]|0)|0,c[l>>2]|0,0)|0;hf(c[n>>2]|0);if(c[k>>2]|0){qp(c[o>>2]|0);c[f>>2]=c[k>>2];r=c[f>>2]|0;i=e;return r|0}else{xp(c[c[g>>2]>>2]|0,c[o>>2]|0)|0;xp(c[(c[g>>2]|0)+4>>2]|0,c[p>>2]|0)|0;Bp(c[(c[g>>2]|0)+8>>2]|0,1)|0;qp(c[o>>2]|0);qp(c[p>>2]|0);c[f>>2]=0;r=c[f>>2]|0;i=e;return r|0}return 0}function ni(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0;f=i;i=i+32|0;if((i|0)>=(j|0))U();g=f+24|0;h=f+20|0;k=f+16|0;l=f+12|0;m=f+8|0;n=f+4|0;o=f;c[h>>2]=a;c[k>>2]=b;c[l>>2]=d;c[m>>2]=e;if(!(c[l>>2]|0))c[l>>2]=c[(c[k>>2]|0)+28>>2];if(!(c[m>>2]|0))c[m>>2]=c[(c[k>>2]|0)+44>>2];if(((c[m>>2]|0)!=0&(c[l>>2]|0)!=0?c[(c[k>>2]|0)+16>>2]|0:0)?c[(c[k>>2]|0)+20>>2]|0:0){if((c[c[k>>2]>>2]|0)==2?(c[(c[k>>2]|0)+24>>2]|0)==0:0){c[g>>2]=0;p=c[g>>2]|0;i=f;return p|0}if((c[(c[k>>2]|0)+4>>2]|0)==1?c[(c[k>>2]|0)+8>>2]&4096|0:0){if(Yh(o,c[m>>2]|0,c[k>>2]|0)|0){c[g>>2]=0;p=c[g>>2]|0;i=f;return p|0}c[n>>2]=Fp(0)|0;Lo(c[n>>2]|0,c[o>>2]|0,32,0);hf(c[o>>2]|0);if(!(c[h>>2]|0))c[h>>2]=kn(0)|0;if(c[h>>2]|0)On(c[h>>2]|0,c[n>>2]|0,c[l>>2]|0,c[k>>2]|0);qp(c[n>>2]|0)}else{if(!(c[h>>2]|0))c[h>>2]=kn(0)|0;if(c[h>>2]|0)On(c[h>>2]|0,c[m>>2]|0,c[l>>2]|0,c[k>>2]|0)}c[g>>2]=c[h>>2];p=c[g>>2]|0;i=f;return p|0}c[g>>2]=0;p=c[g>>2]|0;i=f;return p|0}function oi(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,k=0;e=i;i=i+16|0;if((i|0)>=(j|0))U();f=e+12|0;g=e+8|0;h=e+4|0;k=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;c[k>>2]=0;if(cj(c[f>>2]|0,8,0,0)|0){c[k>>2]=5;if(c[h>>2]|0)Cb[c[h>>2]&1](36136,c[f>>2]|0,37843,36880)}else c[k>>2]=pi(c[f>>2]|0,c[g>>2]|0,c[h>>2]|0)|0;h=wi(c[k>>2]|0)|0;i=e;return h|0}function pi(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,k=0;e=i;i=i+16|0;if((i|0)>=(j|0))U();f=e+12|0;g=e+8|0;h=e+4|0;k=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;switch(c[f>>2]|0){case 2:{c[k>>2]=qi(c[g>>2]|0,c[h>>2]|0)|0;break}case 11:{c[k>>2]=si(c[g>>2]|0,c[h>>2]|0)|0;break}case 8:{c[k>>2]=ti(c[g>>2]|0,c[h>>2]|0)|0;break}case 9:{c[k>>2]=ui(c[g>>2]|0,c[h>>2]|0)|0;break}case 10:{c[k>>2]=vi(c[g>>2]|0,c[h>>2]|0)|0;break}default:c[k>>2]=5}i=e;return c[k>>2]|0}function qi(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0;e=i;i=i+160|0;if((i|0)>=(j|0))U();f=e+24|0;g=e+20|0;h=e+16|0;k=e+12|0;l=e+8|0;m=e+32|0;n=e+4|0;o=e;c[g>>2]=b;c[h>>2]=d;c[k>>2]=35876;c[n>>2]=0;while(1){if((c[n>>2]|0)>=64)break;a[m+(c[n>>2]|0)>>0]=c[n>>2];c[n>>2]=(c[n>>2]|0)+1}c[l>>2]=ri(2,35891,9,m,64,35901,20)|0;do if(!(c[l>>2]|0)){if(c[g>>2]|0){c[k>>2]=35998;c[n>>2]=0;c[o>>2]=48;while(1){if((c[n>>2]|0)>=20)break;d=c[o>>2]|0;c[o>>2]=d+1;a[m+(c[n>>2]|0)>>0]=d;c[n>>2]=(c[n>>2]|0)+1}c[l>>2]=ri(2,36013,9,m,20,36023,20)|0;if(c[l>>2]|0)break;c[k>>2]=36044;c[n>>2]=0;c[o>>2]=80;while(1){if((c[n>>2]|0)>=100)break;d=c[o>>2]|0;c[o>>2]=d+1;a[m+(c[n>>2]|0)>>0]=d;c[n>>2]=(c[n>>2]|0)+1}c[l>>2]=ri(2,36059,9,m,100,36069,20)|0;if(c[l>>2]|0)break;c[k>>2]=36090;c[n>>2]=0;c[o>>2]=112;while(1){if((c[n>>2]|0)>=49)break;d=c[o>>2]|0;c[o>>2]=d+1;a[m+(c[n>>2]|0)>>0]=d;c[n>>2]=(c[n>>2]|0)+1}c[l>>2]=ri(2,36105,9,m,49,36115,20)|0;if(c[l>>2]|0)break}c[f>>2]=0;p=c[f>>2]|0;i=e;return p|0}while(0);if(c[h>>2]|0)Cb[c[h>>2]&1](36136,2,c[k>>2]|0,c[l>>2]|0);c[f>>2]=50;p=c[f>>2]|0;i=e;return p|0}function ri(a,b,d,e,f,g,h){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0;k=i;i=i+48|0;if((i|0)>=(j|0))U();l=k+36|0;m=k+32|0;n=k+28|0;o=k+24|0;p=k+20|0;q=k+16|0;r=k+12|0;s=k+8|0;t=k+4|0;u=k;c[m>>2]=a;c[n>>2]=b;c[o>>2]=d;c[p>>2]=e;c[q>>2]=f;c[r>>2]=g;c[s>>2]=h;h=bj(c[m>>2]|0)|0;if((h|0)!=(c[s>>2]|0)){c[l>>2]=35922;v=c[l>>2]|0;i=k;return v|0}if(Fi(t,c[m>>2]|0,2)|0){c[l>>2]=49750;v=c[l>>2]|0;i=k;return v|0}h=(Ui(c[t>>2]|0,c[p>>2]|0,c[q>>2]|0)|0)!=0;q=c[t>>2]|0;if(h){Ni(q);c[l>>2]=35941;v=c[l>>2]|0;i=k;return v|0}Oi(q,c[n>>2]|0,c[o>>2]|0);c[u>>2]=_i(c[t>>2]|0,c[m>>2]|0)|0;if(!(c[u>>2]|0)){Ni(c[t>>2]|0);c[l>>2]=35963;v=c[l>>2]|0;i=k;return v|0}m=(vv(c[u>>2]|0,c[r>>2]|0,c[s>>2]|0)|0)!=0;Ni(c[t>>2]|0);if(m){c[l>>2]=35983;v=c[l>>2]|0;i=k;return v|0}else{c[l>>2]=0;v=c[l>>2]|0;i=k;return v|0}return 0}function si(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0;d=i;i=i+32|0;if((i|0)>=(j|0))U();e=d+20|0;f=d+16|0;g=d+12|0;h=d+8|0;k=d+4|0;l=d;c[f>>2]=a;c[g>>2]=b;c[l>>2]=0;while(1){if(!(c[2764+((c[l>>2]|0)*40|0)>>2]|0)){m=6;break}c[h>>2]=c[2764+((c[l>>2]|0)*40|0)>>2];b=c[2764+((c[l>>2]|0)*40|0)+4>>2]|0;a=Tu(c[2764+((c[l>>2]|0)*40|0)+4>>2]|0)|0;n=c[2764+((c[l>>2]|0)*40|0)+8>>2]|0;o=Tu(c[2764+((c[l>>2]|0)*40|0)+8>>2]|0)|0;c[k>>2]=ri(11,b,a,n,o,2764+((c[l>>2]|0)*40|0)+12|0,28)|0;if(c[k>>2]|0)break;if(!(c[f>>2]|0)){m=6;break}c[l>>2]=(c[l>>2]|0)+1}if((m|0)==6){c[e>>2]=0;p=c[e>>2]|0;i=d;return p|0}if(c[g>>2]|0)Cb[c[g>>2]&1](36136,11,c[h>>2]|0,c[k>>2]|0);c[e>>2]=50;p=c[e>>2]|0;i=d;return p|0}function ti(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;d=i;i=i+48|0;if((i|0)>=(j|0))U();e=d+32|0;f=d+28|0;g=d+24|0;h=d+20|0;k=d+16|0;l=d+12|0;m=d+8|0;n=d+4|0;o=d;c[f>>2]=a;c[g>>2]=b;c[l>>2]=0;while(1){if(!(c[3044+((c[l>>2]|0)*44|0)>>2]|0)){p=13;break}c[h>>2]=c[3044+((c[l>>2]|0)*44|0)>>2];b=c[3044+((c[l>>2]|0)*44|0)+4>>2]|0;a=Tu(c[3044+((c[l>>2]|0)*44|0)+4>>2]|0)|0;q=c[3044+((c[l>>2]|0)*44|0)+8>>2]|0;r=Tu(c[3044+((c[l>>2]|0)*44|0)+8>>2]|0)|0;c[k>>2]=ri(8,b,a,q,r,3044+((c[l>>2]|0)*44|0)+12|0,32)|0;if(c[k>>2]|0)break;r=c[3044+((c[l>>2]|0)*44|0)+8>>2]|0;c[m>>2]=Lp(r,Tu(c[3044+((c[l>>2]|0)*44|0)+8>>2]|0)|0)|0;if(!(c[m>>2]|0)){p=5;break}r=c[m>>2]|0;q=c[3044+((c[l>>2]|0)*44|0)+4>>2]|0;Mp(r,q,Tu(c[3044+((c[l>>2]|0)*44|0)+4>>2]|0)|0);c[n>>2]=Rp(c[m>>2]|0,o)|0;if(!(c[n>>2]|0)){p=7;break}if((c[o>>2]|0)!=32){p=10;break}if(vv(c[n>>2]|0,3044+((c[l>>2]|0)*44|0)+12|0,32)|0){p=10;break}Qp(c[m>>2]|0);if(!(c[f>>2]|0)){p=13;break}c[l>>2]=(c[l>>2]|0)+1}if((p|0)==5)c[k>>2]=36785;else if((p|0)==7){c[k>>2]=36810;Qp(c[m>>2]|0)}else if((p|0)==10){c[k>>2]=36840;Qp(c[m>>2]|0)}else if((p|0)==13){c[e>>2]=0;s=c[e>>2]|0;i=d;return s|0}if(c[g>>2]|0)Cb[c[g>>2]&1](36136,8,c[h>>2]|0,c[k>>2]|0);c[e>>2]=50;s=c[e>>2]|0;i=d;return s|0}function ui(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0;d=i;i=i+32|0;if((i|0)>=(j|0))U();e=d+20|0;f=d+16|0;g=d+12|0;h=d+8|0;k=d+4|0;l=d;c[f>>2]=a;c[g>>2]=b;c[l>>2]=0;while(1){if(!(c[3352+((c[l>>2]|0)*60|0)>>2]|0)){m=6;break}c[h>>2]=c[3352+((c[l>>2]|0)*60|0)>>2];b=c[3352+((c[l>>2]|0)*60|0)+4>>2]|0;a=Tu(c[3352+((c[l>>2]|0)*60|0)+4>>2]|0)|0;n=c[3352+((c[l>>2]|0)*60|0)+8>>2]|0;o=Tu(c[3352+((c[l>>2]|0)*60|0)+8>>2]|0)|0;c[k>>2]=ri(9,b,a,n,o,3352+((c[l>>2]|0)*60|0)+12|0,48)|0;if(c[k>>2]|0)break;if(!(c[f>>2]|0)){m=6;break}c[l>>2]=(c[l>>2]|0)+1}if((m|0)==6){c[e>>2]=0;p=c[e>>2]|0;i=d;return p|0}if(c[g>>2]|0)Cb[c[g>>2]&1](36136,9,c[h>>2]|0,c[k>>2]|0);c[e>>2]=50;p=c[e>>2]|0;i=d;return p|0}function vi(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0;d=i;i=i+32|0;if((i|0)>=(j|0))U();e=d+20|0;f=d+16|0;g=d+12|0;h=d+8|0;k=d+4|0;l=d;c[f>>2]=a;c[g>>2]=b;c[l>>2]=0;while(1){if(!(c[3772+((c[l>>2]|0)*76|0)>>2]|0)){m=6;break}c[h>>2]=c[3772+((c[l>>2]|0)*76|0)>>2];b=c[3772+((c[l>>2]|0)*76|0)+4>>2]|0;a=Tu(c[3772+((c[l>>2]|0)*76|0)+4>>2]|0)|0;n=c[3772+((c[l>>2]|0)*76|0)+8>>2]|0;o=Tu(c[3772+((c[l>>2]|0)*76|0)+8>>2]|0)|0;c[k>>2]=ri(10,b,a,n,o,3772+((c[l>>2]|0)*76|0)+12|0,64)|0;if(c[k>>2]|0)break;if(!(c[f>>2]|0)){m=6;break}c[l>>2]=(c[l>>2]|0)+1}if((m|0)==6){c[e>>2]=0;p=c[e>>2]|0;i=d;return p|0}if(c[g>>2]|0)Cb[c[g>>2]&1](36136,10,c[h>>2]|0,c[k>>2]|0);c[e>>2]=50;p=c[e>>2]|0;i=d;return p|0}function wi(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b;c[d>>2]=a;a=xi(1,c[d>>2]|0)|0;i=b;return a|0}function xi(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=i;i=i+16|0;if((i|0)>=(j|0))U();e=d+4|0;f=d;c[e>>2]=a;c[f>>2]=b;if(!(c[f>>2]|0)){g=0;i=d;return g|0}g=(c[e>>2]&127)<<24|c[f>>2]&65535;i=d;return g|0}function yi(a){a=a|0;var b=0,d=0,e=0,f=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b+8|0;e=b+4|0;f=b;c[e>>2]=a;do if(c[e>>2]|0){c[f>>2]=zi(c[e>>2]|0,0)|0;if(c[f>>2]|0){c[d>>2]=c[c[f>>2]>>2];break}c[f>>2]=Bi(c[e>>2]|0)|0;if(c[f>>2]|0){c[d>>2]=c[c[f>>2]>>2];break}else{c[d>>2]=0;break}}else c[d>>2]=0;while(0);i=b;return c[d>>2]|0}function zi(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,k=0,l=0;d=i;i=i+32|0;if((i|0)>=(j|0))U();e=d+16|0;f=d+12|0;g=d+8|0;h=d+4|0;k=d;c[f>>2]=a;c[g>>2]=b;do if(c[f>>2]|0){if(rv(c[f>>2]|0,36904,4)|0?rv(c[f>>2]|0,36909,4)|0:0)break;c[f>>2]=(c[f>>2]|0)+4}while(0);c[h>>2]=Ai(c[f>>2]|0)|0;a:do if(c[h>>2]|0?c[(c[h>>2]|0)+20>>2]|0:0){c[k>>2]=0;while(1){if(!(c[(c[(c[h>>2]|0)+20>>2]|0)+(c[k>>2]<<2)>>2]|0))break a;if(!(cv(c[f>>2]|0,c[(c[(c[h>>2]|0)+20>>2]|0)+(c[k>>2]<<2)>>2]|0)|0))break;c[k>>2]=(c[k>>2]|0)+1}if(c[g>>2]|0)c[c[g>>2]>>2]=c[(c[(c[h>>2]|0)+20>>2]|0)+(c[k>>2]<<2)>>2];c[e>>2]=c[h>>2];l=c[e>>2]|0;i=d;return l|0}while(0);c[e>>2]=0;l=c[e>>2]|0;i=d;return l|0}function Ai(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,k=0,l=0,m=0;b=i;i=i+32|0;if((i|0)>=(j|0))U();d=b+20|0;e=b+16|0;f=b+12|0;g=b+8|0;h=b+4|0;k=b;c[e>>2]=a;c[h>>2]=0;a:while(1){a=c[4304+(c[h>>2]<<2)>>2]|0;c[f>>2]=a;if(!a){l=10;break}c[g>>2]=c[(c[f>>2]|0)+20>>2];b:do if(c[g>>2]|0){c[k>>2]=0;while(1){if(!(c[(c[g>>2]|0)+(c[k>>2]<<2)>>2]|0))break b;if(!(cv(c[e>>2]|0,c[(c[g>>2]|0)+(c[k>>2]<<2)>>2]|0)|0)){l=7;break a}c[k>>2]=(c[k>>2]|0)+1}}while(0);c[h>>2]=(c[h>>2]|0)+1}if((l|0)==7){c[d>>2]=c[f>>2];m=c[d>>2]|0;i=b;return m|0}else if((l|0)==10){c[d>>2]=0;m=c[d>>2]|0;i=b;return m|0}return 0}function Bi(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,k=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b+12|0;e=b+8|0;f=b+4|0;g=b;c[e>>2]=a;c[g>>2]=0;while(1){a=c[4304+(c[g>>2]<<2)>>2]|0;c[f>>2]=a;if(!a){h=6;break}if(!(cv(c[e>>2]|0,c[(c[f>>2]|0)+8>>2]|0)|0)){h=4;break}c[g>>2]=(c[g>>2]|0)+1}if((h|0)==4){c[d>>2]=c[f>>2];k=c[d>>2]|0;i=b;return k|0}else if((h|0)==6){c[d>>2]=0;k=c[d>>2]|0;i=b;return k|0}return 0}function Ci(a){a=a|0;var b=0,d=0,e=0,f=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b+4|0;e=b;c[d>>2]=a;c[e>>2]=Di(c[d>>2]|0)|0;if(!(c[e>>2]|0)){f=37750;i=b;return f|0}f=c[(c[e>>2]|0)+8>>2]|0;i=b;return f|0}function Di(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,k=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b+12|0;e=b+8|0;f=b+4|0;g=b;c[e>>2]=a;c[e>>2]=Ei(c[e>>2]|0)|0;c[f>>2]=0;while(1){a=c[4304+(c[f>>2]<<2)>>2]|0;c[g>>2]=a;if(!a){h=6;break}if((c[e>>2]|0)==(c[c[g>>2]>>2]|0)){h=4;break}c[f>>2]=(c[f>>2]|0)+1}if((h|0)==4){c[d>>2]=c[g>>2];k=c[d>>2]|0;i=b;return k|0}else if((h|0)==6){c[d>>2]=0;k=c[d>>2]|0;i=b;return k|0}return 0}function Ei(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b;c[d>>2]=a;i=b;return c[d>>2]|0}function Fi(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,k=0,l=0;e=i;i=i+32|0;if((i|0)>=(j|0))U();f=e+16|0;g=e+12|0;h=e+8|0;k=e+4|0;l=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;if(c[h>>2]&-260|0)c[k>>2]=45;else c[k>>2]=Gi(l,c[g>>2]|0,c[h>>2]|0)|0;c[c[f>>2]>>2]=c[k>>2]|0?0:c[l>>2]|0;i=e;return c[k>>2]|0}function Gi(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;f=i;i=i+48|0;if((i|0)>=(j|0))U();g=f+36|0;h=f+32|0;k=f+28|0;l=f+24|0;m=f+20|0;n=f+16|0;o=f+12|0;p=f+8|0;q=f+4|0;r=f;c[g>>2]=b;c[h>>2]=d;c[k>>2]=e;c[l>>2]=0;c[m>>2]=((c[k>>2]&1|0)!=0^1^1)&1;c[n>>2]=((c[k>>2]&2|0)!=0^1^1)&1;c[o>>2]=c[m>>2]|0?512:1024;c[r>>2]=16+(c[o>>2]|0);c[r>>2]=((((c[r>>2]|0)+8-1|0)>>>0)/8|0)<<3;o=(c[r>>2]|0)+28|0;if(c[m>>2]|0)c[q>>2]=ef(o)|0;else c[q>>2]=bf(o)|0;if(!(c[q>>2]|0))c[l>>2]=pt(c[(fu()|0)>>2]|0)|0;if((c[l>>2]|0)==0?(o=(c[q>>2]|0)+(c[r>>2]|0)|0,c[p>>2]=o,c[c[q>>2]>>2]=o,c[(c[q>>2]|0)+8>>2]=(c[r>>2]|0)-16+1,c[(c[q>>2]|0)+4>>2]=0,o=c[c[q>>2]>>2]|0,c[o>>2]=0,c[o+4>>2]=0,c[o+8>>2]=0,c[o+12>>2]=0,c[o+16>>2]=0,c[o+20>>2]=0,c[o+24>>2]=0,c[c[p>>2]>>2]=c[m>>2]|0?378630161:285677921,c[(c[p>>2]|0)+4>>2]=(c[r>>2]|0)+28,r=(c[p>>2]|0)+12|0,a[r>>0]=a[r>>0]&-2|c[m>>2]&1,m=(c[p>>2]|0)+12|0,a[m>>0]=a[m>>0]&-5|(((c[k>>2]&256|0)!=0^1^1)&1)<<2&255,c[n>>2]|0):0){switch(c[h>>2]|0){case 10:case 9:{c[(c[p>>2]|0)+24>>2]=128;break}case 311:case 308:{c[(c[p>>2]|0)+24>>2]=32;break}default:c[(c[p>>2]|0)+24>>2]=64}n=ef(c[(c[p>>2]|0)+24>>2]<<1)|0;c[(c[p>>2]|0)+20>>2]=n;if(!(c[(c[p>>2]|0)+20>>2]|0)){c[l>>2]=pt(c[(fu()|0)>>2]|0)|0;Hi(c[q>>2]|0)}}if(((c[l>>2]|0)==0?(_m(),c[h>>2]|0):0)?(c[l>>2]=Ki(c[q>>2]|0,c[h>>2]|0)|0,c[l>>2]|0):0)Hi(c[q>>2]|0);if(c[l>>2]|0){s=c[l>>2]|0;i=f;return s|0}c[c[g>>2]>>2]=c[q>>2];s=c[l>>2]|0;i=f;return s|0}function Hi(b){b=b|0;var e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0;e=i;i=i+80|0;if((i|0)>=(j|0))U();f=e+68|0;g=e+64|0;h=e+60|0;k=e+56|0;l=e+52|0;m=e+74|0;n=e+16|0;o=e+48|0;p=e+44|0;q=e+40|0;r=e+73|0;s=e+8|0;t=e+36|0;u=e+32|0;v=e+28|0;w=e+72|0;x=e;y=e+24|0;c[f>>2]=b;if(!(c[f>>2]|0)){i=e;return}if(c[(c[c[f>>2]>>2]|0)+8>>2]|0)Ii(c[f>>2]|0);c[g>>2]=c[(c[c[f>>2]>>2]|0)+16>>2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]=f;c[d+4>>2]=C;i=b;return}function Ji(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,k=0,l=0;e=i;i=i+16|0;if((i|0)>=(j|0))U();f=e+12|0;g=e+8|0;h=e+4|0;k=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;if(c[(c[c[f>>2]>>2]|0)+8>>2]|0){if(c[(c[f>>2]|0)+4>>2]|0?(Jv((c[f>>2]|0)+12|0,c[(c[f>>2]|0)+4>>2]|0,1,c[(c[c[f>>2]>>2]|0)+8>>2]|0)|0)!=1:0)Ee(36914,630,36919);if(c[h>>2]|0?(Jv(c[g>>2]|0,c[h>>2]|0,1,c[(c[c[f>>2]>>2]|0)+8>>2]|0)|0)!=1:0)Ee(36914,632,36919)}c[k>>2]=c[(c[c[f>>2]>>2]|0)+16>>2];while(1){l=(c[f>>2]|0)+4|0;if(!(c[k>>2]|0))break;if(c[l>>2]|0)xb[c[(c[c[k>>2]>>2]|0)+32>>2]&7]((c[k>>2]|0)+16|0,(c[f>>2]|0)+12|0,c[(c[f>>2]|0)+4>>2]|0);xb[c[(c[c[k>>2]>>2]|0)+32>>2]&7]((c[k>>2]|0)+16|0,c[g>>2]|0,c[h>>2]|0);c[k>>2]=c[(c[k>>2]|0)+4>>2]}c[l>>2]=0;i=e;return}function Ki(b,e){b=b|0;e=e|0;var f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;f=i;i=i+48|0;if((i|0)>=(j|0))U();g=f;h=f+32|0;k=f+28|0;l=f+24|0;m=f+20|0;n=f+16|0;o=f+12|0;p=f+8|0;q=f+4|0;c[k>>2]=b;c[l>>2]=e;c[m>>2]=c[c[k>>2]>>2];c[p>>2]=0;c[o>>2]=c[(c[m>>2]|0)+16>>2];while(1){if(!(c[o>>2]|0))break;if((c[c[c[o>>2]>>2]>>2]|0)==(c[l>>2]|0)){r=4;break}c[o>>2]=c[(c[o>>2]|0)+4>>2]}if((r|0)==4){c[h>>2]=0;s=c[h>>2]|0;i=f;return s|0}c[n>>2]=Di(c[l>>2]|0)|0;if(!(c[n>>2]|0)){c[g>>2]=c[l>>2];Le(36928,g);c[p>>2]=5}if(((c[p>>2]|0)==0&(c[l>>2]|0)==1?Jg()|0:0)?(Rg(36967),Pg()|0):0)c[p>>2]=5;do if(!(c[p>>2]|0)){c[q>>2]=24+(c[(c[n>>2]|0)+44>>2]|0)-8;l=c[q>>2]|0;if(a[(c[m>>2]|0)+12>>0]&1|0)c[o>>2]=ef(l)|0;else c[o>>2]=bf(l)|0;if(c[o>>2]|0){c[c[o>>2]>>2]=c[n>>2];c[(c[o>>2]|0)+4>>2]=c[(c[m>>2]|0)+16>>2];c[(c[o>>2]|0)+8>>2]=c[q>>2];c[(c[m>>2]|0)+16>>2]=c[o>>2];vb[c[(c[c[o>>2]>>2]|0)+28>>2]&7]((c[o>>2]|0)+16|0,(d[(c[m>>2]|0)+12>>0]|0)>>>2&1|0?256:0);break}else{c[p>>2]=pt(c[(fu()|0)>>2]|0)|0;break}}while(0);c[h>>2]=c[p>>2];s=c[h>>2]|0;i=f;return s|0}function Li(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,k=0;d=i;i=i+80|0;if((i|0)>=(j|0))U();e=d+16|0;f=d+8|0;g=d+24|0;h=d+20|0;k=d+28|0;c[g>>2]=a;c[h>>2]=b;if(Jg()|0){i=d;return}if(c[(c[c[g>>2]>>2]|0)+8>>2]|0){Le(36976,d);i=d;return}c[17652]=(c[17652]|0)+1;b=c[h>>2]|0;c[f>>2]=c[17652];c[f+4>>2]=b;Cu(k,49,37008,f)|0;f=zv(k,37025)|0;c[(c[c[g>>2]>>2]|0)+8>>2]=f;if(c[(c[c[g>>2]>>2]|0)+8>>2]|0){i=d;return}c[e>>2]=k;Le(37027,e);i=d;return}function Mi(b){b=b|0;var e=0,f=0,g=0;e=i;i=i+16|0;if((i|0)>=(j|0))U();f=e+4|0;g=e;c[f>>2]=b;b=(c[c[f>>2]>>2]|0)+12|0;a[b>>0]=a[b>>0]&-3;c[(c[f>>2]|0)+4>>2]=0;c[g>>2]=c[(c[c[f>>2]>>2]|0)+16>>2];while(1){if(!(c[g>>2]|0))break;Sw((c[g>>2]|0)+16|0,0,c[(c[c[g>>2]>>2]|0)+44>>2]|0)|0;vb[c[(c[c[g>>2]>>2]|0)+28>>2]&7]((c[g>>2]|0)+16|0,(d[(c[c[f>>2]>>2]|0)+12>>0]|0)>>>2&1|0?256:0);c[g>>2]=c[(c[g>>2]|0)+4>>2]}if(!(c[(c[c[f>>2]>>2]|0)+20>>2]|0)){i=e;return}Ji(c[f>>2]|0,c[(c[c[f>>2]>>2]|0)+20>>2]|0,c[(c[c[f>>2]>>2]|0)+24>>2]|0);i=e;return}function Ni(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b;c[d>>2]=a;Hi(c[d>>2]|0);i=b;return}function Oi(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=i;i=i+16|0;if((i|0)>=(j|0))U();f=e+8|0;g=e+4|0;h=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;Ji(c[f>>2]|0,c[g>>2]|0,c[h>>2]|0);i=e;return}function Pi(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,k=0,l=0;f=i;i=i+32|0;if((i|0)>=(j|0))U();g=f+16|0;h=f+12|0;k=f+8|0;l=f;c[g>>2]=a;c[h>>2]=b;c[k>>2]=d;c[f+4>>2]=e;c[l>>2]=0;switch(c[h>>2]|0){case 5:{Qi(c[g>>2]|0);break}case 32:{Li(c[g>>2]|0,c[k>>2]|0);break}case 33:{Ii(c[g>>2]|0);break}default:c[l>>2]=61}i=f;return c[l>>2]|0}function Qi(b){b=b|0;var e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0;e=i;i=i+32|0;if((i|0)>=(j|0))U();f=e+24|0;g=e+20|0;h=e+16|0;k=e+12|0;l=e+8|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function Si(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0;d=i;i=i+32|0;if((i|0)>=(j|0))U();e=d;f=d+16|0;g=d+12|0;h=d+8|0;k=d+4|0;c[g>>2]=a;c[h>>2]=b;c[k>>2]=c[(c[c[g>>2]>>2]|0)+16>>2];if(!(c[h>>2]|0)){if(!(c[k>>2]|0))Ee(36914,816,37175);if(c[(c[k>>2]|0)+4>>2]|0)Le(37136,e);c[f>>2]=wb[c[(c[c[k>>2]>>2]|0)+40>>2]&15]((c[k>>2]|0)+16|0)|0;l=c[f>>2]|0;i=d;return l|0}c[k>>2]=c[(c[c[g>>2]>>2]|0)+16>>2];while(1){if(!(c[k>>2]|0)){m=11;break}n=c[k>>2]|0;if((c[c[c[k>>2]>>2]>>2]|0)==(c[h>>2]|0))break;c[k>>2]=c[n+4>>2]}if((m|0)==11)Ee(36914,816,37175);c[f>>2]=wb[c[(c[n>>2]|0)+40>>2]&15]((c[k>>2]|0)+16|0)|0;l=c[f>>2]|0;i=d;return l|0}function Ti(a){a=a|0;var b=0,d=0,e=0,f=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b+4|0;e=b;c[d>>2]=a;c[e>>2]=Di(c[d>>2]|0)|0;if(!(c[e>>2]|0)){f=0;i=b;return f|0}f=c[(c[e>>2]|0)+24>>2]|0;i=b;return f|0}function Ui(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,k=0;e=i;i=i+16|0;if((i|0)>=(j|0))U();f=e+12|0;g=e+8|0;h=e+4|0;k=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;if(c[(c[c[f>>2]>>2]|0)+20>>2]|0){c[k>>2]=Vi(c[f>>2]|0,c[g>>2]|0,c[h>>2]|0)|0;if(!(c[k>>2]|0))Mi(c[f>>2]|0)}else c[k>>2]=70;i=e;return c[k>>2]|0}function Vi(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,k=0,l=0,m=0,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=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0;f=i;i=i+32|0;if((i|0)>=(j|0))U();g=f;h=f+28|0;k=f+24|0;l=f+20|0;m=f+16|0;n=f+12|0;o=f+8|0;c[h>>2]=a;c[k>>2]=b;c[l>>2]=d;c[m>>2]=e;if((c[h>>2]|0)==2){Kl(c[k>>2]|0,c[l>>2]|0,c[m>>2]|0);i=f;return}if((c[h>>2]|0)==3?(Jg()|0)==0:0){Qk(c[k>>2]|0,c[l>>2]|0,c[m>>2]|0);i=f;return}if(((c[h>>2]|0)==1?Jg()|0:0)?(Rg(36967),Pg()|0):0)Og();c[o>>2]=Gi(n,c[h>>2]|0,0)|0;if(c[o>>2]|0){e=c[h>>2]|0;d=ot(Xi(c[o>>2]|0)|0)|0;c[g>>2]=e;c[g+4>>2]=d;Ke(37183,g)}Ji(c[n>>2]|0,c[l>>2]|0,c[m>>2]|0);Qi(c[n>>2]|0);m=c[k>>2]|0;k=Si(c[n>>2]|0,c[h>>2]|0)|0;Ow(m|0,k|0,Ti(c[h>>2]|0)|0)|0;Hi(c[n>>2]|0);i=f;return}function Xi(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b;c[d>>2]=a;a=Yi(32,c[d>>2]|0)|0;i=b;return a|0}function Yi(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=i;i=i+16|0;if((i|0)>=(j|0))U();e=d+4|0;f=d;c[e>>2]=a;c[f>>2]=b;b=Zi(c[e>>2]|0,c[f>>2]|0)|0;i=d;return b|0}function Zi(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=i;i=i+16|0;if((i|0)>=(j|0))U();e=d+4|0;f=d;c[e>>2]=a;c[f>>2]=b;if(!(c[f>>2]|0)){g=0;i=d;return g|0}g=(c[e>>2]&127)<<24|c[f>>2]&65535;i=d;return g|0}function _i(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=i;i=i+16|0;if((i|0)>=(j|0))U();e=d+4|0;f=d;c[e>>2]=a;c[f>>2]=b;Pi(c[e>>2]|0,5,0,0)|0;b=Si(c[e>>2]|0,c[f>>2]|0)|0;i=d;return b|0}function $i(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;g=i;i=i+48|0;if((i|0)>=(j|0))U();h=g+32|0;k=g+28|0;l=g+24|0;m=g+20|0;n=g+16|0;o=g+12|0;p=g+8|0;q=g+4|0;r=g;c[k>>2]=a;c[l>>2]=b;c[m>>2]=d;c[n>>2]=e;c[o>>2]=f;if((c[n>>2]|0)==0|(c[o>>2]|0)<0){c[h>>2]=45;s=c[h>>2]|0;i=g;return s|0}if(c[l>>2]&-3|0){c[h>>2]=45;s=c[h>>2]|0;i=g;return s|0}c[p>>2]=((c[l>>2]&2|0)!=0^1^1)&1;if((c[p>>2]|0)!=0&(c[o>>2]|0)<1){c[h>>2]=45;s=c[h>>2]|0;i=g;return s|0}if((c[k>>2]|0)!=2|(c[p>>2]|0)!=0){if(((c[k>>2]|0)==1?Jg()|0:0)?(Rg(36967),Pg()|0):0)Og();c[r>>2]=Gi(q,c[k>>2]|0,c[p>>2]|0?2:0)|0;if(c[r>>2]|0){c[h>>2]=c[r>>2];s=c[h>>2]|0;i=g;return s|0}do if(c[p>>2]|0){c[r>>2]=Ui(c[q>>2]|0,(c[(c[n>>2]|0)+12>>2]|0)+(c[(c[n>>2]|0)+4>>2]|0)|0,c[(c[n>>2]|0)+8>>2]|0)|0;if(!(c[r>>2]|0)){c[n>>2]=(c[n>>2]|0)+16;c[o>>2]=(c[o>>2]|0)+-1;break}Hi(c[q>>2]|0);c[h>>2]=c[r>>2];s=c[h>>2]|0;i=g;return s|0}while(0);while(1){t=c[q>>2]|0;if(!(c[o>>2]|0))break;Ji(t,(c[(c[n>>2]|0)+12>>2]|0)+(c[(c[n>>2]|0)+4>>2]|0)|0,c[(c[n>>2]|0)+8>>2]|0);c[n>>2]=(c[n>>2]|0)+16;c[o>>2]=(c[o>>2]|0)+-1}Qi(t);t=c[m>>2]|0;r=Si(c[q>>2]|0,c[k>>2]|0)|0;Ow(t|0,r|0,Ti(c[k>>2]|0)|0)|0;Hi(c[q>>2]|0)}else Ll(c[m>>2]|0,c[n>>2]|0,c[o>>2]|0);c[h>>2]=0;s=c[h>>2]|0;i=g;return s|0}function aj(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b;c[d>>2]=a;a=Ri(c[d>>2]|0)|0;i=b;return a|0}function bj(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b;c[d>>2]=a;a=Ti(c[d>>2]|0)|0;i=b;return a|0}function cj(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0;f=i;i=i+32|0;if((i|0)>=(j|0))U();g=f+24|0;h=f+20|0;k=f+16|0;l=f+12|0;m=f+8|0;n=f+4|0;o=f;c[g>>2]=a;c[h>>2]=b;c[k>>2]=d;c[l>>2]=e;a:do switch(c[h>>2]|0){case 8:{if((c[k>>2]|0)!=0|(c[l>>2]|0)!=0){c[m>>2]=45;break a}else{c[m>>2]=dj(c[g>>2]|0)|0;break a}break}case 10:{c[m>>2]=dj(c[g>>2]|0)|0;if(!(c[m>>2]|0)){c[n>>2]=ej(c[g>>2]|0,o,0)|0;if(c[k>>2]|0?(c[c[l>>2]>>2]|0)>>>0>=(c[o>>2]|0)>>>0:0){Ow(c[k>>2]|0,c[n>>2]|0,c[o>>2]|0)|0;c[c[l>>2]>>2]=c[o>>2];break a}if((c[k>>2]|0)==0&(c[l>>2]|0)!=0){c[c[l>>2]>>2]=c[o>>2];break a}if(c[k>>2]|0){c[m>>2]=66;break a}else{c[m>>2]=45;break a}}break}case 57:{if(c[l>>2]|0)p=c[c[l>>2]>>2]|0;else p=0;c[m>>2]=hj(fj(c[g>>2]|0,p,0)|0)|0;break}default:c[m>>2]=61}while(0);i=f;return c[m>>2]|0}function dj(b){b=b|0;var d=0,e=0,f=0,g=0,h=0;d=i;i=i+16|0;if((i|0)>=(j|0))U();e=d+8|0;f=d+4|0;g=d;c[f>>2]=b;c[g>>2]=Di(c[f>>2]|0)|0;if(c[g>>2]|0?(a[(c[g>>2]|0)+4>>0]&1|0)==0:0){c[e>>2]=0;h=c[e>>2]|0;i=d;return h|0}c[e>>2]=5;h=c[e>>2]|0;i=d;return h|0}function ej(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;e=i;i=i+32|0;if((i|0)>=(j|0))U();f=e;g=e+20|0;h=e+16|0;k=e+12|0;l=e+8|0;m=e+4|0;c[g>>2]=a;c[h>>2]=b;c[k>>2]=d;c[m>>2]=0;c[l>>2]=Di(c[g>>2]|0)|0;if(!(c[l>>2]|0)){c[f>>2]=c[g>>2];Ke(37268,f)}if(c[h>>2]|0)c[c[h>>2]>>2]=c[(c[l>>2]|0)+16>>2];if(!(c[k>>2]|0)){n=c[l>>2]|0;o=n+12|0;p=c[o>>2]|0;c[m>>2]=p;q=c[m>>2]|0;i=e;return q|0}c[c[k>>2]>>2]=c[(c[l>>2]|0)+24>>2];n=c[l>>2]|0;o=n+12|0;p=c[o>>2]|0;c[m>>2]=p;q=c[m>>2]|0;i=e;return q|0}function fj(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;f=i;i=i+32|0;if((i|0)>=(j|0))U();g=f+16|0;h=f+12|0;k=f+8|0;l=f+4|0;m=f;c[g>>2]=b;c[h>>2]=d;c[k>>2]=e;c[l>>2]=0;c[m>>2]=Di(c[g>>2]|0)|0;if((c[m>>2]|0?(a[(c[m>>2]|0)+4>>0]&1|0)==0:0)?c[(c[m>>2]|0)+48>>2]|0:0){c[l>>2]=sb[c[(c[m>>2]|0)+48>>2]&63](c[g>>2]|0,c[h>>2]|0,c[k>>2]|0)|0;n=c[l>>2]|0;o=gj(n)|0;i=f;return o|0}if(c[m>>2]|0)p=(c[(c[m>>2]|0)+48>>2]|0)!=0;else p=0;c[l>>2]=p?5:69;if(!(c[k>>2]|0)){n=c[l>>2]|0;o=gj(n)|0;i=f;return o|0}p=c[k>>2]|0;k=c[g>>2]|0;if(c[m>>2]|0?!(a[(c[m>>2]|0)+4>>0]&1|0):0)q=37821;else q=c[m>>2]|0?37782:37801;Cb[p&1](42986,k,37843,q);n=c[l>>2]|0;o=gj(n)|0;i=f;return o|0}function gj(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b;c[d>>2]=a;a=Zi(1,c[d>>2]|0)|0;i=b;return a|0}function hj(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b;c[d>>2]=a;i=b;return c[d>>2]&65535|0}function ij(){return 0}function jj(){return 0}function kj(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=i;i=i+16|0;if((i|0)>=(j|0))U();e=d+4|0;f=d;c[e>>2]=a;c[f>>2]=b;c[17653]=c[e>>2];c[17654]=c[f>>2];i=d;return}function lj(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,k=0,l=0,m=0;f=i;i=i+32|0;if((i|0)>=(j|0))U();g=f+16|0;h=f+12|0;k=f+8|0;l=f+4|0;m=f;c[g>>2]=a;c[h>>2]=b;c[k>>2]=d;c[l>>2]=e;c[m>>2]=mj(c[g>>2]|0,1,c[h>>2]|0,c[k>>2]|0,c[l>>2]|0)|0;oj(10);i=f;return c[m>>2]|0}function mj(a,b,d,f,g){a=a|0;b=b|0;d=d|0;f=f|0;g=g|0;var h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0;h=i;i=i+96|0;if((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>2]|0)+(c[z>>2]|0)|0))break;c[x>>2]=(c[x>>2]|0)+1}if(!(c[y>>2]|0)){Sn(c[s>>2]|0,c[r>>2]|0,c[z>>2]|0);c[B>>2]=(c[B>>2]|0)+1;Un(c[t>>2]|0,c[s>>2]|0,1);Fo(c[w>>2]|0,c[u>>2]|0,c[t>>2]|0,c[s>>2]|0);if((io(c[w>>2]|0,1)|0)==0?nj(c[s>>2]|0,5,B)|0:0){if(!(_n(c[s>>2]|0,(c[m>>2]|0)-1-(c[n>>2]|0)|0)|0)){F=24;break}if(!(c[p>>2]|0)){F=28;break a}if(!(Bb[c[p>>2]&7](c[q>>2]|0,c[s>>2]|0)|0)){F=28;break a}oj(47)}E=(c[D>>2]|0)+1|0;c[D>>2]=E;if((E|0)==10){oj(46);c[D>>2]=0}}c[z>>2]=(c[z>>2]|0)+2}if((F|0)==24){F=0;oj(10);Le(37445,k)}oj(58)}if((F|0)==28){qp(c[u>>2]|0);qp(c[v>>2]|0);qp(c[w>>2]|0);qp(c[t>>2]|0);qp(c[r>>2]|0);hf(c[C>>2]|0);i=h;return c[s>>2]|0}return 0}function nj(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0;e=i;i=i+64|0;if((i|0)>=(j|0))U();f=e+52|0;g=e+48|0;h=e+44|0;k=e+40|0;l=e+36|0;m=e+32|0;n=e+28|0;o=e+24|0;p=e+20|0;q=e+16|0;r=e+12|0;s=e+8|0;t=e+4|0;u=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;c[k>>2]=ip(c[(c[f>>2]|0)+4>>2]|0)|0;c[l>>2]=ip(c[(c[f>>2]|0)+4>>2]|0)|0;c[m>>2]=ip(c[(c[f>>2]|0)+4>>2]|0)|0;c[n>>2]=ip(c[(c[f>>2]|0)+4>>2]|0)|0;c[o>>2]=hp(2)|0;c[t>>2]=0;c[u>>2]=Zn(c[f>>2]|0)|0;if((c[g>>2]|0)<5)c[g>>2]=5;Un(c[n>>2]|0,c[f>>2]|0,1);c[p>>2]=vp(c[n>>2]|0)|0;c[s>>2]=Ho(c[p>>2]|0)|0;qo(c[p>>2]|0,c[p>>2]|0,c[s>>2]|0);c[q>>2]=0;a:while(1){if((c[q>>2]|0)>>>0>=(c[g>>2]|0)>>>0){v=22;break}d=c[h>>2]|0;c[d>>2]=(c[d>>2]|0)+1;d=c[k>>2]|0;if(c[q>>2]|0){Hp(d,c[u>>2]|0,0);b=(_n(c[k>>2]|0,(c[u>>2]|0)-2|0)|0)!=0;ao(c[k>>2]|0,(c[u>>2]|0)-2|0);if(!b)co(c[k>>2]|0,(c[u>>2]|0)-2|0);if((jo(c[k>>2]|0,c[n>>2]|0)|0)>=0){v=11;break}if((io(c[k>>2]|0,1)|0)<=0){v=11;break}}else Bp(d,2)|0;Fo(c[l>>2]|0,c[k>>2]|0,c[p>>2]|0,c[f>>2]|0);if(io(c[l>>2]|0,1)|0?jo(c[l>>2]|0,c[n>>2]|0)|0:0){c[r>>2]=1;while(1){if((c[r>>2]|0)>>>0<(c[s>>2]|0)>>>0)w=(jo(c[l>>2]|0,c[n>>2]|0)|0)!=0;else w=0;x=c[l>>2]|0;if(!w)break;Fo(x,c[l>>2]|0,c[o>>2]|0,c[f>>2]|0);if(!(io(c[l>>2]|0,1)|0)){v=23;break a}c[r>>2]=(c[r>>2]|0)+1}if(jo(x,c[n>>2]|0)|0){v=23;break}}oj(43);c[q>>2]=(c[q>>2]|0)+1}if((v|0)==11)Fe(37344,37416,951,37427);else if((v|0)==22){c[t>>2]=1;y=c[k>>2]|0;qp(y);z=c[l>>2]|0;qp(z);A=c[m>>2]|0;qp(A);B=c[n>>2]|0;qp(B);C=c[p>>2]|0;qp(C);D=c[o>>2]|0;qp(D);E=c[t>>2]|0;i=e;return E|0}else if((v|0)==23){y=c[k>>2]|0;qp(y);z=c[l>>2]|0;qp(z);A=c[m>>2]|0;qp(A);B=c[n>>2]|0;qp(B);C=c[p>>2]|0;qp(C);D=c[o>>2]|0;qp(D);E=c[t>>2]|0;i=e;return E|0}return 0}function oj(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b;c[d>>2]=a;if(!(c[17653]|0)){i=b;return}tb[c[17653]&15](c[17654]|0,37436,c[d>>2]|0,0,0);i=b;return}function pj(a,b,d,f,g){a=a|0;b=b|0;d=d|0;f=f|0;g=g|0;var h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0;h=i;i=i+48|0;if((i|0)>=(j|0))U();k=h+40|0;l=h+36|0;m=h+32|0;n=h+28|0;o=h+24|0;p=h+20|0;q=h+16|0;r=h+12|0;s=h+8|0;t=h+4|0;u=h;c[l>>2]=a;c[m>>2]=b;c[n>>2]=d;c[o>>2]=f;c[p>>2]=g;c[s>>2]=0;c[q>>2]=0;while(1){g=e[16500+(c[q>>2]<<1)>>1]|0;c[r>>2]=g;v=c[l>>2]|0;if(!g)break;if(ro(v,c[r>>2]|0)|0){w=4;break}c[q>>2]=(c[q>>2]|0)+1}if((w|0)==4){c[k>>2]=((io(c[l>>2]|0,c[r>>2]|0)|0)!=0^1)&1;x=c[k>>2]|0;i=h;return x|0}c[t>>2]=yp(v)|0;c[u>>2]=yp(c[l>>2]|0)|0;Un(c[u>>2]|0,c[l>>2]|0,1);Fo(c[t>>2]|0,c[m>>2]|0,c[u>>2]|0,c[l>>2]|0);qp(c[u>>2]|0);u=(io(c[t>>2]|0,1)|0)!=0;qp(c[t>>2]|0);if(u){oj(46);c[k>>2]=0;x=c[k>>2]|0;i=h;return x|0}if(!(c[o>>2]|0?!(sb[c[o>>2]&63](c[p>>2]|0,2,c[l>>2]|0)|0):0))w=10;do if((w|0)==10?nj(c[l>>2]|0,c[n>>2]|0,s)|0:0){if(c[o>>2]|0?(sb[c[o>>2]&63](c[p>>2]|0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[u>>2]|0,c[l>>2]|0);qp(c[v>>2]|0);if((jo(c[u>>2]|0,c[l>>2]|0)|0)<0)Tn(c[u>>2]|0,c[u>>2]|0,c[t>>2]|0);c[x>>2]=hp(2)|0;c[y>>2]=yp(c[u>>2]|0)|0;Un(c[t>>2]|0,c[t>>2]|0,1);Un(c[u>>2]|0,c[u>>2]|0,1);while(1){c[z>>2]=so(c[y>>2]|0,c[o>>2]|0,c[u>>2]|0)|0;Sn(c[u>>2]|0,c[u>>2]|0,1);if(c[z>>2]|0){if(pj(c[u>>2]|0,c[x>>2]|0,64,0,0)|0)break}else oj(47);Tn(c[u>>2]|0,c[u>>2]|0,c[t>>2]|0)}qp(c[y>>2]|0);qp(c[x>>2]|0);qp(c[t>>2]|0);oj(10);t=c[r>>2]|0;if(c[p>>2]|0)c[c[p>>2]>>2]=t;else qp(t);t=c[s>>2]|0;if(c[q>>2]|0)c[c[q>>2]>>2]=t;else qp(t);c[k>>2]=c[u>>2];A=c[k>>2]|0;i=h;return A|0}c[k>>2]=0;A=c[k>>2]|0;i=h;return A|0}function rj(a){a=a|0;var b=0,d=0,e=0,f=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b+8|0;e=b+4|0;f=b;c[d>>2]=a;c[e>>2]=hp(2)|0;c[f>>2]=vp(c[d>>2]|0)|0;$n(c[f>>2]|0,0);while(1){if(!((pj(c[f>>2]|0,c[e>>2]|0,64,0,0)|0)!=0^1))break;Sn(c[f>>2]|0,c[f>>2]|0,2)}qp(c[e>>2]|0);i=b;return c[f>>2]|0}function sj(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;e=i;i=i+48|0;if((i|0)>=(j|0))U();f=e+36|0;g=e+32|0;h=e+28|0;k=e+24|0;l=e+20|0;m=e+16|0;n=e+12|0;o=e+8|0;p=e+4|0;q=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;c[k>>2]=0;c[o>>2]=5;c[p>>2]=0;c[q>>2]=0;if(c[f>>2]|0)r=(Hf(c[f>>2]|0)|0)-1|0;else r=0;c[n>>2]=r;while(1){if((c[n>>2]|0)<=0)break;c[l>>2]=Kf(c[f>>2]|0,c[n>>2]|0,m)|0;a:do if(c[l>>2]|0)do switch(c[m>>2]|0){case 3:{if((vv(c[l>>2]|0,37475,3)|0)==0&(c[o>>2]|0)==5){c[o>>2]=4;c[p>>2]=c[p>>2]|4;break a}if((vv(c[l>>2]|0,37479,3)|0)==0&(c[o>>2]|0)==5){c[o>>2]=0;c[p>>2]=c[p>>2]|16;break a}if(c[q>>2]|0)break a;c[k>>2]=72;break a;break}case 4:{if(!(vv(c[l>>2]|0,37483,4)|0)){c[p>>2]=c[p>>2]|1024;break a}if((vv(c[l>>2]|0,37488,4)|0)==0&(c[o>>2]|0)==5){c[o>>2]=3;c[p>>2]=c[p>>2]|4;break a}if(!(vv(c[l>>2]|0,46950,4)|0)){c[o>>2]=0;c[p>>2]=c[p>>2]|8192;break a}if(c[q>>2]|0)break a;c[k>>2]=72;break a;break}case 5:{if(!(vv(c[l>>2]|0,46944,5)|0)){c[o>>2]=0;c[p>>2]=c[p>>2]|4096;break a}if((vv(c[l>>2]|0,37493,5)|0)==0&(c[o>>2]|0)==5){c[o>>2]=1;c[p>>2]=c[p>>2]|4;break a}if(!(vv(c[l>>2]|0,37499,5)|0)){c[p>>2]=c[p>>2]|512;break a}if(c[q>>2]|0)break a;c[k>>2]=72;break a;break}case 6:{if(!(vv(c[l>>2]|0,37505,6)|0)){c[p>>2]=c[p>>2]|2048;break a}if(c[q>>2]|0)break a;c[k>>2]=72;break a;break}case 7:{if(!(vv(c[l>>2]|0,37512,7)|0)){c[p>>2]=c[p>>2]|2;break a}if((vv(c[l>>2]|0,37520,7)|0)==0|(c[q>>2]|0)!=0)break a;c[k>>2]=72;break a;break}case 8:{if(!(vv(c[l>>2]|0,39206,8)|0)){c[p>>2]=c[p>>2]|64;break a}if(c[q>>2]|0)break a;c[k>>2]=72;break a;break}case 9:{if((vv(c[l>>2]|0,37528,9)|0)==0&(c[o>>2]|0)==5){c[o>>2]=2;c[p>>2]=c[p>>2]|4;break a}if(c[q>>2]|0)break a;c[k>>2]=72;break a;break}case 10:{if(!(vv(c[l>>2]|0,37538,10)|0)){c[q>>2]=1;break a}if(!(vv(c[l>>2]|0,37549,10)|0)){c[p>>2]=c[p>>2]|16384;break a}if(c[q>>2]|0)break a;c[k>>2]=72;break a;break}case 11:{if(!(vv(c[l>>2]|0,37560,11)|0)){c[p>>2]=c[p>>2]|1;break a}if(!(vv(c[l>>2]|0,37572,11)|0)){c[p>>2]=c[p>>2]|128;break a}if(c[q>>2]|0)break a;c[k>>2]=72;break a;break}case 13:{if(!(vv(c[l>>2]|0,37584,13)|0)){c[p>>2]=c[p>>2]|256;break a}if(!(vv(c[l>>2]|0,46990,13)|0)){c[p>>2]=c[p>>2]|32;break a}if(c[q>>2]|0)break a;c[k>>2]=72;break a;break}default:{if(c[q>>2]|0)break a;c[k>>2]=72;break a}}while(0);while(0);c[n>>2]=(c[n>>2]|0)+-1}if(c[g>>2]|0)c[c[g>>2]>>2]=c[p>>2];if(!(c[h>>2]|0)){s=c[k>>2]|0;i=e;return s|0}c[c[h>>2]>>2]=c[o>>2];s=c[k>>2]|0;i=e;return s|0}function tj(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0;e=i;i=i+80|0;if((i|0)>=(j|0))U();f=e+16|0;g=e+12|0;h=e+8|0;k=e+20|0;l=e+4|0;m=e;c[g>>2]=b;c[h>>2]=d;c[c[h>>2]>>2]=0;c[g>>2]=Gf(c[g>>2]|0,37598,0)|0;if(!(c[g>>2]|0)){c[f>>2]=0;n=c[f>>2]|0;i=e;return n|0}c[l>>2]=Kf(c[g>>2]|0,1,m)|0;if((c[l>>2]|0)==0|(c[m>>2]|0)>>>0>=49){Ef(c[g>>2]|0);c[f>>2]=65;n=c[f>>2]|0;i=e;return n|0}else{Ow(k|0,c[l>>2]|0,c[m>>2]|0)|0;a[k+(c[m>>2]|0)>>0]=0;m=gv(k,0,0)|0;c[c[h>>2]>>2]=m;Ef(c[g>>2]|0);c[f>>2]=0;n=c[f>>2]|0;i=e;return n|0}return 0}function uj(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0;e=i;i=i+80|0;if((i|0)>=(j|0))U();f=e+16|0;g=e+12|0;h=e+8|0;k=e+20|0;l=e+4|0;m=e;c[g>>2]=b;c[h>>2]=d;c[c[h>>2]>>2]=0;c[g>>2]=Gf(c[g>>2]|0,37604,0)|0;if(!(c[g>>2]|0)){c[c[h>>2]>>2]=65537;c[f>>2]=0;n=c[f>>2]|0;i=e;return n|0}c[l>>2]=Kf(c[g>>2]|0,1,m)|0;if((c[l>>2]|0)==0|(c[m>>2]|0)>>>0>=49){Ef(c[g>>2]|0);c[f>>2]=65;n=c[f>>2]|0;i=e;return n|0}else{Ow(k|0,c[l>>2]|0,c[m>>2]|0)|0;a[k+(c[m>>2]|0)>>0]=0;m=gv(k,0,0)|0;c[c[h>>2]>>2]=m;Ef(c[g>>2]|0);c[f>>2]=0;n=c[f>>2]|0;i=e;return n|0}return 0}function vj(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;f=i;i=i+48|0;if((i|0)>=(j|0))U();g=f+32|0;h=f+28|0;k=f+24|0;l=f+20|0;m=f+16|0;n=f+12|0;o=f+8|0;p=f+4|0;q=f;c[g>>2]=a;c[h>>2]=b;c[k>>2]=d;c[l>>2]=e;c[n>>2]=0;c[o>>2]=0;c[p>>2]=0;c[c[k>>2]>>2]=0;if(c[l>>2]|0)c[c[l>>2]>>2]=0;c[n>>2]=Gf(c[g>>2]|0,37614,0)|0;do if(c[n>>2]|0){c[o>>2]=If(c[n>>2]|0,1)|0;if(!(c[o>>2]|0)){c[m>>2]=68;break}c[p>>2]=Nf(c[o>>2]|0,0)|0;if(!(c[p>>2]|0)){c[m>>2]=65;break}if(!(pu(c[p>>2]|0,46984)|0)){Ef(c[o>>2]|0);c[o>>2]=If(c[n>>2]|0,2)|0;if(!(c[o>>2]|0)){c[m>>2]=65;break}hf(c[p>>2]|0);c[p>>2]=Nf(c[o>>2]|0,0)|0;if(!(c[p>>2]|0)){c[m>>2]=65;break}}c[q>>2]=0;while(1){if(!(c[(c[h>>2]|0)+(c[q>>2]<<2)>>2]|0))break;if(!(cv(c[p>>2]|0,c[(c[h>>2]|0)+(c[q>>2]<<2)>>2]|0)|0))break;c[q>>2]=(c[q>>2]|0)+1}if(!(c[(c[h>>2]|0)+(c[q>>2]<<2)>>2]|0)){c[m>>2]=70;break}if(c[l>>2]|0){if(!(pu(c[p>>2]|0,46944)|0))c[c[l>>2]>>2]=4096;if(!(pu(c[p>>2]|0,46950)|0))c[c[l>>2]>>2]=8192}c[c[k>>2]>>2]=c[o>>2];c[o>>2]=0;c[m>>2]=0}else c[m>>2]=65;while(0);hf(c[p>>2]|0);Ef(c[o>>2]|0);Ef(c[n>>2]|0);i=f;return c[m>>2]|0}function wj(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0;f=i;i=i+48|0;if((i|0)>=(j|0))U();g=f+44|0;h=f+40|0;k=f+36|0;l=f+32|0;m=f+28|0;n=f+24|0;o=f+20|0;p=f+16|0;q=f+12|0;r=f+8|0;s=f+4|0;t=f;c[g>>2]=a;c[h>>2]=b;c[k>>2]=d;c[l>>2]=e;c[m>>2]=0;c[n>>2]=0;c[o>>2]=0;c[p>>2]=0;c[r>>2]=0;c[c[k>>2]>>2]=0;c[n>>2]=Gf(c[g>>2]|0,41949,0)|0;do if(c[n>>2]|0){c[o>>2]=If(c[n>>2]|0,1)|0;if(!(c[o>>2]|0)){c[m>>2]=68;break}c[p>>2]=Nf(c[o>>2]|0,0)|0;if(!(c[p>>2]|0)){c[m>>2]=65;break}if(!(pu(c[p>>2]|0,46984)|0)){c[m>>2]=sj(c[o>>2]|0,r,(c[l>>2]|0)+8|0)|0;if(c[m>>2]|0)break;if((c[(c[l>>2]|0)+8>>2]|0)==4){c[m>>2]=70;break}if((c[(c[l>>2]|0)+8>>2]|0)==3){Ef(c[o>>2]|0);c[o>>2]=Gf(c[n>>2]|0,37622,0)|0;if(c[o>>2]|0){c[t>>2]=Kf(c[o>>2]|0,1,q)|0;if(c[t>>2]|0){g=xj(c[t>>2]|0,c[q>>2]|0)|0;c[(c[l>>2]|0)+16>>2]=g;if(!(c[(c[l>>2]|0)+16>>2]|0))c[m>>2]=5}else c[m>>2]=68;if(c[m>>2]|0)break}Ef(c[o>>2]|0);c[o>>2]=Gf(c[n>>2]|0,37706,0)|0;if(c[o>>2]|0){c[t>>2]=Kf(c[o>>2]|0,1,q)|0;do if(c[t>>2]|0){if((c[q>>2]|0)>>>0>0){g=bf(c[q>>2]|0)|0;c[(c[l>>2]|0)+20>>2]=g;if(c[(c[l>>2]|0)+20>>2]|0){Ow(c[(c[l>>2]|0)+20>>2]|0,c[t>>2]|0,c[q>>2]|0)|0;c[(c[l>>2]|0)+24>>2]=c[q>>2];break}else{c[m>>2]=rt()|0;break}}}else c[m>>2]=68;while(0);if(c[m>>2]|0)break}}c[s>>2]=2;a:while(1){Ef(c[o>>2]|0);g=If(c[n>>2]|0,c[s>>2]|0)|0;c[o>>2]=g;if(!g)break;c[t>>2]=Kf(c[o>>2]|0,0,q)|0;if(!((c[q>>2]|0)==9?!(vv(c[t>>2]|0,37622,9)|0):0))u=30;do if((u|0)==30){u=0;if((c[q>>2]|0)==5?(vv(c[t>>2]|0,37706,5)|0)==0:0)break;if((c[q>>2]|0)!=15)break a;if(vv(c[t>>2]|0,37712,15)|0)break a}while(0);c[s>>2]=(c[s>>2]|0)+1}if(!(c[o>>2]|0)){c[m>>2]=68;break}hf(c[p>>2]|0);c[p>>2]=Nf(c[o>>2]|0,0)|0;if(!(c[p>>2]|0)){c[m>>2]=65;break}}else c[r>>2]=c[r>>2]|8;c[s>>2]=0;while(1){if(!(c[(c[h>>2]|0)+(c[s>>2]<<2)>>2]|0))break;if(!(cv(c[p>>2]|0,c[(c[h>>2]|0)+(c[s>>2]<<2)>>2]|0)|0))break;c[s>>2]=(c[s>>2]|0)+1}if(c[(c[h>>2]|0)+(c[s>>2]<<2)>>2]|0){c[c[k>>2]>>2]=c[o>>2];c[o>>2]=0;g=(c[l>>2]|0)+12|0;c[g>>2]=c[g>>2]|c[r>>2];c[m>>2]=0;break}else{c[m>>2]=70;break}}else c[m>>2]=65;while(0);hf(c[p>>2]|0);Ef(c[o>>2]|0);Ef(c[n>>2]|0);i=f;return c[m>>2]|0}function xj(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,k=0,l=0,m=0;e=i;i=i+32|0;if((i|0)>=(j|0))U();f=e+16|0;g=e+12|0;h=e+8|0;k=e+4|0;l=e;c[f>>2]=b;c[g>>2]=d;c[k>>2]=0;while(1){if(!(c[4336+(c[k>>2]<<3)>>2]|0))break;d=Tu(c[4336+(c[k>>2]<<3)>>2]|0)|0;if((d|0)==(c[g>>2]|0)?(vv(c[4336+(c[k>>2]<<3)>>2]|0,c[f>>2]|0,c[g>>2]|0)|0)==0:0)break;c[k>>2]=(c[k>>2]|0)+1}if(c[4336+(c[k>>2]<<3)>>2]|0){c[h>>2]=c[4336+(c[k>>2]<<3)+4>>2];m=c[h>>2]|0;i=e;return m|0}c[l>>2]=bf((c[g>>2]|0)+1|0)|0;if(c[l>>2]|0){Ow(c[l>>2]|0,c[f>>2]|0,c[g>>2]|0)|0;a[(c[l>>2]|0)+(c[g>>2]|0)>>0]=0;c[h>>2]=yi(c[l>>2]|0)|0;hf(c[l>>2]|0);m=c[h>>2]|0;i=e;return m|0}else{c[h>>2]=0;m=c[h>>2]|0;i=e;return m|0}return 0}function yj(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=i;i=i+16|0;if((i|0)>=(j|0))U();f=e+8|0;g=e+4|0;h=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;c[c[f>>2]>>2]=c[g>>2];c[(c[f>>2]|0)+4>>2]=c[h>>2];c[(c[f>>2]|0)+8>>2]=5;c[(c[f>>2]|0)+12>>2]=0;c[(c[f>>2]|0)+16>>2]=2;c[(c[f>>2]|0)+20>>2]=0;c[(c[f>>2]|0)+24>>2]=0;c[(c[f>>2]|0)+28>>2]=20;c[(c[f>>2]|0)+32>>2]=0;c[(c[f>>2]|0)+36>>2]=0;i=e;return}function zj(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b;c[d>>2]=a;hf(c[(c[d>>2]|0)+20>>2]|0);i=b;return}function Aj(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0;e=i;i=i+160|0;if((i|0)>=(j|0))U();f=e+144|0;g=e+140|0;h=e+136|0;k=e+132|0;l=e+128|0;m=e+124|0;n=e+120|0;o=e+116|0;p=e+112|0;q=e+108|0;r=e+104|0;s=e+100|0;t=e+96|0;u=e+92|0;v=e+88|0;w=e+84|0;x=e+80|0;y=e+76|0;z=e+72|0;A=e+68|0;B=e+64|0;C=e+60|0;D=e+56|0;E=e+52|0;F=e+48|0;G=e+44|0;H=e+40|0;I=e+36|0;J=e+32|0;K=e+28|0;L=e+24|0;M=e+20|0;N=e+16|0;O=e+12|0;P=e+8|0;Q=e+4|0;R=e;c[g>>2]=a;c[h>>2]=b;c[k>>2]=d;c[l>>2]=0;c[r>>2]=0;c[s>>2]=0;c[c[h>>2]>>2]=0;c[m>>2]=Gf(c[g>>2]|0,37728,0)|0;if(!(c[m>>2]|0)){d=Of(c[g>>2]|0,0,0)|0;c[c[h>>2]>>2]=d;c[f>>2]=c[c[h>>2]>>2]|0?0:65;S=c[f>>2]|0;i=e;return S|0}c[t>>2]=Gf(c[m>>2]|0,46984,0)|0;if(c[t>>2]|0){if(sj(c[t>>2]|0,s,(c[k>>2]|0)+8|0)|0)c[r>>2]=1;Ef(c[t>>2]|0)}if((c[(c[k>>2]|0)+8>>2]|0)==5)c[(c[k>>2]|0)+8>>2]=0;c[n>>2]=Gf(c[m>>2]|0,37733,0)|0;if(c[n>>2]|0)T=0;else T=Gf(c[m>>2]|0,42034,0)|0;c[o>>2]=T;a:do if(((c[n>>2]|0)!=0^1)&1^((c[o>>2]|0)!=0^1)&1|0){if(c[r>>2]|0){c[l>>2]=72;break}if((c[(c[k>>2]|0)+8>>2]|0)==0?c[s>>2]&4096|0:0){if(!(c[o>>2]|0)){c[l>>2]=65;break}c[u>>2]=Gf(c[m>>2]|0,37622,0)|0;if(c[u>>2]|0){c[q>>2]=Kf(c[u>>2]|0,1,p)|0;if(c[q>>2]|0){T=xj(c[q>>2]|0,c[p>>2]|0)|0;c[(c[k>>2]|0)+16>>2]=T;if(!(c[(c[k>>2]|0)+16>>2]|0))c[l>>2]=5}else c[l>>2]=68;Ef(c[u>>2]|0)}else c[l>>2]=65;if(c[l>>2]|0)break;c[v>>2]=Mf(c[o>>2]|0,1,w)|0;if(c[v>>2]|0){if(c[w>>2]<<3>>>0<(c[w>>2]|0)>>>0){hf(c[v>>2]|0);c[l>>2]=67}}else{c[w>>2]=0;c[v>>2]=bf(1)|0;if(!(c[v>>2]|0))c[l>>2]=rt()|0}if(c[l>>2]|0)break;T=rp(0,c[v>>2]|0,c[w>>2]<<3)|0;c[c[h>>2]>>2]=T;break}do if(c[n>>2]|0?(c[(c[k>>2]|0)+8>>2]|0)==0:0){if((c[s>>2]&16|0)==0?(c[s>>2]&2|0)==0:0)break;if((Hf(c[n>>2]|0)|0)!=3){c[l>>2]=65;break a}T=Kf(c[n>>2]|0,1,p)|0;c[q>>2]=T;if(!((T|0)!=0&(c[p>>2]|0)!=0)){c[l>>2]=65;break a}T=xj(c[q>>2]|0,c[p>>2]|0)|0;c[(c[k>>2]|0)+16>>2]=T;if(!(c[(c[k>>2]|0)+16>>2]|0)){c[l>>2]=5;break a}T=Mf(c[n>>2]|0,2,y)|0;c[x>>2]=T;if(!T){c[l>>2]=65;break a}T=c[x>>2]|0;if(c[y>>2]<<3>>>0<(c[y>>2]|0)>>>0){hf(T);c[l>>2]=67;break a}else{t=rp(0,T,c[y>>2]<<3)|0;c[c[h>>2]>>2]=t;break a}}while(0);if(c[o>>2]|0?(c[(c[k>>2]|0)+8>>2]|0)==0:0){if(c[s>>2]&2|0){c[l>>2]=70;break}t=Of(c[o>>2]|0,1,5)|0;c[c[h>>2]>>2]=t;if(c[c[h>>2]>>2]|0)break;c[l>>2]=65;break}if((c[o>>2]|0?(c[(c[k>>2]|0)+8>>2]|0)==1:0)?(c[c[k>>2]>>2]|0)==0:0){c[C>>2]=0;c[D>>2]=0;t=Kf(c[o>>2]|0,1,A)|0;c[z>>2]=t;if(!((t|0)!=0&(c[A>>2]|0)!=0)){c[l>>2]=65;break}c[B>>2]=Gf(c[m>>2]|0,37712,0)|0;if(c[B>>2]|0){c[q>>2]=Kf(c[B>>2]|0,1,p)|0;do if(c[q>>2]|0){if((c[p>>2]|0)>>>0>0){c[C>>2]=bf(c[p>>2]|0)|0;if(c[C>>2]|0){Ow(c[C>>2]|0,c[q>>2]|0,c[p>>2]|0)|0;c[D>>2]=c[p>>2];break}else{c[l>>2]=rt()|0;break}}}else c[l>>2]=68;while(0);Ef(c[B>>2]|0);if(c[l>>2]|0)break}c[l>>2]=Rk(c[h>>2]|0,c[(c[k>>2]|0)+4>>2]|0,c[z>>2]|0,c[A>>2]|0,c[C>>2]|0,c[D>>2]|0)|0;hf(c[C>>2]|0);break}do if(c[n>>2]|0?(c[(c[k>>2]|0)+8>>2]|0)==1:0){if((c[c[k>>2]>>2]|0)!=2?(c[c[k>>2]>>2]|0)!=3:0)break;if((Hf(c[n>>2]|0)|0)!=3){c[l>>2]=65;break a}t=Kf(c[n>>2]|0,1,p)|0;c[q>>2]=t;if(!((t|0)!=0&(c[p>>2]|0)!=0)){c[l>>2]=65;break a}t=xj(c[q>>2]|0,c[p>>2]|0)|0;c[(c[k>>2]|0)+16>>2]=t;if(!(c[(c[k>>2]|0)+16>>2]|0)){c[l>>2]=5;break a}t=Kf(c[n>>2]|0,2,F)|0;c[E>>2]=t;if((t|0)!=0&(c[F>>2]|0)!=0){c[l>>2]=Vk(c[h>>2]|0,c[(c[k>>2]|0)+4>>2]|0,c[E>>2]|0,c[F>>2]|0,c[(c[k>>2]|0)+16>>2]|0)|0;break a}else{c[l>>2]=65;break a}}while(0);do if(c[o>>2]|0?(c[(c[k>>2]|0)+8>>2]|0)==2:0){if((c[c[k>>2]>>2]|0)!=2?(c[c[k>>2]>>2]|0)!=3:0)break;if((Hf(c[o>>2]|0)|0)!=2){c[l>>2]=65;break a}t=Kf(c[o>>2]|0,1,H)|0;c[G>>2]=t;if((t|0)!=0&(c[H>>2]|0)!=0){c[l>>2]=Wk(c[h>>2]|0,c[(c[k>>2]|0)+4>>2]|0,c[G>>2]|0,c[H>>2]|0)|0;break a}else{c[l>>2]=65;break a}}while(0);if((c[o>>2]|0?(c[(c[k>>2]|0)+8>>2]|0)==3:0)?(c[c[k>>2]>>2]|0)==0:0){t=Kf(c[o>>2]|0,1,J)|0;c[I>>2]=t;if(!((t|0)!=0&(c[J>>2]|0)!=0)){c[l>>2]=65;break}c[L>>2]=0;c[M>>2]=0;c[K>>2]=Gf(c[m>>2]|0,37622,0)|0;if(c[K>>2]|0){c[q>>2]=Kf(c[K>>2]|0,1,p)|0;do if(c[q>>2]|0){t=xj(c[q>>2]|0,c[p>>2]|0)|0;c[(c[k>>2]|0)+16>>2]=t;if(c[(c[k>>2]|0)+16>>2]|0)break;c[l>>2]=5}else c[l>>2]=68;while(0);Ef(c[K>>2]|0);if(c[l>>2]|0)break}c[K>>2]=Gf(c[m>>2]|0,37706,0)|0;if(c[K>>2]|0){c[q>>2]=Kf(c[K>>2]|0,1,p)|0;do if(c[q>>2]|0){if((c[p>>2]|0)>>>0<=0)break;t=bf(c[p>>2]|0)|0;c[(c[k>>2]|0)+20>>2]=t;if(c[(c[k>>2]|0)+20>>2]|0){Ow(c[(c[k>>2]|0)+20>>2]|0,c[q>>2]|0,c[p>>2]|0)|0;c[(c[k>>2]|0)+24>>2]=c[p>>2];break}else{c[l>>2]=rt()|0;break}}else c[l>>2]=68;while(0);Ef(c[K>>2]|0);if(c[l>>2]|0)break}c[K>>2]=Gf(c[m>>2]|0,37712,0)|0;if(c[K>>2]|0){c[q>>2]=Kf(c[K>>2]|0,1,p)|0;do if(c[q>>2]|0){if((c[p>>2]|0)>>>0<=0)break;c[L>>2]=bf(c[p>>2]|0)|0;if(c[L>>2]|0){Ow(c[L>>2]|0,c[q>>2]|0,c[p>>2]|0)|0;c[M>>2]=c[p>>2];break}else{c[l>>2]=rt()|0;break}}else c[l>>2]=68;while(0);Ef(c[K>>2]|0);if(c[l>>2]|0)break}c[l>>2]=Xk(c[h>>2]|0,c[(c[k>>2]|0)+4>>2]|0,c[(c[k>>2]|0)+16>>2]|0,c[I>>2]|0,c[J>>2]|0,c[(c[k>>2]|0)+20>>2]|0,c[(c[k>>2]|0)+24>>2]|0,c[L>>2]|0,c[M>>2]|0)|0;hf(c[L>>2]|0);break}if((c[n>>2]|0?(c[(c[k>>2]|0)+8>>2]|0)==4:0)?(c[c[k>>2]>>2]|0)==2:0){if((Hf(c[n>>2]|0)|0)!=3){c[l>>2]=65;break}t=Kf(c[n>>2]|0,1,p)|0;c[q>>2]=t;if(!((t|0)!=0&(c[p>>2]|0)!=0)){c[l>>2]=65;break}c[P>>2]=0;c[Q>>2]=0;t=xj(c[q>>2]|0,c[p>>2]|0)|0;c[(c[k>>2]|0)+16>>2]=t;if(!(c[(c[k>>2]|0)+16>>2]|0)){c[l>>2]=5;break}t=Kf(c[n>>2]|0,2,O)|0;c[N>>2]=t;if(!((t|0)!=0&(c[O>>2]|0)!=0)){c[l>>2]=65;break}c[R>>2]=Gf(c[m>>2]|0,37738,0)|0;do if(c[R>>2]|0){c[q>>2]=Kf(c[R>>2]|0,1,p)|0;if(c[q>>2]|0){t=gv(c[q>>2]|0,0,10)|0;c[(c[k>>2]|0)+28>>2]=t;Ef(c[R>>2]|0);break}else{c[l>>2]=68;break a}}while(0);c[R>>2]=Gf(c[m>>2]|0,37712,0)|0;if(c[R>>2]|0){c[q>>2]=Kf(c[R>>2]|0,1,p)|0;do if(c[q>>2]|0){if((c[p>>2]|0)>>>0<=0)break;c[P>>2]=bf(c[p>>2]|0)|0;if(c[P>>2]|0){Ow(c[P>>2]|0,c[q>>2]|0,c[p>>2]|0)|0;c[Q>>2]=c[p>>2];break}else{c[l>>2]=rt()|0;break}}else c[l>>2]=68;while(0);Ef(c[R>>2]|0);if(c[l>>2]|0)break}c[l>>2]=$k(c[h>>2]|0,(c[(c[k>>2]|0)+4>>2]|0)-1|0,c[(c[k>>2]|0)+16>>2]|0,c[N>>2]|0,c[O>>2]|0,c[(c[k>>2]|0)+28>>2]|0,c[P>>2]|0,c[Q>>2]|0)|0;hf(c[P>>2]|0);break}if((c[n>>2]|0?(c[(c[k>>2]|0)+8>>2]|0)==4:0)?(c[c[k>>2]>>2]|0)==3:0){if((Hf(c[n>>2]|0)|0)!=3){c[l>>2]=65;break}t=Kf(c[n>>2]|0,1,p)|0;c[q>>2]=t;if(!((t|0)!=0&(c[p>>2]|0)!=0)){c[l>>2]=65;break}t=xj(c[q>>2]|0,c[p>>2]|0)|0;c[(c[k>>2]|0)+16>>2]=t;if(!(c[(c[k>>2]|0)+16>>2]|0)){c[l>>2]=5;break}t=Of(c[n>>2]|0,2,5)|0;c[c[h>>2]>>2]=t;if(!(c[c[h>>2]>>2]|0))c[l>>2]=65;c[(c[k>>2]|0)+32>>2]=5;c[(c[k>>2]|0)+36>>2]=c[c[h>>2]>>2];break}c[l>>2]=70}else c[l>>2]=65;while(0);Ef(c[m>>2]|0);Ef(c[n>>2]|0);Ef(c[o>>2]|0);if(c[l>>2]|0){hf(c[(c[k>>2]|0)+20>>2]|0);c[(c[k>>2]|0)+20>>2]=0}else c[(c[k>>2]|0)+12>>2]=c[s>>2];c[f>>2]=c[l>>2];S=c[f>>2]|0;i=e;return S|0}function Bj(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;d=i;i=i+16|0;if((i|0)>=(j|0))U();e=d+12|0;f=d+8|0;g=d+4|0;h=d;c[e>>2]=a;c[f>>2]=b;c[g>>2]=c[e>>2];c[h>>2]=c[(c[g>>2]|0)+36>>2];e=al(c[h>>2]|0,c[f>>2]|0,(c[(c[g>>2]|0)+4>>2]|0)-1|0,c[(c[g>>2]|0)+16>>2]|0,c[(c[g>>2]|0)+28>>2]|0)|0;i=d;return e|0}function Cj(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,k=0,l=0,m=0;b=i;i=i+32|0;if((i|0)>=(j|0))U();d=b+16|0;e=b+12|0;f=b+8|0;g=b+4|0;h=b;c[e>>2]=a;c[g>>2]=0;a:while(1){a=c[4440+(c[g>>2]<<2)>>2]|0;c[f>>2]=a;if(!a){k=11;break}a=(cv(c[e>>2]|0,c[(c[f>>2]|0)+12>>2]|0)|0)!=0;l=c[f>>2]|0;if(!a){k=4;break}c[h>>2]=c[l+16>>2];while(1){if(!(c[c[h>>2]>>2]|0))break;if(!(cv(c[e>>2]|0,c[c[h>>2]>>2]|0)|0)){k=8;break a}c[h>>2]=(c[h>>2]|0)+4}c[g>>2]=(c[g>>2]|0)+1}if((k|0)==4){c[d>>2]=l;m=c[d>>2]|0;i=b;return m|0}else if((k|0)==8){c[d>>2]=c[f>>2];m=c[d>>2]|0;i=b;return m|0}else if((k|0)==11){c[d>>2]=0;m=c[d>>2]|0;i=b;return m|0}return 0}function Dj(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b+8|0;e=b+4|0;f=b;c[e>>2]=a;c[f>>2]=Ej(c[e>>2]|0)|0;if(c[f>>2]|0){c[d>>2]=c[(c[f>>2]|0)+12>>2];g=c[d>>2]|0;i=b;return g|0}else{c[d>>2]=37750;g=c[d>>2]|0;i=b;return g|0}return 0}function Ej(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,k=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b+12|0;e=b+8|0;f=b+4|0;g=b;c[e>>2]=a;c[e>>2]=Fj(c[e>>2]|0)|0;c[f>>2]=0;while(1){a=c[4440+(c[f>>2]<<2)>>2]|0;c[g>>2]=a;if(!a){h=6;break}if((c[e>>2]|0)==(c[c[g>>2]>>2]|0)){h=4;break}c[f>>2]=(c[f>>2]|0)+1}if((h|0)==4){c[d>>2]=c[g>>2];k=c[d>>2]|0;i=b;return k|0}else if((h|0)==6){c[d>>2]=0;k=c[d>>2]|0;i=b;return k|0}return 0}function Fj(a){a=a|0;var b=0,d=0,e=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b+4|0;e=b;c[e>>2]=a;switch(c[e>>2]|0){case 2:{c[d>>2]=1;break}case 3:{c[d>>2]=1;break}case 16:{c[d>>2]=20;break}case 301:{c[d>>2]=18;break}case 302:{c[d>>2]=18;break}default:c[d>>2]=c[e>>2]}i=b;return c[d>>2]|0}function Gj(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,k=0,l=0,m=0;e=i;i=i+32|0;if((i|0)>=(j|0))U();f=e+20|0;g=e+16|0;h=e+12|0;k=e+8|0;l=e+4|0;m=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;c[c[f>>2]>>2]=0;c[k>>2]=Hj(c[h>>2]|0,0,l,m)|0;do if(!(c[k>>2]|0))if(c[(c[l>>2]|0)+48>>2]|0){c[k>>2]=sb[c[(c[l>>2]|0)+48>>2]&63](c[f>>2]|0,c[g>>2]|0,c[m>>2]|0)|0;break}else{c[k>>2]=69;break}while(0);Ef(c[m>>2]|0);i=e;return c[k>>2]|0}function Hj(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;f=i;i=i+48|0;if((i|0)>=(j|0))U();g=f+32|0;h=f+28|0;k=f+24|0;l=f+20|0;m=f+16|0;n=f+12|0;o=f+8|0;p=f+4|0;q=f;c[h>>2]=a;c[k>>2]=b;c[l>>2]=d;c[m>>2]=e;c[c[l>>2]>>2]=0;if(c[m>>2]|0)c[c[m>>2]>>2]=0;c[n>>2]=Gf(c[h>>2]|0,c[k>>2]|0?37752:37764,0)|0;if(!((c[n>>2]|0)!=0|(c[k>>2]|0)!=0))c[n>>2]=Gf(c[h>>2]|0,37752,0)|0;if(!(c[n>>2]|0)){c[g>>2]=65;r=c[g>>2]|0;i=f;return r|0}c[o>>2]=Qf(c[n>>2]|0)|0;Ef(c[n>>2]|0);c[n>>2]=c[o>>2];c[p>>2]=Nf(c[n>>2]|0,0)|0;if(!(c[p>>2]|0)){Ef(c[n>>2]|0);c[g>>2]=65;r=c[g>>2]|0;i=f;return r|0}c[q>>2]=Cj(c[p>>2]|0)|0;hf(c[p>>2]|0);if(!(c[q>>2]|0)){Ef(c[n>>2]|0);c[g>>2]=4;r=c[g>>2]|0;i=f;return r|0}c[c[l>>2]>>2]=c[q>>2];q=c[n>>2]|0;if(c[m>>2]|0)c[c[m>>2]>>2]=q;else Ef(q);c[g>>2]=0;r=c[g>>2]|0;i=f;return r|0}function Ij(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,k=0,l=0,m=0;e=i;i=i+32|0;if((i|0)>=(j|0))U();f=e+20|0;g=e+16|0;h=e+12|0;k=e+8|0;l=e+4|0;m=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;c[c[f>>2]>>2]=0;c[k>>2]=Hj(c[h>>2]|0,1,l,m)|0;do if(!(c[k>>2]|0))if(c[(c[l>>2]|0)+52>>2]|0){c[k>>2]=sb[c[(c[l>>2]|0)+52>>2]&63](c[f>>2]|0,c[g>>2]|0,c[m>>2]|0)|0;break}else{c[k>>2]=69;break}while(0);Ef(c[m>>2]|0);i=e;return c[k>>2]|0}function Jj(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,k=0,l=0,m=0;e=i;i=i+32|0;if((i|0)>=(j|0))U();f=e+20|0;g=e+16|0;h=e+12|0;k=e+8|0;l=e+4|0;m=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;c[c[f>>2]>>2]=0;c[k>>2]=Hj(c[h>>2]|0,1,l,m)|0;do if(!(c[k>>2]|0))if(c[(c[l>>2]|0)+56>>2]|0){c[k>>2]=sb[c[(c[l>>2]|0)+56>>2]&63](c[f>>2]|0,c[g>>2]|0,c[m>>2]|0)|0;break}else{c[k>>2]=69;break}while(0);Ef(c[m>>2]|0);i=e;return c[k>>2]|0}function Kj(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,k=0,l=0,m=0;e=i;i=i+32|0;if((i|0)>=(j|0))U();f=e+20|0;g=e+16|0;h=e+12|0;k=e+8|0;l=e+4|0;m=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;c[k>>2]=Hj(c[h>>2]|0,0,l,m)|0;do if(!(c[k>>2]|0))if(c[(c[l>>2]|0)+60>>2]|0){c[k>>2]=sb[c[(c[l>>2]|0)+60>>2]&63](c[f>>2]|0,c[g>>2]|0,c[m>>2]|0)|0;break}else{c[k>>2]=69;break}while(0);Ef(c[m>>2]|0);i=e;return c[k>>2]|0}
+function Vo(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,S=0,T=0,V=0,W=0,X=0,Y=0,Z=0,_=0,$=0,aa=0,ba=0,ca=0,da=0,ea=0,fa=0,ga=0,ha=0,ia=0,ja=0,ka=0,la=0,ma=0,na=0,oa=0,pa=0,qa=0,ra=0,sa=0,ta=0,ua=0,va=0,wa=0,xa=0,ya=0,za=0,Aa=0,Ba=0,Ca=0,Da=0,Ea=0,Fa=0,Ga=0,Ha=0,Ia=0,Ja=0,Ka=0,La=0,Ma=0,Na=0;h=i;i=i+320|0;if((i|0)>=(j|0))U();k=h+316|0;l=h+312|0;m=h+308|0;n=h+304|0;o=h+300|0;p=h+296|0;q=h+292|0;r=h+288|0;s=h+284|0;t=h+280|0;u=h+276|0;v=h+272|0;w=h+268|0;x=h+264|0;y=h+260|0;z=h+256|0;A=h+252|0;B=h+248|0;C=h+244|0;D=h+240|0;E=h+236|0;F=h+232|0;G=h+228|0;H=h+224|0;I=h+220|0;J=h+216|0;K=h+212|0;L=h+208|0;M=h+204|0;N=h+200|0;O=h+196|0;P=h+192|0;Q=h+188|0;S=h+184|0;T=h+180|0;V=h+176|0;W=h+172|0;X=h+168|0;Y=h+164|0;Z=h+160|0;_=h+156|0;$=h+152|0;aa=h+148|0;ba=h+144|0;ca=h+140|0;da=h+136|0;ea=h+132|0;fa=h+128|0;ga=h+124|0;ha=h+120|0;ia=h+116|0;ja=h+112|0;ka=h+108|0;la=h+104|0;ma=h+100|0;na=h+96|0;oa=h+92|0;pa=h+88|0;qa=h+84|0;ra=h+80|0;sa=h+76|0;ta=h+72|0;ua=h+68|0;va=h+64|0;wa=h+60|0;xa=h+56|0;ya=h+52|0;za=h+48|0;Aa=h+44|0;Ba=h+40|0;Ca=h+36|0;Da=h+32|0;Ea=h+28|0;Fa=h+24|0;Ga=h+20|0;Ha=h+16|0;Ia=h+12|0;Ja=h+8|0;Ka=h+4|0;La=h;c[k>>2]=a;c[l>>2]=b;c[m>>2]=d;c[n>>2]=e;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g=i;i=i+144|0;if((i|0)>=(j|0))U();h=g+128|0;k=g+124|0;l=g+120|0;m=g+116|0;n=g+112|0;o=g+108|0;p=g+104|0;q=g+100|0;r=g+96|0;s=g+92|0;t=g+88|0;u=g+84|0;v=g+80|0;w=g+76|0;x=g+72|0;y=g+68|0;z=g+64|0;A=g+60|0;B=g+56|0;C=g+52|0;D=g+48|0;E=g+44|0;F=g+40|0;G=g+36|0;H=g+32|0;I=g+28|0;J=g+24|0;K=g+20|0;L=g+16|0;M=g+12|0;N=g+8|0;O=g+4|0;P=g;c[k>>2]=a;c[l>>2]=b;c[m>>2]=e;c[n>>2]=f;if(!(c[m>>2]|0)){c[h>>2]=0;Q=c[h>>2]|0;i=g;return Q|0}c[t>>2]=c[n>>2];f=c[t>>2]|0;c[u>>2]=(c[t>>2]|0)>>>0<65536?(f>>>0<256?0:8):f>>>0<16777216?16:24;c[s>>2]=32-((d[45623+((c[t>>2]|0)>>>(c[u>>2]|0))>>0]|0)+(c[u>>2]|0));if(!(c[s>>2]|0)){c[o>>2]=(c[m>>2]|0)-1;c[r>>2]=c[(c[l>>2]|0)+(c[o>>2]<<2)>>2];if((c[r>>2]|0)>>>0>=(c[n>>2]|0)>>>0)c[r>>2]=0;else{u=c[o>>2]|0;c[o>>2]=u+-1;c[(c[k>>2]|0)+(u<<2)>>2]=0}while(1){if((c[o>>2]|0)<0)break;c[q>>2]=c[(c[l>>2]|0)+(c[o>>2]<<2)>>2];c[J>>2]=(c[n>>2]|0)>>>16;c[K>>2]=c[n>>2]&65535;c[N>>2]=((c[r>>2]|0)>>>0)%((c[J>>2]|0)>>>0)|0;c[L>>2]=((c[r>>2]|0)>>>0)/((c[J>>2]|0)>>>0)|0;c[P>>2]=R(c[L>>2]|0,c[K>>2]|0)|0;c[N>>2]=c[N>>2]<<16|(c[q>>2]|0)>>>16;if(((c[N>>2]|0)>>>0<(c[P>>2]|0)>>>0?(c[L>>2]=(c[L>>2]|0)+-1,c[N>>2]=(c[N>>2]|0)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t>>2]|0)|0;c[(c[k>>2]|0)+(c[m>>2]<<2)>>2]=c[q>>2];c[k>>2]=(c[k>>2]|0)+4;c[s>>2]=(c[s>>2]|0)+1}c[h>>2]=c[q>>2];w=c[h>>2]|0;i=g;return w|0}function cp(a){a=a|0;var b=0,d=0,e=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b+4|0;e=b;c[d>>2]=a;if(c[(c[d>>2]|0)+16>>2]|0)lp(c[(c[d>>2]|0)+16>>2]|0,c[(c[d>>2]|0)+20>>2]|0);if(c[(c[d>>2]|0)+4>>2]|0)lp(c[(c[d>>2]|0)+4>>2]|0,c[(c[d>>2]|0)+8>>2]|0);c[d>>2]=c[c[d>>2]>>2];while(1){if(!(c[d>>2]|0))break;c[e>>2]=c[c[d>>2]>>2];if(c[(c[d>>2]|0)+16>>2]|0)lp(c[(c[d>>2]|0)+16>>2]|0,c[(c[d>>2]|0)+20>>2]|0);if(c[(c[d>>2]|0)+4>>2]|0)lp(c[(c[d>>2]|0)+4>>2]|0,c[(c[d>>2]|0)+8>>2]|0);hf(c[d>>2]|0);c[d>>2]=c[e>>2]}i=b;return}function dp(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;f=i;i=i+48|0;if((i|0)>=(j|0))U();g=f+36|0;h=f+32|0;k=f+28|0;l=f+24|0;m=f+20|0;n=f+16|0;o=f+12|0;p=f+8|0;q=f+4|0;r=f;c[g>>2]=a;c[h>>2]=b;c[k>>2]=d;c[l>>2]=e;c[o>>2]=c[l>>2];c[g>>2]=(c[g>>2]|0)+-4;c[p>>2]=32-(c[o>>2]|0);c[m>>2]=c[c[h>>2]>>2];c[r>>2]=c[m>>2]<<c[p>>2];c[n>>2]=c[m>>2];c[q>>2]=1;while(1){if((c[q>>2]|0)>=(c[k>>2]|0))break;c[m>>2]=c[(c[h>>2]|0)+(c[q>>2]<<2)>>2];c[(c[g>>2]|0)+(c[q>>2]<<2)>>2]=(c[n>>2]|0)>>>(c[o>>2]|0)|c[m>>2]<<c[p>>2];c[n>>2]=c[m>>2];c[q>>2]=(c[q>>2]|0)+1}c[(c[g>>2]|0)+(c[q>>2]<<2)>>2]=(c[n>>2]|0)>>>(c[o>>2]|0);i=f;return c[r>>2]|0}function ep(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0;f=i;i=i+32|0;if((i|0)>=(j|0))U();g=f+28|0;h=f+24|0;k=f+20|0;l=f+16|0;m=f+12|0;n=f+8|0;o=f+4|0;p=f;c[g>>2]=a;c[h>>2]=b;c[k>>2]=d;c[l>>2]=e;c[p>>2]=0-(c[l>>2]|0);c[h>>2]=(c[h>>2]|0)+(0-(c[p>>2]|0)<<2);c[k>>2]=(c[k>>2]|0)+(0-(c[p>>2]|0)<<2);c[g>>2]=(c[g>>2]|0)+(0-(c[p>>2]|0)<<2);c[o>>2]=0;do{c[n>>2]=c[(c[k>>2]|0)+(c[p>>2]<<2)>>2];c[m>>2]=c[(c[h>>2]|0)+(c[p>>2]<<2)>>2];c[n>>2]=(c[n>>2]|0)+(c[o>>2]|0);c[o>>2]=(c[n>>2]|0)>>>0<(c[o>>2]|0)>>>0&1;c[n>>2]=(c[m>>2]|0)-(c[n>>2]|0);c[o>>2]=(c[o>>2]|0)+((c[n>>2]|0)>>>0>(c[m>>2]|0)>>>0&1);c[(c[g>>2]|0)+(c[p>>2]<<2)>>2]=c[n>>2];l=(c[p>>2]|0)+1|0;c[p>>2]=l}while((l|0)!=0);i=f;return c[o>>2]|0}function fp(){return 45973}function gp(){var a=0,b=0,d=0,e=0,f=0,g=0;a=i;i=i+16|0;if((i|0)>=(j|0))U();b=a;d=a+8|0;e=a+4|0;c[d>>2]=0;a:while(1){if((c[d>>2]|0)>=6){f=12;break}switch(c[d>>2]|0){case 0:{c[e>>2]=0;break}case 1:{c[e>>2]=1;break}case 2:{c[e>>2]=2;break}case 3:{c[e>>2]=3;break}case 4:{c[e>>2]=4;break}case 5:{c[e>>2]=8;break}default:{f=10;break a}}g=hp(c[e>>2]|0)|0;c[70672+(c[d>>2]<<2)>>2]=g;c[(c[70672+(c[d>>2]<<2)>>2]|0)+12>>2]=48;c[d>>2]=(c[d>>2]|0)+1}if((f|0)==10){c[b>>2]=c[d>>2];Ke(46117,b)}else if((f|0)==12){i=a;return 0}return 0}function hp(a){a=a|0;var b=0,d=0,e=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b+4|0;e=b;c[d>>2]=a;c[e>>2]=ip(1)|0;c[c[(c[e>>2]|0)+16>>2]>>2]=c[d>>2];c[(c[e>>2]|0)+4>>2]=c[d>>2]|0?1:0;c[(c[e>>2]|0)+8>>2]=0;i=b;return c[e>>2]|0}function ip(a){a=a|0;var b=0,d=0,e=0,f=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b+4|0;e=b;c[d>>2]=a;c[e>>2]=mf(20)|0;if(c[d>>2]|0)f=jp(c[d>>2]|0,0)|0;else f=0;c[(c[e>>2]|0)+16>>2]=f;c[c[e>>2]>>2]=c[d>>2];c[(c[e>>2]|0)+4>>2]=0;c[(c[e>>2]|0)+8>>2]=0;c[(c[e>>2]|0)+12>>2]=0;i=b;return c[e>>2]|0}function jp(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,k=0,l=0;d=i;i=i+16|0;if((i|0)>=(j|0))U();e=d+12|0;f=d+8|0;g=d+4|0;h=d;c[e>>2]=a;c[f>>2]=b;c[h>>2]=(c[e>>2]|0?c[e>>2]|0:1)<<2;b=c[h>>2]|0;if(c[f>>2]|0)k=of(b)|0;else k=mf(b)|0;c[g>>2]=k;if(c[e>>2]|0){l=c[g>>2]|0;i=d;return l|0}c[c[g>>2]>>2]=0;l=c[g>>2]|0;i=d;return l|0}function kp(a){a=a|0;var b=0,d=0,e=0,f=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b+4|0;e=b;c[d>>2]=a;c[e>>2]=mf(20)|0;if(c[d>>2]|0)f=jp(c[d>>2]|0,1)|0;else f=0;c[(c[e>>2]|0)+16>>2]=f;c[c[e>>2]>>2]=c[d>>2];c[(c[e>>2]|0)+12>>2]=1;c[(c[e>>2]|0)+4>>2]=0;c[(c[e>>2]|0)+8>>2]=0;i=b;return c[e>>2]|0}function lp(b,e){b=b|0;e=e|0;var f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0;f=i;i=i+48|0;if((i|0)>=(j|0))U();g=f+28|0;h=f+24|0;k=f+20|0;l=f+16|0;m=f+12|0;n=f+32|0;o=f;p=f+8|0;c[g>>2]=b;c[h>>2]=e;if(!(c[g>>2]|0)){i=f;return}c[k>>2]=c[h>>2]<<2;a:do if(c[k>>2]|0){c[l>>2]=c[g>>2];c[m>>2]=c[k>>2];a[n>>0]=0;h=o;c[h>>2]=d[n>>0];c[h+4>>2]=0;while(1){if(!(c[l>>2]&7|0?(c[m>>2]|0)!=0:0))break;a[c[l>>2]>>0]=a[n>>0]|0;c[l>>2]=(c[l>>2]|0)+1;c[m>>2]=(c[m>>2]|0)+-1}if((c[m>>2]|0)>>>0>=8){h=o;e=Xw(c[h>>2]|0,c[h+4>>2]|0,16843009,16843009)|0;h=o;c[h>>2]=e;c[h+4>>2]=C;do{c[p>>2]=c[l>>2];h=o;e=c[h+4>>2]|0;b=c[p>>2]|0;c[b>>2]=c[h>>2];c[b+4>>2]=e;c[m>>2]=(c[m>>2]|0)-8;c[l>>2]=(c[l>>2]|0)+8}while((c[m>>2]|0)>>>0>=8)}while(1){if(!(c[m>>2]|0))break a;a[c[l>>2]>>0]=a[n>>0]|0;c[l>>2]=(c[l>>2]|0)+1;c[m>>2]=(c[m>>2]|0)+-1}}while(0);hf(c[g>>2]|0);i=f;return}function mp(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=i;i=i+16|0;if((i|0)>=(j|0))U();f=e+8|0;g=e+4|0;h=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;lp(c[(c[f>>2]|0)+16>>2]|0,c[c[f>>2]>>2]|0);c[(c[f>>2]|0)+16>>2]=c[g>>2];c[c[f>>2]>>2]=c[h>>2];i=e;return}function np(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,k=0;d=i;i=i+16|0;if((i|0)>=(j|0))U();e=d+8|0;f=d+4|0;g=d;c[e>>2]=a;c[f>>2]=b;b=c[e>>2]|0;if((c[f>>2]|0)>>>0<=(c[c[e>>2]>>2]|0)>>>0){c[g>>2]=c[b+4>>2];while(1){if((c[g>>2]|0)>>>0>=(c[c[e>>2]>>2]|0)>>>0)break;c[(c[(c[e>>2]|0)+16>>2]|0)+(c[g>>2]<<2)>>2]=0;c[g>>2]=(c[g>>2]|0)+1}i=d;return}a=c[e>>2]|0;a:do if(!(c[b+16>>2]|0)){h=c[f>>2]|0;if(c[a+12>>2]&1|0){k=qf(h,4)|0;c[(c[e>>2]|0)+16>>2]=k;break}else{k=pf(h,4)|0;c[(c[e>>2]|0)+16>>2]=k;break}}else{k=nf(c[a+16>>2]|0,c[f>>2]<<2)|0;c[(c[e>>2]|0)+16>>2]=k;c[g>>2]=c[c[e>>2]>>2];while(1){if((c[g>>2]|0)>>>0>=(c[f>>2]|0)>>>0)break a;c[(c[(c[e>>2]|0)+16>>2]|0)+(c[g>>2]<<2)>>2]=0;c[g>>2]=(c[g>>2]|0)+1}}while(0);c[c[e>>2]>>2]=c[f>>2];i=d;return}function op(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b;c[d>>2]=a;if(c[d>>2]|0?c[(c[d>>2]|0)+12>>2]&16|0:0){pp();i=b;return}c[(c[d>>2]|0)+4>>2]=0;c[(c[d>>2]|0)+12>>2]=0;i=b;return}function pp(){var a=0;a=i;i=i+16|0;if((i|0)>=(j|0))U();Ge(46148,a);i=a;return}function qp(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b+4|0;c[d>>2]=a;if(!(c[d>>2]|0)){i=b;return}if(c[(c[d>>2]|0)+12>>2]&32|0){i=b;return}a=c[(c[d>>2]|0)+16>>2]|0;if(c[(c[d>>2]|0)+12>>2]&4|0)hf(a);else lp(a,c[c[d>>2]>>2]|0);if(c[(c[d>>2]|0)+12>>2]&-3864|0)Ke(46192,b);hf(c[d>>2]|0);i=b;return}function rp(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,k=0,l=0;e=i;i=i+16|0;if((i|0)>=(j|0))U();f=e+12|0;g=e+8|0;h=e+4|0;k=e;c[g>>2]=a;c[h>>2]=b;c[k>>2]=d;if(!(c[g>>2]|0))c[g>>2]=ip(0)|0;if(c[g>>2]|0?c[(c[g>>2]|0)+12>>2]&16|0:0){pp();c[f>>2]=c[g>>2];l=c[f>>2]|0;i=e;return l|0}d=c[(c[g>>2]|0)+16>>2]|0;if(c[(c[g>>2]|0)+12>>2]&4|0)hf(d);else lp(d,c[c[g>>2]>>2]|0);c[(c[g>>2]|0)+16>>2]=c[h>>2];c[c[g>>2]>>2]=0;c[(c[g>>2]|0)+4>>2]=0;c[(c[g>>2]|0)+8>>2]=c[k>>2];c[(c[g>>2]|0)+12>>2]=4|c[(c[g>>2]|0)+12>>2]&3840;if(ff(c[(c[g>>2]|0)+16>>2]|0)|0){k=(c[g>>2]|0)+12|0;c[k>>2]=c[k>>2]|1}c[f>>2]=c[g>>2];l=c[f>>2]|0;i=e;return l|0}function sp(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0;e=i;i=i+32|0;if((i|0)>=(j|0))U();f=e+20|0;g=e+16|0;h=e+12|0;k=e+8|0;l=e+4|0;m=e;c[g>>2]=a;c[h>>2]=b;c[k>>2]=d;c[m>>2]=(((c[k>>2]|0)+7|0)>>>0)/8|0;d=(ff(c[h>>2]|0)|0)!=0;b=c[m>>2]|0;if(d)n=ef(b)|0;else n=bf(b)|0;c[l>>2]=n;if(c[l>>2]|0){Ow(c[l>>2]|0,c[h>>2]|0,c[m>>2]|0)|0;c[f>>2]=rp(c[g>>2]|0,c[l>>2]|0,c[k>>2]|0)|0;o=c[f>>2]|0;i=e;return o|0}else{c[f>>2]=0;o=c[f>>2]|0;i=e;return o|0}return 0}function tp(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=i;i=i+16|0;if((i|0)>=(j|0))U();e=d+8|0;f=d+4|0;c[e>>2]=a;c[f>>2]=b;if(!(c[(c[e>>2]|0)+12>>2]&4))Ke(46224,d);if(c[f>>2]|0)c[c[f>>2]>>2]=c[(c[e>>2]|0)+8>>2];i=d;return c[(c[e>>2]|0)+16>>2]|0}function up(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0;d=i;i=i+32|0;if((i|0)>=(j|0))U();e=d+20|0;f=d+16|0;g=d+12|0;h=d+8|0;k=d+4|0;l=d;c[f>>2]=a;c[g>>2]=b;c[h>>2]=tp(c[f>>2]|0,c[g>>2]|0)|0;if((c[h>>2]|0)==0&(c[g>>2]|0)!=0){c[e>>2]=0;m=c[e>>2]|0;i=d;return m|0}c[l>>2]=(((c[c[g>>2]>>2]|0)+7|0)>>>0)/8|0;g=(ff(c[h>>2]|0)|0)!=0;f=c[l>>2]|0;if(g)n=ef(f)|0;else n=bf(f)|0;c[k>>2]=n;if(c[k>>2]|0)Ow(c[k>>2]|0,c[h>>2]|0,c[l>>2]|0)|0;c[e>>2]=c[k>>2];m=c[e>>2]|0;i=d;return m|0}function vp(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,k=0,l=0,m=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b+12|0;e=b+8|0;f=b+4|0;g=b;c[d>>2]=a;if(c[d>>2]|0?c[(c[d>>2]|0)+12>>2]&4|0:0){a=(ff(c[(c[d>>2]|0)+16>>2]|0)|0)!=0;h=((c[(c[d>>2]|0)+8>>2]|0)+7|0)/8|0;if(a)k=of(h)|0;else k=mf(h)|0;c[g>>2]=k;if(c[(c[d>>2]|0)+16>>2]|0)Ow(c[g>>2]|0,c[(c[d>>2]|0)+16>>2]|0,((c[(c[d>>2]|0)+8>>2]|0)+7|0)/8|0|0)|0;c[f>>2]=rp(0,c[g>>2]|0,c[(c[d>>2]|0)+8>>2]|0)|0;g=(c[f>>2]|0)+12|0;c[g>>2]=c[g>>2]&-49;l=c[f>>2]|0;i=b;return l|0}if(!(c[d>>2]|0)){c[f>>2]=0;l=c[f>>2]|0;i=b;return l|0}if(c[d>>2]|0?c[(c[d>>2]|0)+12>>2]&1|0:0)m=kp(c[(c[d>>2]|0)+4>>2]|0)|0;else m=ip(c[(c[d>>2]|0)+4>>2]|0)|0;c[f>>2]=m;c[(c[f>>2]|0)+4>>2]=c[(c[d>>2]|0)+4>>2];c[(c[f>>2]|0)+8>>2]=c[(c[d>>2]|0)+8>>2];c[(c[f>>2]|0)+12>>2]=c[(c[d>>2]|0)+12>>2];m=(c[f>>2]|0)+12|0;c[m>>2]=c[m>>2]&-49;c[e>>2]=0;while(1){if((c[e>>2]|0)>=(c[(c[f>>2]|0)+4>>2]|0))break;c[(c[(c[f>>2]|0)+16>>2]|0)+(c[e>>2]<<2)>>2]=c[(c[(c[d>>2]|0)+16>>2]|0)+(c[e>>2]<<2)>>2];c[e>>2]=(c[e>>2]|0)+1}l=c[f>>2]|0;i=b;return l|0}function wp(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=i;i=i+16|0;if((i|0)>=(j|0))U();e=d+4|0;f=d;c[e>>2]=a;c[f>>2]=b;b=c[e>>2]|0;if((c[e>>2]|0)==(c[f>>2]|0)){if(b|0?c[(c[e>>2]|0)+12>>2]&16|0:0){pp();i=d;return}}else xp(b,c[f>>2]|0)|0;c[(c[e>>2]|0)+8>>2]=((c[(c[f>>2]|0)+8>>2]|0)!=0^1)&1;i=d;return}function xp(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,k=0,l=0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>>2]=rp(0,c[g>>2]|0,c[(c[d>>2]|0)+8>>2]|0)|0;l=c[e>>2]|0;i=b;return l|0}if(!(c[d>>2]|0)){c[e>>2]=0;l=c[e>>2]|0;i=b;return l|0}if(c[d>>2]|0?c[(c[d>>2]|0)+12>>2]&1|0:0)m=kp(c[(c[d>>2]|0)+4>>2]|0)|0;else m=ip(c[(c[d>>2]|0)+4>>2]|0)|0;c[e>>2]=m;c[(c[e>>2]|0)+4>>2]=0;c[(c[e>>2]|0)+8>>2]=0;c[(c[e>>2]|0)+12>>2]=c[(c[d>>2]|0)+12>>2];l=c[e>>2]|0;i=b;return l|0}function zp(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=i;i=i+16|0;if((i|0)>=(j|0))U();e=d+4|0;f=d;c[e>>2]=a;c[f>>2]=b;if(c[e>>2]|0){if(c[e>>2]|0?c[(c[e>>2]|0)+12>>2]&16|0:0){pp();i=d;return}mp(c[e>>2]|0,c[(c[f>>2]|0)+16>>2]|0,c[c[f>>2]>>2]|0);c[(c[e>>2]|0)+4>>2]=c[(c[f>>2]|0)+4>>2];c[(c[e>>2]|0)+8>>2]=c[(c[f>>2]|0)+8>>2];c[(c[e>>2]|0)+12>>2]=c[(c[f>>2]|0)+12>>2];c[c[f>>2]>>2]=0;c[(c[f>>2]|0)+4>>2]=0;c[(c[f>>2]|0)+16>>2]=0}qp(c[f>>2]|0);i=d;return}function Ap(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0;e=i;i=i+32|0;if((i|0)>=(j|0))U();f=e+28|0;g=e+24|0;h=e+20|0;k=e+16|0;l=e+12|0;m=e+8|0;n=e+4|0;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;c[l>>2]=c[c[g>>2]>>2];c[m>>2]=0-(((c[h>>2]|0)!=0^1^1)&1);if((c[c[f>>2]>>2]|0)!=(c[c[g>>2]>>2]|0))Ke(46254,e);c[k>>2]=0;while(1){o=c[m>>2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c[g>>2]|0)+4>>2]^c[n>>2];c[n>>2]=c[m>>2]&(c[(c[f>>2]|0)+8>>2]^c[(c[g>>2]|0)+8>>2]);c[(c[f>>2]|0)+8>>2]=c[(c[f>>2]|0)+8>>2]^c[n>>2];c[(c[g>>2]|0)+8>>2]=c[(c[g>>2]|0)+8>>2]^c[n>>2];i=e;return}function Ep(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b;c[d>>2]=a;a=ip((((c[d>>2]|0)+32-1|0)>>>0)/32|0)|0;i=b;return a|0}function Fp(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b;c[d>>2]=a;a=kp((((c[d>>2]|0)+32-1|0)>>>0)/32|0)|0;i=b;return a|0}function Gp(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b;c[d>>2]=a;qp(c[d>>2]|0);i=b;return}function Hp(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0;e=i;i=i+32|0;if((i|0)>=(j|0))U();f=e+16|0;g=e+12|0;h=e+8|0;k=e+4|0;l=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;c[l>>2]=(((c[g>>2]|0)+7|0)>>>0)/8|0;if(c[f>>2]|0?c[(c[f>>2]|0)+12>>2]&16|0:0){pp();i=e;return}g=(c[f>>2]|0)!=0;if(!(c[h>>2]|0)){if(g?c[(c[f>>2]|0)+12>>2]&1|0:0)m=of(c[l>>2]|0)|0;else m=mf(c[l>>2]|0)|0;c[k>>2]=m;$m(c[k>>2]|0,c[l>>2]|0)}else{if(g?c[(c[f>>2]|0)+12>>2]&1|0:0)n=Wm(c[l>>2]|0,c[h>>2]|0)|0;else n=Um(c[l>>2]|0,c[h>>2]|0)|0;c[k>>2]=n}Lo(c[f>>2]|0,c[k>>2]|0,c[l>>2]|0,0);hf(c[k>>2]|0);i=e;return}function Ip(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;d=i;i=i+16|0;if((i|0)>=(j|0))U();e=d+12|0;f=d+8|0;g=d+4|0;c[f>>2]=a;c[g>>2]=b;switch(c[g>>2]|0){case 1:{c[e>>2]=((c[(c[f>>2]|0)+12>>2]&1|0)!=0^1^1)&1;h=c[e>>2]|0;i=d;return h|0}case 2:{c[e>>2]=((c[(c[f>>2]|0)+12>>2]&4|0)!=0^1^1)&1;h=c[e>>2]|0;i=d;return h|0}case 4:{c[e>>2]=((c[(c[f>>2]|0)+12>>2]&16|0)!=0^1^1)&1;h=c[e>>2]|0;i=d;return h|0}case 8:{c[e>>2]=((c[(c[f>>2]|0)+12>>2]&32|0)!=0^1^1)&1;h=c[e>>2]|0;i=d;return h|0}case 2048:case 1024:case 512:case 256:{c[e>>2]=((c[(c[f>>2]|0)+12>>2]&c[g>>2]|0)!=0^1^1)&1;h=c[e>>2]|0;i=d;return h|0}default:Ke(46317,d)}return 0}function Jp(a){a=a|0;var b=0,d=0,e=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b;e=b+12|0;c[e>>2]=a;a=c[e>>2]|0;if((c[e>>2]|0)<0|(c[e>>2]|0)>>>0>6){c[d>>2]=a;Ke(46117,d)}if(c[70672+(a<<2)>>2]|0){i=b;return c[70672+(c[e>>2]<<2)>>2]|0}else Ke(46337,b+8|0);return 0}function Kp(){return 46368}function Lp(b,e){b=b|0;e=e|0;var f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;f=i;i=i+96|0;if((i|0)>=(j|0))U();g=f+28|0;h=f+24|0;k=f+20|0;l=f+16|0;m=f+12|0;n=f+32|0;o=f+8|0;p=f+4|0;q=f;c[h>>2]=b;c[k>>2]=e;c[l>>2]=yw(172)|0;if(!(c[l>>2]|0)){c[g>>2]=0;r=c[g>>2]|0;i=f;return r|0}c[c[l>>2]>>2]=1779033703;c[(c[l>>2]|0)+4>>2]=-1150833019;c[(c[l>>2]|0)+8>>2]=1013904242;c[(c[l>>2]|0)+12>>2]=-1521486534;c[(c[l>>2]|0)+16>>2]=1359893119;c[(c[l>>2]|0)+20>>2]=-1694144372;c[(c[l>>2]|0)+24>>2]=528734635;c[(c[l>>2]|0)+28>>2]=1541459225;c[(c[l>>2]|0)+32>>2]=0;c[(c[l>>2]|0)+36>>2]=0;e=(c[l>>2]|0)+40|0;a[e>>0]=a[e>>0]&-2;e=(c[l>>2]|0)+40|0;a[e>>0]=a[e>>0]&-3;a:do if(c[h>>2]|0){e=n;b=e+64|0;do{a[e>>0]=0;e=e+1|0}while((e|0)<(b|0));e=(c[l>>2]|0)+105|0;b=e+64|0;do{a[e>>0]=0;e=e+1|0}while((e|0)<(b|0));do if((c[k>>2]|0)>>>0<=64){Ow(n|0,c[h>>2]|0,c[k>>2]|0)|0;Ow((c[l>>2]|0)+105|0,c[h>>2]|0,c[k>>2]|0)|0}else{c[o>>2]=Lp(0,0)|0;if(c[o>>2]|0){Mp(c[o>>2]|0,c[h>>2]|0,c[k>>2]|0);Pp(c[o>>2]|0);e=n;s=(c[o>>2]|0)+41|0;b=e+32|0;do{a[e>>0]=a[s>>0]|0;e=e+1|0;s=s+1|0}while((e|0)<(b|0));e=(c[l>>2]|0)+105|0;s=(c[o>>2]|0)+41|0;b=e+32|0;do{a[e>>0]=a[s>>0]|0;e=e+1|0;s=s+1|0}while((e|0)<(b|0));Qp(c[o>>2]|0);break}zw(c[l>>2]|0);c[g>>2]=0;r=c[g>>2]|0;i=f;return r|0}while(0);c[m>>2]=0;while(1){if((c[m>>2]|0)>=64)break;e=n+(c[m>>2]|0)|0;a[e>>0]=(d[e>>0]|0)^54;e=(c[l>>2]|0)+105+(c[m>>2]|0)|0;a[e>>0]=(d[e>>0]|0)^92;c[m>>2]=(c[m>>2]|0)+1}e=(c[l>>2]|0)+40|0;a[e>>0]=a[e>>0]&-3|2;Mp(c[l>>2]|0,n,64);c[p>>2]=n;c[q>>2]=64;while(1){if(!(c[q>>2]|0))break a;a[c[p>>2]>>0]=0;c[p>>2]=(c[p>>2]|0)+1;c[q>>2]=(c[q>>2]|0)+-1}}while(0);c[g>>2]=c[l>>2];r=c[g>>2]|0;i=f;return r|0}function Mp(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,k=0,l=0,m=0;f=i;i=i+16|0;if((i|0)>=(j|0))U();g=f+12|0;h=f+8|0;k=f+4|0;l=f;c[g>>2]=b;c[h>>2]=d;c[k>>2]=e;c[l>>2]=c[h>>2];if((a[(c[g>>2]|0)+40>>0]<<7&255)<<24>>24>>7<<24>>24|0){i=f;return}if((c[(c[g>>2]|0)+36>>2]|0)==64){Np(c[g>>2]|0,(c[g>>2]|0)+41|0);c[(c[g>>2]|0)+36>>2]=0;h=(c[g>>2]|0)+32|0;c[h>>2]=(c[h>>2]|0)+1}if(!(c[l>>2]|0)){i=f;return}if(c[(c[g>>2]|0)+36>>2]|0){while(1){if(!(c[k>>2]|0))break;if((c[(c[g>>2]|0)+36>>2]|0)>=64)break;h=c[l>>2]|0;c[l>>2]=h+1;e=a[h>>0]|0;h=(c[g>>2]|0)+36|0;d=c[h>>2]|0;c[h>>2]=d+1;a[(c[g>>2]|0)+41+d>>0]=e;c[k>>2]=(c[k>>2]|0)+-1}Mp(c[g>>2]|0,0,0);if(!(c[k>>2]|0)){i=f;return}}while(1){if((c[k>>2]|0)>>>0<64)break;Np(c[g>>2]|0,c[l>>2]|0);c[(c[g>>2]|0)+36>>2]=0;e=(c[g>>2]|0)+32|0;c[e>>2]=(c[e>>2]|0)+1;c[k>>2]=(c[k>>2]|0)-64;c[l>>2]=(c[l>>2]|0)+64}while(1){if(!(c[k>>2]|0)){m=15;break}if((c[(c[g>>2]|0)+36>>2]|0)>=64){m=15;break}e=c[l>>2]|0;c[l>>2]=e+1;d=a[e>>0]|0;e=(c[g>>2]|0)+36|0;h=c[e>>2]|0;c[e>>2]=h+1;a[(c[g>>2]|0)+41+h>>0]=d;c[k>>2]=(c[k>>2]|0)+-1}if((m|0)==15){i=f;return}}function Np(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0;e=i;i=i+384|0;if((i|0)>=(j|0))U();f=e+376|0;g=e+372|0;h=e+368|0;k=e+364|0;l=e+360|0;m=e+356|0;n=e+352|0;o=e+348|0;p=e+344|0;q=e+340|0;r=e+336|0;s=e+332|0;t=e+328|0;u=e+264|0;v=e+8|0;w=e+4|0;x=e;c[f>>2]=b;c[g>>2]=d;c[h>>2]=c[g>>2];c[k>>2]=c[c[f>>2]>>2];c[l>>2]=c[(c[f>>2]|0)+4>>2];c[m>>2]=c[(c[f>>2]|0)+8>>2];c[n>>2]=c[(c[f>>2]|0)+12>>2];c[o>>2]=c[(c[f>>2]|0)+16>>2];c[p>>2]=c[(c[f>>2]|0)+20>>2];c[q>>2]=c[(c[f>>2]|0)+24>>2];c[r>>2]=c[(c[f>>2]|0)+28>>2];c[w>>2]=0;c[x>>2]=u;while(1){if((c[w>>2]|0)>=16)break;g=c[h>>2]|0;c[h>>2]=g+1;a[(c[x>>2]|0)+3>>0]=a[g>>0]|0;g=c[h>>2]|0;c[h>>2]=g+1;a[(c[x>>2]|0)+2>>0]=a[g>>0]|0;g=c[h>>2]|0;c[h>>2]=g+1;a[(c[x>>2]|0)+1>>0]=a[g>>0]|0;g=c[h>>2]|0;c[h>>2]=g+1;a[c[x>>2]>>0]=a[g>>0]|0;c[w>>2]=(c[w>>2]|0)+1;c[x>>2]=(c[x>>2]|0)+4}c[w>>2]=0;while(1){if((c[w>>2]|0)>=16)break;c[v+(c[w>>2]<<2)>>2]=c[u+(c[w>>2]<<2)>>2];c[w>>2]=(c[w>>2]|0)+1}while(1){if((c[w>>2]|0)>=64)break;u=Op(c[v+((c[w>>2]|0)-2<<2)>>2]|0,17)|0;x=u^(Op(c[v+((c[w>>2]|0)-2<<2)>>2]|0,19)|0);u=(x^(c[v+((c[w>>2]|0)-2<<2)>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0);p=(c[f>>2]|0)+24|0;c[p>>2]=(c[p>>2]|0)+(c[q>>2]|0);q=(c[f>>2]|0)+28|0;c[q>>2]=(c[q>>2]|0)+(c[r>>2]|0);i=e;return}function Op(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=i;i=i+16|0;if((i|0)>=(j|0))U();e=d+4|0;f=d;c[e>>2]=a;c[f>>2]=b;i=d;return (c[e>>2]|0)>>>(c[f>>2]|0)|c[e>>2]<<32-(c[f>>2]|0)|0}function Pp(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,k=0,l=0,m=0;d=i;i=i+32|0;if((i|0)>=(j|0))U();e=d+16|0;f=d+12|0;g=d+8|0;h=d+4|0;k=d;c[e>>2]=b;if((a[(c[e>>2]|0)+40>>0]<<7&255)<<24>>24>>7<<24>>24|0){i=d;return}Mp(c[e>>2]|0,0,0);c[f>>2]=c[(c[e>>2]|0)+32>>2];c[h>>2]=c[f>>2]<<6;c[g>>2]=(c[f>>2]|0)>>>26;c[f>>2]=c[h>>2];b=(c[h>>2]|0)+(c[(c[e>>2]|0)+36>>2]|0)|0;c[h>>2]=b;if(b>>>0<(c[f>>2]|0)>>>0)c[g>>2]=(c[g>>2]|0)+1;c[f>>2]=c[h>>2];c[h>>2]=c[h>>2]<<3;c[g>>2]=c[g>>2]<<3;c[g>>2]=c[g>>2]|(c[f>>2]|0)>>>29;f=(c[(c[e>>2]|0)+36>>2]|0)<56;b=(c[e>>2]|0)+36|0;l=c[b>>2]|0;c[b>>2]=l+1;a[(c[e>>2]|0)+41+l>>0]=-128;a:do if(f)while(1){if((c[(c[e>>2]|0)+36>>2]|0)>=56)break a;l=(c[e>>2]|0)+36|0;b=c[l>>2]|0;c[l>>2]=b+1;a[(c[e>>2]|0)+41+b>>0]=0}else{while(1){m=c[e>>2]|0;if((c[(c[e>>2]|0)+36>>2]|0)>=64)break;b=m+36|0;l=c[b>>2]|0;c[b>>2]=l+1;a[(c[e>>2]|0)+41+l>>0]=0}Mp(m,0,0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c[(c[e>>2]|0)+24>>2]|0)>>>8&255;g=c[k>>2]|0;c[k>>2]=g+1;a[g>>0]=h;h=c[(c[e>>2]|0)+24>>2]&255;g=c[k>>2]|0;c[k>>2]=g+1;a[g>>0]=h;h=(c[(c[e>>2]|0)+28>>2]|0)>>>24&255;g=c[k>>2]|0;c[k>>2]=g+1;a[g>>0]=h;h=(c[(c[e>>2]|0)+28>>2]|0)>>>16&255;g=c[k>>2]|0;c[k>>2]=g+1;a[g>>0]=h;h=(c[(c[e>>2]|0)+28>>2]|0)>>>8&255;g=c[k>>2]|0;c[k>>2]=g+1;a[g>>0]=h;h=c[(c[e>>2]|0)+28>>2]&255;g=c[k>>2]|0;c[k>>2]=g+1;a[g>>0]=h;h=(c[e>>2]|0)+40|0;a[h>>0]=a[h>>0]&-2|1;i=d;return}function Qp(b){b=b|0;var d=0,e=0,f=0,g=0;d=i;i=i+16|0;if((i|0)>=(j|0))U();e=d+8|0;f=d+4|0;g=d;c[e>>2]=b;if(!(c[e>>2]|0)){i=d;return}a:do if((a[(c[e>>2]|0)+40>>0]<<6&255)<<24>>24>>7<<24>>24|0){c[f>>2]=(c[e>>2]|0)+105;c[g>>2]=64;while(1){if(!(c[g>>2]|0))break a;a[c[f>>2]>>0]=0;c[f>>2]=(c[f>>2]|0)+1;c[g>>2]=(c[g>>2]|0)+-1}}while(0);zw(c[e>>2]|0);i=d;return}function Rp(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,k=0,l=0,m=0;e=i;i=i+16|0;if((i|0)>=(j|0))U();f=e+12|0;g=e+8|0;h=e+4|0;k=e;c[g>>2]=b;c[h>>2]=d;Pp(c[g>>2]|0);do if((a[(c[g>>2]|0)+40>>0]<<6&255)<<24>>24>>7<<24>>24|0){c[k>>2]=Lp(0,0)|0;if(c[k>>2]|0){Mp(c[k>>2]|0,(c[g>>2]|0)+105|0,64);Mp(c[k>>2]|0,(c[g>>2]|0)+41|0,32);Pp(c[k>>2]|0);d=(c[g>>2]|0)+41|0;b=(c[k>>2]|0)+41|0;l=d+32|0;do{a[d>>0]=a[b>>0]|0;d=d+1|0;b=b+1|0}while((d|0)<(l|0));Qp(c[k>>2]|0);break}zw(c[g>>2]|0);c[f>>2]=0;m=c[f>>2]|0;i=e;return m|0}while(0);if(c[h>>2]|0)c[c[h>>2]>>2]=32;c[f>>2]=(c[g>>2]|0)+41;m=c[f>>2]|0;i=e;return m|0}function Sp(b,e,f,g,h){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0;k=i;i=i+80|0;if((i|0)>=(j|0))U();l=k+56|0;m=k+52|0;n=k+48|0;o=k+44|0;p=k+40|0;q=k+36|0;r=k+32|0;s=k+28|0;t=k+24|0;u=k+20|0;v=k+16|0;w=k+12|0;x=k+8|0;y=k+64|0;z=k+4|0;A=k;c[m>>2]=b;c[n>>2]=e;c[o>>2]=f;c[p>>2]=g;c[q>>2]=h;if((c[(c[(c[m>>2]|0)+12>>2]|0)+20>>2]|0)!=16){c[l>>2]=139;B=c[l>>2]|0;i=k;return B|0}if((c[o>>2]|0)>>>0<((c[q>>2]|0)+8|0)>>>0){c[l>>2]=200;B=c[l>>2]|0;i=k;return B|0}if(((c[q>>2]|0)>>>0)%8|0|0){c[l>>2]=45;B=c[l>>2]|0;i=k;return B|0}c[t>>2]=((c[q>>2]|0)>>>0)/8|0;if((c[t>>2]|0)>>>0<2){c[l>>2]=45;B=c[l>>2]|0;i=k;return B|0}c[z>>2]=0;c[v>>2]=c[n>>2];c[w>>2]=c[n>>2];c[x>>2]=(c[m>>2]|0)+80;n=c[w>>2]|0;if((d[(c[m>>2]|0)+56>>0]|0)>>>1&1|0){o=(c[m>>2]|0)+64|0;a[n>>0]=a[o>>0]|0;a[n+1>>0]=a[o+1>>0]|0;a[n+2>>0]=a[o+2>>0]|0;a[n+3>>0]=a[o+3>>0]|0;a[n+4>>0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2]|0))|0,0,c[m>>2]|0)|0;m=(c[h>>2]|0)+128+56|0;a[m>>0]=a[m>>0]&-2|1;c[g>>2]=0;o=c[g>>2]|0;i=f;return o|0}return 0}function $p(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0;h=i;i=i+96|0;if((i|0)>=(j|0))U();k=h+64|0;l=h+60|0;m=h+56|0;n=h+52|0;o=h+48|0;p=h+40|0;q=h+72|0;r=h+36|0;s=h+32|0;t=h+28|0;u=h+24|0;v=h+20|0;w=h+16|0;x=h+68|0;y=h;z=h+12|0;A=h+8|0;c[l>>2]=b;c[m>>2]=e;c[n>>2]=f;c[o>>2]=g;c[h+44>>2]=16;c[p>>2]=c[(c[(c[l>>2]|0)+12>>2]|0)+36>>2];c[r>>2]=0;c[s>>2]=c[(c[l>>2]|0)+128+36>>2];if((c[n>>2]|0)==0?!((c[s>>2]|0)!=0&(c[o>>2]|0)!=0):0){c[k>>2]=0;B=c[k>>2]|0;i=h;return B|0}a:do{b:do if((c[s>>2]|0)>>>0>0?1:((c[n>>2]|0)+(c[s>>2]|0)|0)>>>0<16)while(1){if(!(c[n>>2]|0?(c[s>>2]|0)>>>0<16:0))break b;g=c[m>>2]|0;c[m>>2]=g+1;f=a[g>>0]|0;g=c[s>>2]|0;c[s>>2]=g+1;a[(c[l>>2]|0)+128+20+g>>0]=f;c[n>>2]=(c[n>>2]|0)+-1}while(0);c:do if(!(c[n>>2]|0)){if(!(c[o>>2]|0))break a;while(1){if((c[s>>2]|0)>>>0>=16)break c;f=c[s>>2]|0;c[s>>2]=f+1;a[(c[l>>2]|0)+128+20+f>>0]=0}}while(0);if((c[s>>2]|0)>>>0>0){aq((c[l>>2]|0)+64|0,(c[l>>2]|0)+64|0,(c[l>>2]|0)+128+20|0,16);c[u>>2]=sb[c[p>>2]&63]((c[l>>2]|0)+496|0,(c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c[m>>2]=(c[m>>2]|0)+16}while(0)}while((c[n>>2]|0)>>>0>0);c[(c[l>>2]|0)+128+36>>2]=c[s>>2];if(c[r>>2]|0)c[r>>2]=(c[r>>2]|0)+16;c[k>>2]=c[r>>2];B=c[k>>2]|0;i=h;return B|0}function aq(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;h=i;i=i+48|0;if((i|0)>=(j|0))U();k=h+40|0;l=h+36|0;m=h+32|0;n=h+28|0;o=h+24|0;p=h+20|0;q=h+16|0;r=h+12|0;s=h+8|0;t=h+4|0;c[k>>2]=b;c[l>>2]=e;c[m>>2]=f;c[n>>2]=g;c[o>>2]=c[k>>2];c[p>>2]=c[l>>2];c[q>>2]=c[m>>2];c[h>>2]=3;if(!((c[o>>2]|c[p>>2]|c[q>>2])&3)){c[r>>2]=c[o>>2];c[s>>2]=c[p>>2];c[t>>2]=c[q>>2];while(1){if((c[n>>2]|0)>>>0<4)break;m=c[s>>2]|0;c[s>>2]=m+4;l=c[m>>2]|0;m=c[t>>2]|0;c[t>>2]=m+4;k=l^c[m>>2];m=c[r>>2]|0;c[r>>2]=m+4;c[m>>2]=k;c[n>>2]=(c[n>>2]|0)-4}c[o>>2]=c[r>>2];c[p>>2]=c[s>>2];c[q>>2]=c[t>>2]}while(1){if(!(c[n>>2]|0))break;t=c[p>>2]|0;c[p>>2]=t+1;s=d[t>>0]|0;t=c[q>>2]|0;c[q>>2]=t+1;r=(s^(d[t>>0]|0))&255;t=c[o>>2]|0;c[o>>2]=t+1;a[t>>0]=r;c[n>>2]=(c[n>>2]|0)+-1}i=h;return}function bq(b,e,f,g,h){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;k=i;i=i+32|0;if((i|0)>=(j|0))U();l=k+24|0;m=k+20|0;n=k+16|0;o=k+12|0;p=k+8|0;q=k+4|0;r=k;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0;i=g;return w|0}function eq(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;h=i;i=i+48|0;if((i|0)>=(j|0))U();k=h+40|0;l=h+36|0;m=h+32|0;n=h+28|0;o=h+24|0;p=h+20|0;q=h+16|0;r=h+12|0;s=h+8|0;t=h+4|0;c[k>>2]=b;c[l>>2]=e;c[m>>2]=f;c[n>>2]=g;c[o>>2]=c[k>>2];c[p>>2]=c[l>>2];c[q>>2]=c[m>>2];c[h>>2]=3;if(!((c[q>>2]|c[o>>2]|c[p>>2])&3)){c[r>>2]=c[o>>2];c[s>>2]=c[p>>2];c[t>>2]=c[q>>2];while(1){if((c[n>>2]|0)>>>0<4)break;m=c[t>>2]|0;c[t>>2]=m+4;l=c[m>>2]|0;m=c[s>>2]|0;c[s>>2]=m+4;k=c[m>>2]^l;c[m>>2]=k;m=c[r>>2]|0;c[r>>2]=m+4;c[m>>2]=k;c[n>>2]=(c[n>>2]|0)-4}c[o>>2]=c[r>>2];c[p>>2]=c[s>>2];c[q>>2]=c[t>>2]}while(1){if(!(c[n>>2]|0))break;t=c[q>>2]|0;c[q>>2]=t+1;s=d[t>>0]|0;t=c[p>>2]|0;c[p>>2]=t+1;r=((d[t>>0]|0)^s)&255;a[t>>0]=r;t=c[o>>2]|0;c[o>>2]=t+1;a[t>>0]=r;c[n>>2]=(c[n>>2]|0)+-1}i=h;return}function fq(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0;f=i;i=i+32|0;if((i|0)>=(j|0))U();g=f+28|0;h=f+24|0;k=f+20|0;l=f+16|0;m=f+12|0;n=f+8|0;o=f+4|0;c[g>>2]=b;c[h>>2]=d;c[k>>2]=e;c[l>>2]=c[g>>2];c[m>>2]=c[h>>2];c[f>>2]=3;if(!((c[l>>2]|c[m>>2])&3)){c[n>>2]=c[l>>2];c[o>>2]=c[m>>2];while(1){if((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843009,16843009)|0;q=u;c[q>>2]=p;c[q+4>>2]=C;do{c[v>>2]=c[r>>2];q=u;p=c[q+4>>2]|0;g=c[v>>2]|0;c[g>>2]=c[q>>2];c[g+4>>2]=p;c[s>>2]=(c[s>>2]|0)-8;c[r>>2]=(c[r>>2]|0)+8}while((c[s>>2]|0)>>>0>=8)}while(1){if(!(c[s>>2]|0))break;a[c[r>>2]>>0]=a[t>>0]|0;c[r>>2]=(c[r>>2]|0)+1;c[s>>2]=(c[s>>2]|0)+-1}if(!(c[n>>2]|0)){i=e;return}Qe((c[n>>2]|0)+16|0);Re();i=e;return}function lq(b,e,f,g,h){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,D=0,E=0,F=0,G=0;k=i;i=i+96|0;if((i|0)>=(j|0))U();l=k+68|0;m=k+64|0;n=k+60|0;o=k+56|0;p=k+52|0;q=k+48|0;r=k+44|0;s=k+40|0;t=k+36|0;u=k+32|0;v=k+28|0;w=k+24|0;x=k+20|0;y=k+80|0;z=k+16|0;A=k+12|0;B=k+72|0;D=k;E=k+8|0;c[m>>2]=b;c[n>>2]=e;c[o>>2]=f;c[p>>2]=g;c[q>>2]=h;c[t>>2]=c[(c[(c[m>>2]|0)+12>>2]|0)+36>>2];c[u>>2]=c[(c[(c[m>>2]|0)+12>>2]|0)+20>>2];if((c[o>>2]|0)>>>0<(c[q>>2]|0)>>>0){c[l>>2]=200;F=c[l>>2]|0;i=k;return F|0}c[w>>2]=0;if(c[(c[m>>2]|0)+112>>2]|0){if((c[(c[m>>2]|0)+112>>2]|0)>>>0>=(c[u>>2]|0)>>>0)Fe(46632,46654,53,46667);c[s>>2]=(c[u>>2]|0)-(c[(c[m>>2]|0)+112>>2]|0);if((c[(c[m>>2]|0)+112>>2]|0)>>>0>(c[q>>2]|0)>>>0)G=c[q>>2]|0;else G=c[(c[m>>2]|0)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]|0)}while((c[q>>2]|0)!=0);c[(c[m>>2]|0)+112>>2]=(c[u>>2]|0)-(c[r>>2]|0);if(c[(c[m>>2]|0)+112>>2]|0)nq((c[m>>2]|0)+96+(c[r>>2]|0)|0,y+(c[r>>2]|0)|0,c[(c[m>>2]|0)+112>>2]|0);c[z>>2]=y;c[A>>2]=16;a[B>>0]=0;G=D;c[G>>2]=d[B>>0];c[G+4>>2]=0;while(1){if(!(c[z>>2]&7|0?(c[A>>2]|0)!=0:0))break;a[c[z>>2]>>0]=a[B>>0]|0;c[z>>2]=(c[z>>2]|0)+1;c[A>>2]=(c[A>>2]|0)+-1}if((c[A>>2]|0)>>>0>=8){G=D;v=Xw(c[G>>2]|0,c[G+4>>2]|0,16843009,16843009)|0;G=D;c[G>>2]=v;c[G+4>>2]=C;do{c[E>>2]=c[z>>2];G=D;v=c[G+4>>2]|0;o=c[E>>2]|0;c[o>>2]=c[G>>2];c[o+4>>2]=v;c[A>>2]=(c[A>>2]|0)-8;c[z>>2]=(c[z>>2]|0)+8}while((c[A>>2]|0)>>>0>=8)}while(1){if(!(c[A>>2]|0))break a;a[c[z>>2]>>0]=a[B>>0]|0;c[z>>2]=(c[z>>2]|0)+1;c[A>>2]=(c[A>>2]|0)+-1}}while(0);if((c[w>>2]|0)>>>0>0){Qe((c[w>>2]|0)+16|0);Re()}c[l>>2]=0;F=c[l>>2]|0;i=k;return F|0}function mq(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;h=i;i=i+48|0;if((i|0)>=(j|0))U();k=h+40|0;l=h+36|0;m=h+32|0;n=h+28|0;o=h+24|0;p=h+20|0;q=h+16|0;r=h+12|0;s=h+8|0;t=h+4|0;c[k>>2]=b;c[l>>2]=e;c[m>>2]=f;c[n>>2]=g;c[o>>2]=c[k>>2];c[p>>2]=c[l>>2];c[q>>2]=c[m>>2];c[h>>2]=3;if(!((c[o>>2]|c[p>>2]|c[q>>2])&3)){c[r>>2]=c[o>>2];c[s>>2]=c[p>>2];c[t>>2]=c[q>>2];while(1){if((c[n>>2]|0)>>>0<4)break;m=c[s>>2]|0;c[s>>2]=m+4;l=c[m>>2]|0;m=c[t>>2]|0;c[t>>2]=m+4;k=l^c[m>>2];m=c[r>>2]|0;c[r>>2]=m+4;c[m>>2]=k;c[n>>2]=(c[n>>2]|0)-4}c[o>>2]=c[r>>2];c[p>>2]=c[s>>2];c[q>>2]=c[t>>2]}while(1){if(!(c[n>>2]|0))break;t=c[p>>2]|0;c[p>>2]=t+1;s=d[t>>0]|0;t=c[q>>2]|0;c[q>>2]=t+1;r=(s^(d[t>>0]|0))&255;t=c[o>>2]|0;c[o>>2]=t+1;a[t>>0]=r;c[n>>2]=(c[n>>2]|0)+-1}i=h;return}function nq(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0;f=i;i=i+32|0;if((i|0)>=(j|0))U();g=f+28|0;h=f+24|0;k=f+20|0;l=f+16|0;m=f+12|0;n=f+8|0;o=f+4|0;c[g>>2]=b;c[h>>2]=d;c[k>>2]=e;c[l>>2]=c[g>>2];c[m>>2]=c[h>>2];c[f>>2]=3;if(!((c[l>>2]|c[m>>2])&3)){c[n>>2]=c[l>>2];c[o>>2]=c[m>>2];while(1){if((c[k>>2]|0)>>>0<4)break;h=c[o>>2]|0;c[o>>2]=h+4;g=c[h>>2]|0;h=c[n>>2]|0;c[n>>2]=h+4;c[h>>2]=g;c[k>>2]=(c[k>>2]|0)-4}c[l>>2]=c[n>>2];c[m>>2]=c[o>>2]}while(1){if(!(c[k>>2]|0))break;o=c[m>>2]|0;c[m>>2]=o+1;n=a[o>>0]|0;o=c[l>>2]|0;c[l>>2]=o+1;a[o>>0]=n;c[k>>2]=(c[k>>2]|0)+-1}i=f;return}function oq(b,e,f,g,h){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;k=i;i=i+32|0;if((i|0)>=(j|0))U();l=k+24|0;m=k+20|0;n=k+16|0;o=k+12|0;p=k+8|0;q=k+4|0;r=k;c[m>>2]=b;c[n>>2]=e;c[o>>2]=f;c[p>>2]=g;c[q>>2]=h;if((c[(c[(c[m>>2]|0)+12>>2]|0)+20>>2]|0)!=16){c[l>>2]=12;s=c[l>>2]|0;i=k;return s|0}if((c[o>>2]|0)>>>0<(c[q>>2]|0)>>>0){c[l>>2]=200;s=c[l>>2]|0;i=k;return s|0}if((d[(c[m>>2]|0)+128+68>>0]|0)>>>2&1|0){c[l>>2]=139;s=c[l>>2]|0;i=k;return s|0}if(((d[(c[m>>2]|0)+56>>0]|0)>>>2&1|0)==0?(a[(c[m>>2]|0)+128+68>>0]&1|0)==0:0){if(!((d[(c[m>>2]|0)+56>>0]|0)>>>1&1))pq(c[m>>2]|0,76016,16)|0;if((d[(c[m>>2]|0)+128+68>>0]|0)>>>3&1|0){c[l>>2]=156;s=c[l>>2]|0;i=k;return s|0}if(!((d[(c[m>>2]|0)+128+68>>0]|0)>>>1&1)){tq(c[m>>2]|0,(c[m>>2]|0)+128|0,0,0,1);h=(c[m>>2]|0)+128+68|0;a[h>>0]=a[h>>0]&-3|2}rq((c[m>>2]|0)+128+44|0,c[q>>2]|0);h=(wq((c[m>>2]|0)+128+44|0)|0)!=0;g=c[m>>2]|0;if(!h){h=g+128+68|0;a[h>>0]=a[h>>0]&-5|4;c[l>>2]=139;s=c[l>>2]|0;i=k;return s|0}c[r>>2]=lq(g,c[n>>2]|0,c[o>>2]|0,c[p>>2]|0,c[q>>2]|0)|0;if(c[r>>2]|0){c[l>>2]=c[r>>2];s=c[l>>2]|0;i=k;return s|0}else{tq(c[m>>2]|0,(c[m>>2]|0)+128|0,c[n>>2]|0,c[q>>2]|0,0);c[l>>2]=0;s=c[l>>2]|0;i=k;return s|0}}c[l>>2]=156;s=c[l>>2]|0;i=k;return s|0}function pq(b,d,e){b=b|0;d=d|0;e=e|0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>>>0>=8){f=x;b=Xw(c[f>>2]|0,c[f+4>>2]|0,16843009,16843009)|0;f=x;c[f>>2]=b;c[f+4>>2]=C;do{c[y>>2]=c[u>>2];f=x;b=c[f+4>>2]|0;e=c[y>>2]|0;c[e>>2]=c[f>>2];c[e+4>>2]=b;c[v>>2]=(c[v>>2]|0)-8;c[u>>2]=(c[u>>2]|0)+8}while((c[v>>2]|0)>>>0>=8)}while(1){if(!(c[v>>2]|0))break a;a[c[u>>2]>>0]=a[w>>0]|0;c[u>>2]=(c[u>>2]|0)+1;c[v>>2]=(c[v>>2]|0)+-1}}else{Ow((c[k>>2]|0)+80|0,c[l>>2]|0,c[m>>2]|0)|0;a[(c[k>>2]|0)+80+14>>0]=0;a[(c[k>>2]|0)+80+13>>0]=0;a[(c[k>>2]|0)+80+12>>0]=0;a[(c[k>>2]|0)+80+15>>0]=1}while(0);sb[c[(c[(c[k>>2]|0)+12>>2]|0)+36>>2]&63]((c[k>>2]|0)+496|0,(c[k>>2]|0)+128+52|0,(c[k>>2]|0)+80|0)|0;vq((c[k>>2]|0)+80|0,1)|0;c[(c[k>>2]|0)+112>>2]=0;m=(c[k>>2]|0)+56|0;a[m>>0]=a[m>>0]&-3|2;m=(c[k>>2]|0)+56|0;a[m>>0]=a[m>>0]&-5;c[h>>2]=0;z=c[h>>2]|0;i=g;return z|0}function rq(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=i;i=i+16|0;if((i|0)>=(j|0))U();e=d+4|0;f=d;c[e>>2]=a;c[f>>2]=b;b=c[e>>2]|0;c[b>>2]=(c[b>>2]|0)+(c[f>>2]|0);if((c[c[e>>2]>>2]|0)>>>0>=(c[f>>2]|0)>>>0){i=d;return}f=(c[e>>2]|0)+4|0;c[f>>2]=(c[f>>2]|0)+1;i=d;return}function sq(a){a=a|0;var b=0,d=0,e=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b+4|0;e=b;c[e>>2]=a;do if((c[(c[e>>2]|0)+4>>2]|0)>>>0<=536870911){if((c[(c[e>>2]|0)+4>>2]|0)>>>0<536870911){c[d>>2]=1;break}if((c[c[e>>2]>>2]|0)>>>0<=4294967295){c[d>>2]=1;break}else{c[d>>2]=0;break}}else c[d>>2]=0;while(0);i=b;return c[d>>2]|0}function tq(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0;h=i;i=i+48|0;if((i|0)>=(j|0))U();k=h+40|0;l=h+36|0;m=h+32|0;n=h+28|0;o=h+24|0;p=h+20|0;q=h+16|0;r=h+12|0;s=h+8|0;t=h+4|0;u=h;c[k>>2]=b;c[l>>2]=d;c[m>>2]=e;c[n>>2]=f;c[o>>2]=g;c[p>>2]=16;c[q>>2]=c[(c[k>>2]|0)+128+32>>2];c[r>>2]=c[(c[k>>2]|0)+128+96>>2];c[u>>2]=0;if((c[n>>2]|0)==0?!((c[q>>2]|0)!=0&(c[o>>2]|0)!=0):0){i=h;return}a:do{if((c[q>>2]|0)>>>0>0?1:((c[n>>2]|0)+(c[q>>2]|0)|0)>>>0<(c[p>>2]|0)>>>0){c[t>>2]=(c[p>>2]|0)-(c[q>>2]|0);c[t>>2]=(c[t>>2]|0)>>>0<(c[n>>2]|0)>>>0?c[t>>2]|0:c[n>>2]|0;uq((c[k>>2]|0)+128+16+(c[q>>2]|0)|0,c[m>>2]|0,c[t>>2]|0);c[q>>2]=(c[q>>2]|0)+(c[t>>2]|0);c[m>>2]=(c[m>>2]|0)+(c[t>>2]|0);c[n>>2]=(c[n>>2]|0)-(c[t>>2]|0)}b:do if(!(c[n>>2]|0)){if(!(c[o>>2]|0))break a;while(1){if((c[q>>2]|0)>>>0>=(c[p>>2]|0)>>>0)break b;g=c[q>>2]|0;c[q>>2]=g+1;a[(c[k>>2]|0)+128+16+g>>0]=0}}while(0);if((c[q>>2]|0)>>>0>0){if((c[q>>2]|0)!=(c[p>>2]|0)){v=11;break}c[u>>2]=zb[c[r>>2]&7](c[k>>2]|0,c[l>>2]|0,(c[k>>2]|0)+128+16|0,1)|0;c[q>>2]=0}c[s>>2]=((c[n>>2]|0)>>>0)/((c[p>>2]|0)>>>0)|0;if(c[s>>2]|0){c[u>>2]=zb[c[r>>2]&7](c[k>>2]|0,c[l>>2]|0,c[m>>2]|0,c[s>>2]|0)|0;g=R(c[p>>2]|0,c[s>>2]|0)|0;c[m>>2]=(c[m>>2]|0)+g;g=R(c[p>>2]|0,c[s>>2]|0)|0;c[n>>2]=(c[n>>2]|0)-g}}while((c[n>>2]|0)>>>0>0);if((v|0)==11)Fe(46692,46712,499,46725);c[(c[k>>2]|0)+128+32>>2]=c[q>>2];if(!(c[u>>2]|0)){i=h;return}Qe(c[u>>2]|0);Re();i=h;return}function uq(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0;f=i;i=i+32|0;if((i|0)>=(j|0))U();g=f+28|0;h=f+24|0;k=f+20|0;l=f+16|0;m=f+12|0;n=f+8|0;o=f+4|0;c[g>>2]=b;c[h>>2]=d;c[k>>2]=e;c[l>>2]=c[g>>2];c[m>>2]=c[h>>2];c[f>>2]=3;if(!((c[l>>2]|c[m>>2])&3)){c[n>>2]=c[l>>2];c[o>>2]=c[m>>2];while(1){if((c[k>>2]|0)>>>0<4)break;h=c[o>>2]|0;c[o>>2]=h+4;g=c[h>>2]|0;h=c[n>>2]|0;c[n>>2]=h+4;c[h>>2]=g;c[k>>2]=(c[k>>2]|0)-4}c[l>>2]=c[n>>2];c[m>>2]=c[o>>2]}while(1){if(!(c[k>>2]|0))break;o=c[m>>2]|0;c[m>>2]=o+1;n=a[o>>0]|0;o=c[l>>2]|0;c[l>>2]=o+1;a[o>>0]=n;c[k>>2]=(c[k>>2]|0)+-1}i=f;return}function vq(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;d=i;i=i+32|0;if((i|0)>=(j|0))U();e=d+16|0;f=d+12|0;g=d+4|0;h=d;c[e>>2]=a;c[f>>2]=b;c[d+8>>2]=16;c[g>>2]=(c[e>>2]|0)+16+-4;e=Uw(c[c[g>>2]>>2]|0)|0;c[h>>2]=e+(c[f>>2]|0);f=Uw(c[h>>2]|0)|0;c[c[g>>2]>>2]=f;i=d;return c[h>>2]|0}function wq(a){a=a|0;var b=0,d=0,e=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b+4|0;e=b;c[e>>2]=a;do if((c[(c[e>>2]|0)+4>>2]|0)>>>0<=15){if((c[(c[e>>2]|0)+4>>2]|0)>>>0<15){c[d>>2]=1;break}if((c[c[e>>2]>>2]|0)>>>0<=4294967264){c[d>>2]=1;break}else{c[d>>2]=0;break}}else c[d>>2]=0;while(0);i=b;return c[d>>2]|0}function xq(b,e,f,g,h){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;k=i;i=i+32|0;if((i|0)>=(j|0))U();l=k+20|0;m=k+16|0;n=k+12|0;o=k+8|0;p=k+4|0;q=k;c[m>>2]=b;c[n>>2]=e;c[o>>2]=f;c[p>>2]=g;c[q>>2]=h;if((c[(c[(c[m>>2]|0)+12>>2]|0)+20>>2]|0)!=16){c[l>>2]=12;r=c[l>>2]|0;i=k;return r|0}if((c[o>>2]|0)>>>0<(c[q>>2]|0)>>>0){c[l>>2]=200;r=c[l>>2]|0;i=k;return r|0}if((d[(c[m>>2]|0)+128+68>>0]|0)>>>2&1|0){c[l>>2]=139;r=c[l>>2]|0;i=k;return r|0}if(((d[(c[m>>2]|0)+56>>0]|0)>>>2&1|0)==0?(a[(c[m>>2]|0)+128+68>>0]&1|0)==0:0){if(!((d[(c[m>>2]|0)+56>>0]|0)>>>1&1))pq(c[m>>2]|0,76032,16)|0;if(!((d[(c[m>>2]|0)+128+68>>0]|0)>>>1&1)){tq(c[m>>2]|0,(c[m>>2]|0)+128|0,0,0,1);h=(c[m>>2]|0)+128+68|0;a[h>>0]=a[h>>0]&-3|2}rq((c[m>>2]|0)+128+44|0,c[q>>2]|0);h=(wq((c[m>>2]|0)+128+44|0)|0)!=0;g=c[m>>2]|0;if(h){tq(g,(c[m>>2]|0)+128|0,c[p>>2]|0,c[q>>2]|0,0);c[l>>2]=lq(c[m>>2]|0,c[n>>2]|0,c[o>>2]|0,c[p>>2]|0,c[q>>2]|0)|0;r=c[l>>2]|0;i=k;return r|0}else{q=g+128+68|0;a[q>>0]=a[q>>0]&-5|4;c[l>>2]=139;r=c[l>>2]|0;i=k;return r|0}}c[l>>2]=156;r=c[l>>2]|0;i=k;return r|0}function yq(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b;c[d>>2]=a;a=(c[d>>2]|0)+128+80|0;c[a>>2]=0;c[a+4>>2]=0;c[a+8>>2]=0;c[a+12>>2]=0;sb[c[(c[(c[d>>2]|0)+12>>2]|0)+36>>2]&63]((c[d>>2]|0)+496|0,(c[d>>2]|0)+128+80|0,(c[d>>2]|0)+128+80|0)|0;zq(c[d>>2]|0);i=b;return}function zq(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b;c[d>>2]=a;c[(c[d>>2]|0)+128+96>>2]=2;Eq((c[d>>2]|0)+128+80|0,(c[d>>2]|0)+128+100|0);i=b;return}function Aq(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,k=0,l=0,m=0;f=i;i=i+32|0;if((i|0)>=(j|0))U();g=f+20|0;h=f+16|0;k=f+12|0;l=f+8|0;m=f;c[g>>2]=a;c[h>>2]=b;c[k>>2]=d;c[l>>2]=e;c[f+4>>2]=16;c[m>>2]=0;while(1){if(!(c[l>>2]|0))break;c[m>>2]=Bq(c[h>>2]|0,c[k>>2]|0,(c[g>>2]|0)+128+100|0)|0;c[k>>2]=(c[k>>2]|0)+16;c[l>>2]=(c[l>>2]|0)+-1}i=f;return (c[m>>2]|0)+(c[m>>2]|0?20:0)|0}function Bq(a,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]|0,(c[h>>2]|0)+128+32+240|0);c[m>>2]=(c[m>>2]|0)-16;while(1){o=c[k>>2]|0;if(!(c[m>>2]|0))break;Mq(o);c[m>>2]=(c[m>>2]|0)+-1}c[g>>2]=o;n=c[g>>2]|0;i=f;return n|0}function Iq(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;d=i;i=i+16|0;if((i|0)>=(j|0))U();e=d+8|0;f=d;g=f;c[g>>2]=a;c[g+4>>2]=b;b=f;g=c[b+4>>2]|0;if((c[f>>2]|0)!=0|0!=0){c[e>>2]=Jq(c[b>>2]|0)|0;h=c[e>>2]|0;i=d;return h|0}else{c[e>>2]=32+(Jq(g)|0);h=c[e>>2]|0;i=d;return h|0}return 0}function Jq(a){a=a|0;var b=0,d=0,e=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b;c[d>>2]=a;a=(c[d>>2]|0)!=0;e=Iw(c[d>>2]|0)|0;i=b;return (a?e:32)|0}function Kq(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=i;i=i+16|0;if((i|0)>=(j|0))U();e=d+4|0;f=d;c[e>>2]=a;c[f>>2]=b;if((c[e>>2]|0)!=(c[f>>2]|0))Lq(c[e>>2]|0,c[f>>2]|0,16);Mq(c[e>>2]|0);i=d;return}function Lq(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0;f=i;i=i+32|0;if((i|0)>=(j|0))U();g=f+28|0;h=f+24|0;k=f+20|0;l=f+16|0;m=f+12|0;n=f+8|0;o=f+4|0;c[g>>2]=b;c[h>>2]=d;c[k>>2]=e;c[l>>2]=c[g>>2];c[m>>2]=c[h>>2];c[f>>2]=3;if(!((c[l>>2]|c[m>>2])&3)){c[n>>2]=c[l>>2];c[o>>2]=c[m>>2];while(1){if((c[k>>2]|0)>>>0<4)break;h=c[o>>2]|0;c[o>>2]=h+4;g=c[h>>2]|0;h=c[n>>2]|0;c[n>>2]=h+4;c[h>>2]=g;c[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b;c[l>>2]=e;c[m>>2]=f;c[r>>2]=0;if(!(a[(c[k>>2]|0)+56>>0]&1)){c[h>>2]=156;E=c[h>>2]|0;i=g;return E|0}switch(d[(c[k>>2]|0)+128+352>>0]|0|0){case 16:case 12:case 8:break;default:{c[h>>2]=59;E=c[h>>2]|0;i=g;return E|0}}if((c[(c[(c[k>>2]|0)+12>>2]|0)+20>>2]|0)!=16){c[h>>2]=12;E=c[h>>2]|0;i=g;return E|0}if(!(c[l>>2]|0)){c[h>>2]=45;E=c[h>>2]|0;i=g;return E|0}if((c[m>>2]|0)>>>0>15|(c[m>>2]|0)>>>0<8|(c[m>>2]|0)>>>0>=16){c[h>>2]=139;E=c[h>>2]|0;i=g;return E|0}f=n;e=f+16|0;do{a[f>>0]=0;f=f+1|0}while((f|0)<(e|0));c[s>>2]=sb[c[(c[(c[k>>2]|0)+12>>2]|0)+36>>2]&63]((c[k>>2]|0)+496|0,(c[k>>2]|0)+128|0,n)|0;c[r>>2]=(c[s>>2]|0)>>>0>(c[r>>2]|0)>>>0?c[s>>2]|0:c[r>>2]|0;Kq((c[k>>2]|0)+128+16|0,(c[k>>2]|0)+128|0);Kq((c[k>>2]|0)+128+32|0,(c[k>>2]|0)+128+16|0);c[q>>2]=1;while(1){if((c[q>>2]|0)>=16)break;Kq((c[k>>2]|0)+128+32+(c[q>>2]<<4)|0,(c[k>>2]|0)+128+32+((c[q>>2]|0)-1<<4)|0);c[q>>2]=(c[q>>2]|0)+1}Sw(n|0,0,16-(c[m>>2]|0)|0)|0;Lq(n+(16-(c[m>>2]|0))|0,c[l>>2]|0,c[m>>2]|0);a[n>>0]=(((d[(c[k>>2]|0)+128+352>>0]|0)<<3|0)%128|0)<<1;l=n+(16-(c[m>>2]|0)-1)|0;a[l>>0]=d[l>>0]|0|1;c[p>>2]=(d[n+15>>0]|0)&63;l=n+15|0;a[l>>0]=(d[l>>0]|0)&192;c[s>>2]=sb[c[(c[(c[k>>2]|0)+12>>2]|0)+36>>2]&63]((c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]|c[q>>2])&3)){c[r>>2]=c[o>>2];c[s>>2]=c[p>>2];c[t>>2]=c[q>>2];while(1){if((c[n>>2]|0)>>>0<4)break;m=c[s>>2]|0;c[s>>2]=m+4;l=c[m>>2]|0;m=c[t>>2]|0;c[t>>2]=m+4;k=l^c[m>>2];m=c[r>>2]|0;c[r>>2]=m+4;c[m>>2]=k;c[n>>2]=(c[n>>2]|0)-4}c[o>>2]=c[r>>2];c[p>>2]=c[s>>2];c[q>>2]=c[t>>2]}while(1){if(!(c[n>>2]|0))break;t=c[p>>2]|0;c[p>>2]=t+1;s=d[t>>0]|0;t=c[q>>2]|0;c[q>>2]=t+1;r=(s^(d[t>>0]|0))&255;t=c[o>>2]|0;c[o>>2]=t+1;a[t>>0]=r;c[n>>2]=(c[n>>2]|0)+-1}i=h;return}function Rq(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,k=0,l=0,m=0,n=0,o=0;h=i;i=i+32|0;if((i|0)>=(j|0))U();k=h+16|0;l=h+12|0;m=h+8|0;n=h+4|0;o=h;c[k>>2]=b;c[l>>2]=e;c[m>>2]=f;c[n>>2]=g;c[l>>2]=(c[l>>2]|0)+(((c[m>>2]|0)>>>0)/8|0);c[o>>2]=((c[m>>2]|0)>>>0)%8|0;if(c[o>>2]|0){while(1){if(!(c[n>>2]|0))break;a[c[k>>2]>>0]=(d[c[l>>2]>>0]|0)<<c[o>>2]|(d[(c[l>>2]|0)+1>>0]|0)>>8-(c[o>>2]|0);c[n>>2]=(c[n>>2]|0)+-1;c[k>>2]=(c[k>>2]|0)+1;c[l>>2]=(c[l>>2]|0)+1}i=h;return}else{while(1){if(!(c[n>>2]|0))break;a[c[k>>2]>>0]=a[c[l>>2]>>0]|0;c[n>>2]=(c[n>>2]|0)+-1;c[k>>2]=(c[k>>2]|0)+1;c[l>>2]=(c[l>>2]|0)+1}i=h;return}}function Sq(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=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>>2]|0:c[u>>2]|0;v=(c[n>>2]|0)+128+353|0;a[v>>0]=a[v>>0]&-2|1}if((c[u>>2]|0)>>>0>0){Qe((c[u>>2]|0)+16|0);Re()}c[m>>2]=0;z=c[m>>2]|0;i=l;return z|0}c[m>>2]=156;z=c[m>>2]|0;i=l;return z|0}function Vq(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=i;i=i+16|0;if((i|0)>=(j|0))U();f=e+8|0;g=e+4|0;h=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;while(1){if((c[h>>2]|0)>>>0<=0)break;Sq(c[f>>2]|0,c[g>>2]|0,16);c[g>>2]=(c[g>>2]|0)+16;c[h>>2]=(c[h>>2]|0)+-1}i=e;return}function Wq(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,k=0,l=0,m=0,n=0;g=i;i=i+32|0;if((i|0)>=(j|0))U();h=g+16|0;k=g+12|0;l=g+8|0;m=g+4|0;n=g;c[h>>2]=a;c[k>>2]=b;c[l>>2]=d;c[m>>2]=e;c[n>>2]=f;f=Uq(c[h>>2]|0,0,c[k>>2]|0,c[l>>2]|0,c[m>>2]|0,c[n>>2]|0)|0;i=g;return f|0}function Xq(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0;g=i;i=i+48|0;if((i|0)>=(j|0))U();h=g+40|0;k=g+36|0;l=g+32|0;m=g+28|0;n=g+24|0;o=g+20|0;p=g+16|0;q=g+12|0;r=g+8|0;s=g+4|0;t=g;c[k>>2]=a;c[l>>2]=b;c[m>>2]=d;c[n>>2]=e;c[o>>2]=f;c[q>>2]=c[(c[(c[k>>2]|0)+12>>2]|0)+36>>2];c[r>>2]=c[(c[(c[k>>2]|0)+12>>2]|0)+20>>2];if((c[m>>2]|0)>>>0<(c[o>>2]|0)>>>0){c[h>>2]=200;u=c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0))U();e=d;f=d+8|0;c[e>>2]=b;a[f>>0]=0;a[f+1>>0]=0;a[f+2>>0]=0;a[f+3>>0]=0;a[f+4>>0]=0;a[f+5>>0]=0;a[f+6>>0]=0;a[f+7>>0]=0;b=_q(c[e>>2]|0,f,8)|0;i=d;return b|0}function _q(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0;g=i;i=i+112|0;if((i|0)>=(j|0))U();h=g+36|0;k=g+32|0;l=g+28|0;m=g+24|0;n=g+48|0;o=g+20|0;p=g+16|0;q=g+12|0;r=g+40|0;s=g;t=g+8|0;c[k>>2]=b;c[l>>2]=e;c[m>>2]=f;if((c[l>>2]|0)==0&(c[m>>2]|0)!=12){c[h>>2]=45;u=c[h>>2]|0;i=g;return u|0}f=(c[k>>2]|0)+128+20|0;e=f+92|0;do{c[f>>2]=0;f=f+4|0}while((f|0)<(e|0));c[(c[k>>2]|0)+128>>2]=0;c[(c[k>>2]|0)+128+4>>2]=0;c[(c[k>>2]|0)+128+8>>2]=0;c[(c[k>>2]|0)+128+8+4>>2]=0;b=(c[k>>2]|0)+128+16|0;a[b>>0]=a[b>>0]&-3;b=(c[k>>2]|0)+128+16|0;a[b>>0]=a[b>>0]&-2;b=(c[k>>2]|0)+56|0;a[b>>0]=a[b>>0]&-5;b=(c[k>>2]|0)+56|0;a[b>>0]=a[b>>0]&-3;xb[c[(c[(c[k>>2]|0)+12>>2]|0)+60>>2]&7]((c[k>>2]|0)+496|0,c[l>>2]|0,c[m>>2]|0);f=n;e=f+64|0;do{a[f>>0]=0;f=f+1|0}while((f|0)<(e|0));Cb[c[(c[(c[k>>2]|0)+12>>2]|0)+44>>2]&1]((c[k>>2]|0)+496|0,n,n,64);c[o>>2]=Fr((c[k>>2]|0)+128+20|0,n,32)|0;c[p>>2]=n;c[q>>2]=64;a[r>>0]=0;n=s;c[n>>2]=d[r>>0];c[n+4>>2]=0;while(1){if(!(c[p>>2]&7|0?(c[q>>2]|0)!=0:0))break;a[c[p>>2]>>0]=a[r>>0]|0;c[p>>2]=(c[p>>2]|0)+1;c[q>>2]=(c[q>>2]|0)+-1}if((c[q>>2]|0)>>>0>=8){n=s;f=Xw(c[n>>2]|0,c[n+4>>2]|0,16843009,16843009)|0;n=s;c[n>>2]=f;c[n+4>>2]=C;do{c[t>>2]=c[p>>2];n=s;f=c[n+4>>2]|0;e=c[t>>2]|0;c[e>>2]=c[n>>2];c[e+4>>2]=f;c[q>>2]=(c[q>>2]|0)-8;c[p>>2]=(c[p>>2]|0)+8}while((c[q>>2]|0)>>>0>=8)}while(1){if(!(c[q>>2]|0))break;a[c[p>>2]>>0]=a[r>>0]|0;c[p>>2]=(c[p>>2]|0)+1;c[q>>2]=(c[q>>2]|0)+-1}if(c[o>>2]|0){c[h>>2]=c[o>>2];u=c[h>>2]|0;i=g;return u|0}else{o=(c[k>>2]|0)+56|0;a[o>>0]=a[o>>0]&-3|2;c[h>>2]=0;u=c[h>>2]|0;i=g;return u|0}return 0}function $q(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,k=0;d=i;i=i+16|0;if((i|0)>=(j|0))U();e=d+12|0;f=d+8|0;g=d+4|0;h=d;c[f>>2]=a;c[g>>2]=b;c[h>>2]=0;b=c[f>>2]|0;c[b>>2]=(c[b>>2]|0)+(c[g>>2]|0);if((c[c[f>>2]>>2]|0)>>>0>=(c[g>>2]|0)>>>0){c[e>>2]=c[h>>2];k=c[e>>2]|0;i=d;return k|0}else{g=(c[f>>2]|0)+4|0;c[g>>2]=(c[g>>2]|0)+1;c[e>>2]=((c[(c[f>>2]|0)+4>>2]|0)>>>0<1?1:(c[h>>2]|0)!=0)&1;k=c[e>>2]|0;i=d;return k|0}return 0}function ar(b,e,f,g,h){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;k=i;i=i+32|0;if((i|0)>=(j|0))U();l=k+24|0;m=k+20|0;n=k+16|0;o=k+12|0;p=k+8|0;q=k+4|0;r=k;c[m>>2]=b;c[n>>2]=e;c[o>>2]=f;c[p>>2]=g;c[q>>2]=h;if((c[o>>2]|0)>>>0<(c[q>>2]|0)>>>0){c[l>>2]=200;s=c[l>>2]|0;i=k;return s|0}if((d[(c[m>>2]|0)+56>>0]|0)>>>2&1|0){c[l>>2]=156;s=c[l>>2]|0;i=k;return s|0}if((d[(c[m>>2]|0)+128+16>>0]|0)>>>1&1|0){c[l>>2]=139;s=c[l>>2]|0;i=k;return s|0}if(((d[(c[m>>2]|0)+56>>0]|0)>>>1&1|0)==0?(c[r>>2]=Zq(c[m>>2]|0)|0,c[r>>2]|0):0){c[l>>2]=c[r>>2];s=c[l>>2]|0;i=k;return s|0}if(!(a[(c[m>>2]|0)+128+16>>0]&1))br(c[m>>2]|0);r=($q((c[m>>2]|0)+128+8|0,c[q>>2]|0)|0)!=0;o=c[m>>2]|0;if(r){r=o+128+16|0;a[r>>0]=a[r>>0]&-3|2;c[l>>2]=139;s=c[l>>2]|0;i=k;return s|0}else{Cb[c[(c[o+12>>2]|0)+44>>2]&1]((c[m>>2]|0)+496|0,c[n>>2]|0,c[p>>2]|0,c[q>>2]|0);Br((c[m>>2]|0)+128+20|0,c[n>>2]|0,c[q>>2]|0);c[l>>2]=0;s=c[l>>2]|0;i=k;return s|0}return 0}function br(b){b=b|0;var d=0,e=0;d=i;i=i+16|0;if((i|0)>=(j|0))U();e=d;c[e>>2]=b;cr(c[e>>2]|0,(c[e>>2]|0)+128|0);b=(c[e>>2]|0)+128+16|0;a[b>>0]=a[b>>0]&-2|1;c[(c[e>>2]|0)+128+8>>2]=0;c[(c[e>>2]|0)+128+8+4>>2]=0;i=d;return}function cr(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=i;i=i+16|0;if((i|0)>=(j|0))U();e=d+8|0;f=d+4|0;g=d;c[e>>2]=a;c[f>>2]=b;if((((c[c[f>>2]>>2]|0)>>>0)%16|0)>>>0<=0){i=d;return}c[g>>2]=16-(((c[c[f>>2]>>2]|0)>>>0)%16|0);Br((c[e>>2]|0)+128+20|0,76048,c[g>>2]|0);i=d;return}function dr(b,e,f,g,h){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;k=i;i=i+32|0;if((i|0)>=(j|0))U();l=k+24|0;m=k+20|0;n=k+16|0;o=k+12|0;p=k+8|0;q=k+4|0;r=k;c[m>>2]=b;c[n>>2]=e;c[o>>2]=f;c[p>>2]=g;c[q>>2]=h;if((c[o>>2]|0)>>>0<(c[q>>2]|0)>>>0){c[l>>2]=200;s=c[l>>2]|0;i=k;return s|0}if((d[(c[m>>2]|0)+56>>0]|0)>>>2&1|0){c[l>>2]=156;s=c[l>>2]|0;i=k;return s|0}if((d[(c[m>>2]|0)+128+16>>0]|0)>>>1&1|0){c[l>>2]=139;s=c[l>>2]|0;i=k;return s|0}if(((d[(c[m>>2]|0)+56>>0]|0)>>>1&1|0)==0?(c[r>>2]=Zq(c[m>>2]|0)|0,c[r>>2]|0):0){c[l>>2]=c[r>>2];s=c[l>>2]|0;i=k;return s|0}if(!(a[(c[m>>2]|0)+128+16>>0]&1))br(c[m>>2]|0);r=($q((c[m>>2]|0)+128+8|0,c[q>>2]|0)|0)!=0;o=(c[m>>2]|0)+128|0;if(r){r=o+16|0;a[r>>0]=a[r>>0]&-3|2;c[l>>2]=139;s=c[l>>2]|0;i=k;return s|0}else{Br(o+20|0,c[p>>2]|0,c[q>>2]|0);Cb[c[(c[(c[m>>2]|0)+12>>2]|0)+48>>2]&1]((c[m>>2]|0)+496|0,c[n>>2]|0,c[p>>2]|0,c[q>>2]|0);c[l>>2]=0;s=c[l>>2]|0;i=k;return s|0}return 0}function er(b){b=b|0;var d=0,e=0;d=i;i=i+16|0;if((i|0)>=(j|0))U();e=d;c[e>>2]=b;c[(c[e>>2]|0)+128>>2]=0;c[(c[e>>2]|0)+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[t>>2]=(c[t>>2]|0)+(c[r>>2]|0)}tb[c[p>>2]&15](c[v>>2]|0,c[A>>2]|0,c[x>>2]|0,c[y>>2]|0,c[q>>2]|0);if(vv(c[x>>2]|0,c[w>>2]|0,R(c[q>>2]|0,c[r>>2]|0)|0)|0){hf(c[B>>2]|0);c[m>>2]=46778;E=c[m>>2]|0;i=l;return E|0}q=(vv(c[A>>2]|0,c[z>>2]|0,c[r>>2]|0)|0)!=0;hf(c[B>>2]|0);if(q){c[m>>2]=46778;E=c[m>>2]|0;i=l;return E|0}else{c[m>>2]=0;E=c[m>>2]|0;i=l;return E|0}return 0}function gr(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;h=i;i=i+48|0;if((i|0)>=(j|0))U();k=h+40|0;l=h+36|0;m=h+32|0;n=h+28|0;o=h+24|0;p=h+20|0;q=h+16|0;r=h+12|0;s=h+8|0;t=h+4|0;c[k>>2]=b;c[l>>2]=e;c[m>>2]=f;c[n>>2]=g;c[o>>2]=c[k>>2];c[p>>2]=c[l>>2];c[q>>2]=c[m>>2];c[h>>2]=3;if(!((c[o>>2]|c[p>>2]|c[q>>2])&3)){c[r>>2]=c[o>>2];c[s>>2]=c[p>>2];c[t>>2]=c[q>>2];while(1){if((c[n>>2]|0)>>>0<4)break;m=c[s>>2]|0;c[s>>2]=m+4;l=c[m>>2]|0;m=c[t>>2]|0;c[t>>2]=m+4;k=l^c[m>>2];m=c[r>>2]|0;c[r>>2]=m+4;c[m>>2]=k;c[n>>2]=(c[n>>2]|0)-4}c[o>>2]=c[r>>2];c[p>>2]=c[s>>2];c[q>>2]=c[t>>2]}while(1){if(!(c[n>>2]|0))break;t=c[p>>2]|0;c[p>>2]=t+1;s=d[t>>0]|0;t=c[q>>2]|0;c[q>>2]=t+1;r=(s^(d[t>>0]|0))&255;t=c[o>>2]|0;c[o>>2]=t+1;a[t>>0]=r;c[n>>2]=(c[n>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2]|0;i=l;return E|0}return 0}function ir(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;h=i;i=i+48|0;if((i|0)>=(j|0))U();k=h+40|0;l=h+36|0;m=h+32|0;n=h+28|0;o=h+24|0;p=h+20|0;q=h+16|0;r=h+12|0;s=h+8|0;t=h+4|0;c[k>>2]=b;c[l>>2]=e;c[m>>2]=f;c[n>>2]=g;c[o>>2]=c[k>>2];c[p>>2]=c[l>>2];c[q>>2]=c[m>>2];c[h>>2]=3;if(!((c[q>>2]|c[o>>2]|c[p>>2])&3)){c[r>>2]=c[o>>2];c[s>>2]=c[p>>2];c[t>>2]=c[q>>2];while(1){if((c[n>>2]|0)>>>0<4)break;m=c[t>>2]|0;c[t>>2]=m+4;l=c[m>>2]|0;m=c[s>>2]|0;c[s>>2]=m+4;k=c[m>>2]^l;c[m>>2]=k;m=c[r>>2]|0;c[r>>2]=m+4;c[m>>2]=k;c[n>>2]=(c[n>>2]|0)-4}c[o>>2]=c[r>>2];c[p>>2]=c[s>>2];c[q>>2]=c[t>>2]}while(1){if(!(c[n>>2]|0))break;t=c[q>>2]|0;c[q>>2]=t+1;s=d[t>>0]|0;t=c[p>>2]|0;c[p>>2]=t+1;r=((d[t>>0]|0)^s)&255;a[t>>0]=r;t=c[o>>2]|0;c[o>>2]=t+1;a[t>>0]=r;c[n>>2]=(c[n>>2]|0)+-1}i=h;return}function jr(b,e,f,g,h,k,l){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;k=k|0;l=l|0;var m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0;m=i;i=i+96|0;if((i|0)>=(j|0))U();n=m+84|0;o=m+76|0;p=m+72|0;q=m+68|0;r=m+64|0;s=m+60|0;t=m+56|0;u=m+52|0;v=m+48|0;w=m+44|0;x=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)|0;c[v>>2]=0;while(1){if((c[v>>2]|0)>=(c[s>>2]|0))break;o=(c[B>>2]|0)+((c[u>>2]|0)+(c[v>>2]|0))|0;a[o>>0]=d[o>>0]^d[(c[z>>2]|0)+((c[u>>2]|0)+(c[v>>2]|0))>>0];c[v>>2]=(c[v>>2]|0)+1}c[v>>2]=c[s>>2];while(1){if((c[v>>2]|0)<=0)break;o=(c[D>>2]|0)+((c[v>>2]|0)-1)|0;a[o>>0]=(a[o>>0]|0)+1<<24>>24;if(a[(c[D>>2]|0)+((c[v>>2]|0)-1)>>0]|0)break;c[v>>2]=(c[v>>2]|0)+-1}c[u>>2]=(c[u>>2]|0)+(c[s>>2]|0)}tb[c[q>>2]&15](c[y>>2]|0,c[E>>2]|0,c[C>>2]|0,c[A>>2]|0,c[r>>2]|0);if(vv(c[C>>2]|0,c[B>>2]|0,R(c[s>>2]|0,c[r>>2]|0)|0)|0){hf(c[F>>2]|0);c[n>>2]=46876;I=c[n>>2]|0;i=m;return I|0}if(vv(c[E>>2]|0,c[D>>2]|0,c[s>>2]|0)|0){hf(c[F>>2]|0);c[n>>2]=46876;I=c[n>>2]|0;i=m;return I|0}c[x>>2]=0;while(1){if((c[x>>2]|0)>=(c[r>>2]|0)){J=56;break}Sw(c[D>>2]|0,-1,c[s>>2]|0)|0;C=(c[D>>2]|0)+((c[s>>2]|0)-1)|0;a[C>>0]=(d[C>>0]|0)-(c[x>>2]|0);a[(c[D>>2]|0)+1>>0]=0;a[c[D>>2]>>0]=0;a[(c[D>>2]|0)+2>>0]=7;c[u>>2]=0;while(1){if((c[u>>2]|0)>=(R(c[s>>2]|0,c[r>>2]|0)|0))break;a[(c[z>>2]|0)+(c[u>>2]|0)>>0]=c[u>>2];c[u>>2]=(c[u>>2]|0)+1}c[u>>2]=0;while(1){if((c[u>>2]|0)>=(R(c[s>>2]|0,c[r>>2]|0)|0))break;sb[c[p>>2]&63](c[y>>2]|0,(c[B>>2]|0)+(c[u>>2]|0)|0,c[D>>2]|0)|0;c[v>>2]=0;while(1){if((c[v>>2]|0)>=(c[s>>2]|0))break;C=(c[B>>2]|0)+((c[u>>2]|0)+(c[v>>2]|0))|0;a[C>>0]=d[C>>0]^d[(c[z>>2]|0)+((c[u>>2]|0)+(c[v>>2]|0))>>0];c[v>>2]=(c[v>>2]|0)+1}c[v>>2]=c[s>>2];while(1){if((c[v>>2]|0)<=0)break;C=(c[D>>2]|0)+((c[v>>2]|0)-1)|0;a[C>>0]=(a[C>>0]|0)+1<<24>>24;if(a[(c[D>>2]|0)+((c[v>>2]|0)-1)>>0]|0)break;c[v>>2]=(c[v>>2]|0)+-1}c[u>>2]=(c[u>>2]|0)+(c[s>>2]|0)}Sw(c[E>>2]|0,-1,c[s>>2]|0)|0;C=(c[E>>2]|0)+((c[s>>2]|0)-1)|0;a[C>>0]=(d[C>>0]|0)-(c[x>>2]|0);a[(c[E>>2]|0)+1>>0]=0;a[c[E>>2]>>0]=0;a[(c[E>>2]|0)+2>>0]=7;tb[c[q>>2]&15](c[y>>2]|0,c[E>>2]|0,c[A>>2]|0,c[B>>2]|0,c[r>>2]|0);if(vv(c[A>>2]|0,c[z>>2]|0,R(c[s>>2]|0,c[r>>2]|0)|0)|0){J=52;break}if(vv(c[E>>2]|0,c[D>>2]|0,c[s>>2]|0)|0){J=54;break}c[x>>2]=(c[x>>2]|0)+1}if((J|0)==52){hf(c[F>>2]|0);c[n>>2]=46876;I=c[n>>2]|0;i=m;return I|0}else if((J|0)==54){hf(c[F>>2]|0);c[n>>2]=46876;I=c[n>>2]|0;i=m;return I|0}else if((J|0)==56){hf(c[F>>2]|0);c[n>>2]=0;I=c[n>>2]|0;i=m;return I|0}return 0}function kr(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,V=0,W=0,X=0,Y=0,Z=0,_=0,$=0,aa=0,ba=0,ca=0,da=0;d=i;i=i+352|0;if((i|0)>=(j|0))U();e=d+160|0;f=d+128|0;g=d+48|0;h=d+40|0;k=d+32|0;l=d+24|0;m=d+16|0;n=d+8|0;o=d;p=d+344|0;q=d+340|0;r=d+336|0;s=d+332|0;t=d+328|0;u=d+284|0;v=d+224|0;w=d+220|0;x=d+216|0;y=d+212|0;z=d+208|0;A=d+204|0;B=d+200|0;C=d+196|0;D=d+192|0;E=d+188|0;F=d+184|0;G=d+180|0;H=d+176|0;I=d+172|0;J=d+168|0;K=d+164|0;c[q>>2]=a;c[r>>2]=b;c[w>>2]=0;c[x>>2]=0;c[y>>2]=0;c[z>>2]=0;c[A>>2]=0;c[C>>2]=0;c[D>>2]=0;c[E>>2]=0;c[F>>2]=0;c[G>>2]=0;c[H>>2]=0;c[I>>2]=0;b=u;a=b+44|0;do{c[b>>2]=0;b=b+4|0}while((b|0)<(a|0));b=v;a=b+60|0;do{c[b>>2]=0;b=b+4|0}while((b|0)<(a|0));c[s>>2]=tj(c[q>>2]|0,t)|0;if(c[s>>2]|0){c[p>>2]=c[s>>2];L=c[p>>2]|0;i=d;return L|0}c[B>>2]=Gf(c[q>>2]|0,46978,0)|0;if(c[B>>2]|0?(c[A>>2]=Nf(c[B>>2]|0,1)|0,Ef(c[B>>2]|0),(c[A>>2]|0)==0):0){c[p>>2]=65;L=c[p>>2]|0;i=d;return L|0}c[B>>2]=Gf(c[q>>2]|0,46984,0)|0;if(!(c[B>>2]|0?(c[s>>2]=sj(c[B>>2]|0,I,0)|0,Ef(c[B>>2]|0),(c[s>>2]|0)!=0):0))M=8;do if((M|0)==8){c[B>>2]=Gf(c[q>>2]|0,46990,0)|0;if(c[B>>2]|0){c[I>>2]=c[I>>2]|32;Ef(c[B>>2]|0)}if(!((c[t>>2]|0)!=0|(c[A>>2]|0)!=0)){c[p>>2]=68;L=c[p>>2]|0;i=d;return L|0}c[s>>2]=Dh(c[t>>2]|0,c[A>>2]|0,u,t)|0;hf(c[A>>2]|0);c[A>>2]=0;if(!(c[s>>2]|0)){if(sf(1)|0){b=ii(c[u>>2]|0)|0;a=ji(c[u+4>>2]|0)|0;c[o>>2]=b;c[o+4>>2]=a;Le(47004,o);if(c[u+40>>2]|0){c[n>>2]=c[u+40>>2];Le(47029,n)}Pe(47051,c[u+8>>2]|0);Pe(47067,c[u+12>>2]|0);Pe(47083,c[u+16>>2]|0);Pe(47099,c[u+32>>2]|0);Pe(47115,c[u+36>>2]|0);en(47131,u+20|0,0)}c[C>>2]=rn(c[u>>2]|0,c[u+4>>2]|0,0,c[u+8>>2]|0,c[u+12>>2]|0,c[u+16>>2]|0)|0;a=c[C>>2]|0;b=c[I>>2]|0;if(c[I>>2]&4096|0)c[s>>2]=Zh(v,u,a,b)|0;else c[s>>2]=lr(v,u,a,b,c[t>>2]|0,y,z)|0;if(!(c[s>>2]|0)){c[w>>2]=Ep(0)|0;c[x>>2]=Ep(0)|0;if(fn(c[w>>2]|0,c[x>>2]|0,v+20|0,c[C>>2]|0)|0){c[m>>2]=47521;Je(47145,m)}c[F>>2]=ki(c[w>>2]|0,c[x>>2]|0,c[v+8>>2]|0)|0;do if((c[v+4>>2]|0)==1?!(c[I>>2]&2048|0):0){c[s>>2]=Rh(v+44|0,c[C>>2]|0,c[w>>2]|0,c[x>>2]|0,((c[I>>2]&1024|0)!=0^1^1)&1,J,K)|0;if(!(c[s>>2]|0)){c[G>>2]=Ep(0)|0;rp(c[G>>2]|0,c[J>>2]|0,c[K>>2]<<3)|0;c[J>>2]=0;break}c[p>>2]=c[s>>2];L=c[p>>2]|0;i=d;return L|0}else M=28;while(0);if((M|0)==28){if((c[y>>2]|0)==0?(c[y>>2]=Ep(0)|0,c[z>>2]=Ep(0)|0,fn(c[y>>2]|0,c[z>>2]|0,v+44|0,c[C>>2]|0)|0):0){c[l>>2]=47193;Je(47145,l)}c[G>>2]=ki(c[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f(1)|0:0)?(Pe(47794,c[v+8>>2]|0),Pe(47810,c[v+12>>2]|0),Pe(47826,c[v+16>>2]|0),Pe(47842,c[F>>2]|0),Pe(47858,c[v+32>>2]|0),Pe(47874,c[v+36>>2]|0),Pe(47890,c[G>>2]|0),Pe(47906,c[H>>2]|0),c[I>>2]&4096|0):0)Le(47922,e)}}}while(0);qp(c[H>>2]|0);qp(c[G>>2]|0);qp(c[F>>2]|0);fi(v);nn(v+44|0);qp(c[v+56>>2]|0);fi(u);qp(c[w>>2]|0);qp(c[x>>2]|0);qp(c[y>>2]|0);qp(c[z>>2]|0);vn(c[C>>2]|0);Ef(c[E>>2]|0);Ef(c[D>>2]|0);c[p>>2]=c[s>>2];L=c[p>>2]|0;i=d;return L|0}
+function lr(b,d,e,f,g,h,k){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;k=k|0;var l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0;l=i;i=i+96|0;if((i|0)>=(j|0))U();m=l+16|0;n=l+8|0;o=l;p=l+80|0;q=l+76|0;r=l+72|0;s=l+68|0;t=l+64|0;u=l+60|0;v=l+56|0;w=l+44|0;x=l+40|0;y=l+36|0;z=l+32|0;A=l+28|0;B=l+24|0;C=l+20|0;c[p>>2]=b;c[q>>2]=d;c[r>>2]=e;c[s>>2]=f;c[t>>2]=g;c[u>>2]=h;c[v>>2]=k;c[A>>2]=Zn(c[(c[q>>2]|0)+8>>2]|0)|0;ln(w);if(c[s>>2]&32|0)c[x>>2]=1;else c[x>>2]=2;if((c[(c[r>>2]|0)+4>>2]|0)==1){k=Fp(256)|0;c[(c[p>>2]|0)+56>>2]=k;c[B>>2]=Wm(32,c[x>>2]|0)|0;k=c[B>>2]|0;a[k>>0]=a[k>>0]&127;k=c[B>>2]|0;a[k>>0]=a[k>>0]|64;k=(c[B>>2]|0)+31|0;a[k>>0]=a[k>>0]&248;Lo(c[(c[p>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2]|0,c[(c[p>>2]|0)+56>>2]|0);r=(c[p>>2]|0)+44|0;o=c[y>>2]|0;B=c[z>>2]|0;on(r,o,B,Jp(1)|0)|0;if(sf(1)|0)Le(47195,n)}else mr((c[p>>2]|0)+44|0,w);while(0);c[c[u>>2]>>2]=c[y>>2];c[c[v>>2]>>2]=c[z>>2];nn(w);if(c[s>>2]&16384|0){i=l;return 0}s=c[p>>2]|0;w=(c[t>>2]|0)-64|0;if((c[c[p>>2]>>2]|0)!=1){nr(s,w);i=l;return 0}else{or(s,w);i=l;return 0}return 0}function mr(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=i;i=i+16|0;if((i|0)>=(j|0))U();e=d+4|0;f=d;c[e>>2]=a;c[f>>2]=b;xp(c[c[e>>2]>>2]|0,c[c[f>>2]>>2]|0)|0;xp(c[(c[e>>2]|0)+4>>2]|0,c[(c[f>>2]|0)+4>>2]|0)|0;xp(c[(c[e>>2]|0)+8>>2]|0,c[(c[f>>2]|0)+8>>2]|0)|0;i=d;return}function nr(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0;d=i;i=i+224|0;if((i|0)>=(j|0))U();e=d+168|0;f=d+24|0;g=d+16|0;h=d+8|0;k=d+164|0;l=d+160|0;m=d+104|0;n=d+100|0;o=d+88|0;p=d+84|0;q=d+80|0;r=d+76|0;s=d+72|0;t=d+28|0;c[k>>2]=a;c[l>>2]=b;c[n>>2]=Ep(c[l>>2]|0)|0;c[p>>2]=Ep(c[l>>2]|0)|0;c[q>>2]=Ep(c[l>>2]|0)|0;c[r>>2]=Ep(c[l>>2]|0)|0;c[s>>2]=Ep(c[l>>2]|0)|0;if(sf(1)|0)Le(47288,d);ln(o);b=e;a=c[k>>2]|0;u=b+44|0;do{c[b>>2]=c[a>>2];b=b+4|0;a=a+4|0}while((b|0)<(u|0));gi(t,e);b=m;a=t;u=b+44|0;do{c[b>>2]=c[a>>2];b=b+4|0;a=a+4|0}while((b|0)<(u|0));ln(m+44|0);mr(m+44|0,(c[k>>2]|0)+44|0);Hp(c[n>>2]|0,c[l>>2]|0,0);if(jt(c[n>>2]|0,c[k>>2]|0,c[r>>2]|0,c[s>>2]|0,0,0)|0)Je(47302,h);if(kt(c[n>>2]|0,m,c[r>>2]|0,c[s>>2]|0)|0)Je(47332,g);if(!(sf(1)|0)){v=m+44|0;nn(v);fi(m);nn(o);w=c[s>>2]|0;qp(w);x=c[r>>2]|0;qp(x);y=c[q>>2]|0;qp(y);z=c[p>>2]|0;qp(z);A=c[n>>2]|0;qp(A);i=d;return}Le(47370,f);v=m+44|0;nn(v);fi(m);nn(o);w=c[s>>2]|0;qp(w);x=c[r>>2]|0;qp(x);y=c[q>>2]|0;qp(y);z=c[p>>2]|0;qp(z);A=c[n>>2]|0;qp(A);i=d;return}function or(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0;e=i;i=i+224|0;if((i|0)>=(j|0))U();f=e+168|0;g=e+24|0;h=e+16|0;k=e+8|0;l=e+164|0;m=e+160|0;n=e+104|0;o=e+100|0;p=e+88|0;q=e+84|0;r=e+80|0;s=e+76|0;t=e+32|0;u=e+28|0;c[l>>2]=b;c[m>>2]=d;if(sf(1)|0)Le(47288,e);ln(p);d=f;b=c[l>>2]|0;v=d+44|0;do{c[d>>2]=c[b>>2];d=d+4|0;b=b+4|0}while((d|0)<(v|0));gi(t,f);d=n;b=t;v=d+44|0;do{c[d>>2]=c[b>>2];d=d+4|0;b=b+4|0}while((d|0)<(v|0));ln(n+44|0);mr(n+44|0,(c[l>>2]|0)+44|0);if((c[(c[l>>2]|0)+4>>2]|0)==1){c[o>>2]=Ep(256)|0;c[u>>2]=Um(32,0)|0;b=c[u>>2]|0;a[b>>0]=a[b>>0]&127;b=c[u>>2]|0;a[b>>0]=a[b>>0]|64;b=(c[u>>2]|0)+31|0;a[b>>0]=a[b>>0]&248;Lo(c[o>>2]|0,c[u>>2]|0,32,0);hf(c[u>>2]|0)}else{c[o>>2]=Ep(c[m>>2]|0)|0;Hp(c[o>>2]|0,c[m>>2]|0,0)}c[s>>2]=rn(c[n>>2]|0,c[n+4>>2]|0,0,c[n+8>>2]|0,c[n+12>>2]|0,c[n+16>>2]|0)|0;c[q>>2]=Ep(0)|0;c[r>>2]=Ep(0)|0;On(p,c[o>>2]|0,n+44|0,c[s>>2]|0);if((c[(c[l>>2]|0)+4>>2]|0)!=1)On(p,c[(c[s>>2]|0)+36>>2]|0,p,c[s>>2]|0);if(fn(c[q>>2]|0,0,p,c[s>>2]|0)|0)Je(47405,k);On(p,c[o>>2]|0,n+20|0,c[s>>2]|0);On(p,c[(c[l>>2]|0)+56>>2]|0,p,c[s>>2]|0);if((c[(c[l>>2]|0)+4>>2]|0)!=1)On(p,c[(c[s>>2]|0)+36>>2]|0,p,c[s>>2]|0);if(fn(c[r>>2]|0,0,p,c[s>>2]|0)|0)Je(47453,h);if(jo(c[q>>2]|0,c[r>>2]|0)|0)Je(47502,g);else{qp(c[q>>2]|0);qp(c[r>>2]|0);vn(c[s>>2]|0);nn(n+44|0);fi(n);nn(p);qp(c[o>>2]|0);i=e;return}}function pr(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0;b=i;i=i+176|0;if((i|0)>=(j|0))U();d=b+72|0;e=b+64|0;f=b+56|0;g=b+40|0;h=b;k=b+168|0;l=b+164|0;m=b+160|0;n=b+156|0;o=b+152|0;p=b+148|0;q=b+144|0;r=b+140|0;s=b+80|0;t=b+76|0;c[l>>2]=a;c[n>>2]=0;c[o>>2]=0;c[p>>2]=0;c[q>>2]=0;c[r>>2]=0;c[t>>2]=0;a=s;u=a+60|0;do{c[a>>2]=0;a=a+4|0}while((a|0)<(u|0));c[n>>2]=Gf(c[l>>2]|0,46984,0)|0;if(!(c[n>>2]|0?(c[m>>2]=sj(c[n>>2]|0,o,0)|0,(c[m>>2]|0)!=0):0))v=3;do if((v|0)==3){a=c[l>>2]|0;if(c[o>>2]&512|0){c[h>>2]=s+8;c[h+4>>2]=s+12;c[h+8>>2]=s+16;c[h+12>>2]=q;c[h+16>>2]=s+32;c[h+20>>2]=s+36;c[h+24>>2]=r;c[h+28>>2]=s+56;c[h+32>>2]=0;c[m>>2]=_f(a,0,47957,h)|0}else{c[g>>2]=r;c[g+4>>2]=s+56;c[g+8>>2]=0;c[m>>2]=_f(a,0,47976,g)|0}if(!(c[m>>2]|0)){Ef(c[n>>2]|0);c[n>>2]=Gf(c[l>>2]|0,46978,5)|0;if((c[n>>2]|0?(c[p>>2]=Nf(c[n>>2]|0,1)|0,c[p>>2]|0):0)?(c[m>>2]=Gh(c[p>>2]|0,s,s+4|0,s+8|0,s+12|0,s+16|0,q,s+32|0,s+36|0)|0,c[m>>2]|0):0){c[k>>2]=c[m>>2];w=c[k>>2]|0;i=b;return w|0}if(c[q>>2]|0?(ln(s+20|0),c[m>>2]=mi(s+20|0,c[q>>2]|0)|0,c[m>>2]|0):0)break;if(!(c[p>>2]|0)){c[s>>2]=c[o>>2]&4096|0?2:0;c[s+4>>2]=c[o>>2]&4096|0?1:0}if(sf(1)|0){a=ii(c[s>>2]|0)|0;u=ji(c[s+4>>2]|0)|0;c[f>>2]=a;c[f+4>>2]=u;Le(47982,f);if(c[s+40>>2]|0){c[e>>2]=c[s+40>>2];Le(48006,e)}Pe(48027,c[s+8>>2]|0);Pe(48043,c[s+12>>2]|0);Pe(48059,c[s+16>>2]|0);en(48075,s+20|0,0);Pe(48089,c[s+32>>2]|0);Pe(48105,c[s+36>>2]|0);Pe(48121,c[r>>2]|0);if(!(Jg()|0))Pe(48137,c[s+56>>2]|0)}if((((((c[s+8>>2]|0?c[s+12>>2]|0:0)?c[s+16>>2]|0:0)?c[s+20>>2]|0:0)?c[s+32>>2]|0:0)?c[s+36>>2]|0:0)?c[s+56>>2]|0:0){c[t>>2]=rn(c[s>>2]|0,c[s+4>>2]|0,0,c[s+8>>2]|0,c[s+12>>2]|0,c[s+16>>2]|0)|0;if(!(c[r>>2]|0)){c[m>>2]=68;break}ln(s+44|0);if((c[(c[t>>2]|0)+4>>2]|0)==1)c[m>>2]=Wh(c[r>>2]|0,c[t>>2]|0,s+44|0,0,0)|0;else c[m>>2]=mi(s+44|0,c[r>>2]|0)|0;if(c[m>>2]|0)break;if(!(qr(s,c[t>>2]|0,c[o>>2]|0)|0))break;c[m>>2]=7;break}c[m>>2]=68}}while(0);vn(c[t>>2]|0);Gp(c[s+8>>2]|0);Gp(c[s+12>>2]|0);Gp(c[s+16>>2]|0);Gp(c[q>>2]|0);nn(s+20|0);Gp(c[s+32>>2]|0);Gp(c[s+36>>2]|0);Gp(c[r>>2]|0);nn(s+44|0);Gp(c[s+56>>2]|0);hf(c[p>>2]|0);Ef(c[n>>2]|0);if(sf(1)|0){c[d>>2]=ot(c[m>>2]|0)|0;Le(48440,d)}c[k>>2]=c[m>>2];w=c[k>>2]|0;i=b;return w|0}function qr(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0;e=i;i=i+112|0;if((i|0)>=(j|0))U();f=e+64|0;g=e+56|0;h=e+48|0;k=e+40|0;l=e+32|0;m=e+24|0;n=e+16|0;o=e+8|0;p=e;q=e+108|0;r=e+104|0;s=e+100|0;t=e+96|0;u=e+84|0;v=e+80|0;w=e+76|0;x=e+72|0;y=e+68|0;c[q>>2]=a;c[r>>2]=b;c[s>>2]=d;c[t>>2]=1;c[x>>2]=0;c[y>>2]=0;ln(u);c[v>>2]=Ep(0)|0;if((c[c[r>>2]>>2]|0)==1)c[w>>2]=0;else c[w>>2]=Ep(0)|0;a:do if(!(Qn((c[q>>2]|0)+20|0,c[r>>2]|0)|0)){if(sf(1)|0)Le(48153,p)}else{if(!(io(c[(c[q>>2]|0)+20+8>>2]|0,0)|0)){if(!(sf(1)|0))break;Le(48205,o);break}if((c[(c[q>>2]|0)+4>>2]|0)!=1?(On(u,c[(c[q>>2]|0)+32>>2]|0,(c[q>>2]|0)+20|0,c[r>>2]|0),io(c[u+8>>2]|0,0)|0):0){if(!(sf(1)|0))break;Le(48250,n);break}if(!(io(c[(c[q>>2]|0)+44+8>>2]|0,0)|0)){if(!(sf(1)|0))break;Le(48297,m);break}if(!(ni(u,c[r>>2]|0,(c[q>>2]|0)+20|0,c[(c[q>>2]|0)+56>>2]|0)|0)){if(!(sf(1)|0))break;Le(48343,l);break}if(fn(c[v>>2]|0,c[w>>2]|0,u,c[r>>2]|0)|0){if(!(sf(1)|0))break;Le(48297,k);break}do if(!(c[s>>2]&4096)){if(!(io(c[(c[q>>2]|0)+44+8>>2]|0,1)|0)){if(!(jo(c[v>>2]|0,c[(c[q>>2]|0)+44>>2]|0)|0)){if(c[w>>2]|0)break;if(!(jo(c[w>>2]|0,c[(c[q>>2]|0)+44+4>>2]|0)|0))break}if(!(sf(1)|0))break a;Le(48380,h);break a}c[x>>2]=Ep(0)|0;c[y>>2]=Ep(0)|0;if(fn(c[x>>2]|0,c[y>>2]|0,(c[q>>2]|0)+44|0,c[r>>2]|0)|0){if(!(sf(1)|0))break a;Le(48297,g);break a}if((jo(c[v>>2]|0,c[x>>2]|0)|0)==0?(jo(c[w>>2]|0,c[y>>2]|0)|0)==0:0)break;if(!(sf(1)|0))break a;Le(48380,f);break a}while(0);c[t>>2]=0}while(0);qp(c[x>>2]|0);qp(c[v>>2]|0);qp(c[w>>2]|0);qp(c[y>>2]|0);nn(u);i=e;return c[t>>2]|0}function rr(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0;e=i;i=i+256|0;if((i|0)>=(j|0))U();f=e+72|0;g=e+64|0;h=e+56|0;k=e+48|0;l=e+40|0;m=e+32|0;n=e;o=e+248|0;p=e+244|0;q=e+240|0;r=e+236|0;s=e+232|0;t=e+192|0;u=e+184|0;v=e+180|0;w=e+176|0;x=e+172|0;y=e+168|0;z=e+164|0;A=e+160|0;B=e+104|0;C=e+96|0;D=e+84|0;E=e+80|0;F=e+76|0;c[p>>2]=a;c[q>>2]=b;c[r>>2]=d;c[u>>2]=0;c[v>>2]=0;c[w>>2]=0;c[x>>2]=0;c[y>>2]=0;c[z>>2]=0;c[A>>2]=0;c[C>>2]=0;d=B;b=d+56|0;do{c[d>>2]=0;d=d+4|0}while((d|0)<(b|0));yj(t,0,sr(c[r>>2]|0)|0);c[s>>2]=Aj(c[q>>2]|0,A,t)|0;do if(!(c[s>>2]|0)){if(sf(1)|0)Pe(48463,c[A>>2]|0);if(c[A>>2]|0?c[(c[A>>2]|0)+12>>2]&4|0:0){c[s>>2]=79;break}q=c[r>>2]|0;c[n>>2]=B+8;c[n+4>>2]=B+12;c[n+8>>2]=B+16;c[n+12>>2]=w;c[n+16>>2]=B+32;c[n+20>>2]=B+36;c[n+24>>2]=x;c[n+28>>2]=0;c[s>>2]=_f(q,0,48480,n)|0;if(!(c[s>>2]|0)){if(c[w>>2]|0?(ln(B+20|0),c[s>>2]=mi(B+20|0,c[w>>2]|0)|0,c[s>>2]|0):0)break;Ef(c[u>>2]|0);c[u>>2]=Gf(c[r>>2]|0,46978,5)|0;if((c[u>>2]|0?(c[v>>2]=Nf(c[u>>2]|0,1)|0,c[v>>2]|0):0)?(c[s>>2]=Dh(0,c[v>>2]|0,B,0)|0,c[s>>2]|0):0){c[o>>2]=c[s>>2];G=c[o>>2]|0;i=e;return G|0}if(!(c[v>>2]|0)){c[B>>2]=0;c[B+4>>2]=0}if(sf(1)|0){q=ii(c[B>>2]|0)|0;d=ji(c[B+4>>2]|0)|0;c[m>>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(c[v>>2]|0);vn(c[C>>2]|0);zj(t);if(sf(1)|0){c[f>>2]=ot(c[s>>2]|0)|0;Le(48781,f)}c[o>>2]=c[s>>2];G=c[o>>2]|0;i=e;return G|0}function sr(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,k=0,l=0;b=i;i=i+32|0;if((i|0)>=(j|0))U();d=b+20|0;e=b+16|0;f=b+12|0;g=b+8|0;h=b+4|0;k=b;c[e>>2]=a;c[h>>2]=0;c[f>>2]=Gf(c[e>>2]|0,48461,1)|0;if(c[f>>2]|0){c[g>>2]=Of(c[f>>2]|0,1,5)|0;Ef(c[f>>2]|0);if(c[g>>2]|0){c[h>>2]=Zn(c[g>>2]|0)|0;Gp(c[g>>2]|0)}}else{c[f>>2]=Gf(c[e>>2]|0,46978,5)|0;if(!(c[f>>2]|0)){c[d>>2]=0;l=c[d>>2]|0;i=b;return l|0}c[k>>2]=Nf(c[f>>2]|0,1)|0;Ef(c[f>>2]|0);if(!(c[k>>2]|0)){c[d>>2]=0;l=c[d>>2]|0;i=b;return l|0}if(Dh(0,c[k>>2]|0,0,h)|0)c[h>>2]=0;hf(c[k>>2]|0)}c[d>>2]=c[h>>2];l=c[d>>2]|0;i=b;return l|0}function tr(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0;e=i;i=i+256|0;if((i|0)>=(j|0))U();f=e+72|0;g=e+64|0;h=e+56|0;k=e+48|0;l=e+40|0;m=e+8|0;n=e;o=e+248|0;p=e+244|0;q=e+240|0;r=e+236|0;s=e+232|0;t=e+192|0;u=e+188|0;v=e+184|0;w=e+124|0;x=e+120|0;y=e+116|0;z=e+112|0;A=e+100|0;B=e+88|0;C=e+84|0;D=e+80|0;E=e+76|0;c[p>>2]=a;c[q>>2]=b;c[r>>2]=d;c[u>>2]=0;c[v>>2]=0;c[x>>2]=0;c[y>>2]=0;c[z>>2]=0;c[C>>2]=0;d=w;b=d+60|0;do{c[d>>2]=0;d=d+4|0}while((d|0)<(b|0));ln(A);ln(B);yj(t,1,sr(c[r>>2]|0)|0);c[s>>2]=wj(c[q>>2]|0,12912,u,t)|0;do if((c[s>>2]|0)==0?(q=c[u>>2]|0,c[n>>2]=v,c[n+4>>2]=0,c[s>>2]=_f(q,0,48803,n)|0,(c[s>>2]|0)==0):0){if(sf(1)|0)Pe(48805,c[v>>2]|0);if(c[v>>2]|0?c[(c[v>>2]|0)+12>>2]&4|0:0){c[s>>2]=79;break}q=c[r>>2]|0;c[m>>2]=w+8;c[m+4>>2]=w+12;c[m+8>>2]=w+16;c[m+12>>2]=x;c[m+16>>2]=w+32;c[m+20>>2]=w+36;c[m+24>>2]=w+56;c[m+28>>2]=0;c[s>>2]=_f(q,0,48822,m)|0;if(!(c[s>>2]|0)){if(c[x>>2]|0?(ln(w+20|0),c[s>>2]=mi(w+20|0,c[x>>2]|0)|0,c[s>>2]|0):0)break;Ef(c[u>>2]|0);c[u>>2]=Gf(c[r>>2]|0,46978,5)|0;if((c[u>>2]|0?(c[y>>2]=Nf(c[u>>2]|0,1)|0,c[y>>2]|0):0)?(c[s>>2]=Dh(0,c[y>>2]|0,w,0)|0,c[s>>2]|0):0){c[o>>2]=c[s>>2];F=c[o>>2]|0;i=e;return F|0}if(!(c[y>>2]|0)){c[w>>2]=0;c[w+4>>2]=0}if(sf(1)|0){q=ii(c[w>>2]|0)|0;d=ji(c[w+4>>2]|0)|0;c[l>>2]=q;c[l+4>>2]=d;Le(48838,l);if(c[w+40>>2]|0){c[k>>2]=c[w+40>>2];Le(48863,k)}Pe(48885,c[w+8>>2]|0);Pe(48902,c[w+12>>2]|0);Pe(48919,c[w+16>>2]|0);en(48936,w+20|0,0);Pe(48951,c[w+32>>2]|0);Pe(48968,c[w+36>>2]|0);if(!(Jg()|0))Pe(48985,c[w+56>>2]|0)}if((((((c[w+8>>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96|0;h=e+88|0;k=e+80|0;l=e+72|0;m=e+56|0;n=e+40|0;o=e;p=e+256|0;q=e+252|0;r=e+248|0;s=e+244|0;t=e+240|0;u=e+200|0;v=e+192|0;w=e+188|0;x=e+184|0;y=e+180|0;z=e+176|0;A=e+116|0;B=e+112|0;C=e+108|0;c[q>>2]=a;c[r>>2]=b;c[s>>2]=d;c[v>>2]=0;c[w>>2]=0;c[x>>2]=0;c[y>>2]=0;c[z>>2]=0;c[B>>2]=0;c[C>>2]=0;d=A;b=d+60|0;do{c[d>>2]=0;d=d+4|0}while((d|0)<(b|0));yj(u,2,0);c[t>>2]=Aj(c[r>>2]|0,v,u)|0;do if(!(c[t>>2]|0)){if(sf(1)|0)Pe(49092,c[v>>2]|0);r=c[s>>2]|0;if(c[u+12>>2]&512|0){c[o>>2]=A+8;c[o+4>>2]=A+12;c[o+8>>2]=A+16;c[o+12>>2]=y;c[o+16>>2]=A+32;c[o+20>>2]=A+36;c[o+24>>2]=z;c[o+28>>2]=A+56;c[o+32>>2]=0;c[t>>2]=_f(r,0,47957,o)|0}else{c[n>>2]=z;c[n+4>>2]=A+56;c[n+8>>2]=0;c[t>>2]=_f(r,0,47976,n)|0}if(!(c[t>>2]|0)){if(c[y>>2]|0?(ln(A+20|0),c[t>>2]=mi(A+20|0,c[y>>2]|0)|0,c[t>>2]|0):0)break;Ef(c[w>>2]|0);c[w>>2]=Gf(c[s>>2]|0,46978,5)|0;if((c[w>>2]|0?(c[x>>2]=Nf(c[w>>2]|0,1)|0,c[x>>2]|0):0)?(c[t>>2]=Dh(0,c[x>>2]|0,A,0)|0,c[t>>2]|0):0){c[p>>2]=c[t>>2];D=c[p>>2]|0;i=e;return D|0}if(!(c[x>>2]|0)){c[A>>2]=c[u+12>>2]&4096|0?2:0;c[A+4>>2]=c[u+12>>2]&4096|0?1:0}if(sf(1)|0){r=ii(c[A>>2]|0)|0;d=ji(c[A+4>>2]|0)|0;b=c[u+12>>2]&4096|0?49108:76084;c[m>>2]=r;c[m+4>>2]=d;c[m+8>>2]=b;Le(49115,m);if(c[A+40>>2]|0){c[l>>2]=c[A+40>>2];Le(49141,l)}Pe(49162,c[A+8>>2]|0);Pe(49178,c[A+12>>2]|0);Pe(49194,c[A+16>>2]|0);en(49210,A+20|0,0);Pe(49224,c[A+32>>2]|0);Pe(49240,c[A+36>>2]|0);Pe(49256,c[z>>2]|0);if(!(Jg()|0))Pe(49272,c[A+56>>2]|0)}if((((((c[A+8>>2]|0?c[A+12>>2]|0:0)?c[A+16>>2]|0:0)?c[A+20>>2]|0:0)?c[A+32>>2]|0:0)?c[A+36>>2]|0:0)?c[A+56>>2]|0:0){c[B>>2]=Ep(0)|0;c[C>>2]=Ep(0)|0;if(c[u+12>>2]&4096|0){c[t>>2]=ci(c[v>>2]|0,A,c[B>>2]|0,c[C>>2]|0,c[u+16>>2]|0,c[z>>2]|0)|0;if(c[t>>2]|0)break;b=c[q>>2]|0;d=c[C>>2]|0;c[k>>2]=c[B>>2];c[k+4>>2]=d;c[t>>2]=Rf(b,0,49288,k)|0;break}b=c[v>>2]|0;d=c[B>>2]|0;r=c[C>>2]|0;if(c[u+12>>2]&8192|0){c[t>>2]=lt(b,A,d,r)|0;if(c[t>>2]|0)break;a=c[q>>2]|0;E=c[C>>2]|0;c[h>>2]=c[B>>2];c[h+4>>2]=E;c[t>>2]=Rf(a,0,49315,h)|0;break}else{c[t>>2]=jt(b,A,d,r,c[u+12>>2]|0,c[u+16>>2]|0)|0;if(c[t>>2]|0)break;r=c[q>>2]|0;d=c[C>>2]|0;c[g>>2]=c[B>>2];c[g+4>>2]=d;c[t>>2]=Rf(r,0,49341,g)|0;break}}c[t>>2]=68}}while(0);Gp(c[A+8>>2]|0);Gp(c[A+12>>2]|0);Gp(c[A+16>>2]|0);Gp(c[y>>2]|0);nn(A+20|0);Gp(c[A+32>>2]|0);Gp(c[A+36>>2]|0);Gp(c[z>>2]|0);nn(A+44|0);Gp(c[A+56>>2]|0);Gp(c[B>>2]|0);Gp(c[C>>2]|0);hf(c[x>>2]|0);Gp(c[v>>2]|0);Ef(c[w>>2]|0);zj(u);if(sf(1)|0){c[f>>2]=ot(c[t>>2]|0)|0;Le(49368,f)}c[p>>2]=c[t>>2];D=c[p>>2]|0;i=e;return D|0}function vr(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0;e=i;i=i+272|0;if((i|0)>=(j|0))U();f=e+80|0;g=e+72|0;h=e+56|0;k=e+48|0;l=e+16|0;m=e;n=e+256|0;o=e+252|0;p=e+248|0;q=e+244|0;r=e+240|0;s=e+200|0;t=e+192|0;u=e+188|0;v=e+184|0;w=e+180|0;x=e+176|0;y=e+172|0;z=e+168|0;A=e+112|0;B=e+104|0;C=e+100|0;D=e+96|0;E=e+92|0;F=e+88|0;G=e+84|0;c[o>>2]=a;c[p>>2]=b;c[q>>2]=d;c[t>>2]=0;c[u>>2]=0;c[v>>2]=0;c[w>>2]=0;c[x>>2]=0;c[y>>2]=0;c[z>>2]=0;d=A;b=d+56|0;do{c[d>>2]=0;d=d+4|0}while((d|0)<(b|0));yj(s,3,sr(c[q>>2]|0)|0);c[r>>2]=Aj(c[p>>2]|0,z,s)|0;a:do if(!(c[r>>2]|0)){if(sf(1)|0)Pe(49389,c[z>>2]|0);c[r>>2]=vj(c[o>>2]|0,12912,t,B)|0;if((c[r>>2]|0)==0?(p=c[t>>2]|0,d=c[B>>2]&4096|0?49405:46975,c[m>>2]=x,c[m+4>>2]=y,c[m+8>>2]=0,c[r>>2]=_f(p,0,d,m)|0,(c[r>>2]|0)==0):0){if(sf(1)|0){Pe(49409,c[x>>2]|0);Pe(49425,c[y>>2]|0)}if(c[s+12>>2]&4096^c[B>>2]&4096|0){c[r>>2]=70;break}d=c[q>>2]|0;if(c[s+12>>2]&512|0){c[l>>2]=A+8;c[l+4>>2]=A+12;c[l+8>>2]=A+16;c[l+12>>2]=v;c[l+16>>2]=A+32;c[l+20>>2]=A+32;c[l+24>>2]=w;c[l+28>>2]=0;c[r>>2]=_f(d,0,49441,l)|0}else{c[k>>2]=w;c[k+4>>2]=0;c[r>>2]=_f(d,0,49457,k)|0}if(!(c[r>>2]|0)){if(c[v>>2]|0?(ln(A+20|0),c[r>>2]=mi(A+20|0,c[v>>2]|0)|0,c[r>>2]|0):0)break;Ef(c[t>>2]|0);c[t>>2]=Gf(c[q>>2]|0,46978,5)|0;if((c[t>>2]|0?(c[u>>2]=Nf(c[t>>2]|0,1)|0,c[u>>2]|0):0)?(c[r>>2]=Dh(0,c[u>>2]|0,A,0)|0,c[r>>2]|0):0){c[n>>2]=c[r>>2];H=c[n>>2]|0;i=e;return H|0}if(!(c[u>>2]|0)){c[A>>2]=c[B>>2]&4096|0?2:0;c[A+4>>2]=c[B>>2]&4096|0?1:0}if(sf(1)|0){d=ii(c[A>>2]|0)|0;p=ji(c[A+4>>2]|0)|0;b=c[B>>2]&4096|0?49108:76084;c[h>>2]=d;c[h+4>>2]=p;c[h+8>>2]=b;Le(49460,h);if(c[A+40>>2]|0){c[g>>2]=c[A+40>>2];Le(49486,g)}Pe(49507,c[A+8>>2]|0);Pe(49523,c[A+12>>2]|0);Pe(49539,c[A+16>>2]|0);en(49555,A+20|0,0);Pe(49569,c[A+32>>2]|0);Pe(49585,c[A+36>>2]|0);Pe(49601,c[w>>2]|0)}if(((((c[A+8>>2]|0?c[A+12>>2]|0:0)?c[A+16>>2]|0:0)?c[A+20>>2]|0:0)?c[A+32>>2]|0:0)?(c[A+36>>2]|0)!=0&(c[w>>2]|0)!=0:0){if(c[B>>2]&4096|0){c[r>>2]=ei(c[z>>2]|0,A,c[x>>2]|0,c[y>>2]|0,c[s+16>>2]|0,c[w>>2]|0)|0;break}b=(c[B>>2]&8192|0)!=0;ln(A+44|0);if(b){c[r>>2]=mi(A+44|0,c[w>>2]|0)|0;if(c[r>>2]|0)break;c[r>>2]=mt(c[z>>2]|0,A,c[x>>2]|0,c[y>>2]|0)|0;break}if((c[A+4>>2]|0)==1){c[C>>2]=rn(c[A>>2]|0,c[A+4>>2]|0,0,c[A+8>>2]|0,c[A+12>>2]|0,c[A+16>>2]|0)|0;c[r>>2]=Wh(c[w>>2]|0,c[C>>2]|0,A+44|0,0,0)|0;vn(c[C>>2]|0)}else c[r>>2]=mi(A+44|0,c[w>>2]|0)|0;if(c[r>>2]|0)break;do if(c[z>>2]|0){if(!(c[(c[z>>2]|0)+12>>2]&4))break;c[F>>2]=Zn(c[A+32>>2]|0)|0;c[D>>2]=tp(c[z>>2]|0,E)|0;c[r>>2]=Mo(G,5,c[D>>2]|0,(((c[E>>2]|0)+7|0)>>>0)/8|0,0)|0;if(c[r>>2]|0)break a;if((c[E>>2]|0)>>>0>(c[F>>2]|0)>>>0)fo(c[G>>2]|0,c[G>>2]|0,(c[E>>2]|0)-(c[F>>2]|0)|0);c[r>>2]=kt(c[G>>2]|0,A,c[x>>2]|0,c[y>>2]|0)|0;Gp(c[G>>2]|0);break a}while(0);c[r>>2]=kt(c[z>>2]|0,A,c[x>>2]|0,c[y>>2]|0)|0;break}c[r>>2]=68}}}while(0);Gp(c[A+8>>2]|0);Gp(c[A+12>>2]|0);Gp(c[A+16>>2]|0);Gp(c[v>>2]|0);nn(A+20|0);Gp(c[A+32>>2]|0);Gp(c[A+36>>2]|0);Gp(c[w>>2]|0);nn(A+44|0);Gp(c[z>>2]|0);Gp(c[x>>2]|0);Gp(c[y>>2]|0);hf(c[u>>2]|0);Ef(c[t>>2]|0);zj(s);if(sf(1)|0){if(c[r>>2]|0)I=ot(c[r>>2]|0)|0;else I=49617;c[f>>2]=I;Le(49622,f)}c[n>>2]=c[r>>2];H=c[n>>2]|0;i=e;return H|0}function wr(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,k=0;e=i;i=i+16|0;if((i|0)>=(j|0))U();f=e+12|0;g=e+8|0;h=e;c[g>>2]=a;c[e+4>>2]=b;c[h>>2]=d;if((c[g>>2]|0)!=18){c[f>>2]=4;k=c[f>>2]|0;i=e;return k|0}else{c[f>>2]=xr(c[h>>2]|0)|0;k=c[f>>2]|0;i=e;return k|0}return 0}function xr(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b+12|0;e=b+8|0;f=b+4|0;g=b;c[e>>2]=a;c[f>>2]=49643;c[g>>2]=0;if(!(c[g>>2]|0)){c[d>>2]=0;h=c[d>>2]|0;i=b;return h|0}if(c[e>>2]|0)Cb[c[e>>2]&1](49653,18,c[f>>2]|0,c[g>>2]|0);c[d>>2]=50;h=c[d>>2]|0;i=b;return h|0}function yr(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0;e=i;i=i+208|0;if((i|0)>=(j|0))U();f=e+88|0;g=e+80|0;h=e+72|0;k=e+64|0;l=e+32|0;m=e;n=e+172|0;o=e+168|0;p=e+164|0;q=e+160|0;r=e+132|0;s=e+128|0;t=e+124|0;u=e+120|0;v=e+116|0;w=e+112|0;x=e+176|0;y=e+108|0;z=e+104|0;A=e+100|0;B=e+96|0;c[n>>2]=b;c[o>>2]=d;c[t>>2]=0;c[u>>2]=0;c[v>>2]=0;c[w>>2]=0;c[s>>2]=0;while(1){if((c[s>>2]|0)>=7)break;c[r+(c[s>>2]<<2)>>2]=0;c[s>>2]=(c[s>>2]|0)+1}c[q>>2]=Gf(c[o>>2]|0,46984,0)|0;if(!(c[q>>2]|0?(c[p>>2]=sj(c[q>>2]|0,u,0)|0,(c[p>>2]|0)!=0):0))C=6;a:do if((C|0)==6){d=(c[u>>2]&4096|0)!=0;b=c[o>>2]|0;do if(c[u>>2]&512|0){D=r+4|0;E=r+8|0;F=r+12|0;G=r+16|0;H=r+20|0;I=r+24|0;if(d){c[m>>2]=r;c[m+4>>2]=D;c[m+8>>2]=E;c[m+12>>2]=F;c[m+16>>2]=G;c[m+20>>2]=H;c[m+24>>2]=I;c[m+28>>2]=0;c[p>>2]=_f(b,0,49660,m)|0;break}else{c[l>>2]=r;c[l+4>>2]=D;c[l+8>>2]=E;c[l+12>>2]=F;c[l+16>>2]=G;c[l+20>>2]=H;c[l+24>>2]=I;c[l+28>>2]=0;c[p>>2]=_f(b,0,49675,l)|0;break}}else{I=r+24|0;if(d){c[k>>2]=I;c[k+4>>2]=0;c[p>>2]=_f(b,0,49457,k)|0;break}else{c[h>>2]=I;c[h+4>>2]=0;c[p>>2]=_f(b,0,49689,h)|0;break}}while(0);if(!(c[p>>2]|0)){Ef(c[q>>2]|0);c[q>>2]=Gf(c[o>>2]|0,46978,5)|0;if((c[q>>2]|0?(c[t>>2]=Nf(c[q>>2]|0,1)|0,c[t>>2]|0):0)?(c[p>>2]=Gh(c[t>>2]|0,v,w,r,r+4|0,r+8|0,r+12|0,r+16|0,r+20|0)|0,c[p>>2]|0):0)break;if(!(c[t>>2]|0)){c[v>>2]=c[u>>2]&4096|0?2:0;c[w>>2]=c[u>>2]&4096|0?1:0}c[s>>2]=0;while(1){if((c[s>>2]|0)>=7)break;if(!(c[r+(c[s>>2]<<2)>>2]|0)){C=22;break}Yn(c[r+(c[s>>2]<<2)>>2]|0);c[s>>2]=(c[s>>2]|0)+1}if((C|0)==22){c[p>>2]=68;break}if(c[u>>2]&4096|0){if((c[w>>2]|0)==1)c[p>>2]=Th(c[r+24>>2]|0,256)|0;else c[p>>2]=69;if(c[p>>2]|0)break}c[s>>2]=0;b:while(1){if((c[s>>2]|0)>=7)break a;do if((c[s>>2]|0)!=5){if(c[r+(c[s>>2]<<2)>>2]|0?c[(c[r+(c[s>>2]<<2)>>2]|0)+12>>2]&4|0:0){c[y>>2]=tp(c[r+(c[s>>2]<<2)>>2]|0,z)|0;c[z>>2]=(((c[z>>2]|0)+7|0)>>>0)/8|0;b=c[z>>2]|0;c[g>>2]=a[49691+(c[s>>2]|0)>>0];c[g+4>>2]=b;Cu(x,30,49698,g)|0;b=c[n>>2]|0;Oi(b,x,Tu(x)|0);Oi(c[n>>2]|0,c[y>>2]|0,c[z>>2]|0);Oi(c[n>>2]|0,49707,1);break}c[A>>2]=Io(c[r+(c[s>>2]<<2)>>2]|0,0,B,0)|0;if(!(c[A>>2]|0))break b;b=c[B>>2]|0;c[f>>2]=a[49691+(c[s>>2]|0)>>0];c[f+4>>2]=b;Cu(x,30,49698,f)|0;b=c[n>>2]|0;Oi(b,x,Tu(x)|0);Oi(c[n>>2]|0,c[A>>2]|0,c[B>>2]|0);Oi(c[n>>2]|0,49707,1);hf(c[A>>2]|0)}while(0);c[s>>2]=(c[s>>2]|0)+1}c[p>>2]=rt()|0}}while(0);hf(c[t>>2]|0);Ef(c[q>>2]|0);c[s>>2]=0;while(1){if((c[s>>2]|0)>=7)break;Gp(c[r+(c[s>>2]<<2)>>2]|0);c[s>>2]=(c[s>>2]|0)+1}i=e;return c[p>>2]|0}function zr(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0;h=i;i=i+1056|0;if((i|0)>=(j|0))U();k=h+44|0;l=h+40|0;m=h+36|0;n=h+32|0;o=h+28|0;p=h+24|0;q=h+20|0;r=h+16|0;s=h+12|0;t=h+8|0;u=h+4|0;v=h+48|0;w=h;c[l>>2]=a;c[m>>2]=b;c[n>>2]=d;c[o>>2]=e;c[p>>2]=f;c[q>>2]=g;c[r>>2]=0;c[s>>2]=0;g=bj(c[l>>2]|0)|0;if((g|0)!=(c[q>>2]|0)){c[k>>2]=49709;x=c[k>>2]|0;i=h;return x|0}c[s>>2]=Fi(t,c[l>>2]|0,0)|0;if(c[s>>2]|0){c[k>>2]=49750;x=c[k>>2]|0;i=h;return x|0}a:do switch(c[m>>2]|0){case 0:{Oi(c[t>>2]|0,c[n>>2]|0,c[o>>2]|0);break}case 1:{Sw(v|0,97,1e3)|0;c[w>>2]=0;while(1){if((c[w>>2]|0)>=1e3)break a;Oi(c[t>>2]|0,v,1e3);c[w>>2]=(c[w>>2]|0)+1}break}default:c[r>>2]=49770}while(0);if((c[r>>2]|0)==0?(c[u>>2]=_i(c[t>>2]|0,c[l>>2]|0)|0,vv(c[u>>2]|0,c[p>>2]|0,c[q>>2]|0)|0):0)c[r>>2]=49787;Ni(c[t>>2]|0);c[k>>2]=c[r>>2];x=c[k>>2]|0;i=h;return x|0}function Ar(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;f=i;i=i+32|0;if((i|0)>=(j|0))U();g=f+28|0;h=f+24|0;k=f+20|0;l=f+16|0;m=f+12|0;n=f+8|0;o=f+4|0;p=f;c[g>>2]=b;c[h>>2]=d;c[k>>2]=e;c[l>>2]=c[h>>2];c[m>>2]=c[g>>2];c[n>>2]=0;c[o>>2]=c[(c[m>>2]|0)+148>>2];if(128<(c[o>>2]|0)>>>0)Ee(49803,112,49817);if(!(c[(c[m>>2]|0)+152>>2]|0)){i=f;return}if((c[(c[m>>2]|0)+144>>2]|0)==(c[o>>2]|0)?(c[n>>2]=sb[c[(c[m>>2]|0)+152>>2]&63](c[m>>2]|0,c[m>>2]|0,1)|0,Qe(c[n>>2]|0),Re(),c[n>>2]=0,c[(c[m>>2]|0)+144>>2]=0,g=(c[m>>2]|0)+128|0,h=g,e=Gw(c[h>>2]|0,c[h+4>>2]|0,1,0)|0,h=C,d=g,c[d>>2]=e,c[d+4>>2]=h,!((e|0)!=0|(h|0)!=0)):0){h=(c[m>>2]|0)+136|0;e=h;d=Gw(c[e>>2]|0,c[e+4>>2]|0,1,0)|0;e=h;c[e>>2]=d;c[e+4>>2]=C}if(!(c[l>>2]|0)){i=f;return}if(c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|0)+88|0;c[g>>2]=(c[g>>2]|0)+(c[h>>2]|0)}if(!(c[l>>2]|0)){i=e;return}Qe(c[l>>2]|0);Re();i=e;return}function Cr(a){a=a|0;var b=0,d=0,e=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b+4|0;e=b;c[d>>2]=a;c[e>>2]=c[d>>2];c[e>>2]=(c[e>>2]|0)+3;c[e>>2]=(c[e>>2]|0)+(0-(c[e>>2]&3));i=b;return c[e>>2]|0}function Dr(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0;f=i;i=i+32|0;if((i|0)>=(j|0))U();g=f+28|0;h=f+24|0;k=f+20|0;l=f+16|0;m=f+12|0;n=f+8|0;o=f+4|0;c[g>>2]=b;c[h>>2]=d;c[k>>2]=e;c[l>>2]=c[g>>2];c[m>>2]=c[h>>2];c[f>>2]=3;if(!((c[l>>2]|c[m>>2])&3)){c[n>>2]=c[l>>2];c[o>>2]=c[m>>2];while(1){if((c[k>>2]|0)>>>0<4)break;h=c[o>>2]|0;c[o>>2]=h+4;g=c[h>>2]|0;h=c[n>>2]|0;c[n>>2]=h+4;c[h>>2]=g;c[k>>2]=(c[k>>2]|0)-4}c[l>>2]=c[n>>2];c[m>>2]=c[o>>2]}while(1){if(!(c[k>>2]|0))break;o=c[m>>2]|0;c[m>>2]=o+1;n=a[o>>0]|0;o=c[l>>2]|0;c[l>>2]=o+1;a[o>>0]=n;c[k>>2]=(c[k>>2]|0)+-1}i=f;return}function Er(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;d=i;i=i+16|0;if((i|0)>=(j|0))U();e=d+12|0;f=d+8|0;g=d+4|0;h=d;c[e>>2]=a;c[f>>2]=b;c[g>>2]=Cr(c[e>>2]|0)|0;c[h>>2]=zb[c[(c[(c[e>>2]|0)+84>>2]|0)+12>>2]&7](c[g>>2]|0,(c[e>>2]|0)+68|0,c[(c[e>>2]|0)+88>>2]|0,c[f>>2]|0)|0;Qe(c[h>>2]|0);Re();i=d;return}function Fr(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0;g=i;i=i+80|0;if((i|0)>=(j|0))U();h=g+8|0;k=g+40|0;l=g+36|0;m=g+32|0;n=g+28|0;o=g+48|0;p=g+20|0;q=g+16|0;r=g+44|0;s=g;t=g+12|0;c[l>>2]=b;c[m>>2]=e;c[n>>2]=f;c[g+24>>2]=cg()|0;if((c[17674]|0)==0?(c[17674]=1,c[17675]=Gr()|0,c[17675]|0):0){c[h>>2]=c[17675];Ie(50225,h)}if((c[n>>2]|0)!=32){c[k>>2]=44;u=c[k>>2]|0;i=g;return u|0}if(c[17675]|0){c[k>>2]=50;u=c[k>>2]|0;i=g;return u|0}c[(c[l>>2]|0)+84>>2]=12936;Dr(o,c[m>>2]|0,32);Nr(c[l>>2]|0,o);c[p>>2]=o;c[q>>2]=32;a[r>>0]=0;o=s;c[o>>2]=d[r>>0];c[o+4>>2]=0;while(1){if(!(c[p>>2]&7|0?(c[q>>2]|0)!=0:0))break;a[c[p>>2]>>0]=a[r>>0]|0;c[p>>2]=(c[p>>2]|0)+1;c[q>>2]=(c[q>>2]|0)+-1}if((c[q>>2]|0)>>>0>=8){o=s;l=Xw(c[o>>2]|0,c[o+4>>2]|0,16843009,16843009)|0;o=s;c[o>>2]=l;c[o+4>>2]=C;do{c[t>>2]=c[p>>2];o=s;l=c[o+4>>2]|0;m=c[t>>2]|0;c[m>>2]=c[o>>2];c[m+4>>2]=l;c[q>>2]=(c[q>>2]|0)-8;c[p>>2]=(c[p>>2]|0)+8}while((c[q>>2]|0)>>>0>=8)}while(1){if(!(c[q>>2]|0))break;a[c[p>>2]>>0]=a[r>>0]|0;c[p>>2]=(c[p>>2]|0)+1;c[q>>2]=(c[q>>2]|0)+-1}c[k>>2]=0;u=c[k>>2]|0;i=g;return u|0}function Gr(){var b=0,d=0,e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0;b=i;i=i+512|0;if((i|0)>=(j|0))U();d=b+192|0;e=b+100|0;f=b+8|0;g=b+472|0;h=b+216|0;k=b+200|0;l=b+4|0;m=b;n=e;o=n+92|0;do{c[n>>2]=0;n=n+4|0}while((n|0)<(o|0));n=f;o=n+92|0;do{c[n>>2]=0;n=n+4|0}while((n|0)<(o|0));n=k;o=n+16|0;do{a[n>>0]=0;n=n+1|0}while((n|0)<(o|0));Hr(k,49838,131,49969);if(vv(50001,k,16)|0){c[d>>2]=50017;p=c[d>>2]|0;i=b;return p|0}n=k;o=n+16|0;do{a[n>>0]=0;n=n+1|0}while((n|0)<(o|0));Fr(e,49969,32)|0;Br(e,49838,32);Br(e,49870,64);Br(e,49934,16);Br(e,49950,8);Br(e,49958,4);Br(e,49962,2);Br(e,49964,1);Br(e,49965,1);Br(e,49966,1);Br(e,49967,1);Br(e,49968,1);Er(e,k);if(vv(50001,k,16)|0){c[d>>2]=50041;p=c[d>>2]|0;i=b;return p|0}n=k;o=n+16|0;do{a[n>>0]=0;n=n+1|0}while((n|0)<(o|0));Hr(k,50065,16,50081);if(vv(50113,k,16)|0){c[d>>2]=50129;p=c[d>>2]|0;i=b;return p|0}Fr(f,50153,32)|0;c[l>>2]=0;while(1){if((c[l>>2]|0)>>>0>=256)break;c[m>>2]=0;while(1){if((c[m>>2]|0)>>>0>=32)break;a[g+(c[m>>2]|0)>>0]=c[l>>2];c[m>>2]=(c[m>>2]|0)+1}c[m>>2]=0;while(1){if((c[m>>2]|0)>>>0>=(c[l>>2]|0)>>>0)break;a[h+(c[m>>2]|0)>>0]=c[l>>2];c[m>>2]=(c[m>>2]|0)+1}Hr(k,h,c[l>>2]|0,g);Br(f,k,16);c[l>>2]=(c[l>>2]|0)+1}Er(f,k);if(vv(50185,k,16)|0){c[d>>2]=50201;p=c[d>>2]|0;i=b;return p|0}else{c[d>>2]=0;p=c[d>>2]|0;i=b;return p|0}return 0}function Hr(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;h=i;i=i+144|0;if((i|0)>=(j|0))U();k=h+124|0;l=h+120|0;m=h+116|0;n=h+112|0;o=h+20|0;p=h+16|0;q=h+12|0;r=h+128|0;s=h;t=h+8|0;c[k>>2]=b;c[l>>2]=e;c[m>>2]=f;c[n>>2]=g;g=o;f=g+92|0;do{c[g>>2]=0;g=g+4|0}while((g|0)<(f|0));Fr(o,c[n>>2]|0,32)|0;Br(o,c[l>>2]|0,c[m>>2]|0);Er(o,c[k>>2]|0);c[p>>2]=o;c[q>>2]=92;a[r>>0]=0;o=s;c[o>>2]=d[r>>0];c[o+4>>2]=0;while(1){if(!(c[p>>2]&7|0?(c[q>>2]|0)!=0:0))break;a[c[p>>2]>>0]=a[r>>0]|0;c[p>>2]=(c[p>>2]|0)+1;c[q>>2]=(c[q>>2]|0)+-1}if((c[q>>2]|0)>>>0>=8){o=s;k=Xw(c[o>>2]|0,c[o+4>>2]|0,16843009,16843009)|0;o=s;c[o>>2]=k;c[o+4>>2]=C;do{c[t>>2]=c[p>>2];o=s;k=c[o+4>>2]|0;m=c[t>>2]|0;c[m>>2]=c[o>>2];c[m+4>>2]=k;c[q>>2]=(c[q>>2]|0)-8;c[p>>2]=(c[p>>2]|0)+8}while((c[q>>2]|0)>>>0>=8)}while(1){if(!(c[q>>2]|0))break;a[c[p>>2]>>0]=a[r>>0]|0;c[p>>2]=(c[p>>2]|0)+1;c[q>>2]=(c[q>>2]|0)+-1}i=h;return}function Ir(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=i;i=i+16|0;if((i|0)>=(j|0))U();f=e+8|0;g=e+4|0;h=e;c[f>>2]=b;c[g>>2]=d;c[h>>2]=c[f>>2];f=(Jr(c[g>>2]|0)|0)&67108863;c[c[h>>2]>>2]=f;f=(Jr((c[g>>2]|0)+3|0)|0)>>>2&67108611;c[(c[h>>2]|0)+4>>2]=f;f=(Jr((c[g>>2]|0)+6|0)|0)>>>4&67092735;c[(c[h>>2]|0)+8>>2]=f;f=(Jr((c[g>>2]|0)+9|0)|0)>>>6&66076671;c[(c[h>>2]|0)+12>>2]=f;f=(Jr((c[g>>2]|0)+12|0)|0)>>>8&1048575;c[(c[h>>2]|0)+16>>2]=f;c[(c[h>>2]|0)+20>>2]=0;c[(c[h>>2]|0)+20+4>>2]=0;c[(c[h>>2]|0)+20+8>>2]=0;c[(c[h>>2]|0)+20+12>>2]=0;c[(c[h>>2]|0)+20+16>>2]=0;f=Jr((c[g>>2]|0)+16|0)|0;c[(c[h>>2]|0)+40>>2]=f;f=Jr((c[g>>2]|0)+20|0)|0;c[(c[h>>2]|0)+40+4>>2]=f;f=Jr((c[g>>2]|0)+24|0)|0;c[(c[h>>2]|0)+40+8>>2]=f;f=Jr((c[g>>2]|0)+28|0)|0;c[(c[h>>2]|0)+40+12>>2]=f;a[(c[h>>2]|0)+56>>0]=0;i=e;return}function Jr(a){a=a|0;var b=0,e=0,f=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();e=b+4|0;f=b;c[e>>2]=a;c[f>>2]=c[e>>2];i=b;return (d[(c[f>>2]|0)+3>>0]|0)<<24|(d[(c[f>>2]|0)+2>>0]|0)<<16|(d[(c[f>>2]|0)+1>>0]|0)<<8|(d[c[f>>2]>>0]|0)|0}function Kr(a,b,e){a=a|0;b=b|0;e=e|0;var f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,D=0,E=0,F=0,G=0,H=0;f=i;i=i+128|0;if((i|0)>=(j|0))U();g=f+116|0;h=f+112|0;k=f+108|0;l=f+104|0;m=f+100|0;n=f+96|0;o=f+92|0;p=f+88|0;q=f+84|0;r=f+80|0;s=f+76|0;t=f+72|0;u=f+68|0;v=f+64|0;w=f+60|0;x=f+56|0;y=f+52|0;z=f+48|0;A=f+44|0;B=f+32|0;D=f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4|0;h=e;c[f>>2]=b;c[g>>2]=d;c[h>>2]=c[f>>2];a[(c[h>>2]|0)+3>>0]=(c[g>>2]|0)>>>24;a[(c[h>>2]|0)+2>>0]=(c[g>>2]|0)>>>16;a[(c[h>>2]|0)+1>>0]=(c[g>>2]|0)>>>8;a[c[h>>2]>>0]=c[g>>2];i=e;return}function Nr(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=i;i=i+16|0;if((i|0)>=(j|0))U();e=d+8|0;f=d+4|0;g=d;c[e>>2]=a;c[f>>2]=b;c[g>>2]=Cr(c[e>>2]|0)|0;c[(c[e>>2]|0)+88>>2]=0;vb[c[(c[(c[e>>2]|0)+84>>2]|0)+4>>2]&7](c[g>>2]|0,c[f>>2]|0);i=d;return}function Or(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b;c[d>>2]=a;if(c[d>>2]|0){Qr();i=b;return}else{Pr();i=b;return}}function Pr(){if(c[17676]|0)return;c[17676]=1;return}function Qr(){var a=0,b=0;Pr();Rr();if(c[17678]|0){Xr();return}if(c[17679]|0)a=qf(1,664)|0;else a=pf(1,664)|0;c[17678]=a;if(c[17679]|0)b=qf(1,664)|0;else b=pf(1,664)|0;c[17680]=b;c[17681]=Sr()|0;if(!(c[17681]|0)){c[17682]=1;c[17681]=3}c[17699]=Wr()|0;Xr();return}function Rr(){var a=0,b=0,d=0;a=i;i=i+16|0;if((i|0)>=(j|0))U();b=a;d=a+4|0;c[d>>2]=ut(12952)|0;if(c[d>>2]|0){c[b>>2]=ot(c[d>>2]|0)|0;Je(50256,b)}else{c[17677]=1;i=a;return}}function Sr(){var a=0,b=0,d=0;a=i;i=i+16|0;if((i|0)>=(j|0))U();b=a;d=a+4|0;if((Lv(52638,4)|0)==0?(Lv(52740,4)|0)==0:0){c[d>>2]=4;i=a;return c[d>>2]|0}Je(xe(50293)|0,b);return 0}function Tr(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,k=0,l=0,m=0,n=0;g=i;i=i+32|0;if((i|0)>=(j|0))U();h=g+24|0;k=g+20|0;l=g+12|0;m=g+8|0;n=g+4|0;c[g+28>>2]=b;c[h>>2]=d;c[k>>2]=e;c[g+16>>2]=f;if(!(c[17683]|0)){Ge(xe(50331)|0,g);c[17683]=1;f=ib(0)|0;hw(R(f,Kv()|0)|0)}f=mf(c[k>>2]|0)|0;c[m>>2]=f;c[n>>2]=f;c[l>>2]=c[k>>2];while(1){f=c[l>>2]|0;c[l>>2]=f+-1;if(!f)break;f=1+~~(+(iw()|0)*256.0/2147483648.0)-1&255;e=c[n>>2]|0;c[n>>2]=e+1;a[e>>0]=f}Ur(c[m>>2]|0,c[k>>2]|0,c[h>>2]|0);hf(c[m>>2]|0);i=g;return 0}function Ur(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,k=0,l=0,m=0,n=0;g=i;i=i+32|0;if((i|0)>=(j|0))U();h=g+16|0;k=g+12|0;l=g+8|0;m=g+4|0;n=g;c[h>>2]=b;c[k>>2]=e;c[l>>2]=f;c[m>>2]=c[h>>2];c[n>>2]=0;if(!(c[17677]|0))Fe(50382,50397,1074,50413);c[17692]=(c[17692]|0)+(c[k>>2]|0);c[17693]=(c[17693]|0)+1;while(1){h=c[k>>2]|0;c[k>>2]=h+-1;if(!h)break;h=c[m>>2]|0;c[m>>2]=h+1;f=d[h>>0]|0;h=c[17694]|0;c[17694]=h+1;e=(c[17678]|0)+h|0;a[e>>0]=(d[e>>0]|0)^f;c[n>>2]=(c[n>>2]|0)+1;if((c[17694]|0)>>>0<600)continue;if(!((c[l>>2]|0)>>>0<3|(c[17695]|0)!=0)?(c[17696]=(c[17696]|0)+(c[n>>2]|0),c[n>>2]=0,(c[17696]|0)>>>0>=600):0)c[17695]=1;c[17694]=0;Vr(c[17678]|0);c[17684]=(c[17684]|0)+1;c[17698]=((c[k>>2]|0)!=0^1)&1}i=g;return}function Vr(b){b=b|0;var e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;e=i;i=i+224|0;if((i|0)>=(j|0))U();f=e+208|0;g=e+204|0;h=e+200|0;k=e+196|0;l=e+192|0;m=e+188|0;n=e;o=e+184|0;c[f>>2]=b;c[g>>2]=(c[f>>2]|0)+600;if(!(c[17677]|0))Fe(50382,50397,615,50428);Ok(n);c[k>>2]=(c[f>>2]|0)+600;b=c[g>>2]|0;p=(c[k>>2]|0)+-20|0;q=b+20|0;do{a[b>>0]=a[p>>0]|0;b=b+1|0;p=p+1|0}while((b|0)<(q|0));b=(c[g>>2]|0)+20|0;p=c[f>>2]|0;q=b+44|0;do{a[b>>0]=a[p>>0]|0;b=b+1|0;p=p+1|0}while((b|0)<(q|0));Pk(n,c[g>>2]|0);b=c[f>>2]|0;p=c[g>>2]|0;q=b+20|0;do{a[b>>0]=a[p>>0]|0;b=b+1|0;p=p+1|0}while((b|0)<(q|0));a:do if(c[17697]|0?(c[f>>2]|0)==(c[17678]|0):0){c[l>>2]=0;while(1){if((c[l>>2]|0)>=20)break a;r=(c[f>>2]|0)+(c[l>>2]|0)|0;a[r>>0]=(d[r>>0]|0)^(d[76063+(c[l>>2]|0)>>0]|0);c[l>>2]=(c[l>>2]|0)+1}}while(0);c[h>>2]=c[f>>2];c[m>>2]=1;while(1){if((c[m>>2]|0)>=30)break;b=c[g>>2]|0;p=c[h>>2]|0;q=b+20|0;do{a[b>>0]=a[p>>0]|0;b=b+1|0;p=p+1|0}while((b|0)<(q|0));c[h>>2]=(c[h>>2]|0)+20;b:do if(((c[h>>2]|0)+20+64|0)>>>0<(c[k>>2]|0)>>>0){b=(c[g>>2]|0)+20|0;p=(c[h>>2]|0)+20|0;q=b+44|0;do{a[b>>0]=a[p>>0]|0;b=b+1|0;p=p+1|0}while((b|0)<(q|0))}else{c[o>>2]=(c[h>>2]|0)+20;c[l>>2]=20;while(1){if((c[l>>2]|0)>=64)break b;if((c[o>>2]|0)>>>0>=(c[k>>2]|0)>>>0)c[o>>2]=c[f>>2];r=c[o>>2]|0;c[o>>2]=r+1;a[(c[g>>2]|0)+(c[l>>2]|0)>>0]=a[r>>0]|0;c[l>>2]=(c[l>>2]|0)+1}}while(0);Pk(n,c[g>>2]|0);b=c[h>>2]|0;p=c[g>>2]|0;q=b+20|0;do{a[b>>0]=a[p>>0]|0;b=b+1|0;p=p+1|0}while((b|0)<(q|0));c[m>>2]=(c[m>>2]|0)+1}if((c[f>>2]|0)!=(c[17678]|0)){Qe(384);Re();i=e;return}Qk(76063,c[f>>2]|0,600);c[17697]=1;Qe(384);Re();i=e;return}function Wr(){return 0}function Xr(){var a=0,b=0,d=0;a=i;i=i+16|0;if((i|0)>=(j|0))U();b=a;d=a+4|0;c[17677]=0;c[d>>2]=vt(12952)|0;if(c[d>>2]|0){c[b>>2]=ot(c[d>>2]|0)|0;Je(50437,b)}else{i=a;return}}function Yr(){Rr();at(0,0,0,0)|0;c[17695]=0;Xr();return}function Zr(){var a=0,b=0,d=0,e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0;a=i;i=i+48|0;if((i|0)>=(j|0))U();b=a;d=c[17684]|0;e=c[17686]|0;f=c[17687]|0;g=c[17693]|0;h=c[17692]|0;k=c[17685]|0;l=c[17689]|0;m=c[17688]|0;n=c[17691]|0;o=c[17690]|0;p=(Zs()|0)!=0;c[b>>2]=600;c[b+4>>2]=d;c[b+8>>2]=e;c[b+12>>2]=f;c[b+16>>2]=g;c[b+20>>2]=h;c[b+24>>2]=k;c[b+28>>2]=l;c[b+32>>2]=m;c[b+36>>2]=n;c[b+40>>2]=o;c[b+44>>2]=p?50474:76084;Ge(50490,b);i=a;return}function _r(){c[17679]=1;return}function $r(){c[17700]=1;return}function as(a){a=a|0;var b=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();c[b>>2]=a;i=b;return}function bs(a){a=a|0;var b=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();c[b>>2]=a;i=b;return 0}function cs(){Qr();return (c[17682]|0?1:(c[17700]|0)!=0)&1|0}function ds(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,k=0,l=0;e=i;i=i+32|0;if((i|0)>=(j|0))U();f=e+16|0;g=e+12|0;h=e+8|0;k=e+4|0;l=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;Qr();if((c[17700]|0)!=0&(c[h>>2]|0)>>>0>1)c[h>>2]=1;c[h>>2]=c[h>>2]&3;Rr();d=c[g>>2]|0;if((c[h>>2]|0)>>>0>=2){c[17690]=(c[17690]|0)+d;c[17691]=(c[17691]|0)+1}else{c[17688]=(c[17688]|0)+d;c[17689]=(c[17689]|0)+1}c[k>>2]=c[f>>2];while(1){if((c[g>>2]|0)>>>0<=0)break;c[l>>2]=(c[g>>2]|0)>>>0>600?600:c[g>>2]|0;es(c[k>>2]|0,c[l>>2]|0,c[h>>2]|0);c[g>>2]=(c[g>>2]|0)-(c[l>>2]|0);c[k>>2]=(c[k>>2]|0)+(c[l>>2]|0)}Xr();i=e;return}function es(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0;f=i;i=i+64|0;if((i|0)>=(j|0))U();g=f;h=f+48|0;k=f+44|0;l=f+40|0;m=f+36|0;n=f+32|0;o=f+28|0;p=f+24|0;q=f+20|0;r=f+16|0;s=f+12|0;t=f+8|0;u=f+4|0;c[h>>2]=b;c[k>>2]=d;c[l>>2]=e;if(!(c[17677]|0))Fe(50382,50397,934,50614);while(1){c[p>>2]=Kv()|0;if((c[3249]|0)==-1)c[3249]=c[p>>2];if((c[3249]|0)!=(c[p>>2]|0)){c[3249]=c[p>>2];c[q>>2]=c[3249];Ur(q,4,0);c[17698]=0}if(!(c[17677]|0)){v=8;break}if((c[k>>2]|0)>>>0>600){v=10;break}if((c[17695]|0)==0?fs()|0:0)c[17695]=1;if(!((c[l>>2]|0)!=2|(c[17703]|0)!=0)){c[17704]=0;c[r>>2]=(c[k>>2]|0)-(c[17704]|0);if((c[r>>2]|0)>>>0>=16){if((c[r>>2]|0)>>>0>600){v=18;break}}else c[r>>2]=16;hs(4,c[r>>2]|0,2);c[17704]=(c[17704]|0)+(c[r>>2]|0);c[17703]=1}if((c[l>>2]|0)==2?(c[17704]|0)>>>0<(c[k>>2]|0)>>>0:0){if((c[17704]|0)<0)c[17704]=0;c[s>>2]=(c[k>>2]|0)-(c[17704]|0);if((c[s>>2]|0)>>>0>600){v=25;break}hs(4,c[s>>2]|0,2);c[17704]=(c[17704]|0)+(c[s>>2]|0)}while(1){if(!((c[17695]|0)!=0^1))break;is()}js();c[t>>2]=c[3249];Ur(t,4,0);if(!(c[17698]|0)){Vr(c[17678]|0);c[17684]=(c[17684]|0)+1}c[m>>2]=0;c[o>>2]=c[17680];c[n>>2]=c[17678];while(1){if((c[m>>2]|0)>=150)break;c[c[o>>2]>>2]=(c[c[n>>2]>>2]|0)+-1515870811;c[m>>2]=(c[m>>2]|0)+1;c[o>>2]=(c[o>>2]|0)+4;c[n>>2]=(c[n>>2]|0)+4}Vr(c[17678]|0);c[17684]=(c[17684]|0)+1;Vr(c[17680]|0);c[17685]=(c[17685]|0)+1;while(1){e=c[k>>2]|0;c[k>>2]=e+-1;if(!e)break;e=c[17705]|0;c[17705]=e+1;d=a[(c[17680]|0)+e>>0]|0;e=c[h>>2]|0;c[h>>2]=e+1;a[e>>0]=d;if((c[17705]|0)>>>0>=600)c[17705]=0;c[17704]=(c[17704]|0)+-1}if((c[17704]|0)<0)c[17704]=0;Sw(c[17680]|0,0,600)|0;d=Kv()|0;if((d|0)==(c[p>>2]|0)){v=43;break}c[u>>2]=Kv()|0;Ur(u,4,0);c[17698]=0;c[3249]=c[u>>2]}if((v|0)==8)Fe(50382,50397,953,50614);else if((v|0)==10)Ke(50624,g);else if((v|0)==18)Ee(50397,979,50614);else if((v|0)==25)Ee(50397,995,50614);else if((v|0)==43){i=f;return}}function fs(){var a=0,b=0,d=0,e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0;a=i;i=i+768|0;if((i|0)>=(j|0))U();b=a+48|0;d=a+40|0;e=a+32|0;f=a+24|0;g=a+16|0;h=a+8|0;k=a+152|0;l=a+148|0;m=a+72|0;n=a+160|0;o=a+68|0;p=a+64|0;q=a+60|0;r=a+56|0;if(!(c[17677]|0))Fe(50382,50397,743,50656);if(!(c[17701]|0)){c[k>>2]=0;s=c[k>>2]|0;i=a;return s|0}c[l>>2]=Sv(c[17701]|0,0,a)|0;if((c[l>>2]|0)==-1?(c[(fu()|0)>>2]|0)==2:0){c[17702]=1;c[k>>2]=0;s=c[k>>2]|0;i=a;return s|0}if((c[l>>2]|0)==-1){t=xe(50671)|0;u=c[17701]|0;v=xu(c[(fu()|0)>>2]|0)|0;c[h>>2]=u;c[h+4>>2]=v;Ge(t,h);c[k>>2]=0;s=c[k>>2]|0;i=a;return s|0}h=(gs(c[l>>2]|0,c[17701]|0,0)|0)!=0;t=c[l>>2]|0;if(h){uv(t)|0;c[k>>2]=0;s=c[k>>2]|0;i=a;return s|0}if(Ov(t,m)|0){t=xe(50742)|0;h=c[17701]|0;v=xu(c[(fu()|0)>>2]|0)|0;c[g>>2]=h;c[g+4>>2]=v;Ge(t,g);uv(c[l>>2]|0)|0;c[k>>2]=0;s=c[k>>2]|0;i=a;return s|0}if((c[m+12>>2]&61440|0)!=32768){g=xe(50763)|0;c[f>>2]=c[17701];Ge(g,f);uv(c[l>>2]|0)|0;c[k>>2]=0;s=c[k>>2]|0;i=a;return s|0}if(!(c[m+36>>2]|0)){Ge(xe(50801)|0,e);uv(c[l>>2]|0)|0;c[17702]=1;c[k>>2]=0;s=c[k>>2]|0;i=a;return s|0}if((c[m+36>>2]|0)!=600){Ge(xe(50834)|0,d);uv(c[l>>2]|0)|0;c[k>>2]=0;s=c[k>>2]|0;i=a;return s|0}do{c[o>>2]=Rv(c[l>>2]|0,n,600)|0;if((c[o>>2]|0)!=-1)break}while((c[(fu()|0)>>2]|0)==4);if((c[o>>2]|0)!=600){o=xe(50888)|0;d=c[17701]|0;m=xu(c[(fu()|0)>>2]|0)|0;c[b>>2]=d;c[b+4>>2]=m;Je(o,b)}uv(c[l>>2]|0)|0;Ur(n,600,0);c[p>>2]=Kv()|0;Ur(p,4,0);c[q>>2]=ib(0)|0;Ur(q,4,0);c[r>>2]=Qa()|0;Ur(r,4,0);hs(0,16,0);c[17702]=1;c[k>>2]=1;s=c[k>>2]|0;i=a;return s|0}function gs(a,d,e){a=a|0;d=d|0;e=e|0;var f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;f=i;i=i+64|0;if((i|0)>=(j|0))U();g=f+16|0;h=f+8|0;k=f;l=f+60|0;m=f+56|0;n=f+52|0;o=f+48|0;p=f+32|0;q=f+24|0;r=f+20|0;c[m>>2]=a;c[n>>2]=d;c[o>>2]=e;c[r>>2]=0;c[p>>2]=0;c[p+4>>2]=0;c[p+8>>2]=0;c[p+12>>2]=0;b[p>>1]=c[o>>2]|0?1:0;b[p+2>>1]=0;while(1){o=c[m>>2]|0;c[k>>2]=p;if((tv(o,13,k)|0)!=-1){s=10;break}if((c[(fu()|0)>>2]|0)!=11?(c[(fu()|0)>>2]|0)!=13:0){s=5;break}if((c[r>>2]|0)>2){o=xe(50713)|0;c[g>>2]=c[n>>2];Ge(o,g)}c[q>>2]=c[r>>2];c[q+4>>2]=25e4;Pv(0,0,0,0,q)|0;if((c[r>>2]|0)>=10)continue;c[r>>2]=(c[r>>2]|0)+1}if((s|0)==5){r=xe(50692)|0;q=c[n>>2]|0;n=xu(c[(fu()|0)>>2]|0)|0;c[h>>2]=q;c[h+4>>2]=n;Ge(r,h);c[l>>2]=-1;t=c[l>>2]|0;i=f;return t|0}else if((s|0)==10){c[l>>2]=0;t=c[l>>2]|0;i=f;return t|0}return 0}function hs(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=i;i=i+32|0;if((i|0)>=(j|0))U();f=e+20|0;g=e+16|0;h=e+12|0;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;if(!(c[17681]|0))Je(50909,e);if((zb[c[17681]&7](3,c[f>>2]|0,c[g>>2]|0,c[h>>2]|0)|0)<0)Je(50960,e+8|0);else{i=e;return}}function is(){c[17686]=(c[17686]|0)+1;hs(3,120,1);return}function js(){var a=0,b=0,d=0,e=0,f=0;a=i;i=i+160|0;if((i|0)>=(j|0))U();b=a+144|0;d=a+8|0;e=a+4|0;f=a;if(!(c[17677]|0))Fe(50382,50397,1180,50998);c[17687]=(c[17687]|0)+1;if(c[17699]|0)vb[c[17699]&7](3,2);if(jb(b|0,0)|0)Ee(50397,1198,50998);else{Ur(b,4,2);Ur(b+4|0,4,2);nw(0,d)|0;Ur(d,136,2);Sw(d|0,0,136)|0;c[e>>2]=ib(0)|0;Ur(e,4,2);c[f>>2]=Qa()|0;Ur(f,4,2);_s(3,2);i=a;return}}function ks(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b;c[d>>2]=a;if(c[17701]|0)Ee(50397,673,51018);else{c[17701]=rf(c[d>>2]|0)|0;i=b;return}}function ls(){var a=0,b=0,d=0,e=0,f=0,g=0,h=0,k=0,l=0,m=0;a=i;i=i+64|0;if((i|0)>=(j|0))U();b=a+40|0;d=a+32|0;e=a+24|0;f=a+16|0;g=a+8|0;h=a+60|0;k=a+56|0;l=a+52|0;m=a+48|0;Pr();Rr();if(!((c[17701]|0)!=0&(c[17678]|0)!=0&(c[17695]|0)!=0)){Xr();i=a;return}if(!(c[17702]|0)){Xr();Ge(xe(51048)|0,a);i=a;return}c[m>>2]=0;c[k>>2]=c[17680];c[h>>2]=c[17678];while(1){if((c[m>>2]|0)>=150)break;c[c[k>>2]>>2]=(c[c[h>>2]>>2]|0)+-1515870811;c[m>>2]=(c[m>>2]|0)+1;c[k>>2]=(c[k>>2]|0)+4;c[h>>2]=(c[h>>2]|0)+4}Vr(c[17678]|0);c[17684]=(c[17684]|0)+1;Vr(c[17680]|0);c[17685]=(c[17685]|0)+1;h=c[17701]|0;c[g>>2]=384;c[l>>2]=Sv(h,65,g)|0;do if((c[l>>2]|0)!=-1){g=(gs(c[l>>2]|0,c[17701]|0,1)|0)!=0;h=c[l>>2]|0;if(g){uv(h)|0;break}if(aw(h,0)|0){h=xe(51107)|0;g=c[17701]|0;k=xu(c[(fu()|0)>>2]|0)|0;c[e>>2]=g;c[e+4>>2]=k;Ge(h,e);uv(c[l>>2]|0)|0;break}do{c[m>>2]=Qv(c[l>>2]|0,c[17680]|0,600)|0;if((c[m>>2]|0)!=-1)break}while((c[(fu()|0)>>2]|0)==4);if((c[m>>2]|0)!=600){h=xe(51107)|0;k=c[17701]|0;g=xu(c[(fu()|0)>>2]|0)|0;c[d>>2]=k;c[d+4>>2]=g;Ge(h,d)}if(uv(c[l>>2]|0)|0){h=xe(51129)|0;g=c[17701]|0;k=xu(c[(fu()|0)>>2]|0)|0;c[b>>2]=g;c[b+4>>2]=k;Ge(h,b)}}else{h=xe(51084)|0;k=c[17701]|0;g=xu(c[(fu()|0)>>2]|0)|0;c[f>>2]=k;c[f+4>>2]=g;Ge(h,f)}while(0);Xr();i=a;return}function ms(){Pr();Rr();if(!(c[17678]|0)){Xr();return}js();Xr();return}function ns(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b;c[d>>2]=a;os();if(!(c[d>>2]|0)){i=b;return}ps();do if(c[17708]|0){if(c[(c[17709]|0)+52>>2]|0)Fe(51187,51215,767,51229);if(c[(c[17710]|0)+52>>2]|0)Fe(51254,51215,768,51229);if(c[(c[17711]|0)+52>>2]|0)Fe(51284,51215,769,51229);else{rs(c[17709]|0);rs(c[17710]|0);rs(c[17711]|0);break}}else{c[17708]=of(48)|0;c[17709]=pf(1,68)|0;qs(c[17709]|0);c[17710]=qf(1,68)|0;qs(c[17710]|0);c[17711]=qf(1,68)|0;qs(c[17711]|0)}while(0);ss();i=b;return}function os(){if(c[17706]|0)return;c[17706]=1;c[17707]=0;return}function ps(){var a=0,b=0,d=0;a=i;i=i+16|0;if((i|0)>=(j|0))U();b=a;d=a+4|0;c[d>>2]=ut(13e3)|0;if(c[d>>2]|0){c[b>>2]=ot(c[d>>2]|0)|0;Je(51151,b)}else{c[17707]=1;i=a;return}}function qs(b){b=b|0;var d=0,e=0;d=i;i=i+16|0;if((i|0)>=(j|0))U();e=d;c[e>>2]=b;a[c[e>>2]>>0]=17;a[(c[e>>2]|0)+16>>0]=42;a[(c[e>>2]|0)+33>>0]=-119;a[(c[e>>2]|0)+50>>0]=-4;i=d;return}function rs(a){a=a|0;var b=0,e=0,f=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();e=b;f=b+4|0;c[f>>2]=a;if((((d[c[f>>2]>>0]|0|0)==17?(d[(c[f>>2]|0)+16>>0]|0|0)==42:0)?(d[(c[f>>2]|0)+33>>0]|0|0)==137:0)?(d[(c[f>>2]|0)+50>>0]|0|0)==252:0){i=b;return}c[e>>2]=c[f>>2];Je(51317,e)}function ss(){var a=0,b=0,d=0;a=i;i=i+16|0;if((i|0)>=(j|0))U();b=a;d=a+4|0;c[17707]=0;c[d>>2]=vt(13e3)|0;if(c[d>>2]|0){c[b>>2]=ot(c[d>>2]|0)|0;Je(51363,b)}else{i=a;return}}function ts(){ps();at(0,0,0,0)|0;ss();return}function us(){return}function vs(){return 0}function ws(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=i;i=i+16|0;if((i|0)>=(j|0))U();f=e+8|0;g=e+4|0;h=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;ns(1);ps();d=c[f>>2]|0;f=c[g>>2]|0;if((c[h>>2]|0)==2){xs(d,f,c[17711]|0);ss();i=e;return}else{xs(d,f,c[17710]|0);ss();i=e;return}}function xs(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,k=0,l=0;f=i;i=i+16|0;if((i|0)>=(j|0))U();g=f;h=f+12|0;k=f+8|0;l=f+4|0;c[h>>2]=b;c[k>>2]=d;c[l>>2]=e;if(!(c[h>>2]|0))Fe(52514,51215,685,52537);if(!(c[l>>2]|0))Fe(51399,51215,686,52537);rs(c[l>>2]|0);do if(!(c[(c[l>>2]|0)+4>>2]|0)){if((c[l>>2]|0)==(c[17709]|0)){e=ys(1)|0;c[(c[l>>2]|0)+4>>2]=e}else{e=ys(0)|0;c[(c[l>>2]|0)+4>>2]=e}if(c[(c[l>>2]|0)+4>>2]|0){e=Kv()|0;c[(c[l>>2]|0)+60>>2]=e;break}else Je(51932,g)}while(0);if(!((a[(c[l>>2]|0)+8>>0]<<7&255)<<24>>24>>7<<24>>24))Cs(c[l>>2]|0);e=c[(c[l>>2]|0)+60>>2]|0;if((e|0)==(Kv()|0)?(e=c[(c[l>>2]|0)+64>>2]|0,(e|0)==(Kv()|0)):0)if(Es(c[h>>2]|0,c[k>>2]|0,c[l>>2]|0)|0)Je(51932,g);else{rs(c[l>>2]|0);i=f;return}Sg(51215,714,52537,0,51669);Je(51932,g)}function ys(b){b=b|0;var e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;e=i;i=i+64|0;if((i|0)>=(j|0))U();f=e+16|0;g=e+8|0;h=e+48|0;k=e+44|0;l=e+40|0;m=e+36|0;n=e+32|0;o=e+28|0;p=e+24|0;q=e+52|0;r=e;s=e+20|0;c[k>>2]=b;if(!(c[17707]|0))Fe(51407,51215,596,51426);c[m>>2]=jh(l,7,1,1)|0;if(c[m>>2]|0){c[g>>2]=zs(c[m>>2]|0)|0;Ie(51444,g);c[h>>2]=0;t=c[h>>2]|0;i=e;return t|0}if(c[k>>2]|0){c[n>>2]=mf(16)|0;xs(c[n>>2]|0,16,c[17710]|0)}else c[n>>2]=As(16)|0;c[m>>2]=wh(c[l>>2]|0,c[n>>2]|0,16)|0;c[o>>2]=c[n>>2];c[p>>2]=16;a[q>>0]=0;k=r;c[k>>2]=d[q>>0];c[k+4>>2]=0;while(1){if(!(c[o>>2]&7|0?(c[p>>2]|0)!=0:0))break;a[c[o>>2]>>0]=a[q>>0]|0;c[o>>2]=(c[o>>2]|0)+1;c[p>>2]=(c[p>>2]|0)+-1}if((c[p>>2]|0)>>>0>=8){k=r;g=Xw(c[k>>2]|0,c[k+4>>2]|0,16843009,16843009)|0;k=r;c[k>>2]=g;c[k+4>>2]=C;do{c[s>>2]=c[o>>2];k=r;g=c[k+4>>2]|0;b=c[s>>2]|0;c[b>>2]=c[k>>2];c[b+4>>2]=g;c[p>>2]=(c[p>>2]|0)-8;c[o>>2]=(c[o>>2]|0)+8}while((c[p>>2]|0)>>>0>=8)}while(1){if(!(c[p>>2]|0))break;a[c[o>>2]>>0]=a[q>>0]|0;c[o>>2]=(c[o>>2]|0)+1;c[p>>2]=(c[p>>2]|0)+-1}hf(c[n>>2]|0);if(c[m>>2]|0){c[f>>2]=zs(c[m>>2]|0)|0;Ie(51593,f);oh(c[l>>2]|0);c[h>>2]=0;t=c[h>>2]|0;i=e;return t|0}else{c[h>>2]=c[l>>2];t=c[h>>2]|0;i=e;return t|0}return 0}function zs(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b;c[d>>2]=a;a=ot(c[d>>2]|0)|0;i=b;return a|0}function As(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b;e=b+12|0;f=b+8|0;g=b+4|0;c[e>>2]=a;if(c[17712]|0)Fe(51487,51215,552,51511);c[17712]=of(c[e>>2]|0)|0;c[17713]=c[e>>2];c[17714]=0;c[g>>2]=at(4,0,16,2)|0;if((c[g>>2]|0)<0){h=c[17712]|0;hf(h);c[17712]=0;Je(51565,d)}if((c[17714]|0)!=(c[17713]|0)){h=c[17712]|0;hf(h);c[17712]=0;Je(51565,d)}else{c[f>>2]=c[17712];c[17712]=0;i=b;return c[f>>2]|0}return 0}function Bs(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,k=0,l=0,m=0;g=i;i=i+16|0;if((i|0)>=(j|0))U();h=g+12|0;k=g+8|0;l=g;c[h>>2]=b;c[k>>2]=e;c[g+4>>2]=f;c[l>>2]=c[h>>2];if(!(c[17707]|0))Fe(51407,51215,531,51523);if(!(c[17712]|0))Fe(51542,51215,532,51523);while(1){h=c[k>>2]|0;c[k>>2]=h+-1;if(!h){m=8;break}if((c[17714]|0)>>>0>=(c[17713]|0)>>>0){m=8;break}h=c[l>>2]|0;c[l>>2]=h+1;f=d[h>>0]|0;h=c[17714]|0;c[17714]=h+1;e=(c[17712]|0)+h|0;a[e>>0]=(d[e>>0]|0)^f}if((m|0)==8){i=g;return}}function Cs(b){b=b|0;var d=0,e=0,f=0;d=i;i=i+16|0;if((i|0)>=(j|0))U();e=d;c[e>>2]=b;if(!(c[17707]|0))Fe(51407,51215,658,51625);b=(c[e>>2]|0)+17|0;if((c[e>>2]|0)==(c[17709]|0)){xs(b,16,c[17710]|0);f=(c[e>>2]|0)+8|0;a[f>>0]=a[f>>0]&-2|1;f=Kv()|0;c[(c[e>>2]|0)+64>>2]=f;i=d;return}else{Ds(b,16);b=(c[e>>2]|0)+8|0;a[b>>0]=a[b>>0]&-2|1;b=Kv()|0;c[(c[e>>2]|0)+64>>2]=b;i=d;return}}function Ds(b,e){b=b|0;e=e|0;var f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0;f=i;i=i+48|0;if((i|0)>=(j|0))U();g=f+28|0;h=f+24|0;k=f+20|0;l=f+16|0;m=f+12|0;n=f+32|0;o=f;p=f+8|0;c[g>>2]=b;c[h>>2]=e;if(!(c[17707]|0))Fe(51407,51215,642,51637);if((c[h>>2]|0)!=16)Fe(51656,51215,643,51637);c[k>>2]=As(16)|0;h=c[g>>2]|0;g=c[k>>2]|0;e=h+16|0;do{a[h>>0]=a[g>>0]|0;h=h+1|0;g=g+1|0}while((h|0)<(e|0));c[l>>2]=c[k>>2];c[m>>2]=16;a[n>>0]=0;g=o;c[g>>2]=d[n>>0];c[g+4>>2]=0;while(1){if(!(c[l>>2]&7|0?(c[m>>2]|0)!=0:0))break;a[c[l>>2]>>0]=a[n>>0]|0;c[l>>2]=(c[l>>2]|0)+1;c[m>>2]=(c[m>>2]|0)+-1}if((c[m>>2]|0)>>>0>=8){g=o;h=Xw(c[g>>2]|0,c[g+4>>2]|0,16843009,16843009)|0;g=o;c[g>>2]=h;c[g+4>>2]=C;do{c[p>>2]=c[l>>2];g=o;h=c[g+4>>2]|0;e=c[p>>2]|0;c[e>>2]=c[g>>2];c[e+4>>2]=h;c[m>>2]=(c[m>>2]|0)-8;c[l>>2]=(c[l>>2]|0)+8}while((c[m>>2]|0)>>>0>=8)}while(1){if(!(c[m>>2]|0))break;a[c[l>>2]>>0]=a[n>>0]|0;c[l>>2]=(c[l>>2]|0)+1;c[m>>2]=(c[m>>2]|0)+-1}hf(c[k>>2]|0);i=f;return}function Es(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0;g=i;i=i+80|0;if((i|0)>=(j|0))U();h=g+48|0;k=g+44|0;l=g+40|0;m=g+36|0;n=g+56|0;o=g+32|0;p=g+28|0;q=g+24|0;r=g+20|0;s=g+16|0;t=g+12|0;u=g+52|0;v=g;w=g+8|0;c[k>>2]=b;c[l>>2]=e;c[m>>2]=f;if(!(c[17707]|0))Fe(51407,51215,444,51723);if(!(c[(c[m>>2]|0)+4>>2]|0))Fe(51739,51215,445,51723);if(!((a[(c[m>>2]|0)+8>>0]<<7&255)<<24>>24>>7<<24>>24))Fe(51758,51215,446,51723);if(!(c[17708]|0))Fe(51777,51215,448,51723);c[o>>2]=c[17708];c[p>>2]=(c[17708]|0)+16;c[q>>2]=(c[17708]|0)+32;while(1){if(!(c[l>>2]|0)){x=33;break}if((c[(c[m>>2]|0)+52>>2]|0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>2];c[b+4>>2]=f;c[t>>2]=(c[t>>2]|0)-8;c[s>>2]=(c[s>>2]|0)+8}while((c[t>>2]|0)>>>0>=8)}while(1){if(!(c[t>>2]|0))break;a[c[s>>2]>>0]=a[u>>0]|0;c[s>>2]=(c[s>>2]|0)+1;c[t>>2]=(c[t>>2]|0)+-1}c[k>>2]=(c[k>>2]|0)+(c[r>>2]|0);c[l>>2]=(c[l>>2]|0)-(c[r>>2]|0)}if((x|0)==22){Sg(51215,502,51723,0,51892);c[h>>2]=-1;B=c[h>>2]|0;i=g;return B|0}else if((x|0)==33){c[h>>2]=0;B=c[h>>2]|0;i=g;return B|0}return 0}function Fs(d,f,g){d=d|0;f=f|0;g=g|0;var h=0,k=0,l=0,m=0,n=0,o=0,p=0;h=i;i=i+32|0;if((i|0)>=(j|0))U();k=h;l=h+28|0;m=h+24|0;n=h+20|0;o=h+16|0;p=h+8|0;c[l>>2]=d;c[m>>2]=f;c[n>>2]=g;if((c[m>>2]|0)!=16)Fe(51656,51215,273,51807);if(!(c[17707]|0))Fe(51407,51215,274,51807);if(((c[(c[n>>2]|0)+52>>2]|0?(c[n>>2]|0)!=(c[17709]|0):0)?(c[n>>2]|0)!=(c[17710]|0):0)?(c[n>>2]|0)!=(c[17711]|0):0){m=c[l>>2]|0;g=c[(c[n>>2]|0)+52>>2]|0;f=m+16|0;do{a[m>>0]=a[g>>0]|0;m=m+1|0;g=g+1|0}while((m|0)<(f|0));a[(c[l>>2]|0)+12>>0]=(c[(c[n>>2]|0)+56>>2]|0)>>>24;a[(c[l>>2]|0)+13>>0]=(c[(c[n>>2]|0)+56>>2]|0)>>>16;a[(c[l>>2]|0)+14>>0]=(c[(c[n>>2]|0)+56>>2]|0)>>>8;a[(c[l>>2]|0)+15>>0]=c[(c[n>>2]|0)+56>>2];g=(c[n>>2]|0)+56|0;c[g>>2]=(c[g>>2]|0)+1;i=h;return}if(!(c[17715]|0)){c[17716]=Kv()|0;c[17717]=bw()|0}if(jb(p|0,0)|0){c[k>>2]=xu(c[(fu()|0)>>2]|0)|0;Je(51819,k)}c[o>>2]=c[p+4>>2];c[o>>2]=c[o>>2]<<4;if((c[p>>2]|0)==(c[17715]|0)?(c[o>>2]|0)==(c[17718]|0):0){b[35736]=(b[35736]|0)+1<<16>>16;b[35736]=(e[35736]|0)&4095}else{b[35736]=0;c[17715]=c[p>>2];c[17718]=c[o>>2]}a[c[l>>2]>>0]=c[p>>2]>>24;a[(c[l>>2]|0)+1>>0]=c[p>>2]>>16;a[(c[l>>2]|0)+2>>0]=c[p>>2]>>8;a[(c[l>>2]|0)+3>>0]=c[p>>2];a[(c[l>>2]|0)+4>>0]=(c[o>>2]|0)>>>16;a[(c[l>>2]|0)+5>>0]=(c[o>>2]|0)>>>8;a[(c[l>>2]|0)+6>>0]=c[o>>2]&240|(e[35736]|0)>>8&15;a[(c[l>>2]|0)+7>>0]=e[35736]|0;a[(c[l>>2]|0)+8>>0]=(c[17716]|0)>>>24;a[(c[l>>2]|0)+9>>0]=(c[17716]|0)>>>16;a[(c[l>>2]|0)+10>>0]=(c[17716]|0)>>>8;a[(c[l>>2]|0)+11>>0]=c[17716];a[(c[l>>2]|0)+12>>0]=(c[17717]|0)>>>24;a[(c[l>>2]|0)+13>>0]=(c[17717]|0)>>>16;a[(c[l>>2]|0)+14>>0]=(c[17717]|0)>>>8;a[(c[l>>2]|0)+15>>0]=c[17717];l=(c[17717]|0)+1|0;c[17717]=l;if(l|0){i=h;return}c[17716]=(c[17716]|0)+1;i=h;return}function Gs(b,e,f,g,h,k){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;k=k|0;var l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0;l=i;i=i+80|0;if((i|0)>=(j|0))U();m=l+60|0;n=l+56|0;o=l+52|0;p=l+48|0;q=l+44|0;r=l+40|0;s=l+36|0;t=l+32|0;u=l+65|0;v=l+8|0;w=l+28|0;x=l+24|0;y=l+20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=c[x>>2];r=A;t=c[r+4>>2]|0;s=c[B>>2]|0;c[s>>2]=c[r>>2];c[s+4>>2]=t;c[y>>2]=(c[y>>2]|0)-8;c[x>>2]=(c[x>>2]|0)+8}while((c[y>>2]|0)>>>0>=8)}while(1){if(!(c[y>>2]|0))break;a[c[x>>2]>>0]=a[z>>0]|0;c[x>>2]=(c[x>>2]|0)+1;c[y>>2]=(c[y>>2]|0)+-1}i=l;return}function Hs(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,k=0,l=0,m=0,n=0;f=i;i=i+32|0;if((i|0)>=(j|0))U();g=f;h=f+20|0;k=f+16|0;l=f+12|0;m=f+8|0;n=f+4|0;c[h>>2]=a;c[k>>2]=b;c[l>>2]=d;c[m>>2]=e;if((c[m>>2]|0)!=16)Fe(51656,51215,386,51846);c[n>>2]=ph(c[h>>2]|0,c[k>>2]|0,c[m>>2]|0,c[l>>2]|0,c[m>>2]|0)|0;if(c[n>>2]|0){c[g>>2]=zs(c[n>>2]|0)|0;Je(51858,g)}else{i=f;return}}function Is(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,k=0,l=0,m=0,n=0;h=i;i=i+16|0;if((i|0)>=(j|0))U();k=h+12|0;l=h+8|0;m=h+4|0;n=h;c[k>>2]=b;c[l>>2]=e;c[m>>2]=f;c[n>>2]=g;while(1){if(!(c[n>>2]|0))break;a[c[k>>2]>>0]=(d[c[l>>2]>>0]|0)^(d[c[m>>2]>>0]|0);c[n>>2]=(c[n>>2]|0)+-1;c[l>>2]=(c[l>>2]|0)+1;c[m>>2]=(c[m>>2]|0)+1;c[k>>2]=(c[k>>2]|0)+1}i=h;return}function Js(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=i;i=i+16|0;if((i|0)>=(j|0))U();e=d+4|0;f=d;c[e>>2]=a;c[f>>2]=b;ns(1);ps();xs(c[e>>2]|0,c[f>>2]|0,c[17709]|0);ss();i=d;return}function Ks(a){a=a|0;var b=0,d=0,e=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b+4|0;e=b;c[d>>2]=a;Xm(b+8|0,8,1);c[e>>2]=Ls(c[d>>2]|0)|0;d=Ms(c[e>>2]|0)|0;i=b;return d|0}function Ls(b){b=b|0;var e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;e=i;i=i+48|0;if((i|0)>=(j|0))U();f=e+20|0;g=e+16|0;h=e+12|0;k=e+8|0;l=e+4|0;m=e;n=e+24|0;c[f>>2]=b;c[m>>2]=0;if(!(c[17708]|0))Fe(51777,51215,912,51961);c[k>>2]=pf(1,68)|0;qs(c[k>>2]|0);ps();c[g>>2]=0;a:while(1){if((c[g>>2]|0)>>>0>=3)break;c[l>>2]=jh((c[k>>2]|0)+4|0,7,1,1)|0;if(c[l>>2]|0){o=6;break}c[l>>2]=wh(c[(c[k>>2]|0)+4>>2]|0,52012+((c[g>>2]|0)*96|0)|0,16)|0;if(c[l>>2]|0){o=8;break}b=Kv()|0;c[(c[k>>2]|0)+60>>2]=b;b=(c[k>>2]|0)+17|0;p=52012+((c[g>>2]|0)*96|0)+32|0;q=b+16|0;do{a[b>>0]=a[p>>0]|0;b=b+1|0;p=p+1|0}while((b|0)<(q|0));p=(c[k>>2]|0)+8|0;a[p>>0]=a[p>>0]&-2|1;p=Kv()|0;c[(c[k>>2]|0)+64>>2]=p;c[(c[k>>2]|0)+52>>2]=52012+((c[g>>2]|0)*96|0)+16;c[(c[k>>2]|0)+56>>2]=(d[52012+((c[g>>2]|0)*96|0)+16+12>>0]|0)<<24|(d[52012+((c[g>>2]|0)*96|0)+16+13>>0]|0)<<16|(d[52012+((c[g>>2]|0)*96|0)+16+14>>0]|0)<<8|(d[52012+((c[g>>2]|0)*96|0)+16+15>>0]|0);c[h>>2]=0;while(1){if((c[h>>2]|0)>=3)break;if(Es(n,16,c[k>>2]|0)|0){o=12;break a}if(vv(n,52012+((c[g>>2]|0)*96|0)+48+(c[h>>2]<<4)|0,16)|0){o=14;break a}c[h>>2]=(c[h>>2]|0)+1}p=c[(c[k>>2]|0)+60>>2]|0;if((p|0)!=(Kv()|0)){o=18;break}p=c[(c[k>>2]|0)+64>>2]|0;if((p|0)!=(Kv()|0)){o=18;break}oh(c[(c[k>>2]|0)+4>>2]|0);c[(c[k>>2]|0)+4>>2]=0;p=(c[k>>2]|0)+8|0;a[p>>0]=a[p>>0]&-2;rs(c[k>>2]|0);c[g>>2]=(c[g>>2]|0)+1}if((o|0)==6)c[m>>2]=51974;else if((o|0)==8)c[m>>2]=52300;else if((o|0)==12)c[m>>2]=52326;else if((o|0)==14)c[m>>2]=52357;else if((o|0)==18)c[m>>2]=52395;ss();oh(c[(c[k>>2]|0)+4>>2]|0);rs(c[k>>2]|0);hf(c[k>>2]|0);if(!((c[f>>2]|0)!=0&(c[m>>2]|0)!=0)){r=c[m>>2]|0;s=(r|0)!=0;t=s?50:0;i=e;return t|0}Cb[c[f>>2]&1](52417,0,52424,c[m>>2]|0);r=c[m>>2]|0;s=(r|0)!=0;t=s?50:0;i=e;return t|0}function Ms(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b;c[d>>2]=a;a=Ns(1,c[d>>2]|0)|0;i=b;return a|0}function Ns(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=i;i=i+16|0;if((i|0)>=(j|0))U();e=d+4|0;f=d;c[e>>2]=a;c[f>>2]=b;if(!(c[f>>2]|0)){g=0;i=d;return g|0}g=(c[e>>2]&127)<<24|c[f>>2]&65535;i=d;return g|0}function Os(b,e,f,g,h,k,l,m){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;k=k|0;l=l|0;m=m|0;var n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0;n=i;i=i+48|0;if((i|0)>=(j|0))U();o=n+40|0;p=n+36|0;q=n+32|0;r=n+28|0;s=n+24|0;t=n+20|0;u=n+16|0;v=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=c[x>>2];z=c[o>>2]|0;i=n;return z|0}function Ps(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,k=0,l=0,m=0;e=i;i=i+32|0;if((i|0)>=(j|0))U();f=e+16|0;g=e+12|0;h=e+8|0;k=e+4|0;l=e;c[g>>2]=a;c[h>>2]=b;c[k>>2]=d;c[l>>2]=c[g>>2];if((c[l>>2]|0)!=0&(c[h>>2]|0)!=0^1|(c[k>>2]|0)!=16){c[f>>2]=45;m=c[f>>2]|0;i=e;return m|0}else{ps();xs(c[h>>2]|0,c[k>>2]|0,c[l>>2]|0);ss();c[f>>2]=0;m=c[f>>2]|0;i=e;return m|0}return 0}function Qs(a){a=a|0;var b=0,d=0,e=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b+4|0;e=b;c[d>>2]=a;c[e>>2]=c[d>>2];if(!(c[e>>2]|0)){i=b;return}oh(c[(c[e>>2]|0)+4>>2]|0);hf(c[e>>2]|0);i=b;return}function Rs(a){a=a|0;var b=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();c[b>>2]=a;Ss();i=b;return}function Ss(){if(c[17719]|0)return;c[17719]=1;c[17720]=0;return}function Ts(){Us();at(0,0,0,0)|0;Vs();return}function Us(){var a=0,b=0,d=0;a=i;i=i+16|0;if((i|0)>=(j|0))U();b=a;d=a+4|0;c[d>>2]=ut(13044)|0;if(c[d>>2]|0){c[b>>2]=ot(c[d>>2]|0)|0;Je(52428,b)}else{c[17720]=1;i=a;return}}function Vs(){var a=0,b=0,d=0;a=i;i=i+16|0;if((i|0)>=(j|0))U();b=a;d=a+4|0;c[17720]=0;c[d>>2]=vt(13044)|0;if(c[d>>2]|0){c[b>>2]=ot(c[d>>2]|0)|0;Je(52471,b)}else{i=a;return}}function Ws(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=i;i=i+16|0;if((i|0)>=(j|0))U();f=e+8|0;g=e+4|0;h=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;Rs(1);if((c[h>>2]|0)!=2)c[h>>2]=1;Us();Xs(c[f>>2]|0,c[g>>2]|0,c[h>>2]|0);Vs();i=e;return}function Xs(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,k=0,l=0,m=0;e=i;i=i+32|0;if((i|0)>=(j|0))U();f=e;g=e+16|0;h=e+12|0;k=e+8|0;l=e+4|0;c[g>>2]=a;c[h>>2]=b;c[k>>2]=d;if(!(c[g>>2]|0))Fe(52514,52521,144,52537);c[17721]=c[g>>2];c[17722]=c[h>>2];c[17723]=0;c[l>>2]=at(5,0,c[h>>2]|0,c[k>>2]|0)|0;if((c[l>>2]|0)<0){m=c[l>>2]|0;c[f>>2]=m;Je(52592,f)}if((c[17723]|0)!=(c[17722]|0)){m=c[l>>2]|0;c[f>>2]=m;Je(52592,f)}else{i=e;return}}function Ys(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,k=0,l=0;f=i;i=i+16|0;if((i|0)>=(j|0))U();g=f+12|0;h=f+8|0;k=f;c[g>>2]=b;c[h>>2]=d;c[f+4>>2]=e;c[k>>2]=c[g>>2];if(!(c[17720]|0))Fe(52548,52521,124,52569);if(!(c[17721]|0))Fe(52577,52521,125,52569);while(1){g=c[h>>2]|0;c[h>>2]=g+-1;if(!g){l=8;break}if((c[17723]|0)>>>0>=(c[17722]|0)>>>0){l=8;break}g=c[k>>2]|0;c[k>>2]=g+1;e=a[g>>0]|0;g=c[17723]|0;c[17723]=g+1;a[(c[17721]|0)+g>>0]=e}if((l|0)==8){i=f;return}}function Zs(){return c[17724]|0}function _s(a,b){a=a|0;b=b|0;var d=0;d=i;i=i+16|0;if((i|0)>=(j|0))U();c[d+4>>2]=a;c[d>>2]=b;i=d;return}function $s(a,b){a=a|0;b=b|0;var d=0,e=0;d=i;i=i+16|0;if((i|0)>=(j|0))U();e=d;c[d+8>>2]=a;c[d+4>>2]=b;c[e>>2]=0;i=d;return c[e>>2]|0}function at(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0;h=i;i=i+1024|0;if((i|0)>=(j|0))U();k=h+24|0;l=h+16|0;m=h+8|0;n=h+236|0;o=h+232|0;p=h+228|0;q=h+224|0;r=h+220|0;s=h+216|0;t=h+212|0;u=h+248|0;v=h+208|0;w=h+204|0;x=h+200|0;y=h+196|0;z=h+192|0;A=h+64|0;B=h+56|0;D=h+52|0;E=h+48|0;F=h+44|0;G=h+40|0;H=h+36|0;I=h+32|0;J=h+240|0;K=h;L=h+28|0;c[o>>2]=b;c[p>>2]=e;c[q>>2]=f;c[r>>2]=g;c[w>>2]=c[q>>2];c[x>>2]=0;c[y>>2]=0;if(!(c[o>>2]|0)){if((c[3272]|0)!=-1){uv(c[3272]|0)|0;c[3272]=-1}if((c[3273]|0)!=-1){uv(c[3273]|0)|0;c[3273]=-1}c[n>>2]=0;M=c[n>>2]|0;i=h;return M|0}c[v>>2]=$s(c[o>>2]|0,c[p>>2]|0)|0;if((c[v>>2]|0)>>>0>(((c[q>>2]|0)>>>0)/2|0)>>>0)c[v>>2]=((c[q>>2]|0)>>>0)/2|0;if((c[q>>2]|0)>>>0>1)c[q>>2]=(c[q>>2]|0)-(c[v>>2]|0);if((c[r>>2]|0)>=2){if((c[3272]|0)==-1){c[3272]=bt(52638,(d[76083]|0)&1)|0;a[76083]=d[76083]|0|1}c[s>>2]=c[3272]}else{if((c[3273]|0)==-1){c[3273]=bt(52740,(d[76083]|0)&2)|0;a[76083]=d[76083]|0|2}c[s>>2]=c[3273]}c[z>>2]=0;while(1){if(!(c[q>>2]|0))break;if(!(!(c[y>>2]|0)?(c[x>>2]|0)==((c[w>>2]|0)-(c[q>>2]|0)|0):0)){c[x>>2]=(c[w>>2]|0)-(c[q>>2]|0);Jm(52753,88,c[x>>2]|0,c[w>>2]|0);c[y>>2]=1}if((c[s>>2]|0)<1024){c[F>>2]=A;c[E>>2]=32;while(1){if(!(c[E>>2]|0))break;r=c[F>>2]|0;c[F>>2]=r+4;c[r>>2]=0;c[E>>2]=(c[E>>2]|0)+-1}r=A+((((c[s>>2]|0)>>>0)/32|0)<<2)|0;c[r>>2]=c[r>>2]|1<<(((c[s>>2]|0)>>>0)%32|0);c[B>>2]=c[z>>2];c[B+4>>2]=c[z>>2]|0?0:1e5;r=Pv((c[s>>2]|0)+1|0,A,0,0,B)|0;c[D>>2]=r;if(!r){c[y>>2]=1;c[z>>2]=3;continue}if((c[D>>2]|0)==-1){c[m>>2]=xu(c[(fu()|0)>>2]|0)|0;Ie(52766,m);if(c[z>>2]|0)continue;c[z>>2]=1;continue}}do{c[G>>2]=(c[q>>2]|0)>>>0<768?c[q>>2]|0:768;c[t>>2]=Rv(c[s>>2]|0,u,c[G>>2]|0)|0;if((c[t>>2]|0)>=0?(c[t>>2]|0)>>>0>(c[G>>2]|0)>>>0:0){c[l>>2]=c[t>>2];Ie(52786,l);c[t>>2]=c[G>>2]}if((c[t>>2]|0)!=-1)break}while((c[(fu()|0)>>2]|0)==4);if((c[t>>2]|0)==-1){N=38;break}xb[c[o>>2]&7](u,c[t>>2]|0,c[p>>2]|0);c[q>>2]=(c[q>>2]|0)-(c[t>>2]|0)}if((N|0)==38){c[k>>2]=xu(c[(fu()|0)>>2]|0)|0;Je(52824,k)}c[H>>2]=u;c[I>>2]=768;a[J>>0]=0;u=K;c[u>>2]=d[J>>0];c[u+4>>2]=0;while(1){if(!(c[H>>2]&7|0?(c[I>>2]|0)!=0:0))break;a[c[H>>2]>>0]=a[J>>0]|0;c[H>>2]=(c[H>>2]|0)+1;c[I>>2]=(c[I>>2]|0)+-1}if((c[I>>2]|0)>>>0>=8){u=K;k=Xw(c[u>>2]|0,c[u+4>>2]|0,16843009,16843009)|0;u=K;c[u>>2]=k;c[u+4>>2]=C;do{c[L>>2]=c[H>>2];u=K;k=c[u+4>>2]|0;N=c[L>>2]|0;c[N>>2]=c[u>>2];c[N+4>>2]=k;c[I>>2]=(c[I>>2]|0)-8;c[H>>2]=(c[H>>2]|0)+8}while((c[I>>2]|0)>>>0>=8)}while(1){if(!(c[I>>2]|0))break;a[c[H>>2]>>0]=a[J>>0]|0;c[H>>2]=(c[H>>2]|0)+1;c[I>>2]=(c[I>>2]|0)+-1}if(c[y>>2]|0)Jm(52753,88,c[w>>2]|0,c[w>>2]|0);c[n>>2]=0;M=c[n>>2]|0;i=h;return M|0}function bt(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0;d=i;i=i+48|0;if((i|0)>=(j|0))U();e=d+16|0;f=d+8|0;g=d;h=d+40|0;k=d+36|0;l=d+32|0;m=d+24|0;c[h>>2]=a;c[k>>2]=b;if(c[k>>2]|0)Jm(52650,88,1,0);while(1){c[l>>2]=Sv(c[h>>2]|0,0,g)|0;if(!((c[l>>2]|0)==-1&(c[k>>2]|0)!=0))break;c[m>>2]=5;c[m+4>>2]=0;Jm(52666,88,0,c[m>>2]|0);Pv(0,0,0,0,m)|0}if((c[l>>2]|0)==-1){m=c[h>>2]|0;h=xu(c[(fu()|0)>>2]|0)|0;c[f>>2]=m;c[f+4>>2]=h;Je(52682,f)}if(!(ct(c[l>>2]|0)|0)){n=c[l>>2]|0;i=d;return n|0}f=c[l>>2]|0;h=xu(c[(fu()|0)>>2]|0)|0;c[e>>2]=f;c[e+4>>2]=h;Ie(52701,e);n=c[l>>2]|0;i=d;return n|0}function ct(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,k=0;b=i;i=i+32|0;if((i|0)>=(j|0))U();d=b+8|0;e=b;f=b+20|0;g=b+16|0;h=b+12|0;c[g>>2]=a;a=c[g>>2]|0;c[e>>2]=0;c[h>>2]=tv(a,1,e)|0;e=c[h>>2]|0;if((c[h>>2]|0)<0){c[f>>2]=e;k=c[f>>2]|0;i=b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]|0)|0)>=0){if(!(sf(1)|0))continue;Le(52904,g);continue}if((io(c[m>>2]|0,0)|0)>0)break;if(!(sf(1)|0))continue;Le(52926,f)}hf(c[p>>2]|0);i=e;return c[m>>2]|0}function ft(b,d,e,f,g,h,k){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;k=k|0;var l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0;l=i;i=i+80|0;if((i|0)>=(j|0))U();m=l+72|0;n=l+68|0;o=l+64|0;p=l+60|0;q=l+56|0;r=l+52|0;s=l+48|0;t=l+44|0;u=l+40|0;v=l+36|0;w=l+32|0;x=l+28|0;y=l+24|0;z=l+20|0;A=l+16|0;B=l+12|0;C=l+8|0;D=l+4|0;E=l;c[n>>2]=b;c[o>>2]=d;c[p>>2]=e;c[q>>2]=f;c[r>>2]=g;c[s>>2]=h;c[t>>2]=k;c[v>>2]=0;c[w>>2]=0;c[x>>2]=0;c[y>>2]=0;c[z>>2]=0;c[A>>2]=0;c[B>>2]=0;c[D>>2]=Zn(c[o>>2]|0)|0;if(!((c[D>>2]|0)!=0&(c[q>>2]|0)!=0&(c[r>>2]|0)!=0)){c[m>>2]=32816;F=c[m>>2]|0;i=l;return F|0}k=bj(c[s>>2]|0)|0;if((k|0)!=(c[r>>2]|0)){c[m>>2]=5;F=c[m>>2]|0;i=l;return F|0}c[v>>2]=bf(c[r>>2]|0)|0;a:do if(c[v>>2]|0){c[E>>2]=0;while(1){if((c[E>>2]|0)>>>0>=(c[r>>2]|0)>>>0)break;a[(c[v>>2]|0)+(c[E>>2]|0)>>0]=1;c[E>>2]=(c[E>>2]|0)+1}c[w>>2]=jf(1,c[r>>2]|0)|0;if(!(c[w>>2]|0)){c[u>>2]=rt()|0;break}c[u>>2]=gt(x,c[p>>2]|0,(((c[D>>2]|0)+7|0)>>>0)/8|0)|0;if(((((((c[u>>2]|0)==0?(c[u>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rn(c[c[n>>2]>>2]|0,c[(c[n>>2]|0)+4>>2]|0,0,c[(c[n>>2]|0)+8>>2]|0,c[(c[n>>2]|0)+12>>2]|0,c[(c[n>>2]|0)+16>>2]|0)|0;while(1){qp(c[u>>2]|0);c[u>>2]=0;if((c[q>>2]&2|0)!=0&(c[r>>2]|0)!=0){if(!(c[m>>2]|0)){G=9;break}if(!(c[(c[m>>2]|0)+12>>2]&4)){G=9;break}c[B>>2]=tp(c[m>>2]|0,C)|0;c[s>>2]=ft(u,c[(c[n>>2]|0)+32>>2]|0,c[(c[n>>2]|0)+56>>2]|0,c[B>>2]|0,(((c[C>>2]|0)+7|0)>>>0)/8|0,c[r>>2]|0,c[t>>2]|0)|0;if(c[s>>2]|0)break;c[t>>2]=(c[t>>2]|0)+1}else c[u>>2]=et(c[(c[n>>2]|0)+32>>2]|0,1)|0;On(z,c[u>>2]|0,(c[n>>2]|0)+20|0,c[E>>2]|0);if(fn(c[y>>2]|0,0,z,c[E>>2]|0)|0){G=14;break}zo(c[o>>2]|0,c[y>>2]|0,c[(c[n>>2]|0)+32>>2]|0);if((io(c[o>>2]|0,0)|0)!=0^1)continue;Eo(c[v>>2]|0,c[(c[n>>2]|0)+56>>2]|0,c[o>>2]|0,c[(c[n>>2]|0)+32>>2]|0);Wn(c[w>>2]|0,c[A>>2]|0,c[v>>2]|0,c[(c[n>>2]|0)+32>>2]|0);yo(c[x>>2]|0,c[u>>2]|0,c[(c[n>>2]|0)+32>>2]|0)|0;Eo(c[p>>2]|0,c[x>>2]|0,c[w>>2]|0,c[(c[n>>2]|0)+32>>2]|0);if(!((io(c[p>>2]|0,0)|0)!=0^1)){G=19;break}}if((G|0)==9)c[s>>2]=70;else if((G|0)==14){if(sf(1)|0)Le(53025,k);c[s>>2]=8}else if((G|0)==19?sf(1)|0:0){Pe(52966,c[o>>2]|0);Pe(52987,c[p>>2]|0)}vn(c[E>>2]|0);nn(z);qp(c[y>>2]|0);qp(c[x>>2]|0);qp(c[w>>2]|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>>2]|0);Eo(c[t>>2]|0,c[n>>2]|0,c[r>>2]|0,c[(c[m>>2]|0)+32>>2]|0);On(x,c[t>>2]|0,(c[m>>2]|0)+44|0,c[y>>2]|0);In(v,w,x,c[y>>2]|0);do if(io(c[v+8>>2]|0,0)|0){if(fn(c[u>>2]|0,0,v,c[y>>2]|0)|0){if(sf(1)|0)Le(53131,g);c[p>>2]=8;break}zo(c[u>>2]|0,c[u>>2]|0,c[(c[m>>2]|0)+32>>2]|0);if(jo(c[u>>2]|0,c[n>>2]|0)|0){if(sf(1)|0){Pe(53177,c[u>>2]|0);Pe(53184,c[n>>2]|0);Pe(53191,c[o>>2]|0)}c[p>>2]=8}}else{if(sf(1)|0)Le(53109,h);c[p>>2]=8}while(0);vn(c[y>>2]|0);nn(x);nn(w);nn(v);qp(c[u>>2]|0);qp(c[t>>2]|0);qp(c[s>>2]|0);qp(c[r>>2]|0);if((c[q>>2]|0)!=(c[l>>2]|0))qp(c[q>>2]|0);c[k>>2]=c[p>>2];A=c[k>>2]|0;i=f;return A|0}c[k>>2]=8;A=c[k>>2]|0;i=f;return A|0}c[k>>2]=8;A=c[k>>2]|0;i=f;return A|0}function lt(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0;f=i;i=i+96|0;if((i|0)>=(j|0))U();g=f;h=f+80|0;k=f+76|0;l=f+72|0;m=f+68|0;n=f+64|0;o=f+60|0;p=f+56|0;q=f+52|0;r=f+48|0;s=f+44|0;t=f+40|0;u=f+36|0;v=f+24|0;w=f+20|0;x=f+16|0;y=f+12|0;z=f+8|0;A=f+4|0;c[k>>2]=a;c[l>>2]=b;c[m>>2]=d;c[n>>2]=e;c[o>>2]=0;if(sf(1)|0)Pe(53008,c[k>>2]|0);c[z>>2]=Zn(c[(c[l>>2]|0)+32>>2]|0)|0;do if(c[k>>2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]|0)+32>>2]|0);if(!(io(c[s>>2]|0,0)|0))Bp(c[s>>2]|0,1)|0;yo(c[w>>2]|0,c[s>>2]|0,c[(c[o>>2]|0)+32>>2]|0)|0;Eo(c[u>>2]|0,c[q>>2]|0,c[w>>2]|0,c[(c[o>>2]|0)+32>>2]|0);Eo(c[x>>2]|0,c[p>>2]|0,c[w>>2]|0,c[(c[o>>2]|0)+32>>2]|0);Xn(c[v>>2]|0,c[y>>2]|0,c[x>>2]|0,c[(c[o>>2]|0)+32>>2]|0);On(A,c[u>>2]|0,(c[o>>2]|0)+20|0,c[C>>2]|0);On(B,c[v>>2]|0,(c[o>>2]|0)+44|0,c[C>>2]|0);In(z,A,B,c[C>>2]|0);do if(io(c[z+8>>2]|0,0)|0){if(fn(c[t>>2]|0,0,z,c[C>>2]|0)|0){if(sf(1)|0)Le(53131,k);c[r>>2]=8;break}zo(c[t>>2]|0,c[t>>2]|0,c[(c[o>>2]|0)+32>>2]|0);n=(jo(c[t>>2]|0,c[p>>2]|0)|0)!=0;e=(sf(1)|0)!=0;if(!n){if(!e)break;Le(53224,g);break}if(e){Pe(53177,c[t>>2]|0);Pe(53184,c[p>>2]|0);Pe(53191,c[q>>2]|0);Le(53198,h)}c[r>>2]=8}else{if(sf(1)|0)Le(53109,l);c[r>>2]=8}while(0);vn(c[C>>2]|0);nn(B);nn(A);nn(z);qp(c[y>>2]|0);qp(c[x>>2]|0);qp(c[w>>2]|0);qp(c[v>>2]|0);qp(c[u>>2]|0);qp(c[t>>2]|0);qp(c[s>>2]|0);c[m>>2]=c[r>>2];D=c[m>>2]|0;i=f;return D|0}c[m>>2]=8;D=c[m>>2]|0;i=f;return D|0}c[m>>2]=8;D=c[m>>2]|0;i=f;return D|0}function nt(){return Ct()|0}function ot(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b;c[d>>2]=a;a=Pt(c[d>>2]|0)|0;i=b;return a|0}function pt(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b;c[d>>2]=a;a=Tt(c[d>>2]|0)|0;i=b;return a|0}function qt(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b;c[d>>2]=a;a=St(c[d>>2]|0)|0;i=b;return a|0}function rt(){return Ut()|0}function st(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b;c[d>>2]=a;Et(c[d>>2]|0);i=b;return}function tt(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b;c[d>>2]=a;a=xt(c[d>>2]|0)|0;i=b;return a|0}function ut(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b;c[d>>2]=a;a=zt(c[d>>2]|0)|0;i=b;return a|0}function vt(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b;c[d>>2]=a;a=At(c[d>>2]|0)|0;i=b;return a|0}function wt(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b;c[d>>2]=a;a=Bt(c[d>>2]|0)|0;i=b;return a|0}function xt(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b+8|0;e=b+4|0;f=b;c[d>>2]=a;c[e>>2]=c[d>>2];if(c[c[e>>2]>>2]|0)c[e>>2]=yt(c[d>>2]|0)|0;else c[c[e>>2]>>2]=1;c[f>>2]=ta((c[e>>2]|0)+4|0,0)|0;if(!(c[f>>2]|0)){g=c[f>>2]|0;i=b;return g|0}c[f>>2]=pt(c[f>>2]|0)|0;g=c[f>>2]|0;i=b;return g|0}function yt(a){a=a|0;var b=0,d=0,e=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b+4|0;e=b;c[d>>2]=a;c[e>>2]=c[d>>2];if((c[c[e>>2]>>2]|0)!=1)Ba(53246,53266,114,53279);else{i=b;return c[e>>2]|0}return 0}function zt(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b+8|0;e=b+4|0;f=b;c[d>>2]=a;c[e>>2]=yt(c[d>>2]|0)|0;c[f>>2]=Hw((c[e>>2]|0)+4|0)|0;if(!(c[f>>2]|0)){g=c[f>>2]|0;i=b;return g|0}c[f>>2]=pt(c[f>>2]|0)|0;g=c[f>>2]|0;i=b;return g|0}function At(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b+8|0;e=b+4|0;f=b;c[d>>2]=a;c[e>>2]=yt(c[d>>2]|0)|0;c[f>>2]=Nw((c[e>>2]|0)+4|0)|0;if(!(c[f>>2]|0)){g=c[f>>2]|0;i=b;return g|0}c[f>>2]=pt(c[f>>2]|0)|0;g=c[f>>2]|0;i=b;return g|0}function Bt(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0;b=i;i=i+64|0;if((i|0)>=(j|0))U();d=b+52|0;e=b+48|0;f=b+44|0;g=b;c[d>>2]=a;c[e>>2]=yt(c[d>>2]|0)|0;c[f>>2]=Va((c[e>>2]|0)+4|0)|0;if(c[f>>2]|0){c[f>>2]=pt(c[f>>2]|0)|0;h=c[f>>2]|0;i=b;return h|0}else{e=g;a=e+44|0;do{c[e>>2]=0;e=e+4|0}while((e|0)<(a|0));c[g>>2]=1;e=c[d>>2]|0;d=g;a=e+44|0;do{c[e>>2]=c[d>>2];e=e+4|0;d=d+4|0}while((e|0)<(a|0));h=c[f>>2]|0;i=b;return h|0}return 0}function Ct(){Dt();return 0}function Dt(){Ft()|0;return}function Et(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b;c[d>>2]=a;a=c[d>>2]|0;c[(fu()|0)>>2]=a;i=b;return}function Ft(){if(c[17725]|0)return 0;c[17725]=1;lb(3)|0;return 0}function Gt(){Ht(0)|0;c[17727]=0;c[17728]=0;return}function Ht(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,k=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b+8|0;e=b+4|0;f=b;c[d>>2]=a;if(c[d>>2]|0){It(c[d>>2]|0);c[e>>2]=Jt(c[d>>2]|0)|0;Mt(c[d>>2]|0);g=c[e>>2]|0;h=(g|0)!=0;k=h?-1:0;i=b;return k|0}c[e>>2]=0;Nt();c[f>>2]=c[17726];while(1){if(!(c[f>>2]|0))break;if(c[(c[f>>2]|0)+4>>2]|0){It(c[(c[f>>2]|0)+4>>2]|0);d=Jt(c[(c[f>>2]|0)+4>>2]|0)|0;c[e>>2]=c[e>>2]|d;Mt(c[(c[f>>2]|0)+4>>2]|0)}c[f>>2]=c[c[f>>2]>>2]}Ot();g=c[e>>2]|0;h=(g|0)!=0;k=h?-1:0;i=b;return k|0}function It(a){a=a|0;var b=0,e=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();e=b;c[e>>2]=a;if((d[(c[(c[e>>2]|0)+36>>2]|0)+1140>>0]|0)>>>5&1|0){i=b;return}zt((c[(c[e>>2]|0)+36>>2]|0)+1040|0)|0;i=b;return}function Jt(a){a=a|0;var b=0,d=0,e=0,f=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b+4|0;e=b;c[d>>2]=a;a=c[d>>2]|0;if((c[c[d>>2]>>2]|0)>>>16&1|0){c[e>>2]=Kt(a)|0;f=c[e>>2]|0;i=b;return f|0}else{Lt(a);c[e>>2]=0;f=c[e>>2]|0;i=b;return f|0}return 0}function Kt(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,k=0,l=0,m=0;d=i;i=i+32|0;if((i|0)>=(j|0))U();e=d+20|0;f=d+16|0;g=d+12|0;h=d+8|0;k=d+4|0;l=d;c[e>>2]=b;c[f>>2]=c[(c[(c[e>>2]|0)+36>>2]|0)+1108>>2];if(!((c[c[e>>2]>>2]|0)>>>16&1))Ba(53295,53317,1654,53327);do if(c[(c[e>>2]|0)+16>>2]|0){if(!(c[f>>2]|0)){c[g>>2]=95;break}c[k>>2]=0;c[g>>2]=0;do{if(((c[(c[e>>2]|0)+16>>2]|0)-(c[k>>2]|0)|0)<=0)break;if(!((c[g>>2]|0)!=0^1))break;c[l>>2]=sb[c[f>>2]&63](c[(c[(c[e>>2]|0)+36>>2]|0)+1084>>2]|0,(c[(c[e>>2]|0)+4>>2]|0)+(c[k>>2]|0)|0,(c[(c[e>>2]|0)+16>>2]|0)-(c[k>>2]|0)|0)|0;if((c[l>>2]|0)==-1){c[h>>2]=0;c[g>>2]=-1}else c[h>>2]=c[l>>2];c[k>>2]=(c[k>>2]|0)+(c[h>>2]|0)}while(!(c[g>>2]|0));b=(c[e>>2]|0)+20|0;c[b>>2]=(c[b>>2]|0)+(c[k>>2]|0);if((c[(c[e>>2]|0)+16>>2]|0)==(c[k>>2]|0)){b=(c[(c[e>>2]|0)+36>>2]|0)+1100|0;c[b>>2]=(c[b>>2]|0)+(c[(c[e>>2]|0)+16>>2]|0);c[(c[e>>2]|0)+16>>2]=0;c[(c[e>>2]|0)+20>>2]=0;sb[c[f>>2]&63](c[(c[(c[e>>2]|0)+36>>2]|0)+1084>>2]|0,0,0)|0}}else c[g>>2]=0;while(0);if(!(c[g>>2]|0)){m=c[g>>2]|0;i=d;return m|0}f=(c[(c[e>>2]|0)+36>>2]|0)+1136|0;a[f>>0]=a[f>>0]&-2|1;m=c[g>>2]|0;i=d;return m|0}function Lt(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b;c[d>>2]=a;if((c[c[d>>2]>>2]|0)>>>16&1|0)Ba(53336,53317,1722,53359);else{c[(c[d>>2]|0)+12>>2]=0;c[(c[d>>2]|0)+16>>2]=0;c[(c[d>>2]|0)+32>>2]=0;i=b;return}}function Mt(a){a=a|0;var b=0,e=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();e=b;c[e>>2]=a;if((d[(c[(c[e>>2]|0)+36>>2]|0)+1140>>0]|0)>>>5&1|0){i=b;return}At((c[(c[e>>2]|0)+36>>2]|0)+1040|0)|0;i=b;return}function Nt(){zt(13096)|0;return}function Ot(){At(13096)|0;return}function Pt(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b+12|0;e=b+8|0;f=b+4|0;g=b;c[e>>2]=a;c[f>>2]=Qt(c[e>>2]|0)|0;do if(c[f>>2]&32768|0){c[g>>2]=qt(c[f>>2]|0)|0;if(!(c[g>>2]|0)){c[f>>2]=16382;break}c[d>>2]=xu(c[g>>2]|0)|0;h=c[d>>2]|0;i=b;return h|0}while(0);c[d>>2]=53368+(c[13140+((Rt(c[f>>2]|0)|0)<<2)>>2]|0);h=c[d>>2]|0;i=b;return h|0}function Qt(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b;c[d>>2]=a;i=b;return c[d>>2]&65535|0}function Rt(a){a=a|0;var b=0,d=0,e=0,f=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b;c[d>>2]=a;a=c[d>>2]|0;if((c[d>>2]|0)>=0&(c[d>>2]|0)<=213){e=a-0|0;i=b;return e|0}f=c[d>>2]|0;if((a|0)>=222&(c[d>>2]|0)<=254){e=f-8|0;i=b;return e|0}a=c[d>>2]|0;if((f|0)>=257&(c[d>>2]|0)<=271){e=a-10|0;i=b;return e|0}f=c[d>>2]|0;if((a|0)>=273&(c[d>>2]|0)<=281){e=f-11|0;i=b;return e|0}a=c[d>>2]|0;if((f|0)>=721&(c[d>>2]|0)<=729){e=a-450|0;i=b;return e|0}f=c[d>>2]|0;if((a|0)>=750&(c[d>>2]|0)<=752){e=f-470|0;i=b;return e|0}a=c[d>>2]|0;if((f|0)>=754&(c[d>>2]|0)<=782){e=a-471|0;i=b;return e|0}f=c[d>>2]|0;if((a|0)>=784&(c[d>>2]|0)<=789){e=f-472|0;i=b;return e|0}a=c[d>>2]|0;if((f|0)>=800&(c[d>>2]|0)<=804){e=a-482|0;i=b;return e|0}f=c[d>>2]|0;if((a|0)>=815&(c[d>>2]|0)<=822){e=f-492|0;i=b;return e|0}a=c[d>>2]|0;if((f|0)>=832&(c[d>>2]|0)<=839){e=a-501|0;i=b;return e|0}f=c[d>>2]|0;if((a|0)>=844&(c[d>>2]|0)<=844){e=f-505|0;i=b;return e|0}a=c[d>>2]|0;if((f|0)>=848&(c[d>>2]|0)<=848){e=a-508|0;i=b;return e|0}f=c[d>>2]|0;if((a|0)>=881&(c[d>>2]|0)<=891){e=f-540|0;i=b;return e|0}a=c[d>>2]|0;if((f|0)>=1024&(c[d>>2]|0)<=1039){e=a-672|0;i=b;return e|0}else{e=(a|0)>=16381&(c[d>>2]|0)<=16383?(c[d>>2]|0)-16013|0:371;i=b;return e|0}return 0}function St(a){a=a|0;var b=0,d=0,e=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b+4|0;e=b;c[e>>2]=a;do if(c[e>>2]&32768|0){c[e>>2]=c[e>>2]&-32769;if((c[e>>2]|0)>>>0<141){c[d>>2]=c[14628+(c[e>>2]<<2)>>2];break}else{c[d>>2]=0;break}}else c[d>>2]=0;while(0);i=b;return c[d>>2]|0}function Tt(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,k=0,l=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b+8|0;e=b+4|0;f=b;c[e>>2]=a;if(!(c[e>>2]|0)){c[d>>2]=0;g=c[d>>2]|0;i=b;return g|0}a=c[e>>2]|0;do if(!((c[e>>2]|0)>=1&(c[e>>2]|0)<=11)){h=c[e>>2]|0;if((a|0)>=11&(c[e>>2]|0)<=35){k=h-0|0;break}l=c[e>>2]|0;if((h|0)>=35&(c[e>>2]|0)<=40){k=l+1|0;break}h=c[e>>2]|0;if((l|0)>=42&(c[e>>2]|0)<=57){k=h-0|0;break}l=c[e>>2]|0;if((h|0)>=59&(c[e>>2]|0)<=95){k=l-1|0;break}else{k=(l|0)>=95&(c[e>>2]|0)<=125?(c[e>>2]|0)-0|0:-1;break}}else k=a-1|0;while(0);c[f>>2]=k;if((c[f>>2]|0)<0){c[d>>2]=16382;g=c[d>>2]|0;i=b;return g|0}else{c[d>>2]=32768|c[15192+(c[f>>2]<<2)>>2];g=c[d>>2]|0;i=b;return g|0}return 0}function Ut(){var a=0,b=0,d=0,e=0,f=0,g=0,h=0,k=0,l=0;a=i;i=i+16|0;if((i|0)>=(j|0))U();b=a+8|0;d=a+4|0;e=a;c[d>>2]=c[(fu()|0)>>2];if(!(c[d>>2]|0)){c[b>>2]=16381;f=c[b>>2]|0;i=a;return f|0}g=c[d>>2]|0;do if(!((c[d>>2]|0)>=1&(c[d>>2]|0)<=11)){h=c[d>>2]|0;if((g|0)>=11&(c[d>>2]|0)<=35){k=h-0|0;break}l=c[d>>2]|0;if((h|0)>=35&(c[d>>2]|0)<=40){k=l+1|0;break}h=c[d>>2]|0;if((l|0)>=42&(c[d>>2]|0)<=57){k=h-0|0;break}l=c[d>>2]|0;if((h|0)>=59&(c[d>>2]|0)<=95){k=l-1|0;break}else{k=(l|0)>=95&(c[d>>2]|0)<=125?(c[d>>2]|0)-0|0:-1;break}}else k=g-1|0;while(0);c[e>>2]=k;if((c[e>>2]|0)<0){c[b>>2]=16382;f=c[b>>2]|0;i=a;return f|0}else{c[b>>2]=32768|c[15192+(c[e>>2]<<2)>>2];f=c[b>>2]|0;i=a;return f|0}return 0}function Vt(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,k=0;e=i;i=i+16|0;if((i|0)>=(j|0))U();f=e+4|0;g=e;c[f>>2]=b;c[g>>2]=d;d=c[g>>2]|0;b=qd(c[d>>2]|0,c[d+4>>2]|0)|0;d=C;h=c[f>>2]|0;k=h;a[k>>0]=b;a[k+1>>0]=b>>8;a[k+2>>0]=b>>16;a[k+3>>0]=b>>24;b=h+4|0;a[b>>0]=d;a[b+1>>0]=d>>8;a[b+2>>0]=d>>16;a[b+3>>0]=d>>24;d=sv(c[(c[g>>2]|0)+8>>2]|0)|0;b=(c[f>>2]|0)+8|0;a[b>>0]=d;a[b+1>>0]=d>>8;a[b+2>>0]=d>>16;a[b+3>>0]=d>>24;d=(c[f>>2]|0)+12|0;f=(c[g>>2]|0)+12|0;g=d+12|0;do{a[d>>0]=a[f>>0]|0;d=d+1|0;f=f+1|0}while((d|0)<(g|0));i=e;return}function Wt(b,e){b=b|0;e=e|0;var f=0,g=0,h=0,k=0;f=i;i=i+16|0;if((i|0)>=(j|0))U();g=f+4|0;h=f;c[g>>2]=b;c[h>>2]=e;e=c[h>>2]|0;b=e;k=e+4|0;e=rd(d[b>>0]|d[b+1>>0]<<8|d[b+2>>0]<<16|d[b+3>>0]<<24,d[k>>0]|d[k+1>>0]<<8|d[k+2>>0]<<16|d[k+3>>0]<<24)|0;k=c[g>>2]|0;c[k>>2]=e;c[k+4>>2]=C;k=(c[h>>2]|0)+8|0;e=wv(d[k>>0]|d[k+1>>0]<<8|d[k+2>>0]<<16|d[k+3>>0]<<24)|0;c[(c[g>>2]|0)+8>>2]=e;e=(c[g>>2]|0)+12|0;g=(c[h>>2]|0)+12|0;h=e+12|0;do{a[e>>0]=a[g>>0]|0;e=e+1|0;g=g+1|0}while((e|0)<(h|0));i=f;return}function Xt(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,k=0;d=i;i=i+16|0;if((i|0)>=(j|0))U();e=d+12|0;f=d+8|0;g=d+4|0;h=d;c[f>>2]=a;c[g>>2]=b;c[h>>2]=Tu(c[f>>2]|0)|0;if((c[h>>2]|0)>>>0>=12){c[e>>2]=-1;k=c[e>>2]|0;i=d;return k|0}else{b=c[g>>2]|0;c[b>>2]=0;c[b+4>>2]=0;c[b+8>>2]=0;c[b+12>>2]=0;c[b+16>>2]=0;c[b+20>>2]=0;Ow((c[g>>2]|0)+12|0,c[f>>2]|0,c[h>>2]|0)|0;c[e>>2]=1;k=c[e>>2]|0;i=d;return k|0}return 0}function Yt(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;d=i;i=i+16|0;if((i|0)>=(j|0))U();e=d+8|0;f=d+4|0;g=d;c[f>>2]=a;c[g>>2]=b;do if(0!=(Zt(c[f>>2]|0)|0)?0!=(Zt(c[g>>2]|0)|0):0)if(!(cv((c[f>>2]|0)+12|0,(c[g>>2]|0)+12|0)|0)){c[e>>2]=1;break}else{c[e>>2]=0;break}else h=3;while(0);if((h|0)==3)c[e>>2]=-1;i=d;return c[e>>2]|0}function Zt(b){b=b|0;var d=0,e=0;d=i;i=i+16|0;if((i|0)>=(j|0))U();e=d;c[e>>2]=b;i=d;return 0!=(a[(c[e>>2]|0)+12>>0]|0)|0}function _t(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;d=i;i=i+96|0;if((i|0)>=(j|0))U();e=d+64|0;f=d+56|0;g=d+48|0;h=d+92|0;k=d+88|0;l=d+84|0;m=d+24|0;n=d;o=d+80|0;p=d+76|0;q=d+72|0;c[k>>2]=a;c[l>>2]=b;if(1!=(Yt(c[k>>2]|0,c[l>>2]|0)|0)){c[o>>2]=349;if((c[3924]|0)==-1)c[3924]=Yb(1,0,61383,61392,c[o>>2]|0)|0;if(($b()|0)>0){ac(-1,0);Xb()}if(!(c[3924]|0))Xb();c[g>>2]=61383;c[g+4>>2]=349;bc(1,61409,g);Xb()}g=c[k>>2]|0;c[m>>2]=c[g>>2];c[m+4>>2]=c[g+4>>2];c[m+8>>2]=c[g+8>>2];c[m+12>>2]=c[g+12>>2];c[m+16>>2]=c[g+16>>2];c[m+20>>2]=c[g+20>>2];g=c[l>>2]|0;c[n>>2]=c[g>>2];c[n+4>>2]=c[g+4>>2];c[n+8>>2]=c[g+8>>2];c[n+12>>2]=c[g+12>>2];c[n+16>>2]=c[g+16>>2];c[n+20>>2]=c[g+20>>2];if(-1==($t(m)|0)){c[p>>2]=353;if((c[3925]|0)==-1)c[3925]=Yb(1,0,61383,61392,c[p>>2]|0)|0;if(($b()|0)>0){ac(-1,0);Xb()}if(!(c[3925]|0))Xb();c[f>>2]=61383;c[f+4>>2]=353;bc(1,61409,f);Xb()}if(-1==($t(n)|0)){c[q>>2]=355;if((c[3926]|0)==-1)c[3926]=Yb(1,0,61383,61392,c[q>>2]|0)|0;if(($b()|0)>0){ac(-1,0);Xb()}if(!(c[3926]|0))Xb();c[e>>2]=61383;c[e+4>>2]=355;bc(1,61409,e);Xb()}e=m;q=n;if(!((c[e>>2]|0)==(c[q>>2]|0)?(c[e+4>>2]|0)==(c[q+4>>2]|0):0)){q=m;e=c[q+4>>2]|0;f=n;p=c[f+4>>2]|0;if(e>>>0<p>>>0|((e|0)==(p|0)?(c[q>>2]|0)>>>0<(c[f>>2]|0)>>>0:0)){c[h>>2]=-1;r=c[h>>2]|0;i=d;return r|0}else{c[h>>2]=1;r=c[h>>2]|0;i=d;return r|0}}if((c[m+8>>2]|0)>>>0<(c[n+8>>2]|0)>>>0){c[h>>2]=-1;r=c[h>>2]|0;i=d;return r|0}if((c[m+8>>2]|0)>>>0>(c[n+8>>2]|0)>>>0){c[h>>2]=1;r=c[h>>2]|0;i=d;return r|0}else{c[h>>2]=0;r=c[h>>2]|0;i=d;return r|0}return 0}function $t(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,k=0,l=0,m=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b+8|0;e=b+4|0;f=b;c[e>>2]=a;if(1!=(Zt(c[e>>2]|0)|0)){c[d>>2]=-1;g=c[d>>2]|0;i=b;return g|0}c[f>>2]=0;while(1){a=c[e>>2]|0;if((c[a>>2]|0)!=-1?1:(c[a+4>>2]|0)!=-1)h=(c[(c[e>>2]|0)+8>>2]|0)>>>0>=1e6;else h=0;a=(c[e>>2]|0)+8|0;k=c[a>>2]|0;if(!h)break;c[a>>2]=k-1e6;a=c[e>>2]|0;l=a;m=Gw(c[l>>2]|0,c[l+4>>2]|0,1,0)|0;l=a;c[l>>2]=m;c[l+4>>2]=C;c[f>>2]=1}if(k>>>0>=1e6){au(c[e>>2]|0);c[d>>2]=-1;g=c[d>>2]|0;i=b;return g|0}else{c[d>>2]=c[f>>2];g=c[d>>2]|0;i=b;return g|0}return 0}function au(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b;c[d>>2]=a;a=c[d>>2]|0;c[a>>2]=0;c[a+4>>2]=0;c[a+8>>2]=0;c[a+12>>2]=0;c[a+16>>2]=0;c[a+20>>2]=0;i=b;return}function bu(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;e=i;i=i+112|0;if((i|0)>=(j|0))U();f=e+64|0;g=e+56|0;h=e+48|0;k=e+96|0;l=e+92|0;m=e+88|0;n=e+84|0;o=e+24|0;p=e;q=e+80|0;r=e+76|0;s=e+72|0;c[l>>2]=a;c[m>>2]=b;c[n>>2]=d;if(1!=(Yt(c[m>>2]|0,c[n>>2]|0)|0)){au(c[l>>2]|0);c[k>>2]=-1;t=c[k>>2]|0;i=e;return t|0}d=c[m>>2]|0;c[o>>2]=c[d>>2];c[o+4>>2]=c[d+4>>2];c[o+8>>2]=c[d+8>>2];c[o+12>>2]=c[d+12>>2];c[o+16>>2]=c[d+16>>2];c[o+20>>2]=c[d+20>>2];d=c[n>>2]|0;c[p>>2]=c[d>>2];c[p+4>>2]=c[d+4>>2];c[p+8>>2]=c[d+8>>2];c[p+12>>2]=c[d+12>>2];c[p+16>>2]=c[d+16>>2];c[p+20>>2]=c[d+20>>2];if(-1!=($t(o)|0)?-1!=($t(p)|0):0){do if((c[o+8>>2]|0)>>>0<(c[p+8>>2]|0)>>>0){d=o;if(!(0==(c[d>>2]|0)?0==(c[d+4>>2]|0):0)){d=o+8|0;c[d>>2]=(c[d>>2]|0)+1e6;d=o;n=Gw(c[d>>2]|0,c[d+4>>2]|0,-1,-1)|0;d=o;c[d>>2]=n;c[d+4>>2]=C;break}au(c[l>>2]|0);c[k>>2]=-1;t=c[k>>2]|0;i=e;return t|0}while(0);d=o;n=c[d+4>>2]|0;m=p;b=c[m+4>>2]|0;if(n>>>0<b>>>0|((n|0)==(b|0)?(c[d>>2]|0)>>>0<(c[m>>2]|0)>>>0:0)){au(c[l>>2]|0);c[k>>2]=-1;t=c[k>>2]|0;i=e;return t|0}if(1!=(Xt(o+12|0,c[l>>2]|0)|0)){c[q>>2]=421;if((c[3927]|0)==-1)c[3927]=Yb(1,0,61383,61437,c[q>>2]|0)|0;if(($b()|0)>0){ac(-1,0);Xb()}if(!(c[3927]|0))Xb();c[h>>2]=61383;c[h+4>>2]=421;bc(1,61409,h);Xb()}if((c[o+8>>2]|0)>>>0<(c[p+8>>2]|0)>>>0){c[r>>2]=422;if((c[3928]|0)==-1)c[3928]=Yb(1,0,61383,61437,c[r>>2]|0)|0;if(($b()|0)>0){ac(-1,0);Xb()}if(!(c[3928]|0))Xb();c[g>>2]=61383;c[g+4>>2]=422;bc(1,61409,g);Xb()}c[(c[l>>2]|0)+8>>2]=(c[o+8>>2]|0)-(c[p+8>>2]|0);g=o;r=c[g+4>>2]|0;h=p;q=c[h+4>>2]|0;if(r>>>0>q>>>0|((r|0)==(q|0)?(c[g>>2]|0)>>>0>=(c[h>>2]|0)>>>0:0)){h=o;o=p;p=Fw(c[h>>2]|0,c[h+4>>2]|0,c[o>>2]|0,c[o+4>>2]|0)|0;o=c[l>>2]|0;c[o>>2]=p;c[o+4>>2]=C;if(0==(c[(c[l>>2]|0)+8>>2]|0)?(o=c[l>>2]|0,0==(c[o>>2]|0)?0==(c[o+4>>2]|0):0):0){c[k>>2]=0;t=c[k>>2]|0;i=e;return t|0}c[k>>2]=1;t=c[k>>2]|0;i=e;return t|0}c[s>>2]=424;if((c[3929]|0)==-1)c[3929]=Yb(1,0,61383,61437,c[s>>2]|0)|0;if(($b()|0)>0){ac(-1,0);Xb()}if(!(c[3929]|0))Xb();c[f>>2]=61383;c[f+4>>2]=424;bc(1,61409,f);Xb()}au(c[l>>2]|0);c[k>>2]=-1;t=c[k>>2]|0;i=e;return t|0}function cu(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;e=i;i=i+112|0;if((i|0)>=(j|0))U();f=e+72|0;g=e+96|0;h=e+92|0;k=e+88|0;l=e+84|0;m=e+48|0;n=e+24|0;o=e;p=e+80|0;c[h>>2]=a;c[k>>2]=b;c[l>>2]=d;if(1!=(Yt(c[k>>2]|0,c[l>>2]|0)|0)){au(c[h>>2]|0);c[g>>2]=-1;q=c[g>>2]|0;i=e;return q|0}d=c[k>>2]|0;c[m>>2]=c[d>>2];c[m+4>>2]=c[d+4>>2];c[m+8>>2]=c[d+8>>2];c[m+12>>2]=c[d+12>>2];c[m+16>>2]=c[d+16>>2];c[m+20>>2]=c[d+20>>2];d=c[l>>2]|0;c[n>>2]=c[d>>2];c[n+4>>2]=c[d+4>>2];c[n+8>>2]=c[d+8>>2];c[n+12>>2]=c[d+12>>2];c[n+16>>2]=c[d+16>>2];c[n+20>>2]=c[d+20>>2];if(-1!=($t(m)|0)?-1!=($t(n)|0):0){if(1==(Xt((c[k>>2]|0)+12|0,o)|0)){k=m;d=n;l=Gw(c[k>>2]|0,c[k+4>>2]|0,c[d>>2]|0,c[d+4>>2]|0)|0;d=o;c[d>>2]=l;c[d+4>>2]=C;d=o;l=c[d+4>>2]|0;k=m;b=c[k+4>>2]|0;if(l>>>0<b>>>0|((l|0)==(b|0)?(c[d>>2]|0)>>>0<(c[k>>2]|0)>>>0:0)){au(c[h>>2]|0);c[g>>2]=-1;q=c[g>>2]|0;i=e;return q|0}c[o+8>>2]=(c[m+8>>2]|0)+(c[n+8>>2]|0);n=-1==($t(o)|0);m=c[h>>2]|0;if(n){au(m);c[g>>2]=-1;q=c[g>>2]|0;i=e;return q|0}else{c[m>>2]=c[o>>2];c[m+4>>2]=c[o+4>>2];c[m+8>>2]=c[o+8>>2];c[m+12>>2]=c[o+12>>2];c[m+16>>2]=c[o+16>>2];c[m+20>>2]=c[o+20>>2];c[g>>2]=1;q=c[g>>2]|0;i=e;return q|0}}c[p>>2]=468;if((c[3930]|0)==-1)c[3930]=Yb(1,0,61383,61459,c[p>>2]|0)|0;if(($b()|0)>0){ac(-1,0);Xb()}if(!(c[3930]|0))Xb();c[f>>2]=61383;c[f+4>>2]=468;bc(1,61409,f);Xb()}au(c[h>>2]|0);c[g>>2]=-1;q=c[g>>2]|0;i=e;return q|0}function du(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b;c[d>>2]=c[a+60>>2];a=eu(wa(6,d|0)|0)|0;i=b;return a|0}function eu(a){a=a|0;var b=0;if(a>>>0>4294963200){c[(fu()|0)>>2]=0-a;b=-1}else b=a;return b|0}function fu(){var a=0;if(!(c[17729]|0))a=70960;else a=c[(Yw()|0)+64>>2]|0;return a|0}function gu(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0;f=i;i=i+80|0;if((i|0)>=(j|0))U();g=f;c[b+36>>2]=25;if((c[b>>2]&64|0)==0?(c[g>>2]=c[b+60>>2],c[g+4>>2]=21505,c[g+8>>2]=f+12,_a(54,g|0)|0):0)a[b+75>>0]=-1;g=hu(b,d,e)|0;i=f;return g|0}function hu(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0;e=i;i=i+48|0;if((i|0)>=(j|0))U();f=e+16|0;g=e;h=e+32|0;k=a+28|0;l=c[k>>2]|0;c[h>>2]=l;m=a+20|0;n=(c[m>>2]|0)-l|0;c[h+4>>2]=n;c[h+8>>2]=b;c[h+12>>2]=d;b=a+60|0;l=a+44|0;o=h;h=2;p=n+d|0;while(1){if(!(c[17729]|0)){c[f>>2]=c[b>>2];c[f+4>>2]=o;c[f+8>>2]=h;q=eu(qb(146,f|0)|0)|0}else{ya(6,a|0);c[g>>2]=c[b>>2];c[g+4>>2]=o;c[g+8>>2]=h;n=eu(qb(146,g|0)|0)|0;ra(0);q=n}if((p|0)==(q|0)){r=6;break}if((q|0)<0){s=o;t=h;r=8;break}n=p-q|0;u=c[o+4>>2]|0;if(q>>>0<=u>>>0)if((h|0)==2){c[k>>2]=(c[k>>2]|0)+q;v=u;w=q;x=o;y=2}else{v=u;w=q;x=o;y=h}else{z=c[l>>2]|0;c[k>>2]=z;c[m>>2]=z;v=c[o+12>>2]|0;w=q-u|0;x=o+8|0;y=h+-1|0}c[x>>2]=(c[x>>2]|0)+w;c[x+4>>2]=v-w;o=x;h=y;p=n}if((r|0)==6){p=c[l>>2]|0;c[a+16>>2]=p+(c[a+48>>2]|0);l=p;c[k>>2]=l;c[m>>2]=l;A=d}else if((r|0)==8){c[a+16>>2]=0;c[k>>2]=0;c[m>>2]=0;c[a>>2]=c[a>>2]|32;if((t|0)==2)A=0;else A=d-(c[s+4>>2]|0)|0}i=e;return A|0}function iu(a){a=a|0;if(!(c[a+68>>2]|0))ju(a);return}function ju(a){a=a|0;return}function ku(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=i;i=i+32|0;if((i|0)>=(j|0))U();f=e;g=e+20|0;c[f>>2]=c[a+60>>2];c[f+4>>2]=0;c[f+8>>2]=b;c[f+12>>2]=g;c[f+16>>2]=d;if((eu(mb(140,f|0)|0)|0)<0){c[g>>2]=-1;h=-1}else h=c[g>>2]|0;i=e;return h|0}function lu(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;f=i;i=i+48|0;if((i|0)>=(j|0))U();g=f+16|0;h=f;k=f+32|0;c[k>>2]=d;l=k+4|0;m=b+48|0;n=c[m>>2]|0;c[l>>2]=e-((n|0)!=0&1);o=b+44|0;c[k+8>>2]=c[o>>2];c[k+12>>2]=n;if(!(c[17729]|0)){c[g>>2]=c[b+60>>2];c[g+4>>2]=k;c[g+8>>2]=2;p=eu(pb(145,g|0)|0)|0}else{ya(7,b|0);c[h>>2]=c[b+60>>2];c[h+4>>2]=k;c[h+8>>2]=2;k=eu(pb(145,h|0)|0)|0;ra(0);p=k}if((p|0)>=1){k=c[l>>2]|0;if(p>>>0>k>>>0){l=c[o>>2]|0;o=b+4|0;c[o>>2]=l;h=l;c[b+8>>2]=h+(p-k);if(!(c[m>>2]|0))q=e;else{c[o>>2]=h+1;a[d+(e+-1)>>0]=a[h>>0]|0;q=e}}else q=p}else{c[b>>2]=c[b>>2]|p&48^16;c[b+8>>2]=0;c[b+4>>2]=0;q=p}i=f;return q|0}function mu(a){a=a|0;if(!(c[a+68>>2]|0))ju(a);return}function nu(a){a=a|0;return ou(a)|0}function ou(a){a=a|0;return ((a|0)==32|(a|0)==9)&1|0}function pu(b,c){b=b|0;c=c|0;var d=0,e=0,f=0,g=0;d=a[b>>0]|0;e=a[c>>0]|0;if(d<<24>>24==0?1:d<<24>>24!=e<<24>>24){f=d;g=e}else{e=b;b=c;do{e=e+1|0;b=b+1|0;c=a[e>>0]|0;d=a[b>>0]|0}while(!(c<<24>>24==0?1:c<<24>>24!=d<<24>>24));f=c;g=d}return (f&255)-(g&255)|0}function qu(a){a=a|0;var b=0;b=(ru(a)|0)==0;return (b?a:a|32)|0}function ru(a){a=a|0;return (a+-65|0)>>>0<26|0}function su(a){a=a|0;return tu(a,0)|0}function tu(c,f){c=c|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;g=(f<<1)+-1|0;h=f+-1|0;a:do if(!((c+-43008|0)>>>0<22272|((c+-11776|0)>>>0<30784|((c+-1536|0)>>>0<2560|(uu(c)|0)==0)))){i=(f|0)!=0;if(i&(c+-4256|0)>>>0<46){if((c|0)>4293)switch(c|0){case 4295:case 4301:break;default:{j=c;break a}}j=c+7264|0;break}if((c+-11520|0)>>>0<38&(i^1)){if((c|0)>11557)switch(c|0){case 11559:case 11565:break;default:{j=c;break a}}j=c+-7264|0;break}else k=0;do{i=a[18842+(k<<2)+2>>0]|0;l=i<<24>>24;m=c-(e[18842+(k<<2)>>1]|0)|0;if((m-(l&h)|0)>>>0<(d[18842+(k<<2)+3>>0]|0)>>>0){n=i;o=l;p=m;q=13;break}k=k+1|0}while((k|0)!=61);if((q|0)==13)if(n<<24>>24==1){j=f+c-(p&1)|0;break}else{j=(R(o,g)|0)+c|0;break}m=1-f|0;l=b[18350+(m<<1)>>1]|0;b:do if(l<<16>>16){i=l;r=0;while(1){if((i&65535|0)==(c|0)){s=r;break}r=r+1|0;i=b[18350+(r<<2)+(m<<1)>>1]|0;if(!(i<<16>>16))break b}j=e[18350+(s<<2)+(f<<1)>>1]|0;break a}while(0);if((c+-66600+(f*40|0)|0)>>>0<40)j=c+-40+(f*80|0)|0;else j=c}else j=c;while(0);return j|0}function uu(a){a=a|0;var b=0;if(a>>>0<131072)b=(d[61476+((d[61476+(a>>>8)>>0]|0)<<5|a>>>3&31)>>0]|0)>>>(a&7)&1;else b=a>>>0<196606&1;return b|0}function vu(a){a=a|0;return tu(a,1)|0}function wu(a){a=a|0;return (a+-97|0)>>>0<26|0}function xu(b){b=b|0;var c=0,e=0,f=0,g=0,h=0,i=0,j=0;c=0;while(1){if((d[64452+c>>0]|0)==(b|0)){e=c;f=2;break}c=c+1|0;if((c|0)==87){g=87;h=64540;f=5;break}}if((f|0)==2)if(!e)i=64540;else{g=e;h=64540;f=5}if((f|0)==5)while(1){f=0;e=h;while(1){c=e+1|0;if(!(a[e>>0]|0)){j=c;break}else e=c}g=g+-1|0;if(!g){i=j;break}else{h=j;f=5}}return i|0}function yu(a){a=a|0;var b=0;if(!a)b=0;else b=(zu(16160,a)|0)!=0;return b&1|0}function zu(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;if(!b)d=a+((Au(a)|0)<<2)|0;else{e=a;while(1){a=c[e>>2]|0;if((a|0)==0|(a|0)==(b|0)){f=e;g=a;break}else e=e+4|0}d=g|0?f:0}return d|0}function Au(a){a=a|0;var b=0,d=0;b=a;while(1)if(!(c[b>>2]|0)){d=b;break}else b=b+4|0;return d-a>>2|0}function Bu(a){a=a|0;var b=0;if((a+-48|0)>>>0<10)b=1;else b=((a|32)+-97|0)>>>0<6;return b&1|0}function Cu(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0;f=i;i=i+16|0;if((i|0)>=(j|0))U();g=f;c[g>>2]=e;e=Du(a,b,d,g)|0;i=f;return e|0}function Du(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;g=i;i=i+128|0;if((i|0)>=(j|0))U();h=g+112|0;k=g;l=k;m=16248;n=l+112|0;do{c[l>>2]=c[m>>2];l=l+4|0;m=m+4|0}while((l|0)<(n|0));if((d+-1|0)>>>0>2147483646)if(!d){o=h;p=1;q=4}else{c[(fu()|0)>>2]=75;r=-1}else{o=b;p=d;q=4}if((q|0)==4){q=-2-o|0;d=p>>>0>q>>>0?q:p;c[k+48>>2]=d;p=k+20|0;c[p>>2]=o;c[k+44>>2]=o;q=o+d|0;o=k+16|0;c[o>>2]=q;c[k+28>>2]=q;q=Fu(k,e,f)|0;if(!d)r=q;else{d=c[p>>2]|0;a[d+(((d|0)==(c[o>>2]|0))<<31>>31)>>0]=0;r=q}}i=g;return r|0}function Eu(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0;e=a+20|0;f=c[e>>2]|0;g=(c[a+16>>2]|0)-f|0;a=g>>>0>d>>>0?d:g;Ow(f|0,b|0,a|0)|0;c[e>>2]=(c[e>>2]|0)+a;return d|0}function Fu(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0;f=i;i=i+224|0;if((i|0)>=(j|0))U();g=f+120|0;h=f+80|0;k=f;l=f+136|0;m=h;n=m+40|0;do{c[m>>2]=0;m=m+4|0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.0,nb=0.0,ob=0.0,pb=0,qb=0,rb=0,sb=0,tb=0,ub=0,vb=0,wb=0,xb=0.0,yb=0,zb=0,Ab=0,Bb=0,Cb=0,Db=0,Eb=0,Fb=0,Gb=0,Hb=0,Ib=0,Jb=0,Kb=0,Lb=0,Mb=0,Nb=0,Ob=0,Pb=0,Qb=0,Rb=0,Sb=0,Tb=0,Ub=0,Vb=0,Wb=0,Xb=0,Yb=0,Zb=0.0,_b=0.0,$b=0.0,ac=0,bc=0,cc=0,dc=0,ec=0,fc=0,gc=0,hc=0,ic=0,jc=0,kc=0,lc=0,mc=0,nc=0,oc=0,pc=0,qc=0,rc=0,sc=0,tc=0,uc=0,vc=0,wc=0,xc=0,yc=0,zc=0,Ac=0,Bc=0,Cc=0,Dc=0,Ec=0,Fc=0,Gc=0;n=i;i=i+624|0;if((i|0)>=(j|0))U();o=n+24|0;p=n+16|0;q=n+588|0;r=n+576|0;s=n;t=n+536|0;u=n+8|0;v=n+528|0;w=(e|0)!=0;x=t+40|0;y=x;z=t+39|0;t=u+4|0;A=q;B=0-A|0;D=r+12|0;E=r+11|0;r=D;F=r-A|0;G=-2-A|0;H=r+2|0;I=o+288|0;J=q+9|0;K=J;L=q+8|0;M=0;N=0;O=0;P=f;a:while(1){do if((M|0)>-1)if((N|0)>(2147483647-M|0)){c[(fu()|0)>>2]=75;Q=-1;break}else{Q=N+M|0;break}else Q=M;while(0);f=a[P>>0]|0;if(!(f<<24>>24)){S=Q;T=O;V=244;break}else{W=f;X=P}b:while(1){switch(W<<24>>24){case 37:{Y=X;Z=X;V=9;break b;break}case 0:{_=X;$=X;break b;break}default:{}}f=X+1|0;W=a[f>>0]|0;X=f}c:do if((V|0)==9)while(1){V=0;if((a[Y+1>>0]|0)!=37){_=Y;$=Z;break c}f=Z+1|0;aa=Y+2|0;if((a[aa>>0]|0)==37){Y=aa;Z=f;V=9}else{_=aa;$=f;break}}while(0);f=$-P|0;if(w?(c[e>>2]&32|0)==0:0)Hu(P,f,e)|0;if(($|0)!=(P|0)){M=Q;N=f;P=_;continue}aa=_+1|0;ba=a[aa>>0]|0;ca=(ba<<24>>24)+-48|0;if(ca>>>0<10){da=(a[_+2>>0]|0)==36;ea=da?_+3|0:aa;fa=a[ea>>0]|0;ga=da?ca:-1;ha=da?1:O;ia=ea}else{fa=ba;ga=-1;ha=O;ia=aa}aa=fa<<24>>24;d:do if((aa&-32|0)==32){ba=aa;ea=fa;da=0;ca=ia;while(1){if(!(1<<ba+-32&75913)){ja=ea;ka=da;la=ca;break d}ma=1<<(ea<<24>>24)+-32|da;na=ca+1|0;oa=a[na>>0]|0;ba=oa<<24>>24;if((ba&-32|0)!=32){ja=oa;ka=ma;la=na;break}else{ea=oa;da=ma;ca=na}}}else{ja=fa;ka=0;la=ia}while(0);do if(ja<<24>>24==42){aa=la+1|0;ca=(a[aa>>0]|0)+-48|0;if(ca>>>0<10?(a[la+2>>0]|0)==36:0){c[m+(ca<<2)>>2]=10;pa=1;qa=la+3|0;ra=c[l+((a[aa>>0]|0)+-48<<3)>>2]|0}else{if(ha|0){sa=-1;break a}if(!w){ta=ka;ua=0;va=aa;wa=0;break}ca=(c[g>>2]|0)+(4-1)&~(4-1);da=c[ca>>2]|0;c[g>>2]=ca+4;pa=0;qa=aa;ra=da}if((ra|0)<0){ta=ka|8192;ua=pa;va=qa;wa=0-ra|0}else{ta=ka;ua=pa;va=qa;wa=ra}}else{da=(ja<<24>>24)+-48|0;if(da>>>0<10){aa=la;ca=0;ea=da;while(1){da=(ca*10|0)+ea|0;ba=aa+1|0;ea=(a[ba>>0]|0)+-48|0;if(ea>>>0>=10){xa=da;ya=ba;break}else{aa=ba;ca=da}}if((xa|0)<0){sa=-1;break a}else{ta=ka;ua=ha;va=ya;wa=xa}}else{ta=ka;ua=ha;va=la;wa=0}}while(0);e:do if((a[va>>0]|0)==46){ca=va+1|0;aa=a[ca>>0]|0;if(aa<<24>>24!=42){ea=(aa<<24>>24)+-48|0;if(ea>>>0<10){za=ca;Aa=0;Ba=ea}else{Ca=0;Da=ca;break}while(1){ca=(Aa*10|0)+Ba|0;ea=za+1|0;Ba=(a[ea>>0]|0)+-48|0;if(Ba>>>0>=10){Ca=ca;Da=ea;break e}else{za=ea;Aa=ca}}}ca=va+2|0;ea=(a[ca>>0]|0)+-48|0;if(ea>>>0<10?(a[va+3>>0]|0)==36:0){c[m+(ea<<2)>>2]=10;Ca=c[l+((a[ca>>0]|0)+-48<<3)>>2]|0;Da=va+4|0;break}if(ua|0){sa=-1;break a}if(w){ea=(c[g>>2]|0)+(4-1)&~(4-1);aa=c[ea>>2]|0;c[g>>2]=ea+4;Ca=aa;Da=ca}else{Ca=0;Da=ca}}else{Ca=-1;Da=va}while(0);ca=Da;aa=0;while(1){ea=(a[ca>>0]|0)+-65|0;if(ea>>>0>57){sa=-1;break a}da=ca+1|0;ba=a[66344+(aa*58|0)+ea>>0]|0;ea=ba&255;if((ea+-1|0)>>>0<8){ca=da;aa=ea}else{Ea=da;Fa=ba;Ga=ea;Ha=ca;Ia=aa;break}}if(!(Fa<<24>>24)){sa=-1;break}aa=(ga|0)>-1;do if(Fa<<24>>24==19)if(aa){sa=-1;break a}else V=52;else{if(aa){c[m+(ga<<2)>>2]=Ga;ca=l+(ga<<3)|0;ea=c[ca+4>>2]|0;ba=s;c[ba>>2]=c[ca>>2];c[ba+4>>2]=ea;V=52;break}if(!w){sa=0;break a}Ju(s,Ga,g)}while(0);if((V|0)==52?(V=0,!w):0){M=Q;N=f;O=ua;P=Ea;continue}aa=a[Ha>>0]|0;ea=(Ia|0)!=0&(aa&15|0)==3?aa&-33:aa;aa=ta&-65537;ba=(ta&8192|0)==0?ta:aa;f:do switch(ea|0){case 110:{switch(Ia|0){case 0:{c[c[s>>2]>>2]=Q;M=Q;N=f;O=ua;P=Ea;continue a;break}case 1:{c[c[s>>2]>>2]=Q;M=Q;N=f;O=ua;P=Ea;continue a;break}case 2:{ca=c[s>>2]|0;c[ca>>2]=Q;c[ca+4>>2]=((Q|0)<0)<<31>>31;M=Q;N=f;O=ua;P=Ea;continue a;break}case 3:{b[c[s>>2]>>1]=Q;M=Q;N=f;O=ua;P=Ea;continue a;break}case 4:{a[c[s>>2]>>0]=Q;M=Q;N=f;O=ua;P=Ea;continue a;break}case 6:{c[c[s>>2]>>2]=Q;M=Q;N=f;O=ua;P=Ea;continue a;break}case 7:{ca=c[s>>2]|0;c[ca>>2]=Q;c[ca+4>>2]=((Q|0)<0)<<31>>31;M=Q;N=f;O=ua;P=Ea;continue a;break}default:{M=Q;N=f;O=ua;P=Ea;continue a}}break}case 112:{Ja=ba|8;Ka=Ca>>>0>8?Ca:8;La=120;V=64;break}case 88:case 120:{Ja=ba;Ka=Ca;La=ea;V=64;break}case 111:{ca=s;da=c[ca>>2]|0;na=c[ca+4>>2]|0;if((da|0)==0&(na|0)==0)Ma=x;else{ca=x;ma=da;da=na;while(1){na=ca+-1|0;a[na>>0]=ma&7|48;ma=Mw(ma|0,da|0,3)|0;da=C;if((ma|0)==0&(da|0)==0){Ma=na;break}else ca=na}}if(!(ba&8)){Na=Ma;Oa=ba;Pa=Ca;Qa=0;Ra=66824;V=77}else{ca=y-Ma|0;Na=Ma;Oa=ba;Pa=(Ca|0)>(ca|0)?Ca:ca+1|0;Qa=0;Ra=66824;V=77}break}case 105:case 100:{ca=s;da=c[ca>>2]|0;ma=c[ca+4>>2]|0;if((ma|0)<0){ca=Fw(0,0,da|0,ma|0)|0;na=C;oa=s;c[oa>>2]=ca;c[oa+4>>2]=na;Sa=ca;Ta=na;Ua=1;Va=66824;V=76;break f}if(!(ba&2048)){na=ba&1;Sa=da;Ta=ma;Ua=na;Va=(na|0)==0?66824:66826;V=76}else{Sa=da;Ta=ma;Ua=1;Va=66825;V=76}break}case 117:{ma=s;Sa=c[ma>>2]|0;Ta=c[ma+4>>2]|0;Ua=0;Va=66824;V=76;break}case 99:{a[z>>0]=c[s>>2];Wa=z;Xa=aa;Ya=1;Za=0;_a=66824;$a=x;break}case 109:{ab=xu(c[(fu()|0)>>2]|0)|0;V=82;break}case 115:{ma=c[s>>2]|0;ab=ma|0?ma:66834;V=82;break}case 67:{c[u>>2]=c[s>>2];c[t>>2]=0;c[s>>2]=u;bb=u;cb=-1;V=86;break}case 83:{ma=c[s>>2]|0;if(!Ca){Mu(e,32,wa,0,ba);db=0;V=97}else{bb=ma;cb=Ca;V=86}break}case 65:case 71:case 70:case 69:case 97:case 103:case 102:case 101:{eb=+h[s>>3];c[p>>2]=0;h[k>>3]=eb;if((c[k+4>>2]|0)>=0)if(!(ba&2048)){ma=ba&1;fb=eb;gb=ma;hb=(ma|0)==0?66842:66847}else{fb=eb;gb=1;hb=66844}else{fb=-eb;gb=1;hb=66841}h[k>>3]=fb;ma=c[k+4>>2]&2146435072;do if(ma>>>0<2146435072|(ma|0)==2146435072&0<0){eb=+Pu(fb,p)*2.0;da=eb!=0.0;if(da)c[p>>2]=(c[p>>2]|0)+-1;na=ea|32;if((na|0)==97){ca=ea&32;oa=(ca|0)==0?hb:hb+9|0;ib=gb|2;jb=12-Ca|0;do if(!(Ca>>>0>11|(jb|0)==0)){kb=jb;lb=8.0;while(1){kb=kb+-1|0;mb=lb*16.0;if(!kb){nb=mb;break}else lb=mb}if((a[oa>>0]|0)==45){ob=-(nb+(-eb-nb));break}else{ob=eb+nb-nb;break}}else ob=eb;while(0);jb=c[p>>2]|0;kb=(jb|0)<0?0-jb|0:jb;pb=Ku(kb,((kb|0)<0)<<31>>31,D)|0;if((pb|0)==(D|0)){a[E>>0]=48;qb=E}else qb=pb;a[qb+-1>>0]=(jb>>31&2)+43;jb=qb+-2|0;a[jb>>0]=ea+15;pb=(Ca|0)<1;kb=(ba&8|0)==0;lb=ob;rb=q;while(1){sb=~~lb;tb=rb+1|0;a[rb>>0]=d[66808+sb>>0]|ca;lb=(lb-+(sb|0))*16.0;do if((tb-A|0)==1){if(kb&(pb&lb==0.0)){ub=tb;break}a[tb>>0]=46;ub=rb+2|0}else ub=tb;while(0);if(!(lb!=0.0)){vb=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;break}}}else{Hb=kb;Ib=rb;Jb=zb}if((Hb|0)<0){ib=((ca+25|0)/9|0)+1|0;jb=(na|0)==102;da=Hb;sb=Ib;pb=Jb;while(1){Bb=0-da|0;Eb=(Bb|0)>9?9:Bb;do if(sb>>>0<pb>>>0){Bb=(1<<Eb)+-1|0;Cb=1e9>>>Eb;Db=0;Kb=sb;while(1){Lb=c[Kb>>2]|0;c[Kb>>2]=(Lb>>>Eb)+Db;Mb=R(Lb&Bb,Cb)|0;Kb=Kb+4|0;if(Kb>>>0>=pb>>>0){Nb=Mb;break}else Db=Mb}Db=(c[sb>>2]|0)==0?sb+4|0:sb;if(!Nb){Ob=Db;Pb=pb;break}c[pb>>2]=Nb;Ob=Db;Pb=pb+4|0}else{Ob=(c[sb>>2]|0)==0?sb+4|0:sb;Pb=pb}while(0);oa=jb?rb:Ob;Db=(Pb-oa>>2|0)>(ib|0)?oa+(ib<<2)|0:Pb;da=(c[p>>2]|0)+Eb|0;c[p>>2]=da;if((da|0)>=0){Qb=Ob;Rb=Db;break}else{sb=Ob;pb=Db}}}else{Qb=Ib;Rb=Jb}do if(Qb>>>0<Rb>>>0){pb=(tb-Qb>>2)*9|0;sb=c[Qb>>2]|0;if(sb>>>0<10){Sb=pb;break}else{Tb=pb;Ub=10}while(1){Ub=Ub*10|0;pb=Tb+1|0;if(sb>>>0<Ub>>>0){Sb=pb;break}else Tb=pb}}else Sb=0;while(0);sb=(na|0)==103;Eb=(ca|0)!=0;pb=ca-((na|0)!=102?Sb:0)+((Eb&sb)<<31>>31)|0;if((pb|0)<(((Rb-tb>>2)*9|0)+-9|0)){da=pb+9216|0;pb=rb+4+(((da|0)/9|0)+-1024<<2)|0;ib=((da|0)%9|0)+1|0;if((ib|0)<9){da=10;jb=ib;while(1){ib=da*10|0;jb=jb+1|0;if((jb|0)==9){Vb=ib;break}else da=ib}}else Vb=10;da=c[pb>>2]|0;jb=(da>>>0)%(Vb>>>0)|0;na=(pb+4|0)==(Rb|0);do if(na&(jb|0)==0){Wb=Qb;Xb=pb;Yb=Sb}else{lb=(((da>>>0)/(Vb>>>0)|0)&1|0)==0?9007199254740992.0:9007199254740994.0;ib=(Vb|0)/2|0;if(jb>>>0<ib>>>0)Zb=.5;else Zb=na&(jb|0)==(ib|0)?1.0:1.5;do if(!gb){_b=lb;$b=Zb}else{if((a[hb>>0]|0)!=45){_b=lb;$b=Zb;break}_b=-lb;$b=-Zb}while(0);ib=da-jb|0;c[pb>>2]=ib;if(!(_b+$b!=_b)){Wb=Qb;Xb=pb;Yb=Sb;break}kb=ib+Vb|0;c[pb>>2]=kb;if(kb>>>0>999999999){kb=Qb;ib=pb;while(1){Db=ib+-4|0;c[ib>>2]=0;if(Db>>>0<kb>>>0){oa=kb+-4|0;c[oa>>2]=0;ac=oa}else ac=kb;oa=(c[Db>>2]|0)+1|0;c[Db>>2]=oa;if(oa>>>0>999999999){kb=ac;ib=Db}else{bc=ac;cc=Db;break}}}else{bc=Qb;cc=pb}ib=(tb-bc>>2)*9|0;kb=c[bc>>2]|0;if(kb>>>0<10){Wb=bc;Xb=cc;Yb=ib;break}else{dc=ib;ec=10}while(1){ec=ec*10|0;ib=dc+1|0;if(kb>>>0<ec>>>0){Wb=bc;Xb=cc;Yb=ib;break}else dc=ib}}while(0);pb=Xb+4|0;fc=Wb;gc=Yb;hc=Rb>>>0>pb>>>0?pb:Rb}else{fc=Qb;gc=Sb;hc=Rb}pb=0-gc|0;jb=hc;while(1){if(jb>>>0<=fc>>>0){ic=0;jc=jb;break}da=jb+-4|0;if(!(c[da>>2]|0))jb=da;else{ic=1;jc=jb;break}}do if(sb){jb=(Eb&1^1)+ca|0;if((jb|0)>(gc|0)&(gc|0)>-5){kc=ea+-1|0;lc=jb+-1-gc|0}else{kc=ea+-2|0;lc=jb+-1|0}jb=ba&8;if(jb|0){mc=kc;nc=lc;oc=jb;break}do if(ic){jb=c[jc+-4>>2]|0;if(!jb){pc=9;break}if(!((jb>>>0)%10|0)){qc=10;rc=0}else{pc=0;break}while(1){qc=qc*10|0;da=rc+1|0;if((jb>>>0)%(qc>>>0)|0|0){pc=da;break}else rc=da}}else pc=9;while(0);jb=((jc-tb>>2)*9|0)+-9|0;if((kc|32|0)==102){da=jb-pc|0;na=(da|0)<0?0:da;mc=kc;nc=(lc|0)<(na|0)?lc:na;oc=0;break}else{na=jb+gc-pc|0;jb=(na|0)<0?0:na;mc=kc;nc=(lc|0)<(jb|0)?lc:jb;oc=0;break}}else{mc=ea;nc=ca;oc=ba&8}while(0);ca=nc|oc;tb=(ca|0)!=0&1;Eb=(mc|32|0)==102;if(Eb){sc=(gc|0)>0?gc:0;tc=0}else{sb=(gc|0)<0?pb:gc;jb=Ku(sb,((sb|0)<0)<<31>>31,D)|0;if((r-jb|0)<2){sb=jb;while(1){na=sb+-1|0;a[na>>0]=48;if((r-na|0)<2)sb=na;else{uc=na;break}}}else uc=jb;a[uc+-1>>0]=(gc>>31&2)+43;sb=uc+-2|0;a[sb>>0]=mc;sc=r-sb|0;tc=sb}sb=gb+1+nc+tb+sc|0;Mu(e,32,wa,sb,ba);if(!(c[e>>2]&32))Hu(hb,gb,e)|0;Mu(e,48,wa,sb,ba^65536);do if(Eb){pb=fc>>>0>rb>>>0?rb:fc;na=pb;while(1){da=Ku(c[na>>2]|0,0,J)|0;do if((na|0)==(pb|0)){if((da|0)!=(J|0)){vc=da;break}a[L>>0]=48;vc=L}else{if(da>>>0<=q>>>0){vc=da;break}Sw(q|0,48,da-A|0)|0;kb=da;while(1){ib=kb+-1|0;if(ib>>>0>q>>>0)kb=ib;else{vc=ib;break}}}while(0);if(!(c[e>>2]&32))Hu(vc,K-vc|0,e)|0;da=na+4|0;if(da>>>0>rb>>>0){wc=da;break}else na=da}do if(ca|0){if(c[e>>2]&32|0)break;Hu(66876,1,e)|0}while(0);if((nc|0)>0&wc>>>0<jc>>>0){na=nc;pb=wc;while(1){da=Ku(c[pb>>2]|0,0,J)|0;if(da>>>0>q>>>0){Sw(q|0,48,da-A|0)|0;kb=da;while(1){ib=kb+-1|0;if(ib>>>0>q>>>0)kb=ib;else{xc=ib;break}}}else xc=da;if(!(c[e>>2]&32))Hu(xc,(na|0)>9?9:na,e)|0;pb=pb+4|0;kb=na+-9|0;if(!((na|0)>9&pb>>>0<jc>>>0)){yc=kb;break}else na=kb}}else yc=nc;Mu(e,48,yc+9|0,9,0)}else{na=ic?jc:fc+4|0;if((nc|0)>-1){pb=(oc|0)==0;kb=nc;ib=fc;while(1){Db=Ku(c[ib>>2]|0,0,J)|0;if((Db|0)==(J|0)){a[L>>0]=48;zc=L}else zc=Db;do if((ib|0)==(fc|0)){Db=zc+1|0;if(!(c[e>>2]&32))Hu(zc,1,e)|0;if(pb&(kb|0)<1){Ac=Db;break}if(c[e>>2]&32|0){Ac=Db;break}Hu(66876,1,e)|0;Ac=Db}else{if(zc>>>0<=q>>>0){Ac=zc;break}Sw(q|0,48,zc+B|0)|0;Db=zc;while(1){oa=Db+-1|0;if(oa>>>0>q>>>0)Db=oa;else{Ac=oa;break}}}while(0);da=K-Ac|0;if(!(c[e>>2]&32))Hu(Ac,(kb|0)>(da|0)?da:kb,e)|0;Db=kb-da|0;ib=ib+4|0;if(!(ib>>>0<na>>>0&(Db|0)>-1)){Bc=Db;break}else kb=Db}}else Bc=nc;Mu(e,48,Bc+18|0,18,0);if(c[e>>2]&32|0)break;Hu(tc,r-tc|0,e)|0}while(0);Mu(e,32,wa,sb,ba^8192);wb=(sb|0)<(wa|0)?wa:sb}else{ca=(ea&32|0)!=0;rb=fb!=fb|0.0!=0.0;Eb=rb?0:gb;tb=Eb+3|0;Mu(e,32,wa,tb,aa);jb=c[e>>2]|0;if(!(jb&32)){Hu(hb,Eb,e)|0;Cc=c[e>>2]|0}else Cc=jb;if(!(Cc&32))Hu(rb?(ca?66868:66872):ca?66860:66864,3,e)|0;Mu(e,32,wa,tb,ba^8192);wb=(tb|0)<(wa|0)?wa:tb}while(0);M=Q;N=wb;O=ua;P=Ea;continue a;break}default:{Wa=P;Xa=ba;Ya=Ca;Za=0;_a=66824;$a=x}}while(0);g:do if((V|0)==64){V=0;ea=s;f=c[ea>>2]|0;ma=c[ea+4>>2]|0;ea=La&32;if(!((f|0)==0&(ma|0)==0)){tb=x;ca=f;f=ma;while(1){ma=tb+-1|0;a[ma>>0]=d[66808+(ca&15)>>0]|ea;ca=Mw(ca|0,f|0,4)|0;f=C;if((ca|0)==0&(f|0)==0){Dc=ma;break}else tb=ma}tb=s;if((Ja&8|0)==0|(c[tb>>2]|0)==0&(c[tb+4>>2]|0)==0){Na=Dc;Oa=Ja;Pa=Ka;Qa=0;Ra=66824;V=77}else{Na=Dc;Oa=Ja;Pa=Ka;Qa=2;Ra=66824+(La>>4)|0;V=77}}else{Na=x;Oa=Ja;Pa=Ka;Qa=0;Ra=66824;V=77}}else if((V|0)==76){V=0;Na=Ku(Sa,Ta,x)|0;Oa=ba;Pa=Ca;Qa=Ua;Ra=Va;V=77}else if((V|0)==82){V=0;tb=Lu(ab,0,Ca)|0;f=(tb|0)==0;Wa=ab;Xa=aa;Ya=f?Ca:tb-ab|0;Za=0;_a=66824;$a=f?ab+Ca|0:tb}else if((V|0)==86){V=0;tb=0;f=0;ca=bb;while(1){ea=c[ca>>2]|0;if(!ea){Ec=tb;Fc=f;break}ma=Nu(v,ea)|0;if((ma|0)<0|ma>>>0>(cb-tb|0)>>>0){Ec=tb;Fc=ma;break}ea=ma+tb|0;if(cb>>>0>ea>>>0){tb=ea;f=ma;ca=ca+4|0}else{Ec=ea;Fc=ma;break}}if((Fc|0)<0){sa=-1;break a}Mu(e,32,wa,Ec,ba);if(!Ec){db=0;V=97}else{ca=0;f=bb;while(1){tb=c[f>>2]|0;if(!tb){db=Ec;V=97;break g}ma=Nu(v,tb)|0;ca=ma+ca|0;if((ca|0)>(Ec|0)){db=Ec;V=97;break g}if(!(c[e>>2]&32))Hu(v,ma,e)|0;if(ca>>>0>=Ec>>>0){db=Ec;V=97;break}else f=f+4|0}}}while(0);if((V|0)==97){V=0;Mu(e,32,wa,db,ba^8192);M=Q;N=(wa|0)>(db|0)?wa:db;O=ua;P=Ea;continue}if((V|0)==77){V=0;aa=(Pa|0)>-1?Oa&-65537:Oa;f=s;ca=(c[f>>2]|0)!=0|(c[f+4>>2]|0)!=0;if((Pa|0)!=0|ca){f=(ca&1^1)+(y-Na)|0;Wa=Na;Xa=aa;Ya=(Pa|0)>(f|0)?Pa:f;Za=Qa;_a=Ra;$a=x}else{Wa=x;Xa=aa;Ya=0;Za=Qa;_a=Ra;$a=x}}aa=$a-Wa|0;f=(Ya|0)<(aa|0)?aa:Ya;ca=Za+f|0;ma=(wa|0)<(ca|0)?ca:wa;Mu(e,32,ma,ca,Xa);if(!(c[e>>2]&32))Hu(_a,Za,e)|0;Mu(e,48,ma,ca,Xa^65536);Mu(e,48,f,aa,0);if(!(c[e>>2]&32))Hu(Wa,aa,e)|0;Mu(e,32,ma,ca,Xa^8192);M=Q;N=ma;O=ua;P=Ea}h:do if((V|0)==244)if(!e)if(T){Ea=1;while(1){P=c[m+(Ea<<2)>>2]|0;if(!P){Gc=Ea;break}Ju(l+(Ea<<3)|0,P,g);Ea=Ea+1|0;if((Ea|0)>=10){sa=1;break h}}if((Gc|0)<10){Ea=Gc;while(1){if(c[m+(Ea<<2)>>2]|0){sa=-1;break h}Ea=Ea+1|0;if((Ea|0)>=10){sa=1;break}}}else sa=1}else sa=0;else sa=S;while(0);i=n;return sa|0}function Hu(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;f=e+16|0;g=c[f>>2]|0;if(!g)if(!(Iu(e)|0)){h=c[f>>2]|0;i=5}else j=0;else{h=g;i=5}a:do if((i|0)==5){g=e+20|0;f=c[g>>2]|0;k=f;if((h-f|0)>>>0<d>>>0){j=sb[c[e+36>>2]&63](e,b,d)|0;break}b:do if((a[e+75>>0]|0)>-1){f=d;while(1){if(!f){l=d;m=b;n=k;o=0;break b}p=f+-1|0;if((a[b+p>>0]|0)==10){q=f;break}else f=p}if((sb[c[e+36>>2]&63](e,b,q)|0)>>>0<q>>>0){j=q;break a}l=d-q|0;m=b+q|0;n=c[g>>2]|0;o=q}else{l=d;m=b;n=k;o=0}while(0);Ow(n|0,m|0,l|0)|0;c[g>>2]=(c[g>>2]|0)+l;j=o+l|0}while(0);return j|0}function Iu(b){b=b|0;var d=0,e=0,f=0;d=b+74|0;e=a[d>>0]|0;a[d>>0]=e+255|e;e=c[b>>2]|0;if(!(e&8)){c[b+8>>2]=0;c[b+4>>2]=0;d=c[b+44>>2]|0;c[b+28>>2]=d;c[b+20>>2]=d;c[b+16>>2]=d+(c[b+48>>2]|0);f=0}else{c[b>>2]=e|32;f=-1}return f|0}function Ju(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,i=0,j=0.0;a:do if(b>>>0<=20)do switch(b|0){case 9:{e=(c[d>>2]|0)+(4-1)&~(4-1);f=c[e>>2]|0;c[d>>2]=e+4;c[a>>2]=f;break a;break}case 10:{f=(c[d>>2]|0)+(4-1)&~(4-1);e=c[f>>2]|0;c[d>>2]=f+4;f=a;c[f>>2]=e;c[f+4>>2]=((e|0)<0)<<31>>31;break a;break}case 11:{e=(c[d>>2]|0)+(4-1)&~(4-1);f=c[e>>2]|0;c[d>>2]=e+4;e=a;c[e>>2]=f;c[e+4>>2]=0;break a;break}case 12:{e=(c[d>>2]|0)+(8-1)&~(8-1);f=e;g=c[f>>2]|0;i=c[f+4>>2]|0;c[d>>2]=e+8;e=a;c[e>>2]=g;c[e+4>>2]=i;break a;break}case 13:{i=(c[d>>2]|0)+(4-1)&~(4-1);e=c[i>>2]|0;c[d>>2]=i+4;i=(e&65535)<<16>>16;e=a;c[e>>2]=i;c[e+4>>2]=((i|0)<0)<<31>>31;break a;break}case 14:{i=(c[d>>2]|0)+(4-1)&~(4-1);e=c[i>>2]|0;c[d>>2]=i+4;i=a;c[i>>2]=e&65535;c[i+4>>2]=0;break a;break}case 15:{i=(c[d>>2]|0)+(4-1)&~(4-1);e=c[i>>2]|0;c[d>>2]=i+4;i=(e&255)<<24>>24;e=a;c[e>>2]=i;c[e+4>>2]=((i|0)<0)<<31>>31;break a;break}case 16:{i=(c[d>>2]|0)+(4-1)&~(4-1);e=c[i>>2]|0;c[d>>2]=i+4;i=a;c[i>>2]=e&255;c[i+4>>2]=0;break a;break}case 17:{i=(c[d>>2]|0)+(8-1)&~(8-1);j=+h[i>>3];c[d>>2]=i+8;h[a>>3]=j;break a;break}case 18:{i=(c[d>>2]|0)+(8-1)&~(8-1);j=+h[i>>3];c[d>>2]=i+8;h[a>>3]=j;break a;break}default:break a}while(0);while(0);return}
+function ym(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0;e=i;i=i+48|0;if((i|0)>=(j|0))U();f=e+32|0;g=e+28|0;h=e+24|0;k=e+20|0;l=e+16|0;m=e+12|0;n=e+8|0;o=e+4|0;p=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;c[m>>2]=vm(c[h>>2]|0)|0;c[m>>2]=c[m>>2]^c[(c[f>>2]|0)+4096+16>>2];c[n>>2]=vm((c[h>>2]|0)+4|0)|0;c[n>>2]=c[n>>2]^c[(c[f>>2]|0)+4096+20>>2];c[k>>2]=vm((c[h>>2]|0)+8|0)|0;c[k>>2]=c[k>>2]^c[(c[f>>2]|0)+4096+24>>2];c[l>>2]=vm((c[h>>2]|0)+12|0)|0;c[l>>2]=c[l>>2]^c[(c[f>>2]|0)+4096+28>>2];c[o>>2]=c[(c[f>>2]|0)+((c[m>>2]&255)<<2)>>2]^c[(c[f>>2]|0)+1024+(((c[m>>2]|0)>>>8&255)<<2)>>2]^c[(c[f>>2]|0)+2048+(((c[m>>2]|0)>>>16&255)<<2)>>2]^c[(c[f>>2]|0)+3072+((c[m>>2]|0)>>>24<<2)>>2];c[p>>2]=c[(c[f>>2]|0)+1024+((c[n>>2]&255)<<2)>>2]^c[(c[f>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2];wm(c[g>>2]|0,c[k>>2]|0);c[l>>2]=c[l>>2]^c[(c[f>>2]|0)+4096+4>>2];wm((c[g>>2]|0)+4|0,c[l>>2]|0);c[m>>2]=c[m>>2]^c[(c[f>>2]|0)+4096+8>>2];wm((c[g>>2]|0)+8|0,c[m>>2]|0);c[n>>2]=c[n>>2]^c[(c[f>>2]|0)+4096+12>>2];wm((c[g>>2]|0)+12|0,c[n>>2]|0);i=e;return}function zm(){var a=0,b=0;a=i;i=i+16|0;if((i|0)>=(j|0))U();c[a+8>>2]=4;c[a+4>>2]=16;c[a>>2]=4256;b=jr(43259,13,14,8,4,16,4256)|0;i=a;return b|0}function Am(b,e,f,g,h){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0;k=i;i=i+96|0;if((i|0)>=(j|0))U();l=k+60|0;m=k+56|0;n=k+52|0;o=k+48|0;p=k+44|0;q=k+40|0;r=k+36|0;s=k+32|0;t=k+72|0;u=k+28|0;v=k+24|0;w=k+20|0;x=k+16|0;y=k+12|0;z=k+64|0;A=k;B=k+8|0;c[l>>2]=b;c[m>>2]=e;c[n>>2]=f;c[o>>2]=g;c[p>>2]=h;c[q>>2]=c[l>>2];c[r>>2]=c[n>>2];c[s>>2]=c[o>>2];c[v>>2]=0;while(1){if(!(c[p>>2]|0))break;c[u>>2]=tm(c[q>>2]|0,t,c[m>>2]|0)|0;if((c[u>>2]|0)>>>0>(c[v>>2]|0)>>>0)c[v>>2]=c[u>>2];Bm(c[r>>2]|0,t,c[s>>2]|0,16);c[r>>2]=(c[r>>2]|0)+16;c[s>>2]=(c[s>>2]|0)+16;c[w>>2]=16;while(1){if((c[w>>2]|0)<=0)break;o=(c[m>>2]|0)+((c[w>>2]|0)-1)|0;a[o>>0]=(a[o>>0]|0)+1<<24>>24;if(a[(c[m>>2]|0)+((c[w>>2]|0)-1)>>0]|0)break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c[r>>2]=m+4;c[m>>2]=k;c[n>>2]=(c[n>>2]|0)-4}c[o>>2]=c[r>>2];c[p>>2]=c[s>>2];c[q>>2]=c[t>>2]}while(1){if(!(c[n>>2]|0))break;t=c[p>>2]|0;c[p>>2]=t+1;s=d[t>>0]|0;t=c[q>>2]|0;c[q>>2]=t+1;r=(s^(d[t>>0]|0))&255;t=c[o>>2]|0;c[o>>2]=t+1;a[t>>0]=r;c[n>>2]=(c[n>>2]|0)+-1}i=h;return}function Cm(){var a=0,b=0;a=i;i=i+16|0;if((i|0)>=(j|0))U();c[a+8>>2]=5;c[a+4>>2]=16;c[a>>2]=4256;b=fr(43259,13,14,6,5,16,4256)|0;i=a;return b|0}function Dm(b,e,f,g,h){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0;k=i;i=i+80|0;if((i|0)>=(j|0))U();l=k+56|0;m=k+52|0;n=k+48|0;o=k+44|0;p=k+40|0;q=k+36|0;r=k+32|0;s=k+28|0;t=k+64|0;u=k+24|0;v=k+20|0;w=k+16|0;x=k+12|0;y=k+60|0;z=k;A=k+8|0;c[l>>2]=b;c[m>>2]=e;c[n>>2]=f;c[o>>2]=g;c[p>>2]=h;c[q>>2]=c[l>>2];c[r>>2]=c[n>>2];c[s>>2]=c[o>>2];c[v>>2]=0;while(1){if(!(c[p>>2]|0))break;c[u>>2]=xm(c[q>>2]|0,t,c[s>>2]|0)|0;if((c[u>>2]|0)>>>0>(c[v>>2]|0)>>>0)c[v>>2]=c[u>>2];Em(c[r>>2]|0,t,c[m>>2]|0,c[s>>2]|0,16);c[s>>2]=(c[s>>2]|0)+16;c[r>>2]=(c[r>>2]|0)+16;c[p>>2]=(c[p>>2]|0)+-1}c[w>>2]=t;c[x>>2]=16;a[y>>0]=0;t=z;c[t>>2]=d[y>>0];c[t+4>>2]=0;while(1){if(!(c[w>>2]&7|0?(c[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);Re();i=g;return}function Hm(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,k=0,l=0;f=i;i=i+16|0;if((i|0)>=(j|0))U();g=f+12|0;h=f+8|0;k=f+4|0;l=f;c[g>>2]=a;c[h>>2]=b;c[k>>2]=d;c[l>>2]=e;Em(c[g>>2]|0,c[k>>2]|0,c[h>>2]|0,c[k>>2]|0,c[l>>2]|0);i=f;return}function Im(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=i;i=i+16|0;if((i|0)>=(j|0))U();e=d+4|0;f=d;c[e>>2]=a;c[f>>2]=b;c[17659]=c[e>>2];c[17660]=c[f>>2];i=d;return}function Jm(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,k=0,l=0;f=i;i=i+16|0;if((i|0)>=(j|0))U();g=f+12|0;h=f+8|0;k=f+4|0;l=f;c[g>>2]=a;c[h>>2]=b;c[k>>2]=d;c[l>>2]=e;if(!(c[17659]|0)){i=f;return}tb[c[17659]&15](c[17660]|0,c[g>>2]|0,c[h>>2]|0,c[k>>2]|0,c[l>>2]|0);i=f;return}function Km(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b;c[d>>2]=a;do if(c[d>>2]|0){if((c[d>>2]|0)==1){c[17662]=1;break}if(!(c[17661]|0)){if((c[d>>2]|0)==2){c[17663]=1;break}if((c[d>>2]|0)==3)c[17664]=1}}else c[17661]=1;while(0);i=b;return}function Lm(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b;c[d>>2]=a;if(Jg()|0){ns(c[d>>2]|0);i=b;return}if(c[17662]|0){Or(c[d>>2]|0);i=b;return}if(c[17663]|0){ns(c[d>>2]|0);i=b;return}a=c[d>>2]|0;if(c[17664]|0){Rs(a);i=b;return}else{Or(a);i=b;return}}function Mm(){if(Jg()|0){ts();return}if(c[17662]|0){Yr();return}if(c[17663]|0){ts();return}if(c[17664]|0){Ts();return}else{Yr();return}}function Nm(a){a=a|0;var b=0,d=0,e=0,f=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b+4|0;e=b;c[e>>2]=a;if(!(c[e>>2]|0)?Jg()|0:0)c[d>>2]=2;else f=4;do if((f|0)==4){if(c[17662]|0){c[d>>2]=1;break}if(c[17663]|0){c[d>>2]=2;break}if(c[17664]|0){c[d>>2]=3;break}else{c[d>>2]=1;break}}while(0);i=b;return c[d>>2]|0}function Om(){if(Jg()|0){us();return}else{Zr();return}}function Pm(){if(Jg()|0)return;_r();return}function Qm(){if(Jg()|0)return;$r();return}function Rm(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b;c[d>>2]=a;if(Jg()|0){i=b;return}as(c[d>>2]|0);i=b;return}function Sm(a){a=a|0;var b=0,d=0,e=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b+4|0;e=b;c[e>>2]=a;if(Jg()|0)c[d>>2]=0;else c[d>>2]=bs(c[e>>2]|0)|0;i=b;return c[d>>2]|0}function Tm(){var a=0,b=0;a=i;i=i+16|0;if((i|0)>=(j|0))U();b=a;if(Jg()|0)c[b>>2]=vs()|0;else c[b>>2]=cs()|0;i=a;return c[b>>2]|0}function Um(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=i;i=i+16|0;if((i|0)>=(j|0))U();e=d+8|0;f=d+4|0;g=d;c[e>>2]=a;c[f>>2]=b;c[g>>2]=mf(c[e>>2]|0)|0;Vm(c[g>>2]|0,c[e>>2]|0,c[f>>2]|0);i=d;return c[g>>2]|0}function Vm(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=i;i=i+16|0;if((i|0)>=(j|0))U();f=e+8|0;g=e+4|0;h=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;if(Jg()|0){ws(c[f>>2]|0,c[g>>2]|0,c[h>>2]|0);i=e;return}if(c[17662]|0){ds(c[f>>2]|0,c[g>>2]|0,c[h>>2]|0);i=e;return}if(c[17663]|0){ws(c[f>>2]|0,c[g>>2]|0,c[h>>2]|0);i=e;return}d=c[f>>2]|0;f=c[g>>2]|0;g=c[h>>2]|0;if(c[17664]|0){Ws(d,f,g);i=e;return}else{ds(d,f,g);i=e;return}}function Wm(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=i;i=i+16|0;if((i|0)>=(j|0))U();e=d+8|0;f=d+4|0;g=d;c[e>>2]=a;c[f>>2]=b;c[g>>2]=of(c[e>>2]|0)|0;Vm(c[g>>2]|0,c[e>>2]|0,c[f>>2]|0);i=d;return c[g>>2]|0}function Xm(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=i;i=i+16|0;if((i|0)>=(j|0))U();f=e+8|0;g=e+4|0;h=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;Vm(c[f>>2]|0,c[g>>2]|0,c[h>>2]|0);i=e;return}function Ym(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b;c[d>>2]=a;if(Jg()|0){i=b;return}if(c[17662]|0){ks(c[d>>2]|0);i=b;return}if((c[17663]|0)!=0|(c[17664]|0)!=0){i=b;return}ks(c[d>>2]|0);i=b;return}function Zm(){if(Jg()|0)return;if(c[17662]|0){ls();return}if((c[17663]|0)!=0|(c[17664]|0)!=0)return;ls();return}function _m(){if(Jg()|0)return;if(c[17662]|0){ms();return}if((c[17663]|0)!=0|(c[17664]|0)!=0)return;ms();return}function $m(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;e=i;i=i+48|0;if((i|0)>=(j|0))U();f=e+8|0;g=e;h=e+40|0;k=e+36|0;l=e+32|0;m=e+28|0;n=e+24|0;o=e+20|0;p=e+16|0;q=e+12|0;c[h>>2]=b;c[k>>2]=d;if(Jg()|0){Js(c[h>>2]|0,c[k>>2]|0);i=e;return}Lm(1);c[o>>2]=ut(12528)|0;if(c[o>>2]|0){c[g>>2]=ot(c[o>>2]|0)|0;Je(45309,g)}c[l>>2]=Kv()|0;if(c[17665]|0){if((c[17666]|0)!=(c[l>>2]|0)){Vm(76008,8,0);c[17666]=c[l>>2]}}else{c[p>>2]=ib(0)|0;c[q>>2]=c[l>>2];c[17666]=c[l>>2];c[m>>2]=75988;l=c[m>>2]|0;a[l>>0]=a[q>>0]|0;a[l+1>>0]=a[q+1>>0]|0;a[l+2>>0]=a[q+2>>0]|0;a[l+3>>0]=a[q+3>>0]|0;c[m>>2]=(c[m>>2]|0)+4;q=c[m>>2]|0;a[q>>0]=a[p>>0]|0;a[q+1>>0]=a[p+1>>0]|0;a[q+2>>0]=a[p+2>>0]|0;a[q+3>>0]=a[p+3>>0]|0;Xm(76008,8,0);c[17665]=1}c[m>>2]=c[h>>2];while(1){if((c[k>>2]|0)>>>0<=0)break;Kl(75988,75988,28);c[n>>2]=(c[k>>2]|0)>>>0>20?20:c[k>>2]|0;Ow(c[m>>2]|0,75988,c[n>>2]|0)|0;c[k>>2]=(c[k>>2]|0)-(c[n>>2]|0);c[m>>2]=(c[m>>2]|0)+(c[n>>2]|0)}c[o>>2]=vt(12528)|0;if(c[o>>2]|0){c[f>>2]=ot(c[o>>2]|0)|0;Je(45354,f)}else{i=e;return}}function an(a){a=a|0;var b=0,d=0,e=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b+4|0;e=b;c[e>>2]=a;if(Jg()|0)c[d>>2]=Ks(c[e>>2]|0)|0;else c[d>>2]=0;i=b;return c[d>>2]|0}function bn(a,b,d,e,f,g,h,k){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;k=k|0;var l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0;l=i;i=i+48|0;if((i|0)>=(j|0))U();m=l+32|0;n=l+28|0;o=l+24|0;p=l+20|0;q=l+16|0;r=l+12|0;s=l+8|0;t=l+4|0;u=l;c[n>>2]=a;c[o>>2]=b;c[p>>2]=d;c[q>>2]=e;c[r>>2]=f;c[s>>2]=g;c[t>>2]=h;c[u>>2]=k;if(Jg()|0){c[m>>2]=Os(c[n>>2]|0,c[o>>2]|0,c[p>>2]|0,c[q>>2]|0,c[r>>2]|0,c[s>>2]|0,c[t>>2]|0,c[u>>2]|0)|0;v=c[m>>2]|0;i=l;return v|0}else{c[m>>2]=60;v=c[m>>2]|0;i=l;return v|0}return 0}function cn(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,k=0,l=0;e=i;i=i+16|0;if((i|0)>=(j|0))U();f=e+12|0;g=e+8|0;h=e+4|0;k=e;c[g>>2]=a;c[h>>2]=b;c[k>>2]=d;if(Jg()|0){c[f>>2]=Ps(c[g>>2]|0,c[h>>2]|0,c[k>>2]|0)|0;l=c[f>>2]|0;i=e;return l|0}else{c[f>>2]=60;l=c[f>>2]|0;i=e;return l|0}return 0}function dn(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b;c[d>>2]=a;if(!(Jg()|0)){i=b;return}Qs(c[d>>2]|0);i=b;return}function en(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0;f=i;i=i+144|0;if((i|0)>=(j|0))U();g=f+8|0;h=f;k=f+28|0;l=f+24|0;m=f+20|0;n=f+16|0;o=f+12|0;p=f+32|0;c[k>>2]=b;c[l>>2]=d;c[m>>2]=e;e=c[k>>2]|0;if(!(c[l>>2]|0)){c[h>>2]=e;Cu(p,99,45399,h)|0;Pe(p,0);i=f;return}c[g>>2]=e;Cu(p,99,45404,g)|0;if(c[m>>2]|0){c[n>>2]=Ep(0)|0;c[o>>2]=Ep(0)|0}if(c[m>>2]|0?!(fn(c[n>>2]|0,c[o>>2]|0,c[l>>2]|0,c[m>>2]|0)|0):0){a[p+((Tu(p)|0)-1)>>0]=120;Pe(p,c[n>>2]|0);a[p+((Tu(p)|0)-1)>>0]=121;Pe(p,c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[r>>2]=Ep(0)|0;gn(c[r>>2]|0,c[(c[m>>2]|0)+8>>2]|0,c[n>>2]|0);if(c[k>>2]|0)hn(c[k>>2]|0,c[c[m>>2]>>2]|0,c[r>>2]|0,c[n>>2]|0);if(c[l>>2]|0)hn(c[l>>2]|0,c[(c[m>>2]|0)+4>>2]|0,c[r>>2]|0,c[n>>2]|0);Gp(c[r>>2]|0);c[h>>2]=0;s=c[h>>2]|0;i=f;return s|0}default:{c[h>>2]=-1;s=c[h>>2]|0;i=f;return s|0}}return 0}function gn(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=i;i=i+16|0;if((i|0)>=(j|0))U();f=e+12|0;g=e+8|0;h=e+4|0;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;if(yo(c[f>>2]|0,c[g>>2]|0,c[(c[h>>2]|0)+16>>2]|0)|0){i=e;return}Ie(45409,e);Pe(45443,c[g>>2]|0);Pe(45447,c[(c[h>>2]|0)+16>>2]|0);i=e;return}function hn(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,k=0,l=0;f=i;i=i+16|0;if((i|0)>=(j|0))U();g=f+12|0;h=f+8|0;k=f+4|0;l=f;c[g>>2]=a;c[h>>2]=b;c[k>>2]=d;c[l>>2]=e;Do(c[g>>2]|0,c[h>>2]|0,c[k>>2]|0);jn(c[g>>2]|0,c[l>>2]|0);i=f;return}function jn(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=i;i=i+16|0;if((i|0)>=(j|0))U();e=d+4|0;f=d;c[e>>2]=a;c[f>>2]=b;b=c[e>>2]|0;a=c[e>>2]|0;e=c[f>>2]|0;if(c[(c[f>>2]|0)+48+12>>2]|0){Co(b,a,c[e+48+12>>2]|0);i=d;return}else{zo(b,a,c[e+16>>2]|0);i=d;return}}function kn(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b;c[b+4>>2]=a;c[d>>2]=mf(12)|0;ln(c[d>>2]|0);i=b;return c[d>>2]|0}function ln(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b;c[d>>2]=a;a=Ep(0)|0;c[c[d>>2]>>2]=a;a=Ep(0)|0;c[(c[d>>2]|0)+4>>2]=a;a=Ep(0)|0;c[(c[d>>2]|0)+8>>2]=a;i=b;return}function mn(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b;c[d>>2]=a;if(!(c[d>>2]|0)){i=b;return}nn(c[d>>2]|0);hf(c[d>>2]|0);i=b;return}function nn(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b;c[d>>2]=a;qp(c[c[d>>2]>>2]|0);c[c[d>>2]>>2]=0;qp(c[(c[d>>2]|0)+4>>2]|0);c[(c[d>>2]|0)+4>>2]=0;qp(c[(c[d>>2]|0)+8>>2]|0);c[(c[d>>2]|0)+8>>2]=0;i=b;return}function on(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,k=0,l=0,m=0;f=i;i=i+16|0;if((i|0)>=(j|0))U();g=f+12|0;h=f+8|0;k=f+4|0;l=f;c[g>>2]=a;c[h>>2]=b;c[k>>2]=d;c[l>>2]=e;if(!(c[g>>2]|0))c[g>>2]=kn(0)|0;e=c[c[g>>2]>>2]|0;if(c[h>>2]|0)xp(e,c[h>>2]|0)|0;else op(e);e=c[(c[g>>2]|0)+4>>2]|0;if(c[k>>2]|0)xp(e,c[k>>2]|0)|0;else op(e);e=c[(c[g>>2]|0)+8>>2]|0;if(c[l>>2]|0){xp(e,c[l>>2]|0)|0;m=c[g>>2]|0;i=f;return m|0}else{op(e);m=c[g>>2]|0;i=f;return m|0}return 0}function pn(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,k=0,l=0,m=0;f=i;i=i+16|0;if((i|0)>=(j|0))U();g=f+12|0;h=f+8|0;k=f+4|0;l=f;c[g>>2]=a;c[h>>2]=b;c[k>>2]=d;c[l>>2]=e;if(!(c[g>>2]|0))c[g>>2]=kn(0)|0;e=c[c[g>>2]>>2]|0;if(c[h>>2]|0)zp(e,c[h>>2]|0);else op(e);e=c[(c[g>>2]|0)+4>>2]|0;if(c[k>>2]|0)zp(e,c[k>>2]|0);else op(e);e=c[(c[g>>2]|0)+8>>2]|0;if(c[l>>2]|0){zp(e,c[l>>2]|0);m=c[g>>2]|0;i=f;return m|0}else{op(e);m=c[g>>2]|0;i=f;return m|0}return 0}function qn(b){b=b|0;var d=0,e=0;d=i;i=i+16|0;if((i|0)>=(j|0))U();e=d;c[e>>2]=b;b=(c[e>>2]|0)+48|0;a[b>>0]=a[b>>0]&-2;b=(c[e>>2]|0)+48|0;a[b>>0]=a[b>>0]&-3;i=d;return}function rn(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;h=i;i=i+32|0;if((i|0)>=(j|0))U();k=h+24|0;l=h+20|0;m=h+16|0;n=h+12|0;o=h+8|0;p=h+4|0;q=h;c[k>>2]=a;c[l>>2]=b;c[m>>2]=d;c[n>>2]=e;c[o>>2]=f;c[p>>2]=g;c[q>>2]=pf(1,108)|0;sn(c[q>>2]|0,c[k>>2]|0,c[l>>2]|0,c[m>>2]|0,c[n>>2]|0,c[o>>2]|0,c[p>>2]|0);i=h;return c[q>>2]|0}function sn(a,b,d,e,f,g,h){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;k=i;i=i+32|0;if((i|0)>=(j|0))U();l=k+28|0;m=k+24|0;n=k+20|0;o=k+16|0;p=k+12|0;q=k+8|0;r=k+4|0;s=k;c[l>>2]=a;c[m>>2]=b;c[n>>2]=d;c[o>>2]=e;c[p>>2]=f;c[q>>2]=g;c[r>>2]=h;do if(!(c[17667]|0))if(Ya(45535)|0){c[17667]=1;break}else{c[17667]=-1;break}while(0);c[c[l>>2]>>2]=c[m>>2];c[(c[l>>2]|0)+4>>2]=c[n>>2];c[(c[l>>2]|0)+8>>2]=c[o>>2];if((c[n>>2]|0)==1)c[(c[l>>2]|0)+12>>2]=256;else{n=Zn(c[p>>2]|0)|0;c[(c[l>>2]|0)+12>>2]=n}n=vp(c[p>>2]|0)|0;c[(c[l>>2]|0)+16>>2]=n;n=vp(c[q>>2]|0)|0;c[(c[l>>2]|0)+20>>2]=n;n=vp(c[r>>2]|0)|0;c[(c[l>>2]|0)+24>>2]=n;if((c[17667]|0)>0)t=Ao(c[(c[l>>2]|0)+16>>2]|0,0)|0;else t=0;c[(c[l>>2]|0)+48+12>>2]=t;qn(c[l>>2]|0);c[s>>2]=0;while(1){if((c[s>>2]|0)>>>0>=11)break;t=yp(c[(c[l>>2]|0)+16>>2]|0)|0;c[(c[l>>2]|0)+48+16+(c[s>>2]<<2)>>2]=t;c[s>>2]=(c[s>>2]|0)+1}i=k;return}function tn(a,b,d,e,f,g,h){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0;k=i;i=i+48|0;if((i|0)>=(j|0))U();l=k+36|0;m=k+32|0;n=k+28|0;o=k+24|0;p=k+20|0;q=k+16|0;r=k+12|0;s=k+8|0;t=k+4|0;u=k;c[m>>2]=a;c[n>>2]=b;c[o>>2]=d;c[p>>2]=e;c[q>>2]=f;c[r>>2]=g;c[s>>2]=h;c[c[m>>2]>>2]=0;if(!((c[q>>2]|0)!=0&(c[r>>2]|0)!=0)){c[l>>2]=32816;v=c[l>>2]|0;i=k;return v|0}c[t>>2]=dh(1,108,5)|0;if(c[t>>2]|0){c[u>>2]=eh(c[t>>2]|0,1)|0;sn(c[u>>2]|0,c[n>>2]|0,c[o>>2]|0,c[p>>2]|0,c[q>>2]|0,c[r>>2]|0,c[s>>2]|0);c[c[m>>2]>>2]=c[t>>2];c[l>>2]=0;v=c[l>>2]|0;i=k;return v|0}else{c[l>>2]=rt()|0;v=c[l>>2]|0;i=k;return v|0}return 0}function un(a){a=a|0;var b=0,d=0,e=0,f=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b+8|0;e=b+4|0;f=b;c[d>>2]=a;c[e>>2]=c[d>>2];Bo(c[(c[e>>2]|0)+48+12>>2]|0);qp(c[(c[e>>2]|0)+16>>2]|0);qp(c[(c[e>>2]|0)+20>>2]|0);qp(c[(c[e>>2]|0)+24>>2]|0);mn(c[(c[e>>2]|0)+28>>2]|0);qp(c[(c[e>>2]|0)+32>>2]|0);qp(c[(c[e>>2]|0)+36>>2]|0);mn(c[(c[e>>2]|0)+40>>2]|0);qp(c[(c[e>>2]|0)+44>>2]|0);qp(c[(c[e>>2]|0)+48+8>>2]|0);c[f>>2]=0;while(1){if((c[f>>2]|0)>>>0>=11)break;qp(c[(c[e>>2]|0)+48+16+(c[f>>2]<<2)>>2]|0);c[f>>2]=(c[f>>2]|0)+1}i=b;return}function vn(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b;c[d>>2]=a;if(!(c[d>>2]|0)){i=b;return}un(c[d>>2]|0);hf(c[d>>2]|0);i=b;return}function wn(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,k=0;e=i;i=i+16|0;if((i|0)>=(j|0))U();f=e+12|0;g=e+8|0;h=e+4|0;k=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;c[k>>2]=eh(c[g>>2]|0,1)|0;g=Nh(c[f>>2]|0,c[k>>2]|0,c[h>>2]|0)|0;i=e;return g|0}function xn(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=i;i=i+16|0;if((i|0)>=(j|0))U();f=e+12|0;g=e+8|0;h=e;c[f>>2]=a;c[g>>2]=b;c[e+4>>2]=d;c[h>>2]=eh(c[g>>2]|0,1)|0;g=Oh(c[f>>2]|0,c[h>>2]|0)|0;i=e;return g|0}function yn(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=i;i=i+16|0;if((i|0)>=(j|0))U();f=e+8|0;g=e+4|0;h=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;switch(c[c[h>>2]>>2]|0){case 0:{zn(c[f>>2]|0,c[g>>2]|0,c[h>>2]|0);i=e;return}case 1:{Gn(c[f>>2]|0,c[g>>2]|0,c[h>>2]|0);i=e;return}case 2:{Hn(c[f>>2]|0,c[g>>2]|0,c[h>>2]|0);i=e;return}default:{i=e;return}}}function zn(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,k=0;e=i;i=i+16|0;if((i|0)>=(j|0))U();f=e+8|0;g=e+4|0;h=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;if(io(c[(c[g>>2]|0)+4>>2]|0,0)|0?io(c[(c[g>>2]|0)+8>>2]|0,0)|0:0){d=(An(c[h>>2]|0)|0)!=0;b=(c[h>>2]|0)+48+16|0;if(d){Bn(c[b>>2]|0,c[(c[g>>2]|0)+8>>2]|0,c[h>>2]|0);Cn(c[(c[h>>2]|0)+48+16+12>>2]|0,c[c[g>>2]>>2]|0,c[(c[h>>2]|0)+48+16>>2]|0,c[h>>2]|0);d=c[(c[h>>2]|0)+48+16+12>>2]|0;a=c[(c[h>>2]|0)+48+16+12>>2]|0;k=Jp(3)|0;hn(d,a,k,c[h>>2]|0);Dn(c[(c[h>>2]|0)+48+16+4>>2]|0,c[c[g>>2]>>2]|0,c[(c[h>>2]|0)+48+16>>2]|0,c[h>>2]|0);hn(c[(c[h>>2]|0)+48+16+12>>2]|0,c[(c[h>>2]|0)+48+16+12>>2]|0,c[(c[h>>2]|0)+48+16+4>>2]|0,c[h>>2]|0)}else{Bn(c[b+12>>2]|0,c[c[g>>2]>>2]|0,c[h>>2]|0);b=c[(c[h>>2]|0)+48+16+12>>2]|0;k=c[(c[h>>2]|0)+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2]|0,c[(c[h>>2]|0)+48+16+16>>2]|0,c[c[f>>2]>>2]|0,c[h>>2]|0);hn(c[(c[f>>2]|0)+4>>2]|0,c[(c[f>>2]|0)+4>>2]|0,c[(c[h>>2]|0)+48+16+12>>2]|0,c[h>>2]|0);Cn(c[(c[f>>2]|0)+4>>2]|0,c[(c[f>>2]|0)+4>>2]|0,c[(c[h>>2]|0)+48+16+20>>2]|0,c[h>>2]|0);i=e;return}Bp(c[c[f>>2]>>2]|0,1)|0;Bp(c[(c[f>>2]|0)+4>>2]|0,1)|0;Bp(c[(c[f>>2]|0)+8>>2]|0,0)|0;i=e;return}function An(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,k=0,l=0;d=i;i=i+16|0;if((i|0)>=(j|0))U();e=d+4|0;f=d;c[e>>2]=b;if(a[(c[e>>2]|0)+48>>0]&1|0){g=c[e>>2]|0;h=g+48|0;k=h+4|0;l=c[k>>2]|0;i=d;return l|0}b=(c[e>>2]|0)+48|0;a[b>>0]=a[b>>0]&-2|1;c[f>>2]=yp(c[(c[e>>2]|0)+16>>2]|0)|0;Un(c[f>>2]|0,c[(c[e>>2]|0)+16>>2]|0,3);b=((jo(c[(c[e>>2]|0)+20>>2]|0,c[f>>2]|0)|0)!=0^1)&1;c[(c[e>>2]|0)+48+4>>2]=b;qp(c[f>>2]|0);g=c[e>>2]|0;h=g+48|0;k=h+4|0;l=c[k>>2]|0;i=d;return l|0}function Bn(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=i;i=i+16|0;if((i|0)>=(j|0))U();f=e+8|0;g=e+4|0;h=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;hn(c[f>>2]|0,c[g>>2]|0,c[g>>2]|0,c[h>>2]|0);i=e;return}function Cn(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,k=0;f=i;i=i+16|0;if((i|0)>=(j|0))U();g=f+12|0;h=f+8|0;k=f+4|0;c[g>>2]=a;c[h>>2]=b;c[k>>2]=d;c[f>>2]=e;Vn(c[g>>2]|0,c[h>>2]|0,c[k>>2]|0);i=f;return}function Dn(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,k=0,l=0;f=i;i=i+16|0;if((i|0)>=(j|0))U();g=f+12|0;h=f+8|0;k=f+4|0;l=f;c[g>>2]=a;c[h>>2]=b;c[k>>2]=d;c[l>>2]=e;Tn(c[g>>2]|0,c[h>>2]|0,c[k>>2]|0);jn(c[g>>2]|0,c[l>>2]|0);i=f;return}function En(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,k=0,l=0;f=i;i=i+16|0;if((i|0)>=(j|0))U();g=f+12|0;h=f+8|0;k=f+4|0;l=f;c[g>>2]=a;c[h>>2]=b;c[k>>2]=d;c[l>>2]=e;Fo(c[g>>2]|0,c[h>>2]|0,c[k>>2]|0,c[(c[l>>2]|0)+16>>2]|0);i=f;return}function Fn(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=i;i=i+16|0;if((i|0)>=(j|0))U();f=e+8|0;g=e+4|0;h=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;ho(c[f>>2]|0,c[g>>2]|0,1);jn(c[f>>2]|0,c[h>>2]|0);i=e;return}function Gn(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;e=i;i=i+32|0;if((i|0)>=(j|0))U();f=e;c[e+16>>2]=a;c[e+12>>2]=b;c[e+8>>2]=d;c[f>>2]=45576;c[f+4>>2]=45524;Je(45550,f)}function Hn(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=i;i=i+16|0;if((i|0)>=(j|0))U();f=e+8|0;g=e+4|0;h=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;Dn(c[(c[h>>2]|0)+48+16>>2]|0,c[c[g>>2]>>2]|0,c[(c[g>>2]|0)+4>>2]|0,c[h>>2]|0);Bn(c[(c[h>>2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2]|0)+4>>2]|0,c[(c[h>>2]|0)+48+16+16>>2]|0,c[h>>2]|0);hn(c[(c[f>>2]|0)+8>>2]|0,c[(c[h>>2]|0)+48+16+16>>2]|0,c[(c[h>>2]|0)+48+16+24>>2]|0,c[h>>2]|0);i=e;return}function In(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,k=0,l=0;f=i;i=i+16|0;if((i|0)>=(j|0))U();g=f+12|0;h=f+8|0;k=f+4|0;l=f;c[g>>2]=a;c[h>>2]=b;c[k>>2]=d;c[l>>2]=e;switch(c[c[l>>2]>>2]|0){case 0:{Jn(c[g>>2]|0,c[h>>2]|0,c[k>>2]|0,c[l>>2]|0);i=f;return}case 1:{Ln(c[g>>2]|0,c[h>>2]|0,c[k>>2]|0,c[l>>2]|0);i=f;return}case 2:{Mn(c[g>>2]|0,c[h>>2]|0,c[k>>2]|0,c[l>>2]|0);i=f;return}default:{i=f;return}}}function Jn(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,k=0,l=0,m=0,n=0;f=i;i=i+32|0;if((i|0)>=(j|0))U();g=f+20|0;h=f+16|0;k=f+12|0;l=f+8|0;m=f+4|0;n=f;c[g>>2]=a;c[h>>2]=b;c[k>>2]=d;c[l>>2]=e;if(((jo(c[c[h>>2]>>2]|0,c[c[k>>2]>>2]|0)|0)==0?(jo(c[(c[h>>2]|0)+4>>2]|0,c[(c[k>>2]|0)+4>>2]|0)|0)==0:0)?(jo(c[(c[h>>2]|0)+8>>2]|0,c[(c[k>>2]|0)+8>>2]|0)|0)==0:0){yn(c[g>>2]|0,c[h>>2]|0,c[l>>2]|0);i=f;return}if(!(io(c[(c[h>>2]|0)+8>>2]|0,0)|0)){xp(c[c[g>>2]>>2]|0,c[c[k>>2]>>2]|0)|0;xp(c[(c[g>>2]|0)+4>>2]|0,c[(c[k>>2]|0)+4>>2]|0)|0;xp(c[(c[g>>2]|0)+8>>2]|0,c[(c[k>>2]|0)+8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c[(c[l>>2]|0)+48+16+32>>2]|0,c[(c[l>>2]|0)+48+16+20>>2]|0,c[l>>2]|0);k=c[(c[l>>2]|0)+48+16+36>>2]|0;e=c[(c[l>>2]|0)+48+16+8>>2]|0;n=Jp(3)|0;En(k,e,n,c[l>>2]|0);hn(c[(c[l>>2]|0)+48+16+36>>2]|0,c[(c[l>>2]|0)+48+16+36>>2]|0,c[(c[l>>2]|0)+48+16+28>>2]|0,c[l>>2]|0);Cn(c[(c[g>>2]|0)+4>>2]|0,c[(c[l>>2]|0)+48+16+32>>2]|0,c[(c[l>>2]|0)+48+16+36>>2]|0,c[l>>2]|0);n=c[(c[g>>2]|0)+4>>2]|0;e=c[(c[g>>2]|0)+4>>2]|0;k=Kn(c[l>>2]|0)|0;hn(n,e,k,c[l>>2]|0);i=f;return}k=(io(c[m+20>>2]|0,0)|0)!=0;m=c[g>>2]|0;if(k){Bp(c[m>>2]|0,1)|0;Bp(c[(c[g>>2]|0)+4>>2]|0,1)|0;Bp(c[(c[g>>2]|0)+8>>2]|0,0)|0;i=f;return}else{yn(m,c[h>>2]|0,c[l>>2]|0);i=f;return}}function Kn(b){b=b|0;var e=0,f=0,g=0,h=0,k=0,l=0,m=0;e=i;i=i+16|0;if((i|0)>=(j|0))U();f=e;c[f>>2]=b;if((d[(c[f>>2]|0)+48>>0]|0)>>>1&1|0){g=c[f>>2]|0;h=g+48|0;k=h+8|0;l=c[k>>2]|0;i=e;return l|0}b=(c[f>>2]|0)+48|0;a[b>>0]=a[b>>0]&-3|2;if(!(c[(c[f>>2]|0)+48+8>>2]|0)){b=ip(0)|0;c[(c[f>>2]|0)+48+8>>2]=b}b=c[(c[f>>2]|0)+48+8>>2]|0;m=Jp(2)|0;gn(b,m,c[f>>2]|0);g=c[f>>2]|0;h=g+48|0;k=h+8|0;l=c[k>>2]|0;i=e;return l|0}function Ln(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0;f=i;i=i+32|0;if((i|0)>=(j|0))U();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)){wo(c[k>>2]|0,c[l>>2]|0,c[n>>2]|0,c[m>>2]|0,c[o>>2]|0)|0;c[p>>2]=c[n>>2];while(1){if((c[p>>2]|0)<=0)break;if(c[(c[k>>2]|0)+((c[p>>2]|0)-1<<2)>>2]|0)break;c[p>>2]=(c[p>>2]|0)+-1}c[s>>2]=c[q>>2];break}h=(xo(c[l>>2]|0,c[m>>2]|0,c[n>>2]|0)|0)<0;g=c[k>>2]|0;if(h){ep(g,c[m>>2]|0,c[l>>2]|0,c[n>>2]|0)|0;c[p>>2]=c[n>>2];while(1){if((c[p>>2]|0)<=0)break;if(c[(c[k>>2]|0)+((c[p>>2]|0)-1<<2)>>2]|0)break;c[p>>2]=(c[p>>2]|0)+-1}if(c[q>>2]|0)break;c[s>>2]=1;break}else{ep(g,c[l>>2]|0,c[m>>2]|0,c[n>>2]|0)|0;c[p>>2]=c[n>>2];while(1){if((c[p>>2]|0)<=0)break;if(c[(c[k>>2]|0)+((c[p>>2]|0)-1<<2)>>2]|0)break;c[p>>2]=(c[p>>2]|0)+-1}if(!(c[q>>2]|0))break;c[s>>2]=1;break}}else{c[t>>2]=0;while(1){if((c[t>>2]|0)>=(c[n>>2]|0))break;c[(c[k>>2]|0)+(c[t>>2]<<2)>>2]=c[(c[l>>2]|0)+(c[t>>2]<<2)>>2];c[t>>2]=(c[t>>2]|0)+1}c[p>>2]=c[n>>2];c[s>>2]=c[q>>2]}while(0);c[(c[f>>2]|0)+4>>2]=c[p>>2];c[(c[f>>2]|0)+8>>2]=c[s>>2];i=e;return}function Un(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;e=i;i=i+48|0;if((i|0)>=(j|0))U();f=e+36|0;g=e+32|0;h=e+28|0;k=e+24|0;l=e+20|0;m=e+16|0;n=e+12|0;o=e+8|0;p=e+4|0;q=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;c[m>>2]=c[(c[g>>2]|0)+4>>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=f+8|0;k=f+4|0;l=f;c[g>>2]=a;c[h>>2]=b;c[k>>2]=d;c[l>>2]=e;Tn(c[g>>2]|0,c[h>>2]|0,c[k>>2]|0);zo(c[g>>2]|0,c[g>>2]|0,c[l>>2]|0);i=f;return}function Xn(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,k=0,l=0;f=i;i=i+16|0;if((i|0)>=(j|0))U();g=f+12|0;h=f+8|0;k=f+4|0;l=f;c[g>>2]=a;c[h>>2]=b;c[k>>2]=d;c[l>>2]=e;Vn(c[g>>2]|0,c[h>>2]|0,c[k>>2]|0);zo(c[g>>2]|0,c[g>>2]|0,c[l>>2]|0);i=f;return}function Yn(a){a=a|0;var b=0,d=0,e=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b;c[d>>2]=a;if(c[d>>2]|0?c[(c[d>>2]|0)+12>>2]&4|0:0){i=b;return}while(1){if(!(c[(c[d>>2]|0)+4>>2]|0)){e=6;break}if(!((c[(c[(c[d>>2]|0)+16>>2]|0)+((c[(c[d>>2]|0)+4>>2]|0)-1<<2)>>2]|0)!=0^1)){e=6;break}a=(c[d>>2]|0)+4|0;c[a>>2]=(c[a>>2]|0)+-1}if((e|0)==6){i=b;return}}function Zn(a){a=a|0;var b=0,e=0,f=0,g=0,h=0,k=0,l=0,m=0;b=i;i=i+32|0;if((i|0)>=(j|0))U();e=b+20|0;f=b+16|0;g=b+12|0;h=b+8|0;k=b+4|0;l=b;c[f>>2]=a;if(c[f>>2]|0?c[(c[f>>2]|0)+12>>2]&4|0:0){c[e>>2]=c[(c[f>>2]|0)+8>>2];m=c[e>>2]|0;i=b;return m|0}Yn(c[f>>2]|0);if(c[(c[f>>2]|0)+4>>2]|0){c[h>>2]=c[(c[(c[f>>2]|0)+16>>2]|0)+((c[(c[f>>2]|0)+4>>2]|0)-1<<2)>>2];if(c[h>>2]|0){c[k>>2]=c[h>>2];h=c[k>>2]|0;c[l>>2]=(c[k>>2]|0)>>>0<65536?(h>>>0<256?0:8):h>>>0<16777216?16:24;c[g>>2]=32-((d[45623+((c[k>>2]|0)>>>(c[l>>2]|0))>>0]|0)+(c[l>>2]|0))}else c[g>>2]=32;c[g>>2]=32-(c[g>>2]|0)+((c[(c[f>>2]|0)+4>>2]|0)-1<<5)}else c[g>>2]=0;c[e>>2]=c[g>>2];m=c[e>>2]|0;i=b;return m|0}function _n(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,k=0,l=0,m=0;d=i;i=i+32|0;if((i|0)>=(j|0))U();e=d+20|0;f=d+16|0;g=d+12|0;h=d+8|0;k=d+4|0;l=d;c[f>>2]=a;c[g>>2]=b;c[h>>2]=((c[g>>2]|0)>>>0)/32|0;c[k>>2]=((c[g>>2]|0)>>>0)%32|0;if((c[h>>2]|0)>>>0>=(c[(c[f>>2]|0)+4>>2]|0)>>>0){c[e>>2]=0;m=c[e>>2]|0;i=d;return m|0}else{c[l>>2]=c[(c[(c[f>>2]|0)+16>>2]|0)+(c[h>>2]<<2)>>2];c[e>>2]=c[l>>2]&1<<c[k>>2]|0?1:0;m=c[e>>2]|0;i=d;return m|0}return 0}function $n(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,k=0;d=i;i=i+32|0;if((i|0)>=(j|0))U();e=d+16|0;f=d+12|0;g=d+8|0;h=d+4|0;k=d;c[e>>2]=a;c[f>>2]=b;if(c[e>>2]|0?c[(c[e>>2]|0)+12>>2]&16|0:0){pp();i=d;return}c[h>>2]=((c[f>>2]|0)>>>0)/32|0;c[k>>2]=((c[f>>2]|0)>>>0)%32|0;if((c[h>>2]|0)>>>0>=(c[(c[e>>2]|0)+4>>2]|0)>>>0){c[g>>2]=c[(c[e>>2]|0)+4>>2];while(1){if((c[g>>2]|0)>>>0>=(c[c[e>>2]>>2]|0)>>>0)break;c[(c[(c[e>>2]|0)+16>>2]|0)+(c[g>>2]<<2)>>2]=0;c[g>>2]=(c[g>>2]|0)+1}np(c[e>>2]|0,(c[h>>2]|0)+1|0);c[(c[e>>2]|0)+4>>2]=(c[h>>2]|0)+1}g=(c[(c[e>>2]|0)+16>>2]|0)+(c[h>>2]<<2)|0;c[g>>2]=c[g>>2]|1<<c[k>>2];i=d;return}function ao(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,k=0;d=i;i=i+32|0;if((i|0)>=(j|0))U();e=d+16|0;f=d+12|0;g=d+8|0;h=d+4|0;k=d;c[e>>2]=a;c[f>>2]=b;if(c[e>>2]|0?c[(c[e>>2]|0)+12>>2]&16|0:0){pp();i=d;return}c[h>>2]=((c[f>>2]|0)>>>0)/32|0;c[k>>2]=((c[f>>2]|0)>>>0)%32|0;if((c[h>>2]|0)>>>0>=(c[(c[e>>2]|0)+4>>2]|0)>>>0){c[g>>2]=c[(c[e>>2]|0)+4>>2];while(1){if((c[g>>2]|0)>>>0>=(c[c[e>>2]>>2]|0)>>>0)break;c[(c[(c[e>>2]|0)+16>>2]|0)+(c[g>>2]<<2)>>2]=0;c[g>>2]=(c[g>>2]|0)+1}np(c[e>>2]|0,(c[h>>2]|0)+1|0);c[(c[e>>2]|0)+4>>2]=(c[h>>2]|0)+1}g=(c[(c[e>>2]|0)+16>>2]|0)+(c[h>>2]<<2)|0;c[g>>2]=c[g>>2]|1<<c[k>>2];c[k>>2]=(c[k>>2]|0)+1;while(1){if((c[k>>2]|0)>>>0>=32)break;g=(c[(c[e>>2]|0)+16>>2]|0)+(c[h>>2]<<2)|0;c[g>>2]=c[g>>2]&~(1<<c[k>>2]);c[k>>2]=(c[k>>2]|0)+1}c[(c[e>>2]|0)+4>>2]=(c[h>>2]|0)+1;i=d;return}function bo(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;d=i;i=i+16|0;if((i|0)>=(j|0))U();e=d+12|0;f=d+8|0;g=d+4|0;h=d;c[e>>2]=a;c[f>>2]=b;if(c[e>>2]|0?c[(c[e>>2]|0)+12>>2]&16|0:0){pp();i=d;return}c[g>>2]=((c[f>>2]|0)>>>0)/32|0;c[h>>2]=((c[f>>2]|0)>>>0)%32|0;if((c[g>>2]|0)>>>0>=(c[(c[e>>2]|0)+4>>2]|0)>>>0){i=d;return}while(1){if((c[h>>2]|0)>>>0>=32)break;f=(c[(c[e>>2]|0)+16>>2]|0)+(c[g>>2]<<2)|0;c[f>>2]=c[f>>2]&~(1<<c[h>>2]);c[h>>2]=(c[h>>2]|0)+1}c[(c[e>>2]|0)+4>>2]=(c[g>>2]|0)+1;i=d;return}function co(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;d=i;i=i+16|0;if((i|0)>=(j|0))U();e=d+12|0;f=d+8|0;g=d+4|0;h=d;c[e>>2]=a;c[f>>2]=b;if(c[e>>2]|0?c[(c[e>>2]|0)+12>>2]&16|0:0){pp();i=d;return}c[g>>2]=((c[f>>2]|0)>>>0)/32|0;c[h>>2]=((c[f>>2]|0)>>>0)%32|0;if((c[g>>2]|0)>>>0>=(c[(c[e>>2]|0)+4>>2]|0)>>>0){i=d;return}f=(c[(c[e>>2]|0)+16>>2]|0)+(c[g>>2]<<2)|0;c[f>>2]=c[f>>2]&~(1<<c[h>>2]);i=d;return}function eo(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,k=0,l=0;d=i;i=i+32|0;if((i|0)>=(j|0))U();e=d+16|0;f=d+12|0;g=d+8|0;h=d+4|0;k=d;c[e>>2]=a;c[f>>2]=b;c[g>>2]=c[(c[e>>2]|0)+16>>2];c[h>>2]=c[(c[e>>2]|0)+4>>2];if(c[e>>2]|0?c[(c[e>>2]|0)+12>>2]&16|0:0){pp();i=d;return}if((c[f>>2]|0)>>>0>=(c[h>>2]|0)>>>0){c[(c[e>>2]|0)+4>>2]=0;i=d;return}c[k>>2]=0;while(1){l=c[k>>2]|0;if((c[k>>2]|0)>>>0>=((c[h>>2]|0)-(c[f>>2]|0)|0)>>>0)break;c[(c[g>>2]|0)+(c[k>>2]<<2)>>2]=c[(c[g>>2]|0)+(l+(c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:0)dp(c[(c[f>>2]|0)+16>>2]|0,c[(c[f>>2]|0)+16>>2]|0,c[(c[f>>2]|0)+4>>2]|0,c[n>>2]|0)|0}while(0);while(1){if((c[(c[f>>2]|0)+4>>2]|0)<=0){r=40;break}if(c[(c[(c[f>>2]|0)+16>>2]|0)+((c[(c[f>>2]|0)+4>>2]|0)-1<<2)>>2]|0){r=40;break}n=(c[f>>2]|0)+4|0;c[n>>2]=(c[n>>2]|0)+-1}if((r|0)==40){i=e;return}}function go(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,k=0;d=i;i=i+32|0;if((i|0)>=(j|0))U();e=d+16|0;f=d+12|0;g=d+8|0;h=d+4|0;k=d;c[e>>2]=a;c[f>>2]=b;c[h>>2]=c[(c[e>>2]|0)+4>>2];if(!((c[f>>2]|0)!=0&(c[h>>2]|0)!=0)){i=d;return}if((c[c[e>>2]>>2]|0)>>>0<((c[h>>2]|0)+(c[f>>2]|0)|0)>>>0)np(c[e>>2]|0,(c[h>>2]|0)+(c[f>>2]|0)|0);c[g>>2]=c[(c[e>>2]|0)+16>>2];c[k>>2]=(c[h>>2]|0)-1;while(1){if((c[k>>2]|0)<0)break;c[(c[g>>2]|0)+((c[k>>2]|0)+(c[f>>2]|0)<<2)>>2]=c[(c[g>>2]|0)+(c[k>>2]<<2)>>2];c[k>>2]=(c[k>>2]|0)+-1}c[k>>2]=0;while(1){if((c[k>>2]|0)>>>0>=(c[f>>2]|0)>>>0)break;c[(c[g>>2]|0)+(c[k>>2]<<2)>>2]=0;c[k>>2]=(c[k>>2]|0)+1}k=(c[e>>2]|0)+4|0;c[k>>2]=(c[k>>2]|0)+(c[f>>2]|0);i=d;return}function ho(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;e=i;i=i+48|0;if((i|0)>=(j|0))U();f=e+36|0;g=e+32|0;h=e+28|0;k=e+24|0;l=e+20|0;m=e+16|0;n=e+12|0;o=e+8|0;p=e+4|0;q=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;c[k>>2]=((c[h>>2]|0)>>>0)/32|0;c[l>>2]=((c[h>>2]|0)>>>0)%32|0;if(c[f>>2]|0?c[(c[f>>2]|0)+12>>2]&16|0:0){pp();i=e;return}if(!(c[h>>2]|0?1:(c[f>>2]|0)!=(c[g>>2]|0))){i=e;return}if((c[f>>2]|0)!=(c[g>>2]|0)){c[m>>2]=c[(c[g>>2]|0)+4>>2];c[n>>2]=c[(c[g>>2]|0)+8>>2];if((c[c[f>>2]>>2]|0)>>>0<((c[m>>2]|0)+(c[k>>2]|0)+1|0)>>>0)np(c[f>>2]|0,(c[m>>2]|0)+(c[k>>2]|0)+1|0);c[o>>2]=c[(c[f>>2]|0)+16>>2];c[p>>2]=c[(c[g>>2]|0)+16>>2];c[q>>2]=0;while(1){if((c[q>>2]|0)>>>0>=(c[m>>2]|0)>>>0)break;c[(c[o>>2]|0)+(c[q>>2]<<2)>>2]=c[(c[p>>2]|0)+(c[q>>2]<<2)>>2];c[q>>2]=(c[q>>2]|0)+1}c[(c[f>>2]|0)+4>>2]=c[m>>2];c[(c[f>>2]|0)+12>>2]=c[(c[g>>2]|0)+12>>2];c[(c[f>>2]|0)+8>>2]=c[n>>2]}if((c[k>>2]|0)==0|(c[l>>2]|0)!=0){if(c[h>>2]|0){go(c[f>>2]|0,(c[k>>2]|0)+1|0);fo(c[f>>2]|0,c[f>>2]|0,32-(c[l>>2]|0)|0)}}else go(c[f>>2]|0,c[k>>2]|0);while(1){if((c[(c[f>>2]|0)+4>>2]|0)<=0){r=19;break}if(c[(c[(c[f>>2]|0)+16>>2]|0)+((c[(c[f>>2]|0)+4>>2]|0)-1<<2)>>2]|0){r=19;break}k=(c[f>>2]|0)+4|0;c[k>>2]=(c[k>>2]|0)+-1}if((r|0)==19){i=e;return}}function io(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;d=i;i=i+16|0;if((i|0)>=(j|0))U();e=d+12|0;f=d+8|0;g=d+4|0;h=d;c[f>>2]=a;c[g>>2]=b;c[h>>2]=c[g>>2];Yn(c[f>>2]|0);do if(c[(c[f>>2]|0)+4>>2]|0){if(c[(c[f>>2]|0)+8>>2]|0){c[e>>2]=-1;break}if((c[(c[f>>2]|0)+4>>2]|0)!=1){c[e>>2]=1;break}if((c[c[(c[f>>2]|0)+16>>2]>>2]|0)>>>0>(c[h>>2]|0)>>>0){c[e>>2]=1;break}if((c[c[(c[f>>2]|0)+16>>2]>>2]|0)>>>0<(c[h>>2]|0)>>>0){c[e>>2]=-1;break}else{c[e>>2]=0;break}}else c[e>>2]=0-((c[h>>2]|0)!=0&1);while(0);i=d;return c[e>>2]|0}function jo(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0;d=i;i=i+32|0;if((i|0)>=(j|0))U();e=d+20|0;f=d+16|0;g=d+12|0;h=d+8|0;k=d+4|0;l=d;c[f>>2]=a;c[g>>2]=b;if(!(c[f>>2]|0?(c[(c[f>>2]|0)+12>>2]&4|0)!=0:0))m=3;do if((m|0)==3){if(c[g>>2]|0?c[(c[g>>2]|0)+12>>2]&4|0:0)break;Yn(c[f>>2]|0);Yn(c[g>>2]|0);c[h>>2]=c[(c[f>>2]|0)+4>>2];c[k>>2]=c[(c[g>>2]|0)+4>>2];if((c[(c[f>>2]|0)+8>>2]|0)==0?c[(c[g>>2]|0)+8>>2]|0:0){c[e>>2]=1;n=c[e>>2]|0;i=d;return n|0}if(c[(c[f>>2]|0)+8>>2]|0?(c[(c[g>>2]|0)+8>>2]|0)==0:0){c[e>>2]=-1;n=c[e>>2]|0;i=d;return n|0}if(((c[h>>2]|0)!=(c[k>>2]|0)?(c[(c[f>>2]|0)+8>>2]|0)==0:0)?(c[(c[g>>2]|0)+8>>2]|0)==0:0){c[e>>2]=(c[h>>2]|0)-(c[k>>2]|0);n=c[e>>2]|0;i=d;return n|0}if(((c[h>>2]|0)!=(c[k>>2]|0)?c[(c[f>>2]|0)+8>>2]|0:0)?c[(c[g>>2]|0)+8>>2]|0:0){c[e>>2]=(c[k>>2]|0)+(c[h>>2]|0);n=c[e>>2]|0;i=d;return n|0}if(!(c[h>>2]|0)){c[e>>2]=0;n=c[e>>2]|0;i=d;return n|0}b=xo(c[(c[f>>2]|0)+16>>2]|0,c[(c[g>>2]|0)+16>>2]|0,c[h>>2]|0)|0;c[l>>2]=b;if(!b){c[e>>2]=0;n=c[e>>2]|0;i=d;return n|0}if((((c[l>>2]|0)<0?1:0)|0)==((c[(c[f>>2]|0)+8>>2]|0?1:0)|0)){c[e>>2]=1;n=c[e>>2]|0;i=d;return n|0}else{c[e>>2]=-1;n=c[e>>2]|0;i=d;return n|0}}while(0);do if(c[f>>2]|0?c[(c[f>>2]|0)+12>>2]&4|0:0){if(c[g>>2]|0?c[(c[g>>2]|0)+12>>2]&4|0:0)break;c[e>>2]=-1;n=c[e>>2]|0;i=d;return n|0}while(0);if(c[f>>2]|0){if(c[g>>2]|0?(c[(c[f>>2]|0)+12>>2]&4|0)==0:0)m=13}else if(c[g>>2]|0)m=13;if((m|0)==13?c[(c[g>>2]|0)+12>>2]&4|0:0){c[e>>2]=1;n=c[e>>2]|0;i=d;return n|0}if((c[(c[f>>2]|0)+8>>2]|0)==0?(c[(c[g>>2]|0)+8>>2]|0)==0:0){c[e>>2]=0;n=c[e>>2]|0;i=d;return n|0}if((c[(c[f>>2]|0)+8>>2]|0)<(c[(c[g>>2]|0)+8>>2]|0)){c[e>>2]=-1;n=c[e>>2]|0;i=d;return n|0}if((c[(c[f>>2]|0)+8>>2]|0)>(c[(c[g>>2]|0)+8>>2]|0)){c[e>>2]=1;n=c[e>>2]|0;i=d;return n|0}else{c[e>>2]=vv(c[(c[f>>2]|0)+16>>2]|0,c[(c[g>>2]|0)+16>>2]|0,((c[(c[f>>2]|0)+8>>2]|0)+7|0)/8|0)|0;n=c[e>>2]|0;i=d;return n|0}return 0}function ko(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,k=0,l=0;e=i;i=i+32|0;if((i|0)>=(j|0))U();f=e+16|0;g=e+12|0;h=e+8|0;k=e+4|0;l=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;c[k>>2]=c[(c[h>>2]|0)+8>>2];c[l>>2]=0;if((c[f>>2]|0)==(c[h>>2]|0)){c[l>>2]=vp(c[h>>2]|0)|0;c[h>>2]=c[l>>2]}lo(c[f>>2]|0,c[g>>2]|0,c[h>>2]|0);if((c[k>>2]|0?1:0)^(c[(c[g>>2]|0)+8>>2]|0?1:0)|0?c[(c[f>>2]|0)+4>>2]|0:0)Tn(c[f>>2]|0,c[f>>2]|0,c[h>>2]|0);if(!(c[l>>2]|0)){i=e;return}qp(c[l>>2]|0);i=e;return}function lo(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=i;i=i+16|0;if((i|0)>=(j|0))U();f=e+8|0;g=e+4|0;h=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;mo(0,c[f>>2]|0,c[g>>2]|0,c[h>>2]|0);i=e;return}function mo(a,b,e,f){a=a|0;b=b|0;e=e|0;f=f|0;var g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0;g=i;i=i+160|0;if((i|0)>=(j|0))U();h=g+144|0;k=g+140|0;l=g+136|0;m=g+132|0;n=g+128|0;o=g+124|0;p=g+120|0;q=g+116|0;r=g+112|0;s=g+108|0;t=g+104|0;u=g+100|0;v=g+96|0;w=g+92|0;x=g+88|0;y=g+84|0;z=g+64|0;A=g+44|0;B=g+40|0;C=g+36|0;D=g+32|0;E=g+28|0;F=g+24|0;G=g+20|0;H=g+16|0;I=g+12|0;J=g+8|0;K=g+4|0;L=g;c[h>>2]=a;c[k>>2]=b;c[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]|0?1:0;c[(c[k>>2]|0)+4>>2]=c[u>>2];c[(c[k>>2]|0)+8>>2]=c[v>>2];i=g;return}b:do if(l){c[p>>2]=c[(c[h>>2]|0)+16>>2];if((c[p>>2]|0)==(c[n>>2]|0)){c[A+(c[B>>2]<<2)>>2]=c[r>>2];if(c[h>>2]|0)M=(c[(c[h>>2]|0)+12>>2]&1|0)!=0;else M=0;D=jp(c[r>>2]|0,M&1)|0;C=c[B>>2]|0;c[B>>2]=C+1;c[z+(C<<2)>>2]=D;c[n>>2]=D;c[E>>2]=0;while(1){if((c[E>>2]|0)>=(c[r>>2]|0))break b;c[(c[n>>2]|0)+(c[E>>2]<<2)>>2]=c[(c[p>>2]|0)+(c[E>>2]<<2)>>2];c[E>>2]=(c[E>>2]|0)+1}}}else c[p>>2]=(c[q>>2]|0)+(c[s>>2]<<2);while(0);c[F>>2]=c[(c[o>>2]|0)+((c[s>>2]|0)-1<<2)>>2];E=c[F>>2]|0;c[G>>2]=(c[F>>2]|0)>>>0<65536?(E>>>0<256?0:8):E>>>0<16777216?16:24;c[x>>2]=32-((d[45623+((c[F>>2]|0)>>>(c[G>>2]|0))>>0]|0)+(c[G>>2]|0));do if(c[x>>2]|0){c[A+(c[B>>2]<<2)>>2]=c[s>>2];if(c[m>>2]|0)N=(c[(c[m>>2]|0)+12>>2]&1|0)!=0;else N=0;G=jp(c[s>>2]|0,N&1)|0;F=c[B>>2]|0;c[B>>2]=F+1;c[z+(F<<2)>>2]=G;c[H>>2]=G;Xo(c[H>>2]|0,c[o>>2]|0,c[s>>2]|0,c[x>>2]|0)|0;c[o>>2]=c[H>>2];c[I>>2]=Xo(c[q>>2]|0,c[n>>2]|0,c[r>>2]|0,c[x>>2]|0)|0;if(c[I>>2]|0){c[(c[q>>2]|0)+(c[r>>2]<<2)>>2]=c[I>>2];c[u>>2]=(c[r>>2]|0)+1;break}else{c[u>>2]=c[r>>2];break}}else{if((c[o>>2]|0)!=(c[q>>2]|0)){if(c[h>>2]|0?(c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k>>2]|0)+8>>2]=c[v>>2];while(1){if(!(c[B>>2]|0))break;c[B>>2]=(c[B>>2]|0)+-1;lp(c[z+(c[B>>2]<<2)>>2]|0,c[A+(c[B>>2]<<2)>>2]|0)}i=g;return}function no(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,k=0,l=0;e=i;i=i+16|0;if((i|0)>=(j|0))U();f=e+12|0;g=e+8|0;h=e+4|0;k=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;c[k>>2]=Uo(c[(c[g>>2]|0)+16>>2]|0,c[(c[g>>2]|0)+4>>2]|0,c[h>>2]|0)|0;if(c[k>>2]|0?c[(c[g>>2]|0)+8>>2]|0:0)c[k>>2]=(c[h>>2]|0)-(c[k>>2]|0);if(!(c[f>>2]|0)){l=c[k>>2]|0;i=e;return l|0}c[c[(c[f>>2]|0)+16>>2]>>2]=c[k>>2];c[(c[f>>2]|0)+4>>2]=c[k>>2]|0?1:0;l=c[k>>2]|0;i=e;return l|0}function oo(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,k=0;e=i;i=i+16|0;if((i|0)>=(j|0))U();f=e+12|0;g=e+8|0;h=e+4|0;k=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;c[k>>2]=ip(c[(c[f>>2]|0)+4>>2]|0)|0;po(c[f>>2]|0,c[k>>2]|0,c[g>>2]|0,c[h>>2]|0);qp(c[k>>2]|0);i=e;return}function po(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,k=0,l=0,m=0,n=0;f=i;i=i+32|0;if((i|0)>=(j|0))U();g=f+20|0;h=f+16|0;k=f+12|0;l=f+8|0;m=f+4|0;n=f;c[g>>2]=a;c[h>>2]=b;c[k>>2]=d;c[l>>2]=e;c[m>>2]=c[(c[l>>2]|0)+8>>2];c[n>>2]=0;if(!((c[g>>2]|0)!=(c[l>>2]|0)?(c[h>>2]|0)!=(c[l>>2]|0):0)){c[n>>2]=vp(c[l>>2]|0)|0;c[l>>2]=c[n>>2]}mo(c[g>>2]|0,c[h>>2]|0,c[k>>2]|0,c[l>>2]|0);if(c[m>>2]^c[(c[k>>2]|0)+8>>2]|0?c[(c[h>>2]|0)+4>>2]|0:0){Un(c[g>>2]|0,c[g>>2]|0,1);Tn(c[h>>2]|0,c[h>>2]|0,c[l>>2]|0)}if(!(c[n>>2]|0)){i=f;return}qp(c[n>>2]|0);i=f;return}function qo(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0;e=i;i=i+48|0;if((i|0)>=(j|0))U();f=e+32|0;g=e+28|0;h=e+24|0;k=e+20|0;l=e+16|0;m=e+12|0;n=e+8|0;o=e+4|0;p=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;c[k>>2]=c[(c[g>>2]|0)+4>>2];c[m>>2]=((c[h>>2]|0)>>>0)/32|0;c[l>>2]=(c[k>>2]|0)-(c[m>>2]|0);d=c[f>>2]|0;if((c[m>>2]|0)>=(c[k>>2]|0)){c[d+4>>2]=0;i=e;return}if((c[d>>2]|0)<(c[l>>2]|0))np(c[f>>2]|0,c[l>>2]|0);c[n>>2]=c[(c[f>>2]|0)+16>>2];c[o>>2]=c[(c[g>>2]|0)+16>>2];c[h>>2]=((c[h>>2]|0)>>>0)%32|0;a:do if(c[h>>2]|0){dp(c[n>>2]|0,(c[o>>2]|0)+(c[m>>2]<<2)|0,c[l>>2]|0,c[h>>2]|0)|0;c[l>>2]=(c[l>>2]|0)-(((c[(c[n>>2]|0)+((c[l>>2]|0)-1<<2)>>2]|0)!=0^1)&1)}else{c[p>>2]=0;while(1){if((c[p>>2]|0)>=(c[l>>2]|0))break a;c[(c[n>>2]|0)+(c[p>>2]<<2)>>2]=c[(c[o>>2]|0)+(c[m>>2]<<2)+(c[p>>2]<<2)>>2];c[p>>2]=(c[p>>2]|0)+1}}while(0);c[(c[f>>2]|0)+4>>2]=c[l>>2];i=e;return}function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+4;c[n>>2]=(c[e>>2]|0)+1;e=c[n>>2]|0;d=c[h>>2]|0;c[h>>2]=d+4;c[d>>2]=e;if(c[n>>2]|0)break a}c[g>>2]=1;p=c[g>>2]|0;i=f;return p|0}while(0);b:do if((c[h>>2]|0)!=(c[k>>2]|0)){c[o>>2]=0;while(1){if((c[o>>2]|0)>=((c[l>>2]|0)-1|0))break b;c[(c[h>>2]|0)+(c[o>>2]<<2)>>2]=c[(c[k>>2]|0)+(c[o>>2]<<2)>>2];c[o>>2]=(c[o>>2]|0)+1}}while(0);c[g>>2]=0;p=c[g>>2]|0;i=f;return p|0}function uo(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0;g=i;i=i+32|0;if((i|0)>=(j|0))U();h=g+20|0;k=g+16|0;l=g+12|0;m=g+8|0;n=g+4|0;o=g;c[h>>2]=a;c[k>>2]=b;c[l>>2]=d;c[m>>2]=e;c[n>>2]=f;c[o>>2]=0;if(c[n>>2]|0)c[o>>2]=To(c[h>>2]|0,c[k>>2]|0,c[m>>2]|0,c[n>>2]|0)|0;if(!((c[l>>2]|0)-(c[n>>2]|0)|0)){p=c[o>>2]|0;i=g;return p|0}c[o>>2]=to((c[h>>2]|0)+(c[n>>2]<<2)|0,(c[k>>2]|0)+(c[n>>2]<<2)|0,(c[l>>2]|0)-(c[n>>2]|0)|0,c[o>>2]|0)|0;p=c[o>>2]|0;i=g;return p|0}function vo(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0;f=i;i=i+32|0;if((i|0)>=(j|0))U();g=f+24|0;h=f+20|0;k=f+16|0;l=f+12|0;m=f+8|0;n=f+4|0;o=f;c[h>>2]=a;c[k>>2]=b;c[l>>2]=d;c[m>>2]=e;e=c[k>>2]|0;c[k>>2]=e+4;c[n>>2]=c[e>>2];c[m>>2]=(c[n>>2]|0)-(c[m>>2]|0);e=c[m>>2]|0;d=c[h>>2]|0;c[h>>2]=d+4;c[d>>2]=e;a:do if((c[m>>2]|0)>>>0>(c[n>>2]|0)>>>0){while(1){e=(c[l>>2]|0)+-1|0;c[l>>2]=e;if(!e)break;e=c[k>>2]|0;c[k>>2]=e+4;c[n>>2]=c[e>>2];e=(c[n>>2]|0)-1|0;d=c[h>>2]|0;c[h>>2]=d+4;c[d>>2]=e;if(c[n>>2]|0)break a}c[g>>2]=1;p=c[g>>2]|0;i=f;return p|0}while(0);b:do if((c[h>>2]|0)!=(c[k>>2]|0)){c[o>>2]=0;while(1){if((c[o>>2]|0)>=((c[l>>2]|0)-1|0))break b;c[(c[h>>2]|0)+(c[o>>2]<<2)>>2]=c[(c[k>>2]|0)+(c[o>>2]<<2)>>2];c[o>>2]=(c[o>>2]|0)+1}}while(0);c[g>>2]=0;p=c[g>>2]|0;i=f;return p|0}function wo(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0;g=i;i=i+32|0;if((i|0)>=(j|0))U();h=g+20|0;k=g+16|0;l=g+12|0;m=g+8|0;n=g+4|0;o=g;c[h>>2]=a;c[k>>2]=b;c[l>>2]=d;c[m>>2]=e;c[n>>2]=f;c[o>>2]=0;if(c[n>>2]|0)c[o>>2]=ep(c[h>>2]|0,c[k>>2]|0,c[m>>2]|0,c[n>>2]|0)|0;if(!((c[l>>2]|0)-(c[n>>2]|0)|0)){p=c[o>>2]|0;i=g;return p|0}c[o>>2]=vo((c[h>>2]|0)+(c[n>>2]<<2)|0,(c[k>>2]|0)+(c[n>>2]<<2)|0,(c[l>>2]|0)-(c[n>>2]|0)|0,c[o>>2]|0)|0;p=c[o>>2]|0;i=g;return p|0}function xo(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0;e=i;i=i+32|0;if((i|0)>=(j|0))U();f=e+24|0;g=e+20|0;h=e+16|0;k=e+12|0;l=e+8|0;m=e+4|0;n=e;c[g>>2]=a;c[h>>2]=b;c[k>>2]=d;c[l>>2]=(c[k>>2]|0)-1;while(1){if((c[l>>2]|0)<0){o=5;break}c[m>>2]=c[(c[g>>2]|0)+(c[l>>2]<<2)>>2];c[n>>2]=c[(c[h>>2]|0)+(c[l>>2]<<2)>>2];if((c[m>>2]|0)!=(c[n>>2]|0)){o=6;break}c[l>>2]=(c[l>>2]|0)+-1}if((o|0)==5){c[f>>2]=0;p=c[f>>2]|0;i=e;return p|0}else if((o|0)==6){c[f>>2]=(c[m>>2]|0)>>>0>(c[n>>2]|0)>>>0?1:-1;p=c[f>>2]|0;i=e;return p|0}return 0}function yo(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0;e=i;i=i+80|0;if((i|0)>=(j|0))U();f=e+68|0;g=e+64|0;h=e+60|0;k=e+56|0;l=e+52|0;m=e+48|0;n=e+44|0;o=e+40|0;p=e+36|0;q=e+32|0;r=e+28|0;s=e+24|0;t=e+20|0;u=e+16|0;v=e+12|0;w=e+8|0;x=e+4|0;y=e;c[g>>2]=a;c[h>>2]=b;c[k>>2]=d;c[o>>2]=0;c[r>>2]=0;c[u>>2]=0;if(!(io(c[h>>2]|0,0)|0)){c[f>>2]=0;z=c[f>>2]|0;i=e;return z|0}if(!(io(c[k>>2]|0,1)|0)){c[f>>2]=0;z=c[f>>2]|0;i=e;return z|0}c[l>>2]=vp(c[h>>2]|0)|0;c[m>>2]=vp(c[k>>2]|0)|0;c[w>>2]=0;while(1){if(_n(c[l>>2]|0,0)|0)break;if(!((_n(c[m>>2]|0,0)|0)!=0^1))break;fo(c[l>>2]|0,c[l>>2]|0,1);fo(c[m>>2]|0,c[m>>2]|0,1);c[w>>2]=(c[w>>2]|0)+1}c[y>>2]=_n(c[m>>2]|0,0)|0;c[n>>2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>>2]|0,1)|0;c[w>>2]=2}while(0);a:do if((H|0)==19){h=(c[p>>2]|0)==(c[n>>2]|0);if((c[c[f>>2]>>2]|0)<(c[m>>2]|0)){if(!h?(c[p>>2]|0)!=(c[o>>2]|0):0){np(c[f>>2]|0,c[m>>2]|0);c[p>>2]=c[(c[f>>2]|0)+16>>2];break}if(c[f>>2]|0)I=(c[(c[f>>2]|0)+12>>2]&1|0)!=0;else I=0;c[p>>2]=jp(c[m>>2]|0,I&1)|0;c[w>>2]=1;break}if(!h){if((c[p>>2]|0)!=(c[o>>2]|0))break;c[y>>2]=c[l>>2];h=jp(c[l>>2]|0,c[u>>2]|0)|0;c[x>>2]=h;c[o>>2]=h;c[A>>2]=0;while(1){if((c[A>>2]|0)>=(c[l>>2]|0))break a;c[(c[o>>2]|0)+(c[A>>2]<<2)>>2]=c[(c[p>>2]|0)+(c[A>>2]<<2)>>2];c[A>>2]=(c[A>>2]|0)+1}}c[y>>2]=c[k>>2];h=jp(c[k>>2]|0,c[t>>2]|0)|0;c[x>>2]=h;c[n>>2]=h;if((c[p>>2]|0)==(c[o>>2]|0))c[o>>2]=c[n>>2];c[z>>2]=0;while(1){if((c[z>>2]|0)>=(c[k>>2]|0))break a;c[(c[n>>2]|0)+(c[z>>2]<<2)>>2]=c[(c[p>>2]|0)+(c[z>>2]<<2)>>2];c[z>>2]=(c[z>>2]|0)+1}}while(0);if(c[l>>2]|0){c[q>>2]=bp(c[p>>2]|0,c[n>>2]|0,c[k>>2]|0,c[o>>2]|0,c[l>>2]|0)|0;c[m>>2]=(c[m>>2]|0)-(c[q>>2]|0?0:1)}else c[m>>2]=0;if(c[w>>2]|0){if((c[w>>2]|0)==2){c[B>>2]=jp(c[m>>2]|0,0)|0;c[C>>2]=0;while(1){if((c[C>>2]|0)>=(c[m>>2]|0))break;c[(c[B>>2]|0)+(c[C>>2]<<2)>>2]=c[(c[p>>2]|0)+(c[C>>2]<<2)>>2];c[C>>2]=(c[C>>2]|0)+1}lp(c[p>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+408|0;I=g+404|0;J=g+400|0;K=g+396|0;L=g+392|0;M=g+328|0;N=g+264|0;O=g+260|0;P=g+256|0;Q=g+252|0;R=g+248|0;S=g+244|0;T=g+240|0;V=g+236|0;W=g+232|0;X=g+228|0;Y=g+224|0;Z=g+220|0;_=g+216|0;$=g+212|0;aa=g+208|0;ba=g+204|0;ca=g+200|0;da=g+196|0;ea=g+192|0;fa=g+164|0;ga=g+160|0;ha=g+156|0;ia=g+152|0;ja=g+148|0;ka=g+144|0;la=g+140|0;ma=g+136|0;na=g+132|0;oa=g+128|0;pa=g+124|0;qa=g+120|0;ra=g+116|0;sa=g+112|0;ta=g+108|0;ua=g+104|0;va=g+100|0;wa=g+80|0;xa=g+60|0;ya=g+56|0;za=g+52|0;Aa=g+48|0;Ba=g+44|0;Ca=g+24|0;Da=g+4|0;Ea=g;c[h>>2]=a;c[k>>2]=b;c[l>>2]=e;c[m>>2]=f;c[E>>2]=0;c[F>>2]=0;c[G>>2]=0;c[H>>2]=0;c[I>>2]=0;c[J>>2]=0;c[K>>2]=0;c[L>>2]=0;c[r>>2]=c[(c[l>>2]|0)+4>>2];c[s>>2]=c[(c[m>>2]|0)+4>>2];c[B>>2]=c[s>>2]<<1;c[v>>2]=c[(c[m>>2]|0)+8>>2];do if((c[r>>2]<<5|0)<=512){if((c[r>>2]<<5|0)>256){c[O>>2]=4;break}if((c[r>>2]<<5|0)>128){c[O>>2]=3;break}if((c[r>>2]<<5|0)>64){c[O>>2]=2;break}else{c[O>>2]=1;break}}else c[O>>2]=5;while(0);if(c[l>>2]|0)Fa=(c[(c[l>>2]|0)+12>>2]&1|0)!=0;else Fa=0;c[y>>2]=Fa&1;if(c[m>>2]|0)Ga=(c[(c[m>>2]|0)+12>>2]&1|0)!=0;else Ga=0;c[z>>2]=Ga&1;if(c[k>>2]|0)Ha=(c[(c[k>>2]|0)+12>>2]&1|0)!=0;else Ha=0;c[A>>2]=Ha&1;c[n>>2]=c[(c[h>>2]|0)+16>>2];c[o>>2]=c[(c[l>>2]|0)+16>>2];if(!(c[s>>2]|0))Se();do if(c[r>>2]|0){c[I>>2]=c[z>>2]|0?c[s>>2]|0:0;l=jp(c[s>>2]|0,c[z>>2]|0)|0;c[E>>2]=l;c[p>>2]=l;c[S>>2]=c[(c[(c[m>>2]|0)+16>>2]|0)+((c[s>>2]|0)-1<<2)>>2];l=c[S>>2]|0;c[T>>2]=(c[S>>2]|0)>>>0<65536?(l>>>0<256?0:8):l>>>0<16777216?16:24;c[C>>2]=32-((d[45623+((c[S>>2]|0)>>>(c[T>>2]|0))>>0]|0)+(c[T>>2]|0));a:do if(c[C>>2]|0)Xo(c[p>>2]|0,c[(c[m>>2]|0)+16>>2]|0,c[s>>2]|0,c[C>>2]|0)|0;else{c[V>>2]=0;while(1){if((c[V>>2]|0)>=(c[s>>2]|0))break a;c[(c[p>>2]|0)+(c[V>>2]<<2)>>2]=c[(c[(c[m>>2]|0)+16>>2]|0)+(c[V>>2]<<2)>>2];c[V>>2]=(c[V>>2]|0)+1}}while(0);c[t>>2]=c[(c[k>>2]|0)+4>>2];c[w>>2]=c[(c[k>>2]|0)+8>>2];b:do if((c[t>>2]|0)>(c[s>>2]|0)){c[J>>2]=c[A>>2]|0?(c[t>>2]|0)+1|0:0;l=jp((c[t>>2]|0)+1|0,c[A>>2]|0)|0;c[F>>2]=l;c[q>>2]=l;c[W>>2]=0;while(1){if((c[W>>2]|0)>=(c[t>>2]|0))break;c[(c[q>>2]|0)+(c[W>>2]<<2)>>2]=c[(c[(c[k>>2]|0)+16>>2]|0)+(c[W>>2]<<2)>>2];c[W>>2]=(c[W>>2]|0)+1}Vo((c[q>>2]|0)+(c[s>>2]<<2)|0,0,c[q>>2]|0,c[t>>2]|0,c[p>>2]|0,c[s>>2]|0)|0;c[t>>2]=c[s>>2];while(1){if((c[t>>2]|0)<=0)break b;if(c[(c[q>>2]|0)+((c[t>>2]|0)-1<<2)>>2]|0)break b;c[t>>2]=(c[t>>2]|0)+-1}}else c[q>>2]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c[(c[n>>2]|0)+(c[ka>>2]<<2)>>2]=0;c[ka>>2]=(c[ka>>2]|0)+1}}while(0);c[la>>2]=0;while(1){if((c[la>>2]|0)>=(c[t>>2]|0))break;c[(c[n>>2]|0)+(c[la>>2]<<2)>>2]=c[(c[q>>2]|0)+(c[la>>2]<<2)>>2];c[la>>2]=(c[la>>2]|0)+1}c[da>>2]=c[(c[o>>2]|0)+(c[Z>>2]<<2)>>2];c[ma>>2]=c[da>>2];l=c[ma>>2]|0;c[na>>2]=(c[ma>>2]|0)>>>0<65536?(l>>>0<256?0:8):l>>>0<16777216?16:24;c[ca>>2]=32-((d[45623+((c[ma>>2]|0)>>>(c[na>>2]|0))>>0]|0)+(c[na>>2]|0));c[da>>2]=c[da>>2]<<c[ca>>2]<<1;c[ca>>2]=31-(c[ca>>2]|0);c[_>>2]=0;while(1){if(!(c[da>>2]|0)){c[_>>2]=(c[_>>2]|0)+(c[ca>>2]|0);c[Z>>2]=(c[Z>>2]|0)+-1;if((c[Z>>2]|0)<0){Ja=86;break}c[da>>2]=c[(c[o>>2]|0)+(c[Z>>2]<<2)>>2];c[ca>>2]=32;continue}c[qa>>2]=c[da>>2];l=c[qa>>2]|0;c[ra>>2]=(c[qa>>2]|0)>>>0<65536?(l>>>0<256?0:8):l>>>0<16777216?16:24;c[oa>>2]=32-((d[45623+((c[qa>>2]|0)>>>(c[ra>>2]|0))>>0]|0)+(c[ra>>2]|0));c[da>>2]=c[da>>2]<<c[oa>>2];c[ca>>2]=(c[ca>>2]|0)-(c[oa>>2]|0);c[_>>2]=(c[_>>2]|0)+(c[oa>>2]|0);if((c[ca>>2]|0)>=(c[O>>2]|0)){c[pa>>2]=(c[da>>2]|0)>>>(32-(c[O>>2]|0)|0);c[da>>2]=c[da>>2]<<c[O>>2];c[ca>>2]=(c[ca>>2]|0)-(c[O>>2]|0)}else{c[Z>>2]=(c[Z>>2]|0)+-1;if((c[Z>>2]|0)<0){Ja=91;break}c[oa>>2]=c[ca>>2];c[pa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0;c[u>>2]=c[s>>2]}if(c[C>>2]|0)dp(c[n>>2]|0,c[n>>2]|0,c[u>>2]|0,c[C>>2]|0)|0;while(1){if((c[u>>2]|0)<=0)break;if(c[(c[n>>2]|0)+((c[u>>2]|0)-1<<2)>>2]|0)break;c[u>>2]=(c[u>>2]|0)+-1}cp(fa);c[Z>>2]=0;while(1){if((c[Z>>2]|0)>=(1<<(c[O>>2]|0)-1|0))break;if(c[y>>2]|0)Ka=c[N+(c[Z>>2]<<2)>>2]|0;else Ka=0;lp(c[M+(c[Z>>2]<<2)>>2]|0,Ka);c[Z>>2]=(c[Z>>2]|0)+1}lp(c[P>>2]|0,c[y>>2]|0?c[R>>2]|0:0);g:do if((c[D>>2]|0)!=0&(c[u>>2]|0)!=0){if(c[C>>2]|0)dp(c[p>>2]|0,c[p>>2]|0,c[s>>2]|0,c[C>>2]|0)|0;wo(c[n>>2]|0,c[p>>2]|0,c[s>>2]|0,c[n>>2]|0,c[u>>2]|0)|0;c[u>>2]=c[s>>2];c[x>>2]=c[v>>2];while(1){if((c[u>>2]|0)<=0)break g;if(c[(c[n>>2]|0)+((c[u>>2]|0)-1<<2)>>2]|0)break g;c[u>>2]=(c[u>>2]|0)+-1}}while(0);if((c[(c[h>>2]|0)+16>>2]|0)==(c[n>>2]|0)){c[(c[h>>2]|0)+4>>2]=c[u>>2];c[(c[h>>2]|0)+8>>2]=c[x>>2];break}else Fe(45915,45890,786,45900)}else{if((c[s>>2]|0)==1)La=(c[c[(c[m>>2]|0)+16>>2]>>2]|0)==1;else La=0;c[(c[h>>2]|0)+4>>2]=La?0:1;if(c[(c[h>>2]|0)+4>>2]|0){if((c[c[h>>2]>>2]|0)<1)np(c[h>>2]|0,1);c[n>>2]=c[(c[h>>2]|0)+16>>2];c[c[n>>2]>>2]=1}c[(c[h>>2]|0)+8>>2]=0}while(0);if(c[E>>2]|0)lp(c[E>>2]|0,c[I>>2]|0);if(c[F>>2]|0)lp(c[F>>2]|0,c[J>>2]|0);if(c[G>>2]|0)lp(c[G>>2]|0,c[K>>2]|0);if(!(c[H>>2]|0)){i=g;return}lp(c[H>>2]|0,c[L>>2]|0);i=g;return}function Go(a,b,d,e,f,g,h,k,l){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;k=k|0;l=l|0;var m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0;m=i;i=i+48|0;if((i|0)>=(j|0))U();n=m+32|0;o=m+28|0;p=m+24|0;q=m+20|0;r=m+16|0;s=m+12|0;t=m+8|0;u=m+4|0;v=m;c[n>>2]=a;c[o>>2]=b;c[p>>2]=d;c[q>>2]=e;c[r>>2]=f;c[s>>2]=g;c[t>>2]=h;c[u>>2]=k;c[v>>2]=l;l=c[n>>2]|0;k=c[p>>2]|0;p=c[q>>2]|0;h=c[r>>2]|0;r=c[s>>2]|0;if((c[s>>2]|0)<16)bp(l,k,p,h,r)|0;else ap(l,k,p,h,r,c[v>>2]|0);if(((c[q>>2]|0)+(c[s>>2]|0)|0)>(c[u>>2]|0)){Vo((c[n>>2]|0)+(c[u>>2]<<2)|0,0,c[n>>2]|0,(c[q>>2]|0)+(c[s>>2]|0)|0,c[t>>2]|0,c[u>>2]|0)|0;c[c[o>>2]>>2]=c[u>>2];i=m;return}else{c[c[o>>2]>>2]=(c[q>>2]|0)+(c[s>>2]|0);i=m;return}}function Ho(a){a=a|0;var b=0,e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;b=i;i=i+48|0;if((i|0)>=(j|0))U();e=b+32|0;f=b+28|0;g=b+24|0;h=b+20|0;k=b+16|0;l=b+12|0;m=b+8|0;n=b+4|0;o=b;c[e>>2]=a;c[g>>2]=0;c[f>>2]=0;while(1){if((c[f>>2]|0)>>>0>=(c[(c[e>>2]|0)+4>>2]|0)>>>0){p=6;break}if(c[(c[(c[e>>2]|0)+16>>2]|0)+(c[f>>2]<<2)>>2]|0)break;c[g>>2]=(c[g>>2]|0)+32;c[f>>2]=(c[f>>2]|0)+1}if((p|0)==6){q=c[g>>2]|0;i=b;return q|0}c[k>>2]=c[(c[(c[e>>2]|0)+16>>2]|0)+(c[f>>2]<<2)>>2];c[l>>2]=c[k>>2];c[n>>2]=c[l>>2]&0-(c[l>>2]|0);l=c[n>>2]|0;c[o>>2]=(c[n>>2]|0)>>>0<65536?(l>>>0<256?0:8):l>>>0<16777216?16:24;c[m>>2]=32-((d[45623+((c[n>>2]|0)>>>(c[o>>2]|0))>>0]|0)+(c[o>>2]|0));c[h>>2]=31-(c[m>>2]|0);c[g>>2]=(c[g>>2]|0)+(c[h>>2]|0);q=c[g>>2]|0;i=b;return q|0}function Io(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,k=0,l=0;f=i;i=i+16|0;if((i|0)>=(j|0))U();g=f+12|0;h=f+8|0;k=f+4|0;l=f;c[g>>2]=a;c[h>>2]=b;c[k>>2]=d;c[l>>2]=e;e=Jo(c[g>>2]|0,c[h>>2]|0,0,c[k>>2]|0,c[l>>2]|0,0)|0;i=f;return e|0}function Jo(b,e,f,g,h,k){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;k=k|0;var l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0;l=i;i=i+64|0;if((i|0)>=(j|0))U();m=l+60|0;n=l+56|0;o=l+52|0;p=l+48|0;q=l+44|0;r=l+40|0;s=l+36|0;t=l+32|0;u=l+28|0;v=l+24|0;w=l+20|0;x=l+16|0;y=l+12|0;z=l+8|0;A=l+4|0;B=l;c[n>>2]=b;c[o>>2]=e;c[p>>2]=f;c[q>>2]=g;c[r>>2]=h;c[s>>2]=k;if(c[r>>2]|0)c[c[r>>2]>>2]=c[(c[n>>2]|0)+8>>2];c[c[q>>2]>>2]=c[(c[n>>2]|0)+4>>2]<<2;if(c[c[q>>2]>>2]|0)C=c[c[q>>2]>>2]|0;else C=1;c[A>>2]=C;if((c[A>>2]|0)>>>0<(c[o>>2]|0)>>>0)c[A>>2]=c[o>>2];C=c[A>>2]|0;A=c[p>>2]|0;if((c[p>>2]|0)<0)c[B>>2]=C+(0-A);else c[B>>2]=C+A;do if(c[s>>2]|0)D=13;else{if(c[n>>2]|0?c[(c[n>>2]|0)+12>>2]&1|0:0){D=13;break}E=bf(c[B>>2]|0)|0}while(0);if((D|0)==13)E=ef(c[B>>2]|0)|0;c[v>>2]=E;if(!(c[v>>2]|0)){c[m>>2]=0;F=c[m>>2]|0;i=l;return F|0}E=c[v>>2]|0;if((c[p>>2]|0)<0)c[u>>2]=E+(0-(c[p>>2]|0));else c[u>>2]=E;c[t>>2]=c[u>>2];c[z>>2]=(c[(c[n>>2]|0)+4>>2]|0)-1;while(1){if((c[z>>2]|0)<0)break;c[y>>2]=c[(c[(c[n>>2]|0)+16>>2]|0)+(c[z>>2]<<2)>>2];E=(c[y>>2]|0)>>>24&255;p=c[t>>2]|0;c[t>>2]=p+1;a[p>>0]=E;E=(c[y>>2]|0)>>>16&255;p=c[t>>2]|0;c[t>>2]=p+1;a[p>>0]=E;E=(c[y>>2]|0)>>>8&255;p=c[t>>2]|0;c[t>>2]=p+1;a[p>>0]=E;E=c[y>>2]&255;p=c[t>>2]|0;c[t>>2]=p+1;a[p>>0]=E;c[z>>2]=(c[z>>2]|0)+-1}if(c[o>>2]|0){c[w>>2]=c[c[q>>2]>>2];c[z>>2]=0;while(1){if((c[z>>2]|0)>>>0>=(((c[w>>2]|0)>>>0)/2|0)>>>0)break;c[x>>2]=d[(c[u>>2]|0)+(c[z>>2]|0)>>0];a[(c[u>>2]|0)+(c[z>>2]|0)>>0]=a[(c[u>>2]|0)+((c[w>>2]|0)-1-(c[z>>2]|0))>>0]|0;a[(c[u>>2]|0)+((c[w>>2]|0)-1-(c[z>>2]|0))>>0]=c[x>>2];c[z>>2]=(c[z>>2]|0)+1}c[t>>2]=(c[u>>2]|0)+(c[w>>2]|0);while(1){if((c[w>>2]|0)>>>0>=(c[o>>2]|0)>>>0)break;z=c[t>>2]|0;c[t>>2]=z+1;a[z>>0]=0;c[w>>2]=(c[w>>2]|0)+1}c[c[q>>2]>>2]=c[w>>2];c[m>>2]=c[v>>2];F=c[m>>2]|0;i=l;return F|0}else{c[t>>2]=c[u>>2];while(1){if(!(c[c[q>>2]>>2]|0))break;if(!((a[c[t>>2]>>0]|0)!=0^1))break;c[t>>2]=(c[t>>2]|0)+1;w=c[q>>2]|0;c[w>>2]=(c[w>>2]|0)+-1}if((c[t>>2]|0)!=(c[u>>2]|0))Qw(c[u>>2]|0,c[t>>2]|0,c[c[q>>2]>>2]|0)|0;c[m>>2]=c[v>>2];F=c[m>>2]|0;i=l;return F|0}return 0}function Ko(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,k=0,l=0,m=0,n=0;g=i;i=i+32|0;if((i|0)>=(j|0))U();h=g+16|0;k=g+12|0;l=g+8|0;m=g+4|0;n=g;c[h>>2]=a;c[k>>2]=b;c[l>>2]=d;c[m>>2]=e;c[n>>2]=f;f=Jo(c[h>>2]|0,c[k>>2]|0,c[l>>2]|0,c[m>>2]|0,c[n>>2]|0,0)|0;i=g;return f|0}function Lo(a,b,e,f){a=a|0;b=b|0;e=e|0;f=f|0;var g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;g=i;i=i+48|0;if((i|0)>=(j|0))U();h=g+32|0;k=g+28|0;l=g+24|0;m=g+20|0;n=g+16|0;o=g+12|0;p=g+8|0;q=g+4|0;r=g;c[h>>2]=a;c[k>>2]=b;c[l>>2]=e;c[m>>2]=f;c[n>>2]=c[k>>2];if(c[h>>2]|0?c[(c[h>>2]|0)+12>>2]&16|0:0){pp();i=g;return}c[q>>2]=(((c[l>>2]|0)+4-1|0)>>>0)/4|0;if((c[c[h>>2]>>2]|0)<(c[q>>2]|0))np(c[h>>2]|0,c[q>>2]|0);c[(c[h>>2]|0)+8>>2]=c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2]|0;if(!((c[l>>2]|0)!=0&(c[r>>2]|0)!=0)){if(A|0){qp(c[r>>2]|0);c[r>>2]=0}}else{Yn(A);c[c[l>>2]>>2]=c[r>>2]}c[k>>2]=c[r>>2]|0?0:65;z=c[k>>2]|0;i=h;return z|0}if((c[m>>2]|0)!=3){if((c[m>>2]|0)!=4){c[k>>2]=45;z=c[k>>2]|0;i=h;return z|0}if(c[o>>2]|0){c[k>>2]=45;z=c[k>>2]|0;i=h;return z|0}if(c[t>>2]|0)B=kp(0)|0;else B=ip(0)|0;c[r>>2]=B;if(Po(c[r>>2]|0,c[q>>2]|0)|0){qp(c[r>>2]|0);c[k>>2]=65;z=c[k>>2]|0;i=h;return z|0}B=c[r>>2]|0;if(c[l>>2]|0){Yn(B);c[c[l>>2]>>2]=c[r>>2]}else qp(B);if(c[p>>2]|0){B=Tu(c[q>>2]|0)|0;c[c[p>>2]>>2]=B}c[k>>2]=0;z=c[k>>2]|0;i=h;return z|0}c[v>>2]=c[q>>2];if((c[s>>2]|0)!=0&(c[s>>2]|0)>>>0<4){c[k>>2]=66;z=c[k>>2]|0;i=h;return z|0}c[w>>2]=(d[c[v>>2]>>0]|0)<<24|(d[(c[v>>2]|0)+1>>0]|0)<<16|(d[(c[v>>2]|0)+2>>0]|0)<<8|(d[(c[v>>2]|0)+3>>0]|0);c[v>>2]=(c[v>>2]|0)+4;if(c[s>>2]|0)c[s>>2]=(c[s>>2]|0)-4;if(c[s>>2]|0?(c[w>>2]|0)>>>0>(c[s>>2]|0)>>>0:0){c[k>>2]=67;z=c[k>>2]|0;i=h;return z|0}s=(((c[w>>2]|0)+4-1|0)>>>0)/4|0;if(c[t>>2]|0)C=kp(s)|0;else C=ip(s)|0;c[r>>2]=C;if(c[w>>2]|0?(Lo(c[r>>2]|0,c[v>>2]|0,c[w>>2]|0,0),c[(c[r>>2]|0)+8>>2]=(((d[c[v>>2]>>0]|0)&128|0)!=0^1^1)&1,c[(c[r>>2]|0)+8>>2]|0):0){No(c[r>>2]|0);Sn(c[r>>2]|0,c[r>>2]|0,1);c[(c[r>>2]|0)+8>>2]=1}if(c[p>>2]|0)c[c[p>>2]>>2]=(c[w>>2]|0)+4;w=c[r>>2]|0;if(c[l>>2]|0){Yn(w);c[c[l>>2]>>2]=c[r>>2]}else qp(w);c[k>>2]=0;z=c[k>>2]|0;i=h;return z|0}function No(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0;b=i;i=i+32|0;if((i|0)>=(j|0))U();d=b+16|0;e=b+12|0;f=b+8|0;g=b+4|0;h=b;c[d>>2]=a;c[h>>2]=Zn(c[d>>2]|0)|0;if(c[d>>2]|0?c[(c[d>>2]|0)+12>>2]&16|0:0){pp();i=b;return}Yn(c[d>>2]|0);c[e>>2]=c[(c[d>>2]|0)+16>>2];c[f>>2]=c[(c[d>>2]|0)+4>>2];c[g>>2]=0;while(1){if((c[g>>2]|0)>>>0>=(c[f>>2]|0)>>>0)break;a=(c[e>>2]|0)+(c[g>>2]<<2)|0;c[a>>2]=~c[a>>2];c[g>>2]=(c[g>>2]|0)+1}c[(c[d>>2]|0)+8>>2]=0;bo(c[d>>2]|0,(c[h>>2]|0)-1|0);i=b;return}function Oo(a,b,e){a=a|0;b=b|0;e=e|0;var f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0;f=i;i=i+48|0;if((i|0)>=(j|0))U();g=f+40|0;h=f+36|0;k=f+32|0;l=f+28|0;m=f+24|0;n=f+20|0;o=f+16|0;p=f+12|0;q=f+8|0;r=f+4|0;s=f;c[g>>2]=a;c[h>>2]=b;c[k>>2]=e;c[q>>2]=0;c[s>>2]=0;if((c[c[h>>2]>>2]|0)>>>0<2){t=c[q>>2]|0;u=c[h>>2]|0;c[u>>2]=t;v=c[s>>2]|0;i=f;return v|0}c[n>>2]=(d[c[g>>2]>>0]|0)<<8|(d[(c[g>>2]|0)+1>>0]|0);if((c[n>>2]|0)>>>0>16384){t=c[q>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=0;c[l>>2]=0;if((a[c[h>>2]>>0]|0)==45){c[k>>2]=1;c[h>>2]=(c[h>>2]|0)+1}if((a[c[h>>2]>>0]|0)==48?(a[(c[h>>2]|0)+1>>0]|0)==120:0)c[h>>2]=(c[h>>2]|0)+2;c[r>>2]=(Tu(c[h>>2]|0)|0)<<2;if(((c[r>>2]|0)>>>0)%8|0|0)c[l>>2]=1;c[s>>2]=(((c[r>>2]|0)+7|0)>>>0)/8|0;c[t>>2]=(((c[s>>2]|0)+4-1|0)>>>0)/4|0;if((c[c[g>>2]>>2]|0)>>>0<(c[t>>2]|0)>>>0)np(c[g>>2]|0,c[t>>2]|0);c[m>>2]=4-(((c[s>>2]|0)>>>0)%4|0);c[m>>2]=(c[m>>2]|0)%4|0;s=c[t>>2]|0;c[(c[g>>2]|0)+4>>2]=s;c[n>>2]=s;c[(c[g>>2]|0)+8>>2]=c[k>>2];a:while(1){if((c[n>>2]|0)<=0){v=37;break}c[u>>2]=0;while(1){if((c[m>>2]|0)>=4)break;if(c[l>>2]|0){c[p>>2]=48;c[l>>2]=0}else{k=c[h>>2]|0;c[h>>2]=k+1;c[p>>2]=a[k>>0]}if(!(c[p>>2]|0)){v=18;break a}k=c[h>>2]|0;c[h>>2]=k+1;c[q>>2]=a[k>>0];if(!(c[q>>2]|0)){v=20;break a}k=c[p>>2]|0;do if((c[p>>2]|0)>=48&(c[p>>2]|0)<=57)c[o>>2]=k-48;else{s=c[p>>2]|0;if((k|0)>=97&(c[p>>2]|0)<=102){c[o>>2]=s-97+10;break}if(!((s|0)>=65&(c[p>>2]|0)<=70)){v=27;break a}c[o>>2]=(c[p>>2]|0)-65+10}while(0);c[o>>2]=c[o>>2]<<4;k=c[q>>2]|0;do if((c[q>>2]|0)>=48&(c[q>>2]|0)<=57)c[o>>2]=c[o>>2]|k-48;else{s=c[q>>2]|0;if((k|0)>=97&(c[q>>2]|0)<=102){c[o>>2]=c[o>>2]|s-97+10;break}if(!((s|0)>=65&(c[q>>2]|0)<=70)){v=34;break a}c[o>>2]=c[o>>2]|(c[q>>2]|0)-65+10}while(0);c[u>>2]=c[u>>2]<<8;c[u>>2]=c[u>>2]|c[o>>2];c[m>>2]=(c[m>>2]|0)+1}c[m>>2]=0;c[(c[(c[g>>2]|0)+16>>2]|0)+((c[n>>2]|0)-1<<2)>>2]=c[u>>2];c[n>>2]=(c[n>>2]|0)+-1}if((v|0)==18){op(c[g>>2]|0);c[f>>2]=1;w=c[f>>2]|0;i=e;return w|0}else if((v|0)==20){op(c[g>>2]|0);c[f>>2]=1;w=c[f>>2]|0;i=e;return w|0}else if((v|0)==27){op(c[g>>2]|0);c[f>>2]=1;w=c[f>>2]|0;i=e;return w|0}else if((v|0)==34){op(c[g>>2]|0);c[f>>2]=1;w=c[f>>2]|0;i=e;return w|0}else if((v|0)==37){c[f>>2]=0;w=c[f>>2]|0;i=e;return w|0}return 0}function Qo(b,e,f,g,h){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0;k=i;i=i+128|0;if((i|0)>=(j|0))U();l=k+112|0;m=k+108|0;n=k+104|0;o=k+100|0;p=k+96|0;q=k+92|0;r=k+88|0;s=k+84|0;t=k+76|0;u=k+72|0;v=k+68|0;w=k+64|0;x=k+60|0;y=k+56|0;z=k+52|0;A=k+48|0;B=k+44|0;C=k+40|0;D=k+36|0;E=k+32|0;F=k+28|0;G=k+24|0;H=k+20|0;I=k+16|0;J=k+12|0;K=k+8|0;L=k+4|0;M=k;c[m>>2]=b;c[n>>2]=e;c[o>>2]=f;c[p>>2]=g;c[q>>2]=h;c[r>>2]=Zn(c[q>>2]|0)|0;if(!(c[p>>2]|0))c[p>>2]=k+80;if(c[(c[q>>2]|0)+8>>2]|0?io(c[q>>2]|0,0)|0:0)c[t>>2]=1;else c[t>>2]=0;c[s>>2]=c[o>>2];c[c[p>>2]>>2]=0;if((c[m>>2]|0)==1){c[v>>2]=0;c[u>>2]=Io(c[q>>2]|0,0,w,0)|0;if(!(c[u>>2]|0)){c[l>>2]=rt()|0;N=c[l>>2]|0;i=k;return N|0}if(c[t>>2]|0){Ro(c[u>>2]|0,c[w>>2]|0);if(!((d[c[u>>2]>>0]|0)&128)){c[w>>2]=(c[w>>2]|0)+1;c[v>>2]=2}}else if(c[w>>2]|0?(d[c[u>>2]>>0]|0)&128|0:0){c[w>>2]=(c[w>>2]|0)+1;c[v>>2]=1}if(c[n>>2]|0?(c[w>>2]|0)>>>0>(c[s>>2]|0)>>>0:0){hf(c[u>>2]|0);c[l>>2]=66;N=c[l>>2]|0;i=k;return N|0}if(c[n>>2]|0){c[x>>2]=c[n>>2];if((c[v>>2]|0)!=1){if(c[v>>2]|0){o=c[x>>2]|0;c[x>>2]=o+1;a[o>>0]=-1}}else{o=c[x>>2]|0;c[x>>2]=o+1;a[o>>0]=0}Ow(c[x>>2]|0,c[u>>2]|0,(c[w>>2]|0)-(((c[v>>2]|0)!=0^1^1)&1)|0)|0}hf(c[u>>2]|0);c[c[p>>2]>>2]=c[w>>2];c[l>>2]=0;N=c[l>>2]|0;i=k;return N|0}if((c[m>>2]|0)==5){c[y>>2]=(((c[r>>2]|0)+7|0)>>>0)/8|0;if(c[n>>2]|0?(c[y>>2]|0)>>>0>(c[s>>2]|0)>>>0:0){c[l>>2]=66;N=c[l>>2]|0;i=k;return N|0}do if(c[n>>2]|0){c[z>>2]=Io(c[q>>2]|0,0,y,0)|0;if(c[z>>2]|0){Ow(c[n>>2]|0,c[z>>2]|0,c[y>>2]|0)|0;hf(c[z>>2]|0);break}c[l>>2]=rt()|0;N=c[l>>2]|0;i=k;return N|0}while(0);c[c[p>>2]>>2]=c[y>>2];c[l>>2]=0;N=c[l>>2]|0;i=k;return N|0}if((c[m>>2]|0)==2){c[A>>2]=(((c[r>>2]|0)+7|0)>>>0)/8|0;if(c[t>>2]|0){c[l>>2]=45;N=c[l>>2]|0;i=k;return N|0}if(c[n>>2]|0?((c[A>>2]|0)+2|0)>>>0>(c[s>>2]|0)>>>0:0){c[l>>2]=66;N=c[l>>2]|0;i=k;return N|0}do if(c[n>>2]|0){c[C>>2]=c[n>>2];a[c[C>>2]>>0]=(c[r>>2]|0)>>>8;a[(c[C>>2]|0)+1>>0]=c[r>>2];c[B>>2]=Io(c[q>>2]|0,0,A,0)|0;if(c[B>>2]|0){Ow((c[C>>2]|0)+2|0,c[B>>2]|0,c[A>>2]|0)|0;hf(c[B>>2]|0);break}c[l>>2]=rt()|0;N=c[l>>2]|0;i=k;return N|0}while(0);c[c[p>>2]>>2]=(c[A>>2]|0)+2;c[l>>2]=0;N=c[l>>2]|0;i=k;return N|0}if((c[m>>2]|0)==3){c[E>>2]=0;c[D>>2]=Io(c[q>>2]|0,0,F,0)|0;if(!(c[D>>2]|0)){c[l>>2]=rt()|0;N=c[l>>2]|0;i=k;return N|0}if(c[t>>2]|0){Ro(c[D>>2]|0,c[F>>2]|0);if(!((d[c[D>>2]>>0]|0)&128)){c[F>>2]=(c[F>>2]|0)+1;c[E>>2]=2}}else if(c[F>>2]|0?(d[c[D>>2]>>0]|0)&128|0:0){c[F>>2]=(c[F>>2]|0)+1;c[E>>2]=1}if(c[n>>2]|0?((c[F>>2]|0)+4|0)>>>0>(c[s>>2]|0)>>>0:0){hf(c[D>>2]|0);c[l>>2]=66;N=c[l>>2]|0;i=k;return N|0}if(c[n>>2]|0){c[G>>2]=c[n>>2];A=(c[F>>2]|0)>>>24&255;B=c[G>>2]|0;c[G>>2]=B+1;a[B>>0]=A;A=(c[F>>2]|0)>>>16&255;B=c[G>>2]|0;c[G>>2]=B+1;a[B>>0]=A;A=(c[F>>2]|0)>>>8&255;B=c[G>>2]|0;c[G>>2]=B+1;a[B>>0]=A;A=c[F>>2]&255;B=c[G>>2]|0;c[G>>2]=B+1;a[B>>0]=A;if((c[E>>2]|0)!=1){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0;c[c[p>>2]>>2]=(c[L>>2]|0)-(c[n>>2]|0)}else c[c[p>>2]>>2]=(c[K>>2]<<1)+(c[J>>2]|0)+(c[t>>2]|0)+1;hf(c[H>>2]|0);c[l>>2]=0;N=c[l>>2]|0;i=k;return N|0}function Ro(b,e){b=b|0;e=e|0;var f=0,g=0,h=0,k=0;f=i;i=i+16|0;if((i|0)>=(j|0))U();g=f+8|0;h=f+4|0;k=f;c[g>>2]=b;c[h>>2]=e;c[k>>2]=(c[h>>2]|0)-1;while(1){if((c[k>>2]|0)<0)break;if(!((a[(c[g>>2]|0)+(c[k>>2]|0)>>0]|0)!=0^1))break;c[k>>2]=(c[k>>2]|0)+-1}if((c[k>>2]|0)<0){i=f;return}h=d[(c[g>>2]|0)+(c[k>>2]|0)>>0]|0;do if(!(d[(c[g>>2]|0)+(c[k>>2]|0)>>0]&1|0)){e=d[(c[g>>2]|0)+(c[k>>2]|0)>>0]|0;if(h&2|0){a[(c[g>>2]|0)+(c[k>>2]|0)>>0]=(e^252|2)&254;break}b=d[(c[g>>2]|0)+(c[k>>2]|0)>>0]|0;if(e&4|0){a[(c[g>>2]|0)+(c[k>>2]|0)>>0]=(b^248|4)&252;break}e=d[(c[g>>2]|0)+(c[k>>2]|0)>>0]|0;if(b&8|0){a[(c[g>>2]|0)+(c[k>>2]|0)>>0]=(e^240|8)&248;break}b=d[(c[g>>2]|0)+(c[k>>2]|0)>>0]|0;if(e&16|0){a[(c[g>>2]|0)+(c[k>>2]|0)>>0]=(b^224|16)&240;break}e=d[(c[g>>2]|0)+(c[k>>2]|0)>>0]|0;if(b&32|0){a[(c[g>>2]|0)+(c[k>>2]|0)>>0]=(e^192|32)&224;break}b=(c[g>>2]|0)+(c[k>>2]|0)|0;if(e&64|0){a[(c[g>>2]|0)+(c[k>>2]|0)>>0]=(d[b>>0]^128|64)&192;break}else{a[b>>0]=-128;break}}else a[(c[g>>2]|0)+(c[k>>2]|0)>>0]=h^254|1;while(0);c[k>>2]=(c[k>>2]|0)+-1;while(1){if((c[k>>2]|0)<0)break;h=(c[g>>2]|0)+(c[k>>2]|0)|0;a[h>>0]=d[h>>0]^255;c[k>>2]=(c[k>>2]|0)+-1}i=f;return}function So(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0;f=i;i=i+48|0;if((i|0)>=(j|0))U();g=f+36|0;h=f+32|0;k=f+28|0;l=f+24|0;m=f+20|0;n=f+16|0;o=f+12|0;p=f+8|0;q=f+4|0;r=f;c[h>>2]=a;c[k>>2]=b;c[l>>2]=d;c[m>>2]=e;if((((c[h>>2]|0)!=0^1)&1|0)==(((c[k>>2]|0)!=0^1)&1|0)){c[g>>2]=45;s=c[g>>2]|0;i=f;return s|0}if(c[h>>2]|0)c[c[h>>2]>>2]=0;c[n>>2]=Qo(5,0,0,o,c[l>>2]|0)|0;if(c[n>>2]|0){c[g>>2]=c[n>>2];s=c[g>>2]|0;i=f;return s|0}if((c[o>>2]|0)>>>0>(c[m>>2]|0)>>>0){c[g>>2]=67;s=c[g>>2]|0;i=f;return s|0}if((c[o>>2]|0)>>>0<(c[m>>2]|0)>>>0)t=(c[m>>2]|0)-(c[o>>2]|0)|0;else t=0;c[p>>2]=t;c[q>>2]=(c[o>>2]|0)+(c[p>>2]|0);if(!(c[k>>2]|0)){if(c[l>>2]|0?c[(c[l>>2]|0)+12>>2]&1|0:0)u=ef(c[q>>2]|0)|0;else u=bf(c[q>>2]|0)|0;c[r>>2]=u;if(!(c[r>>2]|0)){c[n>>2]=rt()|0;c[g>>2]=c[n>>2];s=c[g>>2]|0;i=f;return s|0}}else c[r>>2]=c[k>>2];if(c[p>>2]|0)Sw(c[r>>2]|0,0,c[p>>2]|0)|0;c[o>>2]=(c[o>>2]|0)+(c[p>>2]|0);c[n>>2]=Qo(5,(c[r>>2]|0)+(c[p>>2]|0)|0,(c[o>>2]|0)-(c[p>>2]|0)|0,0,c[l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g=d+16|0;h=d+12|0;k=d+8|0;l=d+4|0;m=d;c[e>>2]=a;c[f>>2]=b;c[g>>2]=0;c[h>>2]=0;c[k>>2]=0;c[l>>2]=0;c[c[e>>2]>>2]=0;c[h>>2]=Gf(c[f>>2]|0,37775,0)|0;do if(c[h>>2]|0){c[k>>2]=Qf(c[h>>2]|0)|0;Ef(c[h>>2]|0);c[h>>2]=c[k>>2];c[k>>2]=0;if(!(c[h>>2]|0)){c[m>>2]=68;break}c[l>>2]=Nf(c[h>>2]|0,0)|0;if(!(c[l>>2]|0)){c[m>>2]=65;break}c[g>>2]=Cj(c[l>>2]|0)|0;hf(c[l>>2]|0);c[l>>2]=0;if(!(c[g>>2]|0)){c[m>>2]=4;break}if(c[(c[g>>2]|0)+40>>2]|0){c[m>>2]=Bb[c[(c[g>>2]|0)+40>>2]&7](c[h>>2]|0,c[e>>2]|0)|0;break}else{c[m>>2]=69;break}}else c[m>>2]=65;while(0);Ef(c[h>>2]|0);hf(c[l>>2]|0);Ef(c[k>>2]|0);i=d;return c[m>>2]|0}function Nj(){return 0}function Oj(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0;f=i;i=i+32|0;if((i|0)>=(j|0))U();g=f+16|0;h=f+12|0;k=f+8|0;l=f+4|0;m=f;c[g>>2]=b;c[h>>2]=d;c[k>>2]=e;c[g>>2]=Fj(c[g>>2]|0)|0;c[m>>2]=Ej(c[g>>2]|0)|0;if((c[m>>2]|0?(a[(c[m>>2]|0)+4>>0]&1|0)==0:0)?c[(c[m>>2]|0)+68>>2]|0:0){c[l>>2]=sb[c[(c[m>>2]|0)+68>>2]&63](c[g>>2]|0,c[h>>2]|0,c[k>>2]|0)|0;n=c[l>>2]|0;o=Pj(n)|0;i=f;return o|0}c[l>>2]=4;if(!(c[k>>2]|0)){n=c[l>>2]|0;o=Pj(n)|0;i=f;return o|0}h=c[k>>2]|0;k=c[g>>2]|0;if(c[m>>2]|0?!(a[(c[m>>2]|0)+4>>0]&1|0):0)p=37821;else p=c[m>>2]|0?37782:37801;Cb[h&1](49653,k,37843,p);n=c[l>>2]|0;o=Pj(n)|0;i=f;return o|0}function Pj(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b;c[d>>2]=a;a=Qj(1,c[d>>2]|0)|0;i=b;return a|0}function Qj(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=i;i=i+16|0;if((i|0)>=(j|0))U();e=d+4|0;f=d;c[e>>2]=a;c[f>>2]=b;if(!(c[f>>2]|0)){g=0;i=d;return g|0}g=(c[e>>2]&127)<<24|c[f>>2]&65535;i=d;return g|0}function Rj(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,k=0;e=i;i=i+16|0;if((i|0)>=(j|0))U();f=e+12|0;g=e+8|0;h=e+4|0;k=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;c[k>>2]=c[f>>2];f=Sj(c[k>>2]|0,c[g>>2]|0,c[h>>2]|0)|0;i=e;return f|0}function Sj(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,D=0;g=i;i=i+144|0;if((i|0)>=(j|0))U();h=g+72|0;k=g+132|0;l=g+128|0;m=g+124|0;n=g+120|0;o=g+116|0;p=g+112|0;q=g+108|0;r=g+104|0;s=g+100|0;t=g+96|0;u=g+92|0;v=g+88|0;w=g+8|0;x=g+84|0;y=g+80|0;z=g+136|0;A=g;B=g+76|0;c[l>>2]=b;c[m>>2]=e;c[n>>2]=f;c[t>>2]=0;f=(Jg()|0)!=0;if(!(f|(c[17655]|0)!=0)?(c[17655]=1,c[17656]=Tj()|0,c[17656]|0):0){c[h>>2]=c[17656];Ie(43523,h)}if(c[17656]|0){c[k>>2]=50;D=c[k>>2]|0;i=g;return D|0}do if((c[n>>2]|0)==16){c[o>>2]=10;c[u>>2]=4}else{if((c[n>>2]|0)==24){c[o>>2]=12;c[u>>2]=6;break}if((c[n>>2]|0)==32){c[o>>2]=14;c[u>>2]=8;break}c[k>>2]=44;D=c[k>>2]|0;i=g;return D|0}while(0);c[(c[l>>2]|0)+480>>2]=c[o>>2];h=(c[l>>2]|0)+484|0;a[h>>0]=a[h>>0]&-2;c[(c[l>>2]|0)+488>>2]=29;c[(c[l>>2]|0)+492>>2]=30;c[(c[l>>2]|0)+496>>2]=1;c[(c[l>>2]|0)+500>>2]=2;c[v>>2]=4573;Zj();c[p>>2]=0;while(1){if((c[p>>2]|0)>>>0>=(c[n>>2]|0)>>>0)break;a[w+(c[p>>2]>>2<<2)+(c[p>>2]&3)>>0]=a[(c[m>>2]|0)+(c[p>>2]|0)>>0]|0;c[p>>2]=(c[p>>2]|0)+1}c[q>>2]=(c[u>>2]|0)-1;while(1){if((c[q>>2]|0)<0)break;c[w+32+(c[q>>2]<<2)>>2]=c[w+(c[q>>2]<<2)>>2];c[q>>2]=(c[q>>2]|0)+-1}c[r>>2]=0;c[s>>2]=0;c[q>>2]=0;while(1){if((c[q>>2]|0)>=(c[u>>2]|0))break;if((c[r>>2]|0)>=((c[o>>2]|0)+1|0))break;while(1){if(!((c[q>>2]|0)<(c[u>>2]|0)?(c[s>>2]|0)<4:0))break;c[(c[l>>2]|0)+(c[r>>2]<<4)+(c[s>>2]<<2)>>2]=c[w+32+(c[q>>2]<<2)>>2];c[q>>2]=(c[q>>2]|0)+1;c[s>>2]=(c[s>>2]|0)+1}if((c[s>>2]|0)!=4)continue;c[r>>2]=(c[r>>2]|0)+1;c[s>>2]=0}a:while(1){if((c[r>>2]|0)>=((c[o>>2]|0)+1|0))break;p=w+32|0;a[p>>0]=(d[p>>0]|0)^(d[(c[v>>2]|0)+((d[w+32+((c[u>>2]|0)-1<<2)+1>>0]|0)<<2)>>0]|0);p=w+32+1|0;a[p>>0]=(d[p>>0]|0)^(d[(c[v>>2]|0)+((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]|0);c[q>>2]=((c[u>>2]|0)/2|0)+1;while(1){if((c[q>>2]|0)>=(c[u>>2]|0))break b;m=w+32+(c[q>>2]<<2)|0;c[m>>2]=c[m>>2]^c[w+32+((c[q>>2]|0)-1<<2)>>2];c[q>>2]=(c[q>>2]|0)+1}}while(0);c[q>>2]=0;while(1){if((c[q>>2]|0)>=(c[u>>2]|0))continue a;if((c[r>>2]|0)>=((c[o>>2]|0)+1|0))continue a;while(1){if(!((c[q>>2]|0)<(c[u>>2]|0)?(c[s>>2]|0)<4:0))break;c[(c[l>>2]|0)+(c[r>>2]<<4)+(c[s>>2]<<2)>>2]=c[w+32+(c[q>>2]<<2)>>2];c[q>>2]=(c[q>>2]|0)+1;c[s>>2]=(c[s>>2]|0)+1}if((c[s>>2]|0)!=4)continue;c[r>>2]=(c[r>>2]|0)+1;c[s>>2]=0}}c[x>>2]=w;c[y>>2]=64;a[z>>0]=0;w=A;c[w>>2]=d[z>>0];c[w+4>>2]=0;while(1){if(!(c[x>>2]&7|0?(c[y>>2]|0)!=0:0))break;a[c[x>>2]>>0]=a[z>>0]|0;c[x>>2]=(c[x>>2]|0)+1;c[y>>2]=(c[y>>2]|0)+-1}if((c[y>>2]|0)>>>0>=8){w=A;s=Xw(c[w>>2]|0,c[w+4>>2]|0,16843009,16843009)|0;w=A;c[w>>2]=s;c[w+4>>2]=C;do{c[B>>2]=c[x>>2];w=A;s=c[w+4>>2]|0;r=c[B>>2]|0;c[r>>2]=c[w>>2];c[r+4>>2]=s;c[y>>2]=(c[y>>2]|0)-8;c[x>>2]=(c[x>>2]|0)+8}while((c[y>>2]|0)>>>0>=8)}while(1){if(!(c[y>>2]|0))break;a[c[x>>2]>>0]=a[z>>0]|0;c[x>>2]=(c[x>>2]|0)+1;c[y>>2]=(c[y>>2]|0)+-1}c[k>>2]=0;D=c[k>>2]|0;i=g;return D|0}function Tj(){var a=0,b=0,d=0,e=0,f=0,g=0;a=i;i=i+16|0;if((i|0)>=(j|0))U();b=a+4|0;d=a;e=Uj()|0;c[d>>2]=e;do if((!(e|0)?(f=bk()|0,c[d>>2]=f,!(f|0)):0)?(f=ck()|0,c[d>>2]=f,!(f|0)):0){f=dk()|0;c[d>>2]=f;if(f|0){c[b>>2]=c[d>>2];break}f=gk()|0;c[d>>2]=f;if(f|0){c[b>>2]=c[d>>2];break}else{c[d>>2]=jk()|0;c[b>>2]=c[d>>2];break}}else g=4;while(0);if((g|0)==4)c[b>>2]=c[d>>2];i=a;return c[b>>2]|0}function Uj(){var a=0,b=0,d=0,e=0;a=i;i=i+528|0;if((i|0)>=(j|0))U();b=a+504|0;d=a;e=a+512|0;Rj(d,37970,16)|0;Vj(d,e,37986)|0;do if(!(vv(e,38002,16)|0)){Wj(d,e,e)|0;if(vv(e,37986,16)|0){c[b>>2]=38050;break}else{c[b>>2]=0;break}}else c[b>>2]=38018;while(0);i=a;return c[b>>2]|0}function Vj(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,k=0;e=i;i=i+16|0;if((i|0)>=(j|0))U();f=e+12|0;g=e+8|0;h=e+4|0;k=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;c[k>>2]=c[f>>2];if(c[(c[k>>2]|0)+496>>2]|0)yb[c[(c[k>>2]|0)+496>>2]&3]();f=sb[c[(c[k>>2]|0)+488>>2]&63](c[k>>2]|0,c[g>>2]|0,c[h>>2]|0)|0;i=e;return f|0}function Wj(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,k=0;e=i;i=i+16|0;if((i|0)>=(j|0))U();f=e+12|0;g=e+8|0;h=e+4|0;k=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;c[k>>2]=c[f>>2];Xj(c[k>>2]|0);if(c[(c[k>>2]|0)+500>>2]|0)yb[c[(c[k>>2]|0)+500>>2]&3]();f=sb[c[(c[k>>2]|0)+492>>2]&63](c[k>>2]|0,c[g>>2]|0,c[h>>2]|0)|0;i=e;return f|0}function Xj(b){b=b|0;var d=0,e=0;d=i;i=i+16|0;if((i|0)>=(j|0))U();e=d;c[e>>2]=b;if(a[(c[e>>2]|0)+484>>0]&1|0){i=d;return}Yj(c[e>>2]|0);b=(c[e>>2]|0)+484|0;a[b>>0]=a[b>>0]&-2|1;i=d;return}function Yj(a){a=a|0;var b=0,e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0;b=i;i=i+32|0;if((i|0)>=(j|0))U();e=b+20|0;f=b+16|0;g=b+12|0;h=b+8|0;k=b+4|0;l=b;c[e>>2]=a;c[g>>2]=4573;Zj();$j();c[(c[e>>2]|0)+240>>2]=c[c[e>>2]>>2];c[(c[e>>2]|0)+240+4>>2]=c[(c[e>>2]|0)+4>>2];c[(c[e>>2]|0)+240+8>>2]=c[(c[e>>2]|0)+8>>2];c[(c[e>>2]|0)+240+12>>2]=c[(c[e>>2]|0)+12>>2];c[f>>2]=1;while(1){m=(c[e>>2]|0)+(c[f>>2]<<4)|0;if((c[f>>2]|0)>=(c[(c[e>>2]|0)+480>>2]|0))break;c[h>>2]=m;c[k>>2]=(c[e>>2]|0)+240+(c[f>>2]<<4);c[l>>2]=c[c[h>>2]>>2];a=ak(c[5596+((d[(c[g>>2]|0)+(((c[l>>2]|0)>>>0&255)<<2)>>0]|0)<<2)>>2]|0,0)|0;n=a^(ak(c[5596+((d[(c[g>>2]|0)+(((c[l>>2]|0)>>>8&255)<<2)>>0]|0)<<2)>>2]|0,8)|0);a=n^(ak(c[5596+((d[(c[g>>2]|0)+(((c[l>>2]|0)>>>16&255)<<2)>>0]|0)<<2)>>2]|0,16)|0);n=a^(ak(c[5596+((d[(c[g>>2]|0)+(((c[l>>2]|0)>>>24&255)<<2)>>0]|0)<<2)>>2]|0,24)|0);c[c[k>>2]>>2]=n;c[l>>2]=c[(c[h>>2]|0)+4>>2];n=ak(c[5596+((d[(c[g>>2]|0)+(((c[l>>2]|0)>>>0&255)<<2)>>0]|0)<<2)>>2]|0,0)|0;a=n^(ak(c[5596+((d[(c[g>>2]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<4)+4>>2];c[(c[e>>2]|0)+240+(c[f>>2]<<4)+8>>2]=c[(c[e>>2]|0)+(c[f>>2]<<4)+8>>2];c[(c[e>>2]|0)+240+(c[f>>2]<<4)+12>>2]=c[(c[e>>2]|0)+(c[f>>2]<<4)+12>>2];i=b;return}function Zj(){_j(4572,1024);return}function _j(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=i;i=i+16|0;if((i|0)>=(j|0))U();e=d+4|0;f=d;c[d+8>>2]=a;c[e>>2]=b;c[f>>2]=0;while(1){if((c[f>>2]|0)>>>0>=(c[e>>2]|0)>>>0)break;c[f>>2]=(c[f>>2]|0)+256}i=d;return}function $j(){_j(5596,1280);return}function ak(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=i;i=i+16|0;if((i|0)>=(j|0))U();e=d+4|0;f=d;c[e>>2]=a;c[f>>2]=b;i=d;return c[e>>2]<<(c[f>>2]&31)|(c[e>>2]|0)>>>(32-(c[f>>2]|0)&31)|0}function bk(){var a=0,b=0,d=0,e=0;a=i;i=i+528|0;if((i|0)>=(j|0))U();b=a+504|0;d=a;e=a+512|0;Rj(d,38082,24)|0;Vj(d,e,38106)|0;do if(!(vv(e,38122,16)|0)){Wj(d,e,e)|0;if(vv(e,38106,16)|0){c[b>>2]=38170;break}else{c[b>>2]=0;break}}else c[b>>2]=38138;while(0);i=a;return c[b>>2]|0}function ck(){var a=0,b=0,d=0,e=0;a=i;i=i+528|0;if((i|0)>=(j|0))U();b=a+504|0;d=a;e=a+512|0;Rj(d,38202,32)|0;Vj(d,e,38234)|0;do if(!(vv(e,38250,16)|0)){Wj(d,e,e)|0;if(vv(e,38234,16)|0){c[b>>2]=38298;break}else{c[b>>2]=0;break}}else c[b>>2]=38266;while(0);i=a;return c[b>>2]|0}function dk(){var a=0,b=0;a=i;i=i+16|0;if((i|0)>=(j|0))U();c[a+8>>2]=9;c[a+4>>2]=16;c[a>>2]=504;b=jr(37850,1,2,4,9,16,504)|0;i=a;return b|0}function ek(b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do{c[B>>2]=c[x>>2];v=A;p=c[v+4>>2]|0;u=c[B>>2]|0;c[u>>2]=c[v>>2];c[u+4>>2]=p;c[y>>2]=(c[y>>2]|0)-8;c[x>>2]=(c[x>>2]|0)+8}while((c[y>>2]|0)>>>0>=8)}while(1){if(!(c[y>>2]|0))break;a[c[x>>2]>>0]=a[z>>0]|0;c[x>>2]=(c[x>>2]|0)+1;c[y>>2]=(c[y>>2]|0)+-1}if(!(c[t>>2]|0)){i=k;return}Qe((c[t>>2]|0)+16|0);Re();i=k;return}function fk(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;h=i;i=i+48|0;if((i|0)>=(j|0))U();k=h+40|0;l=h+36|0;m=h+32|0;n=h+28|0;o=h+24|0;p=h+20|0;q=h+16|0;r=h+12|0;s=h+8|0;t=h+4|0;c[k>>2]=b;c[l>>2]=e;c[m>>2]=f;c[n>>2]=g;c[o>>2]=c[k>>2];c[p>>2]=c[l>>2];c[q>>2]=c[m>>2];c[h>>2]=3;if(!((c[o>>2]|c[p>>2]|c[q>>2])&3)){c[r>>2]=c[o>>2];c[s>>2]=c[p>>2];c[t>>2]=c[q>>2];while(1){if((c[n>>2]|0)>>>0<4)break;m=c[s>>2]|0;c[s>>2]=m+4;l=c[m>>2]|0;m=c[t>>2]|0;c[t>>2]=m+4;k=l^c[m>>2];m=c[r>>2]|0;c[r>>2]=m+4;c[m>>2]=k;c[n>>2]=(c[n>>2]|0)-4}c[o>>2]=c[r>>2];c[p>>2]=c[s>>2];c[q>>2]=c[t>>2]}while(1){if(!(c[n>>2]|0))break;t=c[p>>2]|0;c[p>>2]=t+1;s=d[t>>0]|0;t=c[q>>2]|0;c[q>>2]=t+1;r=(s^(d[t>>0]|0))&255;t=c[o>>2]|0;c[o>>2]=t+1;a[t>>0]=r;c[n>>2]=(c[n>>2]|0)+-1}i=h;return}function gk(){var a=0,b=0;a=i;i=i+16|0;if((i|0)>=(j|0))U();c[a+8>>2]=10;c[a+4>>2]=16;c[a>>2]=504;b=fr(37850,1,2,3,10,16,504)|0;i=a;return b|0}function hk(b,e,f,g,h){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0;k=i;i=i+80|0;if((i|0)>=(j|0))U();l=k+72|0;m=k+68|0;n=k+64|0;o=k+60|0;p=k+56|0;q=k+52|0;r=k+48|0;s=k+44|0;t=k+40|0;u=k;v=k+36|0;w=k+32|0;x=k+28|0;y=k+76|0;z=k+16|0;A=k+24|0;c[l>>2]=b;c[m>>2]=e;c[n>>2]=f;c[o>>2]=g;c[p>>2]=h;c[q>>2]=c[l>>2];c[r>>2]=c[n>>2];c[s>>2]=c[o>>2];c[t>>2]=0;Xj(c[q>>2]|0);if(c[(c[q>>2]|0)+500>>2]|0)yb[c[(c[q>>2]|0)+500>>2]&3]();c[v>>2]=c[(c[q>>2]|0)+492>>2];while(1){if(!(c[p>>2]|0))break;c[t>>2]=sb[c[v>>2]&63](c[q>>2]|0,u,c[s>>2]|0)|0;ik(c[r>>2]|0,u,c[m>>2]|0,c[s>>2]|0,16);c[s>>2]=(c[s>>2]|0)+16;c[r>>2]=(c[r>>2]|0)+16;c[p>>2]=(c[p>>2]|0)+-1}c[w>>2]=u;c[x>>2]=16;a[y>>0]=0;u=z;c[u>>2]=d[y>>0];c[u+4>>2]=0;while(1){if(!(c[w>>2]&7|0?(c[x>>2]|0)!=0:0))break;a[c[w>>2]>>0]=a[y>>0]|0;c[w>>2]=(c[w>>2]|0)+1;c[x>>2]=(c[x>>2]|0)+-1}if((c[x>>2]|0)>>>0>=8){u=z;p=Xw(c[u>>2]|0,c[u+4>>2]|0,16843009,16843009)|0;u=z;c[u>>2]=p;c[u+4>>2]=C;do{c[A>>2]=c[w>>2];u=z;p=c[u+4>>2]|0;r=c[A>>2]|0;c[r>>2]=c[u>>2];c[r+4>>2]=p;c[x>>2]=(c[x>>2]|0)-8;c[w>>2]=(c[w>>2]|0)+8}while((c[x>>2]|0)>>>0>=8)}while(1){if(!(c[x>>2]|0))break;a[c[w>>2]>>0]=a[y>>0]|0;c[w>>2]=(c[w>>2]|0)+1;c[x>>2]=(c[x>>2]|0)+-1}if(!(c[t>>2]|0)){i=k;return}Qe((c[t>>2]|0)+16|0);Re();i=k;return}function ik(b,e,f,g,h){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0;k=i;i=i+64|0;if((i|0)>=(j|0))U();l=k+56|0;m=k+52|0;n=k+48|0;o=k+44|0;p=k+40|0;q=k+36|0;r=k+32|0;s=k+28|0;t=k+24|0;u=k+60|0;v=k+20|0;w=k+16|0;x=k+12|0;y=k+8|0;z=k+4|0;c[l>>2]=b;c[m>>2]=e;c[n>>2]=f;c[o>>2]=g;c[p>>2]=h;c[q>>2]=c[l>>2];c[r>>2]=c[n>>2];c[s>>2]=c[m>>2];c[t>>2]=c[o>>2];c[k>>2]=3;if(!((c[t>>2]|c[s>>2]|c[q>>2]|c[r>>2])&3)){c[v>>2]=c[q>>2];c[y>>2]=c[s>>2];c[w>>2]=c[r>>2];c[x>>2]=c[t>>2];while(1){if((c[p>>2]|0)>>>0<4)break;o=c[x>>2]|0;c[x>>2]=o+4;c[z>>2]=c[o>>2];o=c[c[w>>2]>>2]|0;m=c[y>>2]|0;c[y>>2]=m+4;n=o^c[m>>2];m=c[v>>2]|0;c[v>>2]=m+4;c[m>>2]=n;n=c[z>>2]|0;m=c[w>>2]|0;c[w>>2]=m+4;c[m>>2]=n;c[p>>2]=(c[p>>2]|0)-4}c[q>>2]=c[v>>2];c[s>>2]=c[y>>2];c[r>>2]=c[w>>2];c[t>>2]=c[x>>2]}while(1){if(!(c[p>>2]|0))break;x=c[t>>2]|0;c[t>>2]=x+1;a[u>>0]=a[x>>0]|0;x=d[c[r>>2]>>0]|0;w=c[s>>2]|0;c[s>>2]=w+1;y=(x^(d[w>>0]|0))&255;w=c[q>>2]|0;c[q>>2]=w+1;a[w>>0]=y;y=a[u>>0]|0;w=c[r>>2]|0;c[r>>2]=w+1;a[w>>0]=y;c[p>>2]=(c[p>>2]|0)+-1}i=k;return}function jk(){var a=0,b=0;a=i;i=i+16|0;if((i|0)>=(j|0))U();c[a+8>>2]=10;c[a+4>>2]=16;c[a>>2]=504;b=hr(37850,1,2,2,10,16,504)|0;i=a;return b|0}function kk(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;g=i;i=i+48|0;if((i|0)>=(j|0))U();h=g+36|0;k=g+32|0;l=g+28|0;m=g+24|0;n=g+20|0;o=g+16|0;p=g+12|0;q=g+8|0;r=g+4|0;s=g;c[h>>2]=a;c[k>>2]=b;c[l>>2]=d;c[m>>2]=e;c[n>>2]=f;c[o>>2]=c[h>>2];c[p>>2]=c[l>>2];c[q>>2]=c[m>>2];c[r>>2]=0;if(c[(c[o>>2]|0)+496>>2]|0)yb[c[(c[o>>2]|0)+496>>2]&3]();c[s>>2]=c[(c[o>>2]|0)+488>>2];while(1){if(!(c[n>>2]|0))break;c[r>>2]=sb[c[s>>2]&63](c[o>>2]|0,c[k>>2]|0,c[k>>2]|0)|0;lk(c[p>>2]|0,c[k>>2]|0,c[q>>2]|0,16);c[p>>2]=(c[p>>2]|0)+16;c[q>>2]=(c[q>>2]|0)+16;c[n>>2]=(c[n>>2]|0)+-1}if(!(c[r>>2]|0)){i=g;return}Qe((c[r>>2]|0)+16|0);Re();i=g;return}function lk(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,k=0,l=0;f=i;i=i+16|0;if((i|0)>=(j|0))U();g=f+12|0;h=f+8|0;k=f+4|0;l=f;c[g>>2]=a;c[h>>2]=b;c[k>>2]=d;c[l>>2]=e;ik(c[g>>2]|0,c[k>>2]|0,c[h>>2]|0,c[k>>2]|0,c[l>>2]|0);i=f;return}function mk(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=i;i=i+16|0;if((i|0)>=(j|0))U();f=e+8|0;g=e+4|0;h=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;d=nk(c[f>>2]|0,c[g>>2]|0,c[h>>2]|0)|0;i=e;return d|0}function nk(a,b,e){a=a|0;b=b|0;e=e|0;var f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;f=i;i=i+64|0;if((i|0)>=(j|0))U();g=f+52|0;h=f+48|0;k=f+44|0;l=f+40|0;m=f+36|0;n=f+32|0;o=f+16|0;p=f;c[g>>2]=a;c[h>>2]=b;c[k>>2]=e;c[l>>2]=4573;c[m>>2]=c[(c[g>>2]|0)+480>>2];c[p>>2]=ok(c[k>>2]|0)|0;c[p+4>>2]=ok((c[k>>2]|0)+4|0)|0;c[p+8>>2]=ok((c[k>>2]|0)+8|0)|0;c[p+12>>2]=ok((c[k>>2]|0)+12|0)|0;c[o>>2]=c[p>>2]^c[c[g>>2]>>2];c[o+4>>2]=c[p+4>>2]^c[(c[g>>2]|0)+4>>2];c[o+8>>2]=c[p+8>>2]^c[(c[g>>2]|0)+8>>2];c[o+12>>2]=c[p+12>>2]^c[(c[g>>2]|0)+12>>2];c[p>>2]=ak(c[4572+(((c[o>>2]|0)>>>0&255)<<2)>>2]|0,0)|0;c[p+12>>2]=ak(c[4572+(((c[o>>2]|0)>>>8&255)<<2)>>2]|0,8)|0;c[p+8>>2]=ak(c[4572+(((c[o>>2]|0)>>>16&255)<<2)>>2]|0,16)|0;c[p+4>>2]=ak(c[4572+(((c[o>>2]|0)>>>24&255)<<2)>>2]|0,24)|0;c[o>>2]=c[(c[g>>2]|0)+16>>2]^c[p>>2];k=ak(c[4572+(((c[o+4>>2]|0)>>>0&255)<<2)>>2]|0,0)|0;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0)+1>>0]|0)<<8|(d[c[f>>2]>>0]|0)|0}function pk(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=i;i=i+16|0;if((i|0)>=(j|0))U();f=e+8|0;g=e+4|0;h=e;c[f>>2]=b;c[g>>2]=d;c[h>>2]=c[f>>2];a[(c[h>>2]|0)+3>>0]=(c[g>>2]|0)>>>24;a[(c[h>>2]|0)+2>>0]=(c[g>>2]|0)>>>16;a[(c[h>>2]|0)+1>>0]=(c[g>>2]|0)>>>8;a[c[h>>2]>>0]=c[g>>2];i=e;return}function qk(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=i;i=i+16|0;if((i|0)>=(j|0))U();f=e+8|0;g=e+4|0;h=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;d=rk(c[f>>2]|0,c[g>>2]|0,c[h>>2]|0)|0;i=e;return d|0}function rk(a,b,e){a=a|0;b=b|0;e=e|0;var f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0;f=i;i=i+64|0;if((i|0)>=(j|0))U();g=f+48|0;h=f+44|0;k=f+40|0;l=f+36|0;m=f+32|0;n=f+16|0;o=f;c[g>>2]=a;c[h>>2]=b;c[k>>2]=e;c[l>>2]=c[(c[g>>2]|0)+480>>2];c[o>>2]=ok(c[k>>2]|0)|0;c[o+4>>2]=ok((c[k>>2]|0)+4|0)|0;c[o+8>>2]=ok((c[k>>2]|0)+8|0)|0;c[o+12>>2]=ok((c[k>>2]|0)+12|0)|0;c[n>>2]=c[o>>2]^c[(c[g>>2]|0)+240+(c[l>>2]<<4)>>2];c[n+4>>2]=c[o+4>>2]^c[(c[g>>2]|0)+240+(c[l>>2]<<4)+4>>2];c[n+8>>2]=c[o+8>>2]^c[(c[g>>2]|0)+240+(c[l>>2]<<4)+8>>2];c[n+12>>2]=c[o+12>>2]^c[(c[g>>2]|0)+240+(c[l>>2]<<4)+12>>2];c[m>>2]=(c[l>>2]|0)-1;while(1){l=(c[m>>2]|0)>1;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]|0,8)|0;l=o+12|0;c[l>>2]=c[l>>2]^m;m=ak(c[5596+(((c[n+8>>2]|0)>>>16&255)<<2)>>2]|0,16)|0;c[n>>2]=c[n>>2]^m;m=ak(c[5596+(((c[n+8>>2]|0)>>>24&255)<<2)>>2]|0,24)|0;l=n+4|0;c[l>>2]=c[l>>2]^m;c[n+8>>2]=c[(c[g>>2]|0)+240+16+8>>2]^c[o+8>>2];m=ak(c[5596+(((c[n+12>>2]|0)>>>0&255)<<2)>>2]|0,0)|0;l=o+12|0;c[l>>2]=c[l>>2]^m;m=ak(c[5596+(((c[n+12>>2]|0)>>>8&255)<<2)>>2]|0,8)|0;c[n>>2]=c[n>>2]^m;m=ak(c[5596+(((c[n+12>>2]|0)>>>16&255)<<2)>>2]|0,16)|0;l=n+4|0;c[l>>2]=c[l>>2]^m;m=ak(c[5596+(((c[n+12>>2]|0)>>>24&255)<<2)>>2]|0,24)|0;l=n+8|0;c[l>>2]=c[l>>2]^m;c[n+12>>2]=c[(c[g>>2]|0)+240+16+12>>2]^c[o+12>>2];c[o>>2]=(d[6620+((c[n>>2]|0)>>>0&255)>>0]|0)<<0;c[o+4>>2]=(d[6620+((c[n>>2]|0)>>>8&255)>>0]|0)<<8;c[o+8>>2]=(d[6620+((c[n>>2]|0)>>>16&255)>>0]|0)<<16;c[o+12>>2]=(d[6620+((c[n>>2]|0)>>>24&255)>>0]|0)<<24;c[n>>2]=c[o>>2]^c[(c[g>>2]|0)+240>>2];m=o+4|0;c[m>>2]=c[m>>2]^(d[6620+((c[n+4>>2]|0)>>>0&255)>>0]|0)<<0;m=o+8|0;c[m>>2]=c[m>>2]^(d[6620+((c[n+4>>2]|0)>>>8&255)>>0]|0)<<8;m=o+12|0;c[m>>2]=c[m>>2]^(d[6620+((c[n+4>>2]|0)>>>16&255)>>0]|0)<<16;c[n>>2]=c[n>>2]^(d[6620+((c[n+4>>2]|0)>>>24&255)>>0]|0)<<24;c[n+4>>2]=c[o+4>>2]^c[(c[g>>2]|0)+240+4>>2];m=o+8|0;c[m>>2]=c[m>>2]^(d[6620+((c[n+8>>2]|0)>>>0&255)>>0]|0)<<0;m=o+12|0;c[m>>2]=c[m>>2]^(d[6620+((c[n+8>>2]|0)>>>8&255)>>0]|0)<<8;c[n>>2]=c[n>>2]^(d[6620+((c[n+8>>2]|0)>>>16&255)>>0]|0)<<16;m=n+4|0;c[m>>2]=c[m>>2]^(d[6620+((c[n+8>>2]|0)>>>24&255)>>0]|0)<<24;c[n+8>>2]=c[o+8>>2]^c[(c[g>>2]|0)+240+8>>2];m=o+12|0;c[m>>2]=c[m>>2]^(d[6620+((c[n+12>>2]|0)>>>0&255)>>0]|0)<<0;c[n>>2]=c[n>>2]^(d[6620+((c[n+12>>2]|0)>>>8&255)>>0]|0)<<8;m=n+4|0;c[m>>2]=c[m>>2]^(d[6620+((c[n+12>>2]|0)>>>16&255)>>0]|0)<<16;m=n+8|0;c[m>>2]=c[m>>2]^(d[6620+((c[n+12>>2]|0)>>>24&255)>>0]|0)<<24;c[n+12>>2]=c[o+12>>2]^c[(c[g>>2]|0)+240+12>>2];pk(c[h>>2]|0,c[n>>2]|0);pk((c[h>>2]|0)+4|0,c[n+4>>2]|0);pk((c[h>>2]|0)+8|0,c[n+8>>2]|0);pk((c[h>>2]|0)+12|0,c[n+12>>2]|0);i=f;return 64}function sk(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,k=0;e=i;i=i+16|0;if((i|0)>=(j|0))U();f=e+12|0;g=e+8|0;h=e+4|0;k=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;switch(c[f>>2]|0){case 7:{c[k>>2]=tk(c[g>>2]|0,c[h>>2]|0)|0;break}case 8:{c[k>>2]=vk(c[g>>2]|0,c[h>>2]|0)|0;break}case 9:{c[k>>2]=wk(c[g>>2]|0,c[h>>2]|0)|0;break}default:c[k>>2]=12}i=e;return c[k>>2]|0}function tk(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,k=0,l=0;d=i;i=i+32|0;if((i|0)>=(j|0))U();e=d+16|0;f=d+12|0;g=d+8|0;h=d+4|0;k=d;c[f>>2]=a;c[g>>2]=b;c[h>>2]=49643;c[k>>2]=Uj()|0;do if(!(c[k>>2]|0)){if(c[f>>2]|0){c[h>>2]=38330;c[k>>2]=uk(2)|0;if(c[k>>2]|0)break;c[h>>2]=38447;c[k>>2]=uk(5)|0;if(c[k>>2]|0)break}c[e>>2]=0;l=c[e>>2]|0;i=d;return l|0}while(0);if(c[g>>2]|0)Cb[c[g>>2]&1](38451,7,c[h>>2]|0,c[k>>2]|0);c[e>>2]=50;l=c[e>>2]|0;i=d;return l|0}function uk(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0;b=i;i=i+48|0;if((i|0)>=(j|0))U();d=b+24|0;e=b+20|0;f=b+32|0;g=b+16|0;h=b+12|0;k=b+8|0;l=b+4|0;m=b;c[e>>2]=a;c[l>>2]=0;c[m>>2]=0;c[h>>2]=0;while(1){if((c[h>>2]|0)>>>0>=2)break;if((c[6996+((c[h>>2]|0)*164|0)>>2]|0)==(c[e>>2]|0))break;c[h>>2]=(c[h>>2]|0)+1}if((c[h>>2]|0)==2){oh(c[l>>2]|0);oh(c[m>>2]|0);c[d>>2]=38334;n=c[d>>2]|0;i=b;return n|0}c[g>>2]=jh(l,7,c[6996+((c[h>>2]|0)*164|0)>>2]|0,0)|0;if(c[g>>2]|0){oh(c[l>>2]|0);oh(c[m>>2]|0);c[d>>2]=38361;n=c[d>>2]|0;i=b;return n|0}c[g>>2]=jh(m,7,c[6996+((c[h>>2]|0)*164|0)>>2]|0,0)|0;e=c[l>>2]|0;if(c[g>>2]|0){oh(e);oh(c[m>>2]|0);c[d>>2]=38361;n=c[d>>2]|0;i=b;return n|0}c[g>>2]=wh(e,6996+((c[h>>2]|0)*164|0)+4|0,16)|0;if(!(c[g>>2]|0))c[g>>2]=wh(c[m>>2]|0,6996+((c[h>>2]|0)*164|0)+4|0,16)|0;e=c[l>>2]|0;if(c[g>>2]|0){oh(e);oh(c[m>>2]|0);c[d>>2]=38366;n=c[d>>2]|0;i=b;return n|0}c[g>>2]=yh(e,6996+((c[h>>2]|0)*164|0)+20|0,16)|0;if(!(c[g>>2]|0))c[g>>2]=yh(c[m>>2]|0,6996+((c[h>>2]|0)*164|0)+20|0,16)|0;if(c[g>>2]|0){oh(c[l>>2]|0);oh(c[m>>2]|0);c[d>>2]=38374;n=c[d>>2]|0;i=b;return n|0}c[k>>2]=0;while(1){o=c[l>>2]|0;if((c[k>>2]|0)>>>0>=4){p=30;break}c[g>>2]=ph(o,f,16,6996+((c[h>>2]|0)*164|0)+36+(c[k>>2]<<5)|0,16)|0;if(c[g>>2]|0){p=22;break}if(vv(f,6996+((c[h>>2]|0)*164|0)+36+(c[k>>2]<<5)+16|0,16)|0){p=24;break}c[g>>2]=th(c[m>>2]|0,f,16,6996+((c[h>>2]|0)*164|0)+36+(c[k>>2]<<5)+16|0,16)|0;if(c[g>>2]|0){p=26;break}if(vv(f,6996+((c[h>>2]|0)*164|0)+36+(c[k>>2]<<5)|0,16)|0){p=28;break}c[k>>2]=(c[k>>2]|0)+1}if((p|0)==22){oh(c[l>>2]|0);oh(c[m>>2]|0);c[d>>2]=38381;n=c[d>>2]|0;i=b;return n|0}else if((p|0)==24){oh(c[l>>2]|0);oh(c[m>>2]|0);c[d>>2]=38397;n=c[d>>2]|0;i=b;return n|0}else if((p|0)==26){oh(c[l>>2]|0);oh(c[m>>2]|0);c[d>>2]=38414;n=c[d>>2]|0;i=b;return n|0}else if((p|0)==28){oh(c[l>>2]|0);oh(c[m>>2]|0);c[d>>2]=38430;n=c[d>>2]|0;i=b;return n|0}else if((p|0)==30){oh(o);oh(c[m>>2]|0);c[d>>2]=0;n=c[d>>2]|0;i=b;return n|0}return 0}function vk(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,k=0;d=i;i=i+32|0;if((i|0)>=(j|0))U();e=d+16|0;f=d+8|0;g=d+4|0;h=d;c[d+12>>2]=a;c[f>>2]=b;c[g>>2]=49643;c[h>>2]=bk()|0;if(!(c[h>>2]|0)){c[e>>2]=0;k=c[e>>2]|0;i=d;return k|0}if(c[f>>2]|0)Cb[c[f>>2]&1](38451,8,c[g>>2]|0,c[h>>2]|0);c[e>>2]=50;k=c[e>>2]|0;i=d;return k|0}function wk(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,k=0;d=i;i=i+32|0;if((i|0)>=(j|0))U();e=d+16|0;f=d+8|0;g=d+4|0;h=d;c[d+12>>2]=a;c[f>>2]=b;c[g>>2]=49643;c[h>>2]=ck()|0;if(!(c[h>>2]|0)){c[e>>2]=0;k=c[e>>2]|0;i=d;return k|0}if(c[f>>2]|0)Cb[c[f>>2]&1](38451,9,c[g>>2]|0,c[h>>2]|0);c[e>>2]=50;k=c[e>>2]|0;i=d;return k|0}function xk(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;g=i;i=i+48|0;if((i|0)>=(j|0))U();h=g+36|0;k=g+32|0;l=g+28|0;m=g+24|0;n=g+20|0;o=g+16|0;p=g+12|0;q=g+8|0;r=g+4|0;s=g;c[h>>2]=a;c[k>>2]=b;c[l>>2]=d;c[m>>2]=e;c[n>>2]=f;c[o>>2]=c[h>>2];c[p>>2]=c[l>>2];c[q>>2]=c[m>>2];c[r>>2]=0;if(c[(c[o>>2]|0)+496>>2]|0)yb[c[(c[o>>2]|0)+496>>2]&3]();c[s>>2]=c[(c[o>>2]|0)+488>>2];while(1){if(!(c[n>>2]|0))break;c[r>>2]=sb[c[s>>2]&63](c[o>>2]|0,c[k>>2]|0,c[k>>2]|0)|0;yk(c[p>>2]|0,c[k>>2]|0,c[q>>2]|0,16);c[p>>2]=(c[p>>2]|0)+16;c[q>>2]=(c[q>>2]|0)+16;c[n>>2]=(c[n>>2]|0)+-1}if(!(c[r>>2]|0)){i=g;return}Qe((c[r>>2]|0)+16|0);Re();i=g;return}function yk(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;h=i;i=i+48|0;if((i|0)>=(j|0))U();k=h+40|0;l=h+36|0;m=h+32|0;n=h+28|0;o=h+24|0;p=h+20|0;q=h+16|0;r=h+12|0;s=h+8|0;t=h+4|0;c[k>>2]=b;c[l>>2]=e;c[m>>2]=f;c[n>>2]=g;c[o>>2]=c[k>>2];c[p>>2]=c[l>>2];c[q>>2]=c[m>>2];c[h>>2]=3;if(!((c[q>>2]|c[o>>2]|c[p>>2])&3)){c[r>>2]=c[o>>2];c[s>>2]=c[p>>2];c[t>>2]=c[q>>2];while(1){if((c[n>>2]|0)>>>0<4)break;m=c[t>>2]|0;c[t>>2]=m+4;l=c[m>>2]|0;m=c[s>>2]|0;c[s>>2]=m+4;k=c[m>>2]^l;c[m>>2]=k;m=c[r>>2]|0;c[r>>2]=m+4;c[m>>2]=k;c[n>>2]=(c[n>>2]|0)-4}c[o>>2]=c[r>>2];c[p>>2]=c[s>>2];c[q>>2]=c[t>>2]}while(1){if(!(c[n>>2]|0))break;t=c[q>>2]|0;c[q>>2]=t+1;s=d[t>>0]|0;t=c[p>>2]|0;c[p>>2]=t+1;r=((d[t>>0]|0)^s)&255;a[t>>0]=r;t=c[o>>2]|0;c[o>>2]=t+1;a[t>>0]=r;c[n>>2]=(c[n>>2]|0)+-1}i=h;return}function zk(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0;h=i;i=i+48|0;if((i|0)>=(j|0))U();k=h+44|0;l=h+40|0;m=h+36|0;n=h+32|0;o=h+28|0;p=h+24|0;q=h+20|0;r=h+16|0;s=h+12|0;t=h+8|0;u=h+4|0;v=h;c[k>>2]=a;c[l>>2]=b;c[m>>2]=d;c[n>>2]=e;c[o>>2]=f;c[p>>2]=g;c[q>>2]=c[k>>2];c[r>>2]=c[m>>2];c[s>>2]=c[n>>2];c[u>>2]=0;if(c[(c[q>>2]|0)+496>>2]|0)yb[c[(c[q>>2]|0)+496>>2]&3]();c[v>>2]=c[(c[q>>2]|0)+488>>2];c[t>>2]=c[l>>2];while(1){if(!(c[o>>2]|0))break;fk(c[r>>2]|0,c[s>>2]|0,c[t>>2]|0,16);c[u>>2]=sb[c[v>>2]&63](c[q>>2]|0,c[r>>2]|0,c[r>>2]|0)|0;c[t>>2]=c[r>>2];c[s>>2]=(c[s>>2]|0)+16;if(!(c[p>>2]|0))c[r>>2]=(c[r>>2]|0)+16;c[o>>2]=(c[o>>2]|0)+-1}if((c[t>>2]|0)!=(c[l>>2]|0))Ak(c[l>>2]|0,c[t>>2]|0,16);if(!(c[u>>2]|0)){i=h;return}Qe((c[u>>2]|0)+16|0);Re();i=h;return}function Ak(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0;f=i;i=i+32|0;if((i|0)>=(j|0))U();g=f+28|0;h=f+24|0;k=f+20|0;l=f+16|0;m=f+12|0;n=f+8|0;o=f+4|0;c[g>>2]=b;c[h>>2]=d;c[k>>2]=e;c[l>>2]=c[g>>2];c[m>>2]=c[h>>2];c[f>>2]=3;if(!((c[l>>2]|c[m>>2])&3)){c[n>>2]=c[l>>2];c[o>>2]=c[m>>2];while(1){if((c[k>>2]|0)>>>0<4)break;h=c[o>>2]|0;c[o>>2]=h+4;g=c[h>>2]|0;h=c[n>>2]|0;c[n>>2]=h+4;c[h>>2]=g;c[k>>2]=(c[k>>2]|0)-4}c[l>>2]=c[n>>2];c[m>>2]=c[o>>2]}while(1){if(!(c[k>>2]|0))break;o=c[m>>2]|0;c[m>>2]=o+1;n=a[o>>0]|0;o=c[l>>2]|0;c[l>>2]=o+1;a[o>>0]=n;c[k>>2]=(c[k>>2]|0)+-1}i=f;return}function Bk(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0;g=i;i=i+112|0;if((i|0)>=(j|0))U();h=g+104|0;k=g+100|0;l=g+96|0;m=g+92|0;n=g+88|0;o=g+84|0;p=g+80|0;q=g+76|0;r=g+72|0;s=g+16|0;t=g+68|0;u=g+40|0;v=g+64|0;w=g+60|0;x=g;y=g+56|0;z=g+32|0;A=g+52|0;B=g+48|0;c[h>>2]=a;c[k>>2]=b;c[l>>2]=d;c[m>>2]=e;c[n>>2]=f;c[o>>2]=(c[h>>2]|0)+496;c[p>>2]=c[k>>2];c[q>>2]=c[l>>2];c[r>>2]=0;l=c[o>>2]|0;if(c[n>>2]|0){if(c[l+496>>2]|0)yb[c[(c[o>>2]|0)+496>>2]&3]()}else{Xj(l);if(c[(c[o>>2]|0)+500>>2]|0)yb[c[(c[o>>2]|0)+500>>2]&3]()}l=c[o>>2]|0;a:do if(c[n>>2]|0){c[t>>2]=c[l+488>>2];while(1){if(!(c[m>>2]|0))break a;k=(c[h>>2]|0)+128+336|0;f=k;e=Gw(c[f>>2]|0,c[f+4>>2]|0,1,0)|0;f=C;d=k;c[d>>2]=e;c[d+4>>2]=f;d=u;c[d>>2]=e;c[d+4>>2]=f;f=u;c[v>>2]=Ck(c[f>>2]|0,c[f+4>>2]|0)|0;if((c[v>>2]|0)>>>0<16)c[w>>2]=(c[h>>2]|0)+128+32+(c[v>>2]<<4);else{f=u;c[w>>2]=Hq(c[h>>2]|0,s,c[f>>2]|0,c[f+4>>2]|0)|0}Ek((c[h>>2]|0)+64|0,c[w>>2]|0,16);Ak(s,c[q>>2]|0,16);Ek((c[h>>2]|0)+80|0,s,16);Ek(s,(c[h>>2]|0)+64|0,16);c[r>>2]=sb[c[t>>2]&63](c[o>>2]|0,s,s)|0;Ek(s,(c[h>>2]|0)+64|0,16);Ak(c[p>>2]|0,s,16);c[q>>2]=(c[q>>2]|0)+16;c[p>>2]=(c[p>>2]|0)+16;c[m>>2]=(c[m>>2]|0)+-1}}else{c[y>>2]=c[l+492>>2];while(1){if(!(c[m>>2]|0))break a;f=(c[h>>2]|0)+128+336|0;d=f;e=Gw(c[d>>2]|0,c[d+4>>2]|0,1,0)|0;d=C;k=f;c[k>>2]=e;c[k+4>>2]=d;k=z;c[k>>2]=e;c[k+4>>2]=d;d=z;c[A>>2]=Ck(c[d>>2]|0,c[d+4>>2]|0)|0;if((c[A>>2]|0)>>>0<16)c[B>>2]=(c[h>>2]|0)+128+32+(c[A>>2]<<4);else{d=z;c[B>>2]=Hq(c[h>>2]|0,x,c[d>>2]|0,c[d+4>>2]|0)|0}Ek((c[h>>2]|0)+64|0,c[B>>2]|0,16);Ak(x,c[q>>2]|0,16);Ek(x,(c[h>>2]|0)+64|0,16);c[r>>2]=sb[c[y>>2]&63](c[o>>2]|0,x,x)|0;Ek(x,(c[h>>2]|0)+64|0,16);Ek((c[h>>2]|0)+80|0,x,16);Ak(c[p>>2]|0,x,16);c[q>>2]=(c[q>>2]|0)+16;c[p>>2]=(c[p>>2]|0)+16;c[m>>2]=(c[m>>2]|0)+-1}}while(0);if(!(c[r>>2]|0)){i=g;return}Qe((c[r>>2]|0)+16|0);Re();i=g;return}function Ck(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;d=i;i=i+16|0;if((i|0)>=(j|0))U();e=d+8|0;f=d;g=f;c[g>>2]=a;c[g+4>>2]=b;b=f;g=c[b+4>>2]|0;if((c[f>>2]|0)!=0|0!=0){c[e>>2]=Dk(c[b>>2]|0)|0;h=c[e>>2]|0;i=d;return h|0}else{c[e>>2]=32+(Dk(g)|0);h=c[e>>2]|0;i=d;return h|0}return 0}function Dk(a){a=a|0;var b=0,d=0,e=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b;c[d>>2]=a;a=(c[d>>2]|0)!=0;e=Iw(c[d>>2]|0)|0;i=b;return (a?e:32)|0}function Ek(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0;g=i;i=i+32|0;if((i|0)>=(j|0))U();h=g+28|0;k=g+24|0;l=g+20|0;m=g+16|0;n=g+12|0;o=g+8|0;p=g+4|0;c[h>>2]=b;c[k>>2]=e;c[l>>2]=f;c[m>>2]=c[h>>2];c[n>>2]=c[k>>2];c[g>>2]=3;if(!((c[m>>2]|c[n>>2])&3)){c[o>>2]=c[m>>2];c[p>>2]=c[n>>2];while(1){if((c[l>>2]|0)>>>0<4)break;k=c[p>>2]|0;c[p>>2]=k+4;h=c[k>>2]|0;k=c[o>>2]|0;c[o>>2]=k+4;c[k>>2]=c[k>>2]^h;c[l>>2]=(c[l>>2]|0)-4}c[m>>2]=c[o>>2];c[n>>2]=c[p>>2]}while(1){if(!(c[l>>2]|0))break;p=c[n>>2]|0;c[n>>2]=p+1;o=d[p>>0]|0;p=c[m>>2]|0;c[m>>2]=p+1;a[p>>0]=(d[p>>0]|0)^o;c[l>>2]=(c[l>>2]|0)+-1}i=g;return}function Fk(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0;g=i;i=i+96|0;if((i|0)>=(j|0))U();h=g+76|0;k=g+72|0;l=g+68|0;m=g+64|0;n=g+60|0;o=g+56|0;p=g;q=g+52|0;r=g+24|0;s=g+48|0;t=g+44|0;u=g+40|0;v=g+36|0;w=g+80|0;x=g+16|0;y=g+32|0;c[h>>2]=b;c[k>>2]=e;c[l>>2]=f;c[m>>2]=(c[h>>2]|0)+496;c[n>>2]=c[k>>2];c[o>>2]=0;if(c[(c[m>>2]|0)+496>>2]|0)yb[c[(c[m>>2]|0)+496>>2]&3]();c[q>>2]=c[(c[m>>2]|0)+488>>2];while(1){if(!(c[l>>2]|0))break;k=(c[h>>2]|0)+128+344|0;f=k;e=Gw(c[f>>2]|0,c[f+4>>2]|0,1,0)|0;f=C;b=k;c[b>>2]=e;c[b+4>>2]=f;b=r;c[b>>2]=e;c[b+4>>2]=f;f=r;c[s>>2]=Ck(c[f>>2]|0,c[f+4>>2]|0)|0;if((c[s>>2]|0)>>>0<16)c[t>>2]=(c[h>>2]|0)+128+32+(c[s>>2]<<4);else{f=r;c[t>>2]=Hq(c[h>>2]|0,p,c[f>>2]|0,c[f+4>>2]|0)|0}Ek((c[h>>2]|0)+128+304|0,c[t>>2]|0,16);fk(p,(c[h>>2]|0)+128+304|0,c[n>>2]|0,16);c[o>>2]=sb[c[q>>2]&63](c[m>>2]|0,p,p)|0;Ek((c[h>>2]|0)+128+320|0,p,16);c[n>>2]=(c[n>>2]|0)+16;c[l>>2]=(c[l>>2]|0)+-1}c[u>>2]=p;c[v>>2]=16;a[w>>0]=0;p=x;c[p>>2]=d[w>>0];c[p+4>>2]=0;while(1){if(!(c[u>>2]&7|0?(c[v>>2]|0)!=0:0))break;a[c[u>>2]>>0]=a[w>>0]|0;c[u>>2]=(c[u>>2]|0)+1;c[v>>2]=(c[v>>2]|0)+-1}if((c[v>>2]|0)>>>0>=8){p=x;l=Xw(c[p>>2]|0,c[p+4>>2]|0,16843009,16843009)|0;p=x;c[p>>2]=l;c[p+4>>2]=C;do{c[y>>2]=c[u>>2];p=x;l=c[p+4>>2]|0;n=c[y>>2]|0;c[n>>2]=c[p>>2];c[n+4>>2]=l;c[v>>2]=(c[v>>2]|0)-8;c[u>>2]=(c[u>>2]|0)+8}while((c[v>>2]|0)>>>0>=8)}while(1){if(!(c[v>>2]|0))break;a[c[u>>2]>>0]=a[w>>0]|0;c[u>>2]=(c[u>>2]|0)+1;c[v>>2]=(c[v>>2]|0)+-1}if(!(c[o>>2]|0)){i=g;return}Qe((c[o>>2]|0)+16|0);Re();i=g;return}function Gk(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=i;i=i+16|0;if((i|0)>=(j|0))U();e=d+8|0;f=d;c[e>>2]=a;c[d+4>>2]=b;c[f>>2]=c[e>>2];c[(c[f>>2]|0)+160>>2]=1732584193;c[(c[f>>2]|0)+164>>2]=-271733879;c[(c[f>>2]|0)+168>>2]=-1732584194;c[(c[f>>2]|0)+172>>2]=271733878;c[(c[f>>2]|0)+176>>2]=-1009589776;e=(c[f>>2]|0)+128|0;c[e>>2]=0;c[e+4>>2]=0;e=(c[f>>2]|0)+136|0;c[e>>2]=0;c[e+4>>2]=0;c[(c[f>>2]|0)+144>>2]=0;c[(c[f>>2]|0)+148>>2]=64;c[(c[f>>2]|0)+152>>2]=31;i=d;return}function Hk(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,k=0;e=i;i=i+16|0;if((i|0)>=(j|0))U();f=e+12|0;g=e+8|0;h=e+4|0;k=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;do{c[k>>2]=Ik(c[f>>2]|0,c[g>>2]|0)|0;c[g>>2]=(c[g>>2]|0)+64;d=(c[h>>2]|0)+-1|0;c[h>>2]=d}while((d|0)!=0);i=e;return c[k>>2]|0}function Ik(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0;d=i;i=i+128|0;if((i|0)>=(j|0))U();e=d+120|0;f=d+116|0;g=d+112|0;h=d+108|0;k=d+104|0;l=d+100|0;m=d+96|0;n=d+92|0;o=d+88|0;p=d+84|0;q=d+80|0;r=d+76|0;s=d+72|0;t=d+8|0;u=d;c[e>>2]=a;c[f>>2]=b;c[g>>2]=c[e>>2];c[u>>2]=0;while(1){if((c[u>>2]|0)>=16)break;e=Jk((c[f>>2]|0)+(c[u>>2]<<2)|0)|0;c[t+(c[u>>2]<<2)>>2]=e;c[u>>2]=(c[u>>2]|0)+1}u=c[(c[g>>2]|0)+160>>2]|0;c[k>>2]=u;c[h>>2]=u;u=c[(c[g>>2]|0)+164>>2]|0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|0)>=(j|0))U();e=d+4|0;f=d;c[e>>2]=a;c[f>>2]=b;i=d;return c[e>>2]<<(c[f>>2]&31)|(c[e>>2]|0)>>>(32-(c[f>>2]|0)&31)|0}function Lk(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0;d=i;i=i+32|0;if((i|0)>=(j|0))U();e=d+28|0;f=d+24|0;g=d+20|0;h=d+16|0;k=d+12|0;l=d+8|0;m=d+4|0;n=d;c[e>>2]=b;c[f>>2]=c[e>>2];Ar(c[f>>2]|0,0,0);c[g>>2]=c[(c[f>>2]|0)+128>>2];c[h>>2]=c[(c[f>>2]|0)+128+4>>2];c[l>>2]=c[g>>2]<<6;c[k>>2]=c[h>>2]<<6|(c[g>>2]|0)>>>26;c[g>>2]=c[l>>2];h=(c[l>>2]|0)+(c[(c[f>>2]|0)+144>>2]|0)|0;c[l>>2]=h;if(h>>>0<(c[g>>2]|0)>>>0)c[k>>2]=(c[k>>2]|0)+1;c[g>>2]=c[l>>2];c[l>>2]=c[l>>2]<<3;c[k>>2]=c[k>>2]<<3;c[k>>2]=c[k>>2]|(c[g>>2]|0)>>>29;g=(c[(c[f>>2]|0)+144>>2]|0)<56;h=(c[f>>2]|0)+144|0;e=c[h>>2]|0;c[h>>2]=e+1;a[(c[f>>2]|0)+e>>0]=-128;a:do if(g)while(1){if((c[(c[f>>2]|0)+144>>2]|0)>=56)break a;e=(c[f>>2]|0)+144|0;h=c[e>>2]|0;c[e>>2]=h+1;a[(c[f>>2]|0)+h>>0]=0}else{while(1){o=c[f>>2]|0;if((c[(c[f>>2]|0)+144>>2]|0)>=64)break;h=o+144|0;e=c[h>>2]|0;c[h>>2]=e+1;a[(c[f>>2]|0)+e>>0]=0}Ar(o,0,0);e=c[f>>2]|0;h=e+56|0;do{c[e>>2]=0;e=e+4|0}while((e|0)<(h|0))}while(0);Mk((c[f>>2]|0)+56|0,c[l>>2]|0);Mk((c[f>>2]|0)+60|0,c[k>>2]|0);c[n>>2]=Hk(c[f>>2]|0,c[f>>2]|0,1)|0;Qe(c[n>>2]|0);Re();c[m>>2]=c[f>>2];Mk(c[m>>2]|0,c[(c[f>>2]|0)+160>>2]|0);c[m>>2]=(c[m>>2]|0)+4;Mk(c[m>>2]|0,c[(c[f>>2]|0)+164>>2]|0);c[m>>2]=(c[m>>2]|0)+4;Mk(c[m>>2]|0,c[(c[f>>2]|0)+168>>2]|0);c[m>>2]=(c[m>>2]|0)+4;Mk(c[m>>2]|0,c[(c[f>>2]|0)+172>>2]|0);c[m>>2]=(c[m>>2]|0)+4;Mk(c[m>>2]|0,c[(c[f>>2]|0)+176>>2]|0);c[m>>2]=(c[m>>2]|0)+4;i=d;return}function Mk(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=i;i=i+16|0;if((i|0)>=(j|0))U();f=e+8|0;g=e+4|0;h=e;c[f>>2]=b;c[g>>2]=d;c[h>>2]=c[f>>2];a[(c[h>>2]|0)+3>>0]=(c[g>>2]|0)>>>24;a[(c[h>>2]|0)+2>>0]=(c[g>>2]|0)>>>16;a[(c[h>>2]|0)+1>>0]=(c[g>>2]|0)>>>8;a[c[h>>2]>>0]=c[g>>2];i=e;return}function Nk(a){a=a|0;var b=0,d=0,e=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b+4|0;e=b;c[d>>2]=a;c[e>>2]=c[d>>2];i=b;return c[e>>2]|0}function Ok(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b;c[d>>2]=a;Gk(c[d>>2]|0,0);i=b;return}function Pk(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=i;i=i+16|0;if((i|0)>=(j|0))U();e=d+8|0;f=d+4|0;g=d;c[e>>2]=a;c[f>>2]=b;c[g>>2]=c[f>>2];Hk(c[e>>2]|0,c[f>>2]|0,1)|0;c[c[g>>2]>>2]=c[(c[e>>2]|0)+160>>2];c[(c[g>>2]|0)+4>>2]=c[(c[e>>2]|0)+164>>2];c[(c[g>>2]|0)+8>>2]=c[(c[e>>2]|0)+168>>2];c[(c[g>>2]|0)+12>>2]=c[(c[e>>2]|0)+172>>2];c[(c[g>>2]|0)+16>>2]=c[(c[e>>2]|0)+176>>2];i=d;return}function Qk(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,k=0,l=0;f=i;i=i+208|0;if((i|0)>=(j|0))U();g=f+192|0;h=f+188|0;k=f+184|0;l=f;c[g>>2]=b;c[h>>2]=d;c[k>>2]=e;Ok(l);Ar(l,c[h>>2]|0,c[k>>2]|0);Lk(l);k=c[g>>2]|0;g=l;l=k+20|0;do{a[k>>0]=a[g>>0]|0;k=k+1|0;g=g+1|0}while((k|0)<(l|0));i=f;return}function Rk(b,d,e,f,g,h){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0;k=i;i=i+80|0;if((i|0)>=(j|0))U();l=k+64|0;m=k+60|0;n=k+56|0;o=k+52|0;p=k+48|0;q=k+44|0;r=k+40|0;s=k+36|0;t=k+32|0;u=k+28|0;v=k+24|0;w=k+20|0;x=k+16|0;y=k+12|0;z=k+8|0;A=k+4|0;B=k;c[m>>2]=b;c[n>>2]=d;c[o>>2]=e;c[p>>2]=f;c[q>>2]=g;c[r>>2]=h;c[s>>2]=0;c[t>>2]=0;c[u>>2]=(((c[n>>2]|0)+7|0)>>>0)/8|0;if(!(c[u>>2]|0?((c[p>>2]|0)+7|0)>>>0<=(c[u>>2]|0)>>>0:0)){c[l>>2]=66;C=c[l>>2]|0;i=k;return C|0}n=ef(c[u>>2]|0)|0;c[t>>2]=n;if(!n){c[l>>2]=rt()|0;C=c[l>>2]|0;i=k;return C|0}c[w>>2]=0;n=c[w>>2]|0;c[w>>2]=n+1;a[(c[t>>2]|0)+n>>0]=0;n=c[w>>2]|0;c[w>>2]=n+1;a[(c[t>>2]|0)+n>>0]=2;c[v>>2]=(c[u>>2]|0)-3-(c[p>>2]|0);if((c[v>>2]|0)<=0)Fe(38757,38763,95,38776);do if(c[q>>2]|0){if((c[r>>2]|0)!=(c[v>>2]|0)){hf(c[t>>2]|0);c[l>>2]=45;C=c[l>>2]|0;i=k;return C|0}c[y>>2]=0;while(1){if((c[y>>2]|0)>>>0>=(c[r>>2]|0)>>>0){D=15;break}if(!(a[(c[q>>2]|0)+(c[y>>2]|0)>>0]|0))break;c[y>>2]=(c[y>>2]|0)+1}if((D|0)==15){Ow((c[t>>2]|0)+(c[w>>2]|0)|0,c[q>>2]|0,c[r>>2]|0)|0;c[w>>2]=(c[w>>2]|0)+(c[r>>2]|0);break}hf(c[t>>2]|0);c[l>>2]=45;C=c[l>>2]|0;i=k;return C|0}else{c[x>>2]=Wm(c[v>>2]|0,1)|0;while(1){c[A>>2]=0;c[z>>2]=0;while(1){if((c[z>>2]|0)>=(c[v>>2]|0))break;if(!(a[(c[x>>2]|0)+(c[z>>2]|0)>>0]|0))c[A>>2]=(c[A>>2]|0)+1;c[z>>2]=(c[z>>2]|0)+1}if(!(c[A>>2]|0))break;c[A>>2]=(c[A>>2]|0)+(((c[A>>2]|0)/128|0)+3);c[B>>2]=Wm(c[A>>2]|0,1)|0;c[z>>2]=0;while(1){if(!((c[z>>2]|0)<(c[v>>2]|0)?(c[A>>2]|0)!=0:0))break;if(!(a[(c[x>>2]|0)+(c[z>>2]|0)>>0]|0)){n=(c[A>>2]|0)+-1|0;c[A>>2]=n;a[(c[x>>2]|0)+(c[z>>2]|0)>>0]=a[(c[B>>2]|0)+n>>0]|0}if(!(a[(c[x>>2]|0)+(c[z>>2]|0)>>0]|0))continue;c[z>>2]=(c[z>>2]|0)+1}hf(c[B>>2]|0)}Ow((c[t>>2]|0)+(c[w>>2]|0)|0,c[x>>2]|0,c[v>>2]|0)|0;c[w>>2]=(c[w>>2]|0)+(c[v>>2]|0);hf(c[x>>2]|0)}while(0);x=c[w>>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[r>>2]|0)>>>0)break;if(!(d[(c[q>>2]|0)+(c[s>>2]|0)>>0]|0))break;c[s>>2]=(c[s>>2]|0)+1}if(((c[s>>2]|0)+1|0)>>>0>=(c[r>>2]|0)>>>0){hf(c[q>>2]|0);c[k>>2]=155;t=c[k>>2]|0;i=h;return t|0}c[s>>2]=(c[s>>2]|0)+1;Qw(c[q>>2]|0,(c[q>>2]|0)+(c[s>>2]|0)|0,(c[r>>2]|0)-(c[s>>2]|0)|0)|0;c[c[l>>2]>>2]=c[q>>2];c[c[m>>2]>>2]=(c[r>>2]|0)-(c[s>>2]|0);if(sf(1)|0)Ne(38852,c[c[l>>2]>>2]|0,c[c[m>>2]>>2]|0);c[k>>2]=0;t=c[k>>2]|0;i=h;return t|0}function Tk(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b;c[d>>2]=a;a=Uk(c[d>>2]|0)|0;i=b;return a|0}function Uk(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b;c[d>>2]=a;i=b;return c[d>>2]&65535|0}function Vk(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0;h=i;i=i+160|0;if((i|0)>=(j|0))U();k=h+48|0;l=h+44|0;m=h+40|0;n=h+36|0;o=h+32|0;p=h+28|0;q=h+24|0;r=h+52|0;s=h+20|0;t=h+16|0;u=h+12|0;v=h+8|0;w=h+4|0;x=h;c[l>>2]=b;c[m>>2]=d;c[n>>2]=e;c[o>>2]=f;c[p>>2]=g;c[q>>2]=0;c[s>>2]=0;c[t>>2]=(((c[m>>2]|0)+7|0)>>>0)/8|0;c[w>>2]=100;c[x>>2]=bj(c[p>>2]|0)|0;if(cj(c[p>>2]|0,10,r,w)|0){c[k>>2]=69;y=c[k>>2]|0;i=h;return y|0}if((c[o>>2]|0)!=(c[x>>2]|0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0;x=L;c[x>>2]=s;c[x+4>>2]=C;do{c[M>>2]=c[I>>2];x=L;s=c[x+4>>2]|0;E=c[M>>2]|0;c[E>>2]=c[x>>2];c[E+4>>2]=s;c[J>>2]=(c[J>>2]|0)-8;c[I>>2]=(c[I>>2]|0)+8}while((c[J>>2]|0)>>>0>=8)}while(1){if(!(c[J>>2]|0))break;a[c[I>>2]>>0]=a[K>>0]|0;c[I>>2]=(c[I>>2]|0)+1;c[J>>2]=(c[J>>2]|0)+-1}hf(c[w>>2]|0);N=c[q>>2]|0;i=k;return N|0}function bl(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0;d=i;i=i+112|0;if((i|0)>=(j|0))U();e=d;f=d+100|0;g=d+96|0;h=d+92|0;k=d+88|0;l=d+84|0;m=d+80|0;n=d+56|0;o=d+52|0;p=d+48|0;q=d+44|0;r=d+40|0;s=d+36|0;c[g>>2]=a;c[h>>2]=b;c[p>>2]=0;c[r>>2]=0;c[n>>2]=0;c[n+4>>2]=0;c[n+8>>2]=0;c[n+12>>2]=0;c[n+16>>2]=0;c[n+20>>2]=0;c[k>>2]=tj(c[g>>2]|0,l)|0;if(c[k>>2]|0){c[f>>2]=c[k>>2];t=c[f>>2]|0;i=d;return t|0}c[k>>2]=uj(c[g>>2]|0,m)|0;if(c[k>>2]|0){c[f>>2]=c[k>>2];t=c[f>>2]|0;i=d;return t|0}c[q>>2]=Gf(c[g>>2]|0,46984,0)|0;if(c[q>>2]|0?(c[k>>2]=sj(c[q>>2]|0,p,0)|0,Ef(c[q>>2]|0),c[k>>2]|0):0){c[f>>2]=c[k>>2];t=c[f>>2]|0;i=d;return t|0}if(c[g>>2]|0)u=Gf(c[g>>2]|0,39193,0)|0;else u=0;c[o>>2]=u;if((c[o>>2]|0)==0?(c[q>>2]=Gf(c[g>>2]|0,39206,0)|0,c[q>>2]|0):0){c[p>>2]=c[p>>2]|64;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0;u=g+124|0;v=g+120|0;w=g+116|0;x=g+112|0;y=g+108|0;z=g+104|0;A=g+100|0;B=g+96|0;C=g+92|0;D=g+88|0;E=g+84|0;F=g+80|0;G=g+76|0;H=g+72|0;I=g+16|0;J=g+8|0;K=g+4|0;c[l>>2]=a;c[m>>2]=b;c[n>>2]=d;c[o>>2]=e;c[p>>2]=f;c[c[p>>2]>>2]=0;if((c[n>>2]|0)==1)c[n>>2]=65537;if((c[m>>2]|0)>>>0>=1024?(((c[m>>2]|0)>>>0)%256|0|0)==0:0){if((c[n>>2]|0)>>>0<3){c[k>>2]=55;L=c[k>>2]|0;i=g;return L|0}if(!(c[n>>2]&1)){c[k>>2]=55;L=c[k>>2]|0;i=g;return L|0}c[B>>2]=0;c[C>>2]=0;c[D>>2]=0;c[E>>2]=0;c[F>>2]=0;c[G>>2]=0;if(c[o>>2]|0){f=I;e=f+56|0;do{c[f>>2]=0;f=f+4|0}while((f|0)<(e|0));c[I>>2]=39325;c[I+8>>2]=39329;c[I+16>>2]=39333;c[I+24>>2]=39336;c[I+32>>2]=39340;c[I+40>>2]=39344;c[I+4>>2]=B;c[I+8+4>>2]=C;c[I+16+4>>2]=D;c[I+24+4>>2]=E;c[I+32+4>>2]=F;c[I+40+4>>2]=G;c[J>>2]=0;while(1){if(!(c[I+(c[J>>2]<<3)>>2]|0))break;c[K>>2]=Gf(c[o>>2]|0,c[I+(c[J>>2]<<3)>>2]|0,0)|0;if(c[K>>2]|0){f=Of(c[K>>2]|0,1,5)|0;c[c[I+(c[J>>2]<<3)+4>>2]>>2]=f;Ef(c[K>>2]|0)}c[J>>2]=(c[J>>2]|0)+1}c[J>>2]=0;while(1){if(!(c[I+(c[J>>2]<<3)>>2]|0))break;if(!(c[c[I+(c[J>>2]<<3)+4>>2]>>2]|0))break;c[J>>2]=(c[J>>2]|0)+1}if(c[I+(c[J>>2]<<3)>>2]|0){c[J>>2]=0;while(1){if(!(c[I+(c[J>>2]<<3)>>2]|0))break;Gp(c[c[I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g;return L|0}else{c[k>>2]=0;L=c[k>>2]|0;i=g;return L|0}}c[k>>2]=55;L=c[k>>2]|0;i=g;return L|0}function dl(a){a=a|0;var b=0,d=0,e=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b+4|0;e=b;c[d>>2]=a;c[e>>2]=Fp(c[d>>2]|0)|0;Hp(c[e>>2]|0,c[d>>2]|0,2);ao(c[e>>2]|0,(c[d>>2]|0)-1|0);$n(c[e>>2]|0,(c[d>>2]|0)-2|0);a=Zn(c[e>>2]|0)|0;if((a|0)==(c[d>>2]|0)){i=b;return c[e>>2]|0}else Fe(39215,39251,360,39257);return 0}function el(){var a=0,b=0;a=i;i=i+16|0;if((i|0)>=(j|0))U();b=a;c[b>>2]=Fp(101)|0;Hp(c[b>>2]|0,101,2);ao(c[b>>2]|0,100);if((Zn(c[b>>2]|0)|0)==101){i=a;return c[b>>2]|0}else Fe(39274,39251,375,39308);return 0}function fl(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0;d=i;i=i+48|0;if((i|0)>=(j|0))U();e=d+32|0;f=d+28|0;g=d+24|0;h=d+16|0;k=d+12|0;l=d+8|0;m=d+4|0;n=d;c[e>>2]=a;c[f>>2]=b;c[g>>2]=-1;c[k>>2]=Ep(c[f>>2]|0)|0;c[l>>2]=Ep(c[f>>2]|0)|0;c[m>>2]=Ep(c[f>>2]|0)|0;c[n>>2]=Ep(c[f>>2]|0)|0;c[h>>2]=c[c[e>>2]>>2];c[h+4>>2]=c[(c[e>>2]|0)+4>>2];Hp(c[k>>2]|0,c[f>>2]|0,0);gl(c[l>>2]|0,c[k>>2]|0,h);if(((jo(c[l>>2]|0,c[k>>2]|0)|0?(hl(c[m>>2]|0,c[l>>2]|0,c[e>>2]|0),(jo(c[m>>2]|0,c[k>>2]|0)|0)==0):0)?(Hp(c[k>>2]|0,c[f>>2]|0,0),hl(c[n>>2]|0,c[k>>2]|0,c[e>>2]|0),gl(c[m>>2]|0,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>2];Un(c[f>>2]|0,c[f>>2]|0,1);c[h>>2]=yp(c[f>>2]|0)|0;c[k>>2]=((so(c[h>>2]|0,c[g>>2]|0,c[f>>2]|0)|0)!=0^1)&1;Gp(c[h>>2]|0);Sn(c[f>>2]|0,c[f>>2]|0,1);i=d;return c[k>>2]|0}function kl(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,k=0;b=i;i=i+80|0;if((i|0)>=(j|0))U();d=b+32|0;e=b;f=b+68|0;g=b+64|0;h=b+40|0;c[f>>2]=a;c[h>>2]=0;c[h+4>>2]=0;c[h+8>>2]=0;c[h+12>>2]=0;c[h+16>>2]=0;c[h+20>>2]=0;a=c[f>>2]|0;c[e>>2]=h;c[e+4>>2]=h+4;c[e+8>>2]=h+8;c[e+12>>2]=h+12;c[e+16>>2]=h+16;c[e+20>>2]=h+20;c[e+24>>2]=0;c[g>>2]=_f(a,0,39180,e)|0;if((c[g>>2]|0)==0?(ll(h)|0)==0:0)c[g>>2]=7;Gp(c[h>>2]|0);Gp(c[h+4>>2]|0);Gp(c[h+8>>2]|0);Gp(c[h+12>>2]|0);Gp(c[h+16>>2]|0);Gp(c[h+20>>2]|0);if(!(sf(1)|0)){k=c[g>>2]|0;i=b;return k|0}c[d>>2]=ot(c[g>>2]|0)|0;Le(39665,d);k=c[g>>2]|0;i=b;return k|0}function ll(a){a=a|0;var b=0,d=0,e=0,f=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b+8|0;e=b+4|0;f=b;c[d>>2]=a;c[f>>2]=ip(c[(c[(c[d>>2]|0)+12>>2]|0)+4>>2]<<1)|0;Do(c[f>>2]|0,c[(c[d>>2]|0)+12>>2]|0,c[(c[d>>2]|0)+16>>2]|0);c[e>>2]=jo(c[f>>2]|0,c[c[d>>2]>>2]|0)|0;qp(c[f>>2]|0);i=b;return ((c[e>>2]|0)!=0^1)&1|0}function ml(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0;e=i;i=i+128|0;if((i|0)>=(j|0))U();f=e+32|0;g=e+24|0;h=e+16|0;k=e;l=e+116|0;m=e+112|0;n=e+108|0;o=e+104|0;p=e+64|0;q=e+56|0;r=e+48|0;s=e+44|0;t=e+40|0;u=e+36|0;c[l>>2]=a;c[m>>2]=b;c[n>>2]=d;c[q>>2]=0;c[r>>2]=0;c[r+4>>2]=0;c[s>>2]=0;yj(p,0,nl(c[n>>2]|0)|0);c[o>>2]=Aj(c[m>>2]|0,q,p)|0;do if(!(c[o>>2]|0)){if(sf(1)|0)Pe(39687,c[q>>2]|0);if(c[q>>2]|0?c[(c[q>>2]|0)+12>>2]&4|0:0){c[o>>2]=79;break}m=c[n>>2]|0;c[k>>2]=r;c[k+4>>2]=r+4;c[k+8>>2]=0;c[o>>2]=_f(m,0,39177,k)|0;if(!(c[o>>2]|0)){if(sf(1)|0){Pe(39704,c[r>>2]|0);Pe(39721,c[r+4>>2]|0)}c[s>>2]=Ep(0)|0;gl(c[s>>2]|0,c[q>>2]|0,r);if(sf(1)|0)Pe(39738,c[s>>2]|0);if(!(c[p+12>>2]&4)){m=c[l>>2]|0;c[g>>2]=c[s>>2];c[o>>2]=Rf(m,0,39775,g)|0;break}c[u>>2]=(((Zn(c[r>>2]|0)|0)+7|0)>>>0)/8|0;c[o>>2]=So(t,0,c[s>>2]|0,c[u>>2]|0)|0;if(!(c[o>>2]|0)){m=c[l>>2]|0;d=c[t>>2]|0;c[h>>2]=c[u>>2];c[h+4>>2]=d;c[o>>2]=Rf(m,0,39755,h)|0;hf(c[t>>2]|0)}}}while(0);Gp(c[s>>2]|0);Gp(c[r>>2]|0);Gp(c[r+4>>2]|0);Gp(c[q>>2]|0);zj(p);if(!(sf(1)|0)){v=c[o>>2]|0;i=e;return v|0}c[f>>2]=ot(c[o>>2]|0)|0;Le(39795,f);v=c[o>>2]|0;i=e;return v|0}function nl(a){a=a|0;var b=0,d=0,e=0,f=0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A,c[r+4>>2]|0,c[r+16>>2]|0,c[v>>2]|0,c[r+20>>2]|0,c[r+24>>2]|0)|0;qp(c[v>>2]|0);c[v>>2]=0;if(c[q>>2]|0)break a;o=c[n>>2]|0;d=c[z>>2]|0;c[h>>2]=c[A>>2];c[h+4>>2]=d;c[q>>2]=Rf(o,0,39963,h)|0;break a;break}default:{o=c[n>>2]|0;d=c[r+12>>2]&8|0?39974:49059;c[g>>2]=c[v>>2];c[q>>2]=Rf(o,0,d,g)|0;break a}}}}while(0);hf(c[z>>2]|0);Gp(c[v>>2]|0);Gp(c[u>>2]|0);Gp(c[u+4>>2]|0);Gp(c[u+8>>2]|0);Gp(c[u+12>>2]|0);Gp(c[u+16>>2]|0);Gp(c[u+20>>2]|0);Gp(c[t>>2]|0);Gp(c[w>>2]|0);Gp(c[x>>2]|0);Gp(c[y>>2]|0);Ef(c[s>>2]|0);zj(r);if(!(sf(1)|0)){B=c[q>>2]|0;i=e;return B|0}c[f>>2]=ot(c[q>>2]|0)|0;Le(39977,f);B=c[q>>2]|0;i=e;return B|0}function pl(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0;e=i;i=i+160|0;if((i|0)>=(j|0))U();f=e+48|0;g=e+40|0;h=e+32|0;k=e;l=e+148|0;m=e+144|0;n=e+140|0;o=e+136|0;p=e+96|0;q=e+88|0;r=e+64|0;s=e+60|0;t=e+56|0;u=e+52|0;c[l>>2]=a;c[m>>2]=b;c[n>>2]=d;c[q>>2]=0;c[r>>2]=0;c[r+4>>2]=0;c[r+8>>2]=0;c[r+12>>2]=0;c[r+16>>2]=0;c[r+20>>2]=0;c[s>>2]=0;yj(p,2,nl(c[n>>2]|0)|0);c[o>>2]=Aj(c[m>>2]|0,q,p)|0;do if(!(c[o>>2]|0)){if(sf(1)|0)Pe(39999,c[q>>2]|0);if(c[q>>2]|0?c[(c[q>>2]|0)+12>>2]&4|0:0){c[o>>2]=79;break}m=c[n>>2]|0;c[k>>2]=r;c[k+4>>2]=r+4;c[k+8>>2]=r+8;c[k+12>>2]=r+12;c[k+16>>2]=r+16;c[k+20>>2]=r+20;c[k+24>>2]=0;c[o>>2]=_f(m,0,39834,k)|0;if(!(c[o>>2]|0)){if(sf(1)|0?(Pe(40015,c[r>>2]|0),Pe(40031,c[r+4>>2]|0),(Jg()|0)==0):0){Pe(40047,c[r+8>>2]|0);Pe(40063,c[r+12>>2]|0);Pe(40079,c[r+16>>2]|0);Pe(40095,c[r+20>>2]|0)}c[s>>2]=Ep(0)|0;hl(c[s>>2]|0,c[q>>2]|0,r);if(sf(1)|0)Pe(40111,c[s>>2]|0);if(!(c[p+12>>2]&4)){m=c[l>>2]|0;c[g>>2]=c[s>>2];c[o>>2]=Rf(m,0,40147,g)|0;break}c[u>>2]=(((Zn(c[r>>2]|0)|0)+7|0)>>>0)/8|0;c[o>>2]=So(t,0,c[s>>2]|0,c[u>>2]|0)|0;if(!(c[o>>2]|0)){m=c[l>>2]|0;d=c[t>>2]|0;c[h>>2]=c[u>>2];c[h+4>>2]=d;c[o>>2]=Rf(m,0,40127,h)|0;hf(c[t>>2]|0)}}}while(0);Gp(c[s>>2]|0);Gp(c[r>>2]|0);Gp(c[r+4>>2]|0);Gp(c[r+8>>2]|0);Gp(c[r+12>>2]|0);Gp(c[r+16>>2]|0);Gp(c[r+20>>2]|0);Gp(c[q>>2]|0);zj(p);if(!(sf(1)|0)){v=c[o>>2]|0;i=e;return v|0}c[f>>2]=ot(c[o>>2]|0)|0;Le(40167,f);v=c[o>>2]|0;i=e;return v|0}function ql(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0;e=i;i=i+112|0;if((i|0)>=(j|0))U();f=e+24|0;g=e+8|0;h=e;k=e+108|0;l=e+104|0;m=e+100|0;n=e+96|0;o=e+56|0;p=e+48|0;q=e+44|0;r=e+40|0;s=e+32|0;t=e+28|0;c[k>>2]=a;c[l>>2]=b;c[m>>2]=d;c[p>>2]=0;c[q>>2]=0;c[r>>2]=0;c[s>>2]=0;c[s+4>>2]=0;c[t>>2]=0;yj(o,3,nl(c[m>>2]|0)|0);c[n>>2]=Aj(c[l>>2]|0,r,o)|0;do if(!(c[n>>2]|0)){if(sf(1)|0)Pe(40188,c[r>>2]|0);if(c[r>>2]|0?c[(c[r>>2]|0)+12>>2]&4|0:0){c[n>>2]=79;break}c[n>>2]=vj(c[k>>2]|0,7704,p,0)|0;if((c[n>>2]|0)==0?(l=c[p>>2]|0,c[h>>2]=q,c[h+4>>2]=0,c[n>>2]=_f(l,0,39189,h)|0,(c[n>>2]|0)==0):0){if(sf(1)|0)Pe(40204,c[q>>2]|0);l=c[m>>2]|0;c[g>>2]=s;c[g+4>>2]=s+4;c[g+8>>2]=0;c[n>>2]=_f(l,0,39177,g)|0;if(!(c[n>>2]|0)){if(sf(1)|0){Pe(40220,c[s>>2]|0);Pe(40236,c[s+4>>2]|0)}c[t>>2]=Ep(0)|0;gl(c[t>>2]|0,c[q>>2]|0,s);if(sf(1)|0)Pe(40252,c[t>>2]|0);if(c[o+32>>2]|0){c[n>>2]=Bb[c[o+32>>2]&7](o,c[t>>2]|0)|0;break}else{l=(jo(c[t>>2]|0,c[r>>2]|0)|0)!=0;c[n>>2]=l?8:0;break}}}}while(0);Gp(c[t>>2]|0);Gp(c[s>>2]|0);Gp(c[s+4>>2]|0);Gp(c[r>>2]|0);Gp(c[q>>2]|0);Ef(c[p>>2]|0);zj(o);if(!(sf(1)|0)){u=c[n>>2]|0;i=e;return u|0}if(c[n>>2]|0)v=ot(c[n>>2]|0)|0;else v=49617;c[f>>2]=v;Le(40268,f);u=c[n>>2]|0;i=e;return u|0}function rl(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,k=0;e=i;i=i+16|0;if((i|0)>=(j|0))U();f=e+12|0;g=e+4|0;h=e;c[f>>2]=a;c[e+8>>2]=b;c[g>>2]=d;if((c[f>>2]|0)==1){c[h>>2]=sl(c[g>>2]|0)|0;k=c[h>>2]|0;i=e;return k|0}else{c[h>>2]=4;k=c[h>>2]|0;i=e;return k|0}return 0}function sl(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,k=0,l=0,m=0;b=i;i=i+32|0;if((i|0)>=(j|0))U();d=b+24|0;e=b+20|0;f=b+16|0;g=b+12|0;h=b+8|0;k=b+4|0;l=b;c[e>>2]=a;c[k>>2]=0;c[l>>2]=0;c[f>>2]=40289;c[h>>2]=Tf(k,0,40297,Tu(40297)|0)|0;if(!(c[h>>2]|0))c[h>>2]=Tf(l,0,41327,Tu(41327)|0)|0;do if(!(c[h>>2]|0)){c[f>>2]=41644;c[h>>2]=Lj(c[k>>2]|0)|0;if(c[h>>2]|0){c[g>>2]=tl(c[h>>2]|0)|0;break}c[f>>2]=41660;c[g>>2]=ul(c[l>>2]|0,c[k>>2]|0)|0;if((c[g>>2]|0)==0?(c[f>>2]=41896,c[g>>2]=xl(c[l>>2]|0,c[k>>2]|0)|0,(c[g>>2]|0)==0):0){Ef(c[l>>2]|0);Ef(c[k>>2]|0);c[d>>2]=0;m=c[d>>2]|0;i=b;return m|0}}else c[g>>2]=tl(c[h>>2]|0)|0;while(0);Ef(c[l>>2]|0);Ef(c[k>>2]|0);if(c[e>>2]|0)Cb[c[e>>2]&1](49653,1,c[f>>2]|0,c[g>>2]|0);c[d>>2]=50;m=c[d>>2]|0;i=b;return m|0}function tl(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b;c[d>>2]=a;a=ot(c[d>>2]|0)|0;i=b;return a|0}function ul(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,k=0,l=0,m=0;d=i;i=i+32|0;if((i|0)>=(j|0))U();e=d+24|0;f=d+20|0;g=d+16|0;h=d+12|0;k=d+8|0;l=d+4|0;m=d;c[e>>2]=a;c[f>>2]=b;c[g>>2]=0;c[k>>2]=0;c[l>>2]=0;c[m>>2]=0;c[h>>2]=Tf(k,0,41665,Tu(41665)|0)|0;if(!(c[h>>2]|0))c[h>>2]=Tf(l,0,41741,Tu(41741)|0)|0;do if(!(c[h>>2]|0)){c[h>>2]=Jj(m,c[k>>2]|0,c[f>>2]|0)|0;if(c[h>>2]|0){c[g>>2]=41840;break}c[h>>2]=Kj(c[m>>2]|0,c[k>>2]|0,c[e>>2]|0)|0;if(c[h>>2]|0){c[g>>2]=41855;break}c[h>>2]=Kj(c[m>>2]|0,c[l>>2]|0,c[e>>2]|0)|0;if((vl(c[h>>2]|0)|0)!=8)c[g>>2]=41869}else c[g>>2]=41817;while(0);Ef(c[m>>2]|0);Ef(c[l>>2]|0);Ef(c[k>>2]|0);i=d;return c[g>>2]|0}function vl(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b;c[d>>2]=a;a=wl(c[d>>2]|0)|0;i=b;return a|0}function wl(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b;c[d>>2]=a;i=b;return c[d>>2]&65535|0}function xl(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;d=i;i=i+64|0;if((i|0)>=(j|0))U();e=d;f=d+48|0;g=d+44|0;h=d+40|0;k=d+36|0;l=d+28|0;m=d+24|0;n=d+20|0;o=d+16|0;p=d+12|0;q=d+8|0;r=d+4|0;c[f>>2]=a;c[g>>2]=b;c[h>>2]=0;c[d+32>>2]=1e3;c[l>>2]=0;c[m>>2]=0;c[n>>2]=0;c[o>>2]=0;c[p>>2]=0;c[q>>2]=0;c[r>>2]=0;c[l>>2]=Ep(1e3)|0;Hp(c[l>>2]|0,1e3,0);c[e>>2]=c[l>>2];c[k>>2]=Rf(m,0,41904,e)|0;do if(!(c[k>>2]|0)){c[k>>2]=Gj(n,c[m>>2]|0,c[f>>2]|0)|0;if(c[k>>2]|0){c[h>>2]=41934;break}c[o>>2]=yl(c[n>>2]|0)|0;if(!(c[o>>2]|0)){c[h>>2]=41957;break}if(!(jo(c[l>>2]|0,c[o>>2]|0)|0)){c[h>>2]=41990;break}c[k>>2]=Ij(p,c[n>>2]|0,c[g>>2]|0)|0;if(c[k>>2]|0){c[h>>2]=42019;break}c[r>>2]=Gf(c[p>>2]|0,42034,0)|0;if(c[r>>2]|0)c[q>>2]=Of(c[r>>2]|0,1,5)|0;else c[q>>2]=Of(c[p>>2]|0,0,5)|0;if(!(c[q>>2]|0)){c[h>>2]=42040;break}if(jo(c[l>>2]|0,c[q>>2]|0)|0)c[h>>2]=42070}else c[h>>2]=41817;while(0);Ef(c[r>>2]|0);Gp(c[q>>2]|0);Ef(c[p>>2]|0);Gp(c[o>>2]|0);Ef(c[n>>2]|0);Ef(c[m>>2]|0);Gp(c[l>>2]|0);i=d;return c[h>>2]|0}function yl(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,k=0,l=0;b=i;i=i+32|0;if((i|0)>=(j|0))U();d=b+20|0;e=b+16|0;f=b+12|0;g=b+8|0;h=b+4|0;k=b;c[e>>2]=a;c[f>>2]=Gf(c[e>>2]|0,41949,0)|0;if(!(c[f>>2]|0)){c[d>>2]=0;l=c[d>>2]|0;i=b;return l|0}c[g>>2]=Gf(c[f>>2]|0,39136,0)|0;Ef(c[f>>2]|0);if(!(c[g>>2]|0)){c[d>>2]=0;l=c[d>>2]|0;i=b;return l|0}c[h>>2]=Gf(c[g>>2]|0,39187,0)|0;Ef(c[g>>2]|0);if(c[h>>2]|0){c[k>>2]=Of(c[h>>2]|0,1,0)|0;Ef(c[h>>2]|0);c[d>>2]=c[k>>2];l=c[d>>2]|0;i=b;return l|0}else{c[d>>2]=0;l=c[d>>2]|0;i=b;return l|0}return 0}function zl(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,k=0,l=0,m=0;d=i;i=i+32|0;if((i|0)>=(j|0))U();e=d+20|0;f=d+16|0;g=d+12|0;h=d+8|0;k=d+4|0;l=d;c[f>>2]=a;c[g>>2]=b;c[h>>2]=Gf(c[g>>2]|0,39191,1)|0;if(!(c[h>>2]|0)){c[e>>2]=68;m=c[e>>2]|0;i=d;return m|0}c[k>>2]=Kf(c[h>>2]|0,1,l)|0;if(c[k>>2]|0){Oi(c[f>>2]|0,c[k>>2]|0,c[l>>2]|0);Ef(c[h>>2]|0);c[e>>2]=0;m=c[e>>2]|0;i=d;return m|0}else{Ef(c[h>>2]|0);c[e>>2]=68;m=c[e>>2]|0;i=d;return m|0}return 0}function Al(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=i;i=i+16|0;if((i|0)>=(j|0))U();e=d+12|0;f=d+4|0;c[e>>2]=a;c[d+8>>2]=b;c[f>>2]=c[e>>2];c[d>>2]=cg()|0;c[(c[f>>2]|0)+160>>2]=1732584193;c[(c[f>>2]|0)+164>>2]=-271733879;c[(c[f>>2]|0)+168>>2]=-1732584194;c[(c[f>>2]|0)+172>>2]=271733878;c[(c[f>>2]|0)+176>>2]=-1009589776;e=(c[f>>2]|0)+128|0;c[e>>2]=0;c[e+4>>2]=0;e=(c[f>>2]|0)+136|0;c[e>>2]=0;c[e+4>>2]=0;c[(c[f>>2]|0)+144>>2]=0;c[(c[f>>2]|0)+148>>2]=64;c[(c[f>>2]|0)+152>>2]=32;i=d;return}function Bl(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,k=0,l=0;e=i;i=i+32|0;if((i|0)>=(j|0))U();f=e+16|0;g=e+12|0;h=e+8|0;k=e+4|0;l=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;c[k>>2]=c[f>>2];do{c[l>>2]=Cl(c[k>>2]|0,c[g>>2]|0)|0;c[g>>2]=(c[g>>2]|0)+64;f=(c[h>>2]|0)+-1|0;c[h>>2]=f}while((f|0)!=0);i=e;return c[l>>2]|0}
+function Ku(b,c,d){b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0;if(c>>>0>0|(c|0)==0&b>>>0>4294967295){e=d;f=b;g=c;while(1){c=Rw(f|0,g|0,10,0)|0;h=e+-1|0;a[h>>0]=c|48;c=Vw(f|0,g|0,10,0)|0;if(g>>>0>9|(g|0)==9&f>>>0>4294967295){e=h;f=c;g=C}else{i=h;j=c;break}}k=i;l=j}else{k=d;l=b}if(!l)m=k;else{b=k;k=l;while(1){l=b+-1|0;a[l>>0]=(k>>>0)%10|0|48;if(k>>>0<10){m=l;break}else{b=l;k=(k>>>0)/10|0}}}return m|0}function Lu(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0;f=d&255;g=(e|0)!=0;a:do if(g&(b&3|0)!=0){h=d&255;i=e;j=b;while(1){if((a[j>>0]|0)==h<<24>>24){k=i;l=j;m=6;break a}n=j+1|0;o=i+-1|0;p=(o|0)!=0;if(p&(n&3|0)!=0){i=o;j=n}else{q=o;r=p;s=n;m=5;break}}}else{q=e;r=g;s=b;m=5}while(0);if((m|0)==5)if(r){k=q;l=s;m=6}else{t=0;u=s}b:do if((m|0)==6){s=d&255;if((a[l>>0]|0)==s<<24>>24){t=k;u=l}else{q=R(f,16843009)|0;c:do if(k>>>0>3){r=k;b=l;while(1){g=c[b>>2]^q;if((g&-2139062144^-2139062144)&g+-16843009|0){v=r;w=b;break}g=b+4|0;e=r+-4|0;if(e>>>0>3){r=e;b=g}else{x=e;y=g;m=11;break c}}z=v;A=w}else{x=k;y=l;m=11}while(0);if((m|0)==11)if(!x){t=0;u=y;break}else{z=x;A=y}while(1){if((a[A>>0]|0)==s<<24>>24){t=z;u=A;break b}q=A+1|0;z=z+-1|0;if(!z){t=0;u=q;break}else A=q}}}while(0);return (t|0?u:0)|0}function Mu(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;g=i;i=i+256|0;if((i|0)>=(j|0))U();h=g;do if((d|0)>(e|0)&(f&73728|0)==0){k=d-e|0;Sw(h|0,b|0,(k>>>0>256?256:k)|0)|0;l=c[a>>2]|0;m=(l&32|0)==0;if(k>>>0>255){n=d-e|0;o=k;p=l;l=m;while(1){if(l){Hu(h,256,a)|0;q=c[a>>2]|0}else q=p;o=o+-256|0;l=(q&32|0)==0;if(o>>>0<=255)break;else p=q}if(l)r=n&255;else break}else if(m)r=k;else break;Hu(h,r,a)|0}while(0);i=g;return}function Nu(a,b){a=a|0;b=b|0;var c=0;if(!a)c=0;else c=Ou(a,b,0)|0;return c|0}function Ou(b,d,e){b=b|0;d=d|0;e=e|0;var f=0;do if(b){if(d>>>0<128){a[b>>0]=d;f=1;break}if(d>>>0<2048){a[b>>0]=d>>>6|192;a[b+1>>0]=d&63|128;f=2;break}if(d>>>0<55296|(d&-8192|0)==57344){a[b>>0]=d>>>12|224;a[b+1>>0]=d>>>6&63|128;a[b+2>>0]=d&63|128;f=3;break}if((d+-65536|0)>>>0<1048576){a[b>>0]=d>>>18|240;a[b+1>>0]=d>>>12&63|128;a[b+2>>0]=d>>>6&63|128;a[b+3>>0]=d&63|128;f=4;break}else{c[(fu()|0)>>2]=84;f=-1;break}}else f=1;while(0);return f|0}function Pu(a,b){a=+a;b=b|0;return +(+Qu(a,b))}function Qu(a,b){a=+a;b=b|0;var d=0,e=0,f=0,g=0,i=0.0,j=0.0,l=0,m=0.0;h[k>>3]=a;d=c[k>>2]|0;e=c[k+4>>2]|0;f=Mw(d|0,e|0,52)|0;g=f&2047;switch(g|0){case 0:{if(a!=0.0){i=+Qu(a*18446744073709551616.0,b);j=i;l=(c[b>>2]|0)+-64|0}else{j=a;l=0}c[b>>2]=l;m=j;break}case 2047:{m=a;break}default:{c[b>>2]=g+-1022;c[k>>2]=d;c[k+4>>2]=e&-2146435073|1071644672;m=+h[k>>3]}}return +m}function Ru(a){a=a|0;return 0}function Su(a){a=a|0;var b=0;b=(wu(a)|0)==0;return (b?a:a&95)|0}function Tu(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0;d=b;a:do if(!(d&3)){e=b;f=4}else{g=b;h=d;while(1){if(!(a[g>>0]|0)){i=h;break a}j=g+1|0;h=j;if(!(h&3)){e=j;f=4;break}else g=j}}while(0);if((f|0)==4){f=e;while(1){e=c[f>>2]|0;if(!((e&-2139062144^-2139062144)&e+-16843009))f=f+4|0;else{k=e;l=f;break}}if(!((k&255)<<24>>24))m=l;else{k=l;while(1){l=k+1|0;if(!(a[l>>0]|0)){m=l;break}else k=l}}i=m}return i-d|0}function Uu(a){a=a|0;return ((a|0)==223|(su(a)|0)!=(a|0))&1|0}function Vu(a){a=a|0;var b=0;if(a>>>0>=255)if((a+-57344|0)>>>0<8185|(a>>>0<8232|(a+-8234|0)>>>0<47062))b=1;else return ((a+-65532|0)>>>0>1048579|(a&65534|0)==65534)&1^1|0;else b=(a+1&127)>>>0>32&1;return b|0}function Wu(a,b){a=a|0;b=b|0;var c=0;do switch(b|0){case 1:{c=Xu(a)|0;break}case 2:{c=uu(a)|0;break}case 3:{c=nu(a)|0;break}case 4:{c=Zu(a)|0;break}case 5:{c=Yu(a)|0;break}case 6:{c=_u(a)|0;break}case 7:{c=Uu(a)|0;break}case 8:{c=Vu(a)|0;break}case 9:{c=$u(a)|0;break}case 10:{c=yu(a)|0;break}case 11:{c=av(a)|0;break}case 12:{c=bv(a)|0;break}default:c=0}while(0);return c|0}function Xu(a){a=a|0;var b=0;if(!(Yu(a)|0))b=(uu(a)|0)!=0;else b=1;return b&1|0}function Yu(a){a=a|0;return (a+-48|0)>>>0<10|0}function Zu(a){a=a|0;var b=0;if((a&-2|0)==8232|(a>>>0<32|(a+-127|0)>>>0<33))b=1;else b=(a+-65529|0)>>>0<3;return b&1|0}function _u(a){a=a|0;var b=0;if(!(yu(a)|0))b=(Vu(a)|0)!=0;else b=0;return b&1|0}function $u(a){a=a|0;var b=0;if(a>>>0<131072)b=(d[66878+((d[66878+(a>>>8)>>0]|0)<<5|a>>>3&31)>>0]|0)>>>(a&7)&1;else b=0;return b|0}function av(a){a=a|0;return (vu(a)|0)!=(a|0)|0}function bv(a){a=a|0;var b=0;if((a+-48|0)>>>0<10)b=1;else b=((a|32)+-97|0)>>>0<6;return b&1|0}function cv(b,c){b=b|0;c=c|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0;e=a[b>>0]|0;a:do if(!(e<<24>>24)){f=0;g=c}else{h=e;i=e&255;j=b;k=c;while(1){l=a[k>>0]|0;if(!(l<<24>>24)){f=h;g=k;break a}if(h<<24>>24!=l<<24>>24?(l=qu(i)|0,(l|0)!=(qu(d[k>>0]|0)|0)):0){m=j;n=k;break}j=j+1|0;l=k+1|0;o=a[j>>0]|0;if(!(o<<24>>24)){f=0;g=l;break a}else{h=o;i=o&255;k=l}}f=a[m>>0]|0;g=n}while(0);n=qu(f&255)|0;return n-(qu(d[g>>0]|0)|0)|0}function dv(a,b){a=a|0;b=b|0;ev(a,b)|0;return a|0}function ev(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;e=d;a:do if(!((e^b)&3)){if(!(e&3)){f=d;g=b}else{h=b;i=d;while(1){j=a[i>>0]|0;a[h>>0]=j;if(!(j<<24>>24)){k=h;break a}j=i+1|0;l=h+1|0;if(!(j&3)){f=j;g=l;break}else{h=l;i=j}}}i=c[f>>2]|0;if(!((i&-2139062144^-2139062144)&i+-16843009)){h=i;i=g;j=f;while(1){l=j+4|0;m=i+4|0;c[i>>2]=h;h=c[l>>2]|0;if((h&-2139062144^-2139062144)&h+-16843009|0){n=m;o=l;break}else{i=m;j=l}}}else{n=g;o=f}p=o;q=n;r=8}else{p=d;q=b;r=8}while(0);if((r|0)==8){r=a[p>>0]|0;a[q>>0]=r;if(!(r<<24>>24))k=q;else{r=q;q=p;while(1){q=q+1|0;p=r+1|0;b=a[q>>0]|0;a[p>>0]=b;if(!(b<<24>>24)){k=p;break}else r=p}}}return k|0}function fv(a){a=a|0;return ((a|0)==32|(a+-9|0)>>>0<5)&1|0}function gv(a,b,c){a=a|0;b=b|0;c=c|0;var d=0;d=hv(a,b,c,-1,0)|0;return d|0}function hv(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,k=0,l=0,m=0;g=i;i=i+112|0;if((i|0)>=(j|0))U();h=g;c[h>>2]=0;k=h+4|0;c[k>>2]=a;c[h+44>>2]=a;l=h+8|0;c[l>>2]=(a|0)<0?-1:a+2147483647|0;c[h+76>>2]=-1;iv(h,0);m=jv(h,d,1,e,f)|0;if(b|0)c[b>>2]=a+((c[k>>2]|0)+(c[h+108>>2]|0)-(c[l>>2]|0));i=g;return m|0}function iv(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;c[a+104>>2]=b;d=c[a+8>>2]|0;e=c[a+4>>2]|0;f=d-e|0;c[a+108>>2]=f;if((b|0)!=0&(f|0)>(b|0))c[a+100>>2]=e+b;else c[a+100>>2]=d;return}function jv(b,e,f,g,h){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0,$=0,aa=0,ba=0,ca=0,da=0,ea=0,fa=0,ga=0,ha=0,ia=0,ja=0,ka=0,la=0,ma=0,na=0,oa=0,pa=0,qa=0,ra=0,sa=0,ta=0,ua=0,va=0;a:do if(e>>>0>36){c[(fu()|0)>>2]=22;i=0;j=0}else{k=b+4|0;l=b+100|0;do{m=c[k>>2]|0;if(m>>>0<(c[l>>2]|0)>>>0){c[k>>2]=m+1;n=d[m>>0]|0}else n=kv(b)|0}while((fv(n)|0)!=0);o=n;b:do switch(o|0){case 43:case 45:{m=((o|0)==45)<<31>>31;p=c[k>>2]|0;if(p>>>0<(c[l>>2]|0)>>>0){c[k>>2]=p+1;q=d[p>>0]|0;r=m;break b}else{q=kv(b)|0;r=m;break b}break}default:{q=o;r=0}}while(0);m=(e|0)==0;do if((e|16|0)==16&(q|0)==48){p=c[k>>2]|0;if(p>>>0<(c[l>>2]|0)>>>0){c[k>>2]=p+1;s=d[p>>0]|0}else s=kv(b)|0;if((s|32|0)!=120)if(m){t=8;u=s;v=46;break}else{w=e;x=s;v=32;break}p=c[k>>2]|0;if(p>>>0<(c[l>>2]|0)>>>0){c[k>>2]=p+1;y=d[p>>0]|0}else y=kv(b)|0;if((d[70047+y>>0]|0)>15){p=(c[l>>2]|0)==0;if(!p)c[k>>2]=(c[k>>2]|0)+-1;if(!f){iv(b,0);i=0;j=0;break a}if(p){i=0;j=0;break a}c[k>>2]=(c[k>>2]|0)+-1;i=0;j=0;break a}else{t=16;u=y;v=46}}else{p=m?10:e;if((d[70047+q>>0]|0)>>>0<p>>>0){w=p;x=q;v=32}else{if(c[l>>2]|0)c[k>>2]=(c[k>>2]|0)+-1;iv(b,0);c[(fu()|0)>>2]=22;i=0;j=0;break a}}while(0);if((v|0)==32)if((w|0)==10){m=x+-48|0;if(m>>>0<10){p=m;m=0;while(1){z=(m*10|0)+p|0;A=c[k>>2]|0;if(A>>>0<(c[l>>2]|0)>>>0){c[k>>2]=A+1;B=d[A>>0]|0}else B=kv(b)|0;p=B+-48|0;if(!(p>>>0<10&z>>>0<429496729)){D=z;E=B;break}else m=z}F=D;G=0;H=E}else{F=0;G=0;H=x}m=H+-48|0;if(m>>>0<10){p=F;z=G;A=m;m=H;while(1){I=Xw(p|0,z|0,10,0)|0;J=C;K=((A|0)<0)<<31>>31;L=~K;if(J>>>0>L>>>0|(J|0)==(L|0)&I>>>0>~A>>>0){M=A;N=p;O=z;P=m;break}L=Gw(I|0,J|0,A|0,K|0)|0;K=C;J=c[k>>2]|0;if(J>>>0<(c[l>>2]|0)>>>0){c[k>>2]=J+1;Q=d[J>>0]|0}else Q=kv(b)|0;J=Q+-48|0;if(J>>>0<10&(K>>>0<429496729|(K|0)==429496729&L>>>0<2576980378)){p=L;z=K;A=J;m=Q}else{M=J;N=L;O=K;P=Q;break}}if(M>>>0>9){S=O;T=N;U=r}else{V=10;W=N;X=O;Y=P;v=72}}else{S=G;T=F;U=r}}else{t=w;u=x;v=46}c:do if((v|0)==46){if(!(t+-1&t)){m=a[70303+((t*23|0)>>>5&7)>>0]|0;A=a[70047+u>>0]|0;z=A&255;if(z>>>0<t>>>0){p=z;z=0;while(1){K=p|z<<m;L=c[k>>2]|0;if(L>>>0<(c[l>>2]|0)>>>0){c[k>>2]=L+1;Z=d[L>>0]|0}else Z=kv(b)|0;L=a[70047+Z>>0]|0;p=L&255;if(!(K>>>0<134217728&p>>>0<t>>>0)){_=K;$=L;aa=Z;break}else z=K}ba=$;ca=0;da=_;ea=aa}else{ba=A;ca=0;da=0;ea=u}z=Mw(-1,-1,m|0)|0;p=C;if((ba&255)>>>0>=t>>>0|(ca>>>0>p>>>0|(ca|0)==(p|0)&da>>>0>z>>>0)){V=t;W=da;X=ca;Y=ea;v=72;break}else{fa=da;ga=ca;ha=ba}while(1){K=Pw(fa|0,ga|0,m|0)|0;L=C;J=ha&255|K;K=c[k>>2]|0;if(K>>>0<(c[l>>2]|0)>>>0){c[k>>2]=K+1;ia=d[K>>0]|0}else ia=kv(b)|0;ha=a[70047+ia>>0]|0;if((ha&255)>>>0>=t>>>0|(L>>>0>p>>>0|(L|0)==(p|0)&J>>>0>z>>>0)){V=t;W=J;X=L;Y=ia;v=72;break c}else{fa=J;ga=L}}}z=a[70047+u>>0]|0;p=z&255;if(p>>>0<t>>>0){m=p;p=0;while(1){A=m+(R(p,t)|0)|0;L=c[k>>2]|0;if(L>>>0<(c[l>>2]|0)>>>0){c[k>>2]=L+1;ja=d[L>>0]|0}else ja=kv(b)|0;L=a[70047+ja>>0]|0;m=L&255;if(!(A>>>0<119304647&m>>>0<t>>>0)){ka=A;la=L;ma=ja;break}else p=A}na=la;oa=ka;pa=0;qa=ma}else{na=z;oa=0;pa=0;qa=u}if((na&255)>>>0<t>>>0){p=Vw(-1,-1,t|0,0)|0;m=C;A=pa;L=oa;J=na;K=qa;while(1){if(A>>>0>m>>>0|(A|0)==(m|0)&L>>>0>p>>>0){V=t;W=L;X=A;Y=K;v=72;break c}I=Xw(L|0,A|0,t|0,0)|0;ra=C;sa=J&255;if(ra>>>0>4294967295|(ra|0)==-1&I>>>0>~sa>>>0){V=t;W=L;X=A;Y=K;v=72;break c}ta=Gw(sa|0,0,I|0,ra|0)|0;ra=C;I=c[k>>2]|0;if(I>>>0<(c[l>>2]|0)>>>0){c[k>>2]=I+1;ua=d[I>>0]|0}else ua=kv(b)|0;J=a[70047+ua>>0]|0;if((J&255)>>>0>=t>>>0){V=t;W=ta;X=ra;Y=ua;v=72;break}else{A=ra;L=ta;K=ua}}}else{V=t;W=oa;X=pa;Y=qa;v=72}}while(0);if((v|0)==72)if((d[70047+Y>>0]|0)>>>0<V>>>0){do{K=c[k>>2]|0;if(K>>>0<(c[l>>2]|0)>>>0){c[k>>2]=K+1;va=d[K>>0]|0}else va=kv(b)|0}while((d[70047+va>>0]|0)>>>0<V>>>0);c[(fu()|0)>>2]=34;S=h;T=g;U=(g&1|0)==0&0==0?r:0}else{S=X;T=W;U=r}if(c[l>>2]|0)c[k>>2]=(c[k>>2]|0)+-1;if(!(S>>>0<h>>>0|(S|0)==(h|0)&T>>>0<g>>>0)){if(!((g&1|0)!=0|0!=0|(U|0)!=0)){c[(fu()|0)>>2]=34;K=Gw(g|0,h|0,-1,-1)|0;i=C;j=K;break}if(S>>>0>h>>>0|(S|0)==(h|0)&T>>>0>g>>>0){c[(fu()|0)>>2]=34;i=h;j=g;break}}K=((U|0)<0)<<31>>31;L=Fw(T^U|0,S^K|0,U|0,K|0)|0;i=C;j=L}while(0);C=i;return j|0}function kv(b){b=b|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0;e=b+104|0;f=c[e>>2]|0;if((f|0)!=0?(c[b+108>>2]|0)>=(f|0):0)g=4;else{f=lv(b)|0;if((f|0)>=0){h=c[e>>2]|0;e=c[b+8>>2]|0;if(h){i=c[b+4>>2]|0;j=h-(c[b+108>>2]|0)|0;h=e;if((e-i|0)<(j|0)){k=h;g=9}else{c[b+100>>2]=i+(j+-1);l=h}}else{k=e;g=9}if((g|0)==9){c[b+100>>2]=e;l=k}k=b+4|0;if(!l)m=c[k>>2]|0;else{e=c[k>>2]|0;k=b+108|0;c[k>>2]=l+1-e+(c[k>>2]|0);m=e}e=m+-1|0;if((d[e>>0]|0|0)==(f|0))n=f;else{a[e>>0]=f;n=f}}else g=4}if((g|0)==4){c[b+100>>2]=0;n=-1}return n|0}function lv(a){a=a|0;var b=0,e=0,f=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();e=b;if((c[a+8>>2]|0)==0?(mv(a)|0)!=0:0)f=-1;else if((sb[c[a+32>>2]&63](a,e,1)|0)==1)f=d[e>>0]|0;else f=-1;i=b;return f|0}function mv(b){b=b|0;var d=0,e=0,f=0;d=b+74|0;e=a[d>>0]|0;a[d>>0]=e+255|e;e=b+20|0;d=b+44|0;if((c[e>>2]|0)>>>0>(c[d>>2]|0)>>>0)sb[c[b+36>>2]&63](b,0,0)|0;c[b+16>>2]=0;c[b+28>>2]=0;c[e>>2]=0;e=c[b>>2]|0;if(e&20)if(!(e&4))f=-1;else{c[b>>2]=e|32;f=-1}else{e=c[d>>2]|0;c[b+8>>2]=e;c[b+4>>2]=e;f=0}return f|0}function nv(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;e=i;i=i+16|0;if((i|0)>=(j|0))U();f=e;c[f>>2]=d;d=ov(a,b,f)|0;i=e;return d|0}function ov(a,b,c){a=a|0;b=b|0;c=c|0;return Du(a,2147483647,b,c)|0}function pv(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;e=i;i=i+16|0;if((i|0)>=(j|0))U();f=e;c[f>>2]=d;d=Fu(a,b,f)|0;i=e;return d|0}function qv(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0;if((c[f+76>>2]|0)>-1)g=Ru(f)|0;else g=0;h=e+-1|0;if((e|0)<2){e=f+74|0;i=a[e>>0]|0;a[e>>0]=i+255|i;if(g|0)ju(f);if(!h){a[b>>0]=0;j=b}else j=0}else{a:do if(h){i=f+4|0;e=f+8|0;k=h;l=b;while(1){m=c[i>>2]|0;n=m;o=(c[e>>2]|0)-n|0;p=Lu(m,10,o)|0;q=(p|0)==0;r=q?o:1-n+p|0;p=r>>>0<k>>>0;n=p?r:k;Ow(l|0,m|0,n|0)|0;m=(c[i>>2]|0)+n|0;c[i>>2]=m;r=l+n|0;o=k-n|0;if(!(q&p)){s=r;t=17;break a}if(m>>>0>=(c[e>>2]|0)>>>0){p=lv(f)|0;if((p|0)<0){u=r;break}else v=p}else{c[i>>2]=m+1;v=d[m>>0]|0}k=o+-1|0;o=r+1|0;a[r>>0]=v;if(!((k|0)!=0&(v&255|0)!=10)){s=o;t=17;break a}else l=o}if((u|0)!=(b|0)?(c[f>>2]&16|0)!=0:0){s=u;t=17}else w=0}else{s=b;t=17}while(0);if((t|0)==17)if(!b)w=0;else{a[s>>0]=0;w=b}if(!g)j=w;else{ju(f);j=w}}return j|0}function rv(b,c,e){b=b|0;c=c|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0;if(!e)f=0;else{g=a[b>>0]|0;a:do if(!(g<<24>>24)){h=0;i=c}else{j=e;k=g;l=b;m=c;while(1){j=j+-1|0;n=a[m>>0]|0;if(!(k<<24>>24==n<<24>>24&((j|0)!=0&n<<24>>24!=0))){h=k;i=m;break a}l=l+1|0;n=m+1|0;k=a[l>>0]|0;if(!(k<<24>>24)){h=0;i=n;break}else m=n}}while(0);f=(h&255)-(d[i>>0]|0)|0}return f|0}function sv(a){a=a|0;return Uw(a|0)|0}function tv(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0;e=i;i=i+192|0;if((i|0)>=(j|0))U();f=e+152|0;g=e+136|0;h=e+120|0;k=e+104|0;l=e+96|0;m=e+80|0;n=e+64|0;o=e+48|0;p=e+32|0;q=e+16|0;r=e;s=e+176|0;t=e+168|0;c[s>>2]=d;d=(c[s>>2]|0)+(4-1)&~(4-1);u=c[d>>2]|0;c[s>>2]=d+4;d=(b|0)==4?u|32768:u;a:do switch(b|0){case 14:{c[r>>2]=a;c[r+4>>2]=14;c[r+8>>2]=d;v=eu(sa(221,r|0)|0)|0;break}case 9:{c[q>>2]=a;c[q+4>>2]=16;c[q+8>>2]=t;u=sa(221,q|0)|0;switch(u|0){case -22:{c[p>>2]=a;c[p+4>>2]=9;c[p+8>>2]=d;w=sa(221,p|0)|0;break}case 0:{s=c[t+4>>2]|0;w=(c[t>>2]|0)==2?0-s|0:s;break}default:w=eu(u)|0}v=w;break}case 1030:{c[o>>2]=a;c[o+4>>2]=1030;c[o+8>>2]=d;u=sa(221,o|0)|0;if((u|0)!=-22){if((u|0)>-1){c[n>>2]=u;c[n+4>>2]=2;c[n+8>>2]=1;sa(221,n|0)|0}v=eu(u)|0;break a}c[m>>2]=a;c[m+4>>2]=1030;c[m+8>>2]=0;u=sa(221,m|0)|0;if((u|0)==-22){c[k>>2]=a;c[k+4>>2]=0;c[k+8>>2]=d;s=sa(221,k|0)|0;if((s|0)>-1){c[h>>2]=s;c[h+4>>2]=2;c[h+8>>2]=1;sa(221,h|0)|0}v=eu(s)|0;break a}else{if((u|0)>-1){c[l>>2]=u;wa(6,l|0)|0}v=eu(-22)|0;break a}break}default:if((b+-12|0)>>>0<5){c[g>>2]=a;c[g+4>>2]=b;c[g+8>>2]=d;v=eu(sa(221,g|0)|0)|0;break a}else{c[f>>2]=a;c[f+4>>2]=b;c[f+8>>2]=d;v=eu(sa(221,f|0)|0)|0;break a}}while(0);i=e;return v|0}function uv(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b;c[d>>2]=a;a=wa(6,d|0)|0;d=eu((a|0)==-4?-115:a)|0;i=b;return d|0}function vv(b,c,d){b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0;a:do if(!d)e=0;else{f=d;g=b;h=c;while(1){i=a[g>>0]|0;j=a[h>>0]|0;if(i<<24>>24!=j<<24>>24){k=i;l=j;break}f=f+-1|0;if(!f){e=0;break a}else{g=g+1|0;h=h+1|0}}e=(k&255)-(l&255)|0}while(0);return e|0}function wv(a){a=a|0;return Uw(a|0)|0}function xv(a,b,c){a=a|0;b=b|0;c=c|0;yv(a,b,c)|0;return a|0}function yv(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0;f=d;do if(!((f^b)&3)){g=(e|0)!=0;a:do if(g&(f&3|0)!=0){h=e;i=d;j=b;while(1){k=a[i>>0]|0;a[j>>0]=k;if(!(k<<24>>24)){l=h;m=i;n=j;break a}k=h+-1|0;o=i+1|0;p=j+1|0;q=(k|0)!=0;if(q&(o&3|0)!=0){h=k;i=o;j=p}else{r=k;s=o;t=p;u=q;v=5;break}}}else{r=e;s=d;t=b;u=g;v=5}while(0);if((v|0)==5)if(u){l=r;m=s;n=t}else{w=t;x=0;break}if(!(a[m>>0]|0)){w=n;x=l}else{b:do if(l>>>0>3){g=l;j=n;i=m;while(1){h=c[i>>2]|0;if((h&-2139062144^-2139062144)&h+-16843009|0){y=g;z=j;A=i;break b}c[j>>2]=h;h=g+-4|0;q=i+4|0;p=j+4|0;if(h>>>0>3){g=h;j=p;i=q}else{y=h;z=p;A=q;break}}}else{y=l;z=n;A=m}while(0);B=A;C=z;D=y;v=11}}else{B=d;C=b;D=e;v=11}while(0);c:do if((v|0)==11)if(!D){w=C;x=0}else{e=B;b=C;d=D;while(1){y=a[e>>0]|0;a[b>>0]=y;if(!(y<<24>>24)){w=b;x=d;break c}d=d+-1|0;y=b+1|0;if(!d){w=y;x=0;break}else{e=e+1|0;b=y}}}while(0);Sw(w|0,0,x|0)|0;return w|0}function zv(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,k=0;e=i;i=i+32|0;if((i|0)>=(j|0))U();f=e+16|0;g=e;if(Lu(70312,a[d>>0]|0,4)|0){h=Av(d)|0|32768;c[g>>2]=b;c[g+4>>2]=h;c[g+8>>2]=438;h=eu(gb(5,g|0)|0)|0;if((h|0)>=0){g=Dv(h,d)|0;if(!g){c[f>>2]=h;wa(6,f|0)|0;k=0}else k=g}else k=0}else{c[(fu()|0)>>2]=22;k=0}i=e;return k|0}function Av(b){b=b|0;var c=0,d=0,e=0,f=0;c=(Bv(b,43)|0)==0;d=a[b>>0]|0;e=c?d<<24>>24!=114&1:2;c=(Bv(b,120)|0)==0;f=c?e:e|128;e=(Bv(b,101)|0)==0;b=e?f:f|524288;f=d<<24>>24==114?b:b|64;b=d<<24>>24==119?f|512:f;return (d<<24>>24==97?b|1024:b)|0}function Bv(b,c){b=b|0;c=c|0;var d=0;d=Cv(b,c)|0;return ((a[d>>0]|0)==(c&255)<<24>>24?d:0)|0}function Cv(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0;e=d&255;a:do if(!e)f=b+(Tu(b)|0)|0;else{if(!(b&3))g=b;else{h=d&255;i=b;while(1){j=a[i>>0]|0;if(j<<24>>24==0?1:j<<24>>24==h<<24>>24){f=i;break a}j=i+1|0;if(!(j&3)){g=j;break}else i=j}}i=R(e,16843009)|0;h=c[g>>2]|0;b:do if(!((h&-2139062144^-2139062144)&h+-16843009)){j=h;k=g;while(1){l=j^i;if((l&-2139062144^-2139062144)&l+-16843009|0){m=k;break b}l=k+4|0;j=c[l>>2]|0;if((j&-2139062144^-2139062144)&j+-16843009|0){m=l;break}else k=l}}else m=g;while(0);i=d&255;h=m;while(1){k=a[h>>0]|0;if(k<<24>>24==0?1:k<<24>>24==i<<24>>24){f=h;break}else h=h+1|0}}while(0);return f|0}function Dv(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;e=i;i=i+112|0;if((i|0)>=(j|0))U();f=e+40|0;g=e+24|0;h=e+16|0;k=e;l=e+52|0;m=a[d>>0]|0;if(Lu(70312,m<<24>>24,4)|0){n=yw(1144)|0;if(!n)o=0;else{p=n;q=p+112|0;do{c[p>>2]=0;p=p+4|0}while((p|0)<(q|0));if(!(Bv(d,43)|0))c[n>>2]=m<<24>>24==114?8:4;if(!(Bv(d,101)|0))r=m;else{c[k>>2]=b;c[k+4>>2]=2;c[k+8>>2]=1;sa(221,k|0)|0;r=a[d>>0]|0}if(r<<24>>24==97){c[h>>2]=b;c[h+4>>2]=3;r=sa(221,h|0)|0;if(!(r&1024)){c[g>>2]=b;c[g+4>>2]=4;c[g+8>>2]=r|1024;sa(221,g|0)|0}g=c[n>>2]|128;c[n>>2]=g;s=g}else s=c[n>>2]|0;c[n+60>>2]=b;c[n+44>>2]=n+120;c[n+48>>2]=1024;g=n+75|0;a[g>>0]=-1;if((s&8|0)==0?(c[f>>2]=b,c[f+4>>2]=21505,c[f+8>>2]=l,(_a(54,f|0)|0)==0):0)a[g>>0]=10;c[n+32>>2]=35;c[n+36>>2]=25;c[n+40>>2]=24;c[n+12>>2]=10;if(!(c[17730]|0))c[n+76>>2]=-1;eb(70944);g=c[17735]|0;c[n+56>>2]=g;if(g|0)c[g+52>>2]=n;c[17735]=n;$a(70944);o=n}}else{c[(fu()|0)>>2]=22;o=0}i=e;return o|0}function Ev(a){a=a|0;var b=0,d=0,e=0,f=0;b=(c[a>>2]&1|0)!=0;if(!b){eb(70944);d=c[a+52>>2]|0;e=a+56|0;if(d|0)c[d+56>>2]=c[e>>2];f=c[e>>2]|0;if(f|0)c[f+52>>2]=d;if((c[17735]|0)==(a|0))c[17735]=f;$a(70944)}f=Fv(a)|0;d=wb[c[a+12>>2]&15](a)|0|f;f=c[a+92>>2]|0;if(f|0)zw(f);if(!b)zw(a);return d|0}function Fv(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0;do if(a){if((c[a+76>>2]|0)<=-1){b=Gv(a)|0;break}d=(Ru(a)|0)==0;e=Gv(a)|0;if(d)b=e;else{ju(a);b=e}}else{if(!(c[3959]|0))f=0;else f=Fv(c[3959]|0)|0;eb(70944);e=c[17735]|0;if(!e)g=f;else{d=e;e=f;while(1){if((c[d+76>>2]|0)>-1)h=Ru(d)|0;else h=0;if((c[d+20>>2]|0)>>>0>(c[d+28>>2]|0)>>>0)i=Gv(d)|0|e;else i=e;if(h|0)ju(d);d=c[d+56>>2]|0;if(!d){g=i;break}else e=i}}$a(70944);b=g}while(0);return b|0}function Gv(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0;b=a+20|0;d=a+28|0;if((c[b>>2]|0)>>>0>(c[d>>2]|0)>>>0?(sb[c[a+36>>2]&63](a,0,0)|0,(c[b>>2]|0)==0):0)e=-1;else{f=a+4|0;g=c[f>>2]|0;h=a+8|0;i=c[h>>2]|0;if(g>>>0<i>>>0)sb[c[a+40>>2]&63](a,g-i|0,1)|0;c[a+16>>2]=0;c[d>>2]=0;c[b>>2]=0;c[h>>2]=0;c[f>>2]=0;e=0}return e|0}function Hv(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,k=0,l=0,m=0,n=0,o=0;g=i;i=i+16|0;if((i|0)>=(j|0))U();h=g;a:do if(!e)k=0;else{do if(f|0){l=(b|0)==0?h:b;m=a[e>>0]|0;n=m&255;if(m<<24>>24>-1){c[l>>2]=n;k=m<<24>>24!=0&1;break a}m=n+-194|0;if(m>>>0<=50){n=e+1|0;o=c[15956+(m<<2)>>2]|0;if(f>>>0<4?o&-2147483648>>>((f*6|0)+-6|0)|0:0)break;m=d[n>>0]|0;n=m>>>3;if((n+-16|n+(o>>26))>>>0<=7){n=m+-128|o<<6;if((n|0)>=0){c[l>>2]=n;k=2;break a}o=d[e+2>>0]|0;if((o&192|0)==128){m=o+-128|n<<6;if((m|0)>=0){c[l>>2]=m;k=3;break a}n=d[e+3>>0]|0;if((n&192|0)==128){c[l>>2]=n+-128|m<<6;k=4;break a}}}}}while(0);c[(fu()|0)>>2]=84;k=-1}while(0);i=g;return k|0}function Iv(a,b){a=a|0;b=b|0;return (Jv(a,Tu(a)|0,1,b)|0)+-1|0}function Jv(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0;f=R(d,b)|0;if((c[e+76>>2]|0)>-1){g=(Ru(e)|0)==0;h=Hu(a,f,e)|0;if(g)i=h;else{ju(e);i=h}}else i=Hu(a,f,e)|0;if((i|0)==(f|0))j=d;else j=(i>>>0)/(b>>>0)|0;return j|0}function Kv(){var a=0,b=0;a=i;i=i+16|0;if((i|0)>=(j|0))U();b=za(20,a|0)|0;i=a;return b|0}function Lv(a,b){a=a|0;b=b|0;var d=0,e=0;d=i;i=i+16|0;if((i|0)>=(j|0))U();e=d;c[e>>2]=a;c[e+4>>2]=b;b=eu(Za(33,e|0)|0)|0;i=d;return b|0}function Mv(a){a=a|0;var b=0,d=0,e=0;if((c[a+76>>2]|0)>-1){b=(Ru(a)|0)==0;d=(c[a>>2]|0)>>>4&1;if(b)e=d;else e=d}else e=(c[a>>2]|0)>>>4&1;return e|0}function Nv(b,c){b=b|0;c=c|0;var d=0,e=0,f=0,g=0;d=b;e=70316;f=d+15|0;do{a[d>>0]=a[e>>0]|0;d=d+1|0;e=e+1|0}while((d|0)<(f|0));if(!c){a[b+14>>0]=48;a[b+15>>0]=0}else{e=14;d=c;while(1){f=e+1|0;if(d>>>0<10){g=f;break}else{e=f;d=(d>>>0)/10|0}}a[b+g>>0]=0;d=c;c=g;while(1){c=c+-1|0;a[b+c>>0]=(d>>>0)%10|0|48;if(d>>>0<10)break;else d=(d>>>0)/10|0}}return}function Ov(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,k=0;d=i;i=i+48|0;if((i|0)>=(j|0))U();e=d+40|0;f=d+8|0;g=d;c[g>>2]=a;c[g+4>>2]=b;h=Ka(197,g|0)|0;if((h|0)==-9?(c[f>>2]=a,c[f+4>>2]=1,(sa(221,f|0)|0)>=0):0){Nv(f,a);c[e>>2]=f;c[e+4>>2]=b;k=eu(La(195,e|0)|0)|0}else k=eu(h)|0;i=d;return k|0}function Pv(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0;g=i;i=i+32|0;if((i|0)>=(j|0))U();h=g;c[h>>2]=a;c[h+4>>2]=b;c[h+8>>2]=d;c[h+12>>2]=e;c[h+16>>2]=f;f=eu(ob(142,h|0)|0)|0;i=g;return f|0}function Qv(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;e=i;i=i+16|0;if((i|0)>=(j|0))U();f=e;c[f>>2]=a;c[f+4>>2]=b;c[f+8>>2]=d;d=eu(hb(4,f|0)|0)|0;i=e;return d|0}function Rv(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;e=i;i=i+16|0;if((i|0)>=(j|0))U();f=e;c[f>>2]=a;c[f+4>>2]=b;c[f+8>>2]=d;d=eu(cb(3,f|0)|0)|0;i=e;return d|0}function Sv(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=i;i=i+32|0;if((i|0)>=(j|0))U();f=e;g=e+16|0;c[g>>2]=d;d=(c[g>>2]|0)+(4-1)&~(4-1);h=c[d>>2]|0;c[g>>2]=d+4;c[f>>2]=a;c[f+4>>2]=b|32768;c[f+8>>2]=h;h=eu(gb(5,f|0)|0)|0;i=e;return h|0}function Tv(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b;c[d>>2]=a;a=eu(bb(10,d|0)|0)|0;i=b;return a|0}function Uv(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0;f=i;i=i+32|0;if((i|0)>=(j|0))U();g=f;c[g>>2]=b;c[g+4>>2]=d;c[g+8>>2]=e;c[g+12>>2]=a;e=g+16|0;c[e>>2]=0;d=g+20|0;c[d>>2]=0;switch(a|0){case 208:case 203:case 213:{c[e>>2]=1;break}default:{}}Zv(8,g);g=c[d>>2]|0;if(!g)h=0;else{c[(fu()|0)>>2]=g;h=-1}i=f;return h|0}function Vv(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;b=i;i=i+32|0;if((i|0)>=(j|0))U();d=b+16|0;e=b;f=a+20|0;do if(!(c[f>>2]|0)){if((c[a+16>>2]|0?(g=c[a>>2]|0,(g|0)>-1):0)?(g|0)!=(Wv()|0):0){c[d>>2]=c[178];c[d+4>>2]=c[179];c[d+8>>2]=c[180];c[d+12>>2]=c[181];Xv(6,e)|0;g=Yv(6,d)|0;c[f>>2]=0-g;if(!((g|0)!=0?(c[17733]|0)!=0:0)){c[f>>2]=1;Yv(6,e)|0}break}c[f>>2]=1}while(0);i=b;return}function Wv(){var a=0,b=0;a=i;i=i+16|0;if((i|0)>=(j|0))U();b=Na(199,a|0)|0;i=a;return b|0}function Xv(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,k=0,l=0;d=i;i=i+32|0;if((i|0)>=(j|0))U();e=d+16|0;f=d;g=d+24|0;c[f>>2]=0;c[f+4>>2]=a;c[f+8>>2]=0;c[f+12>>2]=b;h=eu(db(340,f|0)|0)|0;if(!h){f=b;if((c[f>>2]|0)==-1?(c[f+4>>2]|0)==-1:0){f=b;c[f>>2]=-1;c[f+4>>2]=-1}f=b+8|0;k=f;if((c[k>>2]|0)==-1?(c[k+4>>2]|0)==-1:0){k=f;c[k>>2]=-1;c[k+4>>2]=-1;l=0}else l=0}else if((c[(fu()|0)>>2]|0)==38){c[e>>2]=a;c[e+4>>2]=g;if((eu(Ja(191,e|0)|0)|0)>=0){e=c[g>>2]|0;a=(e|0)==-1;k=b;c[k>>2]=a?-1:e;c[k+4>>2]=a?-1:0;k=c[g+4>>2]|0;g=(k|0)==-1;e=b+8|0;f=e;c[f>>2]=g?-1:k;c[f+4>>2]=g?-1:0;if(a){a=b;c[a>>2]=-1;c[a+4>>2]=-1}if(g){g=e;c[g>>2]=-1;c[g+4>>2]=-1;l=0}else l=0}else l=-1}else l=h;i=d;return l|0}function Yv(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,k=0,l=0,m=0;d=i;i=i+32|0;if((i|0)>=(j|0))U();e=d+16|0;f=d;g=d+24|0;c[f>>2]=0;c[f+4>>2]=a;c[f+8>>2]=b;c[f+12>>2]=0;h=db(340,f|0)|0;if((h|0)==-38){f=b;k=c[f>>2]|0;l=c[f+4>>2]|0;f=l>>>0<0|(l|0)==0&k>>>0<4294967295;l=f?k:-1;c[g>>2]=l;l=b+8|0;b=c[l>>2]|0;k=c[l+4>>2]|0;l=k>>>0<0|(k|0)==0&b>>>0<4294967295;k=l?b:-1;c[g+4>>2]=k;c[e>>2]=a;c[e+4>>2]=g;m=Ua(75,e|0)|0}else m=h;i=d;return m|0}function Zv(a,b){a=a|0;b=b|0;ub[a&15](b);return}function _v(){var a=0,b=0;a=i;i=i+16|0;if((i|0)>=(j|0))U();b=kb(201,a|0)|0;i=a;return b|0}function $v(a){a=a|0;return Uv(213,a,0,0)|0}function aw(a,b){a=a|0;b=b|0;var d=0,e=0;d=i;i=i+16|0;if((i|0)>=(j|0))U();e=d;c[e>>2]=a;c[e+4>>2]=0;c[e+8>>2]=b;c[e+12>>2]=((b|0)<0)<<31>>31;b=eu(Ma(194,e|0)|0)|0;i=d;return b|0}function bw(){var a=0,b=0;a=i;i=i+16|0;if((i|0)>=(j|0))U();b=ua(64,a|0)|0;i=a;return b|0}function cw(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=i;i=i+16|0;if((i|0)>=(j|0))U();e=d;do{c[e>>2]=a;c[e+4>>2]=b;f=va(63,e|0)|0}while((f|0)==-16);g=f;e=eu(g)|0;i=d;return e|0}function dw(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,k=0,l=0,m=0,n=0;h=i;i=i+32|0;if((i|0)>=(j|0))U();k=h;do if((g&4095|0)==0&(((g|0)<0)<<31>>31&-4096|0)==0){if(b>>>0>2147483646){c[(fu()|0)>>2]=12;l=-1;break}m=(e&16|0)!=0;if(m)ew(-1);c[k>>2]=a;c[k+4>>2]=b;c[k+8>>2]=d;c[k+12>>2]=e;c[k+16>>2]=f;c[k+20>>2]=g>>12;n=eu(Ia(192,k|0)|0)|0;if(m){fw();l=n}else l=n}else{c[(fu()|0)>>2]=22;l=-1}while(0);i=h;return l|0}function ew(a){a=a|0;return}function fw(){return}function gw(a,b){a=a|0;b=b|0;var d=0,e=0;d=i;i=i+16|0;if((i|0)>=(j|0))U();e=d;ew(-1);c[e>>2]=a;c[e+4>>2]=b;b=eu(Ta(91,e|0)|0)|0;fw();i=d;return b|0}function hw(a){a=a|0;var b=0;b=70360;c[b>>2]=a+-1;c[b+4>>2]=0;return}function iw(){var a=0,b=0,d=0;a=70360;b=Xw(c[a>>2]|0,c[a+4>>2]|0,1284865837,1481765933)|0;a=Gw(b|0,C|0,1,0)|0;b=C;d=70360;c[d>>2]=a;c[d+4>>2]=b;d=Mw(a|0,b|0,33)|0;return d|0}function jw(a){a=a|0;eb(70964);kw(a);$a(70964);return}function kw(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0;b=c[4090]|0;if(!b)c[c[4091]>>2]=a;else{c[4124]=(b|0)==31|(b|0)==7?3:1;c[17743]=0;if((b|0)>0){d=c[4091]|0;e=0;f=a;a=0;do{g=Xw(f|0,e|0,1284865837,1481765933)|0;f=Gw(g|0,C|0,1,0)|0;e=C;c[d+(a<<2)>>2]=e;a=a+1|0}while((a|0)<(b|0));h=d}else h=c[4091]|0;c[h>>2]=c[h>>2]|1}return}function lw(){var a=0,b=0,d=0,e=0,f=0,g=0,h=0;eb(70964);a=c[4090]|0;if(!a){b=c[4091]|0;d=(R(c[b>>2]|0,1103515245)|0)+12345&2147483647;c[b>>2]=d;e=d}else{d=c[17743]|0;b=c[4091]|0;f=c[4124]|0;g=b+(f<<2)|0;h=(c[g>>2]|0)+(c[b+(d<<2)>>2]|0)|0;c[g>>2]=h;g=f+1|0;c[4124]=(g|0)==(a|0)?0:g;g=d+1|0;c[17743]=(g|0)==(a|0)?0:g;e=h>>>1}$a(70964);return e|0}function mw(b){b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;c=b;while(1){b=c+1|0;if(!(fv(a[c>>0]|0)|0)){d=c;e=b;break}else c=b}c=a[d>>0]|0;switch(c<<24>>24|0){case 45:{f=1;g=5;break}case 43:{f=0;g=5;break}default:{h=d;i=c;j=0}}if((g|0)==5){h=e;i=a[e>>0]|0;j=f}f=(i<<24>>24)+-48|0;if(f>>>0<10){i=h;h=f;f=0;while(1){i=i+1|0;e=(f*10|0)-h|0;h=(a[i>>0]|0)+-48|0;if(h>>>0>=10){k=e;break}else f=e}}else k=0;return (j|0?k:0-k|0)|0}function nw(a,b){a=a|0;b=b|0;var d=0,e=0;d=i;i=i+16|0;if((i|0)>=(j|0))U();e=d;c[e>>2]=a;c[e+4>>2]=b;b=eu(Xa(77,e|0)|0)|0;i=d;return b|0}function ow(a,b){a=a|0;b=b|0;return pw(a,b,(Tu(a)|0)+1|0)|0}function pw(b,c,d){b=b|0;c=c|0;d=d|0;var e=0,f=0;e=c&255;c=d;while(1){if(!c){f=0;break}c=c+-1|0;d=b+c|0;if((a[d>>0]|0)==e<<24>>24){f=d;break}}return f|0}function qw(a){a=a|0;return (a+-48|0)>>>0<10|0}function rw(a,b){a=a|0;b=b|0;var d=0;if(!a)d=Aw(1,24)|0;else{c[b>>2]=0;c[b+4>>2]=0;c[b+8>>2]=0;c[b+12>>2]=0;c[b+16>>2]=0;c[b+20>>2]=0;d=b}return d|0}function sw(a){a=a|0;var b=0,d=0;b=c[a>>2]|0;if(b|0){d=b;do{zw(c[d>>2]|0);b=d;d=c[d+4>>2]|0;zw(b)}while((d|0)!=0)}zw(a);return}function tw(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;g=a+16|0;a:do if(!(c[g>>2]|0)){h=a+12|0;i=c[h>>2]|0;do if(i>>>0<f>>>0){if(b|0)if(!d){c[g>>2]=1;j=0;break a}else{k=a+8|0;c[k>>2]=d;c[h>>2]=1024;l=k;m=d;n=d;o=1024;break}k=f<<3;p=k>>>0>1024?k:1024;k=yw(8)|0;if(!k){c[g>>2]=1;j=0;break a}q=yw(p)|0;c[k>>2]=q;r=q;if(!q){zw(k);c[g>>2]=1;j=0;break a}c[k+4>>2]=0;s=a+4|0;t=c[s>>2]|0;if(t|0)c[t+4>>2]=k;if(!(c[a>>2]|0))c[a>>2]=k;c[s>>2]=k;k=a+8|0;c[k>>2]=r;c[h>>2]=p;l=k;m=r;n=q;o=p}else{p=a+8|0;q=c[p>>2]|0;l=p;m=q;n=q;o=i}while(0);i=m+f&3;q=((i|0)==0?0:4-i|0)+f|0;c[l>>2]=n+q;c[h>>2]=o-q;if(!e)j=n;else{Sw(n|0,0,q|0)|0;j=n}}else j=0;while(0);return j|0}function uw(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0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0;l=(c[a>>2]&8|0)==0?d:0;d=k+40|0;m=c[d>>2]|0;if((m|0)>0&(l|0)!=0){n=yw(m<<2)|0;if(!n)o=12;else{p=n;q=3}}else{p=0;q=3}if((q|0)==3){if(!(c[k+60>>2]|0)){c[h>>2]=0;n=f&1;m=f&2;r=c[a>>2]&4;if(!p)s=0;else s=c[d>>2]|0;t=s<<2;u=c[k+52>>2]|0;v=u<<3;w=v+8|0;x=t+12+v+(w+(R(t,u)|0)<<1)|0;y=yw(x)|0;if(!y){z=12;A=0}else{Sw(y|0,0,x|0)|0;x=y+t|0;B=x&3;C=x+((B|0)==0?0:4-B|0)|0;B=C+w|0;x=B&3;D=B+((x|0)==0?0:4-x|0)|0;x=D+w|0;w=x&3;B=x+((w|0)==0?0:4-w|0)|0;w=B+v|0;v=w&3;if((u|0)>0){x=0;E=w+((v|0)==0?0:4-v|0)|0;while(1){c[D+(x<<3)+4>>2]=E;v=E+t|0;c[C+(x<<3)+4>>2]=v;x=x+1|0;if((x|0)==(u|0)){F=0;break}else E=v+t|0}do{c[B+(F<<3)>>2]=-1;F=F+1|0}while((F|0)!=(u|0))}u=Hv(h,b,4)|0;if((u|0)<1)if((u|0)<0){G=0;H=1}else{I=1;q=201}else{I=u;q=201}a:do if((q|0)==201){u=k+8|0;F=(r|0)!=0;E=(s|0)>0;x=k+12|0;v=k+44|0;w=k+32|0;J=k+36|0;K=(s|0)==0;L=(n|0)==0;M=(s|0)<1;N=-1;O=0;P=0;Q=I;S=0;T=D;V=C;W=C;X=b+I|0;Y=y;while(1){if((N|0)<0){Z=c[u>>2]|0;_=Z+8|0;b:do if(!(c[_>>2]|0)){$=N;aa=O;ba=W}else{ca=(P|0)!=0;da=(S|0)==95;ea=(P|0)==0;fa=F&(S|0)==10;ga=L&(P|0)<1;ha=_;ia=N;ja=O;ka=W;la=Z;while(1){ma=ha;na=la;c:while(1){oa=na+12|0;if((c[B+(c[oa>>2]<<3)>>2]|0)>=(P|0)){pa=ia;qa=ja;ra=ka;sa=na;break}ta=na+20|0;ua=c[ta>>2]|0;if(!ua){va=ma;wa=oa;xa=na;q=236;break}d:do if(fa|(ga|(ua&1|0)==0)){if(ua&2|0?(ya=c[h>>2]|0,!((ya|m|0)==0|F&(ya|0)==10)):0)break;do if(ua&16|0){if(da)break d;if(Xu(S)|0)break d;ya=c[h>>2]|0;if((ya|0)==95)break;if(!(Xu(ya)|0))break d}while(0);ya=c[ta>>2]|0;if(!(ya&32))za=ya;else{if(da){ya=c[h>>2]|0;if((ya|0)==95)break;else Aa=ya}else{ya=(Xu(S)|0)==0;Ba=c[h>>2]|0;if(ya|(Ba|0)==95)break;else Aa=Ba}if(Xu(Aa)|0)break;za=c[ta>>2]|0}Ba=c[h>>2]|0;do if((Ba|0)!=0&(ca&(za&64|0)!=0)){if(da){Ca=Ba;Da=1}else{ya=(Xu(S)|0)!=0;Ca=c[h>>2]|0;Da=ya}if((Ca|0)==95)if(Da)break d;else break;else if(Da^(Xu(Ca)|0)!=0)break;else break d}while(0);if(!(c[ta>>2]&128)){va=ma;wa=oa;xa=na;q=236;break c}Ba=c[h>>2]|0;if(ea|(Ba|0)==0)break;if(da){Ea=Ba;Fa=1}else{Ba=(Xu(S)|0)!=0;Ea=c[h>>2]|0;Fa=Ba}if((Ea|0)==95)if(Fa){va=ma;wa=oa;xa=na;q=236;break c}else break;else if(Fa^(Xu(Ea)|0)!=0)break;else{va=ma;wa=oa;xa=na;q=236;break c}}while(0);ma=na+40|0;if(!(c[ma>>2]|0)){$=ia;aa=ja;ba=ka;break b}else na=na+32|0}if((q|0)==236){q=0;c[ka>>2]=c[va>>2];if(E)Sw(c[ka+4>>2]|0,-1,t|0)|0;na=c[xa+16>>2]|0;do if(na|0){ma=c[na>>2]|0;if((ma|0)<=-1)break;oa=ka+4|0;ta=ma;ma=na;do{if((ta|0)<(s|0))c[(c[oa>>2]|0)+(ta<<2)>>2]=P;ma=ma+4|0;ta=c[ma>>2]|0}while((ta|0)>-1)}while(0);na=(c[ka>>2]|0)!=(c[x>>2]|0);if(M|na){Ga=ka+4|0;Ha=na?ia:P;Ia=na?ja:1}else{na=ka+4|0;ta=c[na>>2]|0;ma=0;do{c[p+(ma<<2)>>2]=c[ta+(ma<<2)>>2];ma=ma+1|0}while((ma|0)!=(s|0));Ga=na;Ha=P;Ia=1}na=c[wa>>2]|0;c[B+(na<<3)>>2]=P;c[B+(na<<3)+4>>2]=Ga;pa=Ha;qa=Ia;ra=ka+8|0;sa=xa}ha=sa+40|0;if(!(c[ha>>2]|0)){$=pa;aa=qa;ba=ra;break}else{ia=pa;ja=qa;ka=ra;la=sa+32|0}}}while(0);c[ba>>2]=0;Z=c[h>>2]|0;if(!Z){Ja=$;break}else{Ka=Z;La=$;Ma=aa}}else{if(K){Ja=N;break}Z=c[h>>2]|0;if((W|0)!=(V|0)&(Z|0)!=0){Ka=Z;La=N;Ma=O}else{Ja=N;break}}Z=P+Q|0;_=Hv(h,X,4)|0;if((_|0)<1)if((_|0)<0){G=0;H=1;break a}else Na=1;else Na=_;_=X+Na|0;if((Ma|0)!=0&(c[v>>2]|0)!=0){if(!(c[V>>2]|0))Oa=T;else{la=c[J>>2]|0;ka=c[la>>2]|0;ja=(ka|0)>-1;ia=V;ha=T;while(1){da=ia+4|0;e:do if(ja){ea=la;ca=ka;ga=0;while(1){fa=c[ea+((ga|1)<<2)>>2]|0;if((ca|0)>=(s|0)){Pa=ha;break e}na=c[da>>2]|0;if((c[na+(fa<<2)>>2]|0)==(c[p+(fa<<2)>>2]|0)?(c[na+(ca<<2)>>2]|0)<(c[p+(ca<<2)>>2]|0):0){Pa=ha;break e}ga=ga+2|0;ea=c[J>>2]|0;ca=c[ea+(ga<<2)>>2]|0;if((ca|0)<=-1){Qa=na;break}}Ra=da;Sa=Qa;q=265}else{Ra=da;Sa=c[da>>2]|0;q=265}while(0);if((q|0)==265){q=0;c[ha>>2]=c[ia>>2];da=ha+4|0;ca=c[da>>2]|0;c[da>>2]=Sa;c[Ra>>2]=ca;Pa=ha+8|0}ia=ia+8|0;if(!(c[ia>>2]|0)){Oa=Pa;break}else ha=Pa}}c[Oa>>2]=0;Ta=0;Ua=T;Va=V}else{Ta=Ma;Ua=V;Va=T}ha=c[Ua>>2]|0;if(!ha){Wa=La;Xa=Ta;Ya=Va;Za=Y}else{ia=(Z|0)!=0;ka=(Ka|0)==95;la=(Z|0)==0;ja=F&(Ka|0)==10;ca=L&(Z|0)<1;da=ha;ha=La;ga=Ta;ea=Ua;na=Va;fa=Y;while(1){ma=da+8|0;if(!(c[ma>>2]|0)){_a=ha;$a=ga;ab=na;bb=fa}else{ta=ea+4|0;oa=fa;ua=ma;ma=ha;Ba=ga;ya=na;cb=da;while(1){f:do if((c[cb>>2]|0)>>>0>Ka>>>0){db=ma;eb=Ba;fb=ya;gb=oa}else{if((c[cb+4>>2]|0)>>>0<Ka>>>0){db=ma;eb=Ba;fb=ya;gb=oa;break}hb=cb+20|0;ib=c[hb>>2]|0;do if(ib|0){if(!(ja|(ca|(ib&1|0)==0))){db=ma;eb=Ba;fb=ya;gb=oa;break f}if(ib&2|0?(jb=c[h>>2]|0,!((jb|m|0)==0|F&(jb|0)==10)):0){db=ma;eb=Ba;fb=ya;gb=oa;break f}do if(ib&16|0){if(ka){db=ma;eb=Ba;fb=ya;gb=oa;break f}if(Xu(Ka)|0){db=ma;eb=Ba;fb=ya;gb=oa;break f}jb=c[h>>2]|0;if((jb|0)==95)break;if(!(Xu(jb)|0)){db=ma;eb=Ba;fb=ya;gb=oa;break f}}while(0);jb=c[hb>>2]|0;if(!(jb&32))kb=jb;else{if(ka){jb=c[h>>2]|0;if((jb|0)==95){db=ma;eb=Ba;fb=ya;gb=oa;break f}else lb=jb}else{jb=(Xu(Ka)|0)==0;mb=c[h>>2]|0;if(jb|(mb|0)==95){db=ma;eb=Ba;fb=ya;gb=oa;break f}else lb=mb}if(Xu(lb)|0){db=ma;eb=Ba;fb=ya;gb=oa;break f}kb=c[hb>>2]|0}mb=c[h>>2]|0;do if((mb|0)!=0&(ia&(kb&64|0)!=0)){if(ka){nb=mb;ob=1}else{jb=(Xu(Ka)|0)!=0;nb=c[h>>2]|0;ob=jb}if((nb|0)==95)if(ob){db=ma;eb=Ba;fb=ya;gb=oa;break f}else break;else if(ob^(Xu(nb)|0)!=0)break;else{db=ma;eb=Ba;fb=ya;gb=oa;break f}}while(0);do if(c[hb>>2]&128|0){mb=c[h>>2]|0;if(la|(mb|0)==0){db=ma;eb=Ba;fb=ya;gb=oa;break f}if(ka){pb=mb;qb=1}else{mb=(Xu(Ka)|0)!=0;pb=c[h>>2]|0;qb=mb}if((pb|0)==95)if(qb)break;else{db=ma;eb=Ba;fb=ya;gb=oa;break f}else if(qb^(Xu(pb)|0)!=0){db=ma;eb=Ba;fb=ya;gb=oa;break f}else break}while(0);mb=c[hb>>2]|0;do if(!(mb&4))rb=mb;else{if(c[a>>2]&2|0){rb=mb;break}if(!(Wu(Ka,c[cb+24>>2]|0)|0)){db=ma;eb=Ba;fb=ya;gb=oa;break f}rb=c[hb>>2]|0}while(0);do if(rb&4|0){if(!(c[a>>2]&2))break;mb=vu(Ka)|0;jb=cb+24|0;if(Wu(mb,c[jb>>2]|0)|0)break;mb=su(Ka)|0;if(!(Wu(mb,c[jb>>2]|0)|0)){db=ma;eb=Ba;fb=ya;gb=oa;break f}}while(0);if(!(c[hb>>2]&8))break;if(xw(c[cb+28>>2]|0,Ka,c[a>>2]&2)|0){db=ma;eb=Ba;fb=ya;gb=oa;break f}}while(0);if(E){hb=c[ta>>2]|0;ib=0;do{c[oa+(ib<<2)>>2]=c[hb+(ib<<2)>>2];ib=ib+1|0}while((ib|0)!=(s|0))}ib=c[cb+16>>2]|0;do if(ib|0){hb=c[ib>>2]|0;if((hb|0)>-1){sb=hb;tb=ib}else break;do{if((sb|0)<(s|0))c[oa+(sb<<2)>>2]=Z;tb=tb+4|0;sb=c[tb>>2]|0}while((sb|0)>-1)}while(0);ib=c[cb+12>>2]|0;hb=B+(ib<<3)|0;if((c[hb>>2]|0)>=(Z|0)){jb=c[B+(ib<<3)+4>>2]|0;mb=c[jb>>2]|0;if(!(vw(s,c[w>>2]|0,oa,mb)|0)){db=ma;eb=Ba;fb=ya;gb=oa;break}c[jb>>2]=oa;if((c[ua>>2]|0)!=(c[x>>2]|0)){db=ma;eb=Ba;fb=ya;gb=mb;break}if(E)ub=0;else{db=Z;eb=1;fb=ya;gb=mb;break}while(1){c[p+(ub<<2)>>2]=c[oa+(ub<<2)>>2];ub=ub+1|0;if((ub|0)==(s|0)){db=Z;eb=1;fb=ya;gb=mb;break f}}}mb=c[ua>>2]|0;c[ya>>2]=mb;jb=ya+4|0;vb=c[jb>>2]|0;c[jb>>2]=oa;c[hb>>2]=Z;c[B+(ib<<3)+4>>2]=jb;do if((mb|0)==(c[x>>2]|0)){if((ma|0)==-1){if(!E){wb=Z;xb=1;break}}else{if(!E){wb=ma;xb=Ba;break}if((c[oa>>2]|0)>(c[p>>2]|0)){wb=ma;xb=Ba;break}}yb=c[jb>>2]|0;zb=0;do{c[p+(zb<<2)>>2]=c[yb+(zb<<2)>>2];zb=zb+1|0}while((zb|0)<(s|0));wb=Z;xb=1}else{wb=ma;xb=Ba}while(0);db=wb;eb=xb;fb=ya+8|0;gb=vb}while(0);ua=cb+40|0;if(!(c[ua>>2]|0)){_a=db;$a=eb;ab=fb;bb=gb;break}else{oa=gb;ma=db;Ba=eb;ya=fb;cb=cb+32|0}}}ea=ea+8|0;da=c[ea>>2]|0;if(!da){Wa=_a;Xa=$a;Ya=ab;Za=bb;break}else{ha=_a;ga=$a;na=ab;fa=bb}}}c[Ya>>2]=0;N=Wa;O=Xa;P=Z;Q=Na;S=Ka;T=Ua;V=Va;W=Ya;X=_;Y=Za}G=Ja;H=Ja>>>31}while(0);zw(y);z=H;A=G}Ab=A;Bb=z}else{c[h>>2]=0;z=f&1;A=f&2;f=c[a>>2]&4;G=rw(0,0)|0;g:do if(G){H=tw(G,0,0,0,32)|0;if(!H){sw(G);Cb=12;Db=0;break}c[H+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if(Ta&2|0?(La=c[h>>2]|0,!((La|A|0)==0|Na&(La|0)==10)):0){Ob=sb;Pb=kb;Qb=lb;break}do if(Ta&16|0){if(rb){Ob=sb;Pb=kb;Qb=lb;break j}if(Xu(xb)|0){Ob=sb;Pb=kb;Qb=lb;break j}La=c[h>>2]|0;if((La|0)==95)break;if(!(Xu(La)|0)){Ob=sb;Pb=kb;Qb=lb;break j}}while(0);vb=c[ub>>2]|0;if(!(vb&32))Rb=vb;else{if(rb){vb=c[h>>2]|0;if((vb|0)==95){Ob=sb;Pb=kb;Qb=lb;break}else Sb=vb}else{vb=(Xu(xb)|0)==0;La=c[h>>2]|0;if(vb|(La|0)==95){Ob=sb;Pb=kb;Qb=lb;break}else Sb=La}if(Xu(Sb)|0){Ob=sb;Pb=kb;Qb=lb;break}Rb=c[ub>>2]|0}La=c[h>>2]|0;do if((La|0)!=0&(tb&(Rb&64|0)!=0)){if(rb){Tb=La;Ub=1}else{vb=(Xu(xb)|0)!=0;Tb=c[h>>2]|0;Ub=vb}if((Tb|0)==95)if(Ub){Ob=sb;Pb=kb;Qb=lb;break j}else break;else if(Ub^(Xu(Tb)|0)!=0)break;else{Ob=sb;Pb=kb;Qb=lb;break j}}while(0);if(!(c[ub>>2]&128)){q=52;break}La=c[h>>2]|0;if(pb|(La|0)==0){Ob=sb;Pb=kb;Qb=lb;break}if(rb){Vb=La;Wb=1}else{La=(Xu(xb)|0)!=0;Vb=c[h>>2]|0;Wb=La}if((Vb|0)==95)if(Wb){q=52;break}else{Ob=sb;Pb=kb;Qb=lb;break}else if(Wb^(Xu(Vb)|0)!=0){Ob=sb;Pb=kb;Qb=lb;break}else{q=52;break}}else q=52;while(0);do if((q|0)==52){q=0;if(!lb){Ob=c[m+16>>2]|0;Pb=kb;Qb=c[ob>>2]|0;break}ub=kb+28|0;Ta=c[ub>>2]|0;if(!Ta){La=tw(G,0,0,0,32)|0;if(!La){q=56;break i}c[La+24>>2]=kb;c[La+28>>2]=0;vb=tw(G,0,0,0,c[d>>2]<<2)|0;c[La+20>>2]=vb;if(!vb){q=63;break i}c[ub>>2]=La;Xb=La}else Xb=Ta;c[Xb>>2]=wb;c[Xb+4>>2]=s;c[Xb+8>>2]=c[ob>>2];c[Xb+12>>2]=c[m+12>>2];c[Xb+16>>2]=c[h>>2];if((c[d>>2]|0)>0){Ta=c[Xb+20>>2]|0;La=0;do{c[Ta+(La<<2)>>2]=c[Jb+(La<<2)>>2];La=La+1|0}while((La|0)<(c[d>>2]|0))}La=c[m+16>>2]|0;if(!La){Ob=sb;Pb=Xb;Qb=lb;break}Ta=c[La>>2]|0;if((Ta|0)<=-1){Ob=sb;Pb=Xb;Qb=lb;break}ub=c[Xb+20>>2]|0;vb=Ta;Ta=La;do{Ta=Ta+4|0;c[ub+(vb<<2)>>2]=wb;vb=c[Ta>>2]|0}while((vb|0)>-1);Ob=sb;Pb=Xb;Qb=lb}while(0);ob=m+40|0;if(!(c[ob>>2]|0)){Yb=Ob;Zb=Pb;_b=Qb;break}else{sb=Ob;kb=Pb;lb=Qb;m=m+32|0}}if(Yb){m=c[Yb>>2]|0;if((m|0)>-1){lb=m;m=Yb;while(1){c[Jb+(lb<<2)>>2]=wb;kb=m+4|0;lb=c[kb>>2]|0;if((lb|0)<=-1){$b=kb;break}else m=kb}}else $b=Yb}else $b=0;if(!_b){ac=_a;bc=$b;cc=wb;dc=Nb;ec=Zb;fc=0;gc=s;q=174}else{hc=_a;ic=$b;jc=wb;kc=Nb;lc=Zb;mc=_b;nc=s;q=82}}else{ac=_a;bc=0;cc=wb;dc=Nb;ec=db;fc=0;gc=s;q=174}k:while(1){l:do if((q|0)==82){q=0;if((mc|0)==(c[Ja>>2]|0)){if((hc|0)>=(jc|0)){if(!(Ua&(hc|0)==(jc|0))){ac=hc;bc=ic;cc=jc;dc=kc;ec=lc;fc=mc;gc=nc;q=174;continue k}if(!(vw(c[d>>2]|0,c[Ka>>2]|0,Jb,p)|0)){ac=hc;bc=ic;cc=hc;dc=kc;ec=lc;fc=mc;gc=nc;q=174;continue k}}if(Va){ac=jc;bc=ic;cc=jc;dc=kc;ec=lc;fc=mc;gc=nc;q=174;continue k}if((c[d>>2]|0)>0)oc=0;else{ac=jc;bc=ic;cc=jc;dc=kc;ec=lc;fc=mc;gc=nc;q=174;continue k}while(1){c[p+(oc<<2)>>2]=c[Jb+(oc<<2)>>2];m=oc+1|0;if((m|0)<(c[d>>2]|0))oc=m;else{ac=jc;bc=ic;cc=jc;dc=kc;ec=lc;fc=mc;gc=nc;q=174;continue k}}}m=mc+8|0;do if(!(c[m>>2]|0))q=97;else{if(!(c[mc+20>>2]&256)){q=97;break}lb=c[mc+24>>2]|0;ww(lb+1|0,Kb,c[a>>2]&-9,k,Jb,jc);kb=c[Kb+(lb<<3)>>2]|0;sb=c[Kb+(lb<<3)+4>>2]|0;lb=sb-kb|0;if(rv(b+kb|0,nc+-1|0,lb)|0){ac=hc;bc=ic;cc=jc;dc=kc;ec=lc;fc=mc;gc=nc;q=174;continue k}ob=(sb|0)==(kb|0);kb=ob&1;sb=Lb+(c[mc+12>>2]<<2)|0;if(ob?c[sb>>2]|0:0){ac=hc;bc=ic;cc=jc;dc=kc;ec=lc;fc=mc;gc=nc;q=174;continue k}c[sb>>2]=kb;kb=lb+-1|0;lb=nc+kb|0;sb=c[h>>2]|0;ob=jc+kc+kb|0;kb=Hv(h,lb,4)|0;if((kb|0)<1)if((kb|0)<0){pc=2;qc=hc;rc=ic;sc=ob;tc=kb;uc=lc;vc=mc;wc=lb;break l}else xc=1;else xc=kb;yc=ob;zc=xc;Ac=sb;Bc=lb+xc|0}while(0);if((q|0)==97){q=0;lb=c[h>>2]|0;if(!lb){ac=hc;bc=ic;cc=jc;dc=kc;ec=lc;fc=mc;gc=nc;q=174;continue k}sb=jc+kc|0;ob=Hv(h,nc,4)|0;if((ob|0)<1){if((ob|0)<0){pc=2;qc=hc;rc=ic;sc=sb;tc=ob;uc=lc;vc=mc;wc=nc;break}Cc=ob+1|0}else Cc=ob;yc=sb;zc=Cc;Ac=lb;Bc=nc+Cc|0}if(!(c[m>>2]|0)){ac=hc;bc=ic;cc=yc;dc=zc;ec=lc;fc=mc;gc=Bc;q=174;continue k}lb=(yc|0)!=0;sb=(Ac|0)==95;ob=(yc|0)==0;kb=Na&(Ac|0)==10;xb=ab&(yc|0)<1;rb=m;pb=0;tb=ic;nb=lc;qb=mc;m:while(1){n:do if((c[qb>>2]|0)>>>0>Ac>>>0){Dc=pb;Ec=tb;Fc=nb}else{if((c[qb+4>>2]|0)>>>0<Ac>>>0){Dc=pb;Ec=tb;Fc=nb;break}vb=qb+20|0;Ta=c[vb>>2]|0;do if(Ta|0){if(!(kb|(xb|(Ta&1|0)==0))){Dc=pb;Ec=tb;Fc=nb;break n}if(Ta&2|0?(ub=c[h>>2]|0,!((ub|A|0)==0|Na&(ub|0)==10)):0){Dc=pb;Ec=tb;Fc=nb;break n}do if(Ta&16|0){if(sb){Dc=pb;Ec=tb;Fc=nb;break n}if(Xu(Ac)|0){Dc=pb;Ec=tb;Fc=nb;break n}ub=c[h>>2]|0;if((ub|0)==95)break;if(!(Xu(ub)|0)){Dc=pb;Ec=tb;Fc=nb;break n}}while(0);ub=c[vb>>2]|0;if(!(ub&32))Gc=ub;else{if(sb){ub=c[h>>2]|0;if((ub|0)==95){Dc=pb;Ec=tb;Fc=nb;break n}else Hc=ub}else{ub=(Xu(Ac)|0)==0;La=c[h>>2]|0;if(ub|(La|0)==95){Dc=pb;Ec=tb;Fc=nb;break n}else Hc=La}if(Xu(Hc)|0){Dc=pb;Ec=tb;Fc=nb;break n}Gc=c[vb>>2]|0}La=c[h>>2]|0;do if((La|0)!=0&(lb&(Gc&64|0)!=0)){if(sb){Ic=La;Jc=1}else{ub=(Xu(Ac)|0)!=0;Ic=c[h>>2]|0;Jc=ub}if((Ic|0)==95)if(Jc){Dc=pb;Ec=tb;Fc=nb;break n}else break;else if(Jc^(Xu(Ic)|0)!=0)break;else{Dc=pb;Ec=tb;Fc=nb;break n}}while(0);do if(c[vb>>2]&128|0){La=c[h>>2]|0;if(ob|(La|0)==0){Dc=pb;Ec=tb;Fc=nb;break n}if(sb){Kc=La;Lc=1}else{La=(Xu(Ac)|0)!=0;Kc=c[h>>2]|0;Lc=La}if((Kc|0)==95)if(Lc)break;else{Dc=pb;Ec=tb;Fc=nb;break n}else if(Lc^(Xu(Kc)|0)!=0){Dc=pb;Ec=tb;Fc=nb;break n}else break}while(0);La=c[vb>>2]|0;do if(!(La&4))Mc=La;else{if(c[a>>2]&2|0){Mc=La;break}if(!(Wu(Ac,c[qb+24>>2]|0)|0)){Dc=pb;Ec=tb;Fc=nb;break n}Mc=c[vb>>2]|0}while(0);do if(Mc&4|0){if(!(c[a>>2]&2))break;La=vu(Ac)|0;ub=qb+24|0;if(Wu(La,c[ub>>2]|0)|0)break;La=su(Ac)|0;if(!(Wu(La,c[ub>>2]|0)|0)){Dc=pb;Ec=tb;Fc=nb;break n}}while(0);if(!(c[vb>>2]&8))break;if(xw(c[qb+28>>2]|0,Ac,c[a>>2]&2)|0){Dc=pb;Ec=tb;Fc=nb;break n}}while(0);if(!pb){Dc=c[rb>>2]|0;Ec=c[qb+16>>2]|0;Fc=nb;break}vb=nb+28|0;Ta=c[vb>>2]|0;if(!Ta){ub=tw(G,0,0,0,32)|0;if(!ub){Nc=tb;Oc=nb;q=148;break m}c[ub+24>>2]=nb;c[ub+28>>2]=0;La=tw(G,0,0,0,c[d>>2]<<2)|0;c[ub+20>>2]=La;if(!La){Pc=tb;Qc=nb;q=155;break m}c[vb>>2]=ub;Rc=ub}else Rc=Ta;c[Rc>>2]=yc;c[Rc+4>>2]=Bc;c[Rc+8>>2]=c[rb>>2];c[Rc+12>>2]=c[qb+12>>2];c[Rc+16>>2]=c[h>>2];if((c[d>>2]|0)>0){Ta=c[Rc+20>>2]|0;ub=0;do{c[Ta+(ub<<2)>>2]=c[Jb+(ub<<2)>>2];ub=ub+1|0}while((ub|0)<(c[d>>2]|0))}ub=c[qb+16>>2]|0;if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){pc=27;qc=ac;rc=bc;sc=cc;tc=dc;uc=ec;vc=fc;wc=gc;break}c[h>>2]=B;pc=3;qc=ac;rc=bc;sc=cc;tc=dc;uc=ec;vc=fc;wc=s;break}nb=c[ec+8>>2]|0;if(c[nb+20>>2]&256|0)c[Lb+(c[ec+12>>2]<<2)>>2]=0;tb=c[ec>>2]|0;pb=c[ec+4>>2]|0;c[h>>2]=c[ec+16>>2];rb=c[d>>2]|0;if((rb|0)<=0){pc=0;qc=ac;rc=bc;sc=tb;tc=dc;uc=qb;vc=nb;wc=pb;break}sb=c[ec+20>>2]|0;ob=0;do{c[Jb+(ob<<2)>>2]=c[sb+(ob<<2)>>2];ob=ob+1|0}while((ob|0)!=(rb|0));pc=0;qc=ac;rc=bc;sc=tb;tc=dc;uc=qb;vc=nb;wc=pb}while(0);switch(pc|0){case 2:{Eb=0;Fb=Kb;Gb=1;Hb=Lb;Ib=Jb;break h;break}case 27:{Xc=qc;q=184;break i;break}case 0:{hc=qc;ic=rc;jc=sc;kc=tc;lc=uc;mc=vc;nc=wc;q=82;break}case 3:{break k;break}default:{Cb=12;Db=0;break g}}}$a=c[d>>2]|0;_a=qc;fb=tc;eb=wb;db=uc;gb=wc}if((q|0)==56){sw(G);if(!Xa)zw(Jb);if(!Wa)zw(Kb);if(bb){Cb=12;Db=0;break g}zw(Lb);Cb=12;Db=0;break g}else if((q|0)==63){sw(G);if(!Xa)zw(Jb);if(!Wa)zw(Kb);if(bb){Cb=12;Db=0;break g}zw(Lb);Cb=12;Db=0;break g}else if((q|0)==184){Eb=Xc;Fb=Kb;Gb=Xc>>>31;Hb=Lb;Ib=Jb;break}}while(0);sw(G);if(Ib|0)zw(Ib);if(Fb|0)zw(Fb);if(!Hb){Cb=Gb;Db=Eb}else{zw(Hb);Cb=Gb;Db=Eb}}else{Cb=12;Db=0}while(0);Ab=Db;Bb=Cb}if(!Bb)ww(l,e,c[a>>2]|0,k,p,Ab);if(!p)o=Bb;else{zw(p);o=Bb}}i=g;return o|0}function vw(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0;a:do if((a|0)>0){f=0;while(1){g=c[d+(f<<2)>>2]|0;h=c[e+(f<<2)>>2]|0;if(!(c[b+(f<<2)>>2]|0)){if((g|0)<(h|0)){i=1;break a}if((g|0)>(h|0)){i=0;break a}}else{if((g|0)>(h|0)){i=1;break a}if((g|0)<(h|0)){i=0;break a}}f=f+1|0;if((f|0)>=(a|0)){i=0;break}}}else i=0;while(0);return i|0}function ww(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;if((d&8|0)==0&(g|0)>-1){d=c[e+16>>2]|0;h=e+28|0;i=c[h>>2]|0;j=(a|0)!=0;if(j&(i|0)!=0){k=e+48|0;e=0;do{l=c[d+(e*12|0)>>2]|0;if((l|0)==(c[k>>2]|0))m=g;else m=c[f+(l<<2)>>2]|0;l=b+(e<<3)|0;c[l>>2]=m;n=c[d+(e*12|0)+4>>2]|0;if((n|0)==(c[k>>2]|0))o=g;else o=c[f+(n<<2)>>2]|0;n=b+(e<<3)+4|0;c[n>>2]=o;if((m|0)==-1|(o|0)==-1){c[n>>2]=-1;c[l>>2]=-1}e=e+1|0;l=c[h>>2]|0}while(e>>>0<a>>>0&e>>>0<l>>>0);p=l}else p=i;if(j&(p|0)!=0){j=0;while(1){i=b+(j<<3)+4|0;e=c[d+(j*12|0)+8>>2]|0;if(e|0?(h=c[e>>2]|0,(h|0)>-1):0){o=b+(j<<3)|0;m=h;h=c[o>>2]|0;f=0;while(1){if((h|0)>=(c[b+(m<<3)>>2]|0)?(c[i>>2]|0)<=(c[b+(m<<3)+4>>2]|0):0)q=h;else{c[i>>2]=-1;c[o>>2]=-1;q=-1}f=f+1|0;m=c[e+(f<<2)>>2]|0;if((m|0)<=-1)break;else h=q}}h=j+1|0;if(h>>>0<a>>>0&h>>>0<p>>>0)j=h;else{r=h;break}}}else r=0}else r=0;if(r>>>0<a>>>0){j=r;do{c[b+(j<<3)>>2]=-1;c[b+(j<<3)+4>>2]=-1;j=j+1|0}while((j|0)!=(a|0))}return}function xw(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0;e=c[a>>2]|0;a:do if(!e)f=0;else{g=(d|0)==0;h=a;i=e;while(1){if(g){if(Wu(b,i)|0){f=1;break a}}else{j=su(b)|0;if(Wu(j,c[h>>2]|0)|0){f=1;break a}j=vu(b)|0;if(Wu(j,c[h>>2]|0)|0){f=1;break a}}h=h+4|0;i=c[h>>2]|0;if(!i){f=0;break}}}while(0);return f|0}function yw(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,V=0,W=0,X=0,Y=0,Z=0,_=0,$=0,aa=0,ba=0,ca=0,da=0,ea=0,fa=0,ga=0,ha=0,ia=0,ja=0,ka=0,la=0,ma=0,na=0,oa=0,pa=0,qa=0,ra=0,sa=0,ta=0,ua=0,va=0,wa=0,xa=0,ya=0,za=0,Aa=0,Ba=0,Ca=0,Da=0,Ea=0,Fa=0,Ga=0,Ia=0,Ja=0,Ka=0,La=0,Ma=0,Na=0,Oa=0,Pa=0,Qa=0,Ra=0,Sa=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b;do if(a>>>0<245){e=a>>>0<11?16:a+11&-8;f=e>>>3;g=c[17744]|0;h=g>>>f;if(h&3|0){k=(h&1^1)+f|0;l=71016+(k<<1<<2)|0;m=l+8|0;n=c[m>>2]|0;o=n+8|0;p=c[o>>2]|0;do if((l|0)!=(p|0)){if(p>>>0<(c[17748]|0)>>>0)fb();q=p+12|0;if((c[q>>2]|0)==(n|0)){c[q>>2]=l;c[m>>2]=p;break}else fb()}else c[17744]=g&~(1<<k);while(0);p=k<<3;c[n+4>>2]=p|3;m=n+p+4|0;c[m>>2]=c[m>>2]|1;r=o;i=b;return r|0}m=c[17746]|0;if(e>>>0>m>>>0){if(h|0){p=2<<f;l=h<<f&(p|0-p);p=(l&0-l)+-1|0;l=p>>>12&16;q=p>>>l;p=q>>>5&8;s=q>>>p;q=s>>>2&4;t=s>>>q;s=t>>>1&2;u=t>>>s;t=u>>>1&1;v=(p|l|q|s|t)+(u>>>t)|0;t=71016+(v<<1<<2)|0;u=t+8|0;s=c[u>>2]|0;q=s+8|0;l=c[q>>2]|0;do if((t|0)!=(l|0)){if(l>>>0<(c[17748]|0)>>>0)fb();p=l+12|0;if((c[p>>2]|0)==(s|0)){c[p>>2]=t;c[u>>2]=l;w=c[17746]|0;break}else fb()}else{c[17744]=g&~(1<<v);w=m}while(0);m=(v<<3)-e|0;c[s+4>>2]=e|3;g=s+e|0;c[g+4>>2]=m|1;c[g+m>>2]=m;if(w|0){l=c[17749]|0;u=w>>>3;t=71016+(u<<1<<2)|0;f=c[17744]|0;h=1<<u;if(f&h){u=t+8|0;o=c[u>>2]|0;if(o>>>0<(c[17748]|0)>>>0)fb();else{x=u;y=o}}else{c[17744]=f|h;x=t+8|0;y=t}c[x>>2]=l;c[y+12>>2]=l;c[l+8>>2]=y;c[l+12>>2]=t}c[17746]=m;c[17749]=g;r=q;i=b;return r|0}g=c[17745]|0;if(g){m=(g&0-g)+-1|0;g=m>>>12&16;t=m>>>g;m=t>>>5&8;l=t>>>m;t=l>>>2&4;h=l>>>t;l=h>>>1&2;f=h>>>l;h=f>>>1&1;o=c[71280+((m|g|t|l|h)+(f>>>h)<<2)>>2]|0;h=(c[o+4>>2]&-8)-e|0;f=o;l=o;while(1){o=c[f+16>>2]|0;if(!o){t=c[f+20>>2]|0;if(!t){z=h;A=l;break}else B=t}else B=o;o=(c[B+4>>2]&-8)-e|0;t=o>>>0<h>>>0;h=t?o:h;f=B;l=t?B:l}l=c[17748]|0;if(A>>>0<l>>>0)fb();f=A+e|0;if(A>>>0>=f>>>0)fb();h=c[A+24>>2]|0;q=c[A+12>>2]|0;do if((q|0)==(A|0)){s=A+20|0;v=c[s>>2]|0;if(!v){t=A+16|0;o=c[t>>2]|0;if(!o){C=0;break}else{D=o;E=t}}else{D=v;E=s}while(1){s=D+20|0;v=c[s>>2]|0;if(v|0){D=v;E=s;continue}s=D+16|0;v=c[s>>2]|0;if(!v){F=D;G=E;break}else{D=v;E=s}}if(G>>>0<l>>>0)fb();else{c[G>>2]=0;C=F;break}}else{s=c[A+8>>2]|0;if(s>>>0<l>>>0)fb();v=s+12|0;if((c[v>>2]|0)!=(A|0))fb();t=q+8|0;if((c[t>>2]|0)==(A|0)){c[v>>2]=q;c[t>>2]=s;C=q;break}else fb()}while(0);do if(h|0){q=c[A+28>>2]|0;l=71280+(q<<2)|0;if((A|0)==(c[l>>2]|0)){c[l>>2]=C;if(!C){c[17745]=c[17745]&~(1<<q);break}}else{if(h>>>0<(c[17748]|0)>>>0)fb();q=h+16|0;if((c[q>>2]|0)==(A|0))c[q>>2]=C;else c[h+20>>2]=C;if(!C)break}q=c[17748]|0;if(C>>>0<q>>>0)fb();c[C+24>>2]=h;l=c[A+16>>2]|0;do if(l|0)if(l>>>0<q>>>0)fb();else{c[C+16>>2]=l;c[l+24>>2]=C;break}while(0);l=c[A+20>>2]|0;if(l|0)if(l>>>0<(c[17748]|0)>>>0)fb();else{c[C+20>>2]=l;c[l+24>>2]=C;break}}while(0);if(z>>>0<16){h=z+e|0;c[A+4>>2]=h|3;l=A+h+4|0;c[l>>2]=c[l>>2]|1}else{c[A+4>>2]=e|3;c[f+4>>2]=z|1;c[f+z>>2]=z;l=c[17746]|0;if(l|0){h=c[17749]|0;q=l>>>3;l=71016+(q<<1<<2)|0;s=c[17744]|0;t=1<<q;if(s&t){q=l+8|0;v=c[q>>2]|0;if(v>>>0<(c[17748]|0)>>>0)fb();else{H=q;I=v}}else{c[17744]=s|t;H=l+8|0;I=l}c[H>>2]=h;c[I+12>>2]=h;c[h+8>>2]=I;c[h+12>>2]=l}c[17746]=z;c[17749]=f}r=A+8|0;i=b;return r|0}else J=e}else J=e}else if(a>>>0<=4294967231){l=a+11|0;h=l&-8;t=c[17745]|0;if(t){s=0-h|0;v=l>>>8;if(v)if(h>>>0>16777215)K=31;else{l=(v+1048320|0)>>>16&8;q=v<<l;v=(q+520192|0)>>>16&4;o=q<<v;q=(o+245760|0)>>>16&2;g=14-(v|l|q)+(o<<q>>>15)|0;K=h>>>(g+7|0)&1|g<<1}else K=0;g=c[71280+(K<<2)>>2]|0;a:do if(!g){L=s;M=0;N=0;O=86}else{q=s;o=0;l=h<<((K|0)==31?0:25-(K>>>1)|0);v=g;m=0;while(1){u=c[v+4>>2]&-8;n=u-h|0;if(n>>>0<q>>>0)if((u|0)==(h|0)){P=n;Q=v;R=v;O=90;break a}else{S=n;T=v}else{S=q;T=m}n=c[v+20>>2]|0;v=c[v+16+(l>>>31<<2)>>2]|0;u=(n|0)==0|(n|0)==(v|0)?o:n;n=(v|0)==0;if(n){L=S;M=u;N=T;O=86;break}else{q=S;o=u;l=l<<(n&1^1);m=T}}}while(0);if((O|0)==86){if((M|0)==0&(N|0)==0){g=2<<K;s=t&(g|0-g);if(!s){J=h;break}g=(s&0-s)+-1|0;s=g>>>12&16;e=g>>>s;g=e>>>5&8;f=e>>>g;e=f>>>2&4;m=f>>>e;f=m>>>1&2;l=m>>>f;m=l>>>1&1;V=c[71280+((g|s|e|f|m)+(l>>>m)<<2)>>2]|0}else V=M;if(!V){W=L;X=N}else{P=L;Q=V;R=N;O=90}}if((O|0)==90)while(1){O=0;m=(c[Q+4>>2]&-8)-h|0;l=m>>>0<P>>>0;f=l?m:P;m=l?Q:R;l=c[Q+16>>2]|0;if(l|0){P=f;Q=l;R=m;O=90;continue}Q=c[Q+20>>2]|0;if(!Q){W=f;X=m;break}else{P=f;R=m;O=90}}if((X|0)!=0?W>>>0<((c[17746]|0)-h|0)>>>0:0){t=c[17748]|0;if(X>>>0<t>>>0)fb();m=X+h|0;if(X>>>0>=m>>>0)fb();f=c[X+24>>2]|0;l=c[X+12>>2]|0;do if((l|0)==(X|0)){e=X+20|0;s=c[e>>2]|0;if(!s){g=X+16|0;o=c[g>>2]|0;if(!o){Y=0;break}else{Z=o;_=g}}else{Z=s;_=e}while(1){e=Z+20|0;s=c[e>>2]|0;if(s|0){Z=s;_=e;continue}e=Z+16|0;s=c[e>>2]|0;if(!s){$=Z;aa=_;break}else{Z=s;_=e}}if(aa>>>0<t>>>0)fb();else{c[aa>>2]=0;Y=$;break}}else{e=c[X+8>>2]|0;if(e>>>0<t>>>0)fb();s=e+12|0;if((c[s>>2]|0)!=(X|0))fb();g=l+8|0;if((c[g>>2]|0)==(X|0)){c[s>>2]=l;c[g>>2]=e;Y=l;break}else fb()}while(0);do if(f|0){l=c[X+28>>2]|0;t=71280+(l<<2)|0;if((X|0)==(c[t>>2]|0)){c[t>>2]=Y;if(!Y){c[17745]=c[17745]&~(1<<l);break}}else{if(f>>>0<(c[17748]|0)>>>0)fb();l=f+16|0;if((c[l>>2]|0)==(X|0))c[l>>2]=Y;else c[f+20>>2]=Y;if(!Y)break}l=c[17748]|0;if(Y>>>0<l>>>0)fb();c[Y+24>>2]=f;t=c[X+16>>2]|0;do if(t|0)if(t>>>0<l>>>0)fb();else{c[Y+16>>2]=t;c[t+24>>2]=Y;break}while(0);t=c[X+20>>2]|0;if(t|0)if(t>>>0<(c[17748]|0)>>>0)fb();else{c[Y+20>>2]=t;c[t+24>>2]=Y;break}}while(0);do if(W>>>0>=16){c[X+4>>2]=h|3;c[m+4>>2]=W|1;c[m+W>>2]=W;f=W>>>3;if(W>>>0<256){t=71016+(f<<1<<2)|0;l=c[17744]|0;e=1<<f;if(l&e){f=t+8|0;g=c[f>>2]|0;if(g>>>0<(c[17748]|0)>>>0)fb();else{ba=f;ca=g}}else{c[17744]=l|e;ba=t+8|0;ca=t}c[ba>>2]=m;c[ca+12>>2]=m;c[m+8>>2]=ca;c[m+12>>2]=t;break}t=W>>>8;if(t)if(W>>>0>16777215)da=31;else{e=(t+1048320|0)>>>16&8;l=t<<e;t=(l+520192|0)>>>16&4;g=l<<t;l=(g+245760|0)>>>16&2;f=14-(t|e|l)+(g<<l>>>15)|0;da=W>>>(f+7|0)&1|f<<1}else da=0;f=71280+(da<<2)|0;c[m+28>>2]=da;l=m+16|0;c[l+4>>2]=0;c[l>>2]=0;l=c[17745]|0;g=1<<da;if(!(l&g)){c[17745]=l|g;c[f>>2]=m;c[m+24>>2]=f;c[m+12>>2]=m;c[m+8>>2]=m;break}g=W<<((da|0)==31?0:25-(da>>>1)|0);l=c[f>>2]|0;while(1){if((c[l+4>>2]&-8|0)==(W|0)){ea=l;O=148;break}f=l+16+(g>>>31<<2)|0;e=c[f>>2]|0;if(!e){fa=f;ga=l;O=145;break}else{g=g<<1;l=e}}if((O|0)==145)if(fa>>>0<(c[17748]|0)>>>0)fb();else{c[fa>>2]=m;c[m+24>>2]=ga;c[m+12>>2]=m;c[m+8>>2]=m;break}else if((O|0)==148){l=ea+8|0;g=c[l>>2]|0;e=c[17748]|0;if(g>>>0>=e>>>0&ea>>>0>=e>>>0){c[g+12>>2]=m;c[l>>2]=m;c[m+8>>2]=g;c[m+12>>2]=ea;c[m+24>>2]=0;break}else fb()}}else{g=W+h|0;c[X+4>>2]=g|3;l=X+g+4|0;c[l>>2]=c[l>>2]|1}while(0);r=X+8|0;i=b;return r|0}else J=h}else J=h}else J=-1;while(0);X=c[17746]|0;if(X>>>0>=J>>>0){W=X-J|0;ea=c[17749]|0;if(W>>>0>15){ga=ea+J|0;c[17749]=ga;c[17746]=W;c[ga+4>>2]=W|1;c[ga+W>>2]=W;c[ea+4>>2]=J|3}else{c[17746]=0;c[17749]=0;c[ea+4>>2]=X|3;W=ea+X+4|0;c[W>>2]=c[W>>2]|1}r=ea+8|0;i=b;return r|0}ea=c[17747]|0;if(ea>>>0>J>>>0){W=ea-J|0;c[17747]=W;ea=c[17750]|0;X=ea+J|0;c[17750]=X;c[X+4>>2]=W|1;c[ea+4>>2]=J|3;r=ea+8|0;i=b;return r|0}if(!(c[17862]|0)){c[17864]=4096;c[17863]=4096;c[17865]=-1;c[17866]=-1;c[17867]=0;c[17855]=0;ea=d&-16^1431655768;c[d>>2]=ea;c[17862]=ea}ea=J+48|0;d=c[17864]|0;W=J+47|0;X=d+W|0;ga=0-d|0;d=X&ga;if(d>>>0<=J>>>0){r=0;i=b;return r|0}fa=c[17854]|0;if(fa|0?(da=c[17852]|0,ca=da+d|0,ca>>>0<=da>>>0|ca>>>0>fa>>>0):0){r=0;i=b;return r|0}b:do if(!(c[17855]&4)){fa=c[17750]|0;c:do if(fa){ca=71424;while(1){da=c[ca>>2]|0;if(da>>>0<=fa>>>0?(ba=ca+4|0,(da+(c[ba>>2]|0)|0)>>>0>fa>>>0):0){ha=ca;ia=ba;break}ca=c[ca+8>>2]|0;if(!ca){O=171;break c}}ca=X-(c[17747]|0)&ga;if(ca>>>0<2147483647){ba=Ha(ca|0)|0;if((ba|0)==((c[ha>>2]|0)+(c[ia>>2]|0)|0)){if((ba|0)!=(-1|0)){ja=ba;ka=ca;O=191;break b}}else{la=ba;ma=ca;O=181}}}else O=171;while(0);do if((O|0)==171?(fa=Ha(0)|0,(fa|0)!=(-1|0)):0){h=fa;ca=c[17863]|0;ba=ca+-1|0;if(!(ba&h))na=d;else na=d-h+(ba+h&0-ca)|0;ca=c[17852]|0;h=ca+na|0;if(na>>>0>J>>>0&na>>>0<2147483647){ba=c[17854]|0;if(ba|0?h>>>0<=ca>>>0|h>>>0>ba>>>0:0)break;ba=Ha(na|0)|0;if((ba|0)==(fa|0)){ja=fa;ka=na;O=191;break b}else{la=ba;ma=na;O=181}}}while(0);d:do if((O|0)==181){ba=0-ma|0;do if(ea>>>0>ma>>>0&(ma>>>0<2147483647&(la|0)!=(-1|0))?(fa=c[17864]|0,h=W-ma+fa&0-fa,h>>>0<2147483647):0)if((Ha(h|0)|0)==(-1|0)){Ha(ba|0)|0;break d}else{oa=h+ma|0;break}else oa=ma;while(0);if((la|0)!=(-1|0)){ja=la;ka=oa;O=191;break b}}while(0);c[17855]=c[17855]|4;O=188}else O=188;while(0);if((((O|0)==188?d>>>0<2147483647:0)?(oa=Ha(d|0)|0,d=Ha(0)|0,oa>>>0<d>>>0&((oa|0)!=(-1|0)&(d|0)!=(-1|0))):0)?(la=d-oa|0,la>>>0>(J+40|0)>>>0):0){ja=oa;ka=la;O=191}if((O|0)==191){la=(c[17852]|0)+ka|0;c[17852]=la;if(la>>>0>(c[17853]|0)>>>0)c[17853]=la;la=c[17750]|0;do if(la){oa=71424;do{d=c[oa>>2]|0;ma=oa+4|0;W=c[ma>>2]|0;if((ja|0)==(d+W|0)){pa=d;qa=ma;ra=W;sa=oa;O=201;break}oa=c[oa+8>>2]|0}while((oa|0)!=0);if(((O|0)==201?(c[sa+12>>2]&8|0)==0:0)?la>>>0<ja>>>0&la>>>0>=pa>>>0:0){c[qa>>2]=ra+ka;oa=la+8|0;W=(oa&7|0)==0?0:0-oa&7;oa=la+W|0;ma=ka-W+(c[17747]|0)|0;c[17750]=oa;c[17747]=ma;c[oa+4>>2]=ma|1;c[oa+ma+4>>2]=40;c[17751]=c[17866];break}ma=c[17748]|0;if(ja>>>0<ma>>>0){c[17748]=ja;ta=ja}else ta=ma;ma=ja+ka|0;oa=71424;while(1){if((c[oa>>2]|0)==(ma|0)){ua=oa;va=oa;O=209;break}oa=c[oa+8>>2]|0;if(!oa){wa=71424;break}}if((O|0)==209)if(!(c[va+12>>2]&8)){c[ua>>2]=ja;oa=va+4|0;c[oa>>2]=(c[oa>>2]|0)+ka;oa=ja+8|0;W=ja+((oa&7|0)==0?0:0-oa&7)|0;oa=ma+8|0;d=ma+((oa&7|0)==0?0:0-oa&7)|0;oa=W+J|0;ea=d-W-J|0;c[W+4>>2]=J|3;do if((d|0)!=(la|0)){if((d|0)==(c[17749]|0)){na=(c[17746]|0)+ea|0;c[17746]=na;c[17749]=oa;c[oa+4>>2]=na|1;c[oa+na>>2]=na;break}na=c[d+4>>2]|0;if((na&3|0)==1){ia=na&-8;ha=na>>>3;e:do if(na>>>0>=256){ga=c[d+24>>2]|0;X=c[d+12>>2]|0;do if((X|0)==(d|0)){ba=d+16|0;h=ba+4|0;fa=c[h>>2]|0;if(!fa){ca=c[ba>>2]|0;if(!ca){xa=0;break}else{ya=ca;za=ba}}else{ya=fa;za=h}while(1){h=ya+20|0;fa=c[h>>2]|0;if(fa|0){ya=fa;za=h;continue}h=ya+16|0;fa=c[h>>2]|0;if(!fa){Aa=ya;Ba=za;break}else{ya=fa;za=h}}if(Ba>>>0<ta>>>0)fb();else{c[Ba>>2]=0;xa=Aa;break}}else{h=c[d+8>>2]|0;if(h>>>0<ta>>>0)fb();fa=h+12|0;if((c[fa>>2]|0)!=(d|0))fb();ba=X+8|0;if((c[ba>>2]|0)==(d|0)){c[fa>>2]=X;c[ba>>2]=h;xa=X;break}else fb()}while(0);if(!ga)break;X=c[d+28>>2]|0;h=71280+(X<<2)|0;do if((d|0)!=(c[h>>2]|0)){if(ga>>>0<(c[17748]|0)>>>0)fb();ba=ga+16|0;if((c[ba>>2]|0)==(d|0))c[ba>>2]=xa;else c[ga+20>>2]=xa;if(!xa)break e}else{c[h>>2]=xa;if(xa|0)break;c[17745]=c[17745]&~(1<<X);break e}while(0);X=c[17748]|0;if(xa>>>0<X>>>0)fb();c[xa+24>>2]=ga;h=d+16|0;ba=c[h>>2]|0;do if(ba|0)if(ba>>>0<X>>>0)fb();else{c[xa+16>>2]=ba;c[ba+24>>2]=xa;break}while(0);ba=c[h+4>>2]|0;if(!ba)break;if(ba>>>0<(c[17748]|0)>>>0)fb();else{c[xa+20>>2]=ba;c[ba+24>>2]=xa;break}}else{ba=c[d+8>>2]|0;X=c[d+12>>2]|0;ga=71016+(ha<<1<<2)|0;do if((ba|0)!=(ga|0)){if(ba>>>0<ta>>>0)fb();if((c[ba+12>>2]|0)==(d|0))break;fb()}while(0);if((X|0)==(ba|0)){c[17744]=c[17744]&~(1<<ha);break}do if((X|0)==(ga|0))Ca=X+8|0;else{if(X>>>0<ta>>>0)fb();h=X+8|0;if((c[h>>2]|0)==(d|0)){Ca=h;break}fb()}while(0);c[ba+12>>2]=X;c[Ca>>2]=ba}while(0);Da=d+ia|0;Ea=ia+ea|0}else{Da=d;Ea=ea}ha=Da+4|0;c[ha>>2]=c[ha>>2]&-2;c[oa+4>>2]=Ea|1;c[oa+Ea>>2]=Ea;ha=Ea>>>3;if(Ea>>>0<256){na=71016+(ha<<1<<2)|0;ga=c[17744]|0;h=1<<ha;do if(!(ga&h)){c[17744]=ga|h;Fa=na+8|0;Ga=na}else{ha=na+8|0;fa=c[ha>>2]|0;if(fa>>>0>=(c[17748]|0)>>>0){Fa=ha;Ga=fa;break}fb()}while(0);c[Fa>>2]=oa;c[Ga+12>>2]=oa;c[oa+8>>2]=Ga;c[oa+12>>2]=na;break}h=Ea>>>8;do if(!h)Ia=0;else{if(Ea>>>0>16777215){Ia=31;break}ga=(h+1048320|0)>>>16&8;ia=h<<ga;fa=(ia+520192|0)>>>16&4;ha=ia<<fa;ia=(ha+245760|0)>>>16&2;ca=14-(fa|ga|ia)+(ha<<ia>>>15)|0;Ia=Ea>>>(ca+7|0)&1|ca<<1}while(0);h=71280+(Ia<<2)|0;c[oa+28>>2]=Ia;na=oa+16|0;c[na+4>>2]=0;c[na>>2]=0;na=c[17745]|0;ca=1<<Ia;if(!(na&ca)){c[17745]=na|ca;c[h>>2]=oa;c[oa+24>>2]=h;c[oa+12>>2]=oa;c[oa+8>>2]=oa;break}ca=Ea<<((Ia|0)==31?0:25-(Ia>>>1)|0);na=c[h>>2]|0;while(1){if((c[na+4>>2]&-8|0)==(Ea|0)){Ja=na;O=279;break}h=na+16+(ca>>>31<<2)|0;ia=c[h>>2]|0;if(!ia){Ka=h;La=na;O=276;break}else{ca=ca<<1;na=ia}}if((O|0)==276)if(Ka>>>0<(c[17748]|0)>>>0)fb();else{c[Ka>>2]=oa;c[oa+24>>2]=La;c[oa+12>>2]=oa;c[oa+8>>2]=oa;break}else if((O|0)==279){na=Ja+8|0;ca=c[na>>2]|0;ia=c[17748]|0;if(ca>>>0>=ia>>>0&Ja>>>0>=ia>>>0){c[ca+12>>2]=oa;c[na>>2]=oa;c[oa+8>>2]=ca;c[oa+12>>2]=Ja;c[oa+24>>2]=0;break}else fb()}}else{ca=(c[17747]|0)+ea|0;c[17747]=ca;c[17750]=oa;c[oa+4>>2]=ca|1}while(0);r=W+8|0;i=b;return r|0}else wa=71424;while(1){oa=c[wa>>2]|0;if(oa>>>0<=la>>>0?(ea=oa+(c[wa+4>>2]|0)|0,ea>>>0>la>>>0):0){Ma=ea;break}wa=c[wa+8>>2]|0}W=Ma+-47|0;ea=W+8|0;oa=W+((ea&7|0)==0?0:0-ea&7)|0;ea=la+16|0;W=oa>>>0<ea>>>0?la:oa;oa=W+8|0;d=ja+8|0;ma=(d&7|0)==0?0:0-d&7;d=ja+ma|0;ca=ka+-40-ma|0;c[17750]=d;c[17747]=ca;c[d+4>>2]=ca|1;c[d+ca+4>>2]=40;c[17751]=c[17866];ca=W+4|0;c[ca>>2]=27;c[oa>>2]=c[17856];c[oa+4>>2]=c[17857];c[oa+8>>2]=c[17858];c[oa+12>>2]=c[17859];c[17856]=ja;c[17857]=ka;c[17859]=0;c[17858]=oa;oa=W+24|0;do{oa=oa+4|0;c[oa>>2]=7}while((oa+4|0)>>>0<Ma>>>0);if((W|0)!=(la|0)){oa=W-la|0;c[ca>>2]=c[ca>>2]&-2;c[la+4>>2]=oa|1;c[W>>2]=oa;d=oa>>>3;if(oa>>>0<256){ma=71016+(d<<1<<2)|0;na=c[17744]|0;ia=1<<d;if(na&ia){d=ma+8|0;h=c[d>>2]|0;if(h>>>0<(c[17748]|0)>>>0)fb();else{Na=d;Oa=h}}else{c[17744]=na|ia;Na=ma+8|0;Oa=ma}c[Na>>2]=la;c[Oa+12>>2]=la;c[la+8>>2]=Oa;c[la+12>>2]=ma;break}ma=oa>>>8;if(ma)if(oa>>>0>16777215)Pa=31;else{ia=(ma+1048320|0)>>>16&8;na=ma<<ia;ma=(na+520192|0)>>>16&4;h=na<<ma;na=(h+245760|0)>>>16&2;d=14-(ma|ia|na)+(h<<na>>>15)|0;Pa=oa>>>(d+7|0)&1|d<<1}else Pa=0;d=71280+(Pa<<2)|0;c[la+28>>2]=Pa;c[la+20>>2]=0;c[ea>>2]=0;na=c[17745]|0;h=1<<Pa;if(!(na&h)){c[17745]=na|h;c[d>>2]=la;c[la+24>>2]=d;c[la+12>>2]=la;c[la+8>>2]=la;break}h=oa<<((Pa|0)==31?0:25-(Pa>>>1)|0);na=c[d>>2]|0;while(1){if((c[na+4>>2]&-8|0)==(oa|0)){Qa=na;O=305;break}d=na+16+(h>>>31<<2)|0;ia=c[d>>2]|0;if(!ia){Ra=d;Sa=na;O=302;break}else{h=h<<1;na=ia}}if((O|0)==302)if(Ra>>>0<(c[17748]|0)>>>0)fb();else{c[Ra>>2]=la;c[la+24>>2]=Sa;c[la+12>>2]=la;c[la+8>>2]=la;break}else if((O|0)==305){na=Qa+8|0;h=c[na>>2]|0;oa=c[17748]|0;if(h>>>0>=oa>>>0&Qa>>>0>=oa>>>0){c[h+12>>2]=la;c[na>>2]=la;c[la+8>>2]=h;c[la+12>>2]=Qa;c[la+24>>2]=0;break}else fb()}}}else{h=c[17748]|0;if((h|0)==0|ja>>>0<h>>>0)c[17748]=ja;c[17856]=ja;c[17857]=ka;c[17859]=0;c[17753]=c[17862];c[17752]=-1;h=0;do{na=71016+(h<<1<<2)|0;c[na+12>>2]=na;c[na+8>>2]=na;h=h+1|0}while((h|0)!=32);h=ja+8|0;na=(h&7|0)==0?0:0-h&7;h=ja+na|0;oa=ka+-40-na|0;c[17750]=h;c[17747]=oa;c[h+4>>2]=oa|1;c[h+oa+4>>2]=40;c[17751]=c[17866]}while(0);ka=c[17747]|0;if(ka>>>0>J>>>0){ja=ka-J|0;c[17747]=ja;ka=c[17750]|0;la=ka+J|0;c[17750]=la;c[la+4>>2]=ja|1;c[ka+4>>2]=J|3;r=ka+8|0;i=b;return r|0}}c[(fu()|0)>>2]=12;r=0;i=b;return r|0}function zw(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0;if(!a)return;b=a+-8|0;d=c[17748]|0;if(b>>>0<d>>>0)fb();e=c[a+-4>>2]|0;a=e&3;if((a|0)==1)fb();f=e&-8;g=b+f|0;do if(!(e&1)){h=c[b>>2]|0;if(!a)return;i=b+(0-h)|0;j=h+f|0;if(i>>>0<d>>>0)fb();if((i|0)==(c[17749]|0)){k=g+4|0;l=c[k>>2]|0;if((l&3|0)!=3){m=i;n=j;break}c[17746]=j;c[k>>2]=l&-2;c[i+4>>2]=j|1;c[i+j>>2]=j;return}l=h>>>3;if(h>>>0<256){h=c[i+8>>2]|0;k=c[i+12>>2]|0;o=71016+(l<<1<<2)|0;if((h|0)!=(o|0)){if(h>>>0<d>>>0)fb();if((c[h+12>>2]|0)!=(i|0))fb()}if((k|0)==(h|0)){c[17744]=c[17744]&~(1<<l);m=i;n=j;break}if((k|0)!=(o|0)){if(k>>>0<d>>>0)fb();o=k+8|0;if((c[o>>2]|0)==(i|0))p=o;else fb()}else p=k+8|0;c[h+12>>2]=k;c[p>>2]=h;m=i;n=j;break}h=c[i+24>>2]|0;k=c[i+12>>2]|0;do if((k|0)==(i|0)){o=i+16|0;l=o+4|0;q=c[l>>2]|0;if(!q){r=c[o>>2]|0;if(!r){s=0;break}else{t=r;u=o}}else{t=q;u=l}while(1){l=t+20|0;q=c[l>>2]|0;if(q|0){t=q;u=l;continue}l=t+16|0;q=c[l>>2]|0;if(!q){v=t;w=u;break}else{t=q;u=l}}if(w>>>0<d>>>0)fb();else{c[w>>2]=0;s=v;break}}else{l=c[i+8>>2]|0;if(l>>>0<d>>>0)fb();q=l+12|0;if((c[q>>2]|0)!=(i|0))fb();o=k+8|0;if((c[o>>2]|0)==(i|0)){c[q>>2]=k;c[o>>2]=l;s=k;break}else fb()}while(0);if(h){k=c[i+28>>2]|0;l=71280+(k<<2)|0;if((i|0)==(c[l>>2]|0)){c[l>>2]=s;if(!s){c[17745]=c[17745]&~(1<<k);m=i;n=j;break}}else{if(h>>>0<(c[17748]|0)>>>0)fb();k=h+16|0;if((c[k>>2]|0)==(i|0))c[k>>2]=s;else c[h+20>>2]=s;if(!s){m=i;n=j;break}}k=c[17748]|0;if(s>>>0<k>>>0)fb();c[s+24>>2]=h;l=i+16|0;o=c[l>>2]|0;do if(o|0)if(o>>>0<k>>>0)fb();else{c[s+16>>2]=o;c[o+24>>2]=s;break}while(0);o=c[l+4>>2]|0;if(o)if(o>>>0<(c[17748]|0)>>>0)fb();else{c[s+20>>2]=o;c[o+24>>2]=s;m=i;n=j;break}else{m=i;n=j}}else{m=i;n=j}}else{m=b;n=f}while(0);if(m>>>0>=g>>>0)fb();f=g+4|0;b=c[f>>2]|0;if(!(b&1))fb();if(!(b&2)){if((g|0)==(c[17750]|0)){s=(c[17747]|0)+n|0;c[17747]=s;c[17750]=m;c[m+4>>2]=s|1;if((m|0)!=(c[17749]|0))return;c[17749]=0;c[17746]=0;return}if((g|0)==(c[17749]|0)){s=(c[17746]|0)+n|0;c[17746]=s;c[17749]=m;c[m+4>>2]=s|1;c[m+s>>2]=s;return}s=(b&-8)+n|0;d=b>>>3;do if(b>>>0>=256){v=c[g+24>>2]|0;w=c[g+12>>2]|0;do if((w|0)==(g|0)){u=g+16|0;t=u+4|0;p=c[t>>2]|0;if(!p){a=c[u>>2]|0;if(!a){x=0;break}else{y=a;z=u}}else{y=p;z=t}while(1){t=y+20|0;p=c[t>>2]|0;if(p|0){y=p;z=t;continue}t=y+16|0;p=c[t>>2]|0;if(!p){A=y;B=z;break}else{y=p;z=t}}if(B>>>0<(c[17748]|0)>>>0)fb();else{c[B>>2]=0;x=A;break}}else{t=c[g+8>>2]|0;if(t>>>0<(c[17748]|0)>>>0)fb();p=t+12|0;if((c[p>>2]|0)!=(g|0))fb();u=w+8|0;if((c[u>>2]|0)==(g|0)){c[p>>2]=w;c[u>>2]=t;x=w;break}else fb()}while(0);if(v|0){w=c[g+28>>2]|0;j=71280+(w<<2)|0;if((g|0)==(c[j>>2]|0)){c[j>>2]=x;if(!x){c[17745]=c[17745]&~(1<<w);break}}else{if(v>>>0<(c[17748]|0)>>>0)fb();w=v+16|0;if((c[w>>2]|0)==(g|0))c[w>>2]=x;else c[v+20>>2]=x;if(!x)break}w=c[17748]|0;if(x>>>0<w>>>0)fb();c[x+24>>2]=v;j=g+16|0;i=c[j>>2]|0;do if(i|0)if(i>>>0<w>>>0)fb();else{c[x+16>>2]=i;c[i+24>>2]=x;break}while(0);i=c[j+4>>2]|0;if(i|0)if(i>>>0<(c[17748]|0)>>>0)fb();else{c[x+20>>2]=i;c[i+24>>2]=x;break}}}else{i=c[g+8>>2]|0;w=c[g+12>>2]|0;v=71016+(d<<1<<2)|0;if((i|0)!=(v|0)){if(i>>>0<(c[17748]|0)>>>0)fb();if((c[i+12>>2]|0)!=(g|0))fb()}if((w|0)==(i|0)){c[17744]=c[17744]&~(1<<d);break}if((w|0)!=(v|0)){if(w>>>0<(c[17748]|0)>>>0)fb();v=w+8|0;if((c[v>>2]|0)==(g|0))C=v;else fb()}else C=w+8|0;c[i+12>>2]=w;c[C>>2]=i}while(0);c[m+4>>2]=s|1;c[m+s>>2]=s;if((m|0)==(c[17749]|0)){c[17746]=s;return}else D=s}else{c[f>>2]=b&-2;c[m+4>>2]=n|1;c[m+n>>2]=n;D=n}n=D>>>3;if(D>>>0<256){b=71016+(n<<1<<2)|0;f=c[17744]|0;s=1<<n;if(f&s){n=b+8|0;C=c[n>>2]|0;if(C>>>0<(c[17748]|0)>>>0)fb();else{E=n;F=C}}else{c[17744]=f|s;E=b+8|0;F=b}c[E>>2]=m;c[F+12>>2]=m;c[m+8>>2]=F;c[m+12>>2]=b;return}b=D>>>8;if(b)if(D>>>0>16777215)G=31;else{F=(b+1048320|0)>>>16&8;E=b<<F;b=(E+520192|0)>>>16&4;s=E<<b;E=(s+245760|0)>>>16&2;f=14-(b|F|E)+(s<<E>>>15)|0;G=D>>>(f+7|0)&1|f<<1}else G=0;f=71280+(G<<2)|0;c[m+28>>2]=G;c[m+20>>2]=0;c[m+16>>2]=0;E=c[17745]|0;s=1<<G;do if(E&s){F=D<<((G|0)==31?0:25-(G>>>1)|0);b=c[f>>2]|0;while(1){if((c[b+4>>2]&-8|0)==(D|0)){H=b;I=130;break}C=b+16+(F>>>31<<2)|0;n=c[C>>2]|0;if(!n){J=C;K=b;I=127;break}else{F=F<<1;b=n}}if((I|0)==127)if(J>>>0<(c[17748]|0)>>>0)fb();else{c[J>>2]=m;c[m+24>>2]=K;c[m+12>>2]=m;c[m+8>>2]=m;break}else if((I|0)==130){b=H+8|0;F=c[b>>2]|0;j=c[17748]|0;if(F>>>0>=j>>>0&H>>>0>=j>>>0){c[F+12>>2]=m;c[b>>2]=m;c[m+8>>2]=F;c[m+12>>2]=H;c[m+24>>2]=0;break}else fb()}}else{c[17745]=E|s;c[f>>2]=m;c[m+24>>2]=f;c[m+12>>2]=m;c[m+8>>2]=m}while(0);m=(c[17752]|0)+-1|0;c[17752]=m;if(!m)L=71432;else return;while(1){m=c[L>>2]|0;if(!m)break;else L=m+8|0}c[17752]=-1;return}function Aw(a,b){a=a|0;b=b|0;var d=0,e=0;if(a){d=R(b,a)|0;if((b|a)>>>0>65535)e=((d>>>0)/(a>>>0)|0|0)==(b|0)?d:-1;else e=d}else e=0;d=yw(e)|0;if(!d)return d|0;if(!(c[d+-4>>2]&3))return d|0;Sw(d|0,0,e|0)|0;return d|0}function Bw(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;if(!a){d=yw(b)|0;return d|0}if(b>>>0>4294967231){c[(fu()|0)>>2]=12;d=0;return d|0}e=Cw(a+-8|0,b>>>0<11?16:b+11&-8)|0;if(e|0){d=e+8|0;return d|0}e=yw(b)|0;if(!e){d=0;return d|0}f=c[a+-4>>2]|0;g=(f&-8)-((f&3|0)==0?8:4)|0;Ow(e|0,a|0,(g>>>0<b>>>0?g:b)|0)|0;zw(a);d=e;return d|0}function Cw(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0;d=a+4|0;e=c[d>>2]|0;f=e&-8;g=a+f|0;h=c[17748]|0;i=e&3;if(!((i|0)!=1&a>>>0>=h>>>0&a>>>0<g>>>0))fb();j=c[g+4>>2]|0;if(!(j&1))fb();if(!i){if(b>>>0<256){k=0;return k|0}if(f>>>0>=(b+4|0)>>>0?(f-b|0)>>>0<=c[17864]<<1>>>0:0){k=a;return k|0}k=0;return k|0}if(f>>>0>=b>>>0){i=f-b|0;if(i>>>0<=15){k=a;return k|0}l=a+b|0;c[d>>2]=e&1|b|2;c[l+4>>2]=i|3;m=l+i+4|0;c[m>>2]=c[m>>2]|1;Dw(l,i);k=a;return k|0}if((g|0)==(c[17750]|0)){i=(c[17747]|0)+f|0;if(i>>>0<=b>>>0){k=0;return k|0}l=i-b|0;i=a+b|0;c[d>>2]=e&1|b|2;c[i+4>>2]=l|1;c[17750]=i;c[17747]=l;k=a;return k|0}if((g|0)==(c[17749]|0)){l=(c[17746]|0)+f|0;if(l>>>0<b>>>0){k=0;return k|0}i=l-b|0;if(i>>>0>15){m=a+b|0;n=m+i|0;c[d>>2]=e&1|b|2;c[m+4>>2]=i|1;c[n>>2]=i;o=n+4|0;c[o>>2]=c[o>>2]&-2;p=m;q=i}else{c[d>>2]=e&1|l|2;i=a+l+4|0;c[i>>2]=c[i>>2]|1;p=0;q=0}c[17746]=q;c[17749]=p;k=a;return k|0}if(j&2|0){k=0;return k|0}p=(j&-8)+f|0;if(p>>>0<b>>>0){k=0;return k|0}f=p-b|0;q=j>>>3;do if(j>>>0>=256){i=c[g+24>>2]|0;l=c[g+12>>2]|0;do if((l|0)==(g|0)){m=g+16|0;o=m+4|0;n=c[o>>2]|0;if(!n){r=c[m>>2]|0;if(!r){s=0;break}else{t=r;u=m}}else{t=n;u=o}while(1){o=t+20|0;n=c[o>>2]|0;if(n|0){t=n;u=o;continue}o=t+16|0;n=c[o>>2]|0;if(!n){v=t;w=u;break}else{t=n;u=o}}if(w>>>0<h>>>0)fb();else{c[w>>2]=0;s=v;break}}else{o=c[g+8>>2]|0;if(o>>>0<h>>>0)fb();n=o+12|0;if((c[n>>2]|0)!=(g|0))fb();m=l+8|0;if((c[m>>2]|0)==(g|0)){c[n>>2]=l;c[m>>2]=o;s=l;break}else fb()}while(0);if(i|0){l=c[g+28>>2]|0;o=71280+(l<<2)|0;if((g|0)==(c[o>>2]|0)){c[o>>2]=s;if(!s){c[17745]=c[17745]&~(1<<l);break}}else{if(i>>>0<(c[17748]|0)>>>0)fb();l=i+16|0;if((c[l>>2]|0)==(g|0))c[l>>2]=s;else c[i+20>>2]=s;if(!s)break}l=c[17748]|0;if(s>>>0<l>>>0)fb();c[s+24>>2]=i;o=g+16|0;m=c[o>>2]|0;do if(m|0)if(m>>>0<l>>>0)fb();else{c[s+16>>2]=m;c[m+24>>2]=s;break}while(0);m=c[o+4>>2]|0;if(m|0)if(m>>>0<(c[17748]|0)>>>0)fb();else{c[s+20>>2]=m;c[m+24>>2]=s;break}}}else{m=c[g+8>>2]|0;l=c[g+12>>2]|0;i=71016+(q<<1<<2)|0;if((m|0)!=(i|0)){if(m>>>0<h>>>0)fb();if((c[m+12>>2]|0)!=(g|0))fb()}if((l|0)==(m|0)){c[17744]=c[17744]&~(1<<q);break}if((l|0)!=(i|0)){if(l>>>0<h>>>0)fb();i=l+8|0;if((c[i>>2]|0)==(g|0))x=i;else fb()}else x=l+8|0;c[m+12>>2]=l;c[x>>2]=m}while(0);if(f>>>0<16){c[d>>2]=p|e&1|2;x=a+p+4|0;c[x>>2]=c[x>>2]|1;k=a;return k|0}else{x=a+b|0;c[d>>2]=e&1|b|2;c[x+4>>2]=f|3;b=x+f+4|0;c[b>>2]=c[b>>2]|1;Dw(x,f);k=a;return k|0}return 0}function Dw(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0;d=a+b|0;e=c[a+4>>2]|0;do if(!(e&1)){f=c[a>>2]|0;if(!(e&3))return;g=a+(0-f)|0;h=f+b|0;i=c[17748]|0;if(g>>>0<i>>>0)fb();if((g|0)==(c[17749]|0)){j=d+4|0;k=c[j>>2]|0;if((k&3|0)!=3){l=g;m=h;break}c[17746]=h;c[j>>2]=k&-2;c[g+4>>2]=h|1;c[g+h>>2]=h;return}k=f>>>3;if(f>>>0<256){f=c[g+8>>2]|0;j=c[g+12>>2]|0;n=71016+(k<<1<<2)|0;if((f|0)!=(n|0)){if(f>>>0<i>>>0)fb();if((c[f+12>>2]|0)!=(g|0))fb()}if((j|0)==(f|0)){c[17744]=c[17744]&~(1<<k);l=g;m=h;break}if((j|0)!=(n|0)){if(j>>>0<i>>>0)fb();n=j+8|0;if((c[n>>2]|0)==(g|0))o=n;else fb()}else o=j+8|0;c[f+12>>2]=j;c[o>>2]=f;l=g;m=h;break}f=c[g+24>>2]|0;j=c[g+12>>2]|0;do if((j|0)==(g|0)){n=g+16|0;k=n+4|0;p=c[k>>2]|0;if(!p){q=c[n>>2]|0;if(!q){r=0;break}else{s=q;t=n}}else{s=p;t=k}while(1){k=s+20|0;p=c[k>>2]|0;if(p|0){s=p;t=k;continue}k=s+16|0;p=c[k>>2]|0;if(!p){u=s;v=t;break}else{s=p;t=k}}if(v>>>0<i>>>0)fb();else{c[v>>2]=0;r=u;break}}else{k=c[g+8>>2]|0;if(k>>>0<i>>>0)fb();p=k+12|0;if((c[p>>2]|0)!=(g|0))fb();n=j+8|0;if((c[n>>2]|0)==(g|0)){c[p>>2]=j;c[n>>2]=k;r=j;break}else fb()}while(0);if(f){j=c[g+28>>2]|0;i=71280+(j<<2)|0;if((g|0)==(c[i>>2]|0)){c[i>>2]=r;if(!r){c[17745]=c[17745]&~(1<<j);l=g;m=h;break}}else{if(f>>>0<(c[17748]|0)>>>0)fb();j=f+16|0;if((c[j>>2]|0)==(g|0))c[j>>2]=r;else c[f+20>>2]=r;if(!r){l=g;m=h;break}}j=c[17748]|0;if(r>>>0<j>>>0)fb();c[r+24>>2]=f;i=g+16|0;k=c[i>>2]|0;do if(k|0)if(k>>>0<j>>>0)fb();else{c[r+16>>2]=k;c[k+24>>2]=r;break}while(0);k=c[i+4>>2]|0;if(k)if(k>>>0<(c[17748]|0)>>>0)fb();else{c[r+20>>2]=k;c[k+24>>2]=r;l=g;m=h;break}else{l=g;m=h}}else{l=g;m=h}}else{l=a;m=b}while(0);b=c[17748]|0;if(d>>>0<b>>>0)fb();a=d+4|0;r=c[a>>2]|0;if(!(r&2)){if((d|0)==(c[17750]|0)){u=(c[17747]|0)+m|0;c[17747]=u;c[17750]=l;c[l+4>>2]=u|1;if((l|0)!=(c[17749]|0))return;c[17749]=0;c[17746]=0;return}if((d|0)==(c[17749]|0)){u=(c[17746]|0)+m|0;c[17746]=u;c[17749]=l;c[l+4>>2]=u|1;c[l+u>>2]=u;return}u=(r&-8)+m|0;v=r>>>3;do if(r>>>0>=256){t=c[d+24>>2]|0;s=c[d+12>>2]|0;do if((s|0)==(d|0)){o=d+16|0;e=o+4|0;k=c[e>>2]|0;if(!k){j=c[o>>2]|0;if(!j){w=0;break}else{x=j;y=o}}else{x=k;y=e}while(1){e=x+20|0;k=c[e>>2]|0;if(k|0){x=k;y=e;continue}e=x+16|0;k=c[e>>2]|0;if(!k){z=x;A=y;break}else{x=k;y=e}}if(A>>>0<b>>>0)fb();else{c[A>>2]=0;w=z;break}}else{e=c[d+8>>2]|0;if(e>>>0<b>>>0)fb();k=e+12|0;if((c[k>>2]|0)!=(d|0))fb();o=s+8|0;if((c[o>>2]|0)==(d|0)){c[k>>2]=s;c[o>>2]=e;w=s;break}else fb()}while(0);if(t|0){s=c[d+28>>2]|0;h=71280+(s<<2)|0;if((d|0)==(c[h>>2]|0)){c[h>>2]=w;if(!w){c[17745]=c[17745]&~(1<<s);break}}else{if(t>>>0<(c[17748]|0)>>>0)fb();s=t+16|0;if((c[s>>2]|0)==(d|0))c[s>>2]=w;else c[t+20>>2]=w;if(!w)break}s=c[17748]|0;if(w>>>0<s>>>0)fb();c[w+24>>2]=t;h=d+16|0;g=c[h>>2]|0;do if(g|0)if(g>>>0<s>>>0)fb();else{c[w+16>>2]=g;c[g+24>>2]=w;break}while(0);g=c[h+4>>2]|0;if(g|0)if(g>>>0<(c[17748]|0)>>>0)fb();else{c[w+20>>2]=g;c[g+24>>2]=w;break}}}else{g=c[d+8>>2]|0;s=c[d+12>>2]|0;t=71016+(v<<1<<2)|0;if((g|0)!=(t|0)){if(g>>>0<b>>>0)fb();if((c[g+12>>2]|0)!=(d|0))fb()}if((s|0)==(g|0)){c[17744]=c[17744]&~(1<<v);break}if((s|0)!=(t|0)){if(s>>>0<b>>>0)fb();t=s+8|0;if((c[t>>2]|0)==(d|0))B=t;else fb()}else B=s+8|0;c[g+12>>2]=s;c[B>>2]=g}while(0);c[l+4>>2]=u|1;c[l+u>>2]=u;if((l|0)==(c[17749]|0)){c[17746]=u;return}else C=u}else{c[a>>2]=r&-2;c[l+4>>2]=m|1;c[l+m>>2]=m;C=m}m=C>>>3;if(C>>>0<256){r=71016+(m<<1<<2)|0;a=c[17744]|0;u=1<<m;if(a&u){m=r+8|0;B=c[m>>2]|0;if(B>>>0<(c[17748]|0)>>>0)fb();else{D=m;E=B}}else{c[17744]=a|u;D=r+8|0;E=r}c[D>>2]=l;c[E+12>>2]=l;c[l+8>>2]=E;c[l+12>>2]=r;return}r=C>>>8;if(r)if(C>>>0>16777215)F=31;else{E=(r+1048320|0)>>>16&8;D=r<<E;r=(D+520192|0)>>>16&4;u=D<<r;D=(u+245760|0)>>>16&2;a=14-(r|E|D)+(u<<D>>>15)|0;F=C>>>(a+7|0)&1|a<<1}else F=0;a=71280+(F<<2)|0;c[l+28>>2]=F;c[l+20>>2]=0;c[l+16>>2]=0;D=c[17745]|0;u=1<<F;if(!(D&u)){c[17745]=D|u;c[a>>2]=l;c[l+24>>2]=a;c[l+12>>2]=l;c[l+8>>2]=l;return}u=C<<((F|0)==31?0:25-(F>>>1)|0);F=c[a>>2]|0;while(1){if((c[F+4>>2]&-8|0)==(C|0)){G=F;H=127;break}a=F+16+(u>>>31<<2)|0;D=c[a>>2]|0;if(!D){I=a;J=F;H=124;break}else{u=u<<1;F=D}}if((H|0)==124){if(I>>>0<(c[17748]|0)>>>0)fb();c[I>>2]=l;c[l+24>>2]=J;c[l+12>>2]=l;c[l+8>>2]=l;return}else if((H|0)==127){H=G+8|0;J=c[H>>2]|0;I=c[17748]|0;if(!(J>>>0>=I>>>0&G>>>0>=I>>>0))fb();c[J+12>>2]=l;c[H>>2]=l;c[l+8>>2]=J;c[l+12>>2]=G;c[l+24>>2]=0;return}}function Ew(){}function Fw(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0;e=b-d>>>0;e=b-d-(c>>>0>a>>>0|0)>>>0;return (C=e,a-c>>>0|0)|0}function Gw(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0;e=a+c>>>0;return (C=b+d+(e>>>0<a>>>0|0)>>>0,e|0)|0}function Hw(a){a=a|0;return 0}function Iw(b){b=b|0;var c=0;c=a[m+(b&255)>>0]|0;if((c|0)<8)return c|0;c=a[m+(b>>8&255)>>0]|0;if((c|0)<8)return c+8|0;c=a[m+(b>>16&255)>>0]|0;if((c|0)<8)return c+16|0;return (a[m+(b>>>24)>>0]|0)+24|0}function Jw(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,D=0,E=0,F=0,G=0,H=0;g=a;h=b;i=h;j=d;k=e;l=k;if(!i){m=(f|0)!=0;if(!l){if(m){c[f>>2]=(g>>>0)%(j>>>0);c[f+4>>2]=0}n=0;o=(g>>>0)/(j>>>0)>>>0;return (C=n,o)|0}else{if(!m){n=0;o=0;return (C=n,o)|0}c[f>>2]=a|0;c[f+4>>2]=b&0;n=0;o=0;return (C=n,o)|0}}m=(l|0)==0;do if(j){if(!m){p=(T(l|0)|0)-(T(i|0)|0)|0;if(p>>>0<=31){q=p+1|0;r=31-p|0;s=p-31>>31;t=q;u=g>>>(q>>>0)&s|i<<r;v=i>>>(q>>>0)&s;w=0;x=g<<r;break}if(!f){n=0;o=0;return (C=n,o)|0}c[f>>2]=a|0;c[f+4>>2]=h|b&0;n=0;o=0;return (C=n,o)|0}r=j-1|0;if(r&j|0){s=(T(j|0)|0)+33-(T(i|0)|0)|0;q=64-s|0;p=32-s|0;y=p>>31;z=s-32|0;A=z>>31;t=s;u=p-1>>31&i>>>(z>>>0)|(i<<p|g>>>(s>>>0))&A;v=A&i>>>(s>>>0);w=g<<q&y;x=(i<<q|g>>>(z>>>0))&y|g<<p&s-33>>31;break}if(f|0){c[f>>2]=r&g;c[f+4>>2]=0}if((j|0)==1){n=h|b&0;o=a|0|0;return (C=n,o)|0}else{r=Iw(j|0)|0;n=i>>>(r>>>0)|0;o=i<<32-r|g>>>(r>>>0)|0;return (C=n,o)|0}}else{if(m){if(f|0){c[f>>2]=(i>>>0)%(j>>>0);c[f+4>>2]=0}n=0;o=(i>>>0)/(j>>>0)>>>0;return (C=n,o)|0}if(!g){if(f|0){c[f>>2]=0;c[f+4>>2]=(i>>>0)%(l>>>0)}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h|0,c[g+4>>2]^j|0,h|0,j|0)|0;j=C;i=f;return (C=j,l)|0}function Lw(a,b,c){a=a|0;b=b|0;c=c|0;if((c|0)<32){C=b>>c;return a>>>c|(b&(1<<c)-1)<<32-c}C=(b|0)<0?-1:0;return b>>c-32|0}function Mw(a,b,c){a=a|0;b=b|0;c=c|0;if((c|0)<32){C=b>>>c;return a>>>c|(b&(1<<c)-1)<<32-c}C=0;return b>>>c-32|0}function Nw(a){a=a|0;return 0}function Ow(b,d,e){b=b|0;d=d|0;e=e|0;var f=0;if((e|0)>=4096)return Sa(b|0,d|0,e|0)|0;f=b|0;if((b&3)==(d&3)){while(b&3){if(!e)return f|0;a[b>>0]=a[d>>0]|0;b=b+1|0;d=d+1|0;e=e-1|0}while((e|0)>=4){c[b>>2]=c[d>>2];b=b+4|0;d=d+4|0;e=e-4|0}}while((e|0)>0){a[b>>0]=a[d>>0]|0;b=b+1|0;d=d+1|0;e=e-1|0}return f|0}function Pw(a,b,c){a=a|0;b=b|0;c=c|0;if((c|0)<32){C=b<<c|(a&(1<<c)-1<<32-c)>>>32-c;return a<<c}C=a<<c-32;return 0}function Qw(b,c,d){b=b|0;c=c|0;d=d|0;var e=0;if((c|0)<(b|0)&(b|0)<(c+d|0)){e=b;c=c+d|0;b=b+d|0;while((d|0)>0){b=b-1|0;c=c-1|0;d=d-1|0;a[b>>0]=a[c>>0]|0}b=e}else Ow(b,c,d)|0;return b|0}function Rw(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0;f=i;i=i+16|0;g=f|0;Jw(a,b,d,e,g)|0;i=f;return (C=c[g+4>>2]|0,c[g>>2]|0)|0}function Sw(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0;f=b+e|0;if((e|0)>=20){d=d&255;g=b&3;h=d|d<<8|d<<16|d<<24;i=f&~3;if(g){g=b+4-g|0;while((b|0)<(g|0)){a[b>>0]=d;b=b+1|0}}while((b|0)<(i|0)){c[b>>2]=h;b=b+4|0}}while((b|0)<(f|0)){a[b>>0]=d;b=b+1|0}return b-e|0}function Tw(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;e=b>>31|((b|0)<0?-1:0)<<1;f=((b|0)<0?-1:0)>>31|((b|0)<0?-1:0)<<1;g=d>>31|((d|0)<0?-1:0)<<1;h=((d|0)<0?-1:0)>>31|((d|0)<0?-1:0)<<1;i=Fw(e^a|0,f^b|0,e|0,f|0)|0;b=C;a=g^e;e=h^f;return Fw((Jw(i,b,Fw(g^c|0,h^d|0,g|0,h|0)|0,C,0)|0)^a|0,C^e|0,a|0,e|0)|0}function Uw(a){a=a|0;return (a&255)<<24|(a>>8&255)<<16|(a>>16&255)<<8|a>>>24|0}function Vw(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;return Jw(a,b,c,d,0)|0}function Ww(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0;c=a&65535;d=b&65535;e=R(d,c)|0;f=a>>>16;a=(e>>>16)+(R(d,f)|0)|0;d=b>>>16;b=R(d,c)|0;return (C=(a>>>16)+(R(d,f)|0)+(((a&65535)+b|0)>>>16)|0,a+b<<16|e&65535|0)|0}function Xw(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0;e=a;a=c;c=Ww(e,a)|0;f=C;return (C=(R(b,a)|0)+(R(d,e)|0)+f|f&0,c|0|0)|0}function Yw(){return 0}function Zw(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;return sb[a&63](b|0,c|0,d|0)|0}function _w(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;tb[a&15](b|0,c|0,d|0,e|0,f|0)}function $w(a,b){a=a|0;b=b|0;ub[a&15](b|0)}function ax(a,b,c){a=a|0;b=b|0;c=c|0;vb[a&7](b|0,c|0)}function bx(a,b){a=a|0;b=b|0;return wb[a&15](b|0)|0}function cx(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;xb[a&7](b|0,c|0,d|0)}function dx(a){a=a|0;yb[a&3]()}function ex(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;return zb[a&7](b|0,c|0,d|0,e|0)|0}function fx(a,b,c,d,e,f,g){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;Ab[a&1](b|0,c|0,d|0,e|0,f|0,g|0)}function gx(a,b,c){a=a|0;b=b|0;c=c|0;return Bb[a&7](b|0,c|0)|0}function hx(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;Cb[a&1](b|0,c|0,d|0,e|0)}function ix(a,b,c){a=a|0;b=b|0;c=c|0;X(0);return 0}function jx(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;Y(1)}function kx(a){a=a|0;Z(2)}function lx(a,b){a=a|0;b=b|0;_(3)}function mx(a){a=a|0;$(4);return 0}function nx(a,b,c){a=a|0;b=b|0;c=c|0;aa(5)}function ox(){ba(6)}function px(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;ca(7);return 0}function qx(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;da(8)}function rx(a,b){a=a|0;b=b|0;ea(9);return 0}function sx(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;fa(10)}
+function Cl(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;d=i;i=i+112|0;if((i|0)>=(j|0))U();e=d+100|0;f=d+96|0;g=d+92|0;h=d+88|0;k=d+84|0;l=d+80|0;m=d+76|0;n=d+72|0;o=d+68|0;p=d+64|0;q=d;c[e>>2]=a;c[f>>2]=b;c[g>>2]=c[e>>2];c[h>>2]=c[f>>2];c[k>>2]=c[(c[g>>2]|0)+160>>2];c[l>>2]=c[(c[g>>2]|0)+164>>2];c[m>>2]=c[(c[g>>2]|0)+168>>2];c[n>>2]=c[(c[g>>2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function El(a){a=a|0;var b=0,e=0,f=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();e=b+4|0;f=b;c[e>>2]=a;c[f>>2]=c[e>>2];i=b;return (d[c[f>>2]>>0]|0)<<24|(d[(c[f>>2]|0)+1>>0]|0)<<16|(d[(c[f>>2]|0)+2>>0]|0)<<8|(d[(c[f>>2]|0)+3>>0]|0)|0}function Fl(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0;d=i;i=i+32|0;if((i|0)>=(j|0))U();e=d+28|0;f=d+24|0;g=d+20|0;h=d+16|0;k=d+12|0;l=d+8|0;m=d+4|0;n=d;c[e>>2]=b;c[f>>2]=c[e>>2];Ar(c[f>>2]|0,0,0);c[g>>2]=c[(c[f>>2]|0)+128>>2];c[h>>2]=c[(c[f>>2]|0)+128+4>>2];c[l>>2]=c[g>>2]<<6;c[k>>2]=c[h>>2]<<6|(c[g>>2]|0)>>>26;c[g>>2]=c[l>>2];h=(c[l>>2]|0)+(c[(c[f>>2]|0)+144>>2]|0)|0;c[l>>2]=h;if(h>>>0<(c[g>>2]|0)>>>0)c[k>>2]=(c[k>>2]|0)+1;c[g>>2]=c[l>>2];c[l>>2]=c[l>>2]<<3;c[k>>2]=c[k>>2]<<3;c[k>>2]=c[k>>2]|(c[g>>2]|0)>>>29;g=(c[(c[f>>2]|0)+144>>2]|0)<56;h=(c[f>>2]|0)+144|0;e=c[h>>2]|0;c[h>>2]=e+1;a[(c[f>>2]|0)+e>>0]=-128;a:do if(g)while(1){if((c[(c[f>>2]|0)+144>>2]|0)>=56)break a;e=(c[f>>2]|0)+144|0;h=c[e>>2]|0;c[e>>2]=h+1;a[(c[f>>2]|0)+h>>0]=0}else{while(1){o=c[f>>2]|0;if((c[(c[f>>2]|0)+144>>2]|0)>=64)break;h=o+144|0;e=c[h>>2]|0;c[h>>2]=e+1;a[(c[f>>2]|0)+e>>0]=0}Ar(o,0,0);e=c[f>>2]|0;h=e+56|0;do{c[e>>2]=0;e=e+4|0}while((e|0)<(h|0))}while(0);Gl((c[f>>2]|0)+56|0,c[k>>2]|0);Gl((c[f>>2]|0)+60|0,c[l>>2]|0);c[n>>2]=Bl(c[f>>2]|0,c[f>>2]|0,1)|0;Qe(c[n>>2]|0);Re();c[m>>2]=c[f>>2];Gl(c[m>>2]|0,c[(c[f>>2]|0)+160>>2]|0);c[m>>2]=(c[m>>2]|0)+4;Gl(c[m>>2]|0,c[(c[f>>2]|0)+164>>2]|0);c[m>>2]=(c[m>>2]|0)+4;Gl(c[m>>2]|0,c[(c[f>>2]|0)+168>>2]|0);c[m>>2]=(c[m>>2]|0)+4;Gl(c[m>>2]|0,c[(c[f>>2]|0)+172>>2]|0);c[m>>2]=(c[m>>2]|0)+4;Gl(c[m>>2]|0,c[(c[f>>2]|0)+176>>2]|0);c[m>>2]=(c[m>>2]|0)+4;i=d;return}function Gl(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=i;i=i+16|0;if((i|0)>=(j|0))U();f=e+8|0;g=e+4|0;h=e;c[f>>2]=b;c[g>>2]=d;c[h>>2]=c[f>>2];a[c[h>>2]>>0]=(c[g>>2]|0)>>>24;a[(c[h>>2]|0)+1>>0]=(c[g>>2]|0)>>>16;a[(c[h>>2]|0)+2>>0]=(c[g>>2]|0)>>>8;a[(c[h>>2]|0)+3>>0]=c[g>>2];i=e;return}function Hl(a){a=a|0;var b=0,d=0,e=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b+4|0;e=b;c[d>>2]=a;c[e>>2]=c[d>>2];i=b;return c[e>>2]|0}function Il(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,k=0,l=0;e=i;i=i+16|0;if((i|0)>=(j|0))U();f=e+12|0;g=e+8|0;h=e+4|0;k=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;if((c[f>>2]|0)==2){c[k>>2]=Jl(c[g>>2]|0,c[h>>2]|0)|0;l=c[k>>2]|0;i=e;return l|0}else{c[k>>2]=5;l=c[k>>2]|0;i=e;return l|0}return 0}function Jl(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,k=0,l=0;d=i;i=i+32|0;if((i|0)>=(j|0))U();e=d+16|0;f=d+12|0;g=d+8|0;h=d+4|0;k=d;c[f>>2]=a;c[g>>2]=b;c[h>>2]=42681;c[k>>2]=zr(2,0,42694,3,42184,20)|0;do if(!(c[k>>2]|0)){if(c[f>>2]|0){c[h>>2]=42747;c[k>>2]=zr(2,0,42325,56,42205,20)|0;if(c[k>>2]|0)break;c[h>>2]=42921;c[k>>2]=zr(2,1,0,0,42226,20)|0;if(c[k>>2]|0)break}c[e>>2]=0;l=c[e>>2]|0;i=d;return l|0}while(0);if(c[g>>2]|0)Cb[c[g>>2]&1](42986,2,c[h>>2]|0,c[k>>2]|0);c[e>>2]=50;l=c[e>>2]|0;i=d;return l|0}function Kl(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,k=0,l=0;f=i;i=i+208|0;if((i|0)>=(j|0))U();g=f+192|0;h=f+188|0;k=f+184|0;l=f;c[g>>2]=b;c[h>>2]=d;c[k>>2]=e;Al(l,0);Ar(l,c[h>>2]|0,c[k>>2]|0);Fl(l);k=c[g>>2]|0;g=l;l=k+20|0;do{a[k>>0]=a[g>>0]|0;k=k+1|0;g=g+1|0}while((k|0)<(l|0));i=f;return}function Ll(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,k=0,l=0;f=i;i=i+208|0;if((i|0)>=(j|0))U();g=f+192|0;h=f+188|0;k=f+184|0;l=f;c[g>>2]=b;c[h>>2]=d;c[k>>2]=e;Al(l,0);while(1){if((c[k>>2]|0)<=0)break;Ar(l,(c[(c[h>>2]|0)+12>>2]|0)+(c[(c[h>>2]|0)+4>>2]|0)|0,c[(c[h>>2]|0)+8>>2]|0);c[h>>2]=(c[h>>2]|0)+16;c[k>>2]=(c[k>>2]|0)+-1}Fl(l);k=c[g>>2]|0;g=l;l=k+20|0;do{a[k>>0]=a[g>>0]|0;k=k+1|0;g=g+1|0}while((k|0)<(l|0));i=f;return}function Ml(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=i;i=i+16|0;if((i|0)>=(j|0))U();e=d+12|0;f=d+4|0;c[e>>2]=a;c[d+8>>2]=b;c[f>>2]=c[e>>2];c[d>>2]=cg()|0;c[(c[f>>2]|0)+160>>2]=-1056596264;c[(c[f>>2]|0)+164>>2]=914150663;c[(c[f>>2]|0)+168>>2]=812702999;c[(c[f>>2]|0)+172>>2]=-150054599;c[(c[f>>2]|0)+176>>2]=-4191439;c[(c[f>>2]|0)+180>>2]=1750603025;c[(c[f>>2]|0)+184>>2]=1694076839;c[(c[f>>2]|0)+188>>2]=-1090891868;e=(c[f>>2]|0)+128|0;c[e>>2]=0;c[e+4>>2]=0;e=(c[f>>2]|0)+136|0;c[e>>2]=0;c[e+4>>2]=0;c[(c[f>>2]|0)+144>>2]=0;c[(c[f>>2]|0)+148>>2]=64;c[(c[f>>2]|0)+152>>2]=33;i=d;return}function Nl(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,k=0,l=0;e=i;i=i+32|0;if((i|0)>=(j|0))U();f=e+16|0;g=e+12|0;h=e+8|0;k=e+4|0;l=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;c[k>>2]=c[f>>2];do{c[l>>2]=Ol(c[k>>2]|0,c[g>>2]|0)|0;c[g>>2]=(c[g>>2]|0)+64;f=(c[h>>2]|0)+-1|0;c[h>>2]=f}while((f|0)!=0);i=e;return c[l>>2]|0}function Ol(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0;d=i;i=i+320|0;if((i|0)>=(j|0))U();e=d+312|0;f=d+308|0;g=d+304|0;h=d+300|0;k=d+296|0;l=d+292|0;m=d+288|0;n=d+284|0;o=d+280|0;p=d+276|0;q=d+272|0;r=d+268|0;s=d+264|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0)+(c[h>>2]|0);h=(c[g>>2]|0)+164|0;c[h>>2]=(c[h>>2]|0)+(c[k>>2]|0);k=(c[g>>2]|0)+168|0;c[k>>2]=(c[k>>2]|0)+(c[l>>2]|0);l=(c[g>>2]|0)+172|0;c[l>>2]=(c[l>>2]|0)+(c[m>>2]|0);m=(c[g>>2]|0)+176|0;c[m>>2]=(c[m>>2]|0)+(c[n>>2]|0);n=(c[g>>2]|0)+180|0;c[n>>2]=(c[n>>2]|0)+(c[o>>2]|0);o=(c[g>>2]|0)+184|0;c[o>>2]=(c[o>>2]|0)+(c[p>>2]|0);p=(c[g>>2]|0)+188|0;c[p>>2]=(c[p>>2]|0)+(c[q>>2]|0);i=d;return 328}function Pl(a){a=a|0;var b=0,e=0,f=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();e=b+4|0;f=b;c[e>>2]=a;c[f>>2]=c[e>>2];i=b;return (d[c[f>>2]>>0]|0)<<24|(d[(c[f>>2]|0)+1>>0]|0)<<16|(d[(c[f>>2]|0)+2>>0]|0)<<8|(d[(c[f>>2]|0)+3>>0]|0)|0}function Ql(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=i;i=i+16|0;if((i|0)>=(j|0))U();e=d+4|0;f=d;c[e>>2]=a;c[f>>2]=b;i=d;return (c[e>>2]|0)>>>(c[f>>2]&31)|c[e>>2]<<(32-(c[f>>2]|0)&31)|0}function Rl(a){a=a|0;var b=0,d=0,e=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b;c[d>>2]=a;a=Ql(c[d>>2]|0,6)|0;e=a^(Ql(c[d>>2]|0,11)|0);a=e^(Ql(c[d>>2]|0,25)|0);i=b;return a|0}function Sl(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=i;i=i+16|0;if((i|0)>=(j|0))U();f=e+8|0;g=e+4|0;h=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;i=e;return c[h>>2]^c[f>>2]&(c[g>>2]^c[h>>2])|0}function Tl(a){a=a|0;var b=0,d=0,e=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b;c[d>>2]=a;a=Ql(c[d>>2]|0,2)|0;e=a^(Ql(c[d>>2]|0,13)|0);a=e^(Ql(c[d>>2]|0,22)|0);i=b;return a|0}function Ul(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=i;i=i+16|0;if((i|0)>=(j|0))U();f=e+8|0;g=e+4|0;h=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;i=e;return c[f>>2]&c[g>>2]|c[h>>2]&(c[f>>2]|c[g>>2])|0}function Vl(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0;d=i;i=i+32|0;if((i|0)>=(j|0))U();e=d+28|0;f=d+24|0;g=d+20|0;h=d+16|0;k=d+12|0;l=d+8|0;m=d+4|0;n=d;c[e>>2]=b;c[f>>2]=c[e>>2];Ar(c[f>>2]|0,0,0);c[g>>2]=c[(c[f>>2]|0)+128>>2];c[h>>2]=c[(c[f>>2]|0)+128+4>>2];c[l>>2]=c[g>>2]<<6;c[k>>2]=c[h>>2]<<6|(c[g>>2]|0)>>>26;c[g>>2]=c[l>>2];h=(c[l>>2]|0)+(c[(c[f>>2]|0)+144>>2]|0)|0;c[l>>2]=h;if(h>>>0<(c[g>>2]|0)>>>0)c[k>>2]=(c[k>>2]|0)+1;c[g>>2]=c[l>>2];c[l>>2]=c[l>>2]<<3;c[k>>2]=c[k>>2]<<3;c[k>>2]=c[k>>2]|(c[g>>2]|0)>>>29;g=(c[(c[f>>2]|0)+144>>2]|0)<56;h=(c[f>>2]|0)+144|0;e=c[h>>2]|0;c[h>>2]=e+1;a[(c[f>>2]|0)+e>>0]=-128;a:do if(g)while(1){if((c[(c[f>>2]|0)+144>>2]|0)>=56)break a;e=(c[f>>2]|0)+144|0;h=c[e>>2]|0;c[e>>2]=h+1;a[(c[f>>2]|0)+h>>0]=0}else{while(1){o=c[f>>2]|0;if((c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0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b+4|0;e=b;c[d>>2]=a;c[e>>2]=c[d>>2];i=b;return c[e>>2]|0}function Yl(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,k=0;e=i;i=i+16|0;if((i|0)>=(j|0))U();f=e+12|0;g=e+8|0;h=e+4|0;k=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;switch(c[f>>2]|0){case 11:{c[k>>2]=Zl(c[g>>2]|0,c[h>>2]|0)|0;break}case 8:{c[k>>2]=_l(c[g>>2]|0,c[h>>2]|0)|0;break}default:c[k>>2]=5}i=e;return c[k>>2]|0}function Zl(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,k=0,l=0;d=i;i=i+32|0;if((i|0)>=(j|0))U();e=d+16|0;f=d+12|0;g=d+8|0;h=d+4|0;k=d;c[f>>2]=a;c[g>>2]=b;c[h>>2]=42681;c[k>>2]=zr(11,0,42694,3,42296,28)|0;do if(!(c[k>>2]|0)){if(c[f>>2]|0){c[h>>2]=42747;c[k>>2]=zr(11,0,42325,56,42382,28)|0;if(c[k>>2]|0)break;c[h>>2]=42921;c[k>>2]=zr(11,1,0,0,42411,28)|0;if(c[k>>2]|0)break}c[e>>2]=0;l=c[e>>2]|0;i=d;return l|0}while(0);if(c[g>>2]|0)Cb[c[g>>2]&1](42986,11,c[h>>2]|0,c[k>>2]|0);c[e>>2]=50;l=c[e>>2]|0;i=d;return l|0}function _l(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,k=0,l=0;d=i;i=i+32|0;if((i|0)>=(j|0))U();e=d+16|0;f=d+12|0;g=d+8|0;h=d+4|0;k=d;c[f>>2]=a;c[g>>2]=b;c[h>>2]=42681;c[k>>2]=zr(8,0,42694,3,42440,32)|0;do if(!(c[k>>2]|0)){if(c[f>>2]|0){c[h>>2]=42747;c[k>>2]=zr(8,0,42325,56,42473,32)|0;if(c[k>>2]|0)break;c[h>>2]=42921;c[k>>2]=zr(8,1,0,0,42506,32)|0;if(c[k>>2]|0)break}c[e>>2]=0;l=c[e>>2]|0;i=d;return l|0}while(0);if(c[g>>2]|0)Cb[c[g>>2]&1](42986,8,c[h>>2]|0,c[k>>2]|0);c[e>>2]=50;l=c[e>>2]|0;i=d;return l|0}function $l(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=i;i=i+16|0;if((i|0)>=(j|0))U();e=d+12|0;f=d+4|0;c[e>>2]=a;c[d+8>>2]=b;c[f>>2]=c[e>>2];c[d>>2]=cg()|0;c[(c[f>>2]|0)+160>>2]=1779033703;c[(c[f>>2]|0)+164>>2]=-1150833019;c[(c[f>>2]|0)+168>>2]=1013904242;c[(c[f>>2]|0)+172>>2]=-1521486534;c[(c[f>>2]|0)+176>>2]=1359893119;c[(c[f>>2]|0)+180>>2]=-1694144372;c[(c[f>>2]|0)+184>>2]=528734635;c[(c[f>>2]|0)+188>>2]=1541459225;e=(c[f>>2]|0)+128|0;c[e>>2]=0;c[e+4>>2]=0;e=(c[f>>2]|0)+136|0;c[e>>2]=0;c[e+4>>2]=0;c[(c[f>>2]|0)+144>>2]=0;c[(c[f>>2]|0)+148>>2]=64;c[(c[f>>2]|0)+152>>2]=33;i=d;return}function am(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=i;i=i+32|0;if((i|0)>=(j|0))U();e=d+16|0;f=d+8|0;g=d+4|0;c[e>>2]=a;c[d+12>>2]=b;c[f>>2]=c[e>>2];c[g>>2]=(c[f>>2]|0)+160;c[d>>2]=cg()|0;e=c[g>>2]|0;c[e>>2]=-205731576;c[e+4>>2]=1779033703;e=(c[g>>2]|0)+8|0;c[e>>2]=-2067093701;c[e+4>>2]=-1150833019;e=(c[g>>2]|0)+16|0;c[e>>2]=-23791573;c[e+4>>2]=1013904242;e=(c[g>>2]|0)+24|0;c[e>>2]=1595750129;c[e+4>>2]=-1521486534;e=(c[g>>2]|0)+32|0;c[e>>2]=-1377402159;c[e+4>>2]=1359893119;e=(c[g>>2]|0)+40|0;c[e>>2]=725511199;c[e+4>>2]=-1694144372;e=(c[g>>2]|0)+48|0;c[e>>2]=-79577749;c[e+4>>2]=528734635;e=(c[g>>2]|0)+56|0;c[e>>2]=327033209;c[e+4>>2]=1541459225;e=(c[f>>2]|0)+128|0;c[e>>2]=0;c[e+4>>2]=0;e=(c[f>>2]|0)+136|0;c[e>>2]=0;c[e+4>>2]=0;c[(c[f>>2]|0)+144>>2]=0;c[(c[f>>2]|0)+148>>2]=128;c[(c[f>>2]|0)+152>>2]=34;i=d;return}function bm(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,k=0,l=0;e=i;i=i+32|0;if((i|0)>=(j|0))U();f=e+16|0;g=e+12|0;h=e+8|0;k=e+4|0;l=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;c[k>>2]=c[f>>2];do{c[l>>2]=(cm((c[k>>2]|0)+160|0,c[g>>2]|0)|0)+12;c[g>>2]=(c[g>>2]|0)+128;f=(c[h>>2]|0)+-1|0;c[h>>2]=f}while((f|0)!=0);i=e;return c[l>>2]|0}function cm(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0;d=i;i=i+240|0;if((i|0)>=(j|0))U();e=d+232|0;f=d+228|0;g=d+216|0;h=d+208|0;k=d+200|0;l=d+192|0;m=d+184|0;n=d+176|0;o=d+168|0;p=d+160|0;q=d+32|0;r=d+224|0;s=d+24|0;t=d+16|0;u=d+8|0;v=d;c[e>>2]=a;c[f>>2]=b;b=c[e>>2]|0;a=c[b+4>>2]|0;w=g;c[w>>2]=c[b>>2];c[w+4>>2]=a;a=(c[e>>2]|0)+8|0;w=c[a+4>>2]|0;b=h;c[b>>2]=c[a>>2];c[b+4>>2]=w;w=(c[e>>2]|0)+16|0;b=c[w+4>>2]|0;a=k;c[a>>2]=c[w>>2];c[a+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c[k>>2]|0)+7>>0]=c[h>>2];i=f;return}function lm(a){a=a|0;var b=0,d=0,e=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();d=b+4|0;e=b;c[d>>2]=a;c[e>>2]=c[d>>2];i=b;return c[e>>2]|0}function mm(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,k=0;e=i;i=i+16|0;if((i|0)>=(j|0))U();f=e+12|0;g=e+8|0;h=e+4|0;k=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;switch(c[f>>2]|0){case 9:{c[k>>2]=nm(c[g>>2]|0,c[h>>2]|0)|0;break}case 10:{c[k>>2]=om(c[g>>2]|0,c[h>>2]|0)|0;break}default:c[k>>2]=5}i=e;return c[k>>2]|0}function nm(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,k=0,l=0;d=i;i=i+32|0;if((i|0)>=(j|0))U();e=d+16|0;f=d+12|0;g=d+8|0;h=d+4|0;k=d;c[f>>2]=a;c[g>>2]=b;c[h>>2]=42681;c[k>>2]=zr(9,0,42694,3,42698,48)|0;do if(!(c[k>>2]|0)){if(c[f>>2]|0){c[h>>2]=42747;c[k>>2]=zr(9,0,42759,112,42872,48)|0;if(c[k>>2]|0)break;c[h>>2]=42921;c[k>>2]=zr(9,1,0,0,42937,48)|0;if(c[k>>2]|0)break}c[e>>2]=0;l=c[e>>2]|0;i=d;return l|0}while(0);if(c[g>>2]|0)Cb[c[g>>2]&1](42986,9,c[h>>2]|0,c[k>>2]|0);c[e>>2]=50;l=c[e>>2]|0;i=d;return l|0}function om(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,k=0,l=0;d=i;i=i+32|0;if((i|0)>=(j|0))U();e=d+16|0;f=d+12|0;g=d+8|0;h=d+4|0;k=d;c[f>>2]=a;c[g>>2]=b;c[h>>2]=42681;c[k>>2]=zr(10,0,42694,3,42993,64)|0;do if(!(c[k>>2]|0)){if(c[f>>2]|0){c[h>>2]=42747;c[k>>2]=zr(10,0,42759,112,43058,64)|0;if(c[k>>2]|0)break;c[h>>2]=42921;c[k>>2]=zr(10,1,0,0,43123,64)|0;if(c[k>>2]|0)break}c[e>>2]=0;l=c[e>>2]|0;i=d;return l|0}while(0);if(c[g>>2]|0)Cb[c[g>>2]&1](42986,10,c[h>>2]|0,c[k>>2]|0);c[e>>2]=50;l=c[e>>2]|0;i=d;return l|0}function pm(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=i;i=i+32|0;if((i|0)>=(j|0))U();e=d+16|0;f=d+8|0;g=d+4|0;c[e>>2]=a;c[d+12>>2]=b;c[f>>2]=c[e>>2];c[g>>2]=(c[f>>2]|0)+160;c[d>>2]=cg()|0;e=c[g>>2]|0;c[e>>2]=-1056596264;c[e+4>>2]=-876896931;e=(c[g>>2]|0)+8|0;c[e>>2]=914150663;c[e+4>>2]=1654270250;e=(c[g>>2]|0)+16|0;c[e>>2]=812702999;c[e+4>>2]=-1856437926;e=(c[g>>2]|0)+24|0;c[e>>2]=-150054599;c[e+4>>2]=355462360;e=(c[g>>2]|0)+32|0;c[e>>2]=-4191439;c[e+4>>2]=1731405415;e=(c[g>>2]|0)+40|0;c[e>>2]=1750603025;c[e+4>>2]=-1900787065;e=(c[g>>2]|0)+48|0;c[e>>2]=1694076839;c[e+4>>2]=-619958771;e=(c[g>>2]|0)+56|0;c[e>>2]=-1090891868;c[e+4>>2]=1203062813;e=(c[f>>2]|0)+128|0;c[e>>2]=0;c[e+4>>2]=0;e=(c[f>>2]|0)+136|0;c[e>>2]=0;c[e+4>>2]=0;c[(c[f>>2]|0)+144>>2]=0;c[(c[f>>2]|0)+148>>2]=128;c[(c[f>>2]|0)+152>>2]=34;i=d;return}function qm(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,k=0,l=0;e=i;i=i+32|0;if((i|0)>=(j|0))U();f=e+16|0;g=e+12|0;h=e+8|0;k=e+4|0;l=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;c[k>>2]=c[f>>2];c[l>>2]=rm(c[k>>2]|0,c[g>>2]|0,c[h>>2]|0)|0;Qe(47);Re();i=e;return c[l>>2]|0}
+function rm(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0;g=i;i=i+64|0;if((i|0)>=(j|0))U();h=g;k=g+36|0;l=g+32|0;m=g+28|0;n=g+24|0;o=g+20|0;p=g+16|0;q=g+12|0;r=g+8|0;s=g+4|0;t=g+56|0;u=g+55|0;v=g+54|0;w=g+53|0;x=g+52|0;y=g+51|0;z=g+50|0;A=g+49|0;B=g+48|0;C=g+47|0;D=g+46|0;E=g+45|0;F=g+44|0;G=g+43|0;H=g+42|0;I=g+41|0;J=g+40|0;c[l>>2]=b;c[m>>2]=e;c[n>>2]=f;a[t>>0]=0;a[u>>0]=0;a[v>>0]=0;a[w>>0]=0;a[x>>0]=0;a[y>>0]=0;a[z>>0]=0;a[A>>0]=0;a[B>>0]=0;a[C>>0]=0;a[D>>0]=0;a[E>>0]=0;a[F>>0]=0;a[G>>0]=0;a[H>>0]=0;a[I>>0]=0;if(((c[n>>2]|0)-16|16|0)!=16){c[k>>2]=44;K=c[k>>2]|0;i=g;return K|0}if((c[17657]|0)==0?(c[17657]=1,c[17658]=sm()|0,c[17658]|0):0){c[h>>2]=c[17658];Ie(43523,h)}if(c[17658]|0){c[k>>2]=50;K=c[k>>2]|0;i=g;return K|0}if(a[c[m>>2]>>0]|0){a[J>>0]=a[43527+((d[c[m>>2]>>0]|0)-1)>>0]|0;a[t>>0]=d[t>>0]^d[43782+((d[J>>0]|0)+0)>>0];a[u>>0]=d[u>>0]^d[43782+((d[J>>0]|0)+45)>>0];a[v>>0]=d[v>>0]^d[43782+((d[J>>0]|0)+1)>>0];a[w>>0]=d[w>>0]^d[43782+((d[J>>0]|0)+45)>>0]}if(a[(c[m>>2]|0)+1>>0]|0){a[J>>0]=a[43527+((d[(c[m>>2]|0)+1>>0]|0)-1)>>0]|0;a[t>>0]=d[t>>0]^d[43782+((d[J>>0]|0)+45)>>0];a[u>>0]=d[u>>0]^d[43782+((d[J>>0]|0)+164)>>0];a[v>>0]=d[v>>0]^d[43782+((d[J>>0]|0)+68)>>0];a[w>>0]=d[w>>0]^d[43782+((d[J>>0]|0)+138)>>0]}if(a[(c[m>>2]|0)+2>>0]|0){a[J>>0]=a[43527+((d[(c[m>>2]|0)+2>>0]|0)-1)>>0]|0;a[t>>0]=d[t>>0]^d[43782+((d[J>>0]|0)+138)>>0];a[u>>0]=d[u>>0]^d[43782+((d[J>>0]|0)+213)>>0];a[v>>0]=d[v>>0]^d[43782+((d[J>>0]|0)+191)>>0];a[w>>0]=d[w>>0]^d[43782+((d[J>>0]|0)+209)>>0]}if(a[(c[m>>2]|0)+3>>0]|0){a[J>>0]=a[43527+((d[(c[m>>2]|0)+3>>0]|0)-1)>>0]|0;a[t>>0]=d[t>>0]^d[43782+((d[J>>0]|0)+209)>>0];a[u>>0]=d[u>>0]^d[43782+((d[J>>0]|0)+127)>>0];a[v>>0]=d[v>>0]^d[43782+((d[J>>0]|0)+61)>>0];a[w>>0]=d[w>>0]^d[43782+((d[J>>0]|0)+153)>>0]}if(a[(c[m>>2]|0)+4>>0]|0){a[J>>0]=a[43527+((d[(c[m>>2]|0)+4>>0]|0)-1)>>0]|0;a[t>>0]=d[t>>0]^d[43782+((d[J>>0]|0)+153)>>0];a[u>>0]=d[u>>0]^d[43782+((d[J>>0]|0)+70)>>0];a[v>>0]=d[v>>0]^d[43782+((d[J>>0]|0)+102)>>0];a[w>>0]=d[w>>0]^d[43782+((d[J>>0]|0)+150)>>0]}if(a[(c[m>>2]|0)+5>>0]|0){a[J>>0]=a[43527+((d[(c[m>>2]|0)+5>>0]|0)-1)>>0]|0;a[t>>0]=d[t>>0]^d[43782+((d[J>>0]|0)+150)>>0];a[u>>0]=d[u>>0]^d[43782+((d[J>>0]|0)+60)>>0];a[v>>0]=d[v>>0]^d[43782+((d[J>>0]|0)+91)>>0];a[w>>0]=d[w>>0]^d[43782+((d[J>>0]|0)+237)>>0]}if(a[(c[m>>2]|0)+6>>0]|0){a[J>>0]=a[43527+((d[(c[m>>2]|0)+6>>0]|0)-1)>>0]|0;a[t>>0]=d[t>>0]^d[43782+((d[J>>0]|0)+237)>>0];a[u>>0]=d[u>>0]^d[43782+((d[J>>0]|0)+55)>>0];a[v>>0]=d[v>>0]^d[43782+((d[J>>0]|0)+79)>>0];a[w>>0]=d[w>>0]^d[43782+((d[J>>0]|0)+224)>>0]}if(a[(c[m>>2]|0)+7>>0]|0){a[J>>0]=a[43527+((d[(c[m>>2]|0)+7>>0]|0)-1)>>0]|0;a[t>>0]=d[t>>0]^d[43782+((d[J>>0]|0)+224)>>0];a[u>>0]=d[u>>0]^d[43782+((d[J>>0]|0)+208)>>0];a[v>>0]=d[v>>0]^d[43782+((d[J>>0]|0)+140)>>0];a[w>>0]=d[w>>0]^d[43782+((d[J>>0]|0)+23)>>0]}if(a[(c[m>>2]|0)+8>>0]|0){a[J>>0]=a[43527+((d[(c[m>>2]|0)+8>>0]|0)-1)>>0]|0;a[x>>0]=d[x>>0]^d[43782+((d[J>>0]|0)+0)>>0];a[y>>0]=d[y>>0]^d[43782+((d[J>>0]|0)+45)>>0];a[z>>0]=d[z>>0]^d[43782+((d[J>>0]|0)+1)>>0];a[A>>0]=d[A>>0]^d[43782+((d[J>>0]|0)+45)>>0]}if(a[(c[m>>2]|0)+9>>0]|0){a[J>>0]=a[43527+((d[(c[m>>2]|0)+9>>0]|0)-1)>>0]|0;a[x>>0]=d[x>>0]^d[43782+((d[J>>0]|0)+45)>>0];a[y>>0]=d[y>>0]^d[43782+((d[J>>0]|0)+164)>>0];a[z>>0]=d[z>>0]^d[43782+((d[J>>0]|0)+68)>>0];a[A>>0]=d[A>>0]^d[43782+((d[J>>0]|0)+138)>>0]}if(a[(c[m>>2]|0)+10>>0]|0){a[J>>0]=a[43527+((d[(c[m>>2]|0)+10>>0]|0)-1)>>0]|0;a[x>>0]=d[x>>0]^d[43782+((d[J>>0]|0)+138)>>0];a[y>>0]=d[y>>0]^d[43782+((d[J>>0]|0)+213)>>0];a[z>>0]=d[z>>0]^d[43782+((d[J>>0]|0)+191)>>0];a[A>>0]=d[A>>0]^d[43782+((d[J>>0]|0)+209)>>0]}if(a[(c[m>>2]|0)+11>>0]|0){a[J>>0]=a[43527+((d[(c[m>>2]|0)+11>>0]|0)-1)>>0]|0;a[x>>0]=d[x>>0]^d[43782+((d[J>>0]|0)+209)>>0];a[y>>0]=d[y>>0]^d[43782+((d[J>>0]|0)+127)>>0];a[z>>0]=d[z>>0]^d[43782+((d[J>>0]|0)+61)>>0];a[A>>0]=d[A>>0]^d[43782+((d[J>>0]|0)+153)>>0]}if(a[(c[m>>2]|0)+12>>0]|0){a[J>>0]=a[43527+((d[(c[m>>2]|0)+12>>0]|0)-1)>>0]|0;a[x>>0]=d[x>>0]^d[43782+((d[J>>0]|0)+153)>>0];a[y>>0]=d[y>>0]^d[43782+((d[J>>0]|0)+70)>>0];a[z>>0]=d[z>>0]^d[43782+((d[J>>0]|0)+102)>>0];a[A>>0]=d[A>>0]^d[43782+((d[J>>0]|0)+150)>>0]}if(a[(c[m>>2]|0)+13>>0]|0){a[J>>0]=a[43527+((d[(c[m>>2]|0)+13>>0]|0)-1)>>0]|0;a[x>>0]=d[x>>0]^d[43782+((d[J>>0]|0)+150)>>0];a[y>>0]=d[y>>0]^d[43782+((d[J>>0]|0)+60)>>0];a[z>>0]=d[z>>0]^d[43782+((d[J>>0]|0)+91)>>0];a[A>>0]=d[A>>0]^d[43782+((d[J>>0]|0)+237)>>0]}if(a[(c[m>>2]|0)+14>>0]|0){a[J>>0]=a[43527+((d[(c[m>>2]|0)+14>>0]|0)-1)>>0]|0;a[x>>0]=d[x>>0]^d[43782+((d[J>>0]|0)+237)>>0];a[y>>0]=d[y>>0]^d[43782+((d[J>>0]|0)+55)>>0];a[z>>0]=d[z>>0]^d[43782+((d[J>>0]|0)+79)>>0];a[A>>0]=d[A>>0]^d[43782+((d[J>>0]|0)+224)>>0]}if(a[(c[m>>2]|0)+15>>0]|0){a[J>>0]=a[43527+((d[(c[m>>2]|0)+15>>0]|0)-1)>>0]|0;a[x>>0]=d[x>>0]^d[43782+((d[J>>0]|0)+224)>>0];a[y>>0]=d[y>>0]^d[43782+((d[J>>0]|0)+208)>>0];a[z>>0]=d[z>>0]^d[43782+((d[J>>0]|0)+140)>>0];a[A>>0]=d[A>>0]^d[43782+((d[J>>0]|0)+23)>>0]}if((c[n>>2]|0)==32){if(a[(c[m>>2]|0)+16>>0]|0){a[J>>0]=a[43527+((d[(c[m>>2]|0)+16>>0]|0)-1)>>0]|0;a[B>>0]=d[B>>0]^d[43782+((d[J>>0]|0)+0)>>0];a[C>>0]=d[C>>0]^d[43782+((d[J>>0]|0)+45)>>0];a[D>>0]=d[D>>0]^d[43782+((d[J>>0]|0)+1)>>0];a[E>>0]=d[E>>0]^d[43782+((d[J>>0]|0)+45)>>0]}if(a[(c[m>>2]|0)+17>>0]|0){a[J>>0]=a[43527+((d[(c[m>>2]|0)+17>>0]|0)-1)>>0]|0;a[B>>0]=d[B>>0]^d[43782+((d[J>>0]|0)+45)>>0];a[C>>0]=d[C>>0]^d[43782+((d[J>>0]|0)+164)>>0];a[D>>0]=d[D>>0]^d[43782+((d[J>>0]|0)+68)>>0];a[E>>0]=d[E>>0]^d[43782+((d[J>>0]|0)+138)>>0]}if(a[(c[m>>2]|0)+18>>0]|0){a[J>>0]=a[43527+((d[(c[m>>2]|0)+18>>0]|0)-1)>>0]|0;a[B>>0]=d[B>>0]^d[43782+((d[J>>0]|0)+138)>>0];a[C>>0]=d[C>>0]^d[43782+((d[J>>0]|0)+213)>>0];a[D>>0]=d[D>>0]^d[43782+((d[J>>0]|0)+191)>>0];a[E>>0]=d[E>>0]^d[43782+((d[J>>0]|0)+209)>>0]}if(a[(c[m>>2]|0)+19>>0]|0){a[J>>0]=a[43527+((d[(c[m>>2]|0)+19>>0]|0)-1)>>0]|0;a[B>>0]=d[B>>0]^d[43782+((d[J>>0]|0)+209)>>0];a[C>>0]=d[C>>0]^d[43782+((d[J>>0]|0)+127)>>0];a[D>>0]=d[D>>0]^d[43782+((d[J>>0]|0)+61)>>0];a[E>>0]=d[E>>0]^d[43782+((d[J>>0]|0)+153)>>0]}if(a[(c[m>>2]|0)+20>>0]|0){a[J>>0]=a[43527+((d[(c[m>>2]|0)+20>>0]|0)-1)>>0]|0;a[B>>0]=d[B>>0]^d[43782+((d[J>>0]|0)+153)>>0];a[C>>0]=d[C>>0]^d[43782+((d[J>>0]|0)+70)>>0];a[D>>0]=d[D>>0]^d[43782+((d[J>>0]|0)+102)>>0];a[E>>0]=d[E>>0]^d[43782+((d[J>>0]|0)+150)>>0]}if(a[(c[m>>2]|0)+21>>0]|0){a[J>>0]=a[43527+((d[(c[m>>2]|0)+21>>0]|0)-1)>>0]|0;a[B>>0]=d[B>>0]^d[43782+((d[J>>0]|0)+150)>>0];a[C>>0]=d[C>>0]^d[43782+((d[J>>0]|0)+60)>>0];a[D>>0]=d[D>>0]^d[43782+((d[J>>0]|0)+91)>>0];a[E>>0]=d[E>>0]^d[43782+((d[J>>0]|0)+237)>>0]}if(a[(c[m>>2]|0)+22>>0]|0){a[J>>0]=a[43527+((d[(c[m>>2]|0)+22>>0]|0)-1)>>0]|0;a[B>>0]=d[B>>0]^d[43782+((d[J>>0]|0)+237)>>0];a[C>>0]=d[C>>0]^d[43782+((d[J>>0]|0)+55)>>0];a[D>>0]=d[D>>0]^d[43782+((d[J>>0]|0)+79)>>0];a[E>>0]=d[E>>0]^d[43782+((d[J>>0]|0)+224)>>0]}if(a[(c[m>>2]|0)+23>>0]|0){a[J>>0]=a[43527+((d[(c[m>>2]|0)+23>>0]|0)-1)>>0]|0;a[B>>0]=d[B>>0]^d[43782+((d[J>>0]|0)+224)>>0];a[C>>0]=d[C>>0]^d[43782+((d[J>>0]|0)+208)>>0];a[D>>0]=d[D>>0]^d[43782+((d[J>>0]|0)+140)>>0];a[E>>0]=d[E>>0]^d[43782+((d[J>>0]|0)+23)>>0]}if(a[(c[m>>2]|0)+24>>0]|0){a[J>>0]=a[43527+((d[(c[m>>2]|0)+24>>0]|0)-1)>>0]|0;a[F>>0]=d[F>>0]^d[43782+((d[J>>0]|0)+0)>>0];a[G>>0]=d[G>>0]^d[43782+((d[J>>0]|0)+45)>>0];a[H>>0]=d[H>>0]^d[43782+((d[J>>0]|0)+1)>>0];a[I>>0]=d[I>>0]^d[43782+((d[J>>0]|0)+45)>>0]}if(a[(c[m>>2]|0)+25>>0]|0){a[J>>0]=a[43527+((d[(c[m>>2]|0)+25>>0]|0)-1)>>0]|0;a[F>>0]=d[F>>0]^d[43782+((d[J>>0]|0)+45)>>0];a[G>>0]=d[G>>0]^d[43782+((d[J>>0]|0)+164)>>0];a[H>>0]=d[H>>0]^d[43782+((d[J>>0]|0)+68)>>0];a[I>>0]=d[I>>0]^d[43782+((d[J>>0]|0)+138)>>0]}if(a[(c[m>>2]|0)+26>>0]|0){a[J>>0]=a[43527+((d[(c[m>>2]|0)+26>>0]|0)-1)>>0]|0;a[F>>0]=d[F>>0]^d[43782+((d[J>>0]|0)+138)>>0];a[G>>0]=d[G>>0]^d[43782+((d[J>>0]|0)+213)>>0];a[H>>0]=d[H>>0]^d[43782+((d[J>>0]|0)+191)>>0];a[I>>0]=d[I>>0]^d[43782+((d[J>>0]|0)+209)>>0]}if(a[(c[m>>2]|0)+27>>0]|0){a[J>>0]=a[43527+((d[(c[m>>2]|0)+27>>0]|0)-1)>>0]|0;a[F>>0]=d[F>>0]^d[43782+((d[J>>0]|0)+209)>>0];a[G>>0]=d[G>>0]^d[43782+((d[J>>0]|0)+127)>>0];a[H>>0]=d[H>>0]^d[43782+((d[J>>0]|0)+61)>>0];a[I>>0]=d[I>>0]^d[43782+((d[J>>0]|0)+153)>>0]}if(a[(c[m>>2]|0)+28>>0]|0){a[J>>0]=a[43527+((d[(c[m>>2]|0)+28>>0]|0)-1)>>0]|0;a[F>>0]=d[F>>0]^d[43782+((d[J>>0]|0)+153)>>0];a[G>>0]=d[G>>0]^d[43782+((d[J>>0]|0)+70)>>0];a[H>>0]=d[H>>0]^d[43782+((d[J>>0]|0)+102)>>0];a[I>>0]=d[I>>0]^d[43782+((d[J>>0]|0)+150)>>0]}if(a[(c[m>>2]|0)+29>>0]|0){a[J>>0]=a[43527+((d[(c[m>>2]|0)+29>>0]|0)-1)>>0]|0;a[F>>0]=d[F>>0]^d[43782+((d[J>>0]|0)+150)>>0];a[G>>0]=d[G>>0]^d[43782+((d[J>>0]|0)+60)>>0];a[H>>0]=d[H>>0]^d[43782+((d[J>>0]|0)+91)>>0];a[I>>0]=d[I>>0]^d[43782+((d[J>>0]|0)+237)>>0]}if(a[(c[m>>2]|0)+30>>0]|0){a[J>>0]=a[43527+((d[(c[m>>2]|0)+30>>0]|0)-1)>>0]|0;a[F>>0]=d[F>>0]^d[43782+((d[J>>0]|0)+237)>>0];a[G>>0]=d[G>>0]^d[43782+((d[J>>0]|0)+55)>>0];a[H>>0]=d[H>>0]^d[43782+((d[J>>0]|0)+79)>>0];a[I>>0]=d[I>>0]^d[43782+((d[J>>0]|0)+224)>>0]}if(a[(c[m>>2]|0)+31>>0]|0){a[J>>0]=a[43527+((d[(c[m>>2]|0)+31>>0]|0)-1)>>0]|0;a[F>>0]=d[F>>0]^d[43782+((d[J>>0]|0)+224)>>0];a[G>>0]=d[G>>0]^d[43782+((d[J>>0]|0)+208)>>0];a[H>>0]=d[H>>0]^d[43782+((d[J>>0]|0)+140)>>0];a[I>>0]=d[I>>0]^d[43782+((d[J>>0]|0)+23)>>0]}c[p>>2]=0;c[o>>2]=0;c[q>>2]=1;while(1){if((c[o>>2]|0)>=256)break;c[(c[l>>2]|0)+(c[o>>2]<<2)>>2]=c[8368+((d[45042+(d[45042+(d[44786+(d[44274+(c[q>>2]|0)>>0]^d[t>>0])>>0]^d[x>>0])>>0]^d[B>>0])>>0]^d[F>>0])<<2)>>2];c[(c[l>>2]|0)+1024+(c[o>>2]<<2)>>2]=c[9392+((d[45042+(d[44786+(d[44786+(d[44274+(c[p>>2]|0)>>0]^d[u>>0])>>0]^d[y>>0])>>0]^d[C>>0])>>0]^d[G>>0])<<2)>>2];c[(c[l>>2]|0)+2048+(c[o>>2]<<2)>>2]=c[10416+((d[44786+(d[45042+(d[45042+(d[44274+(c[p>>2]|0)>>0]^d[v>>0])>>0]^d[z>>0])>>0]^d[D>>0])>>0]^d[H>>0])<<2)>>2];c[(c[l>>2]|0)+3072+(c[o>>2]<<2)>>2]=c[11440+((d[44786+(d[44786+(d[45042+(d[44274+(c[q>>2]|0)>>0]^d[w>>0])>>0]^d[A>>0])>>0]^d[E>>0])>>0]^d[I>>0])<<2)>>2];c[o>>2]=(c[o>>2]|0)+1;c[p>>2]=(c[p>>2]|0)+2;c[q>>2]=(c[q>>2]|0)+2}c[r>>2]=c[8368+((d[45042+(d[45042+(d[44786+(117^d[(c[m>>2]|0)+24>>0])>>0]^d[(c[m>>2]|0)+16>>0])>>0]^d[(c[m>>2]|0)+8>>0])>>0]^d[c[m>>2]>>0])<<2)>>2]^c[9392+((d[45042+(d[44786+(d[44786+(169^d[(c[m>>2]|0)+25>>0])>>0]^d[(c[m>>2]|0)+17>>0])>>0]^d[(c[m>>2]|0)+9>>0])>>0]^d[(c[m>>2]|0)+1>>0])<<2)>>2]^c[10416+((d[44786+(d[45042+(d[45042+(169^d[(c[m>>2]|0)+26>>0])>>0]^d[(c[m>>2]|0)+18>>0])>>0]^d[(c[m>>2]|0)+10>>0])>>0]^d[(c[m>>2]|0)+2>>0])<<2)>>2]^c[11440+((d[44786+(d[44786+(d[45042+(117^d[(c[m>>2]|0)+27>>0])>>0]^d[(c[m>>2]|0)+19>>0])>>0]^d[(c[m>>2]|0)+11>>0])>>0]^d[(c[m>>2]|0)+3>>0])<<2)>>2];c[s>>2]=c[8368+((d[45042+(d[45042+(d[44786+(243^d[(c[m>>2]|0)+28>>0])>>0]^d[(c[m>>2]|0)+20>>0])>>0]^d[(c[m>>2]|0)+12>>0])>>0]^d[(c[m>>2]|0)+4>>0])<<2)>>2]^c[9392+((d[45042+(d[44786+(d[44786+(103^d[(c[m>>2]|0)+29>>0])>>0]^d[(c[m>>2]|0)+21>>0])>>0]^d[(c[m>>2]|0)+13>>0])>>0]^d[(c[m>>2]|0)+5>>0])<<2)>>2]^c[10416+((d[44786+(d[45042+(d[45042+(103^d[(c[m>>2]|0)+30>>0])>>0]^d[(c[m>>2]|0)+22>>0])>>0]^d[(c[m>>2]|0)+14>>0])>>0]^d[(c[m>>2]|0)+6>>0])<<2)>>2]^c[11440+((d[44786+(d[44786+(d[45042+(243^d[(c[m>>2]|0)+31>>0])>>0]^d[(c[m>>2]|0)+23>>0])>>0]^d[(c[m>>2]|0)+15>>0])>>0]^d[(c[m>>2]|0)+7>>0])<<2)>>2];c[s>>2]=(c[s>>2]<<8)+((c[s>>2]|0)>>>24);c[r>>2]=(c[r>>2]|0)+(c[s>>2]|0);c[s>>2]=(c[s>>2]|0)+(c[r>>2]|0);c[(c[l>>2]|0)+4096>>2]=c[r>>2];c[(c[l>>2]|0)+4096+4>>2]=(c[s>>2]<<9)+((c[s>>2]|0)>>>23);c[r>>2]=c[8368+((d[45042+(d[45042+(d[44786+(198^d[(c[m>>2]|0)+24>>0])>>0]^d[(c[m>>2]|0)+16>>0])>>0]^d[(c[m>>2]|0)+8>>0])>>0]^d[c[m>>2]>>0])<<2)>>2]^c[9392+((d[45042+(d[44786+(d[44786+(179^d[(c[m>>2]|0)+25>>0])>>0]^d[(c[m>>2]|0)+17>>0])>>0]^d[(c[m>>2]|0)+9>>0])>>0]^d[(c[m>>2]|0)+1>>0])<<2)>>2]^c[10416+((d[44786+(d[45042+(d[45042+(179^d[(c[m>>2]|0)+26>>0])>>0]^d[(c[m>>2]|0)+18>>0])>>0]^d[(c[m>>2]|0)+10>>0])>>0]^d[(c[m>>2]|0)+2>>0])<<2)>>2]^c[11440+((d[44786+(d[44786+(d[45042+(198^d[(c[m>>2]|0)+27>>0])>>0]^d[(c[m>>2]|0)+19>>0])>>0]^d[(c[m>>2]|0)+11>>0])>>0]^d[(c[m>>2]|0)+3>>0])<<2)>>2];c[s>>2]=c[8368+((d[45042+(d[45042+(d[44786+(244^d[(c[m>>2]|0)+28>>0])>>0]^d[(c[m>>2]|0)+20>>0])>>0]^d[(c[m>>2]|0)+12>>0])>>0]^d[(c[m>>2]|0)+4>>0])<<2)>>2]^c[9392+((d[45042+(d[44786+(d[44786+(232^d[(c[m>>2]|0)+29>>0])>>0]^d[(c[m>>2]|0)+21>>0])>>0]^d[(c[m>>2]|0)+13>>0])>>0]^d[(c[m>>2]|0)+5>>0])<<2)>>2]^c[10416+((d[44786+(d[45042+(d[45042+(232^d[(c[m>>2]|0)+30>>0])>>0]^d[(c[m>>2]|0)+22>>0])>>0]^d[(c[m>>2]|0)+14>>0])>>0]^d[(c[m>>2]|0)+6>>0])<<2)>>2]^c[11440+((d[44786+(d[44786+(d[45042+(244^d[(c[m>>2]|0)+31>>0])>>0]^d[(c[m>>2]|0)+23>>0])>>0]^d[(c[m>>2]|0)+15>>0])>>0]^d[(c[m>>2]|0)+7>>0])<<2)>>2];c[s>>2]=(c[s>>2]<<8)+((c[s>>2]|0)>>>24);c[r>>2]=(c[r>>2]|0)+(c[s>>2]|0);c[s>>2]=(c[s>>2]|0)+(c[r>>2]|0);c[(c[l>>2]|0)+4096+8>>2]=c[r>>2];c[(c[l>>2]|0)+4096+12>>2]=(c[s>>2]<<9)+((c[s>>2]|0)>>>23);c[r>>2]=c[8368+((d[45042+(d[45042+(d[44786+(219^d[(c[m>>2]|0)+24>>0])>>0]^d[(c[m>>2]|0)+16>>0])>>0]^d[(c[m>>2]|0)+8>>0])>>0]^d[c[m>>2]>>0])<<2)>>2]^c[9392+((d[45042+(d[44786+(d[44786+(4^d[(c[m>>2]|0)+25>>0])>>0]^d[(c[m>>2]|0)+17>>0])>>0]^d[(c[m>>2]|0)+9>>0])>>0]^d[(c[m>>2]|0)+1>>0])<<2)>>2]^c[10416+((d[44786+(d[45042+(d[45042+(4^d[(c[m>>2]|0)+26>>0])>>0]^d[(c[m>>2]|0)+18>>0])>>0]^d[(c[m>>2]|0)+10>>0])>>0]^d[(c[m>>2]|0)+2>>0])<<2)>>2]^c[11440+((d[44786+(d[44786+(d[45042+(219^d[(c[m>>2]|0)+27>>0])>>0]^d[(c[m>>2]|0)+19>>0])>>0]^d[(c[m>>2]|0)+11>>0])>>0]^d[(c[m>>2]|0)+3>>0])<<2)>>2];c[s>>2]=c[8368+((d[45042+(d[45042+(d[44786+(123^d[(c[m>>2]|0)+28>>0])>>0]^d[(c[m>>2]|0)+20>>0])>>0]^d[(c[m>>2]|0)+12>>0])>>0]^d[(c[m>>2]|0)+4>>0])<<2)>>2]^c[9392+((d[45042+(d[44786+(d[44786+(253^d[(c[m>>2]|0)+29>>0])>>0]^d[(c[m>>2]|0)+21>>0])>>0]^d[(c[m>>2]|0)+13>>0])>>0]^d[(c[m>>2]|0)+5>>0])<<2)>>2]^c[10416+((d[44786+(d[45042+(d[45042+(253^d[(c[m>>2]|0)+30>>0])>>0]^d[(c[m>>2]|0)+22>>0])>>0]^d[(c[m>>2]|0)+14>>0])>>0]^d[(c[m>>2]|0)+6>>0])<<2)>>2]^c[11440+((d[44786+(d[44786+(d[45042+(123^d[(c[m>>2]|0)+31>>0])>>0]^d[(c[m>>2]|0)+23>>0])>>0]^d[(c[m>>2]|0)+15>>0])>>0]^d[(c[m>>2]|0)+7>>0])<<2)>>2];c[s>>2]=(c[s>>2]<<8)+((c[s>>2]|0)>>>24);c[r>>2]=(c[r>>2]|0)+(c[s>>2]|0);c[s>>2]=(c[s>>2]|0)+(c[r>>2]|0);c[(c[l>>2]|0)+4096+16>>2]=c[r>>2];c[(c[l>>2]|0)+4096+20>>2]=(c[s>>2]<<9)+((c[s>>2]|0)>>>23);c[r>>2]=c[8368+((d[45042+(d[45042+(d[44786+(251^d[(c[m>>2]|0)+24>>0])>>0]^d[(c[m>>2]|0)+16>>0])>>0]^d[(c[m>>2]|0)+8>>0])>>0]^d[c[m>>2]>>0])<<2)>>2]^c[9392+((d[45042+(d[44786+(d[44786+(163^d[(c[m>>2]|0)+25>>0])>>0]^d[(c[m>>2]|0)+17>>0])>>0]^d[(c[m>>2]|0)+9>>0])>>0]^d[(c[m>>2]|0)+1>>0])<<2)>>2]^c[10416+((d[44786+(d[45042+(d[45042+(163^d[(c[m>>2]|0)+26>>0])>>0]^d[(c[m>>2]|0)+18>>0])>>0]^d[(c[m>>2]|0)+10>>0])>>0]^d[(c[m>>2]|0)+2>>0])<<2)>>2]^c[11440+((d[44786+(d[44786+(d[45042+(251^d[(c[m>>2]|0)+27>>0])>>0]^d[(c[m>>2]|0)+19>>0])>>0]^d[(c[m>>2]|0)+11>>0])>>0]^d[(c[m>>2]|0)+3>>0])<<2)>>2];c[s>>2]=c[8368+((d[45042+(d[45042+(d[44786+(200^d[(c[m>>2]|0)+28>>0])>>0]^d[(c[m>>2]|0)+20>>0])>>0]^d[(c[m>>2]|0)+12>>0])>>0]^d[(c[m>>2]|0)+4>>0])<<2)>>2]^c[9392+((d[45042+(d[44786+(d[44786+(118^d[(c[m>>2]|0)+29>>0])>>0]^d[(c[m>>2]|0)+21>>0])>>0]^d[(c[m>>2]|0)+13>>0])>>0]^d[(c[m>>2]|0)+5>>0])<<2)>>2]^c[10416+((d[44786+(d[45042+(d[45042+(118^d[(c[m>>2]|0)+30>>0])>>0]^d[(c[m>>2]|0)+22>>0])>>0]^d[(c[m>>2]|0)+14>>0])>>0]^d[(c[m>>2]|0)+6>>0])<<2)>>2]^c[11440+((d[44786+(d[44786+(d[45042+(200^d[(c[m>>2]|0)+31>>0])>>0]^d[(c[m>>2]|0)+23>>0])>>0]^d[(c[m>>2]|0)+15>>0])>>0]^d[(c[m>>2]|0)+7>>0])<<2)>>2];c[s>>2]=(c[s>>2]<<8)+((c[s>>2]|0)>>>24);c[r>>2]=(c[r>>2]|0)+(c[s>>2]|0);c[s>>2]=(c[s>>2]|0)+(c[r>>2]|0);c[(c[l>>2]|0)+4096+24>>2]=c[r>>2];c[(c[l>>2]|0)+4096+28>>2]=(c[s>>2]<<9)+((c[s>>2]|0)>>>23);c[r>>2]=c[8368+((d[45042+(d[45042+(d[44786+(74^d[(c[m>>2]|0)+24>>0])>>0]^d[(c[m>>2]|0)+16>>0])>>0]^d[(c[m>>2]|0)+8>>0])>>0]^d[c[m>>2]>>0])<<2)>>2]^c[9392+((d[45042+(d[44786+(d[44786+(154^d[(c[m>>2]|0)+25>>0])>>0]^d[(c[m>>2]|0)+17>>0])>>0]^d[(c[m>>2]|0)+9>>0])>>0]^d[(c[m>>2]|0)+1>>0])<<2)>>2]^c[10416+((d[44786+(d[45042+(d[45042+(154^d[(c[m>>2]|0)+26>>0])>>0]^d[(c[m>>2]|0)+18>>0])>>0]^d[(c[m>>2]|0)+10>>0])>>0]^d[(c[m>>2]|0)+2>>0])<<2)>>2]^c[11440+((d[44786+(d[44786+(d[45042+(74^d[(c[m>>2]|0)+27>>0])>>0]^d[(c[m>>2]|0)+19>>0])>>0]^d[(c[m>>2]|0)+11>>0])>>0]^d[(c[m>>2]|0)+3>>0])<<2)>>2];c[s>>2]=c[8368+((d[45042+(d[45042+(d[44786+(211^d[(c[m>>2]|0)+28>>0])>>0]^d[(c[m>>2]|0)+20>>0])>>0]^d[(c[m>>2]|0)+12>>0])>>0]^d[(c[m>>2]|0)+4>>0])<<2)>>2]^c[9392+((d[45042+(d[44786+(d[44786+(146^d[(c[m>>2]|0)+29>>0])>>0]^d[(c[m>>2]|0)+21>>0])>>0]^d[(c[m>>2]|0)+13>>0])>>0]^d[(c[m>>2]|0)+5>>0])<<2)>>2]^c[10416+((d[44786+(d[45042+(d[45042+(146^d[(c[m>>2]|0)+30>>0])>>0]^d[(c[m>>2]|0)+22>>0])>>0]^d[(c[m>>2]|0)+14>>0])>>0]^d[(c[m>>2]|0)+6>>0])<<2)>>2]^c[11440+((d[44786+(d[44786+(d[45042+(211^d[(c[m>>2]|0)+31>>0])>>0]^d[(c[m>>2]|0)+23>>0])>>0]^d[(c[m>>2]|0)+15>>0])>>0]^d[(c[m>>2]|0)+7>>0])<<2)>>2];c[s>>2]=(c[s>>2]<<8)+((c[s>>2]|0)>>>24);c[r>>2]=(c[r>>2]|0)+(c[s>>2]|0);c[s>>2]=(c[s>>2]|0)+(c[r>>2]|0);c[(c[l>>2]|0)+4128>>2]=c[r>>2];c[(c[l>>2]|0)+4128+4>>2]=(c[s>>2]<<9)+((c[s>>2]|0)>>>23);c[r>>2]=c[8368+((d[45042+(d[45042+(d[44786+(230^d[(c[m>>2]|0)+24>>0])>>0]^d[(c[m>>2]|0)+16>>0])>>0]^d[(c[m>>2]|0)+8>>0])>>0]^d[c[m>>2]>>0])<<2)>>2]^c[9392+((d[45042+(d[44786+(d[44786+(128^d[(c[m>>2]|0)+25>>0])>>0]^d[(c[m>>2]|0)+17>>0])>>0]^d[(c[m>>2]|0)+9>>0])>>0]^d[(c[m>>2]|0)+1>>0])<<2)>>2]^c[10416+((d[44786+(d[45042+(d[45042+(128^d[(c[m>>2]|0)+26>>0])>>0]^d[(c[m>>2]|0)+18>>0])>>0]^d[(c[m>>2]|0)+10>>0])>>0]^d[(c[m>>2]|0)+2>>0])<<2)>>2]^c[11440+((d[44786+(d[44786+(d[45042+(230^d[(c[m>>2]|0)+27>>0])>>0]^d[(c[m>>2]|0)+19>>0])>>0]^d[(c[m>>2]|0)+11>>0])>>0]^d[(c[m>>2]|0)+3>>0])<<2)>>2];c[s>>2]=c[8368+((d[45042+(d[45042+(d[44786+(107^d[(c[m>>2]|0)+28>>0])>>0]^d[(c[m>>2]|0)+20>>0])>>0]^d[(c[m>>2]|0)+12>>0])>>0]^d[(c[m>>2]|0)+4>>0])<<2)>>2]^c[9392+((d[45042+(d[44786+(d[44786+(120^d[(c[m>>2]|0)+29>>0])>>0]^d[(c[m>>2]|0)+21>>0])>>0]^d[(c[m>>2]|0)+13>>0])>>0]^d[(c[m>>2]|0)+5>>0])<<2)>>2]^c[10416+((d[44786+(d[45042+(d[45042+(120^d[(c[m>>2]|0)+30>>0])>>0]^d[(c[m>>2]|0)+22>>0])>>0]^d[(c[m>>2]|0)+14>>0])>>0]^d[(c[m>>2]|0)+6>>0])<<2)>>2]^c[11440+((d[44786+(d[44786+(d[45042+(107^d[(c[m>>2]|0)+31>>0])>>0]^d[(c[m>>2]|0)+23>>0])>>0]^d[(c[m>>2]|0)+15>>0])>>0]^d[(c[m>>2]|0)+7>>0])<<2)>>2];c[s>>2]=(c[s>>2]<<8)+((c[s>>2]|0)>>>24);c[r>>2]=(c[r>>2]|0)+(c[s>>2]|0);c[s>>2]=(c[s>>2]|0)+(c[r>>2]|0);c[(c[l>>2]|0)+4128+8>>2]=c[r>>2];c[(c[l>>2]|0)+4128+12>>2]=(c[s>>2]<<9)+((c[s>>2]|0)>>>23);c[r>>2]=c[8368+((d[45042+(d[45042+(d[44786+(69^d[(c[m>>2]|0)+24>>0])>>0]^d[(c[m>>2]|0)+16>>0])>>0]^d[(c[m>>2]|0)+8>>0])>>0]^d[c[m>>2]>>0])<<2)>>2]^c[9392+((d[45042+(d[44786+(d[44786+(228^d[(c[m>>2]|0)+25>>0])>>0]^d[(c[m>>2]|0)+17>>0])>>0]^d[(c[m>>2]|0)+9>>0])>>0]^d[(c[m>>2]|0)+1>>0])<<2)>>2]^c[10416+((d[44786+(d[45042+(d[45042+(228^d[(c[m>>2]|0)+26>>0])>>0]^d[(c[m>>2]|0)+18>>0])>>0]^d[(c[m>>2]|0)+10>>0])>>0]^d[(c[m>>2]|0)+2>>0])<<2)>>2]^c[11440+((d[44786+(d[44786+(d[45042+(69^d[(c[m>>2]|0)+27>>0])>>0]^d[(c[m>>2]|0)+19>>0])>>0]^d[(c[m>>2]|0)+11>>0])>>0]^d[(c[m>>2]|0)+3>>0])<<2)>>2];c[s>>2]=c[8368+((d[45042+(d[45042+(d[44786+(125^d[(c[m>>2]|0)+28>>0])>>0]^d[(c[m>>2]|0)+20>>0])>>0]^d[(c[m>>2]|0)+12>>0])>>0]^d[(c[m>>2]|0)+4>>0])<<2)>>2]^c[9392+((d[45042+(d[44786+(d[44786+(221^d[(c[m>>2]|0)+29>>0])>>0]^d[(c[m>>2]|0)+21>>0])>>0]^d[(c[m>>2]|0)+13>>0])>>0]^d[(c[m>>2]|0)+5>>0])<<2)>>2]^c[10416+((d[44786+(d[45042+(d[45042+(221^d[(c[m>>2]|0)+30>>0])>>0]^d[(c[m>>2]|0)+22>>0])>>0]^d[(c[m>>2]|0)+14>>0])>>0]^d[(c[m>>2]|0)+6>>0])<<2)>>2]^c[11440+((d[44786+(d[44786+(d[45042+(125^d[(c[m>>2]|0)+31>>0])>>0]^d[(c[m>>2]|0)+23>>0])>>0]^d[(c[m>>2]|0)+15>>0])>>0]^d[(c[m>>2]|0)+7>>0])<<2)>>2];c[s>>2]=(c[s>>2]<<8)+((c[s>>2]|0)>>>24);c[r>>2]=(c[r>>2]|0)+(c[s>>2]|0);c[s>>2]=(c[s>>2]|0)+(c[r>>2]|0);c[(c[l>>2]|0)+4128+16>>2]=c[r>>2];c[(c[l>>2]|0)+4128+20>>2]=(c[s>>2]<<9)+((c[s>>2]|0)>>>23);c[r>>2]=c[8368+((d[45042+(d[45042+(d[44786+(232^d[(c[m>>2]|0)+24>>0])>>0]^d[(c[m>>2]|0)+16>>0])>>0]^d[(c[m>>2]|0)+8>>0])>>0]^d[c[m>>2]>>0])<<2)>>2]^c[9392+((d[45042+(d[44786+(d[44786+(209^d[(c[m>>2]|0)+25>>0])>>0]^d[(c[m>>2]|0)+17>>0])>>0]^d[(c[m>>2]|0)+9>>0])>>0]^d[(c[m>>2]|0)+1>>0])<<2)>>2]^c[10416+((d[44786+(d[45042+(d[45042+(209^d[(c[m>>2]|0)+26>>0])>>0]^d[(c[m>>2]|0)+18>>0])>>0]^d[(c[m>>2]|0)+10>>0])>>0]^d[(c[m>>2]|0)+2>>0])<<2)>>2]^c[11440+((d[44786+(d[44786+(d[45042+(232^d[(c[m>>2]|0)+27>>0])>>0]^d[(c[m>>2]|0)+19>>0])>>0]^d[(c[m>>2]|0)+11>>0])>>0]^d[(c[m>>2]|0)+3>>0])<<2)>>2];c[s>>2]=c[8368+((d[45042+(d[45042+(d[44786+(75^d[(c[m>>2]|0)+28>>0])>>0]^d[(c[m>>2]|0)+20>>0])>>0]^d[(c[m>>2]|0)+12>>0])>>0]^d[(c[m>>2]|0)+4>>0])<<2)>>2]^c[9392+((d[45042+(d[44786+(d[44786+(56^d[(c[m>>2]|0)+29>>0])>>0]^d[(c[m>>2]|0)+21>>0])>>0]^d[(c[m>>2]|0)+13>>0])>>0]^d[(c[m>>2]|0)+5>>0])<<2)>>2]^c[10416+((d[44786+(d[45042+(d[45042+(56^d[(c[m>>2]|0)+30>>0])>>0]^d[(c[m>>2]|0)+22>>0])>>0]^d[(c[m>>2]|0)+14>>0])>>0]^d[(c[m>>2]|0)+6>>0])<<2)>>2]^c[11440+((d[44786+(d[44786+(d[45042+(75^d[(c[m>>2]|0)+31>>0])>>0]^d[(c[m>>2]|0)+23>>0])>>0]^d[(c[m>>2]|0)+15>>0])>>0]^d[(c[m>>2]|0)+7>>0])<<2)>>2];c[s>>2]=(c[s>>2]<<8)+((c[s>>2]|0)>>>24);c[r>>2]=(c[r>>2]|0)+(c[s>>2]|0);c[s>>2]=(c[s>>2]|0)+(c[r>>2]|0);c[(c[l>>2]|0)+4128+24>>2]=c[r>>2];c[(c[l>>2]|0)+4128+28>>2]=(c[s>>2]<<9)+((c[s>>2]|0)>>>23);c[r>>2]=c[8368+((d[45042+(d[45042+(d[44786+(214^d[(c[m>>2]|0)+24>>0])>>0]^d[(c[m>>2]|0)+16>>0])>>0]^d[(c[m>>2]|0)+8>>0])>>0]^d[c[m>>2]>>0])<<2)>>2]^c[9392+((d[45042+(d[44786+(d[44786+(13^d[(c[m>>2]|0)+25>>0])>>0]^d[(c[m>>2]|0)+17>>0])>>0]^d[(c[m>>2]|0)+9>>0])>>0]^d[(c[m>>2]|0)+1>>0])<<2)>>2]^c[10416+((d[44786+(d[45042+(d[45042+(13^d[(c[m>>2]|0)+26>>0])>>0]^d[(c[m>>2]|0)+18>>0])>>0]^d[(c[m>>2]|0)+10>>0])>>0]^d[(c[m>>2]|0)+2>>0])<<2)>>2]^c[11440+((d[44786+(d[44786+(d[45042+(214^d[(c[m>>2]|0)+27>>0])>>0]^d[(c[m>>2]|0)+19>>0])>>0]^d[(c[m>>2]|0)+11>>0])>>0]^d[(c[m>>2]|0)+3>>0])<<2)>>2];c[s>>2]=c[8368+((d[45042+(d[45042+(d[44786+(50^d[(c[m>>2]|0)+28>>0])>>0]^d[(c[m>>2]|0)+20>>0])>>0]^d[(c[m>>2]|0)+12>>0])>>0]^d[(c[m>>2]|0)+4>>0])<<2)>>2]^c[9392+((d[45042+(d[44786+(d[44786+(198^d[(c[m>>2]|0)+29>>0])>>0]^d[(c[m>>2]|0)+21>>0])>>0]^d[(c[m>>2]|0)+13>>0])>>0]^d[(c[m>>2]|0)+5>>0])<<2)>>2]^c[10416+((d[44786+(d[45042+(d[45042+(198^d[(c[m>>2]|0)+30>>0])>>0]^d[(c[m>>2]|0)+22>>0])>>0]^d[(c[m>>2]|0)+14>>0])>>0]^d[(c[m>>2]|0)+6>>0])<<2)>>2]^c[11440+((d[44786+(d[44786+(d[45042+(50^d[(c[m>>2]|0)+31>>0])>>0]^d[(c[m>>2]|0)+23>>0])>>0]^d[(c[m>>2]|0)+15>>0])>>0]^d[(c[m>>2]|0)+7>>0])<<2)>>2];c[s>>2]=(c[s>>2]<<8)+((c[s>>2]|0)>>>24);c[r>>2]=(c[r>>2]|0)+(c[s>>2]|0);c[s>>2]=(c[s>>2]|0)+(c[r>>2]|0);c[(c[l>>2]|0)+4128+32>>2]=c[r>>2];c[(c[l>>2]|0)+4128+36>>2]=(c[s>>2]<<9)+((c[s>>2]|0)>>>23);c[r>>2]=c[8368+((d[45042+(d[45042+(d[44786+(216^d[(c[m>>2]|0)+24>>0])>>0]^d[(c[m>>2]|0)+16>>0])>>0]^d[(c[m>>2]|0)+8>>0])>>0]^d[c[m>>2]>>0])<<2)>>2]^c[9392+((d[45042+(d[44786+(d[44786+(53^d[(c[m>>2]|0)+25>>0])>>0]^d[(c[m>>2]|0)+17>>0])>>0]^d[(c[m>>2]|0)+9>>0])>>0]^d[(c[m>>2]|0)+1>>0])<<2)>>2]^c[10416+((d[44786+(d[45042+(d[45042+(53^d[(c[m>>2]|0)+26>>0])>>0]^d[(c[m>>2]|0)+18>>0])>>0]^d[(c[m>>2]|0)+10>>0])>>0]^d[(c[m>>2]|0)+2>>0])<<2)>>2]^c[11440+((d[44786+(d[44786+(d[45042+(216^d[(c[m>>2]|0)+27>>0])>>0]^d[(c[m>>2]|0)+19>>0])>>0]^d[(c[m>>2]|0)+11>>0])>>0]^d[(c[m>>2]|0)+3>>0])<<2)>>2];c[s>>2]=c[8368+((d[45042+(d[45042+(d[44786+(253^d[(c[m>>2]|0)+28>>0])>>0]^d[(c[m>>2]|0)+20>>0])>>0]^d[(c[m>>2]|0)+12>>0])>>0]^d[(c[m>>2]|0)+4>>0])<<2)>>2]^c[9392+((d[45042+(d[44786+(d[44786+(152^d[(c[m>>2]|0)+29>>0])>>0]^d[(c[m>>2]|0)+21>>0])>>0]^d[(c[m>>2]|0)+13>>0])>>0]^d[(c[m>>2]|0)+5>>0])<<2)>>2]^c[10416+((d[44786+(d[45042+(d[45042+(152^d[(c[m>>2]|0)+30>>0])>>0]^d[(c[m>>2]|0)+22>>0])>>0]^d[(c[m>>2]|0)+14>>0])>>0]^d[(c[m>>2]|0)+6>>0])<<2)>>2]^c[11440+((d[44786+(d[44786+(d[45042+(253^d[(c[m>>2]|0)+31>>0])>>0]^d[(c[m>>2]|0)+23>>0])>>0]^d[(c[m>>2]|0)+15>>0])>>0]^d[(c[m>>2]|0)+7>>0])<<2)>>2];c[s>>2]=(c[s>>2]<<8)+((c[s>>2]|0)>>>24);c[r>>2]=(c[r>>2]|0)+(c[s>>2]|0);c[s>>2]=(c[s>>2]|0)+(c[r>>2]|0);c[(c[l>>2]|0)+4128+40>>2]=c[r>>2];c[(c[l>>2]|0)+4128+44>>2]=(c[s>>2]<<9)+((c[s>>2]|0)>>>23);c[r>>2]=c[8368+((d[45042+(d[45042+(d[44786+(55^d[(c[m>>2]|0)+24>>0])>>0]^d[(c[m>>2]|0)+16>>0])>>0]^d[(c[m>>2]|0)+8>>0])>>0]^d[c[m>>2]>>0])<<2)>>2]^c[9392+((d[45042+(d[44786+(d[44786+(24^d[(c[m>>2]|0)+25>>0])>>0]^d[(c[m>>2]|0)+17>>0])>>0]^d[(c[m>>2]|0)+9>>0])>>0]^d[(c[m>>2]|0)+1>>0])<<2)>>2]^c[10416+((d[44786+(d[45042+(d[45042+(24^d[(c[m>>2]|0)+26>>0])>>0]^d[(c[m>>2]|0)+18>>0])>>0]^d[(c[m>>2]|0)+10>>0])>>0]^d[(c[m>>2]|0)+2>>0])<<2)>>2]^c[11440+((d[44786+(d[44786+(d[45042+(55^d[(c[m>>2]|0)+27>>0])>>0]^d[(c[m>>2]|0)+19>>0])>>0]^d[(c[m>>2]|0)+11>>0])>>0]^d[(c[m>>2]|0)+3>>0])<<2)>>2];c[s>>2]=c[8368+((d[45042+(d[45042+(d[44786+(113^d[(c[m>>2]|0)+28>>0])>>0]^d[(c[m>>2]|0)+20>>0])>>0]^d[(c[m>>2]|0)+12>>0])>>0]^d[(c[m>>2]|0)+4>>0])<<2)>>2]^c[9392+((d[45042+(d[44786+(d[44786+(247^d[(c[m>>2]|0)+29>>0])>>0]^d[(c[m>>2]|0)+21>>0])>>0]^d[(c[m>>2]|0)+13>>0])>>0]^d[(c[m>>2]|0)+5>>0])<<2)>>2]^c[10416+((d[44786+(d[45042+(d[45042+(247^d[(c[m>>2]|0)+30>>0])>>0]^d[(c[m>>2]|0)+22>>0])>>0]^d[(c[m>>2]|0)+14>>0])>>0]^d[(c[m>>2]|0)+6>>0])<<2)>>2]^c[11440+((d[44786+(d[44786+(d[45042+(113^d[(c[m>>2]|0)+31>>0])>>0]^d[(c[m>>2]|0)+23>>0])>>0]^d[(c[m>>2]|0)+15>>0])>>0]^d[(c[m>>2]|0)+7>>0])<<2)>>2];c[s>>2]=(c[s>>2]<<8)+((c[s>>2]|0)>>>24);c[r>>2]=(c[r>>2]|0)+(c[s>>2]|0);c[s>>2]=(c[s>>2]|0)+(c[r>>2]|0);c[(c[l>>2]|0)+4128+48>>2]=c[r>>2];c[(c[l>>2]|0)+4128+52>>2]=(c[s>>2]<<9)+((c[s>>2]|0)>>>23);c[r>>2]=c[8368+((d[45042+(d[45042+(d[44786+(241^d[(c[m>>2]|0)+24>>0])>>0]^d[(c[m>>2]|0)+16>>0])>>0]^d[(c[m>>2]|0)+8>>0])>>0]^d[c[m>>2]>>0])<<2)>>2]^c[9392+((d[45042+(d[44786+(d[44786+(236^d[(c[m>>2]|0)+25>>0])>>0]^d[(c[m>>2]|0)+17>>0])>>0]^d[(c[m>>2]|0)+9>>0])>>0]^d[(c[m>>2]|0)+1>>0])<<2)>>2]^c[10416+((d[44786+(d[45042+(d[45042+(236^d[(c[m>>2]|0)+26>>0])>>0]^d[(c[m>>2]|0)+18>>0])>>0]^d[(c[m>>2]|0)+10>>0])>>0]^d[(c[m>>2]|0)+2>>0])<<2)>>2]^c[11440+((d[44786+(d[44786+(d[45042+(241^d[(c[m>>2]|0)+27>>0])>>0]^d[(c[m>>2]|0)+19>>0])>>0]^d[(c[m>>2]|0)+11>>0])>>0]^d[(c[m>>2]|0)+3>>0])<<2)>>2];c[s>>2]=c[8368+((d[45042+(d[45042+(d[44786+(225^d[(c[m>>2]|0)+28>>0])>>0]^d[(c[m>>2]|0)+20>>0])>>0]^d[(c[m>>2]|0)+12>>0])>>0]^d[(c[m>>2]|0)+4>>0])<<2)>>2]^c[9392+((d[45042+(d[44786+(d[44786+(108^d[(c[m>>2]|0)+29>>0])>>0]^d[(c[m>>2]|0)+21>>0])>>0]^d[(c[m>>2]|0)+13>>0])>>0]^d[(c[m>>2]|0)+5>>0])<<2)>>2]^c[10416+((d[44786+(d[45042+(d[45042+(108^d[(c[m>>2]|0)+30>>0])>>0]^d[(c[m>>2]|0)+22>>0])>>0]^d[(c[m>>2]|0)+14>>0])>>0]^d[(c[m>>2]|0)+6>>0])<<2)>>2]^c[11440+((d[44786+(d[44786+(d[45042+(225^d[(c[m>>2]|0)+31>>0])>>0]^d[(c[m>>2]|0)+23>>0])>>0]^d[(c[m>>2]|0)+15>>0])>>0]^d[(c[m>>2]|0)+7>>0])<<2)>>2];c[s>>2]=(c[s>>2]<<8)+((c[s>>2]|0)>>>24);c[r>>2]=(c[r>>2]|0)+(c[s>>2]|0);c[s>>2]=(c[s>>2]|0)+(c[r>>2]|0);c[(c[l>>2]|0)+4128+56>>2]=c[r>>2];c[(c[l>>2]|0)+4128+60>>2]=(c[s>>2]<<9)+((c[s>>2]|0)>>>23);c[r>>2]=c[8368+((d[45042+(d[45042+(d[44786+(48^d[(c[m>>2]|0)+24>>0])>>0]^d[(c[m>>2]|0)+16>>0])>>0]^d[(c[m>>2]|0)+8>>0])>>0]^d[c[m>>2]>>0])<<2)>>2]^c[9392+((d[45042+(d[44786+(d[44786+(67^d[(c[m>>2]|0)+25>>0])>>0]^d[(c[m>>2]|0)+17>>0])>>0]^d[(c[m>>2]|0)+9>>0])>>0]^d[(c[m>>2]|0)+1>>0])<<2)>>2]^c[10416+((d[44786+(d[45042+(d[45042+(67^d[(c[m>>2]|0)+26>>0])>>0]^d[(c[m>>2]|0)+18>>0])>>0]^d[(c[m>>2]|0)+10>>0])>>0]^d[(c[m>>2]|0)+2>>0])<<2)>>2]^c[11440+((d[44786+(d[44786+(d[45042+(48^d[(c[m>>2]|0)+27>>0])>>0]^d[(c[m>>2]|0)+19>>0])>>0]^d[(c[m>>2]|0)+11>>0])>>0]^d[(c[m>>2]|0)+3>>0])<<2)>>2];c[s>>2]=c[8368+((d[45042+(d[45042+(d[44786+(15^d[(c[m>>2]|0)+28>>0])>>0]^d[(c[m>>2]|0)+20>>0])>>0]^d[(c[m>>2]|0)+12>>0])>>0]^d[(c[m>>2]|0)+4>>0])<<2)>>2]^c[9392+((d[45042+(d[44786+(d[44786+(117^d[(c[m>>2]|0)+29>>0])>>0]^d[(c[m>>2]|0)+21>>0])>>0]^d[(c[m>>2]|0)+13>>0])>>0]^d[(c[m>>2]|0)+5>>0])<<2)>>2]^c[10416+((d[44786+(d[45042+(d[45042+(117^d[(c[m>>2]|0)+30>>0])>>0]^d[(c[m>>2]|0)+22>>0])>>0]^d[(c[m>>2]|0)+14>>0])>>0]^d[(c[m>>2]|0)+6>>0])<<2)>>2]^c[11440+((d[44786+(d[44786+(d[45042+(15^d[(c[m>>2]|0)+31>>0])>>0]^d[(c[m>>2]|0)+23>>0])>>0]^d[(c[m>>2]|0)+15>>0])>>0]^d[(c[m>>2]|0)+7>>0])<<2)>>2];c[s>>2]=(c[s>>2]<<8)+((c[s>>2]|0)>>>24);c[r>>2]=(c[r>>2]|0)+(c[s>>2]|0);c[s>>2]=(c[s>>2]|0)+(c[r>>2]|0);c[(c[l>>2]|0)+4128+64>>2]=c[r>>2];c[(c[l>>2]|0)+4128+68>>2]=(c[s>>2]<<9)+((c[s>>2]|0)>>>23);c[r>>2]=c[8368+((d[45042+(d[45042+(d[44786+(248^d[(c[m>>2]|0)+24>>0])>>0]^d[(c[m>>2]|0)+16>>0])>>0]^d[(c[m>>2]|0)+8>>0])>>0]^d[c[m>>2]>>0])<<2)>>2]^c[9392+((d[45042+(d[44786+(d[44786+(55^d[(c[m>>2]|0)+25>>0])>>0]^d[(c[m>>2]|0)+17>>0])>>0]^d[(c[m>>2]|0)+9>>0])>>0]^d[(c[m>>2]|0)+1>>0])<<2)>>2]^c[10416+((d[44786+(d[45042+(d[45042+(55^d[(c[m>>2]|0)+26>>0])>>0]^d[(c[m>>2]|0)+18>>0])>>0]^d[(c[m>>2]|0)+10>>0])>>0]^d[(c[m>>2]|0)+2>>0])<<2)>>2]^c[11440+((d[44786+(d[44786+(d[45042+(248^d[(c[m>>2]|0)+27>>0])>>0]^d[(c[m>>2]|0)+19>>0])>>0]^d[(c[m>>2]|0)+11>>0])>>0]^d[(c[m>>2]|0)+3>>0])<<2)>>2];c[s>>2]=c[8368+((d[45042+(d[45042+(d[44786+(27^d[(c[m>>2]|0)+28>>0])>>0]^d[(c[m>>2]|0)+20>>0])>>0]^d[(c[m>>2]|0)+12>>0])>>0]^d[(c[m>>2]|0)+4>>0])<<2)>>2]^c[9392+((d[45042+(d[44786+(d[44786+(38^d[(c[m>>2]|0)+29>>0])>>0]^d[(c[m>>2]|0)+21>>0])>>0]^d[(c[m>>2]|0)+13>>0])>>0]^d[(c[m>>2]|0)+5>>0])<<2)>>2]^c[10416+((d[44786+(d[45042+(d[45042+(38^d[(c[m>>2]|0)+30>>0])>>0]^d[(c[m>>2]|0)+22>>0])>>0]^d[(c[m>>2]|0)+14>>0])>>0]^d[(c[m>>2]|0)+6>>0])<<2)>>2]^c[11440+((d[44786+(d[44786+(d[45042+(27^d[(c[m>>2]|0)+31>>0])>>0]^d[(c[m>>2]|0)+23>>0])>>0]^d[(c[m>>2]|0)+15>>0])>>0]^d[(c[m>>2]|0)+7>>0])<<2)>>2];c[s>>2]=(c[s>>2]<<8)+((c[s>>2]|0)>>>24);c[r>>2]=(c[r>>2]|0)+(c[s>>2]|0);c[s>>2]=(c[s>>2]|0)+(c[r>>2]|0);c[(c[l>>2]|0)+4128+72>>2]=c[r>>2];c[(c[l>>2]|0)+4128+76>>2]=(c[s>>2]<<9)+((c[s>>2]|0)>>>23);c[r>>2]=c[8368+((d[45042+(d[45042+(d[44786+(135^d[(c[m>>2]|0)+24>>0])>>0]^d[(c[m>>2]|0)+16>>0])>>0]^d[(c[m>>2]|0)+8>>0])>>0]^d[c[m>>2]>>0])<<2)>>2]^c[9392+((d[45042+(d[44786+(d[44786+(250^d[(c[m>>2]|0)+25>>0])>>0]^d[(c[m>>2]|0)+17>>0])>>0]^d[(c[m>>2]|0)+9>>0])>>0]^d[(c[m>>2]|0)+1>>0])<<2)>>2]^c[10416+((d[44786+(d[45042+(d[45042+(250^d[(c[m>>2]|0)+26>>0])>>0]^d[(c[m>>2]|0)+18>>0])>>0]^d[(c[m>>2]|0)+10>>0])>>0]^d[(c[m>>2]|0)+2>>0])<<2)>>2]^c[11440+((d[44786+(d[44786+(d[45042+(135^d[(c[m>>2]|0)+27>>0])>>0]^d[(c[m>>2]|0)+19>>0])>>0]^d[(c[m>>2]|0)+11>>0])>>0]^d[(c[m>>2]|0)+3>>0])<<2)>>2];c[s>>2]=c[8368+((d[45042+(d[45042+(d[44786+(250^d[(c[m>>2]|0)+28>>0])>>0]^d[(c[m>>2]|0)+20>>0])>>0]^d[(c[m>>2]|0)+12>>0])>>0]^d[(c[m>>2]|0)+4>>0])<<2)>>2]^c[9392+((d[45042+(d[44786+(d[44786+(19^d[(c[m>>2]|0)+29>>0])>>0]^d[(c[m>>2]|0)+21>>0])>>0]^d[(c[m>>2]|0)+13>>0])>>0]^d[(c[m>>2]|0)+5>>0])<<2)>>2]^c[10416+((d[44786+(d[45042+(d[45042+(19^d[(c[m>>2]|0)+30>>0])>>0]^d[(c[m>>2]|0)+22>>0])>>0]^d[(c[m>>2]|0)+14>>0])>>0]^d[(c[m>>2]|0)+6>>0])<<2)>>2]^c[11440+((d[44786+(d[44786+(d[45042+(250^d[(c[m>>2]|0)+31>>0])>>0]^d[(c[m>>2]|0)+23>>0])>>0]^d[(c[m>>2]|0)+15>>0])>>0]^d[(c[m>>2]|0)+7>>0])<<2)>>2];c[s>>2]=(c[s>>2]<<8)+((c[s>>2]|0)>>>24);c[r>>2]=(c[r>>2]|0)+(c[s>>2]|0);c[s>>2]=(c[s>>2]|0)+(c[r>>2]|0);c[(c[l>>2]|0)+4128+80>>2]=c[r>>2];c[(c[l>>2]|0)+4128+84>>2]=(c[s>>2]<<9)+((c[s>>2]|0)>>>23);c[r>>2]=c[8368+((d[45042+(d[45042+(d[44786+(6^d[(c[m>>2]|0)+24>>0])>>0]^d[(c[m>>2]|0)+16>>0])>>0]^d[(c[m>>2]|0)+8>>0])>>0]^d[c[m>>2]>>0])<<2)>>2]^c[9392+((d[45042+(d[44786+(d[44786+(148^d[(c[m>>2]|0)+25>>0])>>0]^d[(c[m>>2]|0)+17>>0])>>0]^d[(c[m>>2]|0)+9>>0])>>0]^d[(c[m>>2]|0)+1>>0])<<2)>>2]^c[10416+((d[44786+(d[45042+(d[45042+(148^d[(c[m>>2]|0)+26>>0])>>0]^d[(c[m>>2]|0)+18>>0])>>0]^d[(c[m>>2]|0)+10>>0])>>0]^d[(c[m>>2]|0)+2>>0])<<2)>>2]^c[11440+((d[44786+(d[44786+(d[45042+(6^d[(c[m>>2]|0)+27>>0])>>0]^d[(c[m>>2]|0)+19>>0])>>0]^d[(c[m>>2]|0)+11>>0])>>0]^d[(c[m>>2]|0)+3>>0])<<2)>>2];c[s>>2]=c[8368+((d[45042+(d[45042+(d[44786+(63^d[(c[m>>2]|0)+28>>0])>>0]^d[(c[m>>2]|0)+20>>0])>>0]^d[(c[m>>2]|0)+12>>0])>>0]^d[(c[m>>2]|0)+4>>0])<<2)>>2]^c[9392+((d[45042+(d[44786+(d[44786+(72^d[(c[m>>2]|0)+29>>0])>>0]^d[(c[m>>2]|0)+21>>0])>>0]^d[(c[m>>2]|0)+13>>0])>>0]^d[(c[m>>2]|0)+5>>0])<<2)>>2]^c[10416+((d[44786+(d[45042+(d[45042+(72^d[(c[m>>2]|0)+30>>0])>>0]^d[(c[m>>2]|0)+22>>0])>>0]^d[(c[m>>2]|0)+14>>0])>>0]^d[(c[m>>2]|0)+6>>0])<<2)>>2]^c[11440+((d[44786+(d[44786+(d[45042+(63^d[(c[m>>2]|0)+31>>0])>>0]^d[(c[m>>2]|0)+23>>0])>>0]^d[(c[m>>2]|0)+15>>0])>>0]^d[(c[m>>2]|0)+7>>0])<<2)>>2];c[s>>2]=(c[s>>2]<<8)+((c[s>>2]|0)>>>24);c[r>>2]=(c[r>>2]|0)+(c[s>>2]|0);c[s>>2]=(c[s>>2]|0)+(c[r>>2]|0);c[(c[l>>2]|0)+4128+88>>2]=c[r>>2];c[(c[l>>2]|0)+4128+92>>2]=(c[s>>2]<<9)+((c[s>>2]|0)>>>23);c[r>>2]=c[8368+((d[45042+(d[45042+(d[44786+(94^d[(c[m>>2]|0)+24>>0])>>0]^d[(c[m>>2]|0)+16>>0])>>0]^d[(c[m>>2]|0)+8>>0])>>0]^d[c[m>>2]>>0])<<2)>>2]^c[9392+((d[45042+(d[44786+(d[44786+(242^d[(c[m>>2]|0)+25>>0])>>0]^d[(c[m>>2]|0)+17>>0])>>0]^d[(c[m>>2]|0)+9>>0])>>0]^d[(c[m>>2]|0)+1>>0])<<2)>>2]^c[10416+((d[44786+(d[45042+(d[45042+(242^d[(c[m>>2]|0)+26>>0])>>0]^d[(c[m>>2]|0)+18>>0])>>0]^d[(c[m>>2]|0)+10>>0])>>0]^d[(c[m>>2]|0)+2>>0])<<2)>>2]^c[11440+((d[44786+(d[44786+(d[45042+(94^d[(c[m>>2]|0)+27>>0])>>0]^d[(c[m>>2]|0)+19>>0])>>0]^d[(c[m>>2]|0)+11>>0])>>0]^d[(c[m>>2]|0)+3>>0])<<2)>>2];c[s>>2]=c[8368+((d[45042+(d[45042+(d[44786+(186^d[(c[m>>2]|0)+28>>0])>>0]^d[(c[m>>2]|0)+20>>0])>>0]^d[(c[m>>2]|0)+12>>0])>>0]^d[(c[m>>2]|0)+4>>0])<<2)>>2]^c[9392+((d[45042+(d[44786+(d[44786+(208^d[(c[m>>2]|0)+29>>0])>>0]^d[(c[m>>2]|0)+21>>0])>>0]^d[(c[m>>2]|0)+13>>0])>>0]^d[(c[m>>2]|0)+5>>0])<<2)>>2]^c[10416+((d[44786+(d[45042+(d[45042+(208^d[(c[m>>2]|0)+30>>0])>>0]^d[(c[m>>2]|0)+22>>0])>>0]^d[(c[m>>2]|0)+14>>0])>>0]^d[(c[m>>2]|0)+6>>0])<<2)>>2]^c[11440+((d[44786+(d[44786+(d[45042+(186^d[(c[m>>2]|0)+31>>0])>>0]^d[(c[m>>2]|0)+23>>0])>>0]^d[(c[m>>2]|0)+15>>0])>>0]^d[(c[m>>2]|0)+7>>0])<<2)>>2];c[s>>2]=(c[s>>2]<<8)+((c[s>>2]|0)>>>24);c[r>>2]=(c[r>>2]|0)+(c[s>>2]|0);c[s>>2]=(c[s>>2]|0)+(c[r>>2]|0);c[(c[l>>2]|0)+4128+96>>2]=c[r>>2];c[(c[l>>2]|0)+4128+100>>2]=(c[s>>2]<<9)+((c[s>>2]|0)>>>23);c[r>>2]=c[8368+((d[45042+(d[45042+(d[44786+(174^d[(c[m>>2]|0)+24>>0])>>0]^d[(c[m>>2]|0)+16>>0])>>0]^d[(c[m>>2]|0)+8>>0])>>0]^d[c[m>>2]>>0])<<2)>>2]^c[9392+((d[45042+(d[44786+(d[44786+(139^d[(c[m>>2]|0)+25>>0])>>0]^d[(c[m>>2]|0)+17>>0])>>0]^d[(c[m>>2]|0)+9>>0])>>0]^d[(c[m>>2]|0)+1>>0])<<2)>>2]^c[10416+((d[44786+(d[45042+(d[45042+(139^d[(c[m>>2]|0)+26>>0])>>0]^d[(c[m>>2]|0)+18>>0])>>0]^d[(c[m>>2]|0)+10>>0])>>0]^d[(c[m>>2]|0)+2>>0])<<2)>>2]^c[11440+((d[44786+(d[44786+(d[45042+(174^d[(c[m>>2]|0)+27>>0])>>0]^d[(c[m>>2]|0)+19>>0])>>0]^d[(c[m>>2]|0)+11>>0])>>0]^d[(c[m>>2]|0)+3>>0])<<2)>>2];c[s>>2]=c[8368+((d[45042+(d[45042+(d[44786+(91^d[(c[m>>2]|0)+28>>0])>>0]^d[(c[m>>2]|0)+20>>0])>>0]^d[(c[m>>2]|0)+12>>0])>>0]^d[(c[m>>2]|0)+4>>0])<<2)>>2]^c[9392+((d[45042+(d[44786+(d[44786+(48^d[(c[m>>2]|0)+29>>0])>>0]^d[(c[m>>2]|0)+21>>0])>>0]^d[(c[m>>2]|0)+13>>0])>>0]^d[(c[m>>2]|0)+5>>0])<<2)>>2]^c[10416+((d[44786+(d[45042+(d[45042+(48^d[(c[m>>2]|0)+30>>0])>>0]^d[(c[m>>2]|0)+22>>0])>>0]^d[(c[m>>2]|0)+14>>0])>>0]^d[(c[m>>2]|0)+6>>0])<<2)>>2]^c[11440+((d[44786+(d[44786+(d[45042+(91^d[(c[m>>2]|0)+31>>0])>>0]^d[(c[m>>2]|0)+23>>0])>>0]^d[(c[m>>2]|0)+15>>0])>>0]^d[(c[m>>2]|0)+7>>0])<<2)>>2];c[s>>2]=(c[s>>2]<<8)+((c[s>>2]|0)>>>24);c[r>>2]=(c[r>>2]|0)+(c[s>>2]|0);c[s>>2]=(c[s>>2]|0)+(c[r>>2]|0);c[(c[l>>2]|0)+4128+104>>2]=c[r>>2];c[(c[l>>2]|0)+4128+108>>2]=(c[s>>2]<<9)+((c[s>>2]|0)>>>23);c[r>>2]=c[8368+((d[45042+(d[45042+(d[44786+(138^d[(c[m>>2]|0)+24>>0])>>0]^d[(c[m>>2]|0)+16>>0])>>0]^d[(c[m>>2]|0)+8>>0])>>0]^d[c[m>>2]>>0])<<2)>>2]^c[9392+((d[45042+(d[44786+(d[44786+(132^d[(c[m>>2]|0)+25>>0])>>0]^d[(c[m>>2]|0)+17>>0])>>0]^d[(c[m>>2]|0)+9>>0])>>0]^d[(c[m>>2]|0)+1>>0])<<2)>>2]^c[10416+((d[44786+(d[45042+(d[45042+(132^d[(c[m>>2]|0)+26>>0])>>0]^d[(c[m>>2]|0)+18>>0])>>0]^d[(c[m>>2]|0)+10>>0])>>0]^d[(c[m>>2]|0)+2>>0])<<2)>>2]^c[11440+((d[44786+(d[44786+(d[45042+(138^d[(c[m>>2]|0)+27>>0])>>0]^d[(c[m>>2]|0)+19>>0])>>0]^d[(c[m>>2]|0)+11>>0])>>0]^d[(c[m>>2]|0)+3>>0])<<2)>>2];c[s>>2]=c[8368+((d[45042+(d[45042+(d[44786+(0^d[(c[m>>2]|0)+28>>0])>>0]^d[(c[m>>2]|0)+20>>0])>>0]^d[(c[m>>2]|0)+12>>0])>>0]^d[(c[m>>2]|0)+4>>0])<<2)>>2]^c[9392+((d[45042+(d[44786+(d[44786+(84^d[(c[m>>2]|0)+29>>0])>>0]^d[(c[m>>2]|0)+21>>0])>>0]^d[(c[m>>2]|0)+13>>0])>>0]^d[(c[m>>2]|0)+5>>0])<<2)>>2]^c[10416+((d[44786+(d[45042+(d[45042+(84^d[(c[m>>2]|0)+30>>0])>>0]^d[(c[m>>2]|0)+22>>0])>>0]^d[(c[m>>2]|0)+14>>0])>>0]^d[(c[m>>2]|0)+6>>0])<<2)>>2]^c[11440+((d[44786+(d[44786+(d[45042+(0^d[(c[m>>2]|0)+31>>0])>>0]^d[(c[m>>2]|0)+23>>0])>>0]^d[(c[m>>2]|0)+15>>0])>>0]^d[(c[m>>2]|0)+7>>0])<<2)>>2];c[s>>2]=(c[s>>2]<<8)+((c[s>>2]|0)>>>24);c[r>>2]=(c[r>>2]|0)+(c[s>>2]|0);c[s>>2]=(c[s>>2]|0)+(c[r>>2]|0);c[(c[l>>2]|0)+4128+112>>2]=c[r>>2];c[(c[l>>2]|0)+4128+116>>2]=(c[s>>2]<<9)+((c[s>>2]|0)>>>23);c[r>>2]=c[8368+((d[45042+(d[45042+(d[44786+(188^d[(c[m>>2]|0)+24>>0])>>0]^d[(c[m>>2]|0)+16>>0])>>0]^d[(c[m>>2]|0)+8>>0])>>0]^d[c[m>>2]>>0])<<2)>>2]^c[9392+((d[45042+(d[44786+(d[44786+(223^d[(c[m>>2]|0)+25>>0])>>0]^d[(c[m>>2]|0)+17>>0])>>0]^d[(c[m>>2]|0)+9>>0])>>0]^d[(c[m>>2]|0)+1>>0])<<2)>>2]^c[10416+((d[44786+(d[45042+(d[45042+(223^d[(c[m>>2]|0)+26>>0])>>0]^d[(c[m>>2]|0)+18>>0])>>0]^d[(c[m>>2]|0)+10>>0])>>0]^d[(c[m>>2]|0)+2>>0])<<2)>>2]^c[11440+((d[44786+(d[44786+(d[45042+(188^d[(c[m>>2]|0)+27>>0])>>0]^d[(c[m>>2]|0)+19>>0])>>0]^d[(c[m>>2]|0)+11>>0])>>0]^d[(c[m>>2]|0)+3>>0])<<2)>>2];c[s>>2]=c[8368+((d[45042+(d[45042+(d[44786+(157^d[(c[m>>2]|0)+28>>0])>>0]^d[(c[m>>2]|0)+20>>0])>>0]^d[(c[m>>2]|0)+12>>0])>>0]^d[(c[m>>2]|0)+4>>0])<<2)>>2]^c[9392+((d[45042+(d[44786+(d[44786+(35^d[(c[m>>2]|0)+29>>0])>>0]^d[(c[m>>2]|0)+21>>0])>>0]^d[(c[m>>2]|0)+13>>0])>>0]^d[(c[m>>2]|0)+5>>0])<<2)>>2]^c[10416+((d[44786+(d[45042+(d[45042+(35^d[(c[m>>2]|0)+30>>0])>>0]^d[(c[m>>2]|0)+22>>0])>>0]^d[(c[m>>2]|0)+14>>0])>>0]^d[(c[m>>2]|0)+6>>0])<<2)>>2]^c[11440+((d[44786+(d[44786+(d[45042+(157^d[(c[m>>2]|0)+31>>0])>>0]^d[(c[m>>2]|0)+23>>0])>>0]^d[(c[m>>2]|0)+15>>0])>>0]^d[(c[m>>2]|0)+7>>0])<<2)>>2];c[s>>2]=(c[s>>2]<<8)+((c[s>>2]|0)>>>24);c[r>>2]=(c[r>>2]|0)+(c[s>>2]|0);c[s>>2]=(c[s>>2]|0)+(c[r>>2]|0);c[(c[l>>2]|0)+4128+120>>2]=c[r>>2];c[(c[l>>2]|0)+4128+124>>2]=(c[s>>2]<<9)+((c[s>>2]|0)>>>23)}else{c[p>>2]=0;c[o>>2]=0;c[q>>2]=1;while(1){if((c[o>>2]|0)>=256)break;c[(c[l>>2]|0)+(c[o>>2]<<2)>>2]=c[8368+((d[45042+(d[44274+(c[p>>2]|0)>>0]^d[t>>0])>>0]^d[x>>0])<<2)>>2];c[(c[l>>2]|0)+1024+(c[o>>2]<<2)>>2]=c[9392+((d[45042+(d[44274+(c[q>>2]|0)>>0]^d[u>>0])>>0]^d[y>>0])<<2)>>2];c[(c[l>>2]|0)+2048+(c[o>>2]<<2)>>2]=c[10416+((d[44786+(d[44274+(c[p>>2]|0)>>0]^d[v>>0])>>0]^d[z>>0])<<2)>>2];c[(c[l>>2]|0)+3072+(c[o>>2]<<2)>>2]=c[11440+((d[44786+(d[44274+(c[q>>2]|0)>>0]^d[w>>0])>>0]^d[A>>0])<<2)>>2];c[o>>2]=(c[o>>2]|0)+1;c[p>>2]=(c[p>>2]|0)+2;c[q>>2]=(c[q>>2]|0)+2}c[r>>2]=c[8368+((d[45042+(169^d[(c[m>>2]|0)+8>>0])>>0]^d[c[m>>2]>>0])<<2)>>2]^c[9392+((d[45042+(117^d[(c[m>>2]|0)+9>>0])>>0]^d[(c[m>>2]|0)+1>>0])<<2)>>2]^c[10416+((d[44786+(169^d[(c[m>>2]|0)+10>>0])>>0]^d[(c[m>>2]|0)+2>>0])<<2)>>2]^c[11440+((d[44786+(117^d[(c[m>>2]|0)+11>>0])>>0]^d[(c[m>>2]|0)+3>>0])<<2)>>2];c[s>>2]=c[8368+((d[45042+(103^d[(c[m>>2]|0)+12>>0])>>0]^d[(c[m>>2]|0)+4>>0])<<2)>>2]^c[9392+((d[45042+(243^d[(c[m>>2]|0)+13>>0])>>0]^d[(c[m>>2]|0)+5>>0])<<2)>>2]^c[10416+((d[44786+(103^d[(c[m>>2]|0)+14>>0])>>0]^d[(c[m>>2]|0)+6>>0])<<2)>>2]^c[11440+((d[44786+(243^d[(c[m>>2]|0)+15>>0])>>0]^d[(c[m>>2]|0)+7>>0])<<2)>>2];c[s>>2]=(c[s>>2]<<8)+((c[s>>2]|0)>>>24);c[r>>2]=(c[r>>2]|0)+(c[s>>2]|0);c[s>>2]=(c[s>>2]|0)+(c[r>>2]|0);c[(c[l>>2]|0)+4096>>2]=c[r>>2];c[(c[l>>2]|0)+4096+4>>2]=(c[s>>2]<<9)+((c[s>>2]|0)>>>23);c[r>>2]=c[8368+((d[45042+(179^d[(c[m>>2]|0)+8>>0])>>0]^d[c[m>>2]>>0])<<2)>>2]^c[9392+((d[45042+(198^d[(c[m>>2]|0)+9>>0])>>0]^d[(c[m>>2]|0)+1>>0])<<2)>>2]^c[10416+((d[44786+(179^d[(c[m>>2]|0)+10>>0])>>0]^d[(c[m>>2]|0)+2>>0])<<2)>>2]^c[11440+((d[44786+(198^d[(c[m>>2]|0)+11>>0])>>0]^d[(c[m>>2]|0)+3>>0])<<2)>>2];c[s>>2]=c[8368+((d[45042+(232^d[(c[m>>2]|0)+12>>0])>>0]^d[(c[m>>2]|0)+4>>0])<<2)>>2]^c[9392+((d[45042+(244^d[(c[m>>2]|0)+13>>0])>>0]^d[(c[m>>2]|0)+5>>0])<<2)>>2]^c[10416+((d[44786+(232^d[(c[m>>2]|0)+14>>0])>>0]^d[(c[m>>2]|0)+6>>0])<<2)>>2]^c[11440+((d[44786+(244^d[(c[m>>2]|0)+15>>0])>>0]^d[(c[m>>2]|0)+7>>0])<<2)>>2];c[s>>2]=(c[s>>2]<<8)+((c[s>>2]|0)>>>24);c[r>>2]=(c[r>>2]|0)+(c[s>>2]|0);c[s>>2]=(c[s>>2]|0)+(c[r>>2]|0);c[(c[l>>2]|0)+4096+8>>2]=c[r>>2];c[(c[l>>2]|0)+4096+12>>2]=(c[s>>2]<<9)+((c[s>>2]|0)>>>23);c[r>>2]=c[8368+((d[45042+(4^d[(c[m>>2]|0)+8>>0])>>0]^d[c[m>>2]>>0])<<2)>>2]^c[9392+((d[45042+(219^d[(c[m>>2]|0)+9>>0])>>0]^d[(c[m>>2]|0)+1>>0])<<2)>>2]^c[10416+((d[44786+(4^d[(c[m>>2]|0)+10>>0])>>0]^d[(c[m>>2]|0)+2>>0])<<2)>>2]^c[11440+((d[44786+(219^d[(c[m>>2]|0)+11>>0])>>0]^d[(c[m>>2]|0)+3>>0])<<2)>>2];c[s>>2]=c[8368+((d[45042+(253^d[(c[m>>2]|0)+12>>0])>>0]^d[(c[m>>2]|0)+4>>0])<<2)>>2]^c[9392+((d[45042+(123^d[(c[m>>2]|0)+13>>0])>>0]^d[(c[m>>2]|0)+5>>0])<<2)>>2]^c[10416+((d[44786+(253^d[(c[m>>2]|0)+14>>0])>>0]^d[(c[m>>2]|0)+6>>0])<<2)>>2]^c[11440+((d[44786+(123^d[(c[m>>2]|0)+15>>0])>>0]^d[(c[m>>2]|0)+7>>0])<<2)>>2];c[s>>2]=(c[s>>2]<<8)+((c[s>>2]|0)>>>24);c[r>>2]=(c[r>>2]|0)+(c[s>>2]|0);c[s>>2]=(c[s>>2]|0)+(c[r>>2]|0);c[(c[l>>2]|0)+4096+16>>2]=c[r>>2];c[(c[l>>2]|0)+4096+20>>2]=(c[s>>2]<<9)+((c[s>>2]|0)>>>23);c[r>>2]=c[8368+((d[45042+(163^d[(c[m>>2]|0)+8>>0])>>0]^d[c[m>>2]>>0])<<2)>>2]^c[9392+((d[45042+(251^d[(c[m>>2]|0)+9>>0])>>0]^d[(c[m>>2]|0)+1>>0])<<2)>>2]^c[10416+((d[44786+(163^d[(c[m>>2]|0)+10>>0])>>0]^d[(c[m>>2]|0)+2>>0])<<2)>>2]^c[11440+((d[44786+(251^d[(c[m>>2]|0)+11>>0])>>0]^d[(c[m>>2]|0)+3>>0])<<2)>>2];c[s>>2]=c[8368+((d[45042+(118^d[(c[m>>2]|0)+12>>0])>>0]^d[(c[m>>2]|0)+4>>0])<<2)>>2]^c[9392+((d[45042+(200^d[(c[m>>2]|0)+13>>0])>>0]^d[(c[m>>2]|0)+5>>0])<<2)>>2]^c[10416+((d[44786+(118^d[(c[m>>2]|0)+14>>0])>>0]^d[(c[m>>2]|0)+6>>0])<<2)>>2]^c[11440+((d[44786+(200^d[(c[m>>2]|0)+15>>0])>>0]^d[(c[m>>2]|0)+7>>0])<<2)>>2];c[s>>2]=(c[s>>2]<<8)+((c[s>>2]|0)>>>24);c[r>>2]=(c[r>>2]|0)+(c[s>>2]|0);c[s>>2]=(c[s>>2]|0)+(c[r>>2]|0);c[(c[l>>2]|0)+4096+24>>2]=c[r>>2];c[(c[l>>2]|0)+4096+28>>2]=(c[s>>2]<<9)+((c[s>>2]|0)>>>23);c[r>>2]=c[8368+((d[45042+(154^d[(c[m>>2]|0)+8>>0])>>0]^d[c[m>>2]>>0])<<2)>>2]^c[9392+((d[45042+(74^d[(c[m>>2]|0)+9>>0])>>0]^d[(c[m>>2]|0)+1>>0])<<2)>>2]^c[10416+((d[44786+(154^d[(c[m>>2]|0)+10>>0])>>0]^d[(c[m>>2]|0)+2>>0])<<2)>>2]^c[11440+((d[44786+(74^d[(c[m>>2]|0)+11>>0])>>0]^d[(c[m>>2]|0)+3>>0])<<2)>>2];c[s>>2]=c[8368+((d[45042+(146^d[(c[m>>2]|0)+12>>0])>>0]^d[(c[m>>2]|0)+4>>0])<<2)>>2]^c[9392+((d[45042+(211^d[(c[m>>2]|0)+13>>0])>>0]^d[(c[m>>2]|0)+5>>0])<<2)>>2]^c[10416+((d[44786+(146^d[(c[m>>2]|0)+14>>0])>>0]^d[(c[m>>2]|0)+6>>0])<<2)>>2]^c[11440+((d[44786+(211^d[(c[m>>2]|0)+15>>0])>>0]^d[(c[m>>2]|0)+7>>0])<<2)>>2];c[s>>2]=(c[s>>2]<<8)+((c[s>>2]|0)>>>24);c[r>>2]=(c[r>>2]|0)+(c[s>>2]|0);c[s>>2]=(c[s>>2]|0)+(c[r>>2]|0);c[(c[l>>2]|0)+4128>>2]=c[r>>2];c[(c[l>>2]|0)+4128+4>>2]=(c[s>>2]<<9)+((c[s>>2]|0)>>>23);c[r>>2]=c[8368+((d[45042+(128^d[(c[m>>2]|0)+8>>0])>>0]^d[c[m>>2]>>0])<<2)>>2]^c[9392+((d[45042+(230^d[(c[m>>2]|0)+9>>0])>>0]^d[(c[m>>2]|0)+1>>0])<<2)>>2]^c[10416+((d[44786+(128^d[(c[m>>2]|0)+10>>0])>>0]^d[(c[m>>2]|0)+2>>0])<<2)>>2]^c[11440+((d[44786+(230^d[(c[m>>2]|0)+11>>0])>>0]^d[(c[m>>2]|0)+3>>0])<<2)>>2];c[s>>2]=c[8368+((d[45042+(120^d[(c[m>>2]|0)+12>>0])>>0]^d[(c[m>>2]|0)+4>>0])<<2)>>2]^c[9392+((d[45042+(107^d[(c[m>>2]|0)+13>>0])>>0]^d[(c[m>>2]|0)+5>>0])<<2)>>2]^c[10416+((d[44786+(120^d[(c[m>>2]|0)+14>>0])>>0]^d[(c[m>>2]|0)+6>>0])<<2)>>2]^c[11440+((d[44786+(107^d[(c[m>>2]|0)+15>>0])>>0]^d[(c[m>>2]|0)+7>>0])<<2)>>2];c[s>>2]=(c[s>>2]<<8)+((c[s>>2]|0)>>>24);c[r>>2]=(c[r>>2]|0)+(c[s>>2]|0);c[s>>2]=(c[s>>2]|0)+(c[r>>2]|0);c[(c[l>>2]|0)+4128+8>>2]=c[r>>2];c[(c[l>>2]|0)+4128+12>>2]=(c[s>>2]<<9)+((c[s>>2]|0)>>>23);c[r>>2]=c[8368+((d[45042+(228^d[(c[m>>2]|0)+8>>0])>>0]^d[c[m>>2]>>0])<<2)>>2]^c[9392+((d[45042+(69^d[(c[m>>2]|0)+9>>0])>>0]^d[(c[m>>2]|0)+1>>0])<<2)>>2]^c[10416+((d[44786+(228^d[(c[m>>2]|0)+10>>0])>>0]^d[(c[m>>2]|0)+2>>0])<<2)>>2]^c[11440+((d[44786+(69^d[(c[m>>2]|0)+11>>0])>>0]^d[(c[m>>2]|0)+3>>0])<<2)>>2];c[s>>2]=c[8368+((d[45042+(221^d[(c[m>>2]|0)+12>>0])>>0]^d[(c[m>>2]|0)+4>>0])<<2)>>2]^c[9392+((d[45042+(125^d[(c[m>>2]|0)+13>>0])>>0]^d[(c[m>>2]|0)+5>>0])<<2)>>2]^c[10416+((d[44786+(221^d[(c[m>>2]|0)+14>>0])>>0]^d[(c[m>>2]|0)+6>>0])<<2)>>2]^c[11440+((d[44786+(125^d[(c[m>>2]|0)+15>>0])>>0]^d[(c[m>>2]|0)+7>>0])<<2)>>2];c[s>>2]=(c[s>>2]<<8)+((c[s>>2]|0)>>>24);c[r>>2]=(c[r>>2]|0)+(c[s>>2]|0);c[s>>2]=(c[s>>2]|0)+(c[r>>2]|0);c[(c[l>>2]|0)+4128+16>>2]=c[r>>2];c[(c[l>>2]|0)+4128+20>>2]=(c[s>>2]<<9)+((c[s>>2]|0)>>>23);c[r>>2]=c[8368+((d[45042+(209^d[(c[m>>2]|0)+8>>0])>>0]^d[c[m>>2]>>0])<<2)>>2]^c[9392+((d[45042+(232^d[(c[m>>2]|0)+9>>0])>>0]^d[(c[m>>2]|0)+1>>0])<<2)>>2]^c[10416+((d[44786+(209^d[(c[m>>2]|0)+10>>0])>>0]^d[(c[m>>2]|0)+2>>0])<<2)>>2]^c[11440+((d[44786+(232^d[(c[m>>2]|0)+11>>0])>>0]^d[(c[m>>2]|0)+3>>0])<<2)>>2];c[s>>2]=c[8368+((d[45042+(56^d[(c[m>>2]|0)+12>>0])>>0]^d[(c[m>>2]|0)+4>>0])<<2)>>2]^c[9392+((d[45042+(75^d[(c[m>>2]|0)+13>>0])>>0]^d[(c[m>>2]|0)+5>>0])<<2)>>2]^c[10416+((d[44786+(56^d[(c[m>>2]|0)+14>>0])>>0]^d[(c[m>>2]|0)+6>>0])<<2)>>2]^c[11440+((d[44786+(75^d[(c[m>>2]|0)+15>>0])>>0]^d[(c[m>>2]|0)+7>>0])<<2)>>2];c[s>>2]=(c[s>>2]<<8)+((c[s>>2]|0)>>>24);c[r>>2]=(c[r>>2]|0)+(c[s>>2]|0);c[s>>2]=(c[s>>2]|0)+(c[r>>2]|0);c[(c[l>>2]|0)+4128+24>>2]=c[r>>2];c[(c[l>>2]|0)+4128+28>>2]=(c[s>>2]<<9)+((c[s>>2]|0)>>>23);c[r>>2]=c[8368+((d[45042+(13^d[(c[m>>2]|0)+8>>0])>>0]^d[c[m>>2]>>0])<<2)>>2]^c[9392+((d[45042+(214^d[(c[m>>2]|0)+9>>0])>>0]^d[(c[m>>2]|0)+1>>0])<<2)>>2]^c[10416+((d[44786+(13^d[(c[m>>2]|0)+10>>0])>>0]^d[(c[m>>2]|0)+2>>0])<<2)>>2]^c[11440+((d[44786+(214^d[(c[m>>2]|0)+11>>0])>>0]^d[(c[m>>2]|0)+3>>0])<<2)>>2];c[s>>2]=c[8368+((d[45042+(198^d[(c[m>>2]|0)+12>>0])>>0]^d[(c[m>>2]|0)+4>>0])<<2)>>2]^c[9392+((d[45042+(50^d[(c[m>>2]|0)+13>>0])>>0]^d[(c[m>>2]|0)+5>>0])<<2)>>2]^c[10416+((d[44786+(198^d[(c[m>>2]|0)+14>>0])>>0]^d[(c[m>>2]|0)+6>>0])<<2)>>2]^c[11440+((d[44786+(50^d[(c[m>>2]|0)+15>>0])>>0]^d[(c[m>>2]|0)+7>>0])<<2)>>2];c[s>>2]=(c[s>>2]<<8)+((c[s>>2]|0)>>>24);c[r>>2]=(c[r>>2]|0)+(c[s>>2]|0);c[s>>2]=(c[s>>2]|0)+(c[r>>2]|0);c[(c[l>>2]|0)+4128+32>>2]=c[r>>2];c[(c[l>>2]|0)+4128+36>>2]=(c[s>>2]<<9)+((c[s>>2]|0)>>>23);c[r>>2]=c[8368+((d[45042+(53^d[(c[m>>2]|0)+8>>0])>>0]^d[c[m>>2]>>0])<<2)>>2]^c[9392+((d[45042+(216^d[(c[m>>2]|0)+9>>0])>>0]^d[(c[m>>2]|0)+1>>0])<<2)>>2]^c[10416+((d[44786+(53^d[(c[m>>2]|0)+10>>0])>>0]^d[(c[m>>2]|0)+2>>0])<<2)>>2]^c[11440+((d[44786+(216^d[(c[m>>2]|0)+11>>0])>>0]^d[(c[m>>2]|0)+3>>0])<<2)>>2];c[s>>2]=c[8368+((d[45042+(152^d[(c[m>>2]|0)+12>>0])>>0]^d[(c[m>>2]|0)+4>>0])<<2)>>2]^c[9392+((d[45042+(253^d[(c[m>>2]|0)+13>>0])>>0]^d[(c[m>>2]|0)+5>>0])<<2)>>2]^c[10416+((d[44786+(152^d[(c[m>>2]|0)+14>>0])>>0]^d[(c[m>>2]|0)+6>>0])<<2)>>2]^c[11440+((d[44786+(253^d[(c[m>>2]|0)+15>>0])>>0]^d[(c[m>>2]|0)+7>>0])<<2)>>2];c[s>>2]=(c[s>>2]<<8)+((c[s>>2]|0)>>>24);c[r>>2]=(c[r>>2]|0)+(c[s>>2]|0);c[s>>2]=(c[s>>2]|0)+(c[r>>2]|0);c[(c[l>>2]|0)+4128+40>>2]=c[r>>2];c[(c[l>>2]|0)+4128+44>>2]=(c[s>>2]<<9)+((c[s>>2]|0)>>>23);c[r>>2]=c[8368+((d[45042+(24^d[(c[m>>2]|0)+8>>0])>>0]^d[c[m>>2]>>0])<<2)>>2]^c[9392+((d[45042+(55^d[(c[m>>2]|0)+9>>0])>>0]^d[(c[m>>2]|0)+1>>0])<<2)>>2]^c[10416+((d[44786+(24^d[(c[m>>2]|0)+10>>0])>>0]^d[(c[m>>2]|0)+2>>0])<<2)>>2]^c[11440+((d[44786+(55^d[(c[m>>2]|0)+11>>0])>>0]^d[(c[m>>2]|0)+3>>0])<<2)>>2];c[s>>2]=c[8368+((d[45042+(247^d[(c[m>>2]|0)+12>>0])>>0]^d[(c[m>>2]|0)+4>>0])<<2)>>2]^c[9392+((d[45042+(113^d[(c[m>>2]|0)+13>>0])>>0]^d[(c[m>>2]|0)+5>>0])<<2)>>2]^c[10416+((d[44786+(247^d[(c[m>>2]|0)+14>>0])>>0]^d[(c[m>>2]|0)+6>>0])<<2)>>2]^c[11440+((d[44786+(113^d[(c[m>>2]|0)+15>>0])>>0]^d[(c[m>>2]|0)+7>>0])<<2)>>2];c[s>>2]=(c[s>>2]<<8)+((c[s>>2]|0)>>>24);c[r>>2]=(c[r>>2]|0)+(c[s>>2]|0);c[s>>2]=(c[s>>2]|0)+(c[r>>2]|0);c[(c[l>>2]|0)+4128+48>>2]=c[r>>2];c[(c[l>>2]|0)+4128+52>>2]=(c[s>>2]<<9)+((c[s>>2]|0)>>>23);c[r>>2]=c[8368+((d[45042+(236^d[(c[m>>2]|0)+8>>0])>>0]^d[c[m>>2]>>0])<<2)>>2]^c[9392+((d[45042+(241^d[(c[m>>2]|0)+9>>0])>>0]^d[(c[m>>2]|0)+1>>0])<<2)>>2]^c[10416+((d[44786+(236^d[(c[m>>2]|0)+10>>0])>>0]^d[(c[m>>2]|0)+2>>0])<<2)>>2]^c[11440+((d[44786+(241^d[(c[m>>2]|0)+11>>0])>>0]^d[(c[m>>2]|0)+3>>0])<<2)>>2];c[s>>2]=c[8368+((d[45042+(108^d[(c[m>>2]|0)+12>>0])>>0]^d[(c[m>>2]|0)+4>>0])<<2)>>2]^c[9392+((d[45042+(225^d[(c[m>>2]|0)+13>>0])>>0]^d[(c[m>>2]|0)+5>>0])<<2)>>2]^c[10416+((d[44786+(108^d[(c[m>>2]|0)+14>>0])>>0]^d[(c[m>>2]|0)+6>>0])<<2)>>2]^c[11440+((d[44786+(225^d[(c[m>>2]|0)+15>>0])>>0]^d[(c[m>>2]|0)+7>>0])<<2)>>2];c[s>>2]=(c[s>>2]<<8)+((c[s>>2]|0)>>>24);c[r>>2]=(c[r>>2]|0)+(c[s>>2]|0);c[s>>2]=(c[s>>2]|0)+(c[r>>2]|0);c[(c[l>>2]|0)+4128+56>>2]=c[r>>2];c[(c[l>>2]|0)+4128+60>>2]=(c[s>>2]<<9)+((c[s>>2]|0)>>>23);c[r>>2]=c[8368+((d[45042+(67^d[(c[m>>2]|0)+8>>0])>>0]^d[c[m>>2]>>0])<<2)>>2]^c[9392+((d[45042+(48^d[(c[m>>2]|0)+9>>0])>>0]^d[(c[m>>2]|0)+1>>0])<<2)>>2]^c[10416+((d[44786+(67^d[(c[m>>2]|0)+10>>0])>>0]^d[(c[m>>2]|0)+2>>0])<<2)>>2]^c[11440+((d[44786+(48^d[(c[m>>2]|0)+11>>0])>>0]^d[(c[m>>2]|0)+3>>0])<<2)>>2];c[s>>2]=c[8368+((d[45042+(117^d[(c[m>>2]|0)+12>>0])>>0]^d[(c[m>>2]|0)+4>>0])<<2)>>2]^c[9392+((d[45042+(15^d[(c[m>>2]|0)+13>>0])>>0]^d[(c[m>>2]|0)+5>>0])<<2)>>2]^c[10416+((d[44786+(117^d[(c[m>>2]|0)+14>>0])>>0]^d[(c[m>>2]|0)+6>>0])<<2)>>2]^c[11440+((d[44786+(15^d[(c[m>>2]|0)+15>>0])>>0]^d[(c[m>>2]|0)+7>>0])<<2)>>2];c[s>>2]=(c[s>>2]<<8)+((c[s>>2]|0)>>>24);c[r>>2]=(c[r>>2]|0)+(c[s>>2]|0);c[s>>2]=(c[s>>2]|0)+(c[r>>2]|0);c[(c[l>>2]|0)+4128+64>>2]=c[r>>2];c[(c[l>>2]|0)+4128+68>>2]=(c[s>>2]<<9)+((c[s>>2]|0)>>>23);c[r>>2]=c[8368+((d[45042+(55^d[(c[m>>2]|0)+8>>0])>>0]^d[c[m>>2]>>0])<<2)>>2]^c[9392+((d[45042+(248^d[(c[m>>2]|0)+9>>0])>>0]^d[(c[m>>2]|0)+1>>0])<<2)>>2]^c[10416+((d[44786+(55^d[(c[m>>2]|0)+10>>0])>>0]^d[(c[m>>2]|0)+2>>0])<<2)>>2]^c[11440+((d[44786+(248^d[(c[m>>2]|0)+11>>0])>>0]^d[(c[m>>2]|0)+3>>0])<<2)>>2];c[s>>2]=c[8368+((d[45042+(38^d[(c[m>>2]|0)+12>>0])>>0]^d[(c[m>>2]|0)+4>>0])<<2)>>2]^c[9392+((d[45042+(27^d[(c[m>>2]|0)+13>>0])>>0]^d[(c[m>>2]|0)+5>>0])<<2)>>2]^c[10416+((d[44786+(38^d[(c[m>>2]|0)+14>>0])>>0]^d[(c[m>>2]|0)+6>>0])<<2)>>2]^c[11440+((d[44786+(27^d[(c[m>>2]|0)+15>>0])>>0]^d[(c[m>>2]|0)+7>>0])<<2)>>2];c[s>>2]=(c[s>>2]<<8)+((c[s>>2]|0)>>>24);c[r>>2]=(c[r>>2]|0)+(c[s>>2]|0);c[s>>2]=(c[s>>2]|0)+(c[r>>2]|0);c[(c[l>>2]|0)+4128+72>>2]=c[r>>2];c[(c[l>>2]|0)+4128+76>>2]=(c[s>>2]<<9)+((c[s>>2]|0)>>>23);c[r>>2]=c[8368+((d[45042+(250^d[(c[m>>2]|0)+8>>0])>>0]^d[c[m>>2]>>0])<<2)>>2]^c[9392+((d[45042+(135^d[(c[m>>2]|0)+9>>0])>>0]^d[(c[m>>2]|0)+1>>0])<<2)>>2]^c[10416+((d[44786+(250^d[(c[m>>2]|0)+10>>0])>>0]^d[(c[m>>2]|0)+2>>0])<<2)>>2]^c[11440+((d[44786+(135^d[(c[m>>2]|0)+11>>0])>>0]^d[(c[m>>2]|0)+3>>0])<<2)>>2];c[s>>2]=c[8368+((d[45042+(19^d[(c[m>>2]|0)+12>>0])>>0]^d[(c[m>>2]|0)+4>>0])<<2)>>2]^c[9392+((d[45042+(250^d[(c[m>>2]|0)+13>>0])>>0]^d[(c[m>>2]|0)+5>>0])<<2)>>2]^c[10416+((d[44786+(19^d[(c[m>>2]|0)+14>>0])>>0]^d[(c[m>>2]|0)+6>>0])<<2)>>2]^c[11440+((d[44786+(250^d[(c[m>>2]|0)+15>>0])>>0]^d[(c[m>>2]|0)+7>>0])<<2)>>2];c[s>>2]=(c[s>>2]<<8)+((c[s>>2]|0)>>>24);c[r>>2]=(c[r>>2]|0)+(c[s>>2]|0);c[s>>2]=(c[s>>2]|0)+(c[r>>2]|0);c[(c[l>>2]|0)+4128+80>>2]=c[r>>2];c[(c[l>>2]|0)+4128+84>>2]=(c[s>>2]<<9)+((c[s>>2]|0)>>>23);c[r>>2]=c[8368+((d[45042+(148^d[(c[m>>2]|0)+8>>0])>>0]^d[c[m>>2]>>0])<<2)>>2]^c[9392+((d[45042+(6^d[(c[m>>2]|0)+9>>0])>>0]^d[(c[m>>2]|0)+1>>0])<<2)>>2]^c[10416+((d[44786+(148^d[(c[m>>2]|0)+10>>0])>>0]^d[(c[m>>2]|0)+2>>0])<<2)>>2]^c[11440+((d[44786+(6^d[(c[m>>2]|0)+11>>0])>>0]^d[(c[m>>2]|0)+3>>0])<<2)>>2];c[s>>2]=c[8368+((d[45042+(72^d[(c[m>>2]|0)+12>>0])>>0]^d[(c[m>>2]|0)+4>>0])<<2)>>2]^c[9392+((d[45042+(63^d[(c[m>>2]|0)+13>>0])>>0]^d[(c[m>>2]|0)+5>>0])<<2)>>2]^c[10416+((d[44786+(72^d[(c[m>>2]|0)+14>>0])>>0]^d[(c[m>>2]|0)+6>>0])<<2)>>2]^c[11440+((d[44786+(63^d[(c[m>>2]|0)+15>>0])>>0]^d[(c[m>>2]|0)+7>>0])<<2)>>2];c[s>>2]=(c[s>>2]<<8)+((c[s>>2]|0)>>>24);c[r>>2]=(c[r>>2]|0)+(c[s>>2]|0);c[s>>2]=(c[s>>2]|0)+(c[r>>2]|0);c[(c[l>>2]|0)+4128+88>>2]=c[r>>2];c[(c[l>>2]|0)+4128+92>>2]=(c[s>>2]<<9)+((c[s>>2]|0)>>>23);c[r>>2]=c[8368+((d[45042+(242^d[(c[m>>2]|0)+8>>0])>>0]^d[c[m>>2]>>0])<<2)>>2]^c[9392+((d[45042+(94^d[(c[m>>2]|0)+9>>0])>>0]^d[(c[m>>2]|0)+1>>0])<<2)>>2]^c[10416+((d[44786+(242^d[(c[m>>2]|0)+10>>0])>>0]^d[(c[m>>2]|0)+2>>0])<<2)>>2]^c[11440+((d[44786+(94^d[(c[m>>2]|0)+11>>0])>>0]^d[(c[m>>2]|0)+3>>0])<<2)>>2];c[s>>2]=c[8368+((d[45042+(208^d[(c[m>>2]|0)+12>>0])>>0]^d[(c[m>>2]|0)+4>>0])<<2)>>2]^c[9392+((d[45042+(186^d[(c[m>>2]|0)+13>>0])>>0]^d[(c[m>>2]|0)+5>>0])<<2)>>2]^c[10416+((d[44786+(208^d[(c[m>>2]|0)+14>>0])>>0]^d[(c[m>>2]|0)+6>>0])<<2)>>2]^c[11440+((d[44786+(186^d[(c[m>>2]|0)+15>>0])>>0]^d[(c[m>>2]|0)+7>>0])<<2)>>2];c[s>>2]=(c[s>>2]<<8)+((c[s>>2]|0)>>>24);c[r>>2]=(c[r>>2]|0)+(c[s>>2]|0);c[s>>2]=(c[s>>2]|0)+(c[r>>2]|0);c[(c[l>>2]|0)+4128+96>>2]=c[r>>2];c[(c[l>>2]|0)+4128+100>>2]=(c[s>>2]<<9)+((c[s>>2]|0)>>>23);c[r>>2]=c[8368+((d[45042+(139^d[(c[m>>2]|0)+8>>0])>>0]^d[c[m>>2]>>0])<<2)>>2]^c[9392+((d[45042+(174^d[(c[m>>2]|0)+9>>0])>>0]^d[(c[m>>2]|0)+1>>0])<<2)>>2]^c[10416+((d[44786+(139^d[(c[m>>2]|0)+10>>0])>>0]^d[(c[m>>2]|0)+2>>0])<<2)>>2]^c[11440+((d[44786+(174^d[(c[m>>2]|0)+11>>0])>>0]^d[(c[m>>2]|0)+3>>0])<<2)>>2];c[s>>2]=c[8368+((d[45042+(48^d[(c[m>>2]|0)+12>>0])>>0]^d[(c[m>>2]|0)+4>>0])<<2)>>2]^c[9392+((d[45042+(91^d[(c[m>>2]|0)+13>>0])>>0]^d[(c[m>>2]|0)+5>>0])<<2)>>2]^c[10416+((d[44786+(48^d[(c[m>>2]|0)+14>>0])>>0]^d[(c[m>>2]|0)+6>>0])<<2)>>2]^c[11440+((d[44786+(91^d[(c[m>>2]|0)+15>>0])>>0]^d[(c[m>>2]|0)+7>>0])<<2)>>2];c[s>>2]=(c[s>>2]<<8)+((c[s>>2]|0)>>>24);c[r>>2]=(c[r>>2]|0)+(c[s>>2]|0);c[s>>2]=(c[s>>2]|0)+(c[r>>2]|0);c[(c[l>>2]|0)+4128+104>>2]=c[r>>2];c[(c[l>>2]|0)+4128+108>>2]=(c[s>>2]<<9)+((c[s>>2]|0)>>>23);c[r>>2]=c[8368+((d[45042+(132^d[(c[m>>2]|0)+8>>0])>>0]^d[c[m>>2]>>0])<<2)>>2]^c[9392+((d[45042+(138^d[(c[m>>2]|0)+9>>0])>>0]^d[(c[m>>2]|0)+1>>0])<<2)>>2]^c[10416+((d[44786+(132^d[(c[m>>2]|0)+10>>0])>>0]^d[(c[m>>2]|0)+2>>0])<<2)>>2]^c[11440+((d[44786+(138^d[(c[m>>2]|0)+11>>0])>>0]^d[(c[m>>2]|0)+3>>0])<<2)>>2];c[s>>2]=c[8368+((d[45042+(84^d[(c[m>>2]|0)+12>>0])>>0]^d[(c[m>>2]|0)+4>>0])<<2)>>2]^c[9392+((d[45042+(0^d[(c[m>>2]|0)+13>>0])>>0]^d[(c[m>>2]|0)+5>>0])<<2)>>2]^c[10416+((d[44786+(84^d[(c[m>>2]|0)+14>>0])>>0]^d[(c[m>>2]|0)+6>>0])<<2)>>2]^c[11440+((d[44786+(0^d[(c[m>>2]|0)+15>>0])>>0]^d[(c[m>>2]|0)+7>>0])<<2)>>2];c[s>>2]=(c[s>>2]<<8)+((c[s>>2]|0)>>>24);c[r>>2]=(c[r>>2]|0)+(c[s>>2]|0);c[s>>2]=(c[s>>2]|0)+(c[r>>2]|0);c[(c[l>>2]|0)+4128+112>>2]=c[r>>2];c[(c[l>>2]|0)+4128+116>>2]=(c[s>>2]<<9)+((c[s>>2]|0)>>>23);c[r>>2]=c[8368+((d[45042+(223^d[(c[m>>2]|0)+8>>0])>>0]^d[c[m>>2]>>0])<<2)>>2]^c[9392+((d[45042+(188^d[(c[m>>2]|0)+9>>0])>>0]^d[(c[m>>2]|0)+1>>0])<<2)>>2]^c[10416+((d[44786+(223^d[(c[m>>2]|0)+10>>0])>>0]^d[(c[m>>2]|0)+2>>0])<<2)>>2]^c[11440+((d[44786+(188^d[(c[m>>2]|0)+11>>0])>>0]^d[(c[m>>2]|0)+3>>0])<<2)>>2];c[s>>2]=c[8368+((d[45042+(35^d[(c[m>>2]|0)+12>>0])>>0]^d[(c[m>>2]|0)+4>>0])<<2)>>2]^c[9392+((d[45042+(157^d[(c[m>>2]|0)+13>>0])>>0]^d[(c[m>>2]|0)+5>>0])<<2)>>2]^c[10416+((d[44786+(35^d[(c[m>>2]|0)+14>>0])>>0]^d[(c[m>>2]|0)+6>>0])<<2)>>2]^c[11440+((d[44786+(157^d[(c[m>>2]|0)+15>>0])>>0]^d[(c[m>>2]|0)+7>>0])<<2)>>2];c[s>>2]=(c[s>>2]<<8)+((c[s>>2]|0)>>>24);c[r>>2]=(c[r>>2]|0)+(c[s>>2]|0);c[s>>2]=(c[s>>2]|0)+(c[r>>2]|0);c[(c[l>>2]|0)+4128+120>>2]=c[r>>2];c[(c[l>>2]|0)+4128+124>>2]=(c[s>>2]<<9)+((c[s>>2]|0)>>>23)}c[k>>2]=0;K=c[k>>2]|0;i=g;return K|0}function sm(){var a=0,b=0,d=0,e=0,f=0,g=0;a=i;i=i+4288|0;if((i|0)>=(j|0))U();b=a+4264|0;d=a+8|0;e=a+4272|0;f=a;qm(d,43267,16)|0;tm(d,e,43283)|0;do if(!(vv(e,43299,16)|0)){xm(d,e,e)|0;if(vv(e,43283,16)|0){c[b>>2]=43351;break}qm(d,43387,32)|0;tm(d,e,43419)|0;if(vv(e,43435,16)|0){c[b>>2]=43451;break}xm(d,e,e)|0;if(vv(e,43419,16)|0){c[b>>2]=43487;break}g=zm()|0;c[f>>2]=g;if(g|0){c[b>>2]=c[f>>2];break}g=Cm()|0;c[f>>2]=g;if(g|0){c[b>>2]=c[f>>2];break}g=Fm()|0;c[f>>2]=g;if(g|0){c[b>>2]=c[f>>2];break}else{c[b>>2]=0;break}}else c[b>>2]=43315;while(0);i=a;return c[b>>2]|0}function tm(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,k=0;e=i;i=i+16|0;if((i|0)>=(j|0))U();f=e+12|0;g=e+8|0;h=e+4|0;k=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;c[k>>2]=c[f>>2];um(c[k>>2]|0,c[g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));c[k>>2]=c[k>>2]^(c[o>>2]|0)+(c[(c[f>>2]|0)+4128+88>>2]|0);c[k>>2]=((c[k>>2]|0)>>>1)+(c[k>>2]<<31);c[l>>2]=(c[l>>2]<<1)+((c[l>>2]|0)>>>31)^c[p>>2];c[o>>2]=c[(c[f>>2]|0)+((c[k>>2]&255)<<2)>>2]^c[(c[f>>2]|0)+1024+(((c[k>>2]|0)>>>8&255)<<2)>>2]^c[(c[f>>2]|0)+2048+(((c[k>>2]|0)>>>16&255)<<2)>>2]^c[(c[f>>2]|0)+3072+((c[k>>2]|0)>>>24<<2)>>2];c[p>>2]=c[(c[f>>2]|0)+1024+((c[l>>2]&255)<<2)>>2]^c[(c[f>>2]|0)+2048+(((c[l>>2]|0)>>>8&255)<<2)>>2]^c[(c[f>>2]|0)+3072+(((c[l>>2]|0)>>>16&255)<<2)>>2]^c[(c[f>>2]|0)+((c[l>>2]|0)>>>24<<2)>>2];c[o>>2]=(c[o>>2]|0)+(c[p>>2]|0);c[p>>2]=(c[p>>2]|0)+((c[o>>2]|0)+(c[(c[f>>2]|0)+4128+100>>2]|0));c[m>>2]=c[m>>2]^(c[o>>2]|0)+(c[(c[f>>2]|0)+4128+96>>2]|0);c[m>>2]=((c[m>>2]|0)>>>1)+(c[m>>2]<<31);c[n>>2]=(c[n>>2]<<1)+((c[n>>2]|0)>>>31)^c[p>>2];c[o>>2]=c[(c[f>>2]|0)+((c[m>>2]&255)<<2)>>2]^c[(c[f>>2]|0)+1024+(((c[m>>2]|0)>>>8&255)<<2)>>2]^c[(c[f>>2]|0)+2048+(((c[m>>2]|0)>>>16&255)<<2)>>2]^c[(c[f>>2]|0)+3072+((c[m>>2]|0)>>>24<<2)>>2];c[p>>2]=c[(c[f>>2]|0)+1024+((c[n>>2]&255)<<2)>>2]^c[(c[f>>2]|0)+2048+(((c[n>>2]|0)>>>8&255)<<2)>>2]^c[(c[f>>2]|0)+3072+(((c[n>>2]|0)>>>16&255)<<2)>>2]^c[(c[f>>2]|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]&255)<<2)>>2]^c[(c[f>>2]|0)+2048+(((c[n>>2]|0)>>>8&255)<<2)>>2]^c[(c[f>>2]|0)+3072+(((c[n>>2]|0)>>>16&255)<<2)>>2]^c[(c[f>>2]|0)+((c[n>>2]|0)>>>24<<2)>>2];c[o>>2]=(c[o>>2]|0)+(c[p>>2]|0);c[p>>2]=(c[p>>2]|0)+((c[o>>2]|0)+(c[(c[f>>2]|0)+4128+124>>2]|0));c[k>>2]=c[k>>2]^(c[o>>2]|0)+(c[(c[f>>2]|0)+4128+120>>2]|0);c[k>>2]=((c[k>>2]|0)>>>1)+(c[k>>2]<<31);c[l>>2]=(c[l>>2]<<1)+((c[l>>2]|0)>>>31)^c[p>>2];c[m>>2]=c[m>>2]^c[(c[f>>2]|0)+4096+16>>2];wm(c[g>>2]|0,c[m>>2]|0);c[n>>2]=c[n>>2]^c[(c[f>>2]|0)+4096+20>>2];wm((c[g>>2]|0)+4|0,c[n>>2]|0);c[k>>2]=c[k>>2]^c[(c[f>>2]|0)+4096+24>>2];wm((c[g>>2]|0)+8|0,c[k>>2]|0);c[l>>2]=c[l>>2]^c[(c[f>>2]|0)+4096+28>>2];wm((c[g>>2]|0)+12|0,c[l>>2]|0);i=e;return}function vm(a){a=a|0;var b=0,e=0,f=0;b=i;i=i+16|0;if((i|0)>=(j|0))U();e=b+4|0;f=b;c[e>>2]=a;c[f>>2]=c[e>>2];i=b;return (d[(c[f>>2]|0)+3>>0]|0)<<24|(d[(c[f>>2]|0)+2>>0]|0)<<16|(d[(c[f>>2]|0)+1>>0]|0)<<8|(d[c[f>>2]>>0]|0)|0}function wm(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=i;i=i+16|0;if((i|0)>=(j|0))U();f=e+8|0;g=e+4|0;h=e;c[f>>2]=b;c[g>>2]=d;c[h>>2]=c[f>>2];a[(c[h>>2]|0)+3>>0]=(c[g>>2]|0)>>>24;a[(c[h>>2]|0)+2>>0]=(c[g>>2]|0)>>>16;a[(c[h>>2]|0)+1>>0]=(c[g>>2]|0)>>>8;a[c[h>>2]>>0]=c[g>>2];i=e;return}function xm(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,k=0;e=i;i=i+16|0;if((i|0)>=(j|0))U();f=e+12|0;g=e+8|0;h=e+4|0;k=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;c[k>>2]=c[f>>2];ym(c[k>>2]|0,c[g>>2]|0,c[h>>2]|0);i=e;return 36}
+
+// EMSCRIPTEN_END_FUNCS
+var sb=[ix,Rj,Vj,Wj,sk,ml,ol,pl,ql,rl,Il,Yl,mm,qm,tm,xm,rr,tr,ur,vr,wr,Hh,Kr,gu,ku,hu,Eu,He,pv,mk,qk,Hk,Bl,Nl,bm,lu,ix,ix,ix,ix,ix,ix,ix,ix,ix,ix,ix,ix,ix,ix,ix,ix,ix,ix,ix,ix,ix,ix,ix,ix,ix,ix,ix,ix];var tb=[jx,xk,kk,hk,ek,Bk,Dm,Gm,Am,jx,jx,jx,jx,jx,jx,jx];var ub=[kx,Lk,Fl,Vl,jm,un,iu,mu,Vv,kx,kx,kx,kx,kx,kx,kx];var vb=[lx,Gk,Al,Ml,$l,am,pm,Ir];var wb=[mx,Nk,kl,nl,Hl,Xl,lm,pr,sr,Mh,du,mx,mx,mx,mx,mx];var xb=[nx,Ar,Fk,Ur,Bs,Ys,nx,nx];var yb=[ox,Zj,$j,Gt];var zb=[px,Lr,Aq,Tr,at,px,px,px];var Ab=[qx,zk];var Bb=[rx,bl,zl,kr,yr,Bj,jl,rx];var Cb=[sx,Xg];return{_GNUNET_CRYPTO_rsa_signature_encode:Xc,_GNUNET_CRYPTO_rsa_verify:fd,_bitshift64Shl:Pw,_bitshift64Lshr:Mw,_GNUNET_STRINGS_string_to_data:jd,_GNUNET_CRYPTO_rsa_private_key_get_public:Sc,_memset:Sw,_GNUNET_CRYPTO_eddsa_verify:uc,_TALER_amount_normalize:$t,_GNUNET_CRYPTO_symmetric_encrypt:hc,_TALER_WR_get_fraction:Ob,_GNUNET_CRYPTO_rsa_unblind:ed,_TALER_amount_cmp:_t,_GNUNET_CRYPTO_rsa_blind:Yc,_TALER_WR_get_currency:Pb,_GNUNET_CRYPTO_rsa_private_key_free:Pc,_fflush:Fv,_GNUNET_CRYPTO_hash_create_random:xc,_bitshift64Ashr:Lw,_TALER_WRALL_get_amount:Mb,_GNUNET_CRYPTO_rsa_private_key_create:Oc,_GNUNET_CRYPTO_eddsa_key_create:rc,_TALER_WRALL_eddsa_public_key_from_private:Kb,_llvm_bswap_i32:Uw,___muldi3:Xw,_GNUNET_CRYPTO_ecc_ecdh:vc,_GNUNET_CRYPTO_rsa_private_key_decode:Rc,_GNUNET_CRYPTO_symmetric_decrypt:kc,_GNUNET_CRYPTO_rsa_signature_free:cd,___divdi3:Tw,_TALER_amount_ntoh:Wt,_pthread_self:Yw,_GNUNET_CRYPTO_ecdhe_key_create:pc,_TALER_amount_subtract:bu,___udivmoddi4:Jw,_GNUNET_CRYPTO_random_block:Nc,_i64Add:Gw,_GNUNET_CRYPTO_ecdhe_key_get_public:nc,_TALER_WRALL_purpose_create:Lb,_pthread_mutex_unlock:Nw,_GNUNET_CRYPTO_rsa_public_key_free:Uc,_GNUNET_CRYPTO_hkdf:Bc,_TALER_amount_hton:Vt,_i64Subtract:Fw,_pthread_mutex_lock:Hw,_GNUNET_CRYPTO_rsa_private_key_encode:Qc,_GNUNET_CRYPTO_eddsa_key_get_public:lc,___udivdi3:Vw,___errno_location:fu,___muldsi3:Ww,_TALER_WR_get_value:Nb,_TALER_amount_add:cu,_free:zw,_GNUNET_STRINGS_data_to_string_alloc:id,_memmove:Qw,_llvm_cttz_i32:Iw,_malloc:yw,_memcpy:Ow,_TALER_amount_get_zero:Xt,_GNUNET_CRYPTO_eddsa_sign:sc,_GNUNET_CRYPTO_rsa_public_key_decode:Wc,_GNUNET_CRYPTO_rsa_public_key_encode:Vc,___remdi3:Kw,_GNUNET_CRYPTO_hash:wc,_GNUNET_CRYPTO_rsa_signature_decode:dd,___uremdi3:Rw,_GNUNET_util_cl_init:Vb,_GNUNET_CRYPTO_random_init:Ic,_gpg_err_init:nt,runPostSets:Ew,stackAlloc:Db,stackSave:Eb,stackRestore:Fb,establishStackSpace:Gb,setThrew:Hb,setTempRet0:Ib,getTempRet0:Jb,dynCall_iiii:Zw,dynCall_viiiii:_w,dynCall_vi:$w,dynCall_vii:ax,dynCall_ii:bx,dynCall_viii:cx,dynCall_v:dx,dynCall_iiiii:ex,dynCall_viiiiii:fx,dynCall_iii:gx,dynCall_viiii:hx}})
+
+
+// EMSCRIPTEN_END_ASM
+(Module.asmGlobalArg,Module.asmLibraryArg,buffer);var real__GNUNET_CRYPTO_rsa_signature_encode=asm["_GNUNET_CRYPTO_rsa_signature_encode"];asm["_GNUNET_CRYPTO_rsa_signature_encode"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__GNUNET_CRYPTO_rsa_signature_encode.apply(null,arguments)});var real__GNUNET_CRYPTO_rsa_verify=asm["_GNUNET_CRYPTO_rsa_verify"];asm["_GNUNET_CRYPTO_rsa_verify"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__GNUNET_CRYPTO_rsa_verify.apply(null,arguments)});var real____uremdi3=asm["___uremdi3"];asm["___uremdi3"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real____uremdi3.apply(null,arguments)});var real__GNUNET_STRINGS_string_to_data=asm["_GNUNET_STRINGS_string_to_data"];asm["_GNUNET_STRINGS_string_to_data"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__GNUNET_STRINGS_string_to_data.apply(null,arguments)});var real__i64Subtract=asm["_i64Subtract"];asm["_i64Subtract"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__i64Subtract.apply(null,arguments)});var real__GNUNET_CRYPTO_rsa_private_key_get_public=asm["_GNUNET_CRYPTO_rsa_private_key_get_public"];asm["_GNUNET_CRYPTO_rsa_private_key_get_public"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__GNUNET_CRYPTO_rsa_private_key_get_public.apply(null,arguments)});var real__TALER_WRALL_get_amount=asm["_TALER_WRALL_get_amount"];asm["_TALER_WRALL_get_amount"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__TALER_WRALL_get_amount.apply(null,arguments)});var real__GNUNET_CRYPTO_eddsa_verify=asm["_GNUNET_CRYPTO_eddsa_verify"];asm["_GNUNET_CRYPTO_eddsa_verify"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__GNUNET_CRYPTO_eddsa_verify.apply(null,arguments)});var real__GNUNET_util_cl_init=asm["_GNUNET_util_cl_init"];asm["_GNUNET_util_cl_init"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__GNUNET_util_cl_init.apply(null,arguments)});var real__TALER_amount_normalize=asm["_TALER_amount_normalize"];asm["_TALER_amount_normalize"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__TALER_amount_normalize.apply(null,arguments)});var real__bitshift64Lshr=asm["_bitshift64Lshr"];asm["_bitshift64Lshr"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__bitshift64Lshr.apply(null,arguments)});var real__TALER_WR_get_fraction=asm["_TALER_WR_get_fraction"];asm["_TALER_WR_get_fraction"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__TALER_WR_get_fraction.apply(null,arguments)});var real__GNUNET_CRYPTO_rsa_unblind=asm["_GNUNET_CRYPTO_rsa_unblind"];asm["_GNUNET_CRYPTO_rsa_unblind"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__GNUNET_CRYPTO_rsa_unblind.apply(null,arguments)});var real__TALER_amount_cmp=asm["_TALER_amount_cmp"];asm["_TALER_amount_cmp"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__TALER_amount_cmp.apply(null,arguments)});var real__bitshift64Shl=asm["_bitshift64Shl"];asm["_bitshift64Shl"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__bitshift64Shl.apply(null,arguments)});var real__TALER_WR_get_currency=asm["_TALER_WR_get_currency"];asm["_TALER_WR_get_currency"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__TALER_WR_get_currency.apply(null,arguments)});var real__GNUNET_CRYPTO_rsa_private_key_free=asm["_GNUNET_CRYPTO_rsa_private_key_free"];asm["_GNUNET_CRYPTO_rsa_private_key_free"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__GNUNET_CRYPTO_rsa_private_key_free.apply(null,arguments)});var real__fflush=asm["_fflush"];asm["_fflush"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__fflush.apply(null,arguments)});var real__GNUNET_CRYPTO_hash_create_random=asm["_GNUNET_CRYPTO_hash_create_random"];asm["_GNUNET_CRYPTO_hash_create_random"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__GNUNET_CRYPTO_hash_create_random.apply(null,arguments)});var real__bitshift64Ashr=asm["_bitshift64Ashr"];asm["_bitshift64Ashr"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__bitshift64Ashr.apply(null,arguments)});var real__GNUNET_CRYPTO_eddsa_key_create=asm["_GNUNET_CRYPTO_eddsa_key_create"];asm["_GNUNET_CRYPTO_eddsa_key_create"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__GNUNET_CRYPTO_eddsa_key_create.apply(null,arguments)});var real__TALER_WRALL_eddsa_public_key_from_private=asm["_TALER_WRALL_eddsa_public_key_from_private"];asm["_TALER_WRALL_eddsa_public_key_from_private"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__TALER_WRALL_eddsa_public_key_from_private.apply(null,arguments)});var real____errno_location=asm["___errno_location"];asm["___errno_location"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real____errno_location.apply(null,arguments)});var real____muldi3=asm["___muldi3"];asm["___muldi3"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real____muldi3.apply(null,arguments)});var real__GNUNET_CRYPTO_ecc_ecdh=asm["_GNUNET_CRYPTO_ecc_ecdh"];asm["_GNUNET_CRYPTO_ecc_ecdh"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__GNUNET_CRYPTO_ecc_ecdh.apply(null,arguments)});var real__GNUNET_CRYPTO_rsa_private_key_decode=asm["_GNUNET_CRYPTO_rsa_private_key_decode"];asm["_GNUNET_CRYPTO_rsa_private_key_decode"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__GNUNET_CRYPTO_rsa_private_key_decode.apply(null,arguments)});var real__GNUNET_CRYPTO_symmetric_encrypt=asm["_GNUNET_CRYPTO_symmetric_encrypt"];asm["_GNUNET_CRYPTO_symmetric_encrypt"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__GNUNET_CRYPTO_symmetric_encrypt.apply(null,arguments)});var real__GNUNET_CRYPTO_ecdhe_key_get_public=asm["_GNUNET_CRYPTO_ecdhe_key_get_public"];asm["_GNUNET_CRYPTO_ecdhe_key_get_public"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__GNUNET_CRYPTO_ecdhe_key_get_public.apply(null,arguments)});var real____divdi3=asm["___divdi3"];asm["___divdi3"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real____divdi3.apply(null,arguments)});var real__TALER_amount_ntoh=asm["_TALER_amount_ntoh"];asm["_TALER_amount_ntoh"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__TALER_amount_ntoh.apply(null,arguments)});var real__llvm_cttz_i32=asm["_llvm_cttz_i32"];asm["_llvm_cttz_i32"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__llvm_cttz_i32.apply(null,arguments)});var real__GNUNET_CRYPTO_ecdhe_key_create=asm["_GNUNET_CRYPTO_ecdhe_key_create"];asm["_GNUNET_CRYPTO_ecdhe_key_create"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__GNUNET_CRYPTO_ecdhe_key_create.apply(null,arguments)});var real__TALER_amount_subtract=asm["_TALER_amount_subtract"];asm["_TALER_amount_subtract"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__TALER_amount_subtract.apply(null,arguments)});var real____udivmoddi4=asm["___udivmoddi4"];asm["___udivmoddi4"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real____udivmoddi4.apply(null,arguments)});var real__GNUNET_CRYPTO_rsa_private_key_create=asm["_GNUNET_CRYPTO_rsa_private_key_create"];asm["_GNUNET_CRYPTO_rsa_private_key_create"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__GNUNET_CRYPTO_rsa_private_key_create.apply(null,arguments)});var real__i64Add=asm["_i64Add"];asm["_i64Add"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__i64Add.apply(null,arguments)});var real__GNUNET_CRYPTO_rsa_signature_free=asm["_GNUNET_CRYPTO_rsa_signature_free"];asm["_GNUNET_CRYPTO_rsa_signature_free"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__GNUNET_CRYPTO_rsa_signature_free.apply(null,arguments)});var real__pthread_self=asm["_pthread_self"];asm["_pthread_self"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__pthread_self.apply(null,arguments)});var real__pthread_mutex_unlock=asm["_pthread_mutex_unlock"];asm["_pthread_mutex_unlock"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__pthread_mutex_unlock.apply(null,arguments)});var real__TALER_WRALL_purpose_create=asm["_TALER_WRALL_purpose_create"];asm["_TALER_WRALL_purpose_create"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__TALER_WRALL_purpose_create.apply(null,arguments)});var real__gpg_err_init=asm["_gpg_err_init"];asm["_gpg_err_init"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__gpg_err_init.apply(null,arguments)});var real__GNUNET_CRYPTO_hkdf=asm["_GNUNET_CRYPTO_hkdf"];asm["_GNUNET_CRYPTO_hkdf"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__GNUNET_CRYPTO_hkdf.apply(null,arguments)});var real__TALER_amount_hton=asm["_TALER_amount_hton"];asm["_TALER_amount_hton"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__TALER_amount_hton.apply(null,arguments)});var real__GNUNET_CRYPTO_rsa_public_key_free=asm["_GNUNET_CRYPTO_rsa_public_key_free"];asm["_GNUNET_CRYPTO_rsa_public_key_free"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__GNUNET_CRYPTO_rsa_public_key_free.apply(null,arguments)});var real__GNUNET_CRYPTO_rsa_private_key_encode=asm["_GNUNET_CRYPTO_rsa_private_key_encode"];asm["_GNUNET_CRYPTO_rsa_private_key_encode"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__GNUNET_CRYPTO_rsa_private_key_encode.apply(null,arguments)});var real__GNUNET_CRYPTO_eddsa_key_get_public=asm["_GNUNET_CRYPTO_eddsa_key_get_public"];asm["_GNUNET_CRYPTO_eddsa_key_get_public"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__GNUNET_CRYPTO_eddsa_key_get_public.apply(null,arguments)});var real____udivdi3=asm["___udivdi3"];asm["___udivdi3"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real____udivdi3.apply(null,arguments)});var real__llvm_bswap_i32=asm["_llvm_bswap_i32"];asm["_llvm_bswap_i32"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__llvm_bswap_i32.apply(null,arguments)});var real____muldsi3=asm["___muldsi3"];asm["___muldsi3"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real____muldsi3.apply(null,arguments)});var real__GNUNET_CRYPTO_rsa_blind=asm["_GNUNET_CRYPTO_rsa_blind"];asm["_GNUNET_CRYPTO_rsa_blind"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__GNUNET_CRYPTO_rsa_blind.apply(null,arguments)});var real__TALER_amount_add=asm["_TALER_amount_add"];asm["_TALER_amount_add"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__TALER_amount_add.apply(null,arguments)});var real__free=asm["_free"];asm["_free"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__free.apply(null,arguments)});var real__GNUNET_STRINGS_data_to_string_alloc=asm["_GNUNET_STRINGS_data_to_string_alloc"];asm["_GNUNET_STRINGS_data_to_string_alloc"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__GNUNET_STRINGS_data_to_string_alloc.apply(null,arguments)});var real__GNUNET_CRYPTO_symmetric_decrypt=asm["_GNUNET_CRYPTO_symmetric_decrypt"];asm["_GNUNET_CRYPTO_symmetric_decrypt"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__GNUNET_CRYPTO_symmetric_decrypt.apply(null,arguments)});var real__GNUNET_CRYPTO_random_init=asm["_GNUNET_CRYPTO_random_init"];asm["_GNUNET_CRYPTO_random_init"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__GNUNET_CRYPTO_random_init.apply(null,arguments)});var real__GNUNET_CRYPTO_random_block=asm["_GNUNET_CRYPTO_random_block"];asm["_GNUNET_CRYPTO_random_block"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__GNUNET_CRYPTO_random_block.apply(null,arguments)});var real__TALER_amount_get_zero=asm["_TALER_amount_get_zero"];asm["_TALER_amount_get_zero"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__TALER_amount_get_zero.apply(null,arguments)});var real__malloc=asm["_malloc"];asm["_malloc"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__malloc.apply(null,arguments)});var real__pthread_mutex_lock=asm["_pthread_mutex_lock"];asm["_pthread_mutex_lock"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__pthread_mutex_lock.apply(null,arguments)});var real__GNUNET_CRYPTO_eddsa_sign=asm["_GNUNET_CRYPTO_eddsa_sign"];asm["_GNUNET_CRYPTO_eddsa_sign"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__GNUNET_CRYPTO_eddsa_sign.apply(null,arguments)});var real__GNUNET_CRYPTO_rsa_public_key_decode=asm["_GNUNET_CRYPTO_rsa_public_key_decode"];asm["_GNUNET_CRYPTO_rsa_public_key_decode"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__GNUNET_CRYPTO_rsa_public_key_decode.apply(null,arguments)});var real__memmove=asm["_memmove"];asm["_memmove"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__memmove.apply(null,arguments)});var real__GNUNET_CRYPTO_rsa_public_key_encode=asm["_GNUNET_CRYPTO_rsa_public_key_encode"];asm["_GNUNET_CRYPTO_rsa_public_key_encode"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__GNUNET_CRYPTO_rsa_public_key_encode.apply(null,arguments)});var real____remdi3=asm["___remdi3"];asm["___remdi3"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real____remdi3.apply(null,arguments)});var real__GNUNET_CRYPTO_hash=asm["_GNUNET_CRYPTO_hash"];asm["_GNUNET_CRYPTO_hash"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__GNUNET_CRYPTO_hash.apply(null,arguments)});var real__TALER_WR_get_value=asm["_TALER_WR_get_value"];asm["_TALER_WR_get_value"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__TALER_WR_get_value.apply(null,arguments)});var real__GNUNET_CRYPTO_rsa_signature_decode=asm["_GNUNET_CRYPTO_rsa_signature_decode"];asm["_GNUNET_CRYPTO_rsa_signature_decode"]=(function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return real__GNUNET_CRYPTO_rsa_signature_decode.apply(null,arguments)});var _GNUNET_CRYPTO_rsa_signature_encode=Module["_GNUNET_CRYPTO_rsa_signature_encode"]=asm["_GNUNET_CRYPTO_rsa_signature_encode"];var _GNUNET_CRYPTO_rsa_verify=Module["_GNUNET_CRYPTO_rsa_verify"]=asm["_GNUNET_CRYPTO_rsa_verify"];var ___uremdi3=Module["___uremdi3"]=asm["___uremdi3"];var _GNUNET_STRINGS_string_to_data=Module["_GNUNET_STRINGS_string_to_data"]=asm["_GNUNET_STRINGS_string_to_data"];var _i64Subtract=Module["_i64Subtract"]=asm["_i64Subtract"];var _GNUNET_CRYPTO_rsa_private_key_get_public=Module["_GNUNET_CRYPTO_rsa_private_key_get_public"]=asm["_GNUNET_CRYPTO_rsa_private_key_get_public"];var _TALER_WRALL_get_amount=Module["_TALER_WRALL_get_amount"]=asm["_TALER_WRALL_get_amount"];var _GNUNET_CRYPTO_eddsa_verify=Module["_GNUNET_CRYPTO_eddsa_verify"]=asm["_GNUNET_CRYPTO_eddsa_verify"];var _GNUNET_util_cl_init=Module["_GNUNET_util_cl_init"]=asm["_GNUNET_util_cl_init"];var _TALER_amount_normalize=Module["_TALER_amount_normalize"]=asm["_TALER_amount_normalize"];var _bitshift64Lshr=Module["_bitshift64Lshr"]=asm["_bitshift64Lshr"];var _TALER_WR_get_fraction=Module["_TALER_WR_get_fraction"]=asm["_TALER_WR_get_fraction"];var _GNUNET_CRYPTO_rsa_unblind=Module["_GNUNET_CRYPTO_rsa_unblind"]=asm["_GNUNET_CRYPTO_rsa_unblind"];var _TALER_amount_cmp=Module["_TALER_amount_cmp"]=asm["_TALER_amount_cmp"];var _bitshift64Shl=Module["_bitshift64Shl"]=asm["_bitshift64Shl"];var _TALER_WR_get_currency=Module["_TALER_WR_get_currency"]=asm["_TALER_WR_get_currency"];var _GNUNET_CRYPTO_rsa_private_key_free=Module["_GNUNET_CRYPTO_rsa_private_key_free"]=asm["_GNUNET_CRYPTO_rsa_private_key_free"];var _fflush=Module["_fflush"]=asm["_fflush"];var _GNUNET_CRYPTO_hash_create_random=Module["_GNUNET_CRYPTO_hash_create_random"]=asm["_GNUNET_CRYPTO_hash_create_random"];var _bitshift64Ashr=Module["_bitshift64Ashr"]=asm["_bitshift64Ashr"];var _memset=Module["_memset"]=asm["_memset"];var _GNUNET_CRYPTO_eddsa_key_create=Module["_GNUNET_CRYPTO_eddsa_key_create"]=asm["_GNUNET_CRYPTO_eddsa_key_create"];var _TALER_WRALL_eddsa_public_key_from_private=Module["_TALER_WRALL_eddsa_public_key_from_private"]=asm["_TALER_WRALL_eddsa_public_key_from_private"];var ___errno_location=Module["___errno_location"]=asm["___errno_location"];var ___muldi3=Module["___muldi3"]=asm["___muldi3"];var _GNUNET_CRYPTO_ecc_ecdh=Module["_GNUNET_CRYPTO_ecc_ecdh"]=asm["_GNUNET_CRYPTO_ecc_ecdh"];var _GNUNET_CRYPTO_rsa_private_key_decode=Module["_GNUNET_CRYPTO_rsa_private_key_decode"]=asm["_GNUNET_CRYPTO_rsa_private_key_decode"];var _GNUNET_CRYPTO_symmetric_encrypt=Module["_GNUNET_CRYPTO_symmetric_encrypt"]=asm["_GNUNET_CRYPTO_symmetric_encrypt"];var _GNUNET_CRYPTO_ecdhe_key_get_public=Module["_GNUNET_CRYPTO_ecdhe_key_get_public"]=asm["_GNUNET_CRYPTO_ecdhe_key_get_public"];var ___divdi3=Module["___divdi3"]=asm["___divdi3"];var _TALER_amount_ntoh=Module["_TALER_amount_ntoh"]=asm["_TALER_amount_ntoh"];var _llvm_cttz_i32=Module["_llvm_cttz_i32"]=asm["_llvm_cttz_i32"];var _GNUNET_CRYPTO_ecdhe_key_create=Module["_GNUNET_CRYPTO_ecdhe_key_create"]=asm["_GNUNET_CRYPTO_ecdhe_key_create"];var _TALER_amount_subtract=Module["_TALER_amount_subtract"]=asm["_TALER_amount_subtract"];var ___udivmoddi4=Module["___udivmoddi4"]=asm["___udivmoddi4"];var _GNUNET_CRYPTO_rsa_private_key_create=Module["_GNUNET_CRYPTO_rsa_private_key_create"]=asm["_GNUNET_CRYPTO_rsa_private_key_create"];var _i64Add=Module["_i64Add"]=asm["_i64Add"];var _GNUNET_CRYPTO_rsa_signature_free=Module["_GNUNET_CRYPTO_rsa_signature_free"]=asm["_GNUNET_CRYPTO_rsa_signature_free"];var _pthread_self=Module["_pthread_self"]=asm["_pthread_self"];var _pthread_mutex_unlock=Module["_pthread_mutex_unlock"]=asm["_pthread_mutex_unlock"];var _TALER_WRALL_purpose_create=Module["_TALER_WRALL_purpose_create"]=asm["_TALER_WRALL_purpose_create"];var _gpg_err_init=Module["_gpg_err_init"]=asm["_gpg_err_init"];var _GNUNET_CRYPTO_hkdf=Module["_GNUNET_CRYPTO_hkdf"]=asm["_GNUNET_CRYPTO_hkdf"];var _TALER_amount_hton=Module["_TALER_amount_hton"]=asm["_TALER_amount_hton"];var _GNUNET_CRYPTO_rsa_public_key_free=Module["_GNUNET_CRYPTO_rsa_public_key_free"]=asm["_GNUNET_CRYPTO_rsa_public_key_free"];var _GNUNET_CRYPTO_rsa_private_key_encode=Module["_GNUNET_CRYPTO_rsa_private_key_encode"]=asm["_GNUNET_CRYPTO_rsa_private_key_encode"];var _GNUNET_CRYPTO_eddsa_key_get_public=Module["_GNUNET_CRYPTO_eddsa_key_get_public"]=asm["_GNUNET_CRYPTO_eddsa_key_get_public"];var ___udivdi3=Module["___udivdi3"]=asm["___udivdi3"];var _llvm_bswap_i32=Module["_llvm_bswap_i32"]=asm["_llvm_bswap_i32"];var ___muldsi3=Module["___muldsi3"]=asm["___muldsi3"];var _GNUNET_CRYPTO_rsa_blind=Module["_GNUNET_CRYPTO_rsa_blind"]=asm["_GNUNET_CRYPTO_rsa_blind"];var _TALER_amount_add=Module["_TALER_amount_add"]=asm["_TALER_amount_add"];var _free=Module["_free"]=asm["_free"];var runPostSets=Module["runPostSets"]=asm["runPostSets"];var _GNUNET_STRINGS_data_to_string_alloc=Module["_GNUNET_STRINGS_data_to_string_alloc"]=asm["_GNUNET_STRINGS_data_to_string_alloc"];var _GNUNET_CRYPTO_symmetric_decrypt=Module["_GNUNET_CRYPTO_symmetric_decrypt"]=asm["_GNUNET_CRYPTO_symmetric_decrypt"];var _GNUNET_CRYPTO_random_init=Module["_GNUNET_CRYPTO_random_init"]=asm["_GNUNET_CRYPTO_random_init"];var _GNUNET_CRYPTO_random_block=Module["_GNUNET_CRYPTO_random_block"]=asm["_GNUNET_CRYPTO_random_block"];var _TALER_amount_get_zero=Module["_TALER_amount_get_zero"]=asm["_TALER_amount_get_zero"];var _malloc=Module["_malloc"]=asm["_malloc"];var _memcpy=Module["_memcpy"]=asm["_memcpy"];var _pthread_mutex_lock=Module["_pthread_mutex_lock"]=asm["_pthread_mutex_lock"];var _GNUNET_CRYPTO_eddsa_sign=Module["_GNUNET_CRYPTO_eddsa_sign"]=asm["_GNUNET_CRYPTO_eddsa_sign"];var _GNUNET_CRYPTO_rsa_public_key_decode=Module["_GNUNET_CRYPTO_rsa_public_key_decode"]=asm["_GNUNET_CRYPTO_rsa_public_key_decode"];var _memmove=Module["_memmove"]=asm["_memmove"];var _GNUNET_CRYPTO_rsa_public_key_encode=Module["_GNUNET_CRYPTO_rsa_public_key_encode"]=asm["_GNUNET_CRYPTO_rsa_public_key_encode"];var ___remdi3=Module["___remdi3"]=asm["___remdi3"];var _GNUNET_CRYPTO_hash=Module["_GNUNET_CRYPTO_hash"]=asm["_GNUNET_CRYPTO_hash"];var _TALER_WR_get_value=Module["_TALER_WR_get_value"]=asm["_TALER_WR_get_value"];var _GNUNET_CRYPTO_rsa_signature_decode=Module["_GNUNET_CRYPTO_rsa_signature_decode"]=asm["_GNUNET_CRYPTO_rsa_signature_decode"];var dynCall_iiii=Module["dynCall_iiii"]=asm["dynCall_iiii"];var dynCall_viiiii=Module["dynCall_viiiii"]=asm["dynCall_viiiii"];var dynCall_vi=Module["dynCall_vi"]=asm["dynCall_vi"];var dynCall_vii=Module["dynCall_vii"]=asm["dynCall_vii"];var dynCall_ii=Module["dynCall_ii"]=asm["dynCall_ii"];var dynCall_viii=Module["dynCall_viii"]=asm["dynCall_viii"];var dynCall_v=Module["dynCall_v"]=asm["dynCall_v"];var dynCall_iiiii=Module["dynCall_iiiii"]=asm["dynCall_iiiii"];var dynCall_viiiiii=Module["dynCall_viiiiii"]=asm["dynCall_viiiiii"];var dynCall_iii=Module["dynCall_iii"]=asm["dynCall_iii"];var dynCall_viiii=Module["dynCall_viiii"]=asm["dynCall_viiii"];Runtime.stackAlloc=asm["stackAlloc"];Runtime.stackSave=asm["stackSave"];Runtime.stackRestore=asm["stackRestore"];Runtime.establishStackSpace=asm["establishStackSpace"];Runtime.setTempRet0=asm["setTempRet0"];Runtime.getTempRet0=asm["getTempRet0"];function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}ExitStatus.prototype=new Error;ExitStatus.prototype.constructor=ExitStatus;var initialStackTop;var preloadStartTime=null;var calledMain=false;dependenciesFulfilled=function runCaller(){if(!Module["calledRun"])run();if(!Module["calledRun"])dependenciesFulfilled=runCaller};Module["callMain"]=Module.callMain=function callMain(args){assert(runDependencies==0,"cannot call main when async dependencies remain! (listen on __ATMAIN__)");assert(__ATPRERUN__.length==0,"cannot call main when preRun functions remain to be called");args=args||[];ensureInitRuntime();var argc=args.length+1;function pad(){for(var i=0;i<4-1;i++){argv.push(0)}}var argv=[allocate(intArrayFromString(Module["thisProgram"]),"i8",ALLOC_NORMAL)];pad();for(var i=0;i<argc-1;i=i+1){argv.push(allocate(intArrayFromString(args[i]),"i8",ALLOC_NORMAL));pad()}argv.push(0);argv=allocate(argv,"i32",ALLOC_NORMAL);try{var ret=Module["_main"](argc,argv,0);exit(ret,true)}catch(e){if(e instanceof ExitStatus){return}else if(e=="SimulateInfiniteLoop"){Module["noExitRuntime"]=true;return}else{if(e&&typeof e==="object"&&e.stack)Module.printErr("exception thrown: "+[e,e.stack]);throw e}}finally{calledMain=true}};function run(args){args=args||Module["arguments"];if(preloadStartTime===null)preloadStartTime=Date.now();if(runDependencies>0){Module.printErr("run() called, but dependencies remain, so not running");return}writeStackCookie();preRun();if(runDependencies>0)return;if(Module["calledRun"])return;function doRun(){if(Module["calledRun"])return;Module["calledRun"]=true;if(ABORT)return;ensureInitRuntime();preMain();if(ENVIRONMENT_IS_WEB&&preloadStartTime!==null){Module.printErr("pre-main prep time: "+(Date.now()-preloadStartTime)+" ms")}if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();if(Module["_main"]&&shouldRunNow)Module["callMain"](args);postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout((function(){setTimeout((function(){Module["setStatus"]("")}),1);doRun()}),1)}else{doRun()}checkStackCookie()}Module["run"]=Module.run=run;function exit(status,implicit){if(implicit&&Module["noExitRuntime"]){Module.printErr("exit("+status+") implicitly called by end of main(), but noExitRuntime, so not exiting the runtime (you can use emscripten_force_exit, if you want to force a true shutdown)");return}if(Module["noExitRuntime"]){Module.printErr("exit("+status+") called, but noExitRuntime, so halting execution but not exiting the runtime or preventing further async execution (you can use emscripten_force_exit, if you want to force a true shutdown)")}else{ABORT=true;EXITSTATUS=status;STACKTOP=initialStackTop;exitRuntime();if(Module["onExit"])Module["onExit"](status)}if(ENVIRONMENT_IS_NODE){process["exit"](status)}else if(ENVIRONMENT_IS_SHELL&&typeof quit==="function"){quit(status)}throw new ExitStatus(status)}Module["exit"]=Module.exit=exit;var abortDecorators=[];function abort(what){if(what!==undefined){Module.print(what);Module.printErr(what);what=JSON.stringify(what)}else{what=""}ABORT=true;EXITSTATUS=1;var extra="";var output="abort("+what+") at "+stackTrace()+extra;if(abortDecorators){abortDecorators.forEach((function(decorator){output=decorator(output,what)}))}throw output}Module["abort"]=Module.abort=abort;if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}var shouldRunNow=true;if(Module["noInitialRun"]){shouldRunNow=false}run()
+
+
+
+
diff --git a/lib/i18n.ts b/lib/i18n.ts
new file mode 100644
index 000000000..c91b385a7
--- /dev/null
+++ b/lib/i18n.ts
@@ -0,0 +1,205 @@
+/*
+ This file is part of TALER
+ (C) 2016 GNUnet e.V.
+
+ TALER is free software; you can redistribute it and/or modify it under the
+ terms of the GNU General Public License as published by the Free Software
+ Foundation; either version 3, or (at your option) any later version.
+
+ TALER is distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along with
+ TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
+ */
+
+"use strict";
+
+document.addEventListener(
+ "DOMContentLoaded",
+ function () {
+ try {
+ document.body.lang = chrome.i18n.getUILanguage();
+ } catch (e) {
+ // chrome.* not available?
+ }
+ });
+
+declare var i18n: any;
+
+/**
+ * Information about the last two i18n results, used by plural()
+ * 2-element array, each element contains { stringFound: boolean, pluralValue: number }
+ */
+var i18nResult = <any>[];
+
+const JedModule: any = (window as any)["Jed"];
+var jed: any;
+
+
+class PluralNumber {
+ n: number;
+
+ constructor(n: number) {
+ this.n = n;
+ }
+
+ valueOf () {
+ return this.n;
+ }
+
+ toString () {
+ return this.n.toString();
+ }
+}
+
+
+/**
+ * Initialize Jed
+ */
+function init () {
+ if ("object" === typeof jed) {
+ return;
+ }
+ if ("function" !== typeof JedModule) {
+ return;
+ }
+ if (!(i18n.lang in i18n.strings)) {
+ i18n.lang = "en-US";
+ return;
+ }
+ jed = new JedModule(i18n.strings[i18n.lang]);
+}
+
+
+/**
+ * Convert template strings to a msgid
+ */
+function toI18nString(strings: string[]) {
+ let str = "";
+ for (let i = 0; i < strings.length; i++) {
+ str += strings[i];
+ if (i < strings.length - 1) {
+ str += "%"+ (i+1) +"$s";
+ }
+ }
+ return str;
+}
+
+
+/**
+ * Use the first number in values to determine plural form
+ */
+function getPluralValue (values: any) {
+ let n = null;
+ for (let i = 0; i < values.length; i++) {
+ if ("number" === typeof values[i] || values[i] instanceof PluralNumber) {
+ if (null === n || values[i] instanceof PluralNumber) {
+ n = values[i].valueOf();
+ }
+ }
+ }
+ return (null === n) ? 1 : n;
+}
+
+
+/**
+ * Store information about the result of the last to i18n() or i18n.parts()
+ *
+ * @param i18nString the string template as found in i18n.strings
+ * @param pluralValue value returned by getPluralValue()
+ */
+function setI18nResult (i18nString: string, pluralValue: number) {
+ i18nResult[1] = i18nResult[0];
+ i18nResult[0] = {
+ stringFound: i18nString in i18n.strings[i18n.lang].locale_data[i18n.lang],
+ pluralValue: pluralValue
+ };
+}
+
+
+/**
+ * Internationalize a string template with arbitrary serialized values.
+ */
+var i18n = <any>function i18n(strings: string[], ...values: any[]) {
+ init();
+ //console.log('i18n:', strings, values);
+ if ("object" !== typeof jed) {
+ // Fallback implementation in case i18n lib is not there
+ return String.raw(strings as any, ...values);
+ }
+
+ let str = toI18nString (strings);
+ let n = getPluralValue (values);
+ let tr = jed.translate(str).ifPlural(n, str).fetch(...values);
+
+ setI18nResult (str, n);
+ return tr;
+};
+
+try {
+ i18n.lang = chrome.i18n.getUILanguage();
+} catch (e) {
+ console.warn("i18n default language not available");
+}
+i18n.strings = {};
+
+
+/**
+ * Interpolate i18nized values with arbitrary objects.
+ * @return Array of strings/objects.
+ */
+i18n.parts = function(strings: string[], ...values: any[]) {
+ init();
+ if ("object" !== typeof jed) {
+ // Fallback implementation in case i18n lib is not there
+ let parts: string[] = [];
+
+ for (let i = 0; i < strings.length; i++) {
+ parts.push(strings[i]);
+ if (i < values.length) {
+ parts.push(values[i]);
+ }
+ }
+ return parts;
+ }
+
+ let str = toI18nString (strings);
+ let n = getPluralValue (values);
+ let tr = jed.ngettext(str, str, n).split(/%(\d+)\$s/);
+ let parts: string[] = [];
+ for (let i = 0; i < tr.length; i++) {
+ if (0 == i % 2) {
+ parts.push(tr[i]);
+ } else {
+ parts.push(values[parseInt(tr[i]) - 1]);
+ }
+ }
+
+ setI18nResult (str, n);
+ return parts;
+};
+
+
+/**
+ * Pluralize based on first numeric parameter in the template.
+ * @todo The plural argument is used for extraction by pogen.js
+ */
+i18n.plural = function (singular: any, plural: any) {
+ if (i18nResult[1].stringFound) { // string found in translation file?
+ // 'singular' has the correctly translated & pluralized text
+ return singular;
+ } else {
+ // return appropriate form based on value found in 'singular'
+ return (1 == i18nResult[1].pluralValue) ? singular : plural;
+ }
+};
+
+
+/**
+ * Return a number that is used to determine the plural form for a template.
+ */
+i18n.number = function (n : number) {
+ return new PluralNumber (n);
+};
diff --git a/lib/module-trampoline.js b/lib/module-trampoline.js
new file mode 100644
index 000000000..73e8ca72d
--- /dev/null
+++ b/lib/module-trampoline.js
@@ -0,0 +1,80 @@
+/*
+ This file is part of TALER
+ (C) 2016 GNUnet e.V.
+
+ TALER is free software; you can redistribute it and/or modify it under the
+ terms of the GNU General Public License as published by the Free Software
+ Foundation; either version 3, or (at your option) any later version.
+
+ TALER is distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along with
+ TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
+ */
+
+
+/**
+ * Boilerplate to initialize the module system and call main()
+ *
+ * @author Florian Dold
+ */
+
+"use strict";
+
+if (typeof System === "undefined") {
+ throw Error("system loader not present (must be included before the" +
+ " trampoline");
+}
+
+System.config({
+ defaultJSExtensions: true,
+});
+
+
+// Register mithril as a module,
+// but only if it is ambient.
+if (m) {
+ let mod = System.newModule({default: m});
+ let modName = "mithril";
+ System.set(modName, mod);
+}
+
+
+let me = window.location.protocol
+ + "//" + window.location.host
+ + window.location.pathname.replace(/[.]html$/, ".js");
+
+let domLoaded = false;
+
+document.addEventListener("DOMContentLoaded", function(event) {
+ domLoaded = true;
+});
+
+function execMain(m) {
+ if (m.main) {
+ console.log("executing module main");
+ m.main();
+ } else {
+ console.warn("module does not export a main() function");
+ }
+}
+
+console.log("loading", me);
+
+System.import(me)
+ .then((m) => {
+ console.log("module imported", me);
+ if (domLoaded) {
+ execMain(m);
+ return;
+ }
+ document.addEventListener("DOMContentLoaded", function(event) {
+ execMain(m);
+ });
+ })
+ .catch((e) => {
+ console.log("trampoline failed");
+ console.error(e.stack);
+ });
diff --git a/lib/refs.ts b/lib/refs.ts
new file mode 100644
index 000000000..a9c2c5eb8
--- /dev/null
+++ b/lib/refs.ts
@@ -0,0 +1,6 @@
+
+// Help the TypeScript compiler find declarations.
+
+/// <reference path="decl/lib.es6.d.ts" />
+/// <reference path="decl/urijs/URIjs.d.ts" />
+/// <reference path="decl/systemjs/systemjs.d.ts" />
diff --git a/lib/shopApi.ts b/lib/shopApi.ts
new file mode 100644
index 000000000..7cc37a9db
--- /dev/null
+++ b/lib/shopApi.ts
@@ -0,0 +1,169 @@
+/*
+ This file is part of TALER
+ (C) 2015 GNUnet e.V.
+
+ TALER is free software; you can redistribute it and/or modify it under the
+ terms of the GNU General Public License as published by the Free Software
+ Foundation; either version 3, or (at your option) any later version.
+
+ TALER is distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along with
+ TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
+ */
+
+
+/**
+ * Implementation of the shop API, either invoked via HTTP or
+ * via a JS DOM Events.
+ *
+ * @author Florian Dold
+ */
+
+
+
+function subst(url: string, H_contract: string) {
+ url = url.replace("${H_contract}", H_contract);
+ url = url.replace("${$}", "$");
+ return url;
+}
+
+export function createReserve(amount: any, callback_url: any, wt_types: any) {
+ let params = {
+ amount: JSON.stringify(amount),
+ callback_url: URI(callback_url)
+ .absoluteTo(document.location.href),
+ bank_url: document.location.href,
+ wt_types: JSON.stringify(wt_types),
+ };
+ let uri = URI(chrome.extension.getURL("pages/confirm-create-reserve.html"));
+ document.location.href = uri.query(params).href();
+}
+
+export function confirmContract(contract_wrapper: any, replace_navigation: any) {
+ if (contract_wrapper) {
+ console.error("contract wrapper missing");
+ return;
+ }
+
+ const offer = contract_wrapper;
+
+ if (!offer.contract) {
+ console.error("contract field missing");
+ return;
+ }
+
+ const msg = {
+ type: "check-repurchase",
+ detail: {
+ contract: offer.contract
+ },
+ };
+
+ chrome.runtime.sendMessage(msg, (resp) => {
+ if (resp.error) {
+ console.error("wallet backend error", resp);
+ return;
+ }
+ if (resp.isRepurchase) {
+ console.log("doing repurchase");
+ console.assert(resp.existingFulfillmentUrl);
+ console.assert(resp.existingContractHash);
+ window.location.href = subst(resp.existingFulfillmentUrl,
+ resp.existingContractHash);
+
+ } else {
+ const uri = URI(chrome.extension.getURL("pages/confirm-contract.html"));
+ const params = {
+ offer: JSON.stringify(offer),
+ merchantPageUrl: document.location.href,
+ };
+ const target = uri.query(params).href();
+ if (replace_navigation === true) {
+ document.location.replace(target);
+ } else {
+ document.location.href = target;
+ }
+ }
+ });
+}
+
+
+/**
+ * Fetch a payment (coin deposit permissions) for a given contract.
+ * If we don't have the payment for the contract, redirect to
+ * offering url instead.
+ */
+export function fetchPayment(H_contract: any, offering_url: any) {
+ const msg = {
+ type: "fetch-payment",
+ detail: {H_contract},
+ };
+
+ chrome.runtime.sendMessage(msg, (resp) => {
+ console.log("got resp");
+ console.dir(resp);
+ if (!resp.success) {
+ if (offering_url) {
+ console.log("offering url", offering_url);
+ window.location.href = offering_url;
+ } else {
+ console.error("fetch-payment failed");
+ }
+ return;
+ }
+ let contract = resp.contract;
+ if (!contract) {
+ throw Error("contract missing");
+ }
+
+ // We have the details for then payment, the merchant page
+ // is responsible to give it to the merchant.
+
+ let evt = new CustomEvent("taler-notify-payment", {
+ detail: {
+ H_contract: H_contract,
+ contract: resp.contract,
+ payment: resp.payReq,
+ }
+ });
+ document.dispatchEvent(evt);
+ });
+}
+
+
+/**
+ * Offer a contract to the wallet after
+ * downloading it from the given URL.
+ */
+function offerContractFrom(url: string) {
+ var contract_request = new XMLHttpRequest();
+ console.log("downloading contract from '" + url + "'");
+ contract_request.open("GET", url, true);
+ contract_request.onload = function (e) {
+ if (contract_request.readyState == 4) {
+ if (contract_request.status == 200) {
+ console.log("response text:",
+ contract_request.responseText);
+ var contract_wrapper = JSON.parse(contract_request.responseText);
+ if (!contract_wrapper) {
+ console.error("response text was invalid json");
+ alert("Failure to download contract (invalid json)");
+ return;
+ }
+ confirmContract(contract_wrapper, true);
+ } else {
+ alert("Failure to download contract from merchant " +
+ "(" + contract_request.status + "):\n" +
+ contract_request.responseText);
+ }
+ }
+ };
+ contract_request.onerror = function (e) {
+ alert("Failure requesting the contract:\n"
+ + contract_request.statusText);
+ };
+ contract_request.send();
+} \ No newline at end of file
diff --git a/lib/taler-wallet-lib.ts b/lib/taler-wallet-lib.ts
new file mode 120000
index 000000000..20e599359
--- /dev/null
+++ b/lib/taler-wallet-lib.ts
@@ -0,0 +1 @@
+../web-common/taler-wallet-lib.ts \ No newline at end of file
diff --git a/lib/vendor/URI.js b/lib/vendor/URI.js
new file mode 100644
index 000000000..c041b4304
--- /dev/null
+++ b/lib/vendor/URI.js
@@ -0,0 +1,2162 @@
+/*!
+ * URI.js - Mutating URLs
+ *
+ * Version: 1.17.0
+ *
+ * Author: Rodney Rehm
+ * Web: http://medialize.github.io/URI.js/
+ *
+ * Licensed under
+ * MIT License http://www.opensource.org/licenses/mit-license
+ * GPL v3 http://opensource.org/licenses/GPL-3.0
+ *
+ */
+(function (root, factory) {
+ 'use strict';
+ // https://github.com/umdjs/umd/blob/master/returnExports.js
+ if (typeof exports === 'object') {
+ // Node
+ module.exports = factory(require('./punycode'), require('./IPv6'), require('./SecondLevelDomains'));
+ } else if (typeof define === 'function' && define.amd) {
+ // AMD. Register as an anonymous module.
+ define(['./punycode', './IPv6', './SecondLevelDomains'], factory);
+ } else {
+ // Browser globals (root is window)
+ root.URI = factory(root.punycode, root.IPv6, root.SecondLevelDomains, root);
+ }
+}(this, function (punycode, IPv6, SLD, root) {
+ 'use strict';
+ /*global location, escape, unescape */
+ // FIXME: v2.0.0 renamce non-camelCase properties to uppercase
+ /*jshint camelcase: false */
+
+ // save current URI variable, if any
+ var _URI = root && root.URI;
+
+ function URI(url, base) {
+ var _urlSupplied = arguments.length >= 1;
+ var _baseSupplied = arguments.length >= 2;
+
+ // Allow instantiation without the 'new' keyword
+ if (!(this instanceof URI)) {
+ if (_urlSupplied) {
+ if (_baseSupplied) {
+ return new URI(url, base);
+ }
+
+ return new URI(url);
+ }
+
+ return new URI();
+ }
+
+ if (url === undefined) {
+ if (_urlSupplied) {
+ throw new TypeError('undefined is not a valid argument for URI');
+ }
+
+ if (typeof location !== 'undefined') {
+ url = location.href + '';
+ } else {
+ url = '';
+ }
+ }
+
+ this.href(url);
+
+ // resolve to base according to http://dvcs.w3.org/hg/url/raw-file/tip/Overview.html#constructor
+ if (base !== undefined) {
+ return this.absoluteTo(base);
+ }
+
+ return this;
+ }
+
+ URI.version = '1.17.0';
+
+ var p = URI.prototype;
+ var hasOwn = Object.prototype.hasOwnProperty;
+
+ function escapeRegEx(string) {
+ // https://github.com/medialize/URI.js/commit/85ac21783c11f8ccab06106dba9735a31a86924d#commitcomment-821963
+ return string.replace(/([.*+?^=!:${}()|[\]\/\\])/g, '\\$1');
+ }
+
+ function getType(value) {
+ // IE8 doesn't return [Object Undefined] but [Object Object] for undefined value
+ if (value === undefined) {
+ return 'Undefined';
+ }
+
+ return String(Object.prototype.toString.call(value)).slice(8, -1);
+ }
+
+ function isArray(obj) {
+ return getType(obj) === 'Array';
+ }
+
+ function filterArrayValues(data, value) {
+ var lookup = {};
+ var i, length;
+
+ if (getType(value) === 'RegExp') {
+ lookup = null;
+ } else if (isArray(value)) {
+ for (i = 0, length = value.length; i < length; i++) {
+ lookup[value[i]] = true;
+ }
+ } else {
+ lookup[value] = true;
+ }
+
+ for (i = 0, length = data.length; i < length; i++) {
+ /*jshint laxbreak: true */
+ var _match = lookup && lookup[data[i]] !== undefined
+ || !lookup && value.test(data[i]);
+ /*jshint laxbreak: false */
+ if (_match) {
+ data.splice(i, 1);
+ length--;
+ i--;
+ }
+ }
+
+ return data;
+ }
+
+ function arrayContains(list, value) {
+ var i, length;
+
+ // value may be string, number, array, regexp
+ if (isArray(value)) {
+ // Note: this can be optimized to O(n) (instead of current O(m * n))
+ for (i = 0, length = value.length; i < length; i++) {
+ if (!arrayContains(list, value[i])) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ var _type = getType(value);
+ for (i = 0, length = list.length; i < length; i++) {
+ if (_type === 'RegExp') {
+ if (typeof list[i] === 'string' && list[i].match(value)) {
+ return true;
+ }
+ } else if (list[i] === value) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ function arraysEqual(one, two) {
+ if (!isArray(one) || !isArray(two)) {
+ return false;
+ }
+
+ // arrays can't be equal if they have different amount of content
+ if (one.length !== two.length) {
+ return false;
+ }
+
+ one.sort();
+ two.sort();
+
+ for (var i = 0, l = one.length; i < l; i++) {
+ if (one[i] !== two[i]) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ function trimSlashes(text) {
+ var trim_expression = /^\/+|\/+$/g;
+ return text.replace(trim_expression, '');
+ }
+
+ URI._parts = function() {
+ return {
+ protocol: null,
+ username: null,
+ password: null,
+ hostname: null,
+ urn: null,
+ port: null,
+ path: null,
+ query: null,
+ fragment: null,
+ // state
+ duplicateQueryParameters: URI.duplicateQueryParameters,
+ escapeQuerySpace: URI.escapeQuerySpace
+ };
+ };
+ // state: allow duplicate query parameters (a=1&a=1)
+ URI.duplicateQueryParameters = false;
+ // state: replaces + with %20 (space in query strings)
+ URI.escapeQuerySpace = true;
+ // static properties
+ URI.protocol_expression = /^[a-z][a-z0-9.+-]*$/i;
+ URI.idn_expression = /[^a-z0-9\.-]/i;
+ URI.punycode_expression = /(xn--)/i;
+ // well, 333.444.555.666 matches, but it sure ain't no IPv4 - do we care?
+ URI.ip4_expression = /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/;
+ // credits to Rich Brown
+ // source: http://forums.intermapper.com/viewtopic.php?p=1096#1096
+ // specification: http://www.ietf.org/rfc/rfc4291.txt
+ URI.ip6_expression = /^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/;
+ // expression used is "gruber revised" (@gruber v2) determined to be the
+ // best solution in a regex-golf we did a couple of ages ago at
+ // * http://mathiasbynens.be/demo/url-regex
+ // * http://rodneyrehm.de/t/url-regex.html
+ URI.find_uri_expression = /\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/ig;
+ URI.findUri = {
+ // valid "scheme://" or "www."
+ start: /\b(?:([a-z][a-z0-9.+-]*:\/\/)|www\.)/gi,
+ // everything up to the next whitespace
+ end: /[\s\r\n]|$/,
+ // trim trailing punctuation captured by end RegExp
+ trim: /[`!()\[\]{};:'".,<>?«»“”„‘’]+$/
+ };
+ // http://www.iana.org/assignments/uri-schemes.html
+ // http://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers#Well-known_ports
+ URI.defaultPorts = {
+ http: '80',
+ https: '443',
+ ftp: '21',
+ gopher: '70',
+ ws: '80',
+ wss: '443'
+ };
+ // allowed hostname characters according to RFC 3986
+ // ALPHA DIGIT "-" "." "_" "~" "!" "$" "&" "'" "(" ")" "*" "+" "," ";" "=" %encoded
+ // I've never seen a (non-IDN) hostname other than: ALPHA DIGIT . -
+ URI.invalid_hostname_characters = /[^a-zA-Z0-9\.-]/;
+ // map DOM Elements to their URI attribute
+ URI.domAttributes = {
+ 'a': 'href',
+ 'blockquote': 'cite',
+ 'link': 'href',
+ 'base': 'href',
+ 'script': 'src',
+ 'form': 'action',
+ 'img': 'src',
+ 'area': 'href',
+ 'iframe': 'src',
+ 'embed': 'src',
+ 'source': 'src',
+ 'track': 'src',
+ 'input': 'src', // but only if type="image"
+ 'audio': 'src',
+ 'video': 'src'
+ };
+ URI.getDomAttribute = function(node) {
+ if (!node || !node.nodeName) {
+ return undefined;
+ }
+
+ var nodeName = node.nodeName.toLowerCase();
+ // <input> should only expose src for type="image"
+ if (nodeName === 'input' && node.type !== 'image') {
+ return undefined;
+ }
+
+ return URI.domAttributes[nodeName];
+ };
+
+ function escapeForDumbFirefox36(value) {
+ // https://github.com/medialize/URI.js/issues/91
+ return escape(value);
+ }
+
+ // encoding / decoding according to RFC3986
+ function strictEncodeURIComponent(string) {
+ // see https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/encodeURIComponent
+ return encodeURIComponent(string)
+ .replace(/[!'()*]/g, escapeForDumbFirefox36)
+ .replace(/\*/g, '%2A');
+ }
+ URI.encode = strictEncodeURIComponent;
+ URI.decode = decodeURIComponent;
+ URI.iso8859 = function() {
+ URI.encode = escape;
+ URI.decode = unescape;
+ };
+ URI.unicode = function() {
+ URI.encode = strictEncodeURIComponent;
+ URI.decode = decodeURIComponent;
+ };
+ URI.characters = {
+ pathname: {
+ encode: {
+ // RFC3986 2.1: For consistency, URI producers and normalizers should
+ // use uppercase hexadecimal digits for all percent-encodings.
+ expression: /%(24|26|2B|2C|3B|3D|3A|40)/ig,
+ map: {
+ // -._~!'()*
+ '%24': '$',
+ '%26': '&',
+ '%2B': '+',
+ '%2C': ',',
+ '%3B': ';',
+ '%3D': '=',
+ '%3A': ':',
+ '%40': '@'
+ }
+ },
+ decode: {
+ expression: /[\/\?#]/g,
+ map: {
+ '/': '%2F',
+ '?': '%3F',
+ '#': '%23'
+ }
+ }
+ },
+ reserved: {
+ encode: {
+ // RFC3986 2.1: For consistency, URI producers and normalizers should
+ // use uppercase hexadecimal digits for all percent-encodings.
+ expression: /%(21|23|24|26|27|28|29|2A|2B|2C|2F|3A|3B|3D|3F|40|5B|5D)/ig,
+ map: {
+ // gen-delims
+ '%3A': ':',
+ '%2F': '/',
+ '%3F': '?',
+ '%23': '#',
+ '%5B': '[',
+ '%5D': ']',
+ '%40': '@',
+ // sub-delims
+ '%21': '!',
+ '%24': '$',
+ '%26': '&',
+ '%27': '\'',
+ '%28': '(',
+ '%29': ')',
+ '%2A': '*',
+ '%2B': '+',
+ '%2C': ',',
+ '%3B': ';',
+ '%3D': '='
+ }
+ }
+ },
+ urnpath: {
+ // The characters under `encode` are the characters called out by RFC 2141 as being acceptable
+ // for usage in a URN. RFC2141 also calls out "-", ".", and "_" as acceptable characters, but
+ // these aren't encoded by encodeURIComponent, so we don't have to call them out here. Also
+ // note that the colon character is not featured in the encoding map; this is because URI.js
+ // gives the colons in URNs semantic meaning as the delimiters of path segements, and so it
+ // should not appear unencoded in a segment itself.
+ // See also the note above about RFC3986 and capitalalized hex digits.
+ encode: {
+ expression: /%(21|24|27|28|29|2A|2B|2C|3B|3D|40)/ig,
+ map: {
+ '%21': '!',
+ '%24': '$',
+ '%27': '\'',
+ '%28': '(',
+ '%29': ')',
+ '%2A': '*',
+ '%2B': '+',
+ '%2C': ',',
+ '%3B': ';',
+ '%3D': '=',
+ '%40': '@'
+ }
+ },
+ // These characters are the characters called out by RFC2141 as "reserved" characters that
+ // should never appear in a URN, plus the colon character (see note above).
+ decode: {
+ expression: /[\/\?#:]/g,
+ map: {
+ '/': '%2F',
+ '?': '%3F',
+ '#': '%23',
+ ':': '%3A'
+ }
+ }
+ }
+ };
+ URI.encodeQuery = function(string, escapeQuerySpace) {
+ var escaped = URI.encode(string + '');
+ if (escapeQuerySpace === undefined) {
+ escapeQuerySpace = URI.escapeQuerySpace;
+ }
+
+ return escapeQuerySpace ? escaped.replace(/%20/g, '+') : escaped;
+ };
+ URI.decodeQuery = function(string, escapeQuerySpace) {
+ string += '';
+ if (escapeQuerySpace === undefined) {
+ escapeQuerySpace = URI.escapeQuerySpace;
+ }
+
+ try {
+ return URI.decode(escapeQuerySpace ? string.replace(/\+/g, '%20') : string);
+ } catch(e) {
+ // we're not going to mess with weird encodings,
+ // give up and return the undecoded original string
+ // see https://github.com/medialize/URI.js/issues/87
+ // see https://github.com/medialize/URI.js/issues/92
+ return string;
+ }
+ };
+ // generate encode/decode path functions
+ var _parts = {'encode':'encode', 'decode':'decode'};
+ var _part;
+ var generateAccessor = function(_group, _part) {
+ return function(string) {
+ try {
+ return URI[_part](string + '').replace(URI.characters[_group][_part].expression, function(c) {
+ return URI.characters[_group][_part].map[c];
+ });
+ } catch (e) {
+ // we're not going to mess with weird encodings,
+ // give up and return the undecoded original string
+ // see https://github.com/medialize/URI.js/issues/87
+ // see https://github.com/medialize/URI.js/issues/92
+ return string;
+ }
+ };
+ };
+
+ for (_part in _parts) {
+ URI[_part + 'PathSegment'] = generateAccessor('pathname', _parts[_part]);
+ URI[_part + 'UrnPathSegment'] = generateAccessor('urnpath', _parts[_part]);
+ }
+
+ var generateSegmentedPathFunction = function(_sep, _codingFuncName, _innerCodingFuncName) {
+ return function(string) {
+ // Why pass in names of functions, rather than the function objects themselves? The
+ // definitions of some functions (but in particular, URI.decode) will occasionally change due
+ // to URI.js having ISO8859 and Unicode modes. Passing in the name and getting it will ensure
+ // that the functions we use here are "fresh".
+ var actualCodingFunc;
+ if (!_innerCodingFuncName) {
+ actualCodingFunc = URI[_codingFuncName];
+ } else {
+ actualCodingFunc = function(string) {
+ return URI[_codingFuncName](URI[_innerCodingFuncName](string));
+ };
+ }
+
+ var segments = (string + '').split(_sep);
+
+ for (var i = 0, length = segments.length; i < length; i++) {
+ segments[i] = actualCodingFunc(segments[i]);
+ }
+
+ return segments.join(_sep);
+ };
+ };
+
+ // This takes place outside the above loop because we don't want, e.g., encodeUrnPath functions.
+ URI.decodePath = generateSegmentedPathFunction('/', 'decodePathSegment');
+ URI.decodeUrnPath = generateSegmentedPathFunction(':', 'decodeUrnPathSegment');
+ URI.recodePath = generateSegmentedPathFunction('/', 'encodePathSegment', 'decode');
+ URI.recodeUrnPath = generateSegmentedPathFunction(':', 'encodeUrnPathSegment', 'decode');
+
+ URI.encodeReserved = generateAccessor('reserved', 'encode');
+
+ URI.parse = function(string, parts) {
+ var pos;
+ if (!parts) {
+ parts = {};
+ }
+ // [protocol"://"[username[":"password]"@"]hostname[":"port]"/"?][path]["?"querystring]["#"fragment]
+
+ // extract fragment
+ pos = string.indexOf('#');
+ if (pos > -1) {
+ // escaping?
+ parts.fragment = string.substring(pos + 1) || null;
+ string = string.substring(0, pos);
+ }
+
+ // extract query
+ pos = string.indexOf('?');
+ if (pos > -1) {
+ // escaping?
+ parts.query = string.substring(pos + 1) || null;
+ string = string.substring(0, pos);
+ }
+
+ // extract protocol
+ if (string.substring(0, 2) === '//') {
+ // relative-scheme
+ parts.protocol = null;
+ string = string.substring(2);
+ // extract "user:pass@host:port"
+ string = URI.parseAuthority(string, parts);
+ } else {
+ pos = string.indexOf(':');
+ if (pos > -1) {
+ parts.protocol = string.substring(0, pos) || null;
+ if (parts.protocol && !parts.protocol.match(URI.protocol_expression)) {
+ // : may be within the path
+ parts.protocol = undefined;
+ } else if (string.substring(pos + 1, pos + 3) === '//') {
+ string = string.substring(pos + 3);
+
+ // extract "user:pass@host:port"
+ string = URI.parseAuthority(string, parts);
+ } else {
+ string = string.substring(pos + 1);
+ parts.urn = true;
+ }
+ }
+ }
+
+ // what's left must be the path
+ parts.path = string;
+
+ // and we're done
+ return parts;
+ };
+ URI.parseHost = function(string, parts) {
+ // Copy chrome, IE, opera backslash-handling behavior.
+ // Back slashes before the query string get converted to forward slashes
+ // See: https://github.com/joyent/node/blob/386fd24f49b0e9d1a8a076592a404168faeecc34/lib/url.js#L115-L124
+ // See: https://code.google.com/p/chromium/issues/detail?id=25916
+ // https://github.com/medialize/URI.js/pull/233
+ string = string.replace(/\\/g, '/');
+
+ // extract host:port
+ var pos = string.indexOf('/');
+ var bracketPos;
+ var t;
+
+ if (pos === -1) {
+ pos = string.length;
+ }
+
+ if (string.charAt(0) === '[') {
+ // IPv6 host - http://tools.ietf.org/html/draft-ietf-6man-text-addr-representation-04#section-6
+ // I claim most client software breaks on IPv6 anyways. To simplify things, URI only accepts
+ // IPv6+port in the format [2001:db8::1]:80 (for the time being)
+ bracketPos = string.indexOf(']');
+ parts.hostname = string.substring(1, bracketPos) || null;
+ parts.port = string.substring(bracketPos + 2, pos) || null;
+ if (parts.port === '/') {
+ parts.port = null;
+ }
+ } else {
+ var firstColon = string.indexOf(':');
+ var firstSlash = string.indexOf('/');
+ var nextColon = string.indexOf(':', firstColon + 1);
+ if (nextColon !== -1 && (firstSlash === -1 || nextColon < firstSlash)) {
+ // IPv6 host contains multiple colons - but no port
+ // this notation is actually not allowed by RFC 3986, but we're a liberal parser
+ parts.hostname = string.substring(0, pos) || null;
+ parts.port = null;
+ } else {
+ t = string.substring(0, pos).split(':');
+ parts.hostname = t[0] || null;
+ parts.port = t[1] || null;
+ }
+ }
+
+ if (parts.hostname && string.substring(pos).charAt(0) !== '/') {
+ pos++;
+ string = '/' + string;
+ }
+
+ return string.substring(pos) || '/';
+ };
+ URI.parseAuthority = function(string, parts) {
+ string = URI.parseUserinfo(string, parts);
+ return URI.parseHost(string, parts);
+ };
+ URI.parseUserinfo = function(string, parts) {
+ // extract username:password
+ var firstSlash = string.indexOf('/');
+ var pos = string.lastIndexOf('@', firstSlash > -1 ? firstSlash : string.length - 1);
+ var t;
+
+ // authority@ must come before /path
+ if (pos > -1 && (firstSlash === -1 || pos < firstSlash)) {
+ t = string.substring(0, pos).split(':');
+ parts.username = t[0] ? URI.decode(t[0]) : null;
+ t.shift();
+ parts.password = t[0] ? URI.decode(t.join(':')) : null;
+ string = string.substring(pos + 1);
+ } else {
+ parts.username = null;
+ parts.password = null;
+ }
+
+ return string;
+ };
+ URI.parseQuery = function(string, escapeQuerySpace) {
+ if (!string) {
+ return {};
+ }
+
+ // throw out the funky business - "?"[name"="value"&"]+
+ string = string.replace(/&+/g, '&').replace(/^\?*&*|&+$/g, '');
+
+ if (!string) {
+ return {};
+ }
+
+ var items = {};
+ var splits = string.split('&');
+ var length = splits.length;
+ var v, name, value;
+
+ for (var i = 0; i < length; i++) {
+ v = splits[i].split('=');
+ name = URI.decodeQuery(v.shift(), escapeQuerySpace);
+ // no "=" is null according to http://dvcs.w3.org/hg/url/raw-file/tip/Overview.html#collect-url-parameters
+ value = v.length ? URI.decodeQuery(v.join('='), escapeQuerySpace) : null;
+
+ if (hasOwn.call(items, name)) {
+ if (typeof items[name] === 'string' || items[name] === null) {
+ items[name] = [items[name]];
+ }
+
+ items[name].push(value);
+ } else {
+ items[name] = value;
+ }
+ }
+
+ return items;
+ };
+
+ URI.build = function(parts) {
+ var t = '';
+
+ if (parts.protocol) {
+ t += parts.protocol + ':';
+ }
+
+ if (!parts.urn && (t || parts.hostname)) {
+ t += '//';
+ }
+
+ t += (URI.buildAuthority(parts) || '');
+
+ if (typeof parts.path === 'string') {
+ if (parts.path.charAt(0) !== '/' && typeof parts.hostname === 'string') {
+ t += '/';
+ }
+
+ t += parts.path;
+ }
+
+ if (typeof parts.query === 'string' && parts.query) {
+ t += '?' + parts.query;
+ }
+
+ if (typeof parts.fragment === 'string' && parts.fragment) {
+ t += '#' + parts.fragment;
+ }
+ return t;
+ };
+ URI.buildHost = function(parts) {
+ var t = '';
+
+ if (!parts.hostname) {
+ return '';
+ } else if (URI.ip6_expression.test(parts.hostname)) {
+ t += '[' + parts.hostname + ']';
+ } else {
+ t += parts.hostname;
+ }
+
+ if (parts.port) {
+ t += ':' + parts.port;
+ }
+
+ return t;
+ };
+ URI.buildAuthority = function(parts) {
+ return URI.buildUserinfo(parts) + URI.buildHost(parts);
+ };
+ URI.buildUserinfo = function(parts) {
+ var t = '';
+
+ if (parts.username) {
+ t += URI.encode(parts.username);
+
+ if (parts.password) {
+ t += ':' + URI.encode(parts.password);
+ }
+
+ t += '@';
+ }
+
+ return t;
+ };
+ URI.buildQuery = function(data, duplicateQueryParameters, escapeQuerySpace) {
+ // according to http://tools.ietf.org/html/rfc3986 or http://labs.apache.org/webarch/uri/rfc/rfc3986.html
+ // being »-._~!$&'()*+,;=:@/?« %HEX and alnum are allowed
+ // the RFC explicitly states ?/foo being a valid use case, no mention of parameter syntax!
+ // URI.js treats the query string as being application/x-www-form-urlencoded
+ // see http://www.w3.org/TR/REC-html40/interact/forms.html#form-content-type
+
+ var t = '';
+ var unique, key, i, length;
+ for (key in data) {
+ if (hasOwn.call(data, key) && key) {
+ if (isArray(data[key])) {
+ unique = {};
+ for (i = 0, length = data[key].length; i < length; i++) {
+ if (data[key][i] !== undefined && unique[data[key][i] + ''] === undefined) {
+ t += '&' + URI.buildQueryParameter(key, data[key][i], escapeQuerySpace);
+ if (duplicateQueryParameters !== true) {
+ unique[data[key][i] + ''] = true;
+ }
+ }
+ }
+ } else if (data[key] !== undefined) {
+ t += '&' + URI.buildQueryParameter(key, data[key], escapeQuerySpace);
+ }
+ }
+ }
+
+ return t.substring(1);
+ };
+ URI.buildQueryParameter = function(name, value, escapeQuerySpace) {
+ // http://www.w3.org/TR/REC-html40/interact/forms.html#form-content-type -- application/x-www-form-urlencoded
+ // don't append "=" for null values, according to http://dvcs.w3.org/hg/url/raw-file/tip/Overview.html#url-parameter-serialization
+ return URI.encodeQuery(name, escapeQuerySpace) + (value !== null ? '=' + URI.encodeQuery(value, escapeQuerySpace) : '');
+ };
+
+ URI.addQuery = function(data, name, value) {
+ if (typeof name === 'object') {
+ for (var key in name) {
+ if (hasOwn.call(name, key)) {
+ URI.addQuery(data, key, name[key]);
+ }
+ }
+ } else if (typeof name === 'string') {
+ if (data[name] === undefined) {
+ data[name] = value;
+ return;
+ } else if (typeof data[name] === 'string') {
+ data[name] = [data[name]];
+ }
+
+ if (!isArray(value)) {
+ value = [value];
+ }
+
+ data[name] = (data[name] || []).concat(value);
+ } else {
+ throw new TypeError('URI.addQuery() accepts an object, string as the name parameter');
+ }
+ };
+ URI.removeQuery = function(data, name, value) {
+ var i, length, key;
+
+ if (isArray(name)) {
+ for (i = 0, length = name.length; i < length; i++) {
+ data[name[i]] = undefined;
+ }
+ } else if (getType(name) === 'RegExp') {
+ for (key in data) {
+ if (name.test(key)) {
+ data[key] = undefined;
+ }
+ }
+ } else if (typeof name === 'object') {
+ for (key in name) {
+ if (hasOwn.call(name, key)) {
+ URI.removeQuery(data, key, name[key]);
+ }
+ }
+ } else if (typeof name === 'string') {
+ if (value !== undefined) {
+ if (getType(value) === 'RegExp') {
+ if (!isArray(data[name]) && value.test(data[name])) {
+ data[name] = undefined;
+ } else {
+ data[name] = filterArrayValues(data[name], value);
+ }
+ } else if (data[name] === String(value) && (!isArray(value) || value.length === 1)) {
+ data[name] = undefined;
+ } else if (isArray(data[name])) {
+ data[name] = filterArrayValues(data[name], value);
+ }
+ } else {
+ data[name] = undefined;
+ }
+ } else {
+ throw new TypeError('URI.removeQuery() accepts an object, string, RegExp as the first parameter');
+ }
+ };
+ URI.hasQuery = function(data, name, value, withinArray) {
+ if (typeof name === 'object') {
+ for (var key in name) {
+ if (hasOwn.call(name, key)) {
+ if (!URI.hasQuery(data, key, name[key])) {
+ return false;
+ }
+ }
+ }
+
+ return true;
+ } else if (typeof name !== 'string') {
+ throw new TypeError('URI.hasQuery() accepts an object, string as the name parameter');
+ }
+
+ switch (getType(value)) {
+ case 'Undefined':
+ // true if exists (but may be empty)
+ return name in data; // data[name] !== undefined;
+
+ case 'Boolean':
+ // true if exists and non-empty
+ var _booly = Boolean(isArray(data[name]) ? data[name].length : data[name]);
+ return value === _booly;
+
+ case 'Function':
+ // allow complex comparison
+ return !!value(data[name], name, data);
+
+ case 'Array':
+ if (!isArray(data[name])) {
+ return false;
+ }
+
+ var op = withinArray ? arrayContains : arraysEqual;
+ return op(data[name], value);
+
+ case 'RegExp':
+ if (!isArray(data[name])) {
+ return Boolean(data[name] && data[name].match(value));
+ }
+
+ if (!withinArray) {
+ return false;
+ }
+
+ return arrayContains(data[name], value);
+
+ case 'Number':
+ value = String(value);
+ /* falls through */
+ case 'String':
+ if (!isArray(data[name])) {
+ return data[name] === value;
+ }
+
+ if (!withinArray) {
+ return false;
+ }
+
+ return arrayContains(data[name], value);
+
+ default:
+ throw new TypeError('URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter');
+ }
+ };
+
+
+ URI.commonPath = function(one, two) {
+ var length = Math.min(one.length, two.length);
+ var pos;
+
+ // find first non-matching character
+ for (pos = 0; pos < length; pos++) {
+ if (one.charAt(pos) !== two.charAt(pos)) {
+ pos--;
+ break;
+ }
+ }
+
+ if (pos < 1) {
+ return one.charAt(0) === two.charAt(0) && one.charAt(0) === '/' ? '/' : '';
+ }
+
+ // revert to last /
+ if (one.charAt(pos) !== '/' || two.charAt(pos) !== '/') {
+ pos = one.substring(0, pos).lastIndexOf('/');
+ }
+
+ return one.substring(0, pos + 1);
+ };
+
+ URI.withinString = function(string, callback, options) {
+ options || (options = {});
+ var _start = options.start || URI.findUri.start;
+ var _end = options.end || URI.findUri.end;
+ var _trim = options.trim || URI.findUri.trim;
+ var _attributeOpen = /[a-z0-9-]=["']?$/i;
+
+ _start.lastIndex = 0;
+ while (true) {
+ var match = _start.exec(string);
+ if (!match) {
+ break;
+ }
+
+ var start = match.index;
+ if (options.ignoreHtml) {
+ // attribut(e=["']?$)
+ var attributeOpen = string.slice(Math.max(start - 3, 0), start);
+ if (attributeOpen && _attributeOpen.test(attributeOpen)) {
+ continue;
+ }
+ }
+
+ var end = start + string.slice(start).search(_end);
+ var slice = string.slice(start, end).replace(_trim, '');
+ if (options.ignore && options.ignore.test(slice)) {
+ continue;
+ }
+
+ end = start + slice.length;
+ var result = callback(slice, start, end, string);
+ string = string.slice(0, start) + result + string.slice(end);
+ _start.lastIndex = start + result.length;
+ }
+
+ _start.lastIndex = 0;
+ return string;
+ };
+
+ URI.ensureValidHostname = function(v) {
+ // Theoretically URIs allow percent-encoding in Hostnames (according to RFC 3986)
+ // they are not part of DNS and therefore ignored by URI.js
+
+ if (v.match(URI.invalid_hostname_characters)) {
+ // test punycode
+ if (!punycode) {
+ throw new TypeError('Hostname "' + v + '" contains characters other than [A-Z0-9.-] and Punycode.js is not available');
+ }
+
+ if (punycode.toASCII(v).match(URI.invalid_hostname_characters)) {
+ throw new TypeError('Hostname "' + v + '" contains characters other than [A-Z0-9.-]');
+ }
+ }
+ };
+
+ // noConflict
+ URI.noConflict = function(removeAll) {
+ if (removeAll) {
+ var unconflicted = {
+ URI: this.noConflict()
+ };
+
+ if (root.URITemplate && typeof root.URITemplate.noConflict === 'function') {
+ unconflicted.URITemplate = root.URITemplate.noConflict();
+ }
+
+ if (root.IPv6 && typeof root.IPv6.noConflict === 'function') {
+ unconflicted.IPv6 = root.IPv6.noConflict();
+ }
+
+ if (root.SecondLevelDomains && typeof root.SecondLevelDomains.noConflict === 'function') {
+ unconflicted.SecondLevelDomains = root.SecondLevelDomains.noConflict();
+ }
+
+ return unconflicted;
+ } else if (root.URI === this) {
+ root.URI = _URI;
+ }
+
+ return this;
+ };
+
+ p.build = function(deferBuild) {
+ if (deferBuild === true) {
+ this._deferred_build = true;
+ } else if (deferBuild === undefined || this._deferred_build) {
+ this._string = URI.build(this._parts);
+ this._deferred_build = false;
+ }
+
+ return this;
+ };
+
+ p.clone = function() {
+ return new URI(this);
+ };
+
+ p.valueOf = p.toString = function() {
+ return this.build(false)._string;
+ };
+
+
+ function generateSimpleAccessor(_part){
+ return function(v, build) {
+ if (v === undefined) {
+ return this._parts[_part] || '';
+ } else {
+ this._parts[_part] = v || null;
+ this.build(!build);
+ return this;
+ }
+ };
+ }
+
+ function generatePrefixAccessor(_part, _key){
+ return function(v, build) {
+ if (v === undefined) {
+ return this._parts[_part] || '';
+ } else {
+ if (v !== null) {
+ v = v + '';
+ if (v.charAt(0) === _key) {
+ v = v.substring(1);
+ }
+ }
+
+ this._parts[_part] = v;
+ this.build(!build);
+ return this;
+ }
+ };
+ }
+
+ p.protocol = generateSimpleAccessor('protocol');
+ p.username = generateSimpleAccessor('username');
+ p.password = generateSimpleAccessor('password');
+ p.hostname = generateSimpleAccessor('hostname');
+ p.port = generateSimpleAccessor('port');
+ p.query = generatePrefixAccessor('query', '?');
+ p.fragment = generatePrefixAccessor('fragment', '#');
+
+ p.search = function(v, build) {
+ var t = this.query(v, build);
+ return typeof t === 'string' && t.length ? ('?' + t) : t;
+ };
+ p.hash = function(v, build) {
+ var t = this.fragment(v, build);
+ return typeof t === 'string' && t.length ? ('#' + t) : t;
+ };
+
+ p.pathname = function(v, build) {
+ if (v === undefined || v === true) {
+ var res = this._parts.path || (this._parts.hostname ? '/' : '');
+ return v ? (this._parts.urn ? URI.decodeUrnPath : URI.decodePath)(res) : res;
+ } else {
+ if (this._parts.urn) {
+ this._parts.path = v ? URI.recodeUrnPath(v) : '';
+ } else {
+ this._parts.path = v ? URI.recodePath(v) : '/';
+ }
+ this.build(!build);
+ return this;
+ }
+ };
+ p.path = p.pathname;
+ p.href = function(href, build) {
+ var key;
+
+ if (href === undefined) {
+ return this.toString();
+ }
+
+ this._string = '';
+ this._parts = URI._parts();
+
+ var _URI = href instanceof URI;
+ var _object = typeof href === 'object' && (href.hostname || href.path || href.pathname);
+ if (href.nodeName) {
+ var attribute = URI.getDomAttribute(href);
+ href = href[attribute] || '';
+ _object = false;
+ }
+
+ // window.location is reported to be an object, but it's not the sort
+ // of object we're looking for:
+ // * location.protocol ends with a colon
+ // * location.query != object.search
+ // * location.hash != object.fragment
+ // simply serializing the unknown object should do the trick
+ // (for location, not for everything...)
+ if (!_URI && _object && href.pathname !== undefined) {
+ href = href.toString();
+ }
+
+ if (typeof href === 'string' || href instanceof String) {
+ this._parts = URI.parse(String(href), this._parts);
+ } else if (_URI || _object) {
+ var src = _URI ? href._parts : href;
+ for (key in src) {
+ if (hasOwn.call(this._parts, key)) {
+ this._parts[key] = src[key];
+ }
+ }
+ } else {
+ throw new TypeError('invalid input');
+ }
+
+ this.build(!build);
+ return this;
+ };
+
+ // identification accessors
+ p.is = function(what) {
+ var ip = false;
+ var ip4 = false;
+ var ip6 = false;
+ var name = false;
+ var sld = false;
+ var idn = false;
+ var punycode = false;
+ var relative = !this._parts.urn;
+
+ if (this._parts.hostname) {
+ relative = false;
+ ip4 = URI.ip4_expression.test(this._parts.hostname);
+ ip6 = URI.ip6_expression.test(this._parts.hostname);
+ ip = ip4 || ip6;
+ name = !ip;
+ sld = name && SLD && SLD.has(this._parts.hostname);
+ idn = name && URI.idn_expression.test(this._parts.hostname);
+ punycode = name && URI.punycode_expression.test(this._parts.hostname);
+ }
+
+ switch (what.toLowerCase()) {
+ case 'relative':
+ return relative;
+
+ case 'absolute':
+ return !relative;
+
+ // hostname identification
+ case 'domain':
+ case 'name':
+ return name;
+
+ case 'sld':
+ return sld;
+
+ case 'ip':
+ return ip;
+
+ case 'ip4':
+ case 'ipv4':
+ case 'inet4':
+ return ip4;
+
+ case 'ip6':
+ case 'ipv6':
+ case 'inet6':
+ return ip6;
+
+ case 'idn':
+ return idn;
+
+ case 'url':
+ return !this._parts.urn;
+
+ case 'urn':
+ return !!this._parts.urn;
+
+ case 'punycode':
+ return punycode;
+ }
+
+ return null;
+ };
+
+ // component specific input validation
+ var _protocol = p.protocol;
+ var _port = p.port;
+ var _hostname = p.hostname;
+
+ p.protocol = function(v, build) {
+ if (v !== undefined) {
+ if (v) {
+ // accept trailing ://
+ v = v.replace(/:(\/\/)?$/, '');
+
+ if (!v.match(URI.protocol_expression)) {
+ throw new TypeError('Protocol "' + v + '" contains characters other than [A-Z0-9.+-] or doesn\'t start with [A-Z]');
+ }
+ }
+ }
+ return _protocol.call(this, v, build);
+ };
+ p.scheme = p.protocol;
+ p.port = function(v, build) {
+ if (this._parts.urn) {
+ return v === undefined ? '' : this;
+ }
+
+ if (v !== undefined) {
+ if (v === 0) {
+ v = null;
+ }
+
+ if (v) {
+ v += '';
+ if (v.charAt(0) === ':') {
+ v = v.substring(1);
+ }
+
+ if (v.match(/[^0-9]/)) {
+ throw new TypeError('Port "' + v + '" contains characters other than [0-9]');
+ }
+ }
+ }
+ return _port.call(this, v, build);
+ };
+ p.hostname = function(v, build) {
+ if (this._parts.urn) {
+ return v === undefined ? '' : this;
+ }
+
+ if (v !== undefined) {
+ var x = {};
+ var res = URI.parseHost(v, x);
+ if (res !== '/') {
+ throw new TypeError('Hostname "' + v + '" contains characters other than [A-Z0-9.-]');
+ }
+
+ v = x.hostname;
+ }
+ return _hostname.call(this, v, build);
+ };
+
+ // compound accessors
+ p.origin = function(v, build) {
+ var parts;
+
+ if (this._parts.urn) {
+ return v === undefined ? '' : this;
+ }
+
+ if (v === undefined) {
+ var protocol = this.protocol();
+ var authority = this.authority();
+ if (!authority) return '';
+ return (protocol ? protocol + '://' : '') + this.authority();
+ } else {
+ var origin = URI(v);
+ this
+ .protocol(origin.protocol())
+ .authority(origin.authority())
+ .build(!build);
+ return this;
+ }
+ };
+ p.host = function(v, build) {
+ if (this._parts.urn) {
+ return v === undefined ? '' : this;
+ }
+
+ if (v === undefined) {
+ return this._parts.hostname ? URI.buildHost(this._parts) : '';
+ } else {
+ var res = URI.parseHost(v, this._parts);
+ if (res !== '/') {
+ throw new TypeError('Hostname "' + v + '" contains characters other than [A-Z0-9.-]');
+ }
+
+ this.build(!build);
+ return this;
+ }
+ };
+ p.authority = function(v, build) {
+ if (this._parts.urn) {
+ return v === undefined ? '' : this;
+ }
+
+ if (v === undefined) {
+ return this._parts.hostname ? URI.buildAuthority(this._parts) : '';
+ } else {
+ var res = URI.parseAuthority(v, this._parts);
+ if (res !== '/') {
+ throw new TypeError('Hostname "' + v + '" contains characters other than [A-Z0-9.-]');
+ }
+
+ this.build(!build);
+ return this;
+ }
+ };
+ p.userinfo = function(v, build) {
+ if (this._parts.urn) {
+ return v === undefined ? '' : this;
+ }
+
+ if (v === undefined) {
+ if (!this._parts.username) {
+ return '';
+ }
+
+ var t = URI.buildUserinfo(this._parts);
+ return t.substring(0, t.length -1);
+ } else {
+ if (v[v.length-1] !== '@') {
+ v += '@';
+ }
+
+ URI.parseUserinfo(v, this._parts);
+ this.build(!build);
+ return this;
+ }
+ };
+ p.resource = function(v, build) {
+ var parts;
+
+ if (v === undefined) {
+ return this.path() + this.search() + this.hash();
+ }
+
+ parts = URI.parse(v);
+ this._parts.path = parts.path;
+ this._parts.query = parts.query;
+ this._parts.fragment = parts.fragment;
+ this.build(!build);
+ return this;
+ };
+
+ // fraction accessors
+ p.subdomain = function(v, build) {
+ if (this._parts.urn) {
+ return v === undefined ? '' : this;
+ }
+
+ // convenience, return "www" from "www.example.org"
+ if (v === undefined) {
+ if (!this._parts.hostname || this.is('IP')) {
+ return '';
+ }
+
+ // grab domain and add another segment
+ var end = this._parts.hostname.length - this.domain().length - 1;
+ return this._parts.hostname.substring(0, end) || '';
+ } else {
+ var e = this._parts.hostname.length - this.domain().length;
+ var sub = this._parts.hostname.substring(0, e);
+ var replace = new RegExp('^' + escapeRegEx(sub));
+
+ if (v && v.charAt(v.length - 1) !== '.') {
+ v += '.';
+ }
+
+ if (v) {
+ URI.ensureValidHostname(v);
+ }
+
+ this._parts.hostname = this._parts.hostname.replace(replace, v);
+ this.build(!build);
+ return this;
+ }
+ };
+ p.domain = function(v, build) {
+ if (this._parts.urn) {
+ return v === undefined ? '' : this;
+ }
+
+ if (typeof v === 'boolean') {
+ build = v;
+ v = undefined;
+ }
+
+ // convenience, return "example.org" from "www.example.org"
+ if (v === undefined) {
+ if (!this._parts.hostname || this.is('IP')) {
+ return '';
+ }
+
+ // if hostname consists of 1 or 2 segments, it must be the domain
+ var t = this._parts.hostname.match(/\./g);
+ if (t && t.length < 2) {
+ return this._parts.hostname;
+ }
+
+ // grab tld and add another segment
+ var end = this._parts.hostname.length - this.tld(build).length - 1;
+ end = this._parts.hostname.lastIndexOf('.', end -1) + 1;
+ return this._parts.hostname.substring(end) || '';
+ } else {
+ if (!v) {
+ throw new TypeError('cannot set domain empty');
+ }
+
+ URI.ensureValidHostname(v);
+
+ if (!this._parts.hostname || this.is('IP')) {
+ this._parts.hostname = v;
+ } else {
+ var replace = new RegExp(escapeRegEx(this.domain()) + '$');
+ this._parts.hostname = this._parts.hostname.replace(replace, v);
+ }
+
+ this.build(!build);
+ return this;
+ }
+ };
+ p.tld = function(v, build) {
+ if (this._parts.urn) {
+ return v === undefined ? '' : this;
+ }
+
+ if (typeof v === 'boolean') {
+ build = v;
+ v = undefined;
+ }
+
+ // return "org" from "www.example.org"
+ if (v === undefined) {
+ if (!this._parts.hostname || this.is('IP')) {
+ return '';
+ }
+
+ var pos = this._parts.hostname.lastIndexOf('.');
+ var tld = this._parts.hostname.substring(pos + 1);
+
+ if (build !== true && SLD && SLD.list[tld.toLowerCase()]) {
+ return SLD.get(this._parts.hostname) || tld;
+ }
+
+ return tld;
+ } else {
+ var replace;
+
+ if (!v) {
+ throw new TypeError('cannot set TLD empty');
+ } else if (v.match(/[^a-zA-Z0-9-]/)) {
+ if (SLD && SLD.is(v)) {
+ replace = new RegExp(escapeRegEx(this.tld()) + '$');
+ this._parts.hostname = this._parts.hostname.replace(replace, v);
+ } else {
+ throw new TypeError('TLD "' + v + '" contains characters other than [A-Z0-9]');
+ }
+ } else if (!this._parts.hostname || this.is('IP')) {
+ throw new ReferenceError('cannot set TLD on non-domain host');
+ } else {
+ replace = new RegExp(escapeRegEx(this.tld()) + '$');
+ this._parts.hostname = this._parts.hostname.replace(replace, v);
+ }
+
+ this.build(!build);
+ return this;
+ }
+ };
+ p.directory = function(v, build) {
+ if (this._parts.urn) {
+ return v === undefined ? '' : this;
+ }
+
+ if (v === undefined || v === true) {
+ if (!this._parts.path && !this._parts.hostname) {
+ return '';
+ }
+
+ if (this._parts.path === '/') {
+ return '/';
+ }
+
+ var end = this._parts.path.length - this.filename().length - 1;
+ var res = this._parts.path.substring(0, end) || (this._parts.hostname ? '/' : '');
+
+ return v ? URI.decodePath(res) : res;
+
+ } else {
+ var e = this._parts.path.length - this.filename().length;
+ var directory = this._parts.path.substring(0, e);
+ var replace = new RegExp('^' + escapeRegEx(directory));
+
+ // fully qualifier directories begin with a slash
+ if (!this.is('relative')) {
+ if (!v) {
+ v = '/';
+ }
+
+ if (v.charAt(0) !== '/') {
+ v = '/' + v;
+ }
+ }
+
+ // directories always end with a slash
+ if (v && v.charAt(v.length - 1) !== '/') {
+ v += '/';
+ }
+
+ v = URI.recodePath(v);
+ this._parts.path = this._parts.path.replace(replace, v);
+ this.build(!build);
+ return this;
+ }
+ };
+ p.filename = function(v, build) {
+ if (this._parts.urn) {
+ return v === undefined ? '' : this;
+ }
+
+ if (v === undefined || v === true) {
+ if (!this._parts.path || this._parts.path === '/') {
+ return '';
+ }
+
+ var pos = this._parts.path.lastIndexOf('/');
+ var res = this._parts.path.substring(pos+1);
+
+ return v ? URI.decodePathSegment(res) : res;
+ } else {
+ var mutatedDirectory = false;
+
+ if (v.charAt(0) === '/') {
+ v = v.substring(1);
+ }
+
+ if (v.match(/\.?\//)) {
+ mutatedDirectory = true;
+ }
+
+ var replace = new RegExp(escapeRegEx(this.filename()) + '$');
+ v = URI.recodePath(v);
+ this._parts.path = this._parts.path.replace(replace, v);
+
+ if (mutatedDirectory) {
+ this.normalizePath(build);
+ } else {
+ this.build(!build);
+ }
+
+ return this;
+ }
+ };
+ p.suffix = function(v, build) {
+ if (this._parts.urn) {
+ return v === undefined ? '' : this;
+ }
+
+ if (v === undefined || v === true) {
+ if (!this._parts.path || this._parts.path === '/') {
+ return '';
+ }
+
+ var filename = this.filename();
+ var pos = filename.lastIndexOf('.');
+ var s, res;
+
+ if (pos === -1) {
+ return '';
+ }
+
+ // suffix may only contain alnum characters (yup, I made this up.)
+ s = filename.substring(pos+1);
+ res = (/^[a-z0-9%]+$/i).test(s) ? s : '';
+ return v ? URI.decodePathSegment(res) : res;
+ } else {
+ if (v.charAt(0) === '.') {
+ v = v.substring(1);
+ }
+
+ var suffix = this.suffix();
+ var replace;
+
+ if (!suffix) {
+ if (!v) {
+ return this;
+ }
+
+ this._parts.path += '.' + URI.recodePath(v);
+ } else if (!v) {
+ replace = new RegExp(escapeRegEx('.' + suffix) + '$');
+ } else {
+ replace = new RegExp(escapeRegEx(suffix) + '$');
+ }
+
+ if (replace) {
+ v = URI.recodePath(v);
+ this._parts.path = this._parts.path.replace(replace, v);
+ }
+
+ this.build(!build);
+ return this;
+ }
+ };
+ p.segment = function(segment, v, build) {
+ var separator = this._parts.urn ? ':' : '/';
+ var path = this.path();
+ var absolute = path.substring(0, 1) === '/';
+ var segments = path.split(separator);
+
+ if (segment !== undefined && typeof segment !== 'number') {
+ build = v;
+ v = segment;
+ segment = undefined;
+ }
+
+ if (segment !== undefined && typeof segment !== 'number') {
+ throw new Error('Bad segment "' + segment + '", must be 0-based integer');
+ }
+
+ if (absolute) {
+ segments.shift();
+ }
+
+ if (segment < 0) {
+ // allow negative indexes to address from the end
+ segment = Math.max(segments.length + segment, 0);
+ }
+
+ if (v === undefined) {
+ /*jshint laxbreak: true */
+ return segment === undefined
+ ? segments
+ : segments[segment];
+ /*jshint laxbreak: false */
+ } else if (segment === null || segments[segment] === undefined) {
+ if (isArray(v)) {
+ segments = [];
+ // collapse empty elements within array
+ for (var i=0, l=v.length; i < l; i++) {
+ if (!v[i].length && (!segments.length || !segments[segments.length -1].length)) {
+ continue;
+ }
+
+ if (segments.length && !segments[segments.length -1].length) {
+ segments.pop();
+ }
+
+ segments.push(trimSlashes(v[i]));
+ }
+ } else if (v || typeof v === 'string') {
+ v = trimSlashes(v);
+ if (segments[segments.length -1] === '') {
+ // empty trailing elements have to be overwritten
+ // to prevent results such as /foo//bar
+ segments[segments.length -1] = v;
+ } else {
+ segments.push(v);
+ }
+ }
+ } else {
+ if (v) {
+ segments[segment] = trimSlashes(v);
+ } else {
+ segments.splice(segment, 1);
+ }
+ }
+
+ if (absolute) {
+ segments.unshift('');
+ }
+
+ return this.path(segments.join(separator), build);
+ };
+ p.segmentCoded = function(segment, v, build) {
+ var segments, i, l;
+
+ if (typeof segment !== 'number') {
+ build = v;
+ v = segment;
+ segment = undefined;
+ }
+
+ if (v === undefined) {
+ segments = this.segment(segment, v, build);
+ if (!isArray(segments)) {
+ segments = segments !== undefined ? URI.decode(segments) : undefined;
+ } else {
+ for (i = 0, l = segments.length; i < l; i++) {
+ segments[i] = URI.decode(segments[i]);
+ }
+ }
+
+ return segments;
+ }
+
+ if (!isArray(v)) {
+ v = (typeof v === 'string' || v instanceof String) ? URI.encode(v) : v;
+ } else {
+ for (i = 0, l = v.length; i < l; i++) {
+ v[i] = URI.encode(v[i]);
+ }
+ }
+
+ return this.segment(segment, v, build);
+ };
+
+ // mutating query string
+ var q = p.query;
+ p.query = function(v, build) {
+ if (v === true) {
+ return URI.parseQuery(this._parts.query, this._parts.escapeQuerySpace);
+ } else if (typeof v === 'function') {
+ var data = URI.parseQuery(this._parts.query, this._parts.escapeQuerySpace);
+ var result = v.call(this, data);
+ this._parts.query = URI.buildQuery(result || data, this._parts.duplicateQueryParameters, this._parts.escapeQuerySpace);
+ this.build(!build);
+ return this;
+ } else if (v !== undefined && typeof v !== 'string') {
+ this._parts.query = URI.buildQuery(v, this._parts.duplicateQueryParameters, this._parts.escapeQuerySpace);
+ this.build(!build);
+ return this;
+ } else {
+ return q.call(this, v, build);
+ }
+ };
+ p.setQuery = function(name, value, build) {
+ var data = URI.parseQuery(this._parts.query, this._parts.escapeQuerySpace);
+
+ if (typeof name === 'string' || name instanceof String) {
+ data[name] = value !== undefined ? value : null;
+ } else if (typeof name === 'object') {
+ for (var key in name) {
+ if (hasOwn.call(name, key)) {
+ data[key] = name[key];
+ }
+ }
+ } else {
+ throw new TypeError('URI.addQuery() accepts an object, string as the name parameter');
+ }
+
+ this._parts.query = URI.buildQuery(data, this._parts.duplicateQueryParameters, this._parts.escapeQuerySpace);
+ if (typeof name !== 'string') {
+ build = value;
+ }
+
+ this.build(!build);
+ return this;
+ };
+ p.addQuery = function(name, value, build) {
+ var data = URI.parseQuery(this._parts.query, this._parts.escapeQuerySpace);
+ URI.addQuery(data, name, value === undefined ? null : value);
+ this._parts.query = URI.buildQuery(data, this._parts.duplicateQueryParameters, this._parts.escapeQuerySpace);
+ if (typeof name !== 'string') {
+ build = value;
+ }
+
+ this.build(!build);
+ return this;
+ };
+ p.removeQuery = function(name, value, build) {
+ var data = URI.parseQuery(this._parts.query, this._parts.escapeQuerySpace);
+ URI.removeQuery(data, name, value);
+ this._parts.query = URI.buildQuery(data, this._parts.duplicateQueryParameters, this._parts.escapeQuerySpace);
+ if (typeof name !== 'string') {
+ build = value;
+ }
+
+ this.build(!build);
+ return this;
+ };
+ p.hasQuery = function(name, value, withinArray) {
+ var data = URI.parseQuery(this._parts.query, this._parts.escapeQuerySpace);
+ return URI.hasQuery(data, name, value, withinArray);
+ };
+ p.setSearch = p.setQuery;
+ p.addSearch = p.addQuery;
+ p.removeSearch = p.removeQuery;
+ p.hasSearch = p.hasQuery;
+
+ // sanitizing URLs
+ p.normalize = function() {
+ if (this._parts.urn) {
+ return this
+ .normalizeProtocol(false)
+ .normalizePath(false)
+ .normalizeQuery(false)
+ .normalizeFragment(false)
+ .build();
+ }
+
+ return this
+ .normalizeProtocol(false)
+ .normalizeHostname(false)
+ .normalizePort(false)
+ .normalizePath(false)
+ .normalizeQuery(false)
+ .normalizeFragment(false)
+ .build();
+ };
+ p.normalizeProtocol = function(build) {
+ if (typeof this._parts.protocol === 'string') {
+ this._parts.protocol = this._parts.protocol.toLowerCase();
+ this.build(!build);
+ }
+
+ return this;
+ };
+ p.normalizeHostname = function(build) {
+ if (this._parts.hostname) {
+ if (this.is('IDN') && punycode) {
+ this._parts.hostname = punycode.toASCII(this._parts.hostname);
+ } else if (this.is('IPv6') && IPv6) {
+ this._parts.hostname = IPv6.best(this._parts.hostname);
+ }
+
+ this._parts.hostname = this._parts.hostname.toLowerCase();
+ this.build(!build);
+ }
+
+ return this;
+ };
+ p.normalizePort = function(build) {
+ // remove port of it's the protocol's default
+ if (typeof this._parts.protocol === 'string' && this._parts.port === URI.defaultPorts[this._parts.protocol]) {
+ this._parts.port = null;
+ this.build(!build);
+ }
+
+ return this;
+ };
+ p.normalizePath = function(build) {
+ var _path = this._parts.path;
+ if (!_path) {
+ return this;
+ }
+
+ if (this._parts.urn) {
+ this._parts.path = URI.recodeUrnPath(this._parts.path);
+ this.build(!build);
+ return this;
+ }
+
+ if (this._parts.path === '/') {
+ return this;
+ }
+
+ _path = URI.recodePath(_path);
+
+ var _was_relative;
+ var _leadingParents = '';
+ var _parent, _pos;
+
+ // handle relative paths
+ if (_path.charAt(0) !== '/') {
+ _was_relative = true;
+ _path = '/' + _path;
+ }
+
+ // handle relative files (as opposed to directories)
+ if (_path.slice(-3) === '/..' || _path.slice(-2) === '/.') {
+ _path += '/';
+ }
+
+ // resolve simples
+ _path = _path
+ .replace(/(\/(\.\/)+)|(\/\.$)/g, '/')
+ .replace(/\/{2,}/g, '/');
+
+ // remember leading parents
+ if (_was_relative) {
+ _leadingParents = _path.substring(1).match(/^(\.\.\/)+/) || '';
+ if (_leadingParents) {
+ _leadingParents = _leadingParents[0];
+ }
+ }
+
+ // resolve parents
+ while (true) {
+ _parent = _path.search(/\/\.\.(\/|$)/);
+ if (_parent === -1) {
+ // no more ../ to resolve
+ break;
+ } else if (_parent === 0) {
+ // top level cannot be relative, skip it
+ _path = _path.substring(3);
+ continue;
+ }
+
+ _pos = _path.substring(0, _parent).lastIndexOf('/');
+ if (_pos === -1) {
+ _pos = _parent;
+ }
+ _path = _path.substring(0, _pos) + _path.substring(_parent + 3);
+ }
+
+ // revert to relative
+ if (_was_relative && this.is('relative')) {
+ _path = _leadingParents + _path.substring(1);
+ }
+
+ this._parts.path = _path;
+ this.build(!build);
+ return this;
+ };
+ p.normalizePathname = p.normalizePath;
+ p.normalizeQuery = function(build) {
+ if (typeof this._parts.query === 'string') {
+ if (!this._parts.query.length) {
+ this._parts.query = null;
+ } else {
+ this.query(URI.parseQuery(this._parts.query, this._parts.escapeQuerySpace));
+ }
+
+ this.build(!build);
+ }
+
+ return this;
+ };
+ p.normalizeFragment = function(build) {
+ if (!this._parts.fragment) {
+ this._parts.fragment = null;
+ this.build(!build);
+ }
+
+ return this;
+ };
+ p.normalizeSearch = p.normalizeQuery;
+ p.normalizeHash = p.normalizeFragment;
+
+ p.iso8859 = function() {
+ // expect unicode input, iso8859 output
+ var e = URI.encode;
+ var d = URI.decode;
+
+ URI.encode = escape;
+ URI.decode = decodeURIComponent;
+ try {
+ this.normalize();
+ } finally {
+ URI.encode = e;
+ URI.decode = d;
+ }
+ return this;
+ };
+
+ p.unicode = function() {
+ // expect iso8859 input, unicode output
+ var e = URI.encode;
+ var d = URI.decode;
+
+ URI.encode = strictEncodeURIComponent;
+ URI.decode = unescape;
+ try {
+ this.normalize();
+ } finally {
+ URI.encode = e;
+ URI.decode = d;
+ }
+ return this;
+ };
+
+ p.readable = function() {
+ var uri = this.clone();
+ // removing username, password, because they shouldn't be displayed according to RFC 3986
+ uri.username('').password('').normalize();
+ var t = '';
+ if (uri._parts.protocol) {
+ t += uri._parts.protocol + '://';
+ }
+
+ if (uri._parts.hostname) {
+ if (uri.is('punycode') && punycode) {
+ t += punycode.toUnicode(uri._parts.hostname);
+ if (uri._parts.port) {
+ t += ':' + uri._parts.port;
+ }
+ } else {
+ t += uri.host();
+ }
+ }
+
+ if (uri._parts.hostname && uri._parts.path && uri._parts.path.charAt(0) !== '/') {
+ t += '/';
+ }
+
+ t += uri.path(true);
+ if (uri._parts.query) {
+ var q = '';
+ for (var i = 0, qp = uri._parts.query.split('&'), l = qp.length; i < l; i++) {
+ var kv = (qp[i] || '').split('=');
+ q += '&' + URI.decodeQuery(kv[0], this._parts.escapeQuerySpace)
+ .replace(/&/g, '%26');
+
+ if (kv[1] !== undefined) {
+ q += '=' + URI.decodeQuery(kv[1], this._parts.escapeQuerySpace)
+ .replace(/&/g, '%26');
+ }
+ }
+ t += '?' + q.substring(1);
+ }
+
+ t += URI.decodeQuery(uri.hash(), true);
+ return t;
+ };
+
+ // resolving relative and absolute URLs
+ p.absoluteTo = function(base) {
+ var resolved = this.clone();
+ var properties = ['protocol', 'username', 'password', 'hostname', 'port'];
+ var basedir, i, p;
+
+ if (this._parts.urn) {
+ throw new Error('URNs do not have any generally defined hierarchical components');
+ }
+
+ if (!(base instanceof URI)) {
+ base = new URI(base);
+ }
+
+ if (!resolved._parts.protocol) {
+ resolved._parts.protocol = base._parts.protocol;
+ }
+
+ if (this._parts.hostname) {
+ return resolved;
+ }
+
+ for (i = 0; (p = properties[i]); i++) {
+ resolved._parts[p] = base._parts[p];
+ }
+
+ if (!resolved._parts.path) {
+ resolved._parts.path = base._parts.path;
+ if (!resolved._parts.query) {
+ resolved._parts.query = base._parts.query;
+ }
+ } else if (resolved._parts.path.substring(-2) === '..') {
+ resolved._parts.path += '/';
+ }
+
+ if (resolved.path().charAt(0) !== '/') {
+ basedir = base.directory();
+ basedir = basedir ? basedir : base.path().indexOf('/') === 0 ? '/' : '';
+ resolved._parts.path = (basedir ? (basedir + '/') : '') + resolved._parts.path;
+ resolved.normalizePath();
+ }
+
+ resolved.build();
+ return resolved;
+ };
+ p.relativeTo = function(base) {
+ var relative = this.clone().normalize();
+ var relativeParts, baseParts, common, relativePath, basePath;
+
+ if (relative._parts.urn) {
+ throw new Error('URNs do not have any generally defined hierarchical components');
+ }
+
+ base = new URI(base).normalize();
+ relativeParts = relative._parts;
+ baseParts = base._parts;
+ relativePath = relative.path();
+ basePath = base.path();
+
+ if (relativePath.charAt(0) !== '/') {
+ throw new Error('URI is already relative');
+ }
+
+ if (basePath.charAt(0) !== '/') {
+ throw new Error('Cannot calculate a URI relative to another relative URI');
+ }
+
+ if (relativeParts.protocol === baseParts.protocol) {
+ relativeParts.protocol = null;
+ }
+
+ if (relativeParts.username !== baseParts.username || relativeParts.password !== baseParts.password) {
+ return relative.build();
+ }
+
+ if (relativeParts.protocol !== null || relativeParts.username !== null || relativeParts.password !== null) {
+ return relative.build();
+ }
+
+ if (relativeParts.hostname === baseParts.hostname && relativeParts.port === baseParts.port) {
+ relativeParts.hostname = null;
+ relativeParts.port = null;
+ } else {
+ return relative.build();
+ }
+
+ if (relativePath === basePath) {
+ relativeParts.path = '';
+ return relative.build();
+ }
+
+ // determine common sub path
+ common = URI.commonPath(relativePath, basePath);
+
+ // If the paths have nothing in common, return a relative URL with the absolute path.
+ if (!common) {
+ return relative.build();
+ }
+
+ var parents = baseParts.path
+ .substring(common.length)
+ .replace(/[^\/]*$/, '')
+ .replace(/.*?\//g, '../');
+
+ relativeParts.path = (parents + relativeParts.path.substring(common.length)) || './';
+
+ return relative.build();
+ };
+
+ // comparing URIs
+ p.equals = function(uri) {
+ var one = this.clone();
+ var two = new URI(uri);
+ var one_map = {};
+ var two_map = {};
+ var checked = {};
+ var one_query, two_query, key;
+
+ one.normalize();
+ two.normalize();
+
+ // exact match
+ if (one.toString() === two.toString()) {
+ return true;
+ }
+
+ // extract query string
+ one_query = one.query();
+ two_query = two.query();
+ one.query('');
+ two.query('');
+
+ // definitely not equal if not even non-query parts match
+ if (one.toString() !== two.toString()) {
+ return false;
+ }
+
+ // query parameters have the same length, even if they're permuted
+ if (one_query.length !== two_query.length) {
+ return false;
+ }
+
+ one_map = URI.parseQuery(one_query, this._parts.escapeQuerySpace);
+ two_map = URI.parseQuery(two_query, this._parts.escapeQuerySpace);
+
+ for (key in one_map) {
+ if (hasOwn.call(one_map, key)) {
+ if (!isArray(one_map[key])) {
+ if (one_map[key] !== two_map[key]) {
+ return false;
+ }
+ } else if (!arraysEqual(one_map[key], two_map[key])) {
+ return false;
+ }
+
+ checked[key] = true;
+ }
+ }
+
+ for (key in two_map) {
+ if (hasOwn.call(two_map, key)) {
+ if (!checked[key]) {
+ // two contains a parameter not present in one
+ return false;
+ }
+ }
+ }
+
+ return true;
+ };
+
+ // state
+ p.duplicateQueryParameters = function(v) {
+ this._parts.duplicateQueryParameters = !!v;
+ return this;
+ };
+
+ p.escapeQuerySpace = function(v) {
+ this._parts.escapeQuerySpace = !!v;
+ return this;
+ };
+
+ return URI;
+}));
diff --git a/lib/vendor/jed.js b/lib/vendor/jed.js
new file mode 100644
index 000000000..fad370d83
--- /dev/null
+++ b/lib/vendor/jed.js
@@ -0,0 +1,1022 @@
+/**
+ * @preserve jed.js https://github.com/SlexAxton/Jed
+ */
+/*
+-----------
+A gettext compatible i18n library for modern JavaScript Applications
+
+by Alex Sexton - AlexSexton [at] gmail - @SlexAxton
+WTFPL license for use
+Dojo CLA for contributions
+
+Jed offers the entire applicable GNU gettext spec'd set of
+functions, but also offers some nicer wrappers around them.
+The api for gettext was written for a language with no function
+overloading, so Jed allows a little more of that.
+
+Many thanks to Joshua I. Miller - unrtst@cpan.org - who wrote
+gettext.js back in 2008. I was able to vet a lot of my ideas
+against his. I also made sure Jed passed against his tests
+in order to offer easy upgrades -- jsgettext.berlios.de
+*/
+(function (root, undef) {
+
+ // Set up some underscore-style functions, if you already have
+ // underscore, feel free to delete this section, and use it
+ // directly, however, the amount of functions used doesn't
+ // warrant having underscore as a full dependency.
+ // Underscore 1.3.0 was used to port and is licensed
+ // under the MIT License by Jeremy Ashkenas.
+ var ArrayProto = Array.prototype,
+ ObjProto = Object.prototype,
+ slice = ArrayProto.slice,
+ hasOwnProp = ObjProto.hasOwnProperty,
+ nativeForEach = ArrayProto.forEach,
+ breaker = {};
+
+ // We're not using the OOP style _ so we don't need the
+ // extra level of indirection. This still means that you
+ // sub out for real `_` though.
+ var _ = {
+ forEach : function( obj, iterator, context ) {
+ var i, l, key;
+ if ( obj === null ) {
+ return;
+ }
+
+ if ( nativeForEach && obj.forEach === nativeForEach ) {
+ obj.forEach( iterator, context );
+ }
+ else if ( obj.length === +obj.length ) {
+ for ( i = 0, l = obj.length; i < l; i++ ) {
+ if ( i in obj && iterator.call( context, obj[i], i, obj ) === breaker ) {
+ return;
+ }
+ }
+ }
+ else {
+ for ( key in obj) {
+ if ( hasOwnProp.call( obj, key ) ) {
+ if ( iterator.call (context, obj[key], key, obj ) === breaker ) {
+ return;
+ }
+ }
+ }
+ }
+ },
+ extend : function( obj ) {
+ this.forEach( slice.call( arguments, 1 ), function ( source ) {
+ for ( var prop in source ) {
+ obj[prop] = source[prop];
+ }
+ });
+ return obj;
+ }
+ };
+ // END Miniature underscore impl
+
+ // Jed is a constructor function
+ var Jed = function ( options ) {
+ // Some minimal defaults
+ this.defaults = {
+ "locale_data" : {
+ "messages" : {
+ "" : {
+ "domain" : "messages",
+ "lang" : "en",
+ "plural_forms" : "nplurals=2; plural=(n != 1);"
+ }
+ // There are no default keys, though
+ }
+ },
+ // The default domain if one is missing
+ "domain" : "messages",
+ // enable debug mode to log untranslated strings to the console
+ "debug" : false
+ };
+
+ // Mix in the sent options with the default options
+ this.options = _.extend( {}, this.defaults, options );
+ this.textdomain( this.options.domain );
+
+ if ( options.domain && ! this.options.locale_data[ this.options.domain ] ) {
+ throw new Error('Text domain set to non-existent domain: `' + options.domain + '`');
+ }
+ };
+
+ // The gettext spec sets this character as the default
+ // delimiter for context lookups.
+ // e.g.: context\u0004key
+ // If your translation company uses something different,
+ // just change this at any time and it will use that instead.
+ Jed.context_delimiter = String.fromCharCode( 4 );
+
+ function getPluralFormFunc ( plural_form_string ) {
+ return Jed.PF.compile( plural_form_string || "nplurals=2; plural=(n != 1);");
+ }
+
+ function Chain( key, i18n ){
+ this._key = key;
+ this._i18n = i18n;
+ }
+
+ // Create a chainable api for adding args prettily
+ _.extend( Chain.prototype, {
+ onDomain : function ( domain ) {
+ this._domain = domain;
+ return this;
+ },
+ withContext : function ( context ) {
+ this._context = context;
+ return this;
+ },
+ ifPlural : function ( num, pkey ) {
+ this._val = num;
+ this._pkey = pkey;
+ return this;
+ },
+ fetch : function ( sArr ) {
+ if ( {}.toString.call( sArr ) != '[object Array]' ) {
+ sArr = [].slice.call(arguments, 0);
+ }
+ return ( sArr && sArr.length ? Jed.sprintf : function(x){ return x; } )(
+ this._i18n.dcnpgettext(this._domain, this._context, this._key, this._pkey, this._val),
+ sArr
+ );
+ }
+ });
+
+ // Add functions to the Jed prototype.
+ // These will be the functions on the object that's returned
+ // from creating a `new Jed()`
+ // These seem redundant, but they gzip pretty well.
+ _.extend( Jed.prototype, {
+ // The sexier api start point
+ translate : function ( key ) {
+ return new Chain( key, this );
+ },
+
+ textdomain : function ( domain ) {
+ if ( ! domain ) {
+ return this._textdomain;
+ }
+ this._textdomain = domain;
+ },
+
+ gettext : function ( key ) {
+ return this.dcnpgettext.call( this, undef, undef, key );
+ },
+
+ dgettext : function ( domain, key ) {
+ return this.dcnpgettext.call( this, domain, undef, key );
+ },
+
+ dcgettext : function ( domain , key /*, category */ ) {
+ // Ignores the category anyways
+ return this.dcnpgettext.call( this, domain, undef, key );
+ },
+
+ ngettext : function ( skey, pkey, val ) {
+ return this.dcnpgettext.call( this, undef, undef, skey, pkey, val );
+ },
+
+ dngettext : function ( domain, skey, pkey, val ) {
+ return this.dcnpgettext.call( this, domain, undef, skey, pkey, val );
+ },
+
+ dcngettext : function ( domain, skey, pkey, val/*, category */) {
+ return this.dcnpgettext.call( this, domain, undef, skey, pkey, val );
+ },
+
+ pgettext : function ( context, key ) {
+ return this.dcnpgettext.call( this, undef, context, key );
+ },
+
+ dpgettext : function ( domain, context, key ) {
+ return this.dcnpgettext.call( this, domain, context, key );
+ },
+
+ dcpgettext : function ( domain, context, key/*, category */) {
+ return this.dcnpgettext.call( this, domain, context, key );
+ },
+
+ npgettext : function ( context, skey, pkey, val ) {
+ return this.dcnpgettext.call( this, undef, context, skey, pkey, val );
+ },
+
+ dnpgettext : function ( domain, context, skey, pkey, val ) {
+ return this.dcnpgettext.call( this, domain, context, skey, pkey, val );
+ },
+
+ // The most fully qualified gettext function. It has every option.
+ // Since it has every option, we can use it from every other method.
+ // This is the bread and butter.
+ // Technically there should be one more argument in this function for 'Category',
+ // but since we never use it, we might as well not waste the bytes to define it.
+ dcnpgettext : function ( domain, context, singular_key, plural_key, val ) {
+ // Set some defaults
+
+ plural_key = plural_key || singular_key;
+
+ // Use the global domain default if one
+ // isn't explicitly passed in
+ domain = domain || this._textdomain;
+
+ var fallback;
+
+ // Handle special cases
+
+ // No options found
+ if ( ! this.options ) {
+ // There's likely something wrong, but we'll return the correct key for english
+ // We do this by instantiating a brand new Jed instance with the default set
+ // for everything that could be broken.
+ fallback = new Jed();
+ return fallback.dcnpgettext.call( fallback, undefined, undefined, singular_key, plural_key, val );
+ }
+
+ // No translation data provided
+ if ( ! this.options.locale_data ) {
+ throw new Error('No locale data provided.');
+ }
+
+ if ( ! this.options.locale_data[ domain ] ) {
+ throw new Error('Domain `' + domain + '` was not found.');
+ }
+
+ if ( ! this.options.locale_data[ domain ][ "" ] ) {
+ throw new Error('No locale meta information provided.');
+ }
+
+ // Make sure we have a truthy key. Otherwise we might start looking
+ // into the empty string key, which is the options for the locale
+ // data.
+ if ( ! singular_key ) {
+ throw new Error('No translation key found.');
+ }
+
+ var key = context ? context + Jed.context_delimiter + singular_key : singular_key,
+ locale_data = this.options.locale_data,
+ dict = locale_data[ domain ],
+ defaultConf = (locale_data.messages || this.defaults.locale_data.messages)[""],
+ pluralForms = dict[""].plural_forms || dict[""]["Plural-Forms"] || dict[""]["plural-forms"] || defaultConf.plural_forms || defaultConf["Plural-Forms"] || defaultConf["plural-forms"],
+ val_list,
+ res;
+
+ var val_idx;
+ if (val === undefined) {
+ // No value passed in; assume singular key lookup.
+ val_idx = 0;
+
+ } else {
+ // Value has been passed in; use plural-forms calculations.
+
+ // Handle invalid numbers, but try casting strings for good measure
+ if ( typeof val != 'number' ) {
+ val = parseInt( val, 10 );
+
+ if ( isNaN( val ) ) {
+ throw new Error('The number that was passed in is not a number.');
+ }
+ }
+
+ val_idx = getPluralFormFunc(pluralForms)(val);
+ }
+
+ // Throw an error if a domain isn't found
+ if ( ! dict ) {
+ throw new Error('No domain named `' + domain + '` could be found.');
+ }
+
+ val_list = dict[ key ];
+
+ // If there is no match, then revert back to
+ // english style singular/plural with the keys passed in.
+ if ( ! val_list || val_idx > val_list.length ) {
+ if (this.options.missing_key_callback) {
+ this.options.missing_key_callback(key, domain);
+ }
+ res = [ singular_key, plural_key ];
+
+ // collect untranslated strings
+ if (this.options.debug===true) {
+ console.log(res[ getPluralFormFunc(pluralForms)( val ) ]);
+ }
+ return res[ getPluralFormFunc()( val ) ];
+ }
+
+ res = val_list[ val_idx ];
+
+ // This includes empty strings on purpose
+ if ( ! res ) {
+ res = [ singular_key, plural_key ];
+ return res[ getPluralFormFunc()( val ) ];
+ }
+ return res;
+ }
+ });
+
+
+ // We add in sprintf capabilities for post translation value interolation
+ // This is not internally used, so you can remove it if you have this
+ // available somewhere else, or want to use a different system.
+
+ // We _slightly_ modify the normal sprintf behavior to more gracefully handle
+ // undefined values.
+
+ /**
+ sprintf() for JavaScript 0.7-beta1
+ http://www.diveintojavascript.com/projects/javascript-sprintf
+
+ Copyright (c) Alexandru Marasteanu <alexaholic [at) gmail (dot] com>
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ * Neither the name of sprintf() for JavaScript nor the
+ names of its contributors may be used to endorse or promote products
+ derived from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED. IN NO EVENT SHALL Alexandru Marasteanu BE LIABLE FOR ANY
+ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+ var sprintf = (function() {
+ function get_type(variable) {
+ return Object.prototype.toString.call(variable).slice(8, -1).toLowerCase();
+ }
+ function str_repeat(input, multiplier) {
+ for (var output = []; multiplier > 0; output[--multiplier] = input) {/* do nothing */}
+ return output.join('');
+ }
+
+ var str_format = function() {
+ if (!str_format.cache.hasOwnProperty(arguments[0])) {
+ str_format.cache[arguments[0]] = str_format.parse(arguments[0]);
+ }
+ return str_format.format.call(null, str_format.cache[arguments[0]], arguments);
+ };
+
+ str_format.format = function(parse_tree, argv) {
+ var cursor = 1, tree_length = parse_tree.length, node_type = '', arg, output = [], i, k, match, pad, pad_character, pad_length;
+ for (i = 0; i < tree_length; i++) {
+ node_type = get_type(parse_tree[i]);
+ if (node_type === 'string') {
+ output.push(parse_tree[i]);
+ }
+ else if (node_type === 'array') {
+ match = parse_tree[i]; // convenience purposes only
+ if (match[2]) { // keyword argument
+ arg = argv[cursor];
+ for (k = 0; k < match[2].length; k++) {
+ if (!arg.hasOwnProperty(match[2][k])) {
+ throw(sprintf('[sprintf] property "%s" does not exist', match[2][k]));
+ }
+ arg = arg[match[2][k]];
+ }
+ }
+ else if (match[1]) { // positional argument (explicit)
+ arg = argv[match[1]];
+ }
+ else { // positional argument (implicit)
+ arg = argv[cursor++];
+ }
+
+ if (/[^s]/.test(match[8]) && (get_type(arg) != 'number')) {
+ throw(sprintf('[sprintf] expecting number but found %s', get_type(arg)));
+ }
+
+ // Jed EDIT
+ if ( typeof arg == 'undefined' || arg === null ) {
+ arg = '';
+ }
+ // Jed EDIT
+
+ switch (match[8]) {
+ case 'b': arg = arg.toString(2); break;
+ case 'c': arg = String.fromCharCode(arg); break;
+ case 'd': arg = parseInt(arg, 10); break;
+ case 'e': arg = match[7] ? arg.toExponential(match[7]) : arg.toExponential(); break;
+ case 'f': arg = match[7] ? parseFloat(arg).toFixed(match[7]) : parseFloat(arg); break;
+ case 'o': arg = arg.toString(8); break;
+ case 's': arg = ((arg = String(arg)) && match[7] ? arg.substring(0, match[7]) : arg); break;
+ case 'u': arg = Math.abs(arg); break;
+ case 'x': arg = arg.toString(16); break;
+ case 'X': arg = arg.toString(16).toUpperCase(); break;
+ }
+ arg = (/[def]/.test(match[8]) && match[3] && arg >= 0 ? '+'+ arg : arg);
+ pad_character = match[4] ? match[4] == '0' ? '0' : match[4].charAt(1) : ' ';
+ pad_length = match[6] - String(arg).length;
+ pad = match[6] ? str_repeat(pad_character, pad_length) : '';
+ output.push(match[5] ? arg + pad : pad + arg);
+ }
+ }
+ return output.join('');
+ };
+
+ str_format.cache = {};
+
+ str_format.parse = function(fmt) {
+ var _fmt = fmt, match = [], parse_tree = [], arg_names = 0;
+ while (_fmt) {
+ if ((match = /^[^\x25]+/.exec(_fmt)) !== null) {
+ parse_tree.push(match[0]);
+ }
+ else if ((match = /^\x25{2}/.exec(_fmt)) !== null) {
+ parse_tree.push('%');
+ }
+ else if ((match = /^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-fosuxX])/.exec(_fmt)) !== null) {
+ if (match[2]) {
+ arg_names |= 1;
+ var field_list = [], replacement_field = match[2], field_match = [];
+ if ((field_match = /^([a-z_][a-z_\d]*)/i.exec(replacement_field)) !== null) {
+ field_list.push(field_match[1]);
+ while ((replacement_field = replacement_field.substring(field_match[0].length)) !== '') {
+ if ((field_match = /^\.([a-z_][a-z_\d]*)/i.exec(replacement_field)) !== null) {
+ field_list.push(field_match[1]);
+ }
+ else if ((field_match = /^\[(\d+)\]/.exec(replacement_field)) !== null) {
+ field_list.push(field_match[1]);
+ }
+ else {
+ throw('[sprintf] huh?');
+ }
+ }
+ }
+ else {
+ throw('[sprintf] huh?');
+ }
+ match[2] = field_list;
+ }
+ else {
+ arg_names |= 2;
+ }
+ if (arg_names === 3) {
+ throw('[sprintf] mixing positional and named placeholders is not (yet) supported');
+ }
+ parse_tree.push(match);
+ }
+ else {
+ throw('[sprintf] huh?');
+ }
+ _fmt = _fmt.substring(match[0].length);
+ }
+ return parse_tree;
+ };
+
+ return str_format;
+ })();
+
+ var vsprintf = function(fmt, argv) {
+ argv.unshift(fmt);
+ return sprintf.apply(null, argv);
+ };
+
+ Jed.parse_plural = function ( plural_forms, n ) {
+ plural_forms = plural_forms.replace(/n/g, n);
+ return Jed.parse_expression(plural_forms);
+ };
+
+ Jed.sprintf = function ( fmt, args ) {
+ if ( {}.toString.call( args ) == '[object Array]' ) {
+ return vsprintf( fmt, [].slice.call(args) );
+ }
+ return sprintf.apply(this, [].slice.call(arguments) );
+ };
+
+ Jed.prototype.sprintf = function () {
+ return Jed.sprintf.apply(this, arguments);
+ };
+ // END sprintf Implementation
+
+ // Start the Plural forms section
+ // This is a full plural form expression parser. It is used to avoid
+ // running 'eval' or 'new Function' directly against the plural
+ // forms.
+ //
+ // This can be important if you get translations done through a 3rd
+ // party vendor. I encourage you to use this instead, however, I
+ // also will provide a 'precompiler' that you can use at build time
+ // to output valid/safe function representations of the plural form
+ // expressions. This means you can build this code out for the most
+ // part.
+ Jed.PF = {};
+
+ Jed.PF.parse = function ( p ) {
+ var plural_str = Jed.PF.extractPluralExpr( p );
+ return Jed.PF.parser.parse.call(Jed.PF.parser, plural_str);
+ };
+
+ Jed.PF.compile = function ( p ) {
+ // Handle trues and falses as 0 and 1
+ function imply( val ) {
+ return (val === true ? 1 : val ? val : 0);
+ }
+
+ var ast = Jed.PF.parse( p );
+ return function ( n ) {
+ return imply( Jed.PF.interpreter( ast )( n ) );
+ };
+ };
+
+ Jed.PF.interpreter = function ( ast ) {
+ return function ( n ) {
+ var res;
+ switch ( ast.type ) {
+ case 'GROUP':
+ return Jed.PF.interpreter( ast.expr )( n );
+ case 'TERNARY':
+ if ( Jed.PF.interpreter( ast.expr )( n ) ) {
+ return Jed.PF.interpreter( ast.truthy )( n );
+ }
+ return Jed.PF.interpreter( ast.falsey )( n );
+ case 'OR':
+ return Jed.PF.interpreter( ast.left )( n ) || Jed.PF.interpreter( ast.right )( n );
+ case 'AND':
+ return Jed.PF.interpreter( ast.left )( n ) && Jed.PF.interpreter( ast.right )( n );
+ case 'LT':
+ return Jed.PF.interpreter( ast.left )( n ) < Jed.PF.interpreter( ast.right )( n );
+ case 'GT':
+ return Jed.PF.interpreter( ast.left )( n ) > Jed.PF.interpreter( ast.right )( n );
+ case 'LTE':
+ return Jed.PF.interpreter( ast.left )( n ) <= Jed.PF.interpreter( ast.right )( n );
+ case 'GTE':
+ return Jed.PF.interpreter( ast.left )( n ) >= Jed.PF.interpreter( ast.right )( n );
+ case 'EQ':
+ return Jed.PF.interpreter( ast.left )( n ) == Jed.PF.interpreter( ast.right )( n );
+ case 'NEQ':
+ return Jed.PF.interpreter( ast.left )( n ) != Jed.PF.interpreter( ast.right )( n );
+ case 'MOD':
+ return Jed.PF.interpreter( ast.left )( n ) % Jed.PF.interpreter( ast.right )( n );
+ case 'VAR':
+ return n;
+ case 'NUM':
+ return ast.val;
+ default:
+ throw new Error("Invalid Token found.");
+ }
+ };
+ };
+
+ Jed.PF.extractPluralExpr = function ( p ) {
+ // trim first
+ p = p.replace(/^\s\s*/, '').replace(/\s\s*$/, '');
+
+ if (! /;\s*$/.test(p)) {
+ p = p.concat(';');
+ }
+
+ var nplurals_re = /nplurals\=(\d+);/,
+ plural_re = /plural\=(.*);/,
+ nplurals_matches = p.match( nplurals_re ),
+ res = {},
+ plural_matches;
+
+ // Find the nplurals number
+ if ( nplurals_matches.length > 1 ) {
+ res.nplurals = nplurals_matches[1];
+ }
+ else {
+ throw new Error('nplurals not found in plural_forms string: ' + p );
+ }
+
+ // remove that data to get to the formula
+ p = p.replace( nplurals_re, "" );
+ plural_matches = p.match( plural_re );
+
+ if (!( plural_matches && plural_matches.length > 1 ) ) {
+ throw new Error('`plural` expression not found: ' + p);
+ }
+ return plural_matches[ 1 ];
+ };
+
+ /* Jison generated parser */
+ Jed.PF.parser = (function(){
+
+var parser = {trace: function trace() { },
+yy: {},
+symbols_: {"error":2,"expressions":3,"e":4,"EOF":5,"?":6,":":7,"||":8,"&&":9,"<":10,"<=":11,">":12,">=":13,"!=":14,"==":15,"%":16,"(":17,")":18,"n":19,"NUMBER":20,"$accept":0,"$end":1},
+terminals_: {2:"error",5:"EOF",6:"?",7:":",8:"||",9:"&&",10:"<",11:"<=",12:">",13:">=",14:"!=",15:"==",16:"%",17:"(",18:")",19:"n",20:"NUMBER"},
+productions_: [0,[3,2],[4,5],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,1],[4,1]],
+performAction: function anonymous(yytext,yyleng,yylineno,yy,yystate,$$,_$) {
+
+var $0 = $$.length - 1;
+switch (yystate) {
+case 1: return { type : 'GROUP', expr: $$[$0-1] };
+break;
+case 2:this.$ = { type: 'TERNARY', expr: $$[$0-4], truthy : $$[$0-2], falsey: $$[$0] };
+break;
+case 3:this.$ = { type: "OR", left: $$[$0-2], right: $$[$0] };
+break;
+case 4:this.$ = { type: "AND", left: $$[$0-2], right: $$[$0] };
+break;
+case 5:this.$ = { type: 'LT', left: $$[$0-2], right: $$[$0] };
+break;
+case 6:this.$ = { type: 'LTE', left: $$[$0-2], right: $$[$0] };
+break;
+case 7:this.$ = { type: 'GT', left: $$[$0-2], right: $$[$0] };
+break;
+case 8:this.$ = { type: 'GTE', left: $$[$0-2], right: $$[$0] };
+break;
+case 9:this.$ = { type: 'NEQ', left: $$[$0-2], right: $$[$0] };
+break;
+case 10:this.$ = { type: 'EQ', left: $$[$0-2], right: $$[$0] };
+break;
+case 11:this.$ = { type: 'MOD', left: $$[$0-2], right: $$[$0] };
+break;
+case 12:this.$ = { type: 'GROUP', expr: $$[$0-1] };
+break;
+case 13:this.$ = { type: 'VAR' };
+break;
+case 14:this.$ = { type: 'NUM', val: Number(yytext) };
+break;
+}
+},
+table: [{3:1,4:2,17:[1,3],19:[1,4],20:[1,5]},{1:[3]},{5:[1,6],6:[1,7],8:[1,8],9:[1,9],10:[1,10],11:[1,11],12:[1,12],13:[1,13],14:[1,14],15:[1,15],16:[1,16]},{4:17,17:[1,3],19:[1,4],20:[1,5]},{5:[2,13],6:[2,13],7:[2,13],8:[2,13],9:[2,13],10:[2,13],11:[2,13],12:[2,13],13:[2,13],14:[2,13],15:[2,13],16:[2,13],18:[2,13]},{5:[2,14],6:[2,14],7:[2,14],8:[2,14],9:[2,14],10:[2,14],11:[2,14],12:[2,14],13:[2,14],14:[2,14],15:[2,14],16:[2,14],18:[2,14]},{1:[2,1]},{4:18,17:[1,3],19:[1,4],20:[1,5]},{4:19,17:[1,3],19:[1,4],20:[1,5]},{4:20,17:[1,3],19:[1,4],20:[1,5]},{4:21,17:[1,3],19:[1,4],20:[1,5]},{4:22,17:[1,3],19:[1,4],20:[1,5]},{4:23,17:[1,3],19:[1,4],20:[1,5]},{4:24,17:[1,3],19:[1,4],20:[1,5]},{4:25,17:[1,3],19:[1,4],20:[1,5]},{4:26,17:[1,3],19:[1,4],20:[1,5]},{4:27,17:[1,3],19:[1,4],20:[1,5]},{6:[1,7],8:[1,8],9:[1,9],10:[1,10],11:[1,11],12:[1,12],13:[1,13],14:[1,14],15:[1,15],16:[1,16],18:[1,28]},{6:[1,7],7:[1,29],8:[1,8],9:[1,9],10:[1,10],11:[1,11],12:[1,12],13:[1,13],14:[1,14],15:[1,15],16:[1,16]},{5:[2,3],6:[2,3],7:[2,3],8:[2,3],9:[1,9],10:[1,10],11:[1,11],12:[1,12],13:[1,13],14:[1,14],15:[1,15],16:[1,16],18:[2,3]},{5:[2,4],6:[2,4],7:[2,4],8:[2,4],9:[2,4],10:[1,10],11:[1,11],12:[1,12],13:[1,13],14:[1,14],15:[1,15],16:[1,16],18:[2,4]},{5:[2,5],6:[2,5],7:[2,5],8:[2,5],9:[2,5],10:[2,5],11:[2,5],12:[2,5],13:[2,5],14:[2,5],15:[2,5],16:[1,16],18:[2,5]},{5:[2,6],6:[2,6],7:[2,6],8:[2,6],9:[2,6],10:[2,6],11:[2,6],12:[2,6],13:[2,6],14:[2,6],15:[2,6],16:[1,16],18:[2,6]},{5:[2,7],6:[2,7],7:[2,7],8:[2,7],9:[2,7],10:[2,7],11:[2,7],12:[2,7],13:[2,7],14:[2,7],15:[2,7],16:[1,16],18:[2,7]},{5:[2,8],6:[2,8],7:[2,8],8:[2,8],9:[2,8],10:[2,8],11:[2,8],12:[2,8],13:[2,8],14:[2,8],15:[2,8],16:[1,16],18:[2,8]},{5:[2,9],6:[2,9],7:[2,9],8:[2,9],9:[2,9],10:[2,9],11:[2,9],12:[2,9],13:[2,9],14:[2,9],15:[2,9],16:[1,16],18:[2,9]},{5:[2,10],6:[2,10],7:[2,10],8:[2,10],9:[2,10],10:[2,10],11:[2,10],12:[2,10],13:[2,10],14:[2,10],15:[2,10],16:[1,16],18:[2,10]},{5:[2,11],6:[2,11],7:[2,11],8:[2,11],9:[2,11],10:[2,11],11:[2,11],12:[2,11],13:[2,11],14:[2,11],15:[2,11],16:[2,11],18:[2,11]},{5:[2,12],6:[2,12],7:[2,12],8:[2,12],9:[2,12],10:[2,12],11:[2,12],12:[2,12],13:[2,12],14:[2,12],15:[2,12],16:[2,12],18:[2,12]},{4:30,17:[1,3],19:[1,4],20:[1,5]},{5:[2,2],6:[1,7],7:[2,2],8:[1,8],9:[1,9],10:[1,10],11:[1,11],12:[1,12],13:[1,13],14:[1,14],15:[1,15],16:[1,16],18:[2,2]}],
+defaultActions: {6:[2,1]},
+parseError: function parseError(str, hash) {
+ throw new Error(str);
+},
+parse: function parse(input) {
+ var self = this,
+ stack = [0],
+ vstack = [null], // semantic value stack
+ lstack = [], // location stack
+ table = this.table,
+ yytext = '',
+ yylineno = 0,
+ yyleng = 0,
+ recovering = 0,
+ TERROR = 2,
+ EOF = 1;
+
+ //this.reductionCount = this.shiftCount = 0;
+
+ this.lexer.setInput(input);
+ this.lexer.yy = this.yy;
+ this.yy.lexer = this.lexer;
+ if (typeof this.lexer.yylloc == 'undefined')
+ this.lexer.yylloc = {};
+ var yyloc = this.lexer.yylloc;
+ lstack.push(yyloc);
+
+ if (typeof this.yy.parseError === 'function')
+ this.parseError = this.yy.parseError;
+
+ function popStack (n) {
+ stack.length = stack.length - 2*n;
+ vstack.length = vstack.length - n;
+ lstack.length = lstack.length - n;
+ }
+
+ function lex() {
+ var token;
+ token = self.lexer.lex() || 1; // $end = 1
+ // if token isn't its numeric value, convert
+ if (typeof token !== 'number') {
+ token = self.symbols_[token] || token;
+ }
+ return token;
+ }
+
+ var symbol, preErrorSymbol, state, action, a, r, yyval={},p,len,newState, expected;
+ while (true) {
+ // retreive state number from top of stack
+ state = stack[stack.length-1];
+
+ // use default actions if available
+ if (this.defaultActions[state]) {
+ action = this.defaultActions[state];
+ } else {
+ if (symbol == null)
+ symbol = lex();
+ // read action for current state and first input
+ action = table[state] && table[state][symbol];
+ }
+
+ // handle parse error
+ _handle_error:
+ if (typeof action === 'undefined' || !action.length || !action[0]) {
+
+ if (!recovering) {
+ // Report error
+ expected = [];
+ for (p in table[state]) if (this.terminals_[p] && p > 2) {
+ expected.push("'"+this.terminals_[p]+"'");
+ }
+ var errStr = '';
+ if (this.lexer.showPosition) {
+ errStr = 'Parse error on line '+(yylineno+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+expected.join(', ') + ", got '" + this.terminals_[symbol]+ "'";
+ } else {
+ errStr = 'Parse error on line '+(yylineno+1)+": Unexpected " +
+ (symbol == 1 /*EOF*/ ? "end of input" :
+ ("'"+(this.terminals_[symbol] || symbol)+"'"));
+ }
+ this.parseError(errStr,
+ {text: this.lexer.match, token: this.terminals_[symbol] || symbol, line: this.lexer.yylineno, loc: yyloc, expected: expected});
+ }
+
+ // just recovered from another error
+ if (recovering == 3) {
+ if (symbol == EOF) {
+ throw new Error(errStr || 'Parsing halted.');
+ }
+
+ // discard current lookahead and grab another
+ yyleng = this.lexer.yyleng;
+ yytext = this.lexer.yytext;
+ yylineno = this.lexer.yylineno;
+ yyloc = this.lexer.yylloc;
+ symbol = lex();
+ }
+
+ // try to recover from error
+ while (1) {
+ // check for error recovery rule in this state
+ if ((TERROR.toString()) in table[state]) {
+ break;
+ }
+ if (state == 0) {
+ throw new Error(errStr || 'Parsing halted.');
+ }
+ popStack(1);
+ state = stack[stack.length-1];
+ }
+
+ preErrorSymbol = symbol; // save the lookahead token
+ symbol = TERROR; // insert generic error symbol as new lookahead
+ state = stack[stack.length-1];
+ action = table[state] && table[state][TERROR];
+ recovering = 3; // allow 3 real symbols to be shifted before reporting a new error
+ }
+
+ // this shouldn't happen, unless resolve defaults are off
+ if (action[0] instanceof Array && action.length > 1) {
+ throw new Error('Parse Error: multiple actions possible at state: '+state+', token: '+symbol);
+ }
+
+ switch (action[0]) {
+
+ case 1: // shift
+ //this.shiftCount++;
+
+ stack.push(symbol);
+ vstack.push(this.lexer.yytext);
+ lstack.push(this.lexer.yylloc);
+ stack.push(action[1]); // push state
+ symbol = null;
+ if (!preErrorSymbol) { // normal execution/no error
+ yyleng = this.lexer.yyleng;
+ yytext = this.lexer.yytext;
+ yylineno = this.lexer.yylineno;
+ yyloc = this.lexer.yylloc;
+ if (recovering > 0)
+ recovering--;
+ } else { // error just occurred, resume old lookahead f/ before error
+ symbol = preErrorSymbol;
+ preErrorSymbol = null;
+ }
+ break;
+
+ case 2: // reduce
+ //this.reductionCount++;
+
+ len = this.productions_[action[1]][1];
+
+ // perform semantic action
+ yyval.$ = vstack[vstack.length-len]; // default to $$ = $1
+ // default location, uses first token for firsts, last for lasts
+ yyval._$ = {
+ first_line: lstack[lstack.length-(len||1)].first_line,
+ last_line: lstack[lstack.length-1].last_line,
+ first_column: lstack[lstack.length-(len||1)].first_column,
+ last_column: lstack[lstack.length-1].last_column
+ };
+ r = this.performAction.call(yyval, yytext, yyleng, yylineno, this.yy, action[1], vstack, lstack);
+
+ if (typeof r !== 'undefined') {
+ return r;
+ }
+
+ // pop off stack
+ if (len) {
+ stack = stack.slice(0,-1*len*2);
+ vstack = vstack.slice(0, -1*len);
+ lstack = lstack.slice(0, -1*len);
+ }
+
+ stack.push(this.productions_[action[1]][0]); // push nonterminal (reduce)
+ vstack.push(yyval.$);
+ lstack.push(yyval._$);
+ // goto new state = table[STATE][NONTERMINAL]
+ newState = table[stack[stack.length-2]][stack[stack.length-1]];
+ stack.push(newState);
+ break;
+
+ case 3: // accept
+ return true;
+ }
+
+ }
+
+ return true;
+}};/* Jison generated lexer */
+var lexer = (function(){
+
+var lexer = ({EOF:1,
+parseError:function parseError(str, hash) {
+ if (this.yy.parseError) {
+ this.yy.parseError(str, hash);
+ } else {
+ throw new Error(str);
+ }
+ },
+setInput:function (input) {
+ this._input = input;
+ this._more = this._less = this.done = false;
+ this.yylineno = this.yyleng = 0;
+ this.yytext = this.matched = this.match = '';
+ this.conditionStack = ['INITIAL'];
+ this.yylloc = {first_line:1,first_column:0,last_line:1,last_column:0};
+ return this;
+ },
+input:function () {
+ var ch = this._input[0];
+ this.yytext+=ch;
+ this.yyleng++;
+ this.match+=ch;
+ this.matched+=ch;
+ var lines = ch.match(/\n/);
+ if (lines) this.yylineno++;
+ this._input = this._input.slice(1);
+ return ch;
+ },
+unput:function (ch) {
+ this._input = ch + this._input;
+ return this;
+ },
+more:function () {
+ this._more = true;
+ return this;
+ },
+pastInput:function () {
+ var past = this.matched.substr(0, this.matched.length - this.match.length);
+ return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\n/g, "");
+ },
+upcomingInput:function () {
+ var next = this.match;
+ if (next.length < 20) {
+ next += this._input.substr(0, 20-next.length);
+ }
+ return (next.substr(0,20)+(next.length > 20 ? '...':'')).replace(/\n/g, "");
+ },
+showPosition:function () {
+ var pre = this.pastInput();
+ var c = new Array(pre.length + 1).join("-");
+ return pre + this.upcomingInput() + "\n" + c+"^";
+ },
+next:function () {
+ if (this.done) {
+ return this.EOF;
+ }
+ if (!this._input) this.done = true;
+
+ var token,
+ match,
+ col,
+ lines;
+ if (!this._more) {
+ this.yytext = '';
+ this.match = '';
+ }
+ var rules = this._currentRules();
+ for (var i=0;i < rules.length; i++) {
+ match = this._input.match(this.rules[rules[i]]);
+ if (match) {
+ lines = match[0].match(/\n.*/g);
+ if (lines) this.yylineno += lines.length;
+ this.yylloc = {first_line: this.yylloc.last_line,
+ last_line: this.yylineno+1,
+ first_column: this.yylloc.last_column,
+ last_column: lines ? lines[lines.length-1].length-1 : this.yylloc.last_column + match[0].length}
+ this.yytext += match[0];
+ this.match += match[0];
+ this.matches = match;
+ this.yyleng = this.yytext.length;
+ this._more = false;
+ this._input = this._input.slice(match[0].length);
+ this.matched += match[0];
+ token = this.performAction.call(this, this.yy, this, rules[i],this.conditionStack[this.conditionStack.length-1]);
+ if (token) return token;
+ else return;
+ }
+ }
+ if (this._input === "") {
+ return this.EOF;
+ } else {
+ this.parseError('Lexical error on line '+(this.yylineno+1)+'. Unrecognized text.\n'+this.showPosition(),
+ {text: "", token: null, line: this.yylineno});
+ }
+ },
+lex:function lex() {
+ var r = this.next();
+ if (typeof r !== 'undefined') {
+ return r;
+ } else {
+ return this.lex();
+ }
+ },
+begin:function begin(condition) {
+ this.conditionStack.push(condition);
+ },
+popState:function popState() {
+ return this.conditionStack.pop();
+ },
+_currentRules:function _currentRules() {
+ return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules;
+ },
+topState:function () {
+ return this.conditionStack[this.conditionStack.length-2];
+ },
+pushState:function begin(condition) {
+ this.begin(condition);
+ }});
+lexer.performAction = function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) {
+
+var YYSTATE=YY_START;
+switch($avoiding_name_collisions) {
+case 0:/* skip whitespace */
+break;
+case 1:return 20
+break;
+case 2:return 19
+break;
+case 3:return 8
+break;
+case 4:return 9
+break;
+case 5:return 6
+break;
+case 6:return 7
+break;
+case 7:return 11
+break;
+case 8:return 13
+break;
+case 9:return 10
+break;
+case 10:return 12
+break;
+case 11:return 14
+break;
+case 12:return 15
+break;
+case 13:return 16
+break;
+case 14:return 17
+break;
+case 15:return 18
+break;
+case 16:return 5
+break;
+case 17:return 'INVALID'
+break;
+}
+};
+lexer.rules = [/^\s+/,/^[0-9]+(\.[0-9]+)?\b/,/^n\b/,/^\|\|/,/^&&/,/^\?/,/^:/,/^<=/,/^>=/,/^</,/^>/,/^!=/,/^==/,/^%/,/^\(/,/^\)/,/^$/,/^./];
+lexer.conditions = {"INITIAL":{"rules":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17],"inclusive":true}};return lexer;})()
+parser.lexer = lexer;
+return parser;
+})();
+// End parser
+
+ // Handle node, amd, and global systems
+ if (typeof exports !== 'undefined') {
+ if (typeof module !== 'undefined' && module.exports) {
+ exports = module.exports = Jed;
+ }
+ exports.Jed = Jed;
+ }
+ else {
+ if (typeof define === 'function' && define.amd) {
+ define('jed', function() {
+ return Jed;
+ });
+ }
+ // Leak a global regardless of module system
+ root['Jed'] = Jed;
+ }
+
+})(this);
diff --git a/lib/vendor/lodash.core.min.js b/lib/vendor/lodash.core.min.js
new file mode 100644
index 000000000..062e55d49
--- /dev/null
+++ b/lib/vendor/lodash.core.min.js
@@ -0,0 +1,29 @@
+/**
+ * @license
+ * lodash 4.0.0 (Custom Build) lodash.com/license | Underscore.js 1.8.3 underscorejs.org/LICENSE
+ * Build: `lodash core -o ./dist/lodash.core.js`
+ */
+;(function(){function n(n,t){for(var r=-1,e=t.length,u=n.length;++r<e;)n[u+r]=t[r];return n}function t(n,t,r){for(var e=-1,u=n.length;++e<u;){var o=n[e],i=t(o);if(null!=i&&(c===ln?i===i:r(i,c)))var c=i,f=o}return f}function r(n,t,r){var e;return r(n,function(n,r,u){return t(n,r,u)?(e=n,false):void 0}),e}function e(n,t,r,e,u){return u(n,function(n,u,o){r=e?(e=false,n):t(r,n,u,o)}),r}function u(n,t){return w(t,function(t){return n[t]})}function o(n){return n&&n.Object===Object?n:null}function i(n){return vn[n];
+}function c(n){var t=false;if(null!=n&&typeof n.toString!="function")try{t=!!(n+"")}catch(r){}return t}function f(n,t){return n=typeof n=="number"||hn.test(n)?+n:-1,n>-1&&0==n%1&&(null==t?9007199254740991:t)>n}function a(n){if(Z(n)&&!Vn(n)){if(n instanceof l)return n;if(En.call(n,"__wrapped__")){var t=new l(n.__wrapped__,n.__chain__);return t.__actions__=k(n.__actions__),t}}return new l(n)}function l(n,t){this.__wrapped__=n,this.__actions__=[],this.__chain__=!!t}function p(n,t,r,e){return n===ln||H(n,xn[r])&&!En.call(e,r)?t:n;
+}function s(n,t,r){if(typeof n!="function")throw new TypeError("Expected a function");return setTimeout(function(){n.apply(ln,r)},t)}function h(n,t){var r=true;return $n(n,function(n,e,u){return r=!!t(n,e,u)}),r}function v(n,t){var r=[];return $n(n,function(n,e,u){t(n,e,u)&&r.push(n)}),r}function y(t,r,e,u){u||(u=[]);for(var o=-1,i=t.length;++o<i;){var c=t[o];Z(c)&&Q(c)&&(e||Vn(c)||L(c))?r?y(c,r,e,u):n(u,c):e||(u[u.length]=c)}return u}function _(n,t){return n&&qn(n,t,un)}function g(n,t){return v(t,function(t){
+return W(n[t])})}function b(n,t,r,e,u){return n===t?true:null==n||null==t||!Y(n)&&!Z(t)?n!==n&&t!==t:j(n,t,b,r,e,u)}function j(n,t,r,e,u,o){var i=Vn(n),f=Vn(t),a="[object Array]",l="[object Array]";i||(a=kn.call(n),"[object Arguments]"==a&&(a="[object Object]")),f||(l=kn.call(t),"[object Arguments]"==l&&(l="[object Object]"));var p="[object Object]"==a&&!c(n),f="[object Object]"==l&&!c(t);return!(l=a==l)||i||p?2&u||(a=p&&En.call(n,"__wrapped__"),f=f&&En.call(t,"__wrapped__"),!a&&!f)?l?(o||(o=[]),(a=C(o,function(t){
+return t[0]===n}))&&a[1]?a[1]==t:(o.push([n,t]),t=(i?R:$)(n,t,r,e,u,o),o.pop(),t)):false:r(a?n.value():n,f?t.value():t,e,u,o):I(n,t,a)}function d(n){var t=typeof n;return"function"==t?n:null==n?fn:("object"==t?O:E)(n)}function m(n){n=null==n?n:Object(n);var t,r=[];for(t in n)r.push(t);return r}function w(n,t){var r=-1,e=Q(n)?Array(n.length):[];return $n(n,function(n,u,o){e[++r]=t(n,u,o)}),e}function O(n){var t=un(n),r=t.length;return function(e){if(null==e)return!r;for(e=Object(e);r--;){var u=t[r];if(!(u in e&&b(n[u],e[u],ln,true)))return false;
+}return true}}function x(n,t){return n=Object(n),J(t,function(t,r){return r in n&&(t[r]=n[r]),t},{})}function E(n){return function(t){return null==t?ln:t[n]}}function A(n,t,r){var e=-1,u=n.length;for(0>t&&(t=-t>u?0:u+t),r=r>u?u:r,0>r&&(r+=u),u=t>r?0:r-t>>>0,t>>>=0,r=Array(u);++e<u;)r[e]=n[e+t];return r}function k(n){return A(n,0,n.length)}function N(n,t){var r;return $n(n,function(n,e,u){return r=t(n,e,u),!r}),!!r}function S(t,r){return J(r,function(t,r){return r.func.apply(r.thisArg,n([t],r.args))},t);
+}function T(n,t,r,e){r||(r={});for(var u=-1,o=t.length;++u<o;){var i=t[u],c=e?e(r[i],n[i],i,r,n):n[i],f=r,a=f[i];(!H(a,c)||H(a,xn[i])&&!En.call(f,i)||c===ln&&!(i in f))&&(f[i]=c)}return r}function F(n){return V(function(t,r){var e=-1,u=r.length,o=u>1?r[u-1]:ln,o=typeof o=="function"?(u--,o):ln;for(t=Object(t);++e<u;){var i=r[e];i&&n(t,i,o)}return t})}function B(n){return function(){var t=arguments,r=In(n.prototype),t=n.apply(r,t);return Y(t)?t:r}}function D(n,t,r){function e(){for(var o=-1,i=arguments.length,c=-1,f=r.length,a=Array(f+i),l=this&&this!==wn&&this instanceof e?u:n;++c<f;)a[c]=r[c];
+for(;i--;)a[c++]=arguments[++o];return l.apply(t,a)}if(typeof n!="function")throw new TypeError("Expected a function");var u=B(n);return e}function R(n,t,r,e,u,o){var i=-1,c=1&u,f=n.length,a=t.length;if(f!=a&&!(2&u&&a>f))return false;for(a=true;++i<f;){var l=n[i],p=t[i];if(void 0!==ln){a=false;break}if(c){if(!N(t,function(n){return l===n||r(l,n,e,u,o)})){a=false;break}}else if(l!==p&&!r(l,p,e,u,o)){a=false;break}}return a}function I(n,t,r){switch(r){case"[object Boolean]":case"[object Date]":return+n==+t;case"[object Error]":
+return n.name==t.name&&n.message==t.message;case"[object Number]":return n!=+n?t!=+t:n==+t;case"[object RegExp]":case"[object String]":return n==t+""}return false}function $(n,t,r,e,u,o){var i=2&u,c=1&u,f=un(n),a=f.length,l=un(t);if(a!=l.length&&!i)return false;for(var p=a;p--;){var s=f[p];if(!(i?s in t:En.call(t,s))||!c&&s!=l[p])return false}for(c=true;++p<a;){var s=f[p],l=n[s],h=t[s];if(void 0!==ln||l!==h&&!r(l,h,e,u,o)){c=false;break}i||(i="constructor"==s)}return c&&!i&&(r=n.constructor,e=t.constructor,r!=e&&"constructor"in n&&"constructor"in t&&!(typeof r=="function"&&r instanceof r&&typeof e=="function"&&e instanceof e)&&(c=false)),
+c}function q(n){var t=n?n.length:ln;if(X(t)&&(Vn(n)||tn(n)||L(n))){n=String;for(var r=-1,e=Array(t);++r<t;)e[r]=n(r);t=e}else t=null;return t}function M(n){var t=n&&n.constructor;return n===(typeof t=="function"&&t.prototype||xn)}function z(n){return n?n[0]:ln}function C(n,t){return r(n,d(t),$n)}function G(n,t){return $n(n,typeof t=="function"?t:fn)}function J(n,t,r){return e(n,d(t),r,3>arguments.length,$n)}function P(n){return null==n?0:(n=Q(n)?n:un(n),n.length)}function U(n,t){var r;if(typeof t!="function")throw new TypeError("Expected a function");
+return n=Hn(n),function(){return 0<--n&&(r=t.apply(this,arguments)),1>=n&&(t=ln),r}}function V(n){var t;if(typeof n!="function")throw new TypeError("Expected a function");return t=Rn(t===ln?n.length-1:Hn(t),0),function(){for(var r=arguments,e=-1,u=Rn(r.length-t,0),o=Array(u);++e<u;)o[e]=r[t+e];for(u=Array(t+1),e=-1;++e<t;)u[e]=r[e];return u[t]=o,n.apply(this,u)}}function H(n,t){return n===t||n!==n&&t!==t}function K(n,t){return n>t}function L(n){return Z(n)&&Q(n)&&En.call(n,"callee")&&(!Fn.call(n,"callee")||"[object Arguments]"==kn.call(n));
+}function Q(n){return null!=n&&!(typeof n=="function"&&W(n))&&X(Mn(n))}function W(n){return n=Y(n)?kn.call(n):"","[object Function]"==n||"[object GeneratorFunction]"==n}function X(n){return typeof n=="number"&&n>-1&&0==n%1&&9007199254740991>=n}function Y(n){var t=typeof n;return!!n&&("object"==t||"function"==t)}function Z(n){return!!n&&typeof n=="object"}function nn(n){return typeof n=="number"||Z(n)&&"[object Number]"==kn.call(n)}function tn(n){return typeof n=="string"||!Vn(n)&&Z(n)&&"[object String]"==kn.call(n);
+}function rn(n,t){return t>n}function en(n){return typeof n=="string"?n:null==n?"":n+""}function un(n){var t=M(n);if(!t&&!Q(n))return Dn(Object(n));var r,e=q(n),u=!!e,e=e||[],o=e.length;for(r in n)!En.call(n,r)||u&&("length"==r||f(r,o))||t&&"constructor"==r||e.push(r);return e}function on(n){for(var t=-1,r=M(n),e=m(n),u=e.length,o=q(n),i=!!o,o=o||[],c=o.length;++t<u;){var a=e[t];i&&("length"==a||f(a,c))||"constructor"==a&&(r||!En.call(n,a))||o.push(a)}return o}function cn(n){return n?u(n,un(n)):[];
+}function fn(n){return n}function an(t,r,e){var u=un(r),o=g(r,u);null!=e||Y(r)&&(o.length||!u.length)||(e=r,r=t,t=this,o=g(r,un(r)));var i=Y(e)&&"chain"in e?e.chain:true,c=W(t);return $n(o,function(e){var u=r[e];t[e]=u,c&&(t.prototype[e]=function(){var r=this.__chain__;if(i||r){var e=t(this.__wrapped__);return(e.__actions__=k(this.__actions__)).push({func:u,args:arguments,thisArg:t}),e.__chain__=r,e}return u.apply(t,n([this.value()],arguments))})}),t}var ln,pn=/[&<>"'`]/g,sn=RegExp(pn.source),hn=/^(?:0|[1-9]\d*)$/,vn={
+"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","`":"&#96;"},yn={"function":true,object:true},_n=yn[typeof exports]&&exports&&!exports.nodeType?exports:null,gn=yn[typeof module]&&module&&!module.nodeType?module:null,bn=o(yn[typeof self]&&self),jn=o(yn[typeof window]&&window),dn=gn&&gn.exports===_n?_n:null,mn=o(yn[typeof this]&&this),wn=o(_n&&gn&&typeof global=="object"&&global)||jn!==(mn&&mn.window)&&jn||bn||mn||Function("return this")(),On=Array.prototype,xn=Object.prototype,En=xn.hasOwnProperty,An=0,kn=xn.toString,Nn=wn._,Sn=wn.f,Tn=Sn?Sn.g:ln,Fn=xn.propertyIsEnumerable,Bn=wn.isFinite,Dn=Object.keys,Rn=Math.max,In=function(){
+function n(){}return function(t){if(Y(t)){n.prototype=t;var r=new n;n.prototype=ln}return r||{}}}(),$n=function(n,t){return function(r,e){if(null==r)return r;if(!Q(r))return n(r,e);for(var u=r.length,o=t?u:-1,i=Object(r);(t?o--:++o<u)&&false!==e(i[o],o,i););return r}}(_),qn=function(n){return function(t,r,e){var u=-1,o=Object(t);e=e(t);for(var i=e.length;i--;){var c=e[n?i:++u];if(false===r(o[c],c,o))break}return t}}();Tn&&!Fn.call({valueOf:1},"valueOf")&&(m=function(n){n=Tn(n);for(var t,r=[];!(t=n.next()).done;)r.push(t.value);
+return r});var Mn=E("length"),zn=V(function(t,r){y(r);var e=Vn(t)?t:[Object(t)];return n(k(e),cn)}),Cn=V(function(n,t,r){var e=typeof t=="function";return w(n,function(n){var u=e?t:n[t];return null==u?u:u.apply(n,r)})}),Gn=Date.now,Jn=V(function(n,t,r){return D(n,t,r)}),Pn=V(function(n,t){return s(n,1,t)}),Un=V(function(n,t,r){return s(n,Kn(t)||0,r)}),Vn=Array.isArray,Hn=Number,Kn=Number,Ln=F(function(n,t){T(t,un(t),n)}),Qn=F(function(n,t){T(t,on(t),n)}),Wn=F(function(n,t,r){T(t,on(t),n,r)}),Xn=V(function(n){
+return n.push(ln,p),Wn.apply(ln,n)}),Yn=V(function(n,t){return null==n?{}:x(n,y(t))}),Zn=d;l.prototype=In(a.prototype),l.prototype.constructor=l,a.assignIn=Qn,a.before=U,a.bind=Jn,a.chain=function(n){return n=a(n),n.__chain__=true,n},a.compact=function(n){return v(n,Boolean)},a.concat=zn,a.create=function(n,t){var r=In(n);return t?Ln(r,t):r},a.defaults=Xn,a.defer=Pn,a.delay=Un,a.filter=function(n,t){return v(n,d(t))},a.flatten=function(n){return n&&n.length?y(n):[]},a.flattenDeep=function(n){return n&&n.length?y(n,true):[];
+},a.invokeMap=Cn,a.iteratee=Zn,a.keys=un,a.map=function(n,t){return w(n,d(t))},a.mixin=an,a.negate=function(n){if(typeof n!="function")throw new TypeError("Expected a function");return function(){return!n.apply(this,arguments)}},a.once=function(n){return U(2,n)},a.pick=Yn,a.slice=function(n,t,r){return n&&n.length?A(n,t,r):[]},a.sortBy=function(n,t){var r=0;return t=d(t),w(w(n,function(n,e,u){return{c:n,b:r++,a:t(n,e,u)}}).sort(function(n,t){var r;n:{r=n.a;var e=t.a;if(r!==e){var u=null===r,o=r===ln,i=r===r,c=null===e,f=e===ln,a=e===e;
+if(r>e&&!c||!i||u&&!f&&a||o&&a){r=1;break n}if(e>r&&!u||!a||c&&!o&&i||f&&i){r=-1;break n}}r=0}return r||n.b-t.b}),E("c"))},a.tap=function(n,t){return t(n),n},a.thru=function(n,t){return t(n)},a.toArray=function(n){return Q(n)?n.length?k(n):[]:cn(n)},a.values=cn,a.each=G,a.extend=Qn,an(a,a),a.clone=function(n){return Y(n)?Vn(n)?k(n):T(n,un(n)):n},a.escape=function(n){return(n=en(n))&&sn.test(n)?n.replace(pn,i):n},a.every=function(n,t,r){return t=r?ln:t,h(n,d(t))},a.find=C,a.forEach=G,a.has=function(n,t){
+return null!=n&&En.call(n,t)},a.head=z,a.identity=fn,a.indexOf=function(n,t,r){var e=n?n.length:0;r=typeof r=="number"?0>r?Rn(e+r,0):r:0,r=(r||0)-1;for(var u=t===t;++r<e;){var o=n[r];if(u?o===t:o!==o)return r}return-1},a.isArguments=L,a.isArray=Vn,a.isBoolean=function(n){return true===n||false===n||Z(n)&&"[object Boolean]"==kn.call(n)},a.isDate=function(n){return Z(n)&&"[object Date]"==kn.call(n)},a.isEmpty=function(n){return!Z(n)||W(n.splice)?!P(n):!un(n).length},a.isEqual=function(n,t){return b(n,t)},
+a.isFinite=function(n){return typeof n=="number"&&Bn(n)},a.isFunction=W,a.isNaN=function(n){return nn(n)&&n!=+n},a.isNull=function(n){return null===n},a.isNumber=nn,a.isObject=Y,a.isRegExp=function(n){return Y(n)&&"[object RegExp]"==kn.call(n)},a.isString=tn,a.isUndefined=function(n){return n===ln},a.last=function(n){var t=n?n.length:0;return t?n[t-1]:ln},a.max=function(n){return n&&n.length?t(n,fn,K):ln},a.min=function(n){return n&&n.length?t(n,fn,rn):ln},a.noConflict=function(){return wn._=Nn,this;
+},a.noop=function(){},a.now=Gn,a.reduce=J,a.result=function(n,t,r){return t=null==n?ln:n[t],t===ln&&(t=r),W(t)?t.call(n):t},a.size=P,a.some=function(n,t,r){return t=r?ln:t,N(n,d(t))},a.uniqueId=function(n){var t=++An;return en(n)+t},a.first=z,an(a,function(){var n={};return _(a,function(t,r){En.call(a.prototype,r)||(n[r]=t)}),n}(),{chain:false}),a.VERSION="4.0.0",$n("pop join replace reverse split push shift sort splice unshift".split(" "),function(n){var t=(/^(?:replace|split)$/.test(n)?String.prototype:On)[n],r=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",e=/^(?:pop|join|replace|shift)$/.test(n);
+a.prototype[n]=function(){var n=arguments;return e&&!this.__chain__?t.apply(this.value(),n):this[r](function(r){return t.apply(r,n)})}}),a.prototype.toJSON=a.prototype.valueOf=a.prototype.value=function(){return S(this.__wrapped__,this.__actions__)},(jn||bn||{})._=a,typeof define=="function"&&typeof define.amd=="object"&&define.amd? define(function(){return a}):_n&&gn?(dn&&((gn.exports=a)._=a),_n._=a):wn._=a}).call(this); \ No newline at end of file
diff --git a/lib/vendor/mithril.js b/lib/vendor/mithril.js
new file mode 100644
index 000000000..55bef997f
--- /dev/null
+++ b/lib/vendor/mithril.js
@@ -0,0 +1,2233 @@
+;(function (global, factory) { // eslint-disable-line
+ "use strict"
+ /* eslint-disable no-undef */
+ var m = factory(global)
+ if (typeof module === "object" && module != null && module.exports) {
+ module.exports = m
+ } else if (typeof define === "function" && define.amd) {
+ define(function () { return m })
+ } else {
+ global.m = m
+ }
+ /* eslint-enable no-undef */
+})(typeof window !== "undefined" ? window : this, function (global, undefined) { // eslint-disable-line
+ "use strict"
+
+ m.version = function () {
+ return "v0.2.5"
+ }
+
+ var hasOwn = {}.hasOwnProperty
+ var type = {}.toString
+
+ function isFunction(object) {
+ return typeof object === "function"
+ }
+
+ function isObject(object) {
+ return type.call(object) === "[object Object]"
+ }
+
+ function isString(object) {
+ return type.call(object) === "[object String]"
+ }
+
+ var isArray = Array.isArray || function (object) {
+ return type.call(object) === "[object Array]"
+ }
+
+ function noop() {}
+
+ var voidElements = {
+ AREA: 1,
+ BASE: 1,
+ BR: 1,
+ COL: 1,
+ COMMAND: 1,
+ EMBED: 1,
+ HR: 1,
+ IMG: 1,
+ INPUT: 1,
+ KEYGEN: 1,
+ LINK: 1,
+ META: 1,
+ PARAM: 1,
+ SOURCE: 1,
+ TRACK: 1,
+ WBR: 1
+ }
+
+ // caching commonly used variables
+ var $document, $location, $requestAnimationFrame, $cancelAnimationFrame
+
+ // self invoking function needed because of the way mocks work
+ function initialize(mock) {
+ $document = mock.document
+ $location = mock.location
+ $cancelAnimationFrame = mock.cancelAnimationFrame || mock.clearTimeout
+ $requestAnimationFrame = mock.requestAnimationFrame || mock.setTimeout
+ }
+
+ // testing API
+ m.deps = function (mock) {
+ initialize(global = mock || window)
+ return global
+ }
+
+ m.deps(global)
+
+ /**
+ * @typedef {String} Tag
+ * A string that looks like -> div.classname#id[param=one][param2=two]
+ * Which describes a DOM node
+ */
+
+ function parseTagAttrs(cell, tag) {
+ var classes = []
+ var parser = /(?:(^|#|\.)([^#\.\[\]]+))|(\[.+?\])/g
+ var match
+
+ while ((match = parser.exec(tag))) {
+ if (match[1] === "" && match[2]) {
+ cell.tag = match[2]
+ } else if (match[1] === "#") {
+ cell.attrs.id = match[2]
+ } else if (match[1] === ".") {
+ classes.push(match[2])
+ } else if (match[3][0] === "[") {
+ var pair = /\[(.+?)(?:=("|'|)(.*?)\2)?\]/.exec(match[3])
+ cell.attrs[pair[1]] = pair[3] || ""
+ }
+ }
+
+ return classes
+ }
+
+ function getVirtualChildren(args, hasAttrs) {
+ var children = hasAttrs ? args.slice(1) : args
+
+ if (children.length === 1 && isArray(children[0])) {
+ return children[0]
+ } else {
+ return children
+ }
+ }
+
+ function assignAttrs(target, attrs, classes) {
+ var classAttr = "class" in attrs ? "class" : "className"
+
+ for (var attrName in attrs) {
+ if (hasOwn.call(attrs, attrName)) {
+ if (attrName === classAttr &&
+ attrs[attrName] != null &&
+ attrs[attrName] !== "") {
+ classes.push(attrs[attrName])
+ // create key in correct iteration order
+ target[attrName] = ""
+ } else {
+ target[attrName] = attrs[attrName]
+ }
+ }
+ }
+
+ if (classes.length) target[classAttr] = classes.join(" ")
+ }
+
+ /**
+ *
+ * @param {Tag} The DOM node tag
+ * @param {Object=[]} optional key-value pairs to be mapped to DOM attrs
+ * @param {...mNode=[]} Zero or more Mithril child nodes. Can be an array,
+ * or splat (optional)
+ */
+ function m(tag, pairs) {
+ var args = []
+
+ for (var i = 1, length = arguments.length; i < length; i++) {
+ args[i - 1] = arguments[i]
+ }
+
+ if (isObject(tag)) return parameterize(tag, args)
+
+ if (!isString(tag)) {
+ throw new Error("selector in m(selector, attrs, children) should " +
+ "be a string")
+ }
+
+ var hasAttrs = pairs != null && isObject(pairs) &&
+ !("tag" in pairs || "view" in pairs || "subtree" in pairs)
+
+ var attrs = hasAttrs ? pairs : {}
+ var cell = {
+ tag: "div",
+ attrs: {},
+ children: getVirtualChildren(args, hasAttrs)
+ }
+
+ assignAttrs(cell.attrs, attrs, parseTagAttrs(cell, tag))
+ return cell
+ }
+
+ function forEach(list, f) {
+ for (var i = 0; i < list.length && !f(list[i], i++);) {
+ // function called in condition
+ }
+ }
+
+ function forKeys(list, f) {
+ forEach(list, function (attrs, i) {
+ return (attrs = attrs && attrs.attrs) &&
+ attrs.key != null &&
+ f(attrs, i)
+ })
+ }
+ // This function was causing deopts in Chrome.
+ function dataToString(data) {
+ // data.toString() might throw or return null if data is the return
+ // value of Console.log in some versions of Firefox (behavior depends on
+ // version)
+ try {
+ if (data != null && data.toString() != null) return data
+ } catch (e) {
+ // silently ignore errors
+ }
+ return ""
+ }
+
+ // This function was causing deopts in Chrome.
+ function injectTextNode(parentElement, first, index, data) {
+ try {
+ insertNode(parentElement, first, index)
+ first.nodeValue = data
+ } catch (e) {
+ // IE erroneously throws error when appending an empty text node
+ // after a null
+ }
+ }
+
+ function flatten(list) {
+ // recursively flatten array
+ for (var i = 0; i < list.length; i++) {
+ if (isArray(list[i])) {
+ list = list.concat.apply([], list)
+ // check current index again and flatten until there are no more
+ // nested arrays at that index
+ i--
+ }
+ }
+ return list
+ }
+
+ function insertNode(parentElement, node, index) {
+ parentElement.insertBefore(node,
+ parentElement.childNodes[index] || null)
+ }
+
+ var DELETION = 1
+ var INSERTION = 2
+ var MOVE = 3
+
+ function handleKeysDiffer(data, existing, cached, parentElement) {
+ forKeys(data, function (key, i) {
+ existing[key = key.key] = existing[key] ? {
+ action: MOVE,
+ index: i,
+ from: existing[key].index,
+ element: cached.nodes[existing[key].index] ||
+ $document.createElement("div")
+ } : {action: INSERTION, index: i}
+ })
+
+ var actions = []
+ for (var prop in existing) {
+ if (hasOwn.call(existing, prop)) {
+ actions.push(existing[prop])
+ }
+ }
+
+ var changes = actions.sort(sortChanges)
+ var newCached = new Array(cached.length)
+
+ newCached.nodes = cached.nodes.slice()
+
+ forEach(changes, function (change) {
+ var index = change.index
+ if (change.action === DELETION) {
+ clear(cached[index].nodes, cached[index])
+ newCached.splice(index, 1)
+ }
+ if (change.action === INSERTION) {
+ var dummy = $document.createElement("div")
+ dummy.key = data[index].attrs.key
+ insertNode(parentElement, dummy, index)
+ newCached.splice(index, 0, {
+ attrs: {key: data[index].attrs.key},
+ nodes: [dummy]
+ })
+ newCached.nodes[index] = dummy
+ }
+
+ if (change.action === MOVE) {
+ var changeElement = change.element
+ var maybeChanged = parentElement.childNodes[index]
+ if (maybeChanged !== changeElement && changeElement !== null) {
+ parentElement.insertBefore(changeElement,
+ maybeChanged || null)
+ }
+ newCached[index] = cached[change.from]
+ newCached.nodes[index] = changeElement
+ }
+ })
+
+ return newCached
+ }
+
+ function diffKeys(data, cached, existing, parentElement) {
+ var keysDiffer = data.length !== cached.length
+
+ if (!keysDiffer) {
+ forKeys(data, function (attrs, i) {
+ var cachedCell = cached[i]
+ return keysDiffer = cachedCell &&
+ cachedCell.attrs &&
+ cachedCell.attrs.key !== attrs.key
+ })
+ }
+
+ if (keysDiffer) {
+ return handleKeysDiffer(data, existing, cached, parentElement)
+ } else {
+ return cached
+ }
+ }
+
+ function diffArray(data, cached, nodes) {
+ // diff the array itself
+
+ // update the list of DOM nodes by collecting the nodes from each item
+ forEach(data, function (_, i) {
+ if (cached[i] != null) nodes.push.apply(nodes, cached[i].nodes)
+ })
+ // remove items from the end of the array if the new array is shorter
+ // than the old one. if errors ever happen here, the issue is most
+ // likely a bug in the construction of the `cached` data structure
+ // somewhere earlier in the program
+ forEach(cached.nodes, function (node, i) {
+ if (node.parentNode != null && nodes.indexOf(node) < 0) {
+ clear([node], [cached[i]])
+ }
+ })
+
+ if (data.length < cached.length) cached.length = data.length
+ cached.nodes = nodes
+ }
+
+ function buildArrayKeys(data) {
+ var guid = 0
+ forKeys(data, function () {
+ forEach(data, function (attrs) {
+ if ((attrs = attrs && attrs.attrs) && attrs.key == null) {
+ attrs.key = "__mithril__" + guid++
+ }
+ })
+ return 1
+ })
+ }
+
+ function isDifferentEnough(data, cached, dataAttrKeys) {
+ if (data.tag !== cached.tag) return true
+
+ if (dataAttrKeys.sort().join() !==
+ Object.keys(cached.attrs).sort().join()) {
+ return true
+ }
+
+ if (data.attrs.id !== cached.attrs.id) {
+ return true
+ }
+
+ if (data.attrs.key !== cached.attrs.key) {
+ return true
+ }
+
+ if (m.redraw.strategy() === "all") {
+ return !cached.configContext || cached.configContext.retain !== true
+ }
+
+ if (m.redraw.strategy() === "diff") {
+ return cached.configContext && cached.configContext.retain === false
+ }
+
+ return false
+ }
+
+ function maybeRecreateObject(data, cached, dataAttrKeys) {
+ // if an element is different enough from the one in cache, recreate it
+ if (isDifferentEnough(data, cached, dataAttrKeys)) {
+ if (cached.nodes.length) clear(cached.nodes)
+
+ if (cached.configContext &&
+ isFunction(cached.configContext.onunload)) {
+ cached.configContext.onunload()
+ }
+
+ if (cached.controllers) {
+ forEach(cached.controllers, function (controller) {
+ if (controller.onunload) {
+ controller.onunload({preventDefault: noop})
+ }
+ })
+ }
+ }
+ }
+
+ function getObjectNamespace(data, namespace) {
+ if (data.attrs.xmlns) return data.attrs.xmlns
+ if (data.tag === "svg") return "http://www.w3.org/2000/svg"
+ if (data.tag === "math") return "http://www.w3.org/1998/Math/MathML"
+ return namespace
+ }
+
+ var pendingRequests = 0
+ m.startComputation = function () { pendingRequests++ }
+ m.endComputation = function () {
+ if (pendingRequests > 1) {
+ pendingRequests--
+ } else {
+ pendingRequests = 0
+ m.redraw()
+ }
+ }
+
+ function unloadCachedControllers(cached, views, controllers) {
+ if (controllers.length) {
+ cached.views = views
+ cached.controllers = controllers
+ forEach(controllers, function (controller) {
+ if (controller.onunload && controller.onunload.$old) {
+ controller.onunload = controller.onunload.$old
+ }
+
+ if (pendingRequests && controller.onunload) {
+ var onunload = controller.onunload
+ controller.onunload = noop
+ controller.onunload.$old = onunload
+ }
+ })
+ }
+ }
+
+ function scheduleConfigsToBeCalled(configs, data, node, isNew, cached) {
+ // schedule configs to be called. They are called after `build` finishes
+ // running
+ if (isFunction(data.attrs.config)) {
+ var context = cached.configContext = cached.configContext || {}
+
+ // bind
+ configs.push(function () {
+ return data.attrs.config.call(data, node, !isNew, context,
+ cached)
+ })
+ }
+ }
+
+ function buildUpdatedNode(
+ cached,
+ data,
+ editable,
+ hasKeys,
+ namespace,
+ views,
+ configs,
+ controllers
+ ) {
+ var node = cached.nodes[0]
+
+ if (hasKeys) {
+ setAttributes(node, data.tag, data.attrs, cached.attrs, namespace)
+ }
+
+ cached.children = build(
+ node,
+ data.tag,
+ undefined,
+ undefined,
+ data.children,
+ cached.children,
+ false,
+ 0,
+ data.attrs.contenteditable ? node : editable,
+ namespace,
+ configs
+ )
+
+ cached.nodes.intact = true
+
+ if (controllers.length) {
+ cached.views = views
+ cached.controllers = controllers
+ }
+
+ return node
+ }
+
+ function handleNonexistentNodes(data, parentElement, index) {
+ var nodes
+ if (data.$trusted) {
+ nodes = injectHTML(parentElement, index, data)
+ } else {
+ nodes = [$document.createTextNode(data)]
+ if (!(parentElement.nodeName in voidElements)) {
+ insertNode(parentElement, nodes[0], index)
+ }
+ }
+
+ var cached
+
+ if (typeof data === "string" ||
+ typeof data === "number" ||
+ typeof data === "boolean") {
+ cached = new data.constructor(data)
+ } else {
+ cached = data
+ }
+
+ cached.nodes = nodes
+ return cached
+ }
+
+ function reattachNodes(
+ data,
+ cached,
+ parentElement,
+ editable,
+ index,
+ parentTag
+ ) {
+ var nodes = cached.nodes
+ if (!editable || editable !== $document.activeElement) {
+ if (data.$trusted) {
+ clear(nodes, cached)
+ nodes = injectHTML(parentElement, index, data)
+ } else if (parentTag === "textarea") {
+ // <textarea> uses `value` instead of `nodeValue`.
+ parentElement.value = data
+ } else if (editable) {
+ // contenteditable nodes use `innerHTML` instead of `nodeValue`.
+ editable.innerHTML = data
+ } else {
+ // was a trusted string
+ if (nodes[0].nodeType === 1 || nodes.length > 1 ||
+ (nodes[0].nodeValue.trim &&
+ !nodes[0].nodeValue.trim())) {
+ clear(cached.nodes, cached)
+ nodes = [$document.createTextNode(data)]
+ }
+
+ injectTextNode(parentElement, nodes[0], index, data)
+ }
+ }
+ cached = new data.constructor(data)
+ cached.nodes = nodes
+ return cached
+ }
+
+ function handleTextNode(
+ cached,
+ data,
+ index,
+ parentElement,
+ shouldReattach,
+ editable,
+ parentTag
+ ) {
+ if (!cached.nodes.length) {
+ return handleNonexistentNodes(data, parentElement, index)
+ } else if (cached.valueOf() !== data.valueOf() || shouldReattach) {
+ return reattachNodes(data, cached, parentElement, editable, index,
+ parentTag)
+ } else {
+ return (cached.nodes.intact = true, cached)
+ }
+ }
+
+ function getSubArrayCount(item) {
+ if (item.$trusted) {
+ // fix offset of next element if item was a trusted string w/ more
+ // than one html element
+ // the first clause in the regexp matches elements
+ // the second clause (after the pipe) matches text nodes
+ var match = item.match(/<[^\/]|\>\s*[^<]/g)
+ if (match != null) return match.length
+ } else if (isArray(item)) {
+ return item.length
+ }
+ return 1
+ }
+
+ function buildArray(
+ data,
+ cached,
+ parentElement,
+ index,
+ parentTag,
+ shouldReattach,
+ editable,
+ namespace,
+ configs
+ ) {
+ data = flatten(data)
+ var nodes = []
+ var intact = cached.length === data.length
+ var subArrayCount = 0
+
+ // keys algorithm: sort elements without recreating them if keys are
+ // present
+ //
+ // 1) create a map of all existing keys, and mark all for deletion
+ // 2) add new keys to map and mark them for addition
+ // 3) if key exists in new list, change action from deletion to a move
+ // 4) for each key, handle its corresponding action as marked in
+ // previous steps
+
+ var existing = {}
+ var shouldMaintainIdentities = false
+
+ forKeys(cached, function (attrs, i) {
+ shouldMaintainIdentities = true
+ existing[cached[i].attrs.key] = {action: DELETION, index: i}
+ })
+
+ buildArrayKeys(data)
+ if (shouldMaintainIdentities) {
+ cached = diffKeys(data, cached, existing, parentElement)
+ }
+ // end key algorithm
+
+ var cacheCount = 0
+ // faster explicitly written
+ for (var i = 0, len = data.length; i < len; i++) {
+ // diff each item in the array
+ var item = build(
+ parentElement,
+ parentTag,
+ cached,
+ index,
+ data[i],
+ cached[cacheCount],
+ shouldReattach,
+ index + subArrayCount || subArrayCount,
+ editable,
+ namespace,
+ configs)
+
+ if (item !== undefined) {
+ intact = intact && item.nodes.intact
+ subArrayCount += getSubArrayCount(item)
+ cached[cacheCount++] = item
+ }
+ }
+
+ if (!intact) diffArray(data, cached, nodes)
+ return cached
+ }
+
+ function makeCache(data, cached, index, parentIndex, parentCache) {
+ if (cached != null) {
+ if (type.call(cached) === type.call(data)) return cached
+
+ if (parentCache && parentCache.nodes) {
+ var offset = index - parentIndex
+ var end = offset + (isArray(data) ? data : cached.nodes).length
+ clear(
+ parentCache.nodes.slice(offset, end),
+ parentCache.slice(offset, end))
+ } else if (cached.nodes) {
+ clear(cached.nodes, cached)
+ }
+ }
+
+ cached = new data.constructor()
+ // if constructor creates a virtual dom element, use a blank object as
+ // the base cached node instead of copying the virtual el (#277)
+ if (cached.tag) cached = {}
+ cached.nodes = []
+ return cached
+ }
+
+ function constructNode(data, namespace) {
+ if (data.attrs.is) {
+ if (namespace == null) {
+ return $document.createElement(data.tag, data.attrs.is)
+ } else {
+ return $document.createElementNS(namespace, data.tag,
+ data.attrs.is)
+ }
+ } else if (namespace == null) {
+ return $document.createElement(data.tag)
+ } else {
+ return $document.createElementNS(namespace, data.tag)
+ }
+ }
+
+ function constructAttrs(data, node, namespace, hasKeys) {
+ if (hasKeys) {
+ return setAttributes(node, data.tag, data.attrs, {}, namespace)
+ } else {
+ return data.attrs
+ }
+ }
+
+ function constructChildren(
+ data,
+ node,
+ cached,
+ editable,
+ namespace,
+ configs
+ ) {
+ if (data.children != null && data.children.length > 0) {
+ return build(
+ node,
+ data.tag,
+ undefined,
+ undefined,
+ data.children,
+ cached.children,
+ true,
+ 0,
+ data.attrs.contenteditable ? node : editable,
+ namespace,
+ configs)
+ } else {
+ return data.children
+ }
+ }
+
+ function reconstructCached(
+ data,
+ attrs,
+ children,
+ node,
+ namespace,
+ views,
+ controllers
+ ) {
+ var cached = {
+ tag: data.tag,
+ attrs: attrs,
+ children: children,
+ nodes: [node]
+ }
+
+ unloadCachedControllers(cached, views, controllers)
+
+ if (cached.children && !cached.children.nodes) {
+ cached.children.nodes = []
+ }
+
+ // edge case: setting value on <select> doesn't work before children
+ // exist, so set it again after children have been created
+ if (data.tag === "select" && "value" in data.attrs) {
+ setAttributes(node, data.tag, {value: data.attrs.value}, {},
+ namespace)
+ }
+
+ return cached
+ }
+
+ function getController(views, view, cachedControllers, controller) {
+ var controllerIndex
+
+ if (m.redraw.strategy() === "diff" && views) {
+ controllerIndex = views.indexOf(view)
+ } else {
+ controllerIndex = -1
+ }
+
+ if (controllerIndex > -1) {
+ return cachedControllers[controllerIndex]
+ } else if (isFunction(controller)) {
+ return new controller()
+ } else {
+ return {}
+ }
+ }
+
+ var unloaders = []
+
+ function updateLists(views, controllers, view, controller) {
+ if (controller.onunload != null &&
+ unloaders.map(function (u) { return u.handler })
+ .indexOf(controller.onunload) < 0) {
+ unloaders.push({
+ controller: controller,
+ handler: controller.onunload
+ })
+ }
+
+ views.push(view)
+ controllers.push(controller)
+ }
+
+ var forcing = false
+ function checkView(
+ data,
+ view,
+ cached,
+ cachedControllers,
+ controllers,
+ views
+ ) {
+ var controller = getController(
+ cached.views,
+ view,
+ cachedControllers,
+ data.controller)
+
+ var key = data && data.attrs && data.attrs.key
+
+ if (pendingRequests === 0 ||
+ forcing ||
+ cachedControllers &&
+ cachedControllers.indexOf(controller) > -1) {
+ data = data.view(controller)
+ } else {
+ data = {tag: "placeholder"}
+ }
+
+ if (data.subtree === "retain") return data
+ data.attrs = data.attrs || {}
+ data.attrs.key = key
+ updateLists(views, controllers, view, controller)
+ return data
+ }
+
+ function markViews(data, cached, views, controllers) {
+ var cachedControllers = cached && cached.controllers
+
+ while (data.view != null) {
+ data = checkView(
+ data,
+ data.view.$original || data.view,
+ cached,
+ cachedControllers,
+ controllers,
+ views)
+ }
+
+ return data
+ }
+
+ function buildObject( // eslint-disable-line max-statements
+ data,
+ cached,
+ editable,
+ parentElement,
+ index,
+ shouldReattach,
+ namespace,
+ configs
+ ) {
+ var views = []
+ var controllers = []
+
+ data = markViews(data, cached, views, controllers)
+
+ if (data.subtree === "retain") return cached
+
+ if (!data.tag && controllers.length) {
+ throw new Error("Component template must return a virtual " +
+ "element, not an array, string, etc.")
+ }
+
+ data.attrs = data.attrs || {}
+ cached.attrs = cached.attrs || {}
+
+ var dataAttrKeys = Object.keys(data.attrs)
+ var hasKeys = dataAttrKeys.length > ("key" in data.attrs ? 1 : 0)
+
+ maybeRecreateObject(data, cached, dataAttrKeys)
+
+ if (!isString(data.tag)) return
+
+ var isNew = cached.nodes.length === 0
+
+ namespace = getObjectNamespace(data, namespace)
+
+ var node
+ if (isNew) {
+ node = constructNode(data, namespace)
+ // set attributes first, then create children
+ var attrs = constructAttrs(data, node, namespace, hasKeys)
+
+ // add the node to its parent before attaching children to it
+ insertNode(parentElement, node, index)
+
+ var children = constructChildren(data, node, cached, editable,
+ namespace, configs)
+
+ cached = reconstructCached(
+ data,
+ attrs,
+ children,
+ node,
+ namespace,
+ views,
+ controllers)
+ } else {
+ node = buildUpdatedNode(
+ cached,
+ data,
+ editable,
+ hasKeys,
+ namespace,
+ views,
+ configs,
+ controllers)
+ }
+
+ if (!isNew && shouldReattach === true && node != null) {
+ insertNode(parentElement, node, index)
+ }
+
+ // The configs are called after `build` finishes running
+ scheduleConfigsToBeCalled(configs, data, node, isNew, cached)
+
+ return cached
+ }
+
+ function build(
+ parentElement,
+ parentTag,
+ parentCache,
+ parentIndex,
+ data,
+ cached,
+ shouldReattach,
+ index,
+ editable,
+ namespace,
+ configs
+ ) {
+ /*
+ * `build` is a recursive function that manages creation/diffing/removal
+ * of DOM elements based on comparison between `data` and `cached` the
+ * diff algorithm can be summarized as this:
+ *
+ * 1 - compare `data` and `cached`
+ * 2 - if they are different, copy `data` to `cached` and update the DOM
+ * based on what the difference is
+ * 3 - recursively apply this algorithm for every array and for the
+ * children of every virtual element
+ *
+ * The `cached` data structure is essentially the same as the previous
+ * redraw's `data` data structure, with a few additions:
+ * - `cached` always has a property called `nodes`, which is a list of
+ * DOM elements that correspond to the data represented by the
+ * respective virtual element
+ * - in order to support attaching `nodes` as a property of `cached`,
+ * `cached` is *always* a non-primitive object, i.e. if the data was
+ * a string, then cached is a String instance. If data was `null` or
+ * `undefined`, cached is `new String("")`
+ * - `cached also has a `configContext` property, which is the state
+ * storage object exposed by config(element, isInitialized, context)
+ * - when `cached` is an Object, it represents a virtual element; when
+ * it's an Array, it represents a list of elements; when it's a
+ * String, Number or Boolean, it represents a text node
+ *
+ * `parentElement` is a DOM element used for W3C DOM API calls
+ * `parentTag` is only used for handling a corner case for textarea
+ * values
+ * `parentCache` is used to remove nodes in some multi-node cases
+ * `parentIndex` and `index` are used to figure out the offset of nodes.
+ * They're artifacts from before arrays started being flattened and are
+ * likely refactorable
+ * `data` and `cached` are, respectively, the new and old nodes being
+ * diffed
+ * `shouldReattach` is a flag indicating whether a parent node was
+ * recreated (if so, and if this node is reused, then this node must
+ * reattach itself to the new parent)
+ * `editable` is a flag that indicates whether an ancestor is
+ * contenteditable
+ * `namespace` indicates the closest HTML namespace as it cascades down
+ * from an ancestor
+ * `configs` is a list of config functions to run after the topmost
+ * `build` call finishes running
+ *
+ * there's logic that relies on the assumption that null and undefined
+ * data are equivalent to empty strings
+ * - this prevents lifecycle surprises from procedural helpers that mix
+ * implicit and explicit return statements (e.g.
+ * function foo() {if (cond) return m("div")}
+ * - it simplifies diffing code
+ */
+ data = dataToString(data)
+ if (data.subtree === "retain") return cached
+ cached = makeCache(data, cached, index, parentIndex, parentCache)
+
+ if (isArray(data)) {
+ return buildArray(
+ data,
+ cached,
+ parentElement,
+ index,
+ parentTag,
+ shouldReattach,
+ editable,
+ namespace,
+ configs)
+ } else if (data != null && isObject(data)) {
+ return buildObject(
+ data,
+ cached,
+ editable,
+ parentElement,
+ index,
+ shouldReattach,
+ namespace,
+ configs)
+ } else if (!isFunction(data)) {
+ return handleTextNode(
+ cached,
+ data,
+ index,
+ parentElement,
+ shouldReattach,
+ editable,
+ parentTag)
+ } else {
+ return cached
+ }
+ }
+
+ function sortChanges(a, b) {
+ return a.action - b.action || a.index - b.index
+ }
+
+ function copyStyleAttrs(node, dataAttr, cachedAttr) {
+ for (var rule in dataAttr) {
+ if (hasOwn.call(dataAttr, rule)) {
+ if (cachedAttr == null || cachedAttr[rule] !== dataAttr[rule]) {
+ node.style[rule] = dataAttr[rule]
+ }
+ }
+ }
+
+ for (rule in cachedAttr) {
+ if (hasOwn.call(cachedAttr, rule)) {
+ if (!hasOwn.call(dataAttr, rule)) node.style[rule] = ""
+ }
+ }
+ }
+
+ var shouldUseSetAttribute = {
+ list: 1,
+ style: 1,
+ form: 1,
+ type: 1,
+ width: 1,
+ height: 1
+ }
+
+ function setSingleAttr(
+ node,
+ attrName,
+ dataAttr,
+ cachedAttr,
+ tag,
+ namespace
+ ) {
+ if (attrName === "config" || attrName === "key") {
+ // `config` isn't a real attribute, so ignore it
+ return true
+ } else if (isFunction(dataAttr) && attrName.slice(0, 2) === "on") {
+ // hook event handlers to the auto-redrawing system
+ node[attrName] = autoredraw(dataAttr, node)
+ } else if (attrName === "style" && dataAttr != null &&
+ isObject(dataAttr)) {
+ // handle `style: {...}`
+ copyStyleAttrs(node, dataAttr, cachedAttr)
+ } else if (namespace != null) {
+ // handle SVG
+ if (attrName === "href") {
+ node.setAttributeNS("http://www.w3.org/1999/xlink",
+ "href", dataAttr)
+ } else {
+ node.setAttribute(
+ attrName === "className" ? "class" : attrName,
+ dataAttr)
+ }
+ } else if (attrName in node && !shouldUseSetAttribute[attrName]) {
+ // handle cases that are properties (but ignore cases where we
+ // should use setAttribute instead)
+ //
+ // - list and form are typically used as strings, but are DOM
+ // element references in js
+ //
+ // - when using CSS selectors (e.g. `m("[style='']")`), style is
+ // used as a string, but it's an object in js
+ //
+ // #348 don't set the value if not needed - otherwise, cursor
+ // placement breaks in Chrome
+ try {
+ if (tag !== "input" || node[attrName] !== dataAttr) {
+ node[attrName] = dataAttr
+ }
+ } catch (e) {
+ node.setAttribute(attrName, dataAttr)
+ }
+ }
+ else node.setAttribute(attrName, dataAttr)
+ }
+
+ function trySetAttr(
+ node,
+ attrName,
+ dataAttr,
+ cachedAttr,
+ cachedAttrs,
+ tag,
+ namespace
+ ) {
+ if (!(attrName in cachedAttrs) || (cachedAttr !== dataAttr) || ($document.activeElement === node)) {
+ cachedAttrs[attrName] = dataAttr
+ try {
+ return setSingleAttr(
+ node,
+ attrName,
+ dataAttr,
+ cachedAttr,
+ tag,
+ namespace)
+ } catch (e) {
+ // swallow IE's invalid argument errors to mimic HTML's
+ // fallback-to-doing-nothing-on-invalid-attributes behavior
+ if (e.message.indexOf("Invalid argument") < 0) throw e
+ }
+ } else if (attrName === "value" && tag === "input" &&
+ node.value !== dataAttr) {
+ // #348 dataAttr may not be a string, so use loose comparison
+ node.value = dataAttr
+ }
+ }
+
+ function setAttributes(node, tag, dataAttrs, cachedAttrs, namespace) {
+ for (var attrName in dataAttrs) {
+ if (hasOwn.call(dataAttrs, attrName)) {
+ if (trySetAttr(
+ node,
+ attrName,
+ dataAttrs[attrName],
+ cachedAttrs[attrName],
+ cachedAttrs,
+ tag,
+ namespace)) {
+ continue
+ }
+ }
+ }
+ return cachedAttrs
+ }
+
+ function clear(nodes, cached) {
+ for (var i = nodes.length - 1; i > -1; i--) {
+ if (nodes[i] && nodes[i].parentNode) {
+ try {
+ nodes[i].parentNode.removeChild(nodes[i])
+ } catch (e) {
+ /* eslint-disable max-len */
+ // ignore if this fails due to order of events (see
+ // http://stackoverflow.com/questions/21926083/failed-to-execute-removechild-on-node)
+ /* eslint-enable max-len */
+ }
+ cached = [].concat(cached)
+ if (cached[i]) unload(cached[i])
+ }
+ }
+ // release memory if nodes is an array. This check should fail if nodes
+ // is a NodeList (see loop above)
+ if (nodes.length) {
+ nodes.length = 0
+ }
+ }
+
+ function unload(cached) {
+ if (cached.configContext && isFunction(cached.configContext.onunload)) {
+ cached.configContext.onunload()
+ cached.configContext.onunload = null
+ }
+ if (cached.controllers) {
+ forEach(cached.controllers, function (controller) {
+ if (isFunction(controller.onunload)) {
+ controller.onunload({preventDefault: noop})
+ }
+ })
+ }
+ if (cached.children) {
+ if (isArray(cached.children)) forEach(cached.children, unload)
+ else if (cached.children.tag) unload(cached.children)
+ }
+ }
+
+ function appendTextFragment(parentElement, data) {
+ try {
+ parentElement.appendChild(
+ $document.createRange().createContextualFragment(data))
+ } catch (e) {
+ parentElement.insertAdjacentHTML("beforeend", data)
+ replaceScriptNodes(parentElement)
+ }
+ }
+
+ // Replace script tags inside given DOM element with executable ones.
+ // Will also check children recursively and replace any found script
+ // tags in same manner.
+ function replaceScriptNodes(node) {
+ if (node.tagName === "SCRIPT") {
+ node.parentNode.replaceChild(buildExecutableNode(node), node)
+ } else {
+ var children = node.childNodes
+ if (children && children.length) {
+ for (var i = 0; i < children.length; i++) {
+ replaceScriptNodes(children[i])
+ }
+ }
+ }
+
+ return node
+ }
+
+ // Replace script element with one whose contents are executable.
+ function buildExecutableNode(node){
+ var scriptEl = document.createElement("script")
+ var attrs = node.attributes
+
+ for (var i = 0; i < attrs.length; i++) {
+ scriptEl.setAttribute(attrs[i].name, attrs[i].value)
+ }
+
+ scriptEl.text = node.innerHTML
+ return scriptEl
+ }
+
+ function injectHTML(parentElement, index, data) {
+ var nextSibling = parentElement.childNodes[index]
+ if (nextSibling) {
+ var isElement = nextSibling.nodeType !== 1
+ var placeholder = $document.createElement("span")
+ if (isElement) {
+ parentElement.insertBefore(placeholder, nextSibling || null)
+ placeholder.insertAdjacentHTML("beforebegin", data)
+ parentElement.removeChild(placeholder)
+ } else {
+ nextSibling.insertAdjacentHTML("beforebegin", data)
+ }
+ } else {
+ appendTextFragment(parentElement, data)
+ }
+
+ var nodes = []
+
+ while (parentElement.childNodes[index] !== nextSibling) {
+ nodes.push(parentElement.childNodes[index])
+ index++
+ }
+
+ return nodes
+ }
+
+ function autoredraw(callback, object) {
+ return function (e) {
+ e = e || event
+ m.redraw.strategy("diff")
+ m.startComputation()
+ try {
+ return callback.call(object, e)
+ } finally {
+ endFirstComputation()
+ }
+ }
+ }
+
+ var html
+ var documentNode = {
+ appendChild: function (node) {
+ if (html === undefined) html = $document.createElement("html")
+ if ($document.documentElement &&
+ $document.documentElement !== node) {
+ $document.replaceChild(node, $document.documentElement)
+ } else {
+ $document.appendChild(node)
+ }
+
+ this.childNodes = $document.childNodes
+ },
+
+ insertBefore: function (node) {
+ this.appendChild(node)
+ },
+
+ childNodes: []
+ }
+
+ var nodeCache = []
+ var cellCache = {}
+
+ m.render = function (root, cell, forceRecreation) {
+ if (!root) {
+ throw new Error("Ensure the DOM element being passed to " +
+ "m.route/m.mount/m.render is not undefined.")
+ }
+ var configs = []
+ var id = getCellCacheKey(root)
+ var isDocumentRoot = root === $document
+ var node
+
+ if (isDocumentRoot || root === $document.documentElement) {
+ node = documentNode
+ } else {
+ node = root
+ }
+
+ if (isDocumentRoot && cell.tag !== "html") {
+ cell = {tag: "html", attrs: {}, children: cell}
+ }
+
+ if (cellCache[id] === undefined) clear(node.childNodes)
+ if (forceRecreation === true) reset(root)
+
+ cellCache[id] = build(
+ node,
+ null,
+ undefined,
+ undefined,
+ cell,
+ cellCache[id],
+ false,
+ 0,
+ null,
+ undefined,
+ configs)
+
+ forEach(configs, function (config) { config() })
+ }
+
+ function getCellCacheKey(element) {
+ var index = nodeCache.indexOf(element)
+ return index < 0 ? nodeCache.push(element) - 1 : index
+ }
+
+ m.trust = function (value) {
+ value = new String(value) // eslint-disable-line no-new-wrappers
+ value.$trusted = true
+ return value
+ }
+
+ function gettersetter(store) {
+ function prop() {
+ if (arguments.length) store = arguments[0]
+ return store
+ }
+
+ prop.toJSON = function () {
+ return store
+ }
+
+ return prop
+ }
+
+ m.prop = function (store) {
+ if ((store != null && (isObject(store) || isFunction(store)) || ((typeof Promise !== "undefined") && (store instanceof Promise))) &&
+ isFunction(store.then)) {
+ return propify(store)
+ }
+
+ return gettersetter(store)
+ }
+
+ var roots = []
+ var components = []
+ var controllers = []
+ var lastRedrawId = null
+ var lastRedrawCallTime = 0
+ var computePreRedrawHook = null
+ var computePostRedrawHook = null
+ var topComponent
+ var FRAME_BUDGET = 16 // 60 frames per second = 1 call per 16 ms
+
+ function parameterize(component, args) {
+ function controller() {
+ /* eslint-disable no-invalid-this */
+ return (component.controller || noop).apply(this, args) || this
+ /* eslint-enable no-invalid-this */
+ }
+
+ if (component.controller) {
+ controller.prototype = component.controller.prototype
+ }
+
+ function view(ctrl) {
+ var currentArgs = [ctrl].concat(args)
+ for (var i = 1; i < arguments.length; i++) {
+ currentArgs.push(arguments[i])
+ }
+
+ return component.view.apply(component, currentArgs)
+ }
+
+ view.$original = component.view
+ var output = {controller: controller, view: view}
+ if (args[0] && args[0].key != null) output.attrs = {key: args[0].key}
+ return output
+ }
+
+ m.component = function (component) {
+ var args = new Array(arguments.length - 1)
+
+ for (var i = 1; i < arguments.length; i++) {
+ args[i - 1] = arguments[i]
+ }
+
+ return parameterize(component, args)
+ }
+
+ function checkPrevented(component, root, index, isPrevented) {
+ if (!isPrevented) {
+ m.redraw.strategy("all")
+ m.startComputation()
+ roots[index] = root
+ var currentComponent
+
+ if (component) {
+ currentComponent = topComponent = component
+ } else {
+ currentComponent = topComponent = component = {controller: noop}
+ }
+
+ var controller = new (component.controller || noop)()
+
+ // controllers may call m.mount recursively (via m.route redirects,
+ // for example)
+ // this conditional ensures only the last recursive m.mount call is
+ // applied
+ if (currentComponent === topComponent) {
+ controllers[index] = controller
+ components[index] = component
+ }
+ endFirstComputation()
+ if (component === null) {
+ removeRootElement(root, index)
+ }
+ return controllers[index]
+ } else if (component == null) {
+ removeRootElement(root, index)
+ }
+ }
+
+ m.mount = m.module = function (root, component) {
+ if (!root) {
+ throw new Error("Please ensure the DOM element exists before " +
+ "rendering a template into it.")
+ }
+
+ var index = roots.indexOf(root)
+ if (index < 0) index = roots.length
+
+ var isPrevented = false
+ var event = {
+ preventDefault: function () {
+ isPrevented = true
+ computePreRedrawHook = computePostRedrawHook = null
+ }
+ }
+
+ forEach(unloaders, function (unloader) {
+ unloader.handler.call(unloader.controller, event)
+ unloader.controller.onunload = null
+ })
+
+ if (isPrevented) {
+ forEach(unloaders, function (unloader) {
+ unloader.controller.onunload = unloader.handler
+ })
+ } else {
+ unloaders = []
+ }
+
+ if (controllers[index] && isFunction(controllers[index].onunload)) {
+ controllers[index].onunload(event)
+ }
+
+ return checkPrevented(component, root, index, isPrevented)
+ }
+
+ function removeRootElement(root, index) {
+ roots.splice(index, 1)
+ controllers.splice(index, 1)
+ components.splice(index, 1)
+ reset(root)
+ nodeCache.splice(getCellCacheKey(root), 1)
+ }
+
+ var redrawing = false
+ m.redraw = function (force) {
+ if (redrawing) return
+ redrawing = true
+ if (force) forcing = true
+
+ try {
+ // lastRedrawId is a positive number if a second redraw is requested
+ // before the next animation frame
+ // lastRedrawId is null if it's the first redraw and not an event
+ // handler
+ if (lastRedrawId && !force) {
+ // when setTimeout: only reschedule redraw if time between now
+ // and previous redraw is bigger than a frame, otherwise keep
+ // currently scheduled timeout
+ // when rAF: always reschedule redraw
+ if ($requestAnimationFrame === global.requestAnimationFrame ||
+ new Date() - lastRedrawCallTime > FRAME_BUDGET) {
+ if (lastRedrawId > 0) $cancelAnimationFrame(lastRedrawId)
+ lastRedrawId = $requestAnimationFrame(redraw, FRAME_BUDGET)
+ }
+ } else {
+ redraw()
+ lastRedrawId = $requestAnimationFrame(function () {
+ lastRedrawId = null
+ }, FRAME_BUDGET)
+ }
+ } finally {
+ redrawing = forcing = false
+ }
+ }
+
+ m.redraw.strategy = m.prop()
+ function redraw() {
+ if (computePreRedrawHook) {
+ computePreRedrawHook()
+ computePreRedrawHook = null
+ }
+ forEach(roots, function (root, i) {
+ var component = components[i]
+ if (controllers[i]) {
+ var args = [controllers[i]]
+ m.render(root,
+ component.view ? component.view(controllers[i], args) : "")
+ }
+ })
+ // after rendering within a routed context, we need to scroll back to
+ // the top, and fetch the document title for history.pushState
+ if (computePostRedrawHook) {
+ computePostRedrawHook()
+ computePostRedrawHook = null
+ }
+ lastRedrawId = null
+ lastRedrawCallTime = new Date()
+ m.redraw.strategy("diff")
+ }
+
+ function endFirstComputation() {
+ if (m.redraw.strategy() === "none") {
+ pendingRequests--
+ m.redraw.strategy("diff")
+ } else {
+ m.endComputation()
+ }
+ }
+
+ m.withAttr = function (prop, withAttrCallback, callbackThis) {
+ return function (e) {
+ e = e || window.event
+ /* eslint-disable no-invalid-this */
+ var currentTarget = e.currentTarget || this
+ var _this = callbackThis || this
+ /* eslint-enable no-invalid-this */
+ var target = prop in currentTarget ?
+ currentTarget[prop] :
+ currentTarget.getAttribute(prop)
+ withAttrCallback.call(_this, target)
+ }
+ }
+
+ // routing
+ var modes = {pathname: "", hash: "#", search: "?"}
+ var redirect = noop
+ var isDefaultRoute = false
+ var routeParams, currentRoute
+
+ m.route = function (root, arg1, arg2, vdom) { // eslint-disable-line
+ // m.route()
+ if (arguments.length === 0) return currentRoute
+ // m.route(el, defaultRoute, routes)
+ if (arguments.length === 3 && isString(arg1)) {
+ redirect = function (source) {
+ var path = currentRoute = normalizeRoute(source)
+ if (!routeByValue(root, arg2, path)) {
+ if (isDefaultRoute) {
+ throw new Error("Ensure the default route matches " +
+ "one of the routes defined in m.route")
+ }
+
+ isDefaultRoute = true
+ m.route(arg1, true)
+ isDefaultRoute = false
+ }
+ }
+
+ var listener = m.route.mode === "hash" ?
+ "onhashchange" :
+ "onpopstate"
+
+ global[listener] = function () {
+ var path = $location[m.route.mode]
+ if (m.route.mode === "pathname") path += $location.search
+ if (currentRoute !== normalizeRoute(path)) redirect(path)
+ }
+
+ computePreRedrawHook = setScroll
+ global[listener]()
+
+ return
+ }
+
+ // config: m.route
+ if (root.addEventListener || root.attachEvent) {
+ var base = m.route.mode !== "pathname" ? $location.pathname : ""
+ root.href = base + modes[m.route.mode] + vdom.attrs.href
+ if (root.addEventListener) {
+ root.removeEventListener("click", routeUnobtrusive)
+ root.addEventListener("click", routeUnobtrusive)
+ } else {
+ root.detachEvent("onclick", routeUnobtrusive)
+ root.attachEvent("onclick", routeUnobtrusive)
+ }
+
+ return
+ }
+ // m.route(route, params, shouldReplaceHistoryEntry)
+ if (isString(root)) {
+ var oldRoute = currentRoute
+ currentRoute = root
+
+ var args = arg1 || {}
+ var queryIndex = currentRoute.indexOf("?")
+ var params
+
+ if (queryIndex > -1) {
+ params = parseQueryString(currentRoute.slice(queryIndex + 1))
+ } else {
+ params = {}
+ }
+
+ for (var i in args) {
+ if (hasOwn.call(args, i)) {
+ params[i] = args[i]
+ }
+ }
+
+ var querystring = buildQueryString(params)
+ var currentPath
+
+ if (queryIndex > -1) {
+ currentPath = currentRoute.slice(0, queryIndex)
+ } else {
+ currentPath = currentRoute
+ }
+
+ if (querystring) {
+ currentRoute = currentPath +
+ (currentPath.indexOf("?") === -1 ? "?" : "&") +
+ querystring
+ }
+
+ var replaceHistory =
+ (arguments.length === 3 ? arg2 : arg1) === true ||
+ oldRoute === root
+
+ if (global.history.pushState) {
+ var method = replaceHistory ? "replaceState" : "pushState"
+ computePreRedrawHook = setScroll
+ computePostRedrawHook = function () {
+ try {
+ global.history[method](null, $document.title,
+ modes[m.route.mode] + currentRoute)
+ } catch (err) {
+ // In the event of a pushState or replaceState failure,
+ // fallback to a standard redirect. This is specifically
+ // to address a Safari security error when attempting to
+ // call pushState more than 100 times.
+ $location[m.route.mode] = currentRoute
+ }
+ }
+ redirect(modes[m.route.mode] + currentRoute)
+ } else {
+ $location[m.route.mode] = currentRoute
+ redirect(modes[m.route.mode] + currentRoute)
+ }
+ }
+ }
+
+ m.route.param = function (key) {
+ if (!routeParams) {
+ throw new Error("You must call m.route(element, defaultRoute, " +
+ "routes) before calling m.route.param()")
+ }
+
+ if (!key) {
+ return routeParams
+ }
+
+ return routeParams[key]
+ }
+
+ m.route.mode = "search"
+
+ function normalizeRoute(route) {
+ return route.slice(modes[m.route.mode].length)
+ }
+
+ function routeByValue(root, router, path) {
+ routeParams = {}
+
+ var queryStart = path.indexOf("?")
+ if (queryStart !== -1) {
+ routeParams = parseQueryString(
+ path.substr(queryStart + 1, path.length))
+ path = path.substr(0, queryStart)
+ }
+
+ // Get all routes and check if there's
+ // an exact match for the current path
+ var keys = Object.keys(router)
+ var index = keys.indexOf(path)
+
+ if (index !== -1){
+ m.mount(root, router[keys [index]])
+ return true
+ }
+
+ for (var route in router) {
+ if (hasOwn.call(router, route)) {
+ if (route === path) {
+ m.mount(root, router[route])
+ return true
+ }
+
+ var matcher = new RegExp("^" + route
+ .replace(/:[^\/]+?\.{3}/g, "(.*?)")
+ .replace(/:[^\/]+/g, "([^\\/]+)") + "\/?$")
+
+ if (matcher.test(path)) {
+ /* eslint-disable no-loop-func */
+ path.replace(matcher, function () {
+ var keys = route.match(/:[^\/]+/g) || []
+ var values = [].slice.call(arguments, 1, -2)
+ forEach(keys, function (key, i) {
+ routeParams[key.replace(/:|\./g, "")] =
+ decodeURIComponent(values[i])
+ })
+ m.mount(root, router[route])
+ })
+ /* eslint-enable no-loop-func */
+ return true
+ }
+ }
+ }
+ }
+
+ function routeUnobtrusive(e) {
+ e = e || event
+ if (e.ctrlKey || e.metaKey || e.shiftKey || e.which === 2) return
+
+ if (e.preventDefault) {
+ e.preventDefault()
+ } else {
+ e.returnValue = false
+ }
+
+ var currentTarget = e.currentTarget || e.srcElement
+ var args
+
+ if (m.route.mode === "pathname" && currentTarget.search) {
+ args = parseQueryString(currentTarget.search.slice(1))
+ } else {
+ args = {}
+ }
+
+ while (currentTarget && !/a/i.test(currentTarget.nodeName)) {
+ currentTarget = currentTarget.parentNode
+ }
+
+ // clear pendingRequests because we want an immediate route change
+ pendingRequests = 0
+ m.route(currentTarget[m.route.mode]
+ .slice(modes[m.route.mode].length), args)
+ }
+
+ function setScroll() {
+ if (m.route.mode !== "hash" && $location.hash) {
+ $location.hash = $location.hash
+ } else {
+ global.scrollTo(0, 0)
+ }
+ }
+
+ function buildQueryString(object, prefix) {
+ var duplicates = {}
+ var str = []
+
+ for (var prop in object) {
+ if (hasOwn.call(object, prop)) {
+ var key = prefix ? prefix + "[" + prop + "]" : prop
+ var value = object[prop]
+
+ if (value === null) {
+ str.push(encodeURIComponent(key))
+ } else if (isObject(value)) {
+ str.push(buildQueryString(value, key))
+ } else if (isArray(value)) {
+ var keys = []
+ duplicates[key] = duplicates[key] || {}
+ /* eslint-disable no-loop-func */
+ forEach(value, function (item) {
+ /* eslint-enable no-loop-func */
+ if (!duplicates[key][item]) {
+ duplicates[key][item] = true
+ keys.push(encodeURIComponent(key) + "=" +
+ encodeURIComponent(item))
+ }
+ })
+ str.push(keys.join("&"))
+ } else if (value !== undefined) {
+ str.push(encodeURIComponent(key) + "=" +
+ encodeURIComponent(value))
+ }
+ }
+ }
+
+ return str.join("&")
+ }
+
+ function parseQueryString(str) {
+ if (str === "" || str == null) return {}
+ if (str.charAt(0) === "?") str = str.slice(1)
+
+ var pairs = str.split("&")
+ var params = {}
+
+ forEach(pairs, function (string) {
+ var pair = string.split("=")
+ var key = decodeURIComponent(pair[0])
+ var value = pair.length === 2 ? decodeURIComponent(pair[1]) : null
+ if (params[key] != null) {
+ if (!isArray(params[key])) params[key] = [params[key]]
+ params[key].push(value)
+ }
+ else params[key] = value
+ })
+
+ return params
+ }
+
+ m.route.buildQueryString = buildQueryString
+ m.route.parseQueryString = parseQueryString
+
+ function reset(root) {
+ var cacheKey = getCellCacheKey(root)
+ clear(root.childNodes, cellCache[cacheKey])
+ cellCache[cacheKey] = undefined
+ }
+
+ m.deferred = function () {
+ var deferred = new Deferred()
+ deferred.promise = propify(deferred.promise)
+ return deferred
+ }
+
+ function propify(promise, initialValue) {
+ var prop = m.prop(initialValue)
+ promise.then(prop)
+ prop.then = function (resolve, reject) {
+ return propify(promise.then(resolve, reject), initialValue)
+ }
+
+ prop.catch = prop.then.bind(null, null)
+ return prop
+ }
+ // Promiz.mithril.js | Zolmeister | MIT
+ // a modified version of Promiz.js, which does not conform to Promises/A+
+ // for two reasons:
+ //
+ // 1) `then` callbacks are called synchronously (because setTimeout is too
+ // slow, and the setImmediate polyfill is too big
+ //
+ // 2) throwing subclasses of Error cause the error to be bubbled up instead
+ // of triggering rejection (because the spec does not account for the
+ // important use case of default browser error handling, i.e. message w/
+ // line number)
+
+ var RESOLVING = 1
+ var REJECTING = 2
+ var RESOLVED = 3
+ var REJECTED = 4
+
+ function Deferred(onSuccess, onFailure) {
+ var self = this
+ var state = 0
+ var promiseValue = 0
+ var next = []
+
+ self.promise = {}
+
+ self.resolve = function (value) {
+ if (!state) {
+ promiseValue = value
+ state = RESOLVING
+
+ fire()
+ }
+
+ return self
+ }
+
+ self.reject = function (value) {
+ if (!state) {
+ promiseValue = value
+ state = REJECTING
+
+ fire()
+ }
+
+ return self
+ }
+
+ self.promise.then = function (onSuccess, onFailure) {
+ var deferred = new Deferred(onSuccess, onFailure)
+
+ if (state === RESOLVED) {
+ deferred.resolve(promiseValue)
+ } else if (state === REJECTED) {
+ deferred.reject(promiseValue)
+ } else {
+ next.push(deferred)
+ }
+
+ return deferred.promise
+ }
+
+ function finish(type) {
+ state = type || REJECTED
+ next.map(function (deferred) {
+ if (state === RESOLVED) {
+ deferred.resolve(promiseValue)
+ } else {
+ deferred.reject(promiseValue)
+ }
+ })
+ }
+
+ function thennable(then, success, failure, notThennable) {
+ if (((promiseValue != null && isObject(promiseValue)) ||
+ isFunction(promiseValue)) && isFunction(then)) {
+ try {
+ // count protects against abuse calls from spec checker
+ var count = 0
+ then.call(promiseValue, function (value) {
+ if (count++) return
+ promiseValue = value
+ success()
+ }, function (value) {
+ if (count++) return
+ promiseValue = value
+ failure()
+ })
+ } catch (e) {
+ m.deferred.onerror(e)
+ promiseValue = e
+ failure()
+ }
+ } else {
+ notThennable()
+ }
+ }
+
+ function fire() {
+ // check if it's a thenable
+ var then
+ try {
+ then = promiseValue && promiseValue.then
+ } catch (e) {
+ m.deferred.onerror(e)
+ promiseValue = e
+ state = REJECTING
+ return fire()
+ }
+
+ if (state === REJECTING) {
+ m.deferred.onerror(promiseValue)
+ }
+
+ thennable(then, function () {
+ state = RESOLVING
+ fire()
+ }, function () {
+ state = REJECTING
+ fire()
+ }, function () {
+ try {
+ if (state === RESOLVING && isFunction(onSuccess)) {
+ promiseValue = onSuccess(promiseValue)
+ } else if (state === REJECTING && isFunction(onFailure)) {
+ promiseValue = onFailure(promiseValue)
+ state = RESOLVING
+ }
+ } catch (e) {
+ m.deferred.onerror(e)
+ promiseValue = e
+ return finish()
+ }
+
+ if (promiseValue === self) {
+ promiseValue = TypeError()
+ finish()
+ } else {
+ thennable(then, function () {
+ finish(RESOLVED)
+ }, finish, function () {
+ finish(state === RESOLVING && RESOLVED)
+ })
+ }
+ })
+ }
+ }
+
+ m.deferred.onerror = function (e) {
+ if (type.call(e) === "[object Error]" &&
+ !/ Error/.test(e.constructor.toString())) {
+ pendingRequests = 0
+ throw e
+ }
+ }
+
+ m.sync = function (args) {
+ var deferred = m.deferred()
+ var outstanding = args.length
+ var results = []
+ var method = "resolve"
+
+ function synchronizer(pos, resolved) {
+ return function (value) {
+ results[pos] = value
+ if (!resolved) method = "reject"
+ if (--outstanding === 0) {
+ deferred.promise(results)
+ deferred[method](results)
+ }
+ return value
+ }
+ }
+
+ if (args.length > 0) {
+ forEach(args, function (arg, i) {
+ arg.then(synchronizer(i, true), synchronizer(i, false))
+ })
+ } else {
+ deferred.resolve([])
+ }
+
+ return deferred.promise
+ }
+
+ function identity(value) { return value }
+
+ function handleJsonp(options) {
+ var callbackKey = options.callbackName || "mithril_callback_" +
+ new Date().getTime() + "_" +
+ (Math.round(Math.random() * 1e16)).toString(36)
+
+ var script = $document.createElement("script")
+
+ global[callbackKey] = function (resp) {
+ script.parentNode.removeChild(script)
+ options.onload({
+ type: "load",
+ target: {
+ responseText: resp
+ }
+ })
+ global[callbackKey] = undefined
+ }
+
+ script.onerror = function () {
+ script.parentNode.removeChild(script)
+
+ options.onerror({
+ type: "error",
+ target: {
+ status: 500,
+ responseText: JSON.stringify({
+ error: "Error making jsonp request"
+ })
+ }
+ })
+ global[callbackKey] = undefined
+
+ return false
+ }
+
+ script.onload = function () {
+ return false
+ }
+
+ script.src = options.url +
+ (options.url.indexOf("?") > 0 ? "&" : "?") +
+ (options.callbackKey ? options.callbackKey : "callback") +
+ "=" + callbackKey +
+ "&" + buildQueryString(options.data || {})
+
+ $document.body.appendChild(script)
+ }
+
+ function createXhr(options) {
+ var xhr = new global.XMLHttpRequest()
+ xhr.open(options.method, options.url, true, options.user,
+ options.password)
+
+ xhr.onreadystatechange = function () {
+ if (xhr.readyState === 4) {
+ if (xhr.status >= 200 && xhr.status < 300) {
+ options.onload({type: "load", target: xhr})
+ } else {
+ options.onerror({type: "error", target: xhr})
+ }
+ }
+ }
+
+ if (options.serialize === JSON.stringify &&
+ options.data &&
+ options.method !== "GET") {
+ xhr.setRequestHeader("Content-Type",
+ "application/json; charset=utf-8")
+ }
+
+ if (options.deserialize === JSON.parse) {
+ xhr.setRequestHeader("Accept", "application/json, text/*")
+ }
+
+ if (isFunction(options.config)) {
+ var maybeXhr = options.config(xhr, options)
+ if (maybeXhr != null) xhr = maybeXhr
+ }
+
+ var data = options.method === "GET" || !options.data ? "" : options.data
+
+ if (data && !isString(data) && data.constructor !== global.FormData) {
+ throw new Error("Request data should be either be a string or " +
+ "FormData. Check the `serialize` option in `m.request`")
+ }
+
+ xhr.send(data)
+ return xhr
+ }
+
+ function ajax(options) {
+ if (options.dataType && options.dataType.toLowerCase() === "jsonp") {
+ return handleJsonp(options)
+ } else {
+ return createXhr(options)
+ }
+ }
+
+ function bindData(options, data, serialize) {
+ if (options.method === "GET" && options.dataType !== "jsonp") {
+ var prefix = options.url.indexOf("?") < 0 ? "?" : "&"
+ var querystring = buildQueryString(data)
+ options.url += (querystring ? prefix + querystring : "")
+ } else {
+ options.data = serialize(data)
+ }
+ }
+
+ function parameterizeUrl(url, data) {
+ if (data) {
+ url = url.replace(/:[a-z]\w+/gi, function (token){
+ var key = token.slice(1)
+ var value = data[key] || token
+ delete data[key]
+ return value
+ })
+ }
+ return url
+ }
+
+ m.request = function (options) {
+ if (options.background !== true) m.startComputation()
+ var deferred = new Deferred()
+ var isJSONP = options.dataType &&
+ options.dataType.toLowerCase() === "jsonp"
+
+ var serialize, deserialize, extract
+
+ if (isJSONP) {
+ serialize = options.serialize =
+ deserialize = options.deserialize = identity
+
+ extract = function (jsonp) { return jsonp.responseText }
+ } else {
+ serialize = options.serialize = options.serialize || JSON.stringify
+
+ deserialize = options.deserialize =
+ options.deserialize || JSON.parse
+ extract = options.extract || function (xhr) {
+ if (xhr.responseText.length || deserialize !== JSON.parse) {
+ return xhr.responseText
+ } else {
+ return null
+ }
+ }
+ }
+
+ options.method = (options.method || "GET").toUpperCase()
+ options.url = parameterizeUrl(options.url, options.data)
+ bindData(options, options.data, serialize)
+ options.onload = options.onerror = function (ev) {
+ try {
+ ev = ev || event
+ var response = deserialize(extract(ev.target, options))
+ if (ev.type === "load") {
+ if (options.unwrapSuccess) {
+ response = options.unwrapSuccess(response, ev.target)
+ }
+
+ if (isArray(response) && options.type) {
+ forEach(response, function (res, i) {
+ response[i] = new options.type(res)
+ })
+ } else if (options.type) {
+ response = new options.type(response)
+ }
+
+ deferred.resolve(response)
+ } else {
+ if (options.unwrapError) {
+ response = options.unwrapError(response, ev.target)
+ }
+
+ deferred.reject(response)
+ }
+ } catch (e) {
+ deferred.reject(e)
+ m.deferred.onerror(e)
+ } finally {
+ if (options.background !== true) m.endComputation()
+ }
+ }
+
+ ajax(options)
+ deferred.promise = propify(deferred.promise, options.initialValue)
+ return deferred.promise
+ }
+
+ return m
+}); // eslint-disable-line
diff --git a/lib/vendor/system-csp-production.src.js b/lib/vendor/system-csp-production.src.js
new file mode 100644
index 000000000..9c5e56532
--- /dev/null
+++ b/lib/vendor/system-csp-production.src.js
@@ -0,0 +1,4536 @@
+/*
+ * SystemJS v0.19.39
+ */
+(function() {
+function bootstrap() {// from https://gist.github.com/Yaffle/1088850
+(function(global) {
+function URLPolyfill(url, baseURL) {
+ if (typeof url != 'string')
+ throw new TypeError('URL must be a string');
+ var m = String(url).replace(/^\s+|\s+$/g, "").match(/^([^:\/?#]+:)?(?:\/\/(?:([^:@\/?#]*)(?::([^:@\/?#]*))?@)?(([^:\/?#]*)(?::(\d*))?))?([^?#]*)(\?[^#]*)?(#[\s\S]*)?/);
+ if (!m)
+ throw new RangeError('Invalid URL format');
+ var protocol = m[1] || "";
+ var username = m[2] || "";
+ var password = m[3] || "";
+ var host = m[4] || "";
+ var hostname = m[5] || "";
+ var port = m[6] || "";
+ var pathname = m[7] || "";
+ var search = m[8] || "";
+ var hash = m[9] || "";
+ if (baseURL !== undefined) {
+ var base = baseURL instanceof URLPolyfill ? baseURL : new URLPolyfill(baseURL);
+ var flag = !protocol && !host && !username;
+ if (flag && !pathname && !search)
+ search = base.search;
+ if (flag && pathname[0] !== "/")
+ pathname = (pathname ? (((base.host || base.username) && !base.pathname ? "/" : "") + base.pathname.slice(0, base.pathname.lastIndexOf("/") + 1) + pathname) : base.pathname);
+ // dot segments removal
+ var output = [];
+ pathname.replace(/^(\.\.?(\/|$))+/, "")
+ .replace(/\/(\.(\/|$))+/g, "/")
+ .replace(/\/\.\.$/, "/../")
+ .replace(/\/?[^\/]*/g, function (p) {
+ if (p === "/..")
+ output.pop();
+ else
+ output.push(p);
+ });
+ pathname = output.join("").replace(/^\//, pathname[0] === "/" ? "/" : "");
+ if (flag) {
+ port = base.port;
+ hostname = base.hostname;
+ host = base.host;
+ password = base.password;
+ username = base.username;
+ }
+ if (!protocol)
+ protocol = base.protocol;
+ }
+
+ // convert URLs to use / always
+ pathname = pathname.replace(/\\/g, '/');
+
+ this.origin = host ? protocol + (protocol !== "" || host !== "" ? "//" : "") + host : "";
+ this.href = protocol + (protocol && host || protocol == "file:" ? "//" : "") + (username !== "" ? username + (password !== "" ? ":" + password : "") + "@" : "") + host + pathname + search + hash;
+ this.protocol = protocol;
+ this.username = username;
+ this.password = password;
+ this.host = host;
+ this.hostname = hostname;
+ this.port = port;
+ this.pathname = pathname;
+ this.search = search;
+ this.hash = hash;
+}
+global.URLPolyfill = URLPolyfill;
+})(typeof self != 'undefined' ? self : global);(function(__global) {
+
+ var isWorker = typeof window == 'undefined' && typeof self != 'undefined' && typeof importScripts != 'undefined';
+ var isBrowser = typeof window != 'undefined' && typeof document != 'undefined';
+ var isWindows = typeof process != 'undefined' && typeof process.platform != 'undefined' && !!process.platform.match(/^win/);
+
+ if (!__global.console)
+ __global.console = { assert: function() {} };
+
+ // IE8 support
+ var indexOf = Array.prototype.indexOf || function(item) {
+ for (var i = 0, thisLen = this.length; i < thisLen; i++) {
+ if (this[i] === item) {
+ return i;
+ }
+ }
+ return -1;
+ };
+
+ var defineProperty;
+ (function () {
+ try {
+ if (!!Object.defineProperty({}, 'a', {}))
+ defineProperty = Object.defineProperty;
+ }
+ catch (e) {
+ defineProperty = function(obj, prop, opt) {
+ try {
+ obj[prop] = opt.value || opt.get.call(obj);
+ }
+ catch(e) {}
+ }
+ }
+ })();
+
+ var errArgs = new Error(0, '_').fileName == '_';
+
+ function addToError(err, msg) {
+ // parse the stack removing loader code lines for simplification
+ if (!err.originalErr) {
+ var stack = ((err.message || err) + (err.stack ? '\n' + err.stack : '')).toString().split('\n');
+ var newStack = [];
+ for (var i = 0; i < stack.length; i++) {
+ if (typeof $__curScript == 'undefined' || stack[i].indexOf($__curScript.src) == -1)
+ newStack.push(stack[i]);
+ }
+ }
+
+ var newMsg = '(SystemJS) ' + (newStack ? newStack.join('\n\t') : err.message.substr(11)) + '\n\t' + msg;
+
+ // Convert file:/// URLs to paths in Node
+ if (!isBrowser)
+ newMsg = newMsg.replace(isWindows ? /file:\/\/\//g : /file:\/\//g, '');
+
+ var newErr = errArgs ? new Error(newMsg, err.fileName, err.lineNumber) : new Error(newMsg);
+
+ newErr.stack = newMsg;
+
+ // track the original error
+ newErr.originalErr = err.originalErr || err;
+
+ return newErr;
+ }
+
+ function __eval(source, debugName, context) {
+ try {
+ new Function(source).call(context);
+ }
+ catch(e) {
+ throw addToError(e, 'Evaluating ' + debugName);
+ }
+ }
+
+ var baseURI;
+
+ // environent baseURI detection
+ if (typeof document != 'undefined' && document.getElementsByTagName) {
+ baseURI = document.baseURI;
+
+ if (!baseURI) {
+ var bases = document.getElementsByTagName('base');
+ baseURI = bases[0] && bases[0].href || window.location.href;
+ }
+ }
+ else if (typeof location != 'undefined') {
+ baseURI = __global.location.href;
+ }
+
+ // sanitize out the hash and querystring
+ if (baseURI) {
+ baseURI = baseURI.split('#')[0].split('?')[0];
+ baseURI = baseURI.substr(0, baseURI.lastIndexOf('/') + 1);
+ }
+ else if (typeof process != 'undefined' && process.cwd) {
+ baseURI = 'file://' + (isWindows ? '/' : '') + process.cwd() + '/';
+ if (isWindows)
+ baseURI = baseURI.replace(/\\/g, '/');
+ }
+ else {
+ throw new TypeError('No environment baseURI');
+ }
+
+ try {
+ var nativeURL = new __global.URL('test:///').protocol == 'test:';
+ }
+ catch(e) {}
+
+ var URL = nativeURL ? __global.URL : __global.URLPolyfill;
+
+/*
+*********************************************************************************************
+
+ Dynamic Module Loader Polyfill
+
+ - Implemented exactly to the former 2014-08-24 ES6 Specification Draft Rev 27, Section 15
+ http://wiki.ecmascript.org/doku.php?id=harmony:specification_drafts#august_24_2014_draft_rev_27
+
+ - Functions are commented with their spec numbers, with spec differences commented.
+
+ - Spec bugs are commented in this code with links.
+
+ - Abstract functions have been combined where possible, and their associated functions
+ commented.
+
+ - Realm implementation is entirely omitted.
+
+*********************************************************************************************
+*/
+
+function Module() {}
+// http://www.ecma-international.org/ecma-262/6.0/#sec-@@tostringtag
+defineProperty(Module.prototype, 'toString', {
+ value: function() {
+ return 'Module';
+ }
+});
+function Loader(options) {
+ this._loader = {
+ loaderObj: this,
+ loads: [],
+ modules: {},
+ importPromises: {},
+ moduleRecords: {}
+ };
+
+ // 26.3.3.6
+ defineProperty(this, 'global', {
+ get: function() {
+ return __global;
+ }
+ });
+
+ // 26.3.3.13 realm not implemented
+}
+
+(function() {
+
+// Some Helpers
+
+// logs a linkset snapshot for debugging
+/* function snapshot(loader) {
+ console.log('---Snapshot---');
+ for (var i = 0; i < loader.loads.length; i++) {
+ var load = loader.loads[i];
+ var linkSetLog = ' ' + load.name + ' (' + load.status + '): ';
+
+ for (var j = 0; j < load.linkSets.length; j++) {
+ linkSetLog += '{' + logloads(load.linkSets[j].loads) + '} ';
+ }
+ console.log(linkSetLog);
+ }
+ console.log('');
+}
+function logloads(loads) {
+ var log = '';
+ for (var k = 0; k < loads.length; k++)
+ log += loads[k].name + (k != loads.length - 1 ? ' ' : '');
+ return log;
+} */
+
+
+/* function checkInvariants() {
+ // see https://bugs.ecmascript.org/show_bug.cgi?id=2603#c1
+
+ var loads = System._loader.loads;
+ var linkSets = [];
+
+ for (var i = 0; i < loads.length; i++) {
+ var load = loads[i];
+ console.assert(load.status == 'loading' || load.status == 'loaded', 'Each load is loading or loaded');
+
+ for (var j = 0; j < load.linkSets.length; j++) {
+ var linkSet = load.linkSets[j];
+
+ for (var k = 0; k < linkSet.loads.length; k++)
+ console.assert(loads.indexOf(linkSet.loads[k]) != -1, 'linkSet loads are a subset of loader loads');
+
+ if (linkSets.indexOf(linkSet) == -1)
+ linkSets.push(linkSet);
+ }
+ }
+
+ for (var i = 0; i < loads.length; i++) {
+ var load = loads[i];
+ for (var j = 0; j < linkSets.length; j++) {
+ var linkSet = linkSets[j];
+
+ if (linkSet.loads.indexOf(load) != -1)
+ console.assert(load.linkSets.indexOf(linkSet) != -1, 'linkSet contains load -> load contains linkSet');
+
+ if (load.linkSets.indexOf(linkSet) != -1)
+ console.assert(linkSet.loads.indexOf(load) != -1, 'load contains linkSet -> linkSet contains load');
+ }
+ }
+
+ for (var i = 0; i < linkSets.length; i++) {
+ var linkSet = linkSets[i];
+ for (var j = 0; j < linkSet.loads.length; j++) {
+ var load = linkSet.loads[j];
+
+ for (var k = 0; k < load.dependencies.length; k++) {
+ var depName = load.dependencies[k].value;
+ var depLoad;
+ for (var l = 0; l < loads.length; l++) {
+ if (loads[l].name != depName)
+ continue;
+ depLoad = loads[l];
+ break;
+ }
+
+ // loading records are allowed not to have their dependencies yet
+ // if (load.status != 'loading')
+ // console.assert(depLoad, 'depLoad found');
+
+ // console.assert(linkSet.loads.indexOf(depLoad) != -1, 'linkset contains all dependencies');
+ }
+ }
+ }
+} */
+
+ // 15.2.3 - Runtime Semantics: Loader State
+
+ // 15.2.3.11
+ function createLoaderLoad(object) {
+ return {
+ // modules is an object for ES5 implementation
+ modules: {},
+ loads: [],
+ loaderObj: object
+ };
+ }
+
+ // 15.2.3.2 Load Records and LoadRequest Objects
+
+ var anonCnt = 0;
+
+ // 15.2.3.2.1
+ function createLoad(name) {
+ return {
+ status: 'loading',
+ name: name || '<Anonymous' + ++anonCnt + '>',
+ linkSets: [],
+ dependencies: [],
+ metadata: {}
+ };
+ }
+
+ // 15.2.3.2.2 createLoadRequestObject, absorbed into calling functions
+
+ // 15.2.4
+
+ // 15.2.4.1
+ function loadModule(loader, name, options) {
+ return new Promise(asyncStartLoadPartwayThrough({
+ step: options.address ? 'fetch' : 'locate',
+ loader: loader,
+ moduleName: name,
+ // allow metadata for import https://bugs.ecmascript.org/show_bug.cgi?id=3091
+ moduleMetadata: options && options.metadata || {},
+ moduleSource: options.source,
+ moduleAddress: options.address
+ }));
+ }
+
+ // 15.2.4.2
+ function requestLoad(loader, request, refererName, refererAddress) {
+ // 15.2.4.2.1 CallNormalize
+ return new Promise(function(resolve, reject) {
+ resolve(loader.loaderObj.normalize(request, refererName, refererAddress));
+ })
+ // 15.2.4.2.2 GetOrCreateLoad
+ .then(function(name) {
+ var load;
+ if (loader.modules[name]) {
+ load = createLoad(name);
+ load.status = 'linked';
+ // https://bugs.ecmascript.org/show_bug.cgi?id=2795
+ load.module = loader.modules[name];
+ return load;
+ }
+
+ for (var i = 0, l = loader.loads.length; i < l; i++) {
+ load = loader.loads[i];
+ if (load.name != name)
+ continue;
+ return load;
+ }
+
+ load = createLoad(name);
+ loader.loads.push(load);
+
+ proceedToLocate(loader, load);
+
+ return load;
+ });
+ }
+
+ // 15.2.4.3
+ function proceedToLocate(loader, load) {
+ proceedToFetch(loader, load,
+ Promise.resolve()
+ // 15.2.4.3.1 CallLocate
+ .then(function() {
+ return loader.loaderObj.locate({ name: load.name, metadata: load.metadata });
+ })
+ );
+ }
+
+ // 15.2.4.4
+ function proceedToFetch(loader, load, p) {
+ proceedToTranslate(loader, load,
+ p
+ // 15.2.4.4.1 CallFetch
+ .then(function(address) {
+ // adjusted, see https://bugs.ecmascript.org/show_bug.cgi?id=2602
+ if (load.status != 'loading')
+ return;
+ load.address = address;
+
+ return loader.loaderObj.fetch({ name: load.name, metadata: load.metadata, address: address });
+ })
+ );
+ }
+
+ // 15.2.4.5
+ function proceedToTranslate(loader, load, p) {
+ p
+ // 15.2.4.5.1 CallTranslate
+ .then(function(source) {
+ if (load.status != 'loading')
+ return;
+
+ load.address = load.address || load.name;
+
+ return Promise.resolve(loader.loaderObj.translate({ name: load.name, metadata: load.metadata, address: load.address, source: source }))
+
+ // 15.2.4.5.2 CallInstantiate
+ .then(function(source) {
+ load.source = source;
+ return loader.loaderObj.instantiate({ name: load.name, metadata: load.metadata, address: load.address, source: source });
+ })
+
+ // 15.2.4.5.3 InstantiateSucceeded
+ .then(function(instantiateResult) {
+ if (instantiateResult === undefined)
+ throw new TypeError('Declarative modules unsupported in the polyfill.');
+
+ if (typeof instantiateResult != 'object')
+ throw new TypeError('Invalid instantiate return value');
+
+ load.depsList = instantiateResult.deps || [];
+ load.execute = instantiateResult.execute;
+ })
+ // 15.2.4.6 ProcessLoadDependencies
+ .then(function() {
+ load.dependencies = [];
+ var depsList = load.depsList;
+
+ var loadPromises = [];
+ for (var i = 0, l = depsList.length; i < l; i++) (function(request, index) {
+ loadPromises.push(
+ requestLoad(loader, request, load.name, load.address)
+
+ // 15.2.4.6.1 AddDependencyLoad (load is parentLoad)
+ .then(function(depLoad) {
+
+ // adjusted from spec to maintain dependency order
+ // this is due to the System.register internal implementation needs
+ load.dependencies[index] = {
+ key: request,
+ value: depLoad.name
+ };
+
+ if (depLoad.status != 'linked') {
+ var linkSets = load.linkSets.concat([]);
+ for (var i = 0, l = linkSets.length; i < l; i++)
+ addLoadToLinkSet(linkSets[i], depLoad);
+ }
+
+ // console.log('AddDependencyLoad ' + depLoad.name + ' for ' + load.name);
+ // snapshot(loader);
+ })
+ );
+ })(depsList[i], i);
+
+ return Promise.all(loadPromises);
+ })
+
+ // 15.2.4.6.2 LoadSucceeded
+ .then(function() {
+ // console.log('LoadSucceeded ' + load.name);
+ // snapshot(loader);
+
+ load.status = 'loaded';
+
+ var linkSets = load.linkSets.concat([]);
+ for (var i = 0, l = linkSets.length; i < l; i++)
+ updateLinkSetOnLoad(linkSets[i], load);
+ });
+ })
+ // 15.2.4.5.4 LoadFailed
+ ['catch'](function(exc) {
+ load.status = 'failed';
+ load.exception = exc;
+
+ var linkSets = load.linkSets.concat([]);
+ for (var i = 0, l = linkSets.length; i < l; i++) {
+ linkSetFailed(linkSets[i], load, exc);
+ }
+
+ console.assert(load.linkSets.length == 0, 'linkSets not removed');
+ });
+ }
+
+ // 15.2.4.7 PromiseOfStartLoadPartwayThrough absorbed into calling functions
+
+ // 15.2.4.7.1
+ function asyncStartLoadPartwayThrough(stepState) {
+ return function(resolve, reject) {
+ var loader = stepState.loader;
+ var name = stepState.moduleName;
+ var step = stepState.step;
+
+ if (loader.modules[name])
+ throw new TypeError('"' + name + '" already exists in the module table');
+
+ // adjusted to pick up existing loads
+ var existingLoad;
+ for (var i = 0, l = loader.loads.length; i < l; i++) {
+ if (loader.loads[i].name == name) {
+ existingLoad = loader.loads[i];
+
+ if (step == 'translate' && !existingLoad.source) {
+ existingLoad.address = stepState.moduleAddress;
+ proceedToTranslate(loader, existingLoad, Promise.resolve(stepState.moduleSource));
+ }
+
+ // a primary load -> use that existing linkset if it is for the direct load here
+ // otherwise create a new linkset unit
+ if (existingLoad.linkSets.length && existingLoad.linkSets[0].loads[0].name == existingLoad.name)
+ return existingLoad.linkSets[0].done.then(function() {
+ resolve(existingLoad);
+ });
+ }
+ }
+
+ var load = existingLoad || createLoad(name);
+
+ load.metadata = stepState.moduleMetadata;
+
+ var linkSet = createLinkSet(loader, load);
+
+ loader.loads.push(load);
+
+ resolve(linkSet.done);
+
+ if (step == 'locate')
+ proceedToLocate(loader, load);
+
+ else if (step == 'fetch')
+ proceedToFetch(loader, load, Promise.resolve(stepState.moduleAddress));
+
+ else {
+ console.assert(step == 'translate', 'translate step');
+ load.address = stepState.moduleAddress;
+ proceedToTranslate(loader, load, Promise.resolve(stepState.moduleSource));
+ }
+ }
+ }
+
+ // Declarative linking functions run through alternative implementation:
+ // 15.2.5.1.1 CreateModuleLinkageRecord not implemented
+ // 15.2.5.1.2 LookupExport not implemented
+ // 15.2.5.1.3 LookupModuleDependency not implemented
+
+ // 15.2.5.2.1
+ function createLinkSet(loader, startingLoad) {
+ var linkSet = {
+ loader: loader,
+ loads: [],
+ startingLoad: startingLoad, // added see spec bug https://bugs.ecmascript.org/show_bug.cgi?id=2995
+ loadingCount: 0
+ };
+ linkSet.done = new Promise(function(resolve, reject) {
+ linkSet.resolve = resolve;
+ linkSet.reject = reject;
+ });
+ addLoadToLinkSet(linkSet, startingLoad);
+ return linkSet;
+ }
+ // 15.2.5.2.2
+ function addLoadToLinkSet(linkSet, load) {
+ if (load.status == 'failed')
+ return;
+
+ for (var i = 0, l = linkSet.loads.length; i < l; i++)
+ if (linkSet.loads[i] == load)
+ return;
+
+ linkSet.loads.push(load);
+ load.linkSets.push(linkSet);
+
+ // adjustment, see https://bugs.ecmascript.org/show_bug.cgi?id=2603
+ if (load.status != 'loaded') {
+ linkSet.loadingCount++;
+ }
+
+ var loader = linkSet.loader;
+
+ for (var i = 0, l = load.dependencies.length; i < l; i++) {
+ if (!load.dependencies[i])
+ continue;
+
+ var name = load.dependencies[i].value;
+
+ if (loader.modules[name])
+ continue;
+
+ for (var j = 0, d = loader.loads.length; j < d; j++) {
+ if (loader.loads[j].name != name)
+ continue;
+
+ addLoadToLinkSet(linkSet, loader.loads[j]);
+ break;
+ }
+ }
+ // console.log('add to linkset ' + load.name);
+ // snapshot(linkSet.loader);
+ }
+
+ // linking errors can be generic or load-specific
+ // this is necessary for debugging info
+ function doLink(linkSet) {
+ var error = false;
+ try {
+ link(linkSet, function(load, exc) {
+ linkSetFailed(linkSet, load, exc);
+ error = true;
+ });
+ }
+ catch(e) {
+ linkSetFailed(linkSet, null, e);
+ error = true;
+ }
+ return error;
+ }
+
+ // 15.2.5.2.3
+ function updateLinkSetOnLoad(linkSet, load) {
+ // console.log('update linkset on load ' + load.name);
+ // snapshot(linkSet.loader);
+
+ console.assert(load.status == 'loaded' || load.status == 'linked', 'loaded or linked');
+
+ linkSet.loadingCount--;
+
+ if (linkSet.loadingCount > 0)
+ return;
+
+ // adjusted for spec bug https://bugs.ecmascript.org/show_bug.cgi?id=2995
+ var startingLoad = linkSet.startingLoad;
+
+ // non-executing link variation for loader tracing
+ // on the server. Not in spec.
+ /***/
+ if (linkSet.loader.loaderObj.execute === false) {
+ var loads = [].concat(linkSet.loads);
+ for (var i = 0, l = loads.length; i < l; i++) {
+ var load = loads[i];
+ load.module = {
+ name: load.name,
+ module: _newModule({}),
+ evaluated: true
+ };
+ load.status = 'linked';
+ finishLoad(linkSet.loader, load);
+ }
+ return linkSet.resolve(startingLoad);
+ }
+ /***/
+
+ var abrupt = doLink(linkSet);
+
+ if (abrupt)
+ return;
+
+ console.assert(linkSet.loads.length == 0, 'loads cleared');
+
+ linkSet.resolve(startingLoad);
+ }
+
+ // 15.2.5.2.4
+ function linkSetFailed(linkSet, load, exc) {
+ var loader = linkSet.loader;
+ var requests;
+
+ checkError:
+ if (load) {
+ if (linkSet.loads[0].name == load.name) {
+ exc = addToError(exc, 'Error loading ' + load.name);
+ }
+ else {
+ for (var i = 0; i < linkSet.loads.length; i++) {
+ var pLoad = linkSet.loads[i];
+ for (var j = 0; j < pLoad.dependencies.length; j++) {
+ var dep = pLoad.dependencies[j];
+ if (dep.value == load.name) {
+ exc = addToError(exc, 'Error loading ' + load.name + ' as "' + dep.key + '" from ' + pLoad.name);
+ break checkError;
+ }
+ }
+ }
+ exc = addToError(exc, 'Error loading ' + load.name + ' from ' + linkSet.loads[0].name);
+ }
+ }
+ else {
+ exc = addToError(exc, 'Error linking ' + linkSet.loads[0].name);
+ }
+
+
+ var loads = linkSet.loads.concat([]);
+ for (var i = 0, l = loads.length; i < l; i++) {
+ var load = loads[i];
+
+ // store all failed load records
+ loader.loaderObj.failed = loader.loaderObj.failed || [];
+ if (indexOf.call(loader.loaderObj.failed, load) == -1)
+ loader.loaderObj.failed.push(load);
+
+ var linkIndex = indexOf.call(load.linkSets, linkSet);
+ console.assert(linkIndex != -1, 'link not present');
+ load.linkSets.splice(linkIndex, 1);
+ if (load.linkSets.length == 0) {
+ var globalLoadsIndex = indexOf.call(linkSet.loader.loads, load);
+ if (globalLoadsIndex != -1)
+ linkSet.loader.loads.splice(globalLoadsIndex, 1);
+ }
+ }
+ linkSet.reject(exc);
+ }
+
+ // 15.2.5.2.5
+ function finishLoad(loader, load) {
+ // add to global trace if tracing
+ if (loader.loaderObj.trace) {
+ if (!loader.loaderObj.loads)
+ loader.loaderObj.loads = {};
+ var depMap = {};
+ load.dependencies.forEach(function(dep) {
+ depMap[dep.key] = dep.value;
+ });
+ loader.loaderObj.loads[load.name] = {
+ name: load.name,
+ deps: load.dependencies.map(function(dep){ return dep.key }),
+ depMap: depMap,
+ address: load.address,
+ metadata: load.metadata,
+ source: load.source
+ };
+ }
+ // if not anonymous, add to the module table
+ if (load.name) {
+ console.assert(!loader.modules[load.name] || loader.modules[load.name].module === load.module.module, 'load not in module table');
+ loader.modules[load.name] = load.module;
+ }
+ var loadIndex = indexOf.call(loader.loads, load);
+ if (loadIndex != -1)
+ loader.loads.splice(loadIndex, 1);
+ for (var i = 0, l = load.linkSets.length; i < l; i++) {
+ loadIndex = indexOf.call(load.linkSets[i].loads, load);
+ if (loadIndex != -1)
+ load.linkSets[i].loads.splice(loadIndex, 1);
+ }
+ load.linkSets.splice(0, load.linkSets.length);
+ }
+
+ function doDynamicExecute(linkSet, load, linkError) {
+ try {
+ var module = load.execute();
+ }
+ catch(e) {
+ linkError(load, e);
+ return;
+ }
+ if (!module || !(module instanceof Module))
+ linkError(load, new TypeError('Execution must define a Module instance'));
+ else
+ return module;
+ }
+
+ // 26.3 Loader
+
+ // 26.3.1.1
+ // defined at top
+
+ // importPromises adds ability to import a module twice without error - https://bugs.ecmascript.org/show_bug.cgi?id=2601
+ function createImportPromise(loader, name, promise) {
+ var importPromises = loader._loader.importPromises;
+ return importPromises[name] = promise.then(function(m) {
+ importPromises[name] = undefined;
+ return m;
+ }, function(e) {
+ importPromises[name] = undefined;
+ throw e;
+ });
+ }
+
+ Loader.prototype = {
+ // 26.3.3.1
+ constructor: Loader,
+ // 26.3.3.2
+ define: function(name, source, options) {
+ // check if already defined
+ if (this._loader.importPromises[name])
+ throw new TypeError('Module is already loading.');
+ return createImportPromise(this, name, new Promise(asyncStartLoadPartwayThrough({
+ step: 'translate',
+ loader: this._loader,
+ moduleName: name,
+ moduleMetadata: options && options.metadata || {},
+ moduleSource: source,
+ moduleAddress: options && options.address
+ })));
+ },
+ // 26.3.3.3
+ 'delete': function(name) {
+ var loader = this._loader;
+ delete loader.importPromises[name];
+ delete loader.moduleRecords[name];
+ return loader.modules[name] ? delete loader.modules[name] : false;
+ },
+ // 26.3.3.4 entries not implemented
+ // 26.3.3.5
+ get: function(key) {
+ if (!this._loader.modules[key])
+ return;
+ return this._loader.modules[key].module;
+ },
+ // 26.3.3.7
+ has: function(name) {
+ return !!this._loader.modules[name];
+ },
+ // 26.3.3.8
+ 'import': function(name, parentName, parentAddress) {
+ if (typeof parentName == 'object')
+ parentName = parentName.name;
+
+ // run normalize first
+ var loaderObj = this;
+
+ // added, see https://bugs.ecmascript.org/show_bug.cgi?id=2659
+ return Promise.resolve(loaderObj.normalize(name, parentName))
+ .then(function(name) {
+ var loader = loaderObj._loader;
+
+ if (loader.modules[name])
+ return loader.modules[name].module;
+
+ return loader.importPromises[name] || createImportPromise(loaderObj, name,
+ loadModule(loader, name, {})
+ .then(function(load) {
+ delete loader.importPromises[name];
+ return load.module.module;
+ }));
+ });
+ },
+ // 26.3.3.9 keys not implemented
+ // 26.3.3.10
+ load: function(name) {
+ var loader = this._loader;
+ if (loader.modules[name])
+ return Promise.resolve();
+ return loader.importPromises[name] || createImportPromise(this, name, new Promise(asyncStartLoadPartwayThrough({
+ step: 'locate',
+ loader: loader,
+ moduleName: name,
+ moduleMetadata: {},
+ moduleSource: undefined,
+ moduleAddress: undefined
+ }))
+ .then(function() {
+ delete loader.importPromises[name];
+ }));
+ },
+ // 26.3.3.11
+ module: function(source, options) {
+ var load = createLoad();
+ load.address = options && options.address;
+ var linkSet = createLinkSet(this._loader, load);
+ var sourcePromise = Promise.resolve(source);
+ var loader = this._loader;
+ var p = linkSet.done.then(function() {
+ return load.module.module;
+ });
+ proceedToTranslate(loader, load, sourcePromise);
+ return p;
+ },
+ // 26.3.3.12
+ newModule: function (obj) {
+ if (typeof obj != 'object')
+ throw new TypeError('Expected object');
+
+ var m = new Module();
+
+ var pNames = [];
+ if (Object.getOwnPropertyNames && obj != null)
+ pNames = Object.getOwnPropertyNames(obj);
+ else
+ for (var key in obj)
+ pNames.push(key);
+
+ for (var i = 0; i < pNames.length; i++) (function(key) {
+ defineProperty(m, key, {
+ configurable: false,
+ enumerable: true,
+ get: function () {
+ return obj[key];
+ },
+ set: function() {
+ throw new Error('Module exports cannot be changed externally.');
+ }
+ });
+ })(pNames[i]);
+
+ if (Object.freeze)
+ Object.freeze(m);
+
+ return m;
+ },
+ // 26.3.3.14
+ set: function(name, module) {
+ if (!(module instanceof Module))
+ throw new TypeError('Loader.set(' + name + ', module) must be a module');
+ this._loader.modules[name] = {
+ module: module
+ };
+ },
+ // 26.3.3.15 values not implemented
+ // 26.3.3.16 @@iterator not implemented
+ // 26.3.3.17 @@toStringTag not implemented
+
+ // 26.3.3.18.1
+ normalize: function(name, referrerName, referrerAddress) {},
+ // 26.3.3.18.2
+ locate: function(load) {
+ return load.name;
+ },
+ // 26.3.3.18.3
+ fetch: function(load) {
+ },
+ // 26.3.3.18.4
+ translate: function(load) {
+ return load.source;
+ },
+ // 26.3.3.18.5
+ instantiate: function(load) {
+ }
+ };
+
+ var _newModule = Loader.prototype.newModule;
+
+/*
+ * ES6 Module Declarative Linking Code
+ */
+ function link(linkSet, linkError) {
+
+ var loader = linkSet.loader;
+
+ if (!linkSet.loads.length)
+ return;
+
+ var loads = linkSet.loads.concat([]);
+
+ for (var i = 0; i < loads.length; i++) {
+ var load = loads[i];
+
+ var module = doDynamicExecute(linkSet, load, linkError);
+ if (!module)
+ return;
+ load.module = {
+ name: load.name,
+ module: module
+ };
+ load.status = 'linked';
+
+ finishLoad(loader, load);
+ }
+ }
+
+})();
+
+var System;
+
+// SystemJS Loader Class and Extension helpers
+function SystemJSLoader() {
+ Loader.call(this);
+
+ this.paths = {};
+ this._loader.paths = {};
+
+ systemJSConstructor.call(this);
+}
+
+// inline Object.create-style class extension
+function SystemProto() {};
+SystemProto.prototype = Loader.prototype;
+SystemJSLoader.prototype = new SystemProto();
+SystemJSLoader.prototype.constructor = SystemJSLoader;
+
+var systemJSConstructor;
+
+function hook(name, hook) {
+ SystemJSLoader.prototype[name] = hook(SystemJSLoader.prototype[name] || function() {});
+}
+function hookConstructor(hook) {
+ systemJSConstructor = hook(systemJSConstructor || function() {});
+}
+
+
+var absURLRegEx = /^[^\/]+:\/\//;
+function isAbsolute(name) {
+ return name.match(absURLRegEx);
+}
+function isRel(name) {
+ return (name[0] == '.' && (!name[1] || name[1] == '/' || name[1] == '.')) || name[0] == '/';
+}
+function isPlain(name) {
+ return !isRel(name) && !isAbsolute(name);
+}
+
+var baseURIObj = new URL(baseURI);
+
+function urlResolve(name, parent) {
+ // url resolution shortpaths
+ if (name[0] == '.') {
+ // dot-relative url normalization
+ if (name[1] == '/' && name[2] != '.')
+ return (parent && parent.substr(0, parent.lastIndexOf('/') + 1) || baseURI) + name.substr(2);
+ }
+ else if (name[0] != '/' && name.indexOf(':') == -1) {
+ // plain parent normalization
+ return (parent && parent.substr(0, parent.lastIndexOf('/') + 1) || baseURI) + name;
+ }
+
+ return new URL(name, parent && parent.replace(/#/g, '%05') || baseURIObj).href.replace(/%05/g, '#');
+}
+
+// NB no specification provided for System.paths, used ideas discussed in https://github.com/jorendorff/js-loaders/issues/25
+function applyPaths(loader, name) {
+ // most specific (most number of slashes in path) match wins
+ var pathMatch = '', wildcard, maxWildcardPrefixLen = 0;
+
+ var paths = loader.paths;
+ var pathsCache = loader._loader.paths;
+
+ // check to see if we have a paths entry
+ for (var p in paths) {
+ if (paths.hasOwnProperty && !paths.hasOwnProperty(p))
+ continue;
+
+ // paths sanitization
+ var path = paths[p];
+ if (path !== pathsCache[p])
+ path = paths[p] = pathsCache[p] = urlResolve(paths[p], isRel(paths[p]) ? baseURI : loader.baseURL);
+
+ // exact path match
+ if (p.indexOf('*') === -1) {
+ if (name == p)
+ return paths[p];
+
+ // support trailing / in paths rules
+ else if (name.substr(0, p.length - 1) == p.substr(0, p.length - 1) && (name.length < p.length || name[p.length - 1] == p[p.length - 1]) && (paths[p][paths[p].length - 1] == '/' || paths[p] == '')) {
+ return paths[p].substr(0, paths[p].length - 1) + (name.length > p.length ? (paths[p] && '/' || '') + name.substr(p.length) : '');
+ }
+ }
+ // wildcard path match
+ else {
+ var pathParts = p.split('*');
+ if (pathParts.length > 2)
+ throw new TypeError('Only one wildcard in a path is permitted');
+
+ var wildcardPrefixLen = pathParts[0].length;
+ if (wildcardPrefixLen >= maxWildcardPrefixLen &&
+ name.substr(0, pathParts[0].length) == pathParts[0] &&
+ name.substr(name.length - pathParts[1].length) == pathParts[1]) {
+ maxWildcardPrefixLen = wildcardPrefixLen;
+ pathMatch = p;
+ wildcard = name.substr(pathParts[0].length, name.length - pathParts[1].length - pathParts[0].length);
+ }
+ }
+ }
+
+ var outPath = paths[pathMatch];
+ if (typeof wildcard == 'string')
+ outPath = outPath.replace('*', wildcard);
+
+ return outPath;
+}
+
+function dedupe(deps) {
+ var newDeps = [];
+ for (var i = 0, l = deps.length; i < l; i++)
+ if (indexOf.call(newDeps, deps[i]) == -1)
+ newDeps.push(deps[i])
+ return newDeps;
+}
+
+function group(deps) {
+ var names = [];
+ var indices = [];
+ for (var i = 0, l = deps.length; i < l; i++) {
+ var index = indexOf.call(names, deps[i]);
+ if (index === -1) {
+ names.push(deps[i]);
+ indices.push([i]);
+ }
+ else {
+ indices[index].push(i);
+ }
+ }
+ return { names: names, indices: indices };
+}
+
+var getOwnPropertyDescriptor = true;
+try {
+ Object.getOwnPropertyDescriptor({ a: 0 }, 'a');
+}
+catch(e) {
+ getOwnPropertyDescriptor = false;
+}
+
+// converts any module.exports object into an object ready for SystemJS.newModule
+function getESModule(exports) {
+ var esModule = {};
+ // don't trigger getters/setters in environments that support them
+ if ((typeof exports == 'object' || typeof exports == 'function') && exports !== __global) {
+ if (getOwnPropertyDescriptor) {
+ for (var p in exports) {
+ // The default property is copied to esModule later on
+ if (p === 'default')
+ continue;
+ defineOrCopyProperty(esModule, exports, p);
+ }
+ }
+ else {
+ extend(esModule, exports);
+ }
+ }
+ esModule['default'] = exports;
+ defineProperty(esModule, '__useDefault', {
+ value: true
+ });
+ return esModule;
+}
+
+function defineOrCopyProperty(targetObj, sourceObj, propName) {
+ try {
+ var d;
+ if (d = Object.getOwnPropertyDescriptor(sourceObj, propName))
+ defineProperty(targetObj, propName, d);
+ }
+ catch (ex) {
+ // Object.getOwnPropertyDescriptor threw an exception, fall back to normal set property
+ // we dont need hasOwnProperty here because getOwnPropertyDescriptor would have returned undefined above
+ targetObj[propName] = sourceObj[propName];
+ return false;
+ }
+}
+
+function extend(a, b, prepend) {
+ var hasOwnProperty = b && b.hasOwnProperty;
+ for (var p in b) {
+ if (hasOwnProperty && !b.hasOwnProperty(p))
+ continue;
+ if (!prepend || !(p in a))
+ a[p] = b[p];
+ }
+ return a;
+}
+
+// meta first-level extends where:
+// array + array appends
+// object + object extends
+// other properties replace
+function extendMeta(a, b, prepend) {
+ var hasOwnProperty = b && b.hasOwnProperty;
+ for (var p in b) {
+ if (hasOwnProperty && !b.hasOwnProperty(p))
+ continue;
+ var val = b[p];
+ if (!(p in a))
+ a[p] = val;
+ else if (val instanceof Array && a[p] instanceof Array)
+ a[p] = [].concat(prepend ? val : a[p]).concat(prepend ? a[p] : val);
+ else if (typeof val == 'object' && val !== null && typeof a[p] == 'object')
+ a[p] = extend(extend({}, a[p]), val, prepend);
+ else if (!prepend)
+ a[p] = val;
+ }
+}
+
+function extendPkgConfig(pkgCfgA, pkgCfgB, pkgName, loader, warnInvalidProperties) {
+ for (var prop in pkgCfgB) {
+ if (indexOf.call(['main', 'format', 'defaultExtension', 'basePath'], prop) != -1) {
+ pkgCfgA[prop] = pkgCfgB[prop];
+ }
+ else if (prop == 'map') {
+ extend(pkgCfgA.map = pkgCfgA.map || {}, pkgCfgB.map);
+ }
+ else if (prop == 'meta') {
+ extend(pkgCfgA.meta = pkgCfgA.meta || {}, pkgCfgB.meta);
+ }
+ else if (prop == 'depCache') {
+ for (var d in pkgCfgB.depCache) {
+ var dNormalized;
+
+ if (d.substr(0, 2) == './')
+ dNormalized = pkgName + '/' + d.substr(2);
+ else
+ dNormalized = coreResolve.call(loader, d);
+ loader.depCache[dNormalized] = (loader.depCache[dNormalized] || []).concat(pkgCfgB.depCache[d]);
+ }
+ }
+ else if (warnInvalidProperties && indexOf.call(['browserConfig', 'nodeConfig', 'devConfig', 'productionConfig'], prop) == -1 &&
+ (!pkgCfgB.hasOwnProperty || pkgCfgB.hasOwnProperty(prop))) {
+ warn.call(loader, '"' + prop + '" is not a valid package configuration option in package ' + pkgName);
+ }
+ }
+}
+
+// deeply-merge (to first level) config with any existing package config
+function setPkgConfig(loader, pkgName, cfg, prependConfig) {
+ var pkg;
+
+ // first package is config by reference for fast path, cloned after that
+ if (!loader.packages[pkgName]) {
+ pkg = loader.packages[pkgName] = cfg;
+ }
+ else {
+ var basePkg = loader.packages[pkgName];
+ pkg = loader.packages[pkgName] = {};
+
+ extendPkgConfig(pkg, prependConfig ? cfg : basePkg, pkgName, loader, prependConfig);
+ extendPkgConfig(pkg, prependConfig ? basePkg : cfg, pkgName, loader, !prependConfig);
+ }
+
+ // main object becomes main map
+ if (typeof pkg.main == 'object') {
+ pkg.map = pkg.map || {};
+ pkg.map['./@main'] = pkg.main;
+ pkg.main['default'] = pkg.main['default'] || './';
+ pkg.main = '@main';
+ }
+
+ return pkg;
+}
+
+function warn(msg) {
+ if (this.warnings && typeof console != 'undefined' && console.warn)
+ console.warn(msg);
+}
+ var fetchTextFromURL;
+ if (typeof XMLHttpRequest != 'undefined') {
+ fetchTextFromURL = function(url, authorization, fulfill, reject) {
+ var xhr = new XMLHttpRequest();
+ var sameDomain = true;
+ var doTimeout = false;
+ if (!('withCredentials' in xhr)) {
+ // check if same domain
+ var domainCheck = /^(\w+:)?\/\/([^\/]+)/.exec(url);
+ if (domainCheck) {
+ sameDomain = domainCheck[2] === window.location.host;
+ if (domainCheck[1])
+ sameDomain &= domainCheck[1] === window.location.protocol;
+ }
+ }
+ if (!sameDomain && typeof XDomainRequest != 'undefined') {
+ xhr = new XDomainRequest();
+ xhr.onload = load;
+ xhr.onerror = error;
+ xhr.ontimeout = error;
+ xhr.onprogress = function() {};
+ xhr.timeout = 0;
+ doTimeout = true;
+ }
+ function load() {
+ fulfill(xhr.responseText);
+ }
+ function error() {
+ reject(new Error('XHR error' + (xhr.status ? ' (' + xhr.status + (xhr.statusText ? ' ' + xhr.statusText : '') + ')' : '') + ' loading ' + url));
+ }
+
+ xhr.onreadystatechange = function () {
+ if (xhr.readyState === 4) {
+ // in Chrome on file:/// URLs, status is 0
+ if (xhr.status == 0) {
+ if (xhr.responseText) {
+ load();
+ }
+ else {
+ // when responseText is empty, wait for load or error event
+ // to inform if it is a 404 or empty file
+ xhr.addEventListener('error', error);
+ xhr.addEventListener('load', load);
+ }
+ }
+ else if (xhr.status === 200) {
+ load();
+ }
+ else {
+ error();
+ }
+ }
+ };
+ xhr.open("GET", url, true);
+
+ if (xhr.setRequestHeader) {
+ xhr.setRequestHeader('Accept', 'application/x-es-module, */*');
+ // can set "authorization: true" to enable withCredentials only
+ if (authorization) {
+ if (typeof authorization == 'string')
+ xhr.setRequestHeader('Authorization', authorization);
+ xhr.withCredentials = true;
+ }
+ }
+
+ if (doTimeout) {
+ setTimeout(function() {
+ xhr.send();
+ }, 0);
+ } else {
+ xhr.send(null);
+ }
+ };
+ }
+ else if (typeof require != 'undefined' && typeof process != 'undefined') {
+ var fs;
+ fetchTextFromURL = function(url, authorization, fulfill, reject) {
+ if (url.substr(0, 8) != 'file:///')
+ throw new Error('Unable to fetch "' + url + '". Only file URLs of the form file:/// allowed running in Node.');
+ fs = fs || require('fs');
+ if (isWindows)
+ url = url.replace(/\//g, '\\').substr(8);
+ else
+ url = url.substr(7);
+ return fs.readFile(url, function(err, data) {
+ if (err) {
+ return reject(err);
+ }
+ else {
+ // Strip Byte Order Mark out if it's the leading char
+ var dataString = data + '';
+ if (dataString[0] === '\ufeff')
+ dataString = dataString.substr(1);
+
+ fulfill(dataString);
+ }
+ });
+ };
+ }
+ else if (typeof self != 'undefined' && typeof self.fetch != 'undefined') {
+ fetchTextFromURL = function(url, authorization, fulfill, reject) {
+ var opts = {
+ headers: {'Accept': 'application/x-es-module, */*'}
+ };
+
+ if (authorization) {
+ if (typeof authorization == 'string')
+ opts.headers['Authorization'] = authorization;
+ opts.credentials = 'include';
+ }
+
+ fetch(url, opts)
+ .then(function (r) {
+ if (r.ok) {
+ return r.text();
+ } else {
+ throw new Error('Fetch error: ' + r.status + ' ' + r.statusText);
+ }
+ })
+ .then(fulfill, reject);
+ }
+ }
+ else {
+ throw new TypeError('No environment fetch API available.');
+ }
+function readMemberExpression(p, value) {
+ var pParts = p.split('.');
+ while (pParts.length)
+ value = value[pParts.shift()];
+ return value;
+}
+
+function getMapMatch(map, name) {
+ var bestMatch, bestMatchLength = 0;
+
+ for (var p in map) {
+ if (name.substr(0, p.length) == p && (name.length == p.length || name[p.length] == '/')) {
+ var curMatchLength = p.split('/').length;
+ if (curMatchLength <= bestMatchLength)
+ continue;
+ bestMatch = p;
+ bestMatchLength = curMatchLength;
+ }
+ }
+
+ return bestMatch;
+}
+
+function prepareBaseURL(loader) {
+ // ensure baseURl is fully normalized
+ if (this._loader.baseURL !== this.baseURL) {
+ if (this.baseURL[this.baseURL.length - 1] != '/')
+ this.baseURL += '/';
+
+ this._loader.baseURL = this.baseURL = new URL(this.baseURL, baseURIObj).href;
+ }
+}
+
+var envModule;
+function setProduction(isProduction, isBuilder) {
+ this.set('@system-env', envModule = this.newModule({
+ browser: isBrowser,
+ node: !!this._nodeRequire,
+ production: !isBuilder && isProduction,
+ dev: isBuilder || !isProduction,
+ build: isBuilder,
+ 'default': true
+ }));
+}
+
+hookConstructor(function(constructor) {
+ return function() {
+ constructor.call(this);
+
+ // support baseURL
+ this.baseURL = baseURI;
+
+ // support map and paths
+ this.map = {};
+
+ // make the location of the system.js script accessible
+ if (typeof $__curScript != 'undefined')
+ this.scriptSrc = $__curScript.src;
+
+ // global behaviour flags
+ this.warnings = false;
+ this.defaultJSExtensions = false;
+ this.pluginFirst = false;
+ this.loaderErrorStack = false;
+
+ // by default load ".json" files as json
+ // leading * meta doesn't need normalization
+ // NB add this in next breaking release
+ // this.meta['*.json'] = { format: 'json' };
+
+ // support the empty module, as a concept
+ this.set('@empty', this.newModule({}));
+
+ setProduction.call(this, false, false);
+ };
+});
+
+// include the node require since we're overriding it
+if (typeof require != 'undefined' && typeof process != 'undefined' && !process.browser)
+ SystemJSLoader.prototype._nodeRequire = require;
+
+/*
+ Core SystemJS Normalization
+
+ If a name is relative, we apply URL normalization to the page
+ If a name is an absolute URL, we leave it as-is
+
+ Plain names (neither of the above) run through the map and paths
+ normalization phases.
+
+ The paths normalization phase applies last (paths extension), which
+ defines the `decanonicalize` function and normalizes everything into
+ a URL.
+ */
+
+var parentModuleContext;
+function getNodeModule(name, baseURL) {
+ if (!isPlain(name))
+ throw new Error('Node module ' + name + ' can\'t be loaded as it is not a package require.');
+
+ if (!parentModuleContext) {
+ var Module = this._nodeRequire('module');
+ var base = baseURL.substr(isWindows ? 8 : 7);
+ parentModuleContext = new Module(base);
+ parentModuleContext.paths = Module._nodeModulePaths(base);
+ }
+ return parentModuleContext.require(name);
+}
+
+function coreResolve(name, parentName) {
+ // standard URL resolution
+ if (isRel(name))
+ return urlResolve(name, parentName);
+ else if (isAbsolute(name))
+ return name;
+
+ // plain names not starting with './', '://' and '/' go through custom resolution
+ var mapMatch = getMapMatch(this.map, name);
+
+ if (mapMatch) {
+ name = this.map[mapMatch] + name.substr(mapMatch.length);
+
+ if (isRel(name))
+ return urlResolve(name);
+ else if (isAbsolute(name))
+ return name;
+ }
+
+ if (this.has(name))
+ return name;
+
+ // dynamically load node-core modules when requiring `@node/fs` for example
+ if (name.substr(0, 6) == '@node/') {
+ if (!this._nodeRequire)
+ throw new TypeError('Error loading ' + name + '. Can only load node core modules in Node.');
+ if (this.builder)
+ this.set(name, this.newModule({}));
+ else
+ this.set(name, this.newModule(getESModule(getNodeModule.call(this, name.substr(6), this.baseURL))));
+ return name;
+ }
+
+ // prepare the baseURL to ensure it is normalized
+ prepareBaseURL.call(this);
+
+ return applyPaths(this, name) || this.baseURL + name;
+}
+
+hook('normalize', function(normalize) {
+ return function(name, parentName, skipExt) {
+ var resolved = coreResolve.call(this, name, parentName);
+ if (this.defaultJSExtensions && !skipExt && resolved.substr(resolved.length - 3, 3) != '.js' && !isPlain(resolved))
+ resolved += '.js';
+ return resolved;
+ };
+});
+
+// percent encode just '#' in urls if using HTTP requests
+var httpRequest = typeof XMLHttpRequest != 'undefined';
+hook('locate', function(locate) {
+ return function(load) {
+ return Promise.resolve(locate.call(this, load))
+ .then(function(address) {
+ if (httpRequest)
+ return address.replace(/#/g, '%23');
+ return address;
+ });
+ };
+});
+
+/*
+ * Fetch with authorization
+ */
+hook('fetch', function() {
+ return function(load) {
+ return new Promise(function(resolve, reject) {
+ fetchTextFromURL(load.address, load.metadata.authorization, resolve, reject);
+ });
+ };
+});
+
+/*
+ __useDefault
+
+ When a module object looks like:
+ newModule(
+ __useDefault: true,
+ default: 'some-module'
+ })
+
+ Then importing that module provides the 'some-module'
+ result directly instead of the full module.
+
+ Useful for eg module.exports = function() {}
+*/
+hook('import', function(systemImport) {
+ return function(name, parentName, parentAddress) {
+ if (parentName && parentName.name)
+ warn.call(this, 'SystemJS.import(name, { name: parentName }) is deprecated for SystemJS.import(name, parentName), while importing ' + name + ' from ' + parentName.name);
+ return systemImport.call(this, name, parentName, parentAddress).then(function(module) {
+ return module.__useDefault ? module['default'] : module;
+ });
+ };
+});
+
+/*
+ * Allow format: 'detect' meta to enable format detection
+ */
+hook('translate', function(systemTranslate) {
+ return function(load) {
+ if (load.metadata.format == 'detect')
+ load.metadata.format = undefined;
+ return systemTranslate.apply(this, arguments);
+ };
+});
+
+
+/*
+ * JSON format support
+ *
+ * Supports loading JSON files as a module format itself
+ *
+ * Usage:
+ *
+ * SystemJS.config({
+ * meta: {
+ * '*.json': { format: 'json' }
+ * }
+ * });
+ *
+ * Module is returned as if written:
+ *
+ * export default {JSON}
+ *
+ * No named exports are provided
+ *
+ * Files ending in ".json" are treated as json automatically by SystemJS
+ */
+hook('instantiate', function(instantiate) {
+ return function(load) {
+ if (load.metadata.format == 'json' && !this.builder) {
+ var entry = load.metadata.entry = createEntry();
+ entry.deps = [];
+ entry.execute = function() {
+ try {
+ return JSON.parse(load.source);
+ }
+ catch(e) {
+ throw new Error("Invalid JSON file " + load.name);
+ }
+ };
+ }
+ };
+})
+
+/*
+ Extend config merging one deep only
+
+ loader.config({
+ some: 'random',
+ config: 'here',
+ deep: {
+ config: { too: 'too' }
+ }
+ });
+
+ <=>
+
+ loader.some = 'random';
+ loader.config = 'here'
+ loader.deep = loader.deep || {};
+ loader.deep.config = { too: 'too' };
+
+
+ Normalizes meta and package configs allowing for:
+
+ SystemJS.config({
+ meta: {
+ './index.js': {}
+ }
+ });
+
+ To become
+
+ SystemJS.meta['https://thissite.com/index.js'] = {};
+
+ For easy normalization canonicalization with latest URL support.
+
+*/
+function envSet(loader, cfg, envCallback) {
+ if (envModule.browser && cfg.browserConfig)
+ envCallback(cfg.browserConfig);
+ if (envModule.node && cfg.nodeConfig)
+ envCallback(cfg.nodeConfig);
+ if (envModule.dev && cfg.devConfig)
+ envCallback(cfg.devConfig);
+ if (envModule.build && cfg.buildConfig)
+ envCallback(cfg.buildConfig);
+ if (envModule.production && cfg.productionConfig)
+ envCallback(cfg.productionConfig);
+}
+
+SystemJSLoader.prototype.getConfig = function(name) {
+ var cfg = {};
+ var loader = this;
+ for (var p in loader) {
+ if (loader.hasOwnProperty && !loader.hasOwnProperty(p) || p in SystemJSLoader.prototype && p != 'transpiler')
+ continue;
+ if (indexOf.call(['_loader', 'amdDefine', 'amdRequire', 'defined', 'failed', 'version', 'loads'], p) == -1)
+ cfg[p] = loader[p];
+ }
+ cfg.production = envModule.production;
+ return cfg;
+};
+
+var curCurScript;
+SystemJSLoader.prototype.config = function(cfg, isEnvConfig) {
+ var loader = this;
+
+ if ('loaderErrorStack' in cfg) {
+ curCurScript = $__curScript;
+ if (cfg.loaderErrorStack)
+ $__curScript = undefined;
+ else
+ $__curScript = curCurScript;
+ }
+
+ if ('warnings' in cfg)
+ loader.warnings = cfg.warnings;
+
+ // transpiler deprecation path
+ if (cfg.transpilerRuntime === false)
+ loader._loader.loadedTranspilerRuntime = true;
+
+ if ('production' in cfg || 'build' in cfg)
+ setProduction.call(loader, !!cfg.production, !!(cfg.build || envModule && envModule.build));
+
+ if (!isEnvConfig) {
+ // if using nodeConfig / browserConfig / productionConfig, take baseURL from there
+ // these exceptions will be unnecessary when we can properly implement config queuings
+ var baseURL;
+ envSet(loader, cfg, function(cfg) {
+ baseURL = baseURL || cfg.baseURL;
+ });
+ baseURL = baseURL || cfg.baseURL;
+
+ // always configure baseURL first
+ if (baseURL) {
+ var hasConfig = false;
+ function checkHasConfig(obj) {
+ for (var p in obj)
+ if (obj.hasOwnProperty(p))
+ return true;
+ }
+ if (checkHasConfig(loader.packages) || checkHasConfig(loader.meta) || checkHasConfig(loader.depCache) || checkHasConfig(loader.bundles) || checkHasConfig(loader.packageConfigPaths))
+ throw new TypeError('Incorrect configuration order. The baseURL must be configured with the first SystemJS.config call.');
+
+ this.baseURL = baseURL;
+ prepareBaseURL.call(this);
+ }
+
+ if (cfg.paths)
+ extend(loader.paths, cfg.paths);
+
+ envSet(loader, cfg, function(cfg) {
+ if (cfg.paths)
+ extend(loader.paths, cfg.paths);
+ });
+
+ // warn on wildcard path deprecations
+ if (this.warnings) {
+ for (var p in loader.paths)
+ if (p.indexOf('*') != -1)
+ warn.call(loader, 'Paths configuration "' + p + '" -> "' + loader.paths[p] + '" uses wildcards which are being deprecated for simpler trailing "/" folder paths.');
+ }
+ }
+
+ if (cfg.defaultJSExtensions) {
+ loader.defaultJSExtensions = cfg.defaultJSExtensions;
+ warn.call(loader, 'The defaultJSExtensions configuration option is deprecated, use packages configuration instead.');
+ }
+
+ if (cfg.pluginFirst)
+ loader.pluginFirst = cfg.pluginFirst;
+
+ if (cfg.map) {
+ var objMaps = '';
+ for (var p in cfg.map) {
+ var v = cfg.map[p];
+
+ // object map backwards-compat into packages configuration
+ if (typeof v !== 'string') {
+ objMaps += (objMaps.length ? ', ' : '') + '"' + p + '"';
+
+ var defaultJSExtension = loader.defaultJSExtensions && p.substr(p.length - 3, 3) != '.js';
+ var prop = loader.decanonicalize(p);
+ if (defaultJSExtension && prop.substr(prop.length - 3, 3) == '.js')
+ prop = prop.substr(0, prop.length - 3);
+
+ // if a package main, revert it
+ var pkgMatch = '';
+ for (var pkg in loader.packages) {
+ if (prop.substr(0, pkg.length) == pkg
+ && (!prop[pkg.length] || prop[pkg.length] == '/')
+ && pkgMatch.split('/').length < pkg.split('/').length)
+ pkgMatch = pkg;
+ }
+ if (pkgMatch && loader.packages[pkgMatch].main)
+ prop = prop.substr(0, prop.length - loader.packages[pkgMatch].main.length - 1);
+
+ var pkg = loader.packages[prop] = loader.packages[prop] || {};
+ pkg.map = v;
+ }
+ else {
+ loader.map[p] = v;
+ }
+ }
+ if (objMaps)
+ warn.call(loader, 'The map configuration for ' + objMaps + ' uses object submaps, which is deprecated in global map.\nUpdate this to use package contextual map with configs like SystemJS.config({ packages: { "' + p + '": { map: {...} } } }).');
+ }
+
+ if (cfg.packageConfigPaths) {
+ var packageConfigPaths = [];
+ for (var i = 0; i < cfg.packageConfigPaths.length; i++) {
+ var path = cfg.packageConfigPaths[i];
+ var packageLength = Math.max(path.lastIndexOf('*') + 1, path.lastIndexOf('/'));
+ var normalized = coreResolve.call(loader, path.substr(0, packageLength));
+ packageConfigPaths[i] = normalized + path.substr(packageLength);
+ }
+ loader.packageConfigPaths = packageConfigPaths;
+ }
+
+ if (cfg.bundles) {
+ for (var p in cfg.bundles) {
+ var bundle = [];
+ for (var i = 0; i < cfg.bundles[p].length; i++) {
+ var defaultJSExtension = loader.defaultJSExtensions && cfg.bundles[p][i].substr(cfg.bundles[p][i].length - 3, 3) != '.js';
+ var normalizedBundleDep = loader.decanonicalize(cfg.bundles[p][i]);
+ if (defaultJSExtension && normalizedBundleDep.substr(normalizedBundleDep.length - 3, 3) == '.js')
+ normalizedBundleDep = normalizedBundleDep.substr(0, normalizedBundleDep.length - 3);
+ bundle.push(normalizedBundleDep);
+ }
+ loader.bundles[p] = bundle;
+ }
+ }
+
+ if (cfg.packages) {
+ for (var p in cfg.packages) {
+ if (p.match(/^([^\/]+:)?\/\/$/))
+ throw new TypeError('"' + p + '" is not a valid package name.');
+
+ var prop = coreResolve.call(loader, p);
+
+ // allow trailing slash in packages
+ if (prop[prop.length - 1] == '/')
+ prop = prop.substr(0, prop.length - 1);
+
+ setPkgConfig(loader, prop, cfg.packages[p], false);
+ }
+ }
+
+ for (var c in cfg) {
+ var v = cfg[c];
+
+ if (indexOf.call(['baseURL', 'map', 'packages', 'bundles', 'paths', 'warnings', 'packageConfigPaths',
+ 'loaderErrorStack', 'browserConfig', 'nodeConfig', 'devConfig', 'buildConfig', 'productionConfig'], c) != -1)
+ continue;
+
+ if (typeof v != 'object' || v instanceof Array) {
+ loader[c] = v;
+ }
+ else {
+ loader[c] = loader[c] || {};
+
+ for (var p in v) {
+ // base-level wildcard meta does not normalize to retain catch-all quality
+ if (c == 'meta' && p[0] == '*') {
+ extend(loader[c][p] = loader[c][p] || {}, v[p]);
+ }
+ else if (c == 'meta') {
+ // meta can go through global map, with defaultJSExtensions adding
+ var resolved = coreResolve.call(loader, p);
+ if (loader.defaultJSExtensions && resolved.substr(resolved.length - 3, 3) != '.js' && !isPlain(resolved))
+ resolved += '.js';
+ extend(loader[c][resolved] = loader[c][resolved] || {}, v[p]);
+ }
+ else if (c == 'depCache') {
+ var defaultJSExtension = loader.defaultJSExtensions && p.substr(p.length - 3, 3) != '.js';
+ var prop = loader.decanonicalize(p);
+ if (defaultJSExtension && prop.substr(prop.length - 3, 3) == '.js')
+ prop = prop.substr(0, prop.length - 3);
+ loader[c][prop] = [].concat(v[p]);
+ }
+ else {
+ loader[c][p] = v[p];
+ }
+ }
+ }
+ }
+
+ envSet(loader, cfg, function(cfg) {
+ loader.config(cfg, true);
+ });
+};/*
+ * Package Configuration Extension
+ *
+ * Example:
+ *
+ * SystemJS.packages = {
+ * jquery: {
+ * main: 'index.js', // when not set, package name is requested directly
+ * format: 'amd',
+ * defaultExtension: 'ts', // defaults to 'js', can be set to false
+ * modules: {
+ * '*.ts': {
+ * loader: 'typescript'
+ * },
+ * 'vendor/sizzle.js': {
+ * format: 'global'
+ * }
+ * },
+ * map: {
+ * // map internal require('sizzle') to local require('./vendor/sizzle')
+ * sizzle: './vendor/sizzle.js',
+ * // map any internal or external require of 'jquery/vendor/another' to 'another/index.js'
+ * './vendor/another.js': './another/index.js',
+ * // test.js / test -> lib/test.js
+ * './test.js': './lib/test.js',
+ *
+ * // environment-specific map configurations
+ * './index.js': {
+ * '~browser': './index-node.js',
+ * './custom-condition.js|~export': './index-custom.js'
+ * }
+ * },
+ * // allows for setting package-prefixed depCache
+ * // keys are normalized module names relative to the package itself
+ * depCache: {
+ * // import 'package/index.js' loads in parallel package/lib/test.js,package/vendor/sizzle.js
+ * './index.js': ['./test'],
+ * './test.js': ['external-dep'],
+ * 'external-dep/path.js': ['./another.js']
+ * }
+ * }
+ * };
+ *
+ * Then:
+ * import 'jquery' -> jquery/index.js
+ * import 'jquery/submodule' -> jquery/submodule.js
+ * import 'jquery/submodule.ts' -> jquery/submodule.ts loaded as typescript
+ * import 'jquery/vendor/another' -> another/index.js
+ *
+ * Detailed Behaviours
+ * - main can have a leading "./" can be added optionally
+ * - map and defaultExtension are applied to the main
+ * - defaultExtension adds the extension only if the exact extension is not present
+ * - defaultJSExtensions applies after map when defaultExtension is not set
+ * - if a meta value is available for a module, map and defaultExtension are skipped
+ * - like global map, package map also applies to subpaths (sizzle/x, ./vendor/another/sub)
+ * - condition module map is '@env' module in package or '@system-env' globally
+ * - map targets support conditional interpolation ('./x': './x.#{|env}.js')
+ * - internal package map targets cannot use boolean conditionals
+ *
+ * Package Configuration Loading
+ *
+ * Not all packages may already have their configuration present in the System config
+ * For these cases, a list of packageConfigPaths can be provided, which when matched against
+ * a request, will first request a ".json" file by the package name to derive the package
+ * configuration from. This allows dynamic loading of non-predetermined code, a key use
+ * case in SystemJS.
+ *
+ * Example:
+ *
+ * SystemJS.packageConfigPaths = ['packages/test/package.json', 'packages/*.json'];
+ *
+ * // will first request 'packages/new-package/package.json' for the package config
+ * // before completing the package request to 'packages/new-package/path'
+ * SystemJS.import('packages/new-package/path');
+ *
+ * // will first request 'packages/test/package.json' before the main
+ * SystemJS.import('packages/test');
+ *
+ * When a package matches packageConfigPaths, it will always send a config request for
+ * the package configuration.
+ * The package name itself is taken to be the match up to and including the last wildcard
+ * or trailing slash.
+ * The most specific package config path will be used.
+ * Any existing package configurations for the package will deeply merge with the
+ * package config, with the existing package configurations taking preference.
+ * To opt-out of the package configuration request for a package that matches
+ * packageConfigPaths, use the { configured: true } package config option.
+ *
+ */
+(function() {
+
+ hookConstructor(function(constructor) {
+ return function() {
+ constructor.call(this);
+ this.packages = {};
+ this.packageConfigPaths = [];
+ };
+ });
+
+ function getPackage(loader, normalized) {
+ // use most specific package
+ var curPkg, curPkgLen = 0, pkgLen;
+ for (var p in loader.packages) {
+ if (normalized.substr(0, p.length) === p && (normalized.length === p.length || normalized[p.length] === '/')) {
+ pkgLen = p.split('/').length;
+ if (pkgLen > curPkgLen) {
+ curPkg = p;
+ curPkgLen = pkgLen;
+ }
+ }
+ }
+ return curPkg;
+ }
+
+ function addDefaultExtension(loader, pkg, pkgName, subPath, skipExtensions) {
+ // don't apply extensions to folders or if defaultExtension = false
+ if (!subPath || subPath[subPath.length - 1] == '/' || skipExtensions || pkg.defaultExtension === false)
+ return subPath;
+
+ var metaMatch = false;
+
+ // exact meta or meta with any content after the last wildcard skips extension
+ if (pkg.meta)
+ getMetaMatches(pkg.meta, subPath, function(metaPattern, matchMeta, matchDepth) {
+ if (matchDepth == 0 || metaPattern.lastIndexOf('*') != metaPattern.length - 1)
+ return metaMatch = true;
+ });
+
+ // exact global meta or meta with any content after the last wildcard skips extension
+ if (!metaMatch && loader.meta)
+ getMetaMatches(loader.meta, pkgName + '/' + subPath, function(metaPattern, matchMeta, matchDepth) {
+ if (matchDepth == 0 || metaPattern.lastIndexOf('*') != metaPattern.length - 1)
+ return metaMatch = true;
+ });
+
+ if (metaMatch)
+ return subPath;
+
+ // work out what the defaultExtension is and add if not there already
+ // NB reconsider if default should really be ".js"?
+ var defaultExtension = '.' + (pkg.defaultExtension || 'js');
+ if (subPath.substr(subPath.length - defaultExtension.length) != defaultExtension)
+ return subPath + defaultExtension;
+ else
+ return subPath;
+ }
+
+ function applyPackageConfigSync(loader, pkg, pkgName, subPath, skipExtensions) {
+ // main
+ if (!subPath) {
+ if (pkg.main)
+ subPath = pkg.main.substr(0, 2) == './' ? pkg.main.substr(2) : pkg.main;
+ // also no submap if name is package itself (import 'pkg' -> 'path/to/pkg.js')
+ else
+ // NB can add a default package main convention here when defaultJSExtensions is deprecated
+ // if it becomes internal to the package then it would no longer be an exit path
+ return pkgName + (loader.defaultJSExtensions ? '.js' : '');
+ }
+
+ // map config checking without then with extensions
+ if (pkg.map) {
+ var mapPath = './' + subPath;
+
+ var mapMatch = getMapMatch(pkg.map, mapPath);
+
+ // we then check map with the default extension adding
+ if (!mapMatch) {
+ mapPath = './' + addDefaultExtension(loader, pkg, pkgName, subPath, skipExtensions);
+ if (mapPath != './' + subPath)
+ mapMatch = getMapMatch(pkg.map, mapPath);
+ }
+ if (mapMatch) {
+ var mapped = doMapSync(loader, pkg, pkgName, mapMatch, mapPath, skipExtensions);
+ if (mapped)
+ return mapped;
+ }
+ }
+
+ // normal package resolution
+ return pkgName + '/' + addDefaultExtension(loader, pkg, pkgName, subPath, skipExtensions);
+ }
+
+ function validMapping(mapMatch, mapped, pkgName, path) {
+ // disallow internal to subpath maps
+ if (mapMatch == '.')
+ throw new Error('Package ' + pkgName + ' has a map entry for "." which is not permitted.');
+
+ // allow internal ./x -> ./x/y or ./x/ -> ./x/y recursive maps
+ // but only if the path is exactly ./x and not ./x/z
+ if (mapped.substr(0, mapMatch.length) == mapMatch && path.length > mapMatch.length)
+ return false;
+
+ return true;
+ }
+
+ function doMapSync(loader, pkg, pkgName, mapMatch, path, skipExtensions) {
+ if (path[path.length - 1] == '/')
+ path = path.substr(0, path.length - 1);
+ var mapped = pkg.map[mapMatch];
+
+ if (typeof mapped == 'object')
+ throw new Error('Synchronous conditional normalization not supported sync normalizing ' + mapMatch + ' in ' + pkgName);
+
+ if (!validMapping(mapMatch, mapped, pkgName, path) || typeof mapped != 'string')
+ return;
+
+ // package map to main / base-level
+ if (mapped == '.')
+ mapped = pkgName;
+
+ // internal package map
+ else if (mapped.substr(0, 2) == './')
+ return pkgName + '/' + addDefaultExtension(loader, pkg, pkgName, mapped.substr(2) + path.substr(mapMatch.length), skipExtensions);
+
+ // external map reference
+ return loader.normalizeSync(mapped + path.substr(mapMatch.length), pkgName + '/');
+ }
+
+ function applyPackageConfig(loader, pkg, pkgName, subPath, skipExtensions) {
+ // main
+ if (!subPath) {
+ if (pkg.main)
+ subPath = pkg.main.substr(0, 2) == './' ? pkg.main.substr(2) : pkg.main;
+ // also no submap if name is package itself (import 'pkg' -> 'path/to/pkg.js')
+ else
+ // NB can add a default package main convention here when defaultJSExtensions is deprecated
+ // if it becomes internal to the package then it would no longer be an exit path
+ return Promise.resolve(pkgName + (loader.defaultJSExtensions ? '.js' : ''));
+ }
+
+ // map config checking without then with extensions
+ var mapPath, mapMatch;
+
+ if (pkg.map) {
+ mapPath = './' + subPath;
+ mapMatch = getMapMatch(pkg.map, mapPath);
+
+ // we then check map with the default extension adding
+ if (!mapMatch) {
+ mapPath = './' + addDefaultExtension(loader, pkg, pkgName, subPath, skipExtensions);
+ if (mapPath != './' + subPath)
+ mapMatch = getMapMatch(pkg.map, mapPath);
+ }
+ }
+
+ return (mapMatch ? doMap(loader, pkg, pkgName, mapMatch, mapPath, skipExtensions) : Promise.resolve())
+ .then(function(mapped) {
+ if (mapped)
+ return Promise.resolve(mapped);
+
+ // normal package resolution / fallback resolution for no conditional match
+ return Promise.resolve(pkgName + '/' + addDefaultExtension(loader, pkg, pkgName, subPath, skipExtensions));
+ });
+ }
+
+ function doStringMap(loader, pkg, pkgName, mapMatch, mapped, path, skipExtensions) {
+ // NB the interpolation cases should strictly skip subsequent interpolation
+ // package map to main / base-level
+ if (mapped == '.')
+ mapped = pkgName;
+
+ // internal package map
+ else if (mapped.substr(0, 2) == './')
+ return Promise.resolve(pkgName + '/' + addDefaultExtension(loader, pkg, pkgName, mapped.substr(2) + path.substr(mapMatch.length), skipExtensions))
+ .then(function(name) {
+ return interpolateConditional.call(loader, name, pkgName + '/');
+ });
+
+ // external map reference
+ return loader.normalize(mapped + path.substr(mapMatch.length), pkgName + '/');
+ }
+
+ function doMap(loader, pkg, pkgName, mapMatch, path, skipExtensions) {
+ if (path[path.length - 1] == '/')
+ path = path.substr(0, path.length - 1);
+
+ var mapped = pkg.map[mapMatch];
+
+ if (typeof mapped == 'string') {
+ if (!validMapping(mapMatch, mapped, pkgName, path))
+ return Promise.resolve();
+ return doStringMap(loader, pkg, pkgName, mapMatch, mapped, path, skipExtensions);
+ }
+
+ // we use a special conditional syntax to allow the builder to handle conditional branch points further
+ if (loader.builder)
+ return Promise.resolve(pkgName + '/#:' + path);
+
+ // we load all conditions upfront
+ var conditionPromises = [];
+ var conditions = [];
+ for (var e in mapped) {
+ var c = parseCondition(e);
+ conditions.push({
+ condition: c,
+ map: mapped[e]
+ });
+ conditionPromises.push(loader['import'](c.module, pkgName));
+ }
+
+ // map object -> conditional map
+ return Promise.all(conditionPromises)
+ .then(function(conditionValues) {
+ // first map condition to match is used
+ for (var i = 0; i < conditions.length; i++) {
+ var c = conditions[i].condition;
+ var value = readMemberExpression(c.prop, conditionValues[i]);
+ if (!c.negate && value || c.negate && !value)
+ return conditions[i].map;
+ }
+ })
+ .then(function(mapped) {
+ if (mapped) {
+ if (!validMapping(mapMatch, mapped, pkgName, path))
+ return;
+ return doStringMap(loader, pkg, pkgName, mapMatch, mapped, path, skipExtensions);
+ }
+
+ // no environment match -> fallback to original subPath by returning undefined
+ });
+ }
+
+ // normalizeSync = decanonicalize + package resolution
+ SystemJSLoader.prototype.normalizeSync = SystemJSLoader.prototype.decanonicalize = SystemJSLoader.prototype.normalize;
+
+ // decanonicalize must JUST handle package defaultExtension: false case when defaultJSExtensions is set
+ // to be deprecated!
+ hook('decanonicalize', function(decanonicalize) {
+ return function(name, parentName) {
+ if (this.builder)
+ return decanonicalize.call(this, name, parentName, true);
+
+ var decanonicalized = decanonicalize.call(this, name, parentName, false);
+
+ if (!this.defaultJSExtensions)
+ return decanonicalized;
+
+ var pkgName = getPackage(this, decanonicalized);
+
+ var pkg = this.packages[pkgName];
+ var defaultExtension = pkg && pkg.defaultExtension;
+
+ if (defaultExtension == undefined && pkg && pkg.meta)
+ getMetaMatches(pkg.meta, decanonicalized.substr(pkgName), function(metaPattern, matchMeta, matchDepth) {
+ if (matchDepth == 0 || metaPattern.lastIndexOf('*') != metaPattern.length - 1) {
+ defaultExtension = false;
+ return true;
+ }
+ });
+
+ if ((defaultExtension === false || defaultExtension && defaultExtension != '.js') && name.substr(name.length - 3, 3) != '.js' && decanonicalized.substr(decanonicalized.length - 3, 3) == '.js')
+ decanonicalized = decanonicalized.substr(0, decanonicalized.length - 3);
+
+ return decanonicalized;
+ };
+ });
+
+ hook('normalizeSync', function(normalizeSync) {
+ return function(name, parentName, isPlugin) {
+ var loader = this;
+ isPlugin = isPlugin === true;
+
+ // apply contextual package map first
+ // (we assume the parent package config has already been loaded)
+ if (parentName)
+ var parentPackageName = getPackage(loader, parentName) ||
+ loader.defaultJSExtensions && parentName.substr(parentName.length - 3, 3) == '.js' &&
+ getPackage(loader, parentName.substr(0, parentName.length - 3));
+
+ var parentPackage = parentPackageName && loader.packages[parentPackageName];
+
+ // ignore . since internal maps handled by standard package resolution
+ if (parentPackage && name[0] != '.') {
+ var parentMap = parentPackage.map;
+ var parentMapMatch = parentMap && getMapMatch(parentMap, name);
+
+ if (parentMapMatch && typeof parentMap[parentMapMatch] == 'string') {
+ var mapped = doMapSync(loader, parentPackage, parentPackageName, parentMapMatch, name, isPlugin);
+ if (mapped)
+ return mapped;
+ }
+ }
+
+ var defaultJSExtension = loader.defaultJSExtensions && name.substr(name.length - 3, 3) != '.js';
+
+ // apply map, core, paths, contextual package map
+ var normalized = normalizeSync.call(loader, name, parentName, false);
+
+ // undo defaultJSExtension
+ if (defaultJSExtension && normalized.substr(normalized.length - 3, 3) != '.js')
+ defaultJSExtension = false;
+ if (defaultJSExtension)
+ normalized = normalized.substr(0, normalized.length - 3);
+
+ var pkgConfigMatch = getPackageConfigMatch(loader, normalized);
+ var pkgName = pkgConfigMatch && pkgConfigMatch.packageName || getPackage(loader, normalized);
+
+ if (!pkgName)
+ return normalized + (defaultJSExtension ? '.js' : '');
+
+ var subPath = normalized.substr(pkgName.length + 1);
+
+ return applyPackageConfigSync(loader, loader.packages[pkgName] || {}, pkgName, subPath, isPlugin);
+ };
+ });
+
+ hook('normalize', function(normalize) {
+ return function(name, parentName, isPlugin) {
+ var loader = this;
+ isPlugin = isPlugin === true;
+
+ return Promise.resolve()
+ .then(function() {
+ // apply contextual package map first
+ // (we assume the parent package config has already been loaded)
+ if (parentName)
+ var parentPackageName = getPackage(loader, parentName) ||
+ loader.defaultJSExtensions && parentName.substr(parentName.length - 3, 3) == '.js' &&
+ getPackage(loader, parentName.substr(0, parentName.length - 3));
+
+ var parentPackage = parentPackageName && loader.packages[parentPackageName];
+
+ // ignore . since internal maps handled by standard package resolution
+ if (parentPackage && name.substr(0, 2) != './') {
+ var parentMap = parentPackage.map;
+ var parentMapMatch = parentMap && getMapMatch(parentMap, name);
+
+ if (parentMapMatch)
+ return doMap(loader, parentPackage, parentPackageName, parentMapMatch, name, isPlugin);
+ }
+
+ return Promise.resolve();
+ })
+ .then(function(mapped) {
+ if (mapped)
+ return mapped;
+
+ var defaultJSExtension = loader.defaultJSExtensions && name.substr(name.length - 3, 3) != '.js';
+
+ // apply map, core, paths, contextual package map
+ var normalized = normalize.call(loader, name, parentName, false);
+
+ // undo defaultJSExtension
+ if (defaultJSExtension && normalized.substr(normalized.length - 3, 3) != '.js')
+ defaultJSExtension = false;
+ if (defaultJSExtension)
+ normalized = normalized.substr(0, normalized.length - 3);
+
+ var pkgConfigMatch = getPackageConfigMatch(loader, normalized);
+ var pkgName = pkgConfigMatch && pkgConfigMatch.packageName || getPackage(loader, normalized);
+
+ if (!pkgName)
+ return Promise.resolve(normalized + (defaultJSExtension ? '.js' : ''));
+
+ var pkg = loader.packages[pkgName];
+
+ // if package is already configured or not a dynamic config package, use existing package config
+ var isConfigured = pkg && (pkg.configured || !pkgConfigMatch);
+ return (isConfigured ? Promise.resolve(pkg) : loadPackageConfigPath(loader, pkgName, pkgConfigMatch.configPath))
+ .then(function(pkg) {
+ var subPath = normalized.substr(pkgName.length + 1);
+
+ return applyPackageConfig(loader, pkg, pkgName, subPath, isPlugin);
+ });
+ });
+ };
+ });
+
+ // check if the given normalized name matches a packageConfigPath
+ // if so, loads the config
+ var packageConfigPaths = {};
+
+ // data object for quick checks against package paths
+ function createPkgConfigPathObj(path) {
+ var lastWildcard = path.lastIndexOf('*');
+ var length = Math.max(lastWildcard + 1, path.lastIndexOf('/'));
+ return {
+ length: length,
+ regEx: new RegExp('^(' + path.substr(0, length).replace(/[.+?^${}()|[\]\\]/g, '\\$&').replace(/\*/g, '[^\\/]+') + ')(\\/|$)'),
+ wildcard: lastWildcard != -1
+ };
+ }
+
+ // most specific match wins
+ function getPackageConfigMatch(loader, normalized) {
+ var pkgName, exactMatch = false, configPath;
+ for (var i = 0; i < loader.packageConfigPaths.length; i++) {
+ var packageConfigPath = loader.packageConfigPaths[i];
+ var p = packageConfigPaths[packageConfigPath] || (packageConfigPaths[packageConfigPath] = createPkgConfigPathObj(packageConfigPath));
+ if (normalized.length < p.length)
+ continue;
+ var match = normalized.match(p.regEx);
+ if (match && (!pkgName || (!(exactMatch && p.wildcard) && pkgName.length < match[1].length))) {
+ pkgName = match[1];
+ exactMatch = !p.wildcard;
+ configPath = pkgName + packageConfigPath.substr(p.length);
+ }
+ }
+
+ if (!pkgName)
+ return;
+
+ return {
+ packageName: pkgName,
+ configPath: configPath
+ };
+ }
+
+ function loadPackageConfigPath(loader, pkgName, pkgConfigPath) {
+ var configLoader = loader.pluginLoader || loader;
+
+ // NB remove this when json is default
+ (configLoader.meta[pkgConfigPath] = configLoader.meta[pkgConfigPath] || {}).format = 'json';
+ configLoader.meta[pkgConfigPath].loader = null;
+
+ return configLoader.load(pkgConfigPath)
+ .then(function() {
+ var cfg = configLoader.get(pkgConfigPath)['default'];
+
+ // support "systemjs" prefixing
+ if (cfg.systemjs)
+ cfg = cfg.systemjs;
+
+ // modules backwards compatibility
+ if (cfg.modules) {
+ cfg.meta = cfg.modules;
+ warn.call(loader, 'Package config file ' + pkgConfigPath + ' is configured with "modules", which is deprecated as it has been renamed to "meta".');
+ }
+
+ return setPkgConfig(loader, pkgName, cfg, true);
+ });
+ }
+
+ function getMetaMatches(pkgMeta, subPath, matchFn) {
+ // wildcard meta
+ var meta = {};
+ var wildcardIndex;
+ for (var module in pkgMeta) {
+ // allow meta to start with ./ for flexibility
+ var dotRel = module.substr(0, 2) == './' ? './' : '';
+ if (dotRel)
+ module = module.substr(2);
+
+ wildcardIndex = module.indexOf('*');
+ if (wildcardIndex === -1)
+ continue;
+
+ if (module.substr(0, wildcardIndex) == subPath.substr(0, wildcardIndex)
+ && module.substr(wildcardIndex + 1) == subPath.substr(subPath.length - module.length + wildcardIndex + 1)) {
+ // alow match function to return true for an exit path
+ if (matchFn(module, pkgMeta[dotRel + module], module.split('/').length))
+ return;
+ }
+ }
+ // exact meta
+ var exactMeta = pkgMeta[subPath] && pkgMeta.hasOwnProperty && pkgMeta.hasOwnProperty(subPath) ? pkgMeta[subPath] : pkgMeta['./' + subPath];
+ if (exactMeta)
+ matchFn(exactMeta, exactMeta, 0);
+ }
+
+ hook('locate', function(locate) {
+ return function(load) {
+ var loader = this;
+ return Promise.resolve(locate.call(this, load))
+ .then(function(address) {
+ var pkgName = getPackage(loader, load.name);
+ if (pkgName) {
+ var pkg = loader.packages[pkgName];
+ var subPath = load.name.substr(pkgName.length + 1);
+
+ var meta = {};
+ if (pkg.meta) {
+ var bestDepth = 0;
+
+ // NB support a main shorthand in meta here?
+ getMetaMatches(pkg.meta, subPath, function(metaPattern, matchMeta, matchDepth) {
+ if (matchDepth > bestDepth)
+ bestDepth = matchDepth;
+ extendMeta(meta, matchMeta, matchDepth && bestDepth > matchDepth);
+ });
+
+ extendMeta(load.metadata, meta);
+ }
+
+ // format
+ if (pkg.format && !load.metadata.loader)
+ load.metadata.format = load.metadata.format || pkg.format;
+ }
+
+ return address;
+ });
+ };
+ });
+
+})();
+/*
+ * Script tag fetch
+ *
+ * When load.metadata.scriptLoad is true, we load via script tag injection.
+ */
+(function() {
+
+ if (typeof document != 'undefined')
+ var head = document.getElementsByTagName('head')[0];
+
+ var curSystem;
+ var curRequire;
+
+ // if doing worker executing, this is set to the load record being executed
+ var workerLoad = null;
+
+ // interactive mode handling method courtesy RequireJS
+ var ieEvents = head && (function() {
+ var s = document.createElement('script');
+ var isOpera = typeof opera !== 'undefined' && opera.toString() === '[object Opera]';
+ return s.attachEvent && !(s.attachEvent.toString && s.attachEvent.toString().indexOf('[native code') < 0) && !isOpera;
+ })();
+
+ // IE interactive-only part
+ // we store loading scripts array as { script: <script>, load: {...} }
+ var interactiveLoadingScripts = [];
+ var interactiveScript;
+ function getInteractiveScriptLoad() {
+ if (interactiveScript && interactiveScript.script.readyState === 'interactive')
+ return interactiveScript.load;
+
+ for (var i = 0; i < interactiveLoadingScripts.length; i++)
+ if (interactiveLoadingScripts[i].script.readyState == 'interactive') {
+ interactiveScript = interactiveLoadingScripts[i];
+ return interactiveScript.load;
+ }
+ }
+
+ // System.register, System.registerDynamic, AMD define pipeline
+ // this is called by the above methods when they execute
+ // we then run the reduceRegister_ collection function either immediately
+ // if we are in IE and know the currently executing script (interactive)
+ // or later if we need to wait for the synchronous load callback to know the script
+ var loadingCnt = 0;
+ var registerQueue = [];
+ hook('pushRegister_', function(pushRegister) {
+ return function(register) {
+ // if using eval-execution then skip
+ if (pushRegister.call(this, register))
+ return false;
+
+ // if using worker execution, then we're done
+ if (workerLoad)
+ this.reduceRegister_(workerLoad, register);
+
+ // detect if we know the currently executing load (IE)
+ // if so, immediately call reduceRegister
+ else if (ieEvents)
+ this.reduceRegister_(getInteractiveScriptLoad(), register);
+
+ // otherwise, add to our execution queue
+ // to call reduceRegister on sync script load event
+ else if (loadingCnt)
+ registerQueue.push(register);
+
+ // if we're not currently loading anything though
+ // then do the reduction against a null load
+ // (out of band named define or named register)
+ // note even in non-script environments, this catch is used
+ else
+ this.reduceRegister_(null, register);
+
+ return true;
+ };
+ });
+
+ function webWorkerImport(loader, load) {
+ return new Promise(function(resolve, reject) {
+ if (load.metadata.integrity)
+ reject(new Error('Subresource integrity checking is not supported in web workers.'));
+
+ workerLoad = load;
+ try {
+ importScripts(load.address);
+ }
+ catch(e) {
+ workerLoad = null;
+ reject(e);
+ }
+ workerLoad = null;
+
+ // if nothing registered, then something went wrong
+ if (!load.metadata.entry)
+ reject(new Error(load.address + ' did not call System.register or AMD define. If loading a global, ensure the meta format is set to global.'));
+
+ resolve('');
+ });
+ }
+
+ // override fetch to use script injection
+ hook('fetch', function(fetch) {
+ return function(load) {
+ var loader = this;
+
+ if (load.metadata.format == 'json' || !load.metadata.scriptLoad || (!isBrowser && !isWorker))
+ return fetch.call(this, load);
+
+ if (isWorker)
+ return webWorkerImport(loader, load);
+
+ return new Promise(function(resolve, reject) {
+ var s = document.createElement('script');
+
+ s.async = true;
+
+ if (load.metadata.crossOrigin)
+ s.crossOrigin = load.metadata.crossOrigin;
+
+ if (load.metadata.integrity)
+ s.setAttribute('integrity', load.metadata.integrity);
+
+ if (ieEvents) {
+ s.attachEvent('onreadystatechange', complete);
+ interactiveLoadingScripts.push({
+ script: s,
+ load: load
+ });
+ }
+ else {
+ s.addEventListener('load', complete, false);
+ s.addEventListener('error', error, false);
+ }
+
+ loadingCnt++;
+
+ curSystem = __global.System;
+ curRequire = __global.require;
+
+ s.src = load.address;
+ head.appendChild(s);
+
+ function complete(evt) {
+ if (s.readyState && s.readyState != 'loaded' && s.readyState != 'complete')
+ return;
+
+ loadingCnt--;
+
+ // complete call is sync on execution finish
+ // (in ie already done reductions)
+ if (!load.metadata.entry && !registerQueue.length) {
+ loader.reduceRegister_(load);
+ }
+ else if (!ieEvents) {
+ for (var i = 0; i < registerQueue.length; i++)
+ loader.reduceRegister_(load, registerQueue[i]);
+ registerQueue = [];
+ }
+
+ cleanup();
+
+ // if nothing registered, then something went wrong
+ if (!load.metadata.entry && !load.metadata.bundle)
+ reject(new Error(load.name + ' did not call System.register or AMD define. If loading a global module configure the global name via the meta exports property for script injection support.'));
+
+ resolve('');
+ }
+
+ function error(evt) {
+ cleanup();
+ reject(new Error('Unable to load script ' + load.address));
+ }
+
+ function cleanup() {
+ __global.System = curSystem;
+ __global.require = curRequire;
+
+ if (s.detachEvent) {
+ s.detachEvent('onreadystatechange', complete);
+ for (var i = 0; i < interactiveLoadingScripts.length; i++)
+ if (interactiveLoadingScripts[i].script == s) {
+ if (interactiveScript && interactiveScript.script == s)
+ interactiveScript = null;
+ interactiveLoadingScripts.splice(i, 1);
+ }
+ }
+ else {
+ s.removeEventListener('load', complete, false);
+ s.removeEventListener('error', error, false);
+ }
+
+ head.removeChild(s);
+ }
+ });
+ };
+ });
+})();
+/*
+ * Instantiate registry extension
+ *
+ * Supports Traceur System.register 'instantiate' output for loading ES6 as ES5.
+ *
+ * - Creates the loader.register function
+ * - Also supports metadata.format = 'register' in instantiate for anonymous register modules
+ * - Also supports metadata.deps, metadata.execute and metadata.executingRequire
+ * for handling dynamic modules alongside register-transformed ES6 modules
+ *
+ *
+ * The code here replicates the ES6 linking groups algorithm to ensure that
+ * circular ES6 compiled into System.register can work alongside circular AMD
+ * and CommonJS, identically to the actual ES6 loader.
+ *
+ */
+
+
+/*
+ * Registry side table entries in loader.defined
+ * Registry Entry Contains:
+ * - name
+ * - deps
+ * - declare for declarative modules
+ * - execute for dynamic modules, different to declarative execute on module
+ * - executingRequire indicates require drives execution for circularity of dynamic modules
+ * - declarative optional boolean indicating which of the above
+ *
+ * Can preload modules directly on SystemJS.defined['my/module'] = { deps, execute, executingRequire }
+ *
+ * Then the entry gets populated with derived information during processing:
+ * - normalizedDeps derived from deps, created in instantiate
+ * - groupIndex used by group linking algorithm
+ * - evaluated indicating whether evaluation has happend
+ * - module the module record object, containing:
+ * - exports actual module exports
+ *
+ * For dynamic we track the es module with:
+ * - esModule actual es module value
+ * - esmExports whether to extend the esModule with named exports
+ *
+ * Then for declarative only we track dynamic bindings with the 'module' records:
+ * - name
+ * - exports
+ * - setters declarative setter functions
+ * - dependencies, module records of dependencies
+ * - importers, module records of dependents
+ *
+ * After linked and evaluated, entries are removed, declarative module records remain in separate
+ * module binding table
+ *
+ */
+
+var leadingCommentAndMetaRegEx = /^(\s*\/\*[^\*]*(\*(?!\/)[^\*]*)*\*\/|\s*\/\/[^\n]*|\s*"[^"]+"\s*;?|\s*'[^']+'\s*;?)*\s*/;
+function detectRegisterFormat(source) {
+ var leadingCommentAndMeta = source.match(leadingCommentAndMetaRegEx);
+ return leadingCommentAndMeta && source.substr(leadingCommentAndMeta[0].length, 15) == 'System.register';
+}
+
+function createEntry() {
+ return {
+ name: null,
+ deps: null,
+ originalIndices: null,
+ declare: null,
+ execute: null,
+ executingRequire: false,
+ declarative: false,
+ normalizedDeps: null,
+ groupIndex: null,
+ evaluated: false,
+ module: null,
+ esModule: null,
+ esmExports: false
+ };
+}
+
+(function() {
+
+ /*
+ * There are two variations of System.register:
+ * 1. System.register for ES6 conversion (2-3 params) - System.register([name, ]deps, declare)
+ * see https://github.com/ModuleLoader/es6-module-loader/wiki/System.register-Explained
+ *
+ * 2. System.registerDynamic for dynamic modules (3-4 params) - System.registerDynamic([name, ]deps, executingRequire, execute)
+ * the true or false statement
+ *
+ * this extension implements the linking algorithm for the two variations identical to the spec
+ * allowing compiled ES6 circular references to work alongside AMD and CJS circular references.
+ *
+ */
+ SystemJSLoader.prototype.register = function(name, deps, declare) {
+ if (typeof name != 'string') {
+ declare = deps;
+ deps = name;
+ name = null;
+ }
+
+ // dynamic backwards-compatibility
+ // can be deprecated eventually
+ if (typeof declare == 'boolean')
+ return this.registerDynamic.apply(this, arguments);
+
+ var entry = createEntry();
+ // ideally wouldn't apply map config to bundle names but
+ // dependencies go through map regardless so we can't restrict
+ // could reconsider in shift to new spec
+ entry.name = name && (this.decanonicalize || this.normalize).call(this, name);
+ entry.declarative = true;
+ entry.deps = deps;
+ entry.declare = declare;
+
+ this.pushRegister_({
+ amd: false,
+ entry: entry
+ });
+ };
+ SystemJSLoader.prototype.registerDynamic = function(name, deps, declare, execute) {
+ if (typeof name != 'string') {
+ execute = declare;
+ declare = deps;
+ deps = name;
+ name = null;
+ }
+
+ // dynamic
+ var entry = createEntry();
+ entry.name = name && (this.decanonicalize || this.normalize).call(this, name);
+ entry.deps = deps;
+ entry.execute = execute;
+ entry.executingRequire = declare;
+
+ this.pushRegister_({
+ amd: false,
+ entry: entry
+ });
+ };
+ hook('reduceRegister_', function() {
+ return function(load, register) {
+ if (!register)
+ return;
+
+ var entry = register.entry;
+ var curMeta = load && load.metadata;
+
+ // named register
+ if (entry.name) {
+ if (!(entry.name in this.defined))
+ this.defined[entry.name] = entry;
+
+ if (curMeta)
+ curMeta.bundle = true;
+ }
+ // anonymous register
+ if (!entry.name || load && !curMeta.entry && entry.name == load.name) {
+ if (!curMeta)
+ throw new TypeError('Invalid System.register call. Anonymous System.register calls can only be made by modules loaded by SystemJS.import and not via script tags.');
+ if (curMeta.entry) {
+ if (curMeta.format == 'register')
+ throw new Error('Multiple anonymous System.register calls in module ' + load.name + '. If loading a bundle, ensure all the System.register calls are named.');
+ else
+ throw new Error('Module ' + load.name + ' interpreted as ' + curMeta.format + ' module format, but called System.register.');
+ }
+ if (!curMeta.format)
+ curMeta.format = 'register';
+ curMeta.entry = entry;
+ }
+ };
+ });
+
+ hookConstructor(function(constructor) {
+ return function() {
+ constructor.call(this);
+
+ this.defined = {};
+ this._loader.moduleRecords = {};
+ };
+ });
+
+ function buildGroups(entry, loader, groups) {
+ groups[entry.groupIndex] = groups[entry.groupIndex] || [];
+
+ if (indexOf.call(groups[entry.groupIndex], entry) != -1)
+ return;
+
+ groups[entry.groupIndex].push(entry);
+
+ for (var i = 0, l = entry.normalizedDeps.length; i < l; i++) {
+ var depName = entry.normalizedDeps[i];
+ var depEntry = loader.defined[depName];
+
+ // not in the registry means already linked / ES6
+ if (!depEntry || depEntry.evaluated)
+ continue;
+
+ // now we know the entry is in our unlinked linkage group
+ var depGroupIndex = entry.groupIndex + (depEntry.declarative != entry.declarative);
+
+ // the group index of an entry is always the maximum
+ if (depEntry.groupIndex === null || depEntry.groupIndex < depGroupIndex) {
+
+ // if already in a group, remove from the old group
+ if (depEntry.groupIndex !== null) {
+ groups[depEntry.groupIndex].splice(indexOf.call(groups[depEntry.groupIndex], depEntry), 1);
+
+ // if the old group is empty, then we have a mixed depndency cycle
+ if (groups[depEntry.groupIndex].length == 0)
+ throw new Error("Mixed dependency cycle detected");
+ }
+
+ depEntry.groupIndex = depGroupIndex;
+ }
+
+ buildGroups(depEntry, loader, groups);
+ }
+ }
+
+ function link(name, startEntry, loader) {
+ // skip if already linked
+ if (startEntry.module)
+ return;
+
+ startEntry.groupIndex = 0;
+
+ var groups = [];
+
+ buildGroups(startEntry, loader, groups);
+
+ var curGroupDeclarative = !!startEntry.declarative == groups.length % 2;
+ for (var i = groups.length - 1; i >= 0; i--) {
+ var group = groups[i];
+ for (var j = 0; j < group.length; j++) {
+ var entry = group[j];
+
+ // link each group
+ if (curGroupDeclarative)
+ linkDeclarativeModule(entry, loader);
+ else
+ linkDynamicModule(entry, loader);
+ }
+ curGroupDeclarative = !curGroupDeclarative;
+ }
+ }
+
+ // module binding records
+ function ModuleRecord() {}
+ defineProperty(ModuleRecord, 'toString', {
+ value: function() {
+ return 'Module';
+ }
+ });
+
+ function getOrCreateModuleRecord(name, moduleRecords) {
+ return moduleRecords[name] || (moduleRecords[name] = {
+ name: name,
+ dependencies: [],
+ exports: new ModuleRecord(), // start from an empty module and extend
+ importers: []
+ });
+ }
+
+ function linkDeclarativeModule(entry, loader) {
+ // only link if already not already started linking (stops at circular)
+ if (entry.module)
+ return;
+
+ var moduleRecords = loader._loader.moduleRecords;
+ var module = entry.module = getOrCreateModuleRecord(entry.name, moduleRecords);
+ var exports = entry.module.exports;
+
+ var declaration = entry.declare.call(__global, function(name, value) {
+ module.locked = true;
+
+ if (typeof name == 'object') {
+ for (var p in name)
+ exports[p] = name[p];
+ }
+ else {
+ exports[name] = value;
+ }
+
+ for (var i = 0, l = module.importers.length; i < l; i++) {
+ var importerModule = module.importers[i];
+ if (!importerModule.locked) {
+ var importerIndex = indexOf.call(importerModule.dependencies, module);
+ var setter = importerModule.setters[importerIndex];
+ if (setter)
+ setter(exports);
+ }
+ }
+
+ module.locked = false;
+ return value;
+ }, { id: entry.name });
+
+ if (typeof declaration == 'function')
+ declaration = { setters: [], execute: declaration };
+
+ // allowing undefined declaration was a mistake! To be deprecated.
+ declaration = declaration || { setters: [], execute: function() {} };
+
+ module.setters = declaration.setters;
+ module.execute = declaration.execute;
+
+ if (!module.setters || !module.execute) {
+ throw new TypeError('Invalid System.register form for ' + entry.name);
+ }
+
+ // now link all the module dependencies
+ for (var i = 0, l = entry.normalizedDeps.length; i < l; i++) {
+ var depName = entry.normalizedDeps[i];
+ var depEntry = loader.defined[depName];
+ var depModule = moduleRecords[depName];
+
+ // work out how to set depExports based on scenarios...
+ var depExports;
+
+ if (depModule) {
+ depExports = depModule.exports;
+ }
+ // dynamic, already linked in our registry
+ else if (depEntry && !depEntry.declarative) {
+ depExports = depEntry.esModule;
+ }
+ // in the loader registry
+ else if (!depEntry) {
+ depExports = loader.get(depName);
+ }
+ // we have an entry -> link
+ else {
+ linkDeclarativeModule(depEntry, loader);
+ depModule = depEntry.module;
+ depExports = depModule.exports;
+ }
+
+ // only declarative modules have dynamic bindings
+ if (depModule && depModule.importers) {
+ depModule.importers.push(module);
+ module.dependencies.push(depModule);
+ }
+ else {
+ module.dependencies.push(null);
+ }
+
+ // run setters for all entries with the matching dependency name
+ var originalIndices = entry.originalIndices[i];
+ for (var j = 0, len = originalIndices.length; j < len; ++j) {
+ var index = originalIndices[j];
+ if (module.setters[index]) {
+ module.setters[index](depExports);
+ }
+ }
+ }
+ }
+
+ // An analog to loader.get covering execution of all three layers (real declarative, simulated declarative, simulated dynamic)
+ function getModule(name, loader) {
+ var exports;
+ var entry = loader.defined[name];
+
+ if (!entry) {
+ exports = loader.get(name);
+ if (!exports)
+ throw new Error('Unable to load dependency ' + name + '.');
+ }
+
+ else {
+ if (entry.declarative)
+ ensureEvaluated(name, entry, [], loader);
+
+ else if (!entry.evaluated)
+ linkDynamicModule(entry, loader);
+
+ exports = entry.module.exports;
+ }
+
+ if ((!entry || entry.declarative) && exports && exports.__useDefault)
+ return exports['default'];
+
+ return exports;
+ }
+
+ function linkDynamicModule(entry, loader) {
+ if (entry.module)
+ return;
+
+ var exports = {};
+
+ var module = entry.module = { exports: exports, id: entry.name };
+
+ // AMD requires execute the tree first
+ if (!entry.executingRequire) {
+ for (var i = 0, l = entry.normalizedDeps.length; i < l; i++) {
+ var depName = entry.normalizedDeps[i];
+ // we know we only need to link dynamic due to linking algorithm
+ var depEntry = loader.defined[depName];
+ if (depEntry)
+ linkDynamicModule(depEntry, loader);
+ }
+ }
+
+ // now execute
+ entry.evaluated = true;
+ var output = entry.execute.call(__global, function(name) {
+ for (var i = 0, l = entry.deps.length; i < l; i++) {
+ if (entry.deps[i] != name)
+ continue;
+ return getModule(entry.normalizedDeps[i], loader);
+ }
+ // try and normalize the dependency to see if we have another form
+ var nameNormalized = loader.normalizeSync(name, entry.name);
+ if (indexOf.call(entry.normalizedDeps, nameNormalized) != -1)
+ return getModule(nameNormalized, loader);
+
+ throw new Error('Module ' + name + ' not declared as a dependency of ' + entry.name);
+ }, exports, module);
+
+ if (output !== undefined)
+ module.exports = output;
+
+ // create the esModule object, which allows ES6 named imports of dynamics
+ exports = module.exports;
+
+ // __esModule flag treats as already-named
+ if (exports && (exports.__esModule || exports instanceof Module))
+ entry.esModule = loader.newModule(exports);
+ // set module as 'default' export, then fake named exports by iterating properties
+ else if (entry.esmExports && exports !== __global)
+ entry.esModule = loader.newModule(getESModule(exports));
+ // just use the 'default' export
+ else
+ entry.esModule = loader.newModule({ 'default': exports, __useDefault: true });
+ }
+
+ /*
+ * Given a module, and the list of modules for this current branch,
+ * ensure that each of the dependencies of this module is evaluated
+ * (unless one is a circular dependency already in the list of seen
+ * modules, in which case we execute it)
+ *
+ * Then we evaluate the module itself depth-first left to right
+ * execution to match ES6 modules
+ */
+ function ensureEvaluated(moduleName, entry, seen, loader) {
+ // if already seen, that means it's an already-evaluated non circular dependency
+ if (!entry || entry.evaluated || !entry.declarative)
+ return;
+
+ // this only applies to declarative modules which late-execute
+
+ seen.push(moduleName);
+
+ for (var i = 0, l = entry.normalizedDeps.length; i < l; i++) {
+ var depName = entry.normalizedDeps[i];
+ if (indexOf.call(seen, depName) == -1) {
+ if (!loader.defined[depName])
+ loader.get(depName);
+ else
+ ensureEvaluated(depName, loader.defined[depName], seen, loader);
+ }
+ }
+
+ if (entry.evaluated)
+ return;
+
+ entry.evaluated = true;
+ entry.module.execute.call(__global);
+ }
+
+ // override the delete method to also clear the register caches
+ hook('delete', function(del) {
+ return function(name) {
+ delete this._loader.moduleRecords[name];
+ delete this.defined[name];
+ return del.call(this, name);
+ };
+ });
+
+ hook('fetch', function(fetch) {
+ return function(load) {
+ if (this.defined[load.name]) {
+ load.metadata.format = 'defined';
+ return '';
+ }
+
+ load.metadata.deps = load.metadata.deps || [];
+
+ return fetch.call(this, load);
+ };
+ });
+
+ hook('translate', function(translate) {
+ // we run the meta detection here (register is after meta)
+ return function(load) {
+ load.metadata.deps = load.metadata.deps || [];
+ return Promise.resolve(translate.apply(this, arguments)).then(function(source) {
+ // run detection for register format
+ if (load.metadata.format == 'register' || !load.metadata.format && detectRegisterFormat(load.source))
+ load.metadata.format = 'register';
+ return source;
+ });
+ };
+ });
+
+ // implement a perforance shortpath for System.load with no deps
+ hook('load', function(doLoad) {
+ return function(normalized) {
+ var loader = this;
+ var entry = loader.defined[normalized];
+
+ if (!entry || entry.deps.length)
+ return doLoad.apply(this, arguments);
+
+ entry.originalIndices = entry.normalizedDeps = [];
+
+ // recursively ensure that the module and all its
+ // dependencies are linked (with dependency group handling)
+ link(normalized, entry, loader);
+
+ // now handle dependency execution in correct order
+ ensureEvaluated(normalized, entry, [], loader);
+ if (!entry.esModule)
+ entry.esModule = loader.newModule(entry.module.exports);
+
+ // remove from the registry
+ if (!loader.trace)
+ loader.defined[normalized] = undefined;
+
+ // return the defined module object
+ loader.set(normalized, entry.esModule);
+
+ return Promise.resolve();
+ };
+ });
+
+ hook('instantiate', function(instantiate) {
+ return function(load) {
+ if (load.metadata.format == 'detect')
+ load.metadata.format = undefined;
+
+ // assumes previous instantiate is sync
+ // (core json support)
+ instantiate.call(this, load);
+
+ var loader = this;
+
+ var entry;
+
+ // first we check if this module has already been defined in the registry
+ if (loader.defined[load.name]) {
+ entry = loader.defined[load.name];
+ // don't support deps for ES modules
+ if (!entry.declarative)
+ entry.deps = entry.deps.concat(load.metadata.deps);
+ entry.deps = entry.deps.concat(load.metadata.deps);
+ }
+
+ // picked up already by an anonymous System.register script injection
+ // or via the dynamic formats
+ else if (load.metadata.entry) {
+ entry = load.metadata.entry;
+ entry.deps = entry.deps.concat(load.metadata.deps);
+ }
+
+ // Contains System.register calls
+ // (dont run bundles in the builder)
+ else if (!(loader.builder && load.metadata.bundle)
+ && (load.metadata.format == 'register' || load.metadata.format == 'esm' || load.metadata.format == 'es6')) {
+
+ if (typeof __exec != 'undefined')
+ __exec.call(loader, load);
+
+ if (!load.metadata.entry && !load.metadata.bundle)
+ throw new Error(load.name + ' detected as ' + load.metadata.format + ' but didn\'t execute.');
+
+ entry = load.metadata.entry;
+
+ // support metadata deps for System.register
+ if (entry && load.metadata.deps)
+ entry.deps = entry.deps.concat(load.metadata.deps);
+ }
+
+ // named bundles are just an empty module
+ if (!entry) {
+ entry = createEntry();
+ entry.deps = load.metadata.deps;
+ entry.execute = function() {};
+ }
+
+ // place this module onto defined for circular references
+ loader.defined[load.name] = entry;
+
+ var grouped = group(entry.deps);
+
+ entry.deps = grouped.names;
+ entry.originalIndices = grouped.indices;
+ entry.name = load.name;
+ entry.esmExports = load.metadata.esmExports !== false;
+
+ // first, normalize all dependencies
+ var normalizePromises = [];
+ for (var i = 0, l = entry.deps.length; i < l; i++)
+ normalizePromises.push(Promise.resolve(loader.normalize(entry.deps[i], load.name)));
+
+ return Promise.all(normalizePromises).then(function(normalizedDeps) {
+
+ entry.normalizedDeps = normalizedDeps;
+
+ return {
+ deps: entry.deps,
+ execute: function() {
+ // recursively ensure that the module and all its
+ // dependencies are linked (with dependency group handling)
+ link(load.name, entry, loader);
+
+ // now handle dependency execution in correct order
+ ensureEvaluated(load.name, entry, [], loader);
+
+ if (!entry.esModule)
+ entry.esModule = loader.newModule(entry.module.exports);
+
+ // remove from the registry
+ if (!loader.trace)
+ loader.defined[load.name] = undefined;
+
+ // return the defined module object
+ return entry.esModule;
+ }
+ };
+ });
+ };
+ });
+})();
+
+
+function getGlobalValue(exports) {
+ if (typeof exports == 'string')
+ return readMemberExpression(exports, __global);
+
+ if (!(exports instanceof Array))
+ throw new Error('Global exports must be a string or array.');
+
+ var globalValue = {};
+ var first = true;
+ for (var i = 0; i < exports.length; i++) {
+ var val = readMemberExpression(exports[i], __global);
+ if (first) {
+ globalValue['default'] = val;
+ first = false;
+ }
+ globalValue[exports[i].split('.').pop()] = val;
+ }
+ return globalValue;
+}
+
+hook('reduceRegister_', function(reduceRegister) {
+ return function(load, register) {
+ if (register || (!load.metadata.exports && !(isWorker && load.metadata.format == 'global')))
+ return reduceRegister.call(this, load, register);
+
+ load.metadata.format = 'global';
+ var entry = load.metadata.entry = createEntry();
+ entry.deps = load.metadata.deps;
+ var globalValue = getGlobalValue(load.metadata.exports);
+ entry.execute = function() {
+ return globalValue;
+ };
+ };
+});
+
+hookConstructor(function(constructor) {
+ return function() {
+ var loader = this;
+ constructor.call(loader);
+
+ var hasOwnProperty = Object.prototype.hasOwnProperty;
+
+ // bare minimum ignores
+ var ignoredGlobalProps = ['_g', 'sessionStorage', 'localStorage', 'clipboardData', 'frames', 'frameElement', 'external',
+ 'mozAnimationStartTime', 'webkitStorageInfo', 'webkitIndexedDB', 'mozInnerScreenY', 'mozInnerScreenX'];
+
+ var globalSnapshot;
+
+ function forEachGlobal(callback) {
+ if (Object.keys)
+ Object.keys(__global).forEach(callback);
+ else
+ for (var g in __global) {
+ if (!hasOwnProperty.call(__global, g))
+ continue;
+ callback(g);
+ }
+ }
+
+ function forEachGlobalValue(callback) {
+ forEachGlobal(function(globalName) {
+ if (indexOf.call(ignoredGlobalProps, globalName) != -1)
+ return;
+ try {
+ var value = __global[globalName];
+ }
+ catch (e) {
+ ignoredGlobalProps.push(globalName);
+ }
+ callback(globalName, value);
+ });
+ }
+
+ loader.set('@@global-helpers', loader.newModule({
+ prepareGlobal: function(moduleName, exports, globals, encapsulate) {
+ // disable module detection
+ var curDefine = __global.define;
+
+ __global.define = undefined;
+
+ // set globals
+ var oldGlobals;
+ if (globals) {
+ oldGlobals = {};
+ for (var g in globals) {
+ oldGlobals[g] = __global[g];
+ __global[g] = globals[g];
+ }
+ }
+
+ // store a complete copy of the global object in order to detect changes
+ if (!exports) {
+ globalSnapshot = {};
+
+ forEachGlobalValue(function(name, value) {
+ globalSnapshot[name] = value;
+ });
+ }
+
+ // return function to retrieve global
+ return function() {
+ var globalValue = exports ? getGlobalValue(exports) : {};
+
+ var singleGlobal;
+ var multipleExports = !!exports;
+
+ if (!exports || encapsulate)
+ forEachGlobalValue(function(name, value) {
+ if (globalSnapshot[name] === value)
+ return;
+ if (typeof value == 'undefined')
+ return;
+
+ // allow global encapsulation where globals are removed
+ if (encapsulate)
+ __global[name] = undefined;
+
+ if (!exports) {
+ globalValue[name] = value;
+
+ if (typeof singleGlobal != 'undefined') {
+ if (!multipleExports && singleGlobal !== value)
+ multipleExports = true;
+ }
+ else {
+ singleGlobal = value;
+ }
+ }
+ });
+
+ globalValue = multipleExports ? globalValue : singleGlobal;
+
+ // revert globals
+ if (oldGlobals) {
+ for (var g in oldGlobals)
+ __global[g] = oldGlobals[g];
+ }
+ __global.define = curDefine;
+
+ return globalValue;
+ };
+ }
+ }));
+ };
+});
+hookConstructor(function(constructor) {
+ return function() {
+ var loader = this;
+ constructor.call(loader);
+
+ if (typeof window != 'undefined' && typeof document != 'undefined' && window.location)
+ var windowOrigin = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '');
+
+ function stripOrigin(path) {
+ if (path.substr(0, 8) == 'file:///')
+ return path.substr(7 + !!isWindows);
+
+ if (windowOrigin && path.substr(0, windowOrigin.length) == windowOrigin)
+ return path.substr(windowOrigin.length);
+
+ return path;
+ }
+
+ loader.set('@@cjs-helpers', loader.newModule({
+ requireResolve: function(request, parentId) {
+ return stripOrigin(loader.normalizeSync(request, parentId));
+ },
+ getPathVars: function(moduleId) {
+ // remove any plugin syntax
+ var pluginIndex = moduleId.lastIndexOf('!');
+ var filename;
+ if (pluginIndex != -1)
+ filename = moduleId.substr(0, pluginIndex);
+ else
+ filename = moduleId;
+
+ var dirname = filename.split('/');
+ dirname.pop();
+ dirname = dirname.join('/');
+
+ return {
+ filename: stripOrigin(filename),
+ dirname: stripOrigin(dirname)
+ };
+ }
+ }))
+ };
+});/*
+ * AMD Helper function module
+ * Separated into its own file as this is the part needed for full AMD support in SFX builds
+ * NB since implementations have now diverged this can be merged back with amd.js
+ */
+
+hook('fetch', function(fetch) {
+ return function(load) {
+ // script load implies define global leak
+ if (load.metadata.scriptLoad && isBrowser)
+ __global.define = this.amdDefine;
+ return fetch.call(this, load);
+ };
+});
+
+hookConstructor(function(constructor) {
+ return function() {
+ var loader = this;
+ constructor.call(this);
+
+ var commentRegEx = /(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/mg;
+ var cjsRequirePre = "(?:^|[^$_a-zA-Z\\xA0-\\uFFFF.])";
+ var cjsRequirePost = "\\s*\\(\\s*(\"([^\"]+)\"|'([^']+)')\\s*\\)";
+ var fnBracketRegEx = /\(([^\)]*)\)/;
+ var wsRegEx = /^\s+|\s+$/g;
+
+ var requireRegExs = {};
+
+ function getCJSDeps(source, requireIndex) {
+
+ // remove comments
+ source = source.replace(commentRegEx, '');
+
+ // determine the require alias
+ var params = source.match(fnBracketRegEx);
+ var requireAlias = (params[1].split(',')[requireIndex] || 'require').replace(wsRegEx, '');
+
+ // find or generate the regex for this requireAlias
+ var requireRegEx = requireRegExs[requireAlias] || (requireRegExs[requireAlias] = new RegExp(cjsRequirePre + requireAlias + cjsRequirePost, 'g'));
+
+ requireRegEx.lastIndex = 0;
+
+ var deps = [];
+
+ var match;
+ while (match = requireRegEx.exec(source))
+ deps.push(match[2] || match[3]);
+
+ return deps;
+ }
+
+ /*
+ AMD-compatible require
+ To copy RequireJS, set window.require = window.requirejs = loader.amdRequire
+ */
+ function require(names, callback, errback, referer) {
+ // in amd, first arg can be a config object... we just ignore
+ if (typeof names == 'object' && !(names instanceof Array))
+ return require.apply(null, Array.prototype.splice.call(arguments, 1, arguments.length - 1));
+
+ // amd require
+ if (typeof names == 'string' && typeof callback == 'function')
+ names = [names];
+ if (names instanceof Array) {
+ var dynamicRequires = [];
+ for (var i = 0; i < names.length; i++)
+ dynamicRequires.push(loader['import'](names[i], referer));
+ Promise.all(dynamicRequires).then(function(modules) {
+ if (callback)
+ callback.apply(null, modules);
+ }, errback);
+ }
+
+ // commonjs require
+ else if (typeof names == 'string') {
+ var defaultJSExtension = loader.defaultJSExtensions && names.substr(names.length - 3, 3) != '.js';
+ var normalized = loader.decanonicalize(names, referer);
+ if (defaultJSExtension && normalized.substr(normalized.length - 3, 3) == '.js')
+ normalized = normalized.substr(0, normalized.length - 3);
+ var module = loader.get(normalized);
+ if (!module)
+ throw new Error('Module not already loaded loading "' + names + '" as ' + normalized + (referer ? ' from "' + referer + '".' : '.'));
+ return module.__useDefault ? module['default'] : module;
+ }
+
+ else
+ throw new TypeError('Invalid require');
+ }
+
+ function define(name, deps, factory) {
+ if (typeof name != 'string') {
+ factory = deps;
+ deps = name;
+ name = null;
+ }
+ if (!(deps instanceof Array)) {
+ factory = deps;
+ deps = ['require', 'exports', 'module'].splice(0, factory.length);
+ }
+
+ if (typeof factory != 'function')
+ factory = (function(factory) {
+ return function() { return factory; }
+ })(factory);
+
+ // in IE8, a trailing comma becomes a trailing undefined entry
+ if (deps[deps.length - 1] === undefined)
+ deps.pop();
+
+ // remove system dependencies
+ var requireIndex, exportsIndex, moduleIndex;
+
+ if ((requireIndex = indexOf.call(deps, 'require')) != -1) {
+
+ deps.splice(requireIndex, 1);
+
+ // only trace cjs requires for non-named
+ // named defines assume the trace has already been done
+ if (!name)
+ deps = deps.concat(getCJSDeps(factory.toString(), requireIndex));
+ }
+
+ if ((exportsIndex = indexOf.call(deps, 'exports')) != -1)
+ deps.splice(exportsIndex, 1);
+
+ if ((moduleIndex = indexOf.call(deps, 'module')) != -1)
+ deps.splice(moduleIndex, 1);
+
+ function execute(req, exports, module) {
+ var depValues = [];
+ for (var i = 0; i < deps.length; i++)
+ depValues.push(req(deps[i]));
+
+ module.uri = module.id;
+
+ module.config = function() {};
+
+ // add back in system dependencies
+ if (moduleIndex != -1)
+ depValues.splice(moduleIndex, 0, module);
+
+ if (exportsIndex != -1)
+ depValues.splice(exportsIndex, 0, exports);
+
+ if (requireIndex != -1) {
+ function contextualRequire(names, callback, errback) {
+ if (typeof names == 'string' && typeof callback != 'function')
+ return req(names);
+ return require.call(loader, names, callback, errback, module.id);
+ }
+ contextualRequire.toUrl = function(name) {
+ // normalize without defaultJSExtensions
+ var defaultJSExtension = loader.defaultJSExtensions && name.substr(name.length - 3, 3) != '.js';
+ var url = loader.decanonicalize(name, module.id);
+ if (defaultJSExtension && url.substr(url.length - 3, 3) == '.js')
+ url = url.substr(0, url.length - 3);
+ return url;
+ };
+ depValues.splice(requireIndex, 0, contextualRequire);
+ }
+
+ // set global require to AMD require
+ var curRequire = __global.require;
+ __global.require = require;
+
+ var output = factory.apply(exportsIndex == -1 ? __global : exports, depValues);
+
+ __global.require = curRequire;
+
+ if (typeof output == 'undefined' && module)
+ output = module.exports;
+
+ if (typeof output != 'undefined')
+ return output;
+ }
+
+ var entry = createEntry();
+ entry.name = name && (loader.decanonicalize || loader.normalize).call(loader, name);
+ entry.deps = deps;
+ entry.execute = execute;
+
+ loader.pushRegister_({
+ amd: true,
+ entry: entry
+ });
+ }
+ define.amd = {};
+
+ // reduction function to attach defines to a load record
+ hook('reduceRegister_', function(reduceRegister) {
+ return function(load, register) {
+ // only handle AMD registers here
+ if (!register || !register.amd)
+ return reduceRegister.call(this, load, register);
+
+ var curMeta = load && load.metadata;
+ var entry = register.entry;
+
+ if (curMeta) {
+ if (!curMeta.format || curMeta.format == 'detect')
+ curMeta.format = 'amd';
+ else if (!entry.name && curMeta.format != 'amd')
+ throw new Error('AMD define called while executing ' + curMeta.format + ' module ' + load.name);
+ }
+
+ // anonymous define
+ if (!entry.name) {
+ if (!curMeta)
+ throw new TypeError('Unexpected anonymous AMD define.');
+
+ if (curMeta.entry && !curMeta.entry.name)
+ throw new Error('Multiple anonymous defines in module ' + load.name);
+
+ curMeta.entry = entry;
+ }
+ // named define
+ else {
+ // if we don't have any other defines,
+ // then let this be an anonymous define
+ // this is just to support single modules of the form:
+ // define('jquery')
+ // still loading anonymously
+ // because it is done widely enough to be useful
+ // as soon as there is more than one define, this gets removed though
+ if (curMeta) {
+ if (!curMeta.entry && !curMeta.bundle)
+ curMeta.entry = entry;
+ else if (curMeta.entry && curMeta.entry.name && curMeta.entry.name != load.name)
+ curMeta.entry = undefined;
+
+ // note this is now a bundle
+ curMeta.bundle = true;
+ }
+
+ // define the module through the register registry
+ if (!(entry.name in this.defined))
+ this.defined[entry.name] = entry;
+ }
+ };
+ });
+
+ loader.amdDefine = define;
+ loader.amdRequire = require;
+ };
+});/*
+ SystemJS Loader Plugin Support
+
+ Supports plugin loader syntax with "!", or via metadata.loader
+
+ The plugin name is loaded as a module itself, and can override standard loader hooks
+ for the plugin resource. See the plugin section of the systemjs readme.
+*/
+
+(function() {
+ function getParentName(loader, parentName) {
+ // if parent is a plugin, normalize against the parent plugin argument only
+ if (parentName) {
+ var parentPluginIndex;
+ if (loader.pluginFirst) {
+ if ((parentPluginIndex = parentName.lastIndexOf('!')) != -1)
+ return parentName.substr(parentPluginIndex + 1);
+ }
+ else {
+ if ((parentPluginIndex = parentName.indexOf('!')) != -1)
+ return parentName.substr(0, parentPluginIndex);
+ }
+
+ return parentName;
+ }
+ }
+
+ function parsePlugin(loader, name) {
+ var argumentName;
+ var pluginName;
+
+ var pluginIndex = name.lastIndexOf('!');
+
+ if (pluginIndex == -1)
+ return;
+
+ if (loader.pluginFirst) {
+ argumentName = name.substr(pluginIndex + 1);
+ pluginName = name.substr(0, pluginIndex);
+ }
+ else {
+ argumentName = name.substr(0, pluginIndex);
+ pluginName = name.substr(pluginIndex + 1) || argumentName.substr(argumentName.lastIndexOf('.') + 1);
+ }
+
+ return {
+ argument: argumentName,
+ plugin: pluginName
+ };
+ }
+
+ // put name back together after parts have been normalized
+ function combinePluginParts(loader, argumentName, pluginName, defaultExtension) {
+ if (defaultExtension && argumentName.substr(argumentName.length - 3, 3) == '.js')
+ argumentName = argumentName.substr(0, argumentName.length - 3);
+
+ if (loader.pluginFirst) {
+ return pluginName + '!' + argumentName;
+ }
+ else {
+ return argumentName + '!' + pluginName;
+ }
+ }
+
+ // note if normalize will add a default js extension
+ // if so, remove for backwards compat
+ // this is strange and sucks, but will be deprecated
+ function checkDefaultExtension(loader, arg) {
+ return loader.defaultJSExtensions && arg.substr(arg.length - 3, 3) != '.js';
+ }
+
+ function createNormalizeSync(normalizeSync) {
+ return function(name, parentName, isPlugin) {
+ var loader = this;
+
+ var parsed = parsePlugin(loader, name);
+ parentName = getParentName(this, parentName);
+
+ if (!parsed)
+ return normalizeSync.call(this, name, parentName, isPlugin);
+
+ // if this is a plugin, normalize the plugin name and the argument
+ var argumentName = loader.normalizeSync(parsed.argument, parentName, true);
+ var pluginName = loader.normalizeSync(parsed.plugin, parentName, true);
+ return combinePluginParts(loader, argumentName, pluginName, checkDefaultExtension(loader, parsed.argument));
+ };
+ }
+
+ hook('decanonicalize', createNormalizeSync);
+ hook('normalizeSync', createNormalizeSync);
+
+ hook('normalize', function(normalize) {
+ return function(name, parentName, isPlugin) {
+ var loader = this;
+
+ parentName = getParentName(this, parentName);
+
+ var parsed = parsePlugin(loader, name);
+
+ if (!parsed)
+ return normalize.call(loader, name, parentName, isPlugin);
+
+ return Promise.all([
+ loader.normalize(parsed.argument, parentName, true),
+ loader.normalize(parsed.plugin, parentName, false)
+ ])
+ .then(function(normalized) {
+ return combinePluginParts(loader, normalized[0], normalized[1], checkDefaultExtension(loader, parsed.argument));
+ });
+ }
+ });
+
+ hook('locate', function(locate) {
+ return function(load) {
+ var loader = this;
+
+ var name = load.name;
+
+ // plugin syntax
+ var pluginSyntaxIndex;
+ if (loader.pluginFirst) {
+ if ((pluginSyntaxIndex = name.indexOf('!')) != -1) {
+ load.metadata.loader = name.substr(0, pluginSyntaxIndex);
+ load.name = name.substr(pluginSyntaxIndex + 1);
+ }
+ }
+ else {
+ if ((pluginSyntaxIndex = name.lastIndexOf('!')) != -1) {
+ load.metadata.loader = name.substr(pluginSyntaxIndex + 1);
+ load.name = name.substr(0, pluginSyntaxIndex);
+ }
+ }
+
+ return locate.call(loader, load)
+ .then(function(address) {
+ if (pluginSyntaxIndex != -1 || !load.metadata.loader)
+ return address;
+
+ // normalize plugin relative to parent in locate here when
+ // using plugin via loader metadata
+ return (loader.pluginLoader || loader).normalize(load.metadata.loader, load.name)
+ .then(function(loaderNormalized) {
+ load.metadata.loader = loaderNormalized;
+ return address;
+ });
+ })
+ .then(function(address) {
+ var plugin = load.metadata.loader;
+
+ if (!plugin)
+ return address;
+
+ // don't allow a plugin to load itself
+ if (load.name == plugin)
+ throw new Error('Plugin ' + plugin + ' cannot load itself, make sure it is excluded from any wildcard meta configuration via a custom loader: false rule.');
+
+ // only fetch the plugin itself if this name isn't defined
+ if (loader.defined && loader.defined[name])
+ return address;
+
+ var pluginLoader = loader.pluginLoader || loader;
+
+ // load the plugin module and run standard locate
+ return pluginLoader['import'](plugin)
+ .then(function(loaderModule) {
+ // store the plugin module itself on the metadata
+ load.metadata.loaderModule = loaderModule;
+
+ load.address = address;
+ if (loaderModule.locate)
+ return loaderModule.locate.call(loader, load);
+
+ return address;
+ });
+ });
+ };
+ });
+
+ hook('fetch', function(fetch) {
+ return function(load) {
+ var loader = this;
+ if (load.metadata.loaderModule && load.metadata.loaderModule.fetch && load.metadata.format != 'defined') {
+ load.metadata.scriptLoad = false;
+ return load.metadata.loaderModule.fetch.call(loader, load, function(load) {
+ return fetch.call(loader, load);
+ });
+ }
+ else {
+ return fetch.call(loader, load);
+ }
+ };
+ });
+
+ hook('translate', function(translate) {
+ return function(load) {
+ var loader = this;
+ var args = arguments;
+ if (load.metadata.loaderModule && load.metadata.loaderModule.translate && load.metadata.format != 'defined') {
+ return Promise.resolve(load.metadata.loaderModule.translate.apply(loader, args)).then(function(result) {
+ var sourceMap = load.metadata.sourceMap;
+
+ // sanitize sourceMap if an object not a JSON string
+ if (sourceMap) {
+ if (typeof sourceMap != 'object')
+ throw new Error('load.metadata.sourceMap must be set to an object.');
+
+ var originalName = load.address.split('!')[0];
+
+ // force set the filename of the original file
+ if (!sourceMap.file || sourceMap.file == load.address)
+ sourceMap.file = originalName + '!transpiled';
+
+ // force set the sources list if only one source
+ if (!sourceMap.sources || sourceMap.sources.length <= 1 && (!sourceMap.sources[0] || sourceMap.sources[0] == load.address))
+ sourceMap.sources = [originalName];
+ }
+
+ // if running on file:/// URLs, sourcesContent is necessary
+ // load.metadata.sourceMap.sourcesContent = [load.source];
+
+ if (typeof result == 'string')
+ load.source = result;
+ else
+ warn.call(this, 'Plugin ' + load.metadata.loader + ' should return the source in translate, instead of setting load.source directly. This support will be deprecated.');
+
+ return translate.apply(loader, args);
+ });
+ }
+ else {
+ return translate.apply(loader, args);
+ }
+ };
+ });
+
+ hook('instantiate', function(instantiate) {
+ return function(load) {
+ var loader = this;
+ var calledInstantiate = false;
+
+ if (load.metadata.loaderModule && load.metadata.loaderModule.instantiate && !loader.builder && load.metadata.format != 'defined')
+ return Promise.resolve(load.metadata.loaderModule.instantiate.call(loader, load, function(load) {
+ if (calledInstantiate)
+ throw new Error('Instantiate must only be called once.');
+ calledInstantiate = true;
+ return instantiate.call(loader, load);
+ })).then(function(result) {
+ if (calledInstantiate)
+ return result;
+
+ load.metadata.entry = createEntry();
+ load.metadata.entry.execute = function() {
+ return result;
+ }
+ load.metadata.entry.deps = load.metadata.deps;
+ load.metadata.format = 'defined';
+ return instantiate.call(loader, load);
+ });
+ else
+ return instantiate.call(loader, load);
+ };
+ });
+
+})();/*
+ * Conditions Extension
+ *
+ * Allows a condition module to alter the resolution of an import via syntax:
+ *
+ * import $ from 'jquery/#{browser}';
+ *
+ * Will first load the module 'browser' via `SystemJS.import('browser')` and
+ * take the default export of that module.
+ * If the default export is not a string, an error is thrown.
+ *
+ * We then substitute the string into the require to get the conditional resolution
+ * enabling environment-specific variations like:
+ *
+ * import $ from 'jquery/ie'
+ * import $ from 'jquery/firefox'
+ * import $ from 'jquery/chrome'
+ * import $ from 'jquery/safari'
+ *
+ * It can be useful for a condition module to define multiple conditions.
+ * This can be done via the `|` modifier to specify an export member expression:
+ *
+ * import 'jquery/#{./browser.js|grade.version}'
+ *
+ * Where the `grade` export `version` member in the `browser.js` module is substituted.
+ *
+ *
+ * Boolean Conditionals
+ *
+ * For polyfill modules, that are used as imports but have no module value,
+ * a binary conditional allows a module not to be loaded at all if not needed:
+ *
+ * import 'es5-shim#?./conditions.js|needs-es5shim'
+ *
+ * These conditions can also be negated via:
+ *
+ * import 'es5-shim#?./conditions.js|~es6'
+ *
+ */
+
+ var sysConditions = ['browser', 'node', 'dev', 'build', 'production', 'default'];
+
+ function parseCondition(condition) {
+ var conditionExport, conditionModule, negation;
+
+ var negation = condition[0] == '~';
+ var conditionExportIndex = condition.lastIndexOf('|');
+ if (conditionExportIndex != -1) {
+ conditionExport = condition.substr(conditionExportIndex + 1);
+ conditionModule = condition.substr(negation, conditionExportIndex - negation);
+
+ if (negation)
+ warn.call(this, 'Condition negation form "' + condition + '" is deprecated for "' + conditionModule + '|~' + conditionExport + '"');
+
+ if (conditionExport[0] == '~') {
+ negation = true;
+ conditionExport = conditionExport.substr(1);
+ }
+ }
+ else {
+ conditionExport = 'default';
+ conditionModule = condition.substr(negation);
+ if (sysConditions.indexOf(conditionModule) != -1) {
+ conditionExport = conditionModule;
+ conditionModule = null;
+ }
+ }
+
+ return {
+ module: conditionModule || '@system-env',
+ prop: conditionExport,
+ negate: negation
+ };
+ }
+
+ function serializeCondition(conditionObj) {
+ return conditionObj.module + '|' + (conditionObj.negate ? '~' : '') + conditionObj.prop;
+ }
+
+ function resolveCondition(conditionObj, parentName, bool) {
+ var self = this;
+ return this.normalize(conditionObj.module, parentName)
+ .then(function(normalizedCondition) {
+ return self.load(normalizedCondition)
+ .then(function(q) {
+ var m = readMemberExpression(conditionObj.prop, self.get(normalizedCondition));
+
+ if (bool && typeof m != 'boolean')
+ throw new TypeError('Condition ' + serializeCondition(conditionObj) + ' did not resolve to a boolean.');
+
+ return conditionObj.negate ? !m : m;
+ });
+ });
+ }
+
+ var interpolationRegEx = /#\{[^\}]+\}/;
+ function interpolateConditional(name, parentName) {
+ // first we normalize the conditional
+ var conditionalMatch = name.match(interpolationRegEx);
+
+ if (!conditionalMatch)
+ return Promise.resolve(name);
+
+ var conditionObj = parseCondition.call(this, conditionalMatch[0].substr(2, conditionalMatch[0].length - 3));
+
+ // in builds, return normalized conditional
+ if (this.builder)
+ return this['normalize'](conditionObj.module, parentName)
+ .then(function(conditionModule) {
+ conditionObj.module = conditionModule;
+ return name.replace(interpolationRegEx, '#{' + serializeCondition(conditionObj) + '}');
+ });
+
+ return resolveCondition.call(this, conditionObj, parentName, false)
+ .then(function(conditionValue) {
+ if (typeof conditionValue !== 'string')
+ throw new TypeError('The condition value for ' + name + ' doesn\'t resolve to a string.');
+
+ if (conditionValue.indexOf('/') != -1)
+ throw new TypeError('Unabled to interpolate conditional ' + name + (parentName ? ' in ' + parentName : '') + '\n\tThe condition value ' + conditionValue + ' cannot contain a "/" separator.');
+
+ return name.replace(interpolationRegEx, conditionValue);
+ });
+ }
+
+ function booleanConditional(name, parentName) {
+ // first we normalize the conditional
+ var booleanIndex = name.lastIndexOf('#?');
+
+ if (booleanIndex == -1)
+ return Promise.resolve(name);
+
+ var conditionObj = parseCondition.call(this, name.substr(booleanIndex + 2));
+
+ // in builds, return normalized conditional
+ if (this.builder)
+ return this['normalize'](conditionObj.module, parentName)
+ .then(function(conditionModule) {
+ conditionObj.module = conditionModule;
+ return name.substr(0, booleanIndex) + '#?' + serializeCondition(conditionObj);
+ });
+
+ return resolveCondition.call(this, conditionObj, parentName, true)
+ .then(function(conditionValue) {
+ return conditionValue ? name.substr(0, booleanIndex) : '@empty';
+ });
+ }
+
+ // normalizeSync does not parse conditionals at all although it could
+ hook('normalize', function(normalize) {
+ return function(name, parentName, skipExt) {
+ var loader = this;
+ return booleanConditional.call(loader, name, parentName)
+ .then(function(name) {
+ return normalize.call(loader, name, parentName, skipExt);
+ })
+ .then(function(normalized) {
+ return interpolateConditional.call(loader, normalized, parentName);
+ });
+ };
+ });
+/*
+ * Alias Extension
+ *
+ * Allows a module to be a plain copy of another module by module name
+ *
+ * SystemJS.meta['mybootstrapalias'] = { alias: 'bootstrap' };
+ *
+ */
+(function() {
+ // aliases
+ hook('fetch', function(fetch) {
+ return function(load) {
+ var alias = load.metadata.alias;
+ var aliasDeps = load.metadata.deps || [];
+ if (alias) {
+ load.metadata.format = 'defined';
+ var entry = createEntry();
+ this.defined[load.name] = entry;
+ entry.declarative = true;
+ entry.deps = aliasDeps.concat([alias]);
+ entry.declare = function(_export) {
+ return {
+ setters: [function(module) {
+ for (var p in module)
+ _export(p, module[p]);
+ if (module.__useDefault)
+ entry.module.exports.__useDefault = true;
+ }],
+ execute: function() {}
+ };
+ };
+ return '';
+ }
+
+ return fetch.call(this, load);
+ };
+ });
+})();/*
+ * Meta Extension
+ *
+ * Sets default metadata on a load record (load.metadata) from
+ * loader.metadata via SystemJS.meta function.
+ *
+ *
+ * Also provides an inline meta syntax for module meta in source.
+ *
+ * Eg:
+ *
+ * loader.meta({
+ * 'my/module': { deps: ['jquery'] }
+ * 'my/*': { format: 'amd' }
+ * });
+ *
+ * Which in turn populates loader.metadata.
+ *
+ * load.metadata.deps and load.metadata.format will then be set
+ * for 'my/module'
+ *
+ * The same meta could be set with a my/module.js file containing:
+ *
+ * my/module.js
+ * "format amd";
+ * "deps[] jquery";
+ * "globals.some value"
+ * console.log('this is my/module');
+ *
+ * Configuration meta always takes preference to inline meta.
+ *
+ * Multiple matches in wildcards are supported and ammend the meta.
+ *
+ *
+ * The benefits of the function form is that paths are URL-normalized
+ * supporting say
+ *
+ * loader.meta({ './app': { format: 'cjs' } });
+ *
+ * Instead of needing to set against the absolute URL (https://site.com/app.js)
+ *
+ */
+
+(function() {
+
+ hookConstructor(function(constructor) {
+ return function() {
+ this.meta = {};
+ constructor.call(this);
+ };
+ });
+
+ hook('locate', function(locate) {
+ return function(load) {
+ var meta = this.meta;
+ var name = load.name;
+
+ // NB for perf, maybe introduce a fast-path wildcard lookup cache here
+ // which is checked first
+
+ // apply wildcard metas
+ var bestDepth = 0;
+ var wildcardIndex;
+ for (var module in meta) {
+ wildcardIndex = module.indexOf('*');
+ if (wildcardIndex === -1)
+ continue;
+ if (module.substr(0, wildcardIndex) === name.substr(0, wildcardIndex)
+ && module.substr(wildcardIndex + 1) === name.substr(name.length - module.length + wildcardIndex + 1)) {
+ var depth = module.split('/').length;
+ if (depth > bestDepth)
+ bestDepth = depth;
+ extendMeta(load.metadata, meta[module], bestDepth != depth);
+ }
+ }
+
+ // apply exact meta
+ if (meta[name])
+ extendMeta(load.metadata, meta[name]);
+
+ return locate.call(this, load);
+ };
+ });
+
+ // detect any meta header syntax
+ // only set if not already set
+ var metaRegEx = /^(\s*\/\*[^\*]*(\*(?!\/)[^\*]*)*\*\/|\s*\/\/[^\n]*|\s*"[^"]+"\s*;?|\s*'[^']+'\s*;?)+/;
+ var metaPartRegEx = /\/\*[^\*]*(\*(?!\/)[^\*]*)*\*\/|\/\/[^\n]*|"[^"]+"\s*;?|'[^']+'\s*;?/g;
+
+ function setMetaProperty(target, p, value) {
+ var pParts = p.split('.');
+ var curPart;
+ while (pParts.length > 1) {
+ curPart = pParts.shift();
+ target = target[curPart] = target[curPart] || {};
+ }
+ curPart = pParts.shift();
+ if (!(curPart in target))
+ target[curPart] = value;
+ }
+
+ hook('translate', function(translate) {
+ return function(load) {
+ // shortpath for bundled
+ if (load.metadata.format == 'defined') {
+ load.metadata.deps = load.metadata.deps || [];
+ return Promise.resolve(load.source);
+ }
+
+ // NB meta will be post-translate pending transpiler conversion to plugins
+ var meta = load.source.match(metaRegEx);
+ if (meta) {
+ var metaParts = meta[0].match(metaPartRegEx);
+
+ for (var i = 0; i < metaParts.length; i++) {
+ var curPart = metaParts[i];
+ var len = curPart.length;
+
+ var firstChar = curPart.substr(0, 1);
+ if (curPart.substr(len - 1, 1) == ';')
+ len--;
+
+ if (firstChar != '"' && firstChar != "'")
+ continue;
+
+ var metaString = curPart.substr(1, curPart.length - 3);
+ var metaName = metaString.substr(0, metaString.indexOf(' '));
+
+ if (metaName) {
+ var metaValue = metaString.substr(metaName.length + 1, metaString.length - metaName.length - 1);
+
+ if (metaName.substr(metaName.length - 2, 2) == '[]') {
+ metaName = metaName.substr(0, metaName.length - 2);
+ load.metadata[metaName] = load.metadata[metaName] || [];
+ load.metadata[metaName].push(metaValue);
+ }
+ else if (load.metadata[metaName] instanceof Array) {
+ // temporary backwards compat for previous "deps" syntax
+ warn.call(this, 'Module ' + load.name + ' contains deprecated "deps ' + metaValue + '" meta syntax.\nThis should be updated to "deps[] ' + metaValue + '" for pushing to array meta.');
+ load.metadata[metaName].push(metaValue);
+ }
+ else {
+ setMetaProperty(load.metadata, metaName, metaValue);
+ }
+ }
+ else {
+ load.metadata[metaString] = true;
+ }
+ }
+ }
+
+ return translate.apply(this, arguments);
+ };
+ });
+})();
+/*
+ System bundles
+
+ Allows a bundle module to be specified which will be dynamically
+ loaded before trying to load a given module.
+
+ For example:
+ SystemJS.bundles['mybundle'] = ['jquery', 'bootstrap/js/bootstrap']
+
+ Will result in a load to "mybundle" whenever a load to "jquery"
+ or "bootstrap/js/bootstrap" is made.
+
+ In this way, the bundle becomes the request that provides the module
+*/
+
+(function() {
+ // bundles support (just like RequireJS)
+ // bundle name is module name of bundle itself
+ // bundle is array of modules defined by the bundle
+ // when a module in the bundle is requested, the bundle is loaded instead
+ // of the form SystemJS.bundles['mybundle'] = ['jquery', 'bootstrap/js/bootstrap']
+ hookConstructor(function(constructor) {
+ return function() {
+ constructor.call(this);
+ this.bundles = {};
+ this._loader.loadedBundles = {};
+ };
+ });
+
+ // assign bundle metadata for bundle loads
+ hook('locate', function(locate) {
+ return function(load) {
+ var loader = this;
+ var matched = false;
+
+ if (!(load.name in loader.defined))
+ for (var b in loader.bundles) {
+ for (var i = 0; i < loader.bundles[b].length; i++) {
+ var curModule = loader.bundles[b][i];
+
+ if (curModule == load.name) {
+ matched = true;
+ break;
+ }
+
+ // wildcard in bundles does not include / boundaries
+ if (curModule.indexOf('*') != -1) {
+ var parts = curModule.split('*');
+ if (parts.length != 2) {
+ loader.bundles[b].splice(i--, 1);
+ continue;
+ }
+
+ if (load.name.substring(0, parts[0].length) == parts[0] &&
+ load.name.substr(load.name.length - parts[1].length, parts[1].length) == parts[1] &&
+ load.name.substr(parts[0].length, load.name.length - parts[1].length - parts[0].length).indexOf('/') == -1) {
+ matched = true;
+ break;
+ }
+ }
+ }
+
+ if (matched)
+ return loader['import'](b)
+ .then(function() {
+ return locate.call(loader, load);
+ });
+ }
+
+ return locate.call(loader, load);
+ };
+ });
+})();
+/*
+ * Dependency Tree Cache
+ *
+ * Allows a build to pre-populate a dependency trace tree on the loader of
+ * the expected dependency tree, to be loaded upfront when requesting the
+ * module, avoinding the n round trips latency of module loading, where
+ * n is the dependency tree depth.
+ *
+ * eg:
+ * SystemJS.depCache = {
+ * 'app': ['normalized', 'deps'],
+ * 'normalized': ['another'],
+ * 'deps': ['tree']
+ * };
+ *
+ * SystemJS.import('app')
+ * // simultaneously starts loading all of:
+ * // 'normalized', 'deps', 'another', 'tree'
+ * // before "app" source is even loaded
+ *
+ */
+
+(function() {
+ hookConstructor(function(constructor) {
+ return function() {
+ constructor.call(this);
+ this.depCache = {};
+ }
+ });
+
+ hook('locate', function(locate) {
+ return function(load) {
+ var loader = this;
+ // load direct deps, in turn will pick up their trace trees
+ var deps = loader.depCache[load.name];
+ if (deps)
+ for (var i = 0; i < deps.length; i++)
+ loader['import'](deps[i], load.name);
+
+ return locate.call(loader, load);
+ };
+ });
+})();
+
+/*
+ * Script-only addition used for production loader
+ *
+ */
+hookConstructor(function(constructor) {
+ return function() {
+ constructor.apply(this, arguments);
+ __global.define = this.amdDefine;
+ };
+});
+
+hook('fetch', function(fetch) {
+ return function(load) {
+ load.metadata.scriptLoad = true;
+ return fetch.call(this, load);
+ };
+});System = new SystemJSLoader();
+
+__global.SystemJS = System;
+System.version = '0.19.39 CSP';
+ if (typeof module == 'object' && module.exports && typeof exports == 'object')
+ module.exports = System;
+
+ __global.System = System;
+
+})(typeof self != 'undefined' ? self : global);}
+
+// auto-load Promise polyfill if needed in the browser
+var doPolyfill = typeof Promise === 'undefined';
+
+// document.write
+if (typeof document !== 'undefined') {
+ var scripts = document.getElementsByTagName('script');
+ $__curScript = scripts[scripts.length - 1];
+ if (document.currentScript && ($__curScript.defer || $__curScript.async))
+ $__curScript = document.currentScript;
+ if (doPolyfill) {
+ var curPath = $__curScript.src;
+ var basePath = curPath.substr(0, curPath.lastIndexOf('/') + 1);
+ window.systemJSBootstrap = bootstrap;
+ document.write(
+ '<' + 'script type="text/javascript" src="' + basePath + 'system-polyfills.js">' + '<' + '/script>'
+ );
+ }
+ else {
+ bootstrap();
+ }
+}
+// importScripts
+else if (typeof importScripts !== 'undefined') {
+ var basePath = '';
+ try {
+ throw new Error('_');
+ } catch (e) {
+ e.stack.replace(/(?:at|@).*(http.+):[\d]+:[\d]+/, function(m, url) {
+ $__curScript = { src: url };
+ basePath = url.replace(/\/[^\/]*$/, '/');
+ });
+ }
+ if (doPolyfill)
+ importScripts(basePath + 'system-polyfills.js');
+ bootstrap();
+}
+else {
+ $__curScript = typeof __filename != 'undefined' ? { src: __filename } : null;
+ bootstrap();
+}
+
+
+})(); \ No newline at end of file
diff --git a/lib/wallet/checkable.ts b/lib/wallet/checkable.ts
new file mode 100644
index 000000000..9fd816578
--- /dev/null
+++ b/lib/wallet/checkable.ts
@@ -0,0 +1,262 @@
+/*
+ This file is part of TALER
+ (C) 2016 GNUnet e.V.
+
+ TALER is free software; you can redistribute it and/or modify it under the
+ terms of the GNU General Public License as published by the Free Software
+ Foundation; either version 3, or (at your option) any later version.
+
+ TALER is distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along with
+ TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
+ */
+
+
+"use strict";
+
+/**
+ * Decorators for type-checking JSON into
+ * an object.
+ * @module Checkable
+ * @author Florian Dold
+ */
+
+export namespace Checkable {
+
+ type Path = (number|string)[];
+
+ interface SchemaErrorConstructor {
+ new (err: string): SchemaError;
+ }
+
+ interface SchemaError {
+ name: string;
+ message: string;
+ }
+
+ interface Prop {
+ propertyKey: any;
+ checker: any;
+ type: any;
+ elementChecker?: any;
+ elementProp?: any;
+ }
+
+ export let SchemaError = (function SchemaError(message: string) {
+ this.name = 'SchemaError';
+ this.message = message;
+ this.stack = (<any>new Error()).stack;
+ }) as any as SchemaErrorConstructor;
+
+
+ SchemaError.prototype = new Error;
+
+ let chkSym = Symbol("checkable");
+
+
+ function checkNumber(target: any, prop: Prop, path: Path): any {
+ if ((typeof target) !== "number") {
+ throw new SchemaError(`expected number for ${path}`);
+ }
+ return target;
+ }
+
+
+ function checkString(target: any, prop: Prop, path: Path): any {
+ if (typeof target !== "string") {
+ throw new SchemaError(`expected string for ${path}, got ${typeof target} instead`);
+ }
+ return target;
+ }
+
+
+ function checkAnyObject(target: any, prop: Prop, path: Path): any {
+ if (typeof target !== "object") {
+ throw new SchemaError(`expected (any) object for ${path}, got ${typeof target} instead`);
+ }
+ return target;
+ }
+
+
+ function checkAny(target: any, prop: Prop, path: Path): any {
+ return target;
+ }
+
+
+ function checkList(target: any, prop: Prop, path: Path): any {
+ if (!Array.isArray(target)) {
+ throw new SchemaError(`array expected for ${path}, got ${typeof target} instead`);
+ }
+ for (let i = 0; i < target.length; i++) {
+ let v = target[i];
+ prop.elementChecker(v, prop.elementProp, path.concat([i]));
+ }
+ return target;
+ }
+
+
+ function checkOptional(target: any, prop: Prop, path: Path): any {
+ console.assert(prop.propertyKey);
+ prop.elementChecker(target,
+ prop.elementProp,
+ path.concat([prop.propertyKey]));
+ return target;
+ }
+
+
+ function checkValue(target: any, prop: Prop, path: Path): any {
+ let type = prop.type;
+ if (!type) {
+ throw Error(`assertion failed (prop is ${JSON.stringify(prop)})`);
+ }
+ let v = target;
+ if (!v || typeof v !== "object") {
+ throw new SchemaError(
+ `expected object for ${path.join(".")}, got ${typeof v} instead`);
+ }
+ let props = type.prototype[chkSym].props;
+ let remainingPropNames = new Set(Object.getOwnPropertyNames(v));
+ let obj = new type();
+ for (let prop of props) {
+ if (!remainingPropNames.has(prop.propertyKey)) {
+ if (prop.optional) {
+ continue;
+ }
+ throw new SchemaError("Property missing: " + prop.propertyKey);
+ }
+ if (!remainingPropNames.delete(prop.propertyKey)) {
+ throw new SchemaError("assertion failed");
+ }
+ let propVal = v[prop.propertyKey];
+ obj[prop.propertyKey] = prop.checker(propVal,
+ prop,
+ path.concat([prop.propertyKey]));
+ }
+
+ if (remainingPropNames.size != 0) {
+ throw new SchemaError("superfluous properties " + JSON.stringify(Array.from(
+ remainingPropNames.values())));
+ }
+ return obj;
+ }
+
+
+ export function Class(target: any) {
+ target.checked = (v: any) => {
+ return checkValue(v, {
+ propertyKey: "(root)",
+ type: target,
+ checker: checkValue
+ }, ["(root)"]);
+ };
+ return target;
+ }
+
+
+ export function Value(type: any) {
+ if (!type) {
+ throw Error("Type does not exist yet (wrong order of definitions?)");
+ }
+ function deco(target: Object, propertyKey: string | symbol): void {
+ let chk = mkChk(target);
+ chk.props.push({
+ propertyKey: propertyKey,
+ checker: checkValue,
+ type: type
+ });
+ }
+
+ return deco;
+ }
+
+
+ export function List(type: any) {
+ let stub = {};
+ type(stub, "(list-element)");
+ let elementProp = mkChk(stub).props[0];
+ let elementChecker = elementProp.checker;
+ if (!elementChecker) {
+ throw Error("assertion failed");
+ }
+ function deco(target: Object, propertyKey: string | symbol): void {
+ let chk = mkChk(target);
+ chk.props.push({
+ elementChecker,
+ elementProp,
+ propertyKey: propertyKey,
+ checker: checkList,
+ });
+ }
+
+ return deco;
+ }
+
+
+ export function Optional(type: any) {
+ let stub = {};
+ type(stub, "(optional-element)");
+ let elementProp = mkChk(stub).props[0];
+ let elementChecker = elementProp.checker;
+ if (!elementChecker) {
+ throw Error("assertion failed");
+ }
+ function deco(target: Object, propertyKey: string | symbol): void {
+ let chk = mkChk(target);
+ chk.props.push({
+ elementChecker,
+ elementProp,
+ propertyKey: propertyKey,
+ checker: checkOptional,
+ optional: true,
+ });
+ }
+
+ return deco;
+ }
+
+
+ export function Number(target: Object, propertyKey: string | symbol): void {
+ let chk = mkChk(target);
+ chk.props.push({propertyKey: propertyKey, checker: checkNumber});
+ }
+
+
+ export function AnyObject(target: Object,
+ propertyKey: string | symbol): void {
+ let chk = mkChk(target);
+ chk.props.push({
+ propertyKey: propertyKey,
+ checker: checkAnyObject
+ });
+ }
+
+
+ export function Any(target: Object,
+ propertyKey: string | symbol): void {
+ let chk = mkChk(target);
+ chk.props.push({
+ propertyKey: propertyKey,
+ checker: checkAny,
+ optional: true
+ });
+ }
+
+
+ export function String(target: Object, propertyKey: string | symbol): void {
+ let chk = mkChk(target);
+ chk.props.push({propertyKey: propertyKey, checker: checkString});
+ }
+
+
+ function mkChk(target: any) {
+ let chk = target[chkSym];
+ if (!chk) {
+ chk = {props: []};
+ target[chkSym] = chk;
+ }
+ return chk;
+ }
+} \ No newline at end of file
diff --git a/lib/wallet/chromeBadge.ts b/lib/wallet/chromeBadge.ts
new file mode 100644
index 000000000..df12fba83
--- /dev/null
+++ b/lib/wallet/chromeBadge.ts
@@ -0,0 +1,227 @@
+/*
+ This file is part of TALER
+ (C) 2016 INRIA
+
+ TALER is free software; you can redistribute it and/or modify it under the
+ terms of the GNU General Public License as published by the Free Software
+ Foundation; either version 3, or (at your option) any later version.
+
+ TALER is distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along with
+ TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
+ */
+
+import {
+ Badge
+} from "./wallet";
+
+
+/**
+ * Polyfill for requestAnimationFrame, which
+ * doesn't work from a background page.
+ */
+function rAF(cb: (ts: number) => void) {
+ window.setTimeout(() => {
+ cb(performance.now());
+ }, 100 /* 100 ms delay between frames */);
+}
+
+
+export class ChromeBadge implements Badge {
+ canvas: HTMLCanvasElement;
+ ctx: CanvasRenderingContext2D;
+ /**
+ * True if animation running. The animation
+ * might still be running even if we're not busy anymore,
+ * just to transition to the "normal" state in a animated way.
+ */
+ animationRunning: boolean = false;
+
+ /**
+ * Is the wallet still busy? Note that we do not stop the
+ * animation immediately when the wallet goes idle, but
+ * instead slowly close the gap.
+ */
+ isBusy: boolean = false;
+
+ /**
+ * Current rotation angle, ranges from 0 to rotationAngleMax.
+ */
+ rotationAngle: number = 0;
+
+ /**
+ * While animating, how wide is the current gap in the circle?
+ * Ranges from 0 to openMax.
+ */
+ gapWidth: number = 0;
+
+ /**
+ * Maximum value for our rotationAngle, corresponds to 2 Pi.
+ */
+ static rotationAngleMax = 1000;
+
+ /**
+ * How fast do we rotate? Given in rotation angle (relative to rotationAngleMax) per millisecond.
+ */
+ static rotationSpeed = 0.5;
+
+ /**
+ * How fast to we open? Given in rotation angle (relative to rotationAngleMax) per millisecond.
+ */
+ static openSpeed = 0.15;
+
+ /**
+ * How fast to we close? Given as a multiplication factor per frame update.
+ */
+ static closeSpeed = 0.7;
+
+ /**
+ * How far do we open? Given relative to rotationAngleMax.
+ */
+ static openMax = 100;
+
+ constructor(window?: Window) {
+ // Allow injecting another window for testing
+ let bg = window || chrome.extension.getBackgroundPage();
+ if (!bg) {
+ throw Error("no window available");
+ }
+ this.canvas = bg.document.createElement("canvas");
+ // Note: changing the width here means changing the font
+ // size in draw() as well!
+ this.canvas.width = 32;
+ this.canvas.height = 32;
+ this.ctx = this.canvas.getContext("2d")!;
+ this.draw();
+ }
+
+ /**
+ * Draw the badge based on the current state.
+ */
+ private draw() {
+ this.ctx.setTransform(1, 0, 0, 1, 0, 0);
+ this.ctx.clearRect(0, 0, this.canvas.width, this.canvas.height);
+
+ this.ctx.translate(this.canvas.width / 2, this.canvas.height / 2);
+
+ this.ctx.beginPath();
+ this.ctx.arc(0, 0, this.canvas.width / 2 - 2, 0, 2 * Math.PI);
+ this.ctx.fillStyle = "white";
+ this.ctx.fill();
+
+ // move into the center, off by 2 for aligning the "T" with the bottom
+ // of the circle.
+ this.ctx.translate(0, 2);
+
+ // pick sans-serif font; note: 14px is based on the 32px width above!
+ this.ctx.font = "bold 24px sans-serif";
+ // draw the "T" perfectly centered (x and y) to the current position
+ this.ctx.textAlign = "center";
+ this.ctx.textBaseline = "middle";
+ this.ctx.fillStyle = "black";
+ this.ctx.fillText("T", 0, 0);
+ // now move really into the center
+ this.ctx.translate(0, -2);
+ // start drawing the (possibly open) circle
+ this.ctx.beginPath();
+ this.ctx.lineWidth = 2.5;
+ if (this.animationRunning) {
+ /* Draw circle around the "T" with an opening of this.gapWidth */
+ this.ctx.arc(0, 0,
+ this.canvas.width / 2 - 2, /* radius */
+ this.rotationAngle / ChromeBadge.rotationAngleMax * Math.PI * 2,
+ ((this.rotationAngle + ChromeBadge.rotationAngleMax - this.gapWidth) / ChromeBadge.rotationAngleMax) * Math.PI * 2,
+ false);
+ }
+ else {
+ /* Draw full circle */
+ this.ctx.arc(0, 0,
+ this.canvas.width / 2 - 2, /* radius */
+ 0,
+ Math.PI * 2,
+ false);
+ }
+ this.ctx.stroke();
+ // go back to the origin
+ this.ctx.translate(-this.canvas.width / 2, -this.canvas.height / 2);
+
+ // Allow running outside the extension for testing
+ if (window["chrome"] && window.chrome["browserAction"]) {
+ let imageData = this.ctx.getImageData(0,
+ 0,
+ this.canvas.width,
+ this.canvas.height);
+ chrome.browserAction.setIcon({imageData});
+ }
+ }
+
+ private animate() {
+ if (this.animationRunning) {
+ return;
+ }
+ this.animationRunning = true;
+ let start: number|undefined = undefined;
+ let step = (timestamp: number) => {
+ if (!this.animationRunning) {
+ return;
+ }
+ if (!start) {
+ start = timestamp;
+ }
+ let delta = (timestamp - start);
+ if (!this.isBusy && 0 == this.gapWidth) {
+ // stop if we're close enough to origin
+ this.rotationAngle = 0;
+ } else {
+ this.rotationAngle = (this.rotationAngle + (timestamp - start) * ChromeBadge.rotationSpeed) % ChromeBadge.rotationAngleMax;
+ }
+ if (this.isBusy) {
+ if (this.gapWidth < ChromeBadge.openMax) {
+ this.gapWidth += ChromeBadge.openSpeed * (timestamp - start);
+ }
+ if (this.gapWidth > ChromeBadge.openMax) {
+ this.gapWidth = ChromeBadge.openMax;
+ }
+ }
+ else {
+ if (this.gapWidth > 0) {
+ this.gapWidth--;
+ this.gapWidth *= ChromeBadge.closeSpeed;
+ }
+ }
+
+
+ if (this.isBusy || this.gapWidth > 0) {
+ start = timestamp;
+ rAF(step);
+ } else {
+ this.animationRunning = false;
+ }
+ this.draw();
+ };
+ rAF(step);
+ }
+
+ setText(s: string) {
+ chrome.browserAction.setBadgeText({text: s});
+ }
+
+ setColor(c: string) {
+ chrome.browserAction.setBadgeBackgroundColor({color: c});
+ }
+
+ startBusy() {
+ if (this.isBusy) {
+ return;
+ }
+ this.isBusy = true;
+ this.animate();
+ }
+
+ stopBusy() {
+ this.isBusy = false;
+ }
+}
diff --git a/lib/wallet/cryptoApi.ts b/lib/wallet/cryptoApi.ts
new file mode 100644
index 000000000..db29592fc
--- /dev/null
+++ b/lib/wallet/cryptoApi.ts
@@ -0,0 +1,204 @@
+/*
+ This file is part of TALER
+ (C) 2016 GNUnet e.V.
+
+ TALER is free software; you can redistribute it and/or modify it under the
+ terms of the GNU General Public License as published by the Free Software
+ Foundation; either version 3, or (at your option) any later version.
+
+ TALER is distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along with
+ TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
+ */
+
+
+/**
+ * API to access the Taler crypto worker thread.
+ * @author Florian Dold
+ */
+
+
+import {PreCoin} from "./types";
+import {Reserve} from "./types";
+import {Denomination} from "./types";
+import {Offer} from "./wallet";
+import {CoinWithDenom} from "./wallet";
+import {PayCoinInfo} from "./types";
+
+interface RegistryEntry {
+ resolve: any;
+ reject: any;
+ workerIndex: number;
+}
+
+interface WorkerState {
+ /**
+ * The actual worker thread.
+ */
+ w: Worker;
+ /**
+ * Are we currently running a task on this worker?
+ */
+ busy: boolean;
+}
+
+interface WorkItem {
+ operation: string;
+ args: any[];
+ resolve: any;
+ reject: any;
+}
+
+
+/**
+ * Number of different priorities. Each priority p
+ * must be 0 <= p < NUM_PRIO.
+ */
+const NUM_PRIO = 5;
+
+export class CryptoApi {
+ private nextRpcId: number = 1;
+ private rpcRegistry: {[n: number]: RegistryEntry} = {};
+ private workers: WorkerState[];
+ private workQueues: WorkItem[][];
+ /**
+ * Number of busy workers.
+ */
+ private numBusy: number = 0;
+ /**
+ * Number if pending work items.
+ */
+ private numWaiting: number = 0;
+
+
+ constructor() {
+ let handler = (msg: MessageEvent) => {
+ let id = msg.data.id;
+ if (typeof id !== "number") {
+ console.error("rpc id must be number");
+ return;
+ }
+ if (!this.rpcRegistry[id]) {
+ console.error(`RPC with id ${id} has no registry entry`);
+ return;
+ }
+ let {resolve, workerIndex} = this.rpcRegistry[id];
+ delete this.rpcRegistry[id];
+ let ws = this.workers[workerIndex];
+ if (!ws.busy) {
+ throw Error("assertion failed");
+ }
+ ws.busy = false;
+ this.numBusy--;
+ resolve(msg.data.result);
+
+ // try to find more work for this worker
+ for (let i = 0; i < NUM_PRIO; i++) {
+ let q = this.workQueues[NUM_PRIO - i - 1];
+ if (q.length != 0) {
+ let work: WorkItem = q.shift()!;
+ let msg: any = {
+ operation: work.operation,
+ args: work.args,
+ id: this.registerRpcId(work.resolve, work.reject, workerIndex),
+ };
+ ws.w.postMessage(msg);
+ ws.busy = true;
+ this.numBusy++;
+ return;
+ }
+ }
+ };
+
+ this.workers = new Array<WorkerState>((navigator as any)["hardwareConcurrency"] || 2);
+
+ for (let i = 0; i < this.workers.length; i++) {
+ let w = new Worker("/lib/wallet/cryptoWorker.js");
+ w.onmessage = handler;
+ this.workers[i] = {
+ w,
+ busy: false,
+ };
+ }
+ this.workQueues = [];
+ for (let i = 0; i < NUM_PRIO; i++) {
+ this.workQueues.push([]);
+ }
+ }
+
+
+ private registerRpcId(resolve: any, reject: any,
+ workerIndex: number): number {
+ let id = this.nextRpcId++;
+ this.rpcRegistry[id] = {resolve, reject, workerIndex};
+ return id;
+ }
+
+
+ private doRpc<T>(operation: string, priority: number,
+ ...args: any[]): Promise<T> {
+ if (this.numBusy == this.workers.length) {
+ let q = this.workQueues[priority];
+ if (!q) {
+ throw Error("assertion failed");
+ }
+ return new Promise<T>((resolve, reject) => {
+ this.workQueues[priority].push({operation, args, resolve, reject});
+ });
+ }
+
+ for (let i = 0; i < this.workers.length; i++) {
+ let ws = this.workers[i];
+ if (ws.busy) {
+ continue;
+ }
+
+ ws.busy = true;
+ this.numBusy++;
+
+ return new Promise<T>((resolve, reject) => {
+ let msg: any = {
+ operation, args,
+ id: this.registerRpcId(resolve, reject, i),
+ };
+ ws.w.postMessage(msg);
+ });
+ }
+
+ throw Error("assertion failed");
+ }
+
+
+ createPreCoin(denom: Denomination, reserve: Reserve): Promise<PreCoin> {
+ return this.doRpc("createPreCoin", 1, denom, reserve);
+ }
+
+ hashString(str: string): Promise<string> {
+ return this.doRpc("hashString", 1, str);
+ }
+
+ hashRsaPub(rsaPub: string): Promise<string> {
+ return this.doRpc("hashRsaPub", 2, rsaPub);
+ }
+
+ isValidDenom(denom: Denomination,
+ masterPub: string): Promise<boolean> {
+ return this.doRpc("isValidDenom", 2, denom, masterPub);
+ }
+
+ signDeposit(offer: Offer,
+ cds: CoinWithDenom[]): Promise<PayCoinInfo> {
+ return this.doRpc("signDeposit", 3, offer, cds);
+ }
+
+ createEddsaKeypair(): Promise<{priv: string, pub: string}> {
+ return this.doRpc("createEddsaKeypair", 1);
+ }
+
+ rsaUnblind(sig: string, bk: string, pk: string): Promise<string> {
+ return this.doRpc("rsaUnblind", 4, sig, bk, pk);
+ }
+}
diff --git a/lib/wallet/cryptoLib.ts b/lib/wallet/cryptoLib.ts
new file mode 100644
index 000000000..9a77b3d74
--- /dev/null
+++ b/lib/wallet/cryptoLib.ts
@@ -0,0 +1,227 @@
+/*
+ This file is part of TALER
+ (C) 2016 GNUnet e.V.
+
+ TALER is free software; you can redistribute it and/or modify it under the
+ terms of the GNU General Public License as published by the Free Software
+ Foundation; either version 3, or (at your option) any later version.
+
+ TALER is distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along with
+ TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
+ */
+
+/**
+ * Web worker for crypto operations.
+ * @author Florian Dold
+ */
+
+"use strict";
+
+import * as native from "./emscriptif";
+import {PreCoin, Reserve, PayCoinInfo} from "./types";
+import create = chrome.alarms.create;
+import {Offer} from "./wallet";
+import {CoinWithDenom} from "./wallet";
+import {CoinPaySig} from "./types";
+import {Denomination} from "./types";
+import {Amount} from "./emscriptif";
+
+
+export function main(worker: Worker) {
+ worker.onmessage = (msg: MessageEvent) => {
+ if (!Array.isArray(msg.data.args)) {
+ console.error("args must be array");
+ return;
+ }
+ if (typeof msg.data.id != "number") {
+ console.error("RPC id must be number");
+ }
+ if (typeof msg.data.operation != "string") {
+ console.error("RPC operation must be string");
+ }
+ let f = (RpcFunctions as any)[msg.data.operation];
+ if (!f) {
+ console.error(`unknown operation: '${msg.data.operation}'`);
+ return;
+ }
+ let res = f(...msg.data.args);
+ worker.postMessage({result: res, id: msg.data.id});
+ }
+}
+
+
+namespace RpcFunctions {
+
+ /**
+ * Create a pre-coin of the given denomination to be withdrawn from then given
+ * reserve.
+ */
+ export function createPreCoin(denom: Denomination,
+ reserve: Reserve): PreCoin {
+ let reservePriv = new native.EddsaPrivateKey();
+ reservePriv.loadCrock(reserve.reserve_priv);
+ let reservePub = new native.EddsaPublicKey();
+ reservePub.loadCrock(reserve.reserve_pub);
+ let denomPub = native.RsaPublicKey.fromCrock(denom.denom_pub);
+ let coinPriv = native.EddsaPrivateKey.create();
+ let coinPub = coinPriv.getPublicKey();
+ let blindingFactor = native.RsaBlindingKeySecret.create();
+ let pubHash: native.HashCode = coinPub.hash();
+ let ev: native.ByteArray = native.rsaBlind(pubHash,
+ blindingFactor,
+ denomPub);
+
+ if (!denom.fee_withdraw) {
+ throw Error("Field fee_withdraw missing");
+ }
+
+ let amountWithFee = new native.Amount(denom.value);
+ amountWithFee.add(new native.Amount(denom.fee_withdraw));
+ let withdrawFee = new native.Amount(denom.fee_withdraw);
+
+ // Signature
+ let withdrawRequest = new native.WithdrawRequestPS({
+ reserve_pub: reservePub,
+ amount_with_fee: amountWithFee.toNbo(),
+ withdraw_fee: withdrawFee.toNbo(),
+ h_denomination_pub: denomPub.encode().hash(),
+ h_coin_envelope: ev.hash()
+ });
+
+ var sig = native.eddsaSign(withdrawRequest.toPurpose(), reservePriv);
+
+ let preCoin: PreCoin = {
+ reservePub: reservePub.toCrock(),
+ blindingKey: blindingFactor.toCrock(),
+ coinPub: coinPub.toCrock(),
+ coinPriv: coinPriv.toCrock(),
+ denomPub: denomPub.encode().toCrock(),
+ exchangeBaseUrl: reserve.exchange_base_url,
+ withdrawSig: sig.toCrock(),
+ coinEv: ev.toCrock(),
+ coinValue: denom.value
+ };
+ return preCoin;
+ }
+
+
+ export function isValidDenom(denom: Denomination,
+ masterPub: string): boolean {
+ let p = new native.DenominationKeyValidityPS({
+ master: native.EddsaPublicKey.fromCrock(masterPub),
+ denom_hash: native.RsaPublicKey.fromCrock(denom.denom_pub)
+ .encode()
+ .hash(),
+ expire_legal: native.AbsoluteTimeNbo.fromTalerString(denom.stamp_expire_legal),
+ expire_spend: native.AbsoluteTimeNbo.fromTalerString(denom.stamp_expire_deposit),
+ expire_withdraw: native.AbsoluteTimeNbo.fromTalerString(denom.stamp_expire_withdraw),
+ start: native.AbsoluteTimeNbo.fromTalerString(denom.stamp_start),
+ value: (new native.Amount(denom.value)).toNbo(),
+ fee_deposit: (new native.Amount(denom.fee_deposit)).toNbo(),
+ fee_refresh: (new native.Amount(denom.fee_refresh)).toNbo(),
+ fee_withdraw: (new native.Amount(denom.fee_withdraw)).toNbo(),
+ fee_refund: (new native.Amount(denom.fee_refund)).toNbo(),
+ });
+
+ let nativeSig = new native.EddsaSignature();
+ nativeSig.loadCrock(denom.master_sig);
+
+ let nativePub = native.EddsaPublicKey.fromCrock(masterPub);
+
+ return native.eddsaVerify(native.SignaturePurpose.MASTER_DENOMINATION_KEY_VALIDITY,
+ p.toPurpose(),
+ nativeSig,
+ nativePub);
+
+ }
+
+ export function hashString(str: string): string {
+ const b = native.ByteArray.fromString(str);
+ return b.hash().toCrock();
+ }
+
+
+ export function hashRsaPub(rsaPub: string): string {
+ return native.RsaPublicKey.fromCrock(rsaPub)
+ .encode()
+ .hash()
+ .toCrock();
+ }
+
+
+ export function createEddsaKeypair(): {priv: string, pub: string} {
+ const priv = native.EddsaPrivateKey.create();
+ const pub = priv.getPublicKey();
+ return {priv: priv.toCrock(), pub: pub.toCrock()};
+ }
+
+
+ export function rsaUnblind(sig: string, bk: string, pk: string): string {
+ let denomSig = native.rsaUnblind(native.RsaSignature.fromCrock(sig),
+ native.RsaBlindingKeySecret.fromCrock(bk),
+ native.RsaPublicKey.fromCrock(pk));
+ return denomSig.encode().toCrock()
+ }
+
+
+ /**
+ * Generate updated coins (to store in the database)
+ * and deposit permissions for each given coin.
+ */
+ export function signDeposit(offer: Offer,
+ cds: CoinWithDenom[]): PayCoinInfo {
+ let ret: PayCoinInfo = [];
+ let amountSpent = native.Amount.getZero(cds[0].coin.currentAmount.currency);
+ let amountRemaining = new native.Amount(offer.contract.amount);
+ for (let cd of cds) {
+ let coinSpend: Amount;
+
+ if (amountRemaining.value == 0 && amountRemaining.fraction == 0) {
+ break;
+ }
+
+ if (amountRemaining.cmp(new native.Amount(cd.coin.currentAmount)) < 0) {
+ coinSpend = new native.Amount(amountRemaining.toJson());
+ } else {
+ coinSpend = new native.Amount(cd.coin.currentAmount);
+ }
+
+ amountSpent.add(coinSpend);
+ amountRemaining.sub(coinSpend);
+
+ let newAmount = new native.Amount(cd.coin.currentAmount);
+ newAmount.sub(coinSpend);
+ cd.coin.currentAmount = newAmount.toJson();
+
+ let d = new native.DepositRequestPS({
+ h_contract: native.HashCode.fromCrock(offer.H_contract),
+ h_wire: native.HashCode.fromCrock(offer.contract.H_wire),
+ amount_with_fee: coinSpend.toNbo(),
+ coin_pub: native.EddsaPublicKey.fromCrock(cd.coin.coinPub),
+ deposit_fee: new native.Amount(cd.denom.fee_deposit).toNbo(),
+ merchant: native.EddsaPublicKey.fromCrock(offer.contract.merchant_pub),
+ refund_deadline: native.AbsoluteTimeNbo.fromTalerString(offer.contract.refund_deadline),
+ timestamp: native.AbsoluteTimeNbo.fromTalerString(offer.contract.timestamp),
+ transaction_id: native.UInt64.fromNumber(offer.contract.transaction_id),
+ });
+
+ let coinSig = native.eddsaSign(d.toPurpose(),
+ native.EddsaPrivateKey.fromCrock(cd.coin.coinPriv))
+ .toCrock();
+
+ let s: CoinPaySig = {
+ coin_sig: coinSig,
+ coin_pub: cd.coin.coinPub,
+ ub_sig: cd.coin.denomSig,
+ denom_pub: cd.coin.denomPub,
+ f: coinSpend.toJson(),
+ };
+ ret.push({sig: s, updatedCoin: cd.coin});
+ }
+ return ret;
+ }
+}
diff --git a/lib/wallet/cryptoWorker.ts b/lib/wallet/cryptoWorker.ts
new file mode 100644
index 000000000..4483c64e6
--- /dev/null
+++ b/lib/wallet/cryptoWorker.ts
@@ -0,0 +1,61 @@
+/*
+ This file is part of TALER
+ (C) 2016 GNUnet e.V.
+
+ TALER is free software; you can redistribute it and/or modify it under the
+ terms of the GNU General Public License as published by the Free Software
+ Foundation; either version 3, or (at your option) any later version.
+
+ TALER is distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along with
+ TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
+ */
+
+/**
+ * Web worker for crypto operations.
+ * @author Florian Dold
+ */
+
+"use strict";
+
+
+importScripts("../emscripten/libwrapper.js",
+ "../vendor/system-csp-production.src.js");
+
+
+// TypeScript does not allow ".js" extensions in the
+// module name, so SystemJS must add it.
+System.config({
+ defaultJSExtensions: true,
+ });
+
+// We expect that in the manifest, the emscripten js is loaded
+// becore the background page.
+// Currently it is not possible to use SystemJS to load the emscripten js.
+declare var Module: any;
+if ("object" !== typeof Module) {
+ throw Error("emscripten not loaded, no 'Module' defined");
+}
+
+
+// Manually register the emscripten js as a SystemJS, so that
+// we can use it from TypeScript by importing it.
+
+{
+ let mod = System.newModule({Module: Module});
+ let modName = System.normalizeSync("../emscripten/emsc");
+ console.log("registering", modName);
+ System.set(modName, mod);
+}
+
+System.import("./cryptoLib")
+ .then((m) => {
+ m.main(self);
+ })
+ .catch((e) => {
+ console.log("crypto worker failed");
+ console.error(e.stack);
+ }); \ No newline at end of file
diff --git a/lib/wallet/db.ts b/lib/wallet/db.ts
new file mode 100644
index 000000000..5104f28fb
--- /dev/null
+++ b/lib/wallet/db.ts
@@ -0,0 +1,119 @@
+/*
+ This file is part of TALER
+ (C) 2016 GNUnet e.V.
+
+ TALER is free software; you can redistribute it and/or modify it under the
+ terms of the GNU General Public License as published by the Free Software
+ Foundation; either version 3, or (at your option) any later version.
+
+ TALER is distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along with
+ TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
+ */
+
+"use strict";
+import Dictionary = _.Dictionary;
+
+/**
+ * Declarations and helpers for
+ * things that are stored in the wallet's
+ * database.
+ * @module Db
+ * @author Florian Dold
+ */
+
+const DB_NAME = "taler";
+const DB_VERSION = 7;
+
+/**
+ * Return a promise that resolves
+ * to the taler wallet db.
+ */
+export function openTalerDb(): Promise<IDBDatabase> {
+ return new Promise((resolve, reject) => {
+ const req = indexedDB.open(DB_NAME, DB_VERSION);
+ req.onerror = (e) => {
+ reject(e);
+ };
+ req.onsuccess = (e) => {
+ resolve(req.result);
+ };
+ req.onupgradeneeded = (e) => {
+ const db = req.result;
+ console.log("DB: upgrade needed: oldVersion = " + e.oldVersion);
+ switch (e.oldVersion) {
+ case 0: // DB does not exist yet
+ const exchanges = db.createObjectStore("exchanges",
+ {keyPath: "baseUrl"});
+ exchanges.createIndex("pubKey", "masterPublicKey");
+ db.createObjectStore("reserves", {keyPath: "reserve_pub"});
+ const coins = db.createObjectStore("coins", {keyPath: "coinPub"});
+ coins.createIndex("exchangeBaseUrl", "exchangeBaseUrl");
+ const transactions = db.createObjectStore("transactions",
+ {keyPath: "contractHash"});
+ transactions.createIndex("repurchase",
+ [
+ "contract.merchant_pub",
+ "contract.repurchase_correlation_id"
+ ]);
+
+ db.createObjectStore("precoins",
+ {keyPath: "coinPub", autoIncrement: true});
+ const history = db.createObjectStore("history",
+ {
+ keyPath: "id",
+ autoIncrement: true
+ });
+ history.createIndex("timestamp", "timestamp");
+ break;
+ default:
+ if (e.oldVersion != DB_VERSION) {
+ window.alert("Incompatible wallet dababase version, please reset" +
+ " db.");
+ chrome.browserAction.setBadgeText({text: "R!"});
+ chrome.browserAction.setBadgeBackgroundColor({color: "#F00"});
+ throw Error("incompatible DB");
+ }
+ break;
+ }
+ };
+ });
+}
+
+
+export function exportDb(db: IDBDatabase): Promise<any> {
+ let dump = {
+ name: db.name,
+ version: db.version,
+ stores: {} as Dictionary<any>,
+ };
+
+ return new Promise((resolve, reject) => {
+
+ let tx = db.transaction(Array.from(db.objectStoreNames));
+ tx.addEventListener("complete", () => {
+ resolve(dump);
+ });
+ for (let i = 0; i < db.objectStoreNames.length; i++) {
+ let name = db.objectStoreNames[i];
+ let storeDump = {} as Dictionary<any>;
+ dump.stores[name] = storeDump;
+ let store = tx.objectStore(name)
+ .openCursor()
+ .addEventListener("success", (e: Event) => {
+ let cursor = (e.target as any).result;
+ if (cursor) {
+ storeDump[cursor.key] = cursor.value;
+ cursor.continue();
+ }
+ });
+ }
+ });
+}
+
+export function deleteDb() {
+ indexedDB.deleteDatabase(DB_NAME);
+} \ No newline at end of file
diff --git a/lib/wallet/emscriptif.ts b/lib/wallet/emscriptif.ts
new file mode 100644
index 000000000..5879300e7
--- /dev/null
+++ b/lib/wallet/emscriptif.ts
@@ -0,0 +1,1033 @@
+/*
+ This file is part of TALER
+ (C) 2015 GNUnet e.V.
+
+ TALER is free software; you can redistribute it and/or modify it under the
+ terms of the GNU General Public License as published by the Free Software
+ Foundation; either version 3, or (at your option) any later version.
+
+ TALER is distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along with
+ TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
+ */
+
+import {AmountJson} from "./types";
+import * as EmscWrapper from "../emscripten/emsc";
+
+/**
+ * High-level interface to emscripten-compiled modules used
+ * by the wallet.
+ * @module EmscriptIf
+ * @author Florian Dold
+ */
+
+"use strict";
+
+// Size of a native pointer.
+const PTR_SIZE = 4;
+
+const GNUNET_OK = 1;
+const GNUNET_YES = 1;
+const GNUNET_NO = 0;
+const GNUNET_SYSERR = -1;
+
+let Module = EmscWrapper.Module;
+
+let getEmsc: EmscWrapper.EmscFunGen = (...args: any[]) => Module.cwrap.apply(
+ null,
+ args);
+
+var emsc = {
+ free: (ptr: number) => Module._free(ptr),
+ get_value: getEmsc('TALER_WR_get_value',
+ 'number',
+ ['number']),
+ get_fraction: getEmsc('TALER_WR_get_fraction',
+ 'number',
+ ['number']),
+ get_currency: getEmsc('TALER_WR_get_currency',
+ 'string',
+ ['number']),
+ amount_add: getEmsc('TALER_amount_add',
+ 'number',
+ ['number', 'number', 'number']),
+ amount_subtract: getEmsc('TALER_amount_subtract',
+ 'number',
+ ['number', 'number', 'number']),
+ amount_normalize: getEmsc('TALER_amount_normalize',
+ 'void',
+ ['number']),
+ amount_get_zero: getEmsc('TALER_amount_get_zero',
+ 'number',
+ ['string', 'number']),
+ amount_cmp: getEmsc('TALER_amount_cmp',
+ 'number',
+ ['number', 'number']),
+ amount_hton: getEmsc('TALER_amount_hton',
+ 'void',
+ ['number', 'number']),
+ amount_ntoh: getEmsc('TALER_amount_ntoh',
+ 'void',
+ ['number', 'number']),
+ hash: getEmsc('GNUNET_CRYPTO_hash',
+ 'void',
+ ['number', 'number', 'number']),
+ memmove: getEmsc('memmove',
+ 'number',
+ ['number', 'number', 'number']),
+ rsa_public_key_free: getEmsc('GNUNET_CRYPTO_rsa_public_key_free',
+ 'void',
+ ['number']),
+ rsa_signature_free: getEmsc('GNUNET_CRYPTO_rsa_signature_free',
+ 'void',
+ ['number']),
+ string_to_data: getEmsc('GNUNET_STRINGS_string_to_data',
+ 'number',
+ ['number', 'number', 'number', 'number']),
+ eddsa_sign: getEmsc('GNUNET_CRYPTO_eddsa_sign',
+ 'number',
+ ['number', 'number', 'number']),
+ eddsa_verify: getEmsc('GNUNET_CRYPTO_eddsa_verify',
+ 'number',
+ ['number', 'number', 'number', 'number']),
+ hash_create_random: getEmsc('GNUNET_CRYPTO_hash_create_random',
+ 'void',
+ ['number', 'number']),
+ rsa_blinding_key_destroy: getEmsc('GNUNET_CRYPTO_rsa_blinding_key_free',
+ 'void',
+ ['number']),
+ random_block: getEmsc('GNUNET_CRYPTO_random_block',
+ 'void',
+ ['number', 'number', 'number']),
+};
+
+var emscAlloc = {
+ get_amount: getEmsc('TALER_WRALL_get_amount',
+ 'number',
+ ['number', 'number', 'number', 'string']),
+ eddsa_key_create: getEmsc('GNUNET_CRYPTO_eddsa_key_create',
+ 'number', []),
+ eddsa_public_key_from_private: getEmsc(
+ 'TALER_WRALL_eddsa_public_key_from_private',
+ 'number',
+ ['number']),
+ data_to_string_alloc: getEmsc('GNUNET_STRINGS_data_to_string_alloc',
+ 'number',
+ ['number', 'number']),
+ purpose_create: getEmsc('TALER_WRALL_purpose_create',
+ 'number',
+ ['number', 'number', 'number']),
+ rsa_blind: getEmsc('GNUNET_CRYPTO_rsa_blind',
+ 'number',
+ ['number', 'number', 'number', 'number']),
+ rsa_blinding_key_create: getEmsc('GNUNET_CRYPTO_rsa_blinding_key_create',
+ 'number',
+ ['number']),
+ rsa_blinding_key_encode: getEmsc('GNUNET_CRYPTO_rsa_blinding_key_encode',
+ 'number',
+ ['number', 'number']),
+ rsa_signature_encode: getEmsc('GNUNET_CRYPTO_rsa_signature_encode',
+ 'number',
+ ['number', 'number']),
+ rsa_blinding_key_decode: getEmsc('GNUNET_CRYPTO_rsa_blinding_key_decode',
+ 'number',
+ ['number', 'number']),
+ rsa_public_key_decode: getEmsc('GNUNET_CRYPTO_rsa_public_key_decode',
+ 'number',
+ ['number', 'number']),
+ rsa_signature_decode: getEmsc('GNUNET_CRYPTO_rsa_signature_decode',
+ 'number',
+ ['number', 'number']),
+ rsa_public_key_encode: getEmsc('GNUNET_CRYPTO_rsa_public_key_encode',
+ 'number',
+ ['number', 'number']),
+ rsa_unblind: getEmsc('GNUNET_CRYPTO_rsa_unblind',
+ 'number',
+ ['number', 'number', 'number']),
+ malloc: (size: number) => Module._malloc(size),
+};
+
+
+export enum SignaturePurpose {
+ RESERVE_WITHDRAW = 1200,
+ WALLET_COIN_DEPOSIT = 1201,
+ MASTER_DENOMINATION_KEY_VALIDITY = 1025,
+}
+
+enum RandomQuality {
+ WEAK = 0,
+ STRONG = 1,
+ NONCE = 2
+}
+
+
+abstract class ArenaObject {
+ protected _nativePtr: number | undefined = undefined;
+ arena: Arena;
+
+ abstract destroy(): void;
+
+ constructor(arena?: Arena) {
+ if (!arena) {
+ if (arenaStack.length == 0) {
+ throw Error("No arena available")
+ }
+ arena = arenaStack[arenaStack.length - 1];
+ }
+ arena.put(this);
+ this.arena = arena;
+ }
+
+ getNative(): number {
+ // We want to allow latent allocation
+ // of native wrappers, but we never want to
+ // pass 'undefined' to emscripten.
+ if (this._nativePtr === undefined) {
+ throw Error("Native pointer not initialized");
+ }
+ return this._nativePtr;
+ }
+
+ free() {
+ if (this.nativePtr) {
+ emsc.free(this.nativePtr);
+ this._nativePtr = undefined;
+ }
+ }
+
+ alloc(size: number) {
+ if (this._nativePtr !== undefined) {
+ throw Error("Double allocation");
+ }
+ this.nativePtr = emscAlloc.malloc(size);
+ }
+
+ setNative(n: number) {
+ if (n === undefined) {
+ throw Error("Native pointer must be a number or null");
+ }
+ this._nativePtr = n;
+ }
+
+ set nativePtr(v: number) {
+ this.setNative(v);
+ }
+
+ get nativePtr() {
+ return this.getNative();
+ }
+}
+
+
+interface Arena {
+ put(obj: ArenaObject): void;
+ destroy(): void;
+}
+
+
+class DefaultArena implements Arena {
+ heap: Array<ArenaObject>;
+
+ constructor() {
+ this.heap = [];
+ }
+
+ put(obj: ArenaObject) {
+ this.heap.push(obj);
+ }
+
+ destroy() {
+ for (let obj of this.heap) {
+ obj.destroy();
+ }
+ this.heap = []
+ }
+}
+
+
+function mySetTimeout(ms: number, fn: () => void) {
+ // We need to use different timeouts, depending on whether
+ // we run in node or a web extension
+ if ("function" === typeof setTimeout) {
+ setTimeout(fn, ms);
+ } else {
+ chrome.extension.getBackgroundPage().setTimeout(fn, ms);
+ }
+}
+
+
+/**
+ * Arena that destroys all its objects once control has returned to the message
+ * loop and a small interval has passed.
+ */
+class SyncArena extends DefaultArena {
+ private isScheduled: boolean;
+
+ constructor() {
+ super();
+ }
+
+ pub(obj: ArenaObject) {
+ super.put(obj);
+ if (!this.isScheduled) {
+ this.schedule();
+ }
+ this.heap.push(obj);
+ }
+
+ destroy() {
+ super.destroy();
+ }
+
+ private schedule() {
+ this.isScheduled = true;
+ mySetTimeout(50, () => {
+ this.isScheduled = false;
+ this.destroy();
+ });
+ }
+}
+
+let arenaStack: Arena[] = [];
+arenaStack.push(new SyncArena());
+
+
+export class Amount extends ArenaObject {
+ constructor(args?: AmountJson, arena?: Arena) {
+ super(arena);
+ if (args) {
+ this.nativePtr = emscAlloc.get_amount(args.value,
+ 0,
+ args.fraction,
+ args.currency);
+ } else {
+ this.nativePtr = emscAlloc.get_amount(0, 0, 0, "");
+ }
+ }
+
+ destroy() {
+ super.free();
+ }
+
+
+ static getZero(currency: string, a?: Arena): Amount {
+ let am = new Amount(undefined, a);
+ let r = emsc.amount_get_zero(currency, am.getNative());
+ if (r != GNUNET_OK) {
+ throw Error("invalid currency");
+ }
+ return am;
+ }
+
+
+ toNbo(a?: Arena): AmountNbo {
+ let x = new AmountNbo(a);
+ x.alloc();
+ emsc.amount_hton(x.nativePtr, this.nativePtr);
+ return x;
+ }
+
+ fromNbo(nbo: AmountNbo): void {
+ emsc.amount_ntoh(this.nativePtr, nbo.nativePtr);
+ }
+
+ get value() {
+ return emsc.get_value(this.nativePtr);
+ }
+
+ get fraction() {
+ return emsc.get_fraction(this.nativePtr);
+ }
+
+ get currency(): String {
+ return emsc.get_currency(this.nativePtr);
+ }
+
+ toJson(): AmountJson {
+ return {
+ value: emsc.get_value(this.nativePtr),
+ fraction: emsc.get_fraction(this.nativePtr),
+ currency: emsc.get_currency(this.nativePtr)
+ };
+ }
+
+ /**
+ * Add an amount to this amount.
+ */
+ add(a: Amount) {
+ let res = emsc.amount_add(this.nativePtr, a.nativePtr, this.nativePtr);
+ if (res < 1) {
+ // Overflow
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * Perform saturating subtraction on amounts.
+ */
+ sub(a: Amount) {
+ // this = this - a
+ let res = emsc.amount_subtract(this.nativePtr, this.nativePtr, a.nativePtr);
+ if (res == 0) {
+ // Underflow
+ return false;
+ }
+ if (res > 0) {
+ return true;
+ }
+ throw Error("Incompatible currencies");
+ }
+
+ cmp(a: Amount) {
+ // If we don't check this, the c code aborts.
+ if (this.currency !== a.currency) {
+ throw Error(`incomparable currencies (${this.currency} and ${a.currency})`);
+ }
+ return emsc.amount_cmp(this.nativePtr, a.nativePtr);
+ }
+
+ normalize() {
+ emsc.amount_normalize(this.nativePtr);
+ }
+}
+
+
+/**
+ * Count the UTF-8 characters in a JavaScript string.
+ */
+function countBytes(str: string): number {
+ var s = str.length;
+ // JavaScript strings are UTF-16 arrays
+ for (let i = str.length - 1; i >= 0; i--) {
+ var code = str.charCodeAt(i);
+ if (code > 0x7f && code <= 0x7ff) {
+ // We need an extra byte in utf-8 here
+ s++;
+ } else if (code > 0x7ff && code <= 0xffff) {
+ // We need two extra bytes in utf-8 here
+ s += 2;
+ }
+ // Skip over the other surrogate
+ if (code >= 0xDC00 && code <= 0xDFFF) {
+ i--;
+ }
+ }
+ return s;
+}
+
+
+/**
+ * Managed reference to a contiguous block of memory in the Emscripten heap.
+ * Should contain only data, not pointers.
+ */
+abstract class PackedArenaObject extends ArenaObject {
+ abstract size(): number;
+
+ constructor(a?: Arena) {
+ super(a);
+ }
+
+ randomize(qual: RandomQuality = RandomQuality.STRONG): void {
+ emsc.random_block(qual, this.nativePtr, this.size());
+ }
+
+ toCrock(): string {
+ var d = emscAlloc.data_to_string_alloc(this.nativePtr, this.size());
+ var s = Module.Pointer_stringify(d);
+ emsc.free(d);
+ return s;
+ }
+
+ toJson(): any {
+ // Per default, the json encoding of
+ // packed arena objects is just the crockford encoding.
+ // Subclasses typically want to override this.
+ return this.toCrock();
+ }
+
+ loadCrock(s: string) {
+ this.alloc();
+ // We need to get the javascript string
+ // to the emscripten heap first.
+ let buf = ByteArray.fromString(s);
+ let res = emsc.string_to_data(buf.nativePtr,
+ s.length,
+ this.nativePtr,
+ this.size());
+ buf.destroy();
+ if (res < 1) {
+ throw {error: "wrong encoding"};
+ }
+ }
+
+ alloc() {
+ // FIXME: should the client be allowed to call alloc multiple times?
+ if (!this._nativePtr) {
+ this.nativePtr = emscAlloc.malloc(this.size());
+ }
+ }
+
+ destroy() {
+ emsc.free(this.nativePtr);
+ this.nativePtr = 0;
+ }
+
+ hash(): HashCode {
+ var x = new HashCode();
+ x.alloc();
+ emsc.hash(this.nativePtr, this.size(), x.nativePtr);
+ return x;
+ }
+
+ hexdump() {
+ let bytes: string[] = [];
+ for (let i = 0; i < this.size(); i++) {
+ let b = Module.getValue(this.getNative() + i, "i8");
+ b = (b + 256) % 256;
+ bytes.push("0".concat(b.toString(16)).slice(-2));
+ }
+ let lines: string[] = [];
+ for (let i = 0; i < bytes.length; i += 8) {
+ lines.push(bytes.slice(i, i + 8).join(","));
+ }
+ return lines.join("\n");
+ }
+}
+
+
+export class AmountNbo extends PackedArenaObject {
+ size() {
+ return 24;
+ }
+
+ toJson(): any {
+ let a = new DefaultArena();
+ let am = new Amount(undefined, a);
+ am.fromNbo(this);
+ let json = am.toJson();
+ a.destroy();
+ return json;
+ }
+}
+
+
+export class EddsaPrivateKey extends PackedArenaObject {
+ static create(a?: Arena): EddsaPrivateKey {
+ let obj = new EddsaPrivateKey(a);
+ obj.nativePtr = emscAlloc.eddsa_key_create();
+ return obj;
+ }
+
+ size() {
+ return 32;
+ }
+
+ getPublicKey(a?: Arena): EddsaPublicKey {
+ let obj = new EddsaPublicKey(a);
+ obj.nativePtr = emscAlloc.eddsa_public_key_from_private(this.nativePtr);
+ return obj;
+ }
+
+ static fromCrock: (s: string) => EddsaPrivateKey;
+}
+mixinStatic(EddsaPrivateKey, fromCrock);
+
+
+function fromCrock(s: string) {
+ let x = new this();
+ x.alloc();
+ x.loadCrock(s);
+ return x;
+}
+
+
+function mixin(obj: any, method: any, name?: string) {
+ if (!name) {
+ name = method.name;
+ }
+ if (!name) {
+ throw Error("Mixin needs a name.");
+ }
+ obj.prototype[method.name] = method;
+}
+
+
+function mixinStatic(obj: any, method: any, name?: string) {
+ if (!name) {
+ name = method.name;
+ }
+ if (!name) {
+ throw Error("Mixin needs a name.");
+ }
+ obj[method.name] = method;
+}
+
+
+export class EddsaPublicKey extends PackedArenaObject {
+ size() {
+ return 32;
+ }
+
+ static fromCrock: (s: string) => EddsaPublicKey;
+}
+mixinStatic(EddsaPublicKey, fromCrock);
+
+function makeFromCrock(decodeFn: (p: number, s: number) => number) {
+ function fromCrock(s: string, a?: Arena) {
+ let obj = new this(a);
+ let buf = ByteArray.fromCrock(s);
+ obj.setNative(decodeFn(buf.getNative(),
+ buf.size()));
+ buf.destroy();
+ return obj;
+ }
+
+ return fromCrock;
+}
+
+function makeToCrock(encodeFn: (po: number,
+ ps: number) => number): () => string {
+ function toCrock() {
+ let ptr = emscAlloc.malloc(PTR_SIZE);
+ let size = emscAlloc.rsa_blinding_key_encode(this.nativePtr, ptr);
+ let res = new ByteArray(size, Module.getValue(ptr, '*'));
+ let s = res.toCrock();
+ emsc.free(ptr);
+ res.destroy();
+ return s;
+ }
+
+ return toCrock;
+}
+
+export class RsaBlindingKeySecret extends PackedArenaObject {
+ size() {
+ return 32;
+ }
+
+ /**
+ * Create a random blinding key secret.
+ */
+ static create(a?: Arena): RsaBlindingKeySecret {
+ let o = new RsaBlindingKeySecret(a);
+ o.alloc();
+ o.randomize();
+ return o;
+ }
+
+ static fromCrock: (s: string) => RsaBlindingKeySecret;
+}
+mixinStatic(RsaBlindingKeySecret, fromCrock);
+
+
+export class HashCode extends PackedArenaObject {
+ size() {
+ return 64;
+ }
+
+ static fromCrock: (s: string) => HashCode;
+
+ random(qual: RandomQuality = RandomQuality.STRONG) {
+ this.alloc();
+ emsc.hash_create_random(qual, this.nativePtr);
+ }
+}
+mixinStatic(HashCode, fromCrock);
+
+
+export class ByteArray extends PackedArenaObject {
+ private allocatedSize: number;
+
+ size() {
+ return this.allocatedSize;
+ }
+
+ constructor(desiredSize: number, init?: number, a?: Arena) {
+ super(a);
+ if (init === undefined) {
+ this.nativePtr = emscAlloc.malloc(desiredSize);
+ } else {
+ this.nativePtr = init;
+ }
+ this.allocatedSize = desiredSize;
+ }
+
+ static fromString(s: string, a?: Arena): ByteArray {
+ // UTF-8 bytes, including 0-terminator
+ let terminatedByteLength = countBytes(s) + 1;
+ let hstr = emscAlloc.malloc(terminatedByteLength);
+ Module.stringToUTF8(s, hstr, terminatedByteLength);
+ return new ByteArray(terminatedByteLength, hstr, a);
+ }
+
+ static fromCrock(s: string, a?: Arena): ByteArray {
+ let byteLength = countBytes(s);
+ let hstr = emscAlloc.malloc(byteLength + 1);
+ Module.stringToUTF8(s, hstr, byteLength + 1);
+ let decodedLen = Math.floor((byteLength * 5) / 8);
+ let ba = new ByteArray(decodedLen, undefined, a);
+ let res = emsc.string_to_data(hstr, byteLength, ba.nativePtr, decodedLen);
+ emsc.free(hstr);
+ if (res != GNUNET_OK) {
+ throw Error("decoding failed");
+ }
+ return ba;
+ }
+}
+
+
+export class EccSignaturePurpose extends PackedArenaObject {
+ size() {
+ return this.payloadSize + 8;
+ }
+
+ payloadSize: number;
+
+ constructor(purpose: SignaturePurpose,
+ payload: PackedArenaObject,
+ a?: Arena) {
+ super(a);
+ this.nativePtr = emscAlloc.purpose_create(purpose,
+ payload.nativePtr,
+ payload.size());
+ this.payloadSize = payload.size();
+ }
+}
+
+
+abstract class SignatureStruct {
+ abstract fieldTypes(): Array<any>;
+
+ abstract purpose(): SignaturePurpose;
+
+ private members: any = {};
+
+ constructor(x: { [name: string]: any }) {
+ for (let k in x) {
+ this.set(k, x[k]);
+ }
+ }
+
+ toPurpose(a?: Arena): EccSignaturePurpose {
+ let totalSize = 0;
+ for (let f of this.fieldTypes()) {
+ let name = f[0];
+ let member = this.members[name];
+ if (!member) {
+ throw Error(`Member ${name} not set`);
+ }
+ totalSize += member.size();
+ }
+
+ let buf = emscAlloc.malloc(totalSize);
+ let ptr = buf;
+ for (let f of this.fieldTypes()) {
+ let name = f[0];
+ let member = this.members[name];
+ let size = member.size();
+ emsc.memmove(ptr, member.nativePtr, size);
+ ptr += size;
+ }
+ let ba = new ByteArray(totalSize, buf, a);
+ return new EccSignaturePurpose(this.purpose(), ba);
+ }
+
+
+ toJson() {
+ let res: any = {};
+ for (let f of this.fieldTypes()) {
+ let name = f[0];
+ let member = this.members[name];
+ if (!member) {
+ throw Error(`Member ${name} not set`);
+ }
+ res[name] = member.toJson();
+ }
+ res["purpose"] = this.purpose();
+ return res;
+ }
+
+ protected set(name: string, value: PackedArenaObject) {
+ let typemap: any = {};
+ for (let f of this.fieldTypes()) {
+ typemap[f[0]] = f[1];
+ }
+ if (!(name in typemap)) {
+ throw Error(`Key ${name} not found`);
+ }
+ if (!(value instanceof typemap[name])) {
+ throw Error("Wrong type for ${name}");
+ }
+ this.members[name] = value;
+ }
+}
+
+
+// It's redundant, but more type safe.
+export interface WithdrawRequestPS_Args {
+ reserve_pub: EddsaPublicKey;
+ amount_with_fee: AmountNbo;
+ withdraw_fee: AmountNbo;
+ h_denomination_pub: HashCode;
+ h_coin_envelope: HashCode;
+}
+
+
+export class WithdrawRequestPS extends SignatureStruct {
+ constructor(w: WithdrawRequestPS_Args) {
+ super(w);
+ }
+
+ purpose() {
+ return SignaturePurpose.RESERVE_WITHDRAW;
+ }
+
+ fieldTypes() {
+ return [
+ ["reserve_pub", EddsaPublicKey],
+ ["amount_with_fee", AmountNbo],
+ ["withdraw_fee", AmountNbo],
+ ["h_denomination_pub", HashCode],
+ ["h_coin_envelope", HashCode]
+ ];
+ }
+}
+
+
+export class AbsoluteTimeNbo extends PackedArenaObject {
+ static fromTalerString(s: string): AbsoluteTimeNbo {
+ let x = new AbsoluteTimeNbo();
+ x.alloc();
+ let r = /Date\(([0-9]+)\)/;
+ let m = r.exec(s);
+ if (!m || m.length != 2) {
+ throw Error();
+ }
+ let n = parseInt(m[1]) * 1000000;
+ // XXX: This only works up to 54 bit numbers.
+ set64(x.getNative(), n);
+ return x;
+ }
+
+ size() {
+ return 8;
+ }
+}
+
+
+// XXX: This only works up to 54 bit numbers.
+function set64(p: number, n: number) {
+ for (let i = 0; i < 8; ++i) {
+ Module.setValue(p + (7 - i), n & 0xFF, "i8");
+ n = Math.floor(n / 256);
+ }
+
+}
+
+
+export class UInt64 extends PackedArenaObject {
+ static fromNumber(n: number): UInt64 {
+ let x = new UInt64();
+ x.alloc();
+ set64(x.getNative(), n);
+ return x;
+ }
+
+ size() {
+ return 8;
+ }
+}
+
+
+// It's redundant, but more type safe.
+export interface DepositRequestPS_Args {
+ h_contract: HashCode;
+ h_wire: HashCode;
+ timestamp: AbsoluteTimeNbo;
+ refund_deadline: AbsoluteTimeNbo;
+ transaction_id: UInt64;
+ amount_with_fee: AmountNbo;
+ deposit_fee: AmountNbo;
+ merchant: EddsaPublicKey;
+ coin_pub: EddsaPublicKey;
+}
+
+
+export class DepositRequestPS extends SignatureStruct {
+ constructor(w: DepositRequestPS_Args) {
+ super(w);
+ }
+
+ purpose() {
+ return SignaturePurpose.WALLET_COIN_DEPOSIT;
+ }
+
+ fieldTypes() {
+ return [
+ ["h_contract", HashCode],
+ ["h_wire", HashCode],
+ ["timestamp", AbsoluteTimeNbo],
+ ["refund_deadline", AbsoluteTimeNbo],
+ ["transaction_id", UInt64],
+ ["amount_with_fee", AmountNbo],
+ ["deposit_fee", AmountNbo],
+ ["merchant", EddsaPublicKey],
+ ["coin_pub", EddsaPublicKey],
+ ];
+ }
+}
+
+export interface DenominationKeyValidityPS_args {
+ master: EddsaPublicKey;
+ start: AbsoluteTimeNbo;
+ expire_withdraw: AbsoluteTimeNbo;
+ expire_spend: AbsoluteTimeNbo;
+ expire_legal: AbsoluteTimeNbo;
+ value: AmountNbo;
+ fee_withdraw: AmountNbo;
+ fee_deposit: AmountNbo;
+ fee_refresh: AmountNbo;
+ fee_refund: AmountNbo;
+ denom_hash: HashCode;
+}
+
+export class DenominationKeyValidityPS extends SignatureStruct {
+ constructor(w: DenominationKeyValidityPS_args) {
+ super(w);
+ }
+
+ purpose() {
+ return SignaturePurpose.MASTER_DENOMINATION_KEY_VALIDITY;
+ }
+
+ fieldTypes() {
+ return [
+ ["master", EddsaPublicKey],
+ ["start", AbsoluteTimeNbo],
+ ["expire_withdraw", AbsoluteTimeNbo],
+ ["expire_spend", AbsoluteTimeNbo],
+ ["expire_legal", AbsoluteTimeNbo],
+ ["value", AmountNbo],
+ ["fee_withdraw", AmountNbo],
+ ["fee_deposit", AmountNbo],
+ ["fee_refresh", AmountNbo],
+ ["fee_refund", AmountNbo],
+ ["denom_hash", HashCode]
+ ];
+ }
+}
+
+
+interface Encodeable {
+ encode(arena?: Arena): ByteArray;
+}
+
+function makeEncode(encodeFn: any) {
+ function encode(arena?: Arena) {
+ let ptr = emscAlloc.malloc(PTR_SIZE);
+ let len = encodeFn(this.getNative(), ptr);
+ let res = new ByteArray(len, undefined, arena);
+ res.setNative(Module.getValue(ptr, '*'));
+ emsc.free(ptr);
+ return res;
+ }
+
+ return encode;
+}
+
+
+export class RsaPublicKey extends ArenaObject implements Encodeable {
+ static fromCrock: (s: string, a?: Arena) => RsaPublicKey;
+
+ toCrock() {
+ return this.encode().toCrock();
+ }
+
+ destroy() {
+ emsc.rsa_public_key_free(this.nativePtr);
+ this.nativePtr = 0;
+ }
+
+ encode: (arena?: Arena) => ByteArray;
+}
+mixinStatic(RsaPublicKey, makeFromCrock(emscAlloc.rsa_public_key_decode));
+mixin(RsaPublicKey, makeEncode(emscAlloc.rsa_public_key_encode));
+
+
+export class EddsaSignature extends PackedArenaObject {
+ size() {
+ return 64;
+ }
+}
+
+
+export class RsaSignature extends ArenaObject implements Encodeable {
+ static fromCrock: (s: string, a?: Arena) => RsaSignature;
+
+ encode: (arena?: Arena) => ByteArray;
+
+ destroy() {
+ emsc.rsa_signature_free(this.getNative());
+ this.setNative(0);
+ }
+}
+mixinStatic(RsaSignature, makeFromCrock(emscAlloc.rsa_signature_decode));
+mixin(RsaSignature, makeEncode(emscAlloc.rsa_signature_encode));
+
+
+export function rsaBlind(hashCode: HashCode,
+ blindingKey: RsaBlindingKeySecret,
+ pkey: RsaPublicKey,
+ arena?: Arena): ByteArray {
+ let ptr = emscAlloc.malloc(PTR_SIZE);
+ let s = emscAlloc.rsa_blind(hashCode.nativePtr,
+ blindingKey.nativePtr,
+ pkey.nativePtr,
+ ptr);
+ return new ByteArray(s, Module.getValue(ptr, '*'), arena);
+}
+
+
+export function eddsaSign(purpose: EccSignaturePurpose,
+ priv: EddsaPrivateKey,
+ a?: Arena): EddsaSignature {
+ let sig = new EddsaSignature(a);
+ sig.alloc();
+ let res = emsc.eddsa_sign(priv.nativePtr, purpose.nativePtr, sig.nativePtr);
+ if (res < 1) {
+ throw Error("EdDSA signing failed");
+ }
+ return sig;
+}
+
+
+export function eddsaVerify(purposeNum: number,
+ verify: EccSignaturePurpose,
+ sig: EddsaSignature,
+ pub: EddsaPublicKey,
+ a?: Arena): boolean {
+ let r = emsc.eddsa_verify(purposeNum,
+ verify.nativePtr,
+ sig.nativePtr,
+ pub.nativePtr);
+ if (r === GNUNET_OK) {
+ return true;
+ }
+ return false;
+}
+
+
+export function rsaUnblind(sig: RsaSignature,
+ bk: RsaBlindingKeySecret,
+ pk: RsaPublicKey,
+ a?: Arena): RsaSignature {
+ let x = new RsaSignature(a);
+ x.nativePtr = emscAlloc.rsa_unblind(sig.nativePtr,
+ bk.nativePtr,
+ pk.nativePtr);
+ return x;
+}
diff --git a/lib/wallet/helpers.ts b/lib/wallet/helpers.ts
new file mode 100644
index 000000000..5d231fe64
--- /dev/null
+++ b/lib/wallet/helpers.ts
@@ -0,0 +1,67 @@
+/*
+ This file is part of TALER
+ (C) 2016 GNUnet e.V.
+
+ TALER is free software; you can redistribute it and/or modify it under the
+ terms of the GNU General Public License as published by the Free Software
+ Foundation; either version 3, or (at your option) any later version.
+
+ TALER is distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along with
+ TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
+ */
+
+
+/**
+ * Smaller helper functions that do not depend
+ * on the emscripten machinery.
+ *
+ * @author Florian Dold
+ */
+
+import {AmountJson} from "./types";
+
+export function substituteFulfillmentUrl(url: string, vars: any) {
+ url = url.replace("${H_contract}", vars.H_contract);
+ url = url.replace("${$}", "$");
+ return url;
+}
+
+
+export function amountToPretty(amount: AmountJson): string {
+ let x = amount.value + amount.fraction / 1e6;
+ return `${x} ${amount.currency}`;
+}
+
+
+/**
+ * Canonicalize a base url, typically for the exchange.
+ *
+ * See http://api.taler.net/wallet.html#general
+ */
+export function canonicalizeBaseUrl(url: string) {
+ let x = new URI(url);
+ if (!x.protocol()) {
+ x.protocol("https");
+ }
+ x.path(x.path() + "/").normalizePath();
+ x.fragment();
+ x.query();
+ return x.href()
+}
+
+
+export function parsePrettyAmount(pretty: string): AmountJson|undefined {
+ const res = /([0-9]+)(.[0-9]+)?\s*(\w+)/.exec(pretty);
+ if (!res) {
+ return undefined;
+ }
+ return {
+ value: parseInt(res[1], 10),
+ fraction: res[2] ? (parseFloat(`0.${res[2]}`) * 1e-6) : 0,
+ currency: res[3]
+ }
+}
diff --git a/lib/wallet/http.ts b/lib/wallet/http.ts
new file mode 100644
index 000000000..8f82ceaff
--- /dev/null
+++ b/lib/wallet/http.ts
@@ -0,0 +1,84 @@
+/*
+ This file is part of TALER
+ (C) 2016 GNUnet e.V.
+
+ TALER is free software; you can redistribute it and/or modify it under the
+ terms of the GNU General Public License as published by the Free Software
+ Foundation; either version 3, or (at your option) any later version.
+
+ TALER is distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along with
+ TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
+ */
+
+/**
+ * Helpers for doing XMLHttpRequest-s that are based on ES6 promises.
+ * @module Http
+ * @author Florian Dold
+ */
+
+"use strict";
+
+
+export interface HttpResponse {
+ status: number;
+ responseText: string;
+}
+
+
+export class BrowserHttpLib {
+ req(method: string,
+ url: string|uri.URI,
+ options?: any): Promise<HttpResponse> {
+ let urlString: string;
+ if (url instanceof URI) {
+ urlString = url.href();
+ } else if (typeof url === "string") {
+ urlString = url;
+ }
+
+ return new Promise((resolve, reject) => {
+ let myRequest = new XMLHttpRequest();
+ myRequest.open(method, urlString);
+ if (options && options.req) {
+ myRequest.send(options.req);
+ } else {
+ myRequest.send();
+ }
+ myRequest.addEventListener("readystatechange", (e) => {
+ if (myRequest.readyState == XMLHttpRequest.DONE) {
+ let resp = {
+ status: myRequest.status,
+ responseText: myRequest.responseText
+ };
+ resolve(resp);
+ }
+ });
+ });
+ }
+
+
+ get(url: string|uri.URI) {
+ return this.req("get", url);
+ }
+
+
+ postJson(url: string|uri.URI, body: any) {
+ return this.req("post", url, {req: JSON.stringify(body)});
+ }
+
+
+ postForm(url: string|uri.URI, form: any) {
+ return this.req("post", url, {req: form});
+ }
+}
+
+
+export class RequestException {
+ constructor(detail: any) {
+
+ }
+}
diff --git a/lib/wallet/query.ts b/lib/wallet/query.ts
new file mode 100644
index 000000000..c7420a3f7
--- /dev/null
+++ b/lib/wallet/query.ts
@@ -0,0 +1,415 @@
+/*
+ This file is part of TALER
+ (C) 2016 GNUnet e.V.
+
+ TALER is free software; you can redistribute it and/or modify it under the
+ terms of the GNU General Public License as published by the Free Software
+ Foundation; either version 3, or (at your option) any later version.
+
+ TALER is distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along with
+ TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
+ */
+
+
+/**
+ * Database query abstractions.
+ * @module Query
+ * @author Florian Dold
+ */
+
+"use strict";
+
+
+export function Query(db: IDBDatabase) {
+ return new QueryRoot(db);
+}
+
+/**
+ * Stream that can be filtered, reduced or joined
+ * with indices.
+ */
+export interface QueryStream<T> {
+ indexJoin<S>(storeName: string,
+ indexName: string,
+ keyFn: (obj: any) => any): QueryStream<[T,S]>;
+ filter(f: (x: any) => boolean): QueryStream<T>;
+ reduce<S>(f: (v: T, acc: S) => S, start?: S): Promise<S>;
+ flatMap(f: (x: T) => T[]): QueryStream<T>;
+}
+
+
+/**
+ * Get an unresolved promise together with its extracted resolve / reject
+ * function.
+ */
+function openPromise<T>() {
+ let resolve: ((value?: T | PromiseLike<T>) => void) | null = null;
+ let reject: ((reason?: any) => void) | null = null;
+ const promise = new Promise<T>((res, rej) => {
+ resolve = res;
+ reject = rej;
+ });
+ if (!(resolve && reject)) {
+ // Never happens, unless JS implementation is broken
+ throw Error();
+ }
+ return {resolve, reject, promise};
+}
+
+
+abstract class QueryStreamBase<T> implements QueryStream<T> {
+ abstract subscribe(f: (isDone: boolean,
+ value: any,
+ tx: IDBTransaction) => void): void;
+
+ root: QueryRoot;
+
+ constructor(root: QueryRoot) {
+ this.root = root;
+ }
+
+ flatMap(f: (x: T) => T[]): QueryStream<T> {
+ return new QueryStreamFlatMap(this, f);
+ }
+
+ indexJoin<S>(storeName: string,
+ indexName: string,
+ key: any): QueryStream<[T,S]> {
+ this.root.addStoreAccess(storeName, false);
+ return new QueryStreamIndexJoin(this, storeName, indexName, key);
+ }
+
+ filter(f: (x: any) => boolean): QueryStream<T> {
+ return new QueryStreamFilter(this, f);
+ }
+
+ reduce<A>(f: (x: any, acc?: A) => A, init?: A): Promise<any> {
+ let {resolve, promise} = openPromise();
+ let acc = init;
+
+ this.subscribe((isDone, value) => {
+ if (isDone) {
+ resolve(acc);
+ return;
+ }
+ acc = f(value, acc);
+ });
+
+ return Promise.resolve()
+ .then(() => this.root.finish())
+ .then(() => promise);
+ }
+}
+
+type FilterFn = (e: any) => boolean;
+type SubscribeFn = (done: boolean, value: any, tx: IDBTransaction) => void;
+
+interface FlatMapFn<T> {
+ (v: T): T[];
+}
+
+class QueryStreamFilter<T> extends QueryStreamBase<T> {
+ s: QueryStreamBase<T>;
+ filterFn: FilterFn;
+
+ constructor(s: QueryStreamBase<T>, filterFn: FilterFn) {
+ super(s.root);
+ this.s = s;
+ this.filterFn = filterFn;
+ }
+
+ subscribe(f: SubscribeFn) {
+ this.s.subscribe((isDone, value, tx) => {
+ if (isDone) {
+ f(true, undefined, tx);
+ return;
+ }
+ if (this.filterFn(value)) {
+ f(false, value, tx);
+ }
+ });
+ }
+}
+
+
+class QueryStreamFlatMap<T> extends QueryStreamBase<T> {
+ s: QueryStreamBase<T>;
+ flatMapFn: (v: T) => T[];
+
+ constructor(s: QueryStreamBase<T>, flatMapFn: (v: T) => T[]) {
+ super(s.root);
+ this.s = s;
+ this.flatMapFn = flatMapFn;
+ }
+
+ subscribe(f: SubscribeFn) {
+ this.s.subscribe((isDone, value, tx) => {
+ if (isDone) {
+ f(true, undefined, tx);
+ return;
+ }
+ let values = this.flatMapFn(value);
+ for (let v in values) {
+ f(false, value, tx)
+ }
+ });
+ }
+}
+
+
+class QueryStreamIndexJoin<T,S> extends QueryStreamBase<[T, S]> {
+ s: QueryStreamBase<T>;
+ storeName: string;
+ key: any;
+ indexName: string;
+
+ constructor(s: QueryStreamBase<T>, storeName: string, indexName: string, key: any) {
+ super(s.root);
+ this.s = s;
+ this.storeName = storeName;
+ this.key = key;
+ this.indexName = indexName;
+ }
+
+ subscribe(f: SubscribeFn) {
+ this.s.subscribe((isDone, value, tx) => {
+ if (isDone) {
+ f(true, undefined, tx);
+ return;
+ }
+ console.log("joining on", this.key(value));
+ let s = tx.objectStore(this.storeName).index(this.indexName);
+ let req = s.openCursor(IDBKeyRange.only(this.key(value)));
+ req.onsuccess = () => {
+ let cursor = req.result;
+ if (cursor) {
+ f(false, [value, cursor.value], tx);
+ cursor.continue();
+ } else {
+ f(true, undefined, tx);
+ }
+ }
+ });
+ }
+}
+
+
+class IterQueryStream<T> extends QueryStreamBase<T> {
+ private storeName: string;
+ private options: any;
+ private subscribers: SubscribeFn[];
+
+ constructor(qr: QueryRoot, storeName: string, options: any) {
+ super(qr);
+ this.options = options;
+ this.storeName = storeName;
+ this.subscribers = [];
+
+ let doIt = (tx: IDBTransaction) => {
+ const {indexName = void 0, only = void 0} = this.options;
+ let s: any;
+ if (indexName !== void 0) {
+ s = tx.objectStore(this.storeName)
+ .index(this.options.indexName);
+ } else {
+ s = tx.objectStore(this.storeName);
+ }
+ let kr: IDBKeyRange|undefined = undefined;
+ if (only !== undefined) {
+ kr = IDBKeyRange.only(this.options.only);
+ }
+ let req = s.openCursor(kr);
+ req.onsuccess = () => {
+ let cursor: IDBCursorWithValue = req.result;
+ if (cursor) {
+ for (let f of this.subscribers) {
+ f(false, cursor.value, tx);
+ }
+ cursor.continue();
+ } else {
+ for (let f of this.subscribers) {
+ f(true, undefined, tx);
+ }
+ }
+ }
+ };
+
+ this.root.addWork(doIt);
+ }
+
+ subscribe(f: SubscribeFn) {
+ this.subscribers.push(f);
+ }
+}
+
+
+class QueryRoot {
+ private work: ((t: IDBTransaction) => void)[] = [];
+ private db: IDBDatabase;
+ private stores = new Set();
+ private kickoffPromise: Promise<void>;
+
+ /**
+ * Some operations is a write operation,
+ * and we need to do a "readwrite" transaction/
+ */
+ private hasWrite: boolean;
+
+ constructor(db: IDBDatabase) {
+ this.db = db;
+ }
+
+ iter<T>(storeName: string,
+ {only = <string|undefined>undefined, indexName = <string|undefined>undefined} = {}): QueryStream<T> {
+ this.stores.add(storeName);
+ return new IterQueryStream(this, storeName, {only, indexName});
+ }
+
+ /**
+ * Put an object into the given object store.
+ * Overrides if an existing object with the same key exists
+ * in the store.
+ */
+ put(storeName: string, val: any): QueryRoot {
+ let doPut = (tx: IDBTransaction) => {
+ tx.objectStore(storeName).put(val);
+ };
+ this.addWork(doPut, storeName, true);
+ return this;
+ }
+
+
+ /**
+ * Add all object from an iterable to the given object store.
+ * Fails if the object's key is already present
+ * in the object store.
+ */
+ putAll(storeName: string, iterable: any[]): QueryRoot {
+ const doPutAll = (tx: IDBTransaction) => {
+ for (const obj of iterable) {
+ tx.objectStore(storeName).put(obj);
+ }
+ };
+ this.addWork(doPutAll, storeName, true);
+ return this;
+ }
+
+ /**
+ * Add an object to the given object store.
+ * Fails if the object's key is already present
+ * in the object store.
+ */
+ add(storeName: string, val: any): QueryRoot {
+ const doAdd = (tx: IDBTransaction) => {
+ tx.objectStore(storeName).add(val);
+ };
+ this.addWork(doAdd, storeName, true);
+ return this;
+ }
+
+ /**
+ * Get one object from a store by its key.
+ */
+ get(storeName: any, key: any): Promise<any> {
+ if (key === void 0) {
+ throw Error("key must not be undefined");
+ }
+
+ const {resolve, promise} = openPromise();
+
+ const doGet = (tx: IDBTransaction) => {
+ const req = tx.objectStore(storeName).get(key);
+ req.onsuccess = () => {
+ resolve(req.result);
+ };
+ };
+
+ this.addWork(doGet, storeName, false);
+ return Promise.resolve()
+ .then(() => this.finish())
+ .then(() => promise);
+ }
+
+ /**
+ * Get one object from a store by its key.
+ */
+ getIndexed(storeName: string, indexName: string, key: any): Promise<any> {
+ if (key === void 0) {
+ throw Error("key must not be undefined");
+ }
+
+ const {resolve, promise} = openPromise();
+
+ const doGetIndexed = (tx: IDBTransaction) => {
+ const req = tx.objectStore(storeName).index(indexName).get(key);
+ req.onsuccess = () => {
+ resolve(req.result);
+ };
+ };
+
+ this.addWork(doGetIndexed, storeName, false);
+ return Promise.resolve()
+ .then(() => this.finish())
+ .then(() => promise);
+ }
+
+ /**
+ * Finish the query, and start the query in the first place if necessary.
+ */
+ finish(): Promise<void> {
+ if (this.kickoffPromise) {
+ return this.kickoffPromise;
+ }
+ this.kickoffPromise = new Promise<void>((resolve, reject) => {
+ if (this.work.length == 0) {
+ resolve();
+ return;
+ }
+ const mode = this.hasWrite ? "readwrite" : "readonly";
+ const tx = this.db.transaction(Array.from(this.stores), mode);
+ tx.oncomplete = () => {
+ resolve();
+ };
+ for (let w of this.work) {
+ w(tx);
+ }
+ });
+ return this.kickoffPromise;
+ }
+
+ /**
+ * Delete an object by from the given object store.
+ */
+ delete(storeName: string, key: any): QueryRoot {
+ const doDelete = (tx: IDBTransaction) => {
+ tx.objectStore(storeName).delete(key);
+ };
+ this.addWork(doDelete, storeName, true);
+ return this;
+ }
+
+ /**
+ * Low-level function to add a task to the internal work queue.
+ */
+ addWork(workFn: (t: IDBTransaction) => void,
+ storeName?: string,
+ isWrite?: boolean) {
+ this.work.push(workFn);
+ if (storeName) {
+ this.addStoreAccess(storeName, isWrite);
+ }
+ }
+
+ addStoreAccess(storeName: string, isWrite?: boolean) {
+ if (storeName) {
+ this.stores.add(storeName);
+ }
+ if (isWrite) {
+ this.hasWrite = true;
+ }
+ }
+} \ No newline at end of file
diff --git a/lib/wallet/renderHtml.ts b/lib/wallet/renderHtml.ts
new file mode 100644
index 000000000..6d9823d71
--- /dev/null
+++ b/lib/wallet/renderHtml.ts
@@ -0,0 +1,49 @@
+/*
+ This file is part of TALER
+ (C) 2016 INRIA
+
+ TALER is free software; you can redistribute it and/or modify it under the
+ terms of the GNU General Public License as published by the Free Software
+ Foundation; either version 3, or (at your option) any later version.
+
+ TALER is distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along with
+ TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
+ */
+
+/**
+ * Helpers functions to render Taler-related data structures to HTML.
+ *
+ * @author Florian Dold
+ */
+
+
+import {AmountJson, Contract} from "./types";
+
+
+export function prettyAmount(amount: AmountJson) {
+ let v = amount.value + amount.fraction / 1e6;
+ return `${v.toFixed(2)} ${amount.currency}`;
+}
+
+export function renderContract(contract: Contract): any {
+ let merchantName = m("strong", contract.merchant.name);
+ let amount = m("strong", prettyAmount(contract.amount));
+
+ return m("div", {}, [
+ m("p",
+ i18n.parts`${merchantName}
+ wants to enter a contract over ${amount}
+ with you.`),
+ m("p",
+ i18n`You are about to purchase:`),
+ m('ul',
+
+ contract.products.map(
+ (p: any) => m("li",
+ `${p.description}: ${prettyAmount(p.price)}`)))
+ ]);
+} \ No newline at end of file
diff --git a/lib/wallet/types.ts b/lib/wallet/types.ts
new file mode 100644
index 000000000..e8b7a1e39
--- /dev/null
+++ b/lib/wallet/types.ts
@@ -0,0 +1,396 @@
+/*
+ This file is part of TALER
+ (C) 2015 GNUnet e.V.
+
+ TALER is free software; you can redistribute it and/or modify it under the
+ terms of the GNU General Public License as published by the Free Software
+ Foundation; either version 3, or (at your option) any later version.
+
+ TALER is distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along with
+ TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
+ */
+
+/**
+ * Common types that are used by Taler.
+ *
+ * Note most types are defined in wallet.ts, types that
+ * are defined in types.ts are intended to be used by components
+ * that do not depend on the whole wallet implementation (which depends on
+ * emscripten).
+ *
+ * @author Florian Dold
+ */
+
+import {Checkable} from "./checkable";
+
+@Checkable.Class
+export class AmountJson {
+ @Checkable.Number
+ value: number;
+
+ @Checkable.Number
+ fraction: number;
+
+ @Checkable.String
+ currency: string;
+
+ static checked: (obj: any) => AmountJson;
+}
+
+
+@Checkable.Class
+export class CreateReserveResponse {
+ /**
+ * Exchange URL where the bank should create the reserve.
+ * The URL is canonicalized in the response.
+ */
+ @Checkable.String
+ exchange: string;
+
+ @Checkable.String
+ reservePub: string;
+
+ static checked: (obj: any) => CreateReserveResponse;
+}
+
+
+@Checkable.Class
+export class Denomination {
+ @Checkable.Value(AmountJson)
+ value: AmountJson;
+
+ @Checkable.String
+ denom_pub: string;
+
+ @Checkable.Value(AmountJson)
+ fee_withdraw: AmountJson;
+
+ @Checkable.Value(AmountJson)
+ fee_deposit: AmountJson;
+
+ @Checkable.Value(AmountJson)
+ fee_refresh: AmountJson;
+
+ @Checkable.Value(AmountJson)
+ fee_refund: AmountJson;
+
+ @Checkable.String
+ stamp_start: string;
+
+ @Checkable.String
+ stamp_expire_withdraw: string;
+
+ @Checkable.String
+ stamp_expire_legal: string;
+
+ @Checkable.String
+ stamp_expire_deposit: string;
+
+ @Checkable.String
+ master_sig: string;
+
+ static checked: (obj: any) => Denomination;
+}
+
+
+export interface IExchangeInfo {
+ baseUrl: string;
+ masterPublicKey: string;
+
+ /**
+ * All denominations we ever received from the exchange.
+ * Expired denominations may be garbage collected.
+ */
+ all_denoms: Denomination[];
+
+ /**
+ * Denominations we received with the last update.
+ * Subset of "denoms".
+ */
+ active_denoms: Denomination[];
+
+ /**
+ * Timestamp for last update.
+ */
+ last_update_time: number;
+}
+
+export interface WireInfo {
+ [type: string]: any;
+}
+
+export interface ReserveCreationInfo {
+ exchangeInfo: IExchangeInfo;
+ wireInfo: WireInfo;
+ selectedDenoms: Denomination[];
+ withdrawFee: AmountJson;
+ overhead: AmountJson;
+}
+
+
+/**
+ * A coin that isn't yet signed by an exchange.
+ */
+export interface PreCoin {
+ coinPub: string;
+ coinPriv: string;
+ reservePub: string;
+ denomPub: string;
+ blindingKey: string;
+ withdrawSig: string;
+ coinEv: string;
+ exchangeBaseUrl: string;
+ coinValue: AmountJson;
+}
+
+
+export interface Reserve {
+ exchange_base_url: string
+ reserve_priv: string;
+ reserve_pub: string;
+}
+
+
+export interface CoinPaySig {
+ coin_sig: string;
+ coin_pub: string;
+ ub_sig: string;
+ denom_pub: string;
+ f: AmountJson;
+}
+
+
+/**
+ * Coin as stored in the "coins" data store
+ * of the wallet database.
+ */
+export interface Coin {
+ /**
+ * Public key of the coin.
+ */
+ coinPub: string;
+
+ /**
+ * Private key to authorize operations on the coin.
+ */
+ coinPriv: string;
+
+ /**
+ * Key used by the exchange used to sign the coin.
+ */
+ denomPub: string;
+
+ /**
+ * Unblinded signature by the exchange.
+ */
+ denomSig: string;
+
+ /**
+ * Amount that's left on the coin.
+ */
+ currentAmount: AmountJson;
+
+ /**
+ * Base URL that identifies the exchange from which we got the
+ * coin.
+ */
+ exchangeBaseUrl: string;
+
+ /**
+ * We have withdrawn the coin, but it's not accepted by the exchange anymore.
+ * We have to tell an auditor and wait for compensation or for the exchange
+ * to fix it.
+ */
+ suspended?: boolean;
+}
+
+
+@Checkable.Class
+export class ExchangeHandle {
+ @Checkable.String
+ master_pub: string;
+
+ @Checkable.String
+ url: string;
+
+ static checked: (obj: any) => ExchangeHandle;
+}
+
+
+@Checkable.Class
+export class Contract {
+ @Checkable.String
+ H_wire: string;
+
+ @Checkable.Value(AmountJson)
+ amount: AmountJson;
+
+ @Checkable.List(Checkable.AnyObject)
+ auditors: any[];
+
+ @Checkable.String
+ expiry: string;
+
+ @Checkable.Any
+ locations: any;
+
+ @Checkable.Value(AmountJson)
+ max_fee: AmountJson;
+
+ @Checkable.Any
+ merchant: any;
+
+ @Checkable.String
+ merchant_pub: string;
+
+ @Checkable.List(Checkable.Value(ExchangeHandle))
+ exchanges: ExchangeHandle[];
+
+ @Checkable.List(Checkable.AnyObject)
+ products: any[];
+
+ @Checkable.String
+ refund_deadline: string;
+
+ @Checkable.String
+ timestamp: string;
+
+ @Checkable.Number
+ transaction_id: number;
+
+ @Checkable.String
+ fulfillment_url: string;
+
+ @Checkable.Optional(Checkable.String)
+ repurchase_correlation_id: string;
+
+ @Checkable.Optional(Checkable.String)
+ receiver: string;
+
+ static checked: (obj: any) => Contract;
+}
+
+
+export type PayCoinInfo = Array<{ updatedCoin: Coin, sig: CoinPaySig }>;
+
+
+export namespace Amounts {
+ export interface Result {
+ amount: AmountJson;
+ // Was there an over-/underflow?
+ saturated: boolean;
+ }
+
+ function getMaxAmount(currency: string): AmountJson {
+ return {
+ currency,
+ value: Number.MAX_SAFE_INTEGER,
+ fraction: 2**32,
+ }
+ }
+
+ export function getZero(currency: string): AmountJson {
+ return {
+ currency,
+ value: 0,
+ fraction: 0,
+ }
+ }
+
+ export function add(first: AmountJson, ...rest: AmountJson[]): Result {
+ let currency = first.currency;
+ let value = first.value + Math.floor(first.fraction / 1e6);
+ if (value > Number.MAX_SAFE_INTEGER) {
+ return {amount: getMaxAmount(currency), saturated: true};
+ }
+ let fraction = first.fraction % 1e6;
+ for (let x of rest) {
+ if (x.currency !== currency) {
+ throw Error(`Mismatched currency: ${x.currency} and ${currency}`);
+ }
+
+ value = value + x.value + Math.floor((fraction + x.fraction) / 1e6);
+ fraction = (fraction + x.fraction) % 1e6;
+ if (value > Number.MAX_SAFE_INTEGER) {
+ return {amount: getMaxAmount(currency), saturated: true};
+ }
+ }
+ return {amount: {currency, value, fraction}, saturated: false};
+ }
+
+
+ export function sub(a: AmountJson, b: AmountJson): Result {
+ if (a.currency !== b.currency) {
+ throw Error(`Mismatched currency: ${a.currency} and ${b.currency}`);
+ }
+ let currency = a.currency;
+ let value = a.value;
+ let fraction = a.fraction;
+ if (fraction < b.fraction) {
+ if (value < 1) {
+ return {amount: {currency, value: 0, fraction: 0}, saturated: true};
+ }
+ value--;
+ fraction += 1e6;
+ }
+ console.assert(fraction >= b.fraction);
+ fraction -= b.fraction;
+ if (value < b.value) {
+ return {amount: {currency, value: 0, fraction: 0}, saturated: true};
+ }
+ value -= b.value;
+ return {amount: {currency, value, fraction}, saturated: false};
+ }
+
+ export function cmp(a: AmountJson, b: AmountJson): number {
+ if (a.currency !== b.currency) {
+ throw Error(`Mismatched currency: ${a.currency} and ${b.currency}`);
+ }
+ let av = a.value + Math.floor(a.fraction / 1e6);
+ let af = a.fraction % 1e6;
+ let bv = b.value + Math.floor(b.fraction / 1e6);
+ let bf = b.fraction % 1e6;
+ switch (true) {
+ case av < bv:
+ return -1;
+ case av > bv:
+ return 1;
+ case af < bf:
+ return -1;
+ case af > bf:
+ return 1;
+ case af == bf:
+ return 0;
+ default:
+ throw Error("assertion failed");
+ }
+ }
+
+ export function copy(a: AmountJson): AmountJson {
+ return {
+ value: a.value,
+ fraction: a.fraction,
+ currency: a.currency,
+ }
+ }
+
+ export function isNonZero(a: AmountJson) {
+ return a.value > 0 || a.fraction > 0;
+ }
+}
+
+
+export interface CheckRepurchaseResult {
+ isRepurchase: boolean;
+ existingContractHash?: string;
+ existingFulfillmentUrl?: string;
+}
+
+
+export interface Notifier {
+ notify(): void;
+}
diff --git a/lib/wallet/wallet.ts b/lib/wallet/wallet.ts
new file mode 100644
index 000000000..45d083570
--- /dev/null
+++ b/lib/wallet/wallet.ts
@@ -0,0 +1,1156 @@
+/*
+ This file is part of TALER
+ (C) 2015 GNUnet e.V.
+
+ TALER is free software; you can redistribute it and/or modify it under the
+ terms of the GNU General Public License as published by the Free Software
+ Foundation; either version 3, or (at your option) any later version.
+
+ TALER is distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along with
+ TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
+ */
+
+/**
+ * High-level wallet operations that should be indepentent from the underlying
+ * browser extension interface.
+ * @module Wallet
+ * @author Florian Dold
+ */
+
+import {
+ AmountJson,
+ CreateReserveResponse,
+ IExchangeInfo,
+ Denomination,
+ Notifier,
+ WireInfo
+} from "./types";
+import {HttpResponse, RequestException} from "./http";
+import {Query} from "./query";
+import {Checkable} from "./checkable";
+import {canonicalizeBaseUrl} from "./helpers";
+import {ReserveCreationInfo, Amounts} from "./types";
+import {PreCoin} from "./types";
+import {Reserve} from "./types";
+import {CryptoApi} from "./cryptoApi";
+import {Coin} from "./types";
+import {PayCoinInfo} from "./types";
+import {CheckRepurchaseResult} from "./types";
+import {Contract} from "./types";
+import {ExchangeHandle} from "./types";
+
+"use strict";
+
+export interface CoinWithDenom {
+ coin: Coin;
+ denom: Denomination;
+}
+
+interface ReserveRecord {
+ reserve_pub: string;
+ reserve_priv: string,
+ exchange_base_url: string,
+ created: number,
+ last_query: number|null,
+ /**
+ * Current amount left in the reserve
+ */
+ current_amount: AmountJson|null,
+ /**
+ * Amount requested when the reserve was created.
+ * When a reserve is re-used (rare!) the current_amount can
+ * be higher than the requested_amount
+ */
+ requested_amount: AmountJson,
+ /**
+ * Amount we've already withdrawn from the reserve.
+ */
+ withdrawn_amount: AmountJson;
+ confirmed: boolean,
+}
+
+
+@Checkable.Class
+export class KeysJson {
+ @Checkable.List(Checkable.Value(Denomination))
+ denoms: Denomination[];
+
+ @Checkable.String
+ master_public_key: string;
+
+ @Checkable.Any
+ auditors: any[];
+
+ @Checkable.String
+ list_issue_date: string;
+
+ @Checkable.Any
+ signkeys: any;
+
+ @Checkable.String
+ eddsa_pub: string;
+
+ @Checkable.String
+ eddsa_sig: string;
+
+ static checked: (obj: any) => KeysJson;
+}
+
+
+@Checkable.Class
+export class CreateReserveRequest {
+ /**
+ * The initial amount for the reserve.
+ */
+ @Checkable.Value(AmountJson)
+ amount: AmountJson;
+
+ /**
+ * Exchange URL where the bank should create the reserve.
+ */
+ @Checkable.String
+ exchange: string;
+
+ static checked: (obj: any) => CreateReserveRequest;
+}
+
+
+@Checkable.Class
+export class ConfirmReserveRequest {
+ /**
+ * Public key of then reserve that should be marked
+ * as confirmed.
+ */
+ @Checkable.String
+ reservePub: string;
+
+ static checked: (obj: any) => ConfirmReserveRequest;
+}
+
+
+@Checkable.Class
+export class Offer {
+ @Checkable.Value(Contract)
+ contract: Contract;
+
+ @Checkable.String
+ merchant_sig: string;
+
+ @Checkable.String
+ H_contract: string;
+
+ static checked: (obj: any) => Offer;
+}
+
+export interface HistoryRecord {
+ type: string;
+ timestamp: number;
+ subjectId?: string;
+ detail: any;
+ level: HistoryLevel;
+}
+
+
+interface ExchangeCoins {
+ [exchangeUrl: string]: CoinWithDenom[];
+}
+
+
+interface Transaction {
+ contractHash: string;
+ contract: Contract;
+ payReq: any;
+ merchantSig: string;
+}
+
+export enum HistoryLevel {
+ Trace = 1,
+ Developer = 2,
+ Expert = 3,
+ User = 4,
+}
+
+
+export interface Badge {
+ setText(s: string): void;
+ setColor(c: string): void;
+ startBusy(): void;
+ stopBusy(): void;
+}
+
+export function canonicalJson(obj: any): string {
+ // Check for cycles, etc.
+ JSON.stringify(obj);
+ if (typeof obj == "string" || typeof obj == "number" || obj === null) {
+ return JSON.stringify(obj)
+ }
+ if (Array.isArray(obj)) {
+ let objs: string[] = obj.map((e) => canonicalJson(e));
+ return `[${objs.join(',')}]`;
+ }
+ let keys: string[] = [];
+ for (let key in obj) {
+ keys.push(key);
+ }
+ keys.sort();
+ let s = "{";
+ for (let i = 0; i < keys.length; i++) {
+ let key = keys[i];
+ s += JSON.stringify(key) + ":" + canonicalJson(obj[key]);
+ if (i != keys.length - 1) {
+ s += ",";
+ }
+ }
+ return s + "}";
+}
+
+
+function deepEquals(x: any, y: any): boolean {
+ if (x === y) {
+ return true;
+ }
+
+ if (Array.isArray(x) && x.length !== y.length) {
+ return false;
+ }
+
+ var p = Object.keys(x);
+ return Object.keys(y).every((i) => p.indexOf(i) !== -1) &&
+ p.every((i) => deepEquals(x[i], y[i]));
+}
+
+
+function flatMap<T, U>(xs: T[], f: (x: T) => U[]): U[] {
+ return xs.reduce((acc: U[], next: T) => [...f(next), ...acc], []);
+}
+
+
+function getTalerStampSec(stamp: string): number|null {
+ const m = stamp.match(/\/?Date\(([0-9]*)\)\/?/);
+ if (!m) {
+ return null;
+ }
+ return parseInt(m[1]);
+}
+
+
+function setTimeout(f: any, t: number) {
+ return chrome.extension.getBackgroundPage().setTimeout(f, t);
+}
+
+
+function isWithdrawableDenom(d: Denomination) {
+ const now_sec = (new Date).getTime() / 1000;
+ const stamp_withdraw_sec = getTalerStampSec(d.stamp_expire_withdraw);
+ // Withdraw if still possible to withdraw within a minute
+ if (stamp_withdraw_sec + 60 > now_sec) {
+ return true;
+ }
+ return false;
+}
+
+
+interface HttpRequestLibrary {
+ req(method: string,
+ url: string|uri.URI,
+ options?: any): Promise<HttpResponse>;
+
+ get(url: string|uri.URI): Promise<HttpResponse>;
+
+ postJson(url: string|uri.URI, body: any): Promise<HttpResponse>;
+
+ postForm(url: string|uri.URI, form: any): Promise<HttpResponse>;
+}
+
+
+function copy(o: any) {
+ return JSON.parse(JSON.stringify(o));
+}
+
+/**
+ * Result of updating exisiting information
+ * about an exchange with a new '/keys' response.
+ */
+interface KeyUpdateInfo {
+ updatedExchangeInfo: IExchangeInfo;
+ addedDenominations: Denomination[];
+ removedDenominations: Denomination[];
+}
+
+
+/**
+ * Get a list of denominations (with repetitions possible)
+ * whose total value is as close as possible to the available
+ * amount, but never larger.
+ */
+function getWithdrawDenomList(amountAvailable: AmountJson,
+ denoms: Denomination[]): Denomination[] {
+ let remaining = Amounts.copy(amountAvailable);
+ const ds: Denomination[] = [];
+
+ denoms = denoms.filter(isWithdrawableDenom);
+ denoms.sort((d1, d2) => Amounts.cmp(d2.value, d1.value));
+
+ // This is an arbitrary number of coins
+ // we can withdraw in one go. It's not clear if this limit
+ // is useful ...
+ for (let i = 0; i < 1000; i++) {
+ let found = false;
+ for (let d of denoms) {
+ let cost = Amounts.add(d.value, d.fee_withdraw).amount;
+ if (Amounts.cmp(remaining, cost) < 0) {
+ continue;
+ }
+ found = true;
+ remaining = Amounts.sub(remaining, cost).amount;
+ ds.push(d);
+ break;
+ }
+ if (!found) {
+ break;
+ }
+ }
+ return ds;
+}
+
+
+export class Wallet {
+ private db: IDBDatabase;
+ private http: HttpRequestLibrary;
+ private badge: Badge;
+ private notifier: Notifier;
+ public cryptoApi: CryptoApi;
+
+ /**
+ * Set of identifiers for running operations.
+ */
+ private runningOperations: Set<string> = new Set();
+
+ constructor(db: IDBDatabase,
+ http: HttpRequestLibrary,
+ badge: Badge,
+ notifier: Notifier) {
+ this.db = db;
+ this.http = http;
+ this.badge = badge;
+ this.notifier = notifier;
+ this.cryptoApi = new CryptoApi();
+
+ this.resumePendingFromDb();
+ }
+
+
+ private startOperation(operationId: string) {
+ this.runningOperations.add(operationId);
+ this.badge.startBusy();
+ }
+
+ private stopOperation(operationId: string) {
+ this.runningOperations.delete(operationId);
+ if (this.runningOperations.size == 0) {
+ this.badge.stopBusy();
+ }
+ }
+
+ updateExchanges(): void {
+ console.log("updating exchanges");
+
+ Query(this.db)
+ .iter("exchanges")
+ .reduce((exchange: IExchangeInfo) => {
+ this.updateExchangeFromUrl(exchange.baseUrl)
+ .catch((e) => {
+ console.error("updating exchange failed", e);
+ });
+ });
+ }
+
+ /**
+ * Resume various pending operations that are pending
+ * by looking at the database.
+ */
+ private resumePendingFromDb(): void {
+ console.log("resuming pending operations from db");
+
+ Query(this.db)
+ .iter("reserves")
+ .reduce((reserve: any) => {
+ console.log("resuming reserve", reserve.reserve_pub);
+ this.processReserve(reserve);
+ });
+
+ Query(this.db)
+ .iter("precoins")
+ .reduce((preCoin: any) => {
+ console.log("resuming precoin");
+ this.processPreCoin(preCoin);
+ });
+ }
+
+
+ /**
+ * Get exchanges and associated coins that are still spendable,
+ * but only if the sum the coins' remaining value exceeds the payment amount.
+ */
+ private async getPossibleExchangeCoins(paymentAmount: AmountJson,
+ depositFeeLimit: AmountJson,
+ allowedExchanges: ExchangeHandle[]): Promise<ExchangeCoins> {
+ // Mapping from exchange base URL to list of coins together with their
+ // denomination
+ let m: ExchangeCoins = {};
+
+ let x: number;
+
+ function storeExchangeCoin(mc: any, url: string) {
+ let exchange: IExchangeInfo = mc[0];
+ console.log("got coin for exchange", url);
+ let coin: Coin = mc[1];
+ if (coin.suspended) {
+ console.log("skipping suspended coin",
+ coin.denomPub,
+ "from exchange",
+ exchange.baseUrl);
+ return;
+ }
+ let denom = exchange.active_denoms.find((e) => e.denom_pub === coin.denomPub);
+ if (!denom) {
+ console.warn("denom not found (database inconsistent)");
+ return;
+ }
+ if (denom.value.currency !== paymentAmount.currency) {
+ console.warn("same pubkey for different currencies");
+ return;
+ }
+ let cd = {coin, denom};
+ let x = m[url];
+ if (!x) {
+ m[url] = [cd];
+ } else {
+ x.push(cd);
+ }
+ }
+
+ // Make sure that we don't look up coins
+ // for the same URL twice ...
+ let handledExchanges = new Set();
+
+ let ps = flatMap(allowedExchanges, (info: ExchangeHandle) => {
+ if (handledExchanges.has(info.url)) {
+ return [];
+ }
+ handledExchanges.add(info.url);
+ console.log("Checking for merchant's exchange", JSON.stringify(info));
+ return [
+ Query(this.db)
+ .iter("exchanges", {indexName: "pubKey", only: info.master_pub})
+ .indexJoin("coins", "exchangeBaseUrl", (exchange) => exchange.baseUrl)
+ .reduce((x) => storeExchangeCoin(x, info.url))
+ ];
+ });
+
+ await Promise.all(ps);
+
+ let ret: ExchangeCoins = {};
+
+ if (Object.keys(m).length == 0) {
+ console.log("not suitable exchanges found");
+ }
+
+ console.dir(m);
+
+ // We try to find the first exchange where we have
+ // enough coins to cover the paymentAmount with fees
+ // under depositFeeLimit
+
+ nextExchange:
+ for (let key in m) {
+ let coins = m[key];
+ // Sort by ascending deposit fee
+ coins.sort((o1, o2) => Amounts.cmp(o1.denom.fee_deposit,
+ o2.denom.fee_deposit));
+ let maxFee = Amounts.copy(depositFeeLimit);
+ let minAmount = Amounts.copy(paymentAmount);
+ let accFee = Amounts.copy(coins[0].denom.fee_deposit);
+ let accAmount = Amounts.getZero(coins[0].coin.currentAmount.currency);
+ let usableCoins: CoinWithDenom[] = [];
+ nextCoin:
+ for (let i = 0; i < coins.length; i++) {
+ let coinAmount = Amounts.copy(coins[i].coin.currentAmount);
+ let coinFee = coins[i].denom.fee_deposit;
+ if (Amounts.cmp(coinAmount, coinFee) <= 0) {
+ continue nextCoin;
+ }
+ accFee = Amounts.add(accFee, coinFee).amount;
+ accAmount = Amounts.add(accAmount, coinAmount).amount;
+ if (Amounts.cmp(accFee, maxFee) >= 0) {
+ // FIXME: if the fees are too high, we have
+ // to cover them ourselves ....
+ console.log("too much fees");
+ continue nextExchange;
+ }
+ usableCoins.push(coins[i]);
+ if (Amounts.cmp(accAmount, minAmount) >= 0) {
+ ret[key] = usableCoins;
+ continue nextExchange;
+ }
+ }
+ }
+ return ret;
+ }
+
+
+ /**
+ * Record all information that is necessary to
+ * pay for a contract in the wallet's database.
+ */
+ private async recordConfirmPay(offer: Offer,
+ payCoinInfo: PayCoinInfo,
+ chosenExchange: string): Promise<void> {
+ let payReq: any = {};
+ payReq["amount"] = offer.contract.amount;
+ payReq["coins"] = payCoinInfo.map((x) => x.sig);
+ payReq["H_contract"] = offer.H_contract;
+ payReq["max_fee"] = offer.contract.max_fee;
+ payReq["merchant_sig"] = offer.merchant_sig;
+ payReq["exchange"] = URI(chosenExchange).href();
+ payReq["refund_deadline"] = offer.contract.refund_deadline;
+ payReq["timestamp"] = offer.contract.timestamp;
+ payReq["transaction_id"] = offer.contract.transaction_id;
+ let t: Transaction = {
+ contractHash: offer.H_contract,
+ contract: offer.contract,
+ payReq: payReq,
+ merchantSig: offer.merchant_sig,
+ };
+
+ let historyEntry = {
+ type: "pay",
+ timestamp: (new Date).getTime(),
+ subjectId: `contract-${offer.H_contract}`,
+ detail: {
+ merchantName: offer.contract.merchant.name,
+ amount: offer.contract.amount,
+ contractHash: offer.H_contract,
+ fulfillmentUrl: offer.contract.fulfillment_url
+ }
+ };
+
+ await Query(this.db)
+ .put("transactions", t)
+ .put("history", historyEntry)
+ .putAll("coins", payCoinInfo.map((pci) => pci.updatedCoin))
+ .finish();
+
+ this.notifier.notify();
+ }
+
+
+ async putHistory(historyEntry: HistoryRecord): Promise<void> {
+ await Query(this.db).put("history", historyEntry).finish();
+ this.notifier.notify();
+ }
+
+
+ /**
+ * Add a contract to the wallet and sign coins,
+ * but do not send them yet.
+ */
+ async confirmPay(offer: Offer): Promise<any> {
+ console.log("executing confirmPay");
+
+ let transaction = await Query(this.db)
+ .get("transactions", offer.H_contract);
+
+ if (transaction) {
+ // Already payed ...
+ return {};
+ }
+
+ let mcs = await this.getPossibleExchangeCoins(offer.contract.amount,
+ offer.contract.max_fee,
+ offer.contract.exchanges);
+
+ if (Object.keys(mcs).length == 0) {
+ console.log("not confirming payment, insufficient coins");
+ return {
+ error: "coins-insufficient",
+ };
+ }
+ let exchangeUrl = Object.keys(mcs)[0];
+
+ let ds = await this.cryptoApi.signDeposit(offer, mcs[exchangeUrl]);
+ await this.recordConfirmPay(offer,
+ ds,
+ exchangeUrl);
+ return {};
+ }
+
+
+ /**
+ * Add a contract to the wallet and sign coins,
+ * but do not send them yet.
+ */
+ async checkPay(offer: Offer): Promise<any> {
+ // First check if we already payed for it.
+ let transaction = await
+ Query(this.db)
+ .get("transactions", offer.H_contract);
+ if (transaction) {
+ return {isPayed: true};
+ }
+
+ // If not already payed, check if we could pay for it.
+ let mcs = await this.getPossibleExchangeCoins(offer.contract.amount,
+ offer.contract.max_fee,
+ offer.contract.exchanges);
+
+ if (Object.keys(mcs).length == 0) {
+ console.log("not confirming payment, insufficient coins");
+ return {
+ error: "coins-insufficient",
+ };
+ }
+ return {isPayed: false};
+ }
+
+
+ /**
+ * Retrieve all necessary information for looking up the contract
+ * with the given hash.
+ */
+ async executePayment(H_contract: string): Promise<any> {
+ let t = await Query(this.db)
+ .get("transactions", H_contract);
+ if (!t) {
+ return {
+ success: false,
+ contractFound: false,
+ }
+ }
+ let resp = {
+ success: true,
+ payReq: t.payReq,
+ contract: t.contract,
+ };
+ return resp;
+ }
+
+
+ /**
+ * First fetch information requred to withdraw from the reserve,
+ * then deplete the reserve, withdrawing coins until it is empty.
+ */
+ private async processReserve(reserveRecord: ReserveRecord,
+ retryDelayMs: number = 250): Promise<void> {
+ const opId = "reserve-" + reserveRecord.reserve_pub;
+ this.startOperation(opId);
+
+ try {
+ let exchange = await this.updateExchangeFromUrl(reserveRecord.exchange_base_url);
+ let reserve = await this.updateReserve(reserveRecord.reserve_pub,
+ exchange);
+ let n = await this.depleteReserve(reserve, exchange);
+
+ if (n != 0) {
+ let depleted = {
+ type: "depleted-reserve",
+ subjectId: `reserve-progress-${reserveRecord.reserve_pub}`,
+ timestamp: (new Date).getTime(),
+ detail: {
+ reservePub: reserveRecord.reserve_pub,
+ requestedAmount: reserveRecord.requested_amount,
+ currentAmount: reserveRecord.current_amount,
+ }
+ };
+ await Query(this.db).put("history", depleted).finish();
+ }
+ } catch (e) {
+ // random, exponential backoff truncated at 3 minutes
+ let nextDelay = Math.min(2 * retryDelayMs + retryDelayMs * Math.random(),
+ 3000 * 60);
+ console.warn(`Failed to deplete reserve, trying again in ${retryDelayMs} ms`);
+ setTimeout(() => this.processReserve(reserveRecord, nextDelay),
+ retryDelayMs);
+ } finally {
+ this.stopOperation(opId);
+ }
+ }
+
+
+ private async processPreCoin(preCoin: PreCoin,
+ retryDelayMs = 100): Promise<void> {
+ try {
+ const coin = await this.withdrawExecute(preCoin);
+ this.storeCoin(coin);
+ } catch (e) {
+ console.error("Failed to withdraw coin from precoin, retrying in",
+ retryDelayMs,
+ "ms", e);
+ // exponential backoff truncated at one minute
+ let nextRetryDelayMs = Math.min(retryDelayMs * 2, 1000 * 60);
+ setTimeout(() => this.processPreCoin(preCoin, nextRetryDelayMs),
+ retryDelayMs);
+ }
+ }
+
+
+ /**
+ * Create a reserve, but do not flag it as confirmed yet.
+ */
+ async createReserve(req: CreateReserveRequest): Promise<CreateReserveResponse> {
+ let keypair = await this.cryptoApi.createEddsaKeypair();
+ const now = (new Date).getTime();
+ const canonExchange = canonicalizeBaseUrl(req.exchange);
+
+ const reserveRecord: ReserveRecord = {
+ reserve_pub: keypair.pub,
+ reserve_priv: keypair.priv,
+ exchange_base_url: canonExchange,
+ created: now,
+ last_query: null,
+ current_amount: null,
+ requested_amount: req.amount,
+ confirmed: false,
+ withdrawn_amount: Amounts.getZero(req.amount.currency)
+ };
+
+ const historyEntry = {
+ type: "create-reserve",
+ timestamp: now,
+ subjectId: `reserve-progress-${reserveRecord.reserve_pub}`,
+ detail: {
+ requestedAmount: req.amount,
+ reservePub: reserveRecord.reserve_pub,
+ }
+ };
+
+ await Query(this.db)
+ .put("reserves", reserveRecord)
+ .put("history", historyEntry)
+ .finish();
+
+ let r: CreateReserveResponse = {
+ exchange: canonExchange,
+ reservePub: keypair.pub,
+ };
+ return r;
+ }
+
+
+ /**
+ * Mark an existing reserve as confirmed. The wallet will start trying
+ * to withdraw from that reserve. This may not immediately succeed,
+ * since the exchange might not know about the reserve yet, even though the
+ * bank confirmed its creation.
+ *
+ * A confirmed reserve should be shown to the user in the UI, while
+ * an unconfirmed reserve should be hidden.
+ */
+ async confirmReserve(req: ConfirmReserveRequest): Promise<void> {
+ const now = (new Date).getTime();
+ let reserve: ReserveRecord = await Query(this.db)
+ .get("reserves", req.reservePub);
+ const historyEntry = {
+ type: "confirm-reserve",
+ timestamp: now,
+ subjectId: `reserve-progress-${reserve.reserve_pub}`,
+ detail: {
+ reservePub: req.reservePub,
+ requestedAmount: reserve.requested_amount,
+ }
+ };
+ if (!reserve) {
+ console.error("Unable to confirm reserve, not found in DB");
+ return;
+ }
+ reserve.confirmed = true;
+ await Query(this.db)
+ .put("reserves", reserve)
+ .put("history", historyEntry)
+ .finish();
+
+ this.processReserve(reserve);
+ }
+
+
+ private async withdrawExecute(pc: PreCoin): Promise<Coin> {
+ let reserve = await Query(this.db)
+ .get("reserves", pc.reservePub);
+
+ let wd: any = {};
+ wd.denom_pub = pc.denomPub;
+ wd.reserve_pub = pc.reservePub;
+ wd.reserve_sig = pc.withdrawSig;
+ wd.coin_ev = pc.coinEv;
+ let reqUrl = URI("reserve/withdraw").absoluteTo(reserve.exchange_base_url);
+ let resp = await this.http.postJson(reqUrl, wd);
+
+
+ if (resp.status != 200) {
+ throw new RequestException({
+ hint: "Withdrawal failed",
+ status: resp.status
+ });
+ }
+ let r = JSON.parse(resp.responseText);
+ let denomSig = await this.cryptoApi.rsaUnblind(r.ev_sig,
+ pc.blindingKey,
+ pc.denomPub);
+ let coin: Coin = {
+ coinPub: pc.coinPub,
+ coinPriv: pc.coinPriv,
+ denomPub: pc.denomPub,
+ denomSig: denomSig,
+ currentAmount: pc.coinValue,
+ exchangeBaseUrl: pc.exchangeBaseUrl,
+ };
+ return coin;
+ }
+
+ async storeCoin(coin: Coin): Promise<void> {
+ console.log("storing coin", new Date());
+
+ let historyEntry: HistoryRecord = {
+ type: "withdraw",
+ timestamp: (new Date).getTime(),
+ level: HistoryLevel.Expert,
+ detail: {
+ coinPub: coin.coinPub,
+ }
+ };
+ await Query(this.db)
+ .delete("precoins", coin.coinPub)
+ .add("coins", coin)
+ .add("history", historyEntry)
+ .finish();
+ this.notifier.notify();
+ }
+
+
+ /**
+ * Withdraw one coin of the given denomination from the given reserve.
+ */
+ private async withdraw(denom: Denomination, reserve: Reserve): Promise<void> {
+ console.log("creating pre coin at", new Date());
+ let preCoin = await this.cryptoApi
+ .createPreCoin(denom, reserve);
+ await Query(this.db)
+ .put("precoins", preCoin)
+ .finish();
+ await this.processPreCoin(preCoin);
+ }
+
+
+ /**
+ * Withdraw coins from a reserve until it is empty.
+ */
+ private async depleteReserve(reserve: any,
+ exchange: IExchangeInfo): Promise<number> {
+ let denomsAvailable: Denomination[] = copy(exchange.active_denoms);
+ let denomsForWithdraw = getWithdrawDenomList(reserve.current_amount,
+ denomsAvailable);
+
+ let ps = denomsForWithdraw.map((denom) => this.withdraw(denom, reserve));
+ await Promise.all(ps);
+ return ps.length;
+ }
+
+
+ /**
+ * Update the information about a reserve that is stored in the wallet
+ * by quering the reserve's exchange.
+ */
+ private async updateReserve(reservePub: string,
+ exchange: IExchangeInfo): Promise<Reserve> {
+ let reserve = await Query(this.db)
+ .get("reserves", reservePub);
+ let reqUrl = URI("reserve/status").absoluteTo(exchange.baseUrl);
+ reqUrl.query({'reserve_pub': reservePub});
+ let resp = await this.http.get(reqUrl);
+ if (resp.status != 200) {
+ throw Error();
+ }
+ let reserveInfo = JSON.parse(resp.responseText);
+ if (!reserveInfo) {
+ throw Error();
+ }
+ let oldAmount = reserve.current_amount;
+ let newAmount = reserveInfo.balance;
+ reserve.current_amount = reserveInfo.balance;
+ let historyEntry = {
+ type: "reserve-update",
+ timestamp: (new Date).getTime(),
+ subjectId: `reserve-progress-${reserve.reserve_pub}`,
+ detail: {
+ reservePub,
+ requestedAmount: reserve.requested_amount,
+ oldAmount,
+ newAmount
+ }
+ };
+ await Query(this.db)
+ .put("reserves", reserve)
+ .finish();
+ return reserve;
+ }
+
+
+ /**
+ * Get the wire information for the exchange with the given base URL.
+ */
+ async getWireInfo(exchangeBaseUrl: string): Promise<WireInfo> {
+ exchangeBaseUrl = canonicalizeBaseUrl(exchangeBaseUrl);
+ let reqUrl = URI("wire").absoluteTo(exchangeBaseUrl);
+ let resp = await this.http.get(reqUrl);
+
+ if (resp.status != 200) {
+ throw Error("/wire request failed");
+ }
+
+ let wiJson = JSON.parse(resp.responseText);
+ if (!wiJson) {
+ throw Error("/wire response malformed")
+ }
+ return wiJson;
+ }
+
+ async getReserveCreationInfo(baseUrl: string,
+ amount: AmountJson): Promise<ReserveCreationInfo> {
+ let exchangeInfo = await this.updateExchangeFromUrl(baseUrl);
+
+ let selectedDenoms = getWithdrawDenomList(amount,
+ exchangeInfo.active_denoms);
+ let acc = Amounts.getZero(amount.currency);
+ for (let d of selectedDenoms) {
+ acc = Amounts.add(acc, d.fee_withdraw).amount;
+ }
+ let actualCoinCost = selectedDenoms
+ .map((d: Denomination) => Amounts.add(d.value,
+ d.fee_withdraw).amount)
+ .reduce((a, b) => Amounts.add(a, b).amount);
+
+ let wireInfo = await this.getWireInfo(baseUrl);
+
+ let ret: ReserveCreationInfo = {
+ exchangeInfo,
+ selectedDenoms,
+ wireInfo,
+ withdrawFee: acc,
+ overhead: Amounts.sub(amount, actualCoinCost).amount,
+ };
+ return ret;
+ }
+
+
+ /**
+ * Update or add exchange DB entry by fetching the /keys information.
+ * Optionally link the reserve entry to the new or existing
+ * exchange entry in then DB.
+ */
+ async updateExchangeFromUrl(baseUrl: string): Promise<IExchangeInfo> {
+ baseUrl = canonicalizeBaseUrl(baseUrl);
+ let reqUrl = URI("keys").absoluteTo(baseUrl);
+ let resp = await this.http.get(reqUrl);
+ if (resp.status != 200) {
+ throw Error("/keys request failed");
+ }
+ let exchangeKeysJson = KeysJson.checked(JSON.parse(resp.responseText));
+ return this.updateExchangeFromJson(baseUrl, exchangeKeysJson);
+ }
+
+ private async suspendCoins(exchangeInfo: IExchangeInfo): Promise<void> {
+ let suspendedCoins = await Query(this.db)
+ .iter("coins",
+ {indexName: "exchangeBaseUrl", only: exchangeInfo.baseUrl})
+ .reduce((coin: Coin, suspendedCoins: Coin[]) => {
+ if (!exchangeInfo.active_denoms.find((c) => c.denom_pub == coin.denomPub)) {
+ return Array.prototype.concat(suspendedCoins, [coin]);
+ }
+ return Array.prototype.concat(suspendedCoins);
+ }, []);
+
+ let q = Query(this.db);
+ suspendedCoins.map((c) => {
+ console.log("suspending coin", c);
+ c.suspended = true;
+ q.put("coins", c);
+ });
+ await q.finish();
+ }
+
+
+ private async updateExchangeFromJson(baseUrl: string,
+ exchangeKeysJson: KeysJson): Promise<IExchangeInfo> {
+ const updateTimeSec = getTalerStampSec(exchangeKeysJson.list_issue_date);
+ if (updateTimeSec === null) {
+ throw Error("invalid update time");
+ }
+
+ let r = await Query(this.db).get("exchanges", baseUrl);
+
+ let exchangeInfo: IExchangeInfo;
+
+ if (!r) {
+ exchangeInfo = {
+ baseUrl,
+ all_denoms: [],
+ active_denoms: [],
+ last_update_time: updateTimeSec,
+ masterPublicKey: exchangeKeysJson.master_public_key,
+ };
+ console.log("making fresh exchange");
+ } else {
+ if (updateTimeSec < r.last_update_time) {
+ console.log("outdated /keys, not updating");
+ return r
+ }
+ exchangeInfo = r;
+ console.log("updating old exchange");
+ }
+
+ let updatedExchangeInfo = await this.updateExchangeInfo(exchangeInfo,
+ exchangeKeysJson);
+ await this.suspendCoins(updatedExchangeInfo);
+
+ await Query(this.db)
+ .put("exchanges", updatedExchangeInfo)
+ .finish();
+
+ return updatedExchangeInfo;
+ }
+
+
+ private async updateExchangeInfo(exchangeInfo: IExchangeInfo,
+ newKeys: KeysJson): Promise<IExchangeInfo> {
+ if (exchangeInfo.masterPublicKey != newKeys.master_public_key) {
+ throw Error("public keys do not match");
+ }
+
+ exchangeInfo.active_denoms = [];
+
+ let denomsToCheck = newKeys.denoms.filter((newDenom) => {
+ // did we find the new denom in the list of all (old) denoms?
+ let found = false;
+ for (let oldDenom of exchangeInfo.all_denoms) {
+ if (oldDenom.denom_pub === newDenom.denom_pub) {
+ let a: any = Object.assign({}, oldDenom);
+ let b: any = Object.assign({}, newDenom);
+ // pub hash is only there for convenience in the wallet
+ delete a["pub_hash"];
+ delete b["pub_hash"];
+ if (!deepEquals(a, b)) {
+ console.error("denomination parameters were modified, old/new:");
+ console.dir(a);
+ console.dir(b);
+ // FIXME: report to auditors
+ }
+ found = true;
+ break;
+ }
+ }
+
+ if (found) {
+ exchangeInfo.active_denoms.push(newDenom);
+ // No need to check signatures
+ return false;
+ }
+ return true;
+ });
+
+ let ps = denomsToCheck.map(async(denom) => {
+ let valid = await this.cryptoApi
+ .isValidDenom(denom,
+ exchangeInfo.masterPublicKey);
+ if (!valid) {
+ console.error("invalid denomination",
+ denom,
+ "with key",
+ exchangeInfo.masterPublicKey);
+ // FIXME: report to auditors
+ }
+ exchangeInfo.active_denoms.push(denom);
+ exchangeInfo.all_denoms.push(denom);
+ });
+
+ await Promise.all(ps);
+
+ return exchangeInfo;
+ }
+
+
+ /**
+ * Retrieve a mapping from currency name to the amount
+ * that is currenctly available for spending in the wallet.
+ */
+ async getBalances(): Promise<any> {
+ function collectBalances(c: Coin, byCurrency: any) {
+ if (c.suspended) {
+ return byCurrency;
+ }
+ let acc: AmountJson = byCurrency[c.currentAmount.currency];
+ if (!acc) {
+ acc = Amounts.getZero(c.currentAmount.currency);
+ }
+ byCurrency[c.currentAmount.currency] = Amounts.add(c.currentAmount,
+ acc).amount;
+ return byCurrency;
+ }
+
+ let byCurrency = await Query(this.db)
+ .iter("coins")
+ .reduce(collectBalances, {});
+
+ return {balances: byCurrency};
+ }
+
+
+ /**
+ * Retrive the full event history for this wallet.
+ */
+ async getHistory(): Promise<any> {
+ function collect(x: any, acc: any) {
+ acc.push(x);
+ return acc;
+ }
+
+ let history = await
+ Query(this.db)
+ .iter("history", {indexName: "timestamp"})
+ .reduce(collect, []);
+
+ return {history};
+ }
+
+ async hashContract(contract: any): Promise<string> {
+ return this.cryptoApi.hashString(canonicalJson(contract));
+ }
+
+ /**
+ * Check if there's an equivalent contract we've already purchased.
+ */
+ async checkRepurchase(contract: Contract): Promise<CheckRepurchaseResult> {
+ if (!contract.repurchase_correlation_id) {
+ console.log("no repurchase: no correlation id");
+ return {isRepurchase: false};
+ }
+ let result: Transaction = await Query(this.db)
+ .getIndexed("transactions",
+ "repurchase",
+ [contract.merchant_pub, contract.repurchase_correlation_id]);
+
+ if (result) {
+ console.assert(result.contract.repurchase_correlation_id == contract.repurchase_correlation_id);
+ return {
+ isRepurchase: true,
+ existingContractHash: result.contractHash,
+ existingFulfillmentUrl: result.contract.fulfillment_url,
+ };
+ } else {
+ return {isRepurchase: false};
+ }
+ }
+} \ No newline at end of file
diff --git a/lib/wallet/wxApi.ts b/lib/wallet/wxApi.ts
new file mode 100644
index 000000000..84235c6a9
--- /dev/null
+++ b/lib/wallet/wxApi.ts
@@ -0,0 +1,41 @@
+/*
+ This file is part of TALER
+ (C) 2016 GNUnet e.V.
+
+ TALER is free software; you can redistribute it and/or modify it under the
+ terms of the GNU General Public License as published by the Free Software
+ Foundation; either version 3, or (at your option) any later version.
+
+ TALER is distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along with
+ TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
+ */
+
+import {AmountJson} from "./types";
+import {ReserveCreationInfo} from "./types";
+
+/**
+ * Interface to the wallet through WebExtension messaging.
+ * @author Florian Dold
+ */
+
+
+export function getReserveCreationInfo(baseUrl: string,
+ amount: AmountJson): Promise<ReserveCreationInfo> {
+ let m = {type: "reserve-creation-info", detail: {baseUrl, amount}};
+ return new Promise((resolve, reject) => {
+ chrome.runtime.sendMessage(m, (resp) => {
+ if (resp.error) {
+ console.error("error response", resp);
+ let e = Error("call to reserve-creation-info failed");
+ (e as any).errorResponse = resp;
+ reject(e);
+ return;
+ }
+ resolve(resp);
+ });
+ });
+}
diff --git a/lib/wallet/wxMessaging.ts b/lib/wallet/wxMessaging.ts
new file mode 100644
index 000000000..5c97248c4
--- /dev/null
+++ b/lib/wallet/wxMessaging.ts
@@ -0,0 +1,392 @@
+/*
+ This file is part of TALER
+ (C) 2016 GNUnet e.V.
+
+ TALER is free software; you can redistribute it and/or modify it under the
+ terms of the GNU General Public License as published by the Free Software
+ Foundation; either version 3, or (at your option) any later version.
+
+ TALER is distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along with
+ TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
+ */
+
+
+import {
+ Wallet,
+ Offer,
+ Badge,
+ ConfirmReserveRequest,
+ CreateReserveRequest
+} from "./wallet";
+import {deleteDb, exportDb, openTalerDb} from "./db";
+import {BrowserHttpLib} from "./http";
+import {Checkable} from "./checkable";
+import {AmountJson} from "./types";
+import Port = chrome.runtime.Port;
+import {Notifier} from "./types";
+import {Contract} from "./types";
+import MessageSender = chrome.runtime.MessageSender;
+import {ChromeBadge} from "./chromeBadge";
+
+"use strict";
+
+/**
+ * Messaging for the WebExtensions wallet. Should contain
+ * parts that are specific for WebExtensions, but as little business
+ * logic as possible.
+ *
+ * @author Florian Dold
+ */
+
+
+type Handler = (detail: any, sender: MessageSender) => Promise<any>;
+
+function makeHandlers(db: IDBDatabase,
+ wallet: Wallet): {[msg: string]: Handler} {
+ return {
+ ["balances"]: function(detail, sender) {
+ return wallet.getBalances();
+ },
+ ["dump-db"]: function(detail, sender) {
+ return exportDb(db);
+ },
+ ["ping"]: function(detail, sender) {
+ if (!sender || !sender.tab || !sender.tab.id) {
+ return Promise.resolve();
+ }
+ let id: number = sender.tab.id;
+ let info: any = <any>paymentRequestCookies[id];
+ delete paymentRequestCookies[id];
+ return Promise.resolve(info);
+ },
+ ["reset"]: function(detail, sender) {
+ if (db) {
+ let tx = db.transaction(Array.from(db.objectStoreNames), 'readwrite');
+ for (let i = 0; i < db.objectStoreNames.length; i++) {
+ tx.objectStore(db.objectStoreNames[i]).clear();
+ }
+ }
+ deleteDb();
+
+ chrome.browserAction.setBadgeText({text: ""});
+ console.log("reset done");
+ // Response is synchronous
+ return Promise.resolve({});
+ },
+ ["create-reserve"]: function(detail, sender) {
+ const d = {
+ exchange: detail.exchange,
+ amount: detail.amount,
+ };
+ const req = CreateReserveRequest.checked(d);
+ return wallet.createReserve(req);
+ },
+ ["confirm-reserve"]: function(detail, sender) {
+ // TODO: make it a checkable
+ const d = {
+ reservePub: detail.reservePub
+ };
+ const req = ConfirmReserveRequest.checked(d);
+ return wallet.confirmReserve(req);
+ },
+ ["confirm-pay"]: function(detail, sender) {
+ let offer: Offer;
+ try {
+ offer = Offer.checked(detail.offer);
+ } catch (e) {
+ if (e instanceof Checkable.SchemaError) {
+ console.error("schema error:", e.message);
+ return Promise.resolve({
+ error: "invalid contract",
+ hint: e.message,
+ detail: detail
+ });
+ } else {
+ throw e;
+ }
+ }
+
+ return wallet.confirmPay(offer);
+ },
+ ["check-pay"]: function(detail, sender) {
+ let offer: Offer;
+ try {
+ offer = Offer.checked(detail.offer);
+ } catch (e) {
+ if (e instanceof Checkable.SchemaError) {
+ console.error("schema error:", e.message);
+ return Promise.resolve({
+ error: "invalid contract",
+ hint: e.message,
+ detail: detail
+ });
+ } else {
+ throw e;
+ }
+ }
+ return wallet.checkPay(offer);
+ },
+ ["execute-payment"]: function(detail: any, sender: MessageSender) {
+ if (sender.tab && sender.tab.id) {
+ rateLimitCache[sender.tab.id]++;
+ if (rateLimitCache[sender.tab.id] > 10) {
+ console.warn("rate limit for execute payment exceeded");
+ let msg = {
+ error: "rate limit exceeded for execute-payment",
+ rateLimitExceeded: true,
+ hint: "Check for redirect loops",
+ };
+ return Promise.resolve(msg);
+ }
+ }
+ return wallet.executePayment(detail.H_contract);
+ },
+ ["exchange-info"]: function(detail) {
+ if (!detail.baseUrl) {
+ return Promise.resolve({error: "bad url"});
+ }
+ return wallet.updateExchangeFromUrl(detail.baseUrl);
+ },
+ ["hash-contract"]: function(detail) {
+ if (!detail.contract) {
+ return Promise.resolve({error: "contract missing"});
+ }
+ return wallet.hashContract(detail.contract).then((hash) => {
+ return {hash};
+ });
+ },
+ ["put-history-entry"]: function(detail: any) {
+ if (!detail.historyEntry) {
+ return Promise.resolve({error: "historyEntry missing"});
+ }
+ return wallet.putHistory(detail.historyEntry);
+ },
+ ["reserve-creation-info"]: function(detail, sender) {
+ if (!detail.baseUrl || typeof detail.baseUrl !== "string") {
+ return Promise.resolve({error: "bad url"});
+ }
+ let amount = AmountJson.checked(detail.amount);
+ return wallet.getReserveCreationInfo(detail.baseUrl, amount);
+ },
+ ["check-repurchase"]: function(detail, sender) {
+ let contract = Contract.checked(detail.contract);
+ return wallet.checkRepurchase(contract);
+ },
+ ["get-history"]: function(detail, sender) {
+ // TODO: limit history length
+ return wallet.getHistory();
+ },
+ ["payment-failed"]: function(detail, sender) {
+ // For now we just update exchanges (maybe the exchange did something
+ // wrong and the keys were messed up).
+ // FIXME: in the future we should look at what actually went wrong.
+ console.error("payment reported as failed");
+ wallet.updateExchanges();
+ return Promise.resolve();
+ },
+ };
+}
+
+
+function dispatch(handlers: any, req: any, sender: any, sendResponse: any) {
+ if (req.type in handlers) {
+ Promise
+ .resolve()
+ .then(() => {
+ const p = handlers[req.type](req.detail, sender);
+
+ return p.then((r: any) => {
+ try {
+ sendResponse(r);
+ } catch (e) {
+ // might fail if tab disconnected
+ }
+ })
+ })
+ .catch((e) => {
+ console.log(`exception during wallet handler for '${req.type}'`);
+ console.log("request", req);
+ console.error(e);
+ try {
+ sendResponse({
+ error: "exception",
+ hint: e.message,
+ stack: e.stack.toString()
+ });
+
+ } catch (e) {
+ // might fail if tab disconnected
+ }
+ });
+ // The sendResponse call is async
+ return true;
+ } else {
+ console.error(`Request type ${JSON.stringify(req)} unknown, req ${req.type}`);
+ try {
+ sendResponse({error: "request unknown"});
+ } catch (e) {
+ // might fail if tab disconnected
+ }
+
+ // The sendResponse call is sync
+ return false;
+ }
+}
+
+class ChromeNotifier implements Notifier {
+ ports: Port[] = [];
+
+ constructor() {
+ chrome.runtime.onConnect.addListener((port) => {
+ console.log("got connect!");
+ this.ports.push(port);
+ port.onDisconnect.addListener(() => {
+ let i = this.ports.indexOf(port);
+ if (i >= 0) {
+ this.ports.splice(i, 1);
+ } else {
+ console.error("port already removed");
+ }
+ });
+ });
+ }
+
+ notify() {
+ console.log("notifying all ports");
+ for (let p of this.ports) {
+ p.postMessage({notify: true});
+ }
+ }
+}
+
+
+/**
+ * Mapping from tab ID to payment information (if any).
+ */
+let paymentRequestCookies: {[n: number]: any} = {};
+
+function handleHttpPayment(headerList: chrome.webRequest.HttpHeader[],
+ url: string, tabId: number): any {
+ const headers: {[s: string]: string} = {};
+ for (let kv of headerList) {
+ if (kv.value) {
+ headers[kv.name.toLowerCase()] = kv.value;
+ }
+ }
+
+ const contractUrl = headers["x-taler-contract-url"];
+ if (contractUrl !== undefined) {
+ paymentRequestCookies[tabId] = {type: "fetch", contractUrl};
+ return;
+ }
+
+ const contractHash = headers["x-taler-contract-hash"];
+
+ if (contractHash !== undefined) {
+ const payUrl = headers["x-taler-pay-url"];
+ if (payUrl === undefined) {
+ console.log("malformed 402, X-Taler-Pay-Url missing");
+ return;
+ }
+
+ // Offer URL is optional
+ const offerUrl = headers["x-taler-offer-url"];
+ paymentRequestCookies[tabId] = {
+ type: "execute",
+ offerUrl,
+ payUrl,
+ contractHash
+ };
+ return;
+ }
+
+ // looks like it's not a taler request, it might be
+ // for a different payment system (or the shop is buggy)
+ console.log("ignoring non-taler 402 response");
+}
+
+// Useful for debugging ...
+export let wallet: Wallet|undefined = undefined;
+export let badge: ChromeBadge|undefined = undefined;
+
+// Rate limit cache for executePayment operations, to break redirect loops
+let rateLimitCache: {[n: number]: number} = {};
+
+function clearRateLimitCache() {
+ rateLimitCache = {};
+}
+
+export function wxMain() {
+ chrome.browserAction.setBadgeText({text: ""});
+ badge = new ChromeBadge();
+
+ chrome.tabs.query({}, function(tabs) {
+ for (let tab of tabs) {
+ if (!tab.url || !tab.id) {
+ return;
+ }
+ let uri = URI(tab.url);
+ if (uri.protocol() == "http" || uri.protocol() == "https") {
+ console.log("injecting into existing tab", tab.id);
+ chrome.tabs.executeScript(tab.id, {file: "lib/vendor/URI.js"});
+ chrome.tabs.executeScript(tab.id, {file: "lib/taler-wallet-lib.js"});
+ chrome.tabs.executeScript(tab.id, {file: "content_scripts/notify.js"});
+ }
+ }
+ });
+
+ chrome.extension.getBackgroundPage().setInterval(clearRateLimitCache, 5000);
+
+ Promise.resolve()
+ .then(() => {
+ return openTalerDb();
+ })
+ .catch((e) => {
+ console.error("could not open database");
+ console.error(e);
+ })
+ .then((db: IDBDatabase) => {
+ let http = new BrowserHttpLib();
+ let notifier = new ChromeNotifier();
+ console.log("setting wallet");
+ wallet = new Wallet(db, http, badge!, notifier);
+
+ // Handlers for messages coming directly from the content
+ // script on the page
+ let handlers = makeHandlers(db, wallet!);
+ chrome.runtime.onMessage.addListener((req, sender, sendResponse) => {
+ try {
+ return dispatch(handlers, req, sender, sendResponse)
+ } catch (e) {
+ console.log(`exception during wallet handler (dispatch)`);
+ console.log("request", req);
+ console.error(e);
+ sendResponse({
+ error: "exception",
+ hint: e.message,
+ stack: e.stack.toString()
+ });
+ return false;
+ }
+ });
+
+ // Handlers for catching HTTP requests
+ chrome.webRequest.onHeadersReceived.addListener((details) => {
+ if (details.statusCode != 402) {
+ return;
+ }
+ console.log(`got 402 from ${details.url}`);
+ return handleHttpPayment(details.responseHeaders || [],
+ details.url,
+ details.tabId);
+ }, {urls: ["<all_urls>"]}, ["responseHeaders", "blocking"]);
+ })
+ .catch((e) => {
+ console.error("could not initialize wallet messaging");
+ console.error(e);
+ });
+} \ No newline at end of file