Full Code of yudai/gotty for AI

master a080c85cbc59 cached
166 files
1.9 MB
881.3k tokens
904 symbols
1 requests
Download .txt
Showing preview only (1,983K chars total). Download the full file or copy to clipboard to get everything.
Repository: yudai/gotty
Branch: master
Commit: a080c85cbc59
Files: 166
Total size: 1.9 MB

Directory structure:
gitextract_2tont2x0/

├── .github/
│   └── ISSUE_TEMPLATE.md
├── .gitignore
├── .gotty
├── CONTRIBUTING.md
├── Godeps/
│   ├── Godeps.json
│   └── Readme
├── LICENSE
├── Makefile
├── README.md
├── backend/
│   ├── doc.go
│   └── localcommand/
│       ├── doc.go
│       ├── factory.go
│       ├── local_command.go
│       └── options.go
├── favicon.psd
├── help.go
├── js/
│   ├── dist/
│   │   ├── gotty-bundle.js
│   │   ├── hterm.d.ts
│   │   ├── main.d.ts
│   │   ├── websocket.d.ts
│   │   ├── webtty.d.ts
│   │   └── xterm.d.ts
│   ├── package.json
│   ├── src/
│   │   ├── hterm.ts
│   │   ├── main.ts
│   │   ├── websocket.ts
│   │   ├── webtty.ts
│   │   └── xterm.ts
│   ├── tsconfig.json
│   ├── typings/
│   │   └── libapps/
│   │       └── index.d.ts
│   └── webpack.config.js
├── main.go
├── pkg/
│   ├── homedir/
│   │   └── expand.go
│   └── randomstring/
│       └── generate.go
├── resources/
│   ├── index.css
│   ├── index.html
│   └── xterm_customize.css
├── server/
│   ├── asset.go
│   ├── handler_atomic.go
│   ├── handlers.go
│   ├── init_message.go
│   ├── list_address.go
│   ├── log_response_writer.go
│   ├── middleware.go
│   ├── options.go
│   ├── run_option.go
│   ├── server.go
│   ├── slave.go
│   └── ws_wrapper.go
├── utils/
│   ├── default.go
│   └── flags.go
├── vendor/
│   └── github.com/
│       ├── NYTimes/
│       │   └── gziphandler/
│       │       ├── .gitignore
│       │       ├── .travis.yml
│       │       ├── CODE_OF_CONDUCT.md
│       │       ├── CONTRIBUTING.md
│       │       ├── LICENSE.md
│       │       ├── README.md
│       │       ├── gzip.go
│       │       └── gzip_go18.go
│       ├── codegangsta/
│       │   └── cli/
│       │       ├── .gitignore
│       │       ├── .travis.yml
│       │       ├── CHANGELOG.md
│       │       ├── LICENSE
│       │       ├── README.md
│       │       ├── app.go
│       │       ├── appveyor.yml
│       │       ├── category.go
│       │       ├── cli.go
│       │       ├── command.go
│       │       ├── context.go
│       │       ├── errors.go
│       │       ├── flag-types.json
│       │       ├── flag.go
│       │       ├── flag_generated.go
│       │       ├── funcs.go
│       │       ├── generate-flag-types
│       │       ├── help.go
│       │       └── runtests
│       ├── elazarl/
│       │   └── go-bindata-assetfs/
│       │       ├── LICENSE
│       │       ├── README.md
│       │       ├── assetfs.go
│       │       └── doc.go
│       ├── fatih/
│       │   └── structs/
│       │       ├── .gitignore
│       │       ├── .travis.yml
│       │       ├── LICENSE
│       │       ├── README.md
│       │       ├── field.go
│       │       ├── structs.go
│       │       └── tags.go
│       ├── gorilla/
│       │   └── websocket/
│       │       ├── .gitignore
│       │       ├── .travis.yml
│       │       ├── AUTHORS
│       │       ├── LICENSE
│       │       ├── README.md
│       │       ├── client.go
│       │       ├── conn.go
│       │       ├── doc.go
│       │       ├── json.go
│       │       ├── server.go
│       │       └── util.go
│       ├── hashicorp/
│       │   └── go-multierror/
│       │       ├── LICENSE
│       │       ├── README.md
│       │       ├── append.go
│       │       ├── flatten.go
│       │       ├── format.go
│       │       └── multierror.go
│       ├── kr/
│       │   └── pty/
│       │       ├── .gitignore
│       │       ├── License
│       │       ├── README.md
│       │       ├── doc.go
│       │       ├── ioctl.go
│       │       ├── ioctl_bsd.go
│       │       ├── mktypes.bash
│       │       ├── pty_darwin.go
│       │       ├── pty_freebsd.go
│       │       ├── pty_linux.go
│       │       ├── pty_unsupported.go
│       │       ├── run.go
│       │       ├── types.go
│       │       ├── types_freebsd.go
│       │       ├── util.go
│       │       ├── ztypes_386.go
│       │       ├── ztypes_amd64.go
│       │       ├── ztypes_arm.go
│       │       ├── ztypes_arm64.go
│       │       ├── ztypes_freebsd_386.go
│       │       ├── ztypes_freebsd_amd64.go
│       │       ├── ztypes_freebsd_arm.go
│       │       ├── ztypes_ppc64.go
│       │       ├── ztypes_ppc64le.go
│       │       └── ztypes_s390x.go
│       ├── pkg/
│       │   └── errors/
│       │       ├── .gitignore
│       │       ├── .travis.yml
│       │       ├── LICENSE
│       │       ├── README.md
│       │       ├── appveyor.yml
│       │       ├── errors.go
│       │       └── stack.go
│       └── yudai/
│           └── hcl/
│               ├── .gitignore
│               ├── LICENSE
│               ├── Makefile
│               ├── README.md
│               ├── decoder.go
│               ├── hcl/
│               │   ├── lex.go
│               │   ├── object.go
│               │   ├── parse.go
│               │   ├── parse.y
│               │   ├── valuetype_string.go
│               │   └── y.go
│               ├── hcl.go
│               ├── json/
│               │   ├── lex.go
│               │   ├── parse.go
│               │   ├── parse.y
│               │   └── y.go
│               ├── lex.go
│               └── parse.go
├── version.go
├── webtty/
│   ├── doc.go
│   ├── errors.go
│   ├── master.go
│   ├── message_types.go
│   ├── option.go
│   ├── slave.go
│   ├── webtty.go
│   └── webtty_test.go
└── wercker.yml

================================================
FILE CONTENTS
================================================

================================================
FILE: .github/ISSUE_TEMPLATE.md
================================================
# When file a bug report (see below for feature requests)

Please answer these quesions for a bug report. Thanks!

### What version of GoTTY are you using (`gotty --version`)?


### What operating system and browser are you using?


### What did you do?

If possible, please provide the command you ran.


### What did you expect to see?


### What did you see instead?

If possible, please provide the output of the command and your browser's console output.



# When file a new feature proposal

Please provide an actual usecase that requires your new feature.


================================================
FILE: .gitignore
================================================
gotty
bindata
builds
js/node_modules/*


================================================
FILE: .gotty
================================================
// [string] Address to listen, all addresses will be used when empty
// address = ""

// [string] Port to listen
// port = "8080"

// [bool] Permit clients to write to the TTY
// permit_write = false

// [bool] Enable basic authentication
// enable_basic_auth = false

// [string] Default username and password of basic authentication (user:pass)
//          To enable basic authentication, set `true` to `enable_basic_auth`
// credential = "user:pass"

// [bool] Enable random URL generation
// enable_random_url = false

// [int] Default length of random strings appended to URL
//       To enable random URL generation, set `true` to `enable_random_url`
// random_url_length = 8

// [bool] Enable TLS/SSL
// enable_tls = false

// [string] Default TLS certificate file path
// tls_crt_file = "~/.gotty.crt"

// [string] Default TLS key file path
// tls_key_file = "~/.gotty.key"

// [bool] Enable client certificate authentication
// enable_tls_client_auth = false

// [string] Certificate file of CA for client certificates
// tls_ca_crt_file = "~/.gotty.ca.crt"

// [string] Custom index.html file
// index_file = ""

// [string] Title format of browser window
//          Available variables are:
//            Command    Command string
//            Pid        PID of the process for the client
//            Hostname   Server hostname
//            RemoteAddr Client IP address
// title_format = "GoTTY - {{ .Command }} ({{ .Hostname }})"

// [bool] Enable client side reconnection when connection closed
// enable_reconnect = false

// [int] Interval time to try reconnection (seconds)
//       To enable reconnection, set `true` to `enable_reconnect`
// reconnect_time = 10

// [int] Timeout seconds for waiting a client (0 to disable)
// timeout = 60

// [int] Maximum connection to gotty, 0(default) means no limit.
// max_connection = 0

// [bool] Accept only one client and exit gotty once the client exits
// once = false

// [bool] Permit clients to send command line arguments in URL (e.g. http://example.com:8080/?arg=AAA&arg=BBB)
// permit_arguments = false

// [object] Client terminal (hterm) preferences
// preferences {

  // [enum(null, "none", "ctrl-alt", "left-alt", "right-alt")]
  //     Select an AltGr detection hack^Wheuristic.
  //       null: Autodetect based on navigator.language: "en-us" => "none", else => "right-alt"
  //       "none": Disable any AltGr related munging.
  //       "ctrl-alt": Assume Ctrl+Alt means AltGr.
  //       "left-alt": Assume left Alt means AltGr.
  //       "right-alt": Assume right Alt means AltGr.
  // alt_gr_mode = null

  // [bool] If set, alt-backspace indeed is alt-backspace.
  // alt_backspace_is_meta_backspace = false

  // [bool] Set whether the alt key acts as a meta key or as a distinct alt key.
  // alt_is_meta = false

  // [enum("escape", "8-bit", "browser-key")]
  //     Controls how the alt key is handled.
  //       "escape"....... Send an ESC prefix.
  //       "8-bit"........ Add 128 to the unshifted character as in xterm.
  //       "browser-key".. Wait for the keypress event and see what the browser says.
  //                       (This won't work well on platforms where the browser performs a default action for some alt sequences.)
  // alt_sends_what = "escape"

  // [string] URL of the terminal bell sound.  Empty string for no audible bell.
  // audible_bell_sound = "lib-resource:hterm/audio/bell"

  // [bool] If true, terminal bells in the background will create a Web Notification. http://www.w3.org/TR/notifications/
  //        Displaying notifications requires permission from the user.
  //        When this option is set to true, hterm will attempt to ask the user for permission if necessary.
  //        Note browsers may not show this permission request
  //        if it did not originate from a user action.
  // desktop_notification_bell = false

  // [string] The background color for text with no other color attributes.
  // background_color = "rgb(16, 16, 16)"

  // [string] CSS value of the background image.  Empty string for no image.
  //          For example:
  //            "url(https://goo.gl/anedTK) linear-gradient(top bottom, blue, red)"
  // background_image = ""

  // [string] CSS value of the background image size.  Defaults to none.
  // background_size = ""

  // [string] CSS value of the background image position.
  //          For example:
  //           "10% 10% center"
  // background_position = ""

  // [bool] If true, the backspace should send BS ('\x08', aka ^H).  Otherwise the backspace key should send '\x7f'.
  // backspace_sends_backspace = false

  // [map[string]map[string]string]
  //     A nested map where each property is the character set code and the value is a map that is a sparse array itself.
  //     In that sparse array, each property is the received character and the value is the displayed character.
  //     For example:
  //       {"0" = {"+" = "\u2192"
  //               "," = "\u2190"
  //               "-" = "\u2191"
  //               "." = "\u2193"
  //               "0" = "\u2588"}}
  // character_map_overrides = null

  // [bool] Whether or not to close the window when the command exits.
  // close_on_exit = true

  // [bool] Whether or not to blink the cursor by default.
  // cursor_blink = false

  // [2[int]] The cursor blink rate in milliseconds.
  //          A two element array, the first of which is how long the cursor should be on, second is how long it should be off.
  // cursor_blink_cycle = [1000, 500]

  // [string] The color of the visible cursor.
  // cursor_color = "rgba(255, 0, 0, 0.5)"

  // [[]string]
  //     Override colors in the default palette.
  //     This can be specified as an array or an object.
  //     Values can be specified as almost any css color value.
  //     This includes #RGB, #RRGGBB, rgb(...), rgba(...), and any color names that are also part of the stock X11 rgb.txt file.
  //     You can use 'null' to specify that the default value should be not be changed.
  //     This is useful for skipping a small number of indicies when the value is specified as an array.
  // color_palette_overrides = null

  // [bool] Automatically copy mouse selection to the clipboard.
  // copy_on_select = true

  // [bool] Whether to use the default window copy behaviour
  // use_default_window_copy = false

  // [bool] Whether to clear the selection after copying.
  // clear_selection_after_copy = true

  // [bool] If true, Ctrl-Plus/Minus/Zero controls zoom.
  //        If false, Ctrl-Shift-Plus/Minus/Zero controls zoom, Ctrl-Minus sends ^_, Ctrl-Plus/Zero do nothing.
  // ctrl_plus_minus_zero_zoom = true

  // [bool] Ctrl+C copies if true, send ^C to host if false.
  //        Ctrl+Shift+C sends ^C to host if true, copies if false.
  // ctrl_c_copy = false

  // [bool] Ctrl+V pastes if true, send ^V to host if false.
  //        Ctrl+Shift+V sends ^V to host if true, pastes if false.
  // ctrl_v_paste = false

  // [bool] Set whether East Asian Ambiguous characters have two column width.
  // east_asian_ambiguous_as_two_column = false

  // [bool] True to enable 8-bit control characters, false to ignore them.
  //        We'll respect the two-byte versions of these control characters regardless of this setting.
  // enable_8_bit_control = false

  // [enum(null, true, false)]
  //     True if we should use bold weight font for text with the bold/bright attribute.
  //     False to use the normal weight font.
  //     Null to autodetect.
  // enable_bold = null

  // [bool] True if we should use bright colors (8-15 on a 16 color palette) for any text with the bold attribute.
  //        False otherwise.
  // enable_bold_as_bright = true

  // [bool] Show a message in the terminal when the host writes to the clipboard.
  // enable_clipboard_notice = true

  // [bool] Allow the host to write directly to the system clipboard.
  // enable_clipboard_write = true

  // [bool] Respect the host's attempt to change the cursor blink status using DEC Private Mode 12.
  // enable_dec12 = false

  // [map[string]string] The default environment variables, as an object.
  // environment = {"TERM" = "xterm-256color"}

  // [string] Default font family for the terminal text.
  // font_family = "'DejaVu Sans Mono', 'Everson Mono', FreeMono, 'Menlo', 'Terminal', monospace"

  // [int] The default font size in pixels.
  // font_size = 15

  // [string] CSS font-smoothing property.
  // font_smoothing = "antialiased"

  // [string] The foreground color for text with no other color attributes.
  // foreground_color = "rgb(240, 240, 240)"

  // [bool] If true, home/end will control the terminal scrollbar and shift home/end will send the VT keycodes.
  //        If false then home/end sends VT codes and shift home/end scrolls.
  // home_keys_scroll = false

  // [map[string]string]
  //     A map of key sequence to key actions.
  //     Key sequences include zero or more modifier keys followed by a key code.
  //     Key codes can be decimal or hexadecimal numbers, or a key identifier.
  //     Key actions can be specified a string to send to the host, or an action identifier.
  //     For a full list of key code and action identifiers, see https://goo.gl/8AoD09.
  //     Sample keybindings:
  //       {"Ctrl-Alt-K" = "clearScrollback"
  //        "Ctrl-Shift-L"= "PASS"
  //        "Ctrl-H" = "'HELLO\n'"}
  // keybindings = null

  // [int] Max length of a DCS, OSC, PM, or APS sequence before we give up and ignore the code.
  // max_string_sequence = 100000

  // [bool] If true, convert media keys to their Fkey equivalent.
  //        If false, let the browser handle the keys.
  // media_keys_are_fkeys = false

  // [bool] Set whether the meta key sends a leading escape or not.
  // meta_sends_escape = true

  // [enum(null, 0, 1, 2, 3, 4, 5, 6]
  //     Mouse paste button, or null to autodetect.
  //     For autodetect, we'll try to enable middle button paste for non-X11 platforms.
  //     On X11 we move it to button 3.
  // mouse_paste_button = null

  // [bool] If true, page up/down will control the terminal scrollbar and shift page up/down will send the VT keycodes.
  //        If false then page up/down sends VT codes and shift page up/down scrolls.
  // page_keys_scroll = false

  // [enum(null, true, false)]
  //     Set whether we should pass Alt-1..9 to the browser.
  //     This is handy when running hterm in a browser tab, so that you don't lose Chrome's "switch to tab" keyboard accelerators.
  //     When not running in a tab it's better to send these keys to the host so they can be used in vim or emacs.
  //     If true, Alt-1..9 will be handled by the browser.
  //     If false, Alt-1..9 will be sent to the host.
  //     If null, autodetect based on browser platform and window type.
  // pass_alt_number = null

  // [enum(null, true, false)]
  //     Set whether we should pass Ctrl-1..9 to the browser.
  //     This is handy when running hterm in a browser tab, so that you don't lose Chrome's "switch to tab" keyboard accelerators.
  //     When not running in a tab it's better to send these keys to the host so they can be used in vim or emacs.
  //     If true, Ctrl-1..9 will be handled by the browser.
  //     If false, Ctrl-1..9 will be sent to the host.
  //     If null, autodetect based on browser platform and window type.
  // pass_ctrl_number = null

  // [enum(null, true, false)]
  //     Set whether we should pass Meta-1..9 to the browser.
  //     This is handy when running hterm in a browser tab, so that you don't lose Chrome's "switch to tab" keyboard accelerators.
  //     When not running in a tab it's better to send these keys to the host so they can be used in vim or emacs.
  //     If true, Meta-1..9 will be handled by the browser.
  //     If false, Meta-1..9 will be sent to the host.  If null, autodetect based on browser platform and window type.
  // pass_meta_number = null

  // [bool] Set whether meta-V gets passed to host.
  // pass_meta_v = true

  // [bool] If true, scroll to the bottom on any keystroke.
  // scroll_on_keystroke = true

  // [bool] If true, scroll to the bottom on terminal output.
  // scroll_on_output = false

  // [bool] The vertical scrollbar mode.
  // scrollbar_visible = true

  // [int] The multiplier for the pixel delta in mousewheel event caused by the scroll wheel. Alters how fast the page scrolls.
  // scroll_wheel_move_multiplier = 1

  // [bool] Shift + Insert pastes if true, sent to host if false.
  // shift_insert_paste = true

  // [string] URL of user stylesheet to include in the terminal document.
  // user_css = ""

// }


================================================
FILE: CONTRIBUTING.md
================================================
# How to contribute

GoTTY is MIT licensed and accepts contributions via GitHub pull requests. We also accepts feature requests on GitHub issues.

## Reporting a bug

Reporting a bug is always welcome and one of the best ways to contribute. A good bug report helps the developers to improve the product much easier. We therefore would like to ask you to fill out the quesions on the issue template as much as possible. That helps us to figure out what's happening and discover the root cause.


## Requesting a new feature

When you find that GoTTY cannot fullfill your requirements because of lack of ability, you may want to open a new feature request. In that case, please file a new issue with your usecase and requirements.


## Opening a pull request

### Code Style

Please run `go fmt` on your Go code and make sure that your commits are organized for each logical change and your commit messages are in proper format (see below).

[Go's official code style guide](https://github.com/golang/go/wiki/CodeReviewComments) is also helpful.

### Format of the commit message

When you write a commit message, we recommend include following information to make review easier and keep the history cleaerer.

* What is the change
* The reason for the change

The following is an example:

```
Add something new to existing package

Since the existing function lacks that mechanism for some purpose,
this commit adds a new structure to provide it.
```

When your pull request is to add a new feature, we recommend add an actual usecase so that we can discuss the best way to achive your requirement. Opening a proposal issue in advance is another good way to start discussion of new features.


## Contact

If you have a trivial question about GoTTY for a bug or new feature, you can contact @i_yudai on Twitter (unfortunately, I cannot provide support on GoTTY though).


================================================
FILE: Godeps/Godeps.json
================================================
{
	"ImportPath": "github.com/yudai/gotty",
	"GoVersion": "go1.9",
	"GodepVersion": "v79",
	"Deps": [
		{
			"ImportPath": "github.com/NYTimes/gziphandler",
			"Rev": "967539e5e271a2bc9b3dcb1285078a1b1df105ae"
		},
		{
			"ImportPath": "github.com/codegangsta/cli",
			"Comment": "v1.19.1",
			"Rev": "0bdeddeeb0f650497d603c4ad7b20cfe685682f6"
		},
		{
			"ImportPath": "github.com/elazarl/go-bindata-assetfs",
			"Rev": "d5cac425555ca5cf00694df246e04f05e6a55150"
		},
		{
			"ImportPath": "github.com/fatih/structs",
			"Rev": "a9f7daa9c2729e97450c2da2feda19130a367d8f"
		},
		{
			"ImportPath": "github.com/gorilla/websocket",
			"Rev": "b6ab76f1fe9803ee1d59e7e5b2a797c1fe897ce5"
		},
		{
			"ImportPath": "github.com/hashicorp/go-multierror",
			"Rev": "56912fb08d85084aa318edcf2bba735b97cf35c5"
		},
		{
			"ImportPath": "github.com/kr/pty",
			"Comment": "release.r56-28-g5cf931e",
			"Rev": "5cf931ef8f76dccd0910001d74a58a7fca84a83d"
		},
		{
			"ImportPath": "github.com/pkg/errors",
			"Comment": "v0.8.0-2-g248dadf",
			"Rev": "248dadf4e9068a0b3e79f02ed0a610d935de5302"
		},
		{
			"ImportPath": "github.com/yudai/hcl",
			"Rev": "5fa2393b3552119bf33a69adb1402a1160cba23d"
		},
		{
			"ImportPath": "github.com/yudai/hcl/hcl",
			"Rev": "5fa2393b3552119bf33a69adb1402a1160cba23d"
		},
		{
			"ImportPath": "github.com/yudai/hcl/json",
			"Rev": "5fa2393b3552119bf33a69adb1402a1160cba23d"
		}
	]
}


================================================
FILE: Godeps/Readme
================================================
This directory tree is generated automatically by godep.

Please do not edit.

See https://github.com/tools/godep for more information.


================================================
FILE: LICENSE
================================================
The MIT License (MIT)

Copyright (c) 2015-2017 Iwasaki Yudai

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.


================================================
FILE: Makefile
================================================
OUTPUT_DIR = ./builds
GIT_COMMIT = `git rev-parse HEAD | cut -c1-7`
VERSION = 2.0.0-alpha.3
BUILD_OPTIONS = -ldflags "-X main.Version=$(VERSION) -X main.CommitID=$(GIT_COMMIT)"

gotty: main.go server/*.go webtty/*.go backend/*.go Makefile
	godep go build ${BUILD_OPTIONS}

.PHONY: asset
asset: bindata/static/js/gotty-bundle.js bindata/static/index.html bindata/static/favicon.png bindata/static/css/index.css bindata/static/css/xterm.css bindata/static/css/xterm_customize.css
	go-bindata -prefix bindata -pkg server -ignore=\\.gitkeep -o server/asset.go bindata/...
	gofmt -w server/asset.go

.PHONY: all
all: asset gotty

bindata:
	mkdir bindata

bindata/static: bindata
	mkdir bindata/static

bindata/static/index.html: bindata/static resources/index.html
	cp resources/index.html bindata/static/index.html

bindata/static/favicon.png: bindata/static resources/favicon.png
	cp resources/favicon.png bindata/static/favicon.png

bindata/static/js: bindata/static
	mkdir -p bindata/static/js


bindata/static/js/gotty-bundle.js: bindata/static/js js/dist/gotty-bundle.js
	cp js/dist/gotty-bundle.js bindata/static/js/gotty-bundle.js

bindata/static/css: bindata/static
	mkdir -p bindata/static/css

bindata/static/css/index.css: bindata/static/css resources/index.css
	cp resources/index.css bindata/static/css/index.css

bindata/static/css/xterm_customize.css: bindata/static/css resources/xterm_customize.css
	cp resources/xterm_customize.css bindata/static/css/xterm_customize.css

bindata/static/css/xterm.css: bindata/static/css js/node_modules/xterm/dist/xterm.css
	cp js/node_modules/xterm/dist/xterm.css bindata/static/css/xterm.css

js/node_modules/xterm/dist/xterm.css:
	cd js && \
	npm install

js/dist/gotty-bundle.js: js/src/* js/node_modules/webpack
	cd js && \
	`npm bin`/webpack

js/node_modules/webpack:
	cd js && \
	npm install

tools:
	go get github.com/tools/godep
	go get github.com/mitchellh/gox
	go get github.com/tcnksm/ghr
	go get github.com/jteeuwen/go-bindata/...

test:
	if [ `go fmt $(go list ./... | grep -v /vendor/) | wc -l` -gt 0 ]; then echo "go fmt error"; exit 1; fi

cross_compile:
	GOARM=5 gox -os="darwin linux freebsd netbsd openbsd" -arch="386 amd64 arm" -osarch="!darwin/arm" -output "${OUTPUT_DIR}/pkg/{{.OS}}_{{.Arch}}/{{.Dir}}"

targz:
	mkdir -p ${OUTPUT_DIR}/dist
	cd ${OUTPUT_DIR}/pkg/; for osarch in *; do (cd $$osarch; tar zcvf ../../dist/gotty_${VERSION}_$$osarch.tar.gz ./*); done;

shasums:
	cd ${OUTPUT_DIR}/dist; sha256sum * > ./SHA256SUMS

release:
	ghr -c ${GIT_COMMIT} --delete --prerelease -u yudai -r gotty pre-release ${OUTPUT_DIR}/dist


================================================
FILE: README.md
================================================
# ![](https://raw.githubusercontent.com/yudai/gotty/master/resources/favicon.png) GoTTY - Share your terminal as a web application

[![GitHub release](http://img.shields.io/github/release/yudai/gotty.svg?style=flat-square)][release]
[![Wercker](http://img.shields.io/wercker/ci/55d0eeff7331453f0801982c.svg?style=flat-square)][wercker]
[![MIT License](http://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)][license]

[release]: https://github.com/yudai/gotty/releases
[wercker]: https://app.wercker.com/project/bykey/03b91f441bebeda34f80e09a9f14126f
[license]: https://github.com/yudai/gotty/blob/master/LICENSE

GoTTY is a simple command line tool that turns your CLI tools into web applications.

![Screenshot](https://raw.githubusercontent.com/yudai/gotty/master/screenshot.gif)

# Installation

Download the latest stable binary file from the [Releases](https://github.com/yudai/gotty/releases) page. Note that the release marked `Pre-release` is built for testing purpose, which can include unstable or breaking changes. Download a release marked [Latest release](https://github.com/yudai/gotty/releases/latest) for a stabale build.

(Files named with `darwin_amd64` are for Mac OS X users)

## Homebrew Installation

You can install GoTTY with [Homebrew](http://brew.sh/) as well.

```sh
$ brew install yudai/gotty/gotty
```

## `go get` Installation (Development)

If you have a Go language environment, you can install GoTTY with the `go get` command. However, this command builds a binary file from the latest master branch, which can include unstable or breaking changes. GoTTY requires go1.9 or later.

```sh
$ go get github.com/yudai/gotty
```

# Usage

```
Usage: gotty [options] <command> [<arguments...>]
```

Run `gotty` with your preferred command as its arguments (e.g. `gotty top`).

By default, GoTTY starts a web server at port 8080. Open the URL on your web browser and you can see the running command as if it were running on your terminal.

## Options

```
--address value, -a value     IP address to listen (default: "0.0.0.0") [$GOTTY_ADDRESS]
--port value, -p value        Port number to liten (default: "8080") [$GOTTY_PORT]
--permit-write, -w            Permit clients to write to the TTY (BE CAREFUL) [$GOTTY_PERMIT_WRITE]
--credential value, -c value  Credential for Basic Authentication (ex: user:pass, default disabled) [$GOTTY_CREDENTIAL]
--random-url, -r              Add a random string to the URL [$GOTTY_RANDOM_URL]
--random-url-length value     Random URL length (default: 8) [$GOTTY_RANDOM_URL_LENGTH]
--tls, -t                     Enable TLS/SSL [$GOTTY_TLS]
--tls-crt value               TLS/SSL certificate file path (default: "~/.gotty.crt") [$GOTTY_TLS_CRT]
--tls-key value               TLS/SSL key file path (default: "~/.gotty.key") [$GOTTY_TLS_KEY]
--tls-ca-crt value            TLS/SSL CA certificate file for client certifications (default: "~/.gotty.ca.crt") [$GOTTY_TLS_CA_CRT]
--index value                 Custom index.html file [$GOTTY_INDEX]
--title-format value          Title format of browser window (default: "{{ .command }}@{{ .hostname }}") [$GOTTY_TITLE_FORMAT]
--reconnect                   Enable reconnection [$GOTTY_RECONNECT]
--reconnect-time value        Time to reconnect (default: 10) [$GOTTY_RECONNECT_TIME]
--max-connection value        Maximum connection to gotty (default: 0) [$GOTTY_MAX_CONNECTION]
--once                        Accept only one client and exit on disconnection [$GOTTY_ONCE]
--timeout value               Timeout seconds for waiting a client(0 to disable) (default: 0) [$GOTTY_TIMEOUT]
--permit-arguments            Permit clients to send command line arguments in URL (e.g. http://example.com:8080/?arg=AAA&arg=BBB) [$GOTTY_PERMIT_ARGUMENTS]
--width value                 Static width of the screen, 0(default) means dynamically resize (default: 0) [$GOTTY_WIDTH]
--height value                Static height of the screen, 0(default) means dynamically resize (default: 0) [$GOTTY_HEIGHT]
--ws-origin value             A regular expression that matches origin URLs to be accepted by WebSocket. No cross origin requests are acceptable by default [$GOTTY_WS_ORIGIN]
--term value                  Terminal name to use on the browser, one of xterm or hterm. (default: "xterm") [$GOTTY_TERM]
--close-signal value          Signal sent to the command process when gotty close it (default: SIGHUP) (default: 1) [$GOTTY_CLOSE_SIGNAL]
--close-timeout value         Time in seconds to force kill process after client is disconnected (default: -1) (default: -1) [$GOTTY_CLOSE_TIMEOUT]
--config value                Config file path (default: "~/.gotty") [$GOTTY_CONFIG]
--version, -v                 print the version
```

### Config File

You can customize default options and your terminal (hterm) by providing a config file to the `gotty` command. GoTTY loads a profile file at `~/.gotty` by default when it exists.

```
// Listen at port 9000 by default
port = "9000"

// Enable TSL/SSL by default
enable_tls = true

// hterm preferences
// Smaller font and a little bit bluer background color
preferences {
    font_size = 5
    background_color = "rgb(16, 16, 32)"
}
```

See the [`.gotty`](https://github.com/yudai/gotty/blob/master/.gotty) file in this repository for the list of configuration options.

### Security Options

By default, GoTTY doesn't allow clients to send any keystrokes or commands except terminal window resizing. When you want to permit clients to write input to the TTY, add the `-w` option. However, accepting input from remote clients is dangerous for most commands. When you need interaction with the TTY for some reasons, consider starting GoTTY with tmux or GNU Screen and run your command on it (see "Sharing with Multiple Clients" section for detail).

To restrict client access, you can use the `-c` option to enable the basic authentication. With this option, clients need to input the specified username and password to connect to the GoTTY server. Note that the credentical will be transmitted between the server and clients in plain text. For more strict authentication, consider the SSL/TLS client certificate authentication described below.

The `-r` option is a little bit casualer way to restrict access. With this option, GoTTY generates a random URL so that only people who know the URL can get access to the server.  

All traffic between the server and clients are NOT encrypted by default. When you send secret information through GoTTY, we strongly recommend you use the `-t` option which enables TLS/SSL on the session. By default, GoTTY loads the crt and key files placed at `~/.gotty.crt` and `~/.gotty.key`. You can overwrite these file paths with the `--tls-crt` and `--tls-key` options. When you need to generate a self-signed certification file, you can use the `openssl` command.

```sh
openssl req -x509 -nodes -days 9999 -newkey rsa:2048 -keyout ~/.gotty.key -out ~/.gotty.crt
```

(NOTE: For Safari uses, see [how to enable self-signed certificates for WebSockets](http://blog.marcon.me/post/24874118286/secure-websockets-safari) when use self-signed certificates)

For additional security, you can use the SSL/TLS client certificate authentication by providing a CA certificate file to the `--tls-ca-crt` option (this option requires the `-t` or `--tls` to be set). This option requires all clients to send valid client certificates that are signed by the specified certification authority.

## Sharing with Multiple Clients

GoTTY starts a new process with the given command when a new client connects to the server. This means users cannot share a single terminal with others by default. However, you can use terminal multiplexers for sharing a single process with multiple clients.

For example, you can start a new tmux session named `gotty` with `top` command by the command below.

```sh
$ gotty tmux new -A -s gotty top
```

This command doesn't allow clients to send keystrokes, however, you can attach the session from your local terminal and run operations like switching the mode of the `top` command. To connect to the tmux session from your terminal, you can use following command.

```sh
$ tmux new -A -s gotty
```

By using terminal multiplexers, you can have the control of your terminal and allow clients to just see your screen.

### Quick Sharing on tmux

To share your current session with others by a shortcut key, you can add a line like below to your `.tmux.conf`.

```
# Start GoTTY in a new window with C-t
bind-key C-t new-window "gotty tmux attach -t `tmux display -p '#S'`"
```

## Playing with Docker

When you want to create a jailed environment for each client, you can use Docker containers like following:

```sh
$ gotty -w docker run -it --rm busybox
```

## Development

You can build a binary using the following commands. Windows is not supported now. go1.9 is required.

```sh
# Install tools
go get github.com/jteeuwen/go-bindata/...
go get github.com/tools/godep

# Build
make
```

To build the frontend part (JS files and other static files), you need `npm`.

## Architecture

GoTTY uses [xterm.js](https://xtermjs.org/) and [hterm](https://groups.google.com/a/chromium.org/forum/#!forum/chromium-hterm) to run a JavaScript based terminal on web browsers. GoTTY itself provides a websocket server that simply relays output from the TTY to clients and receives input from clients and forwards it to the TTY. This hterm + websocket idea is inspired by [Wetty](https://github.com/krishnasrinivas/wetty).

## Alternatives

### Command line client

* [gotty-client](https://github.com/moul/gotty-client): If you want to connect to GoTTY server from your terminal

### Terminal/SSH on Web Browsers

* [Secure Shell (Chrome App)](https://chrome.google.com/webstore/detail/secure-shell/pnhechapfaindjhompbnflcldabbghjo): If you are a chrome user and need a "real" SSH client on your web browser, perhaps the Secure Shell app is what you want
* [Wetty](https://github.com/krishnasrinivas/wetty): Node based web terminal (SSH/login)
* [ttyd](https://tsl0922.github.io/ttyd): C port of GoTTY with CJK and IME support

### Terminal Sharing

* [tmate](http://tmate.io/): Forked-Tmux based Terminal-Terminal sharing
* [termshare](https://termsha.re): Terminal-Terminal sharing through a HTTP server
* [tmux](https://tmux.github.io/): Tmux itself also supports TTY sharing through SSH)

# License

The MIT License


================================================
FILE: backend/doc.go
================================================
package backend


================================================
FILE: backend/localcommand/doc.go
================================================
// Package localcommand provides an implementation of webtty.Slave
// that launches a local command with a PTY.
package localcommand


================================================
FILE: backend/localcommand/factory.go
================================================
package localcommand

import (
	"syscall"
	"time"

	"github.com/yudai/gotty/server"
)

type Options struct {
	CloseSignal  int `hcl:"close_signal" flagName:"close-signal" flagSName:"" flagDescribe:"Signal sent to the command process when gotty close it (default: SIGHUP)" default:"1"`
	CloseTimeout int `hcl:"close_timeout" flagName:"close-timeout" flagSName:"" flagDescribe:"Time in seconds to force kill process after client is disconnected (default: -1)" default:"-1"`
}

type Factory struct {
	command string
	argv    []string
	options *Options
	opts    []Option
}

func NewFactory(command string, argv []string, options *Options) (*Factory, error) {
	opts := []Option{WithCloseSignal(syscall.Signal(options.CloseSignal))}
	if options.CloseTimeout >= 0 {
		opts = append(opts, WithCloseTimeout(time.Duration(options.CloseTimeout)*time.Second))
	}

	return &Factory{
		command: command,
		argv:    argv,
		options: options,
		opts:    opts,
	}, nil
}

func (factory *Factory) Name() string {
	return "local command"
}

func (factory *Factory) New(params map[string][]string) (server.Slave, error) {
	argv := make([]string, len(factory.argv))
	copy(argv, factory.argv)
	if params["arg"] != nil && len(params["arg"]) > 0 {
		argv = append(argv, params["arg"]...)
	}

	return New(factory.command, argv, factory.opts...)
}


================================================
FILE: backend/localcommand/local_command.go
================================================
package localcommand

import (
	"os"
	"os/exec"
	"syscall"
	"time"
	"unsafe"

	"github.com/kr/pty"
	"github.com/pkg/errors"
)

const (
	DefaultCloseSignal  = syscall.SIGINT
	DefaultCloseTimeout = 10 * time.Second
)

type LocalCommand struct {
	command string
	argv    []string

	closeSignal  syscall.Signal
	closeTimeout time.Duration

	cmd       *exec.Cmd
	pty       *os.File
	ptyClosed chan struct{}
}

func New(command string, argv []string, options ...Option) (*LocalCommand, error) {
	cmd := exec.Command(command, argv...)

	pty, err := pty.Start(cmd)
	if err != nil {
		// todo close cmd?
		return nil, errors.Wrapf(err, "failed to start command `%s`", command)
	}
	ptyClosed := make(chan struct{})

	lcmd := &LocalCommand{
		command: command,
		argv:    argv,

		closeSignal:  DefaultCloseSignal,
		closeTimeout: DefaultCloseTimeout,

		cmd:       cmd,
		pty:       pty,
		ptyClosed: ptyClosed,
	}

	for _, option := range options {
		option(lcmd)
	}

	// When the process is closed by the user,
	// close pty so that Read() on the pty breaks with an EOF.
	go func() {
		defer func() {
			lcmd.pty.Close()
			close(lcmd.ptyClosed)
		}()

		lcmd.cmd.Wait()
	}()

	return lcmd, nil
}

func (lcmd *LocalCommand) Read(p []byte) (n int, err error) {
	return lcmd.pty.Read(p)
}

func (lcmd *LocalCommand) Write(p []byte) (n int, err error) {
	return lcmd.pty.Write(p)
}

func (lcmd *LocalCommand) Close() error {
	if lcmd.cmd != nil && lcmd.cmd.Process != nil {
		lcmd.cmd.Process.Signal(lcmd.closeSignal)
	}
	for {
		select {
		case <-lcmd.ptyClosed:
			return nil
		case <-lcmd.closeTimeoutC():
			lcmd.cmd.Process.Signal(syscall.SIGKILL)
		}
	}
}

func (lcmd *LocalCommand) WindowTitleVariables() map[string]interface{} {
	return map[string]interface{}{
		"command": lcmd.command,
		"argv":    lcmd.argv,
		"pid":     lcmd.cmd.Process.Pid,
	}
}

func (lcmd *LocalCommand) ResizeTerminal(width int, height int) error {
	window := struct {
		row uint16
		col uint16
		x   uint16
		y   uint16
	}{
		uint16(height),
		uint16(width),
		0,
		0,
	}
	_, _, errno := syscall.Syscall(
		syscall.SYS_IOCTL,
		lcmd.pty.Fd(),
		syscall.TIOCSWINSZ,
		uintptr(unsafe.Pointer(&window)),
	)
	if errno != 0 {
		return errno
	} else {
		return nil
	}
}

func (lcmd *LocalCommand) closeTimeoutC() <-chan time.Time {
	if lcmd.closeTimeout >= 0 {
		return time.After(lcmd.closeTimeout)
	}

	return make(chan time.Time)
}


================================================
FILE: backend/localcommand/options.go
================================================
package localcommand

import (
	"syscall"
	"time"
)

type Option func(*LocalCommand)

func WithCloseSignal(signal syscall.Signal) Option {
	return func(lcmd *LocalCommand) {
		lcmd.closeSignal = signal
	}
}

func WithCloseTimeout(timeout time.Duration) Option {
	return func(lcmd *LocalCommand) {
		lcmd.closeTimeout = timeout
	}
}


================================================
FILE: help.go
================================================
package main

var helpTemplate = `NAME:
   {{.Name}} - {{.Usage}}

USAGE:
   {{.Name}} [options] <command> [<arguments...>]

VERSION:
   {{.Version}}{{if or .Author .Email}}

AUTHOR:{{if .Author}}
  {{.Author}}{{if .Email}} - <{{.Email}}>{{end}}{{else}}
  {{.Email}}{{end}}{{end}}

OPTIONS:
   {{range .Flags}}{{.}}
   {{end}}
`


================================================
FILE: js/dist/gotty-bundle.js
================================================
!function(e){function t(i){if(r[i])return r[i].exports;var o=r[i]={i:i,l:!1,exports:{}};return e[i].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var r={};t.m=e,t.c=r,t.i=function(e){return e},t.d=function(e,r,i){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:i})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=28)}([function(e,t,r){"use strict";function i(e){var t=this;if(!(this instanceof i))return new i(arguments[0],arguments[1],arguments[2]);t.browser=S,t.cancel=i.cancel,u.EventEmitter.call(this),"number"==typeof e&&(e={cols:arguments[0],rows:arguments[1],handler:arguments[2]}),e=e||{},Object.keys(i.defaults).forEach(function(r){null==e[r]&&(e[r]=i.options[r],i[r]!==i.defaults[r]&&(e[r]=i[r])),t[r]=e[r]}),8===e.colors.length?e.colors=e.colors.concat(i._colors.slice(8)):16===e.colors.length?e.colors=e.colors.concat(i._colors.slice(16)):10===e.colors.length?e.colors=e.colors.slice(0,-2).concat(i._colors.slice(8,-2),e.colors.slice(-2)):18===e.colors.length&&(e.colors=e.colors.concat(i._colors.slice(16,-2),e.colors.slice(-2))),this.colors=e.colors,this.options=e,this.parent=e.body||e.parent||(A?A.getElementsByTagName("body")[0]:null),this.cols=e.cols||e.geometry[0],this.rows=e.rows||e.geometry[1],this.geometry=[this.cols,this.rows],e.handler&&this.on("data",e.handler),this.ybase=0,this.ydisp=0,this.x=0,this.y=0,this.cursorState=0,this.cursorHidden=!1,this.convertEol,this.queue="",this.scrollTop=0,this.scrollBottom=this.rows-1,this.customKeyEventHandler=null,this.cursorBlinkInterval=null,this.applicationKeypad=!1,this.applicationCursor=!1,this.originMode=!1,this.insertMode=!1,this.wraparoundMode=!0,this.normal=null,this.charset=null,this.gcharset=null,this.glevel=0,this.charsets=[null],this.decLocator,this.x10Mouse,this.vt200Mouse,this.vt300Mouse,this.normalMouse,this.mouseEvents,this.sendFocus,this.utfMouse,this.sgrMouse,this.urxvtMouse,this.element,this.children,this.refreshStart,this.refreshEnd,this.savedX,this.savedY,this.savedCols,this.readable=!0,this.writable=!0,this.defAttr=131840,this.curAttr=this.defAttr,this.params=[],this.currentParam=0,this.prefix="",this.postfix="",this.inputHandler=new m.InputHandler(this),this.parser=new y.Parser(this.inputHandler,this),this.renderer=this.renderer||null,this.selectionManager=this.selectionManager||null,this.linkifier=this.linkifier||new _.Linkifier,this.writeBuffer=[],this.writeInProgress=!1,this.xoffSentToCatchUp=!1,this.writeStopped=!1,this.surrogate_high="",this.lines=new f.CircularList(this.scrollback);for(var r=this.rows;r--;)this.lines.push(this.blankLine());this.selectionManager&&this.selectionManager.setBuffer(this.lines),this.tabs,this.setupStops(),this.userScrolling=!1}function o(e,t,r,i){Array.isArray(e)||(e=[e]),e.forEach(function(e){e.addEventListener(t,r,i||!1)})}function s(e,t,r,i){e.removeEventListener(t,r,i||!1)}function n(e,t){function r(){this.constructor=e}r.prototype=t.prototype,e.prototype=new r}function a(e,t){var r=e.browser.isMac&&t.altKey&&!t.ctrlKey&&!t.metaKey||e.browser.isMSWindows&&t.altKey&&t.ctrlKey&&!t.metaKey;return"keypress"==t.type?r:r&&(!t.keyCode||t.keyCode>47)}function l(e,t,r){var o=e<<16|t<<8|r;if(null!=l._cache[o])return l._cache[o];for(var s,n,a,h,c,u=1/0,d=-1,p=0;p<i.vcolors.length;p++){if(s=i.vcolors[p],n=s[0],a=s[1],h=s[2],0===(c=l.distance(e,t,r,n,a,h))){d=p;break}c<u&&(u=c,d=p)}return l._cache[o]=d}function h(e){return 16===e.keyCode||17===e.keyCode||18===e.keyCode}/*!
 * xterm (https://npmjs.com/package/xterm)
 * @license MIT
 * @version 2.8.1
 * ==xterm/LICENSE==
 * Copyright (c) 2014-2016, SourceLair Private Company (https://www.sourcelair.com)
 * Copyright (c) 2012-2013, Christopher Jeffrey (https://github.com/chjj/)
 * 
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 * 
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 * 
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */
Object.defineProperty(t,"__esModule",{value:!0});var c=r(15),u=r(1),d=r(22),p=r(23),f=r(25),g=r(2),m=r(16),y=r(18),b=r(19),_=r(17),C=r(20),w=r(24),S=r(9),v=r(10),A="undefined"!=typeof window?window.document:null;n(i,u.EventEmitter),i.prototype.eraseAttr=function(){return-512&this.defAttr|511&this.curAttr},i.tangoColors=["#2e3436","#cc0000","#4e9a06","#c4a000","#3465a4","#75507b","#06989a","#d3d7cf","#555753","#ef2929","#8ae234","#fce94f","#729fcf","#ad7fa8","#34e2e2","#eeeeec"],i.colors=function(){function e(e,r,i){o.push("#"+t(e)+t(r)+t(i))}function t(e){return(e=e.toString(16)).length<2?"0"+e:e}var r,o=i.tangoColors.slice(),s=[0,95,135,175,215,255];for(r=0;r<216;r++)e(s[r/36%6|0],s[r/6%6|0],s[r%6]);for(r=0;r<24;r++)e(s=8+10*r,s,s);return o}(),i._colors=i.colors.slice(),i.vcolors=function(){for(var e,t=[],r=i.colors,o=0;o<256;o++)e=parseInt(r[o].substring(1),16),t.push([e>>16&255,e>>8&255,255&e]);return t}(),i.defaults={colors:i.colors,theme:"default",convertEol:!1,termName:"xterm",geometry:[80,24],cursorBlink:!1,cursorStyle:"block",visualBell:!1,popOnBell:!1,scrollback:1e3,screenKeys:!1,debug:!1,cancelEvents:!1,disableStdin:!1,useFlowControl:!1,tabStopWidth:8},i.options={},i.focus=null,function(e,t,r){if(e.forEach)return e.forEach(t,r);for(var i=0;i<e.length;i++)t.call(r,e[i],i,e)}(function(e){if(Object.keys)return Object.keys(e);var t,r=[];for(t in e)Object.prototype.hasOwnProperty.call(e,t)&&r.push(t);return r}(i.defaults),function(e){i[e]=i.defaults[e],i.options[e]=i.defaults[e]}),i.prototype.focus=function(){return this.textarea.focus()},i.prototype.getOption=function(e,t){if(!(e in i.defaults))throw new Error('No option with key "'+e+'"');return void 0!==this.options[e]?this.options[e]:this[e]},i.prototype.setOption=function(e,t){if(!(e in i.defaults))throw new Error('No option with key "'+e+'"');switch(e){case"scrollback":if(t<this.rows){var r="Setting the scrollback value less than the number of rows ";return r+="("+this.rows+") is not allowed.",console.warn(r),!1}if(this.options[e]!==t){if(this.lines.length>t){var o=this.lines.length-t,s=this.ydisp-o<0;this.lines.trimStart(o),this.ybase=Math.max(this.ybase-o,0),this.ydisp=Math.max(this.ydisp-o,0),s&&this.refresh(0,this.rows-1)}this.lines.maxLength=t,this.viewport.syncScrollArea()}}switch(this[e]=t,this.options[e]=t,e){case"cursorBlink":this.setCursorBlinking(t);break;case"cursorStyle":this.element.classList.toggle("xterm-cursor-style-underline","underline"===t),this.element.classList.toggle("xterm-cursor-style-bar","bar"===t);break;case"tabStopWidth":this.setupStops()}},i.prototype.restartCursorBlinking=function(){this.setCursorBlinking(this.options.cursorBlink)},i.prototype.setCursorBlinking=function(e){if(this.element.classList.toggle("xterm-cursor-blink",e),this.clearCursorBlinkingInterval(),e){var t=this;this.cursorBlinkInterval=setInterval(function(){t.element.classList.toggle("xterm-cursor-blink-on")},600)}},i.prototype.clearCursorBlinkingInterval=function(){this.element.classList.remove("xterm-cursor-blink-on"),this.cursorBlinkInterval&&(clearInterval(this.cursorBlinkInterval),this.cursorBlinkInterval=null)},i.bindFocus=function(e){o(e.textarea,"focus",function(t){e.sendFocus&&e.send(g.C0.ESC+"[I"),e.element.classList.add("focus"),e.showCursor(),e.restartCursorBlinking.apply(e),i.focus=e,e.emit("focus",{terminal:e})})},i.prototype.blur=function(){return this.textarea.blur()},i.bindBlur=function(e){o(e.textarea,"blur",function(t){e.refresh(e.y,e.y),e.sendFocus&&e.send(g.C0.ESC+"[O"),e.element.classList.remove("focus"),e.clearCursorBlinkingInterval.apply(e),i.focus=null,e.emit("blur",{terminal:e})})},i.prototype.initGlobal=function(){var e=this,t=this;i.bindKeys(this),i.bindFocus(this),i.bindBlur(this),o(this.element,"copy",function(r){e.mouseEvents||p.copyHandler(r,t,e.selectionManager)});var r=function(e){return p.pasteHandler(e,t)};o(this.textarea,"paste",r),o(this.element,"paste",r),t.browser.isFirefox?o(this.element,"mousedown",function(t){2==t.button&&p.rightClickHandler(t,e.textarea,e.selectionManager)}):o(this.element,"contextmenu",function(t){p.rightClickHandler(t,e.textarea,e.selectionManager)}),t.browser.isLinux&&o(this.element,"auxclick",function(t){1===t.button&&p.moveTextAreaUnderMouseCursor(t,e.textarea,e.selectionManager)})},i.bindKeys=function(e){o(e.element,"keydown",function(t){A.activeElement==this&&e.keyDown(t)},!0),o(e.element,"keypress",function(t){A.activeElement==this&&e.keyPress(t)},!0),o(e.element,"keyup",function(t){h(t)||e.focus(e)},!0),o(e.textarea,"keydown",function(t){e.keyDown(t)},!0),o(e.textarea,"keypress",function(t){e.keyPress(t),this.value=""},!0),o(e.textarea,"compositionstart",e.compositionHelper.compositionstart.bind(e.compositionHelper)),o(e.textarea,"compositionupdate",e.compositionHelper.compositionupdate.bind(e.compositionHelper)),o(e.textarea,"compositionend",e.compositionHelper.compositionend.bind(e.compositionHelper)),e.on("refresh",e.compositionHelper.updateCompositionElements.bind(e.compositionHelper)),e.on("refresh",function(t){e.queueLinkification(t.start,t.end)})},i.prototype.insertRow=function(e){return"object"!=typeof e&&(e=A.createElement("div")),this.rowContainer.appendChild(e),this.children.push(e),e},i.prototype.open=function(e,t){var r=this,i=this,s=0;if(this.parent=e||this.parent,!this.parent)throw new Error("Terminal requires a parent element.");for(this.context=this.parent.ownerDocument.defaultView,this.document=this.parent.ownerDocument,this.body=this.document.getElementsByTagName("body")[0],this.element=this.document.createElement("div"),this.element.classList.add("terminal"),this.element.classList.add("xterm"),this.element.classList.add("xterm-theme-"+this.theme),this.setCursorBlinking(this.options.cursorBlink),this.element.setAttribute("tabindex",0),this.viewportElement=A.createElement("div"),this.viewportElement.classList.add("xterm-viewport"),this.element.appendChild(this.viewportElement),this.viewportScrollArea=A.createElement("div"),this.viewportScrollArea.classList.add("xterm-scroll-area"),this.viewportElement.appendChild(this.viewportScrollArea),this.selectionContainer=A.createElement("div"),this.selectionContainer.classList.add("xterm-selection"),this.element.appendChild(this.selectionContainer),this.rowContainer=A.createElement("div"),this.rowContainer.classList.add("xterm-rows"),this.element.appendChild(this.rowContainer),this.children=[],this.linkifier.attachToDom(A,this.children),this.helperContainer=A.createElement("div"),this.helperContainer.classList.add("xterm-helpers"),this.element.appendChild(this.helperContainer),this.textarea=A.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this.textarea.addEventListener("focus",function(){i.emit("focus",{terminal:i})}),this.textarea.addEventListener("blur",function(){i.emit("blur",{terminal:i})}),this.helperContainer.appendChild(this.textarea),this.compositionView=A.createElement("div"),this.compositionView.classList.add("composition-view"),this.compositionHelper=new c.CompositionHelper(this.textarea,this.compositionView,this),this.helperContainer.appendChild(this.compositionView),this.charSizeStyleElement=A.createElement("style"),this.helperContainer.appendChild(this.charSizeStyleElement);s<this.rows;s++)this.insertRow();if(this.parent.appendChild(this.element),this.charMeasure=new w.CharMeasure(A,this.helperContainer),this.charMeasure.on("charsizechanged",function(){i.updateCharSizeStyles()}),this.charMeasure.measure(),this.viewport=new d.Viewport(this,this.viewportElement,this.viewportScrollArea,this.charMeasure),this.renderer=new b.Renderer(this),this.selectionManager=new C.SelectionManager(this,this.lines,this.rowContainer,this.charMeasure),this.selectionManager.on("refresh",function(e){r.renderer.refreshSelection(e.start,e.end)}),this.selectionManager.on("newselection",function(e){r.textarea.value=e,r.textarea.focus(),r.textarea.select()}),this.on("scroll",function(){return r.selectionManager.refresh()}),this.viewportElement.addEventListener("scroll",function(){return r.selectionManager.refresh()}),this.refresh(0,this.rows-1),this.initGlobal(),void 0===t){var n="You did not pass the `focus` argument in `Terminal.prototype.open()`.\n";n+="The `focus` argument now defaults to `true` but starting with xterm.js 3.0 ",n+="it will default to `false`.",console.warn(n),t=!0}t&&this.focus(),o(this.element,"click",function(){var e=A.getSelection(),t=e.isCollapsed;("boolean"==typeof t?!t:"Range"==e.type)||i.focus()}),this.bindMouse(),this.emit("open")},i.loadAddon=function(e,t){return r(29)("./"+e+"/"+e)},i.prototype.updateCharSizeStyles=function(){this.charSizeStyleElement.textContent=".xterm-wide-char{width:"+2*this.charMeasure.width+"px;}.xterm-normal-char{width:"+this.charMeasure.width+"px;}.xterm-rows > div{height:"+this.charMeasure.height+"px;}"},i.prototype.bindMouse=function(){function e(e){var t,r;if(t=n(e),r=v.getRawByteCoords(e,l.rowContainer,l.charMeasure,l.cols,l.rows))switch(i(t,r),e.overrideType||e.type){case"mousedown":h=t;break;case"mouseup":h=32}}function t(e){var t,r=h;(t=v.getRawByteCoords(e,l.rowContainer,l.charMeasure,l.cols,l.rows))&&i(r+=32,t)}function r(e,t){if(l.utfMouse){if(2047===t)return e.push(0);t<127?e.push(t):(t>2047&&(t=2047),e.push(192|t>>6),e.push(128|63&t))}else{if(255===t)return e.push(0);t>127&&(t=127),e.push(t)}}function i(e,t){if(l.vt300Mouse){e&=3,t.x-=32,t.y-=32;var i=g.C0.ESC+"[24";if(0===e)i+="1";else if(1===e)i+="3";else if(2===e)i+="5";else{if(3===e)return;i+="0"}return i+="~["+t.x+","+t.y+"]\r",void l.send(i)}return l.decLocator?(e&=3,t.x-=32,t.y-=32,0===e?e=2:1===e?e=4:2===e?e=6:3===e&&(e=3),void l.send(g.C0.ESC+"["+e+";"+(3===e?4:0)+";"+t.y+";"+t.x+";"+(t.page||0)+"&w")):l.urxvtMouse?(t.x-=32,t.y-=32,t.x++,t.y++,void l.send(g.C0.ESC+"["+e+";"+t.x+";"+t.y+"M")):l.sgrMouse?(t.x-=32,t.y-=32,void l.send(g.C0.ESC+"[<"+((3==(3&e)?-4&e:e)-32)+";"+t.x+";"+t.y+(3==(3&e)?"m":"M"))):(r(i=[],e),r(i,t.x),r(i,t.y),void l.send(g.C0.ESC+"[M"+String.fromCharCode.apply(String,i)))}function n(e){var t,r,i,o,s;switch(e.overrideType||e.type){case"mousedown":t=null!=e.button?+e.button:null!=e.which?e.which-1:null,l.browser.isMSIE&&(t=1===t?0:4===t?1:t);break;case"mouseup":t=3;break;case"DOMMouseScroll":t=e.detail<0?64:65;break;case"wheel":t=e.wheelDeltaY>0?64:65}return r=e.shiftKey?4:0,i=e.metaKey?8:0,o=e.ctrlKey?16:0,s=r|i|o,l.vt200Mouse?s&=o:l.normalMouse||(s=0),t=32+(s<<2)+t}var a=this.element,l=this,h=32;o(a,"mousedown",function(r){if(l.mouseEvents)return e(r),l.focus(),l.vt200Mouse?(r.overrideType="mouseup",e(r),l.cancel(r)):(l.normalMouse&&o(l.document,"mousemove",t),l.x10Mouse||o(l.document,"mouseup",function r(i){return e(i),l.normalMouse&&s(l.document,"mousemove",t),s(l.document,"mouseup",r),l.cancel(i)}),l.cancel(r))}),o(a,"wheel",function(t){if(l.mouseEvents&&!(l.x10Mouse||l.vt300Mouse||l.decLocator))return e(t),l.cancel(t)}),o(a,"wheel",function(e){if(!l.mouseEvents)return l.viewport.onWheel(e),l.cancel(e)}),o(a,"touchstart",function(e){if(!l.mouseEvents)return l.viewport.onTouchStart(e),l.cancel(e)}),o(a,"touchmove",function(e){if(!l.mouseEvents)return l.viewport.onTouchMove(e),l.cancel(e)})},i.prototype.destroy=function(){this.readable=!1,this.writable=!1,this._events={},this.handler=function(){},this.write=function(){},this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element)},i.prototype.refresh=function(e,t){this.renderer&&this.renderer.queueRefresh(e,t)},i.prototype.queueLinkification=function(e,t){if(this.linkifier)for(var r=e;r<=t;r++)this.linkifier.linkifyRow(r)},i.prototype.showCursor=function(){this.cursorState||(this.cursorState=1,this.refresh(this.y,this.y))},i.prototype.scroll=function(e){var t;this.lines.length===this.lines.maxLength&&(this.lines.trimStart(1),this.ybase--,0!==this.ydisp&&this.ydisp--),this.ybase++,this.userScrolling||(this.ydisp=this.ybase),t=this.ybase+this.rows-1,(t-=this.rows-1-this.scrollBottom)===this.lines.length?this.lines.push(this.blankLine(void 0,e)):this.lines.splice(t,0,this.blankLine(void 0,e)),0!==this.scrollTop&&(0!==this.ybase&&(this.ybase--,this.userScrolling||(this.ydisp=this.ybase)),this.lines.splice(this.ybase+this.scrollTop,1)),this.updateRange(this.scrollTop),this.updateRange(this.scrollBottom),this.emit("scroll",this.ydisp)},i.prototype.scrollDisp=function(e,t){if(e<0){if(0===this.ydisp)return;this.userScrolling=!0}else e+this.ydisp>=this.ybase&&(this.userScrolling=!1);this.ydisp+=e,this.ydisp>this.ybase?this.ydisp=this.ybase:this.ydisp<0&&(this.ydisp=0),t||this.emit("scroll",this.ydisp),this.refresh(0,this.rows-1)},i.prototype.scrollPages=function(e){this.scrollDisp(e*(this.rows-1))},i.prototype.scrollToTop=function(){this.scrollDisp(-this.ydisp)},i.prototype.scrollToBottom=function(){this.scrollDisp(this.ybase-this.ydisp)},i.prototype.write=function(e){if(this.writeBuffer.push(e),this.options.useFlowControl&&!this.xoffSentToCatchUp&&this.writeBuffer.length>=5&&(this.send(g.C0.DC3),this.xoffSentToCatchUp=!0),!this.writeInProgress&&this.writeBuffer.length>0){this.writeInProgress=!0;var t=this;setTimeout(function(){t.innerWrite()})}},i.prototype.innerWrite=function(){for(var e=this.writeBuffer.splice(0,300);e.length>0;){var t=e.shift();t.length;this.xoffSentToCatchUp&&0===e.length&&0===this.writeBuffer.length&&(this.send(g.C0.DC1),this.xoffSentToCatchUp=!1),this.refreshStart=this.y,this.refreshEnd=this.y;var r=this.parser.parse(t);this.parser.setState(r),this.updateRange(this.y),this.refresh(this.refreshStart,this.refreshEnd)}if(this.writeBuffer.length>0){var i=this;setTimeout(function(){i.innerWrite()},0)}else this.writeInProgress=!1},i.prototype.writeln=function(e){this.write(e+"\r\n")},i.prototype.attachCustomKeydownHandler=function(e){console.warn("attachCustomKeydownHandler() is DEPRECATED and will be removed soon. Please use attachCustomKeyEventHandler() instead."),this.attachCustomKeyEventHandler(e)},i.prototype.attachCustomKeyEventHandler=function(e){this.customKeyEventHandler=e},i.prototype.setHypertextLinkHandler=function(e){if(!this.linkifier)throw new Error("Cannot attach a hypertext link handler before Terminal.open is called");this.linkifier.setHypertextLinkHandler(e),this.refresh(0,this.rows-1)},i.prototype.setHypertextValidationCallback=function(e){if(!this.linkifier)throw new Error("Cannot attach a hypertext validation callback before Terminal.open is called");this.linkifier.setHypertextValidationCallback(e),this.refresh(0,this.rows-1)},i.prototype.registerLinkMatcher=function(e,t,r){if(this.linkifier){var i=this.linkifier.registerLinkMatcher(e,t,r);return this.refresh(0,this.rows-1),i}},i.prototype.deregisterLinkMatcher=function(e){this.linkifier&&this.linkifier.deregisterLinkMatcher(e)&&this.refresh(0,this.rows-1)},i.prototype.hasSelection=function(){return this.selectionManager.hasSelection},i.prototype.getSelection=function(){return this.selectionManager.selectionText},i.prototype.clearSelection=function(){this.selectionManager.clearSelection()},i.prototype.selectAll=function(){this.selectionManager.selectAll()},i.prototype.keyDown=function(e){if(this.customKeyEventHandler&&!1===this.customKeyEventHandler(e))return!1;if(this.restartCursorBlinking(),!this.compositionHelper.keydown.bind(this.compositionHelper)(e))return this.ybase!==this.ydisp&&this.scrollToBottom(),!1;var t=this.evaluateKeyEscapeSequence(e);return t.key===g.C0.DC3?this.writeStopped=!0:t.key===g.C0.DC1&&(this.writeStopped=!1),t.scrollDisp?(this.scrollDisp(t.scrollDisp),this.cancel(e,!0)):!!a(this,e)||(t.cancel&&this.cancel(e,!0),!t.key||(this.emit("keydown",e),this.emit("key",t.key,e),this.showCursor(),this.handler(t.key),this.cancel(e,!0)))},i.prototype.evaluateKeyEscapeSequence=function(e){var t={cancel:!1,key:void 0,scrollDisp:void 0},r=e.shiftKey<<0|e.altKey<<1|e.ctrlKey<<2|e.metaKey<<3;switch(e.keyCode){case 8:if(e.shiftKey){t.key=g.C0.BS;break}t.key=g.C0.DEL;break;case 9:if(e.shiftKey){t.key=g.C0.ESC+"[Z";break}t.key=g.C0.HT,t.cancel=!0;break;case 13:t.key=g.C0.CR,t.cancel=!0;break;case 27:t.key=g.C0.ESC,t.cancel=!0;break;case 37:r?(t.key=g.C0.ESC+"[1;"+(r+1)+"D",t.key==g.C0.ESC+"[1;3D"&&(t.key=this.browser.isMac?g.C0.ESC+"b":g.C0.ESC+"[1;5D")):this.applicationCursor?t.key=g.C0.ESC+"OD":t.key=g.C0.ESC+"[D";break;case 39:r?(t.key=g.C0.ESC+"[1;"+(r+1)+"C",t.key==g.C0.ESC+"[1;3C"&&(t.key=this.browser.isMac?g.C0.ESC+"f":g.C0.ESC+"[1;5C")):this.applicationCursor?t.key=g.C0.ESC+"OC":t.key=g.C0.ESC+"[C";break;case 38:r?(t.key=g.C0.ESC+"[1;"+(r+1)+"A",t.key==g.C0.ESC+"[1;3A"&&(t.key=g.C0.ESC+"[1;5A")):this.applicationCursor?t.key=g.C0.ESC+"OA":t.key=g.C0.ESC+"[A";break;case 40:r?(t.key=g.C0.ESC+"[1;"+(r+1)+"B",t.key==g.C0.ESC+"[1;3B"&&(t.key=g.C0.ESC+"[1;5B")):this.applicationCursor?t.key=g.C0.ESC+"OB":t.key=g.C0.ESC+"[B";break;case 45:e.shiftKey||e.ctrlKey||(t.key=g.C0.ESC+"[2~");break;case 46:t.key=r?g.C0.ESC+"[3;"+(r+1)+"~":g.C0.ESC+"[3~";break;case 36:r?t.key=g.C0.ESC+"[1;"+(r+1)+"H":this.applicationCursor?t.key=g.C0.ESC+"OH":t.key=g.C0.ESC+"[H";break;case 35:r?t.key=g.C0.ESC+"[1;"+(r+1)+"F":this.applicationCursor?t.key=g.C0.ESC+"OF":t.key=g.C0.ESC+"[F";break;case 33:e.shiftKey?t.scrollDisp=-(this.rows-1):t.key=g.C0.ESC+"[5~";break;case 34:e.shiftKey?t.scrollDisp=this.rows-1:t.key=g.C0.ESC+"[6~";break;case 112:t.key=r?g.C0.ESC+"[1;"+(r+1)+"P":g.C0.ESC+"OP";break;case 113:t.key=r?g.C0.ESC+"[1;"+(r+1)+"Q":g.C0.ESC+"OQ";break;case 114:t.key=r?g.C0.ESC+"[1;"+(r+1)+"R":g.C0.ESC+"OR";break;case 115:t.key=r?g.C0.ESC+"[1;"+(r+1)+"S":g.C0.ESC+"OS";break;case 116:t.key=r?g.C0.ESC+"[15;"+(r+1)+"~":g.C0.ESC+"[15~";break;case 117:t.key=r?g.C0.ESC+"[17;"+(r+1)+"~":g.C0.ESC+"[17~";break;case 118:t.key=r?g.C0.ESC+"[18;"+(r+1)+"~":g.C0.ESC+"[18~";break;case 119:t.key=r?g.C0.ESC+"[19;"+(r+1)+"~":g.C0.ESC+"[19~";break;case 120:t.key=r?g.C0.ESC+"[20;"+(r+1)+"~":g.C0.ESC+"[20~";break;case 121:t.key=r?g.C0.ESC+"[21;"+(r+1)+"~":g.C0.ESC+"[21~";break;case 122:t.key=r?g.C0.ESC+"[23;"+(r+1)+"~":g.C0.ESC+"[23~";break;case 123:t.key=r?g.C0.ESC+"[24;"+(r+1)+"~":g.C0.ESC+"[24~";break;default:!e.ctrlKey||e.shiftKey||e.altKey||e.metaKey?this.browser.isMac||!e.altKey||e.ctrlKey||e.metaKey?this.browser.isMac&&!e.altKey&&!e.ctrlKey&&e.metaKey&&65===e.keyCode&&this.selectAll():e.keyCode>=65&&e.keyCode<=90?t.key=g.C0.ESC+String.fromCharCode(e.keyCode+32):192===e.keyCode?t.key=g.C0.ESC+"`":e.keyCode>=48&&e.keyCode<=57&&(t.key=g.C0.ESC+(e.keyCode-48)):e.keyCode>=65&&e.keyCode<=90?t.key=String.fromCharCode(e.keyCode-64):32===e.keyCode?t.key=String.fromCharCode(0):e.keyCode>=51&&e.keyCode<=55?t.key=String.fromCharCode(e.keyCode-51+27):56===e.keyCode?t.key=String.fromCharCode(127):219===e.keyCode?t.key=String.fromCharCode(27):220===e.keyCode?t.key=String.fromCharCode(28):221===e.keyCode&&(t.key=String.fromCharCode(29))}return t},i.prototype.setgLevel=function(e){this.glevel=e,this.charset=this.charsets[e]},i.prototype.setgCharset=function(e,t){this.charsets[e]=t,this.glevel===e&&(this.charset=t)},i.prototype.keyPress=function(e){var t;if(this.customKeyEventHandler&&!1===this.customKeyEventHandler(e))return!1;if(this.cancel(e),e.charCode)t=e.charCode;else if(null==e.which)t=e.keyCode;else{if(0===e.which||0===e.charCode)return!1;t=e.which}return!(!t||(e.altKey||e.ctrlKey||e.metaKey)&&!a(this,e))&&(t=String.fromCharCode(t),this.emit("keypress",t,e),this.emit("key",t,e),this.showCursor(),this.handler(t),!0)},i.prototype.send=function(e){var t=this;this.queue||setTimeout(function(){t.handler(t.queue),t.queue=""},1),this.queue+=e},i.prototype.bell=function(){if(this.visualBell){var e=this;this.element.style.borderColor="white",setTimeout(function(){e.element.style.borderColor=""},10),this.popOnBell&&this.focus()}},i.prototype.log=function(){if(this.debug&&this.context.console&&this.context.console.log){var e=Array.prototype.slice.call(arguments);this.context.console.log.apply(this.context.console,e)}},i.prototype.error=function(){if(this.debug&&this.context.console&&this.context.console.error){var e=Array.prototype.slice.call(arguments);this.context.console.error.apply(this.context.console,e)}},i.prototype.resize=function(e,t){if(!isNaN(e)&&!isNaN(t)){t>this.getOption("scrollback")&&this.setOption("scrollback",t);var r,i,o,s,n;if(e!==this.cols||t!==this.rows){if(e<1&&(e=1),t<1&&(t=1),(o=this.cols)<e)for(s=[this.defAttr," ",1],i=this.lines.length;i--;)for(;this.lines.get(i).length<e;)this.lines.get(i).push(s);if(this.cols=e,this.setupStops(this.cols),o=this.rows,n=0,o<t)for(r=this.element;o++<t;)this.lines.length<t+this.ybase&&(this.ybase>0&&this.lines.length<=this.ybase+this.y+n+1?(this.ybase--,n++,this.ydisp>0&&this.ydisp--):this.lines.push(this.blankLine())),this.children.length<t&&this.insertRow();else for(;o-- >t;)if(this.lines.length>t+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++)),this.children.length>t){if(!(r=this.children.shift()))continue;r.parentNode.removeChild(r)}this.rows=t,this.y>=t&&(this.y=t-1),n&&(this.y+=n),this.x>=e&&(this.x=e-1),this.scrollTop=0,this.scrollBottom=t-1,this.charMeasure.measure(),this.refresh(0,this.rows-1),this.normal=null,this.geometry=[this.cols,this.rows],this.emit("resize",{terminal:this,cols:e,rows:t})}}},i.prototype.updateRange=function(e){e<this.refreshStart&&(this.refreshStart=e),e>this.refreshEnd&&(this.refreshEnd=e)},i.prototype.maxRange=function(){this.refreshStart=0,this.refreshEnd=this.rows-1},i.prototype.setupStops=function(e){for(null!=e?this.tabs[e]||(e=this.prevStop(e)):(this.tabs={},e=0);e<this.cols;e+=this.getOption("tabStopWidth"))this.tabs[e]=!0},i.prototype.prevStop=function(e){for(null==e&&(e=this.x);!this.tabs[--e]&&e>0;);return e>=this.cols?this.cols-1:e<0?0:e},i.prototype.nextStop=function(e){for(null==e&&(e=this.x);!this.tabs[++e]&&e<this.cols;);return e>=this.cols?this.cols-1:e<0?0:e},i.prototype.eraseRight=function(e,t){var r=this.lines.get(this.ybase+t);if(r){for(var i=[this.eraseAttr()," ",1];e<this.cols;e++)r[e]=i;this.updateRange(t)}},i.prototype.eraseLeft=function(e,t){var r=this.lines.get(this.ybase+t);if(r){var i=[this.eraseAttr()," ",1];for(e++;e--;)r[e]=i;this.updateRange(t)}},i.prototype.clear=function(){if(0!==this.ybase||0!==this.y){this.lines.set(0,this.lines.get(this.ybase+this.y)),this.lines.length=1,this.ydisp=0,this.ybase=0,this.y=0;for(var e=1;e<this.rows;e++)this.lines.push(this.blankLine());this.refresh(0,this.rows-1),this.emit("scroll",this.ydisp)}},i.prototype.eraseLine=function(e){this.eraseRight(0,e)},i.prototype.blankLine=function(e,t){var r=[e?this.eraseAttr():this.defAttr," ",1],i=[],o=0;for(t&&(i.isWrapped=t);o<this.cols;o++)i[o]=r;return i},i.prototype.ch=function(e){return e?[this.eraseAttr()," ",1]:[this.defAttr," ",1]},i.prototype.is=function(e){return 0===(this.termName+"").indexOf(e)},i.prototype.handler=function(e){this.options.disableStdin||(this.ybase!==this.ydisp&&this.scrollToBottom(),this.emit("data",e))},i.prototype.handleTitle=function(e){this.emit("title",e)},i.prototype.index=function(){++this.y>this.scrollBottom&&(this.y--,this.scroll()),this.x>=this.cols&&this.x--},i.prototype.reverseIndex=function(){this.y===this.scrollTop?(this.lines.shiftElements(this.y+this.ybase,this.rows-1,1),this.lines.set(this.y+this.ybase,this.blankLine(!0)),this.updateRange(this.scrollTop),this.updateRange(this.scrollBottom)):this.y--},i.prototype.reset=function(){this.options.rows=this.rows,this.options.cols=this.cols;var e=this.customKeyEventHandler,t=this.cursorBlinkInterval;i.call(this,this.options),this.customKeyEventHandler=e,this.cursorBlinkInterval=t,this.refresh(0,this.rows-1),this.viewport.syncScrollArea()},i.prototype.tabSet=function(){this.tabs[this.x]=!0},i.prototype.matchColor=l,l._cache={},l.distance=function(e,t,r,i,o,s){return Math.pow(30*(e-i),2)+Math.pow(59*(t-o),2)+Math.pow(11*(r-s),2)},i.EventEmitter=u.EventEmitter,i.inherits=n,i.on=o,i.off=s,i.cancel=function(e,t){if(this.cancelEvents||t)return e.preventDefault(),e.stopPropagation(),!1},e.exports=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(){this._events=this._events||{}}return e.prototype.on=function(e,t){this._events[e]=this._events[e]||[],this._events[e].push(t)},e.prototype.off=function(e,t){if(this._events[e])for(var r=this._events[e],i=r.length;i--;)if(r[i]===t||r[i].listener===t)return void r.splice(i,1)},e.prototype.removeAllListeners=function(e){this._events[e]&&delete this._events[e]},e.prototype.once=function(e,t){function r(){var i=Array.prototype.slice.call(arguments);return this.off(e,r),t.apply(this,i)}return r.listener=t,this.on(e,r)},e.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(this._events[e])for(var i=this._events[e],o=0;o<i.length;o++)i[o].apply(this,t)},e.prototype.listeners=function(e){return this._events[e]||[]},e}();t.EventEmitter=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});!function(e){e.NUL="\0",e.SOH="",e.STX="",e.ETX="",e.EOT="",e.ENQ="",e.ACK="",e.BEL="",e.BS="\b",e.HT="\t",e.LF="\n",e.VT="\v",e.FF="\f",e.CR="\r",e.SO="",e.SI="",e.DLE="",e.DC1="",e.DC2="",e.DC3="",e.DC4="",e.NAK="",e.SYN="",e.ETB="",e.CAN="",e.EM="",e.SUB="",e.ESC="",e.FS="",e.GS="",e.RS="",e.US="",e.SP=" ",e.DEL=""}(t.C0||(t.C0={}))},function(e,t,r){"use strict";/*!
 * libapps (https://npmjs.com/package/libapps)
 * @license BSD-3-Clause
 * @version 1.70.0
 * ==libapps/LICENSE==
 * // Copyright (c) 2006-2009 The Chromium OS Authors. 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 Google Inc. 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 THE COPYRIGHT
 * // OWNER OR CONTRIBUTORS 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.
 */
if(void 0!==i)throw new Error('Global "lib" object already exists.');var i={};i.runtimeDependencies_={},i.initCallbacks_=[],i.rtdep=function(e){var t;try{throw new Error}catch(e){var r=e.stack.split("\n");t=r.length>=3?r[2].replace(/^\s*at\s+/,""):r[1].replace(/^\s*global code@/,"")}for(var o=0;o<arguments.length;o++){var s=arguments[o];if(s instanceof Array)i.rtdep.apply(i,s);else{var n=this.runtimeDependencies_[s];n||(n=this.runtimeDependencies_[s]=[]),n.push(t)}}},i.ensureRuntimeDependencies_=function(){var e=!0;for(var t in i.runtimeDependencies_)for(var r=i.runtimeDependencies_[t],o=t.split("."),s=window||self,n=0;n<o.length;n++){if(!(o[n]in s)){console.warn('Missing "'+t+'" is needed by',r),e=!1;break}s=s[o[n]]}if(!e)throw new Error("Failed runtime dependency check")},i.registerInit=function(e,t){return i.initCallbacks_.push([e,t]),t},i.init=function(e,t){var r=i.initCallbacks_,o=function(){if(r.length){var s=r.shift();t&&t("init: "+s[0]),s[1](i.f.alarm(o))}else e()};if("function"!=typeof e)throw new Error("Missing or invalid argument: onInit");i.ensureRuntimeDependencies_(),setTimeout(o,0)},String.prototype.padStart||(String.prototype.padStart=function(e,t){return(e-=this.length)<=0?String(this):(void 0===t&&(t=" "),e>t.length&&(t=t.repeat(e/t.length+1)),t.slice(0,e)+String(this))}),String.prototype.padEnd||(String.prototype.padEnd=function(e,t){return(e-=this.length)<=0?String(this):(void 0===t&&(t=" "),e>t.length&&(t=t.repeat(e/t.length+1)),String(this)+t.slice(0,e))}),i.colors={},i.colors.re_={hex16:/#([a-f0-9])([a-f0-9])([a-f0-9])/i,hex24:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/i,rgb:new RegExp("^/s*rgb/s*/(/s*(/d{1,3})/s*,/s*(/d{1,3})/s*,/s*(/d{1,3})/s*/)/s*$".replace(/\//g,"\\"),"i"),rgba:new RegExp("^/s*rgba/s*/(/s*(/d{1,3})/s*,/s*(/d{1,3})/s*,/s*(/d{1,3})/s*(?:,/s*(/d+(?:/./d+)?)/s*)/)/s*$".replace(/\//g,"\\"),"i"),rgbx:new RegExp("^/s*rgba?/s*/(/s*(/d{1,3})/s*,/s*(/d{1,3})/s*,/s*(/d{1,3})/s*(?:,/s*(/d+(?:/./d+)?)/s*)?/)/s*$".replace(/\//g,"\\"),"i"),x11rgb:/^\s*rgb:([a-f0-9]{1,4})\/([a-f0-9]{1,4})\/([a-f0-9]{1,4})\s*$/i,name:/[a-z][a-z0-9\s]+/},i.colors.rgbToX11=function(e){function t(e){return e=(257*Math.min(e,255)).toString(16),i.f.zpad(e,4)}var r=e.match(i.colors.re_.rgbx);return r?"rgb:"+t(r[1])+"/"+t(r[2])+"/"+t(r[3]):null},i.colors.x11HexToCSS=function(e){if(!e.startsWith("#"))return null;if(e=e.substr(1),-1==[3,6,9,12].indexOf(e.length))return null;if(e.match(/[^a-f0-9]/i))return null;var t=e.length/3,r=e.substr(0,t),o=e.substr(t,t),s=e.substr(t+t,t);return i.colors.arrayToRGBA([r,o,s].map(function(e){return e=parseInt(e,16),2==t?e:1==t?e<<4:e>>4*(t-2)}))},i.colors.x11ToCSS=function(e){var t=e.match(i.colors.re_.x11rgb);return t?(t.splice(0,1),i.colors.arrayToRGBA(t.map(function(e){return 1==e.length?parseInt(e+e,16):2==e.length?parseInt(e,16):(3==e.length&&(e+=e.substr(2)),Math.round(parseInt(e,16)/257))}))):e.startsWith("#")?i.colors.x11HexToCSS(e):i.colors.nameToRGB(e)},i.colors.hexToRGB=function(e){function t(e){4==e.length&&(e=e.replace(r,function(e,t,r,i){return"#"+t+t+r+r+i+i}));var t=e.match(o);return t?"rgb("+parseInt(t[1],16)+", "+parseInt(t[2],16)+", "+parseInt(t[3],16)+")":null}var r=i.colors.re_.hex16,o=i.colors.re_.hex24;if(e instanceof Array)for(var s=0;s<e.length;s++)e[s]=t(e[s]);else e=t(e);return e},i.colors.rgbToHex=function(e){function t(e){var t=i.colors.crackRGB(e);return t?"#"+i.f.zpad((parseInt(t[0])<<16|parseInt(t[1])<<8|parseInt(t[2])<<0).toString(16),6):null}if(e instanceof Array)for(var r=0;r<e.length;r++)e[r]=t(e[r]);else e=t(e);return e},i.colors.normalizeCSS=function(e){return e.startsWith("#")?i.colors.hexToRGB(e):i.colors.re_.rgbx.test(e)?e:i.colors.nameToRGB(e)},i.colors.arrayToRGBA=function(e){var t=e.length>3?e[3]:1;return"rgba("+e[0]+", "+e[1]+", "+e[2]+", "+t+")"},i.colors.setAlpha=function(e,t){var r=i.colors.crackRGB(e);return r[3]=t,i.colors.arrayToRGBA(r)},i.colors.mix=function(e,t,r){for(var o=i.colors.crackRGB(e),s=i.colors.crackRGB(t),n=0;n<4;++n){var a=s[n]-o[n];o[n]=Math.round(parseInt(o[n])+a*r)}return i.colors.arrayToRGBA(o)},i.colors.crackRGB=function(e){if(e.startsWith("rgba")){if(t=e.match(i.colors.re_.rgba))return t.shift(),t}else{var t=e.match(i.colors.re_.rgb);if(t)return t.shift(),t.push(1),t}return console.error("Couldn't crack: "+e),null},i.colors.nameToRGB=function(e){return e in i.colors.colorNames?i.colors.colorNames[e]:(e=e.toLowerCase())in i.colors.colorNames?i.colors.colorNames[e]:(e=e.replace(/\s+/g,""))in i.colors.colorNames?i.colors.colorNames[e]:null},i.colors.stockColorPalette=i.colors.hexToRGB(["#000000","#CC0000","#4E9A06","#C4A000","#3465A4","#75507B","#06989A","#D3D7CF","#555753","#EF2929","#00BA13","#FCE94F","#729FCF","#F200CB","#00B5BD","#EEEEEC","#000000","#00005F","#000087","#0000AF","#0000D7","#0000FF","#005F00","#005F5F","#005F87","#005FAF","#005FD7","#005FFF","#008700","#00875F","#008787","#0087AF","#0087D7","#0087FF","#00AF00","#00AF5F","#00AF87","#00AFAF","#00AFD7","#00AFFF","#00D700","#00D75F","#00D787","#00D7AF","#00D7D7","#00D7FF","#00FF00","#00FF5F","#00FF87","#00FFAF","#00FFD7","#00FFFF","#5F0000","#5F005F","#5F0087","#5F00AF","#5F00D7","#5F00FF","#5F5F00","#5F5F5F","#5F5F87","#5F5FAF","#5F5FD7","#5F5FFF","#5F8700","#5F875F","#5F8787","#5F87AF","#5F87D7","#5F87FF","#5FAF00","#5FAF5F","#5FAF87","#5FAFAF","#5FAFD7","#5FAFFF","#5FD700","#5FD75F","#5FD787","#5FD7AF","#5FD7D7","#5FD7FF","#5FFF00","#5FFF5F","#5FFF87","#5FFFAF","#5FFFD7","#5FFFFF","#870000","#87005F","#870087","#8700AF","#8700D7","#8700FF","#875F00","#875F5F","#875F87","#875FAF","#875FD7","#875FFF","#878700","#87875F","#878787","#8787AF","#8787D7","#8787FF","#87AF00","#87AF5F","#87AF87","#87AFAF","#87AFD7","#87AFFF","#87D700","#87D75F","#87D787","#87D7AF","#87D7D7","#87D7FF","#87FF00","#87FF5F","#87FF87","#87FFAF","#87FFD7","#87FFFF","#AF0000","#AF005F","#AF0087","#AF00AF","#AF00D7","#AF00FF","#AF5F00","#AF5F5F","#AF5F87","#AF5FAF","#AF5FD7","#AF5FFF","#AF8700","#AF875F","#AF8787","#AF87AF","#AF87D7","#AF87FF","#AFAF00","#AFAF5F","#AFAF87","#AFAFAF","#AFAFD7","#AFAFFF","#AFD700","#AFD75F","#AFD787","#AFD7AF","#AFD7D7","#AFD7FF","#AFFF00","#AFFF5F","#AFFF87","#AFFFAF","#AFFFD7","#AFFFFF","#D70000","#D7005F","#D70087","#D700AF","#D700D7","#D700FF","#D75F00","#D75F5F","#D75F87","#D75FAF","#D75FD7","#D75FFF","#D78700","#D7875F","#D78787","#D787AF","#D787D7","#D787FF","#D7AF00","#D7AF5F","#D7AF87","#D7AFAF","#D7AFD7","#D7AFFF","#D7D700","#D7D75F","#D7D787","#D7D7AF","#D7D7D7","#D7D7FF","#D7FF00","#D7FF5F","#D7FF87","#D7FFAF","#D7FFD7","#D7FFFF","#FF0000","#FF005F","#FF0087","#FF00AF","#FF00D7","#FF00FF","#FF5F00","#FF5F5F","#FF5F87","#FF5FAF","#FF5FD7","#FF5FFF","#FF8700","#FF875F","#FF8787","#FF87AF","#FF87D7","#FF87FF","#FFAF00","#FFAF5F","#FFAF87","#FFAFAF","#FFAFD7","#FFAFFF","#FFD700","#FFD75F","#FFD787","#FFD7AF","#FFD7D7","#FFD7FF","#FFFF00","#FFFF5F","#FFFF87","#FFFFAF","#FFFFD7","#FFFFFF","#080808","#121212","#1C1C1C","#262626","#303030","#3A3A3A","#444444","#4E4E4E","#585858","#626262","#6C6C6C","#767676","#808080","#8A8A8A","#949494","#9E9E9E","#A8A8A8","#B2B2B2","#BCBCBC","#C6C6C6","#D0D0D0","#DADADA","#E4E4E4","#EEEEEE"]),i.colors.colorPalette=i.colors.stockColorPalette,i.colors.colorNames={aliceblue:"rgb(240, 248, 255)",antiquewhite:"rgb(250, 235, 215)",antiquewhite1:"rgb(255, 239, 219)",antiquewhite2:"rgb(238, 223, 204)",antiquewhite3:"rgb(205, 192, 176)",antiquewhite4:"rgb(139, 131, 120)",aquamarine:"rgb(127, 255, 212)",aquamarine1:"rgb(127, 255, 212)",aquamarine2:"rgb(118, 238, 198)",aquamarine3:"rgb(102, 205, 170)",aquamarine4:"rgb(69, 139, 116)",azure:"rgb(240, 255, 255)",azure1:"rgb(240, 255, 255)",azure2:"rgb(224, 238, 238)",azure3:"rgb(193, 205, 205)",azure4:"rgb(131, 139, 139)",beige:"rgb(245, 245, 220)",bisque:"rgb(255, 228, 196)",bisque1:"rgb(255, 228, 196)",bisque2:"rgb(238, 213, 183)",bisque3:"rgb(205, 183, 158)",bisque4:"rgb(139, 125, 107)",black:"rgb(0, 0, 0)",blanchedalmond:"rgb(255, 235, 205)",blue:"rgb(0, 0, 255)",blue1:"rgb(0, 0, 255)",blue2:"rgb(0, 0, 238)",blue3:"rgb(0, 0, 205)",blue4:"rgb(0, 0, 139)",blueviolet:"rgb(138, 43, 226)",brown:"rgb(165, 42, 42)",brown1:"rgb(255, 64, 64)",brown2:"rgb(238, 59, 59)",brown3:"rgb(205, 51, 51)",brown4:"rgb(139, 35, 35)",burlywood:"rgb(222, 184, 135)",burlywood1:"rgb(255, 211, 155)",burlywood2:"rgb(238, 197, 145)",burlywood3:"rgb(205, 170, 125)",burlywood4:"rgb(139, 115, 85)",cadetblue:"rgb(95, 158, 160)",cadetblue1:"rgb(152, 245, 255)",cadetblue2:"rgb(142, 229, 238)",cadetblue3:"rgb(122, 197, 205)",cadetblue4:"rgb(83, 134, 139)",chartreuse:"rgb(127, 255, 0)",chartreuse1:"rgb(127, 255, 0)",chartreuse2:"rgb(118, 238, 0)",chartreuse3:"rgb(102, 205, 0)",chartreuse4:"rgb(69, 139, 0)",chocolate:"rgb(210, 105, 30)",chocolate1:"rgb(255, 127, 36)",chocolate2:"rgb(238, 118, 33)",chocolate3:"rgb(205, 102, 29)",chocolate4:"rgb(139, 69, 19)",coral:"rgb(255, 127, 80)",coral1:"rgb(255, 114, 86)",coral2:"rgb(238, 106, 80)",coral3:"rgb(205, 91, 69)",coral4:"rgb(139, 62, 47)",cornflowerblue:"rgb(100, 149, 237)",cornsilk:"rgb(255, 248, 220)",cornsilk1:"rgb(255, 248, 220)",cornsilk2:"rgb(238, 232, 205)",cornsilk3:"rgb(205, 200, 177)",cornsilk4:"rgb(139, 136, 120)",cyan:"rgb(0, 255, 255)",cyan1:"rgb(0, 255, 255)",cyan2:"rgb(0, 238, 238)",cyan3:"rgb(0, 205, 205)",cyan4:"rgb(0, 139, 139)",darkblue:"rgb(0, 0, 139)",darkcyan:"rgb(0, 139, 139)",darkgoldenrod:"rgb(184, 134, 11)",darkgoldenrod1:"rgb(255, 185, 15)",darkgoldenrod2:"rgb(238, 173, 14)",darkgoldenrod3:"rgb(205, 149, 12)",darkgoldenrod4:"rgb(139, 101, 8)",darkgray:"rgb(169, 169, 169)",darkgreen:"rgb(0, 100, 0)",darkgrey:"rgb(169, 169, 169)",darkkhaki:"rgb(189, 183, 107)",darkmagenta:"rgb(139, 0, 139)",darkolivegreen:"rgb(85, 107, 47)",darkolivegreen1:"rgb(202, 255, 112)",darkolivegreen2:"rgb(188, 238, 104)",darkolivegreen3:"rgb(162, 205, 90)",darkolivegreen4:"rgb(110, 139, 61)",darkorange:"rgb(255, 140, 0)",darkorange1:"rgb(255, 127, 0)",darkorange2:"rgb(238, 118, 0)",darkorange3:"rgb(205, 102, 0)",darkorange4:"rgb(139, 69, 0)",darkorchid:"rgb(153, 50, 204)",darkorchid1:"rgb(191, 62, 255)",darkorchid2:"rgb(178, 58, 238)",darkorchid3:"rgb(154, 50, 205)",darkorchid4:"rgb(104, 34, 139)",darkred:"rgb(139, 0, 0)",darksalmon:"rgb(233, 150, 122)",darkseagreen:"rgb(143, 188, 143)",darkseagreen1:"rgb(193, 255, 193)",darkseagreen2:"rgb(180, 238, 180)",darkseagreen3:"rgb(155, 205, 155)",darkseagreen4:"rgb(105, 139, 105)",darkslateblue:"rgb(72, 61, 139)",darkslategray:"rgb(47, 79, 79)",darkslategray1:"rgb(151, 255, 255)",darkslategray2:"rgb(141, 238, 238)",darkslategray3:"rgb(121, 205, 205)",darkslategray4:"rgb(82, 139, 139)",darkslategrey:"rgb(47, 79, 79)",darkturquoise:"rgb(0, 206, 209)",darkviolet:"rgb(148, 0, 211)",debianred:"rgb(215, 7, 81)",deeppink:"rgb(255, 20, 147)",deeppink1:"rgb(255, 20, 147)",deeppink2:"rgb(238, 18, 137)",deeppink3:"rgb(205, 16, 118)",deeppink4:"rgb(139, 10, 80)",deepskyblue:"rgb(0, 191, 255)",deepskyblue1:"rgb(0, 191, 255)",deepskyblue2:"rgb(0, 178, 238)",deepskyblue3:"rgb(0, 154, 205)",deepskyblue4:"rgb(0, 104, 139)",dimgray:"rgb(105, 105, 105)",dimgrey:"rgb(105, 105, 105)",dodgerblue:"rgb(30, 144, 255)",dodgerblue1:"rgb(30, 144, 255)",dodgerblue2:"rgb(28, 134, 238)",dodgerblue3:"rgb(24, 116, 205)",dodgerblue4:"rgb(16, 78, 139)",firebrick:"rgb(178, 34, 34)",firebrick1:"rgb(255, 48, 48)",firebrick2:"rgb(238, 44, 44)",firebrick3:"rgb(205, 38, 38)",firebrick4:"rgb(139, 26, 26)",floralwhite:"rgb(255, 250, 240)",forestgreen:"rgb(34, 139, 34)",gainsboro:"rgb(220, 220, 220)",ghostwhite:"rgb(248, 248, 255)",gold:"rgb(255, 215, 0)",gold1:"rgb(255, 215, 0)",gold2:"rgb(238, 201, 0)",gold3:"rgb(205, 173, 0)",gold4:"rgb(139, 117, 0)",goldenrod:"rgb(218, 165, 32)",goldenrod1:"rgb(255, 193, 37)",goldenrod2:"rgb(238, 180, 34)",goldenrod3:"rgb(205, 155, 29)",goldenrod4:"rgb(139, 105, 20)",gray:"rgb(190, 190, 190)",gray0:"rgb(0, 0, 0)",gray1:"rgb(3, 3, 3)",gray10:"rgb(26, 26, 26)",gray100:"rgb(255, 255, 255)",gray11:"rgb(28, 28, 28)",gray12:"rgb(31, 31, 31)",gray13:"rgb(33, 33, 33)",gray14:"rgb(36, 36, 36)",gray15:"rgb(38, 38, 38)",gray16:"rgb(41, 41, 41)",gray17:"rgb(43, 43, 43)",gray18:"rgb(46, 46, 46)",gray19:"rgb(48, 48, 48)",gray2:"rgb(5, 5, 5)",gray20:"rgb(51, 51, 51)",gray21:"rgb(54, 54, 54)",gray22:"rgb(56, 56, 56)",gray23:"rgb(59, 59, 59)",gray24:"rgb(61, 61, 61)",gray25:"rgb(64, 64, 64)",gray26:"rgb(66, 66, 66)",gray27:"rgb(69, 69, 69)",gray28:"rgb(71, 71, 71)",gray29:"rgb(74, 74, 74)",gray3:"rgb(8, 8, 8)",gray30:"rgb(77, 77, 77)",gray31:"rgb(79, 79, 79)",gray32:"rgb(82, 82, 82)",gray33:"rgb(84, 84, 84)",gray34:"rgb(87, 87, 87)",gray35:"rgb(89, 89, 89)",gray36:"rgb(92, 92, 92)",gray37:"rgb(94, 94, 94)",gray38:"rgb(97, 97, 97)",gray39:"rgb(99, 99, 99)",gray4:"rgb(10, 10, 10)",gray40:"rgb(102, 102, 102)",gray41:"rgb(105, 105, 105)",gray42:"rgb(107, 107, 107)",gray43:"rgb(110, 110, 110)",gray44:"rgb(112, 112, 112)",gray45:"rgb(115, 115, 115)",gray46:"rgb(117, 117, 117)",gray47:"rgb(120, 120, 120)",gray48:"rgb(122, 122, 122)",gray49:"rgb(125, 125, 125)",gray5:"rgb(13, 13, 13)",gray50:"rgb(127, 127, 127)",gray51:"rgb(130, 130, 130)",gray52:"rgb(133, 133, 133)",gray53:"rgb(135, 135, 135)",gray54:"rgb(138, 138, 138)",gray55:"rgb(140, 140, 140)",gray56:"rgb(143, 143, 143)",gray57:"rgb(145, 145, 145)",gray58:"rgb(148, 148, 148)",gray59:"rgb(150, 150, 150)",gray6:"rgb(15, 15, 15)",gray60:"rgb(153, 153, 153)",gray61:"rgb(156, 156, 156)",gray62:"rgb(158, 158, 158)",gray63:"rgb(161, 161, 161)",gray64:"rgb(163, 163, 163)",gray65:"rgb(166, 166, 166)",gray66:"rgb(168, 168, 168)",gray67:"rgb(171, 171, 171)",gray68:"rgb(173, 173, 173)",gray69:"rgb(176, 176, 176)",gray7:"rgb(18, 18, 18)",gray70:"rgb(179, 179, 179)",gray71:"rgb(181, 181, 181)",gray72:"rgb(184, 184, 184)",gray73:"rgb(186, 186, 186)",gray74:"rgb(189, 189, 189)",gray75:"rgb(191, 191, 191)",gray76:"rgb(194, 194, 194)",gray77:"rgb(196, 196, 196)",gray78:"rgb(199, 199, 199)",gray79:"rgb(201, 201, 201)",gray8:"rgb(20, 20, 20)",gray80:"rgb(204, 204, 204)",gray81:"rgb(207, 207, 207)",gray82:"rgb(209, 209, 209)",gray83:"rgb(212, 212, 212)",gray84:"rgb(214, 214, 214)",gray85:"rgb(217, 217, 217)",gray86:"rgb(219, 219, 219)",gray87:"rgb(222, 222, 222)",gray88:"rgb(224, 224, 224)",gray89:"rgb(227, 227, 227)",gray9:"rgb(23, 23, 23)",gray90:"rgb(229, 229, 229)",gray91:"rgb(232, 232, 232)",gray92:"rgb(235, 235, 235)",gray93:"rgb(237, 237, 237)",gray94:"rgb(240, 240, 240)",gray95:"rgb(242, 242, 242)",gray96:"rgb(245, 245, 245)",gray97:"rgb(247, 247, 247)",gray98:"rgb(250, 250, 250)",gray99:"rgb(252, 252, 252)",green:"rgb(0, 255, 0)",green1:"rgb(0, 255, 0)",green2:"rgb(0, 238, 0)",green3:"rgb(0, 205, 0)",green4:"rgb(0, 139, 0)",greenyellow:"rgb(173, 255, 47)",grey:"rgb(190, 190, 190)",grey0:"rgb(0, 0, 0)",grey1:"rgb(3, 3, 3)",grey10:"rgb(26, 26, 26)",grey100:"rgb(255, 255, 255)",grey11:"rgb(28, 28, 28)",grey12:"rgb(31, 31, 31)",grey13:"rgb(33, 33, 33)",grey14:"rgb(36, 36, 36)",grey15:"rgb(38, 38, 38)",grey16:"rgb(41, 41, 41)",grey17:"rgb(43, 43, 43)",grey18:"rgb(46, 46, 46)",grey19:"rgb(48, 48, 48)",grey2:"rgb(5, 5, 5)",grey20:"rgb(51, 51, 51)",grey21:"rgb(54, 54, 54)",grey22:"rgb(56, 56, 56)",grey23:"rgb(59, 59, 59)",grey24:"rgb(61, 61, 61)",grey25:"rgb(64, 64, 64)",grey26:"rgb(66, 66, 66)",grey27:"rgb(69, 69, 69)",grey28:"rgb(71, 71, 71)",grey29:"rgb(74, 74, 74)",grey3:"rgb(8, 8, 8)",grey30:"rgb(77, 77, 77)",grey31:"rgb(79, 79, 79)",grey32:"rgb(82, 82, 82)",grey33:"rgb(84, 84, 84)",grey34:"rgb(87, 87, 87)",grey35:"rgb(89, 89, 89)",grey36:"rgb(92, 92, 92)",grey37:"rgb(94, 94, 94)",grey38:"rgb(97, 97, 97)",grey39:"rgb(99, 99, 99)",grey4:"rgb(10, 10, 10)",grey40:"rgb(102, 102, 102)",grey41:"rgb(105, 105, 105)",grey42:"rgb(107, 107, 107)",grey43:"rgb(110, 110, 110)",grey44:"rgb(112, 112, 112)",grey45:"rgb(115, 115, 115)",grey46:"rgb(117, 117, 117)",grey47:"rgb(120, 120, 120)",grey48:"rgb(122, 122, 122)",grey49:"rgb(125, 125, 125)",grey5:"rgb(13, 13, 13)",grey50:"rgb(127, 127, 127)",grey51:"rgb(130, 130, 130)",grey52:"rgb(133, 133, 133)",grey53:"rgb(135, 135, 135)",grey54:"rgb(138, 138, 138)",grey55:"rgb(140, 140, 140)",grey56:"rgb(143, 143, 143)",grey57:"rgb(145, 145, 145)",grey58:"rgb(148, 148, 148)",grey59:"rgb(150, 150, 150)",grey6:"rgb(15, 15, 15)",grey60:"rgb(153, 153, 153)",grey61:"rgb(156, 156, 156)",grey62:"rgb(158, 158, 158)",grey63:"rgb(161, 161, 161)",grey64:"rgb(163, 163, 163)",grey65:"rgb(166, 166, 166)",grey66:"rgb(168, 168, 168)",grey67:"rgb(171, 171, 171)",grey68:"rgb(173, 173, 173)",grey69:"rgb(176, 176, 176)",grey7:"rgb(18, 18, 18)",grey70:"rgb(179, 179, 179)",grey71:"rgb(181, 181, 181)",grey72:"rgb(184, 184, 184)",grey73:"rgb(186, 186, 186)",grey74:"rgb(189, 189, 189)",grey75:"rgb(191, 191, 191)",grey76:"rgb(194, 194, 194)",grey77:"rgb(196, 196, 196)",grey78:"rgb(199, 199, 199)",grey79:"rgb(201, 201, 201)",grey8:"rgb(20, 20, 20)",grey80:"rgb(204, 204, 204)",grey81:"rgb(207, 207, 207)",grey82:"rgb(209, 209, 209)",grey83:"rgb(212, 212, 212)",grey84:"rgb(214, 214, 214)",grey85:"rgb(217, 217, 217)",grey86:"rgb(219, 219, 219)",grey87:"rgb(222, 222, 222)",grey88:"rgb(224, 224, 224)",grey89:"rgb(227, 227, 227)",grey9:"rgb(23, 23, 23)",grey90:"rgb(229, 229, 229)",grey91:"rgb(232, 232, 232)",grey92:"rgb(235, 235, 235)",grey93:"rgb(237, 237, 237)",grey94:"rgb(240, 240, 240)",grey95:"rgb(242, 242, 242)",grey96:"rgb(245, 245, 245)",grey97:"rgb(247, 247, 247)",grey98:"rgb(250, 250, 250)",grey99:"rgb(252, 252, 252)",honeydew:"rgb(240, 255, 240)",honeydew1:"rgb(240, 255, 240)",honeydew2:"rgb(224, 238, 224)",honeydew3:"rgb(193, 205, 193)",honeydew4:"rgb(131, 139, 131)",hotpink:"rgb(255, 105, 180)",hotpink1:"rgb(255, 110, 180)",hotpink2:"rgb(238, 106, 167)",hotpink3:"rgb(205, 96, 144)",hotpink4:"rgb(139, 58, 98)",indianred:"rgb(205, 92, 92)",indianred1:"rgb(255, 106, 106)",indianred2:"rgb(238, 99, 99)",indianred3:"rgb(205, 85, 85)",indianred4:"rgb(139, 58, 58)",ivory:"rgb(255, 255, 240)",ivory1:"rgb(255, 255, 240)",ivory2:"rgb(238, 238, 224)",ivory3:"rgb(205, 205, 193)",ivory4:"rgb(139, 139, 131)",khaki:"rgb(240, 230, 140)",khaki1:"rgb(255, 246, 143)",khaki2:"rgb(238, 230, 133)",khaki3:"rgb(205, 198, 115)",khaki4:"rgb(139, 134, 78)",lavender:"rgb(230, 230, 250)",lavenderblush:"rgb(255, 240, 245)",lavenderblush1:"rgb(255, 240, 245)",lavenderblush2:"rgb(238, 224, 229)",lavenderblush3:"rgb(205, 193, 197)",lavenderblush4:"rgb(139, 131, 134)",lawngreen:"rgb(124, 252, 0)",lemonchiffon:"rgb(255, 250, 205)",lemonchiffon1:"rgb(255, 250, 205)",lemonchiffon2:"rgb(238, 233, 191)",lemonchiffon3:"rgb(205, 201, 165)",lemonchiffon4:"rgb(139, 137, 112)",lightblue:"rgb(173, 216, 230)",lightblue1:"rgb(191, 239, 255)",lightblue2:"rgb(178, 223, 238)",lightblue3:"rgb(154, 192, 205)",lightblue4:"rgb(104, 131, 139)",lightcoral:"rgb(240, 128, 128)",lightcyan:"rgb(224, 255, 255)",lightcyan1:"rgb(224, 255, 255)",lightcyan2:"rgb(209, 238, 238)",lightcyan3:"rgb(180, 205, 205)",lightcyan4:"rgb(122, 139, 139)",lightgoldenrod:"rgb(238, 221, 130)",lightgoldenrod1:"rgb(255, 236, 139)",lightgoldenrod2:"rgb(238, 220, 130)",lightgoldenrod3:"rgb(205, 190, 112)",lightgoldenrod4:"rgb(139, 129, 76)",lightgoldenrodyellow:"rgb(250, 250, 210)",lightgray:"rgb(211, 211, 211)",lightgreen:"rgb(144, 238, 144)",lightgrey:"rgb(211, 211, 211)",lightpink:"rgb(255, 182, 193)",lightpink1:"rgb(255, 174, 185)",lightpink2:"rgb(238, 162, 173)",lightpink3:"rgb(205, 140, 149)",lightpink4:"rgb(139, 95, 101)",lightsalmon:"rgb(255, 160, 122)",lightsalmon1:"rgb(255, 160, 122)",lightsalmon2:"rgb(238, 149, 114)",lightsalmon3:"rgb(205, 129, 98)",lightsalmon4:"rgb(139, 87, 66)",lightseagreen:"rgb(32, 178, 170)",lightskyblue:"rgb(135, 206, 250)",lightskyblue1:"rgb(176, 226, 255)",lightskyblue2:"rgb(164, 211, 238)",lightskyblue3:"rgb(141, 182, 205)",lightskyblue4:"rgb(96, 123, 139)",lightslateblue:"rgb(132, 112, 255)",lightslategray:"rgb(119, 136, 153)",lightslategrey:"rgb(119, 136, 153)",lightsteelblue:"rgb(176, 196, 222)",lightsteelblue1:"rgb(202, 225, 255)",lightsteelblue2:"rgb(188, 210, 238)",lightsteelblue3:"rgb(162, 181, 205)",lightsteelblue4:"rgb(110, 123, 139)",lightyellow:"rgb(255, 255, 224)",lightyellow1:"rgb(255, 255, 224)",lightyellow2:"rgb(238, 238, 209)",lightyellow3:"rgb(205, 205, 180)",lightyellow4:"rgb(139, 139, 122)",limegreen:"rgb(50, 205, 50)",linen:"rgb(250, 240, 230)",magenta:"rgb(255, 0, 255)",magenta1:"rgb(255, 0, 255)",magenta2:"rgb(238, 0, 238)",magenta3:"rgb(205, 0, 205)",magenta4:"rgb(139, 0, 139)",maroon:"rgb(176, 48, 96)",maroon1:"rgb(255, 52, 179)",maroon2:"rgb(238, 48, 167)",maroon3:"rgb(205, 41, 144)",maroon4:"rgb(139, 28, 98)",mediumaquamarine:"rgb(102, 205, 170)",mediumblue:"rgb(0, 0, 205)",mediumorchid:"rgb(186, 85, 211)",mediumorchid1:"rgb(224, 102, 255)",mediumorchid2:"rgb(209, 95, 238)",mediumorchid3:"rgb(180, 82, 205)",mediumorchid4:"rgb(122, 55, 139)",mediumpurple:"rgb(147, 112, 219)",mediumpurple1:"rgb(171, 130, 255)",mediumpurple2:"rgb(159, 121, 238)",mediumpurple3:"rgb(137, 104, 205)",mediumpurple4:"rgb(93, 71, 139)",mediumseagreen:"rgb(60, 179, 113)",mediumslateblue:"rgb(123, 104, 238)",mediumspringgreen:"rgb(0, 250, 154)",mediumturquoise:"rgb(72, 209, 204)",mediumvioletred:"rgb(199, 21, 133)",midnightblue:"rgb(25, 25, 112)",mintcream:"rgb(245, 255, 250)",mistyrose:"rgb(255, 228, 225)",mistyrose1:"rgb(255, 228, 225)",mistyrose2:"rgb(238, 213, 210)",mistyrose3:"rgb(205, 183, 181)",mistyrose4:"rgb(139, 125, 123)",moccasin:"rgb(255, 228, 181)",navajowhite:"rgb(255, 222, 173)",navajowhite1:"rgb(255, 222, 173)",navajowhite2:"rgb(238, 207, 161)",navajowhite3:"rgb(205, 179, 139)",navajowhite4:"rgb(139, 121, 94)",navy:"rgb(0, 0, 128)",navyblue:"rgb(0, 0, 128)",oldlace:"rgb(253, 245, 230)",olivedrab:"rgb(107, 142, 35)",olivedrab1:"rgb(192, 255, 62)",olivedrab2:"rgb(179, 238, 58)",olivedrab3:"rgb(154, 205, 50)",olivedrab4:"rgb(105, 139, 34)",orange:"rgb(255, 165, 0)",orange1:"rgb(255, 165, 0)",orange2:"rgb(238, 154, 0)",orange3:"rgb(205, 133, 0)",orange4:"rgb(139, 90, 0)",orangered:"rgb(255, 69, 0)",orangered1:"rgb(255, 69, 0)",orangered2:"rgb(238, 64, 0)",orangered3:"rgb(205, 55, 0)",orangered4:"rgb(139, 37, 0)",orchid:"rgb(218, 112, 214)",orchid1:"rgb(255, 131, 250)",orchid2:"rgb(238, 122, 233)",orchid3:"rgb(205, 105, 201)",orchid4:"rgb(139, 71, 137)",palegoldenrod:"rgb(238, 232, 170)",palegreen:"rgb(152, 251, 152)",palegreen1:"rgb(154, 255, 154)",palegreen2:"rgb(144, 238, 144)",palegreen3:"rgb(124, 205, 124)",palegreen4:"rgb(84, 139, 84)",paleturquoise:"rgb(175, 238, 238)",paleturquoise1:"rgb(187, 255, 255)",paleturquoise2:"rgb(174, 238, 238)",paleturquoise3:"rgb(150, 205, 205)",paleturquoise4:"rgb(102, 139, 139)",palevioletred:"rgb(219, 112, 147)",palevioletred1:"rgb(255, 130, 171)",palevioletred2:"rgb(238, 121, 159)",palevioletred3:"rgb(205, 104, 137)",palevioletred4:"rgb(139, 71, 93)",papayawhip:"rgb(255, 239, 213)",peachpuff:"rgb(255, 218, 185)",peachpuff1:"rgb(255, 218, 185)",peachpuff2:"rgb(238, 203, 173)",peachpuff3:"rgb(205, 175, 149)",peachpuff4:"rgb(139, 119, 101)",peru:"rgb(205, 133, 63)",pink:"rgb(255, 192, 203)",pink1:"rgb(255, 181, 197)",pink2:"rgb(238, 169, 184)",pink3:"rgb(205, 145, 158)",pink4:"rgb(139, 99, 108)",plum:"rgb(221, 160, 221)",plum1:"rgb(255, 187, 255)",plum2:"rgb(238, 174, 238)",plum3:"rgb(205, 150, 205)",plum4:"rgb(139, 102, 139)",powderblue:"rgb(176, 224, 230)",purple:"rgb(160, 32, 240)",purple1:"rgb(155, 48, 255)",purple2:"rgb(145, 44, 238)",purple3:"rgb(125, 38, 205)",purple4:"rgb(85, 26, 139)",red:"rgb(255, 0, 0)",red1:"rgb(255, 0, 0)",red2:"rgb(238, 0, 0)",red3:"rgb(205, 0, 0)",red4:"rgb(139, 0, 0)",rosybrown:"rgb(188, 143, 143)",rosybrown1:"rgb(255, 193, 193)",rosybrown2:"rgb(238, 180, 180)",rosybrown3:"rgb(205, 155, 155)",rosybrown4:"rgb(139, 105, 105)",royalblue:"rgb(65, 105, 225)",royalblue1:"rgb(72, 118, 255)",royalblue2:"rgb(67, 110, 238)",royalblue3:"rgb(58, 95, 205)",royalblue4:"rgb(39, 64, 139)",saddlebrown:"rgb(139, 69, 19)",salmon:"rgb(250, 128, 114)",salmon1:"rgb(255, 140, 105)",salmon2:"rgb(238, 130, 98)",salmon3:"rgb(205, 112, 84)",salmon4:"rgb(139, 76, 57)",sandybrown:"rgb(244, 164, 96)",seagreen:"rgb(46, 139, 87)",seagreen1:"rgb(84, 255, 159)",seagreen2:"rgb(78, 238, 148)",seagreen3:"rgb(67, 205, 128)",seagreen4:"rgb(46, 139, 87)",seashell:"rgb(255, 245, 238)",seashell1:"rgb(255, 245, 238)",seashell2:"rgb(238, 229, 222)",seashell3:"rgb(205, 197, 191)",seashell4:"rgb(139, 134, 130)",sienna:"rgb(160, 82, 45)",sienna1:"rgb(255, 130, 71)",sienna2:"rgb(238, 121, 66)",sienna3:"rgb(205, 104, 57)",sienna4:"rgb(139, 71, 38)",skyblue:"rgb(135, 206, 235)",skyblue1:"rgb(135, 206, 255)",skyblue2:"rgb(126, 192, 238)",skyblue3:"rgb(108, 166, 205)",skyblue4:"rgb(74, 112, 139)",slateblue:"rgb(106, 90, 205)",slateblue1:"rgb(131, 111, 255)",slateblue2:"rgb(122, 103, 238)",slateblue3:"rgb(105, 89, 205)",slateblue4:"rgb(71, 60, 139)",slategray:"rgb(112, 128, 144)",slategray1:"rgb(198, 226, 255)",slategray2:"rgb(185, 211, 238)",slategray3:"rgb(159, 182, 205)",slategray4:"rgb(108, 123, 139)",slategrey:"rgb(112, 128, 144)",snow:"rgb(255, 250, 250)",snow1:"rgb(255, 250, 250)",snow2:"rgb(238, 233, 233)",snow3:"rgb(205, 201, 201)",snow4:"rgb(139, 137, 137)",springgreen:"rgb(0, 255, 127)",springgreen1:"rgb(0, 255, 127)",springgreen2:"rgb(0, 238, 118)",springgreen3:"rgb(0, 205, 102)",springgreen4:"rgb(0, 139, 69)",steelblue:"rgb(70, 130, 180)",steelblue1:"rgb(99, 184, 255)",steelblue2:"rgb(92, 172, 238)",steelblue3:"rgb(79, 148, 205)",steelblue4:"rgb(54, 100, 139)",tan:"rgb(210, 180, 140)",tan1:"rgb(255, 165, 79)",tan2:"rgb(238, 154, 73)",tan3:"rgb(205, 133, 63)",tan4:"rgb(139, 90, 43)",thistle:"rgb(216, 191, 216)",thistle1:"rgb(255, 225, 255)",thistle2:"rgb(238, 210, 238)",thistle3:"rgb(205, 181, 205)",thistle4:"rgb(139, 123, 139)",tomato:"rgb(255, 99, 71)",tomato1:"rgb(255, 99, 71)",tomato2:"rgb(238, 92, 66)",tomato3:"rgb(205, 79, 57)",tomato4:"rgb(139, 54, 38)",turquoise:"rgb(64, 224, 208)",turquoise1:"rgb(0, 245, 255)",turquoise2:"rgb(0, 229, 238)",turquoise3:"rgb(0, 197, 205)",turquoise4:"rgb(0, 134, 139)",violet:"rgb(238, 130, 238)",violetred:"rgb(208, 32, 144)",violetred1:"rgb(255, 62, 150)",violetred2:"rgb(238, 58, 140)",violetred3:"rgb(205, 50, 120)",violetred4:"rgb(139, 34, 82)",wheat:"rgb(245, 222, 179)",wheat1:"rgb(255, 231, 186)",wheat2:"rgb(238, 216, 174)",wheat3:"rgb(205, 186, 150)",wheat4:"rgb(139, 126, 102)",white:"rgb(255, 255, 255)",whitesmoke:"rgb(245, 245, 245)",yellow:"rgb(255, 255, 0)",yellow1:"rgb(255, 255, 0)",yellow2:"rgb(238, 238, 0)",yellow3:"rgb(205, 205, 0)",yellow4:"rgb(139, 139, 0)",yellowgreen:"rgb(154, 205, 50)"},i.f={},i.f.createEnum=function(e){return new String(e)},i.f.replaceVars=function(e,t){return e.replace(/%([a-z]*)\(([^\)]+)\)/gi,function(e,r,o){if(void 0===t[o])throw"Unknown variable: "+o;var s=t[o];if(r in i.f.replaceVars.functions)s=i.f.replaceVars.functions[r](s);else if(r)throw"Unknown escape function: "+r;return s})},i.f.replaceVars.functions={encodeURI:encodeURI,encodeURIComponent:encodeURIComponent,escapeHTML:function(e){var t={"<":"&lt;",">":"&gt;","&":"&amp;",'"':"&quot;","'":"&#39;"};return e.replace(/[<>&\"\']/g,function(e){return t[e]})}},i.f.getAcceptLanguages=function(e){i.f.getAcceptLanguages.chromeSupported()?chrome.i18n.getAcceptLanguages(e):setTimeout(function(){e([navigator.language.replace(/-/g,"_")])},0)},i.f.getAcceptLanguages.chromeSupported=function(){return window.chrome&&chrome.i18n},i.f.parseQuery=function(e){e.startsWith("?")&&(e=e.substr(1));for(var t={},r=e.split("&"),i=0;i<r.length;i++){var o=r[i].split("=");t[decodeURIComponent(o[0])]=decodeURIComponent(o[1])}return t},i.f.getURL=function(e){return i.f.getURL.chromeSupported()?chrome.runtime.getURL(e):e},i.f.getURL.chromeSupported=function(){return window.chrome&&chrome.runtime&&chrome.runtime.getURL},i.f.clamp=function(e,t,r){return e<t?t:e>r?r:e},i.f.zpad=function(e,t){return String(e).padStart(t,"0")},i.f.getWhitespace=function(e){if(e<=0)return"";var t=this.getWhitespace;for(t.whitespace||(t.whitespace="          ");e>t.whitespace.length;)t.whitespace+=t.whitespace;return t.whitespace.substr(0,e)},i.f.alarm=function(e,t){var r=t||5e3,o=i.f.getStack(1);return function(){var t=setTimeout(function(){var i="string"==typeof e?i:e.name;i=i?": "+i:"",console.warn("lib.f.alarm: timeout expired: "+r/1e3+"s"+i),console.log(o),t=null},r),i=function(e){return function(){return t&&(clearTimeout(t),t=null),e.apply(null,arguments)}};return"string"==typeof e?i:i(e)}()},i.f.getStack=function(e){var t,r=e?e+2:2;try{throw new Error}catch(e){t=e.stack.split("\n")}for(var i={},o=r;o<t.length;o++)i[o-r]=t[o].replace(/^\s*at\s+/,"");return i},i.f.smartFloorDivide=function(e,t){var r=e/t,i=Math.ceil(r);return i-r<1e-4?i:Math.floor(r)},i.f.randomInt=function(e,t){return Math.floor(Math.random()*(t-e+1))+e},i.MessageManager=function(e){this.languages_=e.map(function(e){return e.replace(/-/g,"_")}),-1==this.languages_.indexOf("en")&&this.languages_.unshift("en"),this.messages={}},i.MessageManager.prototype.addMessages=function(e){for(var t in e){var r=e[t];r.placeholders?this.messages[t]=r.message.replace(/\$([a-z][^\s\$]+)\$/gi,function(r,i){return e[t].placeholders[i.toLowerCase()].content}):this.messages[t]=r.message}},i.MessageManager.prototype.findAndLoadMessages=function(e,t){function r(e){e?o=i.shift():s=i.shift(),i.length?n():t(o,s)}var i=this.languages_.concat(),o=[],s=[],n=function(){this.loadMessages(this.replaceReferences(e,i),r.bind(this,!0),r.bind(this,!1))}.bind(this);n()},i.MessageManager.prototype.loadMessages=function(e,t,r){var i=new XMLHttpRequest;i.onloadend=function(){200==i.status?(this.addMessages(JSON.parse(i.responseText)),t()):r&&r(i.status)}.bind(this),i.open("GET",e),i.send()},i.MessageManager.replaceReferences=function(e,t){return e.replace(/\$(\d+)/g,function(e,r){return t[r-1]})},i.MessageManager.prototype.replaceReferences=i.MessageManager.replaceReferences,i.MessageManager.prototype.get=function(e,t,r){var i;if(e in this.messages)i=this.messages[e];else if(window.chrome.i18n&&(i=chrome.i18n.getMessage(e)),!i)return console.warn("Unknown message: "+e),void 0===r?e:r;return t?(t instanceof Array||(t=[t]),this.replaceReferences(i,t)):i},i.MessageManager.prototype.processI18nAttributes=function(e){for(var t=e.querySelectorAll("[i18n]"),r=0;r<t.length;r++)this.processI18nAttribute(t[r])},i.MessageManager.prototype.processI18nAttribute=function(e){var t=e.getAttribute("i18n");if(t){try{t=JSON.parse(t)}catch(r){throw console.error("Can't parse "+e.tagName+"#"+e.id+": "+t),r}for(var r in t){var i=r,o=t[r];o.startsWith("=")&&(o=t[r=o.substr(1)]),o.startsWith("$")&&(o=function(e){return e.replace(/-/g,"_").toUpperCase()}(e.getAttribute(o.substr(1))+"_"+r));var s=this.get(o);"_"==i?e.textContent=s:e.setAttribute(i,s)}}},i.PreferenceManager=function(e,t){this.storage=e,this.storageObserver_=this.onStorageChange_.bind(this),this.isActive_=!1,this.activate(),this.trace=!1;var r=t||"/";r.endsWith("/")||(r+="/"),this.prefix=r,this.prefRecords_={},this.globalObservers_=[],this.childFactories_={},this.childLists_={}},i.PreferenceManager.prototype.DEFAULT_VALUE=i.f.createEnum("DEFAULT"),i.PreferenceManager.Record=function(e,t){this.name=e,this.defaultValue=t,this.currentValue=this.DEFAULT_VALUE,this.observers=[]},i.PreferenceManager.Record.prototype.DEFAULT_VALUE=i.PreferenceManager.prototype.DEFAULT_VALUE,i.PreferenceManager.Record.prototype.addObserver=function(e){this.observers.push(e)},i.PreferenceManager.Record.prototype.removeObserver=function(e){var t=this.observers.indexOf(e);t>=0&&this.observers.splice(t,1)},i.PreferenceManager.Record.prototype.get=function(){return this.currentValue===this.DEFAULT_VALUE?/^(string|number)$/.test(typeof this.defaultValue)?this.defaultValue:"object"==typeof this.defaultValue?JSON.parse(JSON.stringify(this.defaultValue)):this.defaultValue:this.currentValue},i.PreferenceManager.prototype.deactivate=function(){if(!this.isActive_)throw new Error("Not activated");this.isActive_=!1,this.storage.removeObserver(this.storageObserver_)},i.PreferenceManager.prototype.activate=function(){if(this.isActive_)throw new Error("Already activated");this.isActive_=!0,this.storage.addObserver(this.storageObserver_)},i.PreferenceManager.prototype.readStorage=function(e){function t(){0==--r&&e&&e()}var r=0,i=Object.keys(this.prefRecords_).map(function(e){return this.prefix+e}.bind(this));this.trace&&console.log("Preferences read: "+this.prefix),this.storage.getItems(i,function(i){var o=this.prefix.length;for(var s in i){var n=i[s],a=s.substr(o),l=a in this.childLists_&&JSON.stringify(n)!=JSON.stringify(this.prefRecords_[a].currentValue);this.prefRecords_[a].currentValue=n,l&&(r++,this.syncChildList(a,t))}0==r&&e&&setTimeout(e)}.bind(this))},i.PreferenceManager.prototype.definePreference=function(e,t,r){var o=this.prefRecords_[e];o?this.changeDefault(e,t):o=this.prefRecords_[e]=new i.PreferenceManager.Record(e,t),r&&o.addObserver(r)},i.PreferenceManager.prototype.definePreferences=function(e){for(var t=0;t<e.length;t++)this.definePreference(e[t][0],e[t][1],e[t][2])},i.PreferenceManager.prototype.defineChildren=function(e,t){this.definePreference(e,[],this.onChildListChange_.bind(this,e)),this.childFactories_[e]=t,this.childLists_[e]={}},i.PreferenceManager.prototype.addObservers=function(e,t){if(e&&"function"!=typeof e)throw new Error("Invalid param: globals");if(e&&this.globalObservers_.push(e),t)for(var r in t){if(!(r in this.prefRecords_))throw new Error("Unknown preference: "+r);this.prefRecords_[r].addObserver(t[r])}},i.PreferenceManager.prototype.notifyAll=function(){for(var e in this.prefRecords_)this.notifyChange_(e)},i.PreferenceManager.prototype.notifyChange_=function(e){var t=this.prefRecords_[e];if(!t)throw new Error("Unknown preference: "+e);for(var r=t.get(),i=0;i<this.globalObservers_.length;i++)this.globalObservers_[i](e,r);for(i=0;i<t.observers.length;i++)t.observers[i](r,e,this)},i.PreferenceManager.prototype.createChild=function(e,t,r){var o,s=this.get(e);if(r){if(o=r,-1!=s.indexOf(o))throw new Error("Duplicate child: "+e+": "+o)}else for(;!o||-1!=s.indexOf(o);)o=i.f.randomInt(1,65535).toString(16),o=i.f.zpad(o,4),t&&(o=t+":"+o);var n=this.childFactories_[e](this,o);return n.trace=this.trace,n.resetAll(),this.childLists_[e][o]=n,s.push(o),this.set(e,s),n},i.PreferenceManager.prototype.removeChild=function(e,t){this.getChild(e,t).resetAll();var r=this.get(e),i=r.indexOf(t);-1!=i&&(r.splice(i,1),this.set(e,r)),delete this.childLists_[e][t]},i.PreferenceManager.prototype.getChild=function(e,t,r){if(!(e in this.childLists_))throw new Error("Unknown child list: "+e);var i=this.childLists_[e];if(!(t in i)){if(void 0===r)throw new Error('Unknown "'+e+'" child: '+t);return r}return i[t]},i.PreferenceManager.diffChildLists=function(e,t){for(var r={added:{},removed:{},common:{}},i=0;i<e.length;i++)-1!=t.indexOf(e[i])?r.common[e[i]]=!0:r.added[e[i]]=!0;for(i=0;i<t.length;i++)t[i]in r.added||t[i]in r.common||(r.removed[t[i]]=!0);return r},i.PreferenceManager.prototype.syncChildList=function(e,t){for(var r=0,o=this.get(e),s=Object.keys(this.childLists_[e]),n=(i.PreferenceManager.diffChildLists(o,s),0);n<o.length;n++){var a=o[n],l=s.indexOf(a);if(l>=0&&s.splice(l,1),!this.childLists_[e][a]){var h=this.childFactories_[e](this,a);if(!h){console.warn("Unable to restore child: "+e+": "+a);continue}h.trace=this.trace,this.childLists_[e][a]=h,r++,h.readStorage(function(){0==--r&&t&&t()})}}for(n=0;n<s.length;n++)delete this.childLists_[e][s[n]];!r&&t&&setTimeout(t)},i.PreferenceManager.prototype.reset=function(e){var t=this.prefRecords_[e];if(!t)throw new Error("Unknown preference: "+e);this.storage.removeItem(this.prefix+e),t.currentValue!==this.DEFAULT_VALUE&&(t.currentValue=this.DEFAULT_VALUE,this.notifyChange_(e))},i.PreferenceManager.prototype.resetAll=function(){var e=[];for(var t in this.childLists_){var r=this.childLists_[t];for(var i in r)r[i].resetAll()}for(var o in this.prefRecords_)this.prefRecords_[o].currentValue!==this.DEFAULT_VALUE&&(this.prefRecords_[o].currentValue=this.DEFAULT_VALUE,e.push(o));var s=Object.keys(this.prefRecords_).map(function(e){return this.prefix+e}.bind(this));this.storage.removeItems(s),e.forEach(this.notifyChange_.bind(this))},i.PreferenceManager.prototype.diff=function(e,t){return typeof e!=typeof t||!/^(undefined|boolean|number|string)$/.test(typeof e)||e!==t},i.PreferenceManager.prototype.changeDefault=function(e,t){var r=this.prefRecords_[e];if(!r)throw new Error("Unknown preference: "+e);this.diff(r.defaultValue,t)&&(r.currentValue===this.DEFAULT_VALUE?(r.defaultValue=t,this.notifyChange_(e)):r.defaultValue=t)},i.PreferenceManager.prototype.changeDefaults=function(e){for(var t in e)this.changeDefault(t,e[t])},i.PreferenceManager.prototype.set=function(e,t){var r=this.prefRecords_[e];if(!r)throw new Error("Unknown preference: "+e);var i=r.get();this.diff(i,t)&&(this.diff(r.defaultValue,t)?(r.currentValue=t,this.storage.setItem(this.prefix+e,t)):(r.currentValue=this.DEFAULT_VALUE,this.storage.removeItem(this.prefix+e)),setTimeout(this.notifyChange_.bind(this,e),0))},i.PreferenceManager.prototype.get=function(e){var t=this.prefRecords_[e];if(!t)throw new Error("Unknown preference: "+e);return t.get()},i.PreferenceManager.prototype.exportAsJson=function(){var e={};for(var t in this.prefRecords_)if(t in this.childLists_){e[t]=[];for(var r=this.get(t),i=0;i<r.length;i++){var o=r[i];e[t].push({id:o,json:this.getChild(t,o).exportAsJson()})}}else{var s=this.prefRecords_[t];s.currentValue!=this.DEFAULT_VALUE&&(e[t]=s.currentValue)}return e},i.PreferenceManager.prototype.importFromJson=function(e){for(var t in e)if(t in this.childLists_)for(var r=e[t],i=0;i<r.length;i++){var o=r[i].id,s=this.childLists_[t][o];s||(s=this.createChild(t,null,o)),s.importFromJson(r[i].json)}else this.set(t,e[t])},i.PreferenceManager.prototype.onChildListChange_=function(e){this.syncChildList(e)},i.PreferenceManager.prototype.onStorageChange_=function(e){for(var t in e)if(!this.prefix||0==t.lastIndexOf(this.prefix,0)){var r=t.substr(this.prefix.length);if(r in this.prefRecords_){var i=this.prefRecords_[r],o=e[t].newValue,s=i.currentValue;s===i.DEFAULT_VALUE&&(s=void 0),this.diff(s,o)&&(i.currentValue=void 0===o||null===o?i.DEFAULT_VALUE:o,this.notifyChange_(r))}}},i.resource={resources_:{}},i.resource.add=function(e,t,r){i.resource.resources_[e]={type:t,name:e,data:r}},i.resource.get=function(e,t){if(!(e in i.resource.resources_)){if(void 0===t)throw"Unknown resource: "+e;return t}return i.resource.resources_[e]},i.resource.getData=function(e,t){if(!(e in i.resource.resources_)){if(void 0===t)throw"Unknown resource: "+e;return t}return i.resource.resources_[e].data},i.resource.getDataUrl=function(e,t){var r=i.resource.get(e,t);return"data:"+r.type+","+r.data},i.Storage=new Object,i.Storage.Chrome=function(e){this.storage_=e,this.observers_=[],chrome.storage.onChanged.addListener(this.onChanged_.bind(this))},i.Storage.Chrome.prototype.onChanged_=function(e,t){if(chrome.storage[t]==this.storage_)for(var r=0;r<this.observers_.length;r++)this.observers_[r](e)},i.Storage.Chrome.prototype.addObserver=function(e){this.observers_.push(e)},i.Storage.Chrome.prototype.removeObserver=function(e){var t=this.observers_.indexOf(e);-1!=t&&this.observers_.splice(t,1)},i.Storage.Chrome.prototype.clear=function(e){this.storage_.clear(),e&&setTimeout(e,0)},i.Storage.Chrome.prototype.getItem=function(e,t){this.storage_.get(e,t)},i.Storage.Chrome.prototype.getItems=function(e,t){this.storage_.get(e,t)},i.Storage.Chrome.prototype.setItem=function(e,t,r){var i={};i[e]=t,this.storage_.set(i,r)},i.Storage.Chrome.prototype.setItems=function(e,t){this.storage_.set(e,t)},i.Storage.Chrome.prototype.removeItem=function(e,t){this.storage_.remove(e,t)},i.Storage.Chrome.prototype.removeItems=function(e,t){this.storage_.remove(e,t)},i.Storage.Local=function(){this.observers_=[],this.storage_=window.localStorage,window.addEventListener("storage",this.onStorage_.bind(this))},i.Storage.Local.prototype.onStorage_=function(e){if(e.storageArea==this.storage_){var t=e.oldValue?JSON.parse(e.oldValue):e.oldValue,r=e.newValue?JSON.parse(e.newValue):e.newValue,i={};i[e.key]={oldValue:t,newValue:r};for(var o=0;o<this.observers_.length;o++)this.observers_[o](i)}},i.Storage.Local.prototype.addObserver=function(e){this.observers_.push(e)},i.Storage.Local.prototype.removeObserver=function(e){var t=this.observers_.indexOf(e);-1!=t&&this.observers_.splice(t,1)},i.Storage.Local.prototype.clear=function(e){this.storage_.clear(),e&&setTimeout(e,0)},i.Storage.Local.prototype.getItem=function(e,t){var r=this.storage_.getItem(e);if("string"==typeof r)try{r=JSON.parse(r)}catch(e){}setTimeout(t.bind(null,r),0)},i.Storage.Local.prototype.getItems=function(e,t){for(var r={},i=e.length-1;i>=0;i--){var o=e[i],s=this.storage_.getItem(o);if("string"==typeof s)try{r[o]=JSON.parse(s)}catch(e){r[o]=s}else e.splice(i,1)}setTimeout(t.bind(null,r),0)},i.Storage.Local.prototype.setItem=function(e,t,r){this.storage_.setItem(e,JSON.stringify(t)),r&&setTimeout(r,0)},i.Storage.Local.prototype.setItems=function(e,t){for(var r in e)this.storage_.setItem(r,JSON.stringify(e[r]));t&&setTimeout(t,0)},i.Storage.Local.prototype.removeItem=function(e,t){this.storage_.removeItem(e),t&&setTimeout(t,0)},i.Storage.Local.prototype.removeItems=function(e,t){for(var r=0;r<e.length;r++)this.storage_.removeItem(e[r]);t&&setTimeout(t,0)},i.Storage.Memory=function(){this.observers_=[],this.storage_={}},i.Storage.Memory.prototype.addObserver=function(e){this.observers_.push(e)},i.Storage.Memory.prototype.removeObserver=function(e){var t=this.observers_.indexOf(e);-1!=t&&this.observers_.splice(t,1)},i.Storage.Memory.prototype.clear=function(e){var t={};for(var r in this.storage_)t[r]={oldValue:this.storage_[r],newValue:void 0};this.storage_={},setTimeout(function(){for(var e=0;e<this.observers_.length;e++)this.observers_[e](t)}.bind(this),0),e&&setTimeout(e,0)},i.Storage.Memory.prototype.getItem=function(e,t){var r=this.storage_[e];if("string"==typeof r)try{r=JSON.parse(r)}catch(e){}setTimeout(t.bind(null,r),0)},i.Storage.Memory.prototype.getItems=function(e,t){for(var r={},i=e.length-1;i>=0;i--){var o=e[i],s=this.storage_[o];if("string"==typeof s)try{r[o]=JSON.parse(s)}catch(e){r[o]=s}else e.splice(i,1)}setTimeout(t.bind(null,r),0)},i.Storage.Memory.prototype.setItem=function(e,t,r){var i=this.storage_[e];this.storage_[e]=JSON.stringify(t);var o={};o[e]={oldValue:i,newValue:t},setTimeout(function(){for(var e=0;e<this.observers_.length;e++)this.observers_[e](o)}.bind(this),0),r&&setTimeout(r,0)},i.Storage.Memory.prototype.setItems=function(e,t){var r={};for(var i in e)r[i]={oldValue:this.storage_[i],newValue:e[i]},this.storage_[i]=JSON.stringify(e[i]);setTimeout(function(){for(var e=0;e<this.observers_.length;e++)this.observers_[e](r)}.bind(this)),t&&setTimeout(t,0)},i.Storage.Memory.prototype.removeItem=function(e,t){delete this.storage_[e],t&&setTimeout(t,0)},i.Storage.Memory.prototype.removeItems=function(e,t){for(var r=0;r<e.length;r++)delete this.storage_[e[r]];t&&setTimeout(t,0)},i.TestManager=function(e){this.log=e||new i.TestManager.Log},i.TestManager.prototype.createTestRun=function(e){return new i.TestManager.TestRun(this,e)},i.TestManager.prototype.onTestRunComplete=function(e){},i.TestManager.prototype.testPreamble=function(e,t){},i.TestManager.prototype.testPostamble=function(e,t){},i.TestManager.Log=function(e=console){this.save=!1,this.data="",this.prefix_="",this.prefixStack_=0,this.console_=e,["log","debug","info","warn","error"].forEach(e=>{let t="";switch(e){case"debug":case"warn":case"error":t=e.toUpperCase()+": "}const r=this.console_[e];this[e]=this.console_[e]=((...e)=>{this.save&&(this.data+=this.prefix_+t+e.join(" ")+"\n"),r.apply(this.console_,e)})}),["group","groupCollapsed"].forEach(e=>{const t=this.console_[e];this[e]=this.console_[e]=((e="")=>{t(e),this.save&&(this.data+=this.prefix_+e+"\n"),this.prefix_="  ".repeat(++this.prefixStack_)})});const t=this.console_.groupEnd;this.groupEnd=this.console_.groupEnd=(()=>{t(),this.prefix_="  ".repeat(--this.prefixStack_)})},i.TestManager.Suite=function(e){function t(t,r){this.testManager_=t,this.suiteName=e,this.setup(r)}return t.suiteName=e,t.addTest=i.TestManager.Suite.addTest,t.disableTest=i.TestManager.Suite.disableTest,t.getTest=i.TestManager.Suite.getTest,t.getTestList=i.TestManager.Suite.getTestList,t.testList_=[],t.testMap_={},t.prototype=Object.create(i.TestManager.Suite.prototype),t.constructor=i.TestManager.Suite,i.TestManager.Suite.subclasses.push(t),t},i.TestManager.Suite.subclasses=[],i.TestManager.Suite.addTest=function(e,t){if(e in this.testMap_)throw"Duplicate test name: "+e;var r=new i.TestManager.Test(this,e,t);this.testMap_[e]=r,this.testList_.push(r)},i.TestManager.Suite.disableTest=function(e,t){if(e in this.testMap_)throw"Duplicate test name: "+e;var r=new i.TestManager.Test(this,e,t);console.log("Disabled test: "+r.fullName)},i.TestManager.Suite.getTest=function(e){return this.testMap_[e]},i.TestManager.Suite.getTestList=function(){return this.testList_},i.TestManager.Suite.prototype.setDefaults=function(e,t){for(var r in t)this[r]=r in e?e[r]:t[r]},i.TestManager.Suite.prototype.setup=function(e){},i.TestManager.Suite.prototype.preamble=function(e,t){},i.TestManager.Suite.prototype.postamble=function(e,t){},i.TestManager.Test=function(e,t,r){this.suiteClass=e,this.testName=t,this.fullName=e.suiteName+"["+t+"]",this.testFunction_=r},i.TestManager.Test.prototype.run=function(e){try{this.testFunction_.apply(e.suite,[e,e.testRun.cx])}catch(t){if(t instanceof i.TestManager.Result.TestComplete)return;e.println("Test raised an exception: "+t),t.stack&&(t.stack instanceof Array?e.println(t.stack.join("\n")):e.println(t.stack)),e.completeTest_(e.FAILED,!1)}},i.TestManager.TestRun=function(e,t){this.testManager=e,this.log=e.log,this.cx=t||{},this.failures=[],this.passes=[],this.startDate=null,this.duration=null,this.currentResult=null,this.maxFailures=0,this.panic=!1,this.testQueue_=[]},i.TestManager.TestRun.prototype.ALL_TESTS=i.f.createEnum("<all-tests>"),i.TestManager.TestRun.prototype.selectTest=function(e){this.testQueue_.push(e)},i.TestManager.TestRun.prototype.selectSuite=function(e,t){for(var r=t||this.ALL_TESTS,i=0,o=e.getTestList(),s=0;s<o.length;s++){var n=o[s];if(r!==this.ALL_TESTS)if(r instanceof RegExp){if(!r.test(n.testName))continue}else if(n.testName!=r)continue;this.selectTest(n),i++}return i},i.TestManager.TestRun.prototype.selectPattern=function(e){for(var t=0,r=0;r<i.TestManager.Suite.subclasses.length;r++)t+=this.selectSuite(i.TestManager.Suite.subclasses[r],e);return t||this.log.warn("No tests matched selection criteria: "+e),t},i.TestManager.TestRun.prototype.onUncaughtException_=function(e,t,r){if(0==e.indexOf("Uncaught lib.TestManager.Result.TestComplete")||-1!=e.indexOf("status: passed"))return!0;if(this.currentResult&&e!="Uncaught "+this.currentResult.expectedErrorMessage_){var i="during";return this.currentResult.status!=this.currentResult.PENDING&&(i="after"),this.log.error("Uncaught exception "+i+" test case: "+this.currentResult.test.fullName),this.log.error(e+", "+t+":"+r),this.currentResult.completeTest_(this.currentResult.FAILED,!1),!1}},i.TestManager.TestRun.prototype.onTestRunComplete_=function(e){e?(this.duration=new Date-this.startDate,this.log.groupEnd(),this.log.info(this.passes.length+" passed, "+this.failures.length+" failed, "+this.msToSeconds_(this.duration)),this.summarize(),window.onerror=null,this.testManager.onTestRunComplete(this)):setTimeout(this.onTestRunComplete_.bind(this),0,!0)},i.TestManager.TestRun.prototype.onResultComplete=function(e){try{this.testManager.testPostamble(e,this.cx),e.suite.postamble(e,this.ctx)}catch(e){this.log.error("Unexpected exception in postamble: "+(e.stack?e.stack:e)),this.panic=!0}if(e.status!=e.PASSED?this.log.error(e.status):e.duration>500&&this.log.warn("Slow test took "+this.msToSeconds_(e.duration)),this.log.groupEnd(),e.status==e.FAILED)this.failures.push(e),this.currentSuite=null;else{if(e.status!=e.PASSED)return this.log.error("Unknown result status: "+e.test.fullName+": "+e.status),this.panic=!0;this.passes.push(e)}this.runNextTest_()},i.TestManager.TestRun.prototype.onResultReComplete=function(e,t){this.log.error("Late complete for test: "+e.test.fullName+": "+t);var r=this.passes.indexOf(e);r>=0&&(this.passes.splice(r,1),this.failures.push(e))},i.TestManager.TestRun.prototype.runNextTest_=function(){if(this.panic||!this.testQueue_.length)return this.onTestRunComplete_();if(this.maxFailures&&this.failures.length>=this.maxFailures)return this.log.error("Maximum failure count reached, aborting test run."),this.onTestRunComplete_();var e=this.testQueue_[0],t=this.currentResult?this.currentResult.suite:null;try{t&&t instanceof e.suiteClass||(t&&this.log.groupEnd(),this.log.group(e.suiteClass.suiteName),t=new e.suiteClass(this.testManager,this.cx))}catch(e){return this.log.error("Exception during setup: "+(e.stack?e.stack:e)),this.panic=!0,void this.onTestRunComplete_()}try{this.log.group(e.testName),this.currentResult=new i.TestManager.Result(this,t,e),this.testManager.testPreamble(this.currentResult,this.cx),t.preamble(this.currentResult,this.cx),this.testQueue_.shift()}catch(e){return this.log.error("Unexpected exception during test preamble: "+(e.stack?e.stack:e)),this.log.groupEnd(),this.panic=!0,void this.onTestRunComplete_()}try{this.currentResult.run()}catch(e){this.log.error("Unexpected exception during test run: "+(e.stack?e.stack:e)),this.panic=!0}},i.TestManager.TestRun.prototype.run=function(){this.log.info("Running "+this.testQueue_.length+" test(s)"),window.onerror=this.onUncaughtException_.bind(this),this.startDate=new Date,this.runNextTest_()},i.TestManager.TestRun.prototype.msToSeconds_=function(e){return(e/1e3).toFixed(2)+"s"},i.TestManager.TestRun.prototype.summarize=function(){if(this.failures.length)for(var e=0;e<this.failures.length;e++)this.log.error("FAILED: "+this.failures[e].test.fullName);this.testQueue_.length&&this.log.warn("Test run incomplete: "+this.testQueue_.length+" test(s) were not run.")},i.TestManager.Result=function(e,t,r){this.testRun=e,this.suite=t,this.test=r,this.startDate=null,this.duration=null,this.status=this.PENDING,this.expectedErrorMessage_=null},i.TestManager.Result.prototype.PENDING="pending",i.TestManager.Result.prototype.FAILED="FAILED",i.TestManager.Result.prototype.PASSED="passed",i.TestManager.Result.TestComplete=function(e){this.result=e},i.TestManager.Result.TestComplete.prototype.toString=function(){return"lib.TestManager.Result.TestComplete: "+this.result.test.fullName+", status: "+this.result.status},i.TestManager.Result.prototype.run=function(){this.startDate=new Date,this.test.run(this),this.status!=this.PENDING||this.timeout_||(this.println("Test did not return a value and did not request more time."),this.completeTest_(this.FAILED,!1))},i.TestManager.Result.prototype.expectErrorMessage=function(e){this.expectedErrorMessage_=e},i.TestManager.Result.prototype.onTimeout_=function(){this.timeout_=null,this.status==this.PENDING&&(this.println("Test timed out."),this.completeTest_(this.FAILED,!1))},i.TestManager.Result.prototype.requestTime=function(e){this.timeout_&&clearTimeout(this.timeout_),this.timeout_=setTimeout(this.onTimeout_.bind(this),e)},i.TestManager.Result.prototype.completeTest_=function(e,t){if(this.status==this.PENDING?(this.duration=new Date-this.startDate,this.status=e,this.testRun.onResultComplete(this)):this.testRun.onResultReComplete(this,e),arguments.length<2||t)throw new i.TestManager.Result.TestComplete(this)},i.TestManager.Result.prototype.arrayEQ_=function(e,t){if(!e||!t)return!e&&!t;if(e.length!=t.length)return!1;for(var r=0;r<e.length;++r)if(e[r]!=t[r])return!1;return!0},i.TestManager.Result.prototype.assertEQ=function(e,t,r){function i(e){if("number"==typeof e)return e;var t=String(e).split("\n").map(function(e){return JSON.stringify(e)});return t.length>1?"\n"+t.join("\n"):t.join("\n")}if(e!==t&&!(t instanceof Array&&this.arrayEQ_(e,t))){var o=r?"["+r+"]":"";this.fail("assertEQ"+o+": "+this.getCallerLocation_(1)+": "+i(e)+" !== "+i(t))}},i.TestManager.Result.prototype.assert=function(e,t){if(!0!==e){var r=t?"["+t+"]":"";this.fail("assert"+r+": "+this.getCallerLocation_(1)+": "+String(e))}},i.TestManager.Result.prototype.getCallerLocation_=function(e){try{throw new Error}catch(r){var t=r.stack.split("\n")[e+2].match(/([^/]+:\d+):\d+\)?$/);return t?t[1]:"???"}},i.TestManager.Result.prototype.println=function(e){this.testRun.log.info(e)},i.TestManager.Result.prototype.fail=function(e){arguments.length&&this.println(e),this.completeTest_(this.FAILED,!0)},i.TestManager.Result.prototype.pass=function(){this.completeTest_(this.PASSED,!0)},i.UTF8Decoder=function(){this.bytesLeft=0,this.codePoint=0,this.lowerBound=0},i.UTF8Decoder.prototype.decode=function(e){for(var t="",r=0;r<e.length;r++){var i=e.charCodeAt(r);if(0==this.bytesLeft)i<=127?t+=e.charAt(r):192<=i&&i<=223?(this.codePoint=i-192,this.bytesLeft=1,this.lowerBound=128):224<=i&&i<=239?(this.codePoint=i-224,this.bytesLeft=2,this.lowerBound=2048):240<=i&&i<=247?(this.codePoint=i-240,this.bytesLeft=3,this.lowerBound=65536):248<=i&&i<=251?(this.codePoint=i-248,this.bytesLeft=4,this.lowerBound=2097152):252<=i&&i<=253?(this.codePoint=i-252,this.bytesLeft=5,this.lowerBound=67108864):t+="�";else if(128<=i&&i<=191){if(this.bytesLeft--,this.codePoint=(this.codePoint<<6)+(i-128),0==this.bytesLeft){var o=this.codePoint;o<this.lowerBound||55296<=o&&o<=57343||o>1114111?t+="�":o<65536?t+=String.fromCharCode(o):(o-=65536,t+=String.fromCharCode(55296+(o>>>10&1023),56320+(1023&o)))}}else t+="�",this.bytesLeft=0,r--}return t},i.decodeUTF8=function(e){return(new i.UTF8Decoder).decode(e)},i.encodeUTF8=function(e){for(var t="",r=0;r<e.length;r++){var i=e.charCodeAt(r);if(56320<=i&&i<=57343)i=65533;else if(55296<=i&&i<=56319)if(r+1<e.length){var o=e.charCodeAt(r+1);56320<=o&&o<=57343?(i=65536+((1023&i)<<10)+(1023&o),r++):i=65533}else i=65533;var s;if(i<=127)t+=e.charAt(r);else for(i<=2047?(t+=String.fromCharCode(192|i>>>6),s=1):i<=65535?(t+=String.fromCharCode(224|i>>>12),s=2):(t+=String.fromCharCode(240|i>>>18),s=3);s>0;)s--,t+=String.fromCharCode(128|i>>>6*s&63)}return t},i.wc={},i.wc.nulWidth=0,i.wc.controlWidth=0,i.wc.regardCjkAmbiguous=!1,i.wc.cjkAmbiguousWidth=2,i.wc.combining=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531],[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]],i.wc.ambiguous=[[161,161],[164,164],[167,168],[170,170],[174,174],[176,180],[182,186],[188,191],[198,198],[208,208],[215,216],[222,225],[230,230],[232,234],[236,237],[240,240],[242,243],[247,250],[252,252],[254,254],[257,257],[273,273],[275,275],[283,283],[294,295],[299,299],[305,307],[312,312],[319,322],[324,324],[328,331],[333,333],[338,339],[358,359],[363,363],[462,462],[464,464],[466,466],[468,468],[470,470],[472,472],[474,474],[476,476],[593,593],[609,609],[708,708],[711,711],[713,715],[717,717],[720,720],[728,731],[733,733],[735,735],[913,929],[931,937],[945,961],[963,969],[1025,1025],[1040,1103],[1105,1105],[8208,8208],[8211,8214],[8216,8217],[8220,8221],[8224,8226],[8228,8231],[8240,8240],[8242,8243],[8245,8245],[8251,8251],[8254,8254],[8308,8308],[8319,8319],[8321,8324],[8364,8364],[8451,8451],[8453,8453],[8457,8457],[8467,8467],[8470,8470],[8481,8482],[8486,8486],[8491,8491],[8531,8532],[8539,8542],[8544,8555],[8560,8569],[8592,8601],[8632,8633],[8658,8658],[8660,8660],[8679,8679],[8704,8704],[8706,8707],[8711,8712],[8715,8715],[8719,8719],[8721,8721],[8725,8725],[8730,8730],[8733,8736],[8739,8739],[8741,8741],[8743,8748],[8750,8750],[8756,8759],[8764,8765],[8776,8776],[8780,8780],[8786,8786],[8800,8801],[8804,8807],[8810,8811],[8814,8815],[8834,8835],[8838,8839],[8853,8853],[8857,8857],[8869,8869],[8895,8895],[8978,8978],[9312,9449],[9451,9547],[9552,9587],[9600,9615],[9618,9621],[9632,9633],[9635,9641],[9650,9651],[9654,9655],[9660,9661],[9664,9665],[9670,9672],[9675,9675],[9678,9681],[9698,9701],[9711,9711],[9733,9734],[9737,9737],[9742,9743],[9748,9749],[9756,9756],[9758,9758],[9792,9792],[9794,9794],[9824,9825],[9827,9829],[9831,9834],[9836,9837],[9839,9839],[10045,10045],[10102,10111],[57344,63743],[65533,65533],[983040,1048573],[1048576,1114109]],i.wc.isSpace=function(e){var t,r=0,o=i.wc.combining.length-1;if(e<i.wc.combining[0][0]||e>i.wc.combining[o][1])return!1;for(;o>=r;)if(t=Math.floor((r+o)/2),e>i.wc.combining[t][1])r=t+1;else{if(!(e<i.wc.combining[t][0]))return!0;o=t-1}return!1},i.wc.isCjkAmbiguous=function(e){var t,r=0,o=i.wc.ambiguous.length-1;if(e<i.wc.ambiguous[0][0]||e>i.wc.ambiguous[o][1])return!1;for(;o>=r;)if(t=Math.floor((r+o)/2),e>i.wc.ambiguous[t][1])r=t+1;else{if(!(e<i.wc.ambiguous[t][0]))return!0;o=t-1}return!1},i.wc.charWidth=function(e){return i.wc.regardCjkAmbiguous?i.wc.charWidthRegardAmbiguous(e):i.wc.charWidthDisregardAmbiguous(e)},i.wc.charWidthDisregardAmbiguous=function(e){return 0===e?i.wc.nulWidth:e<32||e>=127&&e<160?i.wc.controlWidth:e<127?1:i.wc.isSpace(e)?0:1+(e>=4352&&(e<=4447||9001==e||9002==e||e>=11904&&e<=42191&&12351!=e||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65135||e>=65280&&e<=65376||e>=65504&&e<=65510||e>=131072&&e<=196605||e>=196608&&e<=262141))},i.wc.charWidthRegardAmbiguous=function(e){return i.wc.isCjkAmbiguous(e)?i.wc.cjkAmbiguousWidth:i.wc.charWidthDisregardAmbiguous(e)},i.wc.strWidth=function(e){for(var t,r=0,o=0;o<e.length;){var s=e.codePointAt(o);if((t=i.wc.charWidth(s))<0)return-1;r+=t,o+=s<=65535?1:2}return r},i.wc.substr=function(e,t,r){var o,s,n;for(o=0,n=0;o<e.length&&!((n+=i.wc.charWidth(e.charCodeAt(o)))>t);o++);if(void 0!=r){for(s=o,n=0;s<e.length&&n<=r;n+=i.wc.charWidth(e.charCodeAt(s)),s++);return n>r&&s--,e.substring(o,s)}return e.substr(o)},i.wc.substring=function(e,t,r){return i.wc.substr(e,t,r-t)},i.resource.add("libdot/changelog/version","text/plain","1.16"),i.resource.add("libdot/changelog/date","text/plain","2017-08-16"),i.rtdep("lib.Storage");var o={};o.windowType=null,o.zoomWarningMessage="ZOOM != 100%",o.notifyCopyMessage="✂",o.desktopNotificationTitle="♪ %(title) ♪",o.testDeps=["hterm.ScrollPort.Tests","hterm.Screen.Tests","hterm.Terminal.Tests","hterm.VT.Tests","hterm.VT.CannedTests"],i.registerInit("hterm",function(e){function t(t){o.windowType=t.type,setTimeout(e,0)}o.defaultStorage||(window.chrome&&chrome.storage&&chrome.storage.sync?o.defaultStorage=new i.Storage.Chrome(chrome.storage.sync):o.defaultStorage=new i.Storage.Local);var r=!1;if(window.chrome&&chrome.runtime&&chrome.runtime.getManifest){var s=chrome.runtime.getManifest();r=s.app&&s.app.background}r?setTimeout(t.bind(null,{type:"popup"}),0):window.chrome&&chrome.tabs?chrome.tabs.getCurrent(function(r){r&&window.chrome?chrome.windows.get(r.windowId,null,t):(o.windowType="normal",setTimeout(e,0))}):setTimeout(t.bind(null,{type:"normal"}),0)}),o.getClientSize=function(e){return e.getBoundingClientRect()},o.getClientWidth=function(e){return e.getBoundingClientRect().width},o.getClientHeight=function(e){return e.getBoundingClientRect().height},o.copySelectionToClipboard=function(e){try{e.execCommand("copy")}catch(e){}},o.pasteFromClipboard=function(e){try{return e.execCommand("paste")}catch(e){return!1}},o.notify=function(e){var t=(e,t)=>void 0!==e?e:t;void 0!==e&&null!==e||(e={});var r={body:e.body,icon:t(e.icon,i.resource.getDataUrl("hterm/images/icon-96"))},s=t(e.title,window.document.title);s||(s="hterm"),s=i.f.replaceVars(o.desktopNotificationTitle,{title:s});var n=new Notification(s,r);return n.onclick=function(){window.focus(),this.close()},n},o.Size=function(e,t){this.width=e,this.height=t},o.Size.prototype.resize=function(e,t){this.width=e,this.height=t},o.Size.prototype.clone=function(){return new o.Size(this.width,this.height)},o.Size.prototype.setTo=function(e){this.width=e.width,this.height=e.height},o.Size.prototype.equals=function(e){return this.width==e.width&&this.height==e.height},o.Size.prototype.toString=function(){return"[hterm.Size: "+this.width+", "+this.height+"]"},o.RowCol=function(e,t,r){this.row=e,this.column=t,this.overflow=!!r},o.RowCol.prototype.move=function(e,t,r){this.row=e,this.column=t,this.overflow=!!r},o.RowCol.prototype.clone=function(){return new o.RowCol(this.row,this.column,this.overflow)},o.RowCol.prototype.setTo=function(e){this.row=e.row,this.column=e.column,this.overflow=e.overflow},o.RowCol.prototype.equals=function(e){return this.row==e.row&&this.column==e.column&&this.overflow==e.overflow},o.RowCol.prototype.toString=function(){return"[hterm.RowCol: "+this.row+", "+this.column+", "+this.overflow+"]"},i.rtdep("lib.f"),o.Frame=function(e,t,r){this.terminal_=e,this.div_=e.div_,this.url=t,this.options=r||{},this.iframe_=null,this.container_=null,this.messageChannel_=null},o.Frame.prototype.onMessage_=function(e){switch(e.data.name){case"ipc-init-ok":return void this.sendTerminalInfo_();case"terminal-info-ok":return this.container_.style.display="flex",this.messageChannel_.port1.onmessage=this.onMessage.bind(this),void this.onLoad();default:return void console.log("Unknown message from frame:",e.data)}},o.Frame.prototype.onMessage=function(){},o.Frame.prototype.onLoad_=function(){this.messageChannel_=new MessageChannel,this.messageChannel_.port1.onmessage=this.onMessage_.bind(this),this.messageChannel_.port1.start(),this.iframe_.contentWindow.postMessage({name:"ipc-init",argv:[{messagePort:this.messageChannel_.port2}]},this.url,[this.messageChannel_.port2])},o.Frame.prototype.onLoad=function(){},o.Frame.prototype.sendTerminalInfo_=function(){i.f.getAcceptLanguages(function(e){this.postMessage("terminal-info",[{acceptLanguages:e,foregroundColor:this.terminal_.getForegroundColor(),backgroundColor:this.terminal_.getBackgroundColor(),cursorColor:this.terminal_.getCursorColor(),fontSize:this.terminal_.getFontSize(),fontFamily:this.terminal_.getFontFamily(),baseURL:i.f.getURL("/")}])}.bind(this))},o.Frame.prototype.onCloseClicked_=function(){this.close()},o.Frame.prototype.close=function(){this.container_&&this.container_.parentNode&&(this.container_.parentNode.removeChild(this.container_),this.onClose())},o.Frame.prototype.onClose=function(){},o.Frame.prototype.postMessage=function(e,t){if(!this.messageChannel_)throw new Error("Message channel is not set up.");this.messageChannel_.port1.postMessage({name:e,argv:t})},o.Frame.prototype.show=function(){function e(e,r){return e in t.options?t.options[e]:r}var t=this,t=this;if(this.container_&&this.container_.parentNode)console.error("Frame already visible");else{var r=o.getClientSize(this.div_),i=e("width",640),s=e("height",480),n=(r.width,r.height,this.terminal_.document_),a=this.container_=n.createElement("div");a.style.cssText="position: absolute;display: none;flex-direction: column;top: 10%;left: 4%;width: 90%;height: 80%;min-height: 20%;max-height: 80%;box-shadow: 0 0 2px "+this.terminal_.getForegroundColor()+";border: 2px "+this.terminal_.getForegroundColor()+" solid;";var l=this.iframe_=n.createElement("iframe");l.onload=this.onLoad_.bind(this),l.style.cssText="display: flex;flex: 1;width: 100%",l.setAttribute("src",this.url),l.setAttribute("seamless",!0),a.appendChild(l),this.div_.appendChild(a)}},i.rtdep("hterm.Keyboard.KeyMap"),o.Keyboard=function(e){this.terminal=e,this.keyboardElement_=null,this.handlers_=[["focusout",this.onFocusOut_.bind(this)],["keydown",this.onKeyDown_.bind(this)],["keypress",this.onKeyPress_.bind(this)],["keyup",this.onKeyUp_.bind(this)],["textInput",this.onTextInput_.bind(this)]],this.keyMap=new o.Keyboard.KeyMap(this),this.bindings=new o.Keyboard.Bindings(this),this.altGrMode="none",this.shiftInsertPaste=!0,this.homeKeysScroll=!1,this.pageKeysScroll=!1,this.ctrlPlusMinusZeroZoom=!0,this.ctrlCCopy=!1,this.ctrlVPaste=!1,this.applicationKeypad=!1,this.applicationCursor=!1,this.backspaceSendsBackspace=!1,this.characterEncoding="utf-8",this.metaSendsEscape=!0,this.passMetaV=!0,this.altSendsWhat="escape",this.altIsMeta=!1,this.altBackspaceIsMetaBackspace=!1,this.altKeyPressed=0,this.mediaKeysAreFKeys=!1,this.previousAltSendsWhat_=null},o.Keyboard.KeyActions={CANCEL:i.f.createEnum("CANCEL"),DEFAULT:i.f.createEnum("DEFAULT"),PASS:i.f.createEnum("PASS"),STRIP:i.f.createEnum("STRIP")},o.Keyboard.prototype.encode=function(e){return"utf-8"==this.characterEncoding?this.terminal.vt.encodeUTF8(e):e},o.Keyboard.prototype.installKeyboard=function(e){if(e!=this.keyboardElement_){e&&this.keyboardElement_&&this.installKeyboard(null);for(var t=0;t<this.handlers_.length;t++){var r=this.handlers_[t];e?e.addEventListener(r[0],r[1]):this.keyboardElement_.removeEventListener(r[0],r[1])}this.keyboardElement_=e}},o.Keyboard.prototype.uninstallKeyboard=function(){this.installKeyboard(null)},o.Keyboard.prototype.onTextInput_=function(e){e.data&&e.data.split("").forEach(this.terminal.onVTKeystroke.bind(this.terminal))},o.Keyboard.prototype.onKeyPress_=function(e){var t=String.fromCharCode(e.which).toLowerCase();if(!e.ctrlKey&&!e.metaKey||"c"!=t&&"v"!=t){if(e.altKey&&"browser-key"==this.altSendsWhat&&0==e.charCode){var r=String.fromCharCode(e.keyCode);e.shiftKey||(r=r.toLowerCase()),r.charCodeAt(0)+128}else e.charCode>=32&&(r=e.charCode);r&&this.terminal.onVTKeystroke(String.fromCharCode(r)),e.preventDefault(),e.stopPropagation()}},o.Keyboard.prototype.preventChromeAppNonCtrlShiftDefault_=function(e){window.chrome&&window.chrome.app&&window.chrome.app.window&&(e.ctrlKey&&e.shiftKey||e.preventDefault())},o.Keyboard.prototype.onFocusOut_=function(e){this.altKeyPressed=0},o.Keyboard.prototype.onKeyUp_=function(e){18==e.keyCode&&(this.altKeyPressed=this.altKeyPressed&~(1<<e.location-1)),27==e.keyCode&&this.preventChromeAppNonCtrlShiftDefault_(e)},o.Keyboard.prototype.onKeyDown_=function(e){function t(o){i=o;var n=r[o];return"function"==typeof n&&(n=n.apply(s.keyMap,[e,r])),n===a&&"normal"!=o&&(n=t("normal")),n}18==e.keyCode&&(this.altKeyPressed=this.altKeyPressed|1<<e.location-1),27==e.keyCode&&this.preventChromeAppNonCtrlShiftDefault_(e);var r=this.keyMap.keyDefs[e.keyCode];if(r){var i=null,s=this,n=o.Keyboard.KeyActions.CANCEL,a=o.Keyboard.KeyActions.DEFAULT,l=o.Keyboard.KeyActions.PASS,h=o.Keyboard.KeyActions.STRIP,c=e.ctrlKey,u=!this.altIsMeta&&e.altKey,d=this.altIsMeta?e.altKey||e.metaKey:e.metaKey,p=!/^\[\w+\]$/.test(r.keyCap);switch(this.altGrMode){case"ctrl-alt":p&&c&&u&&(c=!1,u=!1);break;case"right-alt":p&&2&this.terminal.keyboard.altKeyPressed&&(c=!1,u=!1);break;case"left-alt":p&&1&this.terminal.keyboard.altKeyPressed&&(c=!1,u=!1)}var f;f=t(c?"control":u?"alt":d?"meta":"normal");var g=!e.maskShiftKey&&e.shiftKey,m={keyCode:e.keyCode,shift:e.shiftKey,ctrl:c,alt:u,meta:d},y=this.bindings.getBinding(m);if(y&&(g=c=u=d=!1,i="normal","function"==typeof(f=y.action)&&(f=f.call(this,this.terminal,m))),u&&"browser-key"==this.altSendsWhat&&f==a&&(f=l),f!==l&&(f!==a||c||u||d)&&(f===h&&(u=c=!1,"function"==typeof(f=r.normal)&&(f=f.apply(this.keyMap,[e,r])),f==a&&2==r.keyCap.length&&(f=r.keyCap.substr(g?1:0,1))),e.preventDefault(),e.stopPropagation(),f!==n))if(f===a||"string"==typeof f){if("control"==i?c=!1:"alt"==i?u=!1:"meta"==i&&(d=!1),"["==f.substr(0,2)&&(u||c||g)){var b;!g||u||c?!u||g||c?g&&u&&!c?b=";4":!c||g||u?g&&c&&!u?b=";6":u&&c&&!g?b=";7":g&&u&&c&&(b=";8"):b=";5":b=";3":b=";2",f=3==f.length?"[1"+b+f.substr(2,1):f.substr(0,f.length-1)+b+f.substr(f.length-1)}else{if(f===a&&(f=r.keyCap.substr(g?1:0,1),c&&(_=r.keyCap.substr(0,1).charCodeAt(0))>=64&&_<=95&&(f=String.fromCharCode(_-64))),u&&"8-bit"==this.altSendsWhat&&1==f.length){var _=f.charCodeAt(0)+128;f=String.fromCharCode(_)}(u&&"escape"==this.altSendsWhat||d&&this.metaSendsEscape)&&(f=""+f)}this.terminal.onVTKeystroke(f)}else console.warn("Invalid action: "+JSON.stringify(f))}else console.warn("No definition for keyCode: "+e.keyCode)},o.Keyboard.Bindings=function(){this.bindings_={}},o.Keyboard.Bindings.prototype.clear=function(){this.bindings_={}},o.Keyboard.Bindings.prototype.addBinding_=function(e,t){var r=null,i=this.bindings_[e.keyCode];if(i)for(var s=0;s<i.length;s++)if(i[s].keyPattern.matchKeyPattern(e)){r=i[s];break}r?r.action=t:(r={keyPattern:e,action:t},i?(this.bindings_[e.keyCode].push(r),i.sort(function(e,t){return o.Keyboard.KeyPattern.sortCompare(e.keyPattern,t.keyPattern)})):this.bindings_[e.keyCode]=[r])},o.Keyboard.Bindings.prototype.addBinding=function(e,t){if("string"==typeof e){var r=new o.Parser;r.reset(e);var i;try{i=r.parseKeySequence()}catch(e){return void console.error(e)}if(r.isComplete()){if("string"==typeof t){r.reset(t);try{t=r.parseKeyAction()}catch(e){return void console.error(e)}}r.isComplete()?this.addBinding_(new o.Keyboard.KeyPattern(i),t):console.error(r.error("Expected end of sequence: "+i))}else console.error(r.error("Expected end of sequence: "+i))}else this.addBinding_(e,t)},o.Keyboard.Bindings.prototype.addBindings=function(e){for(var t in e)this.addBinding(t,e[t])},o.Keyboard.Bindings.prototype.getBinding=function(e){var t=this.bindings_[e.keyCode];if(!t)return null;for(var r=0;r<t.length;r++){var i=t[r];if(i.keyPattern.matchKeyDown(e))return i}return null},i.rtdep("hterm.Keyboard.KeyActions"),o.Keyboard.KeyMap=function(e){this.keyboard=e,this.keyDefs={},this.reset()},o.Keyboard.KeyMap.prototype.addKeyDef=function(e,t){e in this.keyDefs&&console.warn("Duplicate keyCode: "+e),this.keyDefs[e]=t},o.Keyboard.KeyMap.prototype.addKeyDefs=function(e){for(var t=0;t<arguments.length;t++)this.addKeyDef(arguments[t][0],{keyCap:arguments[t][1],normal:arguments[t][2],control:arguments[t][3],alt:arguments[t][4],meta:arguments[t][5]})},o.Keyboard.KeyMap.prototype.reset=function(){function e(e,t,r){return"function"==typeof e?e.apply(c,[t,r]):e}function t(t,r){return function(i,o){return e(i.shiftKey||i.ctrlKey||i.altKey||i.metaKey||!c.keyboard.applicationCursor?t:r,i,o)}}function r(t,r){return function(i,o){return e(c.keyboard.backspaceSendsBackspace?r:t,i,o)}}function i(t,r){return function(i,o){var s=i.shiftKey?r:t;return i.maskShiftKey=!0,e(s,i,o)}}function s(t,r){return function(i,o){return e(i.altKey?r:t,i,o)}}function n(t,r){return function(i,o){return e(i.shiftKey||i.ctrlKey||i.altKey||i.metaKey?r:t,i,o)}}function a(e){return String.fromCharCode(e.charCodeAt(0)-64)}function l(e){return function(t,r){return this[e](t,r)}}function h(t){return function(r,i){return c.keyboard.mediaKeysAreFKeys?e(t,r,i):166==r.keyCode||167==r.keyCode||168==r.keyCode?o.Keyboard.KeyActions.CANCEL:o.Keyboard.KeyActions.PASS}}this.keyDefs={};var c=this,u=o.Keyboard.KeyActions.CANCEL,d=o.Keyboard.KeyActions.DEFAULT,p=o.Keyboard.KeyActions.PASS,f=o.Keyboard.KeyActions.STRIP;this.addKeyDefs([0,"[UNKNOWN]",p,p,p,p],[27,"[ESC]","",d,d,d],[112,"[F1]",n("OP",""),d,"[23~",d],[113,"[F2]",n("OQ",""),d,"[24~",d],[114,"[F3]",n("OR",""),d,"[25~",d],[115,"[F4]",n("OS",""),d,"[26~",d],[116,"[F5]","[15~",d,"[28~",d],[117,"[F6]","[17~",d,"[29~",d],[118,"[F7]","[18~",d,"[31~",d],[119,"[F8]","[19~",d,"[32~",d],[120,"[F9]","[20~",d,"[33~",d],[121,"[F10]","[21~",d,"[34~",d],[122,"[F11]","[23~",d,"[42~",d],[123,"[F12]","[24~",d,"[43~",d],[192,"`~",d,i(a("@"),a("^")),d,p],[49,"1!",d,l("onCtrlNum_"),l("onAltNum_"),l("onMetaNum_")],[50,"2@",d,l("onCtrlNum_"),l("onAltNum_"),l("onMetaNum_")],[51,"3#",d,l("onCtrlNum_"),l("onAltNum_"),l("onMetaNum_")],[52,"4$",d,l("onCtrlNum_"),l("onAltNum_"),l("onMetaNum_")],[53,"5%",d,l("onCtrlNum_"),l("onAltNum_"),l("onMetaNum_")],[54,"6^",d,l("onCtrlNum_"),l("onAltNum_"),l("onMetaNum_")],[55,"7&",d,l("onCtrlNum_"),l("onAltNum_"),l("onMetaNum_")],[56,"8*",d,l("onCtrlNum_"),l("onAltNum_"),l("onMetaNum_")],[57,"9(",d,l("onCtrlNum_"),l("onAltNum_"),l("onMetaNum_")],[48,"0)",d,l("onPlusMinusZero_"),l("onAltNum_"),l("onPlusMinusZero_")],[189,"-_",d,l("onPlusMinusZero_"),d,l("onPlusMinusZero_")],[187,"=+",d,l("onPlusMinusZero_"),d,l("onPlusMinusZero_")],[173,"-_",d,l("onPlusMinusZero_"),d,l("onPlusMinusZero_")],[61,"=+",d,l("onPlusMinusZero_"),d,l("onPlusMinusZero_")],[171,"+*",d,l("onPlusMinusZero_"),d,l("onPlusMinusZero_")],[8,"[BKSP]",r("","\b"),r("\b",""),d,d],[9,"[TAB]",i("\t",""),f,p,d],[81,"qQ",d,a("Q"),d,d],[87,"wW",d,a("W"),d,d],[69,"eE",d,a("E"),d,d],[82,"rR",d,a("R"),d,d],[84,"tT",d,a("T"),d,d],[89,"yY",d,a("Y"),d,d],[85,"uU",d,a("U"),d,d],[73,"iI",d,a("I"),d,d],[79,"oO",d,a("O"),d,d],[80,"pP",d,a("P"),d,d],[219,"[{",d,a("["),d,d],[221,"]}",d,a("]"),d,d],[220,"\\|",d,a("\\"),d,d],[20,"[CAPS]",p,p,p,d],[65,"aA",d,a("A"),d,d],[83,"sS",d,a("S"),d,d],[68,"dD",d,a("D"),d,d],[70,"fF",d,a("F"),d,d],[71,"gG",d,a("G"),d,d],[72,"hH",d,a("H"),d,d],[74,"jJ",d,i(a("J"),p),d,d],[75,"kK",d,i(a("K"),l("onClear_")),d,d],[76,"lL",d,i(a("L"),p),d,d],[186,";:",d,f,d,d],[222,"'\"",d,f,d,d],[13,"[ENTER]","\r",u,u,d],[16,"[SHIFT]",p,p,p,d],[90,"zZ",d,a("Z"),d,d],[88,"xX",d,a("X"),d,d],[67,"cC",d,l("onCtrlC_"),d,l("onMetaC_")],[86,"vV",d,l("onCtrlV_"),d,l("onMetaV_")],[66,"bB",d,i(a("B"),p),d,i(d,p)],[78,"nN",d,l("onCtrlN_"),d,l("onMetaN_")],[77,"mM",d,a("M"),d,d],[188,",<",d,s(f,p),d,d],[190,".>",d,s(f,p),d,d],[191,"/?",d,i(a("_"),a("?")),d,d],[17,"[CTRL]",p,p,p,p],[18,"[ALT]",p,p,p,p],[91,"[LAPL]",p,p,p,p],[32," ",d,a("@"),d,d],[92,"[RAPL]",p,p,p,p],[93,"[RMENU]",p,p,p,p],[42,"[PRTSCR]",p,p,p,p],[145,"[SCRLK]",p,p,p,p],[19,"[BREAK]",p,p,p,p],[45,"[INSERT]",l("onKeyInsert_"),d,d,d],[36,"[HOME]",l("onKeyHome_"),d,d,d],[33,"[PGUP]",l("onKeyPageUp_"),d,d,d],[46,"[DEL]",l("onKeyDel_"),d,d,d],[35,"[END]",l("onKeyEnd_"),d,d,d],[34,"[PGDOWN]",l("onKeyPageDown_"),d,d,d],[38,"[UP]",l("onKeyArrowUp_"),d,d,d],[40,"[DOWN]",l("onKeyArrowDown_"),d,d,d],[39,"[RIGHT]",t("","OC"),d,d,d],[37,"[LEFT]",t("","OD"),d,d,d],[144,"[NUMLOCK]",p,p,p,p],[96,"[KP0]",d,d,d,d],[97,"[KP1]",d,d,d,d],[98,"[KP2]",d,d,d,d],[99,"[KP3]",d,d,d,d],[100,"[KP4]",d,d,d,d],[101,"[KP5]",d,d,d,d],[102,"[KP6]",d,d,d,d],[103,"[KP7]",d,d,d,d],[104,"[KP8]",d,d,d,d],[105,"[KP9]",d,d,d,d],[107,"[KP+]",d,l("onPlusMinusZero_"),d,l("onPlusMinusZero_")],[109,"[KP-]",d,l("onPlusMinusZero_"),d,l("onPlusMinusZero_")],[106,"[KP*]",d,d,d,d],[111,"[KP/]",d,d,d,d],[110,"[KP.]",d,d,d,d],[166,"[BACK]",h(n("OP","")),d,"[23~",d],[167,"[FWD]",h(n("OQ","")),d,"[24~",d],[168,"[RELOAD]",h(n("OR","")),d,"[25~",d],[183,"[FSCR]",h(n("OS","")),d,"[26~",d],[182,"[WINS]",h("[15~"),d,"[28~",d],[216,"[BRIT-]",h("[17~"),d,"[29~",d],[217,"[BRIT+]",h("[18~"),d,"[31~",d])},o.Keyboard.KeyMap.prototype.onKeyInsert_=function(e){return this.keyboard.shiftInsertPaste&&e.shiftKey?o.Keyboard.KeyActions.PASS:"[2~"},o.Keyboard.KeyMap.prototype.onKeyHome_=function(e){return!this.keyboard.homeKeysScroll^e.shiftKey?e.altey||e.ctrlKey||e.shiftKey||!this.keyboard.applicationCursor?"":"OH":(this.keyboard.terminal.scrollHome(),o.Keyboard.KeyActions.CANCEL)},o.Keyboard.KeyMap.prototype.onKeyEnd_=function(e){return!this.keyboard.homeKeysScroll^e.shiftKey?e.altKey||e.ctrlKey||e.shiftKey||!this.keyboard.applicationCursor?"":"OF":(this.keyboard.terminal.scrollEnd(),o.Keyboard.KeyActions.CANCEL)},o.Keyboard.KeyMap.prototype.onKeyPageUp_=function(e){return!this.keyboard.pageKeysScroll^e.shiftKey?"[5~":(this.keyboard.terminal.scrollPageUp(),o.Keyboard.KeyActions.CANCEL)},o.Keyboard.KeyMap.prototype.onKeyDel_=function(e){return this.keyboard.altBackspaceIsMetaBackspace&&this.keyboard.altKeyPressed&&!e.altKey?"":"[3~"},o.Keyboard.KeyMap.prototype.onKeyPageDown_=function(e){return!this.keyboard.pageKeysScroll^e.shiftKey?"[6~":(this.keyboard.terminal.scrollPageDown(),o.Keyboard.KeyActions.CANCEL)},o.Keyboard.KeyMap.prototype.onKeyArrowUp_=function(e){return!this.keyboard.applicationCursor&&e.shiftKey?(this.keyboard.terminal.scrollLineUp(),o.Keyboard.KeyActions.CANCEL):e.shiftKey||e.ctrlKey||e.altKey||e.metaKey||!this.keyboard.applicationCursor?"":"OA"},o.Keyboard.KeyMap.prototype.onKeyArrowDown_=function(e){return!this.keyboard.applicationCursor&&e.shiftKey?(this.keyboard.terminal.scrollLineDown(),o.Keyboard.KeyActions.CANCEL):e.shiftKey||e.ctrlKey||e.altKey||e.metaKey||!this.keyboard.applicationCursor?"":"OB"},o.Keyboard.KeyMap.prototype.onClear_=function(e,t){return this.keyboard.terminal.wipeContents(),o.Keyboard.KeyActions.CANCEL},o.Keyboard.KeyMap.prototype.onCtrlNum_=function(e,t){function r(e){return String.fromCharCode(e.charCodeAt(0)-64)}if(this.keyboard.terminal.passCtrlNumber&&!e.shiftKey)return o.Keyboard.KeyActions.PASS;switch(t.keyCap.substr(0,1)){case"1":return"1";case"2":return r("@");case"3":return r("[");case"4":return r("\\");case"5":return r("]");case"6":return r("^");case"7":return r("_");case"8":return"";case"9":return"9"}},o.Keyboard.KeyMap.prototype.onAltNum_=function(e,t){return this.keyboard.terminal.passAltNumber&&!e.shiftKey?o.Keyboard.KeyActions.PASS:o.Keyboard.KeyActions.DEFAULT},o.Keyboard.KeyMap.prototype.onMetaNum_=function(e,t){return this.keyboard.terminal.passMetaNumber&&!e.shiftKey?o.Keyboard.KeyActions.PASS:o.Keyboard.KeyActions.DEFAULT},o.Keyboard.KeyMap.prototype.onCtrlC_=function(e,t){var r=this.keyboard.terminal.getDocument().getSelection();if(!r.isCollapsed){if(this.keyboard.ctrlCCopy&&!e.shiftKey)return this.keyboard.terminal.clearSelectionAfterCopy&&setTimeout(r.collapseToEnd.bind(r),50),o.Keyboard.KeyActions.PASS;if(!this.keyboard.ctrlCCopy&&e.shiftKey)return this.keyboard.terminal.clearSelectionAfterCopy&&setTimeout(r.collapseToEnd.bind(r),50),this.keyboard.terminal.copySelectionToClipboard(),o.Keyboard.KeyActions.CANCEL}return""},o.Keyboard.KeyMap.prototype.onCtrlN_=function(e,t){return e.shiftKey?(window.open(document.location.href,"","chrome=no,close=yes,resize=yes,scrollbars=yes,minimizable=yes,width="+window.innerWidth+",height="+window.innerHeight),o.Keyboard.KeyActions.CANCEL):""},o.Keyboard.KeyMap.prototype.onCtrlV_=function(e,t){return!e.shiftKey&&this.keyboard.ctrlVPaste||e.shiftKey&&!this.keyboard.ctrlVPaste?this.keyboard.terminal.paste()?o.Keyboard.KeyActions.CANCEL:o.Keyboard.KeyActions.PASS:""},o.Keyboard.KeyMap.prototype.onMetaN_=function(e,t){return e.shiftKey?(window.open(document.location.href,"","chrome=no,close=yes,resize=yes,scrollbars=yes,minimizable=yes,width="+window.outerWidth+",height="+window.outerHeight),o.Keyboard.KeyActions.CANCEL):o.Keyboard.KeyActions.DEFAULT},o.Keyboard.KeyMap.prototype.onMetaC_=function(e,t){var r=this.keyboard.terminal.getDocument();return e.shiftKey||r.getSelection().isCollapsed?t.keyCap.substr(e.shiftKey?1:0,1):(this.keyboard.terminal.clearSelectionAfterCopy&&setTimeout(function(){r.getSelection().collapseToEnd()},50),o.Keyboard.KeyActions.PASS)},o.Keyboard.KeyMap.prototype.onMetaV_=function(e,t){return e.shiftKey?o.Keyboard.KeyActions.PASS:this.keyboard.passMetaV?o.Keyboard.KeyActions.PASS:o.Keyboard.KeyActions.DEFAULT},o.Keyboard.KeyMap.prototype.onPlusMinusZero_=function(e,t){if(!(this.keyboard.ctrlPlusMinusZeroZoom^e.shiftKey))return"-_"==t.keyCap?"":o.Keyboard.KeyActions.CANCEL;if(1!=this.keyboard.terminal.getZoomFactor())return o.Keyboard.KeyActions.PASS;var r=t.keyCap.substr(0,1);if("0"==r)this.keyboard.terminal.setFontSize(0);else{var i=this.keyboard.terminal.getFontSize();"-"==r||"[KP-]"==t.keyCap?i-=1:i+=1,this.keyboard.terminal.setFontSize(i)}return o.Keyboard.KeyActions.CANCEL},o.Keyboard.KeyPattern=function(e){this.wildcardCount=0,this.keyCode=e.keyCode,o.Keyboard.KeyPattern.modifiers.forEach(function(t){this[t]=e[t]||!1,"*"==this[t]&&this.wildcardCount++}.bind(this))},o.Keyboard.KeyPattern.modifiers=["shift","ctrl","alt","meta"],o.Keyboard.KeyPattern.sortCompare=function(e,t){return e.wildcardCount<t.wildcardCount?-1:e.wildcardCount>t.wildcardCount?1:0},o.Keyboard.KeyPattern.prototype.match_=function(e,t){if(this.keyCode!=e.keyCode)return!1;var r=!0;return o.Keyboard.KeyPattern.modifiers.forEach(function(i){var o=i in e&&e[i];r&&(t||"*"!=this[i])&&this[i]!=o&&(r=!1)}.bind(this)),r},o.Keyboard.KeyPattern.prototype.matchKeyDown=function(e){return this.match_(e,!1)},o.Keyboard.KeyPattern.prototype.matchKeyPattern=function(e){return this.match_(e,!0)},o.Options=function(e){this.wraparound=!e||e.wraparound,this.reverseWraparound=!!e&&e.reverseWraparound,this.originMode=!!e&&e.originMode,this.autoCarriageReturn=!!e&&e.autoCarriageReturn,this.cursorVisible=!!e&&e.cursorVisible,this.cursorBlink=!!e&&e.cursorBlink,this.insertMode=!!e&&e.insertMode,this.reverseVideo=!!e&&e.reverseVideo,this.bracketedPaste=!!e&&e.bracketedPaste},i.rtdep("hterm.Keyboard.KeyActions"),o.Parser=function(){this.source="",this.pos=0,this.ch=null},o.Parser.prototype.error=function(e){return new Error("Parse error at "+this.pos+": "+e)},o.Parser.prototype.isComplete=function(){return this.pos==this.source.length},o.Parser.prototype.reset=function(e,t){this.source=e,this.pos=t||0,this.ch=e.substr(0,1)},o.Parser.prototype.parseKeySequence=function(){var e={keyCode:null};for(var t in o.Parser.identifiers.modifierKeys)e[o.Parser.identifiers.modifierKeys[t]]=!1;for(;this.pos<this.source.length;){this.skipSpace();var r=this.parseToken();if("integer"==r.type)e.keyCode=r.value;else if("identifier"==r.type){var i=r.value.toUpperCase();if(i in o.Parser.identifiers.modifierKeys&&o.Parser.identifiers.modifierKeys.hasOwnProperty(i)){var s=o.Parser.identifiers.modifierKeys[i];if(e[s]&&"*"!=e[s])throw this.error("Duplicate modifier: "+r.value);e[s]=!0}else{if(!(i in o.Parser.identifiers.keyCodes&&o.Parser.identifiers.keyCodes.hasOwnProperty(i)))throw this.error("Unknown key: "+r.value);e.keyCode=o.Parser.identifiers.keyCodes[i]}}else{if("symbol"!=r.type)throw this.error("Expected integer or identifier");if("*"!=r.value)throw this.error("Unexpected symbol: "+r.value);for(var n in o.Parser.identifiers.modifierKeys){var a=o.Parser.identifiers.modifierKeys[n];e[a]||(e[a]="*")}}if(this.skipSpace(),"-"!=this.ch)break;if(null!=e.keyCode)throw this.error("Extra definition after target key");this.advance(1)}if(null==e.keyCode)throw this.error("Missing target key");return e},o.Parser.prototype.parseKeyAction=function(){this.skipSpace();var e=this.parseToken();if("string"==e.type)return e.value;if("identifier"==e.type){if(e.value in o.Parser.identifiers.actions&&o.Parser.identifiers.actions.hasOwnProperty(e.value))return o.Parser.identifiers.actions[e.value];throw this.error("Unknown key action: "+e.value)}throw this.error("Expected string or identifier")},o.Parser.prototype.peekString=function(){return"'"==this.ch||'"'==this.ch},o.Parser.prototype.peekIdentifier=function(){return this.ch.match(/[a-z_]/i)},o.Parser.prototype.peekInteger=function(){return this.ch.match(/[0-9]/)},o.Parser.prototype.parseToken=function(){if("*"==this.ch){var e={type:"symbol",value:this.ch};return this.advance(1),e}if(this.peekIdentifier())return{type:"identifier",value:this.parseIdentifier()};if(this.peekString())return{type:"string",value:this.parseString()};if(this.peekInteger())return{type:"integer",value:this.parseInteger()};throw this.error("Unexpected token")},o.Parser.prototype.parseIdentifier=function(){if(!this.peekIdentifier())throw this.error("Expected identifier");return this.parsePattern(/[a-z0-9_]+/gi)},o.Parser.prototype.parseInteger=function(){return"0"==this.ch&&this.pos<this.source.length-1&&"x"==this.source.substr(this.pos+1,1)?parseInt(this.parsePattern(/0x[0-9a-f]+/gi)):parseInt(this.parsePattern(/\d+/g))},o.Parser.prototype.parseString=function(){var e="",t=this.ch;if('"'!=t&&"'"!=t)throw this.error("String expected");this.advance(1);for(var r=new RegExp("[\\\\"+t+"]","g");this.pos<this.source.length;){if(r.lastIndex=this.pos,!r.exec(this.source))throw this.error("Unterminated string literal");if(e+=this.source.substring(this.pos,r.lastIndex-1),this.advance(r.lastIndex-this.pos-1),'"'!=t||"\\"!=this.ch)if("'"!=t||"\\"!=this.ch){if(this.ch==t)return this.advance(1),e}else e+=this.ch,this.advance(1);else this.advance(1),e+=this.parseEscape()}throw this.error("Unterminated string literal")},o.Parser.prototype.parseEscape=function(){var e={'"':'"',"'":"'","\\":"\\",a:"",b:"\b",e:"",f:"\f",n:"\n",r:"\r",t:"\t",v:"\v",x:function(){var e=this.parsePattern(/[a-z0-9]{2}/gi);return String.fromCharCode(parseInt(e,16))},u:function(){var e=this.parsePattern(/[a-z0-9]{4}/gi);return String.fromCharCode(parseInt(e,16))}};if(!(this.ch in e&&e.hasOwnProperty(this.ch)))throw this.error("Unknown escape: "+this.ch);var t=e[this.ch];return this.advance(1),"function"==typeof t&&(t=t.call(this)),t},o.Parser.prototype.parsePattern=function(e){if(!e.global)throw this.error("Internal error: Span patterns must be global");e.lastIndex=this.pos;var t=e.exec(this.source);if(!t||e.lastIndex-t[0].length!=this.pos)throw this.error("Expected match for: "+e);return this.pos=e.lastIndex-1,this.advance(1),t[0]},o.Parser.prototype.advance=function(e){this.pos+=e,this.ch=this.source.substr(this.pos,1)},o.Parser.prototype.skipSpace=function(e){if(/\s/.test(this.ch)){var t=/\s+/gm;t.lastIndex=this.pos;var r=this.source;if(t.exec(r)&&(this.pos=t.lastIndex),this.ch=this.source.substr(this.pos,1),e&&-1==this.ch.indexOf(e))throw this.error("Expected one of "+e+", found: "+this.ch)}},o.Parser.identifiers={},o.Parser.identifiers.modifierKeys={SHIFT:"shift",CTRL:"ctrl",CONTROL:"ctrl",ALT:"alt",META:"meta"},o.Parser.identifiers.keyCodes={ESCAPE:27,ESC:27,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,ZERO:48,BACKSPACE:8,BKSP:8,BS:8,TAB:9,Q:81,W:87,E:69,R:82,T:84,Y:89,U:85,I:73,O:79,P:80,CAPS_LOCK:20,CAPSLOCK:20,CAPS:20,A:65,S:83,D:68,F:70,G:71,H:72,J:74,K:75,L:76,ENTER:13,ENT:13,RETURN:13,RET:13,Z:90,X:88,C:67,V:86,B:66,N:78,M:77,SPACE:32,SP:32,PRINT_SCREEN:42,PRTSC:42,SCROLL_LOCK:145,SCRLK:145,BREAK:19,BRK:19,INSERT:45,INS:45,HOME:36,PAGE_UP:33,PGUP:33,DELETE:46,DEL:46,END:35,PAGE_DOWN:34,PGDOWN:34,PGDN:34,UP:38,DOWN:40,RIGHT:39,LEFT:37,NUMLOCK:144,KP0:96,KP1:97,KP2:98,KP3:99,KP4:100,KP5:101,KP6:102,KP7:103,KP8:104,KP9:105,KP_PLUS:107,KP_ADD:107,KP_MINUS:109,KP_SUBTRACT:109,KP_STAR:106,KP_MULTIPLY:106,KP_DIVIDE:111,KP_DECIMAL:110,KP_PERIOD:110,NAVIGATE_BACK:166,NAVIGATE_FORWARD:167,RELOAD:168,FULL_SCREEN:183,WINDOW_OVERVIEW:182,BRIGHTNESS_UP:216,BRIGHTNESS_DOWN:217},o.Parser.identifiers.actions={CANCEL:o.Keyboard.KeyActions.CANCEL,DEFAULT:o.Keyboard.KeyActions.DEFAULT,PASS:o.Keyboard.KeyActions.PASS,scrollPageUp:function(e){return e.scrollPageUp(),o.Keyboard.KeyActions.CANCEL},scrollPageDown:function(e){return e.scrollPageDown(),o.Keyboard.KeyActions.CANCEL},scrollToTop:function(e){return e.scrollEnd(),o.Keyboard.KeyActions.CANCEL},scrollToBottom:function(e){return e.scrollEnd(),o.Keyboard.KeyActions.CANCEL},clearScrollback:function(e){return e.wipeContents(),o.Keyboard.KeyActions.CANCEL}},i.rtdep("lib.f","lib.Storage"),o.PreferenceManager=function(e){i.PreferenceManager.call(this,o.defaultStorage,"/hterm/profiles/"+e);var t=o.PreferenceManager.defaultPreferences;Object.keys(t).forEach(function(e){this.definePreference(e,t[e][1])}.bind(this))},o.PreferenceManager.categories={},o.PreferenceManager.categories.Keyboard="Keyboard",o.PreferenceManager.categories.Appearance="Appearance",o.PreferenceManager.categories.CopyPaste="CopyPaste",o.PreferenceManager.categories.Sounds="Sounds",o.PreferenceManager.categories.Scrolling="Scrolling",o.PreferenceManager.categories.Encoding="Encoding",o.PreferenceManager.categories.Miscellaneous="Miscellaneous",o.PreferenceManager.categoryDefinitions=[{id:o.PreferenceManager.categories.Appearance,text:"Appearance (fonts, colors, images)"},{id:o.PreferenceManager.categories.CopyPaste,text:"Copy & Paste"},{id:o.PreferenceManager.categories.Encoding,text:"Encoding"},{id:o.PreferenceManager.categories.Keyboard,text:"Keyboard"},{id:o.PreferenceManager.categories.Scrolling,text:"Scrolling"},{id:o.PreferenceManager.categories.Sounds,text:"Sounds"},{id:o.PreferenceManager.categories.Miscellaneous,text:"Misc."}],o.PreferenceManager.defaultPreferences={"alt-gr-mode":[o.PreferenceManager.categories.Keyboard,null,[null,"none","ctrl-alt","left-alt","right-alt"],"Select an AltGr detection hack^Wheuristic.\n\n'null': Autodetect based on navigator.language:\n      'en-us' => 'none', else => 'right-alt'\n'none': Disable any AltGr related munging.\n'ctrl-alt': Assume Ctrl+Alt means AltGr.\n'left-alt': Assume left Alt means AltGr.\n'right-alt': Assume right Alt means AltGr.\n"],"alt-backspace-is-meta-backspace":[o.PreferenceManager.categories.Keyboard,!1,"bool","If set, undoes the Chrome OS Alt-Backspace->DEL remap, so that alt-backspace indeed is alt-backspace."],"alt-is-meta":[o.PreferenceManager.categories.Keyboard,!1,"bool","Set whether the alt key acts as a meta key or as a distinct alt key."],"alt-sends-what":[o.PreferenceManager.categories.Keyboard,"escape",["escape","8-bit","browser-key"],"Controls how the alt key is handled.\n\n  escape....... Send an ESC prefix.\n  8-bit........ Add 128 to the unshifted character as in xterm.\n  browser-key.. Wait for the keypress event and see what the browser \n                says.  (This won't work well on platforms where the \n                browser performs a default action for some alt sequences.)"],"audible-bell-sound":[o.PreferenceManager.categories.Sounds,"lib-resource:hterm/audio/bell","url","URL of the terminal bell sound.  Empty string for no audible bell."],"desktop-notification-bell":[o.PreferenceManager.categories.Sounds,!1,"bool",'If true, terminal bells in the background will create a Web Notification. https://www.w3.org/TR/notifications/\n\nDisplaying notifications requires permission from the user. When this option is set to true, hterm will attempt to ask the user for permission if necessary. Note browsers may not show this permission request if it did not originate from a user action.\n\nChrome extensions with the "notifications" permission have permission to display notifications.'],"background-color":[o.PreferenceManager.categories.Appearance,"rgb(16, 16, 16)","color","The background color for text with no other color attributes."],"background-image":[o.PreferenceManager.categories.Appearance,"","string","CSS value of the background image.  Empty string for no image.\n\nFor example:\n  url(https://goo.gl/anedTK)\n  linear-gradient(top bottom, blue, red)"],"background-size":[o.PreferenceManager.categories.Appearance,"","string","CSS value of the background image size.  Defaults to none."],"background-position":[o.PreferenceManager.categories.Appearance,"","string","CSS value of the background image position.\n\nFor example:\n  10% 10%\n  center"],"backspace-sends-backspace":[o.PreferenceManager.categories.Keyboard,!1,"bool","If true, the backspace should send BS ('\\x08', aka ^H).  Otherwise the backspace key should send '\\x7f'."],"character-map-overrides":[o.PreferenceManager.categories.Appearance,null,"value",'This is specified as an object. It is a sparse array, where each property is the character set code and the value is an object that is a sparse array itself. In that sparse array, each property is the received character and the value is the displayed character.\n\nFor example:\n  {"0":{"+":"\\u2192",",":"\\u2190","-":"\\u2191",".":"\\u2193", "0":"\\u2588"}}'],"close-on-exit":[o.PreferenceManager.categories.Miscellaneous,!0,"bool","Whether or not to close the window when the command exits."],"cursor-blink":[o.PreferenceManager.categories.Appearance,!1,"bool","Whether or not to blink the cursor by default."],"cursor-blink-cycle":[o.PreferenceManager.categories.Appearance,[1e3,500],"value","The cursor blink rate in milliseconds.\n\nA two element array, the first of which is how long the cursor should be on, second is how long it should be off."],"cursor-color":[o.PreferenceManager.categories.Appearance,"rgba(255, 0, 0, 0.5)","color","The color of the visible cursor."],"color-palette-overrides":[o.PreferenceManager.categories.Appearance,null,"value","Override colors in the default palette.\n\nThis can be specified as an array or an object.  If specified as an object it is assumed to be a sparse array, where each property is a numeric index into the color palette.\n\nValues can be specified as almost any css color value.  This includes #RGB, #RRGGBB, rgb(...), rgba(...), and any color names that are also part of the stock X11 rgb.txt file.\n\nYou can use 'null' to specify that the default value should be not be changed.  This is useful for skipping a small number of indices when the value is specified as an array."],"copy-on-select":[o.PreferenceManager.categories.CopyPaste,!0,"bool","Automatically copy mouse selection to the clipboard."],"use-default-window-copy":[o.PreferenceManager.categories.CopyPaste,!1,"bool","Whether to use the default window copy behavior"],"clear-selection-after-copy":[o.PreferenceManager.categories.CopyPaste,!0,"bool","Whether to clear the selection after copying."],"ctrl-plus-minus-zero-zoom":[o.PreferenceManager.categories.Keyboard,!0,"bool","If true, Ctrl-Plus/Minus/Zero controls zoom.\nIf false, Ctrl-Shift-Plus/Minus/Zero controls zoom, Ctrl-Minus sends ^_, Ctrl-Plus/Zero do nothing."],"ctrl-c-copy":[o.PreferenceManager.categories.Keyboard,!1,"bool","Ctrl+C copies if true, send ^C to host if false.\nCtrl+Shift+C sends ^C to host if true, copies if false."],"ctrl-v-paste":[o.PreferenceManager.categories.Keyboard,!1,"bool","Ctrl+V pastes if true, send ^V to host if false.\nCtrl+Shift+V sends ^V to host if true, pastes if false."],"east-asian-ambiguous-as-two-column":[o.PreferenceManager.categories.Keyboard,!1,"bool","Set whether East Asian Ambiguous characters have two column width."],"enable-8-bit-control":[o.PreferenceManager.categories.Keyboard,!1,"bool","True to enable 8-bit control characters, false to ignore them.\n\nWe'll respect the two-byte versions of these control characters regardless of this setting."],"enable-bold":[o.PreferenceManager.categories.Appearance,null,"tristate","True if we should use bold weight font for text with the bold/bright attribute.  False to use the normal weight font.  Null to autodetect."],"enable-bold-as-bright":[o.PreferenceManager.categories.Appearance,!0,"bool","True if we should use bright colors (8-15 on a 16 color palette) for any text with the bold attribute.  False otherwise."],"enable-blink":[o.PreferenceManager.categories.Appearance,!0,"bool","True if we should respect the blink attribute.  False to ignore it.  "],"enable-clipboard-notice":[o.PreferenceManager.categories.CopyPaste,!0,"bool","Show a message in the terminal when the host writes to the clipboard."],"enable-clipboard-write":[o.PreferenceManager.categories.CopyPaste,!0,"bool","Allow the host to write directly to the system clipboard."],"enable-dec12":[o.PreferenceManager.categories.Miscellaneous,!1,"bool","Respect the host's attempt to change the cursor blink status using DEC Private Mode 12."],environment:[o.PreferenceManager.categories.Miscellaneous,{TERM:"xterm-256color"},"value","The default environment variables, as an object."],"font-family":[o.PreferenceManager.categories.Appearance,'"DejaVu Sans Mono", "Everson Mono", FreeMono, "Menlo", "Terminal", monospace',"string","Default font family for the terminal text."],"font-size":[o.PreferenceManager.categories.Appearance,15,"int","The default font size in pixels."],"font-smoothing":[o.PreferenceManager.categories.Appearance,"antialiased","string","CSS font-smoothing property."],"foreground-color":[o.PreferenceManager.categories.Appearance,"rgb(240, 240, 240)","color","The foreground color for text with no other color attributes."],"home-keys-scroll":[o.PreferenceManager.categories.Keyboard,!1,"bool","If true, home/end will control the terminal scrollbar and shift home/end will send the VT keycodes.  If false then home/end sends VT codes and shift home/end scrolls."],keybindings:[o.PreferenceManager.categories.Keyboard,null,"value",'A map of key sequence to key actions.  Key sequences include zero or more modifier keys followed by a key code.  Key codes can be decimal or hexadecimal numbers, or a key identifier.  Key actions can be specified a string to send to the host, or an action identifier.  For a full explanation of the format, see https://goo.gl/LWRndr.\n\nSample keybindings:\n{\n  "Ctrl-Alt-K": "clearScrollback",\n  "Ctrl-Shift-L": "PASS",\n  "Ctrl-H": "\'HELLO\\n\'"\n}'],"max-string-sequence":[o.PreferenceManager.categories.Encoding,1e5,"int","Max length of a DCS, OSC, PM, or APS sequence before we give up and ignore the code."],"media-keys-are-fkeys":[o.PreferenceManager.categories.Keyboard,!1,"bool","If true, convert media keys to their Fkey equivalent. If false, let the browser handle the keys."],"meta-sends-escape":[o.PreferenceManager.categories.Keyboard,!0,"bool","Set whether the meta key sends a leading escape or not."],"mouse-right-click-paste":[o.PreferenceManager.categories.CopyPaste,!0,"bool",'Paste on right mouse button clicks.\n\nThis option is activate independent of the "mouse-paste-button" setting.\n\nNote: This will handle left & right handed mice correctly.'],"mouse-paste-button":[o.PreferenceManager.categories.CopyPaste,null,[null,0,1,2,3,4,5,6],"Mouse paste button, or null to autodetect.\n\nFor autodetect, we'll use the middle mouse button for non-X11 platforms (including Chrome OS).  On X11, we'll use the right mouse button (since the native window manager should paste via the middle mouse button).\n\n0 == left (primary) button.\n1 == middle (auxiliary) button.\n2 == right (secondary) button.\n\nThis option is activate independent of the \"mouse-right-click-paste\" setting.\n\nNote: This will handle left & right handed mice correctly."],"word-break-match-left":[o.PreferenceManager.categories.CopyPaste,"[^\\s\\[\\](){}<>\"'\\^!@#$%&*,;:`]","string",'Regular expression to halt matching to the left (start) of a selection.\n\nNormally this is a character class to reject specific characters.\nWe allow "~" and "." by default as paths frequently start with those.'],"word-break-match-right":[o.PreferenceManager.categories.CopyPaste,"[^\\s\\[\\](){}<>\"'\\^!@#$%&*,;:~.`]","string","Regular expression to halt matching to the right (end) of a selection.\n\nNormally this is a character class to reject specific characters."],"word-break-match-middle":[o.PreferenceManager.categories.CopyPaste,"[^\\s\\[\\](){}<>\"'\\^]*","string","Regular expression to match all the characters in the middle.\n\nNormally this is a character class to reject specific characters.\n\nUsed to expand the selection surrounding the starting point."],"page-keys-scroll":[o.PreferenceManager.categories.Keyboard,!1,"bool","If true, page up/down will control the terminal scrollbar and shift page up/down will send the VT keycodes.  If false then page up/down sends VT codes and shift page up/down scrolls."],"pass-alt-number":[o.PreferenceManager.categories.Keyboard,null,"tristate","Set whether we should pass Alt-1..9 to the browser.\n\nThis is handy when running hterm in a browser tab, so that you don't lose Chrome's \"switch to tab\" keyboard accelerators.  When not running in a tab it's better to send these keys to the host so they can be used in vim or emacs.\n\nIf true, Alt-1..9 will be handled by the browser.  If false, Alt-1..9 will be sent to the host.  If null, autodetect based on browser platform and window type."],"pass-ctrl-number":[o.PreferenceManager.categories.Keyboard,null,"tristate","Set whether we should pass Ctrl-1..9 to the browser.\n\nThis is handy when running hterm in a browser tab, so that you don't lose Chrome's \"switch to tab\" keyboard accelerators.  When not running in a tab it's better to send these keys to the host so they can be used in vim or emacs.\n\nIf true, Ctrl-1..9 will be handled by the browser.  If false, Ctrl-1..9 will be sent to the host.  If null, autodetect based on browser platform and window type."],"pass-meta-number":[o.PreferenceManager.categories.Keyboard,null,"tristate","Set whether we should pass Meta-1..9 to the browser.\n\nThis is handy when running hterm in a browser tab, so that you don't lose Chrome's \"switch to tab\" keyboard accelerators.  When not running in a tab it's better to send these keys to the host so they can be used in vim or emacs.\n\nIf true, Meta-1..9 will be handled by the browser.  If false, Meta-1..9 will be sent to the host.  If null, autodetect based on browser platform and window type."],"pass-meta-v":[o.PreferenceManager.categories.Keyboard,!0,"bool","Set whether meta-V gets passed to host."],"receive-encoding":[o.PreferenceManager.categories.Encoding,"utf-8",["utf-8","raw"],"Set the expected encoding for data received from the host.\n\nValid values are 'utf-8' and 'raw'."],"scroll-on-keystroke":[o.PreferenceManager.categories.Scrolling,!0,"bool","If true, scroll to the bottom on any keystroke."],"scroll-on-output":[o.PreferenceManager.categories.Scrolling,!1,"bool","If true, scroll to the bottom on terminal output."],"scrollbar-visible":[o.PreferenceManager.categories.Scrolling,!0,"bool","The vertical scrollbar mode."],"scroll-wheel-may-send-arrow-keys":[o.PreferenceManager.categories.Scrolling,!1,"bool","When using the alternative screen buffer, and DECCKM (Application Cursor Keys) is active, mouse wheel scroll events will emulate arrow keys.\n\nIt can be temporarily disabled by holding the shift key.\n\nThis frequently comes up when using pagers (less) or reading man pages or text editors (vi/nano) or using screen/tmux."],"scroll-wheel-move-multiplier":[o.PreferenceManager.categories.Scrolling,1,"int","The multiplier for the pixel delta in wheel events caused by the scroll wheel. Alters how fast the page scrolls."],"send-encoding":[o.PreferenceManager.categories.Encoding,"utf-8",["utf-8","raw"],"Set the encoding for data sent to host."],"terminal-encoding":[o.PreferenceManager.categories.Encoding,"iso-2022",["iso-2022","utf-8","utf-8-locked"],"The default terminal encoding (DOCS).\n\nISO-2022 enables character map translations (like graphics maps).\nUTF-8 disables support for those.\n\nThe locked variant means the encoding cannot be changed at runtime via terminal escape sequences.\n\nYou should stick with UTF-8 unless you notice broken rendering with legacy applications."],"shift-insert-paste":[o.PreferenceManager.categories.Keyboard,!0,"bool","Shift + Insert pastes if true, sent to host if false."],"user-css":[o.PreferenceManager.categories.Appearance,"","url","URL of user stylesheet to include in the terminal document."],"user-css-text":[o.PreferenceManager.categories.Appearance,"","multiline-string","Custom CSS text for styling the terminal."]},o.PreferenceManager.prototype=Object.create(i.PreferenceManager.prototype),o.PreferenceManager.constructor=o.PreferenceManager,o.PubSub=function(){this.observers_={}},o.PubSub.addBehavior=function(e){var t=new o.PubSub;for(var r in o.PubSub.prototype)e[r]=o.PubSub.prototype[r].bind(t)},o.PubSub.prototype.subscribe=function(e,t){e in this.observers_||(this.observers_[e]=[]),this.observers_[e].push(t)},o.PubSub.prototype.unsubscribe=function(e,t){var r=this.observers_[e];if(!r)throw"Invalid subject: "+e;var i=r.indexOf(t);if(i<0)throw"Not subscribed: "+e;r.splice(i,1)},o.PubSub.prototype.publish=function(e,t,r){function i(e){e<o.length-1&&setTimeout(i,0,e+1),o[e](t)}var o=this.observers_[e];o&&(o=[].concat(o)),r&&(o?o.push(r):o=[r]),o&&setTimeout(i,0,0)},i.rtdep("lib.f","lib.wc","hterm.RowCol","hterm.Size","hterm.TextAttributes"),o.Screen=function(e){this.rowsArray=[],this.columnCount_=e||80,this.textAttributes=new o.TextAttributes(window.document),this.cursorPosition=new o.RowCol(0,0),this.cursorRowNode_=null,this.cursorNode_=null,this.cursorOffset_=null,this.wordBreakMatchLeft=null,this.wordBreakMatchRight=null,this.wordBreakMatchMiddle=null},o.Screen.prototype.getSize=function(){return new o.Size(this.columnCount_,this.rowsArray.length)},o.Screen.prototype.getHeight=function(){return this.rowsArray.length},o.Screen.prototype.getWidth=function(){return this.columnCount_},o.Screen.prototype.setColumnCount=function(e){this.columnCount_=e,this.cursorPosition.column>=e&&this.setCursorPosition(this.cursorPosition.row,e-1)},o.Screen.prototype.shiftRow=function(){return this.shiftRows(1)[0]},o.Screen.prototype.shiftRows=function(e){return this.rowsArray.splice(0,e)},o.Screen.prototype.unshiftRow=function(e){this.rowsArray.splice(0,0,e)},o.Screen.prototype.unshiftRows=function(e){this.rowsArray.unshift.apply(this.rowsArray,e)},o.Screen.prototype.popRow=function(){return this.popRows(1)[0]},o.Screen.prototype.popRows=function(e){return this.rowsArray.splice(this.rowsArray.length-e,e)},o.Screen.prototype.pushRow=function(e){this.rowsArray.push(e)},o.Screen.prototype.pushRows=function(e){e.push.apply(this.rowsArray,e)},o.Screen.prototype.insertRow=function(e,t){this.rowsArray.splice(e,0,t)},o.Screen.prototype.insertRows=function(e,t){for(var r=0;r<t.length;r++)this.rowsArray.splice(e+r,0,t[r])},o.Screen.prototype.removeRow=function(e){return this.rowsArray.splice(e,1)[0]},o.Screen.prototype.removeRows=function(e,t){return this.rowsArray.splice(e,t)},o.Screen.prototype.invalidateCursorPosition=function(){this.cursorPosition.move(0,0),this.cursorRowNode_=null,this.cursorNode_=null,this.cursorOffset_=null},o.Screen.prototype.clearCursorRow=function(){this.cursorRowNode_.innerHTML="",this.cursorRowNode_.removeAttribute("line-overflow"),this.cursorOffset_=0,this.cursorPosition.column=0,this.cursorPosition.overflow=!1;var e;e=this.textAttributes.isDefault()?"":i.f.getWhitespace(this.columnCount_);var t=this.textAttributes.inverse;this.textAttributes.inverse=!1,this.textAttributes.syncColors();var r=this.textAttributes.createContainer(e);this.cursorRowNode_.appendChild(r),this.cursorNode_=r,this.textAttributes.inverse=t,this.textAttributes.syncColors()},o.Screen.prototype.commitLineOverflow=function(){this.cursorRowNode_.setAttribute("line-overflow",!0)},o.Screen.prototype.setCursorPosition=function(e,t){if(this.rowsArray.length){e>=this.rowsArray.length?(console.error("Row out of bounds: "+e),e=this.rowsArray.length-1):e<0&&(console.error("Row out of bounds: "+e),e=0),t>=this.columnCount_?(console.error("Column out of bounds: "+t),t=this.columnCount_-1):t<0&&(console.error("Column out of bounds: "+t),t=0),this.cursorPosition.overflow=!1;var r=this.rowsArray[e],i=r.firstChild;i||(i=r.ownerDocument.createTextNode(""),r.appendChild(i));var s=0;for(r==this.cursorRowNode_?t>=this.cursorPosition.column-this.cursorOffset_&&(i=this.cursorNode_,s=this.cursorPosition.column-this.cursorOffset_):this.cursorRowNode_=r,this.cursorPosition.move(e,t);i;){var n=t-s,a=o.TextAttributes.nodeWidth(i);if(!i.nextSibling||a>n)return this.cursorNode_=i,void(this.cursorOffset_=n);s+=a,i=i.nextSibling}}else console.warn("Attempt to set cursor position on empty screen.")},o.Screen.prototype.syncSelectionCaret=function(e){try{e.collapse(this.cursorNode_,this.cursorOffset_)}catch(e){}},o.Screen.prototype.splitNode_=function(e,t){var r=e.cloneNode(!1),s=e.textContent;e.textContent=o.TextAttributes.nodeSubstr(e,0,t),r.textContent=i.wc.substr(s,t),r.textContent&&e.parentNode.insertBefore(r,e.nextSibling),e.textContent||e.parentNode.removeChild(e)},o.Screen.prototype.maybeClipCurrentRow=function(){var e=o.TextAttributes.nodeWidth(this.cursorRowNode_);if(e<=this.columnCount_)this.cursorPosition.column>=this.columnCount_&&(this.setCursorPosition(this.cursorPosition.row,this.columnCount_-1),this.cursorPosition.overflow=!0);else{var t=this.cursorPosition.column;this.setCursorPosition(this.cursorPosition.row,this.columnCount_-1),e=o.TextAttributes.nodeWidth(this.cursorNode_),this.cursorOffset_<e-1&&(this.cursorNode_.textContent=o.TextAttributes.nodeSubstr(this.cursorNode_,0,this.cursorOffset_+1));for(var r=this.cursorRowNode_,i=this.cursorNode_.nextSibling;i;)r.removeChild(i),i=this.cursorNode_.nextSibling;t<this.columnCount_?this.setCursorPosition(this.cursorPosition.row,t):this.cursorPosition.overflow=!0}},o.Screen.prototype.insertString=function(e){var t=this.cursorNode_,r=t.textContent;this.cursorRowNode_.removeAttribute("line-overflow");var s=i.wc.strWidth(e);this.cursorPosition.column+=s;var n=this.cursorOffset_,a=o.TextAttributes.nodeWidth(t)-n;if(a<0){var l=i.f.getWhitespace(-a);if(this.textAttributes.underline||this.textAttributes.strikethrough||this.textAttributes.background||this.textAttributes.wcNode||!this.textAttributes.asciiNode||null!=this.textAttributes.tileData)if(3!=t.nodeType&&(t.wcNode||!t.asciiNode||t.tileNode||t.style.textDecoration||t.style.backgroundColor)){var h=t.ownerDocument.createTextNode(l);this.cursorRowNode_.insertBefore(h,t.nextSibling),this.cursorNode_=t=h,this.cursorOffset_=n=-a,r=l}else t.textContent=r+=l;else e=l+e;a=0}if(this.textAttributes.matchesContainer(t))return t.textContent=0==a?r+e:0==n?e+r:o.TextAttributes.nodeSubstr(t,0,n)+e+o.TextAttributes.nodeSubstr(t,n),void(this.cursorOffset_+=s);if(0==n){var c=t.previousSibling;if(c&&this.textAttributes.matchesContainer(c))return c.textContent+=e,this.cursorNode_=c,void(this.cursorOffset_=i.wc.strWidth(c.textContent));d=this.textAttributes.createContainer(e);return this.cursorRowNode_.insertBefore(d,t),this.cursorNode_=d,void(this.cursorOffset_=s)}if(0==a){var u=t.nextSibling;if(u&&this.textAttributes.matchesContainer(u))return u.textContent=e+u.textContent,this.cursorNode_=u,void(this.cursorOffset_=i.wc.strWidth(e));d=this.textAttributes.createContainer(e);return this.cursorRowNode_.insertBefore(d,u),this.cursorNode_=d,void(this.cursorOffset_=o.TextAttributes.nodeWidth(d))}this.splitNode_(t,n);var d=this.textAttributes.createContainer(e);this.cursorRowNode_.insertBefore(d,t.nextSibling),this.cursorNode_=d,this.cursorOffset_=s},o.Screen.prototype.overwriteString=function(e){var t=this.columnCount_-this.cursorPosition.column;if(!t)return[e];var r=i.wc.strWidth(e);if(this.textAttributes.matchesContainer(this.cursorNode_)&&this.cursorNode_.textContent.substr(this.cursorOffset_)==e)return this.cursorOffset_+=r,void(this.cursorPosition.column+=r);this.deleteChars(Math.min(r,t)),this.insertString(e)},o.Screen.prototype.deleteChars=function(e){var t=this.cursorNode_,r=this.cursorOffset_,i=this.cursorPosition.column;if(!(e=Math.min(e,this.columnCount_-i)))return 0;for(var s,n,a=e;t&&e;){if(s=o.TextAttributes.nodeWidth(t),t.textContent=o.TextAttributes.nodeSubstr(t,0,r)+o.TextAttributes.nodeSubstr(t,r+e),n=o.TextAttributes.nodeWidth(t),e-=s-n,r<s&&n&&s==n){var l=this.textAttributes.createContainer(" ");t.parentNode.insertBefore(l,t.nextSibling),t.textContent="",n=0,e-=1}var h=t.nextSibling;0==n&&t!=this.cursorNode_&&t.parentNode.removeChild(t),t=h,r=0}if(3!=this.cursorNode_.nodeType&&!this.cursorNode_.textContent){var c=this.cursorNode_;if(c.previousSibling)this.cursorNode_=c.previousSibling,this.cursorOffset_=o.TextAttributes.nodeWidth(c.previousSibling);else if(c.nextSibling)this.cursorNode_=c.nextSibling,this.cursorOffset_=0;else{var u=this.cursorRowNode_.ownerDocument.createTextNode("");this.cursorRowNode_.appendChild(u),this.cursorNode_=u,this.cursorOffset_=0}this.cursorRowNode_.removeChild(c)}return a},o.Screen.prototype.getLineStartRow_=function(e){for(;e.previousSibling&&e.previousSibling.hasAttribute("line-overflow");)e=e.previousSibling;return e},o.Screen.prototype.getLineText_=function(e){for(var t="";e&&(t+=e.textContent,e.hasAttribute("line-overflow"));)e=e.nextSibling;return t},o.Screen.prototype.getXRowAncestor_=function(e){for(;e&&"X-ROW"!==e.nodeName;)e=e.parentNode;return e},o.Screen.prototype.getPositionWithOverflow_=function(e,t,r){if(!t)return-1;var i=this.getXRowAncestor_(t);if(!i)return-1;for(var s=0;i!=e;){if(s+=o.TextAttributes.nodeWidth(e),!e.hasAttribute("line-overflow")||!e.nextSibling)return-1;e=e.nextSibling}return s+this.getPositionWithinRow_(e,t,r)},o.Screen.prototype.getPositionWithinRow_=function(e,t,r){if(t.parentNode!=e)return null==t.parentNode?-1:this.getPositionWithinRow_(t.parentNode,t,r)+this.getPositionWithinRow_(e,t.parentNode,0);for(var i=0,s=0;s<e.childNodes.length;s++){var n=e.childNodes[s];if(n==t)return i+r;i+=o.TextAttributes.nodeWidth(n)}return-1},o.Screen.prototype.getNodeAndOffsetWithOverflow_=function(e,t){for(;e&&t>o.TextAttributes.nodeWidth(e);){if(!e.hasAttribute("line-overflow")||!e.nextSibling)return-1;t-=o.TextAttributes.nodeWidth(e),e=e.nextSibling}return this.getNodeAndOffsetWithinRow_(e,t)},o.Screen.prototype.getNodeAndOffsetWithinRow_=function(e,t){for(var r=0;r<e.childNodes.length;r++){var i=e.childNodes[r],s=o.TextAttributes.nodeWidth(i);if(t<=s)return"SPAN"===i.nodeName?this.getNodeAndOffsetWithinRow_(i,t):[i,t];t-=s}return null},o.Screen.prototype.setRange_=function(e,t,r,i){var o=this.getNodeAndOffsetWithOverflow_(e,t);if(null!=o){var s=this.getNodeAndOffsetWithOverflow_(e,r);null!=s&&(i.setStart(o[0],o[1]),i.setEnd(s[0],s[1]))}},o.Screen.prototype.expandSelection=function(e){if(e){var t=e.getRangeAt(0);if(t&&!t.toString().match(/\s/)){var r=this.getLineStartRow_(this.getXRowAncestor_(t.startContainer));if(r){var o=this.getPositionWithOverflow_(r,t.startContainer,t.startOffset);if(-1!=o){var s=this.getPositionWithOverflow_(r,t.endContainer,t.endOffset);if(-1!=s){var n=this.wordBreakMatchLeft,a=this.wordBreakMatchRight,l=this.wordBreakMatchMiddle,h=this.getLineText_(r),c=i.wc.substring(h,0,s),u=new RegExp(n+l+"$"),d=c.search(u);if(!(-1==d||d>o)){var p=i.wc.substring(h,o,i.wc.strWidth(h)),f=new RegExp("^"+l+a),g=p.match(f);if(g){var m=o+i.wc.strWidth(g[0]);-1==m||m<s||(this.setRange_(r,d,m,t),e.addRange(t))}}}}}}}},i.rtdep("lib.f","hterm.PubSub","hterm.Size"),o.ScrollPort=function(e){o.PubSub.addBehavior(this),this.rowProvider_=e,this.characterSize=new o.Size(10,10),this.ruler_=null,this.selection=new o.ScrollPort.Selection(this),this.currentRowNodeCache_=null,this.previousRowNodeCache_={},this.lastScreenWidth_=null,this.lastScreenHeight_=null,this.selectionEnabled_=!0,this.lastRowCount_=0,this.scrollWheelMultiplier_=1,this.lastTouch_={},this.isScrolledEnd=!0,this.currentScrollbarWidthPx=16,this.ctrlVPaste=!1,this.div_=null,this.document_=null,this.timeouts_={},this.observers_={},this.DEBUG_=!1},o.ScrollPort.Selection=function(e){this.scrollPort_=e,this.startRow=null,this.endRow=null,this.isMultiline=null,this.isCollapsed=null},o.ScrollPort.Selection.prototype.findFirstChild=function(e,t){for(var r=e.firstChild;r;){if(-1!=t.indexOf(r))return r;if(r.childNodes.length){var i=this.findFirstChild(r,t);if(i)return i}r=r.nextSibling}return null},o.ScrollPort.Selection.prototype.sync=function(){function e(){r.startRow=o,r.startNode=i.anchorNode,r.startOffset=i.anchorOffset,r.endRow=s,r.endNode=i.focusNode,r.endOffset=i.focusOffset}function t(){r.startRow=s,r.startNode=i.focusNode,r.startOffset=i.focusOffset,r.endRow=o,r.endNode=i.anchorNode,r.endOffset=i.anchorOffset}var r=this,i=this.scrollPort_.getDocument().getSelection();if(this.startRow=null,this.endRow=null,this.isMultiline=null,this.isCollapsed=!i||i.isCollapsed,!this.isCollapsed){for(var o=i.anchorNode;o&&!("rowIndex"in o);)o=o.parentNode;if(o){for(var s=i.focusNode;s&&!("rowIndex"in s);)s=s.parentNode;if(s){if(o.rowIndex<s.rowIndex)e();else if(o.rowIndex>s.rowIndex)t();else if(i.focusNode==i.anchorNode)i.anchorOffset<i.focusOffset?e():t();else{var n=this.findFirstChild(o,[i.anchorNode,i.focusNode]);if(!n)throw new Error("Unexpected error syncing selection.");n==i.anchorNode?e():t()}this.isMultiline=o.rowIndex!=s.rowIndex}else console.error("Selection focus is not rooted in a row node: "+i.focusNode.nodeName)}else console.error("Selection anchor is not rooted in a row node: "+i.anchorNode.nodeName)}},o.ScrollPort.prototype.decorate=function(e){this.div_=e,this.iframe_=e.ownerDocument.createElement("iframe"),this.iframe_.style.cssText="border: 0;height: 100%;position: absolute;width: 100%","mozInnerScreenX"in window&&(this.iframe_.src="#"),e.appendChild(this.iframe_),this.iframe_.contentWindow.addEventListener("resize",this.onResize_.bind(this));var t=this.document_=this.iframe_.contentDocument;t.body.style.cssText="margin: 0px;padding: 0px;height: 100%;width: 100%;overflow: hidden;cursor: var(--hterm-mouse-cursor-style);-webkit-user-select: none;-moz-user-select: none;",this.DEBUG_&&(this.document_.body.style.paddingTop=this.document_.body.style.paddingBottom="calc(var(--hterm-charsize-height) * 3)");var r=t.createElement("style");r.textContent="x-row {  display: block;  height: var(--hterm-charsize-height);  line-height: var(--hterm-charsize-height);}",t.head.appendChild(r),this.userCssLink_=t.createElement("link"),this.userCssLink_.setAttribute("rel","stylesheet"),this.userCssText_=t.createElement("style"),t.head.appendChild(this.userCssText_),this.screen_=t.createElement("x-screen"),this.screen_.setAttribute("contenteditable","true"),this.screen_.setAttribute("spellcheck","false"),this.screen_.setAttribute("autocomplete","off"),this.screen_.setAttribute("autocorrect","off"),this.screen_.setAttribute("autocaptalize","none"),this.screen_.setAttribute("role","textbox"),this.screen_.setAttribute("tabindex","-1"),this.screen_.style.cssText="caret-color: transparent;display: block;font-family: monospace;font-size: 15px;font-variant-ligatures: none;height: 100%;overflow-y: scroll; overflow-x: hidden;white-space: pre;width: 100%;outline: none !important",t.body.appendChild(this.screen_),this.screen_.addEventListener("scroll",this.onScroll_.bind(this)),this.screen_.addEventListener("wheel",this.onScrollWheel_.bind(this)),this.screen_.addEventListener("touchstart",this.onTouch_.bind(this)),this.screen_.addEventListener("touchmove",this.onTouch_.bind(this)),this.screen_.addEventListener("touchend",this.onTouch_.bind(this)),this.screen_.addEventListener("touchcancel",this.onTouch_.bind(this)),this.screen_.addEventListener("copy",this.onCopy_.bind(this)),this.screen_.addEventListener("paste",this.onPaste_.bind(this)),this.screen_.addEventListener("drop",function(e){return e.preventDefault(),!1}),t.body.addEventListener("keydown",this.onBodyKeyDown_.bind(this)),this.rowNodes_=t.createElement("div"),this.rowNodes_.id="hterm:row-nodes",this.rowNodes_.style.cssText="display: block;position: fixed;overflow: hidden;-webkit-user-select: text;-moz-user-select: text;",this.screen_.appendChild(this.rowNodes_),this.topSelectBag_=t.createElement("x-select-bag"),this.topSelectBag_.style.cssText="display: block;overflow: hidden;height: var(--hterm-charsize-height);white-space: pre;",this.bottomSelectBag_=this.topSelectBag_.cloneNode(),this.topFold_=t.createElement("x-fold"),this.topFold_.id="hterm:top-fold-for-row-selection",this.topFold_.style.cssText="display: block;",this.rowNodes_.appendChild(this.topFold_),this.bottomFold_=this.topFold_.cloneNode(),this.bottomFold_.id="hterm:bottom-fold-for-row-selection",this.rowNodes_.appendChild(this.bottomFold_),this.scrollArea_=t.createElement("div"),this.scrollArea_.id="hterm:scrollarea",this.scrollArea_.style.cssText="visibility: hidden",this.screen_.appendChild(this.scrollArea_);var i="http://www.w3.org/2000/svg";this.svg_=this.div_.ownerDocument.createElementNS(i,"svg"),this.svg_.id="hterm:zoom-detector",this.svg_.setAttribute("xmlns",i),this.svg_.setAttribute("version","1.1"),this.svg_.style.cssText="position: absolute;top: 0;left: 0;visibility: hidden",this.pasteTarget_=t.createElement("textarea"),this.pasteTarget_.id="hterm:ctrl-v-paste-target",this.pasteTarget_.setAttribute("tabindex","-1"),this.pasteTarget_.style.cssText="position: absolute;height: 1px;width: 1px;left: 0px; bottom: 0px;opacity: 0",this.pasteTarget_.contentEditable=!0,this.screen_.appendChild(this.pasteTarget_),this.pasteTarget_.addEventListener("textInput",this.handlePasteTargetTextInput_.bind(this)),this.resize()},o.ScrollPort.prototype.setFontFamily=function(e,t){this.screen_.style.fontFamily=e,this.screen_.style.webkitFontSmoothing=t||"",this.syncCharacterSize()},o.ScrollPort.prototype.getFontFamily=function(){return this.screen_.style.fontFamily},o.ScrollPort.prototype.setUserCssUrl=function(e){e?(this.userCssLink_.setAttribute("href",e),this.userCssLink_.parentNode||this.document_.head.appendChild(this.userCssLink_)):this.userCssLink_.parentNode&&this.document_.head.removeChild(this.userCssLink_)},o.ScrollPort.prototype.setUserCssText=function(e){this.userCssText_.textContent=e},o.ScrollPort.prototype.focus=function(){this.iframe_.focus(),this.screen_.focus()},o.ScrollPort.prototype.getForegroundColor=function(){return this.screen_.style.color},o.ScrollPort.prototype.setForegroundColor=function(e){this.screen_.style.color=e},o.ScrollPort.prototype.getBackgroundColor=function(){return this.screen_.style.backgroundColor},o.ScrollPort.prototype.setBackgroundColor=function(e){this.screen_.style.backgroundColor=e},o.ScrollPort.prototype.setBackgroundImage=function(e){this.screen_.style.backgroundImage=e},o.ScrollPort.prototype.setBackgroundSize=function(e){this.screen_.style.backgroundSize=e},o.ScrollPort.prototype.setBackgroundPosition=function(e){this.screen_.style.backgroundPosition=e},o.ScrollPort.prototype.setCtrlVPaste=function(e){this.ctrlVPaste=e},o.ScrollPort.prototype.getScreenSize=function(){var e=o.getClientSize(this.screen_);return{height:e.height,width:e.width-this.currentScrollbarWidthPx}},o.ScrollPort.prototype.getScreenWidth=function(){return this.getScreenSize().width},o.ScrollPort.prototype.getScreenHeight=function(){return this.getScreenSize().height},o.ScrollPort.prototype.getDocument=function(){return this.document_},o.ScrollPort.prototype.getScreenNode=function(){return this.screen_},o.ScrollPort.prototype.resetCache=function(){this.currentRowNodeCache_=null,this.previousRowNodeCache_={}},o.ScrollPort.prototype.setRowProvider=function(e){this.resetCache(),this.rowProvider_=e,this.scheduleRedraw()},o.ScrollPort.prototype.invalidate=function(){for(var e=this.topFold_.nextSibling;e!=this.bottomFold_;){var t=e.nextSibling;e.parentElement.removeChild(e),e=t}this.previousRowNodeCache_=null;var r=this.getTopRowIndex(),i=this.getBottomRowIndex(r);this.drawVisibleRows_(r,i)},o.ScrollPort.prototype.scheduleInvalidate=function(){if(!this.timeouts_.invalidate){var e=this;this.timeouts_.invalidate=setTimeout(function(){delete e.timeouts_.invalidate,e.invalidate()},0)}},o.ScrollPort.prototype.setFontSize=function(e){this.screen_.style.fontSize=e+"px",this.syncCharacterSize()},o.ScrollPort.prototype.getFontSize=function(){return parseInt(this.screen_.style.fontSize)},o.ScrollPort.prototype.measureCharacterSize=function(e){this.ruler_||(this.ruler_=this.document_.createElement("div"),this.ruler_.id="hterm:ruler-character-size",this.ruler_.style.cssText="position: absolute;top: 0;left: 0;visibility: hidden;height: auto !important;width: auto !important;",this.rulerSpan_=this.document_.createElement("span"),this.rulerSpan_.id="hterm:ruler-span-workaround",this.rulerSpan_.innerHTML=("X".repeat(100)+"\r").repeat(100),this.ruler_.appendChild(this.rulerSpan_),this.rulerBaseline_=this.document_.createElement("span"),this.rulerSpan_.id="hterm:ruler-baseline",this.rulerBaseline_.style.fontSize="0px",this.rulerBaseline_.textContent="X"),this.rulerSpan_.style.fontWeight=e||"",this.rowNodes_.appendChild(this.ruler_);var t=o.getClientSize(this.rulerSpan_),r=new o.Size(t.width/100,t.height/100);return this.ruler_.appendChild(this.rulerBaseline_),r.baseline=this.rulerBaseline_.offsetTop,this.ruler_.removeChild(this.rulerBaseline_),this.rowNodes_.removeChild(this.ruler_),this.div_.ownerDocument.body.appendChild(this.svg_),r.zoomFactor=this.svg_.currentScale,this.div_.ownerDocument.body.removeChild(this.svg_),r},o.ScrollPort.prototype.syncCharacterSize=function(){this.characterSize=this.measureCharacterSize(),this.resize()},o.ScrollPort.prototype.resize=function(){this.currentScrollbarWidthPx=o.getClientWidth(this.screen_)-this.screen_.clientWidth,this.syncScrollHeight(),this.syncRowNodesDimensions_();var e=this;this.publish("resize",{scrollPort:this},function(){e.scrollRowToBottom(e.rowProvider_.getRowCount()),e.scheduleRedraw()})},o.ScrollPort.prototype.syncRowNodesDimensions_=function(){var e=this.getScreenSize();this.lastScreenWidth_=e.width,this.lastScreenHeight_=e.height,this.visibleRowCount=i.f.smartFloorDivide(e.height,this.characterSize.height);var t=this.visibleRowCount*this.characterSize.height;this.visibleRowTopMargin=0,this.visibleRowBottomMargin=e.height-t,this.topFold_.style.marginBottom=this.visibleRowTopMargin+"px";for(var r=0,s=this.topFold_.previousSibling;s;)r+=o.getClientHeight(s),s=s.previousSibling;this.rowNodes_.style.width=e.width+"px",this.rowNodes_.style.height=t+r+"px",this.rowNodes_.style.left=this.screen_.offsetLeft+"px",this.rowNodes_.style.top=this.screen_.offsetTop-r+"px"},o.ScrollPort.prototype.syncScrollHeight=function(){this.lastRowCount_=this.rowProvider_.getRowCount(),this.scrollArea_.style.height=this.characterSize.height*this.lastRowCount_+this.visibleRowTopMargin+this.visibleRowBottomMargin+"px"},o.ScrollPort.prototype.scheduleRedraw=function(){if(!this.timeouts_.redraw){var e=this;this.timeouts_.redraw=setTimeout(function(){delete e.timeouts_.redraw,e.redraw_()},0)}},o.ScrollPort.prototype.redraw_=function(){this.resetSelectBags_(),this.selection.sync(),this.syncScrollHeight(),this.currentRowNodeCache_={};var e=this.getTopRowIndex(),t=this.getBottomRowIndex(e);this.drawTopFold_(e),this.drawBottomFold_(t),this.drawVisibleRows_(e,t),this.syncRowNodesDimensions_(),this.previousRowNodeCache_=this.currentRowNodeCache_,this.currentRowNodeCache_=null,this.isScrolledEnd=this.getTopRowIndex()+this.visibleRowCount>=this.lastRowCount_},o.ScrollPort.prototype.drawTopFold_=function(e){if(!this.selection.startRow||this.selection.startRow.rowIndex>=e)this.rowNodes_.firstChild!=this.topFold_&&this.rowNodes_.insertBefore(this.topFold_,this.rowNodes_.firstChild);else{if(!this.selection.isMultiline||this.selection.endRow.rowIndex>=e)this.selection.startRow.nextSibling!=this.topFold_&&this.rowNodes_.insertBefore(this.topFold_,this.selection.startRow.nextSibling);else for(this.selection.endRow.nextSibling!=this.topFold_&&this.rowNodes_.insertBefore(this.topFold_,this.selection.endRow.nextSibling);this.selection.startRow.nextSibling!=this.selection.endRow;)this.rowNodes_.removeChild(this.selection.startRow.nextSibling);for(;this.rowNodes_.firstChild!=this.selection.startRow;)this.rowNodes_.removeChild(this.rowNodes_.firstChild)}},o.ScrollPort.prototype.drawBottomFold_=function(e){if(!this.selection.endRow||this.selection.endRow.rowIndex<=e)this.rowNodes_.lastChild!=this.bottomFold_&&this.rowNodes_.appendChild(this.bottomFold_);else{if(!this.selection.isMultiline||this.selection.startRow.rowIndex<=e)this.bottomFold_.nextSibling!=this.selection.endRow&&this.rowNodes_.insertBefore(this.bottomFold_,this.selection.endRow);else for(this.bottomFold_.nextSibling!=this.selection.startRow&&this.rowNodes_.insertBefore(this.bottomFold_,this.selection.startRow);this.selection.startRow.nextSibling!=this.selection.endRow;)this.rowNodes_.removeChild(this.selection.startRow.nextSibling);for(;this.rowNodes_.lastChild!=this.selection.endRow;)this.rowNodes_.removeChild(this.rowNodes_.lastChild)}},o.ScrollPort.prototype.drawVisibleRows_=function(e,t){function r(e,t){for(;e!=t;){if(!e)throw"Did not encounter target node";if(e==i.bottomFold_)throw"Encountered bottom fold before target node";var r=e;e=e.nextSibling,r.parentNode.removeChild(r)}}for(var i=this,o=this.selection.startRow,s=this.selection.endRow,n=this.bottomFold_,a=this.topFold_.nextSibling,l=Math.min(this.visibleRowCount,this.rowProvider_.getRowCount()),h=0;h<l;h++){var c=e+h;if(a!=n)if(a.rowIndex!=c)if(o&&o.rowIndex==c)r(a,o),a=o.nextSibling;else if(s&&s.rowIndex==c)r(a,s),a=s.nextSibling;else if(a!=o&&a!=s){var u=this.fetchRowNode_(c);if(!u){console.log("Couldn't fetch row index: "+c);break}a!=u?(this.rowNodes_.insertBefore(u,a),u.nextSibling,this.rowNodes_.removeChild(a),a=u.nextSibling):a=a.nextSibling}else{if(!(u=this.fetchRowNode_(c))){console.log("Couldn't fetch row index: "+c);break}this.rowNodes_.insertBefore(u,a)}else a=a.nextSibling;else{if(!(u=this.fetchRowNode_(c))){console.log("Couldn't fetch row index: "+c);break}this.rowNodes_.insertBefore(u,a)}}a!=this.bottomFold_&&r(a,n)},o.ScrollPort.prototype.resetSelectBags_=function(){this.topSelectBag_.parentNode&&(this.topSelectBag_.textContent="",this.topSelectBag_.parentNode.removeChild(this.topSelectBag_)),this.bottomSelectBag_.parentNode&&(this.bottomSelectBag_.textContent="",this.bottomSelectBag_.parentNode.removeChild(this.bottomSelectBag_))},o.ScrollPort.prototype.cacheRowNode_=function(e){this.currentRowNodeCache_[e.rowIndex]=e},o.ScrollPort.prototype.fetchRowNode_=function(e){var t;return t=this.previousRowNodeCache_&&e in this.previousRowNodeCache_?this.previousRowNodeCache_[e]:this.rowProvider_.getRowNode(e),this.currentRowNodeCache_&&this.cacheRowNode_(t),t},o.ScrollPort.prototype.selectAll=function(){var e;if(0!=this.topFold_.nextSibling.rowIndex){for(;this.topFold_.previousSibling;)this.rowNodes_.removeChild(this.topFold_.previousSibling);e=this.fetchRowNode_(0),this.rowNodes_.insertBefore(e,this.topFold_),this.syncRowNodesDimensions_()}else e=this.topFold_.nextSibling;var t,r=this.rowProvider_.getRo
Download .txt
gitextract_2tont2x0/

├── .github/
│   └── ISSUE_TEMPLATE.md
├── .gitignore
├── .gotty
├── CONTRIBUTING.md
├── Godeps/
│   ├── Godeps.json
│   └── Readme
├── LICENSE
├── Makefile
├── README.md
├── backend/
│   ├── doc.go
│   └── localcommand/
│       ├── doc.go
│       ├── factory.go
│       ├── local_command.go
│       └── options.go
├── favicon.psd
├── help.go
├── js/
│   ├── dist/
│   │   ├── gotty-bundle.js
│   │   ├── hterm.d.ts
│   │   ├── main.d.ts
│   │   ├── websocket.d.ts
│   │   ├── webtty.d.ts
│   │   └── xterm.d.ts
│   ├── package.json
│   ├── src/
│   │   ├── hterm.ts
│   │   ├── main.ts
│   │   ├── websocket.ts
│   │   ├── webtty.ts
│   │   └── xterm.ts
│   ├── tsconfig.json
│   ├── typings/
│   │   └── libapps/
│   │       └── index.d.ts
│   └── webpack.config.js
├── main.go
├── pkg/
│   ├── homedir/
│   │   └── expand.go
│   └── randomstring/
│       └── generate.go
├── resources/
│   ├── index.css
│   ├── index.html
│   └── xterm_customize.css
├── server/
│   ├── asset.go
│   ├── handler_atomic.go
│   ├── handlers.go
│   ├── init_message.go
│   ├── list_address.go
│   ├── log_response_writer.go
│   ├── middleware.go
│   ├── options.go
│   ├── run_option.go
│   ├── server.go
│   ├── slave.go
│   └── ws_wrapper.go
├── utils/
│   ├── default.go
│   └── flags.go
├── vendor/
│   └── github.com/
│       ├── NYTimes/
│       │   └── gziphandler/
│       │       ├── .gitignore
│       │       ├── .travis.yml
│       │       ├── CODE_OF_CONDUCT.md
│       │       ├── CONTRIBUTING.md
│       │       ├── LICENSE.md
│       │       ├── README.md
│       │       ├── gzip.go
│       │       └── gzip_go18.go
│       ├── codegangsta/
│       │   └── cli/
│       │       ├── .gitignore
│       │       ├── .travis.yml
│       │       ├── CHANGELOG.md
│       │       ├── LICENSE
│       │       ├── README.md
│       │       ├── app.go
│       │       ├── appveyor.yml
│       │       ├── category.go
│       │       ├── cli.go
│       │       ├── command.go
│       │       ├── context.go
│       │       ├── errors.go
│       │       ├── flag-types.json
│       │       ├── flag.go
│       │       ├── flag_generated.go
│       │       ├── funcs.go
│       │       ├── generate-flag-types
│       │       ├── help.go
│       │       └── runtests
│       ├── elazarl/
│       │   └── go-bindata-assetfs/
│       │       ├── LICENSE
│       │       ├── README.md
│       │       ├── assetfs.go
│       │       └── doc.go
│       ├── fatih/
│       │   └── structs/
│       │       ├── .gitignore
│       │       ├── .travis.yml
│       │       ├── LICENSE
│       │       ├── README.md
│       │       ├── field.go
│       │       ├── structs.go
│       │       └── tags.go
│       ├── gorilla/
│       │   └── websocket/
│       │       ├── .gitignore
│       │       ├── .travis.yml
│       │       ├── AUTHORS
│       │       ├── LICENSE
│       │       ├── README.md
│       │       ├── client.go
│       │       ├── conn.go
│       │       ├── doc.go
│       │       ├── json.go
│       │       ├── server.go
│       │       └── util.go
│       ├── hashicorp/
│       │   └── go-multierror/
│       │       ├── LICENSE
│       │       ├── README.md
│       │       ├── append.go
│       │       ├── flatten.go
│       │       ├── format.go
│       │       └── multierror.go
│       ├── kr/
│       │   └── pty/
│       │       ├── .gitignore
│       │       ├── License
│       │       ├── README.md
│       │       ├── doc.go
│       │       ├── ioctl.go
│       │       ├── ioctl_bsd.go
│       │       ├── mktypes.bash
│       │       ├── pty_darwin.go
│       │       ├── pty_freebsd.go
│       │       ├── pty_linux.go
│       │       ├── pty_unsupported.go
│       │       ├── run.go
│       │       ├── types.go
│       │       ├── types_freebsd.go
│       │       ├── util.go
│       │       ├── ztypes_386.go
│       │       ├── ztypes_amd64.go
│       │       ├── ztypes_arm.go
│       │       ├── ztypes_arm64.go
│       │       ├── ztypes_freebsd_386.go
│       │       ├── ztypes_freebsd_amd64.go
│       │       ├── ztypes_freebsd_arm.go
│       │       ├── ztypes_ppc64.go
│       │       ├── ztypes_ppc64le.go
│       │       └── ztypes_s390x.go
│       ├── pkg/
│       │   └── errors/
│       │       ├── .gitignore
│       │       ├── .travis.yml
│       │       ├── LICENSE
│       │       ├── README.md
│       │       ├── appveyor.yml
│       │       ├── errors.go
│       │       └── stack.go
│       └── yudai/
│           └── hcl/
│               ├── .gitignore
│               ├── LICENSE
│               ├── Makefile
│               ├── README.md
│               ├── decoder.go
│               ├── hcl/
│               │   ├── lex.go
│               │   ├── object.go
│               │   ├── parse.go
│               │   ├── parse.y
│               │   ├── valuetype_string.go
│               │   └── y.go
│               ├── hcl.go
│               ├── json/
│               │   ├── lex.go
│               │   ├── parse.go
│               │   ├── parse.y
│               │   └── y.go
│               ├── lex.go
│               └── parse.go
├── version.go
├── webtty/
│   ├── doc.go
│   ├── errors.go
│   ├── master.go
│   ├── message_types.go
│   ├── option.go
│   ├── slave.go
│   ├── webtty.go
│   └── webtty_test.go
└── wercker.yml
Download .txt
SYMBOL INDEX (904 symbols across 94 files)

FILE: backend/localcommand/factory.go
  type Options (line 10) | type Options struct
  type Factory (line 15) | type Factory struct
    method Name (line 36) | func (factory *Factory) Name() string {
    method New (line 40) | func (factory *Factory) New(params map[string][]string) (server.Slave,...
  function NewFactory (line 22) | func NewFactory(command string, argv []string, options *Options) (*Facto...

FILE: backend/localcommand/local_command.go
  constant DefaultCloseSignal (line 15) | DefaultCloseSignal  = syscall.SIGINT
  constant DefaultCloseTimeout (line 16) | DefaultCloseTimeout = 10 * time.Second
  type LocalCommand (line 19) | type LocalCommand struct
    method Read (line 71) | func (lcmd *LocalCommand) Read(p []byte) (n int, err error) {
    method Write (line 75) | func (lcmd *LocalCommand) Write(p []byte) (n int, err error) {
    method Close (line 79) | func (lcmd *LocalCommand) Close() error {
    method WindowTitleVariables (line 93) | func (lcmd *LocalCommand) WindowTitleVariables() map[string]interface{} {
    method ResizeTerminal (line 101) | func (lcmd *LocalCommand) ResizeTerminal(width int, height int) error {
    method closeTimeoutC (line 126) | func (lcmd *LocalCommand) closeTimeoutC() <-chan time.Time {
  function New (line 31) | func New(command string, argv []string, options ...Option) (*LocalComman...

FILE: backend/localcommand/options.go
  type Option (line 8) | type Option
  function WithCloseSignal (line 10) | func WithCloseSignal(signal syscall.Signal) Option {
  function WithCloseTimeout (line 16) | func WithCloseTimeout(timeout time.Duration) Option {

FILE: js/dist/gotty-bundle.js
  function t (line 1) | function t(i){if(r[i])return r[i].exports;var o=r[i]={i:i,l:!1,exports:{...
  function i (line 1) | function i(e){var t=this;if(!(this instanceof i))return new i(arguments[...
  function o (line 1) | function o(e,t,r,i){Array.isArray(e)||(e=[e]),e.forEach(function(e){e.ad...
  function s (line 1) | function s(e,t,r,i){e.removeEventListener(t,r,i||!1)}
  function n (line 1) | function n(e,t){function r(){this.constructor=e}r.prototype=t.prototype,...
  function a (line 1) | function a(e,t){var r=e.browser.isMac&&t.altKey&&!t.ctrlKey&&!t.metaKey|...
  function l (line 1) | function l(e,t,r){var o=e<<16|t<<8|r;if(null!=l._cache[o])return l._cach...
  function h (line 1) | function h(e){return 16===e.keyCode||17===e.keyCode||18===e.keyCode}
  function e (line 27) | function e(e,r,i){o.push("#"+t(e)+t(r)+t(i))}
  function t (line 27) | function t(e){return(e=e.toString(16)).length<2?"0"+e:e}
  function e (line 27) | function e(e){var t,r;if(t=n(e),r=v.getRawByteCoords(e,l.rowContainer,l....
  function t (line 27) | function t(e){var t,r=h;(t=v.getRawByteCoords(e,l.rowContainer,l.charMea...
  function r (line 27) | function r(e,t){if(l.utfMouse){if(2047===t)return e.push(0);t<127?e.push...
  function i (line 27) | function i(e,t){if(l.vt300Mouse){e&=3,t.x-=32,t.y-=32;var i=g.C0.ESC+"[2...
  function n (line 27) | function n(e){var t,r,i,o,s;switch(e.overrideType||e.type){case"mousedow...
  function e (line 27) | function e(){this._events=this._events||{}}
  function r (line 27) | function r(){var i=Array.prototype.slice.call(arguments);return this.off...
  function t (line 60) | function t(e){return e=(257*Math.min(e,255)).toString(16),i.f.zpad(e,4)}
  function t (line 60) | function t(e){4==e.length&&(e=e.replace(r,function(e,t,r,i){return"#"+t+...
  function t (line 60) | function t(e){var t=i.colors.crackRGB(e);return t?"#"+i.f.zpad((parseInt...
  function r (line 60) | function r(e){e?o=i.shift():s=i.shift(),i.length?n():t(o,s)}
  function t (line 60) | function t(){0==--r&&e&&e()}
  function t (line 60) | function t(t,r){this.testManager_=t,this.suiteName=e,this.setup(r)}
  function i (line 60) | function i(e){if("number"==typeof e)return e;var t=String(e).split("\n")...
  function t (line 60) | function t(t){o.windowType=t.type,setTimeout(e,0)}
  function e (line 60) | function e(e,r){return e in t.options?t.options[e]:r}
  function t (line 60) | function t(o){i=o;var n=r[o];return"function"==typeof n&&(n=n.apply(s.ke...
  function e (line 60) | function e(e,t,r){return"function"==typeof e?e.apply(c,[t,r]):e}
  function t (line 60) | function t(t,r){return function(i,o){return e(i.shiftKey||i.ctrlKey||i.a...
  function r (line 60) | function r(t,r){return function(i,o){return e(c.keyboard.backspaceSendsB...
  function i (line 60) | function i(t,r){return function(i,o){var s=i.shiftKey?r:t;return i.maskS...
  function s (line 60) | function s(t,r){return function(i,o){return e(i.altKey?r:t,i,o)}}
  function n (line 60) | function n(t,r){return function(i,o){return e(i.shiftKey||i.ctrlKey||i.a...
  function a (line 60) | function a(e){return String.fromCharCode(e.charCodeAt(0)-64)}
  function l (line 60) | function l(e){return function(t,r){return this[e](t,r)}}
  function h (line 60) | function h(t){return function(r,i){return c.keyboard.mediaKeysAreFKeys?e...
  function r (line 60) | function r(e){return String.fromCharCode(e.charCodeAt(0)-64)}
  function i (line 60) | function i(e){e<o.length-1&&setTimeout(i,0,e+1),o[e](t)}
  function e (line 60) | function e(){r.startRow=o,r.startNode=i.anchorNode,r.startOffset=i.ancho...
  function t (line 60) | function t(){r.startRow=s,r.startNode=i.focusNode,r.startOffset=i.focusO...
  function r (line 60) | function r(e,t){for(;e!=t;){if(!e)throw"Did not encounter target node";i...
  function t (line 60) | function t(e){!r.codingSystemUtf8_&&r[r.GL].GL&&(e=r[r.GL].GL(e)),r.term...
  function t (line 60) | function t(e){var r=e.consumeChar();""!=r&&(this.dispatch("ESC",r,e),e....
  function t (line 60) | function t(e){if(this.parseUntilStringTerminator_(e)&&e.func!=t){var r=e...
  function t (line 60) | function t(t){return e.args.length<t+2||5!=e.args[t+1]?null:e.iarg(t+2,0)}
  function r (line 60) | function r(t){return e.args.length<t+5||2!=e.args[t+1]?null:"rgb("+e.iar...
  function i (line 88) | function i(e,t){if(null==e.pageX)return null;for(var r=e.pageX,i=e.pageY...
  function o (line 88) | function o(e,t,r,o,s,n){var a=i(e,t);return a[0]=Math.ceil((a[0]+(n?r.wi...
  function e (line 88) | function e(e){this.elem=e,i.hterm.defaultStorage=new i.lib.Storage.Memor...
  function e (line 88) | function e(e,t){this.url=e,this.protocols=t}
  function e (line 88) | function e(e,t){this.bare=new WebSocket(e,t)}
  function e (line 88) | function e(e,t,r,i){this.term=e,this.connectionFactory=t,this.args=r,thi...
  function e (line 88) | function e(e){var t=this;this.elem=e,this.term=new i,this.message=e.owne...
  function e (line 88) | function e(e,t,r){this.textarea=e,this.compositionView=t,this.terminal=r...
  function e (line 88) | function e(e){this._terminal=e}
  function t (line 88) | function t(e){var t,r=0,o=i.length-1;if(e<i[0][0]||e>i[o][1])return!1;fo...
  function r (line 88) | function r(e){return e>=4352&&(e<=4447||9001===e||9002===e||e>=11904&&e<...
  function e (line 88) | function e(){this._nextLinkMatcherId=o,this._rowTimeoutIds=[],this._link...
  function e (line 88) | function e(e,t){this._inputHandler=e,this._terminal=t,this._state=h.NORMAL}
  function i (line 88) | function i(e){var t=e.ownerDocument.createElement("span");t.innerHTML="h...
  function e (line 88) | function e(e){this._terminal=e,this._refreshRowsQueue=[],this._refreshFr...
  function i (line 88) | function i(){this.constructor=t}
  function t (line 88) | function t(t,r,i,s){var n=e.call(this)||this;return n._terminal=t,n._buf...
  function e (line 88) | function e(e){this._terminal=e,this.clearSelection()}
  function e (line 88) | function e(e,t,r,i){var o=this;this.terminal=e,this.viewportElement=t,th...
  function i (line 88) | function i(e,t){return t?e.replace(/\r?\n/g,"\r"):e}
  function o (line 88) | function o(e,t){t.style.position="fixed",t.style.width="20px",t.style.he...
  function i (line 88) | function i(){this.constructor=t}
  function t (line 88) | function t(t,r){var i=e.call(this)||this;return i._document=t,i._parentE...
  function i (line 88) | function i(){this.constructor=t}
  function t (line 88) | function t(t){var r=e.call(this)||this;return r._array=new Array(t),r._s...
  function e (line 88) | function e(e){this.type=e,this._type=e,this._pool=[],this._inUse={}}
  function i (line 88) | function i(e){return r(o(e))}
  function o (line 88) | function o(e){var t=s[e];if(!(t+1))throw new Error("Cannot find module '...

FILE: js/dist/hterm.d.ts
  class Hterm (line 2) | class Hterm {

FILE: js/dist/websocket.d.ts
  class ConnectionFactory (line 1) | class ConnectionFactory {
  class Connection (line 7) | class Connection {

FILE: js/dist/webtty.d.ts
  type Terminal (line 12) | interface Terminal {
  type Connection (line 28) | interface Connection {
  type ConnectionFactory (line 37) | interface ConnectionFactory {
  class WebTTY (line 40) | class WebTTY {

FILE: js/dist/xterm.d.ts
  class Xterm (line 3) | class Xterm {

FILE: js/src/hterm.ts
  class Hterm (line 3) | class Hterm {
    method constructor (line 15) | constructor(elem: HTMLElement) {
    method info (line 26) | info(): { columns: number, rows: number } {
    method output (line 30) | output(data: string) {
    method showMessage (line 36) | showMessage(message: string, timeout: number) {
    method removeMessage (line 45) | removeMessage(): void {
    method setWindowTitle (line 50) | setWindowTitle(title: string) {
    method setPreferences (line 54) | setPreferences(value: object) {
    method onInput (line 60) | onInput(callback: (input: string) => void) {
    method onResize (line 69) | onResize(callback: (colmuns: number, rows: number) => void) {
    method deactivate (line 77) | deactivate(): void {
    method reset (line 84) | reset(): void {
    method close (line 89) | close(): void {

FILE: js/src/websocket.ts
  class ConnectionFactory (line 1) | class ConnectionFactory {
    method constructor (line 5) | constructor(url: string, protocols: string[]) {
    method create (line 10) | create(): Connection {
  class Connection (line 15) | class Connection {
    method constructor (line 19) | constructor(url: string, protocols: string[]) {
    method open (line 23) | open() {
    method close (line 27) | close() {
    method send (line 31) | send(data: string) {
    method isOpen (line 35) | isOpen(): boolean {
    method onOpen (line 43) | onOpen(callback: () => void) {
    method onReceive (line 49) | onReceive(callback: (data: string) => void) {
    method onClose (line 55) | onClose(callback: () => void) {

FILE: js/src/webtty.ts
  type Terminal (line 16) | interface Terminal {
  type Connection (line 30) | interface Connection {
  type ConnectionFactory (line 40) | interface ConnectionFactory {
  class WebTTY (line 45) | class WebTTY {
    method constructor (line 52) | constructor(term: Terminal, connectionFactory: ConnectionFactory, args...
    method open (line 60) | open() {

FILE: js/src/xterm.ts
  class Xterm (line 7) | class Xterm {
    method constructor (line 18) | constructor(elem: HTMLElement) {
    method info (line 42) | info(): { columns: number, rows: number } {
    method output (line 46) | output(data: string) {
    method showMessage (line 50) | showMessage(message: string, timeout: number) {
    method removeMessage (line 64) | removeMessage(): void {
    method setWindowTitle (line 70) | setWindowTitle(title: string) {
    method setPreferences (line 74) | setPreferences(value: object) {
    method onInput (line 77) | onInput(callback: (input: string) => void) {
    method onResize (line 84) | onResize(callback: (colmuns: number, rows: number) => void) {
    method deactivate (line 90) | deactivate(): void {
    method reset (line 96) | reset(): void {
    method close (line 101) | close(): void {

FILE: js/typings/libapps/index.d.ts
  class Terminal (line 2) | class Terminal {
  class IO (line 16) | class IO {
  class Prefs (line 28) | class Prefs {
  type Storage (line 36) | interface Storage {
  type Memory (line 39) | interface Memory {
  class UTF8Decoder (line 48) | class UTF8Decoder {

FILE: main.go
  function main (line 20) | func main() {
  function exit (line 115) | func exit(err error, code int) {
  function waitSignals (line 122) | func waitSignals(errs chan error, cancel context.CancelFunc, gracefullCa...

FILE: pkg/homedir/expand.go
  function Expand (line 7) | func Expand(path string) string {

FILE: pkg/randomstring/generate.go
  function Generate (line 9) | func Generate(length int) string {

FILE: server/asset.go
  function bindataRead (line 26) | func bindataRead(data []byte, name string) ([]byte, error) {
  type asset (line 46) | type asset struct
  type bindataFileInfo (line 51) | type bindataFileInfo struct
    method Name (line 58) | func (fi bindataFileInfo) Name() string {
    method Size (line 61) | func (fi bindataFileInfo) Size() int64 {
    method Mode (line 64) | func (fi bindataFileInfo) Mode() os.FileMode {
    method ModTime (line 67) | func (fi bindataFileInfo) ModTime() time.Time {
    method IsDir (line 70) | func (fi bindataFileInfo) IsDir() bool {
    method Sys (line 73) | func (fi bindataFileInfo) Sys() interface{} {
  function staticCssIndexCssBytes (line 79) | func staticCssIndexCssBytes() ([]byte, error) {
  function staticCssIndexCss (line 86) | func staticCssIndexCss() (*asset, error) {
  function staticCssXtermCssBytes (line 99) | func staticCssXtermCssBytes() ([]byte, error) {
  function staticCssXtermCss (line 106) | func staticCssXtermCss() (*asset, error) {
  function staticCssXterm_customizeCssBytes (line 119) | func staticCssXterm_customizeCssBytes() ([]byte, error) {
  function staticCssXterm_customizeCss (line 126) | func staticCssXterm_customizeCss() (*asset, error) {
  function staticFaviconPngBytes (line 139) | func staticFaviconPngBytes() ([]byte, error) {
  function staticFaviconPng (line 146) | func staticFaviconPng() (*asset, error) {
  function staticIndexHtmlBytes (line 159) | func staticIndexHtmlBytes() ([]byte, error) {
  function staticIndexHtml (line 166) | func staticIndexHtml() (*asset, error) {
  function staticJsBundleJsBytes (line 179) | func staticJsBundleJsBytes() ([]byte, error) {
  function staticJsBundleJs (line 186) | func staticJsBundleJs() (*asset, error) {
  function staticJsGottyBundleJsBytes (line 199) | func staticJsGottyBundleJsBytes() ([]byte, error) {
  function staticJsGottyBundleJs (line 206) | func staticJsGottyBundleJs() (*asset, error) {
  function Asset (line 220) | func Asset(name string) ([]byte, error) {
  function MustAsset (line 234) | func MustAsset(name string) []byte {
  function AssetInfo (line 246) | func AssetInfo(name string) (os.FileInfo, error) {
  function AssetNames (line 259) | func AssetNames() []string {
  function AssetDir (line 291) | func AssetDir(name string) ([]string, error) {
  type bintree (line 313) | type bintree struct
  function RestoreAsset (line 335) | func RestoreAsset(dir, name string) error {
  function RestoreAssets (line 360) | func RestoreAssets(dir, name string) error {
  function _filePath (line 376) | func _filePath(dir, name string) string {

FILE: server/handler_atomic.go
  type counter (line 8) | type counter struct
    method add (line 31) | func (counter *counter) add(n int) int {
    method done (line 44) | func (counter *counter) done() int {
    method count (line 57) | func (counter *counter) count() int {
    method wait (line 64) | func (counter *counter) wait() {
    method timer (line 68) | func (counter *counter) timer() *time.Timer {
  function newCounter (line 16) | func newCounter(duration time.Duration) *counter {

FILE: server/handlers.go
  method generateHandleWS (line 19) | func (server *Server) generateHandleWS(ctx context.Context, cancel conte...
  method processWSConn (line 90) | func (server *Server) processWSConn(ctx context.Context, conn *websocket...
  method handleIndex (line 171) | func (server *Server) handleIndex(w http.ResponseWriter, r *http.Request) {
  method handleAuthToken (line 203) | func (server *Server) handleAuthToken(w http.ResponseWriter, r *http.Req...
  method handleConfig (line 209) | func (server *Server) handleConfig(w http.ResponseWriter, r *http.Reques...
  method titleVariables (line 216) | func (server *Server) titleVariables(order []string, varUnits map[string...

FILE: server/init_message.go
  type InitMessage (line 3) | type InitMessage struct

FILE: server/list_address.go
  function listAddresses (line 7) | func listAddresses() (addresses []string) {

FILE: server/log_response_writer.go
  type logResponseWriter (line 9) | type logResponseWriter struct
    method WriteHeader (line 14) | func (w *logResponseWriter) WriteHeader(status int) {
    method Hijack (line 19) | func (w *logResponseWriter) Hijack() (net.Conn, *bufio.ReadWriter, err...

FILE: server/middleware.go
  method wrapLogger (line 10) | func (server *Server) wrapLogger(handler http.Handler) http.Handler {
  method wrapHeaders (line 18) | func (server *Server) wrapHeaders(handler http.Handler) http.Handler {
  method wrapBasicAuth (line 26) | func (server *Server) wrapBasicAuth(handler http.Handler, credential str...

FILE: server/options.go
  type Options (line 7) | type Options struct
    method Validate (line 37) | func (options *Options) Validate() error {
  type HtermPrefernces (line 44) | type HtermPrefernces struct

FILE: server/run_option.go
  type RunOptions (line 8) | type RunOptions struct
  type RunOption (line 13) | type RunOption
  function WithGracefullContext (line 17) | func WithGracefullContext(ctx context.Context) RunOption {

FILE: server/server.go
  type Server (line 27) | type Server struct
    method Run (line 89) | func (server *Server) Run(ctx context.Context, options ...RunOption) e...
    method setupHandlers (line 183) | func (server *Server) setupHandlers(ctx context.Context, cancel contex...
    method setupHTTPServer (line 215) | func (server *Server) setupHTTPServer(handler http.Handler) (*http.Ser...
    method tlsConfig (line 231) | func (server *Server) tlsConfig() (*tls.Config, error) {
  function New (line 38) | func New(factory Factory, options *Options) (*Server, error) {

FILE: server/slave.go
  type Slave (line 8) | type Slave interface
  type Factory (line 14) | type Factory interface

FILE: server/ws_wrapper.go
  type wsWrapper (line 7) | type wsWrapper struct
    method Write (line 11) | func (wsw *wsWrapper) Write(p []byte) (n int, err error) {
    method Read (line 20) | func (wsw *wsWrapper) Read(p []byte) (n int, err error) {

FILE: utils/default.go
  function ApplyDefaultValues (line 10) | func ApplyDefaultValues(struct_ interface{}) (err error) {

FILE: utils/flags.go
  function GenerateFlags (line 17) | func GenerateFlags(options ...interface{}) (flags []cli.Flag, mappings m...
  function ApplyFlags (line 65) | func ApplyFlags(
  function ApplyConfigFile (line 104) | func ApplyConfigFile(filePath string, options ...interface{}) error {

FILE: vendor/github.com/NYTimes/gziphandler/gzip.go
  constant vary (line 16) | vary            = "Vary"
  constant acceptEncoding (line 17) | acceptEncoding  = "Accept-Encoding"
  constant contentEncoding (line 18) | contentEncoding = "Content-Encoding"
  constant contentType (line 19) | contentType     = "Content-Type"
  constant contentLength (line 20) | contentLength   = "Content-Length"
  type codings (line 23) | type codings
  constant DefaultQValue (line 29) | DefaultQValue = 1.0
  constant DefaultMinSize (line 33) | DefaultMinSize = 512
  function init (line 41) | func init() {
  function poolIndex (line 50) | func poolIndex(level int) int {
  function addLevelPool (line 58) | func addLevelPool(level int) {
  type GzipResponseWriter (line 74) | type GzipResponseWriter struct
    method Write (line 88) | func (w *GzipResponseWriter) Write(b []byte) (int, error) {
    method startGzip (line 119) | func (w *GzipResponseWriter) startGzip() error {
    method WriteHeader (line 152) | func (w *GzipResponseWriter) WriteHeader(code int) {
    method init (line 158) | func (w *GzipResponseWriter) init() {
    method Close (line 167) | func (w *GzipResponseWriter) Close() error {
    method Flush (line 192) | func (w *GzipResponseWriter) Flush() {
    method Hijack (line 204) | func (w *GzipResponseWriter) Hijack() (net.Conn, *bufio.ReadWriter, er...
  function MustNewGzipLevelHandler (line 216) | func MustNewGzipLevelHandler(level int) func(http.Handler) http.Handler {
  function NewGzipLevelHandler (line 230) | func NewGzipLevelHandler(level int) (func(http.Handler) http.Handler, er...
  function NewGzipLevelAndMinSize (line 236) | func NewGzipLevelAndMinSize(level, minSize int) (func(http.Handler) http...
  function GzipHandlerWithOpts (line 240) | func GzipHandlerWithOpts(opts ...option) (func(http.Handler) http.Handle...
  type config (line 278) | type config struct
    method validate (line 284) | func (c *config) validate() error {
  type option (line 296) | type option
  function MinSize (line 298) | func MinSize(size int) option {
  function CompressionLevel (line 304) | func CompressionLevel(level int) option {
  function ContentTypes (line 310) | func ContentTypes(types []string) option {
  function GzipHandler (line 322) | func GzipHandler(h http.Handler) http.Handler {
  function acceptsGzip (line 329) | func acceptsGzip(r *http.Request) bool {
  function handleContentType (line 335) | func handleContentType(contentTypes []string, w http.ResponseWriter) bool {
  function parseEncodings (line 358) | func parseEncodings(s string) (codings, error) {
  function parseCoding (line 384) | func parseCoding(s string) (coding string, qvalue float64, err error) {

FILE: vendor/github.com/NYTimes/gziphandler/gzip_go18.go
  method Push (line 10) | func (w *GzipResponseWriter) Push(target string, opts *http.PushOptions)...
  function setAcceptEncodingForPushOptions (line 19) | func setAcceptEncodingForPushOptions(opts *http.PushOptions) *http.PushO...

FILE: vendor/github.com/codegangsta/cli/app.go
  type App (line 27) | type App struct
    method Setup (line 121) | func (a *App) Setup() {
    method Run (line 169) | func (a *App) Run(arguments []string) (err error) {
    method RunAndExitOnError (line 270) | func (a *App) RunAndExitOnError() {
    method RunAsSubcommand (line 279) | func (a *App) RunAsSubcommand(ctx *Context) (err error) {
    method Command (line 386) | func (a *App) Command(name string) *Command {
    method Categories (line 397) | func (a *App) Categories() CommandCategories {
    method VisibleCategories (line 403) | func (a *App) VisibleCategories() []*CommandCategory {
    method VisibleCommands (line 421) | func (a *App) VisibleCommands() []Command {
    method VisibleFlags (line 432) | func (a *App) VisibleFlags() []Flag {
    method hasFlag (line 436) | func (a *App) hasFlag(flag Flag) bool {
    method errWriter (line 446) | func (a *App) errWriter() io.Writer {
    method appendFlag (line 456) | func (a *App) appendFlag(flag Flag) {
  function compileTime (line 94) | func compileTime() time.Time {
  function NewApp (line 104) | func NewApp() *App {
  type Author (line 463) | type Author struct
    method String (line 469) | func (a Author) String() string {
  function HandleAction (line 481) | func HandleAction(action interface{}, context *Context) (err error) {

FILE: vendor/github.com/codegangsta/cli/category.go
  type CommandCategories (line 4) | type CommandCategories
    method Less (line 12) | func (c CommandCategories) Less(i, j int) bool {
    method Len (line 16) | func (c CommandCategories) Len() int {
    method Swap (line 20) | func (c CommandCategories) Swap(i, j int) {
    method AddCommand (line 25) | func (c CommandCategories) AddCommand(category string, command Command...
  type CommandCategory (line 7) | type CommandCategory struct
    method VisibleCommands (line 36) | func (c *CommandCategory) VisibleCommands() []Command {

FILE: vendor/github.com/codegangsta/cli/command.go
  type Command (line 11) | type Command struct
    method FullName (line 66) | func (c Command) FullName() string {
    method Run (line 77) | func (c Command) Run(ctx *Context) (err error) {
    method Names (line 202) | func (c Command) Names() []string {
    method HasName (line 213) | func (c Command) HasName(name string) bool {
    method startApp (line 222) | func (c Command) startApp(ctx *Context) error {
    method VisibleFlags (line 284) | func (c Command) VisibleFlags() []Flag {
  type Commands (line 74) | type Commands

FILE: vendor/github.com/codegangsta/cli/context.go
  type Context (line 15) | type Context struct
    method NumFlags (line 36) | func (c *Context) NumFlags() int {
    method Set (line 41) | func (c *Context) Set(name, value string) error {
    method GlobalSet (line 46) | func (c *Context) GlobalSet(name, value string) error {
    method IsSet (line 51) | func (c *Context) IsSet(name string) bool {
    method GlobalIsSet (line 114) | func (c *Context) GlobalIsSet(name string) bool {
    method FlagNames (line 129) | func (c *Context) FlagNames() (names []string) {
    method GlobalFlagNames (line 141) | func (c *Context) GlobalFlagNames() (names []string) {
    method Parent (line 153) | func (c *Context) Parent() *Context {
    method value (line 158) | func (c *Context) value(name string) interface{} {
    method Args (line 166) | func (c *Context) Args() Args {
    method NArg (line 172) | func (c *Context) NArg() int {
  function NewContext (line 25) | func NewContext(app *App, set *flag.FlagSet, parentCtx *Context) *Context {
  type Args (line 163) | type Args
    method Get (line 177) | func (a Args) Get(n int) string {
    method First (line 185) | func (a Args) First() string {
    method Tail (line 191) | func (a Args) Tail() []string {
    method Present (line 199) | func (a Args) Present() bool {
    method Swap (line 204) | func (a Args) Swap(from, to int) error {
  function globalContext (line 212) | func globalContext(ctx *Context) *Context {
  function lookupGlobalFlagSet (line 225) | func lookupGlobalFlagSet(name string, ctx *Context) *flag.FlagSet {
  function copyFlag (line 237) | func copyFlag(name string, ff *flag.Flag, set *flag.FlagSet) {
  function normalizeFlags (line 245) | func normalizeFlags(flags []Flag, set *flag.FlagSet) error {

FILE: vendor/github.com/codegangsta/cli/errors.go
  type MultiError (line 18) | type MultiError struct
    method Error (line 28) | func (m MultiError) Error() string {
  function NewMultiError (line 23) | func NewMultiError(err ...error) MultiError {
  type ErrorFormatter (line 37) | type ErrorFormatter interface
  type ExitCoder (line 43) | type ExitCoder interface
  type ExitError (line 49) | type ExitError struct
    method Error (line 64) | func (ee *ExitError) Error() string {
    method ExitCode (line 70) | func (ee *ExitError) ExitCode() int {
  function NewExitError (line 55) | func NewExitError(message interface{}, exitCode int) *ExitError {
  function HandleExitCoder (line 78) | func HandleExitCoder(err error) {

FILE: vendor/github.com/codegangsta/cli/flag.go
  constant defaultPlaceholder (line 14) | defaultPlaceholder = "value"
  type FlagsByName (line 41) | type FlagsByName
    method Len (line 43) | func (f FlagsByName) Len() int {
    method Less (line 47) | func (f FlagsByName) Less(i, j int) bool {
    method Swap (line 51) | func (f FlagsByName) Swap(i, j int) {
  type Flag (line 58) | type Flag interface
  type errorableFlag (line 68) | type errorableFlag interface
  function flagSet (line 74) | func flagSet(name string, flags []Flag) (*flag.FlagSet, error) {
  function eachName (line 90) | func eachName(longName string, fn func(string)) {
  type Generic (line 99) | type Generic interface
  method Apply (line 107) | func (f GenericFlag) Apply(set *flag.FlagSet) {
  method ApplyWithError (line 113) | func (f GenericFlag) ApplyWithError(set *flag.FlagSet) error {
  type StringSlice (line 135) | type StringSlice
    method Set (line 138) | func (f *StringSlice) Set(value string) error {
    method String (line 144) | func (f *StringSlice) String() string {
    method Value (line 149) | func (f *StringSlice) Value() []string {
    method Get (line 154) | func (f *StringSlice) Get() interface{} {
  method Apply (line 160) | func (f StringSliceFlag) Apply(set *flag.FlagSet) {
  method ApplyWithError (line 165) | func (f StringSliceFlag) ApplyWithError(set *flag.FlagSet) error {
  type IntSlice (line 194) | type IntSlice
    method Set (line 197) | func (f *IntSlice) Set(value string) error {
    method String (line 207) | func (f *IntSlice) String() string {
    method Value (line 212) | func (f *IntSlice) Value() []int {
    method Get (line 217) | func (f *IntSlice) Get() interface{} {
  method Apply (line 223) | func (f IntSliceFlag) Apply(set *flag.FlagSet) {
  method ApplyWithError (line 228) | func (f IntSliceFlag) ApplyWithError(set *flag.FlagSet) error {
  type Int64Slice (line 257) | type Int64Slice
    method Set (line 260) | func (f *Int64Slice) Set(value string) error {
    method String (line 270) | func (f *Int64Slice) String() string {
    method Value (line 275) | func (f *Int64Slice) Value() []int64 {
    method Get (line 280) | func (f *Int64Slice) Get() interface{} {
  method Apply (line 286) | func (f Int64SliceFlag) Apply(set *flag.FlagSet) {
  method ApplyWithError (line 291) | func (f Int64SliceFlag) ApplyWithError(set *flag.FlagSet) error {
  method Apply (line 320) | func (f BoolFlag) Apply(set *flag.FlagSet) {
  method ApplyWithError (line 325) | func (f BoolFlag) ApplyWithError(set *flag.FlagSet) error {
  method Apply (line 360) | func (f BoolTFlag) Apply(set *flag.FlagSet) {
  method ApplyWithError (line 365) | func (f BoolTFlag) ApplyWithError(set *flag.FlagSet) error {
  method Apply (line 400) | func (f StringFlag) Apply(set *flag.FlagSet) {
  method ApplyWithError (line 405) | func (f StringFlag) ApplyWithError(set *flag.FlagSet) error {
  method Apply (line 429) | func (f IntFlag) Apply(set *flag.FlagSet) {
  method ApplyWithError (line 434) | func (f IntFlag) ApplyWithError(set *flag.FlagSet) error {
  method Apply (line 462) | func (f Int64Flag) Apply(set *flag.FlagSet) {
  method ApplyWithError (line 467) | func (f Int64Flag) ApplyWithError(set *flag.FlagSet) error {
  method Apply (line 496) | func (f UintFlag) Apply(set *flag.FlagSet) {
  method ApplyWithError (line 501) | func (f UintFlag) ApplyWithError(set *flag.FlagSet) error {
  method Apply (line 530) | func (f Uint64Flag) Apply(set *flag.FlagSet) {
  method ApplyWithError (line 535) | func (f Uint64Flag) ApplyWithError(set *flag.FlagSet) error {
  method Apply (line 564) | func (f DurationFlag) Apply(set *flag.FlagSet) {
  method ApplyWithError (line 569) | func (f DurationFlag) ApplyWithError(set *flag.FlagSet) error {
  method Apply (line 598) | func (f Float64Flag) Apply(set *flag.FlagSet) {
  method ApplyWithError (line 603) | func (f Float64Flag) ApplyWithError(set *flag.FlagSet) error {
  function visibleFlags (line 630) | func visibleFlags(fl []Flag) []Flag {
  function prefixFor (line 640) | func prefixFor(name string) (prefix string) {
  function unquoteUsage (line 651) | func unquoteUsage(usage string) (string, string) {
  function prefixedNames (line 667) | func prefixedNames(fullName, placeholder string) string {
  function withEnvHint (line 683) | func withEnvHint(envVar, str string) string {
  function flagValue (line 699) | func flagValue(f Flag) reflect.Value {
  function stringifyFlag (line 707) | func stringifyFlag(f Flag) string {
  function stringifyIntSliceFlag (line 751) | func stringifyIntSliceFlag(f IntSliceFlag) string {
  function stringifyInt64SliceFlag (line 762) | func stringifyInt64SliceFlag(f Int64SliceFlag) string {
  function stringifyStringSliceFlag (line 773) | func stringifyStringSliceFlag(f StringSliceFlag) string {
  function stringifySliceFlag (line 786) | func stringifySliceFlag(usage, name string, defaultVals []string) string {

FILE: vendor/github.com/codegangsta/cli/flag_generated.go
  type BoolFlag (line 12) | type BoolFlag struct
    method String (line 22) | func (f BoolFlag) String() string {
    method GetName (line 27) | func (f BoolFlag) GetName() string {
  method Bool (line 33) | func (c *Context) Bool(name string) bool {
  method GlobalBool (line 39) | func (c *Context) GlobalBool(name string) bool {
  function lookupBool (line 46) | func lookupBool(name string, set *flag.FlagSet) bool {
  type BoolTFlag (line 59) | type BoolTFlag struct
    method String (line 69) | func (f BoolTFlag) String() string {
    method GetName (line 74) | func (f BoolTFlag) GetName() string {
  method BoolT (line 80) | func (c *Context) BoolT(name string) bool {
  method GlobalBoolT (line 86) | func (c *Context) GlobalBoolT(name string) bool {
  function lookupBoolT (line 93) | func lookupBoolT(name string, set *flag.FlagSet) bool {
  type DurationFlag (line 106) | type DurationFlag struct
    method String (line 117) | func (f DurationFlag) String() string {
    method GetName (line 122) | func (f DurationFlag) GetName() string {
  method Duration (line 128) | func (c *Context) Duration(name string) time.Duration {
  method GlobalDuration (line 134) | func (c *Context) GlobalDuration(name string) time.Duration {
  function lookupDuration (line 141) | func lookupDuration(name string, set *flag.FlagSet) time.Duration {
  type Float64Flag (line 154) | type Float64Flag struct
    method String (line 165) | func (f Float64Flag) String() string {
    method GetName (line 170) | func (f Float64Flag) GetName() string {
  method Float64 (line 176) | func (c *Context) Float64(name string) float64 {
  method GlobalFloat64 (line 182) | func (c *Context) GlobalFloat64(name string) float64 {
  function lookupFloat64 (line 189) | func lookupFloat64(name string, set *flag.FlagSet) float64 {
  type GenericFlag (line 202) | type GenericFlag struct
    method String (line 212) | func (f GenericFlag) String() string {
    method GetName (line 217) | func (f GenericFlag) GetName() string {
  method Generic (line 223) | func (c *Context) Generic(name string) interface{} {
  method GlobalGeneric (line 229) | func (c *Context) GlobalGeneric(name string) interface{} {
  function lookupGeneric (line 236) | func lookupGeneric(name string, set *flag.FlagSet) interface{} {
  type Int64Flag (line 249) | type Int64Flag struct
    method String (line 260) | func (f Int64Flag) String() string {
    method GetName (line 265) | func (f Int64Flag) GetName() string {
  method Int64 (line 271) | func (c *Context) Int64(name string) int64 {
  method GlobalInt64 (line 277) | func (c *Context) GlobalInt64(name string) int64 {
  function lookupInt64 (line 284) | func lookupInt64(name string, set *flag.FlagSet) int64 {
  type IntFlag (line 297) | type IntFlag struct
    method String (line 308) | func (f IntFlag) String() string {
    method GetName (line 313) | func (f IntFlag) GetName() string {
  method Int (line 319) | func (c *Context) Int(name string) int {
  method GlobalInt (line 325) | func (c *Context) GlobalInt(name string) int {
  function lookupInt (line 332) | func lookupInt(name string, set *flag.FlagSet) int {
  type IntSliceFlag (line 345) | type IntSliceFlag struct
    method String (line 355) | func (f IntSliceFlag) String() string {
    method GetName (line 360) | func (f IntSliceFlag) GetName() string {
  method IntSlice (line 366) | func (c *Context) IntSlice(name string) []int {
  method GlobalIntSlice (line 372) | func (c *Context) GlobalIntSlice(name string) []int {
  function lookupIntSlice (line 379) | func lookupIntSlice(name string, set *flag.FlagSet) []int {
  type Int64SliceFlag (line 392) | type Int64SliceFlag struct
    method String (line 402) | func (f Int64SliceFlag) String() string {
    method GetName (line 407) | func (f Int64SliceFlag) GetName() string {
  method Int64Slice (line 413) | func (c *Context) Int64Slice(name string) []int64 {
  method GlobalInt64Slice (line 419) | func (c *Context) GlobalInt64Slice(name string) []int64 {
  function lookupInt64Slice (line 426) | func lookupInt64Slice(name string, set *flag.FlagSet) []int64 {
  type StringFlag (line 439) | type StringFlag struct
    method String (line 450) | func (f StringFlag) String() string {
    method GetName (line 455) | func (f StringFlag) GetName() string {
  method String (line 461) | func (c *Context) String(name string) string {
  method GlobalString (line 467) | func (c *Context) GlobalString(name string) string {
  function lookupString (line 474) | func lookupString(name string, set *flag.FlagSet) string {
  type StringSliceFlag (line 487) | type StringSliceFlag struct
    method String (line 497) | func (f StringSliceFlag) String() string {
    method GetName (line 502) | func (f StringSliceFlag) GetName() string {
  method StringSlice (line 508) | func (c *Context) StringSlice(name string) []string {
  method GlobalStringSlice (line 514) | func (c *Context) GlobalStringSlice(name string) []string {
  function lookupStringSlice (line 521) | func lookupStringSlice(name string, set *flag.FlagSet) []string {
  type Uint64Flag (line 534) | type Uint64Flag struct
    method String (line 545) | func (f Uint64Flag) String() string {
    method GetName (line 550) | func (f Uint64Flag) GetName() string {
  method Uint64 (line 556) | func (c *Context) Uint64(name string) uint64 {
  method GlobalUint64 (line 562) | func (c *Context) GlobalUint64(name string) uint64 {
  function lookupUint64 (line 569) | func lookupUint64(name string, set *flag.FlagSet) uint64 {
  type UintFlag (line 582) | type UintFlag struct
    method String (line 593) | func (f UintFlag) String() string {
    method GetName (line 598) | func (f UintFlag) GetName() string {
  method Uint (line 604) | func (c *Context) Uint(name string) uint {
  method GlobalUint (line 610) | func (c *Context) GlobalUint(name string) uint {
  function lookupUint (line 617) | func lookupUint(name string, set *flag.FlagSet) uint {

FILE: vendor/github.com/codegangsta/cli/funcs.go
  type BashCompleteFunc (line 4) | type BashCompleteFunc
  type BeforeFunc (line 8) | type BeforeFunc
  type AfterFunc (line 12) | type AfterFunc
  type ActionFunc (line 15) | type ActionFunc
  type CommandNotFoundFunc (line 18) | type CommandNotFoundFunc
  type OnUsageErrorFunc (line 24) | type OnUsageErrorFunc
  type FlagStringFunc (line 28) | type FlagStringFunc

FILE: vendor/github.com/codegangsta/cli/help.go
  type helpPrinter (line 113) | type helpPrinter
  function ShowAppHelp (line 124) | func ShowAppHelp(c *Context) error {
  function DefaultAppComplete (line 130) | func DefaultAppComplete(c *Context) {
  function ShowCommandHelp (line 142) | func ShowCommandHelp(ctx *Context, command string) error {
  function ShowSubcommandHelp (line 165) | func ShowSubcommandHelp(c *Context) error {
  function ShowVersion (line 170) | func ShowVersion(c *Context) {
  function printVersion (line 174) | func printVersion(c *Context) {
  function ShowCompletions (line 179) | func ShowCompletions(c *Context) {
  function ShowCommandCompletions (line 187) | func ShowCommandCompletions(ctx *Context, command string) {
  function printHelp (line 194) | func printHelp(out io.Writer, templ string, data interface{}) {
  function checkVersion (line 213) | func checkVersion(c *Context) bool {
  function checkHelp (line 225) | func checkHelp(c *Context) bool {
  function checkCommandHelp (line 237) | func checkCommandHelp(c *Context, name string) bool {
  function checkSubcommandHelp (line 246) | func checkSubcommandHelp(c *Context) bool {
  function checkShellCompleteFlag (line 255) | func checkShellCompleteFlag(a *App, arguments []string) (bool, []string) {
  function checkCompletions (line 270) | func checkCompletions(c *Context) bool {
  function checkCommandCompletions (line 287) | func checkCommandCompletions(c *Context, name string) bool {

FILE: vendor/github.com/elazarl/go-bindata-assetfs/assetfs.go
  type FakeFile (line 20) | type FakeFile struct
    method Name (line 29) | func (f *FakeFile) Name() string {
    method Mode (line 34) | func (f *FakeFile) Mode() os.FileMode {
    method ModTime (line 42) | func (f *FakeFile) ModTime() time.Time {
    method Size (line 46) | func (f *FakeFile) Size() int64 {
    method IsDir (line 50) | func (f *FakeFile) IsDir() bool {
    method Sys (line 54) | func (f *FakeFile) Sys() interface{} {
  type AssetFile (line 59) | type AssetFile struct
    method Readdir (line 72) | func (f *AssetFile) Readdir(count int) ([]os.FileInfo, error) {
    method Size (line 76) | func (f *AssetFile) Size() int64 {
    method Stat (line 80) | func (f *AssetFile) Stat() (os.FileInfo, error) {
  function NewAssetFile (line 65) | func NewAssetFile(name string, content []byte) *AssetFile {
  type AssetDirectory (line 85) | type AssetDirectory struct
    method Readdir (line 107) | func (f *AssetDirectory) Readdir(count int) ([]os.FileInfo, error) {
    method Stat (line 119) | func (f *AssetDirectory) Stat() (os.FileInfo, error) {
  function NewAssetDirectory (line 91) | func NewAssetDirectory(name string, children []string, fs *AssetFS) *Ass...
  type AssetFS (line 125) | type AssetFS struct
    method Open (line 134) | func (fs *AssetFS) Open(name string) (http.File, error) {

FILE: vendor/github.com/fatih/structs/field.go
  type Field (line 16) | type Field struct
    method Tag (line 24) | func (f *Field) Tag(key string) string {
    method Value (line 30) | func (f *Field) Value() interface{} {
    method IsEmbedded (line 35) | func (f *Field) IsEmbedded() bool {
    method IsExported (line 40) | func (f *Field) IsExported() bool {
    method IsZero (line 46) | func (f *Field) IsZero() bool {
    method Name (line 54) | func (f *Field) Name() string {
    method Kind (line 59) | func (f *Field) Kind() reflect.Kind {
    method Set (line 66) | func (f *Field) Set(val interface{}) error {
    method Fields (line 95) | func (f *Field) Fields() []*Field {
    method Field (line 101) | func (f *Field) Field(name string) *Field {
    method FieldOk (line 113) | func (f *Field) FieldOk(name string) (*Field, bool) {

FILE: vendor/github.com/fatih/structs/structs.go
  type Struct (line 15) | type Struct struct
    method Map (line 65) | func (s *Struct) Map() map[string]interface{} {
    method Values (line 130) | func (s *Struct) Values() []interface{} {
    method Fields (line 172) | func (s *Struct) Fields() []*Field {
    method Names (line 183) | func (s *Struct) Names() []string {
    method Field (line 225) | func (s *Struct) Field(name string) *Field {
    method FieldOk (line 237) | func (s *Struct) FieldOk(name string) (*Field, bool) {
    method IsZero (line 268) | func (s *Struct) IsZero() bool {
    method HasZero (line 315) | func (s *Struct) HasZero() bool {
    method Name (line 348) | func (s *Struct) Name() string {
    method structFields (line 355) | func (s *Struct) structFields() []reflect.StructField {
  function New (line 23) | func New(s interface{}) *Struct {
  function getFields (line 195) | func getFields(v reflect.Value, tagName string) []*Field {
  function strctVal (line 378) | func strctVal(s interface{}) reflect.Value {
  function Map (line 395) | func Map(s interface{}) map[string]interface{} {
  function Values (line 401) | func Values(s interface{}) []interface{} {
  function Fields (line 407) | func Fields(s interface{}) []*Field {
  function Names (line 413) | func Names(s interface{}) []string {
  function IsZero (line 419) | func IsZero(s interface{}) bool {
  function HasZero (line 425) | func HasZero(s interface{}) bool {
  function IsStruct (line 431) | func IsStruct(s interface{}) bool {
  function Name (line 447) | func Name(s interface{}) string {

FILE: vendor/github.com/fatih/structs/tags.go
  type tagOptions (line 6) | type tagOptions
    method Has (line 9) | func (t tagOptions) Has(opt string) bool {
  function parseTag (line 22) | func parseTag(tag string) (string, tagOptions) {

FILE: vendor/github.com/gorilla/websocket/client.go
  function NewClient (line 33) | func NewClient(netConn net.Conn, u *url.URL, requestHeader http.Header, ...
  type Dialer (line 80) | type Dialer struct
    method Dial (line 168) | func (d *Dialer) Dial(urlStr string, requestHeader http.Header) (*Conn...
  function parseURL (line 104) | func parseURL(s string) (*url.URL, error) {
  function hostPortNoPort (line 141) | func hostPortNoPort(u *url.URL) (hostPort, hostNoPort string) {

FILE: vendor/github.com/gorilla/websocket/conn.go
  constant maxFrameHeaderSize (line 20) | maxFrameHeaderSize         = 2 + 8 + 4
  constant maxControlFramePayloadSize (line 21) | maxControlFramePayloadSize = 125
  constant finalBit (line 22) | finalBit                   = 1 << 7
  constant maskBit (line 23) | maskBit                    = 1 << 7
  constant writeWait (line 24) | writeWait                  = time.Second
  constant defaultReadBufferSize (line 26) | defaultReadBufferSize  = 4096
  constant defaultWriteBufferSize (line 27) | defaultWriteBufferSize = 4096
  constant continuationFrame (line 29) | continuationFrame = 0
  constant noFrame (line 30) | noFrame           = -1
  constant CloseNormalClosure (line 35) | CloseNormalClosure           = 1000
  constant CloseGoingAway (line 36) | CloseGoingAway               = 1001
  constant CloseProtocolError (line 37) | CloseProtocolError           = 1002
  constant CloseUnsupportedData (line 38) | CloseUnsupportedData         = 1003
  constant CloseNoStatusReceived (line 39) | CloseNoStatusReceived        = 1005
  constant CloseAbnormalClosure (line 40) | CloseAbnormalClosure         = 1006
  constant CloseInvalidFramePayloadData (line 41) | CloseInvalidFramePayloadData = 1007
  constant ClosePolicyViolation (line 42) | ClosePolicyViolation         = 1008
  constant CloseMessageTooBig (line 43) | CloseMessageTooBig           = 1009
  constant CloseMandatoryExtension (line 44) | CloseMandatoryExtension      = 1010
  constant CloseInternalServerErr (line 45) | CloseInternalServerErr       = 1011
  constant CloseTLSHandshake (line 46) | CloseTLSHandshake            = 1015
  constant TextMessage (line 53) | TextMessage = 1
  constant BinaryMessage (line 56) | BinaryMessage = 2
  constant CloseMessage (line 61) | CloseMessage = 8
  constant PingMessage (line 65) | PingMessage = 9
  constant PongMessage (line 69) | PongMessage = 10
  type netError (line 81) | type netError struct
    method Error (line 87) | func (e *netError) Error() string   { return e.msg }
    method Temporary (line 88) | func (e *netError) Temporary() bool { return e.temporary }
    method Timeout (line 89) | func (e *netError) Timeout() bool   { return e.timeout }
  type CloseError (line 92) | type CloseError struct
    method Error (line 101) | func (e *CloseError) Error() string {
  function hideTempErr (line 113) | func hideTempErr(err error) error {
  function isControl (line 120) | func isControl(frameType int) bool {
  function isData (line 124) | func isData(frameType int) bool {
  function maskBytes (line 128) | func maskBytes(key [4]byte, pos int, b []byte) int {
  function newMaskKey (line 136) | func newMaskKey() [4]byte {
  type Conn (line 142) | type Conn struct
    method Subprotocol (line 200) | func (c *Conn) Subprotocol() string {
    method Close (line 205) | func (c *Conn) Close() error {
    method LocalAddr (line 210) | func (c *Conn) LocalAddr() net.Addr {
    method RemoteAddr (line 215) | func (c *Conn) RemoteAddr() net.Addr {
    method write (line 221) | func (c *Conn) write(frameType int, deadline time.Time, bufs ...[]byte...
    method WriteControl (line 249) | func (c *Conn) WriteControl(messageType int, data []byte, deadline tim...
    method NextWriter (line 314) | func (c *Conn) NextWriter(messageType int) (io.WriteCloser, error) {
    method flushFrame (line 333) | func (c *Conn) flushFrame(final bool, extra []byte) error {
    method WriteMessage (line 513) | func (c *Conn) WriteMessage(messageType int, data []byte) error {
    method SetWriteDeadline (line 534) | func (c *Conn) SetWriteDeadline(t time.Time) error {
    method readFull (line 542) | func (c *Conn) readFull(p []byte) (err error) {
    method advanceFrame (line 557) | func (c *Conn) advanceFrame() (int, error) {
    method handleProtocolError (line 686) | func (c *Conn) handleProtocolError(message string) error {
    method NextReader (line 699) | func (c *Conn) NextReader() (messageType int, r io.Reader, err error) {
    method ReadMessage (line 766) | func (c *Conn) ReadMessage() (messageType int, p []byte, err error) {
    method SetReadDeadline (line 780) | func (c *Conn) SetReadDeadline(t time.Time) error {
    method SetReadLimit (line 787) | func (c *Conn) SetReadLimit(limit int64) {
    method SetPingHandler (line 793) | func (c *Conn) SetPingHandler(h func(string) error) {
    method SetPongHandler (line 805) | func (c *Conn) SetPongHandler(h func(string) error) {
    method UnderlyingConn (line 814) | func (c *Conn) UnderlyingConn() net.Conn {
  function newConn (line 173) | func newConn(conn net.Conn, isServer bool, readBufferSize, writeBufferSi...
  type messageWriter (line 400) | type messageWriter struct
    method err (line 405) | func (w messageWriter) err() error {
    method ncopy (line 416) | func (w messageWriter) ncopy(max int) (int, error) {
    method write (line 430) | func (w messageWriter) write(final bool, p []byte) (int, error) {
    method Write (line 457) | func (w messageWriter) Write(p []byte) (int, error) {
    method WriteString (line 461) | func (w messageWriter) WriteString(p string) (int, error) {
    method ReadFrom (line 479) | func (w messageWriter) ReadFrom(r io.Reader) (nn int64, err error) {
    method Close (line 504) | func (w messageWriter) Close() error {
  type messageReader (line 717) | type messageReader struct
    method Read (line 722) | func (r messageReader) Read(b []byte) (int, error) {
  function FormatCloseMessage (line 819) | func FormatCloseMessage(closeCode int, text string) []byte {

FILE: vendor/github.com/gorilla/websocket/json.go
  function WriteJSON (line 13) | func WriteJSON(c *Conn, v interface{}) error {
  method WriteJSON (line 21) | func (c *Conn) WriteJSON(v interface{}) error {
  function ReadJSON (line 35) | func ReadJSON(c *Conn, v interface{}) error {
  method ReadJSON (line 44) | func (c *Conn) ReadJSON(v interface{}) error {

FILE: vendor/github.com/gorilla/websocket/server.go
  type HandshakeError (line 18) | type HandshakeError struct
    method Error (line 22) | func (e HandshakeError) Error() string { return e.message }
  type Upgrader (line 26) | type Upgrader struct
    method returnError (line 51) | func (u *Upgrader) returnError(w http.ResponseWriter, r *http.Request,...
    method selectSubprotocol (line 74) | func (u *Upgrader) selectSubprotocol(r *http.Request, responseHeader h...
    method Upgrade (line 95) | func (u *Upgrader) Upgrade(w http.ResponseWriter, r *http.Request, res...
  function checkSameOrigin (line 62) | func checkSameOrigin(r *http.Request) bool {
  function Upgrade (line 223) | func Upgrade(w http.ResponseWriter, r *http.Request, responseHeader http...
  function Subprotocols (line 237) | func Subprotocols(r *http.Request) []string {

FILE: vendor/github.com/gorilla/websocket/util.go
  function tokenListContainsValue (line 18) | func tokenListContainsValue(header http.Header, name string, value strin...
  function computeAcceptKey (line 31) | func computeAcceptKey(challengeKey string) string {
  function generateChallengeKey (line 38) | func generateChallengeKey() (string, error) {

FILE: vendor/github.com/hashicorp/go-multierror/append.go
  function Append (line 9) | func Append(err error, errs ...error) *Error {

FILE: vendor/github.com/hashicorp/go-multierror/flatten.go
  function Flatten (line 5) | func Flatten(err error) error {
  function flatten (line 17) | func flatten(err error, flatErr *Error) {

FILE: vendor/github.com/hashicorp/go-multierror/format.go
  type ErrorFormatFunc (line 10) | type ErrorFormatFunc
  function ListFormatFunc (line 14) | func ListFormatFunc(es []error) string {

FILE: vendor/github.com/hashicorp/go-multierror/multierror.go
  type Error (line 9) | type Error struct
    method Error (line 14) | func (e *Error) Error() string {
    method ErrorOrNil (line 27) | func (e *Error) ErrorOrNil() error {
    method GoString (line 38) | func (e *Error) GoString() string {
    method WrappedErrors (line 49) | func (e *Error) WrappedErrors() []error {

FILE: vendor/github.com/kr/pty/doc.go
  function Open (line 14) | func Open() (pty, tty *os.File, err error) {

FILE: vendor/github.com/kr/pty/ioctl.go
  function ioctl (line 5) | func ioctl(fd, cmd, ptr uintptr) error {

FILE: vendor/github.com/kr/pty/ioctl_bsd.go
  constant _IOC_VOID (line 7) | _IOC_VOID    uintptr = 0x20000000
  constant _IOC_OUT (line 8) | _IOC_OUT     uintptr = 0x40000000
  constant _IOC_IN (line 9) | _IOC_IN      uintptr = 0x80000000
  constant _IOC_IN_OUT (line 10) | _IOC_IN_OUT  uintptr = _IOC_OUT | _IOC_IN
  constant _IOC_DIRMASK (line 11) | _IOC_DIRMASK         = _IOC_VOID | _IOC_OUT | _IOC_IN
  constant _IOC_PARAM_SHIFT (line 13) | _IOC_PARAM_SHIFT = 13
  constant _IOC_PARAM_MASK (line 14) | _IOC_PARAM_MASK  = (1 << _IOC_PARAM_SHIFT) - 1
  function _IOC_PARM_LEN (line 17) | func _IOC_PARM_LEN(ioctl uintptr) uintptr {
  function _IOC (line 21) | func _IOC(inout uintptr, group byte, ioctl_num uintptr, param_len uintpt...
  function _IO (line 25) | func _IO(group byte, ioctl_num uintptr) uintptr {
  function _IOR (line 29) | func _IOR(group byte, ioctl_num uintptr, param_len uintptr) uintptr {
  function _IOW (line 33) | func _IOW(group byte, ioctl_num uintptr, param_len uintptr) uintptr {
  function _IOWR (line 37) | func _IOWR(group byte, ioctl_num uintptr, param_len uintptr) uintptr {

FILE: vendor/github.com/kr/pty/pty_darwin.go
  function open (line 10) | func open() (pty, tty *os.File, err error) {
  function ptsname (line 38) | func ptsname(f *os.File) (string, error) {
  function grantpt (line 54) | func grantpt(f *os.File) error {
  function unlockpt (line 58) | func unlockpt(f *os.File) error {

FILE: vendor/github.com/kr/pty/pty_freebsd.go
  function posix_openpt (line 10) | func posix_openpt(oflag int) (fd int, err error) {
  function open (line 19) | func open() (pty, tty *os.File, err error) {
  function isptmaster (line 38) | func isptmaster(fd uintptr) (bool, error) {
  function ptsname (line 48) | func ptsname(f *os.File) (string, error) {

FILE: vendor/github.com/kr/pty/pty_linux.go
  function open (line 10) | func open() (pty, tty *os.File, err error) {
  function ptsname (line 33) | func ptsname(f *os.File) (string, error) {
  function unlockpt (line 42) | func unlockpt(f *os.File) error {

FILE: vendor/github.com/kr/pty/pty_unsupported.go
  function open (line 9) | func open() (pty, tty *os.File, err error) {

FILE: vendor/github.com/kr/pty/run.go
  function Start (line 12) | func Start(c *exec.Cmd) (pty *os.File, err error) {

FILE: vendor/github.com/kr/pty/types.go
  type _C_int (line 8) | type _C_int
  type _C_uint (line 9) | type _C_uint

FILE: vendor/github.com/kr/pty/types_freebsd.go
  constant _C_SPECNAMELEN (line 12) | _C_SPECNAMELEN = C.SPECNAMELEN
  type fiodgnameArg (line 15) | type fiodgnameArg

FILE: vendor/github.com/kr/pty/util.go
  function Getsize (line 11) | func Getsize(t *os.File) (rows, cols int, err error) {
  type winsize (line 17) | type winsize struct
  function windowrect (line 24) | func windowrect(ws *winsize, fd uintptr) error {

FILE: vendor/github.com/kr/pty/ztypes_386.go
  type _C_int (line 7) | type _C_int
  type _C_uint (line 8) | type _C_uint

FILE: vendor/github.com/kr/pty/ztypes_amd64.go
  type _C_int (line 7) | type _C_int
  type _C_uint (line 8) | type _C_uint

FILE: vendor/github.com/kr/pty/ztypes_arm.go
  type _C_int (line 7) | type _C_int
  type _C_uint (line 8) | type _C_uint

FILE: vendor/github.com/kr/pty/ztypes_arm64.go
  type _C_int (line 9) | type _C_int
  type _C_uint (line 10) | type _C_uint

FILE: vendor/github.com/kr/pty/ztypes_freebsd_386.go
  constant _C_SPECNAMELEN (line 7) | _C_SPECNAMELEN = 0x3f
  type fiodgnameArg (line 10) | type fiodgnameArg struct

FILE: vendor/github.com/kr/pty/ztypes_freebsd_amd64.go
  constant _C_SPECNAMELEN (line 7) | _C_SPECNAMELEN = 0x3f
  type fiodgnameArg (line 10) | type fiodgnameArg struct

FILE: vendor/github.com/kr/pty/ztypes_freebsd_arm.go
  constant _C_SPECNAMELEN (line 7) | _C_SPECNAMELEN = 0x3f
  type fiodgnameArg (line 10) | type fiodgnameArg struct

FILE: vendor/github.com/kr/pty/ztypes_ppc64.go
  type _C_int (line 9) | type _C_int
  type _C_uint (line 10) | type _C_uint

FILE: vendor/github.com/kr/pty/ztypes_ppc64le.go
  type _C_int (line 9) | type _C_int
  type _C_uint (line 10) | type _C_uint

FILE: vendor/github.com/kr/pty/ztypes_s390x.go
  type _C_int (line 9) | type _C_int
  type _C_uint (line 10) | type _C_uint

FILE: vendor/github.com/pkg/errors/errors.go
  function New (line 101) | func New(message string) error {
  function Errorf (line 111) | func Errorf(format string, args ...interface{}) error {
  type fundamental (line 119) | type fundamental struct
    method Error (line 124) | func (f *fundamental) Error() string { return f.msg }
    method Format (line 126) | func (f *fundamental) Format(s fmt.State, verb rune) {
  function WithStack (line 144) | func WithStack(err error) error {
  type withStack (line 154) | type withStack struct
    method Cause (line 159) | func (w *withStack) Cause() error { return w.error }
    method Format (line 161) | func (w *withStack) Format(s fmt.State, verb rune) {
  function Wrap (line 180) | func Wrap(err error, message string) error {
  function Wrapf (line 197) | func Wrapf(err error, format string, args ...interface{}) error {
  function WithMessage (line 213) | func WithMessage(err error, message string) error {
  type withMessage (line 223) | type withMessage struct
    method Error (line 228) | func (w *withMessage) Error() string { return w.msg + ": " + w.cause.E...
    method Cause (line 229) | func (w *withMessage) Cause() error  { return w.cause }
    method Format (line 231) | func (w *withMessage) Format(s fmt.State, verb rune) {
  function Cause (line 256) | func Cause(err error) error {

FILE: vendor/github.com/pkg/errors/stack.go
  type Frame (line 12) | type Frame
    method pc (line 16) | func (f Frame) pc() uintptr { return uintptr(f) - 1 }
    method file (line 20) | func (f Frame) file() string {
    method line (line 31) | func (f Frame) line() int {
    method Format (line 51) | func (f Frame) Format(s fmt.State, verb rune) {
  type StackTrace (line 80) | type StackTrace
    method Format (line 82) | func (st StackTrace) Format(s fmt.State, verb rune) {
  type stack (line 101) | type stack
    method Format (line 103) | func (s *stack) Format(st fmt.State, verb rune) {
    method StackTrace (line 116) | func (s *stack) StackTrace() StackTrace {
  function callers (line 124) | func callers() *stack {
  function funcname (line 133) | func funcname(name string) string {
  function trimGOPATH (line 140) | func trimGOPATH(name, file string) string {

FILE: vendor/github.com/yudai/hcl/decoder.go
  constant tagName (line 15) | tagName = "hcl"
  function Decode (line 19) | func Decode(out interface{}, in string) error {
  function DecodeObject (line 30) | func DecodeObject(out interface{}, n *hcl.Object) error {
  type decoder (line 40) | type decoder struct
    method decode (line 44) | func (d *decoder) decode(name string, o *hcl.Object, result reflect.Va...
    method decodeBool (line 94) | func (d *decoder) decodeBool(name string, o *hcl.Object, result reflec...
    method decodeFloat (line 105) | func (d *decoder) decodeFloat(name string, o *hcl.Object, result refle...
    method decodeInt (line 116) | func (d *decoder) decodeInt(name string, o *hcl.Object, result reflect...
    method decodeInterface (line 134) | func (d *decoder) decodeInterface(name string, o *hcl.Object, result r...
    method decodeMap (line 199) | func (d *decoder) decodeMap(name string, o *hcl.Object, result reflect...
    method decodePtr (line 261) | func (d *decoder) decodePtr(name string, o *hcl.Object, result reflect...
    method decodeSlice (line 280) | func (d *decoder) decodeSlice(name string, o *hcl.Object, result refle...
    method decodeString (line 326) | func (d *decoder) decodeString(name string, o *hcl.Object, result refl...
    method decodeStruct (line 340) | func (d *decoder) decodeStruct(name string, o *hcl.Object, result refl...

FILE: vendor/github.com/yudai/hcl/hcl/lex.go
  constant lexEOF (line 14) | lexEOF = 0
  type hclLex (line 18) | type hclLex struct
    method Lex (line 30) | func (x *hclLex) Lex(yylval *hclSymType) int {
    method consumeComment (line 110) | func (x *hclLex) consumeComment(c rune) bool {
    method lexId (line 170) | func (x *hclLex) lexId(yylval *hclSymType) int {
    method lexHeredoc (line 214) | func (x *hclLex) lexHeredoc(yylval *hclSymType) int {
    method lexNumber (line 294) | func (x *hclLex) lexNumber(yylval *hclSymType) int {
    method lexString (line 343) | func (x *hclLex) lexString(yylval *hclSymType) int {
    method next (line 404) | func (x *hclLex) next() rune {
    method peek (line 427) | func (x *hclLex) peek() rune {
    method backup (line 434) | func (x *hclLex) backup() {
    method createErr (line 440) | func (x *hclLex) createErr(msg string) {
    method Error (line 445) | func (x *hclLex) Error(s string) {

FILE: vendor/github.com/yudai/hcl/hcl/object.go
  type ValueType (line 12) | type ValueType
  constant ValueTypeUnknown (line 15) | ValueTypeUnknown ValueType = iota
  constant ValueTypeFloat (line 16) | ValueTypeFloat
  constant ValueTypeInt (line 17) | ValueTypeInt
  constant ValueTypeString (line 18) | ValueTypeString
  constant ValueTypeBool (line 19) | ValueTypeBool
  constant ValueTypeNil (line 20) | ValueTypeNil
  constant ValueTypeList (line 21) | ValueTypeList
  constant ValueTypeObject (line 22) | ValueTypeObject
  type Object (line 27) | type Object struct
    method GoString (line 35) | func (o *Object) GoString() string {
    method Get (line 43) | func (o *Object) Get(k string, insensitive bool) *Object {
    method Elem (line 62) | func (o *Object) Elem(expand bool) []*Object {
    method Len (line 96) | func (o *Object) Len() (i int) {
  type ObjectList (line 107) | type ObjectList
    method Flat (line 110) | func (l ObjectList) Flat() []*Object {

FILE: vendor/github.com/yudai/hcl/hcl/parse.go
  function Parse (line 16) | func Parse(v string) (*Object, error) {

FILE: vendor/github.com/yudai/hcl/hcl/valuetype_string.go
  constant _ValueType_name (line 7) | _ValueType_name = "ValueTypeUnknownValueTypeFloatValueTypeIntValueTypeSt...
  method String (line 11) | func (i ValueType) String() string {

FILE: vendor/github.com/yudai/hcl/hcl/y.go
  type hclSymType (line 13) | type hclSymType struct
  constant BOOL (line 23) | BOOL = 57346
  constant FLOAT (line 24) | FLOAT = 57347
  constant NUMBER (line 25) | NUMBER = 57348
  constant COMMA (line 26) | COMMA = 57349
  constant IDENTIFIER (line 27) | IDENTIFIER = 57350
  constant EQUAL (line 28) | EQUAL = 57351
  constant NEWLINE (line 29) | NEWLINE = 57352
  constant STRING (line 30) | STRING = 57353
  constant MINUS (line 31) | MINUS = 57354
  constant LEFTBRACE (line 32) | LEFTBRACE = 57355
  constant RIGHTBRACE (line 33) | RIGHTBRACE = 57356
  constant LEFTBRACKET (line 34) | LEFTBRACKET = 57357
  constant RIGHTBRACKET (line 35) | RIGHTBRACKET = 57358
  constant PERIOD (line 36) | PERIOD = 57359
  constant EPLUS (line 37) | EPLUS = 57360
  constant EMINUS (line 38) | EMINUS = 57361
  constant NULL (line 39) | NULL = 57362
  constant hclEofCode (line 65) | hclEofCode = 1
  constant hclErrCode (line 66) | hclErrCode = 2
  constant hclMaxDepth (line 67) | hclMaxDepth = 200
  constant hclNprod (line 84) | hclNprod = 39
  constant hclPrivate (line 85) | hclPrivate = 57344
  constant hclLast (line 90) | hclLast = 69
  type hclLexer (line 173) | type hclLexer interface
  type hclParser (line 178) | type hclParser interface
  type hclParserImpl (line 183) | type hclParserImpl struct
    method Lookahead (line 187) | func (p *hclParserImpl) Lookahead() int {
    method Parse (line 321) | func (hclrcvr *hclParserImpl) Parse(hcllex hclLexer) int {
  function hclNewParser (line 191) | func hclNewParser() hclParser {
  constant hclFlag (line 198) | hclFlag = -1000
  function hclTokname (line 200) | func hclTokname(c int) string {
  function hclStatname (line 209) | func hclStatname(s int) string {
  function hclErrorMessage (line 218) | func hclErrorMessage(state, lookAhead int) string {
  function hcllex1 (line 282) | func hcllex1(lex hclLexer, lval *hclSymType) (char, token int) {
  function hclParse (line 317) | func hclParse(hcllex hclLexer) int {

FILE: vendor/github.com/yudai/hcl/json/lex.go
  constant lexEOF (line 14) | lexEOF = 0
  type jsonLex (line 18) | type jsonLex struct
    method Lex (line 28) | func (x *jsonLex) Lex(yylval *jsonSymType) int {
    method lexId (line 86) | func (x *jsonLex) lexId(yylval *jsonSymType) int {
    method lexNumber (line 126) | func (x *jsonLex) lexNumber(yylval *jsonSymType) int {
    method lexString (line 175) | func (x *jsonLex) lexString(yylval *jsonSymType) int {
    method next (line 213) | func (x *jsonLex) next() rune {
    method peek (line 236) | func (x *jsonLex) peek() rune {
    method backup (line 243) | func (x *jsonLex) backup() {
    method createErr (line 249) | func (x *jsonLex) createErr(msg string) {
    method Error (line 254) | func (x *jsonLex) Error(s string) {

FILE: vendor/github.com/yudai/hcl/json/parse.go
  function Parse (line 17) | func Parse(v string) (*hcl.Object, error) {

FILE: vendor/github.com/yudai/hcl/json/y.go
  type jsonSymType (line 15) | type jsonSymType struct
  constant FLOAT (line 24) | FLOAT = 57346
  constant NUMBER (line 25) | NUMBER = 57347
  constant COLON (line 26) | COLON = 57348
  constant COMMA (line 27) | COMMA = 57349
  constant IDENTIFIER (line 28) | IDENTIFIER = 57350
  constant EQUAL (line 29) | EQUAL = 57351
  constant NEWLINE (line 30) | NEWLINE = 57352
  constant STRING (line 31) | STRING = 57353
  constant LEFTBRACE (line 32) | LEFTBRACE = 57354
  constant RIGHTBRACE (line 33) | RIGHTBRACE = 57355
  constant LEFTBRACKET (line 34) | LEFTBRACKET = 57356
  constant RIGHTBRACKET (line 35) | RIGHTBRACKET = 57357
  constant TRUE (line 36) | TRUE = 57358
  constant FALSE (line 37) | FALSE = 57359
  constant NULL (line 38) | NULL = 57360
  constant MINUS (line 39) | MINUS = 57361
  constant PERIOD (line 40) | PERIOD = 57362
  constant EPLUS (line 41) | EPLUS = 57363
  constant EMINUS (line 42) | EMINUS = 57364
  constant jsonEofCode (line 70) | jsonEofCode = 1
  constant jsonErrCode (line 71) | jsonErrCode = 2
  constant jsonMaxDepth (line 72) | jsonMaxDepth = 200
  constant jsonNprod (line 83) | jsonNprod = 28
  constant jsonPrivate (line 84) | jsonPrivate = 57344
  constant jsonLast (line 89) | jsonLast = 53
  type jsonLexer (line 167) | type jsonLexer interface
  type jsonParser (line 172) | type jsonParser interface
  type jsonParserImpl (line 177) | type jsonParserImpl struct
    method Lookahead (line 181) | func (p *jsonParserImpl) Lookahead() int {
    method Parse (line 315) | func (jsonrcvr *jsonParserImpl) Parse(jsonlex jsonLexer) int {
  function jsonNewParser (line 185) | func jsonNewParser() jsonParser {
  constant jsonFlag (line 192) | jsonFlag = -1000
  function jsonTokname (line 194) | func jsonTokname(c int) string {
  function jsonStatname (line 203) | func jsonStatname(s int) string {
  function jsonErrorMessage (line 212) | func jsonErrorMessage(state, lookAhead int) string {
  function jsonlex1 (line 276) | func jsonlex1(lex jsonLexer, lval *jsonSymType) (char, token int) {
  function jsonParse (line 311) | func jsonParse(jsonlex jsonLexer) int {

FILE: vendor/github.com/yudai/hcl/lex.go
  type lexModeValue (line 7) | type lexModeValue
  constant lexModeUnknown (line 10) | lexModeUnknown lexModeValue = iota
  constant lexModeHcl (line 11) | lexModeHcl
  constant lexModeJson (line 12) | lexModeJson
  function lexMode (line 17) | func lexMode(v string) lexModeValue {

FILE: vendor/github.com/yudai/hcl/parse.go
  function Parse (line 13) | func Parse(input string) (*hcl.Object, error) {

FILE: webtty/master.go
  type Master (line 8) | type Master

FILE: webtty/message_types.go
  constant UnknownInput (line 9) | UnknownInput = '0'
  constant Input (line 11) | Input = '1'
  constant Ping (line 13) | Ping = '2'
  constant ResizeTerminal (line 15) | ResizeTerminal = '3'
  constant UnknownOutput (line 20) | UnknownOutput = '0'
  constant Output (line 22) | Output = '1'
  constant Pong (line 24) | Pong = '2'
  constant SetWindowTitle (line 26) | SetWindowTitle = '3'
  constant SetPreferences (line 28) | SetPreferences = '4'
  constant SetReconnect (line 30) | SetReconnect = '5'

FILE: webtty/option.go
  type Option (line 10) | type Option
  function WithPermitWrite (line 13) | func WithPermitWrite() Option {
  function WithFixedColumns (line 21) | func WithFixedColumns(columns int) Option {
  function WithFixedRows (line 29) | func WithFixedRows(rows int) Option {
  function WithWindowTitle (line 37) | func WithWindowTitle(windowTitle []byte) Option {
  function WithReconnect (line 45) | func WithReconnect(timeInSeconds int) Option {
  function WithMasterPreferences (line 53) | func WithMasterPreferences(preferences interface{}) Option {

FILE: webtty/slave.go
  type Slave (line 8) | type Slave interface

FILE: webtty/webtty.go
  type WebTTY (line 15) | type WebTTY struct
    method Run (line 61) | func (wt *WebTTY) Run(ctx context.Context) error {
    method sendInitializeMessage (line 112) | func (wt *WebTTY) sendInitializeMessage() error {
    method handleSlaveReadEvent (line 136) | func (wt *WebTTY) handleSlaveReadEvent(data []byte) error {
    method masterWrite (line 146) | func (wt *WebTTY) masterWrite(data []byte) error {
    method handleMasterReadEvent (line 158) | func (wt *WebTTY) handleMasterReadEvent(data []byte) error {
  function New (line 36) | func New(masterConn Master, slave Slave, options ...Option) (*WebTTY, er...
  type argResizeTerminal (line 216) | type argResizeTerminal struct

FILE: webtty/webtty_test.go
  type pipePair (line 12) | type pipePair struct
  function TestWriteFromPTY (line 17) | func TestWriteFromPTY(t *testing.T) {
  function TestWriteFromConn (line 71) | func TestWriteFromConn(t *testing.T) {
Condensed preview — 166 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (2,296K chars).
[
  {
    "path": ".github/ISSUE_TEMPLATE.md",
    "chars": 564,
    "preview": "# When file a bug report (see below for feature requests)\n\nPlease answer these quesions for a bug report. Thanks!\n\n### W"
  },
  {
    "path": ".gitignore",
    "chars": 39,
    "preview": "gotty\nbindata\nbuilds\njs/node_modules/*\n"
  },
  {
    "path": ".gotty",
    "chars": 12631,
    "preview": "// [string] Address to listen, all addresses will be used when empty\n// address = \"\"\n\n// [string] Port to listen\n// port"
  },
  {
    "path": "CONTRIBUTING.md",
    "chars": 1870,
    "preview": "# How to contribute\n\nGoTTY is MIT licensed and accepts contributions via GitHub pull requests. We also accepts feature r"
  },
  {
    "path": "Godeps/Godeps.json",
    "chars": 1405,
    "preview": "{\n\t\"ImportPath\": \"github.com/yudai/gotty\",\n\t\"GoVersion\": \"go1.9\",\n\t\"GodepVersion\": \"v79\",\n\t\"Deps\": [\n\t\t{\n\t\t\t\"ImportPath\""
  },
  {
    "path": "Godeps/Readme",
    "chars": 136,
    "preview": "This directory tree is generated automatically by godep.\n\nPlease do not edit.\n\nSee https://github.com/tools/godep for mo"
  },
  {
    "path": "LICENSE",
    "chars": 1085,
    "preview": "The MIT License (MIT)\n\nCopyright (c) 2015-2017 Iwasaki Yudai\n\nPermission is hereby granted, free of charge, to any perso"
  },
  {
    "path": "Makefile",
    "chars": 2598,
    "preview": "OUTPUT_DIR = ./builds\nGIT_COMMIT = `git rev-parse HEAD | cut -c1-7`\nVERSION = 2.0.0-alpha.3\nBUILD_OPTIONS = -ldflags \"-X"
  },
  {
    "path": "README.md",
    "chars": 10400,
    "preview": "# ![](https://raw.githubusercontent.com/yudai/gotty/master/resources/favicon.png) GoTTY - Share your terminal as a web a"
  },
  {
    "path": "backend/doc.go",
    "chars": 16,
    "preview": "package backend\n"
  },
  {
    "path": "backend/localcommand/doc.go",
    "chars": 133,
    "preview": "// Package localcommand provides an implementation of webtty.Slave\n// that launches a local command with a PTY.\npackage "
  },
  {
    "path": "backend/localcommand/factory.go",
    "chars": 1322,
    "preview": "package localcommand\n\nimport (\n\t\"syscall\"\n\t\"time\"\n\n\t\"github.com/yudai/gotty/server\"\n)\n\ntype Options struct {\n\tCloseSigna"
  },
  {
    "path": "backend/localcommand/local_command.go",
    "chars": 2403,
    "preview": "package localcommand\n\nimport (\n\t\"os\"\n\t\"os/exec\"\n\t\"syscall\"\n\t\"time\"\n\t\"unsafe\"\n\n\t\"github.com/kr/pty\"\n\t\"github.com/pkg/erro"
  },
  {
    "path": "backend/localcommand/options.go",
    "chars": 332,
    "preview": "package localcommand\n\nimport (\n\t\"syscall\"\n\t\"time\"\n)\n\ntype Option func(*LocalCommand)\n\nfunc WithCloseSignal(signal syscal"
  },
  {
    "path": "help.go",
    "chars": 329,
    "preview": "package main\n\nvar helpTemplate = `NAME:\n   {{.Name}} - {{.Usage}}\n\nUSAGE:\n   {{.Name}} [options] <command> [<arguments.."
  },
  {
    "path": "js/dist/gotty-bundle.js",
    "chars": 332063,
    "preview": "!function(e){function t(i){if(r[i])return r[i].exports;var o=r[i]={i:i,l:!1,exports:{}};return e[i].call(o.exports,o,o.e"
  },
  {
    "path": "js/dist/hterm.d.ts",
    "chars": 690,
    "preview": "import * as bare from \"libapps\";\nexport declare class Hterm {\n    elem: HTMLElement;\n    term: bare.hterm.Terminal;\n    "
  },
  {
    "path": "js/dist/main.d.ts",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "js/dist/websocket.d.ts",
    "chars": 496,
    "preview": "export declare class ConnectionFactory {\n    url: string;\n    protocols: string[];\n    constructor(url: string, protocol"
  },
  {
    "path": "js/dist/webtty.d.ts",
    "chars": 1552,
    "preview": "export declare const protocols: string[];\nexport declare const msgInputUnknown = \"0\";\nexport declare const msgInput = \"1"
  },
  {
    "path": "js/dist/xterm.d.ts",
    "chars": 763,
    "preview": "import * as bare from \"xterm\";\nimport { lib } from \"libapps\";\nexport declare class Xterm {\n    elem: HTMLElement;\n    te"
  },
  {
    "path": "js/package.json",
    "chars": 331,
    "preview": "{\n    \"devDependencies\": {\n        \"license-loader\": \"^0.5.0\",\n        \"ts-loader\": \"^2.0.3\",\n        \"typescript\": \"^2."
  },
  {
    "path": "js/src/hterm.ts",
    "chars": 2377,
    "preview": "import * as bare from \"libapps\";\n\nexport class Hterm {\n    elem: HTMLElement;\n\n    term: bare.hterm.Terminal;\n    io: ba"
  },
  {
    "path": "js/src/main.ts",
    "chars": 943,
    "preview": "import { Hterm } from \"./hterm\";\nimport { Xterm } from \"./xterm\";\nimport { Terminal, WebTTY, protocols } from \"./webtty\""
  },
  {
    "path": "js/src/websocket.ts",
    "chars": 1203,
    "preview": "export class ConnectionFactory {\n    url: string;\n    protocols: string[];\n\n    constructor(url: string, protocols: stri"
  },
  {
    "path": "js/src/webtty.ts",
    "chars": 4563,
    "preview": "export const protocols = [\"webtty\"];\n\nexport const msgInputUnknown = '0';\nexport const msgInput = '1';\nexport const msgP"
  },
  {
    "path": "js/src/xterm.ts",
    "chars": 2541,
    "preview": "import * as bare from \"xterm\";\nimport { lib } from \"libapps\"\n\n\nbare.loadAddon(\"fit\");\n\nexport class Xterm {\n    elem: HT"
  },
  {
    "path": "js/tsconfig.json",
    "chars": 405,
    "preview": "{\n  \"compilerOptions\": {\n      \"strictNullChecks\": true,\n      \"noUnusedLocals\" : true,\n      \"noImplicitThis\": true,\n  "
  },
  {
    "path": "js/typings/libapps/index.d.ts",
    "chars": 1192,
    "preview": "export declare namespace hterm {\n    export class Terminal {\n        io: IO;\n        onTerminalReady: () => void;\n\n     "
  },
  {
    "path": "js/webpack.config.js",
    "chars": 645,
    "preview": "const UglifyJSPlugin = require('uglifyjs-webpack-plugin');\n\nmodule.exports = {\n    entry: \"./src/main.ts\",\n    output: {"
  },
  {
    "path": "main.go",
    "chars": 3173,
    "preview": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n\t\"os/signal\"\n\t\"strings\"\n\t\"syscall\"\n\n\t\"github.com/codegangsta/cli\"\n"
  },
  {
    "path": "pkg/homedir/expand.go",
    "chars": 160,
    "preview": "package homedir\n\nimport (\n\t\"os\"\n)\n\nfunc Expand(path string) string {\n\tif path[0:2] == \"~/\" {\n\t\treturn os.Getenv(\"HOME\") "
  },
  {
    "path": "pkg/randomstring/generate.go",
    "chars": 308,
    "preview": "package randomstring\n\nimport (\n\t\"crypto/rand\"\n\t\"math/big\"\n\t\"strconv\"\n)\n\nfunc Generate(length int) string {\n\tconst base ="
  },
  {
    "path": "resources/index.css",
    "chars": 116,
    "preview": "html, body, #terminal {\n    background: black;\n    height: 100%;\n    width: 100%;\n    padding: 0%;\n    margin: 0%;\n}"
  },
  {
    "path": "resources/index.html",
    "chars": 491,
    "preview": "<!doctype html>\n<html>\n  <head>\n    <title>{{ .title }}</title>\n    <link rel=\"icon\" type=\"image/png\" href=\"favicon.png\""
  },
  {
    "path": "resources/xterm_customize.css",
    "chars": 550,
    "preview": ".terminal {\n    font-family: \"DejaVu Sans Mono\", \"Everson Mono\", FreeMono, Menlo, Terminal, monospace, \"Apple Symbols\";\n"
  },
  {
    "path": "server/asset.go",
    "chars": 1155010,
    "preview": "// Code generated by go-bindata.\n// sources:\n// bindata/static/css/index.css\n// bindata/static/css/xterm.css\n// bindata/"
  },
  {
    "path": "server/handler_atomic.go",
    "chars": 1231,
    "preview": "package server\n\nimport (\n\t\"sync\"\n\t\"time\"\n)\n\ntype counter struct {\n\tduration    time.Duration\n\tzeroTimer   *time.Timer\n\tw"
  },
  {
    "path": "server/handlers.go",
    "chars": 5833,
    "preview": "package server\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"log\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"sync/atomic\"\n\n\t\"git"
  },
  {
    "path": "server/init_message.go",
    "chars": 138,
    "preview": "package server\n\ntype InitMessage struct {\n\tArguments string `json:\"Arguments,omitempty\"`\n\tAuthToken string `json:\"AuthTo"
  },
  {
    "path": "server/list_address.go",
    "chars": 498,
    "preview": "package server\n\nimport (\n\t\"net\"\n)\n\nfunc listAddresses() (addresses []string) {\n\tifaces, err := net.Interfaces()\n\tif err "
  },
  {
    "path": "server/log_response_writer.go",
    "chars": 421,
    "preview": "package server\n\nimport (\n\t\"bufio\"\n\t\"net\"\n\t\"net/http\"\n)\n\ntype logResponseWriter struct {\n\thttp.ResponseWriter\n\tstatus int"
  },
  {
    "path": "server/middleware.go",
    "chars": 1466,
    "preview": "package server\n\nimport (\n\t\"encoding/base64\"\n\t\"log\"\n\t\"net/http\"\n\t\"strings\"\n)\n\nfunc (server *Server) wrapLogger(handler ht"
  },
  {
    "path": "server/options.go",
    "chars": 10605,
    "preview": "package server\n\nimport (\n\t\"github.com/pkg/errors\"\n)\n\ntype Options struct {\n\tAddress             string           `hcl:\"a"
  },
  {
    "path": "server/run_option.go",
    "chars": 474,
    "preview": "package server\n\nimport (\n\t\"context\"\n)\n\n// RunOptions holds a set of configurations for Server.Run().\ntype RunOptions str"
  },
  {
    "path": "server/server.go",
    "chars": 6845,
    "preview": "package server\n\nimport (\n\t\"context\"\n\t\"crypto/tls\"\n\t\"crypto/x509\"\n\t\"html/template\"\n\t\"io/ioutil\"\n\t\"log\"\n\t\"net\"\n\t\"net/http\""
  },
  {
    "path": "server/slave.go",
    "chars": 262,
    "preview": "package server\n\nimport (\n\t\"github.com/yudai/gotty/webtty\"\n)\n\n// Slave is webtty.Slave with some additional methods.\ntype"
  },
  {
    "path": "server/ws_wrapper.go",
    "chars": 546,
    "preview": "package server\n\nimport (\n\t\"github.com/gorilla/websocket\"\n)\n\ntype wsWrapper struct {\n\t*websocket.Conn\n}\n\nfunc (wsw *wsWra"
  },
  {
    "path": "utils/default.go",
    "chars": 773,
    "preview": "package utils\n\nimport (\n\t\"fmt\"\n\t\"github.com/fatih/structs\"\n\t\"reflect\"\n\t\"strconv\"\n)\n\nfunc ApplyDefaultValues(struct_ inte"
  },
  {
    "path": "utils/flags.go",
    "chars": 2547,
    "preview": "package utils\n\nimport (\n\t\"io/ioutil\"\n\t\"log\"\n\t\"os\"\n\t\"reflect\"\n\t\"strings\"\n\n\t\"github.com/codegangsta/cli\"\n\t\"github.com/fati"
  },
  {
    "path": "vendor/github.com/NYTimes/gziphandler/.gitignore",
    "chars": 6,
    "preview": "*.swp\n"
  },
  {
    "path": "vendor/github.com/NYTimes/gziphandler/.travis.yml",
    "chars": 42,
    "preview": "language: go\n\ngo:\n  - 1.7\n  - 1.8\n  - tip\n"
  },
  {
    "path": "vendor/github.com/NYTimes/gziphandler/CODE_OF_CONDUCT.md",
    "chars": 7405,
    "preview": "---\nlayout: code-of-conduct\nversion: v1.0\n---\n\nThis code of conduct outlines our expectations for participants within th"
  },
  {
    "path": "vendor/github.com/NYTimes/gziphandler/CONTRIBUTING.md",
    "chars": 1301,
    "preview": "# Contributing to NYTimes/gziphandler\n\nThis is an open source project started by handful of developers at The New York T"
  },
  {
    "path": "vendor/github.com/NYTimes/gziphandler/LICENSE.md",
    "chars": 577,
    "preview": "Copyright (c) 2015 The New York Times Company\n \nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may "
  },
  {
    "path": "vendor/github.com/NYTimes/gziphandler/README.md",
    "chars": 1099,
    "preview": "Gzip Handler\n============\n\nThis is a tiny Go package which wraps HTTP handlers to transparently gzip the\nresponse body, "
  },
  {
    "path": "vendor/github.com/NYTimes/gziphandler/gzip.go",
    "chars": 11714,
    "preview": "package gziphandler\n\nimport (\n\t\"bufio\"\n\t\"compress/gzip\"\n\t\"fmt\"\n\t\"io\"\n\t\"net\"\n\t\"net/http\"\n\t\"strconv\"\n\t\"strings\"\n\t\"sync\"\n)\n"
  },
  {
    "path": "vendor/github.com/NYTimes/gziphandler/gzip_go18.go",
    "chars": 1071,
    "preview": "// +build go1.8\n\npackage gziphandler\n\nimport \"net/http\"\n\n// Push initiates an HTTP/2 server push.\n// Push returns ErrNot"
  },
  {
    "path": "vendor/github.com/codegangsta/cli/.gitignore",
    "chars": 29,
    "preview": "*.coverprofile\nnode_modules/\n"
  },
  {
    "path": "vendor/github.com/codegangsta/cli/.travis.yml",
    "chars": 521,
    "preview": "language: go\n\nsudo: false\n\ncache:\n  directories:\n  - node_modules\n\ngo:\n- 1.2.x\n- 1.3.x\n- 1.4.2\n- 1.5.x\n- 1.6.x\n- 1.7.x\n-"
  },
  {
    "path": "vendor/github.com/codegangsta/cli/CHANGELOG.md",
    "chars": 14324,
    "preview": "# Change Log\n\n**ATTN**: This project uses [semantic versioning](http://semver.org/).\n\n## [Unreleased]\n\n## [1.19.1] - 201"
  },
  {
    "path": "vendor/github.com/codegangsta/cli/LICENSE",
    "chars": 1084,
    "preview": "MIT License\n\nCopyright (c) 2016 Jeremy Saenz & Contributors\n\nPermission is hereby granted, free of charge, to any person"
  },
  {
    "path": "vendor/github.com/codegangsta/cli/README.md",
    "chars": 31486,
    "preview": "cli\n===\n\n[![Build Status](https://travis-ci.org/urfave/cli.svg?branch=master)](https://travis-ci.org/urfave/cli)\n[![Wind"
  },
  {
    "path": "vendor/github.com/codegangsta/cli/app.go",
    "chars": 12166,
    "preview": "package cli\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"sort\"\n\t\"time\"\n)\n\nvar (\n\tchangeLogURL           "
  },
  {
    "path": "vendor/github.com/codegangsta/cli/appveyor.yml",
    "chars": 434,
    "preview": "version: \"{build}\"\n\nos: Windows Server 2012 R2\n\nclone_folder: c:\\gopath\\src\\github.com\\urfave\\cli\n\nenvironment:\n  GOPATH"
  },
  {
    "path": "vendor/github.com/codegangsta/cli/category.go",
    "chars": 1089,
    "preview": "package cli\n\n// CommandCategories is a slice of *CommandCategory.\ntype CommandCategories []*CommandCategory\n\n// CommandC"
  },
  {
    "path": "vendor/github.com/codegangsta/cli/cli.go",
    "chars": 701,
    "preview": "// Package cli provides a minimal framework for creating and organizing command line\n// Go applications. cli is designed"
  },
  {
    "path": "vendor/github.com/codegangsta/cli/command.go",
    "chars": 7056,
    "preview": "package cli\n\nimport (\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"sort\"\n\t\"strings\"\n)\n\n// Command is a subcommand for a cli.App.\ntype Command s"
  },
  {
    "path": "vendor/github.com/codegangsta/cli/context.go",
    "chars": 6430,
    "preview": "package cli\n\nimport (\n\t\"errors\"\n\t\"flag\"\n\t\"reflect\"\n\t\"strings\"\n\t\"syscall\"\n)\n\n// Context is a type that is passed through "
  },
  {
    "path": "vendor/github.com/codegangsta/cli/errors.go",
    "chars": 2525,
    "preview": "package cli\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strings\"\n)\n\n// OsExiter is the function used when the app exits. If not set d"
  },
  {
    "path": "vendor/github.com/codegangsta/cli/flag-types.json",
    "chars": 2188,
    "preview": "[\n  {\n    \"name\": \"Bool\",\n    \"type\": \"bool\",\n    \"value\": false,\n    \"context_default\": \"false\",\n    \"parser\": \"strconv"
  },
  {
    "path": "vendor/github.com/codegangsta/cli/flag.go",
    "chars": 19946,
    "preview": "package cli\n\nimport (\n\t\"flag\"\n\t\"fmt\"\n\t\"reflect\"\n\t\"runtime\"\n\t\"strconv\"\n\t\"strings\"\n\t\"syscall\"\n\t\"time\"\n)\n\nconst defaultPlac"
  },
  {
    "path": "vendor/github.com/codegangsta/cli/flag_generated.go",
    "chars": 13862,
    "preview": "package cli\n\nimport (\n\t\"flag\"\n\t\"strconv\"\n\t\"time\"\n)\n\n// WARNING: This file is generated!\n\n// BoolFlag is a flag with type"
  },
  {
    "path": "vendor/github.com/codegangsta/cli/funcs.go",
    "chars": 1264,
    "preview": "package cli\n\n// BashCompleteFunc is an action to execute when the bash-completion flag is set\ntype BashCompleteFunc func"
  },
  {
    "path": "vendor/github.com/codegangsta/cli/generate-flag-types",
    "chars": 8183,
    "preview": "#!/usr/bin/env python\n\"\"\"\nThe flag types that ship with the cli library have many things in common, and\nso we can take a"
  },
  {
    "path": "vendor/github.com/codegangsta/cli/help.go",
    "chars": 7326,
    "preview": "package cli\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strings\"\n\t\"text/tabwriter\"\n\t\"text/template\"\n)\n\n// AppHelpTemplate is the text"
  },
  {
    "path": "vendor/github.com/codegangsta/cli/runtests",
    "chars": 2929,
    "preview": "#!/usr/bin/env python\nfrom __future__ import print_function\n\nimport argparse\nimport os\nimport sys\nimport tempfile\n\nfrom "
  },
  {
    "path": "vendor/github.com/elazarl/go-bindata-assetfs/LICENSE",
    "chars": 1299,
    "preview": "Copyright (c) 2014, Elazar Leibovich\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or wi"
  },
  {
    "path": "vendor/github.com/elazarl/go-bindata-assetfs/README.md",
    "chars": 1269,
    "preview": "# go-bindata-assetfs\n\nServe embedded files from [jteeuwen/go-bindata](https://github.com/jteeuwen/go-bindata) with `net/"
  },
  {
    "path": "vendor/github.com/elazarl/go-bindata-assetfs/assetfs.go",
    "chars": 3166,
    "preview": "package assetfs\n\nimport (\n\t\"bytes\"\n\t\"errors\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"net/http\"\n\t\"os\"\n\t\"path\"\n\t\"path/filepath\"\n\t\"time\"\n)\n\nva"
  },
  {
    "path": "vendor/github.com/elazarl/go-bindata-assetfs/doc.go",
    "chars": 459,
    "preview": "// assetfs allows packages to serve static content embedded\n// with the go-bindata tool with the standard net/http packa"
  },
  {
    "path": "vendor/github.com/fatih/structs/.gitignore",
    "chars": 259,
    "preview": "# Compiled Object files, Static and Dynamic libs (Shared Objects)\n*.o\n*.a\n*.so\n\n# Folders\n_obj\n_test\n\n# Architecture spe"
  },
  {
    "path": "vendor/github.com/fatih/structs/.travis.yml",
    "chars": 420,
    "preview": "language: go\ngo: 1.3\nbefore_install:\n- go get github.com/axw/gocov/gocov\n- go get github.com/mattn/goveralls\n- go get co"
  },
  {
    "path": "vendor/github.com/fatih/structs/LICENSE",
    "chars": 1078,
    "preview": "The MIT License (MIT)\n\nCopyright (c) 2014 Fatih Arslan\n\nPermission is hereby granted, free of charge, to any person obta"
  },
  {
    "path": "vendor/github.com/fatih/structs/README.md",
    "chars": 4584,
    "preview": "# Structs [![GoDoc](http://img.shields.io/badge/go-documentation-blue.svg?style=flat-square)](http://godoc.org/github.co"
  },
  {
    "path": "vendor/github.com/fatih/structs/field.go",
    "chars": 3285,
    "preview": "package structs\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"reflect\"\n)\n\nvar (\n\terrNotExported = errors.New(\"field is not exported\")\n\ter"
  },
  {
    "path": "vendor/github.com/fatih/structs/structs.go",
    "chars": 11941,
    "preview": "// Package structs contains various utilities functions to work with structs.\npackage structs\n\nimport \"reflect\"\n\nvar (\n\t"
  },
  {
    "path": "vendor/github.com/fatih/structs/tags.go",
    "chars": 696,
    "preview": "package structs\n\nimport \"strings\"\n\n// tagOptions contains a slice of tag options\ntype tagOptions []string\n\n// Has return"
  },
  {
    "path": "vendor/github.com/gorilla/websocket/.gitignore",
    "chars": 252,
    "preview": "# Compiled Object files, Static and Dynamic libs (Shared Objects)\n*.o\n*.a\n*.so\n\n# Folders\n_obj\n_test\n\n# Architecture spe"
  },
  {
    "path": "vendor/github.com/gorilla/websocket/.travis.yml",
    "chars": 42,
    "preview": "language: go\n\ngo:\n  - 1.1\n  - 1.2\n  - tip\n"
  },
  {
    "path": "vendor/github.com/gorilla/websocket/AUTHORS",
    "chars": 190,
    "preview": "# This is the official list of Gorilla WebSocket authors for copyright\n# purposes.\n#\n# Please keep the list sorted.\n\nGar"
  },
  {
    "path": "vendor/github.com/gorilla/websocket/LICENSE",
    "chars": 1312,
    "preview": "Copyright (c) 2013 The Gorilla WebSocket Authors. All rights reserved.\n\nRedistribution and use in source and binary form"
  },
  {
    "path": "vendor/github.com/gorilla/websocket/README.md",
    "chars": 3598,
    "preview": "# Gorilla WebSocket\n\nGorilla WebSocket is a [Go](http://golang.org/) implementation of the\n[WebSocket](http://www.rfc-ed"
  },
  {
    "path": "vendor/github.com/gorilla/websocket/client.go",
    "chars": 7516,
    "preview": "// Copyright 2013 The Gorilla WebSocket Authors. All rights reserved.\n// Use of this source code is governed by a BSD-st"
  },
  {
    "path": "vendor/github.com/gorilla/websocket/conn.go",
    "chars": 20549,
    "preview": "// Copyright 2013 The Gorilla WebSocket Authors. All rights reserved.\n// Use of this source code is governed by a BSD-st"
  },
  {
    "path": "vendor/github.com/gorilla/websocket/doc.go",
    "chars": 5546,
    "preview": "// Copyright 2013 The Gorilla WebSocket Authors. All rights reserved.\n// Use of this source code is governed by a BSD-st"
  },
  {
    "path": "vendor/github.com/gorilla/websocket/json.go",
    "chars": 1373,
    "preview": "// Copyright 2013 The Gorilla WebSocket Authors. All rights reserved.\n// Use of this source code is governed by a BSD-st"
  },
  {
    "path": "vendor/github.com/gorilla/websocket/server.go",
    "chars": 8008,
    "preview": "// Copyright 2013 The Gorilla WebSocket Authors. All rights reserved.\n// Use of this source code is governed by a BSD-st"
  },
  {
    "path": "vendor/github.com/gorilla/websocket/util.go",
    "chars": 1078,
    "preview": "// Copyright 2013 The Gorilla WebSocket Authors. All rights reserved.\n// Use of this source code is governed by a BSD-st"
  },
  {
    "path": "vendor/github.com/hashicorp/go-multierror/LICENSE",
    "chars": 15884,
    "preview": "Mozilla Public License, version 2.0\n\n1. Definitions\n\n1.1. “Contributor”\n\n     means each individual or legal entity that"
  },
  {
    "path": "vendor/github.com/hashicorp/go-multierror/README.md",
    "chars": 2449,
    "preview": "# go-multierror\n\n`go-multierror` is a package for Go that provides a mechanism for\nrepresenting a list of `error` values"
  },
  {
    "path": "vendor/github.com/hashicorp/go-multierror/append.go",
    "chars": 740,
    "preview": "package multierror\n\n// Append is a helper function that will append more errors\n// onto an Error in order to create a la"
  },
  {
    "path": "vendor/github.com/hashicorp/go-multierror/flatten.go",
    "chars": 568,
    "preview": "package multierror\n\n// Flatten flattens the given error, merging any *Errors together into\n// a single *Error.\nfunc Flat"
  },
  {
    "path": "vendor/github.com/hashicorp/go-multierror/format.go",
    "chars": 580,
    "preview": "package multierror\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\n// ErrorFormatFunc is a function callback that is called by Error to\n/"
  },
  {
    "path": "vendor/github.com/hashicorp/go-multierror/multierror.go",
    "chars": 1265,
    "preview": "package multierror\n\nimport (\n\t\"fmt\"\n)\n\n// Error is an error type to track multiple errors. This is used to\n// accumulate"
  },
  {
    "path": "vendor/github.com/kr/pty/.gitignore",
    "chars": 27,
    "preview": "[568].out\n_go*\n_test*\n_obj\n"
  },
  {
    "path": "vendor/github.com/kr/pty/License",
    "chars": 1056,
    "preview": "Copyright (c) 2011 Keith Rarick\n\nPermission is hereby granted, free of charge, to any person\nobtaining a copy of this so"
  },
  {
    "path": "vendor/github.com/kr/pty/README.md",
    "chars": 469,
    "preview": "# pty\n\nPty is a Go package for using unix pseudo-terminals.\n\n## Install\n\n    go get github.com/kr/pty\n\n## Example\n\n```go"
  },
  {
    "path": "vendor/github.com/kr/pty/doc.go",
    "chars": 349,
    "preview": "// Package pty provides functions for working with Unix terminals.\npackage pty\n\nimport (\n\t\"errors\"\n\t\"os\"\n)\n\n// ErrUnsupp"
  },
  {
    "path": "vendor/github.com/kr/pty/ioctl.go",
    "chars": 174,
    "preview": "package pty\n\nimport \"syscall\"\n\nfunc ioctl(fd, cmd, ptr uintptr) error {\n\t_, _, e := syscall.Syscall(syscall.SYS_IOCTL, f"
  },
  {
    "path": "vendor/github.com/kr/pty/ioctl_bsd.go",
    "chars": 1103,
    "preview": "// +build darwin dragonfly freebsd netbsd openbsd\n\npackage pty\n\n// from <sys/ioccom.h>\nconst (\n\t_IOC_VOID    uintptr = 0"
  },
  {
    "path": "vendor/github.com/kr/pty/mktypes.bash",
    "chars": 311,
    "preview": "#!/usr/bin/env bash\n\nGOOSARCH=\"${GOOS}_${GOARCH}\"\ncase \"$GOOSARCH\" in\n_* | *_ | _)\n\techo 'undefined $GOOS_$GOARCH:' \"$GO"
  },
  {
    "path": "vendor/github.com/kr/pty/pty_darwin.go",
    "chars": 1024,
    "preview": "package pty\n\nimport (\n\t\"errors\"\n\t\"os\"\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nfunc open() (pty, tty *os.File, err error) {\n\tp, err := os"
  },
  {
    "path": "vendor/github.com/kr/pty/pty_freebsd.go",
    "chars": 1388,
    "preview": "package pty\n\nimport (\n\t\"errors\"\n\t\"os\"\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nfunc posix_openpt(oflag int) (fd int, err error) {\n\tr0, _,"
  },
  {
    "path": "vendor/github.com/kr/pty/pty_linux.go",
    "chars": 866,
    "preview": "package pty\n\nimport (\n\t\"os\"\n\t\"strconv\"\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nfunc open() (pty, tty *os.File, err error) {\n\tp, err := o"
  },
  {
    "path": "vendor/github.com/kr/pty/pty_unsupported.go",
    "chars": 146,
    "preview": "// +build !linux,!darwin,!freebsd\n\npackage pty\n\nimport (\n\t\"os\"\n)\n\nfunc open() (pty, tty *os.File, err error) {\n\treturn n"
  },
  {
    "path": "vendor/github.com/kr/pty/run.go",
    "chars": 546,
    "preview": "package pty\n\nimport (\n\t\"os\"\n\t\"os/exec\"\n\t\"syscall\"\n)\n\n// Start assigns a pseudo-terminal tty os.File to c.Stdin, c.Stdout"
  },
  {
    "path": "vendor/github.com/kr/pty/types.go",
    "chars": 83,
    "preview": "// +build ignore\n\npackage pty\n\nimport \"C\"\n\ntype (\n\t_C_int  C.int\n\t_C_uint C.uint\n)\n"
  },
  {
    "path": "vendor/github.com/kr/pty/types_freebsd.go",
    "chars": 210,
    "preview": "// +build ignore\n\npackage pty\n\n/*\n#include <sys/param.h>\n#include <sys/filio.h>\n*/\nimport \"C\"\n\nconst (\n\t_C_SPECNAMELEN ="
  },
  {
    "path": "vendor/github.com/kr/pty/util.go",
    "chars": 625,
    "preview": "package pty\n\nimport (\n\t\"os\"\n\t\"syscall\"\n\t\"unsafe\"\n)\n\n// Getsize returns the number of rows (lines) and cols (positions\n//"
  },
  {
    "path": "vendor/github.com/kr/pty/ztypes_386.go",
    "chars": 118,
    "preview": "// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs types.go\n\npackage pty\n\ntype (\n\t_C_int  int32\n\t_C_uint uint32\n)\n"
  },
  {
    "path": "vendor/github.com/kr/pty/ztypes_amd64.go",
    "chars": 118,
    "preview": "// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs types.go\n\npackage pty\n\ntype (\n\t_C_int  int32\n\t_C_uint uint32\n)\n"
  },
  {
    "path": "vendor/github.com/kr/pty/ztypes_arm.go",
    "chars": 118,
    "preview": "// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs types.go\n\npackage pty\n\ntype (\n\t_C_int  int32\n\t_C_uint uint32\n)\n"
  },
  {
    "path": "vendor/github.com/kr/pty/ztypes_arm64.go",
    "chars": 135,
    "preview": "// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs types.go\n\n// +build arm64\n\npackage pty\n\ntype (\n\t_C_int  int32\n\t_C"
  },
  {
    "path": "vendor/github.com/kr/pty/ztypes_freebsd_386.go",
    "chars": 171,
    "preview": "// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs types_freebsd.go\n\npackage pty\n\nconst (\n\t_C_SPECNAMELEN = 0x3f\n)\n\n"
  },
  {
    "path": "vendor/github.com/kr/pty/ztypes_freebsd_amd64.go",
    "chars": 202,
    "preview": "// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs types_freebsd.go\n\npackage pty\n\nconst (\n\t_C_SPECNAMELEN = 0x3f\n)\n\n"
  },
  {
    "path": "vendor/github.com/kr/pty/ztypes_freebsd_arm.go",
    "chars": 171,
    "preview": "// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs types_freebsd.go\n\npackage pty\n\nconst (\n\t_C_SPECNAMELEN = 0x3f\n)\n\n"
  },
  {
    "path": "vendor/github.com/kr/pty/ztypes_ppc64.go",
    "chars": 135,
    "preview": "// +build ppc64\n\n// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs types.go\n\npackage pty\n\ntype (\n\t_C_int  int32\n\t_C"
  },
  {
    "path": "vendor/github.com/kr/pty/ztypes_ppc64le.go",
    "chars": 137,
    "preview": "// +build ppc64le\n\n// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs types.go\n\npackage pty\n\ntype (\n\t_C_int  int32\n\t"
  },
  {
    "path": "vendor/github.com/kr/pty/ztypes_s390x.go",
    "chars": 135,
    "preview": "// +build s390x\n\n// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs types.go\n\npackage pty\n\ntype (\n\t_C_int  int32\n\t_C"
  },
  {
    "path": "vendor/github.com/pkg/errors/.gitignore",
    "chars": 266,
    "preview": "# Compiled Object files, Static and Dynamic libs (Shared Objects)\n*.o\n*.a\n*.so\n\n# Folders\n_obj\n_test\n\n# Architecture spe"
  },
  {
    "path": "vendor/github.com/pkg/errors/.travis.yml",
    "chars": 133,
    "preview": "language: go\ngo_import_path: github.com/pkg/errors\ngo:\n  - 1.4.3\n  - 1.5.4\n  - 1.6.3\n  - 1.7.3\n  - tip\n\nscript:\n  - go t"
  },
  {
    "path": "vendor/github.com/pkg/errors/LICENSE",
    "chars": 1312,
    "preview": "Copyright (c) 2015, Dave Cheney <dave@cheney.net>\nAll rights reserved.\n\nRedistribution and use in source and binary form"
  },
  {
    "path": "vendor/github.com/pkg/errors/README.md",
    "chars": 2242,
    "preview": "# errors [![Travis-CI](https://travis-ci.org/pkg/errors.svg)](https://travis-ci.org/pkg/errors) [![AppVeyor](https://ci."
  },
  {
    "path": "vendor/github.com/pkg/errors/appveyor.yml",
    "chars": 639,
    "preview": "version: build-{build}.{branch}\n\nclone_folder: C:\\gopath\\src\\github.com\\pkg\\errors\nshallow_clone: true # for startup spe"
  },
  {
    "path": "vendor/github.com/pkg/errors/errors.go",
    "chars": 6838,
    "preview": "// Package errors provides simple error handling primitives.\n//\n// The traditional error handling idiom in Go is roughly"
  },
  {
    "path": "vendor/github.com/pkg/errors/stack.go",
    "chars": 4412,
    "preview": "package errors\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"path\"\n\t\"runtime\"\n\t\"strings\"\n)\n\n// Frame represents a program counter inside a st"
  },
  {
    "path": "vendor/github.com/yudai/hcl/.gitignore",
    "chars": 10,
    "preview": "y.output\r\n"
  },
  {
    "path": "vendor/github.com/yudai/hcl/LICENSE",
    "chars": 15885,
    "preview": "Mozilla Public License, version 2.0\n\n1. Definitions\n\n1.1. “Contributor”\n\n     means each individual or legal entity that"
  },
  {
    "path": "vendor/github.com/yudai/hcl/Makefile",
    "chars": 246,
    "preview": "TEST?=./...\r\n\r\ndefault: test\r\n\r\nfmt: generate\r\n\tgo fmt ./...\r\n\r\ntest: generate\r\n\tgo test $(TEST) $(TESTARGS)\r\n\r\ngenerate"
  },
  {
    "path": "vendor/github.com/yudai/hcl/README.md",
    "chars": 3342,
    "preview": "# HCL\n\nHCL (HashiCorp Configuration Language) is a configuration language built\nby HashiCorp. The goal of HCL is to buil"
  },
  {
    "path": "vendor/github.com/yudai/hcl/decoder.go",
    "chars": 12026,
    "preview": "package hcl\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"reflect\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n\n\t\"github.com/yudai/hcl/hcl\"\n)\n\n// This "
  },
  {
    "path": "vendor/github.com/yudai/hcl/hcl/lex.go",
    "chars": 7392,
    "preview": "package hcl\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"strconv\"\n\t\"unicode\"\n\t\"unicode/utf8\"\n)\n\n//go:generate go tool yacc -p \"hcl\" parse"
  },
  {
    "path": "vendor/github.com/yudai/hcl/hcl/object.go",
    "chars": 2325,
    "preview": "package hcl\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\n//go:generate stringer -type=ValueType\n\n// ValueType is an enum represnting t"
  },
  {
    "path": "vendor/github.com/yudai/hcl/hcl/parse.go",
    "chars": 715,
    "preview": "package hcl\n\nimport (\n\t\"sync\"\n\n\t\"github.com/hashicorp/go-multierror\"\n)\n\n// hclErrors are the errors built up from parsin"
  },
  {
    "path": "vendor/github.com/yudai/hcl/hcl/parse.y",
    "chars": 3311,
    "preview": "// This is the yacc input for creating the parser for HCL.\n\n%{\npackage hcl\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n)\n\n%}\n\n%union {\n\t"
  },
  {
    "path": "vendor/github.com/yudai/hcl/hcl/valuetype_string.go",
    "chars": 487,
    "preview": "// generated by stringer -type=ValueType; DO NOT EDIT\n\npackage hcl\n\nimport \"fmt\"\n\nconst _ValueType_name = \"ValueTypeUnkn"
  },
  {
    "path": "vendor/github.com/yudai/hcl/hcl/y.go",
    "chars": 15455,
    "preview": "//line parse.y:4\npackage hcl\n\nimport __yyfmt__ \"fmt\"\n\n//line parse.y:4\nimport (\n\t\"fmt\"\n\t\"strconv\"\n)\n\n//line parse.y:13\nt"
  },
  {
    "path": "vendor/github.com/yudai/hcl/hcl.go",
    "chars": 490,
    "preview": "// hcl is a package for decoding HCL into usable Go structures.\n//\n// hcl input can come in either pure HCL format or JS"
  },
  {
    "path": "vendor/github.com/yudai/hcl/json/lex.go",
    "chars": 4210,
    "preview": "package json\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"strconv\"\n\t\"unicode\"\n\t\"unicode/utf8\"\n)\n\n//go:generate go tool yacc -p \"json\" par"
  },
  {
    "path": "vendor/github.com/yudai/hcl/json/parse.go",
    "chars": 766,
    "preview": "package json\n\nimport (\n\t\"sync\"\n\n\t\"github.com/yudai/hcl/hcl\"\n\t\"github.com/hashicorp/go-multierror\"\n)\n\n// jsonErrors are t"
  },
  {
    "path": "vendor/github.com/yudai/hcl/json/parse.y",
    "chars": 2762,
    "preview": "// This is the yacc input for creating the parser for HCL JSON.\r\n\r\n%{\r\npackage json\r\n\r\nimport (\r\n\t\"fmt\"\r\n\t\"strconv\"\r\n\r\n\t"
  },
  {
    "path": "vendor/github.com/yudai/hcl/json/y.go",
    "chars": 14047,
    "preview": "//line parse.y:3\npackage json\n\nimport __yyfmt__ \"fmt\"\n\n//line parse.y:5\nimport (\n\t\"fmt\"\n\t\"strconv\"\n\n\t\"github.com/yudai/h"
  },
  {
    "path": "vendor/github.com/yudai/hcl/lex.go",
    "chars": 417,
    "preview": "package hcl\n\nimport (\n\t\"unicode\"\n)\n\ntype lexModeValue byte\n\nconst (\n\tlexModeUnknown lexModeValue = iota\n\tlexModeHcl\n\tlex"
  },
  {
    "path": "vendor/github.com/yudai/hcl/parse.go",
    "chars": 419,
    "preview": "package hcl\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/yudai/hcl/hcl\"\n\t\"github.com/yudai/hcl/json\"\n)\n\n// Parse parses the given inpu"
  },
  {
    "path": "version.go",
    "chars": 78,
    "preview": "package main\n\nvar Version = \"unknown_version\"\nvar CommitID = \"unknown_commit\"\n"
  },
  {
    "path": "webtty/doc.go",
    "chars": 118,
    "preview": "// Package webtty provides a protocl and an implementation to\n// controll terminals thorough networks.\npackage webtty\n"
  },
  {
    "path": "webtty/errors.go",
    "chars": 273,
    "preview": "package webtty\n\nimport (\n\t\"errors\"\n)\n\nvar (\n\t// ErrSlaveClosed indicates the function has exited by the slave\n\tErrSlaveC"
  },
  {
    "path": "webtty/master.go",
    "chars": 132,
    "preview": "package webtty\n\nimport (\n\t\"io\"\n)\n\n// Master represents a PTY master, usually it's a websocket connection.\ntype Master io"
  },
  {
    "path": "webtty/message_types.go",
    "chars": 730,
    "preview": "package webtty\n\n// Protocols defines the name of this protocol,\n// which is supposed to be used to the subprotocol of We"
  },
  {
    "path": "webtty/option.go",
    "chars": 1363,
    "preview": "package webtty\n\nimport (\n\t\"encoding/json\"\n\n\t\"github.com/pkg/errors\"\n)\n\n// Option is an option for WebTTY.\ntype Option fu"
  },
  {
    "path": "webtty/slave.go",
    "chars": 387,
    "preview": "package webtty\n\nimport (\n\t\"io\"\n)\n\n// Slave represents a PTY slave, typically it's a local command.\ntype Slave interface "
  },
  {
    "path": "webtty/webtty.go",
    "chars": 4637,
    "preview": "package webtty\n\nimport (\n\t\"context\"\n\t\"encoding/base64\"\n\t\"encoding/json\"\n\t\"sync\"\n\n\t\"github.com/pkg/errors\"\n)\n\n// WebTTY b"
  },
  {
    "path": "webtty/webtty_test.go",
    "chars": 3009,
    "preview": "package webtty\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"encoding/base64\"\n\t\"io\"\n\t\"sync\"\n\t\"testing\"\n)\n\ntype pipePair struct {\n\t*io."
  },
  {
    "path": "wercker.yml",
    "chars": 704,
    "preview": "box: golang:1.9.0\n\nbuild:\n  steps:\n    - setup-go-workspace\n    - script:\n        name: tools\n        code: make tools\n "
  }
]

// ... and 1 more files (download for full content)

About this extraction

This page contains the full source code of the yudai/gotty GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 166 files (1.9 MB), approximately 881.3k tokens, and a symbol index with 904 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!