aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaximilian Hils <git@maximilianhils.com>2017-08-22 01:06:46 +0200
committerMaximilian Hils <git@maximilianhils.com>2017-08-22 01:06:46 +0200
commit6350d5a19edafa992b53073610f05c0d38f28ddd (patch)
treefff2a54debff46d4bafdb2724fe87eb2bd94d4c6
parent58642d57f6281dde1d224365c6c0b2b05085413b (diff)
downloadmitmproxy-6350d5a19edafa992b53073610f05c0d38f28ddd.tar.gz
mitmproxy-6350d5a19edafa992b53073610f05c0d38f28ddd.tar.bz2
mitmproxy-6350d5a19edafa992b53073610f05c0d38f28ddd.zip
update mitmweb assets (gulp prod)
-rw-r--r--mitmproxy/tools/web/static/app.css981
-rw-r--r--mitmproxy/tools/web/static/app.js9409
-rw-r--r--mitmproxy/tools/web/static/vendor.css8393
-rw-r--r--mitmproxy/tools/web/static/vendor.js52051
4 files changed, 294 insertions, 70540 deletions
diff --git a/mitmproxy/tools/web/static/app.css b/mitmproxy/tools/web/static/app.css
index 43e5cd8d..fc62d21b 100644
--- a/mitmproxy/tools/web/static/app.css
+++ b/mitmproxy/tools/web/static/app.css
@@ -1,981 +1,2 @@
-html {
- box-sizing: border-box;
-}
-*,
-*:before,
-*:after {
- box-sizing: inherit;
-}
-.resource-icon {
- width: 32px;
- height: 32px;
-}
-.resource-icon-css {
- background-image: url(images/chrome-devtools/resourceCSSIcon.png);
-}
-.resource-icon-document {
- background-image: url(images/chrome-devtools/resourceDocumentIcon.png);
-}
-.resource-icon-js {
- background-image: url(images/chrome-devtools/resourceJSIcon.png);
-}
-.resource-icon-plain {
- background-image: url(images/chrome-devtools/resourcePlainIcon.png);
-}
-.resource-icon-executable {
- background-image: url(images/resourceExecutableIcon.png);
-}
-.resource-icon-flash {
- background-image: url(images/resourceFlashIcon.png);
-}
-.resource-icon-image {
- background-image: url(images/resourceImageIcon.png);
-}
-.resource-icon-java {
- background-image: url(images/resourceJavaIcon.png);
-}
-.resource-icon-not-modified {
- background-image: url(images/resourceNotModifiedIcon.png);
-}
-.resource-icon-redirect {
- background-image: url(images/resourceRedirectIcon.png);
-}
-html,
-body,
-#container,
-#mitmproxy {
- height: 100%;
- margin: 0;
- overflow: hidden;
-}
-#container {
- display: flex;
- flex-direction: column;
- outline: none;
-}
-#container > header,
-#container > footer,
-#container > .eventlog {
- flex: 0 0 auto;
-}
-.main-view {
- flex: 1 1 auto;
- height: 0;
- display: flex;
- flex-direction: row;
-}
-.main-view.vertical {
- flex-direction: column;
-}
-.main-view .flow-detail,
-.main-view .flow-table {
- flex: 1 1 auto;
-}
-.splitter {
- flex: 0 0 1px;
- background-color: #aaa;
- position: relative;
-}
-.splitter > div {
- position: absolute;
-}
-.splitter.splitter-x {
- cursor: col-resize;
-}
-.splitter.splitter-x > div {
- margin-left: -1px;
- width: 4px;
- height: 100%;
-}
-.splitter.splitter-y {
- cursor: row-resize;
-}
-.splitter.splitter-y > div {
- margin-top: -1px;
- height: 4px;
- width: 100%;
-}
-.nav-tabs {
- border-bottom: solid #a6a6a6 1px;
-}
-.nav-tabs a {
- display: inline-block;
- border: solid transparent 1px;
- text-decoration: none;
-}
-.nav-tabs a.active {
- background-color: white;
- border-color: #a6a6a6;
- border-bottom-color: white;
-}
-.nav-tabs a.special {
- color: white;
- background-color: #396cad;
- border-bottom-color: #396cad;
-}
-.nav-tabs a.special:hover {
- background-color: #5386c6;
-}
-.nav-tabs-lg a {
- padding: 3px 14px;
- margin: 0 2px -1px;
-}
-.nav-tabs-sm a {
- padding: 0px 7px;
- margin: 2px 2px -1px;
-}
-.nav-tabs-sm a.nav-action {
- float: right;
- padding: 0;
- margin: 1px 0 0px;
-}
-header {
- padding-top: 6px;
- background-color: white;
-}
-header > div {
- display: block;
- margin: 0;
- padding: 0;
- border-bottom: solid #a6a6a6 1px;
- height: 85px;
- overflow: visible;
-}
-.menu-group {
- margin: 0 3px;
- display: inline-block;
- height: 85px;
- vertical-align: top;
-}
-.menu-content {
- height: 69px;
- text-align: center;
-}
-.menu-content > .btn {
- height: 69px;
- text-align: center;
- margin: 0 1px;
- padding: 12px 5px;
- border: none;
- border-radius: 0;
-}
-.menu-content > .btn i {
- font-size: 20px;
- display: block;
- margin: 0 auto 5px;
-}
-.menu-entry {
- text-align: left;
- height: 23px;
- line-height: 1;
- padding: 0.5rem 1rem;
-}
-.menu-entry label {
- font-size: 1.2rem;
- font-weight: normal;
- margin: 0;
-}
-.menu-entry input[type=checkbox] {
- margin: 0 2px;
- vertical-align: middle;
-}
-.menu-legend {
- height: 16px;
- text-align: center;
- font-size: 12px;
- padding: 0 5px;
-}
-.menu-group + .menu-group:before {
- margin-left: -3px;
- content: " ";
- border-left: solid 1px #e6e6e6;
- margin-top: 10px;
- height: 65px;
- position: absolute;
-}
-.menu-main {
- margin-left: -2px;
- margin-right: -3px;
- padding: 2px 5px;
-}
-.filter-input {
- position: relative;
- min-height: 1px;
- padding-left: 2.5px;
- padding-right: 2.5px;
- padding: 2.5px;
-}
-@media (min-width: 768px) {
- .filter-input {
- float: left;
- width: 41.66666667%;
- }
-}
-@media (max-width: 767px) {
- .filter-input {
- padding: 2px 2.5px;
- }
- .filter-input > .form-control,
- .filter-input > .input-group-addon,
- .filter-input > .input-group-btn > .btn {
- height: 23.5px;
- padding: 1px 5px;
- font-size: 12px;
- line-height: 1.5;
- }
-}
-.filter-input .popover {
- top: 27px;
- left: 43px;
- display: block;
- max-width: none;
- opacity: 0.9;
-}
-@media (max-width: 767px) {
- .filter-input .popover {
- top: 16px;
- left: 29px;
- right: 2px;
- }
-}
-.filter-input .popover .popover-content {
- max-height: 500px;
- overflow-y: auto;
-}
-.filter-input .popover .popover-content tr {
- cursor: pointer;
-}
-.filter-input .popover .popover-content tr:hover {
- background-color: rgba(193, 215, 235, 0.5) !important;
-}
-.connection-indicator {
- display: inline;
- padding: .2em .6em .3em;
- font-size: 75%;
- font-weight: bold;
- line-height: 1;
- color: #fff;
- text-align: center;
- white-space: nowrap;
- vertical-align: baseline;
- border-radius: .25em;
- float: right;
- margin: 5px;
- opacity: 1;
- transition: all 1s linear;
-}
-a.connection-indicator:hover,
-a.connection-indicator:focus {
- color: #fff;
- text-decoration: none;
- cursor: pointer;
-}
-.connection-indicator:empty {
- display: none;
-}
-.btn .connection-indicator {
- position: relative;
- top: -1px;
-}
-.connection-indicator.init,
-.connection-indicator.fetching {
- background-color: #5bc0de;
-}
-.connection-indicator.established {
- background-color: #5cb85c;
- opacity: 0;
-}
-.connection-indicator.error {
- background-color: #d9534f;
- transition: all 0.2s linear;
-}
-.connection-indicator.offline {
- background-color: #f0ad4e;
- opacity: 1;
-}
-.flow-table {
- width: 100%;
- overflow-y: scroll;
- overflow-x: hidden;
-}
-.flow-table table {
- width: 100%;
- table-layout: fixed;
-}
-.flow-table thead {
- background-color: #F2F2F2;
- line-height: 23px;
-}
-.flow-table th {
- font-weight: normal;
- box-shadow: 0 1px 0 #a6a6a6;
- position: relative !important;
- padding-left: 1px;
- -webkit-touch-callout: none;
- -webkit-user-select: none;
- -khtml-user-select: none;
- -moz-user-select: none;
- -ms-user-select: none;
- user-select: none;
-}
-.flow-table th.sort-asc,
-.flow-table th.sort-desc {
- background-color: #fafafa;
-}
-.flow-table th.sort-asc:after,
-.flow-table th.sort-desc:after {
- font: normal normal normal 14px/1 FontAwesome;
- position: absolute;
- right: 3px;
- top: 3px;
- padding: 2px;
- background-color: rgba(250, 250, 250, 0.8);
-}
-.flow-table th.sort-asc:after {
- content: "\f0de";
-}
-.flow-table th.sort-desc:after {
- content: "\f0dd";
-}
-.flow-table tr {
- cursor: pointer;
-}
-.flow-table tr:nth-child(even) {
- background-color: rgba(0, 0, 0, 0.05);
-}
-.flow-table tr.selected {
- background-color: rgba(193, 215, 235, 0.5) !important;
-}
-.flow-table tr.highlighted {
- background-color: rgba(255, 204, 0, 0.4);
-}
-.flow-table tr.highlighted:nth-child(even) {
- background-color: rgba(255, 204, 0, 0.5);
-}
-.flow-table td {
- overflow: hidden;
- white-space: nowrap;
- text-overflow: ellipsis;
-}
-.flow-table tr.intercepted:not(.has-response) .col-path,
-.flow-table tr.intercepted:not(.has-response) .col-method {
- color: #ff8000;
-}
-.flow-table tr.intercepted.has-response .col-status,
-.flow-table tr.intercepted.has-response .col-size,
-.flow-table tr.intercepted.has-response .col-time {
- color: #ff8000;
-}
-.flow-table .fa {
- line-height: inherit;
-}
-.flow-table .fa.pull-right {
- margin-left: 0;
-}
-.flow-table .col-tls {
- width: 10px;
-}
-.flow-table .col-tls-https {
- background-color: rgba(0, 185, 0, 0.5);
-}
-.flow-table .col-icon {
- width: 32px;
-}
-.flow-table .col-path .fa-repeat {
- color: green;
-}
-.flow-table .col-path .fa-pause {
- color: #ff8000;
-}
-.flow-table .col-path .fa-exclamation,
-.flow-table .col-path .fa-times {
- color: darkred;
-}
-.flow-table .col-method {
- width: 60px;
-}
-.flow-table .col-status {
- width: 50px;
-}
-.flow-table .col-size {
- width: 70px;
-}
-.flow-table .col-time {
- width: 50px;
-}
-.flow-table td.col-time,
-.flow-table td.col-size {
- text-align: right;
-}
-.flow-detail {
- width: 100%;
- overflow: hidden;
- display: flex;
- flex-direction: column;
-}
-.flow-detail nav {
- background-color: #F2F2F2;
-}
-.flow-detail section {
- overflow-y: scroll;
-}
-.flow-detail section > article {
- overflow: auto;
- padding: 5px 12px 0;
-}
-.flow-detail section > footer {
- box-shadow: 0 0 3px gray;
- padding: 2px;
- margin: 0;
- height: 23px;
-}
-.flow-detail section.detail,
-.flow-detail section.error {
- overflow: auto;
- padding: 5px 12px 0;
-}
-.flow-detail .first-line {
- font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
- background-color: #428bca;
- color: white;
- margin: 0 -8px;
- padding: 4px 8px;
- border-radius: 5px;
- word-break: break-all;
- max-height: 100px;
- overflow-y: auto;
-}
-.flow-detail .first-line .inline-input.editable {
- border-color: rgba(255, 255, 255, 0.5);
-}
-.flow-detail .request-line {
- margin-bottom: 2px;
-}
-.flow-detail hr {
- margin: 0 0 5px;
-}
-.inline-input {
- display: inline;
- margin: 0 -3px;
- padding: 0 3px;
- border: solid transparent 1px;
-}
-.inline-input.editable {
- border-color: #ccc;
-}
-.inline-input[contenteditable] {
- background-color: rgba(255, 255, 255, 0.2);
-}
-.inline-input[contenteditable].has-warning {
- color: #ffb8b8;
-}
-.view-all-content-btn {
- float: right;
- margin-bottom: 12px;
-}
-.flow-detail table {
- font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
- width: 100%;
- table-layout: fixed;
- word-break: break-all;
-}
-.flow-detail table tr:not(:first-child) {
- border-top: 1px solid #f7f7f7;
-}
-.flow-detail table td {
- vertical-align: top;
-}
-.connection-table td:first-child {
- width: 50%;
- padding-right: 1em;
-}
-.header-table td {
- line-height: 1.3em;
-}
-.header-table .header-name {
- width: 33%;
-}
-.header-table .header-colon {
- position: absolute;
- opacity: 0;
-}
-.header-table .inline-input {
- display: inline-block;
- width: 100%;
- height: 100%;
-}
-.connection-table td,
-.timing-table td {
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
-}
-.flowview-image {
- text-align: center;
-}
-.flowview-image img {
- max-width: 100%;
- max-height: 100%;
-}
-.edit-flow-container {
- position: relative;
-}
-.edit-flow {
- cursor: pointer;
- position: absolute;
- right: 0;
- top: 5px;
- height: 40px;
- width: 40px;
- border-radius: 20px;
- z-index: 10000;
- background-color: rgba(255, 255, 255, 0.7);
- border: solid 2px rgba(248, 145, 59, 0.7);
- text-align: center;
- font-size: 22px;
- line-height: 37px;
- transition: all 100ms ease-in-out;
-}
-.edit-flow:hover {
- background-color: rgba(239, 108, 0, 0.7);
- color: rgba(0, 0, 0, 0.8);
- border: solid 2px transparent;
-}
-.prompt-dialog {
- top: 0;
- bottom: 0;
- left: 0;
- right: 0;
- position: fixed;
- z-index: 100;
- background-color: rgba(0, 0, 0, 0.1);
-}
-.prompt-content {
- position: fixed;
- bottom: 0;
- left: 0;
- right: 0;
- height: 25px;
- padding: 2px 5px;
- background-color: white;
- box-shadow: 0 -1px 3px lightgray;
-}
-.prompt-content .option {
- cursor: pointer;
-}
-.prompt-content .option:not(:last-child)::after {
- content: ", ";
-}
-.eventlog {
- height: 200px;
- flex: 0 0 auto;
- display: flex;
- flex-direction: column;
-}
-.eventlog > div {
- background-color: #F2F2F2;
- padding: 0 5px;
- flex: 0 0 auto;
- border-top: 1px solid #aaa;
- cursor: row-resize;
-}
-.eventlog > pre {
- flex: 1 1 auto;
- margin: 0;
- border-radius: 0;
- overflow-x: auto;
- overflow-y: scroll;
- background-color: #fcfcfc;
-}
-.eventlog .fa-close {
- cursor: pointer;
- float: right;
- color: grey;
- padding: 3px 0;
- padding-left: 10px;
-}
-.eventlog .fa-close:hover {
- color: black;
-}
-.eventlog .btn-toggle {
- margin-top: -2px;
- margin-left: 3px;
- padding: 2px 2px;
- font-size: 10px;
- line-height: 10px;
- border-radius: 2px;
-}
-.eventlog .label {
- cursor: pointer;
- vertical-align: middle;
- display: inline-block;
- margin-top: -2px;
- margin-left: 3px;
-}
-footer {
- box-shadow: 0 -1px 3px lightgray;
- padding: 0px 10px 3px;
-}
-footer .label {
- margin-right: 3px;
-}
-.CodeMirror {
- border: 1px solid #ccc;
- height: auto !important;
-}
-/* BASICS */
-
-.CodeMirror {
- /* Set height, width, borders, and global font properties here */
- font-family: monospace;
- height: 300px;
- color: black;
-}
-
-/* PADDING */
-
-.CodeMirror-lines {
- padding: 4px 0; /* Vertical padding around content */
-}
-.CodeMirror pre {
- padding: 0 4px; /* Horizontal padding of content */
-}
-
-.CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {
- background-color: white; /* The little square between H and V scrollbars */
-}
-
-/* GUTTER */
-
-.CodeMirror-gutters {
- border-right: 1px solid #ddd;
- background-color: #f7f7f7;
- white-space: nowrap;
-}
-.CodeMirror-linenumbers {}
-.CodeMirror-linenumber {
- padding: 0 3px 0 5px;
- min-width: 20px;
- text-align: right;
- color: #999;
- white-space: nowrap;
-}
-
-.CodeMirror-guttermarker { color: black; }
-.CodeMirror-guttermarker-subtle { color: #999; }
-
-/* CURSOR */
-
-.CodeMirror-cursor {
- border-left: 1px solid black;
- border-right: none;
- width: 0;
-}
-/* Shown when moving in bi-directional text */
-.CodeMirror div.CodeMirror-secondarycursor {
- border-left: 1px solid silver;
-}
-.cm-fat-cursor .CodeMirror-cursor {
- width: auto;
- border: 0 !important;
- background: #7e7;
-}
-.cm-fat-cursor div.CodeMirror-cursors {
- z-index: 1;
-}
-
-.cm-animate-fat-cursor {
- width: auto;
- border: 0;
- -webkit-animation: blink 1.06s steps(1) infinite;
- -moz-animation: blink 1.06s steps(1) infinite;
- animation: blink 1.06s steps(1) infinite;
- background-color: #7e7;
-}
-@-moz-keyframes blink {
- 0% {}
- 50% { background-color: transparent; }
- 100% {}
-}
-@-webkit-keyframes blink {
- 0% {}
- 50% { background-color: transparent; }
- 100% {}
-}
-@keyframes blink {
- 0% {}
- 50% { background-color: transparent; }
- 100% {}
-}
-
-/* Can style cursor different in overwrite (non-insert) mode */
-.CodeMirror-overwrite .CodeMirror-cursor {}
-
-.cm-tab { display: inline-block; text-decoration: inherit; }
-
-.CodeMirror-rulers {
- position: absolute;
- left: 0; right: 0; top: -50px; bottom: -20px;
- overflow: hidden;
-}
-.CodeMirror-ruler {
- border-left: 1px solid #ccc;
- top: 0; bottom: 0;
- position: absolute;
-}
-
-/* DEFAULT THEME */
-
-.cm-s-default .cm-header {color: blue;}
-.cm-s-default .cm-quote {color: #090;}
-.cm-negative {color: #d44;}
-.cm-positive {color: #292;}
-.cm-header, .cm-strong {font-weight: bold;}
-.cm-em {font-style: italic;}
-.cm-link {text-decoration: underline;}
-.cm-strikethrough {text-decoration: line-through;}
-
-.cm-s-default .cm-keyword {color: #708;}
-.cm-s-default .cm-atom {color: #219;}
-.cm-s-default .cm-number {color: #164;}
-.cm-s-default .cm-def {color: #00f;}
-.cm-s-default .cm-variable,
-.cm-s-default .cm-punctuation,
-.cm-s-default .cm-property,
-.cm-s-default .cm-operator {}
-.cm-s-default .cm-variable-2 {color: #05a;}
-.cm-s-default .cm-variable-3 {color: #085;}
-.cm-s-default .cm-comment {color: #a50;}
-.cm-s-default .cm-string {color: #a11;}
-.cm-s-default .cm-string-2 {color: #f50;}
-.cm-s-default .cm-meta {color: #555;}
-.cm-s-default .cm-qualifier {color: #555;}
-.cm-s-default .cm-builtin {color: #30a;}
-.cm-s-default .cm-bracket {color: #997;}
-.cm-s-default .cm-tag {color: #170;}
-.cm-s-default .cm-attribute {color: #00c;}
-.cm-s-default .cm-hr {color: #999;}
-.cm-s-default .cm-link {color: #00c;}
-
-.cm-s-default .cm-error {color: #f00;}
-.cm-invalidchar {color: #f00;}
-
-.CodeMirror-composing { border-bottom: 2px solid; }
-
-/* Default styles for common addons */
-
-div.CodeMirror span.CodeMirror-matchingbracket {color: #0f0;}
-div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
-.CodeMirror-matchingtag { background: rgba(255, 150, 0, .3); }
-.CodeMirror-activeline-background {background: #e8f2ff;}
-
-/* STOP */
-
-/* The rest of this file contains styles related to the mechanics of
- the editor. You probably shouldn't touch them. */
-
-.CodeMirror {
- position: relative;
- overflow: hidden;
- background: white;
-}
-
-.CodeMirror-scroll {
- overflow: scroll !important; /* Things will break if this is overridden */
- /* 30px is the magic margin used to hide the element's real scrollbars */
- /* See overflow: hidden in .CodeMirror */
- margin-bottom: -30px; margin-right: -30px;
- padding-bottom: 30px;
- height: 100%;
- outline: none; /* Prevent dragging from highlighting the element */
- position: relative;
-}
-.CodeMirror-sizer {
- position: relative;
- border-right: 30px solid transparent;
-}
-
-/* The fake, visible scrollbars. Used to force redraw during scrolling
- before actual scrolling happens, thus preventing shaking and
- flickering artifacts. */
-.CodeMirror-vscrollbar, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {
- position: absolute;
- z-index: 6;
- display: none;
-}
-.CodeMirror-vscrollbar {
- right: 0; top: 0;
- overflow-x: hidden;
- overflow-y: scroll;
-}
-.CodeMirror-hscrollbar {
- bottom: 0; left: 0;
- overflow-y: hidden;
- overflow-x: scroll;
-}
-.CodeMirror-scrollbar-filler {
- right: 0; bottom: 0;
-}
-.CodeMirror-gutter-filler {
- left: 0; bottom: 0;
-}
-
-.CodeMirror-gutters {
- position: absolute; left: 0; top: 0;
- min-height: 100%;
- z-index: 3;
-}
-.CodeMirror-gutter {
- white-space: normal;
- height: 100%;
- display: inline-block;
- vertical-align: top;
- margin-bottom: -30px;
-}
-.CodeMirror-gutter-wrapper {
- position: absolute;
- z-index: 4;
- background: none !important;
- border: none !important;
-}
-.CodeMirror-gutter-background {
- position: absolute;
- top: 0; bottom: 0;
- z-index: 4;
-}
-.CodeMirror-gutter-elt {
- position: absolute;
- cursor: default;
- z-index: 4;
-}
-.CodeMirror-gutter-wrapper {
- -webkit-user-select: none;
- -moz-user-select: none;
- user-select: none;
-}
-
-.CodeMirror-lines {
- cursor: text;
- min-height: 1px; /* prevents collapsing before first draw */
-}
-.CodeMirror pre {
- /* Reset some styles that the rest of the page might have set */
- -moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0;
- border-width: 0;
- background: transparent;
- font-family: inherit;
- font-size: inherit;
- margin: 0;
- white-space: pre;
- word-wrap: normal;
- line-height: inherit;
- color: inherit;
- z-index: 2;
- position: relative;
- overflow: visible;
- -webkit-tap-highlight-color: transparent;
- -webkit-font-variant-ligatures: contextual;
- font-variant-ligatures: contextual;
-}
-.CodeMirror-wrap pre {
- word-wrap: break-word;
- white-space: pre-wrap;
- word-break: normal;
-}
-
-.CodeMirror-linebackground {
- position: absolute;
- left: 0; right: 0; top: 0; bottom: 0;
- z-index: 0;
-}
-
-.CodeMirror-linewidget {
- position: relative;
- z-index: 2;
- overflow: auto;
-}
-
-.CodeMirror-widget {}
-
-.CodeMirror-code {
- outline: none;
-}
-
-/* Force content-box sizing for the elements where we expect it */
-.CodeMirror-scroll,
-.CodeMirror-sizer,
-.CodeMirror-gutter,
-.CodeMirror-gutters,
-.CodeMirror-linenumber {
- -moz-box-sizing: content-box;
- box-sizing: content-box;
-}
-
-.CodeMirror-measure {
- position: absolute;
- width: 100%;
- height: 0;
- overflow: hidden;
- visibility: hidden;
-}
-
-.CodeMirror-cursor {
- position: absolute;
- pointer-events: none;
-}
-.CodeMirror-measure pre { position: static; }
-
-div.CodeMirror-cursors {
- visibility: hidden;
- position: relative;
- z-index: 3;
-}
-div.CodeMirror-dragcursors {
- visibility: visible;
-}
-
-.CodeMirror-focused div.CodeMirror-cursors {
- visibility: visible;
-}
-
-.CodeMirror-selected { background: #d9d9d9; }
-.CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; }
-.CodeMirror-crosshair { cursor: crosshair; }
-.CodeMirror-line::selection, .CodeMirror-line > span::selection, .CodeMirror-line > span > span::selection { background: #d7d4f0; }
-.CodeMirror-line::-moz-selection, .CodeMirror-line > span::-moz-selection, .CodeMirror-line > span > span::-moz-selection { background: #d7d4f0; }
-
-.cm-searching {
- background: #ffa;
- background: rgba(255, 255, 0, .4);
-}
-
-/* Used to force a border model for a node */
-.cm-force-border { padding-right: .1px; }
-
-@media print {
- /* Hide the cursor when printing */
- .CodeMirror div.CodeMirror-cursors {
- visibility: hidden;
- }
-}
-
-/* See issue #2901 */
-.cm-tab-wrap-hack:after { content: ''; }
-
-/* Help users use markselection to safely style text background */
-span.CodeMirror-selectedtext { background: none; }
-
-.contentview .header {
- font-weight: bold;
-}
-.contentview .highlight {
- font-weight: bold;
-}
-.contentview .offset {
- color: blue;
-}
-.contentview .codeeditor {
- margin-bottom: 12px;
-}
-
+html{box-sizing:border-box}*,:after,:before{box-sizing:inherit}.resource-icon{width:32px;height:32px}.resource-icon-css{background-image:url(images/chrome-devtools/resourceCSSIcon.png)}.resource-icon-document{background-image:url(images/chrome-devtools/resourceDocumentIcon.png)}.resource-icon-js{background-image:url(images/chrome-devtools/resourceJSIcon.png)}.resource-icon-plain{background-image:url(images/chrome-devtools/resourcePlainIcon.png)}.resource-icon-executable{background-image:url(images/resourceExecutableIcon.png)}.resource-icon-flash{background-image:url(images/resourceFlashIcon.png)}.resource-icon-image{background-image:url(images/resourceImageIcon.png)}.resource-icon-java{background-image:url(images/resourceJavaIcon.png)}.resource-icon-not-modified{background-image:url(images/resourceNotModifiedIcon.png)}.resource-icon-redirect{background-image:url(images/resourceRedirectIcon.png)}#container,#mitmproxy,body,html{height:100%;margin:0;overflow:hidden}#container{display:flex;flex-direction:column;outline:0}#container>.eventlog,#container>footer,#container>header{flex:0 0 auto}.main-view{flex:1 1 auto;height:0;display:flex;flex-direction:row}.main-view.vertical{flex-direction:column}.main-view .flow-detail,.main-view .flow-table{flex:1 1 auto}.splitter{flex:0 0 1px;background-color:#aaa;position:relative}.splitter>div{position:absolute}.splitter.splitter-x{cursor:col-resize}.splitter.splitter-x>div{margin-left:-1px;width:4px;height:100%}.splitter.splitter-y{cursor:row-resize}.splitter.splitter-y>div{margin-top:-1px;height:4px;width:100%}.nav-tabs{border-bottom:solid #a6a6a6 1px}.nav-tabs a{display:inline-block;border:solid transparent 1px;text-decoration:none}.nav-tabs a.active{background-color:#fff;border-color:#a6a6a6;border-bottom-color:#fff}.nav-tabs a.special{color:#fff;background-color:#396cad;border-bottom-color:#396cad}.nav-tabs a.special:hover{background-color:#5386c6}.nav-tabs-lg a{padding:3px 14px;margin:0 2px -1px}.nav-tabs-sm a{padding:0 7px;margin:2px 2px -1px}.nav-tabs-sm a.nav-action{float:right;padding:0;margin:1px 0 0}header{padding-top:6px;background-color:#fff}header>div{display:block;margin:0;padding:0;border-bottom:solid #a6a6a6 1px;height:85px;overflow:visible}.menu-group{margin:0 3px;display:inline-block;height:85px;vertical-align:top}.menu-content{height:69px;text-align:center}.menu-content>.btn{height:69px;text-align:center;margin:0 1px;padding:12px 5px;border:none;border-radius:0}.menu-content>.btn i{font-size:20px;display:block;margin:0 auto 5px}.menu-entry{text-align:left;height:23px;line-height:1;padding:.5rem 1rem}.menu-entry label{font-size:1.2rem;font-weight:400;margin:0}.menu-entry input[type=checkbox]{margin:0 2px;vertical-align:middle}.menu-legend{height:16px;text-align:center;font-size:12px;padding:0 5px}.menu-group+.menu-group:before{margin-left:-3px;content:" ";border-left:solid 1px #e6e6e6;margin-top:10px;height:65px;position:absolute}.menu-main{margin-left:-2px;margin-right:-3px;padding:2px 5px}.filter-input{position:relative;min-height:1px;padding-left:2.5px;padding-right:2.5px;padding:2.5px}@media (min-width:768px){.filter-input{float:left;width:41.66666667%}}@media (max-width:767px){.filter-input{padding:2px 2.5px}.filter-input>.form-control,.filter-input>.input-group-addon,.filter-input>.input-group-btn>.btn{height:23.5px;padding:1px 5px;font-size:12px;line-height:1.5}}.filter-input .popover{top:27px;left:43px;display:block;max-width:none;opacity:.9}@media (max-width:767px){.filter-input .popover{top:16px;left:29px;right:2px}}.filter-input .popover .popover-content{max-height:500px;overflow-y:auto}.filter-input .popover .popover-content tr{cursor:pointer}.filter-input .popover .popover-content tr:hover{background-color:rgba(193,215,235,.5)!important}.connection-indicator{display:inline;padding:.2em .6em .3em;font-size:75%;font-weight:700;line-height:1;color:#fff;text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:.25em;float:right;margin:5px;opacity:1;transition:all 1s linear}a.connection-indicator:focus,a.connection-indicator:hover{color:#fff;text-decoration:none;cursor:pointer}.connection-indicator:empty{display:none}.btn .connection-indicator{position:relative;top:-1px}.connection-indicator.fetching,.connection-indicator.init{background-color:#5bc0de}.connection-indicator.established{background-color:#5cb85c;opacity:0}.connection-indicator.error{background-color:#d9534f;transition:all .2s linear}.connection-indicator.offline{background-color:#f0ad4e;opacity:1}.flow-table{width:100%;overflow-y:scroll;overflow-x:hidden}.flow-table table{width:100%;table-layout:fixed}.flow-table thead{background-color:#f2f2f2;line-height:23px}.flow-table th{font-weight:400;box-shadow:0 1px 0 #a6a6a6;position:relative!important;padding-left:1px;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.flow-table th.sort-asc,.flow-table th.sort-desc{background-color:#fafafa}.flow-table th.sort-asc:after,.flow-table th.sort-desc:after{font:normal normal normal 14px/1 FontAwesome;position:absolute;right:3px;top:3px;padding:2px;background-color:rgba(250,250,250,.8)}.flow-table th.sort-asc:after{content:"\f0de"}.flow-table th.sort-desc:after{content:"\f0dd"}.flow-table tr{cursor:pointer}.flow-table tr:nth-child(even){background-color:rgba(0,0,0,.05)}.flow-table tr.selected{background-color:rgba(193,215,235,.5)!important}.flow-table tr.highlighted{background-color:rgba(255,204,0,.4)}.flow-table tr.highlighted:nth-child(even){background-color:rgba(255,204,0,.5)}.flow-table td{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.flow-table tr.intercepted:not(.has-response) .col-method,.flow-table tr.intercepted:not(.has-response) .col-path{color:#ff8000}.flow-table tr.intercepted.has-response .col-size,.flow-table tr.intercepted.has-response .col-status,.flow-table tr.intercepted.has-response .col-time{color:#ff8000}.flow-table .fa{line-height:inherit}.flow-table .fa.pull-right{margin-left:0}.flow-table .col-tls{width:10px}.flow-table .col-tls-https{background-color:rgba(0,185,0,.5)}.flow-table .col-icon{width:32px}.flow-table .col-path .fa-repeat{color:green}.flow-table .col-path .fa-pause{color:#ff8000}.flow-table .col-path .fa-exclamation,.flow-table .col-path .fa-times{color:#8b0000}.flow-table .col-method{width:60px}.flow-table .col-status{width:50px}.flow-table .col-size{width:70px}.flow-table .col-time{width:50px}.flow-table td.col-size,.flow-table td.col-time{text-align:right}.flow-detail{width:100%;overflow:hidden;display:flex;flex-direction:column}.flow-detail nav{background-color:#f2f2f2}.flow-detail section{overflow-y:scroll}.flow-detail section>article{overflow:auto;padding:5px 12px 0}.flow-detail section>footer{box-shadow:0 0 3px gray;padding:2px;margin:0;height:23px}.flow-detail section.detail,.flow-detail section.error{overflow:auto;padding:5px 12px 0}.flow-detail .first-line{font-family:Menlo,Monaco,Consolas,"Courier New",monospace;background-color:#428bca;color:#fff;margin:0 -8px;padding:4px 8px;border-radius:5px;word-break:break-all;max-height:100px;overflow-y:auto}.flow-detail .first-line .inline-input.editable{border-color:rgba(255,255,255,.5)}.flow-detail .request-line{margin-bottom:2px}.flow-detail hr{margin:0 0 5px}.inline-input{display:inline;margin:0 -3px;padding:0 3px;border:solid transparent 1px}.inline-input.editable{border-color:#ccc}.inline-input[contenteditable]{background-color:rgba(255,255,255,.2)}.inline-input[contenteditable].has-warning{color:#ffb8b8}.view-all-content-btn{float:right;margin-bottom:12px}.flow-detail table{font-family:Menlo,Monaco,Consolas,"Courier New",monospace;width:100%;table-layout:fixed;word-break:break-all}.flow-detail table tr:not(:first-child){border-top:1px solid #f7f7f7}.flow-detail table td{vertical-align:top}.connection-table td:first-child{width:50%;padding-right:1em}.header-table td{line-height:1.3em}.header-table .header-name{width:33%}.header-table .header-colon{position:absolute;opacity:0}.header-table .inline-input{display:inline-block;width:100%;height:100%}.connection-table td,.timing-table td{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.flowview-image{text-align:center}.flowview-image img{max-width:100%;max-height:100%}.edit-flow-container{position:relative}.edit-flow{cursor:pointer;position:absolute;right:0;top:5px;height:40px;width:40px;border-radius:20px;z-index:10000;background-color:rgba(255,255,255,.7);border:solid 2px rgba(248,145,59,.7);text-align:center;font-size:22px;line-height:37px;transition:all .1s ease-in-out}.edit-flow:hover{background-color:rgba(239,108,0,.7);color:rgba(0,0,0,.8);border:solid 2px transparent}.prompt-dialog{top:0;bottom:0;left:0;right:0;position:fixed;z-index:100;background-color:rgba(0,0,0,.1)}.prompt-content{position:fixed;bottom:0;left:0;right:0;height:25px;padding:2px 5px;background-color:#fff;box-shadow:0 -1px 3px #d3d3d3}.prompt-content .option{cursor:pointer}.prompt-content .option:not(:last-child)::after{content:", "}.eventlog{height:200px;flex:0 0 auto;display:flex;flex-direction:column}.eventlog>div{background-color:#f2f2f2;padding:0 5px;flex:0 0 auto;border-top:1px solid #aaa;cursor:row-resize}.eventlog>pre{flex:1 1 auto;margin:0;border-radius:0;overflow-x:auto;overflow-y:scroll;background-color:#fcfcfc}.eventlog .fa-close{cursor:pointer;float:right;color:grey;padding:3px 0;padding-left:10px}.eventlog .fa-close:hover{color:#000}.eventlog .btn-toggle{margin-top:-2px;margin-left:3px;padding:2px 2px;font-size:10px;line-height:10px;border-radius:2px}.eventlog .label{cursor:pointer;vertical-align:middle;display:inline-block;margin-top:-2px;margin-left:3px}footer{box-shadow:0 -1px 3px #d3d3d3;padding:0 10px 3px}footer .label{margin-right:3px}.CodeMirror{border:1px solid #ccc;height:auto!important}.CodeMirror{font-family:monospace;height:300px;color:#000}.CodeMirror-lines{padding:4px 0}.CodeMirror pre{padding:0 4px}.CodeMirror-gutter-filler,.CodeMirror-scrollbar-filler{background-color:#fff}.CodeMirror-gutters{border-right:1px solid #ddd;background-color:#f7f7f7;white-space:nowrap}.CodeMirror-linenumber{padding:0 3px 0 5px;min-width:20px;text-align:right;color:#999;white-space:nowrap}.CodeMirror-guttermarker{color:#000}.CodeMirror-guttermarker-subtle{color:#999}.CodeMirror-cursor{border-left:1px solid #000;border-right:none;width:0}.CodeMirror div.CodeMirror-secondarycursor{border-left:1px solid silver}.cm-fat-cursor .CodeMirror-cursor{width:auto;border:0!important;background:#7e7}.cm-fat-cursor div.CodeMirror-cursors{z-index:1}.cm-animate-fat-cursor{width:auto;border:0;-webkit-animation:blink 1.06s steps(1) infinite;-moz-animation:blink 1.06s steps(1) infinite;animation:blink 1.06s steps(1) infinite;background-color:#7e7}@-moz-keyframes blink{50%{background-color:transparent}}@-webkit-keyframes blink{50%{background-color:transparent}}@keyframes blink{50%{background-color:transparent}}.cm-tab{display:inline-block;text-decoration:inherit}.CodeMirror-rulers{position:absolute;left:0;right:0;top:-50px;bottom:-20px;overflow:hidden}.CodeMirror-ruler{border-left:1px solid #ccc;top:0;bottom:0;position:absolute}.cm-s-default .cm-header{color:#00f}.cm-s-default .cm-quote{color:#090}.cm-negative{color:#d44}.cm-positive{color:#292}.cm-header,.cm-strong{font-weight:700}.cm-em{font-style:italic}.cm-link{text-decoration:underline}.cm-strikethrough{text-decoration:line-through}.cm-s-default .cm-keyword{color:#708}.cm-s-default .cm-atom{color:#219}.cm-s-default .cm-number{color:#164}.cm-s-default .cm-def{color:#00f}.cm-s-default .cm-variable-2{color:#05a}.cm-s-default .cm-variable-3{color:#085}.cm-s-default .cm-comment{color:#a50}.cm-s-default .cm-string{color:#a11}.cm-s-default .cm-string-2{color:#f50}.cm-s-default .cm-meta{color:#555}.cm-s-default .cm-qualifier{color:#555}.cm-s-default .cm-builtin{color:#30a}.cm-s-default .cm-bracket{color:#997}.cm-s-default .cm-tag{color:#170}.cm-s-default .cm-attribute{color:#00c}.cm-s-default .cm-hr{color:#999}.cm-s-default .cm-link{color:#00c}.cm-s-default .cm-error{color:red}.cm-invalidchar{color:red}.CodeMirror-composing{border-bottom:2px solid}div.CodeMirror span.CodeMirror-matchingbracket{color:#0f0}div.CodeMirror span.CodeMirror-nonmatchingbracket{color:#f22}.CodeMirror-matchingtag{background:rgba(255,150,0,.3)}.CodeMirror-activeline-background{background:#e8f2ff}.CodeMirror{position:relative;overflow:hidden;background:#fff}.CodeMirror-scroll{overflow:scroll!important;margin-bottom:-30px;margin-right:-30px;padding-bottom:30px;height:100%;outline:0;position:relative}.CodeMirror-sizer{position:relative;border-right:30px solid transparent}.CodeMirror-gutter-filler,.CodeMirror-hscrollbar,.CodeMirror-scrollbar-filler,.CodeMirror-vscrollbar{position:absolute;z-index:6;display:none}.CodeMirror-vscrollbar{right:0;top:0;overflow-x:hidden;overflow-y:scroll}.CodeMirror-hscrollbar{bottom:0;left:0;overflow-y:hidden;overflow-x:scroll}.CodeMirror-scrollbar-filler{right:0;bottom:0}.CodeMirror-gutter-filler{left:0;bottom:0}.CodeMirror-gutters{position:absolute;left:0;top:0;min-height:100%;z-index:3}.CodeMirror-gutter{white-space:normal;height:100%;display:inline-block;vertical-align:top;margin-bottom:-30px}.CodeMirror-gutter-wrapper{position:absolute;z-index:4;background:0 0!important;border:none!important}.CodeMirror-gutter-background{position:absolute;top:0;bottom:0;z-index:4}.CodeMirror-gutter-elt{position:absolute;cursor:default;z-index:4}.CodeMirror-gutter-wrapper{-webkit-user-select:none;-moz-user-select:none;user-select:none}.CodeMirror-lines{cursor:text;min-height:1px}.CodeMirror pre{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0;border-width:0;background:0 0;font-family:inherit;font-size:inherit;margin:0;white-space:pre;word-wrap:normal;line-height:inherit;color:inherit;z-index:2;position:relative;overflow:visible;-webkit-tap-highlight-color:transparent;-webkit-font-variant-ligatures:contextual;font-variant-ligatures:contextual}.CodeMirror-wrap pre{word-wrap:break-word;white-space:pre-wrap;word-break:normal}.CodeMirror-linebackground{position:absolute;left:0;right:0;top:0;bottom:0;z-index:0}.CodeMirror-linewidget{position:relative;z-index:2;overflow:auto}.CodeMirror-code{outline:0}.CodeMirror-gutter,.CodeMirror-gutters,.CodeMirror-linenumber,.CodeMirror-scroll,.CodeMirror-sizer{-moz-box-sizing:content-box;box-sizing:content-box}.CodeMirror-measure{position:absolute;width:100%;height:0;overflow:hidden;visibility:hidden}.CodeMirror-cursor{position:absolute;pointer-events:none}.CodeMirror-measure pre{position:static}div.CodeMirror-cursors{visibility:hidden;position:relative;z-index:3}div.CodeMirror-dragcursors{visibility:visible}.CodeMirror-focused div.CodeMirror-cursors{visibility:visible}.CodeMirror-selected{background:#d9d9d9}.CodeMirror-focused .CodeMirror-selected{background:#d7d4f0}.CodeMirror-crosshair{cursor:crosshair}.CodeMirror-line::selection,.CodeMirror-line>span::selection,.CodeMirror-line>span>span::selection{background:#d7d4f0}.CodeMirror-line::-moz-selection,.CodeMirror-line>span::-moz-selection,.CodeMirror-line>span>span::-moz-selection{background:#d7d4f0}.cm-searching{background:#ffa;background:rgba(255,255,0,.4)}.cm-force-border{padding-right:.1px}@media print{.CodeMirror div.CodeMirror-cursors{visibility:hidden}}.cm-tab-wrap-hack:after{content:''}span.CodeMirror-selectedtext{background:0 0}.contentview .header{font-weight:700}.contentview .highlight{font-weight:700}.contentview .offset{color:#00f}.contentview .codeeditor{margin-bottom:12px}.modal-visible{display:block}.modal-dialog{overflow-y:initial!important}.modal-body{max-height:calc(80vh);overflow-y:auto}
/*# sourceMappingURL=app.css.map */
diff --git a/mitmproxy/tools/web/static/app.js b/mitmproxy/tools/web/static/app.js
index 8ee4d97d..ace3106d 100644
--- a/mitmproxy/tools/web/static/app.js
+++ b/mitmproxy/tools/web/static/app.js
@@ -1,9344 +1,219 @@
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
-// shim for using process in browser
-var process = module.exports = {};
+"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var _react=require("react"),_react2=_interopRequireDefault(_react),_reactDom=require("react-dom"),_redux=require("redux"),_reactRedux=require("react-redux"),_reduxThunk=require("redux-thunk"),_reduxThunk2=_interopRequireDefault(_reduxThunk),_ProxyApp=require("./components/ProxyApp"),_ProxyApp2=_interopRequireDefault(_ProxyApp),_index=require("./ducks/index"),_index2=_interopRequireDefault(_index),_eventLog=require("./ducks/eventLog"),_urlState=require("./urlState"),_urlState2=_interopRequireDefault(_urlState),_websocket=require("./backends/websocket"),_websocket2=_interopRequireDefault(_websocket),_static=require("./backends/static"),_static2=_interopRequireDefault(_static),_reduxLogger=require("redux-logger"),middlewares=[_reduxThunk2.default],store=(0,_redux.createStore)(_index2.default,_redux.applyMiddleware.apply(void 0,middlewares));(0,_urlState2.default)(store),MITMWEB_STATIC?window.backend=new _static2.default(store):window.backend=new _websocket2.default(store),window.addEventListener("error",function(e){store.dispatch((0,_eventLog.add)(e))}),document.addEventListener("DOMContentLoaded",function(){(0,_reactDom.render)(_react2.default.createElement(_reactRedux.Provider,{store:store},_react2.default.createElement(_ProxyApp2.default,null)),document.getElementById("mitmproxy"))});
-// cached from whatever global is present so that test runners that stub it
-// don't break things. But we need to wrap it in a try catch in case it is
-// wrapped in strict mode code which doesn't define any globals. It's inside a
-// function because try/catches deoptimize in certain engines.
+},{"./backends/static":2,"./backends/websocket":3,"./components/ProxyApp":43,"./ducks/eventLog":56,"./ducks/index":58,"./urlState":70,"react":"react","react-dom":"react-dom","react-redux":"react-redux","redux":"redux","redux-logger":"redux-logger","redux-thunk":"redux-thunk"}],2:[function(require,module,exports){
+"use strict";function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(exports,"__esModule",{value:!0});var _createClass=function(){function e(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(t,n,a){return n&&e(t.prototype,n),a&&e(t,a),t}}(),_utils=require("../utils"),StaticBackend=function(){function e(t){_classCallCheck(this,e),this.store=t,this.onOpen()}return _createClass(e,[{key:"onOpen",value:function(){this.fetchData("flows")}},{key:"fetchData",value:function(e){var t=this;(0,_utils.fetchApi)("./"+e).then(function(e){return e.json()}).then(function(n){t.receive(e,n)})}},{key:"receive",value:function(e,t){var n=(e+"_RECEIVE").toUpperCase();this.store.dispatch({type:n,cmd:"receive",resource:e,data:t})}}]),e}();exports.default=StaticBackend;
-var cachedSetTimeout;
-var cachedClearTimeout;
+},{"../utils":71}],3:[function(require,module,exports){
+"use strict";function _interopRequireWildcard(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(exports,"__esModule",{value:!0});var _extends=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},_createClass=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),_utils=require("../utils"),_connection=require("../ducks/connection"),connectionActions=_interopRequireWildcard(_connection),CMD_RESET="reset",WebsocketBackend=function(){function e(t){_classCallCheck(this,e),this.activeFetches={},this.store=t,this.connect()}return _createClass(e,[{key:"connect",value:function(){var e=this;this.socket=new WebSocket(location.origin.replace("http","ws")+"/updates"),this.socket.addEventListener("open",function(){return e.onOpen()}),this.socket.addEventListener("close",function(t){return e.onClose(t)}),this.socket.addEventListener("message",function(t){return e.onMessage(JSON.parse(t.data))}),this.socket.addEventListener("error",function(t){return e.onError(t)})}},{key:"onOpen",value:function(){this.fetchData("settings"),this.fetchData("flows"),this.fetchData("events"),this.fetchData("options"),this.store.dispatch(connectionActions.startFetching())}},{key:"fetchData",value:function(e){var t=this,n=[];this.activeFetches[e]=n,(0,_utils.fetchApi)("./"+e).then(function(e){return e.json()}).then(function(o){t.activeFetches[e]===n&&t.receive(e,o)})}},{key:"onMessage",value:function(e){if(e.cmd===CMD_RESET)return this.fetchData(e.resource);if(e.resource in this.activeFetches)this.activeFetches[e.resource].push(e);else{var t=(e.resource+"_"+e.cmd).toUpperCase();this.store.dispatch(_extends({type:t},e))}}},{key:"receive",value:function(e,t){var n=this,o=(e+"_RECEIVE").toUpperCase();this.store.dispatch({type:o,cmd:"receive",resource:e,data:t});var c=this.activeFetches[e];delete this.activeFetches[e],c.forEach(function(e){return n.onMessage(e)}),0===Object.keys(this.activeFetches).length&&this.store.dispatch(connectionActions.connectionEstablished())}},{key:"onClose",value:function(e){this.store.dispatch(connectionActions.connectionError("Connection closed at "+(new Date).toUTCString()+" with error code "+e.code+".")),console.error("websocket connection closed",e)}},{key:"onError",value:function(){console.error("websocket connection errored",arguments)}}]),e}();exports.default=WebsocketBackend;
-function defaultSetTimout() {
- throw new Error('setTimeout has not been defined');
-}
-function defaultClearTimeout () {
- throw new Error('clearTimeout has not been defined');
-}
-(function () {
- try {
- if (typeof setTimeout === 'function') {
- cachedSetTimeout = setTimeout;
- } else {
- cachedSetTimeout = defaultSetTimout;
- }
- } catch (e) {
- cachedSetTimeout = defaultSetTimout;
- }
- try {
- if (typeof clearTimeout === 'function') {
- cachedClearTimeout = clearTimeout;
- } else {
- cachedClearTimeout = defaultClearTimeout;
- }
- } catch (e) {
- cachedClearTimeout = defaultClearTimeout;
- }
-} ())
-function runTimeout(fun) {
- if (cachedSetTimeout === setTimeout) {
- //normal enviroments in sane situations
- return setTimeout(fun, 0);
- }
- // if setTimeout wasn't available but was latter defined
- if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
- cachedSetTimeout = setTimeout;
- return setTimeout(fun, 0);
- }
- try {
- // when when somebody has screwed with setTimeout but no I.E. maddness
- return cachedSetTimeout(fun, 0);
- } catch(e){
- try {
- // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
- return cachedSetTimeout.call(null, fun, 0);
- } catch(e){
- // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
- return cachedSetTimeout.call(this, fun, 0);
- }
- }
+},{"../ducks/connection":55,"../utils":71}],4:[function(require,module,exports){
+"use strict";function _interopRequireWildcard(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function ContentView(e){var t=e.flow,n=e.message,r=e.contentView,o=e.isDisplayLarge,i=e.displayLarge,a=e.onContentChange,u=e.readonly;if(0===n.contentLength&&u)return _react2.default.createElement(MetaViews.ContentEmpty,e);if(null===n.contentLength&&u)return _react2.default.createElement(MetaViews.ContentMissing,e);if(!o&&ContentView.isContentTooLarge(n))return _react2.default.createElement(MetaViews.ContentTooLarge,_extends({},e,{onClick:i}));var l=void 0;return l="Edit"===r?_react2.default.createElement(_ContentViews.Edit,{flow:t,message:n,onChange:a}):_react2.default.createElement(_ContentViews.ViewServer,{flow:t,message:n,contentView:r}),_react2.default.createElement("div",{className:"contentview"},l,_react2.default.createElement(_ShowFullContentButton2.default,null))}Object.defineProperty(exports,"__esModule",{value:!0});var _extends=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},_react=require("react"),_react2=_interopRequireDefault(_react),_propTypes=require("prop-types"),_propTypes2=_interopRequireDefault(_propTypes),_reactRedux=require("react-redux"),_ContentViews=require("./ContentView/ContentViews"),_MetaViews=require("./ContentView/MetaViews"),MetaViews=_interopRequireWildcard(_MetaViews),_ShowFullContentButton=require("./ContentView/ShowFullContentButton"),_ShowFullContentButton2=_interopRequireDefault(_ShowFullContentButton),_flow=require("../ducks/ui/flow");ContentView.propTypes={flow:_propTypes2.default.object.isRequired,message:_propTypes2.default.object.isRequired},ContentView.isContentTooLarge=function(e){return e.contentLength>1048576*(_ContentViews.ViewImage.matches(e)?10:.2)},exports.default=(0,_reactRedux.connect)(function(e){return{contentView:e.ui.flow.contentView,isDisplayLarge:e.ui.flow.displayLarge}},{displayLarge:_flow.displayLarge,updateEdit:_flow.updateEdit})(ContentView);
-
-}
-function runClearTimeout(marker) {
- if (cachedClearTimeout === clearTimeout) {
- //normal enviroments in sane situations
- return clearTimeout(marker);
- }
- // if clearTimeout wasn't available but was latter defined
- if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
- cachedClearTimeout = clearTimeout;
- return clearTimeout(marker);
- }
- try {
- // when when somebody has screwed with setTimeout but no I.E. maddness
- return cachedClearTimeout(marker);
- } catch (e){
- try {
- // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
- return cachedClearTimeout.call(null, marker);
- } catch (e){
- // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
- // Some versions of I.E. have different rules for clearTimeout vs setTimeout
- return cachedClearTimeout.call(this, marker);
- }
- }
-
-
-
-}
-var queue = [];
-var draining = false;
-var currentQueue;
-var queueIndex = -1;
-
-function cleanUpNextTick() {
- if (!draining || !currentQueue) {
- return;
- }
- draining = false;
- if (currentQueue.length) {
- queue = currentQueue.concat(queue);
- } else {
- queueIndex = -1;
- }
- if (queue.length) {
- drainQueue();
- }
-}
-
-function drainQueue() {
- if (draining) {
- return;
- }
- var timeout = runTimeout(cleanUpNextTick);
- draining = true;
-
- var len = queue.length;
- while(len) {
- currentQueue = queue;
- queue = [];
- while (++queueIndex < len) {
- if (currentQueue) {
- currentQueue[queueIndex].run();
- }
- }
- queueIndex = -1;
- len = queue.length;
- }
- currentQueue = null;
- draining = false;
- runClearTimeout(timeout);
-}
-
-process.nextTick = function (fun) {
- var args = new Array(arguments.length - 1);
- if (arguments.length > 1) {
- for (var i = 1; i < arguments.length; i++) {
- args[i - 1] = arguments[i];
- }
- }
- queue.push(new Item(fun, args));
- if (queue.length === 1 && !draining) {
- runTimeout(drainQueue);
- }
-};
-
-// v8 likes predictible objects
-function Item(fun, array) {
- this.fun = fun;
- this.array = array;
-}
-Item.prototype.run = function () {
- this.fun.apply(null, this.array);
-};
-process.title = 'browser';
-process.browser = true;
-process.env = {};
-process.argv = [];
-process.version = ''; // empty string to avoid regexp issues
-process.versions = {};
-
-function noop() {}
-
-process.on = noop;
-process.addListener = noop;
-process.once = noop;
-process.off = noop;
-process.removeListener = noop;
-process.removeAllListeners = noop;
-process.emit = noop;
-
-process.binding = function (name) {
- throw new Error('process.binding is not supported');
-};
-
-process.cwd = function () { return '/' };
-process.chdir = function (dir) {
- throw new Error('process.chdir is not supported');
-};
-process.umask = function() { return 0; };
-
-},{}],2:[function(require,module,exports){
-(function (process){
-'use strict';
-
-var _react = require('react');
-
-var _react2 = _interopRequireDefault(_react);
-
-var _reactDom = require('react-dom');
-
-var _redux = require('redux');
-
-var _reactRedux = require('react-redux');
-
-var _reduxThunk = require('redux-thunk');
-
-var _reduxThunk2 = _interopRequireDefault(_reduxThunk);
-
-var _ProxyApp = require('./components/ProxyApp');
-
-var _ProxyApp2 = _interopRequireDefault(_ProxyApp);
-
-var _index = require('./ducks/index');
-
-var _index2 = _interopRequireDefault(_index);
-
-var _eventLog = require('./ducks/eventLog');
-
-var _urlState = require('./urlState');
-
-var _urlState2 = _interopRequireDefault(_urlState);
-
-var _websocket = require('./backends/websocket');
-
-var _websocket2 = _interopRequireDefault(_websocket);
-
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
-var middlewares = [_reduxThunk2.default];
-
-if (process.env.NODE_ENV !== 'production') {
- var createLogger = require('redux-logger');
- middlewares.push(createLogger());
-}
-
-// logger must be last
-var store = (0, _redux.createStore)(_index2.default, _redux.applyMiddleware.apply(undefined, middlewares));
-
-(0, _urlState2.default)(store);
-window.backend = new _websocket2.default(store);
-
-window.addEventListener('error', function (msg) {
- store.dispatch((0, _eventLog.add)(msg));
-});
-
-document.addEventListener('DOMContentLoaded', function () {
- (0, _reactDom.render)(_react2.default.createElement(
- _reactRedux.Provider,
- { store: store },
- _react2.default.createElement(_ProxyApp2.default, null)
- ), document.getElementById("mitmproxy"));
-});
-
-}).call(this,require('_process'))
-
-},{"./backends/websocket":3,"./components/ProxyApp":38,"./ducks/eventLog":50,"./ducks/index":52,"./urlState":61,"_process":1,"react":"react","react-dom":"react-dom","react-redux":"react-redux","redux":"redux","redux-logger":"redux-logger","redux-thunk":"redux-thunk"}],3:[function(require,module,exports){
-"use strict";
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-
-var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
-
-var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /**
- * The WebSocket backend is responsible for updating our knowledge of flows and events
- * from the REST API and live updates delivered via a WebSocket connection.
- * An alternative backend may use the REST API only to host static instances.
- */
-
-
-var _utils = require("../utils");
-
-var _connection = require("../ducks/connection");
-
-var connectionActions = _interopRequireWildcard(_connection);
-
-function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
-
-function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
-var CMD_RESET = 'reset';
-
-var WebsocketBackend = function () {
- function WebsocketBackend(store) {
- _classCallCheck(this, WebsocketBackend);
-
- this.activeFetches = {};
- this.store = store;
- this.connect();
- }
-
- _createClass(WebsocketBackend, [{
- key: "connect",
- value: function connect() {
- var _this = this;
-
- this.socket = new WebSocket(location.origin.replace('http', 'ws') + '/updates');
- this.socket.addEventListener('open', function () {
- return _this.onOpen();
- });
- this.socket.addEventListener('close', function (event) {
- return _this.onClose(event);
- });
- this.socket.addEventListener('message', function (msg) {
- return _this.onMessage(JSON.parse(msg.data));
- });
- this.socket.addEventListener('error', function (error) {
- return _this.onError(error);
- });
- }
- }, {
- key: "onOpen",
- value: function onOpen() {
- this.fetchData("settings");
- this.fetchData("flows");
- this.fetchData("events");
- this.store.dispatch(connectionActions.startFetching());
- }
- }, {
- key: "fetchData",
- value: function fetchData(resource) {
- var _this2 = this;
-
- var queue = [];
- this.activeFetches[resource] = queue;
- (0, _utils.fetchApi)("/" + resource).then(function (res) {
- return res.json();
- }).then(function (json) {
- // Make sure that we are not superseded yet by the server sending a RESET.
- if (_this2.activeFetches[resource] === queue) _this2.receive(resource, json);
- });
- }
- }, {
- key: "onMessage",
- value: function onMessage(msg) {
-
- if (msg.cmd === CMD_RESET) {
- return this.fetchData(msg.resource);
- }
- if (msg.resource in this.activeFetches) {
- this.activeFetches[msg.resource].push(msg);
- } else {
- var type = (msg.resource + "_" + msg.cmd).toUpperCase();
- this.store.dispatch(_extends({ type: type }, msg));
- }
- }
- }, {
- key: "receive",
- value: function receive(resource, data) {
- var _this3 = this;
-
- var type = (resource + "_RECEIVE").toUpperCase();
- this.store.dispatch({ type: type, cmd: "receive", resource: resource, data: data });
- var queue = this.activeFetches[resource];
- delete this.activeFetches[resource];
- queue.forEach(function (msg) {
- return _this3.onMessage(msg);
- });
-
- if (Object.keys(this.activeFetches).length === 0) {
- // We have fetched the last resource
- this.store.dispatch(connectionActions.connectionEstablished());
- }
- }
- }, {
- key: "onClose",
- value: function onClose(closeEvent) {
- this.store.dispatch(connectionActions.connectionError("Connection closed at " + new Date().toUTCString() + " with error code " + closeEvent.code + "."));
- console.error("websocket connection closed", closeEvent);
- }
- }, {
- key: "onError",
- value: function onError() {
- // FIXME
- console.error("websocket connection errored", arguments);
- }
- }]);
-
- return WebsocketBackend;
-}();
-
-exports.default = WebsocketBackend;
-
-},{"../ducks/connection":49,"../utils":62}],4:[function(require,module,exports){
-'use strict';
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-
-var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
-
-var _react = require('react');
-
-var _react2 = _interopRequireDefault(_react);
-
-var _propTypes = require('prop-types');
-
-var _propTypes2 = _interopRequireDefault(_propTypes);
-
-var _reactRedux = require('react-redux');
-
-var _ContentViews = require('./ContentView/ContentViews');
-
-var ContentViews = _interopRequireWildcard(_ContentViews);
-
-var _MetaViews = require('./ContentView/MetaViews');
-
-var MetaViews = _interopRequireWildcard(_MetaViews);
-
-var _ShowFullContentButton = require('./ContentView/ShowFullContentButton');
-
-var _ShowFullContentButton2 = _interopRequireDefault(_ShowFullContentButton);
-
-var _flow = require('../ducks/ui/flow');
-
-function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
-
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
-ContentView.propTypes = {
- // It may seem a bit weird at the first glance:
- // Every view takes the flow and the message as props, e.g.
- // <Auto flow={flow} message={flow.request}/>
- flow: _propTypes2.default.object.isRequired,
- message: _propTypes2.default.object.isRequired
-};
-
-ContentView.isContentTooLarge = function (msg) {
- return msg.contentLength > 1024 * 1024 * (ContentViews.ViewImage.matches(msg) ? 10 : 0.2);
-};
-
-function ContentView(props) {
- var flow = props.flow,
- message = props.message,
- contentView = props.contentView,
- isDisplayLarge = props.isDisplayLarge,
- displayLarge = props.displayLarge,
- onContentChange = props.onContentChange,
- readonly = props.readonly;
-
-
- if (message.contentLength === 0 && readonly) {
- return _react2.default.createElement(MetaViews.ContentEmpty, props);
- }
-
- if (message.contentLength === null && readonly) {
- return _react2.default.createElement(MetaViews.ContentMissing, props);
- }
-
- if (!isDisplayLarge && ContentView.isContentTooLarge(message)) {
- return _react2.default.createElement(MetaViews.ContentTooLarge, _extends({}, props, { onClick: displayLarge }));
- }
-
- var View = ContentViews[contentView] || ContentViews['ViewServer'];
- return _react2.default.createElement(
- 'div',
- { className: 'contentview' },
- _react2.default.createElement(View, { flow: flow, message: message, contentView: contentView, readonly: readonly, onChange: onContentChange }),
- _react2.default.createElement(_ShowFullContentButton2.default, null)
- );
-}
-
-exports.default = (0, _reactRedux.connect)(function (state) {
- return {
- contentView: state.ui.flow.contentView,
- isDisplayLarge: state.ui.flow.displayLarge
- };
-}, {
- displayLarge: _flow.displayLarge,
- updateEdit: _flow.updateEdit
-})(ContentView);
-
-},{"../ducks/ui/flow":54,"./ContentView/ContentViews":8,"./ContentView/MetaViews":10,"./ContentView/ShowFullContentButton":11,"prop-types":"prop-types","react":"react","react-redux":"react-redux"}],5:[function(require,module,exports){
-'use strict';
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports.default = CodeEditor;
-
-var _react = require('react');
-
-var _react2 = _interopRequireDefault(_react);
-
-var _propTypes = require('prop-types');
-
-var _propTypes2 = _interopRequireDefault(_propTypes);
-
-var _reactCodemirror = require('react-codemirror');
-
-var _reactCodemirror2 = _interopRequireDefault(_reactCodemirror);
-
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
-CodeEditor.propTypes = {
- content: _propTypes2.default.string.isRequired,
- onChange: _propTypes2.default.func.isRequired
-};
-
-function CodeEditor(_ref) {
- var content = _ref.content,
- onChange = _ref.onChange;
-
-
- var options = {
- lineNumbers: true
- };
- return _react2.default.createElement(
- 'div',
- { className: 'codeeditor', onKeyDown: function onKeyDown(e) {
- return e.stopPropagation();
- } },
- _react2.default.createElement(_reactCodemirror2.default, { value: content, onChange: onChange, options: options })
- );
-}
+},{"../ducks/ui/flow":61,"./ContentView/ContentViews":8,"./ContentView/MetaViews":10,"./ContentView/ShowFullContentButton":11,"prop-types":"prop-types","react":"react","react-redux":"react-redux"}],5:[function(require,module,exports){
+"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function CodeEditor(e){var r=e.content,t=e.onChange,o={lineNumbers:!0};return _react2.default.createElement("div",{className:"codeeditor",onKeyDown:function(e){return e.stopPropagation()}},_react2.default.createElement(_reactCodemirror2.default,{value:r,onChange:t,options:o}))}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=CodeEditor;var _react=require("react"),_react2=_interopRequireDefault(_react),_propTypes=require("prop-types"),_propTypes2=_interopRequireDefault(_propTypes),_reactCodemirror=require("react-codemirror"),_reactCodemirror2=_interopRequireDefault(_reactCodemirror);CodeEditor.propTypes={content:_propTypes2.default.string.isRequired,onChange:_propTypes2.default.func.isRequired};
},{"prop-types":"prop-types","react":"react","react-codemirror":"react-codemirror"}],6:[function(require,module,exports){
-'use strict';
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-
-var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
-
-var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-
-var _react = require('react');
-
-var _react2 = _interopRequireDefault(_react);
-
-var _propTypes = require('prop-types');
-
-var _propTypes2 = _interopRequireDefault(_propTypes);
-
-var _utils = require('../../flow/utils.js');
-
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
-function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
-function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
-
-function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
-
-exports.default = function (View) {
- var _class, _temp;
-
- return _temp = _class = function (_React$Component) {
- _inherits(_class, _React$Component);
-
- function _class(props) {
- _classCallCheck(this, _class);
-
- var _this = _possibleConstructorReturn(this, (_class.__proto__ || Object.getPrototypeOf(_class)).call(this, props));
-
- _this.state = {
- content: undefined,
- request: undefined
- };
- return _this;
- }
-
- _createClass(_class, [{
- key: 'componentWillMount',
- value: function componentWillMount() {
- this.updateContent(this.props);
- }
- }, {
- key: 'componentWillReceiveProps',
- value: function componentWillReceiveProps(nextProps) {
- if (nextProps.message.content !== this.props.message.content || nextProps.message.contentHash !== this.props.message.contentHash || nextProps.contentView !== this.props.contentView) {
- this.updateContent(nextProps);
- }
- }
- }, {
- key: 'componentWillUnmount',
- value: function componentWillUnmount() {
- if (this.state.request) {
- this.state.request.abort();
- }
- }
- }, {
- key: 'updateContent',
- value: function updateContent(props) {
- if (this.state.request) {
- this.state.request.abort();
- }
- // We have a few special cases where we do not need to make an HTTP request.
- if (props.message.content !== undefined) {
- return this.setState({ request: undefined, content: props.message.content });
- }
- if (props.message.contentLength === 0 || props.message.contentLength === null) {
- return this.setState({ request: undefined, content: "" });
- }
-
- var requestUrl = _utils.MessageUtils.getContentURL(props.flow, props.message, View.name == 'ViewServer' ? props.contentView : undefined);
-
- // We use XMLHttpRequest instead of fetch() because fetch() is not (yet) abortable.
- var request = new XMLHttpRequest();
- request.addEventListener("load", this.requestComplete.bind(this, request));
- request.addEventListener("error", this.requestFailed.bind(this, request));
- request.open("GET", requestUrl);
- request.send();
- this.setState({ request: request, content: undefined });
- }
- }, {
- key: 'requestComplete',
- value: function requestComplete(request, e) {
- if (request !== this.state.request) {
- return; // Stale request
- }
- this.setState({
- content: request.responseText,
- request: undefined
- });
- }
- }, {
- key: 'requestFailed',
- value: function requestFailed(request, e) {
- if (request !== this.state.request) {
- return; // Stale request
- }
- console.error(e);
- // FIXME: Better error handling
- this.setState({
- content: "Error getting content.",
- request: undefined
- });
- }
- }, {
- key: 'render',
- value: function render() {
- return this.state.content !== undefined ? _react2.default.createElement(View, _extends({ content: this.state.content }, this.props)) : _react2.default.createElement(
- 'div',
- { className: 'text-center' },
- _react2.default.createElement('i', { className: 'fa fa-spinner fa-spin' })
- );
- }
- }]);
-
- return _class;
- }(_react2.default.Component), _class.displayName = View.displayName || View.name, _class.matches = View.matches, _class.propTypes = _extends({}, View.propTypes, {
- content: _propTypes2.default.string, // mark as non-required
- flow: _propTypes2.default.object.isRequired,
- message: _propTypes2.default.object.isRequired
- }), _temp;
-};
-
-},{"../../flow/utils.js":60,"prop-types":"prop-types","react":"react"}],7:[function(require,module,exports){
-'use strict';
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-
-var _react = require('react');
-
-var _react2 = _interopRequireDefault(_react);
-
-var _propTypes = require('prop-types');
-
-var _propTypes2 = _interopRequireDefault(_propTypes);
-
-var _reactRedux = require('react-redux');
-
-var _ViewSelector = require('./ViewSelector');
-
-var _ViewSelector2 = _interopRequireDefault(_ViewSelector);
-
-var _UploadContentButton = require('./UploadContentButton');
-
-var _UploadContentButton2 = _interopRequireDefault(_UploadContentButton);
-
-var _DownloadContentButton = require('./DownloadContentButton');
+"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function withContentLoader(e){var t,n;return n=t=function(t){function n(e){_classCallCheck(this,n);var t=_possibleConstructorReturn(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,e));return t.state={content:void 0,request:void 0},t}return _inherits(n,t),_createClass(n,[{key:"componentWillMount",value:function(){this.updateContent(this.props)}},{key:"componentWillReceiveProps",value:function(e){e.message.content===this.props.message.content&&e.message.contentHash===this.props.message.contentHash&&e.contentView===this.props.contentView||this.updateContent(e)}},{key:"componentWillUnmount",value:function(){this.state.request&&this.state.request.abort()}},{key:"updateContent",value:function(e){if(this.state.request&&this.state.request.abort(),void 0!==e.message.content)return this.setState({request:void 0,content:e.message.content});if(0===e.message.contentLength||null===e.message.contentLength)return this.setState({request:void 0,content:""});var t=_utils.MessageUtils.getContentURL(e.flow,e.message,e.contentView),n=new XMLHttpRequest;n.addEventListener("load",this.requestComplete.bind(this,n)),n.addEventListener("error",this.requestFailed.bind(this,n)),n.open("GET",t),n.send(),this.setState({request:n,content:void 0})}},{key:"requestComplete",value:function(e,t){e===this.state.request&&this.setState({content:e.responseText,request:void 0})}},{key:"requestFailed",value:function(e,t){e===this.state.request&&(console.error(t),this.setState({content:"Error getting content.",request:void 0}))}},{key:"render",value:function(){return void 0!==this.state.content?_react2.default.createElement(e,_extends({content:this.state.content},this.props)):_react2.default.createElement("div",{className:"text-center"},_react2.default.createElement("i",{className:"fa fa-spinner fa-spin"}))}}]),n}(_react2.default.Component),t.displayName=e.displayName||e.name,t.matches=e.matches,t.propTypes=_extends({},e.propTypes,{content:_propTypes2.default.string,flow:_propTypes2.default.object.isRequired,message:_propTypes2.default.object.isRequired}),n}Object.defineProperty(exports,"__esModule",{value:!0});var _extends=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},_createClass=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();exports.default=withContentLoader;var _react=require("react"),_react2=_interopRequireDefault(_react),_propTypes=require("prop-types"),_propTypes2=_interopRequireDefault(_propTypes),_utils=require("../../flow/utils.js");
-var _DownloadContentButton2 = _interopRequireDefault(_DownloadContentButton);
-
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
-ContentViewOptions.propTypes = {
- flow: _propTypes2.default.object.isRequired,
- message: _propTypes2.default.object.isRequired
-};
-
-function ContentViewOptions(_ref) {
- var flow = _ref.flow,
- message = _ref.message,
- uploadContent = _ref.uploadContent,
- readonly = _ref.readonly,
- contentViewDescription = _ref.contentViewDescription;
-
- return _react2.default.createElement(
- 'div',
- { className: 'view-options' },
- readonly ? _react2.default.createElement(_ViewSelector2.default, { message: message }) : _react2.default.createElement(
- 'span',
- null,
- _react2.default.createElement(
- 'b',
- null,
- 'View:'
- ),
- ' edit'
- ),
- '\xA0',
- _react2.default.createElement(_DownloadContentButton2.default, { flow: flow, message: message }),
- '\xA0',
- !readonly && _react2.default.createElement(_UploadContentButton2.default, { uploadContent: uploadContent }),
- '\xA0',
- readonly && _react2.default.createElement(
- 'span',
- null,
- contentViewDescription
- )
- );
-}
-
-exports.default = (0, _reactRedux.connect)(function (state) {
- return {
- contentViewDescription: state.ui.flow.viewDescription,
- readonly: !state.ui.flow.modifiedFlow
- };
-})(ContentViewOptions);
+},{"../../flow/utils.js":69,"prop-types":"prop-types","react":"react"}],7:[function(require,module,exports){
+"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function ContentViewOptions(e){var t=e.flow,o=e.message,n=e.uploadContent,r=e.readonly,a=e.contentViewDescription;return _react2.default.createElement("div",{className:"view-options"},r?_react2.default.createElement(_ViewSelector2.default,{message:o}):_react2.default.createElement("span",null,_react2.default.createElement("b",null,"View:")," edit")," ",_react2.default.createElement(_DownloadContentButton2.default,{flow:t,message:o})," ",!r&&_react2.default.createElement(_UploadContentButton2.default,{uploadContent:n})," ",r&&_react2.default.createElement("span",null,a))}Object.defineProperty(exports,"__esModule",{value:!0});var _react=require("react"),_react2=_interopRequireDefault(_react),_propTypes=require("prop-types"),_propTypes2=_interopRequireDefault(_propTypes),_reactRedux=require("react-redux"),_ViewSelector=require("./ViewSelector"),_ViewSelector2=_interopRequireDefault(_ViewSelector),_UploadContentButton=require("./UploadContentButton"),_UploadContentButton2=_interopRequireDefault(_UploadContentButton),_DownloadContentButton=require("./DownloadContentButton"),_DownloadContentButton2=_interopRequireDefault(_DownloadContentButton);ContentViewOptions.propTypes={flow:_propTypes2.default.object.isRequired,message:_propTypes2.default.object.isRequired},exports.default=(0,_reactRedux.connect)(function(e){return{contentViewDescription:e.ui.flow.viewDescription,readonly:!e.ui.flow.modifiedFlow}})(ContentViewOptions);
},{"./DownloadContentButton":9,"./UploadContentButton":12,"./ViewSelector":13,"prop-types":"prop-types","react":"react","react-redux":"react-redux"}],8:[function(require,module,exports){
-'use strict';
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports.ViewImage = exports.ViewServer = exports.Edit = undefined;
-
-var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();
-
-var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-
-var _react = require('react');
-
-var _react2 = _interopRequireDefault(_react);
-
-var _propTypes = require('prop-types');
-
-var _propTypes2 = _interopRequireDefault(_propTypes);
-
-var _reactRedux = require('react-redux');
-
-var _flow = require('../../ducks/ui/flow');
-
-var _ContentLoader = require('./ContentLoader');
-
-var _ContentLoader2 = _interopRequireDefault(_ContentLoader);
-
-var _utils = require('../../flow/utils');
-
-var _CodeEditor = require('./CodeEditor');
-
-var _CodeEditor2 = _interopRequireDefault(_CodeEditor);
-
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
-function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
-function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
-
-function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
-
-var isImage = /^image\/(png|jpe?g|gif|vnc.microsoft.icon|x-icon)$/i;
-ViewImage.matches = function (msg) {
- return isImage.test(_utils.MessageUtils.getContentType(msg));
-};
-ViewImage.propTypes = {
- flow: _propTypes2.default.object.isRequired,
- message: _propTypes2.default.object.isRequired
-};
-function ViewImage(_ref) {
- var flow = _ref.flow,
- message = _ref.message;
-
- return _react2.default.createElement(
- 'div',
- { className: 'flowview-image' },
- _react2.default.createElement('img', { src: _utils.MessageUtils.getContentURL(flow, message), alt: 'preview', className: 'img-thumbnail' })
- );
-}
-
-Edit.propTypes = {
- content: _propTypes2.default.string.isRequired
-};
-
-function Edit(_ref2) {
- var content = _ref2.content,
- onChange = _ref2.onChange;
-
- return _react2.default.createElement(_CodeEditor2.default, { content: content, onChange: onChange });
-}
-exports.Edit = Edit = (0, _ContentLoader2.default)(Edit);
-
-var ViewServer = function (_Component) {
- _inherits(ViewServer, _Component);
-
- function ViewServer() {
- _classCallCheck(this, ViewServer);
-
- return _possibleConstructorReturn(this, (ViewServer.__proto__ || Object.getPrototypeOf(ViewServer)).apply(this, arguments));
- }
-
- _createClass(ViewServer, [{
- key: 'componentWillMount',
- value: function componentWillMount() {
- this.setContentView(this.props);
- }
- }, {
- key: 'componentWillReceiveProps',
- value: function componentWillReceiveProps(nextProps) {
- if (nextProps.content != this.props.content) {
- this.setContentView(nextProps);
- }
- }
- }, {
- key: 'setContentView',
- value: function setContentView(props) {
- try {
- this.data = JSON.parse(props.content);
- } catch (err) {
- this.data = { lines: [], description: err.message };
- }
-
- props.setContentViewDescription(props.contentView != this.data.description ? this.data.description : '');
- props.setContent(this.data.lines);
- }
- }, {
- key: 'render',
- value: function render() {
- var _props = this.props,
- content = _props.content,
- contentView = _props.contentView,
- message = _props.message,
- maxLines = _props.maxLines;
-
- var lines = this.props.showFullContent ? this.data.lines : this.data.lines.slice(0, maxLines);
- return _react2.default.createElement(
- 'div',
- null,
- ViewImage.matches(message) && _react2.default.createElement(ViewImage, this.props),
- _react2.default.createElement(
- 'pre',
- null,
- lines.map(function (line, i) {
- return _react2.default.createElement(
- 'div',
- { key: 'line' + i },
- line.map(function (element, j) {
- var _element = _slicedToArray(element, 2),
- style = _element[0],
- text = _element[1];
-
- return _react2.default.createElement(
- 'span',
- { key: 'tuple' + j, className: style },
- text
- );
- })
- );
- })
- )
- );
- }
- }]);
-
- return ViewServer;
-}(_react.Component);
-
-ViewServer.propTypes = {
- showFullContent: _propTypes2.default.bool.isRequired,
- maxLines: _propTypes2.default.number.isRequired,
- setContentViewDescription: _propTypes2.default.func.isRequired,
- setContent: _propTypes2.default.func.isRequired
-};
-
-
-exports.ViewServer = ViewServer = (0, _reactRedux.connect)(function (state) {
- return {
- showFullContent: state.ui.flow.showFullContent,
- maxLines: state.ui.flow.maxContentLines
- };
-}, {
- setContentViewDescription: _flow.setContentViewDescription,
- setContent: _flow.setContent
-})((0, _ContentLoader2.default)(ViewServer));
-
-exports.Edit = Edit;
-exports.ViewServer = ViewServer;
-exports.ViewImage = ViewImage;
-
-},{"../../ducks/ui/flow":54,"../../flow/utils":60,"./CodeEditor":5,"./ContentLoader":6,"prop-types":"prop-types","react":"react","react-redux":"react-redux"}],9:[function(require,module,exports){
-"use strict";
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports.default = DownloadContentButton;
-
-var _utils = require("../../flow/utils");
-
-var _propTypes = require("prop-types");
-
-var _propTypes2 = _interopRequireDefault(_propTypes);
-
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
-DownloadContentButton.propTypes = {
- flow: _propTypes2.default.object.isRequired,
- message: _propTypes2.default.object.isRequired
-};
-
-function DownloadContentButton(_ref) {
- var flow = _ref.flow,
- message = _ref.message;
-
-
- return React.createElement(
- "a",
- { className: "btn btn-default btn-xs",
- href: _utils.MessageUtils.getContentURL(flow, message),
- title: "Download the content of the flow." },
- React.createElement("i", { className: "fa fa-download" })
- );
-}
-
-},{"../../flow/utils":60,"prop-types":"prop-types"}],10:[function(require,module,exports){
-'use strict';
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports.ContentEmpty = ContentEmpty;
-exports.ContentMissing = ContentMissing;
-exports.ContentTooLarge = ContentTooLarge;
-
-var _react = require('react');
-
-var _react2 = _interopRequireDefault(_react);
-
-var _utils = require('../../utils.js');
-
-var _UploadContentButton = require('./UploadContentButton');
-
-var _UploadContentButton2 = _interopRequireDefault(_UploadContentButton);
-
-var _DownloadContentButton = require('./DownloadContentButton');
-
-var _DownloadContentButton2 = _interopRequireDefault(_DownloadContentButton);
-
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
-function ContentEmpty(_ref) {
- var flow = _ref.flow,
- message = _ref.message;
-
- return _react2.default.createElement(
- 'div',
- { className: 'alert alert-info' },
- 'No ',
- flow.request === message ? 'request' : 'response',
- ' content.'
- );
-}
-
-function ContentMissing(_ref2) {
- var flow = _ref2.flow,
- message = _ref2.message;
-
- return _react2.default.createElement(
- 'div',
- { className: 'alert alert-info' },
- flow.request === message ? 'Request' : 'Response',
- ' content missing.'
- );
-}
-
-function ContentTooLarge(_ref3) {
- var message = _ref3.message,
- onClick = _ref3.onClick,
- uploadContent = _ref3.uploadContent,
- flow = _ref3.flow;
-
- return _react2.default.createElement(
- 'div',
- null,
- _react2.default.createElement(
- 'div',
- { className: 'alert alert-warning' },
- _react2.default.createElement(
- 'button',
- { onClick: onClick, className: 'btn btn-xs btn-warning pull-right' },
- 'Display anyway'
- ),
- (0, _utils.formatSize)(message.contentLength),
- ' content size.'
- ),
- _react2.default.createElement(
- 'div',
- { className: 'view-options text-center' },
- _react2.default.createElement(_UploadContentButton2.default, { uploadContent: uploadContent }),
- '\xA0',
- _react2.default.createElement(_DownloadContentButton2.default, { flow: flow, message: message })
- )
- );
-}
-
-},{"../../utils.js":62,"./DownloadContentButton":9,"./UploadContentButton":12,"react":"react"}],11:[function(require,module,exports){
-'use strict';
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-
-var _react = require('react');
-
-var _react2 = _interopRequireDefault(_react);
-
-var _propTypes = require('prop-types');
-
-var _propTypes2 = _interopRequireDefault(_propTypes);
-
-var _reactRedux = require('react-redux');
-
-var _reactDom = require('react-dom');
-
-var _Button = require('../common/Button');
-
-var _Button2 = _interopRequireDefault(_Button);
-
-var _flow = require('../../ducks/ui/flow');
-
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
-ShowFullContentButton.propTypes = {
- setShowFullContent: _propTypes2.default.func.isRequired,
- showFullContent: _propTypes2.default.bool.isRequired
-};
-
-function ShowFullContentButton(_ref) {
- var setShowFullContent = _ref.setShowFullContent,
- showFullContent = _ref.showFullContent,
- visibleLines = _ref.visibleLines,
- contentLines = _ref.contentLines;
-
-
- return !showFullContent && _react2.default.createElement(
- 'div',
- null,
- _react2.default.createElement(
- _Button2.default,
- { className: 'view-all-content-btn btn-xs', onClick: function onClick() {
- return setShowFullContent();
- } },
- 'Show full content'
- ),
- _react2.default.createElement(
- 'span',
- { className: 'pull-right' },
- ' ',
- visibleLines,
- '/',
- contentLines,
- ' are visible \xA0 '
- )
- );
-}
-
-exports.default = (0, _reactRedux.connect)(function (state) {
- return {
- showFullContent: state.ui.flow.showFullContent,
- visibleLines: state.ui.flow.maxContentLines,
- contentLines: state.ui.flow.content.length
-
- };
-}, {
- setShowFullContent: _flow.setShowFullContent
-})(ShowFullContentButton);
-
-},{"../../ducks/ui/flow":54,"../common/Button":41,"prop-types":"prop-types","react":"react","react-dom":"react-dom","react-redux":"react-redux"}],12:[function(require,module,exports){
-'use strict';
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports.default = UploadContentButton;
-
-var _propTypes = require('prop-types');
-
-var _propTypes2 = _interopRequireDefault(_propTypes);
-
-var _FileChooser = require('../common/FileChooser');
-
-var _FileChooser2 = _interopRequireDefault(_FileChooser);
-
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
-UploadContentButton.propTypes = {
- uploadContent: _propTypes2.default.func.isRequired
-};
-
-function UploadContentButton(_ref) {
- var uploadContent = _ref.uploadContent;
-
-
- return React.createElement(_FileChooser2.default, {
- icon: 'fa-upload',
- title: 'Upload a file to replace the content.',
- onOpenFile: uploadContent,
- className: 'btn btn-default btn-xs' });
-}
-
-},{"../common/FileChooser":44,"prop-types":"prop-types"}],13:[function(require,module,exports){
-'use strict';
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-
-var _react = require('react');
-
-var _react2 = _interopRequireDefault(_react);
-
-var _propTypes = require('prop-types');
-
-var _propTypes2 = _interopRequireDefault(_propTypes);
-
-var _reactRedux = require('react-redux');
-
-var _flow = require('../../ducks/ui/flow');
-
-var _Dropdown = require('../common/Dropdown');
-
-var _Dropdown2 = _interopRequireDefault(_Dropdown);
-
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
-ViewSelector.propTypes = {
- contentViews: _propTypes2.default.array.isRequired,
- activeView: _propTypes2.default.string.isRequired,
- setContentView: _propTypes2.default.func.isRequired
-};
-
-function ViewSelector(_ref) {
- var contentViews = _ref.contentViews,
- activeView = _ref.activeView,
- setContentView = _ref.setContentView;
-
- var inner = _react2.default.createElement(
- 'span',
- null,
- ' ',
- _react2.default.createElement(
- 'b',
- null,
- 'View:'
- ),
- ' ',
- activeView.toLowerCase(),
- ' ',
- _react2.default.createElement('span', { className: 'caret' }),
- ' '
- );
-
- return _react2.default.createElement(
- _Dropdown2.default,
- { dropup: true, className: 'pull-left', btnClass: 'btn btn-default btn-xs', text: inner },
- contentViews.map(function (name) {
- return _react2.default.createElement(
- 'a',
- { href: '#', key: name, onClick: function onClick(e) {
- e.preventDefault();setContentView(name);
- } },
- name.toLowerCase().replace('_', ' ')
- );
- })
- );
-}
-
-exports.default = (0, _reactRedux.connect)(function (state) {
- return {
- contentViews: state.settings.contentViews,
- activeView: state.ui.flow.contentView
- };
-}, {
- setContentView: _flow.setContentView
-})(ViewSelector);
-
-},{"../../ducks/ui/flow":54,"../common/Dropdown":43,"prop-types":"prop-types","react":"react","react-redux":"react-redux"}],14:[function(require,module,exports){
-'use strict';
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-
-var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-
-var _react = require('react');
-
-var _react2 = _interopRequireDefault(_react);
-
-var _propTypes = require('prop-types');
-
-var _propTypes2 = _interopRequireDefault(_propTypes);
-
-var _reactRedux = require('react-redux');
-
-var _eventLog = require('../ducks/eventLog');
-
-var _ToggleButton = require('./common/ToggleButton');
-
-var _ToggleButton2 = _interopRequireDefault(_ToggleButton);
-
-var _EventList = require('./EventLog/EventList');
-
-var _EventList2 = _interopRequireDefault(_EventList);
-
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
-function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
-function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
-
-function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
-
-var EventLog = function (_Component) {
- _inherits(EventLog, _Component);
-
- function EventLog(props, context) {
- _classCallCheck(this, EventLog);
-
- var _this = _possibleConstructorReturn(this, (EventLog.__proto__ || Object.getPrototypeOf(EventLog)).call(this, props, context));
-
- _this.state = { height: _this.props.defaultHeight };
-
- _this.onDragStart = _this.onDragStart.bind(_this);
- _this.onDragMove = _this.onDragMove.bind(_this);
- _this.onDragStop = _this.onDragStop.bind(_this);
- return _this;
- }
-
- _createClass(EventLog, [{
- key: 'onDragStart',
- value: function onDragStart(event) {
- event.preventDefault();
- this.dragStart = this.state.height + event.pageY;
- window.addEventListener('mousemove', this.onDragMove);
- window.addEventListener('mouseup', this.onDragStop);
- window.addEventListener('dragend', this.onDragStop);
- }
- }, {
- key: 'onDragMove',
- value: function onDragMove(event) {
- event.preventDefault();
- this.setState({ height: this.dragStart - event.pageY });
- }
- }, {
- key: 'onDragStop',
- value: function onDragStop(event) {
- event.preventDefault();
- window.removeEventListener('mousemove', this.onDragMove);
- }
- }, {
- key: 'render',
- value: function render() {
- var height = this.state.height;
- var _props = this.props,
- filters = _props.filters,
- events = _props.events,
- toggleFilter = _props.toggleFilter,
- close = _props.close;
-
-
- return _react2.default.createElement(
- 'div',
- { className: 'eventlog', style: { height: height } },
- _react2.default.createElement(
- 'div',
- { onMouseDown: this.onDragStart },
- 'Eventlog',
- _react2.default.createElement(
- 'div',
- { className: 'pull-right' },
- ['debug', 'info', 'web', 'warn', 'error'].map(function (type) {
- return _react2.default.createElement(_ToggleButton2.default, { key: type, text: type, checked: filters[type], onToggle: function onToggle() {
- return toggleFilter(type);
- } });
- }),
- _react2.default.createElement('i', { onClick: close, className: 'fa fa-close' })
- )
- ),
- _react2.default.createElement(_EventList2.default, { events: events })
- );
- }
- }]);
-
- return EventLog;
-}(_react.Component);
-
-EventLog.propTypes = {
- filters: _propTypes2.default.object.isRequired,
- events: _propTypes2.default.array.isRequired,
- toggleFilter: _propTypes2.default.func.isRequired,
- close: _propTypes2.default.func.isRequired,
- defaultHeight: _propTypes2.default.number
-};
-EventLog.defaultProps = {
- defaultHeight: 200
-};
-exports.default = (0, _reactRedux.connect)(function (state) {
- return {
- filters: state.eventLog.filters,
- events: state.eventLog.view
- };
-}, {
- close: _eventLog.toggleVisibility,
- toggleFilter: _eventLog.toggleFilter
-})(EventLog);
-
-},{"../ducks/eventLog":50,"./EventLog/EventList":15,"./common/ToggleButton":46,"prop-types":"prop-types","react":"react","react-redux":"react-redux"}],15:[function(require,module,exports){
-'use strict';
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-
-var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-
-var _react = require('react');
-
-var _react2 = _interopRequireDefault(_react);
-
-var _propTypes = require('prop-types');
-
-var _propTypes2 = _interopRequireDefault(_propTypes);
-
-var _reactDom = require('react-dom');
-
-var _reactDom2 = _interopRequireDefault(_reactDom);
-
-var _shallowequal = require('shallowequal');
-
-var _shallowequal2 = _interopRequireDefault(_shallowequal);
-
-var _AutoScroll = require('../helpers/AutoScroll');
-
-var _AutoScroll2 = _interopRequireDefault(_AutoScroll);
-
-var _VirtualScroll = require('../helpers/VirtualScroll');
-
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
-function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
-function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
-
-function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
-
-var EventLogList = function (_Component) {
- _inherits(EventLogList, _Component);
-
- function EventLogList(props) {
- _classCallCheck(this, EventLogList);
-
- var _this = _possibleConstructorReturn(this, (EventLogList.__proto__ || Object.getPrototypeOf(EventLogList)).call(this, props));
-
- _this.heights = {};
- _this.state = { vScroll: (0, _VirtualScroll.calcVScroll)() };
-
- _this.onViewportUpdate = _this.onViewportUpdate.bind(_this);
- return _this;
- }
-
- _createClass(EventLogList, [{
- key: 'componentDidMount',
- value: function componentDidMount() {
- window.addEventListener('resize', this.onViewportUpdate);
- this.onViewportUpdate();
- }
- }, {
- key: 'componentWillUnmount',
- value: function componentWillUnmount() {
- window.removeEventListener('resize', this.onViewportUpdate);
- }
- }, {
- key: 'componentDidUpdate',
- value: function componentDidUpdate() {
- this.onViewportUpdate();
- }
- }, {
- key: 'onViewportUpdate',
- value: function onViewportUpdate() {
- var _this2 = this;
-
- var viewport = _reactDom2.default.findDOMNode(this);
-
- var vScroll = (0, _VirtualScroll.calcVScroll)({
- itemCount: this.props.events.length,
- rowHeight: this.props.rowHeight,
- viewportTop: viewport.scrollTop,
- viewportHeight: viewport.offsetHeight,
- itemHeights: this.props.events.map(function (entry) {
- return _this2.heights[entry.id];
- })
- });
-
- if (!(0, _shallowequal2.default)(this.state.vScroll, vScroll)) {
- this.setState({ vScroll: vScroll });
- }
- }
- }, {
- key: 'setHeight',
- value: function setHeight(id, node) {
- if (node && !this.heights[id]) {
- var height = node.offsetHeight;
- if (this.heights[id] !== height) {
- this.heights[id] = height;
- this.onViewportUpdate();
- }
- }
- }
- }, {
- key: 'render',
- value: function render() {
- var _this3 = this;
-
- var vScroll = this.state.vScroll;
- var events = this.props.events;
-
-
- return _react2.default.createElement(
- 'pre',
- { onScroll: this.onViewportUpdate },
- _react2.default.createElement('div', { style: { height: vScroll.paddingTop } }),
- events.slice(vScroll.start, vScroll.end).map(function (event) {
- return _react2.default.createElement(
- 'div',
- { key: event.id, ref: function ref(node) {
- return _this3.setHeight(event.id, node);
- } },
- _react2.default.createElement(LogIcon, { event: event }),
- event.message
- );
- }),
- _react2.default.createElement('div', { style: { height: vScroll.paddingBottom } })
- );
- }
- }]);
-
- return EventLogList;
-}(_react.Component);
-
-EventLogList.propTypes = {
- events: _propTypes2.default.array.isRequired,
- rowHeight: _propTypes2.default.number
-};
-EventLogList.defaultProps = {
- rowHeight: 18
-};
-
-
-function LogIcon(_ref) {
- var event = _ref.event;
-
- var icon = {
- web: 'html5',
- debug: 'bug',
- warn: 'exclamation-triangle',
- error: 'ban'
- }[event.level] || 'info';
- return _react2.default.createElement('i', { className: 'fa fa-fw fa-' + icon });
-}
-
-exports.default = (0, _AutoScroll2.default)(EventLogList);
-
-},{"../helpers/AutoScroll":47,"../helpers/VirtualScroll":48,"prop-types":"prop-types","react":"react","react-dom":"react-dom","shallowequal":"shallowequal"}],16:[function(require,module,exports){
-'use strict';
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-
-var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-
-var _react = require('react');
-
-var _react2 = _interopRequireDefault(_react);
-
-var _propTypes = require('prop-types');
-
-var _propTypes2 = _interopRequireDefault(_propTypes);
-
-var _reactDom = require('react-dom');
-
-var _reactDom2 = _interopRequireDefault(_reactDom);
-
-var _shallowequal = require('shallowequal');
-
-var _shallowequal2 = _interopRequireDefault(_shallowequal);
-
-var _AutoScroll = require('./helpers/AutoScroll');
-
-var _AutoScroll2 = _interopRequireDefault(_AutoScroll);
-
-var _VirtualScroll = require('./helpers/VirtualScroll');
-
-var _FlowTableHead = require('./FlowTable/FlowTableHead');
-
-var _FlowTableHead2 = _interopRequireDefault(_FlowTableHead);
-
-var _FlowRow = require('./FlowTable/FlowRow');
-
-var _FlowRow2 = _interopRequireDefault(_FlowRow);
-
-var _filt = require('../filt/filt');
-
-var _filt2 = _interopRequireDefault(_filt);
-
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
-function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
-function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
-
-function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
-
-var FlowTable = function (_React$Component) {
- _inherits(FlowTable, _React$Component);
-
- function FlowTable(props, context) {
- _classCallCheck(this, FlowTable);
-
- var _this = _possibleConstructorReturn(this, (FlowTable.__proto__ || Object.getPrototypeOf(FlowTable)).call(this, props, context));
-
- _this.state = { vScroll: (0, _VirtualScroll.calcVScroll)() };
- _this.onViewportUpdate = _this.onViewportUpdate.bind(_this);
- return _this;
- }
-
- _createClass(FlowTable, [{
- key: 'componentWillMount',
- value: function componentWillMount() {
- window.addEventListener('resize', this.onViewportUpdate);
- }
- }, {
- key: 'componentWillUnmount',
- value: function componentWillUnmount() {
- window.removeEventListener('resize', this.onViewportUpdate);
- }
- }, {
- key: 'componentDidUpdate',
- value: function componentDidUpdate() {
- this.onViewportUpdate();
-
- if (!this.shouldScrollIntoView) {
- return;
- }
-
- this.shouldScrollIntoView = false;
-
- var _props = this.props,
- rowHeight = _props.rowHeight,
- flows = _props.flows,
- selected = _props.selected;
-
- var viewport = _reactDom2.default.findDOMNode(this);
- var head = _reactDom2.default.findDOMNode(this.refs.head);
-
- var headHeight = head ? head.offsetHeight : 0;
-
- var rowTop = flows.indexOf(selected) * rowHeight + headHeight;
- var rowBottom = rowTop + rowHeight;
-
- var viewportTop = viewport.scrollTop;
- var viewportHeight = viewport.offsetHeight;
-
- // Account for pinned thead
- if (rowTop - headHeight < viewportTop) {
- viewport.scrollTop = rowTop - headHeight;
- } else if (rowBottom > viewportTop + viewportHeight) {
- viewport.scrollTop = rowBottom - viewportHeight;
- }
- }
- }, {
- key: 'componentWillReceiveProps',
- value: function componentWillReceiveProps(nextProps) {
- if (nextProps.selected && nextProps.selected !== this.props.selected) {
- this.shouldScrollIntoView = true;
- }
- }
- }, {
- key: 'onViewportUpdate',
- value: function onViewportUpdate() {
- var viewport = _reactDom2.default.findDOMNode(this);
- var viewportTop = viewport.scrollTop;
-
- var vScroll = (0, _VirtualScroll.calcVScroll)({
- viewportTop: viewportTop,
- viewportHeight: viewport.offsetHeight,
- itemCount: this.props.flows.length,
- rowHeight: this.props.rowHeight
- });
-
- if (this.state.viewportTop !== viewportTop || !(0, _shallowequal2.default)(this.state.vScroll, vScroll)) {
- this.setState({ vScroll: vScroll, viewportTop: viewportTop });
- }
- }
- }, {
- key: 'render',
- value: function render() {
- var _this2 = this;
-
- var _state = this.state,
- vScroll = _state.vScroll,
- viewportTop = _state.viewportTop;
- var _props2 = this.props,
- flows = _props2.flows,
- selected = _props2.selected,
- highlight = _props2.highlight;
-
- var isHighlighted = highlight ? _filt2.default.parse(highlight) : function () {
- return false;
- };
-
- return _react2.default.createElement(
- 'div',
- { className: 'flow-table', onScroll: this.onViewportUpdate },
- _react2.default.createElement(
- 'table',
- null,
- _react2.default.createElement(
- 'thead',
- { ref: 'head', style: { transform: 'translateY(' + viewportTop + 'px)' } },
- _react2.default.createElement(_FlowTableHead2.default, null)
- ),
- _react2.default.createElement(
- 'tbody',
- null,
- _react2.default.createElement('tr', { style: { height: vScroll.paddingTop } }),
- flows.slice(vScroll.start, vScroll.end).map(function (flow) {
- return _react2.default.createElement(_FlowRow2.default, {
- key: flow.id,
- flow: flow,
- selected: flow === selected,
- highlighted: isHighlighted(flow),
- onSelect: _this2.props.onSelect
- });
- }),
- _react2.default.createElement('tr', { style: { height: vScroll.paddingBottom } })
- )
- )
- );
- }
- }]);
-
- return FlowTable;
-}(_react2.default.Component);
-
-FlowTable.propTypes = {
- onSelect: _propTypes2.default.func.isRequired,
- flows: _propTypes2.default.array.isRequired,
- rowHeight: _propTypes2.default.number,
- highlight: _propTypes2.default.string,
- selected: _propTypes2.default.object
-};
-FlowTable.defaultProps = {
- rowHeight: 32
-};
-exports.default = (0, _AutoScroll2.default)(FlowTable);
-
-},{"../filt/filt":59,"./FlowTable/FlowRow":18,"./FlowTable/FlowTableHead":19,"./helpers/AutoScroll":47,"./helpers/VirtualScroll":48,"prop-types":"prop-types","react":"react","react-dom":"react-dom","shallowequal":"shallowequal"}],17:[function(require,module,exports){
-'use strict';
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports.TLSColumn = TLSColumn;
-exports.IconColumn = IconColumn;
-exports.PathColumn = PathColumn;
-exports.MethodColumn = MethodColumn;
-exports.StatusColumn = StatusColumn;
-exports.SizeColumn = SizeColumn;
-exports.TimeColumn = TimeColumn;
-
-var _react = require('react');
-
-var _react2 = _interopRequireDefault(_react);
-
-var _classnames = require('classnames');
-
-var _classnames2 = _interopRequireDefault(_classnames);
-
-var _utils = require('../../flow/utils.js');
-
-var _utils2 = require('../../utils.js');
-
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
-function TLSColumn(_ref) {
- var flow = _ref.flow;
-
- return _react2.default.createElement('td', { className: (0, _classnames2.default)('col-tls', flow.request.scheme === 'https' ? 'col-tls-https' : 'col-tls-http') });
-}
-
-TLSColumn.headerClass = 'col-tls';
-TLSColumn.headerName = '';
-
-function IconColumn(_ref2) {
- var flow = _ref2.flow;
-
- return _react2.default.createElement(
- 'td',
- { className: 'col-icon' },
- _react2.default.createElement('div', { className: (0, _classnames2.default)('resource-icon', IconColumn.getIcon(flow)) })
- );
-}
-
-IconColumn.headerClass = 'col-icon';
-IconColumn.headerName = '';
-
-IconColumn.getIcon = function (flow) {
- if (!flow.response) {
- return 'resource-icon-plain';
- }
-
- var contentType = _utils.ResponseUtils.getContentType(flow.response) || '';
-
- // @todo We should assign a type to the flow somewhere else.
- if (flow.response.status_code === 304) {
- return 'resource-icon-not-modified';
- }
- if (300 <= flow.response.status_code && flow.response.status_code < 400) {
- return 'resource-icon-redirect';
- }
- if (contentType.indexOf('image') >= 0) {
- return 'resource-icon-image';
- }
- if (contentType.indexOf('javascript') >= 0) {
- return 'resource-icon-js';
- }
- if (contentType.indexOf('css') >= 0) {
- return 'resource-icon-css';
- }
- if (contentType.indexOf('html') >= 0) {
- return 'resource-icon-document';
- }
-
- return 'resource-icon-plain';
-};
-
-function PathColumn(_ref3) {
- var flow = _ref3.flow;
-
-
- var err = void 0;
- if (flow.error) {
- if (flow.error.msg === "Connection killed") {
- err = _react2.default.createElement('i', { className: 'fa fa-fw fa-times pull-right' });
- } else {
- err = _react2.default.createElement('i', { className: 'fa fa-fw fa-exclamation pull-right' });
- }
- }
- return _react2.default.createElement(
- 'td',
- { className: 'col-path' },
- flow.request.is_replay && _react2.default.createElement('i', { className: 'fa fa-fw fa-repeat pull-right' }),
- flow.intercepted && _react2.default.createElement('i', { className: 'fa fa-fw fa-pause pull-right' }),
- err,
- _utils.RequestUtils.pretty_url(flow.request)
- );
-}
-
-PathColumn.headerClass = 'col-path';
-PathColumn.headerName = 'Path';
-
-function MethodColumn(_ref4) {
- var flow = _ref4.flow;
-
- return _react2.default.createElement(
- 'td',
- { className: 'col-method' },
- flow.request.method
- );
-}
-
-MethodColumn.headerClass = 'col-method';
-MethodColumn.headerName = 'Method';
-
-function StatusColumn(_ref5) {
- var flow = _ref5.flow;
-
- return _react2.default.createElement(
- 'td',
- { className: 'col-status' },
- flow.response && flow.response.status_code
- );
-}
-
-StatusColumn.headerClass = 'col-status';
-StatusColumn.headerName = 'Status';
-
-function SizeColumn(_ref6) {
- var flow = _ref6.flow;
-
- return _react2.default.createElement(
- 'td',
- { className: 'col-size' },
- (0, _utils2.formatSize)(SizeColumn.getTotalSize(flow))
- );
-}
-
-SizeColumn.getTotalSize = function (flow) {
- var total = flow.request.contentLength;
- if (flow.response) {
- total += flow.response.contentLength || 0;
- }
- return total;
-};
-
-SizeColumn.headerClass = 'col-size';
-SizeColumn.headerName = 'Size';
-
-function TimeColumn(_ref7) {
- var flow = _ref7.flow;
-
- return _react2.default.createElement(
- 'td',
- { className: 'col-time' },
- flow.response ? (0, _utils2.formatTimeDelta)(1000 * (flow.response.timestamp_end - flow.server_conn.timestamp_start)) : '...'
- );
-}
-
-TimeColumn.headerClass = 'col-time';
-TimeColumn.headerName = 'Time';
-
-exports.default = [TLSColumn, IconColumn, PathColumn, MethodColumn, StatusColumn, SizeColumn, TimeColumn];
-
-},{"../../flow/utils.js":60,"../../utils.js":62,"classnames":"classnames","react":"react"}],18:[function(require,module,exports){
-'use strict';
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-
-var _react = require('react');
-
-var _react2 = _interopRequireDefault(_react);
-
-var _propTypes = require('prop-types');
-
-var _propTypes2 = _interopRequireDefault(_propTypes);
-
-var _classnames = require('classnames');
-
-var _classnames2 = _interopRequireDefault(_classnames);
-
-var _FlowColumns = require('./FlowColumns');
-
-var _FlowColumns2 = _interopRequireDefault(_FlowColumns);
-
-var _utils = require('../../utils');
-
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
-FlowRow.propTypes = {
- onSelect: _propTypes2.default.func.isRequired,
- flow: _propTypes2.default.object.isRequired,
- highlighted: _propTypes2.default.bool,
- selected: _propTypes2.default.bool
-};
-
-function FlowRow(_ref) {
- var flow = _ref.flow,
- selected = _ref.selected,
- highlighted = _ref.highlighted,
- onSelect = _ref.onSelect;
-
- var className = (0, _classnames2.default)({
- 'selected': selected,
- 'highlighted': highlighted,
- 'intercepted': flow.intercepted,
- 'has-request': flow.request,
- 'has-response': flow.response
- });
-
- return _react2.default.createElement(
- 'tr',
- { className: className, onClick: function onClick() {
- return onSelect(flow.id);
- } },
- _FlowColumns2.default.map(function (Column) {
- return _react2.default.createElement(Column, { key: Column.name, flow: flow });
- })
- );
-}
-
-exports.default = (0, _utils.pure)(FlowRow);
-
-},{"../../utils":62,"./FlowColumns":17,"classnames":"classnames","prop-types":"prop-types","react":"react"}],19:[function(require,module,exports){
-'use strict';
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-
-var _react = require('react');
-
-var _react2 = _interopRequireDefault(_react);
-
-var _propTypes = require('prop-types');
-
-var _propTypes2 = _interopRequireDefault(_propTypes);
-
-var _reactRedux = require('react-redux');
-
-var _classnames = require('classnames');
-
-var _classnames2 = _interopRequireDefault(_classnames);
-
-var _FlowColumns = require('./FlowColumns');
-
-var _FlowColumns2 = _interopRequireDefault(_FlowColumns);
-
-var _flows = require('../../ducks/flows');
-
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
-FlowTableHead.propTypes = {
- setSort: _propTypes2.default.func.isRequired,
- sortDesc: _propTypes2.default.bool.isRequired,
- sortColumn: _propTypes2.default.string
-};
-
-function FlowTableHead(_ref) {
- var sortColumn = _ref.sortColumn,
- sortDesc = _ref.sortDesc,
- setSort = _ref.setSort;
-
- var sortType = sortDesc ? 'sort-desc' : 'sort-asc';
-
- return _react2.default.createElement(
- 'tr',
- null,
- _FlowColumns2.default.map(function (Column) {
- return _react2.default.createElement(
- 'th',
- { className: (0, _classnames2.default)(Column.headerClass, sortColumn === Column.name && sortType),
- key: Column.name,
- onClick: function onClick() {
- return setSort(Column.name, Column.name !== sortColumn ? false : !sortDesc);
- } },
- Column.headerName
- );
- })
- );
-}
-
-exports.default = (0, _reactRedux.connect)(function (state) {
- return {
- sortDesc: state.flows.sort.desc,
- sortColumn: state.flows.sort.column
- };
-}, {
- setSort: _flows.setSort
-})(FlowTableHead);
-
-},{"../../ducks/flows":51,"./FlowColumns":17,"classnames":"classnames","prop-types":"prop-types","react":"react","react-redux":"react-redux"}],20:[function(require,module,exports){
-'use strict';
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-
-var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-
-var _react = require('react');
-
-var _react2 = _interopRequireDefault(_react);
-
-var _reactRedux = require('react-redux');
-
-var _lodash = require('lodash');
-
-var _lodash2 = _interopRequireDefault(_lodash);
-
-var _Nav = require('./FlowView/Nav');
-
-var _Nav2 = _interopRequireDefault(_Nav);
-
-var _Messages = require('./FlowView/Messages');
-
-var _Details = require('./FlowView/Details');
-
-var _Details2 = _interopRequireDefault(_Details);
-
-var _Prompt = require('./Prompt');
-
-var _Prompt2 = _interopRequireDefault(_Prompt);
-
-var _flow = require('../ducks/ui/flow');
-
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
-function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
-function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
-
-function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
-
-var FlowView = function (_Component) {
- _inherits(FlowView, _Component);
-
- function FlowView(props, context) {
- _classCallCheck(this, FlowView);
-
- var _this = _possibleConstructorReturn(this, (FlowView.__proto__ || Object.getPrototypeOf(FlowView)).call(this, props, context));
-
- _this.onPromptFinish = _this.onPromptFinish.bind(_this);
- return _this;
- }
-
- _createClass(FlowView, [{
- key: 'onPromptFinish',
- value: function onPromptFinish(edit) {
- this.props.setPrompt(false);
- if (edit && this.tabComponent) {
- this.tabComponent.edit(edit);
- }
- }
- }, {
- key: 'getPromptOptions',
- value: function getPromptOptions() {
- switch (this.props.tab) {
-
- case 'request':
- return ['method', 'url', { text: 'http version', key: 'v' }, 'header'];
- break;
-
- case 'response':
- return [{ text: 'http version', key: 'v' }, 'code', 'message', 'header'];
- break;
-
- case 'details':
- return;
-
- default:
- throw 'Unknown tab for edit: ' + this.props.tab;
- }
- }
- }, {
- key: 'render',
- value: function render() {
- var _this2 = this;
-
- var _props = this.props,
- flow = _props.flow,
- active = _props.tab,
- updateFlow = _props.updateFlow;
-
- var tabs = ['request', 'response', 'error'].filter(function (k) {
- return flow[k];
- }).concat(['details']);
-
- if (tabs.indexOf(active) < 0) {
- if (active === 'response' && flow.error) {
- active = 'error';
- } else if (active === 'error' && flow.response) {
- active = 'response';
- } else {
- active = tabs[0];
- }
- }
-
- var Tab = FlowView.allTabs[_lodash2.default.capitalize(active)];
-
- return _react2.default.createElement(
- 'div',
- { className: 'flow-detail' },
- _react2.default.createElement(_Nav2.default, {
- flow: flow,
- tabs: tabs,
- active: active,
- onSelectTab: this.props.selectTab
- }),
- _react2.default.createElement(Tab, { ref: function ref(tab) {
- return _this2.tabComponent = tab;
- }, flow: flow, updateFlow: updateFlow }),
- this.props.promptOpen && _react2.default.createElement(_Prompt2.default, { options: this.getPromptOptions(), done: this.onPromptFinish })
- );
- }
- }]);
-
- return FlowView;
-}(_react.Component);
-
-FlowView.allTabs = { Request: _Messages.Request, Response: _Messages.Response, Error: _Messages.ErrorView, Details: _Details2.default };
-exports.default = (0, _reactRedux.connect)(function (state) {
- return {
- promptOpen: state.ui.promptOpen,
- tab: state.ui.flow.tab
- };
-}, {
- selectTab: _flow.selectTab
-})(FlowView);
-
-},{"../ducks/ui/flow":54,"./FlowView/Details":21,"./FlowView/Messages":23,"./FlowView/Nav":24,"./Prompt":37,"lodash":"lodash","react":"react","react-redux":"react-redux"}],21:[function(require,module,exports){
-'use strict';
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-
-var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
-
-exports.TimeStamp = TimeStamp;
-exports.ConnectionInfo = ConnectionInfo;
-exports.CertificateInfo = CertificateInfo;
-exports.Timing = Timing;
-exports.default = Details;
-
-var _react = require('react');
-
-var _react2 = _interopRequireDefault(_react);
-
-var _lodash = require('lodash');
-
-var _lodash2 = _interopRequireDefault(_lodash);
-
-var _utils = require('../../utils.js');
-
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
-function TimeStamp(_ref) {
- var t = _ref.t,
- deltaTo = _ref.deltaTo,
- title = _ref.title;
-
- return t ? _react2.default.createElement(
- 'tr',
- null,
- _react2.default.createElement(
- 'td',
- null,
- title,
- ':'
- ),
- _react2.default.createElement(
- 'td',
- null,
- (0, _utils.formatTimeStamp)(t),
- deltaTo && _react2.default.createElement(
- 'span',
- { className: 'text-muted' },
- '(',
- (0, _utils.formatTimeDelta)(1000 * (t - deltaTo)),
- ')'
- )
- )
- ) : _react2.default.createElement('tr', null);
-}
-
-function ConnectionInfo(_ref2) {
- var conn = _ref2.conn;
-
- return _react2.default.createElement(
- 'table',
- { className: 'connection-table' },
- _react2.default.createElement(
- 'tbody',
- null,
- _react2.default.createElement(
- 'tr',
- { key: 'address' },
- _react2.default.createElement(
- 'td',
- null,
- 'Address:'
- ),
- _react2.default.createElement(
- 'td',
- null,
- conn.address.join(':')
- )
- ),
- conn.sni && _react2.default.createElement(
- 'tr',
- { key: 'sni' },
- _react2.default.createElement(
- 'td',
- null,
- _react2.default.createElement(
- 'abbr',
- { title: 'TLS Server Name Indication' },
- 'TLS SNI:'
- )
- ),
- _react2.default.createElement(
- 'td',
- null,
- conn.sni
- )
- )
- )
- );
-}
-
-function CertificateInfo(_ref3) {
- var flow = _ref3.flow;
-
- // @todo We should fetch human-readable certificate representation from the server
- return _react2.default.createElement(
- 'div',
- null,
- flow.client_conn.cert && [_react2.default.createElement(
- 'h4',
- { key: 'name' },
- 'Client Certificate'
- ), _react2.default.createElement(
- 'pre',
- { key: 'value', style: { maxHeight: 100 } },
- flow.client_conn.cert
- )],
- flow.server_conn.cert && [_react2.default.createElement(
- 'h4',
- { key: 'name' },
- 'Server Certificate'
- ), _react2.default.createElement(
- 'pre',
- { key: 'value', style: { maxHeight: 100 } },
- flow.server_conn.cert
- )]
- );
-}
-
-function Timing(_ref4) {
- var flow = _ref4.flow;
- var sc = flow.server_conn,
- cc = flow.client_conn,
- req = flow.request,
- res = flow.response;
-
-
- var timestamps = [{
- title: "Server conn. initiated",
- t: sc.timestamp_start,
- deltaTo: req.timestamp_start
- }, {
- title: "Server conn. TCP handshake",
- t: sc.timestamp_tcp_setup,
- deltaTo: req.timestamp_start
- }, {
- title: "Server conn. SSL handshake",
- t: sc.timestamp_ssl_setup,
- deltaTo: req.timestamp_start
- }, {
- title: "Client conn. established",
- t: cc.timestamp_start,
- deltaTo: req.timestamp_start
- }, {
- title: "Client conn. SSL handshake",
- t: cc.timestamp_ssl_setup,
- deltaTo: req.timestamp_start
- }, {
- title: "First request byte",
- t: req.timestamp_start
- }, {
- title: "Request complete",
- t: req.timestamp_end,
- deltaTo: req.timestamp_start
- }, res && {
- title: "First response byte",
- t: res.timestamp_start,
- deltaTo: req.timestamp_start
- }, res && {
- title: "Response complete",
- t: res.timestamp_end,
- deltaTo: req.timestamp_start
- }];
-
- return _react2.default.createElement(
- 'div',
- null,
- _react2.default.createElement(
- 'h4',
- null,
- 'Timing'
- ),
- _react2.default.createElement(
- 'table',
- { className: 'timing-table' },
- _react2.default.createElement(
- 'tbody',
- null,
- timestamps.filter(function (v) {
- return v;
- }).sort(function (a, b) {
- return a.t - b.t;
- }).map(function (item) {
- return _react2.default.createElement(TimeStamp, _extends({ key: item.title }, item));
- })
- )
- )
- );
-}
-
-function Details(_ref5) {
- var flow = _ref5.flow;
-
- return _react2.default.createElement(
- 'section',
- { className: 'detail' },
- _react2.default.createElement(
- 'h4',
- null,
- 'Client Connection'
- ),
- _react2.default.createElement(ConnectionInfo, { conn: flow.client_conn }),
- _react2.default.createElement(
- 'h4',
- null,
- 'Server Connection'
- ),
- _react2.default.createElement(ConnectionInfo, { conn: flow.server_conn }),
- _react2.default.createElement(CertificateInfo, { flow: flow }),
- _react2.default.createElement(Timing, { flow: flow })
- );
-}
-
-},{"../../utils.js":62,"lodash":"lodash","react":"react"}],22:[function(require,module,exports){
-'use strict';
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-
-var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
-
-var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-
-var _react = require('react');
-
-var _react2 = _interopRequireDefault(_react);
-
-var _propTypes = require('prop-types');
-
-var _propTypes2 = _interopRequireDefault(_propTypes);
-
-var _reactDom = require('react-dom');
-
-var _reactDom2 = _interopRequireDefault(_reactDom);
-
-var _ValueEditor = require('../ValueEditor/ValueEditor');
-
-var _ValueEditor2 = _interopRequireDefault(_ValueEditor);
-
-var _utils = require('../../utils');
-
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
-function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
-
-function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
-function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
-
-function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
-
-var HeaderEditor = function (_Component) {
- _inherits(HeaderEditor, _Component);
-
- function HeaderEditor(props) {
- _classCallCheck(this, HeaderEditor);
-
- var _this = _possibleConstructorReturn(this, (HeaderEditor.__proto__ || Object.getPrototypeOf(HeaderEditor)).call(this, props));
-
- _this.onKeyDown = _this.onKeyDown.bind(_this);
- return _this;
- }
-
- _createClass(HeaderEditor, [{
- key: 'render',
- value: function render() {
- var _props = this.props,
- onTab = _props.onTab,
- props = _objectWithoutProperties(_props, ['onTab']);
-
- return _react2.default.createElement(_ValueEditor2.default, _extends({}, props, {
- onKeyDown: this.onKeyDown
- }));
- }
- }, {
- key: 'focus',
- value: function focus() {
- _reactDom2.default.findDOMNode(this).focus();
- }
- }, {
- key: 'onKeyDown',
- value: function onKeyDown(e) {
- switch (e.keyCode) {
- case _utils.Key.BACKSPACE:
- var s = window.getSelection().getRangeAt(0);
- if (s.startOffset === 0 && s.endOffset === 0) {
- this.props.onRemove(e);
- }
- break;
- case _utils.Key.ENTER:
- case _utils.Key.TAB:
- if (!e.shiftKey) {
- this.props.onTab(e);
- }
- break;
- }
- }
- }]);
-
- return HeaderEditor;
-}(_react.Component);
-
-var Headers = function (_Component2) {
- _inherits(Headers, _Component2);
-
- function Headers() {
- _classCallCheck(this, Headers);
-
- return _possibleConstructorReturn(this, (Headers.__proto__ || Object.getPrototypeOf(Headers)).apply(this, arguments));
- }
-
- _createClass(Headers, [{
- key: 'onChange',
- value: function onChange(row, col, val) {
- var nextHeaders = _.cloneDeep(this.props.message.headers);
-
- nextHeaders[row][col] = val;
-
- if (!nextHeaders[row][0] && !nextHeaders[row][1]) {
- // do not delete last row
- if (nextHeaders.length === 1) {
- nextHeaders[0][0] = 'Name';
- nextHeaders[0][1] = 'Value';
- } else {
- nextHeaders.splice(row, 1);
- // manually move selection target if this has been the last row.
- if (row === nextHeaders.length) {
- this._nextSel = row - 1 + '-value';
- }
- }
- }
-
- this.props.onChange(nextHeaders);
- }
- }, {
- key: 'edit',
- value: function edit() {
- this.refs['0-key'].focus();
- }
- }, {
- key: 'onTab',
- value: function onTab(row, col, e) {
- var headers = this.props.message.headers;
-
- if (col === 0) {
- this._nextSel = row + '-value';
- return;
- }
- if (row !== headers.length - 1) {
- this._nextSel = row + 1 + '-key';
- return;
- }
-
- e.preventDefault();
-
- var nextHeaders = _.cloneDeep(this.props.message.headers);
- nextHeaders.push(['Name', 'Value']);
- this.props.onChange(nextHeaders);
- this._nextSel = row + 1 + '-key';
- }
- }, {
- key: 'componentDidUpdate',
- value: function componentDidUpdate() {
- if (this._nextSel && this.refs[this._nextSel]) {
- this.refs[this._nextSel].focus();
- this._nextSel = undefined;
- }
- }
- }, {
- key: 'onRemove',
- value: function onRemove(row, col, e) {
- if (col === 1) {
- e.preventDefault();
- this.refs[row + '-key'].focus();
- } else if (row > 0) {
- e.preventDefault();
- this.refs[row - 1 + '-value'].focus();
- }
- }
- }, {
- key: 'render',
- value: function render() {
- var _this3 = this;
-
- var _props2 = this.props,
- message = _props2.message,
- readonly = _props2.readonly;
-
-
- return _react2.default.createElement(
- 'table',
- { className: 'header-table' },
- _react2.default.createElement(
- 'tbody',
- null,
- message.headers.map(function (header, i) {
- return _react2.default.createElement(
- 'tr',
- { key: i },
- _react2.default.createElement(
- 'td',
- { className: 'header-name' },
- _react2.default.createElement(HeaderEditor, {
- ref: i + '-key',
- content: header[0],
- readonly: readonly,
- onDone: function onDone(val) {
- return _this3.onChange(i, 0, val);
- },
- onRemove: function onRemove(event) {
- return _this3.onRemove(i, 0, event);
- },
- onTab: function onTab(event) {
- return _this3.onTab(i, 0, event);
- }
- }),
- _react2.default.createElement(
- 'span',
- { className: 'header-colon' },
- ':'
- )
- ),
- _react2.default.createElement(
- 'td',
- { className: 'header-value' },
- _react2.default.createElement(HeaderEditor, {
- ref: i + '-value',
- content: header[1],
- readonly: readonly,
- onDone: function onDone(val) {
- return _this3.onChange(i, 1, val);
- },
- onRemove: function onRemove(event) {
- return _this3.onRemove(i, 1, event);
- },
- onTab: function onTab(event) {
- return _this3.onTab(i, 1, event);
- }
- })
- )
- );
- })
- )
- );
- }
- }]);
-
- return Headers;
-}(_react.Component);
-
-Headers.propTypes = {
- onChange: _propTypes2.default.func.isRequired,
- message: _propTypes2.default.object.isRequired
-};
-exports.default = Headers;
-
-},{"../../utils":62,"../ValueEditor/ValueEditor":40,"prop-types":"prop-types","react":"react","react-dom":"react-dom"}],23:[function(require,module,exports){
-'use strict';
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports.Response = exports.Request = undefined;
-
-var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-
-var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
-
-exports.ErrorView = ErrorView;
-
-var _react = require('react');
-
-var _react2 = _interopRequireDefault(_react);
-
-var _propTypes = require('prop-types');
-
-var _propTypes2 = _interopRequireDefault(_propTypes);
-
-var _reactRedux = require('react-redux');
-
-var _utils = require('../../flow/utils.js');
-
-var _utils2 = require('../../utils.js');
-
-var _ContentView = require('../ContentView');
-
-var _ContentView2 = _interopRequireDefault(_ContentView);
-
-var _ContentViewOptions = require('../ContentView/ContentViewOptions');
-
-var _ContentViewOptions2 = _interopRequireDefault(_ContentViewOptions);
-
-var _ValidateEditor = require('../ValueEditor/ValidateEditor');
-
-var _ValidateEditor2 = _interopRequireDefault(_ValidateEditor);
-
-var _ValueEditor = require('../ValueEditor/ValueEditor');
-
-var _ValueEditor2 = _interopRequireDefault(_ValueEditor);
-
-var _Headers = require('./Headers');
-
-var _Headers2 = _interopRequireDefault(_Headers);
-
-var _flow = require('../../ducks/ui/flow');
-
-var _flows = require('../../ducks/flows');
-
-var FlowActions = _interopRequireWildcard(_flows);
-
-var _ToggleEdit = require('./ToggleEdit');
-
-var _ToggleEdit2 = _interopRequireDefault(_ToggleEdit);
-
-function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
-
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
-function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
-function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
-
-function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
-
-function RequestLine(_ref) {
- var flow = _ref.flow,
- readonly = _ref.readonly,
- updateFlow = _ref.updateFlow;
-
- return _react2.default.createElement(
- 'div',
- { className: 'first-line request-line' },
- _react2.default.createElement(
- 'div',
- null,
- _react2.default.createElement(_ValueEditor2.default, {
- content: flow.request.method,
- readonly: readonly,
- onDone: function onDone(method) {
- return updateFlow({ request: { method: method } });
- }
- }),
- '\xA0',
- _react2.default.createElement(_ValidateEditor2.default, {
- content: _utils.RequestUtils.pretty_url(flow.request),
- readonly: readonly,
- onDone: function onDone(url) {
- return updateFlow({ request: _extends({ path: '' }, (0, _utils.parseUrl)(url)) });
- },
- isValid: function isValid(url) {
- return !!(0, _utils.parseUrl)(url).host;
- }
- }),
- '\xA0',
- _react2.default.createElement(_ValidateEditor2.default, {
- content: flow.request.http_version,
- readonly: readonly,
- onDone: function onDone(http_version) {
- return updateFlow({ request: { http_version: http_version } });
- },
- isValid: _utils.isValidHttpVersion
- })
- )
- );
-}
-
-function ResponseLine(_ref2) {
- var flow = _ref2.flow,
- readonly = _ref2.readonly,
- updateFlow = _ref2.updateFlow;
-
- return _react2.default.createElement(
- 'div',
- { className: 'first-line response-line' },
- _react2.default.createElement(_ValidateEditor2.default, {
- content: flow.response.http_version,
- readonly: readonly,
- onDone: function onDone(nextVer) {
- return updateFlow({ response: { http_version: nextVer } });
- },
- isValid: _utils.isValidHttpVersion
- }),
- '\xA0',
- _react2.default.createElement(_ValidateEditor2.default, {
- content: flow.response.status_code + '',
- readonly: readonly,
- onDone: function onDone(code) {
- return updateFlow({ response: { code: parseInt(code) } });
- },
- isValid: function isValid(code) {
- return (/^\d+$/.test(code)
- );
- }
- }),
- '\xA0',
- _react2.default.createElement(_ValueEditor2.default, {
- content: flow.response.reason,
- readonly: readonly,
- onDone: function onDone(msg) {
- return updateFlow({ response: { msg: msg } });
- }
- })
- );
-}
-
-var Message = (0, _reactRedux.connect)(function (state) {
- return {
- flow: state.ui.flow.modifiedFlow || state.flows.byId[state.flows.selected[0]],
- isEdit: !!state.ui.flow.modifiedFlow
- };
-}, {
- updateFlow: _flow.updateEdit,
- uploadContent: FlowActions.uploadContent
-});
-
-var Request = exports.Request = function (_Component) {
- _inherits(Request, _Component);
-
- function Request() {
- _classCallCheck(this, Request);
-
- return _possibleConstructorReturn(this, (Request.__proto__ || Object.getPrototypeOf(Request)).apply(this, arguments));
- }
-
- _createClass(Request, [{
- key: 'render',
- value: function render() {
- var _props = this.props,
- flow = _props.flow,
- isEdit = _props.isEdit,
- updateFlow = _props.updateFlow,
- _uploadContent = _props.uploadContent;
-
- var noContent = !isEdit && (flow.request.contentLength == 0 || flow.request.contentLength == null);
- return _react2.default.createElement(
- 'section',
- { className: 'request' },
- _react2.default.createElement(
- 'article',
- null,
- _react2.default.createElement(_ToggleEdit2.default, null),
- _react2.default.createElement(RequestLine, {
- flow: flow,
- readonly: !isEdit,
- updateFlow: updateFlow }),
- _react2.default.createElement(_Headers2.default, {
- message: flow.request,
- readonly: !isEdit,
- onChange: function onChange(headers) {
- return updateFlow({ request: { headers: headers } });
- }
- }),
- _react2.default.createElement('hr', null),
- _react2.default.createElement(_ContentView2.default, {
- readonly: !isEdit,
- flow: flow,
- onContentChange: function onContentChange(content) {
- return updateFlow({ request: { content: content } });
- },
- message: flow.request })
- ),
- !noContent && _react2.default.createElement(
- 'footer',
- null,
- _react2.default.createElement(_ContentViewOptions2.default, {
- flow: flow,
- readonly: !isEdit,
- message: flow.request,
- uploadContent: function uploadContent(content) {
- return _uploadContent(flow, content, "request");
- } })
- )
- );
- }
- }, {
- key: 'edit',
- value: function edit(k) {
- throw "unimplemented";
- /*
- switch (k) {
- case 'm':
- this.refs.requestLine.refs.method.focus()
- break
- case 'u':
- this.refs.requestLine.refs.url.focus()
- break
- case 'v':
- this.refs.requestLine.refs.httpVersion.focus()
- break
- case 'h':
- this.refs.headers.edit()
- break
- default:
- throw new Error(`Unimplemented: ${k}`)
- }
- */
- }
- }]);
-
- return Request;
-}(_react.Component);
-
-exports.Request = Request = Message(Request);
-
-var Response = exports.Response = function (_Component2) {
- _inherits(Response, _Component2);
-
- function Response() {
- _classCallCheck(this, Response);
-
- return _possibleConstructorReturn(this, (Response.__proto__ || Object.getPrototypeOf(Response)).apply(this, arguments));
- }
-
- _createClass(Response, [{
- key: 'render',
- value: function render() {
- var _props2 = this.props,
- flow = _props2.flow,
- isEdit = _props2.isEdit,
- updateFlow = _props2.updateFlow,
- _uploadContent2 = _props2.uploadContent;
-
- var noContent = !isEdit && (flow.response.contentLength == 0 || flow.response.contentLength == null);
-
- return _react2.default.createElement(
- 'section',
- { className: 'response' },
- _react2.default.createElement(
- 'article',
- null,
- _react2.default.createElement(_ToggleEdit2.default, null),
- _react2.default.createElement(ResponseLine, {
- flow: flow,
- readonly: !isEdit,
- updateFlow: updateFlow }),
- _react2.default.createElement(_Headers2.default, {
- message: flow.response,
- readonly: !isEdit,
- onChange: function onChange(headers) {
- return updateFlow({ response: { headers: headers } });
- }
- }),
- _react2.default.createElement('hr', null),
- _react2.default.createElement(_ContentView2.default, {
- readonly: !isEdit,
- flow: flow,
- onContentChange: function onContentChange(content) {
- return updateFlow({ response: { content: content } });
- },
- message: flow.response
- })
- ),
- !noContent && _react2.default.createElement(
- 'footer',
- null,
- _react2.default.createElement(_ContentViewOptions2.default, {
- flow: flow,
- message: flow.response,
- uploadContent: function uploadContent(content) {
- return _uploadContent2(flow, content, "response");
- },
- readonly: !isEdit })
- )
- );
- }
- }, {
- key: 'edit',
- value: function edit(k) {
- throw "unimplemented";
- /*
- switch (k) {
- case 'c':
- this.refs.responseLine.refs.status_code.focus()
- break
- case 'm':
- this.refs.responseLine.refs.msg.focus()
- break
- case 'v':
- this.refs.responseLine.refs.httpVersion.focus()
- break
- case 'h':
- this.refs.headers.edit()
- break
- default:
- throw new Error(`'Unimplemented: ${k}`)
- }
- */
- }
- }]);
-
- return Response;
-}(_react.Component);
-
-exports.Response = Response = Message(Response);
-
-ErrorView.propTypes = {
- flow: _propTypes2.default.object.isRequired
-};
-
-function ErrorView(_ref3) {
- var flow = _ref3.flow;
-
- return _react2.default.createElement(
- 'section',
- { className: 'error' },
- _react2.default.createElement(
- 'div',
- { className: 'alert alert-warning' },
- flow.error.msg,
- _react2.default.createElement(
- 'div',
- null,
- _react2.default.createElement(
- 'small',
- null,
- (0, _utils2.formatTimeStamp)(flow.error.timestamp)
- )
- )
- )
- );
-}
-
-},{"../../ducks/flows":51,"../../ducks/ui/flow":54,"../../flow/utils.js":60,"../../utils.js":62,"../ContentView":4,"../ContentView/ContentViewOptions":7,"../ValueEditor/ValidateEditor":39,"../ValueEditor/ValueEditor":40,"./Headers":22,"./ToggleEdit":25,"prop-types":"prop-types","react":"react","react-redux":"react-redux"}],24:[function(require,module,exports){
-'use strict';
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports.default = Nav;
-
-var _react = require('react');
-
-var _react2 = _interopRequireDefault(_react);
-
-var _propTypes = require('prop-types');
-
-var _propTypes2 = _interopRequireDefault(_propTypes);
-
-var _reactRedux = require('react-redux');
-
-var _classnames = require('classnames');
-
-var _classnames2 = _interopRequireDefault(_classnames);
-
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
-NavAction.propTypes = {
- icon: _propTypes2.default.string.isRequired,
- title: _propTypes2.default.string.isRequired,
- onClick: _propTypes2.default.func.isRequired
-};
-
-function NavAction(_ref) {
- var icon = _ref.icon,
- title = _ref.title,
- _onClick = _ref.onClick;
-
- return _react2.default.createElement(
- 'a',
- { title: title,
- href: '#',
- className: 'nav-action',
- onClick: function onClick(event) {
- event.preventDefault();
- _onClick(event);
- } },
- _react2.default.createElement('i', { className: 'fa fa-fw ' + icon })
- );
-}
-
-Nav.propTypes = {
- active: _propTypes2.default.string.isRequired,
- tabs: _propTypes2.default.array.isRequired,
- onSelectTab: _propTypes2.default.func.isRequired
-};
-
-function Nav(_ref2) {
- var active = _ref2.active,
- tabs = _ref2.tabs,
- onSelectTab = _ref2.onSelectTab;
-
- return _react2.default.createElement(
- 'nav',
- { className: 'nav-tabs nav-tabs-sm' },
- tabs.map(function (tab) {
- return _react2.default.createElement(
- 'a',
- { key: tab,
- href: '#',
- className: (0, _classnames2.default)({ active: active === tab }),
- onClick: function onClick(event) {
- event.preventDefault();
- onSelectTab(tab);
- } },
- _.capitalize(tab)
- );
- })
- );
-}
-
-},{"classnames":"classnames","prop-types":"prop-types","react":"react","react-redux":"react-redux"}],25:[function(require,module,exports){
-'use strict';
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-
-var _react = require('react');
-
-var _react2 = _interopRequireDefault(_react);
-
-var _propTypes = require('prop-types');
-
-var _propTypes2 = _interopRequireDefault(_propTypes);
-
-var _reactRedux = require('react-redux');
-
-var _flow = require('../../ducks/ui/flow');
-
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
-ToggleEdit.propTypes = {
- isEdit: _propTypes2.default.bool.isRequired,
- flow: _propTypes2.default.object.isRequired,
- startEdit: _propTypes2.default.func.isRequired,
- stopEdit: _propTypes2.default.func.isRequired
-};
-
-function ToggleEdit(_ref) {
- var isEdit = _ref.isEdit,
- startEdit = _ref.startEdit,
- stopEdit = _ref.stopEdit,
- flow = _ref.flow,
- modifiedFlow = _ref.modifiedFlow;
-
- return _react2.default.createElement(
- 'div',
- { className: 'edit-flow-container' },
- isEdit ? _react2.default.createElement(
- 'a',
- { className: 'edit-flow', title: 'Finish Edit', onClick: function onClick() {
- return stopEdit(flow, modifiedFlow);
- } },
- _react2.default.createElement('i', { className: 'fa fa-check' })
- ) : _react2.default.createElement(
- 'a',
- { className: 'edit-flow', title: 'Edit Flow', onClick: function onClick() {
- return startEdit(flow);
- } },
- _react2.default.createElement('i', { className: 'fa fa-pencil' })
- )
- );
-}
-
-exports.default = (0, _reactRedux.connect)(function (state) {
- return {
- isEdit: !!state.ui.flow.modifiedFlow,
- modifiedFlow: state.ui.flow.modifiedFlow || state.flows.byId[state.flows.selected[0]],
- flow: state.flows.byId[state.flows.selected[0]]
- };
-}, {
- startEdit: _flow.startEdit,
- stopEdit: _flow.stopEdit
-})(ToggleEdit);
-
-},{"../../ducks/ui/flow":54,"prop-types":"prop-types","react":"react","react-redux":"react-redux"}],26:[function(require,module,exports){
-'use strict';
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-
-var _react = require('react');
-
-var _react2 = _interopRequireDefault(_react);
-
-var _propTypes = require('prop-types');
-
-var _propTypes2 = _interopRequireDefault(_propTypes);
-
-var _reactRedux = require('react-redux');
-
-var _utils = require('../utils.js');
-
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
-Footer.propTypes = {
- settings: _propTypes2.default.object.isRequired
-};
-
-function Footer(_ref) {
- var settings = _ref.settings;
- var mode = settings.mode,
- intercept = settings.intercept,
- showhost = settings.showhost,
- no_upstream_cert = settings.no_upstream_cert,
- rawtcp = settings.rawtcp,
- http2 = settings.http2,
- websocket = settings.websocket,
- anticache = settings.anticache,
- anticomp = settings.anticomp,
- stickyauth = settings.stickyauth,
- stickycookie = settings.stickycookie,
- stream_large_bodies = settings.stream_large_bodies,
- listen_host = settings.listen_host,
- listen_port = settings.listen_port,
- version = settings.version,
- server = settings.server;
-
- return _react2.default.createElement(
- 'footer',
- null,
- mode && mode != "regular" && _react2.default.createElement(
- 'span',
- { className: 'label label-success' },
- mode,
- ' mode'
- ),
- intercept && _react2.default.createElement(
- 'span',
- { className: 'label label-success' },
- 'Intercept: ',
- intercept
- ),
- showhost && _react2.default.createElement(
- 'span',
- { className: 'label label-success' },
- 'showhost'
- ),
- no_upstream_cert && _react2.default.createElement(
- 'span',
- { className: 'label label-success' },
- 'no-upstream-cert'
- ),
- rawtcp && _react2.default.createElement(
- 'span',
- { className: 'label label-success' },
- 'raw-tcp'
- ),
- !http2 && _react2.default.createElement(
- 'span',
- { className: 'label label-success' },
- 'no-http2'
- ),
- !websocket && _react2.default.createElement(
- 'span',
- { className: 'label label-success' },
- 'no-websocket'
- ),
- anticache && _react2.default.createElement(
- 'span',
- { className: 'label label-success' },
- 'anticache'
- ),
- anticomp && _react2.default.createElement(
- 'span',
- { className: 'label label-success' },
- 'anticomp'
- ),
- stickyauth && _react2.default.createElement(
- 'span',
- { className: 'label label-success' },
- 'stickyauth: ',
- stickyauth
- ),
- stickycookie && _react2.default.createElement(
- 'span',
- { className: 'label label-success' },
- 'stickycookie: ',
- stickycookie
- ),
- stream_large_bodies && _react2.default.createElement(
- 'span',
- { className: 'label label-success' },
- 'stream: ',
- (0, _utils.formatSize)(stream_large_bodies)
- ),
- _react2.default.createElement(
- 'div',
- { className: 'pull-right' },
- server && _react2.default.createElement(
- 'span',
- { className: 'label label-primary', title: 'HTTP Proxy Server Address' },
- listen_host || "*",
- ':',
- listen_port
- ),
- _react2.default.createElement(
- 'span',
- { className: 'label label-info', title: 'Mitmproxy Version' },
- 'v',
- version
- )
- )
- );
-}
-
-exports.default = (0, _reactRedux.connect)(function (state) {
- return {
- settings: state.settings
- };
-})(Footer);
-
-},{"../utils.js":62,"prop-types":"prop-types","react":"react","react-redux":"react-redux"}],27:[function(require,module,exports){
-'use strict';
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-
-var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-
-var _react = require('react');
-
-var _react2 = _interopRequireDefault(_react);
-
-var _propTypes = require('prop-types');
-
-var _propTypes2 = _interopRequireDefault(_propTypes);
-
-var _reactRedux = require('react-redux');
-
-var _classnames = require('classnames');
-
-var _classnames2 = _interopRequireDefault(_classnames);
-
-var _MainMenu = require('./Header/MainMenu');
-
-var _MainMenu2 = _interopRequireDefault(_MainMenu);
-
-var _OptionMenu = require('./Header/OptionMenu');
-
-var _OptionMenu2 = _interopRequireDefault(_OptionMenu);
-
-var _FileMenu = require('./Header/FileMenu');
-
-var _FileMenu2 = _interopRequireDefault(_FileMenu);
-
-var _FlowMenu = require('./Header/FlowMenu');
-
-var _FlowMenu2 = _interopRequireDefault(_FlowMenu);
-
-var _header = require('../ducks/ui/header');
-
-var _ConnectionIndicator = require('./Header/ConnectionIndicator');
-
-var _ConnectionIndicator2 = _interopRequireDefault(_ConnectionIndicator);
-
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
-function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
-
-function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
-function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
-
-function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
-
-var Header = function (_Component) {
- _inherits(Header, _Component);
-
- function Header() {
- _classCallCheck(this, Header);
-
- return _possibleConstructorReturn(this, (Header.__proto__ || Object.getPrototypeOf(Header)).apply(this, arguments));
- }
-
- _createClass(Header, [{
- key: 'handleClick',
- value: function handleClick(active, e) {
- e.preventDefault();
- this.props.setActiveMenu(active.title);
- }
- }, {
- key: 'render',
- value: function render() {
- var _this2 = this;
-
- var _props = this.props,
- selectedFlowId = _props.selectedFlowId,
- activeMenu = _props.activeMenu;
-
-
- var entries = [].concat(_toConsumableArray(Header.entries));
- if (selectedFlowId) entries.push(_FlowMenu2.default);
-
- // Make sure to have a fallback in case FlowMenu is selected but we don't have any flows
- // (e.g. because they are all deleted or not yet received)
- var Active = _.find(entries, function (e) {
- return e.title == activeMenu;
- }) || _MainMenu2.default;
-
- return _react2.default.createElement(
- 'header',
- null,
- _react2.default.createElement(
- 'nav',
- { className: 'nav-tabs nav-tabs-lg' },
- _react2.default.createElement(_FileMenu2.default, null),
- entries.map(function (Entry) {
- return _react2.default.createElement(
- 'a',
- { key: Entry.title,
- href: '#',
- className: (0, _classnames2.default)({ active: Entry === Active }),
- onClick: function onClick(e) {
- return _this2.handleClick(Entry, e);
- } },
- Entry.title
- );
- }),
- _react2.default.createElement(_ConnectionIndicator2.default, null)
- ),
- _react2.default.createElement(
- 'div',
- null,
- _react2.default.createElement(Active, null)
- )
- );
- }
- }]);
-
- return Header;
-}(_react.Component);
-
-Header.entries = [_MainMenu2.default, _OptionMenu2.default];
-exports.default = (0, _reactRedux.connect)(function (state) {
- return {
- selectedFlowId: state.flows.selected[0],
- activeMenu: state.ui.header.activeMenu
- };
-}, {
- setActiveMenu: _header.setActiveMenu
-})(Header);
-
-},{"../ducks/ui/header":55,"./Header/ConnectionIndicator":28,"./Header/FileMenu":29,"./Header/FlowMenu":32,"./Header/MainMenu":33,"./Header/OptionMenu":35,"classnames":"classnames","prop-types":"prop-types","react":"react","react-redux":"react-redux"}],28:[function(require,module,exports){
-"use strict";
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-
-var _react = require("react");
-
-var _react2 = _interopRequireDefault(_react);
-
-var _propTypes = require("prop-types");
-
-var _propTypes2 = _interopRequireDefault(_propTypes);
-
-var _reactRedux = require("react-redux");
-
-var _connection = require("../../ducks/connection");
-
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
-ConnectionIndicator.propTypes = {
- state: _propTypes2.default.symbol.isRequired,
- message: _propTypes2.default.string
-
-};
-function ConnectionIndicator(_ref) {
- var state = _ref.state,
- message = _ref.message;
-
- switch (state) {
- case _connection.ConnectionState.INIT:
- return _react2.default.createElement(
- "span",
- { className: "connection-indicator init" },
- "connecting\u2026"
- );
- case _connection.ConnectionState.FETCHING:
- return _react2.default.createElement(
- "span",
- { className: "connection-indicator fetching" },
- "fetching data\u2026"
- );
- case _connection.ConnectionState.ESTABLISHED:
- return _react2.default.createElement(
- "span",
- { className: "connection-indicator established" },
- "connected"
- );
- case _connection.ConnectionState.ERROR:
- return _react2.default.createElement(
- "span",
- { className: "connection-indicator error",
- title: message },
- "connection lost"
- );
- case _connection.ConnectionState.OFFLINE:
- return _react2.default.createElement(
- "span",
- { className: "connection-indicator offline" },
- "offline"
- );
- }
-}
-
-exports.default = (0, _reactRedux.connect)(function (state) {
- return state.connection;
-})(ConnectionIndicator);
-
-},{"../../ducks/connection":49,"prop-types":"prop-types","react":"react","react-redux":"react-redux"}],29:[function(require,module,exports){
-'use strict';
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-
-var _react = require('react');
-
-var _react2 = _interopRequireDefault(_react);
-
-var _propTypes = require('prop-types');
-
-var _propTypes2 = _interopRequireDefault(_propTypes);
-
-var _reactRedux = require('react-redux');
-
-var _FileChooser = require('../common/FileChooser');
-
-var _FileChooser2 = _interopRequireDefault(_FileChooser);
-
-var _Dropdown = require('../common/Dropdown');
-
-var _Dropdown2 = _interopRequireDefault(_Dropdown);
-
-var _flows = require('../../ducks/flows');
-
-var flowsActions = _interopRequireWildcard(_flows);
-
-function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
-
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
-FileMenu.propTypes = {
- clearFlows: _propTypes2.default.func.isRequired,
- loadFlows: _propTypes2.default.func.isRequired,
- saveFlows: _propTypes2.default.func.isRequired
-};
-
-FileMenu.onNewClick = function (e, clearFlows) {
- e.preventDefault();
- if (confirm('Delete all flows?')) clearFlows();
-};
-
-function FileMenu(_ref) {
- var clearFlows = _ref.clearFlows,
- loadFlows = _ref.loadFlows,
- saveFlows = _ref.saveFlows;
-
- return _react2.default.createElement(
- _Dropdown2.default,
- { className: 'pull-left', btnClass: 'special', text: 'mitmproxy' },
- _react2.default.createElement(
- 'a',
- { href: '#', onClick: function onClick(e) {
- return FileMenu.onNewClick(e, clearFlows);
- } },
- _react2.default.createElement('i', { className: 'fa fa-fw fa-file' }),
- '\xA0New'
- ),
- _react2.default.createElement(_FileChooser2.default, {
- icon: 'fa-folder-open',
- text: '\xA0Open...',
- onOpenFile: function onOpenFile(file) {
- return loadFlows(file);
- }
- }),
- _react2.default.createElement(
- 'a',
- { href: '#', onClick: function onClick(e) {
- e.preventDefault();saveFlows();
- } },
- _react2.default.createElement('i', { className: 'fa fa-fw fa-floppy-o' }),
- '\xA0Save...'
- ),
- _react2.default.createElement(_Dropdown.Divider, null),
- _react2.default.createElement(
- 'a',
- { href: 'http://mitm.it/', target: '_blank' },
- _react2.default.createElement('i', { className: 'fa fa-fw fa-external-link' }),
- '\xA0Install Certificates...'
- )
- );
-}
-
-exports.default = (0, _reactRedux.connect)(null, {
- clearFlows: flowsActions.clear,
- loadFlows: flowsActions.upload,
- saveFlows: flowsActions.download
-})(FileMenu);
-
-},{"../../ducks/flows":51,"../common/Dropdown":43,"../common/FileChooser":44,"prop-types":"prop-types","react":"react","react-redux":"react-redux"}],30:[function(require,module,exports){
-'use strict';
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-
-var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-
-var _react = require('react');
-
-var _react2 = _interopRequireDefault(_react);
-
-var _utils = require('../../utils');
-
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
-function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
-function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
-
-function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
-
-var FilterDocs = function (_Component) {
- _inherits(FilterDocs, _Component);
-
- // @todo move to redux
-
- function FilterDocs(props, context) {
- _classCallCheck(this, FilterDocs);
-
- var _this = _possibleConstructorReturn(this, (FilterDocs.__proto__ || Object.getPrototypeOf(FilterDocs)).call(this, props, context));
-
- _this.state = { doc: FilterDocs.doc };
- return _this;
- }
-
- _createClass(FilterDocs, [{
- key: 'componentWillMount',
- value: function componentWillMount() {
- var _this2 = this;
-
- if (!FilterDocs.xhr) {
- FilterDocs.xhr = (0, _utils.fetchApi)('/filter-help').then(function (response) {
- return response.json();
- });
- FilterDocs.xhr.catch(function () {
- FilterDocs.xhr = null;
- });
- }
- if (!this.state.doc) {
- FilterDocs.xhr.then(function (doc) {
- FilterDocs.doc = doc;
- _this2.setState({ doc: doc });
- });
- }
- }
- }, {
- key: 'render',
- value: function render() {
- var _this3 = this;
-
- var doc = this.state.doc;
-
- return !doc ? _react2.default.createElement('i', { className: 'fa fa-spinner fa-spin' }) : _react2.default.createElement(
- 'table',
- { className: 'table table-condensed' },
- _react2.default.createElement(
- 'tbody',
- null,
- doc.commands.map(function (cmd) {
- return _react2.default.createElement(
- 'tr',
- { key: cmd[1], onClick: function onClick(e) {
- return _this3.props.selectHandler(cmd[0].split(" ")[0] + " ");
- } },
- _react2.default.createElement(
- 'td',
- null,
- cmd[0].replace(' ', '\xA0')
- ),
- _react2.default.createElement(
- 'td',
- null,
- cmd[1]
- )
- );
- }),
- _react2.default.createElement(
- 'tr',
- { key: 'docs-link' },
- _react2.default.createElement(
- 'td',
- { colSpan: '2' },
- _react2.default.createElement(
- 'a',
- { href: 'http://docs.mitmproxy.org/en/stable/features/filters.html',
- target: '_blank' },
- _react2.default.createElement('i', { className: 'fa fa-external-link' }),
- '\xA0 mitmproxy docs'
- )
- )
- )
- )
- );
- }
- }]);
-
- return FilterDocs;
-}(_react.Component);
-
-FilterDocs.xhr = null;
-FilterDocs.doc = null;
-exports.default = FilterDocs;
-
-},{"../../utils":62,"react":"react"}],31:[function(require,module,exports){
-'use strict';
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-
-var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-
-var _react = require('react');
-
-var _react2 = _interopRequireDefault(_react);
-
-var _propTypes = require('prop-types');
-
-var _propTypes2 = _interopRequireDefault(_propTypes);
-
-var _reactDom = require('react-dom');
-
-var _reactDom2 = _interopRequireDefault(_reactDom);
-
-var _classnames = require('classnames');
-
-var _classnames2 = _interopRequireDefault(_classnames);
-
-var _utils = require('../../utils.js');
-
-var _filt = require('../../filt/filt');
-
-var _filt2 = _interopRequireDefault(_filt);
-
-var _FilterDocs = require('./FilterDocs');
-
-var _FilterDocs2 = _interopRequireDefault(_FilterDocs);
-
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
-function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
-function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
-
-function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
-
-var FilterInput = function (_Component) {
- _inherits(FilterInput, _Component);
-
- function FilterInput(props, context) {
- _classCallCheck(this, FilterInput);
-
- // Consider both focus and mouseover for showing/hiding the tooltip,
- // because onBlur of the input is triggered before the click on the tooltip
- // finalized, hiding the tooltip just as the user clicks on it.
- var _this = _possibleConstructorReturn(this, (FilterInput.__proto__ || Object.getPrototypeOf(FilterInput)).call(this, props, context));
-
- _this.state = { value: _this.props.value, focus: false, mousefocus: false };
-
- _this.onChange = _this.onChange.bind(_this);
- _this.onFocus = _this.onFocus.bind(_this);
- _this.onBlur = _this.onBlur.bind(_this);
- _this.onKeyDown = _this.onKeyDown.bind(_this);
- _this.onMouseEnter = _this.onMouseEnter.bind(_this);
- _this.onMouseLeave = _this.onMouseLeave.bind(_this);
- _this.selectFilter = _this.selectFilter.bind(_this);
- return _this;
- }
-
- _createClass(FilterInput, [{
- key: 'componentWillReceiveProps',
- value: function componentWillReceiveProps(nextProps) {
- this.setState({ value: nextProps.value });
- }
- }, {
- key: 'isValid',
- value: function isValid(filt) {
- try {
- var str = filt == null ? this.state.value : filt;
- if (str) {
- _filt2.default.parse(str);
- }
- return true;
- } catch (e) {
- return false;
- }
- }
- }, {
- key: 'getDesc',
- value: function getDesc() {
- if (!this.state.value) {
- return _react2.default.createElement(_FilterDocs2.default, { selectHandler: this.selectFilter });
- }
- try {
- return _filt2.default.parse(this.state.value).desc;
- } catch (e) {
- return '' + e;
- }
- }
- }, {
- key: 'onChange',
- value: function onChange(e) {
- var value = e.target.value;
- this.setState({ value: value });
-
- // Only propagate valid filters upwards.
- if (this.isValid(value)) {
- this.props.onChange(value);
- }
- }
- }, {
- key: 'onFocus',
- value: function onFocus() {
- this.setState({ focus: true });
- }
- }, {
- key: 'onBlur',
- value: function onBlur() {
- this.setState({ focus: false });
- }
- }, {
- key: 'onMouseEnter',
- value: function onMouseEnter() {
- this.setState({ mousefocus: true });
- }
- }, {
- key: 'onMouseLeave',
- value: function onMouseLeave() {
- this.setState({ mousefocus: false });
- }
- }, {
- key: 'onKeyDown',
- value: function onKeyDown(e) {
- if (e.keyCode === _utils.Key.ESC || e.keyCode === _utils.Key.ENTER) {
- this.blur();
- // If closed using ESC/ENTER, hide the tooltip.
- this.setState({ mousefocus: false });
- }
- e.stopPropagation();
- }
- }, {
- key: 'selectFilter',
- value: function selectFilter(cmd) {
- this.setState({ value: cmd });
- _reactDom2.default.findDOMNode(this.refs.input).focus();
- }
- }, {
- key: 'blur',
- value: function blur() {
- _reactDom2.default.findDOMNode(this.refs.input).blur();
- }
- }, {
- key: 'select',
- value: function select() {
- _reactDom2.default.findDOMNode(this.refs.input).select();
- }
- }, {
- key: 'render',
- value: function render() {
- var _props = this.props,
- type = _props.type,
- color = _props.color,
- placeholder = _props.placeholder;
- var _state = this.state,
- value = _state.value,
- focus = _state.focus,
- mousefocus = _state.mousefocus;
-
- return _react2.default.createElement(
- 'div',
- { className: (0, _classnames2.default)('filter-input input-group', { 'has-error': !this.isValid() }) },
- _react2.default.createElement(
- 'span',
- { className: 'input-group-addon' },
- _react2.default.createElement('i', { className: 'fa fa-fw fa-' + type, style: { color: color } })
- ),
- _react2.default.createElement('input', {
- type: 'text',
- ref: 'input',
- placeholder: placeholder,
- className: 'form-control',
- value: value,
- onChange: this.onChange,
- onFocus: this.onFocus,
- onBlur: this.onBlur,
- onKeyDown: this.onKeyDown
- }),
- (focus || mousefocus) && _react2.default.createElement(
- 'div',
- { className: 'popover bottom',
- onMouseEnter: this.onMouseEnter,
- onMouseLeave: this.onMouseLeave },
- _react2.default.createElement('div', { className: 'arrow' }),
- _react2.default.createElement(
- 'div',
- { className: 'popover-content' },
- this.getDesc()
- )
- )
- );
- }
- }]);
-
- return FilterInput;
-}(_react.Component);
-
-exports.default = FilterInput;
-
-},{"../../filt/filt":59,"../../utils.js":62,"./FilterDocs":30,"classnames":"classnames","prop-types":"prop-types","react":"react","react-dom":"react-dom"}],32:[function(require,module,exports){
-"use strict";
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-
-var _react = require("react");
-
-var _react2 = _interopRequireDefault(_react);
-
-var _propTypes = require("prop-types");
-
-var _propTypes2 = _interopRequireDefault(_propTypes);
-
-var _reactRedux = require("react-redux");
-
-var _Button = require("../common/Button");
-
-var _Button2 = _interopRequireDefault(_Button);
-
-var _utils = require("../../flow/utils.js");
-
-var _flows = require("../../ducks/flows");
-
-var flowsActions = _interopRequireWildcard(_flows);
-
-function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
-
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
-FlowMenu.title = 'Flow';
-
-FlowMenu.propTypes = {
- flow: _propTypes2.default.object,
- resumeFlow: _propTypes2.default.func.isRequired,
- killFlow: _propTypes2.default.func.isRequired,
- replayFlow: _propTypes2.default.func.isRequired,
- duplicateFlow: _propTypes2.default.func.isRequired,
- removeFlow: _propTypes2.default.func.isRequired,
- revertFlow: _propTypes2.default.func.isRequired
-};
-
-function FlowMenu(_ref) {
- var flow = _ref.flow,
- resumeFlow = _ref.resumeFlow,
- killFlow = _ref.killFlow,
- replayFlow = _ref.replayFlow,
- duplicateFlow = _ref.duplicateFlow,
- removeFlow = _ref.removeFlow,
- revertFlow = _ref.revertFlow;
-
- if (!flow) return _react2.default.createElement("div", null);
- return _react2.default.createElement(
- "div",
- null,
- _react2.default.createElement(
- "div",
- { className: "menu-group" },
- _react2.default.createElement(
- "div",
- { className: "menu-content" },
- _react2.default.createElement(
- _Button2.default,
- { title: "[r]eplay flow", icon: "fa-repeat text-primary",
- onClick: function onClick() {
- return replayFlow(flow);
- } },
- "Replay"
- ),
- _react2.default.createElement(
- _Button2.default,
- { title: "[D]uplicate flow", icon: "fa-copy text-info",
- onClick: function onClick() {
- return duplicateFlow(flow);
- } },
- "Duplicate"
- ),
- _react2.default.createElement(
- _Button2.default,
- { disabled: !flow || !flow.modified, title: "revert changes to flow [V]",
- icon: "fa-history text-warning", onClick: function onClick() {
- return revertFlow(flow);
- } },
- "Revert"
- ),
- _react2.default.createElement(
- _Button2.default,
- { title: "[d]elete flow", icon: "fa-trash text-danger",
- onClick: function onClick() {
- return removeFlow(flow);
- } },
- "Delete"
- )
- ),
- _react2.default.createElement(
- "div",
- { className: "menu-legend" },
- "Flow Modification"
- )
- ),
- _react2.default.createElement(
- "div",
- { className: "menu-group" },
- _react2.default.createElement(
- "div",
- { className: "menu-content" },
- _react2.default.createElement(
- _Button2.default,
- { title: "download", icon: "fa-download",
- onClick: function onClick() {
- return window.location = _utils.MessageUtils.getContentURL(flow, flow.response);
- } },
- "Download"
- )
- ),
- _react2.default.createElement(
- "div",
- { className: "menu-legend" },
- "Export"
- )
- ),
- _react2.default.createElement(
- "div",
- { className: "menu-group" },
- _react2.default.createElement(
- "div",
- { className: "menu-content" },
- _react2.default.createElement(
- _Button2.default,
- { disabled: !flow || !flow.intercepted, title: "[a]ccept intercepted flow",
- icon: "fa-play text-success", onClick: function onClick() {
- return resumeFlow(flow);
- } },
- "Resume"
- ),
- _react2.default.createElement(
- _Button2.default,
- { disabled: !flow || !flow.intercepted, title: "kill intercepted flow [x]",
- icon: "fa-times text-danger", onClick: function onClick() {
- return killFlow(flow);
- } },
- "Abort"
- )
- ),
- _react2.default.createElement(
- "div",
- { className: "menu-legend" },
- "Interception"
- )
- )
- );
-}
-
-exports.default = (0, _reactRedux.connect)(function (state) {
- return {
- flow: state.flows.byId[state.flows.selected[0]]
- };
-}, {
- resumeFlow: flowsActions.resume,
- killFlow: flowsActions.kill,
- replayFlow: flowsActions.replay,
- duplicateFlow: flowsActions.duplicate,
- removeFlow: flowsActions.remove,
- revertFlow: flowsActions.revert
-})(FlowMenu);
-
-},{"../../ducks/flows":51,"../../flow/utils.js":60,"../common/Button":41,"prop-types":"prop-types","react":"react","react-redux":"react-redux"}],33:[function(require,module,exports){
-"use strict";
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports.default = MainMenu;
-
-var _react = require("react");
-
-var _react2 = _interopRequireDefault(_react);
-
-var _propTypes = require("prop-types");
-
-var _propTypes2 = _interopRequireDefault(_propTypes);
-
-var _reactRedux = require("react-redux");
-
-var _FilterInput = require("./FilterInput");
-
-var _FilterInput2 = _interopRequireDefault(_FilterInput);
-
-var _settings = require("../../ducks/settings");
-
-var _flows = require("../../ducks/flows");
-
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
-MainMenu.title = "Start";
-
-function MainMenu() {
- return _react2.default.createElement(
- "div",
- { className: "menu-main" },
- _react2.default.createElement(FlowFilterInput, null),
- _react2.default.createElement(HighlightInput, null),
- _react2.default.createElement(InterceptInput, null)
- );
-}
-
-var InterceptInput = (0, _reactRedux.connect)(function (state) {
- return {
- value: state.settings.intercept || '',
- placeholder: 'Intercept',
- type: 'pause',
- color: 'hsl(208, 56%, 53%)'
- };
-}, { onChange: function onChange(intercept) {
- return (0, _settings.update)({ intercept: intercept });
- } })(_FilterInput2.default);
-
-var FlowFilterInput = (0, _reactRedux.connect)(function (state) {
- return {
- value: state.flows.filter || '',
- placeholder: 'Search',
- type: 'search',
- color: 'black'
- };
-}, { onChange: _flows.setFilter })(_FilterInput2.default);
-
-var HighlightInput = (0, _reactRedux.connect)(function (state) {
- return {
- value: state.flows.highlight || '',
- placeholder: 'Highlight',
- type: 'tag',
- color: 'hsl(48, 100%, 50%)'
- };
-}, { onChange: _flows.setHighlight })(_FilterInput2.default);
-
-},{"../../ducks/flows":51,"../../ducks/settings":53,"./FilterInput":31,"prop-types":"prop-types","react":"react","react-redux":"react-redux"}],34:[function(require,module,exports){
-"use strict";
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports.MenuToggle = MenuToggle;
-exports.SettingsToggle = SettingsToggle;
-exports.EventlogToggle = EventlogToggle;
-
-var _propTypes = require("prop-types");
-
-var _propTypes2 = _interopRequireDefault(_propTypes);
-
-var _reactRedux = require("react-redux");
-
-var _settings = require("../../ducks/settings");
-
-var _eventLog = require("../../ducks/eventLog");
-
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
-function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
-
-MenuToggle.propTypes = {
- value: _propTypes2.default.bool.isRequired,
- onChange: _propTypes2.default.func.isRequired,
- children: _propTypes2.default.node.isRequired
-};
-
-function MenuToggle(_ref) {
- var value = _ref.value,
- onChange = _ref.onChange,
- children = _ref.children;
-
- return React.createElement(
- "div",
- { className: "menu-entry" },
- React.createElement(
- "label",
- null,
- React.createElement("input", { type: "checkbox",
- checked: value,
- onChange: onChange }),
- children
- )
- );
-}
-
-SettingsToggle.propTypes = {
- setting: _propTypes2.default.string.isRequired,
- children: _propTypes2.default.node.isRequired
-};
-
-function SettingsToggle(_ref2) {
- var setting = _ref2.setting,
- children = _ref2.children,
- settings = _ref2.settings,
- updateSettings = _ref2.updateSettings;
-
- return React.createElement(
- MenuToggle,
- {
- value: settings[setting] || false // we don't have settings initially, so just pass false.
- , onChange: function onChange() {
- return updateSettings(_defineProperty({}, setting, !settings[setting]));
- }
- },
- children
- );
-}
-exports.SettingsToggle = SettingsToggle = (0, _reactRedux.connect)(function (state) {
- return {
- settings: state.settings
- };
-}, {
- updateSettings: _settings.update
-})(SettingsToggle);
-
-function EventlogToggle(_ref3) {
- var toggleVisibility = _ref3.toggleVisibility,
- eventLogVisible = _ref3.eventLogVisible;
-
- return React.createElement(
- MenuToggle,
- {
- value: eventLogVisible,
- onChange: toggleVisibility
- },
- "Display Event Log"
- );
-}
-exports.EventlogToggle = EventlogToggle = (0, _reactRedux.connect)(function (state) {
- return {
- eventLogVisible: state.eventLog.visible
- };
-}, {
- toggleVisibility: _eventLog.toggleVisibility
-})(EventlogToggle);
-
-},{"../../ducks/eventLog":50,"../../ducks/settings":53,"prop-types":"prop-types","react-redux":"react-redux"}],35:[function(require,module,exports){
-"use strict";
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports.default = OptionMenu;
-
-var _react = require("react");
-
-var _react2 = _interopRequireDefault(_react);
-
-var _propTypes = require("prop-types");
-
-var _propTypes2 = _interopRequireDefault(_propTypes);
-
-var _reactRedux = require("react-redux");
-
-var _MenuToggle = require("./MenuToggle");
-
-var _DocsLink = require("../common/DocsLink");
-
-var _DocsLink2 = _interopRequireDefault(_DocsLink);
-
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
-OptionMenu.title = 'Options';
-
-function OptionMenu() {
- return _react2.default.createElement(
- "div",
- null,
- _react2.default.createElement(
- "div",
- { className: "menu-group" },
- _react2.default.createElement(
- "div",
- { className: "menu-content" },
- _react2.default.createElement(
- _MenuToggle.SettingsToggle,
- { setting: "http2" },
- "HTTP/2.0"
- ),
- _react2.default.createElement(
- _MenuToggle.SettingsToggle,
- { setting: "websocket" },
- "WebSockets"
- ),
- _react2.default.createElement(
- _MenuToggle.SettingsToggle,
- { setting: "rawtcp" },
- "Raw TCP"
- )
- ),
- _react2.default.createElement(
- "div",
- { className: "menu-legend" },
- "Protocol Support"
- )
- ),
- _react2.default.createElement(
- "div",
- { className: "menu-group" },
- _react2.default.createElement(
- "div",
- { className: "menu-content" },
- _react2.default.createElement(
- _MenuToggle.SettingsToggle,
- { setting: "anticache" },
- "Disable Caching ",
- _react2.default.createElement(_DocsLink2.default, { resource: "features/anticache.html" })
- ),
- _react2.default.createElement(
- _MenuToggle.SettingsToggle,
- { setting: "anticomp" },
- "Disable Compression ",
- _react2.default.createElement("i", { className: "fa fa-question-circle",
- title: "Do not forward Accept-Encoding headers to the server to force an uncompressed response." })
- )
- ),
- _react2.default.createElement(
- "div",
- { className: "menu-legend" },
- "HTTP Options"
- )
- ),
- _react2.default.createElement(
- "div",
- { className: "menu-group" },
- _react2.default.createElement(
- "div",
- { className: "menu-content" },
- _react2.default.createElement(
- _MenuToggle.SettingsToggle,
- { setting: "showhost" },
- "Use Host Header ",
- _react2.default.createElement("i", { className: "fa fa-question-circle",
- title: "Use the Host header to construct URLs for display." })
- ),
- _react2.default.createElement(_MenuToggle.EventlogToggle, null)
- ),
- _react2.default.createElement(
- "div",
- { className: "menu-legend" },
- "View Options"
- )
- )
- );
-}
-
-},{"../common/DocsLink":42,"./MenuToggle":34,"prop-types":"prop-types","react":"react","react-redux":"react-redux"}],36:[function(require,module,exports){
-'use strict';
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-
-var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-
-var _react = require('react');
-
-var _react2 = _interopRequireDefault(_react);
-
-var _propTypes = require('prop-types');
-
-var _propTypes2 = _interopRequireDefault(_propTypes);
-
-var _reactRedux = require('react-redux');
-
-var _Splitter = require('./common/Splitter');
-
-var _Splitter2 = _interopRequireDefault(_Splitter);
-
-var _FlowTable = require('./FlowTable');
-
-var _FlowTable2 = _interopRequireDefault(_FlowTable);
-
-var _FlowView = require('./FlowView');
-
-var _FlowView2 = _interopRequireDefault(_FlowView);
-
-var _flows = require('../ducks/flows');
-
-var flowsActions = _interopRequireWildcard(_flows);
-
-function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
-
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
-function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
-function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
-
-function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
-
-var MainView = function (_Component) {
- _inherits(MainView, _Component);
-
- function MainView() {
- _classCallCheck(this, MainView);
-
- return _possibleConstructorReturn(this, (MainView.__proto__ || Object.getPrototypeOf(MainView)).apply(this, arguments));
- }
-
- _createClass(MainView, [{
- key: 'render',
- value: function render() {
- var _this2 = this;
-
- var _props = this.props,
- flows = _props.flows,
- selectedFlow = _props.selectedFlow,
- highlight = _props.highlight;
-
- return _react2.default.createElement(
- 'div',
- { className: 'main-view' },
- _react2.default.createElement(_FlowTable2.default, {
- ref: 'flowTable',
- flows: flows,
- selected: selectedFlow,
- highlight: highlight,
- onSelect: this.props.selectFlow
- }),
- selectedFlow && [_react2.default.createElement(_Splitter2.default, { key: 'splitter' }), _react2.default.createElement(_FlowView2.default, {
- key: 'flowDetails',
- ref: 'flowDetails',
- tab: this.props.tab,
- updateFlow: function updateFlow(data) {
- return _this2.props.updateFlow(selectedFlow, data);
- },
- flow: selectedFlow
- })]
- );
- }
- }]);
-
- return MainView;
-}(_react.Component);
-
-MainView.propTypes = {
- highlight: _propTypes2.default.string,
- sort: _propTypes2.default.object
-};
-exports.default = (0, _reactRedux.connect)(function (state) {
- return {
- flows: state.flows.view,
- filter: state.flows.filter,
- highlight: state.flows.highlight,
- selectedFlow: state.flows.byId[state.flows.selected[0]],
- tab: state.ui.flow.tab
- };
-}, {
- selectFlow: flowsActions.select,
- updateFlow: flowsActions.update
-})(MainView);
-
-},{"../ducks/flows":51,"./FlowTable":16,"./FlowView":20,"./common/Splitter":45,"prop-types":"prop-types","react":"react","react-redux":"react-redux"}],37:[function(require,module,exports){
-'use strict';
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports.default = Prompt;
-
-var _react = require('react');
-
-var _react2 = _interopRequireDefault(_react);
-
-var _propTypes = require('prop-types');
-
-var _propTypes2 = _interopRequireDefault(_propTypes);
-
-var _reactDom = require('react-dom');
-
-var _reactDom2 = _interopRequireDefault(_reactDom);
-
-var _lodash = require('lodash');
-
-var _lodash2 = _interopRequireDefault(_lodash);
-
-var _utils = require('../utils.js');
-
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
-Prompt.propTypes = {
- options: _propTypes2.default.array.isRequired,
- done: _propTypes2.default.func.isRequired,
- prompt: _propTypes2.default.string
-};
-
-function Prompt(_ref) {
- var prompt = _ref.prompt,
- done = _ref.done,
- options = _ref.options;
-
- var opts = [];
-
- for (var i = 0; i < options.length; i++) {
- var opt = options[i];
- if (_lodash2.default.isString(opt)) {
- var str = opt;
- while (str.length > 0 && keyTaken(str[0])) {
- str = str.substr(1);
- }
- opt = { text: opt, key: str[0] };
- }
- if (!opt.text || !opt.key || keyTaken(opt.key)) {
- throw 'invalid options';
- }
- opts.push(opt);
- }
-
- function keyTaken(k) {
- return _lodash2.default.map(opts, 'key').includes(k);
- }
-
- function onKeyDown(event) {
- event.stopPropagation();
- event.preventDefault();
- var key = opts.find(function (opt) {
- return _utils.Key[opt.key.toUpperCase()] === event.keyCode;
- });
- if (!key && event.keyCode !== _utils.Key.ESC && event.keyCode !== _utils.Key.ENTER) {
- return;
- }
- done(key.key || false);
- }
-
- return _react2.default.createElement(
- 'div',
- { tabIndex: '0', onKeyDown: onKeyDown, className: 'prompt-dialog' },
- _react2.default.createElement(
- 'div',
- { className: 'prompt-content' },
- prompt || _react2.default.createElement(
- 'strong',
- null,
- 'Select: '
- ),
- opts.map(function (opt) {
- var idx = opt.text.indexOf(opt.key);
- function onClick(event) {
- done(opt.key);
- event.stopPropagation();
- }
- return _react2.default.createElement(
- 'span',
- { key: opt.key, className: 'option', onClick: onClick },
- idx !== -1 ? opt.text.substring(0, idx) : opt.text + '(',
- _react2.default.createElement(
- 'strong',
- { className: 'text-primary' },
- opt.key
- ),
- idx !== -1 ? opt.text.substring(idx + 1) : ')'
- );
- })
- )
- );
-}
-
-},{"../utils.js":62,"lodash":"lodash","prop-types":"prop-types","react":"react","react-dom":"react-dom"}],38:[function(require,module,exports){
-'use strict';
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-
-var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-
-var _react = require('react');
-
-var _react2 = _interopRequireDefault(_react);
-
-var _propTypes = require('prop-types');
-
-var _propTypes2 = _interopRequireDefault(_propTypes);
-
-var _reactRedux = require('react-redux');
-
-var _keyboard = require('../ducks/ui/keyboard');
-
-var _MainView = require('./MainView');
-
-var _MainView2 = _interopRequireDefault(_MainView);
-
-var _Header = require('./Header');
-
-var _Header2 = _interopRequireDefault(_Header);
-
-var _EventLog = require('./EventLog');
-
-var _EventLog2 = _interopRequireDefault(_EventLog);
-
-var _Footer = require('./Footer');
-
-var _Footer2 = _interopRequireDefault(_Footer);
-
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
-function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
-function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
-
-function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
-
-var ProxyAppMain = function (_Component) {
- _inherits(ProxyAppMain, _Component);
-
- function ProxyAppMain() {
- _classCallCheck(this, ProxyAppMain);
-
- return _possibleConstructorReturn(this, (ProxyAppMain.__proto__ || Object.getPrototypeOf(ProxyAppMain)).apply(this, arguments));
- }
-
- _createClass(ProxyAppMain, [{
- key: 'componentWillMount',
- value: function componentWillMount() {
- window.addEventListener('keydown', this.props.onKeyDown);
- }
- }, {
- key: 'componentWillUnmount',
- value: function componentWillUnmount() {
- window.removeEventListener('keydown', this.props.onKeyDown);
- }
- }, {
- key: 'render',
- value: function render() {
- var _props = this.props,
- showEventLog = _props.showEventLog,
- location = _props.location,
- filter = _props.filter,
- highlight = _props.highlight;
-
- return _react2.default.createElement(
- 'div',
- { id: 'container', tabIndex: '0' },
- _react2.default.createElement(_Header2.default, null),
- _react2.default.createElement(_MainView2.default, null),
- showEventLog && _react2.default.createElement(_EventLog2.default, { key: 'eventlog' }),
- _react2.default.createElement(_Footer2.default, null)
- );
- }
- }]);
-
- return ProxyAppMain;
-}(_react.Component);
-
-exports.default = (0, _reactRedux.connect)(function (state) {
- return {
- showEventLog: state.eventLog.visible
- };
-}, {
- onKeyDown: _keyboard.onKeyDown
-})(ProxyAppMain);
-
-},{"../ducks/ui/keyboard":57,"./EventLog":14,"./Footer":26,"./Header":27,"./MainView":36,"prop-types":"prop-types","react":"react","react-redux":"react-redux"}],39:[function(require,module,exports){
-'use strict';
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-
-var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-
-var _react = require('react');
-
-var _react2 = _interopRequireDefault(_react);
-
-var _propTypes = require('prop-types');
-
-var _propTypes2 = _interopRequireDefault(_propTypes);
-
-var _ValueEditor = require('./ValueEditor');
-
-var _ValueEditor2 = _interopRequireDefault(_ValueEditor);
-
-var _classnames = require('classnames');
-
-var _classnames2 = _interopRequireDefault(_classnames);
-
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
-function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
-function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
-
-function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
-
-var ValidateEditor = function (_Component) {
- _inherits(ValidateEditor, _Component);
-
- function ValidateEditor(props) {
- _classCallCheck(this, ValidateEditor);
-
- var _this = _possibleConstructorReturn(this, (ValidateEditor.__proto__ || Object.getPrototypeOf(ValidateEditor)).call(this, props));
-
- _this.state = { valid: props.isValid(props.content) };
- _this.onInput = _this.onInput.bind(_this);
- _this.onDone = _this.onDone.bind(_this);
- return _this;
- }
-
- _createClass(ValidateEditor, [{
- key: 'componentWillReceiveProps',
- value: function componentWillReceiveProps(nextProps) {
- this.setState({ valid: nextProps.isValid(nextProps.content) });
- }
- }, {
- key: 'onInput',
- value: function onInput(content) {
- this.setState({ valid: this.props.isValid(content) });
- }
- }, {
- key: 'onDone',
- value: function onDone(content) {
- if (!this.props.isValid(content)) {
- this.editor.reset();
- content = this.props.content;
- }
- this.props.onDone(content);
- }
- }, {
- key: 'render',
- value: function render() {
- var _this2 = this;
-
- var className = (0, _classnames2.default)(this.props.className, {
- 'has-success': this.state.valid,
- 'has-warning': !this.state.valid
- });
- return _react2.default.createElement(_ValueEditor2.default, {
- content: this.props.content,
- readonly: this.props.readonly,
- onDone: this.onDone,
- onInput: this.onInput,
- className: className,
- ref: function ref(e) {
- return _this2.editor = e;
- }
- });
- }
- }]);
-
- return ValidateEditor;
-}(_react.Component);
-
-ValidateEditor.propTypes = {
- content: _propTypes2.default.string.isRequired,
- readonly: _propTypes2.default.bool,
- onDone: _propTypes2.default.func.isRequired,
- className: _propTypes2.default.string,
- isValid: _propTypes2.default.func.isRequired
-};
-exports.default = ValidateEditor;
-
-},{"./ValueEditor":40,"classnames":"classnames","prop-types":"prop-types","react":"react"}],40:[function(require,module,exports){
-'use strict';
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-
-var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-
-var _react = require('react');
-
-var _react2 = _interopRequireDefault(_react);
-
-var _propTypes = require('prop-types');
-
-var _propTypes2 = _interopRequireDefault(_propTypes);
-
-var _lodash = require('lodash');
-
-var _lodash2 = _interopRequireDefault(_lodash);
-
-var _classnames = require('classnames');
-
-var _classnames2 = _interopRequireDefault(_classnames);
-
-var _utils = require('../../utils');
-
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
-function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
-function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
-
-function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
-
-var ValueEditor = function (_Component) {
- _inherits(ValueEditor, _Component);
-
- function ValueEditor(props) {
- _classCallCheck(this, ValueEditor);
-
- var _this = _possibleConstructorReturn(this, (ValueEditor.__proto__ || Object.getPrototypeOf(ValueEditor)).call(this, props));
-
- _this.state = { editable: false };
-
- _this.onPaste = _this.onPaste.bind(_this);
- _this.onMouseDown = _this.onMouseDown.bind(_this);
- _this.onMouseUp = _this.onMouseUp.bind(_this);
- _this.onFocus = _this.onFocus.bind(_this);
- _this.onClick = _this.onClick.bind(_this);
- _this.blur = _this.blur.bind(_this);
- _this.onBlur = _this.onBlur.bind(_this);
- _this.reset = _this.reset.bind(_this);
- _this.onKeyDown = _this.onKeyDown.bind(_this);
- _this.onInput = _this.onInput.bind(_this);
- return _this;
- }
-
- _createClass(ValueEditor, [{
- key: 'blur',
- value: function blur() {
- // a stop would cause a blur as a side-effect.
- // but a blur event must trigger a stop as well.
- // to fix this, make stop = blur and do the actual stop in the onBlur handler.
- this.input.blur();
- }
- }, {
- key: 'reset',
- value: function reset() {
- this.input.innerHTML = _lodash2.default.escape(this.props.content);
- }
- }, {
- key: 'render',
- value: function render() {
- var _this2 = this;
-
- var className = (0, _classnames2.default)('inline-input', {
- 'readonly': this.props.readonly,
- 'editable': !this.props.readonly
- }, this.props.className);
- return _react2.default.createElement('div', {
- ref: function ref(input) {
- return _this2.input = input;
- },
- tabIndex: this.props.readonly ? undefined : 0,
- className: className,
- contentEditable: this.state.editable || undefined,
- onFocus: this.onFocus,
- onMouseDown: this.onMouseDown,
- onClick: this.onClick,
- onBlur: this.onBlur,
- onKeyDown: this.onKeyDown,
- onInput: this.onInput,
- onPaste: this.onPaste,
- dangerouslySetInnerHTML: { __html: _lodash2.default.escape(this.props.content) }
- });
- }
- }, {
- key: 'onPaste',
- value: function onPaste(e) {
- e.preventDefault();
- var content = e.clipboardData.getData('text/plain');
- document.execCommand('insertHTML', false, content);
- }
- }, {
- key: 'onMouseDown',
- value: function onMouseDown(e) {
- this._mouseDown = true;
- window.addEventListener('mouseup', this.onMouseUp);
- }
- }, {
- key: 'onMouseUp',
- value: function onMouseUp() {
- if (this._mouseDown) {
- this._mouseDown = false;
- window.removeEventListener('mouseup', this.onMouseUp);
- }
- }
- }, {
- key: 'onClick',
- value: function onClick(e) {
- this.onMouseUp();
- this.onFocus(e);
- }
- }, {
- key: 'onFocus',
- value: function onFocus(e) {
- var _this3 = this;
-
- if (this._mouseDown || this._ignore_events || this.state.editable || this.props.readonly) {
- return;
- }
-
- // contenteditable in FireFox is more or less broken.
- // - we need to blur() and then focus(), otherwise the caret is not shown.
- // - blur() + focus() == we need to save the caret position before
- // Firefox sometimes just doesn't set a caret position => use caretPositionFromPoint
- var sel = window.getSelection();
- var range = void 0;
- if (sel.rangeCount > 0) {
- range = sel.getRangeAt(0);
- } else if (document.caretPositionFromPoint && e.clientX && e.clientY) {
- var pos = document.caretPositionFromPoint(e.clientX, e.clientY);
- range = document.createRange();
- range.setStart(pos.offsetNode, pos.offset);
- } else if (document.caretRangeFromPoint && e.clientX && e.clientY) {
- range = document.caretRangeFromPoint(e.clientX, e.clientY);
- } else {
- range = document.createRange();
- range.selectNodeContents(this.input);
- }
-
- this._ignore_events = true;
- this.setState({ editable: true }, function () {
- _this3.input.blur();
- _this3.input.focus();
- _this3._ignore_events = false;
- range.selectNodeContents(_this3.input);
- sel.removeAllRanges();
- sel.addRange(range);
- });
- }
- }, {
- key: 'onBlur',
- value: function onBlur(e) {
- if (this._ignore_events || this.props.readonly) {
- return;
- }
- window.getSelection().removeAllRanges(); //make sure that selection is cleared on blur
- this.setState({ editable: false });
- this.props.onDone(this.input.textContent);
- }
- }, {
- key: 'onKeyDown',
- value: function onKeyDown(e) {
- e.stopPropagation();
- switch (e.keyCode) {
- case _utils.Key.ESC:
- e.preventDefault();
- this.reset();
- this.blur();
- break;
- case _utils.Key.ENTER:
- if (!e.shiftKey) {
- e.preventDefault();
- this.blur();
- }
- break;
- default:
- break;
- }
- this.props.onKeyDown(e);
- }
- }, {
- key: 'onInput',
- value: function onInput() {
- this.props.onInput(this.input.textContent);
- }
- }]);
-
- return ValueEditor;
-}(_react.Component);
-
-ValueEditor.propTypes = {
- content: _propTypes2.default.string.isRequired,
- readonly: _propTypes2.default.bool,
- onDone: _propTypes2.default.func.isRequired,
- className: _propTypes2.default.string,
- onInput: _propTypes2.default.func,
- onKeyDown: _propTypes2.default.func
-};
-ValueEditor.defaultProps = {
- onInput: function onInput() {},
- onKeyDown: function onKeyDown() {}
-};
-exports.default = ValueEditor;
-
-},{"../../utils":62,"classnames":"classnames","lodash":"lodash","prop-types":"prop-types","react":"react"}],41:[function(require,module,exports){
-"use strict";
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports.default = Button;
-
-var _react = require("react");
-
-var _react2 = _interopRequireDefault(_react);
-
-var _propTypes = require("prop-types");
-
-var _propTypes2 = _interopRequireDefault(_propTypes);
-
-var _classnames = require("classnames");
-
-var _classnames2 = _interopRequireDefault(_classnames);
-
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
-Button.propTypes = {
- onClick: _propTypes2.default.func.isRequired,
- children: _propTypes2.default.node.isRequired,
- icon: _propTypes2.default.string,
- title: _propTypes2.default.string
-};
-
-function Button(_ref) {
- var onClick = _ref.onClick,
- children = _ref.children,
- icon = _ref.icon,
- disabled = _ref.disabled,
- className = _ref.className,
- title = _ref.title;
-
- return _react2.default.createElement(
- "div",
- { className: (0, _classnames2.default)(className, 'btn btn-default'),
- onClick: !disabled && onClick,
- disabled: disabled,
- title: title },
- icon && _react2.default.createElement("i", { className: "fa fa-fw " + icon }),
- children
- );
-}
-
-},{"classnames":"classnames","prop-types":"prop-types","react":"react"}],42:[function(require,module,exports){
-"use strict";
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports.default = DocsLink;
-
-var _propTypes = require("prop-types");
-
-var _propTypes2 = _interopRequireDefault(_propTypes);
-
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
-DocsLink.propTypes = {
- resource: _propTypes2.default.string.isRequired
-};
-
-function DocsLink(_ref) {
- var children = _ref.children,
- resource = _ref.resource;
-
- var url = "http://docs.mitmproxy.org/en/stable/" + resource;
- return React.createElement(
- "a",
- { target: "_blank", href: url },
- children || React.createElement("i", { className: "fa fa-question-circle" })
- );
-}
-
-},{"prop-types":"prop-types"}],43:[function(require,module,exports){
-'use strict';
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports.Divider = undefined;
-
-var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-
-var _react = require('react');
-
-var _react2 = _interopRequireDefault(_react);
-
-var _propTypes = require('prop-types');
-
-var _propTypes2 = _interopRequireDefault(_propTypes);
-
-var _classnames = require('classnames');
-
-var _classnames2 = _interopRequireDefault(_classnames);
-
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
-function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
-function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
-
-function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
-
-var Divider = exports.Divider = function Divider() {
- return _react2.default.createElement('hr', { className: 'divider' });
-};
-
-var Dropdown = function (_Component) {
- _inherits(Dropdown, _Component);
-
- function Dropdown(props, context) {
- _classCallCheck(this, Dropdown);
-
- var _this = _possibleConstructorReturn(this, (Dropdown.__proto__ || Object.getPrototypeOf(Dropdown)).call(this, props, context));
-
- _this.state = { open: false };
- _this.close = _this.close.bind(_this);
- _this.open = _this.open.bind(_this);
- return _this;
- }
-
- _createClass(Dropdown, [{
- key: 'close',
- value: function close() {
- this.setState({ open: false });
- document.removeEventListener('click', this.close);
- }
- }, {
- key: 'open',
- value: function open(e) {
- e.preventDefault();
- if (this.state.open) {
- return;
- }
- this.setState({ open: !this.state.open });
- document.addEventListener('click', this.close);
- }
- }, {
- key: 'render',
- value: function render() {
- var _props = this.props,
- dropup = _props.dropup,
- className = _props.className,
- btnClass = _props.btnClass,
- text = _props.text,
- children = _props.children;
-
- return _react2.default.createElement(
- 'div',
- { className: (0, _classnames2.default)(dropup ? 'dropup' : 'dropdown', className, { open: this.state.open }) },
- _react2.default.createElement(
- 'a',
- { href: '#', className: btnClass,
- onClick: this.open },
- text
- ),
- _react2.default.createElement(
- 'ul',
- { className: 'dropdown-menu', role: 'menu' },
- children.map(function (item, i) {
- return _react2.default.createElement(
- 'li',
- { key: i },
- ' ',
- item,
- ' '
- );
- })
- )
- );
- }
- }]);
-
- return Dropdown;
-}(_react.Component);
-
-Dropdown.propTypes = {
- dropup: _propTypes2.default.bool,
- className: _propTypes2.default.string,
- btnClass: _propTypes2.default.string.isRequired
-};
-Dropdown.defaultProps = {
- dropup: false
-};
-exports.default = Dropdown;
-
-},{"classnames":"classnames","prop-types":"prop-types","react":"react"}],44:[function(require,module,exports){
-'use strict';
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports.default = FileChooser;
-
-var _react = require('react');
-
-var _react2 = _interopRequireDefault(_react);
-
-var _propTypes = require('prop-types');
-
-var _propTypes2 = _interopRequireDefault(_propTypes);
-
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
-FileChooser.propTypes = {
- icon: _propTypes2.default.string,
- text: _propTypes2.default.string,
- className: _propTypes2.default.string,
- title: _propTypes2.default.string,
- onOpenFile: _propTypes2.default.func.isRequired
-};
-
-function FileChooser(_ref) {
- var icon = _ref.icon,
- text = _ref.text,
- className = _ref.className,
- title = _ref.title,
- onOpenFile = _ref.onOpenFile;
-
- var fileInput = void 0;
- return _react2.default.createElement(
- 'a',
- { href: '#', onClick: function onClick() {
- return fileInput.click();
- },
- className: className,
- title: title },
- _react2.default.createElement('i', { className: 'fa fa-fw ' + icon }),
- text,
- _react2.default.createElement('input', {
- ref: function ref(_ref2) {
- return fileInput = _ref2;
- },
- className: 'hidden',
- type: 'file',
- onChange: function onChange(e) {
- e.preventDefault();if (e.target.files.length > 0) onOpenFile(e.target.files[0]);fileInput = "";
- }
- })
- );
-}
-
-},{"prop-types":"prop-types","react":"react"}],45:[function(require,module,exports){
-'use strict';
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-
-var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-
-var _react = require('react');
-
-var _react2 = _interopRequireDefault(_react);
-
-var _reactDom = require('react-dom');
-
-var _reactDom2 = _interopRequireDefault(_reactDom);
-
-var _classnames = require('classnames');
-
-var _classnames2 = _interopRequireDefault(_classnames);
-
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
-function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
-function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
-
-function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
-
-var Splitter = function (_Component) {
- _inherits(Splitter, _Component);
-
- function Splitter(props, context) {
- _classCallCheck(this, Splitter);
-
- var _this = _possibleConstructorReturn(this, (Splitter.__proto__ || Object.getPrototypeOf(Splitter)).call(this, props, context));
-
- _this.state = { applied: false, startX: false, startY: false };
-
- _this.onMouseMove = _this.onMouseMove.bind(_this);
- _this.onMouseDown = _this.onMouseDown.bind(_this);
- _this.onMouseUp = _this.onMouseUp.bind(_this);
- _this.onDragEnd = _this.onDragEnd.bind(_this);
- return _this;
- }
-
- _createClass(Splitter, [{
- key: 'onMouseDown',
- value: function onMouseDown(e) {
- this.setState({ startX: e.pageX, startY: e.pageY });
-
- window.addEventListener('mousemove', this.onMouseMove);
- window.addEventListener('mouseup', this.onMouseUp);
- // Occasionally, only a dragEnd event is triggered, but no mouseUp.
- window.addEventListener('dragend', this.onDragEnd);
- }
- }, {
- key: 'onDragEnd',
- value: function onDragEnd() {
- _reactDom2.default.findDOMNode(this).style.transform = '';
-
- window.removeEventListener('dragend', this.onDragEnd);
- window.removeEventListener('mouseup', this.onMouseUp);
- window.removeEventListener('mousemove', this.onMouseMove);
- }
- }, {
- key: 'onMouseUp',
- value: function onMouseUp(e) {
- this.onDragEnd();
-
- var node = _reactDom2.default.findDOMNode(this);
- var prev = node.previousElementSibling;
-
- var flexBasis = prev.offsetHeight + e.pageY - this.state.startY;
-
- if (this.props.axis === 'x') {
- flexBasis = prev.offsetWidth + e.pageX - this.state.startX;
- }
-
- prev.style.flex = '0 0 ' + Math.max(0, flexBasis) + 'px';
- node.nextElementSibling.style.flex = '1 1 auto';
-
- this.setState({ applied: true });
- this.onResize();
- }
- }, {
- key: 'onMouseMove',
- value: function onMouseMove(e) {
- var dX = 0;
- var dY = 0;
- if (this.props.axis === 'x') {
- dX = e.pageX - this.state.startX;
- } else {
- dY = e.pageY - this.state.startY;
- }
- _reactDom2.default.findDOMNode(this).style.transform = 'translate(' + dX + 'px, ' + dY + 'px)';
- }
- }, {
- key: 'onResize',
- value: function onResize() {
- // Trigger a global resize event. This notifies components that employ virtual scrolling
- // that their viewport may have changed.
- window.setTimeout(function () {
- return window.dispatchEvent(new CustomEvent('resize'));
- }, 1);
- }
- }, {
- key: 'reset',
- value: function reset(willUnmount) {
- if (!this.state.applied) {
- return;
- }
-
- var node = _reactDom2.default.findDOMNode(this);
-
- node.previousElementSibling.style.flex = '';
- node.nextElementSibling.style.flex = '';
-
- if (!willUnmount) {
- this.setState({ applied: false });
- }
- this.onResize();
- }
- }, {
- key: 'componentWillUnmount',
- value: function componentWillUnmount() {
- this.reset(true);
- }
- }, {
- key: 'render',
- value: function render() {
- return _react2.default.createElement(
- 'div',
- { className: (0, _classnames2.default)('splitter', this.props.axis === 'x' ? 'splitter-x' : 'splitter-y') },
- _react2.default.createElement('div', { onMouseDown: this.onMouseDown, draggable: 'true' })
- );
- }
- }]);
-
- return Splitter;
-}(_react.Component);
-
-Splitter.defaultProps = { axis: 'x' };
-exports.default = Splitter;
-
-},{"classnames":"classnames","react":"react","react-dom":"react-dom"}],46:[function(require,module,exports){
-'use strict';
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports.default = ToggleButton;
-
-var _react = require('react');
-
-var _react2 = _interopRequireDefault(_react);
-
-var _propTypes = require('prop-types');
-
-var _propTypes2 = _interopRequireDefault(_propTypes);
-
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
-ToggleButton.propTypes = {
- checked: _propTypes2.default.bool.isRequired,
- onToggle: _propTypes2.default.func.isRequired,
- text: _propTypes2.default.string.isRequired
-};
-
-function ToggleButton(_ref) {
- var checked = _ref.checked,
- onToggle = _ref.onToggle,
- text = _ref.text;
-
- return _react2.default.createElement(
- 'div',
- { className: "btn btn-toggle " + (checked ? "btn-primary" : "btn-default"), onClick: onToggle },
- _react2.default.createElement('i', { className: "fa fa-fw " + (checked ? "fa-check-square-o" : "fa-square-o") }),
- '\xA0',
- text
- );
-}
-
-},{"prop-types":"prop-types","react":"react"}],47:[function(require,module,exports){
-"use strict";
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-
-var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-
-var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
-
-var _react = require("react");
-
-var _react2 = _interopRequireDefault(_react);
-
-var _reactDom = require("react-dom");
-
-var _reactDom2 = _interopRequireDefault(_reactDom);
-
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
-function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
-function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
-
-function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
-
-var symShouldStick = Symbol("shouldStick");
-var isAtBottom = function isAtBottom(v) {
- return v.scrollTop + v.clientHeight === v.scrollHeight;
-};
-
-exports.default = function (Component) {
- var _class, _temp;
-
- return Object.assign((_temp = _class = function (_Component) {
- _inherits(AutoScrollWrapper, _Component);
-
- function AutoScrollWrapper() {
- _classCallCheck(this, AutoScrollWrapper);
-
- return _possibleConstructorReturn(this, (AutoScrollWrapper.__proto__ || Object.getPrototypeOf(AutoScrollWrapper)).apply(this, arguments));
- }
-
- _createClass(AutoScrollWrapper, [{
- key: "componentWillUpdate",
- value: function componentWillUpdate() {
- var viewport = _reactDom2.default.findDOMNode(this);
- this[symShouldStick] = viewport.scrollTop && isAtBottom(viewport);
- _get(AutoScrollWrapper.prototype.__proto__ || Object.getPrototypeOf(AutoScrollWrapper.prototype), "componentWillUpdate", this) && _get(AutoScrollWrapper.prototype.__proto__ || Object.getPrototypeOf(AutoScrollWrapper.prototype), "componentWillUpdate", this).call(this);
- }
- }, {
- key: "componentDidUpdate",
- value: function componentDidUpdate() {
- var viewport = _reactDom2.default.findDOMNode(this);
- if (this[symShouldStick] && !isAtBottom(viewport)) {
- viewport.scrollTop = viewport.scrollHeight;
- }
- _get(AutoScrollWrapper.prototype.__proto__ || Object.getPrototypeOf(AutoScrollWrapper.prototype), "componentDidUpdate", this) && _get(AutoScrollWrapper.prototype.__proto__ || Object.getPrototypeOf(AutoScrollWrapper.prototype), "componentDidUpdate", this).call(this);
- }
- }]);
-
- return AutoScrollWrapper;
- }(Component), _class.displayName = Component.name, _temp), Component);
-};
-
-},{"react":"react","react-dom":"react-dom"}],48:[function(require,module,exports){
-"use strict";
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports.calcVScroll = calcVScroll;
-/**
- * Calculate virtual scroll stuffs
- *
- * @param {?Object} opts Options for calculation
- *
- * @returns {Object} result
- *
- * __opts__ should have following properties:
- * - {number} itemCount
- * - {number} rowHeight
- * - {number} viewportTop
- * - {number} viewportHeight
- * - {Array<?number>} [itemHeights]
- *
- * __result__ have following properties:
- * - {number} start
- * - {number} end
- * - {number} paddingTop
- * - {number} paddingBottom
- */
-function calcVScroll(opts) {
- if (!opts) {
- return { start: 0, end: 0, paddingTop: 0, paddingBottom: 0 };
- }
-
- var itemCount = opts.itemCount,
- rowHeight = opts.rowHeight,
- viewportTop = opts.viewportTop,
- viewportHeight = opts.viewportHeight,
- itemHeights = opts.itemHeights;
-
- var viewportBottom = viewportTop + viewportHeight;
-
- var start = 0;
- var end = 0;
-
- var paddingTop = 0;
- var paddingBottom = 0;
-
- if (itemHeights) {
-
- for (var i = 0, pos = 0; i < itemCount; i++) {
- var height = itemHeights[i] || rowHeight;
-
- if (pos <= viewportTop && i % 2 === 0) {
- paddingTop = pos;
- start = i;
- }
-
- if (pos <= viewportBottom) {
- end = i + 1;
- } else {
- paddingBottom += height;
- }
-
- pos += height;
- }
- } else {
-
- // Make sure that we start at an even row so that CSS `:nth-child(even)` is preserved
- start = Math.max(0, Math.floor(viewportTop / rowHeight) - 1) & ~1;
- end = Math.min(itemCount, start + Math.ceil(viewportHeight / rowHeight) + 2);
-
- // When a large trunk of elements is removed from the button, start may be far off the viewport.
- // To make this issue less severe, limit the top placeholder to the total number of rows.
- paddingTop = Math.min(start, itemCount) * rowHeight;
- paddingBottom = Math.max(0, itemCount - end) * rowHeight;
- }
-
- return { start: start, end: end, paddingTop: paddingTop, paddingBottom: paddingBottom };
-}
-
-},{}],49:[function(require,module,exports){
-"use strict";
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports.default = reducer;
-exports.startFetching = startFetching;
-exports.connectionEstablished = connectionEstablished;
-exports.connectionError = connectionError;
-exports.setOffline = setOffline;
-var ConnectionState = exports.ConnectionState = {
- INIT: Symbol("init"),
- FETCHING: Symbol("fetching"), // WebSocket is established, but still startFetching resources.
- ESTABLISHED: Symbol("established"),
- ERROR: Symbol("error"),
- OFFLINE: Symbol("offline") };
-
-var defaultState = {
- state: ConnectionState.INIT,
- message: null
-};
-
-function reducer() {
- var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultState;
- var action = arguments[1];
-
- switch (action.type) {
-
- case ConnectionState.ESTABLISHED:
- case ConnectionState.FETCHING:
- case ConnectionState.ERROR:
- case ConnectionState.OFFLINE:
- return {
- state: action.type,
- message: action.message
- };
-
- default:
- return state;
- }
-}
-
-function startFetching() {
- return { type: ConnectionState.FETCHING };
-}
-
-function connectionEstablished() {
- return { type: ConnectionState.ESTABLISHED };
-}
-
-function connectionError(message) {
- return { type: ConnectionState.ERROR, message: message };
-}
-function setOffline() {
- return { type: ConnectionState.OFFLINE };
-}
-
-},{}],50:[function(require,module,exports){
-"use strict";
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports.TOGGLE_FILTER = exports.TOGGLE_VISIBILITY = exports.RECEIVE = exports.ADD = undefined;
-
-var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
-
-exports.default = reduce;
-exports.toggleFilter = toggleFilter;
-exports.toggleVisibility = toggleVisibility;
-exports.add = add;
-
-var _store = require("./utils/store");
-
-var storeActions = _interopRequireWildcard(_store);
-
-function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
-
-function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
-
-var ADD = exports.ADD = 'EVENTS_ADD';
-var RECEIVE = exports.RECEIVE = 'EVENTS_RECEIVE';
-var TOGGLE_VISIBILITY = exports.TOGGLE_VISIBILITY = 'EVENTS_TOGGLE_VISIBILITY';
-var TOGGLE_FILTER = exports.TOGGLE_FILTER = 'EVENTS_TOGGLE_FILTER';
-
-var defaultState = _extends({
- visible: false,
- filters: { debug: false, info: true, web: true, warn: true, error: true }
-}, (0, storeActions.default)(undefined, {}));
-
-function reduce() {
- var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultState;
- var action = arguments[1];
-
- switch (action.type) {
-
- case TOGGLE_VISIBILITY:
- return _extends({}, state, {
- visible: !state.visible
- });
-
- case TOGGLE_FILTER:
- var filters = _extends({}, state.filters, _defineProperty({}, action.filter, !state.filters[action.filter]));
- return _extends({}, state, {
- filters: filters
- }, (0, storeActions.default)(state, storeActions.setFilter(function (log) {
- return filters[log.level];
- })));
-
- case ADD:
- case RECEIVE:
- return _extends({}, state, (0, storeActions.default)(state, storeActions[action.cmd](action.data, function (log) {
- return state.filters[log.level];
- })));
-
- default:
- return state;
- }
-}
-
-function toggleFilter(filter) {
- return { type: TOGGLE_FILTER, filter: filter };
-}
-
-function toggleVisibility() {
- return { type: TOGGLE_VISIBILITY };
-}
-
-function add(message) {
- var level = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'web';
-
- var data = {
- id: Math.random().toString(),
- message: message,
- level: level
- };
- return {
- type: ADD,
- cmd: "add",
- data: data
- };
-}
-
-},{"./utils/store":58}],51:[function(require,module,exports){
-"use strict";
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports.REQUEST_ACTION = exports.SET_HIGHLIGHT = exports.SET_SORT = exports.SET_FILTER = exports.SELECT = exports.RECEIVE = exports.REMOVE = exports.UPDATE = exports.ADD = undefined;
-
-var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
-
-exports.default = reduce;
-exports.makeFilter = makeFilter;
-exports.makeSort = makeSort;
-exports.setFilter = setFilter;
-exports.setHighlight = setHighlight;
-exports.setSort = setSort;
-exports.selectRelative = selectRelative;
-exports.resume = resume;
-exports.resumeAll = resumeAll;
-exports.kill = kill;
-exports.killAll = killAll;
-exports.remove = remove;
-exports.duplicate = duplicate;
-exports.replay = replay;
-exports.revert = revert;
-exports.update = update;
-exports.uploadContent = uploadContent;
-exports.clear = clear;
-exports.download = download;
-exports.upload = upload;
-exports.select = select;
-
-var _utils = require("../utils");
-
-var _store = require("./utils/store");
-
-var storeActions = _interopRequireWildcard(_store);
-
-var _filt = require("../filt/filt");
-
-var _filt2 = _interopRequireDefault(_filt);
-
-var _utils2 = require("../flow/utils");
-
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
-function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
-
-var ADD = exports.ADD = 'FLOWS_ADD';
-var UPDATE = exports.UPDATE = 'FLOWS_UPDATE';
-var REMOVE = exports.REMOVE = 'FLOWS_REMOVE';
-var RECEIVE = exports.RECEIVE = 'FLOWS_RECEIVE';
-var SELECT = exports.SELECT = 'FLOWS_SELECT';
-var SET_FILTER = exports.SET_FILTER = 'FLOWS_SET_FILTER';
-var SET_SORT = exports.SET_SORT = 'FLOWS_SET_SORT';
-var SET_HIGHLIGHT = exports.SET_HIGHLIGHT = 'FLOWS_SET_HIGHLIGHT';
-var REQUEST_ACTION = exports.REQUEST_ACTION = 'FLOWS_REQUEST_ACTION';
-
-var defaultState = _extends({
- highlight: null,
- filter: null,
- sort: { column: null, desc: false },
- selected: []
-}, (0, storeActions.default)(undefined, {}));
-
-function reduce() {
- var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultState;
- var action = arguments[1];
-
- switch (action.type) {
-
- case ADD:
- case UPDATE:
- case REMOVE:
- case RECEIVE:
- var storeAction = storeActions[action.cmd](action.data, makeFilter(state.filter), makeSort(state.sort));
-
- var selected = state.selected;
- if (action.type === REMOVE && state.selected.includes(action.data)) {
- if (state.selected.length > 1) {
- selected = selected.filter(function (x) {
- return x !== action.data;
- });
- } else {
- selected = [];
- if (action.data in state.viewIndex && state.view.length > 1) {
- var currentIndex = state.viewIndex[action.data],
- nextSelection = void 0;
- if (currentIndex === state.view.length - 1) {
- // last row
- nextSelection = state.view[currentIndex - 1];
- } else {
- nextSelection = state.view[currentIndex + 1];
- }
- selected.push(nextSelection.id);
- }
- }
- }
-
- return _extends({}, state, {
- selected: selected
- }, (0, storeActions.default)(state, storeAction));
-
- case SET_FILTER:
- return _extends({}, state, {
- filter: action.filter
- }, (0, storeActions.default)(state, storeActions.setFilter(makeFilter(action.filter), makeSort(state.sort))));
-
- case SET_HIGHLIGHT:
- return _extends({}, state, {
- highlight: action.highlight
- });
-
- case SET_SORT:
- return _extends({}, state, {
- sort: action.sort
- }, (0, storeActions.default)(state, storeActions.setSort(makeSort(action.sort))));
-
- case SELECT:
- return _extends({}, state, {
- selected: action.flowIds
- });
-
- default:
- return state;
- }
-}
-
-var sortKeyFuns = {
-
- TLSColumn: function TLSColumn(flow) {
- return flow.request.scheme;
- },
-
- PathColumn: function PathColumn(flow) {
- return _utils2.RequestUtils.pretty_url(flow.request);
- },
-
- MethodColumn: function MethodColumn(flow) {
- return flow.request.method;
- },
-
- StatusColumn: function StatusColumn(flow) {
- return flow.response && flow.response.status_code;
- },
-
- TimeColumn: function TimeColumn(flow) {
- return flow.response && flow.response.timestamp_end - flow.request.timestamp_start;
- },
-
- SizeColumn: function SizeColumn(flow) {
- var total = flow.request.contentLength;
- if (flow.response) {
- total += flow.response.contentLength || 0;
- }
- return total;
- }
-};
-
-function makeFilter(filter) {
- if (!filter) {
- return;
- }
- return _filt2.default.parse(filter);
-}
-
-function makeSort(_ref) {
- var column = _ref.column,
- desc = _ref.desc;
-
- var sortKeyFun = sortKeyFuns[column];
- if (!sortKeyFun) {
- return;
- }
- return function (a, b) {
- var ka = sortKeyFun(a);
- var kb = sortKeyFun(b);
- if (ka > kb) {
- return desc ? -1 : 1;
- }
- if (ka < kb) {
- return desc ? 1 : -1;
- }
- return 0;
- };
-}
-
-function setFilter(filter) {
- return { type: SET_FILTER, filter: filter };
-}
-
-function setHighlight(highlight) {
- return { type: SET_HIGHLIGHT, highlight: highlight };
-}
-
-function setSort(column, desc) {
- return { type: SET_SORT, sort: { column: column, desc: desc } };
-}
-
-function selectRelative(flows, shift) {
- var currentSelectionIndex = flows.viewIndex[flows.selected[0]];
- var minIndex = 0;
- var maxIndex = flows.view.length - 1;
- var newIndex = void 0;
- if (currentSelectionIndex === undefined) {
- newIndex = shift < 0 ? minIndex : maxIndex;
- } else {
- newIndex = currentSelectionIndex + shift;
- newIndex = window.Math.max(newIndex, minIndex);
- newIndex = window.Math.min(newIndex, maxIndex);
- }
- var flow = flows.view[newIndex];
- return select(flow ? flow.id : undefined);
-}
-
-function resume(flow) {
- return function (dispatch) {
- return (0, _utils.fetchApi)("/flows/" + flow.id + "/resume", { method: 'POST' });
- };
-}
-
-function resumeAll() {
- return function (dispatch) {
- return (0, _utils.fetchApi)('/flows/resume', { method: 'POST' });
- };
-}
-
-function kill(flow) {
- return function (dispatch) {
- return (0, _utils.fetchApi)("/flows/" + flow.id + "/kill", { method: 'POST' });
- };
-}
-
-function killAll() {
- return function (dispatch) {
- return (0, _utils.fetchApi)('/flows/kill', { method: 'POST' });
- };
-}
-
-function remove(flow) {
- return function (dispatch) {
- return (0, _utils.fetchApi)("/flows/" + flow.id, { method: 'DELETE' });
- };
-}
-
-function duplicate(flow) {
- return function (dispatch) {
- return (0, _utils.fetchApi)("/flows/" + flow.id + "/duplicate", { method: 'POST' });
- };
-}
-
-function replay(flow) {
- return function (dispatch) {
- return (0, _utils.fetchApi)("/flows/" + flow.id + "/replay", { method: 'POST' });
- };
-}
-
-function revert(flow) {
- return function (dispatch) {
- return (0, _utils.fetchApi)("/flows/" + flow.id + "/revert", { method: 'POST' });
- };
-}
-
-function update(flow, data) {
- return function (dispatch) {
- return _utils.fetchApi.put("/flows/" + flow.id, data);
- };
-}
-
-function uploadContent(flow, file, type) {
- var body = new FormData();
- file = new window.Blob([file], { type: 'plain/text' });
- body.append('file', file);
- return function (dispatch) {
- return (0, _utils.fetchApi)("/flows/" + flow.id + "/" + type + "/content", { method: 'POST', body: body });
- };
-}
-
-function clear() {
- return function (dispatch) {
- return (0, _utils.fetchApi)('/clear', { method: 'POST' });
- };
-}
-
-function download() {
- window.location = '/flows/dump';
- return { type: REQUEST_ACTION };
-}
-
-function upload(file) {
- var body = new FormData();
- body.append('file', file);
- return function (dispatch) {
- return (0, _utils.fetchApi)('/flows/dump', { method: 'POST', body: body });
- };
-}
-
-function select(id) {
- return {
- type: SELECT,
- flowIds: id ? [id] : []
- };
-}
-
-},{"../filt/filt":59,"../flow/utils":60,"../utils":62,"./utils/store":58}],52:[function(require,module,exports){
-"use strict";
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-
-var _redux = require("redux");
-
-var _eventLog = require("./eventLog");
-
-var _eventLog2 = _interopRequireDefault(_eventLog);
-
-var _flows = require("./flows");
-
-var _flows2 = _interopRequireDefault(_flows);
-
-var _settings = require("./settings");
-
-var _settings2 = _interopRequireDefault(_settings);
-
-var _index = require("./ui/index");
-
-var _index2 = _interopRequireDefault(_index);
-
-var _connection = require("./connection");
-
-var _connection2 = _interopRequireDefault(_connection);
-
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
-exports.default = (0, _redux.combineReducers)({
- eventLog: _eventLog2.default,
- flows: _flows2.default,
- settings: _settings2.default,
- connection: _connection2.default,
- ui: _index2.default
-});
-
-},{"./connection":49,"./eventLog":50,"./flows":51,"./settings":53,"./ui/index":56,"redux":"redux"}],53:[function(require,module,exports){
-'use strict';
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports.UNKNOWN_CMD = exports.REQUEST_UPDATE = exports.UPDATE = exports.RECEIVE = undefined;
-
-var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
-
-exports.default = reducer;
-exports.update = update;
-
-var _utils = require('../utils');
-
-var RECEIVE = exports.RECEIVE = 'SETTINGS_RECEIVE';
-var UPDATE = exports.UPDATE = 'SETTINGS_UPDATE';
-var REQUEST_UPDATE = exports.REQUEST_UPDATE = 'REQUEST_UPDATE';
-var UNKNOWN_CMD = exports.UNKNOWN_CMD = 'SETTINGS_UNKNOWN_CMD';
-
-var defaultState = {};
-
-function reducer() {
- var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultState;
- var action = arguments[1];
-
- switch (action.type) {
-
- case RECEIVE:
- return action.data;
-
- case UPDATE:
- return _extends({}, state, action.data);
-
- default:
- return state;
- }
-}
-
-function update(settings) {
- _utils.fetchApi.put('/settings', settings);
- return { type: REQUEST_UPDATE };
-}
-
-},{"../utils":62}],54:[function(require,module,exports){
-'use strict';
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports.SET_CONTENT = exports.SET_CONTENT_VIEW_DESCRIPTION = exports.SET_SHOW_FULL_CONTENT = exports.UPLOAD_CONTENT = exports.UPDATE_EDIT = exports.START_EDIT = exports.SET_TAB = exports.DISPLAY_LARGE = exports.SET_CONTENT_VIEW = undefined;
-
-var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
-
-exports.default = reducer;
-exports.setContentView = setContentView;
-exports.displayLarge = displayLarge;
-exports.selectTab = selectTab;
-exports.startEdit = startEdit;
-exports.updateEdit = updateEdit;
-exports.setContentViewDescription = setContentViewDescription;
-exports.setShowFullContent = setShowFullContent;
-exports.setContent = setContent;
-exports.stopEdit = stopEdit;
-
-var _flows = require('../flows');
-
-var flowsActions = _interopRequireWildcard(_flows);
-
-var _utils = require('../../utils');
-
-var _lodash = require('lodash');
-
-var _lodash2 = _interopRequireDefault(_lodash);
-
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
-function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
-
-var SET_CONTENT_VIEW = exports.SET_CONTENT_VIEW = 'UI_FLOWVIEW_SET_CONTENT_VIEW',
- DISPLAY_LARGE = exports.DISPLAY_LARGE = 'UI_FLOWVIEW_DISPLAY_LARGE',
- SET_TAB = exports.SET_TAB = "UI_FLOWVIEW_SET_TAB",
- START_EDIT = exports.START_EDIT = 'UI_FLOWVIEW_START_EDIT',
- UPDATE_EDIT = exports.UPDATE_EDIT = 'UI_FLOWVIEW_UPDATE_EDIT',
- UPLOAD_CONTENT = exports.UPLOAD_CONTENT = 'UI_FLOWVIEW_UPLOAD_CONTENT',
- SET_SHOW_FULL_CONTENT = exports.SET_SHOW_FULL_CONTENT = 'UI_SET_SHOW_FULL_CONTENT',
- SET_CONTENT_VIEW_DESCRIPTION = exports.SET_CONTENT_VIEW_DESCRIPTION = "UI_SET_CONTENT_VIEW_DESCRIPTION",
- SET_CONTENT = exports.SET_CONTENT = "UI_SET_CONTENT";
-
-var defaultState = {
- displayLarge: false,
- viewDescription: '',
- showFullContent: false,
- modifiedFlow: false,
- contentView: 'Auto',
- tab: 'request',
- content: [],
- maxContentLines: 80
-};
-
-function reducer() {
- var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultState;
- var action = arguments[1];
-
- var wasInEditMode = state.modifiedFlow;
-
- var content = action.content || state.content;
- var isFullContentShown = content && content.length <= state.maxContentLines;
-
- switch (action.type) {
-
- case START_EDIT:
- return _extends({}, state, {
- modifiedFlow: action.flow,
- contentView: 'Edit',
- showFullContent: true
- });
-
- case UPDATE_EDIT:
- return _extends({}, state, {
- modifiedFlow: _lodash2.default.merge({}, state.modifiedFlow, action.update)
- });
-
- case flowsActions.SELECT:
- return _extends({}, state, {
- modifiedFlow: false,
- displayLarge: false,
- contentView: wasInEditMode ? 'Auto' : state.contentView,
- showFullContent: isFullContentShown
- });
-
- case flowsActions.UPDATE:
- // There is no explicit "stop edit" event.
- // We stop editing when we receive an update for
- // the currently edited flow from the server
- if (action.data.id === state.modifiedFlow.id) {
- return _extends({}, state, {
- modifiedFlow: false,
- displayLarge: false,
- contentView: wasInEditMode ? 'Auto' : state.contentView,
- showFullContent: false
- });
- } else {
- return state;
- }
-
- case SET_CONTENT_VIEW_DESCRIPTION:
- return _extends({}, state, {
- viewDescription: action.description
- });
-
- case SET_SHOW_FULL_CONTENT:
- return _extends({}, state, {
- showFullContent: true
- });
-
- case SET_TAB:
- return _extends({}, state, {
- tab: action.tab ? action.tab : 'request',
- displayLarge: false,
- showFullContent: state.contentView === 'Edit'
- });
-
- case SET_CONTENT_VIEW:
- return _extends({}, state, {
- contentView: action.contentView,
- showFullContent: action.contentView === 'Edit'
- });
-
- case SET_CONTENT:
- return _extends({}, state, {
- content: action.content,
- showFullContent: isFullContentShown
- });
-
- case DISPLAY_LARGE:
- return _extends({}, state, {
- displayLarge: true
- });
- default:
- return state;
- }
-}
-
-function setContentView(contentView) {
- return { type: SET_CONTENT_VIEW, contentView: contentView };
-}
-
-function displayLarge() {
- return { type: DISPLAY_LARGE };
-}
-
-function selectTab(tab) {
- return { type: SET_TAB, tab: tab };
-}
-
-function startEdit(flow) {
- return { type: START_EDIT, flow: flow };
-}
-
-function updateEdit(update) {
- return { type: UPDATE_EDIT, update: update };
-}
-
-function setContentViewDescription(description) {
- return { type: SET_CONTENT_VIEW_DESCRIPTION, description: description };
-}
-
-function setShowFullContent() {
- return { type: SET_SHOW_FULL_CONTENT };
-}
-
-function setContent(content) {
- return { type: SET_CONTENT, content: content };
-}
-
-function stopEdit(data, modifiedFlow) {
- var diff = (0, _utils.getDiff)(data, modifiedFlow);
- return { type: flowsActions.UPDATE, data: data, diff: diff };
-}
-
-},{"../../utils":62,"../flows":51,"lodash":"lodash"}],55:[function(require,module,exports){
-'use strict';
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports.SET_ACTIVE_MENU = undefined;
-
-var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
-
-exports.default = reducer;
-exports.setActiveMenu = setActiveMenu;
-
-var _flows = require('../flows');
-
-var flowsActions = _interopRequireWildcard(_flows);
-
-function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
-
-var SET_ACTIVE_MENU = exports.SET_ACTIVE_MENU = 'UI_SET_ACTIVE_MENU';
-
-var defaultState = {
- activeMenu: 'Start',
- isFlowSelected: false
-};
-
-function reducer() {
- var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultState;
- var action = arguments[1];
-
- switch (action.type) {
-
- case SET_ACTIVE_MENU:
- return _extends({}, state, {
- activeMenu: action.activeMenu
- });
-
- case flowsActions.SELECT:
- // First Select
- if (action.flowIds.length > 0 && !state.isFlowSelected) {
- return _extends({}, state, {
- activeMenu: 'Flow',
- isFlowSelected: true
- });
- }
-
- // Deselect
- if (action.flowIds.length === 0 && state.isFlowSelected) {
- var activeMenu = state.activeMenu;
- if (activeMenu === 'Flow') {
- activeMenu = 'Start';
- }
- return _extends({}, state, {
- activeMenu: activeMenu,
- isFlowSelected: false
- });
- }
- return state;
- default:
- return state;
- }
-}
-
-function setActiveMenu(activeMenu) {
- return { type: SET_ACTIVE_MENU, activeMenu: activeMenu };
-}
-
-},{"../flows":51}],56:[function(require,module,exports){
-'use strict';
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-
-var _redux = require('redux');
-
-var _flow = require('./flow');
-
-var _flow2 = _interopRequireDefault(_flow);
-
-var _header = require('./header');
-
-var _header2 = _interopRequireDefault(_header);
-
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
-// TODO: Just move ducks/ui/* into ducks/?
-exports.default = (0, _redux.combineReducers)({
- flow: _flow2.default,
- header: _header2.default
-});
-
-},{"./flow":54,"./header":55,"redux":"redux"}],57:[function(require,module,exports){
-"use strict";
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports.onKeyDown = onKeyDown;
-
-var _utils = require("../../utils");
-
-var _flow = require("./flow");
-
-var _flows = require("../flows");
-
-var flowsActions = _interopRequireWildcard(_flows);
-
-function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
-
-function onKeyDown(e) {
- console.debug("onKeyDown", e);
- if (e.ctrlKey) {
- return function () {};
- }
- var key = e.keyCode,
- shiftKey = e.shiftKey;
- e.preventDefault();
- return function (dispatch, getState) {
-
- var flows = getState().flows,
- flow = flows.byId[getState().flows.selected[0]];
-
- switch (key) {
- case _utils.Key.K:
- case _utils.Key.UP:
- dispatch(flowsActions.selectRelative(flows, -1));
- break;
-
- case _utils.Key.J:
- case _utils.Key.DOWN:
- dispatch(flowsActions.selectRelative(flows, +1));
- break;
-
- case _utils.Key.SPACE:
- case _utils.Key.PAGE_DOWN:
- dispatch(flowsActions.selectRelative(flows, +10));
- break;
-
- case _utils.Key.PAGE_UP:
- dispatch(flowsActions.selectRelative(flows, -10));
- break;
-
- case _utils.Key.END:
- dispatch(flowsActions.selectRelative(flows, +1e10));
- break;
-
- case _utils.Key.HOME:
- dispatch(flowsActions.selectRelative(flows, -1e10));
- break;
-
- case _utils.Key.ESC:
- dispatch(flowsActions.select(null));
- break;
-
- case _utils.Key.LEFT:
- {
- if (!flow) break;
- var tabs = ['request', 'response', 'error'].filter(function (k) {
- return flow[k];
- }).concat(['details']),
- currentTab = getState().ui.flow.tab,
- nextTab = tabs[(tabs.indexOf(currentTab) - 1 + tabs.length) % tabs.length];
- dispatch((0, _flow.selectTab)(nextTab));
- break;
- }
-
- case _utils.Key.TAB:
- case _utils.Key.RIGHT:
- {
- if (!flow) break;
- var _tabs = ['request', 'response', 'error'].filter(function (k) {
- return flow[k];
- }).concat(['details']),
- _currentTab = getState().ui.flow.tab,
- _nextTab = _tabs[(_tabs.indexOf(_currentTab) + 1) % _tabs.length];
- dispatch((0, _flow.selectTab)(_nextTab));
- break;
- }
-
- case _utils.Key.D:
- {
- if (!flow) {
- return;
- }
- if (shiftKey) {
- dispatch(flowsActions.duplicate(flow));
- } else {
- dispatch(flowsActions.remove(flow));
- }
- break;
- }
-
- case _utils.Key.A:
- {
- if (shiftKey) {
- dispatch(flowsActions.resumeAll());
- } else if (flow && flow.intercepted) {
- dispatch(flowsActions.resume(flow));
- }
- break;
- }
-
- case _utils.Key.R:
- {
- if (!shiftKey && flow) {
- dispatch(flowsActions.replay(flow));
- }
- break;
- }
-
- case _utils.Key.V:
- {
- if (!shiftKey && flow && flow.modified) {
- dispatch(flowsActions.revert(flow));
- }
- break;
- }
-
- case _utils.Key.X:
- {
- if (shiftKey) {
- dispatch(flowsActions.killAll());
- } else if (flow && flow.intercepted) {
- dispatch(flowsActions.kill(flow));
- }
- break;
- }
-
- case _utils.Key.Z:
- {
- if (!shiftKey) {
- dispatch(flowsActions.clear());
- }
- break;
- }
-
- default:
- return;
- }
- };
-}
-
-},{"../../utils":62,"../flows":51,"./flow":54}],58:[function(require,module,exports){
-'use strict';
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-
-var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
-
-exports.default = reduce;
-exports.setFilter = setFilter;
-exports.setSort = setSort;
-exports.add = add;
-exports.update = update;
-exports.remove = remove;
-exports.receive = receive;
-
-function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
-
-function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
-
-var SET_FILTER = exports.SET_FILTER = 'LIST_SET_FILTER';
-var SET_SORT = exports.SET_SORT = 'LIST_SET_SORT';
-var ADD = exports.ADD = 'LIST_ADD';
-var UPDATE = exports.UPDATE = 'LIST_UPDATE';
-var REMOVE = exports.REMOVE = 'LIST_REMOVE';
-var RECEIVE = exports.RECEIVE = 'LIST_RECEIVE';
-
-var defaultState = {
- byId: {},
- list: [],
- listIndex: {},
- view: [],
- viewIndex: {}
-};
-
-/**
- * The store reducer can be used as a mixin to another reducer that always returns a
- * new { byId, list, listIndex, view, viewIndex } object. The reducer using the store
- * usually has to map its action to the matching store action and then call the mixin with that.
- *
- * Example Usage:
- *
- * import reduceStore, * as storeActions from "./utils/store"
- *
- * case EVENTLOG_ADD:
- * return {
- * ...state,
- * ...reduceStore(state, storeActions.add(action.data))
- * }
- *
- */
-function reduce() {
- var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultState;
- var action = arguments[1];
- var byId = state.byId,
- list = state.list,
- listIndex = state.listIndex,
- view = state.view,
- viewIndex = state.viewIndex;
-
-
- switch (action.type) {
- case SET_FILTER:
- view = list.filter(action.filter).sort(action.sort);
- viewIndex = {};
- view.forEach(function (item, index) {
- viewIndex[item.id] = index;
- });
- break;
-
- case SET_SORT:
- view = [].concat(_toConsumableArray(view)).sort(action.sort);
- viewIndex = {};
- view.forEach(function (item, index) {
- viewIndex[item.id] = index;
- });
- break;
-
- case ADD:
- if (action.item.id in byId) {
- // we already had that.
- break;
- }
- byId = _extends({}, byId, _defineProperty({}, action.item.id, action.item));
- listIndex = _extends({}, listIndex, _defineProperty({}, action.item.id, list.length));
- list = [].concat(_toConsumableArray(list), [action.item]);
- if (action.filter(action.item)) {
- var _sortedInsert = sortedInsert(state, action.item, action.sort);
-
- view = _sortedInsert.view;
- viewIndex = _sortedInsert.viewIndex;
- }
- break;
-
- case UPDATE:
- byId = _extends({}, byId, _defineProperty({}, action.item.id, action.item));
- list = [].concat(_toConsumableArray(list));
- list[listIndex[action.item.id]] = action.item;
-
- var hasOldItem = action.item.id in viewIndex;
- var hasNewItem = action.filter(action.item);
- if (hasNewItem && !hasOldItem) {
- var _sortedInsert2 = sortedInsert(state, action.item, action.sort);
-
- view = _sortedInsert2.view;
- viewIndex = _sortedInsert2.viewIndex;
- } else if (!hasNewItem && hasOldItem) {
- var _removeData = removeData(view, viewIndex, action.item.id);
-
- view = _removeData.data;
- viewIndex = _removeData.dataIndex;
- } else if (hasNewItem && hasOldItem) {
- var _sortedUpdate = sortedUpdate(state, action.item, action.sort);
-
- view = _sortedUpdate.view;
- viewIndex = _sortedUpdate.viewIndex;
- }
- break;
-
- case REMOVE:
- if (!(action.id in byId)) {
- break;
- }
- byId = _extends({}, byId);
- delete byId[action.id];
-
- var _removeData2 = removeData(list, listIndex, action.id);
-
- list = _removeData2.data;
- listIndex = _removeData2.dataIndex;
-
-
- if (action.id in viewIndex) {
- var _removeData3 = removeData(view, viewIndex, action.id);
-
- view = _removeData3.data;
- viewIndex = _removeData3.dataIndex;
- }
- break;
-
- case RECEIVE:
- list = action.list;
- listIndex = {};
- byId = {};
- list.forEach(function (item, i) {
- byId[item.id] = item;
- listIndex[item.id] = i;
- });
- view = list.filter(action.filter).sort(action.sort);
- viewIndex = {};
- view.forEach(function (item, index) {
- viewIndex[item.id] = index;
- });
- break;
- }
- return { byId: byId, list: list, listIndex: listIndex, view: view, viewIndex: viewIndex };
-}
-
-function setFilter() {
- var filter = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultFilter;
- var sort = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultSort;
-
- return { type: SET_FILTER, filter: filter, sort: sort };
-}
-
-function setSort() {
- var sort = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultSort;
-
- return { type: SET_SORT, sort: sort };
-}
-
-function add(item) {
- var filter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultFilter;
- var sort = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultSort;
-
- return { type: ADD, item: item, filter: filter, sort: sort };
-}
-
-function update(item) {
- var filter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultFilter;
- var sort = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultSort;
-
- return { type: UPDATE, item: item, filter: filter, sort: sort };
-}
-
-function remove(id) {
- return { type: REMOVE, id: id };
-}
-
-function receive(list) {
- var filter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultFilter;
- var sort = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultSort;
-
- return { type: RECEIVE, list: list, filter: filter, sort: sort };
-}
-
-function sortedInsert(state, item, sort) {
- var index = sortedIndex(state.view, item, sort);
- var view = [].concat(_toConsumableArray(state.view));
- var viewIndex = _extends({}, state.viewIndex);
-
- view.splice(index, 0, item);
- for (var i = view.length - 1; i >= index; i--) {
- viewIndex[view[i].id] = i;
- }
-
- return { view: view, viewIndex: viewIndex };
-}
-
-function removeData(currentData, currentDataIndex, id) {
- var index = currentDataIndex[id];
- var data = [].concat(_toConsumableArray(currentData));
- var dataIndex = _extends({}, currentDataIndex);
- delete dataIndex[id];
-
- data.splice(index, 1);
- for (var i = data.length - 1; i >= index; i--) {
- dataIndex[data[i].id] = i;
- }
-
- return { data: data, dataIndex: dataIndex };
-}
-
-function sortedUpdate(state, item, sort) {
- var view = [].concat(_toConsumableArray(state.view));
- var viewIndex = _extends({}, state.viewIndex);
- var index = viewIndex[item.id];
- view[index] = item;
- while (index + 1 < view.length && sort(view[index], view[index + 1]) > 0) {
- view[index] = view[index + 1];
- view[index + 1] = item;
- viewIndex[item.id] = index + 1;
- viewIndex[view[index].id] = index;
- ++index;
- }
- while (index > 0 && sort(view[index], view[index - 1]) < 0) {
- view[index] = view[index - 1];
- view[index - 1] = item;
- viewIndex[item.id] = index - 1;
- viewIndex[view[index].id] = index;
- --index;
- }
- return { view: view, viewIndex: viewIndex };
-}
-
-function sortedIndex(list, item, sort) {
- var low = 0;
- var high = list.length;
-
- while (low < high) {
- var middle = low + high >>> 1;
- if (sort(item, list[middle]) >= 0) {
- low = middle + 1;
- } else {
- high = middle;
- }
- }
-
- return low;
-}
-
-function defaultFilter() {
- return true;
-}
-
-function defaultSort(a, b) {
- return 0;
-}
-
-},{}],59:[function(require,module,exports){
-"use strict";
-
-module.exports = function () {
- "use strict";
-
- /*
- * Generated by PEG.js 0.9.0.
- *
- * http://pegjs.org/
- */
-
- function peg$subclass(child, parent) {
- function ctor() {
- this.constructor = child;
- }
- ctor.prototype = parent.prototype;
- child.prototype = new ctor();
- }
-
- function peg$SyntaxError(message, expected, found, location) {
- this.message = message;
- this.expected = expected;
- this.found = found;
- this.location = location;
- this.name = "SyntaxError";
-
- if (typeof Error.captureStackTrace === "function") {
- Error.captureStackTrace(this, peg$SyntaxError);
- }
- }
-
- peg$subclass(peg$SyntaxError, Error);
-
- function peg$parse(input) {
- var options = arguments.length > 1 ? arguments[1] : {},
- parser = this,
- peg$FAILED = {},
- peg$startRuleFunctions = { start: peg$parsestart },
- peg$startRuleFunction = peg$parsestart,
- peg$c0 = { type: "other", description: "filter expression" },
- peg$c1 = function peg$c1(orExpr) {
- return orExpr;
- },
- peg$c2 = { type: "other", description: "whitespace" },
- peg$c3 = /^[ \t\n\r]/,
- peg$c4 = { type: "class", value: "[ \\t\\n\\r]", description: "[ \\t\\n\\r]" },
- peg$c5 = { type: "other", description: "control character" },
- peg$c6 = /^[|&!()~"]/,
- peg$c7 = { type: "class", value: "[|&!()~\"]", description: "[|&!()~\"]" },
- peg$c8 = { type: "other", description: "optional whitespace" },
- peg$c9 = "|",
- peg$c10 = { type: "literal", value: "|", description: "\"|\"" },
- peg$c11 = function peg$c11(first, second) {
- return or(first, second);
- },
- peg$c12 = "&",
- peg$c13 = { type: "literal", value: "&", description: "\"&\"" },
- peg$c14 = function peg$c14(first, second) {
- return and(first, second);
- },
- peg$c15 = "!",
- peg$c16 = { type: "literal", value: "!", description: "\"!\"" },
- peg$c17 = function peg$c17(expr) {
- return not(expr);
- },
- peg$c18 = "(",
- peg$c19 = { type: "literal", value: "(", description: "\"(\"" },
- peg$c20 = ")",
- peg$c21 = { type: "literal", value: ")", description: "\")\"" },
- peg$c22 = function peg$c22(expr) {
- return binding(expr);
- },
- peg$c23 = "true",
- peg$c24 = { type: "literal", value: "true", description: "\"true\"" },
- peg$c25 = function peg$c25() {
- return trueFilter;
- },
- peg$c26 = "false",
- peg$c27 = { type: "literal", value: "false", description: "\"false\"" },
- peg$c28 = function peg$c28() {
- return falseFilter;
- },
- peg$c29 = "~a",
- peg$c30 = { type: "literal", value: "~a", description: "\"~a\"" },
- peg$c31 = function peg$c31() {
- return assetFilter;
- },
- peg$c32 = "~b",
- peg$c33 = { type: "literal", value: "~b", description: "\"~b\"" },
- peg$c34 = function peg$c34(s) {
- return body(s);
- },
- peg$c35 = "~bq",
- peg$c36 = { type: "literal", value: "~bq", description: "\"~bq\"" },
- peg$c37 = function peg$c37(s) {
- return requestBody(s);
- },
- peg$c38 = "~bs",
- peg$c39 = { type: "literal", value: "~bs", description: "\"~bs\"" },
- peg$c40 = function peg$c40(s) {
- return responseBody(s);
- },
- peg$c41 = "~c",
- peg$c42 = { type: "literal", value: "~c", description: "\"~c\"" },
- peg$c43 = function peg$c43(s) {
- return responseCode(s);
- },
- peg$c44 = "~d",
- peg$c45 = { type: "literal", value: "~d", description: "\"~d\"" },
- peg$c46 = function peg$c46(s) {
- return domain(s);
- },
- peg$c47 = "~dst",
- peg$c48 = { type: "literal", value: "~dst", description: "\"~dst\"" },
- peg$c49 = function peg$c49(s) {
- return destination(s);
- },
- peg$c50 = "~e",
- peg$c51 = { type: "literal", value: "~e", description: "\"~e\"" },
- peg$c52 = function peg$c52() {
- return errorFilter;
- },
- peg$c53 = "~h",
- peg$c54 = { type: "literal", value: "~h", description: "\"~h\"" },
- peg$c55 = function peg$c55(s) {
- return header(s);
- },
- peg$c56 = "~hq",
- peg$c57 = { type: "literal", value: "~hq", description: "\"~hq\"" },
- peg$c58 = function peg$c58(s) {
- return requestHeader(s);
- },
- peg$c59 = "~hs",
- peg$c60 = { type: "literal", value: "~hs", description: "\"~hs\"" },
- peg$c61 = function peg$c61(s) {
- return responseHeader(s);
- },
- peg$c62 = "~http",
- peg$c63 = { type: "literal", value: "~http", description: "\"~http\"" },
- peg$c64 = function peg$c64() {
- return httpFilter;
- },
- peg$c65 = "~m",
- peg$c66 = { type: "literal", value: "~m", description: "\"~m\"" },
- peg$c67 = function peg$c67(s) {
- return method(s);
- },
- peg$c68 = "~marked",
- peg$c69 = { type: "literal", value: "~marked", description: "\"~marked\"" },
- peg$c70 = function peg$c70() {
- return markedFilter;
- },
- peg$c71 = "~q",
- peg$c72 = { type: "literal", value: "~q", description: "\"~q\"" },
- peg$c73 = function peg$c73() {
- return noResponseFilter;
- },
- peg$c74 = "~src",
- peg$c75 = { type: "literal", value: "~src", description: "\"~src\"" },
- peg$c76 = function peg$c76(s) {
- return source(s);
- },
- peg$c77 = "~s",
- peg$c78 = { type: "literal", value: "~s", description: "\"~s\"" },
- peg$c79 = function peg$c79() {
- return responseFilter;
- },
- peg$c80 = "~t",
- peg$c81 = { type: "literal", value: "~t", description: "\"~t\"" },
- peg$c82 = function peg$c82(s) {
- return contentType(s);
- },
- peg$c83 = "~tcp",
- peg$c84 = { type: "literal", value: "~tcp", description: "\"~tcp\"" },
- peg$c85 = function peg$c85() {
- return tcpFilter;
- },
- peg$c86 = "~tq",
- peg$c87 = { type: "literal", value: "~tq", description: "\"~tq\"" },
- peg$c88 = function peg$c88(s) {
- return requestContentType(s);
- },
- peg$c89 = "~ts",
- peg$c90 = { type: "literal", value: "~ts", description: "\"~ts\"" },
- peg$c91 = function peg$c91(s) {
- return responseContentType(s);
- },
- peg$c92 = "~u",
- peg$c93 = { type: "literal", value: "~u", description: "\"~u\"" },
- peg$c94 = function peg$c94(s) {
- return url(s);
- },
- peg$c95 = "~websocket",
- peg$c96 = { type: "literal", value: "~websocket", description: "\"~websocket\"" },
- peg$c97 = function peg$c97() {
- return websocketFilter;
- },
- peg$c98 = { type: "other", description: "integer" },
- peg$c99 = /^['"]/,
- peg$c100 = { type: "class", value: "['\"]", description: "['\"]" },
- peg$c101 = /^[0-9]/,
- peg$c102 = { type: "class", value: "[0-9]", description: "[0-9]" },
- peg$c103 = function peg$c103(digits) {
- return parseInt(digits.join(""), 10);
- },
- peg$c104 = { type: "other", description: "string" },
- peg$c105 = "\"",
- peg$c106 = { type: "literal", value: "\"", description: "\"\\\"\"" },
- peg$c107 = function peg$c107(chars) {
- return chars.join("");
- },
- peg$c108 = "'",
- peg$c109 = { type: "literal", value: "'", description: "\"'\"" },
- peg$c110 = /^["\\]/,
- peg$c111 = { type: "class", value: "[\"\\\\]", description: "[\"\\\\]" },
- peg$c112 = { type: "any", description: "any character" },
- peg$c113 = function peg$c113(char) {
- return char;
- },
- peg$c114 = "\\",
- peg$c115 = { type: "literal", value: "\\", description: "\"\\\\\"" },
- peg$c116 = /^['\\]/,
- peg$c117 = { type: "class", value: "['\\\\]", description: "['\\\\]" },
- peg$c118 = /^['"\\]/,
- peg$c119 = { type: "class", value: "['\"\\\\]", description: "['\"\\\\]" },
- peg$c120 = "n",
- peg$c121 = { type: "literal", value: "n", description: "\"n\"" },
- peg$c122 = function peg$c122() {
- return "\n";
- },
- peg$c123 = "r",
- peg$c124 = { type: "literal", value: "r", description: "\"r\"" },
- peg$c125 = function peg$c125() {
- return "\r";
- },
- peg$c126 = "t",
- peg$c127 = { type: "literal", value: "t", description: "\"t\"" },
- peg$c128 = function peg$c128() {
- return "\t";
- },
- peg$currPos = 0,
- peg$savedPos = 0,
- peg$posDetailsCache = [{ line: 1, column: 1, seenCR: false }],
- peg$maxFailPos = 0,
- peg$maxFailExpected = [],
- peg$silentFails = 0,
- peg$result;
-
- if ("startRule" in options) {
- if (!(options.startRule in peg$startRuleFunctions)) {
- throw new Error("Can't start parsing from rule \"" + options.startRule + "\".");
- }
-
- peg$startRuleFunction = peg$startRuleFunctions[options.startRule];
- }
-
- function text() {
- return input.substring(peg$savedPos, peg$currPos);
- }
-
- function location() {
- return peg$computeLocation(peg$savedPos, peg$currPos);
- }
-
- function expected(description) {
- throw peg$buildException(null, [{ type: "other", description: description }], input.substring(peg$savedPos, peg$currPos), peg$computeLocation(peg$savedPos, peg$currPos));
- }
-
- function error(message) {
- throw peg$buildException(message, null, input.substring(peg$savedPos, peg$currPos), peg$computeLocation(peg$savedPos, peg$currPos));
- }
-
- function peg$computePosDetails(pos) {
- var details = peg$posDetailsCache[pos],
- p,
- ch;
-
- if (details) {
- return details;
- } else {
- p = pos - 1;
- while (!peg$posDetailsCache[p]) {
- p--;
- }
-
- details = peg$posDetailsCache[p];
- details = {
- line: details.line,
- column: details.column,
- seenCR: details.seenCR
- };
-
- while (p < pos) {
- ch = input.charAt(p);
- if (ch === "\n") {
- if (!details.seenCR) {
- details.line++;
- }
- details.column = 1;
- details.seenCR = false;
- } else if (ch === "\r" || ch === "\u2028" || ch === "\u2029") {
- details.line++;
- details.column = 1;
- details.seenCR = true;
- } else {
- details.column++;
- details.seenCR = false;
- }
-
- p++;
- }
-
- peg$posDetailsCache[pos] = details;
- return details;
- }
- }
-
- function peg$computeLocation(startPos, endPos) {
- var startPosDetails = peg$computePosDetails(startPos),
- endPosDetails = peg$computePosDetails(endPos);
-
- return {
- start: {
- offset: startPos,
- line: startPosDetails.line,
- column: startPosDetails.column
- },
- end: {
- offset: endPos,
- line: endPosDetails.line,
- column: endPosDetails.column
- }
- };
- }
-
- function peg$fail(expected) {
- if (peg$currPos < peg$maxFailPos) {
- return;
- }
-
- if (peg$currPos > peg$maxFailPos) {
- peg$maxFailPos = peg$currPos;
- peg$maxFailExpected = [];
- }
-
- peg$maxFailExpected.push(expected);
- }
-
- function peg$buildException(message, expected, found, location) {
- function cleanupExpected(expected) {
- var i = 1;
-
- expected.sort(function (a, b) {
- if (a.description < b.description) {
- return -1;
- } else if (a.description > b.description) {
- return 1;
- } else {
- return 0;
- }
- });
-
- while (i < expected.length) {
- if (expected[i - 1] === expected[i]) {
- expected.splice(i, 1);
- } else {
- i++;
- }
- }
- }
-
- function buildMessage(expected, found) {
- function stringEscape(s) {
- function hex(ch) {
- return ch.charCodeAt(0).toString(16).toUpperCase();
- }
-
- return s.replace(/\\/g, '\\\\').replace(/"/g, '\\"').replace(/\x08/g, '\\b').replace(/\t/g, '\\t').replace(/\n/g, '\\n').replace(/\f/g, '\\f').replace(/\r/g, '\\r').replace(/[\x00-\x07\x0B\x0E\x0F]/g, function (ch) {
- return '\\x0' + hex(ch);
- }).replace(/[\x10-\x1F\x80-\xFF]/g, function (ch) {
- return '\\x' + hex(ch);
- }).replace(/[\u0100-\u0FFF]/g, function (ch) {
- return "\\u0" + hex(ch);
- }).replace(/[\u1000-\uFFFF]/g, function (ch) {
- return "\\u" + hex(ch);
- });
- }
-
- var expectedDescs = new Array(expected.length),
- expectedDesc,
- foundDesc,
- i;
-
- for (i = 0; i < expected.length; i++) {
- expectedDescs[i] = expected[i].description;
- }
-
- expectedDesc = expected.length > 1 ? expectedDescs.slice(0, -1).join(", ") + " or " + expectedDescs[expected.length - 1] : expectedDescs[0];
-
- foundDesc = found ? "\"" + stringEscape(found) + "\"" : "end of input";
-
- return "Expected " + expectedDesc + " but " + foundDesc + " found.";
- }
-
- if (expected !== null) {
- cleanupExpected(expected);
- }
-
- return new peg$SyntaxError(message !== null ? message : buildMessage(expected, found), expected, found, location);
- }
-
- function peg$parsestart() {
- var s0, s1, s2, s3;
-
- peg$silentFails++;
- s0 = peg$currPos;
- s1 = peg$parse__();
- if (s1 !== peg$FAILED) {
- s2 = peg$parseOrExpr();
- if (s2 !== peg$FAILED) {
- s3 = peg$parse__();
- if (s3 !== peg$FAILED) {
- peg$savedPos = s0;
- s1 = peg$c1(s2);
- s0 = s1;
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- peg$silentFails--;
- if (s0 === peg$FAILED) {
- s1 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c0);
- }
- }
-
- return s0;
- }
-
- function peg$parsews() {
- var s0, s1;
-
- peg$silentFails++;
- if (peg$c3.test(input.charAt(peg$currPos))) {
- s0 = input.charAt(peg$currPos);
- peg$currPos++;
- } else {
- s0 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c4);
- }
- }
- peg$silentFails--;
- if (s0 === peg$FAILED) {
- s1 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c2);
- }
- }
-
- return s0;
- }
-
- function peg$parsecc() {
- var s0, s1;
-
- peg$silentFails++;
- if (peg$c6.test(input.charAt(peg$currPos))) {
- s0 = input.charAt(peg$currPos);
- peg$currPos++;
- } else {
- s0 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c7);
- }
- }
- peg$silentFails--;
- if (s0 === peg$FAILED) {
- s1 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c5);
- }
- }
-
- return s0;
- }
-
- function peg$parse__() {
- var s0, s1;
-
- peg$silentFails++;
- s0 = [];
- s1 = peg$parsews();
- while (s1 !== peg$FAILED) {
- s0.push(s1);
- s1 = peg$parsews();
- }
- peg$silentFails--;
- if (s0 === peg$FAILED) {
- s1 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c8);
- }
- }
-
- return s0;
- }
-
- function peg$parseOrExpr() {
- var s0, s1, s2, s3, s4, s5;
-
- s0 = peg$currPos;
- s1 = peg$parseAndExpr();
- if (s1 !== peg$FAILED) {
- s2 = peg$parse__();
- if (s2 !== peg$FAILED) {
- if (input.charCodeAt(peg$currPos) === 124) {
- s3 = peg$c9;
- peg$currPos++;
- } else {
- s3 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c10);
- }
- }
- if (s3 !== peg$FAILED) {
- s4 = peg$parse__();
- if (s4 !== peg$FAILED) {
- s5 = peg$parseOrExpr();
- if (s5 !== peg$FAILED) {
- peg$savedPos = s0;
- s1 = peg$c11(s1, s5);
- s0 = s1;
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- if (s0 === peg$FAILED) {
- s0 = peg$parseAndExpr();
- }
-
- return s0;
- }
-
- function peg$parseAndExpr() {
- var s0, s1, s2, s3, s4, s5;
-
- s0 = peg$currPos;
- s1 = peg$parseNotExpr();
- if (s1 !== peg$FAILED) {
- s2 = peg$parse__();
- if (s2 !== peg$FAILED) {
- if (input.charCodeAt(peg$currPos) === 38) {
- s3 = peg$c12;
- peg$currPos++;
- } else {
- s3 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c13);
- }
- }
- if (s3 !== peg$FAILED) {
- s4 = peg$parse__();
- if (s4 !== peg$FAILED) {
- s5 = peg$parseAndExpr();
- if (s5 !== peg$FAILED) {
- peg$savedPos = s0;
- s1 = peg$c14(s1, s5);
- s0 = s1;
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- if (s0 === peg$FAILED) {
- s0 = peg$currPos;
- s1 = peg$parseNotExpr();
- if (s1 !== peg$FAILED) {
- s2 = [];
- s3 = peg$parsews();
- if (s3 !== peg$FAILED) {
- while (s3 !== peg$FAILED) {
- s2.push(s3);
- s3 = peg$parsews();
- }
- } else {
- s2 = peg$FAILED;
- }
- if (s2 !== peg$FAILED) {
- s3 = peg$parseAndExpr();
- if (s3 !== peg$FAILED) {
- peg$savedPos = s0;
- s1 = peg$c14(s1, s3);
- s0 = s1;
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- if (s0 === peg$FAILED) {
- s0 = peg$parseNotExpr();
- }
- }
-
- return s0;
- }
-
- function peg$parseNotExpr() {
- var s0, s1, s2, s3;
-
- s0 = peg$currPos;
- if (input.charCodeAt(peg$currPos) === 33) {
- s1 = peg$c15;
- peg$currPos++;
- } else {
- s1 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c16);
- }
- }
- if (s1 !== peg$FAILED) {
- s2 = peg$parse__();
- if (s2 !== peg$FAILED) {
- s3 = peg$parseNotExpr();
- if (s3 !== peg$FAILED) {
- peg$savedPos = s0;
- s1 = peg$c17(s3);
- s0 = s1;
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- if (s0 === peg$FAILED) {
- s0 = peg$parseBindingExpr();
- }
-
- return s0;
- }
-
- function peg$parseBindingExpr() {
- var s0, s1, s2, s3, s4, s5;
-
- s0 = peg$currPos;
- if (input.charCodeAt(peg$currPos) === 40) {
- s1 = peg$c18;
- peg$currPos++;
- } else {
- s1 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c19);
- }
- }
- if (s1 !== peg$FAILED) {
- s2 = peg$parse__();
- if (s2 !== peg$FAILED) {
- s3 = peg$parseOrExpr();
- if (s3 !== peg$FAILED) {
- s4 = peg$parse__();
- if (s4 !== peg$FAILED) {
- if (input.charCodeAt(peg$currPos) === 41) {
- s5 = peg$c20;
- peg$currPos++;
- } else {
- s5 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c21);
- }
- }
- if (s5 !== peg$FAILED) {
- peg$savedPos = s0;
- s1 = peg$c22(s3);
- s0 = s1;
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- if (s0 === peg$FAILED) {
- s0 = peg$parseExpr();
- }
-
- return s0;
- }
-
- function peg$parseExpr() {
- var s0, s1, s2, s3;
-
- s0 = peg$currPos;
- if (input.substr(peg$currPos, 4) === peg$c23) {
- s1 = peg$c23;
- peg$currPos += 4;
- } else {
- s1 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c24);
- }
- }
- if (s1 !== peg$FAILED) {
- peg$savedPos = s0;
- s1 = peg$c25();
- }
- s0 = s1;
- if (s0 === peg$FAILED) {
- s0 = peg$currPos;
- if (input.substr(peg$currPos, 5) === peg$c26) {
- s1 = peg$c26;
- peg$currPos += 5;
- } else {
- s1 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c27);
- }
- }
- if (s1 !== peg$FAILED) {
- peg$savedPos = s0;
- s1 = peg$c28();
- }
- s0 = s1;
- if (s0 === peg$FAILED) {
- s0 = peg$currPos;
- if (input.substr(peg$currPos, 2) === peg$c29) {
- s1 = peg$c29;
- peg$currPos += 2;
- } else {
- s1 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c30);
- }
- }
- if (s1 !== peg$FAILED) {
- peg$savedPos = s0;
- s1 = peg$c31();
- }
- s0 = s1;
- if (s0 === peg$FAILED) {
- s0 = peg$currPos;
- if (input.substr(peg$currPos, 2) === peg$c32) {
- s1 = peg$c32;
- peg$currPos += 2;
- } else {
- s1 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c33);
- }
- }
- if (s1 !== peg$FAILED) {
- s2 = [];
- s3 = peg$parsews();
- if (s3 !== peg$FAILED) {
- while (s3 !== peg$FAILED) {
- s2.push(s3);
- s3 = peg$parsews();
- }
- } else {
- s2 = peg$FAILED;
- }
- if (s2 !== peg$FAILED) {
- s3 = peg$parseStringLiteral();
- if (s3 !== peg$FAILED) {
- peg$savedPos = s0;
- s1 = peg$c34(s3);
- s0 = s1;
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- if (s0 === peg$FAILED) {
- s0 = peg$currPos;
- if (input.substr(peg$currPos, 3) === peg$c35) {
- s1 = peg$c35;
- peg$currPos += 3;
- } else {
- s1 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c36);
- }
- }
- if (s1 !== peg$FAILED) {
- s2 = [];
- s3 = peg$parsews();
- if (s3 !== peg$FAILED) {
- while (s3 !== peg$FAILED) {
- s2.push(s3);
- s3 = peg$parsews();
- }
- } else {
- s2 = peg$FAILED;
- }
- if (s2 !== peg$FAILED) {
- s3 = peg$parseStringLiteral();
- if (s3 !== peg$FAILED) {
- peg$savedPos = s0;
- s1 = peg$c37(s3);
- s0 = s1;
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- if (s0 === peg$FAILED) {
- s0 = peg$currPos;
- if (input.substr(peg$currPos, 3) === peg$c38) {
- s1 = peg$c38;
- peg$currPos += 3;
- } else {
- s1 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c39);
- }
- }
- if (s1 !== peg$FAILED) {
- s2 = [];
- s3 = peg$parsews();
- if (s3 !== peg$FAILED) {
- while (s3 !== peg$FAILED) {
- s2.push(s3);
- s3 = peg$parsews();
- }
- } else {
- s2 = peg$FAILED;
- }
- if (s2 !== peg$FAILED) {
- s3 = peg$parseStringLiteral();
- if (s3 !== peg$FAILED) {
- peg$savedPos = s0;
- s1 = peg$c40(s3);
- s0 = s1;
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- if (s0 === peg$FAILED) {
- s0 = peg$currPos;
- if (input.substr(peg$currPos, 2) === peg$c41) {
- s1 = peg$c41;
- peg$currPos += 2;
- } else {
- s1 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c42);
- }
- }
- if (s1 !== peg$FAILED) {
- s2 = [];
- s3 = peg$parsews();
- if (s3 !== peg$FAILED) {
- while (s3 !== peg$FAILED) {
- s2.push(s3);
- s3 = peg$parsews();
- }
- } else {
- s2 = peg$FAILED;
- }
- if (s2 !== peg$FAILED) {
- s3 = peg$parseIntegerLiteral();
- if (s3 !== peg$FAILED) {
- peg$savedPos = s0;
- s1 = peg$c43(s3);
- s0 = s1;
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- if (s0 === peg$FAILED) {
- s0 = peg$currPos;
- if (input.substr(peg$currPos, 2) === peg$c44) {
- s1 = peg$c44;
- peg$currPos += 2;
- } else {
- s1 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c45);
- }
- }
- if (s1 !== peg$FAILED) {
- s2 = [];
- s3 = peg$parsews();
- if (s3 !== peg$FAILED) {
- while (s3 !== peg$FAILED) {
- s2.push(s3);
- s3 = peg$parsews();
- }
- } else {
- s2 = peg$FAILED;
- }
- if (s2 !== peg$FAILED) {
- s3 = peg$parseStringLiteral();
- if (s3 !== peg$FAILED) {
- peg$savedPos = s0;
- s1 = peg$c46(s3);
- s0 = s1;
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- if (s0 === peg$FAILED) {
- s0 = peg$currPos;
- if (input.substr(peg$currPos, 4) === peg$c47) {
- s1 = peg$c47;
- peg$currPos += 4;
- } else {
- s1 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c48);
- }
- }
- if (s1 !== peg$FAILED) {
- s2 = [];
- s3 = peg$parsews();
- if (s3 !== peg$FAILED) {
- while (s3 !== peg$FAILED) {
- s2.push(s3);
- s3 = peg$parsews();
- }
- } else {
- s2 = peg$FAILED;
- }
- if (s2 !== peg$FAILED) {
- s3 = peg$parseStringLiteral();
- if (s3 !== peg$FAILED) {
- peg$savedPos = s0;
- s1 = peg$c49(s3);
- s0 = s1;
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- if (s0 === peg$FAILED) {
- s0 = peg$currPos;
- if (input.substr(peg$currPos, 2) === peg$c50) {
- s1 = peg$c50;
- peg$currPos += 2;
- } else {
- s1 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c51);
- }
- }
- if (s1 !== peg$FAILED) {
- peg$savedPos = s0;
- s1 = peg$c52();
- }
- s0 = s1;
- if (s0 === peg$FAILED) {
- s0 = peg$currPos;
- if (input.substr(peg$currPos, 2) === peg$c53) {
- s1 = peg$c53;
- peg$currPos += 2;
- } else {
- s1 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c54);
- }
- }
- if (s1 !== peg$FAILED) {
- s2 = [];
- s3 = peg$parsews();
- if (s3 !== peg$FAILED) {
- while (s3 !== peg$FAILED) {
- s2.push(s3);
- s3 = peg$parsews();
- }
- } else {
- s2 = peg$FAILED;
- }
- if (s2 !== peg$FAILED) {
- s3 = peg$parseStringLiteral();
- if (s3 !== peg$FAILED) {
- peg$savedPos = s0;
- s1 = peg$c55(s3);
- s0 = s1;
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- if (s0 === peg$FAILED) {
- s0 = peg$currPos;
- if (input.substr(peg$currPos, 3) === peg$c56) {
- s1 = peg$c56;
- peg$currPos += 3;
- } else {
- s1 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c57);
- }
- }
- if (s1 !== peg$FAILED) {
- s2 = [];
- s3 = peg$parsews();
- if (s3 !== peg$FAILED) {
- while (s3 !== peg$FAILED) {
- s2.push(s3);
- s3 = peg$parsews();
- }
- } else {
- s2 = peg$FAILED;
- }
- if (s2 !== peg$FAILED) {
- s3 = peg$parseStringLiteral();
- if (s3 !== peg$FAILED) {
- peg$savedPos = s0;
- s1 = peg$c58(s3);
- s0 = s1;
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- if (s0 === peg$FAILED) {
- s0 = peg$currPos;
- if (input.substr(peg$currPos, 3) === peg$c59) {
- s1 = peg$c59;
- peg$currPos += 3;
- } else {
- s1 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c60);
- }
- }
- if (s1 !== peg$FAILED) {
- s2 = [];
- s3 = peg$parsews();
- if (s3 !== peg$FAILED) {
- while (s3 !== peg$FAILED) {
- s2.push(s3);
- s3 = peg$parsews();
- }
- } else {
- s2 = peg$FAILED;
- }
- if (s2 !== peg$FAILED) {
- s3 = peg$parseStringLiteral();
- if (s3 !== peg$FAILED) {
- peg$savedPos = s0;
- s1 = peg$c61(s3);
- s0 = s1;
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- if (s0 === peg$FAILED) {
- s0 = peg$currPos;
- if (input.substr(peg$currPos, 5) === peg$c62) {
- s1 = peg$c62;
- peg$currPos += 5;
- } else {
- s1 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c63);
- }
- }
- if (s1 !== peg$FAILED) {
- peg$savedPos = s0;
- s1 = peg$c64();
- }
- s0 = s1;
- if (s0 === peg$FAILED) {
- s0 = peg$currPos;
- if (input.substr(peg$currPos, 2) === peg$c65) {
- s1 = peg$c65;
- peg$currPos += 2;
- } else {
- s1 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c66);
- }
- }
- if (s1 !== peg$FAILED) {
- s2 = [];
- s3 = peg$parsews();
- if (s3 !== peg$FAILED) {
- while (s3 !== peg$FAILED) {
- s2.push(s3);
- s3 = peg$parsews();
- }
- } else {
- s2 = peg$FAILED;
- }
- if (s2 !== peg$FAILED) {
- s3 = peg$parseStringLiteral();
- if (s3 !== peg$FAILED) {
- peg$savedPos = s0;
- s1 = peg$c67(s3);
- s0 = s1;
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- if (s0 === peg$FAILED) {
- s0 = peg$currPos;
- if (input.substr(peg$currPos, 7) === peg$c68) {
- s1 = peg$c68;
- peg$currPos += 7;
- } else {
- s1 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c69);
- }
- }
- if (s1 !== peg$FAILED) {
- peg$savedPos = s0;
- s1 = peg$c70();
- }
- s0 = s1;
- if (s0 === peg$FAILED) {
- s0 = peg$currPos;
- if (input.substr(peg$currPos, 2) === peg$c71) {
- s1 = peg$c71;
- peg$currPos += 2;
- } else {
- s1 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c72);
- }
- }
- if (s1 !== peg$FAILED) {
- peg$savedPos = s0;
- s1 = peg$c73();
- }
- s0 = s1;
- if (s0 === peg$FAILED) {
- s0 = peg$currPos;
- if (input.substr(peg$currPos, 4) === peg$c74) {
- s1 = peg$c74;
- peg$currPos += 4;
- } else {
- s1 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c75);
- }
- }
- if (s1 !== peg$FAILED) {
- s2 = [];
- s3 = peg$parsews();
- if (s3 !== peg$FAILED) {
- while (s3 !== peg$FAILED) {
- s2.push(s3);
- s3 = peg$parsews();
- }
- } else {
- s2 = peg$FAILED;
- }
- if (s2 !== peg$FAILED) {
- s3 = peg$parseStringLiteral();
- if (s3 !== peg$FAILED) {
- peg$savedPos = s0;
- s1 = peg$c76(s3);
- s0 = s1;
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- if (s0 === peg$FAILED) {
- s0 = peg$currPos;
- if (input.substr(peg$currPos, 2) === peg$c77) {
- s1 = peg$c77;
- peg$currPos += 2;
- } else {
- s1 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c78);
- }
- }
- if (s1 !== peg$FAILED) {
- peg$savedPos = s0;
- s1 = peg$c79();
- }
- s0 = s1;
- if (s0 === peg$FAILED) {
- s0 = peg$currPos;
- if (input.substr(peg$currPos, 2) === peg$c80) {
- s1 = peg$c80;
- peg$currPos += 2;
- } else {
- s1 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c81);
- }
- }
- if (s1 !== peg$FAILED) {
- s2 = [];
- s3 = peg$parsews();
- if (s3 !== peg$FAILED) {
- while (s3 !== peg$FAILED) {
- s2.push(s3);
- s3 = peg$parsews();
- }
- } else {
- s2 = peg$FAILED;
- }
- if (s2 !== peg$FAILED) {
- s3 = peg$parseStringLiteral();
- if (s3 !== peg$FAILED) {
- peg$savedPos = s0;
- s1 = peg$c82(s3);
- s0 = s1;
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- if (s0 === peg$FAILED) {
- s0 = peg$currPos;
- if (input.substr(peg$currPos, 4) === peg$c83) {
- s1 = peg$c83;
- peg$currPos += 4;
- } else {
- s1 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c84);
- }
- }
- if (s1 !== peg$FAILED) {
- peg$savedPos = s0;
- s1 = peg$c85();
- }
- s0 = s1;
- if (s0 === peg$FAILED) {
- s0 = peg$currPos;
- if (input.substr(peg$currPos, 3) === peg$c86) {
- s1 = peg$c86;
- peg$currPos += 3;
- } else {
- s1 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c87);
- }
- }
- if (s1 !== peg$FAILED) {
- s2 = [];
- s3 = peg$parsews();
- if (s3 !== peg$FAILED) {
- while (s3 !== peg$FAILED) {
- s2.push(s3);
- s3 = peg$parsews();
- }
- } else {
- s2 = peg$FAILED;
- }
- if (s2 !== peg$FAILED) {
- s3 = peg$parseStringLiteral();
- if (s3 !== peg$FAILED) {
- peg$savedPos = s0;
- s1 = peg$c88(s3);
- s0 = s1;
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- if (s0 === peg$FAILED) {
- s0 = peg$currPos;
- if (input.substr(peg$currPos, 3) === peg$c89) {
- s1 = peg$c89;
- peg$currPos += 3;
- } else {
- s1 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c90);
- }
- }
- if (s1 !== peg$FAILED) {
- s2 = [];
- s3 = peg$parsews();
- if (s3 !== peg$FAILED) {
- while (s3 !== peg$FAILED) {
- s2.push(s3);
- s3 = peg$parsews();
- }
- } else {
- s2 = peg$FAILED;
- }
- if (s2 !== peg$FAILED) {
- s3 = peg$parseStringLiteral();
- if (s3 !== peg$FAILED) {
- peg$savedPos = s0;
- s1 = peg$c91(s3);
- s0 = s1;
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- if (s0 === peg$FAILED) {
- s0 = peg$currPos;
- if (input.substr(peg$currPos, 2) === peg$c92) {
- s1 = peg$c92;
- peg$currPos += 2;
- } else {
- s1 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c93);
- }
- }
- if (s1 !== peg$FAILED) {
- s2 = [];
- s3 = peg$parsews();
- if (s3 !== peg$FAILED) {
- while (s3 !== peg$FAILED) {
- s2.push(s3);
- s3 = peg$parsews();
- }
- } else {
- s2 = peg$FAILED;
- }
- if (s2 !== peg$FAILED) {
- s3 = peg$parseStringLiteral();
- if (s3 !== peg$FAILED) {
- peg$savedPos = s0;
- s1 = peg$c94(s3);
- s0 = s1;
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- if (s0 === peg$FAILED) {
- s0 = peg$currPos;
- if (input.substr(peg$currPos, 10) === peg$c95) {
- s1 = peg$c95;
- peg$currPos += 10;
- } else {
- s1 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c96);
- }
- }
- if (s1 !== peg$FAILED) {
- peg$savedPos = s0;
- s1 = peg$c97();
- }
- s0 = s1;
- if (s0 === peg$FAILED) {
- s0 = peg$currPos;
- s1 = peg$parseStringLiteral();
- if (s1 !== peg$FAILED) {
- peg$savedPos = s0;
- s1 = peg$c94(s1);
- }
- s0 = s1;
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
-
- return s0;
- }
-
- function peg$parseIntegerLiteral() {
- var s0, s1, s2, s3;
-
- peg$silentFails++;
- s0 = peg$currPos;
- if (peg$c99.test(input.charAt(peg$currPos))) {
- s1 = input.charAt(peg$currPos);
- peg$currPos++;
- } else {
- s1 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c100);
- }
- }
- if (s1 === peg$FAILED) {
- s1 = null;
- }
- if (s1 !== peg$FAILED) {
- s2 = [];
- if (peg$c101.test(input.charAt(peg$currPos))) {
- s3 = input.charAt(peg$currPos);
- peg$currPos++;
- } else {
- s3 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c102);
- }
- }
- if (s3 !== peg$FAILED) {
- while (s3 !== peg$FAILED) {
- s2.push(s3);
- if (peg$c101.test(input.charAt(peg$currPos))) {
- s3 = input.charAt(peg$currPos);
- peg$currPos++;
- } else {
- s3 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c102);
- }
- }
- }
- } else {
- s2 = peg$FAILED;
- }
- if (s2 !== peg$FAILED) {
- if (peg$c99.test(input.charAt(peg$currPos))) {
- s3 = input.charAt(peg$currPos);
- peg$currPos++;
- } else {
- s3 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c100);
- }
- }
- if (s3 === peg$FAILED) {
- s3 = null;
- }
- if (s3 !== peg$FAILED) {
- peg$savedPos = s0;
- s1 = peg$c103(s2);
- s0 = s1;
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- peg$silentFails--;
- if (s0 === peg$FAILED) {
- s1 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c98);
- }
- }
-
- return s0;
- }
-
- function peg$parseStringLiteral() {
- var s0, s1, s2, s3;
-
- peg$silentFails++;
- s0 = peg$currPos;
- if (input.charCodeAt(peg$currPos) === 34) {
- s1 = peg$c105;
- peg$currPos++;
- } else {
- s1 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c106);
- }
- }
- if (s1 !== peg$FAILED) {
- s2 = [];
- s3 = peg$parseDoubleStringChar();
- while (s3 !== peg$FAILED) {
- s2.push(s3);
- s3 = peg$parseDoubleStringChar();
- }
- if (s2 !== peg$FAILED) {
- if (input.charCodeAt(peg$currPos) === 34) {
- s3 = peg$c105;
- peg$currPos++;
- } else {
- s3 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c106);
- }
- }
- if (s3 !== peg$FAILED) {
- peg$savedPos = s0;
- s1 = peg$c107(s2);
- s0 = s1;
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- if (s0 === peg$FAILED) {
- s0 = peg$currPos;
- if (input.charCodeAt(peg$currPos) === 39) {
- s1 = peg$c108;
- peg$currPos++;
- } else {
- s1 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c109);
- }
- }
- if (s1 !== peg$FAILED) {
- s2 = [];
- s3 = peg$parseSingleStringChar();
- while (s3 !== peg$FAILED) {
- s2.push(s3);
- s3 = peg$parseSingleStringChar();
- }
- if (s2 !== peg$FAILED) {
- if (input.charCodeAt(peg$currPos) === 39) {
- s3 = peg$c108;
- peg$currPos++;
- } else {
- s3 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c109);
- }
- }
- if (s3 !== peg$FAILED) {
- peg$savedPos = s0;
- s1 = peg$c107(s2);
- s0 = s1;
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- if (s0 === peg$FAILED) {
- s0 = peg$currPos;
- s1 = peg$currPos;
- peg$silentFails++;
- s2 = peg$parsecc();
- peg$silentFails--;
- if (s2 === peg$FAILED) {
- s1 = void 0;
- } else {
- peg$currPos = s1;
- s1 = peg$FAILED;
- }
- if (s1 !== peg$FAILED) {
- s2 = [];
- s3 = peg$parseUnquotedStringChar();
- if (s3 !== peg$FAILED) {
- while (s3 !== peg$FAILED) {
- s2.push(s3);
- s3 = peg$parseUnquotedStringChar();
- }
- } else {
- s2 = peg$FAILED;
- }
- if (s2 !== peg$FAILED) {
- peg$savedPos = s0;
- s1 = peg$c107(s2);
- s0 = s1;
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- }
- }
- peg$silentFails--;
- if (s0 === peg$FAILED) {
- s1 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c104);
- }
- }
-
- return s0;
- }
-
- function peg$parseDoubleStringChar() {
- var s0, s1, s2;
-
- s0 = peg$currPos;
- s1 = peg$currPos;
- peg$silentFails++;
- if (peg$c110.test(input.charAt(peg$currPos))) {
- s2 = input.charAt(peg$currPos);
- peg$currPos++;
- } else {
- s2 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c111);
- }
- }
- peg$silentFails--;
- if (s2 === peg$FAILED) {
- s1 = void 0;
- } else {
- peg$currPos = s1;
- s1 = peg$FAILED;
- }
- if (s1 !== peg$FAILED) {
- if (input.length > peg$currPos) {
- s2 = input.charAt(peg$currPos);
- peg$currPos++;
- } else {
- s2 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c112);
- }
- }
- if (s2 !== peg$FAILED) {
- peg$savedPos = s0;
- s1 = peg$c113(s2);
- s0 = s1;
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- if (s0 === peg$FAILED) {
- s0 = peg$currPos;
- if (input.charCodeAt(peg$currPos) === 92) {
- s1 = peg$c114;
- peg$currPos++;
- } else {
- s1 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c115);
- }
- }
- if (s1 !== peg$FAILED) {
- s2 = peg$parseEscapeSequence();
- if (s2 !== peg$FAILED) {
- peg$savedPos = s0;
- s1 = peg$c113(s2);
- s0 = s1;
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- }
-
- return s0;
- }
-
- function peg$parseSingleStringChar() {
- var s0, s1, s2;
-
- s0 = peg$currPos;
- s1 = peg$currPos;
- peg$silentFails++;
- if (peg$c116.test(input.charAt(peg$currPos))) {
- s2 = input.charAt(peg$currPos);
- peg$currPos++;
- } else {
- s2 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c117);
- }
- }
- peg$silentFails--;
- if (s2 === peg$FAILED) {
- s1 = void 0;
- } else {
- peg$currPos = s1;
- s1 = peg$FAILED;
- }
- if (s1 !== peg$FAILED) {
- if (input.length > peg$currPos) {
- s2 = input.charAt(peg$currPos);
- peg$currPos++;
- } else {
- s2 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c112);
- }
- }
- if (s2 !== peg$FAILED) {
- peg$savedPos = s0;
- s1 = peg$c113(s2);
- s0 = s1;
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- if (s0 === peg$FAILED) {
- s0 = peg$currPos;
- if (input.charCodeAt(peg$currPos) === 92) {
- s1 = peg$c114;
- peg$currPos++;
- } else {
- s1 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c115);
- }
- }
- if (s1 !== peg$FAILED) {
- s2 = peg$parseEscapeSequence();
- if (s2 !== peg$FAILED) {
- peg$savedPos = s0;
- s1 = peg$c113(s2);
- s0 = s1;
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- }
-
- return s0;
- }
-
- function peg$parseUnquotedStringChar() {
- var s0, s1, s2;
-
- s0 = peg$currPos;
- s1 = peg$currPos;
- peg$silentFails++;
- s2 = peg$parsews();
- peg$silentFails--;
- if (s2 === peg$FAILED) {
- s1 = void 0;
- } else {
- peg$currPos = s1;
- s1 = peg$FAILED;
- }
- if (s1 !== peg$FAILED) {
- if (input.length > peg$currPos) {
- s2 = input.charAt(peg$currPos);
- peg$currPos++;
- } else {
- s2 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c112);
- }
- }
- if (s2 !== peg$FAILED) {
- peg$savedPos = s0;
- s1 = peg$c113(s2);
- s0 = s1;
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
-
- return s0;
- }
-
- function peg$parseEscapeSequence() {
- var s0, s1;
-
- if (peg$c118.test(input.charAt(peg$currPos))) {
- s0 = input.charAt(peg$currPos);
- peg$currPos++;
- } else {
- s0 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c119);
- }
- }
- if (s0 === peg$FAILED) {
- s0 = peg$currPos;
- if (input.charCodeAt(peg$currPos) === 110) {
- s1 = peg$c120;
- peg$currPos++;
- } else {
- s1 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c121);
- }
- }
- if (s1 !== peg$FAILED) {
- peg$savedPos = s0;
- s1 = peg$c122();
- }
- s0 = s1;
- if (s0 === peg$FAILED) {
- s0 = peg$currPos;
- if (input.charCodeAt(peg$currPos) === 114) {
- s1 = peg$c123;
- peg$currPos++;
- } else {
- s1 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c124);
- }
- }
- if (s1 !== peg$FAILED) {
- peg$savedPos = s0;
- s1 = peg$c125();
- }
- s0 = s1;
- if (s0 === peg$FAILED) {
- s0 = peg$currPos;
- if (input.charCodeAt(peg$currPos) === 116) {
- s1 = peg$c126;
- peg$currPos++;
- } else {
- s1 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c127);
- }
- }
- if (s1 !== peg$FAILED) {
- peg$savedPos = s0;
- s1 = peg$c128();
- }
- s0 = s1;
- }
- }
- }
-
- return s0;
- }
-
- var flowutils = require("../flow/utils.js");
-
- function or(first, second) {
- // Add explicit function names to ease debugging.
- function orFilter() {
- return first.apply(this, arguments) || second.apply(this, arguments);
- }
- orFilter.desc = first.desc + " or " + second.desc;
- return orFilter;
- }
- function and(first, second) {
- function andFilter() {
- return first.apply(this, arguments) && second.apply(this, arguments);
- }
- andFilter.desc = first.desc + " and " + second.desc;
- return andFilter;
- }
- function not(expr) {
- function notFilter() {
- return !expr.apply(this, arguments);
- }
- notFilter.desc = "not " + expr.desc;
- return notFilter;
- }
- function binding(expr) {
- function bindingFilter() {
- return expr.apply(this, arguments);
- }
- bindingFilter.desc = "(" + expr.desc + ")";
- return bindingFilter;
- }
- function trueFilter(flow) {
- return true;
- }
- trueFilter.desc = "true";
- function falseFilter(flow) {
- return false;
- }
- falseFilter.desc = "false";
-
- var ASSET_TYPES = [new RegExp("text/javascript"), new RegExp("application/x-javascript"), new RegExp("application/javascript"), new RegExp("text/css"), new RegExp("image/.*"), new RegExp("application/x-shockwave-flash")];
- function assetFilter(flow) {
- if (flow.response) {
- var ct = flowutils.ResponseUtils.getContentType(flow.response);
- var i = ASSET_TYPES.length;
- while (i--) {
- if (ASSET_TYPES[i].test(ct)) {
- return true;
- }
- }
- }
- return false;
- }
- assetFilter.desc = "is asset";
- function responseCode(code) {
- function responseCodeFilter(flow) {
- return flow.response && flow.response.status_code === code;
- }
- responseCodeFilter.desc = "resp. code is " + code;
- return responseCodeFilter;
- }
- function body(regex) {
- regex = new RegExp(regex, "i");
- function bodyFilter(flow) {
- return True;
- }
- bodyFilter.desc = "body filters are not implemented yet, see https://github.com/mitmproxy/mitmweb/issues/10";
- return bodyFilter;
- }
- function requestBody(regex) {
- regex = new RegExp(regex, "i");
- function requestBodyFilter(flow) {
- return True;
- }
- requestBodyFilter.desc = "body filters are not implemented yet, see https://github.com/mitmproxy/mitmweb/issues/10";
- return requestBodyFilter;
- }
- function responseBody(regex) {
- regex = new RegExp(regex, "i");
- function responseBodyFilter(flow) {
- return True;
- }
- responseBodyFilter.desc = "body filters are not implemented yet, see https://github.com/mitmproxy/mitmweb/issues/10";
- return responseBodyFilter;
- }
- function domain(regex) {
- regex = new RegExp(regex, "i");
- function domainFilter(flow) {
- return flow.request && (regex.test(flow.request.host) || regex.test(flow.request.pretty_host));
- }
- domainFilter.desc = "domain matches " + regex;
- return domainFilter;
- }
- function destination(regex) {
- regex = new RegExp(regex, "i");
- function destinationFilter(flow) {
- return !!flow.server_conn.address && regex.test(flow.server_conn.address[0] + ":" + flow.server_conn.address[1]);
- }
- destinationFilter.desc = "destination address matches " + regex;
- return destinationFilter;
- }
- function errorFilter(flow) {
- return !!flow.error;
- }
- errorFilter.desc = "has error";
- function header(regex) {
- regex = new RegExp(regex, "i");
- function headerFilter(flow) {
- return flow.request && flowutils.RequestUtils.match_header(flow.request, regex) || flow.response && flowutils.ResponseUtils.match_header(flow.response, regex);
- }
- headerFilter.desc = "header matches " + regex;
- return headerFilter;
- }
- function requestHeader(regex) {
- regex = new RegExp(regex, "i");
- function requestHeaderFilter(flow) {
- return flow.request && flowutils.RequestUtils.match_header(flow.request, regex);
- }
- requestHeaderFilter.desc = "req. header matches " + regex;
- return requestHeaderFilter;
- }
- function responseHeader(regex) {
- regex = new RegExp(regex, "i");
- function responseHeaderFilter(flow) {
- return flow.response && flowutils.ResponseUtils.match_header(flow.response, regex);
- }
- responseHeaderFilter.desc = "resp. header matches " + regex;
- return responseHeaderFilter;
- }
- function httpFilter(flow) {
- return flow.type === "http";
- }
- httpFilter.desc = "is an HTTP Flow";
- function method(regex) {
- regex = new RegExp(regex, "i");
- function methodFilter(flow) {
- return flow.request && regex.test(flow.request.method);
- }
- methodFilter.desc = "method matches " + regex;
- return methodFilter;
- }
- function markedFilter(flow) {
- return flow.marked;
- }
- markedFilter.desc = "is marked";
- function noResponseFilter(flow) {
- return flow.request && !flow.response;
- }
- noResponseFilter.desc = "has no response";
- function responseFilter(flow) {
- return !!flow.response;
- }
- responseFilter.desc = "has response";
- function source(regex) {
- regex = new RegExp(regex, "i");
- function sourceFilter(flow) {
- return !!flow.client_conn.address && regex.test(flow.client_conn.address[0] + ":" + flow.client_conn.address[1]);
- }
- sourceFilter.desc = "source address matches " + regex;
- return sourceFilter;
- }
- function contentType(regex) {
- regex = new RegExp(regex, "i");
- function contentTypeFilter(flow) {
- return flow.request && regex.test(flowutils.RequestUtils.getContentType(flow.request)) || flow.response && regex.test(flowutils.ResponseUtils.getContentType(flow.response));
- }
- contentTypeFilter.desc = "content type matches " + regex;
- return contentTypeFilter;
- }
- function tcpFilter(flow) {
- return flow.type === "tcp";
- }
- tcpFilter.desc = "is a TCP Flow";
- function requestContentType(regex) {
- regex = new RegExp(regex, "i");
- function requestContentTypeFilter(flow) {
- return flow.request && regex.test(flowutils.RequestUtils.getContentType(flow.request));
- }
- requestContentTypeFilter.desc = "req. content type matches " + regex;
- return requestContentTypeFilter;
- }
- function responseContentType(regex) {
- regex = new RegExp(regex, "i");
- function responseContentTypeFilter(flow) {
- return flow.response && regex.test(flowutils.ResponseUtils.getContentType(flow.response));
- }
- responseContentTypeFilter.desc = "resp. content type matches " + regex;
- return responseContentTypeFilter;
- }
- function url(regex) {
- regex = new RegExp(regex, "i");
- function urlFilter(flow) {
- return flow.request && regex.test(flowutils.RequestUtils.pretty_url(flow.request));
- }
- urlFilter.desc = "url matches " + regex;
- return urlFilter;
- }
- function websocketFilter(flow) {
- return flow.type === "websocket";
- }
- websocketFilter.desc = "is a Websocket Flow";
-
- peg$result = peg$startRuleFunction();
-
- if (peg$result !== peg$FAILED && peg$currPos === input.length) {
- return peg$result;
- } else {
- if (peg$result !== peg$FAILED && peg$currPos < input.length) {
- peg$fail({ type: "end", description: "end of input" });
- }
-
- throw peg$buildException(null, peg$maxFailExpected, peg$maxFailPos < input.length ? input.charAt(peg$maxFailPos) : null, peg$maxFailPos < input.length ? peg$computeLocation(peg$maxFailPos, peg$maxFailPos + 1) : peg$computeLocation(peg$maxFailPos, peg$maxFailPos));
- }
- }
-
- return {
- SyntaxError: peg$SyntaxError,
- parse: peg$parse
- };
-}();
-
-},{"../flow/utils.js":60}],60:[function(require,module,exports){
-"use strict";
+"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function ViewImage(e){var t=e.flow,r=e.message;return _react2.default.createElement("div",{className:"flowview-image"},_react2.default.createElement("img",{src:_utils.MessageUtils.getContentURL(t,r),alt:"preview",className:"img-thumbnail"}))}function Edit(e){var t=e.content,r=e.onChange;return _react2.default.createElement(_CodeEditor2.default,{content:t,onChange:r})}Object.defineProperty(exports,"__esModule",{value:!0}),exports.ViewImage=exports.ViewServer=exports.Edit=exports.PureViewServer=void 0;var _slicedToArray=function(){function e(e,t){var r=[],n=!0,o=!1,i=void 0;try{for(var a,s=e[Symbol.iterator]();!(n=(a=s.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){o=!0,i=e}finally{try{!n&&s.return&&s.return()}finally{if(o)throw i}}return r}return function(t,r){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,r);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),_createClass=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),_react=require("react"),_react2=_interopRequireDefault(_react),_propTypes=require("prop-types"),_propTypes2=_interopRequireDefault(_propTypes),_reactRedux=require("react-redux"),_flow=require("../../ducks/ui/flow"),_ContentLoader=require("./ContentLoader"),_ContentLoader2=_interopRequireDefault(_ContentLoader),_utils=require("../../flow/utils"),_CodeEditor=require("./CodeEditor"),_CodeEditor2=_interopRequireDefault(_CodeEditor),isImage=/^image\/(png|jpe?g|gif|vnc.microsoft.icon|x-icon)$/i;ViewImage.matches=function(e){return isImage.test(_utils.MessageUtils.getContentType(e))},ViewImage.propTypes={flow:_propTypes2.default.object.isRequired,message:_propTypes2.default.object.isRequired},Edit.propTypes={content:_propTypes2.default.string.isRequired},exports.Edit=Edit=(0,_ContentLoader2.default)(Edit);var PureViewServer=exports.PureViewServer=function(e){function t(){return _classCallCheck(this,t),_possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return _inherits(t,e),_createClass(t,[{key:"componentWillMount",value:function(){this.setContentView(this.props)}},{key:"componentWillReceiveProps",value:function(e){e.content!=this.props.content&&this.setContentView(e)}},{key:"setContentView",value:function(e){try{this.data=JSON.parse(e.content)}catch(e){this.data={lines:[],description:e.message}}e.setContentViewDescription(e.contentView!=this.data.description?this.data.description:""),e.setContent(this.data.lines)}},{key:"render",value:function(){var e=this.props,t=(e.content,e.contentView,e.message),r=e.maxLines,n=this.props.showFullContent?this.data.lines:this.data.lines.slice(0,r);return _react2.default.createElement("div",null,ViewImage.matches(t)&&_react2.default.createElement(ViewImage,this.props),_react2.default.createElement("pre",null,n.map(function(e,t){return _react2.default.createElement("div",{key:"line"+t},e.map(function(e,t){var r=_slicedToArray(e,2),n=r[0],o=r[1];return _react2.default.createElement("span",{key:"tuple"+t,className:n},o)}))})))}}]),t}(_react.Component);PureViewServer.propTypes={showFullContent:_propTypes2.default.bool.isRequired,maxLines:_propTypes2.default.number.isRequired,setContentViewDescription:_propTypes2.default.func.isRequired,setContent:_propTypes2.default.func.isRequired};var ViewServer=(0,_reactRedux.connect)(function(e){return{showFullContent:e.ui.flow.showFullContent,maxLines:e.ui.flow.maxContentLines}},{setContentViewDescription:_flow.setContentViewDescription,setContent:_flow.setContent})((0,_ContentLoader2.default)(PureViewServer));exports.Edit=Edit,exports.ViewServer=ViewServer,exports.ViewImage=ViewImage;
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports.isValidHttpVersion = exports.parseUrl = exports.ResponseUtils = exports.RequestUtils = exports.MessageUtils = undefined;
+},{"../../ducks/ui/flow":61,"../../flow/utils":69,"./CodeEditor":5,"./ContentLoader":6,"prop-types":"prop-types","react":"react","react-redux":"react-redux"}],9:[function(require,module,exports){
+"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function DownloadContentButton(e){var t=e.flow,o=e.message;return _react2.default.createElement("a",{className:"btn btn-default btn-xs",href:_utils.MessageUtils.getContentURL(t,o),title:"Download the content of the flow."},_react2.default.createElement("i",{className:"fa fa-download"}))}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=DownloadContentButton;var _react=require("react"),_react2=_interopRequireDefault(_react),_utils=require("../../flow/utils"),_propTypes=require("prop-types"),_propTypes2=_interopRequireDefault(_propTypes);DownloadContentButton.propTypes={flow:_propTypes2.default.object.isRequired,message:_propTypes2.default.object.isRequired};
-var _lodash = require("lodash");
+},{"../../flow/utils":69,"prop-types":"prop-types","react":"react"}],10:[function(require,module,exports){
+"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function ContentEmpty(e){var t=e.flow,n=e.message;return _react2.default.createElement("div",{className:"alert alert-info"},"No ",t.request===n?"request":"response"," content.")}function ContentMissing(e){var t=e.flow,n=e.message;return _react2.default.createElement("div",{className:"alert alert-info"},t.request===n?"Request":"Response"," content missing.")}function ContentTooLarge(e){var t=e.message,n=e.onClick,o=e.uploadContent,a=e.flow;return _react2.default.createElement("div",null,_react2.default.createElement("div",{className:"alert alert-warning"},_react2.default.createElement("button",{onClick:n,className:"btn btn-xs btn-warning pull-right"},"Display anyway"),(0,_utils.formatSize)(t.contentLength)," content size."),_react2.default.createElement("div",{className:"view-options text-center"},_react2.default.createElement(_UploadContentButton2.default,{uploadContent:o})," ",_react2.default.createElement(_DownloadContentButton2.default,{flow:a,message:t})))}Object.defineProperty(exports,"__esModule",{value:!0}),exports.ContentEmpty=ContentEmpty,exports.ContentMissing=ContentMissing,exports.ContentTooLarge=ContentTooLarge;var _react=require("react"),_react2=_interopRequireDefault(_react),_utils=require("../../utils.js"),_UploadContentButton=require("./UploadContentButton"),_UploadContentButton2=_interopRequireDefault(_UploadContentButton),_DownloadContentButton=require("./DownloadContentButton"),_DownloadContentButton2=_interopRequireDefault(_DownloadContentButton);
-var _lodash2 = _interopRequireDefault(_lodash);
+},{"../../utils.js":71,"./DownloadContentButton":9,"./UploadContentButton":12,"react":"react"}],11:[function(require,module,exports){
+"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function ShowFullContentButton(e){var t=e.setShowFullContent,n=e.showFullContent,o=e.visibleLines,u=e.contentLines;return!n&&_react2.default.createElement("div",null,_react2.default.createElement(_Button2.default,{className:"view-all-content-btn btn-xs",onClick:function(){return t()}},"Show full content"),_react2.default.createElement("span",{className:"pull-right"}," ",o,"/",u," are visible   "))}Object.defineProperty(exports,"__esModule",{value:!0}),exports.ShowFullContentButton=ShowFullContentButton;var _react=require("react"),_react2=_interopRequireDefault(_react),_propTypes=require("prop-types"),_propTypes2=_interopRequireDefault(_propTypes),_reactRedux=require("react-redux"),_reactDom=require("react-dom"),_Button=require("../common/Button"),_Button2=_interopRequireDefault(_Button),_flow=require("../../ducks/ui/flow");ShowFullContentButton.propTypes={setShowFullContent:_propTypes2.default.func.isRequired,showFullContent:_propTypes2.default.bool.isRequired},exports.default=(0,_reactRedux.connect)(function(e){return{showFullContent:e.ui.flow.showFullContent,visibleLines:e.ui.flow.maxContentLines,contentLines:e.ui.flow.content.length}},{setShowFullContent:_flow.setShowFullContent})(ShowFullContentButton);
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+},{"../../ducks/ui/flow":61,"../common/Button":46,"prop-types":"prop-types","react":"react","react-dom":"react-dom","react-redux":"react-redux"}],12:[function(require,module,exports){
+"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function UploadContentButton(e){var t=e.uploadContent;return _react2.default.createElement(_FileChooser2.default,{icon:"fa-upload",title:"Upload a file to replace the content.",onOpenFile:t,className:"btn btn-default btn-xs"})}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=UploadContentButton;var _react=require("react"),_react2=_interopRequireDefault(_react),_propTypes=require("prop-types"),_propTypes2=_interopRequireDefault(_propTypes),_FileChooser=require("../common/FileChooser"),_FileChooser2=_interopRequireDefault(_FileChooser);UploadContentButton.propTypes={uploadContent:_propTypes2.default.func.isRequired};
-var defaultPorts = {
- "http": 80,
- "https": 443
-};
+},{"../common/FileChooser":49,"prop-types":"prop-types","react":"react"}],13:[function(require,module,exports){
+"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function ViewSelector(e){var t=e.contentViews,r=e.activeView,n=e.setContentView,o=_react2.default.createElement("span",null," ",_react2.default.createElement("b",null,"View:")," ",r.toLowerCase()," ",_react2.default.createElement("span",{className:"caret"})," ");return _react2.default.createElement(_Dropdown2.default,{dropup:!0,className:"pull-left",btnClass:"btn btn-default btn-xs",text:o},t.map(function(e){return _react2.default.createElement("a",{href:"#",key:e,onClick:function(t){t.preventDefault(),n(e)}},e.toLowerCase().replace("_"," "))}))}Object.defineProperty(exports,"__esModule",{value:!0}),exports.ViewSelector=ViewSelector;var _react=require("react"),_react2=_interopRequireDefault(_react),_propTypes=require("prop-types"),_propTypes2=_interopRequireDefault(_propTypes),_reactRedux=require("react-redux"),_flow=require("../../ducks/ui/flow"),_Dropdown=require("../common/Dropdown"),_Dropdown2=_interopRequireDefault(_Dropdown);ViewSelector.propTypes={contentViews:_propTypes2.default.array.isRequired,activeView:_propTypes2.default.string.isRequired,setContentView:_propTypes2.default.func.isRequired},exports.default=(0,_reactRedux.connect)(function(e){return{contentViews:e.settings.contentViews,activeView:e.ui.flow.contentView}},{setContentView:_flow.setContentView})(ViewSelector);
-var MessageUtils = exports.MessageUtils = {
- getContentType: function getContentType(message) {
- var ct = this.get_first_header(message, /^Content-Type$/i);
- if (ct) {
- return ct.split(";")[0].trim();
- }
- },
- get_first_header: function get_first_header(message, regex) {
- //FIXME: Cache Invalidation.
- if (!message._headerLookups) Object.defineProperty(message, "_headerLookups", {
- value: {},
- configurable: false,
- enumerable: false,
- writable: false
- });
- if (!(regex in message._headerLookups)) {
- var header;
- for (var i = 0; i < message.headers.length; i++) {
- if (!!message.headers[i][0].match(regex)) {
- header = message.headers[i];
- break;
- }
- }
- message._headerLookups[regex] = header ? header[1] : undefined;
- }
- return message._headerLookups[regex];
- },
- match_header: function match_header(message, regex) {
- var headers = message.headers;
- var i = headers.length;
- while (i--) {
- if (regex.test(headers[i].join(" "))) {
- return headers[i];
- }
- }
- return false;
- },
- getContentURL: function getContentURL(flow, message, view) {
- if (message === flow.request) {
- message = "request";
- } else if (message === flow.response) {
- message = "response";
- }
- return "/flows/" + flow.id + "/" + message + "/content" + (view ? "/" + view : '');
- }
-};
+},{"../../ducks/ui/flow":61,"../common/Dropdown":48,"prop-types":"prop-types","react":"react","react-redux":"react-redux"}],14:[function(require,module,exports){
+"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.PureEventLog=void 0;var _createClass=function(){function e(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,r,o){return r&&e(t.prototype,r),o&&e(t,o),t}}(),_react=require("react"),_react2=_interopRequireDefault(_react),_propTypes=require("prop-types"),_propTypes2=_interopRequireDefault(_propTypes),_reactRedux=require("react-redux"),_eventLog=require("../ducks/eventLog"),_ToggleButton=require("./common/ToggleButton"),_ToggleButton2=_interopRequireDefault(_ToggleButton),_EventList=require("./EventLog/EventList"),_EventList2=_interopRequireDefault(_EventList),PureEventLog=exports.PureEventLog=function(e){function t(e,r){_classCallCheck(this,t);var o=_possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,r));return o.state={height:o.props.defaultHeight},o.onDragStart=o.onDragStart.bind(o),o.onDragMove=o.onDragMove.bind(o),o.onDragStop=o.onDragStop.bind(o),o}return _inherits(t,e),_createClass(t,[{key:"onDragStart",value:function(e){e.preventDefault(),this.dragStart=this.state.height+e.pageY,window.addEventListener("mousemove",this.onDragMove),window.addEventListener("mouseup",this.onDragStop),window.addEventListener("dragend",this.onDragStop)}},{key:"onDragMove",value:function(e){e.preventDefault(),this.setState({height:this.dragStart-e.pageY})}},{key:"onDragStop",value:function(e){e.preventDefault(),window.removeEventListener("mousemove",this.onDragMove)}},{key:"render",value:function(){var e=this.state.height,t=this.props,r=t.filters,o=t.events,n=t.toggleFilter,a=t.close;return _react2.default.createElement("div",{className:"eventlog",style:{height:e}},_react2.default.createElement("div",{onMouseDown:this.onDragStart},"Eventlog",_react2.default.createElement("div",{className:"pull-right"},["debug","info","web","warn","error"].map(function(e){return _react2.default.createElement(_ToggleButton2.default,{key:e,text:e,checked:r[e],onToggle:function(){return n(e)}})}),_react2.default.createElement("i",{onClick:a,className:"fa fa-close"}))),_react2.default.createElement(_EventList2.default,{events:o}))}}]),t}(_react.Component);PureEventLog.propTypes={filters:_propTypes2.default.object.isRequired,events:_propTypes2.default.array.isRequired,toggleFilter:_propTypes2.default.func.isRequired,close:_propTypes2.default.func.isRequired,defaultHeight:_propTypes2.default.number},PureEventLog.defaultProps={defaultHeight:200},exports.default=(0,_reactRedux.connect)(function(e){return{filters:e.eventLog.filters,events:e.eventLog.view}},{close:_eventLog.toggleVisibility,toggleFilter:_eventLog.toggleFilter})(PureEventLog);
-var RequestUtils = exports.RequestUtils = _lodash2.default.extend(MessageUtils, {
- pretty_url: function pretty_url(request) {
- var port = "";
- if (defaultPorts[request.scheme] !== request.port) {
- port = ":" + request.port;
- }
- return request.scheme + "://" + request.pretty_host + port + request.path;
- }
-});
+},{"../ducks/eventLog":56,"./EventLog/EventList":15,"./common/ToggleButton":52,"prop-types":"prop-types","react":"react","react-redux":"react-redux"}],15:[function(require,module,exports){
+"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function LogIcon(e){var t=e.event,r={web:"html5",debug:"bug",warn:"exclamation-triangle",error:"ban"}[t.level]||"info";return _react2.default.createElement("i",{className:"fa fa-fw fa-"+r})}Object.defineProperty(exports,"__esModule",{value:!0});var _createClass=function(){function e(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,r,o){return r&&e(t.prototype,r),o&&e(t,o),t}}(),_react=require("react"),_react2=_interopRequireDefault(_react),_propTypes=require("prop-types"),_propTypes2=_interopRequireDefault(_propTypes),_reactDom=require("react-dom"),_reactDom2=_interopRequireDefault(_reactDom),_shallowequal=require("shallowequal"),_shallowequal2=_interopRequireDefault(_shallowequal),_AutoScroll=require("../helpers/AutoScroll"),_AutoScroll2=_interopRequireDefault(_AutoScroll),_VirtualScroll=require("../helpers/VirtualScroll"),EventLogList=function(e){function t(e){_classCallCheck(this,t);var r=_possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return r.heights={},r.state={vScroll:(0,_VirtualScroll.calcVScroll)()},r.onViewportUpdate=r.onViewportUpdate.bind(r),r}return _inherits(t,e),_createClass(t,[{key:"componentDidMount",value:function(){window.addEventListener("resize",this.onViewportUpdate),this.onViewportUpdate()}},{key:"componentWillUnmount",value:function(){window.removeEventListener("resize",this.onViewportUpdate)}},{key:"componentDidUpdate",value:function(){this.onViewportUpdate()}},{key:"onViewportUpdate",value:function(){var e=this,t=_reactDom2.default.findDOMNode(this),r=(0,_VirtualScroll.calcVScroll)({itemCount:this.props.events.length,rowHeight:this.props.rowHeight,viewportTop:t.scrollTop,viewportHeight:t.offsetHeight,itemHeights:this.props.events.map(function(t){return e.heights[t.id]})});(0,_shallowequal2.default)(this.state.vScroll,r)||this.setState({vScroll:r})}},{key:"setHeight",value:function(e,t){if(t&&!this.heights[e]){var r=t.offsetHeight;this.heights[e]!==r&&(this.heights[e]=r,this.onViewportUpdate())}}},{key:"render",value:function(){var e=this,t=this.state.vScroll,r=this.props.events;return _react2.default.createElement("pre",{onScroll:this.onViewportUpdate},_react2.default.createElement("div",{style:{height:t.paddingTop}}),r.slice(t.start,t.end).map(function(t){return _react2.default.createElement("div",{key:t.id,ref:function(r){return e.setHeight(t.id,r)}},_react2.default.createElement(LogIcon,{event:t}),t.message)}),_react2.default.createElement("div",{style:{height:t.paddingBottom}}))}}]),t}(_react.Component);EventLogList.propTypes={events:_propTypes2.default.array.isRequired,rowHeight:_propTypes2.default.number},EventLogList.defaultProps={rowHeight:18},exports.default=(0,_AutoScroll2.default)(EventLogList);
-var ResponseUtils = exports.ResponseUtils = _lodash2.default.extend(MessageUtils, {});
+},{"../helpers/AutoScroll":53,"../helpers/VirtualScroll":54,"prop-types":"prop-types","react":"react","react-dom":"react-dom","shallowequal":"shallowequal"}],16:[function(require,module,exports){
+"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(exports,"__esModule",{value:!0});var _createClass=function(){function e(e,t){for(var o=0;o<t.length;o++){var r=t[o];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,o,r){return o&&e(t.prototype,o),r&&e(t,r),t}}(),_react=require("react"),_react2=_interopRequireDefault(_react),_propTypes=require("prop-types"),_propTypes2=_interopRequireDefault(_propTypes),_reactDom=require("react-dom"),_reactDom2=_interopRequireDefault(_reactDom),_shallowequal=require("shallowequal"),_shallowequal2=_interopRequireDefault(_shallowequal),_AutoScroll=require("./helpers/AutoScroll"),_AutoScroll2=_interopRequireDefault(_AutoScroll),_VirtualScroll=require("./helpers/VirtualScroll"),_FlowTableHead=require("./FlowTable/FlowTableHead"),_FlowTableHead2=_interopRequireDefault(_FlowTableHead),_FlowRow=require("./FlowTable/FlowRow"),_FlowRow2=_interopRequireDefault(_FlowRow),_filt=require("../filt/filt"),_filt2=_interopRequireDefault(_filt),FlowTable=function(e){function t(e,o){_classCallCheck(this,t);var r=_possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,o));return r.state={vScroll:(0,_VirtualScroll.calcVScroll)()},r.onViewportUpdate=r.onViewportUpdate.bind(r),r}return _inherits(t,e),_createClass(t,[{key:"componentWillMount",value:function(){window.addEventListener("resize",this.onViewportUpdate)}},{key:"componentWillUnmount",value:function(){window.removeEventListener("resize",this.onViewportUpdate)}},{key:"componentDidUpdate",value:function(){if(this.onViewportUpdate(),this.shouldScrollIntoView){this.shouldScrollIntoView=!1;var e=this.props,t=e.rowHeight,o=e.flows,r=e.selected,l=_reactDom2.default.findDOMNode(this),a=_reactDom2.default.findDOMNode(this.refs.head),i=a?a.offsetHeight:0,n=o.indexOf(r)*t+i,u=n+t,s=l.scrollTop,c=l.offsetHeight;n-i<s?l.scrollTop=n-i:u>s+c&&(l.scrollTop=u-c)}}},{key:"componentWillReceiveProps",value:function(e){e.selected&&e.selected!==this.props.selected&&(this.shouldScrollIntoView=!0)}},{key:"onViewportUpdate",value:function(){var e=_reactDom2.default.findDOMNode(this),t=e.scrollTop,o=(0,_VirtualScroll.calcVScroll)({viewportTop:t,viewportHeight:e.offsetHeight,itemCount:this.props.flows.length,rowHeight:this.props.rowHeight});this.state.viewportTop===t&&(0,_shallowequal2.default)(this.state.vScroll,o)||this.setState({vScroll:o,viewportTop:t})}},{key:"render",value:function(){var e=this,t=this.state,o=t.vScroll,r=t.viewportTop,l=this.props,a=l.flows,i=l.selected,n=l.highlight,u=n?_filt2.default.parse(n):function(){return!1};return _react2.default.createElement("div",{className:"flow-table",onScroll:this.onViewportUpdate},_react2.default.createElement("table",null,_react2.default.createElement("thead",{ref:"head",style:{transform:"translateY("+r+"px)"}},_react2.default.createElement(_FlowTableHead2.default,null)),_react2.default.createElement("tbody",null,_react2.default.createElement("tr",{style:{height:o.paddingTop}}),a.slice(o.start,o.end).map(function(t){return _react2.default.createElement(_FlowRow2.default,{key:t.id,flow:t,selected:t===i,highlighted:u(t),onSelect:e.props.onSelect})}),_react2.default.createElement("tr",{style:{height:o.paddingBottom}}))))}}]),t}(_react2.default.Component);FlowTable.propTypes={onSelect:_propTypes2.default.func.isRequired,flows:_propTypes2.default.array.isRequired,rowHeight:_propTypes2.default.number,highlight:_propTypes2.default.string,selected:_propTypes2.default.object},FlowTable.defaultProps={rowHeight:32},exports.default=(0,_AutoScroll2.default)(FlowTable);
-var parseUrl_regex = /^(?:(https?):\/\/)?([^\/:]+)?(?::(\d+))?(\/.*)?$/i;
-var parseUrl = exports.parseUrl = function parseUrl(url) {
- //there are many correct ways to parse a URL,
- //however, a mitmproxy user may also wish to generate a not-so-correct URL. ;-)
- var parts = parseUrl_regex.exec(url);
- if (!parts) {
- return false;
- }
+},{"../filt/filt":68,"./FlowTable/FlowRow":18,"./FlowTable/FlowTableHead":19,"./helpers/AutoScroll":53,"./helpers/VirtualScroll":54,"prop-types":"prop-types","react":"react","react-dom":"react-dom","shallowequal":"shallowequal"}],17:[function(require,module,exports){
+"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function TLSColumn(e){var t=e.flow;return _react2.default.createElement("td",{className:(0,_classnames2.default)("col-tls","https"===t.request.scheme?"col-tls-https":"col-tls-http")})}function IconColumn(e){var t=e.flow;return _react2.default.createElement("td",{className:"col-icon"},_react2.default.createElement("div",{className:(0,_classnames2.default)("resource-icon",IconColumn.getIcon(t))}))}function PathColumn(e){var t=e.flow,a=void 0;return t.error&&(a="Connection killed"===t.error.msg?_react2.default.createElement("i",{className:"fa fa-fw fa-times pull-right"}):_react2.default.createElement("i",{className:"fa fa-fw fa-exclamation pull-right"})),_react2.default.createElement("td",{className:"col-path"},t.request.is_replay&&_react2.default.createElement("i",{className:"fa fa-fw fa-repeat pull-right"}),t.intercepted&&_react2.default.createElement("i",{className:"fa fa-fw fa-pause pull-right"}),a,_utils.RequestUtils.pretty_url(t.request))}function MethodColumn(e){var t=e.flow;return _react2.default.createElement("td",{className:"col-method"},t.request.method)}function StatusColumn(e){var t=e.flow;return _react2.default.createElement("td",{className:"col-status"},t.response&&t.response.status_code)}function SizeColumn(e){var t=e.flow;return _react2.default.createElement("td",{className:"col-size"},(0,_utils2.formatSize)(SizeColumn.getTotalSize(t)))}function TimeColumn(e){var t=e.flow;return _react2.default.createElement("td",{className:"col-time"},t.response?(0,_utils2.formatTimeDelta)(1e3*(t.response.timestamp_end-t.server_conn.timestamp_start)):"...")}Object.defineProperty(exports,"__esModule",{value:!0}),exports.TLSColumn=TLSColumn,exports.IconColumn=IconColumn,exports.PathColumn=PathColumn,exports.MethodColumn=MethodColumn,exports.StatusColumn=StatusColumn,exports.SizeColumn=SizeColumn,exports.TimeColumn=TimeColumn;var _react=require("react"),_react2=_interopRequireDefault(_react),_classnames=require("classnames"),_classnames2=_interopRequireDefault(_classnames),_utils=require("../../flow/utils.js"),_utils2=require("../../utils.js");TLSColumn.headerClass="col-tls",TLSColumn.headerName="",IconColumn.headerClass="col-icon",IconColumn.headerName="",IconColumn.getIcon=function(e){if(!e.response)return"resource-icon-plain";var t=_utils.ResponseUtils.getContentType(e.response)||"";return 304===e.response.status_code?"resource-icon-not-modified":300<=e.response.status_code&&e.response.status_code<400?"resource-icon-redirect":t.indexOf("image")>=0?"resource-icon-image":t.indexOf("javascript")>=0?"resource-icon-js":t.indexOf("css")>=0?"resource-icon-css":t.indexOf("html")>=0?"resource-icon-document":"resource-icon-plain"},PathColumn.headerClass="col-path",PathColumn.headerName="Path",MethodColumn.headerClass="col-method",MethodColumn.headerName="Method",StatusColumn.headerClass="col-status",StatusColumn.headerName="Status",SizeColumn.getTotalSize=function(e){var t=e.request.contentLength;return e.response&&(t+=e.response.contentLength||0),t},SizeColumn.headerClass="col-size",SizeColumn.headerName="Size",TimeColumn.headerClass="col-time",TimeColumn.headerName="Time",exports.default=[TLSColumn,IconColumn,PathColumn,MethodColumn,StatusColumn,SizeColumn,TimeColumn];
- var scheme = parts[1],
- host = parts[2],
- port = parseInt(parts[3]),
- path = parts[4];
- if (scheme) {
- port = port || defaultPorts[scheme];
- }
- var ret = {};
- if (scheme) {
- ret.scheme = scheme;
- }
- if (host) {
- ret.host = host;
- }
- if (port) {
- ret.port = port;
- }
- if (path) {
- ret.path = path;
- }
- return ret;
-};
+},{"../../flow/utils.js":69,"../../utils.js":71,"classnames":"classnames","react":"react"}],18:[function(require,module,exports){
+"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function FlowRow(e){var t=e.flow,r=e.selected,l=e.highlighted,s=e.onSelect,o=(0,_classnames2.default)({selected:r,highlighted:l,intercepted:t.intercepted,"has-request":t.request,"has-response":t.response});return _react2.default.createElement("tr",{className:o,onClick:function(){return s(t.id)}},_FlowColumns2.default.map(function(e){return _react2.default.createElement(e,{key:e.name,flow:t})}))}Object.defineProperty(exports,"__esModule",{value:!0});var _react=require("react"),_react2=_interopRequireDefault(_react),_propTypes=require("prop-types"),_propTypes2=_interopRequireDefault(_propTypes),_classnames=require("classnames"),_classnames2=_interopRequireDefault(_classnames),_FlowColumns=require("./FlowColumns"),_FlowColumns2=_interopRequireDefault(_FlowColumns),_utils=require("../../utils");FlowRow.propTypes={onSelect:_propTypes2.default.func.isRequired,flow:_propTypes2.default.object.isRequired,highlighted:_propTypes2.default.bool,selected:_propTypes2.default.bool},exports.default=(0,_utils.pure)(FlowRow);
-var isValidHttpVersion_regex = /^HTTP\/\d+(\.\d+)*$/i;
-var isValidHttpVersion = exports.isValidHttpVersion = function isValidHttpVersion(httpVersion) {
- return isValidHttpVersion_regex.test(httpVersion);
-};
+},{"../../utils":71,"./FlowColumns":17,"classnames":"classnames","prop-types":"prop-types","react":"react"}],19:[function(require,module,exports){
+"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function FlowTableHead(e){var r=e.sortColumn,t=e.sortDesc,s=e.setSort,o=t?"sort-desc":"sort-asc";return _react2.default.createElement("tr",null,_FlowColumns2.default.map(function(e){return _react2.default.createElement("th",{className:(0,_classnames2.default)(e.headerClass,r===e.name&&o),key:e.name,onClick:function(){return s(e.name,e.name===r&&!t)}},e.headerName)}))}Object.defineProperty(exports,"__esModule",{value:!0}),exports.FlowTableHead=FlowTableHead;var _react=require("react"),_react2=_interopRequireDefault(_react),_propTypes=require("prop-types"),_propTypes2=_interopRequireDefault(_propTypes),_reactRedux=require("react-redux"),_classnames=require("classnames"),_classnames2=_interopRequireDefault(_classnames),_FlowColumns=require("./FlowColumns"),_FlowColumns2=_interopRequireDefault(_FlowColumns),_flows=require("../../ducks/flows");FlowTableHead.propTypes={setSort:_propTypes2.default.func.isRequired,sortDesc:_propTypes2.default.bool.isRequired,sortColumn:_propTypes2.default.string},exports.default=(0,_reactRedux.connect)(function(e){return{sortDesc:e.flows.sort.desc,sortColumn:e.flows.sort.column}},{setSort:_flows.setSort})(FlowTableHead);
-},{"lodash":"lodash"}],61:[function(require,module,exports){
-"use strict";
+},{"../../ducks/flows":57,"./FlowColumns":17,"classnames":"classnames","prop-types":"prop-types","react":"react","react-redux":"react-redux"}],20:[function(require,module,exports){
+"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(exports,"__esModule",{value:!0});var _createClass=function(){function e(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,r,o){return r&&e(t.prototype,r),o&&e(t,o),t}}(),_react=require("react"),_react2=_interopRequireDefault(_react),_reactRedux=require("react-redux"),_lodash=require("lodash"),_lodash2=_interopRequireDefault(_lodash),_Nav=require("./FlowView/Nav"),_Nav2=_interopRequireDefault(_Nav),_Messages=require("./FlowView/Messages"),_Details=require("./FlowView/Details"),_Details2=_interopRequireDefault(_Details),_Prompt=require("./Prompt"),_Prompt2=_interopRequireDefault(_Prompt),_flow=require("../ducks/ui/flow"),FlowView=function(e){function t(e,r){_classCallCheck(this,t);var o=_possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,r));return o.onPromptFinish=o.onPromptFinish.bind(o),o}return _inherits(t,e),_createClass(t,[{key:"onPromptFinish",value:function(e){this.props.setPrompt(!1),e&&this.tabComponent&&this.tabComponent.edit(e)}},{key:"getPromptOptions",value:function(){switch(this.props.tab){case"request":return["method","url",{text:"http version",key:"v"},"header"];case"response":return[{text:"http version",key:"v"},"code","message","header"];case"details":return;default:throw"Unknown tab for edit: "+this.props.tab}}},{key:"render",value:function(){var e=this,r=this.props,o=r.flow,n=r.tab,a=r.updateFlow,s=["request","response","error"].filter(function(e){return o[e]}).concat(["details"]);s.indexOf(n)<0&&(n="response"===n&&o.error?"error":"error"===n&&o.response?"response":s[0]);var i=t.allTabs[_lodash2.default.capitalize(n)];return _react2.default.createElement("div",{className:"flow-detail"},_react2.default.createElement(_Nav2.default,{flow:o,tabs:s,active:n,onSelectTab:this.props.selectTab}),_react2.default.createElement(i,{ref:function(t){return e.tabComponent=t},flow:o,updateFlow:a}),this.props.promptOpen&&_react2.default.createElement(_Prompt2.default,{options:this.getPromptOptions(),done:this.onPromptFinish}))}}]),t}(_react.Component);FlowView.allTabs={Request:_Messages.Request,Response:_Messages.Response,Error:_Messages.ErrorView,Details:_Details2.default},exports.default=(0,_reactRedux.connect)(function(e){return{promptOpen:e.ui.promptOpen,tab:e.ui.flow.tab}},{selectTab:_flow.selectTab})(FlowView);
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
+},{"../ducks/ui/flow":61,"./FlowView/Details":21,"./FlowView/Messages":23,"./FlowView/Nav":24,"./Prompt":42,"lodash":"lodash","react":"react","react-redux":"react-redux"}],21:[function(require,module,exports){
+"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function TimeStamp(e){var t=e.t,a=e.deltaTo,n=e.title;return t?_react2.default.createElement("tr",null,_react2.default.createElement("td",null,n,":"),_react2.default.createElement("td",null,(0,_utils.formatTimeStamp)(t),a&&_react2.default.createElement("span",{className:"text-muted"},"(",(0,_utils.formatTimeDelta)(1e3*(t-a)),")"))):_react2.default.createElement("tr",null)}function ConnectionInfo(e){var t=e.conn;return _react2.default.createElement("table",{className:"connection-table"},_react2.default.createElement("tbody",null,_react2.default.createElement("tr",{key:"address"},_react2.default.createElement("td",null,"Address:"),_react2.default.createElement("td",null,t.address.join(":"))),t.sni&&_react2.default.createElement("tr",{key:"sni"},_react2.default.createElement("td",null,_react2.default.createElement("abbr",{title:"TLS Server Name Indication"},"TLS SNI:")),_react2.default.createElement("td",null,t.sni))))}function CertificateInfo(e){var t=e.flow;return _react2.default.createElement("div",null,t.client_conn.cert&&[_react2.default.createElement("h4",{key:"name"},"Client Certificate"),_react2.default.createElement("pre",{key:"value",style:{maxHeight:100}},t.client_conn.cert)],t.server_conn.cert&&[_react2.default.createElement("h4",{key:"name"},"Server Certificate"),_react2.default.createElement("pre",{key:"value",style:{maxHeight:100}},t.server_conn.cert)])}function Timing(e){var t=e.flow,a=t.server_conn,n=t.client_conn,r=t.request,l=t.response,c=[{title:"Server conn. initiated",t:a.timestamp_start,deltaTo:r.timestamp_start},{title:"Server conn. TCP handshake",t:a.timestamp_tcp_setup,deltaTo:r.timestamp_start},{title:"Server conn. SSL handshake",t:a.timestamp_ssl_setup,deltaTo:r.timestamp_start},{title:"Client conn. established",t:n.timestamp_start,deltaTo:r.timestamp_start},{title:"Client conn. SSL handshake",t:n.timestamp_ssl_setup,deltaTo:r.timestamp_start},{title:"First request byte",t:r.timestamp_start},{title:"Request complete",t:r.timestamp_end,deltaTo:r.timestamp_start},l&&{title:"First response byte",t:l.timestamp_start,deltaTo:r.timestamp_start},l&&{title:"Response complete",t:l.timestamp_end,deltaTo:r.timestamp_start}];return _react2.default.createElement("div",null,_react2.default.createElement("h4",null,"Timing"),_react2.default.createElement("table",{className:"timing-table"},_react2.default.createElement("tbody",null,c.filter(function(e){return e}).sort(function(e,t){return e.t-t.t}).map(function(e){return _react2.default.createElement(TimeStamp,_extends({key:e.title},e))}))))}function Details(e){var t=e.flow;return _react2.default.createElement("section",{className:"detail"},_react2.default.createElement("h4",null,"Client Connection"),_react2.default.createElement(ConnectionInfo,{conn:t.client_conn}),_react2.default.createElement("h4",null,"Server Connection"),_react2.default.createElement(ConnectionInfo,{conn:t.server_conn}),_react2.default.createElement(CertificateInfo,{flow:t}),_react2.default.createElement(Timing,{flow:t}))}Object.defineProperty(exports,"__esModule",{value:!0});var _extends=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e};exports.TimeStamp=TimeStamp,exports.ConnectionInfo=ConnectionInfo,exports.CertificateInfo=CertificateInfo,exports.Timing=Timing,exports.default=Details;var _react=require("react"),_react2=_interopRequireDefault(_react),_lodash=require("lodash"),_lodash2=_interopRequireDefault(_lodash),_utils=require("../../utils.js");
-var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); /**
- * Instead of dealing with react-router's ever-changing APIs,
- * we use a simple url state manager where we only
- *
- * - read the initial URL state on page load
- * - push updates to the URL later on.
- */
+},{"../../utils.js":71,"lodash":"lodash","react":"react"}],22:[function(require,module,exports){
+"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _objectWithoutProperties(e,t){var r={};for(var n in e)t.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.HeaderEditor=void 0;var _extends=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},_createClass=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),_react=require("react"),_react2=_interopRequireDefault(_react),_propTypes=require("prop-types"),_propTypes2=_interopRequireDefault(_propTypes),_reactDom=require("react-dom"),_reactDom2=_interopRequireDefault(_reactDom),_ValueEditor=require("../ValueEditor/ValueEditor"),_ValueEditor2=_interopRequireDefault(_ValueEditor),_utils=require("../../utils"),HeaderEditor=exports.HeaderEditor=function(e){function t(e){_classCallCheck(this,t);var r=_possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return r.onKeyDown=r.onKeyDown.bind(r),r}return _inherits(t,e),_createClass(t,[{key:"render",value:function(){var e=this.props,t=(e.onTab,_objectWithoutProperties(e,["onTab"]));return _react2.default.createElement(_ValueEditor2.default,_extends({},t,{onKeyDown:this.onKeyDown}))}},{key:"focus",value:function(){_reactDom2.default.findDOMNode(this).focus()}},{key:"onKeyDown",value:function(e){switch(e.keyCode){case _utils.Key.BACKSPACE:var t=window.getSelection().getRangeAt(0);0===t.startOffset&&0===t.endOffset&&this.props.onRemove(e);break;case _utils.Key.ENTER:case _utils.Key.TAB:e.shiftKey||this.props.onTab(e)}}}]),t}(_react.Component),Headers=function(e){function t(){return _classCallCheck(this,t),_possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return _inherits(t,e),_createClass(t,[{key:"onChange",value:function(e,t,r){var n=_.cloneDeep(this.props.message.headers);n[e][t]=r,n[e][0]||n[e][1]||(1===n.length?(n[0][0]="Name",n[0][1]="Value"):(n.splice(e,1),e===n.length&&(this._nextSel=e-1+"-value"))),this.props.onChange(n)}},{key:"edit",value:function(){this.refs["0-key"].focus()}},{key:"onTab",value:function(e,t,r){var n=this.props.message.headers;if(0===t)return void(this._nextSel=e+"-value");if(e!==n.length-1)return void(this._nextSel=e+1+"-key");r.preventDefault();var o=_.cloneDeep(this.props.message.headers);o.push(["Name","Value"]),this.props.onChange(o),this._nextSel=e+1+"-key"}},{key:"componentDidUpdate",value:function(){this._nextSel&&this.refs[this._nextSel]&&(this.refs[this._nextSel].focus(),this._nextSel=void 0)}},{key:"onRemove",value:function(e,t,r){1===t?(r.preventDefault(),this.refs[e+"-key"].focus()):e>0&&(r.preventDefault(),this.refs[e-1+"-value"].focus())}},{key:"render",value:function(){var e=this,t=this.props,r=t.message,n=t.readonly;return _react2.default.createElement("table",{className:"header-table"},_react2.default.createElement("tbody",null,r.headers.map(function(t,r){return _react2.default.createElement("tr",{key:r},_react2.default.createElement("td",{className:"header-name"},_react2.default.createElement(HeaderEditor,{ref:r+"-key",content:t[0],readonly:n,onDone:function(t){return e.onChange(r,0,t)},onRemove:function(t){return e.onRemove(r,0,t)},onTab:function(t){return e.onTab(r,0,t)}}),_react2.default.createElement("span",{className:"header-colon"},":")),_react2.default.createElement("td",{className:"header-value"},_react2.default.createElement(HeaderEditor,{ref:r+"-value",content:t[1],readonly:n,onDone:function(t){return e.onChange(r,1,t)},onRemove:function(t){return e.onRemove(r,1,t)},onTab:function(t){return e.onTab(r,1,t)}})))})))}}]),t}(_react.Component);Headers.propTypes={onChange:_propTypes2.default.func.isRequired,message:_propTypes2.default.object.isRequired},exports.default=Headers;
+},{"../../utils":71,"../ValueEditor/ValueEditor":45,"prop-types":"prop-types","react":"react","react-dom":"react-dom"}],23:[function(require,module,exports){
+"use strict";function _interopRequireWildcard(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function RequestLine(e){var t=e.flow,r=e.readonly,n=e.updateFlow;return _react2.default.createElement("div",{className:"first-line request-line"},_react2.default.createElement("div",null,_react2.default.createElement(_ValueEditor2.default,{content:t.request.method,readonly:r,onDone:function(e){return n({request:{method:e}})}})," ",_react2.default.createElement(_ValidateEditor2.default,{content:_utils.RequestUtils.pretty_url(t.request),readonly:r,onDone:function(e){return n({request:_extends({path:""},(0,_utils.parseUrl)(e))})},isValid:function(e){return!!(0,_utils.parseUrl)(e).host}})," ",_react2.default.createElement(_ValidateEditor2.default,{content:t.request.http_version,readonly:r,onDone:function(e){return n({request:{http_version:e}})},isValid:_utils.isValidHttpVersion})))}function ResponseLine(e){var t=e.flow,r=e.readonly,n=e.updateFlow;return _react2.default.createElement("div",{className:"first-line response-line"},_react2.default.createElement(_ValidateEditor2.default,{content:t.response.http_version,readonly:r,onDone:function(e){return n({response:{http_version:e}})},isValid:_utils.isValidHttpVersion})," ",_react2.default.createElement(_ValidateEditor2.default,{content:t.response.status_code+"",readonly:r,onDone:function(e){return n({response:{code:parseInt(e)}})},isValid:function(e){return/^\d+$/.test(e)}})," ",_react2.default.createElement(_ValueEditor2.default,{content:t.response.reason,readonly:r,onDone:function(e){return n({response:{msg:e}})}}))}function ErrorView(e){var t=e.flow;return _react2.default.createElement("section",{className:"error"},_react2.default.createElement("div",{className:"alert alert-warning"},t.error.msg,_react2.default.createElement("div",null,_react2.default.createElement("small",null,(0,_utils2.formatTimeStamp)(t.error.timestamp)))))}Object.defineProperty(exports,"__esModule",{value:!0}),exports.Response=exports.Request=void 0;var _createClass=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),_extends=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e};exports.ErrorView=ErrorView;var _react=require("react"),_react2=_interopRequireDefault(_react),_propTypes=require("prop-types"),_propTypes2=_interopRequireDefault(_propTypes),_reactRedux=require("react-redux"),_utils=require("../../flow/utils.js"),_utils2=require("../../utils.js"),_ContentView=require("../ContentView"),_ContentView2=_interopRequireDefault(_ContentView),_ContentViewOptions=require("../ContentView/ContentViewOptions"),_ContentViewOptions2=_interopRequireDefault(_ContentViewOptions),_ValidateEditor=require("../ValueEditor/ValidateEditor"),_ValidateEditor2=_interopRequireDefault(_ValidateEditor),_ValueEditor=require("../ValueEditor/ValueEditor"),_ValueEditor2=_interopRequireDefault(_ValueEditor),_HideInStatic=require("../common/HideInStatic"),_HideInStatic2=_interopRequireDefault(_HideInStatic),_Headers=require("./Headers"),_Headers2=_interopRequireDefault(_Headers),_flow=require("../../ducks/ui/flow"),_flows=require("../../ducks/flows"),FlowActions=_interopRequireWildcard(_flows),_ToggleEdit=require("./ToggleEdit"),_ToggleEdit2=_interopRequireDefault(_ToggleEdit),Message=(0,_reactRedux.connect)(function(e){return{flow:e.ui.flow.modifiedFlow||e.flows.byId[e.flows.selected[0]],isEdit:!!e.ui.flow.modifiedFlow}},{updateFlow:_flow.updateEdit,uploadContent:FlowActions.uploadContent}),Request=exports.Request=function(e){function t(){return _classCallCheck(this,t),_possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return _inherits(t,e),_createClass(t,[{key:"render",value:function(){var e=this.props,t=e.flow,r=e.isEdit,n=e.updateFlow,o=e.uploadContent,a=!r&&(0==t.request.contentLength||null==t.request.contentLength);return _react2.default.createElement("section",{className:"request"},_react2.default.createElement("article",null,_react2.default.createElement(_ToggleEdit2.default,null),_react2.default.createElement(RequestLine,{flow:t,readonly:!r,updateFlow:n}),_react2.default.createElement(_Headers2.default,{message:t.request,readonly:!r,onChange:function(e){return n({request:{headers:e}})}}),_react2.default.createElement("hr",null),_react2.default.createElement(_ContentView2.default,{readonly:!r,flow:t,onContentChange:function(e){return n({request:{content:e}})},message:t.request})),_react2.default.createElement(_HideInStatic2.default,null,!a&&_react2.default.createElement("footer",null,_react2.default.createElement(_ContentViewOptions2.default,{flow:t,readonly:!r,message:t.request,uploadContent:function(e){return o(t,e,"request")}}))))}},{key:"edit",value:function(e){throw"unimplemented"}}]),t}(_react.Component);exports.Request=Request=Message(Request);var Response=exports.Response=function(e){function t(){return _classCallCheck(this,t),_possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return _inherits(t,e),_createClass(t,[{key:"render",value:function(){var e=this.props,t=e.flow,r=e.isEdit,n=e.updateFlow,o=e.uploadContent,a=!r&&(0==t.response.contentLength||null==t.response.contentLength);return _react2.default.createElement("section",{className:"response"},_react2.default.createElement("article",null,_react2.default.createElement(_ToggleEdit2.default,null),_react2.default.createElement(ResponseLine,{flow:t,readonly:!r,updateFlow:n}),_react2.default.createElement(_Headers2.default,{message:t.response,readonly:!r,onChange:function(e){return n({response:{headers:e}})}}),_react2.default.createElement("hr",null),_react2.default.createElement(_ContentView2.default,{readonly:!r,flow:t,onContentChange:function(e){return n({response:{content:e}})},message:t.response})),_react2.default.createElement(_HideInStatic2.default,null,!a&&_react2.default.createElement("footer",null,_react2.default.createElement(_ContentViewOptions2.default,{flow:t,message:t.response,uploadContent:function(e){return o(t,e,"response")},readonly:!r}))))}},{key:"edit",value:function(e){throw"unimplemented"}}]),t}(_react.Component);exports.Response=Response=Message(Response),ErrorView.propTypes={flow:_propTypes2.default.object.isRequired};
-exports.default = initialize;
+},{"../../ducks/flows":57,"../../ducks/ui/flow":61,"../../flow/utils.js":69,"../../utils.js":71,"../ContentView":4,"../ContentView/ContentViewOptions":7,"../ValueEditor/ValidateEditor":44,"../ValueEditor/ValueEditor":45,"../common/HideInStatic":50,"./Headers":22,"./ToggleEdit":25,"prop-types":"prop-types","react":"react","react-redux":"react-redux"}],24:[function(require,module,exports){
+"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function NavAction(e){var a=e.icon,t=e.title,r=e.onClick;return _react2.default.createElement("a",{title:t,href:"#",className:"nav-action",onClick:function(e){e.preventDefault(),r(e)}},_react2.default.createElement("i",{className:"fa fa-fw "+a}))}function Nav(e){var a=e.active,t=e.tabs,r=e.onSelectTab;return _react2.default.createElement("nav",{className:"nav-tabs nav-tabs-sm"},t.map(function(e){return _react2.default.createElement("a",{key:e,href:"#",className:(0,_classnames2.default)({active:a===e}),onClick:function(a){a.preventDefault(),r(e)}},_lodash2.default.capitalize(e))}))}Object.defineProperty(exports,"__esModule",{value:!0}),exports.NavAction=void 0,exports.default=Nav;var _react=require("react"),_react2=_interopRequireDefault(_react),_propTypes=require("prop-types"),_propTypes2=_interopRequireDefault(_propTypes),_reactRedux=require("react-redux"),_classnames=require("classnames"),_classnames2=_interopRequireDefault(_classnames),_lodash=require("lodash"),_lodash2=_interopRequireDefault(_lodash);NavAction.propTypes={icon:_propTypes2.default.string.isRequired,title:_propTypes2.default.string.isRequired,onClick:_propTypes2.default.func.isRequired},exports.NavAction=NavAction,Nav.propTypes={active:_propTypes2.default.string.isRequired,tabs:_propTypes2.default.array.isRequired,onSelectTab:_propTypes2.default.func.isRequired};
-var _flows = require("./ducks/flows");
+},{"classnames":"classnames","lodash":"lodash","prop-types":"prop-types","react":"react","react-redux":"react-redux"}],25:[function(require,module,exports){
+"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function ToggleEdit(e){var t=e.isEdit,i=e.startEdit,r=e.stopEdit,o=e.flow,l=e.modifiedFlow;return _react2.default.createElement("div",{className:"edit-flow-container"},t?_react2.default.createElement("a",{className:"edit-flow",title:"Finish Edit",onClick:function(){return r(o,l)}},_react2.default.createElement("i",{className:"fa fa-check"})):_react2.default.createElement("a",{className:"edit-flow",title:"Edit Flow",onClick:function(){return i(o)}},_react2.default.createElement("i",{className:"fa fa-pencil"})))}Object.defineProperty(exports,"__esModule",{value:!0});var _react=require("react"),_react2=_interopRequireDefault(_react),_propTypes=require("prop-types"),_propTypes2=_interopRequireDefault(_propTypes),_reactRedux=require("react-redux"),_flow=require("../../ducks/ui/flow");ToggleEdit.propTypes={isEdit:_propTypes2.default.bool.isRequired,flow:_propTypes2.default.object.isRequired,startEdit:_propTypes2.default.func.isRequired,stopEdit:_propTypes2.default.func.isRequired},exports.default=(0,_reactRedux.connect)(function(e){return{isEdit:!!e.ui.flow.modifiedFlow,modifiedFlow:e.ui.flow.modifiedFlow||e.flows.byId[e.flows.selected[0]],flow:e.flows.byId[e.flows.selected[0]]}},{startEdit:_flow.startEdit,stopEdit:_flow.stopEdit})(ToggleEdit);
-var _flow = require("./ducks/ui/flow");
+},{"../../ducks/ui/flow":61,"prop-types":"prop-types","react":"react","react-redux":"react-redux"}],26:[function(require,module,exports){
+"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function Footer(e){var t=e.settings,a=t.mode,l=t.intercept,s=t.showhost,c=t.no_upstream_cert,r=t.rawtcp,n=t.http2,u=t.websocket,i=t.anticache,o=t.anticomp,p=t.stickyauth,m=t.stickycookie,_=t.stream_large_bodies,d=t.listen_host,b=t.listen_port,f=t.version,E=t.server;return _react2.default.createElement("footer",null,a&&"regular"!=a&&_react2.default.createElement("span",{className:"label label-success"},a," mode"),l&&_react2.default.createElement("span",{className:"label label-success"},"Intercept: ",l),s&&_react2.default.createElement("span",{className:"label label-success"},"showhost"),c&&_react2.default.createElement("span",{className:"label label-success"},"no-upstream-cert"),r&&_react2.default.createElement("span",{className:"label label-success"},"raw-tcp"),!n&&_react2.default.createElement("span",{className:"label label-success"},"no-http2"),!u&&_react2.default.createElement("span",{className:"label label-success"},"no-websocket"),i&&_react2.default.createElement("span",{className:"label label-success"},"anticache"),o&&_react2.default.createElement("span",{className:"label label-success"},"anticomp"),p&&_react2.default.createElement("span",{className:"label label-success"},"stickyauth: ",p),m&&_react2.default.createElement("span",{className:"label label-success"},"stickycookie: ",m),_&&_react2.default.createElement("span",{className:"label label-success"},"stream: ",(0,_utils.formatSize)(_)),_react2.default.createElement("div",{className:"pull-right"},_react2.default.createElement(_HideInStatic2.default,null,E&&_react2.default.createElement("span",{className:"label label-primary",title:"HTTP Proxy Server Address"},d||"*",":",b)),_react2.default.createElement("span",{className:"label label-info",title:"Mitmproxy Version"},"v",f)))}Object.defineProperty(exports,"__esModule",{value:!0});var _react=require("react"),_react2=_interopRequireDefault(_react),_propTypes=require("prop-types"),_propTypes2=_interopRequireDefault(_propTypes),_reactRedux=require("react-redux"),_utils=require("../utils.js"),_HideInStatic=require("../components/common/HideInStatic"),_HideInStatic2=_interopRequireDefault(_HideInStatic);Footer.propTypes={settings:_propTypes2.default.object.isRequired},exports.default=(0,_reactRedux.connect)(function(e){return{settings:e.settings}})(Footer);
-var _eventLog = require("./ducks/eventLog");
+},{"../components/common/HideInStatic":50,"../utils.js":71,"prop-types":"prop-types","react":"react","react-redux":"react-redux"}],27:[function(require,module,exports){
+"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _toConsumableArray(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(exports,"__esModule",{value:!0});var _createClass=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),_react=require("react"),_react2=_interopRequireDefault(_react),_propTypes=require("prop-types"),_propTypes2=_interopRequireDefault(_propTypes),_reactRedux=require("react-redux"),_classnames=require("classnames"),_classnames2=_interopRequireDefault(_classnames),_MainMenu=require("./Header/MainMenu"),_MainMenu2=_interopRequireDefault(_MainMenu),_OptionMenu=require("./Header/OptionMenu"),_OptionMenu2=_interopRequireDefault(_OptionMenu),_FileMenu=require("./Header/FileMenu"),_FileMenu2=_interopRequireDefault(_FileMenu),_FlowMenu=require("./Header/FlowMenu"),_FlowMenu2=_interopRequireDefault(_FlowMenu),_header=require("../ducks/ui/header"),_ConnectionIndicator=require("./Header/ConnectionIndicator"),_ConnectionIndicator2=_interopRequireDefault(_ConnectionIndicator),_HideInStatic=require("./common/HideInStatic"),_HideInStatic2=_interopRequireDefault(_HideInStatic),Header=function(e){function t(){return _classCallCheck(this,t),_possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return _inherits(t,e),_createClass(t,[{key:"handleClick",value:function(e,t){t.preventDefault(),this.props.setActiveMenu(e.title)}},{key:"render",value:function(){var e=this,n=this.props,r=n.selectedFlowId,a=n.activeMenu,u=[].concat(_toConsumableArray(t.entries));r&&u.push(_FlowMenu2.default);var i=_.find(u,function(e){return e.title==a})||_MainMenu2.default;return _react2.default.createElement("header",null,_react2.default.createElement("nav",{className:"nav-tabs nav-tabs-lg"},_react2.default.createElement(_FileMenu2.default,null),u.map(function(t){return _react2.default.createElement("a",{key:t.title,href:"#",className:(0,_classnames2.default)({active:t===i}),onClick:function(n){return e.handleClick(t,n)}},t.title)}),_react2.default.createElement(_HideInStatic2.default,null,_react2.default.createElement(_ConnectionIndicator2.default,null))),_react2.default.createElement("div",null,_react2.default.createElement(i,null)))}}]),t}(_react.Component);Header.entries=[_MainMenu2.default,_OptionMenu2.default],exports.default=(0,_reactRedux.connect)(function(e){return{selectedFlowId:e.flows.selected[0],activeMenu:e.ui.header.activeMenu}},{setActiveMenu:_header.setActiveMenu})(Header);
-function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
+},{"../ducks/ui/header":62,"./Header/ConnectionIndicator":28,"./Header/FileMenu":29,"./Header/FlowMenu":32,"./Header/MainMenu":33,"./Header/OptionMenu":35,"./common/HideInStatic":50,"classnames":"classnames","prop-types":"prop-types","react":"react","react-redux":"react-redux"}],28:[function(require,module,exports){
+"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function ConnectionIndicator(e){var n=e.state,t=e.message;switch(n){case _connection.ConnectionState.INIT:return _react2.default.createElement("span",{className:"connection-indicator init"},"connecting…");case _connection.ConnectionState.FETCHING:return _react2.default.createElement("span",{className:"connection-indicator fetching"},"fetching data…");case _connection.ConnectionState.ESTABLISHED:return _react2.default.createElement("span",{className:"connection-indicator established"},"connected");case _connection.ConnectionState.ERROR:return _react2.default.createElement("span",{className:"connection-indicator error",title:t},"connection lost");case _connection.ConnectionState.OFFLINE:return _react2.default.createElement("span",{className:"connection-indicator offline"},"offline")}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.ConnectionIndicator=ConnectionIndicator;var _react=require("react"),_react2=_interopRequireDefault(_react),_propTypes=require("prop-types"),_propTypes2=_interopRequireDefault(_propTypes),_reactRedux=require("react-redux"),_connection=require("../../ducks/connection");ConnectionIndicator.propTypes={state:_propTypes2.default.symbol.isRequired,message:_propTypes2.default.string},exports.default=(0,_reactRedux.connect)(function(e){return e.connection})(ConnectionIndicator);
-var Query = {
- SEARCH: "s",
- HIGHLIGHT: "h",
- SHOW_EVENTLOG: "e"
-};
+},{"../../ducks/connection":55,"prop-types":"prop-types","react":"react","react-redux":"react-redux"}],29:[function(require,module,exports){
+"use strict";function _interopRequireWildcard(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function FileMenu(e){var t=e.clearFlows,r=e.loadFlows,a=e.saveFlows,l=e.openModal;return _react2.default.createElement(_Dropdown2.default,{className:"pull-left",btnClass:"special",text:"mitmproxy"},_react2.default.createElement("a",{href:"#",onClick:function(e){return FileMenu.onNewClick(e,t)}},_react2.default.createElement("i",{className:"fa fa-fw fa-file"})," New"),_react2.default.createElement(_FileChooser2.default,{icon:"fa-folder-open",text:" Open...",onOpenFile:function(e){return r(e)}}),_react2.default.createElement("a",{href:"#",onClick:function(e){e.preventDefault(),a()}},_react2.default.createElement("i",{className:"fa fa-fw fa-floppy-o"})," Save..."),_react2.default.createElement(_HideInStatic2.default,null,_react2.default.createElement("a",{href:"#",onClick:function(e){e.preventDefault(),l()}},_react2.default.createElement("i",{className:"fa fa-fw fa-cog"})," Options"),_react2.default.createElement(_Dropdown.Divider,null),_react2.default.createElement("a",{href:"http://mitm.it/",target:"_blank"},_react2.default.createElement("i",{className:"fa fa-fw fa-external-link"})," Install Certificates...")))}Object.defineProperty(exports,"__esModule",{value:!0}),exports.FileMenu=FileMenu;var _react=require("react"),_react2=_interopRequireDefault(_react),_propTypes=require("prop-types"),_propTypes2=_interopRequireDefault(_propTypes),_reactRedux=require("react-redux"),_FileChooser=require("../common/FileChooser"),_FileChooser2=_interopRequireDefault(_FileChooser),_Dropdown=require("../common/Dropdown"),_Dropdown2=_interopRequireDefault(_Dropdown),_flows=require("../../ducks/flows"),flowsActions=_interopRequireWildcard(_flows),_modal=require("../../ducks/ui/modal"),modalActions=_interopRequireWildcard(_modal),_HideInStatic=require("../common/HideInStatic"),_HideInStatic2=_interopRequireDefault(_HideInStatic);FileMenu.propTypes={clearFlows:_propTypes2.default.func.isRequired,loadFlows:_propTypes2.default.func.isRequired,saveFlows:_propTypes2.default.func.isRequired,openModal:_propTypes2.default.func.isRequired},FileMenu.onNewClick=function(e,t){e.preventDefault(),confirm("Delete all flows?")&&t()},exports.default=(0,_reactRedux.connect)(null,{clearFlows:flowsActions.clear,loadFlows:flowsActions.upload,saveFlows:flowsActions.download,openModal:function(){return modalActions.setActiveModal("OptionModal")}})(FileMenu);
-function updateStoreFromUrl(store) {
- var _window$location$hash = window.location.hash.substr(1).split("?", 2),
- _window$location$hash2 = _slicedToArray(_window$location$hash, 2),
- path = _window$location$hash2[0],
- query = _window$location$hash2[1];
+},{"../../ducks/flows":57,"../../ducks/ui/modal":65,"../common/Dropdown":48,"../common/FileChooser":49,"../common/HideInStatic":50,"prop-types":"prop-types","react":"react","react-redux":"react-redux"}],30:[function(require,module,exports){
+"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(exports,"__esModule",{value:!0});var _createClass=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),_react=require("react"),_react2=_interopRequireDefault(_react),_utils=require("../../utils"),FilterDocs=function(e){function t(e,r){_classCallCheck(this,t);var n=_possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,r));return n.state={doc:t.doc},n}return _inherits(t,e),_createClass(t,[{key:"componentWillMount",value:function(){var e=this;t.xhr||(t.xhr=(0,_utils.fetchApi)("/filter-help").then(function(e){return e.json()}),t.xhr.catch(function(){t.xhr=null})),this.state.doc||t.xhr.then(function(r){t.doc=r,e.setState({doc:r})})}},{key:"render",value:function(){var e=this,t=this.state.doc;return t?_react2.default.createElement("table",{className:"table table-condensed"},_react2.default.createElement("tbody",null,t.commands.map(function(t){return _react2.default.createElement("tr",{key:t[1],onClick:function(r){return e.props.selectHandler(t[0].split(" ")[0]+" ")}},_react2.default.createElement("td",null,t[0].replace(" "," ")),_react2.default.createElement("td",null,t[1]))}),_react2.default.createElement("tr",{key:"docs-link"},_react2.default.createElement("td",{colSpan:"2"},_react2.default.createElement("a",{href:"http://docs.mitmproxy.org/en/stable/features/filters.html",target:"_blank"},_react2.default.createElement("i",{className:"fa fa-external-link"}),"  mitmproxy docs"))))):_react2.default.createElement("i",{className:"fa fa-spinner fa-spin"})}}]),t}(_react.Component);FilterDocs.xhr=null,FilterDocs.doc=null,exports.default=FilterDocs;
- var path_components = path.substr(1).split("/");
+},{"../../utils":71,"react":"react"}],31:[function(require,module,exports){
+"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(exports,"__esModule",{value:!0});var _createClass=function(){function e(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,r,o){return r&&e(t.prototype,r),o&&e(t,o),t}}(),_react=require("react"),_react2=_interopRequireDefault(_react),_propTypes=require("prop-types"),_propTypes2=_interopRequireDefault(_propTypes),_reactDom=require("react-dom"),_reactDom2=_interopRequireDefault(_reactDom),_classnames=require("classnames"),_classnames2=_interopRequireDefault(_classnames),_utils=require("../../utils.js"),_filt=require("../../filt/filt"),_filt2=_interopRequireDefault(_filt),_FilterDocs=require("./FilterDocs"),_FilterDocs2=_interopRequireDefault(_FilterDocs),FilterInput=function(e){function t(e,r){_classCallCheck(this,t);var o=_possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,r));return o.state={value:o.props.value,focus:!1,mousefocus:!1},o.onChange=o.onChange.bind(o),o.onFocus=o.onFocus.bind(o),o.onBlur=o.onBlur.bind(o),o.onKeyDown=o.onKeyDown.bind(o),o.onMouseEnter=o.onMouseEnter.bind(o),o.onMouseLeave=o.onMouseLeave.bind(o),o.selectFilter=o.selectFilter.bind(o),o}return _inherits(t,e),_createClass(t,[{key:"componentWillReceiveProps",value:function(e){this.setState({value:e.value})}},{key:"isValid",value:function(e){try{var t=null==e?this.state.value:e;return t&&_filt2.default.parse(t),!0}catch(e){return!1}}},{key:"getDesc",value:function(){if(!this.state.value)return _react2.default.createElement(_FilterDocs2.default,{selectHandler:this.selectFilter});try{return _filt2.default.parse(this.state.value).desc}catch(e){return""+e}}},{key:"onChange",value:function(e){var t=e.target.value;this.setState({value:t}),this.isValid(t)&&this.props.onChange(t)}},{key:"onFocus",value:function(){this.setState({focus:!0})}},{key:"onBlur",value:function(){this.setState({focus:!1})}},{key:"onMouseEnter",value:function(){this.setState({mousefocus:!0})}},{key:"onMouseLeave",value:function(){this.setState({mousefocus:!1})}},{key:"onKeyDown",value:function(e){e.keyCode!==_utils.Key.ESC&&e.keyCode!==_utils.Key.ENTER||(this.blur(),this.setState({mousefocus:!1})),e.stopPropagation()}},{key:"selectFilter",value:function(e){this.setState({value:e}),_reactDom2.default.findDOMNode(this.refs.input).focus()}},{key:"blur",value:function(){_reactDom2.default.findDOMNode(this.refs.input).blur()}},{key:"select",value:function(){_reactDom2.default.findDOMNode(this.refs.input).select()}},{key:"render",value:function(){var e=this.props,t=e.type,r=e.color,o=e.placeholder,n=this.state,a=n.value,s=n.focus,u=n.mousefocus;return _react2.default.createElement("div",{className:(0,_classnames2.default)("filter-input input-group",{"has-error":!this.isValid()})},_react2.default.createElement("span",{className:"input-group-addon"},_react2.default.createElement("i",{className:"fa fa-fw fa-"+t,style:{color:r}})),_react2.default.createElement("input",{type:"text",ref:"input",placeholder:o,className:"form-control",value:a,onChange:this.onChange,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.onKeyDown}),(s||u)&&_react2.default.createElement("div",{className:"popover bottom",onMouseEnter:this.onMouseEnter,onMouseLeave:this.onMouseLeave},_react2.default.createElement("div",{className:"arrow"}),_react2.default.createElement("div",{className:"popover-content"},this.getDesc())))}}]),t}(_react.Component);exports.default=FilterInput;
- if (path_components[0] === "flows") {
- if (path_components.length == 3) {
- var _path_components$slic = path_components.slice(1),
- _path_components$slic2 = _slicedToArray(_path_components$slic, 2),
- flowId = _path_components$slic2[0],
- tab = _path_components$slic2[1];
+},{"../../filt/filt":68,"../../utils.js":71,"./FilterDocs":30,"classnames":"classnames","prop-types":"prop-types","react":"react","react-dom":"react-dom"}],32:[function(require,module,exports){
+"use strict";function _interopRequireWildcard(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var l in e)Object.prototype.hasOwnProperty.call(e,l)&&(t[l]=e[l]);return t.default=e,t}function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function FlowMenu(e){var t=e.flow,l=e.resumeFlow,r=e.killFlow,n=e.replayFlow,a=e.duplicateFlow,o=e.removeFlow,u=e.revertFlow;return t?_react2.default.createElement("div",null,_react2.default.createElement(_HideInStatic2.default,null,_react2.default.createElement("div",{className:"menu-group"},_react2.default.createElement("div",{className:"menu-content"},_react2.default.createElement(_Button2.default,{title:"[r]eplay flow",icon:"fa-repeat text-primary",onClick:function(){return n(t)}},"Replay"),_react2.default.createElement(_Button2.default,{title:"[D]uplicate flow",icon:"fa-copy text-info",onClick:function(){return a(t)}},"Duplicate"),_react2.default.createElement(_Button2.default,{disabled:!t||!t.modified,title:"revert changes to flow [V]",icon:"fa-history text-warning",onClick:function(){return u(t)}},"Revert"),_react2.default.createElement(_Button2.default,{title:"[d]elete flow",icon:"fa-trash text-danger",onClick:function(){return o(t)}},"Delete")),_react2.default.createElement("div",{className:"menu-legend"},"Flow Modification"))),_react2.default.createElement("div",{className:"menu-group"},_react2.default.createElement("div",{className:"menu-content"},_react2.default.createElement(_Button2.default,{title:"download",icon:"fa-download",onClick:function(){return window.location=_utils.MessageUtils.getContentURL(t,t.response)}},"Download")),_react2.default.createElement("div",{className:"menu-legend"},"Export")),_react2.default.createElement(_HideInStatic2.default,null,_react2.default.createElement("div",{className:"menu-group"},_react2.default.createElement("div",{className:"menu-content"},_react2.default.createElement(_Button2.default,{disabled:!t||!t.intercepted,title:"[a]ccept intercepted flow",icon:"fa-play text-success",onClick:function(){return l(t)}},"Resume"),_react2.default.createElement(_Button2.default,{disabled:!t||!t.intercepted,title:"kill intercepted flow [x]",icon:"fa-times text-danger",onClick:function(){return r(t)}},"Abort")),_react2.default.createElement("div",{className:"menu-legend"},"Interception")))):_react2.default.createElement("div",null)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.FlowMenu=FlowMenu;var _react=require("react"),_react2=_interopRequireDefault(_react),_propTypes=require("prop-types"),_propTypes2=_interopRequireDefault(_propTypes),_reactRedux=require("react-redux"),_Button=require("../common/Button"),_Button2=_interopRequireDefault(_Button),_utils=require("../../flow/utils.js"),_flows=require("../../ducks/flows"),flowsActions=_interopRequireWildcard(_flows),_HideInStatic=require("../common/HideInStatic"),_HideInStatic2=_interopRequireDefault(_HideInStatic);FlowMenu.title="Flow",FlowMenu.propTypes={flow:_propTypes2.default.object,resumeFlow:_propTypes2.default.func.isRequired,killFlow:_propTypes2.default.func.isRequired,replayFlow:_propTypes2.default.func.isRequired,duplicateFlow:_propTypes2.default.func.isRequired,removeFlow:_propTypes2.default.func.isRequired,revertFlow:_propTypes2.default.func.isRequired},exports.default=(0,_reactRedux.connect)(function(e){return{flow:e.flows.byId[e.flows.selected[0]]}},{resumeFlow:flowsActions.resume,killFlow:flowsActions.kill,replayFlow:flowsActions.replay,duplicateFlow:flowsActions.duplicate,removeFlow:flowsActions.remove,revertFlow:flowsActions.revert})(FlowMenu);
- store.dispatch((0, _flows.select)(flowId));
- store.dispatch((0, _flow.selectTab)(tab));
- }
- }
+},{"../../ducks/flows":57,"../../flow/utils.js":69,"../common/Button":46,"../common/HideInStatic":50,"prop-types":"prop-types","react":"react","react-redux":"react-redux"}],33:[function(require,module,exports){
+"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function MainMenu(){return _react2.default.createElement("div",{className:"menu-main"},_react2.default.createElement(FlowFilterInput,null),_react2.default.createElement(HighlightInput,null),_react2.default.createElement(InterceptInput,null))}function setIntercept(e){(0,_settings.update)({intercept:e})}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=MainMenu,exports.setIntercept=setIntercept;var _react=require("react"),_react2=_interopRequireDefault(_react),_propTypes=require("prop-types"),_propTypes2=_interopRequireDefault(_propTypes),_reactRedux=require("react-redux"),_FilterInput=require("./FilterInput"),_FilterInput2=_interopRequireDefault(_FilterInput),_settings=require("../../ducks/settings"),_flows=require("../../ducks/flows");MainMenu.title="Start";var InterceptInput=(0,_reactRedux.connect)(function(e){return{value:e.settings.intercept||"",placeholder:"Intercept",type:"pause",color:"hsl(208, 56%, 53%)"}},{onChange:setIntercept})(_FilterInput2.default),FlowFilterInput=(0,_reactRedux.connect)(function(e){return{value:e.flows.filter||"",placeholder:"Search",type:"search",color:"black"}},{onChange:_flows.setFilter})(_FilterInput2.default),HighlightInput=(0,_reactRedux.connect)(function(e){return{value:e.flows.highlight||"",placeholder:"Highlight",type:"tag",color:"hsl(48, 100%, 50%)"}},{onChange:_flows.setHighlight})(_FilterInput2.default);
- if (query) {
- query.split("&").forEach(function (x) {
- var _x$split = x.split("=", 2),
- _x$split2 = _slicedToArray(_x$split, 2),
- key = _x$split2[0],
- value = _x$split2[1];
+},{"../../ducks/flows":57,"../../ducks/settings":60,"./FilterInput":31,"prop-types":"prop-types","react":"react","react-redux":"react-redux"}],34:[function(require,module,exports){
+"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperty(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function MenuToggle(e){var t=e.value,n=e.onChange,r=e.children;return React.createElement("div",{className:"menu-entry"},React.createElement("label",null,React.createElement("input",{type:"checkbox",checked:t,onChange:n}),r))}function SettingsToggle(e){var t=e.setting,n=e.children,r=e.settings,g=e.updateSettings;return React.createElement(MenuToggle,{value:r[t]||!1,onChange:function(){return g(_defineProperty({},t,!r[t]))}},n)}function EventlogToggle(e){var t=e.toggleVisibility,n=e.eventLogVisible;return React.createElement(MenuToggle,{value:n,onChange:t},"Display Event Log")}Object.defineProperty(exports,"__esModule",{value:!0}),exports.MenuToggle=MenuToggle,exports.SettingsToggle=SettingsToggle,exports.EventlogToggle=EventlogToggle;var _propTypes=require("prop-types"),_propTypes2=_interopRequireDefault(_propTypes),_reactRedux=require("react-redux"),_settings=require("../../ducks/settings"),_eventLog=require("../../ducks/eventLog");MenuToggle.propTypes={value:_propTypes2.default.bool.isRequired,onChange:_propTypes2.default.func.isRequired,children:_propTypes2.default.node.isRequired},SettingsToggle.propTypes={setting:_propTypes2.default.string.isRequired,children:_propTypes2.default.node.isRequired},exports.SettingsToggle=SettingsToggle=(0,_reactRedux.connect)(function(e){return{settings:e.settings}},{updateSettings:_settings.update})(SettingsToggle),exports.EventlogToggle=EventlogToggle=(0,_reactRedux.connect)(function(e){return{eventLogVisible:e.eventLog.visible}},{toggleVisibility:_eventLog.toggleVisibility})(EventlogToggle);
- switch (key) {
- case Query.SEARCH:
- store.dispatch((0, _flows.setFilter)(value));
- break;
- case Query.HIGHLIGHT:
- store.dispatch((0, _flows.setHighlight)(value));
- break;
- case Query.SHOW_EVENTLOG:
- if (!store.getState().eventLog.visible) store.dispatch((0, _eventLog.toggleVisibility)());
- break;
- default:
- console.error("unimplemented query arg: " + x);
- }
- });
- }
-}
+},{"../../ducks/eventLog":56,"../../ducks/settings":60,"prop-types":"prop-types","react-redux":"react-redux"}],35:[function(require,module,exports){
+"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function OptionMenu(){return _react2.default.createElement("div",null,_react2.default.createElement(_HideInStatic2.default,null,_react2.default.createElement("div",{className:"menu-group"},_react2.default.createElement("div",{className:"menu-content"},_react2.default.createElement(_MenuToggle.SettingsToggle,{setting:"http2"},"HTTP/2.0"),_react2.default.createElement(_MenuToggle.SettingsToggle,{setting:"websocket"},"WebSockets"),_react2.default.createElement(_MenuToggle.SettingsToggle,{setting:"rawtcp"},"Raw TCP")),_react2.default.createElement("div",{className:"menu-legend"},"Protocol Support")),_react2.default.createElement("div",{className:"menu-group"},_react2.default.createElement("div",{className:"menu-content"},_react2.default.createElement(_MenuToggle.SettingsToggle,{setting:"anticache"},"Disable Caching ",_react2.default.createElement(_DocsLink2.default,{resource:"features/anticache.html"})),_react2.default.createElement(_MenuToggle.SettingsToggle,{setting:"anticomp"},"Disable Compression ",_react2.default.createElement("i",{className:"fa fa-question-circle",title:"Do not forward Accept-Encoding headers to the server to force an uncompressed response."}))),_react2.default.createElement("div",{className:"menu-legend"},"HTTP Options"))),_react2.default.createElement("div",{className:"menu-group"},_react2.default.createElement("div",{className:"menu-content"},_react2.default.createElement(_HideInStatic2.default,null,_react2.default.createElement(_MenuToggle.SettingsToggle,{setting:"showhost"},"Use Host Header ",_react2.default.createElement("i",{className:"fa fa-question-circle",title:"Use the Host header to construct URLs for display."}))),_react2.default.createElement(_MenuToggle.EventlogToggle,null)),_react2.default.createElement("div",{className:"menu-legend"},"View Options")))}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=OptionMenu;var _react=require("react"),_react2=_interopRequireDefault(_react),_propTypes=require("prop-types"),_propTypes2=_interopRequireDefault(_propTypes),_reactRedux=require("react-redux"),_MenuToggle=require("./MenuToggle"),_DocsLink=require("../common/DocsLink"),_DocsLink2=_interopRequireDefault(_DocsLink),_HideInStatic=require("../common/HideInStatic"),_HideInStatic2=_interopRequireDefault(_HideInStatic);OptionMenu.title="Options";
-function updateUrlFromStore(store) {
- var _query;
+},{"../common/DocsLink":47,"../common/HideInStatic":50,"./MenuToggle":34,"prop-types":"prop-types","react":"react","react-redux":"react-redux"}],36:[function(require,module,exports){
+"use strict";function _interopRequireWildcard(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(exports,"__esModule",{value:!0});var _createClass=function(){function e(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,r,o){return r&&e(t.prototype,r),o&&e(t,o),t}}(),_react=require("react"),_react2=_interopRequireDefault(_react),_propTypes=require("prop-types"),_propTypes2=_interopRequireDefault(_propTypes),_reactRedux=require("react-redux"),_Splitter=require("./common/Splitter"),_Splitter2=_interopRequireDefault(_Splitter),_FlowTable=require("./FlowTable"),_FlowTable2=_interopRequireDefault(_FlowTable),_FlowView=require("./FlowView"),_FlowView2=_interopRequireDefault(_FlowView),_flows=require("../ducks/flows"),flowsActions=_interopRequireWildcard(_flows),MainView=function(e){function t(){return _classCallCheck(this,t),_possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return _inherits(t,e),_createClass(t,[{key:"render",value:function(){var e=this,t=this.props,r=t.flows,o=t.selectedFlow,l=t.highlight;return _react2.default.createElement("div",{className:"main-view"},_react2.default.createElement(_FlowTable2.default,{ref:"flowTable",flows:r,selected:o,highlight:l,onSelect:this.props.selectFlow}),o&&[_react2.default.createElement(_Splitter2.default,{key:"splitter"}),_react2.default.createElement(_FlowView2.default,{key:"flowDetails",ref:"flowDetails",tab:this.props.tab,updateFlow:function(t){return e.props.updateFlow(o,t)},flow:o})])}}]),t}(_react.Component);MainView.propTypes={highlight:_propTypes2.default.string,sort:_propTypes2.default.object},exports.default=(0,_reactRedux.connect)(function(e){return{flows:e.flows.view,filter:e.flows.filter,highlight:e.flows.highlight,selectedFlow:e.flows.byId[e.flows.selected[0]],tab:e.ui.flow.tab}},{selectFlow:flowsActions.select,updateFlow:flowsActions.update})(MainView);
- var state = store.getState();
- var query = (_query = {}, _defineProperty(_query, Query.SEARCH, state.flows.filter), _defineProperty(_query, Query.HIGHLIGHT, state.flows.highlight), _defineProperty(_query, Query.SHOW_EVENTLOG, state.eventLog.visible), _query);
- var queryStr = Object.keys(query).filter(function (k) {
- return query[k];
- }).map(function (k) {
- return k + "=" + query[k];
- }).join("&");
+},{"../ducks/flows":57,"./FlowTable":16,"./FlowView":20,"./common/Splitter":51,"prop-types":"prop-types","react":"react","react-redux":"react-redux"}],37:[function(require,module,exports){
+"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(exports,"__esModule",{value:!0});var _createClass=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),_react=require("react"),_react2=_interopRequireDefault(_react),_reactRedux=require("react-redux"),_ModalList=require("./ModalList"),_ModalList2=_interopRequireDefault(_ModalList),PureModal=function(e){function t(e,r){return _classCallCheck(this,t),_possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,r))}return _inherits(t,e),_createClass(t,[{key:"render",value:function(){var e=this.props.activeModal,t=_ModalList2.default.find(function(t){return t.name===e});return e?_react2.default.createElement(t,null):_react2.default.createElement("div",null)}}]),t}(_react.Component);exports.default=(0,_reactRedux.connect)(function(e){return{activeModal:e.ui.modal.activeModal}})(PureModal);
- var url = void 0;
- if (state.flows.selected.length > 0) {
- url = "/flows/" + state.flows.selected[0] + "/" + state.ui.flow.tab;
- } else {
- url = "/flows";
- }
+},{"./ModalList":39,"react":"react","react-redux":"react-redux"}],38:[function(require,module,exports){
+"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function ModalLayout(e){var a=e.children;return _react2.default.createElement("div",null,_react2.default.createElement("div",{className:"modal-backdrop fade in"}),_react2.default.createElement("div",{className:"modal modal-visible",id:"optionsModal",tabIndex:"-1",role:"dialog","aria-labelledby":"options"},_react2.default.createElement("div",{className:"modal-dialog modal-lg",role:"document"},_react2.default.createElement("div",{className:"modal-content"},a))))}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=ModalLayout;var _react=require("react"),_react2=_interopRequireDefault(_react);
- if (queryStr) {
- url += "?" + queryStr;
- }
- if (window.location.hash.substr(1) !== url) {
- history.replaceState(undefined, "", "/#" + url);
- }
-}
+},{"react":"react"}],39:[function(require,module,exports){
+"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function OptionModal(){return _react2.default.createElement(_ModalLayout2.default,null,_react2.default.createElement(_OptionModal2.default,null))}Object.defineProperty(exports,"__esModule",{value:!0});var _react=require("react"),_react2=_interopRequireDefault(_react),_ModalLayout=require("./ModalLayout"),_ModalLayout2=_interopRequireDefault(_ModalLayout),_OptionModal=require("./OptionModal"),_OptionModal2=_interopRequireDefault(_OptionModal);exports.default=[OptionModal];
-function initialize(store) {
- updateStoreFromUrl(store);
- store.subscribe(function () {
- return updateUrlFromStore(store);
- });
-}
+},{"./ModalLayout":38,"./OptionModal":41,"react":"react"}],40:[function(require,module,exports){
+"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _objectWithoutProperties(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function BooleanOption(e){var t=e.value,n=e.onChange,r=_objectWithoutProperties(e,["value","onChange"]);return _react2.default.createElement("div",{className:"checkbox"},_react2.default.createElement("label",null,_react2.default.createElement("input",_extends({type:"checkbox",checked:t,onChange:function(e){return n(e.target.checked)}},r)),"Enable"))}function StringOption(e){var t=e.value,n=e.onChange,r=_objectWithoutProperties(e,["value","onChange"]);return _react2.default.createElement("input",_extends({type:"text",value:t||"",onChange:function(e){return n(e.target.value)}},r))}function Optional(e){return function(t){var n=t.onChange,r=_objectWithoutProperties(t,["onChange"]);return _react2.default.createElement(e,_extends({onChange:function(e){return n(e?e:null)}},r))}}function NumberOption(e){var t=e.value,n=e.onChange,r=_objectWithoutProperties(e,["value","onChange"]);return _react2.default.createElement("input",_extends({type:"number",value:t,onChange:function(e){return n(parseInt(e.target.value))}},r))}function ChoicesOption(e){var t=e.value,n=e.onChange,r=e.choices,o=_objectWithoutProperties(e,["value","onChange","choices"]);return _react2.default.createElement("select",_extends({onChange:function(e){return n(e.target.value)},value:t},o),r.map(function(e){return _react2.default.createElement("option",{key:e,value:e},e)}))}function StringSequenceOption(e){var t=e.value,n=e.onChange,r=_objectWithoutProperties(e,["value","onChange"]),o=Math.max(t.length,1);return _react2.default.createElement("textarea",_extends({rows:o,value:t.join("\n"),onChange:function(e){return n(e.target.value.split("\n"))}},r))}function PureOption(e){var t=e.choices,n=e.type,r=e.value,o=e.onChange,a=e.name,u=e.error,i=void 0,p={};return t?(i=ChoicesOption,p.choices=t):i=Options[n],i!==BooleanOption&&(p.className="form-control"),_react2.default.createElement("div",{className:(0,_classnames2.default)({"has-error":u})},_react2.default.createElement(i,_extends({name:a,value:r,onChange:o,onKeyDown:stopPropagation},p)))}Object.defineProperty(exports,"__esModule",{value:!0}),exports.Options=exports.ChoicesOption=void 0;var _extends=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},_react=require("react"),_react2=_interopRequireDefault(_react),_propTypes=require("prop-types"),_propTypes2=_interopRequireDefault(_propTypes),_reactRedux=require("react-redux"),_options=require("../../ducks/options"),_utils=require("../../utils"),_classnames=require("classnames"),_classnames2=_interopRequireDefault(_classnames),stopPropagation=function(e){e.keyCode!==_utils.Key.ESC&&e.stopPropagation()};BooleanOption.PropTypes={value:_propTypes2.default.bool.isRequired,onChange:_propTypes2.default.func.isRequired},StringOption.PropTypes={value:_propTypes2.default.string.isRequired,onChange:_propTypes2.default.func.isRequired},NumberOption.PropTypes={value:_propTypes2.default.number.isRequired,onChange:_propTypes2.default.func.isRequired},ChoicesOption.PropTypes={value:_propTypes2.default.string.isRequired,onChange:_propTypes2.default.func.isRequired},exports.ChoicesOption=ChoicesOption,StringSequenceOption.PropTypes={value:_propTypes2.default.string.isRequired,onChange:_propTypes2.default.func.isRequired};var Options=exports.Options={bool:BooleanOption,str:StringOption,int:NumberOption,"optional str":Optional(StringOption),"sequence of str":StringSequenceOption};exports.default=(0,_reactRedux.connect)(function(e,t){var n=t.name;return _extends({},e.options[n],e.ui.optionsEditor[n])},function(e,t){var n=t.name;return{onChange:function(t){return e((0,_options.update)(n,t))}}})(PureOption);
-},{"./ducks/eventLog":50,"./ducks/flows":51,"./ducks/ui/flow":54}],62:[function(require,module,exports){
-'use strict';
+},{"../../ducks/options":59,"../../utils":71,"classnames":"classnames","prop-types":"prop-types","react":"react","react-redux":"react-redux"}],41:[function(require,module,exports){
+"use strict";function _interopRequireWildcard(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function PureOptionHelp(e){var t=e.help;return _react2.default.createElement("div",{className:"help-block small"},t)}function PureOptionError(e){var t=e.error;return t?_react2.default.createElement("div",{className:"small text-danger"},t):null}function PureOptionDefault(e){var t=e.value,r=e.defaultVal;if(t===r)return null;if("boolean"==typeof r)r=r?"true":"false";else if(Array.isArray(r)){if(_lodash2.default.isEmpty(_lodash2.default.compact(t))&&_lodash2.default.isEmpty(r))return null;r="[ ]"}else""===r?r='""':null===r&&(r="null");return _react2.default.createElement("div",{className:"small"},"Default: ",_react2.default.createElement("strong",null," ",r," ")," ")}Object.defineProperty(exports,"__esModule",{value:!0});var _createClass=function(){function e(e,t){for(var r=0;r<t.length;r++){var a=t[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(t,r,a){return r&&e(t.prototype,r),a&&e(t,a),t}}();exports.PureOptionDefault=PureOptionDefault;var _react=require("react"),_react2=_interopRequireDefault(_react),_reactRedux=require("react-redux"),_modal=require("../../ducks/ui/modal"),modalAction=_interopRequireWildcard(_modal),_options=require("../../ducks/options"),optionAction=_interopRequireWildcard(_options),_Option=require("./Option"),_Option2=_interopRequireDefault(_Option),_lodash=require("lodash"),_lodash2=_interopRequireDefault(_lodash),OptionHelp=(0,_reactRedux.connect)(function(e,t){var r=t.name;return{help:e.options[r].help}})(PureOptionHelp),OptionError=(0,_reactRedux.connect)(function(e,t){var r=t.name;return{error:e.ui.optionsEditor[r]&&e.ui.optionsEditor[r].error}})(PureOptionError),OptionDefault=(0,_reactRedux.connect)(function(e,t){var r=t.name;return{value:e.options[r].value,defaultVal:e.options[r].default}})(PureOptionDefault),PureOptionModal=function(e){function t(e,r){_classCallCheck(this,t);var a=_possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,r));return a.state={title:"Options"},a}return _inherits(t,e),_createClass(t,[{key:"componentWillUnmount",value:function(){this.props.save()}},{key:"render",value:function(){var e=this.props,t=e.hideModal,r=e.options,a=this.state.title;return _react2.default.createElement("div",null,_react2.default.createElement("div",{className:"modal-header"},_react2.default.createElement("button",{type:"button",className:"close","data-dismiss":"modal",onClick:function(){t()}},_react2.default.createElement("i",{className:"fa fa-fw fa-times"})),_react2.default.createElement("div",{className:"modal-title"},_react2.default.createElement("h4",null,a))),_react2.default.createElement("div",{className:"modal-body"},_react2.default.createElement("div",{className:"form-horizontal"},r.map(function(e){return _react2.default.createElement("div",{key:e,className:"form-group"},_react2.default.createElement("div",{className:"col-xs-6"},_react2.default.createElement("label",{htmlFor:e},e),_react2.default.createElement(OptionHelp,{name:e})),_react2.default.createElement("div",{className:"col-xs-6"},_react2.default.createElement(_Option2.default,{name:e}),_react2.default.createElement(OptionError,{name:e}),_react2.default.createElement(OptionDefault,{name:e})))}))),_react2.default.createElement("div",{className:"modal-footer"}))}}]),t}(_react.Component);exports.default=(0,_reactRedux.connect)(function(e){return{options:Object.keys(e.options).sort()}},{hideModal:modalAction.hideModal,save:optionAction.save})(PureOptionModal);
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports.pure = exports.formatTimeStamp = exports.formatTimeDelta = exports.formatSize = exports.Key = undefined;
+},{"../../ducks/options":59,"../../ducks/ui/modal":65,"./Option":40,"lodash":"lodash","react":"react","react-redux":"react-redux"}],42:[function(require,module,exports){
+"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function Prompt(e){function t(e){return _lodash2.default.map(p,"key").includes(e)}function r(e){e.stopPropagation(),e.preventDefault();var t=p.find(function(t){return _utils.Key[t.key.toUpperCase()]===e.keyCode});(t||e.keyCode===_utils.Key.ESC||e.keyCode===_utils.Key.ENTER)&&a(t.key||!1)}for(var o=e.prompt,a=e.done,n=e.options,p=[],u=0;u<n.length;u++){var i=n[u];if(_lodash2.default.isString(i)){for(var s=i;s.length>0&&t(s[0]);)s=s.substr(1);i={text:i,key:s[0]}}if(!i.text||!i.key||t(i.key))throw"invalid options";p.push(i)}return _react2.default.createElement("div",{tabIndex:"0",onKeyDown:r,className:"prompt-dialog"},_react2.default.createElement("div",{className:"prompt-content"},o||_react2.default.createElement("strong",null,"Select: "),p.map(function(e){function t(t){a(e.key),t.stopPropagation()}var r=e.text.indexOf(e.key);return _react2.default.createElement("span",{key:e.key,className:"option",onClick:t},r!==-1?e.text.substring(0,r):e.text+"(",_react2.default.createElement("strong",{className:"text-primary"},e.key),r!==-1?e.text.substring(r+1):")")})))}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=Prompt;var _react=require("react"),_react2=_interopRequireDefault(_react),_propTypes=require("prop-types"),_propTypes2=_interopRequireDefault(_propTypes),_reactDom=require("react-dom"),_reactDom2=_interopRequireDefault(_reactDom),_lodash=require("lodash"),_lodash2=_interopRequireDefault(_lodash),_utils=require("../utils.js");Prompt.propTypes={options:_propTypes2.default.array.isRequired,done:_propTypes2.default.func.isRequired,prompt:_propTypes2.default.string};
-var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+},{"../utils.js":71,"lodash":"lodash","prop-types":"prop-types","react":"react","react-dom":"react-dom"}],43:[function(require,module,exports){
+"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(exports,"__esModule",{value:!0});var _createClass=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),_react=require("react"),_react2=_interopRequireDefault(_react),_propTypes=require("prop-types"),_propTypes2=_interopRequireDefault(_propTypes),_reactRedux=require("react-redux"),_keyboard=require("../ducks/ui/keyboard"),_MainView=require("./MainView"),_MainView2=_interopRequireDefault(_MainView),_Header=require("./Header"),_Header2=_interopRequireDefault(_Header),_EventLog=require("./EventLog"),_EventLog2=_interopRequireDefault(_EventLog),_Footer=require("./Footer"),_Footer2=_interopRequireDefault(_Footer),_Modal=require("./Modal/Modal"),_Modal2=_interopRequireDefault(_Modal),ProxyAppMain=function(e){function t(){return _classCallCheck(this,t),_possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return _inherits(t,e),_createClass(t,[{key:"componentWillMount",value:function(){window.addEventListener("keydown",this.props.onKeyDown)}},{key:"componentWillUnmount",value:function(){window.removeEventListener("keydown",this.props.onKeyDown)}},{key:"render",value:function(){var e=this.props,t=e.showEventLog;e.location,e.filter,e.highlight;return _react2.default.createElement("div",{id:"container",tabIndex:"0"},_react2.default.createElement(_Header2.default,null),_react2.default.createElement(_MainView2.default,null),t&&_react2.default.createElement(_EventLog2.default,{key:"eventlog"}),_react2.default.createElement(_Footer2.default,null),_react2.default.createElement(_Modal2.default,null))}}]),t}(_react.Component);exports.default=(0,_reactRedux.connect)(function(e){return{showEventLog:e.eventLog.visible}},{onKeyDown:_keyboard.onKeyDown})(ProxyAppMain);
-var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
+},{"../ducks/ui/keyboard":64,"./EventLog":14,"./Footer":26,"./Header":27,"./MainView":36,"./Modal/Modal":37,"prop-types":"prop-types","react":"react","react-redux":"react-redux"}],44:[function(require,module,exports){
+"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(exports,"__esModule",{value:!0});var _createClass=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),_react=require("react"),_react2=_interopRequireDefault(_react),_propTypes=require("prop-types"),_propTypes2=_interopRequireDefault(_propTypes),_ValueEditor=require("./ValueEditor"),_ValueEditor2=_interopRequireDefault(_ValueEditor),_classnames=require("classnames"),_classnames2=_interopRequireDefault(_classnames),ValidateEditor=function(e){function t(e){_classCallCheck(this,t);var r=_possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return r.state={valid:e.isValid(e.content)},r.onInput=r.onInput.bind(r),r.onDone=r.onDone.bind(r),r}return _inherits(t,e),_createClass(t,[{key:"componentWillReceiveProps",value:function(e){this.setState({valid:e.isValid(e.content)})}},{key:"onInput",value:function(e){this.setState({valid:this.props.isValid(e)})}},{key:"onDone",value:function(e){this.props.isValid(e)||(this.editor.reset(),e=this.props.content),this.props.onDone(e)}},{key:"render",value:function(){var e=this,t=(0,_classnames2.default)(this.props.className,{"has-success":this.state.valid,"has-warning":!this.state.valid});return _react2.default.createElement(_ValueEditor2.default,{content:this.props.content,readonly:this.props.readonly,onDone:this.onDone,onInput:this.onInput,className:t,ref:function(t){return e.editor=t}})}}]),t}(_react.Component);ValidateEditor.propTypes={content:_propTypes2.default.string.isRequired,readonly:_propTypes2.default.bool,onDone:_propTypes2.default.func.isRequired,className:_propTypes2.default.string,isValid:_propTypes2.default.func.isRequired},exports.default=ValidateEditor;
-exports.reverseString = reverseString;
-exports.fetchApi = fetchApi;
-exports.getDiff = getDiff;
+},{"./ValueEditor":45,"classnames":"classnames","prop-types":"prop-types","react":"react"}],45:[function(require,module,exports){
+"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(exports,"__esModule",{value:!0});var _createClass=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),_react=require("react"),_react2=_interopRequireDefault(_react),_propTypes=require("prop-types"),_propTypes2=_interopRequireDefault(_propTypes),_lodash=require("lodash"),_lodash2=_interopRequireDefault(_lodash),_classnames=require("classnames"),_classnames2=_interopRequireDefault(_classnames),_utils=require("../../utils"),ValueEditor=function(e){function t(e){_classCallCheck(this,t);var n=_possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.state={editable:!1},n.onPaste=n.onPaste.bind(n),n.onMouseDown=n.onMouseDown.bind(n),n.onMouseUp=n.onMouseUp.bind(n),n.onFocus=n.onFocus.bind(n),n.onClick=n.onClick.bind(n),n.blur=n.blur.bind(n),n.onBlur=n.onBlur.bind(n),n.reset=n.reset.bind(n),n.onKeyDown=n.onKeyDown.bind(n),n.onInput=n.onInput.bind(n),n}return _inherits(t,e),_createClass(t,[{key:"blur",value:function(){this.input.blur()}},{key:"reset",value:function(){this.input.innerHTML=_lodash2.default.escape(this.props.content)}},{key:"render",value:function(){var e=this,t=(0,_classnames2.default)("inline-input",{readonly:this.props.readonly,editable:!this.props.readonly},this.props.className);return _react2.default.createElement("div",{ref:function(t){return e.input=t},tabIndex:this.props.readonly?void 0:0,className:t,contentEditable:this.state.editable||void 0,onFocus:this.onFocus,onMouseDown:this.onMouseDown,onClick:this.onClick,onBlur:this.onBlur,onKeyDown:this.onKeyDown,onInput:this.onInput,onPaste:this.onPaste,dangerouslySetInnerHTML:{__html:_lodash2.default.escape(this.props.content)}})}},{key:"onPaste",value:function(e){e.preventDefault();var t=e.clipboardData.getData("text/plain");document.execCommand("insertHTML",!1,t)}},{key:"onMouseDown",value:function(e){this._mouseDown=!0,window.addEventListener("mouseup",this.onMouseUp)}},{key:"onMouseUp",value:function(){this._mouseDown&&(this._mouseDown=!1,window.removeEventListener("mouseup",this.onMouseUp))}},{key:"onClick",value:function(e){this.onMouseUp(),this.onFocus(e)}},{key:"onFocus",value:function(e){var t=this;if(!(this._mouseDown||this._ignore_events||this.state.editable||this.props.readonly)){var n=window.getSelection(),o=void 0;if(n.rangeCount>0)o=n.getRangeAt(0);else if(document.caretPositionFromPoint&&e.clientX&&e.clientY){var s=document.caretPositionFromPoint(e.clientX,e.clientY);o=document.createRange(),o.setStart(s.offsetNode,s.offset)}else document.caretRangeFromPoint&&e.clientX&&e.clientY?o=document.caretRangeFromPoint(e.clientX,e.clientY):(o=document.createRange(),o.selectNodeContents(this.input));this._ignore_events=!0,this.setState({editable:!0},function(){t.input.blur(),t.input.focus(),t._ignore_events=!1,o.selectNodeContents(t.input),n.removeAllRanges(),n.addRange(o)})}}},{key:"onBlur",value:function(e){this._ignore_events||this.props.readonly||(window.getSelection().removeAllRanges(),this.setState({editable:!1}),this.props.onDone(this.input.textContent))}},{key:"onKeyDown",value:function(e){switch(e.stopPropagation(),e.keyCode){case _utils.Key.ESC:e.preventDefault(),this.reset(),this.blur();break;case _utils.Key.ENTER:e.shiftKey||(e.preventDefault(),this.blur())}this.props.onKeyDown(e)}},{key:"onInput",value:function(){this.props.onInput(this.input.textContent)}}]),t}(_react.Component);ValueEditor.propTypes={content:_propTypes2.default.string.isRequired,readonly:_propTypes2.default.bool,onDone:_propTypes2.default.func.isRequired,className:_propTypes2.default.string,onInput:_propTypes2.default.func,onKeyDown:_propTypes2.default.func},ValueEditor.defaultProps={onInput:function(){},onKeyDown:function(){}},exports.default=ValueEditor;
-var _lodash = require('lodash');
+},{"../../utils":71,"classnames":"classnames","lodash":"lodash","prop-types":"prop-types","react":"react"}],46:[function(require,module,exports){
+"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function Button(e){var t=e.onClick,r=e.children,a=e.icon,s=e.disabled,l=e.className,i=e.title;return _react2.default.createElement("div",{className:(0,_classnames2.default)(l,"btn btn-default"),onClick:!s&&t,disabled:s,title:i},a&&_react2.default.createElement("i",{className:"fa fa-fw "+a}),r)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=Button;var _react=require("react"),_react2=_interopRequireDefault(_react),_propTypes=require("prop-types"),_propTypes2=_interopRequireDefault(_propTypes),_classnames=require("classnames"),_classnames2=_interopRequireDefault(_classnames);Button.propTypes={onClick:_propTypes2.default.func.isRequired,children:_propTypes2.default.node.isRequired,icon:_propTypes2.default.string,title:_propTypes2.default.string};
-var _lodash2 = _interopRequireDefault(_lodash);
+},{"classnames":"classnames","prop-types":"prop-types","react":"react"}],47:[function(require,module,exports){
+"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function DocsLink(e){var r=e.children,t=e.resource,a="http://docs.mitmproxy.org/en/stable/"+t;return _react2.default.createElement("a",{target:"_blank",href:a},r||_react2.default.createElement("i",{className:"fa fa-question-circle"}))}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=DocsLink;var _react=require("react"),_react2=_interopRequireDefault(_react),_propTypes=require("prop-types"),_propTypes2=_interopRequireDefault(_propTypes);DocsLink.propTypes={resource:_propTypes2.default.string.isRequired};
-var _react = require('react');
+},{"prop-types":"prop-types","react":"react"}],48:[function(require,module,exports){
+"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.Divider=void 0;var _createClass=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),_react=require("react"),_react2=_interopRequireDefault(_react),_propTypes=require("prop-types"),_propTypes2=_interopRequireDefault(_propTypes),_classnames=require("classnames"),_classnames2=_interopRequireDefault(_classnames),Divider=exports.Divider=function(){return _react2.default.createElement("hr",{className:"divider"})},Dropdown=function(e){function t(e,r){_classCallCheck(this,t);var n=_possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,r));return n.state={open:!1},n.close=n.close.bind(n),n.open=n.open.bind(n),n}return _inherits(t,e),_createClass(t,[{key:"close",value:function(){this.setState({open:!1}),document.removeEventListener("click",this.close)}},{key:"open",value:function(e){e.preventDefault(),this.state.open||(this.setState({open:!this.state.open}),document.addEventListener("click",this.close))}},{key:"render",value:function(){var e=this.props,t=e.dropup,r=e.className,n=e.btnClass,o=e.text,s=e.children;return _react2.default.createElement("div",{className:(0,_classnames2.default)(t?"dropup":"dropdown",r,{open:this.state.open})},_react2.default.createElement("a",{href:"#",className:n,onClick:this.open},o),_react2.default.createElement("ul",{className:"dropdown-menu",role:"menu"},s.map(function(e,t){return _react2.default.createElement("li",{key:t}," ",e," ")})))}}]),t}(_react.Component);Dropdown.propTypes={dropup:_propTypes2.default.bool,className:_propTypes2.default.string,btnClass:_propTypes2.default.string.isRequired},Dropdown.defaultProps={dropup:!1},exports.default=Dropdown;
-var _react2 = _interopRequireDefault(_react);
+},{"classnames":"classnames","prop-types":"prop-types","react":"react"}],49:[function(require,module,exports){
+"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function FileChooser(e){var t=e.icon,r=e.text,a=e.className,p=e.title,i=e.onOpenFile,l=void 0;return _react2.default.createElement("a",{href:"#",onClick:function(){return l.click()},className:a,title:p},_react2.default.createElement("i",{className:"fa fa-fw "+t}),r,_react2.default.createElement("input",{ref:function(e){return l=e},className:"hidden",type:"file",onChange:function(e){e.preventDefault(),e.target.files.length>0&&i(e.target.files[0]),l.value=""}}))}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=FileChooser;var _react=require("react"),_react2=_interopRequireDefault(_react),_propTypes=require("prop-types"),_propTypes2=_interopRequireDefault(_propTypes);FileChooser.propTypes={icon:_propTypes2.default.string,text:_propTypes2.default.string,className:_propTypes2.default.string,title:_propTypes2.default.string,onOpenFile:_propTypes2.default.func.isRequired};
-var _shallowequal = require('shallowequal');
+},{"prop-types":"prop-types","react":"react"}],50:[function(require,module,exports){
+(function (global){
+"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function HideInStatic(e){var t=e.children;return global.MITMWEB_STATIC?null:[t]}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=HideInStatic;var _react=require("react"),_react2=_interopRequireDefault(_react);
-var _shallowequal2 = _interopRequireDefault(_shallowequal);
+}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+},{"react":"react"}],51:[function(require,module,exports){
+"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(exports,"__esModule",{value:!0});var _createClass=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),_react=require("react"),_react2=_interopRequireDefault(_react),_reactDom=require("react-dom"),_reactDom2=_interopRequireDefault(_reactDom),_classnames=require("classnames"),_classnames2=_interopRequireDefault(_classnames),Splitter=function(e){function t(e,n){_classCallCheck(this,t);var o=_possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));return o.state={applied:!1,startX:!1,startY:!1},o.onMouseMove=o.onMouseMove.bind(o),o.onMouseDown=o.onMouseDown.bind(o),o.onMouseUp=o.onMouseUp.bind(o),o.onDragEnd=o.onDragEnd.bind(o),o}return _inherits(t,e),_createClass(t,[{key:"onMouseDown",value:function(e){this.setState({startX:e.pageX,startY:e.pageY}),window.addEventListener("mousemove",this.onMouseMove),window.addEventListener("mouseup",this.onMouseUp),window.addEventListener("dragend",this.onDragEnd)}},{key:"onDragEnd",value:function(){_reactDom2.default.findDOMNode(this).style.transform="",window.removeEventListener("dragend",this.onDragEnd),window.removeEventListener("mouseup",this.onMouseUp),window.removeEventListener("mousemove",this.onMouseMove)}},{key:"onMouseUp",value:function(e){this.onDragEnd();var t=_reactDom2.default.findDOMNode(this),n=t.previousElementSibling,o=n.offsetHeight+e.pageY-this.state.startY;"x"===this.props.axis&&(o=n.offsetWidth+e.pageX-this.state.startX),n.style.flex="0 0 "+Math.max(0,o)+"px",t.nextElementSibling.style.flex="1 1 auto",this.setState({applied:!0}),this.onResize()}},{key:"onMouseMove",value:function(e){var t=0,n=0;"x"===this.props.axis?t=e.pageX-this.state.startX:n=e.pageY-this.state.startY,_reactDom2.default.findDOMNode(this).style.transform="translate("+t+"px, "+n+"px)"}},{key:"onResize",value:function(){window.setTimeout(function(){return window.dispatchEvent(new CustomEvent("resize"))},1)}},{key:"reset",value:function(e){if(this.state.applied){var t=_reactDom2.default.findDOMNode(this);t.previousElementSibling.style.flex="",t.nextElementSibling.style.flex="",e||this.setState({applied:!1}),this.onResize()}}},{key:"componentWillUnmount",value:function(){this.reset(!0)}},{key:"render",value:function(){return _react2.default.createElement("div",{className:(0,_classnames2.default)("splitter","x"===this.props.axis?"splitter-x":"splitter-y")},_react2.default.createElement("div",{onMouseDown:this.onMouseDown,draggable:"true"}))}}]),t}(_react.Component);Splitter.defaultProps={axis:"x"},exports.default=Splitter;
-function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+},{"classnames":"classnames","react":"react","react-dom":"react-dom"}],52:[function(require,module,exports){
+"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function ToggleButton(e){var t=e.checked,r=e.onToggle,o=e.text;return _react2.default.createElement("div",{className:"btn btn-toggle "+(t?"btn-primary":"btn-default"),onClick:r},_react2.default.createElement("i",{className:"fa fa-fw "+(t?"fa-check-square-o":"fa-square-o")})," ",o)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=ToggleButton;var _react=require("react"),_react2=_interopRequireDefault(_react),_propTypes=require("prop-types"),_propTypes2=_interopRequireDefault(_propTypes);ToggleButton.propTypes={checked:_propTypes2.default.bool.isRequired,onToggle:_propTypes2.default.func.isRequired,text:_propTypes2.default.string.isRequired};
-function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
+},{"prop-types":"prop-types","react":"react"}],53:[function(require,module,exports){
+"use strict";function _interopRequireDefault(t){return t&&t.__esModule?t:{default:t}}function _classCallCheck(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(exports,"__esModule",{value:!0});var _createClass=function(){function t(t,e){for(var o=0;o<e.length;o++){var r=e[o];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,o,r){return o&&t(e.prototype,o),r&&t(e,r),e}}(),_get=function t(e,o,r){null===e&&(e=Function.prototype);var n=Object.getOwnPropertyDescriptor(e,o);if(void 0===n){var i=Object.getPrototypeOf(e);return null===i?void 0:t(i,o,r)}if("value"in n)return n.value;var c=n.get;if(void 0!==c)return c.call(r)},_react=require("react"),_react2=_interopRequireDefault(_react),_reactDom=require("react-dom"),_reactDom2=_interopRequireDefault(_reactDom),symShouldStick=Symbol("shouldStick"),isAtBottom=function(t){return t.scrollTop+t.clientHeight===t.scrollHeight};exports.default=function(t){var e,o;return Object.assign((o=e=function(t){function e(){return _classCallCheck(this,e),_possibleConstructorReturn(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return _inherits(e,t),_createClass(e,[{key:"componentWillUpdate",value:function(){var t=_reactDom2.default.findDOMNode(this);this[symShouldStick]=t.scrollTop&&isAtBottom(t),_get(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"componentWillUpdate",this)&&_get(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"componentWillUpdate",this).call(this)}},{key:"componentDidUpdate",value:function(){var t=_reactDom2.default.findDOMNode(this);this[symShouldStick]&&!isAtBottom(t)&&(t.scrollTop=t.scrollHeight),_get(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"componentDidUpdate",this)&&_get(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"componentDidUpdate",this).call(this)}}]),e}(t),e.displayName=t.name,o),t)};
-function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
+},{"react":"react","react-dom":"react-dom"}],54:[function(require,module,exports){
+"use strict";function calcVScroll(t){if(!t)return{start:0,end:0,paddingTop:0,paddingBottom:0};var e=t.itemCount,o=t.rowHeight,r=t.viewportTop,a=t.viewportHeight,i=t.itemHeights,l=r+a,n=0,c=0,d=0,p=0;if(i)for(var h=0,s=0;h<e;h++){var m=i[h]||o;s<=r&&h%2===0&&(d=s,n=h),s<=l?c=h+1:p+=m,s+=m}else n=Math.max(0,Math.floor(r/o)-1)&-2,c=Math.min(e,n+Math.ceil(a/o)+2),d=Math.min(n,e)*o,p=Math.max(0,e-c)*o;return{start:n,end:c,paddingTop:d,paddingBottom:p}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.calcVScroll=calcVScroll;
-window._ = _lodash2.default;
-window.React = _react2.default;
+},{}],55:[function(require,module,exports){
+"use strict";function reducer(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:defaultState,e=arguments[1];switch(e.type){case ConnectionState.ESTABLISHED:case ConnectionState.FETCHING:case ConnectionState.ERROR:case ConnectionState.OFFLINE:return{state:e.type,message:e.message};default:return t}}function startFetching(){return{type:ConnectionState.FETCHING}}function connectionEstablished(){return{type:ConnectionState.ESTABLISHED}}function connectionError(t){return{type:ConnectionState.ERROR,message:t}}function setOffline(){return{type:ConnectionState.OFFLINE}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=reducer,exports.startFetching=startFetching,exports.connectionEstablished=connectionEstablished,exports.connectionError=connectionError,exports.setOffline=setOffline;var ConnectionState=exports.ConnectionState={INIT:Symbol("init"),FETCHING:Symbol("fetching"),ESTABLISHED:Symbol("established"),ERROR:Symbol("error"),OFFLINE:Symbol("offline")},defaultState={state:ConnectionState.INIT,message:null};
-var Key = exports.Key = {
- UP: 38,
- DOWN: 40,
- PAGE_UP: 33,
- PAGE_DOWN: 34,
- HOME: 36,
- END: 35,
- LEFT: 37,
- RIGHT: 39,
- ENTER: 13,
- ESC: 27,
- TAB: 9,
- SPACE: 32,
- BACKSPACE: 8,
- SHIFT: 16
-};
-// Add A-Z
-for (var i = 65; i <= 90; i++) {
- Key[String.fromCharCode(i)] = i;
-}
+},{}],56:[function(require,module,exports){
+"use strict";function _interopRequireWildcard(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function _defineProperty(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function reduce(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:defaultState,t=arguments[1];switch(t.type){case TOGGLE_VISIBILITY:return _extends({},e,{visible:!e.visible});case TOGGLE_FILTER:var r=_extends({},e.filters,_defineProperty({},t.filter,!e.filters[t.filter]));return _extends({},e,{filters:r},(0,storeActions.default)(e,storeActions.setFilter(function(e){return r[e.level]})));case ADD:case RECEIVE:return _extends({},e,(0,storeActions.default)(e,storeActions[t.cmd](t.data,function(t){return e.filters[t.level]})));default:return e}}function toggleFilter(e){return{type:TOGGLE_FILTER,filter:e}}function toggleVisibility(){return{type:TOGGLE_VISIBILITY}}function add(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"web",r={id:Math.random().toString(),message:e,level:t};return{type:ADD,cmd:"add",data:r}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.TOGGLE_FILTER=exports.TOGGLE_VISIBILITY=exports.RECEIVE=exports.ADD=void 0;var _extends=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e};exports.default=reduce,exports.toggleFilter=toggleFilter,exports.toggleVisibility=toggleVisibility,exports.add=add;var _store=require("./utils/store"),storeActions=_interopRequireWildcard(_store),ADD=exports.ADD="EVENTS_ADD",RECEIVE=exports.RECEIVE="EVENTS_RECEIVE",TOGGLE_VISIBILITY=exports.TOGGLE_VISIBILITY="EVENTS_TOGGLE_VISIBILITY",TOGGLE_FILTER=exports.TOGGLE_FILTER="EVENTS_TOGGLE_FILTER",defaultState=_extends({visible:!1,filters:{debug:!1,info:!0,web:!0,warn:!0,error:!0}},(0,storeActions.default)(void 0,{}));
-var formatSize = exports.formatSize = function formatSize(bytes) {
- if (bytes === 0) return "0";
- var prefix = ["b", "kb", "mb", "gb", "tb"];
- for (var i = 0; i < prefix.length; i++) {
- if (Math.pow(1024, i + 1) > bytes) {
- break;
- }
- }
- var precision;
- if (bytes % Math.pow(1024, i) === 0) precision = 0;else precision = 1;
- return (bytes / Math.pow(1024, i)).toFixed(precision) + prefix[i];
-};
+},{"./utils/store":67}],57:[function(require,module,exports){
+"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _interopRequireWildcard(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function reduce(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:defaultState,t=arguments[1];switch(t.type){case ADD:case UPDATE:case REMOVE:case RECEIVE:var r=storeActions[t.cmd](t.data,makeFilter(e.filter),makeSort(e.sort)),n=e.selected;if(t.type===REMOVE&&e.selected.includes(t.data))if(e.selected.length>1)n=n.filter(function(e){return e!==t.data});else if(n=[],t.data in e.viewIndex&&e.view.length>1){var o=e.viewIndex[t.data],i=void 0;i=o===e.view.length-1?e.view[o-1]:e.view[o+1],n.push(i.id)}return _extends({},e,{selected:n},(0,storeActions.default)(e,r));case SET_FILTER:return _extends({},e,{filter:t.filter},(0,storeActions.default)(e,storeActions.setFilter(makeFilter(t.filter),makeSort(e.sort))));case SET_HIGHLIGHT:return _extends({},e,{highlight:t.highlight});case SET_SORT:return _extends({},e,{sort:t.sort},(0,storeActions.default)(e,storeActions.setSort(makeSort(t.sort))));case SELECT:return _extends({},e,{selected:t.flowIds});default:return e}}function makeFilter(e){if(e)return _filt2.default.parse(e)}function makeSort(e){var t=e.column,r=e.desc,n=sortKeyFuns[t];if(n)return function(e,t){var o=n(e),i=n(t);return o>i?r?-1:1:o<i?r?1:-1:0}}function setFilter(e){return{type:SET_FILTER,filter:e}}function setHighlight(e){return{type:SET_HIGHLIGHT,highlight:e}}function setSort(e,t){return{type:SET_SORT,sort:{column:e,desc:t}}}function selectRelative(e,t){var r=e.viewIndex[e.selected[0]],n=0,o=e.view.length-1,i=void 0;void 0===r?i=t<0?n:o:(i=r+t,i=window.Math.max(i,n),i=window.Math.min(i,o));var s=e.view[i];return select(s?s.id:void 0)}function resume(e){return function(t){return(0,_utils.fetchApi)("/flows/"+e.id+"/resume",{method:"POST"})}}function resumeAll(){return function(e){return(0,_utils.fetchApi)("/flows/resume",{method:"POST"})}}function kill(e){return function(t){return(0,_utils.fetchApi)("/flows/"+e.id+"/kill",{method:"POST"})}}function killAll(){return function(e){return(0,_utils.fetchApi)("/flows/kill",{method:"POST"})}}function remove(e){return function(t){return(0,_utils.fetchApi)("/flows/"+e.id,{method:"DELETE"})}}function duplicate(e){return function(t){return(0,_utils.fetchApi)("/flows/"+e.id+"/duplicate",{method:"POST"})}}function replay(e){return function(t){return(0,_utils.fetchApi)("/flows/"+e.id+"/replay",{method:"POST"})}}function revert(e){return function(t){return(0,_utils.fetchApi)("/flows/"+e.id+"/revert",{method:"POST"})}}function update(e,t){return function(r){return _utils.fetchApi.put("/flows/"+e.id,t)}}function uploadContent(e,t,r){var n=new FormData;return t=new window.Blob([t],{type:"plain/text"}),n.append("file",t),function(t){return(0,_utils.fetchApi)("/flows/"+e.id+"/"+r+"/content",{method:"POST",body:n})}}function clear(){return function(e){return(0,_utils.fetchApi)("/clear",{method:"POST"})}}function download(){return window.location="/flows/dump",{type:REQUEST_ACTION}}function upload(e){var t=new FormData;return t.append("file",e),function(e){return(0,_utils.fetchApi)("/flows/dump",{method:"POST",body:t})}}function select(e){return{type:SELECT,flowIds:e?[e]:[]}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.REQUEST_ACTION=exports.SET_HIGHLIGHT=exports.SET_SORT=exports.SET_FILTER=exports.SELECT=exports.RECEIVE=exports.REMOVE=exports.UPDATE=exports.ADD=void 0;var _extends=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e};exports.default=reduce,exports.makeFilter=makeFilter,exports.makeSort=makeSort,exports.setFilter=setFilter,exports.setHighlight=setHighlight,exports.setSort=setSort,exports.selectRelative=selectRelative,exports.resume=resume,exports.resumeAll=resumeAll,exports.kill=kill,exports.killAll=killAll,exports.remove=remove,exports.duplicate=duplicate,exports.replay=replay,exports.revert=revert,exports.update=update,exports.uploadContent=uploadContent,exports.clear=clear,exports.download=download,exports.upload=upload,exports.select=select;var _utils=require("../utils"),_store=require("./utils/store"),storeActions=_interopRequireWildcard(_store),_filt=require("../filt/filt"),_filt2=_interopRequireDefault(_filt),_utils2=require("../flow/utils"),ADD=exports.ADD="FLOWS_ADD",UPDATE=exports.UPDATE="FLOWS_UPDATE",REMOVE=exports.REMOVE="FLOWS_REMOVE",RECEIVE=exports.RECEIVE="FLOWS_RECEIVE",SELECT=exports.SELECT="FLOWS_SELECT",SET_FILTER=exports.SET_FILTER="FLOWS_SET_FILTER",SET_SORT=exports.SET_SORT="FLOWS_SET_SORT",SET_HIGHLIGHT=exports.SET_HIGHLIGHT="FLOWS_SET_HIGHLIGHT",REQUEST_ACTION=exports.REQUEST_ACTION="FLOWS_REQUEST_ACTION",defaultState=_extends({highlight:null,filter:null,sort:{column:null,desc:!1},selected:[]},(0,storeActions.default)(void 0,{})),sortKeyFuns={TLSColumn:function(e){return e.request.scheme},PathColumn:function(e){return _utils2.RequestUtils.pretty_url(e.request)},MethodColumn:function(e){return e.request.method},StatusColumn:function(e){return e.response&&e.response.status_code},TimeColumn:function(e){return e.response&&e.response.timestamp_end-e.request.timestamp_start},SizeColumn:function(e){var t=e.request.contentLength;return e.response&&(t+=e.response.contentLength||0),t}};
-var formatTimeDelta = exports.formatTimeDelta = function formatTimeDelta(milliseconds) {
- var time = milliseconds;
- var prefix = ["ms", "s", "min", "h"];
- var div = [1000, 60, 60];
- var i = 0;
- while (Math.abs(time) >= div[i] && i < div.length) {
- time = time / div[i];
- i++;
- }
- return Math.round(time) + prefix[i];
-};
+},{"../filt/filt":68,"../flow/utils":69,"../utils":71,"./utils/store":67}],58:[function(require,module,exports){
+"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(exports,"__esModule",{value:!0});var _redux=require("redux"),_eventLog=require("./eventLog"),_eventLog2=_interopRequireDefault(_eventLog),_flows=require("./flows"),_flows2=_interopRequireDefault(_flows),_settings=require("./settings"),_settings2=_interopRequireDefault(_settings),_index=require("./ui/index"),_index2=_interopRequireDefault(_index),_connection=require("./connection"),_connection2=_interopRequireDefault(_connection),_options=require("./options"),_options2=_interopRequireDefault(_options);exports.default=(0,_redux.combineReducers)({eventLog:_eventLog2.default,flows:_flows2.default,settings:_settings2.default,connection:_connection2.default,ui:_index2.default,options:_options2.default});
-var formatTimeStamp = exports.formatTimeStamp = function formatTimeStamp(seconds) {
- var ts = new Date(seconds * 1000).toISOString();
- return ts.replace("T", " ").replace("Z", "");
-};
+},{"./connection":55,"./eventLog":56,"./flows":57,"./options":59,"./settings":60,"./ui/index":63,"redux":"redux"}],59:[function(require,module,exports){
+"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _interopRequireWildcard(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function _defineProperty(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function reducer(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:defaultState,t=arguments[1];switch(t.type){case RECEIVE:return t.data;case UPDATE:return _extends({},e,t.data);default:return e}}function pureSendUpdate(e,t,r){_utils.fetchApi.put("/options",_defineProperty({},e,t)).then(function(t){200===t.status?r(optionsEditorActions.updateSuccess(e)):t.text().then(function(t){r(optionsEditorActions.updateError(e,t))})})}function update(e,t){return function(r){r(optionsEditorActions.startUpdate(e,t)),sendUpdate(e,t,r)}}function save(){return function(e){return(0,_utils.fetchApi)("/options/save",{method:"POST"})}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.REQUEST_UPDATE=exports.UPDATE=exports.RECEIVE=void 0;var _extends=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e};exports.default=reducer,exports.pureSendUpdate=pureSendUpdate,exports.update=update,exports.save=save;var _utils=require("../utils"),_optionsEditor=require("./ui/optionsEditor"),optionsEditorActions=_interopRequireWildcard(_optionsEditor),_lodash=require("lodash"),_lodash2=_interopRequireDefault(_lodash),RECEIVE=exports.RECEIVE="OPTIONS_RECEIVE",UPDATE=exports.UPDATE="OPTIONS_UPDATE",REQUEST_UPDATE=exports.REQUEST_UPDATE="REQUEST_UPDATE",defaultState={},sendUpdate=_lodash2.default.throttle(pureSendUpdate,700,{leading:!0,trailing:!0});
-// At some places, we need to sort strings alphabetically descending,
-// but we can only provide a key function.
-// This beauty "reverses" a JS string.
-var end = String.fromCharCode(0xffff);
-function reverseString(s) {
- return String.fromCharCode.apply(String, _lodash2.default.map(s.split(""), function (c) {
- return 0xffff - c.charCodeAt(0);
- })) + end;
-}
+},{"../utils":71,"./ui/optionsEditor":66,"lodash":"lodash"}],60:[function(require,module,exports){
+"use strict";function reducer(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:defaultState,t=arguments[1];switch(t.type){case RECEIVE:return t.data;case UPDATE:return _extends({},e,t.data);default:return e}}function update(e){return _utils.fetchApi.put("/settings",e),{type:REQUEST_UPDATE}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.REQUEST_UPDATE=exports.UPDATE=exports.RECEIVE=void 0;var _extends=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var E in r)Object.prototype.hasOwnProperty.call(r,E)&&(e[E]=r[E])}return e};exports.default=reducer,exports.update=update;var _utils=require("../utils"),RECEIVE=exports.RECEIVE="SETTINGS_RECEIVE",UPDATE=exports.UPDATE="SETTINGS_UPDATE",REQUEST_UPDATE=exports.REQUEST_UPDATE="REQUEST_UPDATE",defaultState={};
-function getCookie(name) {
- var r = document.cookie.match(new RegExp("\\b" + name + "=([^;]*)\\b"));
- return r ? r[1] : undefined;
-}
-var xsrf = '_xsrf=' + getCookie("_xsrf");
+},{"../utils":71}],61:[function(require,module,exports){
+"use strict";function _interopRequireDefault(t){return t&&t.__esModule?t:{default:t}}function _interopRequireWildcard(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function reducer(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:defaultState,e=arguments[1],n=t.modifiedFlow,o=e.content||t.content,r=o&&o.length<=t.maxContentLines;switch(e.type){case START_EDIT:return _extends({},t,{modifiedFlow:e.flow,contentView:"Edit",showFullContent:!0});case UPDATE_EDIT:return _extends({},t,{modifiedFlow:_lodash2.default.merge({},t.modifiedFlow,e.update)});case flowsActions.SELECT:return _extends({},t,{modifiedFlow:!1,displayLarge:!1,contentView:n?"Auto":t.contentView,showFullContent:r});case flowsActions.UPDATE:return e.data.id===t.modifiedFlow.id?_extends({},t,{modifiedFlow:!1,displayLarge:!1,contentView:n?"Auto":t.contentView,showFullContent:!1}):t;case SET_CONTENT_VIEW_DESCRIPTION:return _extends({},t,{viewDescription:e.description});case SET_SHOW_FULL_CONTENT:return _extends({},t,{showFullContent:!0});case SET_TAB:return _extends({},t,{tab:e.tab?e.tab:"request",displayLarge:!1,showFullContent:"Edit"===t.contentView});case SET_CONTENT_VIEW:return _extends({},t,{contentView:e.contentView,showFullContent:"Edit"===e.contentView});case SET_CONTENT:return _extends({},t,{content:e.content,showFullContent:r});case DISPLAY_LARGE:return _extends({},t,{displayLarge:!0});default:return t}}function setContentView(t){return{type:SET_CONTENT_VIEW,contentView:t}}function displayLarge(){return{type:DISPLAY_LARGE}}function selectTab(t){return{type:SET_TAB,tab:t}}function startEdit(t){return{type:START_EDIT,flow:t}}function updateEdit(t){return{type:UPDATE_EDIT,update:t}}function setContentViewDescription(t){return{type:SET_CONTENT_VIEW_DESCRIPTION,description:t}}function setShowFullContent(){return{type:SET_SHOW_FULL_CONTENT}}function setContent(t){return{type:SET_CONTENT,content:t}}function stopEdit(t,e){return flowsActions.update(t,(0,_utils.getDiff)(t,e))}Object.defineProperty(exports,"__esModule",{value:!0}),exports.SET_CONTENT=exports.SET_CONTENT_VIEW_DESCRIPTION=exports.SET_SHOW_FULL_CONTENT=exports.UPLOAD_CONTENT=exports.UPDATE_EDIT=exports.START_EDIT=exports.SET_TAB=exports.DISPLAY_LARGE=exports.SET_CONTENT_VIEW=void 0;var _extends=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t};exports.default=reducer,exports.setContentView=setContentView,exports.displayLarge=displayLarge,exports.selectTab=selectTab,exports.startEdit=startEdit,exports.updateEdit=updateEdit,exports.setContentViewDescription=setContentViewDescription,exports.setShowFullContent=setShowFullContent,exports.setContent=setContent,exports.stopEdit=stopEdit;var _flows=require("../flows"),flowsActions=_interopRequireWildcard(_flows),_utils=require("../../utils"),_lodash=require("lodash"),_lodash2=_interopRequireDefault(_lodash),SET_CONTENT_VIEW=exports.SET_CONTENT_VIEW="UI_FLOWVIEW_SET_CONTENT_VIEW",DISPLAY_LARGE=exports.DISPLAY_LARGE="UI_FLOWVIEW_DISPLAY_LARGE",SET_TAB=exports.SET_TAB="UI_FLOWVIEW_SET_TAB",START_EDIT=exports.START_EDIT="UI_FLOWVIEW_START_EDIT",UPDATE_EDIT=exports.UPDATE_EDIT="UI_FLOWVIEW_UPDATE_EDIT",UPLOAD_CONTENT=exports.UPLOAD_CONTENT="UI_FLOWVIEW_UPLOAD_CONTENT",SET_SHOW_FULL_CONTENT=exports.SET_SHOW_FULL_CONTENT="UI_SET_SHOW_FULL_CONTENT",SET_CONTENT_VIEW_DESCRIPTION=exports.SET_CONTENT_VIEW_DESCRIPTION="UI_SET_CONTENT_VIEW_DESCRIPTION",SET_CONTENT=exports.SET_CONTENT="UI_SET_CONTENT",defaultState={displayLarge:!1,viewDescription:"",showFullContent:!1,modifiedFlow:!1,contentView:"Auto",tab:"request",content:[],maxContentLines:80};
-function fetchApi(url) {
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
+},{"../../utils":71,"../flows":57,"lodash":"lodash"}],62:[function(require,module,exports){
+"use strict";function _interopRequireWildcard(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function reducer(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:defaultState,t=arguments[1];switch(t.type){case SET_ACTIVE_MENU:return _extends({},e,{activeMenu:t.activeMenu});case flowsActions.SELECT:if(t.flowIds.length>0&&!e.isFlowSelected)return _extends({},e,{activeMenu:"Flow",isFlowSelected:!0});if(0===t.flowIds.length&&e.isFlowSelected){var r=e.activeMenu;return"Flow"===r&&(r="Start"),_extends({},e,{activeMenu:r,isFlowSelected:!1})}return e;default:return e}}function setActiveMenu(e){return{type:SET_ACTIVE_MENU,activeMenu:e}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.SET_ACTIVE_MENU=void 0;var _extends=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e};exports.default=reducer,exports.setActiveMenu=setActiveMenu;var _flows=require("../flows"),flowsActions=_interopRequireWildcard(_flows),SET_ACTIVE_MENU=exports.SET_ACTIVE_MENU="UI_SET_ACTIVE_MENU",defaultState={activeMenu:"Start",isFlowSelected:!1};
- if (options.method && options.method !== "GET") {
- if (url.indexOf("?") === -1) {
- url += "?" + xsrf;
- } else {
- url += "&" + xsrf;
- }
- }
+},{"../flows":57}],63:[function(require,module,exports){
+"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(exports,"__esModule",{value:!0});var _redux=require("redux"),_flow=require("./flow"),_flow2=_interopRequireDefault(_flow),_header=require("./header"),_header2=_interopRequireDefault(_header),_modal=require("./modal"),_modal2=_interopRequireDefault(_modal),_optionsEditor=require("./optionsEditor"),_optionsEditor2=_interopRequireDefault(_optionsEditor);exports.default=(0,_redux.combineReducers)({flow:_flow2.default,header:_header2.default,modal:_modal2.default,optionsEditor:_optionsEditor2.default});
- return fetch(url, _extends({
- credentials: 'same-origin'
- }, options));
-}
+},{"./flow":61,"./header":62,"./modal":65,"./optionsEditor":66,"redux":"redux"}],64:[function(require,module,exports){
+"use strict";function _interopRequireWildcard(e){if(e&&e.__esModule)return e;var s={};if(null!=e)for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(s[t]=e[t]);return s.default=e,s}function onKeyDown(e){if(e.ctrlKey)return function(){};var s=e.keyCode,t=e.shiftKey;return e.preventDefault(),function(e,l){var i=l().flows,r=i.byId[l().flows.selected[0]];switch(s){case _utils.Key.K:case _utils.Key.UP:e(flowsActions.selectRelative(i,-1));break;case _utils.Key.J:case _utils.Key.DOWN:e(flowsActions.selectRelative(i,1));break;case _utils.Key.SPACE:case _utils.Key.PAGE_DOWN:e(flowsActions.selectRelative(i,10));break;case _utils.Key.PAGE_UP:e(flowsActions.selectRelative(i,-10));break;case _utils.Key.END:e(flowsActions.selectRelative(i,1e10));break;case _utils.Key.HOME:e(flowsActions.selectRelative(i,-1e10));break;case _utils.Key.ESC:e(l().ui.modal.activeModal?modalActions.hideModal():flowsActions.select(null));break;case _utils.Key.LEFT:if(!r)break;var o=["request","response","error"].filter(function(e){return r[e]}).concat(["details"]),a=l().ui.flow.tab,c=o[(o.indexOf(a)-1+o.length)%o.length];e((0,_flow.selectTab)(c));break;case _utils.Key.TAB:case _utils.Key.RIGHT:if(!r)break;var n=["request","response","error"].filter(function(e){return r[e]}).concat(["details"]),u=l().ui.flow.tab,f=n[(n.indexOf(u)+1)%n.length];e((0,_flow.selectTab)(f));break;case _utils.Key.D:if(!r)return;e(t?flowsActions.duplicate(r):flowsActions.remove(r));break;case _utils.Key.A:t?e(flowsActions.resumeAll()):r&&r.intercepted&&e(flowsActions.resume(r));break;case _utils.Key.R:!t&&r&&e(flowsActions.replay(r));break;case _utils.Key.V:!t&&r&&r.modified&&e(flowsActions.revert(r));break;case _utils.Key.X:t?e(flowsActions.killAll()):r&&r.intercepted&&e(flowsActions.kill(r));break;case _utils.Key.Z:t||e(flowsActions.clear());break;default:return}}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.onKeyDown=onKeyDown;var _utils=require("../../utils"),_flow=require("./flow"),_flows=require("../flows"),flowsActions=_interopRequireWildcard(_flows),_modal=require("./modal"),modalActions=_interopRequireWildcard(_modal);
-fetchApi.put = function (url, json, options) {
- return fetchApi(url, _extends({
- method: "PUT",
- headers: {
- 'Content-Type': 'application/json'
- },
- body: JSON.stringify(json)
- }, options));
-};
-// deep comparison of two json objects (dicts). arrays are handeled as a single value.
-// return: json object including only the changed keys value pairs.
-function getDiff(obj1, obj2) {
- var result = _extends({}, obj2);
- for (var key in obj1) {
- if (_lodash2.default.isEqual(obj2[key], obj1[key])) result[key] = undefined;else if (Object.prototype.toString.call(obj2[key]) === '[object Object]' && Object.prototype.toString.call(obj1[key]) === '[object Object]') result[key] = getDiff(obj1[key], obj2[key]);
- }
- return result;
-}
+},{"../../utils":71,"../flows":57,"./flow":61,"./modal":65}],65:[function(require,module,exports){
+"use strict";function reducer(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:defaultState,t=arguments[1];switch(t.type){case SET_ACTIVE_MODAL:return _extends({},e,{activeModal:t.activeModal});case HIDE_MODAL:return _extends({},e,{activeModal:void 0});default:return e}}function setActiveModal(e){return{type:SET_ACTIVE_MODAL,activeModal:e}}function hideModal(){return{type:HIDE_MODAL}}Object.defineProperty(exports,"__esModule",{value:!0});var _extends=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e};exports.default=reducer,exports.setActiveModal=setActiveModal,exports.hideModal=hideModal;var HIDE_MODAL=exports.HIDE_MODAL="UI_HIDE_MODAL",SET_ACTIVE_MODAL=exports.SET_ACTIVE_MODAL="UI_SET_ACTIVE_MODAL",defaultState={activeModal:void 0};
-var pure = exports.pure = function pure(renderFn) {
- var _class, _temp;
+},{}],66:[function(require,module,exports){
+"use strict";function _defineProperty(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function reducer(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:defaultState,r=arguments[1];switch(r.type){case OPTION_UPDATE_START:return _extends({},e,_defineProperty({},r.option,{isUpdating:!0,value:r.value,error:!1}));case OPTION_UPDATE_SUCCESS:return _extends({},e,_defineProperty({},r.option,void 0));case OPTION_UPDATE_ERROR:var t=e[r.option].value;return"boolean"==typeof t&&(t=!t),_extends({},e,_defineProperty({},r.option,{value:t,isUpdating:!1,error:r.error}));case _modal.HIDE_MODAL:return{};default:return e}}function startUpdate(e,r){return{type:OPTION_UPDATE_START,option:e,value:r}}function updateSuccess(e){return{type:OPTION_UPDATE_SUCCESS,option:e}}function updateError(e,r){return{type:OPTION_UPDATE_ERROR,option:e,error:r}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.OPTION_UPDATE_ERROR=exports.OPTION_UPDATE_SUCCESS=exports.OPTION_UPDATE_START=void 0;var _extends=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e};exports.default=reducer,exports.startUpdate=startUpdate,exports.updateSuccess=updateSuccess,exports.updateError=updateError;var _modal=require("./modal"),OPTION_UPDATE_START=exports.OPTION_UPDATE_START="UI_OPTION_UPDATE_START",OPTION_UPDATE_SUCCESS=exports.OPTION_UPDATE_SUCCESS="UI_OPTION_UPDATE_SUCCESS",OPTION_UPDATE_ERROR=exports.OPTION_UPDATE_ERROR="UI_OPTION_UPDATE_ERROR",defaultState={};
- return _temp = _class = function (_React$Component) {
- _inherits(_class, _React$Component);
+},{"./modal":65}],67:[function(require,module,exports){
+"use strict";function _defineProperty(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _toConsumableArray(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return Array.from(e)}function reduce(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:defaultState,t=arguments[1],r=e.byId,i=e.list,n=e.listIndex,o=e.view,a=e.viewIndex;switch(t.type){case SET_FILTER:o=i.filter(t.filter).sort(t.sort),a={},o.forEach(function(e,t){a[e.id]=t});break;case SET_SORT:o=[].concat(_toConsumableArray(o)).sort(t.sort),a={},o.forEach(function(e,t){a[e.id]=t});break;case ADD:if(t.item.id in r)break;if(r=_extends({},r,_defineProperty({},t.item.id,t.item)),n=_extends({},n,_defineProperty({},t.item.id,i.length)),i=[].concat(_toConsumableArray(i),[t.item]),t.filter(t.item)){var d=sortedInsert(e,t.item,t.sort);o=d.view,a=d.viewIndex}break;case UPDATE:r=_extends({},r,_defineProperty({},t.item.id,t.item)),i=[].concat(_toConsumableArray(i)),i[n[t.item.id]]=t.item;var s=t.item.id in a,l=t.filter(t.item);if(l&&!s){var f=sortedInsert(e,t.item,t.sort);o=f.view,a=f.viewIndex}else if(!l&&s){var u=removeData(o,a,t.item.id);o=u.data,a=u.dataIndex}else if(l&&s){var v=sortedUpdate(e,t.item,t.sort);o=v.view,a=v.viewIndex}break;case REMOVE:if(!(t.id in r))break;r=_extends({},r),delete r[t.id];var c=removeData(i,n,t.id);if(i=c.data,n=c.dataIndex,t.id in a){var E=removeData(o,a,t.id);o=E.data,a=E.dataIndex}break;case RECEIVE:i=t.list,n={},r={},i.forEach(function(e,t){r[e.id]=e,n[e.id]=t}),o=i.filter(t.filter).sort(t.sort),a={},o.forEach(function(e,t){a[e.id]=t})}return{byId:r,list:i,listIndex:n,view:o,viewIndex:a}}function setFilter(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:defaultFilter,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:defaultSort;return{type:SET_FILTER,filter:e,sort:t}}function setSort(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:defaultSort;return{type:SET_SORT,sort:e}}function add(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:defaultFilter,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:defaultSort;return{type:ADD,item:e,filter:t,sort:r}}function update(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:defaultFilter,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:defaultSort;return{type:UPDATE,item:e,filter:t,sort:r}}function remove(e){return{type:REMOVE,id:e}}function receive(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:defaultFilter,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:defaultSort;return{type:RECEIVE,list:e,filter:t,sort:r}}function sortedInsert(e,t,r){var i=sortedIndex(e.view,t,r),n=[].concat(_toConsumableArray(e.view)),o=_extends({},e.viewIndex);n.splice(i,0,t);for(var a=n.length-1;a>=i;a--)o[n[a].id]=a;return{view:n,viewIndex:o}}function removeData(e,t,r){var i=t[r],n=[].concat(_toConsumableArray(e)),o=_extends({},t);delete o[r],n.splice(i,1);for(var a=n.length-1;a>=i;a--)o[n[a].id]=a;return{data:n,dataIndex:o}}function sortedUpdate(e,t,r){var i=[].concat(_toConsumableArray(e.view)),n=_extends({},e.viewIndex),o=n[t.id];for(i[o]=t;o+1<i.length&&r(i[o],i[o+1])>0;)i[o]=i[o+1],i[o+1]=t,n[t.id]=o+1,n[i[o].id]=o,++o;for(;o>0&&r(i[o],i[o-1])<0;)i[o]=i[o-1],i[o-1]=t,n[t.id]=o-1,n[i[o].id]=o,--o;return{view:i,viewIndex:n}}function sortedIndex(e,t,r){for(var i=0,n=e.length;i<n;){var o=i+n>>>1;r(t,e[o])>=0?i=o+1:n=o}return i}function defaultFilter(){return!0}function defaultSort(e,t){return 0}Object.defineProperty(exports,"__esModule",{value:!0});var _extends=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e};exports.default=reduce,exports.setFilter=setFilter,exports.setSort=setSort,exports.add=add,exports.update=update,exports.remove=remove,exports.receive=receive;var SET_FILTER=exports.SET_FILTER="LIST_SET_FILTER",SET_SORT=exports.SET_SORT="LIST_SET_SORT",ADD=exports.ADD="LIST_ADD",UPDATE=exports.UPDATE="LIST_UPDATE",REMOVE=exports.REMOVE="LIST_REMOVE",RECEIVE=exports.RECEIVE="LIST_RECEIVE",defaultState={byId:{},list:[],listIndex:{},view:[],viewIndex:{}};
- function _class() {
- _classCallCheck(this, _class);
+},{}],68:[function(require,module,exports){
+"use strict";module.exports=function(){function e(e,t){function r(){this.constructor=e}r.prototype=t.prototype,e.prototype=new r}function t(e,r,n,s){this.message=e,this.expected=r,this.found=n,this.location=s,this.name="SyntaxError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,t)}function r(e){function r(t){var r,n,s=qr[t];if(s)return s;for(r=t-1;!qr[r];)r--;for(s=qr[r],s={line:s.line,column:s.column,seenCR:s.seenCR};r<t;)n=e.charAt(r),"\n"===n?(s.seenCR||s.line++,s.column=1,s.seenCR=!1):"\r"===n||"\u2028"===n||"\u2029"===n?(s.line++,s.column=1,s.seenCR=!0):(s.column++,s.seenCR=!1),r++;return qr[t]=s,s}function n(e,t){var n=r(e),s=r(t);return{start:{offset:e,line:n.line,column:n.column},end:{offset:t,line:s.line,column:s.column}}}function s(e){wr<Cr||(wr>Cr&&(Cr=wr,Er=[]),Er.push(e))}function i(e,r,n,s){function i(e){var t=1;for(e.sort(function(e,t){return e.description<t.description?-1:e.description>t.description?1:0});t<e.length;)e[t-1]===e[t]?e.splice(t,1):t++}function u(e,t){function r(e){function t(e){return e.charCodeAt(0).toString(16).toUpperCase()}return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\x08/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/[\x00-\x07\x0B\x0E\x0F]/g,function(e){return"\\x0"+t(e)}).replace(/[\x10-\x1F\x80-\xFF]/g,function(e){return"\\x"+t(e)}).replace(/[\u0100-\u0FFF]/g,function(e){return"\\u0"+t(e)}).replace(/[\u1000-\uFFFF]/g,function(e){return"\\u"+t(e)})}var n,s,i,u=new Array(e.length);for(i=0;i<e.length;i++)u[i]=e[i].description;return n=e.length>1?u.slice(0,-1).join(", ")+" or "+u[e.length-1]:u[0],s=t?'"'+r(t)+'"':"end of input","Expected "+n+" but "+s+" found."}return null!==r&&i(r),new t(null!==e?e:u(r,n),r,n,s)}function u(){var e,t,r,n;return Fr++,e=wr,t=a(),t!==Z?(r=l(),r!==Z?(n=a(),n!==Z?(Ar=e,t=re(r),e=t):(wr=e,e=Z)):(wr=e,e=Z)):(wr=e,e=Z),Fr--,e===Z&&(t=Z,0===Fr&&s(te)),e}function c(){var t,r;return Fr++,se.test(e.charAt(wr))?(t=e.charAt(wr),wr++):(t=Z,0===Fr&&s(ie)),Fr--,t===Z&&(r=Z,0===Fr&&s(ne)),t}function o(){var t,r;return Fr++,ce.test(e.charAt(wr))?(t=e.charAt(wr),wr++):(t=Z,0===Fr&&s(oe)),Fr--,t===Z&&(r=Z,0===Fr&&s(ue)),t}function a(){var e,t;for(Fr++,e=[],t=c();t!==Z;)e.push(t),t=c();return Fr--,e===Z&&(t=Z,0===Fr&&s(ae)),e}function l(){var t,r,n,i,u,c;return t=wr,r=p(),r!==Z?(n=a(),n!==Z?(124===e.charCodeAt(wr)?(i=le,wr++):(i=Z,0===Fr&&s(pe)),i!==Z?(u=a(),u!==Z?(c=l(),c!==Z?(Ar=t,r=fe(r,c),t=r):(wr=t,t=Z)):(wr=t,t=Z)):(wr=t,t=Z)):(wr=t,t=Z)):(wr=t,t=Z),t===Z&&(t=p()),t}function p(){var t,r,n,i,u,o;if(t=wr,r=f(),r!==Z?(n=a(),n!==Z?(38===e.charCodeAt(wr)?(i=de,wr++):(i=Z,0===Fr&&s(he)),i!==Z?(u=a(),u!==Z?(o=p(),o!==Z?(Ar=t,r=ye(r,o),t=r):(wr=t,t=Z)):(wr=t,t=Z)):(wr=t,t=Z)):(wr=t,t=Z)):(wr=t,t=Z),t===Z){if(t=wr,r=f(),r!==Z){if(n=[],i=c(),i!==Z)for(;i!==Z;)n.push(i),i=c();else n=Z;n!==Z?(i=p(),i!==Z?(Ar=t,r=ye(r,i),t=r):(wr=t,t=Z)):(wr=t,t=Z)}else wr=t,t=Z;t===Z&&(t=f())}return t}function f(){var t,r,n,i;return t=wr,33===e.charCodeAt(wr)?(r=ve,wr++):(r=Z,0===Fr&&s(me)),r!==Z?(n=a(),n!==Z?(i=f(),i!==Z?(Ar=t,r=ge(i),t=r):(wr=t,t=Z)):(wr=t,t=Z)):(wr=t,t=Z),t===Z&&(t=d()),t}function d(){var t,r,n,i,u,c;return t=wr,40===e.charCodeAt(wr)?(r=be,wr++):(r=Z,0===Fr&&s(xe)),r!==Z?(n=a(),n!==Z?(i=l(),i!==Z?(u=a(),u!==Z?(41===e.charCodeAt(wr)?(c=Re,wr++):(c=Z,0===Fr&&s(we)),c!==Z?(Ar=t,r=Ae(i),t=r):(wr=t,t=Z)):(wr=t,t=Z)):(wr=t,t=Z)):(wr=t,t=Z)):(wr=t,t=Z),t===Z&&(t=h()),t}function h(){var t,r,n,i;if(t=wr,e.substr(wr,4)===qe?(r=qe,wr+=4):(r=Z,0===Fr&&s(Ce)),r!==Z&&(Ar=t,r=Ee()),t=r,t===Z&&(t=wr,e.substr(wr,5)===Fe?(r=Fe,wr+=5):(r=Z,0===Fr&&s(ke)),r!==Z&&(Ar=t,r=Te()),t=r,t===Z&&(t=wr,e.substr(wr,2)===_e?(r=_e,wr+=2):(r=Z,0===Fr&&s(Ue)),r!==Z&&(Ar=t,r=je()),t=r,t===Z))){if(t=wr,e.substr(wr,2)===Se?(r=Se,wr+=2):(r=Z,0===Fr&&s(Pe)),r!==Z){if(n=[],i=c(),i!==Z)for(;i!==Z;)n.push(i),i=c();else n=Z;n!==Z?(i=v(),i!==Z?(Ar=t,r=Be(i),t=r):(wr=t,t=Z)):(wr=t,t=Z)}else wr=t,t=Z;if(t===Z){if(t=wr,e.substr(wr,3)===He?(r=He,wr+=3):(r=Z,0===Fr&&s(Ie)),r!==Z){if(n=[],i=c(),i!==Z)for(;i!==Z;)n.push(i),i=c();else n=Z;n!==Z?(i=v(),i!==Z?(Ar=t,r=We(i),t=r):(wr=t,t=Z)):(wr=t,t=Z)}else wr=t,t=Z;if(t===Z){if(t=wr,e.substr(wr,3)===ze?(r=ze,wr+=3):(r=Z,0===Fr&&s(De)),r!==Z){if(n=[],i=c(),i!==Z)for(;i!==Z;)n.push(i),i=c();else n=Z;n!==Z?(i=v(),i!==Z?(Ar=t,r=Ge(i),t=r):(wr=t,t=Z)):(wr=t,t=Z)}else wr=t,t=Z;if(t===Z){if(t=wr,e.substr(wr,2)===Je?(r=Je,wr+=2):(r=Z,0===Fr&&s(Ke)),r!==Z){if(n=[],i=c(),i!==Z)for(;i!==Z;)n.push(i),i=c();else n=Z;n!==Z?(i=y(),i!==Z?(Ar=t,r=Le(i),t=r):(wr=t,t=Z)):(wr=t,t=Z)}else wr=t,t=Z;if(t===Z){if(t=wr,e.substr(wr,2)===Me?(r=Me,wr+=2):(r=Z,0===Fr&&s(Ne)),r!==Z){if(n=[],i=c(),i!==Z)for(;i!==Z;)n.push(i),i=c();else n=Z;n!==Z?(i=v(),i!==Z?(Ar=t,r=Oe(i),t=r):(wr=t,t=Z)):(wr=t,t=Z)}else wr=t,t=Z;if(t===Z){if(t=wr,e.substr(wr,4)===Qe?(r=Qe,wr+=4):(r=Z,0===Fr&&s(Ve)),r!==Z){if(n=[],i=c(),i!==Z)for(;i!==Z;)n.push(i),i=c();else n=Z;n!==Z?(i=v(),i!==Z?(Ar=t,r=Xe(i),t=r):(wr=t,t=Z)):(wr=t,t=Z)}else wr=t,t=Z;if(t===Z&&(t=wr,e.substr(wr,2)===Ye?(r=Ye,wr+=2):(r=Z,0===Fr&&s(Ze)),r!==Z&&(Ar=t,r=$e()),t=r,t===Z)){if(t=wr,e.substr(wr,2)===et?(r=et,wr+=2):(r=Z,0===Fr&&s(tt)),r!==Z){if(n=[],i=c(),i!==Z)for(;i!==Z;)n.push(i),i=c();else n=Z;n!==Z?(i=v(),i!==Z?(Ar=t,r=rt(i),t=r):(wr=t,t=Z)):(wr=t,t=Z)}else wr=t,t=Z;if(t===Z){if(t=wr,e.substr(wr,3)===nt?(r=nt,wr+=3):(r=Z,0===Fr&&s(st)),r!==Z){if(n=[],i=c(),i!==Z)for(;i!==Z;)n.push(i),i=c();else n=Z;n!==Z?(i=v(),i!==Z?(Ar=t,r=it(i),t=r):(wr=t,t=Z)):(wr=t,t=Z)}else wr=t,t=Z;if(t===Z){if(t=wr,e.substr(wr,3)===ut?(r=ut,wr+=3):(r=Z,0===Fr&&s(ct)),r!==Z){if(n=[],i=c(),i!==Z)for(;i!==Z;)n.push(i),i=c();else n=Z;n!==Z?(i=v(),i!==Z?(Ar=t,r=ot(i),t=r):(wr=t,t=Z)):(wr=t,t=Z)}else wr=t,t=Z;if(t===Z&&(t=wr,e.substr(wr,5)===at?(r=at,wr+=5):(r=Z,0===Fr&&s(lt)),r!==Z&&(Ar=t,r=pt()),t=r,t===Z)){if(t=wr,e.substr(wr,2)===ft?(r=ft,wr+=2):(r=Z,0===Fr&&s(dt)),r!==Z){if(n=[],i=c(),i!==Z)for(;i!==Z;)n.push(i),i=c();else n=Z;n!==Z?(i=v(),i!==Z?(Ar=t,r=ht(i),t=r):(wr=t,t=Z)):(wr=t,t=Z)}else wr=t,t=Z;if(t===Z&&(t=wr,e.substr(wr,7)===yt?(r=yt,wr+=7):(r=Z,0===Fr&&s(vt)),r!==Z&&(Ar=t,r=mt()),t=r,t===Z&&(t=wr,e.substr(wr,2)===gt?(r=gt,wr+=2):(r=Z,0===Fr&&s(bt)),r!==Z&&(Ar=t,r=xt()),t=r,t===Z))){if(t=wr,e.substr(wr,4)===Rt?(r=Rt,wr+=4):(r=Z,0===Fr&&s(wt)),r!==Z){if(n=[],i=c(),i!==Z)for(;i!==Z;)n.push(i),i=c();else n=Z;n!==Z?(i=v(),i!==Z?(Ar=t,r=At(i),t=r):(wr=t,t=Z)):(wr=t,t=Z)}else wr=t,t=Z;if(t===Z&&(t=wr,e.substr(wr,2)===qt?(r=qt,wr+=2):(r=Z,0===Fr&&s(Ct)),r!==Z&&(Ar=t,r=Et()),t=r,t===Z)){if(t=wr,e.substr(wr,2)===Ft?(r=Ft,wr+=2):(r=Z,0===Fr&&s(kt)),r!==Z){if(n=[],i=c(),i!==Z)for(;i!==Z;)n.push(i),i=c();else n=Z;n!==Z?(i=v(),i!==Z?(Ar=t,r=Tt(i),t=r):(wr=t,t=Z)):(wr=t,t=Z)}else wr=t,t=Z;if(t===Z&&(t=wr,e.substr(wr,4)===_t?(r=_t,wr+=4):(r=Z,0===Fr&&s(Ut)),r!==Z&&(Ar=t,r=jt()),t=r,t===Z)){if(t=wr,e.substr(wr,3)===St?(r=St,wr+=3):(r=Z,0===Fr&&s(Pt)),r!==Z){if(n=[],i=c(),i!==Z)for(;i!==Z;)n.push(i),i=c();else n=Z;n!==Z?(i=v(),i!==Z?(Ar=t,r=Bt(i),t=r):(wr=t,t=Z)):(wr=t,t=Z)}else wr=t,t=Z;if(t===Z){if(t=wr,e.substr(wr,3)===Ht?(r=Ht,wr+=3):(r=Z,0===Fr&&s(It)),r!==Z){if(n=[],i=c(),i!==Z)for(;i!==Z;)n.push(i),i=c();else n=Z;n!==Z?(i=v(),i!==Z?(Ar=t,r=Wt(i),t=r):(wr=t,t=Z)):(wr=t,t=Z)}else wr=t,t=Z;if(t===Z){if(t=wr,e.substr(wr,2)===zt?(r=zt,wr+=2):(r=Z,0===Fr&&s(Dt)),r!==Z){if(n=[],i=c(),i!==Z)for(;i!==Z;)n.push(i),i=c();else n=Z;n!==Z?(i=v(),i!==Z?(Ar=t,r=Gt(i),t=r):(wr=t,t=Z)):(wr=t,t=Z)}else wr=t,t=Z;t===Z&&(t=wr,e.substr(wr,10)===Jt?(r=Jt,wr+=10):(r=Z,0===Fr&&s(Kt)),r!==Z&&(Ar=t,r=Lt()),t=r,t===Z&&(t=wr,r=v(),r!==Z&&(Ar=t,r=Gt(r)),t=r))}}}}}}}}}}}}}}}return t}function y(){var t,r,n,i;if(Fr++,t=wr,Nt.test(e.charAt(wr))?(r=e.charAt(wr),wr++):(r=Z,0===Fr&&s(Ot)),r===Z&&(r=null),r!==Z){if(n=[],Qt.test(e.charAt(wr))?(i=e.charAt(wr),wr++):(i=Z,0===Fr&&s(Vt)),i!==Z)for(;i!==Z;)n.push(i),Qt.test(e.charAt(wr))?(i=e.charAt(wr),wr++):(i=Z,0===Fr&&s(Vt));else n=Z;n!==Z?(Nt.test(e.charAt(wr))?(i=e.charAt(wr),wr++):(i=Z,0===Fr&&s(Ot)),i===Z&&(i=null),i!==Z?(Ar=t,r=Xt(n),t=r):(wr=t,t=Z)):(wr=t,t=Z)}else wr=t,t=Z;return Fr--,t===Z&&(r=Z,0===Fr&&s(Mt)),t}function v(){var t,r,n,i;if(Fr++,t=wr,34===e.charCodeAt(wr)?(r=Zt,wr++):(r=Z,0===Fr&&s($t)),r!==Z){for(n=[],i=m();i!==Z;)n.push(i),i=m();n!==Z?(34===e.charCodeAt(wr)?(i=Zt,wr++):(i=Z,0===Fr&&s($t)),i!==Z?(Ar=t,r=er(n),t=r):(wr=t,t=Z)):(wr=t,t=Z)}else wr=t,t=Z;if(t===Z){if(t=wr,39===e.charCodeAt(wr)?(r=tr,wr++):(r=Z,0===Fr&&s(rr)),r!==Z){for(n=[],i=g();i!==Z;)n.push(i),i=g();n!==Z?(39===e.charCodeAt(wr)?(i=tr,wr++):(i=Z,0===Fr&&s(rr)),i!==Z?(Ar=t,r=er(n),t=r):(wr=t,t=Z)):(wr=t,t=Z)}else wr=t,t=Z;if(t===Z)if(t=wr,r=wr,Fr++,n=o(),Fr--,n===Z?r=void 0:(wr=r,r=Z),r!==Z){if(n=[],i=b(),i!==Z)for(;i!==Z;)n.push(i),i=b();else n=Z;n!==Z?(Ar=t,r=er(n),t=r):(wr=t,t=Z)}else wr=t,t=Z}return Fr--,t===Z&&(r=Z,0===Fr&&s(Yt)),t}function m(){var t,r,n;return t=wr,r=wr,Fr++,nr.test(e.charAt(wr))?(n=e.charAt(wr),wr++):(n=Z,0===Fr&&s(sr)),Fr--,n===Z?r=void 0:(wr=r,r=Z),r!==Z?(e.length>wr?(n=e.charAt(wr),wr++):(n=Z,0===Fr&&s(ir)),n!==Z?(Ar=t,r=ur(n),t=r):(wr=t,t=Z)):(wr=t,t=Z),t===Z&&(t=wr,92===e.charCodeAt(wr)?(r=cr,wr++):(r=Z,0===Fr&&s(or)),r!==Z?(n=x(),n!==Z?(Ar=t,r=ur(n),t=r):(wr=t,t=Z)):(wr=t,t=Z)),t}function g(){var t,r,n;return t=wr,r=wr,Fr++,ar.test(e.charAt(wr))?(n=e.charAt(wr),wr++):(n=Z,0===Fr&&s(lr)),Fr--,n===Z?r=void 0:(wr=r,r=Z),r!==Z?(e.length>wr?(n=e.charAt(wr),wr++):(n=Z,0===Fr&&s(ir)),n!==Z?(Ar=t,r=ur(n),t=r):(wr=t,t=Z)):(wr=t,t=Z),t===Z&&(t=wr,92===e.charCodeAt(wr)?(r=cr,wr++):(r=Z,0===Fr&&s(or)),r!==Z?(n=x(),n!==Z?(Ar=t,r=ur(n),t=r):(wr=t,t=Z)):(wr=t,t=Z)),t}function b(){var t,r,n;return t=wr,r=wr,Fr++,n=c(),Fr--,n===Z?r=void 0:(wr=r,r=Z),r!==Z?(e.length>wr?(n=e.charAt(wr),wr++):(n=Z,0===Fr&&s(ir)),n!==Z?(Ar=t,r=ur(n),t=r):(wr=t,t=Z)):(wr=t,t=Z),t}function x(){var t,r;return pr.test(e.charAt(wr))?(t=e.charAt(wr),wr++):(t=Z,0===Fr&&s(fr)),t===Z&&(t=wr,110===e.charCodeAt(wr)?(r=dr,wr++):(r=Z,0===Fr&&s(hr)),r!==Z&&(Ar=t,r=yr()),t=r,t===Z&&(t=wr,114===e.charCodeAt(wr)?(r=vr,wr++):(r=Z,0===Fr&&s(mr)),r!==Z&&(Ar=t,r=gr()),t=r,t===Z&&(t=wr,116===e.charCodeAt(wr)?(r=br,wr++):(r=Z,0===Fr&&s(xr)),r!==Z&&(Ar=t,r=Rr()),t=r))),t}function R(e,t){function r(){return e.apply(this,arguments)||t.apply(this,arguments)}return r.desc=e.desc+" or "+t.desc,r}function w(e,t){function r(){return e.apply(this,arguments)&&t.apply(this,arguments)}return r.desc=e.desc+" and "+t.desc,r}function A(e){function t(){return!e.apply(this,arguments)}return t.desc="not "+e.desc,t}function q(e){function t(){return e.apply(this,arguments)}return t.desc="("+e.desc+")",t}function C(e){return!0}function E(e){return!1}function F(e){if(e.response)for(var t=kr.ResponseUtils.getContentType(e.response),r=Tr.length;r--;)if(Tr[r].test(t))return!0;return!1}function k(e){function t(t){return t.response&&t.response.status_code===e}return t.desc="resp. code is "+e,t}function T(e){function t(e){return True}return e=new RegExp(e,"i"),t.desc="body filters are not implemented yet, see https://github.com/mitmproxy/mitmweb/issues/10",t}function _(e){function t(e){return True}return e=new RegExp(e,"i"),t.desc="body filters are not implemented yet, see https://github.com/mitmproxy/mitmweb/issues/10",t}function U(e){function t(e){return True}return e=new RegExp(e,"i"),t.desc="body filters are not implemented yet, see https://github.com/mitmproxy/mitmweb/issues/10",t}function j(e){function t(t){return t.request&&(e.test(t.request.host)||e.test(t.request.pretty_host))}return e=new RegExp(e,"i"),t.desc="domain matches "+e,t}function S(e){function t(t){return!!t.server_conn.address&&e.test(t.server_conn.address[0]+":"+t.server_conn.address[1])}return e=new RegExp(e,"i"),t.desc="destination address matches "+e,t}function P(e){return!!e.error}function B(e){function t(t){return t.request&&kr.RequestUtils.match_header(t.request,e)||t.response&&kr.ResponseUtils.match_header(t.response,e)}return e=new RegExp(e,"i"),t.desc="header matches "+e,t}function H(e){function t(t){return t.request&&kr.RequestUtils.match_header(t.request,e)}return e=new RegExp(e,"i"),t.desc="req. header matches "+e,t}function I(e){function t(t){return t.response&&kr.ResponseUtils.match_header(t.response,e)}return e=new RegExp(e,"i"),t.desc="resp. header matches "+e,t}function W(e){return"http"===e.type}function z(e){function t(t){return t.request&&e.test(t.request.method)}return e=new RegExp(e,"i"),t.desc="method matches "+e,t}function D(e){return e.marked}function G(e){return e.request&&!e.response}function J(e){return!!e.response}function K(e){function t(t){return!!t.client_conn.address&&e.test(t.client_conn.address[0]+":"+t.client_conn.address[1])}return e=new RegExp(e,"i"),t.desc="source address matches "+e,t}function L(e){function t(t){return t.request&&e.test(kr.RequestUtils.getContentType(t.request))||t.response&&e.test(kr.ResponseUtils.getContentType(t.response))}return e=new RegExp(e,"i"),t.desc="content type matches "+e,t}function M(e){return"tcp"===e.type}function N(e){function t(t){return t.request&&e.test(kr.RequestUtils.getContentType(t.request))}return e=new RegExp(e,"i"),t.desc="req. content type matches "+e,t}function O(e){function t(t){return t.response&&e.test(kr.ResponseUtils.getContentType(t.response))}return e=new RegExp(e,"i"),t.desc="resp. content type matches "+e,t}function Q(e){function t(t){return t.request&&e.test(kr.RequestUtils.pretty_url(t.request))}return e=new RegExp(e,"i"),t.desc="url matches "+e,t}function V(e){return"websocket"===e.type}var X,Y=arguments.length>1?arguments[1]:{},Z={},$={start:u},ee=u,te={type:"other",description:"filter expression"},re=function(e){return e},ne={type:"other",description:"whitespace"},se=/^[ \t\n\r]/,ie={type:"class",value:"[ \\t\\n\\r]",description:"[ \\t\\n\\r]"},ue={type:"other",description:"control character"},ce=/^[|&!()~"]/,oe={type:"class",value:'[|&!()~"]',description:'[|&!()~"]'},ae={type:"other",description:"optional whitespace"},le="|",pe={type:"literal",value:"|",description:'"|"'},fe=function(e,t){return R(e,t)},de="&",he={type:"literal",value:"&",description:'"&"'},ye=function(e,t){return w(e,t)},ve="!",me={type:"literal",value:"!",description:'"!"'},ge=function(e){return A(e)},be="(",xe={type:"literal",value:"(",description:'"("'},Re=")",we={type:"literal",value:")",description:'")"'},Ae=function(e){return q(e)},qe="true",Ce={type:"literal",value:"true",description:'"true"'},Ee=function(){return C},Fe="false",ke={type:"literal",value:"false",description:'"false"'},Te=function(){return E},_e="~a",Ue={type:"literal",value:"~a",description:'"~a"'},je=function(){return F},Se="~b",Pe={type:"literal",value:"~b",description:'"~b"'},Be=function(e){return T(e)},He="~bq",Ie={type:"literal",value:"~bq",description:'"~bq"'},We=function(e){return _(e)},ze="~bs",De={type:"literal",value:"~bs",description:'"~bs"'},Ge=function(e){return U(e)},Je="~c",Ke={type:"literal",value:"~c",description:'"~c"'},Le=function(e){return k(e)},Me="~d",Ne={type:"literal",value:"~d",description:'"~d"'},Oe=function(e){return j(e)},Qe="~dst",Ve={type:"literal",value:"~dst",description:'"~dst"'},Xe=function(e){return S(e)},Ye="~e",Ze={type:"literal",value:"~e",description:'"~e"'},$e=function(){return P},et="~h",tt={type:"literal",value:"~h",description:'"~h"'},rt=function(e){return B(e)},nt="~hq",st={type:"literal",value:"~hq",description:'"~hq"'},it=function(e){return H(e)},ut="~hs",ct={type:"literal",value:"~hs",description:'"~hs"'},ot=function(e){return I(e)},at="~http",lt={type:"literal",value:"~http",description:'"~http"'},pt=function(){return W},ft="~m",dt={type:"literal",value:"~m",description:'"~m"'},ht=function(e){return z(e)},yt="~marked",vt={type:"literal",value:"~marked",description:'"~marked"'},mt=function(){return D},gt="~q",bt={type:"literal",value:"~q",description:'"~q"'},xt=function(){return G},Rt="~src",wt={type:"literal",value:"~src",description:'"~src"'},At=function(e){return K(e)},qt="~s",Ct={type:"literal",value:"~s",description:'"~s"'},Et=function(){return J},Ft="~t",kt={type:"literal",value:"~t",description:'"~t"'},Tt=function(e){return L(e)},_t="~tcp",Ut={type:"literal",value:"~tcp",description:'"~tcp"'},jt=function(){return M},St="~tq",Pt={type:"literal",value:"~tq",description:'"~tq"'},Bt=function(e){return N(e)},Ht="~ts",It={type:"literal",value:"~ts",description:'"~ts"'},Wt=function(e){return O(e)},zt="~u",Dt={type:"literal",value:"~u",description:'"~u"'},Gt=function(e){return Q(e)},Jt="~websocket",Kt={type:"literal",value:"~websocket",description:'"~websocket"'},Lt=function(){return V},Mt={type:"other",description:"integer"},Nt=/^['"]/,Ot={type:"class",value:"['\"]",description:"['\"]"},Qt=/^[0-9]/,Vt={type:"class",value:"[0-9]",description:"[0-9]"},Xt=function(e){return parseInt(e.join(""),10)},Yt={type:"other",description:"string"},Zt='"',$t={type:"literal",value:'"',description:'"\\""'},er=function(e){return e.join("")},tr="'",rr={type:"literal",value:"'",description:'"\'"'},nr=/^["\\]/,sr={type:"class",value:'["\\\\]',description:'["\\\\]'},ir={type:"any",description:"any character"},ur=function(e){return e},cr="\\",or={type:"literal",value:"\\",description:'"\\\\"'},ar=/^['\\]/,lr={type:"class",value:"['\\\\]",description:"['\\\\]"},pr=/^['"\\]/,fr={type:"class",value:"['\"\\\\]",description:"['\"\\\\]"},dr="n",hr={type:"literal",value:"n",description:'"n"'},yr=function(){return"\n"},vr="r",mr={type:"literal",value:"r",description:'"r"'},gr=function(){return"\r"},br="t",xr={type:"literal",value:"t",description:'"t"'},Rr=function(){return"\t"},wr=0,Ar=0,qr=[{line:1,column:1,seenCR:!1}],Cr=0,Er=[],Fr=0;if("startRule"in Y){if(!(Y.startRule in $))throw new Error("Can't start parsing from rule \""+Y.startRule+'".');ee=$[Y.startRule]}var kr=require("../flow/utils.js");C.desc="true",E.desc="false";var Tr=[new RegExp("text/javascript"),new RegExp("application/x-javascript"),new RegExp("application/javascript"),new RegExp("text/css"),new RegExp("image/.*"),new RegExp("application/x-shockwave-flash")];if(F.desc="is asset",P.desc="has error",W.desc="is an HTTP Flow",D.desc="is marked",G.desc="has no response",J.desc="has response",M.desc="is a TCP Flow",V.desc="is a Websocket Flow",X=ee(),X!==Z&&wr===e.length)return X;throw X!==Z&&wr<e.length&&s({type:"end",description:"end of input"}),i(null,Er,Cr<e.length?e.charAt(Cr):null,Cr<e.length?n(Cr,Cr+1):n(Cr,Cr))}return e(t,Error),{SyntaxError:t,parse:r}}();
- return _possibleConstructorReturn(this, (_class.__proto__ || Object.getPrototypeOf(_class)).apply(this, arguments));
- }
+},{"../flow/utils.js":69}],69:[function(require,module,exports){
+"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.isValidHttpVersion=exports.parseUrl=exports.ResponseUtils=exports.RequestUtils=exports.MessageUtils=void 0;var _lodash=require("lodash"),_lodash2=_interopRequireDefault(_lodash),defaultPorts={http:80,https:443},MessageUtils=exports.MessageUtils={getContentType:function(e){var t=this.get_first_header(e,/^Content-Type$/i);if(t)return t.split(";")[0].trim()},get_first_header:function(e,t){if(e._headerLookups||Object.defineProperty(e,"_headerLookups",{value:{},configurable:!1,enumerable:!1,writable:!1}),!(t in e._headerLookups)){for(var r,s=0;s<e.headers.length;s++)if(e.headers[s][0].match(t)){r=e.headers[s];break}e._headerLookups[t]=r?r[1]:void 0}return e._headerLookups[t]},match_header:function(e,t){for(var r=e.headers,s=r.length;s--;)if(t.test(r[s].join(" ")))return r[s];return!1},getContentURL:function(e,t,r){return t===e.request?t="request":t===e.response&&(t="response"),"./flows/"+e.id+"/"+t+"/"+(r?"content/"+r+".json":"content.data")}},RequestUtils=exports.RequestUtils=_lodash2.default.extend(MessageUtils,{pretty_url:function(e){var t="";return defaultPorts[e.scheme]!==e.port&&(t=":"+e.port),e.scheme+"://"+e.pretty_host+t+e.path}}),ResponseUtils=exports.ResponseUtils=_lodash2.default.extend(MessageUtils,{}),parseUrl_regex=/^(?:(https?):\/\/)?([^\/:]+)?(?::(\d+))?(\/.*)?$/i,parseUrl=exports.parseUrl=function(e){var t=parseUrl_regex.exec(e);if(!t)return!1;var r=t[1],s=t[2],o=parseInt(t[3]),a=t[4];r&&(o=o||defaultPorts[r]);var i={};return r&&(i.scheme=r),s&&(i.host=s),o&&(i.port=o),a&&(i.path=a),i},isValidHttpVersion_regex=/^HTTP\/\d+(\.\d+)*$/i,isValidHttpVersion=exports.isValidHttpVersion=function(e){return isValidHttpVersion_regex.test(e)};
- _createClass(_class, [{
- key: 'shouldComponentUpdate',
- value: function shouldComponentUpdate(nextProps) {
- return !(0, _shallowequal2.default)(this.props, nextProps);
- }
- }, {
- key: 'render',
- value: function render() {
- return renderFn(this.props);
- }
- }]);
+},{"lodash":"lodash"}],70:[function(require,module,exports){
+"use strict";function _defineProperty(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function updateStoreFromUrl(e){var r=window.location.hash.substr(1).split("?",2),t=_slicedToArray(r,2),o=t[0],i=t[1],l=o.substr(1).split("/");if("flows"===l[0]&&3==l.length){var n=l.slice(1),a=_slicedToArray(n,2),s=a[0],u=a[1];e.dispatch((0,_flows.select)(s)),e.dispatch((0,_flow.selectTab)(u))}i&&i.split("&").forEach(function(r){var t=r.split("=",2),o=_slicedToArray(t,2),i=o[0],l=o[1];switch(i){case Query.SEARCH:e.dispatch((0,_flows.setFilter)(l));break;case Query.HIGHLIGHT:e.dispatch((0,_flows.setHighlight)(l));break;case Query.SHOW_EVENTLOG:e.getState().eventLog.visible||e.dispatch((0,_eventLog.toggleVisibility)());break;default:console.error("unimplemented query arg: "+r)}})}function updateUrlFromStore(e){var r,t=e.getState(),o=(r={},_defineProperty(r,Query.SEARCH,t.flows.filter),_defineProperty(r,Query.HIGHLIGHT,t.flows.highlight),_defineProperty(r,Query.SHOW_EVENTLOG,t.eventLog.visible),r),i=Object.keys(o).filter(function(e){return o[e]}).map(function(e){return e+"="+o[e]}).join("&"),l=void 0;l=t.flows.selected.length>0?"/flows/"+t.flows.selected[0]+"/"+t.ui.flow.tab:"/flows",i&&(l+="?"+i);var n=window.location.pathname;"blank"===n&&(n="/"),window.location.hash.substr(1)!==l&&history.replaceState(void 0,"",n+"#"+l)}function initialize(e){updateStoreFromUrl(e),e.subscribe(function(){return updateUrlFromStore(e)})}Object.defineProperty(exports,"__esModule",{value:!0});var _slicedToArray=function(){function e(e,r){var t=[],o=!0,i=!1,l=void 0;try{for(var n,a=e[Symbol.iterator]();!(o=(n=a.next()).done)&&(t.push(n.value),!r||t.length!==r);o=!0);}catch(e){i=!0,l=e}finally{try{!o&&a.return&&a.return()}finally{if(i)throw l}}return t}return function(r,t){if(Array.isArray(r))return r;if(Symbol.iterator in Object(r))return e(r,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();exports.updateStoreFromUrl=updateStoreFromUrl,exports.updateUrlFromStore=updateUrlFromStore,exports.default=initialize;var _flows=require("./ducks/flows"),_flow=require("./ducks/ui/flow"),_eventLog=require("./ducks/eventLog"),Query={SEARCH:"s",HIGHLIGHT:"h",SHOW_EVENTLOG:"e"};
- return _class;
- }(_react2.default.Component), _class.displayName = renderFn.name, _temp;
-};
+},{"./ducks/eventLog":56,"./ducks/flows":57,"./ducks/ui/flow":61}],71:[function(require,module,exports){
+"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function reverseString(e){return String.fromCharCode.apply(String,_lodash2.default.map(e.split(""),function(e){return 65535-e.charCodeAt(0)}))+end}function getCookie(e){var t=document.cookie.match(new RegExp("\\b"+e+"=([^;]*)\\b"));return t?t[1]:void 0}function fetchApi(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e+=t.method&&"GET"!==t.method?e.indexOf("?")===-1?"?"+xsrf:"&"+xsrf:".json",e.startsWith("/")&&(e="."+e),fetch(e,_extends({credentials:"same-origin"},t))}function getDiff(e,t){var r=_extends({},t);for(var o in e)_lodash2.default.isEqual(t[o],e[o])?r[o]=void 0:"[object Object]"===Object.prototype.toString.call(t[o])&&"[object Object]"===Object.prototype.toString.call(e[o])&&(r[o]=getDiff(e[o],t[o]));return r}Object.defineProperty(exports,"__esModule",{value:!0}),exports.pure=exports.formatTimeStamp=exports.formatTimeDelta=exports.formatSize=exports.Key=void 0;var _createClass=function(){function e(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,r,o){return r&&e(t.prototype,r),o&&e(t,o),t}}(),_extends=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e};exports.reverseString=reverseString,exports.fetchApi=fetchApi,exports.getDiff=getDiff;var _lodash=require("lodash"),_lodash2=_interopRequireDefault(_lodash),_react=require("react"),_react2=_interopRequireDefault(_react),_shallowequal=require("shallowequal"),_shallowequal2=_interopRequireDefault(_shallowequal);window._=_lodash2.default,window.React=_react2.default;for(var Key=exports.Key={UP:38,DOWN:40,PAGE_UP:33,PAGE_DOWN:34,HOME:36,END:35,LEFT:37,RIGHT:39,ENTER:13,ESC:27,TAB:9,SPACE:32,BACKSPACE:8,SHIFT:16},i=65;i<=90;i++)Key[String.fromCharCode(i)]=i;var formatSize=exports.formatSize=function(e){if(0===e)return"0";for(var t=["b","kb","mb","gb","tb"],r=0;r<t.length&&!(Math.pow(1024,r+1)>e);r++);var o;return o=e%Math.pow(1024,r)===0?0:1,(e/Math.pow(1024,r)).toFixed(o)+t[r]},formatTimeDelta=exports.formatTimeDelta=function(e){for(var t=e,r=["ms","s","min","h"],o=[1e3,60,60],n=0;Math.abs(t)>=o[n]&&n<o.length;)t/=o[n],n++;return Math.round(t)+r[n]},formatTimeStamp=exports.formatTimeStamp=function(e){var t=new Date(1e3*e).toISOString();return t.replace("T"," ").replace("Z","")},end=String.fromCharCode(65535),xsrf="_xsrf="+getCookie("_xsrf");fetchApi.put=function(e,t,r){return fetchApi(e,_extends({method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)},r))};var pure=exports.pure=function(e){var t,r;return r=t=function(t){function r(){return _classCallCheck(this,r),_possibleConstructorReturn(this,(r.__proto__||Object.getPrototypeOf(r)).apply(this,arguments))}return _inherits(r,t),_createClass(r,[{key:"shouldComponentUpdate",value:function(e){return!(0,_shallowequal2.default)(this.props,e)}},{key:"render",value:function(){return e(this.props)}}]),r}(_react2.default.Component),t.displayName=e.name,r};
-},{"lodash":"lodash","react":"react","shallowequal":"shallowequal"}]},{},[2])
+},{"lodash":"lodash","react":"react","shallowequal":"shallowequal"}]},{},[1])
//# sourceMappingURL=app.js.map
diff --git a/mitmproxy/tools/web/static/vendor.css b/mitmproxy/tools/web/static/vendor.css
index 4826b4c3..afebfc21 100644
--- a/mitmproxy/tools/web/static/vendor.css
+++ b/mitmproxy/tools/web/static/vendor.css
@@ -1,8394 +1,5 @@
-/*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */
-html {
- font-family: sans-serif;
- -ms-text-size-adjust: 100%;
- -webkit-text-size-adjust: 100%;
-}
-body {
- margin: 0;
-}
-article,
-aside,
-details,
-figcaption,
-figure,
-footer,
-header,
-hgroup,
-main,
-menu,
-nav,
-section,
-summary {
- display: block;
-}
-audio,
-canvas,
-progress,
-video {
- display: inline-block;
- vertical-align: baseline;
-}
-audio:not([controls]) {
- display: none;
- height: 0;
-}
-[hidden],
-template {
- display: none;
-}
-a {
- background-color: transparent;
-}
-a:active,
-a:hover {
- outline: 0;
-}
-abbr[title] {
- border-bottom: 1px dotted;
-}
-b,
-strong {
- font-weight: bold;
-}
-dfn {
- font-style: italic;
-}
-h1 {
- font-size: 2em;
- margin: 0.67em 0;
-}
-mark {
- background: #ff0;
- color: #000;
-}
-small {
- font-size: 80%;
-}
-sub,
-sup {
- font-size: 75%;
- line-height: 0;
- position: relative;
- vertical-align: baseline;
-}
-sup {
- top: -0.5em;
-}
-sub {
- bottom: -0.25em;
-}
-img {
- border: 0;
-}
-svg:not(:root) {
- overflow: hidden;
-}
-figure {
- margin: 1em 40px;
-}
-hr {
- box-sizing: content-box;
- height: 0;
-}
-pre {
- overflow: auto;
-}
-code,
-kbd,
-pre,
-samp {
- font-family: monospace, monospace;
- font-size: 1em;
-}
-button,
-input,
-optgroup,
-select,
-textarea {
- color: inherit;
- font: inherit;
- margin: 0;
-}
-button {
- overflow: visible;
-}
-button,
-select {
- text-transform: none;
-}
-button,
-html input[type="button"],
-input[type="reset"],
-input[type="submit"] {
- -webkit-appearance: button;
- cursor: pointer;
-}
-button[disabled],
-html input[disabled] {
- cursor: default;
-}
-button::-moz-focus-inner,
-input::-moz-focus-inner {
- border: 0;
- padding: 0;
-}
-input {
- line-height: normal;
-}
-input[type="checkbox"],
-input[type="radio"] {
- box-sizing: border-box;
- padding: 0;
-}
-input[type="number"]::-webkit-inner-spin-button,
-input[type="number"]::-webkit-outer-spin-button {
- height: auto;
-}
-input[type="search"] {
- -webkit-appearance: textfield;
- box-sizing: content-box;
-}
-input[type="search"]::-webkit-search-cancel-button,
-input[type="search"]::-webkit-search-decoration {
- -webkit-appearance: none;
-}
-fieldset {
- border: 1px solid #c0c0c0;
- margin: 0 2px;
- padding: 0.35em 0.625em 0.75em;
-}
-legend {
- border: 0;
- padding: 0;
-}
-textarea {
- overflow: auto;
-}
-optgroup {
- font-weight: bold;
-}
-table {
- border-collapse: collapse;
- border-spacing: 0;
-}
-td,
-th {
- padding: 0;
-}
-/*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */
-@media print {
- *,
- *:before,
- *:after {
- background: transparent !important;
- color: #000 !important;
- box-shadow: none !important;
- text-shadow: none !important;
- }
- a,
- a:visited {
- text-decoration: underline;
- }
- a[href]:after {
- content: " (" attr(href) ")";
- }
- abbr[title]:after {
- content: " (" attr(title) ")";
- }
- a[href^="#"]:after,
- a[href^="javascript:"]:after {
- content: "";
- }
- pre,
- blockquote {
- border: 1px solid #999;
- page-break-inside: avoid;
- }
- thead {
- display: table-header-group;
- }
- tr,
- img {
- page-break-inside: avoid;
- }
- img {
- max-width: 100% !important;
- }
- p,
- h2,
- h3 {
- orphans: 3;
- widows: 3;
- }
- h2,
- h3 {
- page-break-after: avoid;
- }
- .navbar {
- display: none;
- }
- .btn > .caret,
- .dropup > .btn > .caret {
- border-top-color: #000 !important;
- }
- .label {
- border: 1px solid #000;
- }
- .table {
- border-collapse: collapse !important;
- }
- .table td,
- .table th {
- background-color: #fff !important;
- }
- .table-bordered th,
- .table-bordered td {
- border: 1px solid #ddd !important;
- }
-}
-@font-face {
- font-family: 'Glyphicons Halflings';
- src: url('../fonts/glyphicons-halflings-regular.eot');
- src: url('../fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'), url('../fonts/glyphicons-halflings-regular.woff2') format('woff2'), url('../fonts/glyphicons-halflings-regular.woff') format('woff'), url('../fonts/glyphicons-halflings-regular.ttf') format('truetype'), url('../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular') format('svg');
-}
-.glyphicon {
- position: relative;
- top: 1px;
- display: inline-block;
- font-family: 'Glyphicons Halflings';
- font-style: normal;
- font-weight: normal;
- line-height: 1;
- -webkit-font-smoothing: antialiased;
- -moz-osx-font-smoothing: grayscale;
-}
-.glyphicon-asterisk:before {
- content: "\002a";
-}
-.glyphicon-plus:before {
- content: "\002b";
-}
-.glyphicon-euro:before,
-.glyphicon-eur:before {
- content: "\20ac";
-}
-.glyphicon-minus:before {
- content: "\2212";
-}
-.glyphicon-cloud:before {
- content: "\2601";
-}
-.glyphicon-envelope:before {
- content: "\2709";
-}
-.glyphicon-pencil:before {
- content: "\270f";
-}
-.glyphicon-glass:before {
- content: "\e001";
-}
-.glyphicon-music:before {
- content: "\e002";
-}
-.glyphicon-search:before {
- content: "\e003";
-}
-.glyphicon-heart:before {
- content: "\e005";
-}
-.glyphicon-star:before {
- content: "\e006";
-}
-.glyphicon-star-empty:before {
- content: "\e007";
-}
-.glyphicon-user:before {
- content: "\e008";
-}
-.glyphicon-film:before {
- content: "\e009";
-}
-.glyphicon-th-large:before {
- content: "\e010";
-}
-.glyphicon-th:before {
- content: "\e011";
-}
-.glyphicon-th-list:before {
- content: "\e012";
-}
-.glyphicon-ok:before {
- content: "\e013";
-}
-.glyphicon-remove:before {
- content: "\e014";
-}
-.glyphicon-zoom-in:before {
- content: "\e015";
-}
-.glyphicon-zoom-out:before {
- content: "\e016";
-}
-.glyphicon-off:before {
- content: "\e017";
-}
-.glyphicon-signal:before {
- content: "\e018";
-}
-.glyphicon-cog:before {
- content: "\e019";
-}
-.glyphicon-trash:before {
- content: "\e020";
-}
-.glyphicon-home:before {
- content: "\e021";
-}
-.glyphicon-file:before {
- content: "\e022";
-}
-.glyphicon-time:before {
- content: "\e023";
-}
-.glyphicon-road:before {
- content: "\e024";
-}
-.glyphicon-download-alt:before {
- content: "\e025";
-}
-.glyphicon-download:before {
- content: "\e026";
-}
-.glyphicon-upload:before {
- content: "\e027";
-}
-.glyphicon-inbox:before {
- content: "\e028";
-}
-.glyphicon-play-circle:before {
- content: "\e029";
-}
-.glyphicon-repeat:before {
- content: "\e030";
-}
-.glyphicon-refresh:before {
- content: "\e031";
-}
-.glyphicon-list-alt:before {
- content: "\e032";
-}
-.glyphicon-lock:before {
- content: "\e033";
-}
-.glyphicon-flag:before {
- content: "\e034";
-}
-.glyphicon-headphones:before {
- content: "\e035";
-}
-.glyphicon-volume-off:before {
- content: "\e036";
-}
-.glyphicon-volume-down:before {
- content: "\e037";
-}
-.glyphicon-volume-up:before {
- content: "\e038";
-}
-.glyphicon-qrcode:before {
- content: "\e039";
-}
-.glyphicon-barcode:before {
- content: "\e040";
-}
-.glyphicon-tag:before {
- content: "\e041";
-}
-.glyphicon-tags:before {
- content: "\e042";
-}
-.glyphicon-book:before {
- content: "\e043";
-}
-.glyphicon-bookmark:before {
- content: "\e044";
-}
-.glyphicon-print:before {
- content: "\e045";
-}
-.glyphicon-camera:before {
- content: "\e046";
-}
-.glyphicon-font:before {
- content: "\e047";
-}
-.glyphicon-bold:before {
- content: "\e048";
-}
-.glyphicon-italic:before {
- content: "\e049";
-}
-.glyphicon-text-height:before {
- content: "\e050";
-}
-.glyphicon-text-width:before {
- content: "\e051";
-}
-.glyphicon-align-left:before {
- content: "\e052";
-}
-.glyphicon-align-center:before {
- content: "\e053";
-}
-.glyphicon-align-right:before {
- content: "\e054";
-}
-.glyphicon-align-justify:before {
- content: "\e055";
-}
-.glyphicon-list:before {
- content: "\e056";
-}
-.glyphicon-indent-left:before {
- content: "\e057";
-}
-.glyphicon-indent-right:before {
- content: "\e058";
-}
-.glyphicon-facetime-video:before {
- content: "\e059";
-}
-.glyphicon-picture:before {
- content: "\e060";
-}
-.glyphicon-map-marker:before {
- content: "\e062";
-}
-.glyphicon-adjust:before {
- content: "\e063";
-}
-.glyphicon-tint:before {
- content: "\e064";
-}
-.glyphicon-edit:before {
- content: "\e065";
-}
-.glyphicon-share:before {
- content: "\e066";
-}
-.glyphicon-check:before {
- content: "\e067";
-}
-.glyphicon-move:before {
- content: "\e068";
-}
-.glyphicon-step-backward:before {
- content: "\e069";
-}
-.glyphicon-fast-backward:before {
- content: "\e070";
-}
-.glyphicon-backward:before {
- content: "\e071";
-}
-.glyphicon-play:before {
- content: "\e072";
-}
-.glyphicon-pause:before {
- content: "\e073";
-}
-.glyphicon-stop:before {
- content: "\e074";
-}
-.glyphicon-forward:before {
- content: "\e075";
-}
-.glyphicon-fast-forward:before {
- content: "\e076";
-}
-.glyphicon-step-forward:before {
- content: "\e077";
-}
-.glyphicon-eject:before {
- content: "\e078";
-}
-.glyphicon-chevron-left:before {
- content: "\e079";
-}
-.glyphicon-chevron-right:before {
- content: "\e080";
-}
-.glyphicon-plus-sign:before {
- content: "\e081";
-}
-.glyphicon-minus-sign:before {
- content: "\e082";
-}
-.glyphicon-remove-sign:before {
- content: "\e083";
-}
-.glyphicon-ok-sign:before {
- content: "\e084";
-}
-.glyphicon-question-sign:before {
- content: "\e085";
-}
-.glyphicon-info-sign:before {
- content: "\e086";
-}
-.glyphicon-screenshot:before {
- content: "\e087";
-}
-.glyphicon-remove-circle:before {
- content: "\e088";
-}
-.glyphicon-ok-circle:before {
- content: "\e089";
-}
-.glyphicon-ban-circle:before {
- content: "\e090";
-}
-.glyphicon-arrow-left:before {
- content: "\e091";
-}
-.glyphicon-arrow-right:before {
- content: "\e092";
-}
-.glyphicon-arrow-up:before {
- content: "\e093";
-}
-.glyphicon-arrow-down:before {
- content: "\e094";
-}
-.glyphicon-share-alt:before {
- content: "\e095";
-}
-.glyphicon-resize-full:before {
- content: "\e096";
-}
-.glyphicon-resize-small:before {
- content: "\e097";
-}
-.glyphicon-exclamation-sign:before {
- content: "\e101";
-}
-.glyphicon-gift:before {
- content: "\e102";
-}
-.glyphicon-leaf:before {
- content: "\e103";
-}
-.glyphicon-fire:before {
- content: "\e104";
-}
-.glyphicon-eye-open:before {
- content: "\e105";
-}
-.glyphicon-eye-close:before {
- content: "\e106";
-}
-.glyphicon-warning-sign:before {
- content: "\e107";
-}
-.glyphicon-plane:before {
- content: "\e108";
-}
-.glyphicon-calendar:before {
- content: "\e109";
-}
-.glyphicon-random:before {
- content: "\e110";
-}
-.glyphicon-comment:before {
- content: "\e111";
-}
-.glyphicon-magnet:before {
- content: "\e112";
-}
-.glyphicon-chevron-up:before {
- content: "\e113";
-}
-.glyphicon-chevron-down:before {
- content: "\e114";
-}
-.glyphicon-retweet:before {
- content: "\e115";
-}
-.glyphicon-shopping-cart:before {
- content: "\e116";
-}
-.glyphicon-folder-close:before {
- content: "\e117";
-}
-.glyphicon-folder-open:before {
- content: "\e118";
-}
-.glyphicon-resize-vertical:before {
- content: "\e119";
-}
-.glyphicon-resize-horizontal:before {
- content: "\e120";
-}
-.glyphicon-hdd:before {
- content: "\e121";
-}
-.glyphicon-bullhorn:before {
- content: "\e122";
-}
-.glyphicon-bell:before {
- content: "\e123";
-}
-.glyphicon-certificate:before {
- content: "\e124";
-}
-.glyphicon-thumbs-up:before {
- content: "\e125";
-}
-.glyphicon-thumbs-down:before {
- content: "\e126";
-}
-.glyphicon-hand-right:before {
- content: "\e127";
-}
-.glyphicon-hand-left:before {
- content: "\e128";
-}
-.glyphicon-hand-up:before {
- content: "\e129";
-}
-.glyphicon-hand-down:before {
- content: "\e130";
-}
-.glyphicon-circle-arrow-right:before {
- content: "\e131";
-}
-.glyphicon-circle-arrow-left:before {
- content: "\e132";
-}
-.glyphicon-circle-arrow-up:before {
- content: "\e133";
-}
-.glyphicon-circle-arrow-down:before {
- content: "\e134";
-}
-.glyphicon-globe:before {
- content: "\e135";
-}
-.glyphicon-wrench:before {
- content: "\e136";
-}
-.glyphicon-tasks:before {
- content: "\e137";
-}
-.glyphicon-filter:before {
- content: "\e138";
-}
-.glyphicon-briefcase:before {
- content: "\e139";
-}
-.glyphicon-fullscreen:before {
- content: "\e140";
-}
-.glyphicon-dashboard:before {
- content: "\e141";
-}
-.glyphicon-paperclip:before {
- content: "\e142";
-}
-.glyphicon-heart-empty:before {
- content: "\e143";
-}
-.glyphicon-link:before {
- content: "\e144";
-}
-.glyphicon-phone:before {
- content: "\e145";
-}
-.glyphicon-pushpin:before {
- content: "\e146";
-}
-.glyphicon-usd:before {
- content: "\e148";
-}
-.glyphicon-gbp:before {
- content: "\e149";
-}
-.glyphicon-sort:before {
- content: "\e150";
-}
-.glyphicon-sort-by-alphabet:before {
- content: "\e151";
-}
-.glyphicon-sort-by-alphabet-alt:before {
- content: "\e152";
-}
-.glyphicon-sort-by-order:before {
- content: "\e153";
-}
-.glyphicon-sort-by-order-alt:before {
- content: "\e154";
-}
-.glyphicon-sort-by-attributes:before {
- content: "\e155";
-}
-.glyphicon-sort-by-attributes-alt:before {
- content: "\e156";
-}
-.glyphicon-unchecked:before {
- content: "\e157";
-}
-.glyphicon-expand:before {
- content: "\e158";
-}
-.glyphicon-collapse-down:before {
- content: "\e159";
-}
-.glyphicon-collapse-up:before {
- content: "\e160";
-}
-.glyphicon-log-in:before {
- content: "\e161";
-}
-.glyphicon-flash:before {
- content: "\e162";
-}
-.glyphicon-log-out:before {
- content: "\e163";
-}
-.glyphicon-new-window:before {
- content: "\e164";
-}
-.glyphicon-record:before {
- content: "\e165";
-}
-.glyphicon-save:before {
- content: "\e166";
-}
-.glyphicon-open:before {
- content: "\e167";
-}
-.glyphicon-saved:before {
- content: "\e168";
-}
-.glyphicon-import:before {
- content: "\e169";
-}
-.glyphicon-export:before {
- content: "\e170";
-}
-.glyphicon-send:before {
- content: "\e171";
-}
-.glyphicon-floppy-disk:before {
- content: "\e172";
-}
-.glyphicon-floppy-saved:before {
- content: "\e173";
-}
-.glyphicon-floppy-remove:before {
- content: "\e174";
-}
-.glyphicon-floppy-save:before {
- content: "\e175";
-}
-.glyphicon-floppy-open:before {
- content: "\e176";
-}
-.glyphicon-credit-card:before {
- content: "\e177";
-}
-.glyphicon-transfer:before {
- content: "\e178";
-}
-.glyphicon-cutlery:before {
- content: "\e179";
-}
-.glyphicon-header:before {
- content: "\e180";
-}
-.glyphicon-compressed:before {
- content: "\e181";
-}
-.glyphicon-earphone:before {
- content: "\e182";
-}
-.glyphicon-phone-alt:before {
- content: "\e183";
-}
-.glyphicon-tower:before {
- content: "\e184";
-}
-.glyphicon-stats:before {
- content: "\e185";
-}
-.glyphicon-sd-video:before {
- content: "\e186";
-}
-.glyphicon-hd-video:before {
- content: "\e187";
-}
-.glyphicon-subtitles:before {
- content: "\e188";
-}
-.glyphicon-sound-stereo:before {
- content: "\e189";
-}
-.glyphicon-sound-dolby:before {
- content: "\e190";
-}
-.glyphicon-sound-5-1:before {
- content: "\e191";
-}
-.glyphicon-sound-6-1:before {
- content: "\e192";
-}
-.glyphicon-sound-7-1:before {
- content: "\e193";
-}
-.glyphicon-copyright-mark:before {
- content: "\e194";
-}
-.glyphicon-registration-mark:before {
- content: "\e195";
-}
-.glyphicon-cloud-download:before {
- content: "\e197";
-}
-.glyphicon-cloud-upload:before {
- content: "\e198";
-}
-.glyphicon-tree-conifer:before {
- content: "\e199";
-}
-.glyphicon-tree-deciduous:before {
- content: "\e200";
-}
-.glyphicon-cd:before {
- content: "\e201";
-}
-.glyphicon-save-file:before {
- content: "\e202";
-}
-.glyphicon-open-file:before {
- content: "\e203";
-}
-.glyphicon-level-up:before {
- content: "\e204";
-}
-.glyphicon-copy:before {
- content: "\e205";
-}
-.glyphicon-paste:before {
- content: "\e206";
-}
-.glyphicon-alert:before {
- content: "\e209";
-}
-.glyphicon-equalizer:before {
- content: "\e210";
-}
-.glyphicon-king:before {
- content: "\e211";
-}
-.glyphicon-queen:before {
- content: "\e212";
-}
-.glyphicon-pawn:before {
- content: "\e213";
-}
-.glyphicon-bishop:before {
- content: "\e214";
-}
-.glyphicon-knight:before {
- content: "\e215";
-}
-.glyphicon-baby-formula:before {
- content: "\e216";
-}
-.glyphicon-tent:before {
- content: "\26fa";
-}
-.glyphicon-blackboard:before {
- content: "\e218";
-}
-.glyphicon-bed:before {
- content: "\e219";
-}
-.glyphicon-apple:before {
- content: "\f8ff";
-}
-.glyphicon-erase:before {
- content: "\e221";
-}
-.glyphicon-hourglass:before {
- content: "\231b";
-}
-.glyphicon-lamp:before {
- content: "\e223";
-}
-.glyphicon-duplicate:before {
- content: "\e224";
-}
-.glyphicon-piggy-bank:before {
- content: "\e225";
-}
-.glyphicon-scissors:before {
- content: "\e226";
-}
-.glyphicon-bitcoin:before {
- content: "\e227";
-}
-.glyphicon-btc:before {
- content: "\e227";
-}
-.glyphicon-xbt:before {
- content: "\e227";
-}
-.glyphicon-yen:before {
- content: "\00a5";
-}
-.glyphicon-jpy:before {
- content: "\00a5";
-}
-.glyphicon-ruble:before {
- content: "\20bd";
-}
-.glyphicon-rub:before {
- content: "\20bd";
-}
-.glyphicon-scale:before {
- content: "\e230";
-}
-.glyphicon-ice-lolly:before {
- content: "\e231";
-}
-.glyphicon-ice-lolly-tasted:before {
- content: "\e232";
-}
-.glyphicon-education:before {
- content: "\e233";
-}
-.glyphicon-option-horizontal:before {
- content: "\e234";
-}
-.glyphicon-option-vertical:before {
- content: "\e235";
-}
-.glyphicon-menu-hamburger:before {
- content: "\e236";
-}
-.glyphicon-modal-window:before {
- content: "\e237";
-}
-.glyphicon-oil:before {
- content: "\e238";
-}
-.glyphicon-grain:before {
- content: "\e239";
-}
-.glyphicon-sunglasses:before {
- content: "\e240";
-}
-.glyphicon-text-size:before {
- content: "\e241";
-}
-.glyphicon-text-color:before {
- content: "\e242";
-}
-.glyphicon-text-background:before {
- content: "\e243";
-}
-.glyphicon-object-align-top:before {
- content: "\e244";
-}
-.glyphicon-object-align-bottom:before {
- content: "\e245";
-}
-.glyphicon-object-align-horizontal:before {
- content: "\e246";
-}
-.glyphicon-object-align-left:before {
- content: "\e247";
-}
-.glyphicon-object-align-vertical:before {
- content: "\e248";
-}
-.glyphicon-object-align-right:before {
- content: "\e249";
-}
-.glyphicon-triangle-right:before {
- content: "\e250";
-}
-.glyphicon-triangle-left:before {
- content: "\e251";
-}
-.glyphicon-triangle-bottom:before {
- content: "\e252";
-}
-.glyphicon-triangle-top:before {
- content: "\e253";
-}
-.glyphicon-console:before {
- content: "\e254";
-}
-.glyphicon-superscript:before {
- content: "\e255";
-}
-.glyphicon-subscript:before {
- content: "\e256";
-}
-.glyphicon-menu-left:before {
- content: "\e257";
-}
-.glyphicon-menu-right:before {
- content: "\e258";
-}
-.glyphicon-menu-down:before {
- content: "\e259";
-}
-.glyphicon-menu-up:before {
- content: "\e260";
-}
-* {
- -webkit-box-sizing: border-box;
- -moz-box-sizing: border-box;
- box-sizing: border-box;
-}
-*:before,
-*:after {
- -webkit-box-sizing: border-box;
- -moz-box-sizing: border-box;
- box-sizing: border-box;
-}
-html {
- font-size: 10px;
- -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
-}
-body {
- font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
- font-size: 14px;
- line-height: 1.42857143;
- color: #333333;
- background-color: #fff;
-}
-input,
-button,
-select,
-textarea {
- font-family: inherit;
- font-size: inherit;
- line-height: inherit;
-}
-a {
- color: #337ab7;
- text-decoration: none;
-}
-a:hover,
-a:focus {
- color: #23527c;
- text-decoration: underline;
-}
-a:focus {
- outline: 5px auto -webkit-focus-ring-color;
- outline-offset: -2px;
-}
-figure {
- margin: 0;
-}
-img {
- vertical-align: middle;
-}
-.img-responsive,
-.thumbnail > img,
-.thumbnail a > img,
-.carousel-inner > .item > img,
-.carousel-inner > .item > a > img {
- display: block;
- max-width: 100%;
- height: auto;
-}
-.img-rounded {
- border-radius: 6px;
-}
-.img-thumbnail {
- padding: 4px;
- line-height: 1.42857143;
- background-color: #fff;
- border: 1px solid #ddd;
- border-radius: 4px;
- -webkit-transition: all 0.2s ease-in-out;
- -o-transition: all 0.2s ease-in-out;
- transition: all 0.2s ease-in-out;
- display: inline-block;
- max-width: 100%;
- height: auto;
-}
-.img-circle {
- border-radius: 50%;
-}
-hr {
- margin-top: 20px;
- margin-bottom: 20px;
- border: 0;
- border-top: 1px solid #eeeeee;
-}
-.sr-only {
- position: absolute;
- width: 1px;
- height: 1px;
- margin: -1px;
- padding: 0;
- overflow: hidden;
- clip: rect(0, 0, 0, 0);
- border: 0;
-}
-.sr-only-focusable:active,
-.sr-only-focusable:focus {
- position: static;
- width: auto;
- height: auto;
- margin: 0;
- overflow: visible;
- clip: auto;
-}
-[role="button"] {
- cursor: pointer;
-}
-h1,
-h2,
-h3,
-h4,
-h5,
-h6,
-.h1,
-.h2,
-.h3,
-.h4,
-.h5,
-.h6 {
- font-family: inherit;
- font-weight: 500;
- line-height: 1.1;
- color: inherit;
-}
-h1 small,
-h2 small,
-h3 small,
-h4 small,
-h5 small,
-h6 small,
-.h1 small,
-.h2 small,
-.h3 small,
-.h4 small,
-.h5 small,
-.h6 small,
-h1 .small,
-h2 .small,
-h3 .small,
-h4 .small,
-h5 .small,
-h6 .small,
-.h1 .small,
-.h2 .small,
-.h3 .small,
-.h4 .small,
-.h5 .small,
-.h6 .small {
- font-weight: normal;
- line-height: 1;
- color: #777777;
-}
-h1,
-.h1,
-h2,
-.h2,
-h3,
-.h3 {
- margin-top: 20px;
- margin-bottom: 10px;
-}
-h1 small,
-.h1 small,
-h2 small,
-.h2 small,
-h3 small,
-.h3 small,
-h1 .small,
-.h1 .small,
-h2 .small,
-.h2 .small,
-h3 .small,
-.h3 .small {
- font-size: 65%;
-}
-h4,
-.h4,
-h5,
-.h5,
-h6,
-.h6 {
- margin-top: 10px;
- margin-bottom: 10px;
-}
-h4 small,
-.h4 small,
-h5 small,
-.h5 small,
-h6 small,
-.h6 small,
-h4 .small,
-.h4 .small,
-h5 .small,
-.h5 .small,
-h6 .small,
-.h6 .small {
- font-size: 75%;
-}
-h1,
-.h1 {
- font-size: 36px;
-}
-h2,
-.h2 {
- font-size: 30px;
-}
-h3,
-.h3 {
- font-size: 24px;
-}
-h4,
-.h4 {
- font-size: 18px;
-}
-h5,
-.h5 {
- font-size: 14px;
-}
-h6,
-.h6 {
- font-size: 12px;
-}
-p {
- margin: 0 0 10px;
-}
-.lead {
- margin-bottom: 20px;
- font-size: 16px;
- font-weight: 300;
- line-height: 1.4;
-}
-@media (min-width: 768px) {
- .lead {
- font-size: 21px;
- }
-}
-small,
-.small {
- font-size: 85%;
-}
-mark,
-.mark {
- background-color: #fcf8e3;
- padding: .2em;
-}
-.text-left {
- text-align: left;
-}
-.text-right {
- text-align: right;
-}
-.text-center {
- text-align: center;
-}
-.text-justify {
- text-align: justify;
-}
-.text-nowrap {
- white-space: nowrap;
-}
-.text-lowercase {
- text-transform: lowercase;
-}
-.text-uppercase {
- text-transform: uppercase;
-}
-.text-capitalize {
- text-transform: capitalize;
-}
-.text-muted {
- color: #777777;
-}
-.text-primary {
- color: #337ab7;
-}
-a.text-primary:hover,
-a.text-primary:focus {
- color: #286090;
-}
-.text-success {
- color: #3c763d;
-}
-a.text-success:hover,
-a.text-success:focus {
- color: #2b542c;
-}
-.text-info {
- color: #31708f;
-}
-a.text-info:hover,
-a.text-info:focus {
- color: #245269;
-}
-.text-warning {
- color: #8a6d3b;
-}
-a.text-warning:hover,
-a.text-warning:focus {
- color: #66512c;
-}
-.text-danger {
- color: #a94442;
-}
-a.text-danger:hover,
-a.text-danger:focus {
- color: #843534;
-}
-.bg-primary {
- color: #fff;
- background-color: #337ab7;
-}
-a.bg-primary:hover,
-a.bg-primary:focus {
- background-color: #286090;
-}
-.bg-success {
- background-color: #dff0d8;
-}
-a.bg-success:hover,
-a.bg-success:focus {
- background-color: #c1e2b3;
-}
-.bg-info {
- background-color: #d9edf7;
-}
-a.bg-info:hover,
-a.bg-info:focus {
- background-color: #afd9ee;
-}
-.bg-warning {
- background-color: #fcf8e3;
-}
-a.bg-warning:hover,
-a.bg-warning:focus {
- background-color: #f7ecb5;
-}
-.bg-danger {
- background-color: #f2dede;
-}
-a.bg-danger:hover,
-a.bg-danger:focus {
- background-color: #e4b9b9;
-}
-.page-header {
- padding-bottom: 9px;
- margin: 40px 0 20px;
- border-bottom: 1px solid #eeeeee;
-}
-ul,
-ol {
- margin-top: 0;
- margin-bottom: 10px;
-}
-ul ul,
-ol ul,
-ul ol,
-ol ol {
- margin-bottom: 0;
-}
-.list-unstyled {
- padding-left: 0;
- list-style: none;
-}
-.list-inline {
- padding-left: 0;
- list-style: none;
- margin-left: -5px;
-}
-.list-inline > li {
- display: inline-block;
- padding-left: 5px;
- padding-right: 5px;
-}
-dl {
- margin-top: 0;
- margin-bottom: 20px;
-}
-dt,
-dd {
- line-height: 1.42857143;
-}
-dt {
- font-weight: bold;
-}
-dd {
- margin-left: 0;
-}
-@media (min-width: 768px) {
- .dl-horizontal dt {
- float: left;
- width: 160px;
- clear: left;
- text-align: right;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- .dl-horizontal dd {
- margin-left: 180px;
- }
-}
-abbr[title],
-abbr[data-original-title] {
- cursor: help;
- border-bottom: 1px dotted #777777;
-}
-.initialism {
- font-size: 90%;
- text-transform: uppercase;
-}
-blockquote {
- padding: 10px 20px;
- margin: 0 0 20px;
- font-size: 17.5px;
- border-left: 5px solid #eeeeee;
-}
-blockquote p:last-child,
-blockquote ul:last-child,
-blockquote ol:last-child {
- margin-bottom: 0;
-}
-blockquote footer,
-blockquote small,
-blockquote .small {
- display: block;
- font-size: 80%;
- line-height: 1.42857143;
- color: #777777;
-}
-blockquote footer:before,
-blockquote small:before,
-blockquote .small:before {
- content: '\2014 \00A0';
-}
-.blockquote-reverse,
-blockquote.pull-right {
- padding-right: 15px;
- padding-left: 0;
- border-right: 5px solid #eeeeee;
- border-left: 0;
- text-align: right;
-}
-.blockquote-reverse footer:before,
-blockquote.pull-right footer:before,
-.blockquote-reverse small:before,
-blockquote.pull-right small:before,
-.blockquote-reverse .small:before,
-blockquote.pull-right .small:before {
- content: '';
-}
-.blockquote-reverse footer:after,
-blockquote.pull-right footer:after,
-.blockquote-reverse small:after,
-blockquote.pull-right small:after,
-.blockquote-reverse .small:after,
-blockquote.pull-right .small:after {
- content: '\00A0 \2014';
-}
-address {
- margin-bottom: 20px;
- font-style: normal;
- line-height: 1.42857143;
-}
-code,
-kbd,
-pre,
-samp {
- font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
-}
-code {
- padding: 2px 4px;
- font-size: 90%;
- color: #c7254e;
- background-color: #f9f2f4;
- border-radius: 4px;
-}
-kbd {
- padding: 2px 4px;
- font-size: 90%;
- color: #fff;
- background-color: #333;
- border-radius: 3px;
- box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.25);
-}
-kbd kbd {
- padding: 0;
- font-size: 100%;
- font-weight: bold;
- box-shadow: none;
-}
-pre {
- display: block;
- padding: 9.5px;
- margin: 0 0 10px;
- font-size: 13px;
- line-height: 1.42857143;
- word-break: break-all;
- word-wrap: break-word;
- color: #333333;
- background-color: #f5f5f5;
- border: 1px solid #ccc;
- border-radius: 4px;
-}
-pre code {
- padding: 0;
- font-size: inherit;
- color: inherit;
- white-space: pre-wrap;
- background-color: transparent;
- border-radius: 0;
-}
-.pre-scrollable {
- max-height: 340px;
- overflow-y: scroll;
-}
-.container {
- margin-right: auto;
- margin-left: auto;
- padding-left: 15px;
- padding-right: 15px;
-}
-@media (min-width: 768px) {
- .container {
- width: 750px;
- }
-}
-@media (min-width: 992px) {
- .container {
- width: 970px;
- }
-}
-@media (min-width: 1200px) {
- .container {
- width: 1170px;
- }
-}
-.container-fluid {
- margin-right: auto;
- margin-left: auto;
- padding-left: 15px;
- padding-right: 15px;
-}
-.row {
- margin-left: -15px;
- margin-right: -15px;
-}
-.col-xs-1, .col-sm-1, .col-md-1, .col-lg-1, .col-xs-2, .col-sm-2, .col-md-2, .col-lg-2, .col-xs-3, .col-sm-3, .col-md-3, .col-lg-3, .col-xs-4, .col-sm-4, .col-md-4, .col-lg-4, .col-xs-5, .col-sm-5, .col-md-5, .col-lg-5, .col-xs-6, .col-sm-6, .col-md-6, .col-lg-6, .col-xs-7, .col-sm-7, .col-md-7, .col-lg-7, .col-xs-8, .col-sm-8, .col-md-8, .col-lg-8, .col-xs-9, .col-sm-9, .col-md-9, .col-lg-9, .col-xs-10, .col-sm-10, .col-md-10, .col-lg-10, .col-xs-11, .col-sm-11, .col-md-11, .col-lg-11, .col-xs-12, .col-sm-12, .col-md-12, .col-lg-12 {
- position: relative;
- min-height: 1px;
- padding-left: 15px;
- padding-right: 15px;
-}
-.col-xs-1, .col-xs-2, .col-xs-3, .col-xs-4, .col-xs-5, .col-xs-6, .col-xs-7, .col-xs-8, .col-xs-9, .col-xs-10, .col-xs-11, .col-xs-12 {
- float: left;
-}
-.col-xs-12 {
- width: 100%;
-}
-.col-xs-11 {
- width: 91.66666667%;
-}
-.col-xs-10 {
- width: 83.33333333%;
-}
-.col-xs-9 {
- width: 75%;
-}
-.col-xs-8 {
- width: 66.66666667%;
-}
-.col-xs-7 {
- width: 58.33333333%;
-}
-.col-xs-6 {
- width: 50%;
-}
-.col-xs-5 {
- width: 41.66666667%;
-}
-.col-xs-4 {
- width: 33.33333333%;
-}
-.col-xs-3 {
- width: 25%;
-}
-.col-xs-2 {
- width: 16.66666667%;
-}
-.col-xs-1 {
- width: 8.33333333%;
-}
-.col-xs-pull-12 {
- right: 100%;
-}
-.col-xs-pull-11 {
- right: 91.66666667%;
-}
-.col-xs-pull-10 {
- right: 83.33333333%;
-}
-.col-xs-pull-9 {
- right: 75%;
-}
-.col-xs-pull-8 {
- right: 66.66666667%;
-}
-.col-xs-pull-7 {
- right: 58.33333333%;
-}
-.col-xs-pull-6 {
- right: 50%;
-}
-.col-xs-pull-5 {
- right: 41.66666667%;
-}
-.col-xs-pull-4 {
- right: 33.33333333%;
-}
-.col-xs-pull-3 {
- right: 25%;
-}
-.col-xs-pull-2 {
- right: 16.66666667%;
-}
-.col-xs-pull-1 {
- right: 8.33333333%;
-}
-.col-xs-pull-0 {
- right: auto;
-}
-.col-xs-push-12 {
- left: 100%;
-}
-.col-xs-push-11 {
- left: 91.66666667%;
-}
-.col-xs-push-10 {
- left: 83.33333333%;
-}
-.col-xs-push-9 {
- left: 75%;
-}
-.col-xs-push-8 {
- left: 66.66666667%;
-}
-.col-xs-push-7 {
- left: 58.33333333%;
-}
-.col-xs-push-6 {
- left: 50%;
-}
-.col-xs-push-5 {
- left: 41.66666667%;
-}
-.col-xs-push-4 {
- left: 33.33333333%;
-}
-.col-xs-push-3 {
- left: 25%;
-}
-.col-xs-push-2 {
- left: 16.66666667%;
-}
-.col-xs-push-1 {
- left: 8.33333333%;
-}
-.col-xs-push-0 {
- left: auto;
-}
-.col-xs-offset-12 {
- margin-left: 100%;
-}
-.col-xs-offset-11 {
- margin-left: 91.66666667%;
-}
-.col-xs-offset-10 {
- margin-left: 83.33333333%;
-}
-.col-xs-offset-9 {
- margin-left: 75%;
-}
-.col-xs-offset-8 {
- margin-left: 66.66666667%;
-}
-.col-xs-offset-7 {
- margin-left: 58.33333333%;
-}
-.col-xs-offset-6 {
- margin-left: 50%;
-}
-.col-xs-offset-5 {
- margin-left: 41.66666667%;
-}
-.col-xs-offset-4 {
- margin-left: 33.33333333%;
-}
-.col-xs-offset-3 {
- margin-left: 25%;
-}
-.col-xs-offset-2 {
- margin-left: 16.66666667%;
-}
-.col-xs-offset-1 {
- margin-left: 8.33333333%;
-}
-.col-xs-offset-0 {
- margin-left: 0%;
-}
-@media (min-width: 768px) {
- .col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-sm-10, .col-sm-11, .col-sm-12 {
- float: left;
- }
- .col-sm-12 {
- width: 100%;
- }
- .col-sm-11 {
- width: 91.66666667%;
- }
- .col-sm-10 {
- width: 83.33333333%;
- }
- .col-sm-9 {
- width: 75%;
- }
- .col-sm-8 {
- width: 66.66666667%;
- }
- .col-sm-7 {
- width: 58.33333333%;
- }
- .col-sm-6 {
- width: 50%;
- }
- .col-sm-5 {
- width: 41.66666667%;
- }
- .col-sm-4 {
- width: 33.33333333%;
- }
- .col-sm-3 {
- width: 25%;
- }
- .col-sm-2 {
- width: 16.66666667%;
- }
- .col-sm-1 {
- width: 8.33333333%;
- }
- .col-sm-pull-12 {
- right: 100%;
- }
- .col-sm-pull-11 {
- right: 91.66666667%;
- }
- .col-sm-pull-10 {
- right: 83.33333333%;
- }
- .col-sm-pull-9 {
- right: 75%;
- }
- .col-sm-pull-8 {
- right: 66.66666667%;
- }
- .col-sm-pull-7 {
- right: 58.33333333%;
- }
- .col-sm-pull-6 {
- right: 50%;
- }
- .col-sm-pull-5 {
- right: 41.66666667%;
- }
- .col-sm-pull-4 {
- right: 33.33333333%;
- }
- .col-sm-pull-3 {
- right: 25%;
- }
- .col-sm-pull-2 {
- right: 16.66666667%;
- }
- .col-sm-pull-1 {
- right: 8.33333333%;
- }
- .col-sm-pull-0 {
- right: auto;
- }
- .col-sm-push-12 {
- left: 100%;
- }
- .col-sm-push-11 {
- left: 91.66666667%;
- }
- .col-sm-push-10 {
- left: 83.33333333%;
- }
- .col-sm-push-9 {
- left: 75%;
- }
- .col-sm-push-8 {
- left: 66.66666667%;
- }
- .col-sm-push-7 {
- left: 58.33333333%;
- }
- .col-sm-push-6 {
- left: 50%;
- }
- .col-sm-push-5 {
- left: 41.66666667%;
- }
- .col-sm-push-4 {
- left: 33.33333333%;
- }
- .col-sm-push-3 {
- left: 25%;
- }
- .col-sm-push-2 {
- left: 16.66666667%;
- }
- .col-sm-push-1 {
- left: 8.33333333%;
- }
- .col-sm-push-0 {
- left: auto;
- }
- .col-sm-offset-12 {
- margin-left: 100%;
- }
- .col-sm-offset-11 {
- margin-left: 91.66666667%;
- }
- .col-sm-offset-10 {
- margin-left: 83.33333333%;
- }
- .col-sm-offset-9 {
- margin-left: 75%;
- }
- .col-sm-offset-8 {
- margin-left: 66.66666667%;
- }
- .col-sm-offset-7 {
- margin-left: 58.33333333%;
- }
- .col-sm-offset-6 {
- margin-left: 50%;
- }
- .col-sm-offset-5 {
- margin-left: 41.66666667%;
- }
- .col-sm-offset-4 {
- margin-left: 33.33333333%;
- }
- .col-sm-offset-3 {
- margin-left: 25%;
- }
- .col-sm-offset-2 {
- margin-left: 16.66666667%;
- }
- .col-sm-offset-1 {
- margin-left: 8.33333333%;
- }
- .col-sm-offset-0 {
- margin-left: 0%;
- }
-}
-@media (min-width: 992px) {
- .col-md-1, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9, .col-md-10, .col-md-11, .col-md-12 {
- float: left;
- }
- .col-md-12 {
- width: 100%;
- }
- .col-md-11 {
- width: 91.66666667%;
- }
- .col-md-10 {
- width: 83.33333333%;
- }
- .col-md-9 {
- width: 75%;
- }
- .col-md-8 {
- width: 66.66666667%;
- }
- .col-md-7 {
- width: 58.33333333%;
- }
- .col-md-6 {
- width: 50%;
- }
- .col-md-5 {
- width: 41.66666667%;
- }
- .col-md-4 {
- width: 33.33333333%;
- }
- .col-md-3 {
- width: 25%;
- }
- .col-md-2 {
- width: 16.66666667%;
- }
- .col-md-1 {
- width: 8.33333333%;
- }
- .col-md-pull-12 {
- right: 100%;
- }
- .col-md-pull-11 {
- right: 91.66666667%;
- }
- .col-md-pull-10 {
- right: 83.33333333%;
- }
- .col-md-pull-9 {
- right: 75%;
- }
- .col-md-pull-8 {
- right: 66.66666667%;
- }
- .col-md-pull-7 {
- right: 58.33333333%;
- }
- .col-md-pull-6 {
- right: 50%;
- }
- .col-md-pull-5 {
- right: 41.66666667%;
- }
- .col-md-pull-4 {
- right: 33.33333333%;
- }
- .col-md-pull-3 {
- right: 25%;
- }
- .col-md-pull-2 {
- right: 16.66666667%;
- }
- .col-md-pull-1 {
- right: 8.33333333%;
- }
- .col-md-pull-0 {
- right: auto;
- }
- .col-md-push-12 {
- left: 100%;
- }
- .col-md-push-11 {
- left: 91.66666667%;
- }
- .col-md-push-10 {
- left: 83.33333333%;
- }
- .col-md-push-9 {
- left: 75%;
- }
- .col-md-push-8 {
- left: 66.66666667%;
- }
- .col-md-push-7 {
- left: 58.33333333%;
- }
- .col-md-push-6 {
- left: 50%;
- }
- .col-md-push-5 {
- left: 41.66666667%;
- }
- .col-md-push-4 {
- left: 33.33333333%;
- }
- .col-md-push-3 {
- left: 25%;
- }
- .col-md-push-2 {
- left: 16.66666667%;
- }
- .col-md-push-1 {
- left: 8.33333333%;
- }
- .col-md-push-0 {
- left: auto;
- }
- .col-md-offset-12 {
- margin-left: 100%;
- }
- .col-md-offset-11 {
- margin-left: 91.66666667%;
- }
- .col-md-offset-10 {
- margin-left: 83.33333333%;
- }
- .col-md-offset-9 {
- margin-left: 75%;
- }
- .col-md-offset-8 {
- margin-left: 66.66666667%;
- }
- .col-md-offset-7 {
- margin-left: 58.33333333%;
- }
- .col-md-offset-6 {
- margin-left: 50%;
- }
- .col-md-offset-5 {
- margin-left: 41.66666667%;
- }
- .col-md-offset-4 {
- margin-left: 33.33333333%;
- }
- .col-md-offset-3 {
- margin-left: 25%;
- }
- .col-md-offset-2 {
- margin-left: 16.66666667%;
- }
- .col-md-offset-1 {
- margin-left: 8.33333333%;
- }
- .col-md-offset-0 {
- margin-left: 0%;
- }
-}
-@media (min-width: 1200px) {
- .col-lg-1, .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8, .col-lg-9, .col-lg-10, .col-lg-11, .col-lg-12 {
- float: left;
- }
- .col-lg-12 {
- width: 100%;
- }
- .col-lg-11 {
- width: 91.66666667%;
- }
- .col-lg-10 {
- width: 83.33333333%;
- }
- .col-lg-9 {
- width: 75%;
- }
- .col-lg-8 {
- width: 66.66666667%;
- }
- .col-lg-7 {
- width: 58.33333333%;
- }
- .col-lg-6 {
- width: 50%;
- }
- .col-lg-5 {
- width: 41.66666667%;
- }
- .col-lg-4 {
- width: 33.33333333%;
- }
- .col-lg-3 {
- width: 25%;
- }
- .col-lg-2 {
- width: 16.66666667%;
- }
- .col-lg-1 {
- width: 8.33333333%;
- }
- .col-lg-pull-12 {
- right: 100%;
- }
- .col-lg-pull-11 {
- right: 91.66666667%;
- }
- .col-lg-pull-10 {
- right: 83.33333333%;
- }
- .col-lg-pull-9 {
- right: 75%;
- }
- .col-lg-pull-8 {
- right: 66.66666667%;
- }
- .col-lg-pull-7 {
- right: 58.33333333%;
- }
- .col-lg-pull-6 {
- right: 50%;
- }
- .col-lg-pull-5 {
- right: 41.66666667%;
- }
- .col-lg-pull-4 {
- right: 33.33333333%;
- }
- .col-lg-pull-3 {
- right: 25%;
- }
- .col-lg-pull-2 {
- right: 16.66666667%;
- }
- .col-lg-pull-1 {
- right: 8.33333333%;
- }
- .col-lg-pull-0 {
- right: auto;
- }
- .col-lg-push-12 {
- left: 100%;
- }
- .col-lg-push-11 {
- left: 91.66666667%;
- }
- .col-lg-push-10 {
- left: 83.33333333%;
- }
- .col-lg-push-9 {
- left: 75%;
- }
- .col-lg-push-8 {
- left: 66.66666667%;
- }
- .col-lg-push-7 {
- left: 58.33333333%;
- }
- .col-lg-push-6 {
- left: 50%;
- }
- .col-lg-push-5 {
- left: 41.66666667%;
- }
- .col-lg-push-4 {
- left: 33.33333333%;
- }
- .col-lg-push-3 {
- left: 25%;
- }
- .col-lg-push-2 {
- left: 16.66666667%;
- }
- .col-lg-push-1 {
- left: 8.33333333%;
- }
- .col-lg-push-0 {
- left: auto;
- }
- .col-lg-offset-12 {
- margin-left: 100%;
- }
- .col-lg-offset-11 {
- margin-left: 91.66666667%;
- }
- .col-lg-offset-10 {
- margin-left: 83.33333333%;
- }
- .col-lg-offset-9 {
- margin-left: 75%;
- }
- .col-lg-offset-8 {
- margin-left: 66.66666667%;
- }
- .col-lg-offset-7 {
- margin-left: 58.33333333%;
- }
- .col-lg-offset-6 {
- margin-left: 50%;
- }
- .col-lg-offset-5 {
- margin-left: 41.66666667%;
- }
- .col-lg-offset-4 {
- margin-left: 33.33333333%;
- }
- .col-lg-offset-3 {
- margin-left: 25%;
- }
- .col-lg-offset-2 {
- margin-left: 16.66666667%;
- }
- .col-lg-offset-1 {
- margin-left: 8.33333333%;
- }
- .col-lg-offset-0 {
- margin-left: 0%;
- }
-}
-table {
- background-color: transparent;
-}
-caption {
- padding-top: 8px;
- padding-bottom: 8px;
- color: #777777;
- text-align: left;
-}
-th {
- text-align: left;
-}
-.table {
- width: 100%;
- max-width: 100%;
- margin-bottom: 20px;
-}
-.table > thead > tr > th,
-.table > tbody > tr > th,
-.table > tfoot > tr > th,
-.table > thead > tr > td,
-.table > tbody > tr > td,
-.table > tfoot > tr > td {
- padding: 8px;
- line-height: 1.42857143;
- vertical-align: top;
- border-top: 1px solid #ddd;
-}
-.table > thead > tr > th {
- vertical-align: bottom;
- border-bottom: 2px solid #ddd;
-}
-.table > caption + thead > tr:first-child > th,
-.table > colgroup + thead > tr:first-child > th,
-.table > thead:first-child > tr:first-child > th,
-.table > caption + thead > tr:first-child > td,
-.table > colgroup + thead > tr:first-child > td,
-.table > thead:first-child > tr:first-child > td {
- border-top: 0;
-}
-.table > tbody + tbody {
- border-top: 2px solid #ddd;
-}
-.table .table {
- background-color: #fff;
-}
-.table-condensed > thead > tr > th,
-.table-condensed > tbody > tr > th,
-.table-condensed > tfoot > tr > th,
-.table-condensed > thead > tr > td,
-.table-condensed > tbody > tr > td,
-.table-condensed > tfoot > tr > td {
- padding: 5px;
-}
-.table-bordered {
- border: 1px solid #ddd;
-}
-.table-bordered > thead > tr > th,
-.table-bordered > tbody > tr > th,
-.table-bordered > tfoot > tr > th,
-.table-bordered > thead > tr > td,
-.table-bordered > tbody > tr > td,
-.table-bordered > tfoot > tr > td {
- border: 1px solid #ddd;
-}
-.table-bordered > thead > tr > th,
-.table-bordered > thead > tr > td {
- border-bottom-width: 2px;
-}
-.table-striped > tbody > tr:nth-of-type(odd) {
- background-color: #f9f9f9;
-}
-.table-hover > tbody > tr:hover {
- background-color: #f5f5f5;
-}
-table col[class*="col-"] {
- position: static;
- float: none;
- display: table-column;
-}
-table td[class*="col-"],
-table th[class*="col-"] {
- position: static;
- float: none;
- display: table-cell;
-}
-.table > thead > tr > td.active,
-.table > tbody > tr > td.active,
-.table > tfoot > tr > td.active,
-.table > thead > tr > th.active,
-.table > tbody > tr > th.active,
-.table > tfoot > tr > th.active,
-.table > thead > tr.active > td,
-.table > tbody > tr.active > td,
-.table > tfoot > tr.active > td,
-.table > thead > tr.active > th,
-.table > tbody > tr.active > th,
-.table > tfoot > tr.active > th {
- background-color: #f5f5f5;
-}
-.table-hover > tbody > tr > td.active:hover,
-.table-hover > tbody > tr > th.active:hover,
-.table-hover > tbody > tr.active:hover > td,
-.table-hover > tbody > tr:hover > .active,
-.table-hover > tbody > tr.active:hover > th {
- background-color: #e8e8e8;
-}
-.table > thead > tr > td.success,
-.table > tbody > tr > td.success,
-.table > tfoot > tr > td.success,
-.table > thead > tr > th.success,
-.table > tbody > tr > th.success,
-.table > tfoot > tr > th.success,
-.table > thead > tr.success > td,
-.table > tbody > tr.success > td,
-.table > tfoot > tr.success > td,
-.table > thead > tr.success > th,
-.table > tbody > tr.success > th,
-.table > tfoot > tr.success > th {
- background-color: #dff0d8;
-}
-.table-hover > tbody > tr > td.success:hover,
-.table-hover > tbody > tr > th.success:hover,
-.table-hover > tbody > tr.success:hover > td,
-.table-hover > tbody > tr:hover > .success,
-.table-hover > tbody > tr.success:hover > th {
- background-color: #d0e9c6;
-}
-.table > thead > tr > td.info,
-.table > tbody > tr > td.info,
-.table > tfoot > tr > td.info,
-.table > thead > tr > th.info,
-.table > tbody > tr > th.info,
-.table > tfoot > tr > th.info,
-.table > thead > tr.info > td,
-.table > tbody > tr.info > td,
-.table > tfoot > tr.info > td,
-.table > thead > tr.info > th,
-.table > tbody > tr.info > th,
-.table > tfoot > tr.info > th {
- background-color: #d9edf7;
-}
-.table-hover > tbody > tr > td.info:hover,
-.table-hover > tbody > tr > th.info:hover,
-.table-hover > tbody > tr.info:hover > td,
-.table-hover > tbody > tr:hover > .info,
-.table-hover > tbody > tr.info:hover > th {
- background-color: #c4e3f3;
-}
-.table > thead > tr > td.warning,
-.table > tbody > tr > td.warning,
-.table > tfoot > tr > td.warning,
-.table > thead > tr > th.warning,
-.table > tbody > tr > th.warning,
-.table > tfoot > tr > th.warning,
-.table > thead > tr.warning > td,
-.table > tbody > tr.warning > td,
-.table > tfoot > tr.warning > td,
-.table > thead > tr.warning > th,
-.table > tbody > tr.warning > th,
-.table > tfoot > tr.warning > th {
- background-color: #fcf8e3;
-}
-.table-hover > tbody > tr > td.warning:hover,
-.table-hover > tbody > tr > th.warning:hover,
-.table-hover > tbody > tr.warning:hover > td,
-.table-hover > tbody > tr:hover > .warning,
-.table-hover > tbody > tr.warning:hover > th {
- background-color: #faf2cc;
-}
-.table > thead > tr > td.danger,
-.table > tbody > tr > td.danger,
-.table > tfoot > tr > td.danger,
-.table > thead > tr > th.danger,
-.table > tbody > tr > th.danger,
-.table > tfoot > tr > th.danger,
-.table > thead > tr.danger > td,
-.table > tbody > tr.danger > td,
-.table > tfoot > tr.danger > td,
-.table > thead > tr.danger > th,
-.table > tbody > tr.danger > th,
-.table > tfoot > tr.danger > th {
- background-color: #f2dede;
-}
-.table-hover > tbody > tr > td.danger:hover,
-.table-hover > tbody > tr > th.danger:hover,
-.table-hover > tbody > tr.danger:hover > td,
-.table-hover > tbody > tr:hover > .danger,
-.table-hover > tbody > tr.danger:hover > th {
- background-color: #ebcccc;
-}
-.table-responsive {
- overflow-x: auto;
- min-height: 0.01%;
-}
-@media screen and (max-width: 767px) {
- .table-responsive {
- width: 100%;
- margin-bottom: 15px;
- overflow-y: hidden;
- -ms-overflow-style: -ms-autohiding-scrollbar;
- border: 1px solid #ddd;
- }
- .table-responsive > .table {
- margin-bottom: 0;
- }
- .table-responsive > .table > thead > tr > th,
- .table-responsive > .table > tbody > tr > th,
- .table-responsive > .table > tfoot > tr > th,
- .table-responsive > .table > thead > tr > td,
- .table-responsive > .table > tbody > tr > td,
- .table-responsive > .table > tfoot > tr > td {
- white-space: nowrap;
- }
- .table-responsive > .table-bordered {
- border: 0;
- }
- .table-responsive > .table-bordered > thead > tr > th:first-child,
- .table-responsive > .table-bordered > tbody > tr > th:first-child,
- .table-responsive > .table-bordered > tfoot > tr > th:first-child,
- .table-responsive > .table-bordered > thead > tr > td:first-child,
- .table-responsive > .table-bordered > tbody > tr > td:first-child,
- .table-responsive > .table-bordered > tfoot > tr > td:first-child {
- border-left: 0;
- }
- .table-responsive > .table-bordered > thead > tr > th:last-child,
- .table-responsive > .table-bordered > tbody > tr > th:last-child,
- .table-responsive > .table-bordered > tfoot > tr > th:last-child,
- .table-responsive > .table-bordered > thead > tr > td:last-child,
- .table-responsive > .table-bordered > tbody > tr > td:last-child,
- .table-responsive > .table-bordered > tfoot > tr > td:last-child {
- border-right: 0;
- }
- .table-responsive > .table-bordered > tbody > tr:last-child > th,
- .table-responsive > .table-bordered > tfoot > tr:last-child > th,
- .table-responsive > .table-bordered > tbody > tr:last-child > td,
- .table-responsive > .table-bordered > tfoot > tr:last-child > td {
- border-bottom: 0;
- }
-}
-fieldset {
- padding: 0;
- margin: 0;
- border: 0;
- min-width: 0;
-}
-legend {
- display: block;
- width: 100%;
- padding: 0;
- margin-bottom: 20px;
- font-size: 21px;
- line-height: inherit;
- color: #333333;
- border: 0;
- border-bottom: 1px solid #e5e5e5;
-}
-label {
- display: inline-block;
- max-width: 100%;
- margin-bottom: 5px;
- font-weight: bold;
-}
-input[type="search"] {
- -webkit-box-sizing: border-box;
- -moz-box-sizing: border-box;
- box-sizing: border-box;
-}
-input[type="radio"],
-input[type="checkbox"] {
- margin: 4px 0 0;
- margin-top: 1px \9;
- line-height: normal;
-}
-input[type="file"] {
- display: block;
-}
-input[type="range"] {
- display: block;
- width: 100%;
-}
-select[multiple],
-select[size] {
- height: auto;
-}
-input[type="file"]:focus,
-input[type="radio"]:focus,
-input[type="checkbox"]:focus {
- outline: 5px auto -webkit-focus-ring-color;
- outline-offset: -2px;
-}
-output {
- display: block;
- padding-top: 7px;
- font-size: 14px;
- line-height: 1.42857143;
- color: #555555;
-}
-.form-control {
- display: block;
- width: 100%;
- height: 34px;
- padding: 6px 12px;
- font-size: 14px;
- line-height: 1.42857143;
- color: #555555;
- background-color: #fff;
- background-image: none;
- border: 1px solid #ccc;
- border-radius: 4px;
- -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
- box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
- -webkit-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
- -o-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
- transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
-}
-.form-control:focus {
- border-color: #66afe9;
- outline: 0;
- -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6);
- box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6);
-}
-.form-control::-moz-placeholder {
- color: #999;
- opacity: 1;
-}
-.form-control:-ms-input-placeholder {
- color: #999;
-}
-.form-control::-webkit-input-placeholder {
- color: #999;
-}
-.form-control::-ms-expand {
- border: 0;
- background-color: transparent;
-}
-.form-control[disabled],
-.form-control[readonly],
-fieldset[disabled] .form-control {
- background-color: #eeeeee;
- opacity: 1;
-}
-.form-control[disabled],
-fieldset[disabled] .form-control {
- cursor: not-allowed;
-}
-textarea.form-control {
- height: auto;
-}
-input[type="search"] {
- -webkit-appearance: none;
-}
-@media screen and (-webkit-min-device-pixel-ratio: 0) {
- input[type="date"].form-control,
- input[type="time"].form-control,
- input[type="datetime-local"].form-control,
- input[type="month"].form-control {
- line-height: 34px;
- }
- input[type="date"].input-sm,
- input[type="time"].input-sm,
- input[type="datetime-local"].input-sm,
- input[type="month"].input-sm,
- .input-group-sm input[type="date"],
- .input-group-sm input[type="time"],
- .input-group-sm input[type="datetime-local"],
- .input-group-sm input[type="month"] {
- line-height: 30px;
- }
- input[type="date"].input-lg,
- input[type="time"].input-lg,
- input[type="datetime-local"].input-lg,
- input[type="month"].input-lg,
- .input-group-lg input[type="date"],
- .input-group-lg input[type="time"],
- .input-group-lg input[type="datetime-local"],
- .input-group-lg input[type="month"] {
- line-height: 46px;
- }
-}
-.form-group {
- margin-bottom: 15px;
-}
-.radio,
-.checkbox {
- position: relative;
- display: block;
- margin-top: 10px;
- margin-bottom: 10px;
-}
-.radio label,
-.checkbox label {
- min-height: 20px;
- padding-left: 20px;
- margin-bottom: 0;
- font-weight: normal;
- cursor: pointer;
-}
-.radio input[type="radio"],
-.radio-inline input[type="radio"],
-.checkbox input[type="checkbox"],
-.checkbox-inline input[type="checkbox"] {
- position: absolute;
- margin-left: -20px;
- margin-top: 4px \9;
-}
-.radio + .radio,
-.checkbox + .checkbox {
- margin-top: -5px;
-}
-.radio-inline,
-.checkbox-inline {
- position: relative;
- display: inline-block;
- padding-left: 20px;
- margin-bottom: 0;
- vertical-align: middle;
- font-weight: normal;
- cursor: pointer;
-}
-.radio-inline + .radio-inline,
-.checkbox-inline + .checkbox-inline {
- margin-top: 0;
- margin-left: 10px;
-}
-input[type="radio"][disabled],
-input[type="checkbox"][disabled],
-input[type="radio"].disabled,
-input[type="checkbox"].disabled,
-fieldset[disabled] input[type="radio"],
-fieldset[disabled] input[type="checkbox"] {
- cursor: not-allowed;
-}
-.radio-inline.disabled,
-.checkbox-inline.disabled,
-fieldset[disabled] .radio-inline,
-fieldset[disabled] .checkbox-inline {
- cursor: not-allowed;
-}
-.radio.disabled label,
-.checkbox.disabled label,
-fieldset[disabled] .radio label,
-fieldset[disabled] .checkbox label {
- cursor: not-allowed;
-}
-.form-control-static {
- padding-top: 7px;
- padding-bottom: 7px;
- margin-bottom: 0;
- min-height: 34px;
-}
-.form-control-static.input-lg,
-.form-control-static.input-sm {
- padding-left: 0;
- padding-right: 0;
-}
-.input-sm {
- height: 30px;
- padding: 5px 10px;
- font-size: 12px;
- line-height: 1.5;
- border-radius: 3px;
-}
-select.input-sm {
- height: 30px;
- line-height: 30px;
-}
-textarea.input-sm,
-select[multiple].input-sm {
- height: auto;
-}
-.form-group-sm .form-control {
- height: 30px;
- padding: 5px 10px;
- font-size: 12px;
- line-height: 1.5;
- border-radius: 3px;
-}
-.form-group-sm select.form-control {
- height: 30px;
- line-height: 30px;
-}
-.form-group-sm textarea.form-control,
-.form-group-sm select[multiple].form-control {
- height: auto;
-}
-.form-group-sm .form-control-static {
- height: 30px;
- min-height: 32px;
- padding: 6px 10px;
- font-size: 12px;
- line-height: 1.5;
-}
-.input-lg {
- height: 46px;
- padding: 10px 16px;
- font-size: 18px;
- line-height: 1.3333333;
- border-radius: 6px;
-}
-select.input-lg {
- height: 46px;
- line-height: 46px;
-}
-textarea.input-lg,
-select[multiple].input-lg {
- height: auto;
-}
-.form-group-lg .form-control {
- height: 46px;
- padding: 10px 16px;
- font-size: 18px;
- line-height: 1.3333333;
- border-radius: 6px;
-}
-.form-group-lg select.form-control {
- height: 46px;
- line-height: 46px;
-}
-.form-group-lg textarea.form-control,
-.form-group-lg select[multiple].form-control {
- height: auto;
-}
-.form-group-lg .form-control-static {
- height: 46px;
- min-height: 38px;
- padding: 11px 16px;
- font-size: 18px;
- line-height: 1.3333333;
-}
-.has-feedback {
- position: relative;
-}
-.has-feedback .form-control {
- padding-right: 42.5px;
-}
-.form-control-feedback {
- position: absolute;
- top: 0;
- right: 0;
- z-index: 2;
- display: block;
- width: 34px;
- height: 34px;
- line-height: 34px;
- text-align: center;
- pointer-events: none;
-}
-.input-lg + .form-control-feedback,
-.input-group-lg + .form-control-feedback,
-.form-group-lg .form-control + .form-control-feedback {
- width: 46px;
- height: 46px;
- line-height: 46px;
-}
-.input-sm + .form-control-feedback,
-.input-group-sm + .form-control-feedback,
-.form-group-sm .form-control + .form-control-feedback {
- width: 30px;
- height: 30px;
- line-height: 30px;
-}
-.has-success .help-block,
-.has-success .control-label,
-.has-success .radio,
-.has-success .checkbox,
-.has-success .radio-inline,
-.has-success .checkbox-inline,
-.has-success.radio label,
-.has-success.checkbox label,
-.has-success.radio-inline label,
-.has-success.checkbox-inline label {
- color: #3c763d;
-}
-.has-success .form-control {
- border-color: #3c763d;
- -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
- box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
-}
-.has-success .form-control:focus {
- border-color: #2b542c;
- -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #67b168;
- box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #67b168;
-}
-.has-success .input-group-addon {
- color: #3c763d;
- border-color: #3c763d;
- background-color: #dff0d8;
-}
-.has-success .form-control-feedback {
- color: #3c763d;
-}
-.has-warning .help-block,
-.has-warning .control-label,
-.has-warning .radio,
-.has-warning .checkbox,
-.has-warning .radio-inline,
-.has-warning .checkbox-inline,
-.has-warning.radio label,
-.has-warning.checkbox label,
-.has-warning.radio-inline label,
-.has-warning.checkbox-inline label {
- color: #8a6d3b;
-}
-.has-warning .form-control {
- border-color: #8a6d3b;
- -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
- box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
-}
-.has-warning .form-control:focus {
- border-color: #66512c;
- -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #c0a16b;
- box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #c0a16b;
-}
-.has-warning .input-group-addon {
- color: #8a6d3b;
- border-color: #8a6d3b;
- background-color: #fcf8e3;
-}
-.has-warning .form-control-feedback {
- color: #8a6d3b;
-}
-.has-error .help-block,
-.has-error .control-label,
-.has-error .radio,
-.has-error .checkbox,
-.has-error .radio-inline,
-.has-error .checkbox-inline,
-.has-error.radio label,
-.has-error.checkbox label,
-.has-error.radio-inline label,
-.has-error.checkbox-inline label {
- color: #a94442;
-}
-.has-error .form-control {
- border-color: #a94442;
- -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
- box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
-}
-.has-error .form-control:focus {
- border-color: #843534;
- -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #ce8483;
- box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #ce8483;
-}
-.has-error .input-group-addon {
- color: #a94442;
- border-color: #a94442;
- background-color: #f2dede;
-}
-.has-error .form-control-feedback {
- color: #a94442;
-}
-.has-feedback label ~ .form-control-feedback {
- top: 25px;
-}
-.has-feedback label.sr-only ~ .form-control-feedback {
- top: 0;
-}
-.help-block {
- display: block;
- margin-top: 5px;
- margin-bottom: 10px;
- color: #737373;
-}
-@media (min-width: 768px) {
- .form-inline .form-group {
- display: inline-block;
- margin-bottom: 0;
- vertical-align: middle;
- }
- .form-inline .form-control {
- display: inline-block;
- width: auto;
- vertical-align: middle;
- }
- .form-inline .form-control-static {
- display: inline-block;
- }
- .form-inline .input-group {
- display: inline-table;
- vertical-align: middle;
- }
- .form-inline .input-group .input-group-addon,
- .form-inline .input-group .input-group-btn,
- .form-inline .input-group .form-control {
- width: auto;
- }
- .form-inline .input-group > .form-control {
- width: 100%;
- }
- .form-inline .control-label {
- margin-bottom: 0;
- vertical-align: middle;
- }
- .form-inline .radio,
- .form-inline .checkbox {
- display: inline-block;
- margin-top: 0;
- margin-bottom: 0;
- vertical-align: middle;
- }
- .form-inline .radio label,
- .form-inline .checkbox label {
- padding-left: 0;
- }
- .form-inline .radio input[type="radio"],
- .form-inline .checkbox input[type="checkbox"] {
- position: relative;
- margin-left: 0;
- }
- .form-inline .has-feedback .form-control-feedback {
- top: 0;
- }
-}
-.form-horizontal .radio,
-.form-horizontal .checkbox,
-.form-horizontal .radio-inline,
-.form-horizontal .checkbox-inline {
- margin-top: 0;
- margin-bottom: 0;
- padding-top: 7px;
-}
-.form-horizontal .radio,
-.form-horizontal .checkbox {
- min-height: 27px;
-}
-.form-horizontal .form-group {
- margin-left: -15px;
- margin-right: -15px;
-}
-@media (min-width: 768px) {
- .form-horizontal .control-label {
- text-align: right;
- margin-bottom: 0;
- padding-top: 7px;
- }
-}
-.form-horizontal .has-feedback .form-control-feedback {
- right: 15px;
-}
-@media (min-width: 768px) {
- .form-horizontal .form-group-lg .control-label {
- padding-top: 11px;
- font-size: 18px;
- }
-}
-@media (min-width: 768px) {
- .form-horizontal .form-group-sm .control-label {
- padding-top: 6px;
- font-size: 12px;
- }
-}
-.btn {
- display: inline-block;
- margin-bottom: 0;
- font-weight: normal;
- text-align: center;
- vertical-align: middle;
- touch-action: manipulation;
- cursor: pointer;
- background-image: none;
- border: 1px solid transparent;
- white-space: nowrap;
- padding: 6px 12px;
- font-size: 14px;
- line-height: 1.42857143;
- border-radius: 4px;
- -webkit-user-select: none;
- -moz-user-select: none;
- -ms-user-select: none;
- user-select: none;
-}
-.btn:focus,
-.btn:active:focus,
-.btn.active:focus,
-.btn.focus,
-.btn:active.focus,
-.btn.active.focus {
- outline: 5px auto -webkit-focus-ring-color;
- outline-offset: -2px;
-}
-.btn:hover,
-.btn:focus,
-.btn.focus {
- color: #333;
- text-decoration: none;
-}
-.btn:active,
-.btn.active {
- outline: 0;
- background-image: none;
- -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
- box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
-}
-.btn.disabled,
-.btn[disabled],
-fieldset[disabled] .btn {
- cursor: not-allowed;
- opacity: 0.65;
- filter: alpha(opacity=65);
- -webkit-box-shadow: none;
- box-shadow: none;
-}
-a.btn.disabled,
-fieldset[disabled] a.btn {
- pointer-events: none;
-}
-.btn-default {
- color: #333;
- background-color: #fff;
- border-color: #ccc;
-}
-.btn-default:focus,
-.btn-default.focus {
- color: #333;
- background-color: #e6e6e6;
- border-color: #8c8c8c;
-}
-.btn-default:hover {
- color: #333;
- background-color: #e6e6e6;
- border-color: #adadad;
-}
-.btn-default:active,
-.btn-default.active,
-.open > .dropdown-toggle.btn-default {
- color: #333;
- background-color: #e6e6e6;
- border-color: #adadad;
-}
-.btn-default:active:hover,
-.btn-default.active:hover,
-.open > .dropdown-toggle.btn-default:hover,
-.btn-default:active:focus,
-.btn-default.active:focus,
-.open > .dropdown-toggle.btn-default:focus,
-.btn-default:active.focus,
-.btn-default.active.focus,
-.open > .dropdown-toggle.btn-default.focus {
- color: #333;
- background-color: #d4d4d4;
- border-color: #8c8c8c;
-}
-.btn-default:active,
-.btn-default.active,
-.open > .dropdown-toggle.btn-default {
- background-image: none;
-}
-.btn-default.disabled:hover,
-.btn-default[disabled]:hover,
-fieldset[disabled] .btn-default:hover,
-.btn-default.disabled:focus,
-.btn-default[disabled]:focus,
-fieldset[disabled] .btn-default:focus,
-.btn-default.disabled.focus,
-.btn-default[disabled].focus,
-fieldset[disabled] .btn-default.focus {
- background-color: #fff;
- border-color: #ccc;
-}
-.btn-default .badge {
- color: #fff;
- background-color: #333;
-}
-.btn-primary {
- color: #fff;
- background-color: #337ab7;
- border-color: #2e6da4;
-}
-.btn-primary:focus,
-.btn-primary.focus {
- color: #fff;
- background-color: #286090;
- border-color: #122b40;
-}
-.btn-primary:hover {
- color: #fff;
- background-color: #286090;
- border-color: #204d74;
-}
-.btn-primary:active,
-.btn-primary.active,
-.open > .dropdown-toggle.btn-primary {
- color: #fff;
- background-color: #286090;
- border-color: #204d74;
-}
-.btn-primary:active:hover,
-.btn-primary.active:hover,
-.open > .dropdown-toggle.btn-primary:hover,
-.btn-primary:active:focus,
-.btn-primary.active:focus,
-.open > .dropdown-toggle.btn-primary:focus,
-.btn-primary:active.focus,
-.btn-primary.active.focus,
-.open > .dropdown-toggle.btn-primary.focus {
- color: #fff;
- background-color: #204d74;
- border-color: #122b40;
-}
-.btn-primary:active,
-.btn-primary.active,
-.open > .dropdown-toggle.btn-primary {
- background-image: none;
-}
-.btn-primary.disabled:hover,
-.btn-primary[disabled]:hover,
-fieldset[disabled] .btn-primary:hover,
-.btn-primary.disabled:focus,
-.btn-primary[disabled]:focus,
-fieldset[disabled] .btn-primary:focus,
-.btn-primary.disabled.focus,
-.btn-primary[disabled].focus,
-fieldset[disabled] .btn-primary.focus {
- background-color: #337ab7;
- border-color: #2e6da4;
-}
-.btn-primary .badge {
- color: #337ab7;
- background-color: #fff;
-}
-.btn-success {
- color: #fff;
- background-color: #5cb85c;
- border-color: #4cae4c;
-}
-.btn-success:focus,
-.btn-success.focus {
- color: #fff;
- background-color: #449d44;
- border-color: #255625;
-}
-.btn-success:hover {
- color: #fff;
- background-color: #449d44;
- border-color: #398439;
-}
-.btn-success:active,
-.btn-success.active,
-.open > .dropdown-toggle.btn-success {
- color: #fff;
- background-color: #449d44;
- border-color: #398439;
-}
-.btn-success:active:hover,
-.btn-success.active:hover,
-.open > .dropdown-toggle.btn-success:hover,
-.btn-success:active:focus,
-.btn-success.active:focus,
-.open > .dropdown-toggle.btn-success:focus,
-.btn-success:active.focus,
-.btn-success.active.focus,
-.open > .dropdown-toggle.btn-success.focus {
- color: #fff;
- background-color: #398439;
- border-color: #255625;
-}
-.btn-success:active,
-.btn-success.active,
-.open > .dropdown-toggle.btn-success {
- background-image: none;
-}
-.btn-success.disabled:hover,
-.btn-success[disabled]:hover,
-fieldset[disabled] .btn-success:hover,
-.btn-success.disabled:focus,
-.btn-success[disabled]:focus,
-fieldset[disabled] .btn-success:focus,
-.btn-success.disabled.focus,
-.btn-success[disabled].focus,
-fieldset[disabled] .btn-success.focus {
- background-color: #5cb85c;
- border-color: #4cae4c;
-}
-.btn-success .badge {
- color: #5cb85c;
- background-color: #fff;
-}
-.btn-info {
- color: #fff;
- background-color: #5bc0de;
- border-color: #46b8da;
-}
-.btn-info:focus,
-.btn-info.focus {
- color: #fff;
- background-color: #31b0d5;
- border-color: #1b6d85;
-}
-.btn-info:hover {
- color: #fff;
- background-color: #31b0d5;
- border-color: #269abc;
-}
-.btn-info:active,
-.btn-info.active,
-.open > .dropdown-toggle.btn-info {
- color: #fff;
- background-color: #31b0d5;
- border-color: #269abc;
-}
-.btn-info:active:hover,
-.btn-info.active:hover,
-.open > .dropdown-toggle.btn-info:hover,
-.btn-info:active:focus,
-.btn-info.active:focus,
-.open > .dropdown-toggle.btn-info:focus,
-.btn-info:active.focus,
-.btn-info.active.focus,
-.open > .dropdown-toggle.btn-info.focus {
- color: #fff;
- background-color: #269abc;
- border-color: #1b6d85;
-}
-.btn-info:active,
-.btn-info.active,
-.open > .dropdown-toggle.btn-info {
- background-image: none;
-}
-.btn-info.disabled:hover,
-.btn-info[disabled]:hover,
-fieldset[disabled] .btn-info:hover,
-.btn-info.disabled:focus,
-.btn-info[disabled]:focus,
-fieldset[disabled] .btn-info:focus,
-.btn-info.disabled.focus,
-.btn-info[disabled].focus,
-fieldset[disabled] .btn-info.focus {
- background-color: #5bc0de;
- border-color: #46b8da;
-}
-.btn-info .badge {
- color: #5bc0de;
- background-color: #fff;
-}
-.btn-warning {
- color: #fff;
- background-color: #f0ad4e;
- border-color: #eea236;
-}
-.btn-warning:focus,
-.btn-warning.focus {
- color: #fff;
- background-color: #ec971f;
- border-color: #985f0d;
-}
-.btn-warning:hover {
- color: #fff;
- background-color: #ec971f;
- border-color: #d58512;
-}
-.btn-warning:active,
-.btn-warning.active,
-.open > .dropdown-toggle.btn-warning {
- color: #fff;
- background-color: #ec971f;
- border-color: #d58512;
-}
-.btn-warning:active:hover,
-.btn-warning.active:hover,
-.open > .dropdown-toggle.btn-warning:hover,
-.btn-warning:active:focus,
-.btn-warning.active:focus,
-.open > .dropdown-toggle.btn-warning:focus,
-.btn-warning:active.focus,
-.btn-warning.active.focus,
-.open > .dropdown-toggle.btn-warning.focus {
- color: #fff;
- background-color: #d58512;
- border-color: #985f0d;
-}
-.btn-warning:active,
-.btn-warning.active,
-.open > .dropdown-toggle.btn-warning {
- background-image: none;
-}
-.btn-warning.disabled:hover,
-.btn-warning[disabled]:hover,
-fieldset[disabled] .btn-warning:hover,
-.btn-warning.disabled:focus,
-.btn-warning[disabled]:focus,
-fieldset[disabled] .btn-warning:focus,
-.btn-warning.disabled.focus,
-.btn-warning[disabled].focus,
-fieldset[disabled] .btn-warning.focus {
- background-color: #f0ad4e;
- border-color: #eea236;
-}
-.btn-warning .badge {
- color: #f0ad4e;
- background-color: #fff;
-}
-.btn-danger {
- color: #fff;
- background-color: #d9534f;
- border-color: #d43f3a;
-}
-.btn-danger:focus,
-.btn-danger.focus {
- color: #fff;
- background-color: #c9302c;
- border-color: #761c19;
-}
-.btn-danger:hover {
- color: #fff;
- background-color: #c9302c;
- border-color: #ac2925;
-}
-.btn-danger:active,
-.btn-danger.active,
-.open > .dropdown-toggle.btn-danger {
- color: #fff;
- background-color: #c9302c;
- border-color: #ac2925;
-}
-.btn-danger:active:hover,
-.btn-danger.active:hover,
-.open > .dropdown-toggle.btn-danger:hover,
-.btn-danger:active:focus,
-.btn-danger.active:focus,
-.open > .dropdown-toggle.btn-danger:focus,
-.btn-danger:active.focus,
-.btn-danger.active.focus,
-.open > .dropdown-toggle.btn-danger.focus {
- color: #fff;
- background-color: #ac2925;
- border-color: #761c19;
-}
-.btn-danger:active,
-.btn-danger.active,
-.open > .dropdown-toggle.btn-danger {
- background-image: none;
-}
-.btn-danger.disabled:hover,
-.btn-danger[disabled]:hover,
-fieldset[disabled] .btn-danger:hover,
-.btn-danger.disabled:focus,
-.btn-danger[disabled]:focus,
-fieldset[disabled] .btn-danger:focus,
-.btn-danger.disabled.focus,
-.btn-danger[disabled].focus,
-fieldset[disabled] .btn-danger.focus {
- background-color: #d9534f;
- border-color: #d43f3a;
-}
-.btn-danger .badge {
- color: #d9534f;
- background-color: #fff;
-}
-.btn-link {
- color: #337ab7;
- font-weight: normal;
- border-radius: 0;
-}
-.btn-link,
-.btn-link:active,
-.btn-link.active,
-.btn-link[disabled],
-fieldset[disabled] .btn-link {
- background-color: transparent;
- -webkit-box-shadow: none;
- box-shadow: none;
-}
-.btn-link,
-.btn-link:hover,
-.btn-link:focus,
-.btn-link:active {
- border-color: transparent;
-}
-.btn-link:hover,
-.btn-link:focus {
- color: #23527c;
- text-decoration: underline;
- background-color: transparent;
-}
-.btn-link[disabled]:hover,
-fieldset[disabled] .btn-link:hover,
-.btn-link[disabled]:focus,
-fieldset[disabled] .btn-link:focus {
- color: #777777;
- text-decoration: none;
-}
-.btn-lg,
-.btn-group-lg > .btn {
- padding: 10px 16px;
- font-size: 18px;
- line-height: 1.3333333;
- border-radius: 6px;
-}
-.btn-sm,
-.btn-group-sm > .btn {
- padding: 5px 10px;
- font-size: 12px;
- line-height: 1.5;
- border-radius: 3px;
-}
-.btn-xs,
-.btn-group-xs > .btn {
- padding: 1px 5px;
- font-size: 12px;
- line-height: 1.5;
- border-radius: 3px;
-}
-.btn-block {
- display: block;
- width: 100%;
-}
-.btn-block + .btn-block {
- margin-top: 5px;
-}
-input[type="submit"].btn-block,
-input[type="reset"].btn-block,
-input[type="button"].btn-block {
- width: 100%;
-}
-.fade {
- opacity: 0;
- -webkit-transition: opacity 0.15s linear;
- -o-transition: opacity 0.15s linear;
- transition: opacity 0.15s linear;
-}
-.fade.in {
- opacity: 1;
-}
-.collapse {
- display: none;
-}
-.collapse.in {
- display: block;
-}
-tr.collapse.in {
- display: table-row;
-}
-tbody.collapse.in {
- display: table-row-group;
-}
-.collapsing {
- position: relative;
- height: 0;
- overflow: hidden;
- -webkit-transition-property: height, visibility;
- transition-property: height, visibility;
- -webkit-transition-duration: 0.35s;
- transition-duration: 0.35s;
- -webkit-transition-timing-function: ease;
- transition-timing-function: ease;
-}
-.caret {
- display: inline-block;
- width: 0;
- height: 0;
- margin-left: 2px;
- vertical-align: middle;
- border-top: 4px dashed;
- border-top: 4px solid \9;
- border-right: 4px solid transparent;
- border-left: 4px solid transparent;
-}
-.dropup,
-.dropdown {
- position: relative;
-}
-.dropdown-toggle:focus {
- outline: 0;
-}
-.dropdown-menu {
- position: absolute;
- top: 100%;
- left: 0;
- z-index: 1000;
- display: none;
- float: left;
- min-width: 160px;
- padding: 5px 0;
- margin: 2px 0 0;
- list-style: none;
- font-size: 14px;
- text-align: left;
- background-color: #fff;
- border: 1px solid #ccc;
- border: 1px solid rgba(0, 0, 0, 0.15);
- border-radius: 4px;
- -webkit-box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
- box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
- background-clip: padding-box;
-}
-.dropdown-menu.pull-right {
- right: 0;
- left: auto;
-}
-.dropdown-menu .divider {
- height: 1px;
- margin: 9px 0;
- overflow: hidden;
- background-color: #e5e5e5;
-}
-.dropdown-menu > li > a {
- display: block;
- padding: 3px 20px;
- clear: both;
- font-weight: normal;
- line-height: 1.42857143;
- color: #333333;
- white-space: nowrap;
-}
-.dropdown-menu > li > a:hover,
-.dropdown-menu > li > a:focus {
- text-decoration: none;
- color: #262626;
- background-color: #f5f5f5;
-}
-.dropdown-menu > .active > a,
-.dropdown-menu > .active > a:hover,
-.dropdown-menu > .active > a:focus {
- color: #fff;
- text-decoration: none;
- outline: 0;
- background-color: #337ab7;
-}
-.dropdown-menu > .disabled > a,
-.dropdown-menu > .disabled > a:hover,
-.dropdown-menu > .disabled > a:focus {
- color: #777777;
-}
-.dropdown-menu > .disabled > a:hover,
-.dropdown-menu > .disabled > a:focus {
- text-decoration: none;
- background-color: transparent;
- background-image: none;
- filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
- cursor: not-allowed;
-}
-.open > .dropdown-menu {
- display: block;
-}
-.open > a {
- outline: 0;
-}
-.dropdown-menu-right {
- left: auto;
- right: 0;
-}
-.dropdown-menu-left {
- left: 0;
- right: auto;
-}
-.dropdown-header {
- display: block;
- padding: 3px 20px;
- font-size: 12px;
- line-height: 1.42857143;
- color: #777777;
- white-space: nowrap;
-}
-.dropdown-backdrop {
- position: fixed;
- left: 0;
- right: 0;
- bottom: 0;
- top: 0;
- z-index: 990;
-}
-.pull-right > .dropdown-menu {
- right: 0;
- left: auto;
-}
-.dropup .caret,
-.navbar-fixed-bottom .dropdown .caret {
- border-top: 0;
- border-bottom: 4px dashed;
- border-bottom: 4px solid \9;
- content: "";
-}
-.dropup .dropdown-menu,
-.navbar-fixed-bottom .dropdown .dropdown-menu {
- top: auto;
- bottom: 100%;
- margin-bottom: 2px;
-}
-@media (min-width: 768px) {
- .navbar-right .dropdown-menu {
- left: auto;
- right: 0;
- }
- .navbar-right .dropdown-menu-left {
- left: 0;
- right: auto;
- }
-}
-.btn-group,
-.btn-group-vertical {
- position: relative;
- display: inline-block;
- vertical-align: middle;
-}
-.btn-group > .btn,
-.btn-group-vertical > .btn {
- position: relative;
- float: left;
-}
-.btn-group > .btn:hover,
-.btn-group-vertical > .btn:hover,
-.btn-group > .btn:focus,
-.btn-group-vertical > .btn:focus,
-.btn-group > .btn:active,
-.btn-group-vertical > .btn:active,
-.btn-group > .btn.active,
-.btn-group-vertical > .btn.active {
- z-index: 2;
-}
-.btn-group .btn + .btn,
-.btn-group .btn + .btn-group,
-.btn-group .btn-group + .btn,
-.btn-group .btn-group + .btn-group {
- margin-left: -1px;
-}
-.btn-toolbar {
- margin-left: -5px;
-}
-.btn-toolbar .btn,
-.btn-toolbar .btn-group,
-.btn-toolbar .input-group {
- float: left;
-}
-.btn-toolbar > .btn,
-.btn-toolbar > .btn-group,
-.btn-toolbar > .input-group {
- margin-left: 5px;
-}
-.btn-group > .btn:not(:first-child):not(:last-child):not(.dropdown-toggle) {
- border-radius: 0;
-}
-.btn-group > .btn:first-child {
- margin-left: 0;
-}
-.btn-group > .btn:first-child:not(:last-child):not(.dropdown-toggle) {
- border-bottom-right-radius: 0;
- border-top-right-radius: 0;
-}
-.btn-group > .btn:last-child:not(:first-child),
-.btn-group > .dropdown-toggle:not(:first-child) {
- border-bottom-left-radius: 0;
- border-top-left-radius: 0;
-}
-.btn-group > .btn-group {
- float: left;
-}
-.btn-group > .btn-group:not(:first-child):not(:last-child) > .btn {
- border-radius: 0;
-}
-.btn-group > .btn-group:first-child:not(:last-child) > .btn:last-child,
-.btn-group > .btn-group:first-child:not(:last-child) > .dropdown-toggle {
- border-bottom-right-radius: 0;
- border-top-right-radius: 0;
-}
-.btn-group > .btn-group:last-child:not(:first-child) > .btn:first-child {
- border-bottom-left-radius: 0;
- border-top-left-radius: 0;
-}
-.btn-group .dropdown-toggle:active,
-.btn-group.open .dropdown-toggle {
- outline: 0;
-}
-.btn-group > .btn + .dropdown-toggle {
- padding-left: 8px;
- padding-right: 8px;
-}
-.btn-group > .btn-lg + .dropdown-toggle {
- padding-left: 12px;
- padding-right: 12px;
-}
-.btn-group.open .dropdown-toggle {
- -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
- box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
-}
-.btn-group.open .dropdown-toggle.btn-link {
- -webkit-box-shadow: none;
- box-shadow: none;
-}
-.btn .caret {
- margin-left: 0;
-}
-.btn-lg .caret {
- border-width: 5px 5px 0;
- border-bottom-width: 0;
-}
-.dropup .btn-lg .caret {
- border-width: 0 5px 5px;
-}
-.btn-group-vertical > .btn,
-.btn-group-vertical > .btn-group,
-.btn-group-vertical > .btn-group > .btn {
- display: block;
- float: none;
- width: 100%;
- max-width: 100%;
-}
-.btn-group-vertical > .btn-group > .btn {
- float: none;
-}
-.btn-group-vertical > .btn + .btn,
-.btn-group-vertical > .btn + .btn-group,
-.btn-group-vertical > .btn-group + .btn,
-.btn-group-vertical > .btn-group + .btn-group {
- margin-top: -1px;
- margin-left: 0;
-}
-.btn-group-vertical > .btn:not(:first-child):not(:last-child) {
- border-radius: 0;
-}
-.btn-group-vertical > .btn:first-child:not(:last-child) {
- border-top-right-radius: 4px;
- border-top-left-radius: 4px;
- border-bottom-right-radius: 0;
- border-bottom-left-radius: 0;
-}
-.btn-group-vertical > .btn:last-child:not(:first-child) {
- border-top-right-radius: 0;
- border-top-left-radius: 0;
- border-bottom-right-radius: 4px;
- border-bottom-left-radius: 4px;
-}
-.btn-group-vertical > .btn-group:not(:first-child):not(:last-child) > .btn {
- border-radius: 0;
-}
-.btn-group-vertical > .btn-group:first-child:not(:last-child) > .btn:last-child,
-.btn-group-vertical > .btn-group:first-child:not(:last-child) > .dropdown-toggle {
- border-bottom-right-radius: 0;
- border-bottom-left-radius: 0;
-}
-.btn-group-vertical > .btn-group:last-child:not(:first-child) > .btn:first-child {
- border-top-right-radius: 0;
- border-top-left-radius: 0;
-}
-.btn-group-justified {
- display: table;
- width: 100%;
- table-layout: fixed;
- border-collapse: separate;
-}
-.btn-group-justified > .btn,
-.btn-group-justified > .btn-group {
- float: none;
- display: table-cell;
- width: 1%;
-}
-.btn-group-justified > .btn-group .btn {
- width: 100%;
-}
-.btn-group-justified > .btn-group .dropdown-menu {
- left: auto;
-}
-[data-toggle="buttons"] > .btn input[type="radio"],
-[data-toggle="buttons"] > .btn-group > .btn input[type="radio"],
-[data-toggle="buttons"] > .btn input[type="checkbox"],
-[data-toggle="buttons"] > .btn-group > .btn input[type="checkbox"] {
- position: absolute;
- clip: rect(0, 0, 0, 0);
- pointer-events: none;
-}
-.input-group {
- position: relative;
- display: table;
- border-collapse: separate;
-}
-.input-group[class*="col-"] {
- float: none;
- padding-left: 0;
- padding-right: 0;
-}
-.input-group .form-control {
- position: relative;
- z-index: 2;
- float: left;
- width: 100%;
- margin-bottom: 0;
-}
-.input-group .form-control:focus {
- z-index: 3;
-}
-.input-group-lg > .form-control,
-.input-group-lg > .input-group-addon,
-.input-group-lg > .input-group-btn > .btn {
- height: 46px;
- padding: 10px 16px;
- font-size: 18px;
- line-height: 1.3333333;
- border-radius: 6px;
-}
-select.input-group-lg > .form-control,
-select.input-group-lg > .input-group-addon,
-select.input-group-lg > .input-group-btn > .btn {
- height: 46px;
- line-height: 46px;
-}
-textarea.input-group-lg > .form-control,
-textarea.input-group-lg > .input-group-addon,
-textarea.input-group-lg > .input-group-btn > .btn,
-select[multiple].input-group-lg > .form-control,
-select[multiple].input-group-lg > .input-group-addon,
-select[multiple].input-group-lg > .input-group-btn > .btn {
- height: auto;
-}
-.input-group-sm > .form-control,
-.input-group-sm > .input-group-addon,
-.input-group-sm > .input-group-btn > .btn {
- height: 30px;
- padding: 5px 10px;
- font-size: 12px;
- line-height: 1.5;
- border-radius: 3px;
-}
-select.input-group-sm > .form-control,
-select.input-group-sm > .input-group-addon,
-select.input-group-sm > .input-group-btn > .btn {
- height: 30px;
- line-height: 30px;
-}
-textarea.input-group-sm > .form-control,
-textarea.input-group-sm > .input-group-addon,
-textarea.input-group-sm > .input-group-btn > .btn,
-select[multiple].input-group-sm > .form-control,
-select[multiple].input-group-sm > .input-group-addon,
-select[multiple].input-group-sm > .input-group-btn > .btn {
- height: auto;
-}
-.input-group-addon,
-.input-group-btn,
-.input-group .form-control {
- display: table-cell;
-}
-.input-group-addon:not(:first-child):not(:last-child),
-.input-group-btn:not(:first-child):not(:last-child),
-.input-group .form-control:not(:first-child):not(:last-child) {
- border-radius: 0;
-}
-.input-group-addon,
-.input-group-btn {
- width: 1%;
- white-space: nowrap;
- vertical-align: middle;
-}
-.input-group-addon {
- padding: 6px 12px;
- font-size: 14px;
- font-weight: normal;
- line-height: 1;
- color: #555555;
- text-align: center;
- background-color: #eeeeee;
- border: 1px solid #ccc;
- border-radius: 4px;
-}
-.input-group-addon.input-sm {
- padding: 5px 10px;
- font-size: 12px;
- border-radius: 3px;
-}
-.input-group-addon.input-lg {
- padding: 10px 16px;
- font-size: 18px;
- border-radius: 6px;
-}
-.input-group-addon input[type="radio"],
-.input-group-addon input[type="checkbox"] {
- margin-top: 0;
-}
-.input-group .form-control:first-child,
-.input-group-addon:first-child,
-.input-group-btn:first-child > .btn,
-.input-group-btn:first-child > .btn-group > .btn,
-.input-group-btn:first-child > .dropdown-toggle,
-.input-group-btn:last-child > .btn:not(:last-child):not(.dropdown-toggle),
-.input-group-btn:last-child > .btn-group:not(:last-child) > .btn {
- border-bottom-right-radius: 0;
- border-top-right-radius: 0;
-}
-.input-group-addon:first-child {
- border-right: 0;
-}
-.input-group .form-control:last-child,
-.input-group-addon:last-child,
-.input-group-btn:last-child > .btn,
-.input-group-btn:last-child > .btn-group > .btn,
-.input-group-btn:last-child > .dropdown-toggle,
-.input-group-btn:first-child > .btn:not(:first-child),
-.input-group-btn:first-child > .btn-group:not(:first-child) > .btn {
- border-bottom-left-radius: 0;
- border-top-left-radius: 0;
-}
-.input-group-addon:last-child {
- border-left: 0;
-}
-.input-group-btn {
- position: relative;
- font-size: 0;
- white-space: nowrap;
-}
-.input-group-btn > .btn {
- position: relative;
-}
-.input-group-btn > .btn + .btn {
- margin-left: -1px;
-}
-.input-group-btn > .btn:hover,
-.input-group-btn > .btn:focus,
-.input-group-btn > .btn:active {
- z-index: 2;
-}
-.input-group-btn:first-child > .btn,
-.input-group-btn:first-child > .btn-group {
- margin-right: -1px;
-}
-.input-group-btn:last-child > .btn,
-.input-group-btn:last-child > .btn-group {
- z-index: 2;
- margin-left: -1px;
-}
-.nav {
- margin-bottom: 0;
- padding-left: 0;
- list-style: none;
-}
-.nav > li {
- position: relative;
- display: block;
-}
-.nav > li > a {
- position: relative;
- display: block;
- padding: 10px 15px;
-}
-.nav > li > a:hover,
-.nav > li > a:focus {
- text-decoration: none;
- background-color: #eeeeee;
-}
-.nav > li.disabled > a {
- color: #777777;
-}
-.nav > li.disabled > a:hover,
-.nav > li.disabled > a:focus {
- color: #777777;
- text-decoration: none;
- background-color: transparent;
- cursor: not-allowed;
-}
-.nav .open > a,
-.nav .open > a:hover,
-.nav .open > a:focus {
- background-color: #eeeeee;
- border-color: #337ab7;
-}
-.nav .nav-divider {
- height: 1px;
- margin: 9px 0;
- overflow: hidden;
- background-color: #e5e5e5;
-}
-.nav > li > a > img {
- max-width: none;
-}
-.nav-tabs {
- border-bottom: 1px solid #ddd;
-}
-.nav-tabs > li {
- float: left;
- margin-bottom: -1px;
-}
-.nav-tabs > li > a {
- margin-right: 2px;
- line-height: 1.42857143;
- border: 1px solid transparent;
- border-radius: 4px 4px 0 0;
-}
-.nav-tabs > li > a:hover {
- border-color: #eeeeee #eeeeee #ddd;
-}
-.nav-tabs > li.active > a,
-.nav-tabs > li.active > a:hover,
-.nav-tabs > li.active > a:focus {
- color: #555555;
- background-color: #fff;
- border: 1px solid #ddd;
- border-bottom-color: transparent;
- cursor: default;
-}
-.nav-tabs.nav-justified {
- width: 100%;
- border-bottom: 0;
-}
-.nav-tabs.nav-justified > li {
- float: none;
-}
-.nav-tabs.nav-justified > li > a {
- text-align: center;
- margin-bottom: 5px;
-}
-.nav-tabs.nav-justified > .dropdown .dropdown-menu {
- top: auto;
- left: auto;
-}
-@media (min-width: 768px) {
- .nav-tabs.nav-justified > li {
- display: table-cell;
- width: 1%;
- }
- .nav-tabs.nav-justified > li > a {
- margin-bottom: 0;
- }
-}
-.nav-tabs.nav-justified > li > a {
- margin-right: 0;
- border-radius: 4px;
-}
-.nav-tabs.nav-justified > .active > a,
-.nav-tabs.nav-justified > .active > a:hover,
-.nav-tabs.nav-justified > .active > a:focus {
- border: 1px solid #ddd;
-}
-@media (min-width: 768px) {
- .nav-tabs.nav-justified > li > a {
- border-bottom: 1px solid #ddd;
- border-radius: 4px 4px 0 0;
- }
- .nav-tabs.nav-justified > .active > a,
- .nav-tabs.nav-justified > .active > a:hover,
- .nav-tabs.nav-justified > .active > a:focus {
- border-bottom-color: #fff;
- }
-}
-.nav-pills > li {
- float: left;
-}
-.nav-pills > li > a {
- border-radius: 4px;
-}
-.nav-pills > li + li {
- margin-left: 2px;
-}
-.nav-pills > li.active > a,
-.nav-pills > li.active > a:hover,
-.nav-pills > li.active > a:focus {
- color: #fff;
- background-color: #337ab7;
-}
-.nav-stacked > li {
- float: none;
-}
-.nav-stacked > li + li {
- margin-top: 2px;
- margin-left: 0;
-}
-.nav-justified {
- width: 100%;
-}
-.nav-justified > li {
- float: none;
-}
-.nav-justified > li > a {
- text-align: center;
- margin-bottom: 5px;
-}
-.nav-justified > .dropdown .dropdown-menu {
- top: auto;
- left: auto;
-}
-@media (min-width: 768px) {
- .nav-justified > li {
- display: table-cell;
- width: 1%;
- }
- .nav-justified > li > a {
- margin-bottom: 0;
- }
-}
-.nav-tabs-justified {
- border-bottom: 0;
-}
-.nav-tabs-justified > li > a {
- margin-right: 0;
- border-radius: 4px;
-}
-.nav-tabs-justified > .active > a,
-.nav-tabs-justified > .active > a:hover,
-.nav-tabs-justified > .active > a:focus {
- border: 1px solid #ddd;
-}
-@media (min-width: 768px) {
- .nav-tabs-justified > li > a {
- border-bottom: 1px solid #ddd;
- border-radius: 4px 4px 0 0;
- }
- .nav-tabs-justified > .active > a,
- .nav-tabs-justified > .active > a:hover,
- .nav-tabs-justified > .active > a:focus {
- border-bottom-color: #fff;
- }
-}
-.tab-content > .tab-pane {
- display: none;
-}
-.tab-content > .active {
- display: block;
-}
-.nav-tabs .dropdown-menu {
- margin-top: -1px;
- border-top-right-radius: 0;
- border-top-left-radius: 0;
-}
-.navbar {
- position: relative;
- min-height: 32px;
- margin-bottom: 20px;
- border: 1px solid transparent;
-}
-@media (min-width: 768px) {
- .navbar {
- border-radius: 4px;
- }
-}
-@media (min-width: 768px) {
- .navbar-header {
- float: left;
- }
-}
-.navbar-collapse {
- overflow-x: visible;
- padding-right: 15px;
- padding-left: 15px;
- border-top: 1px solid transparent;
- box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
- -webkit-overflow-scrolling: touch;
-}
-.navbar-collapse.in {
- overflow-y: auto;
-}
-@media (min-width: 768px) {
- .navbar-collapse {
- width: auto;
- border-top: 0;
- box-shadow: none;
- }
- .navbar-collapse.collapse {
- display: block !important;
- height: auto !important;
- padding-bottom: 0;
- overflow: visible !important;
- }
- .navbar-collapse.in {
- overflow-y: visible;
- }
- .navbar-fixed-top .navbar-collapse,
- .navbar-static-top .navbar-collapse,
- .navbar-fixed-bottom .navbar-collapse {
- padding-left: 0;
- padding-right: 0;
- }
-}
-.navbar-fixed-top .navbar-collapse,
-.navbar-fixed-bottom .navbar-collapse {
- max-height: 340px;
-}
-@media (max-device-width: 480px) and (orientation: landscape) {
- .navbar-fixed-top .navbar-collapse,
- .navbar-fixed-bottom .navbar-collapse {
- max-height: 200px;
- }
-}
-.container > .navbar-header,
-.container-fluid > .navbar-header,
-.container > .navbar-collapse,
-.container-fluid > .navbar-collapse {
- margin-right: -15px;
- margin-left: -15px;
-}
-@media (min-width: 768px) {
- .container > .navbar-header,
- .container-fluid > .navbar-header,
- .container > .navbar-collapse,
- .container-fluid > .navbar-collapse {
- margin-right: 0;
- margin-left: 0;
- }
-}
-.navbar-static-top {
- z-index: 1000;
- border-width: 0 0 1px;
-}
-@media (min-width: 768px) {
- .navbar-static-top {
- border-radius: 0;
- }
-}
-.navbar-fixed-top,
-.navbar-fixed-bottom {
- position: fixed;
- right: 0;
- left: 0;
- z-index: 1030;
-}
-@media (min-width: 768px) {
- .navbar-fixed-top,
- .navbar-fixed-bottom {
- border-radius: 0;
- }
-}
-.navbar-fixed-top {
- top: 0;
- border-width: 0 0 1px;
-}
-.navbar-fixed-bottom {
- bottom: 0;
- margin-bottom: 0;
- border-width: 1px 0 0;
-}
-.navbar-brand {
- float: left;
- padding: 6px 15px;
- font-size: 18px;
- line-height: 20px;
- height: 32px;
-}
-.navbar-brand:hover,
-.navbar-brand:focus {
- text-decoration: none;
-}
-.navbar-brand > img {
- display: block;
-}
-@media (min-width: 768px) {
- .navbar > .container .navbar-brand,
- .navbar > .container-fluid .navbar-brand {
- margin-left: -15px;
- }
-}
-.navbar-toggle {
- position: relative;
- float: right;
- margin-right: 15px;
- padding: 9px 10px;
- margin-top: -1px;
- margin-bottom: -1px;
- background-color: transparent;
- background-image: none;
- border: 1px solid transparent;
- border-radius: 4px;
-}
-.navbar-toggle:focus {
- outline: 0;
-}
-.navbar-toggle .icon-bar {
- display: block;
- width: 22px;
- height: 2px;
- border-radius: 1px;
-}
-.navbar-toggle .icon-bar + .icon-bar {
- margin-top: 4px;
-}
-@media (min-width: 768px) {
- .navbar-toggle {
- display: none;
- }
-}
-.navbar-nav {
- margin: 3px -15px;
-}
-.navbar-nav > li > a {
- padding-top: 10px;
- padding-bottom: 10px;
- line-height: 20px;
-}
-@media (max-width: 767px) {
- .navbar-nav .open .dropdown-menu {
- position: static;
- float: none;
- width: auto;
- margin-top: 0;
- background-color: transparent;
- border: 0;
- box-shadow: none;
- }
- .navbar-nav .open .dropdown-menu > li > a,
- .navbar-nav .open .dropdown-menu .dropdown-header {
- padding: 5px 15px 5px 25px;
- }
- .navbar-nav .open .dropdown-menu > li > a {
- line-height: 20px;
- }
- .navbar-nav .open .dropdown-menu > li > a:hover,
- .navbar-nav .open .dropdown-menu > li > a:focus {
- background-image: none;
- }
-}
-@media (min-width: 768px) {
- .navbar-nav {
- float: left;
- margin: 0;
- }
- .navbar-nav > li {
- float: left;
- }
- .navbar-nav > li > a {
- padding-top: 6px;
- padding-bottom: 6px;
- }
-}
-.navbar-form {
- margin-left: -15px;
- margin-right: -15px;
- padding: 10px 15px;
- border-top: 1px solid transparent;
- border-bottom: 1px solid transparent;
- -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1);
- box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1);
- margin-top: -1px;
- margin-bottom: -1px;
-}
-@media (min-width: 768px) {
- .navbar-form .form-group {
- display: inline-block;
- margin-bottom: 0;
- vertical-align: middle;
- }
- .navbar-form .form-control {
- display: inline-block;
- width: auto;
- vertical-align: middle;
- }
- .navbar-form .form-control-static {
- display: inline-block;
- }
- .navbar-form .input-group {
- display: inline-table;
- vertical-align: middle;
- }
- .navbar-form .input-group .input-group-addon,
- .navbar-form .input-group .input-group-btn,
- .navbar-form .input-group .form-control {
- width: auto;
- }
- .navbar-form .input-group > .form-control {
- width: 100%;
- }
- .navbar-form .control-label {
- margin-bottom: 0;
- vertical-align: middle;
- }
- .navbar-form .radio,
- .navbar-form .checkbox {
- display: inline-block;
- margin-top: 0;
- margin-bottom: 0;
- vertical-align: middle;
- }
- .navbar-form .radio label,
- .navbar-form .checkbox label {
- padding-left: 0;
- }
- .navbar-form .radio input[type="radio"],
- .navbar-form .checkbox input[type="checkbox"] {
- position: relative;
- margin-left: 0;
- }
- .navbar-form .has-feedback .form-control-feedback {
- top: 0;
- }
-}
-@media (max-width: 767px) {
- .navbar-form .form-group {
- margin-bottom: 5px;
- }
- .navbar-form .form-group:last-child {
- margin-bottom: 0;
- }
-}
-@media (min-width: 768px) {
- .navbar-form {
- width: auto;
- border: 0;
- margin-left: 0;
- margin-right: 0;
- padding-top: 0;
- padding-bottom: 0;
- -webkit-box-shadow: none;
- box-shadow: none;
- }
-}
-.navbar-nav > li > .dropdown-menu {
- margin-top: 0;
- border-top-right-radius: 0;
- border-top-left-radius: 0;
-}
-.navbar-fixed-bottom .navbar-nav > li > .dropdown-menu {
- margin-bottom: 0;
- border-top-right-radius: 4px;
- border-top-left-radius: 4px;
- border-bottom-right-radius: 0;
- border-bottom-left-radius: 0;
-}
-.navbar-btn {
- margin-top: -1px;
- margin-bottom: -1px;
-}
-.navbar-btn.btn-sm {
- margin-top: 1px;
- margin-bottom: 1px;
-}
-.navbar-btn.btn-xs {
- margin-top: 5px;
- margin-bottom: 5px;
-}
-.navbar-text {
- margin-top: 6px;
- margin-bottom: 6px;
-}
-@media (min-width: 768px) {
- .navbar-text {
- float: left;
- margin-left: 15px;
- margin-right: 15px;
- }
-}
-@media (min-width: 768px) {
- .navbar-left {
- float: left !important;
- float: left;
- }
- .navbar-right {
- float: right !important;
- float: right;
- margin-right: -15px;
- }
- .navbar-right ~ .navbar-right {
- margin-right: 0;
- }
-}
-.navbar-default {
- background-color: #ffffff;
- border-color: #e0e0e0;
-}
-.navbar-default .navbar-brand {
- color: #303030;
-}
-.navbar-default .navbar-brand:hover,
-.navbar-default .navbar-brand:focus {
- color: #161616;
- background-color: transparent;
-}
-.navbar-default .navbar-text {
- color: #303030;
-}
-.navbar-default .navbar-nav > li > a {
- color: #303030;
-}
-.navbar-default .navbar-nav > li > a:hover,
-.navbar-default .navbar-nav > li > a:focus {
- color: #333;
- background-color: transparent;
-}
-.navbar-default .navbar-nav > .active > a,
-.navbar-default .navbar-nav > .active > a:hover,
-.navbar-default .navbar-nav > .active > a:focus {
- color: #555;
- background-color: #eeeeee;
-}
-.navbar-default .navbar-nav > .disabled > a,
-.navbar-default .navbar-nav > .disabled > a:hover,
-.navbar-default .navbar-nav > .disabled > a:focus {
- color: #ccc;
- background-color: transparent;
-}
-.navbar-default .navbar-toggle {
- border-color: #ddd;
-}
-.navbar-default .navbar-toggle:hover,
-.navbar-default .navbar-toggle:focus {
- background-color: #ddd;
-}
-.navbar-default .navbar-toggle .icon-bar {
- background-color: #888;
-}
-.navbar-default .navbar-collapse,
-.navbar-default .navbar-form {
- border-color: #e0e0e0;
-}
-.navbar-default .navbar-nav > .open > a,
-.navbar-default .navbar-nav > .open > a:hover,
-.navbar-default .navbar-nav > .open > a:focus {
- background-color: #eeeeee;
- color: #555;
-}
-@media (max-width: 767px) {
- .navbar-default .navbar-nav .open .dropdown-menu > li > a {
- color: #303030;
- }
- .navbar-default .navbar-nav .open .dropdown-menu > li > a:hover,
- .navbar-default .navbar-nav .open .dropdown-menu > li > a:focus {
- color: #333;
- background-color: transparent;
- }
- .navbar-default .navbar-nav .open .dropdown-menu > .active > a,
- .navbar-default .navbar-nav .open .dropdown-menu > .active > a:hover,
- .navbar-default .navbar-nav .open .dropdown-menu > .active > a:focus {
- color: #555;
- background-color: #eeeeee;
- }
- .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a,
- .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a:hover,
- .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a:focus {
- color: #ccc;
- background-color: transparent;
- }
-}
-.navbar-default .navbar-link {
- color: #303030;
-}
-.navbar-default .navbar-link:hover {
- color: #333;
-}
-.navbar-default .btn-link {
- color: #303030;
-}
-.navbar-default .btn-link:hover,
-.navbar-default .btn-link:focus {
- color: #333;
-}
-.navbar-default .btn-link[disabled]:hover,
-fieldset[disabled] .navbar-default .btn-link:hover,
-.navbar-default .btn-link[disabled]:focus,
-fieldset[disabled] .navbar-default .btn-link:focus {
- color: #ccc;
-}
-.navbar-inverse {
- background-color: #222;
- border-color: #080808;
-}
-.navbar-inverse .navbar-brand {
- color: #9d9d9d;
-}
-.navbar-inverse .navbar-brand:hover,
-.navbar-inverse .navbar-brand:focus {
- color: #fff;
- background-color: transparent;
-}
-.navbar-inverse .navbar-text {
- color: #9d9d9d;
-}
-.navbar-inverse .navbar-nav > li > a {
- color: #9d9d9d;
-}
-.navbar-inverse .navbar-nav > li > a:hover,
-.navbar-inverse .navbar-nav > li > a:focus {
- color: #fff;
- background-color: transparent;
-}
-.navbar-inverse .navbar-nav > .active > a,
-.navbar-inverse .navbar-nav > .active > a:hover,
-.navbar-inverse .navbar-nav > .active > a:focus {
- color: #fff;
- background-color: #080808;
-}
-.navbar-inverse .navbar-nav > .disabled > a,
-.navbar-inverse .navbar-nav > .disabled > a:hover,
-.navbar-inverse .navbar-nav > .disabled > a:focus {
- color: #444;
- background-color: transparent;
-}
-.navbar-inverse .navbar-toggle {
- border-color: #333;
-}
-.navbar-inverse .navbar-toggle:hover,
-.navbar-inverse .navbar-toggle:focus {
- background-color: #333;
-}
-.navbar-inverse .navbar-toggle .icon-bar {
- background-color: #fff;
-}
-.navbar-inverse .navbar-collapse,
-.navbar-inverse .navbar-form {
- border-color: #101010;
-}
-.navbar-inverse .navbar-nav > .open > a,
-.navbar-inverse .navbar-nav > .open > a:hover,
-.navbar-inverse .navbar-nav > .open > a:focus {
- background-color: #080808;
- color: #fff;
-}
-@media (max-width: 767px) {
- .navbar-inverse .navbar-nav .open .dropdown-menu > .dropdown-header {
- border-color: #080808;
- }
- .navbar-inverse .navbar-nav .open .dropdown-menu .divider {
- background-color: #080808;
- }
- .navbar-inverse .navbar-nav .open .dropdown-menu > li > a {
- color: #9d9d9d;
- }
- .navbar-inverse .navbar-nav .open .dropdown-menu > li > a:hover,
- .navbar-inverse .navbar-nav .open .dropdown-menu > li > a:focus {
- color: #fff;
- background-color: transparent;
- }
- .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a,
- .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a:hover,
- .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a:focus {
- color: #fff;
- background-color: #080808;
- }
- .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a,
- .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a:hover,
- .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a:focus {
- color: #444;
- background-color: transparent;
- }
-}
-.navbar-inverse .navbar-link {
- color: #9d9d9d;
-}
-.navbar-inverse .navbar-link:hover {
- color: #fff;
-}
-.navbar-inverse .btn-link {
- color: #9d9d9d;
-}
-.navbar-inverse .btn-link:hover,
-.navbar-inverse .btn-link:focus {
- color: #fff;
-}
-.navbar-inverse .btn-link[disabled]:hover,
-fieldset[disabled] .navbar-inverse .btn-link:hover,
-.navbar-inverse .btn-link[disabled]:focus,
-fieldset[disabled] .navbar-inverse .btn-link:focus {
- color: #444;
-}
-.breadcrumb {
- padding: 8px 15px;
- margin-bottom: 20px;
- list-style: none;
- background-color: #f5f5f5;
- border-radius: 4px;
-}
-.breadcrumb > li {
- display: inline-block;
-}
-.breadcrumb > li + li:before {
- content: "/\00a0";
- padding: 0 5px;
- color: #ccc;
-}
-.breadcrumb > .active {
- color: #777777;
-}
-.pagination {
- display: inline-block;
- padding-left: 0;
- margin: 20px 0;
- border-radius: 4px;
-}
-.pagination > li {
- display: inline;
-}
-.pagination > li > a,
-.pagination > li > span {
- position: relative;
- float: left;
- padding: 6px 12px;
- line-height: 1.42857143;
- text-decoration: none;
- color: #337ab7;
- background-color: #fff;
- border: 1px solid #ddd;
- margin-left: -1px;
-}
-.pagination > li:first-child > a,
-.pagination > li:first-child > span {
- margin-left: 0;
- border-bottom-left-radius: 4px;
- border-top-left-radius: 4px;
-}
-.pagination > li:last-child > a,
-.pagination > li:last-child > span {
- border-bottom-right-radius: 4px;
- border-top-right-radius: 4px;
-}
-.pagination > li > a:hover,
-.pagination > li > span:hover,
-.pagination > li > a:focus,
-.pagination > li > span:focus {
- z-index: 2;
- color: #23527c;
- background-color: #eeeeee;
- border-color: #ddd;
-}
-.pagination > .active > a,
-.pagination > .active > span,
-.pagination > .active > a:hover,
-.pagination > .active > span:hover,
-.pagination > .active > a:focus,
-.pagination > .active > span:focus {
- z-index: 3;
- color: #fff;
- background-color: #337ab7;
- border-color: #337ab7;
- cursor: default;
-}
-.pagination > .disabled > span,
-.pagination > .disabled > span:hover,
-.pagination > .disabled > span:focus,
-.pagination > .disabled > a,
-.pagination > .disabled > a:hover,
-.pagination > .disabled > a:focus {
- color: #777777;
- background-color: #fff;
- border-color: #ddd;
- cursor: not-allowed;
-}
-.pagination-lg > li > a,
-.pagination-lg > li > span {
- padding: 10px 16px;
- font-size: 18px;
- line-height: 1.3333333;
-}
-.pagination-lg > li:first-child > a,
-.pagination-lg > li:first-child > span {
- border-bottom-left-radius: 6px;
- border-top-left-radius: 6px;
-}
-.pagination-lg > li:last-child > a,
-.pagination-lg > li:last-child > span {
- border-bottom-right-radius: 6px;
- border-top-right-radius: 6px;
-}
-.pagination-sm > li > a,
-.pagination-sm > li > span {
- padding: 5px 10px;
- font-size: 12px;
- line-height: 1.5;
-}
-.pagination-sm > li:first-child > a,
-.pagination-sm > li:first-child > span {
- border-bottom-left-radius: 3px;
- border-top-left-radius: 3px;
-}
-.pagination-sm > li:last-child > a,
-.pagination-sm > li:last-child > span {
- border-bottom-right-radius: 3px;
- border-top-right-radius: 3px;
-}
-.pager {
- padding-left: 0;
- margin: 20px 0;
- list-style: none;
- text-align: center;
-}
-.pager li {
- display: inline;
-}
-.pager li > a,
-.pager li > span {
- display: inline-block;
- padding: 5px 14px;
- background-color: #fff;
- border: 1px solid #ddd;
- border-radius: 15px;
-}
-.pager li > a:hover,
-.pager li > a:focus {
- text-decoration: none;
- background-color: #eeeeee;
-}
-.pager .next > a,
-.pager .next > span {
- float: right;
-}
-.pager .previous > a,
-.pager .previous > span {
- float: left;
-}
-.pager .disabled > a,
-.pager .disabled > a:hover,
-.pager .disabled > a:focus,
-.pager .disabled > span {
- color: #777777;
- background-color: #fff;
- cursor: not-allowed;
-}
-.label {
- display: inline;
- padding: .2em .6em .3em;
- font-size: 75%;
- font-weight: bold;
- line-height: 1;
- color: #fff;
- text-align: center;
- white-space: nowrap;
- vertical-align: baseline;
- border-radius: .25em;
-}
-a.label:hover,
-a.label:focus {
- color: #fff;
- text-decoration: none;
- cursor: pointer;
-}
-.label:empty {
- display: none;
-}
-.btn .label {
- position: relative;
- top: -1px;
-}
-.label-default {
- background-color: #777777;
-}
-.label-default[href]:hover,
-.label-default[href]:focus {
- background-color: #5e5e5e;
-}
-.label-primary {
- background-color: #337ab7;
-}
-.label-primary[href]:hover,
-.label-primary[href]:focus {
- background-color: #286090;
-}
-.label-success {
- background-color: #5cb85c;
-}
-.label-success[href]:hover,
-.label-success[href]:focus {
- background-color: #449d44;
-}
-.label-info {
- background-color: #5bc0de;
-}
-.label-info[href]:hover,
-.label-info[href]:focus {
- background-color: #31b0d5;
-}
-.label-warning {
- background-color: #f0ad4e;
-}
-.label-warning[href]:hover,
-.label-warning[href]:focus {
- background-color: #ec971f;
-}
-.label-danger {
- background-color: #d9534f;
-}
-.label-danger[href]:hover,
-.label-danger[href]:focus {
- background-color: #c9302c;
-}
-.badge {
- display: inline-block;
- min-width: 10px;
- padding: 3px 7px;
- font-size: 12px;
- font-weight: bold;
- color: #fff;
- line-height: 1;
- vertical-align: middle;
- white-space: nowrap;
- text-align: center;
- background-color: #777777;
- border-radius: 10px;
-}
-.badge:empty {
- display: none;
-}
-.btn .badge {
- position: relative;
- top: -1px;
-}
-.btn-xs .badge,
-.btn-group-xs > .btn .badge {
- top: 0;
- padding: 1px 5px;
-}
-a.badge:hover,
-a.badge:focus {
- color: #fff;
- text-decoration: none;
- cursor: pointer;
-}
-.list-group-item.active > .badge,
-.nav-pills > .active > a > .badge {
- color: #337ab7;
- background-color: #fff;
-}
-.list-group-item > .badge {
- float: right;
-}
-.list-group-item > .badge + .badge {
- margin-right: 5px;
-}
-.nav-pills > li > a > .badge {
- margin-left: 3px;
-}
-.jumbotron {
- padding-top: 30px;
- padding-bottom: 30px;
- margin-bottom: 30px;
- color: inherit;
- background-color: #eeeeee;
-}
-.jumbotron h1,
-.jumbotron .h1 {
- color: inherit;
-}
-.jumbotron p {
- margin-bottom: 15px;
- font-size: 21px;
- font-weight: 200;
-}
-.jumbotron > hr {
- border-top-color: #d5d5d5;
-}
-.container .jumbotron,
-.container-fluid .jumbotron {
- border-radius: 6px;
- padding-left: 15px;
- padding-right: 15px;
-}
-.jumbotron .container {
- max-width: 100%;
-}
-@media screen and (min-width: 768px) {
- .jumbotron {
- padding-top: 48px;
- padding-bottom: 48px;
- }
- .container .jumbotron,
- .container-fluid .jumbotron {
- padding-left: 60px;
- padding-right: 60px;
- }
- .jumbotron h1,
- .jumbotron .h1 {
- font-size: 63px;
- }
-}
-.thumbnail {
- display: block;
- padding: 4px;
- margin-bottom: 20px;
- line-height: 1.42857143;
- background-color: #fff;
- border: 1px solid #ddd;
- border-radius: 4px;
- -webkit-transition: border 0.2s ease-in-out;
- -o-transition: border 0.2s ease-in-out;
- transition: border 0.2s ease-in-out;
-}
-.thumbnail > img,
-.thumbnail a > img {
- margin-left: auto;
- margin-right: auto;
-}
-a.thumbnail:hover,
-a.thumbnail:focus,
-a.thumbnail.active {
- border-color: #337ab7;
-}
-.thumbnail .caption {
- padding: 9px;
- color: #333333;
-}
-.alert {
- padding: 15px;
- margin-bottom: 20px;
- border: 1px solid transparent;
- border-radius: 4px;
-}
-.alert h4 {
- margin-top: 0;
- color: inherit;
-}
-.alert .alert-link {
- font-weight: bold;
-}
-.alert > p,
-.alert > ul {
- margin-bottom: 0;
-}
-.alert > p + p {
- margin-top: 5px;
-}
-.alert-dismissable,
-.alert-dismissible {
- padding-right: 35px;
-}
-.alert-dismissable .close,
-.alert-dismissible .close {
- position: relative;
- top: -2px;
- right: -21px;
- color: inherit;
-}
-.alert-success {
- background-color: #dff0d8;
- border-color: #d6e9c6;
- color: #3c763d;
-}
-.alert-success hr {
- border-top-color: #c9e2b3;
-}
-.alert-success .alert-link {
- color: #2b542c;
-}
-.alert-info {
- background-color: #d9edf7;
- border-color: #bce8f1;
- color: #31708f;
-}
-.alert-info hr {
- border-top-color: #a6e1ec;
-}
-.alert-info .alert-link {
- color: #245269;
-}
-.alert-warning {
- background-color: #fcf8e3;
- border-color: #faebcc;
- color: #8a6d3b;
-}
-.alert-warning hr {
- border-top-color: #f7e1b5;
-}
-.alert-warning .alert-link {
- color: #66512c;
-}
-.alert-danger {
- background-color: #f2dede;
- border-color: #ebccd1;
- color: #a94442;
-}
-.alert-danger hr {
- border-top-color: #e4b9c0;
-}
-.alert-danger .alert-link {
- color: #843534;
-}
-@-webkit-keyframes progress-bar-stripes {
- from {
- background-position: 40px 0;
- }
- to {
- background-position: 0 0;
- }
-}
-@keyframes progress-bar-stripes {
- from {
- background-position: 40px 0;
- }
- to {
- background-position: 0 0;
- }
-}
-.progress {
- overflow: hidden;
- height: 20px;
- margin-bottom: 20px;
- background-color: #f5f5f5;
- border-radius: 4px;
- -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
- box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
-}
-.progress-bar {
- float: left;
- width: 0%;
- height: 100%;
- font-size: 12px;
- line-height: 20px;
- color: #fff;
- text-align: center;
- background-color: #337ab7;
- -webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15);
- box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15);
- -webkit-transition: width 0.6s ease;
- -o-transition: width 0.6s ease;
- transition: width 0.6s ease;
-}
-.progress-striped .progress-bar,
-.progress-bar-striped {
- background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
- background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
- background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
- background-size: 40px 40px;
-}
-.progress.active .progress-bar,
-.progress-bar.active {
- -webkit-animation: progress-bar-stripes 2s linear infinite;
- -o-animation: progress-bar-stripes 2s linear infinite;
- animation: progress-bar-stripes 2s linear infinite;
-}
-.progress-bar-success {
- background-color: #5cb85c;
-}
-.progress-striped .progress-bar-success {
- background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
- background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
- background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
-}
-.progress-bar-info {
- background-color: #5bc0de;
-}
-.progress-striped .progress-bar-info {
- background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
- background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
- background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
-}
-.progress-bar-warning {
- background-color: #f0ad4e;
-}
-.progress-striped .progress-bar-warning {
- background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
- background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
- background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
-}
-.progress-bar-danger {
- background-color: #d9534f;
-}
-.progress-striped .progress-bar-danger {
- background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
- background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
- background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
-}
-.media {
- margin-top: 15px;
-}
-.media:first-child {
- margin-top: 0;
-}
-.media,
-.media-body {
- zoom: 1;
- overflow: hidden;
-}
-.media-body {
- width: 10000px;
-}
-.media-object {
- display: block;
-}
-.media-object.img-thumbnail {
- max-width: none;
-}
-.media-right,
-.media > .pull-right {
- padding-left: 10px;
-}
-.media-left,
-.media > .pull-left {
- padding-right: 10px;
-}
-.media-left,
-.media-right,
-.media-body {
- display: table-cell;
- vertical-align: top;
-}
-.media-middle {
- vertical-align: middle;
-}
-.media-bottom {
- vertical-align: bottom;
-}
-.media-heading {
- margin-top: 0;
- margin-bottom: 5px;
-}
-.media-list {
- padding-left: 0;
- list-style: none;
-}
-.list-group {
- margin-bottom: 20px;
- padding-left: 0;
-}
-.list-group-item {
- position: relative;
- display: block;
- padding: 10px 15px;
- margin-bottom: -1px;
- background-color: #fff;
- border: 1px solid #ddd;
-}
-.list-group-item:first-child {
- border-top-right-radius: 4px;
- border-top-left-radius: 4px;
-}
-.list-group-item:last-child {
- margin-bottom: 0;
- border-bottom-right-radius: 4px;
- border-bottom-left-radius: 4px;
-}
-a.list-group-item,
-button.list-group-item {
- color: #555;
-}
-a.list-group-item .list-group-item-heading,
-button.list-group-item .list-group-item-heading {
- color: #333;
-}
-a.list-group-item:hover,
-button.list-group-item:hover,
-a.list-group-item:focus,
-button.list-group-item:focus {
- text-decoration: none;
- color: #555;
- background-color: #f5f5f5;
-}
-button.list-group-item {
- width: 100%;
- text-align: left;
-}
-.list-group-item.disabled,
-.list-group-item.disabled:hover,
-.list-group-item.disabled:focus {
- background-color: #eeeeee;
- color: #777777;
- cursor: not-allowed;
-}
-.list-group-item.disabled .list-group-item-heading,
-.list-group-item.disabled:hover .list-group-item-heading,
-.list-group-item.disabled:focus .list-group-item-heading {
- color: inherit;
-}
-.list-group-item.disabled .list-group-item-text,
-.list-group-item.disabled:hover .list-group-item-text,
-.list-group-item.disabled:focus .list-group-item-text {
- color: #777777;
-}
-.list-group-item.active,
-.list-group-item.active:hover,
-.list-group-item.active:focus {
- z-index: 2;
- color: #fff;
- background-color: #337ab7;
- border-color: #337ab7;
-}
-.list-group-item.active .list-group-item-heading,
-.list-group-item.active:hover .list-group-item-heading,
-.list-group-item.active:focus .list-group-item-heading,
-.list-group-item.active .list-group-item-heading > small,
-.list-group-item.active:hover .list-group-item-heading > small,
-.list-group-item.active:focus .list-group-item-heading > small,
-.list-group-item.active .list-group-item-heading > .small,
-.list-group-item.active:hover .list-group-item-heading > .small,
-.list-group-item.active:focus .list-group-item-heading > .small {
- color: inherit;
-}
-.list-group-item.active .list-group-item-text,
-.list-group-item.active:hover .list-group-item-text,
-.list-group-item.active:focus .list-group-item-text {
- color: #c7ddef;
-}
-.list-group-item-success {
- color: #3c763d;
- background-color: #dff0d8;
-}
-a.list-group-item-success,
-button.list-group-item-success {
- color: #3c763d;
-}
-a.list-group-item-success .list-group-item-heading,
-button.list-group-item-success .list-group-item-heading {
- color: inherit;
-}
-a.list-group-item-success:hover,
-button.list-group-item-success:hover,
-a.list-group-item-success:focus,
-button.list-group-item-success:focus {
- color: #3c763d;
- background-color: #d0e9c6;
-}
-a.list-group-item-success.active,
-button.list-group-item-success.active,
-a.list-group-item-success.active:hover,
-button.list-group-item-success.active:hover,
-a.list-group-item-success.active:focus,
-button.list-group-item-success.active:focus {
- color: #fff;
- background-color: #3c763d;
- border-color: #3c763d;
-}
-.list-group-item-info {
- color: #31708f;
- background-color: #d9edf7;
-}
-a.list-group-item-info,
-button.list-group-item-info {
- color: #31708f;
-}
-a.list-group-item-info .list-group-item-heading,
-button.list-group-item-info .list-group-item-heading {
- color: inherit;
-}
-a.list-group-item-info:hover,
-button.list-group-item-info:hover,
-a.list-group-item-info:focus,
-button.list-group-item-info:focus {
- color: #31708f;
- background-color: #c4e3f3;
-}
-a.list-group-item-info.active,
-button.list-group-item-info.active,
-a.list-group-item-info.active:hover,
-button.list-group-item-info.active:hover,
-a.list-group-item-info.active:focus,
-button.list-group-item-info.active:focus {
- color: #fff;
- background-color: #31708f;
- border-color: #31708f;
-}
-.list-group-item-warning {
- color: #8a6d3b;
- background-color: #fcf8e3;
-}
-a.list-group-item-warning,
-button.list-group-item-warning {
- color: #8a6d3b;
-}
-a.list-group-item-warning .list-group-item-heading,
-button.list-group-item-warning .list-group-item-heading {
- color: inherit;
-}
-a.list-group-item-warning:hover,
-button.list-group-item-warning:hover,
-a.list-group-item-warning:focus,
-button.list-group-item-warning:focus {
- color: #8a6d3b;
- background-color: #faf2cc;
-}
-a.list-group-item-warning.active,
-button.list-group-item-warning.active,
-a.list-group-item-warning.active:hover,
-button.list-group-item-warning.active:hover,
-a.list-group-item-warning.active:focus,
-button.list-group-item-warning.active:focus {
- color: #fff;
- background-color: #8a6d3b;
- border-color: #8a6d3b;
-}
-.list-group-item-danger {
- color: #a94442;
- background-color: #f2dede;
-}
-a.list-group-item-danger,
-button.list-group-item-danger {
- color: #a94442;
-}
-a.list-group-item-danger .list-group-item-heading,
-button.list-group-item-danger .list-group-item-heading {
- color: inherit;
-}
-a.list-group-item-danger:hover,
-button.list-group-item-danger:hover,
-a.list-group-item-danger:focus,
-button.list-group-item-danger:focus {
- color: #a94442;
- background-color: #ebcccc;
-}
-a.list-group-item-danger.active,
-button.list-group-item-danger.active,
-a.list-group-item-danger.active:hover,
-button.list-group-item-danger.active:hover,
-a.list-group-item-danger.active:focus,
-button.list-group-item-danger.active:focus {
- color: #fff;
- background-color: #a94442;
- border-color: #a94442;
-}
-.list-group-item-heading {
- margin-top: 0;
- margin-bottom: 5px;
-}
-.list-group-item-text {
- margin-bottom: 0;
- line-height: 1.3;
-}
-.panel {
- margin-bottom: 20px;
- background-color: #fff;
- border: 1px solid transparent;
- border-radius: 4px;
- -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
- box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
-}
-.panel-body {
- padding: 15px;
-}
-.panel-heading {
- padding: 10px 15px;
- border-bottom: 1px solid transparent;
- border-top-right-radius: 3px;
- border-top-left-radius: 3px;
-}
-.panel-heading > .dropdown .dropdown-toggle {
- color: inherit;
-}
-.panel-title {
- margin-top: 0;
- margin-bottom: 0;
- font-size: 16px;
- color: inherit;
-}
-.panel-title > a,
-.panel-title > small,
-.panel-title > .small,
-.panel-title > small > a,
-.panel-title > .small > a {
- color: inherit;
-}
-.panel-footer {
- padding: 10px 15px;
- background-color: #f5f5f5;
- border-top: 1px solid #ddd;
- border-bottom-right-radius: 3px;
- border-bottom-left-radius: 3px;
-}
-.panel > .list-group,
-.panel > .panel-collapse > .list-group {
- margin-bottom: 0;
-}
-.panel > .list-group .list-group-item,
-.panel > .panel-collapse > .list-group .list-group-item {
- border-width: 1px 0;
- border-radius: 0;
-}
-.panel > .list-group:first-child .list-group-item:first-child,
-.panel > .panel-collapse > .list-group:first-child .list-group-item:first-child {
- border-top: 0;
- border-top-right-radius: 3px;
- border-top-left-radius: 3px;
-}
-.panel > .list-group:last-child .list-group-item:last-child,
-.panel > .panel-collapse > .list-group:last-child .list-group-item:last-child {
- border-bottom: 0;
- border-bottom-right-radius: 3px;
- border-bottom-left-radius: 3px;
-}
-.panel > .panel-heading + .panel-collapse > .list-group .list-group-item:first-child {
- border-top-right-radius: 0;
- border-top-left-radius: 0;
-}
-.panel-heading + .list-group .list-group-item:first-child {
- border-top-width: 0;
-}
-.list-group + .panel-footer {
- border-top-width: 0;
-}
-.panel > .table,
-.panel > .table-responsive > .table,
-.panel > .panel-collapse > .table {
- margin-bottom: 0;
-}
-.panel > .table caption,
-.panel > .table-responsive > .table caption,
-.panel > .panel-collapse > .table caption {
- padding-left: 15px;
- padding-right: 15px;
-}
-.panel > .table:first-child,
-.panel > .table-responsive:first-child > .table:first-child {
- border-top-right-radius: 3px;
- border-top-left-radius: 3px;
-}
-.panel > .table:first-child > thead:first-child > tr:first-child,
-.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child,
-.panel > .table:first-child > tbody:first-child > tr:first-child,
-.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child {
- border-top-left-radius: 3px;
- border-top-right-radius: 3px;
-}
-.panel > .table:first-child > thead:first-child > tr:first-child td:first-child,
-.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child td:first-child,
-.panel > .table:first-child > tbody:first-child > tr:first-child td:first-child,
-.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child td:first-child,
-.panel > .table:first-child > thead:first-child > tr:first-child th:first-child,
-.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child th:first-child,
-.panel > .table:first-child > tbody:first-child > tr:first-child th:first-child,
-.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child th:first-child {
- border-top-left-radius: 3px;
-}
-.panel > .table:first-child > thead:first-child > tr:first-child td:last-child,
-.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child td:last-child,
-.panel > .table:first-child > tbody:first-child > tr:first-child td:last-child,
-.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child td:last-child,
-.panel > .table:first-child > thead:first-child > tr:first-child th:last-child,
-.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child th:last-child,
-.panel > .table:first-child > tbody:first-child > tr:first-child th:last-child,
-.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child th:last-child {
- border-top-right-radius: 3px;
-}
-.panel > .table:last-child,
-.panel > .table-responsive:last-child > .table:last-child {
- border-bottom-right-radius: 3px;
- border-bottom-left-radius: 3px;
-}
-.panel > .table:last-child > tbody:last-child > tr:last-child,
-.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child,
-.panel > .table:last-child > tfoot:last-child > tr:last-child,
-.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child {
- border-bottom-left-radius: 3px;
- border-bottom-right-radius: 3px;
-}
-.panel > .table:last-child > tbody:last-child > tr:last-child td:first-child,
-.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child td:first-child,
-.panel > .table:last-child > tfoot:last-child > tr:last-child td:first-child,
-.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child td:first-child,
-.panel > .table:last-child > tbody:last-child > tr:last-child th:first-child,
-.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child th:first-child,
-.panel > .table:last-child > tfoot:last-child > tr:last-child th:first-child,
-.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child th:first-child {
- border-bottom-left-radius: 3px;
-}
-.panel > .table:last-child > tbody:last-child > tr:last-child td:last-child,
-.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child td:last-child,
-.panel > .table:last-child > tfoot:last-child > tr:last-child td:last-child,
-.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child td:last-child,
-.panel > .table:last-child > tbody:last-child > tr:last-child th:last-child,
-.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child th:last-child,
-.panel > .table:last-child > tfoot:last-child > tr:last-child th:last-child,
-.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child th:last-child {
- border-bottom-right-radius: 3px;
-}
-.panel > .panel-body + .table,
-.panel > .panel-body + .table-responsive,
-.panel > .table + .panel-body,
-.panel > .table-responsive + .panel-body {
- border-top: 1px solid #ddd;
-}
-.panel > .table > tbody:first-child > tr:first-child th,
-.panel > .table > tbody:first-child > tr:first-child td {
- border-top: 0;
-}
-.panel > .table-bordered,
-.panel > .table-responsive > .table-bordered {
- border: 0;
-}
-.panel > .table-bordered > thead > tr > th:first-child,
-.panel > .table-responsive > .table-bordered > thead > tr > th:first-child,
-.panel > .table-bordered > tbody > tr > th:first-child,
-.panel > .table-responsive > .table-bordered > tbody > tr > th:first-child,
-.panel > .table-bordered > tfoot > tr > th:first-child,
-.panel > .table-responsive > .table-bordered > tfoot > tr > th:first-child,
-.panel > .table-bordered > thead > tr > td:first-child,
-.panel > .table-responsive > .table-bordered > thead > tr > td:first-child,
-.panel > .table-bordered > tbody > tr > td:first-child,
-.panel > .table-responsive > .table-bordered > tbody > tr > td:first-child,
-.panel > .table-bordered > tfoot > tr > td:first-child,
-.panel > .table-responsive > .table-bordered > tfoot > tr > td:first-child {
- border-left: 0;
-}
-.panel > .table-bordered > thead > tr > th:last-child,
-.panel > .table-responsive > .table-bordered > thead > tr > th:last-child,
-.panel > .table-bordered > tbody > tr > th:last-child,
-.panel > .table-responsive > .table-bordered > tbody > tr > th:last-child,
-.panel > .table-bordered > tfoot > tr > th:last-child,
-.panel > .table-responsive > .table-bordered > tfoot > tr > th:last-child,
-.panel > .table-bordered > thead > tr > td:last-child,
-.panel > .table-responsive > .table-bordered > thead > tr > td:last-child,
-.panel > .table-bordered > tbody > tr > td:last-child,
-.panel > .table-responsive > .table-bordered > tbody > tr > td:last-child,
-.panel > .table-bordered > tfoot > tr > td:last-child,
-.panel > .table-responsive > .table-bordered > tfoot > tr > td:last-child {
- border-right: 0;
-}
-.panel > .table-bordered > thead > tr:first-child > td,
-.panel > .table-responsive > .table-bordered > thead > tr:first-child > td,
-.panel > .table-bordered > tbody > tr:first-child > td,
-.panel > .table-responsive > .table-bordered > tbody > tr:first-child > td,
-.panel > .table-bordered > thead > tr:first-child > th,
-.panel > .table-responsive > .table-bordered > thead > tr:first-child > th,
-.panel > .table-bordered > tbody > tr:first-child > th,
-.panel > .table-responsive > .table-bordered > tbody > tr:first-child > th {
- border-bottom: 0;
-}
-.panel > .table-bordered > tbody > tr:last-child > td,
-.panel > .table-responsive > .table-bordered > tbody > tr:last-child > td,
-.panel > .table-bordered > tfoot > tr:last-child > td,
-.panel > .table-responsive > .table-bordered > tfoot > tr:last-child > td,
-.panel > .table-bordered > tbody > tr:last-child > th,
-.panel > .table-responsive > .table-bordered > tbody > tr:last-child > th,
-.panel > .table-bordered > tfoot > tr:last-child > th,
-.panel > .table-responsive > .table-bordered > tfoot > tr:last-child > th {
- border-bottom: 0;
-}
-.panel > .table-responsive {
- border: 0;
- margin-bottom: 0;
-}
-.panel-group {
- margin-bottom: 20px;
-}
-.panel-group .panel {
- margin-bottom: 0;
- border-radius: 4px;
-}
-.panel-group .panel + .panel {
- margin-top: 5px;
-}
-.panel-group .panel-heading {
- border-bottom: 0;
-}
-.panel-group .panel-heading + .panel-collapse > .panel-body,
-.panel-group .panel-heading + .panel-collapse > .list-group {
- border-top: 1px solid #ddd;
-}
-.panel-group .panel-footer {
- border-top: 0;
-}
-.panel-group .panel-footer + .panel-collapse .panel-body {
- border-bottom: 1px solid #ddd;
-}
-.panel-default {
- border-color: #ddd;
-}
-.panel-default > .panel-heading {
- color: #333333;
- background-color: #f5f5f5;
- border-color: #ddd;
-}
-.panel-default > .panel-heading + .panel-collapse > .panel-body {
- border-top-color: #ddd;
-}
-.panel-default > .panel-heading .badge {
- color: #f5f5f5;
- background-color: #333333;
-}
-.panel-default > .panel-footer + .panel-collapse > .panel-body {
- border-bottom-color: #ddd;
-}
-.panel-primary {
- border-color: #337ab7;
-}
-.panel-primary > .panel-heading {
- color: #fff;
- background-color: #337ab7;
- border-color: #337ab7;
-}
-.panel-primary > .panel-heading + .panel-collapse > .panel-body {
- border-top-color: #337ab7;
-}
-.panel-primary > .panel-heading .badge {
- color: #337ab7;
- background-color: #fff;
-}
-.panel-primary > .panel-footer + .panel-collapse > .panel-body {
- border-bottom-color: #337ab7;
-}
-.panel-success {
- border-color: #d6e9c6;
-}
-.panel-success > .panel-heading {
- color: #3c763d;
- background-color: #dff0d8;
- border-color: #d6e9c6;
-}
-.panel-success > .panel-heading + .panel-collapse > .panel-body {
- border-top-color: #d6e9c6;
-}
-.panel-success > .panel-heading .badge {
- color: #dff0d8;
- background-color: #3c763d;
-}
-.panel-success > .panel-footer + .panel-collapse > .panel-body {
- border-bottom-color: #d6e9c6;
-}
-.panel-info {
- border-color: #bce8f1;
-}
-.panel-info > .panel-heading {
- color: #31708f;
- background-color: #d9edf7;
- border-color: #bce8f1;
-}
-.panel-info > .panel-heading + .panel-collapse > .panel-body {
- border-top-color: #bce8f1;
-}
-.panel-info > .panel-heading .badge {
- color: #d9edf7;
- background-color: #31708f;
-}
-.panel-info > .panel-footer + .panel-collapse > .panel-body {
- border-bottom-color: #bce8f1;
-}
-.panel-warning {
- border-color: #faebcc;
-}
-.panel-warning > .panel-heading {
- color: #8a6d3b;
- background-color: #fcf8e3;
- border-color: #faebcc;
-}
-.panel-warning > .panel-heading + .panel-collapse > .panel-body {
- border-top-color: #faebcc;
-}
-.panel-warning > .panel-heading .badge {
- color: #fcf8e3;
- background-color: #8a6d3b;
-}
-.panel-warning > .panel-footer + .panel-collapse > .panel-body {
- border-bottom-color: #faebcc;
-}
-.panel-danger {
- border-color: #ebccd1;
-}
-.panel-danger > .panel-heading {
- color: #a94442;
- background-color: #f2dede;
- border-color: #ebccd1;
-}
-.panel-danger > .panel-heading + .panel-collapse > .panel-body {
- border-top-color: #ebccd1;
-}
-.panel-danger > .panel-heading .badge {
- color: #f2dede;
- background-color: #a94442;
-}
-.panel-danger > .panel-footer + .panel-collapse > .panel-body {
- border-bottom-color: #ebccd1;
-}
-.embed-responsive {
- position: relative;
- display: block;
- height: 0;
- padding: 0;
- overflow: hidden;
-}
-.embed-responsive .embed-responsive-item,
-.embed-responsive iframe,
-.embed-responsive embed,
-.embed-responsive object,
-.embed-responsive video {
- position: absolute;
- top: 0;
- left: 0;
- bottom: 0;
- height: 100%;
- width: 100%;
- border: 0;
-}
-.embed-responsive-16by9 {
- padding-bottom: 56.25%;
-}
-.embed-responsive-4by3 {
- padding-bottom: 75%;
-}
-.well {
- min-height: 20px;
- padding: 19px;
- margin-bottom: 20px;
- background-color: #f5f5f5;
- border: 1px solid #e3e3e3;
- border-radius: 4px;
- -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
- box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
-}
-.well blockquote {
- border-color: #ddd;
- border-color: rgba(0, 0, 0, 0.15);
-}
-.well-lg {
- padding: 24px;
- border-radius: 6px;
-}
-.well-sm {
- padding: 9px;
- border-radius: 3px;
-}
-.close {
- float: right;
- font-size: 21px;
- font-weight: bold;
- line-height: 1;
- color: #000;
- text-shadow: 0 1px 0 #fff;
- opacity: 0.2;
- filter: alpha(opacity=20);
-}
-.close:hover,
-.close:focus {
- color: #000;
- text-decoration: none;
- cursor: pointer;
- opacity: 0.5;
- filter: alpha(opacity=50);
-}
-button.close {
- padding: 0;
- cursor: pointer;
- background: transparent;
- border: 0;
- -webkit-appearance: none;
-}
-.modal-open {
- overflow: hidden;
-}
-.modal {
- display: none;
- overflow: hidden;
- position: fixed;
- top: 0;
- right: 0;
- bottom: 0;
- left: 0;
- z-index: 1050;
- -webkit-overflow-scrolling: touch;
- outline: 0;
-}
-.modal.fade .modal-dialog {
- -webkit-transform: translate(0, -25%);
- -ms-transform: translate(0, -25%);
- -o-transform: translate(0, -25%);
- transform: translate(0, -25%);
- -webkit-transition: -webkit-transform 0.3s ease-out;
- -moz-transition: -moz-transform 0.3s ease-out;
- -o-transition: -o-transform 0.3s ease-out;
- transition: transform 0.3s ease-out;
-}
-.modal.in .modal-dialog {
- -webkit-transform: translate(0, 0);
- -ms-transform: translate(0, 0);
- -o-transform: translate(0, 0);
- transform: translate(0, 0);
-}
-.modal-open .modal {
- overflow-x: hidden;
- overflow-y: auto;
-}
-.modal-dialog {
- position: relative;
- width: auto;
- margin: 10px;
-}
-.modal-content {
- position: relative;
- background-color: #fff;
- border: 1px solid #999;
- border: 1px solid rgba(0, 0, 0, 0.2);
- border-radius: 6px;
- -webkit-box-shadow: 0 3px 9px rgba(0, 0, 0, 0.5);
- box-shadow: 0 3px 9px rgba(0, 0, 0, 0.5);
- background-clip: padding-box;
- outline: 0;
-}
-.modal-backdrop {
- position: fixed;
- top: 0;
- right: 0;
- bottom: 0;
- left: 0;
- z-index: 1040;
- background-color: #000;
-}
-.modal-backdrop.fade {
- opacity: 0;
- filter: alpha(opacity=0);
-}
-.modal-backdrop.in {
- opacity: 0.5;
- filter: alpha(opacity=50);
-}
-.modal-header {
- padding: 15px;
- border-bottom: 1px solid #e5e5e5;
-}
-.modal-header .close {
- margin-top: -2px;
-}
-.modal-title {
- margin: 0;
- line-height: 1.42857143;
-}
-.modal-body {
- position: relative;
- padding: 15px;
-}
-.modal-footer {
- padding: 15px;
- text-align: right;
- border-top: 1px solid #e5e5e5;
-}
-.modal-footer .btn + .btn {
- margin-left: 5px;
- margin-bottom: 0;
-}
-.modal-footer .btn-group .btn + .btn {
- margin-left: -1px;
-}
-.modal-footer .btn-block + .btn-block {
- margin-left: 0;
-}
-.modal-scrollbar-measure {
- position: absolute;
- top: -9999px;
- width: 50px;
- height: 50px;
- overflow: scroll;
-}
-@media (min-width: 768px) {
- .modal-dialog {
- width: 600px;
- margin: 30px auto;
- }
- .modal-content {
- -webkit-box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
- box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
- }
- .modal-sm {
- width: 300px;
- }
-}
-@media (min-width: 992px) {
- .modal-lg {
- width: 900px;
- }
-}
-.tooltip {
- position: absolute;
- z-index: 1070;
- display: block;
- font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
- font-style: normal;
- font-weight: normal;
- letter-spacing: normal;
- line-break: auto;
- line-height: 1.42857143;
- text-align: left;
- text-align: start;
- text-decoration: none;
- text-shadow: none;
- text-transform: none;
- white-space: normal;
- word-break: normal;
- word-spacing: normal;
- word-wrap: normal;
- font-size: 12px;
- opacity: 0;
- filter: alpha(opacity=0);
-}
-.tooltip.in {
- opacity: 0.9;
- filter: alpha(opacity=90);
-}
-.tooltip.top {
- margin-top: -3px;
- padding: 5px 0;
-}
-.tooltip.right {
- margin-left: 3px;
- padding: 0 5px;
-}
-.tooltip.bottom {
- margin-top: 3px;
- padding: 5px 0;
-}
-.tooltip.left {
- margin-left: -3px;
- padding: 0 5px;
-}
-.tooltip-inner {
- max-width: 200px;
- padding: 3px 8px;
- color: #fff;
- text-align: center;
- background-color: #000;
- border-radius: 4px;
-}
-.tooltip-arrow {
- position: absolute;
- width: 0;
- height: 0;
- border-color: transparent;
- border-style: solid;
-}
-.tooltip.top .tooltip-arrow {
- bottom: 0;
- left: 50%;
- margin-left: -5px;
- border-width: 5px 5px 0;
- border-top-color: #000;
-}
-.tooltip.top-left .tooltip-arrow {
- bottom: 0;
- right: 5px;
- margin-bottom: -5px;
- border-width: 5px 5px 0;
- border-top-color: #000;
-}
-.tooltip.top-right .tooltip-arrow {
- bottom: 0;
- left: 5px;
- margin-bottom: -5px;
- border-width: 5px 5px 0;
- border-top-color: #000;
-}
-.tooltip.right .tooltip-arrow {
- top: 50%;
- left: 0;
- margin-top: -5px;
- border-width: 5px 5px 5px 0;
- border-right-color: #000;
-}
-.tooltip.left .tooltip-arrow {
- top: 50%;
- right: 0;
- margin-top: -5px;
- border-width: 5px 0 5px 5px;
- border-left-color: #000;
-}
-.tooltip.bottom .tooltip-arrow {
- top: 0;
- left: 50%;
- margin-left: -5px;
- border-width: 0 5px 5px;
- border-bottom-color: #000;
-}
-.tooltip.bottom-left .tooltip-arrow {
- top: 0;
- right: 5px;
- margin-top: -5px;
- border-width: 0 5px 5px;
- border-bottom-color: #000;
-}
-.tooltip.bottom-right .tooltip-arrow {
- top: 0;
- left: 5px;
- margin-top: -5px;
- border-width: 0 5px 5px;
- border-bottom-color: #000;
-}
-.popover {
- position: absolute;
- top: 0;
- left: 0;
- z-index: 1060;
- display: none;
- max-width: 276px;
- padding: 1px;
- font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
- font-style: normal;
- font-weight: normal;
- letter-spacing: normal;
- line-break: auto;
- line-height: 1.42857143;
- text-align: left;
- text-align: start;
- text-decoration: none;
- text-shadow: none;
- text-transform: none;
- white-space: normal;
- word-break: normal;
- word-spacing: normal;
- word-wrap: normal;
- font-size: 14px;
- background-color: #fff;
- background-clip: padding-box;
- border: 1px solid #ccc;
- border: 1px solid rgba(0, 0, 0, 0.2);
- border-radius: 6px;
- -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
- box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
-}
-.popover.top {
- margin-top: -10px;
-}
-.popover.right {
- margin-left: 10px;
-}
-.popover.bottom {
- margin-top: 10px;
-}
-.popover.left {
- margin-left: -10px;
-}
-.popover-title {
- margin: 0;
- padding: 8px 14px;
- font-size: 14px;
- background-color: #f7f7f7;
- border-bottom: 1px solid #ebebeb;
- border-radius: 5px 5px 0 0;
-}
-.popover-content {
- padding: 9px 14px;
-}
-.popover > .arrow,
-.popover > .arrow:after {
- position: absolute;
- display: block;
- width: 0;
- height: 0;
- border-color: transparent;
- border-style: solid;
-}
-.popover > .arrow {
- border-width: 11px;
-}
-.popover > .arrow:after {
- border-width: 10px;
- content: "";
-}
-.popover.top > .arrow {
- left: 50%;
- margin-left: -11px;
- border-bottom-width: 0;
- border-top-color: #999999;
- border-top-color: rgba(0, 0, 0, 0.25);
- bottom: -11px;
-}
-.popover.top > .arrow:after {
- content: " ";
- bottom: 1px;
- margin-left: -10px;
- border-bottom-width: 0;
- border-top-color: #fff;
-}
-.popover.right > .arrow {
- top: 50%;
- left: -11px;
- margin-top: -11px;
- border-left-width: 0;
- border-right-color: #999999;
- border-right-color: rgba(0, 0, 0, 0.25);
-}
-.popover.right > .arrow:after {
- content: " ";
- left: 1px;
- bottom: -10px;
- border-left-width: 0;
- border-right-color: #fff;
-}
-.popover.bottom > .arrow {
- left: 50%;
- margin-left: -11px;
- border-top-width: 0;
- border-bottom-color: #999999;
- border-bottom-color: rgba(0, 0, 0, 0.25);
- top: -11px;
-}
-.popover.bottom > .arrow:after {
- content: " ";
- top: 1px;
- margin-left: -10px;
- border-top-width: 0;
- border-bottom-color: #fff;
-}
-.popover.left > .arrow {
- top: 50%;
- right: -11px;
- margin-top: -11px;
- border-right-width: 0;
- border-left-color: #999999;
- border-left-color: rgba(0, 0, 0, 0.25);
-}
-.popover.left > .arrow:after {
- content: " ";
- right: 1px;
- border-right-width: 0;
- border-left-color: #fff;
- bottom: -10px;
-}
-.carousel {
- position: relative;
-}
-.carousel-inner {
- position: relative;
- overflow: hidden;
- width: 100%;
-}
-.carousel-inner > .item {
- display: none;
- position: relative;
- -webkit-transition: 0.6s ease-in-out left;
- -o-transition: 0.6s ease-in-out left;
- transition: 0.6s ease-in-out left;
-}
-.carousel-inner > .item > img,
-.carousel-inner > .item > a > img {
- line-height: 1;
-}
-@media all and (transform-3d), (-webkit-transform-3d) {
- .carousel-inner > .item {
- -webkit-transition: -webkit-transform 0.6s ease-in-out;
- -moz-transition: -moz-transform 0.6s ease-in-out;
- -o-transition: -o-transform 0.6s ease-in-out;
- transition: transform 0.6s ease-in-out;
- -webkit-backface-visibility: hidden;
- -moz-backface-visibility: hidden;
- backface-visibility: hidden;
- -webkit-perspective: 1000px;
- -moz-perspective: 1000px;
- perspective: 1000px;
- }
- .carousel-inner > .item.next,
- .carousel-inner > .item.active.right {
- -webkit-transform: translate3d(100%, 0, 0);
- transform: translate3d(100%, 0, 0);
- left: 0;
- }
- .carousel-inner > .item.prev,
- .carousel-inner > .item.active.left {
- -webkit-transform: translate3d(-100%, 0, 0);
- transform: translate3d(-100%, 0, 0);
- left: 0;
- }
- .carousel-inner > .item.next.left,
- .carousel-inner > .item.prev.right,
- .carousel-inner > .item.active {
- -webkit-transform: translate3d(0, 0, 0);
- transform: translate3d(0, 0, 0);
- left: 0;
- }
-}
-.carousel-inner > .active,
-.carousel-inner > .next,
-.carousel-inner > .prev {
- display: block;
-}
-.carousel-inner > .active {
- left: 0;
-}
-.carousel-inner > .next,
-.carousel-inner > .prev {
- position: absolute;
- top: 0;
- width: 100%;
-}
-.carousel-inner > .next {
- left: 100%;
-}
-.carousel-inner > .prev {
- left: -100%;
-}
-.carousel-inner > .next.left,
-.carousel-inner > .prev.right {
- left: 0;
-}
-.carousel-inner > .active.left {
- left: -100%;
-}
-.carousel-inner > .active.right {
- left: 100%;
-}
-.carousel-control {
- position: absolute;
- top: 0;
- left: 0;
- bottom: 0;
- width: 15%;
- opacity: 0.5;
- filter: alpha(opacity=50);
- font-size: 20px;
- color: #fff;
- text-align: center;
- text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
- background-color: rgba(0, 0, 0, 0);
-}
-.carousel-control.left {
- background-image: -webkit-linear-gradient(left, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.0001) 100%);
- background-image: -o-linear-gradient(left, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.0001) 100%);
- background-image: linear-gradient(to right, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.0001) 100%);
- background-repeat: repeat-x;
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000', endColorstr='#00000000', GradientType=1);
-}
-.carousel-control.right {
- left: auto;
- right: 0;
- background-image: -webkit-linear-gradient(left, rgba(0, 0, 0, 0.0001) 0%, rgba(0, 0, 0, 0.5) 100%);
- background-image: -o-linear-gradient(left, rgba(0, 0, 0, 0.0001) 0%, rgba(0, 0, 0, 0.5) 100%);
- background-image: linear-gradient(to right, rgba(0, 0, 0, 0.0001) 0%, rgba(0, 0, 0, 0.5) 100%);
- background-repeat: repeat-x;
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#80000000', GradientType=1);
-}
-.carousel-control:hover,
-.carousel-control:focus {
- outline: 0;
- color: #fff;
- text-decoration: none;
- opacity: 0.9;
- filter: alpha(opacity=90);
-}
-.carousel-control .icon-prev,
-.carousel-control .icon-next,
-.carousel-control .glyphicon-chevron-left,
-.carousel-control .glyphicon-chevron-right {
- position: absolute;
- top: 50%;
- margin-top: -10px;
- z-index: 5;
- display: inline-block;
-}
-.carousel-control .icon-prev,
-.carousel-control .glyphicon-chevron-left {
- left: 50%;
- margin-left: -10px;
-}
-.carousel-control .icon-next,
-.carousel-control .glyphicon-chevron-right {
- right: 50%;
- margin-right: -10px;
-}
-.carousel-control .icon-prev,
-.carousel-control .icon-next {
- width: 20px;
- height: 20px;
- line-height: 1;
- font-family: serif;
-}
-.carousel-control .icon-prev:before {
- content: '\2039';
-}
-.carousel-control .icon-next:before {
- content: '\203a';
-}
-.carousel-indicators {
- position: absolute;
- bottom: 10px;
- left: 50%;
- z-index: 15;
- width: 60%;
- margin-left: -30%;
- padding-left: 0;
- list-style: none;
- text-align: center;
-}
-.carousel-indicators li {
- display: inline-block;
- width: 10px;
- height: 10px;
- margin: 1px;
- text-indent: -999px;
- border: 1px solid #fff;
- border-radius: 10px;
- cursor: pointer;
- background-color: #000 \9;
- background-color: rgba(0, 0, 0, 0);
-}
-.carousel-indicators .active {
- margin: 0;
- width: 12px;
- height: 12px;
- background-color: #fff;
-}
-.carousel-caption {
- position: absolute;
- left: 15%;
- right: 15%;
- bottom: 20px;
- z-index: 10;
- padding-top: 20px;
- padding-bottom: 20px;
- color: #fff;
- text-align: center;
- text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
-}
-.carousel-caption .btn {
- text-shadow: none;
-}
-@media screen and (min-width: 768px) {
- .carousel-control .glyphicon-chevron-left,
- .carousel-control .glyphicon-chevron-right,
- .carousel-control .icon-prev,
- .carousel-control .icon-next {
- width: 30px;
- height: 30px;
- margin-top: -10px;
- font-size: 30px;
- }
- .carousel-control .glyphicon-chevron-left,
- .carousel-control .icon-prev {
- margin-left: -10px;
- }
- .carousel-control .glyphicon-chevron-right,
- .carousel-control .icon-next {
- margin-right: -10px;
- }
- .carousel-caption {
- left: 20%;
- right: 20%;
- padding-bottom: 30px;
- }
- .carousel-indicators {
- bottom: 20px;
- }
-}
-.clearfix:before,
-.clearfix:after,
-.dl-horizontal dd:before,
-.dl-horizontal dd:after,
-.container:before,
-.container:after,
-.container-fluid:before,
-.container-fluid:after,
-.row:before,
-.row:after,
-.form-horizontal .form-group:before,
-.form-horizontal .form-group:after,
-.btn-toolbar:before,
-.btn-toolbar:after,
-.btn-group-vertical > .btn-group:before,
-.btn-group-vertical > .btn-group:after,
-.nav:before,
-.nav:after,
-.navbar:before,
-.navbar:after,
-.navbar-header:before,
-.navbar-header:after,
-.navbar-collapse:before,
-.navbar-collapse:after,
-.pager:before,
-.pager:after,
-.panel-body:before,
-.panel-body:after,
-.modal-header:before,
-.modal-header:after,
-.modal-footer:before,
-.modal-footer:after {
- content: " ";
- display: table;
-}
-.clearfix:after,
-.dl-horizontal dd:after,
-.container:after,
-.container-fluid:after,
-.row:after,
-.form-horizontal .form-group:after,
-.btn-toolbar:after,
-.btn-group-vertical > .btn-group:after,
-.nav:after,
-.navbar:after,
-.navbar-header:after,
-.navbar-collapse:after,
-.pager:after,
-.panel-body:after,
-.modal-header:after,
-.modal-footer:after {
- clear: both;
-}
-.center-block {
- display: block;
- margin-left: auto;
- margin-right: auto;
-}
-.pull-right {
- float: right !important;
-}
-.pull-left {
- float: left !important;
-}
-.hide {
- display: none !important;
-}
-.show {
- display: block !important;
-}
-.invisible {
- visibility: hidden;
-}
-.text-hide {
- font: 0/0 a;
- color: transparent;
- text-shadow: none;
- background-color: transparent;
- border: 0;
-}
-.hidden {
- display: none !important;
-}
-.affix {
- position: fixed;
-}
-@-ms-viewport {
- width: device-width;
-}
-.visible-xs,
-.visible-sm,
-.visible-md,
-.visible-lg {
- display: none !important;
-}
-.visible-xs-block,
-.visible-xs-inline,
-.visible-xs-inline-block,
-.visible-sm-block,
-.visible-sm-inline,
-.visible-sm-inline-block,
-.visible-md-block,
-.visible-md-inline,
-.visible-md-inline-block,
-.visible-lg-block,
-.visible-lg-inline,
-.visible-lg-inline-block {
- display: none !important;
-}
-@media (max-width: 767px) {
- .visible-xs {
- display: block !important;
- }
- table.visible-xs {
- display: table !important;
- }
- tr.visible-xs {
- display: table-row !important;
- }
- th.visible-xs,
- td.visible-xs {
- display: table-cell !important;
- }
-}
-@media (max-width: 767px) {
- .visible-xs-block {
- display: block !important;
- }
-}
-@media (max-width: 767px) {
- .visible-xs-inline {
- display: inline !important;
- }
-}
-@media (max-width: 767px) {
- .visible-xs-inline-block {
- display: inline-block !important;
- }
-}
-@media (min-width: 768px) and (max-width: 991px) {
- .visible-sm {
- display: block !important;
- }
- table.visible-sm {
- display: table !important;
- }
- tr.visible-sm {
- display: table-row !important;
- }
- th.visible-sm,
- td.visible-sm {
- display: table-cell !important;
- }
-}
-@media (min-width: 768px) and (max-width: 991px) {
- .visible-sm-block {
- display: block !important;
- }
-}
-@media (min-width: 768px) and (max-width: 991px) {
- .visible-sm-inline {
- display: inline !important;
- }
-}
-@media (min-width: 768px) and (max-width: 991px) {
- .visible-sm-inline-block {
- display: inline-block !important;
- }
-}
-@media (min-width: 992px) and (max-width: 1199px) {
- .visible-md {
- display: block !important;
- }
- table.visible-md {
- display: table !important;
- }
- tr.visible-md {
- display: table-row !important;
- }
- th.visible-md,
- td.visible-md {
- display: table-cell !important;
- }
-}
-@media (min-width: 992px) and (max-width: 1199px) {
- .visible-md-block {
- display: block !important;
- }
-}
-@media (min-width: 992px) and (max-width: 1199px) {
- .visible-md-inline {
- display: inline !important;
- }
-}
-@media (min-width: 992px) and (max-width: 1199px) {
- .visible-md-inline-block {
- display: inline-block !important;
- }
-}
-@media (min-width: 1200px) {
- .visible-lg {
- display: block !important;
- }
- table.visible-lg {
- display: table !important;
- }
- tr.visible-lg {
- display: table-row !important;
- }
- th.visible-lg,
- td.visible-lg {
- display: table-cell !important;
- }
-}
-@media (min-width: 1200px) {
- .visible-lg-block {
- display: block !important;
- }
-}
-@media (min-width: 1200px) {
- .visible-lg-inline {
- display: inline !important;
- }
-}
-@media (min-width: 1200px) {
- .visible-lg-inline-block {
- display: inline-block !important;
- }
-}
-@media (max-width: 767px) {
- .hidden-xs {
- display: none !important;
- }
-}
-@media (min-width: 768px) and (max-width: 991px) {
- .hidden-sm {
- display: none !important;
- }
-}
-@media (min-width: 992px) and (max-width: 1199px) {
- .hidden-md {
- display: none !important;
- }
-}
-@media (min-width: 1200px) {
- .hidden-lg {
- display: none !important;
- }
-}
-.visible-print {
- display: none !important;
-}
-@media print {
- .visible-print {
- display: block !important;
- }
- table.visible-print {
- display: table !important;
- }
- tr.visible-print {
- display: table-row !important;
- }
- th.visible-print,
- td.visible-print {
- display: table-cell !important;
- }
-}
-.visible-print-block {
- display: none !important;
-}
-@media print {
- .visible-print-block {
- display: block !important;
- }
-}
-.visible-print-inline {
- display: none !important;
-}
-@media print {
- .visible-print-inline {
- display: inline !important;
- }
-}
-.visible-print-inline-block {
- display: none !important;
-}
-@media print {
- .visible-print-inline-block {
- display: inline-block !important;
- }
-}
-@media print {
- .hidden-print {
- display: none !important;
- }
-}
-/*!
+/*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:700}dfn{font-style:italic}h1{font-size:2em;margin:.67em 0}mark{background:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{box-sizing:content-box;height:0}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{height:auto}input[type=search]{-webkit-appearance:textfield;box-sizing:content-box}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}legend{border:0;padding:0}textarea{overflow:auto}optgroup{font-weight:700}table{border-collapse:collapse;border-spacing:0}td,th{padding:0}/*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */@media print{*,:after,:before{background:0 0!important;color:#000!important;box-shadow:none!important;text-shadow:none!important}a,a:visited{text-decoration:underline}a[href]:after{content:" (" attr(href) ")"}abbr[title]:after{content:" (" attr(title) ")"}a[href^="#"]:after,a[href^="javascript:"]:after{content:""}blockquote,pre{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}img,tr{page-break-inside:avoid}img{max-width:100%!important}h2,h3,p{orphans:3;widows:3}h2,h3{page-break-after:avoid}.navbar{display:none}.btn>.caret,.dropup>.btn>.caret{border-top-color:#000!important}.label{border:1px solid #000}.table{border-collapse:collapse!important}.table td,.table th{background-color:#fff!important}.table-bordered td,.table-bordered th{border:1px solid #ddd!important}}@font-face{font-family:'Glyphicons Halflings';src:url(../fonts/glyphicons-halflings-regular.eot);src:url(../fonts/glyphicons-halflings-regular.eot?#iefix) format('embedded-opentype'),url(../fonts/glyphicons-halflings-regular.woff2) format('woff2'),url(../fonts/glyphicons-halflings-regular.woff) format('woff'),url(../fonts/glyphicons-halflings-regular.ttf) format('truetype'),url(../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular) format('svg')}.glyphicon{position:relative;top:1px;display:inline-block;font-family:'Glyphicons Halflings';font-style:normal;font-weight:400;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.glyphicon-asterisk:before{content:"\002a"}.glyphicon-plus:before{content:"\002b"}.glyphicon-eur:before,.glyphicon-euro:before{content:"\20ac"}.glyphicon-minus:before{content:"\2212"}.glyphicon-cloud:before{content:"\2601"}.glyphicon-envelope:before{content:"\2709"}.glyphicon-pencil:before{content:"\270f"}.glyphicon-glass:before{content:"\e001"}.glyphicon-music:before{content:"\e002"}.glyphicon-search:before{content:"\e003"}.glyphicon-heart:before{content:"\e005"}.glyphicon-star:before{content:"\e006"}.glyphicon-star-empty:before{content:"\e007"}.glyphicon-user:before{content:"\e008"}.glyphicon-film:before{content:"\e009"}.glyphicon-th-large:before{content:"\e010"}.glyphicon-th:before{content:"\e011"}.glyphicon-th-list:before{content:"\e012"}.glyphicon-ok:before{content:"\e013"}.glyphicon-remove:before{content:"\e014"}.glyphicon-zoom-in:before{content:"\e015"}.glyphicon-zoom-out:before{content:"\e016"}.glyphicon-off:before{content:"\e017"}.glyphicon-signal:before{content:"\e018"}.glyphicon-cog:before{content:"\e019"}.glyphicon-trash:before{content:"\e020"}.glyphicon-home:before{content:"\e021"}.glyphicon-file:before{content:"\e022"}.glyphicon-time:before{content:"\e023"}.glyphicon-road:before{content:"\e024"}.glyphicon-download-alt:before{content:"\e025"}.glyphicon-download:before{content:"\e026"}.glyphicon-upload:before{content:"\e027"}.glyphicon-inbox:before{content:"\e028"}.glyphicon-play-circle:before{content:"\e029"}.glyphicon-repeat:before{content:"\e030"}.glyphicon-refresh:before{content:"\e031"}.glyphicon-list-alt:before{content:"\e032"}.glyphicon-lock:before{content:"\e033"}.glyphicon-flag:before{content:"\e034"}.glyphicon-headphones:before{content:"\e035"}.glyphicon-volume-off:before{content:"\e036"}.glyphicon-volume-down:before{content:"\e037"}.glyphicon-volume-up:before{content:"\e038"}.glyphicon-qrcode:before{content:"\e039"}.glyphicon-barcode:before{content:"\e040"}.glyphicon-tag:before{content:"\e041"}.glyphicon-tags:before{content:"\e042"}.glyphicon-book:before{content:"\e043"}.glyphicon-bookmark:before{content:"\e044"}.glyphicon-print:before{content:"\e045"}.glyphicon-camera:before{content:"\e046"}.glyphicon-font:before{content:"\e047"}.glyphicon-bold:before{content:"\e048"}.glyphicon-italic:before{content:"\e049"}.glyphicon-text-height:before{content:"\e050"}.glyphicon-text-width:before{content:"\e051"}.glyphicon-align-left:before{content:"\e052"}.glyphicon-align-center:before{content:"\e053"}.glyphicon-align-right:before{content:"\e054"}.glyphicon-align-justify:before{content:"\e055"}.glyphicon-list:before{content:"\e056"}.glyphicon-indent-left:before{content:"\e057"}.glyphicon-indent-right:before{content:"\e058"}.glyphicon-facetime-video:before{content:"\e059"}.glyphicon-picture:before{content:"\e060"}.glyphicon-map-marker:before{content:"\e062"}.glyphicon-adjust:before{content:"\e063"}.glyphicon-tint:before{content:"\e064"}.glyphicon-edit:before{content:"\e065"}.glyphicon-share:before{content:"\e066"}.glyphicon-check:before{content:"\e067"}.glyphicon-move:before{content:"\e068"}.glyphicon-step-backward:before{content:"\e069"}.glyphicon-fast-backward:before{content:"\e070"}.glyphicon-backward:before{content:"\e071"}.glyphicon-play:before{content:"\e072"}.glyphicon-pause:before{content:"\e073"}.glyphicon-stop:before{content:"\e074"}.glyphicon-forward:before{content:"\e075"}.glyphicon-fast-forward:before{content:"\e076"}.glyphicon-step-forward:before{content:"\e077"}.glyphicon-eject:before{content:"\e078"}.glyphicon-chevron-left:before{content:"\e079"}.glyphicon-chevron-right:before{content:"\e080"}.glyphicon-plus-sign:before{content:"\e081"}.glyphicon-minus-sign:before{content:"\e082"}.glyphicon-remove-sign:before{content:"\e083"}.glyphicon-ok-sign:before{content:"\e084"}.glyphicon-question-sign:before{content:"\e085"}.glyphicon-info-sign:before{content:"\e086"}.glyphicon-screenshot:before{content:"\e087"}.glyphicon-remove-circle:before{content:"\e088"}.glyphicon-ok-circle:before{content:"\e089"}.glyphicon-ban-circle:before{content:"\e090"}.glyphicon-arrow-left:before{content:"\e091"}.glyphicon-arrow-right:before{content:"\e092"}.glyphicon-arrow-up:before{content:"\e093"}.glyphicon-arrow-down:before{content:"\e094"}.glyphicon-share-alt:before{content:"\e095"}.glyphicon-resize-full:before{content:"\e096"}.glyphicon-resize-small:before{content:"\e097"}.glyphicon-exclamation-sign:before{content:"\e101"}.glyphicon-gift:before{content:"\e102"}.glyphicon-leaf:before{content:"\e103"}.glyphicon-fire:before{content:"\e104"}.glyphicon-eye-open:before{content:"\e105"}.glyphicon-eye-close:before{content:"\e106"}.glyphicon-warning-sign:before{content:"\e107"}.glyphicon-plane:before{content:"\e108"}.glyphicon-calendar:before{content:"\e109"}.glyphicon-random:before{content:"\e110"}.glyphicon-comment:before{content:"\e111"}.glyphicon-magnet:before{content:"\e112"}.glyphicon-chevron-up:before{content:"\e113"}.glyphicon-chevron-down:before{content:"\e114"}.glyphicon-retweet:before{content:"\e115"}.glyphicon-shopping-cart:before{content:"\e116"}.glyphicon-folder-close:before{content:"\e117"}.glyphicon-folder-open:before{content:"\e118"}.glyphicon-resize-vertical:before{content:"\e119"}.glyphicon-resize-horizontal:before{content:"\e120"}.glyphicon-hdd:before{content:"\e121"}.glyphicon-bullhorn:before{content:"\e122"}.glyphicon-bell:before{content:"\e123"}.glyphicon-certificate:before{content:"\e124"}.glyphicon-thumbs-up:before{content:"\e125"}.glyphicon-thumbs-down:before{content:"\e126"}.glyphicon-hand-right:before{content:"\e127"}.glyphicon-hand-left:before{content:"\e128"}.glyphicon-hand-up:before{content:"\e129"}.glyphicon-hand-down:before{content:"\e130"}.glyphicon-circle-arrow-right:before{content:"\e131"}.glyphicon-circle-arrow-left:before{content:"\e132"}.glyphicon-circle-arrow-up:before{content:"\e133"}.glyphicon-circle-arrow-down:before{content:"\e134"}.glyphicon-globe:before{content:"\e135"}.glyphicon-wrench:before{content:"\e136"}.glyphicon-tasks:before{content:"\e137"}.glyphicon-filter:before{content:"\e138"}.glyphicon-briefcase:before{content:"\e139"}.glyphicon-fullscreen:before{content:"\e140"}.glyphicon-dashboard:before{content:"\e141"}.glyphicon-paperclip:before{content:"\e142"}.glyphicon-heart-empty:before{content:"\e143"}.glyphicon-link:before{content:"\e144"}.glyphicon-phone:before{content:"\e145"}.glyphicon-pushpin:before{content:"\e146"}.glyphicon-usd:before{content:"\e148"}.glyphicon-gbp:before{content:"\e149"}.glyphicon-sort:before{content:"\e150"}.glyphicon-sort-by-alphabet:before{content:"\e151"}.glyphicon-sort-by-alphabet-alt:before{content:"\e152"}.glyphicon-sort-by-order:before{content:"\e153"}.glyphicon-sort-by-order-alt:before{content:"\e154"}.glyphicon-sort-by-attributes:before{content:"\e155"}.glyphicon-sort-by-attributes-alt:before{content:"\e156"}.glyphicon-unchecked:before{content:"\e157"}.glyphicon-expand:before{content:"\e158"}.glyphicon-collapse-down:before{content:"\e159"}.glyphicon-collapse-up:before{content:"\e160"}.glyphicon-log-in:before{content:"\e161"}.glyphicon-flash:before{content:"\e162"}.glyphicon-log-out:before{content:"\e163"}.glyphicon-new-window:before{content:"\e164"}.glyphicon-record:before{content:"\e165"}.glyphicon-save:before{content:"\e166"}.glyphicon-open:before{content:"\e167"}.glyphicon-saved:before{content:"\e168"}.glyphicon-import:before{content:"\e169"}.glyphicon-export:before{content:"\e170"}.glyphicon-send:before{content:"\e171"}.glyphicon-floppy-disk:before{content:"\e172"}.glyphicon-floppy-saved:before{content:"\e173"}.glyphicon-floppy-remove:before{content:"\e174"}.glyphicon-floppy-save:before{content:"\e175"}.glyphicon-floppy-open:before{content:"\e176"}.glyphicon-credit-card:before{content:"\e177"}.glyphicon-transfer:before{content:"\e178"}.glyphicon-cutlery:before{content:"\e179"}.glyphicon-header:before{content:"\e180"}.glyphicon-compressed:before{content:"\e181"}.glyphicon-earphone:before{content:"\e182"}.glyphicon-phone-alt:before{content:"\e183"}.glyphicon-tower:before{content:"\e184"}.glyphicon-stats:before{content:"\e185"}.glyphicon-sd-video:before{content:"\e186"}.glyphicon-hd-video:before{content:"\e187"}.glyphicon-subtitles:before{content:"\e188"}.glyphicon-sound-stereo:before{content:"\e189"}.glyphicon-sound-dolby:before{content:"\e190"}.glyphicon-sound-5-1:before{content:"\e191"}.glyphicon-sound-6-1:before{content:"\e192"}.glyphicon-sound-7-1:before{content:"\e193"}.glyphicon-copyright-mark:before{content:"\e194"}.glyphicon-registration-mark:before{content:"\e195"}.glyphicon-cloud-download:before{content:"\e197"}.glyphicon-cloud-upload:before{content:"\e198"}.glyphicon-tree-conifer:before{content:"\e199"}.glyphicon-tree-deciduous:before{content:"\e200"}.glyphicon-cd:before{content:"\e201"}.glyphicon-save-file:before{content:"\e202"}.glyphicon-open-file:before{content:"\e203"}.glyphicon-level-up:before{content:"\e204"}.glyphicon-copy:before{content:"\e205"}.glyphicon-paste:before{content:"\e206"}.glyphicon-alert:before{content:"\e209"}.glyphicon-equalizer:before{content:"\e210"}.glyphicon-king:before{content:"\e211"}.glyphicon-queen:before{content:"\e212"}.glyphicon-pawn:before{content:"\e213"}.glyphicon-bishop:before{content:"\e214"}.glyphicon-knight:before{content:"\e215"}.glyphicon-baby-formula:before{content:"\e216"}.glyphicon-tent:before{content:"\26fa"}.glyphicon-blackboard:before{content:"\e218"}.glyphicon-bed:before{content:"\e219"}.glyphicon-apple:before{content:"\f8ff"}.glyphicon-erase:before{content:"\e221"}.glyphicon-hourglass:before{content:"\231b"}.glyphicon-lamp:before{content:"\e223"}.glyphicon-duplicate:before{content:"\e224"}.glyphicon-piggy-bank:before{content:"\e225"}.glyphicon-scissors:before{content:"\e226"}.glyphicon-bitcoin:before{content:"\e227"}.glyphicon-btc:before{content:"\e227"}.glyphicon-xbt:before{content:"\e227"}.glyphicon-yen:before{content:"\00a5"}.glyphicon-jpy:before{content:"\00a5"}.glyphicon-ruble:before{content:"\20bd"}.glyphicon-rub:before{content:"\20bd"}.glyphicon-scale:before{content:"\e230"}.glyphicon-ice-lolly:before{content:"\e231"}.glyphicon-ice-lolly-tasted:before{content:"\e232"}.glyphicon-education:before{content:"\e233"}.glyphicon-option-horizontal:before{content:"\e234"}.glyphicon-option-vertical:before{content:"\e235"}.glyphicon-menu-hamburger:before{content:"\e236"}.glyphicon-modal-window:before{content:"\e237"}.glyphicon-oil:before{content:"\e238"}.glyphicon-grain:before{content:"\e239"}.glyphicon-sunglasses:before{content:"\e240"}.glyphicon-text-size:before{content:"\e241"}.glyphicon-text-color:before{content:"\e242"}.glyphicon-text-background:before{content:"\e243"}.glyphicon-object-align-top:before{content:"\e244"}.glyphicon-object-align-bottom:before{content:"\e245"}.glyphicon-object-align-horizontal:before{content:"\e246"}.glyphicon-object-align-left:before{content:"\e247"}.glyphicon-object-align-vertical:before{content:"\e248"}.glyphicon-object-align-right:before{content:"\e249"}.glyphicon-triangle-right:before{content:"\e250"}.glyphicon-triangle-left:before{content:"\e251"}.glyphicon-triangle-bottom:before{content:"\e252"}.glyphicon-triangle-top:before{content:"\e253"}.glyphicon-console:before{content:"\e254"}.glyphicon-superscript:before{content:"\e255"}.glyphicon-subscript:before{content:"\e256"}.glyphicon-menu-left:before{content:"\e257"}.glyphicon-menu-right:before{content:"\e258"}.glyphicon-menu-down:before{content:"\e259"}.glyphicon-menu-up:before{content:"\e260"}*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}:after,:before{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}html{font-size:10px;-webkit-tap-highlight-color:transparent}body{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;line-height:1.42857143;color:#333;background-color:#fff}button,input,select,textarea{font-family:inherit;font-size:inherit;line-height:inherit}a{color:#337ab7;text-decoration:none}a:focus,a:hover{color:#23527c;text-decoration:underline}a:focus{outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}figure{margin:0}img{vertical-align:middle}.carousel-inner>.item>a>img,.carousel-inner>.item>img,.img-responsive,.thumbnail a>img,.thumbnail>img{display:block;max-width:100%;height:auto}.img-rounded{border-radius:6px}.img-thumbnail{padding:4px;line-height:1.42857143;background-color:#fff;border:1px solid #ddd;border-radius:4px;-webkit-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out;display:inline-block;max-width:100%;height:auto}.img-circle{border-radius:50%}hr{margin-top:20px;margin-bottom:20px;border:0;border-top:1px solid #eee}.sr-only{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;margin:0;overflow:visible;clip:auto}[role=button]{cursor:pointer}.h1,.h2,.h3,.h4,.h5,.h6,h1,h2,h3,h4,h5,h6{font-family:inherit;font-weight:500;line-height:1.1;color:inherit}.h1 .small,.h1 small,.h2 .small,.h2 small,.h3 .small,.h3 small,.h4 .small,.h4 small,.h5 .small,.h5 small,.h6 .small,.h6 small,h1 .small,h1 small,h2 .small,h2 small,h3 .small,h3 small,h4 .small,h4 small,h5 .small,h5 small,h6 .small,h6 small{font-weight:400;line-height:1;color:#777}.h1,.h2,.h3,h1,h2,h3{margin-top:20px;margin-bottom:10px}.h1 .small,.h1 small,.h2 .small,.h2 small,.h3 .small,.h3 small,h1 .small,h1 small,h2 .small,h2 small,h3 .small,h3 small{font-size:65%}.h4,.h5,.h6,h4,h5,h6{margin-top:10px;margin-bottom:10px}.h4 .small,.h4 small,.h5 .small,.h5 small,.h6 .small,.h6 small,h4 .small,h4 small,h5 .small,h5 small,h6 .small,h6 small{font-size:75%}.h1,h1{font-size:36px}.h2,h2{font-size:30px}.h3,h3{font-size:24px}.h4,h4{font-size:18px}.h5,h5{font-size:14px}.h6,h6{font-size:12px}p{margin:0 0 10px}.lead{margin-bottom:20px;font-size:16px;font-weight:300;line-height:1.4}@media (min-width:768px){.lead{font-size:21px}}.small,small{font-size:85%}.mark,mark{background-color:#fcf8e3;padding:.2em}.text-left{text-align:left}.text-right{text-align:right}.text-center{text-align:center}.text-justify{text-align:justify}.text-nowrap{white-space:nowrap}.text-lowercase{text-transform:lowercase}.text-uppercase{text-transform:uppercase}.text-capitalize{text-transform:capitalize}.text-muted{color:#777}.text-primary{color:#337ab7}a.text-primary:focus,a.text-primary:hover{color:#286090}.text-success{color:#3c763d}a.text-success:focus,a.text-success:hover{color:#2b542c}.text-info{color:#31708f}a.text-info:focus,a.text-info:hover{color:#245269}.text-warning{color:#8a6d3b}a.text-warning:focus,a.text-warning:hover{color:#66512c}.text-danger{color:#a94442}a.text-danger:focus,a.text-danger:hover{color:#843534}.bg-primary{color:#fff;background-color:#337ab7}a.bg-primary:focus,a.bg-primary:hover{background-color:#286090}.bg-success{background-color:#dff0d8}a.bg-success:focus,a.bg-success:hover{background-color:#c1e2b3}.bg-info{background-color:#d9edf7}a.bg-info:focus,a.bg-info:hover{background-color:#afd9ee}.bg-warning{background-color:#fcf8e3}a.bg-warning:focus,a.bg-warning:hover{background-color:#f7ecb5}.bg-danger{background-color:#f2dede}a.bg-danger:focus,a.bg-danger:hover{background-color:#e4b9b9}.page-header{padding-bottom:9px;margin:40px 0 20px;border-bottom:1px solid #eee}ol,ul{margin-top:0;margin-bottom:10px}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}.list-unstyled{padding-left:0;list-style:none}.list-inline{padding-left:0;list-style:none;margin-left:-5px}.list-inline>li{display:inline-block;padding-left:5px;padding-right:5px}dl{margin-top:0;margin-bottom:20px}dd,dt{line-height:1.42857143}dt{font-weight:700}dd{margin-left:0}@media (min-width:768px){.dl-horizontal dt{float:left;width:160px;clear:left;text-align:right;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dl-horizontal dd{margin-left:180px}}abbr[data-original-title],abbr[title]{cursor:help;border-bottom:1px dotted #777}.initialism{font-size:90%;text-transform:uppercase}blockquote{padding:10px 20px;margin:0 0 20px;font-size:17.5px;border-left:5px solid #eee}blockquote ol:last-child,blockquote p:last-child,blockquote ul:last-child{margin-bottom:0}blockquote .small,blockquote footer,blockquote small{display:block;font-size:80%;line-height:1.42857143;color:#777}blockquote .small:before,blockquote footer:before,blockquote small:before{content:'\2014 \00A0'}.blockquote-reverse,blockquote.pull-right{padding-right:15px;padding-left:0;border-right:5px solid #eee;border-left:0;text-align:right}.blockquote-reverse .small:before,.blockquote-reverse footer:before,.blockquote-reverse small:before,blockquote.pull-right .small:before,blockquote.pull-right footer:before,blockquote.pull-right small:before{content:''}.blockquote-reverse .small:after,.blockquote-reverse footer:after,.blockquote-reverse small:after,blockquote.pull-right .small:after,blockquote.pull-right footer:after,blockquote.pull-right small:after{content:'\00A0 \2014'}address{margin-bottom:20px;font-style:normal;line-height:1.42857143}code,kbd,pre,samp{font-family:Menlo,Monaco,Consolas,"Courier New",monospace}code{padding:2px 4px;font-size:90%;color:#c7254e;background-color:#f9f2f4;border-radius:4px}kbd{padding:2px 4px;font-size:90%;color:#fff;background-color:#333;border-radius:3px;box-shadow:inset 0 -1px 0 rgba(0,0,0,.25)}kbd kbd{padding:0;font-size:100%;font-weight:700;box-shadow:none}pre{display:block;padding:9.5px;margin:0 0 10px;font-size:13px;line-height:1.42857143;word-break:break-all;word-wrap:break-word;color:#333;background-color:#f5f5f5;border:1px solid #ccc;border-radius:4px}pre code{padding:0;font-size:inherit;color:inherit;white-space:pre-wrap;background-color:transparent;border-radius:0}.pre-scrollable{max-height:340px;overflow-y:scroll}.container{margin-right:auto;margin-left:auto;padding-left:15px;padding-right:15px}@media (min-width:768px){.container{width:750px}}@media (min-width:992px){.container{width:970px}}@media (min-width:1200px){.container{width:1170px}}.container-fluid{margin-right:auto;margin-left:auto;padding-left:15px;padding-right:15px}.row{margin-left:-15px;margin-right:-15px}.col-lg-1,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-md-1,.col-md-10,.col-md-11,.col-md-12,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-sm-1,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-xs-1,.col-xs-10,.col-xs-11,.col-xs-12,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9{position:relative;min-height:1px;padding-left:15px;padding-right:15px}.col-xs-1,.col-xs-10,.col-xs-11,.col-xs-12,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9{float:left}.col-xs-12{width:100%}.col-xs-11{width:91.66666667%}.col-xs-10{width:83.33333333%}.col-xs-9{width:75%}.col-xs-8{width:66.66666667%}.col-xs-7{width:58.33333333%}.col-xs-6{width:50%}.col-xs-5{width:41.66666667%}.col-xs-4{width:33.33333333%}.col-xs-3{width:25%}.col-xs-2{width:16.66666667%}.col-xs-1{width:8.33333333%}.col-xs-pull-12{right:100%}.col-xs-pull-11{right:91.66666667%}.col-xs-pull-10{right:83.33333333%}.col-xs-pull-9{right:75%}.col-xs-pull-8{right:66.66666667%}.col-xs-pull-7{right:58.33333333%}.col-xs-pull-6{right:50%}.col-xs-pull-5{right:41.66666667%}.col-xs-pull-4{right:33.33333333%}.col-xs-pull-3{right:25%}.col-xs-pull-2{right:16.66666667%}.col-xs-pull-1{right:8.33333333%}.col-xs-pull-0{right:auto}.col-xs-push-12{left:100%}.col-xs-push-11{left:91.66666667%}.col-xs-push-10{left:83.33333333%}.col-xs-push-9{left:75%}.col-xs-push-8{left:66.66666667%}.col-xs-push-7{left:58.33333333%}.col-xs-push-6{left:50%}.col-xs-push-5{left:41.66666667%}.col-xs-push-4{left:33.33333333%}.col-xs-push-3{left:25%}.col-xs-push-2{left:16.66666667%}.col-xs-push-1{left:8.33333333%}.col-xs-push-0{left:auto}.col-xs-offset-12{margin-left:100%}.col-xs-offset-11{margin-left:91.66666667%}.col-xs-offset-10{margin-left:83.33333333%}.col-xs-offset-9{margin-left:75%}.col-xs-offset-8{margin-left:66.66666667%}.col-xs-offset-7{margin-left:58.33333333%}.col-xs-offset-6{margin-left:50%}.col-xs-offset-5{margin-left:41.66666667%}.col-xs-offset-4{margin-left:33.33333333%}.col-xs-offset-3{margin-left:25%}.col-xs-offset-2{margin-left:16.66666667%}.col-xs-offset-1{margin-left:8.33333333%}.col-xs-offset-0{margin-left:0}@media (min-width:768px){.col-sm-1,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9{float:left}.col-sm-12{width:100%}.col-sm-11{width:91.66666667%}.col-sm-10{width:83.33333333%}.col-sm-9{width:75%}.col-sm-8{width:66.66666667%}.col-sm-7{width:58.33333333%}.col-sm-6{width:50%}.col-sm-5{width:41.66666667%}.col-sm-4{width:33.33333333%}.col-sm-3{width:25%}.col-sm-2{width:16.66666667%}.col-sm-1{width:8.33333333%}.col-sm-pull-12{right:100%}.col-sm-pull-11{right:91.66666667%}.col-sm-pull-10{right:83.33333333%}.col-sm-pull-9{right:75%}.col-sm-pull-8{right:66.66666667%}.col-sm-pull-7{right:58.33333333%}.col-sm-pull-6{right:50%}.col-sm-pull-5{right:41.66666667%}.col-sm-pull-4{right:33.33333333%}.col-sm-pull-3{right:25%}.col-sm-pull-2{right:16.66666667%}.col-sm-pull-1{right:8.33333333%}.col-sm-pull-0{right:auto}.col-sm-push-12{left:100%}.col-sm-push-11{left:91.66666667%}.col-sm-push-10{left:83.33333333%}.col-sm-push-9{left:75%}.col-sm-push-8{left:66.66666667%}.col-sm-push-7{left:58.33333333%}.col-sm-push-6{left:50%}.col-sm-push-5{left:41.66666667%}.col-sm-push-4{left:33.33333333%}.col-sm-push-3{left:25%}.col-sm-push-2{left:16.66666667%}.col-sm-push-1{left:8.33333333%}.col-sm-push-0{left:auto}.col-sm-offset-12{margin-left:100%}.col-sm-offset-11{margin-left:91.66666667%}.col-sm-offset-10{margin-left:83.33333333%}.col-sm-offset-9{margin-left:75%}.col-sm-offset-8{margin-left:66.66666667%}.col-sm-offset-7{margin-left:58.33333333%}.col-sm-offset-6{margin-left:50%}.col-sm-offset-5{margin-left:41.66666667%}.col-sm-offset-4{margin-left:33.33333333%}.col-sm-offset-3{margin-left:25%}.col-sm-offset-2{margin-left:16.66666667%}.col-sm-offset-1{margin-left:8.33333333%}.col-sm-offset-0{margin-left:0}}@media (min-width:992px){.col-md-1,.col-md-10,.col-md-11,.col-md-12,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9{float:left}.col-md-12{width:100%}.col-md-11{width:91.66666667%}.col-md-10{width:83.33333333%}.col-md-9{width:75%}.col-md-8{width:66.66666667%}.col-md-7{width:58.33333333%}.col-md-6{width:50%}.col-md-5{width:41.66666667%}.col-md-4{width:33.33333333%}.col-md-3{width:25%}.col-md-2{width:16.66666667%}.col-md-1{width:8.33333333%}.col-md-pull-12{right:100%}.col-md-pull-11{right:91.66666667%}.col-md-pull-10{right:83.33333333%}.col-md-pull-9{right:75%}.col-md-pull-8{right:66.66666667%}.col-md-pull-7{right:58.33333333%}.col-md-pull-6{right:50%}.col-md-pull-5{right:41.66666667%}.col-md-pull-4{right:33.33333333%}.col-md-pull-3{right:25%}.col-md-pull-2{right:16.66666667%}.col-md-pull-1{right:8.33333333%}.col-md-pull-0{right:auto}.col-md-push-12{left:100%}.col-md-push-11{left:91.66666667%}.col-md-push-10{left:83.33333333%}.col-md-push-9{left:75%}.col-md-push-8{left:66.66666667%}.col-md-push-7{left:58.33333333%}.col-md-push-6{left:50%}.col-md-push-5{left:41.66666667%}.col-md-push-4{left:33.33333333%}.col-md-push-3{left:25%}.col-md-push-2{left:16.66666667%}.col-md-push-1{left:8.33333333%}.col-md-push-0{left:auto}.col-md-offset-12{margin-left:100%}.col-md-offset-11{margin-left:91.66666667%}.col-md-offset-10{margin-left:83.33333333%}.col-md-offset-9{margin-left:75%}.col-md-offset-8{margin-left:66.66666667%}.col-md-offset-7{margin-left:58.33333333%}.col-md-offset-6{margin-left:50%}.col-md-offset-5{margin-left:41.66666667%}.col-md-offset-4{margin-left:33.33333333%}.col-md-offset-3{margin-left:25%}.col-md-offset-2{margin-left:16.66666667%}.col-md-offset-1{margin-left:8.33333333%}.col-md-offset-0{margin-left:0}}@media (min-width:1200px){.col-lg-1,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9{float:left}.col-lg-12{width:100%}.col-lg-11{width:91.66666667%}.col-lg-10{width:83.33333333%}.col-lg-9{width:75%}.col-lg-8{width:66.66666667%}.col-lg-7{width:58.33333333%}.col-lg-6{width:50%}.col-lg-5{width:41.66666667%}.col-lg-4{width:33.33333333%}.col-lg-3{width:25%}.col-lg-2{width:16.66666667%}.col-lg-1{width:8.33333333%}.col-lg-pull-12{right:100%}.col-lg-pull-11{right:91.66666667%}.col-lg-pull-10{right:83.33333333%}.col-lg-pull-9{right:75%}.col-lg-pull-8{right:66.66666667%}.col-lg-pull-7{right:58.33333333%}.col-lg-pull-6{right:50%}.col-lg-pull-5{right:41.66666667%}.col-lg-pull-4{right:33.33333333%}.col-lg-pull-3{right:25%}.col-lg-pull-2{right:16.66666667%}.col-lg-pull-1{right:8.33333333%}.col-lg-pull-0{right:auto}.col-lg-push-12{left:100%}.col-lg-push-11{left:91.66666667%}.col-lg-push-10{left:83.33333333%}.col-lg-push-9{left:75%}.col-lg-push-8{left:66.66666667%}.col-lg-push-7{left:58.33333333%}.col-lg-push-6{left:50%}.col-lg-push-5{left:41.66666667%}.col-lg-push-4{left:33.33333333%}.col-lg-push-3{left:25%}.col-lg-push-2{left:16.66666667%}.col-lg-push-1{left:8.33333333%}.col-lg-push-0{left:auto}.col-lg-offset-12{margin-left:100%}.col-lg-offset-11{margin-left:91.66666667%}.col-lg-offset-10{margin-left:83.33333333%}.col-lg-offset-9{margin-left:75%}.col-lg-offset-8{margin-left:66.66666667%}.col-lg-offset-7{margin-left:58.33333333%}.col-lg-offset-6{margin-left:50%}.col-lg-offset-5{margin-left:41.66666667%}.col-lg-offset-4{margin-left:33.33333333%}.col-lg-offset-3{margin-left:25%}.col-lg-offset-2{margin-left:16.66666667%}.col-lg-offset-1{margin-left:8.33333333%}.col-lg-offset-0{margin-left:0}}table{background-color:transparent}caption{padding-top:8px;padding-bottom:8px;color:#777;text-align:left}th{text-align:left}.table{width:100%;max-width:100%;margin-bottom:20px}.table>tbody>tr>td,.table>tbody>tr>th,.table>tfoot>tr>td,.table>tfoot>tr>th,.table>thead>tr>td,.table>thead>tr>th{padding:8px;line-height:1.42857143;vertical-align:top;border-top:1px solid #ddd}.table>thead>tr>th{vertical-align:bottom;border-bottom:2px solid #ddd}.table>caption+thead>tr:first-child>td,.table>caption+thead>tr:first-child>th,.table>colgroup+thead>tr:first-child>td,.table>colgroup+thead>tr:first-child>th,.table>thead:first-child>tr:first-child>td,.table>thead:first-child>tr:first-child>th{border-top:0}.table>tbody+tbody{border-top:2px solid #ddd}.table .table{background-color:#fff}.table-condensed>tbody>tr>td,.table-condensed>tbody>tr>th,.table-condensed>tfoot>tr>td,.table-condensed>tfoot>tr>th,.table-condensed>thead>tr>td,.table-condensed>thead>tr>th{padding:5px}.table-bordered{border:1px solid #ddd}.table-bordered>tbody>tr>td,.table-bordered>tbody>tr>th,.table-bordered>tfoot>tr>td,.table-bordered>tfoot>tr>th,.table-bordered>thead>tr>td,.table-bordered>thead>tr>th{border:1px solid #ddd}.table-bordered>thead>tr>td,.table-bordered>thead>tr>th{border-bottom-width:2px}.table-striped>tbody>tr:nth-of-type(odd){background-color:#f9f9f9}.table-hover>tbody>tr:hover{background-color:#f5f5f5}table col[class*=col-]{position:static;float:none;display:table-column}table td[class*=col-],table th[class*=col-]{position:static;float:none;display:table-cell}.table>tbody>tr.active>td,.table>tbody>tr.active>th,.table>tbody>tr>td.active,.table>tbody>tr>th.active,.table>tfoot>tr.active>td,.table>tfoot>tr.active>th,.table>tfoot>tr>td.active,.table>tfoot>tr>th.active,.table>thead>tr.active>td,.table>thead>tr.active>th,.table>thead>tr>td.active,.table>thead>tr>th.active{background-color:#f5f5f5}.table-hover>tbody>tr.active:hover>td,.table-hover>tbody>tr.active:hover>th,.table-hover>tbody>tr:hover>.active,.table-hover>tbody>tr>td.active:hover,.table-hover>tbody>tr>th.active:hover{background-color:#e8e8e8}.table>tbody>tr.success>td,.table>tbody>tr.success>th,.table>tbody>tr>td.success,.table>tbody>tr>th.success,.table>tfoot>tr.success>td,.table>tfoot>tr.success>th,.table>tfoot>tr>td.success,.table>tfoot>tr>th.success,.table>thead>tr.success>td,.table>thead>tr.success>th,.table>thead>tr>td.success,.table>thead>tr>th.success{background-color:#dff0d8}.table-hover>tbody>tr.success:hover>td,.table-hover>tbody>tr.success:hover>th,.table-hover>tbody>tr:hover>.success,.table-hover>tbody>tr>td.success:hover,.table-hover>tbody>tr>th.success:hover{background-color:#d0e9c6}.table>tbody>tr.info>td,.table>tbody>tr.info>th,.table>tbody>tr>td.info,.table>tbody>tr>th.info,.table>tfoot>tr.info>td,.table>tfoot>tr.info>th,.table>tfoot>tr>td.info,.table>tfoot>tr>th.info,.table>thead>tr.info>td,.table>thead>tr.info>th,.table>thead>tr>td.info,.table>thead>tr>th.info{background-color:#d9edf7}.table-hover>tbody>tr.info:hover>td,.table-hover>tbody>tr.info:hover>th,.table-hover>tbody>tr:hover>.info,.table-hover>tbody>tr>td.info:hover,.table-hover>tbody>tr>th.info:hover{background-color:#c4e3f3}.table>tbody>tr.warning>td,.table>tbody>tr.warning>th,.table>tbody>tr>td.warning,.table>tbody>tr>th.warning,.table>tfoot>tr.warning>td,.table>tfoot>tr.warning>th,.table>tfoot>tr>td.warning,.table>tfoot>tr>th.warning,.table>thead>tr.warning>td,.table>thead>tr.warning>th,.table>thead>tr>td.warning,.table>thead>tr>th.warning{background-color:#fcf8e3}.table-hover>tbody>tr.warning:hover>td,.table-hover>tbody>tr.warning:hover>th,.table-hover>tbody>tr:hover>.warning,.table-hover>tbody>tr>td.warning:hover,.table-hover>tbody>tr>th.warning:hover{background-color:#faf2cc}.table>tbody>tr.danger>td,.table>tbody>tr.danger>th,.table>tbody>tr>td.danger,.table>tbody>tr>th.danger,.table>tfoot>tr.danger>td,.table>tfoot>tr.danger>th,.table>tfoot>tr>td.danger,.table>tfoot>tr>th.danger,.table>thead>tr.danger>td,.table>thead>tr.danger>th,.table>thead>tr>td.danger,.table>thead>tr>th.danger{background-color:#f2dede}.table-hover>tbody>tr.danger:hover>td,.table-hover>tbody>tr.danger:hover>th,.table-hover>tbody>tr:hover>.danger,.table-hover>tbody>tr>td.danger:hover,.table-hover>tbody>tr>th.danger:hover{background-color:#ebcccc}.table-responsive{overflow-x:auto;min-height:.01%}@media screen and (max-width:767px){.table-responsive{width:100%;margin-bottom:15px;overflow-y:hidden;-ms-overflow-style:-ms-autohiding-scrollbar;border:1px solid #ddd}.table-responsive>.table{margin-bottom:0}.table-responsive>.table>tbody>tr>td,.table-responsive>.table>tbody>tr>th,.table-responsive>.table>tfoot>tr>td,.table-responsive>.table>tfoot>tr>th,.table-responsive>.table>thead>tr>td,.table-responsive>.table>thead>tr>th{white-space:nowrap}.table-responsive>.table-bordered{border:0}.table-responsive>.table-bordered>tbody>tr>td:first-child,.table-responsive>.table-bordered>tbody>tr>th:first-child,.table-responsive>.table-bordered>tfoot>tr>td:first-child,.table-responsive>.table-bordered>tfoot>tr>th:first-child,.table-responsive>.table-bordered>thead>tr>td:first-child,.table-responsive>.table-bordered>thead>tr>th:first-child{border-left:0}.table-responsive>.table-bordered>tbody>tr>td:last-child,.table-responsive>.table-bordered>tbody>tr>th:last-child,.table-responsive>.table-bordered>tfoot>tr>td:last-child,.table-responsive>.table-bordered>tfoot>tr>th:last-child,.table-responsive>.table-bordered>thead>tr>td:last-child,.table-responsive>.table-bordered>thead>tr>th:last-child{border-right:0}.table-responsive>.table-bordered>tbody>tr:last-child>td,.table-responsive>.table-bordered>tbody>tr:last-child>th,.table-responsive>.table-bordered>tfoot>tr:last-child>td,.table-responsive>.table-bordered>tfoot>tr:last-child>th{border-bottom:0}}fieldset{padding:0;margin:0;border:0;min-width:0}legend{display:block;width:100%;padding:0;margin-bottom:20px;font-size:21px;line-height:inherit;color:#333;border:0;border-bottom:1px solid #e5e5e5}label{display:inline-block;max-width:100%;margin-bottom:5px;font-weight:700}input[type=search]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}input[type=checkbox],input[type=radio]{margin:4px 0 0;line-height:normal}input[type=file]{display:block}input[type=range]{display:block;width:100%}select[multiple],select[size]{height:auto}input[type=checkbox]:focus,input[type=file]:focus,input[type=radio]:focus{outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}output{display:block;padding-top:7px;font-size:14px;line-height:1.42857143;color:#555}.form-control{display:block;width:100%;height:34px;padding:6px 12px;font-size:14px;line-height:1.42857143;color:#555;background-color:#fff;background-image:none;border:1px solid #ccc;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075);-webkit-transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s;-o-transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s;transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s}.form-control:focus{border-color:#66afe9;outline:0;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6);box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6)}.form-control::-moz-placeholder{color:#999;opacity:1}.form-control:-ms-input-placeholder{color:#999}.form-control::-webkit-input-placeholder{color:#999}.form-control::-ms-expand{border:0;background-color:transparent}.form-control[disabled],.form-control[readonly],fieldset[disabled] .form-control{background-color:#eee;opacity:1}.form-control[disabled],fieldset[disabled] .form-control{cursor:not-allowed}textarea.form-control{height:auto}input[type=search]{-webkit-appearance:none}@media screen and (-webkit-min-device-pixel-ratio:0){input[type=date].form-control,input[type=datetime-local].form-control,input[type=month].form-control,input[type=time].form-control{line-height:34px}.input-group-sm input[type=date],.input-group-sm input[type=datetime-local],.input-group-sm input[type=month],.input-group-sm input[type=time],input[type=date].input-sm,input[type=datetime-local].input-sm,input[type=month].input-sm,input[type=time].input-sm{line-height:30px}.input-group-lg input[type=date],.input-group-lg input[type=datetime-local],.input-group-lg input[type=month],.input-group-lg input[type=time],input[type=date].input-lg,input[type=datetime-local].input-lg,input[type=month].input-lg,input[type=time].input-lg{line-height:46px}}.form-group{margin-bottom:15px}.checkbox,.radio{position:relative;display:block;margin-top:10px;margin-bottom:10px}.checkbox label,.radio label{min-height:20px;padding-left:20px;margin-bottom:0;font-weight:400;cursor:pointer}.checkbox input[type=checkbox],.checkbox-inline input[type=checkbox],.radio input[type=radio],.radio-inline input[type=radio]{position:absolute;margin-left:-20px}.checkbox+.checkbox,.radio+.radio{margin-top:-5px}.checkbox-inline,.radio-inline{position:relative;display:inline-block;padding-left:20px;margin-bottom:0;vertical-align:middle;font-weight:400;cursor:pointer}.checkbox-inline+.checkbox-inline,.radio-inline+.radio-inline{margin-top:0;margin-left:10px}fieldset[disabled] input[type=checkbox],fieldset[disabled] input[type=radio],input[type=checkbox].disabled,input[type=checkbox][disabled],input[type=radio].disabled,input[type=radio][disabled]{cursor:not-allowed}.checkbox-inline.disabled,.radio-inline.disabled,fieldset[disabled] .checkbox-inline,fieldset[disabled] .radio-inline{cursor:not-allowed}.checkbox.disabled label,.radio.disabled label,fieldset[disabled] .checkbox label,fieldset[disabled] .radio label{cursor:not-allowed}.form-control-static{padding-top:7px;padding-bottom:7px;margin-bottom:0;min-height:34px}.form-control-static.input-lg,.form-control-static.input-sm{padding-left:0;padding-right:0}.input-sm{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}select.input-sm{height:30px;line-height:30px}select[multiple].input-sm,textarea.input-sm{height:auto}.form-group-sm .form-control{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}.form-group-sm select.form-control{height:30px;line-height:30px}.form-group-sm select[multiple].form-control,.form-group-sm textarea.form-control{height:auto}.form-group-sm .form-control-static{height:30px;min-height:32px;padding:6px 10px;font-size:12px;line-height:1.5}.input-lg{height:46px;padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}select.input-lg{height:46px;line-height:46px}select[multiple].input-lg,textarea.input-lg{height:auto}.form-group-lg .form-control{height:46px;padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}.form-group-lg select.form-control{height:46px;line-height:46px}.form-group-lg select[multiple].form-control,.form-group-lg textarea.form-control{height:auto}.form-group-lg .form-control-static{height:46px;min-height:38px;padding:11px 16px;font-size:18px;line-height:1.3333333}.has-feedback{position:relative}.has-feedback .form-control{padding-right:42.5px}.form-control-feedback{position:absolute;top:0;right:0;z-index:2;display:block;width:34px;height:34px;line-height:34px;text-align:center;pointer-events:none}.form-group-lg .form-control+.form-control-feedback,.input-group-lg+.form-control-feedback,.input-lg+.form-control-feedback{width:46px;height:46px;line-height:46px}.form-group-sm .form-control+.form-control-feedback,.input-group-sm+.form-control-feedback,.input-sm+.form-control-feedback{width:30px;height:30px;line-height:30px}.has-success .checkbox,.has-success .checkbox-inline,.has-success .control-label,.has-success .help-block,.has-success .radio,.has-success .radio-inline,.has-success.checkbox label,.has-success.checkbox-inline label,.has-success.radio label,.has-success.radio-inline label{color:#3c763d}.has-success .form-control{border-color:#3c763d;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-success .form-control:focus{border-color:#2b542c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #67b168;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #67b168}.has-success .input-group-addon{color:#3c763d;border-color:#3c763d;background-color:#dff0d8}.has-success .form-control-feedback{color:#3c763d}.has-warning .checkbox,.has-warning .checkbox-inline,.has-warning .control-label,.has-warning .help-block,.has-warning .radio,.has-warning .radio-inline,.has-warning.checkbox label,.has-warning.checkbox-inline label,.has-warning.radio label,.has-warning.radio-inline label{color:#8a6d3b}.has-warning .form-control{border-color:#8a6d3b;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-warning .form-control:focus{border-color:#66512c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #c0a16b;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #c0a16b}.has-warning .input-group-addon{color:#8a6d3b;border-color:#8a6d3b;background-color:#fcf8e3}.has-warning .form-control-feedback{color:#8a6d3b}.has-error .checkbox,.has-error .checkbox-inline,.has-error .control-label,.has-error .help-block,.has-error .radio,.has-error .radio-inline,.has-error.checkbox label,.has-error.checkbox-inline label,.has-error.radio label,.has-error.radio-inline label{color:#a94442}.has-error .form-control{border-color:#a94442;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-error .form-control:focus{border-color:#843534;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #ce8483;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #ce8483}.has-error .input-group-addon{color:#a94442;border-color:#a94442;background-color:#f2dede}.has-error .form-control-feedback{color:#a94442}.has-feedback label~.form-control-feedback{top:25px}.has-feedback label.sr-only~.form-control-feedback{top:0}.help-block{display:block;margin-top:5px;margin-bottom:10px;color:#737373}@media (min-width:768px){.form-inline .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.form-inline .form-control{display:inline-block;width:auto;vertical-align:middle}.form-inline .form-control-static{display:inline-block}.form-inline .input-group{display:inline-table;vertical-align:middle}.form-inline .input-group .form-control,.form-inline .input-group .input-group-addon,.form-inline .input-group .input-group-btn{width:auto}.form-inline .input-group>.form-control{width:100%}.form-inline .control-label{margin-bottom:0;vertical-align:middle}.form-inline .checkbox,.form-inline .radio{display:inline-block;margin-top:0;margin-bottom:0;vertical-align:middle}.form-inline .checkbox label,.form-inline .radio label{padding-left:0}.form-inline .checkbox input[type=checkbox],.form-inline .radio input[type=radio]{position:relative;margin-left:0}.form-inline .has-feedback .form-control-feedback{top:0}}.form-horizontal .checkbox,.form-horizontal .checkbox-inline,.form-horizontal .radio,.form-horizontal .radio-inline{margin-top:0;margin-bottom:0;padding-top:7px}.form-horizontal .checkbox,.form-horizontal .radio{min-height:27px}.form-horizontal .form-group{margin-left:-15px;margin-right:-15px}@media (min-width:768px){.form-horizontal .control-label{text-align:right;margin-bottom:0;padding-top:7px}}.form-horizontal .has-feedback .form-control-feedback{right:15px}@media (min-width:768px){.form-horizontal .form-group-lg .control-label{padding-top:11px;font-size:18px}}@media (min-width:768px){.form-horizontal .form-group-sm .control-label{padding-top:6px;font-size:12px}}.btn{display:inline-block;margin-bottom:0;font-weight:400;text-align:center;vertical-align:middle;touch-action:manipulation;cursor:pointer;background-image:none;border:1px solid transparent;white-space:nowrap;padding:6px 12px;font-size:14px;line-height:1.42857143;border-radius:4px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.btn.active.focus,.btn.active:focus,.btn.focus,.btn:active.focus,.btn:active:focus,.btn:focus{outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.btn.focus,.btn:focus,.btn:hover{color:#333;text-decoration:none}.btn.active,.btn:active{outline:0;background-image:none;-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.btn.disabled,.btn[disabled],fieldset[disabled] .btn{cursor:not-allowed;opacity:.65;-webkit-box-shadow:none;box-shadow:none}a.btn.disabled,fieldset[disabled] a.btn{pointer-events:none}.btn-default{color:#333;background-color:#fff;border-color:#ccc}.btn-default.focus,.btn-default:focus{color:#333;background-color:#e6e6e6;border-color:#8c8c8c}.btn-default:hover{color:#333;background-color:#e6e6e6;border-color:#adadad}.btn-default.active,.btn-default:active,.open>.dropdown-toggle.btn-default{color:#333;background-color:#e6e6e6;border-color:#adadad}.btn-default.active.focus,.btn-default.active:focus,.btn-default.active:hover,.btn-default:active.focus,.btn-default:active:focus,.btn-default:active:hover,.open>.dropdown-toggle.btn-default.focus,.open>.dropdown-toggle.btn-default:focus,.open>.dropdown-toggle.btn-default:hover{color:#333;background-color:#d4d4d4;border-color:#8c8c8c}.btn-default.active,.btn-default:active,.open>.dropdown-toggle.btn-default{background-image:none}.btn-default.disabled.focus,.btn-default.disabled:focus,.btn-default.disabled:hover,.btn-default[disabled].focus,.btn-default[disabled]:focus,.btn-default[disabled]:hover,fieldset[disabled] .btn-default.focus,fieldset[disabled] .btn-default:focus,fieldset[disabled] .btn-default:hover{background-color:#fff;border-color:#ccc}.btn-default .badge{color:#fff;background-color:#333}.btn-primary{color:#fff;background-color:#337ab7;border-color:#2e6da4}.btn-primary.focus,.btn-primary:focus{color:#fff;background-color:#286090;border-color:#122b40}.btn-primary:hover{color:#fff;background-color:#286090;border-color:#204d74}.btn-primary.active,.btn-primary:active,.open>.dropdown-toggle.btn-primary{color:#fff;background-color:#286090;border-color:#204d74}.btn-primary.active.focus,.btn-primary.active:focus,.btn-primary.active:hover,.btn-primary:active.focus,.btn-primary:active:focus,.btn-primary:active:hover,.open>.dropdown-toggle.btn-primary.focus,.open>.dropdown-toggle.btn-primary:focus,.open>.dropdown-toggle.btn-primary:hover{color:#fff;background-color:#204d74;border-color:#122b40}.btn-primary.active,.btn-primary:active,.open>.dropdown-toggle.btn-primary{background-image:none}.btn-primary.disabled.focus,.btn-primary.disabled:focus,.btn-primary.disabled:hover,.btn-primary[disabled].focus,.btn-primary[disabled]:focus,.btn-primary[disabled]:hover,fieldset[disabled] .btn-primary.focus,fieldset[disabled] .btn-primary:focus,fieldset[disabled] .btn-primary:hover{background-color:#337ab7;border-color:#2e6da4}.btn-primary .badge{color:#337ab7;background-color:#fff}.btn-success{color:#fff;background-color:#5cb85c;border-color:#4cae4c}.btn-success.focus,.btn-success:focus{color:#fff;background-color:#449d44;border-color:#255625}.btn-success:hover{color:#fff;background-color:#449d44;border-color:#398439}.btn-success.active,.btn-success:active,.open>.dropdown-toggle.btn-success{color:#fff;background-color:#449d44;border-color:#398439}.btn-success.active.focus,.btn-success.active:focus,.btn-success.active:hover,.btn-success:active.focus,.btn-success:active:focus,.btn-success:active:hover,.open>.dropdown-toggle.btn-success.focus,.open>.dropdown-toggle.btn-success:focus,.open>.dropdown-toggle.btn-success:hover{color:#fff;background-color:#398439;border-color:#255625}.btn-success.active,.btn-success:active,.open>.dropdown-toggle.btn-success{background-image:none}.btn-success.disabled.focus,.btn-success.disabled:focus,.btn-success.disabled:hover,.btn-success[disabled].focus,.btn-success[disabled]:focus,.btn-success[disabled]:hover,fieldset[disabled] .btn-success.focus,fieldset[disabled] .btn-success:focus,fieldset[disabled] .btn-success:hover{background-color:#5cb85c;border-color:#4cae4c}.btn-success .badge{color:#5cb85c;background-color:#fff}.btn-info{color:#fff;background-color:#5bc0de;border-color:#46b8da}.btn-info.focus,.btn-info:focus{color:#fff;background-color:#31b0d5;border-color:#1b6d85}.btn-info:hover{color:#fff;background-color:#31b0d5;border-color:#269abc}.btn-info.active,.btn-info:active,.open>.dropdown-toggle.btn-info{color:#fff;background-color:#31b0d5;border-color:#269abc}.btn-info.active.focus,.btn-info.active:focus,.btn-info.active:hover,.btn-info:active.focus,.btn-info:active:focus,.btn-info:active:hover,.open>.dropdown-toggle.btn-info.focus,.open>.dropdown-toggle.btn-info:focus,.open>.dropdown-toggle.btn-info:hover{color:#fff;background-color:#269abc;border-color:#1b6d85}.btn-info.active,.btn-info:active,.open>.dropdown-toggle.btn-info{background-image:none}.btn-info.disabled.focus,.btn-info.disabled:focus,.btn-info.disabled:hover,.btn-info[disabled].focus,.btn-info[disabled]:focus,.btn-info[disabled]:hover,fieldset[disabled] .btn-info.focus,fieldset[disabled] .btn-info:focus,fieldset[disabled] .btn-info:hover{background-color:#5bc0de;border-color:#46b8da}.btn-info .badge{color:#5bc0de;background-color:#fff}.btn-warning{color:#fff;background-color:#f0ad4e;border-color:#eea236}.btn-warning.focus,.btn-warning:focus{color:#fff;background-color:#ec971f;border-color:#985f0d}.btn-warning:hover{color:#fff;background-color:#ec971f;border-color:#d58512}.btn-warning.active,.btn-warning:active,.open>.dropdown-toggle.btn-warning{color:#fff;background-color:#ec971f;border-color:#d58512}.btn-warning.active.focus,.btn-warning.active:focus,.btn-warning.active:hover,.btn-warning:active.focus,.btn-warning:active:focus,.btn-warning:active:hover,.open>.dropdown-toggle.btn-warning.focus,.open>.dropdown-toggle.btn-warning:focus,.open>.dropdown-toggle.btn-warning:hover{color:#fff;background-color:#d58512;border-color:#985f0d}.btn-warning.active,.btn-warning:active,.open>.dropdown-toggle.btn-warning{background-image:none}.btn-warning.disabled.focus,.btn-warning.disabled:focus,.btn-warning.disabled:hover,.btn-warning[disabled].focus,.btn-warning[disabled]:focus,.btn-warning[disabled]:hover,fieldset[disabled] .btn-warning.focus,fieldset[disabled] .btn-warning:focus,fieldset[disabled] .btn-warning:hover{background-color:#f0ad4e;border-color:#eea236}.btn-warning .badge{color:#f0ad4e;background-color:#fff}.btn-danger{color:#fff;background-color:#d9534f;border-color:#d43f3a}.btn-danger.focus,.btn-danger:focus{color:#fff;background-color:#c9302c;border-color:#761c19}.btn-danger:hover{color:#fff;background-color:#c9302c;border-color:#ac2925}.btn-danger.active,.btn-danger:active,.open>.dropdown-toggle.btn-danger{color:#fff;background-color:#c9302c;border-color:#ac2925}.btn-danger.active.focus,.btn-danger.active:focus,.btn-danger.active:hover,.btn-danger:active.focus,.btn-danger:active:focus,.btn-danger:active:hover,.open>.dropdown-toggle.btn-danger.focus,.open>.dropdown-toggle.btn-danger:focus,.open>.dropdown-toggle.btn-danger:hover{color:#fff;background-color:#ac2925;border-color:#761c19}.btn-danger.active,.btn-danger:active,.open>.dropdown-toggle.btn-danger{background-image:none}.btn-danger.disabled.focus,.btn-danger.disabled:focus,.btn-danger.disabled:hover,.btn-danger[disabled].focus,.btn-danger[disabled]:focus,.btn-danger[disabled]:hover,fieldset[disabled] .btn-danger.focus,fieldset[disabled] .btn-danger:focus,fieldset[disabled] .btn-danger:hover{background-color:#d9534f;border-color:#d43f3a}.btn-danger .badge{color:#d9534f;background-color:#fff}.btn-link{color:#337ab7;font-weight:400;border-radius:0}.btn-link,.btn-link.active,.btn-link:active,.btn-link[disabled],fieldset[disabled] .btn-link{background-color:transparent;-webkit-box-shadow:none;box-shadow:none}.btn-link,.btn-link:active,.btn-link:focus,.btn-link:hover{border-color:transparent}.btn-link:focus,.btn-link:hover{color:#23527c;text-decoration:underline;background-color:transparent}.btn-link[disabled]:focus,.btn-link[disabled]:hover,fieldset[disabled] .btn-link:focus,fieldset[disabled] .btn-link:hover{color:#777;text-decoration:none}.btn-group-lg>.btn,.btn-lg{padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}.btn-group-sm>.btn,.btn-sm{padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}.btn-group-xs>.btn,.btn-xs{padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px}.btn-block{display:block;width:100%}.btn-block+.btn-block{margin-top:5px}input[type=button].btn-block,input[type=reset].btn-block,input[type=submit].btn-block{width:100%}.fade{opacity:0;-webkit-transition:opacity .15s linear;-o-transition:opacity .15s linear;transition:opacity .15s linear}.fade.in{opacity:1}.collapse{display:none}.collapse.in{display:block}tr.collapse.in{display:table-row}tbody.collapse.in{display:table-row-group}.collapsing{position:relative;height:0;overflow:hidden;-webkit-transition-property:height,visibility;transition-property:height,visibility;-webkit-transition-duration:.35s;transition-duration:.35s;-webkit-transition-timing-function:ease;transition-timing-function:ease}.caret{display:inline-block;width:0;height:0;margin-left:2px;vertical-align:middle;border-top:4px dashed;border-right:4px solid transparent;border-left:4px solid transparent}.dropdown,.dropup{position:relative}.dropdown-toggle:focus{outline:0}.dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:160px;padding:5px 0;margin:2px 0 0;list-style:none;font-size:14px;text-align:left;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,.15);border-radius:4px;-webkit-box-shadow:0 6px 12px rgba(0,0,0,.175);box-shadow:0 6px 12px rgba(0,0,0,.175);background-clip:padding-box}.dropdown-menu.pull-right{right:0;left:auto}.dropdown-menu .divider{height:1px;margin:9px 0;overflow:hidden;background-color:#e5e5e5}.dropdown-menu>li>a{display:block;padding:3px 20px;clear:both;font-weight:400;line-height:1.42857143;color:#333;white-space:nowrap}.dropdown-menu>li>a:focus,.dropdown-menu>li>a:hover{text-decoration:none;color:#262626;background-color:#f5f5f5}.dropdown-menu>.active>a,.dropdown-menu>.active>a:focus,.dropdown-menu>.active>a:hover{color:#fff;text-decoration:none;outline:0;background-color:#337ab7}.dropdown-menu>.disabled>a,.dropdown-menu>.disabled>a:focus,.dropdown-menu>.disabled>a:hover{color:#777}.dropdown-menu>.disabled>a:focus,.dropdown-menu>.disabled>a:hover{text-decoration:none;background-color:transparent;background-image:none;cursor:not-allowed}.open>.dropdown-menu{display:block}.open>a{outline:0}.dropdown-menu-right{left:auto;right:0}.dropdown-menu-left{left:0;right:auto}.dropdown-header{display:block;padding:3px 20px;font-size:12px;line-height:1.42857143;color:#777;white-space:nowrap}.dropdown-backdrop{position:fixed;left:0;right:0;bottom:0;top:0;z-index:990}.pull-right>.dropdown-menu{right:0;left:auto}.dropup .caret,.navbar-fixed-bottom .dropdown .caret{border-top:0;border-bottom:4px dashed;content:""}.dropup .dropdown-menu,.navbar-fixed-bottom .dropdown .dropdown-menu{top:auto;bottom:100%;margin-bottom:2px}@media (min-width:768px){.navbar-right .dropdown-menu{left:auto;right:0}.navbar-right .dropdown-menu-left{left:0;right:auto}}.btn-group,.btn-group-vertical{position:relative;display:inline-block;vertical-align:middle}.btn-group-vertical>.btn,.btn-group>.btn{position:relative;float:left}.btn-group-vertical>.btn.active,.btn-group-vertical>.btn:active,.btn-group-vertical>.btn:focus,.btn-group-vertical>.btn:hover,.btn-group>.btn.active,.btn-group>.btn:active,.btn-group>.btn:focus,.btn-group>.btn:hover{z-index:2}.btn-group .btn+.btn,.btn-group .btn+.btn-group,.btn-group .btn-group+.btn,.btn-group .btn-group+.btn-group{margin-left:-1px}.btn-toolbar{margin-left:-5px}.btn-toolbar .btn,.btn-toolbar .btn-group,.btn-toolbar .input-group{float:left}.btn-toolbar>.btn,.btn-toolbar>.btn-group,.btn-toolbar>.input-group{margin-left:5px}.btn-group>.btn:not(:first-child):not(:last-child):not(.dropdown-toggle){border-radius:0}.btn-group>.btn:first-child{margin-left:0}.btn-group>.btn:first-child:not(:last-child):not(.dropdown-toggle){border-bottom-right-radius:0;border-top-right-radius:0}.btn-group>.btn:last-child:not(:first-child),.btn-group>.dropdown-toggle:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0}.btn-group>.btn-group{float:left}.btn-group>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group>.btn-group:first-child:not(:last-child)>.btn:last-child,.btn-group>.btn-group:first-child:not(:last-child)>.dropdown-toggle{border-bottom-right-radius:0;border-top-right-radius:0}.btn-group>.btn-group:last-child:not(:first-child)>.btn:first-child{border-bottom-left-radius:0;border-top-left-radius:0}.btn-group .dropdown-toggle:active,.btn-group.open .dropdown-toggle{outline:0}.btn-group>.btn+.dropdown-toggle{padding-left:8px;padding-right:8px}.btn-group>.btn-lg+.dropdown-toggle{padding-left:12px;padding-right:12px}.btn-group.open .dropdown-toggle{-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.btn-group.open .dropdown-toggle.btn-link{-webkit-box-shadow:none;box-shadow:none}.btn .caret{margin-left:0}.btn-lg .caret{border-width:5px 5px 0;border-bottom-width:0}.dropup .btn-lg .caret{border-width:0 5px 5px}.btn-group-vertical>.btn,.btn-group-vertical>.btn-group,.btn-group-vertical>.btn-group>.btn{display:block;float:none;width:100%;max-width:100%}.btn-group-vertical>.btn-group>.btn{float:none}.btn-group-vertical>.btn+.btn,.btn-group-vertical>.btn+.btn-group,.btn-group-vertical>.btn-group+.btn,.btn-group-vertical>.btn-group+.btn-group{margin-top:-1px;margin-left:0}.btn-group-vertical>.btn:not(:first-child):not(:last-child){border-radius:0}.btn-group-vertical>.btn:first-child:not(:last-child){border-top-right-radius:4px;border-top-left-radius:4px;border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn:last-child:not(:first-child){border-top-right-radius:0;border-top-left-radius:0;border-bottom-right-radius:4px;border-bottom-left-radius:4px}.btn-group-vertical>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group-vertical>.btn-group:first-child:not(:last-child)>.btn:last-child,.btn-group-vertical>.btn-group:first-child:not(:last-child)>.dropdown-toggle{border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn-group:last-child:not(:first-child)>.btn:first-child{border-top-right-radius:0;border-top-left-radius:0}.btn-group-justified{display:table;width:100%;table-layout:fixed;border-collapse:separate}.btn-group-justified>.btn,.btn-group-justified>.btn-group{float:none;display:table-cell;width:1%}.btn-group-justified>.btn-group .btn{width:100%}.btn-group-justified>.btn-group .dropdown-menu{left:auto}[data-toggle=buttons]>.btn input[type=checkbox],[data-toggle=buttons]>.btn input[type=radio],[data-toggle=buttons]>.btn-group>.btn input[type=checkbox],[data-toggle=buttons]>.btn-group>.btn input[type=radio]{position:absolute;clip:rect(0,0,0,0);pointer-events:none}.input-group{position:relative;display:table;border-collapse:separate}.input-group[class*=col-]{float:none;padding-left:0;padding-right:0}.input-group .form-control{position:relative;z-index:2;float:left;width:100%;margin-bottom:0}.input-group .form-control:focus{z-index:3}.input-group-lg>.form-control,.input-group-lg>.input-group-addon,.input-group-lg>.input-group-btn>.btn{height:46px;padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}select.input-group-lg>.form-control,select.input-group-lg>.input-group-addon,select.input-group-lg>.input-group-btn>.btn{height:46px;line-height:46px}select[multiple].input-group-lg>.form-control,select[multiple].input-group-lg>.input-group-addon,select[multiple].input-group-lg>.input-group-btn>.btn,textarea.input-group-lg>.form-control,textarea.input-group-lg>.input-group-addon,textarea.input-group-lg>.input-group-btn>.btn{height:auto}.input-group-sm>.form-control,.input-group-sm>.input-group-addon,.input-group-sm>.input-group-btn>.btn{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}select.input-group-sm>.form-control,select.input-group-sm>.input-group-addon,select.input-group-sm>.input-group-btn>.btn{height:30px;line-height:30px}select[multiple].input-group-sm>.form-control,select[multiple].input-group-sm>.input-group-addon,select[multiple].input-group-sm>.input-group-btn>.btn,textarea.input-group-sm>.form-control,textarea.input-group-sm>.input-group-addon,textarea.input-group-sm>.input-group-btn>.btn{height:auto}.input-group .form-control,.input-group-addon,.input-group-btn{display:table-cell}.input-group .form-control:not(:first-child):not(:last-child),.input-group-addon:not(:first-child):not(:last-child),.input-group-btn:not(:first-child):not(:last-child){border-radius:0}.input-group-addon,.input-group-btn{width:1%;white-space:nowrap;vertical-align:middle}.input-group-addon{padding:6px 12px;font-size:14px;font-weight:400;line-height:1;color:#555;text-align:center;background-color:#eee;border:1px solid #ccc;border-radius:4px}.input-group-addon.input-sm{padding:5px 10px;font-size:12px;border-radius:3px}.input-group-addon.input-lg{padding:10px 16px;font-size:18px;border-radius:6px}.input-group-addon input[type=checkbox],.input-group-addon input[type=radio]{margin-top:0}.input-group .form-control:first-child,.input-group-addon:first-child,.input-group-btn:first-child>.btn,.input-group-btn:first-child>.btn-group>.btn,.input-group-btn:first-child>.dropdown-toggle,.input-group-btn:last-child>.btn-group:not(:last-child)>.btn,.input-group-btn:last-child>.btn:not(:last-child):not(.dropdown-toggle){border-bottom-right-radius:0;border-top-right-radius:0}.input-group-addon:first-child{border-right:0}.input-group .form-control:last-child,.input-group-addon:last-child,.input-group-btn:first-child>.btn-group:not(:first-child)>.btn,.input-group-btn:first-child>.btn:not(:first-child),.input-group-btn:last-child>.btn,.input-group-btn:last-child>.btn-group>.btn,.input-group-btn:last-child>.dropdown-toggle{border-bottom-left-radius:0;border-top-left-radius:0}.input-group-addon:last-child{border-left:0}.input-group-btn{position:relative;font-size:0;white-space:nowrap}.input-group-btn>.btn{position:relative}.input-group-btn>.btn+.btn{margin-left:-1px}.input-group-btn>.btn:active,.input-group-btn>.btn:focus,.input-group-btn>.btn:hover{z-index:2}.input-group-btn:first-child>.btn,.input-group-btn:first-child>.btn-group{margin-right:-1px}.input-group-btn:last-child>.btn,.input-group-btn:last-child>.btn-group{z-index:2;margin-left:-1px}.nav{margin-bottom:0;padding-left:0;list-style:none}.nav>li{position:relative;display:block}.nav>li>a{position:relative;display:block;padding:10px 15px}.nav>li>a:focus,.nav>li>a:hover{text-decoration:none;background-color:#eee}.nav>li.disabled>a{color:#777}.nav>li.disabled>a:focus,.nav>li.disabled>a:hover{color:#777;text-decoration:none;background-color:transparent;cursor:not-allowed}.nav .open>a,.nav .open>a:focus,.nav .open>a:hover{background-color:#eee;border-color:#337ab7}.nav .nav-divider{height:1px;margin:9px 0;overflow:hidden;background-color:#e5e5e5}.nav>li>a>img{max-width:none}.nav-tabs{border-bottom:1px solid #ddd}.nav-tabs>li{float:left;margin-bottom:-1px}.nav-tabs>li>a{margin-right:2px;line-height:1.42857143;border:1px solid transparent;border-radius:4px 4px 0 0}.nav-tabs>li>a:hover{border-color:#eee #eee #ddd}.nav-tabs>li.active>a,.nav-tabs>li.active>a:focus,.nav-tabs>li.active>a:hover{color:#555;background-color:#fff;border:1px solid #ddd;border-bottom-color:transparent;cursor:default}.nav-tabs.nav-justified{width:100%;border-bottom:0}.nav-tabs.nav-justified>li{float:none}.nav-tabs.nav-justified>li>a{text-align:center;margin-bottom:5px}.nav-tabs.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}@media (min-width:768px){.nav-tabs.nav-justified>li{display:table-cell;width:1%}.nav-tabs.nav-justified>li>a{margin-bottom:0}}.nav-tabs.nav-justified>li>a{margin-right:0;border-radius:4px}.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:focus,.nav-tabs.nav-justified>.active>a:hover{border:1px solid #ddd}@media (min-width:768px){.nav-tabs.nav-justified>li>a{border-bottom:1px solid #ddd;border-radius:4px 4px 0 0}.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:focus,.nav-tabs.nav-justified>.active>a:hover{border-bottom-color:#fff}}.nav-pills>li{float:left}.nav-pills>li>a{border-radius:4px}.nav-pills>li+li{margin-left:2px}.nav-pills>li.active>a,.nav-pills>li.active>a:focus,.nav-pills>li.active>a:hover{color:#fff;background-color:#337ab7}.nav-stacked>li{float:none}.nav-stacked>li+li{margin-top:2px;margin-left:0}.nav-justified{width:100%}.nav-justified>li{float:none}.nav-justified>li>a{text-align:center;margin-bottom:5px}.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}@media (min-width:768px){.nav-justified>li{display:table-cell;width:1%}.nav-justified>li>a{margin-bottom:0}}.nav-tabs-justified{border-bottom:0}.nav-tabs-justified>li>a{margin-right:0;border-radius:4px}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:focus,.nav-tabs-justified>.active>a:hover{border:1px solid #ddd}@media (min-width:768px){.nav-tabs-justified>li>a{border-bottom:1px solid #ddd;border-radius:4px 4px 0 0}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:focus,.nav-tabs-justified>.active>a:hover{border-bottom-color:#fff}}.tab-content>.tab-pane{display:none}.tab-content>.active{display:block}.nav-tabs .dropdown-menu{margin-top:-1px;border-top-right-radius:0;border-top-left-radius:0}.navbar{position:relative;min-height:32px;margin-bottom:20px;border:1px solid transparent}@media (min-width:768px){.navbar{border-radius:4px}}@media (min-width:768px){.navbar-header{float:left}}.navbar-collapse{overflow-x:visible;padding-right:15px;padding-left:15px;border-top:1px solid transparent;box-shadow:inset 0 1px 0 rgba(255,255,255,.1);-webkit-overflow-scrolling:touch}.navbar-collapse.in{overflow-y:auto}@media (min-width:768px){.navbar-collapse{width:auto;border-top:0;box-shadow:none}.navbar-collapse.collapse{display:block!important;height:auto!important;padding-bottom:0;overflow:visible!important}.navbar-collapse.in{overflow-y:visible}.navbar-fixed-bottom .navbar-collapse,.navbar-fixed-top .navbar-collapse,.navbar-static-top .navbar-collapse{padding-left:0;padding-right:0}}.navbar-fixed-bottom .navbar-collapse,.navbar-fixed-top .navbar-collapse{max-height:340px}@media (max-device-width:480px) and (orientation:landscape){.navbar-fixed-bottom .navbar-collapse,.navbar-fixed-top .navbar-collapse{max-height:200px}}.container-fluid>.navbar-collapse,.container-fluid>.navbar-header,.container>.navbar-collapse,.container>.navbar-header{margin-right:-15px;margin-left:-15px}@media (min-width:768px){.container-fluid>.navbar-collapse,.container-fluid>.navbar-header,.container>.navbar-collapse,.container>.navbar-header{margin-right:0;margin-left:0}}.navbar-static-top{z-index:1000;border-width:0 0 1px}@media (min-width:768px){.navbar-static-top{border-radius:0}}.navbar-fixed-bottom,.navbar-fixed-top{position:fixed;right:0;left:0;z-index:1030}@media (min-width:768px){.navbar-fixed-bottom,.navbar-fixed-top{border-radius:0}}.navbar-fixed-top{top:0;border-width:0 0 1px}.navbar-fixed-bottom{bottom:0;margin-bottom:0;border-width:1px 0 0}.navbar-brand{float:left;padding:6px 15px;font-size:18px;line-height:20px;height:32px}.navbar-brand:focus,.navbar-brand:hover{text-decoration:none}.navbar-brand>img{display:block}@media (min-width:768px){.navbar>.container .navbar-brand,.navbar>.container-fluid .navbar-brand{margin-left:-15px}}.navbar-toggle{position:relative;float:right;margin-right:15px;padding:9px 10px;margin-top:-1px;margin-bottom:-1px;background-color:transparent;background-image:none;border:1px solid transparent;border-radius:4px}.navbar-toggle:focus{outline:0}.navbar-toggle .icon-bar{display:block;width:22px;height:2px;border-radius:1px}.navbar-toggle .icon-bar+.icon-bar{margin-top:4px}@media (min-width:768px){.navbar-toggle{display:none}}.navbar-nav{margin:3px -15px}.navbar-nav>li>a{padding-top:10px;padding-bottom:10px;line-height:20px}@media (max-width:767px){.navbar-nav .open .dropdown-menu{position:static;float:none;width:auto;margin-top:0;background-color:transparent;border:0;box-shadow:none}.navbar-nav .open .dropdown-menu .dropdown-header,.navbar-nav .open .dropdown-menu>li>a{padding:5px 15px 5px 25px}.navbar-nav .open .dropdown-menu>li>a{line-height:20px}.navbar-nav .open .dropdown-menu>li>a:focus,.navbar-nav .open .dropdown-menu>li>a:hover{background-image:none}}@media (min-width:768px){.navbar-nav{float:left;margin:0}.navbar-nav>li{float:left}.navbar-nav>li>a{padding-top:6px;padding-bottom:6px}}.navbar-form{margin-left:-15px;margin-right:-15px;padding:10px 15px;border-top:1px solid transparent;border-bottom:1px solid transparent;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.1),0 1px 0 rgba(255,255,255,.1);box-shadow:inset 0 1px 0 rgba(255,255,255,.1),0 1px 0 rgba(255,255,255,.1);margin-top:-1px;margin-bottom:-1px}@media (min-width:768px){.navbar-form .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.navbar-form .form-control{display:inline-block;width:auto;vertical-align:middle}.navbar-form .form-control-static{display:inline-block}.navbar-form .input-group{display:inline-table;vertical-align:middle}.navbar-form .input-group .form-control,.navbar-form .input-group .input-group-addon,.navbar-form .input-group .input-group-btn{width:auto}.navbar-form .input-group>.form-control{width:100%}.navbar-form .control-label{margin-bottom:0;vertical-align:middle}.navbar-form .checkbox,.navbar-form .radio{display:inline-block;margin-top:0;margin-bottom:0;vertical-align:middle}.navbar-form .checkbox label,.navbar-form .radio label{padding-left:0}.navbar-form .checkbox input[type=checkbox],.navbar-form .radio input[type=radio]{position:relative;margin-left:0}.navbar-form .has-feedback .form-control-feedback{top:0}}@media (max-width:767px){.navbar-form .form-group{margin-bottom:5px}.navbar-form .form-group:last-child{margin-bottom:0}}@media (min-width:768px){.navbar-form{width:auto;border:0;margin-left:0;margin-right:0;padding-top:0;padding-bottom:0;-webkit-box-shadow:none;box-shadow:none}}.navbar-nav>li>.dropdown-menu{margin-top:0;border-top-right-radius:0;border-top-left-radius:0}.navbar-fixed-bottom .navbar-nav>li>.dropdown-menu{margin-bottom:0;border-top-right-radius:4px;border-top-left-radius:4px;border-bottom-right-radius:0;border-bottom-left-radius:0}.navbar-btn{margin-top:-1px;margin-bottom:-1px}.navbar-btn.btn-sm{margin-top:1px;margin-bottom:1px}.navbar-btn.btn-xs{margin-top:5px;margin-bottom:5px}.navbar-text{margin-top:6px;margin-bottom:6px}@media (min-width:768px){.navbar-text{float:left;margin-left:15px;margin-right:15px}}@media (min-width:768px){.navbar-left{float:left!important;float:left}.navbar-right{float:right!important;float:right;margin-right:-15px}.navbar-right~.navbar-right{margin-right:0}}.navbar-default{background-color:#fff;border-color:#e0e0e0}.navbar-default .navbar-brand{color:#303030}.navbar-default .navbar-brand:focus,.navbar-default .navbar-brand:hover{color:#161616;background-color:transparent}.navbar-default .navbar-text{color:#303030}.navbar-default .navbar-nav>li>a{color:#303030}.navbar-default .navbar-nav>li>a:focus,.navbar-default .navbar-nav>li>a:hover{color:#333;background-color:transparent}.navbar-default .navbar-nav>.active>a,.navbar-default .navbar-nav>.active>a:focus,.navbar-default .navbar-nav>.active>a:hover{color:#555;background-color:#eee}.navbar-default .navbar-nav>.disabled>a,.navbar-default .navbar-nav>.disabled>a:focus,.navbar-default .navbar-nav>.disabled>a:hover{color:#ccc;background-color:transparent}.navbar-default .navbar-toggle{border-color:#ddd}.navbar-default .navbar-toggle:focus,.navbar-default .navbar-toggle:hover{background-color:#ddd}.navbar-default .navbar-toggle .icon-bar{background-color:#888}.navbar-default .navbar-collapse,.navbar-default .navbar-form{border-color:#e0e0e0}.navbar-default .navbar-nav>.open>a,.navbar-default .navbar-nav>.open>a:focus,.navbar-default .navbar-nav>.open>a:hover{background-color:#eee;color:#555}@media (max-width:767px){.navbar-default .navbar-nav .open .dropdown-menu>li>a{color:#303030}.navbar-default .navbar-nav .open .dropdown-menu>li>a:focus,.navbar-default .navbar-nav .open .dropdown-menu>li>a:hover{color:#333;background-color:transparent}.navbar-default .navbar-nav .open .dropdown-menu>.active>a,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:focus,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:hover{color:#555;background-color:#eee}.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:focus,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:hover{color:#ccc;background-color:transparent}}.navbar-default .navbar-link{color:#303030}.navbar-default .navbar-link:hover{color:#333}.navbar-default .btn-link{color:#303030}.navbar-default .btn-link:focus,.navbar-default .btn-link:hover{color:#333}.navbar-default .btn-link[disabled]:focus,.navbar-default .btn-link[disabled]:hover,fieldset[disabled] .navbar-default .btn-link:focus,fieldset[disabled] .navbar-default .btn-link:hover{color:#ccc}.navbar-inverse{background-color:#222;border-color:#080808}.navbar-inverse .navbar-brand{color:#9d9d9d}.navbar-inverse .navbar-brand:focus,.navbar-inverse .navbar-brand:hover{color:#fff;background-color:transparent}.navbar-inverse .navbar-text{color:#9d9d9d}.navbar-inverse .navbar-nav>li>a{color:#9d9d9d}.navbar-inverse .navbar-nav>li>a:focus,.navbar-inverse .navbar-nav>li>a:hover{color:#fff;background-color:transparent}.navbar-inverse .navbar-nav>.active>a,.navbar-inverse .navbar-nav>.active>a:focus,.navbar-inverse .navbar-nav>.active>a:hover{color:#fff;background-color:#080808}.navbar-inverse .navbar-nav>.disabled>a,.navbar-inverse .navbar-nav>.disabled>a:focus,.navbar-inverse .navbar-nav>.disabled>a:hover{color:#444;background-color:transparent}.navbar-inverse .navbar-toggle{border-color:#333}.navbar-inverse .navbar-toggle:focus,.navbar-inverse .navbar-toggle:hover{background-color:#333}.navbar-inverse .navbar-toggle .icon-bar{background-color:#fff}.navbar-inverse .navbar-collapse,.navbar-inverse .navbar-form{border-color:#101010}.navbar-inverse .navbar-nav>.open>a,.navbar-inverse .navbar-nav>.open>a:focus,.navbar-inverse .navbar-nav>.open>a:hover{background-color:#080808;color:#fff}@media (max-width:767px){.navbar-inverse .navbar-nav .open .dropdown-menu>.dropdown-header{border-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu .divider{background-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a{color:#9d9d9d}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:focus,.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:hover{color:#fff;background-color:transparent}.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:focus,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:hover{color:#fff;background-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:focus,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:hover{color:#444;background-color:transparent}}.navbar-inverse .navbar-link{color:#9d9d9d}.navbar-inverse .navbar-link:hover{color:#fff}.navbar-inverse .btn-link{color:#9d9d9d}.navbar-inverse .btn-link:focus,.navbar-inverse .btn-link:hover{color:#fff}.navbar-inverse .btn-link[disabled]:focus,.navbar-inverse .btn-link[disabled]:hover,fieldset[disabled] .navbar-inverse .btn-link:focus,fieldset[disabled] .navbar-inverse .btn-link:hover{color:#444}.breadcrumb{padding:8px 15px;margin-bottom:20px;list-style:none;background-color:#f5f5f5;border-radius:4px}.breadcrumb>li{display:inline-block}.breadcrumb>li+li:before{content:"/\00a0";padding:0 5px;color:#ccc}.breadcrumb>.active{color:#777}.pagination{display:inline-block;padding-left:0;margin:20px 0;border-radius:4px}.pagination>li{display:inline}.pagination>li>a,.pagination>li>span{position:relative;float:left;padding:6px 12px;line-height:1.42857143;text-decoration:none;color:#337ab7;background-color:#fff;border:1px solid #ddd;margin-left:-1px}.pagination>li:first-child>a,.pagination>li:first-child>span{margin-left:0;border-bottom-left-radius:4px;border-top-left-radius:4px}.pagination>li:last-child>a,.pagination>li:last-child>span{border-bottom-right-radius:4px;border-top-right-radius:4px}.pagination>li>a:focus,.pagination>li>a:hover,.pagination>li>span:focus,.pagination>li>span:hover{z-index:2;color:#23527c;background-color:#eee;border-color:#ddd}.pagination>.active>a,.pagination>.active>a:focus,.pagination>.active>a:hover,.pagination>.active>span,.pagination>.active>span:focus,.pagination>.active>span:hover{z-index:3;color:#fff;background-color:#337ab7;border-color:#337ab7;cursor:default}.pagination>.disabled>a,.pagination>.disabled>a:focus,.pagination>.disabled>a:hover,.pagination>.disabled>span,.pagination>.disabled>span:focus,.pagination>.disabled>span:hover{color:#777;background-color:#fff;border-color:#ddd;cursor:not-allowed}.pagination-lg>li>a,.pagination-lg>li>span{padding:10px 16px;font-size:18px;line-height:1.3333333}.pagination-lg>li:first-child>a,.pagination-lg>li:first-child>span{border-bottom-left-radius:6px;border-top-left-radius:6px}.pagination-lg>li:last-child>a,.pagination-lg>li:last-child>span{border-bottom-right-radius:6px;border-top-right-radius:6px}.pagination-sm>li>a,.pagination-sm>li>span{padding:5px 10px;font-size:12px;line-height:1.5}.pagination-sm>li:first-child>a,.pagination-sm>li:first-child>span{border-bottom-left-radius:3px;border-top-left-radius:3px}.pagination-sm>li:last-child>a,.pagination-sm>li:last-child>span{border-bottom-right-radius:3px;border-top-right-radius:3px}.pager{padding-left:0;margin:20px 0;list-style:none;text-align:center}.pager li{display:inline}.pager li>a,.pager li>span{display:inline-block;padding:5px 14px;background-color:#fff;border:1px solid #ddd;border-radius:15px}.pager li>a:focus,.pager li>a:hover{text-decoration:none;background-color:#eee}.pager .next>a,.pager .next>span{float:right}.pager .previous>a,.pager .previous>span{float:left}.pager .disabled>a,.pager .disabled>a:focus,.pager .disabled>a:hover,.pager .disabled>span{color:#777;background-color:#fff;cursor:not-allowed}.label{display:inline;padding:.2em .6em .3em;font-size:75%;font-weight:700;line-height:1;color:#fff;text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:.25em}a.label:focus,a.label:hover{color:#fff;text-decoration:none;cursor:pointer}.label:empty{display:none}.btn .label{position:relative;top:-1px}.label-default{background-color:#777}.label-default[href]:focus,.label-default[href]:hover{background-color:#5e5e5e}.label-primary{background-color:#337ab7}.label-primary[href]:focus,.label-primary[href]:hover{background-color:#286090}.label-success{background-color:#5cb85c}.label-success[href]:focus,.label-success[href]:hover{background-color:#449d44}.label-info{background-color:#5bc0de}.label-info[href]:focus,.label-info[href]:hover{background-color:#31b0d5}.label-warning{background-color:#f0ad4e}.label-warning[href]:focus,.label-warning[href]:hover{background-color:#ec971f}.label-danger{background-color:#d9534f}.label-danger[href]:focus,.label-danger[href]:hover{background-color:#c9302c}.badge{display:inline-block;min-width:10px;padding:3px 7px;font-size:12px;font-weight:700;color:#fff;line-height:1;vertical-align:middle;white-space:nowrap;text-align:center;background-color:#777;border-radius:10px}.badge:empty{display:none}.btn .badge{position:relative;top:-1px}.btn-group-xs>.btn .badge,.btn-xs .badge{top:0;padding:1px 5px}a.badge:focus,a.badge:hover{color:#fff;text-decoration:none;cursor:pointer}.list-group-item.active>.badge,.nav-pills>.active>a>.badge{color:#337ab7;background-color:#fff}.list-group-item>.badge{float:right}.list-group-item>.badge+.badge{margin-right:5px}.nav-pills>li>a>.badge{margin-left:3px}.jumbotron{padding-top:30px;padding-bottom:30px;margin-bottom:30px;color:inherit;background-color:#eee}.jumbotron .h1,.jumbotron h1{color:inherit}.jumbotron p{margin-bottom:15px;font-size:21px;font-weight:200}.jumbotron>hr{border-top-color:#d5d5d5}.container .jumbotron,.container-fluid .jumbotron{border-radius:6px;padding-left:15px;padding-right:15px}.jumbotron .container{max-width:100%}@media screen and (min-width:768px){.jumbotron{padding-top:48px;padding-bottom:48px}.container .jumbotron,.container-fluid .jumbotron{padding-left:60px;padding-right:60px}.jumbotron .h1,.jumbotron h1{font-size:63px}}.thumbnail{display:block;padding:4px;margin-bottom:20px;line-height:1.42857143;background-color:#fff;border:1px solid #ddd;border-radius:4px;-webkit-transition:border .2s ease-in-out;-o-transition:border .2s ease-in-out;transition:border .2s ease-in-out}.thumbnail a>img,.thumbnail>img{margin-left:auto;margin-right:auto}a.thumbnail.active,a.thumbnail:focus,a.thumbnail:hover{border-color:#337ab7}.thumbnail .caption{padding:9px;color:#333}.alert{padding:15px;margin-bottom:20px;border:1px solid transparent;border-radius:4px}.alert h4{margin-top:0;color:inherit}.alert .alert-link{font-weight:700}.alert>p,.alert>ul{margin-bottom:0}.alert>p+p{margin-top:5px}.alert-dismissable,.alert-dismissible{padding-right:35px}.alert-dismissable .close,.alert-dismissible .close{position:relative;top:-2px;right:-21px;color:inherit}.alert-success{background-color:#dff0d8;border-color:#d6e9c6;color:#3c763d}.alert-success hr{border-top-color:#c9e2b3}.alert-success .alert-link{color:#2b542c}.alert-info{background-color:#d9edf7;border-color:#bce8f1;color:#31708f}.alert-info hr{border-top-color:#a6e1ec}.alert-info .alert-link{color:#245269}.alert-warning{background-color:#fcf8e3;border-color:#faebcc;color:#8a6d3b}.alert-warning hr{border-top-color:#f7e1b5}.alert-warning .alert-link{color:#66512c}.alert-danger{background-color:#f2dede;border-color:#ebccd1;color:#a94442}.alert-danger hr{border-top-color:#e4b9c0}.alert-danger .alert-link{color:#843534}@-webkit-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}.progress{overflow:hidden;height:20px;margin-bottom:20px;background-color:#f5f5f5;border-radius:4px;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,.1);box-shadow:inset 0 1px 2px rgba(0,0,0,.1)}.progress-bar{float:left;width:0;height:100%;font-size:12px;line-height:20px;color:#fff;text-align:center;background-color:#337ab7;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,.15);box-shadow:inset 0 -1px 0 rgba(0,0,0,.15);-webkit-transition:width .6s ease;-o-transition:width .6s ease;transition:width .6s ease}.progress-bar-striped,.progress-striped .progress-bar{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-size:40px 40px}.progress-bar.active,.progress.active .progress-bar{-webkit-animation:progress-bar-stripes 2s linear infinite;-o-animation:progress-bar-stripes 2s linear infinite;animation:progress-bar-stripes 2s linear infinite}.progress-bar-success{background-color:#5cb85c}.progress-striped .progress-bar-success{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-info{background-color:#5bc0de}.progress-striped .progress-bar-info{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-warning{background-color:#f0ad4e}.progress-striped .progress-bar-warning{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-danger{background-color:#d9534f}.progress-striped .progress-bar-danger{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.media{margin-top:15px}.media:first-child{margin-top:0}.media,.media-body{zoom:1;overflow:hidden}.media-body{width:10000px}.media-object{display:block}.media-object.img-thumbnail{max-width:none}.media-right,.media>.pull-right{padding-left:10px}.media-left,.media>.pull-left{padding-right:10px}.media-body,.media-left,.media-right{display:table-cell;vertical-align:top}.media-middle{vertical-align:middle}.media-bottom{vertical-align:bottom}.media-heading{margin-top:0;margin-bottom:5px}.media-list{padding-left:0;list-style:none}.list-group{margin-bottom:20px;padding-left:0}.list-group-item{position:relative;display:block;padding:10px 15px;margin-bottom:-1px;background-color:#fff;border:1px solid #ddd}.list-group-item:first-child{border-top-right-radius:4px;border-top-left-radius:4px}.list-group-item:last-child{margin-bottom:0;border-bottom-right-radius:4px;border-bottom-left-radius:4px}a.list-group-item,button.list-group-item{color:#555}a.list-group-item .list-group-item-heading,button.list-group-item .list-group-item-heading{color:#333}a.list-group-item:focus,a.list-group-item:hover,button.list-group-item:focus,button.list-group-item:hover{text-decoration:none;color:#555;background-color:#f5f5f5}button.list-group-item{width:100%;text-align:left}.list-group-item.disabled,.list-group-item.disabled:focus,.list-group-item.disabled:hover{background-color:#eee;color:#777;cursor:not-allowed}.list-group-item.disabled .list-group-item-heading,.list-group-item.disabled:focus .list-group-item-heading,.list-group-item.disabled:hover .list-group-item-heading{color:inherit}.list-group-item.disabled .list-group-item-text,.list-group-item.disabled:focus .list-group-item-text,.list-group-item.disabled:hover .list-group-item-text{color:#777}.list-group-item.active,.list-group-item.active:focus,.list-group-item.active:hover{z-index:2;color:#fff;background-color:#337ab7;border-color:#337ab7}.list-group-item.active .list-group-item-heading,.list-group-item.active .list-group-item-heading>.small,.list-group-item.active .list-group-item-heading>small,.list-group-item.active:focus .list-group-item-heading,.list-group-item.active:focus .list-group-item-heading>.small,.list-group-item.active:focus .list-group-item-heading>small,.list-group-item.active:hover .list-group-item-heading,.list-group-item.active:hover .list-group-item-heading>.small,.list-group-item.active:hover .list-group-item-heading>small{color:inherit}.list-group-item.active .list-group-item-text,.list-group-item.active:focus .list-group-item-text,.list-group-item.active:hover .list-group-item-text{color:#c7ddef}.list-group-item-success{color:#3c763d;background-color:#dff0d8}a.list-group-item-success,button.list-group-item-success{color:#3c763d}a.list-group-item-success .list-group-item-heading,button.list-group-item-success .list-group-item-heading{color:inherit}a.list-group-item-success:focus,a.list-group-item-success:hover,button.list-group-item-success:focus,button.list-group-item-success:hover{color:#3c763d;background-color:#d0e9c6}a.list-group-item-success.active,a.list-group-item-success.active:focus,a.list-group-item-success.active:hover,button.list-group-item-success.active,button.list-group-item-success.active:focus,button.list-group-item-success.active:hover{color:#fff;background-color:#3c763d;border-color:#3c763d}.list-group-item-info{color:#31708f;background-color:#d9edf7}a.list-group-item-info,button.list-group-item-info{color:#31708f}a.list-group-item-info .list-group-item-heading,button.list-group-item-info .list-group-item-heading{color:inherit}a.list-group-item-info:focus,a.list-group-item-info:hover,button.list-group-item-info:focus,button.list-group-item-info:hover{color:#31708f;background-color:#c4e3f3}a.list-group-item-info.active,a.list-group-item-info.active:focus,a.list-group-item-info.active:hover,button.list-group-item-info.active,button.list-group-item-info.active:focus,button.list-group-item-info.active:hover{color:#fff;background-color:#31708f;border-color:#31708f}.list-group-item-warning{color:#8a6d3b;background-color:#fcf8e3}a.list-group-item-warning,button.list-group-item-warning{color:#8a6d3b}a.list-group-item-warning .list-group-item-heading,button.list-group-item-warning .list-group-item-heading{color:inherit}a.list-group-item-warning:focus,a.list-group-item-warning:hover,button.list-group-item-warning:focus,button.list-group-item-warning:hover{color:#8a6d3b;background-color:#faf2cc}a.list-group-item-warning.active,a.list-group-item-warning.active:focus,a.list-group-item-warning.active:hover,button.list-group-item-warning.active,button.list-group-item-warning.active:focus,button.list-group-item-warning.active:hover{color:#fff;background-color:#8a6d3b;border-color:#8a6d3b}.list-group-item-danger{color:#a94442;background-color:#f2dede}a.list-group-item-danger,button.list-group-item-danger{color:#a94442}a.list-group-item-danger .list-group-item-heading,button.list-group-item-danger .list-group-item-heading{color:inherit}a.list-group-item-danger:focus,a.list-group-item-danger:hover,button.list-group-item-danger:focus,button.list-group-item-danger:hover{color:#a94442;background-color:#ebcccc}a.list-group-item-danger.active,a.list-group-item-danger.active:focus,a.list-group-item-danger.active:hover,button.list-group-item-danger.active,button.list-group-item-danger.active:focus,button.list-group-item-danger.active:hover{color:#fff;background-color:#a94442;border-color:#a94442}.list-group-item-heading{margin-top:0;margin-bottom:5px}.list-group-item-text{margin-bottom:0;line-height:1.3}.panel{margin-bottom:20px;background-color:#fff;border:1px solid transparent;border-radius:4px;-webkit-box-shadow:0 1px 1px rgba(0,0,0,.05);box-shadow:0 1px 1px rgba(0,0,0,.05)}.panel-body{padding:15px}.panel-heading{padding:10px 15px;border-bottom:1px solid transparent;border-top-right-radius:3px;border-top-left-radius:3px}.panel-heading>.dropdown .dropdown-toggle{color:inherit}.panel-title{margin-top:0;margin-bottom:0;font-size:16px;color:inherit}.panel-title>.small,.panel-title>.small>a,.panel-title>a,.panel-title>small,.panel-title>small>a{color:inherit}.panel-footer{padding:10px 15px;background-color:#f5f5f5;border-top:1px solid #ddd;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.list-group,.panel>.panel-collapse>.list-group{margin-bottom:0}.panel>.list-group .list-group-item,.panel>.panel-collapse>.list-group .list-group-item{border-width:1px 0;border-radius:0}.panel>.list-group:first-child .list-group-item:first-child,.panel>.panel-collapse>.list-group:first-child .list-group-item:first-child{border-top:0;border-top-right-radius:3px;border-top-left-radius:3px}.panel>.list-group:last-child .list-group-item:last-child,.panel>.panel-collapse>.list-group:last-child .list-group-item:last-child{border-bottom:0;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.panel-heading+.panel-collapse>.list-group .list-group-item:first-child{border-top-right-radius:0;border-top-left-radius:0}.panel-heading+.list-group .list-group-item:first-child{border-top-width:0}.list-group+.panel-footer{border-top-width:0}.panel>.panel-collapse>.table,.panel>.table,.panel>.table-responsive>.table{margin-bottom:0}.panel>.panel-collapse>.table caption,.panel>.table caption,.panel>.table-responsive>.table caption{padding-left:15px;padding-right:15px}.panel>.table-responsive:first-child>.table:first-child,.panel>.table:first-child{border-top-right-radius:3px;border-top-left-radius:3px}.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child,.panel>.table:first-child>thead:first-child>tr:first-child{border-top-left-radius:3px;border-top-right-radius:3px}.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child td:first-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child th:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child td:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child th:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child td:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child th:first-child,.panel>.table:first-child>thead:first-child>tr:first-child td:first-child,.panel>.table:first-child>thead:first-child>tr:first-child th:first-child{border-top-left-radius:3px}.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child td:last-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child th:last-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child td:last-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child th:last-child,.panel>.table:first-child>tbody:first-child>tr:first-child td:last-child,.panel>.table:first-child>tbody:first-child>tr:first-child th:last-child,.panel>.table:first-child>thead:first-child>tr:first-child td:last-child,.panel>.table:first-child>thead:first-child>tr:first-child th:last-child{border-top-right-radius:3px}.panel>.table-responsive:last-child>.table:last-child,.panel>.table:last-child{border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child{border-bottom-left-radius:3px;border-bottom-right-radius:3px}.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child td:first-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child th:first-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child td:first-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child th:first-child,.panel>.table:last-child>tbody:last-child>tr:last-child td:first-child,.panel>.table:last-child>tbody:last-child>tr:last-child th:first-child,.panel>.table:last-child>tfoot:last-child>tr:last-child td:first-child,.panel>.table:last-child>tfoot:last-child>tr:last-child th:first-child{border-bottom-left-radius:3px}.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child td:last-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child th:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child td:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child th:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child td:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child th:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child td:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child th:last-child{border-bottom-right-radius:3px}.panel>.panel-body+.table,.panel>.panel-body+.table-responsive,.panel>.table+.panel-body,.panel>.table-responsive+.panel-body{border-top:1px solid #ddd}.panel>.table>tbody:first-child>tr:first-child td,.panel>.table>tbody:first-child>tr:first-child th{border-top:0}.panel>.table-bordered,.panel>.table-responsive>.table-bordered{border:0}.panel>.table-bordered>tbody>tr>td:first-child,.panel>.table-bordered>tbody>tr>th:first-child,.panel>.table-bordered>tfoot>tr>td:first-child,.panel>.table-bordered>tfoot>tr>th:first-child,.panel>.table-bordered>thead>tr>td:first-child,.panel>.table-bordered>thead>tr>th:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:first-child,.panel>.table-responsive>.table-bordered>thead>tr>td:first-child,.panel>.table-responsive>.table-bordered>thead>tr>th:first-child{border-left:0}.panel>.table-bordered>tbody>tr>td:last-child,.panel>.table-bordered>tbody>tr>th:last-child,.panel>.table-bordered>tfoot>tr>td:last-child,.panel>.table-bordered>tfoot>tr>th:last-child,.panel>.table-bordered>thead>tr>td:last-child,.panel>.table-bordered>thead>tr>th:last-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:last-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:last-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:last-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:last-child,.panel>.table-responsive>.table-bordered>thead>tr>td:last-child,.panel>.table-responsive>.table-bordered>thead>tr>th:last-child{border-right:0}.panel>.table-bordered>tbody>tr:first-child>td,.panel>.table-bordered>tbody>tr:first-child>th,.panel>.table-bordered>thead>tr:first-child>td,.panel>.table-bordered>thead>tr:first-child>th,.panel>.table-responsive>.table-bordered>tbody>tr:first-child>td,.panel>.table-responsive>.table-bordered>tbody>tr:first-child>th,.panel>.table-responsive>.table-bordered>thead>tr:first-child>td,.panel>.table-responsive>.table-bordered>thead>tr:first-child>th{border-bottom:0}.panel>.table-bordered>tbody>tr:last-child>td,.panel>.table-bordered>tbody>tr:last-child>th,.panel>.table-bordered>tfoot>tr:last-child>td,.panel>.table-bordered>tfoot>tr:last-child>th,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>td,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>th,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>td,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>th{border-bottom:0}.panel>.table-responsive{border:0;margin-bottom:0}.panel-group{margin-bottom:20px}.panel-group .panel{margin-bottom:0;border-radius:4px}.panel-group .panel+.panel{margin-top:5px}.panel-group .panel-heading{border-bottom:0}.panel-group .panel-heading+.panel-collapse>.list-group,.panel-group .panel-heading+.panel-collapse>.panel-body{border-top:1px solid #ddd}.panel-group .panel-footer{border-top:0}.panel-group .panel-footer+.panel-collapse .panel-body{border-bottom:1px solid #ddd}.panel-default{border-color:#ddd}.panel-default>.panel-heading{color:#333;background-color:#f5f5f5;border-color:#ddd}.panel-default>.panel-heading+.panel-collapse>.panel-body{border-top-color:#ddd}.panel-default>.panel-heading .badge{color:#f5f5f5;background-color:#333}.panel-default>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#ddd}.panel-primary{border-color:#337ab7}.panel-primary>.panel-heading{color:#fff;background-color:#337ab7;border-color:#337ab7}.panel-primary>.panel-heading+.panel-collapse>.panel-body{border-top-color:#337ab7}.panel-primary>.panel-heading .badge{color:#337ab7;background-color:#fff}.panel-primary>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#337ab7}.panel-success{border-color:#d6e9c6}.panel-success>.panel-heading{color:#3c763d;background-color:#dff0d8;border-color:#d6e9c6}.panel-success>.panel-heading+.panel-collapse>.panel-body{border-top-color:#d6e9c6}.panel-success>.panel-heading .badge{color:#dff0d8;background-color:#3c763d}.panel-success>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#d6e9c6}.panel-info{border-color:#bce8f1}.panel-info>.panel-heading{color:#31708f;background-color:#d9edf7;border-color:#bce8f1}.panel-info>.panel-heading+.panel-collapse>.panel-body{border-top-color:#bce8f1}.panel-info>.panel-heading .badge{color:#d9edf7;background-color:#31708f}.panel-info>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#bce8f1}.panel-warning{border-color:#faebcc}.panel-warning>.panel-heading{color:#8a6d3b;background-color:#fcf8e3;border-color:#faebcc}.panel-warning>.panel-heading+.panel-collapse>.panel-body{border-top-color:#faebcc}.panel-warning>.panel-heading .badge{color:#fcf8e3;background-color:#8a6d3b}.panel-warning>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#faebcc}.panel-danger{border-color:#ebccd1}.panel-danger>.panel-heading{color:#a94442;background-color:#f2dede;border-color:#ebccd1}.panel-danger>.panel-heading+.panel-collapse>.panel-body{border-top-color:#ebccd1}.panel-danger>.panel-heading .badge{color:#f2dede;background-color:#a94442}.panel-danger>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#ebccd1}.embed-responsive{position:relative;display:block;height:0;padding:0;overflow:hidden}.embed-responsive .embed-responsive-item,.embed-responsive embed,.embed-responsive iframe,.embed-responsive object,.embed-responsive video{position:absolute;top:0;left:0;bottom:0;height:100%;width:100%;border:0}.embed-responsive-16by9{padding-bottom:56.25%}.embed-responsive-4by3{padding-bottom:75%}.well{min-height:20px;padding:19px;margin-bottom:20px;background-color:#f5f5f5;border:1px solid #e3e3e3;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.05);box-shadow:inset 0 1px 1px rgba(0,0,0,.05)}.well blockquote{border-color:#ddd;border-color:rgba(0,0,0,.15)}.well-lg{padding:24px;border-radius:6px}.well-sm{padding:9px;border-radius:3px}.close{float:right;font-size:21px;font-weight:700;line-height:1;color:#000;text-shadow:0 1px 0 #fff;opacity:.2}.close:focus,.close:hover{color:#000;text-decoration:none;cursor:pointer;opacity:.5}button.close{padding:0;cursor:pointer;background:0 0;border:0;-webkit-appearance:none}.modal-open{overflow:hidden}.modal{display:none;overflow:hidden;position:fixed;top:0;right:0;bottom:0;left:0;z-index:1050;-webkit-overflow-scrolling:touch;outline:0}.modal.fade .modal-dialog{-webkit-transform:translate(0,-25%);-ms-transform:translate(0,-25%);-o-transform:translate(0,-25%);transform:translate(0,-25%);-webkit-transition:-webkit-transform .3s ease-out;-moz-transition:-moz-transform .3s ease-out;-o-transition:-o-transform .3s ease-out;transition:transform .3s ease-out}.modal.in .modal-dialog{-webkit-transform:translate(0,0);-ms-transform:translate(0,0);-o-transform:translate(0,0);transform:translate(0,0)}.modal-open .modal{overflow-x:hidden;overflow-y:auto}.modal-dialog{position:relative;width:auto;margin:10px}.modal-content{position:relative;background-color:#fff;border:1px solid #999;border:1px solid rgba(0,0,0,.2);border-radius:6px;-webkit-box-shadow:0 3px 9px rgba(0,0,0,.5);box-shadow:0 3px 9px rgba(0,0,0,.5);background-clip:padding-box;outline:0}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1040;background-color:#000}.modal-backdrop.fade{opacity:0}.modal-backdrop.in{opacity:.5}.modal-header{padding:15px;border-bottom:1px solid #e5e5e5}.modal-header .close{margin-top:-2px}.modal-title{margin:0;line-height:1.42857143}.modal-body{position:relative;padding:15px}.modal-footer{padding:15px;text-align:right;border-top:1px solid #e5e5e5}.modal-footer .btn+.btn{margin-left:5px;margin-bottom:0}.modal-footer .btn-group .btn+.btn{margin-left:-1px}.modal-footer .btn-block+.btn-block{margin-left:0}.modal-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}@media (min-width:768px){.modal-dialog{width:600px;margin:30px auto}.modal-content{-webkit-box-shadow:0 5px 15px rgba(0,0,0,.5);box-shadow:0 5px 15px rgba(0,0,0,.5)}.modal-sm{width:300px}}@media (min-width:992px){.modal-lg{width:900px}}.tooltip{position:absolute;z-index:1070;display:block;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-style:normal;font-weight:400;letter-spacing:normal;line-break:auto;line-height:1.42857143;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;white-space:normal;word-break:normal;word-spacing:normal;word-wrap:normal;font-size:12px;opacity:0}.tooltip.in{opacity:.9}.tooltip.top{margin-top:-3px;padding:5px 0}.tooltip.right{margin-left:3px;padding:0 5px}.tooltip.bottom{margin-top:3px;padding:5px 0}.tooltip.left{margin-left:-3px;padding:0 5px}.tooltip-inner{max-width:200px;padding:3px 8px;color:#fff;text-align:center;background-color:#000;border-radius:4px}.tooltip-arrow{position:absolute;width:0;height:0;border-color:transparent;border-style:solid}.tooltip.top .tooltip-arrow{bottom:0;left:50%;margin-left:-5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.top-left .tooltip-arrow{bottom:0;right:5px;margin-bottom:-5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.top-right .tooltip-arrow{bottom:0;left:5px;margin-bottom:-5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.right .tooltip-arrow{top:50%;left:0;margin-top:-5px;border-width:5px 5px 5px 0;border-right-color:#000}.tooltip.left .tooltip-arrow{top:50%;right:0;margin-top:-5px;border-width:5px 0 5px 5px;border-left-color:#000}.tooltip.bottom .tooltip-arrow{top:0;left:50%;margin-left:-5px;border-width:0 5px 5px;border-bottom-color:#000}.tooltip.bottom-left .tooltip-arrow{top:0;right:5px;margin-top:-5px;border-width:0 5px 5px;border-bottom-color:#000}.tooltip.bottom-right .tooltip-arrow{top:0;left:5px;margin-top:-5px;border-width:0 5px 5px;border-bottom-color:#000}.popover{position:absolute;top:0;left:0;z-index:1060;display:none;max-width:276px;padding:1px;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-style:normal;font-weight:400;letter-spacing:normal;line-break:auto;line-height:1.42857143;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;white-space:normal;word-break:normal;word-spacing:normal;word-wrap:normal;font-size:14px;background-color:#fff;background-clip:padding-box;border:1px solid #ccc;border:1px solid rgba(0,0,0,.2);border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,.2);box-shadow:0 5px 10px rgba(0,0,0,.2)}.popover.top{margin-top:-10px}.popover.right{margin-left:10px}.popover.bottom{margin-top:10px}.popover.left{margin-left:-10px}.popover-title{margin:0;padding:8px 14px;font-size:14px;background-color:#f7f7f7;border-bottom:1px solid #ebebeb;border-radius:5px 5px 0 0}.popover-content{padding:9px 14px}.popover>.arrow,.popover>.arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.popover>.arrow{border-width:11px}.popover>.arrow:after{border-width:10px;content:""}.popover.top>.arrow{left:50%;margin-left:-11px;border-bottom-width:0;border-top-color:#999;border-top-color:rgba(0,0,0,.25);bottom:-11px}.popover.top>.arrow:after{content:" ";bottom:1px;margin-left:-10px;border-bottom-width:0;border-top-color:#fff}.popover.right>.arrow{top:50%;left:-11px;margin-top:-11px;border-left-width:0;border-right-color:#999;border-right-color:rgba(0,0,0,.25)}.popover.right>.arrow:after{content:" ";left:1px;bottom:-10px;border-left-width:0;border-right-color:#fff}.popover.bottom>.arrow{left:50%;margin-left:-11px;border-top-width:0;border-bottom-color:#999;border-bottom-color:rgba(0,0,0,.25);top:-11px}.popover.bottom>.arrow:after{content:" ";top:1px;margin-left:-10px;border-top-width:0;border-bottom-color:#fff}.popover.left>.arrow{top:50%;right:-11px;margin-top:-11px;border-right-width:0;border-left-color:#999;border-left-color:rgba(0,0,0,.25)}.popover.left>.arrow:after{content:" ";right:1px;border-right-width:0;border-left-color:#fff;bottom:-10px}.carousel{position:relative}.carousel-inner{position:relative;overflow:hidden;width:100%}.carousel-inner>.item{display:none;position:relative;-webkit-transition:.6s ease-in-out left;-o-transition:.6s ease-in-out left;transition:.6s ease-in-out left}.carousel-inner>.item>a>img,.carousel-inner>.item>img{line-height:1}@media all and (transform-3d),(-webkit-transform-3d){.carousel-inner>.item{-webkit-transition:-webkit-transform .6s ease-in-out;-moz-transition:-moz-transform .6s ease-in-out;-o-transition:-o-transform .6s ease-in-out;transition:transform .6s ease-in-out;-webkit-backface-visibility:hidden;-moz-backface-visibility:hidden;backface-visibility:hidden;-webkit-perspective:1000px;-moz-perspective:1000px;perspective:1000px}.carousel-inner>.item.active.right,.carousel-inner>.item.next{-webkit-transform:translate3d(100%,0,0);transform:translate3d(100%,0,0);left:0}.carousel-inner>.item.active.left,.carousel-inner>.item.prev{-webkit-transform:translate3d(-100%,0,0);transform:translate3d(-100%,0,0);left:0}.carousel-inner>.item.active,.carousel-inner>.item.next.left,.carousel-inner>.item.prev.right{-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0);left:0}}.carousel-inner>.active,.carousel-inner>.next,.carousel-inner>.prev{display:block}.carousel-inner>.active{left:0}.carousel-inner>.next,.carousel-inner>.prev{position:absolute;top:0;width:100%}.carousel-inner>.next{left:100%}.carousel-inner>.prev{left:-100%}.carousel-inner>.next.left,.carousel-inner>.prev.right{left:0}.carousel-inner>.active.left{left:-100%}.carousel-inner>.active.right{left:100%}.carousel-control{position:absolute;top:0;left:0;bottom:0;width:15%;opacity:.5;font-size:20px;color:#fff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,.6);background-color:rgba(0,0,0,0)}.carousel-control.left{background-image:-webkit-linear-gradient(left,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001) 100%);background-image:-o-linear-gradient(left,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001) 100%);background-image:linear-gradient(to right,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001) 100%);background-repeat:repeat-x}.carousel-control.right{left:auto;right:0;background-image:-webkit-linear-gradient(left,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5) 100%);background-image:-o-linear-gradient(left,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5) 100%);background-image:linear-gradient(to right,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5) 100%);background-repeat:repeat-x}.carousel-control:focus,.carousel-control:hover{outline:0;color:#fff;text-decoration:none;opacity:.9}.carousel-control .glyphicon-chevron-left,.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next,.carousel-control .icon-prev{position:absolute;top:50%;margin-top:-10px;z-index:5;display:inline-block}.carousel-control .glyphicon-chevron-left,.carousel-control .icon-prev{left:50%;margin-left:-10px}.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next{right:50%;margin-right:-10px}.carousel-control .icon-next,.carousel-control .icon-prev{width:20px;height:20px;line-height:1;font-family:serif}.carousel-control .icon-prev:before{content:'\2039'}.carousel-control .icon-next:before{content:'\203a'}.carousel-indicators{position:absolute;bottom:10px;left:50%;z-index:15;width:60%;margin-left:-30%;padding-left:0;list-style:none;text-align:center}.carousel-indicators li{display:inline-block;width:10px;height:10px;margin:1px;text-indent:-999px;border:1px solid #fff;border-radius:10px;cursor:pointer;background-color:rgba(0,0,0,0)}.carousel-indicators .active{margin:0;width:12px;height:12px;background-color:#fff}.carousel-caption{position:absolute;left:15%;right:15%;bottom:20px;z-index:10;padding-top:20px;padding-bottom:20px;color:#fff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,.6)}.carousel-caption .btn{text-shadow:none}@media screen and (min-width:768px){.carousel-control .glyphicon-chevron-left,.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next,.carousel-control .icon-prev{width:30px;height:30px;margin-top:-10px;font-size:30px}.carousel-control .glyphicon-chevron-left,.carousel-control .icon-prev{margin-left:-10px}.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next{margin-right:-10px}.carousel-caption{left:20%;right:20%;padding-bottom:30px}.carousel-indicators{bottom:20px}}.btn-group-vertical>.btn-group:after,.btn-group-vertical>.btn-group:before,.btn-toolbar:after,.btn-toolbar:before,.clearfix:after,.clearfix:before,.container-fluid:after,.container-fluid:before,.container:after,.container:before,.dl-horizontal dd:after,.dl-horizontal dd:before,.form-horizontal .form-group:after,.form-horizontal .form-group:before,.modal-footer:after,.modal-footer:before,.modal-header:after,.modal-header:before,.nav:after,.nav:before,.navbar-collapse:after,.navbar-collapse:before,.navbar-header:after,.navbar-header:before,.navbar:after,.navbar:before,.pager:after,.pager:before,.panel-body:after,.panel-body:before,.row:after,.row:before{content:" ";display:table}.btn-group-vertical>.btn-group:after,.btn-toolbar:after,.clearfix:after,.container-fluid:after,.container:after,.dl-horizontal dd:after,.form-horizontal .form-group:after,.modal-footer:after,.modal-header:after,.nav:after,.navbar-collapse:after,.navbar-header:after,.navbar:after,.pager:after,.panel-body:after,.row:after{clear:both}.center-block{display:block;margin-left:auto;margin-right:auto}.pull-right{float:right!important}.pull-left{float:left!important}.hide{display:none!important}.show{display:block!important}.invisible{visibility:hidden}.text-hide{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.hidden{display:none!important}.affix{position:fixed}@-ms-viewport{width:device-width}.visible-lg,.visible-md,.visible-sm,.visible-xs{display:none!important}.visible-lg-block,.visible-lg-inline,.visible-lg-inline-block,.visible-md-block,.visible-md-inline,.visible-md-inline-block,.visible-sm-block,.visible-sm-inline,.visible-sm-inline-block,.visible-xs-block,.visible-xs-inline,.visible-xs-inline-block{display:none!important}@media (max-width:767px){.visible-xs{display:block!important}table.visible-xs{display:table!important}tr.visible-xs{display:table-row!important}td.visible-xs,th.visible-xs{display:table-cell!important}}@media (max-width:767px){.visible-xs-block{display:block!important}}@media (max-width:767px){.visible-xs-inline{display:inline!important}}@media (max-width:767px){.visible-xs-inline-block{display:inline-block!important}}@media (min-width:768px) and (max-width:991px){.visible-sm{display:block!important}table.visible-sm{display:table!important}tr.visible-sm{display:table-row!important}td.visible-sm,th.visible-sm{display:table-cell!important}}@media (min-width:768px) and (max-width:991px){.visible-sm-block{display:block!important}}@media (min-width:768px) and (max-width:991px){.visible-sm-inline{display:inline!important}}@media (min-width:768px) and (max-width:991px){.visible-sm-inline-block{display:inline-block!important}}@media (min-width:992px) and (max-width:1199px){.visible-md{display:block!important}table.visible-md{display:table!important}tr.visible-md{display:table-row!important}td.visible-md,th.visible-md{display:table-cell!important}}@media (min-width:992px) and (max-width:1199px){.visible-md-block{display:block!important}}@media (min-width:992px) and (max-width:1199px){.visible-md-inline{display:inline!important}}@media (min-width:992px) and (max-width:1199px){.visible-md-inline-block{display:inline-block!important}}@media (min-width:1200px){.visible-lg{display:block!important}table.visible-lg{display:table!important}tr.visible-lg{display:table-row!important}td.visible-lg,th.visible-lg{display:table-cell!important}}@media (min-width:1200px){.visible-lg-block{display:block!important}}@media (min-width:1200px){.visible-lg-inline{display:inline!important}}@media (min-width:1200px){.visible-lg-inline-block{display:inline-block!important}}@media (max-width:767px){.hidden-xs{display:none!important}}@media (min-width:768px) and (max-width:991px){.hidden-sm{display:none!important}}@media (min-width:992px) and (max-width:1199px){.hidden-md{display:none!important}}@media (min-width:1200px){.hidden-lg{display:none!important}}.visible-print{display:none!important}@media print{.visible-print{display:block!important}table.visible-print{display:table!important}tr.visible-print{display:table-row!important}td.visible-print,th.visible-print{display:table-cell!important}}.visible-print-block{display:none!important}@media print{.visible-print-block{display:block!important}}.visible-print-inline{display:none!important}@media print{.visible-print-inline{display:inline!important}}.visible-print-inline-block{display:none!important}@media print{.visible-print-inline-block{display:inline-block!important}}@media print{.hidden-print{display:none!important}}/*!
* Font Awesome 4.2.0 by @davegandy - http://fontawesome.io - @fontawesome
* License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License)
- */
-/* FONT PATH
- * -------------------------- */
-@font-face {
- font-family: 'FontAwesome';
- src: url('fonts/fontawesome-webfont.eot?v=4.2.0');
- src: url('fonts/fontawesome-webfont.eot?#iefix&v=4.2.0') format('embedded-opentype'), url('fonts/fontawesome-webfont.woff?v=4.2.0') format('woff'), url('fonts/fontawesome-webfont.ttf?v=4.2.0') format('truetype'), url('fonts/fontawesome-webfont.svg?v=4.2.0#fontawesomeregular') format('svg');
- font-weight: normal;
- font-style: normal;
-}
-.fa {
- display: inline-block;
- font: normal normal normal 14px/1 FontAwesome;
- font-size: inherit;
- text-rendering: auto;
- -webkit-font-smoothing: antialiased;
- -moz-osx-font-smoothing: grayscale;
-}
-/* makes the font 33% larger relative to the icon container */
-.fa-lg {
- font-size: 1.3333333333333333em;
- line-height: 0.75em;
- vertical-align: -15%;
-}
-.fa-2x {
- font-size: 2em;
-}
-.fa-3x {
- font-size: 3em;
-}
-.fa-4x {
- font-size: 4em;
-}
-.fa-5x {
- font-size: 5em;
-}
-.fa-fw {
- width: 1.2857142857142858em;
- text-align: center;
-}
-.fa-ul {
- padding-left: 0;
- margin-left: 2.142857142857143em;
- list-style-type: none;
-}
-.fa-ul > li {
- position: relative;
-}
-.fa-li {
- position: absolute;
- left: -2.14285714em;
- width: 2.142857142857143em;
- top: 0.14285714285714285em;
- text-align: center;
-}
-.fa-li.fa-lg {
- left: -1.85714286em;
-}
-.fa-border {
- padding: .2em .25em .15em;
- border: solid 0.08em #eeeeee;
- border-radius: .1em;
-}
-.pull-right {
- float: right;
-}
-.pull-left {
- float: left;
-}
-.fa.pull-left {
- margin-right: .3em;
-}
-.fa.pull-right {
- margin-left: .3em;
-}
-.fa-spin {
- -webkit-animation: fa-spin 2s infinite linear;
- animation: fa-spin 2s infinite linear;
-}
-@-webkit-keyframes fa-spin {
- 0% {
- -webkit-transform: rotate(0deg);
- transform: rotate(0deg);
- }
- 100% {
- -webkit-transform: rotate(359deg);
- transform: rotate(359deg);
- }
-}
-@keyframes fa-spin {
- 0% {
- -webkit-transform: rotate(0deg);
- transform: rotate(0deg);
- }
- 100% {
- -webkit-transform: rotate(359deg);
- transform: rotate(359deg);
- }
-}
-.fa-rotate-90 {
- filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=1);
- -webkit-transform: rotate(90deg);
- -ms-transform: rotate(90deg);
- transform: rotate(90deg);
-}
-.fa-rotate-180 {
- filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=2);
- -webkit-transform: rotate(180deg);
- -ms-transform: rotate(180deg);
- transform: rotate(180deg);
-}
-.fa-rotate-270 {
- filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3);
- -webkit-transform: rotate(270deg);
- -ms-transform: rotate(270deg);
- transform: rotate(270deg);
-}
-.fa-flip-horizontal {
- filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1);
- -webkit-transform: scale(-1, 1);
- -ms-transform: scale(-1, 1);
- transform: scale(-1, 1);
-}
-.fa-flip-vertical {
- filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1);
- -webkit-transform: scale(1, -1);
- -ms-transform: scale(1, -1);
- transform: scale(1, -1);
-}
-:root .fa-rotate-90,
-:root .fa-rotate-180,
-:root .fa-rotate-270,
-:root .fa-flip-horizontal,
-:root .fa-flip-vertical {
- filter: none;
-}
-.fa-stack {
- position: relative;
- display: inline-block;
- width: 2em;
- height: 2em;
- line-height: 2em;
- vertical-align: middle;
-}
-.fa-stack-1x,
-.fa-stack-2x {
- position: absolute;
- left: 0;
- width: 100%;
- text-align: center;
-}
-.fa-stack-1x {
- line-height: inherit;
-}
-.fa-stack-2x {
- font-size: 2em;
-}
-.fa-inverse {
- color: #ffffff;
-}
-/* Font Awesome uses the Unicode Private Use Area (PUA) to ensure screen
- readers do not read off random characters that represent icons */
-.fa-glass:before {
- content: "\f000";
-}
-.fa-music:before {
- content: "\f001";
-}
-.fa-search:before {
- content: "\f002";
-}
-.fa-envelope-o:before {
- content: "\f003";
-}
-.fa-heart:before {
- content: "\f004";
-}
-.fa-star:before {
- content: "\f005";
-}
-.fa-star-o:before {
- content: "\f006";
-}
-.fa-user:before {
- content: "\f007";
-}
-.fa-film:before {
- content: "\f008";
-}
-.fa-th-large:before {
- content: "\f009";
-}
-.fa-th:before {
- content: "\f00a";
-}
-.fa-th-list:before {
- content: "\f00b";
-}
-.fa-check:before {
- content: "\f00c";
-}
-.fa-remove:before,
-.fa-close:before,
-.fa-times:before {
- content: "\f00d";
-}
-.fa-search-plus:before {
- content: "\f00e";
-}
-.fa-search-minus:before {
- content: "\f010";
-}
-.fa-power-off:before {
- content: "\f011";
-}
-.fa-signal:before {
- content: "\f012";
-}
-.fa-gear:before,
-.fa-cog:before {
- content: "\f013";
-}
-.fa-trash-o:before {
- content: "\f014";
-}
-.fa-home:before {
- content: "\f015";
-}
-.fa-file-o:before {
- content: "\f016";
-}
-.fa-clock-o:before {
- content: "\f017";
-}
-.fa-road:before {
- content: "\f018";
-}
-.fa-download:before {
- content: "\f019";
-}
-.fa-arrow-circle-o-down:before {
- content: "\f01a";
-}
-.fa-arrow-circle-o-up:before {
- content: "\f01b";
-}
-.fa-inbox:before {
- content: "\f01c";
-}
-.fa-play-circle-o:before {
- content: "\f01d";
-}
-.fa-rotate-right:before,
-.fa-repeat:before {
- content: "\f01e";
-}
-.fa-refresh:before {
- content: "\f021";
-}
-.fa-list-alt:before {
- content: "\f022";
-}
-.fa-lock:before {
- content: "\f023";
-}
-.fa-flag:before {
- content: "\f024";
-}
-.fa-headphones:before {
- content: "\f025";
-}
-.fa-volume-off:before {
- content: "\f026";
-}
-.fa-volume-down:before {
- content: "\f027";
-}
-.fa-volume-up:before {
- content: "\f028";
-}
-.fa-qrcode:before {
- content: "\f029";
-}
-.fa-barcode:before {
- content: "\f02a";
-}
-.fa-tag:before {
- content: "\f02b";
-}
-.fa-tags:before {
- content: "\f02c";
-}
-.fa-book:before {
- content: "\f02d";
-}
-.fa-bookmark:before {
- content: "\f02e";
-}
-.fa-print:before {
- content: "\f02f";
-}
-.fa-camera:before {
- content: "\f030";
-}
-.fa-font:before {
- content: "\f031";
-}
-.fa-bold:before {
- content: "\f032";
-}
-.fa-italic:before {
- content: "\f033";
-}
-.fa-text-height:before {
- content: "\f034";
-}
-.fa-text-width:before {
- content: "\f035";
-}
-.fa-align-left:before {
- content: "\f036";
-}
-.fa-align-center:before {
- content: "\f037";
-}
-.fa-align-right:before {
- content: "\f038";
-}
-.fa-align-justify:before {
- content: "\f039";
-}
-.fa-list:before {
- content: "\f03a";
-}
-.fa-dedent:before,
-.fa-outdent:before {
- content: "\f03b";
-}
-.fa-indent:before {
- content: "\f03c";
-}
-.fa-video-camera:before {
- content: "\f03d";
-}
-.fa-photo:before,
-.fa-image:before,
-.fa-picture-o:before {
- content: "\f03e";
-}
-.fa-pencil:before {
- content: "\f040";
-}
-.fa-map-marker:before {
- content: "\f041";
-}
-.fa-adjust:before {
- content: "\f042";
-}
-.fa-tint:before {
- content: "\f043";
-}
-.fa-edit:before,
-.fa-pencil-square-o:before {
- content: "\f044";
-}
-.fa-share-square-o:before {
- content: "\f045";
-}
-.fa-check-square-o:before {
- content: "\f046";
-}
-.fa-arrows:before {
- content: "\f047";
-}
-.fa-step-backward:before {
- content: "\f048";
-}
-.fa-fast-backward:before {
- content: "\f049";
-}
-.fa-backward:before {
- content: "\f04a";
-}
-.fa-play:before {
- content: "\f04b";
-}
-.fa-pause:before {
- content: "\f04c";
-}
-.fa-stop:before {
- content: "\f04d";
-}
-.fa-forward:before {
- content: "\f04e";
-}
-.fa-fast-forward:before {
- content: "\f050";
-}
-.fa-step-forward:before {
- content: "\f051";
-}
-.fa-eject:before {
- content: "\f052";
-}
-.fa-chevron-left:before {
- content: "\f053";
-}
-.fa-chevron-right:before {
- content: "\f054";
-}
-.fa-plus-circle:before {
- content: "\f055";
-}
-.fa-minus-circle:before {
- content: "\f056";
-}
-.fa-times-circle:before {
- content: "\f057";
-}
-.fa-check-circle:before {
- content: "\f058";
-}
-.fa-question-circle:before {
- content: "\f059";
-}
-.fa-info-circle:before {
- content: "\f05a";
-}
-.fa-crosshairs:before {
- content: "\f05b";
-}
-.fa-times-circle-o:before {
- content: "\f05c";
-}
-.fa-check-circle-o:before {
- content: "\f05d";
-}
-.fa-ban:before {
- content: "\f05e";
-}
-.fa-arrow-left:before {
- content: "\f060";
-}
-.fa-arrow-right:before {
- content: "\f061";
-}
-.fa-arrow-up:before {
- content: "\f062";
-}
-.fa-arrow-down:before {
- content: "\f063";
-}
-.fa-mail-forward:before,
-.fa-share:before {
- content: "\f064";
-}
-.fa-expand:before {
- content: "\f065";
-}
-.fa-compress:before {
- content: "\f066";
-}
-.fa-plus:before {
- content: "\f067";
-}
-.fa-minus:before {
- content: "\f068";
-}
-.fa-asterisk:before {
- content: "\f069";
-}
-.fa-exclamation-circle:before {
- content: "\f06a";
-}
-.fa-gift:before {
- content: "\f06b";
-}
-.fa-leaf:before {
- content: "\f06c";
-}
-.fa-fire:before {
- content: "\f06d";
-}
-.fa-eye:before {
- content: "\f06e";
-}
-.fa-eye-slash:before {
- content: "\f070";
-}
-.fa-warning:before,
-.fa-exclamation-triangle:before {
- content: "\f071";
-}
-.fa-plane:before {
- content: "\f072";
-}
-.fa-calendar:before {
- content: "\f073";
-}
-.fa-random:before {
- content: "\f074";
-}
-.fa-comment:before {
- content: "\f075";
-}
-.fa-magnet:before {
- content: "\f076";
-}
-.fa-chevron-up:before {
- content: "\f077";
-}
-.fa-chevron-down:before {
- content: "\f078";
-}
-.fa-retweet:before {
- content: "\f079";
-}
-.fa-shopping-cart:before {
- content: "\f07a";
-}
-.fa-folder:before {
- content: "\f07b";
-}
-.fa-folder-open:before {
- content: "\f07c";
-}
-.fa-arrows-v:before {
- content: "\f07d";
-}
-.fa-arrows-h:before {
- content: "\f07e";
-}
-.fa-bar-chart-o:before,
-.fa-bar-chart:before {
- content: "\f080";
-}
-.fa-twitter-square:before {
- content: "\f081";
-}
-.fa-facebook-square:before {
- content: "\f082";
-}
-.fa-camera-retro:before {
- content: "\f083";
-}
-.fa-key:before {
- content: "\f084";
-}
-.fa-gears:before,
-.fa-cogs:before {
- content: "\f085";
-}
-.fa-comments:before {
- content: "\f086";
-}
-.fa-thumbs-o-up:before {
- content: "\f087";
-}
-.fa-thumbs-o-down:before {
- content: "\f088";
-}
-.fa-star-half:before {
- content: "\f089";
-}
-.fa-heart-o:before {
- content: "\f08a";
-}
-.fa-sign-out:before {
- content: "\f08b";
-}
-.fa-linkedin-square:before {
- content: "\f08c";
-}
-.fa-thumb-tack:before {
- content: "\f08d";
-}
-.fa-external-link:before {
- content: "\f08e";
-}
-.fa-sign-in:before {
- content: "\f090";
-}
-.fa-trophy:before {
- content: "\f091";
-}
-.fa-github-square:before {
- content: "\f092";
-}
-.fa-upload:before {
- content: "\f093";
-}
-.fa-lemon-o:before {
- content: "\f094";
-}
-.fa-phone:before {
- content: "\f095";
-}
-.fa-square-o:before {
- content: "\f096";
-}
-.fa-bookmark-o:before {
- content: "\f097";
-}
-.fa-phone-square:before {
- content: "\f098";
-}
-.fa-twitter:before {
- content: "\f099";
-}
-.fa-facebook:before {
- content: "\f09a";
-}
-.fa-github:before {
- content: "\f09b";
-}
-.fa-unlock:before {
- content: "\f09c";
-}
-.fa-credit-card:before {
- content: "\f09d";
-}
-.fa-rss:before {
- content: "\f09e";
-}
-.fa-hdd-o:before {
- content: "\f0a0";
-}
-.fa-bullhorn:before {
- content: "\f0a1";
-}
-.fa-bell:before {
- content: "\f0f3";
-}
-.fa-certificate:before {
- content: "\f0a3";
-}
-.fa-hand-o-right:before {
- content: "\f0a4";
-}
-.fa-hand-o-left:before {
- content: "\f0a5";
-}
-.fa-hand-o-up:before {
- content: "\f0a6";
-}
-.fa-hand-o-down:before {
- content: "\f0a7";
-}
-.fa-arrow-circle-left:before {
- content: "\f0a8";
-}
-.fa-arrow-circle-right:before {
- content: "\f0a9";
-}
-.fa-arrow-circle-up:before {
- content: "\f0aa";
-}
-.fa-arrow-circle-down:before {
- content: "\f0ab";
-}
-.fa-globe:before {
- content: "\f0ac";
-}
-.fa-wrench:before {
- content: "\f0ad";
-}
-.fa-tasks:before {
- content: "\f0ae";
-}
-.fa-filter:before {
- content: "\f0b0";
-}
-.fa-briefcase:before {
- content: "\f0b1";
-}
-.fa-arrows-alt:before {
- content: "\f0b2";
-}
-.fa-group:before,
-.fa-users:before {
- content: "\f0c0";
-}
-.fa-chain:before,
-.fa-link:before {
- content: "\f0c1";
-}
-.fa-cloud:before {
- content: "\f0c2";
-}
-.fa-flask:before {
- content: "\f0c3";
-}
-.fa-cut:before,
-.fa-scissors:before {
- content: "\f0c4";
-}
-.fa-copy:before,
-.fa-files-o:before {
- content: "\f0c5";
-}
-.fa-paperclip:before {
- content: "\f0c6";
-}
-.fa-save:before,
-.fa-floppy-o:before {
- content: "\f0c7";
-}
-.fa-square:before {
- content: "\f0c8";
-}
-.fa-navicon:before,
-.fa-reorder:before,
-.fa-bars:before {
- content: "\f0c9";
-}
-.fa-list-ul:before {
- content: "\f0ca";
-}
-.fa-list-ol:before {
- content: "\f0cb";
-}
-.fa-strikethrough:before {
- content: "\f0cc";
-}
-.fa-underline:before {
- content: "\f0cd";
-}
-.fa-table:before {
- content: "\f0ce";
-}
-.fa-magic:before {
- content: "\f0d0";
-}
-.fa-truck:before {
- content: "\f0d1";
-}
-.fa-pinterest:before {
- content: "\f0d2";
-}
-.fa-pinterest-square:before {
- content: "\f0d3";
-}
-.fa-google-plus-square:before {
- content: "\f0d4";
-}
-.fa-google-plus:before {
- content: "\f0d5";
-}
-.fa-money:before {
- content: "\f0d6";
-}
-.fa-caret-down:before {
- content: "\f0d7";
-}
-.fa-caret-up:before {
- content: "\f0d8";
-}
-.fa-caret-left:before {
- content: "\f0d9";
-}
-.fa-caret-right:before {
- content: "\f0da";
-}
-.fa-columns:before {
- content: "\f0db";
-}
-.fa-unsorted:before,
-.fa-sort:before {
- content: "\f0dc";
-}
-.fa-sort-down:before,
-.fa-sort-desc:before {
- content: "\f0dd";
-}
-.fa-sort-up:before,
-.fa-sort-asc:before {
- content: "\f0de";
-}
-.fa-envelope:before {
- content: "\f0e0";
-}
-.fa-linkedin:before {
- content: "\f0e1";
-}
-.fa-rotate-left:before,
-.fa-undo:before {
- content: "\f0e2";
-}
-.fa-legal:before,
-.fa-gavel:before {
- content: "\f0e3";
-}
-.fa-dashboard:before,
-.fa-tachometer:before {
- content: "\f0e4";
-}
-.fa-comment-o:before {
- content: "\f0e5";
-}
-.fa-comments-o:before {
- content: "\f0e6";
-}
-.fa-flash:before,
-.fa-bolt:before {
- content: "\f0e7";
-}
-.fa-sitemap:before {
- content: "\f0e8";
-}
-.fa-umbrella:before {
- content: "\f0e9";
-}
-.fa-paste:before,
-.fa-clipboard:before {
- content: "\f0ea";
-}
-.fa-lightbulb-o:before {
- content: "\f0eb";
-}
-.fa-exchange:before {
- content: "\f0ec";
-}
-.fa-cloud-download:before {
- content: "\f0ed";
-}
-.fa-cloud-upload:before {
- content: "\f0ee";
-}
-.fa-user-md:before {
- content: "\f0f0";
-}
-.fa-stethoscope:before {
- content: "\f0f1";
-}
-.fa-suitcase:before {
- content: "\f0f2";
-}
-.fa-bell-o:before {
- content: "\f0a2";
-}
-.fa-coffee:before {
- content: "\f0f4";
-}
-.fa-cutlery:before {
- content: "\f0f5";
-}
-.fa-file-text-o:before {
- content: "\f0f6";
-}
-.fa-building-o:before {
- content: "\f0f7";
-}
-.fa-hospital-o:before {
- content: "\f0f8";
-}
-.fa-ambulance:before {
- content: "\f0f9";
-}
-.fa-medkit:before {
- content: "\f0fa";
-}
-.fa-fighter-jet:before {
- content: "\f0fb";
-}
-.fa-beer:before {
- content: "\f0fc";
-}
-.fa-h-square:before {
- content: "\f0fd";
-}
-.fa-plus-square:before {
- content: "\f0fe";
-}
-.fa-angle-double-left:before {
- content: "\f100";
-}
-.fa-angle-double-right:before {
- content: "\f101";
-}
-.fa-angle-double-up:before {
- content: "\f102";
-}
-.fa-angle-double-down:before {
- content: "\f103";
-}
-.fa-angle-left:before {
- content: "\f104";
-}
-.fa-angle-right:before {
- content: "\f105";
-}
-.fa-angle-up:before {
- content: "\f106";
-}
-.fa-angle-down:before {
- content: "\f107";
-}
-.fa-desktop:before {
- content: "\f108";
-}
-.fa-laptop:before {
- content: "\f109";
-}
-.fa-tablet:before {
- content: "\f10a";
-}
-.fa-mobile-phone:before,
-.fa-mobile:before {
- content: "\f10b";
-}
-.fa-circle-o:before {
- content: "\f10c";
-}
-.fa-quote-left:before {
- content: "\f10d";
-}
-.fa-quote-right:before {
- content: "\f10e";
-}
-.fa-spinner:before {
- content: "\f110";
-}
-.fa-circle:before {
- content: "\f111";
-}
-.fa-mail-reply:before,
-.fa-reply:before {
- content: "\f112";
-}
-.fa-github-alt:before {
- content: "\f113";
-}
-.fa-folder-o:before {
- content: "\f114";
-}
-.fa-folder-open-o:before {
- content: "\f115";
-}
-.fa-smile-o:before {
- content: "\f118";
-}
-.fa-frown-o:before {
- content: "\f119";
-}
-.fa-meh-o:before {
- content: "\f11a";
-}
-.fa-gamepad:before {
- content: "\f11b";
-}
-.fa-keyboard-o:before {
- content: "\f11c";
-}
-.fa-flag-o:before {
- content: "\f11d";
-}
-.fa-flag-checkered:before {
- content: "\f11e";
-}
-.fa-terminal:before {
- content: "\f120";
-}
-.fa-code:before {
- content: "\f121";
-}
-.fa-mail-reply-all:before,
-.fa-reply-all:before {
- content: "\f122";
-}
-.fa-star-half-empty:before,
-.fa-star-half-full:before,
-.fa-star-half-o:before {
- content: "\f123";
-}
-.fa-location-arrow:before {
- content: "\f124";
-}
-.fa-crop:before {
- content: "\f125";
-}
-.fa-code-fork:before {
- content: "\f126";
-}
-.fa-unlink:before,
-.fa-chain-broken:before {
- content: "\f127";
-}
-.fa-question:before {
- content: "\f128";
-}
-.fa-info:before {
- content: "\f129";
-}
-.fa-exclamation:before {
- content: "\f12a";
-}
-.fa-superscript:before {
- content: "\f12b";
-}
-.fa-subscript:before {
- content: "\f12c";
-}
-.fa-eraser:before {
- content: "\f12d";
-}
-.fa-puzzle-piece:before {
- content: "\f12e";
-}
-.fa-microphone:before {
- content: "\f130";
-}
-.fa-microphone-slash:before {
- content: "\f131";
-}
-.fa-shield:before {
- content: "\f132";
-}
-.fa-calendar-o:before {
- content: "\f133";
-}
-.fa-fire-extinguisher:before {
- content: "\f134";
-}
-.fa-rocket:before {
- content: "\f135";
-}
-.fa-maxcdn:before {
- content: "\f136";
-}
-.fa-chevron-circle-left:before {
- content: "\f137";
-}
-.fa-chevron-circle-right:before {
- content: "\f138";
-}
-.fa-chevron-circle-up:before {
- content: "\f139";
-}
-.fa-chevron-circle-down:before {
- content: "\f13a";
-}
-.fa-html5:before {
- content: "\f13b";
-}
-.fa-css3:before {
- content: "\f13c";
-}
-.fa-anchor:before {
- content: "\f13d";
-}
-.fa-unlock-alt:before {
- content: "\f13e";
-}
-.fa-bullseye:before {
- content: "\f140";
-}
-.fa-ellipsis-h:before {
- content: "\f141";
-}
-.fa-ellipsis-v:before {
- content: "\f142";
-}
-.fa-rss-square:before {
- content: "\f143";
-}
-.fa-play-circle:before {
- content: "\f144";
-}
-.fa-ticket:before {
- content: "\f145";
-}
-.fa-minus-square:before {
- content: "\f146";
-}
-.fa-minus-square-o:before {
- content: "\f147";
-}
-.fa-level-up:before {
- content: "\f148";
-}
-.fa-level-down:before {
- content: "\f149";
-}
-.fa-check-square:before {
- content: "\f14a";
-}
-.fa-pencil-square:before {
- content: "\f14b";
-}
-.fa-external-link-square:before {
- content: "\f14c";
-}
-.fa-share-square:before {
- content: "\f14d";
-}
-.fa-compass:before {
- content: "\f14e";
-}
-.fa-toggle-down:before,
-.fa-caret-square-o-down:before {
- content: "\f150";
-}
-.fa-toggle-up:before,
-.fa-caret-square-o-up:before {
- content: "\f151";
-}
-.fa-toggle-right:before,
-.fa-caret-square-o-right:before {
- content: "\f152";
-}
-.fa-euro:before,
-.fa-eur:before {
- content: "\f153";
-}
-.fa-gbp:before {
- content: "\f154";
-}
-.fa-dollar:before,
-.fa-usd:before {
- content: "\f155";
-}
-.fa-rupee:before,
-.fa-inr:before {
- content: "\f156";
-}
-.fa-cny:before,
-.fa-rmb:before,
-.fa-yen:before,
-.fa-jpy:before {
- content: "\f157";
-}
-.fa-ruble:before,
-.fa-rouble:before,
-.fa-rub:before {
- content: "\f158";
-}
-.fa-won:before,
-.fa-krw:before {
- content: "\f159";
-}
-.fa-bitcoin:before,
-.fa-btc:before {
- content: "\f15a";
-}
-.fa-file:before {
- content: "\f15b";
-}
-.fa-file-text:before {
- content: "\f15c";
-}
-.fa-sort-alpha-asc:before {
- content: "\f15d";
-}
-.fa-sort-alpha-desc:before {
- content: "\f15e";
-}
-.fa-sort-amount-asc:before {
- content: "\f160";
-}
-.fa-sort-amount-desc:before {
- content: "\f161";
-}
-.fa-sort-numeric-asc:before {
- content: "\f162";
-}
-.fa-sort-numeric-desc:before {
- content: "\f163";
-}
-.fa-thumbs-up:before {
- content: "\f164";
-}
-.fa-thumbs-down:before {
- content: "\f165";
-}
-.fa-youtube-square:before {
- content: "\f166";
-}
-.fa-youtube:before {
- content: "\f167";
-}
-.fa-xing:before {
- content: "\f168";
-}
-.fa-xing-square:before {
- content: "\f169";
-}
-.fa-youtube-play:before {
- content: "\f16a";
-}
-.fa-dropbox:before {
- content: "\f16b";
-}
-.fa-stack-overflow:before {
- content: "\f16c";
-}
-.fa-instagram:before {
- content: "\f16d";
-}
-.fa-flickr:before {
- content: "\f16e";
-}
-.fa-adn:before {
- content: "\f170";
-}
-.fa-bitbucket:before {
- content: "\f171";
-}
-.fa-bitbucket-square:before {
- content: "\f172";
-}
-.fa-tumblr:before {
- content: "\f173";
-}
-.fa-tumblr-square:before {
- content: "\f174";
-}
-.fa-long-arrow-down:before {
- content: "\f175";
-}
-.fa-long-arrow-up:before {
- content: "\f176";
-}
-.fa-long-arrow-left:before {
- content: "\f177";
-}
-.fa-long-arrow-right:before {
- content: "\f178";
-}
-.fa-apple:before {
- content: "\f179";
-}
-.fa-windows:before {
- content: "\f17a";
-}
-.fa-android:before {
- content: "\f17b";
-}
-.fa-linux:before {
- content: "\f17c";
-}
-.fa-dribbble:before {
- content: "\f17d";
-}
-.fa-skype:before {
- content: "\f17e";
-}
-.fa-foursquare:before {
- content: "\f180";
-}
-.fa-trello:before {
- content: "\f181";
-}
-.fa-female:before {
- content: "\f182";
-}
-.fa-male:before {
- content: "\f183";
-}
-.fa-gittip:before {
- content: "\f184";
-}
-.fa-sun-o:before {
- content: "\f185";
-}
-.fa-moon-o:before {
- content: "\f186";
-}
-.fa-archive:before {
- content: "\f187";
-}
-.fa-bug:before {
- content: "\f188";
-}
-.fa-vk:before {
- content: "\f189";
-}
-.fa-weibo:before {
- content: "\f18a";
-}
-.fa-renren:before {
- content: "\f18b";
-}
-.fa-pagelines:before {
- content: "\f18c";
-}
-.fa-stack-exchange:before {
- content: "\f18d";
-}
-.fa-arrow-circle-o-right:before {
- content: "\f18e";
-}
-.fa-arrow-circle-o-left:before {
- content: "\f190";
-}
-.fa-toggle-left:before,
-.fa-caret-square-o-left:before {
- content: "\f191";
-}
-.fa-dot-circle-o:before {
- content: "\f192";
-}
-.fa-wheelchair:before {
- content: "\f193";
-}
-.fa-vimeo-square:before {
- content: "\f194";
-}
-.fa-turkish-lira:before,
-.fa-try:before {
- content: "\f195";
-}
-.fa-plus-square-o:before {
- content: "\f196";
-}
-.fa-space-shuttle:before {
- content: "\f197";
-}
-.fa-slack:before {
- content: "\f198";
-}
-.fa-envelope-square:before {
- content: "\f199";
-}
-.fa-wordpress:before {
- content: "\f19a";
-}
-.fa-openid:before {
- content: "\f19b";
-}
-.fa-institution:before,
-.fa-bank:before,
-.fa-university:before {
- content: "\f19c";
-}
-.fa-mortar-board:before,
-.fa-graduation-cap:before {
- content: "\f19d";
-}
-.fa-yahoo:before {
- content: "\f19e";
-}
-.fa-google:before {
- content: "\f1a0";
-}
-.fa-reddit:before {
- content: "\f1a1";
-}
-.fa-reddit-square:before {
- content: "\f1a2";
-}
-.fa-stumbleupon-circle:before {
- content: "\f1a3";
-}
-.fa-stumbleupon:before {
- content: "\f1a4";
-}
-.fa-delicious:before {
- content: "\f1a5";
-}
-.fa-digg:before {
- content: "\f1a6";
-}
-.fa-pied-piper:before {
- content: "\f1a7";
-}
-.fa-pied-piper-alt:before {
- content: "\f1a8";
-}
-.fa-drupal:before {
- content: "\f1a9";
-}
-.fa-joomla:before {
- content: "\f1aa";
-}
-.fa-language:before {
- content: "\f1ab";
-}
-.fa-fax:before {
- content: "\f1ac";
-}
-.fa-building:before {
- content: "\f1ad";
-}
-.fa-child:before {
- content: "\f1ae";
-}
-.fa-paw:before {
- content: "\f1b0";
-}
-.fa-spoon:before {
- content: "\f1b1";
-}
-.fa-cube:before {
- content: "\f1b2";
-}
-.fa-cubes:before {
- content: "\f1b3";
-}
-.fa-behance:before {
- content: "\f1b4";
-}
-.fa-behance-square:before {
- content: "\f1b5";
-}
-.fa-steam:before {
- content: "\f1b6";
-}
-.fa-steam-square:before {
- content: "\f1b7";
-}
-.fa-recycle:before {
- content: "\f1b8";
-}
-.fa-automobile:before,
-.fa-car:before {
- content: "\f1b9";
-}
-.fa-cab:before,
-.fa-taxi:before {
- content: "\f1ba";
-}
-.fa-tree:before {
- content: "\f1bb";
-}
-.fa-spotify:before {
- content: "\f1bc";
-}
-.fa-deviantart:before {
- content: "\f1bd";
-}
-.fa-soundcloud:before {
- content: "\f1be";
-}
-.fa-database:before {
- content: "\f1c0";
-}
-.fa-file-pdf-o:before {
- content: "\f1c1";
-}
-.fa-file-word-o:before {
- content: "\f1c2";
-}
-.fa-file-excel-o:before {
- content: "\f1c3";
-}
-.fa-file-powerpoint-o:before {
- content: "\f1c4";
-}
-.fa-file-photo-o:before,
-.fa-file-picture-o:before,
-.fa-file-image-o:before {
- content: "\f1c5";
-}
-.fa-file-zip-o:before,
-.fa-file-archive-o:before {
- content: "\f1c6";
-}
-.fa-file-sound-o:before,
-.fa-file-audio-o:before {
- content: "\f1c7";
-}
-.fa-file-movie-o:before,
-.fa-file-video-o:before {
- content: "\f1c8";
-}
-.fa-file-code-o:before {
- content: "\f1c9";
-}
-.fa-vine:before {
- content: "\f1ca";
-}
-.fa-codepen:before {
- content: "\f1cb";
-}
-.fa-jsfiddle:before {
- content: "\f1cc";
-}
-.fa-life-bouy:before,
-.fa-life-buoy:before,
-.fa-life-saver:before,
-.fa-support:before,
-.fa-life-ring:before {
- content: "\f1cd";
-}
-.fa-circle-o-notch:before {
- content: "\f1ce";
-}
-.fa-ra:before,
-.fa-rebel:before {
- content: "\f1d0";
-}
-.fa-ge:before,
-.fa-empire:before {
- content: "\f1d1";
-}
-.fa-git-square:before {
- content: "\f1d2";
-}
-.fa-git:before {
- content: "\f1d3";
-}
-.fa-hacker-news:before {
- content: "\f1d4";
-}
-.fa-tencent-weibo:before {
- content: "\f1d5";
-}
-.fa-qq:before {
- content: "\f1d6";
-}
-.fa-wechat:before,
-.fa-weixin:before {
- content: "\f1d7";
-}
-.fa-send:before,
-.fa-paper-plane:before {
- content: "\f1d8";
-}
-.fa-send-o:before,
-.fa-paper-plane-o:before {
- content: "\f1d9";
-}
-.fa-history:before {
- content: "\f1da";
-}
-.fa-circle-thin:before {
- content: "\f1db";
-}
-.fa-header:before {
- content: "\f1dc";
-}
-.fa-paragraph:before {
- content: "\f1dd";
-}
-.fa-sliders:before {
- content: "\f1de";
-}
-.fa-share-alt:before {
- content: "\f1e0";
-}
-.fa-share-alt-square:before {
- content: "\f1e1";
-}
-.fa-bomb:before {
- content: "\f1e2";
-}
-.fa-soccer-ball-o:before,
-.fa-futbol-o:before {
- content: "\f1e3";
-}
-.fa-tty:before {
- content: "\f1e4";
-}
-.fa-binoculars:before {
- content: "\f1e5";
-}
-.fa-plug:before {
- content: "\f1e6";
-}
-.fa-slideshare:before {
- content: "\f1e7";
-}
-.fa-twitch:before {
- content: "\f1e8";
-}
-.fa-yelp:before {
- content: "\f1e9";
-}
-.fa-newspaper-o:before {
- content: "\f1ea";
-}
-.fa-wifi:before {
- content: "\f1eb";
-}
-.fa-calculator:before {
- content: "\f1ec";
-}
-.fa-paypal:before {
- content: "\f1ed";
-}
-.fa-google-wallet:before {
- content: "\f1ee";
-}
-.fa-cc-visa:before {
- content: "\f1f0";
-}
-.fa-cc-mastercard:before {
- content: "\f1f1";
-}
-.fa-cc-discover:before {
- content: "\f1f2";
-}
-.fa-cc-amex:before {
- content: "\f1f3";
-}
-.fa-cc-paypal:before {
- content: "\f1f4";
-}
-.fa-cc-stripe:before {
- content: "\f1f5";
-}
-.fa-bell-slash:before {
- content: "\f1f6";
-}
-.fa-bell-slash-o:before {
- content: "\f1f7";
-}
-.fa-trash:before {
- content: "\f1f8";
-}
-.fa-copyright:before {
- content: "\f1f9";
-}
-.fa-at:before {
- content: "\f1fa";
-}
-.fa-eyedropper:before {
- content: "\f1fb";
-}
-.fa-paint-brush:before {
- content: "\f1fc";
-}
-.fa-birthday-cake:before {
- content: "\f1fd";
-}
-.fa-area-chart:before {
- content: "\f1fe";
-}
-.fa-pie-chart:before {
- content: "\f200";
-}
-.fa-line-chart:before {
- content: "\f201";
-}
-.fa-lastfm:before {
- content: "\f202";
-}
-.fa-lastfm-square:before {
- content: "\f203";
-}
-.fa-toggle-off:before {
- content: "\f204";
-}
-.fa-toggle-on:before {
- content: "\f205";
-}
-.fa-bicycle:before {
- content: "\f206";
-}
-.fa-bus:before {
- content: "\f207";
-}
-.fa-ioxhost:before {
- content: "\f208";
-}
-.fa-angellist:before {
- content: "\f209";
-}
-.fa-cc:before {
- content: "\f20a";
-}
-.fa-shekel:before,
-.fa-sheqel:before,
-.fa-ils:before {
- content: "\f20b";
-}
-.fa-meanpath:before {
- content: "\f20c";
-}
-
+ */@font-face{font-family:FontAwesome;src:url(fonts/fontawesome-webfont.eot?v=4.2.0);src:url(fonts/fontawesome-webfont.eot?#iefix&v=4.2.0) format('embedded-opentype'),url(fonts/fontawesome-webfont.woff?v=4.2.0) format('woff'),url(fonts/fontawesome-webfont.ttf?v=4.2.0) format('truetype'),url(fonts/fontawesome-webfont.svg?v=4.2.0#fontawesomeregular) format('svg');font-weight:400;font-style:normal}.fa{display:inline-block;font:normal normal normal 14px/1 FontAwesome;font-size:inherit;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.fa-lg{font-size:1.3333333333333333em;line-height:.75em;vertical-align:-15%}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-fw{width:1.2857142857142858em;text-align:center}.fa-ul{padding-left:0;margin-left:2.142857142857143em;list-style-type:none}.fa-ul>li{position:relative}.fa-li{position:absolute;left:-2.14285714em;width:2.142857142857143em;top:.14285714285714285em;text-align:center}.fa-li.fa-lg{left:-1.85714286em}.fa-border{padding:.2em .25em .15em;border:solid .08em #eee;border-radius:.1em}.pull-right{float:right}.pull-left{float:left}.fa.pull-left{margin-right:.3em}.fa.pull-right{margin-left:.3em}.fa-spin{-webkit-animation:fa-spin 2s infinite linear;animation:fa-spin 2s infinite linear}@-webkit-keyframes fa-spin{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes fa-spin{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.fa-rotate-90{-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}.fa-rotate-180{-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}.fa-rotate-270{-webkit-transform:rotate(270deg);-ms-transform:rotate(270deg);transform:rotate(270deg)}.fa-flip-horizontal{-webkit-transform:scale(-1,1);-ms-transform:scale(-1,1);transform:scale(-1,1)}.fa-flip-vertical{-webkit-transform:scale(1,-1);-ms-transform:scale(1,-1);transform:scale(1,-1)}:root .fa-flip-horizontal,:root .fa-flip-vertical,:root .fa-rotate-180,:root .fa-rotate-270,:root .fa-rotate-90{filter:none}.fa-stack{position:relative;display:inline-block;width:2em;height:2em;line-height:2em;vertical-align:middle}.fa-stack-1x,.fa-stack-2x{position:absolute;left:0;width:100%;text-align:center}.fa-stack-1x{line-height:inherit}.fa-stack-2x{font-size:2em}.fa-inverse{color:#fff}.fa-glass:before{content:"\f000"}.fa-music:before{content:"\f001"}.fa-search:before{content:"\f002"}.fa-envelope-o:before{content:"\f003"}.fa-heart:before{content:"\f004"}.fa-star:before{content:"\f005"}.fa-star-o:before{content:"\f006"}.fa-user:before{content:"\f007"}.fa-film:before{content:"\f008"}.fa-th-large:before{content:"\f009"}.fa-th:before{content:"\f00a"}.fa-th-list:before{content:"\f00b"}.fa-check:before{content:"\f00c"}.fa-close:before,.fa-remove:before,.fa-times:before{content:"\f00d"}.fa-search-plus:before{content:"\f00e"}.fa-search-minus:before{content:"\f010"}.fa-power-off:before{content:"\f011"}.fa-signal:before{content:"\f012"}.fa-cog:before,.fa-gear:before{content:"\f013"}.fa-trash-o:before{content:"\f014"}.fa-home:before{content:"\f015"}.fa-file-o:before{content:"\f016"}.fa-clock-o:before{content:"\f017"}.fa-road:before{content:"\f018"}.fa-download:before{content:"\f019"}.fa-arrow-circle-o-down:before{content:"\f01a"}.fa-arrow-circle-o-up:before{content:"\f01b"}.fa-inbox:before{content:"\f01c"}.fa-play-circle-o:before{content:"\f01d"}.fa-repeat:before,.fa-rotate-right:before{content:"\f01e"}.fa-refresh:before{content:"\f021"}.fa-list-alt:before{content:"\f022"}.fa-lock:before{content:"\f023"}.fa-flag:before{content:"\f024"}.fa-headphones:before{content:"\f025"}.fa-volume-off:before{content:"\f026"}.fa-volume-down:before{content:"\f027"}.fa-volume-up:before{content:"\f028"}.fa-qrcode:before{content:"\f029"}.fa-barcode:before{content:"\f02a"}.fa-tag:before{content:"\f02b"}.fa-tags:before{content:"\f02c"}.fa-book:before{content:"\f02d"}.fa-bookmark:before{content:"\f02e"}.fa-print:before{content:"\f02f"}.fa-camera:before{content:"\f030"}.fa-font:before{content:"\f031"}.fa-bold:before{content:"\f032"}.fa-italic:before{content:"\f033"}.fa-text-height:before{content:"\f034"}.fa-text-width:before{content:"\f035"}.fa-align-left:before{content:"\f036"}.fa-align-center:before{content:"\f037"}.fa-align-right:before{content:"\f038"}.fa-align-justify:before{content:"\f039"}.fa-list:before{content:"\f03a"}.fa-dedent:before,.fa-outdent:before{content:"\f03b"}.fa-indent:before{content:"\f03c"}.fa-video-camera:before{content:"\f03d"}.fa-image:before,.fa-photo:before,.fa-picture-o:before{content:"\f03e"}.fa-pencil:before{content:"\f040"}.fa-map-marker:before{content:"\f041"}.fa-adjust:before{content:"\f042"}.fa-tint:before{content:"\f043"}.fa-edit:before,.fa-pencil-square-o:before{content:"\f044"}.fa-share-square-o:before{content:"\f045"}.fa-check-square-o:before{content:"\f046"}.fa-arrows:before{content:"\f047"}.fa-step-backward:before{content:"\f048"}.fa-fast-backward:before{content:"\f049"}.fa-backward:before{content:"\f04a"}.fa-play:before{content:"\f04b"}.fa-pause:before{content:"\f04c"}.fa-stop:before{content:"\f04d"}.fa-forward:before{content:"\f04e"}.fa-fast-forward:before{content:"\f050"}.fa-step-forward:before{content:"\f051"}.fa-eject:before{content:"\f052"}.fa-chevron-left:before{content:"\f053"}.fa-chevron-right:before{content:"\f054"}.fa-plus-circle:before{content:"\f055"}.fa-minus-circle:before{content:"\f056"}.fa-times-circle:before{content:"\f057"}.fa-check-circle:before{content:"\f058"}.fa-question-circle:before{content:"\f059"}.fa-info-circle:before{content:"\f05a"}.fa-crosshairs:before{content:"\f05b"}.fa-times-circle-o:before{content:"\f05c"}.fa-check-circle-o:before{content:"\f05d"}.fa-ban:before{content:"\f05e"}.fa-arrow-left:before{content:"\f060"}.fa-arrow-right:before{content:"\f061"}.fa-arrow-up:before{content:"\f062"}.fa-arrow-down:before{content:"\f063"}.fa-mail-forward:before,.fa-share:before{content:"\f064"}.fa-expand:before{content:"\f065"}.fa-compress:before{content:"\f066"}.fa-plus:before{content:"\f067"}.fa-minus:before{content:"\f068"}.fa-asterisk:before{content:"\f069"}.fa-exclamation-circle:before{content:"\f06a"}.fa-gift:before{content:"\f06b"}.fa-leaf:before{content:"\f06c"}.fa-fire:before{content:"\f06d"}.fa-eye:before{content:"\f06e"}.fa-eye-slash:before{content:"\f070"}.fa-exclamation-triangle:before,.fa-warning:before{content:"\f071"}.fa-plane:before{content:"\f072"}.fa-calendar:before{content:"\f073"}.fa-random:before{content:"\f074"}.fa-comment:before{content:"\f075"}.fa-magnet:before{content:"\f076"}.fa-chevron-up:before{content:"\f077"}.fa-chevron-down:before{content:"\f078"}.fa-retweet:before{content:"\f079"}.fa-shopping-cart:before{content:"\f07a"}.fa-folder:before{content:"\f07b"}.fa-folder-open:before{content:"\f07c"}.fa-arrows-v:before{content:"\f07d"}.fa-arrows-h:before{content:"\f07e"}.fa-bar-chart-o:before,.fa-bar-chart:before{content:"\f080"}.fa-twitter-square:before{content:"\f081"}.fa-facebook-square:before{content:"\f082"}.fa-camera-retro:before{content:"\f083"}.fa-key:before{content:"\f084"}.fa-cogs:before,.fa-gears:before{content:"\f085"}.fa-comments:before{content:"\f086"}.fa-thumbs-o-up:before{content:"\f087"}.fa-thumbs-o-down:before{content:"\f088"}.fa-star-half:before{content:"\f089"}.fa-heart-o:before{content:"\f08a"}.fa-sign-out:before{content:"\f08b"}.fa-linkedin-square:before{content:"\f08c"}.fa-thumb-tack:before{content:"\f08d"}.fa-external-link:before{content:"\f08e"}.fa-sign-in:before{content:"\f090"}.fa-trophy:before{content:"\f091"}.fa-github-square:before{content:"\f092"}.fa-upload:before{content:"\f093"}.fa-lemon-o:before{content:"\f094"}.fa-phone:before{content:"\f095"}.fa-square-o:before{content:"\f096"}.fa-bookmark-o:before{content:"\f097"}.fa-phone-square:before{content:"\f098"}.fa-twitter:before{content:"\f099"}.fa-facebook:before{content:"\f09a"}.fa-github:before{content:"\f09b"}.fa-unlock:before{content:"\f09c"}.fa-credit-card:before{content:"\f09d"}.fa-rss:before{content:"\f09e"}.fa-hdd-o:before{content:"\f0a0"}.fa-bullhorn:before{content:"\f0a1"}.fa-bell:before{content:"\f0f3"}.fa-certificate:before{content:"\f0a3"}.fa-hand-o-right:before{content:"\f0a4"}.fa-hand-o-left:before{content:"\f0a5"}.fa-hand-o-up:before{content:"\f0a6"}.fa-hand-o-down:before{content:"\f0a7"}.fa-arrow-circle-left:before{content:"\f0a8"}.fa-arrow-circle-right:before{content:"\f0a9"}.fa-arrow-circle-up:before{content:"\f0aa"}.fa-arrow-circle-down:before{content:"\f0ab"}.fa-globe:before{content:"\f0ac"}.fa-wrench:before{content:"\f0ad"}.fa-tasks:before{content:"\f0ae"}.fa-filter:before{content:"\f0b0"}.fa-briefcase:before{content:"\f0b1"}.fa-arrows-alt:before{content:"\f0b2"}.fa-group:before,.fa-users:before{content:"\f0c0"}.fa-chain:before,.fa-link:before{content:"\f0c1"}.fa-cloud:before{content:"\f0c2"}.fa-flask:before{content:"\f0c3"}.fa-cut:before,.fa-scissors:before{content:"\f0c4"}.fa-copy:before,.fa-files-o:before{content:"\f0c5"}.fa-paperclip:before{content:"\f0c6"}.fa-floppy-o:before,.fa-save:before{content:"\f0c7"}.fa-square:before{content:"\f0c8"}.fa-bars:before,.fa-navicon:before,.fa-reorder:before{content:"\f0c9"}.fa-list-ul:before{content:"\f0ca"}.fa-list-ol:before{content:"\f0cb"}.fa-strikethrough:before{content:"\f0cc"}.fa-underline:before{content:"\f0cd"}.fa-table:before{content:"\f0ce"}.fa-magic:before{content:"\f0d0"}.fa-truck:before{content:"\f0d1"}.fa-pinterest:before{content:"\f0d2"}.fa-pinterest-square:before{content:"\f0d3"}.fa-google-plus-square:before{content:"\f0d4"}.fa-google-plus:before{content:"\f0d5"}.fa-money:before{content:"\f0d6"}.fa-caret-down:before{content:"\f0d7"}.fa-caret-up:before{content:"\f0d8"}.fa-caret-left:before{content:"\f0d9"}.fa-caret-right:before{content:"\f0da"}.fa-columns:before{content:"\f0db"}.fa-sort:before,.fa-unsorted:before{content:"\f0dc"}.fa-sort-desc:before,.fa-sort-down:before{content:"\f0dd"}.fa-sort-asc:before,.fa-sort-up:before{content:"\f0de"}.fa-envelope:before{content:"\f0e0"}.fa-linkedin:before{content:"\f0e1"}.fa-rotate-left:before,.fa-undo:before{content:"\f0e2"}.fa-gavel:before,.fa-legal:before{content:"\f0e3"}.fa-dashboard:before,.fa-tachometer:before{content:"\f0e4"}.fa-comment-o:before{content:"\f0e5"}.fa-comments-o:before{content:"\f0e6"}.fa-bolt:before,.fa-flash:before{content:"\f0e7"}.fa-sitemap:before{content:"\f0e8"}.fa-umbrella:before{content:"\f0e9"}.fa-clipboard:before,.fa-paste:before{content:"\f0ea"}.fa-lightbulb-o:before{content:"\f0eb"}.fa-exchange:before{content:"\f0ec"}.fa-cloud-download:before{content:"\f0ed"}.fa-cloud-upload:before{content:"\f0ee"}.fa-user-md:before{content:"\f0f0"}.fa-stethoscope:before{content:"\f0f1"}.fa-suitcase:before{content:"\f0f2"}.fa-bell-o:before{content:"\f0a2"}.fa-coffee:before{content:"\f0f4"}.fa-cutlery:before{content:"\f0f5"}.fa-file-text-o:before{content:"\f0f6"}.fa-building-o:before{content:"\f0f7"}.fa-hospital-o:before{content:"\f0f8"}.fa-ambulance:before{content:"\f0f9"}.fa-medkit:before{content:"\f0fa"}.fa-fighter-jet:before{content:"\f0fb"}.fa-beer:before{content:"\f0fc"}.fa-h-square:before{content:"\f0fd"}.fa-plus-square:before{content:"\f0fe"}.fa-angle-double-left:before{content:"\f100"}.fa-angle-double-right:before{content:"\f101"}.fa-angle-double-up:before{content:"\f102"}.fa-angle-double-down:before{content:"\f103"}.fa-angle-left:before{content:"\f104"}.fa-angle-right:before{content:"\f105"}.fa-angle-up:before{content:"\f106"}.fa-angle-down:before{content:"\f107"}.fa-desktop:before{content:"\f108"}.fa-laptop:before{content:"\f109"}.fa-tablet:before{content:"\f10a"}.fa-mobile-phone:before,.fa-mobile:before{content:"\f10b"}.fa-circle-o:before{content:"\f10c"}.fa-quote-left:before{content:"\f10d"}.fa-quote-right:before{content:"\f10e"}.fa-spinner:before{content:"\f110"}.fa-circle:before{content:"\f111"}.fa-mail-reply:before,.fa-reply:before{content:"\f112"}.fa-github-alt:before{content:"\f113"}.fa-folder-o:before{content:"\f114"}.fa-folder-open-o:before{content:"\f115"}.fa-smile-o:before{content:"\f118"}.fa-frown-o:before{content:"\f119"}.fa-meh-o:before{content:"\f11a"}.fa-gamepad:before{content:"\f11b"}.fa-keyboard-o:before{content:"\f11c"}.fa-flag-o:before{content:"\f11d"}.fa-flag-checkered:before{content:"\f11e"}.fa-terminal:before{content:"\f120"}.fa-code:before{content:"\f121"}.fa-mail-reply-all:before,.fa-reply-all:before{content:"\f122"}.fa-star-half-empty:before,.fa-star-half-full:before,.fa-star-half-o:before{content:"\f123"}.fa-location-arrow:before{content:"\f124"}.fa-crop:before{content:"\f125"}.fa-code-fork:before{content:"\f126"}.fa-chain-broken:before,.fa-unlink:before{content:"\f127"}.fa-question:before{content:"\f128"}.fa-info:before{content:"\f129"}.fa-exclamation:before{content:"\f12a"}.fa-superscript:before{content:"\f12b"}.fa-subscript:before{content:"\f12c"}.fa-eraser:before{content:"\f12d"}.fa-puzzle-piece:before{content:"\f12e"}.fa-microphone:before{content:"\f130"}.fa-microphone-slash:before{content:"\f131"}.fa-shield:before{content:"\f132"}.fa-calendar-o:before{content:"\f133"}.fa-fire-extinguisher:before{content:"\f134"}.fa-rocket:before{content:"\f135"}.fa-maxcdn:before{content:"\f136"}.fa-chevron-circle-left:before{content:"\f137"}.fa-chevron-circle-right:before{content:"\f138"}.fa-chevron-circle-up:before{content:"\f139"}.fa-chevron-circle-down:before{content:"\f13a"}.fa-html5:before{content:"\f13b"}.fa-css3:before{content:"\f13c"}.fa-anchor:before{content:"\f13d"}.fa-unlock-alt:before{content:"\f13e"}.fa-bullseye:before{content:"\f140"}.fa-ellipsis-h:before{content:"\f141"}.fa-ellipsis-v:before{content:"\f142"}.fa-rss-square:before{content:"\f143"}.fa-play-circle:before{content:"\f144"}.fa-ticket:before{content:"\f145"}.fa-minus-square:before{content:"\f146"}.fa-minus-square-o:before{content:"\f147"}.fa-level-up:before{content:"\f148"}.fa-level-down:before{content:"\f149"}.fa-check-square:before{content:"\f14a"}.fa-pencil-square:before{content:"\f14b"}.fa-external-link-square:before{content:"\f14c"}.fa-share-square:before{content:"\f14d"}.fa-compass:before{content:"\f14e"}.fa-caret-square-o-down:before,.fa-toggle-down:before{content:"\f150"}.fa-caret-square-o-up:before,.fa-toggle-up:before{content:"\f151"}.fa-caret-square-o-right:before,.fa-toggle-right:before{content:"\f152"}.fa-eur:before,.fa-euro:before{content:"\f153"}.fa-gbp:before{content:"\f154"}.fa-dollar:before,.fa-usd:before{content:"\f155"}.fa-inr:before,.fa-rupee:before{content:"\f156"}.fa-cny:before,.fa-jpy:before,.fa-rmb:before,.fa-yen:before{content:"\f157"}.fa-rouble:before,.fa-rub:before,.fa-ruble:before{content:"\f158"}.fa-krw:before,.fa-won:before{content:"\f159"}.fa-bitcoin:before,.fa-btc:before{content:"\f15a"}.fa-file:before{content:"\f15b"}.fa-file-text:before{content:"\f15c"}.fa-sort-alpha-asc:before{content:"\f15d"}.fa-sort-alpha-desc:before{content:"\f15e"}.fa-sort-amount-asc:before{content:"\f160"}.fa-sort-amount-desc:before{content:"\f161"}.fa-sort-numeric-asc:before{content:"\f162"}.fa-sort-numeric-desc:before{content:"\f163"}.fa-thumbs-up:before{content:"\f164"}.fa-thumbs-down:before{content:"\f165"}.fa-youtube-square:before{content:"\f166"}.fa-youtube:before{content:"\f167"}.fa-xing:before{content:"\f168"}.fa-xing-square:before{content:"\f169"}.fa-youtube-play:before{content:"\f16a"}.fa-dropbox:before{content:"\f16b"}.fa-stack-overflow:before{content:"\f16c"}.fa-instagram:before{content:"\f16d"}.fa-flickr:before{content:"\f16e"}.fa-adn:before{content:"\f170"}.fa-bitbucket:before{content:"\f171"}.fa-bitbucket-square:before{content:"\f172"}.fa-tumblr:before{content:"\f173"}.fa-tumblr-square:before{content:"\f174"}.fa-long-arrow-down:before{content:"\f175"}.fa-long-arrow-up:before{content:"\f176"}.fa-long-arrow-left:before{content:"\f177"}.fa-long-arrow-right:before{content:"\f178"}.fa-apple:before{content:"\f179"}.fa-windows:before{content:"\f17a"}.fa-android:before{content:"\f17b"}.fa-linux:before{content:"\f17c"}.fa-dribbble:before{content:"\f17d"}.fa-skype:before{content:"\f17e"}.fa-foursquare:before{content:"\f180"}.fa-trello:before{content:"\f181"}.fa-female:before{content:"\f182"}.fa-male:before{content:"\f183"}.fa-gittip:before{content:"\f184"}.fa-sun-o:before{content:"\f185"}.fa-moon-o:before{content:"\f186"}.fa-archive:before{content:"\f187"}.fa-bug:before{content:"\f188"}.fa-vk:before{content:"\f189"}.fa-weibo:before{content:"\f18a"}.fa-renren:before{content:"\f18b"}.fa-pagelines:before{content:"\f18c"}.fa-stack-exchange:before{content:"\f18d"}.fa-arrow-circle-o-right:before{content:"\f18e"}.fa-arrow-circle-o-left:before{content:"\f190"}.fa-caret-square-o-left:before,.fa-toggle-left:before{content:"\f191"}.fa-dot-circle-o:before{content:"\f192"}.fa-wheelchair:before{content:"\f193"}.fa-vimeo-square:before{content:"\f194"}.fa-try:before,.fa-turkish-lira:before{content:"\f195"}.fa-plus-square-o:before{content:"\f196"}.fa-space-shuttle:before{content:"\f197"}.fa-slack:before{content:"\f198"}.fa-envelope-square:before{content:"\f199"}.fa-wordpress:before{content:"\f19a"}.fa-openid:before{content:"\f19b"}.fa-bank:before,.fa-institution:before,.fa-university:before{content:"\f19c"}.fa-graduation-cap:before,.fa-mortar-board:before{content:"\f19d"}.fa-yahoo:before{content:"\f19e"}.fa-google:before{content:"\f1a0"}.fa-reddit:before{content:"\f1a1"}.fa-reddit-square:before{content:"\f1a2"}.fa-stumbleupon-circle:before{content:"\f1a3"}.fa-stumbleupon:before{content:"\f1a4"}.fa-delicious:before{content:"\f1a5"}.fa-digg:before{content:"\f1a6"}.fa-pied-piper:before{content:"\f1a7"}.fa-pied-piper-alt:before{content:"\f1a8"}.fa-drupal:before{content:"\f1a9"}.fa-joomla:before{content:"\f1aa"}.fa-language:before{content:"\f1ab"}.fa-fax:before{content:"\f1ac"}.fa-building:before{content:"\f1ad"}.fa-child:before{content:"\f1ae"}.fa-paw:before{content:"\f1b0"}.fa-spoon:before{content:"\f1b1"}.fa-cube:before{content:"\f1b2"}.fa-cubes:before{content:"\f1b3"}.fa-behance:before{content:"\f1b4"}.fa-behance-square:before{content:"\f1b5"}.fa-steam:before{content:"\f1b6"}.fa-steam-square:before{content:"\f1b7"}.fa-recycle:before{content:"\f1b8"}.fa-automobile:before,.fa-car:before{content:"\f1b9"}.fa-cab:before,.fa-taxi:before{content:"\f1ba"}.fa-tree:before{content:"\f1bb"}.fa-spotify:before{content:"\f1bc"}.fa-deviantart:before{content:"\f1bd"}.fa-soundcloud:before{content:"\f1be"}.fa-database:before{content:"\f1c0"}.fa-file-pdf-o:before{content:"\f1c1"}.fa-file-word-o:before{content:"\f1c2"}.fa-file-excel-o:before{content:"\f1c3"}.fa-file-powerpoint-o:before{content:"\f1c4"}.fa-file-image-o:before,.fa-file-photo-o:before,.fa-file-picture-o:before{content:"\f1c5"}.fa-file-archive-o:before,.fa-file-zip-o:before{content:"\f1c6"}.fa-file-audio-o:before,.fa-file-sound-o:before{content:"\f1c7"}.fa-file-movie-o:before,.fa-file-video-o:before{content:"\f1c8"}.fa-file-code-o:before{content:"\f1c9"}.fa-vine:before{content:"\f1ca"}.fa-codepen:before{content:"\f1cb"}.fa-jsfiddle:before{content:"\f1cc"}.fa-life-bouy:before,.fa-life-buoy:before,.fa-life-ring:before,.fa-life-saver:before,.fa-support:before{content:"\f1cd"}.fa-circle-o-notch:before{content:"\f1ce"}.fa-ra:before,.fa-rebel:before{content:"\f1d0"}.fa-empire:before,.fa-ge:before{content:"\f1d1"}.fa-git-square:before{content:"\f1d2"}.fa-git:before{content:"\f1d3"}.fa-hacker-news:before{content:"\f1d4"}.fa-tencent-weibo:before{content:"\f1d5"}.fa-qq:before{content:"\f1d6"}.fa-wechat:before,.fa-weixin:before{content:"\f1d7"}.fa-paper-plane:before,.fa-send:before{content:"\f1d8"}.fa-paper-plane-o:before,.fa-send-o:before{content:"\f1d9"}.fa-history:before{content:"\f1da"}.fa-circle-thin:before{content:"\f1db"}.fa-header:before{content:"\f1dc"}.fa-paragraph:before{content:"\f1dd"}.fa-sliders:before{content:"\f1de"}.fa-share-alt:before{content:"\f1e0"}.fa-share-alt-square:before{content:"\f1e1"}.fa-bomb:before{content:"\f1e2"}.fa-futbol-o:before,.fa-soccer-ball-o:before{content:"\f1e3"}.fa-tty:before{content:"\f1e4"}.fa-binoculars:before{content:"\f1e5"}.fa-plug:before{content:"\f1e6"}.fa-slideshare:before{content:"\f1e7"}.fa-twitch:before{content:"\f1e8"}.fa-yelp:before{content:"\f1e9"}.fa-newspaper-o:before{content:"\f1ea"}.fa-wifi:before{content:"\f1eb"}.fa-calculator:before{content:"\f1ec"}.fa-paypal:before{content:"\f1ed"}.fa-google-wallet:before{content:"\f1ee"}.fa-cc-visa:before{content:"\f1f0"}.fa-cc-mastercard:before{content:"\f1f1"}.fa-cc-discover:before{content:"\f1f2"}.fa-cc-amex:before{content:"\f1f3"}.fa-cc-paypal:before{content:"\f1f4"}.fa-cc-stripe:before{content:"\f1f5"}.fa-bell-slash:before{content:"\f1f6"}.fa-bell-slash-o:before{content:"\f1f7"}.fa-trash:before{content:"\f1f8"}.fa-copyright:before{content:"\f1f9"}.fa-at:before{content:"\f1fa"}.fa-eyedropper:before{content:"\f1fb"}.fa-paint-brush:before{content:"\f1fc"}.fa-birthday-cake:before{content:"\f1fd"}.fa-area-chart:before{content:"\f1fe"}.fa-pie-chart:before{content:"\f200"}.fa-line-chart:before{content:"\f201"}.fa-lastfm:before{content:"\f202"}.fa-lastfm-square:before{content:"\f203"}.fa-toggle-off:before{content:"\f204"}.fa-toggle-on:before{content:"\f205"}.fa-bicycle:before{content:"\f206"}.fa-bus:before{content:"\f207"}.fa-ioxhost:before{content:"\f208"}.fa-angellist:before{content:"\f209"}.fa-cc:before{content:"\f20a"}.fa-ils:before,.fa-shekel:before,.fa-sheqel:before{content:"\f20b"}.fa-meanpath:before{content:"\f20c"}
/*# sourceMappingURL=vendor.css.map */
diff --git a/mitmproxy/tools/web/static/vendor.js b/mitmproxy/tools/web/static/vendor.js
index 3b5ed1ac..93aa0821 100644
--- a/mitmproxy/tools/web/static/vendor.js
+++ b/mitmproxy/tools/web/static/vendor.js
@@ -1,52006 +1,253 @@
require=(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
-// CodeMirror, copyright (c) by Marijn Haverbeke and others
-// Distributed under an MIT license: http://codemirror.net/LICENSE
+!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.CodeMirror=t()}(this,function(){"use strict";function e(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}function t(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function r(e,r){return t(e).appendChild(r)}function n(e,t,r,n){var i=document.createElement(e);if(r&&(i.className=r),n&&(i.style.cssText=n),"string"==typeof t)i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o<t.length;++o)i.appendChild(t[o]);return i}function i(e,t){if(3==t.nodeType&&(t=t.parentNode),e.contains)return e.contains(t);do if(11==t.nodeType&&(t=t.host),t==e)return!0;while(t=t.parentNode)}function o(){var e;try{e=document.activeElement}catch(t){e=document.body||null}for(;e&&e.root&&e.root.activeElement;)e=e.root.activeElement;return e}function l(t,r){var n=t.className;e(r).test(n)||(t.className+=(n?" ":"")+r)}function s(t,r){for(var n=t.split(" "),i=0;i<n.length;i++)n[i]&&!e(n[i]).test(r)&&(r+=" "+n[i]);return r}function a(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function u(e,t,r){t||(t={});for(var n in e)!e.hasOwnProperty(n)||r===!1&&t.hasOwnProperty(n)||(t[n]=e[n]);return t}function c(e,t,r,n,i){null==t&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var o=n||0,l=i||0;;){var s=e.indexOf("\t",o);if(s<0||s>=t)return l+(t-o);l+=s-o,l+=r-l%r,o=s+1}}function f(e,t){for(var r=0;r<e.length;++r)if(e[r]==t)return r;return-1}function h(e,t,r){for(var n=0,i=0;;){var o=e.indexOf("\t",n);o==-1&&(o=e.length);var l=o-n;if(o==e.length||i+l>=t)return n+Math.min(l,t-i);if(i+=o-n,i+=r-i%r,n=o+1,i>=t)return n}}function d(e){for(;Ll.length<=e;)Ll.push(p(Ll)+" ");return Ll[e]}function p(e){return e[e.length-1]}function g(e,t){for(var r=[],n=0;n<e.length;n++)r[n]=t(e[n],n);return r}function v(e,t,r){for(var n=0,i=r(t);n<e.length&&r(e[n])<=i;)n++;e.splice(n,0,t)}function m(){}function y(e,t){var r;return Object.create?r=Object.create(e):(m.prototype=e,r=new m),t&&u(t,r),r}function b(e){return/\w/.test(e)||e>"€"&&(e.toUpperCase()!=e.toLowerCase()||Tl.test(e))}function w(e,t){return t?!!(t.source.indexOf("\\w")>-1&&b(e))||t.test(e):b(e)}function x(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}function C(e){return e.charCodeAt(0)>=768&&kl.test(e)}function S(e,t,r){for(;(r<0?t>0:t<e.length)&&C(e.charAt(t));)t+=r;return t}function L(e,t,r){for(;;){if(Math.abs(t-r)<=1)return e(t)?t:r;var n=Math.floor((t+r)/2);e(n)?r=n:t=n}}function T(e,t,r){var i=this;this.input=r,i.scrollbarFiller=n("div",null,"CodeMirror-scrollbar-filler"),i.scrollbarFiller.setAttribute("cm-not-content","true"),i.gutterFiller=n("div",null,"CodeMirror-gutter-filler"),i.gutterFiller.setAttribute("cm-not-content","true"),i.lineDiv=n("div",null,"CodeMirror-code"),i.selectionDiv=n("div",null,null,"position: relative; z-index: 1"),i.cursorDiv=n("div",null,"CodeMirror-cursors"),i.measure=n("div",null,"CodeMirror-measure"),i.lineMeasure=n("div",null,"CodeMirror-measure"),i.lineSpace=n("div",[i.measure,i.lineMeasure,i.selectionDiv,i.cursorDiv,i.lineDiv],null,"position: relative; outline: none"),i.mover=n("div",[n("div",[i.lineSpace],"CodeMirror-lines")],null,"position: relative"),i.sizer=n("div",[i.mover],"CodeMirror-sizer"),i.sizerWidth=null,i.heightForcer=n("div",null,null,"position: absolute; height: "+bl+"px; width: 1px;"),i.gutters=n("div",null,"CodeMirror-gutters"),i.lineGutter=null,i.scroller=n("div",[i.sizer,i.heightForcer,i.gutters],"CodeMirror-scroll"),i.scroller.setAttribute("tabIndex","-1"),i.wrapper=n("div",[i.scrollbarFiller,i.gutterFiller,i.scroller],"CodeMirror"),qo&&Zo<8&&(i.gutters.style.zIndex=-1,i.scroller.style.paddingRight=0),Qo||Xo&&ll||(i.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(i.wrapper):e(i.wrapper)),i.viewFrom=i.viewTo=t.first,i.reportedViewFrom=i.reportedViewTo=t.first,i.view=[],i.renderedView=null,i.externalMeasured=null,i.viewOffset=0,i.lastWrapHeight=i.lastWrapWidth=0,i.updateLineNumbers=null,i.nativeBarWidth=i.barHeight=i.barWidth=0,i.scrollbarsClipped=!1,i.lineNumWidth=i.lineNumInnerWidth=i.lineNumChars=null,i.alignWidgets=!1,i.cachedCharWidth=i.cachedTextHeight=i.cachedPaddingH=null,i.maxLine=null,i.maxLineLength=0,i.maxLineChanged=!1,i.wheelDX=i.wheelDY=i.wheelStartX=i.wheelStartY=null,i.shift=!1,i.selForContextMenu=null,i.activeTouch=null,r.init(i)}function k(e,t){if(t-=e.first,t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var r=e;!r.lines;)for(var n=0;;++n){var i=r.children[n],o=i.chunkSize();if(t<o){r=i;break}t-=o}return r.lines[t]}function M(e,t,r){var n=[],i=t.line;return e.iter(t.line,r.line+1,function(e){var o=e.text;i==r.line&&(o=o.slice(0,r.ch)),i==t.line&&(o=o.slice(t.ch)),n.push(o),++i}),n}function N(e,t,r){var n=[];return e.iter(t,r,function(e){n.push(e.text)}),n}function W(e,t){var r=t-e.height;if(r)for(var n=e;n;n=n.parent)n.height+=r}function O(e){if(null==e.parent)return null;for(var t=e.parent,r=f(t.lines,e),n=t.parent;n;t=n,n=n.parent)for(var i=0;n.children[i]!=t;++i)r+=n.children[i].chunkSize();return r+t.first}function A(e,t){var r=e.first;e:do{for(var n=0;n<e.children.length;++n){var i=e.children[n],o=i.height;if(t<o){e=i;continue e}t-=o,r+=i.chunkSize()}return r}while(!e.lines);for(var l=0;l<e.lines.length;++l){var s=e.lines[l],a=s.height;if(t<a)break;t-=a}return r+l}function D(e,t){return t>=e.first&&t<e.first+e.size}function H(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function P(e,t,r){return void 0===r&&(r=null),this instanceof P?(this.line=e,this.ch=t,void(this.sticky=r)):new P(e,t,r)}function E(e,t){return e.line-t.line||e.ch-t.ch}function I(e,t){return e.sticky==t.sticky&&0==E(e,t)}function z(e){return P(e.line,e.ch)}function F(e,t){return E(e,t)<0?t:e}function R(e,t){return E(e,t)<0?e:t}function B(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function G(e,t){if(t.line<e.first)return P(e.first,0);var r=e.first+e.size-1;return t.line>r?P(r,k(e,r).text.length):U(t,k(e,t.line).text.length)}function U(e,t){var r=e.ch;return null==r||r>t?P(e.line,t):r<0?P(e.line,0):e}function V(e,t){for(var r=[],n=0;n<t.length;n++)r[n]=G(e,t[n]);return r}function K(){Ml=!0}function j(){Nl=!0}function X(e,t,r){this.marker=e,this.from=t,this.to=r}function Y(e,t){if(e)for(var r=0;r<e.length;++r){var n=e[r];if(n.marker==t)return n}}function _(e,t){for(var r,n=0;n<e.length;++n)e[n]!=t&&(r||(r=[])).push(e[n]);return r}function $(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function q(e,t,r){var n;if(e)for(var i=0;i<e.length;++i){var o=e[i],l=o.marker,s=null==o.from||(l.inclusiveLeft?o.from<=t:o.from<t);if(s||o.from==t&&"bookmark"==l.type&&(!r||!o.marker.insertLeft)){var a=null==o.to||(l.inclusiveRight?o.to>=t:o.to>t);(n||(n=[])).push(new X(l,o.from,a?null:o.to))}}return n}function Z(e,t,r){var n;if(e)for(var i=0;i<e.length;++i){var o=e[i],l=o.marker,s=null==o.to||(l.inclusiveRight?o.to>=t:o.to>t);if(s||o.from==t&&"bookmark"==l.type&&(!r||o.marker.insertLeft)){var a=null==o.from||(l.inclusiveLeft?o.from<=t:o.from<t);(n||(n=[])).push(new X(l,a?null:o.from-t,null==o.to?null:o.to-t))}}return n}function Q(e,t){if(t.full)return null;var r=D(e,t.from.line)&&k(e,t.from.line).markedSpans,n=D(e,t.to.line)&&k(e,t.to.line).markedSpans;if(!r&&!n)return null;var i=t.from.ch,o=t.to.ch,l=0==E(t.from,t.to),s=q(r,i,l),a=Z(n,o,l),u=1==t.text.length,c=p(t.text).length+(u?i:0);if(s)for(var f=0;f<s.length;++f){var h=s[f];if(null==h.to){var d=Y(a,h.marker);d?u&&(h.to=null==d.to?null:d.to+c):h.to=i}}if(a)for(var g=0;g<a.length;++g){var v=a[g];if(null!=v.to&&(v.to+=c),null==v.from){var m=Y(s,v.marker);m||(v.from=c,u&&(s||(s=[])).push(v))}else v.from+=c,u&&(s||(s=[])).push(v)}s&&(s=J(s)),a&&a!=s&&(a=J(a));var y=[s];if(!u){var b,w=t.text.length-2;if(w>0&&s)for(var x=0;x<s.length;++x)null==s[x].to&&(b||(b=[])).push(new X(s[x].marker,null,null));for(var C=0;C<w;++C)y.push(b);y.push(a)}return y}function J(e){for(var t=0;t<e.length;++t){var r=e[t];null!=r.from&&r.from==r.to&&r.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function ee(e,t,r){var n=null;if(e.iter(t.line,r.line+1,function(e){if(e.markedSpans)for(var t=0;t<e.markedSpans.length;++t){var r=e.markedSpans[t].marker;!r.readOnly||n&&f(n,r)!=-1||(n||(n=[])).push(r)}}),!n)return null;for(var i=[{from:t,to:r}],o=0;o<n.length;++o)for(var l=n[o],s=l.find(0),a=0;a<i.length;++a){var u=i[a];if(!(E(u.to,s.from)<0||E(u.from,s.to)>0)){var c=[a,1],h=E(u.from,s.from),d=E(u.to,s.to);(h<0||!l.inclusiveLeft&&!h)&&c.push({from:u.from,to:s.from}),(d>0||!l.inclusiveRight&&!d)&&c.push({from:s.to,to:u.to}),i.splice.apply(i,c),a+=c.length-3}}return i}function te(e){var t=e.markedSpans;if(t){for(var r=0;r<t.length;++r)t[r].marker.detachLine(e);e.markedSpans=null}}function re(e,t){if(t){for(var r=0;r<t.length;++r)t[r].marker.attachLine(e);e.markedSpans=t}}function ne(e){return e.inclusiveLeft?-1:0}function ie(e){return e.inclusiveRight?1:0}function oe(e,t){var r=e.lines.length-t.lines.length;if(0!=r)return r;var n=e.find(),i=t.find(),o=E(n.from,i.from)||ne(e)-ne(t);if(o)return-o;var l=E(n.to,i.to)||ie(e)-ie(t);return l?l:t.id-e.id}function le(e,t){var r,n=Nl&&e.markedSpans;if(n)for(var i=void 0,o=0;o<n.length;++o)i=n[o],i.marker.collapsed&&null==(t?i.from:i.to)&&(!r||oe(r,i.marker)<0)&&(r=i.marker);return r}function se(e){return le(e,!0)}function ae(e){return le(e,!1)}function ue(e,t,r,n,i){var o=k(e,t),l=Nl&&o.markedSpans;if(l)for(var s=0;s<l.length;++s){var a=l[s];if(a.marker.collapsed){var u=a.marker.find(0),c=E(u.from,r)||ne(a.marker)-ne(i),f=E(u.to,n)||ie(a.marker)-ie(i);if(!(c>=0&&f<=0||c<=0&&f>=0)&&(c<=0&&(a.marker.inclusiveRight&&i.inclusiveLeft?E(u.to,r)>=0:E(u.to,r)>0)||c>=0&&(a.marker.inclusiveRight&&i.inclusiveLeft?E(u.from,n)<=0:E(u.from,n)<0)))return!0}}}function ce(e){for(var t;t=se(e);)e=t.find(-1,!0).line;return e}function fe(e){for(var t;t=ae(e);)e=t.find(1,!0).line;return e}function he(e){for(var t,r;t=ae(e);)e=t.find(1,!0).line,(r||(r=[])).push(e);return r}function de(e,t){var r=k(e,t),n=ce(r);return r==n?t:O(n)}function pe(e,t){if(t>e.lastLine())return t;var r,n=k(e,t);if(!ge(e,n))return t;for(;r=ae(n);)n=r.find(1,!0).line;return O(n)+1}function ge(e,t){var r=Nl&&t.markedSpans;if(r)for(var n=void 0,i=0;i<r.length;++i)if(n=r[i],n.marker.collapsed){if(null==n.from)return!0;if(!n.marker.widgetNode&&0==n.from&&n.marker.inclusiveLeft&&ve(e,t,n))return!0}}function ve(e,t,r){if(null==r.to){var n=r.marker.find(1,!0);return ve(e,n.line,Y(n.line.markedSpans,r.marker))}if(r.marker.inclusiveRight&&r.to==t.text.length)return!0;for(var i=void 0,o=0;o<t.markedSpans.length;++o)if(i=t.markedSpans[o],i.marker.collapsed&&!i.marker.widgetNode&&i.from==r.to&&(null==i.to||i.to!=r.from)&&(i.marker.inclusiveLeft||r.marker.inclusiveRight)&&ve(e,t,i))return!0}function me(e){e=ce(e);for(var t=0,r=e.parent,n=0;n<r.lines.length;++n){var i=r.lines[n];if(i==e)break;t+=i.height}for(var o=r.parent;o;r=o,o=r.parent)for(var l=0;l<o.children.length;++l){var s=o.children[l];if(s==r)break;t+=s.height}return t}function ye(e){if(0==e.height)return 0;for(var t,r=e.text.length,n=e;t=se(n);){var i=t.find(0,!0);n=i.from.line,r+=i.from.ch-i.to.ch}for(n=e;t=ae(n);){var o=t.find(0,!0);r-=n.text.length-o.from.ch,n=o.to.line,r+=n.text.length-o.to.ch}return r}function be(e){var t=e.display,r=e.doc;t.maxLine=k(r,r.first),t.maxLineLength=ye(t.maxLine),t.maxLineChanged=!0,r.iter(function(e){var r=ye(e);r>t.maxLineLength&&(t.maxLineLength=r,t.maxLine=e)})}function we(e,t,r,n){if(!e)return n(t,r,"ltr");for(var i=!1,o=0;o<e.length;++o){var l=e[o];(l.from<r&&l.to>t||t==r&&l.to==t)&&(n(Math.max(l.from,t),Math.min(l.to,r),1==l.level?"rtl":"ltr"),i=!0)}i||n(t,r,"ltr")}function xe(e,t,r){var n;Wl=null;for(var i=0;i<e.length;++i){var o=e[i];if(o.from<t&&o.to>t)return i;o.to==t&&(o.from!=o.to&&"before"==r?n=i:Wl=i),o.from==t&&(o.from!=o.to&&"before"!=r?n=i:Wl=i)}return null!=n?n:Wl}function Ce(e){var t=e.order;return null==t&&(t=e.order=Ol(e.text)),t}function Se(e,t,r){var n=S(e.text,t+r,r);return n<0||n>e.text.length?null:n}function Le(e,t,r){var n=Se(e,t.ch,r);return null==n?null:new P(t.line,n,r<0?"after":"before")}function Te(e,t,r,n,i){if(e){var o=Ce(r);if(o){var l,s=i<0?p(o):o[0],a=i<0==(1==s.level),u=a?"after":"before";if(s.level>0){var c=$t(t,r);l=i<0?r.text.length-1:0;var f=qt(t,c,l).top;l=L(function(e){return qt(t,c,e).top==f},i<0==(1==s.level)?s.from:s.to-1,l),"before"==u&&(l=Se(r,l,1,!0))}else l=i<0?s.to:s.from;return new P(n,l,u)}}return new P(n,i<0?r.text.length:0,i<0?"before":"after")}function ke(e,t,r,n){var i=Ce(t);if(!i)return Le(t,r,n);r.ch>=t.text.length?(r.ch=t.text.length,r.sticky="before"):r.ch<=0&&(r.ch=0,r.sticky="after");var o=xe(i,r.ch,r.sticky),l=i[o];if(l.level%2==0&&(n>0?l.to>r.ch:l.from<r.ch))return Le(t,r,n);var s,a=function(e,r){return Se(t,e instanceof P?e.ch:e,r)},u=function(r){return e.options.lineWrapping?(s=s||$t(e,t),pr(e,t,s,r)):{begin:0,end:t.text.length}},c=u("before"==r.sticky?a(r,-1):r.ch);if(l.level%2==1){var f=a(r,-n);if(null!=f&&(n>0?f>=l.from&&f>=c.begin:f<=l.to&&f<=c.end)){var h=n<0?"before":"after";return new P(r.line,f,h)}}var d=function(e,t,n){for(var o=function(e,t){return t?new P(r.line,a(e,1),"before"):new P(r.line,e,"after")};e>=0&&e<i.length;e+=t){var l=i[e],s=t>0==(1!=l.level),u=s?n.begin:a(n.end,-1);if(l.from<=u&&u<l.to)return o(u,s);if(u=s?l.from:a(l.to,-1),n.begin<=u&&u<n.end)return o(u,s)}},p=d(o+n,n,c);if(p)return p;var g=n>0?c.end:a(c.begin,-1);return null==g||n>0&&g==t.text.length||!(p=d(n>0?0:i.length-1,n,u(g)))?null:p}function Me(e,t){return e._handlers&&e._handlers[t]||Al}function Ne(e,t,r){if(e.removeEventListener)e.removeEventListener(t,r,!1);else if(e.detachEvent)e.detachEvent("on"+t,r);else{var n=e._handlers,i=n&&n[t];if(i){var o=f(i,r);o>-1&&(n[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function We(e,t){var r=Me(e,t);if(r.length)for(var n=Array.prototype.slice.call(arguments,2),i=0;i<r.length;++i)r[i].apply(null,n)}function Oe(e,t,r){return"string"==typeof t&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),We(e,r||t.type,e,t),Ie(t)||t.codemirrorIgnore}function Ae(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var r=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),n=0;n<t.length;++n)f(r,t[n])==-1&&r.push(t[n])}function De(e,t){return Me(e,t).length>0}function He(e){e.prototype.on=function(e,t){Dl(this,e,t)},e.prototype.off=function(e,t){Ne(this,e,t)}}function Pe(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function Ee(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function Ie(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function ze(e){Pe(e),Ee(e)}function Fe(e){return e.target||e.srcElement}function Re(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),sl&&e.ctrlKey&&1==t&&(t=3),t}function Be(e){if(null==ml){var t=n("span","​");r(e,n("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(ml=t.offsetWidth<=1&&t.offsetHeight>2&&!(qo&&Zo<8))}var i=ml?n("span","​"):n("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return i.setAttribute("cm-text",""),i}function Ge(e){if(null!=yl)return yl;var n=r(e,document.createTextNode("AخA")),i=fl(n,0,1).getBoundingClientRect(),o=fl(n,1,2).getBoundingClientRect();return t(e),!(!i||i.left==i.right)&&(yl=o.right-i.right<3)}function Ue(e){if(null!=zl)return zl;var t=r(e,n("span","x")),i=t.getBoundingClientRect(),o=fl(t,0,1).getBoundingClientRect();return zl=Math.abs(i.left-o.left)>1}function Ve(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Fl[e]=t}function Ke(e,t){Rl[e]=t}function je(e){if("string"==typeof e&&Rl.hasOwnProperty(e))e=Rl[e];else if(e&&"string"==typeof e.name&&Rl.hasOwnProperty(e.name)){var t=Rl[e.name];"string"==typeof t&&(t={name:t}),e=y(t,e),e.name=t.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return je("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return je("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function Xe(e,t){t=je(t);var r=Fl[t.name];if(!r)return Xe(e,"text/plain");var n=r(e,t);if(Bl.hasOwnProperty(t.name)){var i=Bl[t.name];for(var o in i)i.hasOwnProperty(o)&&(n.hasOwnProperty(o)&&(n["_"+o]=n[o]),n[o]=i[o])}if(n.name=t.name,t.helperType&&(n.helperType=t.helperType),t.modeProps)for(var l in t.modeProps)n[l]=t.modeProps[l];return n}function Ye(e,t){var r=Bl.hasOwnProperty(e)?Bl[e]:Bl[e]={};u(t,r)}function _e(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var r={};for(var n in t){var i=t[n];i instanceof Array&&(i=i.concat([])),r[n]=i}return r}function $e(e,t){for(var r;e.innerMode&&(r=e.innerMode(t),r&&r.mode!=e);)t=r.state,e=r.mode;return r||{mode:e,state:t}}function qe(e,t,r){return!e.startState||e.startState(t,r)}function Ze(e,t,r,n){var i=[e.state.modeGen],o={};ot(e,t.text,e.doc.mode,r,function(e,t){return i.push(e,t)},o,n);for(var l=function(r){var n=e.state.overlays[r],l=1,s=0;ot(e,t.text,n.mode,!0,function(e,t){for(var r=l;s<e;){var o=i[l];o>e&&i.splice(l,1,e,i[l+1],o),l+=2,s=Math.min(e,o)}if(t)if(n.opaque)i.splice(r,l-r,e,"overlay "+t),l=r+2;else for(;r<l;r+=2){var a=i[r+1];i[r+1]=(a?a+" ":"")+"overlay "+t}},o)},s=0;s<e.state.overlays.length;++s)l(s);return{styles:i,classes:o.bgClass||o.textClass?o:null}}function Qe(e,t,r){if(!t.styles||t.styles[0]!=e.state.modeGen){var n=Je(e,O(t)),i=Ze(e,t,t.text.length>e.options.maxHighlightLength?_e(e.doc.mode,n):n);t.stateAfter=n,t.styles=i.styles,i.classes?t.styleClasses=i.classes:t.styleClasses&&(t.styleClasses=null),r===e.doc.frontier&&e.doc.frontier++}return t.styles}function Je(e,t,r){var n=e.doc,i=e.display;if(!n.mode.startState)return!0;var o=lt(e,t,r),l=o>n.first&&k(n,o-1).stateAfter;return l=l?_e(n.mode,l):qe(n.mode),n.iter(o,t,function(r){et(e,r.text,l);var s=o==t-1||o%5==0||o>=i.viewFrom&&o<i.viewTo;r.stateAfter=s?_e(n.mode,l):null,++o}),r&&(n.frontier=o),l}function et(e,t,r,n){var i=e.doc.mode,o=new Gl(t,e.options.tabSize);for(o.start=o.pos=n||0,""==t&&tt(i,r);!o.eol();)rt(i,o,r),o.start=o.pos}function tt(e,t){if(e.blankLine)return e.blankLine(t);if(e.innerMode){var r=$e(e,t);return r.mode.blankLine?r.mode.blankLine(r.state):void 0}}function rt(e,t,r,n){for(var i=0;i<10;i++){n&&(n[0]=$e(e,r).mode);var o=e.token(t,r);if(t.pos>t.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}function nt(e,t,r,n){var i,o=function(e){return{start:f.start,end:f.pos,string:f.current(),type:i||null,state:e?_e(l.mode,c):c}},l=e.doc,s=l.mode;t=G(l,t);var a,u=k(l,t.line),c=Je(e,t.line,r),f=new Gl(u.text,e.options.tabSize);for(n&&(a=[]);(n||f.pos<t.ch)&&!f.eol();)f.start=f.pos,i=rt(s,f,c),n&&a.push(o(!0));return n?a:o()}function it(e,t){if(e)for(;;){var r=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!r)break;e=e.slice(0,r.index)+e.slice(r.index+r[0].length);var n=r[1]?"bgClass":"textClass";null==t[n]?t[n]=r[2]:new RegExp("(?:^|s)"+r[2]+"(?:$|s)").test(t[n])||(t[n]+=" "+r[2])}return e}function ot(e,t,r,n,i,o,l){var s=r.flattenSpans;null==s&&(s=e.options.flattenSpans);var a,u=0,c=null,f=new Gl(t,e.options.tabSize),h=e.options.addModeClass&&[null];for(""==t&&it(tt(r,n),o);!f.eol();){if(f.pos>e.options.maxHighlightLength?(s=!1,l&&et(e,t,n,f.pos),f.pos=t.length,a=null):a=it(rt(r,f,n,h),o),h){var d=h[0].name;d&&(a="m-"+(a?d+" "+a:d))}if(!s||c!=a){for(;u<f.start;)u=Math.min(f.start,u+5e3),i(u,c);c=a}f.start=f.pos}for(;u<f.pos;){var p=Math.min(f.pos,u+5e3);i(p,c),u=p}}function lt(e,t,r){for(var n,i,o=e.doc,l=r?-1:t-(e.doc.mode.innerMode?1e3:100),s=t;s>l;--s){if(s<=o.first)return o.first;var a=k(o,s-1);if(a.stateAfter&&(!r||s<=o.frontier))return s;var u=c(a.text,null,e.options.tabSize);(null==i||n>u)&&(i=s-1,n=u)}return i}function st(e,t,r,n){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),te(e),re(e,r);var i=n?n(e):1;i!=e.height&&W(e,i)}function at(e){e.parent=null,te(e)}function ut(e,t){if(!e||/^\s*$/.test(e))return null;var r=t.addModeClass?jl:Kl;return r[e]||(r[e]=e.replace(/\S+/g,"cm-$&"))}function ct(e,t){var r=n("span",null,null,Qo?"padding-right: .1px":null),i={pre:n("pre",[r],"CodeMirror-line"),content:r,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:(qo||Qo)&&e.getOption("lineWrapping")};r.setAttribute("role","presentation"),i.pre.setAttribute("role","presentation"),t.measure={};for(var o=0;o<=(t.rest?t.rest.length:0);o++){var l=o?t.rest[o-1]:t.line,a=void 0;i.pos=0,i.addToken=ht,Ge(e.display.measure)&&(a=Ce(l))&&(i.addToken=pt(i.addToken,a)),i.map=[];var u=t!=e.display.externalMeasured&&O(l);vt(l,i,Qe(e,l,u)),l.styleClasses&&(l.styleClasses.bgClass&&(i.bgClass=s(l.styleClasses.bgClass,i.bgClass||"")),l.styleClasses.textClass&&(i.textClass=s(l.styleClasses.textClass,i.textClass||""))),0==i.map.length&&i.map.push(0,0,i.content.appendChild(Be(e.display.measure))),0==o?(t.measure.map=i.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(i.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(Qo){var c=i.content.lastChild;(/\bcm-tab\b/.test(c.className)||c.querySelector&&c.querySelector(".cm-tab"))&&(i.content.className="cm-tab-wrap-hack")}return We(e,"renderLine",e,t.line,i.pre),i.pre.className&&(i.textClass=s(i.pre.className,i.textClass||"")),i}function ft(e){var t=n("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function ht(e,t,r,i,o,l,s){if(t){var a,u=e.splitSpaces?dt(t,e.trailingSpace):t,c=e.cm.state.specialChars,f=!1;if(c.test(t)){a=document.createDocumentFragment();for(var h=0;;){c.lastIndex=h;var p=c.exec(t),g=p?p.index-h:t.length-h;if(g){var v=document.createTextNode(u.slice(h,h+g));qo&&Zo<9?a.appendChild(n("span",[v])):a.appendChild(v),e.map.push(e.pos,e.pos+g,v),e.col+=g,e.pos+=g}if(!p)break;h+=g+1;var m=void 0;if("\t"==p[0]){var y=e.cm.options.tabSize,b=y-e.col%y;m=a.appendChild(n("span",d(b),"cm-tab")),m.setAttribute("role","presentation"),m.setAttribute("cm-text","\t"),e.col+=b}else"\r"==p[0]||"\n"==p[0]?(m=a.appendChild(n("span","\r"==p[0]?"␍":"␤","cm-invalidchar")),m.setAttribute("cm-text",p[0]),e.col+=1):(m=e.cm.options.specialCharPlaceholder(p[0]),m.setAttribute("cm-text",p[0]),qo&&Zo<9?a.appendChild(n("span",[m])):a.appendChild(m),e.col+=1);e.map.push(e.pos,e.pos+1,m),e.pos++}}else e.col+=t.length,a=document.createTextNode(u),e.map.push(e.pos,e.pos+t.length,a),qo&&Zo<9&&(f=!0),e.pos+=t.length;if(e.trailingSpace=32==u.charCodeAt(t.length-1),r||i||o||f||s){var w=r||"";i&&(w+=i),o&&(w+=o);var x=n("span",[a],w,s);return l&&(x.title=l),e.content.appendChild(x)}e.content.appendChild(a)}}function dt(e,t){if(e.length>1&&!/ /.test(e))return e;for(var r=t,n="",i=0;i<e.length;i++){var o=e.charAt(i);" "!=o||!r||i!=e.length-1&&32!=e.charCodeAt(i+1)||(o=" "),n+=o,r=" "==o}return n}function pt(e,t){return function(r,n,i,o,l,s,a){i=i?i+" cm-force-border":"cm-force-border";for(var u=r.pos,c=u+n.length;;){for(var f=void 0,h=0;h<t.length&&(f=t[h],!(f.to>u&&f.from<=u));h++);if(f.to>=c)return e(r,n,i,o,l,s,a);e(r,n.slice(0,f.to-u),i,o,null,s,a),o=null,n=n.slice(f.to-u),u=f.to}}}function gt(e,t,r,n){var i=!n&&r.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!n&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",r.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function vt(e,t,r){var n=e.markedSpans,i=e.text,o=0;if(n)for(var l,s,a,u,c,f,h,d=i.length,p=0,g=1,v="",m=0;;){if(m==p){a=u=c=f=s="",h=null,m=1/0;for(var y=[],b=void 0,w=0;w<n.length;++w){var x=n[w],C=x.marker;"bookmark"==C.type&&x.from==p&&C.widgetNode?y.push(C):x.from<=p&&(null==x.to||x.to>p||C.collapsed&&x.to==p&&x.from==p)?(null!=x.to&&x.to!=p&&m>x.to&&(m=x.to,u=""),C.className&&(a+=" "+C.className),C.css&&(s=(s?s+";":"")+C.css),C.startStyle&&x.from==p&&(c+=" "+C.startStyle),C.endStyle&&x.to==m&&(b||(b=[])).push(C.endStyle,x.to),C.title&&!f&&(f=C.title),C.collapsed&&(!h||oe(h.marker,C)<0)&&(h=x)):x.from>p&&m>x.from&&(m=x.from)}if(b)for(var S=0;S<b.length;S+=2)b[S+1]==m&&(u+=" "+b[S]);if(!h||h.from==p)for(var L=0;L<y.length;++L)gt(t,0,y[L]);if(h&&(h.from||0)==p){if(gt(t,(null==h.to?d+1:h.to)-p,h.marker,null==h.from),null==h.to)return;h.to==p&&(h=!1)}}if(p>=d)break;for(var T=Math.min(d,m);;){if(v){var k=p+v.length;if(!h){var M=k>T?v.slice(0,T-p):v;t.addToken(t,M,l?l+a:a,c,p+M.length==m?u:"",f,s)}if(k>=T){v=v.slice(T-p),p=T;break}p=k,c=""}v=i.slice(o,o=r[g++]),l=ut(r[g++],t.cm.options)}}else for(var N=1;N<r.length;N+=2)t.addToken(t,i.slice(o,o=r[N]),ut(r[N+1],t.cm.options))}function mt(e,t,r){this.line=t,this.rest=he(t),this.size=this.rest?O(p(this.rest))-r+1:1,this.node=this.text=null,this.hidden=ge(e,t)}function yt(e,t,r){for(var n,i=[],o=t;o<r;o=n){var l=new mt(e.doc,k(e.doc,o),o);n=o+l.size,i.push(l)}return i}function bt(e){Xl?Xl.ops.push(e):e.ownsGroup=Xl={ops:[e],delayedCallbacks:[]}}function wt(e){var t=e.delayedCallbacks,r=0;do{for(;r<t.length;r++)t[r].call(null);for(var n=0;n<e.ops.length;n++){var i=e.ops[n];if(i.cursorActivityHandlers)for(;i.cursorActivityCalled<i.cursorActivityHandlers.length;)i.cursorActivityHandlers[i.cursorActivityCalled++].call(null,i.cm)}}while(r<t.length)}function xt(e,t){var r=e.ownsGroup;if(r)try{wt(r)}finally{Xl=null,t(r)}}function Ct(e,t){var r=Me(e,t);if(r.length){var n,i=Array.prototype.slice.call(arguments,2);Xl?n=Xl.delayedCallbacks:Yl?n=Yl:(n=Yl=[],setTimeout(St,0));for(var o=function(e){n.push(function(){return r[e].apply(null,i)})},l=0;l<r.length;++l)o(l)}}function St(){var e=Yl;Yl=null;for(var t=0;t<e.length;++t)e[t]()}function Lt(e,t,r,n){for(var i=0;i<t.changes.length;i++){var o=t.changes[i];"text"==o?Nt(e,t):"gutter"==o?Ot(e,t,r,n):"class"==o?Wt(t):"widget"==o&&At(e,t,n)}t.changes=null}function Tt(e){return e.node==e.text&&(e.node=n("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),qo&&Zo<8&&(e.node.style.zIndex=2)),e.node}function kt(e){var t=e.bgClass?e.bgClass+" "+(e.line.bgClass||""):e.line.bgClass;if(t&&(t+=" CodeMirror-linebackground"),e.background)t?e.background.className=t:(e.background.parentNode.removeChild(e.background),e.background=null);else if(t){var r=Tt(e);e.background=r.insertBefore(n("div",null,t),r.firstChild)}}function Mt(e,t){var r=e.display.externalMeasured;return r&&r.line==t.line?(e.display.externalMeasured=null,t.measure=r.measure,r.built):ct(e,t)}function Nt(e,t){var r=t.text.className,n=Mt(e,t);t.text==t.node&&(t.node=n.pre),t.text.parentNode.replaceChild(n.pre,t.text),t.text=n.pre,n.bgClass!=t.bgClass||n.textClass!=t.textClass?(t.bgClass=n.bgClass,t.textClass=n.textClass,Wt(t)):r&&(t.text.className=r)}function Wt(e){kt(e),e.line.wrapClass?Tt(e).className=e.line.wrapClass:e.node!=e.text&&(e.node.className="");var t=e.textClass?e.textClass+" "+(e.line.textClass||""):e.line.textClass;e.text.className=t||""}function Ot(e,t,r,i){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var o=Tt(t);t.gutterBackground=n("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?i.fixedPos:-i.gutterTotalWidth)+"px; width: "+i.gutterTotalWidth+"px"),o.insertBefore(t.gutterBackground,t.text)}var l=t.line.gutterMarkers;if(e.options.lineNumbers||l){var s=Tt(t),a=t.gutter=n("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?i.fixedPos:-i.gutterTotalWidth)+"px");if(e.display.input.setUneditable(a),s.insertBefore(a,t.text),t.line.gutterClass&&(a.className+=" "+t.line.gutterClass),!e.options.lineNumbers||l&&l["CodeMirror-linenumbers"]||(t.lineNumber=a.appendChild(n("div",H(e.options,r),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+i.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),l)for(var u=0;u<e.options.gutters.length;++u){var c=e.options.gutters[u],f=l.hasOwnProperty(c)&&l[c];f&&a.appendChild(n("div",[f],"CodeMirror-gutter-elt","left: "+i.gutterLeft[c]+"px; width: "+i.gutterWidth[c]+"px"))}}}function At(e,t,r){t.alignable&&(t.alignable=null);for(var n=t.node.firstChild,i=void 0;n;n=i)i=n.nextSibling,"CodeMirror-linewidget"==n.className&&t.node.removeChild(n);Ht(e,t,r)}function Dt(e,t,r,n){var i=Mt(e,t);return t.text=t.node=i.pre,i.bgClass&&(t.bgClass=i.bgClass),i.textClass&&(t.textClass=i.textClass),Wt(t),Ot(e,t,r,n),Ht(e,t,n),t.node}function Ht(e,t,r){if(Pt(e,t.line,t,r,!0),t.rest)for(var n=0;n<t.rest.length;n++)Pt(e,t.rest[n],t,r,!1)}function Pt(e,t,r,i,o){if(t.widgets)for(var l=Tt(r),s=0,a=t.widgets;s<a.length;++s){var u=a[s],c=n("div",[u.node],"CodeMirror-linewidget");u.handleMouseEvents||c.setAttribute("cm-ignore-events","true"),Et(u,c,r,i),e.display.input.setUneditable(c),o&&u.above?l.insertBefore(c,r.gutter||r.text):l.appendChild(c),Ct(u,"redraw")}}function Et(e,t,r,n){if(e.noHScroll){(r.alignable||(r.alignable=[])).push(t);var i=n.wrapperWidth;t.style.left=n.fixedPos+"px",e.coverGutter||(i-=n.gutterTotalWidth,t.style.paddingLeft=n.gutterTotalWidth+"px"),t.style.width=i+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-n.gutterTotalWidth+"px"))}function It(e){if(null!=e.height)return e.height;var t=e.doc.cm;if(!t)return 0;if(!i(document.body,e.node)){var o="position: relative;";e.coverGutter&&(o+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(o+="width: "+t.display.wrapper.clientWidth+"px;"),r(t.display.measure,n("div",[e.node],null,o))}return e.height=e.node.parentNode.offsetHeight}function zt(e,t){for(var r=Fe(t);r!=e.wrapper;r=r.parentNode)if(!r||1==r.nodeType&&"true"==r.getAttribute("cm-ignore-events")||r.parentNode==e.sizer&&r!=e.mover)return!0}function Ft(e){return e.lineSpace.offsetTop}function Rt(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function Bt(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=r(e.measure,n("pre","x")),i=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,o={left:parseInt(i.paddingLeft),right:parseInt(i.paddingRight)};return isNaN(o.left)||isNaN(o.right)||(e.cachedPaddingH=o),o}function Gt(e){return bl-e.display.nativeBarWidth}function Ut(e){return e.display.scroller.clientWidth-Gt(e)-e.display.barWidth}function Vt(e){return e.display.scroller.clientHeight-Gt(e)-e.display.barHeight}function Kt(e,t,r){var n=e.options.lineWrapping,i=n&&Ut(e);if(!t.measure.heights||n&&t.measure.width!=i){var o=t.measure.heights=[];if(n){t.measure.width=i;for(var l=t.text.firstChild.getClientRects(),s=0;s<l.length-1;s++){var a=l[s],u=l[s+1];Math.abs(a.bottom-u.bottom)>2&&o.push((a.bottom+u.top)/2-r.top)}}o.push(r.bottom-r.top)}}function jt(e,t,r){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var n=0;n<e.rest.length;n++)if(e.rest[n]==t)return{map:e.measure.maps[n],cache:e.measure.caches[n]};for(var i=0;i<e.rest.length;i++)if(O(e.rest[i])>r)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}function Xt(e,t){t=ce(t);var n=O(t),i=e.display.externalMeasured=new mt(e.doc,t,n);i.lineN=n;var o=i.built=ct(e,i);return i.text=o.pre,r(e.display.lineMeasure,o.pre),i}function Yt(e,t,r,n){return qt(e,$t(e,t),r,n)}function _t(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[Sr(e,t)];var r=e.display.externalMeasured;return r&&t>=r.lineN&&t<r.lineN+r.size?r:void 0}function $t(e,t){var r=O(t),n=_t(e,r);n&&!n.text?n=null:n&&n.changes&&(Lt(e,n,r,yr(e)),e.curOp.forceUpdate=!0),n||(n=Xt(e,t));var i=jt(n,t,r);return{line:t,view:n,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function qt(e,t,r,n,i){t.before&&(r=-1);var o,l=r+(n||"");return t.cache.hasOwnProperty(l)?o=t.cache[l]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(Kt(e,t.view,t.rect),t.hasHeights=!0),
+o=Jt(e,t,r,n),o.bogus||(t.cache[l]=o)),{left:o.left,right:o.right,top:i?o.rtop:o.top,bottom:i?o.rbottom:o.bottom}}function Zt(e,t,r){for(var n,i,o,l,s,a,u=0;u<e.length;u+=3)if(s=e[u],a=e[u+1],t<s?(i=0,o=1,l="left"):t<a?(i=t-s,o=i+1):(u==e.length-3||t==a&&e[u+3]>t)&&(o=a-s,i=o-1,t>=a&&(l="right")),null!=i){if(n=e[u+2],s==a&&r==(n.insertLeft?"left":"right")&&(l=r),"left"==r&&0==i)for(;u&&e[u-2]==e[u-3]&&e[u-1].insertLeft;)n=e[(u-=3)+2],l="left";if("right"==r&&i==a-s)for(;u<e.length-3&&e[u+3]==e[u+4]&&!e[u+5].insertLeft;)n=e[(u+=3)+2],l="right";break}return{node:n,start:i,end:o,collapse:l,coverStart:s,coverEnd:a}}function Qt(e,t){var r=_l;if("left"==t)for(var n=0;n<e.length&&(r=e[n]).left==r.right;n++);else for(var i=e.length-1;i>=0&&(r=e[i]).left==r.right;i--);return r}function Jt(e,t,r,n){var i,o=Zt(t.map,r,n),l=o.node,s=o.start,a=o.end,u=o.collapse;if(3==l.nodeType){for(var c=0;c<4;c++){for(;s&&C(t.line.text.charAt(o.coverStart+s));)--s;for(;o.coverStart+a<o.coverEnd&&C(t.line.text.charAt(o.coverStart+a));)++a;if(i=qo&&Zo<9&&0==s&&a==o.coverEnd-o.coverStart?l.parentNode.getBoundingClientRect():Qt(fl(l,s,a).getClientRects(),n),i.left||i.right||0==s)break;a=s,s-=1,u="right"}qo&&Zo<11&&(i=er(e.display.measure,i))}else{s>0&&(u=n="right");var f;i=e.options.lineWrapping&&(f=l.getClientRects()).length>1?f["right"==n?f.length-1:0]:l.getBoundingClientRect()}if(qo&&Zo<9&&!s&&(!i||!i.left&&!i.right)){var h=l.parentNode.getClientRects()[0];i=h?{left:h.left,right:h.left+mr(e.display),top:h.top,bottom:h.bottom}:_l}for(var d=i.top-t.rect.top,p=i.bottom-t.rect.top,g=(d+p)/2,v=t.view.measure.heights,m=0;m<v.length-1&&!(g<v[m]);m++);var y=m?v[m-1]:0,b=v[m],w={left:("right"==u?i.right:i.left)-t.rect.left,right:("left"==u?i.left:i.right)-t.rect.left,top:y,bottom:b};return i.left||i.right||(w.bogus=!0),e.options.singleCursorHeightPerLine||(w.rtop=d,w.rbottom=p),w}function er(e,t){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!Ue(e))return t;var r=screen.logicalXDPI/screen.deviceXDPI,n=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*r,right:t.right*r,top:t.top*n,bottom:t.bottom*n}}function tr(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function rr(e){e.display.externalMeasure=null,t(e.display.lineMeasure);for(var r=0;r<e.display.view.length;r++)tr(e.display.view[r])}function nr(e){rr(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function ir(){return window.pageXOffset||(document.documentElement||document.body).scrollLeft}function or(){return window.pageYOffset||(document.documentElement||document.body).scrollTop}function lr(e,t,r,n,i){if(!i&&t.widgets)for(var o=0;o<t.widgets.length;++o)if(t.widgets[o].above){var l=It(t.widgets[o]);r.top+=l,r.bottom+=l}if("line"==n)return r;n||(n="local");var s=me(t);if("local"==n?s+=Ft(e.display):s-=e.display.viewOffset,"page"==n||"window"==n){var a=e.display.lineSpace.getBoundingClientRect();s+=a.top+("window"==n?0:or());var u=a.left+("window"==n?0:ir());r.left+=u,r.right+=u}return r.top+=s,r.bottom+=s,r}function sr(e,t,r){if("div"==r)return t;var n=t.left,i=t.top;if("page"==r)n-=ir(),i-=or();else if("local"==r||!r){var o=e.display.sizer.getBoundingClientRect();n+=o.left,i+=o.top}var l=e.display.lineSpace.getBoundingClientRect();return{left:n-l.left,top:i-l.top}}function ar(e,t,r,n,i){return n||(n=k(e.doc,t.line)),lr(e,n,Yt(e,n,t.ch,i),r)}function ur(e,t,r,n,i,o){function l(t,l){var s=qt(e,i,t,l?"right":"left",o);return l?s.left=s.right:s.right=s.left,lr(e,n,s,r)}function s(e,t,r){var n=a[t],i=n.level%2!=0;return l(r?e-1:e,i!=r)}n=n||k(e.doc,t.line),i||(i=$t(e,n));var a=Ce(n),u=t.ch,c=t.sticky;if(u>=n.text.length?(u=n.text.length,c="before"):u<=0&&(u=0,c="after"),!a)return l("before"==c?u-1:u,"before"==c);var f=xe(a,u,c),h=Wl,d=s(u,f,"before"==c);return null!=h&&(d.other=s(u,h,"before"!=c)),d}function cr(e,t){var r=0;t=G(e.doc,t),e.options.lineWrapping||(r=mr(e.display)*t.ch);var n=k(e.doc,t.line),i=me(n)+Ft(e.display);return{left:r,right:r,top:i,bottom:i+n.height}}function fr(e,t,r,n,i){var o=P(e,t,r);return o.xRel=i,n&&(o.outside=!0),o}function hr(e,t,r){var n=e.doc;if(r+=e.display.viewOffset,r<0)return fr(n.first,0,null,!0,-1);var i=A(n,r),o=n.first+n.size-1;if(i>o)return fr(n.first+n.size-1,k(n,o).text.length,null,!0,1);t<0&&(t=0);for(var l=k(n,i);;){var s=gr(e,l,i,t,r),a=ae(l),u=a&&a.find(0,!0);if(!a||!(s.ch>u.from.ch||s.ch==u.from.ch&&s.xRel>0))return s;i=O(l=u.to.line)}}function dr(e,t,r,n){var i=function(n){return lr(e,t,qt(e,r,n),"line")},o=t.text.length,l=L(function(e){return i(e-1).bottom<=n},o,0);return o=L(function(e){return i(e).top>n},l,o),{begin:l,end:o}}function pr(e,t,r,n){var i=lr(e,t,qt(e,r,n),"line").top;return dr(e,t,r,i)}function gr(e,t,r,n,i){i-=me(t);var o,l=0,s=t.text.length,a=$t(e,t),u=Ce(t);if(u){if(e.options.lineWrapping){var c;c=dr(e,t,a,i),l=c.begin,s=c.end,c}o=new P(r,l);var f,h,d=ur(e,o,"line",t,a).left,p=d<n?1:-1,g=d-n;do{if(f=g,h=o,o=ke(e,t,o,p),null==o||o.ch<l||s<=("before"==o.sticky?o.ch-1:o.ch)){o=h;break}g=ur(e,o,"line",t,a).left-n}while(p<0!=g<0&&Math.abs(g)<=Math.abs(f));if(Math.abs(g)>Math.abs(f)){if(g<0==f<0)throw new Error("Broke out of infinite loop in coordsCharInner");o=h}}else{var v=L(function(r){var o=lr(e,t,qt(e,a,r),"line");return o.top>i?(s=Math.min(r,s),!0):!(o.bottom<=i)&&(o.left>n||!(o.right<n)&&n-o.left<o.right-n)},l,s);v=S(t.text,v,1),o=new P(r,v,v==s?"before":"after")}var m=ur(e,o,"line",t,a);return(i<m.top||m.bottom<i)&&(o.outside=!0),o.xRel=n<m.left?-1:n>m.right?1:0,o}function vr(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==Vl){Vl=n("pre");for(var i=0;i<49;++i)Vl.appendChild(document.createTextNode("x")),Vl.appendChild(n("br"));Vl.appendChild(document.createTextNode("x"))}r(e.measure,Vl);var o=Vl.offsetHeight/50;return o>3&&(e.cachedTextHeight=o),t(e.measure),o||1}function mr(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=n("span","xxxxxxxxxx"),i=n("pre",[t]);r(e.measure,i);var o=t.getBoundingClientRect(),l=(o.right-o.left)/10;return l>2&&(e.cachedCharWidth=l),l||10}function yr(e){for(var t=e.display,r={},n={},i=t.gutters.clientLeft,o=t.gutters.firstChild,l=0;o;o=o.nextSibling,++l)r[e.options.gutters[l]]=o.offsetLeft+o.clientLeft+i,n[e.options.gutters[l]]=o.clientWidth;return{fixedPos:br(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:r,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}function br(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function wr(e){var t=vr(e.display),r=e.options.lineWrapping,n=r&&Math.max(5,e.display.scroller.clientWidth/mr(e.display)-3);return function(i){if(ge(e.doc,i))return 0;var o=0;if(i.widgets)for(var l=0;l<i.widgets.length;l++)i.widgets[l].height&&(o+=i.widgets[l].height);return r?o+(Math.ceil(i.text.length/n)||1)*t:o+t}}function xr(e){var t=e.doc,r=wr(e);t.iter(function(e){var t=r(e);t!=e.height&&W(e,t)})}function Cr(e,t,r,n){var i=e.display;if(!r&&"true"==Fe(t).getAttribute("cm-not-content"))return null;var o,l,s=i.lineSpace.getBoundingClientRect();try{o=t.clientX-s.left,l=t.clientY-s.top}catch(e){return null}var a,u=hr(e,o,l);if(n&&1==u.xRel&&(a=k(e.doc,u.line).text).length==u.ch){var f=c(a,a.length,e.options.tabSize)-a.length;u=P(u.line,Math.max(0,Math.round((o-Bt(e.display).left)/mr(e.display))-f))}return u}function Sr(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var r=e.display.view,n=0;n<r.length;n++)if(t-=r[n].size,t<0)return n}function Lr(e){e.display.input.showSelection(e.display.input.prepareSelection())}function Tr(e,t){for(var r=e.doc,n={},i=n.cursors=document.createDocumentFragment(),o=n.selection=document.createDocumentFragment(),l=0;l<r.sel.ranges.length;l++)if(t!==!1||l!=r.sel.primIndex){var s=r.sel.ranges[l];if(!(s.from().line>=e.display.viewTo||s.to().line<e.display.viewFrom)){var a=s.empty();(a||e.options.showCursorWhenSelecting)&&kr(e,s.head,i),a||Mr(e,s,o)}}return n}function kr(e,t,r){var i=ur(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),o=r.appendChild(n("div"," ","CodeMirror-cursor"));if(o.style.left=i.left+"px",o.style.top=i.top+"px",o.style.height=Math.max(0,i.bottom-i.top)*e.options.cursorHeight+"px",i.other){var l=r.appendChild(n("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));l.style.display="",l.style.left=i.other.left+"px",l.style.top=i.other.top+"px",l.style.height=.85*(i.other.bottom-i.other.top)+"px"}}function Mr(e,t,r){function i(e,t,r,i){t<0&&(t=0),t=Math.round(t),i=Math.round(i),a.appendChild(n("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px;\n top: "+t+"px; width: "+(null==r?f-e:r)+"px;\n height: "+(i-t)+"px"))}function o(t,r,n){function o(r,n){return ar(e,P(t,r),"div",u,n)}var l,a,u=k(s,t),h=u.text.length;return we(Ce(u),r||0,null==n?h:n,function(e,t,s){var u,d,p,g=o(e,"left");if(e==t)u=g,d=p=g.left;else{if(u=o(t-1,"right"),"rtl"==s){var v=g;g=u,u=v}d=g.left,p=u.right}null==r&&0==e&&(d=c),u.top-g.top>3&&(i(d,g.top,null,g.bottom),d=c,g.bottom<u.top&&i(d,g.bottom,null,u.top)),null==n&&t==h&&(p=f),(!l||g.top<l.top||g.top==l.top&&g.left<l.left)&&(l=g),(!a||u.bottom>a.bottom||u.bottom==a.bottom&&u.right>a.right)&&(a=u),d<c+1&&(d=c),i(d,u.top,p-d,u.bottom)}),{start:l,end:a}}var l=e.display,s=e.doc,a=document.createDocumentFragment(),u=Bt(e.display),c=u.left,f=Math.max(l.sizerWidth,Ut(e)-l.sizer.offsetLeft)-u.right,h=t.from(),d=t.to();if(h.line==d.line)o(h.line,h.ch,d.ch);else{var p=k(s,h.line),g=k(s,d.line),v=ce(p)==ce(g),m=o(h.line,h.ch,v?p.text.length+1:null).end,y=o(d.line,v?0:null,d.ch).start;v&&(m.top<y.top-2?(i(m.right,m.top,null,m.bottom),i(c,y.top,y.left,y.bottom)):i(m.right,m.top,y.left-m.right,m.bottom)),m.bottom<y.top&&i(c,m.bottom,null,y.top)}r.appendChild(a)}function Nr(e){if(e.state.focused){var t=e.display;clearInterval(t.blinker);var r=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){return t.cursorDiv.style.visibility=(r=!r)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function Wr(e){e.state.focused||(e.display.input.focus(),Ar(e))}function Or(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Dr(e))},100)}function Ar(e,t){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(We(e,"focus",e,t),e.state.focused=!0,l(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),Qo&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Nr(e))}function Dr(e,t){e.state.delayingBlurEvent||(e.state.focused&&(We(e,"blur",e,t),e.state.focused=!1,pl(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function Hr(e){var t=e.display,r=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var n=br(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=n+"px",l=0;l<r.length;l++)if(!r[l].hidden){e.options.fixedGutter&&(r[l].gutter&&(r[l].gutter.style.left=o),r[l].gutterBackground&&(r[l].gutterBackground.style.left=o));var s=r[l].alignable;if(s)for(var a=0;a<s.length;a++)s[a].style.left=o}e.options.fixedGutter&&(t.gutters.style.left=n+i+"px")}}function Pr(e){if(!e.options.lineNumbers)return!1;var t=e.doc,r=H(e.options,t.first+t.size-1),i=e.display;if(r.length!=i.lineNumChars){var o=i.measure.appendChild(n("div",[n("div",r)],"CodeMirror-linenumber CodeMirror-gutter-elt")),l=o.firstChild.offsetWidth,s=o.offsetWidth-l;return i.lineGutter.style.width="",i.lineNumInnerWidth=Math.max(l,i.lineGutter.offsetWidth-s)+1,i.lineNumWidth=i.lineNumInnerWidth+s,i.lineNumChars=i.lineNumInnerWidth?r.length:-1,i.lineGutter.style.width=i.lineNumWidth+"px",kn(e),!0}return!1}function Er(e){for(var t=e.display,r=t.lineDiv.offsetTop,n=0;n<t.view.length;n++){var i=t.view[n],o=void 0;if(!i.hidden){if(qo&&Zo<8){var l=i.node.offsetTop+i.node.offsetHeight;o=l-r,r=l}else{var s=i.node.getBoundingClientRect();o=s.bottom-s.top}var a=i.line.height-o;if(o<2&&(o=vr(t)),(a>.001||a<-.001)&&(W(i.line,o),Ir(i.line),i.rest))for(var u=0;u<i.rest.length;u++)Ir(i.rest[u])}}}function Ir(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t)e.widgets[t].height=e.widgets[t].node.parentNode.offsetHeight}function zr(e,t,r){var n=r&&null!=r.top?Math.max(0,r.top):e.scroller.scrollTop;n=Math.floor(n-Ft(e));var i=r&&null!=r.bottom?r.bottom:n+e.wrapper.clientHeight,o=A(t,n),l=A(t,i);if(r&&r.ensure){var s=r.ensure.from.line,a=r.ensure.to.line;s<o?(o=s,l=A(t,me(k(t,s))+e.wrapper.clientHeight)):Math.min(a,t.lastLine())>=l&&(o=A(t,me(k(t,a))-e.wrapper.clientHeight),l=a)}return{from:o,to:Math.max(l,o+1)}}function Fr(e,t){Math.abs(e.doc.scrollTop-t)<2||(e.doc.scrollTop=t,Xo||Ln(e,{top:t}),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t),e.display.scrollbars.setScrollTop(t),Xo&&Ln(e),bn(e,100))}function Rr(e,t,r){(r?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)||(t=Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth),e.doc.scrollLeft=t,Hr(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function Br(e){var t=e.wheelDeltaX,r=e.wheelDeltaY;return null==t&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),null==r&&e.detail&&e.axis==e.VERTICAL_AXIS?r=e.detail:null==r&&(r=e.wheelDelta),{x:t,y:r}}function Gr(e){var t=Br(e);return t.x*=ql,t.y*=ql,t}function Ur(e,t){var r=Br(t),n=r.x,i=r.y,o=e.display,l=o.scroller,s=l.scrollWidth>l.clientWidth,a=l.scrollHeight>l.clientHeight;if(n&&s||i&&a){if(i&&sl&&Qo)e:for(var u=t.target,c=o.view;u!=l;u=u.parentNode)for(var f=0;f<c.length;f++)if(c[f].node==u){e.display.currentWheelTarget=u;break e}if(n&&!Xo&&!tl&&null!=ql)return i&&a&&Fr(e,Math.max(0,Math.min(l.scrollTop+i*ql,l.scrollHeight-l.clientHeight))),Rr(e,Math.max(0,Math.min(l.scrollLeft+n*ql,l.scrollWidth-l.clientWidth))),(!i||i&&a)&&Pe(t),void(o.wheelStartX=null);if(i&&null!=ql){var h=i*ql,d=e.doc.scrollTop,p=d+o.wrapper.clientHeight;h<0?d=Math.max(0,d+h-50):p=Math.min(e.doc.height,p+h+50),Ln(e,{top:d,bottom:p})}$l<20&&(null==o.wheelStartX?(o.wheelStartX=l.scrollLeft,o.wheelStartY=l.scrollTop,o.wheelDX=n,o.wheelDY=i,setTimeout(function(){if(null!=o.wheelStartX){var e=l.scrollLeft-o.wheelStartX,t=l.scrollTop-o.wheelStartY,r=t&&o.wheelDY&&t/o.wheelDY||e&&o.wheelDX&&e/o.wheelDX;o.wheelStartX=o.wheelStartY=null,r&&(ql=(ql*$l+r)/($l+1),++$l)}},200)):(o.wheelDX+=n,o.wheelDY+=i))}}function Vr(e){var t=e.display,r=t.gutters.offsetWidth,n=Math.round(e.doc.height+Rt(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?r:0,docHeight:n,scrollHeight:n+Gt(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:r}}function Kr(e,t){t||(t=Vr(e));var r=e.display.barWidth,n=e.display.barHeight;jr(e,t);for(var i=0;i<4&&r!=e.display.barWidth||n!=e.display.barHeight;i++)r!=e.display.barWidth&&e.options.lineWrapping&&Er(e),jr(e,Vr(e)),r=e.display.barWidth,n=e.display.barHeight}function jr(e,t){var r=e.display,n=r.scrollbars.update(t);r.sizer.style.paddingRight=(r.barWidth=n.right)+"px",r.sizer.style.paddingBottom=(r.barHeight=n.bottom)+"px",r.heightForcer.style.borderBottom=n.bottom+"px solid transparent",n.right&&n.bottom?(r.scrollbarFiller.style.display="block",r.scrollbarFiller.style.height=n.bottom+"px",r.scrollbarFiller.style.width=n.right+"px"):r.scrollbarFiller.style.display="",n.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(r.gutterFiller.style.display="block",r.gutterFiller.style.height=n.bottom+"px",r.gutterFiller.style.width=t.gutterWidth+"px"):r.gutterFiller.style.display=""}function Xr(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&pl(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Jl[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),Dl(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,r){"horizontal"==r?Rr(e,t):Fr(e,t)},e),e.display.scrollbars.addClass&&l(e.display.wrapper,e.display.scrollbars.addClass)}function Yr(e,t){if(!Oe(e,"scrollCursorIntoView")){var r=e.display,i=r.sizer.getBoundingClientRect(),o=null;if(t.top+i.top<0?o=!0:t.bottom+i.top>(window.innerHeight||document.documentElement.clientHeight)&&(o=!1),null!=o&&!il){var l=n("div","​",null,"position: absolute;\n top: "+(t.top-r.viewOffset-Ft(e.display))+"px;\n height: "+(t.bottom-t.top+Gt(e)+r.barHeight)+"px;\n left: "+t.left+"px; width: 2px;");e.display.lineSpace.appendChild(l),l.scrollIntoView(o),e.display.lineSpace.removeChild(l)}}}function _r(e,t,r,n){null==n&&(n=0);for(var i,o=0;o<5;o++){var l=!1;i=ur(e,t);var s=r&&r!=t?ur(e,r):i,a=qr(e,Math.min(i.left,s.left),Math.min(i.top,s.top)-n,Math.max(i.left,s.left),Math.max(i.bottom,s.bottom)+n),u=e.doc.scrollTop,c=e.doc.scrollLeft;if(null!=a.scrollTop&&(Fr(e,a.scrollTop),Math.abs(e.doc.scrollTop-u)>1&&(l=!0)),null!=a.scrollLeft&&(Rr(e,a.scrollLeft),Math.abs(e.doc.scrollLeft-c)>1&&(l=!0)),!l)break}return i}function $r(e,t,r,n,i){var o=qr(e,t,r,n,i);null!=o.scrollTop&&Fr(e,o.scrollTop),null!=o.scrollLeft&&Rr(e,o.scrollLeft)}function qr(e,t,r,n,i){var o=e.display,l=vr(e.display);r<0&&(r=0);var s=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:o.scroller.scrollTop,a=Vt(e),u={};i-r>a&&(i=r+a);var c=e.doc.height+Rt(o),f=r<l,h=i>c-l;if(r<s)u.scrollTop=f?0:r;else if(i>s+a){var d=Math.min(r,(h?c:i)-a);d!=s&&(u.scrollTop=d)}var p=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:o.scroller.scrollLeft,g=Ut(e)-(e.options.fixedGutter?o.gutters.offsetWidth:0),v=n-t>g;return v&&(n=t+g),t<10?u.scrollLeft=0:t<p?u.scrollLeft=Math.max(0,t-(v?0:10)):n>g+p-3&&(u.scrollLeft=n+(v?0:10)-g),u}function Zr(e,t,r){null==t&&null==r||Jr(e),null!=t&&(e.curOp.scrollLeft=(null==e.curOp.scrollLeft?e.doc.scrollLeft:e.curOp.scrollLeft)+t),null!=r&&(e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+r)}function Qr(e){Jr(e);var t=e.getCursor(),r=t,n=t;e.options.lineWrapping||(r=t.ch?P(t.line,t.ch-1):t,n=P(t.line,t.ch+1)),e.curOp.scrollToPos={from:r,to:n,margin:e.options.cursorScrollMargin,isCursor:!0}}function Jr(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var r=cr(e,t.from),n=cr(e,t.to),i=qr(e,Math.min(r.left,n.left),Math.min(r.top,n.top)-t.margin,Math.max(r.right,n.right),Math.max(r.bottom,n.bottom)+t.margin);e.scrollTo(i.scrollLeft,i.scrollTop)}}function en(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:null,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++es},bt(e.curOp)}function tn(e){var t=e.curOp;xt(t,function(e){for(var t=0;t<e.ops.length;t++)e.ops[t].cm.curOp=null;rn(e)})}function rn(e){for(var t=e.ops,r=0;r<t.length;r++)nn(t[r]);for(var n=0;n<t.length;n++)on(t[n]);for(var i=0;i<t.length;i++)ln(t[i]);for(var o=0;o<t.length;o++)sn(t[o]);for(var l=0;l<t.length;l++)an(t[l])}function nn(e){var t=e.cm,r=t.display;xn(t),e.updateMaxLine&&be(t),e.mustUpdate=e.viewChanged||e.forceUpdate||null!=e.scrollTop||e.scrollToPos&&(e.scrollToPos.from.line<r.viewFrom||e.scrollToPos.to.line>=r.viewTo)||r.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new ts(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function on(e){e.updatedDisplay=e.mustUpdate&&Cn(e.cm,e.update)}function ln(e){var t=e.cm,r=t.display;e.updatedDisplay&&Er(t),e.barMeasure=Vr(t),r.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Yt(t,r.maxLine,r.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(r.scroller.clientWidth,r.sizer.offsetLeft+e.adjustWidthTo+Gt(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,r.sizer.offsetLeft+e.adjustWidthTo-Ut(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=r.input.prepareSelection(e.focus))}function sn(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&Rr(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var r=e.focus&&e.focus==o()&&(!document.hasFocus||document.hasFocus());e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,r),(e.updatedDisplay||e.startHeight!=t.doc.height)&&Kr(t,e.barMeasure),e.updatedDisplay&&Mn(t,e.barMeasure),e.selectionChanged&&Nr(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),r&&Wr(e.cm)}function an(e){var t=e.cm,r=t.display,n=t.doc;if(e.updatedDisplay&&Sn(t,e.update),null==r.wheelStartX||null==e.scrollTop&&null==e.scrollLeft&&!e.scrollToPos||(r.wheelStartX=r.wheelStartY=null),null==e.scrollTop||r.scroller.scrollTop==e.scrollTop&&!e.forceScroll||(n.scrollTop=Math.max(0,Math.min(r.scroller.scrollHeight-r.scroller.clientHeight,e.scrollTop)),r.scrollbars.setScrollTop(n.scrollTop),r.scroller.scrollTop=n.scrollTop),null==e.scrollLeft||r.scroller.scrollLeft==e.scrollLeft&&!e.forceScroll||(n.scrollLeft=Math.max(0,Math.min(r.scroller.scrollWidth-r.scroller.clientWidth,e.scrollLeft)),r.scrollbars.setScrollLeft(n.scrollLeft),r.scroller.scrollLeft=n.scrollLeft,Hr(t)),e.scrollToPos){var i=_r(t,G(n,e.scrollToPos.from),G(n,e.scrollToPos.to),e.scrollToPos.margin);e.scrollToPos.isCursor&&t.state.focused&&Yr(t,i)}var o=e.maybeHiddenMarkers,l=e.maybeUnhiddenMarkers;if(o)for(var s=0;s<o.length;++s)o[s].lines.length||We(o[s],"hide");if(l)for(var a=0;a<l.length;++a)l[a].lines.length&&We(l[a],"unhide");r.wrapper.offsetHeight&&(n.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&We(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function un(e,t){if(e.curOp)return t();en(e);try{return t()}finally{tn(e)}}function cn(e,t){return function(){if(e.curOp)return t.apply(e,arguments);en(e);try{return t.apply(e,arguments)}finally{tn(e)}}}function fn(e){return function(){if(this.curOp)return e.apply(this,arguments);en(this);try{return e.apply(this,arguments)}finally{tn(this)}}}function hn(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);en(t);try{return e.apply(this,arguments)}finally{tn(t)}}}function dn(e,t,r,n){null==t&&(t=e.doc.first),null==r&&(r=e.doc.first+e.doc.size),n||(n=0);var i=e.display;if(n&&r<i.viewTo&&(null==i.updateLineNumbers||i.updateLineNumbers>t)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)Nl&&de(e.doc,t)<i.viewTo&&gn(e);else if(r<=i.viewFrom)Nl&&pe(e.doc,r+n)>i.viewFrom?gn(e):(i.viewFrom+=n,i.viewTo+=n);else if(t<=i.viewFrom&&r>=i.viewTo)gn(e);else if(t<=i.viewFrom){var o=vn(e,r,r+n,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=n):gn(e)}else if(r>=i.viewTo){var l=vn(e,t,t,-1);l?(i.view=i.view.slice(0,l.index),i.viewTo=l.lineN):gn(e)}else{var s=vn(e,t,t,-1),a=vn(e,r,r+n,1);s&&a?(i.view=i.view.slice(0,s.index).concat(yt(e,s.lineN,a.lineN)).concat(i.view.slice(a.index)),i.viewTo+=n):gn(e)}var u=i.externalMeasured;u&&(r<u.lineN?u.lineN+=n:t<u.lineN+u.size&&(i.externalMeasured=null))}function pn(e,t,r){e.curOp.viewChanged=!0;var n=e.display,i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size&&(n.externalMeasured=null),!(t<n.viewFrom||t>=n.viewTo)){var o=n.view[Sr(e,t)];if(null!=o.node){var l=o.changes||(o.changes=[]);f(l,r)==-1&&l.push(r)}}}function gn(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function vn(e,t,r,n){var i,o=Sr(e,t),l=e.display.view;if(!Nl||r==e.doc.first+e.doc.size)return{index:o,lineN:r};for(var s=e.display.viewFrom,a=0;a<o;a++)s+=l[a].size;if(s!=t){if(n>0){if(o==l.length-1)return null;i=s+l[o].size-t,o++}else i=s-t;t+=i,r+=i}for(;de(e.doc,r)!=r;){if(o==(n<0?0:l.length-1))return null;r+=n*l[o-(n<0?1:0)].size,o+=n}return{index:o,lineN:r}}function mn(e,t,r){var n=e.display,i=n.view;0==i.length||t>=n.viewTo||r<=n.viewFrom?(n.view=yt(e,t,r),n.viewFrom=t):(n.viewFrom>t?n.view=yt(e,t,n.viewFrom).concat(n.view):n.viewFrom<t&&(n.view=n.view.slice(Sr(e,t))),n.viewFrom=t,n.viewTo<r?n.view=n.view.concat(yt(e,n.viewTo,r)):n.viewTo>r&&(n.view=n.view.slice(0,Sr(e,r)))),n.viewTo=r}function yn(e){for(var t=e.display.view,r=0,n=0;n<t.length;n++){var i=t[n];i.hidden||i.node&&!i.changes||++r}return r}function bn(e,t){e.doc.mode.startState&&e.doc.frontier<e.display.viewTo&&e.state.highlight.set(t,a(wn,e))}function wn(e){var t=e.doc;if(t.frontier<t.first&&(t.frontier=t.first),!(t.frontier>=e.display.viewTo)){var r=+new Date+e.options.workTime,n=_e(t.mode,Je(e,t.frontier)),i=[];t.iter(t.frontier,Math.min(t.first+t.size,e.display.viewTo+500),function(o){if(t.frontier>=e.display.viewFrom){var l=o.styles,s=o.text.length>e.options.maxHighlightLength,a=Ze(e,o,s?_e(t.mode,n):n,!0);o.styles=a.styles;var u=o.styleClasses,c=a.classes;c?o.styleClasses=c:u&&(o.styleClasses=null);for(var f=!l||l.length!=o.styles.length||u!=c&&(!u||!c||u.bgClass!=c.bgClass||u.textClass!=c.textClass),h=0;!f&&h<l.length;++h)f=l[h]!=o.styles[h];f&&i.push(t.frontier),o.stateAfter=s?n:_e(t.mode,n)}else o.text.length<=e.options.maxHighlightLength&&et(e,o.text,n),o.stateAfter=t.frontier%5==0?_e(t.mode,n):null;if(++t.frontier,+new Date>r)return bn(e,e.options.workDelay),!0}),i.length&&un(e,function(){for(var t=0;t<i.length;t++)pn(e,i[t],"text")})}}function xn(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=Gt(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Gt(e)+"px",t.scrollbarsClipped=!0)}function Cn(e,r){var n=e.display,i=e.doc;if(r.editorIsHidden)return gn(e),!1;if(!r.force&&r.visible.from>=n.viewFrom&&r.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==yn(e))return!1;Pr(e)&&(gn(e),r.dims=yr(e));var l=i.first+i.size,s=Math.max(r.visible.from-e.options.viewportMargin,i.first),a=Math.min(l,r.visible.to+e.options.viewportMargin);n.viewFrom<s&&s-n.viewFrom<20&&(s=Math.max(i.first,n.viewFrom)),n.viewTo>a&&n.viewTo-a<20&&(a=Math.min(l,n.viewTo)),Nl&&(s=de(e.doc,s),a=pe(e.doc,a));var u=s!=n.viewFrom||a!=n.viewTo||n.lastWrapHeight!=r.wrapperHeight||n.lastWrapWidth!=r.wrapperWidth;mn(e,s,a),n.viewOffset=me(k(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var c=yn(e);if(!u&&0==c&&!r.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var f=o();return c>4&&(n.lineDiv.style.display="none"),Tn(e,n.updateLineNumbers,r.dims),c>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,f&&o()!=f&&f.offsetHeight&&f.focus(),t(n.cursorDiv),t(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,u&&(n.lastWrapHeight=r.wrapperHeight,n.lastWrapWidth=r.wrapperWidth,bn(e,400)),n.updateLineNumbers=null,!0}function Sn(e,t){for(var r=t.viewport,n=!0;(n&&e.options.lineWrapping&&t.oldDisplayWidth!=Ut(e)||(r&&null!=r.top&&(r={top:Math.min(e.doc.height+Rt(e.display)-Vt(e),r.top)}),t.visible=zr(e.display,e.doc,r),!(t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)))&&Cn(e,t);n=!1){Er(e);var i=Vr(e);Lr(e),Kr(e,i),Mn(e,i)}t.signal(e,"update",e),e.display.viewFrom==e.display.reportedViewFrom&&e.display.viewTo==e.display.reportedViewTo||(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function Ln(e,t){var r=new ts(e,t);if(Cn(e,r)){Er(e),Sn(e,r);var n=Vr(e);Lr(e),Kr(e,n),Mn(e,n),r.finish()}}function Tn(e,r,n){function i(t){var r=t.nextSibling;return Qo&&sl&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),r}for(var o=e.display,l=e.options.lineNumbers,s=o.lineDiv,a=s.firstChild,u=o.view,c=o.viewFrom,h=0;h<u.length;h++){var d=u[h];if(d.hidden);else if(d.node&&d.node.parentNode==s){for(;a!=d.node;)a=i(a);var p=l&&null!=r&&r<=c&&d.lineNumber;d.changes&&(f(d.changes,"gutter")>-1&&(p=!1),Lt(e,d,c,n)),p&&(t(d.lineNumber),d.lineNumber.appendChild(document.createTextNode(H(e.options,c)))),a=d.node.nextSibling}else{var g=Dt(e,d,c,n);s.insertBefore(g,a)}c+=d.size}for(;a;)a=i(a)}function kn(e){var t=e.display.gutters.offsetWidth;e.display.sizer.style.marginLeft=t+"px"}function Mn(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+Gt(e)+"px"}function Nn(e){var r=e.display.gutters,i=e.options.gutters;t(r);for(var o=0;o<i.length;++o){var l=i[o],s=r.appendChild(n("div",null,"CodeMirror-gutter "+l));"CodeMirror-linenumbers"==l&&(e.display.lineGutter=s,s.style.width=(e.display.lineNumWidth||1)+"px")}r.style.display=o?"":"none",kn(e)}function Wn(e){var t=f(e.gutters,"CodeMirror-linenumbers");t==-1&&e.lineNumbers?e.gutters=e.gutters.concat(["CodeMirror-linenumbers"]):t>-1&&!e.lineNumbers&&(e.gutters=e.gutters.slice(0),e.gutters.splice(t,1))}function On(e,t){var r=e[t];e.sort(function(e,t){return E(e.from(),t.from())}),t=f(e,r);for(var n=1;n<e.length;n++){var i=e[n],o=e[n-1];if(E(o.to(),i.from())>=0){var l=R(o.from(),i.from()),s=F(o.to(),i.to()),a=o.empty()?i.from()==i.head:o.from()==o.head;n<=t&&--t,e.splice(--n,2,new ns(a?s:l,a?l:s))}}return new rs(e,t)}function An(e,t){return new rs([new ns(e,t||e)],0)}function Dn(e){return e.text?P(e.from.line+e.text.length-1,p(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function Hn(e,t){if(E(e,t.from)<0)return e;if(E(e,t.to)<=0)return Dn(t);var r=e.line+t.text.length-(t.to.line-t.from.line)-1,n=e.ch;return e.line==t.to.line&&(n+=Dn(t).ch-t.to.ch),P(r,n)}function Pn(e,t){for(var r=[],n=0;n<e.sel.ranges.length;n++){var i=e.sel.ranges[n];r.push(new ns(Hn(i.anchor,t),Hn(i.head,t)))}return On(r,e.sel.primIndex)}function En(e,t,r){return e.line==t.line?P(r.line,e.ch-t.ch+r.ch):P(r.line+(e.line-t.line),e.ch)}function In(e,t,r){for(var n=[],i=P(e.first,0),o=i,l=0;l<t.length;l++){var s=t[l],a=En(s.from,i,o),u=En(Dn(s),i,o);if(i=s.to,o=u,"around"==r){var c=e.sel.ranges[l],f=E(c.head,c.anchor)<0;n[l]=new ns(f?u:a,f?a:u)}else n[l]=new ns(a,a)}return new rs(n,e.sel.primIndex)}function zn(e){e.doc.mode=Xe(e.options,e.doc.modeOption),Fn(e)}function Fn(e){e.doc.iter(function(e){e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null)}),e.doc.frontier=e.doc.first,bn(e,100),e.state.modeGen++,e.curOp&&dn(e)}function Rn(e,t){return 0==t.from.ch&&0==t.to.ch&&""==p(t.text)&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Bn(e,t,r,n){function i(e){return r?r[e]:null}function o(e,r,i){st(e,r,i,n),Ct(e,"change",e,t)}function l(e,t){for(var r=[],o=e;o<t;++o)r.push(new Ul(u[o],i(o),n));return r}var s=t.from,a=t.to,u=t.text,c=k(e,s.line),f=k(e,a.line),h=p(u),d=i(u.length-1),g=a.line-s.line;if(t.full)e.insert(0,l(0,u.length)),e.remove(u.length,e.size-u.length);else if(Rn(e,t)){var v=l(0,u.length-1);o(f,f.text,d),g&&e.remove(s.line,g),v.length&&e.insert(s.line,v)}else if(c==f)if(1==u.length)o(c,c.text.slice(0,s.ch)+h+c.text.slice(a.ch),d);else{var m=l(1,u.length-1);m.push(new Ul(h+c.text.slice(a.ch),d,n)),o(c,c.text.slice(0,s.ch)+u[0],i(0)),e.insert(s.line+1,m)}else if(1==u.length)o(c,c.text.slice(0,s.ch)+u[0]+f.text.slice(a.ch),i(0)),e.remove(s.line+1,g);else{o(c,c.text.slice(0,s.ch)+u[0],i(0)),o(f,h+f.text.slice(a.ch),d);var y=l(1,u.length-1);g>1&&e.remove(s.line+1,g-1),e.insert(s.line+1,y)}Ct(e,"change",e,t)}function Gn(e,t,r){
+function n(e,i,o){if(e.linked)for(var l=0;l<e.linked.length;++l){var s=e.linked[l];if(s.doc!=i){var a=o&&s.sharedHist;r&&!a||(t(s.doc,a),n(s.doc,e,a))}}}n(e,null,!0)}function Un(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,xr(e),zn(e),e.options.lineWrapping||be(e),e.options.mode=t.modeOption,dn(e)}function Vn(e){this.done=[],this.undone=[],this.undoDepth=1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e||1}function Kn(e,t){var r={from:z(t.from),to:Dn(t),text:M(e,t.from,t.to)};return Zn(e,r,t.from.line,t.to.line+1),Gn(e,function(e){return Zn(e,r,t.from.line,t.to.line+1)},!0),r}function jn(e){for(;e.length;){var t=p(e);if(!t.ranges)break;e.pop()}}function Xn(e,t){return t?(jn(e.done),p(e.done)):e.done.length&&!p(e.done).ranges?p(e.done):e.done.length>1&&!e.done[e.done.length-2].ranges?(e.done.pop(),p(e.done)):void 0}function Yn(e,t,r,n){var i=e.history;i.undone.length=0;var o,l,s=+new Date;if((i.lastOp==n||i.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&e.cm&&i.lastModTime>s-e.cm.options.historyEventDelay||"*"==t.origin.charAt(0)))&&(o=Xn(i,i.lastOp==n)))l=p(o.changes),0==E(t.from,t.to)&&0==E(t.from,l.to)?l.to=Dn(t):o.changes.push(Kn(e,t));else{var a=p(i.done);for(a&&a.ranges||qn(e.sel,i.done),o={changes:[Kn(e,t)],generation:i.generation},i.done.push(o);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(r),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=s,i.lastOp=i.lastSelOp=n,i.lastOrigin=i.lastSelOrigin=t.origin,l||We(e,"historyAdded")}function _n(e,t,r,n){var i=t.charAt(0);return"*"==i||"+"==i&&r.ranges.length==n.ranges.length&&r.somethingSelected()==n.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function $n(e,t,r,n){var i=e.history,o=n&&n.origin;r==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||_n(e,o,p(i.done),t))?i.done[i.done.length-1]=t:qn(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=r,n&&n.clearRedo!==!1&&jn(i.undone)}function qn(e,t){var r=p(t);r&&r.ranges&&r.equals(e)||t.push(e)}function Zn(e,t,r,n){var i=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,r),Math.min(e.first+e.size,n),function(r){r.markedSpans&&((i||(i=t["spans_"+e.id]={}))[o]=r.markedSpans),++o})}function Qn(e){if(!e)return null;for(var t,r=0;r<e.length;++r)e[r].marker.explicitlyCleared?t||(t=e.slice(0,r)):t&&t.push(e[r]);return t?t.length?t:null:e}function Jn(e,t){var r=t["spans_"+e.id];if(!r)return null;for(var n=[],i=0;i<t.text.length;++i)n.push(Qn(r[i]));return n}function ei(e,t){var r=Jn(e,t),n=Q(e,t);if(!r)return n;if(!n)return r;for(var i=0;i<r.length;++i){var o=r[i],l=n[i];if(o&&l)e:for(var s=0;s<l.length;++s){for(var a=l[s],u=0;u<o.length;++u)if(o[u].marker==a.marker)continue e;o.push(a)}else l&&(r[i]=l)}return r}function ti(e,t,r){for(var n=[],i=0;i<e.length;++i){var o=e[i];if(o.ranges)n.push(r?rs.prototype.deepCopy.call(o):o);else{var l=o.changes,s=[];n.push({changes:s});for(var a=0;a<l.length;++a){var u=l[a],c=void 0;if(s.push({from:u.from,to:u.to,text:u.text}),t)for(var h in u)(c=h.match(/^spans_(\d+)$/))&&f(t,Number(c[1]))>-1&&(p(s)[h]=u[h],delete u[h])}}}return n}function ri(e,t,r,n){if(e.cm&&e.cm.display.shift||e.extend){var i=t.anchor;if(n){var o=E(r,i)<0;o!=E(n,i)<0?(i=r,r=n):o!=E(r,n)<0&&(r=n)}return new ns(i,r)}return new ns(n||r,r)}function ni(e,t,r,n){ui(e,new rs([ri(e,e.sel.primary(),t,r)],0),n)}function ii(e,t,r){for(var n=[],i=0;i<e.sel.ranges.length;i++)n[i]=ri(e,e.sel.ranges[i],t[i],null);var o=On(n,e.sel.primIndex);ui(e,o,r)}function oi(e,t,r,n){var i=e.sel.ranges.slice(0);i[t]=r,ui(e,On(i,e.sel.primIndex),n)}function li(e,t,r,n){ui(e,An(t,r),n)}function si(e,t,r){var n={ranges:t.ranges,update:function(t){var r=this;this.ranges=[];for(var n=0;n<t.length;n++)r.ranges[n]=new ns(G(e,t[n].anchor),G(e,t[n].head))},origin:r&&r.origin};return We(e,"beforeSelectionChange",e,n),e.cm&&We(e.cm,"beforeSelectionChange",e.cm,n),n.ranges!=t.ranges?On(n.ranges,n.ranges.length-1):t}function ai(e,t,r){var n=e.history.done,i=p(n);i&&i.ranges?(n[n.length-1]=t,ci(e,t,r)):ui(e,t,r)}function ui(e,t,r){ci(e,t,r),$n(e,e.sel,e.cm?e.cm.curOp.id:NaN,r)}function ci(e,t,r){(De(e,"beforeSelectionChange")||e.cm&&De(e.cm,"beforeSelectionChange"))&&(t=si(e,t,r));var n=r&&r.bias||(E(t.primary().head,e.sel.primary().head)<0?-1:1);fi(e,di(e,t,n,!0)),r&&r.scroll===!1||!e.cm||Qr(e.cm)}function fi(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=e.cm.curOp.selectionChanged=!0,Ae(e.cm)),Ct(e,"cursorActivity",e))}function hi(e){fi(e,di(e,e.sel,null,!1),xl)}function di(e,t,r,n){for(var i,o=0;o<t.ranges.length;o++){var l=t.ranges[o],s=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[o],a=gi(e,l.anchor,s&&s.anchor,r,n),u=gi(e,l.head,s&&s.head,r,n);(i||a!=l.anchor||u!=l.head)&&(i||(i=t.ranges.slice(0,o)),i[o]=new ns(a,u))}return i?On(i,t.primIndex):t}function pi(e,t,r,n,i){var o=k(e,t.line);if(o.markedSpans)for(var l=0;l<o.markedSpans.length;++l){var s=o.markedSpans[l],a=s.marker;if((null==s.from||(a.inclusiveLeft?s.from<=t.ch:s.from<t.ch))&&(null==s.to||(a.inclusiveRight?s.to>=t.ch:s.to>t.ch))){if(i&&(We(a,"beforeCursorEnter"),a.explicitlyCleared)){if(o.markedSpans){--l;continue}break}if(!a.atomic)continue;if(r){var u=a.find(n<0?1:-1),c=void 0;if((n<0?a.inclusiveRight:a.inclusiveLeft)&&(u=vi(e,u,-n,u&&u.line==t.line?o:null)),u&&u.line==t.line&&(c=E(u,r))&&(n<0?c<0:c>0))return pi(e,u,t,n,i)}var f=a.find(n<0?-1:1);return(n<0?a.inclusiveLeft:a.inclusiveRight)&&(f=vi(e,f,n,f.line==t.line?o:null)),f?pi(e,f,t,n,i):null}}return t}function gi(e,t,r,n,i){var o=n||1,l=pi(e,t,r,o,i)||!i&&pi(e,t,r,o,!0)||pi(e,t,r,-o,i)||!i&&pi(e,t,r,-o,!0);return l?l:(e.cantEdit=!0,P(e.first,0))}function vi(e,t,r,n){return r<0&&0==t.ch?t.line>e.first?G(e,P(t.line-1)):null:r>0&&t.ch==(n||k(e,t.line)).text.length?t.line<e.first+e.size-1?P(t.line+1,0):null:new P(t.line,t.ch+r)}function mi(e){e.setSelection(P(e.firstLine(),0),P(e.lastLine()),xl)}function yi(e,t,r){var n={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return n.canceled=!0}};return r&&(n.update=function(t,r,i,o){t&&(n.from=G(e,t)),r&&(n.to=G(e,r)),i&&(n.text=i),void 0!==o&&(n.origin=o)}),We(e,"beforeChange",e,n),e.cm&&We(e.cm,"beforeChange",e.cm,n),n.canceled?null:{from:n.from,to:n.to,text:n.text,origin:n.origin}}function bi(e,t,r){if(e.cm){if(!e.cm.curOp)return cn(e.cm,bi)(e,t,r);if(e.cm.state.suppressEdits)return}if(!(De(e,"beforeChange")||e.cm&&De(e.cm,"beforeChange"))||(t=yi(e,t,!0))){var n=Ml&&!r&&ee(e,t.from,t.to);if(n)for(var i=n.length-1;i>=0;--i)wi(e,{from:n[i].from,to:n[i].to,text:i?[""]:t.text});else wi(e,t)}}function wi(e,t){if(1!=t.text.length||""!=t.text[0]||0!=E(t.from,t.to)){var r=Pn(e,t);Yn(e,t,r,e.cm?e.cm.curOp.id:NaN),Si(e,t,r,Q(e,t));var n=[];Gn(e,function(e,r){r||f(n,e.history)!=-1||(Ni(e.history,t),n.push(e.history)),Si(e,t,null,Q(e,t))})}}function xi(e,t,r){if(!e.cm||!e.cm.state.suppressEdits||r){for(var n,i=e.history,o=e.sel,l="undo"==t?i.done:i.undone,s="undo"==t?i.undone:i.done,a=0;a<l.length&&(n=l[a],r?!n.ranges||n.equals(e.sel):n.ranges);a++);if(a!=l.length){for(i.lastOrigin=i.lastSelOrigin=null;n=l.pop(),n.ranges;){if(qn(n,s),r&&!n.equals(e.sel))return void ui(e,n,{clearRedo:!1});o=n}var u=[];qn(o,s),s.push({changes:u,generation:i.generation}),i.generation=n.generation||++i.maxGeneration;for(var c=De(e,"beforeChange")||e.cm&&De(e.cm,"beforeChange"),h=function(r){var i=n.changes[r];if(i.origin=t,c&&!yi(e,i,!1))return l.length=0,{};u.push(Kn(e,i));var o=r?Pn(e,i):p(l);Si(e,i,o,ei(e,i)),!r&&e.cm&&e.cm.scrollIntoView({from:i.from,to:Dn(i)});var s=[];Gn(e,function(e,t){t||f(s,e.history)!=-1||(Ni(e.history,i),s.push(e.history)),Si(e,i,null,ei(e,i))})},d=n.changes.length-1;d>=0;--d){var g=h(d);if(g)return g.v}}}}function Ci(e,t){if(0!=t&&(e.first+=t,e.sel=new rs(g(e.sel.ranges,function(e){return new ns(P(e.anchor.line+t,e.anchor.ch),P(e.head.line+t,e.head.ch))}),e.sel.primIndex),e.cm)){dn(e.cm,e.first,e.first-t,t);for(var r=e.cm.display,n=r.viewFrom;n<r.viewTo;n++)pn(e.cm,n,"gutter")}}function Si(e,t,r,n){if(e.cm&&!e.cm.curOp)return cn(e.cm,Si)(e,t,r,n);if(t.to.line<e.first)return void Ci(e,t.text.length-1-(t.to.line-t.from.line));if(!(t.from.line>e.lastLine())){if(t.from.line<e.first){var i=t.text.length-1-(e.first-t.from.line);Ci(e,i),t={from:P(e.first,0),to:P(t.to.line+i,t.to.ch),text:[p(t.text)],origin:t.origin}}var o=e.lastLine();t.to.line>o&&(t={from:t.from,to:P(o,k(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=M(e,t.from,t.to),r||(r=Pn(e,t)),e.cm?Li(e.cm,t,n):Bn(e,t,n),ci(e,r,xl)}}function Li(e,t,r){var n=e.doc,i=e.display,o=t.from,l=t.to,s=!1,a=o.line;e.options.lineWrapping||(a=O(ce(k(n,o.line))),n.iter(a,l.line+1,function(e){if(e==i.maxLine)return s=!0,!0})),n.sel.contains(t.from,t.to)>-1&&Ae(e),Bn(n,t,r,wr(e)),e.options.lineWrapping||(n.iter(a,o.line+t.text.length,function(e){var t=ye(e);t>i.maxLineLength&&(i.maxLine=e,i.maxLineLength=t,i.maxLineChanged=!0,s=!1)}),s&&(e.curOp.updateMaxLine=!0)),n.frontier=Math.min(n.frontier,o.line),bn(e,400);var u=t.text.length-(l.line-o.line)-1;t.full?dn(e):o.line!=l.line||1!=t.text.length||Rn(e.doc,t)?dn(e,o.line,l.line+1,u):pn(e,o.line,"text");var c=De(e,"changes"),f=De(e,"change");if(f||c){var h={from:o,to:l,text:t.text,removed:t.removed,origin:t.origin};f&&Ct(e,"change",e,h),c&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(h)}e.display.selForContextMenu=null}function Ti(e,t,r,n,i){if(n||(n=r),E(n,r)<0){var o=n;n=r,r=o}"string"==typeof t&&(t=e.splitLines(t)),bi(e,{from:r,to:n,text:t,origin:i})}function ki(e,t,r,n){r<e.line?e.line+=n:t<e.line&&(e.line=t,e.ch=0)}function Mi(e,t,r,n){for(var i=0;i<e.length;++i){var o=e[i],l=!0;if(o.ranges){o.copied||(o=e[i]=o.deepCopy(),o.copied=!0);for(var s=0;s<o.ranges.length;s++)ki(o.ranges[s].anchor,t,r,n),ki(o.ranges[s].head,t,r,n)}else{for(var a=0;a<o.changes.length;++a){var u=o.changes[a];if(r<u.from.line)u.from=P(u.from.line+n,u.from.ch),u.to=P(u.to.line+n,u.to.ch);else if(t<=u.to.line){l=!1;break}}l||(e.splice(0,i+1),i=0)}}}function Ni(e,t){var r=t.from.line,n=t.to.line,i=t.text.length-(n-r)-1;Mi(e.done,r,n,i),Mi(e.undone,r,n,i)}function Wi(e,t,r,n){var i=t,o=t;return"number"==typeof t?o=k(e,B(e,t)):i=O(t),null==i?null:(n(o,i)&&e.cm&&pn(e.cm,i,r),o)}function Oi(e,t,r){me(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Zr(e,null,r)}function Ai(e,t,r,n){var i=new ls(e,r,n),o=e.cm;return o&&i.noHScroll&&(o.display.alignWidgets=!0),Wi(e,t,"widget",function(t){var r=t.widgets||(t.widgets=[]);if(null==i.insertAt?r.push(i):r.splice(Math.min(r.length-1,Math.max(0,i.insertAt)),0,i),i.line=t,o&&!ge(e,t)){var n=me(t)<e.scrollTop;W(t,t.height+It(i)),n&&Zr(o,null,i.height),o.curOp.forceUpdate=!0}return!0}),Ct(o,"lineWidgetAdded",o,i),i}function Di(e,t,r,i,o){if(i&&i.shared)return Hi(e,t,r,i,o);if(e.cm&&!e.cm.curOp)return cn(e.cm,Di)(e,t,r,i,o);var l=new as(e,o),s=E(t,r);if(i&&u(i,l,!1),s>0||0==s&&l.clearWhenEmpty!==!1)return l;if(l.replacedWith&&(l.collapsed=!0,l.widgetNode=n("span",[l.replacedWith],"CodeMirror-widget"),l.widgetNode.setAttribute("role","presentation"),i.handleMouseEvents||l.widgetNode.setAttribute("cm-ignore-events","true"),i.insertLeft&&(l.widgetNode.insertLeft=!0)),l.collapsed){if(ue(e,t.line,t,r,l)||t.line!=r.line&&ue(e,r.line,t,r,l))throw new Error("Inserting collapsed marker partially overlapping an existing one");j()}l.addToHistory&&Yn(e,{from:t,to:r,origin:"markText"},e.sel,NaN);var a,c=t.line,f=e.cm;if(e.iter(c,r.line+1,function(e){f&&l.collapsed&&!f.options.lineWrapping&&ce(e)==f.display.maxLine&&(a=!0),l.collapsed&&c!=t.line&&W(e,0),$(e,new X(l,c==t.line?t.ch:null,c==r.line?r.ch:null)),++c}),l.collapsed&&e.iter(t.line,r.line+1,function(t){ge(e,t)&&W(t,0)}),l.clearOnEnter&&Dl(l,"beforeCursorEnter",function(){return l.clear()}),l.readOnly&&(K(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),l.collapsed&&(l.id=++ss,l.atomic=!0),f){if(a&&(f.curOp.updateMaxLine=!0),l.collapsed)dn(f,t.line,r.line+1);else if(l.className||l.title||l.startStyle||l.endStyle||l.css)for(var h=t.line;h<=r.line;h++)pn(f,h,"text");l.atomic&&hi(f.doc),Ct(f,"markerAdded",f,l)}return l}function Hi(e,t,r,n,i){n=u(n),n.shared=!1;var o=[Di(e,t,r,n,i)],l=o[0],s=n.widgetNode;return Gn(e,function(e){s&&(n.widgetNode=s.cloneNode(!0)),o.push(Di(e,G(e,t),G(e,r),n,i));for(var a=0;a<e.linked.length;++a)if(e.linked[a].isParent)return;l=p(o)}),new us(o,l)}function Pi(e){return e.findMarks(P(e.first,0),e.clipPos(P(e.lastLine())),function(e){return e.parent})}function Ei(e,t){for(var r=0;r<t.length;r++){var n=t[r],i=n.find(),o=e.clipPos(i.from),l=e.clipPos(i.to);if(E(o,l)){var s=Di(e,o,l,n.primary,n.primary.type);n.markers.push(s),s.parent=n}}}function Ii(e){for(var t=function(t){var r=e[t],n=[r.primary.doc];Gn(r.primary.doc,function(e){return n.push(e)});for(var i=0;i<r.markers.length;i++){var o=r.markers[i];f(n,o.doc)==-1&&(o.parent=null,r.markers.splice(i--,1))}},r=0;r<e.length;r++)t(r)}function zi(e){var t=this;if(Bi(t),!Oe(t,e)&&!zt(t.display,e)){Pe(e),qo&&(hs=+new Date);var r=Cr(t,e,!0),n=e.dataTransfer.files;if(r&&!t.isReadOnly())if(n&&n.length&&window.FileReader&&window.File)for(var i=n.length,o=Array(i),l=0,s=function(e,n){if(!t.options.allowDropFileTypes||f(t.options.allowDropFileTypes,e.type)!=-1){var s=new FileReader;s.onload=cn(t,function(){var e=s.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(e)&&(e=""),o[n]=e,++l==i){r=G(t.doc,r);var a={from:r,to:r,text:t.doc.splitLines(o.join(t.doc.lineSeparator())),origin:"paste"};bi(t.doc,a),ai(t.doc,An(r,Dn(a)))}}),s.readAsText(e)}},a=0;a<i;++a)s(n[a],a);else{if(t.state.draggingText&&t.doc.sel.contains(r)>-1)return t.state.draggingText(e),void setTimeout(function(){return t.display.input.focus()},20);try{var u=e.dataTransfer.getData("Text");if(u){var c;if(t.state.draggingText&&!t.state.draggingText.copy&&(c=t.listSelections()),ci(t.doc,An(r,r)),c)for(var h=0;h<c.length;++h)Ti(t.doc,"",c[h].anchor,c[h].head,"drag");t.replaceSelection(u,"around","paste"),t.display.input.focus()}}catch(e){}}}}function Fi(e,t){if(qo&&(!e.state.draggingText||+new Date-hs<100))return void ze(t);if(!Oe(e,t)&&!zt(e.display,t)&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!rl)){var r=n("img",null,null,"position: fixed; left: 0; top: 0;");r.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",tl&&(r.width=r.height=1,e.display.wrapper.appendChild(r),r._top=r.offsetTop),t.dataTransfer.setDragImage(r,0,0),tl&&r.parentNode.removeChild(r)}}function Ri(e,t){var i=Cr(e,t);if(i){var o=document.createDocumentFragment();kr(e,i,o),e.display.dragCursor||(e.display.dragCursor=n("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),r(e.display.dragCursor,o)}}function Bi(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Gi(e){if(document.body.getElementsByClassName)for(var t=document.body.getElementsByClassName("CodeMirror"),r=0;r<t.length;r++){var n=t[r].CodeMirror;n&&e(n)}}function Ui(){ds||(Vi(),ds=!0)}function Vi(){var e;Dl(window,"resize",function(){null==e&&(e=setTimeout(function(){e=null,Gi(Ki)},100))}),Dl(window,"blur",function(){return Gi(Dr)})}function Ki(e){var t=e.display;t.lastWrapHeight==t.wrapper.clientHeight&&t.lastWrapWidth==t.wrapper.clientWidth||(t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize())}function ji(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var r,n,i,o,l=0;l<t.length-1;l++){var s=t[l];if(/^(cmd|meta|m)$/i.test(s))o=!0;else if(/^a(lt)?$/i.test(s))r=!0;else if(/^(c|ctrl|control)$/i.test(s))n=!0;else{if(!/^s(hift)?$/i.test(s))throw new Error("Unrecognized modifier name: "+s);i=!0}}return r&&(e="Alt-"+e),n&&(e="Ctrl-"+e),o&&(e="Cmd-"+e),i&&(e="Shift-"+e),e}function Xi(e){var t={};for(var r in e)if(e.hasOwnProperty(r)){var n=e[r];if(/^(name|fallthrough|(de|at)tach)$/.test(r))continue;if("..."==n){delete e[r];continue}for(var i=g(r.split(" "),ji),o=0;o<i.length;o++){var l=void 0,s=void 0;o==i.length-1?(s=i.join(" "),l=n):(s=i.slice(0,o+1).join(" "),l="...");var a=t[s];if(a){if(a!=l)throw new Error("Inconsistent bindings for "+s)}else t[s]=l}delete e[r]}for(var u in t)e[u]=t[u];return e}function Yi(e,t,r,n){t=qi(t);var i=t.call?t.call(e,n):t[e];if(i===!1)return"nothing";if("..."===i)return"multi";if(null!=i&&r(i))return"handled";if(t.fallthrough){if("[object Array]"!=Object.prototype.toString.call(t.fallthrough))return Yi(e,t.fallthrough,r,n);for(var o=0;o<t.fallthrough.length;o++){var l=Yi(e,t.fallthrough[o],r,n);if(l)return l}}}function _i(e){var t="string"==typeof e?e:ps[e.keyCode];return"Ctrl"==t||"Alt"==t||"Shift"==t||"Mod"==t}function $i(e,t){if(tl&&34==e.keyCode&&e.char)return!1;var r=ps[e.keyCode],n=r;return null!=n&&!e.altGraphKey&&(e.altKey&&"Alt"!=r&&(n="Alt-"+n),(hl?e.metaKey:e.ctrlKey)&&"Ctrl"!=r&&(n="Ctrl-"+n),(hl?e.ctrlKey:e.metaKey)&&"Cmd"!=r&&(n="Cmd-"+n),!t&&e.shiftKey&&"Shift"!=r&&(n="Shift-"+n),n)}function qi(e){return"string"==typeof e?ys[e]:e}function Zi(e,t){for(var r=e.doc.sel.ranges,n=[],i=0;i<r.length;i++){for(var o=t(r[i]);n.length&&E(o.from,p(n).to)<=0;){var l=n.pop();if(E(l.from,o.from)<0){o.from=l.from;break}}n.push(o)}un(e,function(){for(var t=n.length-1;t>=0;t--)Ti(e.doc,"",n[t].from,n[t].to,"+delete");Qr(e)})}function Qi(e,t){var r=k(e.doc,t),n=ce(r);return n!=r&&(t=O(n)),Te(!0,e,n,t,1)}function Ji(e,t){var r=k(e.doc,t),n=fe(r);return n!=r&&(t=O(n)),Te(!0,e,r,t,-1)}function eo(e,t){var r=Qi(e,t.line),n=k(e.doc,r.line),i=Ce(n);if(!i||0==i[0].level){var o=Math.max(0,n.text.search(/\S/)),l=t.line==r.line&&t.ch<=o&&t.ch;return P(r.line,l?0:o,r.sticky)}return r}function to(e,t,r){if("string"==typeof t&&(t=xs[t],!t))return!1;e.display.input.ensurePolled();var n=e.display.shift,i=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),r&&(e.display.shift=!1),i=t(e)!=wl}finally{e.display.shift=n,e.state.suppressEdits=!1}return i}function ro(e,t,r){for(var n=0;n<e.state.keyMaps.length;n++){var i=Yi(t,e.state.keyMaps[n],r,e);if(i)return i}return e.options.extraKeys&&Yi(t,e.options.extraKeys,r,e)||Yi(t,e.options.keyMap,r,e)}function no(e,t,r,n){var i=e.state.keySeq;if(i){if(_i(t))return"handled";Cs.set(50,function(){e.state.keySeq==i&&(e.state.keySeq=null,e.display.input.reset())}),t=i+" "+t}var o=ro(e,t,n);return"multi"==o&&(e.state.keySeq=t),"handled"==o&&Ct(e,"keyHandled",e,t,r),"handled"!=o&&"multi"!=o||(Pe(r),Nr(e)),i&&!o&&/\'$/.test(t)?(Pe(r),!0):!!o}function io(e,t){var r=$i(t,!0);return!!r&&(t.shiftKey&&!e.state.keySeq?no(e,"Shift-"+r,t,function(t){return to(e,t,!0)})||no(e,r,t,function(t){if("string"==typeof t?/^go[A-Z]/.test(t):t.motion)return to(e,t)}):no(e,r,t,function(t){return to(e,t)}))}function oo(e,t,r){return no(e,"'"+r+"'",t,function(t){return to(e,t,!0)})}function lo(e){var t=this;if(t.curOp.focus=o(),!Oe(t,e)){qo&&Zo<11&&27==e.keyCode&&(e.returnValue=!1);var r=e.keyCode;t.display.shift=16==r||e.shiftKey;var n=io(t,e);tl&&(Ss=n?r:null,!n&&88==r&&!Il&&(sl?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),18!=r||/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)||so(t)}}function so(e){function t(e){18!=e.keyCode&&e.altKey||(pl(r,"CodeMirror-crosshair"),Ne(document,"keyup",t),Ne(document,"mouseover",t))}var r=e.display.lineDiv;l(r,"CodeMirror-crosshair"),Dl(document,"keyup",t),Dl(document,"mouseover",t)}function ao(e){16==e.keyCode&&(this.doc.sel.shift=!1),Oe(this,e)}function uo(e){var t=this;if(!(zt(t.display,e)||Oe(t,e)||e.ctrlKey&&!e.altKey||sl&&e.metaKey)){var r=e.keyCode,n=e.charCode;if(tl&&r==Ss)return Ss=null,void Pe(e);if(!tl||e.which&&!(e.which<10)||!io(t,e)){var i=String.fromCharCode(null==n?r:n);"\b"!=i&&(oo(t,e,i)||t.display.input.onKeyPress(e))}}}function co(e){var t=this,r=t.display;if(!(Oe(t,e)||r.activeTouch&&r.input.supportsTouch())){if(r.input.ensurePolled(),r.shift=e.shiftKey,zt(r,e))return void(Qo||(r.scroller.draggable=!1,setTimeout(function(){return r.scroller.draggable=!0},100)));if(!vo(t,e)){var n=Cr(t,e);switch(window.focus(),Re(e)){case 1:t.state.selectingText?t.state.selectingText(e):n?fo(t,e,n):Fe(e)==r.scroller&&Pe(e);break;case 2:Qo&&(t.state.lastMiddleDown=+new Date),n&&ni(t.doc,n),setTimeout(function(){return r.input.focus()},20),Pe(e);break;case 3:dl?mo(t,e):Or(t)}}}}function fo(e,t,r){qo?setTimeout(a(Wr,e),0):e.curOp.focus=o();var n,i=+new Date;ws&&ws.time>i-400&&0==E(ws.pos,r)?n="triple":bs&&bs.time>i-400&&0==E(bs.pos,r)?(n="double",ws={time:i,pos:r}):(n="single",bs={time:i,pos:r});var l,s=e.doc.sel,u=sl?t.metaKey:t.ctrlKey;e.options.dragDrop&&Hl&&!e.isReadOnly()&&"single"==n&&(l=s.contains(r))>-1&&(E((l=s.ranges[l]).from(),r)<0||r.xRel>0)&&(E(l.to(),r)>0||r.xRel<0)?ho(e,t,r,u):po(e,t,r,n,u)}function ho(e,t,r,n){var i=e.display,o=+new Date,l=cn(e,function(s){Qo&&(i.scroller.draggable=!1),e.state.draggingText=!1,Ne(document,"mouseup",l),Ne(i.scroller,"drop",l),Math.abs(t.clientX-s.clientX)+Math.abs(t.clientY-s.clientY)<10&&(Pe(s),!n&&+new Date-200<o&&ni(e.doc,r),Qo||qo&&9==Zo?setTimeout(function(){document.body.focus(),i.input.focus()},20):i.input.focus())});Qo&&(i.scroller.draggable=!0),e.state.draggingText=l,l.copy=sl?t.altKey:t.ctrlKey,i.scroller.dragDrop&&i.scroller.dragDrop(),Dl(document,"mouseup",l),Dl(i.scroller,"drop",l)}function po(e,t,r,n,i){function l(t){if(0!=E(b,t))if(b=t,"rect"==n){for(var i=[],o=e.options.tabSize,l=c(k(f,r.line).text,r.ch,o),s=c(k(f,t.line).text,t.ch,o),a=Math.min(l,s),u=Math.max(l,s),v=Math.min(r.line,t.line),m=Math.min(e.lastLine(),Math.max(r.line,t.line));v<=m;v++){var y=k(f,v).text,w=h(y,a,o);a==u?i.push(new ns(P(v,w),P(v,w))):y.length>w&&i.push(new ns(P(v,w),P(v,h(y,u,o))))}i.length||i.push(new ns(r,r)),ui(f,On(g.ranges.slice(0,p).concat(i),p),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var x=d,C=x.anchor,S=t;if("single"!=n){var L;L="double"==n?e.findWordAt(t):new ns(P(t.line,0),G(f,P(t.line+1,0))),E(L.anchor,C)>0?(S=L.head,C=R(x.from(),L.anchor)):(S=L.anchor,C=F(x.to(),L.head))}var T=g.ranges.slice(0);T[p]=new ns(G(f,C),S),ui(f,On(T,p),Cl)}}function s(t){var r=++x,i=Cr(e,t,!0,"rect"==n);if(i)if(0!=E(i,b)){e.curOp.focus=o(),l(i);var a=zr(u,f);(i.line>=a.to||i.line<a.from)&&setTimeout(cn(e,function(){x==r&&s(t)}),150)}else{var c=t.clientY<w.top?-20:t.clientY>w.bottom?20:0;c&&setTimeout(cn(e,function(){x==r&&(u.scroller.scrollTop+=c,s(t))}),50)}}function a(t){e.state.selectingText=!1,x=1/0,Pe(t),u.input.focus(),Ne(document,"mousemove",C),Ne(document,"mouseup",S),f.history.lastSelOrigin=null}var u=e.display,f=e.doc;Pe(t);var d,p,g=f.sel,v=g.ranges;if(i&&!t.shiftKey?(p=f.sel.contains(r),d=p>-1?v[p]:new ns(r,r)):(d=f.sel.primary(),p=f.sel.primIndex),al?t.shiftKey&&t.metaKey:t.altKey)n="rect",i||(d=new ns(r,r)),r=Cr(e,t,!0,!0),p=-1;else if("double"==n){var m=e.findWordAt(r);d=e.display.shift||f.extend?ri(f,d,m.anchor,m.head):m}else if("triple"==n){var y=new ns(P(r.line,0),G(f,P(r.line+1,0)));d=e.display.shift||f.extend?ri(f,d,y.anchor,y.head):y}else d=ri(f,d,r);i?p==-1?(p=v.length,ui(f,On(v.concat([d]),p),{scroll:!1,origin:"*mouse"})):v.length>1&&v[p].empty()&&"single"==n&&!t.shiftKey?(ui(f,On(v.slice(0,p).concat(v.slice(p+1)),0),{scroll:!1,origin:"*mouse"}),g=f.sel):oi(f,p,d,Cl):(p=0,ui(f,new rs([d],0),Cl),g=f.sel);var b=r,w=u.wrapper.getBoundingClientRect(),x=0,C=cn(e,function(e){Re(e)?s(e):a(e)}),S=cn(e,a);e.state.selectingText=S,Dl(document,"mousemove",C),Dl(document,"mouseup",S)}function go(e,t,r,n){var i,o;try{i=t.clientX,o=t.clientY}catch(e){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;n&&Pe(t);var l=e.display,s=l.lineDiv.getBoundingClientRect();if(o>s.bottom||!De(e,r))return Ie(t);o-=s.top-l.viewOffset;for(var a=0;a<e.options.gutters.length;++a){var u=l.gutters.childNodes[a];if(u&&u.getBoundingClientRect().right>=i){var c=A(e.doc,o),f=e.options.gutters[a];return We(e,r,e,c,f,t),Ie(t)}}}function vo(e,t){return go(e,t,"gutterClick",!0)}function mo(e,t){zt(e.display,t)||yo(e,t)||Oe(e,t,"contextmenu")||e.display.input.onContextMenu(t)}function yo(e,t){return!!De(e,"gutterContextMenu")&&go(e,t,"gutterContextMenu",!1)}function bo(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),nr(e)}function wo(e){function t(t,n,i,o){e.defaults[t]=n,i&&(r[t]=o?function(e,t,r){r!=Ls&&i(e,t,r)}:i)}var r=e.optionHandlers;e.defineOption=t,e.Init=Ls,t("value","",function(e,t){return e.setValue(t)},!0),t("mode",null,function(e,t){e.doc.modeOption=t,zn(e)},!0),t("indentUnit",2,zn,!0),t("indentWithTabs",!1),t("smartIndent",!0),t("tabSize",4,function(e){Fn(e),nr(e),dn(e)},!0),t("lineSeparator",null,function(e,t){if(e.doc.lineSep=t,t){var r=[],n=e.doc.first;e.doc.iter(function(e){for(var i=0;;){var o=e.text.indexOf(t,i);if(o==-1)break;i=o+t.length,r.push(P(n,o))}n++});for(var i=r.length-1;i>=0;i--)Ti(e.doc,t,r[i],P(r[i].line,r[i].ch+t.length))}}),t("specialChars",/[\u0000-\u001f\u007f\u00ad\u061c\u200b-\u200f\u2028\u2029\ufeff]/g,function(e,t,r){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),r!=Ls&&e.refresh()}),t("specialCharPlaceholder",ft,function(e){return e.refresh()},!0),t("electricChars",!0),t("inputStyle",ll?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),t("spellcheck",!1,function(e,t){return e.getInputField().spellcheck=t},!0),t("rtlMoveVisually",!ul),t("wholeLineUpdateBefore",!0),t("theme","default",function(e){bo(e),xo(e)},!0),t("keyMap","default",function(e,t,r){var n=qi(t),i=r!=Ls&&qi(r);i&&i.detach&&i.detach(e,n),n.attach&&n.attach(e,i||null)}),t("extraKeys",null),t("lineWrapping",!1,So,!0),t("gutters",[],function(e){Wn(e.options),xo(e)},!0),t("fixedGutter",!0,function(e,t){e.display.gutters.style.left=t?br(e.display)+"px":"0",e.refresh()},!0),t("coverGutterNextToScrollbar",!1,function(e){return Kr(e)},!0),t("scrollbarStyle","native",function(e){Xr(e),Kr(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)},!0),t("lineNumbers",!1,function(e){Wn(e.options),xo(e)},!0),t("firstLineNumber",1,xo,!0),t("lineNumberFormatter",function(e){return e},xo,!0),t("showCursorWhenSelecting",!1,Lr,!0),t("resetSelectionOnContextMenu",!0),t("lineWiseCopyCut",!0),t("readOnly",!1,function(e,t){"nocursor"==t?(Dr(e),e.display.input.blur(),e.display.disabled=!0):e.display.disabled=!1,e.display.input.readOnlyChanged(t)}),t("disableInput",!1,function(e,t){t||e.display.input.reset()},!0),t("dragDrop",!0,Co),t("allowDropFileTypes",null),t("cursorBlinkRate",530),t("cursorScrollMargin",0),t("cursorHeight",1,Lr,!0),t("singleCursorHeightPerLine",!0,Lr,!0),t("workTime",100),t("workDelay",100),t("flattenSpans",!0,Fn,!0),t("addModeClass",!1,Fn,!0),t("pollInterval",100),t("undoDepth",200,function(e,t){return e.doc.history.undoDepth=t}),t("historyEventDelay",1250),t("viewportMargin",10,function(e){return e.refresh()},!0),t("maxHighlightLength",1e4,Fn,!0),t("moveInputWithCursor",!0,function(e,t){t||e.display.input.resetPosition()}),t("tabindex",null,function(e,t){return e.display.input.getField().tabIndex=t||""}),t("autofocus",null)}function xo(e){Nn(e),dn(e),Hr(e)}function Co(e,t,r){var n=r&&r!=Ls;if(!t!=!n){var i=e.display.dragFunctions,o=t?Dl:Ne;o(e.display.scroller,"dragstart",i.start),o(e.display.scroller,"dragenter",i.enter),o(e.display.scroller,"dragover",i.over),o(e.display.scroller,"dragleave",i.leave),o(e.display.scroller,"drop",i.drop)}}function So(e){e.options.lineWrapping?(l(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(pl(e.display.wrapper,"CodeMirror-wrap"),be(e)),xr(e),dn(e),nr(e),setTimeout(function(){return Kr(e)},100)}function Lo(e,t){var r=this;if(!(this instanceof Lo))return new Lo(e,t);this.options=t=t?u(t):{},u(Ts,t,!1),Wn(t);var n=t.value;"string"==typeof n&&(n=new fs(n,t.mode,null,t.lineSeparator)),this.doc=n;var i=new Lo.inputStyles[t.inputStyle](this),o=this.display=new T(e,n,i);o.wrapper.CodeMirror=this,Nn(this),bo(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Xr(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:!1,cutIncoming:!1,selectingText:!1,draggingText:!1,highlight:new vl,keySeq:null,specialChars:null},t.autofocus&&!ll&&o.input.focus(),qo&&Zo<11&&setTimeout(function(){return r.display.input.reset(!0)},20),To(this),Ui(),en(this),this.curOp.forceUpdate=!0,Un(this,n),t.autofocus&&!ll||this.hasFocus()?setTimeout(a(Ar,this),20):Dr(this);for(var l in ks)ks.hasOwnProperty(l)&&ks[l](r,t[l],Ls);Pr(this),t.finishInit&&t.finishInit(this);for(var s=0;s<Ms.length;++s)Ms[s](r);tn(this),Qo&&t.lineWrapping&&"optimizelegibility"==getComputedStyle(o.lineDiv).textRendering&&(o.lineDiv.style.textRendering="auto")}function To(e){function t(){i.activeTouch&&(o=setTimeout(function(){return i.activeTouch=null},1e3),l=i.activeTouch,l.end=+new Date)}function r(e){if(1!=e.touches.length)return!1;var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}function n(e,t){if(null==t.left)return!0;var r=t.left-e.left,n=t.top-e.top;return r*r+n*n>400}var i=e.display;Dl(i.scroller,"mousedown",cn(e,co)),qo&&Zo<11?Dl(i.scroller,"dblclick",cn(e,function(t){if(!Oe(e,t)){var r=Cr(e,t);if(r&&!vo(e,t)&&!zt(e.display,t)){Pe(t);var n=e.findWordAt(r);ni(e.doc,n.anchor,n.head)}}})):Dl(i.scroller,"dblclick",function(t){return Oe(e,t)||Pe(t)}),dl||Dl(i.scroller,"contextmenu",function(t){return mo(e,t)});var o,l={end:0};Dl(i.scroller,"touchstart",function(t){if(!Oe(e,t)&&!r(t)){i.input.ensurePolled(),clearTimeout(o);var n=+new Date;i.activeTouch={start:n,moved:!1,prev:n-l.end<=300?l:null},1==t.touches.length&&(i.activeTouch.left=t.touches[0].pageX,i.activeTouch.top=t.touches[0].pageY)}}),Dl(i.scroller,"touchmove",function(){i.activeTouch&&(i.activeTouch.moved=!0)}),Dl(i.scroller,"touchend",function(r){var o=i.activeTouch;if(o&&!zt(i,r)&&null!=o.left&&!o.moved&&new Date-o.start<300){var l,s=e.coordsChar(i.activeTouch,"page");l=!o.prev||n(o,o.prev)?new ns(s,s):!o.prev.prev||n(o,o.prev.prev)?e.findWordAt(s):new ns(P(s.line,0),G(e.doc,P(s.line+1,0))),e.setSelection(l.anchor,l.head),e.focus(),Pe(r)}t()}),Dl(i.scroller,"touchcancel",t),Dl(i.scroller,"scroll",function(){i.scroller.clientHeight&&(Fr(e,i.scroller.scrollTop),Rr(e,i.scroller.scrollLeft,!0),We(e,"scroll",e))}),Dl(i.scroller,"mousewheel",function(t){return Ur(e,t)}),Dl(i.scroller,"DOMMouseScroll",function(t){return Ur(e,t)}),Dl(i.wrapper,"scroll",function(){return i.wrapper.scrollTop=i.wrapper.scrollLeft=0}),i.dragFunctions={enter:function(t){Oe(e,t)||ze(t)},over:function(t){Oe(e,t)||(Ri(e,t),ze(t))},start:function(t){return Fi(e,t)},drop:cn(e,zi),leave:function(t){Oe(e,t)||Bi(e)}};var s=i.input.getField();Dl(s,"keyup",function(t){return ao.call(e,t)}),Dl(s,"keydown",cn(e,lo)),Dl(s,"keypress",cn(e,uo)),Dl(s,"focus",function(t){return Ar(e,t)}),Dl(s,"blur",function(t){return Dr(e,t)})}function ko(e,t,r,n){var i,o=e.doc;null==r&&(r="add"),"smart"==r&&(o.mode.indent?i=Je(e,t):r="prev");var l=e.options.tabSize,s=k(o,t),a=c(s.text,null,l);s.stateAfter&&(s.stateAfter=null);var u,f=s.text.match(/^\s*/)[0];if(n||/\S/.test(s.text)){if("smart"==r&&(u=o.mode.indent(i,s.text.slice(f.length),s.text),u==wl||u>150)){if(!n)return;r="prev"}}else u=0,r="not";"prev"==r?u=t>o.first?c(k(o,t-1).text,null,l):0:"add"==r?u=a+e.options.indentUnit:"subtract"==r?u=a-e.options.indentUnit:"number"==typeof r&&(u=a+r),u=Math.max(0,u);var h="",p=0;if(e.options.indentWithTabs)for(var g=Math.floor(u/l);g;--g)p+=l,h+="\t";if(p<u&&(h+=d(u-p)),h!=f)return Ti(o,h,P(t,0),P(t,f.length),"+input"),s.stateAfter=null,!0;for(var v=0;v<o.sel.ranges.length;v++){var m=o.sel.ranges[v];if(m.head.line==t&&m.head.ch<f.length){var y=P(t,f.length);
+oi(o,v,new ns(y,y));break}}}function Mo(e){Ns=e}function No(e,t,r,n,i){var o=e.doc;e.display.shift=!1,n||(n=o.sel);var l=e.state.pasteIncoming||"paste"==i,s=Pl(t),a=null;if(l&&n.ranges.length>1)if(Ns&&Ns.text.join("\n")==t){if(n.ranges.length%Ns.text.length==0){a=[];for(var u=0;u<Ns.text.length;u++)a.push(o.splitLines(Ns.text[u]))}}else s.length==n.ranges.length&&(a=g(s,function(e){return[e]}));for(var c,f=n.ranges.length-1;f>=0;f--){var h=n.ranges[f],d=h.from(),v=h.to();h.empty()&&(r&&r>0?d=P(d.line,d.ch-r):e.state.overwrite&&!l?v=P(v.line,Math.min(k(o,v.line).text.length,v.ch+p(s).length)):Ns&&Ns.lineWise&&Ns.text.join("\n")==t&&(d=v=P(d.line,0))),c=e.curOp.updateInput;var m={from:d,to:v,text:a?a[f%a.length]:s,origin:i||(l?"paste":e.state.cutIncoming?"cut":"+input")};bi(e.doc,m),Ct(e,"inputRead",e,m)}t&&!l&&Oo(e,t),Qr(e),e.curOp.updateInput=c,e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=!1}function Wo(e,t){var r=e.clipboardData&&e.clipboardData.getData("Text");if(r)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||un(t,function(){return No(t,r,0,null,"paste")}),!0}function Oo(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var r=e.doc.sel,n=r.ranges.length-1;n>=0;n--){var i=r.ranges[n];if(!(i.head.ch>100||n&&r.ranges[n-1].head.line==i.head.line)){var o=e.getModeAt(i.head),l=!1;if(o.electricChars){for(var s=0;s<o.electricChars.length;s++)if(t.indexOf(o.electricChars.charAt(s))>-1){l=ko(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(k(e.doc,i.head.line).text.slice(0,i.head.ch))&&(l=ko(e,i.head.line,"smart"));l&&Ct(e,"electricInput",e,i.head.line)}}}function Ao(e){for(var t=[],r=[],n=0;n<e.doc.sel.ranges.length;n++){var i=e.doc.sel.ranges[n].head.line,o={anchor:P(i,0),head:P(i+1,0)};r.push(o),t.push(e.getRange(o.anchor,o.head))}return{text:t,ranges:r}}function Do(e,t){e.setAttribute("autocorrect","off"),e.setAttribute("autocapitalize","off"),e.setAttribute("spellcheck",!!t)}function Ho(){var e=n("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=n("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return Qo?e.style.width="1000px":e.setAttribute("wrap","off"),ol&&(e.style.border="1px solid black"),Do(e),t}function Po(e){var t=e.optionHandlers,r=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(e,r){var n=this.options,i=n[e];n[e]==r&&"mode"!=e||(n[e]=r,t.hasOwnProperty(e)&&cn(this,t[e])(this,r,i),We(this,"optionChange",this,e))},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?"push":"unshift"](qi(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,r=0;r<t.length;++r)if(t[r]==e||t[r].name==e)return t.splice(r,1),!0},addOverlay:fn(function(t,r){var n=t.token?t:e.getMode(this.options,t);if(n.startState)throw new Error("Overlays may not be stateful.");v(this.state.overlays,{mode:n,modeSpec:t,opaque:r&&r.opaque,priority:r&&r.priority||0},function(e){return e.priority}),this.state.modeGen++,dn(this)}),removeOverlay:fn(function(e){for(var t=this,r=this.state.overlays,n=0;n<r.length;++n){var i=r[n].modeSpec;if(i==e||"string"==typeof e&&i.name==e)return r.splice(n,1),t.state.modeGen++,void dn(t)}}),indentLine:fn(function(e,t,r){"string"!=typeof t&&"number"!=typeof t&&(t=null==t?this.options.smartIndent?"smart":"prev":t?"add":"subtract"),D(this.doc,e)&&ko(this,e,t,r)}),indentSelection:fn(function(e){for(var t=this,r=this.doc.sel.ranges,n=-1,i=0;i<r.length;i++){var o=r[i];if(o.empty())o.head.line>n&&(ko(t,o.head.line,e,!0),n=o.head.line,i==t.doc.sel.primIndex&&Qr(t));else{var l=o.from(),s=o.to(),a=Math.max(n,l.line);n=Math.min(t.lastLine(),s.line-(s.ch?0:1))+1;for(var u=a;u<n;++u)ko(t,u,e);var c=t.doc.sel.ranges;0==l.ch&&r.length==c.length&&c[i].from().ch>0&&oi(t.doc,i,new ns(l,c[i].to()),xl)}}}),getTokenAt:function(e,t){return nt(this,e,t)},getLineTokens:function(e,t){return nt(this,P(e),t,!0)},getTokenTypeAt:function(e){e=G(this.doc,e);var t,r=Qe(this,k(this.doc,e.line)),n=0,i=(r.length-1)/2,o=e.ch;if(0==o)t=r[2];else for(;;){var l=n+i>>1;if((l?r[2*l-1]:0)>=o)i=l;else{if(!(r[2*l+1]<o)){t=r[2*l+2];break}n=l+1}}var s=t?t.indexOf("overlay "):-1;return s<0?t:0==s?null:t.slice(0,s-1)},getModeAt:function(t){var r=this.doc.mode;return r.innerMode?e.innerMode(r,this.getTokenAt(t).state).mode:r},getHelper:function(e,t){return this.getHelpers(e,t)[0]},getHelpers:function(e,t){var n=this,i=[];if(!r.hasOwnProperty(t))return i;var o=r[t],l=this.getModeAt(e);if("string"==typeof l[t])o[l[t]]&&i.push(o[l[t]]);else if(l[t])for(var s=0;s<l[t].length;s++){var a=o[l[t][s]];a&&i.push(a)}else l.helperType&&o[l.helperType]?i.push(o[l.helperType]):o[l.name]&&i.push(o[l.name]);for(var u=0;u<o._global.length;u++){var c=o._global[u];c.pred(l,n)&&f(i,c.val)==-1&&i.push(c.val)}return i},getStateAfter:function(e,t){var r=this.doc;return e=B(r,null==e?r.first+r.size-1:e),Je(this,e+1,t)},cursorCoords:function(e,t){var r,n=this.doc.sel.primary();return r=null==e?n.head:"object"==typeof e?G(this.doc,e):e?n.from():n.to(),ur(this,r,t||"page")},charCoords:function(e,t){return ar(this,G(this.doc,e),t||"page")},coordsChar:function(e,t){return e=sr(this,e,t||"page"),hr(this,e.left,e.top)},lineAtHeight:function(e,t){return e=sr(this,{top:e,left:0},t||"page").top,A(this.doc,e+this.display.viewOffset)},heightAtLine:function(e,t,r){var n,i=!1;if("number"==typeof e){var o=this.doc.first+this.doc.size-1;e<this.doc.first?e=this.doc.first:e>o&&(e=o,i=!0),n=k(this.doc,e)}else n=e;return lr(this,n,{top:0,left:0},t||"page",r||i).top+(i?this.doc.height-me(n):0)},defaultTextHeight:function(){return vr(this.display)},defaultCharWidth:function(){return mr(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,r,n,i){var o=this.display;e=ur(this,G(this.doc,e));var l=e.bottom,s=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),o.sizer.appendChild(t),"over"==n)l=e.top;else if("above"==n||"near"==n){var a=Math.max(o.wrapper.clientHeight,this.doc.height),u=Math.max(o.sizer.clientWidth,o.lineSpace.clientWidth);("above"==n||e.bottom+t.offsetHeight>a)&&e.top>t.offsetHeight?l=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=a&&(l=e.bottom),s+t.offsetWidth>u&&(s=u-t.offsetWidth)}t.style.top=l+"px",t.style.left=t.style.right="","right"==i?(s=o.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?s=0:"middle"==i&&(s=(o.sizer.clientWidth-t.offsetWidth)/2),t.style.left=s+"px"),r&&$r(this,s,l,s+t.offsetWidth,l+t.offsetHeight)},triggerOnKeyDown:fn(lo),triggerOnKeyPress:fn(uo),triggerOnKeyUp:ao,execCommand:function(e){if(xs.hasOwnProperty(e))return xs[e].call(null,this)},triggerElectric:fn(function(e){Oo(this,e)}),findPosH:function(e,t,r,n){var i=this,o=1;t<0&&(o=-1,t=-t);for(var l=G(this.doc,e),s=0;s<t&&(l=Eo(i.doc,l,o,r,n),!l.hitSide);++s);return l},moveH:fn(function(e,t){var r=this;this.extendSelectionsBy(function(n){return r.display.shift||r.doc.extend||n.empty()?Eo(r.doc,n.head,e,t,r.options.rtlMoveVisually):e<0?n.from():n.to()},Sl)}),deleteH:fn(function(e,t){var r=this.doc.sel,n=this.doc;r.somethingSelected()?n.replaceSelection("",null,"+delete"):Zi(this,function(r){var i=Eo(n,r.head,e,t,!1);return e<0?{from:i,to:r.head}:{from:r.head,to:i}})}),findPosV:function(e,t,r,n){var i=this,o=1,l=n;t<0&&(o=-1,t=-t);for(var s=G(this.doc,e),a=0;a<t;++a){var u=ur(i,s,"div");if(null==l?l=u.left:u.left=l,s=Io(i,u,o,r),s.hitSide)break}return s},moveV:fn(function(e,t){var r=this,n=this.doc,i=[],o=!this.display.shift&&!n.extend&&n.sel.somethingSelected();if(n.extendSelectionsBy(function(l){if(o)return e<0?l.from():l.to();var s=ur(r,l.head,"div");null!=l.goalColumn&&(s.left=l.goalColumn),i.push(s.left);var a=Io(r,s,e,t);return"page"==t&&l==n.sel.primary()&&Zr(r,null,ar(r,a,"div").top-s.top),a},Sl),i.length)for(var l=0;l<n.sel.ranges.length;l++)n.sel.ranges[l].goalColumn=i[l]}),findWordAt:function(e){var t=this.doc,r=k(t,e.line).text,n=e.ch,i=e.ch;if(r){var o=this.getHelper(e,"wordChars");"before"!=e.sticky&&i!=r.length||!n?++i:--n;for(var l=r.charAt(n),s=w(l,o)?function(e){return w(e,o)}:/\s/.test(l)?function(e){return/\s/.test(e)}:function(e){return!/\s/.test(e)&&!w(e)};n>0&&s(r.charAt(n-1));)--n;for(;i<r.length&&s(r.charAt(i));)++i}return new ns(P(e.line,n),P(e.line,i))},toggleOverwrite:function(e){null!=e&&e==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?l(this.display.cursorDiv,"CodeMirror-overwrite"):pl(this.display.cursorDiv,"CodeMirror-overwrite"),We(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==o()},isReadOnly:function(){return!(!this.options.readOnly&&!this.doc.cantEdit)},scrollTo:fn(function(e,t){null==e&&null==t||Jr(this),null!=e&&(this.curOp.scrollLeft=e),null!=t&&(this.curOp.scrollTop=t)}),getScrollInfo:function(){var e=this.display.scroller;return{left:e.scrollLeft,top:e.scrollTop,height:e.scrollHeight-Gt(this)-this.display.barHeight,width:e.scrollWidth-Gt(this)-this.display.barWidth,clientHeight:Vt(this),clientWidth:Ut(this)}},scrollIntoView:fn(function(e,t){if(null==e?(e={from:this.doc.sel.primary().head,to:null},null==t&&(t=this.options.cursorScrollMargin)):"number"==typeof e?e={from:P(e,0),to:null}:null==e.from&&(e={from:e,to:null}),e.to||(e.to=e.from),e.margin=t||0,null!=e.from.line)Jr(this),this.curOp.scrollToPos=e;else{var r=qr(this,Math.min(e.from.left,e.to.left),Math.min(e.from.top,e.to.top)-e.margin,Math.max(e.from.right,e.to.right),Math.max(e.from.bottom,e.to.bottom)+e.margin);this.scrollTo(r.scrollLeft,r.scrollTop)}}),setSize:fn(function(e,t){var r=this,n=function(e){return"number"==typeof e||/^\d+$/.test(String(e))?e+"px":e};null!=e&&(this.display.wrapper.style.width=n(e)),null!=t&&(this.display.wrapper.style.height=n(t)),this.options.lineWrapping&&rr(this);var i=this.display.viewFrom;this.doc.iter(i,this.display.viewTo,function(e){if(e.widgets)for(var t=0;t<e.widgets.length;t++)if(e.widgets[t].noHScroll){pn(r,i,"widget");break}++i}),this.curOp.forceUpdate=!0,We(this,"refresh",this)}),operation:function(e){return un(this,e)},refresh:fn(function(){var e=this.display.cachedTextHeight;dn(this),this.curOp.forceUpdate=!0,nr(this),this.scrollTo(this.doc.scrollLeft,this.doc.scrollTop),kn(this),(null==e||Math.abs(e-vr(this.display))>.5)&&xr(this),We(this,"refresh",this)}),swapDoc:fn(function(e){var t=this.doc;return t.cm=null,Un(this,e),nr(this),this.display.input.reset(),this.scrollTo(e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,Ct(this,"swapDoc",this,t),t}),getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},He(e),e.registerHelper=function(t,n,i){r.hasOwnProperty(t)||(r[t]=e[t]={_global:[]}),r[t][n]=i},e.registerGlobalHelper=function(t,n,i,o){e.registerHelper(t,n,o),r[t]._global.push({pred:i,val:o})}}function Eo(e,t,r,n,i){function o(){var n=t.line+r;return!(n<e.first||n>=e.first+e.size)&&(t=new P(n,t.ch,t.sticky),u=k(e,n))}function l(n){var l;if(l=i?ke(e.cm,u,t,r):Le(u,t,r),null==l){if(n||!o())return!1;t=Te(i,e.cm,u,t.line,r)}else t=l;return!0}var s=t,a=r,u=k(e,t.line);if("char"==n)l();else if("column"==n)l(!0);else if("word"==n||"group"==n)for(var c=null,f="group"==n,h=e.cm&&e.cm.getHelper(t,"wordChars"),d=!0;!(r<0)||l(!d);d=!1){var p=u.text.charAt(t.ch)||"\n",g=w(p,h)?"w":f&&"\n"==p?"n":!f||/\s/.test(p)?null:"p";if(!f||d||g||(g="s"),c&&c!=g){r<0&&(r=1,l(),t.sticky="after");break}if(g&&(c=g),r>0&&!l(!d))break}var v=gi(e,t,s,a,!0);return I(s,v)&&(v.hitSide=!0),v}function Io(e,t,r,n){var i,o=e.doc,l=t.left;if("page"==n){var s=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),a=Math.max(s-.5*vr(e.display),3);i=(r>0?t.bottom:t.top)+r*a}else"line"==n&&(i=r>0?t.bottom+3:t.top-3);for(var u;u=hr(e,l,i),u.outside;){if(r<0?i<=0:i>=o.height){u.hitSide=!0;break}i+=5*r}return u}function zo(e,t){var r=_t(e,t.line);if(!r||r.hidden)return null;var n=k(e.doc,t.line),i=jt(r,n,t.line),o=Ce(n),l="left";if(o){var s=xe(o,t.ch);l=s%2?"right":"left"}var a=Zt(i.map,t.ch,l);return a.offset="right"==a.collapse?a.end:a.start,a}function Fo(e,t){return t&&(e.bad=!0),e}function Ro(e,t,r,n,i){function o(e){return function(t){return t.id==e}}function l(t){if(1==t.nodeType){var r=t.getAttribute("cm-text");if(null!=r)return void(s+=""==r?t.textContent.replace(/\u200b/g,""):r);var c,f=t.getAttribute("cm-marker");if(f){var h=e.findMarks(P(n,0),P(i+1,0),o(+f));return void(h.length&&(c=h[0].find())&&(s+=M(e.doc,c.from,c.to).join(u)))}if("false"==t.getAttribute("contenteditable"))return;for(var d=0;d<t.childNodes.length;d++)l(t.childNodes[d]);/^(pre|div|p)$/i.test(t.nodeName)&&(a=!0)}else if(3==t.nodeType){var p=t.nodeValue;if(!p)return;a&&(s+=u,a=!1),s+=p}}for(var s="",a=!1,u=e.doc.lineSeparator();l(t),t!=r;)t=t.nextSibling;return s}function Bo(e,t,r){var n;if(t==e.display.lineDiv){if(n=e.display.lineDiv.childNodes[r],!n)return Fo(e.clipPos(P(e.display.viewTo-1)),!0);t=null,r=0}else for(n=t;;n=n.parentNode){if(!n||n==e.display.lineDiv)return null;if(n.parentNode&&n.parentNode==e.display.lineDiv)break}for(var i=0;i<e.display.view.length;i++){var o=e.display.view[i];if(o.node==n)return Go(o,t,r)}}function Go(e,t,r){function n(t,r,n){for(var i=-1;i<(f?f.length:0);i++)for(var o=i<0?c.map:f[i],l=0;l<o.length;l+=3){var s=o[l+2];if(s==t||s==r){var a=O(i<0?e.line:e.rest[i]),u=o[l]+n;return(n<0||s!=t)&&(u=o[l+(n?1:0)]),P(a,u)}}}var o=e.text.firstChild,l=!1;if(!t||!i(o,t))return Fo(P(O(e.line),0),!0);if(t==o&&(l=!0,t=o.childNodes[r],r=0,!t)){var s=e.rest?p(e.rest):e.line;return Fo(P(O(s),s.text.length),l)}var a=3==t.nodeType?t:null,u=t;for(a||1!=t.childNodes.length||3!=t.firstChild.nodeType||(a=t.firstChild,r&&(r=a.nodeValue.length));u.parentNode!=o;)u=u.parentNode;var c=e.measure,f=c.maps,h=n(a,u,r);if(h)return Fo(h,l);for(var d=u.nextSibling,g=a?a.nodeValue.length-r:0;d;d=d.nextSibling){if(h=n(d,d.firstChild,0))return Fo(P(h.line,h.ch-g),l);g+=d.textContent.length}for(var v=u.previousSibling,m=r;v;v=v.previousSibling){if(h=n(v,v.firstChild,-1))return Fo(P(h.line,h.ch+m),l);m+=v.textContent.length}}function Uo(e,t){function r(){e.value=a.getValue()}if(t=t?u(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),null==t.autofocus){var n=o();t.autofocus=n==e||null!=e.getAttribute("autofocus")&&n==document.body}var i;if(e.form&&(Dl(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var l=e.form;i=l.submit;try{var s=l.submit=function(){r(),l.submit=i,l.submit(),l.submit=s}}catch(e){}}t.finishInit=function(t){t.save=r,t.getTextArea=function(){return e},t.toTextArea=function(){t.toTextArea=isNaN,r(),e.parentNode.removeChild(t.getWrapperElement()),e.style.display="",e.form&&(Ne(e.form,"submit",r),"function"==typeof e.form.submit&&(e.form.submit=i))}},e.style.display="none";var a=Lo(function(t){return e.parentNode.insertBefore(t,e.nextSibling)},t);return a}function Vo(e){e.off=Ne,e.on=Dl,e.wheelEventPixels=Gr,e.Doc=fs,e.splitLines=Pl,e.countColumn=c,e.findColumn=h,e.isWordChar=b,e.Pass=wl,e.signal=We,e.Line=Ul,e.changeEnd=Dn,e.scrollbarModel=Jl,e.Pos=P,e.cmpPos=E,e.modes=Fl,e.mimeModes=Rl,e.resolveMode=je,e.getMode=Xe,e.modeExtensions=Bl,e.extendMode=Ye,e.copyState=_e,e.startState=qe,e.innerMode=$e,e.commands=xs,e.keyMap=ys,e.keyName=$i,e.isModifierKey=_i,e.lookupKey=Yi,e.normalizeKeyMap=Xi,e.StringStream=Gl,e.SharedTextMarker=us,e.TextMarker=as,e.LineWidget=ls,e.e_preventDefault=Pe,e.e_stopPropagation=Ee,e.e_stop=ze,e.addClass=l,e.contains=i,e.rmClass=pl,e.keyNames=ps}var Ko=navigator.userAgent,jo=navigator.platform,Xo=/gecko\/\d/i.test(Ko),Yo=/MSIE \d/.test(Ko),_o=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Ko),$o=/Edge\/(\d+)/.exec(Ko),qo=Yo||_o||$o,Zo=qo&&(Yo?document.documentMode||6:+($o||_o)[1]),Qo=!$o&&/WebKit\//.test(Ko),Jo=Qo&&/Qt\/\d+\.\d+/.test(Ko),el=!$o&&/Chrome\//.test(Ko),tl=/Opera\//.test(Ko),rl=/Apple Computer/.test(navigator.vendor),nl=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(Ko),il=/PhantomJS/.test(Ko),ol=!$o&&/AppleWebKit/.test(Ko)&&/Mobile\/\w+/.test(Ko),ll=ol||/Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(Ko),sl=ol||/Mac/.test(jo),al=/\bCrOS\b/.test(Ko),ul=/win/i.test(jo),cl=tl&&Ko.match(/Version\/(\d*\.\d*)/);cl&&(cl=Number(cl[1])),cl&&cl>=15&&(tl=!1,Qo=!0);var fl,hl=sl&&(Jo||tl&&(null==cl||cl<12.11)),dl=Xo||qo&&Zo>=9,pl=function(t,r){var n=t.className,i=e(r).exec(n);if(i){var o=n.slice(i.index+i[0].length);t.className=n.slice(0,i.index)+(o?i[1]+o:"")}};fl=document.createRange?function(e,t,r,n){var i=document.createRange();return i.setEnd(n||e,r),i.setStart(e,t),i}:function(e,t,r){var n=document.body.createTextRange();try{n.moveToElementText(e.parentNode)}catch(e){return n}return n.collapse(!0),n.moveEnd("character",r),n.moveStart("character",t),n};var gl=function(e){e.select()};ol?gl=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:qo&&(gl=function(e){try{e.select()}catch(e){}});var vl=function(){this.id=null};vl.prototype.set=function(e,t){clearTimeout(this.id),this.id=setTimeout(t,e)};var ml,yl,bl=30,wl={toString:function(){return"CodeMirror.Pass"}},xl={scroll:!1},Cl={origin:"*mouse"},Sl={origin:"+move"},Ll=[""],Tl=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,kl=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/,Ml=!1,Nl=!1,Wl=null,Ol=function(){function e(e){return e<=247?r.charAt(e):1424<=e&&e<=1524?"R":1536<=e&&e<=1785?n.charAt(e-1536):1774<=e&&e<=2220?"r":8192<=e&&e<=8203?"w":8204==e?"b":"L"}function t(e,t,r){this.level=e,this.from=t,this.to=r}var r="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",n="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111",i=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,o=/[stwN]/,l=/[LRr]/,s=/[Lb1n]/,a=/[1n]/,u="L";return function(r){if(!i.test(r))return!1;for(var n=r.length,c=[],f=0;f<n;++f)c.push(e(r.charCodeAt(f)));for(var h=0,d=u;h<n;++h){var g=c[h];"m"==g?c[h]=d:d=g}for(var v=0,m=u;v<n;++v){var y=c[v];"1"==y&&"r"==m?c[v]="n":l.test(y)&&(m=y,"r"==y&&(c[v]="R"))}for(var b=1,w=c[0];b<n-1;++b){var x=c[b];"+"==x&&"1"==w&&"1"==c[b+1]?c[b]="1":","!=x||w!=c[b+1]||"1"!=w&&"n"!=w||(c[b]=w),w=x}for(var C=0;C<n;++C){var S=c[C];if(","==S)c[C]="N";else if("%"==S){var L=void 0;for(L=C+1;L<n&&"%"==c[L];++L);for(var T=C&&"!"==c[C-1]||L<n&&"1"==c[L]?"1":"N",k=C;k<L;++k)c[k]=T;C=L-1}}for(var M=0,N=u;M<n;++M){var W=c[M];"L"==N&&"1"==W?c[M]="L":l.test(W)&&(N=W)}for(var O=0;O<n;++O)if(o.test(c[O])){var A=void 0;for(A=O+1;A<n&&o.test(c[A]);++A);for(var D="L"==(O?c[O-1]:u),H="L"==(A<n?c[A]:u),P=D||H?"L":"R",E=O;E<A;++E)c[E]=P;O=A-1}for(var I,z=[],F=0;F<n;)if(s.test(c[F])){var R=F;for(++F;F<n&&s.test(c[F]);++F);z.push(new t(0,R,F))}else{var B=F,G=z.length;for(++F;F<n&&"L"!=c[F];++F);for(var U=B;U<F;)if(a.test(c[U])){B<U&&z.splice(G,0,new t(1,B,U));var V=U;for(++U;U<F&&a.test(c[U]);++U);z.splice(G,0,new t(2,V,U)),B=U}else++U;B<F&&z.splice(G,0,new t(1,B,F))}return 1==z[0].level&&(I=r.match(/^\s+/))&&(z[0].from=I[0].length,z.unshift(new t(0,0,I[0].length))),1==p(z).level&&(I=r.match(/\s+$/))&&(p(z).to-=I[0].length,z.push(new t(0,n-I[0].length,n))),z}}(),Al=[],Dl=function(e,t,r){if(e.addEventListener)e.addEventListener(t,r,!1);else if(e.attachEvent)e.attachEvent("on"+t,r);else{var n=e._handlers||(e._handlers={});n[t]=(n[t]||Al).concat(r)}},Hl=function(){if(qo&&Zo<9)return!1;var e=n("div");return"draggable"in e||"dragDrop"in e}(),Pl=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,r=[],n=e.length;t<=n;){var i=e.indexOf("\n",t);i==-1&&(i=e.length);var o=e.slice(t,"\r"==e.charAt(i-1)?i-1:i),l=o.indexOf("\r");l!=-1?(r.push(o.slice(0,l)),t+=l+1):(r.push(o),t=i+1)}return r}:function(e){return e.split(/\r\n?|\n/)},El=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(e){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(e){}return!(!t||t.parentElement()!=e)&&0!=t.compareEndPoints("StartToEnd",t)},Il=function(){var e=n("div");return"oncopy"in e||(e.setAttribute("oncopy","return;"),"function"==typeof e.oncopy)}(),zl=null,Fl={},Rl={},Bl={},Gl=function(e,t){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0};Gl.prototype.eol=function(){return this.pos>=this.string.length},Gl.prototype.sol=function(){return this.pos==this.lineStart},Gl.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Gl.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Gl.prototype.eat=function(e){var t,r=this.string.charAt(this.pos);if(t="string"==typeof e?r==e:r&&(e.test?e.test(r):e(r)))return++this.pos,r},Gl.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},Gl.prototype.eatSpace=function(){for(var e=this,t=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++e.pos;return this.pos>t},Gl.prototype.skipToEnd=function(){this.pos=this.string.length},Gl.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Gl.prototype.backUp=function(e){this.pos-=e},Gl.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=c(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?c(this.string,this.lineStart,this.tabSize):0)},Gl.prototype.indentation=function(){return c(this.string,null,this.tabSize)-(this.lineStart?c(this.string,this.lineStart,this.tabSize):0)},Gl.prototype.match=function(e,t,r){if("string"!=typeof e){var n=this.string.slice(this.pos).match(e);return n&&n.index>0?null:(n&&t!==!1&&(this.pos+=n[0].length),n)}var i=function(e){return r?e.toLowerCase():e},o=this.string.substr(this.pos,e.length);if(i(o)==i(e))return t!==!1&&(this.pos+=e.length),!0},Gl.prototype.current=function(){return this.string.slice(this.start,this.pos)},Gl.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}};var Ul=function(e,t,r){this.text=e,re(this,t),this.height=r?r(this):1};Ul.prototype.lineNo=function(){return O(this)},He(Ul);var Vl,Kl={},jl={},Xl=null,Yl=null,_l={left:0,right:0,top:0,bottom:0},$l=0,ql=null;qo?ql=-.53:Xo?ql=15:el?ql=-.7:rl&&(ql=-1/3);var Zl=function(e,t,r){this.cm=r;var i=this.vert=n("div",[n("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),o=this.horiz=n("div",[n("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");e(i),e(o),Dl(i,"scroll",function(){i.clientHeight&&t(i.scrollTop,"vertical")}),Dl(o,"scroll",function(){o.clientWidth&&t(o.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,qo&&Zo<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Zl.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,r=e.scrollHeight>e.clientHeight+1,n=e.nativeBarWidth;if(r){this.vert.style.display="block",this.vert.style.bottom=t?n+"px":"0";var i=e.viewHeight-(t?n:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=r?n+"px":"0",this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(r?n:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+o)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(0==n&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:r?n:0,bottom:t?n:0}},Zl.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz)},Zl.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert)},Zl.prototype.zeroWidthHack=function(){var e=sl&&!nl?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new vl,this.disableVert=new vl},Zl.prototype.enableZeroWidthBar=function(e,t){function r(){var n=e.getBoundingClientRect(),i=document.elementFromPoint(n.left+1,n.bottom-1);i!=e?e.style.pointerEvents="none":t.set(1e3,r)}e.style.pointerEvents="auto",t.set(1e3,r)},Zl.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Ql=function(){};Ql.prototype.update=function(){return{bottom:0,right:0}},Ql.prototype.setScrollLeft=function(){},Ql.prototype.setScrollTop=function(){},Ql.prototype.clear=function(){};var Jl={native:Zl,null:Ql},es=0,ts=function(e,t,r){var n=e.display;this.viewport=t,this.visible=zr(n,e.doc,t),this.editorIsHidden=!n.wrapper.offsetWidth,this.wrapperHeight=n.wrapper.clientHeight,this.wrapperWidth=n.wrapper.clientWidth,this.oldDisplayWidth=Ut(e),this.force=r,this.dims=yr(e),this.events=[]};ts.prototype.signal=function(e,t){De(e,t)&&this.events.push(arguments)},ts.prototype.finish=function(){for(var e=this,t=0;t<this.events.length;t++)We.apply(null,e.events[t])};var rs=function(e,t){this.ranges=e,this.primIndex=t};rs.prototype.primary=function(){return this.ranges[this.primIndex]},rs.prototype.equals=function(e){var t=this;if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var r=0;r<this.ranges.length;r++){var n=t.ranges[r],i=e.ranges[r];if(!I(n.anchor,i.anchor)||!I(n.head,i.head))return!1}return!0},rs.prototype.deepCopy=function(){for(var e=this,t=[],r=0;r<this.ranges.length;r++)t[r]=new ns(z(e.ranges[r].anchor),z(e.ranges[r].head));return new rs(t,this.primIndex)},rs.prototype.somethingSelected=function(){for(var e=this,t=0;t<this.ranges.length;t++)if(!e.ranges[t].empty())return!0;return!1},rs.prototype.contains=function(e,t){var r=this;t||(t=e);for(var n=0;n<this.ranges.length;n++){var i=r.ranges[n];if(E(t,i.from())>=0&&E(e,i.to())<=0)return n}return-1};var ns=function(e,t){this.anchor=e,this.head=t};ns.prototype.from=function(){return R(this.anchor,this.head)},ns.prototype.to=function(){return F(this.anchor,this.head)},ns.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};var is=function(e){var t=this;this.lines=e,this.parent=null;for(var r=0,n=0;n<e.length;++n)e[n].parent=t,r+=e[n].height;this.height=r};is.prototype.chunkSize=function(){return this.lines.length},is.prototype.removeInner=function(e,t){for(var r=this,n=e,i=e+t;n<i;++n){var o=r.lines[n];r.height-=o.height,at(o),Ct(o,"delete")}this.lines.splice(e,t)},is.prototype.collapse=function(e){e.push.apply(e,this.lines)},is.prototype.insertInner=function(e,t,r){var n=this;this.height+=r,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var i=0;i<t.length;++i)t[i].parent=n},is.prototype.iterN=function(e,t,r){for(var n=this,i=e+t;e<i;++e)if(r(n.lines[e]))return!0};var os=function(e){var t=this;this.children=e;for(var r=0,n=0,i=0;i<e.length;++i){var o=e[i];r+=o.chunkSize(),n+=o.height,o.parent=t}this.size=r,this.height=n,this.parent=null};os.prototype.chunkSize=function(){return this.size},os.prototype.removeInner=function(e,t){var r=this;this.size-=t;for(var n=0;n<this.children.length;++n){var i=r.children[n],o=i.chunkSize();if(e<o){var l=Math.min(t,o-e),s=i.height;if(i.removeInner(e,l),r.height-=s-i.height,o==l&&(r.children.splice(n--,1),i.parent=null),0==(t-=l))break;e=0}else e-=o}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof is))){var a=[];this.collapse(a),this.children=[new is(a)],this.children[0].parent=this}},os.prototype.collapse=function(e){for(var t=this,r=0;r<this.children.length;++r)t.children[r].collapse(e)},os.prototype.insertInner=function(e,t,r){var n=this;this.size+=t.length,this.height+=r;for(var i=0;i<this.children.length;++i){var o=n.children[i],l=o.chunkSize();if(e<=l){if(o.insertInner(e,t,r),o.lines&&o.lines.length>50){for(var s=o.lines.length%25+25,a=s;a<o.lines.length;){var u=new is(o.lines.slice(a,a+=25));o.height-=u.height,n.children.splice(++i,0,u),u.parent=n}o.lines=o.lines.slice(0,s),n.maybeSpill()}break}e-=l}},os.prototype.maybeSpill=function(){if(!(this.children.length<=10)){var e=this;do{var t=e.children.splice(e.children.length-5,5),r=new os(t);if(e.parent){e.size-=r.size,e.height-=r.height;var n=f(e.parent.children,e);e.parent.children.splice(n+1,0,r)}else{var i=new os(e.children);i.parent=e,e.children=[i,r],e=i}r.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},os.prototype.iterN=function(e,t,r){for(var n=this,i=0;i<this.children.length;++i){var o=n.children[i],l=o.chunkSize();if(e<l){var s=Math.min(t,l-e);if(o.iterN(e,s,r))return!0;if(0==(t-=s))break;e=0}else e-=l}};var ls=function(e,t,r){var n=this;if(r)for(var i in r)r.hasOwnProperty(i)&&(n[i]=r[i]);this.doc=e,this.node=t};ls.prototype.clear=function(){var e=this,t=this.doc.cm,r=this.line.widgets,n=this.line,i=O(n);if(null!=i&&r){for(var o=0;o<r.length;++o)r[o]==e&&r.splice(o--,1);r.length||(n.widgets=null);var l=It(this);W(n,Math.max(0,n.height-l)),t&&(un(t,function(){Oi(t,n,-l),pn(t,i,"widget")}),Ct(t,"lineWidgetCleared",t,this))}},ls.prototype.changed=function(){var e=this.height,t=this.doc.cm,r=this.line;this.height=null;var n=It(this)-e;n&&(W(r,r.height+n),t&&un(t,function(){t.curOp.forceUpdate=!0,Oi(t,r,n)}))},He(ls);var ss=0,as=function(e,t){this.lines=[],this.type=t,
+this.doc=e,this.id=++ss};as.prototype.clear=function(){var e=this;if(!this.explicitlyCleared){var t=this.doc.cm,r=t&&!t.curOp;if(r&&en(t),De(this,"clear")){var n=this.find();n&&Ct(this,"clear",n.from,n.to)}for(var i=null,o=null,l=0;l<this.lines.length;++l){var s=e.lines[l],a=Y(s.markedSpans,e);t&&!e.collapsed?pn(t,O(s),"text"):t&&(null!=a.to&&(o=O(s)),null!=a.from&&(i=O(s))),s.markedSpans=_(s.markedSpans,a),null==a.from&&e.collapsed&&!ge(e.doc,s)&&t&&W(s,vr(t.display))}if(t&&this.collapsed&&!t.options.lineWrapping)for(var u=0;u<this.lines.length;++u){var c=ce(e.lines[u]),f=ye(c);f>t.display.maxLineLength&&(t.display.maxLine=c,t.display.maxLineLength=f,t.display.maxLineChanged=!0)}null!=i&&t&&this.collapsed&&dn(t,i,o+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,t&&hi(t.doc)),t&&Ct(t,"markerCleared",t,this),r&&tn(t),this.parent&&this.parent.clear()}},as.prototype.find=function(e,t){var r=this;null==e&&"bookmark"==this.type&&(e=1);for(var n,i,o=0;o<this.lines.length;++o){var l=r.lines[o],s=Y(l.markedSpans,r);if(null!=s.from&&(n=P(t?l:O(l),s.from),e==-1))return n;if(null!=s.to&&(i=P(t?l:O(l),s.to),1==e))return i}return n&&{from:n,to:i}},as.prototype.changed=function(){var e=this.find(-1,!0),t=this,r=this.doc.cm;e&&r&&un(r,function(){var n=e.line,i=O(e.line),o=_t(r,i);if(o&&(tr(o),r.curOp.selectionChanged=r.curOp.forceUpdate=!0),r.curOp.updateMaxLine=!0,!ge(t.doc,n)&&null!=t.height){var l=t.height;t.height=null;var s=It(t)-l;s&&W(n,n.height+s)}})},as.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;t.maybeHiddenMarkers&&f(t.maybeHiddenMarkers,this)!=-1||(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},as.prototype.detachLine=function(e){if(this.lines.splice(f(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},He(as);var us=function(e,t){var r=this;this.markers=e,this.primary=t;for(var n=0;n<e.length;++n)e[n].parent=r};us.prototype.clear=function(){var e=this;if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var t=0;t<this.markers.length;++t)e.markers[t].clear();Ct(this,"clear")}},us.prototype.find=function(e,t){return this.primary.find(e,t)},He(us);var cs=0,fs=function(e,t,r,n){if(!(this instanceof fs))return new fs(e,t,r,n);null==r&&(r=0),os.call(this,[new is([new Ul("",null)])]),this.first=r,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.frontier=r;var i=P(r,0);this.sel=An(i),this.history=new Vn(null),this.id=++cs,this.modeOption=t,this.lineSep=n,this.extend=!1,"string"==typeof e&&(e=this.splitLines(e)),Bn(this,{from:i,to:i,text:e}),ui(this,An(i),xl)};fs.prototype=y(os.prototype,{constructor:fs,iter:function(e,t,r){r?this.iterN(e-this.first,t-e,r):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var r=0,n=0;n<t.length;++n)r+=t[n].height;this.insertInner(e-this.first,t,r)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=N(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:hn(function(e){var t=P(this.first,0),r=this.first+this.size-1;bi(this,{from:t,to:P(r,k(this,r).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),ui(this,An(t))}),replaceRange:function(e,t,r,n){t=G(this,t),r=r?G(this,r):t,Ti(this,e,t,r,n)},getRange:function(e,t,r){var n=M(this,G(this,e),G(this,t));return r===!1?n:n.join(r||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(D(this,e))return k(this,e)},getLineNumber:function(e){return O(e)},getLineHandleVisualStart:function(e){return"number"==typeof e&&(e=k(this,e)),ce(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return G(this,e)},getCursor:function(e){var t,r=this.sel.primary();return t=null==e||"head"==e?r.head:"anchor"==e?r.anchor:"end"==e||"to"==e||e===!1?r.to():r.from()},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:hn(function(e,t,r){li(this,G(this,"number"==typeof e?P(e,t||0):e),null,r)}),setSelection:hn(function(e,t,r){li(this,G(this,e),G(this,t||e),r)}),extendSelection:hn(function(e,t,r){ni(this,G(this,e),t&&G(this,t),r)}),extendSelections:hn(function(e,t){ii(this,V(this,e),t)}),extendSelectionsBy:hn(function(e,t){var r=g(this.sel.ranges,e);ii(this,V(this,r),t)}),setSelections:hn(function(e,t,r){var n=this;if(e.length){for(var i=[],o=0;o<e.length;o++)i[o]=new ns(G(n,e[o].anchor),G(n,e[o].head));null==t&&(t=Math.min(e.length-1,this.sel.primIndex)),ui(this,On(i,t),r)}}),addSelection:hn(function(e,t,r){var n=this.sel.ranges.slice(0);n.push(new ns(G(this,e),G(this,t||e))),ui(this,On(n,n.length-1),r)}),getSelection:function(e){for(var t,r=this,n=this.sel.ranges,i=0;i<n.length;i++){var o=M(r,n[i].from(),n[i].to());t=t?t.concat(o):o}return e===!1?t:t.join(e||this.lineSeparator())},getSelections:function(e){for(var t=this,r=[],n=this.sel.ranges,i=0;i<n.length;i++){var o=M(t,n[i].from(),n[i].to());e!==!1&&(o=o.join(e||t.lineSeparator())),r[i]=o}return r},replaceSelection:function(e,t,r){for(var n=[],i=0;i<this.sel.ranges.length;i++)n[i]=e;this.replaceSelections(n,t,r||"+input")},replaceSelections:hn(function(e,t,r){for(var n=this,i=[],o=this.sel,l=0;l<o.ranges.length;l++){var s=o.ranges[l];i[l]={from:s.from(),to:s.to(),text:n.splitLines(e[l]),origin:r}}for(var a=t&&"end"!=t&&In(this,i,t),u=i.length-1;u>=0;u--)bi(n,i[u]);a?ai(this,a):this.cm&&Qr(this.cm)}),undo:hn(function(){xi(this,"undo")}),redo:hn(function(){xi(this,"redo")}),undoSelection:hn(function(){xi(this,"undo",!0)}),redoSelection:hn(function(){xi(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,r=0,n=0;n<e.done.length;n++)e.done[n].ranges||++t;for(var i=0;i<e.undone.length;i++)e.undone[i].ranges||++r;return{undo:t,redo:r}},clearHistory:function(){this.history=new Vn(this.history.maxGeneration)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:ti(this.history.done),undone:ti(this.history.undone)}},setHistory:function(e){var t=this.history=new Vn(this.history.maxGeneration);t.done=ti(e.done.slice(0),null,!0),t.undone=ti(e.undone.slice(0),null,!0)},setGutterMarker:hn(function(e,t,r){return Wi(this,e,"gutter",function(e){var n=e.gutterMarkers||(e.gutterMarkers={});return n[t]=r,!r&&x(n)&&(e.gutterMarkers=null),!0})}),clearGutter:hn(function(e){var t=this;this.iter(function(r){r.gutterMarkers&&r.gutterMarkers[e]&&Wi(t,r,"gutter",function(){return r.gutterMarkers[e]=null,x(r.gutterMarkers)&&(r.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if("number"==typeof e){if(!D(this,e))return null;if(t=e,e=k(this,e),!e)return null}else if(t=O(e),null==t)return null;return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:hn(function(t,r,n){return Wi(this,t,"gutter"==r?"gutter":"class",function(t){var i="text"==r?"textClass":"background"==r?"bgClass":"gutter"==r?"gutterClass":"wrapClass";if(t[i]){if(e(n).test(t[i]))return!1;t[i]+=" "+n}else t[i]=n;return!0})}),removeLineClass:hn(function(t,r,n){return Wi(this,t,"gutter"==r?"gutter":"class",function(t){var i="text"==r?"textClass":"background"==r?"bgClass":"gutter"==r?"gutterClass":"wrapClass",o=t[i];if(!o)return!1;if(null==n)t[i]=null;else{var l=o.match(e(n));if(!l)return!1;var s=l.index+l[0].length;t[i]=o.slice(0,l.index)+(l.index&&s!=o.length?" ":"")+o.slice(s)||null}return!0})}),addLineWidget:hn(function(e,t,r){return Ai(this,e,t,r)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,r){return Di(this,G(this,e),G(this,t),r,r&&r.type||"range")},setBookmark:function(e,t){var r={replacedWith:t&&(null==t.nodeType?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=G(this,e),Di(this,e,e,r,"bookmark")},findMarksAt:function(e){e=G(this,e);var t=[],r=k(this,e.line).markedSpans;if(r)for(var n=0;n<r.length;++n){var i=r[n];(null==i.from||i.from<=e.ch)&&(null==i.to||i.to>=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,r){e=G(this,e),t=G(this,t);var n=[],i=e.line;return this.iter(e.line,t.line+1,function(o){var l=o.markedSpans;if(l)for(var s=0;s<l.length;s++){var a=l[s];null!=a.to&&i==e.line&&e.ch>=a.to||null==a.from&&i!=e.line||null!=a.from&&i==t.line&&a.from>=t.ch||r&&!r(a.marker)||n.push(a.marker.parent||a.marker)}++i}),n},getAllMarks:function(){var e=[];return this.iter(function(t){var r=t.markedSpans;if(r)for(var n=0;n<r.length;++n)null!=r[n].from&&e.push(r[n].marker)}),e},posFromIndex:function(e){var t,r=this.first,n=this.lineSeparator().length;return this.iter(function(i){var o=i.text.length+n;return o>e?(t=e,!0):(e-=o,void++r)}),G(this,P(r,t))},indexFromPos:function(e){e=G(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var r=this.lineSeparator().length;return this.iter(this.first,e.line,function(e){t+=e.text.length+r}),t},copy:function(e){var t=new fs(N(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,r=this.first+this.size;null!=e.from&&e.from>t&&(t=e.from),null!=e.to&&e.to<r&&(r=e.to);var n=new fs(N(this,t,r),e.mode||this.modeOption,t,this.lineSep);return e.sharedHist&&(n.history=this.history),(this.linked||(this.linked=[])).push({doc:n,sharedHist:e.sharedHist}),n.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],Ei(n,Pi(this)),n},unlinkDoc:function(e){var t=this;if(e instanceof Lo&&(e=e.doc),this.linked)for(var r=0;r<this.linked.length;++r){var n=t.linked[r];if(n.doc==e){t.linked.splice(r,1),e.unlinkDoc(t),Ii(Pi(t));break}}if(e.history==this.history){var i=[e.id];Gn(e,function(e){return i.push(e.id)},!0),e.history=new Vn(null),e.history.done=ti(this.history.done,i),e.history.undone=ti(this.history.undone,i)}},iterLinkedDocs:function(e){Gn(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):Pl(e)},lineSeparator:function(){return this.lineSep||"\n"}}),fs.prototype.eachLine=fs.prototype.iter;for(var hs=0,ds=!1,ps={3:"Enter",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",127:"Delete",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},gs=0;gs<10;gs++)ps[gs+48]=ps[gs+96]=String(gs);for(var vs=65;vs<=90;vs++)ps[vs]=String.fromCharCode(vs);for(var ms=1;ms<=12;ms++)ps[ms+111]=ps[ms+63235]="F"+ms;var ys={};ys.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},ys.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},ys.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},ys.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},ys.default=sl?ys.macDefault:ys.pcDefault;var bs,ws,xs={selectAll:mi,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),xl)},killLine:function(e){return Zi(e,function(t){if(t.empty()){var r=k(e.doc,t.head.line).text.length;return t.head.ch==r&&t.head.line<e.lastLine()?{from:t.head,to:P(t.head.line+1,0)}:{from:t.head,to:P(t.head.line,r)}}return{from:t.from(),to:t.to()}})},deleteLine:function(e){return Zi(e,function(t){return{from:P(t.from().line,0),to:G(e.doc,P(t.to().line+1,0))}})},delLineLeft:function(e){return Zi(e,function(e){return{from:P(e.from().line,0),to:e.from()}})},delWrappedLineLeft:function(e){return Zi(e,function(t){var r=e.charCoords(t.head,"div").top+5,n=e.coordsChar({left:0,top:r},"div");return{from:n,to:t.from()}})},delWrappedLineRight:function(e){return Zi(e,function(t){var r=e.charCoords(t.head,"div").top+5,n=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:r},"div");return{from:t.from(),to:n}})},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(P(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(P(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return Qi(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return eo(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return Ji(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var r=e.charCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:r},"div")},Sl)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var r=e.charCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:r},"div")},Sl)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var r=e.charCoords(t.head,"div").top+5,n=e.coordsChar({left:0,top:r},"div");return n.ch<e.getLine(n.line).search(/\S/)?eo(e,t.head):n},Sl)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"char")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection("\t")},insertSoftTab:function(e){for(var t=[],r=e.listSelections(),n=e.options.tabSize,i=0;i<r.length;i++){var o=r[i].from(),l=c(e.getLine(o.line),o.ch,n);t.push(d(n-l%n))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return un(e,function(){for(var t=e.listSelections(),r=[],n=0;n<t.length;n++)if(t[n].empty()){var i=t[n].head,o=k(e.doc,i.line).text;if(o)if(i.ch==o.length&&(i=new P(i.line,i.ch-1)),i.ch>0)i=new P(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),P(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var l=k(e.doc,i.line-1).text;l&&(i=new P(i.line,1),e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+l.charAt(l.length-1),P(i.line-1,l.length-1),i,"+transpose"))}r.push(new ns(i,i))}e.setSelections(r)})},newlineAndIndent:function(e){return un(e,function(){for(var t=e.listSelections(),r=t.length-1;r>=0;r--)e.replaceRange(e.doc.lineSeparator(),t[r].anchor,t[r].head,"+input");t=e.listSelections();for(var n=0;n<t.length;n++)e.indentLine(t[n].from().line,null,!0);Qr(e)})},openLine:function(e){return e.replaceSelection("\n","start")},toggleOverwrite:function(e){return e.toggleOverwrite()}},Cs=new vl,Ss=null,Ls={toString:function(){return"CodeMirror.Init"}},Ts={},ks={};Lo.defaults=Ts,Lo.optionHandlers=ks;var Ms=[];Lo.defineInitHook=function(e){return Ms.push(e)};var Ns=null,Ws=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new vl,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};Ws.prototype.init=function(e){function t(e){if(!Oe(i,e)){if(i.somethingSelected())Mo({lineWise:!1,text:i.getSelections()}),"cut"==e.type&&i.replaceSelection("",null,"cut");else{if(!i.options.lineWiseCopyCut)return;var t=Ao(i);Mo({lineWise:!0,text:t.text}),"cut"==e.type&&i.operation(function(){i.setSelections(t.ranges,0,xl),i.replaceSelection("",null,"cut")})}if(e.clipboardData){e.clipboardData.clearData();var r=Ns.text.join("\n");if(e.clipboardData.setData("Text",r),e.clipboardData.getData("Text")==r)return void e.preventDefault()}var l=Ho(),s=l.firstChild;i.display.lineSpace.insertBefore(l,i.display.lineSpace.firstChild),s.value=Ns.text.join("\n");var a=document.activeElement;gl(s),setTimeout(function(){i.display.lineSpace.removeChild(l),a.focus(),a==o&&n.showPrimarySelection()},50)}}var r=this,n=this,i=n.cm,o=n.div=e.lineDiv;Do(o,i.options.spellcheck),Dl(o,"paste",function(e){Oe(i,e)||Wo(e,i)||Zo<=11&&setTimeout(cn(i,function(){n.pollContent()||dn(i)}),20)}),Dl(o,"compositionstart",function(e){r.composing={data:e.data,done:!1}}),Dl(o,"compositionupdate",function(e){r.composing||(r.composing={data:e.data,done:!1})}),Dl(o,"compositionend",function(e){r.composing&&(e.data!=r.composing.data&&r.readFromDOMSoon(),r.composing.done=!0)}),Dl(o,"touchstart",function(){return n.forceCompositionEnd()}),Dl(o,"input",function(){r.composing||r.readFromDOMSoon()}),Dl(o,"copy",t),Dl(o,"cut",t)},Ws.prototype.prepareSelection=function(){var e=Tr(this.cm,!1);return e.focus=this.cm.state.focused,e},Ws.prototype.showSelection=function(e,t){e&&this.cm.display.view.length&&((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},Ws.prototype.showPrimarySelection=function(){var e=window.getSelection(),t=this.cm.doc.sel.primary(),r=Bo(this.cm,e.anchorNode,e.anchorOffset),n=Bo(this.cm,e.focusNode,e.focusOffset);if(!r||r.bad||!n||n.bad||0!=E(R(r,n),t.from())||0!=E(F(r,n),t.to())){var i=zo(this.cm,t.from()),o=zo(this.cm,t.to());if(i||o){var l=this.cm.display.view,s=e.rangeCount&&e.getRangeAt(0);if(i){if(!o){var a=l[l.length-1].measure,u=a.maps?a.maps[a.maps.length-1]:a.map;o={node:u[u.length-1],offset:u[u.length-2]-u[u.length-3]}}}else i={node:l[0].measure.map[2],offset:0};var c;try{c=fl(i.node,i.offset,o.offset,o.node)}catch(e){}c&&(!Xo&&this.cm.state.focused?(e.collapse(i.node,i.offset),c.collapsed||(e.removeAllRanges(),e.addRange(c))):(e.removeAllRanges(),e.addRange(c)),s&&null==e.anchorNode?e.addRange(s):Xo&&this.startGracePeriod()),this.rememberSelection()}}},Ws.prototype.startGracePeriod=function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation(function(){return e.cm.curOp.selectionChanged=!0})},20)},Ws.prototype.showMultipleSelections=function(e){r(this.cm.display.cursorDiv,e.cursors),r(this.cm.display.selectionDiv,e.selection)},Ws.prototype.rememberSelection=function(){var e=window.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},Ws.prototype.selectionInEditor=function(){var e=window.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return i(this.div,t)},Ws.prototype.focus=function(){"nocursor"!=this.cm.options.readOnly&&(this.selectionInEditor()||this.showSelection(this.prepareSelection(),!0),this.div.focus())},Ws.prototype.blur=function(){this.div.blur()},Ws.prototype.getField=function(){return this.div},Ws.prototype.supportsTouch=function(){return!0},Ws.prototype.receivedFocus=function(){function e(){t.cm.state.focused&&(t.pollSelection(),t.polling.set(t.cm.options.pollInterval,e))}var t=this;this.selectionInEditor()?this.pollSelection():un(this.cm,function(){return t.cm.curOp.selectionChanged=!0}),this.polling.set(this.cm.options.pollInterval,e)},Ws.prototype.selectionChanged=function(){var e=window.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},Ws.prototype.pollSelection=function(){if(!this.composing&&null==this.readDOMTimeout&&!this.gracePeriod&&this.selectionChanged()){var e=window.getSelection(),t=this.cm;this.rememberSelection();var r=Bo(t,e.anchorNode,e.anchorOffset),n=Bo(t,e.focusNode,e.focusOffset);r&&n&&un(t,function(){ui(t.doc,An(r,n),xl),(r.bad||n.bad)&&(t.curOp.selectionChanged=!0)})}},Ws.prototype.pollContent=function(){null!=this.readDOMTimeout&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,r=e.doc.sel.primary(),n=r.from(),i=r.to();if(0==n.ch&&n.line>e.firstLine()&&(n=P(n.line-1,k(e.doc,n.line-1).length)),i.ch==k(e.doc,i.line).text.length&&i.line<e.lastLine()&&(i=P(i.line+1,0)),n.line<t.viewFrom||i.line>t.viewTo-1)return!1;var o,l,s;n.line==t.viewFrom||0==(o=Sr(e,n.line))?(l=O(t.view[0].line),s=t.view[0].node):(l=O(t.view[o].line),s=t.view[o-1].node.nextSibling);var a,u,c=Sr(e,i.line);if(c==t.view.length-1?(a=t.viewTo-1,u=t.lineDiv.lastChild):(a=O(t.view[c+1].line)-1,u=t.view[c+1].node.previousSibling),!s)return!1;for(var f=e.doc.splitLines(Ro(e,s,u,l,a)),h=M(e.doc,P(l,0),P(a,k(e.doc,a).text.length));f.length>1&&h.length>1;)if(p(f)==p(h))f.pop(),h.pop(),a--;else{if(f[0]!=h[0])break;f.shift(),h.shift(),l++}for(var d=0,g=0,v=f[0],m=h[0],y=Math.min(v.length,m.length);d<y&&v.charCodeAt(d)==m.charCodeAt(d);)++d;for(var b=p(f),w=p(h),x=Math.min(b.length-(1==f.length?d:0),w.length-(1==h.length?d:0));g<x&&b.charCodeAt(b.length-g-1)==w.charCodeAt(w.length-g-1);)++g;f[f.length-1]=b.slice(0,b.length-g).replace(/^\u200b+/,""),f[0]=f[0].slice(d).replace(/\u200b+$/,"");var C=P(l,d),S=P(a,h.length?p(h).length-g:0);return f.length>1||f[0]||E(C,S)?(Ti(e.doc,f,C,S,"+input"),!0):void 0},Ws.prototype.ensurePolled=function(){this.forceCompositionEnd()},Ws.prototype.reset=function(){this.forceCompositionEnd()},Ws.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.pollContent()||dn(this.cm),this.div.blur(),this.div.focus())},Ws.prototype.readFromDOMSoon=function(){var e=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout(function(){if(e.readDOMTimeout=null,e.composing){if(!e.composing.done)return;e.composing=null}!e.cm.isReadOnly()&&e.pollContent()||un(e.cm,function(){return dn(e.cm)})},80))},Ws.prototype.setUneditable=function(e){e.contentEditable="false"},Ws.prototype.onKeyPress=function(e){0!=e.charCode&&(e.preventDefault(),this.cm.isReadOnly()||cn(this.cm,No)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0))},Ws.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},Ws.prototype.onContextMenu=function(){},Ws.prototype.resetPosition=function(){},Ws.prototype.needsContentAttribute=!0;var Os=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new vl,this.inaccurateSelection=!1,this.hasSelection=!1,this.composing=null};Os.prototype.init=function(e){function t(e){if(!Oe(i,e)){if(i.somethingSelected())Mo({lineWise:!1,text:i.getSelections()}),n.inaccurateSelection&&(n.prevInput="",n.inaccurateSelection=!1,l.value=Ns.text.join("\n"),gl(l));else{if(!i.options.lineWiseCopyCut)return;var t=Ao(i);Mo({lineWise:!0,text:t.text}),"cut"==e.type?i.setSelections(t.ranges,null,xl):(n.prevInput="",l.value=t.text.join("\n"),gl(l))}"cut"==e.type&&(i.state.cutIncoming=!0)}}var r=this,n=this,i=this.cm,o=this.wrapper=Ho(),l=this.textarea=o.firstChild;e.wrapper.insertBefore(o,e.wrapper.firstChild),ol&&(l.style.width="0px"),Dl(l,"input",function(){qo&&Zo>=9&&r.hasSelection&&(r.hasSelection=null),n.poll()}),Dl(l,"paste",function(e){Oe(i,e)||Wo(e,i)||(i.state.pasteIncoming=!0,n.fastPoll())}),Dl(l,"cut",t),Dl(l,"copy",t),Dl(e.scroller,"paste",function(t){zt(e,t)||Oe(i,t)||(i.state.pasteIncoming=!0,n.focus())}),Dl(e.lineSpace,"selectstart",function(t){zt(e,t)||Pe(t)}),Dl(l,"compositionstart",function(){var e=i.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:e,range:i.markText(e,i.getCursor("to"),{className:"CodeMirror-composing"})}}),Dl(l,"compositionend",function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)})},Os.prototype.prepareSelection=function(){var e=this.cm,t=e.display,r=e.doc,n=Tr(e);if(e.options.moveInputWithCursor){var i=ur(e,r.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),l=t.lineDiv.getBoundingClientRect();n.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+l.top-o.top)),n.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+l.left-o.left))}return n},Os.prototype.showSelection=function(e){var t=this.cm,n=t.display;r(n.cursorDiv,e.cursors),r(n.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Os.prototype.reset=function(e){if(!this.contextMenuPending){var t,r,n=this.cm,i=n.doc;if(n.somethingSelected()){this.prevInput="";var o=i.sel.primary();t=Il&&(o.to().line-o.from().line>100||(r=n.getSelection()).length>1e3);var l=t?"-":r||n.getSelection();this.textarea.value=l,n.state.focused&&gl(this.textarea),qo&&Zo>=9&&(this.hasSelection=l)}else e||(this.prevInput=this.textarea.value="",qo&&Zo>=9&&(this.hasSelection=null));this.inaccurateSelection=t}},Os.prototype.getField=function(){return this.textarea},Os.prototype.supportsTouch=function(){return!1},Os.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!ll||o()!=this.textarea))try{this.textarea.focus()}catch(e){}},Os.prototype.blur=function(){this.textarea.blur()},Os.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Os.prototype.receivedFocus=function(){this.slowPoll()},Os.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},Os.prototype.fastPoll=function(){function e(){var n=r.poll();n||t?(r.pollingFast=!1,r.slowPoll()):(t=!0,r.polling.set(60,e))}var t=!1,r=this;r.pollingFast=!0,r.polling.set(20,e)},Os.prototype.poll=function(){var e=this,t=this.cm,r=this.textarea,n=this.prevInput;if(this.contextMenuPending||!t.state.focused||El(r)&&!n&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var i=r.value;if(i==n&&!t.somethingSelected())return!1;if(qo&&Zo>=9&&this.hasSelection===i||sl&&/[\uf700-\uf7ff]/.test(i))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var o=i.charCodeAt(0);if(8203!=o||n||(n="​"),8666==o)return this.reset(),this.cm.execCommand("undo")}for(var l=0,s=Math.min(n.length,i.length);l<s&&n.charCodeAt(l)==i.charCodeAt(l);)++l;return un(t,function(){No(t,i.slice(l),n.length-l,null,e.composing?"*compose":null),i.length>1e3||i.indexOf("\n")>-1?r.value=e.prevInput="":e.prevInput=i,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},Os.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Os.prototype.onKeyPress=function(){qo&&Zo>=9&&(this.hasSelection=null),this.fastPoll()},Os.prototype.onContextMenu=function(e){function t(){if(null!=l.selectionStart){var e=i.somethingSelected(),t="​"+(e?l.value:"");l.value="⇚",l.value=t,n.prevInput=e?"":"​",l.selectionStart=1,l.selectionEnd=t.length,o.selForContextMenu=i.doc.sel}}function r(){if(n.contextMenuPending=!1,n.wrapper.style.cssText=f,l.style.cssText=c,qo&&Zo<9&&o.scrollbars.setScrollTop(o.scroller.scrollTop=a),null!=l.selectionStart){(!qo||qo&&Zo<9)&&t();var e=0,r=function(){o.selForContextMenu==i.doc.sel&&0==l.selectionStart&&l.selectionEnd>0&&"​"==n.prevInput?cn(i,mi)(i):e++<10?o.detectingSelectAll=setTimeout(r,500):(o.selForContextMenu=null,o.input.reset())};o.detectingSelectAll=setTimeout(r,200)}}var n=this,i=n.cm,o=i.display,l=n.textarea,s=Cr(i,e),a=o.scroller.scrollTop;if(s&&!tl){var u=i.options.resetSelectionOnContextMenu;u&&i.doc.sel.contains(s)==-1&&cn(i,ui)(i.doc,An(s),xl);var c=l.style.cssText,f=n.wrapper.style.cssText;n.wrapper.style.cssText="position: absolute";var h=n.wrapper.getBoundingClientRect();l.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(e.clientY-h.top-5)+"px; left: "+(e.clientX-h.left-5)+"px;\n z-index: 1000; background: "+(qo?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);";var d;if(Qo&&(d=window.scrollY),o.input.focus(),Qo&&window.scrollTo(null,d),o.input.reset(),i.somethingSelected()||(l.value=n.prevInput=" "),n.contextMenuPending=!0,o.selForContextMenu=i.doc.sel,clearTimeout(o.detectingSelectAll),qo&&Zo>=9&&t(),dl){ze(e);var p=function(){Ne(window,"mouseup",p),setTimeout(r,20)};Dl(window,"mouseup",p)}else setTimeout(r,50)}},Os.prototype.readOnlyChanged=function(e){e||this.reset()},Os.prototype.setUneditable=function(){},Os.prototype.needsContentAttribute=!1,wo(Lo),Po(Lo);var As="iter insert remove copy getEditor constructor".split(" ");for(var Ds in fs.prototype)fs.prototype.hasOwnProperty(Ds)&&f(As,Ds)<0&&(Lo.prototype[Ds]=function(e){return function(){return e.apply(this.doc,arguments)}}(fs.prototype[Ds]));return He(fs),Lo.inputStyles={
+textarea:Os,contenteditable:Ws},Lo.defineMode=function(e){Lo.defaults.mode||"null"==e||(Lo.defaults.mode=e),Ve.apply(this,arguments)},Lo.defineMIME=Ke,Lo.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Lo.defineMIME("text/plain","null"),Lo.defineExtension=function(e,t){Lo.prototype[e]=t},Lo.defineDocExtension=function(e,t){fs.prototype[e]=t},Lo.fromTextArea=Uo,Vo(Lo),Lo.version="5.24.0",Lo});
-// This is CodeMirror (http://codemirror.net), a code editor
-// implemented in JavaScript on top of the browser's DOM.
-//
-// You can find some technical background for some of the code below
-// at http://marijnhaverbeke.nl/blog/#cm-internals .
-
-(function (global, factory) {
- typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
- typeof define === 'function' && define.amd ? define(factory) :
- (global.CodeMirror = factory());
-}(this, (function () { 'use strict';
-
-// Kludges for bugs and behavior differences that can't be feature
-// detected are enabled based on userAgent etc sniffing.
-var userAgent = navigator.userAgent
-var platform = navigator.platform
-
-var gecko = /gecko\/\d/i.test(userAgent)
-var ie_upto10 = /MSIE \d/.test(userAgent)
-var ie_11up = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(userAgent)
-var edge = /Edge\/(\d+)/.exec(userAgent)
-var ie = ie_upto10 || ie_11up || edge
-var ie_version = ie && (ie_upto10 ? document.documentMode || 6 : +(edge || ie_11up)[1])
-var webkit = !edge && /WebKit\//.test(userAgent)
-var qtwebkit = webkit && /Qt\/\d+\.\d+/.test(userAgent)
-var chrome = !edge && /Chrome\//.test(userAgent)
-var presto = /Opera\//.test(userAgent)
-var safari = /Apple Computer/.test(navigator.vendor)
-var mac_geMountainLion = /Mac OS X 1\d\D([8-9]|\d\d)\D/.test(userAgent)
-var phantom = /PhantomJS/.test(userAgent)
-
-var ios = !edge && /AppleWebKit/.test(userAgent) && /Mobile\/\w+/.test(userAgent)
-// This is woefully incomplete. Suggestions for alternative methods welcome.
-var mobile = ios || /Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(userAgent)
-var mac = ios || /Mac/.test(platform)
-var chromeOS = /\bCrOS\b/.test(userAgent)
-var windows = /win/i.test(platform)
-
-var presto_version = presto && userAgent.match(/Version\/(\d*\.\d*)/)
-if (presto_version) { presto_version = Number(presto_version[1]) }
-if (presto_version && presto_version >= 15) { presto = false; webkit = true }
-// Some browsers use the wrong event properties to signal cmd/ctrl on OS X
-var flipCtrlCmd = mac && (qtwebkit || presto && (presto_version == null || presto_version < 12.11))
-var captureRightClick = gecko || (ie && ie_version >= 9)
-
-function classTest(cls) { return new RegExp("(^|\\s)" + cls + "(?:$|\\s)\\s*") }
-
-var rmClass = function(node, cls) {
- var current = node.className
- var match = classTest(cls).exec(current)
- if (match) {
- var after = current.slice(match.index + match[0].length)
- node.className = current.slice(0, match.index) + (after ? match[1] + after : "")
- }
-}
-
-function removeChildren(e) {
- for (var count = e.childNodes.length; count > 0; --count)
- { e.removeChild(e.firstChild) }
- return e
-}
-
-function removeChildrenAndAdd(parent, e) {
- return removeChildren(parent).appendChild(e)
-}
-
-function elt(tag, content, className, style) {
- var e = document.createElement(tag)
- if (className) { e.className = className }
- if (style) { e.style.cssText = style }
- if (typeof content == "string") { e.appendChild(document.createTextNode(content)) }
- else if (content) { for (var i = 0; i < content.length; ++i) { e.appendChild(content[i]) } }
- return e
-}
-
-var range
-if (document.createRange) { range = function(node, start, end, endNode) {
- var r = document.createRange()
- r.setEnd(endNode || node, end)
- r.setStart(node, start)
- return r
-} }
-else { range = function(node, start, end) {
- var r = document.body.createTextRange()
- try { r.moveToElementText(node.parentNode) }
- catch(e) { return r }
- r.collapse(true)
- r.moveEnd("character", end)
- r.moveStart("character", start)
- return r
-} }
-
-function contains(parent, child) {
- if (child.nodeType == 3) // Android browser always returns false when child is a textnode
- { child = child.parentNode }
- if (parent.contains)
- { return parent.contains(child) }
- do {
- if (child.nodeType == 11) { child = child.host }
- if (child == parent) { return true }
- } while (child = child.parentNode)
-}
-
-function activeElt() {
- // IE and Edge may throw an "Unspecified Error" when accessing document.activeElement.
- // IE < 10 will throw when accessed while the page is loading or in an iframe.
- // IE > 9 and Edge will throw when accessed in an iframe if document.body is unavailable.
- var activeElement
- try {
- activeElement = document.activeElement
- } catch(e) {
- activeElement = document.body || null
- }
- while (activeElement && activeElement.root && activeElement.root.activeElement)
- { activeElement = activeElement.root.activeElement }
- return activeElement
-}
-
-function addClass(node, cls) {
- var current = node.className
- if (!classTest(cls).test(current)) { node.className += (current ? " " : "") + cls }
-}
-function joinClasses(a, b) {
- var as = a.split(" ")
- for (var i = 0; i < as.length; i++)
- { if (as[i] && !classTest(as[i]).test(b)) { b += " " + as[i] } }
- return b
-}
-
-var selectInput = function(node) { node.select() }
-if (ios) // Mobile Safari apparently has a bug where select() is broken.
- { selectInput = function(node) { node.selectionStart = 0; node.selectionEnd = node.value.length } }
-else if (ie) // Suppress mysterious IE10 errors
- { selectInput = function(node) { try { node.select() } catch(_e) {} } }
-
-function bind(f) {
- var args = Array.prototype.slice.call(arguments, 1)
- return function(){return f.apply(null, args)}
-}
-
-function copyObj(obj, target, overwrite) {
- if (!target) { target = {} }
- for (var prop in obj)
- { if (obj.hasOwnProperty(prop) && (overwrite !== false || !target.hasOwnProperty(prop)))
- { target[prop] = obj[prop] } }
- return target
-}
-
-// Counts the column offset in a string, taking tabs into account.
-// Used mostly to find indentation.
-function countColumn(string, end, tabSize, startIndex, startValue) {
- if (end == null) {
- end = string.search(/[^\s\u00a0]/)
- if (end == -1) { end = string.length }
- }
- for (var i = startIndex || 0, n = startValue || 0;;) {
- var nextTab = string.indexOf("\t", i)
- if (nextTab < 0 || nextTab >= end)
- { return n + (end - i) }
- n += nextTab - i
- n += tabSize - (n % tabSize)
- i = nextTab + 1
- }
-}
-
-var Delayed = function() {this.id = null};
-Delayed.prototype.set = function (ms, f) {
- clearTimeout(this.id)
- this.id = setTimeout(f, ms)
-};
-
-function indexOf(array, elt) {
- for (var i = 0; i < array.length; ++i)
- { if (array[i] == elt) { return i } }
- return -1
-}
-
-// Number of pixels added to scroller and sizer to hide scrollbar
-var scrollerGap = 30
-
-// Returned or thrown by various protocols to signal 'I'm not
-// handling this'.
-var Pass = {toString: function(){return "CodeMirror.Pass"}}
-
-// Reused option objects for setSelection & friends
-var sel_dontScroll = {scroll: false};
-var sel_mouse = {origin: "*mouse"};
-var sel_move = {origin: "+move"};
-// The inverse of countColumn -- find the offset that corresponds to
-// a particular column.
-function findColumn(string, goal, tabSize) {
- for (var pos = 0, col = 0;;) {
- var nextTab = string.indexOf("\t", pos)
- if (nextTab == -1) { nextTab = string.length }
- var skipped = nextTab - pos
- if (nextTab == string.length || col + skipped >= goal)
- { return pos + Math.min(skipped, goal - col) }
- col += nextTab - pos
- col += tabSize - (col % tabSize)
- pos = nextTab + 1
- if (col >= goal) { return pos }
- }
-}
-
-var spaceStrs = [""]
-function spaceStr(n) {
- while (spaceStrs.length <= n)
- { spaceStrs.push(lst(spaceStrs) + " ") }
- return spaceStrs[n]
-}
-
-function lst(arr) { return arr[arr.length-1] }
-
-function map(array, f) {
- var out = []
- for (var i = 0; i < array.length; i++) { out[i] = f(array[i], i) }
- return out
-}
-
-function insertSorted(array, value, score) {
- var pos = 0, priority = score(value)
- while (pos < array.length && score(array[pos]) <= priority) { pos++ }
- array.splice(pos, 0, value)
-}
-
-function nothing() {}
-
-function createObj(base, props) {
- var inst
- if (Object.create) {
- inst = Object.create(base)
- } else {
- nothing.prototype = base
- inst = new nothing()
- }
- if (props) { copyObj(props, inst) }
- return inst
-}
-
-var nonASCIISingleCaseWordChar = /[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/
-function isWordCharBasic(ch) {
- return /\w/.test(ch) || ch > "\x80" &&
- (ch.toUpperCase() != ch.toLowerCase() || nonASCIISingleCaseWordChar.test(ch))
-}
-function isWordChar(ch, helper) {
- if (!helper) { return isWordCharBasic(ch) }
- if (helper.source.indexOf("\\w") > -1 && isWordCharBasic(ch)) { return true }
- return helper.test(ch)
-}
-
-function isEmpty(obj) {
- for (var n in obj) { if (obj.hasOwnProperty(n) && obj[n]) { return false } }
- return true
-}
-
-// Extending unicode characters. A series of a non-extending char +
-// any number of extending chars is treated as a single unit as far
-// as editing and measuring is concerned. This is not fully correct,
-// since some scripts/fonts/browsers also treat other configurations
-// of code points as a group.
-var extendingChars = /[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/
-function isExtendingChar(ch) { return ch.charCodeAt(0) >= 768 && extendingChars.test(ch) }
-
-// Returns a number from the range [`0`; `str.length`] unless `pos` is outside that range.
-function skipExtendingChars(str, pos, dir) {
- while ((dir < 0 ? pos > 0 : pos < str.length) && isExtendingChar(str.charAt(pos))) { pos += dir }
- return pos
-}
-
-// Returns the value from the range [`from`; `to`] that satisfies
-// `pred` and is closest to `from`. Assumes that at least `to` satisfies `pred`.
-function findFirst(pred, from, to) {
- for (;;) {
- if (Math.abs(from - to) <= 1) { return pred(from) ? from : to }
- var mid = Math.floor((from + to) / 2)
- if (pred(mid)) { to = mid }
- else { from = mid }
- }
-}
-
-// The display handles the DOM integration, both for input reading
-// and content drawing. It holds references to DOM nodes and
-// display-related state.
-
-function Display(place, doc, input) {
- var d = this
- this.input = input
-
- // Covers bottom-right square when both scrollbars are present.
- d.scrollbarFiller = elt("div", null, "CodeMirror-scrollbar-filler")
- d.scrollbarFiller.setAttribute("cm-not-content", "true")
- // Covers bottom of gutter when coverGutterNextToScrollbar is on
- // and h scrollbar is present.
- d.gutterFiller = elt("div", null, "CodeMirror-gutter-filler")
- d.gutterFiller.setAttribute("cm-not-content", "true")
- // Will contain the actual code, positioned to cover the viewport.
- d.lineDiv = elt("div", null, "CodeMirror-code")
- // Elements are added to these to represent selection and cursors.
- d.selectionDiv = elt("div", null, null, "position: relative; z-index: 1")
- d.cursorDiv = elt("div", null, "CodeMirror-cursors")
- // A visibility: hidden element used to find the size of things.
- d.measure = elt("div", null, "CodeMirror-measure")
- // When lines outside of the viewport are measured, they are drawn in this.
- d.lineMeasure = elt("div", null, "CodeMirror-measure")
- // Wraps everything that needs to exist inside the vertically-padded coordinate system
- d.lineSpace = elt("div", [d.measure, d.lineMeasure, d.selectionDiv, d.cursorDiv, d.lineDiv],
- null, "position: relative; outline: none")
- // Moved around its parent to cover visible view.
- d.mover = elt("div", [elt("div", [d.lineSpace], "CodeMirror-lines")], null, "position: relative")
- // Set to the height of the document, allowing scrolling.
- d.sizer = elt("div", [d.mover], "CodeMirror-sizer")
- d.sizerWidth = null
- // Behavior of elts with overflow: auto and padding is
- // inconsistent across browsers. This is used to ensure the
- // scrollable area is big enough.
- d.heightForcer = elt("div", null, null, "position: absolute; height: " + scrollerGap + "px; width: 1px;")
- // Will contain the gutters, if any.
- d.gutters = elt("div", null, "CodeMirror-gutters")
- d.lineGutter = null
- // Actual scrollable element.
- d.scroller = elt("div", [d.sizer, d.heightForcer, d.gutters], "CodeMirror-scroll")
- d.scroller.setAttribute("tabIndex", "-1")
- // The element in which the editor lives.
- d.wrapper = elt("div", [d.scrollbarFiller, d.gutterFiller, d.scroller], "CodeMirror")
-
- // Work around IE7 z-index bug (not perfect, hence IE7 not really being supported)
- if (ie && ie_version < 8) { d.gutters.style.zIndex = -1; d.scroller.style.paddingRight = 0 }
- if (!webkit && !(gecko && mobile)) { d.scroller.draggable = true }
-
- if (place) {
- if (place.appendChild) { place.appendChild(d.wrapper) }
- else { place(d.wrapper) }
- }
-
- // Current rendered range (may be bigger than the view window).
- d.viewFrom = d.viewTo = doc.first
- d.reportedViewFrom = d.reportedViewTo = doc.first
- // Information about the rendered lines.
- d.view = []
- d.renderedView = null
- // Holds info about a single rendered line when it was rendered
- // for measurement, while not in view.
- d.externalMeasured = null
- // Empty space (in pixels) above the view
- d.viewOffset = 0
- d.lastWrapHeight = d.lastWrapWidth = 0
- d.updateLineNumbers = null
-
- d.nativeBarWidth = d.barHeight = d.barWidth = 0
- d.scrollbarsClipped = false
-
- // Used to only resize the line number gutter when necessary (when
- // the amount of lines crosses a boundary that makes its width change)
- d.lineNumWidth = d.lineNumInnerWidth = d.lineNumChars = null
- // Set to true when a non-horizontal-scrolling line widget is
- // added. As an optimization, line widget aligning is skipped when
- // this is false.
- d.alignWidgets = false
-
- d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null
-
- // Tracks the maximum line length so that the horizontal scrollbar
- // can be kept static when scrolling.
- d.maxLine = null
- d.maxLineLength = 0
- d.maxLineChanged = false
-
- // Used for measuring wheel scrolling granularity
- d.wheelDX = d.wheelDY = d.wheelStartX = d.wheelStartY = null
-
- // True when shift is held down.
- d.shift = false
-
- // Used to track whether anything happened since the context menu
- // was opened.
- d.selForContextMenu = null
-
- d.activeTouch = null
-
- input.init(d)
-}
-
-// Find the line object corresponding to the given line number.
-function getLine(doc, n) {
- n -= doc.first
- if (n < 0 || n >= doc.size) { throw new Error("There is no line " + (n + doc.first) + " in the document.") }
- var chunk = doc
- while (!chunk.lines) {
- for (var i = 0;; ++i) {
- var child = chunk.children[i], sz = child.chunkSize()
- if (n < sz) { chunk = child; break }
- n -= sz
- }
- }
- return chunk.lines[n]
-}
-
-// Get the part of a document between two positions, as an array of
-// strings.
-function getBetween(doc, start, end) {
- var out = [], n = start.line
- doc.iter(start.line, end.line + 1, function (line) {
- var text = line.text
- if (n == end.line) { text = text.slice(0, end.ch) }
- if (n == start.line) { text = text.slice(start.ch) }
- out.push(text)
- ++n
- })
- return out
-}
-// Get the lines between from and to, as array of strings.
-function getLines(doc, from, to) {
- var out = []
- doc.iter(from, to, function (line) { out.push(line.text) }) // iter aborts when callback returns truthy value
- return out
-}
-
-// Update the height of a line, propagating the height change
-// upwards to parent nodes.
-function updateLineHeight(line, height) {
- var diff = height - line.height
- if (diff) { for (var n = line; n; n = n.parent) { n.height += diff } }
-}
-
-// Given a line object, find its line number by walking up through
-// its parent links.
-function lineNo(line) {
- if (line.parent == null) { return null }
- var cur = line.parent, no = indexOf(cur.lines, line)
- for (var chunk = cur.parent; chunk; cur = chunk, chunk = chunk.parent) {
- for (var i = 0;; ++i) {
- if (chunk.children[i] == cur) { break }
- no += chunk.children[i].chunkSize()
- }
- }
- return no + cur.first
-}
-
-// Find the line at the given vertical position, using the height
-// information in the document tree.
-function lineAtHeight(chunk, h) {
- var n = chunk.first
- outer: do {
- for (var i$1 = 0; i$1 < chunk.children.length; ++i$1) {
- var child = chunk.children[i$1], ch = child.height
- if (h < ch) { chunk = child; continue outer }
- h -= ch
- n += child.chunkSize()
- }
- return n
- } while (!chunk.lines)
- var i = 0
- for (; i < chunk.lines.length; ++i) {
- var line = chunk.lines[i], lh = line.height
- if (h < lh) { break }
- h -= lh
- }
- return n + i
-}
-
-function isLine(doc, l) {return l >= doc.first && l < doc.first + doc.size}
-
-function lineNumberFor(options, i) {
- return String(options.lineNumberFormatter(i + options.firstLineNumber))
-}
-
-// A Pos instance represents a position within the text.
-function Pos(line, ch, sticky) {
- if ( sticky === void 0 ) sticky = null;
-
- if (!(this instanceof Pos)) { return new Pos(line, ch, sticky) }
- this.line = line
- this.ch = ch
- this.sticky = sticky
-}
-
-// Compare two positions, return 0 if they are the same, a negative
-// number when a is less, and a positive number otherwise.
-function cmp(a, b) { return a.line - b.line || a.ch - b.ch }
-
-function equalCursorPos(a, b) { return a.sticky == b.sticky && cmp(a, b) == 0 }
-
-function copyPos(x) {return Pos(x.line, x.ch)}
-function maxPos(a, b) { return cmp(a, b) < 0 ? b : a }
-function minPos(a, b) { return cmp(a, b) < 0 ? a : b }
-
-// Most of the external API clips given positions to make sure they
-// actually exist within the document.
-function clipLine(doc, n) {return Math.max(doc.first, Math.min(n, doc.first + doc.size - 1))}
-function clipPos(doc, pos) {
- if (pos.line < doc.first) { return Pos(doc.first, 0) }
- var last = doc.first + doc.size - 1
- if (pos.line > last) { return Pos(last, getLine(doc, last).text.length) }
- return clipToLen(pos, getLine(doc, pos.line).text.length)
-}
-function clipToLen(pos, linelen) {
- var ch = pos.ch
- if (ch == null || ch > linelen) { return Pos(pos.line, linelen) }
- else if (ch < 0) { return Pos(pos.line, 0) }
- else { return pos }
-}
-function clipPosArray(doc, array) {
- var out = []
- for (var i = 0; i < array.length; i++) { out[i] = clipPos(doc, array[i]) }
- return out
-}
-
-// Optimize some code when these features are not used.
-var sawReadOnlySpans = false;
-var sawCollapsedSpans = false;
-function seeReadOnlySpans() {
- sawReadOnlySpans = true
-}
-
-function seeCollapsedSpans() {
- sawCollapsedSpans = true
-}
-
-// TEXTMARKER SPANS
-
-function MarkedSpan(marker, from, to) {
- this.marker = marker
- this.from = from; this.to = to
-}
-
-// Search an array of spans for a span matching the given marker.
-function getMarkedSpanFor(spans, marker) {
- if (spans) { for (var i = 0; i < spans.length; ++i) {
- var span = spans[i]
- if (span.marker == marker) { return span }
- } }
-}
-// Remove a span from an array, returning undefined if no spans are
-// left (we don't store arrays for lines without spans).
-function removeMarkedSpan(spans, span) {
- var r
- for (var i = 0; i < spans.length; ++i)
- { if (spans[i] != span) { (r || (r = [])).push(spans[i]) } }
- return r
-}
-// Add a span to a line.
-function addMarkedSpan(line, span) {
- line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span]
- span.marker.attachLine(line)
-}
-
-// Used for the algorithm that adjusts markers for a change in the
-// document. These functions cut an array of spans at a given
-// character position, returning an array of remaining chunks (or
-// undefined if nothing remains).
-function markedSpansBefore(old, startCh, isInsert) {
- var nw
- if (old) { for (var i = 0; i < old.length; ++i) {
- var span = old[i], marker = span.marker
- var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= startCh : span.from < startCh)
- if (startsBefore || span.from == startCh && marker.type == "bookmark" && (!isInsert || !span.marker.insertLeft)) {
- var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= startCh : span.to > startCh)
- ;(nw || (nw = [])).push(new MarkedSpan(marker, span.from, endsAfter ? null : span.to))
- }
- } }
- return nw
-}
-function markedSpansAfter(old, endCh, isInsert) {
- var nw
- if (old) { for (var i = 0; i < old.length; ++i) {
- var span = old[i], marker = span.marker
- var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= endCh : span.to > endCh)
- if (endsAfter || span.from == endCh && marker.type == "bookmark" && (!isInsert || span.marker.insertLeft)) {
- var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= endCh : span.from < endCh)
- ;(nw || (nw = [])).push(new MarkedSpan(marker, startsBefore ? null : span.from - endCh,
- span.to == null ? null : span.to - endCh))
- }
- } }
- return nw
-}
-
-// Given a change object, compute the new set of marker spans that
-// cover the line in which the change took place. Removes spans
-// entirely within the change, reconnects spans belonging to the
-// same marker that appear on both sides of the change, and cuts off
-// spans partially within the change. Returns an array of span
-// arrays with one element for each line in (after) the change.
-function stretchSpansOverChange(doc, change) {
- if (change.full) { return null }
- var oldFirst = isLine(doc, change.from.line) && getLine(doc, change.from.line).markedSpans
- var oldLast = isLine(doc, change.to.line) && getLine(doc, change.to.line).markedSpans
- if (!oldFirst && !oldLast) { return null }
-
- var startCh = change.from.ch, endCh = change.to.ch, isInsert = cmp(change.from, change.to) == 0
- // Get the spans that 'stick out' on both sides
- var first = markedSpansBefore(oldFirst, startCh, isInsert)
- var last = markedSpansAfter(oldLast, endCh, isInsert)
-
- // Next, merge those two ends
- var sameLine = change.text.length == 1, offset = lst(change.text).length + (sameLine ? startCh : 0)
- if (first) {
- // Fix up .to properties of first
- for (var i = 0; i < first.length; ++i) {
- var span = first[i]
- if (span.to == null) {
- var found = getMarkedSpanFor(last, span.marker)
- if (!found) { span.to = startCh }
- else if (sameLine) { span.to = found.to == null ? null : found.to + offset }
- }
- }
- }
- if (last) {
- // Fix up .from in last (or move them into first in case of sameLine)
- for (var i$1 = 0; i$1 < last.length; ++i$1) {
- var span$1 = last[i$1]
- if (span$1.to != null) { span$1.to += offset }
- if (span$1.from == null) {
- var found$1 = getMarkedSpanFor(first, span$1.marker)
- if (!found$1) {
- span$1.from = offset
- if (sameLine) { (first || (first = [])).push(span$1) }
- }
- } else {
- span$1.from += offset
- if (sameLine) { (first || (first = [])).push(span$1) }
- }
- }
- }
- // Make sure we didn't create any zero-length spans
- if (first) { first = clearEmptySpans(first) }
- if (last && last != first) { last = clearEmptySpans(last) }
-
- var newMarkers = [first]
- if (!sameLine) {
- // Fill gap with whole-line-spans
- var gap = change.text.length - 2, gapMarkers
- if (gap > 0 && first)
- { for (var i$2 = 0; i$2 < first.length; ++i$2)
- { if (first[i$2].to == null)
- { (gapMarkers || (gapMarkers = [])).push(new MarkedSpan(first[i$2].marker, null, null)) } } }
- for (var i$3 = 0; i$3 < gap; ++i$3)
- { newMarkers.push(gapMarkers) }
- newMarkers.push(last)
- }
- return newMarkers
-}
-
-// Remove spans that are empty and don't have a clearWhenEmpty
-// option of false.
-function clearEmptySpans(spans) {
- for (var i = 0; i < spans.length; ++i) {
- var span = spans[i]
- if (span.from != null && span.from == span.to && span.marker.clearWhenEmpty !== false)
- { spans.splice(i--, 1) }
- }
- if (!spans.length) { return null }
- return spans
-}
-
-// Used to 'clip' out readOnly ranges when making a change.
-function removeReadOnlyRanges(doc, from, to) {
- var markers = null
- doc.iter(from.line, to.line + 1, function (line) {
- if (line.markedSpans) { for (var i = 0; i < line.markedSpans.length; ++i) {
- var mark = line.markedSpans[i].marker
- if (mark.readOnly && (!markers || indexOf(markers, mark) == -1))
- { (markers || (markers = [])).push(mark) }
- } }
- })
- if (!markers) { return null }
- var parts = [{from: from, to: to}]
- for (var i = 0; i < markers.length; ++i) {
- var mk = markers[i], m = mk.find(0)
- for (var j = 0; j < parts.length; ++j) {
- var p = parts[j]
- if (cmp(p.to, m.from) < 0 || cmp(p.from, m.to) > 0) { continue }
- var newParts = [j, 1], dfrom = cmp(p.from, m.from), dto = cmp(p.to, m.to)
- if (dfrom < 0 || !mk.inclusiveLeft && !dfrom)
- { newParts.push({from: p.from, to: m.from}) }
- if (dto > 0 || !mk.inclusiveRight && !dto)
- { newParts.push({from: m.to, to: p.to}) }
- parts.splice.apply(parts, newParts)
- j += newParts.length - 3
- }
- }
- return parts
-}
-
-// Connect or disconnect spans from a line.
-function detachMarkedSpans(line) {
- var spans = line.markedSpans
- if (!spans) { return }
- for (var i = 0; i < spans.length; ++i)
- { spans[i].marker.detachLine(line) }
- line.markedSpans = null
-}
-function attachMarkedSpans(line, spans) {
- if (!spans) { return }
- for (var i = 0; i < spans.length; ++i)
- { spans[i].marker.attachLine(line) }
- line.markedSpans = spans
-}
-
-// Helpers used when computing which overlapping collapsed span
-// counts as the larger one.
-function extraLeft(marker) { return marker.inclusiveLeft ? -1 : 0 }
-function extraRight(marker) { return marker.inclusiveRight ? 1 : 0 }
-
-// Returns a number indicating which of two overlapping collapsed
-// spans is larger (and thus includes the other). Falls back to
-// comparing ids when the spans cover exactly the same range.
-function compareCollapsedMarkers(a, b) {
- var lenDiff = a.lines.length - b.lines.length
- if (lenDiff != 0) { return lenDiff }
- var aPos = a.find(), bPos = b.find()
- var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b)
- if (fromCmp) { return -fromCmp }
- var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b)
- if (toCmp) { return toCmp }
- return b.id - a.id
-}
-
-// Find out whether a line ends or starts in a collapsed span. If
-// so, return the marker for that span.
-function collapsedSpanAtSide(line, start) {
- var sps = sawCollapsedSpans && line.markedSpans, found
- if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {
- sp = sps[i]
- if (sp.marker.collapsed && (start ? sp.from : sp.to) == null &&
- (!found || compareCollapsedMarkers(found, sp.marker) < 0))
- { found = sp.marker }
- } }
- return found
-}
-function collapsedSpanAtStart(line) { return collapsedSpanAtSide(line, true) }
-function collapsedSpanAtEnd(line) { return collapsedSpanAtSide(line, false) }
-
-// Test whether there exists a collapsed span that partially
-// overlaps (covers the start or end, but not both) of a new span.
-// Such overlap is not allowed.
-function conflictingCollapsedRange(doc, lineNo, from, to, marker) {
- var line = getLine(doc, lineNo)
- var sps = sawCollapsedSpans && line.markedSpans
- if (sps) { for (var i = 0; i < sps.length; ++i) {
- var sp = sps[i]
- if (!sp.marker.collapsed) { continue }
- var found = sp.marker.find(0)
- var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker)
- var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker)
- if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { continue }
- if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) ||
- fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0))
- { return true }
- } }
-}
-
-// A visual line is a line as drawn on the screen. Folding, for
-// example, can cause multiple logical lines to appear on the same
-// visual line. This finds the start of the visual line that the
-// given line is part of (usually that is the line itself).
-function visualLine(line) {
- var merged
- while (merged = collapsedSpanAtStart(line))
- { line = merged.find(-1, true).line }
- return line
-}
-
-function visualLineEnd(line) {
- var merged
- while (merged = collapsedSpanAtEnd(line))
- { line = merged.find(1, true).line }
- return line
-}
-
-// Returns an array of logical lines that continue the visual line
-// started by the argument, or undefined if there are no such lines.
-function visualLineContinued(line) {
- var merged, lines
- while (merged = collapsedSpanAtEnd(line)) {
- line = merged.find(1, true).line
- ;(lines || (lines = [])).push(line)
- }
- return lines
-}
-
-// Get the line number of the start of the visual line that the
-// given line number is part of.
-function visualLineNo(doc, lineN) {
- var line = getLine(doc, lineN), vis = visualLine(line)
- if (line == vis) { return lineN }
- return lineNo(vis)
-}
-
-// Get the line number of the start of the next visual line after
-// the given line.
-function visualLineEndNo(doc, lineN) {
- if (lineN > doc.lastLine()) { return lineN }
- var line = getLine(doc, lineN), merged
- if (!lineIsHidden(doc, line)) { return lineN }
- while (merged = collapsedSpanAtEnd(line))
- { line = merged.find(1, true).line }
- return lineNo(line) + 1
-}
-
-// Compute whether a line is hidden. Lines count as hidden when they
-// are part of a visual line that starts with another line, or when
-// they are entirely covered by collapsed, non-widget span.
-function lineIsHidden(doc, line) {
- var sps = sawCollapsedSpans && line.markedSpans
- if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {
- sp = sps[i]
- if (!sp.marker.collapsed) { continue }
- if (sp.from == null) { return true }
- if (sp.marker.widgetNode) { continue }
- if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp))
- { return true }
- } }
-}
-function lineIsHiddenInner(doc, line, span) {
- if (span.to == null) {
- var end = span.marker.find(1, true)
- return lineIsHiddenInner(doc, end.line, getMarkedSpanFor(end.line.markedSpans, span.marker))
- }
- if (span.marker.inclusiveRight && span.to == line.text.length)
- { return true }
- for (var sp = (void 0), i = 0; i < line.markedSpans.length; ++i) {
- sp = line.markedSpans[i]
- if (sp.marker.collapsed && !sp.marker.widgetNode && sp.from == span.to &&
- (sp.to == null || sp.to != span.from) &&
- (sp.marker.inclusiveLeft || span.marker.inclusiveRight) &&
- lineIsHiddenInner(doc, line, sp)) { return true }
- }
-}
-
-// Find the height above the given line.
-function heightAtLine(lineObj) {
- lineObj = visualLine(lineObj)
-
- var h = 0, chunk = lineObj.parent
- for (var i = 0; i < chunk.lines.length; ++i) {
- var line = chunk.lines[i]
- if (line == lineObj) { break }
- else { h += line.height }
- }
- for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {
- for (var i$1 = 0; i$1 < p.children.length; ++i$1) {
- var cur = p.children[i$1]
- if (cur == chunk) { break }
- else { h += cur.height }
- }
- }
- return h
-}
-
-// Compute the character length of a line, taking into account
-// collapsed ranges (see markText) that might hide parts, and join
-// other lines onto it.
-function lineLength(line) {
- if (line.height == 0) { return 0 }
- var len = line.text.length, merged, cur = line
- while (merged = collapsedSpanAtStart(cur)) {
- var found = merged.find(0, true)
- cur = found.from.line
- len += found.from.ch - found.to.ch
- }
- cur = line
- while (merged = collapsedSpanAtEnd(cur)) {
- var found$1 = merged.find(0, true)
- len -= cur.text.length - found$1.from.ch
- cur = found$1.to.line
- len += cur.text.length - found$1.to.ch
- }
- return len
-}
-
-// Find the longest line in the document.
-function findMaxLine(cm) {
- var d = cm.display, doc = cm.doc
- d.maxLine = getLine(doc, doc.first)
- d.maxLineLength = lineLength(d.maxLine)
- d.maxLineChanged = true
- doc.iter(function (line) {
- var len = lineLength(line)
- if (len > d.maxLineLength) {
- d.maxLineLength = len
- d.maxLine = line
- }
- })
-}
-
-// BIDI HELPERS
-
-function iterateBidiSections(order, from, to, f) {
- if (!order) { return f(from, to, "ltr") }
- var found = false
- for (var i = 0; i < order.length; ++i) {
- var part = order[i]
- if (part.from < to && part.to > from || from == to && part.to == from) {
- f(Math.max(part.from, from), Math.min(part.to, to), part.level == 1 ? "rtl" : "ltr")
- found = true
- }
- }
- if (!found) { f(from, to, "ltr") }
-}
-
-var bidiOther = null
-function getBidiPartAt(order, ch, sticky) {
- var found
- bidiOther = null
- for (var i = 0; i < order.length; ++i) {
- var cur = order[i]
- if (cur.from < ch && cur.to > ch) { return i }
- if (cur.to == ch) {
- if (cur.from != cur.to && sticky == "before") { found = i }
- else { bidiOther = i }
- }
- if (cur.from == ch) {
- if (cur.from != cur.to && sticky != "before") { found = i }
- else { bidiOther = i }
- }
- }
- return found != null ? found : bidiOther
-}
-
-// Bidirectional ordering algorithm
-// See http://unicode.org/reports/tr9/tr9-13.html for the algorithm
-// that this (partially) implements.
-
-// One-char codes used for character types:
-// L (L): Left-to-Right
-// R (R): Right-to-Left
-// r (AL): Right-to-Left Arabic
-// 1 (EN): European Number
-// + (ES): European Number Separator
-// % (ET): European Number Terminator
-// n (AN): Arabic Number
-// , (CS): Common Number Separator
-// m (NSM): Non-Spacing Mark
-// b (BN): Boundary Neutral
-// s (B): Paragraph Separator
-// t (S): Segment Separator
-// w (WS): Whitespace
-// N (ON): Other Neutrals
-
-// Returns null if characters are ordered as they appear
-// (left-to-right), or an array of sections ({from, to, level}
-// objects) in the order in which they occur visually.
-var bidiOrdering = (function() {
- // Character types for codepoints 0 to 0xff
- var lowTypes = "bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN"
- // Character types for codepoints 0x600 to 0x6f9
- var arabicTypes = "nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111"
- function charType(code) {
- if (code <= 0xf7) { return lowTypes.charAt(code) }
- else if (0x590 <= code && code <= 0x5f4) { return "R" }
- else if (0x600 <= code && code <= 0x6f9) { return arabicTypes.charAt(code - 0x600) }
- else if (0x6ee <= code && code <= 0x8ac) { return "r" }
- else if (0x2000 <= code && code <= 0x200b) { return "w" }
- else if (code == 0x200c) { return "b" }
- else { return "L" }
- }
-
- var bidiRE = /[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/
- var isNeutral = /[stwN]/, isStrong = /[LRr]/, countsAsLeft = /[Lb1n]/, countsAsNum = /[1n]/
- // Browsers seem to always treat the boundaries of block elements as being L.
- var outerType = "L"
-
- function BidiSpan(level, from, to) {
- this.level = level
- this.from = from; this.to = to
- }
-
- return function(str) {
- if (!bidiRE.test(str)) { return false }
- var len = str.length, types = []
- for (var i = 0; i < len; ++i)
- { types.push(charType(str.charCodeAt(i))) }
-
- // W1. Examine each non-spacing mark (NSM) in the level run, and
- // change the type of the NSM to the type of the previous
- // character. If the NSM is at the start of the level run, it will
- // get the type of sor.
- for (var i$1 = 0, prev = outerType; i$1 < len; ++i$1) {
- var type = types[i$1]
- if (type == "m") { types[i$1] = prev }
- else { prev = type }
- }
-
- // W2. Search backwards from each instance of a European number
- // until the first strong type (R, L, AL, or sor) is found. If an
- // AL is found, change the type of the European number to Arabic
- // number.
- // W3. Change all ALs to R.
- for (var i$2 = 0, cur = outerType; i$2 < len; ++i$2) {
- var type$1 = types[i$2]
- if (type$1 == "1" && cur == "r") { types[i$2] = "n" }
- else if (isStrong.test(type$1)) { cur = type$1; if (type$1 == "r") { types[i$2] = "R" } }
- }
-
- // W4. A single European separator between two European numbers
- // changes to a European number. A single common separator between
- // two numbers of the same type changes to that type.
- for (var i$3 = 1, prev$1 = types[0]; i$3 < len - 1; ++i$3) {
- var type$2 = types[i$3]
- if (type$2 == "+" && prev$1 == "1" && types[i$3+1] == "1") { types[i$3] = "1" }
- else if (type$2 == "," && prev$1 == types[i$3+1] &&
- (prev$1 == "1" || prev$1 == "n")) { types[i$3] = prev$1 }
- prev$1 = type$2
- }
-
- // W5. A sequence of European terminators adjacent to European
- // numbers changes to all European numbers.
- // W6. Otherwise, separators and terminators change to Other
- // Neutral.
- for (var i$4 = 0; i$4 < len; ++i$4) {
- var type$3 = types[i$4]
- if (type$3 == ",") { types[i$4] = "N" }
- else if (type$3 == "%") {
- var end = (void 0)
- for (end = i$4 + 1; end < len && types[end] == "%"; ++end) {}
- var replace = (i$4 && types[i$4-1] == "!") || (end < len && types[end] == "1") ? "1" : "N"
- for (var j = i$4; j < end; ++j) { types[j] = replace }
- i$4 = end - 1
- }
- }
-
- // W7. Search backwards from each instance of a European number
- // until the first strong type (R, L, or sor) is found. If an L is
- // found, then change the type of the European number to L.
- for (var i$5 = 0, cur$1 = outerType; i$5 < len; ++i$5) {
- var type$4 = types[i$5]
- if (cur$1 == "L" && type$4 == "1") { types[i$5] = "L" }
- else if (isStrong.test(type$4)) { cur$1 = type$4 }
- }
-
- // N1. A sequence of neutrals takes the direction of the
- // surrounding strong text if the text on both sides has the same
- // direction. European and Arabic numbers act as if they were R in
- // terms of their influence on neutrals. Start-of-level-run (sor)
- // and end-of-level-run (eor) are used at level run boundaries.
- // N2. Any remaining neutrals take the embedding direction.
- for (var i$6 = 0; i$6 < len; ++i$6) {
- if (isNeutral.test(types[i$6])) {
- var end$1 = (void 0)
- for (end$1 = i$6 + 1; end$1 < len && isNeutral.test(types[end$1]); ++end$1) {}
- var before = (i$6 ? types[i$6-1] : outerType) == "L"
- var after = (end$1 < len ? types[end$1] : outerType) == "L"
- var replace$1 = before || after ? "L" : "R"
- for (var j$1 = i$6; j$1 < end$1; ++j$1) { types[j$1] = replace$1 }
- i$6 = end$1 - 1
- }
- }
-
- // Here we depart from the documented algorithm, in order to avoid
- // building up an actual levels array. Since there are only three
- // levels (0, 1, 2) in an implementation that doesn't take
- // explicit embedding into account, we can build up the order on
- // the fly, without following the level-based algorithm.
- var order = [], m
- for (var i$7 = 0; i$7 < len;) {
- if (countsAsLeft.test(types[i$7])) {
- var start = i$7
- for (++i$7; i$7 < len && countsAsLeft.test(types[i$7]); ++i$7) {}
- order.push(new BidiSpan(0, start, i$7))
- } else {
- var pos = i$7, at = order.length
- for (++i$7; i$7 < len && types[i$7] != "L"; ++i$7) {}
- for (var j$2 = pos; j$2 < i$7;) {
- if (countsAsNum.test(types[j$2])) {
- if (pos < j$2) { order.splice(at, 0, new BidiSpan(1, pos, j$2)) }
- var nstart = j$2
- for (++j$2; j$2 < i$7 && countsAsNum.test(types[j$2]); ++j$2) {}
- order.splice(at, 0, new BidiSpan(2, nstart, j$2))
- pos = j$2
- } else { ++j$2 }
- }
- if (pos < i$7) { order.splice(at, 0, new BidiSpan(1, pos, i$7)) }
- }
- }
- if (order[0].level == 1 && (m = str.match(/^\s+/))) {
- order[0].from = m[0].length
- order.unshift(new BidiSpan(0, 0, m[0].length))
- }
- if (lst(order).level == 1 && (m = str.match(/\s+$/))) {
- lst(order).to -= m[0].length
- order.push(new BidiSpan(0, len - m[0].length, len))
- }
-
- return order
- }
-})()
-
-// Get the bidi ordering for the given line (and cache it). Returns
-// false for lines that are fully left-to-right, and an array of
-// BidiSpan objects otherwise.
-function getOrder(line) {
- var order = line.order
- if (order == null) { order = line.order = bidiOrdering(line.text) }
- return order
-}
-
-function moveCharLogically(line, ch, dir) {
- var target = skipExtendingChars(line.text, ch + dir, dir)
- return target < 0 || target > line.text.length ? null : target
-}
-
-function moveLogically(line, start, dir) {
- var ch = moveCharLogically(line, start.ch, dir)
- return ch == null ? null : new Pos(start.line, ch, dir < 0 ? "after" : "before")
-}
-
-function endOfLine(visually, cm, lineObj, lineNo, dir) {
- if (visually) {
- var order = getOrder(lineObj)
- if (order) {
- var part = dir < 0 ? lst(order) : order[0]
- var moveInStorageOrder = (dir < 0) == (part.level == 1)
- var sticky = moveInStorageOrder ? "after" : "before"
- var ch
- // With a wrapped rtl chunk (possibly spanning multiple bidi parts),
- // it could be that the last bidi part is not on the last visual line,
- // since visual lines contain content order-consecutive chunks.
- // Thus, in rtl, we are looking for the first (content-order) character
- // in the rtl chunk that is on the last line (that is, the same line
- // as the last (content-order) character).
- if (part.level > 0) {
- var prep = prepareMeasureForLine(cm, lineObj)
- ch = dir < 0 ? lineObj.text.length - 1 : 0
- var targetTop = measureCharPrepared(cm, prep, ch).top
- ch = findFirst(function (ch) { return measureCharPrepared(cm, prep, ch).top == targetTop; }, (dir < 0) == (part.level == 1) ? part.from : part.to - 1, ch)
- if (sticky == "before") { ch = moveCharLogically(lineObj, ch, 1, true) }
- } else { ch = dir < 0 ? part.to : part.from }
- return new Pos(lineNo, ch, sticky)
- }
- }
- return new Pos(lineNo, dir < 0 ? lineObj.text.length : 0, dir < 0 ? "before" : "after")
-}
-
-function moveVisually(cm, line, start, dir) {
- var bidi = getOrder(line)
- if (!bidi) { return moveLogically(line, start, dir) }
- if (start.ch >= line.text.length) {
- start.ch = line.text.length
- start.sticky = "before"
- } else if (start.ch <= 0) {
- start.ch = 0
- start.sticky = "after"
- }
- var partPos = getBidiPartAt(bidi, start.ch, start.sticky), part = bidi[partPos]
- if (part.level % 2 == 0 && (dir > 0 ? part.to > start.ch : part.from < start.ch)) {
- // Case 1: We move within an ltr part. Even with wrapped lines,
- // nothing interesting happens.
- return moveLogically(line, start, dir)
- }
-
- var mv = function (pos, dir) { return moveCharLogically(line, pos instanceof Pos ? pos.ch : pos, dir); }
- var prep
- var getWrappedLineExtent = function (ch) {
- if (!cm.options.lineWrapping) { return {begin: 0, end: line.text.length} }
- prep = prep || prepareMeasureForLine(cm, line)
- return wrappedLineExtentChar(cm, line, prep, ch)
- }
- var wrappedLineExtent = getWrappedLineExtent(start.sticky == "before" ? mv(start, -1) : start.ch)
-
- if (part.level % 2 == 1) {
- var ch = mv(start, -dir)
- if (ch != null && (dir > 0 ? ch >= part.from && ch >= wrappedLineExtent.begin : ch <= part.to && ch <= wrappedLineExtent.end)) {
- // Case 2: We move within an rtl part on the same visual line
- var sticky = dir < 0 ? "before" : "after"
- return new Pos(start.line, ch, sticky)
- }
- }
-
- // Case 3: Could not move within this bidi part in this visual line, so leave
- // the current bidi part
-
- var searchInVisualLine = function (partPos, dir, wrappedLineExtent) {
- var getRes = function (ch, moveInStorageOrder) { return moveInStorageOrder
- ? new Pos(start.line, mv(ch, 1), "before")
- : new Pos(start.line, ch, "after"); }
-
- for (; partPos >= 0 && partPos < bidi.length; partPos += dir) {
- var part = bidi[partPos]
- var moveInStorageOrder = (dir > 0) == (part.level != 1)
- var ch = moveInStorageOrder ? wrappedLineExtent.begin : mv(wrappedLineExtent.end, -1)
- if (part.from <= ch && ch < part.to) { return getRes(ch, moveInStorageOrder) }
- ch = moveInStorageOrder ? part.from : mv(part.to, -1)
- if (wrappedLineExtent.begin <= ch && ch < wrappedLineExtent.end) { return getRes(ch, moveInStorageOrder) }
- }
- }
-
- // Case 3a: Look for other bidi parts on the same visual line
- var res = searchInVisualLine(partPos + dir, dir, wrappedLineExtent)
- if (res) { return res }
-
- // Case 3b: Look for other bidi parts on the next visual line
- var nextCh = dir > 0 ? wrappedLineExtent.end : mv(wrappedLineExtent.begin, -1)
- if (nextCh != null && !(dir > 0 && nextCh == line.text.length)) {
- res = searchInVisualLine(dir > 0 ? 0 : bidi.length - 1, dir, getWrappedLineExtent(nextCh))
- if (res) { return res }
- }
-
- // Case 4: Nowhere to move
- return null
-}
-
-// EVENT HANDLING
-
-// Lightweight event framework. on/off also work on DOM nodes,
-// registering native DOM handlers.
-
-var noHandlers = []
-
-var on = function(emitter, type, f) {
- if (emitter.addEventListener) {
- emitter.addEventListener(type, f, false)
- } else if (emitter.attachEvent) {
- emitter.attachEvent("on" + type, f)
- } else {
- var map = emitter._handlers || (emitter._handlers = {})
- map[type] = (map[type] || noHandlers).concat(f)
- }
-}
-
-function getHandlers(emitter, type) {
- return emitter._handlers && emitter._handlers[type] || noHandlers
-}
-
-function off(emitter, type, f) {
- if (emitter.removeEventListener) {
- emitter.removeEventListener(type, f, false)
- } else if (emitter.detachEvent) {
- emitter.detachEvent("on" + type, f)
- } else {
- var map = emitter._handlers, arr = map && map[type]
- if (arr) {
- var index = indexOf(arr, f)
- if (index > -1)
- { map[type] = arr.slice(0, index).concat(arr.slice(index + 1)) }
- }
- }
-}
-
-function signal(emitter, type /*, values...*/) {
- var handlers = getHandlers(emitter, type)
- if (!handlers.length) { return }
- var args = Array.prototype.slice.call(arguments, 2)
- for (var i = 0; i < handlers.length; ++i) { handlers[i].apply(null, args) }
-}
-
-// The DOM events that CodeMirror handles can be overridden by
-// registering a (non-DOM) handler on the editor for the event name,
-// and preventDefault-ing the event in that handler.
-function signalDOMEvent(cm, e, override) {
- if (typeof e == "string")
- { e = {type: e, preventDefault: function() { this.defaultPrevented = true }} }
- signal(cm, override || e.type, cm, e)
- return e_defaultPrevented(e) || e.codemirrorIgnore
-}
-
-function signalCursorActivity(cm) {
- var arr = cm._handlers && cm._handlers.cursorActivity
- if (!arr) { return }
- var set = cm.curOp.cursorActivityHandlers || (cm.curOp.cursorActivityHandlers = [])
- for (var i = 0; i < arr.length; ++i) { if (indexOf(set, arr[i]) == -1)
- { set.push(arr[i]) } }
-}
-
-function hasHandler(emitter, type) {
- return getHandlers(emitter, type).length > 0
-}
-
-// Add on and off methods to a constructor's prototype, to make
-// registering events on such objects more convenient.
-function eventMixin(ctor) {
- ctor.prototype.on = function(type, f) {on(this, type, f)}
- ctor.prototype.off = function(type, f) {off(this, type, f)}
-}
-
-// Due to the fact that we still support jurassic IE versions, some
-// compatibility wrappers are needed.
-
-function e_preventDefault(e) {
- if (e.preventDefault) { e.preventDefault() }
- else { e.returnValue = false }
-}
-function e_stopPropagation(e) {
- if (e.stopPropagation) { e.stopPropagation() }
- else { e.cancelBubble = true }
-}
-function e_defaultPrevented(e) {
- return e.defaultPrevented != null ? e.defaultPrevented : e.returnValue == false
-}
-function e_stop(e) {e_preventDefault(e); e_stopPropagation(e)}
-
-function e_target(e) {return e.target || e.srcElement}
-function e_button(e) {
- var b = e.which
- if (b == null) {
- if (e.button & 1) { b = 1 }
- else if (e.button & 2) { b = 3 }
- else if (e.button & 4) { b = 2 }
- }
- if (mac && e.ctrlKey && b == 1) { b = 3 }
- return b
-}
-
-// Detect drag-and-drop
-var dragAndDrop = function() {
- // There is *some* kind of drag-and-drop support in IE6-8, but I
- // couldn't get it to work yet.
- if (ie && ie_version < 9) { return false }
- var div = elt('div')
- return "draggable" in div || "dragDrop" in div
-}()
-
-var zwspSupported
-function zeroWidthElement(measure) {
- if (zwspSupported == null) {
- var test = elt("span", "\u200b")
- removeChildrenAndAdd(measure, elt("span", [test, document.createTextNode("x")]))
- if (measure.firstChild.offsetHeight != 0)
- { zwspSupported = test.offsetWidth <= 1 && test.offsetHeight > 2 && !(ie && ie_version < 8) }
- }
- var node = zwspSupported ? elt("span", "\u200b") :
- elt("span", "\u00a0", null, "display: inline-block; width: 1px; margin-right: -1px")
- node.setAttribute("cm-text", "")
- return node
-}
-
-// Feature-detect IE's crummy client rect reporting for bidi text
-var badBidiRects
-function hasBadBidiRects(measure) {
- if (badBidiRects != null) { return badBidiRects }
- var txt = removeChildrenAndAdd(measure, document.createTextNode("A\u062eA"))
- var r0 = range(txt, 0, 1).getBoundingClientRect()
- var r1 = range(txt, 1, 2).getBoundingClientRect()
- removeChildren(measure)
- if (!r0 || r0.left == r0.right) { return false } // Safari returns null in some cases (#2780)
- return badBidiRects = (r1.right - r0.right < 3)
-}
-
-// See if "".split is the broken IE version, if so, provide an
-// alternative way to split lines.
-var splitLinesAuto = "\n\nb".split(/\n/).length != 3 ? function (string) {
- var pos = 0, result = [], l = string.length
- while (pos <= l) {
- var nl = string.indexOf("\n", pos)
- if (nl == -1) { nl = string.length }
- var line = string.slice(pos, string.charAt(nl - 1) == "\r" ? nl - 1 : nl)
- var rt = line.indexOf("\r")
- if (rt != -1) {
- result.push(line.slice(0, rt))
- pos += rt + 1
- } else {
- result.push(line)
- pos = nl + 1
- }
- }
- return result
-} : function (string) { return string.split(/\r\n?|\n/); }
-
-var hasSelection = window.getSelection ? function (te) {
- try { return te.selectionStart != te.selectionEnd }
- catch(e) { return false }
-} : function (te) {
- var range
- try {range = te.ownerDocument.selection.createRange()}
- catch(e) {}
- if (!range || range.parentElement() != te) { return false }
- return range.compareEndPoints("StartToEnd", range) != 0
-}
-
-var hasCopyEvent = (function () {
- var e = elt("div")
- if ("oncopy" in e) { return true }
- e.setAttribute("oncopy", "return;")
- return typeof e.oncopy == "function"
-})()
-
-var badZoomedRects = null
-function hasBadZoomedRects(measure) {
- if (badZoomedRects != null) { return badZoomedRects }
- var node = removeChildrenAndAdd(measure, elt("span", "x"))
- var normal = node.getBoundingClientRect()
- var fromRange = range(node, 0, 1).getBoundingClientRect()
- return badZoomedRects = Math.abs(normal.left - fromRange.left) > 1
-}
-
-var modes = {};
-var mimeModes = {};
-// Extra arguments are stored as the mode's dependencies, which is
-// used by (legacy) mechanisms like loadmode.js to automatically
-// load a mode. (Preferred mechanism is the require/define calls.)
-function defineMode(name, mode) {
- if (arguments.length > 2)
- { mode.dependencies = Array.prototype.slice.call(arguments, 2) }
- modes[name] = mode
-}
-
-function defineMIME(mime, spec) {
- mimeModes[mime] = spec
-}
-
-// Given a MIME type, a {name, ...options} config object, or a name
-// string, return a mode config object.
-function resolveMode(spec) {
- if (typeof spec == "string" && mimeModes.hasOwnProperty(spec)) {
- spec = mimeModes[spec]
- } else if (spec && typeof spec.name == "string" && mimeModes.hasOwnProperty(spec.name)) {
- var found = mimeModes[spec.name]
- if (typeof found == "string") { found = {name: found} }
- spec = createObj(found, spec)
- spec.name = found.name
- } else if (typeof spec == "string" && /^[\w\-]+\/[\w\-]+\+xml$/.test(spec)) {
- return resolveMode("application/xml")
- } else if (typeof spec == "string" && /^[\w\-]+\/[\w\-]+\+json$/.test(spec)) {
- return resolveMode("application/json")
- }
- if (typeof spec == "string") { return {name: spec} }
- else { return spec || {name: "null"} }
-}
-
-// Given a mode spec (anything that resolveMode accepts), find and
-// initialize an actual mode object.
-function getMode(options, spec) {
- spec = resolveMode(spec)
- var mfactory = modes[spec.name]
- if (!mfactory) { return getMode(options, "text/plain") }
- var modeObj = mfactory(options, spec)
- if (modeExtensions.hasOwnProperty(spec.name)) {
- var exts = modeExtensions[spec.name]
- for (var prop in exts) {
- if (!exts.hasOwnProperty(prop)) { continue }
- if (modeObj.hasOwnProperty(prop)) { modeObj["_" + prop] = modeObj[prop] }
- modeObj[prop] = exts[prop]
- }
- }
- modeObj.name = spec.name
- if (spec.helperType) { modeObj.helperType = spec.helperType }
- if (spec.modeProps) { for (var prop$1 in spec.modeProps)
- { modeObj[prop$1] = spec.modeProps[prop$1] } }
-
- return modeObj
-}
-
-// This can be used to attach properties to mode objects from
-// outside the actual mode definition.
-var modeExtensions = {}
-function extendMode(mode, properties) {
- var exts = modeExtensions.hasOwnProperty(mode) ? modeExtensions[mode] : (modeExtensions[mode] = {})
- copyObj(properties, exts)
-}
-
-function copyState(mode, state) {
- if (state === true) { return state }
- if (mode.copyState) { return mode.copyState(state) }
- var nstate = {}
- for (var n in state) {
- var val = state[n]
- if (val instanceof Array) { val = val.concat([]) }
- nstate[n] = val
- }
- return nstate
-}
-
-// Given a mode and a state (for that mode), find the inner mode and
-// state at the position that the state refers to.
-function innerMode(mode, state) {
- var info
- while (mode.innerMode) {
- info = mode.innerMode(state)
- if (!info || info.mode == mode) { break }
- state = info.state
- mode = info.mode
- }
- return info || {mode: mode, state: state}
-}
-
-function startState(mode, a1, a2) {
- return mode.startState ? mode.startState(a1, a2) : true
-}
-
-// STRING STREAM
-
-// Fed to the mode parsers, provides helper functions to make
-// parsers more succinct.
-
-var StringStream = function(string, tabSize) {
- this.pos = this.start = 0
- this.string = string
- this.tabSize = tabSize || 8
- this.lastColumnPos = this.lastColumnValue = 0
- this.lineStart = 0
-};
-
-StringStream.prototype.eol = function () {return this.pos >= this.string.length};
-StringStream.prototype.sol = function () {return this.pos == this.lineStart};
-StringStream.prototype.peek = function () {return this.string.charAt(this.pos) || undefined};
-StringStream.prototype.next = function () {
- if (this.pos < this.string.length)
- { return this.string.charAt(this.pos++) }
-};
-StringStream.prototype.eat = function (match) {
- var ch = this.string.charAt(this.pos)
- var ok
- if (typeof match == "string") { ok = ch == match }
- else { ok = ch && (match.test ? match.test(ch) : match(ch)) }
- if (ok) {++this.pos; return ch}
-};
-StringStream.prototype.eatWhile = function (match) {
- var start = this.pos
- while (this.eat(match)){}
- return this.pos > start
-};
-StringStream.prototype.eatSpace = function () {
- var this$1 = this;
-
- var start = this.pos
- while (/[\s\u00a0]/.test(this.string.charAt(this.pos))) { ++this$1.pos }
- return this.pos > start
-};
-StringStream.prototype.skipToEnd = function () {this.pos = this.string.length};
-StringStream.prototype.skipTo = function (ch) {
- var found = this.string.indexOf(ch, this.pos)
- if (found > -1) {this.pos = found; return true}
-};
-StringStream.prototype.backUp = function (n) {this.pos -= n};
-StringStream.prototype.column = function () {
- if (this.lastColumnPos < this.start) {
- this.lastColumnValue = countColumn(this.string, this.start, this.tabSize, this.lastColumnPos, this.lastColumnValue)
- this.lastColumnPos = this.start
- }
- return this.lastColumnValue - (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0)
-};
-StringStream.prototype.indentation = function () {
- return countColumn(this.string, null, this.tabSize) -
- (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0)
-};
-StringStream.prototype.match = function (pattern, consume, caseInsensitive) {
- if (typeof pattern == "string") {
- var cased = function (str) { return caseInsensitive ? str.toLowerCase() : str; }
- var substr = this.string.substr(this.pos, pattern.length)
- if (cased(substr) == cased(pattern)) {
- if (consume !== false) { this.pos += pattern.length }
- return true
- }
- } else {
- var match = this.string.slice(this.pos).match(pattern)
- if (match && match.index > 0) { return null }
- if (match && consume !== false) { this.pos += match[0].length }
- return match
- }
-};
-StringStream.prototype.current = function (){return this.string.slice(this.start, this.pos)};
-StringStream.prototype.hideFirstChars = function (n, inner) {
- this.lineStart += n
- try { return inner() }
- finally { this.lineStart -= n }
-};
-
-// Compute a style array (an array starting with a mode generation
-// -- for invalidation -- followed by pairs of end positions and
-// style strings), which is used to highlight the tokens on the
-// line.
-function highlightLine(cm, line, state, forceToEnd) {
- // A styles array always starts with a number identifying the
- // mode/overlays that it is based on (for easy invalidation).
- var st = [cm.state.modeGen], lineClasses = {}
- // Compute the base array of styles
- runMode(cm, line.text, cm.doc.mode, state, function (end, style) { return st.push(end, style); },
- lineClasses, forceToEnd)
-
- // Run overlays, adjust style array.
- var loop = function ( o ) {
- var overlay = cm.state.overlays[o], i = 1, at = 0
- runMode(cm, line.text, overlay.mode, true, function (end, style) {
- var start = i
- // Ensure there's a token end at the current position, and that i points at it
- while (at < end) {
- var i_end = st[i]
- if (i_end > end)
- { st.splice(i, 1, end, st[i+1], i_end) }
- i += 2
- at = Math.min(end, i_end)
- }
- if (!style) { return }
- if (overlay.opaque) {
- st.splice(start, i - start, end, "overlay " + style)
- i = start + 2
- } else {
- for (; start < i; start += 2) {
- var cur = st[start+1]
- st[start+1] = (cur ? cur + " " : "") + "overlay " + style
- }
- }
- }, lineClasses)
- };
-
- for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );
-
- return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}
-}
-
-function getLineStyles(cm, line, updateFrontier) {
- if (!line.styles || line.styles[0] != cm.state.modeGen) {
- var state = getStateBefore(cm, lineNo(line))
- var result = highlightLine(cm, line, line.text.length > cm.options.maxHighlightLength ? copyState(cm.doc.mode, state) : state)
- line.stateAfter = state
- line.styles = result.styles
- if (result.classes) { line.styleClasses = result.classes }
- else if (line.styleClasses) { line.styleClasses = null }
- if (updateFrontier === cm.doc.frontier) { cm.doc.frontier++ }
- }
- return line.styles
-}
-
-function getStateBefore(cm, n, precise) {
- var doc = cm.doc, display = cm.display
- if (!doc.mode.startState) { return true }
- var pos = findStartLine(cm, n, precise), state = pos > doc.first && getLine(doc, pos-1).stateAfter
- if (!state) { state = startState(doc.mode) }
- else { state = copyState(doc.mode, state) }
- doc.iter(pos, n, function (line) {
- processLine(cm, line.text, state)
- var save = pos == n - 1 || pos % 5 == 0 || pos >= display.viewFrom && pos < display.viewTo
- line.stateAfter = save ? copyState(doc.mode, state) : null
- ++pos
- })
- if (precise) { doc.frontier = pos }
- return state
-}
-
-// Lightweight form of highlight -- proceed over this line and
-// update state, but don't save a style array. Used for lines that
-// aren't currently visible.
-function processLine(cm, text, state, startAt) {
- var mode = cm.doc.mode
- var stream = new StringStream(text, cm.options.tabSize)
- stream.start = stream.pos = startAt || 0
- if (text == "") { callBlankLine(mode, state) }
- while (!stream.eol()) {
- readToken(mode, stream, state)
- stream.start = stream.pos
- }
-}
-
-function callBlankLine(mode, state) {
- if (mode.blankLine) { return mode.blankLine(state) }
- if (!mode.innerMode) { return }
- var inner = innerMode(mode, state)
- if (inner.mode.blankLine) { return inner.mode.blankLine(inner.state) }
-}
-
-function readToken(mode, stream, state, inner) {
- for (var i = 0; i < 10; i++) {
- if (inner) { inner[0] = innerMode(mode, state).mode }
- var style = mode.token(stream, state)
- if (stream.pos > stream.start) { return style }
- }
- throw new Error("Mode " + mode.name + " failed to advance stream.")
-}
-
-// Utility for getTokenAt and getLineTokens
-function takeToken(cm, pos, precise, asArray) {
- var getObj = function (copy) { return ({
- start: stream.start, end: stream.pos,
- string: stream.current(),
- type: style || null,
- state: copy ? copyState(doc.mode, state) : state
- }); }
-
- var doc = cm.doc, mode = doc.mode, style
- pos = clipPos(doc, pos)
- var line = getLine(doc, pos.line), state = getStateBefore(cm, pos.line, precise)
- var stream = new StringStream(line.text, cm.options.tabSize), tokens
- if (asArray) { tokens = [] }
- while ((asArray || stream.pos < pos.ch) && !stream.eol()) {
- stream.start = stream.pos
- style = readToken(mode, stream, state)
- if (asArray) { tokens.push(getObj(true)) }
- }
- return asArray ? tokens : getObj()
-}
-
-function extractLineClasses(type, output) {
- if (type) { for (;;) {
- var lineClass = type.match(/(?:^|\s+)line-(background-)?(\S+)/)
- if (!lineClass) { break }
- type = type.slice(0, lineClass.index) + type.slice(lineClass.index + lineClass[0].length)
- var prop = lineClass[1] ? "bgClass" : "textClass"
- if (output[prop] == null)
- { output[prop] = lineClass[2] }
- else if (!(new RegExp("(?:^|\s)" + lineClass[2] + "(?:$|\s)")).test(output[prop]))
- { output[prop] += " " + lineClass[2] }
- } }
- return type
-}
-
-// Run the given mode's parser over a line, calling f for each token.
-function runMode(cm, text, mode, state, f, lineClasses, forceToEnd) {
- var flattenSpans = mode.flattenSpans
- if (flattenSpans == null) { flattenSpans = cm.options.flattenSpans }
- var curStart = 0, curStyle = null
- var stream = new StringStream(text, cm.options.tabSize), style
- var inner = cm.options.addModeClass && [null]
- if (text == "") { extractLineClasses(callBlankLine(mode, state), lineClasses) }
- while (!stream.eol()) {
- if (stream.pos > cm.options.maxHighlightLength) {
- flattenSpans = false
- if (forceToEnd) { processLine(cm, text, state, stream.pos) }
- stream.pos = text.length
- style = null
- } else {
- style = extractLineClasses(readToken(mode, stream, state, inner), lineClasses)
- }
- if (inner) {
- var mName = inner[0].name
- if (mName) { style = "m-" + (style ? mName + " " + style : mName) }
- }
- if (!flattenSpans || curStyle != style) {
- while (curStart < stream.start) {
- curStart = Math.min(stream.start, curStart + 5000)
- f(curStart, curStyle)
- }
- curStyle = style
- }
- stream.start = stream.pos
- }
- while (curStart < stream.pos) {
- // Webkit seems to refuse to render text nodes longer than 57444
- // characters, and returns inaccurate measurements in nodes
- // starting around 5000 chars.
- var pos = Math.min(stream.pos, curStart + 5000)
- f(pos, curStyle)
- curStart = pos
- }
-}
-
-// Finds the line to start with when starting a parse. Tries to
-// find a line with a stateAfter, so that it can start with a
-// valid state. If that fails, it returns the line with the
-// smallest indentation, which tends to need the least context to
-// parse correctly.
-function findStartLine(cm, n, precise) {
- var minindent, minline, doc = cm.doc
- var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100)
- for (var search = n; search > lim; --search) {
- if (search <= doc.first) { return doc.first }
- var line = getLine(doc, search - 1)
- if (line.stateAfter && (!precise || search <= doc.frontier)) { return search }
- var indented = countColumn(line.text, null, cm.options.tabSize)
- if (minline == null || minindent > indented) {
- minline = search - 1
- minindent = indented
- }
- }
- return minline
-}
-
-// LINE DATA STRUCTURE
-
-// Line objects. These hold state related to a line, including
-// highlighting info (the styles array).
-var Line = function(text, markedSpans, estimateHeight) {
- this.text = text
- attachMarkedSpans(this, markedSpans)
- this.height = estimateHeight ? estimateHeight(this) : 1
-};
-
-Line.prototype.lineNo = function () { return lineNo(this) };
-eventMixin(Line)
-
-// Change the content (text, markers) of a line. Automatically
-// invalidates cached information and tries to re-estimate the
-// line's height.
-function updateLine(line, text, markedSpans, estimateHeight) {
- line.text = text
- if (line.stateAfter) { line.stateAfter = null }
- if (line.styles) { line.styles = null }
- if (line.order != null) { line.order = null }
- detachMarkedSpans(line)
- attachMarkedSpans(line, markedSpans)
- var estHeight = estimateHeight ? estimateHeight(line) : 1
- if (estHeight != line.height) { updateLineHeight(line, estHeight) }
-}
-
-// Detach a line from the document tree and its markers.
-function cleanUpLine(line) {
- line.parent = null
- detachMarkedSpans(line)
-}
-
-// Convert a style as returned by a mode (either null, or a string
-// containing one or more styles) to a CSS style. This is cached,
-// and also looks for line-wide styles.
-var styleToClassCache = {};
-var styleToClassCacheWithMode = {};
-function interpretTokenStyle(style, options) {
- if (!style || /^\s*$/.test(style)) { return null }
- var cache = options.addModeClass ? styleToClassCacheWithMode : styleToClassCache
- return cache[style] ||
- (cache[style] = style.replace(/\S+/g, "cm-$&"))
-}
-
-// Render the DOM representation of the text of a line. Also builds
-// up a 'line map', which points at the DOM nodes that represent
-// specific stretches of text, and is used by the measuring code.
-// The returned object contains the DOM node, this map, and
-// information about line-wide styles that were set by the mode.
-function buildLineContent(cm, lineView) {
- // The padding-right forces the element to have a 'border', which
- // is needed on Webkit to be able to get line-level bounding
- // rectangles for it (in measureChar).
- var content = elt("span", null, null, webkit ? "padding-right: .1px" : null)
- var builder = {pre: elt("pre", [content], "CodeMirror-line"), content: content,
- col: 0, pos: 0, cm: cm,
- trailingSpace: false,
- splitSpaces: (ie || webkit) && cm.getOption("lineWrapping")}
- // hide from accessibility tree
- content.setAttribute("role", "presentation")
- builder.pre.setAttribute("role", "presentation")
- lineView.measure = {}
-
- // Iterate over the logical lines that make up this visual line.
- for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {
- var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0)
- builder.pos = 0
- builder.addToken = buildToken
- // Optionally wire in some hacks into the token-rendering
- // algorithm, to deal with browser quirks.
- if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line)))
- { builder.addToken = buildTokenBadBidi(builder.addToken, order) }
- builder.map = []
- var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line)
- insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate))
- if (line.styleClasses) {
- if (line.styleClasses.bgClass)
- { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || "") }
- if (line.styleClasses.textClass)
- { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || "") }
- }
-
- // Ensure at least a single node is present, for measuring.
- if (builder.map.length == 0)
- { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))) }
-
- // Store the map and a cache object for the current logical line
- if (i == 0) {
- lineView.measure.map = builder.map
- lineView.measure.cache = {}
- } else {
- ;(lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)
- ;(lineView.measure.caches || (lineView.measure.caches = [])).push({})
- }
- }
-
- // See issue #2901
- if (webkit) {
- var last = builder.content.lastChild
- if (/\bcm-tab\b/.test(last.className) || (last.querySelector && last.querySelector(".cm-tab")))
- { builder.content.className = "cm-tab-wrap-hack" }
- }
-
- signal(cm, "renderLine", cm, lineView.line, builder.pre)
- if (builder.pre.className)
- { builder.textClass = joinClasses(builder.pre.className, builder.textClass || "") }
-
- return builder
-}
-
-function defaultSpecialCharPlaceholder(ch) {
- var token = elt("span", "\u2022", "cm-invalidchar")
- token.title = "\\u" + ch.charCodeAt(0).toString(16)
- token.setAttribute("aria-label", token.title)
- return token
-}
-
-// Build up the DOM representation for a single token, and add it to
-// the line map. Takes care to render special characters separately.
-function buildToken(builder, text, style, startStyle, endStyle, title, css) {
- if (!text) { return }
- var displayText = builder.splitSpaces ? splitSpaces(text, builder.trailingSpace) : text
- var special = builder.cm.state.specialChars, mustWrap = false
- var content
- if (!special.test(text)) {
- builder.col += text.length
- content = document.createTextNode(displayText)
- builder.map.push(builder.pos, builder.pos + text.length, content)
- if (ie && ie_version < 9) { mustWrap = true }
- builder.pos += text.length
- } else {
- content = document.createDocumentFragment()
- var pos = 0
- while (true) {
- special.lastIndex = pos
- var m = special.exec(text)
- var skipped = m ? m.index - pos : text.length - pos
- if (skipped) {
- var txt = document.createTextNode(displayText.slice(pos, pos + skipped))
- if (ie && ie_version < 9) { content.appendChild(elt("span", [txt])) }
- else { content.appendChild(txt) }
- builder.map.push(builder.pos, builder.pos + skipped, txt)
- builder.col += skipped
- builder.pos += skipped
- }
- if (!m) { break }
- pos += skipped + 1
- var txt$1 = (void 0)
- if (m[0] == "\t") {
- var tabSize = builder.cm.options.tabSize, tabWidth = tabSize - builder.col % tabSize
- txt$1 = content.appendChild(elt("span", spaceStr(tabWidth), "cm-tab"))
- txt$1.setAttribute("role", "presentation")
- txt$1.setAttribute("cm-text", "\t")
- builder.col += tabWidth
- } else if (m[0] == "\r" || m[0] == "\n") {
- txt$1 = content.appendChild(elt("span", m[0] == "\r" ? "\u240d" : "\u2424", "cm-invalidchar"))
- txt$1.setAttribute("cm-text", m[0])
- builder.col += 1
- } else {
- txt$1 = builder.cm.options.specialCharPlaceholder(m[0])
- txt$1.setAttribute("cm-text", m[0])
- if (ie && ie_version < 9) { content.appendChild(elt("span", [txt$1])) }
- else { content.appendChild(txt$1) }
- builder.col += 1
- }
- builder.map.push(builder.pos, builder.pos + 1, txt$1)
- builder.pos++
- }
- }
- builder.trailingSpace = displayText.charCodeAt(text.length - 1) == 32
- if (style || startStyle || endStyle || mustWrap || css) {
- var fullStyle = style || ""
- if (startStyle) { fullStyle += startStyle }
- if (endStyle) { fullStyle += endStyle }
- var token = elt("span", [content], fullStyle, css)
- if (title) { token.title = title }
- return builder.content.appendChild(token)
- }
- builder.content.appendChild(content)
-}
-
-function splitSpaces(text, trailingBefore) {
- if (text.length > 1 && !/ /.test(text)) { return text }
- var spaceBefore = trailingBefore, result = ""
- for (var i = 0; i < text.length; i++) {
- var ch = text.charAt(i)
- if (ch == " " && spaceBefore && (i == text.length - 1 || text.charCodeAt(i + 1) == 32))
- { ch = "\u00a0" }
- result += ch
- spaceBefore = ch == " "
- }
- return result
-}
-
-// Work around nonsense dimensions being reported for stretches of
-// right-to-left text.
-function buildTokenBadBidi(inner, order) {
- return function (builder, text, style, startStyle, endStyle, title, css) {
- style = style ? style + " cm-force-border" : "cm-force-border"
- var start = builder.pos, end = start + text.length
- for (;;) {
- // Find the part that overlaps with the start of this text
- var part = (void 0)
- for (var i = 0; i < order.length; i++) {
- part = order[i]
- if (part.to > start && part.from <= start) { break }
- }
- if (part.to >= end) { return inner(builder, text, style, startStyle, endStyle, title, css) }
- inner(builder, text.slice(0, part.to - start), style, startStyle, null, title, css)
- startStyle = null
- text = text.slice(part.to - start)
- start = part.to
- }
- }
-}
-
-function buildCollapsedSpan(builder, size, marker, ignoreWidget) {
- var widget = !ignoreWidget && marker.widgetNode
- if (widget) { builder.map.push(builder.pos, builder.pos + size, widget) }
- if (!ignoreWidget && builder.cm.display.input.needsContentAttribute) {
- if (!widget)
- { widget = builder.content.appendChild(document.createElement("span")) }
- widget.setAttribute("cm-marker", marker.id)
- }
- if (widget) {
- builder.cm.display.input.setUneditable(widget)
- builder.content.appendChild(widget)
- }
- builder.pos += size
- builder.trailingSpace = false
-}
-
-// Outputs a number of spans to make up a line, taking highlighting
-// and marked text into account.
-function insertLineContent(line, builder, styles) {
- var spans = line.markedSpans, allText = line.text, at = 0
- if (!spans) {
- for (var i$1 = 1; i$1 < styles.length; i$1+=2)
- { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)) }
- return
- }
-
- var len = allText.length, pos = 0, i = 1, text = "", style, css
- var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed
- for (;;) {
- if (nextChange == pos) { // Update current marker set
- spanStyle = spanEndStyle = spanStartStyle = title = css = ""
- collapsed = null; nextChange = Infinity
- var foundBookmarks = [], endStyles = (void 0)
- for (var j = 0; j < spans.length; ++j) {
- var sp = spans[j], m = sp.marker
- if (m.type == "bookmark" && sp.from == pos && m.widgetNode) {
- foundBookmarks.push(m)
- } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {
- if (sp.to != null && sp.to != pos && nextChange > sp.to) {
- nextChange = sp.to
- spanEndStyle = ""
- }
- if (m.className) { spanStyle += " " + m.className }
- if (m.css) { css = (css ? css + ";" : "") + m.css }
- if (m.startStyle && sp.from == pos) { spanStartStyle += " " + m.startStyle }
- if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to) }
- if (m.title && !title) { title = m.title }
- if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))
- { collapsed = sp }
- } else if (sp.from > pos && nextChange > sp.from) {
- nextChange = sp.from
- }
- }
- if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)
- { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += " " + endStyles[j$1] } } }
-
- if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)
- { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]) } }
- if (collapsed && (collapsed.from || 0) == pos) {
- buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,
- collapsed.marker, collapsed.from == null)
- if (collapsed.to == null) { return }
- if (collapsed.to == pos) { collapsed = false }
- }
- }
- if (pos >= len) { break }
-
- var upto = Math.min(len, nextChange)
- while (true) {
- if (text) {
- var end = pos + text.length
- if (!collapsed) {
- var tokenText = end > upto ? text.slice(0, upto - pos) : text
- builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,
- spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : "", title, css)
- }
- if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}
- pos = end
- spanStartStyle = ""
- }
- text = allText.slice(at, at = styles[i++])
- style = interpretTokenStyle(styles[i++], builder.cm.options)
- }
- }
-}
-
-
-// These objects are used to represent the visible (currently drawn)
-// part of the document. A LineView may correspond to multiple
-// logical lines, if those are connected by collapsed ranges.
-function LineView(doc, line, lineN) {
- // The starting line
- this.line = line
- // Continuing lines, if any
- this.rest = visualLineContinued(line)
- // Number of logical lines in this visual line
- this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1
- this.node = this.text = null
- this.hidden = lineIsHidden(doc, line)
-}
-
-// Create a range of LineView objects for the given lines.
-function buildViewArray(cm, from, to) {
- var array = [], nextPos
- for (var pos = from; pos < to; pos = nextPos) {
- var view = new LineView(cm.doc, getLine(cm.doc, pos), pos)
- nextPos = pos + view.size
- array.push(view)
- }
- return array
-}
-
-var operationGroup = null
-
-function pushOperation(op) {
- if (operationGroup) {
- operationGroup.ops.push(op)
- } else {
- op.ownsGroup = operationGroup = {
- ops: [op],
- delayedCallbacks: []
- }
- }
-}
-
-function fireCallbacksForOps(group) {
- // Calls delayed callbacks and cursorActivity handlers until no
- // new ones appear
- var callbacks = group.delayedCallbacks, i = 0
- do {
- for (; i < callbacks.length; i++)
- { callbacks[i].call(null) }
- for (var j = 0; j < group.ops.length; j++) {
- var op = group.ops[j]
- if (op.cursorActivityHandlers)
- { while (op.cursorActivityCalled < op.cursorActivityHandlers.length)
- { op.cursorActivityHandlers[op.cursorActivityCalled++].call(null, op.cm) } }
- }
- } while (i < callbacks.length)
-}
-
-function finishOperation(op, endCb) {
- var group = op.ownsGroup
- if (!group) { return }
-
- try { fireCallbacksForOps(group) }
- finally {
- operationGroup = null
- endCb(group)
- }
-}
-
-var orphanDelayedCallbacks = null
-
-// Often, we want to signal events at a point where we are in the
-// middle of some work, but don't want the handler to start calling
-// other methods on the editor, which might be in an inconsistent
-// state or simply not expect any other events to happen.
-// signalLater looks whether there are any handlers, and schedules
-// them to be executed when the last operation ends, or, if no
-// operation is active, when a timeout fires.
-function signalLater(emitter, type /*, values...*/) {
- var arr = getHandlers(emitter, type)
- if (!arr.length) { return }
- var args = Array.prototype.slice.call(arguments, 2), list
- if (operationGroup) {
- list = operationGroup.delayedCallbacks
- } else if (orphanDelayedCallbacks) {
- list = orphanDelayedCallbacks
- } else {
- list = orphanDelayedCallbacks = []
- setTimeout(fireOrphanDelayed, 0)
- }
- var loop = function ( i ) {
- list.push(function () { return arr[i].apply(null, args); })
- };
-
- for (var i = 0; i < arr.length; ++i)
- loop( i );
-}
-
-function fireOrphanDelayed() {
- var delayed = orphanDelayedCallbacks
- orphanDelayedCallbacks = null
- for (var i = 0; i < delayed.length; ++i) { delayed[i]() }
-}
-
-// When an aspect of a line changes, a string is added to
-// lineView.changes. This updates the relevant part of the line's
-// DOM structure.
-function updateLineForChanges(cm, lineView, lineN, dims) {
- for (var j = 0; j < lineView.changes.length; j++) {
- var type = lineView.changes[j]
- if (type == "text") { updateLineText(cm, lineView) }
- else if (type == "gutter") { updateLineGutter(cm, lineView, lineN, dims) }
- else if (type == "class") { updateLineClasses(lineView) }
- else if (type == "widget") { updateLineWidgets(cm, lineView, dims) }
- }
- lineView.changes = null
-}
-
-// Lines with gutter elements, widgets or a background class need to
-// be wrapped, and have the extra elements added to the wrapper div
-function ensureLineWrapped(lineView) {
- if (lineView.node == lineView.text) {
- lineView.node = elt("div", null, null, "position: relative")
- if (lineView.text.parentNode)
- { lineView.text.parentNode.replaceChild(lineView.node, lineView.text) }
- lineView.node.appendChild(lineView.text)
- if (ie && ie_version < 8) { lineView.node.style.zIndex = 2 }
- }
- return lineView.node
-}
-
-function updateLineBackground(lineView) {
- var cls = lineView.bgClass ? lineView.bgClass + " " + (lineView.line.bgClass || "") : lineView.line.bgClass
- if (cls) { cls += " CodeMirror-linebackground" }
- if (lineView.background) {
- if (cls) { lineView.background.className = cls }
- else { lineView.background.parentNode.removeChild(lineView.background); lineView.background = null }
- } else if (cls) {
- var wrap = ensureLineWrapped(lineView)
- lineView.background = wrap.insertBefore(elt("div", null, cls), wrap.firstChild)
- }
-}
-
-// Wrapper around buildLineContent which will reuse the structure
-// in display.externalMeasured when possible.
-function getLineContent(cm, lineView) {
- var ext = cm.display.externalMeasured
- if (ext && ext.line == lineView.line) {
- cm.display.externalMeasured = null
- lineView.measure = ext.measure
- return ext.built
- }
- return buildLineContent(cm, lineView)
-}
-
-// Redraw the line's text. Interacts with the background and text
-// classes because the mode may output tokens that influence these
-// classes.
-function updateLineText(cm, lineView) {
- var cls = lineView.text.className
- var built = getLineContent(cm, lineView)
- if (lineView.text == lineView.node) { lineView.node = built.pre }
- lineView.text.parentNode.replaceChild(built.pre, lineView.text)
- lineView.text = built.pre
- if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {
- lineView.bgClass = built.bgClass
- lineView.textClass = built.textClass
- updateLineClasses(lineView)
- } else if (cls) {
- lineView.text.className = cls
- }
-}
-
-function updateLineClasses(lineView) {
- updateLineBackground(lineView)
- if (lineView.line.wrapClass)
- { ensureLineWrapped(lineView).className = lineView.line.wrapClass }
- else if (lineView.node != lineView.text)
- { lineView.node.className = "" }
- var textClass = lineView.textClass ? lineView.textClass + " " + (lineView.line.textClass || "") : lineView.line.textClass
- lineView.text.className = textClass || ""
-}
-
-function updateLineGutter(cm, lineView, lineN, dims) {
- if (lineView.gutter) {
- lineView.node.removeChild(lineView.gutter)
- lineView.gutter = null
- }
- if (lineView.gutterBackground) {
- lineView.node.removeChild(lineView.gutterBackground)
- lineView.gutterBackground = null
- }
- if (lineView.line.gutterClass) {
- var wrap = ensureLineWrapped(lineView)
- lineView.gutterBackground = elt("div", null, "CodeMirror-gutter-background " + lineView.line.gutterClass,
- ("left: " + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + "px; width: " + (dims.gutterTotalWidth) + "px"))
- wrap.insertBefore(lineView.gutterBackground, lineView.text)
- }
- var markers = lineView.line.gutterMarkers
- if (cm.options.lineNumbers || markers) {
- var wrap$1 = ensureLineWrapped(lineView)
- var gutterWrap = lineView.gutter = elt("div", null, "CodeMirror-gutter-wrapper", ("left: " + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + "px"))
- cm.display.input.setUneditable(gutterWrap)
- wrap$1.insertBefore(gutterWrap, lineView.text)
- if (lineView.line.gutterClass)
- { gutterWrap.className += " " + lineView.line.gutterClass }
- if (cm.options.lineNumbers && (!markers || !markers["CodeMirror-linenumbers"]))
- { lineView.lineNumber = gutterWrap.appendChild(
- elt("div", lineNumberFor(cm.options, lineN),
- "CodeMirror-linenumber CodeMirror-gutter-elt",
- ("left: " + (dims.gutterLeft["CodeMirror-linenumbers"]) + "px; width: " + (cm.display.lineNumInnerWidth) + "px"))) }
- if (markers) { for (var k = 0; k < cm.options.gutters.length; ++k) {
- var id = cm.options.gutters[k], found = markers.hasOwnProperty(id) && markers[id]
- if (found)
- { gutterWrap.appendChild(elt("div", [found], "CodeMirror-gutter-elt",
- ("left: " + (dims.gutterLeft[id]) + "px; width: " + (dims.gutterWidth[id]) + "px"))) }
- } }
- }
-}
-
-function updateLineWidgets(cm, lineView, dims) {
- if (lineView.alignable) { lineView.alignable = null }
- for (var node = lineView.node.firstChild, next = (void 0); node; node = next) {
- next = node.nextSibling
- if (node.className == "CodeMirror-linewidget")
- { lineView.node.removeChild(node) }
- }
- insertLineWidgets(cm, lineView, dims)
-}
-
-// Build a line's DOM representation from scratch
-function buildLineElement(cm, lineView, lineN, dims) {
- var built = getLineContent(cm, lineView)
- lineView.text = lineView.node = built.pre
- if (built.bgClass) { lineView.bgClass = built.bgClass }
- if (built.textClass) { lineView.textClass = built.textClass }
-
- updateLineClasses(lineView)
- updateLineGutter(cm, lineView, lineN, dims)
- insertLineWidgets(cm, lineView, dims)
- return lineView.node
-}
-
-// A lineView may contain multiple logical lines (when merged by
-// collapsed spans). The widgets for all of them need to be drawn.
-function insertLineWidgets(cm, lineView, dims) {
- insertLineWidgetsFor(cm, lineView.line, lineView, dims, true)
- if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++)
- { insertLineWidgetsFor(cm, lineView.rest[i], lineView, dims, false) } }
-}
-
-function insertLineWidgetsFor(cm, line, lineView, dims, allowAbove) {
- if (!line.widgets) { return }
- var wrap = ensureLineWrapped(lineView)
- for (var i = 0, ws = line.widgets; i < ws.length; ++i) {
- var widget = ws[i], node = elt("div", [widget.node], "CodeMirror-linewidget")
- if (!widget.handleMouseEvents) { node.setAttribute("cm-ignore-events", "true") }
- positionLineWidget(widget, node, lineView, dims)
- cm.display.input.setUneditable(node)
- if (allowAbove && widget.above)
- { wrap.insertBefore(node, lineView.gutter || lineView.text) }
- else
- { wrap.appendChild(node) }
- signalLater(widget, "redraw")
- }
-}
-
-function positionLineWidget(widget, node, lineView, dims) {
- if (widget.noHScroll) {
- ;(lineView.alignable || (lineView.alignable = [])).push(node)
- var width = dims.wrapperWidth
- node.style.left = dims.fixedPos + "px"
- if (!widget.coverGutter) {
- width -= dims.gutterTotalWidth
- node.style.paddingLeft = dims.gutterTotalWidth + "px"
- }
- node.style.width = width + "px"
- }
- if (widget.coverGutter) {
- node.style.zIndex = 5
- node.style.position = "relative"
- if (!widget.noHScroll) { node.style.marginLeft = -dims.gutterTotalWidth + "px" }
- }
-}
-
-function widgetHeight(widget) {
- if (widget.height != null) { return widget.height }
- var cm = widget.doc.cm
- if (!cm) { return 0 }
- if (!contains(document.body, widget.node)) {
- var parentStyle = "position: relative;"
- if (widget.coverGutter)
- { parentStyle += "margin-left: -" + cm.display.gutters.offsetWidth + "px;" }
- if (widget.noHScroll)
- { parentStyle += "width: " + cm.display.wrapper.clientWidth + "px;" }
- removeChildrenAndAdd(cm.display.measure, elt("div", [widget.node], null, parentStyle))
- }
- return widget.height = widget.node.parentNode.offsetHeight
-}
-
-// Return true when the given mouse event happened in a widget
-function eventInWidget(display, e) {
- for (var n = e_target(e); n != display.wrapper; n = n.parentNode) {
- if (!n || (n.nodeType == 1 && n.getAttribute("cm-ignore-events") == "true") ||
- (n.parentNode == display.sizer && n != display.mover))
- { return true }
- }
-}
-
-// POSITION MEASUREMENT
-
-function paddingTop(display) {return display.lineSpace.offsetTop}
-function paddingVert(display) {return display.mover.offsetHeight - display.lineSpace.offsetHeight}
-function paddingH(display) {
- if (display.cachedPaddingH) { return display.cachedPaddingH }
- var e = removeChildrenAndAdd(display.measure, elt("pre", "x"))
- var style = window.getComputedStyle ? window.getComputedStyle(e) : e.currentStyle
- var data = {left: parseInt(style.paddingLeft), right: parseInt(style.paddingRight)}
- if (!isNaN(data.left) && !isNaN(data.right)) { display.cachedPaddingH = data }
- return data
-}
-
-function scrollGap(cm) { return scrollerGap - cm.display.nativeBarWidth }
-function displayWidth(cm) {
- return cm.display.scroller.clientWidth - scrollGap(cm) - cm.display.barWidth
-}
-function displayHeight(cm) {
- return cm.display.scroller.clientHeight - scrollGap(cm) - cm.display.barHeight
-}
-
-// Ensure the lineView.wrapping.heights array is populated. This is
-// an array of bottom offsets for the lines that make up a drawn
-// line. When lineWrapping is on, there might be more than one
-// height.
-function ensureLineHeights(cm, lineView, rect) {
- var wrapping = cm.options.lineWrapping
- var curWidth = wrapping && displayWidth(cm)
- if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) {
- var heights = lineView.measure.heights = []
- if (wrapping) {
- lineView.measure.width = curWidth
- var rects = lineView.text.firstChild.getClientRects()
- for (var i = 0; i < rects.length - 1; i++) {
- var cur = rects[i], next = rects[i + 1]
- if (Math.abs(cur.bottom - next.bottom) > 2)
- { heights.push((cur.bottom + next.top) / 2 - rect.top) }
- }
- }
- heights.push(rect.bottom - rect.top)
- }
-}
-
-// Find a line map (mapping character offsets to text nodes) and a
-// measurement cache for the given line number. (A line view might
-// contain multiple lines when collapsed ranges are present.)
-function mapFromLineView(lineView, line, lineN) {
- if (lineView.line == line)
- { return {map: lineView.measure.map, cache: lineView.measure.cache} }
- for (var i = 0; i < lineView.rest.length; i++)
- { if (lineView.rest[i] == line)
- { return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i]} } }
- for (var i$1 = 0; i$1 < lineView.rest.length; i$1++)
- { if (lineNo(lineView.rest[i$1]) > lineN)
- { return {map: lineView.measure.maps[i$1], cache: lineView.measure.caches[i$1], before: true} } }
-}
-
-// Render a line into the hidden node display.externalMeasured. Used
-// when measurement is needed for a line that's not in the viewport.
-function updateExternalMeasurement(cm, line) {
- line = visualLine(line)
- var lineN = lineNo(line)
- var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN)
- view.lineN = lineN
- var built = view.built = buildLineContent(cm, view)
- view.text = built.pre
- removeChildrenAndAdd(cm.display.lineMeasure, built.pre)
- return view
-}
-
-// Get a {top, bottom, left, right} box (in line-local coordinates)
-// for a given character.
-function measureChar(cm, line, ch, bias) {
- return measureCharPrepared(cm, prepareMeasureForLine(cm, line), ch, bias)
-}
-
-// Find a line view that corresponds to the given line number.
-function findViewForLine(cm, lineN) {
- if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)
- { return cm.display.view[findViewIndex(cm, lineN)] }
- var ext = cm.display.externalMeasured
- if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)
- { return ext }
-}
-
-// Measurement can be split in two steps, the set-up work that
-// applies to the whole line, and the measurement of the actual
-// character. Functions like coordsChar, that need to do a lot of
-// measurements in a row, can thus ensure that the set-up work is
-// only done once.
-function prepareMeasureForLine(cm, line) {
- var lineN = lineNo(line)
- var view = findViewForLine(cm, lineN)
- if (view && !view.text) {
- view = null
- } else if (view && view.changes) {
- updateLineForChanges(cm, view, lineN, getDimensions(cm))
- cm.curOp.forceUpdate = true
- }
- if (!view)
- { view = updateExternalMeasurement(cm, line) }
-
- var info = mapFromLineView(view, line, lineN)
- return {
- line: line, view: view, rect: null,
- map: info.map, cache: info.cache, before: info.before,
- hasHeights: false
- }
-}
-
-// Given a prepared measurement object, measures the position of an
-// actual character (or fetches it from the cache).
-function measureCharPrepared(cm, prepared, ch, bias, varHeight) {
- if (prepared.before) { ch = -1 }
- var key = ch + (bias || ""), found
- if (prepared.cache.hasOwnProperty(key)) {
- found = prepared.cache[key]
- } else {
- if (!prepared.rect)
- { prepared.rect = prepared.view.text.getBoundingClientRect() }
- if (!prepared.hasHeights) {
- ensureLineHeights(cm, prepared.view, prepared.rect)
- prepared.hasHeights = true
- }
- found = measureCharInner(cm, prepared, ch, bias)
- if (!found.bogus) { prepared.cache[key] = found }
- }
- return {left: found.left, right: found.right,
- top: varHeight ? found.rtop : found.top,
- bottom: varHeight ? found.rbottom : found.bottom}
-}
-
-var nullRect = {left: 0, right: 0, top: 0, bottom: 0}
-
-function nodeAndOffsetInLineMap(map, ch, bias) {
- var node, start, end, collapse, mStart, mEnd
- // First, search the line map for the text node corresponding to,
- // or closest to, the target character.
- for (var i = 0; i < map.length; i += 3) {
- mStart = map[i]
- mEnd = map[i + 1]
- if (ch < mStart) {
- start = 0; end = 1
- collapse = "left"
- } else if (ch < mEnd) {
- start = ch - mStart
- end = start + 1
- } else if (i == map.length - 3 || ch == mEnd && map[i + 3] > ch) {
- end = mEnd - mStart
- start = end - 1
- if (ch >= mEnd) { collapse = "right" }
- }
- if (start != null) {
- node = map[i + 2]
- if (mStart == mEnd && bias == (node.insertLeft ? "left" : "right"))
- { collapse = bias }
- if (bias == "left" && start == 0)
- { while (i && map[i - 2] == map[i - 3] && map[i - 1].insertLeft) {
- node = map[(i -= 3) + 2]
- collapse = "left"
- } }
- if (bias == "right" && start == mEnd - mStart)
- { while (i < map.length - 3 && map[i + 3] == map[i + 4] && !map[i + 5].insertLeft) {
- node = map[(i += 3) + 2]
- collapse = "right"
- } }
- break
- }
- }
- return {node: node, start: start, end: end, collapse: collapse, coverStart: mStart, coverEnd: mEnd}
-}
-
-function getUsefulRect(rects, bias) {
- var rect = nullRect
- if (bias == "left") { for (var i = 0; i < rects.length; i++) {
- if ((rect = rects[i]).left != rect.right) { break }
- } } else { for (var i$1 = rects.length - 1; i$1 >= 0; i$1--) {
- if ((rect = rects[i$1]).left != rect.right) { break }
- } }
- return rect
-}
-
-function measureCharInner(cm, prepared, ch, bias) {
- var place = nodeAndOffsetInLineMap(prepared.map, ch, bias)
- var node = place.node, start = place.start, end = place.end, collapse = place.collapse
-
- var rect
- if (node.nodeType == 3) { // If it is a text node, use a range to retrieve the coordinates.
- for (var i$1 = 0; i$1 < 4; i$1++) { // Retry a maximum of 4 times when nonsense rectangles are returned
- while (start && isExtendingChar(prepared.line.text.charAt(place.coverStart + start))) { --start }
- while (place.coverStart + end < place.coverEnd && isExtendingChar(prepared.line.text.charAt(place.coverStart + end))) { ++end }
- if (ie && ie_version < 9 && start == 0 && end == place.coverEnd - place.coverStart)
- { rect = node.parentNode.getBoundingClientRect() }
- else
- { rect = getUsefulRect(range(node, start, end).getClientRects(), bias) }
- if (rect.left || rect.right || start == 0) { break }
- end = start
- start = start - 1
- collapse = "right"
- }
- if (ie && ie_version < 11) { rect = maybeUpdateRectForZooming(cm.display.measure, rect) }
- } else { // If it is a widget, simply get the box for the whole widget.
- if (start > 0) { collapse = bias = "right" }
- var rects
- if (cm.options.lineWrapping && (rects = node.getClientRects()).length > 1)
- { rect = rects[bias == "right" ? rects.length - 1 : 0] }
- else
- { rect = node.getBoundingClientRect() }
- }
- if (ie && ie_version < 9 && !start && (!rect || !rect.left && !rect.right)) {
- var rSpan = node.parentNode.getClientRects()[0]
- if (rSpan)
- { rect = {left: rSpan.left, right: rSpan.left + charWidth(cm.display), top: rSpan.top, bottom: rSpan.bottom} }
- else
- { rect = nullRect }
- }
-
- var rtop = rect.top - prepared.rect.top, rbot = rect.bottom - prepared.rect.top
- var mid = (rtop + rbot) / 2
- var heights = prepared.view.measure.heights
- var i = 0
- for (; i < heights.length - 1; i++)
- { if (mid < heights[i]) { break } }
- var top = i ? heights[i - 1] : 0, bot = heights[i]
- var result = {left: (collapse == "right" ? rect.right : rect.left) - prepared.rect.left,
- right: (collapse == "left" ? rect.left : rect.right) - prepared.rect.left,
- top: top, bottom: bot}
- if (!rect.left && !rect.right) { result.bogus = true }
- if (!cm.options.singleCursorHeightPerLine) { result.rtop = rtop; result.rbottom = rbot }
-
- return result
-}
-
-// Work around problem with bounding client rects on ranges being
-// returned incorrectly when zoomed on IE10 and below.
-function maybeUpdateRectForZooming(measure, rect) {
- if (!window.screen || screen.logicalXDPI == null ||
- screen.logicalXDPI == screen.deviceXDPI || !hasBadZoomedRects(measure))
- { return rect }
- var scaleX = screen.logicalXDPI / screen.deviceXDPI
- var scaleY = screen.logicalYDPI / screen.deviceYDPI
- return {left: rect.left * scaleX, right: rect.right * scaleX,
- top: rect.top * scaleY, bottom: rect.bottom * scaleY}
-}
-
-function clearLineMeasurementCacheFor(lineView) {
- if (lineView.measure) {
- lineView.measure.cache = {}
- lineView.measure.heights = null
- if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++)
- { lineView.measure.caches[i] = {} } }
- }
-}
-
-function clearLineMeasurementCache(cm) {
- cm.display.externalMeasure = null
- removeChildren(cm.display.lineMeasure)
- for (var i = 0; i < cm.display.view.length; i++)
- { clearLineMeasurementCacheFor(cm.display.view[i]) }
-}
-
-function clearCaches(cm) {
- clearLineMeasurementCache(cm)
- cm.display.cachedCharWidth = cm.display.cachedTextHeight = cm.display.cachedPaddingH = null
- if (!cm.options.lineWrapping) { cm.display.maxLineChanged = true }
- cm.display.lineNumChars = null
-}
-
-function pageScrollX() { return window.pageXOffset || (document.documentElement || document.body).scrollLeft }
-function pageScrollY() { return window.pageYOffset || (document.documentElement || document.body).scrollTop }
-
-// Converts a {top, bottom, left, right} box from line-local
-// coordinates into another coordinate system. Context may be one of
-// "line", "div" (display.lineDiv), "local"./null (editor), "window",
-// or "page".
-function intoCoordSystem(cm, lineObj, rect, context, includeWidgets) {
- if (!includeWidgets && lineObj.widgets) { for (var i = 0; i < lineObj.widgets.length; ++i) { if (lineObj.widgets[i].above) {
- var size = widgetHeight(lineObj.widgets[i])
- rect.top += size; rect.bottom += size
- } } }
- if (context == "line") { return rect }
- if (!context) { context = "local" }
- var yOff = heightAtLine(lineObj)
- if (context == "local") { yOff += paddingTop(cm.display) }
- else { yOff -= cm.display.viewOffset }
- if (context == "page" || context == "window") {
- var lOff = cm.display.lineSpace.getBoundingClientRect()
- yOff += lOff.top + (context == "window" ? 0 : pageScrollY())
- var xOff = lOff.left + (context == "window" ? 0 : pageScrollX())
- rect.left += xOff; rect.right += xOff
- }
- rect.top += yOff; rect.bottom += yOff
- return rect
-}
-
-// Coverts a box from "div" coords to another coordinate system.
-// Context may be "window", "page", "div", or "local"./null.
-function fromCoordSystem(cm, coords, context) {
- if (context == "div") { return coords }
- var left = coords.left, top = coords.top
- // First move into "page" coordinate system
- if (context == "page") {
- left -= pageScrollX()
- top -= pageScrollY()
- } else if (context == "local" || !context) {
- var localBox = cm.display.sizer.getBoundingClientRect()
- left += localBox.left
- top += localBox.top
- }
-
- var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect()
- return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top}
-}
-
-function charCoords(cm, pos, context, lineObj, bias) {
- if (!lineObj) { lineObj = getLine(cm.doc, pos.line) }
- return intoCoordSystem(cm, lineObj, measureChar(cm, lineObj, pos.ch, bias), context)
-}
-
-// Returns a box for a given cursor position, which may have an
-// 'other' property containing the position of the secondary cursor
-// on a bidi boundary.
-// A cursor Pos(line, char, "before") is on the same visual line as `char - 1`
-// and after `char - 1` in writing order of `char - 1`
-// A cursor Pos(line, char, "after") is on the same visual line as `char`
-// and before `char` in writing order of `char`
-// Examples (upper-case letters are RTL, lower-case are LTR):
-// Pos(0, 1, ...)
-// before after
-// ab a|b a|b
-// aB a|B aB|
-// Ab |Ab A|b
-// AB B|A B|A
-// Every position after the last character on a line is considered to stick
-// to the last character on the line.
-function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {
- lineObj = lineObj || getLine(cm.doc, pos.line)
- if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj) }
- function get(ch, right) {
- var m = measureCharPrepared(cm, preparedMeasure, ch, right ? "right" : "left", varHeight)
- if (right) { m.left = m.right; } else { m.right = m.left }
- return intoCoordSystem(cm, lineObj, m, context)
- }
- var order = getOrder(lineObj), ch = pos.ch, sticky = pos.sticky
- if (ch >= lineObj.text.length) {
- ch = lineObj.text.length
- sticky = "before"
- } else if (ch <= 0) {
- ch = 0
- sticky = "after"
- }
- if (!order) { return get(sticky == "before" ? ch - 1 : ch, sticky == "before") }
-
- function getBidi(ch, partPos, invert) {
- var part = order[partPos], right = (part.level % 2) != 0
- return get(invert ? ch - 1 : ch, right != invert)
- }
- var partPos = getBidiPartAt(order, ch, sticky)
- var other = bidiOther
- var val = getBidi(ch, partPos, sticky == "before")
- if (other != null) { val.other = getBidi(ch, other, sticky != "before") }
- return val
-}
-
-// Used to cheaply estimate the coordinates for a position. Used for
-// intermediate scroll updates.
-function estimateCoords(cm, pos) {
- var left = 0
- pos = clipPos(cm.doc, pos)
- if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch }
- var lineObj = getLine(cm.doc, pos.line)
- var top = heightAtLine(lineObj) + paddingTop(cm.display)
- return {left: left, right: left, top: top, bottom: top + lineObj.height}
-}
-
-// Positions returned by coordsChar contain some extra information.
-// xRel is the relative x position of the input coordinates compared
-// to the found position (so xRel > 0 means the coordinates are to
-// the right of the character position, for example). When outside
-// is true, that means the coordinates lie outside the line's
-// vertical range.
-function PosWithInfo(line, ch, sticky, outside, xRel) {
- var pos = Pos(line, ch, sticky)
- pos.xRel = xRel
- if (outside) { pos.outside = true }
- return pos
-}
-
-// Compute the character position closest to the given coordinates.
-// Input must be lineSpace-local ("div" coordinate system).
-function coordsChar(cm, x, y) {
- var doc = cm.doc
- y += cm.display.viewOffset
- if (y < 0) { return PosWithInfo(doc.first, 0, null, true, -1) }
- var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1
- if (lineN > last)
- { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, true, 1) }
- if (x < 0) { x = 0 }
-
- var lineObj = getLine(doc, lineN)
- for (;;) {
- var found = coordsCharInner(cm, lineObj, lineN, x, y)
- var merged = collapsedSpanAtEnd(lineObj)
- var mergedPos = merged && merged.find(0, true)
- if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))
- { lineN = lineNo(lineObj = mergedPos.to.line) }
- else
- { return found }
- }
-}
-
-function wrappedLineExtent(cm, lineObj, preparedMeasure, y) {
- var measure = function (ch) { return intoCoordSystem(cm, lineObj, measureCharPrepared(cm, preparedMeasure, ch), "line"); }
- var end = lineObj.text.length
- var begin = findFirst(function (ch) { return measure(ch - 1).bottom <= y; }, end, 0)
- end = findFirst(function (ch) { return measure(ch).top > y; }, begin, end)
- return {begin: begin, end: end}
-}
-
-function wrappedLineExtentChar(cm, lineObj, preparedMeasure, target) {
- var targetTop = intoCoordSystem(cm, lineObj, measureCharPrepared(cm, preparedMeasure, target), "line").top
- return wrappedLineExtent(cm, lineObj, preparedMeasure, targetTop)
-}
-
-function coordsCharInner(cm, lineObj, lineNo, x, y) {
- y -= heightAtLine(lineObj)
- var begin = 0, end = lineObj.text.length
- var preparedMeasure = prepareMeasureForLine(cm, lineObj)
- var pos
- var order = getOrder(lineObj)
- if (order) {
- if (cm.options.lineWrapping) {
- ;var assign;
- ((assign = wrappedLineExtent(cm, lineObj, preparedMeasure, y), begin = assign.begin, end = assign.end, assign))
- }
- pos = new Pos(lineNo, begin)
- var beginLeft = cursorCoords(cm, pos, "line", lineObj, preparedMeasure).left
- var dir = beginLeft < x ? 1 : -1
- var prevDiff, diff = beginLeft - x, prevPos
- do {
- prevDiff = diff
- prevPos = pos
- pos = moveVisually(cm, lineObj, pos, dir)
- if (pos == null || pos.ch < begin || end <= (pos.sticky == "before" ? pos.ch - 1 : pos.ch)) {
- pos = prevPos
- break
- }
- diff = cursorCoords(cm, pos, "line", lineObj, preparedMeasure).left - x
- } while ((dir < 0) != (diff < 0) && (Math.abs(diff) <= Math.abs(prevDiff)))
- if (Math.abs(diff) > Math.abs(prevDiff)) {
- if ((diff < 0) == (prevDiff < 0)) { throw new Error("Broke out of infinite loop in coordsCharInner") }
- pos = prevPos
- }
- } else {
- var ch = findFirst(function (ch) {
- var box = intoCoordSystem(cm, lineObj, measureCharPrepared(cm, preparedMeasure, ch), "line")
- if (box.top > y) {
- // For the cursor stickiness
- end = Math.min(ch, end)
- return true
- }
- else if (box.bottom <= y) { return false }
- else if (box.left > x) { return true }
- else if (box.right < x) { return false }
- else { return (x - box.left < box.right - x) }
- }, begin, end)
- ch = skipExtendingChars(lineObj.text, ch, 1)
- pos = new Pos(lineNo, ch, ch == end ? "before" : "after")
- }
- var coords = cursorCoords(cm, pos, "line", lineObj, preparedMeasure)
- if (y < coords.top || coords.bottom < y) { pos.outside = true }
- pos.xRel = x < coords.left ? -1 : (x > coords.right ? 1 : 0)
- return pos
-}
-
-var measureText
-// Compute the default text height.
-function textHeight(display) {
- if (display.cachedTextHeight != null) { return display.cachedTextHeight }
- if (measureText == null) {
- measureText = elt("pre")
- // Measure a bunch of lines, for browsers that compute
- // fractional heights.
- for (var i = 0; i < 49; ++i) {
- measureText.appendChild(document.createTextNode("x"))
- measureText.appendChild(elt("br"))
- }
- measureText.appendChild(document.createTextNode("x"))
- }
- removeChildrenAndAdd(display.measure, measureText)
- var height = measureText.offsetHeight / 50
- if (height > 3) { display.cachedTextHeight = height }
- removeChildren(display.measure)
- return height || 1
-}
-
-// Compute the default character width.
-function charWidth(display) {
- if (display.cachedCharWidth != null) { return display.cachedCharWidth }
- var anchor = elt("span", "xxxxxxxxxx")
- var pre = elt("pre", [anchor])
- removeChildrenAndAdd(display.measure, pre)
- var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10
- if (width > 2) { display.cachedCharWidth = width }
- return width || 10
-}
-
-// Do a bulk-read of the DOM positions and sizes needed to draw the
-// view, so that we don't interleave reading and writing to the DOM.
-function getDimensions(cm) {
- var d = cm.display, left = {}, width = {}
- var gutterLeft = d.gutters.clientLeft
- for (var n = d.gutters.firstChild, i = 0; n; n = n.nextSibling, ++i) {
- left[cm.options.gutters[i]] = n.offsetLeft + n.clientLeft + gutterLeft
- width[cm.options.gutters[i]] = n.clientWidth
- }
- return {fixedPos: compensateForHScroll(d),
- gutterTotalWidth: d.gutters.offsetWidth,
- gutterLeft: left,
- gutterWidth: width,
- wrapperWidth: d.wrapper.clientWidth}
-}
-
-// Computes display.scroller.scrollLeft + display.gutters.offsetWidth,
-// but using getBoundingClientRect to get a sub-pixel-accurate
-// result.
-function compensateForHScroll(display) {
- return display.scroller.getBoundingClientRect().left - display.sizer.getBoundingClientRect().left
-}
-
-// Returns a function that estimates the height of a line, to use as
-// first approximation until the line becomes visible (and is thus
-// properly measurable).
-function estimateHeight(cm) {
- var th = textHeight(cm.display), wrapping = cm.options.lineWrapping
- var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3)
- return function (line) {
- if (lineIsHidden(cm.doc, line)) { return 0 }
-
- var widgetsHeight = 0
- if (line.widgets) { for (var i = 0; i < line.widgets.length; i++) {
- if (line.widgets[i].height) { widgetsHeight += line.widgets[i].height }
- } }
-
- if (wrapping)
- { return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th }
- else
- { return widgetsHeight + th }
- }
-}
-
-function estimateLineHeights(cm) {
- var doc = cm.doc, est = estimateHeight(cm)
- doc.iter(function (line) {
- var estHeight = est(line)
- if (estHeight != line.height) { updateLineHeight(line, estHeight) }
- })
-}
-
-// Given a mouse event, find the corresponding position. If liberal
-// is false, it checks whether a gutter or scrollbar was clicked,
-// and returns null if it was. forRect is used by rectangular
-// selections, and tries to estimate a character position even for
-// coordinates beyond the right of the text.
-function posFromMouse(cm, e, liberal, forRect) {
- var display = cm.display
- if (!liberal && e_target(e).getAttribute("cm-not-content") == "true") { return null }
-
- var x, y, space = display.lineSpace.getBoundingClientRect()
- // Fails unpredictably on IE[67] when mouse is dragged around quickly.
- try { x = e.clientX - space.left; y = e.clientY - space.top }
- catch (e) { return null }
- var coords = coordsChar(cm, x, y), line
- if (forRect && coords.xRel == 1 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {
- var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length
- coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff))
- }
- return coords
-}
-
-// Find the view element corresponding to a given line. Return null
-// when the line isn't visible.
-function findViewIndex(cm, n) {
- if (n >= cm.display.viewTo) { return null }
- n -= cm.display.viewFrom
- if (n < 0) { return null }
- var view = cm.display.view
- for (var i = 0; i < view.length; i++) {
- n -= view[i].size
- if (n < 0) { return i }
- }
-}
-
-function updateSelection(cm) {
- cm.display.input.showSelection(cm.display.input.prepareSelection())
-}
-
-function prepareSelection(cm, primary) {
- var doc = cm.doc, result = {}
- var curFragment = result.cursors = document.createDocumentFragment()
- var selFragment = result.selection = document.createDocumentFragment()
-
- for (var i = 0; i < doc.sel.ranges.length; i++) {
- if (primary === false && i == doc.sel.primIndex) { continue }
- var range = doc.sel.ranges[i]
- if (range.from().line >= cm.display.viewTo || range.to().line < cm.display.viewFrom) { continue }
- var collapsed = range.empty()
- if (collapsed || cm.options.showCursorWhenSelecting)
- { drawSelectionCursor(cm, range.head, curFragment) }
- if (!collapsed)
- { drawSelectionRange(cm, range, selFragment) }
- }
- return result
-}
-
-// Draws a cursor for the given range
-function drawSelectionCursor(cm, head, output) {
- var pos = cursorCoords(cm, head, "div", null, null, !cm.options.singleCursorHeightPerLine)
-
- var cursor = output.appendChild(elt("div", "\u00a0", "CodeMirror-cursor"))
- cursor.style.left = pos.left + "px"
- cursor.style.top = pos.top + "px"
- cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + "px"
-
- if (pos.other) {
- // Secondary cursor, shown when on a 'jump' in bi-directional text
- var otherCursor = output.appendChild(elt("div", "\u00a0", "CodeMirror-cursor CodeMirror-secondarycursor"))
- otherCursor.style.display = ""
- otherCursor.style.left = pos.other.left + "px"
- otherCursor.style.top = pos.other.top + "px"
- otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + "px"
- }
-}
-
-// Draws the given range as a highlighted selection
-function drawSelectionRange(cm, range, output) {
- var display = cm.display, doc = cm.doc
- var fragment = document.createDocumentFragment()
- var padding = paddingH(cm.display), leftSide = padding.left
- var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right
-
- function add(left, top, width, bottom) {
- if (top < 0) { top = 0 }
- top = Math.round(top)
- bottom = Math.round(bottom)
- fragment.appendChild(elt("div", null, "CodeMirror-selected", ("position: absolute; left: " + left + "px;\n top: " + top + "px; width: " + (width == null ? rightSide - left : width) + "px;\n height: " + (bottom - top) + "px")))
- }
-
- function drawForLine(line, fromArg, toArg) {
- var lineObj = getLine(doc, line)
- var lineLen = lineObj.text.length
- var start, end
- function coords(ch, bias) {
- return charCoords(cm, Pos(line, ch), "div", lineObj, bias)
- }
-
- iterateBidiSections(getOrder(lineObj), fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir) {
- var leftPos = coords(from, "left"), rightPos, left, right
- if (from == to) {
- rightPos = leftPos
- left = right = leftPos.left
- } else {
- rightPos = coords(to - 1, "right")
- if (dir == "rtl") { var tmp = leftPos; leftPos = rightPos; rightPos = tmp }
- left = leftPos.left
- right = rightPos.right
- }
- if (fromArg == null && from == 0) { left = leftSide }
- if (rightPos.top - leftPos.top > 3) { // Different lines, draw top part
- add(left, leftPos.top, null, leftPos.bottom)
- left = leftSide
- if (leftPos.bottom < rightPos.top) { add(left, leftPos.bottom, null, rightPos.top) }
- }
- if (toArg == null && to == lineLen) { right = rightSide }
- if (!start || leftPos.top < start.top || leftPos.top == start.top && leftPos.left < start.left)
- { start = leftPos }
- if (!end || rightPos.bottom > end.bottom || rightPos.bottom == end.bottom && rightPos.right > end.right)
- { end = rightPos }
- if (left < leftSide + 1) { left = leftSide }
- add(left, rightPos.top, right - left, rightPos.bottom)
- })
- return {start: start, end: end}
- }
-
- var sFrom = range.from(), sTo = range.to()
- if (sFrom.line == sTo.line) {
- drawForLine(sFrom.line, sFrom.ch, sTo.ch)
- } else {
- var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line)
- var singleVLine = visualLine(fromLine) == visualLine(toLine)
- var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end
- var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start
- if (singleVLine) {
- if (leftEnd.top < rightStart.top - 2) {
- add(leftEnd.right, leftEnd.top, null, leftEnd.bottom)
- add(leftSide, rightStart.top, rightStart.left, rightStart.bottom)
- } else {
- add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom)
- }
- }
- if (leftEnd.bottom < rightStart.top)
- { add(leftSide, leftEnd.bottom, null, rightStart.top) }
- }
-
- output.appendChild(fragment)
-}
-
-// Cursor-blinking
-function restartBlink(cm) {
- if (!cm.state.focused) { return }
- var display = cm.display
- clearInterval(display.blinker)
- var on = true
- display.cursorDiv.style.visibility = ""
- if (cm.options.cursorBlinkRate > 0)
- { display.blinker = setInterval(function () { return display.cursorDiv.style.visibility = (on = !on) ? "" : "hidden"; },
- cm.options.cursorBlinkRate) }
- else if (cm.options.cursorBlinkRate < 0)
- { display.cursorDiv.style.visibility = "hidden" }
-}
-
-function ensureFocus(cm) {
- if (!cm.state.focused) { cm.display.input.focus(); onFocus(cm) }
-}
-
-function delayBlurEvent(cm) {
- cm.state.delayingBlurEvent = true
- setTimeout(function () { if (cm.state.delayingBlurEvent) {
- cm.state.delayingBlurEvent = false
- onBlur(cm)
- } }, 100)
-}
-
-function onFocus(cm, e) {
- if (cm.state.delayingBlurEvent) { cm.state.delayingBlurEvent = false }
-
- if (cm.options.readOnly == "nocursor") { return }
- if (!cm.state.focused) {
- signal(cm, "focus", cm, e)
- cm.state.focused = true
- addClass(cm.display.wrapper, "CodeMirror-focused")
- // This test prevents this from firing when a context
- // menu is closed (since the input reset would kill the
- // select-all detection hack)
- if (!cm.curOp && cm.display.selForContextMenu != cm.doc.sel) {
- cm.display.input.reset()
- if (webkit) { setTimeout(function () { return cm.display.input.reset(true); }, 20) } // Issue #1730
- }
- cm.display.input.receivedFocus()
- }
- restartBlink(cm)
-}
-function onBlur(cm, e) {
- if (cm.state.delayingBlurEvent) { return }
-
- if (cm.state.focused) {
- signal(cm, "blur", cm, e)
- cm.state.focused = false
- rmClass(cm.display.wrapper, "CodeMirror-focused")
- }
- clearInterval(cm.display.blinker)
- setTimeout(function () { if (!cm.state.focused) { cm.display.shift = false } }, 150)
-}
-
-// Re-align line numbers and gutter marks to compensate for
-// horizontal scrolling.
-function alignHorizontally(cm) {
- var display = cm.display, view = display.view
- if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }
- var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft
- var gutterW = display.gutters.offsetWidth, left = comp + "px"
- for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {
- if (cm.options.fixedGutter) {
- if (view[i].gutter)
- { view[i].gutter.style.left = left }
- if (view[i].gutterBackground)
- { view[i].gutterBackground.style.left = left }
- }
- var align = view[i].alignable
- if (align) { for (var j = 0; j < align.length; j++)
- { align[j].style.left = left } }
- } }
- if (cm.options.fixedGutter)
- { display.gutters.style.left = (comp + gutterW) + "px" }
-}
-
-// Used to ensure that the line number gutter is still the right
-// size for the current document size. Returns true when an update
-// is needed.
-function maybeUpdateLineNumberWidth(cm) {
- if (!cm.options.lineNumbers) { return false }
- var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display
- if (last.length != display.lineNumChars) {
- var test = display.measure.appendChild(elt("div", [elt("div", last)],
- "CodeMirror-linenumber CodeMirror-gutter-elt"))
- var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW
- display.lineGutter.style.width = ""
- display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1
- display.lineNumWidth = display.lineNumInnerWidth + padding
- display.lineNumChars = display.lineNumInnerWidth ? last.length : -1
- display.lineGutter.style.width = display.lineNumWidth + "px"
- updateGutterSpace(cm)
- return true
- }
- return false
-}
-
-// Read the actual heights of the rendered lines, and update their
-// stored heights to match.
-function updateHeightsInViewport(cm) {
- var display = cm.display
- var prevBottom = display.lineDiv.offsetTop
- for (var i = 0; i < display.view.length; i++) {
- var cur = display.view[i], height = (void 0)
- if (cur.hidden) { continue }
- if (ie && ie_version < 8) {
- var bot = cur.node.offsetTop + cur.node.offsetHeight
- height = bot - prevBottom
- prevBottom = bot
- } else {
- var box = cur.node.getBoundingClientRect()
- height = box.bottom - box.top
- }
- var diff = cur.line.height - height
- if (height < 2) { height = textHeight(display) }
- if (diff > .001 || diff < -.001) {
- updateLineHeight(cur.line, height)
- updateWidgetHeight(cur.line)
- if (cur.rest) { for (var j = 0; j < cur.rest.length; j++)
- { updateWidgetHeight(cur.rest[j]) } }
- }
- }
-}
-
-// Read and store the height of line widgets associated with the
-// given line.
-function updateWidgetHeight(line) {
- if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i)
- { line.widgets[i].height = line.widgets[i].node.parentNode.offsetHeight } }
-}
-
-// Compute the lines that are visible in a given viewport (defaults
-// the the current scroll position). viewport may contain top,
-// height, and ensure (see op.scrollToPos) properties.
-function visibleLines(display, doc, viewport) {
- var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop
- top = Math.floor(top - paddingTop(display))
- var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight
-
- var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom)
- // Ensure is a {from: {line, ch}, to: {line, ch}} object, and
- // forces those lines into the viewport (if possible).
- if (viewport && viewport.ensure) {
- var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line
- if (ensureFrom < from) {
- from = ensureFrom
- to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight)
- } else if (Math.min(ensureTo, doc.lastLine()) >= to) {
- from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight)
- to = ensureTo
- }
- }
- return {from: from, to: Math.max(to, from + 1)}
-}
-
-// Sync the scrollable area and scrollbars, ensure the viewport
-// covers the visible area.
-function setScrollTop(cm, val) {
- if (Math.abs(cm.doc.scrollTop - val) < 2) { return }
- cm.doc.scrollTop = val
- if (!gecko) { updateDisplaySimple(cm, {top: val}) }
- if (cm.display.scroller.scrollTop != val) { cm.display.scroller.scrollTop = val }
- cm.display.scrollbars.setScrollTop(val)
- if (gecko) { updateDisplaySimple(cm) }
- startWorker(cm, 100)
-}
-// Sync scroller and scrollbar, ensure the gutter elements are
-// aligned.
-function setScrollLeft(cm, val, isScroller) {
- if (isScroller ? val == cm.doc.scrollLeft : Math.abs(cm.doc.scrollLeft - val) < 2) { return }
- val = Math.min(val, cm.display.scroller.scrollWidth - cm.display.scroller.clientWidth)
- cm.doc.scrollLeft = val
- alignHorizontally(cm)
- if (cm.display.scroller.scrollLeft != val) { cm.display.scroller.scrollLeft = val }
- cm.display.scrollbars.setScrollLeft(val)
-}
-
-// Since the delta values reported on mouse wheel events are
-// unstandardized between browsers and even browser versions, and
-// generally horribly unpredictable, this code starts by measuring
-// the scroll effect that the first few mouse wheel events have,
-// and, from that, detects the way it can convert deltas to pixel
-// offsets afterwards.
-//
-// The reason we want to know the amount a wheel event will scroll
-// is that it gives us a chance to update the display before the
-// actual scrolling happens, reducing flickering.
-
-var wheelSamples = 0;
-var wheelPixelsPerUnit = null;
-// Fill in a browser-detected starting value on browsers where we
-// know one. These don't have to be accurate -- the result of them
-// being wrong would just be a slight flicker on the first wheel
-// scroll (if it is large enough).
-if (ie) { wheelPixelsPerUnit = -.53 }
-else if (gecko) { wheelPixelsPerUnit = 15 }
-else if (chrome) { wheelPixelsPerUnit = -.7 }
-else if (safari) { wheelPixelsPerUnit = -1/3 }
-
-function wheelEventDelta(e) {
- var dx = e.wheelDeltaX, dy = e.wheelDeltaY
- if (dx == null && e.detail && e.axis == e.HORIZONTAL_AXIS) { dx = e.detail }
- if (dy == null && e.detail && e.axis == e.VERTICAL_AXIS) { dy = e.detail }
- else if (dy == null) { dy = e.wheelDelta }
- return {x: dx, y: dy}
-}
-function wheelEventPixels(e) {
- var delta = wheelEventDelta(e)
- delta.x *= wheelPixelsPerUnit
- delta.y *= wheelPixelsPerUnit
- return delta
-}
-
-function onScrollWheel(cm, e) {
- var delta = wheelEventDelta(e), dx = delta.x, dy = delta.y
-
- var display = cm.display, scroll = display.scroller
- // Quit if there's nothing to scroll here
- var canScrollX = scroll.scrollWidth > scroll.clientWidth
- var canScrollY = scroll.scrollHeight > scroll.clientHeight
- if (!(dx && canScrollX || dy && canScrollY)) { return }
-
- // Webkit browsers on OS X abort momentum scrolls when the target
- // of the scroll event is removed from the scrollable element.
- // This hack (see related code in patchDisplay) makes sure the
- // element is kept around.
- if (dy && mac && webkit) {
- outer: for (var cur = e.target, view = display.view; cur != scroll; cur = cur.parentNode) {
- for (var i = 0; i < view.length; i++) {
- if (view[i].node == cur) {
- cm.display.currentWheelTarget = cur
- break outer
- }
- }
- }
- }
-
- // On some browsers, horizontal scrolling will cause redraws to
- // happen before the gutter has been realigned, causing it to
- // wriggle around in a most unseemly way. When we have an
- // estimated pixels/delta value, we just handle horizontal
- // scrolling entirely here. It'll be slightly off from native, but
- // better than glitching out.
- if (dx && !gecko && !presto && wheelPixelsPerUnit != null) {
- if (dy && canScrollY)
- { setScrollTop(cm, Math.max(0, Math.min(scroll.scrollTop + dy * wheelPixelsPerUnit, scroll.scrollHeight - scroll.clientHeight))) }
- setScrollLeft(cm, Math.max(0, Math.min(scroll.scrollLeft + dx * wheelPixelsPerUnit, scroll.scrollWidth - scroll.clientWidth)))
- // Only prevent default scrolling if vertical scrolling is
- // actually possible. Otherwise, it causes vertical scroll
- // jitter on OSX trackpads when deltaX is small and deltaY
- // is large (issue #3579)
- if (!dy || (dy && canScrollY))
- { e_preventDefault(e) }
- display.wheelStartX = null // Abort measurement, if in progress
- return
- }
-
- // 'Project' the visible viewport to cover the area that is being
- // scrolled into view (if we know enough to estimate it).
- if (dy && wheelPixelsPerUnit != null) {
- var pixels = dy * wheelPixelsPerUnit
- var top = cm.doc.scrollTop, bot = top + display.wrapper.clientHeight
- if (pixels < 0) { top = Math.max(0, top + pixels - 50) }
- else { bot = Math.min(cm.doc.height, bot + pixels + 50) }
- updateDisplaySimple(cm, {top: top, bottom: bot})
- }
-
- if (wheelSamples < 20) {
- if (display.wheelStartX == null) {
- display.wheelStartX = scroll.scrollLeft; display.wheelStartY = scroll.scrollTop
- display.wheelDX = dx; display.wheelDY = dy
- setTimeout(function () {
- if (display.wheelStartX == null) { return }
- var movedX = scroll.scrollLeft - display.wheelStartX
- var movedY = scroll.scrollTop - display.wheelStartY
- var sample = (movedY && display.wheelDY && movedY / display.wheelDY) ||
- (movedX && display.wheelDX && movedX / display.wheelDX)
- display.wheelStartX = display.wheelStartY = null
- if (!sample) { return }
- wheelPixelsPerUnit = (wheelPixelsPerUnit * wheelSamples + sample) / (wheelSamples + 1)
- ++wheelSamples
- }, 200)
- } else {
- display.wheelDX += dx; display.wheelDY += dy
- }
- }
-}
-
-// SCROLLBARS
-
-// Prepare DOM reads needed to update the scrollbars. Done in one
-// shot to minimize update/measure roundtrips.
-function measureForScrollbars(cm) {
- var d = cm.display, gutterW = d.gutters.offsetWidth
- var docH = Math.round(cm.doc.height + paddingVert(cm.display))
- return {
- clientHeight: d.scroller.clientHeight,
- viewHeight: d.wrapper.clientHeight,
- scrollWidth: d.scroller.scrollWidth, clientWidth: d.scroller.clientWidth,
- viewWidth: d.wrapper.clientWidth,
- barLeft: cm.options.fixedGutter ? gutterW : 0,
- docHeight: docH,
- scrollHeight: docH + scrollGap(cm) + d.barHeight,
- nativeBarWidth: d.nativeBarWidth,
- gutterWidth: gutterW
- }
-}
-
-var NativeScrollbars = function(place, scroll, cm) {
- this.cm = cm
- var vert = this.vert = elt("div", [elt("div", null, null, "min-width: 1px")], "CodeMirror-vscrollbar")
- var horiz = this.horiz = elt("div", [elt("div", null, null, "height: 100%; min-height: 1px")], "CodeMirror-hscrollbar")
- place(vert); place(horiz)
-
- on(vert, "scroll", function () {
- if (vert.clientHeight) { scroll(vert.scrollTop, "vertical") }
- })
- on(horiz, "scroll", function () {
- if (horiz.clientWidth) { scroll(horiz.scrollLeft, "horizontal") }
- })
-
- this.checkedZeroWidth = false
- // Need to set a minimum width to see the scrollbar on IE7 (but must not set it on IE8).
- if (ie && ie_version < 8) { this.horiz.style.minHeight = this.vert.style.minWidth = "18px" }
-};
-
-NativeScrollbars.prototype.update = function (measure) {
- var needsH = measure.scrollWidth > measure.clientWidth + 1
- var needsV = measure.scrollHeight > measure.clientHeight + 1
- var sWidth = measure.nativeBarWidth
-
- if (needsV) {
- this.vert.style.display = "block"
- this.vert.style.bottom = needsH ? sWidth + "px" : "0"
- var totalHeight = measure.viewHeight - (needsH ? sWidth : 0)
- // A bug in IE8 can cause this value to be negative, so guard it.
- this.vert.firstChild.style.height =
- Math.max(0, measure.scrollHeight - measure.clientHeight + totalHeight) + "px"
- } else {
- this.vert.style.display = ""
- this.vert.firstChild.style.height = "0"
- }
-
- if (needsH) {
- this.horiz.style.display = "block"
- this.horiz.style.right = needsV ? sWidth + "px" : "0"
- this.horiz.style.left = measure.barLeft + "px"
- var totalWidth = measure.viewWidth - measure.barLeft - (needsV ? sWidth : 0)
- this.horiz.firstChild.style.width =
- Math.max(0, measure.scrollWidth - measure.clientWidth + totalWidth) + "px"
- } else {
- this.horiz.style.display = ""
- this.horiz.firstChild.style.width = "0"
- }
-
- if (!this.checkedZeroWidth && measure.clientHeight > 0) {
- if (sWidth == 0) { this.zeroWidthHack() }
- this.checkedZeroWidth = true
- }
-
- return {right: needsV ? sWidth : 0, bottom: needsH ? sWidth : 0}
-};
-
-NativeScrollbars.prototype.setScrollLeft = function (pos) {
- if (this.horiz.scrollLeft != pos) { this.horiz.scrollLeft = pos }
- if (this.disableHoriz) { this.enableZeroWidthBar(this.horiz, this.disableHoriz) }
-};
-
-NativeScrollbars.prototype.setScrollTop = function (pos) {
- if (this.vert.scrollTop != pos) { this.vert.scrollTop = pos }
- if (this.disableVert) { this.enableZeroWidthBar(this.vert, this.disableVert) }
-};
-
-NativeScrollbars.prototype.zeroWidthHack = function () {
- var w = mac && !mac_geMountainLion ? "12px" : "18px"
- this.horiz.style.height = this.vert.style.width = w
- this.horiz.style.pointerEvents = this.vert.style.pointerEvents = "none"
- this.disableHoriz = new Delayed
- this.disableVert = new Delayed
-};
-
-NativeScrollbars.prototype.enableZeroWidthBar = function (bar, delay) {
- bar.style.pointerEvents = "auto"
- function maybeDisable() {
- // To find out whether the scrollbar is still visible, we
- // check whether the element under the pixel in the bottom
- // left corner of the scrollbar box is the scrollbar box
- // itself (when the bar is still visible) or its filler child
- // (when the bar is hidden). If it is still visible, we keep
- // it enabled, if it's hidden, we disable pointer events.
- var box = bar.getBoundingClientRect()
- var elt = document.elementFromPoint(box.left + 1, box.bottom - 1)
- if (elt != bar) { bar.style.pointerEvents = "none" }
- else { delay.set(1000, maybeDisable) }
- }
- delay.set(1000, maybeDisable)
-};
-
-NativeScrollbars.prototype.clear = function () {
- var parent = this.horiz.parentNode
- parent.removeChild(this.horiz)
- parent.removeChild(this.vert)
-};
-
-var NullScrollbars = function () {};
-
-NullScrollbars.prototype.update = function () { return {bottom: 0, right: 0} };
-NullScrollbars.prototype.setScrollLeft = function () {};
-NullScrollbars.prototype.setScrollTop = function () {};
-NullScrollbars.prototype.clear = function () {};
-
-function updateScrollbars(cm, measure) {
- if (!measure) { measure = measureForScrollbars(cm) }
- var startWidth = cm.display.barWidth, startHeight = cm.display.barHeight
- updateScrollbarsInner(cm, measure)
- for (var i = 0; i < 4 && startWidth != cm.display.barWidth || startHeight != cm.display.barHeight; i++) {
- if (startWidth != cm.display.barWidth && cm.options.lineWrapping)
- { updateHeightsInViewport(cm) }
- updateScrollbarsInner(cm, measureForScrollbars(cm))
- startWidth = cm.display.barWidth; startHeight = cm.display.barHeight
- }
-}
-
-// Re-synchronize the fake scrollbars with the actual size of the
-// content.
-function updateScrollbarsInner(cm, measure) {
- var d = cm.display
- var sizes = d.scrollbars.update(measure)
-
- d.sizer.style.paddingRight = (d.barWidth = sizes.right) + "px"
- d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + "px"
- d.heightForcer.style.borderBottom = sizes.bottom + "px solid transparent"
-
- if (sizes.right && sizes.bottom) {
- d.scrollbarFiller.style.display = "block"
- d.scrollbarFiller.style.height = sizes.bottom + "px"
- d.scrollbarFiller.style.width = sizes.right + "px"
- } else { d.scrollbarFiller.style.display = "" }
- if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {
- d.gutterFiller.style.display = "block"
- d.gutterFiller.style.height = sizes.bottom + "px"
- d.gutterFiller.style.width = measure.gutterWidth + "px"
- } else { d.gutterFiller.style.display = "" }
-}
-
-var scrollbarModel = {"native": NativeScrollbars, "null": NullScrollbars}
-
-function initScrollbars(cm) {
- if (cm.display.scrollbars) {
- cm.display.scrollbars.clear()
- if (cm.display.scrollbars.addClass)
- { rmClass(cm.display.wrapper, cm.display.scrollbars.addClass) }
- }
-
- cm.display.scrollbars = new scrollbarModel[cm.options.scrollbarStyle](function (node) {
- cm.display.wrapper.insertBefore(node, cm.display.scrollbarFiller)
- // Prevent clicks in the scrollbars from killing focus
- on(node, "mousedown", function () {
- if (cm.state.focused) { setTimeout(function () { return cm.display.input.focus(); }, 0) }
- })
- node.setAttribute("cm-not-content", "true")
- }, function (pos, axis) {
- if (axis == "horizontal") { setScrollLeft(cm, pos) }
- else { setScrollTop(cm, pos) }
- }, cm)
- if (cm.display.scrollbars.addClass)
- { addClass(cm.display.wrapper, cm.display.scrollbars.addClass) }
-}
-
-// SCROLLING THINGS INTO VIEW
-
-// If an editor sits on the top or bottom of the window, partially
-// scrolled out of view, this ensures that the cursor is visible.
-function maybeScrollWindow(cm, coords) {
- if (signalDOMEvent(cm, "scrollCursorIntoView")) { return }
-
- var display = cm.display, box = display.sizer.getBoundingClientRect(), doScroll = null
- if (coords.top + box.top < 0) { doScroll = true }
- else if (coords.bottom + box.top > (window.innerHeight || document.documentElement.clientHeight)) { doScroll = false }
- if (doScroll != null && !phantom) {
- var scrollNode = elt("div", "\u200b", null, ("position: absolute;\n top: " + (coords.top - display.viewOffset - paddingTop(cm.display)) + "px;\n height: " + (coords.bottom - coords.top + scrollGap(cm) + display.barHeight) + "px;\n left: " + (coords.left) + "px; width: 2px;"))
- cm.display.lineSpace.appendChild(scrollNode)
- scrollNode.scrollIntoView(doScroll)
- cm.display.lineSpace.removeChild(scrollNode)
- }
-}
-
-// Scroll a given position into view (immediately), verifying that
-// it actually became visible (as line heights are accurately
-// measured, the position of something may 'drift' during drawing).
-function scrollPosIntoView(cm, pos, end, margin) {
- if (margin == null) { margin = 0 }
- var coords
- for (var limit = 0; limit < 5; limit++) {
- var changed = false
- coords = cursorCoords(cm, pos)
- var endCoords = !end || end == pos ? coords : cursorCoords(cm, end)
- var scrollPos = calculateScrollPos(cm, Math.min(coords.left, endCoords.left),
- Math.min(coords.top, endCoords.top) - margin,
- Math.max(coords.left, endCoords.left),
- Math.max(coords.bottom, endCoords.bottom) + margin)
- var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft
- if (scrollPos.scrollTop != null) {
- setScrollTop(cm, scrollPos.scrollTop)
- if (Math.abs(cm.doc.scrollTop - startTop) > 1) { changed = true }
- }
- if (scrollPos.scrollLeft != null) {
- setScrollLeft(cm, scrollPos.scrollLeft)
- if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) { changed = true }
- }
- if (!changed) { break }
- }
- return coords
-}
-
-// Scroll a given set of coordinates into view (immediately).
-function scrollIntoView(cm, x1, y1, x2, y2) {
- var scrollPos = calculateScrollPos(cm, x1, y1, x2, y2)
- if (scrollPos.scrollTop != null) { setScrollTop(cm, scrollPos.scrollTop) }
- if (scrollPos.scrollLeft != null) { setScrollLeft(cm, scrollPos.scrollLeft) }
-}
-
-// Calculate a new scroll position needed to scroll the given
-// rectangle into view. Returns an object with scrollTop and
-// scrollLeft properties. When these are undefined, the
-// vertical/horizontal position does not need to be adjusted.
-function calculateScrollPos(cm, x1, y1, x2, y2) {
- var display = cm.display, snapMargin = textHeight(cm.display)
- if (y1 < 0) { y1 = 0 }
- var screentop = cm.curOp && cm.curOp.scrollTop != null ? cm.curOp.scrollTop : display.scroller.scrollTop
- var screen = displayHeight(cm), result = {}
- if (y2 - y1 > screen) { y2 = y1 + screen }
- var docBottom = cm.doc.height + paddingVert(display)
- var atTop = y1 < snapMargin, atBottom = y2 > docBottom - snapMargin
- if (y1 < screentop) {
- result.scrollTop = atTop ? 0 : y1
- } else if (y2 > screentop + screen) {
- var newTop = Math.min(y1, (atBottom ? docBottom : y2) - screen)
- if (newTop != screentop) { result.scrollTop = newTop }
- }
-
- var screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft
- var screenw = displayWidth(cm) - (cm.options.fixedGutter ? display.gutters.offsetWidth : 0)
- var tooWide = x2 - x1 > screenw
- if (tooWide) { x2 = x1 + screenw }
- if (x1 < 10)
- { result.scrollLeft = 0 }
- else if (x1 < screenleft)
- { result.scrollLeft = Math.max(0, x1 - (tooWide ? 0 : 10)) }
- else if (x2 > screenw + screenleft - 3)
- { result.scrollLeft = x2 + (tooWide ? 0 : 10) - screenw }
- return result
-}
-
-// Store a relative adjustment to the scroll position in the current
-// operation (to be applied when the operation finishes).
-function addToScrollPos(cm, left, top) {
- if (left != null || top != null) { resolveScrollToPos(cm) }
- if (left != null)
- { cm.curOp.scrollLeft = (cm.curOp.scrollLeft == null ? cm.doc.scrollLeft : cm.curOp.scrollLeft) + left }
- if (top != null)
- { cm.curOp.scrollTop = (cm.curOp.scrollTop == null ? cm.doc.scrollTop : cm.curOp.scrollTop) + top }
-}
-
-// Make sure that at the end of the operation the current cursor is
-// shown.
-function ensureCursorVisible(cm) {
- resolveScrollToPos(cm)
- var cur = cm.getCursor(), from = cur, to = cur
- if (!cm.options.lineWrapping) {
- from = cur.ch ? Pos(cur.line, cur.ch - 1) : cur
- to = Pos(cur.line, cur.ch + 1)
- }
- cm.curOp.scrollToPos = {from: from, to: to, margin: cm.options.cursorScrollMargin, isCursor: true}
-}
-
-// When an operation has its scrollToPos property set, and another
-// scroll action is applied before the end of the operation, this
-// 'simulates' scrolling that position into view in a cheap way, so
-// that the effect of intermediate scroll commands is not ignored.
-function resolveScrollToPos(cm) {
- var range = cm.curOp.scrollToPos
- if (range) {
- cm.curOp.scrollToPos = null
- var from = estimateCoords(cm, range.from), to = estimateCoords(cm, range.to)
- var sPos = calculateScrollPos(cm, Math.min(from.left, to.left),
- Math.min(from.top, to.top) - range.margin,
- Math.max(from.right, to.right),
- Math.max(from.bottom, to.bottom) + range.margin)
- cm.scrollTo(sPos.scrollLeft, sPos.scrollTop)
- }
-}
-
-// Operations are used to wrap a series of changes to the editor
-// state in such a way that each change won't have to update the
-// cursor and display (which would be awkward, slow, and
-// error-prone). Instead, display updates are batched and then all
-// combined and executed at once.
-
-var nextOpId = 0
-// Start a new operation.
-function startOperation(cm) {
- cm.curOp = {
- cm: cm,
- viewChanged: false, // Flag that indicates that lines might need to be redrawn
- startHeight: cm.doc.height, // Used to detect need to update scrollbar
- forceUpdate: false, // Used to force a redraw
- updateInput: null, // Whether to reset the input textarea
- typing: false, // Whether this reset should be careful to leave existing text (for compositing)
- changeObjs: null, // Accumulated changes, for firing change events
- cursorActivityHandlers: null, // Set of handlers to fire cursorActivity on
- cursorActivityCalled: 0, // Tracks which cursorActivity handlers have been called already
- selectionChanged: false, // Whether the selection needs to be redrawn
- updateMaxLine: false, // Set when the widest line needs to be determined anew
- scrollLeft: null, scrollTop: null, // Intermediate scroll position, not pushed to DOM yet
- scrollToPos: null, // Used to scroll to a specific position
- focus: false,
- id: ++nextOpId // Unique ID
- }
- pushOperation(cm.curOp)
-}
-
-// Finish an operation, updating the display and signalling delayed events
-function endOperation(cm) {
- var op = cm.curOp
- finishOperation(op, function (group) {
- for (var i = 0; i < group.ops.length; i++)
- { group.ops[i].cm.curOp = null }
- endOperations(group)
- })
-}
-
-// The DOM updates done when an operation finishes are batched so
-// that the minimum number of relayouts are required.
-function endOperations(group) {
- var ops = group.ops
- for (var i = 0; i < ops.length; i++) // Read DOM
- { endOperation_R1(ops[i]) }
- for (var i$1 = 0; i$1 < ops.length; i$1++) // Write DOM (maybe)
- { endOperation_W1(ops[i$1]) }
- for (var i$2 = 0; i$2 < ops.length; i$2++) // Read DOM
- { endOperation_R2(ops[i$2]) }
- for (var i$3 = 0; i$3 < ops.length; i$3++) // Write DOM (maybe)
- { endOperation_W2(ops[i$3]) }
- for (var i$4 = 0; i$4 < ops.length; i$4++) // Read DOM
- { endOperation_finish(ops[i$4]) }
-}
-
-function endOperation_R1(op) {
- var cm = op.cm, display = cm.display
- maybeClipScrollbars(cm)
- if (op.updateMaxLine) { findMaxLine(cm) }
-
- op.mustUpdate = op.viewChanged || op.forceUpdate || op.scrollTop != null ||
- op.scrollToPos && (op.scrollToPos.from.line < display.viewFrom ||
- op.scrollToPos.to.line >= display.viewTo) ||
- display.maxLineChanged && cm.options.lineWrapping
- op.update = op.mustUpdate &&
- new DisplayUpdate(cm, op.mustUpdate && {top: op.scrollTop, ensure: op.scrollToPos}, op.forceUpdate)
-}
-
-function endOperation_W1(op) {
- op.updatedDisplay = op.mustUpdate && updateDisplayIfNeeded(op.cm, op.update)
-}
-
-function endOperation_R2(op) {
- var cm = op.cm, display = cm.display
- if (op.updatedDisplay) { updateHeightsInViewport(cm) }
-
- op.barMeasure = measureForScrollbars(cm)
-
- // If the max line changed since it was last measured, measure it,
- // and ensure the document's width matches it.
- // updateDisplay_W2 will use these properties to do the actual resizing
- if (display.maxLineChanged && !cm.options.lineWrapping) {
- op.adjustWidthTo = measureChar(cm, display.maxLine, display.maxLine.text.length).left + 3
- cm.display.sizerWidth = op.adjustWidthTo
- op.barMeasure.scrollWidth =
- Math.max(display.scroller.clientWidth, display.sizer.offsetLeft + op.adjustWidthTo + scrollGap(cm) + cm.display.barWidth)
- op.maxScrollLeft = Math.max(0, display.sizer.offsetLeft + op.adjustWidthTo - displayWidth(cm))
- }
-
- if (op.updatedDisplay || op.selectionChanged)
- { op.preparedSelection = display.input.prepareSelection(op.focus) }
-}
-
-function endOperation_W2(op) {
- var cm = op.cm
-
- if (op.adjustWidthTo != null) {
- cm.display.sizer.style.minWidth = op.adjustWidthTo + "px"
- if (op.maxScrollLeft < cm.doc.scrollLeft)
- { setScrollLeft(cm, Math.min(cm.display.scroller.scrollLeft, op.maxScrollLeft), true) }
- cm.display.maxLineChanged = false
- }
-
- var takeFocus = op.focus && op.focus == activeElt() && (!document.hasFocus || document.hasFocus())
- if (op.preparedSelection)
- { cm.display.input.showSelection(op.preparedSelection, takeFocus) }
- if (op.updatedDisplay || op.startHeight != cm.doc.height)
- { updateScrollbars(cm, op.barMeasure) }
- if (op.updatedDisplay)
- { setDocumentHeight(cm, op.barMeasure) }
-
- if (op.selectionChanged) { restartBlink(cm) }
-
- if (cm.state.focused && op.updateInput)
- { cm.display.input.reset(op.typing) }
- if (takeFocus) { ensureFocus(op.cm) }
-}
-
-function endOperation_finish(op) {
- var cm = op.cm, display = cm.display, doc = cm.doc
-
- if (op.updatedDisplay) { postUpdateDisplay(cm, op.update) }
-
- // Abort mouse wheel delta measurement, when scrolling explicitly
- if (display.wheelStartX != null && (op.scrollTop != null || op.scrollLeft != null || op.scrollToPos))
- { display.wheelStartX = display.wheelStartY = null }
-
- // Propagate the scroll position to the actual DOM scroller
- if (op.scrollTop != null && (display.scroller.scrollTop != op.scrollTop || op.forceScroll)) {
- doc.scrollTop = Math.max(0, Math.min(display.scroller.scrollHeight - display.scroller.clientHeight, op.scrollTop))
- display.scrollbars.setScrollTop(doc.scrollTop)
- display.scroller.scrollTop = doc.scrollTop
- }
- if (op.scrollLeft != null && (display.scroller.scrollLeft != op.scrollLeft || op.forceScroll)) {
- doc.scrollLeft = Math.max(0, Math.min(display.scroller.scrollWidth - display.scroller.clientWidth, op.scrollLeft))
- display.scrollbars.setScrollLeft(doc.scrollLeft)
- display.scroller.scrollLeft = doc.scrollLeft
- alignHorizontally(cm)
- }
- // If we need to scroll a specific position into view, do so.
- if (op.scrollToPos) {
- var coords = scrollPosIntoView(cm, clipPos(doc, op.scrollToPos.from),
- clipPos(doc, op.scrollToPos.to), op.scrollToPos.margin)
- if (op.scrollToPos.isCursor && cm.state.focused) { maybeScrollWindow(cm, coords) }
- }
-
- // Fire events for markers that are hidden/unidden by editing or
- // undoing
- var hidden = op.maybeHiddenMarkers, unhidden = op.maybeUnhiddenMarkers
- if (hidden) { for (var i = 0; i < hidden.length; ++i)
- { if (!hidden[i].lines.length) { signal(hidden[i], "hide") } } }
- if (unhidden) { for (var i$1 = 0; i$1 < unhidden.length; ++i$1)
- { if (unhidden[i$1].lines.length) { signal(unhidden[i$1], "unhide") } } }
-
- if (display.wrapper.offsetHeight)
- { doc.scrollTop = cm.display.scroller.scrollTop }
-
- // Fire change events, and delayed event handlers
- if (op.changeObjs)
- { signal(cm, "changes", cm, op.changeObjs) }
- if (op.update)
- { op.update.finish() }
-}
-
-// Run the given function in an operation
-function runInOp(cm, f) {
- if (cm.curOp) { return f() }
- startOperation(cm)
- try { return f() }
- finally { endOperation(cm) }
-}
-// Wraps a function in an operation. Returns the wrapped function.
-function operation(cm, f) {
- return function() {
- if (cm.curOp) { return f.apply(cm, arguments) }
- startOperation(cm)
- try { return f.apply(cm, arguments) }
- finally { endOperation(cm) }
- }
-}
-// Used to add methods to editor and doc instances, wrapping them in
-// operations.
-function methodOp(f) {
- return function() {
- if (this.curOp) { return f.apply(this, arguments) }
- startOperation(this)
- try { return f.apply(this, arguments) }
- finally { endOperation(this) }
- }
-}
-function docMethodOp(f) {
- return function() {
- var cm = this.cm
- if (!cm || cm.curOp) { return f.apply(this, arguments) }
- startOperation(cm)
- try { return f.apply(this, arguments) }
- finally { endOperation(cm) }
- }
-}
-
-// Updates the display.view data structure for a given change to the
-// document. From and to are in pre-change coordinates. Lendiff is
-// the amount of lines added or subtracted by the change. This is
-// used for changes that span multiple lines, or change the way
-// lines are divided into visual lines. regLineChange (below)
-// registers single-line changes.
-function regChange(cm, from, to, lendiff) {
- if (from == null) { from = cm.doc.first }
- if (to == null) { to = cm.doc.first + cm.doc.size }
- if (!lendiff) { lendiff = 0 }
-
- var display = cm.display
- if (lendiff && to < display.viewTo &&
- (display.updateLineNumbers == null || display.updateLineNumbers > from))
- { display.updateLineNumbers = from }
-
- cm.curOp.viewChanged = true
-
- if (from >= display.viewTo) { // Change after
- if (sawCollapsedSpans && visualLineNo(cm.doc, from) < display.viewTo)
- { resetView(cm) }
- } else if (to <= display.viewFrom) { // Change before
- if (sawCollapsedSpans && visualLineEndNo(cm.doc, to + lendiff) > display.viewFrom) {
- resetView(cm)
- } else {
- display.viewFrom += lendiff
- display.viewTo += lendiff
- }
- } else if (from <= display.viewFrom && to >= display.viewTo) { // Full overlap
- resetView(cm)
- } else if (from <= display.viewFrom) { // Top overlap
- var cut = viewCuttingPoint(cm, to, to + lendiff, 1)
- if (cut) {
- display.view = display.view.slice(cut.index)
- display.viewFrom = cut.lineN
- display.viewTo += lendiff
- } else {
- resetView(cm)
- }
- } else if (to >= display.viewTo) { // Bottom overlap
- var cut$1 = viewCuttingPoint(cm, from, from, -1)
- if (cut$1) {
- display.view = display.view.slice(0, cut$1.index)
- display.viewTo = cut$1.lineN
- } else {
- resetView(cm)
- }
- } else { // Gap in the middle
- var cutTop = viewCuttingPoint(cm, from, from, -1)
- var cutBot = viewCuttingPoint(cm, to, to + lendiff, 1)
- if (cutTop && cutBot) {
- display.view = display.view.slice(0, cutTop.index)
- .concat(buildViewArray(cm, cutTop.lineN, cutBot.lineN))
- .concat(display.view.slice(cutBot.index))
- display.viewTo += lendiff
- } else {
- resetView(cm)
- }
- }
-
- var ext = display.externalMeasured
- if (ext) {
- if (to < ext.lineN)
- { ext.lineN += lendiff }
- else if (from < ext.lineN + ext.size)
- { display.externalMeasured = null }
- }
-}
-
-// Register a change to a single line. Type must be one of "text",
-// "gutter", "class", "widget"
-function regLineChange(cm, line, type) {
- cm.curOp.viewChanged = true
- var display = cm.display, ext = cm.display.externalMeasured
- if (ext && line >= ext.lineN && line < ext.lineN + ext.size)
- { display.externalMeasured = null }
-
- if (line < display.viewFrom || line >= display.viewTo) { return }
- var lineView = display.view[findViewIndex(cm, line)]
- if (lineView.node == null) { return }
- var arr = lineView.changes || (lineView.changes = [])
- if (indexOf(arr, type) == -1) { arr.push(type) }
-}
-
-// Clear the view.
-function resetView(cm) {
- cm.display.viewFrom = cm.display.viewTo = cm.doc.first
- cm.display.view = []
- cm.display.viewOffset = 0
-}
-
-function viewCuttingPoint(cm, oldN, newN, dir) {
- var index = findViewIndex(cm, oldN), diff, view = cm.display.view
- if (!sawCollapsedSpans || newN == cm.doc.first + cm.doc.size)
- { return {index: index, lineN: newN} }
- var n = cm.display.viewFrom
- for (var i = 0; i < index; i++)
- { n += view[i].size }
- if (n != oldN) {
- if (dir > 0) {
- if (index == view.length - 1) { return null }
- diff = (n + view[index].size) - oldN
- index++
- } else {
- diff = n - oldN
- }
- oldN += diff; newN += diff
- }
- while (visualLineNo(cm.doc, newN) != newN) {
- if (index == (dir < 0 ? 0 : view.length - 1)) { return null }
- newN += dir * view[index - (dir < 0 ? 1 : 0)].size
- index += dir
- }
- return {index: index, lineN: newN}
-}
-
-// Force the view to cover a given range, adding empty view element
-// or clipping off existing ones as needed.
-function adjustView(cm, from, to) {
- var display = cm.display, view = display.view
- if (view.length == 0 || from >= display.viewTo || to <= display.viewFrom) {
- display.view = buildViewArray(cm, from, to)
- display.viewFrom = from
- } else {
- if (display.viewFrom > from)
- { display.view = buildViewArray(cm, from, display.viewFrom).concat(display.view) }
- else if (display.viewFrom < from)
- { display.view = display.view.slice(findViewIndex(cm, from)) }
- display.viewFrom = from
- if (display.viewTo < to)
- { display.view = display.view.concat(buildViewArray(cm, display.viewTo, to)) }
- else if (display.viewTo > to)
- { display.view = display.view.slice(0, findViewIndex(cm, to)) }
- }
- display.viewTo = to
-}
-
-// Count the number of lines in the view whose DOM representation is
-// out of date (or nonexistent).
-function countDirtyView(cm) {
- var view = cm.display.view, dirty = 0
- for (var i = 0; i < view.length; i++) {
- var lineView = view[i]
- if (!lineView.hidden && (!lineView.node || lineView.changes)) { ++dirty }
- }
- return dirty
-}
-
-// HIGHLIGHT WORKER
-
-function startWorker(cm, time) {
- if (cm.doc.mode.startState && cm.doc.frontier < cm.display.viewTo)
- { cm.state.highlight.set(time, bind(highlightWorker, cm)) }
-}
-
-function highlightWorker(cm) {
- var doc = cm.doc
- if (doc.frontier < doc.first) { doc.frontier = doc.first }
- if (doc.frontier >= cm.display.viewTo) { return }
- var end = +new Date + cm.options.workTime
- var state = copyState(doc.mode, getStateBefore(cm, doc.frontier))
- var changedLines = []
-
- doc.iter(doc.frontier, Math.min(doc.first + doc.size, cm.display.viewTo + 500), function (line) {
- if (doc.frontier >= cm.display.viewFrom) { // Visible
- var oldStyles = line.styles, tooLong = line.text.length > cm.options.maxHighlightLength
- var highlighted = highlightLine(cm, line, tooLong ? copyState(doc.mode, state) : state, true)
- line.styles = highlighted.styles
- var oldCls = line.styleClasses, newCls = highlighted.classes
- if (newCls) { line.styleClasses = newCls }
- else if (oldCls) { line.styleClasses = null }
- var ischange = !oldStyles || oldStyles.length != line.styles.length ||
- oldCls != newCls && (!oldCls || !newCls || oldCls.bgClass != newCls.bgClass || oldCls.textClass != newCls.textClass)
- for (var i = 0; !ischange && i < oldStyles.length; ++i) { ischange = oldStyles[i] != line.styles[i] }
- if (ischange) { changedLines.push(doc.frontier) }
- line.stateAfter = tooLong ? state : copyState(doc.mode, state)
- } else {
- if (line.text.length <= cm.options.maxHighlightLength)
- { processLine(cm, line.text, state) }
- line.stateAfter = doc.frontier % 5 == 0 ? copyState(doc.mode, state) : null
- }
- ++doc.frontier
- if (+new Date > end) {
- startWorker(cm, cm.options.workDelay)
- return true
- }
- })
- if (changedLines.length) { runInOp(cm, function () {
- for (var i = 0; i < changedLines.length; i++)
- { regLineChange(cm, changedLines[i], "text") }
- }) }
-}
-
-// DISPLAY DRAWING
-
-var DisplayUpdate = function(cm, viewport, force) {
- var display = cm.display
-
- this.viewport = viewport
- // Store some values that we'll need later (but don't want to force a relayout for)
- this.visible = visibleLines(display, cm.doc, viewport)
- this.editorIsHidden = !display.wrapper.offsetWidth
- this.wrapperHeight = display.wrapper.clientHeight
- this.wrapperWidth = display.wrapper.clientWidth
- this.oldDisplayWidth = displayWidth(cm)
- this.force = force
- this.dims = getDimensions(cm)
- this.events = []
-};
-
-DisplayUpdate.prototype.signal = function (emitter, type) {
- if (hasHandler(emitter, type))
- { this.events.push(arguments) }
-};
-DisplayUpdate.prototype.finish = function () {
- var this$1 = this;
-
- for (var i = 0; i < this.events.length; i++)
- { signal.apply(null, this$1.events[i]) }
-};
-
-function maybeClipScrollbars(cm) {
- var display = cm.display
- if (!display.scrollbarsClipped && display.scroller.offsetWidth) {
- display.nativeBarWidth = display.scroller.offsetWidth - display.scroller.clientWidth
- display.heightForcer.style.height = scrollGap(cm) + "px"
- display.sizer.style.marginBottom = -display.nativeBarWidth + "px"
- display.sizer.style.borderRightWidth = scrollGap(cm) + "px"
- display.scrollbarsClipped = true
- }
-}
-
-// Does the actual updating of the line display. Bails out
-// (returning false) when there is nothing to be done and forced is
-// false.
-function updateDisplayIfNeeded(cm, update) {
- var display = cm.display, doc = cm.doc
-
- if (update.editorIsHidden) {
- resetView(cm)
- return false
- }
-
- // Bail out if the visible area is already rendered and nothing changed.
- if (!update.force &&
- update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&
- (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&
- display.renderedView == display.view && countDirtyView(cm) == 0)
- { return false }
-
- if (maybeUpdateLineNumberWidth(cm)) {
- resetView(cm)
- update.dims = getDimensions(cm)
- }
-
- // Compute a suitable new viewport (from & to)
- var end = doc.first + doc.size
- var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first)
- var to = Math.min(end, update.visible.to + cm.options.viewportMargin)
- if (display.viewFrom < from && from - display.viewFrom < 20) { from = Math.max(doc.first, display.viewFrom) }
- if (display.viewTo > to && display.viewTo - to < 20) { to = Math.min(end, display.viewTo) }
- if (sawCollapsedSpans) {
- from = visualLineNo(cm.doc, from)
- to = visualLineEndNo(cm.doc, to)
- }
-
- var different = from != display.viewFrom || to != display.viewTo ||
- display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth
- adjustView(cm, from, to)
-
- display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom))
- // Position the mover div to align with the current scroll position
- cm.display.mover.style.top = display.viewOffset + "px"
-
- var toUpdate = countDirtyView(cm)
- if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&
- (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))
- { return false }
-
- // For big changes, we hide the enclosing element during the
- // update, since that speeds up the operations on most browsers.
- var focused = activeElt()
- if (toUpdate > 4) { display.lineDiv.style.display = "none" }
- patchDisplay(cm, display.updateLineNumbers, update.dims)
- if (toUpdate > 4) { display.lineDiv.style.display = "" }
- display.renderedView = display.view
- // There might have been a widget with a focused element that got
- // hidden or updated, if so re-focus it.
- if (focused && activeElt() != focused && focused.offsetHeight) { focused.focus() }
-
- // Prevent selection and cursors from interfering with the scroll
- // width and height.
- removeChildren(display.cursorDiv)
- removeChildren(display.selectionDiv)
- display.gutters.style.height = display.sizer.style.minHeight = 0
-
- if (different) {
- display.lastWrapHeight = update.wrapperHeight
- display.lastWrapWidth = update.wrapperWidth
- startWorker(cm, 400)
- }
-
- display.updateLineNumbers = null
-
- return true
-}
-
-function postUpdateDisplay(cm, update) {
- var viewport = update.viewport
-
- for (var first = true;; first = false) {
- if (!first || !cm.options.lineWrapping || update.oldDisplayWidth == displayWidth(cm)) {
- // Clip forced viewport to actual scrollable area.
- if (viewport && viewport.top != null)
- { viewport = {top: Math.min(cm.doc.height + paddingVert(cm.display) - displayHeight(cm), viewport.top)} }
- // Updated line heights might result in the drawn area not
- // actually covering the viewport. Keep looping until it does.
- update.visible = visibleLines(cm.display, cm.doc, viewport)
- if (update.visible.from >= cm.display.viewFrom && update.visible.to <= cm.display.viewTo)
- { break }
- }
- if (!updateDisplayIfNeeded(cm, update)) { break }
- updateHeightsInViewport(cm)
- var barMeasure = measureForScrollbars(cm)
- updateSelection(cm)
- updateScrollbars(cm, barMeasure)
- setDocumentHeight(cm, barMeasure)
- }
-
- update.signal(cm, "update", cm)
- if (cm.display.viewFrom != cm.display.reportedViewFrom || cm.display.viewTo != cm.display.reportedViewTo) {
- update.signal(cm, "viewportChange", cm, cm.display.viewFrom, cm.display.viewTo)
- cm.display.reportedViewFrom = cm.display.viewFrom; cm.display.reportedViewTo = cm.display.viewTo
- }
-}
-
-function updateDisplaySimple(cm, viewport) {
- var update = new DisplayUpdate(cm, viewport)
- if (updateDisplayIfNeeded(cm, update)) {
- updateHeightsInViewport(cm)
- postUpdateDisplay(cm, update)
- var barMeasure = measureForScrollbars(cm)
- updateSelection(cm)
- updateScrollbars(cm, barMeasure)
- setDocumentHeight(cm, barMeasure)
- update.finish()
- }
-}
-
-// Sync the actual display DOM structure with display.view, removing
-// nodes for lines that are no longer in view, and creating the ones
-// that are not there yet, and updating the ones that are out of
-// date.
-function patchDisplay(cm, updateNumbersFrom, dims) {
- var display = cm.display, lineNumbers = cm.options.lineNumbers
- var container = display.lineDiv, cur = container.firstChild
-
- function rm(node) {
- var next = node.nextSibling
- // Works around a throw-scroll bug in OS X Webkit
- if (webkit && mac && cm.display.currentWheelTarget == node)
- { node.style.display = "none" }
- else
- { node.parentNode.removeChild(node) }
- return next
- }
-
- var view = display.view, lineN = display.viewFrom
- // Loop over the elements in the view, syncing cur (the DOM nodes
- // in display.lineDiv) with the view as we go.
- for (var i = 0; i < view.length; i++) {
- var lineView = view[i]
- if (lineView.hidden) {
- } else if (!lineView.node || lineView.node.parentNode != container) { // Not drawn yet
- var node = buildLineElement(cm, lineView, lineN, dims)
- container.insertBefore(node, cur)
- } else { // Already drawn
- while (cur != lineView.node) { cur = rm(cur) }
- var updateNumber = lineNumbers && updateNumbersFrom != null &&
- updateNumbersFrom <= lineN && lineView.lineNumber
- if (lineView.changes) {
- if (indexOf(lineView.changes, "gutter") > -1) { updateNumber = false }
- updateLineForChanges(cm, lineView, lineN, dims)
- }
- if (updateNumber) {
- removeChildren(lineView.lineNumber)
- lineView.lineNumber.appendChild(document.createTextNode(lineNumberFor(cm.options, lineN)))
- }
- cur = lineView.node.nextSibling
- }
- lineN += lineView.size
- }
- while (cur) { cur = rm(cur) }
-}
-
-function updateGutterSpace(cm) {
- var width = cm.display.gutters.offsetWidth
- cm.display.sizer.style.marginLeft = width + "px"
-}
-
-function setDocumentHeight(cm, measure) {
- cm.display.sizer.style.minHeight = measure.docHeight + "px"
- cm.display.heightForcer.style.top = measure.docHeight + "px"
- cm.display.gutters.style.height = (measure.docHeight + cm.display.barHeight + scrollGap(cm)) + "px"
-}
-
-// Rebuild the gutter elements, ensure the margin to the left of the
-// code matches their width.
-function updateGutters(cm) {
- var gutters = cm.display.gutters, specs = cm.options.gutters
- removeChildren(gutters)
- var i = 0
- for (; i < specs.length; ++i) {
- var gutterClass = specs[i]
- var gElt = gutters.appendChild(elt("div", null, "CodeMirror-gutter " + gutterClass))
- if (gutterClass == "CodeMirror-linenumbers") {
- cm.display.lineGutter = gElt
- gElt.style.width = (cm.display.lineNumWidth || 1) + "px"
- }
- }
- gutters.style.display = i ? "" : "none"
- updateGutterSpace(cm)
-}
-
-// Make sure the gutters options contains the element
-// "CodeMirror-linenumbers" when the lineNumbers option is true.
-function setGuttersForLineNumbers(options) {
- var found = indexOf(options.gutters, "CodeMirror-linenumbers")
- if (found == -1 && options.lineNumbers) {
- options.gutters = options.gutters.concat(["CodeMirror-linenumbers"])
- } else if (found > -1 && !options.lineNumbers) {
- options.gutters = options.gutters.slice(0)
- options.gutters.splice(found, 1)
- }
-}
-
-// Selection objects are immutable. A new one is created every time
-// the selection changes. A selection is one or more non-overlapping
-// (and non-touching) ranges, sorted, and an integer that indicates
-// which one is the primary selection (the one that's scrolled into
-// view, that getCursor returns, etc).
-var Selection = function(ranges, primIndex) {
- this.ranges = ranges
- this.primIndex = primIndex
-};
-
-Selection.prototype.primary = function () { return this.ranges[this.primIndex] };
-
-Selection.prototype.equals = function (other) {
- var this$1 = this;
-
- if (other == this) { return true }
- if (other.primIndex != this.primIndex || other.ranges.length != this.ranges.length) { return false }
- for (var i = 0; i < this.ranges.length; i++) {
- var here = this$1.ranges[i], there = other.ranges[i]
- if (!equalCursorPos(here.anchor, there.anchor) || !equalCursorPos(here.head, there.head)) { return false }
- }
- return true
-};
-
-Selection.prototype.deepCopy = function () {
- var this$1 = this;
-
- var out = []
- for (var i = 0; i < this.ranges.length; i++)
- { out[i] = new Range(copyPos(this$1.ranges[i].anchor), copyPos(this$1.ranges[i].head)) }
- return new Selection(out, this.primIndex)
-};
-
-Selection.prototype.somethingSelected = function () {
- var this$1 = this;
-
- for (var i = 0; i < this.ranges.length; i++)
- { if (!this$1.ranges[i].empty()) { return true } }
- return false
-};
-
-Selection.prototype.contains = function (pos, end) {
- var this$1 = this;
-
- if (!end) { end = pos }
- for (var i = 0; i < this.ranges.length; i++) {
- var range = this$1.ranges[i]
- if (cmp(end, range.from()) >= 0 && cmp(pos, range.to()) <= 0)
- { return i }
- }
- return -1
-};
-
-var Range = function(anchor, head) {
- this.anchor = anchor; this.head = head
-};
-
-Range.prototype.from = function () { return minPos(this.anchor, this.head) };
-Range.prototype.to = function () { return maxPos(this.anchor, this.head) };
-Range.prototype.empty = function () { return this.head.line == this.anchor.line && this.head.ch == this.anchor.ch };
-
-// Take an unsorted, potentially overlapping set of ranges, and
-// build a selection out of it. 'Consumes' ranges array (modifying
-// it).
-function normalizeSelection(ranges, primIndex) {
- var prim = ranges[primIndex]
- ranges.sort(function (a, b) { return cmp(a.from(), b.from()); })
- primIndex = indexOf(ranges, prim)
- for (var i = 1; i < ranges.length; i++) {
- var cur = ranges[i], prev = ranges[i - 1]
- if (cmp(prev.to(), cur.from()) >= 0) {
- var from = minPos(prev.from(), cur.from()), to = maxPos(prev.to(), cur.to())
- var inv = prev.empty() ? cur.from() == cur.head : prev.from() == prev.head
- if (i <= primIndex) { --primIndex }
- ranges.splice(--i, 2, new Range(inv ? to : from, inv ? from : to))
- }
- }
- return new Selection(ranges, primIndex)
-}
-
-function simpleSelection(anchor, head) {
- return new Selection([new Range(anchor, head || anchor)], 0)
-}
-
-// Compute the position of the end of a change (its 'to' property
-// refers to the pre-change end).
-function changeEnd(change) {
- if (!change.text) { return change.to }
- return Pos(change.from.line + change.text.length - 1,
- lst(change.text).length + (change.text.length == 1 ? change.from.ch : 0))
-}
-
-// Adjust a position to refer to the post-change position of the
-// same text, or the end of the change if the change covers it.
-function adjustForChange(pos, change) {
- if (cmp(pos, change.from) < 0) { return pos }
- if (cmp(pos, change.to) <= 0) { return changeEnd(change) }
-
- var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch
- if (pos.line == change.to.line) { ch += changeEnd(change).ch - change.to.ch }
- return Pos(line, ch)
-}
-
-function computeSelAfterChange(doc, change) {
- var out = []
- for (var i = 0; i < doc.sel.ranges.length; i++) {
- var range = doc.sel.ranges[i]
- out.push(new Range(adjustForChange(range.anchor, change),
- adjustForChange(range.head, change)))
- }
- return normalizeSelection(out, doc.sel.primIndex)
-}
-
-function offsetPos(pos, old, nw) {
- if (pos.line == old.line)
- { return Pos(nw.line, pos.ch - old.ch + nw.ch) }
- else
- { return Pos(nw.line + (pos.line - old.line), pos.ch) }
-}
-
-// Used by replaceSelections to allow moving the selection to the
-// start or around the replaced test. Hint may be "start" or "around".
-function computeReplacedSel(doc, changes, hint) {
- var out = []
- var oldPrev = Pos(doc.first, 0), newPrev = oldPrev
- for (var i = 0; i < changes.length; i++) {
- var change = changes[i]
- var from = offsetPos(change.from, oldPrev, newPrev)
- var to = offsetPos(changeEnd(change), oldPrev, newPrev)
- oldPrev = change.to
- newPrev = to
- if (hint == "around") {
- var range = doc.sel.ranges[i], inv = cmp(range.head, range.anchor) < 0
- out[i] = new Range(inv ? to : from, inv ? from : to)
- } else {
- out[i] = new Range(from, from)
- }
- }
- return new Selection(out, doc.sel.primIndex)
-}
-
-// Used to get the editor into a consistent state again when options change.
-
-function loadMode(cm) {
- cm.doc.mode = getMode(cm.options, cm.doc.modeOption)
- resetModeState(cm)
-}
-
-function resetModeState(cm) {
- cm.doc.iter(function (line) {
- if (line.stateAfter) { line.stateAfter = null }
- if (line.styles) { line.styles = null }
- })
- cm.doc.frontier = cm.doc.first
- startWorker(cm, 100)
- cm.state.modeGen++
- if (cm.curOp) { regChange(cm) }
-}
-
-// DOCUMENT DATA STRUCTURE
-
-// By default, updates that start and end at the beginning of a line
-// are treated specially, in order to make the association of line
-// widgets and marker elements with the text behave more intuitive.
-function isWholeLineUpdate(doc, change) {
- return change.from.ch == 0 && change.to.ch == 0 && lst(change.text) == "" &&
- (!doc.cm || doc.cm.options.wholeLineUpdateBefore)
-}
-
-// Perform a change on the document data structure.
-function updateDoc(doc, change, markedSpans, estimateHeight) {
- function spansFor(n) {return markedSpans ? markedSpans[n] : null}
- function update(line, text, spans) {
- updateLine(line, text, spans, estimateHeight)
- signalLater(line, "change", line, change)
- }
- function linesFor(start, end) {
- var result = []
- for (var i = start; i < end; ++i)
- { result.push(new Line(text[i], spansFor(i), estimateHeight)) }
- return result
- }
-
- var from = change.from, to = change.to, text = change.text
- var firstLine = getLine(doc, from.line), lastLine = getLine(doc, to.line)
- var lastText = lst(text), lastSpans = spansFor(text.length - 1), nlines = to.line - from.line
-
- // Adjust the line structure
- if (change.full) {
- doc.insert(0, linesFor(0, text.length))
- doc.remove(text.length, doc.size - text.length)
- } else if (isWholeLineUpdate(doc, change)) {
- // This is a whole-line replace. Treated specially to make
- // sure line objects move the way they are supposed to.
- var added = linesFor(0, text.length - 1)
- update(lastLine, lastLine.text, lastSpans)
- if (nlines) { doc.remove(from.line, nlines) }
- if (added.length) { doc.insert(from.line, added) }
- } else if (firstLine == lastLine) {
- if (text.length == 1) {
- update(firstLine, firstLine.text.slice(0, from.ch) + lastText + firstLine.text.slice(to.ch), lastSpans)
- } else {
- var added$1 = linesFor(1, text.length - 1)
- added$1.push(new Line(lastText + firstLine.text.slice(to.ch), lastSpans, estimateHeight))
- update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0))
- doc.insert(from.line + 1, added$1)
- }
- } else if (text.length == 1) {
- update(firstLine, firstLine.text.slice(0, from.ch) + text[0] + lastLine.text.slice(to.ch), spansFor(0))
- doc.remove(from.line + 1, nlines)
- } else {
- update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0))
- update(lastLine, lastText + lastLine.text.slice(to.ch), lastSpans)
- var added$2 = linesFor(1, text.length - 1)
- if (nlines > 1) { doc.remove(from.line + 1, nlines - 1) }
- doc.insert(from.line + 1, added$2)
- }
-
- signalLater(doc, "change", doc, change)
-}
-
-// Call f for all linked documents.
-function linkedDocs(doc, f, sharedHistOnly) {
- function propagate(doc, skip, sharedHist) {
- if (doc.linked) { for (var i = 0; i < doc.linked.length; ++i) {
- var rel = doc.linked[i]
- if (rel.doc == skip) { continue }
- var shared = sharedHist && rel.sharedHist
- if (sharedHistOnly && !shared) { continue }
- f(rel.doc, shared)
- propagate(rel.doc, doc, shared)
- } }
- }
- propagate(doc, null, true)
-}
-
-// Attach a document to an editor.
-function attachDoc(cm, doc) {
- if (doc.cm) { throw new Error("This document is already in use.") }
- cm.doc = doc
- doc.cm = cm
- estimateLineHeights(cm)
- loadMode(cm)
- if (!cm.options.lineWrapping) { findMaxLine(cm) }
- cm.options.mode = doc.modeOption
- regChange(cm)
-}
-
-function History(startGen) {
- // Arrays of change events and selections. Doing something adds an
- // event to done and clears undo. Undoing moves events from done
- // to undone, redoing moves them in the other direction.
- this.done = []; this.undone = []
- this.undoDepth = Infinity
- // Used to track when changes can be merged into a single undo
- // event
- this.lastModTime = this.lastSelTime = 0
- this.lastOp = this.lastSelOp = null
- this.lastOrigin = this.lastSelOrigin = null
- // Used by the isClean() method
- this.generation = this.maxGeneration = startGen || 1
-}
-
-// Create a history change event from an updateDoc-style change
-// object.
-function historyChangeFromChange(doc, change) {
- var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)}
- attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1)
- linkedDocs(doc, function (doc) { return attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); }, true)
- return histChange
-}
-
-// Pop all selection events off the end of a history array. Stop at
-// a change event.
-function clearSelectionEvents(array) {
- while (array.length) {
- var last = lst(array)
- if (last.ranges) { array.pop() }
- else { break }
- }
-}
-
-// Find the top change event in the history. Pop off selection
-// events that are in the way.
-function lastChangeEvent(hist, force) {
- if (force) {
- clearSelectionEvents(hist.done)
- return lst(hist.done)
- } else if (hist.done.length && !lst(hist.done).ranges) {
- return lst(hist.done)
- } else if (hist.done.length > 1 && !hist.done[hist.done.length - 2].ranges) {
- hist.done.pop()
- return lst(hist.done)
- }
-}
-
-// Register a change in the history. Merges changes that are within
-// a single operation, or are close together with an origin that
-// allows merging (starting with "+") into a single event.
-function addChangeToHistory(doc, change, selAfter, opId) {
- var hist = doc.history
- hist.undone.length = 0
- var time = +new Date, cur
- var last
-
- if ((hist.lastOp == opId ||
- hist.lastOrigin == change.origin && change.origin &&
- ((change.origin.charAt(0) == "+" && doc.cm && hist.lastModTime > time - doc.cm.options.historyEventDelay) ||
- change.origin.charAt(0) == "*")) &&
- (cur = lastChangeEvent(hist, hist.lastOp == opId))) {
- // Merge this change into the last event
- last = lst(cur.changes)
- if (cmp(change.from, change.to) == 0 && cmp(change.from, last.to) == 0) {
- // Optimized case for simple insertion -- don't want to add
- // new changesets for every character typed
- last.to = changeEnd(change)
- } else {
- // Add new sub-event
- cur.changes.push(historyChangeFromChange(doc, change))
- }
- } else {
- // Can not be merged, start a new event.
- var before = lst(hist.done)
- if (!before || !before.ranges)
- { pushSelectionToHistory(doc.sel, hist.done) }
- cur = {changes: [historyChangeFromChange(doc, change)],
- generation: hist.generation}
- hist.done.push(cur)
- while (hist.done.length > hist.undoDepth) {
- hist.done.shift()
- if (!hist.done[0].ranges) { hist.done.shift() }
- }
- }
- hist.done.push(selAfter)
- hist.generation = ++hist.maxGeneration
- hist.lastModTime = hist.lastSelTime = time
- hist.lastOp = hist.lastSelOp = opId
- hist.lastOrigin = hist.lastSelOrigin = change.origin
-
- if (!last) { signal(doc, "historyAdded") }
-}
-
-function selectionEventCanBeMerged(doc, origin, prev, sel) {
- var ch = origin.charAt(0)
- return ch == "*" ||
- ch == "+" &&
- prev.ranges.length == sel.ranges.length &&
- prev.somethingSelected() == sel.somethingSelected() &&
- new Date - doc.history.lastSelTime <= (doc.cm ? doc.cm.options.historyEventDelay : 500)
-}
-
-// Called whenever the selection changes, sets the new selection as
-// the pending selection in the history, and pushes the old pending
-// selection into the 'done' array when it was significantly
-// different (in number of selected ranges, emptiness, or time).
-function addSelectionToHistory(doc, sel, opId, options) {
- var hist = doc.history, origin = options && options.origin
-
- // A new event is started when the previous origin does not match
- // the current, or the origins don't allow matching. Origins
- // starting with * are always merged, those starting with + are
- // merged when similar and close together in time.
- if (opId == hist.lastSelOp ||
- (origin && hist.lastSelOrigin == origin &&
- (hist.lastModTime == hist.lastSelTime && hist.lastOrigin == origin ||
- selectionEventCanBeMerged(doc, origin, lst(hist.done), sel))))
- { hist.done[hist.done.length - 1] = sel }
- else
- { pushSelectionToHistory(sel, hist.done) }
-
- hist.lastSelTime = +new Date
- hist.lastSelOrigin = origin
- hist.lastSelOp = opId
- if (options && options.clearRedo !== false)
- { clearSelectionEvents(hist.undone) }
-}
-
-function pushSelectionToHistory(sel, dest) {
- var top = lst(dest)
- if (!(top && top.ranges && top.equals(sel)))
- { dest.push(sel) }
-}
-
-// Used to store marked span information in the history.
-function attachLocalSpans(doc, change, from, to) {
- var existing = change["spans_" + doc.id], n = 0
- doc.iter(Math.max(doc.first, from), Math.min(doc.first + doc.size, to), function (line) {
- if (line.markedSpans)
- { (existing || (existing = change["spans_" + doc.id] = {}))[n] = line.markedSpans }
- ++n
- })
-}
-
-// When un/re-doing restores text containing marked spans, those
-// that have been explicitly cleared should not be restored.
-function removeClearedSpans(spans) {
- if (!spans) { return null }
- var out
- for (var i = 0; i < spans.length; ++i) {
- if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i) } }
- else if (out) { out.push(spans[i]) }
- }
- return !out ? spans : out.length ? out : null
-}
-
-// Retrieve and filter the old marked spans stored in a change event.
-function getOldSpans(doc, change) {
- var found = change["spans_" + doc.id]
- if (!found) { return null }
- var nw = []
- for (var i = 0; i < change.text.length; ++i)
- { nw.push(removeClearedSpans(found[i])) }
- return nw
-}
-
-// Used for un/re-doing changes from the history. Combines the
-// result of computing the existing spans with the set of spans that
-// existed in the history (so that deleting around a span and then
-// undoing brings back the span).
-function mergeOldSpans(doc, change) {
- var old = getOldSpans(doc, change)
- var stretched = stretchSpansOverChange(doc, change)
- if (!old) { return stretched }
- if (!stretched) { return old }
-
- for (var i = 0; i < old.length; ++i) {
- var oldCur = old[i], stretchCur = stretched[i]
- if (oldCur && stretchCur) {
- spans: for (var j = 0; j < stretchCur.length; ++j) {
- var span = stretchCur[j]
- for (var k = 0; k < oldCur.length; ++k)
- { if (oldCur[k].marker == span.marker) { continue spans } }
- oldCur.push(span)
- }
- } else if (stretchCur) {
- old[i] = stretchCur
- }
- }
- return old
-}
-
-// Used both to provide a JSON-safe object in .getHistory, and, when
-// detaching a document, to split the history in two
-function copyHistoryArray(events, newGroup, instantiateSel) {
- var copy = []
- for (var i = 0; i < events.length; ++i) {
- var event = events[i]
- if (event.ranges) {
- copy.push(instantiateSel ? Selection.prototype.deepCopy.call(event) : event)
- continue
- }
- var changes = event.changes, newChanges = []
- copy.push({changes: newChanges})
- for (var j = 0; j < changes.length; ++j) {
- var change = changes[j], m = (void 0)
- newChanges.push({from: change.from, to: change.to, text: change.text})
- if (newGroup) { for (var prop in change) { if (m = prop.match(/^spans_(\d+)$/)) {
- if (indexOf(newGroup, Number(m[1])) > -1) {
- lst(newChanges)[prop] = change[prop]
- delete change[prop]
- }
- } } }
- }
- }
- return copy
-}
-
-// The 'scroll' parameter given to many of these indicated whether
-// the new cursor position should be scrolled into view after
-// modifying the selection.
-
-// If shift is held or the extend flag is set, extends a range to
-// include a given position (and optionally a second position).
-// Otherwise, simply returns the range between the given positions.
-// Used for cursor motion and such.
-function extendRange(doc, range, head, other) {
- if (doc.cm && doc.cm.display.shift || doc.extend) {
- var anchor = range.anchor
- if (other) {
- var posBefore = cmp(head, anchor) < 0
- if (posBefore != (cmp(other, anchor) < 0)) {
- anchor = head
- head = other
- } else if (posBefore != (cmp(head, other) < 0)) {
- head = other
- }
- }
- return new Range(anchor, head)
- } else {
- return new Range(other || head, head)
- }
-}
-
-// Extend the primary selection range, discard the rest.
-function extendSelection(doc, head, other, options) {
- setSelection(doc, new Selection([extendRange(doc, doc.sel.primary(), head, other)], 0), options)
-}
-
-// Extend all selections (pos is an array of selections with length
-// equal the number of selections)
-function extendSelections(doc, heads, options) {
- var out = []
- for (var i = 0; i < doc.sel.ranges.length; i++)
- { out[i] = extendRange(doc, doc.sel.ranges[i], heads[i], null) }
- var newSel = normalizeSelection(out, doc.sel.primIndex)
- setSelection(doc, newSel, options)
-}
-
-// Updates a single range in the selection.
-function replaceOneSelection(doc, i, range, options) {
- var ranges = doc.sel.ranges.slice(0)
- ranges[i] = range
- setSelection(doc, normalizeSelection(ranges, doc.sel.primIndex), options)
-}
-
-// Reset the selection to a single range.
-function setSimpleSelection(doc, anchor, head, options) {
- setSelection(doc, simpleSelection(anchor, head), options)
-}
-
-// Give beforeSelectionChange handlers a change to influence a
-// selection update.
-function filterSelectionChange(doc, sel, options) {
- var obj = {
- ranges: sel.ranges,
- update: function(ranges) {
- var this$1 = this;
-
- this.ranges = []
- for (var i = 0; i < ranges.length; i++)
- { this$1.ranges[i] = new Range(clipPos(doc, ranges[i].anchor),
- clipPos(doc, ranges[i].head)) }
- },
- origin: options && options.origin
- }
- signal(doc, "beforeSelectionChange", doc, obj)
- if (doc.cm) { signal(doc.cm, "beforeSelectionChange", doc.cm, obj) }
- if (obj.ranges != sel.ranges) { return normalizeSelection(obj.ranges, obj.ranges.length - 1) }
- else { return sel }
-}
-
-function setSelectionReplaceHistory(doc, sel, options) {
- var done = doc.history.done, last = lst(done)
- if (last && last.ranges) {
- done[done.length - 1] = sel
- setSelectionNoUndo(doc, sel, options)
- } else {
- setSelection(doc, sel, options)
- }
-}
-
-// Set a new selection.
-function setSelection(doc, sel, options) {
- setSelectionNoUndo(doc, sel, options)
- addSelectionToHistory(doc, doc.sel, doc.cm ? doc.cm.curOp.id : NaN, options)
-}
-
-function setSelectionNoUndo(doc, sel, options) {
- if (hasHandler(doc, "beforeSelectionChange") || doc.cm && hasHandler(doc.cm, "beforeSelectionChange"))
- { sel = filterSelectionChange(doc, sel, options) }
-
- var bias = options && options.bias ||
- (cmp(sel.primary().head, doc.sel.primary().head) < 0 ? -1 : 1)
- setSelectionInner(doc, skipAtomicInSelection(doc, sel, bias, true))
-
- if (!(options && options.scroll === false) && doc.cm)
- { ensureCursorVisible(doc.cm) }
-}
-
-function setSelectionInner(doc, sel) {
- if (sel.equals(doc.sel)) { return }
-
- doc.sel = sel
-
- if (doc.cm) {
- doc.cm.curOp.updateInput = doc.cm.curOp.selectionChanged = true
- signalCursorActivity(doc.cm)
- }
- signalLater(doc, "cursorActivity", doc)
-}
-
-// Verify that the selection does not partially select any atomic
-// marked ranges.
-function reCheckSelection(doc) {
- setSelectionInner(doc, skipAtomicInSelection(doc, doc.sel, null, false), sel_dontScroll)
-}
-
-// Return a selection that does not partially select any atomic
-// ranges.
-function skipAtomicInSelection(doc, sel, bias, mayClear) {
- var out
- for (var i = 0; i < sel.ranges.length; i++) {
- var range = sel.ranges[i]
- var old = sel.ranges.length == doc.sel.ranges.length && doc.sel.ranges[i]
- var newAnchor = skipAtomic(doc, range.anchor, old && old.anchor, bias, mayClear)
- var newHead = skipAtomic(doc, range.head, old && old.head, bias, mayClear)
- if (out || newAnchor != range.anchor || newHead != range.head) {
- if (!out) { out = sel.ranges.slice(0, i) }
- out[i] = new Range(newAnchor, newHead)
- }
- }
- return out ? normalizeSelection(out, sel.primIndex) : sel
-}
-
-function skipAtomicInner(doc, pos, oldPos, dir, mayClear) {
- var line = getLine(doc, pos.line)
- if (line.markedSpans) { for (var i = 0; i < line.markedSpans.length; ++i) {
- var sp = line.markedSpans[i], m = sp.marker
- if ((sp.from == null || (m.inclusiveLeft ? sp.from <= pos.ch : sp.from < pos.ch)) &&
- (sp.to == null || (m.inclusiveRight ? sp.to >= pos.ch : sp.to > pos.ch))) {
- if (mayClear) {
- signal(m, "beforeCursorEnter")
- if (m.explicitlyCleared) {
- if (!line.markedSpans) { break }
- else {--i; continue}
- }
- }
- if (!m.atomic) { continue }
-
- if (oldPos) {
- var near = m.find(dir < 0 ? 1 : -1), diff = (void 0)
- if (dir < 0 ? m.inclusiveRight : m.inclusiveLeft)
- { near = movePos(doc, near, -dir, near && near.line == pos.line ? line : null) }
- if (near && near.line == pos.line && (diff = cmp(near, oldPos)) && (dir < 0 ? diff < 0 : diff > 0))
- { return skipAtomicInner(doc, near, pos, dir, mayClear) }
- }
-
- var far = m.find(dir < 0 ? -1 : 1)
- if (dir < 0 ? m.inclusiveLeft : m.inclusiveRight)
- { far = movePos(doc, far, dir, far.line == pos.line ? line : null) }
- return far ? skipAtomicInner(doc, far, pos, dir, mayClear) : null
- }
- } }
- return pos
-}
-
-// Ensure a given position is not inside an atomic range.
-function skipAtomic(doc, pos, oldPos, bias, mayClear) {
- var dir = bias || 1
- var found = skipAtomicInner(doc, pos, oldPos, dir, mayClear) ||
- (!mayClear && skipAtomicInner(doc, pos, oldPos, dir, true)) ||
- skipAtomicInner(doc, pos, oldPos, -dir, mayClear) ||
- (!mayClear && skipAtomicInner(doc, pos, oldPos, -dir, true))
- if (!found) {
- doc.cantEdit = true
- return Pos(doc.first, 0)
- }
- return found
-}
-
-function movePos(doc, pos, dir, line) {
- if (dir < 0 && pos.ch == 0) {
- if (pos.line > doc.first) { return clipPos(doc, Pos(pos.line - 1)) }
- else { return null }
- } else if (dir > 0 && pos.ch == (line || getLine(doc, pos.line)).text.length) {
- if (pos.line < doc.first + doc.size - 1) { return Pos(pos.line + 1, 0) }
- else { return null }
- } else {
- return new Pos(pos.line, pos.ch + dir)
- }
-}
-
-function selectAll(cm) {
- cm.setSelection(Pos(cm.firstLine(), 0), Pos(cm.lastLine()), sel_dontScroll)
-}
-
-// UPDATING
-
-// Allow "beforeChange" event handlers to influence a change
-function filterChange(doc, change, update) {
- var obj = {
- canceled: false,
- from: change.from,
- to: change.to,
- text: change.text,
- origin: change.origin,
- cancel: function () { return obj.canceled = true; }
- }
- if (update) { obj.update = function (from, to, text, origin) {
- if (from) { obj.from = clipPos(doc, from) }
- if (to) { obj.to = clipPos(doc, to) }
- if (text) { obj.text = text }
- if (origin !== undefined) { obj.origin = origin }
- } }
- signal(doc, "beforeChange", doc, obj)
- if (doc.cm) { signal(doc.cm, "beforeChange", doc.cm, obj) }
-
- if (obj.canceled) { return null }
- return {from: obj.from, to: obj.to, text: obj.text, origin: obj.origin}
-}
-
-// Apply a change to a document, and add it to the document's
-// history, and propagating it to all linked documents.
-function makeChange(doc, change, ignoreReadOnly) {
- if (doc.cm) {
- if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) }
- if (doc.cm.state.suppressEdits) { return }
- }
-
- if (hasHandler(doc, "beforeChange") || doc.cm && hasHandler(doc.cm, "beforeChange")) {
- change = filterChange(doc, change, true)
- if (!change) { return }
- }
-
- // Possibly split or suppress the update based on the presence
- // of read-only spans in its range.
- var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to)
- if (split) {
- for (var i = split.length - 1; i >= 0; --i)
- { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [""] : change.text}) }
- } else {
- makeChangeInner(doc, change)
- }
-}
-
-function makeChangeInner(doc, change) {
- if (change.text.length == 1 && change.text[0] == "" && cmp(change.from, change.to) == 0) { return }
- var selAfter = computeSelAfterChange(doc, change)
- addChangeToHistory(doc, change, selAfter, doc.cm ? doc.cm.curOp.id : NaN)
-
- makeChangeSingleDoc(doc, change, selAfter, stretchSpansOverChange(doc, change))
- var rebased = []
-
- linkedDocs(doc, function (doc, sharedHist) {
- if (!sharedHist && indexOf(rebased, doc.history) == -1) {
- rebaseHist(doc.history, change)
- rebased.push(doc.history)
- }
- makeChangeSingleDoc(doc, change, null, stretchSpansOverChange(doc, change))
- })
-}
-
-// Revert a change stored in a document's history.
-function makeChangeFromHistory(doc, type, allowSelectionOnly) {
- if (doc.cm && doc.cm.state.suppressEdits && !allowSelectionOnly) { return }
-
- var hist = doc.history, event, selAfter = doc.sel
- var source = type == "undo" ? hist.done : hist.undone, dest = type == "undo" ? hist.undone : hist.done
-
- // Verify that there is a useable event (so that ctrl-z won't
- // needlessly clear selection events)
- var i = 0
- for (; i < source.length; i++) {
- event = source[i]
- if (allowSelectionOnly ? event.ranges && !event.equals(doc.sel) : !event.ranges)
- { break }
- }
- if (i == source.length) { return }
- hist.lastOrigin = hist.lastSelOrigin = null
-
- for (;;) {
- event = source.pop()
- if (event.ranges) {
- pushSelectionToHistory(event, dest)
- if (allowSelectionOnly && !event.equals(doc.sel)) {
- setSelection(doc, event, {clearRedo: false})
- return
- }
- selAfter = event
- }
- else { break }
- }
-
- // Build up a reverse change object to add to the opposite history
- // stack (redo when undoing, and vice versa).
- var antiChanges = []
- pushSelectionToHistory(selAfter, dest)
- dest.push({changes: antiChanges, generation: hist.generation})
- hist.generation = event.generation || ++hist.maxGeneration
-
- var filter = hasHandler(doc, "beforeChange") || doc.cm && hasHandler(doc.cm, "beforeChange")
-
- var loop = function ( i ) {
- var change = event.changes[i]
- change.origin = type
- if (filter && !filterChange(doc, change, false)) {
- source.length = 0
- return {}
- }
-
- antiChanges.push(historyChangeFromChange(doc, change))
-
- var after = i ? computeSelAfterChange(doc, change) : lst(source)
- makeChangeSingleDoc(doc, change, after, mergeOldSpans(doc, change))
- if (!i && doc.cm) { doc.cm.scrollIntoView({from: change.from, to: changeEnd(change)}) }
- var rebased = []
-
- // Propagate to the linked documents
- linkedDocs(doc, function (doc, sharedHist) {
- if (!sharedHist && indexOf(rebased, doc.history) == -1) {
- rebaseHist(doc.history, change)
- rebased.push(doc.history)
- }
- makeChangeSingleDoc(doc, change, null, mergeOldSpans(doc, change))
- })
- };
-
- for (var i$1 = event.changes.length - 1; i$1 >= 0; --i$1) {
- var returned = loop( i$1 );
-
- if ( returned ) return returned.v;
- }
-}
-
-// Sub-views need their line numbers shifted when text is added
-// above or below them in the parent document.
-function shiftDoc(doc, distance) {
- if (distance == 0) { return }
- doc.first += distance
- doc.sel = new Selection(map(doc.sel.ranges, function (range) { return new Range(
- Pos(range.anchor.line + distance, range.anchor.ch),
- Pos(range.head.line + distance, range.head.ch)
- ); }), doc.sel.primIndex)
- if (doc.cm) {
- regChange(doc.cm, doc.first, doc.first - distance, distance)
- for (var d = doc.cm.display, l = d.viewFrom; l < d.viewTo; l++)
- { regLineChange(doc.cm, l, "gutter") }
- }
-}
-
-// More lower-level change function, handling only a single document
-// (not linked ones).
-function makeChangeSingleDoc(doc, change, selAfter, spans) {
- if (doc.cm && !doc.cm.curOp)
- { return operation(doc.cm, makeChangeSingleDoc)(doc, change, selAfter, spans) }
-
- if (change.to.line < doc.first) {
- shiftDoc(doc, change.text.length - 1 - (change.to.line - change.from.line))
- return
- }
- if (change.from.line > doc.lastLine()) { return }
-
- // Clip the change to the size of this doc
- if (change.from.line < doc.first) {
- var shift = change.text.length - 1 - (doc.first - change.from.line)
- shiftDoc(doc, shift)
- change = {from: Pos(doc.first, 0), to: Pos(change.to.line + shift, change.to.ch),
- text: [lst(change.text)], origin: change.origin}
- }
- var last = doc.lastLine()
- if (change.to.line > last) {
- change = {from: change.from, to: Pos(last, getLine(doc, last).text.length),
- text: [change.text[0]], origin: change.origin}
- }
-
- change.removed = getBetween(doc, change.from, change.to)
-
- if (!selAfter) { selAfter = computeSelAfterChange(doc, change) }
- if (doc.cm) { makeChangeSingleDocInEditor(doc.cm, change, spans) }
- else { updateDoc(doc, change, spans) }
- setSelectionNoUndo(doc, selAfter, sel_dontScroll)
-}
-
-// Handle the interaction of a change to a document with the editor
-// that this document is part of.
-function makeChangeSingleDocInEditor(cm, change, spans) {
- var doc = cm.doc, display = cm.display, from = change.from, to = change.to
-
- var recomputeMaxLength = false, checkWidthStart = from.line
- if (!cm.options.lineWrapping) {
- checkWidthStart = lineNo(visualLine(getLine(doc, from.line)))
- doc.iter(checkWidthStart, to.line + 1, function (line) {
- if (line == display.maxLine) {
- recomputeMaxLength = true
- return true
- }
- })
- }
-
- if (doc.sel.contains(change.from, change.to) > -1)
- { signalCursorActivity(cm) }
-
- updateDoc(doc, change, spans, estimateHeight(cm))
-
- if (!cm.options.lineWrapping) {
- doc.iter(checkWidthStart, from.line + change.text.length, function (line) {
- var len = lineLength(line)
- if (len > display.maxLineLength) {
- display.maxLine = line
- display.maxLineLength = len
- display.maxLineChanged = true
- recomputeMaxLength = false
- }
- })
- if (recomputeMaxLength) { cm.curOp.updateMaxLine = true }
- }
-
- // Adjust frontier, schedule worker
- doc.frontier = Math.min(doc.frontier, from.line)
- startWorker(cm, 400)
-
- var lendiff = change.text.length - (to.line - from.line) - 1
- // Remember that these lines changed, for updating the display
- if (change.full)
- { regChange(cm) }
- else if (from.line == to.line && change.text.length == 1 && !isWholeLineUpdate(cm.doc, change))
- { regLineChange(cm, from.line, "text") }
- else
- { regChange(cm, from.line, to.line + 1, lendiff) }
-
- var changesHandler = hasHandler(cm, "changes"), changeHandler = hasHandler(cm, "change")
- if (changeHandler || changesHandler) {
- var obj = {
- from: from, to: to,
- text: change.text,
- removed: change.removed,
- origin: change.origin
- }
- if (changeHandler) { signalLater(cm, "change", cm, obj) }
- if (changesHandler) { (cm.curOp.changeObjs || (cm.curOp.changeObjs = [])).push(obj) }
- }
- cm.display.selForContextMenu = null
-}
-
-function replaceRange(doc, code, from, to, origin) {
- if (!to) { to = from }
- if (cmp(to, from) < 0) { var tmp = to; to = from; from = tmp }
- if (typeof code == "string") { code = doc.splitLines(code) }
- makeChange(doc, {from: from, to: to, text: code, origin: origin})
-}
-
-// Rebasing/resetting history to deal with externally-sourced changes
-
-function rebaseHistSelSingle(pos, from, to, diff) {
- if (to < pos.line) {
- pos.line += diff
- } else if (from < pos.line) {
- pos.line = from
- pos.ch = 0
- }
-}
-
-// Tries to rebase an array of history events given a change in the
-// document. If the change touches the same lines as the event, the
-// event, and everything 'behind' it, is discarded. If the change is
-// before the event, the event's positions are updated. Uses a
-// copy-on-write scheme for the positions, to avoid having to
-// reallocate them all on every rebase, but also avoid problems with
-// shared position objects being unsafely updated.
-function rebaseHistArray(array, from, to, diff) {
- for (var i = 0; i < array.length; ++i) {
- var sub = array[i], ok = true
- if (sub.ranges) {
- if (!sub.copied) { sub = array[i] = sub.deepCopy(); sub.copied = true }
- for (var j = 0; j < sub.ranges.length; j++) {
- rebaseHistSelSingle(sub.ranges[j].anchor, from, to, diff)
- rebaseHistSelSingle(sub.ranges[j].head, from, to, diff)
- }
- continue
- }
- for (var j$1 = 0; j$1 < sub.changes.length; ++j$1) {
- var cur = sub.changes[j$1]
- if (to < cur.from.line) {
- cur.from = Pos(cur.from.line + diff, cur.from.ch)
- cur.to = Pos(cur.to.line + diff, cur.to.ch)
- } else if (from <= cur.to.line) {
- ok = false
- break
- }
- }
- if (!ok) {
- array.splice(0, i + 1)
- i = 0
- }
- }
-}
-
-function rebaseHist(hist, change) {
- var from = change.from.line, to = change.to.line, diff = change.text.length - (to - from) - 1
- rebaseHistArray(hist.done, from, to, diff)
- rebaseHistArray(hist.undone, from, to, diff)
-}
-
-// Utility for applying a change to a line by handle or number,
-// returning the number and optionally registering the line as
-// changed.
-function changeLine(doc, handle, changeType, op) {
- var no = handle, line = handle
- if (typeof handle == "number") { line = getLine(doc, clipLine(doc, handle)) }
- else { no = lineNo(handle) }
- if (no == null) { return null }
- if (op(line, no) && doc.cm) { regLineChange(doc.cm, no, changeType) }
- return line
-}
-
-// The document is represented as a BTree consisting of leaves, with
-// chunk of lines in them, and branches, with up to ten leaves or
-// other branch nodes below them. The top node is always a branch
-// node, and is the document object itself (meaning it has
-// additional methods and properties).
-//
-// All nodes have parent links. The tree is used both to go from
-// line numbers to line objects, and to go from objects to numbers.
-// It also indexes by height, and is used to convert between height
-// and line object, and to find the total height of the document.
-//
-// See also http://marijnhaverbeke.nl/blog/codemirror-line-tree.html
-
-var LeafChunk = function(lines) {
- var this$1 = this;
-
- this.lines = lines
- this.parent = null
- var height = 0
- for (var i = 0; i < lines.length; ++i) {
- lines[i].parent = this$1
- height += lines[i].height
- }
- this.height = height
-};
-
-LeafChunk.prototype.chunkSize = function () { return this.lines.length };
-
-// Remove the n lines at offset 'at'.
-LeafChunk.prototype.removeInner = function (at, n) {
- var this$1 = this;
-
- for (var i = at, e = at + n; i < e; ++i) {
- var line = this$1.lines[i]
- this$1.height -= line.height
- cleanUpLine(line)
- signalLater(line, "delete")
- }
- this.lines.splice(at, n)
-};
-
-// Helper used to collapse a small branch into a single leaf.
-LeafChunk.prototype.collapse = function (lines) {
- lines.push.apply(lines, this.lines)
-};
-
-// Insert the given array of lines at offset 'at', count them as
-// having the given height.
-LeafChunk.prototype.insertInner = function (at, lines, height) {
- var this$1 = this;
-
- this.height += height
- this.lines = this.lines.slice(0, at).concat(lines).concat(this.lines.slice(at))
- for (var i = 0; i < lines.length; ++i) { lines[i].parent = this$1 }
-};
-
-// Used to iterate over a part of the tree.
-LeafChunk.prototype.iterN = function (at, n, op) {
- var this$1 = this;
-
- for (var e = at + n; at < e; ++at)
- { if (op(this$1.lines[at])) { return true } }
-};
-
-var BranchChunk = function(children) {
- var this$1 = this;
-
- this.children = children
- var size = 0, height = 0
- for (var i = 0; i < children.length; ++i) {
- var ch = children[i]
- size += ch.chunkSize(); height += ch.height
- ch.parent = this$1
- }
- this.size = size
- this.height = height
- this.parent = null
-};
-
-BranchChunk.prototype.chunkSize = function () { return this.size };
-
-BranchChunk.prototype.removeInner = function (at, n) {
- var this$1 = this;
-
- this.size -= n
- for (var i = 0; i < this.children.length; ++i) {
- var child = this$1.children[i], sz = child.chunkSize()
- if (at < sz) {
- var rm = Math.min(n, sz - at), oldHeight = child.height
- child.removeInner(at, rm)
- this$1.height -= oldHeight - child.height
- if (sz == rm) { this$1.children.splice(i--, 1); child.parent = null }
- if ((n -= rm) == 0) { break }
- at = 0
- } else { at -= sz }
- }
- // If the result is smaller than 25 lines, ensure that it is a
- // single leaf node.
- if (this.size - n < 25 &&
- (this.children.length > 1 || !(this.children[0] instanceof LeafChunk))) {
- var lines = []
- this.collapse(lines)
- this.children = [new LeafChunk(lines)]
- this.children[0].parent = this
- }
-};
-
-BranchChunk.prototype.collapse = function (lines) {
- var this$1 = this;
-
- for (var i = 0; i < this.children.length; ++i) { this$1.children[i].collapse(lines) }
-};
-
-BranchChunk.prototype.insertInner = function (at, lines, height) {
- var this$1 = this;
-
- this.size += lines.length
- this.height += height
- for (var i = 0; i < this.children.length; ++i) {
- var child = this$1.children[i], sz = child.chunkSize()
- if (at <= sz) {
- child.insertInner(at, lines, height)
- if (child.lines && child.lines.length > 50) {
- // To avoid memory thrashing when child.lines is huge (e.g. first view of a large file), it's never spliced.
- // Instead, small slices are taken. They're taken in order because sequential memory accesses are fastest.
- var remaining = child.lines.length % 25 + 25
- for (var pos = remaining; pos < child.lines.length;) {
- var leaf = new LeafChunk(child.lines.slice(pos, pos += 25))
- child.height -= leaf.height
- this$1.children.splice(++i, 0, leaf)
- leaf.parent = this$1
- }
- child.lines = child.lines.slice(0, remaining)
- this$1.maybeSpill()
- }
- break
- }
- at -= sz
- }
-};
-
-// When a node has grown, check whether it should be split.
-BranchChunk.prototype.maybeSpill = function () {
- if (this.children.length <= 10) { return }
- var me = this
- do {
- var spilled = me.children.splice(me.children.length - 5, 5)
- var sibling = new BranchChunk(spilled)
- if (!me.parent) { // Become the parent node
- var copy = new BranchChunk(me.children)
- copy.parent = me
- me.children = [copy, sibling]
- me = copy
- } else {
- me.size -= sibling.size
- me.height -= sibling.height
- var myIndex = indexOf(me.parent.children, me)
- me.parent.children.splice(myIndex + 1, 0, sibling)
- }
- sibling.parent = me.parent
- } while (me.children.length > 10)
- me.parent.maybeSpill()
-};
-
-BranchChunk.prototype.iterN = function (at, n, op) {
- var this$1 = this;
-
- for (var i = 0; i < this.children.length; ++i) {
- var child = this$1.children[i], sz = child.chunkSize()
- if (at < sz) {
- var used = Math.min(n, sz - at)
- if (child.iterN(at, used, op)) { return true }
- if ((n -= used) == 0) { break }
- at = 0
- } else { at -= sz }
- }
-};
-
-// Line widgets are block elements displayed above or below a line.
-
-var LineWidget = function(doc, node, options) {
- var this$1 = this;
-
- if (options) { for (var opt in options) { if (options.hasOwnProperty(opt))
- { this$1[opt] = options[opt] } } }
- this.doc = doc
- this.node = node
-};
-
-LineWidget.prototype.clear = function () {
- var this$1 = this;
-
- var cm = this.doc.cm, ws = this.line.widgets, line = this.line, no = lineNo(line)
- if (no == null || !ws) { return }
- for (var i = 0; i < ws.length; ++i) { if (ws[i] == this$1) { ws.splice(i--, 1) } }
- if (!ws.length) { line.widgets = null }
- var height = widgetHeight(this)
- updateLineHeight(line, Math.max(0, line.height - height))
- if (cm) {
- runInOp(cm, function () {
- adjustScrollWhenAboveVisible(cm, line, -height)
- regLineChange(cm, no, "widget")
- })
- signalLater(cm, "lineWidgetCleared", cm, this)
- }
-};
-
-LineWidget.prototype.changed = function () {
- var oldH = this.height, cm = this.doc.cm, line = this.line
- this.height = null
- var diff = widgetHeight(this) - oldH
- if (!diff) { return }
- updateLineHeight(line, line.height + diff)
- if (cm) { runInOp(cm, function () {
- cm.curOp.forceUpdate = true
- adjustScrollWhenAboveVisible(cm, line, diff)
- }) }
-};
-eventMixin(LineWidget)
-
-function adjustScrollWhenAboveVisible(cm, line, diff) {
- if (heightAtLine(line) < ((cm.curOp && cm.curOp.scrollTop) || cm.doc.scrollTop))
- { addToScrollPos(cm, null, diff) }
-}
-
-function addLineWidget(doc, handle, node, options) {
- var widget = new LineWidget(doc, node, options)
- var cm = doc.cm
- if (cm && widget.noHScroll) { cm.display.alignWidgets = true }
- changeLine(doc, handle, "widget", function (line) {
- var widgets = line.widgets || (line.widgets = [])
- if (widget.insertAt == null) { widgets.push(widget) }
- else { widgets.splice(Math.min(widgets.length - 1, Math.max(0, widget.insertAt)), 0, widget) }
- widget.line = line
- if (cm && !lineIsHidden(doc, line)) {
- var aboveVisible = heightAtLine(line) < doc.scrollTop
- updateLineHeight(line, line.height + widgetHeight(widget))
- if (aboveVisible) { addToScrollPos(cm, null, widget.height) }
- cm.curOp.forceUpdate = true
- }
- return true
- })
- signalLater(cm, "lineWidgetAdded", cm, widget)
- return widget
-}
-
-// TEXTMARKERS
-
-// Created with markText and setBookmark methods. A TextMarker is a
-// handle that can be used to clear or find a marked position in the
-// document. Line objects hold arrays (markedSpans) containing
-// {from, to, marker} object pointing to such marker objects, and
-// indicating that such a marker is present on that line. Multiple
-// lines may point to the same marker when it spans across lines.
-// The spans will have null for their from/to properties when the
-// marker continues beyond the start/end of the line. Markers have
-// links back to the lines they currently touch.
-
-// Collapsed markers have unique ids, in order to be able to order
-// them, which is needed for uniquely determining an outer marker
-// when they overlap (they may nest, but not partially overlap).
-var nextMarkerId = 0
-
-var TextMarker = function(doc, type) {
- this.lines = []
- this.type = type
- this.doc = doc
- this.id = ++nextMarkerId
-};
-
-// Clear the marker.
-TextMarker.prototype.clear = function () {
- var this$1 = this;
-
- if (this.explicitlyCleared) { return }
- var cm = this.doc.cm, withOp = cm && !cm.curOp
- if (withOp) { startOperation(cm) }
- if (hasHandler(this, "clear")) {
- var found = this.find()
- if (found) { signalLater(this, "clear", found.from, found.to) }
- }
- var min = null, max = null
- for (var i = 0; i < this.lines.length; ++i) {
- var line = this$1.lines[i]
- var span = getMarkedSpanFor(line.markedSpans, this$1)
- if (cm && !this$1.collapsed) { regLineChange(cm, lineNo(line), "text") }
- else if (cm) {
- if (span.to != null) { max = lineNo(line) }
- if (span.from != null) { min = lineNo(line) }
- }
- line.markedSpans = removeMarkedSpan(line.markedSpans, span)
- if (span.from == null && this$1.collapsed && !lineIsHidden(this$1.doc, line) && cm)
- { updateLineHeight(line, textHeight(cm.display)) }
- }
- if (cm && this.collapsed && !cm.options.lineWrapping) { for (var i$1 = 0; i$1 < this.lines.length; ++i$1) {
- var visual = visualLine(this$1.lines[i$1]), len = lineLength(visual)
- if (len > cm.display.maxLineLength) {
- cm.display.maxLine = visual
- cm.display.maxLineLength = len
- cm.display.maxLineChanged = true
- }
- } }
-
- if (min != null && cm && this.collapsed) { regChange(cm, min, max + 1) }
- this.lines.length = 0
- this.explicitlyCleared = true
- if (this.atomic && this.doc.cantEdit) {
- this.doc.cantEdit = false
- if (cm) { reCheckSelection(cm.doc) }
- }
- if (cm) { signalLater(cm, "markerCleared", cm, this) }
- if (withOp) { endOperation(cm) }
- if (this.parent) { this.parent.clear() }
-};
-
-// Find the position of the marker in the document. Returns a {from,
-// to} object by default. Side can be passed to get a specific side
-// -- 0 (both), -1 (left), or 1 (right). When lineObj is true, the
-// Pos objects returned contain a line object, rather than a line
-// number (used to prevent looking up the same line twice).
-TextMarker.prototype.find = function (side, lineObj) {
- var this$1 = this;
-
- if (side == null && this.type == "bookmark") { side = 1 }
- var from, to
- for (var i = 0; i < this.lines.length; ++i) {
- var line = this$1.lines[i]
- var span = getMarkedSpanFor(line.markedSpans, this$1)
- if (span.from != null) {
- from = Pos(lineObj ? line : lineNo(line), span.from)
- if (side == -1) { return from }
- }
- if (span.to != null) {
- to = Pos(lineObj ? line : lineNo(line), span.to)
- if (side == 1) { return to }
- }
- }
- return from && {from: from, to: to}
-};
-
-// Signals that the marker's widget changed, and surrounding layout
-// should be recomputed.
-TextMarker.prototype.changed = function () {
- var pos = this.find(-1, true), widget = this, cm = this.doc.cm
- if (!pos || !cm) { return }
- runInOp(cm, function () {
- var line = pos.line, lineN = lineNo(pos.line)
- var view = findViewForLine(cm, lineN)
- if (view) {
- clearLineMeasurementCacheFor(view)
- cm.curOp.selectionChanged = cm.curOp.forceUpdate = true
- }
- cm.curOp.updateMaxLine = true
- if (!lineIsHidden(widget.doc, line) && widget.height != null) {
- var oldHeight = widget.height
- widget.height = null
- var dHeight = widgetHeight(widget) - oldHeight
- if (dHeight)
- { updateLineHeight(line, line.height + dHeight) }
- }
- })
-};
-
-TextMarker.prototype.attachLine = function (line) {
- if (!this.lines.length && this.doc.cm) {
- var op = this.doc.cm.curOp
- if (!op.maybeHiddenMarkers || indexOf(op.maybeHiddenMarkers, this) == -1)
- { (op.maybeUnhiddenMarkers || (op.maybeUnhiddenMarkers = [])).push(this) }
- }
- this.lines.push(line)
-};
-
-TextMarker.prototype.detachLine = function (line) {
- this.lines.splice(indexOf(this.lines, line), 1)
- if (!this.lines.length && this.doc.cm) {
- var op = this.doc.cm.curOp
- ;(op.maybeHiddenMarkers || (op.maybeHiddenMarkers = [])).push(this)
- }
-};
-eventMixin(TextMarker)
-
-// Create a marker, wire it up to the right lines, and
-function markText(doc, from, to, options, type) {
- // Shared markers (across linked documents) are handled separately
- // (markTextShared will call out to this again, once per
- // document).
- if (options && options.shared) { return markTextShared(doc, from, to, options, type) }
- // Ensure we are in an operation.
- if (doc.cm && !doc.cm.curOp) { return operation(doc.cm, markText)(doc, from, to, options, type) }
-
- var marker = new TextMarker(doc, type), diff = cmp(from, to)
- if (options) { copyObj(options, marker, false) }
- // Don't connect empty markers unless clearWhenEmpty is false
- if (diff > 0 || diff == 0 && marker.clearWhenEmpty !== false)
- { return marker }
- if (marker.replacedWith) {
- // Showing up as a widget implies collapsed (widget replaces text)
- marker.collapsed = true
- marker.widgetNode = elt("span", [marker.replacedWith], "CodeMirror-widget")
- marker.widgetNode.setAttribute("role", "presentation") // hide from accessibility tree
- if (!options.handleMouseEvents) { marker.widgetNode.setAttribute("cm-ignore-events", "true") }
- if (options.insertLeft) { marker.widgetNode.insertLeft = true }
- }
- if (marker.collapsed) {
- if (conflictingCollapsedRange(doc, from.line, from, to, marker) ||
- from.line != to.line && conflictingCollapsedRange(doc, to.line, from, to, marker))
- { throw new Error("Inserting collapsed marker partially overlapping an existing one") }
- seeCollapsedSpans()
- }
-
- if (marker.addToHistory)
- { addChangeToHistory(doc, {from: from, to: to, origin: "markText"}, doc.sel, NaN) }
-
- var curLine = from.line, cm = doc.cm, updateMaxLine
- doc.iter(curLine, to.line + 1, function (line) {
- if (cm && marker.collapsed && !cm.options.lineWrapping && visualLine(line) == cm.display.maxLine)
- { updateMaxLine = true }
- if (marker.collapsed && curLine != from.line) { updateLineHeight(line, 0) }
- addMarkedSpan(line, new MarkedSpan(marker,
- curLine == from.line ? from.ch : null,
- curLine == to.line ? to.ch : null))
- ++curLine
- })
- // lineIsHidden depends on the presence of the spans, so needs a second pass
- if (marker.collapsed) { doc.iter(from.line, to.line + 1, function (line) {
- if (lineIsHidden(doc, line)) { updateLineHeight(line, 0) }
- }) }
-
- if (marker.clearOnEnter) { on(marker, "beforeCursorEnter", function () { return marker.clear(); }) }
-
- if (marker.readOnly) {
- seeReadOnlySpans()
- if (doc.history.done.length || doc.history.undone.length)
- { doc.clearHistory() }
- }
- if (marker.collapsed) {
- marker.id = ++nextMarkerId
- marker.atomic = true
- }
- if (cm) {
- // Sync editor state
- if (updateMaxLine) { cm.curOp.updateMaxLine = true }
- if (marker.collapsed)
- { regChange(cm, from.line, to.line + 1) }
- else if (marker.className || marker.title || marker.startStyle || marker.endStyle || marker.css)
- { for (var i = from.line; i <= to.line; i++) { regLineChange(cm, i, "text") } }
- if (marker.atomic) { reCheckSelection(cm.doc) }
- signalLater(cm, "markerAdded", cm, marker)
- }
- return marker
-}
-
-// SHARED TEXTMARKERS
-
-// A shared marker spans multiple linked documents. It is
-// implemented as a meta-marker-object controlling multiple normal
-// markers.
-var SharedTextMarker = function(markers, primary) {
- var this$1 = this;
-
- this.markers = markers
- this.primary = primary
- for (var i = 0; i < markers.length; ++i)
- { markers[i].parent = this$1 }
-};
-
-SharedTextMarker.prototype.clear = function () {
- var this$1 = this;
-
- if (this.explicitlyCleared) { return }
- this.explicitlyCleared = true
- for (var i = 0; i < this.markers.length; ++i)
- { this$1.markers[i].clear() }
- signalLater(this, "clear")
-};
-
-SharedTextMarker.prototype.find = function (side, lineObj) {
- return this.primary.find(side, lineObj)
-};
-eventMixin(SharedTextMarker)
-
-function markTextShared(doc, from, to, options, type) {
- options = copyObj(options)
- options.shared = false
- var markers = [markText(doc, from, to, options, type)], primary = markers[0]
- var widget = options.widgetNode
- linkedDocs(doc, function (doc) {
- if (widget) { options.widgetNode = widget.cloneNode(true) }
- markers.push(markText(doc, clipPos(doc, from), clipPos(doc, to), options, type))
- for (var i = 0; i < doc.linked.length; ++i)
- { if (doc.linked[i].isParent) { return } }
- primary = lst(markers)
- })
- return new SharedTextMarker(markers, primary)
-}
-
-function findSharedMarkers(doc) {
- return doc.findMarks(Pos(doc.first, 0), doc.clipPos(Pos(doc.lastLine())), function (m) { return m.parent; })
-}
-
-function copySharedMarkers(doc, markers) {
- for (var i = 0; i < markers.length; i++) {
- var marker = markers[i], pos = marker.find()
- var mFrom = doc.clipPos(pos.from), mTo = doc.clipPos(pos.to)
- if (cmp(mFrom, mTo)) {
- var subMark = markText(doc, mFrom, mTo, marker.primary, marker.primary.type)
- marker.markers.push(subMark)
- subMark.parent = marker
- }
- }
-}
-
-function detachSharedMarkers(markers) {
- var loop = function ( i ) {
- var marker = markers[i], linked = [marker.primary.doc]
- linkedDocs(marker.primary.doc, function (d) { return linked.push(d); })
- for (var j = 0; j < marker.markers.length; j++) {
- var subMarker = marker.markers[j]
- if (indexOf(linked, subMarker.doc) == -1) {
- subMarker.parent = null
- marker.markers.splice(j--, 1)
- }
- }
- };
-
- for (var i = 0; i < markers.length; i++) loop( i );
-}
-
-var nextDocId = 0
-var Doc = function(text, mode, firstLine, lineSep) {
- if (!(this instanceof Doc)) { return new Doc(text, mode, firstLine, lineSep) }
- if (firstLine == null) { firstLine = 0 }
-
- BranchChunk.call(this, [new LeafChunk([new Line("", null)])])
- this.first = firstLine
- this.scrollTop = this.scrollLeft = 0
- this.cantEdit = false
- this.cleanGeneration = 1
- this.frontier = firstLine
- var start = Pos(firstLine, 0)
- this.sel = simpleSelection(start)
- this.history = new History(null)
- this.id = ++nextDocId
- this.modeOption = mode
- this.lineSep = lineSep
- this.extend = false
-
- if (typeof text == "string") { text = this.splitLines(text) }
- updateDoc(this, {from: start, to: start, text: text})
- setSelection(this, simpleSelection(start), sel_dontScroll)
-}
-
-Doc.prototype = createObj(BranchChunk.prototype, {
- constructor: Doc,
- // Iterate over the document. Supports two forms -- with only one
- // argument, it calls that for each line in the document. With
- // three, it iterates over the range given by the first two (with
- // the second being non-inclusive).
- iter: function(from, to, op) {
- if (op) { this.iterN(from - this.first, to - from, op) }
- else { this.iterN(this.first, this.first + this.size, from) }
- },
-
- // Non-public interface for adding and removing lines.
- insert: function(at, lines) {
- var height = 0
- for (var i = 0; i < lines.length; ++i) { height += lines[i].height }
- this.insertInner(at - this.first, lines, height)
- },
- remove: function(at, n) { this.removeInner(at - this.first, n) },
-
- // From here, the methods are part of the public interface. Most
- // are also available from CodeMirror (editor) instances.
-
- getValue: function(lineSep) {
- var lines = getLines(this, this.first, this.first + this.size)
- if (lineSep === false) { return lines }
- return lines.join(lineSep || this.lineSeparator())
- },
- setValue: docMethodOp(function(code) {
- var top = Pos(this.first, 0), last = this.first + this.size - 1
- makeChange(this, {from: top, to: Pos(last, getLine(this, last).text.length),
- text: this.splitLines(code), origin: "setValue", full: true}, true)
- setSelection(this, simpleSelection(top))
- }),
- replaceRange: function(code, from, to, origin) {
- from = clipPos(this, from)
- to = to ? clipPos(this, to) : from
- replaceRange(this, code, from, to, origin)
- },
- getRange: function(from, to, lineSep) {
- var lines = getBetween(this, clipPos(this, from), clipPos(this, to))
- if (lineSep === false) { return lines }
- return lines.join(lineSep || this.lineSeparator())
- },
-
- getLine: function(line) {var l = this.getLineHandle(line); return l && l.text},
-
- getLineHandle: function(line) {if (isLine(this, line)) { return getLine(this, line) }},
- getLineNumber: function(line) {return lineNo(line)},
-
- getLineHandleVisualStart: function(line) {
- if (typeof line == "number") { line = getLine(this, line) }
- return visualLine(line)
- },
-
- lineCount: function() {return this.size},
- firstLine: function() {return this.first},
- lastLine: function() {return this.first + this.size - 1},
-
- clipPos: function(pos) {return clipPos(this, pos)},
-
- getCursor: function(start) {
- var range = this.sel.primary(), pos
- if (start == null || start == "head") { pos = range.head }
- else if (start == "anchor") { pos = range.anchor }
- else if (start == "end" || start == "to" || start === false) { pos = range.to() }
- else { pos = range.from() }
- return pos
- },
- listSelections: function() { return this.sel.ranges },
- somethingSelected: function() {return this.sel.somethingSelected()},
-
- setCursor: docMethodOp(function(line, ch, options) {
- setSimpleSelection(this, clipPos(this, typeof line == "number" ? Pos(line, ch || 0) : line), null, options)
- }),
- setSelection: docMethodOp(function(anchor, head, options) {
- setSimpleSelection(this, clipPos(this, anchor), clipPos(this, head || anchor), options)
- }),
- extendSelection: docMethodOp(function(head, other, options) {
- extendSelection(this, clipPos(this, head), other && clipPos(this, other), options)
- }),
- extendSelections: docMethodOp(function(heads, options) {
- extendSelections(this, clipPosArray(this, heads), options)
- }),
- extendSelectionsBy: docMethodOp(function(f, options) {
- var heads = map(this.sel.ranges, f)
- extendSelections(this, clipPosArray(this, heads), options)
- }),
- setSelections: docMethodOp(function(ranges, primary, options) {
- var this$1 = this;
-
- if (!ranges.length) { return }
- var out = []
- for (var i = 0; i < ranges.length; i++)
- { out[i] = new Range(clipPos(this$1, ranges[i].anchor),
- clipPos(this$1, ranges[i].head)) }
- if (primary == null) { primary = Math.min(ranges.length - 1, this.sel.primIndex) }
- setSelection(this, normalizeSelection(out, primary), options)
- }),
- addSelection: docMethodOp(function(anchor, head, options) {
- var ranges = this.sel.ranges.slice(0)
- ranges.push(new Range(clipPos(this, anchor), clipPos(this, head || anchor)))
- setSelection(this, normalizeSelection(ranges, ranges.length - 1), options)
- }),
-
- getSelection: function(lineSep) {
- var this$1 = this;
-
- var ranges = this.sel.ranges, lines
- for (var i = 0; i < ranges.length; i++) {
- var sel = getBetween(this$1, ranges[i].from(), ranges[i].to())
- lines = lines ? lines.concat(sel) : sel
- }
- if (lineSep === false) { return lines }
- else { return lines.join(lineSep || this.lineSeparator()) }
- },
- getSelections: function(lineSep) {
- var this$1 = this;
-
- var parts = [], ranges = this.sel.ranges
- for (var i = 0; i < ranges.length; i++) {
- var sel = getBetween(this$1, ranges[i].from(), ranges[i].to())
- if (lineSep !== false) { sel = sel.join(lineSep || this$1.lineSeparator()) }
- parts[i] = sel
- }
- return parts
- },
- replaceSelection: function(code, collapse, origin) {
- var dup = []
- for (var i = 0; i < this.sel.ranges.length; i++)
- { dup[i] = code }
- this.replaceSelections(dup, collapse, origin || "+input")
- },
- replaceSelections: docMethodOp(function(code, collapse, origin) {
- var this$1 = this;
-
- var changes = [], sel = this.sel
- for (var i = 0; i < sel.ranges.length; i++) {
- var range = sel.ranges[i]
- changes[i] = {from: range.from(), to: range.to(), text: this$1.splitLines(code[i]), origin: origin}
- }
- var newSel = collapse && collapse != "end" && computeReplacedSel(this, changes, collapse)
- for (var i$1 = changes.length - 1; i$1 >= 0; i$1--)
- { makeChange(this$1, changes[i$1]) }
- if (newSel) { setSelectionReplaceHistory(this, newSel) }
- else if (this.cm) { ensureCursorVisible(this.cm) }
- }),
- undo: docMethodOp(function() {makeChangeFromHistory(this, "undo")}),
- redo: docMethodOp(function() {makeChangeFromHistory(this, "redo")}),
- undoSelection: docMethodOp(function() {makeChangeFromHistory(this, "undo", true)}),
- redoSelection: docMethodOp(function() {makeChangeFromHistory(this, "redo", true)}),
-
- setExtending: function(val) {this.extend = val},
- getExtending: function() {return this.extend},
-
- historySize: function() {
- var hist = this.history, done = 0, undone = 0
- for (var i = 0; i < hist.done.length; i++) { if (!hist.done[i].ranges) { ++done } }
- for (var i$1 = 0; i$1 < hist.undone.length; i$1++) { if (!hist.undone[i$1].ranges) { ++undone } }
- return {undo: done, redo: undone}
- },
- clearHistory: function() {this.history = new History(this.history.maxGeneration)},
-
- markClean: function() {
- this.cleanGeneration = this.changeGeneration(true)
- },
- changeGeneration: function(forceSplit) {
- if (forceSplit)
- { this.history.lastOp = this.history.lastSelOp = this.history.lastOrigin = null }
- return this.history.generation
- },
- isClean: function (gen) {
- return this.history.generation == (gen || this.cleanGeneration)
- },
-
- getHistory: function() {
- return {done: copyHistoryArray(this.history.done),
- undone: copyHistoryArray(this.history.undone)}
- },
- setHistory: function(histData) {
- var hist = this.history = new History(this.history.maxGeneration)
- hist.done = copyHistoryArray(histData.done.slice(0), null, true)
- hist.undone = copyHistoryArray(histData.undone.slice(0), null, true)
- },
-
- setGutterMarker: docMethodOp(function(line, gutterID, value) {
- return changeLine(this, line, "gutter", function (line) {
- var markers = line.gutterMarkers || (line.gutterMarkers = {})
- markers[gutterID] = value
- if (!value && isEmpty(markers)) { line.gutterMarkers = null }
- return true
- })
- }),
-
- clearGutter: docMethodOp(function(gutterID) {
- var this$1 = this;
-
- this.iter(function (line) {
- if (line.gutterMarkers && line.gutterMarkers[gutterID]) {
- changeLine(this$1, line, "gutter", function () {
- line.gutterMarkers[gutterID] = null
- if (isEmpty(line.gutterMarkers)) { line.gutterMarkers = null }
- return true
- })
- }
- })
- }),
-
- lineInfo: function(line) {
- var n
- if (typeof line == "number") {
- if (!isLine(this, line)) { return null }
- n = line
- line = getLine(this, line)
- if (!line) { return null }
- } else {
- n = lineNo(line)
- if (n == null) { return null }
- }
- return {line: n, handle: line, text: line.text, gutterMarkers: line.gutterMarkers,
- textClass: line.textClass, bgClass: line.bgClass, wrapClass: line.wrapClass,
- widgets: line.widgets}
- },
-
- addLineClass: docMethodOp(function(handle, where, cls) {
- return changeLine(this, handle, where == "gutter" ? "gutter" : "class", function (line) {
- var prop = where == "text" ? "textClass"
- : where == "background" ? "bgClass"
- : where == "gutter" ? "gutterClass" : "wrapClass"
- if (!line[prop]) { line[prop] = cls }
- else if (classTest(cls).test(line[prop])) { return false }
- else { line[prop] += " " + cls }
- return true
- })
- }),
- removeLineClass: docMethodOp(function(handle, where, cls) {
- return changeLine(this, handle, where == "gutter" ? "gutter" : "class", function (line) {
- var prop = where == "text" ? "textClass"
- : where == "background" ? "bgClass"
- : where == "gutter" ? "gutterClass" : "wrapClass"
- var cur = line[prop]
- if (!cur) { return false }
- else if (cls == null) { line[prop] = null }
- else {
- var found = cur.match(classTest(cls))
- if (!found) { return false }
- var end = found.index + found[0].length
- line[prop] = cur.slice(0, found.index) + (!found.index || end == cur.length ? "" : " ") + cur.slice(end) || null
- }
- return true
- })
- }),
-
- addLineWidget: docMethodOp(function(handle, node, options) {
- return addLineWidget(this, handle, node, options)
- }),
- removeLineWidget: function(widget) { widget.clear() },
-
- markText: function(from, to, options) {
- return markText(this, clipPos(this, from), clipPos(this, to), options, options && options.type || "range")
- },
- setBookmark: function(pos, options) {
- var realOpts = {replacedWith: options && (options.nodeType == null ? options.widget : options),
- insertLeft: options && options.insertLeft,
- clearWhenEmpty: false, shared: options && options.shared,
- handleMouseEvents: options && options.handleMouseEvents}
- pos = clipPos(this, pos)
- return markText(this, pos, pos, realOpts, "bookmark")
- },
- findMarksAt: function(pos) {
- pos = clipPos(this, pos)
- var markers = [], spans = getLine(this, pos.line).markedSpans
- if (spans) { for (var i = 0; i < spans.length; ++i) {
- var span = spans[i]
- if ((span.from == null || span.from <= pos.ch) &&
- (span.to == null || span.to >= pos.ch))
- { markers.push(span.marker.parent || span.marker) }
- } }
- return markers
- },
- findMarks: function(from, to, filter) {
- from = clipPos(this, from); to = clipPos(this, to)
- var found = [], lineNo = from.line
- this.iter(from.line, to.line + 1, function (line) {
- var spans = line.markedSpans
- if (spans) { for (var i = 0; i < spans.length; i++) {
- var span = spans[i]
- if (!(span.to != null && lineNo == from.line && from.ch >= span.to ||
- span.from == null && lineNo != from.line ||
- span.from != null && lineNo == to.line && span.from >= to.ch) &&
- (!filter || filter(span.marker)))
- { found.push(span.marker.parent || span.marker) }
- } }
- ++lineNo
- })
- return found
- },
- getAllMarks: function() {
- var markers = []
- this.iter(function (line) {
- var sps = line.markedSpans
- if (sps) { for (var i = 0; i < sps.length; ++i)
- { if (sps[i].from != null) { markers.push(sps[i].marker) } } }
- })
- return markers
- },
-
- posFromIndex: function(off) {
- var ch, lineNo = this.first, sepSize = this.lineSeparator().length
- this.iter(function (line) {
- var sz = line.text.length + sepSize
- if (sz > off) { ch = off; return true }
- off -= sz
- ++lineNo
- })
- return clipPos(this, Pos(lineNo, ch))
- },
- indexFromPos: function (coords) {
- coords = clipPos(this, coords)
- var index = coords.ch
- if (coords.line < this.first || coords.ch < 0) { return 0 }
- var sepSize = this.lineSeparator().length
- this.iter(this.first, coords.line, function (line) { // iter aborts when callback returns a truthy value
- index += line.text.length + sepSize
- })
- return index
- },
-
- copy: function(copyHistory) {
- var doc = new Doc(getLines(this, this.first, this.first + this.size),
- this.modeOption, this.first, this.lineSep)
- doc.scrollTop = this.scrollTop; doc.scrollLeft = this.scrollLeft
- doc.sel = this.sel
- doc.extend = false
- if (copyHistory) {
- doc.history.undoDepth = this.history.undoDepth
- doc.setHistory(this.getHistory())
- }
- return doc
- },
-
- linkedDoc: function(options) {
- if (!options) { options = {} }
- var from = this.first, to = this.first + this.size
- if (options.from != null && options.from > from) { from = options.from }
- if (options.to != null && options.to < to) { to = options.to }
- var copy = new Doc(getLines(this, from, to), options.mode || this.modeOption, from, this.lineSep)
- if (options.sharedHist) { copy.history = this.history
- ; }(this.linked || (this.linked = [])).push({doc: copy, sharedHist: options.sharedHist})
- copy.linked = [{doc: this, isParent: true, sharedHist: options.sharedHist}]
- copySharedMarkers(copy, findSharedMarkers(this))
- return copy
- },
- unlinkDoc: function(other) {
- var this$1 = this;
-
- if (other instanceof CodeMirror) { other = other.doc }
- if (this.linked) { for (var i = 0; i < this.linked.length; ++i) {
- var link = this$1.linked[i]
- if (link.doc != other) { continue }
- this$1.linked.splice(i, 1)
- other.unlinkDoc(this$1)
- detachSharedMarkers(findSharedMarkers(this$1))
- break
- } }
- // If the histories were shared, split them again
- if (other.history == this.history) {
- var splitIds = [other.id]
- linkedDocs(other, function (doc) { return splitIds.push(doc.id); }, true)
- other.history = new History(null)
- other.history.done = copyHistoryArray(this.history.done, splitIds)
- other.history.undone = copyHistoryArray(this.history.undone, splitIds)
- }
- },
- iterLinkedDocs: function(f) {linkedDocs(this, f)},
-
- getMode: function() {return this.mode},
- getEditor: function() {return this.cm},
-
- splitLines: function(str) {
- if (this.lineSep) { return str.split(this.lineSep) }
- return splitLinesAuto(str)
- },
- lineSeparator: function() { return this.lineSep || "\n" }
-})
-
-// Public alias.
-Doc.prototype.eachLine = Doc.prototype.iter
-
-// Kludge to work around strange IE behavior where it'll sometimes
-// re-fire a series of drag-related events right after the drop (#1551)
-var lastDrop = 0
-
-function onDrop(e) {
- var cm = this
- clearDragCursor(cm)
- if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e))
- { return }
- e_preventDefault(e)
- if (ie) { lastDrop = +new Date }
- var pos = posFromMouse(cm, e, true), files = e.dataTransfer.files
- if (!pos || cm.isReadOnly()) { return }
- // Might be a file drop, in which case we simply extract the text
- // and insert it.
- if (files && files.length && window.FileReader && window.File) {
- var n = files.length, text = Array(n), read = 0
- var loadFile = function (file, i) {
- if (cm.options.allowDropFileTypes &&
- indexOf(cm.options.allowDropFileTypes, file.type) == -1)
- { return }
-
- var reader = new FileReader
- reader.onload = operation(cm, function () {
- var content = reader.result
- if (/[\x00-\x08\x0e-\x1f]{2}/.test(content)) { content = "" }
- text[i] = content
- if (++read == n) {
- pos = clipPos(cm.doc, pos)
- var change = {from: pos, to: pos,
- text: cm.doc.splitLines(text.join(cm.doc.lineSeparator())),
- origin: "paste"}
- makeChange(cm.doc, change)
- setSelectionReplaceHistory(cm.doc, simpleSelection(pos, changeEnd(change)))
- }
- })
- reader.readAsText(file)
- }
- for (var i = 0; i < n; ++i) { loadFile(files[i], i) }
- } else { // Normal drop
- // Don't do a replace if the drop happened inside of the selected text.
- if (cm.state.draggingText && cm.doc.sel.contains(pos) > -1) {
- cm.state.draggingText(e)
- // Ensure the editor is re-focused
- setTimeout(function () { return cm.display.input.focus(); }, 20)
- return
- }
- try {
- var text$1 = e.dataTransfer.getData("Text")
- if (text$1) {
- var selected
- if (cm.state.draggingText && !cm.state.draggingText.copy)
- { selected = cm.listSelections() }
- setSelectionNoUndo(cm.doc, simpleSelection(pos, pos))
- if (selected) { for (var i$1 = 0; i$1 < selected.length; ++i$1)
- { replaceRange(cm.doc, "", selected[i$1].anchor, selected[i$1].head, "drag") } }
- cm.replaceSelection(text$1, "around", "paste")
- cm.display.input.focus()
- }
- }
- catch(e){}
- }
-}
-
-function onDragStart(cm, e) {
- if (ie && (!cm.state.draggingText || +new Date - lastDrop < 100)) { e_stop(e); return }
- if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e)) { return }
-
- e.dataTransfer.setData("Text", cm.getSelection())
- e.dataTransfer.effectAllowed = "copyMove"
-
- // Use dummy image instead of default browsers image.
- // Recent Safari (~6.0.2) have a tendency to segfault when this happens, so we don't do it there.
- if (e.dataTransfer.setDragImage && !safari) {
- var img = elt("img", null, null, "position: fixed; left: 0; top: 0;")
- img.src = "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="
- if (presto) {
- img.width = img.height = 1
- cm.display.wrapper.appendChild(img)
- // Force a relayout, or Opera won't use our image for some obscure reason
- img._top = img.offsetTop
- }
- e.dataTransfer.setDragImage(img, 0, 0)
- if (presto) { img.parentNode.removeChild(img) }
- }
-}
-
-function onDragOver(cm, e) {
- var pos = posFromMouse(cm, e)
- if (!pos) { return }
- var frag = document.createDocumentFragment()
- drawSelectionCursor(cm, pos, frag)
- if (!cm.display.dragCursor) {
- cm.display.dragCursor = elt("div", null, "CodeMirror-cursors CodeMirror-dragcursors")
- cm.display.lineSpace.insertBefore(cm.display.dragCursor, cm.display.cursorDiv)
- }
- removeChildrenAndAdd(cm.display.dragCursor, frag)
-}
-
-function clearDragCursor(cm) {
- if (cm.display.dragCursor) {
- cm.display.lineSpace.removeChild(cm.display.dragCursor)
- cm.display.dragCursor = null
- }
-}
-
-// These must be handled carefully, because naively registering a
-// handler for each editor will cause the editors to never be
-// garbage collected.
-
-function forEachCodeMirror(f) {
- if (!document.body.getElementsByClassName) { return }
- var byClass = document.body.getElementsByClassName("CodeMirror")
- for (var i = 0; i < byClass.length; i++) {
- var cm = byClass[i].CodeMirror
- if (cm) { f(cm) }
- }
-}
-
-var globalsRegistered = false
-function ensureGlobalHandlers() {
- if (globalsRegistered) { return }
- registerGlobalHandlers()
- globalsRegistered = true
-}
-function registerGlobalHandlers() {
- // When the window resizes, we need to refresh active editors.
- var resizeTimer
- on(window, "resize", function () {
- if (resizeTimer == null) { resizeTimer = setTimeout(function () {
- resizeTimer = null
- forEachCodeMirror(onResize)
- }, 100) }
- })
- // When the window loses focus, we want to show the editor as blurred
- on(window, "blur", function () { return forEachCodeMirror(onBlur); })
-}
-// Called when the window resizes
-function onResize(cm) {
- var d = cm.display
- if (d.lastWrapHeight == d.wrapper.clientHeight && d.lastWrapWidth == d.wrapper.clientWidth)
- { return }
- // Might be a text scaling operation, clear size caches.
- d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null
- d.scrollbarsClipped = false
- cm.setSize()
-}
-
-var keyNames = {
- 3: "Enter", 8: "Backspace", 9: "Tab", 13: "Enter", 16: "Shift", 17: "Ctrl", 18: "Alt",
- 19: "Pause", 20: "CapsLock", 27: "Esc", 32: "Space", 33: "PageUp", 34: "PageDown", 35: "End",
- 36: "Home", 37: "Left", 38: "Up", 39: "Right", 40: "Down", 44: "PrintScrn", 45: "Insert",
- 46: "Delete", 59: ";", 61: "=", 91: "Mod", 92: "Mod", 93: "Mod",
- 106: "*", 107: "=", 109: "-", 110: ".", 111: "/", 127: "Delete",
- 173: "-", 186: ";", 187: "=", 188: ",", 189: "-", 190: ".", 191: "/", 192: "`", 219: "[", 220: "\\",
- 221: "]", 222: "'", 63232: "Up", 63233: "Down", 63234: "Left", 63235: "Right", 63272: "Delete",
- 63273: "Home", 63275: "End", 63276: "PageUp", 63277: "PageDown", 63302: "Insert"
-}
-
-// Number keys
-for (var i = 0; i < 10; i++) { keyNames[i + 48] = keyNames[i + 96] = String(i) }
-// Alphabetic keys
-for (var i$1 = 65; i$1 <= 90; i$1++) { keyNames[i$1] = String.fromCharCode(i$1) }
-// Function keys
-for (var i$2 = 1; i$2 <= 12; i$2++) { keyNames[i$2 + 111] = keyNames[i$2 + 63235] = "F" + i$2 }
-
-var keyMap = {}
-
-keyMap.basic = {
- "Left": "goCharLeft", "Right": "goCharRight", "Up": "goLineUp", "Down": "goLineDown",
- "End": "goLineEnd", "Home": "goLineStartSmart", "PageUp": "goPageUp", "PageDown": "goPageDown",
- "Delete": "delCharAfter", "Backspace": "delCharBefore", "Shift-Backspace": "delCharBefore",
- "Tab": "defaultTab", "Shift-Tab": "indentAuto",
- "Enter": "newlineAndIndent", "Insert": "toggleOverwrite",
- "Esc": "singleSelection"
-}
-// Note that the save and find-related commands aren't defined by
-// default. User code or addons can define them. Unknown commands
-// are simply ignored.
-keyMap.pcDefault = {
- "Ctrl-A": "selectAll", "Ctrl-D": "deleteLine", "Ctrl-Z": "undo", "Shift-Ctrl-Z": "redo", "Ctrl-Y": "redo",
- "Ctrl-Home": "goDocStart", "Ctrl-End": "goDocEnd", "Ctrl-Up": "goLineUp", "Ctrl-Down": "goLineDown",
- "Ctrl-Left": "goGroupLeft", "Ctrl-Right": "goGroupRight", "Alt-Left": "goLineStart", "Alt-Right": "goLineEnd",
- "Ctrl-Backspace": "delGroupBefore", "Ctrl-Delete": "delGroupAfter", "Ctrl-S": "save", "Ctrl-F": "find",
- "Ctrl-G": "findNext", "Shift-Ctrl-G": "findPrev", "Shift-Ctrl-F": "replace", "Shift-Ctrl-R": "replaceAll",
- "Ctrl-[": "indentLess", "Ctrl-]": "indentMore",
- "Ctrl-U": "undoSelection", "Shift-Ctrl-U": "redoSelection", "Alt-U": "redoSelection",
- fallthrough: "basic"
-}
-// Very basic readline/emacs-style bindings, which are standard on Mac.
-keyMap.emacsy = {
- "Ctrl-F": "goCharRight", "Ctrl-B": "goCharLeft", "Ctrl-P": "goLineUp", "Ctrl-N": "goLineDown",
- "Alt-F": "goWordRight", "Alt-B": "goWordLeft", "Ctrl-A": "goLineStart", "Ctrl-E": "goLineEnd",
- "Ctrl-V": "goPageDown", "Shift-Ctrl-V": "goPageUp", "Ctrl-D": "delCharAfter", "Ctrl-H": "delCharBefore",
- "Alt-D": "delWordAfter", "Alt-Backspace": "delWordBefore", "Ctrl-K": "killLine", "Ctrl-T": "transposeChars",
- "Ctrl-O": "openLine"
-}
-keyMap.macDefault = {
- "Cmd-A": "selectAll", "Cmd-D": "deleteLine", "Cmd-Z": "undo", "Shift-Cmd-Z": "redo", "Cmd-Y": "redo",
- "Cmd-Home": "goDocStart", "Cmd-Up": "goDocStart", "Cmd-End": "goDocEnd", "Cmd-Down": "goDocEnd", "Alt-Left": "goGroupLeft",
- "Alt-Right": "goGroupRight", "Cmd-Left": "goLineLeft", "Cmd-Right": "goLineRight", "Alt-Backspace": "delGroupBefore",
- "Ctrl-Alt-Backspace": "delGroupAfter", "Alt-Delete": "delGroupAfter", "Cmd-S": "save", "Cmd-F": "find",
- "Cmd-G": "findNext", "Shift-Cmd-G": "findPrev", "Cmd-Alt-F": "replace", "Shift-Cmd-Alt-F": "replaceAll",
- "Cmd-[": "indentLess", "Cmd-]": "indentMore", "Cmd-Backspace": "delWrappedLineLeft", "Cmd-Delete": "delWrappedLineRight",
- "Cmd-U": "undoSelection", "Shift-Cmd-U": "redoSelection", "Ctrl-Up": "goDocStart", "Ctrl-Down": "goDocEnd",
- fallthrough: ["basic", "emacsy"]
-}
-keyMap["default"] = mac ? keyMap.macDefault : keyMap.pcDefault
-
-// KEYMAP DISPATCH
-
-function normalizeKeyName(name) {
- var parts = name.split(/-(?!$)/)
- name = parts[parts.length - 1]
- var alt, ctrl, shift, cmd
- for (var i = 0; i < parts.length - 1; i++) {
- var mod = parts[i]
- if (/^(cmd|meta|m)$/i.test(mod)) { cmd = true }
- else if (/^a(lt)?$/i.test(mod)) { alt = true }
- else if (/^(c|ctrl|control)$/i.test(mod)) { ctrl = true }
- else if (/^s(hift)?$/i.test(mod)) { shift = true }
- else { throw new Error("Unrecognized modifier name: " + mod) }
- }
- if (alt) { name = "Alt-" + name }
- if (ctrl) { name = "Ctrl-" + name }
- if (cmd) { name = "Cmd-" + name }
- if (shift) { name = "Shift-" + name }
- return name
-}
-
-// This is a kludge to keep keymaps mostly working as raw objects
-// (backwards compatibility) while at the same time support features
-// like normalization and multi-stroke key bindings. It compiles a
-// new normalized keymap, and then updates the old object to reflect
-// this.
-function normalizeKeyMap(keymap) {
- var copy = {}
- for (var keyname in keymap) { if (keymap.hasOwnProperty(keyname)) {
- var value = keymap[keyname]
- if (/^(name|fallthrough|(de|at)tach)$/.test(keyname)) { continue }
- if (value == "...") { delete keymap[keyname]; continue }
-
- var keys = map(keyname.split(" "), normalizeKeyName)
- for (var i = 0; i < keys.length; i++) {
- var val = (void 0), name = (void 0)
- if (i == keys.length - 1) {
- name = keys.join(" ")
- val = value
- } else {
- name = keys.slice(0, i + 1).join(" ")
- val = "..."
- }
- var prev = copy[name]
- if (!prev) { copy[name] = val }
- else if (prev != val) { throw new Error("Inconsistent bindings for " + name) }
- }
- delete keymap[keyname]
- } }
- for (var prop in copy) { keymap[prop] = copy[prop] }
- return keymap
-}
-
-function lookupKey(key, map, handle, context) {
- map = getKeyMap(map)
- var found = map.call ? map.call(key, context) : map[key]
- if (found === false) { return "nothing" }
- if (found === "...") { return "multi" }
- if (found != null && handle(found)) { return "handled" }
-
- if (map.fallthrough) {
- if (Object.prototype.toString.call(map.fallthrough) != "[object Array]")
- { return lookupKey(key, map.fallthrough, handle, context) }
- for (var i = 0; i < map.fallthrough.length; i++) {
- var result = lookupKey(key, map.fallthrough[i], handle, context)
- if (result) { return result }
- }
- }
-}
-
-// Modifier key presses don't count as 'real' key presses for the
-// purpose of keymap fallthrough.
-function isModifierKey(value) {
- var name = typeof value == "string" ? value : keyNames[value.keyCode]
- return name == "Ctrl" || name == "Alt" || name == "Shift" || name == "Mod"
-}
-
-// Look up the name of a key as indicated by an event object.
-function keyName(event, noShift) {
- if (presto && event.keyCode == 34 && event["char"]) { return false }
- var base = keyNames[event.keyCode], name = base
- if (name == null || event.altGraphKey) { return false }
- if (event.altKey && base != "Alt") { name = "Alt-" + name }
- if ((flipCtrlCmd ? event.metaKey : event.ctrlKey) && base != "Ctrl") { name = "Ctrl-" + name }
- if ((flipCtrlCmd ? event.ctrlKey : event.metaKey) && base != "Cmd") { name = "Cmd-" + name }
- if (!noShift && event.shiftKey && base != "Shift") { name = "Shift-" + name }
- return name
-}
-
-function getKeyMap(val) {
- return typeof val == "string" ? keyMap[val] : val
-}
-
-// Helper for deleting text near the selection(s), used to implement
-// backspace, delete, and similar functionality.
-function deleteNearSelection(cm, compute) {
- var ranges = cm.doc.sel.ranges, kill = []
- // Build up a set of ranges to kill first, merging overlapping
- // ranges.
- for (var i = 0; i < ranges.length; i++) {
- var toKill = compute(ranges[i])
- while (kill.length && cmp(toKill.from, lst(kill).to) <= 0) {
- var replaced = kill.pop()
- if (cmp(replaced.from, toKill.from) < 0) {
- toKill.from = replaced.from
- break
- }
- }
- kill.push(toKill)
- }
- // Next, remove those actual ranges.
- runInOp(cm, function () {
- for (var i = kill.length - 1; i >= 0; i--)
- { replaceRange(cm.doc, "", kill[i].from, kill[i].to, "+delete") }
- ensureCursorVisible(cm)
- })
-}
-
-// Commands are parameter-less actions that can be performed on an
-// editor, mostly used for keybindings.
-var commands = {
- selectAll: selectAll,
- singleSelection: function (cm) { return cm.setSelection(cm.getCursor("anchor"), cm.getCursor("head"), sel_dontScroll); },
- killLine: function (cm) { return deleteNearSelection(cm, function (range) {
- if (range.empty()) {
- var len = getLine(cm.doc, range.head.line).text.length
- if (range.head.ch == len && range.head.line < cm.lastLine())
- { return {from: range.head, to: Pos(range.head.line + 1, 0)} }
- else
- { return {from: range.head, to: Pos(range.head.line, len)} }
- } else {
- return {from: range.from(), to: range.to()}
- }
- }); },
- deleteLine: function (cm) { return deleteNearSelection(cm, function (range) { return ({
- from: Pos(range.from().line, 0),
- to: clipPos(cm.doc, Pos(range.to().line + 1, 0))
- }); }); },
- delLineLeft: function (cm) { return deleteNearSelection(cm, function (range) { return ({
- from: Pos(range.from().line, 0), to: range.from()
- }); }); },
- delWrappedLineLeft: function (cm) { return deleteNearSelection(cm, function (range) {
- var top = cm.charCoords(range.head, "div").top + 5
- var leftPos = cm.coordsChar({left: 0, top: top}, "div")
- return {from: leftPos, to: range.from()}
- }); },
- delWrappedLineRight: function (cm) { return deleteNearSelection(cm, function (range) {
- var top = cm.charCoords(range.head, "div").top + 5
- var rightPos = cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, "div")
- return {from: range.from(), to: rightPos }
- }); },
- undo: function (cm) { return cm.undo(); },
- redo: function (cm) { return cm.redo(); },
- undoSelection: function (cm) { return cm.undoSelection(); },
- redoSelection: function (cm) { return cm.redoSelection(); },
- goDocStart: function (cm) { return cm.extendSelection(Pos(cm.firstLine(), 0)); },
- goDocEnd: function (cm) { return cm.extendSelection(Pos(cm.lastLine())); },
- goLineStart: function (cm) { return cm.extendSelectionsBy(function (range) { return lineStart(cm, range.head.line); },
- {origin: "+move", bias: 1}
- ); },
- goLineStartSmart: function (cm) { return cm.extendSelectionsBy(function (range) { return lineStartSmart(cm, range.head); },
- {origin: "+move", bias: 1}
- ); },
- goLineEnd: function (cm) { return cm.extendSelectionsBy(function (range) { return lineEnd(cm, range.head.line); },
- {origin: "+move", bias: -1}
- ); },
- goLineRight: function (cm) { return cm.extendSelectionsBy(function (range) {
- var top = cm.charCoords(range.head, "div").top + 5
- return cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, "div")
- }, sel_move); },
- goLineLeft: function (cm) { return cm.extendSelectionsBy(function (range) {
- var top = cm.charCoords(range.head, "div").top + 5
- return cm.coordsChar({left: 0, top: top}, "div")
- }, sel_move); },
- goLineLeftSmart: function (cm) { return cm.extendSelectionsBy(function (range) {
- var top = cm.charCoords(range.head, "div").top + 5
- var pos = cm.coordsChar({left: 0, top: top}, "div")
- if (pos.ch < cm.getLine(pos.line).search(/\S/)) { return lineStartSmart(cm, range.head) }
- return pos
- }, sel_move); },
- goLineUp: function (cm) { return cm.moveV(-1, "line"); },
- goLineDown: function (cm) { return cm.moveV(1, "line"); },
- goPageUp: function (cm) { return cm.moveV(-1, "page"); },
- goPageDown: function (cm) { return cm.moveV(1, "page"); },
- goCharLeft: function (cm) { return cm.moveH(-1, "char"); },
- goCharRight: function (cm) { return cm.moveH(1, "char"); },
- goColumnLeft: function (cm) { return cm.moveH(-1, "column"); },
- goColumnRight: function (cm) { return cm.moveH(1, "column"); },
- goWordLeft: function (cm) { return cm.moveH(-1, "word"); },
- goGroupRight: function (cm) { return cm.moveH(1, "group"); },
- goGroupLeft: function (cm) { return cm.moveH(-1, "group"); },
- goWordRight: function (cm) { return cm.moveH(1, "word"); },
- delCharBefore: function (cm) { return cm.deleteH(-1, "char"); },
- delCharAfter: function (cm) { return cm.deleteH(1, "char"); },
- delWordBefore: function (cm) { return cm.deleteH(-1, "word"); },
- delWordAfter: function (cm) { return cm.deleteH(1, "word"); },
- delGroupBefore: function (cm) { return cm.deleteH(-1, "group"); },
- delGroupAfter: function (cm) { return cm.deleteH(1, "group"); },
- indentAuto: function (cm) { return cm.indentSelection("smart"); },
- indentMore: function (cm) { return cm.indentSelection("add"); },
- indentLess: function (cm) { return cm.indentSelection("subtract"); },
- insertTab: function (cm) { return cm.replaceSelection("\t"); },
- insertSoftTab: function (cm) {
- var spaces = [], ranges = cm.listSelections(), tabSize = cm.options.tabSize
- for (var i = 0; i < ranges.length; i++) {
- var pos = ranges[i].from()
- var col = countColumn(cm.getLine(pos.line), pos.ch, tabSize)
- spaces.push(spaceStr(tabSize - col % tabSize))
- }
- cm.replaceSelections(spaces)
- },
- defaultTab: function (cm) {
- if (cm.somethingSelected()) { cm.indentSelection("add") }
- else { cm.execCommand("insertTab") }
- },
- // Swap the two chars left and right of each selection's head.
- // Move cursor behind the two swapped characters afterwards.
- //
- // Doesn't consider line feeds a character.
- // Doesn't scan more than one line above to find a character.
- // Doesn't do anything on an empty line.
- // Doesn't do anything with non-empty selections.
- transposeChars: function (cm) { return runInOp(cm, function () {
- var ranges = cm.listSelections(), newSel = []
- for (var i = 0; i < ranges.length; i++) {
- if (!ranges[i].empty()) { continue }
- var cur = ranges[i].head, line = getLine(cm.doc, cur.line).text
- if (line) {
- if (cur.ch == line.length) { cur = new Pos(cur.line, cur.ch - 1) }
- if (cur.ch > 0) {
- cur = new Pos(cur.line, cur.ch + 1)
- cm.replaceRange(line.charAt(cur.ch - 1) + line.charAt(cur.ch - 2),
- Pos(cur.line, cur.ch - 2), cur, "+transpose")
- } else if (cur.line > cm.doc.first) {
- var prev = getLine(cm.doc, cur.line - 1).text
- if (prev) {
- cur = new Pos(cur.line, 1)
- cm.replaceRange(line.charAt(0) + cm.doc.lineSeparator() +
- prev.charAt(prev.length - 1),
- Pos(cur.line - 1, prev.length - 1), cur, "+transpose")
- }
- }
- }
- newSel.push(new Range(cur, cur))
- }
- cm.setSelections(newSel)
- }); },
- newlineAndIndent: function (cm) { return runInOp(cm, function () {
- var sels = cm.listSelections()
- for (var i = sels.length - 1; i >= 0; i--)
- { cm.replaceRange(cm.doc.lineSeparator(), sels[i].anchor, sels[i].head, "+input") }
- sels = cm.listSelections()
- for (var i$1 = 0; i$1 < sels.length; i$1++)
- { cm.indentLine(sels[i$1].from().line, null, true) }
- ensureCursorVisible(cm)
- }); },
- openLine: function (cm) { return cm.replaceSelection("\n", "start"); },
- toggleOverwrite: function (cm) { return cm.toggleOverwrite(); }
-}
-
-
-function lineStart(cm, lineN) {
- var line = getLine(cm.doc, lineN)
- var visual = visualLine(line)
- if (visual != line) { lineN = lineNo(visual) }
- return endOfLine(true, cm, visual, lineN, 1)
-}
-function lineEnd(cm, lineN) {
- var line = getLine(cm.doc, lineN)
- var visual = visualLineEnd(line)
- if (visual != line) { lineN = lineNo(visual) }
- return endOfLine(true, cm, line, lineN, -1)
-}
-function lineStartSmart(cm, pos) {
- var start = lineStart(cm, pos.line)
- var line = getLine(cm.doc, start.line)
- var order = getOrder(line)
- if (!order || order[0].level == 0) {
- var firstNonWS = Math.max(0, line.text.search(/\S/))
- var inWS = pos.line == start.line && pos.ch <= firstNonWS && pos.ch
- return Pos(start.line, inWS ? 0 : firstNonWS, start.sticky)
- }
- return start
-}
-
-// Run a handler that was bound to a key.
-function doHandleBinding(cm, bound, dropShift) {
- if (typeof bound == "string") {
- bound = commands[bound]
- if (!bound) { return false }
- }
- // Ensure previous input has been read, so that the handler sees a
- // consistent view of the document
- cm.display.input.ensurePolled()
- var prevShift = cm.display.shift, done = false
- try {
- if (cm.isReadOnly()) { cm.state.suppressEdits = true }
- if (dropShift) { cm.display.shift = false }
- done = bound(cm) != Pass
- } finally {
- cm.display.shift = prevShift
- cm.state.suppressEdits = false
- }
- return done
-}
-
-function lookupKeyForEditor(cm, name, handle) {
- for (var i = 0; i < cm.state.keyMaps.length; i++) {
- var result = lookupKey(name, cm.state.keyMaps[i], handle, cm)
- if (result) { return result }
- }
- return (cm.options.extraKeys && lookupKey(name, cm.options.extraKeys, handle, cm))
- || lookupKey(name, cm.options.keyMap, handle, cm)
-}
-
-var stopSeq = new Delayed
-function dispatchKey(cm, name, e, handle) {
- var seq = cm.state.keySeq
- if (seq) {
- if (isModifierKey(name)) { return "handled" }
- stopSeq.set(50, function () {
- if (cm.state.keySeq == seq) {
- cm.state.keySeq = null
- cm.display.input.reset()
- }
- })
- name = seq + " " + name
- }
- var result = lookupKeyForEditor(cm, name, handle)
-
- if (result == "multi")
- { cm.state.keySeq = name }
- if (result == "handled")
- { signalLater(cm, "keyHandled", cm, name, e) }
-
- if (result == "handled" || result == "multi") {
- e_preventDefault(e)
- restartBlink(cm)
- }
-
- if (seq && !result && /\'$/.test(name)) {
- e_preventDefault(e)
- return true
- }
- return !!result
-}
-
-// Handle a key from the keydown event.
-function handleKeyBinding(cm, e) {
- var name = keyName(e, true)
- if (!name) { return false }
-
- if (e.shiftKey && !cm.state.keySeq) {
- // First try to resolve full name (including 'Shift-'). Failing
- // that, see if there is a cursor-motion command (starting with
- // 'go') bound to the keyname without 'Shift-'.
- return dispatchKey(cm, "Shift-" + name, e, function (b) { return doHandleBinding(cm, b, true); })
- || dispatchKey(cm, name, e, function (b) {
- if (typeof b == "string" ? /^go[A-Z]/.test(b) : b.motion)
- { return doHandleBinding(cm, b) }
- })
- } else {
- return dispatchKey(cm, name, e, function (b) { return doHandleBinding(cm, b); })
- }
-}
-
-// Handle a key from the keypress event
-function handleCharBinding(cm, e, ch) {
- return dispatchKey(cm, "'" + ch + "'", e, function (b) { return doHandleBinding(cm, b, true); })
-}
-
-var lastStoppedKey = null
-function onKeyDown(e) {
- var cm = this
- cm.curOp.focus = activeElt()
- if (signalDOMEvent(cm, e)) { return }
- // IE does strange things with escape.
- if (ie && ie_version < 11 && e.keyCode == 27) { e.returnValue = false }
- var code = e.keyCode
- cm.display.shift = code == 16 || e.shiftKey
- var handled = handleKeyBinding(cm, e)
- if (presto) {
- lastStoppedKey = handled ? code : null
- // Opera has no cut event... we try to at least catch the key combo
- if (!handled && code == 88 && !hasCopyEvent && (mac ? e.metaKey : e.ctrlKey))
- { cm.replaceSelection("", null, "cut") }
- }
-
- // Turn mouse into crosshair when Alt is held on Mac.
- if (code == 18 && !/\bCodeMirror-crosshair\b/.test(cm.display.lineDiv.className))
- { showCrossHair(cm) }
-}
-
-function showCrossHair(cm) {
- var lineDiv = cm.display.lineDiv
- addClass(lineDiv, "CodeMirror-crosshair")
-
- function up(e) {
- if (e.keyCode == 18 || !e.altKey) {
- rmClass(lineDiv, "CodeMirror-crosshair")
- off(document, "keyup", up)
- off(document, "mouseover", up)
- }
- }
- on(document, "keyup", up)
- on(document, "mouseover", up)
-}
-
-function onKeyUp(e) {
- if (e.keyCode == 16) { this.doc.sel.shift = false }
- signalDOMEvent(this, e)
-}
-
-function onKeyPress(e) {
- var cm = this
- if (eventInWidget(cm.display, e) || signalDOMEvent(cm, e) || e.ctrlKey && !e.altKey || mac && e.metaKey) { return }
- var keyCode = e.keyCode, charCode = e.charCode
- if (presto && keyCode == lastStoppedKey) {lastStoppedKey = null; e_preventDefault(e); return}
- if ((presto && (!e.which || e.which < 10)) && handleKeyBinding(cm, e)) { return }
- var ch = String.fromCharCode(charCode == null ? keyCode : charCode)
- // Some browsers fire keypress events for backspace
- if (ch == "\x08") { return }
- if (handleCharBinding(cm, e, ch)) { return }
- cm.display.input.onKeyPress(e)
-}
-
-// A mouse down can be a single click, double click, triple click,
-// start of selection drag, start of text drag, new cursor
-// (ctrl-click), rectangle drag (alt-drag), or xwin
-// middle-click-paste. Or it might be a click on something we should
-// not interfere with, such as a scrollbar or widget.
-function onMouseDown(e) {
- var cm = this, display = cm.display
- if (signalDOMEvent(cm, e) || display.activeTouch && display.input.supportsTouch()) { return }
- display.input.ensurePolled()
- display.shift = e.shiftKey
-
- if (eventInWidget(display, e)) {
- if (!webkit) {
- // Briefly turn off draggability, to allow widgets to do
- // normal dragging things.
- display.scroller.draggable = false
- setTimeout(function () { return display.scroller.draggable = true; }, 100)
- }
- return
- }
- if (clickInGutter(cm, e)) { return }
- var start = posFromMouse(cm, e)
- window.focus()
-
- switch (e_button(e)) {
- case 1:
- // #3261: make sure, that we're not starting a second selection
- if (cm.state.selectingText)
- { cm.state.selectingText(e) }
- else if (start)
- { leftButtonDown(cm, e, start) }
- else if (e_target(e) == display.scroller)
- { e_preventDefault(e) }
- break
- case 2:
- if (webkit) { cm.state.lastMiddleDown = +new Date }
- if (start) { extendSelection(cm.doc, start) }
- setTimeout(function () { return display.input.focus(); }, 20)
- e_preventDefault(e)
- break
- case 3:
- if (captureRightClick) { onContextMenu(cm, e) }
- else { delayBlurEvent(cm) }
- break
- }
-}
-
-var lastClick;
-var lastDoubleClick;
-function leftButtonDown(cm, e, start) {
- if (ie) { setTimeout(bind(ensureFocus, cm), 0) }
- else { cm.curOp.focus = activeElt() }
-
- var now = +new Date, type
- if (lastDoubleClick && lastDoubleClick.time > now - 400 && cmp(lastDoubleClick.pos, start) == 0) {
- type = "triple"
- } else if (lastClick && lastClick.time > now - 400 && cmp(lastClick.pos, start) == 0) {
- type = "double"
- lastDoubleClick = {time: now, pos: start}
- } else {
- type = "single"
- lastClick = {time: now, pos: start}
- }
-
- var sel = cm.doc.sel, modifier = mac ? e.metaKey : e.ctrlKey, contained
- if (cm.options.dragDrop && dragAndDrop && !cm.isReadOnly() &&
- type == "single" && (contained = sel.contains(start)) > -1 &&
- (cmp((contained = sel.ranges[contained]).from(), start) < 0 || start.xRel > 0) &&
- (cmp(contained.to(), start) > 0 || start.xRel < 0))
- { leftButtonStartDrag(cm, e, start, modifier) }
- else
- { leftButtonSelect(cm, e, start, type, modifier) }
-}
-
-// Start a text drag. When it ends, see if any dragging actually
-// happen, and treat as a click if it didn't.
-function leftButtonStartDrag(cm, e, start, modifier) {
- var display = cm.display, startTime = +new Date
- var dragEnd = operation(cm, function (e2) {
- if (webkit) { display.scroller.draggable = false }
- cm.state.draggingText = false
- off(document, "mouseup", dragEnd)
- off(display.scroller, "drop", dragEnd)
- if (Math.abs(e.clientX - e2.clientX) + Math.abs(e.clientY - e2.clientY) < 10) {
- e_preventDefault(e2)
- if (!modifier && +new Date - 200 < startTime)
- { extendSelection(cm.doc, start) }
- // Work around unexplainable focus problem in IE9 (#2127) and Chrome (#3081)
- if (webkit || ie && ie_version == 9)
- { setTimeout(function () {document.body.focus(); display.input.focus()}, 20) }
- else
- { display.input.focus() }
- }
- })
- // Let the drag handler handle this.
- if (webkit) { display.scroller.draggable = true }
- cm.state.draggingText = dragEnd
- dragEnd.copy = mac ? e.altKey : e.ctrlKey
- // IE's approach to draggable
- if (display.scroller.dragDrop) { display.scroller.dragDrop() }
- on(document, "mouseup", dragEnd)
- on(display.scroller, "drop", dragEnd)
-}
-
-// Normal selection, as opposed to text dragging.
-function leftButtonSelect(cm, e, start, type, addNew) {
- var display = cm.display, doc = cm.doc
- e_preventDefault(e)
-
- var ourRange, ourIndex, startSel = doc.sel, ranges = startSel.ranges
- if (addNew && !e.shiftKey) {
- ourIndex = doc.sel.contains(start)
- if (ourIndex > -1)
- { ourRange = ranges[ourIndex] }
- else
- { ourRange = new Range(start, start) }
- } else {
- ourRange = doc.sel.primary()
- ourIndex = doc.sel.primIndex
- }
-
- if (chromeOS ? e.shiftKey && e.metaKey : e.altKey) {
- type = "rect"
- if (!addNew) { ourRange = new Range(start, start) }
- start = posFromMouse(cm, e, true, true)
- ourIndex = -1
- } else if (type == "double") {
- var word = cm.findWordAt(start)
- if (cm.display.shift || doc.extend)
- { ourRange = extendRange(doc, ourRange, word.anchor, word.head) }
- else
- { ourRange = word }
- } else if (type == "triple") {
- var line = new Range(Pos(start.line, 0), clipPos(doc, Pos(start.line + 1, 0)))
- if (cm.display.shift || doc.extend)
- { ourRange = extendRange(doc, ourRange, line.anchor, line.head) }
- else
- { ourRange = line }
- } else {
- ourRange = extendRange(doc, ourRange, start)
- }
-
- if (!addNew) {
- ourIndex = 0
- setSelection(doc, new Selection([ourRange], 0), sel_mouse)
- startSel = doc.sel
- } else if (ourIndex == -1) {
- ourIndex = ranges.length
- setSelection(doc, normalizeSelection(ranges.concat([ourRange]), ourIndex),
- {scroll: false, origin: "*mouse"})
- } else if (ranges.length > 1 && ranges[ourIndex].empty() && type == "single" && !e.shiftKey) {
- setSelection(doc, normalizeSelection(ranges.slice(0, ourIndex).concat(ranges.slice(ourIndex + 1)), 0),
- {scroll: false, origin: "*mouse"})
- startSel = doc.sel
- } else {
- replaceOneSelection(doc, ourIndex, ourRange, sel_mouse)
- }
-
- var lastPos = start
- function extendTo(pos) {
- if (cmp(lastPos, pos) == 0) { return }
- lastPos = pos
-
- if (type == "rect") {
- var ranges = [], tabSize = cm.options.tabSize
- var startCol = countColumn(getLine(doc, start.line).text, start.ch, tabSize)
- var posCol = countColumn(getLine(doc, pos.line).text, pos.ch, tabSize)
- var left = Math.min(startCol, posCol), right = Math.max(startCol, posCol)
- for (var line = Math.min(start.line, pos.line), end = Math.min(cm.lastLine(), Math.max(start.line, pos.line));
- line <= end; line++) {
- var text = getLine(doc, line).text, leftPos = findColumn(text, left, tabSize)
- if (left == right)
- { ranges.push(new Range(Pos(line, leftPos), Pos(line, leftPos))) }
- else if (text.length > leftPos)
- { ranges.push(new Range(Pos(line, leftPos), Pos(line, findColumn(text, right, tabSize)))) }
- }
- if (!ranges.length) { ranges.push(new Range(start, start)) }
- setSelection(doc, normalizeSelection(startSel.ranges.slice(0, ourIndex).concat(ranges), ourIndex),
- {origin: "*mouse", scroll: false})
- cm.scrollIntoView(pos)
- } else {
- var oldRange = ourRange
- var anchor = oldRange.anchor, head = pos
- if (type != "single") {
- var range
- if (type == "double")
- { range = cm.findWordAt(pos) }
- else
- { range = new Range(Pos(pos.line, 0), clipPos(doc, Pos(pos.line + 1, 0))) }
- if (cmp(range.anchor, anchor) > 0) {
- head = range.head
- anchor = minPos(oldRange.from(), range.anchor)
- } else {
- head = range.anchor
- anchor = maxPos(oldRange.to(), range.head)
- }
- }
- var ranges$1 = startSel.ranges.slice(0)
- ranges$1[ourIndex] = new Range(clipPos(doc, anchor), head)
- setSelection(doc, normalizeSelection(ranges$1, ourIndex), sel_mouse)
- }
- }
-
- var editorSize = display.wrapper.getBoundingClientRect()
- // Used to ensure timeout re-tries don't fire when another extend
- // happened in the meantime (clearTimeout isn't reliable -- at
- // least on Chrome, the timeouts still happen even when cleared,
- // if the clear happens after their scheduled firing time).
- var counter = 0
-
- function extend(e) {
- var curCount = ++counter
- var cur = posFromMouse(cm, e, true, type == "rect")
- if (!cur) { return }
- if (cmp(cur, lastPos) != 0) {
- cm.curOp.focus = activeElt()
- extendTo(cur)
- var visible = visibleLines(display, doc)
- if (cur.line >= visible.to || cur.line < visible.from)
- { setTimeout(operation(cm, function () {if (counter == curCount) { extend(e) }}), 150) }
- } else {
- var outside = e.clientY < editorSize.top ? -20 : e.clientY > editorSize.bottom ? 20 : 0
- if (outside) { setTimeout(operation(cm, function () {
- if (counter != curCount) { return }
- display.scroller.scrollTop += outside
- extend(e)
- }), 50) }
- }
- }
-
- function done(e) {
- cm.state.selectingText = false
- counter = Infinity
- e_preventDefault(e)
- display.input.focus()
- off(document, "mousemove", move)
- off(document, "mouseup", up)
- doc.history.lastSelOrigin = null
- }
-
- var move = operation(cm, function (e) {
- if (!e_button(e)) { done(e) }
- else { extend(e) }
- })
- var up = operation(cm, done)
- cm.state.selectingText = up
- on(document, "mousemove", move)
- on(document, "mouseup", up)
-}
-
-
-// Determines whether an event happened in the gutter, and fires the
-// handlers for the corresponding event.
-function gutterEvent(cm, e, type, prevent) {
- var mX, mY
- try { mX = e.clientX; mY = e.clientY }
- catch(e) { return false }
- if (mX >= Math.floor(cm.display.gutters.getBoundingClientRect().right)) { return false }
- if (prevent) { e_preventDefault(e) }
-
- var display = cm.display
- var lineBox = display.lineDiv.getBoundingClientRect()
-
- if (mY > lineBox.bottom || !hasHandler(cm, type)) { return e_defaultPrevented(e) }
- mY -= lineBox.top - display.viewOffset
-
- for (var i = 0; i < cm.options.gutters.length; ++i) {
- var g = display.gutters.childNodes[i]
- if (g && g.getBoundingClientRect().right >= mX) {
- var line = lineAtHeight(cm.doc, mY)
- var gutter = cm.options.gutters[i]
- signal(cm, type, cm, line, gutter, e)
- return e_defaultPrevented(e)
- }
- }
-}
-
-function clickInGutter(cm, e) {
- return gutterEvent(cm, e, "gutterClick", true)
-}
-
-// CONTEXT MENU HANDLING
-
-// To make the context menu work, we need to briefly unhide the
-// textarea (making it as unobtrusive as possible) to let the
-// right-click take effect on it.
-function onContextMenu(cm, e) {
- if (eventInWidget(cm.display, e) || contextMenuInGutter(cm, e)) { return }
- if (signalDOMEvent(cm, e, "contextmenu")) { return }
- cm.display.input.onContextMenu(e)
-}
-
-function contextMenuInGutter(cm, e) {
- if (!hasHandler(cm, "gutterContextMenu")) { return false }
- return gutterEvent(cm, e, "gutterContextMenu", false)
-}
-
-function themeChanged(cm) {
- cm.display.wrapper.className = cm.display.wrapper.className.replace(/\s*cm-s-\S+/g, "") +
- cm.options.theme.replace(/(^|\s)\s*/g, " cm-s-")
- clearCaches(cm)
-}
-
-var Init = {toString: function(){return "CodeMirror.Init"}}
-
-var defaults = {}
-var optionHandlers = {}
-
-function defineOptions(CodeMirror) {
- var optionHandlers = CodeMirror.optionHandlers
-
- function option(name, deflt, handle, notOnInit) {
- CodeMirror.defaults[name] = deflt
- if (handle) { optionHandlers[name] =
- notOnInit ? function (cm, val, old) {if (old != Init) { handle(cm, val, old) }} : handle }
- }
-
- CodeMirror.defineOption = option
-
- // Passed to option handlers when there is no old value.
- CodeMirror.Init = Init
-
- // These two are, on init, called from the constructor because they
- // have to be initialized before the editor can start at all.
- option("value", "", function (cm, val) { return cm.setValue(val); }, true)
- option("mode", null, function (cm, val) {
- cm.doc.modeOption = val
- loadMode(cm)
- }, true)
-
- option("indentUnit", 2, loadMode, true)
- option("indentWithTabs", false)
- option("smartIndent", true)
- option("tabSize", 4, function (cm) {
- resetModeState(cm)
- clearCaches(cm)
- regChange(cm)
- }, true)
- option("lineSeparator", null, function (cm, val) {
- cm.doc.lineSep = val
- if (!val) { return }
- var newBreaks = [], lineNo = cm.doc.first
- cm.doc.iter(function (line) {
- for (var pos = 0;;) {
- var found = line.text.indexOf(val, pos)
- if (found == -1) { break }
- pos = found + val.length
- newBreaks.push(Pos(lineNo, found))
- }
- lineNo++
- })
- for (var i = newBreaks.length - 1; i >= 0; i--)
- { replaceRange(cm.doc, val, newBreaks[i], Pos(newBreaks[i].line, newBreaks[i].ch + val.length)) }
- })
- option("specialChars", /[\u0000-\u001f\u007f\u00ad\u061c\u200b-\u200f\u2028\u2029\ufeff]/g, function (cm, val, old) {
- cm.state.specialChars = new RegExp(val.source + (val.test("\t") ? "" : "|\t"), "g")
- if (old != Init) { cm.refresh() }
- })
- option("specialCharPlaceholder", defaultSpecialCharPlaceholder, function (cm) { return cm.refresh(); }, true)
- option("electricChars", true)
- option("inputStyle", mobile ? "contenteditable" : "textarea", function () {
- throw new Error("inputStyle can not (yet) be changed in a running editor") // FIXME
- }, true)
- option("spellcheck", false, function (cm, val) { return cm.getInputField().spellcheck = val; }, true)
- option("rtlMoveVisually", !windows)
- option("wholeLineUpdateBefore", true)
-
- option("theme", "default", function (cm) {
- themeChanged(cm)
- guttersChanged(cm)
- }, true)
- option("keyMap", "default", function (cm, val, old) {
- var next = getKeyMap(val)
- var prev = old != Init && getKeyMap(old)
- if (prev && prev.detach) { prev.detach(cm, next) }
- if (next.attach) { next.attach(cm, prev || null) }
- })
- option("extraKeys", null)
-
- option("lineWrapping", false, wrappingChanged, true)
- option("gutters", [], function (cm) {
- setGuttersForLineNumbers(cm.options)
- guttersChanged(cm)
- }, true)
- option("fixedGutter", true, function (cm, val) {
- cm.display.gutters.style.left = val ? compensateForHScroll(cm.display) + "px" : "0"
- cm.refresh()
- }, true)
- option("coverGutterNextToScrollbar", false, function (cm) { return updateScrollbars(cm); }, true)
- option("scrollbarStyle", "native", function (cm) {
- initScrollbars(cm)
- updateScrollbars(cm)
- cm.display.scrollbars.setScrollTop(cm.doc.scrollTop)
- cm.display.scrollbars.setScrollLeft(cm.doc.scrollLeft)
- }, true)
- option("lineNumbers", false, function (cm) {
- setGuttersForLineNumbers(cm.options)
- guttersChanged(cm)
- }, true)
- option("firstLineNumber", 1, guttersChanged, true)
- option("lineNumberFormatter", function (integer) { return integer; }, guttersChanged, true)
- option("showCursorWhenSelecting", false, updateSelection, true)
-
- option("resetSelectionOnContextMenu", true)
- option("lineWiseCopyCut", true)
-
- option("readOnly", false, function (cm, val) {
- if (val == "nocursor") {
- onBlur(cm)
- cm.display.input.blur()
- cm.display.disabled = true
- } else {
- cm.display.disabled = false
- }
- cm.display.input.readOnlyChanged(val)
- })
- option("disableInput", false, function (cm, val) {if (!val) { cm.display.input.reset() }}, true)
- option("dragDrop", true, dragDropChanged)
- option("allowDropFileTypes", null)
-
- option("cursorBlinkRate", 530)
- option("cursorScrollMargin", 0)
- option("cursorHeight", 1, updateSelection, true)
- option("singleCursorHeightPerLine", true, updateSelection, true)
- option("workTime", 100)
- option("workDelay", 100)
- option("flattenSpans", true, resetModeState, true)
- option("addModeClass", false, resetModeState, true)
- option("pollInterval", 100)
- option("undoDepth", 200, function (cm, val) { return cm.doc.history.undoDepth = val; })
- option("historyEventDelay", 1250)
- option("viewportMargin", 10, function (cm) { return cm.refresh(); }, true)
- option("maxHighlightLength", 10000, resetModeState, true)
- option("moveInputWithCursor", true, function (cm, val) {
- if (!val) { cm.display.input.resetPosition() }
- })
-
- option("tabindex", null, function (cm, val) { return cm.display.input.getField().tabIndex = val || ""; })
- option("autofocus", null)
-}
-
-function guttersChanged(cm) {
- updateGutters(cm)
- regChange(cm)
- alignHorizontally(cm)
-}
-
-function dragDropChanged(cm, value, old) {
- var wasOn = old && old != Init
- if (!value != !wasOn) {
- var funcs = cm.display.dragFunctions
- var toggle = value ? on : off
- toggle(cm.display.scroller, "dragstart", funcs.start)
- toggle(cm.display.scroller, "dragenter", funcs.enter)
- toggle(cm.display.scroller, "dragover", funcs.over)
- toggle(cm.display.scroller, "dragleave", funcs.leave)
- toggle(cm.display.scroller, "drop", funcs.drop)
- }
-}
-
-function wrappingChanged(cm) {
- if (cm.options.lineWrapping) {
- addClass(cm.display.wrapper, "CodeMirror-wrap")
- cm.display.sizer.style.minWidth = ""
- cm.display.sizerWidth = null
- } else {
- rmClass(cm.display.wrapper, "CodeMirror-wrap")
- findMaxLine(cm)
- }
- estimateLineHeights(cm)
- regChange(cm)
- clearCaches(cm)
- setTimeout(function () { return updateScrollbars(cm); }, 100)
-}
-
-// A CodeMirror instance represents an editor. This is the object
-// that user code is usually dealing with.
-
-function CodeMirror(place, options) {
- var this$1 = this;
-
- if (!(this instanceof CodeMirror)) { return new CodeMirror(place, options) }
-
- this.options = options = options ? copyObj(options) : {}
- // Determine effective options based on given values and defaults.
- copyObj(defaults, options, false)
- setGuttersForLineNumbers(options)
-
- var doc = options.value
- if (typeof doc == "string") { doc = new Doc(doc, options.mode, null, options.lineSeparator) }
- this.doc = doc
-
- var input = new CodeMirror.inputStyles[options.inputStyle](this)
- var display = this.display = new Display(place, doc, input)
- display.wrapper.CodeMirror = this
- updateGutters(this)
- themeChanged(this)
- if (options.lineWrapping)
- { this.display.wrapper.className += " CodeMirror-wrap" }
- initScrollbars(this)
-
- this.state = {
- keyMaps: [], // stores maps added by addKeyMap
- overlays: [], // highlighting overlays, as added by addOverlay
- modeGen: 0, // bumped when mode/overlay changes, used to invalidate highlighting info
- overwrite: false,
- delayingBlurEvent: false,
- focused: false,
- suppressEdits: false, // used to disable editing during key handlers when in readOnly mode
- pasteIncoming: false, cutIncoming: false, // help recognize paste/cut edits in input.poll
- selectingText: false,
- draggingText: false,
- highlight: new Delayed(), // stores highlight worker timeout
- keySeq: null, // Unfinished key sequence
- specialChars: null
- }
-
- if (options.autofocus && !mobile) { display.input.focus() }
-
- // Override magic textarea content restore that IE sometimes does
- // on our hidden textarea on reload
- if (ie && ie_version < 11) { setTimeout(function () { return this$1.display.input.reset(true); }, 20) }
-
- registerEventHandlers(this)
- ensureGlobalHandlers()
-
- startOperation(this)
- this.curOp.forceUpdate = true
- attachDoc(this, doc)
-
- if ((options.autofocus && !mobile) || this.hasFocus())
- { setTimeout(bind(onFocus, this), 20) }
- else
- { onBlur(this) }
-
- for (var opt in optionHandlers) { if (optionHandlers.hasOwnProperty(opt))
- { optionHandlers[opt](this$1, options[opt], Init) } }
- maybeUpdateLineNumberWidth(this)
- if (options.finishInit) { options.finishInit(this) }
- for (var i = 0; i < initHooks.length; ++i) { initHooks[i](this$1) }
- endOperation(this)
- // Suppress optimizelegibility in Webkit, since it breaks text
- // measuring on line wrapping boundaries.
- if (webkit && options.lineWrapping &&
- getComputedStyle(display.lineDiv).textRendering == "optimizelegibility")
- { display.lineDiv.style.textRendering = "auto" }
-}
-
-// The default configuration options.
-CodeMirror.defaults = defaults
-// Functions to run when options are changed.
-CodeMirror.optionHandlers = optionHandlers
-
-// Attach the necessary event handlers when initializing the editor
-function registerEventHandlers(cm) {
- var d = cm.display
- on(d.scroller, "mousedown", operation(cm, onMouseDown))
- // Older IE's will not fire a second mousedown for a double click
- if (ie && ie_version < 11)
- { on(d.scroller, "dblclick", operation(cm, function (e) {
- if (signalDOMEvent(cm, e)) { return }
- var pos = posFromMouse(cm, e)
- if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) { return }
- e_preventDefault(e)
- var word = cm.findWordAt(pos)
- extendSelection(cm.doc, word.anchor, word.head)
- })) }
- else
- { on(d.scroller, "dblclick", function (e) { return signalDOMEvent(cm, e) || e_preventDefault(e); }) }
- // Some browsers fire contextmenu *after* opening the menu, at
- // which point we can't mess with it anymore. Context menu is
- // handled in onMouseDown for these browsers.
- if (!captureRightClick) { on(d.scroller, "contextmenu", function (e) { return onContextMenu(cm, e); }) }
-
- // Used to suppress mouse event handling when a touch happens
- var touchFinished, prevTouch = {end: 0}
- function finishTouch() {
- if (d.activeTouch) {
- touchFinished = setTimeout(function () { return d.activeTouch = null; }, 1000)
- prevTouch = d.activeTouch
- prevTouch.end = +new Date
- }
- }
- function isMouseLikeTouchEvent(e) {
- if (e.touches.length != 1) { return false }
- var touch = e.touches[0]
- return touch.radiusX <= 1 && touch.radiusY <= 1
- }
- function farAway(touch, other) {
- if (other.left == null) { return true }
- var dx = other.left - touch.left, dy = other.top - touch.top
- return dx * dx + dy * dy > 20 * 20
- }
- on(d.scroller, "touchstart", function (e) {
- if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e)) {
- d.input.ensurePolled()
- clearTimeout(touchFinished)
- var now = +new Date
- d.activeTouch = {start: now, moved: false,
- prev: now - prevTouch.end <= 300 ? prevTouch : null}
- if (e.touches.length == 1) {
- d.activeTouch.left = e.touches[0].pageX
- d.activeTouch.top = e.touches[0].pageY
- }
- }
- })
- on(d.scroller, "touchmove", function () {
- if (d.activeTouch) { d.activeTouch.moved = true }
- })
- on(d.scroller, "touchend", function (e) {
- var touch = d.activeTouch
- if (touch && !eventInWidget(d, e) && touch.left != null &&
- !touch.moved && new Date - touch.start < 300) {
- var pos = cm.coordsChar(d.activeTouch, "page"), range
- if (!touch.prev || farAway(touch, touch.prev)) // Single tap
- { range = new Range(pos, pos) }
- else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap
- { range = cm.findWordAt(pos) }
- else // Triple tap
- { range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))) }
- cm.setSelection(range.anchor, range.head)
- cm.focus()
- e_preventDefault(e)
- }
- finishTouch()
- })
- on(d.scroller, "touchcancel", finishTouch)
-
- // Sync scrolling between fake scrollbars and real scrollable
- // area, ensure viewport is updated when scrolling.
- on(d.scroller, "scroll", function () {
- if (d.scroller.clientHeight) {
- setScrollTop(cm, d.scroller.scrollTop)
- setScrollLeft(cm, d.scroller.scrollLeft, true)
- signal(cm, "scroll", cm)
- }
- })
-
- // Listen to wheel events in order to try and update the viewport on time.
- on(d.scroller, "mousewheel", function (e) { return onScrollWheel(cm, e); })
- on(d.scroller, "DOMMouseScroll", function (e) { return onScrollWheel(cm, e); })
-
- // Prevent wrapper from ever scrolling
- on(d.wrapper, "scroll", function () { return d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; })
-
- d.dragFunctions = {
- enter: function (e) {if (!signalDOMEvent(cm, e)) { e_stop(e) }},
- over: function (e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e) }},
- start: function (e) { return onDragStart(cm, e); },
- drop: operation(cm, onDrop),
- leave: function (e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm) }}
- }
-
- var inp = d.input.getField()
- on(inp, "keyup", function (e) { return onKeyUp.call(cm, e); })
- on(inp, "keydown", operation(cm, onKeyDown))
- on(inp, "keypress", operation(cm, onKeyPress))
- on(inp, "focus", function (e) { return onFocus(cm, e); })
- on(inp, "blur", function (e) { return onBlur(cm, e); })
-}
-
-var initHooks = []
-CodeMirror.defineInitHook = function (f) { return initHooks.push(f); }
-
-// Indent the given line. The how parameter can be "smart",
-// "add"/null, "subtract", or "prev". When aggressive is false
-// (typically set to true for forced single-line indents), empty
-// lines are not indented, and places where the mode returns Pass
-// are left alone.
-function indentLine(cm, n, how, aggressive) {
- var doc = cm.doc, state
- if (how == null) { how = "add" }
- if (how == "smart") {
- // Fall back to "prev" when the mode doesn't have an indentation
- // method.
- if (!doc.mode.indent) { how = "prev" }
- else { state = getStateBefore(cm, n) }
- }
-
- var tabSize = cm.options.tabSize
- var line = getLine(doc, n), curSpace = countColumn(line.text, null, tabSize)
- if (line.stateAfter) { line.stateAfter = null }
- var curSpaceString = line.text.match(/^\s*/)[0], indentation
- if (!aggressive && !/\S/.test(line.text)) {
- indentation = 0
- how = "not"
- } else if (how == "smart") {
- indentation = doc.mode.indent(state, line.text.slice(curSpaceString.length), line.text)
- if (indentation == Pass || indentation > 150) {
- if (!aggressive) { return }
- how = "prev"
- }
- }
- if (how == "prev") {
- if (n > doc.first) { indentation = countColumn(getLine(doc, n-1).text, null, tabSize) }
- else { indentation = 0 }
- } else if (how == "add") {
- indentation = curSpace + cm.options.indentUnit
- } else if (how == "subtract") {
- indentation = curSpace - cm.options.indentUnit
- } else if (typeof how == "number") {
- indentation = curSpace + how
- }
- indentation = Math.max(0, indentation)
-
- var indentString = "", pos = 0
- if (cm.options.indentWithTabs)
- { for (var i = Math.floor(indentation / tabSize); i; --i) {pos += tabSize; indentString += "\t"} }
- if (pos < indentation) { indentString += spaceStr(indentation - pos) }
-
- if (indentString != curSpaceString) {
- replaceRange(doc, indentString, Pos(n, 0), Pos(n, curSpaceString.length), "+input")
- line.stateAfter = null
- return true
- } else {
- // Ensure that, if the cursor was in the whitespace at the start
- // of the line, it is moved to the end of that space.
- for (var i$1 = 0; i$1 < doc.sel.ranges.length; i$1++) {
- var range = doc.sel.ranges[i$1]
- if (range.head.line == n && range.head.ch < curSpaceString.length) {
- var pos$1 = Pos(n, curSpaceString.length)
- replaceOneSelection(doc, i$1, new Range(pos$1, pos$1))
- break
- }
- }
- }
-}
-
-// This will be set to a {lineWise: bool, text: [string]} object, so
-// that, when pasting, we know what kind of selections the copied
-// text was made out of.
-var lastCopied = null
-
-function setLastCopied(newLastCopied) {
- lastCopied = newLastCopied
-}
-
-function applyTextInput(cm, inserted, deleted, sel, origin) {
- var doc = cm.doc
- cm.display.shift = false
- if (!sel) { sel = doc.sel }
-
- var paste = cm.state.pasteIncoming || origin == "paste"
- var textLines = splitLinesAuto(inserted), multiPaste = null
- // When pasing N lines into N selections, insert one line per selection
- if (paste && sel.ranges.length > 1) {
- if (lastCopied && lastCopied.text.join("\n") == inserted) {
- if (sel.ranges.length % lastCopied.text.length == 0) {
- multiPaste = []
- for (var i = 0; i < lastCopied.text.length; i++)
- { multiPaste.push(doc.splitLines(lastCopied.text[i])) }
- }
- } else if (textLines.length == sel.ranges.length) {
- multiPaste = map(textLines, function (l) { return [l]; })
- }
- }
-
- var updateInput
- // Normal behavior is to insert the new text into every selection
- for (var i$1 = sel.ranges.length - 1; i$1 >= 0; i$1--) {
- var range = sel.ranges[i$1]
- var from = range.from(), to = range.to()
- if (range.empty()) {
- if (deleted && deleted > 0) // Handle deletion
- { from = Pos(from.line, from.ch - deleted) }
- else if (cm.state.overwrite && !paste) // Handle overwrite
- { to = Pos(to.line, Math.min(getLine(doc, to.line).text.length, to.ch + lst(textLines).length)) }
- else if (lastCopied && lastCopied.lineWise && lastCopied.text.join("\n") == inserted)
- { from = to = Pos(from.line, 0) }
- }
- updateInput = cm.curOp.updateInput
- var changeEvent = {from: from, to: to, text: multiPaste ? multiPaste[i$1 % multiPaste.length] : textLines,
- origin: origin || (paste ? "paste" : cm.state.cutIncoming ? "cut" : "+input")}
- makeChange(cm.doc, changeEvent)
- signalLater(cm, "inputRead", cm, changeEvent)
- }
- if (inserted && !paste)
- { triggerElectric(cm, inserted) }
-
- ensureCursorVisible(cm)
- cm.curOp.updateInput = updateInput
- cm.curOp.typing = true
- cm.state.pasteIncoming = cm.state.cutIncoming = false
-}
-
-function handlePaste(e, cm) {
- var pasted = e.clipboardData && e.clipboardData.getData("Text")
- if (pasted) {
- e.preventDefault()
- if (!cm.isReadOnly() && !cm.options.disableInput)
- { runInOp(cm, function () { return applyTextInput(cm, pasted, 0, null, "paste"); }) }
- return true
- }
-}
-
-function triggerElectric(cm, inserted) {
- // When an 'electric' character is inserted, immediately trigger a reindent
- if (!cm.options.electricChars || !cm.options.smartIndent) { return }
- var sel = cm.doc.sel
-
- for (var i = sel.ranges.length - 1; i >= 0; i--) {
- var range = sel.ranges[i]
- if (range.head.ch > 100 || (i && sel.ranges[i - 1].head.line == range.head.line)) { continue }
- var mode = cm.getModeAt(range.head)
- var indented = false
- if (mode.electricChars) {
- for (var j = 0; j < mode.electricChars.length; j++)
- { if (inserted.indexOf(mode.electricChars.charAt(j)) > -1) {
- indented = indentLine(cm, range.head.line, "smart")
- break
- } }
- } else if (mode.electricInput) {
- if (mode.electricInput.test(getLine(cm.doc, range.head.line).text.slice(0, range.head.ch)))
- { indented = indentLine(cm, range.head.line, "smart") }
- }
- if (indented) { signalLater(cm, "electricInput", cm, range.head.line) }
- }
-}
-
-function copyableRanges(cm) {
- var text = [], ranges = []
- for (var i = 0; i < cm.doc.sel.ranges.length; i++) {
- var line = cm.doc.sel.ranges[i].head.line
- var lineRange = {anchor: Pos(line, 0), head: Pos(line + 1, 0)}
- ranges.push(lineRange)
- text.push(cm.getRange(lineRange.anchor, lineRange.head))
- }
- return {text: text, ranges: ranges}
-}
-
-function disableBrowserMagic(field, spellcheck) {
- field.setAttribute("autocorrect", "off")
- field.setAttribute("autocapitalize", "off")
- field.setAttribute("spellcheck", !!spellcheck)
-}
-
-function hiddenTextarea() {
- var te = elt("textarea", null, null, "position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none")
- var div = elt("div", [te], null, "overflow: hidden; position: relative; width: 3px; height: 0px;")
- // The textarea is kept positioned near the cursor to prevent the
- // fact that it'll be scrolled into view on input from scrolling
- // our fake cursor out of view. On webkit, when wrap=off, paste is
- // very slow. So make the area wide instead.
- if (webkit) { te.style.width = "1000px" }
- else { te.setAttribute("wrap", "off") }
- // If border: 0; -- iOS fails to open keyboard (issue #1287)
- if (ios) { te.style.border = "1px solid black" }
- disableBrowserMagic(te)
- return div
-}
-
-// The publicly visible API. Note that methodOp(f) means
-// 'wrap f in an operation, performed on its `this` parameter'.
-
-// This is not the complete set of editor methods. Most of the
-// methods defined on the Doc type are also injected into
-// CodeMirror.prototype, for backwards compatibility and
-// convenience.
-
-function addEditorMethods(CodeMirror) {
- var optionHandlers = CodeMirror.optionHandlers
-
- var helpers = CodeMirror.helpers = {}
-
- CodeMirror.prototype = {
- constructor: CodeMirror,
- focus: function(){window.focus(); this.display.input.focus()},
-
- setOption: function(option, value) {
- var options = this.options, old = options[option]
- if (options[option] == value && option != "mode") { return }
- options[option] = value
- if (optionHandlers.hasOwnProperty(option))
- { operation(this, optionHandlers[option])(this, value, old) }
- signal(this, "optionChange", this, option)
- },
-
- getOption: function(option) {return this.options[option]},
- getDoc: function() {return this.doc},
-
- addKeyMap: function(map, bottom) {
- this.state.keyMaps[bottom ? "push" : "unshift"](getKeyMap(map))
- },
- removeKeyMap: function(map) {
- var maps = this.state.keyMaps
- for (var i = 0; i < maps.length; ++i)
- { if (maps[i] == map || maps[i].name == map) {
- maps.splice(i, 1)
- return true
- } }
- },
-
- addOverlay: methodOp(function(spec, options) {
- var mode = spec.token ? spec : CodeMirror.getMode(this.options, spec)
- if (mode.startState) { throw new Error("Overlays may not be stateful.") }
- insertSorted(this.state.overlays,
- {mode: mode, modeSpec: spec, opaque: options && options.opaque,
- priority: (options && options.priority) || 0},
- function (overlay) { return overlay.priority; })
- this.state.modeGen++
- regChange(this)
- }),
- removeOverlay: methodOp(function(spec) {
- var this$1 = this;
-
- var overlays = this.state.overlays
- for (var i = 0; i < overlays.length; ++i) {
- var cur = overlays[i].modeSpec
- if (cur == spec || typeof spec == "string" && cur.name == spec) {
- overlays.splice(i, 1)
- this$1.state.modeGen++
- regChange(this$1)
- return
- }
- }
- }),
-
- indentLine: methodOp(function(n, dir, aggressive) {
- if (typeof dir != "string" && typeof dir != "number") {
- if (dir == null) { dir = this.options.smartIndent ? "smart" : "prev" }
- else { dir = dir ? "add" : "subtract" }
- }
- if (isLine(this.doc, n)) { indentLine(this, n, dir, aggressive) }
- }),
- indentSelection: methodOp(function(how) {
- var this$1 = this;
-
- var ranges = this.doc.sel.ranges, end = -1
- for (var i = 0; i < ranges.length; i++) {
- var range = ranges[i]
- if (!range.empty()) {
- var from = range.from(), to = range.to()
- var start = Math.max(end, from.line)
- end = Math.min(this$1.lastLine(), to.line - (to.ch ? 0 : 1)) + 1
- for (var j = start; j < end; ++j)
- { indentLine(this$1, j, how) }
- var newRanges = this$1.doc.sel.ranges
- if (from.ch == 0 && ranges.length == newRanges.length && newRanges[i].from().ch > 0)
- { replaceOneSelection(this$1.doc, i, new Range(from, newRanges[i].to()), sel_dontScroll) }
- } else if (range.head.line > end) {
- indentLine(this$1, range.head.line, how, true)
- end = range.head.line
- if (i == this$1.doc.sel.primIndex) { ensureCursorVisible(this$1) }
- }
- }
- }),
-
- // Fetch the parser token for a given character. Useful for hacks
- // that want to inspect the mode state (say, for completion).
- getTokenAt: function(pos, precise) {
- return takeToken(this, pos, precise)
- },
-
- getLineTokens: function(line, precise) {
- return takeToken(this, Pos(line), precise, true)
- },
-
- getTokenTypeAt: function(pos) {
- pos = clipPos(this.doc, pos)
- var styles = getLineStyles(this, getLine(this.doc, pos.line))
- var before = 0, after = (styles.length - 1) / 2, ch = pos.ch
- var type
- if (ch == 0) { type = styles[2] }
- else { for (;;) {
- var mid = (before + after) >> 1
- if ((mid ? styles[mid * 2 - 1] : 0) >= ch) { after = mid }
- else if (styles[mid * 2 + 1] < ch) { before = mid + 1 }
- else { type = styles[mid * 2 + 2]; break }
- } }
- var cut = type ? type.indexOf("overlay ") : -1
- return cut < 0 ? type : cut == 0 ? null : type.slice(0, cut - 1)
- },
-
- getModeAt: function(pos) {
- var mode = this.doc.mode
- if (!mode.innerMode) { return mode }
- return CodeMirror.innerMode(mode, this.getTokenAt(pos).state).mode
- },
-
- getHelper: function(pos, type) {
- return this.getHelpers(pos, type)[0]
- },
-
- getHelpers: function(pos, type) {
- var this$1 = this;
-
- var found = []
- if (!helpers.hasOwnProperty(type)) { return found }
- var help = helpers[type], mode = this.getModeAt(pos)
- if (typeof mode[type] == "string") {
- if (help[mode[type]]) { found.push(help[mode[type]]) }
- } else if (mode[type]) {
- for (var i = 0; i < mode[type].length; i++) {
- var val = help[mode[type][i]]
- if (val) { found.push(val) }
- }
- } else if (mode.helperType && help[mode.helperType]) {
- found.push(help[mode.helperType])
- } else if (help[mode.name]) {
- found.push(help[mode.name])
- }
- for (var i$1 = 0; i$1 < help._global.length; i$1++) {
- var cur = help._global[i$1]
- if (cur.pred(mode, this$1) && indexOf(found, cur.val) == -1)
- { found.push(cur.val) }
- }
- return found
- },
-
- getStateAfter: function(line, precise) {
- var doc = this.doc
- line = clipLine(doc, line == null ? doc.first + doc.size - 1: line)
- return getStateBefore(this, line + 1, precise)
- },
-
- cursorCoords: function(start, mode) {
- var pos, range = this.doc.sel.primary()
- if (start == null) { pos = range.head }
- else if (typeof start == "object") { pos = clipPos(this.doc, start) }
- else { pos = start ? range.from() : range.to() }
- return cursorCoords(this, pos, mode || "page")
- },
-
- charCoords: function(pos, mode) {
- return charCoords(this, clipPos(this.doc, pos), mode || "page")
- },
-
- coordsChar: function(coords, mode) {
- coords = fromCoordSystem(this, coords, mode || "page")
- return coordsChar(this, coords.left, coords.top)
- },
-
- lineAtHeight: function(height, mode) {
- height = fromCoordSystem(this, {top: height, left: 0}, mode || "page").top
- return lineAtHeight(this.doc, height + this.display.viewOffset)
- },
- heightAtLine: function(line, mode, includeWidgets) {
- var end = false, lineObj
- if (typeof line == "number") {
- var last = this.doc.first + this.doc.size - 1
- if (line < this.doc.first) { line = this.doc.first }
- else if (line > last) { line = last; end = true }
- lineObj = getLine(this.doc, line)
- } else {
- lineObj = line
- }
- return intoCoordSystem(this, lineObj, {top: 0, left: 0}, mode || "page", includeWidgets || end).top +
- (end ? this.doc.height - heightAtLine(lineObj) : 0)
- },
-
- defaultTextHeight: function() { return textHeight(this.display) },
- defaultCharWidth: function() { return charWidth(this.display) },
-
- getViewport: function() { return {from: this.display.viewFrom, to: this.display.viewTo}},
-
- addWidget: function(pos, node, scroll, vert, horiz) {
- var display = this.display
- pos = cursorCoords(this, clipPos(this.doc, pos))
- var top = pos.bottom, left = pos.left
- node.style.position = "absolute"
- node.setAttribute("cm-ignore-events", "true")
- this.display.input.setUneditable(node)
- display.sizer.appendChild(node)
- if (vert == "over") {
- top = pos.top
- } else if (vert == "above" || vert == "near") {
- var vspace = Math.max(display.wrapper.clientHeight, this.doc.height),
- hspace = Math.max(display.sizer.clientWidth, display.lineSpace.clientWidth)
- // Default to positioning above (if specified and possible); otherwise default to positioning below
- if ((vert == 'above' || pos.bottom + node.offsetHeight > vspace) && pos.top > node.offsetHeight)
- { top = pos.top - node.offsetHeight }
- else if (pos.bottom + node.offsetHeight <= vspace)
- { top = pos.bottom }
- if (left + node.offsetWidth > hspace)
- { left = hspace - node.offsetWidth }
- }
- node.style.top = top + "px"
- node.style.left = node.style.right = ""
- if (horiz == "right") {
- left = display.sizer.clientWidth - node.offsetWidth
- node.style.right = "0px"
- } else {
- if (horiz == "left") { left = 0 }
- else if (horiz == "middle") { left = (display.sizer.clientWidth - node.offsetWidth) / 2 }
- node.style.left = left + "px"
- }
- if (scroll)
- { scrollIntoView(this, left, top, left + node.offsetWidth, top + node.offsetHeight) }
- },
-
- triggerOnKeyDown: methodOp(onKeyDown),
- triggerOnKeyPress: methodOp(onKeyPress),
- triggerOnKeyUp: onKeyUp,
-
- execCommand: function(cmd) {
- if (commands.hasOwnProperty(cmd))
- { return commands[cmd].call(null, this) }
- },
-
- triggerElectric: methodOp(function(text) { triggerElectric(this, text) }),
-
- findPosH: function(from, amount, unit, visually) {
- var this$1 = this;
-
- var dir = 1
- if (amount < 0) { dir = -1; amount = -amount }
- var cur = clipPos(this.doc, from)
- for (var i = 0; i < amount; ++i) {
- cur = findPosH(this$1.doc, cur, dir, unit, visually)
- if (cur.hitSide) { break }
- }
- return cur
- },
-
- moveH: methodOp(function(dir, unit) {
- var this$1 = this;
-
- this.extendSelectionsBy(function (range) {
- if (this$1.display.shift || this$1.doc.extend || range.empty())
- { return findPosH(this$1.doc, range.head, dir, unit, this$1.options.rtlMoveVisually) }
- else
- { return dir < 0 ? range.from() : range.to() }
- }, sel_move)
- }),
-
- deleteH: methodOp(function(dir, unit) {
- var sel = this.doc.sel, doc = this.doc
- if (sel.somethingSelected())
- { doc.replaceSelection("", null, "+delete") }
- else
- { deleteNearSelection(this, function (range) {
- var other = findPosH(doc, range.head, dir, unit, false)
- return dir < 0 ? {from: other, to: range.head} : {from: range.head, to: other}
- }) }
- }),
-
- findPosV: function(from, amount, unit, goalColumn) {
- var this$1 = this;
-
- var dir = 1, x = goalColumn
- if (amount < 0) { dir = -1; amount = -amount }
- var cur = clipPos(this.doc, from)
- for (var i = 0; i < amount; ++i) {
- var coords = cursorCoords(this$1, cur, "div")
- if (x == null) { x = coords.left }
- else { coords.left = x }
- cur = findPosV(this$1, coords, dir, unit)
- if (cur.hitSide) { break }
- }
- return cur
- },
-
- moveV: methodOp(function(dir, unit) {
- var this$1 = this;
-
- var doc = this.doc, goals = []
- var collapse = !this.display.shift && !doc.extend && doc.sel.somethingSelected()
- doc.extendSelectionsBy(function (range) {
- if (collapse)
- { return dir < 0 ? range.from() : range.to() }
- var headPos = cursorCoords(this$1, range.head, "div")
- if (range.goalColumn != null) { headPos.left = range.goalColumn }
- goals.push(headPos.left)
- var pos = findPosV(this$1, headPos, dir, unit)
- if (unit == "page" && range == doc.sel.primary())
- { addToScrollPos(this$1, null, charCoords(this$1, pos, "div").top - headPos.top) }
- return pos
- }, sel_move)
- if (goals.length) { for (var i = 0; i < doc.sel.ranges.length; i++)
- { doc.sel.ranges[i].goalColumn = goals[i] } }
- }),
-
- // Find the word at the given position (as returned by coordsChar).
- findWordAt: function(pos) {
- var doc = this.doc, line = getLine(doc, pos.line).text
- var start = pos.ch, end = pos.ch
- if (line) {
- var helper = this.getHelper(pos, "wordChars")
- if ((pos.sticky == "before" || end == line.length) && start) { --start; } else { ++end }
- var startChar = line.charAt(start)
- var check = isWordChar(startChar, helper)
- ? function (ch) { return isWordChar(ch, helper); }
- : /\s/.test(startChar) ? function (ch) { return /\s/.test(ch); }
- : function (ch) { return (!/\s/.test(ch) && !isWordChar(ch)); }
- while (start > 0 && check(line.charAt(start - 1))) { --start }
- while (end < line.length && check(line.charAt(end))) { ++end }
- }
- return new Range(Pos(pos.line, start), Pos(pos.line, end))
- },
-
- toggleOverwrite: function(value) {
- if (value != null && value == this.state.overwrite) { return }
- if (this.state.overwrite = !this.state.overwrite)
- { addClass(this.display.cursorDiv, "CodeMirror-overwrite") }
- else
- { rmClass(this.display.cursorDiv, "CodeMirror-overwrite") }
-
- signal(this, "overwriteToggle", this, this.state.overwrite)
- },
- hasFocus: function() { return this.display.input.getField() == activeElt() },
- isReadOnly: function() { return !!(this.options.readOnly || this.doc.cantEdit) },
-
- scrollTo: methodOp(function(x, y) {
- if (x != null || y != null) { resolveScrollToPos(this) }
- if (x != null) { this.curOp.scrollLeft = x }
- if (y != null) { this.curOp.scrollTop = y }
- }),
- getScrollInfo: function() {
- var scroller = this.display.scroller
- return {left: scroller.scrollLeft, top: scroller.scrollTop,
- height: scroller.scrollHeight - scrollGap(this) - this.display.barHeight,
- width: scroller.scrollWidth - scrollGap(this) - this.display.barWidth,
- clientHeight: displayHeight(this), clientWidth: displayWidth(this)}
- },
-
- scrollIntoView: methodOp(function(range, margin) {
- if (range == null) {
- range = {from: this.doc.sel.primary().head, to: null}
- if (margin == null) { margin = this.options.cursorScrollMargin }
- } else if (typeof range == "number") {
- range = {from: Pos(range, 0), to: null}
- } else if (range.from == null) {
- range = {from: range, to: null}
- }
- if (!range.to) { range.to = range.from }
- range.margin = margin || 0
-
- if (range.from.line != null) {
- resolveScrollToPos(this)
- this.curOp.scrollToPos = range
- } else {
- var sPos = calculateScrollPos(this, Math.min(range.from.left, range.to.left),
- Math.min(range.from.top, range.to.top) - range.margin,
- Math.max(range.from.right, range.to.right),
- Math.max(range.from.bottom, range.to.bottom) + range.margin)
- this.scrollTo(sPos.scrollLeft, sPos.scrollTop)
- }
- }),
-
- setSize: methodOp(function(width, height) {
- var this$1 = this;
-
- var interpret = function (val) { return typeof val == "number" || /^\d+$/.test(String(val)) ? val + "px" : val; }
- if (width != null) { this.display.wrapper.style.width = interpret(width) }
- if (height != null) { this.display.wrapper.style.height = interpret(height) }
- if (this.options.lineWrapping) { clearLineMeasurementCache(this) }
- var lineNo = this.display.viewFrom
- this.doc.iter(lineNo, this.display.viewTo, function (line) {
- if (line.widgets) { for (var i = 0; i < line.widgets.length; i++)
- { if (line.widgets[i].noHScroll) { regLineChange(this$1, lineNo, "widget"); break } } }
- ++lineNo
- })
- this.curOp.forceUpdate = true
- signal(this, "refresh", this)
- }),
-
- operation: function(f){return runInOp(this, f)},
-
- refresh: methodOp(function() {
- var oldHeight = this.display.cachedTextHeight
- regChange(this)
- this.curOp.forceUpdate = true
- clearCaches(this)
- this.scrollTo(this.doc.scrollLeft, this.doc.scrollTop)
- updateGutterSpace(this)
- if (oldHeight == null || Math.abs(oldHeight - textHeight(this.display)) > .5)
- { estimateLineHeights(this) }
- signal(this, "refresh", this)
- }),
-
- swapDoc: methodOp(function(doc) {
- var old = this.doc
- old.cm = null
- attachDoc(this, doc)
- clearCaches(this)
- this.display.input.reset()
- this.scrollTo(doc.scrollLeft, doc.scrollTop)
- this.curOp.forceScroll = true
- signalLater(this, "swapDoc", this, old)
- return old
- }),
-
- getInputField: function(){return this.display.input.getField()},
- getWrapperElement: function(){return this.display.wrapper},
- getScrollerElement: function(){return this.display.scroller},
- getGutterElement: function(){return this.display.gutters}
- }
- eventMixin(CodeMirror)
-
- CodeMirror.registerHelper = function(type, name, value) {
- if (!helpers.hasOwnProperty(type)) { helpers[type] = CodeMirror[type] = {_global: []} }
- helpers[type][name] = value
- }
- CodeMirror.registerGlobalHelper = function(type, name, predicate, value) {
- CodeMirror.registerHelper(type, name, value)
- helpers[type]._global.push({pred: predicate, val: value})
- }
-}
-
-// Used for horizontal relative motion. Dir is -1 or 1 (left or
-// right), unit can be "char", "column" (like char, but doesn't
-// cross line boundaries), "word" (across next word), or "group" (to
-// the start of next group of word or non-word-non-whitespace
-// chars). The visually param controls whether, in right-to-left
-// text, direction 1 means to move towards the next index in the
-// string, or towards the character to the right of the current
-// position. The resulting position will have a hitSide=true
-// property if it reached the end of the document.
-function findPosH(doc, pos, dir, unit, visually) {
- var oldPos = pos
- var origDir = dir
- var lineObj = getLine(doc, pos.line)
- function findNextLine() {
- var l = pos.line + dir
- if (l < doc.first || l >= doc.first + doc.size) { return false }
- pos = new Pos(l, pos.ch, pos.sticky)
- return lineObj = getLine(doc, l)
- }
- function moveOnce(boundToLine) {
- var next
- if (visually) {
- next = moveVisually(doc.cm, lineObj, pos, dir)
- } else {
- next = moveLogically(lineObj, pos, dir)
- }
- if (next == null) {
- if (!boundToLine && findNextLine())
- { pos = endOfLine(visually, doc.cm, lineObj, pos.line, dir) }
- else
- { return false }
- } else {
- pos = next
- }
- return true
- }
-
- if (unit == "char") {
- moveOnce()
- } else if (unit == "column") {
- moveOnce(true)
- } else if (unit == "word" || unit == "group") {
- var sawType = null, group = unit == "group"
- var helper = doc.cm && doc.cm.getHelper(pos, "wordChars")
- for (var first = true;; first = false) {
- if (dir < 0 && !moveOnce(!first)) { break }
- var cur = lineObj.text.charAt(pos.ch) || "\n"
- var type = isWordChar(cur, helper) ? "w"
- : group && cur == "\n" ? "n"
- : !group || /\s/.test(cur) ? null
- : "p"
- if (group && !first && !type) { type = "s" }
- if (sawType && sawType != type) {
- if (dir < 0) {dir = 1; moveOnce(); pos.sticky = "after"}
- break
- }
-
- if (type) { sawType = type }
- if (dir > 0 && !moveOnce(!first)) { break }
- }
- }
- var result = skipAtomic(doc, pos, oldPos, origDir, true)
- if (equalCursorPos(oldPos, result)) { result.hitSide = true }
- return result
-}
-
-// For relative vertical movement. Dir may be -1 or 1. Unit can be
-// "page" or "line". The resulting position will have a hitSide=true
-// property if it reached the end of the document.
-function findPosV(cm, pos, dir, unit) {
- var doc = cm.doc, x = pos.left, y
- if (unit == "page") {
- var pageSize = Math.min(cm.display.wrapper.clientHeight, window.innerHeight || document.documentElement.clientHeight)
- var moveAmount = Math.max(pageSize - .5 * textHeight(cm.display), 3)
- y = (dir > 0 ? pos.bottom : pos.top) + dir * moveAmount
-
- } else if (unit == "line") {
- y = dir > 0 ? pos.bottom + 3 : pos.top - 3
- }
- var target
- for (;;) {
- target = coordsChar(cm, x, y)
- if (!target.outside) { break }
- if (dir < 0 ? y <= 0 : y >= doc.height) { target.hitSide = true; break }
- y += dir * 5
- }
- return target
-}
-
-// CONTENTEDITABLE INPUT STYLE
-
-var ContentEditableInput = function(cm) {
- this.cm = cm
- this.lastAnchorNode = this.lastAnchorOffset = this.lastFocusNode = this.lastFocusOffset = null
- this.polling = new Delayed()
- this.composing = null
- this.gracePeriod = false
- this.readDOMTimeout = null
-};
-
-ContentEditableInput.prototype.init = function (display) {
- var this$1 = this;
-
- var input = this, cm = input.cm
- var div = input.div = display.lineDiv
- disableBrowserMagic(div, cm.options.spellcheck)
-
- on(div, "paste", function (e) {
- if (signalDOMEvent(cm, e) || handlePaste(e, cm)) { return }
- // IE doesn't fire input events, so we schedule a read for the pasted content in this way
- if (ie_version <= 11) { setTimeout(operation(cm, function () {
- if (!input.pollContent()) { regChange(cm) }
- }), 20) }
- })
-
- on(div, "compositionstart", function (e) {
- this$1.composing = {data: e.data, done: false}
- })
- on(div, "compositionupdate", function (e) {
- if (!this$1.composing) { this$1.composing = {data: e.data, done: false} }
- })
- on(div, "compositionend", function (e) {
- if (this$1.composing) {
- if (e.data != this$1.composing.data) { this$1.readFromDOMSoon() }
- this$1.composing.done = true
- }
- })
-
- on(div, "touchstart", function () { return input.forceCompositionEnd(); })
-
- on(div, "input", function () {
- if (!this$1.composing) { this$1.readFromDOMSoon() }
- })
-
- function onCopyCut(e) {
- if (signalDOMEvent(cm, e)) { return }
- if (cm.somethingSelected()) {
- setLastCopied({lineWise: false, text: cm.getSelections()})
- if (e.type == "cut") { cm.replaceSelection("", null, "cut") }
- } else if (!cm.options.lineWiseCopyCut) {
- return
- } else {
- var ranges = copyableRanges(cm)
- setLastCopied({lineWise: true, text: ranges.text})
- if (e.type == "cut") {
- cm.operation(function () {
- cm.setSelections(ranges.ranges, 0, sel_dontScroll)
- cm.replaceSelection("", null, "cut")
- })
- }
- }
- if (e.clipboardData) {
- e.clipboardData.clearData()
- var content = lastCopied.text.join("\n")
- // iOS exposes the clipboard API, but seems to discard content inserted into it
- e.clipboardData.setData("Text", content)
- if (e.clipboardData.getData("Text") == content) {
- e.preventDefault()
- return
- }
- }
- // Old-fashioned briefly-focus-a-textarea hack
- var kludge = hiddenTextarea(), te = kludge.firstChild
- cm.display.lineSpace.insertBefore(kludge, cm.display.lineSpace.firstChild)
- te.value = lastCopied.text.join("\n")
- var hadFocus = document.activeElement
- selectInput(te)
- setTimeout(function () {
- cm.display.lineSpace.removeChild(kludge)
- hadFocus.focus()
- if (hadFocus == div) { input.showPrimarySelection() }
- }, 50)
- }
- on(div, "copy", onCopyCut)
- on(div, "cut", onCopyCut)
-};
-
-ContentEditableInput.prototype.prepareSelection = function () {
- var result = prepareSelection(this.cm, false)
- result.focus = this.cm.state.focused
- return result
-};
-
-ContentEditableInput.prototype.showSelection = function (info, takeFocus) {
- if (!info || !this.cm.display.view.length) { return }
- if (info.focus || takeFocus) { this.showPrimarySelection() }
- this.showMultipleSelections(info)
-};
-
-ContentEditableInput.prototype.showPrimarySelection = function () {
- var sel = window.getSelection(), prim = this.cm.doc.sel.primary()
- var curAnchor = domToPos(this.cm, sel.anchorNode, sel.anchorOffset)
- var curFocus = domToPos(this.cm, sel.focusNode, sel.focusOffset)
- if (curAnchor && !curAnchor.bad && curFocus && !curFocus.bad &&
- cmp(minPos(curAnchor, curFocus), prim.from()) == 0 &&
- cmp(maxPos(curAnchor, curFocus), prim.to()) == 0)
- { return }
-
- var start = posToDOM(this.cm, prim.from())
- var end = posToDOM(this.cm, prim.to())
- if (!start && !end) { return }
-
- var view = this.cm.display.view
- var old = sel.rangeCount && sel.getRangeAt(0)
- if (!start) {
- start = {node: view[0].measure.map[2], offset: 0}
- } else if (!end) { // FIXME dangerously hacky
- var measure = view[view.length - 1].measure
- var map = measure.maps ? measure.maps[measure.maps.length - 1] : measure.map
- end = {node: map[map.length - 1], offset: map[map.length - 2] - map[map.length - 3]}
- }
-
- var rng
- try { rng = range(start.node, start.offset, end.offset, end.node) }
- catch(e) {} // Our model of the DOM might be outdated, in which case the range we try to set can be impossible
- if (rng) {
- if (!gecko && this.cm.state.focused) {
- sel.collapse(start.node, start.offset)
- if (!rng.collapsed) {
- sel.removeAllRanges()
- sel.addRange(rng)
- }
- } else {
- sel.removeAllRanges()
- sel.addRange(rng)
- }
- if (old && sel.anchorNode == null) { sel.addRange(old) }
- else if (gecko) { this.startGracePeriod() }
- }
- this.rememberSelection()
-};
-
-ContentEditableInput.prototype.startGracePeriod = function () {
- var this$1 = this;
-
- clearTimeout(this.gracePeriod)
- this.gracePeriod = setTimeout(function () {
- this$1.gracePeriod = false
- if (this$1.selectionChanged())
- { this$1.cm.operation(function () { return this$1.cm.curOp.selectionChanged = true; }) }
- }, 20)
-};
-
-ContentEditableInput.prototype.showMultipleSelections = function (info) {
- removeChildrenAndAdd(this.cm.display.cursorDiv, info.cursors)
- removeChildrenAndAdd(this.cm.display.selectionDiv, info.selection)
-};
-
-ContentEditableInput.prototype.rememberSelection = function () {
- var sel = window.getSelection()
- this.lastAnchorNode = sel.anchorNode; this.lastAnchorOffset = sel.anchorOffset
- this.lastFocusNode = sel.focusNode; this.lastFocusOffset = sel.focusOffset
-};
-
-ContentEditableInput.prototype.selectionInEditor = function () {
- var sel = window.getSelection()
- if (!sel.rangeCount) { return false }
- var node = sel.getRangeAt(0).commonAncestorContainer
- return contains(this.div, node)
-};
-
-ContentEditableInput.prototype.focus = function () {
- if (this.cm.options.readOnly != "nocursor") {
- if (!this.selectionInEditor())
- { this.showSelection(this.prepareSelection(), true) }
- this.div.focus()
- }
-};
-ContentEditableInput.prototype.blur = function () { this.div.blur() };
-ContentEditableInput.prototype.getField = function () { return this.div };
-
-ContentEditableInput.prototype.supportsTouch = function () { return true };
-
-ContentEditableInput.prototype.receivedFocus = function () {
- var input = this
- if (this.selectionInEditor())
- { this.pollSelection() }
- else
- { runInOp(this.cm, function () { return input.cm.curOp.selectionChanged = true; }) }
-
- function poll() {
- if (input.cm.state.focused) {
- input.pollSelection()
- input.polling.set(input.cm.options.pollInterval, poll)
- }
- }
- this.polling.set(this.cm.options.pollInterval, poll)
-};
-
-ContentEditableInput.prototype.selectionChanged = function () {
- var sel = window.getSelection()
- return sel.anchorNode != this.lastAnchorNode || sel.anchorOffset != this.lastAnchorOffset ||
- sel.focusNode != this.lastFocusNode || sel.focusOffset != this.lastFocusOffset
-};
-
-ContentEditableInput.prototype.pollSelection = function () {
- if (!this.composing && this.readDOMTimeout == null && !this.gracePeriod && this.selectionChanged()) {
- var sel = window.getSelection(), cm = this.cm
- this.rememberSelection()
- var anchor = domToPos(cm, sel.anchorNode, sel.anchorOffset)
- var head = domToPos(cm, sel.focusNode, sel.focusOffset)
- if (anchor && head) { runInOp(cm, function () {
- setSelection(cm.doc, simpleSelection(anchor, head), sel_dontScroll)
- if (anchor.bad || head.bad) { cm.curOp.selectionChanged = true }
- }) }
- }
-};
-
-ContentEditableInput.prototype.pollContent = function () {
- if (this.readDOMTimeout != null) {
- clearTimeout(this.readDOMTimeout)
- this.readDOMTimeout = null
- }
-
- var cm = this.cm, display = cm.display, sel = cm.doc.sel.primary()
- var from = sel.from(), to = sel.to()
- if (from.ch == 0 && from.line > cm.firstLine())
- { from = Pos(from.line - 1, getLine(cm.doc, from.line - 1).length) }
- if (to.ch == getLine(cm.doc, to.line).text.length && to.line < cm.lastLine())
- { to = Pos(to.line + 1, 0) }
- if (from.line < display.viewFrom || to.line > display.viewTo - 1) { return false }
-
- var fromIndex, fromLine, fromNode
- if (from.line == display.viewFrom || (fromIndex = findViewIndex(cm, from.line)) == 0) {
- fromLine = lineNo(display.view[0].line)
- fromNode = display.view[0].node
- } else {
- fromLine = lineNo(display.view[fromIndex].line)
- fromNode = display.view[fromIndex - 1].node.nextSibling
- }
- var toIndex = findViewIndex(cm, to.line)
- var toLine, toNode
- if (toIndex == display.view.length - 1) {
- toLine = display.viewTo - 1
- toNode = display.lineDiv.lastChild
- } else {
- toLine = lineNo(display.view[toIndex + 1].line) - 1
- toNode = display.view[toIndex + 1].node.previousSibling
- }
-
- if (!fromNode) { return false }
- var newText = cm.doc.splitLines(domTextBetween(cm, fromNode, toNode, fromLine, toLine))
- var oldText = getBetween(cm.doc, Pos(fromLine, 0), Pos(toLine, getLine(cm.doc, toLine).text.length))
- while (newText.length > 1 && oldText.length > 1) {
- if (lst(newText) == lst(oldText)) { newText.pop(); oldText.pop(); toLine-- }
- else if (newText[0] == oldText[0]) { newText.shift(); oldText.shift(); fromLine++ }
- else { break }
- }
-
- var cutFront = 0, cutEnd = 0
- var newTop = newText[0], oldTop = oldText[0], maxCutFront = Math.min(newTop.length, oldTop.length)
- while (cutFront < maxCutFront && newTop.charCodeAt(cutFront) == oldTop.charCodeAt(cutFront))
- { ++cutFront }
- var newBot = lst(newText), oldBot = lst(oldText)
- var maxCutEnd = Math.min(newBot.length - (newText.length == 1 ? cutFront : 0),
- oldBot.length - (oldText.length == 1 ? cutFront : 0))
- while (cutEnd < maxCutEnd &&
- newBot.charCodeAt(newBot.length - cutEnd - 1) == oldBot.charCodeAt(oldBot.length - cutEnd - 1))
- { ++cutEnd }
-
- newText[newText.length - 1] = newBot.slice(0, newBot.length - cutEnd).replace(/^\u200b+/, "")
- newText[0] = newText[0].slice(cutFront).replace(/\u200b+$/, "")
-
- var chFrom = Pos(fromLine, cutFront)
- var chTo = Pos(toLine, oldText.length ? lst(oldText).length - cutEnd : 0)
- if (newText.length > 1 || newText[0] || cmp(chFrom, chTo)) {
- replaceRange(cm.doc, newText, chFrom, chTo, "+input")
- return true
- }
-};
-
-ContentEditableInput.prototype.ensurePolled = function () {
- this.forceCompositionEnd()
-};
-ContentEditableInput.prototype.reset = function () {
- this.forceCompositionEnd()
-};
-ContentEditableInput.prototype.forceCompositionEnd = function () {
- if (!this.composing) { return }
- clearTimeout(this.readDOMTimeout)
- this.composing = null
- if (!this.pollContent()) { regChange(this.cm) }
- this.div.blur()
- this.div.focus()
-};
-ContentEditableInput.prototype.readFromDOMSoon = function () {
- var this$1 = this;
-
- if (this.readDOMTimeout != null) { return }
- this.readDOMTimeout = setTimeout(function () {
- this$1.readDOMTimeout = null
- if (this$1.composing) {
- if (this$1.composing.done) { this$1.composing = null }
- else { return }
- }
- if (this$1.cm.isReadOnly() || !this$1.pollContent())
- { runInOp(this$1.cm, function () { return regChange(this$1.cm); }) }
- }, 80)
-};
-
-ContentEditableInput.prototype.setUneditable = function (node) {
- node.contentEditable = "false"
-};
-
-ContentEditableInput.prototype.onKeyPress = function (e) {
- if (e.charCode == 0) { return }
- e.preventDefault()
- if (!this.cm.isReadOnly())
- { operation(this.cm, applyTextInput)(this.cm, String.fromCharCode(e.charCode == null ? e.keyCode : e.charCode), 0) }
-};
-
-ContentEditableInput.prototype.readOnlyChanged = function (val) {
- this.div.contentEditable = String(val != "nocursor")
-};
-
-ContentEditableInput.prototype.onContextMenu = function () {};
-ContentEditableInput.prototype.resetPosition = function () {};
-
-ContentEditableInput.prototype.needsContentAttribute = true
-
-function posToDOM(cm, pos) {
- var view = findViewForLine(cm, pos.line)
- if (!view || view.hidden) { return null }
- var line = getLine(cm.doc, pos.line)
- var info = mapFromLineView(view, line, pos.line)
-
- var order = getOrder(line), side = "left"
- if (order) {
- var partPos = getBidiPartAt(order, pos.ch)
- side = partPos % 2 ? "right" : "left"
- }
- var result = nodeAndOffsetInLineMap(info.map, pos.ch, side)
- result.offset = result.collapse == "right" ? result.end : result.start
- return result
-}
-
-function badPos(pos, bad) { if (bad) { pos.bad = true; } return pos }
-
-function domTextBetween(cm, from, to, fromLine, toLine) {
- var text = "", closing = false, lineSep = cm.doc.lineSeparator()
- function recognizeMarker(id) { return function (marker) { return marker.id == id; } }
- function walk(node) {
- if (node.nodeType == 1) {
- var cmText = node.getAttribute("cm-text")
- if (cmText != null) {
- if (cmText == "") { text += node.textContent.replace(/\u200b/g, "") }
- else { text += cmText }
- return
- }
- var markerID = node.getAttribute("cm-marker"), range
- if (markerID) {
- var found = cm.findMarks(Pos(fromLine, 0), Pos(toLine + 1, 0), recognizeMarker(+markerID))
- if (found.length && (range = found[0].find()))
- { text += getBetween(cm.doc, range.from, range.to).join(lineSep) }
- return
- }
- if (node.getAttribute("contenteditable") == "false") { return }
- for (var i = 0; i < node.childNodes.length; i++)
- { walk(node.childNodes[i]) }
- if (/^(pre|div|p)$/i.test(node.nodeName))
- { closing = true }
- } else if (node.nodeType == 3) {
- var val = node.nodeValue
- if (!val) { return }
- if (closing) {
- text += lineSep
- closing = false
- }
- text += val
- }
- }
- for (;;) {
- walk(from)
- if (from == to) { break }
- from = from.nextSibling
- }
- return text
-}
-
-function domToPos(cm, node, offset) {
- var lineNode
- if (node == cm.display.lineDiv) {
- lineNode = cm.display.lineDiv.childNodes[offset]
- if (!lineNode) { return badPos(cm.clipPos(Pos(cm.display.viewTo - 1)), true) }
- node = null; offset = 0
- } else {
- for (lineNode = node;; lineNode = lineNode.parentNode) {
- if (!lineNode || lineNode == cm.display.lineDiv) { return null }
- if (lineNode.parentNode && lineNode.parentNode == cm.display.lineDiv) { break }
- }
- }
- for (var i = 0; i < cm.display.view.length; i++) {
- var lineView = cm.display.view[i]
- if (lineView.node == lineNode)
- { return locateNodeInLineView(lineView, node, offset) }
- }
-}
-
-function locateNodeInLineView(lineView, node, offset) {
- var wrapper = lineView.text.firstChild, bad = false
- if (!node || !contains(wrapper, node)) { return badPos(Pos(lineNo(lineView.line), 0), true) }
- if (node == wrapper) {
- bad = true
- node = wrapper.childNodes[offset]
- offset = 0
- if (!node) {
- var line = lineView.rest ? lst(lineView.rest) : lineView.line
- return badPos(Pos(lineNo(line), line.text.length), bad)
- }
- }
-
- var textNode = node.nodeType == 3 ? node : null, topNode = node
- if (!textNode && node.childNodes.length == 1 && node.firstChild.nodeType == 3) {
- textNode = node.firstChild
- if (offset) { offset = textNode.nodeValue.length }
- }
- while (topNode.parentNode != wrapper) { topNode = topNode.parentNode }
- var measure = lineView.measure, maps = measure.maps
-
- function find(textNode, topNode, offset) {
- for (var i = -1; i < (maps ? maps.length : 0); i++) {
- var map = i < 0 ? measure.map : maps[i]
- for (var j = 0; j < map.length; j += 3) {
- var curNode = map[j + 2]
- if (curNode == textNode || curNode == topNode) {
- var line = lineNo(i < 0 ? lineView.line : lineView.rest[i])
- var ch = map[j] + offset
- if (offset < 0 || curNode != textNode) { ch = map[j + (offset ? 1 : 0)] }
- return Pos(line, ch)
- }
- }
- }
- }
- var found = find(textNode, topNode, offset)
- if (found) { return badPos(found, bad) }
-
- // FIXME this is all really shaky. might handle the few cases it needs to handle, but likely to cause problems
- for (var after = topNode.nextSibling, dist = textNode ? textNode.nodeValue.length - offset : 0; after; after = after.nextSibling) {
- found = find(after, after.firstChild, 0)
- if (found)
- { return badPos(Pos(found.line, found.ch - dist), bad) }
- else
- { dist += after.textContent.length }
- }
- for (var before = topNode.previousSibling, dist$1 = offset; before; before = before.previousSibling) {
- found = find(before, before.firstChild, -1)
- if (found)
- { return badPos(Pos(found.line, found.ch + dist$1), bad) }
- else
- { dist$1 += before.textContent.length }
- }
-}
-
-// TEXTAREA INPUT STYLE
-
-var TextareaInput = function(cm) {
- this.cm = cm
- // See input.poll and input.reset
- this.prevInput = ""
-
- // Flag that indicates whether we expect input to appear real soon
- // now (after some event like 'keypress' or 'input') and are
- // polling intensively.
- this.pollingFast = false
- // Self-resetting timeout for the poller
- this.polling = new Delayed()
- // Tracks when input.reset has punted to just putting a short
- // string into the textarea instead of the full selection.
- this.inaccurateSelection = false
- // Used to work around IE issue with selection being forgotten when focus moves away from textarea
- this.hasSelection = false
- this.composing = null
-};
-
-TextareaInput.prototype.init = function (display) {
- var this$1 = this;
-
- var input = this, cm = this.cm
-
- // Wraps and hides input textarea
- var div = this.wrapper = hiddenTextarea()
- // The semihidden textarea that is focused when the editor is
- // focused, and receives input.
- var te = this.textarea = div.firstChild
- display.wrapper.insertBefore(div, display.wrapper.firstChild)
-
- // Needed to hide big blue blinking cursor on Mobile Safari (doesn't seem to work in iOS 8 anymore)
- if (ios) { te.style.width = "0px" }
-
- on(te, "input", function () {
- if (ie && ie_version >= 9 && this$1.hasSelection) { this$1.hasSelection = null }
- input.poll()
- })
-
- on(te, "paste", function (e) {
- if (signalDOMEvent(cm, e) || handlePaste(e, cm)) { return }
-
- cm.state.pasteIncoming = true
- input.fastPoll()
- })
-
- function prepareCopyCut(e) {
- if (signalDOMEvent(cm, e)) { return }
- if (cm.somethingSelected()) {
- setLastCopied({lineWise: false, text: cm.getSelections()})
- if (input.inaccurateSelection) {
- input.prevInput = ""
- input.inaccurateSelection = false
- te.value = lastCopied.text.join("\n")
- selectInput(te)
- }
- } else if (!cm.options.lineWiseCopyCut) {
- return
- } else {
- var ranges = copyableRanges(cm)
- setLastCopied({lineWise: true, text: ranges.text})
- if (e.type == "cut") {
- cm.setSelections(ranges.ranges, null, sel_dontScroll)
- } else {
- input.prevInput = ""
- te.value = ranges.text.join("\n")
- selectInput(te)
- }
- }
- if (e.type == "cut") { cm.state.cutIncoming = true }
- }
- on(te, "cut", prepareCopyCut)
- on(te, "copy", prepareCopyCut)
-
- on(display.scroller, "paste", function (e) {
- if (eventInWidget(display, e) || signalDOMEvent(cm, e)) { return }
- cm.state.pasteIncoming = true
- input.focus()
- })
-
- // Prevent normal selection in the editor (we handle our own)
- on(display.lineSpace, "selectstart", function (e) {
- if (!eventInWidget(display, e)) { e_preventDefault(e) }
- })
-
- on(te, "compositionstart", function () {
- var start = cm.getCursor("from")
- if (input.composing) { input.composing.range.clear() }
- input.composing = {
- start: start,
- range: cm.markText(start, cm.getCursor("to"), {className: "CodeMirror-composing"})
- }
- })
- on(te, "compositionend", function () {
- if (input.composing) {
- input.poll()
- input.composing.range.clear()
- input.composing = null
- }
- })
-};
-
-TextareaInput.prototype.prepareSelection = function () {
- // Redraw the selection and/or cursor
- var cm = this.cm, display = cm.display, doc = cm.doc
- var result = prepareSelection(cm)
-
- // Move the hidden textarea near the cursor to prevent scrolling artifacts
- if (cm.options.moveInputWithCursor) {
- var headPos = cursorCoords(cm, doc.sel.primary().head, "div")
- var wrapOff = display.wrapper.getBoundingClientRect(), lineOff = display.lineDiv.getBoundingClientRect()
- result.teTop = Math.max(0, Math.min(display.wrapper.clientHeight - 10,
- headPos.top + lineOff.top - wrapOff.top))
- result.teLeft = Math.max(0, Math.min(display.wrapper.clientWidth - 10,
- headPos.left + lineOff.left - wrapOff.left))
- }
-
- return result
-};
-
-TextareaInput.prototype.showSelection = function (drawn) {
- var cm = this.cm, display = cm.display
- removeChildrenAndAdd(display.cursorDiv, drawn.cursors)
- removeChildrenAndAdd(display.selectionDiv, drawn.selection)
- if (drawn.teTop != null) {
- this.wrapper.style.top = drawn.teTop + "px"
- this.wrapper.style.left = drawn.teLeft + "px"
- }
-};
-
-// Reset the input to correspond to the selection (or to be empty,
-// when not typing and nothing is selected)
-TextareaInput.prototype.reset = function (typing) {
- if (this.contextMenuPending) { return }
- var minimal, selected, cm = this.cm, doc = cm.doc
- if (cm.somethingSelected()) {
- this.prevInput = ""
- var range = doc.sel.primary()
- minimal = hasCopyEvent &&
- (range.to().line - range.from().line > 100 || (selected = cm.getSelection()).length > 1000)
- var content = minimal ? "-" : selected || cm.getSelection()
- this.textarea.value = content
- if (cm.state.focused) { selectInput(this.textarea) }
- if (ie && ie_version >= 9) { this.hasSelection = content }
- } else if (!typing) {
- this.prevInput = this.textarea.value = ""
- if (ie && ie_version >= 9) { this.hasSelection = null }
- }
- this.inaccurateSelection = minimal
-};
-
-TextareaInput.prototype.getField = function () { return this.textarea };
-
-TextareaInput.prototype.supportsTouch = function () { return false };
-
-TextareaInput.prototype.focus = function () {
- if (this.cm.options.readOnly != "nocursor" && (!mobile || activeElt() != this.textarea)) {
- try { this.textarea.focus() }
- catch (e) {} // IE8 will throw if the textarea is display: none or not in DOM
- }
-};
-
-TextareaInput.prototype.blur = function () { this.textarea.blur() };
-
-TextareaInput.prototype.resetPosition = function () {
- this.wrapper.style.top = this.wrapper.style.left = 0
-};
-
-TextareaInput.prototype.receivedFocus = function () { this.slowPoll() };
-
-// Poll for input changes, using the normal rate of polling. This
-// runs as long as the editor is focused.
-TextareaInput.prototype.slowPoll = function () {
- var this$1 = this;
-
- if (this.pollingFast) { return }
- this.polling.set(this.cm.options.pollInterval, function () {
- this$1.poll()
- if (this$1.cm.state.focused) { this$1.slowPoll() }
- })
-};
-
-// When an event has just come in that is likely to add or change
-// something in the input textarea, we poll faster, to ensure that
-// the change appears on the screen quickly.
-TextareaInput.prototype.fastPoll = function () {
- var missed = false, input = this
- input.pollingFast = true
- function p() {
- var changed = input.poll()
- if (!changed && !missed) {missed = true; input.polling.set(60, p)}
- else {input.pollingFast = false; input.slowPoll()}
- }
- input.polling.set(20, p)
-};
-
-// Read input from the textarea, and update the document to match.
-// When something is selected, it is present in the textarea, and
-// selected (unless it is huge, in which case a placeholder is
-// used). When nothing is selected, the cursor sits after previously
-// seen text (can be empty), which is stored in prevInput (we must
-// not reset the textarea when typing, because that breaks IME).
-TextareaInput.prototype.poll = function () {
- var this$1 = this;
-
- var cm = this.cm, input = this.textarea, prevInput = this.prevInput
- // Since this is called a *lot*, try to bail out as cheaply as
- // possible when it is clear that nothing happened. hasSelection
- // will be the case when there is a lot of text in the textarea,
- // in which case reading its value would be expensive.
- if (this.contextMenuPending || !cm.state.focused ||
- (hasSelection(input) && !prevInput && !this.composing) ||
- cm.isReadOnly() || cm.options.disableInput || cm.state.keySeq)
- { return false }
-
- var text = input.value
- // If nothing changed, bail.
- if (text == prevInput && !cm.somethingSelected()) { return false }
- // Work around nonsensical selection resetting in IE9/10, and
- // inexplicable appearance of private area unicode characters on
- // some key combos in Mac (#2689).
- if (ie && ie_version >= 9 && this.hasSelection === text ||
- mac && /[\uf700-\uf7ff]/.test(text)) {
- cm.display.input.reset()
- return false
- }
-
- if (cm.doc.sel == cm.display.selForContextMenu) {
- var first = text.charCodeAt(0)
- if (first == 0x200b && !prevInput) { prevInput = "\u200b" }
- if (first == 0x21da) { this.reset(); return this.cm.execCommand("undo") }
- }
- // Find the part of the input that is actually new
- var same = 0, l = Math.min(prevInput.length, text.length)
- while (same < l && prevInput.charCodeAt(same) == text.charCodeAt(same)) { ++same }
-
- runInOp(cm, function () {
- applyTextInput(cm, text.slice(same), prevInput.length - same,
- null, this$1.composing ? "*compose" : null)
-
- // Don't leave long text in the textarea, since it makes further polling slow
- if (text.length > 1000 || text.indexOf("\n") > -1) { input.value = this$1.prevInput = "" }
- else { this$1.prevInput = text }
-
- if (this$1.composing) {
- this$1.composing.range.clear()
- this$1.composing.range = cm.markText(this$1.composing.start, cm.getCursor("to"),
- {className: "CodeMirror-composing"})
- }
- })
- return true
-};
-
-TextareaInput.prototype.ensurePolled = function () {
- if (this.pollingFast && this.poll()) { this.pollingFast = false }
-};
-
-TextareaInput.prototype.onKeyPress = function () {
- if (ie && ie_version >= 9) { this.hasSelection = null }
- this.fastPoll()
-};
-
-TextareaInput.prototype.onContextMenu = function (e) {
- var input = this, cm = input.cm, display = cm.display, te = input.textarea
- var pos = posFromMouse(cm, e), scrollPos = display.scroller.scrollTop
- if (!pos || presto) { return } // Opera is difficult.
-
- // Reset the current text selection only if the click is done outside of the selection
- // and 'resetSelectionOnContextMenu' option is true.
- var reset = cm.options.resetSelectionOnContextMenu
- if (reset && cm.doc.sel.contains(pos) == -1)
- { operation(cm, setSelection)(cm.doc, simpleSelection(pos), sel_dontScroll) }
-
- var oldCSS = te.style.cssText, oldWrapperCSS = input.wrapper.style.cssText
- input.wrapper.style.cssText = "position: absolute"
- var wrapperBox = input.wrapper.getBoundingClientRect()
- te.style.cssText = "position: absolute; width: 30px; height: 30px;\n top: " + (e.clientY - wrapperBox.top - 5) + "px; left: " + (e.clientX - wrapperBox.left - 5) + "px;\n z-index: 1000; background: " + (ie ? "rgba(255, 255, 255, .05)" : "transparent") + ";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);"
- var oldScrollY
- if (webkit) { oldScrollY = window.scrollY } // Work around Chrome issue (#2712)
- display.input.focus()
- if (webkit) { window.scrollTo(null, oldScrollY) }
- display.input.reset()
- // Adds "Select all" to context menu in FF
- if (!cm.somethingSelected()) { te.value = input.prevInput = " " }
- input.contextMenuPending = true
- display.selForContextMenu = cm.doc.sel
- clearTimeout(display.detectingSelectAll)
-
- // Select-all will be greyed out if there's nothing to select, so
- // this adds a zero-width space so that we can later check whether
- // it got selected.
- function prepareSelectAllHack() {
- if (te.selectionStart != null) {
- var selected = cm.somethingSelected()
- var extval = "\u200b" + (selected ? te.value : "")
- te.value = "\u21da" // Used to catch context-menu undo
- te.value = extval
- input.prevInput = selected ? "" : "\u200b"
- te.selectionStart = 1; te.selectionEnd = extval.length
- // Re-set this, in case some other handler touched the
- // selection in the meantime.
- display.selForContextMenu = cm.doc.sel
- }
- }
- function rehide() {
- input.contextMenuPending = false
- input.wrapper.style.cssText = oldWrapperCSS
- te.style.cssText = oldCSS
- if (ie && ie_version < 9) { display.scrollbars.setScrollTop(display.scroller.scrollTop = scrollPos) }
-
- // Try to detect the user choosing select-all
- if (te.selectionStart != null) {
- if (!ie || (ie && ie_version < 9)) { prepareSelectAllHack() }
- var i = 0, poll = function () {
- if (display.selForContextMenu == cm.doc.sel && te.selectionStart == 0 &&
- te.selectionEnd > 0 && input.prevInput == "\u200b") {
- operation(cm, selectAll)(cm)
- } else if (i++ < 10) {
- display.detectingSelectAll = setTimeout(poll, 500)
- } else {
- display.selForContextMenu = null
- display.input.reset()
- }
- }
- display.detectingSelectAll = setTimeout(poll, 200)
- }
- }
-
- if (ie && ie_version >= 9) { prepareSelectAllHack() }
- if (captureRightClick) {
- e_stop(e)
- var mouseup = function () {
- off(window, "mouseup", mouseup)
- setTimeout(rehide, 20)
- }
- on(window, "mouseup", mouseup)
- } else {
- setTimeout(rehide, 50)
- }
-};
-
-TextareaInput.prototype.readOnlyChanged = function (val) {
- if (!val) { this.reset() }
-};
-
-TextareaInput.prototype.setUneditable = function () {};
-
-TextareaInput.prototype.needsContentAttribute = false
-
-function fromTextArea(textarea, options) {
- options = options ? copyObj(options) : {}
- options.value = textarea.value
- if (!options.tabindex && textarea.tabIndex)
- { options.tabindex = textarea.tabIndex }
- if (!options.placeholder && textarea.placeholder)
- { options.placeholder = textarea.placeholder }
- // Set autofocus to true if this textarea is focused, or if it has
- // autofocus and no other element is focused.
- if (options.autofocus == null) {
- var hasFocus = activeElt()
- options.autofocus = hasFocus == textarea ||
- textarea.getAttribute("autofocus") != null && hasFocus == document.body
- }
-
- function save() {textarea.value = cm.getValue()}
-
- var realSubmit
- if (textarea.form) {
- on(textarea.form, "submit", save)
- // Deplorable hack to make the submit method do the right thing.
- if (!options.leaveSubmitMethodAlone) {
- var form = textarea.form
- realSubmit = form.submit
- try {
- var wrappedSubmit = form.submit = function () {
- save()
- form.submit = realSubmit
- form.submit()
- form.submit = wrappedSubmit
- }
- } catch(e) {}
- }
- }
-
- options.finishInit = function (cm) {
- cm.save = save
- cm.getTextArea = function () { return textarea; }
- cm.toTextArea = function () {
- cm.toTextArea = isNaN // Prevent this from being ran twice
- save()
- textarea.parentNode.removeChild(cm.getWrapperElement())
- textarea.style.display = ""
- if (textarea.form) {
- off(textarea.form, "submit", save)
- if (typeof textarea.form.submit == "function")
- { textarea.form.submit = realSubmit }
- }
- }
- }
-
- textarea.style.display = "none"
- var cm = CodeMirror(function (node) { return textarea.parentNode.insertBefore(node, textarea.nextSibling); },
- options)
- return cm
-}
-
-function addLegacyProps(CodeMirror) {
- CodeMirror.off = off
- CodeMirror.on = on
- CodeMirror.wheelEventPixels = wheelEventPixels
- CodeMirror.Doc = Doc
- CodeMirror.splitLines = splitLinesAuto
- CodeMirror.countColumn = countColumn
- CodeMirror.findColumn = findColumn
- CodeMirror.isWordChar = isWordCharBasic
- CodeMirror.Pass = Pass
- CodeMirror.signal = signal
- CodeMirror.Line = Line
- CodeMirror.changeEnd = changeEnd
- CodeMirror.scrollbarModel = scrollbarModel
- CodeMirror.Pos = Pos
- CodeMirror.cmpPos = cmp
- CodeMirror.modes = modes
- CodeMirror.mimeModes = mimeModes
- CodeMirror.resolveMode = resolveMode
- CodeMirror.getMode = getMode
- CodeMirror.modeExtensions = modeExtensions
- CodeMirror.extendMode = extendMode
- CodeMirror.copyState = copyState
- CodeMirror.startState = startState
- CodeMirror.innerMode = innerMode
- CodeMirror.commands = commands
- CodeMirror.keyMap = keyMap
- CodeMirror.keyName = keyName
- CodeMirror.isModifierKey = isModifierKey
- CodeMirror.lookupKey = lookupKey
- CodeMirror.normalizeKeyMap = normalizeKeyMap
- CodeMirror.StringStream = StringStream
- CodeMirror.SharedTextMarker = SharedTextMarker
- CodeMirror.TextMarker = TextMarker
- CodeMirror.LineWidget = LineWidget
- CodeMirror.e_preventDefault = e_preventDefault
- CodeMirror.e_stopPropagation = e_stopPropagation
- CodeMirror.e_stop = e_stop
- CodeMirror.addClass = addClass
- CodeMirror.contains = contains
- CodeMirror.rmClass = rmClass
- CodeMirror.keyNames = keyNames
-}
-
-// EDITOR CONSTRUCTOR
-
-defineOptions(CodeMirror)
-
-addEditorMethods(CodeMirror)
-
-// Set up methods on CodeMirror's prototype to redirect to the editor's document.
-var dontDelegate = "iter insert remove copy getEditor constructor".split(" ")
-for (var prop in Doc.prototype) { if (Doc.prototype.hasOwnProperty(prop) && indexOf(dontDelegate, prop) < 0)
- { CodeMirror.prototype[prop] = (function(method) {
- return function() {return method.apply(this.doc, arguments)}
- })(Doc.prototype[prop]) } }
-
-eventMixin(Doc)
-
-// INPUT HANDLING
-
-CodeMirror.inputStyles = {"textarea": TextareaInput, "contenteditable": ContentEditableInput}
-
-// MODE DEFINITION AND QUERYING
-
-// Extra arguments are stored as the mode's dependencies, which is
-// used by (legacy) mechanisms like loadmode.js to automatically
-// load a mode. (Preferred mechanism is the require/define calls.)
-CodeMirror.defineMode = function(name/*, mode, …*/) {
- if (!CodeMirror.defaults.mode && name != "null") { CodeMirror.defaults.mode = name }
- defineMode.apply(this, arguments)
-}
-
-CodeMirror.defineMIME = defineMIME
-
-// Minimal default mode.
-CodeMirror.defineMode("null", function () { return ({token: function (stream) { return stream.skipToEnd(); }}); })
-CodeMirror.defineMIME("text/plain", "null")
-
-// EXTENSIONS
-
-CodeMirror.defineExtension = function (name, func) {
- CodeMirror.prototype[name] = func
-}
-CodeMirror.defineDocExtension = function (name, func) {
- Doc.prototype[name] = func
-}
-
-CodeMirror.fromTextArea = fromTextArea
-
-addLegacyProps(CodeMirror)
-
-CodeMirror.version = "5.24.0"
-
-return CodeMirror;
-
-})));
},{}],2:[function(require,module,exports){
-(function (global){
-/*!
- * deep-diff.
- * Licensed under the MIT License.
- */
-;(function(root, factory) {
- 'use strict';
- if (typeof define === 'function' && define.amd) {
- // AMD. Register as an anonymous module.
- define([], function() {
- return factory();
- });
- } else if (typeof exports === 'object') {
- // Node. Does not work with strict CommonJS, but
- // only CommonJS-like environments that support module.exports,
- // like Node.
- module.exports = factory();
- } else {
- // Browser globals (root is window)
- root.DeepDiff = factory();
- }
-}(this, function(undefined) {
- 'use strict';
-
- var $scope, conflict, conflictResolution = [];
- if (typeof global === 'object' && global) {
- $scope = global;
- } else if (typeof window !== 'undefined') {
- $scope = window;
- } else {
- $scope = {};
- }
- conflict = $scope.DeepDiff;
- if (conflict) {
- conflictResolution.push(
- function() {
- if ('undefined' !== typeof conflict && $scope.DeepDiff === accumulateDiff) {
- $scope.DeepDiff = conflict;
- conflict = undefined;
- }
- });
- }
-
- // nodejs compatible on server side and in the browser.
- function inherits(ctor, superCtor) {
- ctor.super_ = superCtor;
- ctor.prototype = Object.create(superCtor.prototype, {
- constructor: {
- value: ctor,
- enumerable: false,
- writable: true,
- configurable: true
- }
- });
- }
-
- function Diff(kind, path) {
- Object.defineProperty(this, 'kind', {
- value: kind,
- enumerable: true
- });
- if (path && path.length) {
- Object.defineProperty(this, 'path', {
- value: path,
- enumerable: true
- });
- }
- }
-
- function DiffEdit(path, origin, value) {
- DiffEdit.super_.call(this, 'E', path);
- Object.defineProperty(this, 'lhs', {
- value: origin,
- enumerable: true
- });
- Object.defineProperty(this, 'rhs', {
- value: value,
- enumerable: true
- });
- }
- inherits(DiffEdit, Diff);
-
- function DiffNew(path, value) {
- DiffNew.super_.call(this, 'N', path);
- Object.defineProperty(this, 'rhs', {
- value: value,
- enumerable: true
- });
- }
- inherits(DiffNew, Diff);
+"use strict";function identity(t){return t}function factory(t,e,n){function o(t,e){var n=y.hasOwnProperty(e)?y[e]:null;_.hasOwnProperty(e)&&_invariant("OVERRIDE_BASE"===n,"ReactClassInterface: You are attempting to override `%s` from your class specification. Ensure that your method names do not overlap with React methods.",e),t&&_invariant("DEFINE_MANY"===n||"DEFINE_MANY_MERGED"===n,"ReactClassInterface: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",e)}function i(t,n){if(n){_invariant("function"!=typeof n,"ReactClass: You're attempting to use a component class or function as a mixin. Instead, just use a regular object."),_invariant(!e(n),"ReactClass: You're attempting to use a component as a mixin. Instead, just use a regular object.");var i=t.prototype,a=i.__reactAutoBindPairs;n.hasOwnProperty(MIXINS_KEY)&&E.mixins(t,n.mixins);for(var r in n)if(n.hasOwnProperty(r)&&r!==MIXINS_KEY){var c=n[r],u=i.hasOwnProperty(r);if(o(u,r),E.hasOwnProperty(r))E[r](t,c);else{var l=y.hasOwnProperty(r),f="function"==typeof c,m=f&&!l&&!u&&n.autobind!==!1;if(m)a.push(r,c),i[r]=c;else if(u){var _=y[r];_invariant(l&&("DEFINE_MANY_MERGED"===_||"DEFINE_MANY"===_),"ReactClass: Unexpected spec policy %s for key %s when mixing in component specs.",_,r),"DEFINE_MANY_MERGED"===_?i[r]=s(i[r],c):"DEFINE_MANY"===_&&(i[r]=p(i[r],c))}else i[r]=c}}}else;}function a(t,e){if(e)for(var n in e){var o=e[n];if(e.hasOwnProperty(n)){var i=n in E;_invariant(!i,'ReactClass: You are attempting to define a reserved property, `%s`, that shouldn\'t be on the "statics" key. Define it as an instance property instead; it will still be accessible on the constructor.',n);var a=n in t;_invariant(!a,"ReactClass: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",n),t[n]=o}}}function r(t,e){_invariant(t&&e&&"object"==typeof t&&"object"==typeof e,"mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.");for(var n in e)e.hasOwnProperty(n)&&(_invariant(void 0===t[n],"mergeIntoWithNoDuplicateKeys(): Tried to merge two objects with the same key: `%s`. This conflict may be due to a mixin; in particular, this may be caused by two getInitialState() or getDefaultProps() methods returning objects with clashing keys.",n),t[n]=e[n]);return t}function s(t,e){return function(){var n=t.apply(this,arguments),o=e.apply(this,arguments);if(null==n)return o;if(null==o)return n;var i={};return r(i,n),r(i,o),i}}function p(t,e){return function(){t.apply(this,arguments),e.apply(this,arguments)}}function c(t,e){var n=e.bind(t);return n}function u(t){for(var e=t.__reactAutoBindPairs,n=0;n<e.length;n+=2){var o=e[n],i=e[n+1];t[o]=c(t,i)}}function l(t){var e=identity(function(t,o,i){this.__reactAutoBindPairs.length&&u(this),this.props=t,this.context=o,this.refs=emptyObject,this.updater=i||n,this.state=null;var a=this.getInitialState?this.getInitialState():null;_invariant("object"==typeof a&&!Array.isArray(a),"%s.getInitialState(): must return an object or null",e.displayName||"ReactCompositeComponent"),this.state=a});e.prototype=new h,e.prototype.constructor=e,e.prototype.__reactAutoBindPairs=[],f.forEach(i.bind(null,e)),i(e,m),i(e,t),e.getDefaultProps&&(e.defaultProps=e.getDefaultProps()),_invariant(e.prototype.render,"createClass(...): Class specification must implement a `render` method.");for(var o in y)e.prototype[o]||(e.prototype[o]=null);return e}var f=[],y={mixins:"DEFINE_MANY",statics:"DEFINE_MANY",propTypes:"DEFINE_MANY",contextTypes:"DEFINE_MANY",childContextTypes:"DEFINE_MANY",getDefaultProps:"DEFINE_MANY_MERGED",getInitialState:"DEFINE_MANY_MERGED",getChildContext:"DEFINE_MANY_MERGED",render:"DEFINE_ONCE",componentWillMount:"DEFINE_MANY",componentDidMount:"DEFINE_MANY",componentWillReceiveProps:"DEFINE_MANY",shouldComponentUpdate:"DEFINE_ONCE",componentWillUpdate:"DEFINE_MANY",componentDidUpdate:"DEFINE_MANY",componentWillUnmount:"DEFINE_MANY",updateComponent:"OVERRIDE_BASE"},E={displayName:function(t,e){t.displayName=e},mixins:function(t,e){if(e)for(var n=0;n<e.length;n++)i(t,e[n])},childContextTypes:function(t,e){t.childContextTypes=_assign({},t.childContextTypes,e)},contextTypes:function(t,e){t.contextTypes=_assign({},t.contextTypes,e)},getDefaultProps:function(t,e){t.getDefaultProps?t.getDefaultProps=s(t.getDefaultProps,e):t.getDefaultProps=e},propTypes:function(t,e){t.propTypes=_assign({},t.propTypes,e)},statics:function(t,e){a(t,e)},autobind:function(){}},m={componentDidMount:function(){this.__isMounted=!0},componentWillUnmount:function(){this.__isMounted=!1}},_={replaceState:function(t,e){this.updater.enqueueReplaceState(this,t,e)},isMounted:function(){return!!this.__isMounted}},h=function(){};return _assign(h.prototype,t.prototype,_),l}var _assign=require("object-assign"),emptyObject=require("fbjs/lib/emptyObject"),_invariant=require("fbjs/lib/invariant"),warning,MIXINS_KEY="mixins",ReactPropTypeLocationNames;ReactPropTypeLocationNames={},module.exports=factory;
- function DiffDeleted(path, value) {
- DiffDeleted.super_.call(this, 'D', path);
- Object.defineProperty(this, 'lhs', {
- value: value,
- enumerable: true
- });
- }
- inherits(DiffDeleted, Diff);
+},{"fbjs/lib/emptyObject":8,"fbjs/lib/invariant":11,"object-assign":33}],3:[function(require,module,exports){
+"use strict";var React=require("react"),factory=require("./factory"),ReactNoopUpdateQueue=(new React.Component).updater;module.exports=factory(React.Component,React.isValidElement,ReactNoopUpdateQueue);
- function DiffArray(path, index, item) {
- DiffArray.super_.call(this, 'A', path);
- Object.defineProperty(this, 'index', {
- value: index,
- enumerable: true
- });
- Object.defineProperty(this, 'item', {
- value: item,
- enumerable: true
- });
- }
- inherits(DiffArray, Diff);
+},{"./factory":2,"react":"react"}],4:[function(require,module,exports){
+"use strict";var emptyFunction=require("./emptyFunction"),EventListener={listen:function(e,t,n){return e.addEventListener?(e.addEventListener(t,n,!1),{remove:function(){e.removeEventListener(t,n,!1)}}):e.attachEvent?(e.attachEvent("on"+t,n),{remove:function(){e.detachEvent("on"+t,n)}}):void 0},capture:function(e,t,n){return e.addEventListener?(e.addEventListener(t,n,!0),{remove:function(){e.removeEventListener(t,n,!0)}}):{remove:emptyFunction}},registerDefault:function(){}};module.exports=EventListener;
- function arrayRemove(arr, from, to) {
- var rest = arr.slice((to || from) + 1 || arr.length);
- arr.length = from < 0 ? arr.length + from : from;
- arr.push.apply(arr, rest);
- return arr;
- }
+},{"./emptyFunction":7}],5:[function(require,module,exports){
+"use strict";var canUseDOM=!("undefined"==typeof window||!window.document||!window.document.createElement),ExecutionEnvironment={canUseDOM:canUseDOM,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:canUseDOM&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:canUseDOM&&!!window.screen,isInWorker:!canUseDOM};module.exports=ExecutionEnvironment;
- function realTypeOf(subject) {
- var type = typeof subject;
- if (type !== 'object') {
- return type;
- }
-
- if (subject === Math) {
- return 'math';
- } else if (subject === null) {
- return 'null';
- } else if (Array.isArray(subject)) {
- return 'array';
- } else if (Object.prototype.toString.call(subject) === '[object Date]') {
- return 'date';
- } else if (typeof subject.toString !== 'undefined' && /^\/.*\//.test(subject.toString())) {
- return 'regexp';
- }
- return 'object';
- }
-
- function deepDiff(lhs, rhs, changes, prefilter, path, key, stack) {
- path = path || [];
- var currentPath = path.slice(0);
- if (typeof key !== 'undefined') {
- if (prefilter) {
- if (typeof(prefilter) === 'function' && prefilter(currentPath, key)) { return; }
- else if (typeof(prefilter) === 'object') {
- if (prefilter.prefilter && prefilter.prefilter(currentPath, key)) { return; }
- if (prefilter.normalize) {
- var alt = prefilter.normalize(currentPath, key, lhs, rhs);
- if (alt) {
- lhs = alt[0];
- rhs = alt[1];
- }
- }
- }
- }
- currentPath.push(key);
- }
-
- // Use string comparison for regexes
- if (realTypeOf(lhs) === 'regexp' && realTypeOf(rhs) === 'regexp') {
- lhs = lhs.toString();
- rhs = rhs.toString();
- }
-
- var ltype = typeof lhs;
- var rtype = typeof rhs;
- if (ltype === 'undefined') {
- if (rtype !== 'undefined') {
- changes(new DiffNew(currentPath, rhs));
- }
- } else if (rtype === 'undefined') {
- changes(new DiffDeleted(currentPath, lhs));
- } else if (realTypeOf(lhs) !== realTypeOf(rhs)) {
- changes(new DiffEdit(currentPath, lhs, rhs));
- } else if (Object.prototype.toString.call(lhs) === '[object Date]' && Object.prototype.toString.call(rhs) === '[object Date]' && ((lhs - rhs) !== 0)) {
- changes(new DiffEdit(currentPath, lhs, rhs));
- } else if (ltype === 'object' && lhs !== null && rhs !== null) {
- stack = stack || [];
- if (stack.indexOf(lhs) < 0) {
- stack.push(lhs);
- if (Array.isArray(lhs)) {
- var i, len = lhs.length;
- for (i = 0; i < lhs.length; i++) {
- if (i >= rhs.length) {
- changes(new DiffArray(currentPath, i, new DiffDeleted(undefined, lhs[i])));
- } else {
- deepDiff(lhs[i], rhs[i], changes, prefilter, currentPath, i, stack);
- }
- }
- while (i < rhs.length) {
- changes(new DiffArray(currentPath, i, new DiffNew(undefined, rhs[i++])));
- }
- } else {
- var akeys = Object.keys(lhs);
- var pkeys = Object.keys(rhs);
- akeys.forEach(function(k, i) {
- var other = pkeys.indexOf(k);
- if (other >= 0) {
- deepDiff(lhs[k], rhs[k], changes, prefilter, currentPath, k, stack);
- pkeys = arrayRemove(pkeys, other);
- } else {
- deepDiff(lhs[k], undefined, changes, prefilter, currentPath, k, stack);
- }
- });
- pkeys.forEach(function(k) {
- deepDiff(undefined, rhs[k], changes, prefilter, currentPath, k, stack);
- });
- }
- stack.length = stack.length - 1;
- }
- } else if (lhs !== rhs) {
- if (!(ltype === 'number' && isNaN(lhs) && isNaN(rhs))) {
- changes(new DiffEdit(currentPath, lhs, rhs));
- }
- }
- }
-
- function accumulateDiff(lhs, rhs, prefilter, accum) {
- accum = accum || [];
- deepDiff(lhs, rhs,
- function(diff) {
- if (diff) {
- accum.push(diff);
- }
- },
- prefilter);
- return (accum.length) ? accum : undefined;
- }
-
- function applyArrayChange(arr, index, change) {
- if (change.path && change.path.length) {
- var it = arr[index],
- i, u = change.path.length - 1;
- for (i = 0; i < u; i++) {
- it = it[change.path[i]];
- }
- switch (change.kind) {
- case 'A':
- applyArrayChange(it[change.path[i]], change.index, change.item);
- break;
- case 'D':
- delete it[change.path[i]];
- break;
- case 'E':
- case 'N':
- it[change.path[i]] = change.rhs;
- break;
- }
- } else {
- switch (change.kind) {
- case 'A':
- applyArrayChange(arr[index], change.index, change.item);
- break;
- case 'D':
- arr = arrayRemove(arr, index);
- break;
- case 'E':
- case 'N':
- arr[index] = change.rhs;
- break;
- }
- }
- return arr;
- }
-
- function applyChange(target, source, change) {
- if (target && source && change && change.kind) {
- var it = target,
- i = -1,
- last = change.path ? change.path.length - 1 : 0;
- while (++i < last) {
- if (typeof it[change.path[i]] === 'undefined') {
- it[change.path[i]] = (typeof change.path[i] === 'number') ? [] : {};
- }
- it = it[change.path[i]];
- }
- switch (change.kind) {
- case 'A':
- applyArrayChange(change.path ? it[change.path[i]] : it, change.index, change.item);
- break;
- case 'D':
- delete it[change.path[i]];
- break;
- case 'E':
- case 'N':
- it[change.path[i]] = change.rhs;
- break;
- }
- }
- }
-
- function revertArrayChange(arr, index, change) {
- if (change.path && change.path.length) {
- // the structure of the object at the index has changed...
- var it = arr[index],
- i, u = change.path.length - 1;
- for (i = 0; i < u; i++) {
- it = it[change.path[i]];
- }
- switch (change.kind) {
- case 'A':
- revertArrayChange(it[change.path[i]], change.index, change.item);
- break;
- case 'D':
- it[change.path[i]] = change.lhs;
- break;
- case 'E':
- it[change.path[i]] = change.lhs;
- break;
- case 'N':
- delete it[change.path[i]];
- break;
- }
- } else {
- // the array item is different...
- switch (change.kind) {
- case 'A':
- revertArrayChange(arr[index], change.index, change.item);
- break;
- case 'D':
- arr[index] = change.lhs;
- break;
- case 'E':
- arr[index] = change.lhs;
- break;
- case 'N':
- arr = arrayRemove(arr, index);
- break;
- }
- }
- return arr;
- }
-
- function revertChange(target, source, change) {
- if (target && source && change && change.kind) {
- var it = target,
- i, u;
- u = change.path.length - 1;
- for (i = 0; i < u; i++) {
- if (typeof it[change.path[i]] === 'undefined') {
- it[change.path[i]] = {};
- }
- it = it[change.path[i]];
- }
- switch (change.kind) {
- case 'A':
- // Array was modified...
- // it will be an array...
- revertArrayChange(it[change.path[i]], change.index, change.item);
- break;
- case 'D':
- // Item was deleted...
- it[change.path[i]] = change.lhs;
- break;
- case 'E':
- // Item was edited...
- it[change.path[i]] = change.lhs;
- break;
- case 'N':
- // Item is new...
- delete it[change.path[i]];
- break;
- }
- }
- }
-
- function applyDiff(target, source, filter) {
- if (target && source) {
- var onChange = function(change) {
- if (!filter || filter(target, source, change)) {
- applyChange(target, source, change);
- }
- };
- deepDiff(target, source, onChange);
- }
- }
-
- Object.defineProperties(accumulateDiff, {
-
- diff: {
- value: accumulateDiff,
- enumerable: true
- },
- observableDiff: {
- value: deepDiff,
- enumerable: true
- },
- applyDiff: {
- value: applyDiff,
- enumerable: true
- },
- applyChange: {
- value: applyChange,
- enumerable: true
- },
- revertChange: {
- value: revertChange,
- enumerable: true
- },
- isConflict: {
- value: function() {
- return 'undefined' !== typeof conflict;
- },
- enumerable: true
- },
- noConflict: {
- value: function() {
- if (conflictResolution) {
- conflictResolution.forEach(function(it) {
- it();
- });
- conflictResolution = null;
- }
- return accumulateDiff;
- },
- enumerable: true
- }
- });
-
- return accumulateDiff;
-}));
-
-}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
-
-},{}],3:[function(require,module,exports){
-(function (process){
-'use strict';
-
-/**
- * Copyright (c) 2013-present, Facebook, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * @typechecks
- */
-
-var emptyFunction = require('./emptyFunction');
-
-/**
- * Upstream version of event listener. Does not take into account specific
- * nature of platform.
- */
-var EventListener = {
- /**
- * Listen to DOM events during the bubble phase.
- *
- * @param {DOMEventTarget} target DOM element to register listener on.
- * @param {string} eventType Event type, e.g. 'click' or 'mouseover'.
- * @param {function} callback Callback function.
- * @return {object} Object with a `remove` method.
- */
- listen: function listen(target, eventType, callback) {
- if (target.addEventListener) {
- target.addEventListener(eventType, callback, false);
- return {
- remove: function remove() {
- target.removeEventListener(eventType, callback, false);
- }
- };
- } else if (target.attachEvent) {
- target.attachEvent('on' + eventType, callback);
- return {
- remove: function remove() {
- target.detachEvent('on' + eventType, callback);
- }
- };
- }
- },
-
- /**
- * Listen to DOM events during the capture phase.
- *
- * @param {DOMEventTarget} target DOM element to register listener on.
- * @param {string} eventType Event type, e.g. 'click' or 'mouseover'.
- * @param {function} callback Callback function.
- * @return {object} Object with a `remove` method.
- */
- capture: function capture(target, eventType, callback) {
- if (target.addEventListener) {
- target.addEventListener(eventType, callback, true);
- return {
- remove: function remove() {
- target.removeEventListener(eventType, callback, true);
- }
- };
- } else {
- if (process.env.NODE_ENV !== 'production') {
- console.error('Attempted to listen to events during the capture phase on a ' + 'browser that does not support the capture phase. Your application ' + 'will not receive some events.');
- }
- return {
- remove: emptyFunction
- };
- }
- },
-
- registerDefault: function registerDefault() {}
-};
-
-module.exports = EventListener;
-}).call(this,require('_process'))
-
-},{"./emptyFunction":10,"_process":43}],4:[function(require,module,exports){
-/**
- * Copyright (c) 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-'use strict';
-
-var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);
-
-/**
- * Simple, lightweight module assisting with the detection and context of
- * Worker. Helps avoid circular dependencies and allows code to reason about
- * whether or not they are in a Worker, even if they never include the main
- * `ReactWorker` dependency.
- */
-var ExecutionEnvironment = {
-
- canUseDOM: canUseDOM,
-
- canUseWorkers: typeof Worker !== 'undefined',
-
- canUseEventListeners: canUseDOM && !!(window.addEventListener || window.attachEvent),
-
- canUseViewport: canUseDOM && !!window.screen,
-
- isInWorker: !canUseDOM // For now, this is true - might change in the future.
-
-};
-
-module.exports = ExecutionEnvironment;
-},{}],5:[function(require,module,exports){
-"use strict";
-
-/**
- * Copyright (c) 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- * @typechecks
- */
-
-var _hyphenPattern = /-(.)/g;
-
-/**
- * Camelcases a hyphenated string, for example:
- *
- * > camelize('background-color')
- * < "backgroundColor"
- *
- * @param {string} string
- * @return {string}
- */
-function camelize(string) {
- return string.replace(_hyphenPattern, function (_, character) {
- return character.toUpperCase();
- });
-}
-
-module.exports = camelize;
},{}],6:[function(require,module,exports){
-/**
- * Copyright (c) 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- * @typechecks
- */
-
-'use strict';
-
-var camelize = require('./camelize');
+"use strict";function containsNode(o,e){return!(!o||!e)&&(o===e||!isTextNode(o)&&(isTextNode(e)?containsNode(o,e.parentNode):"contains"in o?o.contains(e):!!o.compareDocumentPosition&&!!(16&o.compareDocumentPosition(e))))}var isTextNode=require("./isTextNode");module.exports=containsNode;
-var msPattern = /^-ms-/;
+},{"./isTextNode":13}],7:[function(require,module,exports){
+"use strict";function makeEmptyFunction(t){return function(){return t}}var emptyFunction=function(){};emptyFunction.thatReturns=makeEmptyFunction,emptyFunction.thatReturnsFalse=makeEmptyFunction(!1),emptyFunction.thatReturnsTrue=makeEmptyFunction(!0),emptyFunction.thatReturnsNull=makeEmptyFunction(null),emptyFunction.thatReturnsThis=function(){return this},emptyFunction.thatReturnsArgument=function(t){return t},module.exports=emptyFunction;
-/**
- * Camelcases a hyphenated CSS property name, for example:
- *
- * > camelizeStyleName('background-color')
- * < "backgroundColor"
- * > camelizeStyleName('-moz-transition')
- * < "MozTransition"
- * > camelizeStyleName('-ms-transition')
- * < "msTransition"
- *
- * As Andi Smith suggests
- * (http://www.andismith.com/blog/2012/02/modernizr-prefixed/), an `-ms` prefix
- * is converted to lowercase `ms`.
- *
- * @param {string} string
- * @return {string}
- */
-function camelizeStyleName(string) {
- return camelize(string.replace(msPattern, 'ms-'));
-}
+},{}],8:[function(require,module,exports){
+"use strict";var emptyObject={};module.exports=emptyObject;
-module.exports = camelizeStyleName;
-},{"./camelize":5}],7:[function(require,module,exports){
-'use strict';
+},{}],9:[function(require,module,exports){
+"use strict";function focusNode(o){try{o.focus()}catch(o){}}module.exports=focusNode;
-/**
- * Copyright (c) 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- *
- */
+},{}],10:[function(require,module,exports){
+"use strict";function getActiveElement(){if("undefined"==typeof document)return null;try{return document.activeElement||document.body}catch(e){return document.body}}module.exports=getActiveElement;
-var isTextNode = require('./isTextNode');
-
-/*eslint-disable no-bitwise */
-
-/**
- * Checks if a given DOM node contains or is another DOM node.
- */
-function containsNode(outerNode, innerNode) {
- if (!outerNode || !innerNode) {
- return false;
- } else if (outerNode === innerNode) {
- return true;
- } else if (isTextNode(outerNode)) {
- return false;
- } else if (isTextNode(innerNode)) {
- return containsNode(outerNode, innerNode.parentNode);
- } else if ('contains' in outerNode) {
- return outerNode.contains(innerNode);
- } else if (outerNode.compareDocumentPosition) {
- return !!(outerNode.compareDocumentPosition(innerNode) & 16);
- } else {
- return false;
- }
-}
-
-module.exports = containsNode;
-},{"./isTextNode":20}],8:[function(require,module,exports){
-(function (process){
-'use strict';
-
-/**
- * Copyright (c) 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- * @typechecks
- */
-
-var invariant = require('./invariant');
-
-/**
- * Convert array-like objects to arrays.
- *
- * This API assumes the caller knows the contents of the data type. For less
- * well defined inputs use createArrayFromMixed.
- *
- * @param {object|function|filelist} obj
- * @return {array}
- */
-function toArray(obj) {
- var length = obj.length;
-
- // Some browsers builtin objects can report typeof 'function' (e.g. NodeList
- // in old versions of Safari).
- !(!Array.isArray(obj) && (typeof obj === 'object' || typeof obj === 'function')) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'toArray: Array-like object expected') : invariant(false) : void 0;
-
- !(typeof length === 'number') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'toArray: Object needs a length property') : invariant(false) : void 0;
-
- !(length === 0 || length - 1 in obj) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'toArray: Object should have keys for indices') : invariant(false) : void 0;
-
- !(typeof obj.callee !== 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'toArray: Object can\'t be `arguments`. Use rest params ' + '(function(...args) {}) or Array.from() instead.') : invariant(false) : void 0;
-
- // Old IE doesn't give collections access to hasOwnProperty. Assume inputs
- // without method will throw during the slice call and skip straight to the
- // fallback.
- if (obj.hasOwnProperty) {
- try {
- return Array.prototype.slice.call(obj);
- } catch (e) {
- // IE < 9 does not support Array#slice on collections objects
- }
- }
-
- // Fall back to copying key by key. This assumes all keys have a value,
- // so will not preserve sparsely populated inputs.
- var ret = Array(length);
- for (var ii = 0; ii < length; ii++) {
- ret[ii] = obj[ii];
- }
- return ret;
-}
-
-/**
- * Perform a heuristic test to determine if an object is "array-like".
- *
- * A monk asked Joshu, a Zen master, "Has a dog Buddha nature?"
- * Joshu replied: "Mu."
- *
- * This function determines if its argument has "array nature": it returns
- * true if the argument is an actual array, an `arguments' object, or an
- * HTMLCollection (e.g. node.childNodes or node.getElementsByTagName()).
- *
- * It will return false for other array-like objects like Filelist.
- *
- * @param {*} obj
- * @return {boolean}
- */
-function hasArrayNature(obj) {
- return (
- // not null/false
- !!obj && (
- // arrays are objects, NodeLists are functions in Safari
- typeof obj == 'object' || typeof obj == 'function') &&
- // quacks like an array
- 'length' in obj &&
- // not window
- !('setInterval' in obj) &&
- // no DOM node should be considered an array-like
- // a 'select' element has 'length' and 'item' properties on IE8
- typeof obj.nodeType != 'number' && (
- // a real array
- Array.isArray(obj) ||
- // arguments
- 'callee' in obj ||
- // HTMLCollection/NodeList
- 'item' in obj)
- );
-}
-
-/**
- * Ensure that the argument is an array by wrapping it in an array if it is not.
- * Creates a copy of the argument if it is already an array.
- *
- * This is mostly useful idiomatically:
- *
- * var createArrayFromMixed = require('createArrayFromMixed');
- *
- * function takesOneOrMoreThings(things) {
- * things = createArrayFromMixed(things);
- * ...
- * }
- *
- * This allows you to treat `things' as an array, but accept scalars in the API.
- *
- * If you need to convert an array-like object, like `arguments`, into an array
- * use toArray instead.
- *
- * @param {*} obj
- * @return {array}
- */
-function createArrayFromMixed(obj) {
- if (!hasArrayNature(obj)) {
- return [obj];
- } else if (Array.isArray(obj)) {
- return obj.slice();
- } else {
- return toArray(obj);
- }
-}
-
-module.exports = createArrayFromMixed;
-}).call(this,require('_process'))
-
-},{"./invariant":18,"_process":43}],9:[function(require,module,exports){
-(function (process){
-'use strict';
-
-/**
- * Copyright (c) 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- * @typechecks
- */
-
-/*eslint-disable fb-www/unsafe-html*/
-
-var ExecutionEnvironment = require('./ExecutionEnvironment');
-
-var createArrayFromMixed = require('./createArrayFromMixed');
-var getMarkupWrap = require('./getMarkupWrap');
-var invariant = require('./invariant');
-
-/**
- * Dummy container used to render all markup.
- */
-var dummyNode = ExecutionEnvironment.canUseDOM ? document.createElement('div') : null;
-
-/**
- * Pattern used by `getNodeName`.
- */
-var nodeNamePattern = /^\s*<(\w+)/;
-
-/**
- * Extracts the `nodeName` of the first element in a string of markup.
- *
- * @param {string} markup String of markup.
- * @return {?string} Node name of the supplied markup.
- */
-function getNodeName(markup) {
- var nodeNameMatch = markup.match(nodeNamePattern);
- return nodeNameMatch && nodeNameMatch[1].toLowerCase();
-}
-
-/**
- * Creates an array containing the nodes rendered from the supplied markup. The
- * optionally supplied `handleScript` function will be invoked once for each
- * <script> element that is rendered. If no `handleScript` function is supplied,
- * an exception is thrown if any <script> elements are rendered.
- *
- * @param {string} markup A string of valid HTML markup.
- * @param {?function} handleScript Invoked once for each rendered <script>.
- * @return {array<DOMElement|DOMTextNode>} An array of rendered nodes.
- */
-function createNodesFromMarkup(markup, handleScript) {
- var node = dummyNode;
- !!!dummyNode ? process.env.NODE_ENV !== 'production' ? invariant(false, 'createNodesFromMarkup dummy not initialized') : invariant(false) : void 0;
- var nodeName = getNodeName(markup);
-
- var wrap = nodeName && getMarkupWrap(nodeName);
- if (wrap) {
- node.innerHTML = wrap[1] + markup + wrap[2];
-
- var wrapDepth = wrap[0];
- while (wrapDepth--) {
- node = node.lastChild;
- }
- } else {
- node.innerHTML = markup;
- }
-
- var scripts = node.getElementsByTagName('script');
- if (scripts.length) {
- !handleScript ? process.env.NODE_ENV !== 'production' ? invariant(false, 'createNodesFromMarkup(...): Unexpected <script> element rendered.') : invariant(false) : void 0;
- createArrayFromMixed(scripts).forEach(handleScript);
- }
-
- var nodes = Array.from(node.childNodes);
- while (node.lastChild) {
- node.removeChild(node.lastChild);
- }
- return nodes;
-}
-
-module.exports = createNodesFromMarkup;
-}).call(this,require('_process'))
-
-},{"./ExecutionEnvironment":4,"./createArrayFromMixed":8,"./getMarkupWrap":14,"./invariant":18,"_process":43}],10:[function(require,module,exports){
-"use strict";
-
-/**
- * Copyright (c) 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- *
- */
-
-function makeEmptyFunction(arg) {
- return function () {
- return arg;
- };
-}
-
-/**
- * This function accepts and discards inputs; it has no side effects. This is
- * primarily useful idiomatically for overridable function endpoints which
- * always need to be callable, since JS lacks a null-call idiom ala Cocoa.
- */
-var emptyFunction = function emptyFunction() {};
-
-emptyFunction.thatReturns = makeEmptyFunction;
-emptyFunction.thatReturnsFalse = makeEmptyFunction(false);
-emptyFunction.thatReturnsTrue = makeEmptyFunction(true);
-emptyFunction.thatReturnsNull = makeEmptyFunction(null);
-emptyFunction.thatReturnsThis = function () {
- return this;
-};
-emptyFunction.thatReturnsArgument = function (arg) {
- return arg;
-};
-
-module.exports = emptyFunction;
},{}],11:[function(require,module,exports){
-(function (process){
-/**
- * Copyright (c) 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-'use strict';
-
-var emptyObject = {};
-
-if (process.env.NODE_ENV !== 'production') {
- Object.freeze(emptyObject);
-}
-
-module.exports = emptyObject;
-}).call(this,require('_process'))
-
-},{"_process":43}],12:[function(require,module,exports){
-/**
- * Copyright (c) 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
+"use strict";function invariant(e,n,r,i,a,o,t,d){if(validateFormat(n),!e){var f;if(void 0===n)f=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=[r,i,a,o,t,d],v=0;f=new Error(n.replace(/%s/g,function(){return l[v++]})),f.name="Invariant Violation"}throw f.framesToPop=1,f}}var validateFormat=function(e){};module.exports=invariant;
-'use strict';
+},{}],12:[function(require,module,exports){
+"use strict";function isNode(e){return!(!e||!("function"==typeof Node?e instanceof Node:"object"==typeof e&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName))}module.exports=isNode;
-/**
- * @param {DOMElement} node input/textarea to focus
- */
-
-function focusNode(node) {
- // IE8 can throw "Can't move focus to the control because it is invisible,
- // not enabled, or of a type that does not accept the focus." for all kinds of
- // reasons that are too expensive and fragile to test.
- try {
- node.focus();
- } catch (e) {}
-}
-
-module.exports = focusNode;
},{}],13:[function(require,module,exports){
-'use strict';
-
-/**
- * Copyright (c) 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- * @typechecks
- */
-
-/* eslint-disable fb-www/typeof-undefined */
-
-/**
- * Same as document.activeElement but wraps in a try-catch block. In IE it is
- * not safe to call document.activeElement if there is nothing focused.
- *
- * The activeElement will be null only if the document or document body is not
- * yet defined.
- */
-function getActiveElement() /*?DOMElement*/{
- if (typeof document === 'undefined') {
- return null;
- }
- try {
- return document.activeElement || document.body;
- } catch (e) {
- return document.body;
- }
-}
-
-module.exports = getActiveElement;
-},{}],14:[function(require,module,exports){
-(function (process){
-'use strict';
-
-/**
- * Copyright (c) 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-/*eslint-disable fb-www/unsafe-html */
-
-var ExecutionEnvironment = require('./ExecutionEnvironment');
-
-var invariant = require('./invariant');
-
-/**
- * Dummy container used to detect which wraps are necessary.
- */
-var dummyNode = ExecutionEnvironment.canUseDOM ? document.createElement('div') : null;
-
-/**
- * Some browsers cannot use `innerHTML` to render certain elements standalone,
- * so we wrap them, render the wrapped nodes, then extract the desired node.
- *
- * In IE8, certain elements cannot render alone, so wrap all elements ('*').
- */
-
-var shouldWrap = {};
-
-var selectWrap = [1, '<select multiple="true">', '</select>'];
-var tableWrap = [1, '<table>', '</table>'];
-var trWrap = [3, '<table><tbody><tr>', '</tr></tbody></table>'];
-
-var svgWrap = [1, '<svg xmlns="http://www.w3.org/2000/svg">', '</svg>'];
-
-var markupWrap = {
- '*': [1, '?<div>', '</div>'],
-
- 'area': [1, '<map>', '</map>'],
- 'col': [2, '<table><tbody></tbody><colgroup>', '</colgroup></table>'],
- 'legend': [1, '<fieldset>', '</fieldset>'],
- 'param': [1, '<object>', '</object>'],
- 'tr': [2, '<table><tbody>', '</tbody></table>'],
-
- 'optgroup': selectWrap,
- 'option': selectWrap,
-
- 'caption': tableWrap,
- 'colgroup': tableWrap,
- 'tbody': tableWrap,
- 'tfoot': tableWrap,
- 'thead': tableWrap,
-
- 'td': trWrap,
- 'th': trWrap
-};
+"use strict";function isTextNode(e){return isNode(e)&&3==e.nodeType}var isNode=require("./isNode");module.exports=isTextNode;
-// Initialize the SVG elements since we know they'll always need to be wrapped
-// consistently. If they are created inside a <div> they will be initialized in
-// the wrong namespace (and will not display).
-var svgElements = ['circle', 'clipPath', 'defs', 'ellipse', 'g', 'image', 'line', 'linearGradient', 'mask', 'path', 'pattern', 'polygon', 'polyline', 'radialGradient', 'rect', 'stop', 'text', 'tspan'];
-svgElements.forEach(function (nodeName) {
- markupWrap[nodeName] = svgWrap;
- shouldWrap[nodeName] = true;
-});
+},{"./isNode":12}],14:[function(require,module,exports){
+"use strict";function is(t,e){return t===e?0!==t||0!==e||1/t===1/e:t!==t&&e!==e}function shallowEqual(t,e){if(is(t,e))return!0;if("object"!=typeof t||null===t||"object"!=typeof e||null===e)return!1;var r=Object.keys(t),n=Object.keys(e);if(r.length!==n.length)return!1;for(var l=0;l<r.length;l++)if(!hasOwnProperty.call(e,r[l])||!is(t[r[l]],e[r[l]]))return!1;return!0}var hasOwnProperty=Object.prototype.hasOwnProperty;module.exports=shallowEqual;
-/**
- * Gets the markup wrap configuration for the supplied `nodeName`.
- *
- * NOTE: This lazily detects which wraps are necessary for the current browser.
- *
- * @param {string} nodeName Lowercase `nodeName`.
- * @return {?array} Markup wrap configuration, if applicable.
- */
-function getMarkupWrap(nodeName) {
- !!!dummyNode ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Markup wrapping node not initialized') : invariant(false) : void 0;
- if (!markupWrap.hasOwnProperty(nodeName)) {
- nodeName = '*';
- }
- if (!shouldWrap.hasOwnProperty(nodeName)) {
- if (nodeName === '*') {
- dummyNode.innerHTML = '<link />';
- } else {
- dummyNode.innerHTML = '<' + nodeName + '></' + nodeName + '>';
- }
- shouldWrap[nodeName] = !dummyNode.firstChild;
- }
- return shouldWrap[nodeName] ? markupWrap[nodeName] : null;
-}
+},{}],15:[function(require,module,exports){
+"use strict";var REACT_STATICS={childContextTypes:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,mixins:!0,propTypes:!0,type:!0},KNOWN_STATICS={name:!0,length:!0,prototype:!0,caller:!0,arguments:!0,arity:!0},isGetOwnPropertySymbolsAvailable="function"==typeof Object.getOwnPropertySymbols;module.exports=function(t,e,r){if("string"!=typeof e){var o=Object.getOwnPropertyNames(e);isGetOwnPropertySymbolsAvailable&&(o=o.concat(Object.getOwnPropertySymbols(e)));for(var n=0;n<o.length;++n)if(!(REACT_STATICS[o[n]]||KNOWN_STATICS[o[n]]||r&&r[o[n]]))try{t[o[n]]=e[o[n]]}catch(t){}}return t};
-module.exports = getMarkupWrap;
-}).call(this,require('_process'))
-
-},{"./ExecutionEnvironment":4,"./invariant":18,"_process":43}],15:[function(require,module,exports){
-/**
- * Copyright (c) 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- * @typechecks
- */
-
-'use strict';
-
-/**
- * Gets the scroll position of the supplied element or window.
- *
- * The return values are unbounded, unlike `getScrollPosition`. This means they
- * may be negative or exceed the element boundaries (which is possible using
- * inertial scrolling).
- *
- * @param {DOMWindow|DOMElement} scrollable
- * @return {object} Map with `x` and `y` keys.
- */
-
-function getUnboundedScrollPosition(scrollable) {
- if (scrollable === window) {
- return {
- x: window.pageXOffset || document.documentElement.scrollLeft,
- y: window.pageYOffset || document.documentElement.scrollTop
- };
- }
- return {
- x: scrollable.scrollLeft,
- y: scrollable.scrollTop
- };
-}
-
-module.exports = getUnboundedScrollPosition;
},{}],16:[function(require,module,exports){
-'use strict';
+"use strict";var invariant=function(e,n,r,i,o,a,t,f){if(!e){var s;if(void 0===n)s=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var d=[r,i,o,a,t,f],l=0;s=new Error(n.replace(/%s/g,function(){return d[l++]})),s.name="Invariant Violation"}throw s.framesToPop=1,s}};module.exports=invariant;
-/**
- * Copyright (c) 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- * @typechecks
- */
-
-var _uppercasePattern = /([A-Z])/g;
-
-/**
- * Hyphenates a camelcased string, for example:
- *
- * > hyphenate('backgroundColor')
- * < "background-color"
- *
- * For CSS style names, use `hyphenateStyleName` instead which works properly
- * with all vendor prefixes, including `ms`.
- *
- * @param {string} string
- * @return {string}
- */
-function hyphenate(string) {
- return string.replace(_uppercasePattern, '-$1').toLowerCase();
-}
-
-module.exports = hyphenate;
},{}],17:[function(require,module,exports){
-/**
- * Copyright (c) 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- * @typechecks
- */
-
-'use strict';
-
-var hyphenate = require('./hyphenate');
-
-var msPattern = /^ms-/;
-
-/**
- * Hyphenates a camelcased CSS property name, for example:
- *
- * > hyphenateStyleName('backgroundColor')
- * < "background-color"
- * > hyphenateStyleName('MozTransition')
- * < "-moz-transition"
- * > hyphenateStyleName('msTransition')
- * < "-ms-transition"
- *
- * As Modernizr suggests (http://modernizr.com/docs/#prefixed), an `ms` prefix
- * is converted to `-ms-`.
- *
- * @param {string} string
- * @return {string}
- */
-function hyphenateStyleName(string) {
- return hyphenate(string).replace(msPattern, '-ms-');
-}
-
-module.exports = hyphenateStyleName;
-},{"./hyphenate":16}],18:[function(require,module,exports){
-(function (process){
-/**
- * Copyright (c) 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-'use strict';
-
-/**
- * Use invariant() to assert state which your program assumes to be true.
- *
- * Provide sprintf-style format (only %s is supported) and arguments
- * to provide information about what broke and what you were
- * expecting.
- *
- * The invariant message will be stripped in production, but the invariant
- * will remain to ensure logic does not differ in production.
- */
-
-var validateFormat = function validateFormat(format) {};
-
-if (process.env.NODE_ENV !== 'production') {
- validateFormat = function validateFormat(format) {
- if (format === undefined) {
- throw new Error('invariant requires an error message argument');
- }
- };
-}
-
-function invariant(condition, format, a, b, c, d, e, f) {
- validateFormat(format);
-
- if (!condition) {
- var error;
- if (format === undefined) {
- error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');
- } else {
- var args = [a, b, c, d, e, f];
- var argIndex = 0;
- error = new Error(format.replace(/%s/g, function () {
- return args[argIndex++];
- }));
- error.name = 'Invariant Violation';
- }
-
- error.framesToPop = 1; // we don't care about invariant's own frame
- throw error;
- }
-}
-
-module.exports = invariant;
-}).call(this,require('_process'))
-
-},{"_process":43}],19:[function(require,module,exports){
-'use strict';
-
-/**
- * Copyright (c) 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- * @typechecks
- */
-
-/**
- * @param {*} object The object to check.
- * @return {boolean} Whether or not the object is a DOM node.
- */
-function isNode(object) {
- return !!(object && (typeof Node === 'function' ? object instanceof Node : typeof object === 'object' && typeof object.nodeType === 'number' && typeof object.nodeName === 'string'));
-}
-
-module.exports = isNode;
-},{}],20:[function(require,module,exports){
-'use strict';
+(function (global){
+function debounce(e,t,o){function r(t){var o=s,r=v;return s=v=void 0,d=t,j=e.apply(r,o)}function n(e){return d=e,y=setTimeout(a,t),O?r(e):j}function i(e){var o=e-p,r=e-d,n=t-o;return T?nativeMin(n,m-r):n}function u(e){var o=e-p,r=e-d;return void 0===p||o>=t||o<0||T&&r>=m}function a(){var e=now();return u(e)?f(e):void(y=setTimeout(a,i(e)))}function f(e){return y=void 0,g&&s?r(e):(s=v=void 0,j)}function c(){void 0!==y&&clearTimeout(y),d=0,s=p=v=y=void 0}function l(){return void 0===y?j:f(now())}function b(){var e=now(),o=u(e);if(s=arguments,v=this,p=e,o){if(void 0===y)return n(p);if(T)return y=setTimeout(a,t),r(p)}return void 0===y&&(y=setTimeout(a,t)),j}var s,v,m,j,y,p,d=0,O=!1,T=!1,g=!0;if("function"!=typeof e)throw new TypeError(FUNC_ERROR_TEXT);return t=toNumber(t)||0,isObject(o)&&(O=!!o.leading,T="maxWait"in o,m=T?nativeMax(toNumber(o.maxWait)||0,t):m,g="trailing"in o?!!o.trailing:g),b.cancel=c,b.flush=l,b}function isObject(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function isObjectLike(e){return!!e&&"object"==typeof e}function isSymbol(e){return"symbol"==typeof e||isObjectLike(e)&&objectToString.call(e)==symbolTag}function toNumber(e){if("number"==typeof e)return e;if(isSymbol(e))return NAN;if(isObject(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=isObject(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(reTrim,"");var o=reIsBinary.test(e);return o||reIsOctal.test(e)?freeParseInt(e.slice(2),o?2:8):reIsBadHex.test(e)?NAN:+e}var FUNC_ERROR_TEXT="Expected a function",NAN=NaN,symbolTag="[object Symbol]",reTrim=/^\s+|\s+$/g,reIsBadHex=/^[-+]0x[0-9a-f]+$/i,reIsBinary=/^0b[01]+$/i,reIsOctal=/^0o[0-7]+$/i,freeParseInt=parseInt,freeGlobal="object"==typeof global&&global&&global.Object===Object&&global,freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")(),objectProto=Object.prototype,objectToString=objectProto.toString,nativeMax=Math.max,nativeMin=Math.min,now=function(){return root.Date.now()};module.exports=debounce;
-/**
- * Copyright (c) 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- * @typechecks
- */
+}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
-var isNode = require('./isNode');
+},{}],18:[function(require,module,exports){
+(function (global){
+function arrayFilter(e,t){for(var a=-1,r=null==e?0:e.length,n=0,o=[];++a<r;){var s=e[a];t(s,a,e)&&(o[n++]=s)}return o}function arrayPush(e,t){for(var a=-1,r=t.length,n=e.length;++a<r;)e[n+a]=t[a];return e}function arraySome(e,t){for(var a=-1,r=null==e?0:e.length;++a<r;)if(t(e[a],a,e))return!0;return!1}function baseTimes(e,t){for(var a=-1,r=Array(e);++a<e;)r[a]=t(a);return r}function baseUnary(e){return function(t){return e(t)}}function cacheHas(e,t){return e.has(t)}function getValue(e,t){return null==e?void 0:e[t]}function mapToArray(e){var t=-1,a=Array(e.size);return e.forEach(function(e,r){a[++t]=[r,e]}),a}function overArg(e,t){return function(a){return e(t(a))}}function setToArray(e){var t=-1,a=Array(e.size);return e.forEach(function(e){a[++t]=e}),a}function Hash(e){var t=-1,a=null==e?0:e.length;for(this.clear();++t<a;){var r=e[t];this.set(r[0],r[1])}}function hashClear(){this.__data__=nativeCreate?nativeCreate(null):{},this.size=0}function hashDelete(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}function hashGet(e){var t=this.__data__;if(nativeCreate){var a=t[e];return a===HASH_UNDEFINED?void 0:a}return hasOwnProperty.call(t,e)?t[e]:void 0}function hashHas(e){var t=this.__data__;return nativeCreate?void 0!==t[e]:hasOwnProperty.call(t,e)}function hashSet(e,t){var a=this.__data__;return this.size+=this.has(e)?0:1,a[e]=nativeCreate&&void 0===t?HASH_UNDEFINED:t,this}function ListCache(e){var t=-1,a=null==e?0:e.length;for(this.clear();++t<a;){var r=e[t];this.set(r[0],r[1])}}function listCacheClear(){this.__data__=[],this.size=0}function listCacheDelete(e){var t=this.__data__,a=assocIndexOf(t,e);if(a<0)return!1;var r=t.length-1;return a==r?t.pop():splice.call(t,a,1),--this.size,!0}function listCacheGet(e){var t=this.__data__,a=assocIndexOf(t,e);return a<0?void 0:t[a][1]}function listCacheHas(e){return assocIndexOf(this.__data__,e)>-1}function listCacheSet(e,t){var a=this.__data__,r=assocIndexOf(a,e);return r<0?(++this.size,a.push([e,t])):a[r][1]=t,this}function MapCache(e){var t=-1,a=null==e?0:e.length;for(this.clear();++t<a;){var r=e[t];this.set(r[0],r[1])}}function mapCacheClear(){this.size=0,this.__data__={hash:new Hash,map:new(Map||ListCache),string:new Hash}}function mapCacheDelete(e){var t=getMapData(this,e).delete(e);return this.size-=t?1:0,t}function mapCacheGet(e){return getMapData(this,e).get(e)}function mapCacheHas(e){return getMapData(this,e).has(e)}function mapCacheSet(e,t){var a=getMapData(this,e),r=a.size;return a.set(e,t),this.size+=a.size==r?0:1,this}function SetCache(e){var t=-1,a=null==e?0:e.length;for(this.__data__=new MapCache;++t<a;)this.add(e[t])}function setCacheAdd(e){return this.__data__.set(e,HASH_UNDEFINED),this}function setCacheHas(e){return this.__data__.has(e)}function Stack(e){var t=this.__data__=new ListCache(e);this.size=t.size}function stackClear(){this.__data__=new ListCache,this.size=0}function stackDelete(e){var t=this.__data__,a=t.delete(e);return this.size=t.size,a}function stackGet(e){return this.__data__.get(e)}function stackHas(e){return this.__data__.has(e)}function stackSet(e,t){var a=this.__data__;if(a instanceof ListCache){var r=a.__data__;if(!Map||r.length<LARGE_ARRAY_SIZE-1)return r.push([e,t]),this.size=++a.size,this;a=this.__data__=new MapCache(r)}return a.set(e,t),this.size=a.size,this}function arrayLikeKeys(e,t){var a=isArray(e),r=!a&&isArguments(e),n=!a&&!r&&isBuffer(e),o=!a&&!r&&!n&&isTypedArray(e),s=a||r||n||o,i=s?baseTimes(e.length,String):[],c=i.length;for(var u in e)!t&&!hasOwnProperty.call(e,u)||s&&("length"==u||n&&("offset"==u||"parent"==u)||o&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||isIndex(u,c))||i.push(u);return i}function assocIndexOf(e,t){for(var a=e.length;a--;)if(eq(e[a][0],t))return a;return-1}function baseGetAllKeys(e,t,a){var r=t(e);return isArray(e)?r:arrayPush(r,a(e))}function baseGetTag(e){return null==e?void 0===e?undefinedTag:nullTag:symToStringTag&&symToStringTag in Object(e)?getRawTag(e):objectToString(e)}function baseIsArguments(e){return isObjectLike(e)&&baseGetTag(e)==argsTag}function baseIsEqual(e,t,a,r,n){return e===t||(null==e||null==t||!isObjectLike(e)&&!isObjectLike(t)?e!==e&&t!==t:baseIsEqualDeep(e,t,a,r,baseIsEqual,n))}function baseIsEqualDeep(e,t,a,r,n,o){var s=isArray(e),i=isArray(t),c=s?arrayTag:getTag(e),u=i?arrayTag:getTag(t);c=c==argsTag?objectTag:c,u=u==argsTag?objectTag:u;var g=c==objectTag,l=u==objectTag,y=c==u;if(y&&isBuffer(e)){if(!isBuffer(t))return!1;s=!0,g=!1}if(y&&!g)return o||(o=new Stack),s||isTypedArray(e)?equalArrays(e,t,a,r,n,o):equalByTag(e,t,c,a,r,n,o);if(!(a&COMPARE_PARTIAL_FLAG)){var f=g&&hasOwnProperty.call(e,"__wrapped__"),p=l&&hasOwnProperty.call(t,"__wrapped__");if(f||p){var h=f?e.value():e,T=p?t.value():t;return o||(o=new Stack),n(h,T,a,r,o)}}return!!y&&(o||(o=new Stack),equalObjects(e,t,a,r,n,o))}function baseIsNative(e){if(!isObject(e)||isMasked(e))return!1;var t=isFunction(e)?reIsNative:reIsHostCtor;return t.test(toSource(e))}function baseIsTypedArray(e){return isObjectLike(e)&&isLength(e.length)&&!!typedArrayTags[baseGetTag(e)]}function baseKeys(e){if(!isPrototype(e))return nativeKeys(e);var t=[];for(var a in Object(e))hasOwnProperty.call(e,a)&&"constructor"!=a&&t.push(a);return t}function equalArrays(e,t,a,r,n,o){var s=a&COMPARE_PARTIAL_FLAG,i=e.length,c=t.length;if(i!=c&&!(s&&c>i))return!1;var u=o.get(e);if(u&&o.get(t))return u==t;var g=-1,l=!0,y=a&COMPARE_UNORDERED_FLAG?new SetCache:void 0;for(o.set(e,t),o.set(t,e);++g<i;){var f=e[g],p=t[g];if(r)var h=s?r(p,f,g,t,e,o):r(f,p,g,e,t,o);if(void 0!==h){if(h)continue;l=!1;break}if(y){if(!arraySome(t,function(e,t){if(!cacheHas(y,t)&&(f===e||n(f,e,a,r,o)))return y.push(t)})){l=!1;break}}else if(f!==p&&!n(f,p,a,r,o)){l=!1;break}}return o.delete(e),o.delete(t),l}function equalByTag(e,t,a,r,n,o,s){switch(a){case dataViewTag:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case arrayBufferTag:return!(e.byteLength!=t.byteLength||!o(new Uint8Array(e),new Uint8Array(t)));case boolTag:case dateTag:case numberTag:return eq(+e,+t);case errorTag:return e.name==t.name&&e.message==t.message;case regexpTag:case stringTag:return e==t+"";case mapTag:var i=mapToArray;case setTag:var c=r&COMPARE_PARTIAL_FLAG;if(i||(i=setToArray),e.size!=t.size&&!c)return!1;var u=s.get(e);if(u)return u==t;r|=COMPARE_UNORDERED_FLAG,s.set(e,t);var g=equalArrays(i(e),i(t),r,n,o,s);return s.delete(e),g;case symbolTag:if(symbolValueOf)return symbolValueOf.call(e)==symbolValueOf.call(t)}return!1}function equalObjects(e,t,a,r,n,o){var s=a&COMPARE_PARTIAL_FLAG,i=getAllKeys(e),c=i.length,u=getAllKeys(t),g=u.length;if(c!=g&&!s)return!1;for(var l=c;l--;){var y=i[l];if(!(s?y in t:hasOwnProperty.call(t,y)))return!1}var f=o.get(e);if(f&&o.get(t))return f==t;var p=!0;o.set(e,t),o.set(t,e);for(var h=s;++l<c;){y=i[l];var T=e[y],b=t[y];if(r)var d=s?r(b,T,y,t,e,o):r(T,b,y,e,t,o);if(!(void 0===d?T===b||n(T,b,a,r,o):d)){p=!1;break}h||(h="constructor"==y)}if(p&&!h){var _=e.constructor,A=t.constructor;_!=A&&"constructor"in e&&"constructor"in t&&!("function"==typeof _&&_ instanceof _&&"function"==typeof A&&A instanceof A)&&(p=!1)}return o.delete(e),o.delete(t),p}function getAllKeys(e){return baseGetAllKeys(e,keys,getSymbols)}function getMapData(e,t){var a=e.__data__;return isKeyable(t)?a["string"==typeof t?"string":"hash"]:a.map}function getNative(e,t){var a=getValue(e,t);return baseIsNative(a)?a:void 0}function getRawTag(e){var t=hasOwnProperty.call(e,symToStringTag),a=e[symToStringTag];try{e[symToStringTag]=void 0;var r=!0}catch(e){}var n=nativeObjectToString.call(e);return r&&(t?e[symToStringTag]=a:delete e[symToStringTag]),n}function isIndex(e,t){return t=null==t?MAX_SAFE_INTEGER:t,!!t&&("number"==typeof e||reIsUint.test(e))&&e>-1&&e%1==0&&e<t}function isKeyable(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}function isMasked(e){return!!maskSrcKey&&maskSrcKey in e}function isPrototype(e){var t=e&&e.constructor,a="function"==typeof t&&t.prototype||objectProto;return e===a}function objectToString(e){return nativeObjectToString.call(e)}function toSource(e){if(null!=e){try{return funcToString.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function eq(e,t){return e===t||e!==e&&t!==t}function isArrayLike(e){return null!=e&&isLength(e.length)&&!isFunction(e)}function isEqual(e,t){return baseIsEqual(e,t)}function isFunction(e){if(!isObject(e))return!1;var t=baseGetTag(e);return t==funcTag||t==genTag||t==asyncTag||t==proxyTag}function isLength(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=MAX_SAFE_INTEGER}function isObject(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function isObjectLike(e){return null!=e&&"object"==typeof e}function keys(e){return isArrayLike(e)?arrayLikeKeys(e):baseKeys(e)}function stubArray(){return[]}function stubFalse(){return!1}var LARGE_ARRAY_SIZE=200,HASH_UNDEFINED="__lodash_hash_undefined__",COMPARE_PARTIAL_FLAG=1,COMPARE_UNORDERED_FLAG=2,MAX_SAFE_INTEGER=9007199254740991,argsTag="[object Arguments]",arrayTag="[object Array]",asyncTag="[object AsyncFunction]",boolTag="[object Boolean]",dateTag="[object Date]",errorTag="[object Error]",funcTag="[object Function]",genTag="[object GeneratorFunction]",mapTag="[object Map]",numberTag="[object Number]",nullTag="[object Null]",objectTag="[object Object]",promiseTag="[object Promise]",proxyTag="[object Proxy]",regexpTag="[object RegExp]",setTag="[object Set]",stringTag="[object String]",symbolTag="[object Symbol]",undefinedTag="[object Undefined]",weakMapTag="[object WeakMap]",arrayBufferTag="[object ArrayBuffer]",dataViewTag="[object DataView]",float32Tag="[object Float32Array]",float64Tag="[object Float64Array]",int8Tag="[object Int8Array]",int16Tag="[object Int16Array]",int32Tag="[object Int32Array]",uint8Tag="[object Uint8Array]",uint8ClampedTag="[object Uint8ClampedArray]",uint16Tag="[object Uint16Array]",uint32Tag="[object Uint32Array]",reRegExpChar=/[\\^$.*+?()[\]{}|]/g,reIsHostCtor=/^\[object .+?Constructor\]$/,reIsUint=/^(?:0|[1-9]\d*)$/,typedArrayTags={};typedArrayTags[float32Tag]=typedArrayTags[float64Tag]=typedArrayTags[int8Tag]=typedArrayTags[int16Tag]=typedArrayTags[int32Tag]=typedArrayTags[uint8Tag]=typedArrayTags[uint8ClampedTag]=typedArrayTags[uint16Tag]=typedArrayTags[uint32Tag]=!0,typedArrayTags[argsTag]=typedArrayTags[arrayTag]=typedArrayTags[arrayBufferTag]=typedArrayTags[boolTag]=typedArrayTags[dataViewTag]=typedArrayTags[dateTag]=typedArrayTags[errorTag]=typedArrayTags[funcTag]=typedArrayTags[mapTag]=typedArrayTags[numberTag]=typedArrayTags[objectTag]=typedArrayTags[regexpTag]=typedArrayTags[setTag]=typedArrayTags[stringTag]=typedArrayTags[weakMapTag]=!1;var freeGlobal="object"==typeof global&&global&&global.Object===Object&&global,freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")(),freeExports="object"==typeof exports&&exports&&!exports.nodeType&&exports,freeModule=freeExports&&"object"==typeof module&&module&&!module.nodeType&&module,moduleExports=freeModule&&freeModule.exports===freeExports,freeProcess=moduleExports&&freeGlobal.process,nodeUtil=function(){try{return freeProcess&&freeProcess.binding&&freeProcess.binding("util")}catch(e){}}(),nodeIsTypedArray=nodeUtil&&nodeUtil.isTypedArray,arrayProto=Array.prototype,funcProto=Function.prototype,objectProto=Object.prototype,coreJsData=root["__core-js_shared__"],funcToString=funcProto.toString,hasOwnProperty=objectProto.hasOwnProperty,maskSrcKey=function(){var e=/[^.]+$/.exec(coreJsData&&coreJsData.keys&&coreJsData.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),nativeObjectToString=objectProto.toString,reIsNative=RegExp("^"+funcToString.call(hasOwnProperty).replace(reRegExpChar,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Buffer=moduleExports?root.Buffer:void 0,Symbol=root.Symbol,Uint8Array=root.Uint8Array,propertyIsEnumerable=objectProto.propertyIsEnumerable,splice=arrayProto.splice,symToStringTag=Symbol?Symbol.toStringTag:void 0,nativeGetSymbols=Object.getOwnPropertySymbols,nativeIsBuffer=Buffer?Buffer.isBuffer:void 0,nativeKeys=overArg(Object.keys,Object),DataView=getNative(root,"DataView"),Map=getNative(root,"Map"),Promise=getNative(root,"Promise"),Set=getNative(root,"Set"),WeakMap=getNative(root,"WeakMap"),nativeCreate=getNative(Object,"create"),dataViewCtorString=toSource(DataView),mapCtorString=toSource(Map),promiseCtorString=toSource(Promise),setCtorString=toSource(Set),weakMapCtorString=toSource(WeakMap),symbolProto=Symbol?Symbol.prototype:void 0,symbolValueOf=symbolProto?symbolProto.valueOf:void 0;Hash.prototype.clear=hashClear,Hash.prototype.delete=hashDelete,Hash.prototype.get=hashGet,Hash.prototype.has=hashHas,Hash.prototype.set=hashSet,ListCache.prototype.clear=listCacheClear,ListCache.prototype.delete=listCacheDelete,ListCache.prototype.get=listCacheGet,ListCache.prototype.has=listCacheHas,ListCache.prototype.set=listCacheSet,MapCache.prototype.clear=mapCacheClear,MapCache.prototype.delete=mapCacheDelete,MapCache.prototype.get=mapCacheGet,MapCache.prototype.has=mapCacheHas,MapCache.prototype.set=mapCacheSet,SetCache.prototype.add=SetCache.prototype.push=setCacheAdd,SetCache.prototype.has=setCacheHas,Stack.prototype.clear=stackClear,Stack.prototype.delete=stackDelete,Stack.prototype.get=stackGet,Stack.prototype.has=stackHas,Stack.prototype.set=stackSet;var getSymbols=nativeGetSymbols?function(e){return null==e?[]:(e=Object(e),arrayFilter(nativeGetSymbols(e),function(t){return propertyIsEnumerable.call(e,t)}))}:stubArray,getTag=baseGetTag;(DataView&&getTag(new DataView(new ArrayBuffer(1)))!=dataViewTag||Map&&getTag(new Map)!=mapTag||Promise&&getTag(Promise.resolve())!=promiseTag||Set&&getTag(new Set)!=setTag||WeakMap&&getTag(new WeakMap)!=weakMapTag)&&(getTag=function(e){var t=baseGetTag(e),a=t==objectTag?e.constructor:void 0,r=a?toSource(a):"";if(r)switch(r){case dataViewCtorString:return dataViewTag;case mapCtorString:return mapTag;case promiseCtorString:return promiseTag;case setCtorString:return setTag;case weakMapCtorString:return weakMapTag}return t});var isArguments=baseIsArguments(function(){return arguments}())?baseIsArguments:function(e){return isObjectLike(e)&&hasOwnProperty.call(e,"callee")&&!propertyIsEnumerable.call(e,"callee")},isArray=Array.isArray,isBuffer=nativeIsBuffer||stubFalse,isTypedArray=nodeIsTypedArray?baseUnary(nodeIsTypedArray):baseIsTypedArray;module.exports=isEqual;
-/**
- * @param {*} object The object to check.
- * @return {boolean} Whether or not the object is a DOM text node.
- */
-function isTextNode(object) {
- return isNode(object) && object.nodeType == 3;
-}
+}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
-module.exports = isTextNode;
-},{"./isNode":19}],21:[function(require,module,exports){
-/**
- * Copyright (c) 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- *
- * @typechecks static-only
- */
+},{}],19:[function(require,module,exports){
+var root=require("./_root"),Symbol=root.Symbol;module.exports=Symbol;
-'use strict';
+},{"./_root":26}],20:[function(require,module,exports){
+function baseGetTag(e){return null==e?void 0===e?undefinedTag:nullTag:symToStringTag&&symToStringTag in Object(e)?getRawTag(e):objectToString(e)}var Symbol=require("./_Symbol"),getRawTag=require("./_getRawTag"),objectToString=require("./_objectToString"),nullTag="[object Null]",undefinedTag="[object Undefined]",symToStringTag=Symbol?Symbol.toStringTag:void 0;module.exports=baseGetTag;
-/**
- * Memoizes the return value of a function that accepts one string argument.
- */
+},{"./_Symbol":19,"./_getRawTag":23,"./_objectToString":24}],21:[function(require,module,exports){
+(function (global){
+var freeGlobal="object"==typeof global&&global&&global.Object===Object&&global;module.exports=freeGlobal;
-function memoizeStringOnly(callback) {
- var cache = {};
- return function (string) {
- if (!cache.hasOwnProperty(string)) {
- cache[string] = callback.call(this, string);
- }
- return cache[string];
- };
-}
+}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
-module.exports = memoizeStringOnly;
},{}],22:[function(require,module,exports){
-/**
- * Copyright (c) 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- * @typechecks
- */
-
-'use strict';
-
-var ExecutionEnvironment = require('./ExecutionEnvironment');
-
-var performance;
-
-if (ExecutionEnvironment.canUseDOM) {
- performance = window.performance || window.msPerformance || window.webkitPerformance;
-}
-
-module.exports = performance || {};
-},{"./ExecutionEnvironment":4}],23:[function(require,module,exports){
-'use strict';
-
-/**
- * Copyright (c) 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- * @typechecks
- */
-
-var performance = require('./performance');
-
-var performanceNow;
-
-/**
- * Detect if we can use `window.performance.now()` and gracefully fallback to
- * `Date.now()` if it doesn't exist. We need to support Firefox < 15 for now
- * because of Facebook's testing infrastructure.
- */
-if (performance.now) {
- performanceNow = function performanceNow() {
- return performance.now();
- };
-} else {
- performanceNow = function performanceNow() {
- return Date.now();
- };
-}
+var overArg=require("./_overArg"),getPrototype=overArg(Object.getPrototypeOf,Object);module.exports=getPrototype;
-module.exports = performanceNow;
-},{"./performance":22}],24:[function(require,module,exports){
-/**
- * Copyright (c) 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- * @typechecks
- *
- */
+},{"./_overArg":25}],23:[function(require,module,exports){
+function getRawTag(t){var o=hasOwnProperty.call(t,symToStringTag),r=t[symToStringTag];try{t[symToStringTag]=void 0;var a=!0}catch(t){}var e=nativeObjectToString.call(t);return a&&(o?t[symToStringTag]=r:delete t[symToStringTag]),e}var Symbol=require("./_Symbol"),objectProto=Object.prototype,hasOwnProperty=objectProto.hasOwnProperty,nativeObjectToString=objectProto.toString,symToStringTag=Symbol?Symbol.toStringTag:void 0;module.exports=getRawTag;
-/*eslint-disable no-self-compare */
+},{"./_Symbol":19}],24:[function(require,module,exports){
+function objectToString(t){return nativeObjectToString.call(t)}var objectProto=Object.prototype,nativeObjectToString=objectProto.toString;module.exports=objectToString;
-'use strict';
-
-var hasOwnProperty = Object.prototype.hasOwnProperty;
-
-/**
- * inlined Object.is polyfill to avoid requiring consumers ship their own
- * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
- */
-function is(x, y) {
- // SameValue algorithm
- if (x === y) {
- // Steps 1-5, 7-10
- // Steps 6.b-6.e: +0 != -0
- // Added the nonzero y check to make Flow happy, but it is redundant
- return x !== 0 || y !== 0 || 1 / x === 1 / y;
- } else {
- // Step 6.a: NaN == NaN
- return x !== x && y !== y;
- }
-}
-
-/**
- * Performs equality by iterating through keys on an object and returning false
- * when any key has values which are not strictly equal between the arguments.
- * Returns true when the values of all keys are strictly equal.
- */
-function shallowEqual(objA, objB) {
- if (is(objA, objB)) {
- return true;
- }
-
- if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {
- return false;
- }
-
- var keysA = Object.keys(objA);
- var keysB = Object.keys(objB);
-
- if (keysA.length !== keysB.length) {
- return false;
- }
-
- // Test for A's keys different from B.
- for (var i = 0; i < keysA.length; i++) {
- if (!hasOwnProperty.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {
- return false;
- }
- }
-
- return true;
-}
-
-module.exports = shallowEqual;
},{}],25:[function(require,module,exports){
-(function (process){
-/**
- * Copyright 2014-2015, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-'use strict';
-
-var emptyFunction = require('./emptyFunction');
-
-/**
- * Similar to invariant but only logs a warning if the condition is not met.
- * This can be used to log issues in development environments in critical
- * paths. Removing the logging code for production environments will keep the
- * same logic and follow the same code paths.
- */
-
-var warning = emptyFunction;
-
-if (process.env.NODE_ENV !== 'production') {
- (function () {
- var printWarning = function printWarning(format) {
- for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
- args[_key - 1] = arguments[_key];
- }
-
- var argIndex = 0;
- var message = 'Warning: ' + format.replace(/%s/g, function () {
- return args[argIndex++];
- });
- if (typeof console !== 'undefined') {
- console.error(message);
- }
- try {
- // --- Welcome to debugging React ---
- // This error was thrown as a convenience so that you can use this stack
- // to find the callsite that caused this warning to fire.
- throw new Error(message);
- } catch (x) {}
- };
-
- warning = function warning(condition, format) {
- if (format === undefined) {
- throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument');
- }
-
- if (format.indexOf('Failed Composite propType: ') === 0) {
- return; // Ignore CompositeComponent proptype check.
- }
-
- if (!condition) {
- for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
- args[_key2 - 2] = arguments[_key2];
- }
-
- printWarning.apply(undefined, [format].concat(args));
- }
- };
- })();
-}
-
-module.exports = warning;
-}).call(this,require('_process'))
-
-},{"./emptyFunction":10,"_process":43}],26:[function(require,module,exports){
-/**
- * Copyright 2015, Yahoo! Inc.
- * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
- */
-'use strict';
-
-var REACT_STATICS = {
- childContextTypes: true,
- contextTypes: true,
- defaultProps: true,
- displayName: true,
- getDefaultProps: true,
- mixins: true,
- propTypes: true,
- type: true
-};
-
-var KNOWN_STATICS = {
- name: true,
- length: true,
- prototype: true,
- caller: true,
- arguments: true,
- arity: true
-};
-
-var isGetOwnPropertySymbolsAvailable = typeof Object.getOwnPropertySymbols === 'function';
-
-module.exports = function hoistNonReactStatics(targetComponent, sourceComponent, customStatics) {
- if (typeof sourceComponent !== 'string') { // don't hoist over string (html) components
- var keys = Object.getOwnPropertyNames(sourceComponent);
-
- /* istanbul ignore else */
- if (isGetOwnPropertySymbolsAvailable) {
- keys = keys.concat(Object.getOwnPropertySymbols(sourceComponent));
- }
-
- for (var i = 0; i < keys.length; ++i) {
- if (!REACT_STATICS[keys[i]] && !KNOWN_STATICS[keys[i]] && (!customStatics || !customStatics[keys[i]])) {
- try {
- targetComponent[keys[i]] = sourceComponent[keys[i]];
- } catch (error) {
-
- }
- }
- }
- }
-
- return targetComponent;
-};
-
-},{}],27:[function(require,module,exports){
-(function (process){
-/**
- * Copyright 2013-2015, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- */
-
-'use strict';
-
-/**
- * Use invariant() to assert state which your program assumes to be true.
- *
- * Provide sprintf-style format (only %s is supported) and arguments
- * to provide information about what broke and what you were
- * expecting.
- *
- * The invariant message will be stripped in production, but the invariant
- * will remain to ensure logic does not differ in production.
- */
-
-var invariant = function(condition, format, a, b, c, d, e, f) {
- if (process.env.NODE_ENV !== 'production') {
- if (format === undefined) {
- throw new Error('invariant requires an error message argument');
- }
- }
-
- if (!condition) {
- var error;
- if (format === undefined) {
- error = new Error(
- 'Minified exception occurred; use the non-minified dev environment ' +
- 'for the full error message and additional helpful warnings.'
- );
- } else {
- var args = [a, b, c, d, e, f];
- var argIndex = 0;
- error = new Error(
- format.replace(/%s/g, function() { return args[argIndex++]; })
- );
- error.name = 'Invariant Violation';
- }
-
- error.framesToPop = 1; // we don't care about invariant's own frame
- throw error;
- }
-};
-
-module.exports = invariant;
-
-}).call(this,require('_process'))
-
-},{"_process":43}],28:[function(require,module,exports){
-/**
- * lodash 3.9.1 (Custom Build) <https://lodash.com/>
- * Build: `lodash modern modularize exports="npm" -o ./`
- * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/>
- * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
- * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
- * Available under MIT license <https://lodash.com/license>
- */
-
-/** `Object#toString` result references. */
-var funcTag = '[object Function]';
-
-/** Used to detect host constructors (Safari > 5). */
-var reIsHostCtor = /^\[object .+?Constructor\]$/;
-
-/**
- * Checks if `value` is object-like.
- *
- * @private
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
- */
-function isObjectLike(value) {
- return !!value && typeof value == 'object';
-}
-
-/** Used for native method references. */
-var objectProto = Object.prototype;
-
-/** Used to resolve the decompiled source of functions. */
-var fnToString = Function.prototype.toString;
-
-/** Used to check objects for own properties. */
-var hasOwnProperty = objectProto.hasOwnProperty;
-
-/**
- * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
- * of values.
- */
-var objToString = objectProto.toString;
-
-/** Used to detect if a method is native. */
-var reIsNative = RegExp('^' +
- fnToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g, '\\$&')
- .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
-);
-
-/**
- * Gets the native function at `key` of `object`.
- *
- * @private
- * @param {Object} object The object to query.
- * @param {string} key The key of the method to get.
- * @returns {*} Returns the function if it's native, else `undefined`.
- */
-function getNative(object, key) {
- var value = object == null ? undefined : object[key];
- return isNative(value) ? value : undefined;
-}
-
-/**
- * Checks if `value` is classified as a `Function` object.
- *
- * @static
- * @memberOf _
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
- * @example
- *
- * _.isFunction(_);
- * // => true
- *
- * _.isFunction(/abc/);
- * // => false
- */
-function isFunction(value) {
- // The use of `Object#toString` avoids issues with the `typeof` operator
- // in older versions of Chrome and Safari which return 'function' for regexes
- // and Safari 8 equivalents which return 'object' for typed array constructors.
- return isObject(value) && objToString.call(value) == funcTag;
-}
-
-/**
- * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`.
- * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
- *
- * @static
- * @memberOf _
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is an object, else `false`.
- * @example
- *
- * _.isObject({});
- * // => true
- *
- * _.isObject([1, 2, 3]);
- * // => true
- *
- * _.isObject(1);
- * // => false
- */
-function isObject(value) {
- // Avoid a V8 JIT bug in Chrome 19-20.
- // See https://code.google.com/p/v8/issues/detail?id=2291 for more details.
- var type = typeof value;
- return !!value && (type == 'object' || type == 'function');
-}
-
-/**
- * Checks if `value` is a native function.
- *
- * @static
- * @memberOf _
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a native function, else `false`.
- * @example
- *
- * _.isNative(Array.prototype.push);
- * // => true
- *
- * _.isNative(_);
- * // => false
- */
-function isNative(value) {
- if (value == null) {
- return false;
- }
- if (isFunction(value)) {
- return reIsNative.test(fnToString.call(value));
- }
- return isObjectLike(value) && reIsHostCtor.test(value);
-}
-
-module.exports = getNative;
-
-},{}],29:[function(require,module,exports){
-(function (global){
-/**
- * lodash (Custom Build) <https://lodash.com/>
- * Build: `lodash modularize exports="npm" -o ./`
- * Copyright jQuery Foundation and other contributors <https://jquery.org/>
- * Released under MIT license <https://lodash.com/license>
- * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
- * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
- */
-
-/** Used as the `TypeError` message for "Functions" methods. */
-var FUNC_ERROR_TEXT = 'Expected a function';
-
-/** Used as references for various `Number` constants. */
-var NAN = 0 / 0;
-
-/** `Object#toString` result references. */
-var symbolTag = '[object Symbol]';
-
-/** Used to match leading and trailing whitespace. */
-var reTrim = /^\s+|\s+$/g;
-
-/** Used to detect bad signed hexadecimal string values. */
-var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
-
-/** Used to detect binary string values. */
-var reIsBinary = /^0b[01]+$/i;
-
-/** Used to detect octal string values. */
-var reIsOctal = /^0o[0-7]+$/i;
+function overArg(r,e){return function(n){return r(e(n))}}module.exports=overArg;
-/** Built-in method references without a dependency on `root`. */
-var freeParseInt = parseInt;
+},{}],26:[function(require,module,exports){
+var freeGlobal=require("./_freeGlobal"),freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")();module.exports=root;
-/** Detect free variable `global` from Node.js. */
-var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
+},{"./_freeGlobal":21}],27:[function(require,module,exports){
+function isObjectLike(e){return null!=e&&"object"==typeof e}module.exports=isObjectLike;
-/** Detect free variable `self`. */
-var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
+},{}],28:[function(require,module,exports){
+function isPlainObject(t){if(!isObjectLike(t)||baseGetTag(t)!=objectTag)return!1;var e=getPrototype(t);if(null===e)return!0;var o=hasOwnProperty.call(e,"constructor")&&e.constructor;return"function"==typeof o&&o instanceof o&&funcToString.call(o)==objectCtorString}var baseGetTag=require("./_baseGetTag"),getPrototype=require("./_getPrototype"),isObjectLike=require("./isObjectLike"),objectTag="[object Object]",funcProto=Function.prototype,objectProto=Object.prototype,funcToString=funcProto.toString,hasOwnProperty=objectProto.hasOwnProperty,objectCtorString=funcToString.call(Object);module.exports=isPlainObject;
-/** Used as a reference to the global object. */
-var root = freeGlobal || freeSelf || Function('return this')();
-
-/** Used for built-in method references. */
-var objectProto = Object.prototype;
-
-/**
- * Used to resolve the
- * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
- * of values.
- */
-var objectToString = objectProto.toString;
-
-/* Built-in method references for those with the same name as other `lodash` methods. */
-var nativeMax = Math.max,
- nativeMin = Math.min;
-
-/**
- * Gets the timestamp of the number of milliseconds that have elapsed since
- * the Unix epoch (1 January 1970 00:00:00 UTC).
- *
- * @static
- * @memberOf _
- * @since 2.4.0
- * @category Date
- * @returns {number} Returns the timestamp.
- * @example
- *
- * _.defer(function(stamp) {
- * console.log(_.now() - stamp);
- * }, _.now());
- * // => Logs the number of milliseconds it took for the deferred invocation.
- */
-var now = function() {
- return root.Date.now();
-};
-
-/**
- * Creates a debounced function that delays invoking `func` until after `wait`
- * milliseconds have elapsed since the last time the debounced function was
- * invoked. The debounced function comes with a `cancel` method to cancel
- * delayed `func` invocations and a `flush` method to immediately invoke them.
- * Provide `options` to indicate whether `func` should be invoked on the
- * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
- * with the last arguments provided to the debounced function. Subsequent
- * calls to the debounced function return the result of the last `func`
- * invocation.
- *
- * **Note:** If `leading` and `trailing` options are `true`, `func` is
- * invoked on the trailing edge of the timeout only if the debounced function
- * is invoked more than once during the `wait` timeout.
- *
- * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
- * until to the next tick, similar to `setTimeout` with a timeout of `0`.
- *
- * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
- * for details over the differences between `_.debounce` and `_.throttle`.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Function
- * @param {Function} func The function to debounce.
- * @param {number} [wait=0] The number of milliseconds to delay.
- * @param {Object} [options={}] The options object.
- * @param {boolean} [options.leading=false]
- * Specify invoking on the leading edge of the timeout.
- * @param {number} [options.maxWait]
- * The maximum time `func` is allowed to be delayed before it's invoked.
- * @param {boolean} [options.trailing=true]
- * Specify invoking on the trailing edge of the timeout.
- * @returns {Function} Returns the new debounced function.
- * @example
- *
- * // Avoid costly calculations while the window size is in flux.
- * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
- *
- * // Invoke `sendMail` when clicked, debouncing subsequent calls.
- * jQuery(element).on('click', _.debounce(sendMail, 300, {
- * 'leading': true,
- * 'trailing': false
- * }));
- *
- * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
- * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
- * var source = new EventSource('/stream');
- * jQuery(source).on('message', debounced);
- *
- * // Cancel the trailing debounced invocation.
- * jQuery(window).on('popstate', debounced.cancel);
- */
-function debounce(func, wait, options) {
- var lastArgs,
- lastThis,
- maxWait,
- result,
- timerId,
- lastCallTime,
- lastInvokeTime = 0,
- leading = false,
- maxing = false,
- trailing = true;
-
- if (typeof func != 'function') {
- throw new TypeError(FUNC_ERROR_TEXT);
- }
- wait = toNumber(wait) || 0;
- if (isObject(options)) {
- leading = !!options.leading;
- maxing = 'maxWait' in options;
- maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
- trailing = 'trailing' in options ? !!options.trailing : trailing;
- }
-
- function invokeFunc(time) {
- var args = lastArgs,
- thisArg = lastThis;
-
- lastArgs = lastThis = undefined;
- lastInvokeTime = time;
- result = func.apply(thisArg, args);
- return result;
- }
-
- function leadingEdge(time) {
- // Reset any `maxWait` timer.
- lastInvokeTime = time;
- // Start the timer for the trailing edge.
- timerId = setTimeout(timerExpired, wait);
- // Invoke the leading edge.
- return leading ? invokeFunc(time) : result;
- }
-
- function remainingWait(time) {
- var timeSinceLastCall = time - lastCallTime,
- timeSinceLastInvoke = time - lastInvokeTime,
- result = wait - timeSinceLastCall;
-
- return maxing ? nativeMin(result, maxWait - timeSinceLastInvoke) : result;
- }
-
- function shouldInvoke(time) {
- var timeSinceLastCall = time - lastCallTime,
- timeSinceLastInvoke = time - lastInvokeTime;
-
- // Either this is the first call, activity has stopped and we're at the
- // trailing edge, the system time has gone backwards and we're treating
- // it as the trailing edge, or we've hit the `maxWait` limit.
- return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
- (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
- }
-
- function timerExpired() {
- var time = now();
- if (shouldInvoke(time)) {
- return trailingEdge(time);
- }
- // Restart the timer.
- timerId = setTimeout(timerExpired, remainingWait(time));
- }
-
- function trailingEdge(time) {
- timerId = undefined;
-
- // Only invoke if we have `lastArgs` which means `func` has been
- // debounced at least once.
- if (trailing && lastArgs) {
- return invokeFunc(time);
- }
- lastArgs = lastThis = undefined;
- return result;
- }
-
- function cancel() {
- if (timerId !== undefined) {
- clearTimeout(timerId);
- }
- lastInvokeTime = 0;
- lastArgs = lastCallTime = lastThis = timerId = undefined;
- }
-
- function flush() {
- return timerId === undefined ? result : trailingEdge(now());
- }
-
- function debounced() {
- var time = now(),
- isInvoking = shouldInvoke(time);
-
- lastArgs = arguments;
- lastThis = this;
- lastCallTime = time;
-
- if (isInvoking) {
- if (timerId === undefined) {
- return leadingEdge(lastCallTime);
- }
- if (maxing) {
- // Handle invocations in a tight loop.
- timerId = setTimeout(timerExpired, wait);
- return invokeFunc(lastCallTime);
- }
- }
- if (timerId === undefined) {
- timerId = setTimeout(timerExpired, wait);
- }
- return result;
- }
- debounced.cancel = cancel;
- debounced.flush = flush;
- return debounced;
-}
-
-/**
- * Checks if `value` is the
- * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
- * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is an object, else `false`.
- * @example
- *
- * _.isObject({});
- * // => true
- *
- * _.isObject([1, 2, 3]);
- * // => true
- *
- * _.isObject(_.noop);
- * // => true
- *
- * _.isObject(null);
- * // => false
- */
-function isObject(value) {
- var type = typeof value;
- return !!value && (type == 'object' || type == 'function');
-}
-
-/**
- * Checks if `value` is object-like. A value is object-like if it's not `null`
- * and has a `typeof` result of "object".
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
- * @example
- *
- * _.isObjectLike({});
- * // => true
- *
- * _.isObjectLike([1, 2, 3]);
- * // => true
- *
- * _.isObjectLike(_.noop);
- * // => false
- *
- * _.isObjectLike(null);
- * // => false
- */
-function isObjectLike(value) {
- return !!value && typeof value == 'object';
-}
-
-/**
- * Checks if `value` is classified as a `Symbol` primitive or object.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
- * @example
- *
- * _.isSymbol(Symbol.iterator);
- * // => true
- *
- * _.isSymbol('abc');
- * // => false
- */
-function isSymbol(value) {
- return typeof value == 'symbol' ||
- (isObjectLike(value) && objectToString.call(value) == symbolTag);
-}
-
-/**
- * Converts `value` to a number.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {*} value The value to process.
- * @returns {number} Returns the number.
- * @example
- *
- * _.toNumber(3.2);
- * // => 3.2
- *
- * _.toNumber(Number.MIN_VALUE);
- * // => 5e-324
- *
- * _.toNumber(Infinity);
- * // => Infinity
- *
- * _.toNumber('3.2');
- * // => 3.2
- */
-function toNumber(value) {
- if (typeof value == 'number') {
- return value;
- }
- if (isSymbol(value)) {
- return NAN;
- }
- if (isObject(value)) {
- var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
- value = isObject(other) ? (other + '') : other;
- }
- if (typeof value != 'string') {
- return value === 0 ? value : +value;
- }
- value = value.replace(reTrim, '');
- var isBinary = reIsBinary.test(value);
- return (isBinary || reIsOctal.test(value))
- ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
- : (reIsBadHex.test(value) ? NAN : +value);
-}
-
-module.exports = debounce;
-
-}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
+},{"./_baseGetTag":20,"./_getPrototype":22,"./isObjectLike":27}],29:[function(require,module,exports){
+"use strict";var Event=function(t,e,i){this.type=t,this.loaded=void 0!==e?e:0,i>0?(this.total=i,this.lengthComputable=!0):(this.total=0,this.lengthComputable=!1)};module.exports=Event;
},{}],30:[function(require,module,exports){
-/**
- * lodash (Custom Build) <https://lodash.com/>
- * Build: `lodash modularize exports="npm" -o ./`
- * Copyright jQuery Foundation and other contributors <https://jquery.org/>
- * Released under MIT license <https://lodash.com/license>
- * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
- * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
- */
-
-/** Used as references for various `Number` constants. */
-var MAX_SAFE_INTEGER = 9007199254740991;
-
-/** `Object#toString` result references. */
-var argsTag = '[object Arguments]',
- funcTag = '[object Function]',
- genTag = '[object GeneratorFunction]';
-
-/** Used for built-in method references. */
-var objectProto = Object.prototype;
-
-/** Used to check objects for own properties. */
-var hasOwnProperty = objectProto.hasOwnProperty;
-
-/**
- * Used to resolve the
- * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
- * of values.
- */
-var objectToString = objectProto.toString;
-
-/** Built-in value references. */
-var propertyIsEnumerable = objectProto.propertyIsEnumerable;
-
-/**
- * Checks if `value` is likely an `arguments` object.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is an `arguments` object,
- * else `false`.
- * @example
- *
- * _.isArguments(function() { return arguments; }());
- * // => true
- *
- * _.isArguments([1, 2, 3]);
- * // => false
- */
-function isArguments(value) {
- // Safari 8.1 makes `arguments.callee` enumerable in strict mode.
- return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&
- (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);
-}
-
-/**
- * Checks if `value` is array-like. A value is considered array-like if it's
- * not a function and has a `value.length` that's an integer greater than or
- * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
- * @example
- *
- * _.isArrayLike([1, 2, 3]);
- * // => true
- *
- * _.isArrayLike(document.body.children);
- * // => true
- *
- * _.isArrayLike('abc');
- * // => true
- *
- * _.isArrayLike(_.noop);
- * // => false
- */
-function isArrayLike(value) {
- return value != null && isLength(value.length) && !isFunction(value);
-}
-
-/**
- * This method is like `_.isArrayLike` except that it also checks if `value`
- * is an object.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is an array-like object,
- * else `false`.
- * @example
- *
- * _.isArrayLikeObject([1, 2, 3]);
- * // => true
- *
- * _.isArrayLikeObject(document.body.children);
- * // => true
- *
- * _.isArrayLikeObject('abc');
- * // => false
- *
- * _.isArrayLikeObject(_.noop);
- * // => false
- */
-function isArrayLikeObject(value) {
- return isObjectLike(value) && isArrayLike(value);
-}
-
-/**
- * Checks if `value` is classified as a `Function` object.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a function, else `false`.
- * @example
- *
- * _.isFunction(_);
- * // => true
- *
- * _.isFunction(/abc/);
- * // => false
- */
-function isFunction(value) {
- // The use of `Object#toString` avoids issues with the `typeof` operator
- // in Safari 8-9 which returns 'object' for typed array and other constructors.
- var tag = isObject(value) ? objectToString.call(value) : '';
- return tag == funcTag || tag == genTag;
-}
-
-/**
- * Checks if `value` is a valid array-like length.
- *
- * **Note:** This method is loosely based on
- * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
- * @example
- *
- * _.isLength(3);
- * // => true
- *
- * _.isLength(Number.MIN_VALUE);
- * // => false
- *
- * _.isLength(Infinity);
- * // => false
- *
- * _.isLength('3');
- * // => false
- */
-function isLength(value) {
- return typeof value == 'number' &&
- value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
-}
-
-/**
- * Checks if `value` is the
- * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
- * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is an object, else `false`.
- * @example
- *
- * _.isObject({});
- * // => true
- *
- * _.isObject([1, 2, 3]);
- * // => true
- *
- * _.isObject(_.noop);
- * // => true
- *
- * _.isObject(null);
- * // => false
- */
-function isObject(value) {
- var type = typeof value;
- return !!value && (type == 'object' || type == 'function');
-}
-
-/**
- * Checks if `value` is object-like. A value is object-like if it's not `null`
- * and has a `typeof` result of "object".
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
- * @example
- *
- * _.isObjectLike({});
- * // => true
- *
- * _.isObjectLike([1, 2, 3]);
- * // => true
- *
- * _.isObjectLike(_.noop);
- * // => false
- *
- * _.isObjectLike(null);
- * // => false
- */
-function isObjectLike(value) {
- return !!value && typeof value == 'object';
-}
-
-module.exports = isArguments;
+"use strict";var EventTarget=function(e){this._eventContext=e||this,this._eventListeners={}};EventTarget.events=["loadstart","progress","abort","error","load","timeout","loadend"],EventTarget.prototype.hasListeners=function(){for(var e=0;e<EventTarget.events.length;e++){var t=EventTarget.events[e];if(this._eventListeners[t]||this["on"+t])return!0}return!1},EventTarget.prototype.addEventListener=function(e,t){t&&(this._eventListeners[e]=this._eventListeners[e]||[],this._eventListeners[e].push(t))},EventTarget.prototype.dispatchEvent=function(e){var t=[];if(this._eventListeners[e.type])for(var n=0;n<this._eventListeners[e.type].length;n++)t.push(this._eventListeners[e.type][n]);if(EventTarget.events.indexOf(e.type)!==-1){var s=this["on"+e.type];s&&t.push(s)}for(n=0;n<t.length;n++)"function"==typeof t[n]?t[n].call(this._eventContext,e):t[n].handleEvent()},module.exports=EventTarget;
},{}],31:[function(require,module,exports){
-/**
- * lodash 3.0.4 (Custom Build) <https://lodash.com/>
- * Build: `lodash modern modularize exports="npm" -o ./`
- * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/>
- * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
- * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
- * Available under MIT license <https://lodash.com/license>
- */
-
-/** `Object#toString` result references. */
-var arrayTag = '[object Array]',
- funcTag = '[object Function]';
-
-/** Used to detect host constructors (Safari > 5). */
-var reIsHostCtor = /^\[object .+?Constructor\]$/;
-
-/**
- * Checks if `value` is object-like.
- *
- * @private
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
- */
-function isObjectLike(value) {
- return !!value && typeof value == 'object';
-}
-
-/** Used for native method references. */
-var objectProto = Object.prototype;
-
-/** Used to resolve the decompiled source of functions. */
-var fnToString = Function.prototype.toString;
-
-/** Used to check objects for own properties. */
-var hasOwnProperty = objectProto.hasOwnProperty;
-
-/**
- * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
- * of values.
- */
-var objToString = objectProto.toString;
-
-/** Used to detect if a method is native. */
-var reIsNative = RegExp('^' +
- fnToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g, '\\$&')
- .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
-);
-
-/* Native method references for those with the same name as other `lodash` methods. */
-var nativeIsArray = getNative(Array, 'isArray');
-
-/**
- * Used as the [maximum length](http://ecma-international.org/ecma-262/6.0/#sec-number.max_safe_integer)
- * of an array-like value.
- */
-var MAX_SAFE_INTEGER = 9007199254740991;
-
-/**
- * Gets the native function at `key` of `object`.
- *
- * @private
- * @param {Object} object The object to query.
- * @param {string} key The key of the method to get.
- * @returns {*} Returns the function if it's native, else `undefined`.
- */
-function getNative(object, key) {
- var value = object == null ? undefined : object[key];
- return isNative(value) ? value : undefined;
-}
-
-/**
- * Checks if `value` is a valid array-like length.
- *
- * **Note:** This function is based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength).
- *
- * @private
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
- */
-function isLength(value) {
- return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
-}
-
-/**
- * Checks if `value` is classified as an `Array` object.
- *
- * @static
- * @memberOf _
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
- * @example
- *
- * _.isArray([1, 2, 3]);
- * // => true
- *
- * _.isArray(function() { return arguments; }());
- * // => false
- */
-var isArray = nativeIsArray || function(value) {
- return isObjectLike(value) && isLength(value.length) && objToString.call(value) == arrayTag;
-};
-
-/**
- * Checks if `value` is classified as a `Function` object.
- *
- * @static
- * @memberOf _
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
- * @example
- *
- * _.isFunction(_);
- * // => true
- *
- * _.isFunction(/abc/);
- * // => false
- */
-function isFunction(value) {
- // The use of `Object#toString` avoids issues with the `typeof` operator
- // in older versions of Chrome and Safari which return 'function' for regexes
- // and Safari 8 equivalents which return 'object' for typed array constructors.
- return isObject(value) && objToString.call(value) == funcTag;
-}
-
-/**
- * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`.
- * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
- *
- * @static
- * @memberOf _
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is an object, else `false`.
- * @example
- *
- * _.isObject({});
- * // => true
- *
- * _.isObject([1, 2, 3]);
- * // => true
- *
- * _.isObject(1);
- * // => false
- */
-function isObject(value) {
- // Avoid a V8 JIT bug in Chrome 19-20.
- // See https://code.google.com/p/v8/issues/detail?id=2291 for more details.
- var type = typeof value;
- return !!value && (type == 'object' || type == 'function');
-}
-
-/**
- * Checks if `value` is a native function.
- *
- * @static
- * @memberOf _
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a native function, else `false`.
- * @example
- *
- * _.isNative(Array.prototype.push);
- * // => true
- *
- * _.isNative(_);
- * // => false
- */
-function isNative(value) {
- if (value == null) {
- return false;
- }
- if (isFunction(value)) {
- return reIsNative.test(fnToString.call(value));
- }
- return isObjectLike(value) && reIsHostCtor.test(value);
-}
-
-module.exports = isArray;
+"use strict";var HeadersContainer=function(e){if(this._headers=[],e&&e instanceof Object)for(var r in e)e.hasOwnProperty(r)&&this._headers.push({name:r,value:e[r]})};HeadersContainer.prototype.reset=function(){this._headers=[]},HeadersContainer.prototype.getHeader=function(e){var r=this._getHeader(e);return null!==r?r.value:null},HeadersContainer.prototype.getAll=function(){for(var e="",r=0;r<this._headers.length;r++)e.length>0&&(e+="\r\n"),e+=this._headers[r].name+": "+this._headers[r].value;return e},HeadersContainer.prototype.addHeader=function(e,r){var t=this._getHeader(e);t?t.value+=", "+r:this._headers.push({name:e,value:r})},HeadersContainer.prototype._getHeader=function(e){e=e.toLowerCase();for(var r=0;r<this._headers.length;r++)if(this._headers[r].name.toLowerCase()===e)return this._headers[r];return null},module.exports=HeadersContainer;
},{}],32:[function(require,module,exports){
-var root = require('./_root');
-
-/** Built-in value references. */
-var Symbol = root.Symbol;
-
-module.exports = Symbol;
-
-},{"./_root":39}],33:[function(require,module,exports){
-var Symbol = require('./_Symbol'),
- getRawTag = require('./_getRawTag'),
- objectToString = require('./_objectToString');
-
-/** `Object#toString` result references. */
-var nullTag = '[object Null]',
- undefinedTag = '[object Undefined]';
-
-/** Built-in value references. */
-var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
-
-/**
- * The base implementation of `getTag` without fallbacks for buggy environments.
- *
- * @private
- * @param {*} value The value to query.
- * @returns {string} Returns the `toStringTag`.
- */
-function baseGetTag(value) {
- if (value == null) {
- return value === undefined ? undefinedTag : nullTag;
- }
- return (symToStringTag && symToStringTag in Object(value))
- ? getRawTag(value)
- : objectToString(value);
-}
-
-module.exports = baseGetTag;
-
-},{"./_Symbol":32,"./_getRawTag":36,"./_objectToString":37}],34:[function(require,module,exports){
-(function (global){
-/** Detect free variable `global` from Node.js. */
-var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
-
-module.exports = freeGlobal;
-
-}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
-
-},{}],35:[function(require,module,exports){
-var overArg = require('./_overArg');
-
-/** Built-in value references. */
-var getPrototype = overArg(Object.getPrototypeOf, Object);
-
-module.exports = getPrototype;
-
-},{"./_overArg":38}],36:[function(require,module,exports){
-var Symbol = require('./_Symbol');
-
-/** Used for built-in method references. */
-var objectProto = Object.prototype;
-
-/** Used to check objects for own properties. */
-var hasOwnProperty = objectProto.hasOwnProperty;
-
-/**
- * Used to resolve the
- * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
- * of values.
- */
-var nativeObjectToString = objectProto.toString;
-
-/** Built-in value references. */
-var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
-
-/**
- * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
- *
- * @private
- * @param {*} value The value to query.
- * @returns {string} Returns the raw `toStringTag`.
- */
-function getRawTag(value) {
- var isOwn = hasOwnProperty.call(value, symToStringTag),
- tag = value[symToStringTag];
-
- try {
- value[symToStringTag] = undefined;
- var unmasked = true;
- } catch (e) {}
-
- var result = nativeObjectToString.call(value);
- if (unmasked) {
- if (isOwn) {
- value[symToStringTag] = tag;
- } else {
- delete value[symToStringTag];
- }
- }
- return result;
-}
-
-module.exports = getRawTag;
-
-},{"./_Symbol":32}],37:[function(require,module,exports){
-/** Used for built-in method references. */
-var objectProto = Object.prototype;
-
-/**
- * Used to resolve the
- * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
- * of values.
- */
-var nativeObjectToString = objectProto.toString;
-
-/**
- * Converts `value` to a string using `Object.prototype.toString`.
- *
- * @private
- * @param {*} value The value to convert.
- * @returns {string} Returns the converted string.
- */
-function objectToString(value) {
- return nativeObjectToString.call(value);
-}
-
-module.exports = objectToString;
-
-},{}],38:[function(require,module,exports){
-/**
- * Creates a unary function that invokes `func` with its argument transformed.
- *
- * @private
- * @param {Function} func The function to wrap.
- * @param {Function} transform The argument transform.
- * @returns {Function} Returns the new function.
- */
-function overArg(func, transform) {
- return function(arg) {
- return func(transform(arg));
- };
-}
-
-module.exports = overArg;
-
-},{}],39:[function(require,module,exports){
-var freeGlobal = require('./_freeGlobal');
-
-/** Detect free variable `self`. */
-var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
-
-/** Used as a reference to the global object. */
-var root = freeGlobal || freeSelf || Function('return this')();
-
-module.exports = root;
-
-},{"./_freeGlobal":34}],40:[function(require,module,exports){
-/**
- * Checks if `value` is object-like. A value is object-like if it's not `null`
- * and has a `typeof` result of "object".
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
- * @example
- *
- * _.isObjectLike({});
- * // => true
- *
- * _.isObjectLike([1, 2, 3]);
- * // => true
- *
- * _.isObjectLike(_.noop);
- * // => false
- *
- * _.isObjectLike(null);
- * // => false
- */
-function isObjectLike(value) {
- return value != null && typeof value == 'object';
-}
-
-module.exports = isObjectLike;
-
-},{}],41:[function(require,module,exports){
-var baseGetTag = require('./_baseGetTag'),
- getPrototype = require('./_getPrototype'),
- isObjectLike = require('./isObjectLike');
-
-/** `Object#toString` result references. */
-var objectTag = '[object Object]';
-
-/** Used for built-in method references. */
-var funcProto = Function.prototype,
- objectProto = Object.prototype;
-
-/** Used to resolve the decompiled source of functions. */
-var funcToString = funcProto.toString;
-
-/** Used to check objects for own properties. */
-var hasOwnProperty = objectProto.hasOwnProperty;
-
-/** Used to infer the `Object` constructor. */
-var objectCtorString = funcToString.call(Object);
-
-/**
- * Checks if `value` is a plain object, that is, an object created by the
- * `Object` constructor or one with a `[[Prototype]]` of `null`.
- *
- * @static
- * @memberOf _
- * @since 0.8.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
- * @example
- *
- * function Foo() {
- * this.a = 1;
- * }
- *
- * _.isPlainObject(new Foo);
- * // => false
- *
- * _.isPlainObject([1, 2, 3]);
- * // => false
- *
- * _.isPlainObject({ 'x': 0, 'y': 0 });
- * // => true
- *
- * _.isPlainObject(Object.create(null));
- * // => true
- */
-function isPlainObject(value) {
- if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
- return false;
- }
- var proto = getPrototype(value);
- if (proto === null) {
- return true;
- }
- var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
- return typeof Ctor == 'function' && Ctor instanceof Ctor &&
- funcToString.call(Ctor) == objectCtorString;
-}
-
-module.exports = isPlainObject;
-
-},{"./_baseGetTag":33,"./_getPrototype":35,"./isObjectLike":40}],42:[function(require,module,exports){
-/*
-object-assign
-(c) Sindre Sorhus
-@license MIT
-*/
-
-'use strict';
-/* eslint-disable no-unused-vars */
-var getOwnPropertySymbols = Object.getOwnPropertySymbols;
-var hasOwnProperty = Object.prototype.hasOwnProperty;
-var propIsEnumerable = Object.prototype.propertyIsEnumerable;
-
-function toObject(val) {
- if (val === null || val === undefined) {
- throw new TypeError('Object.assign cannot be called with null or undefined');
- }
-
- return Object(val);
-}
-
-function shouldUseNative() {
- try {
- if (!Object.assign) {
- return false;
- }
-
- // Detect buggy property enumeration order in older V8 versions.
-
- // https://bugs.chromium.org/p/v8/issues/detail?id=4118
- var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
- test1[5] = 'de';
- if (Object.getOwnPropertyNames(test1)[0] === '5') {
- return false;
- }
-
- // https://bugs.chromium.org/p/v8/issues/detail?id=3056
- var test2 = {};
- for (var i = 0; i < 10; i++) {
- test2['_' + String.fromCharCode(i)] = i;
- }
- var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
- return test2[n];
- });
- if (order2.join('') !== '0123456789') {
- return false;
- }
-
- // https://bugs.chromium.org/p/v8/issues/detail?id=3056
- var test3 = {};
- 'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
- test3[letter] = letter;
- });
- if (Object.keys(Object.assign({}, test3)).join('') !==
- 'abcdefghijklmnopqrst') {
- return false;
- }
-
- return true;
- } catch (err) {
- // We don't expect any of the above to throw, but better to be safe.
- return false;
- }
-}
-
-module.exports = shouldUseNative() ? Object.assign : function (target, source) {
- var from;
- var to = toObject(target);
- var symbols;
-
- for (var s = 1; s < arguments.length; s++) {
- from = Object(arguments[s]);
-
- for (var key in from) {
- if (hasOwnProperty.call(from, key)) {
- to[key] = from[key];
- }
- }
-
- if (getOwnPropertySymbols) {
- symbols = getOwnPropertySymbols(from);
- for (var i = 0; i < symbols.length; i++) {
- if (propIsEnumerable.call(from, symbols[i])) {
- to[symbols[i]] = from[symbols[i]];
- }
- }
- }
- }
-
- return to;
-};
-
-},{}],43:[function(require,module,exports){
-// shim for using process in browser
-var process = module.exports = {};
-
-// cached from whatever global is present so that test runners that stub it
-// don't break things. But we need to wrap it in a try catch in case it is
-// wrapped in strict mode code which doesn't define any globals. It's inside a
-// function because try/catches deoptimize in certain engines.
-
-var cachedSetTimeout;
-var cachedClearTimeout;
-
-function defaultSetTimout() {
- throw new Error('setTimeout has not been defined');
-}
-function defaultClearTimeout () {
- throw new Error('clearTimeout has not been defined');
-}
-(function () {
- try {
- if (typeof setTimeout === 'function') {
- cachedSetTimeout = setTimeout;
- } else {
- cachedSetTimeout = defaultSetTimout;
- }
- } catch (e) {
- cachedSetTimeout = defaultSetTimout;
- }
- try {
- if (typeof clearTimeout === 'function') {
- cachedClearTimeout = clearTimeout;
- } else {
- cachedClearTimeout = defaultClearTimeout;
- }
- } catch (e) {
- cachedClearTimeout = defaultClearTimeout;
- }
-} ())
-function runTimeout(fun) {
- if (cachedSetTimeout === setTimeout) {
- //normal enviroments in sane situations
- return setTimeout(fun, 0);
- }
- // if setTimeout wasn't available but was latter defined
- if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
- cachedSetTimeout = setTimeout;
- return setTimeout(fun, 0);
- }
- try {
- // when when somebody has screwed with setTimeout but no I.E. maddness
- return cachedSetTimeout(fun, 0);
- } catch(e){
- try {
- // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
- return cachedSetTimeout.call(null, fun, 0);
- } catch(e){
- // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
- return cachedSetTimeout.call(this, fun, 0);
- }
- }
-
-
-}
-function runClearTimeout(marker) {
- if (cachedClearTimeout === clearTimeout) {
- //normal enviroments in sane situations
- return clearTimeout(marker);
- }
- // if clearTimeout wasn't available but was latter defined
- if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
- cachedClearTimeout = clearTimeout;
- return clearTimeout(marker);
- }
- try {
- // when when somebody has screwed with setTimeout but no I.E. maddness
- return cachedClearTimeout(marker);
- } catch (e){
- try {
- // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
- return cachedClearTimeout.call(null, marker);
- } catch (e){
- // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
- // Some versions of I.E. have different rules for clearTimeout vs setTimeout
- return cachedClearTimeout.call(this, marker);
- }
- }
-
-
-
-}
-var queue = [];
-var draining = false;
-var currentQueue;
-var queueIndex = -1;
-
-function cleanUpNextTick() {
- if (!draining || !currentQueue) {
- return;
- }
- draining = false;
- if (currentQueue.length) {
- queue = currentQueue.concat(queue);
- } else {
- queueIndex = -1;
- }
- if (queue.length) {
- drainQueue();
- }
-}
-
-function drainQueue() {
- if (draining) {
- return;
- }
- var timeout = runTimeout(cleanUpNextTick);
- draining = true;
-
- var len = queue.length;
- while(len) {
- currentQueue = queue;
- queue = [];
- while (++queueIndex < len) {
- if (currentQueue) {
- currentQueue[queueIndex].run();
- }
- }
- queueIndex = -1;
- len = queue.length;
- }
- currentQueue = null;
- draining = false;
- runClearTimeout(timeout);
-}
-
-process.nextTick = function (fun) {
- var args = new Array(arguments.length - 1);
- if (arguments.length > 1) {
- for (var i = 1; i < arguments.length; i++) {
- args[i - 1] = arguments[i];
- }
- }
- queue.push(new Item(fun, args));
- if (queue.length === 1 && !draining) {
- runTimeout(drainQueue);
- }
-};
-
-// v8 likes predictible objects
-function Item(fun, array) {
- this.fun = fun;
- this.array = array;
-}
-Item.prototype.run = function () {
- this.fun.apply(null, this.array);
-};
-process.title = 'browser';
-process.browser = true;
-process.env = {};
-process.argv = [];
-process.version = ''; // empty string to avoid regexp issues
-process.versions = {};
-
-function noop() {}
-
-process.on = noop;
-process.addListener = noop;
-process.once = noop;
-process.off = noop;
-process.removeListener = noop;
-process.removeAllListeners = noop;
-process.emit = noop;
-
-process.binding = function (name) {
- throw new Error('process.binding is not supported');
-};
-
-process.cwd = function () { return '/' };
-process.chdir = function (dir) {
- throw new Error('process.chdir is not supported');
-};
-process.umask = function() { return 0; };
-
-},{}],44:[function(require,module,exports){
-(function (process){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- */
-
-'use strict';
-
-if (process.env.NODE_ENV !== 'production') {
- var invariant = require('fbjs/lib/invariant');
- var warning = require('fbjs/lib/warning');
- var ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');
- var loggedTypeFailures = {};
-}
-
-/**
- * Assert that the values match with the type specs.
- * Error messages are memorized and will only be shown once.
- *
- * @param {object} typeSpecs Map of name to a ReactPropType
- * @param {object} values Runtime values that need to be type-checked
- * @param {string} location e.g. "prop", "context", "child context"
- * @param {string} componentName Name of the component for error messages.
- * @param {?Function} getStack Returns the component stack.
- * @private
- */
-function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
- if (process.env.NODE_ENV !== 'production') {
- for (var typeSpecName in typeSpecs) {
- if (typeSpecs.hasOwnProperty(typeSpecName)) {
- var error;
- // Prop type validation may throw. In case they do, we don't want to
- // fail the render phase where it didn't fail before. So we log it.
- // After these have been cleaned up, we'll let them throw.
- try {
- // This is intentionally an invariant that gets caught. It's the same
- // behavior as without this statement except with a better message.
- invariant(typeof typeSpecs[typeSpecName] === 'function', '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'React.PropTypes.', componentName || 'React class', location, typeSpecName);
- error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
- } catch (ex) {
- error = ex;
- }
- warning(!error || error instanceof Error, '%s: type specification of %s `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error);
- if (error instanceof Error && !(error.message in loggedTypeFailures)) {
- // Only monitor this failure once because there tends to be a lot of the
- // same error.
- loggedTypeFailures[error.message] = true;
-
- var stack = getStack ? getStack() : '';
-
- warning(false, 'Failed %s type: %s%s', location, error.message, stack != null ? stack : '');
- }
- }
- }
- }
-}
-
-module.exports = checkPropTypes;
-
-}).call(this,require('_process'))
-
-},{"./lib/ReactPropTypesSecret":47,"_process":43,"fbjs/lib/invariant":18,"fbjs/lib/warning":25}],45:[function(require,module,exports){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- */
-
-'use strict';
-
-var emptyFunction = require('fbjs/lib/emptyFunction');
-var invariant = require('fbjs/lib/invariant');
-
-module.exports = function() {
- // Important!
- // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
- function shim() {
- invariant(
- false,
- 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
- 'Use PropTypes.checkPropTypes() to call them. ' +
- 'Read more at http://fb.me/use-check-prop-types'
- );
- };
- shim.isRequired = shim;
- function getShim() {
- return shim;
- };
- var ReactPropTypes = {
- array: shim,
- bool: shim,
- func: shim,
- number: shim,
- object: shim,
- string: shim,
- symbol: shim,
-
- any: shim,
- arrayOf: getShim,
- element: shim,
- instanceOf: getShim,
- node: shim,
- objectOf: getShim,
- oneOf: getShim,
- oneOfType: getShim,
- shape: getShim
- };
-
- ReactPropTypes.checkPropTypes = emptyFunction;
- ReactPropTypes.PropTypes = ReactPropTypes;
-
- return ReactPropTypes;
-};
-
-},{"fbjs/lib/emptyFunction":10,"fbjs/lib/invariant":18}],46:[function(require,module,exports){
-(function (process){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- */
-
-'use strict';
-
-var emptyFunction = require('fbjs/lib/emptyFunction');
-var invariant = require('fbjs/lib/invariant');
-var warning = require('fbjs/lib/warning');
-
-var ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');
-var checkPropTypes = require('./checkPropTypes');
-
-module.exports = function(isValidElement, throwOnDirectAccess) {
- /* global Symbol */
- var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
- var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
-
- /**
- * Returns the iterator method function contained on the iterable object.
- *
- * Be sure to invoke the function with the iterable as context:
- *
- * var iteratorFn = getIteratorFn(myIterable);
- * if (iteratorFn) {
- * var iterator = iteratorFn.call(myIterable);
- * ...
- * }
- *
- * @param {?object} maybeIterable
- * @return {?function}
- */
- function getIteratorFn(maybeIterable) {
- var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
- if (typeof iteratorFn === 'function') {
- return iteratorFn;
- }
- }
-
- /**
- * Collection of methods that allow declaration and validation of props that are
- * supplied to React components. Example usage:
- *
- * var Props = require('ReactPropTypes');
- * var MyArticle = React.createClass({
- * propTypes: {
- * // An optional string prop named "description".
- * description: Props.string,
- *
- * // A required enum prop named "category".
- * category: Props.oneOf(['News','Photos']).isRequired,
- *
- * // A prop named "dialog" that requires an instance of Dialog.
- * dialog: Props.instanceOf(Dialog).isRequired
- * },
- * render: function() { ... }
- * });
- *
- * A more formal specification of how these methods are used:
- *
- * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)
- * decl := ReactPropTypes.{type}(.isRequired)?
- *
- * Each and every declaration produces a function with the same signature. This
- * allows the creation of custom validation functions. For example:
- *
- * var MyLink = React.createClass({
- * propTypes: {
- * // An optional string or URI prop named "href".
- * href: function(props, propName, componentName) {
- * var propValue = props[propName];
- * if (propValue != null && typeof propValue !== 'string' &&
- * !(propValue instanceof URI)) {
- * return new Error(
- * 'Expected a string or an URI for ' + propName + ' in ' +
- * componentName
- * );
- * }
- * }
- * },
- * render: function() {...}
- * });
- *
- * @internal
- */
-
- var ANONYMOUS = '<<anonymous>>';
+"use strict";function throwError(e,t){var r=new Error(t||"");throw r.name=e,r}var Event=require("./Event"),EventTarget=require("./EventTarget"),HeadersContainer=require("./HeadersContainer"),MockXhr=function(){EventTarget.call(this),this._readyState=MockXhr.UNSENT,this.requestHeaders=new HeadersContainer,this._upload=new EventTarget(this),this._response=this._networkErrorResponse(),"function"==typeof MockXhr.onCreate&&MockXhr.onCreate(this)};MockXhr.prototype=Object.create(EventTarget.prototype,{readyState:{get:function(){return this._readyState}},upload:{get:function(){return this._upload}},status:{get:function(){return this._response.status}},statusText:{get:function(){return this._response.statusMessage}},responseType:{get:function(){return""},set:function(){throw new Error("Operation not supported.")}},response:{get:function(){return this._getResponseText()}},responseText:{get:function(){return this._getResponseText()}}}),MockXhr.prototype.constructor=MockXhr,MockXhr.UNSENT=0,MockXhr.OPENED=1,MockXhr.HEADERS_RECEIVED=2,MockXhr.LOADING=3,MockXhr.DONE=4,MockXhr.prototype.open=function(e,t){this._methodForbidden(e)&&throwError("SecurityError",'Method "'+e+'" forbidden.'),e=this._normalizeMethodName(e),this._terminateRequest(),this.sendFlag=!1,this.method=e,this.url=t,this.requestHeaders.reset(),this._response=this._networkErrorResponse(),this._readyState!==MockXhr.OPENED&&(this._readyState=MockXhr.OPENED,this._fireReadyStateChange())},MockXhr.prototype.setRequestHeader=function(e,t){if((this._readyState!==MockXhr.OPENED||this.sendFlag)&&throwError("InvalidStateError"),"string"!=typeof e||"string"!=typeof t)throw new SyntaxError;this._requestHeaderForbidden(e)||(t=t.trim(),this.requestHeaders.addHeader(e,t))},MockXhr.prototype.send=function(e){if(void 0===e&&(e=null),(this._readyState!==MockXhr.OPENED||this.sendFlag)&&throwError("InvalidStateError"),"GET"!==this.method&&"HEAD"!==this.method||(e=null),null!==e&&null===this.requestHeaders.getHeader("Content-Type")){var t=null;"string"==typeof e?t="text/plain;charset=UTF-8":e.type&&(t=e.type),null!==t&&this.requestHeaders.addHeader("Content-Type",t)}this.body=e,this.uploadCompleteFlag=null===this.body,this.sendFlag=!0,this._fireEvent("loadstart",0,0),this.uploadCompleteFlag||this._fireUploadEvent("loadstart",0,this._getRequestBodySize());var r=this;if("function"==typeof this.onSend){var o=this.onSend;setTimeout(function(){o.call(r,r)},0)}if("function"==typeof MockXhr.onSend){var s=MockXhr.onSend;setTimeout(function(){s.call(r,r)},0)}},MockXhr.prototype.abort=function(){this._terminateRequest(),(this._readyState===MockXhr.OPENED&&this.sendFlag||this._readyState===MockXhr.HEADERS_RECEIVED||this._readyState===MockXhr.LOADING)&&this._requestErrorSteps("abort"),this._readyState===MockXhr.DONE&&(this._readyState=MockXhr.UNSENT)},MockXhr.prototype._networkErrorResponse=function(){return{type:"error",status:0,statusMessage:"",headers:new HeadersContainer,body:null}},MockXhr.prototype._isNetworkErrorResponse=function(){return"error"===this._response.type},MockXhr.prototype._terminateRequest=function(){delete this.method,delete this.url},MockXhr.prototype._getRequestBodySize=function(){return this.body?this.body.size?this.body.size:this.body.length:0},MockXhr.prototype.getResponseHeader=function(e){return this._response.headers.getHeader(e)},MockXhr.prototype.getAllResponseHeaders=function(){return this._response.headers.getAll()},MockXhr.prototype._getResponseText=function(){return this._readyState!==MockXhr.LOADING&&this._readyState!==MockXhr.DONE?"":this._response.body?this._response.body:""},MockXhr.prototype._newEvent=function(e,t,r){return new Event(e,t,r)},MockXhr.prototype._fireEvent=function(e,t,r){this.dispatchEvent(this._newEvent(e,t,r))},MockXhr.prototype._fireUploadEvent=function(e,t,r){this._upload.dispatchEvent(this._newEvent(e,t,r))},MockXhr.prototype._fireReadyStateChange=function(){var e=new Event("readystatechange");this.onreadystatechange&&this.onreadystatechange(e),this.dispatchEvent(e)},MockXhr.prototype._requestEndOfBody=function(){this.uploadCompleteFlag=!0;var e=this._getRequestBodySize(),t=e;this._fireUploadEvent("progress",t,e),this._fireUploadEvent("load",t,e),this._fireUploadEvent("loadend",t,e)},MockXhr.prototype._processResponse=function(e){this._response=e,this._handleResponseErrors(),this._isNetworkErrorResponse()||(this._readyState=MockXhr.HEADERS_RECEIVED,this._fireReadyStateChange(),this._readyState===MockXhr.HEADERS_RECEIVED&&null===this._response.body&&this._handleResponseEndOfBody())},MockXhr.prototype._handleResponseEndOfBody=function(){if(this._handleResponseErrors(),!this._isNetworkErrorResponse()){var e=this._response.body?this._response.body.length:0;this._fireEvent("progress",e,e),this._readyState=MockXhr.DONE,this.sendFlag=!1,this._fireReadyStateChange(),this._fireEvent("load",e,e),this._fireEvent("loadend",e,e)}},MockXhr.prototype._handleResponseErrors=function(){if(this.sendFlag)if(this._isNetworkErrorResponse())this._requestErrorSteps("error");else switch(this._response.terminationReason){case"end-user abort":this._requestErrorSteps("abort");break;case"fatal":this._readyState=MockXhr.DONE,this.sendFlag=!1,this._response=this._networkErrorResponse()}},MockXhr.prototype._requestErrorSteps=function(e){this._readyState=MockXhr.DONE,this.sendFlag=!1,this._response=this._networkErrorResponse(),this._fireReadyStateChange(),this.uploadCompleteFlag||(this.uploadCompleteFlag=!0,this._fireUploadEvent(e,0,0),this._fireUploadEvent("loadend",0,0)),this._fireEvent(e,0,0),this._fireEvent("loadend",0,0)},MockXhr.prototype.uploadProgress=function(e){if(!this.sendFlag||this.uploadCompleteFlag)throw new Error("Mock usage error detected.");this._fireUploadEvent("progress",e,this._getRequestBodySize())},MockXhr.prototype.respond=function(e,t,r,o){this.setResponseHeaders(e,t,o),this.setResponseBody(r)},MockXhr.prototype.setResponseHeaders=function(e,t,r){if(this._readyState!==MockXhr.OPENED||!this.sendFlag)throw new Error("Mock usage error detected.");this.body&&this._requestEndOfBody(),e="number"==typeof e?e:200,this._processResponse({status:e,statusMessage:void 0!==r?r:MockXhr.statusCodes[e],headers:new HeadersContainer(t)})},MockXhr.prototype.downloadProgress=function(e,t){if(this._readyState!==MockXhr.HEADERS_RECEIVED&&this._readyState!==MockXhr.LOADING)throw new Error("Mock usage error detected.");this._readyState===MockXhr.HEADERS_RECEIVED&&(this._readyState=MockXhr.LOADING),this._fireReadyStateChange(),this._fireEvent("progress",e,t)},MockXhr.prototype.setResponseBody=function(e){if(!this.sendFlag||this._readyState!==MockXhr.OPENED&&this._readyState!==MockXhr.HEADERS_RECEIVED&&this._readyState!==MockXhr.LOADING)throw new Error("Mock usage error detected.");this._readyState===MockXhr.OPENED&&this.setResponseHeaders(),this._readyState=MockXhr.LOADING,this._fireReadyStateChange(),this._response.body=void 0!==e?e:null,this._handleResponseEndOfBody()},MockXhr.prototype.setNetworkError=function(){if(!this.sendFlag)throw new Error("Mock usage error detected.");this._processResponse(this._networkErrorResponse())};var forbiddenHeaders=["Accept-Charset","Accept-Encoding","Access-Control-Request-Headers","Access-Control-Request-Method","Connection","Content-Length","Cookie","Cookie2","Date","DNT","Expect","Host","Keep-Alive","Origin","Referer","TE","Trailer","Transfer-Encoding","Upgrade","Via"],forbiddenHeaderRegEx=new RegExp("^("+forbiddenHeaders.join("|")+"|Proxy-.*|Sec-.*)$","i");MockXhr.prototype._requestHeaderForbidden=function(e){return forbiddenHeaderRegEx.test(e)},MockXhr.prototype._methodForbidden=function(e){return/^(CONNECT|TRACE|TRACK)$/i.test(e)};var upperCaseMethods=["DELETE","GET","HEAD","OPTIONS","POST","PUT"],upperCaseMethodsRegEx=new RegExp("^("+upperCaseMethods.join("|")+")$","i");MockXhr.prototype._normalizeMethodName=function(e){return upperCaseMethodsRegEx.test(e)&&(e=e.toUpperCase()),e},MockXhr.statusCodes={100:"Continue",101:"Switching Protocols",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",300:"Multiple Choice",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Request Entity Too Large",414:"Request-URI Too Long",415:"Unsupported Media Type",416:"Requested Range Not Satisfiable",417:"Expectation Failed",422:"Unprocessable Entity",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported"},module.exports=MockXhr;
- // Important!
- // Keep this list in sync with production version in `./factoryWithThrowingShims.js`.
- var ReactPropTypes = {
- array: createPrimitiveTypeChecker('array'),
- bool: createPrimitiveTypeChecker('boolean'),
- func: createPrimitiveTypeChecker('function'),
- number: createPrimitiveTypeChecker('number'),
- object: createPrimitiveTypeChecker('object'),
- string: createPrimitiveTypeChecker('string'),
- symbol: createPrimitiveTypeChecker('symbol'),
+},{"./Event":29,"./EventTarget":30,"./HeadersContainer":31}],33:[function(require,module,exports){
+"use strict";function toObject(r){if(null===r||void 0===r)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(r)}function shouldUseNative(){try{if(!Object.assign)return!1;var r=new String("abc");if(r[5]="de","5"===Object.getOwnPropertyNames(r)[0])return!1;for(var e={},t=0;t<10;t++)e["_"+String.fromCharCode(t)]=t;var n=Object.getOwnPropertyNames(e).map(function(r){return e[r]});if("0123456789"!==n.join(""))return!1;var o={};return"abcdefghijklmnopqrst".split("").forEach(function(r){o[r]=r}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},o)).join("")}catch(r){return!1}}var getOwnPropertySymbols=Object.getOwnPropertySymbols,hasOwnProperty=Object.prototype.hasOwnProperty,propIsEnumerable=Object.prototype.propertyIsEnumerable;module.exports=shouldUseNative()?Object.assign:function(r,e){for(var t,n,o=toObject(r),a=1;a<arguments.length;a++){t=Object(arguments[a]);for(var s in t)hasOwnProperty.call(t,s)&&(o[s]=t[s]);if(getOwnPropertySymbols){n=getOwnPropertySymbols(t);for(var c=0;c<n.length;c++)propIsEnumerable.call(t,n[c])&&(o[n[c]]=t[n[c]])}}return o};
- any: createAnyTypeChecker(),
- arrayOf: createArrayOfTypeChecker,
- element: createElementTypeChecker(),
- instanceOf: createInstanceTypeChecker,
- node: createNodeChecker(),
- objectOf: createObjectOfTypeChecker,
- oneOf: createEnumTypeChecker,
- oneOfType: createUnionTypeChecker,
- shape: createShapeTypeChecker
- };
+},{}],34:[function(require,module,exports){
+"use strict";var emptyFunction=require("fbjs/lib/emptyFunction"),invariant=require("fbjs/lib/invariant"),ReactPropTypesSecret=require("./lib/ReactPropTypesSecret");module.exports=function(){function e(e,r,t,n,p,o){o!==ReactPropTypesSecret&&invariant(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types")}function r(){return e}e.isRequired=e;var t={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:r,element:e,instanceOf:r,node:e,objectOf:r,oneOf:r,oneOfType:r,shape:r};return t.checkPropTypes=emptyFunction,t.PropTypes=t,t};
- /**
- * inlined Object.is polyfill to avoid requiring consumers ship their own
- * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
- */
- /*eslint-disable no-self-compare*/
- function is(x, y) {
- // SameValue algorithm
- if (x === y) {
- // Steps 1-5, 7-10
- // Steps 6.b-6.e: +0 != -0
- return x !== 0 || 1 / x === 1 / y;
- } else {
- // Step 6.a: NaN == NaN
- return x !== x && y !== y;
- }
- }
- /*eslint-enable no-self-compare*/
+},{"./lib/ReactPropTypesSecret":35,"fbjs/lib/emptyFunction":7,"fbjs/lib/invariant":11}],35:[function(require,module,exports){
+"use strict";var ReactPropTypesSecret="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";module.exports=ReactPropTypesSecret;
- /**
- * We use an Error-like object for backward compatibility as people may call
- * PropTypes directly and inspect their output. However, we don't use real
- * Errors anymore. We don't inspect their stack anyway, and creating them
- * is prohibitively expensive if they are created too often, such as what
- * happens in oneOfType() for any type before the one that matched.
- */
- function PropTypeError(message) {
- this.message = message;
- this.stack = '';
- }
- // Make `instanceof Error` still work for returned errors.
- PropTypeError.prototype = Error.prototype;
+},{}],36:[function(require,module,exports){
+"use strict";function e(e){for(var t=arguments.length-1,n="Minified React error #"+e+"; visit http://facebook.github.io/react/docs/error-decoder.html?invariant="+e,r=0;r<t;r++)n+="&args[]="+encodeURIComponent(arguments[r+1]);n+=" for the full message or use the non-minified dev environment for full errors and additional helpful warnings.";var o=new Error(n);throw o.name="Invariant Violation",o.framesToPop=1,o}function t(){if(wn)for(var e in Nn){var t=Nn[e],r=wn.indexOf(e);if(r>-1||xn("96",e),!Sn.plugins[r]){t.extractEvents||xn("97",e),Sn.plugins[r]=t;var o=t.eventTypes;for(var a in o)n(o[a],t,a)||xn("98",a,e)}}}function n(e,t,n){Sn.eventNameDispatchConfigs.hasOwnProperty(n)&&xn("99",n),Sn.eventNameDispatchConfigs[n]=e;var o=e.phasedRegistrationNames;if(o){for(var a in o)if(o.hasOwnProperty(a)){var i=o[a];r(i,t,n)}return!0}return!!e.registrationName&&(r(e.registrationName,t,n),!0)}function r(e,t,n){Sn.registrationNameModules[e]&&xn("100",e),Sn.registrationNameModules[e]=t,Sn.registrationNameDependencies[e]=t.eventTypes[n].dependencies}function o(e,t){return(e&t)===t}function a(e,t){return e.nodeType===Gn&&e.getAttribute(Jn)===""+t||e.nodeType===Zn&&e.nodeValue===" react-text: "+t+" "||e.nodeType===Zn&&e.nodeValue===" react-empty: "+t+" "}function i(e){for(var t;t=e._renderedComponent;)e=t;return e}function l(e,t){var n=i(e);n._hostNode=t,t[nr]=n}function u(e,t){t[nr]=e}function s(e){var t=e._hostNode;t&&(delete t[nr],e._hostNode=null)}function c(e,t){if(!(e._flags&er.hasCachedChildNodes)){var n=e._renderedChildren,r=t.firstChild;e:for(var o in n)if(n.hasOwnProperty(o)){var u=n[o],s=i(u)._domID;if(0!==s){for(;null!==r;r=r.nextSibling)if(a(r,s)){l(u,r);continue e}xn("32",s)}}e._flags|=er.hasCachedChildNodes}}function p(e){if(e[nr])return e[nr];for(var t=[];!e[nr];){if(t.push(e),!e.parentNode)return null;e=e.parentNode}var n,r=e[nr];if(r.tag===$n||r.tag===Xn)return r;for(;e&&(r=e[nr]);e=t.pop())n=r,t.length&&c(r,e);return n}function d(e){var t=e[nr];return t?t.tag===$n||t.tag===Xn?t:t._hostNode===e?t:null:(t=p(e),null!=t&&t._hostNode===e?t:null)}function f(e){if(e.tag===$n||e.tag===Xn)return e.stateNode;if(void 0===e._hostNode&&xn("33"),e._hostNode)return e._hostNode;for(var t=[];!e._hostNode;)t.push(e),e._hostParent||xn("34"),e=e._hostParent;for(;t.length;e=t.pop())c(e,e._hostNode);return e._hostNode}function h(e){return e[rr]||null}function g(e,t){e[rr]=t}function v(e){if("function"==typeof e.getName)return e.getName();if("number"==typeof e.tag){var t=e,n=t.type;if("string"==typeof n)return n;if("function"==typeof n)return n.displayName||n.name}return null}function m(e){var t=e;if(e.alternate)for(;t.return;)t=t.return;else{if((t.effectTag&yr)!==mr)return br;for(;t.return;)if(t=t.return,(t.effectTag&yr)!==mr)return br}return t.tag===hr?Cr:Er}function y(e){m(e)!==Cr&&xn("188")}function b(e){var t=e.alternate;if(!t){var n=m(e);return n===Er&&xn("188"),n===br?null:e}for(var r=e,o=t;;){var a=r.return,i=a?a.alternate:null;if(!a||!i)break;if(a.child===i.child){for(var l=a.child;l;){if(l===r)return y(a),e;if(l===o)return y(a),t;l=l.sibling}xn("188")}if(r.return!==o.return)r=a,o=i;else{for(var u=!1,s=a.child;s;){if(s===r){u=!0,r=a,o=i;break}if(s===o){u=!0,o=a,r=i;break}s=s.sibling}if(!u){for(s=i.child;s;){if(s===r){u=!0,r=i,o=a;break}if(s===o){u=!0,o=i,r=a;break}s=s.sibling}u||xn("189")}}r.alternate!==o&&xn("190")}return r.tag!==hr&&xn("188"),r.stateNode.current===r?e:t}function C(e){return"topMouseUp"===e||"topTouchEnd"===e||"topTouchCancel"===e}function E(e){return"topMouseMove"===e||"topTouchMove"===e}function k(e){return"topMouseDown"===e||"topTouchStart"===e}function P(e,t,n,r){var o=e.type||"unknown-event";e.currentTarget=Dr.getNodeFromInstance(r),Fr.invokeGuardedCallbackAndCatchFirstError(o,n,void 0,e),e.currentTarget=null}function T(e,t){var n=e._dispatchListeners,r=e._dispatchInstances;if(Array.isArray(n))for(var o=0;o<n.length&&!e.isPropagationStopped();o++)P(e,t,n[o],r[o]);else n&&P(e,t,n,r);e._dispatchListeners=null,e._dispatchInstances=null}function x(e){var t=e._dispatchListeners,n=e._dispatchInstances;if(Array.isArray(t)){for(var r=0;r<t.length&&!e.isPropagationStopped();r++)if(t[r](e,n[r]))return n[r]}else if(t&&t(e,n))return n;return null}function w(e){var t=x(e);return e._dispatchInstances=null,e._dispatchListeners=null,t}function N(e){var t=e._dispatchListeners,n=e._dispatchInstances;Array.isArray(t)&&xn("103"),e.currentTarget=t?Dr.getNodeFromInstance(n):null;var r=t?t(e):null;return e.currentTarget=null,e._dispatchListeners=null,e._dispatchInstances=null,r}function S(e){return!!e._dispatchListeners}function _(e){var t=Ar.getInstanceFromNode(e);if(t){if("number"==typeof t.tag){Rr&&"function"==typeof Rr.restoreControlledState||xn("194");var n=Ar.getFiberCurrentPropsFromNode(t.stateNode);return void Rr.restoreControlledState(t.stateNode,t.type,n)}"function"!=typeof t.restoreControlledState&&xn("195"),t.restoreControlledState()}}function I(e,t){return jr(e,t)}function F(e,t){return Vr(I,e,t)}function O(e,t){if(zr)return F(e,t);zr=!0;try{return F(e,t)}finally{zr=!1,Br.restoreStateIfNeeded()}}function M(e){var t=e.target||e.srcElement||window;return t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===Qr?t.parentNode:t}function D(e){if("number"==typeof e.tag){for(;e.return;)e=e.return;return e.tag!==Xr?null:e.stateNode.containerInfo}for(;e._hostParent;)e=e._hostParent;return ar.getNodeFromInstance(e).parentNode}function A(e,t,n){this.topLevelType=e,this.nativeEvent=t,this.targetInst=n,this.ancestors=[]}function R(e){var t=e.targetInst,n=t;do{if(!n){e.ancestors.push(n);break}var r=D(n);if(!r)break;e.ancestors.push(n),n=ar.getClosestInstanceFromNode(r)}while(n);for(var o=0;o<e.ancestors.length;o++)t=e.ancestors[o],Gr._handleTopLevel(e.topLevelType,t,e.nativeEvent,$r(e.nativeEvent))}function U(e,t){return null==t&&xn("30"),null==e?t:Array.isArray(e)?Array.isArray(t)?(e.push.apply(e,t),e):(e.push(t),e):Array.isArray(t)?[e].concat(t):[e,t]}function H(e,t,n){Array.isArray(e)?e.forEach(t,n):e&&t.call(n,e)}function L(e){return"button"===e||"input"===e||"select"===e||"textarea"===e}function W(e,t,n){switch(e){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":return!(!n.disabled||!L(t));default:return!1}}function B(e){io.enqueueEvents(e),io.processEventQueue(!1)}function V(e,t){if(!hn.canUseDOM||t&&!("addEventListener"in document))return!1;var n="on"+e,r=n in document;if(!r){var o=document.createElement("div");o.setAttribute(n,"return;"),r="function"==typeof o[n]}return!r&&so&&"wheel"===e&&(r=document.implementation.hasFeature("Events.wheel","3.0")),r}function j(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n["ms"+e]="MS"+t,n["O"+e]="o"+t.toLowerCase(),n}function z(e){if(fo[e])return fo[e];if(!po[e])return e;var t=po[e];for(var n in t)if(t.hasOwnProperty(n)&&n in ho)return fo[e]=t[n];return""}function K(e){return Object.prototype.hasOwnProperty.call(e,ko)||(e[ko]=Eo++,Co[e[ko]]={}),Co[e[ko]]}function Y(e,t){return e+t.charAt(0).toUpperCase()+t.substring(1)}function q(e,t,n){return null==t||"boolean"==typeof t||""===t?"":n||"number"!=typeof t||0===t||Do.hasOwnProperty(e)&&Do[e]?(""+t).trim():t+"px"}function Q(e){return!!zo.hasOwnProperty(e)||!jo.hasOwnProperty(e)&&(Vo.test(e)?(zo[e]=!0,!0):(jo[e]=!0,!1))}function $(e,t){return null==t||e.hasBooleanValue&&!t||e.hasNumericValue&&isNaN(t)||e.hasPositiveNumericValue&&t<1||e.hasOverloadedBooleanValue&&!1===t}function X(){return null}function G(){return null}function Z(){qo.getCurrentStack=null,Qo.current=null,Qo.phase=null}function J(e,t){qo.getCurrentStack=G,Qo.current=e,Qo.phase=t}function ee(e){return"checkbox"===e.type||"radio"===e.type?null!=e.checked:null!=e.value}function te(e,t){var n=t.name;if("radio"===t.type&&null!=n){for(var r=e;r.parentNode;)r=r.parentNode;for(var o=r.querySelectorAll("input[name="+JSON.stringify(""+n)+'][type="radio"]'),a=0;a<o.length;a++){var i=o[a];if(i!==e&&i.form===e.form){var l=ar.getFiberCurrentPropsFromNode(i);l||xn("90"),Xo.updateWrapper(i,l)}}}}function ne(e){var t="";return yn.Children.forEach(e,function(e){null!=e&&("string"!=typeof e&&"number"!=typeof e||(t+=e))}),t}function re(e,t,n){var r=e.options;if(t){for(var o=n,a={},i=0;i<o.length;i++)a["$"+o[i]]=!0;for(var l=0;l<r.length;l++){var u=a.hasOwnProperty("$"+r[l].value);r[l].selected!==u&&(r[l].selected=u)}}else{for(var s=""+n,c=0;c<r.length;c++)if(r[c].value===s)return void(r[c].selected=!0);r.length&&(r[0].selected=!0)}}function oe(e){return""}function ae(e,t,n){t&&(ua[e]&&(null!=t.children||null!=t.dangerouslySetInnerHTML)&&xn("137",e,oe(n)),null!=t.dangerouslySetInnerHTML&&(null!=t.children&&xn("60"),"object"==typeof t.dangerouslySetInnerHTML&&sa in t.dangerouslySetInnerHTML||xn("61")),null!=t.style&&"object"!=typeof t.style&&xn("62",oe(n)))}function ie(e){var t=e.type,n=e.nodeName;return n&&"input"===n.toLowerCase()&&("checkbox"===t||"radio"===t)}function le(e){return e._valueTracker}function ue(e){e._valueTracker=null}function se(e){var t="";return e?t=ie(e)?e.checked?"true":"false":e.value:t}function ce(e){var t=ie(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&"function"==typeof n.get&&"function"==typeof n.set)return Object.defineProperty(e,t,{enumerable:n.enumerable,configurable:!0,get:function(){return n.get.call(this)},set:function(e){r=""+e,n.set.call(this,e)}}),{getValue:function(){return r},setValue:function(e){r=""+e},stopTracking:function(){ue(e),delete e[t]}}}function pe(e,t){return e.indexOf("-")>=0||null!=t.is}function de(e){var t=""+e,n=ba.exec(t);if(!n)return t;var r,o="",a=0,i=0;for(a=n.index;a<t.length;a++){switch(t.charCodeAt(a)){case 34:r="&quot;";break;case 38:r="&amp;";break;case 39:r="&#x27;";break;case 60:r="&lt;";break;case 62:r="&gt;";break;default:continue}i!==a&&(o+=t.substring(i,a)),i=a+1,o+=r}return i!==a?o+t.substring(i,a):o}function fe(e){return"boolean"==typeof e||"number"==typeof e?""+e:de(e)}function he(e,t){var n=e.nodeType===xa||e.nodeType===wa,r=n?e:e.ownerDocument;Na(t,r)}function ge(e){e.onclick=bn}function ve(e,t,n,r){for(var o in n)if(n.hasOwnProperty(o)){var a=n[o];if(o===Oa)Lo.setValueForStyles(e,a);else if(o===_a){var i=a?a[Ma]:void 0;null!=i&&ya(e,i)}else o===Fa?"string"==typeof a?Pa(e,a):"number"==typeof a&&Pa(e,""+a):o===Ia||(Sa.hasOwnProperty(o)?a&&he(t,o):r?Yo.setValueForAttribute(e,o,a):(jn.properties[o]||jn.isCustomAttribute(o))&&null!=a&&Yo.setValueForProperty(e,o,a))}}function me(e,t,n,r){for(var o=0;o<t.length;o+=2){var a=t[o],i=t[o+1];a===Oa?Lo.setValueForStyles(e,i):a===_a?ya(e,i):a===Fa?Pa(e,i):r?null!=i?Yo.setValueForAttribute(e,a,i):Yo.deleteValueForAttribute(e,a):(jn.properties[a]||jn.isCustomAttribute(a))&&(null!=i?Yo.setValueForProperty(e,a,i):Yo.deleteValueForProperty(e,a))}}function ye(e){switch(e){case"svg":return Aa;case"math":return Ra;default:return Da}}function be(e,t){return e!==oi&&e!==ri||t!==oi&&t!==ri?e===ni&&t!==ni?-255:e!==ni&&t===ni?255:e-t:0}function Ce(){return{first:null,last:null,hasForceUpdate:!1,callbackList:null}}function Ee(e){return{priorityLevel:e.priorityLevel,partialState:e.partialState,callback:e.callback,isReplace:e.isReplace,isForced:e.isForced,isTopLevelUnmount:e.isTopLevelUnmount,next:null}}function ke(e,t,n,r){null!==n?n.next=t:(t.next=e.first,e.first=t),null!==r?t.next=r:e.last=t}function Pe(e,t){var n=t.priorityLevel,r=null,o=null;if(null!==e.last&&be(e.last.priorityLevel,n)<=0)r=e.last;else for(o=e.first;null!==o&&be(o.priorityLevel,n)<=0;)r=o,o=o.next;return r}function Te(e){var t=e.alternate,n=e.updateQueue;null===n&&(n=e.updateQueue=Ce());var r=void 0;return null!==t?null===(r=t.updateQueue)&&(r=t.updateQueue=Ce()):r=null,[n,r!==n?r:null]}function xe(e,t){var n=Te(e),r=n[0],o=n[1],a=Pe(r,t),i=null!==a?a.next:r.first;if(null===o)return ke(r,t,a,i),null;var l=Pe(o,t),u=null!==l?l.next:o.first;if(ke(r,t,a,i),i===u&&null!==i||a===l&&null!==a)return null===l&&(o.first=t),null===u&&(o.last=null),null;var s=Ee(t);return ke(o,s,l,u),s}function we(e,t,n,r){xe(e,{priorityLevel:r,partialState:t,callback:n,isReplace:!1,isForced:!1,isTopLevelUnmount:!1,next:null})}function Ne(e,t,n,r){xe(e,{priorityLevel:r,partialState:t,callback:n,isReplace:!0,isForced:!1,isTopLevelUnmount:!1,next:null})}function Se(e,t,n){xe(e,{priorityLevel:n,partialState:null,callback:t,isReplace:!1,isForced:!0,isTopLevelUnmount:!1,next:null})}function _e(e){var t=e.updateQueue;return null===t?ni:e.tag!==ai&&e.tag!==ii?ni:null!==t.first?t.first.priorityLevel:ni}function Ie(e,t,n,r){var o=null===t.element,a={priorityLevel:r,partialState:t,callback:n,isReplace:!1,isForced:!1,isTopLevelUnmount:o,next:null},i=xe(e,a);if(o){var l=Te(e),u=l[0],s=l[1];null!==u&&null!==a.next&&(a.next=null,u.last=a),null!==s&&null!==i&&null!==i.next&&(i.next=null,s.last=a)}}function Fe(e,t,n,r){var o=e.partialState;return"function"==typeof o?o.call(t,n,r):o}function Oe(e,t,n,r,o,a,i){if(null!==e&&e.updateQueue===n){var l=n;n=t.updateQueue={first:l.first,last:l.last,callbackList:null,hasForceUpdate:!1}}for(var u=n.callbackList,s=n.hasForceUpdate,c=o,d=!0,p=n.first;null!==p&&be(p.priorityLevel,i)<=0;){n.first=p.next,null===n.first&&(n.last=null);var f=void 0;p.isReplace?(c=Fe(p,r,c,a),d=!0):(f=Fe(p,r,c,a))&&(c=d?gn({},c,f):gn(c,f),d=!1),p.isForced&&(s=!0),null===p.callback||p.isTopLevelUnmount&&null!==p.next||(u=null!==u?u:[],u.push(p.callback),t.effectTag|=ti),p=p.next}return n.callbackList=u,n.hasForceUpdate=s,null!==n.first||null!==u||s||(t.updateQueue=null),c}function Me(e,t,n){var r=t.callbackList;if(null!==r){t.callbackList=null;for(var o=0;o<r.length;o++){var a=r[o];"function"!=typeof a&&xn("191",a),a.call(n)}}}function De(e){return Ue(e)?Oi:Ii.current}function Ae(e,t,n){var r=e.stateNode;r.__reactInternalMemoizedUnmaskedChildContext=t,r.__reactInternalMemoizedMaskedChildContext=n}function Re(e){return e.tag===xi&&null!=e.type.contextTypes}function Ue(e){return e.tag===xi&&null!=e.type.childContextTypes}function He(e){Ue(e)&&(Si(Fi,e),Si(Ii,e))}function Le(e,t,n){var r=e.stateNode,o=e.type.childContextTypes;if("function"!=typeof r.getChildContext)return t;var a=void 0;a=r.getChildContext();for(var i in a)i in o||xn("108",pr(e)||"Unknown",i);return Pi({},t,a)}function We(e){return!(!e.prototype||!e.prototype.isReactComponent)}function Be(e,t,n,r){var o=void 0;return"function"==typeof e?(o=We(e)?il($i,t,n):il(Qi,t,n),o.type=e):"string"==typeof e?(o=il(Gi,t,n),o.type=e):"object"==typeof e&&null!==e&&"number"==typeof e.tag?o=e:xn("130",null==e?e:typeof e,""),o}function Ve(e){switch(e.tag){case Pl:case Tl:case xl:case wl:var t=e._debugOwner,n=e._debugSource,r=pr(e),o=null;return t&&(o=pr(t)),kl(r,n,o);default:return""}}function je(e){var t="",n=e;do t+=Ve(n),n=n.return;while(n);return t}function ze(e){if(!1!==_l(e)){var t=e.error;console.error(t)}}function Ke(e){if(null===e||void 0===e)return null;var t=hu&&e[hu]||e[gu];return"function"==typeof t?t:null}function Ye(e,t){var n=t.ref;if(null!==n&&"function"!=typeof n){if(t._owner){var r=t._owner,o=void 0;if(r)if("number"==typeof r.tag){var a=r;a.tag!==au&&xn("110"),o=a.stateNode}else o=r.getPublicInstance();o||xn("147",n);var i=""+n;if(null!==e&&null!==e.ref&&e.ref._stringRef===i)return e.ref;var l=function(e){var t=o.refs===Cn?o.refs={}:o.refs;null===e?delete t[i]:t[i]=e};return l._stringRef=i,l}"string"!=typeof n&&xn("148"),t._owner||xn("149",n)}return n}function qe(e,t){"textarea"!==e.type&&xn("31","[object Object]"===Object.prototype.toString.call(t)?"object with keys {"+Object.keys(t).join(", ")+"}":t,"")}function Qe(e,t){function n(n,r){if(t){if(!e){if(null===r.alternate)return;r=r.alternate}var o=n.lastEffect;null!==o?(o.nextEffect=r,n.lastEffect=r):n.firstEffect=n.lastEffect=r,r.nextEffect=null,r.effectTag=fu}}function r(e,r){if(!t)return null;for(var o=r;null!==o;)n(e,o),o=o.sibling;return null}function o(e,t){for(var n=new Map,r=t;null!==r;)null!==r.key?n.set(r.key,r):n.set(r.index,r),r=r.sibling;return n}function a(t,n){if(e){var r=Xl(t,n);return r.index=0,r.sibling=null,r}return t.pendingWorkPriority=n,t.effectTag=pu,t.index=0,t.sibling=null,t}function i(e,n,r){if(e.index=r,!t)return n;var o=e.alternate;if(null!==o){var a=o.index;return a<n?(e.effectTag=du,n):a}return e.effectTag=du,n}function l(e){return t&&null===e.alternate&&(e.effectTag=du),e}function u(e,t,n,r){if(null===t||t.tag!==iu){var o=Jl(n,e.internalContextTag,r);return o.return=e,o}var i=a(t,r);return i.pendingProps=n,i.return=e,i}function s(e,t,n,r){if(null===t||t.type!==n.type){var o=Gl(n,e.internalContextTag,r);return o.ref=Ye(t,n),o.return=e,o}var i=a(t,r);return i.ref=Ye(t,n),i.pendingProps=n.props,i.return=e,i}function c(e,t,n,r){if(null===t||t.tag!==uu){var o=eu(n,e.internalContextTag,r);return o.return=e,o}var i=a(t,r);return i.pendingProps=n,i.return=e,i}function d(e,t,n,r){if(null===t||t.tag!==su){var o=tu(n,e.internalContextTag,r);return o.type=n.value,o.return=e,o}var i=a(t,r);return i.type=n.value,i.return=e,i}function p(e,t,n,r){if(null===t||t.tag!==lu||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation){var o=nu(n,e.internalContextTag,r);return o.return=e,o}var i=a(t,r);return i.pendingProps=n.children||[],i.return=e,i}function f(e,t,n,r){if(null===t||t.tag!==cu){var o=Zl(n,e.internalContextTag,r);return o.return=e,o}var i=a(t,r);return i.pendingProps=n,i.return=e,i}function h(e,t,n){if("string"==typeof t||"number"==typeof t){var r=Jl(""+t,e.internalContextTag,n);return r.return=e,r}if("object"==typeof t&&null!==t){switch(t.$$typeof){case vu:var o=Gl(t,e.internalContextTag,n);return o.ref=Ye(null,t),o.return=e,o;case ql:var a=eu(t,e.internalContextTag,n);return a.return=e,a;case Ql:var i=tu(t,e.internalContextTag,n);return i.type=t.value,i.return=e,i;case $l:var l=nu(t,e.internalContextTag,n);return l.return=e,l}if(ru(t)||Ke(t)){var u=Zl(t,e.internalContextTag,n);return u.return=e,u}qe(e,t)}return null}function g(e,t,n,r){var o=null!==t?t.key:null;if("string"==typeof n||"number"==typeof n)return null!==o?null:u(e,t,""+n,r);if("object"==typeof n&&null!==n){switch(n.$$typeof){case vu:return n.key===o?s(e,t,n,r):null;case ql:return n.key===o?c(e,t,n,r):null;case Ql:return null===o?d(e,t,n,r):null;case $l:return n.key===o?p(e,t,n,r):null}if(ru(n)||Ke(n))return null!==o?null:f(e,t,n,r);qe(e,n)}return null}function v(e,t,n,r,o){if("string"==typeof r||"number"==typeof r)return u(t,e.get(n)||null,""+r,o);if("object"==typeof r&&null!==r){switch(r.$$typeof){case vu:return s(t,e.get(null===r.key?n:r.key)||null,r,o);case ql:return c(t,e.get(null===r.key?n:r.key)||null,r,o);case Ql:return d(t,e.get(n)||null,r,o);case $l:return p(t,e.get(null===r.key?n:r.key)||null,r,o)}if(ru(r)||Ke(r))return f(t,e.get(n)||null,r,o);qe(t,r)}return null}function m(e,a,l,u){for(var s=null,c=null,d=a,p=0,f=0,m=null;null!==d&&f<l.length;f++){d.index>f?(m=d,d=null):m=d.sibling;var y=g(e,d,l[f],u);if(null===y){null===d&&(d=m);break}t&&d&&null===y.alternate&&n(e,d),p=i(y,p,f),null===c?s=y:c.sibling=y,c=y,d=m}if(f===l.length)return r(e,d),s;if(null===d){for(;f<l.length;f++){var b=h(e,l[f],u);b&&(p=i(b,p,f),null===c?s=b:c.sibling=b,c=b)}return s}for(var C=o(e,d);f<l.length;f++){var E=v(C,e,f,l[f],u);E&&(t&&null!==E.alternate&&C.delete(null===E.key?f:E.key),p=i(E,p,f),null===c?s=E:c.sibling=E,c=E)}return t&&C.forEach(function(t){return n(e,t)}),s}function y(e,a,l,u){var s=Ke(l);"function"!=typeof s&&xn("150");var c=s.call(l);null==c&&xn("151");for(var d=null,p=null,f=a,m=0,y=0,b=null,C=c.next();null!==f&&!C.done;y++,C=c.next()){f.index>y?(b=f,f=null):b=f.sibling;var E=g(e,f,C.value,u);if(null===E){f||(f=b);break}t&&f&&null===E.alternate&&n(e,f),m=i(E,m,y),null===p?d=E:p.sibling=E,p=E,f=b}if(C.done)return r(e,f),d;if(null===f){for(;!C.done;y++,C=c.next()){var x=h(e,C.value,u);null!==x&&(m=i(x,m,y),null===p?d=x:p.sibling=x,p=x)}return d}for(var k=o(e,f);!C.done;y++,C=c.next()){var P=v(k,e,y,C.value,u);null!==P&&(t&&null!==P.alternate&&k.delete(null===P.key?y:P.key),m=i(P,m,y),null===p?d=P:p.sibling=P,p=P)}return t&&k.forEach(function(t){return n(e,t)}),d}function b(e,t,n,o){if(null!==t&&t.tag===iu){r(e,t.sibling);var i=a(t,o);return i.pendingProps=n,i.return=e,i}r(e,t);var l=Jl(n,e.internalContextTag,o);return l.return=e,l}function C(e,t,o,i){for(var l=o.key,u=t;null!==u;){if(u.key===l){if(u.type===o.type){r(e,u.sibling);var s=a(u,i);return s.ref=Ye(u,o),s.pendingProps=o.props,s.return=e,s}r(e,u);break}n(e,u),u=u.sibling}var c=Gl(o,e.internalContextTag,i);return c.ref=Ye(t,o),c.return=e,c}function E(e,t,o,i){for(var l=o.key,u=t;null!==u;){if(u.key===l){if(u.tag===uu){r(e,u.sibling);var s=a(u,i);return s.pendingProps=o,s.return=e,s}r(e,u);break}n(e,u),u=u.sibling}var c=eu(o,e.internalContextTag,i);return c.return=e,c}function x(e,t,n,o){var i=t;if(null!==i){if(i.tag===su){r(e,i.sibling);var l=a(i,o);return l.type=n.value,l.return=e,l}r(e,i)}var u=tu(n,e.internalContextTag,o);return u.type=n.value,u.return=e,u}function k(e,t,o,i){for(var l=o.key,u=t;null!==u;){if(u.key===l){if(u.tag===lu&&u.stateNode.containerInfo===o.containerInfo&&u.stateNode.implementation===o.implementation){r(e,u.sibling);var s=a(u,i);return s.pendingProps=o.children||[],s.return=e,s}r(e,u);break}n(e,u),u=u.sibling}var c=nu(o,e.internalContextTag,i);return c.return=e,c}function P(e,t,n,o){var a=wo.disableNewFiberFeatures,i="object"==typeof n&&null!==n;if(i)if(a)switch(n.$$typeof){case vu:return l(C(e,t,n,o));case $l:return l(k(e,t,n,o))}else switch(n.$$typeof){case vu:return l(C(e,t,n,o));case ql:return l(E(e,t,n,o));case Ql:return l(x(e,t,n,o));case $l:return l(k(e,t,n,o))}if(a)switch(e.tag){case au:var u=e.type;null!==n&&!1!==n&&xn("109",u.displayName||u.name||"Component");break;case ou:var s=e.type;null!==n&&!1!==n&&xn("105",s.displayName||s.name||"Component")}if("string"==typeof n||"number"==typeof n)return l(b(e,t,""+n,o));if(ru(n))return m(e,t,n,o);if(Ke(n))return y(e,t,n,o);if(i&&qe(e,n),!a&&void 0===n)switch(e.tag){case au:case ou:var c=e.type;xn("152",c.displayName||c.name||"Component")}return r(e,t)}return P}function $e(e){return function(t){try{return e(t)}catch(e){}}}function Xe(e){if("undefined"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__)return!1;var t=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!t.supportsFiber)return!0;try{var n=t.inject(e);Fs=$e(function(e){return t.onCommitFiberRoot(n,e)}),Os=$e(function(e){return t.onCommitFiberUnmount(n,e)})}catch(e){}return!0}function Ge(e){"function"==typeof Fs&&Fs(e)}function Ze(e){"function"==typeof Os&&Os(e)}function Je(e){if(!e)return Cn;var t=lr.get(e);return"number"==typeof t.tag?jc(t):t._processChildContext(t._context)}function et(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function tt(e){for(;e;){if(e.nextSibling)return e.nextSibling;e=e.parentNode}}function nt(e,t){for(var n=et(e),r=0,o=0;n;){if(n.nodeType===ep){if(o=r+n.textContent.length,r<=t&&o>=t)return{node:n,offset:t-r};r=o}n=et(tt(n))}}function rt(){return!np&&hn.canUseDOM&&(np="textContent"in document.documentElement?"textContent":"innerText"),np}function ot(e,t,n,r){return e===n&&t===r}function at(e){var t=window.getSelection&&window.getSelection();if(!t||0===t.rangeCount)return null;var n=t.anchorNode,r=t.anchorOffset,o=t.focusNode,a=t.focusOffset,i=t.getRangeAt(0);try{i.startContainer.nodeType,i.endContainer.nodeType}catch(e){return null}var l=ot(t.anchorNode,t.anchorOffset,t.focusNode,t.focusOffset),u=l?0:i.toString().length,s=i.cloneRange();s.selectNodeContents(e),s.setEnd(i.startContainer,i.startOffset);var c=ot(s.startContainer,s.startOffset,s.endContainer,s.endOffset),d=c?0:s.toString().length,p=d+u,f=document.createRange();f.setStart(n,r),f.setEnd(o,a);var h=f.collapsed;return{start:h?p:d,end:h?d:p}}function it(e,t){if(window.getSelection){var n=window.getSelection(),r=e[rp()].length,o=Math.min(t.start,r),a=void 0===t.end?o:Math.min(t.end,r);if(!n.extend&&o>a){var i=a;a=o,o=i}var l=tp(e,o),u=tp(e,a);if(l&&u){var s=document.createRange();s.setStart(l.node,l.offset),n.removeAllRanges(),o>a?(n.addRange(s),n.extend(u.node,u.offset)):(s.setEnd(u.node,u.offset),n.addRange(s))}}}function lt(e){return kn(document.documentElement,e)}function ut(e){if(void 0!==e._hostParent)return e._hostParent;if("number"==typeof e.tag){do e=e.return;while(e&&e.tag!==gp);if(e)return e}return null}function st(e,t){for(var n=0,r=e;r;r=ut(r))n++;for(var o=0,a=t;a;a=ut(a))o++;for(;n-o>0;)e=ut(e),n--;for(;o-n>0;)t=ut(t),o--;for(var i=n;i--;){if(e===t||e===t.alternate)return e;e=ut(e),t=ut(t)}return null}function ct(e,t){for(;t;){if(e===t||e===t.alternate)return!0;t=ut(t)}return!1}function pt(e){return ut(e)}function dt(e,t,n){for(var r=[];e;)r.push(e),e=ut(e);var o;for(o=r.length;o-- >0;)t(r[o],"captured",n);for(o=0;o<r.length;o++)t(r[o],"bubbled",n)}function ft(e,t,n,r,o){for(var a=e&&t?st(e,t):null,i=[];e&&e!==a;)i.push(e),e=ut(e);for(var l=[];t&&t!==a;)l.push(t),t=ut(t);var u;for(u=0;u<i.length;u++)n(i[u],"bubbled",r);for(u=l.length;u-- >0;)n(l[u],"captured",o)}function ht(e,t,n){var r=t.dispatchConfig.phasedRegistrationNames[n];return mp(e,r)}function gt(e,t,n){var r=ht(e,n,t);r&&(n._dispatchListeners=Jr(n._dispatchListeners,r),n._dispatchInstances=Jr(n._dispatchInstances,e))}function vt(e){e&&e.dispatchConfig.phasedRegistrationNames&&vp.traverseTwoPhase(e._targetInst,gt,e)}function mt(e){if(e&&e.dispatchConfig.phasedRegistrationNames){var t=e._targetInst,n=t?vp.getParentInstance(t):null;vp.traverseTwoPhase(n,gt,e)}}function yt(e,t,n){if(e&&n&&n.dispatchConfig.registrationName){var r=n.dispatchConfig.registrationName,o=mp(e,r);o&&(n._dispatchListeners=Jr(n._dispatchListeners,o),n._dispatchInstances=Jr(n._dispatchInstances,e))}}function bt(e){e&&e.dispatchConfig.registrationName&&yt(e._targetInst,null,e)}function Ct(e){eo(e,vt)}function Et(e){eo(e,mt)}function kt(e,t,n,r){vp.traverseEnterLeave(n,r,yt,e,t)}function Pt(e){eo(e,bt)}function Tt(e){this._root=e,this._startText=this.getText(),this._fallbackText=null}function xt(e,t,n,r){this.dispatchConfig=e,this._targetInst=t,this.nativeEvent=n;var o=this.constructor.Interface;for(var a in o)if(o.hasOwnProperty(a)){var i=o[a];i?this[a]=i(n):"target"===a?this.target=r:this[a]=n[a]}var l=null!=n.defaultPrevented?n.defaultPrevented:!1===n.returnValue;return this.isDefaultPrevented=l?bn.thatReturnsTrue:bn.thatReturnsFalse,this.isPropagationStopped=bn.thatReturnsFalse,this}function wt(e,t,n,r){return Pp.call(this,e,t,n,r)}function Nt(e,t,n,r){return Pp.call(this,e,t,n,r)}function St(){var e=window.opera;return"object"==typeof e&&"function"==typeof e.version&&parseInt(e.version(),10)<=12}function _t(e){return(e.ctrlKey||e.altKey||e.metaKey)&&!(e.ctrlKey&&e.altKey)}function It(e){switch(e){case"topCompositionStart":return Rp.compositionStart;case"topCompositionEnd":return Rp.compositionEnd;case"topCompositionUpdate":return Rp.compositionUpdate}}function Ft(e,t){return"topKeyDown"===e&&t.keyCode===_p}function Ot(e,t){switch(e){case"topKeyUp":return-1!==Sp.indexOf(t.keyCode);case"topKeyDown":return t.keyCode!==_p;case"topKeyPress":case"topMouseDown":case"topBlur":return!0;default:return!1}}function Mt(e){var t=e.detail;return"object"==typeof t&&"data"in t?t.data:null}function Dt(e,t,n,r){var o,a;if(Ip?o=It(e):Hp?Ot(e,n)&&(o=Rp.compositionEnd):Ft(e,n)&&(o=Rp.compositionStart),!o)return null;Mp&&(Hp||o!==Rp.compositionStart?o===Rp.compositionEnd&&Hp&&(a=Hp.getData()):Hp=Cp.getPooled(r));var i=xp.getPooled(o,t,n,r);if(a)i.data=a;else{var l=Mt(n);null!==l&&(i.data=l)}return bp.accumulateTwoPhaseDispatches(i),i}function At(e,t){switch(e){case"topCompositionEnd":return Mt(t);case"topKeyPress":return t.which!==Dp?null:(Up=!0,Ap);case"topTextInput":var n=t.data;return n===Ap&&Up?null:n;default:return null}}function Rt(e,t){if(Hp){if("topCompositionEnd"===e||!Ip&&Ot(e,t)){var n=Hp.getData();return Cp.release(Hp),Hp=null,n}return null}switch(e){case"topPaste":return null;case"topKeyPress":if(!_t(t)){if(t.char&&t.char.length>1)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"topCompositionEnd":return Mp?null:t.data;default:return null}}function Ut(e,t,n,r){var o;if(!(o=Op?At(e,n):Rt(e,n)))return null;var a=Np.getPooled(Rp.beforeInput,t,n,r);return a.data=o,bp.accumulateTwoPhaseDispatches(a),a}function Ht(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!Bp[e.type]:"textarea"===t}function Lt(e){var t=e.nodeName&&e.nodeName.toLowerCase();return"select"===t||"input"===t&&"file"===e.type}function Wt(e,t,n){var r=Pp.getPooled(jp.change,e,t,n);return r.type="change",Br.enqueueStateRestore(n),bp.accumulateTwoPhaseDispatches(r),r}function Bt(e,t){if(da.updateValueIfChanged(t))return e}function Vt(e,t,n){if("topInput"===e||"topChange"===e||"topSelectionChange"===e||"topKeyUp"===e||"topKeyDown"===e)return Bt(t,n)}function jt(e,t,n){if("topInput"===e||"topChange"===e)return Bt(t,n)}function zt(e,t,n){if("topChange"===e)return Bt(t,n)}function Kt(e,t){if(null!=e){var n=e._wrapperState||t._wrapperState;if(n&&n.controlled&&"number"===t.type){var r=""+t.value;t.getAttribute("value")!==r&&t.setAttribute("value",r)}}}function Yt(e,t,n,r){return Pp.call(this,e,t,n,r)}function qt(e){var t=this,n=t.nativeEvent;if(n.getModifierState)return n.getModifierState(e);var r=Gp[e];return!!r&&!!n[r]}function Qt(e){return qt}function $t(e,t,n,r){return Xp.call(this,e,t,n,r)}function Xt(e){if("selectionStart"in e&&up.hasSelectionCapabilities(e))return{start:e.selectionStart,end:e.selectionEnd};if(window.getSelection){var t=window.getSelection();return{anchorNode:t.anchorNode,anchorOffset:t.anchorOffset,focusNode:t.focusNode,focusOffset:t.focusOffset}}}function Gt(e,t){if(cd||null==ld||ld!==Tn())return null;var n=Xt(ld);if(!sd||!En(sd,n)){sd=n;var r=Pp.getPooled(id.select,ud,e,t);return r.type="select",r.target=ld,bp.accumulateTwoPhaseDispatches(r),r}return null}function Zt(e,t,n,r){return Pp.call(this,e,t,n,r)}function Jt(e,t,n,r){return Pp.call(this,e,t,n,r)}function en(e,t,n,r){return Xp.call(this,e,t,n,r)}function tn(e){var t,n=e.keyCode;return"charCode"in e?0===(t=e.charCode)&&13===n&&(t=13):t=n,t>=32||13===t?t:0}function nn(e){if(e.key){var t=Ed[e.key]||e.key;if("Unidentified"!==t)return t}if("keypress"===e.type){var n=Cd(e);return 13===n?"Enter":String.fromCharCode(n)}return"keydown"===e.type||"keyup"===e.type?kd[e.keyCode]||"Unidentified":""}function rn(e,t,n,r){return Xp.call(this,e,t,n,r)}function on(e,t,n,r){return ed.call(this,e,t,n,r)}function an(e,t,n,r){return Xp.call(this,e,t,n,r)}function ln(e,t,n,r){return Pp.call(this,e,t,n,r)}function un(e,t,n,r){return ed.call(this,e,t,n,r)}function sn(e){return!(!e||e.nodeType!==Jd&&e.nodeType!==nf&&e.nodeType!==rf&&(e.nodeType!==tf||" react-mount-point-unstable "!==e.nodeValue))}function cn(e){return e?e.nodeType===nf?e.documentElement:e.firstChild:null}function pn(e){var t=cn(e);return!(!t||t.nodeType!==Jd||!t.hasAttribute(of))}function dn(e,t){switch(e){case"button":case"input":case"select":case"textarea":return!!t.autoFocus}return!1}function fn(e,t,n,r,o){vn(sn(n),"Target container is not a DOM element.");var a=n._reactRootContainer;if(a)Ef.updateContainer(t,a,e,o);else{if(!r&&!pn(n))for(var i=void 0;i=n.lastChild;)n.removeChild(i);var l=Ef.createContainer(n);a=n._reactRootContainer=l,Ef.unbatchedUpdates(function(){Ef.updateContainer(t,l,e,o)})}return Ef.getPublicRootInstance(a)}var hn=require("fbjs/lib/ExecutionEnvironment"),gn=require("object-assign"),vn=require("fbjs/lib/invariant"),mn=require("fbjs/lib/EventListener"),yn=require("react"),bn=require("fbjs/lib/emptyFunction"),Cn=require("fbjs/lib/emptyObject"),En=require("fbjs/lib/shallowEqual"),kn=require("fbjs/lib/containsNode"),Pn=require("fbjs/lib/focusNode"),Tn=require("fbjs/lib/getActiveElement"),xn=e,wn=null,Nn={},Sn={plugins:[],eventNameDispatchConfigs:{},registrationNameModules:{},registrationNameDependencies:{},possibleRegistrationNames:null,injectEventPluginOrder:function(e){
+wn&&xn("101"),wn=Array.prototype.slice.call(e),t()},injectEventPluginsByName:function(e){var n=!1;for(var r in e)if(e.hasOwnProperty(r)){var o=e[r];Nn.hasOwnProperty(r)&&Nn[r]===o||(Nn[r]&&xn("102",r),Nn[r]=o,n=!0)}n&&t()}},_n=Sn,In=function(e){var t=this;if(t.instancePool.length){var n=t.instancePool.pop();return t.call(n,e),n}return new t(e)},Fn=function(e,t){var n=this;if(n.instancePool.length){var r=n.instancePool.pop();return n.call(r,e,t),r}return new n(e,t)},On=function(e,t,n){var r=this;if(r.instancePool.length){var o=r.instancePool.pop();return r.call(o,e,t,n),o}return new r(e,t,n)},Mn=function(e,t,n,r){var o=this;if(o.instancePool.length){var a=o.instancePool.pop();return o.call(a,e,t,n,r),a}return new o(e,t,n,r)},Dn=function(e){var t=this;e instanceof t||xn("25"),e.destructor(),t.instancePool.length<t.poolSize&&t.instancePool.push(e)},An=10,Rn=In,Un=function(e,t){var n=e;return n.instancePool=[],n.getPooled=t||Rn,n.poolSize||(n.poolSize=An),n.release=Dn,n},Hn={addPoolingTo:Un,oneArgumentPooler:In,twoArgumentPooler:Fn,threeArgumentPooler:On,fourArgumentPooler:Mn},Ln=Hn,Wn={MUST_USE_PROPERTY:1,HAS_BOOLEAN_VALUE:4,HAS_NUMERIC_VALUE:8,HAS_POSITIVE_NUMERIC_VALUE:24,HAS_OVERLOADED_BOOLEAN_VALUE:32,injectDOMPropertyConfig:function(e){var t=Wn,n=e.Properties||{},r=e.DOMAttributeNamespaces||{},a=e.DOMAttributeNames||{},i=e.DOMPropertyNames||{},l=e.DOMMutationMethods||{};e.isCustomAttribute&&Vn._isCustomAttributeFunctions.push(e.isCustomAttribute);for(var u in n){Vn.properties.hasOwnProperty(u)&&xn("48",u);var s=u.toLowerCase(),c=n[u],d={attributeName:s,attributeNamespace:null,propertyName:u,mutationMethod:null,mustUseProperty:o(c,t.MUST_USE_PROPERTY),hasBooleanValue:o(c,t.HAS_BOOLEAN_VALUE),hasNumericValue:o(c,t.HAS_NUMERIC_VALUE),hasPositiveNumericValue:o(c,t.HAS_POSITIVE_NUMERIC_VALUE),hasOverloadedBooleanValue:o(c,t.HAS_OVERLOADED_BOOLEAN_VALUE)};if(d.hasBooleanValue+d.hasNumericValue+d.hasOverloadedBooleanValue<=1||xn("50",u),a.hasOwnProperty(u)){var p=a[u];d.attributeName=p}r.hasOwnProperty(u)&&(d.attributeNamespace=r[u]),i.hasOwnProperty(u)&&(d.propertyName=i[u]),l.hasOwnProperty(u)&&(d.mutationMethod=l[u]),Vn.properties[u]=d}}},Bn=":A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",Vn={ID_ATTRIBUTE_NAME:"data-reactid",ROOT_ATTRIBUTE_NAME:"data-reactroot",ATTRIBUTE_NAME_START_CHAR:Bn,ATTRIBUTE_NAME_CHAR:Bn+"\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",properties:{},getPossibleStandardName:null,_isCustomAttributeFunctions:[],isCustomAttribute:function(e){for(var t=0;t<Vn._isCustomAttributeFunctions.length;t++)if((0,Vn._isCustomAttributeFunctions[t])(e))return!0;return!1},injection:Wn},jn=Vn,zn={hasCachedChildNodes:1},Kn=zn,Yn={IndeterminateComponent:0,FunctionalComponent:1,ClassComponent:2,HostRoot:3,HostPortal:4,HostComponent:5,HostText:6,CoroutineComponent:7,CoroutineHandlerPhase:8,YieldComponent:9,Fragment:10},qn={ELEMENT_NODE:1,TEXT_NODE:3,COMMENT_NODE:8,DOCUMENT_NODE:9,DOCUMENT_FRAGMENT_NODE:11},Qn=qn,$n=Yn.HostComponent,Xn=Yn.HostText,Gn=Qn.ELEMENT_NODE,Zn=Qn.COMMENT_NODE,Jn=jn.ID_ATTRIBUTE_NAME,er=Kn,tr=Math.random().toString(36).slice(2),nr="__reactInternalInstance$"+tr,rr="__reactEventHandlers$"+tr,or={getClosestInstanceFromNode:p,getInstanceFromNode:d,getNodeFromInstance:f,precacheChildNodes:c,precacheNode:l,uncacheNode:s,precacheFiberNode:u,getFiberCurrentPropsFromNode:h,updateFiberProps:g},ar=or,ir={remove:function(e){e._reactInternalInstance=void 0},get:function(e){return e._reactInternalInstance},has:function(e){return void 0!==e._reactInternalInstance},set:function(e,t){e._reactInternalInstance=t}},lr=ir,ur=yn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,sr={ReactCurrentOwner:ur.ReactCurrentOwner},cr=sr,pr=v,dr={NoEffect:0,PerformedWork:1,Placement:2,Update:4,PlacementAndUpdate:6,Deletion:8,ContentReset:16,Callback:32,Err:64,Ref:128},fr=Yn.HostComponent,hr=Yn.HostRoot,gr=Yn.HostPortal,vr=Yn.HostText,mr=dr.NoEffect,yr=dr.Placement,br=1,Cr=2,Er=3,kr=function(e){return m(e)===Cr},Pr=function(e){var t=lr.get(e);return!!t&&m(t)===Cr},Tr=b,xr=function(e){var t=b(e);if(!t)return null;for(var n=t;;){if(n.tag===fr||n.tag===vr)return n;if(n.child)n.child.return=n,n=n.child;else{if(n===t)return null;for(;!n.sibling;){if(!n.return||n.return===t)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}}return null},wr=function(e){var t=b(e);if(!t)return null;for(var n=t;;){if(n.tag===fr||n.tag===vr)return n;if(n.child&&n.tag!==gr)n.child.return=n,n=n.child;else{if(n===t)return null;for(;!n.sibling;){if(!n.return||n.return===t)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}}return null},Nr={isFiberMounted:kr,isMounted:Pr,findCurrentFiberUsingSlowPath:Tr,findCurrentHostFiber:xr,findCurrentHostFiberWithNoPortals:wr},Sr={_caughtError:null,_hasCaughtError:!1,_rethrowError:null,_hasRethrowError:!1,injection:{injectErrorUtils:function(e){"function"!=typeof e.invokeGuardedCallback&&xn("197"),_r=e.invokeGuardedCallback}},invokeGuardedCallback:function(e,t,n,r,o,a,i,l,u){_r.apply(Sr,arguments)},invokeGuardedCallbackAndCatchFirstError:function(e,t,n,r,o,a,i,l,u){if(Sr.invokeGuardedCallback.apply(this,arguments),Sr.hasCaughtError()){var s=Sr.clearCaughtError();Sr._hasRethrowError||(Sr._hasRethrowError=!0,Sr._rethrowError=s)}},rethrowCaughtError:function(){return Ir.apply(Sr,arguments)},hasCaughtError:function(){return Sr._hasCaughtError},clearCaughtError:function(){if(Sr._hasCaughtError){var e=Sr._caughtError;return Sr._caughtError=null,Sr._hasCaughtError=!1,e}xn("198")}},_r=function(e,t,n,r,o,a,i,l,u){Sr._hasCaughtError=!1,Sr._caughtError=null;var s=Array.prototype.slice.call(arguments,3);try{t.apply(n,s)}catch(e){Sr._caughtError=e,Sr._hasCaughtError=!0}},Ir=function(){if(Sr._hasRethrowError){var e=Sr._rethrowError;throw Sr._rethrowError=null,Sr._hasRethrowError=!1,e}},Fr=Sr,Or,Mr={injectComponentTree:function(e){Or=e}},Dr={isEndish:C,isMoveish:E,isStartish:k,executeDirectDispatch:N,executeDispatchesInOrder:T,executeDispatchesInOrderStopAtTrue:w,hasDispatches:S,getFiberCurrentPropsFromNode:function(e){return Or.getFiberCurrentPropsFromNode(e)},getInstanceFromNode:function(e){return Or.getInstanceFromNode(e)},getNodeFromInstance:function(e){return Or.getNodeFromInstance(e)},injection:Mr},Ar=Dr,Rr=null,Ur={injectFiberControlledHostComponent:function(e){Rr=e}},Hr=null,Lr=null,Wr={injection:Ur,enqueueStateRestore:function(e){Hr?Lr?Lr.push(e):Lr=[e]:Hr=e},restoreStateIfNeeded:function(){if(Hr){var e=Hr,t=Lr;if(Hr=null,Lr=null,_(e),t)for(var n=0;n<t.length;n++)_(t[n])}}},Br=Wr,Vr=function(e,t,n,r,o,a){return e(t,n,r,o,a)},jr=function(e,t){return e(t)},zr=!1,Kr={injectStackBatchedUpdates:function(e){Vr=e},injectFiberBatchedUpdates:function(e){jr=e}},Yr={batchedUpdates:O,injection:Kr},qr=Yr,Qr=Qn.TEXT_NODE,$r=M,Xr=Yn.HostRoot;gn(A.prototype,{destructor:function(){this.topLevelType=null,this.nativeEvent=null,this.targetInst=null,this.ancestors.length=0}}),Ln.addPoolingTo(A,Ln.threeArgumentPooler);var Gr={_enabled:!0,_handleTopLevel:null,setHandleTopLevel:function(e){Gr._handleTopLevel=e},setEnabled:function(e){Gr._enabled=!!e},isEnabled:function(){return Gr._enabled},trapBubbledEvent:function(e,t,n){return n?mn.listen(n,t,Gr.dispatchEvent.bind(null,e)):null},trapCapturedEvent:function(e,t,n){return n?mn.capture(n,t,Gr.dispatchEvent.bind(null,e)):null},dispatchEvent:function(e,t){if(Gr._enabled){var n=$r(t),r=ar.getClosestInstanceFromNode(n);null===r||"number"!=typeof r.tag||Nr.isFiberMounted(r)||(r=null);var o=A.getPooled(e,t,r);try{qr.batchedUpdates(R,o)}finally{A.release(o)}}}},Zr=Gr,Jr=U,eo=H,to=null,no=function(e,t){e&&(Ar.executeDispatchesInOrder(e,t),e.isPersistent()||e.constructor.release(e))},ro=function(e){return no(e,!0)},oo=function(e){return no(e,!1)},ao={injection:{injectEventPluginOrder:_n.injectEventPluginOrder,injectEventPluginsByName:_n.injectEventPluginsByName},getListener:function(e,t){var n;if("number"==typeof e.tag){var r=e.stateNode;if(!r)return null;var o=Ar.getFiberCurrentPropsFromNode(r);if(!o)return null;if(n=o[t],W(t,e.type,o))return null}else{var a=e._currentElement;if("string"==typeof a||"number"==typeof a)return null;if(!e._rootNodeID)return null;var i=a.props;if(n=i[t],W(t,a.type,i))return null}return n&&"function"!=typeof n&&xn("94",t,typeof n),n},extractEvents:function(e,t,n,r){for(var o,a=_n.plugins,i=0;i<a.length;i++){var l=a[i];if(l){var u=l.extractEvents(e,t,n,r);u&&(o=Jr(o,u))}}return o},enqueueEvents:function(e){e&&(to=Jr(to,e))},processEventQueue:function(e){var t=to;to=null,e?eo(t,ro):eo(t,oo),to&&xn("95"),Fr.rethrowCaughtError()}},io=ao,lo={handleTopLevel:function(e,t,n,r){B(io.extractEvents(e,t,n,r))}},uo=lo,so;hn.canUseDOM&&(so=document.implementation&&document.implementation.hasFeature&&!0!==document.implementation.hasFeature("",""));var co=V,po={animationend:j("Animation","AnimationEnd"),animationiteration:j("Animation","AnimationIteration"),animationstart:j("Animation","AnimationStart"),transitionend:j("Transition","TransitionEnd")},fo={},ho={};hn.canUseDOM&&(ho=document.createElement("div").style,"AnimationEvent"in window||(delete po.animationend.animation,delete po.animationiteration.animation,delete po.animationstart.animation),"TransitionEvent"in window||delete po.transitionend.transition);var go=z,vo={topAbort:"abort",topAnimationEnd:go("animationend")||"animationend",topAnimationIteration:go("animationiteration")||"animationiteration",topAnimationStart:go("animationstart")||"animationstart",topBlur:"blur",topCancel:"cancel",topCanPlay:"canplay",topCanPlayThrough:"canplaythrough",topChange:"change",topClick:"click",topClose:"close",topCompositionEnd:"compositionend",topCompositionStart:"compositionstart",topCompositionUpdate:"compositionupdate",topContextMenu:"contextmenu",topCopy:"copy",topCut:"cut",topDoubleClick:"dblclick",topDrag:"drag",topDragEnd:"dragend",topDragEnter:"dragenter",topDragExit:"dragexit",topDragLeave:"dragleave",topDragOver:"dragover",topDragStart:"dragstart",topDrop:"drop",topDurationChange:"durationchange",topEmptied:"emptied",topEncrypted:"encrypted",topEnded:"ended",topError:"error",topFocus:"focus",topInput:"input",topKeyDown:"keydown",topKeyPress:"keypress",topKeyUp:"keyup",topLoadedData:"loadeddata",topLoad:"load",topLoadedMetadata:"loadedmetadata",topLoadStart:"loadstart",topMouseDown:"mousedown",topMouseMove:"mousemove",topMouseOut:"mouseout",topMouseOver:"mouseover",topMouseUp:"mouseup",topPaste:"paste",topPause:"pause",topPlay:"play",topPlaying:"playing",topProgress:"progress",topRateChange:"ratechange",topScroll:"scroll",topSeeked:"seeked",topSeeking:"seeking",topSelectionChange:"selectionchange",topStalled:"stalled",topSuspend:"suspend",topTextInput:"textInput",topTimeUpdate:"timeupdate",topToggle:"toggle",topTouchCancel:"touchcancel",topTouchEnd:"touchend",topTouchMove:"touchmove",topTouchStart:"touchstart",topTransitionEnd:go("transitionend")||"transitionend",topVolumeChange:"volumechange",topWaiting:"waiting",topWheel:"wheel"},mo={topLevelTypes:vo},yo=mo,bo=yo.topLevelTypes,Co={},Eo=0,ko="_reactListenersID"+(""+Math.random()).slice(2),Po=gn({},uo,{setEnabled:function(e){Zr&&Zr.setEnabled(e)},isEnabled:function(){return!(!Zr||!Zr.isEnabled())},listenTo:function(e,t){for(var n=t,r=K(n),o=_n.registrationNameDependencies[e],a=0;a<o.length;a++){var i=o[a];r.hasOwnProperty(i)&&r[i]||("topWheel"===i?co("wheel")?Zr.trapBubbledEvent("topWheel","wheel",n):co("mousewheel")?Zr.trapBubbledEvent("topWheel","mousewheel",n):Zr.trapBubbledEvent("topWheel","DOMMouseScroll",n):"topScroll"===i?Zr.trapCapturedEvent("topScroll","scroll",n):"topFocus"===i||"topBlur"===i?(Zr.trapCapturedEvent("topFocus","focus",n),Zr.trapCapturedEvent("topBlur","blur",n),r.topBlur=!0,r.topFocus=!0):"topCancel"===i?(co("cancel",!0)&&Zr.trapCapturedEvent("topCancel","cancel",n),r.topCancel=!0):"topClose"===i?(co("close",!0)&&Zr.trapCapturedEvent("topClose","close",n),r.topClose=!0):bo.hasOwnProperty(i)&&Zr.trapBubbledEvent(i,bo[i],n),r[i]=!0)}},isListeningToAllDependencies:function(e,t){for(var n=K(t),r=_n.registrationNameDependencies[e],o=0;o<r.length;o++){var a=r[o];if(!n.hasOwnProperty(a)||!n[a])return!1}return!0},trapBubbledEvent:function(e,t,n){return Zr.trapBubbledEvent(e,t,n)},trapCapturedEvent:function(e,t,n){return Zr.trapCapturedEvent(e,t,n)}}),To=Po,xo={disableNewFiberFeatures:!1,enableAsyncSubtreeAPI:!1},wo=xo,No={fiberAsyncScheduling:!1,useFiber:!0},So=No,_o={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Io=["Webkit","ms","Moz","O"];Object.keys(_o).forEach(function(e){Io.forEach(function(t){_o[Y(t,e)]=_o[e]})});var Fo={background:{backgroundAttachment:!0,backgroundColor:!0,backgroundImage:!0,backgroundPositionX:!0,backgroundPositionY:!0,backgroundRepeat:!0},backgroundPosition:{backgroundPositionX:!0,backgroundPositionY:!0},border:{borderWidth:!0,borderStyle:!0,borderColor:!0},borderBottom:{borderBottomWidth:!0,borderBottomStyle:!0,borderBottomColor:!0},borderLeft:{borderLeftWidth:!0,borderLeftStyle:!0,borderLeftColor:!0},borderRight:{borderRightWidth:!0,borderRightStyle:!0,borderRightColor:!0},borderTop:{borderTopWidth:!0,borderTopStyle:!0,borderTopColor:!0},font:{fontStyle:!0,fontVariant:!0,fontWeight:!0,fontSize:!0,lineHeight:!0,fontFamily:!0},outline:{outlineWidth:!0,outlineStyle:!0,outlineColor:!0}},Oo={isUnitlessNumber:_o,shorthandPropertyExpansions:Fo},Mo=Oo,Do=Mo.isUnitlessNumber,Ao=q,Ro=!1;if(hn.canUseDOM){var Uo=document.createElement("div").style;try{Uo.font=""}catch(e){Ro=!0}}var Ho={createDangerousStringForStyles:function(e){},setValueForStyles:function(e,t,n){var r=e.style;for(var o in t)if(t.hasOwnProperty(o)){var a=0===o.indexOf("--"),i=Ao(o,t[o],a);if("float"===o&&(o="cssFloat"),a)r.setProperty(o,i);else if(i)r[o]=i;else{var l=Ro&&Mo.shorthandPropertyExpansions[o];if(l)for(var u in l)r[u]="";else r[o]=""}}}},Lo=Ho,Wo={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg"},Bo=Wo,Vo=new RegExp("^["+jn.ATTRIBUTE_NAME_START_CHAR+"]["+jn.ATTRIBUTE_NAME_CHAR+"]*$"),jo={},zo={},Ko={setAttributeForID:function(e,t){e.setAttribute(jn.ID_ATTRIBUTE_NAME,t)},setAttributeForRoot:function(e){e.setAttribute(jn.ROOT_ATTRIBUTE_NAME,"")},getValueForProperty:function(e,t,n){},getValueForAttribute:function(e,t,n){},setValueForProperty:function(e,t,n){var r=jn.properties.hasOwnProperty(t)?jn.properties[t]:null;if(r){var o=r.mutationMethod;if(o)o(e,n);else{if($(r,n))return void Ko.deleteValueForProperty(e,t);if(r.mustUseProperty)e[r.propertyName]=n;else{var a=r.attributeName,i=r.attributeNamespace;i?e.setAttributeNS(i,a,""+n):r.hasBooleanValue||r.hasOverloadedBooleanValue&&!0===n?e.setAttribute(a,""):e.setAttribute(a,""+n)}}}else if(jn.isCustomAttribute(t))return void Ko.setValueForAttribute(e,t,n)},setValueForAttribute:function(e,t,n){Q(t)&&(null==n?e.removeAttribute(t):e.setAttribute(t,""+n))},deleteValueForAttribute:function(e,t){e.removeAttribute(t)},deleteValueForProperty:function(e,t){var n=jn.properties.hasOwnProperty(t)?jn.properties[t]:null;if(n){var r=n.mutationMethod;if(r)r(e,void 0);else if(n.mustUseProperty){var o=n.propertyName;n.hasBooleanValue?e[o]=!1:e[o]=""}else e.removeAttribute(n.attributeName)}else jn.isCustomAttribute(t)&&e.removeAttribute(t)}},Yo=Ko,qo=cr.ReactDebugCurrentFrame,Qo={current:null,phase:null,resetCurrentFiber:Z,setCurrentFiber:J,getCurrentFiberOwnerName:X,getCurrentFiberStackAddendum:G},$o=Qo,Xo={getHostProps:function(e,t){var n=e,r=t.value,o=t.checked;return gn({type:void 0,step:void 0,min:void 0,max:void 0},t,{defaultChecked:void 0,defaultValue:void 0,value:null!=r?r:n._wrapperState.initialValue,checked:null!=o?o:n._wrapperState.initialChecked})},initWrapperState:function(e,t){var n=t.defaultValue;e._wrapperState={initialChecked:null!=t.checked?t.checked:t.defaultChecked,initialValue:null!=t.value?t.value:n,controlled:ee(t)}},updateWrapper:function(e,t){var n=e,r=t.checked;null!=r&&Yo.setValueForProperty(n,"checked",r||!1);var o=t.value;if(null!=o)if(0===o&&""===n.value)n.value="0";else if("number"===t.type){var a=parseFloat(n.value)||0;(o!=a||o==a&&n.value!=o)&&(n.value=""+o)}else n.value!==""+o&&(n.value=""+o);else null==t.value&&null!=t.defaultValue&&n.defaultValue!==""+t.defaultValue&&(n.defaultValue=""+t.defaultValue),null==t.checked&&null!=t.defaultChecked&&(n.defaultChecked=!!t.defaultChecked)},postMountWrapper:function(e,t){var n=e;switch(t.type){case"submit":case"reset":break;case"color":case"date":case"datetime":case"datetime-local":case"month":case"time":case"week":n.value="",n.value=n.defaultValue;break;default:n.value=n.value}var r=n.name;""!==r&&(n.name=""),n.defaultChecked=!n.defaultChecked,n.defaultChecked=!n.defaultChecked,""!==r&&(n.name=r)},restoreControlledState:function(e,t){var n=e;Xo.updateWrapper(n,t),te(n,t)}},Go=Xo,Zo={validateProps:function(e,t){},postMountWrapper:function(e,t){null!=t.value&&e.setAttribute("value",t.value)},getHostProps:function(e,t){var n=gn({children:void 0},t),r=ne(t.children);return r&&(n.children=r),n}},Jo=Zo,ea={getHostProps:function(e,t){return gn({},t,{value:void 0})},initWrapperState:function(e,t){var n=e,r=t.value;n._wrapperState={initialValue:null!=r?r:t.defaultValue,wasMultiple:!!t.multiple}},postMountWrapper:function(e,t){var n=e;n.multiple=!!t.multiple;var r=t.value;null!=r?re(n,!!t.multiple,r):null!=t.defaultValue&&re(n,!!t.multiple,t.defaultValue)},postUpdateWrapper:function(e,t){var n=e;n._wrapperState.initialValue=void 0;var r=n._wrapperState.wasMultiple;n._wrapperState.wasMultiple=!!t.multiple;var o=t.value;null!=o?re(n,!!t.multiple,o):r!==!!t.multiple&&(null!=t.defaultValue?re(n,!!t.multiple,t.defaultValue):re(n,!!t.multiple,t.multiple?[]:""))},restoreControlledState:function(e,t){var n=e,r=t.value;null!=r&&re(n,!!t.multiple,r)}},ta=ea,na={getHostProps:function(e,t){var n=e;return null!=t.dangerouslySetInnerHTML&&xn("91"),gn({},t,{value:void 0,defaultValue:void 0,children:""+n._wrapperState.initialValue})},initWrapperState:function(e,t){var n=e,r=t.value,o=r;if(null==r){var a=t.defaultValue,i=t.children;null!=i&&(null!=a&&xn("92"),Array.isArray(i)&&(i.length<=1||xn("93"),i=i[0]),a=""+i),null==a&&(a=""),o=a}n._wrapperState={initialValue:""+o}},updateWrapper:function(e,t){var n=e,r=t.value;if(null!=r){var o=""+r;o!==n.value&&(n.value=o),null==t.defaultValue&&(n.defaultValue=o)}null!=t.defaultValue&&(n.defaultValue=t.defaultValue)},postMountWrapper:function(e,t){var n=e,r=n.textContent;r===n._wrapperState.initialValue&&(n.value=r)},restoreControlledState:function(e,t){na.updateWrapper(e,t)}},ra=na,oa={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},aa=oa,ia=gn||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},la=ia({menuitem:!0},aa),ua=la,sa="__html",ca=ae,pa={_getTrackerFromNode:le,track:function(e){le(e)||(e._valueTracker=ce(e))},updateValueIfChanged:function(e){if(!e)return!1;var t=le(e);if(!t)return!0;var n=t.getValue(),r=se(e);return r!==n&&(t.setValue(r),!0)},stopTracking:function(e){var t=le(e);t&&t.stopTracking()}},da=pa,fa=pe,ha=function(e){return"undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction?function(t,n,r,o){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,o)})}:e},ga=ha,va,ma=ga(function(e,t){if(e.namespaceURI!==Bo.svg||"innerHTML"in e)e.innerHTML=t;else{va=va||document.createElement("div"),va.innerHTML="<svg>"+t+"</svg>";for(var n=va.firstChild;n.firstChild;)e.appendChild(n.firstChild)}}),ya=ma,ba=/["'&<>]/,Ca=fe,Ea=Qn.TEXT_NODE,ka=function(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===Ea)return void(n.nodeValue=t)}e.textContent=t};hn.canUseDOM&&("textContent"in document.documentElement||(ka=function(e,t){return e.nodeType===Ea?void(e.nodeValue=t):void ya(e,Ca(t))}));var Pa=ka,Ta=$o.getCurrentFiberOwnerName,xa=Qn.DOCUMENT_NODE,wa=Qn.DOCUMENT_FRAGMENT_NODE,Na=To.listenTo,Sa=_n.registrationNameModules,_a="dangerouslySetInnerHTML",Ia="suppressContentEditableWarning",Fa="children",Oa="style",Ma="__html",Da=Bo.html,Aa=Bo.svg,Ra=Bo.mathml,Ua={topAbort:"abort",topCanPlay:"canplay",topCanPlayThrough:"canplaythrough",topDurationChange:"durationchange",topEmptied:"emptied",topEncrypted:"encrypted",topEnded:"ended",topError:"error",topLoadedData:"loadeddata",topLoadedMetadata:"loadedmetadata",topLoadStart:"loadstart",topPause:"pause",topPlay:"play",topPlaying:"playing",topProgress:"progress",topRateChange:"ratechange",topSeeked:"seeked",topSeeking:"seeking",topStalled:"stalled",topSuspend:"suspend",topTimeUpdate:"timeupdate",topVolumeChange:"volumechange",topWaiting:"waiting"},Ha={getChildNamespace:function(e,t){return null==e||e===Da?ye(t):e===Aa&&"foreignObject"===t?Da:e},createElement:function(e,t,n,r){var o,a=n.nodeType===xa?n:n.ownerDocument,i=r;if(i===Da&&(i=ye(e)),i===Da)if("script"===e){var l=a.createElement("div");l.innerHTML="<script></script>";var u=l.firstChild;o=l.removeChild(u)}else o=t.is?a.createElement(e,{is:t.is}):a.createElement(e);else o=a.createElementNS(i,e);return o},setInitialProperties:function(e,t,n,r){var o,a=fa(t,n);switch(t){case"iframe":case"object":To.trapBubbledEvent("topLoad","load",e),o=n;break;case"video":case"audio":for(var i in Ua)Ua.hasOwnProperty(i)&&To.trapBubbledEvent(i,Ua[i],e);o=n;break;case"source":To.trapBubbledEvent("topError","error",e),o=n;break;case"img":case"image":To.trapBubbledEvent("topError","error",e),To.trapBubbledEvent("topLoad","load",e),o=n;break;case"form":To.trapBubbledEvent("topReset","reset",e),To.trapBubbledEvent("topSubmit","submit",e),o=n;break;case"details":To.trapBubbledEvent("topToggle","toggle",e),o=n;break;case"input":Go.initWrapperState(e,n),o=Go.getHostProps(e,n),To.trapBubbledEvent("topInvalid","invalid",e),he(r,"onChange");break;case"option":Jo.validateProps(e,n),o=Jo.getHostProps(e,n);break;case"select":ta.initWrapperState(e,n),o=ta.getHostProps(e,n),To.trapBubbledEvent("topInvalid","invalid",e),he(r,"onChange");break;case"textarea":ra.initWrapperState(e,n),o=ra.getHostProps(e,n),To.trapBubbledEvent("topInvalid","invalid",e),he(r,"onChange");break;default:o=n}switch(ca(t,o,Ta),ve(e,r,o,a),t){case"input":da.track(e),Go.postMountWrapper(e,n);break;case"textarea":da.track(e),ra.postMountWrapper(e,n);break;case"option":Jo.postMountWrapper(e,n);break;case"select":ta.postMountWrapper(e,n);break;default:"function"==typeof o.onClick&&ge(e)}},diffProperties:function(e,t,n,r,o){var a,i,l=null;switch(t){case"input":a=Go.getHostProps(e,n),i=Go.getHostProps(e,r),l=[];break;case"option":a=Jo.getHostProps(e,n),i=Jo.getHostProps(e,r),l=[];break;case"select":a=ta.getHostProps(e,n),i=ta.getHostProps(e,r),l=[];break;case"textarea":a=ra.getHostProps(e,n),i=ra.getHostProps(e,r),l=[];break;default:a=n,i=r,"function"!=typeof a.onClick&&"function"==typeof i.onClick&&ge(e)}ca(t,i,Ta);var u,s,c=null;for(u in a)if(!i.hasOwnProperty(u)&&a.hasOwnProperty(u)&&null!=a[u])if(u===Oa){var d=a[u];for(s in d)d.hasOwnProperty(s)&&(c||(c={}),c[s]="")}else u===_a||u===Fa||u===Ia||(Sa.hasOwnProperty(u)?l||(l=[]):(l=l||[]).push(u,null));for(u in i){var p=i[u],f=null!=a?a[u]:void 0;if(i.hasOwnProperty(u)&&p!==f&&(null!=p||null!=f))if(u===Oa)if(f){for(s in f)!f.hasOwnProperty(s)||p&&p.hasOwnProperty(s)||(c||(c={}),c[s]="");for(s in p)p.hasOwnProperty(s)&&f[s]!==p[s]&&(c||(c={}),c[s]=p[s])}else c||(l||(l=[]),l.push(u,c)),c=p;else if(u===_a){var h=p?p[Ma]:void 0,g=f?f[Ma]:void 0;null!=h&&g!==h&&(l=l||[]).push(u,""+h)}else u===Fa?f===p||"string"!=typeof p&&"number"!=typeof p||(l=l||[]).push(u,""+p):u===Ia||(Sa.hasOwnProperty(u)?(p&&he(o,u),l||f===p||(l=[])):(l=l||[]).push(u,p))}return c&&(l=l||[]).push(Oa,c),l},updateProperties:function(e,t,n,r,o){switch(me(e,t,fa(n,r),fa(n,o)),n){case"input":Go.updateWrapper(e,o),da.updateValueIfChanged(e);break;case"textarea":ra.updateWrapper(e,o);break;case"select":ta.postUpdateWrapper(e,o)}},diffHydratedProperties:function(e,t,n,r){switch(t){case"iframe":case"object":To.trapBubbledEvent("topLoad","load",e);break;case"video":case"audio":for(var o in Ua)Ua.hasOwnProperty(o)&&To.trapBubbledEvent(o,Ua[o],e);break;case"source":To.trapBubbledEvent("topError","error",e);break;case"img":case"image":To.trapBubbledEvent("topError","error",e),To.trapBubbledEvent("topLoad","load",e);break;case"form":To.trapBubbledEvent("topReset","reset",e),To.trapBubbledEvent("topSubmit","submit",e);break;case"details":To.trapBubbledEvent("topToggle","toggle",e);break;case"input":Go.initWrapperState(e,n),To.trapBubbledEvent("topInvalid","invalid",e),he(r,"onChange");break;case"option":Jo.validateProps(e,n);break;case"select":ta.initWrapperState(e,n),To.trapBubbledEvent("topInvalid","invalid",e),he(r,"onChange");break;case"textarea":ra.initWrapperState(e,n),To.trapBubbledEvent("topInvalid","invalid",e),he(r,"onChange")}ca(t,n,Ta);var a=null;for(var i in n)if(n.hasOwnProperty(i)){var l=n[i];i===Fa?"string"==typeof l?e.textContent!==l&&(a=[Fa,l]):"number"==typeof l&&e.textContent!==""+l&&(a=[Fa,""+l]):Sa.hasOwnProperty(i)&&l&&he(r,i)}switch(t){case"input":da.track(e),Go.postMountWrapper(e,n);break;case"textarea":da.track(e),ra.postMountWrapper(e,n);break;case"select":case"option":break;default:"function"==typeof n.onClick&&ge(e)}return a},diffHydratedText:function(e,t){return e.nodeValue!==t},warnForDeletedHydratableElement:function(e,t){},warnForDeletedHydratableText:function(e,t){},warnForInsertedHydratedElement:function(e,t,n){},warnForInsertedHydratedText:function(e,t){},restoreControlledState:function(e,t,n){switch(t){case"input":return void Go.restoreControlledState(e,n);case"textarea":return void ra.restoreControlledState(e,n);case"select":return void ta.restoreControlledState(e,n)}}},La=Ha,Wa=void 0;if(hn.canUseDOM)if("function"!=typeof requestIdleCallback){var Ba=null,Va=null,ja=!1,za=!1,Ka=0,Ya=33,qa=33,Qa={timeRemaining:"object"==typeof performance&&"function"==typeof performance.now?function(){return Ka-performance.now()}:function(){return Ka-Date.now()}},$a="__reactIdleCallback$"+Math.random().toString(36).slice(2),Xa=function(e){if(e.source===window&&e.data===$a){ja=!1;var t=Va;Va=null,null!==t&&t(Qa)}};window.addEventListener("message",Xa,!1);var Ga=function(e){za=!1;var t=e-Ka+qa;t<qa&&Ya<qa?(t<8&&(t=8),qa=t<Ya?Ya:t):Ya=t,Ka=e+qa,ja||(ja=!0,window.postMessage($a,"*"));var n=Ba;Ba=null,null!==n&&n(e)};Wa=function(e){return Va=e,za||(za=!0,requestAnimationFrame(Ga)),0}}else Wa=requestIdleCallback;else Wa=function(e){return setTimeout(function(){e({timeRemaining:function(){return 1/0}})}),0};var Za=Wa,Ja={rIC:Za},ei={NoWork:0,SynchronousPriority:1,TaskPriority:2,HighPriority:3,LowPriority:4,OffscreenPriority:5},ti=dr.Callback,ni=ei.NoWork,ri=ei.SynchronousPriority,oi=ei.TaskPriority,ai=Yn.ClassComponent,ii=Yn.HostRoot,li=we,ui=Ne,si=Se,ci=_e,pi=Ie,di=Oe,fi=Me,hi={addUpdate:li,addReplaceUpdate:ui,addForceUpdate:si,getUpdatePriority:ci,addTopLevelUpdate:pi,beginUpdateQueue:di,commitCallbacks:fi},gi=[],vi=-1,mi=function(e){return{current:e}},yi=function(){return-1===vi},bi=function(e,t){vi<0||(e.current=gi[vi],gi[vi]=null,vi--)},Ci=function(e,t,n){vi++,gi[vi]=e.current,e.current=t},Ei=function(){for(;vi>-1;)gi[vi]=null,vi--},ki={createCursor:mi,isEmpty:yi,pop:bi,push:Ci,reset:Ei},Pi=gn||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ti=Nr.isFiberMounted,xi=Yn.ClassComponent,wi=Yn.HostRoot,Ni=ki.createCursor,Si=ki.pop,_i=ki.push,Ii=Ni(Cn),Fi=Ni(!1),Oi=Cn,Mi=De,Di=Ae,Ai=function(e,t){var n=e.type,r=n.contextTypes;if(!r)return Cn;var o=e.stateNode;if(o&&o.__reactInternalMemoizedUnmaskedChildContext===t)return o.__reactInternalMemoizedMaskedChildContext;var a={};for(var i in r)a[i]=t[i];return o&&Ae(e,t,a),a},Ri=function(){return Fi.current},Ui=Re,Hi=Ue,Li=He,Wi=function(e,t,n){null!=Ii.cursor&&xn("168"),_i(Ii,t,e),_i(Fi,n,e)},Bi=Le,Vi=function(e){if(!Ue(e))return!1;var t=e.stateNode,n=t&&t.__reactInternalMemoizedMergedChildContext||Cn;return Oi=Ii.current,_i(Ii,n,e),_i(Fi,Fi.current,e),!0},ji=function(e,t){var n=e.stateNode;if(n||xn("169"),t){var r=Le(e,Oi,!0);n.__reactInternalMemoizedMergedChildContext=r,Si(Fi,e),Si(Ii,e),_i(Ii,r,e),_i(Fi,t,e)}else Si(Fi,e),_i(Fi,t,e)},zi=function(){Oi=Cn,Ii.current=Cn,Fi.current=!1},Ki=function(e){Ti(e)&&e.tag===xi||xn("170");for(var t=e;t.tag!==wi;){if(Ue(t))return t.stateNode.__reactInternalMemoizedMergedChildContext;var n=t.return;n||xn("171"),t=n}return t.stateNode.context},Yi={getUnmaskedContext:Mi,cacheContext:Di,getMaskedContext:Ai,hasContextChanged:Ri,isContextConsumer:Ui,isContextProvider:Hi,popContextProvider:Li,pushTopLevelContextObject:Wi,processChildContext:Bi,pushContextProvider:Vi,invalidateContextProvider:ji,resetContext:zi,findCurrentUnmaskedContext:Ki},qi={NoContext:0,AsyncUpdates:1},Qi=Yn.IndeterminateComponent,$i=Yn.ClassComponent,Xi=Yn.HostRoot,Gi=Yn.HostComponent,Zi=Yn.HostText,Ji=Yn.HostPortal,el=Yn.CoroutineComponent,tl=Yn.YieldComponent,nl=Yn.Fragment,rl=ei.NoWork,ol=qi.NoContext,al=dr.NoEffect,il=function(e,t,n){return{tag:e,key:t,type:null,stateNode:null,return:null,child:null,sibling:null,index:0,ref:null,pendingProps:null,memoizedProps:null,updateQueue:null,memoizedState:null,internalContextTag:n,effectTag:al,nextEffect:null,firstEffect:null,lastEffect:null,pendingWorkPriority:rl,alternate:null}},ll=function(e,t){var n=e.alternate;return null===n?(n=il(e.tag,e.key,e.internalContextTag),n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.effectTag=rl,n.nextEffect=null,n.firstEffect=null,n.lastEffect=null),n.pendingWorkPriority=t,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n},ul=function(){return il(Xi,null,ol)},sl=function(e,t,n){var r=Be(e.type,e.key,t,null);return r.pendingProps=e.props,r.pendingWorkPriority=n,r},cl=function(e,t,n){var r=il(nl,null,t);return r.pendingProps=e,r.pendingWorkPriority=n,r},pl=function(e,t,n){var r=il(Zi,null,t);return r.pendingProps=e,r.pendingWorkPriority=n,r},dl=Be,fl=function(){var e=il(Gi,null,ol);return e.type="DELETED",e},hl=function(e,t,n){var r=il(el,e.key,t);return r.type=e.handler,r.pendingProps=e,r.pendingWorkPriority=n,r},gl=function(e,t,n){return il(tl,null,t)},vl=function(e,t,n){var r=il(Ji,e.key,t);return r.pendingProps=e.children||[],r.pendingWorkPriority=n,r.stateNode={containerInfo:e.containerInfo,implementation:e.implementation},r},ml=function(e,t){return e!==rl&&(t===rl||t>e)?e:t},yl={createWorkInProgress:ll,createHostRootFiber:ul,createFiberFromElement:sl,createFiberFromFragment:cl,createFiberFromText:pl,createFiberFromElementType:dl,createFiberFromHostInstanceForDeletion:fl,createFiberFromCoroutine:hl,createFiberFromYield:gl,createFiberFromPortal:vl,largerPriority:ml},bl=yl.createHostRootFiber,Cl=function(e){var t=bl(),n={current:t,containerInfo:e,isScheduled:!1,nextScheduledRoot:null,context:null,pendingContext:null};return t.stateNode=n,n},El={createFiberRoot:Cl},kl=function(e,t,n){return"\n in "+(e||"Unknown")+(t?" (at "+t.fileName.replace(/^.*[\\\/]/,"")+":"+t.lineNumber+")":n?" (created by "+n+")":"")},Pl=Yn.IndeterminateComponent,Tl=Yn.FunctionalComponent,xl=Yn.ClassComponent,wl=Yn.HostComponent,Nl={getStackAddendumByWorkInProgressFiber:je},Sl=function(e){return!0},_l=Sl,Il={injectDialog:function(e){
+_l!==Sl&&xn("172"),"function"!=typeof e&&xn("173"),_l=e}},Fl=ze,Ol={injection:Il,logCapturedError:Fl},Ml,Dl;"function"==typeof Symbol&&Symbol.for?(Ml=Symbol.for("react.coroutine"),Dl=Symbol.for("react.yield")):(Ml=60104,Dl=60105);var Al=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:Ml,key:null==r?null:""+r,children:e,handler:t,props:n}},Rl=function(e){return{$$typeof:Dl,value:e}},Ul=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===Ml},Hl=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===Dl},Ll=Dl,Wl=Ml,Bl={createCoroutine:Al,createYield:Rl,isCoroutine:Ul,isYield:Hl,REACT_YIELD_TYPE:Ll,REACT_COROUTINE_TYPE:Wl},Vl="function"==typeof Symbol&&Symbol.for&&Symbol.for("react.portal")||60106,jl=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:Vl,key:null==r?null:""+r,children:e,containerInfo:t,implementation:n}},zl=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===Vl},Kl=Vl,Yl={createPortal:jl,isPortal:zl,REACT_PORTAL_TYPE:Kl},ql=Bl.REACT_COROUTINE_TYPE,Ql=Bl.REACT_YIELD_TYPE,$l=Yl.REACT_PORTAL_TYPE,Xl=yl.createWorkInProgress,Gl=yl.createFiberFromElement,Zl=yl.createFiberFromFragment,Jl=yl.createFiberFromText,eu=yl.createFiberFromCoroutine,tu=yl.createFiberFromYield,nu=yl.createFiberFromPortal,ru=Array.isArray,ou=Yn.FunctionalComponent,au=Yn.ClassComponent,iu=Yn.HostText,lu=Yn.HostPortal,uu=Yn.CoroutineComponent,su=Yn.YieldComponent,cu=Yn.Fragment,pu=dr.NoEffect,du=dr.Placement,fu=dr.Deletion,hu="function"==typeof Symbol&&Symbol.iterator,gu="@@iterator",vu="function"==typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,mu=Qe(!0,!0),yu=Qe(!1,!0),bu=Qe(!1,!1),Cu=function(e,t){if(null!==e&&t.child!==e.child&&xn("153"),null!==t.child){var n=t.child,r=Xl(n,n.pendingWorkPriority);for(r.pendingProps=n.pendingProps,t.child=r,r.return=t;null!==n.sibling;)n=n.sibling,r=r.sibling=Xl(n,n.pendingWorkPriority),r.pendingProps=n.pendingProps,r.return=t;r.sibling=null}},Eu={reconcileChildFibers:mu,reconcileChildFibersInPlace:yu,mountChildFibersInPlace:bu,cloneChildFibers:Cu},ku=dr.Update,Pu=qi.AsyncUpdates,Tu=Yi.cacheContext,xu=Yi.getMaskedContext,wu=Yi.getUnmaskedContext,Nu=Yi.isContextConsumer,Su=hi.addUpdate,_u=hi.addReplaceUpdate,Iu=hi.addForceUpdate,Fu=hi.beginUpdateQueue,Ou=Yi,Mu=Ou.hasContextChanged,Du=Nr.isMounted,Au=function(e,t,n,r){function o(e,t,n,r,o,a){if(null===t||null!==e.updateQueue&&e.updateQueue.hasForceUpdate)return!0;var i=e.stateNode,l=e.type;return"function"==typeof i.shouldComponentUpdate?i.shouldComponentUpdate(n,o,a):!(l.prototype&&l.prototype.isPureReactComponent&&En(t,n)&&En(r,o))}function a(e,t){t.props=e.memoizedProps,t.state=e.memoizedState}function i(e,t){t.updater=p,e.stateNode=t,lr.set(t,e)}function l(e,t){var n=e.type,r=wu(e),o=Nu(e),a=o?xu(e,r):Cn,l=new n(t,a);return i(e,l),o&&Tu(e,r,a),l}function u(e,t){var n=t.state;t.componentWillMount(),n!==t.state&&p.enqueueReplaceState(t,t.state,null)}function s(e,t,n,r){var o=t.state;t.componentWillReceiveProps(n,r),t.state!==o&&p.enqueueReplaceState(t,t.state,null)}function c(e,t){var n=e.alternate,r=e.stateNode,o=r.state||null,a=e.pendingProps;a||xn("158");var i=wu(e);if(r.props=a,r.state=o,r.refs=Cn,r.context=xu(e,i),wo.enableAsyncSubtreeAPI&&null!=e.type&&null!=e.type.prototype&&!0===e.type.prototype.unstable_isAsyncReactComponent&&(e.internalContextTag|=Pu),"function"==typeof r.componentWillMount){u(e,r);var l=e.updateQueue;null!==l&&(r.state=Fu(n,e,l,r,o,a,t))}"function"==typeof r.componentDidMount&&(e.effectTag|=ku)}function d(e,t,i){var l=t.stateNode;a(t,l);var u=t.memoizedProps,c=t.pendingProps;c||null==(c=u)&&xn("159");var d=l.context,p=wu(t),f=xu(t,p);"function"!=typeof l.componentWillReceiveProps||u===c&&d===f||s(t,l,c,f);var h=t.memoizedState,g=void 0;if(g=null!==t.updateQueue?Fu(e,t,t.updateQueue,l,h,c,i):h,!(u!==c||h!==g||Mu()||null!==t.updateQueue&&t.updateQueue.hasForceUpdate))return"function"==typeof l.componentDidUpdate&&(u===e.memoizedProps&&h===e.memoizedState||(t.effectTag|=ku)),!1;var v=o(t,u,c,h,g,f);return v?("function"==typeof l.componentWillUpdate&&l.componentWillUpdate(c,g,f),"function"==typeof l.componentDidUpdate&&(t.effectTag|=ku)):("function"==typeof l.componentDidUpdate&&(u===e.memoizedProps&&h===e.memoizedState||(t.effectTag|=ku)),n(t,c),r(t,g)),l.props=c,l.state=g,l.context=f,v}var p={isMounted:Du,enqueueSetState:function(n,r,o){var a=lr.get(n),i=t(a,!1);o=void 0===o?null:o,Su(a,r,o,i),e(a,i)},enqueueReplaceState:function(n,r,o){var a=lr.get(n),i=t(a,!1);o=void 0===o?null:o,_u(a,r,o,i),e(a,i)},enqueueForceUpdate:function(n,r){var o=lr.get(n),a=t(o,!1);r=void 0===r?null:r,Iu(o,r,a),e(o,a)}};return{adoptClassInstance:i,constructClassInstance:l,mountClassInstance:c,updateClassInstance:d}},Ru=Eu.mountChildFibersInPlace,Uu=Eu.reconcileChildFibers,Hu=Eu.reconcileChildFibersInPlace,Lu=Eu.cloneChildFibers,Wu=hi.beginUpdateQueue,Bu=Yi.getMaskedContext,Vu=Yi.getUnmaskedContext,ju=Yi.hasContextChanged,zu=Yi.pushContextProvider,Ku=Yi.pushTopLevelContextObject,Yu=Yi.invalidateContextProvider,qu=Yn.IndeterminateComponent,Qu=Yn.FunctionalComponent,$u=Yn.ClassComponent,Xu=Yn.HostRoot,Gu=Yn.HostComponent,Zu=Yn.HostText,Ju=Yn.HostPortal,es=Yn.CoroutineComponent,ts=Yn.CoroutineHandlerPhase,ns=Yn.YieldComponent,rs=Yn.Fragment,os=ei.NoWork,as=ei.OffscreenPriority,is=dr.PerformedWork,ls=dr.Placement,us=dr.ContentReset,ss=dr.Err,cs=dr.Ref,ps=cr.ReactCurrentOwner,ds=function(e,t,n,r,o){function a(e,t,n){i(e,t,n,t.pendingWorkPriority)}function i(e,t,n,r){null===e?t.child=Ru(t,t.child,n,r):e.child===t.child?t.child=Uu(t,t.child,n,r):t.child=Hu(t,t.child,n,r)}function l(e,t){var n=t.pendingProps;if(ju())null===n&&(n=t.memoizedProps);else if(null===n||t.memoizedProps===n)return y(e,t);return a(e,t,n),C(t,n),t.child}function u(e,t){var n=t.ref;null===n||e&&e.ref===n||(t.effectTag|=cs)}function s(e,t){var n=t.type,r=t.pendingProps,o=t.memoizedProps;if(ju())null===r&&(r=o);else if(null===r||o===r)return y(e,t);var i,l=Vu(t),u=Bu(t,l);return i=n(r,u),t.effectTag|=is,a(e,t,i),C(t,r),t.child}function c(e,t,n){var r=zu(t),o=void 0;return null===e?t.stateNode?xn("153"):(D(t,t.pendingProps),A(t,n),o=!0):o=R(e,t,n),d(e,t,o,r)}function d(e,t,n,r){if(u(e,t),!n)return r&&Yu(t,!1),y(e,t);var o=t.stateNode;ps.current=t;var i=void 0;return i=o.render(),t.effectTag|=is,a(e,t,i),E(t,o.state),C(t,o.props),r&&Yu(t,!0),t.child}function p(e,t,n){var r=t.stateNode;r.pendingContext?Ku(t,r.pendingContext,r.pendingContext!==r.context):r.context&&Ku(t,r.context,!1),N(t,r.containerInfo);var o=t.updateQueue;if(null!==o){var i=t.memoizedState,l=Wu(e,t,o,null,i,null,n);if(i===l)return F(),y(e,t);var u=l.element;return null!==e&&null!==e.child||!_(t)?(F(),a(e,t,u)):(t.effectTag|=ls,t.child=Ru(t,t.child,u,n)),E(t,l),t.child}return F(),y(e,t)}function f(e,t,n){w(t),null===e&&I(t);var r=t.type,o=t.memoizedProps,i=t.pendingProps;null===i&&null===(i=o)&&xn("154");var l=null!==e?e.memoizedProps:null;if(ju());else if(null===i||o===i)return y(e,t);var s=i.children;return P(r,i)?s=null:l&&P(r,l)&&(t.effectTag|=us),u(e,t),n!==as&&!T&&S(r,i)?(t.pendingWorkPriority=as,null):(a(e,t,s),C(t,i),t.child)}function h(e,t){null===e&&I(t);var n=t.pendingProps;return null===n&&(n=t.memoizedProps),C(t,n),null}function g(e,t,n){null!==e&&xn("155");var r,o=t.type,i=t.pendingProps,l=Vu(t),u=Bu(t,l);if(r=o(i,u),t.effectTag|=is,"object"==typeof r&&null!==r&&"function"==typeof r.render){t.tag=$u;var s=zu(t);return M(t,r),A(t,n),d(e,t,!0,s)}return t.tag=Qu,a(e,t,r),C(t,i),t.child}function v(e,t){var n=t.pendingProps;ju()?null===n&&null===(n=e&&e.memoizedProps)&&xn("154"):null!==n&&t.memoizedProps!==n||(n=t.memoizedProps);var r=n.children,o=t.pendingWorkPriority;return null===e?t.stateNode=Ru(t,t.stateNode,r,o):e.child===t.child?t.stateNode=Uu(t,t.stateNode,r,o):t.stateNode=Hu(t,t.stateNode,r,o),C(t,n),t.stateNode}function m(e,t){N(t,t.stateNode.containerInfo);var n=t.pendingWorkPriority,r=t.pendingProps;if(ju())null===r&&null==(r=e&&e.memoizedProps)&&xn("154");else if(null===r||t.memoizedProps===r)return y(e,t);return null===e?(t.child=Hu(t,t.child,r,n),C(t,r)):(a(e,t,r),C(t,r)),t.child}function y(e,t){return Lu(e,t),t.child}function b(e,t){switch(t.tag){case $u:zu(t);break;case Ju:N(t,t.stateNode.containerInfo)}return null}function C(e,t){e.memoizedProps=t}function E(e,t){e.memoizedState=t}function x(e,t,n){if(t.pendingWorkPriority===os||t.pendingWorkPriority>n)return b(e,t);switch(t.tag){case qu:return g(e,t,n);case Qu:return s(e,t);case $u:return c(e,t,n);case Xu:return p(e,t,n);case Gu:return f(e,t,n);case Zu:return h(e,t);case ts:t.tag=es;case es:return v(e,t);case ns:return null;case Ju:return m(e,t);case rs:return l(e,t);default:xn("156")}}function k(e,t,n){switch(t.tag){case $u:zu(t);break;case Xu:var r=t.stateNode;N(t,r.containerInfo);break;default:xn("157")}if(t.effectTag|=ss,null===e?t.child=null:t.child!==e.child&&(t.child=e.child),t.pendingWorkPriority===os||t.pendingWorkPriority>n)return b(e,t);if(t.firstEffect=null,t.lastEffect=null,i(e,t,null,n),t.tag===$u){var o=t.stateNode;t.memoizedProps=o.props,t.memoizedState=o.state}return t.child}var P=e.shouldSetTextContent,T=e.useSyncScheduling,S=e.shouldDeprioritizeSubtree,w=t.pushHostContext,N=t.pushHostContainer,_=n.enterHydrationState,F=n.resetHydrationState,I=n.tryToClaimNextHydratableInstance,O=Au(r,o,C,E),M=O.adoptClassInstance,D=O.constructClassInstance,A=O.mountClassInstance,R=O.updateClassInstance;return{beginWork:x,beginFailedWork:k}},fs=Eu.reconcileChildFibers,hs=Yi.popContextProvider,gs=Yn.IndeterminateComponent,vs=Yn.FunctionalComponent,ms=Yn.ClassComponent,ys=Yn.HostRoot,bs=Yn.HostComponent,Cs=Yn.HostText,Es=Yn.HostPortal,ks=Yn.CoroutineComponent,Ps=Yn.CoroutineHandlerPhase,Ts=Yn.YieldComponent,xs=Yn.Fragment,ws=dr.Placement,Ns=dr.Ref,Ss=dr.Update,_s=ei.OffscreenPriority,Is=function(e,t,n){function r(e){e.effectTag|=Ss}function o(e){e.effectTag|=Ns}function a(e,t){var n=t.stateNode;for(n&&(n.return=t);null!==n;){if(n.tag===bs||n.tag===Cs||n.tag===Es)xn("164");else if(n.tag===Ts)e.push(n.type);else if(null!==n.child){n.child.return=n,n=n.child;continue}for(;null===n.sibling;){if(null===n.return||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}}function i(e,t){var n=t.memoizedProps;n||xn("165"),t.tag=Ps;var r=[];a(r,t);var o=n.handler,i=n.props,l=o(i,r),u=null!==e?e.child:null,s=t.pendingWorkPriority;return t.child=fs(t,u,l,s),t.child}function l(e,t){for(var n=t.child;null!==n;){if(n.tag===bs||n.tag===Cs)d(e,n.stateNode);else if(n.tag===Es);else if(null!==n.child){n=n.child;continue}if(n===t)return;for(;null===n.sibling;){if(null===n.return||n.return===t)return;n=n.return}n=n.sibling}}function u(e,t,n){var a=t.pendingProps;switch(null===a?a=t.memoizedProps:t.pendingWorkPriority===_s&&n!==_s||(t.pendingProps=null),t.tag){case vs:return null;case ms:return hs(t),null;case ys:var u=t.stateNode;return u.pendingContext&&(u.context=u.pendingContext,u.pendingContext=null),null!==e&&null!==e.child||(C(t),t.effectTag&=~ws),null;case bs:g(t);var d=h(),E=t.type;if(null!==e&&null!=t.stateNode){var x=e.memoizedProps,k=t.stateNode,P=v(),T=f(k,E,x,a,d,P);t.updateQueue=T,T&&r(t),e.ref!==t.ref&&o(t)}else{if(!a)return null===t.stateNode&&xn("166"),null;var S=v();if(C(t))y(t,d)&&r(t);else{var w=s(E,a,d,S,t);l(w,t),p(w,E,a,d)&&r(t),t.stateNode=w}null!==t.ref&&o(t)}return null;case Cs:var N=a;if(e&&null!=t.stateNode)e.memoizedProps!==N&&r(t);else{if("string"!=typeof N)return null===t.stateNode&&xn("166"),null;var _=h(),F=v();C(t)?b(t)&&r(t):t.stateNode=c(N,_,F,t)}return null;case ks:return i(e,t);case Ps:return t.tag=ks,null;case Ts:case xs:return null;case Es:return r(t),m(t),null;case gs:xn("167");default:xn("156")}}var s=e.createInstance,c=e.createTextInstance,d=e.appendInitialChild,p=e.finalizeInitialChildren,f=e.prepareUpdate,h=t.getRootHostContainer,g=t.popHostContext,v=t.getHostContext,m=t.popHostContainer,y=n.prepareToHydrateHostInstance,b=n.prepareToHydrateHostTextInstance,C=n.popHydrationState;return{completeWork:u}},Fs=null,Os=null,Ms=!1,Ds=Xe,As=Ge,Rs=Ze,Us={injectInternals:Ds,onCommitRoot:As,onCommitUnmount:Rs},Hs=Yn.ClassComponent,Ls=Yn.HostRoot,Ws=Yn.HostComponent,Bs=Yn.HostText,Vs=Yn.HostPortal,js=Yn.CoroutineComponent,zs=hi.commitCallbacks,Ks=Us.onCommitUnmount,Ys=dr.Placement,qs=dr.Update,Qs=dr.Callback,$s=dr.ContentReset,Xs=function(e,t){function n(e,n){try{n.componentWillUnmount()}catch(n){t(e,n)}}function r(e){var n=e.ref;if(null!==n)try{n(null)}catch(n){t(e,n)}}function o(e){for(var t=e.return;null!==t;){if(a(t))return t;t=t.return}xn("160")}function a(e){return e.tag===Ws||e.tag===Ls||e.tag===Vs}function i(e){var t=e;e:for(;;){for(;null===t.sibling;){if(null===t.return||a(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==Ws&&t.tag!==Bs;){if(t.effectTag&Ys)continue e;if(null===t.child||t.tag===Vs)continue e;t.child.return=t,t=t.child}if(!(t.effectTag&Ys))return t.stateNode}}function l(e){var t=o(e),n=void 0,r=void 0;switch(t.tag){case Ws:n=t.stateNode,r=!1;break;case Ls:case Vs:n=t.stateNode.containerInfo,r=!0;break;default:xn("161")}t.effectTag&$s&&(y(n),t.effectTag&=~$s);for(var a=i(e),l=e;;){if(l.tag===Ws||l.tag===Bs)a?r?k(n,l.stateNode,a):x(n,l.stateNode,a):r?E(n,l.stateNode):C(n,l.stateNode);else if(l.tag===Vs);else if(null!==l.child){l.child.return=l,l=l.child;continue}if(l===e)return;for(;null===l.sibling;){if(null===l.return||l.return===e)return;l=l.return}l.sibling.return=l.return,l=l.sibling}}function u(e){for(var t=e;;)if(d(t),null===t.child||t.tag===Vs){if(t===e)return;for(;null===t.sibling;){if(null===t.return||t.return===e)return;t=t.return}t.sibling.return=t.return,t=t.sibling}else t.child.return=t,t=t.child}function s(e){for(var t=e,n=!1,r=void 0,o=void 0;;){if(!n){var a=t.return;e:for(;;){switch(null===a&&xn("160"),a.tag){case Ws:r=a.stateNode,o=!1;break e;case Ls:case Vs:r=a.stateNode.containerInfo,o=!0;break e}a=a.return}n=!0}if(t.tag===Ws||t.tag===Bs)u(t),o?T(r,t.stateNode):P(r,t.stateNode);else if(t.tag===Vs){if(r=t.stateNode.containerInfo,null!==t.child){t.child.return=t,t=t.child;continue}}else if(d(t),null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)return;for(;null===t.sibling;){if(null===t.return||t.return===e)return;t=t.return,t.tag===Vs&&(n=!1)}t.sibling.return=t.return,t=t.sibling}}function c(e){s(e),e.return=null,e.child=null,e.alternate&&(e.alternate.child=null,e.alternate.return=null)}function d(e){switch("function"==typeof Ks&&Ks(e),e.tag){case Hs:r(e);var t=e.stateNode;return void("function"==typeof t.componentWillUnmount&&n(e,t));case Ws:return void r(e);case js:return void u(e.stateNode);case Vs:return void s(e)}}function p(e,t){switch(t.tag){case Hs:return;case Ws:var n=t.stateNode;if(null!=n){var r=t.memoizedProps,o=null!==e?e.memoizedProps:r,a=t.type,i=t.updateQueue;t.updateQueue=null,null!==i&&m(n,i,a,o,r,t)}return;case Bs:null===t.stateNode&&xn("162");var l=t.stateNode,u=t.memoizedProps,s=null!==e?e.memoizedProps:u;return void b(l,s,u);case Ls:case Vs:return;default:xn("163")}}function f(e,t){switch(t.tag){case Hs:var n=t.stateNode;if(t.effectTag&qs)if(null===e)n.componentDidMount();else{var r=e.memoizedProps,o=e.memoizedState;n.componentDidUpdate(r,o)}return void(t.effectTag&Qs&&null!==t.updateQueue&&zs(t,t.updateQueue,n));case Ls:var a=t.updateQueue;if(null!==a){var i=t.child&&t.child.stateNode;zs(t,a,i)}return;case Ws:var l=t.stateNode;if(null===e&&t.effectTag&qs){var u=t.type,s=t.memoizedProps;v(l,u,s,t)}return;case Bs:case Vs:return;default:xn("163")}}function h(e){var t=e.ref;if(null!==t){var n=e.stateNode;switch(e.tag){case Ws:t(S(n));break;default:t(n)}}}function g(e){var t=e.ref;null!==t&&t(null)}var v=e.commitMount,m=e.commitUpdate,y=e.resetTextContent,b=e.commitTextUpdate,C=e.appendChild,E=e.appendChildToContainer,x=e.insertBefore,k=e.insertInContainerBefore,P=e.removeChild,T=e.removeChildFromContainer,S=e.getPublicInstance;return{commitPlacement:l,commitDeletion:c,commitWork:p,commitLifeCycles:f,commitAttachRef:h,commitDetachRef:g}},Gs=ki.createCursor,Zs=ki.pop,Js=ki.push,ec={},tc=function(e){function t(e){return e===ec&&xn("174"),e}function n(){return t(f.current)}function r(e,t){Js(f,t,e);var n=c(t);Js(p,e,e),Js(d,n,e)}function o(e){Zs(d,e),Zs(p,e),Zs(f,e)}function a(){return t(d.current)}function i(e){var n=t(f.current),r=t(d.current),o=s(r,e.type,n);r!==o&&(Js(p,e,e),Js(d,o,e))}function l(e){p.current===e&&(Zs(d,e),Zs(p,e))}function u(){d.current=ec,f.current=ec}var s=e.getChildHostContext,c=e.getRootHostContext,d=Gs(ec),p=Gs(ec),f=Gs(ec);return{getHostContext:a,getRootHostContainer:n,popHostContainer:o,popHostContext:l,pushHostContainer:r,pushHostContext:i,resetHostContainer:u}},nc=Yn.HostComponent,rc=Yn.HostText,oc=Yn.HostRoot,ac=dr.Deletion,ic=dr.Placement,lc=yl.createFiberFromHostInstanceForDeletion,uc=function(e){function t(e){var t=e.stateNode.containerInfo;return x=g(t),E=e,k=!0,!0}function n(e,t){var n=lc();n.stateNode=t,n.return=e,n.effectTag=ac,null!==e.lastEffect?(e.lastEffect.nextEffect=n,e.lastEffect=n):e.firstEffect=e.lastEffect=n}function r(e,t){t.effectTag|=ic}function o(e,t){switch(e.tag){case nc:var n=e.type,r=e.pendingProps;return p(t,n,r);case rc:var o=e.pendingProps;return f(t,o);default:return!1}}function a(e){if(k){var t=x;if(!t)return r(E,e),k=!1,void(E=e);if(!o(e,t)){if(!(t=h(t))||!o(e,t))return r(E,e),k=!1,void(E=e);n(E,x)}e.stateNode=t,E=e,x=g(t)}}function i(e,t){var n=e.stateNode,r=v(n,e.type,e.memoizedProps,t,e);return e.updateQueue=r,null!==r}function l(e){var t=e.stateNode;return m(t,e.memoizedProps,e)}function u(e){for(var t=e.return;null!==t&&t.tag!==nc&&t.tag!==oc;)t=t.return;E=t}function s(e){if(e!==E)return!1;if(!k)return u(e),k=!0,!1;var t=e.type;if(e.tag!==nc||"head"!==t&&"body"!==t&&!d(t,e.memoizedProps))for(var r=x;r;)n(e,r),r=h(r);return u(e),x=E?h(e.stateNode):null,!0}function c(){E=null,x=null,k=!1}var d=e.shouldSetTextContent,p=e.canHydrateInstance,f=e.canHydrateTextInstance,h=e.getNextHydratableSibling,g=e.getFirstHydratableChild,v=e.hydrateInstance,m=e.hydrateTextInstance,y=e.didNotHydrateInstance,b=e.didNotFindHydratableInstance,C=e.didNotFindHydratableTextInstance;if(!(p&&f&&h&&g&&v&&m&&y&&b&&C))return{enterHydrationState:function(){return!1},resetHydrationState:function(){},tryToClaimNextHydratableInstance:function(){},prepareToHydrateHostInstance:function(){xn("175")},prepareToHydrateHostTextInstance:function(){xn("176")},popHydrationState:function(e){return!1}};var E=null,x=null,k=!1;return{enterHydrationState:t,resetHydrationState:c,tryToClaimNextHydratableInstance:a,prepareToHydrateHostInstance:i,prepareToHydrateHostTextInstance:l,popHydrationState:s}},sc=Yi.popContextProvider,cc=ki.reset,pc=Nl.getStackAddendumByWorkInProgressFiber,dc=Ol.logCapturedError,fc=cr.ReactCurrentOwner,hc=yl.createWorkInProgress,gc=yl.largerPriority,vc=Us.onCommitRoot,mc=ei.NoWork,yc=ei.SynchronousPriority,bc=ei.TaskPriority,Cc=ei.HighPriority,Ec=ei.LowPriority,kc=ei.OffscreenPriority,Pc=qi.AsyncUpdates,Tc=dr.PerformedWork,xc=dr.Placement,wc=dr.Update,Nc=dr.PlacementAndUpdate,Sc=dr.Deletion,_c=dr.ContentReset,Ic=dr.Callback,Fc=dr.Err,Oc=dr.Ref,Mc=Yn.HostRoot,Dc=Yn.HostComponent,Ac=Yn.HostPortal,Rc=Yn.ClassComponent,Uc=hi.getUpdatePriority,Hc=Yi,Lc=Hc.resetContext,Wc,Bc=1,Vc=function(e){function t(){cc(),Lc(),M()}function n(){for(;null!==ae&&ae.current.pendingWorkPriority===mc;){ae.isScheduled=!1;var e=ae.nextScheduledRoot;if(ae.nextScheduledRoot=null,ae===ie)return ae=null,ie=null,ne=mc,null;ae=e}for(var n=ae,r=null,o=mc;null!==n;)n.current.pendingWorkPriority!==mc&&(o===mc||o>n.current.pendingWorkPriority)&&(o=n.current.pendingWorkPriority,r=n),n=n.nextScheduledRoot;return null!==r?(ne=o,t(),void(te=hc(r.current,o))):(ne=mc,void(te=null))}function r(){for(;null!==re;){var t=re.effectTag;if(t&_c&&e.resetTextContent(re.stateNode),t&Oc){var n=re.alternate;null!==n&&z(n)}switch(t&~(Ic|Fc|_c|Oc|Tc)){case xc:B(re),re.effectTag&=~xc;break;case Nc:B(re),re.effectTag&=~xc;var r=re.alternate;j(r,re);break;case wc:var o=re.alternate;j(o,re);break;case Sc:he=!0,W(re),he=!1}re=re.nextEffect}}function o(){for(;null!==re;){var e=re.effectTag;if(e&(wc|Ic)){var t=re.alternate;Y(t,re)}e&Oc&&V(re),e&Fc&&y(re);var n=re.nextEffect;re.nextEffect=null,re=n}}function a(e){fe=!0,oe=null;var t=e.stateNode;t.current===e&&xn("177"),ne!==yc&&ne!==bc||ve++,fc.current=null;var a=void 0;for(e.effectTag>Tc?null!==e.lastEffect?(e.lastEffect.nextEffect=e,a=e.firstEffect):a=e:a=e.firstEffect,Q(),re=a;null!==re;){var i=!1,l=void 0;try{r()}catch(e){i=!0,l=e}i&&(null===re&&xn("178"),g(re,l),null!==re&&(re=re.nextEffect))}for($(),t.current=e,re=a;null!==re;){var u=!1,s=void 0;try{o()}catch(e){u=!0,s=e}u&&(null===re&&xn("178"),g(re,s),null!==re&&(re=re.nextEffect))}fe=!1,"function"==typeof vc&&vc(e.stateNode),ce&&(ce.forEach(k),ce=null),n()}function i(e,t){if(!(e.pendingWorkPriority!==mc&&e.pendingWorkPriority>t)){for(var n=Uc(e),r=e.child;null!==r;)n=gc(n,r.pendingWorkPriority),r=r.sibling;e.pendingWorkPriority=n}}function l(e){for(;;){var t=e.alternate,n=L(t,e,ne),r=e.return,o=e.sibling;if(i(e,ne),null!==n)return n;if(null!==r&&(null===r.firstEffect&&(r.firstEffect=e.firstEffect),null!==e.lastEffect&&(null!==r.lastEffect&&(r.lastEffect.nextEffect=e.firstEffect),r.lastEffect=e.lastEffect),e.effectTag>Tc&&(null!==r.lastEffect?r.lastEffect.nextEffect=e:r.firstEffect=e,r.lastEffect=e)),null!==o)return o;if(null===r)return oe=e,null;e=r}return null}function u(e){var t=e.alternate,n=A(t,e,ne);return null===n&&(n=l(e)),fc.current=null,n}function s(e){var t=e.alternate,n=R(t,e,ne);return null===n&&(n=l(e)),fc.current=null,n}function c(e){h(kc,e)}function d(){if(null!==ue&&ue.size>0)for(;null!==te;)if(null===(te=v(te)?s(te):u(te))){if(null===oe&&xn("179"),X=bc,a(oe),X=ne,null===ue||0===ue.size)break;ne!==bc&&xn("180")}}function p(e,t){if(null!==oe?(X=bc,a(oe),d()):null===te&&n(),!(ne===mc||ne>e)){X=ne;e:for(;;){if(ne<=bc)for(;null!==te&&!(null===(te=u(te))&&(null===oe&&xn("179"),X=bc,a(oe),X=ne,d(),ne===mc||ne>e||ne>bc)););else if(null!==t)for(;null!==te&&!Z;)if(t.timeRemaining()>Bc){if(null===(te=u(te)))if(null===oe&&xn("179"),t.timeRemaining()>Bc){if(X=bc,a(oe),X=ne,d(),ne===mc||ne>e||ne<Cc)break}else Z=!0}else Z=!0;switch(ne){case yc:case bc:if(ne<=e)continue e;break e;case Cc:case Ec:case kc:if(null===t)break e;if(!Z&&ne<=e)continue e;break e;case mc:break e;default:xn("181")}}}}function f(e,t,n,r){b(e,t),te=s(t),p(n,r)}function h(e,t){G&&xn("182"),G=!0,ve=0;var n=X,r=!1,o=null;try{p(e,t)}catch(e){r=!0,o=e}for(;r;){if(pe){de=o;break}var a=te;if(null!==a){var i=g(a,o);if(null===i&&xn("183"),!pe){r=!1,o=null;try{f(a,i,e,t),o=null}catch(e){r=!0,o=e;continue}break}}else pe=!0}X=n,null!==t&&(le=!1),ne>bc&&!le&&(K(c),le=!0);var l=de;if(G=!1,Z=!1,pe=!1,de=null,ue=null,se=null,null!==l)throw l}function g(e,t){fc.current=null;var n=null,r=!1,o=!1,a=null;if(e.tag===Mc)n=e,m(e)&&(pe=!0);else for(var i=e.return;null!==i&&null===n;){if(i.tag===Rc){var l=i.stateNode;"function"==typeof l.componentDidCatch&&(r=!0,a=pr(i),n=i,o=!0)}else i.tag===Mc&&(n=i);if(m(i)){if(he)return null;if(null!==ce&&(ce.has(i)||null!==i.alternate&&ce.has(i.alternate)))return null;n=null,o=!1}i=i.return}if(null!==n){null===se&&(se=new Set),se.add(n);var u=pc(e),s=pr(e);null===ue&&(ue=new Map);var c={componentName:s,componentStack:u,error:t,errorBoundary:r?n.stateNode:null,errorBoundaryFound:r,errorBoundaryName:a,willRetry:o};ue.set(n,c);try{dc(c)}catch(e){console.error(e)}return fe?(null===ce&&(ce=new Set),ce.add(n)):k(n),n}return null===de&&(de=t),null}function v(e){return null!==ue&&(ue.has(e)||null!==e.alternate&&ue.has(e.alternate))}function m(e){return null!==se&&(se.has(e)||null!==e.alternate&&se.has(e.alternate))}function y(e){var t=void 0;switch(null!==ue&&(t=ue.get(e),ue.delete(e),null==t&&null!==e.alternate&&(e=e.alternate,t=ue.get(e),ue.delete(e))),null==t&&xn("184"),e.tag){case Rc:var n=e.stateNode,r={componentStack:t.componentStack};return void n.componentDidCatch(t.error,r);case Mc:return void(null===de&&(de=t.error));default:xn("157")}}function b(e,t){for(var n=e;null!==n;){switch(n.tag){case Rc:sc(n);break;case Dc:O(n);break;case Mc:case Ac:I(n)}if(n===t||n.alternate===t)break;n=n.return}}function C(e,t){t!==mc&&(e.isScheduled||(e.isScheduled=!0,ie?(ie.nextScheduledRoot=e,ie=e):(ae=e,ie=e)))}function E(e,t){ve>ge&&(pe=!0,xn("185")),!G&&t<=ne&&(te=null);for(var n=e,r=!0;null!==n&&r;){if(r=!1,(n.pendingWorkPriority===mc||n.pendingWorkPriority>t)&&(r=!0,n.pendingWorkPriority=t),null!==n.alternate&&(n.alternate.pendingWorkPriority===mc||n.alternate.pendingWorkPriority>t)&&(r=!0,n.alternate.pendingWorkPriority=t),null===n.return){if(n.tag!==Mc)return;if(C(n.stateNode,t),!G)switch(t){case yc:ee?h(yc,null):h(bc,null);break;case bc:J||xn("186");break;default:le||(K(c),le=!0)}}n=n.return}}function x(e,t){var n=X;return n===mc&&(n=!q||e.internalContextTag&Pc||t?Ec:yc),n===yc&&(G||J)?bc:n}function k(e){E(e,bc)}function P(e,t){var n=X;X=e;try{t()}finally{X=n}}function T(e,t){var n=J;J=!0;try{return e(t)}finally{J=n,G||J||h(bc,null)}}function S(e){var t=ee,n=J;ee=J,J=!1;try{return e()}finally{J=n,ee=t}}function w(e){var t=J,n=X;J=!0,X=yc;try{return e()}finally{J=t,X=n,G&&xn("187"),h(bc,null)}}function N(e){var t=X;X=Ec;try{return e()}finally{X=t}}var _=tc(e),F=uc(e),I=_.popHostContainer,O=_.popHostContext,M=_.resetHostContainer,D=ds(e,_,F,E,x),A=D.beginWork,R=D.beginFailedWork,U=Is(e,_,F),L=U.completeWork,H=Xs(e,g),B=H.commitPlacement,W=H.commitDeletion,j=H.commitWork,Y=H.commitLifeCycles,V=H.commitAttachRef,z=H.commitDetachRef,K=e.scheduleDeferredCallback,q=e.useSyncScheduling,Q=e.prepareForCommit,$=e.resetAfterCommit,X=mc,G=!1,Z=!1,J=!1,ee=!1,te=null,ne=mc,re=null,oe=null,ae=null,ie=null,le=!1,ue=null,se=null,ce=null,de=null,pe=!1,fe=!1,he=!1,ge=1e3,ve=0;return{scheduleUpdate:E,getPriorityContext:x,performWithPriority:P,batchedUpdates:T,unbatchedUpdates:S,flushSync:w,deferredUpdates:N}},jc=function(e){xn("196")};Je._injectFiber=function(e){jc=e};var zc=Je,Kc=hi.addTopLevelUpdate,Yc=Yi.findCurrentUnmaskedContext,qc=Yi.isContextProvider,Qc=Yi.processChildContext,$c=El.createFiberRoot,Xc=Yn.HostComponent,Gc=Nr.findCurrentHostFiber,Zc=Nr.findCurrentHostFiberWithNoPortals;zc._injectFiber(function(e){var t=Yc(e);return qc(e)?Qc(e,t,!1):t});var Jc=function(e){function t(e,t,n){var r=wo.enableAsyncSubtreeAPI&&null!=t&&null!=t.type&&null!=t.type.prototype&&!0===t.type.prototype.unstable_isAsyncReactComponent,i=a(e,r),l={element:t};n=void 0===n?null:n,Kc(e,l,n,i),o(e,i)}var n=e.getPublicInstance,r=Vc(e),o=r.scheduleUpdate,a=r.getPriorityContext,i=r.performWithPriority,l=r.batchedUpdates,u=r.unbatchedUpdates,s=r.flushSync,c=r.deferredUpdates;return{createContainer:function(e){return $c(e)},updateContainer:function(e,n,r,o){var a=n.current,i=zc(r);null===n.context?n.context=i:n.pendingContext=i,t(a,e,o)},performWithPriority:i,batchedUpdates:l,unbatchedUpdates:u,deferredUpdates:c,flushSync:s,getPublicRootInstance:function(e){var t=e.current;if(!t.child)return null;switch(t.child.tag){case Xc:return n(t.child.stateNode);default:return t.child.stateNode}},findHostInstance:function(e){var t=Gc(e);return null===t?null:t.stateNode},findHostInstanceWithNoPortals:function(e){var t=Zc(e);return null===t?null:t.stateNode}}},ep=Qn.TEXT_NODE,tp=nt,np=null,rp=rt,op={getOffsets:at,setOffsets:it},ap=op,ip=Qn.ELEMENT_NODE,lp={hasSelectionCapabilities:function(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&"text"===e.type||"textarea"===t||"true"===e.contentEditable)},getSelectionInformation:function(){var e=Tn();return{focusedElem:e,selectionRange:lp.hasSelectionCapabilities(e)?lp.getSelection(e):null}},restoreSelection:function(e){var t=Tn(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&lt(n)){lp.hasSelectionCapabilities(n)&&lp.setSelection(n,r);for(var o=[],a=n;a=a.parentNode;)a.nodeType===ip&&o.push({element:a,left:a.scrollLeft,top:a.scrollTop});Pn(n);for(var i=0;i<o.length;i++){var l=o[i];l.element.scrollLeft=l.left,l.element.scrollTop=l.top}}},getSelection:function(e){return("selectionStart"in e?{start:e.selectionStart,end:e.selectionEnd}:ap.getOffsets(e))||{start:0,end:0}},setSelection:function(e,t){var n=t.start,r=t.end;void 0===r&&(r=n),"selectionStart"in e?(e.selectionStart=n,e.selectionEnd=Math.min(r,e.value.length)):ap.setOffsets(e,t)}},up=lp,sp="16.0.0-beta.3",cp=Qn.ELEMENT_NODE,pp=function(e){vn(!1,"Missing injection for fiber findDOMNode")},dp=function(e){vn(!1,"Missing injection for stack findDOMNode")},fp=function(e){if(null==e)return null;if(e.nodeType===cp)return e;var t=lr.get(e);return t?"number"==typeof t.tag?pp(t):dp(t):void("function"==typeof e.render?xn("188"):vn(!1,"Element appears to be neither ReactComponent nor DOMNode. Keys: %s",Object.keys(e)))};fp._injectFiber=function(e){pp=e},fp._injectStack=function(e){dp=e};var hp=fp,gp=Yn.HostComponent,vp={isAncestor:ct,getLowestCommonAncestor:st,getParentInstance:pt,traverseTwoPhase:dt,traverseEnterLeave:ft},mp=io.getListener,yp={accumulateTwoPhaseDispatches:Ct,accumulateTwoPhaseDispatchesSkipTarget:Et,accumulateDirectDispatches:Pt,accumulateEnterLeaveDispatches:kt},bp=yp;gn(Tt.prototype,{destructor:function(){this._root=null,this._startText=null,this._fallbackText=null},getText:function(){return"value"in this._root?this._root.value:this._root[rp()]},getData:function(){if(this._fallbackText)return this._fallbackText;var e,t,n=this._startText,r=n.length,o=this.getText(),a=o.length;for(e=0;e<r&&n[e]===o[e];e++);var i=r-e;for(t=1;t<=i&&n[r-t]===o[a-t];t++);var l=t>1?1-t:void 0;return this._fallbackText=o.slice(e,l),this._fallbackText}}),Ln.addPoolingTo(Tt);var Cp=Tt,Ep=["dispatchConfig","_targetInst","nativeEvent","isDefaultPrevented","isPropagationStopped","_dispatchListeners","_dispatchInstances"],kp={type:null,target:null,currentTarget:bn.thatReturnsNull,eventPhase:null,bubbles:null,cancelable:null,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:null,isTrusted:null};gn(xt.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!=typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=bn.thatReturnsTrue)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!=typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=bn.thatReturnsTrue)},persist:function(){this.isPersistent=bn.thatReturnsTrue},isPersistent:bn.thatReturnsFalse,destructor:function(){var e=this.constructor.Interface;for(var t in e)this[t]=null;for(var n=0;n<Ep.length;n++)this[Ep[n]]=null}}),xt.Interface=kp,xt.augmentClass=function(e,t){var n=this,r=function(){};r.prototype=n.prototype;var o=new r;gn(o,e.prototype),e.prototype=o,e.prototype.constructor=e,e.Interface=gn({},n.Interface,t),e.augmentClass=n.augmentClass,Ln.addPoolingTo(e,Ln.fourArgumentPooler)},Ln.addPoolingTo(xt,Ln.fourArgumentPooler);var Pp=xt,Tp={data:null};Pp.augmentClass(wt,Tp);var xp=wt,wp={data:null};Pp.augmentClass(Nt,wp);var Np=Nt,Sp=[9,13,27,32],_p=229,Ip=hn.canUseDOM&&"CompositionEvent"in window,Fp=null;hn.canUseDOM&&"documentMode"in document&&(Fp=document.documentMode);var Op=hn.canUseDOM&&"TextEvent"in window&&!Fp&&!St(),Mp=hn.canUseDOM&&(!Ip||Fp&&Fp>8&&Fp<=11),Dp=32,Ap=String.fromCharCode(Dp),Rp={beforeInput:{phasedRegistrationNames:{bubbled:"onBeforeInput",captured:"onBeforeInputCapture"},dependencies:["topCompositionEnd","topKeyPress","topTextInput","topPaste"]},compositionEnd:{phasedRegistrationNames:{bubbled:"onCompositionEnd",captured:"onCompositionEndCapture"},dependencies:["topBlur","topCompositionEnd","topKeyDown","topKeyPress","topKeyUp","topMouseDown"]},compositionStart:{phasedRegistrationNames:{bubbled:"onCompositionStart",captured:"onCompositionStartCapture"},dependencies:["topBlur","topCompositionStart","topKeyDown","topKeyPress","topKeyUp","topMouseDown"]},compositionUpdate:{phasedRegistrationNames:{bubbled:"onCompositionUpdate",
+captured:"onCompositionUpdateCapture"},dependencies:["topBlur","topCompositionUpdate","topKeyDown","topKeyPress","topKeyUp","topMouseDown"]}},Up=!1,Hp=null,Lp={eventTypes:Rp,extractEvents:function(e,t,n,r){return[Dt(e,t,n,r),Ut(e,t,n,r)]}},Wp=Lp,Bp={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0},Vp=Ht,jp={change:{phasedRegistrationNames:{bubbled:"onChange",captured:"onChangeCapture"},dependencies:["topBlur","topChange","topClick","topFocus","topInput","topKeyDown","topKeyUp","topSelectionChange"]}},zp=!1;hn.canUseDOM&&(zp=!document.documentMode||document.documentMode>9);var Kp={eventTypes:jp,extractEvents:function(e,t,n,r){var o=t?ar.getNodeFromInstance(t):window;zp||"topSelectionChange"!==e||(r=o=Tn(),o&&(t=ar.getInstanceFromNode(o)));var a,i;if(a=Lt(o)?zt:Vp(o)&&!zp?Vt:jt){var l=a(e,t,o);if(l)return Wt(l,n,r)}i&&i(e,o,t),"topBlur"===e&&Kt(t,o)}},Yp=Kp,qp=["ResponderEventPlugin","SimpleEventPlugin","TapEventPlugin","EnterLeaveEventPlugin","ChangeEventPlugin","SelectEventPlugin","BeforeInputEventPlugin"],Qp=qp,$p={view:function(e){if(e.view)return e.view;var t=$r(e);if(t.window===t)return t;var n=t.ownerDocument;return n?n.defaultView||n.parentWindow:window},detail:function(e){return e.detail||0}};Pp.augmentClass(Yt,$p);var Xp=Yt,Gp={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"},Zp=Qt,Jp={screenX:null,screenY:null,clientX:null,clientY:null,pageX:null,pageY:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,getModifierState:Zp,button:null,buttons:null,relatedTarget:function(e){return e.relatedTarget||(e.fromElement===e.srcElement?e.toElement:e.fromElement)}};Xp.augmentClass($t,Jp);var ed=$t,td={mouseEnter:{registrationName:"onMouseEnter",dependencies:["topMouseOut","topMouseOver"]},mouseLeave:{registrationName:"onMouseLeave",dependencies:["topMouseOut","topMouseOver"]}},nd={eventTypes:td,extractEvents:function(e,t,n,r){if("topMouseOver"===e&&(n.relatedTarget||n.fromElement))return null;if("topMouseOut"!==e&&"topMouseOver"!==e)return null;var o;if(r.window===r)o=r;else{var a=r.ownerDocument;o=a?a.defaultView||a.parentWindow:window}var i,l;if("topMouseOut"===e){i=t;var u=n.relatedTarget||n.toElement;l=u?ar.getClosestInstanceFromNode(u):null}else i=null,l=t;if(i===l)return null;var s=null==i?o:ar.getNodeFromInstance(i),c=null==l?o:ar.getNodeFromInstance(l),d=ed.getPooled(td.mouseLeave,i,n,r);d.type="mouseleave",d.target=s,d.relatedTarget=c;var p=ed.getPooled(td.mouseEnter,l,n,r);return p.type="mouseenter",p.target=c,p.relatedTarget=s,bp.accumulateEnterLeaveDispatches(d,p,i,l),[d,p]}},rd=nd,od=Qn.DOCUMENT_NODE,ad=hn.canUseDOM&&"documentMode"in document&&document.documentMode<=11,id={select:{phasedRegistrationNames:{bubbled:"onSelect",captured:"onSelectCapture"},dependencies:["topBlur","topContextMenu","topFocus","topKeyDown","topKeyUp","topMouseDown","topMouseUp","topSelectionChange"]}},ld=null,ud=null,sd=null,cd=!1,pd=To.isListeningToAllDependencies,dd={eventTypes:id,extractEvents:function(e,t,n,r){var o=r.window===r?r.document:r.nodeType===od?r:r.ownerDocument;if(!o||!pd("onSelect",o))return null;var a=t?ar.getNodeFromInstance(t):window;switch(e){case"topFocus":(Vp(a)||"true"===a.contentEditable)&&(ld=a,ud=t,sd=null);break;case"topBlur":ld=null,ud=null,sd=null;break;case"topMouseDown":cd=!0;break;case"topContextMenu":case"topMouseUp":return cd=!1,Gt(n,r);case"topSelectionChange":if(ad)break;case"topKeyDown":case"topKeyUp":return Gt(n,r)}return null}},fd=dd,hd={animationName:null,elapsedTime:null,pseudoElement:null};Pp.augmentClass(Zt,hd);var gd=Zt,vd={clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}};Pp.augmentClass(Jt,vd);var md=Jt,yd={relatedTarget:null};Xp.augmentClass(en,yd);var bd=en,Cd=tn,Ed={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},kd={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Pd=nn,Td={key:Pd,location:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,repeat:null,locale:null,getModifierState:Zp,charCode:function(e){return"keypress"===e.type?Cd(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?Cd(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}};Xp.augmentClass(rn,Td);var xd=rn,wd={dataTransfer:null};ed.augmentClass(on,wd);var Nd=on,Sd={touches:null,targetTouches:null,changedTouches:null,altKey:null,metaKey:null,ctrlKey:null,shiftKey:null,getModifierState:Zp};Xp.augmentClass(an,Sd);var _d=an,Id={propertyName:null,elapsedTime:null,pseudoElement:null};Pp.augmentClass(ln,Id);var Fd=ln,Od={deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:null,deltaMode:null};ed.augmentClass(un,Od);var Md=un,Dd={},Ad={};["abort","animationEnd","animationIteration","animationStart","blur","cancel","canPlay","canPlayThrough","click","close","contextMenu","copy","cut","doubleClick","drag","dragEnd","dragEnter","dragExit","dragLeave","dragOver","dragStart","drop","durationChange","emptied","encrypted","ended","error","focus","input","invalid","keyDown","keyPress","keyUp","load","loadedData","loadedMetadata","loadStart","mouseDown","mouseMove","mouseOut","mouseOver","mouseUp","paste","pause","play","playing","progress","rateChange","reset","scroll","seeked","seeking","stalled","submit","suspend","timeUpdate","toggle","touchCancel","touchEnd","touchMove","touchStart","transitionEnd","volumeChange","waiting","wheel"].forEach(function(e){var t=e[0].toUpperCase()+e.slice(1),n="on"+t,r="top"+t,o={phasedRegistrationNames:{bubbled:n,captured:n+"Capture"},dependencies:[r]};Dd[e]=o,Ad[r]=o});var Rd={eventTypes:Dd,extractEvents:function(e,t,n,r){var o=Ad[e];if(!o)return null;var a;switch(e){case"topAbort":case"topCancel":case"topCanPlay":case"topCanPlayThrough":case"topClose":case"topDurationChange":case"topEmptied":case"topEncrypted":case"topEnded":case"topError":case"topInput":case"topInvalid":case"topLoad":case"topLoadedData":case"topLoadedMetadata":case"topLoadStart":case"topPause":case"topPlay":case"topPlaying":case"topProgress":case"topRateChange":case"topReset":case"topSeeked":case"topSeeking":case"topStalled":case"topSubmit":case"topSuspend":case"topTimeUpdate":case"topToggle":case"topVolumeChange":case"topWaiting":a=Pp;break;case"topKeyPress":if(0===Cd(n))return null;case"topKeyDown":case"topKeyUp":a=xd;break;case"topBlur":case"topFocus":a=bd;break;case"topClick":if(2===n.button)return null;case"topDoubleClick":case"topMouseDown":case"topMouseMove":case"topMouseUp":case"topMouseOut":case"topMouseOver":case"topContextMenu":a=ed;break;case"topDrag":case"topDragEnd":case"topDragEnter":case"topDragExit":case"topDragLeave":case"topDragOver":case"topDragStart":case"topDrop":a=Nd;break;case"topTouchCancel":case"topTouchEnd":case"topTouchMove":case"topTouchStart":a=_d;break;case"topAnimationEnd":case"topAnimationIteration":case"topAnimationStart":a=gd;break;case"topTransitionEnd":a=Fd;break;case"topScroll":a=Xp;break;case"topWheel":a=Md;break;case"topCopy":case"topCut":case"topPaste":a=md}a||xn("86",e);var i=a.getPooled(o,t,n,r);return bp.accumulateTwoPhaseDispatches(i),i}},Ud=Rd;Zr.setHandleTopLevel(To.handleTopLevel),io.injection.injectEventPluginOrder(Qp),Ar.injection.injectComponentTree(ar),io.injection.injectEventPluginsByName({SimpleEventPlugin:Ud,EnterLeaveEventPlugin:rd,ChangeEventPlugin:Yp,SelectEventPlugin:fd,BeforeInputEventPlugin:Wp});var Hd={Properties:{"aria-current":0,"aria-details":0,"aria-disabled":0,"aria-hidden":0,"aria-invalid":0,"aria-keyshortcuts":0,"aria-label":0,"aria-roledescription":0,"aria-autocomplete":0,"aria-checked":0,"aria-expanded":0,"aria-haspopup":0,"aria-level":0,"aria-modal":0,"aria-multiline":0,"aria-multiselectable":0,"aria-orientation":0,"aria-placeholder":0,"aria-pressed":0,"aria-readonly":0,"aria-required":0,"aria-selected":0,"aria-sort":0,"aria-valuemax":0,"aria-valuemin":0,"aria-valuenow":0,"aria-valuetext":0,"aria-atomic":0,"aria-busy":0,"aria-live":0,"aria-relevant":0,"aria-dropeffect":0,"aria-grabbed":0,"aria-activedescendant":0,"aria-colcount":0,"aria-colindex":0,"aria-colspan":0,"aria-controls":0,"aria-describedby":0,"aria-errormessage":0,"aria-flowto":0,"aria-labelledby":0,"aria-owns":0,"aria-posinset":0,"aria-rowcount":0,"aria-rowindex":0,"aria-rowspan":0,"aria-setsize":0},DOMAttributeNames:{},DOMPropertyNames:{}},Ld=Hd,Wd=jn.injection.MUST_USE_PROPERTY,Bd=jn.injection.HAS_BOOLEAN_VALUE,Vd=jn.injection.HAS_NUMERIC_VALUE,jd=jn.injection.HAS_POSITIVE_NUMERIC_VALUE,zd=jn.injection.HAS_OVERLOADED_BOOLEAN_VALUE,Kd={isCustomAttribute:RegExp.prototype.test.bind(new RegExp("^(data|aria)-["+jn.ATTRIBUTE_NAME_CHAR+"]*$")),Properties:{accept:0,acceptCharset:0,accessKey:0,action:0,allowFullScreen:Bd,allowTransparency:0,alt:0,as:0,async:Bd,autoComplete:0,autoPlay:Bd,capture:Bd,cellPadding:0,cellSpacing:0,charSet:0,challenge:0,checked:Wd|Bd,cite:0,classID:0,className:0,cols:jd,colSpan:0,content:0,contentEditable:0,contextMenu:0,controls:Bd,controlsList:0,coords:0,crossOrigin:0,data:0,dateTime:0,default:Bd,defer:Bd,dir:0,disabled:Bd,download:zd,draggable:0,encType:0,form:0,formAction:0,formEncType:0,formMethod:0,formNoValidate:Bd,formTarget:0,frameBorder:0,headers:0,height:0,hidden:Bd,high:0,href:0,hrefLang:0,htmlFor:0,httpEquiv:0,id:0,inputMode:0,integrity:0,is:0,keyParams:0,keyType:0,kind:0,label:0,lang:0,list:0,loop:Bd,low:0,manifest:0,marginHeight:0,marginWidth:0,max:0,maxLength:0,media:0,mediaGroup:0,method:0,min:0,minLength:0,multiple:Wd|Bd,muted:Wd|Bd,name:0,nonce:0,noValidate:Bd,open:Bd,optimum:0,pattern:0,placeholder:0,playsInline:Bd,poster:0,preload:0,profile:0,radioGroup:0,readOnly:Bd,referrerPolicy:0,rel:0,required:Bd,reversed:Bd,role:0,rows:jd,rowSpan:Vd,sandbox:0,scope:0,scoped:Bd,scrolling:0,seamless:Bd,selected:Wd|Bd,shape:0,size:jd,sizes:0,slot:0,span:jd,spellCheck:0,src:0,srcDoc:0,srcLang:0,srcSet:0,start:Vd,step:0,style:0,summary:0,tabIndex:0,target:0,title:0,type:0,useMap:0,value:0,width:0,wmode:0,wrap:0,about:0,datatype:0,inlist:0,prefix:0,property:0,resource:0,typeof:0,vocab:0,autoCapitalize:0,autoCorrect:0,autoSave:0,color:0,itemProp:0,itemScope:Bd,itemType:0,itemID:0,itemRef:0,results:0,security:0,unselectable:0},DOMAttributeNames:{acceptCharset:"accept-charset",className:"class",htmlFor:"for",httpEquiv:"http-equiv"},DOMPropertyNames:{},DOMMutationMethods:{value:function(e,t){return null==t?e.removeAttribute("value"):void("number"!==e.type||!1===e.hasAttribute("value")?e.setAttribute("value",""+t):e.validity&&!e.validity.badInput&&e.ownerDocument.activeElement!==e&&e.setAttribute("value",""+t))}}},Yd=Kd,qd={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"},Qd={accentHeight:"accent-height",accumulate:0,additive:0,alignmentBaseline:"alignment-baseline",allowReorder:"allowReorder",alphabetic:0,amplitude:0,arabicForm:"arabic-form",ascent:0,attributeName:"attributeName",attributeType:"attributeType",autoReverse:"autoReverse",azimuth:0,baseFrequency:"baseFrequency",baseProfile:"baseProfile",baselineShift:"baseline-shift",bbox:0,begin:0,bias:0,by:0,calcMode:"calcMode",capHeight:"cap-height",clip:0,clipPath:"clip-path",clipRule:"clip-rule",clipPathUnits:"clipPathUnits",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",contentScriptType:"contentScriptType",contentStyleType:"contentStyleType",cursor:0,cx:0,cy:0,d:0,decelerate:0,descent:0,diffuseConstant:"diffuseConstant",direction:0,display:0,divisor:0,dominantBaseline:"dominant-baseline",dur:0,dx:0,dy:0,edgeMode:"edgeMode",elevation:0,enableBackground:"enable-background",end:0,exponent:0,externalResourcesRequired:"externalResourcesRequired",fill:0,fillOpacity:"fill-opacity",fillRule:"fill-rule",filter:0,filterRes:"filterRes",filterUnits:"filterUnits",floodColor:"flood-color",floodOpacity:"flood-opacity",focusable:0,fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",format:0,from:0,fx:0,fy:0,g1:0,g2:0,glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",glyphRef:"glyphRef",gradientTransform:"gradientTransform",gradientUnits:"gradientUnits",hanging:0,horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",ideographic:0,imageRendering:"image-rendering",in:0,in2:0,intercept:0,k:0,k1:0,k2:0,k3:0,k4:0,kernelMatrix:"kernelMatrix",kernelUnitLength:"kernelUnitLength",kerning:0,keyPoints:"keyPoints",keySplines:"keySplines",keyTimes:"keyTimes",lengthAdjust:"lengthAdjust",letterSpacing:"letter-spacing",lightingColor:"lighting-color",limitingConeAngle:"limitingConeAngle",local:0,markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",markerHeight:"markerHeight",markerUnits:"markerUnits",markerWidth:"markerWidth",mask:0,maskContentUnits:"maskContentUnits",maskUnits:"maskUnits",mathematical:0,mode:0,numOctaves:"numOctaves",offset:0,opacity:0,operator:0,order:0,orient:0,orientation:0,origin:0,overflow:0,overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pathLength:"pathLength",patternContentUnits:"patternContentUnits",patternTransform:"patternTransform",patternUnits:"patternUnits",pointerEvents:"pointer-events",points:0,pointsAtX:"pointsAtX",pointsAtY:"pointsAtY",pointsAtZ:"pointsAtZ",preserveAlpha:"preserveAlpha",preserveAspectRatio:"preserveAspectRatio",primitiveUnits:"primitiveUnits",r:0,radius:0,refX:"refX",refY:"refY",renderingIntent:"rendering-intent",repeatCount:"repeatCount",repeatDur:"repeatDur",requiredExtensions:"requiredExtensions",requiredFeatures:"requiredFeatures",restart:0,result:0,rotate:0,rx:0,ry:0,scale:0,seed:0,shapeRendering:"shape-rendering",slope:0,spacing:0,specularConstant:"specularConstant",specularExponent:"specularExponent",speed:0,spreadMethod:"spreadMethod",startOffset:"startOffset",stdDeviation:"stdDeviation",stemh:0,stemv:0,stitchTiles:"stitchTiles",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",string:0,stroke:0,strokeDasharray:"stroke-dasharray",strokeDashoffset:"stroke-dashoffset",strokeLinecap:"stroke-linecap",strokeLinejoin:"stroke-linejoin",strokeMiterlimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",surfaceScale:"surfaceScale",systemLanguage:"systemLanguage",tableValues:"tableValues",targetX:"targetX",targetY:"targetY",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",textLength:"textLength",to:0,transform:0,u1:0,u2:0,underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicode:0,unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",values:0,vectorEffect:"vector-effect",version:0,vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",viewBox:"viewBox",viewTarget:"viewTarget",visibility:0,widths:0,wordSpacing:"word-spacing",writingMode:"writing-mode",x:0,xHeight:"x-height",x1:0,x2:0,xChannelSelector:"xChannelSelector",xlinkActuate:"xlink:actuate",xlinkArcrole:"xlink:arcrole",xlinkHref:"xlink:href",xlinkRole:"xlink:role",xlinkShow:"xlink:show",xlinkTitle:"xlink:title",xlinkType:"xlink:type",xmlBase:"xml:base",xmlns:0,xmlnsXlink:"xmlns:xlink",xmlLang:"xml:lang",xmlSpace:"xml:space",y:0,y1:0,y2:0,yChannelSelector:"yChannelSelector",z:0,zoomAndPan:"zoomAndPan"},$d={Properties:{},DOMAttributeNamespaces:{xlinkActuate:qd.xlink,xlinkArcrole:qd.xlink,xlinkHref:qd.xlink,xlinkRole:qd.xlink,xlinkShow:qd.xlink,xlinkTitle:qd.xlink,xlinkType:qd.xlink,xmlBase:qd.xml,xmlLang:qd.xml,xmlSpace:qd.xml},DOMAttributeNames:{}};Object.keys(Qd).forEach(function(e){$d.Properties[e]=0,Qd[e]&&($d.DOMAttributeNames[e]=Qd[e])});var Xd=$d;jn.injection.injectDOMPropertyConfig(Ld),jn.injection.injectDOMPropertyConfig(Yd),jn.injection.injectDOMPropertyConfig(Xd);var Gd=yn.isValidElement,Zd=Us.injectInternals,Jd=Qn.ELEMENT_NODE,ef=Qn.TEXT_NODE,tf=Qn.COMMENT_NODE,nf=Qn.DOCUMENT_NODE,rf=Qn.DOCUMENT_FRAGMENT_NODE,of=jn.ROOT_ATTRIBUTE_NAME,af=La.createElement,lf=La.getChildNamespace,uf=La.setInitialProperties,sf=La.diffProperties,cf=La.updateProperties,pf=La.diffHydratedProperties,df=La.diffHydratedText,ff=La.warnForDeletedHydratableElement,hf=La.warnForDeletedHydratableText,gf=La.warnForInsertedHydratedElement,vf=La.warnForInsertedHydratedText,mf=ar.precacheFiberNode,yf=ar.updateFiberProps;Br.injection.injectFiberControlledHostComponent(La),hp._injectFiber(function(e){return Ef.findHostInstance(e)});var bf=null,Cf=null,Ef=Jc({getRootHostContext:function(e){var t=void 0,n=void 0;if(e.nodeType===nf){t="#document";var r=e.documentElement;n=r?r.namespaceURI:lf(null,"")}else{var o=e.nodeType===tf?e.parentNode:e,a=o.namespaceURI||null;t=o.tagName,n=lf(a,t)}return n},getChildHostContext:function(e,t){return lf(e,t)},getPublicInstance:function(e){return e},prepareForCommit:function(){bf=To.isEnabled(),Cf=up.getSelectionInformation(),To.setEnabled(!1)},resetAfterCommit:function(){up.restoreSelection(Cf),Cf=null,To.setEnabled(bf),bf=null},createInstance:function(e,t,n,r,o){var a=void 0;a=r;var i=af(e,t,n,a);return mf(o,i),yf(i,t),i},appendInitialChild:function(e,t){e.appendChild(t)},finalizeInitialChildren:function(e,t,n,r){return uf(e,t,n,r),dn(t,n)},prepareUpdate:function(e,t,n,r,o,a){return sf(e,t,n,r,o)},commitMount:function(e,t,n,r){e.focus()},commitUpdate:function(e,t,n,r,o,a){yf(e,o),cf(e,t,n,r,o)},shouldSetTextContent:function(e,t){return"textarea"===e||"string"==typeof t.children||"number"==typeof t.children||"object"==typeof t.dangerouslySetInnerHTML&&null!==t.dangerouslySetInnerHTML&&"string"==typeof t.dangerouslySetInnerHTML.__html},resetTextContent:function(e){e.textContent=""},shouldDeprioritizeSubtree:function(e,t){return!!t.hidden},createTextInstance:function(e,t,n,r){var o=document.createTextNode(e);return mf(r,o),o},commitTextUpdate:function(e,t,n){e.nodeValue=n},appendChild:function(e,t){e.appendChild(t)},appendChildToContainer:function(e,t){e.nodeType===tf?e.parentNode.insertBefore(t,e):e.appendChild(t)},insertBefore:function(e,t,n){e.insertBefore(t,n)},insertInContainerBefore:function(e,t,n){e.nodeType===tf?e.parentNode.insertBefore(t,n):e.insertBefore(t,n)},removeChild:function(e,t){e.removeChild(t)},removeChildFromContainer:function(e,t){e.nodeType===tf?e.parentNode.removeChild(t):e.removeChild(t)},canHydrateInstance:function(e,t,n){return e.nodeType===Jd&&t===e.nodeName.toLowerCase()},canHydrateTextInstance:function(e,t){return""!==t&&e.nodeType===ef},getNextHydratableSibling:function(e){for(var t=e.nextSibling;t&&t.nodeType!==Jd&&t.nodeType!==ef;)t=t.nextSibling;return t},getFirstHydratableChild:function(e){for(var t=e.firstChild;t&&t.nodeType!==Jd&&t.nodeType!==ef;)t=t.nextSibling;return t},hydrateInstance:function(e,t,n,r,o){return mf(o,e),yf(e,n),pf(e,t,n,r)},hydrateTextInstance:function(e,t,n){return mf(n,e),df(e,t)},didNotHydrateInstance:function(e,t){1===t.nodeType?ff(e,t):hf(e,t)},didNotFindHydratableInstance:function(e,t,n){gf(e,t,n)},didNotFindHydratableTextInstance:function(e,t){vf(e,t)},scheduleDeferredCallback:Ja.rIC,useSyncScheduling:!So.fiberAsyncScheduling});qr.injection.injectFiberBatchedUpdates(Ef.batchedUpdates);var kf={hydrate:function(e,t,n){return fn(null,e,t,!0,n)},render:function(e,t,n){return wo.disableNewFiberFeatures&&(Gd(e)||("string"==typeof e?vn(!1,"ReactDOM.render(): Invalid component element. Instead of passing a string like 'div', pass React.createElement('div') or <div />."):"function"==typeof e?vn(!1,"ReactDOM.render(): Invalid component element. Instead of passing a class like Foo, pass React.createElement(Foo) or <Foo />."):null!=e&&void 0!==e.props?vn(!1,"ReactDOM.render(): Invalid component element. This may be caused by unintentionally loading two independent copies of React."):vn(!1,"ReactDOM.render(): Invalid component element."))),fn(null,e,t,!1,n)},unstable_renderSubtreeIntoContainer:function(e,t,n,r){return null!=e&&lr.has(e)||xn("38"),fn(e,t,n,!1,r)},unmountComponentAtNode:function(e){return sn(e)||xn("40"),!!e._reactRootContainer&&(Ef.unbatchedUpdates(function(){fn(null,null,e,!1,function(){e._reactRootContainer=null})}),!0)},findDOMNode:hp,unstable_createPortal:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return Yl.createPortal(e,t,null,n)},unstable_batchedUpdates:qr.batchedUpdates,unstable_deferredUpdates:Ef.deferredUpdates,flushSync:Ef.flushSync,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:{EventPluginHub:io,EventPluginRegistry:_n,EventPropagators:bp,ReactControlledComponent:Br,ReactDOMComponentTree:ar,ReactDOMEventListener:Zr}},Pf=Zd({findFiberByHostInstance:ar.getClosestInstanceFromNode,findHostInstanceByFiber:Ef.findHostInstance,bundleType:0,version:sp}),Tf=kf;module.exports=Tf;
- function createChainableTypeChecker(validate) {
- if (process.env.NODE_ENV !== 'production') {
- var manualPropTypeCallCache = {};
- var manualPropTypeWarningCount = 0;
- }
- function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
- componentName = componentName || ANONYMOUS;
- propFullName = propFullName || propName;
+},{"fbjs/lib/EventListener":4,"fbjs/lib/ExecutionEnvironment":5,"fbjs/lib/containsNode":6,"fbjs/lib/emptyFunction":7,"fbjs/lib/emptyObject":8,"fbjs/lib/focusNode":9,"fbjs/lib/getActiveElement":10,"fbjs/lib/invariant":11,"fbjs/lib/shallowEqual":14,"object-assign":33,"react":"react"}],37:[function(require,module,exports){
+"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(e,r){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!r||"object"!=typeof r&&"function"!=typeof r?e:r}function _inherits(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function, not "+typeof r);e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),r&&(Object.setPrototypeOf?Object.setPrototypeOf(e,r):e.__proto__=r)}function warnAboutReceivingStore(){didWarnAboutReceivingStore||(didWarnAboutReceivingStore=!0,(0,_warning2.default)("<Provider> does not support changing `store` on the fly. It is most likely that you see this error because you updated to Redux 2.x and React Redux 2.x which no longer hot reload reducers automatically. See https://github.com/reactjs/react-redux/releases/tag/v2.0.0 for the migration instructions."))}function createProvider(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"store",t=arguments[1],o=t||r+"Subscription",n=function(e){function t(o,n){_classCallCheck(this,t);var i=_possibleConstructorReturn(this,e.call(this,o,n));return i[r]=o.store,i}return _inherits(t,e),t.prototype.getChildContext=function(){var e;return e={},e[r]=this[r],e[o]=null,e},t.prototype.render=function(){return _react.Children.only(this.props.children)},t}(_react.Component);return n.propTypes={store:_PropTypes.storeShape.isRequired,children:_propTypes2.default.element.isRequired},n.childContextTypes=(e={},e[r]=_PropTypes.storeShape.isRequired,e[o]=_PropTypes.subscriptionShape,e),n.displayName="Provider",n}exports.__esModule=!0,exports.createProvider=createProvider;var _react=require("react"),_propTypes=require("prop-types"),_propTypes2=_interopRequireDefault(_propTypes),_PropTypes=require("../utils/PropTypes"),_warning=require("../utils/warning"),_warning2=_interopRequireDefault(_warning),didWarnAboutReceivingStore=!1;exports.default=createProvider();
- if (secret !== ReactPropTypesSecret) {
- if (throwOnDirectAccess) {
- // New behavior only for users of `prop-types` package
- invariant(
- false,
- 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
- 'Use `PropTypes.checkPropTypes()` to call them. ' +
- 'Read more at http://fb.me/use-check-prop-types'
- );
- } else if (process.env.NODE_ENV !== 'production' && typeof console !== 'undefined') {
- // Old behavior for people using React.PropTypes
- var cacheKey = componentName + ':' + propName;
- if (
- !manualPropTypeCallCache[cacheKey] &&
- // Avoid spamming the console because they are often not actionable except for lib authors
- manualPropTypeWarningCount < 3
- ) {
- warning(
- false,
- 'You are manually calling a React.PropTypes validation ' +
- 'function for the `%s` prop on `%s`. This is deprecated ' +
- 'and will throw in the standalone `prop-types` package. ' +
- 'You may be seeing this warning due to a third-party PropTypes ' +
- 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.',
- propFullName,
- componentName
- );
- manualPropTypeCallCache[cacheKey] = true;
- manualPropTypeWarningCount++;
- }
- }
- }
- if (props[propName] == null) {
- if (isRequired) {
- if (props[propName] === null) {
- return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));
- }
- return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));
- }
- return null;
- } else {
- return validate(props, propName, componentName, location, propFullName);
- }
- }
+},{"../utils/PropTypes":46,"../utils/warning":50,"prop-types":"prop-types","react":"react"}],38:[function(require,module,exports){
+"use strict";function _interopRequireDefault(t){return t&&t.__esModule?t:{default:t}}function _classCallCheck(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function _objectWithoutProperties(t,e){var o={};for(var n in t)e.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(t,n)&&(o[n]=t[n]);return o}function noop(){}function makeSelectorStateful(t,e){var o={run:function(n){try{var r=t(e.getState(),n);(r!==o.props||o.error)&&(o.shouldComponentUpdate=!0,o.props=r,o.error=null)}catch(t){o.shouldComponentUpdate=!0,o.error=t}}};return o}function connectAdvanced(t){var e,o,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.getDisplayName,i=void 0===r?function(t){return"ConnectAdvanced("+t+")"}:r,s=n.methodName,p=void 0===s?"connectAdvanced":s,a=n.renderCountProp,u=void 0===a?void 0:a,c=n.shouldHandleStateChanges,d=void 0===c||c,h=n.storeKey,l=void 0===h?"store":h,f=n.withRef,y=void 0!==f&&f,b=_objectWithoutProperties(n,["getDisplayName","methodName","renderCountProp","shouldHandleStateChanges","storeKey","withRef"]),m=l+"Subscription",_=hotReloadingVersion++,v=(e={},e[l]=_PropTypes.storeShape,e[m]=_PropTypes.subscriptionShape,e),S=(o={},o[m]=_PropTypes.subscriptionShape,o);return function(e){(0,_invariant2.default)("function"==typeof e,"You must pass a component to the function returned by connect. Instead received "+JSON.stringify(e));var o=e.displayName||e.name||"Component",n=i(o),r=_extends({},b,{getDisplayName:i,methodName:p,renderCountProp:u,shouldHandleStateChanges:d,storeKey:l,withRef:y,displayName:n,wrappedComponentName:o,WrappedComponent:e}),s=function(o){function i(t,e){_classCallCheck(this,i);var r=_possibleConstructorReturn(this,o.call(this,t,e));return r.version=_,r.state={},r.renderCount=0,r.store=t[l]||e[l],r.propsMode=Boolean(t[l]),r.setWrappedInstance=r.setWrappedInstance.bind(r),(0,_invariant2.default)(r.store,'Could not find "'+l+'" in either the context or props of '+('"'+n+'". Either wrap the root component in a <Provider>, ')+('or explicitly pass "'+l+'" as a prop to "'+n+'".')),r.initSelector(),r.initSubscription(),r}return _inherits(i,o),i.prototype.getChildContext=function(){var t,e=this.propsMode?null:this.subscription;return t={},t[m]=e||this.context[m],t},i.prototype.componentDidMount=function(){d&&(this.subscription.trySubscribe(),this.selector.run(this.props),this.selector.shouldComponentUpdate&&this.forceUpdate())},i.prototype.componentWillReceiveProps=function(t){this.selector.run(t)},i.prototype.shouldComponentUpdate=function(){return this.selector.shouldComponentUpdate},i.prototype.componentWillUnmount=function(){this.subscription&&this.subscription.tryUnsubscribe(),this.subscription=null,this.notifyNestedSubs=noop,this.store=null,this.selector.run=noop,this.selector.shouldComponentUpdate=!1},i.prototype.getWrappedInstance=function(){return(0,_invariant2.default)(y,"To access the wrapped instance, you need to specify "+("{ withRef: true } in the options argument of the "+p+"() call.")),this.wrappedInstance},i.prototype.setWrappedInstance=function(t){this.wrappedInstance=t},i.prototype.initSelector=function(){var e=t(this.store.dispatch,r);this.selector=makeSelectorStateful(e,this.store),this.selector.run(this.props)},i.prototype.initSubscription=function(){if(d){var t=(this.propsMode?this.props:this.context)[m];this.subscription=new _Subscription2.default(this.store,t,this.onStateChange.bind(this)),this.notifyNestedSubs=this.subscription.notifyNestedSubs.bind(this.subscription)}},i.prototype.onStateChange=function(){this.selector.run(this.props),this.selector.shouldComponentUpdate?(this.componentDidUpdate=this.notifyNestedSubsOnComponentDidUpdate,this.setState(dummyState)):this.notifyNestedSubs()},i.prototype.notifyNestedSubsOnComponentDidUpdate=function(){this.componentDidUpdate=void 0,this.notifyNestedSubs()},i.prototype.isSubscribed=function(){return Boolean(this.subscription)&&this.subscription.isSubscribed()},i.prototype.addExtraProps=function(t){if(!(y||u||this.propsMode&&this.subscription))return t;var e=_extends({},t);return y&&(e.ref=this.setWrappedInstance),u&&(e[u]=this.renderCount++),this.propsMode&&this.subscription&&(e[m]=this.subscription),e},i.prototype.render=function(){var t=this.selector;if(t.shouldComponentUpdate=!1,t.error)throw t.error;return(0,_react.createElement)(e,this.addExtraProps(t.props))},i}(_react.Component);return s.WrappedComponent=e,s.displayName=n,s.childContextTypes=S,s.contextTypes=v,s.propTypes=v,(0,_hoistNonReactStatics2.default)(s,e)}}exports.__esModule=!0;var _extends=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var o=arguments[e];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(t[n]=o[n])}return t};exports.default=connectAdvanced;var _hoistNonReactStatics=require("hoist-non-react-statics"),_hoistNonReactStatics2=_interopRequireDefault(_hoistNonReactStatics),_invariant=require("invariant"),_invariant2=_interopRequireDefault(_invariant),_react=require("react"),_Subscription=require("../utils/Subscription"),_Subscription2=_interopRequireDefault(_Subscription),_PropTypes=require("../utils/PropTypes"),hotReloadingVersion=0,dummyState={};
- var chainedCheckType = checkType.bind(null, false);
- chainedCheckType.isRequired = checkType.bind(null, true);
+},{"../utils/PropTypes":46,"../utils/Subscription":47,"hoist-non-react-statics":15,"invariant":16,"react":"react"}],39:[function(require,module,exports){
+"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _objectWithoutProperties(e,t){var r={};for(var o in e)t.indexOf(o)>=0||Object.prototype.hasOwnProperty.call(e,o)&&(r[o]=e[o]);return r}function match(e,t,r){for(var o=t.length-1;o>=0;o--){var a=t[o](e);if(a)return a}return function(t,o){throw new Error("Invalid value of type "+typeof e+" for "+r+" argument when connecting component "+o.wrappedComponentName+".")}}function strictEqual(e,t){return e===t}function createConnect(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.connectHOC,r=void 0===t?_connectAdvanced2.default:t,o=e.mapStateToPropsFactories,a=void 0===o?_mapStateToProps2.default:o,n=e.mapDispatchToPropsFactories,p=void 0===n?_mapDispatchToProps2.default:n,s=e.mergePropsFactories,u=void 0===s?_mergeProps2.default:s,c=e.selectorFactory,l=void 0===c?_selectorFactory2.default:c;return function(e,t,o){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},s=n.pure,c=void 0===s||s,i=n.areStatesEqual,d=void 0===i?strictEqual:i,_=n.areOwnPropsEqual,P=void 0===_?_shallowEqual2.default:_,f=n.areStatePropsEqual,q=void 0===f?_shallowEqual2.default:f,m=n.areMergedPropsEqual,h=void 0===m?_shallowEqual2.default:m,v=_objectWithoutProperties(n,["pure","areStatesEqual","areOwnPropsEqual","areStatePropsEqual","areMergedPropsEqual"]),E=match(e,a,"mapStateToProps"),g=match(t,p,"mapDispatchToProps"),w=match(o,u,"mergeProps");return r(l,_extends({methodName:"connect",getDisplayName:function(e){return"Connect("+e+")"},shouldHandleStateChanges:Boolean(e),initMapStateToProps:E,initMapDispatchToProps:g,initMergeProps:w,pure:c,areStatesEqual:d,areOwnPropsEqual:P,areStatePropsEqual:q,areMergedPropsEqual:h},v))}}exports.__esModule=!0;var _extends=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e};exports.createConnect=createConnect;var _connectAdvanced=require("../components/connectAdvanced"),_connectAdvanced2=_interopRequireDefault(_connectAdvanced),_shallowEqual=require("../utils/shallowEqual"),_shallowEqual2=_interopRequireDefault(_shallowEqual),_mapDispatchToProps=require("./mapDispatchToProps"),_mapDispatchToProps2=_interopRequireDefault(_mapDispatchToProps),_mapStateToProps=require("./mapStateToProps"),_mapStateToProps2=_interopRequireDefault(_mapStateToProps),_mergeProps=require("./mergeProps"),_mergeProps2=_interopRequireDefault(_mergeProps),_selectorFactory=require("./selectorFactory"),_selectorFactory2=_interopRequireDefault(_selectorFactory);exports.default=createConnect();
- return chainedCheckType;
- }
+},{"../components/connectAdvanced":38,"../utils/shallowEqual":48,"./mapDispatchToProps":40,"./mapStateToProps":41,"./mergeProps":42,"./selectorFactory":43}],40:[function(require,module,exports){
+"use strict";function whenMapDispatchToPropsIsFunction(p){return"function"==typeof p?(0,_wrapMapToProps.wrapMapToPropsFunc)(p,"mapDispatchToProps"):void 0}function whenMapDispatchToPropsIsMissing(p){return p?void 0:(0,_wrapMapToProps.wrapMapToPropsConstant)(function(p){return{dispatch:p}})}function whenMapDispatchToPropsIsObject(p){return p&&"object"==typeof p?(0,_wrapMapToProps.wrapMapToPropsConstant)(function(o){return(0,_redux.bindActionCreators)(p,o)}):void 0}exports.__esModule=!0,exports.whenMapDispatchToPropsIsFunction=whenMapDispatchToPropsIsFunction,exports.whenMapDispatchToPropsIsMissing=whenMapDispatchToPropsIsMissing,exports.whenMapDispatchToPropsIsObject=whenMapDispatchToPropsIsObject;var _redux=require("redux"),_wrapMapToProps=require("./wrapMapToProps");exports.default=[whenMapDispatchToPropsIsFunction,whenMapDispatchToPropsIsMissing,whenMapDispatchToPropsIsObject];
- function createPrimitiveTypeChecker(expectedType) {
- function validate(props, propName, componentName, location, propFullName, secret) {
- var propValue = props[propName];
- var propType = getPropType(propValue);
- if (propType !== expectedType) {
- // `propValue` being instance of, say, date/regexp, pass the 'object'
- // check, but we can offer a more precise error message here rather than
- // 'of type `object`'.
- var preciseType = getPreciseType(propValue);
+},{"./wrapMapToProps":45,"redux":"redux"}],41:[function(require,module,exports){
+"use strict";function whenMapStateToPropsIsFunction(o){return"function"==typeof o?(0,_wrapMapToProps.wrapMapToPropsFunc)(o,"mapStateToProps"):void 0}function whenMapStateToPropsIsMissing(o){return o?void 0:(0,_wrapMapToProps.wrapMapToPropsConstant)(function(){return{}})}exports.__esModule=!0,exports.whenMapStateToPropsIsFunction=whenMapStateToPropsIsFunction,exports.whenMapStateToPropsIsMissing=whenMapStateToPropsIsMissing;var _wrapMapToProps=require("./wrapMapToProps");exports.default=[whenMapStateToPropsIsFunction,whenMapStateToPropsIsMissing];
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'));
- }
- return null;
- }
- return createChainableTypeChecker(validate);
- }
+},{"./wrapMapToProps":45}],42:[function(require,module,exports){
+"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function defaultMergeProps(e,r,t){return _extends({},t,e,r)}function wrapMergePropsFunc(e){return function(r,t){var n=(t.displayName,t.pure),o=t.areMergedPropsEqual,u=!1,s=void 0;return function(r,t,i){var p=e(r,t,i);return u?n&&o(p,s)||(s=p):(u=!0,s=p),s}}}function whenMergePropsIsFunction(e){return"function"==typeof e?wrapMergePropsFunc(e):void 0}function whenMergePropsIsOmitted(e){return e?void 0:function(){return defaultMergeProps}}exports.__esModule=!0;var _extends=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e};exports.defaultMergeProps=defaultMergeProps,exports.wrapMergePropsFunc=wrapMergePropsFunc,exports.whenMergePropsIsFunction=whenMergePropsIsFunction,exports.whenMergePropsIsOmitted=whenMergePropsIsOmitted;var _verifyPlainObject=require("../utils/verifyPlainObject"),_verifyPlainObject2=_interopRequireDefault(_verifyPlainObject);exports.default=[whenMergePropsIsFunction,whenMergePropsIsOmitted];
- function createAnyTypeChecker() {
- return createChainableTypeChecker(emptyFunction.thatReturnsNull);
- }
+},{"../utils/verifyPlainObject":49}],43:[function(require,module,exports){
+"use strict";function _interopRequireDefault(r){return r&&r.__esModule?r:{default:r}}function _objectWithoutProperties(r,e){var t={};for(var o in r)e.indexOf(o)>=0||Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o]);return t}function impureFinalPropsSelectorFactory(r,e,t,o){return function(n,i){return t(r(n,i),e(o,i),i)}}function pureFinalPropsSelectorFactory(r,e,t,o,n){function i(n,i){return F=n,S=i,d=r(F,S),v=e(o,S),y=t(d,v,S),P=!0,y}function u(){return d=r(F,S),e.dependsOnOwnProps&&(v=e(o,S)),y=t(d,v,S)}function p(){return r.dependsOnOwnProps&&(d=r(F,S)),e.dependsOnOwnProps&&(v=e(o,S)),y=t(d,v,S)}function a(){var e=r(F,S),o=!f(e,d);return d=e,o&&(y=t(d,v,S)),y}function s(r,e){var t=!l(e,S),o=!c(r,F);return F=r,S=e,t&&o?u():t?p():o?a():y}var c=n.areStatesEqual,l=n.areOwnPropsEqual,f=n.areStatePropsEqual,P=!1,F=void 0,S=void 0,d=void 0,v=void 0,y=void 0;return function(r,e){return P?s(r,e):i(r,e)}}function finalPropsSelectorFactory(r,e){var t=e.initMapStateToProps,o=e.initMapDispatchToProps,n=e.initMergeProps,i=_objectWithoutProperties(e,["initMapStateToProps","initMapDispatchToProps","initMergeProps"]),u=t(r,i),p=o(r,i),a=n(r,i),s=i.pure?pureFinalPropsSelectorFactory:impureFinalPropsSelectorFactory;return s(u,p,a,r,i)}exports.__esModule=!0,exports.impureFinalPropsSelectorFactory=impureFinalPropsSelectorFactory,exports.pureFinalPropsSelectorFactory=pureFinalPropsSelectorFactory,exports.default=finalPropsSelectorFactory;var _verifySubselectors=require("./verifySubselectors"),_verifySubselectors2=_interopRequireDefault(_verifySubselectors);
- function createArrayOfTypeChecker(typeChecker) {
- function validate(props, propName, componentName, location, propFullName) {
- if (typeof typeChecker !== 'function') {
- return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
- }
- var propValue = props[propName];
- if (!Array.isArray(propValue)) {
- var propType = getPropType(propValue);
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
- }
- for (var i = 0; i < propValue.length; i++) {
- var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret);
- if (error instanceof Error) {
- return error;
- }
- }
- return null;
- }
- return createChainableTypeChecker(validate);
- }
+},{"./verifySubselectors":44}],44:[function(require,module,exports){
+"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function verify(e,r,o){if(!e)throw new Error("Unexpected value for "+r+" in "+o+".");"mapStateToProps"!==r&&"mapDispatchToProps"!==r||e.hasOwnProperty("dependsOnOwnProps")||(0,_warning2.default)("The selector for "+r+" of "+o+" did not specify a value for dependsOnOwnProps.")}function verifySubselectors(e,r,o,n){verify(e,"mapStateToProps",n),verify(r,"mapDispatchToProps",n),verify(o,"mergeProps",n)}exports.__esModule=!0,exports.default=verifySubselectors;var _warning=require("../utils/warning"),_warning2=_interopRequireDefault(_warning);
- function createElementTypeChecker() {
- function validate(props, propName, componentName, location, propFullName) {
- var propValue = props[propName];
- if (!isValidElement(propValue)) {
- var propType = getPropType(propValue);
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));
- }
- return null;
- }
- return createChainableTypeChecker(validate);
- }
+},{"../utils/warning":50}],45:[function(require,module,exports){
+"use strict";function _interopRequireDefault(n){return n&&n.__esModule?n:{default:n}}function wrapMapToPropsConstant(n){return function(e,r){function p(){return o}var o=n(e,r);return p.dependsOnOwnProps=!1,p}}function getDependsOnOwnProps(n){return null!==n.dependsOnOwnProps&&void 0!==n.dependsOnOwnProps?Boolean(n.dependsOnOwnProps):1!==n.length}function wrapMapToPropsFunc(n,e){return function(e,r){var p=(r.displayName,function(n,e){return p.dependsOnOwnProps?p.mapToProps(n,e):p.mapToProps(n)});return p.dependsOnOwnProps=!0,p.mapToProps=function(e,r){p.mapToProps=n,p.dependsOnOwnProps=getDependsOnOwnProps(n);var o=p(e,r);return"function"==typeof o&&(p.mapToProps=o,p.dependsOnOwnProps=getDependsOnOwnProps(o),o=p(e,r)),o},p}}exports.__esModule=!0,exports.wrapMapToPropsConstant=wrapMapToPropsConstant,exports.getDependsOnOwnProps=getDependsOnOwnProps,exports.wrapMapToPropsFunc=wrapMapToPropsFunc;var _verifyPlainObject=require("../utils/verifyPlainObject"),_verifyPlainObject2=_interopRequireDefault(_verifyPlainObject);
- function createInstanceTypeChecker(expectedClass) {
- function validate(props, propName, componentName, location, propFullName) {
- if (!(props[propName] instanceof expectedClass)) {
- var expectedClassName = expectedClass.name || ANONYMOUS;
- var actualClassName = getClassName(props[propName]);
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
- }
- return null;
- }
- return createChainableTypeChecker(validate);
- }
+},{"../utils/verifyPlainObject":49}],46:[function(require,module,exports){
+"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}exports.__esModule=!0,exports.storeShape=exports.subscriptionShape=void 0;var _propTypes=require("prop-types"),_propTypes2=_interopRequireDefault(_propTypes),subscriptionShape=exports.subscriptionShape=_propTypes2.default.shape({trySubscribe:_propTypes2.default.func.isRequired,tryUnsubscribe:_propTypes2.default.func.isRequired,notifyNestedSubs:_propTypes2.default.func.isRequired,isSubscribed:_propTypes2.default.func.isRequired}),storeShape=exports.storeShape=_propTypes2.default.shape({subscribe:_propTypes2.default.func.isRequired,dispatch:_propTypes2.default.func.isRequired,getState:_propTypes2.default.func.isRequired});
- function createEnumTypeChecker(expectedValues) {
- if (!Array.isArray(expectedValues)) {
- process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid argument supplied to oneOf, expected an instance of array.') : void 0;
- return emptyFunction.thatReturnsNull;
- }
-
- function validate(props, propName, componentName, location, propFullName) {
- var propValue = props[propName];
- for (var i = 0; i < expectedValues.length; i++) {
- if (is(propValue, expectedValues[i])) {
- return null;
- }
- }
-
- var valuesString = JSON.stringify(expectedValues);
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
- }
- return createChainableTypeChecker(validate);
- }
-
- function createObjectOfTypeChecker(typeChecker) {
- function validate(props, propName, componentName, location, propFullName) {
- if (typeof typeChecker !== 'function') {
- return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
- }
- var propValue = props[propName];
- var propType = getPropType(propValue);
- if (propType !== 'object') {
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
- }
- for (var key in propValue) {
- if (propValue.hasOwnProperty(key)) {
- var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
- if (error instanceof Error) {
- return error;
- }
- }
- }
- return null;
- }
- return createChainableTypeChecker(validate);
- }
-
- function createUnionTypeChecker(arrayOfTypeCheckers) {
- if (!Array.isArray(arrayOfTypeCheckers)) {
- process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid argument supplied to oneOfType, expected an instance of array.') : void 0;
- return emptyFunction.thatReturnsNull;
- }
-
- function validate(props, propName, componentName, location, propFullName) {
- for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
- var checker = arrayOfTypeCheckers[i];
- if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret) == null) {
- return null;
- }
- }
-
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.'));
- }
- return createChainableTypeChecker(validate);
- }
-
- function createNodeChecker() {
- function validate(props, propName, componentName, location, propFullName) {
- if (!isNode(props[propName])) {
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
- }
- return null;
- }
- return createChainableTypeChecker(validate);
- }
-
- function createShapeTypeChecker(shapeTypes) {
- function validate(props, propName, componentName, location, propFullName) {
- var propValue = props[propName];
- var propType = getPropType(propValue);
- if (propType !== 'object') {
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
- }
- for (var key in shapeTypes) {
- var checker = shapeTypes[key];
- if (!checker) {
- continue;
- }
- var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
- if (error) {
- return error;
- }
- }
- return null;
- }
- return createChainableTypeChecker(validate);
- }
-
- function isNode(propValue) {
- switch (typeof propValue) {
- case 'number':
- case 'string':
- case 'undefined':
- return true;
- case 'boolean':
- return !propValue;
- case 'object':
- if (Array.isArray(propValue)) {
- return propValue.every(isNode);
- }
- if (propValue === null || isValidElement(propValue)) {
- return true;
- }
-
- var iteratorFn = getIteratorFn(propValue);
- if (iteratorFn) {
- var iterator = iteratorFn.call(propValue);
- var step;
- if (iteratorFn !== propValue.entries) {
- while (!(step = iterator.next()).done) {
- if (!isNode(step.value)) {
- return false;
- }
- }
- } else {
- // Iterator will provide entry [k,v] tuples rather than values.
- while (!(step = iterator.next()).done) {
- var entry = step.value;
- if (entry) {
- if (!isNode(entry[1])) {
- return false;
- }
- }
- }
- }
- } else {
- return false;
- }
-
- return true;
- default:
- return false;
- }
- }
-
- function isSymbol(propType, propValue) {
- // Native Symbol.
- if (propType === 'symbol') {
- return true;
- }
-
- // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'
- if (propValue['@@toStringTag'] === 'Symbol') {
- return true;
- }
-
- // Fallback for non-spec compliant Symbols which are polyfilled.
- if (typeof Symbol === 'function' && propValue instanceof Symbol) {
- return true;
- }
-
- return false;
- }
-
- // Equivalent of `typeof` but with special handling for array and regexp.
- function getPropType(propValue) {
- var propType = typeof propValue;
- if (Array.isArray(propValue)) {
- return 'array';
- }
- if (propValue instanceof RegExp) {
- // Old webkits (at least until Android 4.0) return 'function' rather than
- // 'object' for typeof a RegExp. We'll normalize this here so that /bla/
- // passes PropTypes.object.
- return 'object';
- }
- if (isSymbol(propType, propValue)) {
- return 'symbol';
- }
- return propType;
- }
-
- // This handles more types than `getPropType`. Only used for error messages.
- // See `createPrimitiveTypeChecker`.
- function getPreciseType(propValue) {
- var propType = getPropType(propValue);
- if (propType === 'object') {
- if (propValue instanceof Date) {
- return 'date';
- } else if (propValue instanceof RegExp) {
- return 'regexp';
- }
- }
- return propType;
- }
-
- // Returns class name of the object, if any.
- function getClassName(propValue) {
- if (!propValue.constructor || !propValue.constructor.name) {
- return ANONYMOUS;
- }
- return propValue.constructor.name;
- }
-
- ReactPropTypes.checkPropTypes = checkPropTypes;
- ReactPropTypes.PropTypes = ReactPropTypes;
-
- return ReactPropTypes;
-};
-
-}).call(this,require('_process'))
-
-},{"./checkPropTypes":44,"./lib/ReactPropTypesSecret":47,"_process":43,"fbjs/lib/emptyFunction":10,"fbjs/lib/invariant":18,"fbjs/lib/warning":25}],47:[function(require,module,exports){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- */
-
-'use strict';
-
-var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
-
-module.exports = ReactPropTypesSecret;
+},{"prop-types":"prop-types"}],47:[function(require,module,exports){
+"use strict";function _classCallCheck(t,s){if(!(t instanceof s))throw new TypeError("Cannot call a class as a function")}function createListenerCollection(){var t=[],s=[];return{clear:function(){s=CLEARED,t=CLEARED},notify:function(){for(var e=t=s,n=0;n<e.length;n++)e[n]()},subscribe:function(e){var n=!0;return s===t&&(s=t.slice()),s.push(e),function(){n&&t!==CLEARED&&(n=!1,s===t&&(s=t.slice()),s.splice(s.indexOf(e),1))}}}}exports.__esModule=!0;var CLEARED=null,nullListeners={notify:function(){}},Subscription=function(){function t(s,e,n){_classCallCheck(this,t),this.store=s,this.parentSub=e,this.onStateChange=n,this.unsubscribe=null,this.listeners=nullListeners}return t.prototype.addNestedSub=function(t){return this.trySubscribe(),this.listeners.subscribe(t)},t.prototype.notifyNestedSubs=function(){this.listeners.notify()},t.prototype.isSubscribed=function(){return Boolean(this.unsubscribe)},t.prototype.trySubscribe=function(){this.unsubscribe||(this.unsubscribe=this.parentSub?this.parentSub.addNestedSub(this.onStateChange):this.store.subscribe(this.onStateChange),this.listeners=createListenerCollection())},t.prototype.tryUnsubscribe=function(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=null,this.listeners.clear(),this.listeners=nullListeners)},t}();exports.default=Subscription;
},{}],48:[function(require,module,exports){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
+"use strict";function is(e,t){return e===t?0!==e||0!==t||1/e===1/t:e!==e&&t!==t}function shallowEqual(e,t){if(is(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(var l=0;l<r.length;l++)if(!hasOwn.call(t,r[l])||!is(e[r[l]],t[r[l]]))return!1;return!0}exports.__esModule=!0,exports.default=shallowEqual;var hasOwn=Object.prototype.hasOwnProperty;
-'use strict';
-
-var ARIADOMPropertyConfig = {
- Properties: {
- // Global States and Properties
- 'aria-current': 0, // state
- 'aria-details': 0,
- 'aria-disabled': 0, // state
- 'aria-hidden': 0, // state
- 'aria-invalid': 0, // state
- 'aria-keyshortcuts': 0,
- 'aria-label': 0,
- 'aria-roledescription': 0,
- // Widget Attributes
- 'aria-autocomplete': 0,
- 'aria-checked': 0,
- 'aria-expanded': 0,
- 'aria-haspopup': 0,
- 'aria-level': 0,
- 'aria-modal': 0,
- 'aria-multiline': 0,
- 'aria-multiselectable': 0,
- 'aria-orientation': 0,
- 'aria-placeholder': 0,
- 'aria-pressed': 0,
- 'aria-readonly': 0,
- 'aria-required': 0,
- 'aria-selected': 0,
- 'aria-sort': 0,
- 'aria-valuemax': 0,
- 'aria-valuemin': 0,
- 'aria-valuenow': 0,
- 'aria-valuetext': 0,
- // Live Region Attributes
- 'aria-atomic': 0,
- 'aria-busy': 0,
- 'aria-live': 0,
- 'aria-relevant': 0,
- // Drag-and-Drop Attributes
- 'aria-dropeffect': 0,
- 'aria-grabbed': 0,
- // Relationship Attributes
- 'aria-activedescendant': 0,
- 'aria-colcount': 0,
- 'aria-colindex': 0,
- 'aria-colspan': 0,
- 'aria-controls': 0,
- 'aria-describedby': 0,
- 'aria-errormessage': 0,
- 'aria-flowto': 0,
- 'aria-labelledby': 0,
- 'aria-owns': 0,
- 'aria-posinset': 0,
- 'aria-rowcount': 0,
- 'aria-rowindex': 0,
- 'aria-rowspan': 0,
- 'aria-setsize': 0
- },
- DOMAttributeNames: {},
- DOMPropertyNames: {}
-};
-
-module.exports = ARIADOMPropertyConfig;
},{}],49:[function(require,module,exports){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-'use strict';
-
-var ReactDOMComponentTree = require('./ReactDOMComponentTree');
-
-var focusNode = require('fbjs/lib/focusNode');
-
-var AutoFocusUtils = {
- focusDOMComponent: function () {
- focusNode(ReactDOMComponentTree.getNodeFromInstance(this));
- }
-};
-
-module.exports = AutoFocusUtils;
-},{"./ReactDOMComponentTree":80,"fbjs/lib/focusNode":12}],50:[function(require,module,exports){
-/**
- * Copyright 2013-present Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-'use strict';
-
-var EventPropagators = require('./EventPropagators');
-var ExecutionEnvironment = require('fbjs/lib/ExecutionEnvironment');
-var FallbackCompositionState = require('./FallbackCompositionState');
-var SyntheticCompositionEvent = require('./SyntheticCompositionEvent');
-var SyntheticInputEvent = require('./SyntheticInputEvent');
-
-var END_KEYCODES = [9, 13, 27, 32]; // Tab, Return, Esc, Space
-var START_KEYCODE = 229;
-
-var canUseCompositionEvent = ExecutionEnvironment.canUseDOM && 'CompositionEvent' in window;
-
-var documentMode = null;
-if (ExecutionEnvironment.canUseDOM && 'documentMode' in document) {
- documentMode = document.documentMode;
-}
-
-// Webkit offers a very useful `textInput` event that can be used to
-// directly represent `beforeInput`. The IE `textinput` event is not as
-// useful, so we don't use it.
-var canUseTextInputEvent = ExecutionEnvironment.canUseDOM && 'TextEvent' in window && !documentMode && !isPresto();
-
-// In IE9+, we have access to composition events, but the data supplied
-// by the native compositionend event may be incorrect. Japanese ideographic
-// spaces, for instance (\u3000) are not recorded correctly.
-var useFallbackCompositionData = ExecutionEnvironment.canUseDOM && (!canUseCompositionEvent || documentMode && documentMode > 8 && documentMode <= 11);
-
-/**
- * Opera <= 12 includes TextEvent in window, but does not fire
- * text input events. Rely on keypress instead.
- */
-function isPresto() {
- var opera = window.opera;
- return typeof opera === 'object' && typeof opera.version === 'function' && parseInt(opera.version(), 10) <= 12;
-}
-
-var SPACEBAR_CODE = 32;
-var SPACEBAR_CHAR = String.fromCharCode(SPACEBAR_CODE);
-
-// Events and their corresponding property names.
-var eventTypes = {
- beforeInput: {
- phasedRegistrationNames: {
- bubbled: 'onBeforeInput',
- captured: 'onBeforeInputCapture'
- },
- dependencies: ['topCompositionEnd', 'topKeyPress', 'topTextInput', 'topPaste']
- },
- compositionEnd: {
- phasedRegistrationNames: {
- bubbled: 'onCompositionEnd',
- captured: 'onCompositionEndCapture'
- },
- dependencies: ['topBlur', 'topCompositionEnd', 'topKeyDown', 'topKeyPress', 'topKeyUp', 'topMouseDown']
- },
- compositionStart: {
- phasedRegistrationNames: {
- bubbled: 'onCompositionStart',
- captured: 'onCompositionStartCapture'
- },
- dependencies: ['topBlur', 'topCompositionStart', 'topKeyDown', 'topKeyPress', 'topKeyUp', 'topMouseDown']
- },
- compositionUpdate: {
- phasedRegistrationNames: {
- bubbled: 'onCompositionUpdate',
- captured: 'onCompositionUpdateCapture'
- },
- dependencies: ['topBlur', 'topCompositionUpdate', 'topKeyDown', 'topKeyPress', 'topKeyUp', 'topMouseDown']
- }
-};
-
-// Track whether we've ever handled a keypress on the space key.
-var hasSpaceKeypress = false;
-
-/**
- * Return whether a native keypress event is assumed to be a command.
- * This is required because Firefox fires `keypress` events for key commands
- * (cut, copy, select-all, etc.) even though no character is inserted.
- */
-function isKeypressCommand(nativeEvent) {
- return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&
- // ctrlKey && altKey is equivalent to AltGr, and is not a command.
- !(nativeEvent.ctrlKey && nativeEvent.altKey);
-}
-
-/**
- * Translate native top level events into event types.
- *
- * @param {string} topLevelType
- * @return {object}
- */
-function getCompositionEventType(topLevelType) {
- switch (topLevelType) {
- case 'topCompositionStart':
- return eventTypes.compositionStart;
- case 'topCompositionEnd':
- return eventTypes.compositionEnd;
- case 'topCompositionUpdate':
- return eventTypes.compositionUpdate;
- }
-}
-
-/**
- * Does our fallback best-guess model think this event signifies that
- * composition has begun?
- *
- * @param {string} topLevelType
- * @param {object} nativeEvent
- * @return {boolean}
- */
-function isFallbackCompositionStart(topLevelType, nativeEvent) {
- return topLevelType === 'topKeyDown' && nativeEvent.keyCode === START_KEYCODE;
-}
-
-/**
- * Does our fallback mode think that this event is the end of composition?
- *
- * @param {string} topLevelType
- * @param {object} nativeEvent
- * @return {boolean}
- */
-function isFallbackCompositionEnd(topLevelType, nativeEvent) {
- switch (topLevelType) {
- case 'topKeyUp':
- // Command keys insert or clear IME input.
- return END_KEYCODES.indexOf(nativeEvent.keyCode) !== -1;
- case 'topKeyDown':
- // Expect IME keyCode on each keydown. If we get any other
- // code we must have exited earlier.
- return nativeEvent.keyCode !== START_KEYCODE;
- case 'topKeyPress':
- case 'topMouseDown':
- case 'topBlur':
- // Events are not possible without cancelling IME.
- return true;
- default:
- return false;
- }
-}
-
-/**
- * Google Input Tools provides composition data via a CustomEvent,
- * with the `data` property populated in the `detail` object. If this
- * is available on the event object, use it. If not, this is a plain
- * composition event and we have nothing special to extract.
- *
- * @param {object} nativeEvent
- * @return {?string}
- */
-function getDataFromCustomEvent(nativeEvent) {
- var detail = nativeEvent.detail;
- if (typeof detail === 'object' && 'data' in detail) {
- return detail.data;
- }
- return null;
-}
-
-// Track the current IME composition fallback object, if any.
-var currentComposition = null;
-
-/**
- * @return {?object} A SyntheticCompositionEvent.
- */
-function extractCompositionEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget) {
- var eventType;
- var fallbackData;
-
- if (canUseCompositionEvent) {
- eventType = getCompositionEventType(topLevelType);
- } else if (!currentComposition) {
- if (isFallbackCompositionStart(topLevelType, nativeEvent)) {
- eventType = eventTypes.compositionStart;
- }
- } else if (isFallbackCompositionEnd(topLevelType, nativeEvent)) {
- eventType = eventTypes.compositionEnd;
- }
-
- if (!eventType) {
- return null;
- }
-
- if (useFallbackCompositionData) {
- // The current composition is stored statically and must not be
- // overwritten while composition continues.
- if (!currentComposition && eventType === eventTypes.compositionStart) {
- currentComposition = FallbackCompositionState.getPooled(nativeEventTarget);
- } else if (eventType === eventTypes.compositionEnd) {
- if (currentComposition) {
- fallbackData = currentComposition.getData();
- }
- }
- }
-
- var event = SyntheticCompositionEvent.getPooled(eventType, targetInst, nativeEvent, nativeEventTarget);
-
- if (fallbackData) {
- // Inject data generated from fallback path into the synthetic event.
- // This matches the property of native CompositionEventInterface.
- event.data = fallbackData;
- } else {
- var customData = getDataFromCustomEvent(nativeEvent);
- if (customData !== null) {
- event.data = customData;
- }
- }
-
- EventPropagators.accumulateTwoPhaseDispatches(event);
- return event;
-}
-
-/**
- * @param {string} topLevelType Record from `EventConstants`.
- * @param {object} nativeEvent Native browser event.
- * @return {?string} The string corresponding to this `beforeInput` event.
- */
-function getNativeBeforeInputChars(topLevelType, nativeEvent) {
- switch (topLevelType) {
- case 'topCompositionEnd':
- return getDataFromCustomEvent(nativeEvent);
- case 'topKeyPress':
- /**
- * If native `textInput` events are available, our goal is to make
- * use of them. However, there is a special case: the spacebar key.
- * In Webkit, preventing default on a spacebar `textInput` event
- * cancels character insertion, but it *also* causes the browser
- * to fall back to its default spacebar behavior of scrolling the
- * page.
- *
- * Tracking at:
- * https://code.google.com/p/chromium/issues/detail?id=355103
- *
- * To avoid this issue, use the keypress event as if no `textInput`
- * event is available.
- */
- var which = nativeEvent.which;
- if (which !== SPACEBAR_CODE) {
- return null;
- }
-
- hasSpaceKeypress = true;
- return SPACEBAR_CHAR;
-
- case 'topTextInput':
- // Record the characters to be added to the DOM.
- var chars = nativeEvent.data;
-
- // If it's a spacebar character, assume that we have already handled
- // it at the keypress level and bail immediately. Android Chrome
- // doesn't give us keycodes, so we need to blacklist it.
- if (chars === SPACEBAR_CHAR && hasSpaceKeypress) {
- return null;
- }
-
- return chars;
-
- default:
- // For other native event types, do nothing.
- return null;
- }
-}
-
-/**
- * For browsers that do not provide the `textInput` event, extract the
- * appropriate string to use for SyntheticInputEvent.
- *
- * @param {string} topLevelType Record from `EventConstants`.
- * @param {object} nativeEvent Native browser event.
- * @return {?string} The fallback string for this `beforeInput` event.
- */
-function getFallbackBeforeInputChars(topLevelType, nativeEvent) {
- // If we are currently composing (IME) and using a fallback to do so,
- // try to extract the composed characters from the fallback object.
- // If composition event is available, we extract a string only at
- // compositionevent, otherwise extract it at fallback events.
- if (currentComposition) {
- if (topLevelType === 'topCompositionEnd' || !canUseCompositionEvent && isFallbackCompositionEnd(topLevelType, nativeEvent)) {
- var chars = currentComposition.getData();
- FallbackCompositionState.release(currentComposition);
- currentComposition = null;
- return chars;
- }
- return null;
- }
-
- switch (topLevelType) {
- case 'topPaste':
- // If a paste event occurs after a keypress, throw out the input
- // chars. Paste events should not lead to BeforeInput events.
- return null;
- case 'topKeyPress':
- /**
- * As of v27, Firefox may fire keypress events even when no character
- * will be inserted. A few possibilities:
- *
- * - `which` is `0`. Arrow keys, Esc key, etc.
- *
- * - `which` is the pressed key code, but no char is available.
- * Ex: 'AltGr + d` in Polish. There is no modified character for
- * this key combination and no character is inserted into the
- * document, but FF fires the keypress for char code `100` anyway.
- * No `input` event will occur.
- *
- * - `which` is the pressed key code, but a command combination is
- * being used. Ex: `Cmd+C`. No character is inserted, and no
- * `input` event will occur.
- */
- if (nativeEvent.which && !isKeypressCommand(nativeEvent)) {
- return String.fromCharCode(nativeEvent.which);
- }
- return null;
- case 'topCompositionEnd':
- return useFallbackCompositionData ? null : nativeEvent.data;
- default:
- return null;
- }
-}
-
-/**
- * Extract a SyntheticInputEvent for `beforeInput`, based on either native
- * `textInput` or fallback behavior.
- *
- * @return {?object} A SyntheticInputEvent.
- */
-function extractBeforeInputEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget) {
- var chars;
-
- if (canUseTextInputEvent) {
- chars = getNativeBeforeInputChars(topLevelType, nativeEvent);
- } else {
- chars = getFallbackBeforeInputChars(topLevelType, nativeEvent);
- }
-
- // If no characters are being inserted, no BeforeInput event should
- // be fired.
- if (!chars) {
- return null;
- }
-
- var event = SyntheticInputEvent.getPooled(eventTypes.beforeInput, targetInst, nativeEvent, nativeEventTarget);
-
- event.data = chars;
- EventPropagators.accumulateTwoPhaseDispatches(event);
- return event;
-}
-
-/**
- * Create an `onBeforeInput` event to match
- * http://www.w3.org/TR/2013/WD-DOM-Level-3-Events-20131105/#events-inputevents.
- *
- * This event plugin is based on the native `textInput` event
- * available in Chrome, Safari, Opera, and IE. This event fires after
- * `onKeyPress` and `onCompositionEnd`, but before `onInput`.
- *
- * `beforeInput` is spec'd but not implemented in any browsers, and
- * the `input` event does not provide any useful information about what has
- * actually been added, contrary to the spec. Thus, `textInput` is the best
- * available event to identify the characters that have actually been inserted
- * into the target node.
- *
- * This plugin is also responsible for emitting `composition` events, thus
- * allowing us to share composition fallback code for both `beforeInput` and
- * `composition` event types.
- */
-var BeforeInputEventPlugin = {
-
- eventTypes: eventTypes,
-
- extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
- return [extractCompositionEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget), extractBeforeInputEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget)];
- }
-};
-
-module.exports = BeforeInputEventPlugin;
-},{"./EventPropagators":66,"./FallbackCompositionState":67,"./SyntheticCompositionEvent":131,"./SyntheticInputEvent":135,"fbjs/lib/ExecutionEnvironment":4}],51:[function(require,module,exports){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-'use strict';
-
-/**
- * CSS properties which accept numbers but are not in units of "px".
- */
-
-var isUnitlessNumber = {
- animationIterationCount: true,
- borderImageOutset: true,
- borderImageSlice: true,
- borderImageWidth: true,
- boxFlex: true,
- boxFlexGroup: true,
- boxOrdinalGroup: true,
- columnCount: true,
- flex: true,
- flexGrow: true,
- flexPositive: true,
- flexShrink: true,
- flexNegative: true,
- flexOrder: true,
- gridRow: true,
- gridColumn: true,
- fontWeight: true,
- lineClamp: true,
- lineHeight: true,
- opacity: true,
- order: true,
- orphans: true,
- tabSize: true,
- widows: true,
- zIndex: true,
- zoom: true,
-
- // SVG-related properties
- fillOpacity: true,
- floodOpacity: true,
- stopOpacity: true,
- strokeDasharray: true,
- strokeDashoffset: true,
- strokeMiterlimit: true,
- strokeOpacity: true,
- strokeWidth: true
-};
-
-/**
- * @param {string} prefix vendor-specific prefix, eg: Webkit
- * @param {string} key style name, eg: transitionDuration
- * @return {string} style name prefixed with `prefix`, properly camelCased, eg:
- * WebkitTransitionDuration
- */
-function prefixKey(prefix, key) {
- return prefix + key.charAt(0).toUpperCase() + key.substring(1);
-}
-
-/**
- * Support style names that may come passed in prefixed by adding permutations
- * of vendor prefixes.
- */
-var prefixes = ['Webkit', 'ms', 'Moz', 'O'];
-
-// Using Object.keys here, or else the vanilla for-in loop makes IE8 go into an
-// infinite loop, because it iterates over the newly added props too.
-Object.keys(isUnitlessNumber).forEach(function (prop) {
- prefixes.forEach(function (prefix) {
- isUnitlessNumber[prefixKey(prefix, prop)] = isUnitlessNumber[prop];
- });
-});
-
-/**
- * Most style properties can be unset by doing .style[prop] = '' but IE8
- * doesn't like doing that with shorthand properties so for the properties that
- * IE8 breaks on, which are listed here, we instead unset each of the
- * individual properties. See http://bugs.jquery.com/ticket/12385.
- * The 4-value 'clock' properties like margin, padding, border-width seem to
- * behave without any problems. Curiously, list-style works too without any
- * special prodding.
- */
-var shorthandPropertyExpansions = {
- background: {
- backgroundAttachment: true,
- backgroundColor: true,
- backgroundImage: true,
- backgroundPositionX: true,
- backgroundPositionY: true,
- backgroundRepeat: true
- },
- backgroundPosition: {
- backgroundPositionX: true,
- backgroundPositionY: true
- },
- border: {
- borderWidth: true,
- borderStyle: true,
- borderColor: true
- },
- borderBottom: {
- borderBottomWidth: true,
- borderBottomStyle: true,
- borderBottomColor: true
- },
- borderLeft: {
- borderLeftWidth: true,
- borderLeftStyle: true,
- borderLeftColor: true
- },
- borderRight: {
- borderRightWidth: true,
- borderRightStyle: true,
- borderRightColor: true
- },
- borderTop: {
- borderTopWidth: true,
- borderTopStyle: true,
- borderTopColor: true
- },
- font: {
- fontStyle: true,
- fontVariant: true,
- fontWeight: true,
- fontSize: true,
- lineHeight: true,
- fontFamily: true
- },
- outline: {
- outlineWidth: true,
- outlineStyle: true,
- outlineColor: true
- }
-};
-
-var CSSProperty = {
- isUnitlessNumber: isUnitlessNumber,
- shorthandPropertyExpansions: shorthandPropertyExpansions
-};
-
-module.exports = CSSProperty;
-},{}],52:[function(require,module,exports){
-(function (process){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-'use strict';
-
-var CSSProperty = require('./CSSProperty');
-var ExecutionEnvironment = require('fbjs/lib/ExecutionEnvironment');
-var ReactInstrumentation = require('./ReactInstrumentation');
-
-var camelizeStyleName = require('fbjs/lib/camelizeStyleName');
-var dangerousStyleValue = require('./dangerousStyleValue');
-var hyphenateStyleName = require('fbjs/lib/hyphenateStyleName');
-var memoizeStringOnly = require('fbjs/lib/memoizeStringOnly');
-var warning = require('fbjs/lib/warning');
-
-var processStyleName = memoizeStringOnly(function (styleName) {
- return hyphenateStyleName(styleName);
-});
-
-var hasShorthandPropertyBug = false;
-var styleFloatAccessor = 'cssFloat';
-if (ExecutionEnvironment.canUseDOM) {
- var tempStyle = document.createElement('div').style;
- try {
- // IE8 throws "Invalid argument." if resetting shorthand style properties.
- tempStyle.font = '';
- } catch (e) {
- hasShorthandPropertyBug = true;
- }
- // IE8 only supports accessing cssFloat (standard) as styleFloat
- if (document.documentElement.style.cssFloat === undefined) {
- styleFloatAccessor = 'styleFloat';
- }
-}
-
-if (process.env.NODE_ENV !== 'production') {
- // 'msTransform' is correct, but the other prefixes should be capitalized
- var badVendoredStyleNamePattern = /^(?:webkit|moz|o)[A-Z]/;
-
- // style values shouldn't contain a semicolon
- var badStyleValueWithSemicolonPattern = /;\s*$/;
-
- var warnedStyleNames = {};
- var warnedStyleValues = {};
- var warnedForNaNValue = false;
-
- var warnHyphenatedStyleName = function (name, owner) {
- if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {
- return;
- }
-
- warnedStyleNames[name] = true;
- process.env.NODE_ENV !== 'production' ? warning(false, 'Unsupported style property %s. Did you mean %s?%s', name, camelizeStyleName(name), checkRenderMessage(owner)) : void 0;
- };
-
- var warnBadVendoredStyleName = function (name, owner) {
- if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {
- return;
- }
-
- warnedStyleNames[name] = true;
- process.env.NODE_ENV !== 'production' ? warning(false, 'Unsupported vendor-prefixed style property %s. Did you mean %s?%s', name, name.charAt(0).toUpperCase() + name.slice(1), checkRenderMessage(owner)) : void 0;
- };
-
- var warnStyleValueWithSemicolon = function (name, value, owner) {
- if (warnedStyleValues.hasOwnProperty(value) && warnedStyleValues[value]) {
- return;
- }
-
- warnedStyleValues[value] = true;
- process.env.NODE_ENV !== 'production' ? warning(false, 'Style property values shouldn\'t contain a semicolon.%s ' + 'Try "%s: %s" instead.', checkRenderMessage(owner), name, value.replace(badStyleValueWithSemicolonPattern, '')) : void 0;
- };
-
- var warnStyleValueIsNaN = function (name, value, owner) {
- if (warnedForNaNValue) {
- return;
- }
-
- warnedForNaNValue = true;
- process.env.NODE_ENV !== 'production' ? warning(false, '`NaN` is an invalid value for the `%s` css style property.%s', name, checkRenderMessage(owner)) : void 0;
- };
-
- var checkRenderMessage = function (owner) {
- if (owner) {
- var name = owner.getName();
- if (name) {
- return ' Check the render method of `' + name + '`.';
- }
- }
- return '';
- };
-
- /**
- * @param {string} name
- * @param {*} value
- * @param {ReactDOMComponent} component
- */
- var warnValidStyle = function (name, value, component) {
- var owner;
- if (component) {
- owner = component._currentElement._owner;
- }
- if (name.indexOf('-') > -1) {
- warnHyphenatedStyleName(name, owner);
- } else if (badVendoredStyleNamePattern.test(name)) {
- warnBadVendoredStyleName(name, owner);
- } else if (badStyleValueWithSemicolonPattern.test(value)) {
- warnStyleValueWithSemicolon(name, value, owner);
- }
-
- if (typeof value === 'number' && isNaN(value)) {
- warnStyleValueIsNaN(name, value, owner);
- }
- };
-}
-
-/**
- * Operations for dealing with CSS properties.
- */
-var CSSPropertyOperations = {
-
- /**
- * Serializes a mapping of style properties for use as inline styles:
- *
- * > createMarkupForStyles({width: '200px', height: 0})
- * "width:200px;height:0;"
- *
- * Undefined values are ignored so that declarative programming is easier.
- * The result should be HTML-escaped before insertion into the DOM.
- *
- * @param {object} styles
- * @param {ReactDOMComponent} component
- * @return {?string}
- */
- createMarkupForStyles: function (styles, component) {
- var serialized = '';
- for (var styleName in styles) {
- if (!styles.hasOwnProperty(styleName)) {
- continue;
- }
- var styleValue = styles[styleName];
- if (process.env.NODE_ENV !== 'production') {
- warnValidStyle(styleName, styleValue, component);
- }
- if (styleValue != null) {
- serialized += processStyleName(styleName) + ':';
- serialized += dangerousStyleValue(styleName, styleValue, component) + ';';
- }
- }
- return serialized || null;
- },
-
- /**
- * Sets the value for multiple styles on a node. If a value is specified as
- * '' (empty string), the corresponding style property will be unset.
- *
- * @param {DOMElement} node
- * @param {object} styles
- * @param {ReactDOMComponent} component
- */
- setValueForStyles: function (node, styles, component) {
- if (process.env.NODE_ENV !== 'production') {
- ReactInstrumentation.debugTool.onHostOperation({
- instanceID: component._debugID,
- type: 'update styles',
- payload: styles
- });
- }
-
- var style = node.style;
- for (var styleName in styles) {
- if (!styles.hasOwnProperty(styleName)) {
- continue;
- }
- if (process.env.NODE_ENV !== 'production') {
- warnValidStyle(styleName, styles[styleName], component);
- }
- var styleValue = dangerousStyleValue(styleName, styles[styleName], component);
- if (styleName === 'float' || styleName === 'cssFloat') {
- styleName = styleFloatAccessor;
- }
- if (styleValue) {
- style[styleName] = styleValue;
- } else {
- var expansion = hasShorthandPropertyBug && CSSProperty.shorthandPropertyExpansions[styleName];
- if (expansion) {
- // Shorthand property that IE8 won't like unsetting, so unset each
- // component to placate it
- for (var individualStyleName in expansion) {
- style[individualStyleName] = '';
- }
- } else {
- style[styleName] = '';
- }
- }
- }
- }
-
-};
-
-module.exports = CSSPropertyOperations;
-}).call(this,require('_process'))
-
-},{"./CSSProperty":51,"./ReactInstrumentation":109,"./dangerousStyleValue":148,"_process":43,"fbjs/lib/ExecutionEnvironment":4,"fbjs/lib/camelizeStyleName":6,"fbjs/lib/hyphenateStyleName":17,"fbjs/lib/memoizeStringOnly":21,"fbjs/lib/warning":25}],53:[function(require,module,exports){
-(function (process){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- *
- */
-
-'use strict';
-
-var _prodInvariant = require('./reactProdInvariant');
-
-function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
-var PooledClass = require('./PooledClass');
-
-var invariant = require('fbjs/lib/invariant');
-
-/**
- * A specialized pseudo-event module to help keep track of components waiting to
- * be notified when their DOM representations are available for use.
- *
- * This implements `PooledClass`, so you should never need to instantiate this.
- * Instead, use `CallbackQueue.getPooled()`.
- *
- * @class ReactMountReady
- * @implements PooledClass
- * @internal
- */
-
-var CallbackQueue = function () {
- function CallbackQueue(arg) {
- _classCallCheck(this, CallbackQueue);
-
- this._callbacks = null;
- this._contexts = null;
- this._arg = arg;
- }
-
- /**
- * Enqueues a callback to be invoked when `notifyAll` is invoked.
- *
- * @param {function} callback Invoked when `notifyAll` is invoked.
- * @param {?object} context Context to call `callback` with.
- * @internal
- */
-
-
- CallbackQueue.prototype.enqueue = function enqueue(callback, context) {
- this._callbacks = this._callbacks || [];
- this._callbacks.push(callback);
- this._contexts = this._contexts || [];
- this._contexts.push(context);
- };
-
- /**
- * Invokes all enqueued callbacks and clears the queue. This is invoked after
- * the DOM representation of a component has been created or updated.
- *
- * @internal
- */
-
-
- CallbackQueue.prototype.notifyAll = function notifyAll() {
- var callbacks = this._callbacks;
- var contexts = this._contexts;
- var arg = this._arg;
- if (callbacks && contexts) {
- !(callbacks.length === contexts.length) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Mismatched list of contexts in callback queue') : _prodInvariant('24') : void 0;
- this._callbacks = null;
- this._contexts = null;
- for (var i = 0; i < callbacks.length; i++) {
- callbacks[i].call(contexts[i], arg);
- }
- callbacks.length = 0;
- contexts.length = 0;
- }
- };
-
- CallbackQueue.prototype.checkpoint = function checkpoint() {
- return this._callbacks ? this._callbacks.length : 0;
- };
-
- CallbackQueue.prototype.rollback = function rollback(len) {
- if (this._callbacks && this._contexts) {
- this._callbacks.length = len;
- this._contexts.length = len;
- }
- };
-
- /**
- * Resets the internal queue.
- *
- * @internal
- */
-
-
- CallbackQueue.prototype.reset = function reset() {
- this._callbacks = null;
- this._contexts = null;
- };
-
- /**
- * `PooledClass` looks for this.
- */
-
-
- CallbackQueue.prototype.destructor = function destructor() {
- this.reset();
- };
-
- return CallbackQueue;
-}();
-
-module.exports = PooledClass.addPoolingTo(CallbackQueue);
-}).call(this,require('_process'))
-
-},{"./PooledClass":71,"./reactProdInvariant":167,"_process":43,"fbjs/lib/invariant":18}],54:[function(require,module,exports){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-'use strict';
-
-var EventPluginHub = require('./EventPluginHub');
-var EventPropagators = require('./EventPropagators');
-var ExecutionEnvironment = require('fbjs/lib/ExecutionEnvironment');
-var ReactDOMComponentTree = require('./ReactDOMComponentTree');
-var ReactUpdates = require('./ReactUpdates');
-var SyntheticEvent = require('./SyntheticEvent');
-
-var getEventTarget = require('./getEventTarget');
-var isEventSupported = require('./isEventSupported');
-var isTextInputElement = require('./isTextInputElement');
-
-var eventTypes = {
- change: {
- phasedRegistrationNames: {
- bubbled: 'onChange',
- captured: 'onChangeCapture'
- },
- dependencies: ['topBlur', 'topChange', 'topClick', 'topFocus', 'topInput', 'topKeyDown', 'topKeyUp', 'topSelectionChange']
- }
-};
-
-/**
- * For IE shims
- */
-var activeElement = null;
-var activeElementInst = null;
-var activeElementValue = null;
-var activeElementValueProp = null;
-
-/**
- * SECTION: handle `change` event
- */
-function shouldUseChangeEvent(elem) {
- var nodeName = elem.nodeName && elem.nodeName.toLowerCase();
- return nodeName === 'select' || nodeName === 'input' && elem.type === 'file';
-}
-
-var doesChangeEventBubble = false;
-if (ExecutionEnvironment.canUseDOM) {
- // See `handleChange` comment below
- doesChangeEventBubble = isEventSupported('change') && (!document.documentMode || document.documentMode > 8);
-}
-
-function manualDispatchChangeEvent(nativeEvent) {
- var event = SyntheticEvent.getPooled(eventTypes.change, activeElementInst, nativeEvent, getEventTarget(nativeEvent));
- EventPropagators.accumulateTwoPhaseDispatches(event);
-
- // If change and propertychange bubbled, we'd just bind to it like all the
- // other events and have it go through ReactBrowserEventEmitter. Since it
- // doesn't, we manually listen for the events and so we have to enqueue and
- // process the abstract event manually.
- //
- // Batching is necessary here in order to ensure that all event handlers run
- // before the next rerender (including event handlers attached to ancestor
- // elements instead of directly on the input). Without this, controlled
- // components don't work properly in conjunction with event bubbling because
- // the component is rerendered and the value reverted before all the event
- // handlers can run. See https://github.com/facebook/react/issues/708.
- ReactUpdates.batchedUpdates(runEventInBatch, event);
-}
-
-function runEventInBatch(event) {
- EventPluginHub.enqueueEvents(event);
- EventPluginHub.processEventQueue(false);
-}
-
-function startWatchingForChangeEventIE8(target, targetInst) {
- activeElement = target;
- activeElementInst = targetInst;
- activeElement.attachEvent('onchange', manualDispatchChangeEvent);
-}
-
-function stopWatchingForChangeEventIE8() {
- if (!activeElement) {
- return;
- }
- activeElement.detachEvent('onchange', manualDispatchChangeEvent);
- activeElement = null;
- activeElementInst = null;
-}
-
-function getTargetInstForChangeEvent(topLevelType, targetInst) {
- if (topLevelType === 'topChange') {
- return targetInst;
- }
-}
-function handleEventsForChangeEventIE8(topLevelType, target, targetInst) {
- if (topLevelType === 'topFocus') {
- // stopWatching() should be a noop here but we call it just in case we
- // missed a blur event somehow.
- stopWatchingForChangeEventIE8();
- startWatchingForChangeEventIE8(target, targetInst);
- } else if (topLevelType === 'topBlur') {
- stopWatchingForChangeEventIE8();
- }
-}
-
-/**
- * SECTION: handle `input` event
- */
-var isInputEventSupported = false;
-if (ExecutionEnvironment.canUseDOM) {
- // IE9 claims to support the input event but fails to trigger it when
- // deleting text, so we ignore its input events.
- // IE10+ fire input events to often, such when a placeholder
- // changes or when an input with a placeholder is focused.
- isInputEventSupported = isEventSupported('input') && (!document.documentMode || document.documentMode > 11);
-}
-
-/**
- * (For IE <=11) Replacement getter/setter for the `value` property that gets
- * set on the active element.
- */
-var newValueProp = {
- get: function () {
- return activeElementValueProp.get.call(this);
- },
- set: function (val) {
- // Cast to a string so we can do equality checks.
- activeElementValue = '' + val;
- activeElementValueProp.set.call(this, val);
- }
-};
-
-/**
- * (For IE <=11) Starts tracking propertychange events on the passed-in element
- * and override the value property so that we can distinguish user events from
- * value changes in JS.
- */
-function startWatchingForValueChange(target, targetInst) {
- activeElement = target;
- activeElementInst = targetInst;
- activeElementValue = target.value;
- activeElementValueProp = Object.getOwnPropertyDescriptor(target.constructor.prototype, 'value');
-
- // Not guarded in a canDefineProperty check: IE8 supports defineProperty only
- // on DOM elements
- Object.defineProperty(activeElement, 'value', newValueProp);
- if (activeElement.attachEvent) {
- activeElement.attachEvent('onpropertychange', handlePropertyChange);
- } else {
- activeElement.addEventListener('propertychange', handlePropertyChange, false);
- }
-}
-
-/**
- * (For IE <=11) Removes the event listeners from the currently-tracked element,
- * if any exists.
- */
-function stopWatchingForValueChange() {
- if (!activeElement) {
- return;
- }
-
- // delete restores the original property definition
- delete activeElement.value;
-
- if (activeElement.detachEvent) {
- activeElement.detachEvent('onpropertychange', handlePropertyChange);
- } else {
- activeElement.removeEventListener('propertychange', handlePropertyChange, false);
- }
-
- activeElement = null;
- activeElementInst = null;
- activeElementValue = null;
- activeElementValueProp = null;
-}
-
-/**
- * (For IE <=11) Handles a propertychange event, sending a `change` event if
- * the value of the active element has changed.
- */
-function handlePropertyChange(nativeEvent) {
- if (nativeEvent.propertyName !== 'value') {
- return;
- }
- var value = nativeEvent.srcElement.value;
- if (value === activeElementValue) {
- return;
- }
- activeElementValue = value;
-
- manualDispatchChangeEvent(nativeEvent);
-}
-
-/**
- * If a `change` event should be fired, returns the target's ID.
- */
-function getTargetInstForInputEvent(topLevelType, targetInst) {
- if (topLevelType === 'topInput') {
- // In modern browsers (i.e., not IE8 or IE9), the input event is exactly
- // what we want so fall through here and trigger an abstract event
- return targetInst;
- }
-}
-
-function handleEventsForInputEventIE(topLevelType, target, targetInst) {
- if (topLevelType === 'topFocus') {
- // In IE8, we can capture almost all .value changes by adding a
- // propertychange handler and looking for events with propertyName
- // equal to 'value'
- // In IE9-11, propertychange fires for most input events but is buggy and
- // doesn't fire when text is deleted, but conveniently, selectionchange
- // appears to fire in all of the remaining cases so we catch those and
- // forward the event if the value has changed
- // In either case, we don't want to call the event handler if the value
- // is changed from JS so we redefine a setter for `.value` that updates
- // our activeElementValue variable, allowing us to ignore those changes
- //
- // stopWatching() should be a noop here but we call it just in case we
- // missed a blur event somehow.
- stopWatchingForValueChange();
- startWatchingForValueChange(target, targetInst);
- } else if (topLevelType === 'topBlur') {
- stopWatchingForValueChange();
- }
-}
-
-// For IE8 and IE9.
-function getTargetInstForInputEventIE(topLevelType, targetInst) {
- if (topLevelType === 'topSelectionChange' || topLevelType === 'topKeyUp' || topLevelType === 'topKeyDown') {
- // On the selectionchange event, the target is just document which isn't
- // helpful for us so just check activeElement instead.
- //
- // 99% of the time, keydown and keyup aren't necessary. IE8 fails to fire
- // propertychange on the first input event after setting `value` from a
- // script and fires only keydown, keypress, keyup. Catching keyup usually
- // gets it and catching keydown lets us fire an event for the first
- // keystroke if user does a key repeat (it'll be a little delayed: right
- // before the second keystroke). Other input methods (e.g., paste) seem to
- // fire selectionchange normally.
- if (activeElement && activeElement.value !== activeElementValue) {
- activeElementValue = activeElement.value;
- return activeElementInst;
- }
- }
-}
+"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function verifyPlainObject(e,i,n){(0,_isPlainObject2.default)(e)||(0,_warning2.default)(n+"() in "+i+" must return a plain object. Instead received "+e+".")}exports.__esModule=!0,exports.default=verifyPlainObject;var _isPlainObject=require("lodash/isPlainObject"),_isPlainObject2=_interopRequireDefault(_isPlainObject),_warning=require("./warning"),_warning2=_interopRequireDefault(_warning);
-/**
- * SECTION: handle `click` event
- */
-function shouldUseClickEvent(elem) {
- // Use the `click` event to detect changes to checkbox and radio inputs.
- // This approach works across all browsers, whereas `change` does not fire
- // until `blur` in IE8.
- return elem.nodeName && elem.nodeName.toLowerCase() === 'input' && (elem.type === 'checkbox' || elem.type === 'radio');
-}
+},{"./warning":50,"lodash/isPlainObject":28}],50:[function(require,module,exports){
+"use strict";function warning(o){"undefined"!=typeof console&&"function"==typeof console.error&&console.error(o);try{throw new Error(o)}catch(o){}}exports.__esModule=!0,exports.default=warning;
-function getTargetInstForClickEvent(topLevelType, targetInst) {
- if (topLevelType === 'topClick') {
- return targetInst;
- }
-}
+},{}],51:[function(require,module,exports){
+"use strict";function e(e){for(var t=arguments.length-1,n="Minified React error #"+e+"; visit http://facebook.github.io/react/docs/error-decoder.html?invariant="+e,r=0;r<t;r++)n+="&args[]="+encodeURIComponent(arguments[r+1]);n+=" for the full message or use the non-minified dev environment for full errors and additional helpful warnings.";var o=new Error(n);throw o.name="Invariant Violation",o.framesToPop=1,o}function t(e,t){}function n(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||R}function r(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||R}function o(){}function u(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||R}function l(e){return void 0!==e.ref}function i(e){return void 0!==e.key}function c(e){var t={"=":"=0",":":"=2"};return"$"+(""+e).replace(/[=:]/g,function(e){return t[e]})}function a(e){return(""+e).replace(B,"$&/")}function f(e,t,n,r){if(Y.length){var o=Y.pop();return o.result=e,o.keyPrefix=t,o.func=n,o.context=r,o.count=0,o}return{result:e,keyPrefix:t,func:n,context:r,count:0}}function p(e){e.result=null,e.keyPrefix=null,e.func=null,e.context=null,e.count=0,Y.length<W&&Y.push(e)}function s(e,t,n,r){var o=typeof e;if("undefined"!==o&&"boolean"!==o||(e=null),null===e||"string"===o||"number"===o||"object"===o&&e.$$typeof===D)return n(r,e,""===t?K+d(e,0):t),1;var u,l,i=0,c=""===t?K:t+M;if(Array.isArray(e))for(var a=0;a<e.length;a++)u=e[a],l=c+d(u,a),i+=s(u,l,n,r);else{var f=T&&e[T]||e[L];if("function"==typeof f)for(var p,y=f.call(e),m=0;!(p=y.next()).done;)u=p.value,l=c+d(u,m++),i+=s(u,l,n,r);else if("object"===o){var h=""+e;C("31","[object Object]"===h?"object with keys {"+Object.keys(e).join(", ")+"}":h,"")}}return i}function y(e,t,n){return null==e?0:s(e,"",t,n)}function d(e,t){return"object"==typeof e&&null!==e&&null!=e.key?c(e.key):t.toString(36)}function m(e,t,n){var r=e.func,o=e.context;r.call(o,t,e.count++)}function h(e,t,n){if(null==e)return e;var r=f(null,null,t,n);y(e,m,r),p(r)}function v(e,t,n){var r=e.result,o=e.keyPrefix,u=e.func,l=e.context,i=u.call(l,t,e.count++);Array.isArray(i)?b(i,r,n,j.thatReturnsArgument):null!=i&&(N.isValidElement(i)&&(i=N.cloneAndReplaceKey(i,o+(!i.key||t&&t.key===i.key?"":a(i.key)+"/")+n)),r.push(i))}function b(e,t,n,r,o){var u="";null!=n&&(u=a(n)+"/");var l=f(t,u,r,o);y(e,v,l),p(l)}function _(e,t,n){if(null==e)return e;var r=[];return b(e,r,null,t,n),r}function E(e,t){return y(e,j.thatReturnsNull,null)}function S(e){var t=[];return b(e,t,null,j.thatReturnsArgument),t}function k(e){return N.isValidElement(e)||C("143"),e}var A=require("object-assign"),g=require("fbjs/lib/emptyObject");require("fbjs/lib/invariant");var j=require("fbjs/lib/emptyFunction"),C=e,P={isMounted:function(e){return!1},enqueueForceUpdate:function(e,n,r){t(e,"forceUpdate")},enqueueReplaceState:function(e,n,r,o){t(e,"replaceState")},enqueueSetState:function(e,n,r,o){t(e,"setState")}},R=P;n.prototype.isReactComponent={},n.prototype.setState=function(e,t){"object"!=typeof e&&"function"!=typeof e&&null!=e&&C("85"),this.updater.enqueueSetState(this,e,t,"setState")},n.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},o.prototype=n.prototype;var x=r.prototype=new o;x.constructor=r,A(x,n.prototype),x.isPureReactComponent=!0;var w=u.prototype=new o;w.constructor=u,A(w,n.prototype),w.unstable_isAsyncReactComponent=!0,w.render=function(){return this.props.children};var O={Component:n,PureComponent:r,AsyncComponent:u},q={current:null},U=q,$=Object.prototype.hasOwnProperty,F="function"==typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,V={key:!0,ref:!0,__self:!0,__source:!0},I=function(e,t,n,r,o,u,l){return{$$typeof:F,type:e,key:t,ref:n,props:l,_owner:u}};I.createElement=function(e,t,n){var r,o={},u=null,c=null,a=null,f=null;if(null!=t){l(t)&&(c=t.ref),i(t)&&(u=""+t.key),a=void 0===t.__self?null:t.__self,f=void 0===t.__source?null:t.__source;for(r in t)$.call(t,r)&&!V.hasOwnProperty(r)&&(o[r]=t[r])}var p=arguments.length-2;if(1===p)o.children=n;else if(p>1){for(var s=Array(p),y=0;y<p;y++)s[y]=arguments[y+2];o.children=s}if(e&&e.defaultProps){var d=e.defaultProps;for(r in d)void 0===o[r]&&(o[r]=d[r])}return I(e,u,c,a,f,U.current,o)},I.createFactory=function(e){var t=I.createElement.bind(null,e);return t.type=e,t},I.cloneAndReplaceKey=function(e,t){return I(e.type,t,e.ref,e._self,e._source,e._owner,e.props)},I.cloneElement=function(e,t,n){var r,o=A({},e.props),u=e.key,c=e.ref,a=e._self,f=e._source,p=e._owner;if(null!=t){l(t)&&(c=t.ref,p=U.current),i(t)&&(u=""+t.key);var s;e.type&&e.type.defaultProps&&(s=e.type.defaultProps);for(r in t)$.call(t,r)&&!V.hasOwnProperty(r)&&(void 0===t[r]&&void 0!==s?o[r]=s[r]:o[r]=t[r])}var y=arguments.length-2;if(1===y)o.children=n;else if(y>1){for(var d=Array(y),m=0;m<y;m++)d[m]=arguments[m+2];o.children=d}return I(e.type,u,c,a,f,p,o)},I.isValidElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===F};var N=I,T="function"==typeof Symbol&&Symbol.iterator,L="@@iterator",D="function"==typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,K=".",M=":",B=/\/+/g,W=10,Y=[],z={forEach:h,map:_,count:E,toArray:S},G=z,H="16.0.0-beta.3",J=k,Q=N.createElement,X=N.createFactory,Z=N.cloneElement,ee={Children:{map:G.map,forEach:G.forEach,count:G.count,toArray:G.toArray,only:J},Component:O.Component,PureComponent:O.PureComponent,unstable_AsyncComponent:O.AsyncComponent,createElement:Q,cloneElement:Z,isValidElement:N.isValidElement,createFactory:X,version:H,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:{ReactCurrentOwner:U}},te=ee;module.exports=te;
-/**
- * This plugin creates an `onChange` event that normalizes change events
- * across form elements. This event fires at a time when it's possible to
- * change the element's value without seeing a flicker.
- *
- * Supported elements are:
- * - input (see `isTextInputElement`)
- * - textarea
- * - select
- */
-var ChangeEventPlugin = {
+},{"fbjs/lib/emptyFunction":7,"fbjs/lib/emptyObject":8,"fbjs/lib/invariant":11,"object-assign":33}],52:[function(require,module,exports){
+"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function applyMiddleware(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(e){return function(r,n,o){var a=e(r,n,o),u=a.dispatch,p=[],i={getState:a.getState,dispatch:function(e){return u(e)}};return p=t.map(function(e){return e(i)}),u=_compose2.default.apply(void 0,p)(a.dispatch),_extends({},a,{dispatch:u})}}}exports.__esModule=!0;var _extends=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e};exports.default=applyMiddleware;var _compose=require("./compose"),_compose2=_interopRequireDefault(_compose);
- eventTypes: eventTypes,
+},{"./compose":55}],53:[function(require,module,exports){
+"use strict";function bindActionCreator(t,o){return function(){return o(t.apply(void 0,arguments))}}function bindActionCreators(t,o){if("function"==typeof t)return bindActionCreator(t,o);if("object"!=typeof t||null===t)throw new Error("bindActionCreators expected an object or a function, instead received "+(null===t?"null":typeof t)+'. Did you write "import ActionCreators from" instead of "import * as ActionCreators from"?');for(var r=Object.keys(t),n={},e=0;e<r.length;e++){var i=r[e],c=t[i];"function"==typeof c&&(n[i]=bindActionCreator(c,o))}return n}exports.__esModule=!0,exports.default=bindActionCreators;
- extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
- var targetNode = targetInst ? ReactDOMComponentTree.getNodeFromInstance(targetInst) : window;
+},{}],54:[function(require,module,exports){
+"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function getUndefinedStateErrorMessage(e,t){var n=t&&t.type,r=n&&'"'+n.toString()+'"'||"an action";return"Given action "+r+', reducer "'+e+'" returned undefined. To ignore an action, you must explicitly return the previous state.'}function getUnexpectedStateShapeWarningMessage(e,t,n,r){var i=Object.keys(t),a=n&&n.type===_createStore.ActionTypes.INIT?"preloadedState argument passed to createStore":"previous state received by the reducer";if(0===i.length)return"Store does not have a valid reducer. Make sure the argument passed to combineReducers is an object whose values are reducers.";if(!(0,_isPlainObject2.default)(e))return"The "+a+' has unexpected type of "'+{}.toString.call(e).match(/\s([a-z|A-Z]+)/)[1]+'". Expected argument to be an object with the following '+('keys: "'+i.join('", "')+'"');var o=Object.keys(e).filter(function(e){return!t.hasOwnProperty(e)&&!r[e]});return o.forEach(function(e){r[e]=!0}),o.length>0?"Unexpected "+(o.length>1?"keys":"key")+" "+('"'+o.join('", "')+'" found in '+a+". ")+"Expected to find one of the known reducer keys instead: "+('"'+i.join('", "')+'". Unexpected keys will be ignored.'):void 0}function assertReducerSanity(e){Object.keys(e).forEach(function(t){var n=e[t],r=n(void 0,{type:_createStore.ActionTypes.INIT});if("undefined"==typeof r)throw new Error('Reducer "'+t+'" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined.');var i="@@redux/PROBE_UNKNOWN_ACTION_"+Math.random().toString(36).substring(7).split("").join(".");if("undefined"==typeof n(void 0,{type:i}))throw new Error('Reducer "'+t+'" returned undefined when probed with a random type. '+("Don't try to handle "+_createStore.ActionTypes.INIT+' or other actions in "redux/*" ')+"namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined.")})}function combineReducers(e){for(var t=Object.keys(e),n={},r=0;r<t.length;r++){var i=t[r];"function"==typeof e[i]&&(n[i]=e[i])}var a,o=Object.keys(n);try{assertReducerSanity(n)}catch(e){a=e}return function(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],t=arguments[1];if(a)throw a;for(var r=!1,i={},u=0;u<o.length;u++){var s=o[u],d=n[s],c=e[s],f=d(c,t);if("undefined"==typeof f){var l=getUndefinedStateErrorMessage(s,t);throw new Error(l)}i[s]=f,r=r||f!==c}return r?i:e}}exports.__esModule=!0,exports.default=combineReducers;var _createStore=require("./createStore"),_isPlainObject=require("lodash/isPlainObject"),_isPlainObject2=_interopRequireDefault(_isPlainObject),_warning=require("./utils/warning"),_warning2=_interopRequireDefault(_warning);
- var getTargetInstFunc, handleEventFunc;
- if (shouldUseChangeEvent(targetNode)) {
- if (doesChangeEventBubble) {
- getTargetInstFunc = getTargetInstForChangeEvent;
- } else {
- handleEventFunc = handleEventsForChangeEventIE8;
- }
- } else if (isTextInputElement(targetNode)) {
- if (isInputEventSupported) {
- getTargetInstFunc = getTargetInstForInputEvent;
- } else {
- getTargetInstFunc = getTargetInstForInputEventIE;
- handleEventFunc = handleEventsForInputEventIE;
- }
- } else if (shouldUseClickEvent(targetNode)) {
- getTargetInstFunc = getTargetInstForClickEvent;
- }
+},{"./createStore":56,"./utils/warning":57,"lodash/isPlainObject":28}],55:[function(require,module,exports){
+"use strict";function compose(){for(var e=arguments.length,r=Array(e),t=0;t<e;t++)r[t]=arguments[t];if(0===r.length)return function(e){return e};if(1===r.length)return r[0];var n=r[r.length-1],u=r.slice(0,-1);return function(){return u.reduceRight(function(e,r){return r(e)},n.apply(void 0,arguments))}}exports.__esModule=!0,exports.default=compose;
- if (getTargetInstFunc) {
- var inst = getTargetInstFunc(topLevelType, targetInst);
- if (inst) {
- var event = SyntheticEvent.getPooled(eventTypes.change, inst, nativeEvent, nativeEventTarget);
- event.type = 'change';
- EventPropagators.accumulateTwoPhaseDispatches(event);
- return event;
- }
- }
+},{}],56:[function(require,module,exports){
+"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function createStore(e,t,r){function n(){l===b&&(l=b.slice())}function o(){return p}function i(e){if("function"!=typeof e)throw new Error("Expected listener to be a function.");var t=!0;return n(),l.push(e),function(){if(t){t=!1,n();var r=l.indexOf(e);l.splice(r,1)}}}function c(e){if(!(0,_isPlainObject2.default)(e))throw new Error("Actions must be plain objects. Use custom middleware for async actions.");if("undefined"==typeof e.type)throw new Error('Actions may not have an undefined "type" property. Have you misspelled a constant?');if(d)throw new Error("Reducers may not dispatch actions.");try{d=!0,p=a(p,e)}finally{d=!1}for(var t=b=l,r=0;r<t.length;r++)t[r]();return e}function u(e){if("function"!=typeof e)throw new Error("Expected the nextReducer to be a function.");a=e,c({type:ActionTypes.INIT})}function s(){var e,t=i;return e={subscribe:function(e){function r(){e.next&&e.next(o())}if("object"!=typeof e)throw new TypeError("Expected the observer to be an object.");r();var n=t(r);return{unsubscribe:n}}},e[_symbolObservable2.default]=function(){return this},e}var f;if("function"==typeof t&&"undefined"==typeof r&&(r=t,t=void 0),"undefined"!=typeof r){if("function"!=typeof r)throw new Error("Expected the enhancer to be a function.");return r(createStore)(e,t)}if("function"!=typeof e)throw new Error("Expected the reducer to be a function.");var a=e,p=t,b=[],l=b,d=!1;return c({type:ActionTypes.INIT}),f={dispatch:c,subscribe:i,getState:o,replaceReducer:u},f[_symbolObservable2.default]=s,f}exports.__esModule=!0,exports.ActionTypes=void 0,exports.default=createStore;var _isPlainObject=require("lodash/isPlainObject"),_isPlainObject2=_interopRequireDefault(_isPlainObject),_symbolObservable=require("symbol-observable"),_symbolObservable2=_interopRequireDefault(_symbolObservable),ActionTypes=exports.ActionTypes={INIT:"@@redux/INIT"};
- if (handleEventFunc) {
- handleEventFunc(topLevelType, targetNode, targetInst);
- }
- }
+},{"lodash/isPlainObject":28,"symbol-observable":58}],57:[function(require,module,exports){
+"use strict";function warning(o){"undefined"!=typeof console&&"function"==typeof console.error&&console.error(o);try{throw new Error(o)}catch(o){}}exports.__esModule=!0,exports.default=warning;
-};
-
-module.exports = ChangeEventPlugin;
-},{"./EventPluginHub":63,"./EventPropagators":66,"./ReactDOMComponentTree":80,"./ReactUpdates":124,"./SyntheticEvent":133,"./getEventTarget":156,"./isEventSupported":164,"./isTextInputElement":165,"fbjs/lib/ExecutionEnvironment":4}],55:[function(require,module,exports){
-(function (process){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-'use strict';
-
-var DOMLazyTree = require('./DOMLazyTree');
-var Danger = require('./Danger');
-var ReactDOMComponentTree = require('./ReactDOMComponentTree');
-var ReactInstrumentation = require('./ReactInstrumentation');
-
-var createMicrosoftUnsafeLocalFunction = require('./createMicrosoftUnsafeLocalFunction');
-var setInnerHTML = require('./setInnerHTML');
-var setTextContent = require('./setTextContent');
-
-function getNodeAfter(parentNode, node) {
- // Special case for text components, which return [open, close] comments
- // from getHostNode.
- if (Array.isArray(node)) {
- node = node[1];
- }
- return node ? node.nextSibling : parentNode.firstChild;
-}
-
-/**
- * Inserts `childNode` as a child of `parentNode` at the `index`.
- *
- * @param {DOMElement} parentNode Parent node in which to insert.
- * @param {DOMElement} childNode Child node to insert.
- * @param {number} index Index at which to insert the child.
- * @internal
- */
-var insertChildAt = createMicrosoftUnsafeLocalFunction(function (parentNode, childNode, referenceNode) {
- // We rely exclusively on `insertBefore(node, null)` instead of also using
- // `appendChild(node)`. (Using `undefined` is not allowed by all browsers so
- // we are careful to use `null`.)
- parentNode.insertBefore(childNode, referenceNode);
-});
-
-function insertLazyTreeChildAt(parentNode, childTree, referenceNode) {
- DOMLazyTree.insertTreeBefore(parentNode, childTree, referenceNode);
-}
-
-function moveChild(parentNode, childNode, referenceNode) {
- if (Array.isArray(childNode)) {
- moveDelimitedText(parentNode, childNode[0], childNode[1], referenceNode);
- } else {
- insertChildAt(parentNode, childNode, referenceNode);
- }
-}
-
-function removeChild(parentNode, childNode) {
- if (Array.isArray(childNode)) {
- var closingComment = childNode[1];
- childNode = childNode[0];
- removeDelimitedText(parentNode, childNode, closingComment);
- parentNode.removeChild(closingComment);
- }
- parentNode.removeChild(childNode);
-}
-
-function moveDelimitedText(parentNode, openingComment, closingComment, referenceNode) {
- var node = openingComment;
- while (true) {
- var nextNode = node.nextSibling;
- insertChildAt(parentNode, node, referenceNode);
- if (node === closingComment) {
- break;
- }
- node = nextNode;
- }
-}
-
-function removeDelimitedText(parentNode, startNode, closingComment) {
- while (true) {
- var node = startNode.nextSibling;
- if (node === closingComment) {
- // The closing comment is removed by ReactMultiChild.
- break;
- } else {
- parentNode.removeChild(node);
- }
- }
-}
-
-function replaceDelimitedText(openingComment, closingComment, stringText) {
- var parentNode = openingComment.parentNode;
- var nodeAfterComment = openingComment.nextSibling;
- if (nodeAfterComment === closingComment) {
- // There are no text nodes between the opening and closing comments; insert
- // a new one if stringText isn't empty.
- if (stringText) {
- insertChildAt(parentNode, document.createTextNode(stringText), nodeAfterComment);
- }
- } else {
- if (stringText) {
- // Set the text content of the first node after the opening comment, and
- // remove all following nodes up until the closing comment.
- setTextContent(nodeAfterComment, stringText);
- removeDelimitedText(parentNode, nodeAfterComment, closingComment);
- } else {
- removeDelimitedText(parentNode, openingComment, closingComment);
- }
- }
-
- if (process.env.NODE_ENV !== 'production') {
- ReactInstrumentation.debugTool.onHostOperation({
- instanceID: ReactDOMComponentTree.getInstanceFromNode(openingComment)._debugID,
- type: 'replace text',
- payload: stringText
- });
- }
-}
-
-var dangerouslyReplaceNodeWithMarkup = Danger.dangerouslyReplaceNodeWithMarkup;
-if (process.env.NODE_ENV !== 'production') {
- dangerouslyReplaceNodeWithMarkup = function (oldChild, markup, prevInstance) {
- Danger.dangerouslyReplaceNodeWithMarkup(oldChild, markup);
- if (prevInstance._debugID !== 0) {
- ReactInstrumentation.debugTool.onHostOperation({
- instanceID: prevInstance._debugID,
- type: 'replace with',
- payload: markup.toString()
- });
- } else {
- var nextInstance = ReactDOMComponentTree.getInstanceFromNode(markup.node);
- if (nextInstance._debugID !== 0) {
- ReactInstrumentation.debugTool.onHostOperation({
- instanceID: nextInstance._debugID,
- type: 'mount',
- payload: markup.toString()
- });
- }
- }
- };
-}
-
-/**
- * Operations for updating with DOM children.
- */
-var DOMChildrenOperations = {
-
- dangerouslyReplaceNodeWithMarkup: dangerouslyReplaceNodeWithMarkup,
-
- replaceDelimitedText: replaceDelimitedText,
-
- /**
- * Updates a component's children by processing a series of updates. The
- * update configurations are each expected to have a `parentNode` property.
- *
- * @param {array<object>} updates List of update configurations.
- * @internal
- */
- processUpdates: function (parentNode, updates) {
- if (process.env.NODE_ENV !== 'production') {
- var parentNodeDebugID = ReactDOMComponentTree.getInstanceFromNode(parentNode)._debugID;
- }
-
- for (var k = 0; k < updates.length; k++) {
- var update = updates[k];
- switch (update.type) {
- case 'INSERT_MARKUP':
- insertLazyTreeChildAt(parentNode, update.content, getNodeAfter(parentNode, update.afterNode));
- if (process.env.NODE_ENV !== 'production') {
- ReactInstrumentation.debugTool.onHostOperation({
- instanceID: parentNodeDebugID,
- type: 'insert child',
- payload: { toIndex: update.toIndex, content: update.content.toString() }
- });
- }
- break;
- case 'MOVE_EXISTING':
- moveChild(parentNode, update.fromNode, getNodeAfter(parentNode, update.afterNode));
- if (process.env.NODE_ENV !== 'production') {
- ReactInstrumentation.debugTool.onHostOperation({
- instanceID: parentNodeDebugID,
- type: 'move child',
- payload: { fromIndex: update.fromIndex, toIndex: update.toIndex }
- });
- }
- break;
- case 'SET_MARKUP':
- setInnerHTML(parentNode, update.content);
- if (process.env.NODE_ENV !== 'production') {
- ReactInstrumentation.debugTool.onHostOperation({
- instanceID: parentNodeDebugID,
- type: 'replace children',
- payload: update.content.toString()
- });
- }
- break;
- case 'TEXT_CONTENT':
- setTextContent(parentNode, update.content);
- if (process.env.NODE_ENV !== 'production') {
- ReactInstrumentation.debugTool.onHostOperation({
- instanceID: parentNodeDebugID,
- type: 'replace text',
- payload: update.content.toString()
- });
- }
- break;
- case 'REMOVE_NODE':
- removeChild(parentNode, update.fromNode);
- if (process.env.NODE_ENV !== 'production') {
- ReactInstrumentation.debugTool.onHostOperation({
- instanceID: parentNodeDebugID,
- type: 'remove child',
- payload: { fromIndex: update.fromIndex }
- });
- }
- break;
- }
- }
- }
-
-};
-
-module.exports = DOMChildrenOperations;
-}).call(this,require('_process'))
-
-},{"./DOMLazyTree":56,"./Danger":60,"./ReactDOMComponentTree":80,"./ReactInstrumentation":109,"./createMicrosoftUnsafeLocalFunction":147,"./setInnerHTML":169,"./setTextContent":170,"_process":43}],56:[function(require,module,exports){
-/**
- * Copyright 2015-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-'use strict';
-
-var DOMNamespaces = require('./DOMNamespaces');
-var setInnerHTML = require('./setInnerHTML');
-
-var createMicrosoftUnsafeLocalFunction = require('./createMicrosoftUnsafeLocalFunction');
-var setTextContent = require('./setTextContent');
-
-var ELEMENT_NODE_TYPE = 1;
-var DOCUMENT_FRAGMENT_NODE_TYPE = 11;
-
-/**
- * In IE (8-11) and Edge, appending nodes with no children is dramatically
- * faster than appending a full subtree, so we essentially queue up the
- * .appendChild calls here and apply them so each node is added to its parent
- * before any children are added.
- *
- * In other browsers, doing so is slower or neutral compared to the other order
- * (in Firefox, twice as slow) so we only do this inversion in IE.
- *
- * See https://github.com/spicyj/innerhtml-vs-createelement-vs-clonenode.
- */
-var enableLazy = typeof document !== 'undefined' && typeof document.documentMode === 'number' || typeof navigator !== 'undefined' && typeof navigator.userAgent === 'string' && /\bEdge\/\d/.test(navigator.userAgent);
-
-function insertTreeChildren(tree) {
- if (!enableLazy) {
- return;
- }
- var node = tree.node;
- var children = tree.children;
- if (children.length) {
- for (var i = 0; i < children.length; i++) {
- insertTreeBefore(node, children[i], null);
- }
- } else if (tree.html != null) {
- setInnerHTML(node, tree.html);
- } else if (tree.text != null) {
- setTextContent(node, tree.text);
- }
-}
-
-var insertTreeBefore = createMicrosoftUnsafeLocalFunction(function (parentNode, tree, referenceNode) {
- // DocumentFragments aren't actually part of the DOM after insertion so
- // appending children won't update the DOM. We need to ensure the fragment
- // is properly populated first, breaking out of our lazy approach for just
- // this level. Also, some <object> plugins (like Flash Player) will read
- // <param> nodes immediately upon insertion into the DOM, so <object>
- // must also be populated prior to insertion into the DOM.
- if (tree.node.nodeType === DOCUMENT_FRAGMENT_NODE_TYPE || tree.node.nodeType === ELEMENT_NODE_TYPE && tree.node.nodeName.toLowerCase() === 'object' && (tree.node.namespaceURI == null || tree.node.namespaceURI === DOMNamespaces.html)) {
- insertTreeChildren(tree);
- parentNode.insertBefore(tree.node, referenceNode);
- } else {
- parentNode.insertBefore(tree.node, referenceNode);
- insertTreeChildren(tree);
- }
-});
-
-function replaceChildWithTree(oldNode, newTree) {
- oldNode.parentNode.replaceChild(newTree.node, oldNode);
- insertTreeChildren(newTree);
-}
-
-function queueChild(parentTree, childTree) {
- if (enableLazy) {
- parentTree.children.push(childTree);
- } else {
- parentTree.node.appendChild(childTree.node);
- }
-}
-
-function queueHTML(tree, html) {
- if (enableLazy) {
- tree.html = html;
- } else {
- setInnerHTML(tree.node, html);
- }
-}
-
-function queueText(tree, text) {
- if (enableLazy) {
- tree.text = text;
- } else {
- setTextContent(tree.node, text);
- }
-}
-
-function toString() {
- return this.node.nodeName;
-}
-
-function DOMLazyTree(node) {
- return {
- node: node,
- children: [],
- html: null,
- text: null,
- toString: toString
- };
-}
-
-DOMLazyTree.insertTreeBefore = insertTreeBefore;
-DOMLazyTree.replaceChildWithTree = replaceChildWithTree;
-DOMLazyTree.queueChild = queueChild;
-DOMLazyTree.queueHTML = queueHTML;
-DOMLazyTree.queueText = queueText;
-
-module.exports = DOMLazyTree;
-},{"./DOMNamespaces":57,"./createMicrosoftUnsafeLocalFunction":147,"./setInnerHTML":169,"./setTextContent":170}],57:[function(require,module,exports){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-'use strict';
-
-var DOMNamespaces = {
- html: 'http://www.w3.org/1999/xhtml',
- mathml: 'http://www.w3.org/1998/Math/MathML',
- svg: 'http://www.w3.org/2000/svg'
-};
-
-module.exports = DOMNamespaces;
},{}],58:[function(require,module,exports){
-(function (process){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-'use strict';
-
-var _prodInvariant = require('./reactProdInvariant');
-
-var invariant = require('fbjs/lib/invariant');
-
-function checkMask(value, bitmask) {
- return (value & bitmask) === bitmask;
-}
-
-var DOMPropertyInjection = {
- /**
- * Mapping from normalized, camelcased property names to a configuration that
- * specifies how the associated DOM property should be accessed or rendered.
- */
- MUST_USE_PROPERTY: 0x1,
- HAS_BOOLEAN_VALUE: 0x4,
- HAS_NUMERIC_VALUE: 0x8,
- HAS_POSITIVE_NUMERIC_VALUE: 0x10 | 0x8,
- HAS_OVERLOADED_BOOLEAN_VALUE: 0x20,
-
- /**
- * Inject some specialized knowledge about the DOM. This takes a config object
- * with the following properties:
- *
- * isCustomAttribute: function that given an attribute name will return true
- * if it can be inserted into the DOM verbatim. Useful for data-* or aria-*
- * attributes where it's impossible to enumerate all of the possible
- * attribute names,
- *
- * Properties: object mapping DOM property name to one of the
- * DOMPropertyInjection constants or null. If your attribute isn't in here,
- * it won't get written to the DOM.
- *
- * DOMAttributeNames: object mapping React attribute name to the DOM
- * attribute name. Attribute names not specified use the **lowercase**
- * normalized name.
- *
- * DOMAttributeNamespaces: object mapping React attribute name to the DOM
- * attribute namespace URL. (Attribute names not specified use no namespace.)
- *
- * DOMPropertyNames: similar to DOMAttributeNames but for DOM properties.
- * Property names not specified use the normalized name.
- *
- * DOMMutationMethods: Properties that require special mutation methods. If
- * `value` is undefined, the mutation method should unset the property.
- *
- * @param {object} domPropertyConfig the config as described above.
- */
- injectDOMPropertyConfig: function (domPropertyConfig) {
- var Injection = DOMPropertyInjection;
- var Properties = domPropertyConfig.Properties || {};
- var DOMAttributeNamespaces = domPropertyConfig.DOMAttributeNamespaces || {};
- var DOMAttributeNames = domPropertyConfig.DOMAttributeNames || {};
- var DOMPropertyNames = domPropertyConfig.DOMPropertyNames || {};
- var DOMMutationMethods = domPropertyConfig.DOMMutationMethods || {};
-
- if (domPropertyConfig.isCustomAttribute) {
- DOMProperty._isCustomAttributeFunctions.push(domPropertyConfig.isCustomAttribute);
- }
-
- for (var propName in Properties) {
- !!DOMProperty.properties.hasOwnProperty(propName) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'injectDOMPropertyConfig(...): You\'re trying to inject DOM property \'%s\' which has already been injected. You may be accidentally injecting the same DOM property config twice, or you may be injecting two configs that have conflicting property names.', propName) : _prodInvariant('48', propName) : void 0;
-
- var lowerCased = propName.toLowerCase();
- var propConfig = Properties[propName];
-
- var propertyInfo = {
- attributeName: lowerCased,
- attributeNamespace: null,
- propertyName: propName,
- mutationMethod: null,
-
- mustUseProperty: checkMask(propConfig, Injection.MUST_USE_PROPERTY),
- hasBooleanValue: checkMask(propConfig, Injection.HAS_BOOLEAN_VALUE),
- hasNumericValue: checkMask(propConfig, Injection.HAS_NUMERIC_VALUE),
- hasPositiveNumericValue: checkMask(propConfig, Injection.HAS_POSITIVE_NUMERIC_VALUE),
- hasOverloadedBooleanValue: checkMask(propConfig, Injection.HAS_OVERLOADED_BOOLEAN_VALUE)
- };
- !(propertyInfo.hasBooleanValue + propertyInfo.hasNumericValue + propertyInfo.hasOverloadedBooleanValue <= 1) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'DOMProperty: Value can be one of boolean, overloaded boolean, or numeric value, but not a combination: %s', propName) : _prodInvariant('50', propName) : void 0;
-
- if (process.env.NODE_ENV !== 'production') {
- DOMProperty.getPossibleStandardName[lowerCased] = propName;
- }
-
- if (DOMAttributeNames.hasOwnProperty(propName)) {
- var attributeName = DOMAttributeNames[propName];
- propertyInfo.attributeName = attributeName;
- if (process.env.NODE_ENV !== 'production') {
- DOMProperty.getPossibleStandardName[attributeName] = propName;
- }
- }
-
- if (DOMAttributeNamespaces.hasOwnProperty(propName)) {
- propertyInfo.attributeNamespace = DOMAttributeNamespaces[propName];
- }
-
- if (DOMPropertyNames.hasOwnProperty(propName)) {
- propertyInfo.propertyName = DOMPropertyNames[propName];
- }
-
- if (DOMMutationMethods.hasOwnProperty(propName)) {
- propertyInfo.mutationMethod = DOMMutationMethods[propName];
- }
-
- DOMProperty.properties[propName] = propertyInfo;
- }
- }
-};
-
-/* eslint-disable max-len */
-var ATTRIBUTE_NAME_START_CHAR = ':A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD';
-/* eslint-enable max-len */
-
-/**
- * DOMProperty exports lookup objects that can be used like functions:
- *
- * > DOMProperty.isValid['id']
- * true
- * > DOMProperty.isValid['foobar']
- * undefined
- *
- * Although this may be confusing, it performs better in general.
- *
- * @see http://jsperf.com/key-exists
- * @see http://jsperf.com/key-missing
- */
-var DOMProperty = {
-
- ID_ATTRIBUTE_NAME: 'data-reactid',
- ROOT_ATTRIBUTE_NAME: 'data-reactroot',
-
- ATTRIBUTE_NAME_START_CHAR: ATTRIBUTE_NAME_START_CHAR,
- ATTRIBUTE_NAME_CHAR: ATTRIBUTE_NAME_START_CHAR + '\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040',
-
- /**
- * Map from property "standard name" to an object with info about how to set
- * the property in the DOM. Each object contains:
- *
- * attributeName:
- * Used when rendering markup or with `*Attribute()`.
- * attributeNamespace
- * propertyName:
- * Used on DOM node instances. (This includes properties that mutate due to
- * external factors.)
- * mutationMethod:
- * If non-null, used instead of the property or `setAttribute()` after
- * initial render.
- * mustUseProperty:
- * Whether the property must be accessed and mutated as an object property.
- * hasBooleanValue:
- * Whether the property should be removed when set to a falsey value.
- * hasNumericValue:
- * Whether the property must be numeric or parse as a numeric and should be
- * removed when set to a falsey value.
- * hasPositiveNumericValue:
- * Whether the property must be positive numeric or parse as a positive
- * numeric and should be removed when set to a falsey value.
- * hasOverloadedBooleanValue:
- * Whether the property can be used as a flag as well as with a value.
- * Removed when strictly equal to false; present without a value when
- * strictly equal to true; present with a value otherwise.
- */
- properties: {},
-
- /**
- * Mapping from lowercase property names to the properly cased version, used
- * to warn in the case of missing properties. Available only in __DEV__.
- *
- * autofocus is predefined, because adding it to the property whitelist
- * causes unintended side effects.
- *
- * @type {Object}
- */
- getPossibleStandardName: process.env.NODE_ENV !== 'production' ? { autofocus: 'autoFocus' } : null,
-
- /**
- * All of the isCustomAttribute() functions that have been injected.
- */
- _isCustomAttributeFunctions: [],
-
- /**
- * Checks whether a property name is a custom attribute.
- * @method
- */
- isCustomAttribute: function (attributeName) {
- for (var i = 0; i < DOMProperty._isCustomAttributeFunctions.length; i++) {
- var isCustomAttributeFn = DOMProperty._isCustomAttributeFunctions[i];
- if (isCustomAttributeFn(attributeName)) {
- return true;
- }
- }
- return false;
- },
-
- injection: DOMPropertyInjection
-};
-
-module.exports = DOMProperty;
-}).call(this,require('_process'))
-
-},{"./reactProdInvariant":167,"_process":43,"fbjs/lib/invariant":18}],59:[function(require,module,exports){
-(function (process){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-'use strict';
-
-var DOMProperty = require('./DOMProperty');
-var ReactDOMComponentTree = require('./ReactDOMComponentTree');
-var ReactInstrumentation = require('./ReactInstrumentation');
-
-var quoteAttributeValueForBrowser = require('./quoteAttributeValueForBrowser');
-var warning = require('fbjs/lib/warning');
-
-var VALID_ATTRIBUTE_NAME_REGEX = new RegExp('^[' + DOMProperty.ATTRIBUTE_NAME_START_CHAR + '][' + DOMProperty.ATTRIBUTE_NAME_CHAR + ']*$');
-var illegalAttributeNameCache = {};
-var validatedAttributeNameCache = {};
-
-function isAttributeNameSafe(attributeName) {
- if (validatedAttributeNameCache.hasOwnProperty(attributeName)) {
- return true;
- }
- if (illegalAttributeNameCache.hasOwnProperty(attributeName)) {
- return false;
- }
- if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName)) {
- validatedAttributeNameCache[attributeName] = true;
- return true;
- }
- illegalAttributeNameCache[attributeName] = true;
- process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid attribute name: `%s`', attributeName) : void 0;
- return false;
-}
-
-function shouldIgnoreValue(propertyInfo, value) {
- return value == null || propertyInfo.hasBooleanValue && !value || propertyInfo.hasNumericValue && isNaN(value) || propertyInfo.hasPositiveNumericValue && value < 1 || propertyInfo.hasOverloadedBooleanValue && value === false;
-}
-
-/**
- * Operations for dealing with DOM properties.
- */
-var DOMPropertyOperations = {
-
- /**
- * Creates markup for the ID property.
- *
- * @param {string} id Unescaped ID.
- * @return {string} Markup string.
- */
- createMarkupForID: function (id) {
- return DOMProperty.ID_ATTRIBUTE_NAME + '=' + quoteAttributeValueForBrowser(id);
- },
-
- setAttributeForID: function (node, id) {
- node.setAttribute(DOMProperty.ID_ATTRIBUTE_NAME, id);
- },
-
- createMarkupForRoot: function () {
- return DOMProperty.ROOT_ATTRIBUTE_NAME + '=""';
- },
-
- setAttributeForRoot: function (node) {
- node.setAttribute(DOMProperty.ROOT_ATTRIBUTE_NAME, '');
- },
-
- /**
- * Creates markup for a property.
- *
- * @param {string} name
- * @param {*} value
- * @return {?string} Markup string, or null if the property was invalid.
- */
- createMarkupForProperty: function (name, value) {
- var propertyInfo = DOMProperty.properties.hasOwnProperty(name) ? DOMProperty.properties[name] : null;
- if (propertyInfo) {
- if (shouldIgnoreValue(propertyInfo, value)) {
- return '';
- }
- var attributeName = propertyInfo.attributeName;
- if (propertyInfo.hasBooleanValue || propertyInfo.hasOverloadedBooleanValue && value === true) {
- return attributeName + '=""';
- }
- return attributeName + '=' + quoteAttributeValueForBrowser(value);
- } else if (DOMProperty.isCustomAttribute(name)) {
- if (value == null) {
- return '';
- }
- return name + '=' + quoteAttributeValueForBrowser(value);
- }
- return null;
- },
-
- /**
- * Creates markup for a custom property.
- *
- * @param {string} name
- * @param {*} value
- * @return {string} Markup string, or empty string if the property was invalid.
- */
- createMarkupForCustomAttribute: function (name, value) {
- if (!isAttributeNameSafe(name) || value == null) {
- return '';
- }
- return name + '=' + quoteAttributeValueForBrowser(value);
- },
-
- /**
- * Sets the value for a property on a node.
- *
- * @param {DOMElement} node
- * @param {string} name
- * @param {*} value
- */
- setValueForProperty: function (node, name, value) {
- var propertyInfo = DOMProperty.properties.hasOwnProperty(name) ? DOMProperty.properties[name] : null;
- if (propertyInfo) {
- var mutationMethod = propertyInfo.mutationMethod;
- if (mutationMethod) {
- mutationMethod(node, value);
- } else if (shouldIgnoreValue(propertyInfo, value)) {
- this.deleteValueForProperty(node, name);
- return;
- } else if (propertyInfo.mustUseProperty) {
- // Contrary to `setAttribute`, object properties are properly
- // `toString`ed by IE8/9.
- node[propertyInfo.propertyName] = value;
- } else {
- var attributeName = propertyInfo.attributeName;
- var namespace = propertyInfo.attributeNamespace;
- // `setAttribute` with objects becomes only `[object]` in IE8/9,
- // ('' + value) makes it output the correct toString()-value.
- if (namespace) {
- node.setAttributeNS(namespace, attributeName, '' + value);
- } else if (propertyInfo.hasBooleanValue || propertyInfo.hasOverloadedBooleanValue && value === true) {
- node.setAttribute(attributeName, '');
- } else {
- node.setAttribute(attributeName, '' + value);
- }
- }
- } else if (DOMProperty.isCustomAttribute(name)) {
- DOMPropertyOperations.setValueForAttribute(node, name, value);
- return;
- }
-
- if (process.env.NODE_ENV !== 'production') {
- var payload = {};
- payload[name] = value;
- ReactInstrumentation.debugTool.onHostOperation({
- instanceID: ReactDOMComponentTree.getInstanceFromNode(node)._debugID,
- type: 'update attribute',
- payload: payload
- });
- }
- },
-
- setValueForAttribute: function (node, name, value) {
- if (!isAttributeNameSafe(name)) {
- return;
- }
- if (value == null) {
- node.removeAttribute(name);
- } else {
- node.setAttribute(name, '' + value);
- }
-
- if (process.env.NODE_ENV !== 'production') {
- var payload = {};
- payload[name] = value;
- ReactInstrumentation.debugTool.onHostOperation({
- instanceID: ReactDOMComponentTree.getInstanceFromNode(node)._debugID,
- type: 'update attribute',
- payload: payload
- });
- }
- },
-
- /**
- * Deletes an attributes from a node.
- *
- * @param {DOMElement} node
- * @param {string} name
- */
- deleteValueForAttribute: function (node, name) {
- node.removeAttribute(name);
- if (process.env.NODE_ENV !== 'production') {
- ReactInstrumentation.debugTool.onHostOperation({
- instanceID: ReactDOMComponentTree.getInstanceFromNode(node)._debugID,
- type: 'remove attribute',
- payload: name
- });
- }
- },
-
- /**
- * Deletes the value for a property on a node.
- *
- * @param {DOMElement} node
- * @param {string} name
- */
- deleteValueForProperty: function (node, name) {
- var propertyInfo = DOMProperty.properties.hasOwnProperty(name) ? DOMProperty.properties[name] : null;
- if (propertyInfo) {
- var mutationMethod = propertyInfo.mutationMethod;
- if (mutationMethod) {
- mutationMethod(node, undefined);
- } else if (propertyInfo.mustUseProperty) {
- var propName = propertyInfo.propertyName;
- if (propertyInfo.hasBooleanValue) {
- node[propName] = false;
- } else {
- node[propName] = '';
- }
- } else {
- node.removeAttribute(propertyInfo.attributeName);
- }
- } else if (DOMProperty.isCustomAttribute(name)) {
- node.removeAttribute(name);
- }
-
- if (process.env.NODE_ENV !== 'production') {
- ReactInstrumentation.debugTool.onHostOperation({
- instanceID: ReactDOMComponentTree.getInstanceFromNode(node)._debugID,
- type: 'remove attribute',
- payload: name
- });
- }
- }
-
-};
-
-module.exports = DOMPropertyOperations;
-}).call(this,require('_process'))
-
-},{"./DOMProperty":58,"./ReactDOMComponentTree":80,"./ReactInstrumentation":109,"./quoteAttributeValueForBrowser":166,"_process":43,"fbjs/lib/warning":25}],60:[function(require,module,exports){
-(function (process){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-'use strict';
-
-var _prodInvariant = require('./reactProdInvariant');
-
-var DOMLazyTree = require('./DOMLazyTree');
-var ExecutionEnvironment = require('fbjs/lib/ExecutionEnvironment');
-
-var createNodesFromMarkup = require('fbjs/lib/createNodesFromMarkup');
-var emptyFunction = require('fbjs/lib/emptyFunction');
-var invariant = require('fbjs/lib/invariant');
-
-var Danger = {
-
- /**
- * Replaces a node with a string of markup at its current position within its
- * parent. The markup must render into a single root node.
- *
- * @param {DOMElement} oldChild Child node to replace.
- * @param {string} markup Markup to render in place of the child node.
- * @internal
- */
- dangerouslyReplaceNodeWithMarkup: function (oldChild, markup) {
- !ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? invariant(false, 'dangerouslyReplaceNodeWithMarkup(...): Cannot render markup in a worker thread. Make sure `window` and `document` are available globally before requiring React when unit testing or use ReactDOMServer.renderToString() for server rendering.') : _prodInvariant('56') : void 0;
- !markup ? process.env.NODE_ENV !== 'production' ? invariant(false, 'dangerouslyReplaceNodeWithMarkup(...): Missing markup.') : _prodInvariant('57') : void 0;
- !(oldChild.nodeName !== 'HTML') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'dangerouslyReplaceNodeWithMarkup(...): Cannot replace markup of the <html> node. This is because browser quirks make this unreliable and/or slow. If you want to render to the root you must use server rendering. See ReactDOMServer.renderToString().') : _prodInvariant('58') : void 0;
-
- if (typeof markup === 'string') {
- var newChild = createNodesFromMarkup(markup, emptyFunction)[0];
- oldChild.parentNode.replaceChild(newChild, oldChild);
- } else {
- DOMLazyTree.replaceChildWithTree(oldChild, markup);
- }
- }
-
-};
-
-module.exports = Danger;
-}).call(this,require('_process'))
-
-},{"./DOMLazyTree":56,"./reactProdInvariant":167,"_process":43,"fbjs/lib/ExecutionEnvironment":4,"fbjs/lib/createNodesFromMarkup":9,"fbjs/lib/emptyFunction":10,"fbjs/lib/invariant":18}],61:[function(require,module,exports){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-'use strict';
-
-/**
- * Module that is injectable into `EventPluginHub`, that specifies a
- * deterministic ordering of `EventPlugin`s. A convenient way to reason about
- * plugins, without having to package every one of them. This is better than
- * having plugins be ordered in the same order that they are injected because
- * that ordering would be influenced by the packaging order.
- * `ResponderEventPlugin` must occur before `SimpleEventPlugin` so that
- * preventing default on events is convenient in `SimpleEventPlugin` handlers.
- */
-
-var DefaultEventPluginOrder = ['ResponderEventPlugin', 'SimpleEventPlugin', 'TapEventPlugin', 'EnterLeaveEventPlugin', 'ChangeEventPlugin', 'SelectEventPlugin', 'BeforeInputEventPlugin'];
-
-module.exports = DefaultEventPluginOrder;
-},{}],62:[function(require,module,exports){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-'use strict';
-
-var EventPropagators = require('./EventPropagators');
-var ReactDOMComponentTree = require('./ReactDOMComponentTree');
-var SyntheticMouseEvent = require('./SyntheticMouseEvent');
-
-var eventTypes = {
- mouseEnter: {
- registrationName: 'onMouseEnter',
- dependencies: ['topMouseOut', 'topMouseOver']
- },
- mouseLeave: {
- registrationName: 'onMouseLeave',
- dependencies: ['topMouseOut', 'topMouseOver']
- }
-};
-
-var EnterLeaveEventPlugin = {
-
- eventTypes: eventTypes,
-
- /**
- * For almost every interaction we care about, there will be both a top-level
- * `mouseover` and `mouseout` event that occurs. Only use `mouseout` so that
- * we do not extract duplicate events. However, moving the mouse into the
- * browser from outside will not fire a `mouseout` event. In this case, we use
- * the `mouseover` top-level event.
- */
- extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
- if (topLevelType === 'topMouseOver' && (nativeEvent.relatedTarget || nativeEvent.fromElement)) {
- return null;
- }
- if (topLevelType !== 'topMouseOut' && topLevelType !== 'topMouseOver') {
- // Must not be a mouse in or mouse out - ignoring.
- return null;
- }
-
- var win;
- if (nativeEventTarget.window === nativeEventTarget) {
- // `nativeEventTarget` is probably a window object.
- win = nativeEventTarget;
- } else {
- // TODO: Figure out why `ownerDocument` is sometimes undefined in IE8.
- var doc = nativeEventTarget.ownerDocument;
- if (doc) {
- win = doc.defaultView || doc.parentWindow;
- } else {
- win = window;
- }
- }
-
- var from;
- var to;
- if (topLevelType === 'topMouseOut') {
- from = targetInst;
- var related = nativeEvent.relatedTarget || nativeEvent.toElement;
- to = related ? ReactDOMComponentTree.getClosestInstanceFromNode(related) : null;
- } else {
- // Moving to a node from outside the window.
- from = null;
- to = targetInst;
- }
-
- if (from === to) {
- // Nothing pertains to our managed components.
- return null;
- }
-
- var fromNode = from == null ? win : ReactDOMComponentTree.getNodeFromInstance(from);
- var toNode = to == null ? win : ReactDOMComponentTree.getNodeFromInstance(to);
-
- var leave = SyntheticMouseEvent.getPooled(eventTypes.mouseLeave, from, nativeEvent, nativeEventTarget);
- leave.type = 'mouseleave';
- leave.target = fromNode;
- leave.relatedTarget = toNode;
-
- var enter = SyntheticMouseEvent.getPooled(eventTypes.mouseEnter, to, nativeEvent, nativeEventTarget);
- enter.type = 'mouseenter';
- enter.target = toNode;
- enter.relatedTarget = fromNode;
-
- EventPropagators.accumulateEnterLeaveDispatches(leave, enter, from, to);
-
- return [leave, enter];
- }
-
-};
-
-module.exports = EnterLeaveEventPlugin;
-},{"./EventPropagators":66,"./ReactDOMComponentTree":80,"./SyntheticMouseEvent":137}],63:[function(require,module,exports){
-(function (process){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-'use strict';
-
-var _prodInvariant = require('./reactProdInvariant');
-
-var EventPluginRegistry = require('./EventPluginRegistry');
-var EventPluginUtils = require('./EventPluginUtils');
-var ReactErrorUtils = require('./ReactErrorUtils');
-
-var accumulateInto = require('./accumulateInto');
-var forEachAccumulated = require('./forEachAccumulated');
-var invariant = require('fbjs/lib/invariant');
-
-/**
- * Internal store for event listeners
- */
-var listenerBank = {};
-
-/**
- * Internal queue of events that have accumulated their dispatches and are
- * waiting to have their dispatches executed.
- */
-var eventQueue = null;
-
-/**
- * Dispatches an event and releases it back into the pool, unless persistent.
- *
- * @param {?object} event Synthetic event to be dispatched.
- * @param {boolean} simulated If the event is simulated (changes exn behavior)
- * @private
- */
-var executeDispatchesAndRelease = function (event, simulated) {
- if (event) {
- EventPluginUtils.executeDispatchesInOrder(event, simulated);
-
- if (!event.isPersistent()) {
- event.constructor.release(event);
- }
- }
-};
-var executeDispatchesAndReleaseSimulated = function (e) {
- return executeDispatchesAndRelease(e, true);
-};
-var executeDispatchesAndReleaseTopLevel = function (e) {
- return executeDispatchesAndRelease(e, false);
-};
-
-var getDictionaryKey = function (inst) {
- // Prevents V8 performance issue:
- // https://github.com/facebook/react/pull/7232
- return '.' + inst._rootNodeID;
-};
-
-function isInteractive(tag) {
- return tag === 'button' || tag === 'input' || tag === 'select' || tag === 'textarea';
-}
-
-function shouldPreventMouseEvent(name, type, props) {
- switch (name) {
- case 'onClick':
- case 'onClickCapture':
- case 'onDoubleClick':
- case 'onDoubleClickCapture':
- case 'onMouseDown':
- case 'onMouseDownCapture':
- case 'onMouseMove':
- case 'onMouseMoveCapture':
- case 'onMouseUp':
- case 'onMouseUpCapture':
- return !!(props.disabled && isInteractive(type));
- default:
- return false;
- }
-}
-
-/**
- * This is a unified interface for event plugins to be installed and configured.
- *
- * Event plugins can implement the following properties:
- *
- * `extractEvents` {function(string, DOMEventTarget, string, object): *}
- * Required. When a top-level event is fired, this method is expected to
- * extract synthetic events that will in turn be queued and dispatched.
- *
- * `eventTypes` {object}
- * Optional, plugins that fire events must publish a mapping of registration
- * names that are used to register listeners. Values of this mapping must
- * be objects that contain `registrationName` or `phasedRegistrationNames`.
- *
- * `executeDispatch` {function(object, function, string)}
- * Optional, allows plugins to override how an event gets dispatched. By
- * default, the listener is simply invoked.
- *
- * Each plugin that is injected into `EventsPluginHub` is immediately operable.
- *
- * @public
- */
-var EventPluginHub = {
-
- /**
- * Methods for injecting dependencies.
- */
- injection: {
-
- /**
- * @param {array} InjectedEventPluginOrder
- * @public
- */
- injectEventPluginOrder: EventPluginRegistry.injectEventPluginOrder,
-
- /**
- * @param {object} injectedNamesToPlugins Map from names to plugin modules.
- */
- injectEventPluginsByName: EventPluginRegistry.injectEventPluginsByName
-
- },
-
- /**
- * Stores `listener` at `listenerBank[registrationName][key]`. Is idempotent.
- *
- * @param {object} inst The instance, which is the source of events.
- * @param {string} registrationName Name of listener (e.g. `onClick`).
- * @param {function} listener The callback to store.
- */
- putListener: function (inst, registrationName, listener) {
- !(typeof listener === 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Expected %s listener to be a function, instead got type %s', registrationName, typeof listener) : _prodInvariant('94', registrationName, typeof listener) : void 0;
-
- var key = getDictionaryKey(inst);
- var bankForRegistrationName = listenerBank[registrationName] || (listenerBank[registrationName] = {});
- bankForRegistrationName[key] = listener;
-
- var PluginModule = EventPluginRegistry.registrationNameModules[registrationName];
- if (PluginModule && PluginModule.didPutListener) {
- PluginModule.didPutListener(inst, registrationName, listener);
- }
- },
-
- /**
- * @param {object} inst The instance, which is the source of events.
- * @param {string} registrationName Name of listener (e.g. `onClick`).
- * @return {?function} The stored callback.
- */
- getListener: function (inst, registrationName) {
- // TODO: shouldPreventMouseEvent is DOM-specific and definitely should not
- // live here; needs to be moved to a better place soon
- var bankForRegistrationName = listenerBank[registrationName];
- if (shouldPreventMouseEvent(registrationName, inst._currentElement.type, inst._currentElement.props)) {
- return null;
- }
- var key = getDictionaryKey(inst);
- return bankForRegistrationName && bankForRegistrationName[key];
- },
-
- /**
- * Deletes a listener from the registration bank.
- *
- * @param {object} inst The instance, which is the source of events.
- * @param {string} registrationName Name of listener (e.g. `onClick`).
- */
- deleteListener: function (inst, registrationName) {
- var PluginModule = EventPluginRegistry.registrationNameModules[registrationName];
- if (PluginModule && PluginModule.willDeleteListener) {
- PluginModule.willDeleteListener(inst, registrationName);
- }
-
- var bankForRegistrationName = listenerBank[registrationName];
- // TODO: This should never be null -- when is it?
- if (bankForRegistrationName) {
- var key = getDictionaryKey(inst);
- delete bankForRegistrationName[key];
- }
- },
-
- /**
- * Deletes all listeners for the DOM element with the supplied ID.
- *
- * @param {object} inst The instance, which is the source of events.
- */
- deleteAllListeners: function (inst) {
- var key = getDictionaryKey(inst);
- for (var registrationName in listenerBank) {
- if (!listenerBank.hasOwnProperty(registrationName)) {
- continue;
- }
-
- if (!listenerBank[registrationName][key]) {
- continue;
- }
-
- var PluginModule = EventPluginRegistry.registrationNameModules[registrationName];
- if (PluginModule && PluginModule.willDeleteListener) {
- PluginModule.willDeleteListener(inst, registrationName);
- }
-
- delete listenerBank[registrationName][key];
- }
- },
-
- /**
- * Allows registered plugins an opportunity to extract events from top-level
- * native browser events.
- *
- * @return {*} An accumulation of synthetic events.
- * @internal
- */
- extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
- var events;
- var plugins = EventPluginRegistry.plugins;
- for (var i = 0; i < plugins.length; i++) {
- // Not every plugin in the ordering may be loaded at runtime.
- var possiblePlugin = plugins[i];
- if (possiblePlugin) {
- var extractedEvents = possiblePlugin.extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget);
- if (extractedEvents) {
- events = accumulateInto(events, extractedEvents);
- }
- }
- }
- return events;
- },
-
- /**
- * Enqueues a synthetic event that should be dispatched when
- * `processEventQueue` is invoked.
- *
- * @param {*} events An accumulation of synthetic events.
- * @internal
- */
- enqueueEvents: function (events) {
- if (events) {
- eventQueue = accumulateInto(eventQueue, events);
- }
- },
-
- /**
- * Dispatches all synthetic events on the event queue.
- *
- * @internal
- */
- processEventQueue: function (simulated) {
- // Set `eventQueue` to null before processing it so that we can tell if more
- // events get enqueued while processing.
- var processingEventQueue = eventQueue;
- eventQueue = null;
- if (simulated) {
- forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseSimulated);
- } else {
- forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseTopLevel);
- }
- !!eventQueue ? process.env.NODE_ENV !== 'production' ? invariant(false, 'processEventQueue(): Additional events were enqueued while processing an event queue. Support for this has not yet been implemented.') : _prodInvariant('95') : void 0;
- // This would be a good time to rethrow if any of the event handlers threw.
- ReactErrorUtils.rethrowCaughtError();
- },
-
- /**
- * These are needed for tests only. Do not use!
- */
- __purge: function () {
- listenerBank = {};
- },
-
- __getListenerBank: function () {
- return listenerBank;
- }
-
-};
-
-module.exports = EventPluginHub;
-}).call(this,require('_process'))
-
-},{"./EventPluginRegistry":64,"./EventPluginUtils":65,"./ReactErrorUtils":100,"./accumulateInto":144,"./forEachAccumulated":152,"./reactProdInvariant":167,"_process":43,"fbjs/lib/invariant":18}],64:[function(require,module,exports){
-(function (process){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- *
- */
-
-'use strict';
-
-var _prodInvariant = require('./reactProdInvariant');
-
-var invariant = require('fbjs/lib/invariant');
-
-/**
- * Injectable ordering of event plugins.
- */
-var eventPluginOrder = null;
-
-/**
- * Injectable mapping from names to event plugin modules.
- */
-var namesToPlugins = {};
-
-/**
- * Recomputes the plugin list using the injected plugins and plugin ordering.
- *
- * @private
- */
-function recomputePluginOrdering() {
- if (!eventPluginOrder) {
- // Wait until an `eventPluginOrder` is injected.
- return;
- }
- for (var pluginName in namesToPlugins) {
- var pluginModule = namesToPlugins[pluginName];
- var pluginIndex = eventPluginOrder.indexOf(pluginName);
- !(pluginIndex > -1) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : _prodInvariant('96', pluginName) : void 0;
- if (EventPluginRegistry.plugins[pluginIndex]) {
- continue;
- }
- !pluginModule.extractEvents ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : _prodInvariant('97', pluginName) : void 0;
- EventPluginRegistry.plugins[pluginIndex] = pluginModule;
- var publishedEvents = pluginModule.eventTypes;
- for (var eventName in publishedEvents) {
- !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : _prodInvariant('98', eventName, pluginName) : void 0;
- }
- }
-}
-
-/**
- * Publishes an event so that it can be dispatched by the supplied plugin.
- *
- * @param {object} dispatchConfig Dispatch configuration for the event.
- * @param {object} PluginModule Plugin publishing the event.
- * @return {boolean} True if the event was successfully published.
- * @private
- */
-function publishEventForPlugin(dispatchConfig, pluginModule, eventName) {
- !!EventPluginRegistry.eventNameDispatchConfigs.hasOwnProperty(eventName) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginHub: More than one plugin attempted to publish the same event name, `%s`.', eventName) : _prodInvariant('99', eventName) : void 0;
- EventPluginRegistry.eventNameDispatchConfigs[eventName] = dispatchConfig;
-
- var phasedRegistrationNames = dispatchConfig.phasedRegistrationNames;
- if (phasedRegistrationNames) {
- for (var phaseName in phasedRegistrationNames) {
- if (phasedRegistrationNames.hasOwnProperty(phaseName)) {
- var phasedRegistrationName = phasedRegistrationNames[phaseName];
- publishRegistrationName(phasedRegistrationName, pluginModule, eventName);
- }
- }
- return true;
- } else if (dispatchConfig.registrationName) {
- publishRegistrationName(dispatchConfig.registrationName, pluginModule, eventName);
- return true;
- }
- return false;
-}
-
-/**
- * Publishes a registration name that is used to identify dispatched events and
- * can be used with `EventPluginHub.putListener` to register listeners.
- *
- * @param {string} registrationName Registration name to add.
- * @param {object} PluginModule Plugin publishing the event.
- * @private
- */
-function publishRegistrationName(registrationName, pluginModule, eventName) {
- !!EventPluginRegistry.registrationNameModules[registrationName] ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginHub: More than one plugin attempted to publish the same registration name, `%s`.', registrationName) : _prodInvariant('100', registrationName) : void 0;
- EventPluginRegistry.registrationNameModules[registrationName] = pluginModule;
- EventPluginRegistry.registrationNameDependencies[registrationName] = pluginModule.eventTypes[eventName].dependencies;
-
- if (process.env.NODE_ENV !== 'production') {
- var lowerCasedName = registrationName.toLowerCase();
- EventPluginRegistry.possibleRegistrationNames[lowerCasedName] = registrationName;
-
- if (registrationName === 'onDoubleClick') {
- EventPluginRegistry.possibleRegistrationNames.ondblclick = registrationName;
- }
- }
-}
-
-/**
- * Registers plugins so that they can extract and dispatch events.
- *
- * @see {EventPluginHub}
- */
-var EventPluginRegistry = {
-
- /**
- * Ordered list of injected plugins.
- */
- plugins: [],
-
- /**
- * Mapping from event name to dispatch config
- */
- eventNameDispatchConfigs: {},
-
- /**
- * Mapping from registration name to plugin module
- */
- registrationNameModules: {},
-
- /**
- * Mapping from registration name to event name
- */
- registrationNameDependencies: {},
-
- /**
- * Mapping from lowercase registration names to the properly cased version,
- * used to warn in the case of missing event handlers. Available
- * only in __DEV__.
- * @type {Object}
- */
- possibleRegistrationNames: process.env.NODE_ENV !== 'production' ? {} : null,
- // Trust the developer to only use possibleRegistrationNames in __DEV__
-
- /**
- * Injects an ordering of plugins (by plugin name). This allows the ordering
- * to be decoupled from injection of the actual plugins so that ordering is
- * always deterministic regardless of packaging, on-the-fly injection, etc.
- *
- * @param {array} InjectedEventPluginOrder
- * @internal
- * @see {EventPluginHub.injection.injectEventPluginOrder}
- */
- injectEventPluginOrder: function (injectedEventPluginOrder) {
- !!eventPluginOrder ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginRegistry: Cannot inject event plugin ordering more than once. You are likely trying to load more than one copy of React.') : _prodInvariant('101') : void 0;
- // Clone the ordering so it cannot be dynamically mutated.
- eventPluginOrder = Array.prototype.slice.call(injectedEventPluginOrder);
- recomputePluginOrdering();
- },
-
- /**
- * Injects plugins to be used by `EventPluginHub`. The plugin names must be
- * in the ordering injected by `injectEventPluginOrder`.
- *
- * Plugins can be injected as part of page initialization or on-the-fly.
- *
- * @param {object} injectedNamesToPlugins Map from names to plugin modules.
- * @internal
- * @see {EventPluginHub.injection.injectEventPluginsByName}
- */
- injectEventPluginsByName: function (injectedNamesToPlugins) {
- var isOrderingDirty = false;
- for (var pluginName in injectedNamesToPlugins) {
- if (!injectedNamesToPlugins.hasOwnProperty(pluginName)) {
- continue;
- }
- var pluginModule = injectedNamesToPlugins[pluginName];
- if (!namesToPlugins.hasOwnProperty(pluginName) || namesToPlugins[pluginName] !== pluginModule) {
- !!namesToPlugins[pluginName] ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginRegistry: Cannot inject two different event plugins using the same name, `%s`.', pluginName) : _prodInvariant('102', pluginName) : void 0;
- namesToPlugins[pluginName] = pluginModule;
- isOrderingDirty = true;
- }
- }
- if (isOrderingDirty) {
- recomputePluginOrdering();
- }
- },
-
- /**
- * Looks up the plugin for the supplied event.
- *
- * @param {object} event A synthetic event.
- * @return {?object} The plugin that created the supplied event.
- * @internal
- */
- getPluginModuleForEvent: function (event) {
- var dispatchConfig = event.dispatchConfig;
- if (dispatchConfig.registrationName) {
- return EventPluginRegistry.registrationNameModules[dispatchConfig.registrationName] || null;
- }
- if (dispatchConfig.phasedRegistrationNames !== undefined) {
- // pulling phasedRegistrationNames out of dispatchConfig helps Flow see
- // that it is not undefined.
- var phasedRegistrationNames = dispatchConfig.phasedRegistrationNames;
-
- for (var phase in phasedRegistrationNames) {
- if (!phasedRegistrationNames.hasOwnProperty(phase)) {
- continue;
- }
- var pluginModule = EventPluginRegistry.registrationNameModules[phasedRegistrationNames[phase]];
- if (pluginModule) {
- return pluginModule;
- }
- }
- }
- return null;
- },
-
- /**
- * Exposed for unit testing.
- * @private
- */
- _resetEventPlugins: function () {
- eventPluginOrder = null;
- for (var pluginName in namesToPlugins) {
- if (namesToPlugins.hasOwnProperty(pluginName)) {
- delete namesToPlugins[pluginName];
- }
- }
- EventPluginRegistry.plugins.length = 0;
-
- var eventNameDispatchConfigs = EventPluginRegistry.eventNameDispatchConfigs;
- for (var eventName in eventNameDispatchConfigs) {
- if (eventNameDispatchConfigs.hasOwnProperty(eventName)) {
- delete eventNameDispatchConfigs[eventName];
- }
- }
-
- var registrationNameModules = EventPluginRegistry.registrationNameModules;
- for (var registrationName in registrationNameModules) {
- if (registrationNameModules.hasOwnProperty(registrationName)) {
- delete registrationNameModules[registrationName];
- }
- }
-
- if (process.env.NODE_ENV !== 'production') {
- var possibleRegistrationNames = EventPluginRegistry.possibleRegistrationNames;
- for (var lowerCasedName in possibleRegistrationNames) {
- if (possibleRegistrationNames.hasOwnProperty(lowerCasedName)) {
- delete possibleRegistrationNames[lowerCasedName];
- }
- }
- }
- }
-
-};
-
-module.exports = EventPluginRegistry;
-}).call(this,require('_process'))
-
-},{"./reactProdInvariant":167,"_process":43,"fbjs/lib/invariant":18}],65:[function(require,module,exports){
-(function (process){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-'use strict';
-
-var _prodInvariant = require('./reactProdInvariant');
-
-var ReactErrorUtils = require('./ReactErrorUtils');
-
-var invariant = require('fbjs/lib/invariant');
-var warning = require('fbjs/lib/warning');
-
-/**
- * Injected dependencies:
- */
-
-/**
- * - `ComponentTree`: [required] Module that can convert between React instances
- * and actual node references.
- */
-var ComponentTree;
-var TreeTraversal;
-var injection = {
- injectComponentTree: function (Injected) {
- ComponentTree = Injected;
- if (process.env.NODE_ENV !== 'production') {
- process.env.NODE_ENV !== 'production' ? warning(Injected && Injected.getNodeFromInstance && Injected.getInstanceFromNode, 'EventPluginUtils.injection.injectComponentTree(...): Injected ' + 'module is missing getNodeFromInstance or getInstanceFromNode.') : void 0;
- }
- },
- injectTreeTraversal: function (Injected) {
- TreeTraversal = Injected;
- if (process.env.NODE_ENV !== 'production') {
- process.env.NODE_ENV !== 'production' ? warning(Injected && Injected.isAncestor && Injected.getLowestCommonAncestor, 'EventPluginUtils.injection.injectTreeTraversal(...): Injected ' + 'module is missing isAncestor or getLowestCommonAncestor.') : void 0;
- }
- }
-};
-
-function isEndish(topLevelType) {
- return topLevelType === 'topMouseUp' || topLevelType === 'topTouchEnd' || topLevelType === 'topTouchCancel';
-}
-
-function isMoveish(topLevelType) {
- return topLevelType === 'topMouseMove' || topLevelType === 'topTouchMove';
-}
-function isStartish(topLevelType) {
- return topLevelType === 'topMouseDown' || topLevelType === 'topTouchStart';
-}
-
-var validateEventDispatches;
-if (process.env.NODE_ENV !== 'production') {
- validateEventDispatches = function (event) {
- var dispatchListeners = event._dispatchListeners;
- var dispatchInstances = event._dispatchInstances;
-
- var listenersIsArr = Array.isArray(dispatchListeners);
- var listenersLen = listenersIsArr ? dispatchListeners.length : dispatchListeners ? 1 : 0;
-
- var instancesIsArr = Array.isArray(dispatchInstances);
- var instancesLen = instancesIsArr ? dispatchInstances.length : dispatchInstances ? 1 : 0;
-
- process.env.NODE_ENV !== 'production' ? warning(instancesIsArr === listenersIsArr && instancesLen === listenersLen, 'EventPluginUtils: Invalid `event`.') : void 0;
- };
-}
-
-/**
- * Dispatch the event to the listener.
- * @param {SyntheticEvent} event SyntheticEvent to handle
- * @param {boolean} simulated If the event is simulated (changes exn behavior)
- * @param {function} listener Application-level callback
- * @param {*} inst Internal component instance
- */
-function executeDispatch(event, simulated, listener, inst) {
- var type = event.type || 'unknown-event';
- event.currentTarget = EventPluginUtils.getNodeFromInstance(inst);
- if (simulated) {
- ReactErrorUtils.invokeGuardedCallbackWithCatch(type, listener, event);
- } else {
- ReactErrorUtils.invokeGuardedCallback(type, listener, event);
- }
- event.currentTarget = null;
-}
-
-/**
- * Standard/simple iteration through an event's collected dispatches.
- */
-function executeDispatchesInOrder(event, simulated) {
- var dispatchListeners = event._dispatchListeners;
- var dispatchInstances = event._dispatchInstances;
- if (process.env.NODE_ENV !== 'production') {
- validateEventDispatches(event);
- }
- if (Array.isArray(dispatchListeners)) {
- for (var i = 0; i < dispatchListeners.length; i++) {
- if (event.isPropagationStopped()) {
- break;
- }
- // Listeners and Instances are two parallel arrays that are always in sync.
- executeDispatch(event, simulated, dispatchListeners[i], dispatchInstances[i]);
- }
- } else if (dispatchListeners) {
- executeDispatch(event, simulated, dispatchListeners, dispatchInstances);
- }
- event._dispatchListeners = null;
- event._dispatchInstances = null;
-}
-
-/**
- * Standard/simple iteration through an event's collected dispatches, but stops
- * at the first dispatch execution returning true, and returns that id.
- *
- * @return {?string} id of the first dispatch execution who's listener returns
- * true, or null if no listener returned true.
- */
-function executeDispatchesInOrderStopAtTrueImpl(event) {
- var dispatchListeners = event._dispatchListeners;
- var dispatchInstances = event._dispatchInstances;
- if (process.env.NODE_ENV !== 'production') {
- validateEventDispatches(event);
- }
- if (Array.isArray(dispatchListeners)) {
- for (var i = 0; i < dispatchListeners.length; i++) {
- if (event.isPropagationStopped()) {
- break;
- }
- // Listeners and Instances are two parallel arrays that are always in sync.
- if (dispatchListeners[i](event, dispatchInstances[i])) {
- return dispatchInstances[i];
- }
- }
- } else if (dispatchListeners) {
- if (dispatchListeners(event, dispatchInstances)) {
- return dispatchInstances;
- }
- }
- return null;
-}
-
-/**
- * @see executeDispatchesInOrderStopAtTrueImpl
- */
-function executeDispatchesInOrderStopAtTrue(event) {
- var ret = executeDispatchesInOrderStopAtTrueImpl(event);
- event._dispatchInstances = null;
- event._dispatchListeners = null;
- return ret;
-}
-
-/**
- * Execution of a "direct" dispatch - there must be at most one dispatch
- * accumulated on the event or it is considered an error. It doesn't really make
- * sense for an event with multiple dispatches (bubbled) to keep track of the
- * return values at each dispatch execution, but it does tend to make sense when
- * dealing with "direct" dispatches.
- *
- * @return {*} The return value of executing the single dispatch.
- */
-function executeDirectDispatch(event) {
- if (process.env.NODE_ENV !== 'production') {
- validateEventDispatches(event);
- }
- var dispatchListener = event._dispatchListeners;
- var dispatchInstance = event._dispatchInstances;
- !!Array.isArray(dispatchListener) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'executeDirectDispatch(...): Invalid `event`.') : _prodInvariant('103') : void 0;
- event.currentTarget = dispatchListener ? EventPluginUtils.getNodeFromInstance(dispatchInstance) : null;
- var res = dispatchListener ? dispatchListener(event) : null;
- event.currentTarget = null;
- event._dispatchListeners = null;
- event._dispatchInstances = null;
- return res;
-}
-
-/**
- * @param {SyntheticEvent} event
- * @return {boolean} True iff number of dispatches accumulated is greater than 0.
- */
-function hasDispatches(event) {
- return !!event._dispatchListeners;
-}
-
-/**
- * General utilities that are useful in creating custom Event Plugins.
- */
-var EventPluginUtils = {
- isEndish: isEndish,
- isMoveish: isMoveish,
- isStartish: isStartish,
-
- executeDirectDispatch: executeDirectDispatch,
- executeDispatchesInOrder: executeDispatchesInOrder,
- executeDispatchesInOrderStopAtTrue: executeDispatchesInOrderStopAtTrue,
- hasDispatches: hasDispatches,
-
- getInstanceFromNode: function (node) {
- return ComponentTree.getInstanceFromNode(node);
- },
- getNodeFromInstance: function (node) {
- return ComponentTree.getNodeFromInstance(node);
- },
- isAncestor: function (a, b) {
- return TreeTraversal.isAncestor(a, b);
- },
- getLowestCommonAncestor: function (a, b) {
- return TreeTraversal.getLowestCommonAncestor(a, b);
- },
- getParentInstance: function (inst) {
- return TreeTraversal.getParentInstance(inst);
- },
- traverseTwoPhase: function (target, fn, arg) {
- return TreeTraversal.traverseTwoPhase(target, fn, arg);
- },
- traverseEnterLeave: function (from, to, fn, argFrom, argTo) {
- return TreeTraversal.traverseEnterLeave(from, to, fn, argFrom, argTo);
- },
-
- injection: injection
-};
-
-module.exports = EventPluginUtils;
-}).call(this,require('_process'))
-
-},{"./ReactErrorUtils":100,"./reactProdInvariant":167,"_process":43,"fbjs/lib/invariant":18,"fbjs/lib/warning":25}],66:[function(require,module,exports){
-(function (process){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-'use strict';
-
-var EventPluginHub = require('./EventPluginHub');
-var EventPluginUtils = require('./EventPluginUtils');
-
-var accumulateInto = require('./accumulateInto');
-var forEachAccumulated = require('./forEachAccumulated');
-var warning = require('fbjs/lib/warning');
-
-var getListener = EventPluginHub.getListener;
-
-/**
- * Some event types have a notion of different registration names for different
- * "phases" of propagation. This finds listeners by a given phase.
- */
-function listenerAtPhase(inst, event, propagationPhase) {
- var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];
- return getListener(inst, registrationName);
-}
-
-/**
- * Tags a `SyntheticEvent` with dispatched listeners. Creating this function
- * here, allows us to not have to bind or create functions for each event.
- * Mutating the event's members allows us to not have to create a wrapping
- * "dispatch" object that pairs the event with the listener.
- */
-function accumulateDirectionalDispatches(inst, phase, event) {
- if (process.env.NODE_ENV !== 'production') {
- process.env.NODE_ENV !== 'production' ? warning(inst, 'Dispatching inst must not be null') : void 0;
- }
- var listener = listenerAtPhase(inst, event, phase);
- if (listener) {
- event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);
- event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);
- }
-}
-
-/**
- * Collect dispatches (must be entirely collected before dispatching - see unit
- * tests). Lazily allocate the array to conserve memory. We must loop through
- * each event and perform the traversal for each one. We cannot perform a
- * single traversal for the entire collection of events because each event may
- * have a different target.
- */
-function accumulateTwoPhaseDispatchesSingle(event) {
- if (event && event.dispatchConfig.phasedRegistrationNames) {
- EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);
- }
-}
-
-/**
- * Same as `accumulateTwoPhaseDispatchesSingle`, but skips over the targetID.
- */
-function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {
- if (event && event.dispatchConfig.phasedRegistrationNames) {
- var targetInst = event._targetInst;
- var parentInst = targetInst ? EventPluginUtils.getParentInstance(targetInst) : null;
- EventPluginUtils.traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);
- }
-}
-
-/**
- * Accumulates without regard to direction, does not look for phased
- * registration names. Same as `accumulateDirectDispatchesSingle` but without
- * requiring that the `dispatchMarker` be the same as the dispatched ID.
- */
-function accumulateDispatches(inst, ignoredDirection, event) {
- if (event && event.dispatchConfig.registrationName) {
- var registrationName = event.dispatchConfig.registrationName;
- var listener = getListener(inst, registrationName);
- if (listener) {
- event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);
- event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);
- }
- }
-}
-
-/**
- * Accumulates dispatches on an `SyntheticEvent`, but only for the
- * `dispatchMarker`.
- * @param {SyntheticEvent} event
- */
-function accumulateDirectDispatchesSingle(event) {
- if (event && event.dispatchConfig.registrationName) {
- accumulateDispatches(event._targetInst, null, event);
- }
-}
-
-function accumulateTwoPhaseDispatches(events) {
- forEachAccumulated(events, accumulateTwoPhaseDispatchesSingle);
-}
-
-function accumulateTwoPhaseDispatchesSkipTarget(events) {
- forEachAccumulated(events, accumulateTwoPhaseDispatchesSingleSkipTarget);
-}
-
-function accumulateEnterLeaveDispatches(leave, enter, from, to) {
- EventPluginUtils.traverseEnterLeave(from, to, accumulateDispatches, leave, enter);
-}
-
-function accumulateDirectDispatches(events) {
- forEachAccumulated(events, accumulateDirectDispatchesSingle);
-}
-
-/**
- * A small set of propagation patterns, each of which will accept a small amount
- * of information, and generate a set of "dispatch ready event objects" - which
- * are sets of events that have already been annotated with a set of dispatched
- * listener functions/ids. The API is designed this way to discourage these
- * propagation strategies from actually executing the dispatches, since we
- * always want to collect the entire set of dispatches before executing event a
- * single one.
- *
- * @constructor EventPropagators
- */
-var EventPropagators = {
- accumulateTwoPhaseDispatches: accumulateTwoPhaseDispatches,
- accumulateTwoPhaseDispatchesSkipTarget: accumulateTwoPhaseDispatchesSkipTarget,
- accumulateDirectDispatches: accumulateDirectDispatches,
- accumulateEnterLeaveDispatches: accumulateEnterLeaveDispatches
-};
-
-module.exports = EventPropagators;
-}).call(this,require('_process'))
-
-},{"./EventPluginHub":63,"./EventPluginUtils":65,"./accumulateInto":144,"./forEachAccumulated":152,"_process":43,"fbjs/lib/warning":25}],67:[function(require,module,exports){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-'use strict';
-
-var _assign = require('object-assign');
-
-var PooledClass = require('./PooledClass');
-
-var getTextContentAccessor = require('./getTextContentAccessor');
-
-/**
- * This helper class stores information about text content of a target node,
- * allowing comparison of content before and after a given event.
- *
- * Identify the node where selection currently begins, then observe
- * both its text content and its current position in the DOM. Since the
- * browser may natively replace the target node during composition, we can
- * use its position to find its replacement.
- *
- * @param {DOMEventTarget} root
- */
-function FallbackCompositionState(root) {
- this._root = root;
- this._startText = this.getText();
- this._fallbackText = null;
-}
-
-_assign(FallbackCompositionState.prototype, {
- destructor: function () {
- this._root = null;
- this._startText = null;
- this._fallbackText = null;
- },
-
- /**
- * Get current text of input.
- *
- * @return {string}
- */
- getText: function () {
- if ('value' in this._root) {
- return this._root.value;
- }
- return this._root[getTextContentAccessor()];
- },
-
- /**
- * Determine the differing substring between the initially stored
- * text content and the current content.
- *
- * @return {string}
- */
- getData: function () {
- if (this._fallbackText) {
- return this._fallbackText;
- }
-
- var start;
- var startValue = this._startText;
- var startLength = startValue.length;
- var end;
- var endValue = this.getText();
- var endLength = endValue.length;
-
- for (start = 0; start < startLength; start++) {
- if (startValue[start] !== endValue[start]) {
- break;
- }
- }
-
- var minEnd = startLength - start;
- for (end = 1; end <= minEnd; end++) {
- if (startValue[startLength - end] !== endValue[endLength - end]) {
- break;
- }
- }
-
- var sliceTail = end > 1 ? 1 - end : undefined;
- this._fallbackText = endValue.slice(start, sliceTail);
- return this._fallbackText;
- }
-});
-
-PooledClass.addPoolingTo(FallbackCompositionState);
-
-module.exports = FallbackCompositionState;
-},{"./PooledClass":71,"./getTextContentAccessor":161,"object-assign":42}],68:[function(require,module,exports){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-'use strict';
-
-var DOMProperty = require('./DOMProperty');
-
-var MUST_USE_PROPERTY = DOMProperty.injection.MUST_USE_PROPERTY;
-var HAS_BOOLEAN_VALUE = DOMProperty.injection.HAS_BOOLEAN_VALUE;
-var HAS_NUMERIC_VALUE = DOMProperty.injection.HAS_NUMERIC_VALUE;
-var HAS_POSITIVE_NUMERIC_VALUE = DOMProperty.injection.HAS_POSITIVE_NUMERIC_VALUE;
-var HAS_OVERLOADED_BOOLEAN_VALUE = DOMProperty.injection.HAS_OVERLOADED_BOOLEAN_VALUE;
-
-var HTMLDOMPropertyConfig = {
- isCustomAttribute: RegExp.prototype.test.bind(new RegExp('^(data|aria)-[' + DOMProperty.ATTRIBUTE_NAME_CHAR + ']*$')),
- Properties: {
- /**
- * Standard Properties
- */
- accept: 0,
- acceptCharset: 0,
- accessKey: 0,
- action: 0,
- allowFullScreen: HAS_BOOLEAN_VALUE,
- allowTransparency: 0,
- alt: 0,
- // specifies target context for links with `preload` type
- as: 0,
- async: HAS_BOOLEAN_VALUE,
- autoComplete: 0,
- // autoFocus is polyfilled/normalized by AutoFocusUtils
- // autoFocus: HAS_BOOLEAN_VALUE,
- autoPlay: HAS_BOOLEAN_VALUE,
- capture: HAS_BOOLEAN_VALUE,
- cellPadding: 0,
- cellSpacing: 0,
- charSet: 0,
- challenge: 0,
- checked: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
- cite: 0,
- classID: 0,
- className: 0,
- cols: HAS_POSITIVE_NUMERIC_VALUE,
- colSpan: 0,
- content: 0,
- contentEditable: 0,
- contextMenu: 0,
- controls: HAS_BOOLEAN_VALUE,
- coords: 0,
- crossOrigin: 0,
- data: 0, // For `<object />` acts as `src`.
- dateTime: 0,
- 'default': HAS_BOOLEAN_VALUE,
- defer: HAS_BOOLEAN_VALUE,
- dir: 0,
- disabled: HAS_BOOLEAN_VALUE,
- download: HAS_OVERLOADED_BOOLEAN_VALUE,
- draggable: 0,
- encType: 0,
- form: 0,
- formAction: 0,
- formEncType: 0,
- formMethod: 0,
- formNoValidate: HAS_BOOLEAN_VALUE,
- formTarget: 0,
- frameBorder: 0,
- headers: 0,
- height: 0,
- hidden: HAS_BOOLEAN_VALUE,
- high: 0,
- href: 0,
- hrefLang: 0,
- htmlFor: 0,
- httpEquiv: 0,
- icon: 0,
- id: 0,
- inputMode: 0,
- integrity: 0,
- is: 0,
- keyParams: 0,
- keyType: 0,
- kind: 0,
- label: 0,
- lang: 0,
- list: 0,
- loop: HAS_BOOLEAN_VALUE,
- low: 0,
- manifest: 0,
- marginHeight: 0,
- marginWidth: 0,
- max: 0,
- maxLength: 0,
- media: 0,
- mediaGroup: 0,
- method: 0,
- min: 0,
- minLength: 0,
- // Caution; `option.selected` is not updated if `select.multiple` is
- // disabled with `removeAttribute`.
- multiple: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
- muted: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
- name: 0,
- nonce: 0,
- noValidate: HAS_BOOLEAN_VALUE,
- open: HAS_BOOLEAN_VALUE,
- optimum: 0,
- pattern: 0,
- placeholder: 0,
- playsInline: HAS_BOOLEAN_VALUE,
- poster: 0,
- preload: 0,
- profile: 0,
- radioGroup: 0,
- readOnly: HAS_BOOLEAN_VALUE,
- referrerPolicy: 0,
- rel: 0,
- required: HAS_BOOLEAN_VALUE,
- reversed: HAS_BOOLEAN_VALUE,
- role: 0,
- rows: HAS_POSITIVE_NUMERIC_VALUE,
- rowSpan: HAS_NUMERIC_VALUE,
- sandbox: 0,
- scope: 0,
- scoped: HAS_BOOLEAN_VALUE,
- scrolling: 0,
- seamless: HAS_BOOLEAN_VALUE,
- selected: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
- shape: 0,
- size: HAS_POSITIVE_NUMERIC_VALUE,
- sizes: 0,
- span: HAS_POSITIVE_NUMERIC_VALUE,
- spellCheck: 0,
- src: 0,
- srcDoc: 0,
- srcLang: 0,
- srcSet: 0,
- start: HAS_NUMERIC_VALUE,
- step: 0,
- style: 0,
- summary: 0,
- tabIndex: 0,
- target: 0,
- title: 0,
- // Setting .type throws on non-<input> tags
- type: 0,
- useMap: 0,
- value: 0,
- width: 0,
- wmode: 0,
- wrap: 0,
-
- /**
- * RDFa Properties
- */
- about: 0,
- datatype: 0,
- inlist: 0,
- prefix: 0,
- // property is also supported for OpenGraph in meta tags.
- property: 0,
- resource: 0,
- 'typeof': 0,
- vocab: 0,
-
- /**
- * Non-standard Properties
- */
- // autoCapitalize and autoCorrect are supported in Mobile Safari for
- // keyboard hints.
- autoCapitalize: 0,
- autoCorrect: 0,
- // autoSave allows WebKit/Blink to persist values of input fields on page reloads
- autoSave: 0,
- // color is for Safari mask-icon link
- color: 0,
- // itemProp, itemScope, itemType are for
- // Microdata support. See http://schema.org/docs/gs.html
- itemProp: 0,
- itemScope: HAS_BOOLEAN_VALUE,
- itemType: 0,
- // itemID and itemRef are for Microdata support as well but
- // only specified in the WHATWG spec document. See
- // https://html.spec.whatwg.org/multipage/microdata.html#microdata-dom-api
- itemID: 0,
- itemRef: 0,
- // results show looking glass icon and recent searches on input
- // search fields in WebKit/Blink
- results: 0,
- // IE-only attribute that specifies security restrictions on an iframe
- // as an alternative to the sandbox attribute on IE<10
- security: 0,
- // IE-only attribute that controls focus behavior
- unselectable: 0
- },
- DOMAttributeNames: {
- acceptCharset: 'accept-charset',
- className: 'class',
- htmlFor: 'for',
- httpEquiv: 'http-equiv'
- },
- DOMPropertyNames: {}
-};
-
-module.exports = HTMLDOMPropertyConfig;
-},{"./DOMProperty":58}],69:[function(require,module,exports){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- *
- */
-
-'use strict';
-
-/**
- * Escape and wrap key so it is safe to use as a reactid
- *
- * @param {string} key to be escaped.
- * @return {string} the escaped key.
- */
-
-function escape(key) {
- var escapeRegex = /[=:]/g;
- var escaperLookup = {
- '=': '=0',
- ':': '=2'
- };
- var escapedString = ('' + key).replace(escapeRegex, function (match) {
- return escaperLookup[match];
- });
-
- return '$' + escapedString;
-}
-
-/**
- * Unescape and unwrap key for human-readable display
- *
- * @param {string} key to unescape.
- * @return {string} the unescaped key.
- */
-function unescape(key) {
- var unescapeRegex = /(=0|=2)/g;
- var unescaperLookup = {
- '=0': '=',
- '=2': ':'
- };
- var keySubstring = key[0] === '.' && key[1] === '$' ? key.substring(2) : key.substring(1);
-
- return ('' + keySubstring).replace(unescapeRegex, function (match) {
- return unescaperLookup[match];
- });
-}
-
-var KeyEscapeUtils = {
- escape: escape,
- unescape: unescape
-};
-
-module.exports = KeyEscapeUtils;
-},{}],70:[function(require,module,exports){
-(function (process){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-'use strict';
-
-var _prodInvariant = require('./reactProdInvariant');
-
-var React = require('react/lib/React');
-var ReactPropTypesSecret = require('./ReactPropTypesSecret');
-
-var invariant = require('fbjs/lib/invariant');
-var warning = require('fbjs/lib/warning');
-
-var hasReadOnlyValue = {
- 'button': true,
- 'checkbox': true,
- 'image': true,
- 'hidden': true,
- 'radio': true,
- 'reset': true,
- 'submit': true
-};
-
-function _assertSingleLink(inputProps) {
- !(inputProps.checkedLink == null || inputProps.valueLink == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Cannot provide a checkedLink and a valueLink. If you want to use checkedLink, you probably don\'t want to use valueLink and vice versa.') : _prodInvariant('87') : void 0;
-}
-function _assertValueLink(inputProps) {
- _assertSingleLink(inputProps);
- !(inputProps.value == null && inputProps.onChange == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Cannot provide a valueLink and a value or onChange event. If you want to use value or onChange, you probably don\'t want to use valueLink.') : _prodInvariant('88') : void 0;
-}
-
-function _assertCheckedLink(inputProps) {
- _assertSingleLink(inputProps);
- !(inputProps.checked == null && inputProps.onChange == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Cannot provide a checkedLink and a checked property or onChange event. If you want to use checked or onChange, you probably don\'t want to use checkedLink') : _prodInvariant('89') : void 0;
-}
-
-var propTypes = {
- value: function (props, propName, componentName) {
- if (!props[propName] || hasReadOnlyValue[props.type] || props.onChange || props.readOnly || props.disabled) {
- return null;
- }
- return new Error('You provided a `value` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultValue`. Otherwise, ' + 'set either `onChange` or `readOnly`.');
- },
- checked: function (props, propName, componentName) {
- if (!props[propName] || props.onChange || props.readOnly || props.disabled) {
- return null;
- }
- return new Error('You provided a `checked` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultChecked`. Otherwise, ' + 'set either `onChange` or `readOnly`.');
- },
- onChange: React.PropTypes.func
-};
-
-var loggedTypeFailures = {};
-function getDeclarationErrorAddendum(owner) {
- if (owner) {
- var name = owner.getName();
- if (name) {
- return ' Check the render method of `' + name + '`.';
- }
- }
- return '';
-}
-
-/**
- * Provide a linked `value` attribute for controlled forms. You should not use
- * this outside of the ReactDOM controlled form components.
- */
-var LinkedValueUtils = {
- checkPropTypes: function (tagName, props, owner) {
- for (var propName in propTypes) {
- if (propTypes.hasOwnProperty(propName)) {
- var error = propTypes[propName](props, propName, tagName, 'prop', null, ReactPropTypesSecret);
- }
- if (error instanceof Error && !(error.message in loggedTypeFailures)) {
- // Only monitor this failure once because there tends to be a lot of the
- // same error.
- loggedTypeFailures[error.message] = true;
-
- var addendum = getDeclarationErrorAddendum(owner);
- process.env.NODE_ENV !== 'production' ? warning(false, 'Failed form propType: %s%s', error.message, addendum) : void 0;
- }
- }
- },
-
- /**
- * @param {object} inputProps Props for form component
- * @return {*} current value of the input either from value prop or link.
- */
- getValue: function (inputProps) {
- if (inputProps.valueLink) {
- _assertValueLink(inputProps);
- return inputProps.valueLink.value;
- }
- return inputProps.value;
- },
-
- /**
- * @param {object} inputProps Props for form component
- * @return {*} current checked status of the input either from checked prop
- * or link.
- */
- getChecked: function (inputProps) {
- if (inputProps.checkedLink) {
- _assertCheckedLink(inputProps);
- return inputProps.checkedLink.value;
- }
- return inputProps.checked;
- },
-
- /**
- * @param {object} inputProps Props for form component
- * @param {SyntheticEvent} event change event to handle
- */
- executeOnChange: function (inputProps, event) {
- if (inputProps.valueLink) {
- _assertValueLink(inputProps);
- return inputProps.valueLink.requestChange(event.target.value);
- } else if (inputProps.checkedLink) {
- _assertCheckedLink(inputProps);
- return inputProps.checkedLink.requestChange(event.target.checked);
- } else if (inputProps.onChange) {
- return inputProps.onChange.call(undefined, event);
- }
- }
-};
-
-module.exports = LinkedValueUtils;
-}).call(this,require('_process'))
-
-},{"./ReactPropTypesSecret":117,"./reactProdInvariant":167,"_process":43,"fbjs/lib/invariant":18,"fbjs/lib/warning":25,"react/lib/React":190}],71:[function(require,module,exports){
-(function (process){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- *
- */
-
-'use strict';
-
-var _prodInvariant = require('./reactProdInvariant');
-
-var invariant = require('fbjs/lib/invariant');
-
-/**
- * Static poolers. Several custom versions for each potential number of
- * arguments. A completely generic pooler is easy to implement, but would
- * require accessing the `arguments` object. In each of these, `this` refers to
- * the Class itself, not an instance. If any others are needed, simply add them
- * here, or in their own files.
- */
-var oneArgumentPooler = function (copyFieldsFrom) {
- var Klass = this;
- if (Klass.instancePool.length) {
- var instance = Klass.instancePool.pop();
- Klass.call(instance, copyFieldsFrom);
- return instance;
- } else {
- return new Klass(copyFieldsFrom);
- }
-};
-
-var twoArgumentPooler = function (a1, a2) {
- var Klass = this;
- if (Klass.instancePool.length) {
- var instance = Klass.instancePool.pop();
- Klass.call(instance, a1, a2);
- return instance;
- } else {
- return new Klass(a1, a2);
- }
-};
-
-var threeArgumentPooler = function (a1, a2, a3) {
- var Klass = this;
- if (Klass.instancePool.length) {
- var instance = Klass.instancePool.pop();
- Klass.call(instance, a1, a2, a3);
- return instance;
- } else {
- return new Klass(a1, a2, a3);
- }
-};
-
-var fourArgumentPooler = function (a1, a2, a3, a4) {
- var Klass = this;
- if (Klass.instancePool.length) {
- var instance = Klass.instancePool.pop();
- Klass.call(instance, a1, a2, a3, a4);
- return instance;
- } else {
- return new Klass(a1, a2, a3, a4);
- }
-};
-
-var standardReleaser = function (instance) {
- var Klass = this;
- !(instance instanceof Klass) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Trying to release an instance into a pool of a different type.') : _prodInvariant('25') : void 0;
- instance.destructor();
- if (Klass.instancePool.length < Klass.poolSize) {
- Klass.instancePool.push(instance);
- }
-};
-
-var DEFAULT_POOL_SIZE = 10;
-var DEFAULT_POOLER = oneArgumentPooler;
-
-/**
- * Augments `CopyConstructor` to be a poolable class, augmenting only the class
- * itself (statically) not adding any prototypical fields. Any CopyConstructor
- * you give this may have a `poolSize` property, and will look for a
- * prototypical `destructor` on instances.
- *
- * @param {Function} CopyConstructor Constructor that can be used to reset.
- * @param {Function} pooler Customizable pooler.
- */
-var addPoolingTo = function (CopyConstructor, pooler) {
- // Casting as any so that flow ignores the actual implementation and trusts
- // it to match the type we declared
- var NewKlass = CopyConstructor;
- NewKlass.instancePool = [];
- NewKlass.getPooled = pooler || DEFAULT_POOLER;
- if (!NewKlass.poolSize) {
- NewKlass.poolSize = DEFAULT_POOL_SIZE;
- }
- NewKlass.release = standardReleaser;
- return NewKlass;
-};
-
-var PooledClass = {
- addPoolingTo: addPoolingTo,
- oneArgumentPooler: oneArgumentPooler,
- twoArgumentPooler: twoArgumentPooler,
- threeArgumentPooler: threeArgumentPooler,
- fourArgumentPooler: fourArgumentPooler
-};
-
-module.exports = PooledClass;
-}).call(this,require('_process'))
-
-},{"./reactProdInvariant":167,"_process":43,"fbjs/lib/invariant":18}],72:[function(require,module,exports){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-'use strict';
-
-var _assign = require('object-assign');
-
-var EventPluginRegistry = require('./EventPluginRegistry');
-var ReactEventEmitterMixin = require('./ReactEventEmitterMixin');
-var ViewportMetrics = require('./ViewportMetrics');
-
-var getVendorPrefixedEventName = require('./getVendorPrefixedEventName');
-var isEventSupported = require('./isEventSupported');
-
-/**
- * Summary of `ReactBrowserEventEmitter` event handling:
- *
- * - Top-level delegation is used to trap most native browser events. This
- * may only occur in the main thread and is the responsibility of
- * ReactEventListener, which is injected and can therefore support pluggable
- * event sources. This is the only work that occurs in the main thread.
- *
- * - We normalize and de-duplicate events to account for browser quirks. This
- * may be done in the worker thread.
- *
- * - Forward these native events (with the associated top-level type used to
- * trap it) to `EventPluginHub`, which in turn will ask plugins if they want
- * to extract any synthetic events.
- *
- * - The `EventPluginHub` will then process each event by annotating them with
- * "dispatches", a sequence of listeners and IDs that care about that event.
- *
- * - The `EventPluginHub` then dispatches the events.
- *
- * Overview of React and the event system:
- *
- * +------------+ .
- * | DOM | .
- * +------------+ .
- * | .
- * v .
- * +------------+ .
- * | ReactEvent | .
- * | Listener | .
- * +------------+ . +-----------+
- * | . +--------+|SimpleEvent|
- * | . | |Plugin |
- * +-----|------+ . v +-----------+
- * | | | . +--------------+ +------------+
- * | +-----------.--->|EventPluginHub| | Event |
- * | | . | | +-----------+ | Propagators|
- * | ReactEvent | . | | |TapEvent | |------------|
- * | Emitter | . | |<---+|Plugin | |other plugin|
- * | | . | | +-----------+ | utilities |
- * | +-----------.--->| | +------------+
- * | | | . +--------------+
- * +-----|------+ . ^ +-----------+
- * | . | |Enter/Leave|
- * + . +-------+|Plugin |
- * +-------------+ . +-----------+
- * | application | .
- * |-------------| .
- * | | .
- * | | .
- * +-------------+ .
- * .
- * React Core . General Purpose Event Plugin System
- */
-
-var hasEventPageXY;
-var alreadyListeningTo = {};
-var isMonitoringScrollValue = false;
-var reactTopListenersCounter = 0;
-
-// For events like 'submit' which don't consistently bubble (which we trap at a
-// lower node than `document`), binding at `document` would cause duplicate
-// events so we don't include them here
-var topEventMapping = {
- topAbort: 'abort',
- topAnimationEnd: getVendorPrefixedEventName('animationend') || 'animationend',
- topAnimationIteration: getVendorPrefixedEventName('animationiteration') || 'animationiteration',
- topAnimationStart: getVendorPrefixedEventName('animationstart') || 'animationstart',
- topBlur: 'blur',
- topCanPlay: 'canplay',
- topCanPlayThrough: 'canplaythrough',
- topChange: 'change',
- topClick: 'click',
- topCompositionEnd: 'compositionend',
- topCompositionStart: 'compositionstart',
- topCompositionUpdate: 'compositionupdate',
- topContextMenu: 'contextmenu',
- topCopy: 'copy',
- topCut: 'cut',
- topDoubleClick: 'dblclick',
- topDrag: 'drag',
- topDragEnd: 'dragend',
- topDragEnter: 'dragenter',
- topDragExit: 'dragexit',
- topDragLeave: 'dragleave',
- topDragOver: 'dragover',
- topDragStart: 'dragstart',
- topDrop: 'drop',
- topDurationChange: 'durationchange',
- topEmptied: 'emptied',
- topEncrypted: 'encrypted',
- topEnded: 'ended',
- topError: 'error',
- topFocus: 'focus',
- topInput: 'input',
- topKeyDown: 'keydown',
- topKeyPress: 'keypress',
- topKeyUp: 'keyup',
- topLoadedData: 'loadeddata',
- topLoadedMetadata: 'loadedmetadata',
- topLoadStart: 'loadstart',
- topMouseDown: 'mousedown',
- topMouseMove: 'mousemove',
- topMouseOut: 'mouseout',
- topMouseOver: 'mouseover',
- topMouseUp: 'mouseup',
- topPaste: 'paste',
- topPause: 'pause',
- topPlay: 'play',
- topPlaying: 'playing',
- topProgress: 'progress',
- topRateChange: 'ratechange',
- topScroll: 'scroll',
- topSeeked: 'seeked',
- topSeeking: 'seeking',
- topSelectionChange: 'selectionchange',
- topStalled: 'stalled',
- topSuspend: 'suspend',
- topTextInput: 'textInput',
- topTimeUpdate: 'timeupdate',
- topTouchCancel: 'touchcancel',
- topTouchEnd: 'touchend',
- topTouchMove: 'touchmove',
- topTouchStart: 'touchstart',
- topTransitionEnd: getVendorPrefixedEventName('transitionend') || 'transitionend',
- topVolumeChange: 'volumechange',
- topWaiting: 'waiting',
- topWheel: 'wheel'
-};
-
-/**
- * To ensure no conflicts with other potential React instances on the page
- */
-var topListenersIDKey = '_reactListenersID' + String(Math.random()).slice(2);
-
-function getListeningForDocument(mountAt) {
- // In IE8, `mountAt` is a host object and doesn't have `hasOwnProperty`
- // directly.
- if (!Object.prototype.hasOwnProperty.call(mountAt, topListenersIDKey)) {
- mountAt[topListenersIDKey] = reactTopListenersCounter++;
- alreadyListeningTo[mountAt[topListenersIDKey]] = {};
- }
- return alreadyListeningTo[mountAt[topListenersIDKey]];
-}
-
-/**
- * `ReactBrowserEventEmitter` is used to attach top-level event listeners. For
- * example:
- *
- * EventPluginHub.putListener('myID', 'onClick', myFunction);
- *
- * This would allocate a "registration" of `('onClick', myFunction)` on 'myID'.
- *
- * @internal
- */
-var ReactBrowserEventEmitter = _assign({}, ReactEventEmitterMixin, {
-
- /**
- * Injectable event backend
- */
- ReactEventListener: null,
-
- injection: {
- /**
- * @param {object} ReactEventListener
- */
- injectReactEventListener: function (ReactEventListener) {
- ReactEventListener.setHandleTopLevel(ReactBrowserEventEmitter.handleTopLevel);
- ReactBrowserEventEmitter.ReactEventListener = ReactEventListener;
- }
- },
-
- /**
- * Sets whether or not any created callbacks should be enabled.
- *
- * @param {boolean} enabled True if callbacks should be enabled.
- */
- setEnabled: function (enabled) {
- if (ReactBrowserEventEmitter.ReactEventListener) {
- ReactBrowserEventEmitter.ReactEventListener.setEnabled(enabled);
- }
- },
-
- /**
- * @return {boolean} True if callbacks are enabled.
- */
- isEnabled: function () {
- return !!(ReactBrowserEventEmitter.ReactEventListener && ReactBrowserEventEmitter.ReactEventListener.isEnabled());
- },
-
- /**
- * We listen for bubbled touch events on the document object.
- *
- * Firefox v8.01 (and possibly others) exhibited strange behavior when
- * mounting `onmousemove` events at some node that was not the document
- * element. The symptoms were that if your mouse is not moving over something
- * contained within that mount point (for example on the background) the
- * top-level listeners for `onmousemove` won't be called. However, if you
- * register the `mousemove` on the document object, then it will of course
- * catch all `mousemove`s. This along with iOS quirks, justifies restricting
- * top-level listeners to the document object only, at least for these
- * movement types of events and possibly all events.
- *
- * @see http://www.quirksmode.org/blog/archives/2010/09/click_event_del.html
- *
- * Also, `keyup`/`keypress`/`keydown` do not bubble to the window on IE, but
- * they bubble to document.
- *
- * @param {string} registrationName Name of listener (e.g. `onClick`).
- * @param {object} contentDocumentHandle Document which owns the container
- */
- listenTo: function (registrationName, contentDocumentHandle) {
- var mountAt = contentDocumentHandle;
- var isListening = getListeningForDocument(mountAt);
- var dependencies = EventPluginRegistry.registrationNameDependencies[registrationName];
-
- for (var i = 0; i < dependencies.length; i++) {
- var dependency = dependencies[i];
- if (!(isListening.hasOwnProperty(dependency) && isListening[dependency])) {
- if (dependency === 'topWheel') {
- if (isEventSupported('wheel')) {
- ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent('topWheel', 'wheel', mountAt);
- } else if (isEventSupported('mousewheel')) {
- ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent('topWheel', 'mousewheel', mountAt);
- } else {
- // Firefox needs to capture a different mouse scroll event.
- // @see http://www.quirksmode.org/dom/events/tests/scroll.html
- ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent('topWheel', 'DOMMouseScroll', mountAt);
- }
- } else if (dependency === 'topScroll') {
-
- if (isEventSupported('scroll', true)) {
- ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent('topScroll', 'scroll', mountAt);
- } else {
- ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent('topScroll', 'scroll', ReactBrowserEventEmitter.ReactEventListener.WINDOW_HANDLE);
- }
- } else if (dependency === 'topFocus' || dependency === 'topBlur') {
-
- if (isEventSupported('focus', true)) {
- ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent('topFocus', 'focus', mountAt);
- ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent('topBlur', 'blur', mountAt);
- } else if (isEventSupported('focusin')) {
- // IE has `focusin` and `focusout` events which bubble.
- // @see http://www.quirksmode.org/blog/archives/2008/04/delegating_the.html
- ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent('topFocus', 'focusin', mountAt);
- ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent('topBlur', 'focusout', mountAt);
- }
-
- // to make sure blur and focus event listeners are only attached once
- isListening.topBlur = true;
- isListening.topFocus = true;
- } else if (topEventMapping.hasOwnProperty(dependency)) {
- ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(dependency, topEventMapping[dependency], mountAt);
- }
-
- isListening[dependency] = true;
- }
- }
- },
-
- trapBubbledEvent: function (topLevelType, handlerBaseName, handle) {
- return ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelType, handlerBaseName, handle);
- },
-
- trapCapturedEvent: function (topLevelType, handlerBaseName, handle) {
- return ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent(topLevelType, handlerBaseName, handle);
- },
-
- /**
- * Protect against document.createEvent() returning null
- * Some popup blocker extensions appear to do this:
- * https://github.com/facebook/react/issues/6887
- */
- supportsEventPageXY: function () {
- if (!document.createEvent) {
- return false;
- }
- var ev = document.createEvent('MouseEvent');
- return ev != null && 'pageX' in ev;
- },
-
- /**
- * Listens to window scroll and resize events. We cache scroll values so that
- * application code can access them without triggering reflows.
- *
- * ViewportMetrics is only used by SyntheticMouse/TouchEvent and only when
- * pageX/pageY isn't supported (legacy browsers).
- *
- * NOTE: Scroll events do not bubble.
- *
- * @see http://www.quirksmode.org/dom/events/scroll.html
- */
- ensureScrollValueMonitoring: function () {
- if (hasEventPageXY === undefined) {
- hasEventPageXY = ReactBrowserEventEmitter.supportsEventPageXY();
- }
- if (!hasEventPageXY && !isMonitoringScrollValue) {
- var refresh = ViewportMetrics.refreshScrollValues;
- ReactBrowserEventEmitter.ReactEventListener.monitorScrollValue(refresh);
- isMonitoringScrollValue = true;
- }
- }
-
-});
-
-module.exports = ReactBrowserEventEmitter;
-},{"./EventPluginRegistry":64,"./ReactEventEmitterMixin":101,"./ViewportMetrics":143,"./getVendorPrefixedEventName":162,"./isEventSupported":164,"object-assign":42}],73:[function(require,module,exports){
-(function (process){
-/**
- * Copyright 2014-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-'use strict';
-
-var ReactReconciler = require('./ReactReconciler');
-
-var instantiateReactComponent = require('./instantiateReactComponent');
-var KeyEscapeUtils = require('./KeyEscapeUtils');
-var shouldUpdateReactComponent = require('./shouldUpdateReactComponent');
-var traverseAllChildren = require('./traverseAllChildren');
-var warning = require('fbjs/lib/warning');
-
-var ReactComponentTreeHook;
-
-if (typeof process !== 'undefined' && process.env && process.env.NODE_ENV === 'test') {
- // Temporary hack.
- // Inline requires don't work well with Jest:
- // https://github.com/facebook/react/issues/7240
- // Remove the inline requires when we don't need them anymore:
- // https://github.com/facebook/react/pull/7178
- ReactComponentTreeHook = require('react/lib/ReactComponentTreeHook');
-}
-
-function instantiateChild(childInstances, child, name, selfDebugID) {
- // We found a component instance.
- var keyUnique = childInstances[name] === undefined;
- if (process.env.NODE_ENV !== 'production') {
- if (!ReactComponentTreeHook) {
- ReactComponentTreeHook = require('react/lib/ReactComponentTreeHook');
- }
- if (!keyUnique) {
- process.env.NODE_ENV !== 'production' ? warning(false, 'flattenChildren(...): Encountered two children with the same key, ' + '`%s`. Child keys must be unique; when two children share a key, only ' + 'the first child will be used.%s', KeyEscapeUtils.unescape(name), ReactComponentTreeHook.getStackAddendumByID(selfDebugID)) : void 0;
- }
- }
- if (child != null && keyUnique) {
- childInstances[name] = instantiateReactComponent(child, true);
- }
-}
-
-/**
- * ReactChildReconciler provides helpers for initializing or updating a set of
- * children. Its output is suitable for passing it onto ReactMultiChild which
- * does diffed reordering and insertion.
- */
-var ReactChildReconciler = {
- /**
- * Generates a "mount image" for each of the supplied children. In the case
- * of `ReactDOMComponent`, a mount image is a string of markup.
- *
- * @param {?object} nestedChildNodes Nested child maps.
- * @return {?object} A set of child instances.
- * @internal
- */
- instantiateChildren: function (nestedChildNodes, transaction, context, selfDebugID // 0 in production and for roots
- ) {
- if (nestedChildNodes == null) {
- return null;
- }
- var childInstances = {};
-
- if (process.env.NODE_ENV !== 'production') {
- traverseAllChildren(nestedChildNodes, function (childInsts, child, name) {
- return instantiateChild(childInsts, child, name, selfDebugID);
- }, childInstances);
- } else {
- traverseAllChildren(nestedChildNodes, instantiateChild, childInstances);
- }
- return childInstances;
- },
-
- /**
- * Updates the rendered children and returns a new set of children.
- *
- * @param {?object} prevChildren Previously initialized set of children.
- * @param {?object} nextChildren Flat child element maps.
- * @param {ReactReconcileTransaction} transaction
- * @param {object} context
- * @return {?object} A new set of child instances.
- * @internal
- */
- updateChildren: function (prevChildren, nextChildren, mountImages, removedNodes, transaction, hostParent, hostContainerInfo, context, selfDebugID // 0 in production and for roots
- ) {
- // We currently don't have a way to track moves here but if we use iterators
- // instead of for..in we can zip the iterators and check if an item has
- // moved.
- // TODO: If nothing has changed, return the prevChildren object so that we
- // can quickly bailout if nothing has changed.
- if (!nextChildren && !prevChildren) {
- return;
- }
- var name;
- var prevChild;
- for (name in nextChildren) {
- if (!nextChildren.hasOwnProperty(name)) {
- continue;
- }
- prevChild = prevChildren && prevChildren[name];
- var prevElement = prevChild && prevChild._currentElement;
- var nextElement = nextChildren[name];
- if (prevChild != null && shouldUpdateReactComponent(prevElement, nextElement)) {
- ReactReconciler.receiveComponent(prevChild, nextElement, transaction, context);
- nextChildren[name] = prevChild;
- } else {
- if (prevChild) {
- removedNodes[name] = ReactReconciler.getHostNode(prevChild);
- ReactReconciler.unmountComponent(prevChild, false);
- }
- // The child must be instantiated before it's mounted.
- var nextChildInstance = instantiateReactComponent(nextElement, true);
- nextChildren[name] = nextChildInstance;
- // Creating mount image now ensures refs are resolved in right order
- // (see https://github.com/facebook/react/pull/7101 for explanation).
- var nextChildMountImage = ReactReconciler.mountComponent(nextChildInstance, transaction, hostParent, hostContainerInfo, context, selfDebugID);
- mountImages.push(nextChildMountImage);
- }
- }
- // Unmount children that are no longer present.
- for (name in prevChildren) {
- if (prevChildren.hasOwnProperty(name) && !(nextChildren && nextChildren.hasOwnProperty(name))) {
- prevChild = prevChildren[name];
- removedNodes[name] = ReactReconciler.getHostNode(prevChild);
- ReactReconciler.unmountComponent(prevChild, false);
- }
- }
- },
-
- /**
- * Unmounts all rendered children. This should be used to clean up children
- * when this component is unmounted.
- *
- * @param {?object} renderedChildren Previously initialized set of children.
- * @internal
- */
- unmountChildren: function (renderedChildren, safely) {
- for (var name in renderedChildren) {
- if (renderedChildren.hasOwnProperty(name)) {
- var renderedChild = renderedChildren[name];
- ReactReconciler.unmountComponent(renderedChild, safely);
- }
- }
- }
-
-};
-
-module.exports = ReactChildReconciler;
-}).call(this,require('_process'))
-
-},{"./KeyEscapeUtils":69,"./ReactReconciler":119,"./instantiateReactComponent":163,"./shouldUpdateReactComponent":171,"./traverseAllChildren":172,"_process":43,"fbjs/lib/warning":25,"react/lib/ReactComponentTreeHook":194}],74:[function(require,module,exports){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-'use strict';
-
-var DOMChildrenOperations = require('./DOMChildrenOperations');
-var ReactDOMIDOperations = require('./ReactDOMIDOperations');
-
-/**
- * Abstracts away all functionality of the reconciler that requires knowledge of
- * the browser context. TODO: These callers should be refactored to avoid the
- * need for this injection.
- */
-var ReactComponentBrowserEnvironment = {
-
- processChildrenUpdates: ReactDOMIDOperations.dangerouslyProcessChildrenUpdates,
-
- replaceNodeWithMarkup: DOMChildrenOperations.dangerouslyReplaceNodeWithMarkup
-
-};
-
-module.exports = ReactComponentBrowserEnvironment;
-},{"./DOMChildrenOperations":55,"./ReactDOMIDOperations":84}],75:[function(require,module,exports){
-(function (process){
-/**
- * Copyright 2014-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- *
- */
-
-'use strict';
-
-var _prodInvariant = require('./reactProdInvariant');
-
-var invariant = require('fbjs/lib/invariant');
-
-var injected = false;
-
-var ReactComponentEnvironment = {
-
- /**
- * Optionally injectable hook for swapping out mount images in the middle of
- * the tree.
- */
- replaceNodeWithMarkup: null,
-
- /**
- * Optionally injectable hook for processing a queue of child updates. Will
- * later move into MultiChildComponents.
- */
- processChildrenUpdates: null,
-
- injection: {
- injectEnvironment: function (environment) {
- !!injected ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactCompositeComponent: injectEnvironment() can only be called once.') : _prodInvariant('104') : void 0;
- ReactComponentEnvironment.replaceNodeWithMarkup = environment.replaceNodeWithMarkup;
- ReactComponentEnvironment.processChildrenUpdates = environment.processChildrenUpdates;
- injected = true;
- }
- }
-
-};
-
-module.exports = ReactComponentEnvironment;
-}).call(this,require('_process'))
-
-},{"./reactProdInvariant":167,"_process":43,"fbjs/lib/invariant":18}],76:[function(require,module,exports){
-(function (process){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-'use strict';
-
-var _prodInvariant = require('./reactProdInvariant'),
- _assign = require('object-assign');
-
-var React = require('react/lib/React');
-var ReactComponentEnvironment = require('./ReactComponentEnvironment');
-var ReactCurrentOwner = require('react/lib/ReactCurrentOwner');
-var ReactErrorUtils = require('./ReactErrorUtils');
-var ReactInstanceMap = require('./ReactInstanceMap');
-var ReactInstrumentation = require('./ReactInstrumentation');
-var ReactNodeTypes = require('./ReactNodeTypes');
-var ReactReconciler = require('./ReactReconciler');
-
-if (process.env.NODE_ENV !== 'production') {
- var checkReactTypeSpec = require('./checkReactTypeSpec');
-}
-
-var emptyObject = require('fbjs/lib/emptyObject');
-var invariant = require('fbjs/lib/invariant');
-var shallowEqual = require('fbjs/lib/shallowEqual');
-var shouldUpdateReactComponent = require('./shouldUpdateReactComponent');
-var warning = require('fbjs/lib/warning');
-
-var CompositeTypes = {
- ImpureClass: 0,
- PureClass: 1,
- StatelessFunctional: 2
-};
-
-function StatelessComponent(Component) {}
-StatelessComponent.prototype.render = function () {
- var Component = ReactInstanceMap.get(this)._currentElement.type;
- var element = Component(this.props, this.context, this.updater);
- warnIfInvalidElement(Component, element);
- return element;
-};
-
-function warnIfInvalidElement(Component, element) {
- if (process.env.NODE_ENV !== 'production') {
- process.env.NODE_ENV !== 'production' ? warning(element === null || element === false || React.isValidElement(element), '%s(...): A valid React element (or null) must be returned. You may have ' + 'returned undefined, an array or some other invalid object.', Component.displayName || Component.name || 'Component') : void 0;
- process.env.NODE_ENV !== 'production' ? warning(!Component.childContextTypes, '%s(...): childContextTypes cannot be defined on a functional component.', Component.displayName || Component.name || 'Component') : void 0;
- }
-}
-
-function shouldConstruct(Component) {
- return !!(Component.prototype && Component.prototype.isReactComponent);
-}
-
-function isPureComponent(Component) {
- return !!(Component.prototype && Component.prototype.isPureReactComponent);
-}
-
-// Separated into a function to contain deoptimizations caused by try/finally.
-function measureLifeCyclePerf(fn, debugID, timerType) {
- if (debugID === 0) {
- // Top-level wrappers (see ReactMount) and empty components (see
- // ReactDOMEmptyComponent) are invisible to hooks and devtools.
- // Both are implementation details that should go away in the future.
- return fn();
- }
-
- ReactInstrumentation.debugTool.onBeginLifeCycleTimer(debugID, timerType);
- try {
- return fn();
- } finally {
- ReactInstrumentation.debugTool.onEndLifeCycleTimer(debugID, timerType);
- }
-}
-
-/**
- * ------------------ The Life-Cycle of a Composite Component ------------------
- *
- * - constructor: Initialization of state. The instance is now retained.
- * - componentWillMount
- * - render
- * - [children's constructors]
- * - [children's componentWillMount and render]
- * - [children's componentDidMount]
- * - componentDidMount
- *
- * Update Phases:
- * - componentWillReceiveProps (only called if parent updated)
- * - shouldComponentUpdate
- * - componentWillUpdate
- * - render
- * - [children's constructors or receive props phases]
- * - componentDidUpdate
- *
- * - componentWillUnmount
- * - [children's componentWillUnmount]
- * - [children destroyed]
- * - (destroyed): The instance is now blank, released by React and ready for GC.
- *
- * -----------------------------------------------------------------------------
- */
-
-/**
- * An incrementing ID assigned to each component when it is mounted. This is
- * used to enforce the order in which `ReactUpdates` updates dirty components.
- *
- * @private
- */
-var nextMountID = 1;
-
-/**
- * @lends {ReactCompositeComponent.prototype}
- */
-var ReactCompositeComponent = {
-
- /**
- * Base constructor for all composite component.
- *
- * @param {ReactElement} element
- * @final
- * @internal
- */
- construct: function (element) {
- this._currentElement = element;
- this._rootNodeID = 0;
- this._compositeType = null;
- this._instance = null;
- this._hostParent = null;
- this._hostContainerInfo = null;
-
- // See ReactUpdateQueue
- this._updateBatchNumber = null;
- this._pendingElement = null;
- this._pendingStateQueue = null;
- this._pendingReplaceState = false;
- this._pendingForceUpdate = false;
-
- this._renderedNodeType = null;
- this._renderedComponent = null;
- this._context = null;
- this._mountOrder = 0;
- this._topLevelWrapper = null;
-
- // See ReactUpdates and ReactUpdateQueue.
- this._pendingCallbacks = null;
-
- // ComponentWillUnmount shall only be called once
- this._calledComponentWillUnmount = false;
-
- if (process.env.NODE_ENV !== 'production') {
- this._warnedAboutRefsInRender = false;
- }
- },
-
- /**
- * Initializes the component, renders markup, and registers event listeners.
- *
- * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
- * @param {?object} hostParent
- * @param {?object} hostContainerInfo
- * @param {?object} context
- * @return {?string} Rendered markup to be inserted into the DOM.
- * @final
- * @internal
- */
- mountComponent: function (transaction, hostParent, hostContainerInfo, context) {
- var _this = this;
-
- this._context = context;
- this._mountOrder = nextMountID++;
- this._hostParent = hostParent;
- this._hostContainerInfo = hostContainerInfo;
-
- var publicProps = this._currentElement.props;
- var publicContext = this._processContext(context);
-
- var Component = this._currentElement.type;
-
- var updateQueue = transaction.getUpdateQueue();
-
- // Initialize the public class
- var doConstruct = shouldConstruct(Component);
- var inst = this._constructComponent(doConstruct, publicProps, publicContext, updateQueue);
- var renderedElement;
-
- // Support functional components
- if (!doConstruct && (inst == null || inst.render == null)) {
- renderedElement = inst;
- warnIfInvalidElement(Component, renderedElement);
- !(inst === null || inst === false || React.isValidElement(inst)) ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s(...): A valid React element (or null) must be returned. You may have returned undefined, an array or some other invalid object.', Component.displayName || Component.name || 'Component') : _prodInvariant('105', Component.displayName || Component.name || 'Component') : void 0;
- inst = new StatelessComponent(Component);
- this._compositeType = CompositeTypes.StatelessFunctional;
- } else {
- if (isPureComponent(Component)) {
- this._compositeType = CompositeTypes.PureClass;
- } else {
- this._compositeType = CompositeTypes.ImpureClass;
- }
- }
-
- if (process.env.NODE_ENV !== 'production') {
- // This will throw later in _renderValidatedComponent, but add an early
- // warning now to help debugging
- if (inst.render == null) {
- process.env.NODE_ENV !== 'production' ? warning(false, '%s(...): No `render` method found on the returned component ' + 'instance: you may have forgotten to define `render`.', Component.displayName || Component.name || 'Component') : void 0;
- }
-
- var propsMutated = inst.props !== publicProps;
- var componentName = Component.displayName || Component.name || 'Component';
-
- process.env.NODE_ENV !== 'production' ? warning(inst.props === undefined || !propsMutated, '%s(...): When calling super() in `%s`, make sure to pass ' + 'up the same props that your component\'s constructor was passed.', componentName, componentName) : void 0;
- }
-
- // These should be set up in the constructor, but as a convenience for
- // simpler class abstractions, we set them up after the fact.
- inst.props = publicProps;
- inst.context = publicContext;
- inst.refs = emptyObject;
- inst.updater = updateQueue;
-
- this._instance = inst;
-
- // Store a reference from the instance back to the internal representation
- ReactInstanceMap.set(inst, this);
-
- if (process.env.NODE_ENV !== 'production') {
- // Since plain JS classes are defined without any special initialization
- // logic, we can not catch common errors early. Therefore, we have to
- // catch them here, at initialization time, instead.
- process.env.NODE_ENV !== 'production' ? warning(!inst.getInitialState || inst.getInitialState.isReactClassApproved || inst.state, 'getInitialState was defined on %s, a plain JavaScript class. ' + 'This is only supported for classes created using React.createClass. ' + 'Did you mean to define a state property instead?', this.getName() || 'a component') : void 0;
- process.env.NODE_ENV !== 'production' ? warning(!inst.getDefaultProps || inst.getDefaultProps.isReactClassApproved, 'getDefaultProps was defined on %s, a plain JavaScript class. ' + 'This is only supported for classes created using React.createClass. ' + 'Use a static property to define defaultProps instead.', this.getName() || 'a component') : void 0;
- process.env.NODE_ENV !== 'production' ? warning(!inst.propTypes, 'propTypes was defined as an instance property on %s. Use a static ' + 'property to define propTypes instead.', this.getName() || 'a component') : void 0;
- process.env.NODE_ENV !== 'production' ? warning(!inst.contextTypes, 'contextTypes was defined as an instance property on %s. Use a ' + 'static property to define contextTypes instead.', this.getName() || 'a component') : void 0;
- process.env.NODE_ENV !== 'production' ? warning(typeof inst.componentShouldUpdate !== 'function', '%s has a method called ' + 'componentShouldUpdate(). Did you mean shouldComponentUpdate()? ' + 'The name is phrased as a question because the function is ' + 'expected to return a value.', this.getName() || 'A component') : void 0;
- process.env.NODE_ENV !== 'production' ? warning(typeof inst.componentDidUnmount !== 'function', '%s has a method called ' + 'componentDidUnmount(). But there is no such lifecycle method. ' + 'Did you mean componentWillUnmount()?', this.getName() || 'A component') : void 0;
- process.env.NODE_ENV !== 'production' ? warning(typeof inst.componentWillRecieveProps !== 'function', '%s has a method called ' + 'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?', this.getName() || 'A component') : void 0;
- }
-
- var initialState = inst.state;
- if (initialState === undefined) {
- inst.state = initialState = null;
- }
- !(typeof initialState === 'object' && !Array.isArray(initialState)) ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s.state: must be set to an object or null', this.getName() || 'ReactCompositeComponent') : _prodInvariant('106', this.getName() || 'ReactCompositeComponent') : void 0;
-
- this._pendingStateQueue = null;
- this._pendingReplaceState = false;
- this._pendingForceUpdate = false;
-
- var markup;
- if (inst.unstable_handleError) {
- markup = this.performInitialMountWithErrorHandling(renderedElement, hostParent, hostContainerInfo, transaction, context);
- } else {
- markup = this.performInitialMount(renderedElement, hostParent, hostContainerInfo, transaction, context);
- }
-
- if (inst.componentDidMount) {
- if (process.env.NODE_ENV !== 'production') {
- transaction.getReactMountReady().enqueue(function () {
- measureLifeCyclePerf(function () {
- return inst.componentDidMount();
- }, _this._debugID, 'componentDidMount');
- });
- } else {
- transaction.getReactMountReady().enqueue(inst.componentDidMount, inst);
- }
- }
-
- return markup;
- },
-
- _constructComponent: function (doConstruct, publicProps, publicContext, updateQueue) {
- if (process.env.NODE_ENV !== 'production') {
- ReactCurrentOwner.current = this;
- try {
- return this._constructComponentWithoutOwner(doConstruct, publicProps, publicContext, updateQueue);
- } finally {
- ReactCurrentOwner.current = null;
- }
- } else {
- return this._constructComponentWithoutOwner(doConstruct, publicProps, publicContext, updateQueue);
- }
- },
-
- _constructComponentWithoutOwner: function (doConstruct, publicProps, publicContext, updateQueue) {
- var Component = this._currentElement.type;
-
- if (doConstruct) {
- if (process.env.NODE_ENV !== 'production') {
- return measureLifeCyclePerf(function () {
- return new Component(publicProps, publicContext, updateQueue);
- }, this._debugID, 'ctor');
- } else {
- return new Component(publicProps, publicContext, updateQueue);
- }
- }
-
- // This can still be an instance in case of factory components
- // but we'll count this as time spent rendering as the more common case.
- if (process.env.NODE_ENV !== 'production') {
- return measureLifeCyclePerf(function () {
- return Component(publicProps, publicContext, updateQueue);
- }, this._debugID, 'render');
- } else {
- return Component(publicProps, publicContext, updateQueue);
- }
- },
-
- performInitialMountWithErrorHandling: function (renderedElement, hostParent, hostContainerInfo, transaction, context) {
- var markup;
- var checkpoint = transaction.checkpoint();
- try {
- markup = this.performInitialMount(renderedElement, hostParent, hostContainerInfo, transaction, context);
- } catch (e) {
- // Roll back to checkpoint, handle error (which may add items to the transaction), and take a new checkpoint
- transaction.rollback(checkpoint);
- this._instance.unstable_handleError(e);
- if (this._pendingStateQueue) {
- this._instance.state = this._processPendingState(this._instance.props, this._instance.context);
- }
- checkpoint = transaction.checkpoint();
-
- this._renderedComponent.unmountComponent(true);
- transaction.rollback(checkpoint);
-
- // Try again - we've informed the component about the error, so they can render an error message this time.
- // If this throws again, the error will bubble up (and can be caught by a higher error boundary).
- markup = this.performInitialMount(renderedElement, hostParent, hostContainerInfo, transaction, context);
- }
- return markup;
- },
-
- performInitialMount: function (renderedElement, hostParent, hostContainerInfo, transaction, context) {
- var inst = this._instance;
-
- var debugID = 0;
- if (process.env.NODE_ENV !== 'production') {
- debugID = this._debugID;
- }
-
- if (inst.componentWillMount) {
- if (process.env.NODE_ENV !== 'production') {
- measureLifeCyclePerf(function () {
- return inst.componentWillMount();
- }, debugID, 'componentWillMount');
- } else {
- inst.componentWillMount();
- }
- // When mounting, calls to `setState` by `componentWillMount` will set
- // `this._pendingStateQueue` without triggering a re-render.
- if (this._pendingStateQueue) {
- inst.state = this._processPendingState(inst.props, inst.context);
- }
- }
-
- // If not a stateless component, we now render
- if (renderedElement === undefined) {
- renderedElement = this._renderValidatedComponent();
- }
-
- var nodeType = ReactNodeTypes.getType(renderedElement);
- this._renderedNodeType = nodeType;
- var child = this._instantiateReactComponent(renderedElement, nodeType !== ReactNodeTypes.EMPTY /* shouldHaveDebugID */
- );
- this._renderedComponent = child;
-
- var markup = ReactReconciler.mountComponent(child, transaction, hostParent, hostContainerInfo, this._processChildContext(context), debugID);
-
- if (process.env.NODE_ENV !== 'production') {
- if (debugID !== 0) {
- var childDebugIDs = child._debugID !== 0 ? [child._debugID] : [];
- ReactInstrumentation.debugTool.onSetChildren(debugID, childDebugIDs);
- }
- }
-
- return markup;
- },
-
- getHostNode: function () {
- return ReactReconciler.getHostNode(this._renderedComponent);
- },
-
- /**
- * Releases any resources allocated by `mountComponent`.
- *
- * @final
- * @internal
- */
- unmountComponent: function (safely) {
- if (!this._renderedComponent) {
- return;
- }
-
- var inst = this._instance;
-
- if (inst.componentWillUnmount && !inst._calledComponentWillUnmount) {
- inst._calledComponentWillUnmount = true;
-
- if (safely) {
- var name = this.getName() + '.componentWillUnmount()';
- ReactErrorUtils.invokeGuardedCallback(name, inst.componentWillUnmount.bind(inst));
- } else {
- if (process.env.NODE_ENV !== 'production') {
- measureLifeCyclePerf(function () {
- return inst.componentWillUnmount();
- }, this._debugID, 'componentWillUnmount');
- } else {
- inst.componentWillUnmount();
- }
- }
- }
-
- if (this._renderedComponent) {
- ReactReconciler.unmountComponent(this._renderedComponent, safely);
- this._renderedNodeType = null;
- this._renderedComponent = null;
- this._instance = null;
- }
-
- // Reset pending fields
- // Even if this component is scheduled for another update in ReactUpdates,
- // it would still be ignored because these fields are reset.
- this._pendingStateQueue = null;
- this._pendingReplaceState = false;
- this._pendingForceUpdate = false;
- this._pendingCallbacks = null;
- this._pendingElement = null;
-
- // These fields do not really need to be reset since this object is no
- // longer accessible.
- this._context = null;
- this._rootNodeID = 0;
- this._topLevelWrapper = null;
-
- // Delete the reference from the instance to this internal representation
- // which allow the internals to be properly cleaned up even if the user
- // leaks a reference to the public instance.
- ReactInstanceMap.remove(inst);
-
- // Some existing components rely on inst.props even after they've been
- // destroyed (in event handlers).
- // TODO: inst.props = null;
- // TODO: inst.state = null;
- // TODO: inst.context = null;
- },
-
- /**
- * Filters the context object to only contain keys specified in
- * `contextTypes`
- *
- * @param {object} context
- * @return {?object}
- * @private
- */
- _maskContext: function (context) {
- var Component = this._currentElement.type;
- var contextTypes = Component.contextTypes;
- if (!contextTypes) {
- return emptyObject;
- }
- var maskedContext = {};
- for (var contextName in contextTypes) {
- maskedContext[contextName] = context[contextName];
- }
- return maskedContext;
- },
-
- /**
- * Filters the context object to only contain keys specified in
- * `contextTypes`, and asserts that they are valid.
- *
- * @param {object} context
- * @return {?object}
- * @private
- */
- _processContext: function (context) {
- var maskedContext = this._maskContext(context);
- if (process.env.NODE_ENV !== 'production') {
- var Component = this._currentElement.type;
- if (Component.contextTypes) {
- this._checkContextTypes(Component.contextTypes, maskedContext, 'context');
- }
- }
- return maskedContext;
- },
-
- /**
- * @param {object} currentContext
- * @return {object}
- * @private
- */
- _processChildContext: function (currentContext) {
- var Component = this._currentElement.type;
- var inst = this._instance;
- var childContext;
-
- if (inst.getChildContext) {
- if (process.env.NODE_ENV !== 'production') {
- ReactInstrumentation.debugTool.onBeginProcessingChildContext();
- try {
- childContext = inst.getChildContext();
- } finally {
- ReactInstrumentation.debugTool.onEndProcessingChildContext();
- }
- } else {
- childContext = inst.getChildContext();
- }
- }
-
- if (childContext) {
- !(typeof Component.childContextTypes === 'object') ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s.getChildContext(): childContextTypes must be defined in order to use getChildContext().', this.getName() || 'ReactCompositeComponent') : _prodInvariant('107', this.getName() || 'ReactCompositeComponent') : void 0;
- if (process.env.NODE_ENV !== 'production') {
- this._checkContextTypes(Component.childContextTypes, childContext, 'childContext');
- }
- for (var name in childContext) {
- !(name in Component.childContextTypes) ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s.getChildContext(): key "%s" is not defined in childContextTypes.', this.getName() || 'ReactCompositeComponent', name) : _prodInvariant('108', this.getName() || 'ReactCompositeComponent', name) : void 0;
- }
- return _assign({}, currentContext, childContext);
- }
- return currentContext;
- },
-
- /**
- * Assert that the context types are valid
- *
- * @param {object} typeSpecs Map of context field to a ReactPropType
- * @param {object} values Runtime values that need to be type-checked
- * @param {string} location e.g. "prop", "context", "child context"
- * @private
- */
- _checkContextTypes: function (typeSpecs, values, location) {
- if (process.env.NODE_ENV !== 'production') {
- checkReactTypeSpec(typeSpecs, values, location, this.getName(), null, this._debugID);
- }
- },
-
- receiveComponent: function (nextElement, transaction, nextContext) {
- var prevElement = this._currentElement;
- var prevContext = this._context;
-
- this._pendingElement = null;
-
- this.updateComponent(transaction, prevElement, nextElement, prevContext, nextContext);
- },
-
- /**
- * If any of `_pendingElement`, `_pendingStateQueue`, or `_pendingForceUpdate`
- * is set, update the component.
- *
- * @param {ReactReconcileTransaction} transaction
- * @internal
- */
- performUpdateIfNecessary: function (transaction) {
- if (this._pendingElement != null) {
- ReactReconciler.receiveComponent(this, this._pendingElement, transaction, this._context);
- } else if (this._pendingStateQueue !== null || this._pendingForceUpdate) {
- this.updateComponent(transaction, this._currentElement, this._currentElement, this._context, this._context);
- } else {
- this._updateBatchNumber = null;
- }
- },
-
- /**
- * Perform an update to a mounted component. The componentWillReceiveProps and
- * shouldComponentUpdate methods are called, then (assuming the update isn't
- * skipped) the remaining update lifecycle methods are called and the DOM
- * representation is updated.
- *
- * By default, this implements React's rendering and reconciliation algorithm.
- * Sophisticated clients may wish to override this.
- *
- * @param {ReactReconcileTransaction} transaction
- * @param {ReactElement} prevParentElement
- * @param {ReactElement} nextParentElement
- * @internal
- * @overridable
- */
- updateComponent: function (transaction, prevParentElement, nextParentElement, prevUnmaskedContext, nextUnmaskedContext) {
- var inst = this._instance;
- !(inst != null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Attempted to update component `%s` that has already been unmounted (or failed to mount).', this.getName() || 'ReactCompositeComponent') : _prodInvariant('136', this.getName() || 'ReactCompositeComponent') : void 0;
-
- var willReceive = false;
- var nextContext;
-
- // Determine if the context has changed or not
- if (this._context === nextUnmaskedContext) {
- nextContext = inst.context;
- } else {
- nextContext = this._processContext(nextUnmaskedContext);
- willReceive = true;
- }
-
- var prevProps = prevParentElement.props;
- var nextProps = nextParentElement.props;
-
- // Not a simple state update but a props update
- if (prevParentElement !== nextParentElement) {
- willReceive = true;
- }
-
- // An update here will schedule an update but immediately set
- // _pendingStateQueue which will ensure that any state updates gets
- // immediately reconciled instead of waiting for the next batch.
- if (willReceive && inst.componentWillReceiveProps) {
- if (process.env.NODE_ENV !== 'production') {
- measureLifeCyclePerf(function () {
- return inst.componentWillReceiveProps(nextProps, nextContext);
- }, this._debugID, 'componentWillReceiveProps');
- } else {
- inst.componentWillReceiveProps(nextProps, nextContext);
- }
- }
-
- var nextState = this._processPendingState(nextProps, nextContext);
- var shouldUpdate = true;
-
- if (!this._pendingForceUpdate) {
- if (inst.shouldComponentUpdate) {
- if (process.env.NODE_ENV !== 'production') {
- shouldUpdate = measureLifeCyclePerf(function () {
- return inst.shouldComponentUpdate(nextProps, nextState, nextContext);
- }, this._debugID, 'shouldComponentUpdate');
- } else {
- shouldUpdate = inst.shouldComponentUpdate(nextProps, nextState, nextContext);
- }
- } else {
- if (this._compositeType === CompositeTypes.PureClass) {
- shouldUpdate = !shallowEqual(prevProps, nextProps) || !shallowEqual(inst.state, nextState);
- }
- }
- }
-
- if (process.env.NODE_ENV !== 'production') {
- process.env.NODE_ENV !== 'production' ? warning(shouldUpdate !== undefined, '%s.shouldComponentUpdate(): Returned undefined instead of a ' + 'boolean value. Make sure to return true or false.', this.getName() || 'ReactCompositeComponent') : void 0;
- }
-
- this._updateBatchNumber = null;
- if (shouldUpdate) {
- this._pendingForceUpdate = false;
- // Will set `this.props`, `this.state` and `this.context`.
- this._performComponentUpdate(nextParentElement, nextProps, nextState, nextContext, transaction, nextUnmaskedContext);
- } else {
- // If it's determined that a component should not update, we still want
- // to set props and state but we shortcut the rest of the update.
- this._currentElement = nextParentElement;
- this._context = nextUnmaskedContext;
- inst.props = nextProps;
- inst.state = nextState;
- inst.context = nextContext;
- }
- },
-
- _processPendingState: function (props, context) {
- var inst = this._instance;
- var queue = this._pendingStateQueue;
- var replace = this._pendingReplaceState;
- this._pendingReplaceState = false;
- this._pendingStateQueue = null;
-
- if (!queue) {
- return inst.state;
- }
-
- if (replace && queue.length === 1) {
- return queue[0];
- }
-
- var nextState = _assign({}, replace ? queue[0] : inst.state);
- for (var i = replace ? 1 : 0; i < queue.length; i++) {
- var partial = queue[i];
- _assign(nextState, typeof partial === 'function' ? partial.call(inst, nextState, props, context) : partial);
- }
-
- return nextState;
- },
-
- /**
- * Merges new props and state, notifies delegate methods of update and
- * performs update.
- *
- * @param {ReactElement} nextElement Next element
- * @param {object} nextProps Next public object to set as properties.
- * @param {?object} nextState Next object to set as state.
- * @param {?object} nextContext Next public object to set as context.
- * @param {ReactReconcileTransaction} transaction
- * @param {?object} unmaskedContext
- * @private
- */
- _performComponentUpdate: function (nextElement, nextProps, nextState, nextContext, transaction, unmaskedContext) {
- var _this2 = this;
-
- var inst = this._instance;
-
- var hasComponentDidUpdate = Boolean(inst.componentDidUpdate);
- var prevProps;
- var prevState;
- var prevContext;
- if (hasComponentDidUpdate) {
- prevProps = inst.props;
- prevState = inst.state;
- prevContext = inst.context;
- }
-
- if (inst.componentWillUpdate) {
- if (process.env.NODE_ENV !== 'production') {
- measureLifeCyclePerf(function () {
- return inst.componentWillUpdate(nextProps, nextState, nextContext);
- }, this._debugID, 'componentWillUpdate');
- } else {
- inst.componentWillUpdate(nextProps, nextState, nextContext);
- }
- }
-
- this._currentElement = nextElement;
- this._context = unmaskedContext;
- inst.props = nextProps;
- inst.state = nextState;
- inst.context = nextContext;
-
- this._updateRenderedComponent(transaction, unmaskedContext);
-
- if (hasComponentDidUpdate) {
- if (process.env.NODE_ENV !== 'production') {
- transaction.getReactMountReady().enqueue(function () {
- measureLifeCyclePerf(inst.componentDidUpdate.bind(inst, prevProps, prevState, prevContext), _this2._debugID, 'componentDidUpdate');
- });
- } else {
- transaction.getReactMountReady().enqueue(inst.componentDidUpdate.bind(inst, prevProps, prevState, prevContext), inst);
- }
- }
- },
-
- /**
- * Call the component's `render` method and update the DOM accordingly.
- *
- * @param {ReactReconcileTransaction} transaction
- * @internal
- */
- _updateRenderedComponent: function (transaction, context) {
- var prevComponentInstance = this._renderedComponent;
- var prevRenderedElement = prevComponentInstance._currentElement;
- var nextRenderedElement = this._renderValidatedComponent();
-
- var debugID = 0;
- if (process.env.NODE_ENV !== 'production') {
- debugID = this._debugID;
- }
-
- if (shouldUpdateReactComponent(prevRenderedElement, nextRenderedElement)) {
- ReactReconciler.receiveComponent(prevComponentInstance, nextRenderedElement, transaction, this._processChildContext(context));
- } else {
- var oldHostNode = ReactReconciler.getHostNode(prevComponentInstance);
- ReactReconciler.unmountComponent(prevComponentInstance, false);
-
- var nodeType = ReactNodeTypes.getType(nextRenderedElement);
- this._renderedNodeType = nodeType;
- var child = this._instantiateReactComponent(nextRenderedElement, nodeType !== ReactNodeTypes.EMPTY /* shouldHaveDebugID */
- );
- this._renderedComponent = child;
-
- var nextMarkup = ReactReconciler.mountComponent(child, transaction, this._hostParent, this._hostContainerInfo, this._processChildContext(context), debugID);
-
- if (process.env.NODE_ENV !== 'production') {
- if (debugID !== 0) {
- var childDebugIDs = child._debugID !== 0 ? [child._debugID] : [];
- ReactInstrumentation.debugTool.onSetChildren(debugID, childDebugIDs);
- }
- }
-
- this._replaceNodeWithMarkup(oldHostNode, nextMarkup, prevComponentInstance);
- }
- },
-
- /**
- * Overridden in shallow rendering.
- *
- * @protected
- */
- _replaceNodeWithMarkup: function (oldHostNode, nextMarkup, prevInstance) {
- ReactComponentEnvironment.replaceNodeWithMarkup(oldHostNode, nextMarkup, prevInstance);
- },
-
- /**
- * @protected
- */
- _renderValidatedComponentWithoutOwnerOrContext: function () {
- var inst = this._instance;
- var renderedElement;
-
- if (process.env.NODE_ENV !== 'production') {
- renderedElement = measureLifeCyclePerf(function () {
- return inst.render();
- }, this._debugID, 'render');
- } else {
- renderedElement = inst.render();
- }
-
- if (process.env.NODE_ENV !== 'production') {
- // We allow auto-mocks to proceed as if they're returning null.
- if (renderedElement === undefined && inst.render._isMockFunction) {
- // This is probably bad practice. Consider warning here and
- // deprecating this convenience.
- renderedElement = null;
- }
- }
-
- return renderedElement;
- },
-
- /**
- * @private
- */
- _renderValidatedComponent: function () {
- var renderedElement;
- if (process.env.NODE_ENV !== 'production' || this._compositeType !== CompositeTypes.StatelessFunctional) {
- ReactCurrentOwner.current = this;
- try {
- renderedElement = this._renderValidatedComponentWithoutOwnerOrContext();
- } finally {
- ReactCurrentOwner.current = null;
- }
- } else {
- renderedElement = this._renderValidatedComponentWithoutOwnerOrContext();
- }
- !(
- // TODO: An `isValidNode` function would probably be more appropriate
- renderedElement === null || renderedElement === false || React.isValidElement(renderedElement)) ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s.render(): A valid React element (or null) must be returned. You may have returned undefined, an array or some other invalid object.', this.getName() || 'ReactCompositeComponent') : _prodInvariant('109', this.getName() || 'ReactCompositeComponent') : void 0;
-
- return renderedElement;
- },
-
- /**
- * Lazily allocates the refs object and stores `component` as `ref`.
- *
- * @param {string} ref Reference name.
- * @param {component} component Component to store as `ref`.
- * @final
- * @private
- */
- attachRef: function (ref, component) {
- var inst = this.getPublicInstance();
- !(inst != null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Stateless function components cannot have refs.') : _prodInvariant('110') : void 0;
- var publicComponentInstance = component.getPublicInstance();
- if (process.env.NODE_ENV !== 'production') {
- var componentName = component && component.getName ? component.getName() : 'a component';
- process.env.NODE_ENV !== 'production' ? warning(publicComponentInstance != null || component._compositeType !== CompositeTypes.StatelessFunctional, 'Stateless function components cannot be given refs ' + '(See ref "%s" in %s created by %s). ' + 'Attempts to access this ref will fail.', ref, componentName, this.getName()) : void 0;
- }
- var refs = inst.refs === emptyObject ? inst.refs = {} : inst.refs;
- refs[ref] = publicComponentInstance;
- },
-
- /**
- * Detaches a reference name.
- *
- * @param {string} ref Name to dereference.
- * @final
- * @private
- */
- detachRef: function (ref) {
- var refs = this.getPublicInstance().refs;
- delete refs[ref];
- },
-
- /**
- * Get a text description of the component that can be used to identify it
- * in error messages.
- * @return {string} The name or null.
- * @internal
- */
- getName: function () {
- var type = this._currentElement.type;
- var constructor = this._instance && this._instance.constructor;
- return type.displayName || constructor && constructor.displayName || type.name || constructor && constructor.name || null;
- },
-
- /**
- * Get the publicly accessible representation of this component - i.e. what
- * is exposed by refs and returned by render. Can be null for stateless
- * components.
- *
- * @return {ReactComponent} the public component instance.
- * @internal
- */
- getPublicInstance: function () {
- var inst = this._instance;
- if (this._compositeType === CompositeTypes.StatelessFunctional) {
- return null;
- }
- return inst;
- },
-
- // Stub
- _instantiateReactComponent: null
-
-};
-
-module.exports = ReactCompositeComponent;
-}).call(this,require('_process'))
-
-},{"./ReactComponentEnvironment":75,"./ReactErrorUtils":100,"./ReactInstanceMap":108,"./ReactInstrumentation":109,"./ReactNodeTypes":114,"./ReactReconciler":119,"./checkReactTypeSpec":146,"./reactProdInvariant":167,"./shouldUpdateReactComponent":171,"_process":43,"fbjs/lib/emptyObject":11,"fbjs/lib/invariant":18,"fbjs/lib/shallowEqual":24,"fbjs/lib/warning":25,"object-assign":42,"react/lib/React":190,"react/lib/ReactCurrentOwner":195}],77:[function(require,module,exports){
-(function (process){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-/* globals __REACT_DEVTOOLS_GLOBAL_HOOK__*/
-
-'use strict';
-
-var ReactDOMComponentTree = require('./ReactDOMComponentTree');
-var ReactDefaultInjection = require('./ReactDefaultInjection');
-var ReactMount = require('./ReactMount');
-var ReactReconciler = require('./ReactReconciler');
-var ReactUpdates = require('./ReactUpdates');
-var ReactVersion = require('./ReactVersion');
-
-var findDOMNode = require('./findDOMNode');
-var getHostComponentFromComposite = require('./getHostComponentFromComposite');
-var renderSubtreeIntoContainer = require('./renderSubtreeIntoContainer');
-var warning = require('fbjs/lib/warning');
-
-ReactDefaultInjection.inject();
-
-var ReactDOM = {
- findDOMNode: findDOMNode,
- render: ReactMount.render,
- unmountComponentAtNode: ReactMount.unmountComponentAtNode,
- version: ReactVersion,
-
- /* eslint-disable camelcase */
- unstable_batchedUpdates: ReactUpdates.batchedUpdates,
- unstable_renderSubtreeIntoContainer: renderSubtreeIntoContainer
-};
-
-// Inject the runtime into a devtools global hook regardless of browser.
-// Allows for debugging when the hook is injected on the page.
-if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.inject === 'function') {
- __REACT_DEVTOOLS_GLOBAL_HOOK__.inject({
- ComponentTree: {
- getClosestInstanceFromNode: ReactDOMComponentTree.getClosestInstanceFromNode,
- getNodeFromInstance: function (inst) {
- // inst is an internal instance (but could be a composite)
- if (inst._renderedComponent) {
- inst = getHostComponentFromComposite(inst);
- }
- if (inst) {
- return ReactDOMComponentTree.getNodeFromInstance(inst);
- } else {
- return null;
- }
- }
- },
- Mount: ReactMount,
- Reconciler: ReactReconciler
- });
-}
-
-if (process.env.NODE_ENV !== 'production') {
- var ExecutionEnvironment = require('fbjs/lib/ExecutionEnvironment');
- if (ExecutionEnvironment.canUseDOM && window.top === window.self) {
-
- // First check if devtools is not installed
- if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined') {
- // If we're in Chrome or Firefox, provide a download link if not installed.
- if (navigator.userAgent.indexOf('Chrome') > -1 && navigator.userAgent.indexOf('Edge') === -1 || navigator.userAgent.indexOf('Firefox') > -1) {
- // Firefox does not have the issue with devtools loaded over file://
- var showFileUrlMessage = window.location.protocol.indexOf('http') === -1 && navigator.userAgent.indexOf('Firefox') === -1;
- console.debug('Download the React DevTools ' + (showFileUrlMessage ? 'and use an HTTP server (instead of a file: URL) ' : '') + 'for a better development experience: ' + 'https://fb.me/react-devtools');
- }
- }
-
- var testFunc = function testFn() {};
- process.env.NODE_ENV !== 'production' ? warning((testFunc.name || testFunc.toString()).indexOf('testFn') !== -1, 'It looks like you\'re using a minified copy of the development build ' + 'of React. When deploying React apps to production, make sure to use ' + 'the production build which skips development warnings and is faster. ' + 'See https://fb.me/react-minification for more details.') : void 0;
-
- // If we're in IE8, check to see if we are in compatibility mode and provide
- // information on preventing compatibility mode
- var ieCompatibilityMode = document.documentMode && document.documentMode < 8;
-
- process.env.NODE_ENV !== 'production' ? warning(!ieCompatibilityMode, 'Internet Explorer is running in compatibility mode; please add the ' + 'following tag to your HTML to prevent this from happening: ' + '<meta http-equiv="X-UA-Compatible" content="IE=edge" />') : void 0;
-
- var expectedFeatures = [
- // shims
- Array.isArray, Array.prototype.every, Array.prototype.forEach, Array.prototype.indexOf, Array.prototype.map, Date.now, Function.prototype.bind, Object.keys, String.prototype.trim];
-
- for (var i = 0; i < expectedFeatures.length; i++) {
- if (!expectedFeatures[i]) {
- process.env.NODE_ENV !== 'production' ? warning(false, 'One or more ES5 shims expected by React are not available: ' + 'https://fb.me/react-warning-polyfills') : void 0;
- break;
- }
- }
- }
-}
-
-if (process.env.NODE_ENV !== 'production') {
- var ReactInstrumentation = require('./ReactInstrumentation');
- var ReactDOMUnknownPropertyHook = require('./ReactDOMUnknownPropertyHook');
- var ReactDOMNullInputValuePropHook = require('./ReactDOMNullInputValuePropHook');
- var ReactDOMInvalidARIAHook = require('./ReactDOMInvalidARIAHook');
-
- ReactInstrumentation.debugTool.addHook(ReactDOMUnknownPropertyHook);
- ReactInstrumentation.debugTool.addHook(ReactDOMNullInputValuePropHook);
- ReactInstrumentation.debugTool.addHook(ReactDOMInvalidARIAHook);
-}
-
-module.exports = ReactDOM;
-}).call(this,require('_process'))
-
-},{"./ReactDOMComponentTree":80,"./ReactDOMInvalidARIAHook":86,"./ReactDOMNullInputValuePropHook":87,"./ReactDOMUnknownPropertyHook":94,"./ReactDefaultInjection":97,"./ReactInstrumentation":109,"./ReactMount":112,"./ReactReconciler":119,"./ReactUpdates":124,"./ReactVersion":125,"./findDOMNode":150,"./getHostComponentFromComposite":157,"./renderSubtreeIntoContainer":168,"_process":43,"fbjs/lib/ExecutionEnvironment":4,"fbjs/lib/warning":25}],78:[function(require,module,exports){
-(function (process){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-/* global hasOwnProperty:true */
-
-'use strict';
-
-var _prodInvariant = require('./reactProdInvariant'),
- _assign = require('object-assign');
-
-var AutoFocusUtils = require('./AutoFocusUtils');
-var CSSPropertyOperations = require('./CSSPropertyOperations');
-var DOMLazyTree = require('./DOMLazyTree');
-var DOMNamespaces = require('./DOMNamespaces');
-var DOMProperty = require('./DOMProperty');
-var DOMPropertyOperations = require('./DOMPropertyOperations');
-var EventPluginHub = require('./EventPluginHub');
-var EventPluginRegistry = require('./EventPluginRegistry');
-var ReactBrowserEventEmitter = require('./ReactBrowserEventEmitter');
-var ReactDOMComponentFlags = require('./ReactDOMComponentFlags');
-var ReactDOMComponentTree = require('./ReactDOMComponentTree');
-var ReactDOMInput = require('./ReactDOMInput');
-var ReactDOMOption = require('./ReactDOMOption');
-var ReactDOMSelect = require('./ReactDOMSelect');
-var ReactDOMTextarea = require('./ReactDOMTextarea');
-var ReactInstrumentation = require('./ReactInstrumentation');
-var ReactMultiChild = require('./ReactMultiChild');
-var ReactServerRenderingTransaction = require('./ReactServerRenderingTransaction');
-
-var emptyFunction = require('fbjs/lib/emptyFunction');
-var escapeTextContentForBrowser = require('./escapeTextContentForBrowser');
-var invariant = require('fbjs/lib/invariant');
-var isEventSupported = require('./isEventSupported');
-var shallowEqual = require('fbjs/lib/shallowEqual');
-var validateDOMNesting = require('./validateDOMNesting');
-var warning = require('fbjs/lib/warning');
-
-var Flags = ReactDOMComponentFlags;
-var deleteListener = EventPluginHub.deleteListener;
-var getNode = ReactDOMComponentTree.getNodeFromInstance;
-var listenTo = ReactBrowserEventEmitter.listenTo;
-var registrationNameModules = EventPluginRegistry.registrationNameModules;
-
-// For quickly matching children type, to test if can be treated as content.
-var CONTENT_TYPES = { 'string': true, 'number': true };
-
-var STYLE = 'style';
-var HTML = '__html';
-var RESERVED_PROPS = {
- children: null,
- dangerouslySetInnerHTML: null,
- suppressContentEditableWarning: null
-};
-
-// Node type for document fragments (Node.DOCUMENT_FRAGMENT_NODE).
-var DOC_FRAGMENT_TYPE = 11;
-
-function getDeclarationErrorAddendum(internalInstance) {
- if (internalInstance) {
- var owner = internalInstance._currentElement._owner || null;
- if (owner) {
- var name = owner.getName();
- if (name) {
- return ' This DOM node was rendered by `' + name + '`.';
- }
- }
- }
- return '';
-}
-
-function friendlyStringify(obj) {
- if (typeof obj === 'object') {
- if (Array.isArray(obj)) {
- return '[' + obj.map(friendlyStringify).join(', ') + ']';
- } else {
- var pairs = [];
- for (var key in obj) {
- if (Object.prototype.hasOwnProperty.call(obj, key)) {
- var keyEscaped = /^[a-z$_][\w$_]*$/i.test(key) ? key : JSON.stringify(key);
- pairs.push(keyEscaped + ': ' + friendlyStringify(obj[key]));
- }
- }
- return '{' + pairs.join(', ') + '}';
- }
- } else if (typeof obj === 'string') {
- return JSON.stringify(obj);
- } else if (typeof obj === 'function') {
- return '[function object]';
- }
- // Differs from JSON.stringify in that undefined because undefined and that
- // inf and nan don't become null
- return String(obj);
-}
-
-var styleMutationWarning = {};
-
-function checkAndWarnForMutatedStyle(style1, style2, component) {
- if (style1 == null || style2 == null) {
- return;
- }
- if (shallowEqual(style1, style2)) {
- return;
- }
-
- var componentName = component._tag;
- var owner = component._currentElement._owner;
- var ownerName;
- if (owner) {
- ownerName = owner.getName();
- }
-
- var hash = ownerName + '|' + componentName;
-
- if (styleMutationWarning.hasOwnProperty(hash)) {
- return;
- }
-
- styleMutationWarning[hash] = true;
-
- process.env.NODE_ENV !== 'production' ? warning(false, '`%s` was passed a style object that has previously been mutated. ' + 'Mutating `style` is deprecated. Consider cloning it beforehand. Check ' + 'the `render` %s. Previous style: %s. Mutated style: %s.', componentName, owner ? 'of `' + ownerName + '`' : 'using <' + componentName + '>', friendlyStringify(style1), friendlyStringify(style2)) : void 0;
-}
-
-/**
- * @param {object} component
- * @param {?object} props
- */
-function assertValidProps(component, props) {
- if (!props) {
- return;
- }
- // Note the use of `==` which checks for null or undefined.
- if (voidElementTags[component._tag]) {
- !(props.children == null && props.dangerouslySetInnerHTML == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`.%s', component._tag, component._currentElement._owner ? ' Check the render method of ' + component._currentElement._owner.getName() + '.' : '') : _prodInvariant('137', component._tag, component._currentElement._owner ? ' Check the render method of ' + component._currentElement._owner.getName() + '.' : '') : void 0;
- }
- if (props.dangerouslySetInnerHTML != null) {
- !(props.children == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Can only set one of `children` or `props.dangerouslySetInnerHTML`.') : _prodInvariant('60') : void 0;
- !(typeof props.dangerouslySetInnerHTML === 'object' && HTML in props.dangerouslySetInnerHTML) ? process.env.NODE_ENV !== 'production' ? invariant(false, '`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. Please visit https://fb.me/react-invariant-dangerously-set-inner-html for more information.') : _prodInvariant('61') : void 0;
- }
- if (process.env.NODE_ENV !== 'production') {
- process.env.NODE_ENV !== 'production' ? warning(props.innerHTML == null, 'Directly setting property `innerHTML` is not permitted. ' + 'For more information, lookup documentation on `dangerouslySetInnerHTML`.') : void 0;
- process.env.NODE_ENV !== 'production' ? warning(props.suppressContentEditableWarning || !props.contentEditable || props.children == null, 'A component is `contentEditable` and contains `children` managed by ' + 'React. It is now your responsibility to guarantee that none of ' + 'those nodes are unexpectedly modified or duplicated. This is ' + 'probably not intentional.') : void 0;
- process.env.NODE_ENV !== 'production' ? warning(props.onFocusIn == null && props.onFocusOut == null, 'React uses onFocus and onBlur instead of onFocusIn and onFocusOut. ' + 'All React events are normalized to bubble, so onFocusIn and onFocusOut ' + 'are not needed/supported by React.') : void 0;
- }
- !(props.style == null || typeof props.style === 'object') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + \'em\'}} when using JSX.%s', getDeclarationErrorAddendum(component)) : _prodInvariant('62', getDeclarationErrorAddendum(component)) : void 0;
-}
-
-function enqueuePutListener(inst, registrationName, listener, transaction) {
- if (transaction instanceof ReactServerRenderingTransaction) {
- return;
- }
- if (process.env.NODE_ENV !== 'production') {
- // IE8 has no API for event capturing and the `onScroll` event doesn't
- // bubble.
- process.env.NODE_ENV !== 'production' ? warning(registrationName !== 'onScroll' || isEventSupported('scroll', true), 'This browser doesn\'t support the `onScroll` event') : void 0;
- }
- var containerInfo = inst._hostContainerInfo;
- var isDocumentFragment = containerInfo._node && containerInfo._node.nodeType === DOC_FRAGMENT_TYPE;
- var doc = isDocumentFragment ? containerInfo._node : containerInfo._ownerDocument;
- listenTo(registrationName, doc);
- transaction.getReactMountReady().enqueue(putListener, {
- inst: inst,
- registrationName: registrationName,
- listener: listener
- });
-}
-
-function putListener() {
- var listenerToPut = this;
- EventPluginHub.putListener(listenerToPut.inst, listenerToPut.registrationName, listenerToPut.listener);
-}
-
-function inputPostMount() {
- var inst = this;
- ReactDOMInput.postMountWrapper(inst);
-}
-
-function textareaPostMount() {
- var inst = this;
- ReactDOMTextarea.postMountWrapper(inst);
-}
-
-function optionPostMount() {
- var inst = this;
- ReactDOMOption.postMountWrapper(inst);
-}
-
-var setAndValidateContentChildDev = emptyFunction;
-if (process.env.NODE_ENV !== 'production') {
- setAndValidateContentChildDev = function (content) {
- var hasExistingContent = this._contentDebugID != null;
- var debugID = this._debugID;
- // This ID represents the inlined child that has no backing instance:
- var contentDebugID = -debugID;
-
- if (content == null) {
- if (hasExistingContent) {
- ReactInstrumentation.debugTool.onUnmountComponent(this._contentDebugID);
- }
- this._contentDebugID = null;
- return;
- }
-
- validateDOMNesting(null, String(content), this, this._ancestorInfo);
- this._contentDebugID = contentDebugID;
- if (hasExistingContent) {
- ReactInstrumentation.debugTool.onBeforeUpdateComponent(contentDebugID, content);
- ReactInstrumentation.debugTool.onUpdateComponent(contentDebugID);
- } else {
- ReactInstrumentation.debugTool.onBeforeMountComponent(contentDebugID, content, debugID);
- ReactInstrumentation.debugTool.onMountComponent(contentDebugID);
- ReactInstrumentation.debugTool.onSetChildren(debugID, [contentDebugID]);
- }
- };
-}
-
-// There are so many media events, it makes sense to just
-// maintain a list rather than create a `trapBubbledEvent` for each
-var mediaEvents = {
- topAbort: 'abort',
- topCanPlay: 'canplay',
- topCanPlayThrough: 'canplaythrough',
- topDurationChange: 'durationchange',
- topEmptied: 'emptied',
- topEncrypted: 'encrypted',
- topEnded: 'ended',
- topError: 'error',
- topLoadedData: 'loadeddata',
- topLoadedMetadata: 'loadedmetadata',
- topLoadStart: 'loadstart',
- topPause: 'pause',
- topPlay: 'play',
- topPlaying: 'playing',
- topProgress: 'progress',
- topRateChange: 'ratechange',
- topSeeked: 'seeked',
- topSeeking: 'seeking',
- topStalled: 'stalled',
- topSuspend: 'suspend',
- topTimeUpdate: 'timeupdate',
- topVolumeChange: 'volumechange',
- topWaiting: 'waiting'
-};
-
-function trapBubbledEventsLocal() {
- var inst = this;
- // If a component renders to null or if another component fatals and causes
- // the state of the tree to be corrupted, `node` here can be null.
- !inst._rootNodeID ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Must be mounted to trap events') : _prodInvariant('63') : void 0;
- var node = getNode(inst);
- !node ? process.env.NODE_ENV !== 'production' ? invariant(false, 'trapBubbledEvent(...): Requires node to be rendered.') : _prodInvariant('64') : void 0;
-
- switch (inst._tag) {
- case 'iframe':
- case 'object':
- inst._wrapperState.listeners = [ReactBrowserEventEmitter.trapBubbledEvent('topLoad', 'load', node)];
- break;
- case 'video':
- case 'audio':
-
- inst._wrapperState.listeners = [];
- // Create listener for each media event
- for (var event in mediaEvents) {
- if (mediaEvents.hasOwnProperty(event)) {
- inst._wrapperState.listeners.push(ReactBrowserEventEmitter.trapBubbledEvent(event, mediaEvents[event], node));
- }
- }
- break;
- case 'source':
- inst._wrapperState.listeners = [ReactBrowserEventEmitter.trapBubbledEvent('topError', 'error', node)];
- break;
- case 'img':
- inst._wrapperState.listeners = [ReactBrowserEventEmitter.trapBubbledEvent('topError', 'error', node), ReactBrowserEventEmitter.trapBubbledEvent('topLoad', 'load', node)];
- break;
- case 'form':
- inst._wrapperState.listeners = [ReactBrowserEventEmitter.trapBubbledEvent('topReset', 'reset', node), ReactBrowserEventEmitter.trapBubbledEvent('topSubmit', 'submit', node)];
- break;
- case 'input':
- case 'select':
- case 'textarea':
- inst._wrapperState.listeners = [ReactBrowserEventEmitter.trapBubbledEvent('topInvalid', 'invalid', node)];
- break;
- }
-}
-
-function postUpdateSelectWrapper() {
- ReactDOMSelect.postUpdateWrapper(this);
-}
-
-// For HTML, certain tags should omit their close tag. We keep a whitelist for
-// those special-case tags.
-
-var omittedCloseTags = {
- 'area': true,
- 'base': true,
- 'br': true,
- 'col': true,
- 'embed': true,
- 'hr': true,
- 'img': true,
- 'input': true,
- 'keygen': true,
- 'link': true,
- 'meta': true,
- 'param': true,
- 'source': true,
- 'track': true,
- 'wbr': true
-};
-
-var newlineEatingTags = {
- 'listing': true,
- 'pre': true,
- 'textarea': true
-};
-
-// For HTML, certain tags cannot have children. This has the same purpose as
-// `omittedCloseTags` except that `menuitem` should still have its closing tag.
-
-var voidElementTags = _assign({
- 'menuitem': true
-}, omittedCloseTags);
-
-// We accept any tag to be rendered but since this gets injected into arbitrary
-// HTML, we want to make sure that it's a safe tag.
-// http://www.w3.org/TR/REC-xml/#NT-Name
-
-var VALID_TAG_REGEX = /^[a-zA-Z][a-zA-Z:_\.\-\d]*$/; // Simplified subset
-var validatedTagCache = {};
-var hasOwnProperty = {}.hasOwnProperty;
-
-function validateDangerousTag(tag) {
- if (!hasOwnProperty.call(validatedTagCache, tag)) {
- !VALID_TAG_REGEX.test(tag) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Invalid tag: %s', tag) : _prodInvariant('65', tag) : void 0;
- validatedTagCache[tag] = true;
- }
-}
-
-function isCustomComponent(tagName, props) {
- return tagName.indexOf('-') >= 0 || props.is != null;
-}
-
-var globalIdCounter = 1;
-
-/**
- * Creates a new React class that is idempotent and capable of containing other
- * React components. It accepts event listeners and DOM properties that are
- * valid according to `DOMProperty`.
- *
- * - Event listeners: `onClick`, `onMouseDown`, etc.
- * - DOM properties: `className`, `name`, `title`, etc.
- *
- * The `style` property functions differently from the DOM API. It accepts an
- * object mapping of style properties to values.
- *
- * @constructor ReactDOMComponent
- * @extends ReactMultiChild
- */
-function ReactDOMComponent(element) {
- var tag = element.type;
- validateDangerousTag(tag);
- this._currentElement = element;
- this._tag = tag.toLowerCase();
- this._namespaceURI = null;
- this._renderedChildren = null;
- this._previousStyle = null;
- this._previousStyleCopy = null;
- this._hostNode = null;
- this._hostParent = null;
- this._rootNodeID = 0;
- this._domID = 0;
- this._hostContainerInfo = null;
- this._wrapperState = null;
- this._topLevelWrapper = null;
- this._flags = 0;
- if (process.env.NODE_ENV !== 'production') {
- this._ancestorInfo = null;
- setAndValidateContentChildDev.call(this, null);
- }
-}
-
-ReactDOMComponent.displayName = 'ReactDOMComponent';
-
-ReactDOMComponent.Mixin = {
-
- /**
- * Generates root tag markup then recurses. This method has side effects and
- * is not idempotent.
- *
- * @internal
- * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
- * @param {?ReactDOMComponent} the parent component instance
- * @param {?object} info about the host container
- * @param {object} context
- * @return {string} The computed markup.
- */
- mountComponent: function (transaction, hostParent, hostContainerInfo, context) {
- this._rootNodeID = globalIdCounter++;
- this._domID = hostContainerInfo._idCounter++;
- this._hostParent = hostParent;
- this._hostContainerInfo = hostContainerInfo;
-
- var props = this._currentElement.props;
-
- switch (this._tag) {
- case 'audio':
- case 'form':
- case 'iframe':
- case 'img':
- case 'link':
- case 'object':
- case 'source':
- case 'video':
- this._wrapperState = {
- listeners: null
- };
- transaction.getReactMountReady().enqueue(trapBubbledEventsLocal, this);
- break;
- case 'input':
- ReactDOMInput.mountWrapper(this, props, hostParent);
- props = ReactDOMInput.getHostProps(this, props);
- transaction.getReactMountReady().enqueue(trapBubbledEventsLocal, this);
- break;
- case 'option':
- ReactDOMOption.mountWrapper(this, props, hostParent);
- props = ReactDOMOption.getHostProps(this, props);
- break;
- case 'select':
- ReactDOMSelect.mountWrapper(this, props, hostParent);
- props = ReactDOMSelect.getHostProps(this, props);
- transaction.getReactMountReady().enqueue(trapBubbledEventsLocal, this);
- break;
- case 'textarea':
- ReactDOMTextarea.mountWrapper(this, props, hostParent);
- props = ReactDOMTextarea.getHostProps(this, props);
- transaction.getReactMountReady().enqueue(trapBubbledEventsLocal, this);
- break;
- }
-
- assertValidProps(this, props);
-
- // We create tags in the namespace of their parent container, except HTML
- // tags get no namespace.
- var namespaceURI;
- var parentTag;
- if (hostParent != null) {
- namespaceURI = hostParent._namespaceURI;
- parentTag = hostParent._tag;
- } else if (hostContainerInfo._tag) {
- namespaceURI = hostContainerInfo._namespaceURI;
- parentTag = hostContainerInfo._tag;
- }
- if (namespaceURI == null || namespaceURI === DOMNamespaces.svg && parentTag === 'foreignobject') {
- namespaceURI = DOMNamespaces.html;
- }
- if (namespaceURI === DOMNamespaces.html) {
- if (this._tag === 'svg') {
- namespaceURI = DOMNamespaces.svg;
- } else if (this._tag === 'math') {
- namespaceURI = DOMNamespaces.mathml;
- }
- }
- this._namespaceURI = namespaceURI;
-
- if (process.env.NODE_ENV !== 'production') {
- var parentInfo;
- if (hostParent != null) {
- parentInfo = hostParent._ancestorInfo;
- } else if (hostContainerInfo._tag) {
- parentInfo = hostContainerInfo._ancestorInfo;
- }
- if (parentInfo) {
- // parentInfo should always be present except for the top-level
- // component when server rendering
- validateDOMNesting(this._tag, null, this, parentInfo);
- }
- this._ancestorInfo = validateDOMNesting.updatedAncestorInfo(parentInfo, this._tag, this);
- }
-
- var mountImage;
- if (transaction.useCreateElement) {
- var ownerDocument = hostContainerInfo._ownerDocument;
- var el;
- if (namespaceURI === DOMNamespaces.html) {
- if (this._tag === 'script') {
- // Create the script via .innerHTML so its "parser-inserted" flag is
- // set to true and it does not execute
- var div = ownerDocument.createElement('div');
- var type = this._currentElement.type;
- div.innerHTML = '<' + type + '></' + type + '>';
- el = div.removeChild(div.firstChild);
- } else if (props.is) {
- el = ownerDocument.createElement(this._currentElement.type, props.is);
- } else {
- // Separate else branch instead of using `props.is || undefined` above becuase of a Firefox bug.
- // See discussion in https://github.com/facebook/react/pull/6896
- // and discussion in https://bugzilla.mozilla.org/show_bug.cgi?id=1276240
- el = ownerDocument.createElement(this._currentElement.type);
- }
- } else {
- el = ownerDocument.createElementNS(namespaceURI, this._currentElement.type);
- }
- ReactDOMComponentTree.precacheNode(this, el);
- this._flags |= Flags.hasCachedChildNodes;
- if (!this._hostParent) {
- DOMPropertyOperations.setAttributeForRoot(el);
- }
- this._updateDOMProperties(null, props, transaction);
- var lazyTree = DOMLazyTree(el);
- this._createInitialChildren(transaction, props, context, lazyTree);
- mountImage = lazyTree;
- } else {
- var tagOpen = this._createOpenTagMarkupAndPutListeners(transaction, props);
- var tagContent = this._createContentMarkup(transaction, props, context);
- if (!tagContent && omittedCloseTags[this._tag]) {
- mountImage = tagOpen + '/>';
- } else {
- mountImage = tagOpen + '>' + tagContent + '</' + this._currentElement.type + '>';
- }
- }
-
- switch (this._tag) {
- case 'input':
- transaction.getReactMountReady().enqueue(inputPostMount, this);
- if (props.autoFocus) {
- transaction.getReactMountReady().enqueue(AutoFocusUtils.focusDOMComponent, this);
- }
- break;
- case 'textarea':
- transaction.getReactMountReady().enqueue(textareaPostMount, this);
- if (props.autoFocus) {
- transaction.getReactMountReady().enqueue(AutoFocusUtils.focusDOMComponent, this);
- }
- break;
- case 'select':
- if (props.autoFocus) {
- transaction.getReactMountReady().enqueue(AutoFocusUtils.focusDOMComponent, this);
- }
- break;
- case 'button':
- if (props.autoFocus) {
- transaction.getReactMountReady().enqueue(AutoFocusUtils.focusDOMComponent, this);
- }
- break;
- case 'option':
- transaction.getReactMountReady().enqueue(optionPostMount, this);
- break;
- }
-
- return mountImage;
- },
-
- /**
- * Creates markup for the open tag and all attributes.
- *
- * This method has side effects because events get registered.
- *
- * Iterating over object properties is faster than iterating over arrays.
- * @see http://jsperf.com/obj-vs-arr-iteration
- *
- * @private
- * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
- * @param {object} props
- * @return {string} Markup of opening tag.
- */
- _createOpenTagMarkupAndPutListeners: function (transaction, props) {
- var ret = '<' + this._currentElement.type;
-
- for (var propKey in props) {
- if (!props.hasOwnProperty(propKey)) {
- continue;
- }
- var propValue = props[propKey];
- if (propValue == null) {
- continue;
- }
- if (registrationNameModules.hasOwnProperty(propKey)) {
- if (propValue) {
- enqueuePutListener(this, propKey, propValue, transaction);
- }
- } else {
- if (propKey === STYLE) {
- if (propValue) {
- if (process.env.NODE_ENV !== 'production') {
- // See `_updateDOMProperties`. style block
- this._previousStyle = propValue;
- }
- propValue = this._previousStyleCopy = _assign({}, props.style);
- }
- propValue = CSSPropertyOperations.createMarkupForStyles(propValue, this);
- }
- var markup = null;
- if (this._tag != null && isCustomComponent(this._tag, props)) {
- if (!RESERVED_PROPS.hasOwnProperty(propKey)) {
- markup = DOMPropertyOperations.createMarkupForCustomAttribute(propKey, propValue);
- }
- } else {
- markup = DOMPropertyOperations.createMarkupForProperty(propKey, propValue);
- }
- if (markup) {
- ret += ' ' + markup;
- }
- }
- }
-
- // For static pages, no need to put React ID and checksum. Saves lots of
- // bytes.
- if (transaction.renderToStaticMarkup) {
- return ret;
- }
-
- if (!this._hostParent) {
- ret += ' ' + DOMPropertyOperations.createMarkupForRoot();
- }
- ret += ' ' + DOMPropertyOperations.createMarkupForID(this._domID);
- return ret;
- },
-
- /**
- * Creates markup for the content between the tags.
- *
- * @private
- * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
- * @param {object} props
- * @param {object} context
- * @return {string} Content markup.
- */
- _createContentMarkup: function (transaction, props, context) {
- var ret = '';
-
- // Intentional use of != to avoid catching zero/false.
- var innerHTML = props.dangerouslySetInnerHTML;
- if (innerHTML != null) {
- if (innerHTML.__html != null) {
- ret = innerHTML.__html;
- }
- } else {
- var contentToUse = CONTENT_TYPES[typeof props.children] ? props.children : null;
- var childrenToUse = contentToUse != null ? null : props.children;
- if (contentToUse != null) {
- // TODO: Validate that text is allowed as a child of this node
- ret = escapeTextContentForBrowser(contentToUse);
- if (process.env.NODE_ENV !== 'production') {
- setAndValidateContentChildDev.call(this, contentToUse);
- }
- } else if (childrenToUse != null) {
- var mountImages = this.mountChildren(childrenToUse, transaction, context);
- ret = mountImages.join('');
- }
- }
- if (newlineEatingTags[this._tag] && ret.charAt(0) === '\n') {
- // text/html ignores the first character in these tags if it's a newline
- // Prefer to break application/xml over text/html (for now) by adding
- // a newline specifically to get eaten by the parser. (Alternately for
- // textareas, replacing "^\n" with "\r\n" doesn't get eaten, and the first
- // \r is normalized out by HTMLTextAreaElement#value.)
- // See: <http://www.w3.org/TR/html-polyglot/#newlines-in-textarea-and-pre>
- // See: <http://www.w3.org/TR/html5/syntax.html#element-restrictions>
- // See: <http://www.w3.org/TR/html5/syntax.html#newlines>
- // See: Parsing of "textarea" "listing" and "pre" elements
- // from <http://www.w3.org/TR/html5/syntax.html#parsing-main-inbody>
- return '\n' + ret;
- } else {
- return ret;
- }
- },
-
- _createInitialChildren: function (transaction, props, context, lazyTree) {
- // Intentional use of != to avoid catching zero/false.
- var innerHTML = props.dangerouslySetInnerHTML;
- if (innerHTML != null) {
- if (innerHTML.__html != null) {
- DOMLazyTree.queueHTML(lazyTree, innerHTML.__html);
- }
- } else {
- var contentToUse = CONTENT_TYPES[typeof props.children] ? props.children : null;
- var childrenToUse = contentToUse != null ? null : props.children;
- // TODO: Validate that text is allowed as a child of this node
- if (contentToUse != null) {
- // Avoid setting textContent when the text is empty. In IE11 setting
- // textContent on a text area will cause the placeholder to not
- // show within the textarea until it has been focused and blurred again.
- // https://github.com/facebook/react/issues/6731#issuecomment-254874553
- if (contentToUse !== '') {
- if (process.env.NODE_ENV !== 'production') {
- setAndValidateContentChildDev.call(this, contentToUse);
- }
- DOMLazyTree.queueText(lazyTree, contentToUse);
- }
- } else if (childrenToUse != null) {
- var mountImages = this.mountChildren(childrenToUse, transaction, context);
- for (var i = 0; i < mountImages.length; i++) {
- DOMLazyTree.queueChild(lazyTree, mountImages[i]);
- }
- }
- }
- },
-
- /**
- * Receives a next element and updates the component.
- *
- * @internal
- * @param {ReactElement} nextElement
- * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
- * @param {object} context
- */
- receiveComponent: function (nextElement, transaction, context) {
- var prevElement = this._currentElement;
- this._currentElement = nextElement;
- this.updateComponent(transaction, prevElement, nextElement, context);
- },
-
- /**
- * Updates a DOM component after it has already been allocated and
- * attached to the DOM. Reconciles the root DOM node, then recurses.
- *
- * @param {ReactReconcileTransaction} transaction
- * @param {ReactElement} prevElement
- * @param {ReactElement} nextElement
- * @internal
- * @overridable
- */
- updateComponent: function (transaction, prevElement, nextElement, context) {
- var lastProps = prevElement.props;
- var nextProps = this._currentElement.props;
-
- switch (this._tag) {
- case 'input':
- lastProps = ReactDOMInput.getHostProps(this, lastProps);
- nextProps = ReactDOMInput.getHostProps(this, nextProps);
- break;
- case 'option':
- lastProps = ReactDOMOption.getHostProps(this, lastProps);
- nextProps = ReactDOMOption.getHostProps(this, nextProps);
- break;
- case 'select':
- lastProps = ReactDOMSelect.getHostProps(this, lastProps);
- nextProps = ReactDOMSelect.getHostProps(this, nextProps);
- break;
- case 'textarea':
- lastProps = ReactDOMTextarea.getHostProps(this, lastProps);
- nextProps = ReactDOMTextarea.getHostProps(this, nextProps);
- break;
- }
-
- assertValidProps(this, nextProps);
- this._updateDOMProperties(lastProps, nextProps, transaction);
- this._updateDOMChildren(lastProps, nextProps, transaction, context);
-
- switch (this._tag) {
- case 'input':
- // Update the wrapper around inputs *after* updating props. This has to
- // happen after `_updateDOMProperties`. Otherwise HTML5 input validations
- // raise warnings and prevent the new value from being assigned.
- ReactDOMInput.updateWrapper(this);
- break;
- case 'textarea':
- ReactDOMTextarea.updateWrapper(this);
- break;
- case 'select':
- // <select> value update needs to occur after <option> children
- // reconciliation
- transaction.getReactMountReady().enqueue(postUpdateSelectWrapper, this);
- break;
- }
- },
-
- /**
- * Reconciles the properties by detecting differences in property values and
- * updating the DOM as necessary. This function is probably the single most
- * critical path for performance optimization.
- *
- * TODO: Benchmark whether checking for changed values in memory actually
- * improves performance (especially statically positioned elements).
- * TODO: Benchmark the effects of putting this at the top since 99% of props
- * do not change for a given reconciliation.
- * TODO: Benchmark areas that can be improved with caching.
- *
- * @private
- * @param {object} lastProps
- * @param {object} nextProps
- * @param {?DOMElement} node
- */
- _updateDOMProperties: function (lastProps, nextProps, transaction) {
- var propKey;
- var styleName;
- var styleUpdates;
- for (propKey in lastProps) {
- if (nextProps.hasOwnProperty(propKey) || !lastProps.hasOwnProperty(propKey) || lastProps[propKey] == null) {
- continue;
- }
- if (propKey === STYLE) {
- var lastStyle = this._previousStyleCopy;
- for (styleName in lastStyle) {
- if (lastStyle.hasOwnProperty(styleName)) {
- styleUpdates = styleUpdates || {};
- styleUpdates[styleName] = '';
- }
- }
- this._previousStyleCopy = null;
- } else if (registrationNameModules.hasOwnProperty(propKey)) {
- if (lastProps[propKey]) {
- // Only call deleteListener if there was a listener previously or
- // else willDeleteListener gets called when there wasn't actually a
- // listener (e.g., onClick={null})
- deleteListener(this, propKey);
- }
- } else if (isCustomComponent(this._tag, lastProps)) {
- if (!RESERVED_PROPS.hasOwnProperty(propKey)) {
- DOMPropertyOperations.deleteValueForAttribute(getNode(this), propKey);
- }
- } else if (DOMProperty.properties[propKey] || DOMProperty.isCustomAttribute(propKey)) {
- DOMPropertyOperations.deleteValueForProperty(getNode(this), propKey);
- }
- }
- for (propKey in nextProps) {
- var nextProp = nextProps[propKey];
- var lastProp = propKey === STYLE ? this._previousStyleCopy : lastProps != null ? lastProps[propKey] : undefined;
- if (!nextProps.hasOwnProperty(propKey) || nextProp === lastProp || nextProp == null && lastProp == null) {
- continue;
- }
- if (propKey === STYLE) {
- if (nextProp) {
- if (process.env.NODE_ENV !== 'production') {
- checkAndWarnForMutatedStyle(this._previousStyleCopy, this._previousStyle, this);
- this._previousStyle = nextProp;
- }
- nextProp = this._previousStyleCopy = _assign({}, nextProp);
- } else {
- this._previousStyleCopy = null;
- }
- if (lastProp) {
- // Unset styles on `lastProp` but not on `nextProp`.
- for (styleName in lastProp) {
- if (lastProp.hasOwnProperty(styleName) && (!nextProp || !nextProp.hasOwnProperty(styleName))) {
- styleUpdates = styleUpdates || {};
- styleUpdates[styleName] = '';
- }
- }
- // Update styles that changed since `lastProp`.
- for (styleName in nextProp) {
- if (nextProp.hasOwnProperty(styleName) && lastProp[styleName] !== nextProp[styleName]) {
- styleUpdates = styleUpdates || {};
- styleUpdates[styleName] = nextProp[styleName];
- }
- }
- } else {
- // Relies on `updateStylesByID` not mutating `styleUpdates`.
- styleUpdates = nextProp;
- }
- } else if (registrationNameModules.hasOwnProperty(propKey)) {
- if (nextProp) {
- enqueuePutListener(this, propKey, nextProp, transaction);
- } else if (lastProp) {
- deleteListener(this, propKey);
- }
- } else if (isCustomComponent(this._tag, nextProps)) {
- if (!RESERVED_PROPS.hasOwnProperty(propKey)) {
- DOMPropertyOperations.setValueForAttribute(getNode(this), propKey, nextProp);
- }
- } else if (DOMProperty.properties[propKey] || DOMProperty.isCustomAttribute(propKey)) {
- var node = getNode(this);
- // If we're updating to null or undefined, we should remove the property
- // from the DOM node instead of inadvertently setting to a string. This
- // brings us in line with the same behavior we have on initial render.
- if (nextProp != null) {
- DOMPropertyOperations.setValueForProperty(node, propKey, nextProp);
- } else {
- DOMPropertyOperations.deleteValueForProperty(node, propKey);
- }
- }
- }
- if (styleUpdates) {
- CSSPropertyOperations.setValueForStyles(getNode(this), styleUpdates, this);
- }
- },
-
- /**
- * Reconciles the children with the various properties that affect the
- * children content.
- *
- * @param {object} lastProps
- * @param {object} nextProps
- * @param {ReactReconcileTransaction} transaction
- * @param {object} context
- */
- _updateDOMChildren: function (lastProps, nextProps, transaction, context) {
- var lastContent = CONTENT_TYPES[typeof lastProps.children] ? lastProps.children : null;
- var nextContent = CONTENT_TYPES[typeof nextProps.children] ? nextProps.children : null;
-
- var lastHtml = lastProps.dangerouslySetInnerHTML && lastProps.dangerouslySetInnerHTML.__html;
- var nextHtml = nextProps.dangerouslySetInnerHTML && nextProps.dangerouslySetInnerHTML.__html;
-
- // Note the use of `!=` which checks for null or undefined.
- var lastChildren = lastContent != null ? null : lastProps.children;
- var nextChildren = nextContent != null ? null : nextProps.children;
-
- // If we're switching from children to content/html or vice versa, remove
- // the old content
- var lastHasContentOrHtml = lastContent != null || lastHtml != null;
- var nextHasContentOrHtml = nextContent != null || nextHtml != null;
- if (lastChildren != null && nextChildren == null) {
- this.updateChildren(null, transaction, context);
- } else if (lastHasContentOrHtml && !nextHasContentOrHtml) {
- this.updateTextContent('');
- if (process.env.NODE_ENV !== 'production') {
- ReactInstrumentation.debugTool.onSetChildren(this._debugID, []);
- }
- }
-
- if (nextContent != null) {
- if (lastContent !== nextContent) {
- this.updateTextContent('' + nextContent);
- if (process.env.NODE_ENV !== 'production') {
- setAndValidateContentChildDev.call(this, nextContent);
- }
- }
- } else if (nextHtml != null) {
- if (lastHtml !== nextHtml) {
- this.updateMarkup('' + nextHtml);
- }
- if (process.env.NODE_ENV !== 'production') {
- ReactInstrumentation.debugTool.onSetChildren(this._debugID, []);
- }
- } else if (nextChildren != null) {
- if (process.env.NODE_ENV !== 'production') {
- setAndValidateContentChildDev.call(this, null);
- }
-
- this.updateChildren(nextChildren, transaction, context);
- }
- },
-
- getHostNode: function () {
- return getNode(this);
- },
-
- /**
- * Destroys all event registrations for this instance. Does not remove from
- * the DOM. That must be done by the parent.
- *
- * @internal
- */
- unmountComponent: function (safely) {
- switch (this._tag) {
- case 'audio':
- case 'form':
- case 'iframe':
- case 'img':
- case 'link':
- case 'object':
- case 'source':
- case 'video':
- var listeners = this._wrapperState.listeners;
- if (listeners) {
- for (var i = 0; i < listeners.length; i++) {
- listeners[i].remove();
- }
- }
- break;
- case 'html':
- case 'head':
- case 'body':
- /**
- * Components like <html> <head> and <body> can't be removed or added
- * easily in a cross-browser way, however it's valuable to be able to
- * take advantage of React's reconciliation for styling and <title>
- * management. So we just document it and throw in dangerous cases.
- */
- !false ? process.env.NODE_ENV !== 'production' ? invariant(false, '<%s> tried to unmount. Because of cross-browser quirks it is impossible to unmount some top-level components (eg <html>, <head>, and <body>) reliably and efficiently. To fix this, have a single top-level component that never unmounts render these elements.', this._tag) : _prodInvariant('66', this._tag) : void 0;
- break;
- }
-
- this.unmountChildren(safely);
- ReactDOMComponentTree.uncacheNode(this);
- EventPluginHub.deleteAllListeners(this);
- this._rootNodeID = 0;
- this._domID = 0;
- this._wrapperState = null;
-
- if (process.env.NODE_ENV !== 'production') {
- setAndValidateContentChildDev.call(this, null);
- }
- },
-
- getPublicInstance: function () {
- return getNode(this);
- }
-
-};
-
-_assign(ReactDOMComponent.prototype, ReactDOMComponent.Mixin, ReactMultiChild.Mixin);
-
-module.exports = ReactDOMComponent;
-}).call(this,require('_process'))
-
-},{"./AutoFocusUtils":49,"./CSSPropertyOperations":52,"./DOMLazyTree":56,"./DOMNamespaces":57,"./DOMProperty":58,"./DOMPropertyOperations":59,"./EventPluginHub":63,"./EventPluginRegistry":64,"./ReactBrowserEventEmitter":72,"./ReactDOMComponentFlags":79,"./ReactDOMComponentTree":80,"./ReactDOMInput":85,"./ReactDOMOption":88,"./ReactDOMSelect":89,"./ReactDOMTextarea":92,"./ReactInstrumentation":109,"./ReactMultiChild":113,"./ReactServerRenderingTransaction":121,"./escapeTextContentForBrowser":149,"./isEventSupported":164,"./reactProdInvariant":167,"./validateDOMNesting":173,"_process":43,"fbjs/lib/emptyFunction":10,"fbjs/lib/invariant":18,"fbjs/lib/shallowEqual":24,"fbjs/lib/warning":25,"object-assign":42}],79:[function(require,module,exports){
-/**
- * Copyright 2015-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-'use strict';
-
-var ReactDOMComponentFlags = {
- hasCachedChildNodes: 1 << 0
-};
-
-module.exports = ReactDOMComponentFlags;
-},{}],80:[function(require,module,exports){
-(function (process){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-'use strict';
-
-var _prodInvariant = require('./reactProdInvariant');
-
-var DOMProperty = require('./DOMProperty');
-var ReactDOMComponentFlags = require('./ReactDOMComponentFlags');
-
-var invariant = require('fbjs/lib/invariant');
-
-var ATTR_NAME = DOMProperty.ID_ATTRIBUTE_NAME;
-var Flags = ReactDOMComponentFlags;
-
-var internalInstanceKey = '__reactInternalInstance$' + Math.random().toString(36).slice(2);
-
-/**
- * Check if a given node should be cached.
- */
-function shouldPrecacheNode(node, nodeID) {
- return node.nodeType === 1 && node.getAttribute(ATTR_NAME) === String(nodeID) || node.nodeType === 8 && node.nodeValue === ' react-text: ' + nodeID + ' ' || node.nodeType === 8 && node.nodeValue === ' react-empty: ' + nodeID + ' ';
-}
-
-/**
- * Drill down (through composites and empty components) until we get a host or
- * host text component.
- *
- * This is pretty polymorphic but unavoidable with the current structure we have
- * for `_renderedChildren`.
- */
-function getRenderedHostOrTextFromComponent(component) {
- var rendered;
- while (rendered = component._renderedComponent) {
- component = rendered;
- }
- return component;
-}
-
-/**
- * Populate `_hostNode` on the rendered host/text component with the given
- * DOM node. The passed `inst` can be a composite.
- */
-function precacheNode(inst, node) {
- var hostInst = getRenderedHostOrTextFromComponent(inst);
- hostInst._hostNode = node;
- node[internalInstanceKey] = hostInst;
-}
-
-function uncacheNode(inst) {
- var node = inst._hostNode;
- if (node) {
- delete node[internalInstanceKey];
- inst._hostNode = null;
- }
-}
-
-/**
- * Populate `_hostNode` on each child of `inst`, assuming that the children
- * match up with the DOM (element) children of `node`.
- *
- * We cache entire levels at once to avoid an n^2 problem where we access the
- * children of a node sequentially and have to walk from the start to our target
- * node every time.
- *
- * Since we update `_renderedChildren` and the actual DOM at (slightly)
- * different times, we could race here and see a newer `_renderedChildren` than
- * the DOM nodes we see. To avoid this, ReactMultiChild calls
- * `prepareToManageChildren` before we change `_renderedChildren`, at which
- * time the container's child nodes are always cached (until it unmounts).
- */
-function precacheChildNodes(inst, node) {
- if (inst._flags & Flags.hasCachedChildNodes) {
- return;
- }
- var children = inst._renderedChildren;
- var childNode = node.firstChild;
- outer: for (var name in children) {
- if (!children.hasOwnProperty(name)) {
- continue;
- }
- var childInst = children[name];
- var childID = getRenderedHostOrTextFromComponent(childInst)._domID;
- if (childID === 0) {
- // We're currently unmounting this child in ReactMultiChild; skip it.
- continue;
- }
- // We assume the child nodes are in the same order as the child instances.
- for (; childNode !== null; childNode = childNode.nextSibling) {
- if (shouldPrecacheNode(childNode, childID)) {
- precacheNode(childInst, childNode);
- continue outer;
- }
- }
- // We reached the end of the DOM children without finding an ID match.
- !false ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;
- }
- inst._flags |= Flags.hasCachedChildNodes;
-}
-
-/**
- * Given a DOM node, return the closest ReactDOMComponent or
- * ReactDOMTextComponent instance ancestor.
- */
-function getClosestInstanceFromNode(node) {
- if (node[internalInstanceKey]) {
- return node[internalInstanceKey];
- }
-
- // Walk up the tree until we find an ancestor whose instance we have cached.
- var parents = [];
- while (!node[internalInstanceKey]) {
- parents.push(node);
- if (node.parentNode) {
- node = node.parentNode;
- } else {
- // Top of the tree. This node must not be part of a React tree (or is
- // unmounted, potentially).
- return null;
- }
- }
-
- var closest;
- var inst;
- for (; node && (inst = node[internalInstanceKey]); node = parents.pop()) {
- closest = inst;
- if (parents.length) {
- precacheChildNodes(inst, node);
- }
- }
-
- return closest;
-}
-
-/**
- * Given a DOM node, return the ReactDOMComponent or ReactDOMTextComponent
- * instance, or null if the node was not rendered by this React.
- */
-function getInstanceFromNode(node) {
- var inst = getClosestInstanceFromNode(node);
- if (inst != null && inst._hostNode === node) {
- return inst;
- } else {
- return null;
- }
-}
-
-/**
- * Given a ReactDOMComponent or ReactDOMTextComponent, return the corresponding
- * DOM node.
- */
-function getNodeFromInstance(inst) {
- // Without this first invariant, passing a non-DOM-component triggers the next
- // invariant for a missing parent, which is super confusing.
- !(inst._hostNode !== undefined) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'getNodeFromInstance: Invalid argument.') : _prodInvariant('33') : void 0;
-
- if (inst._hostNode) {
- return inst._hostNode;
- }
-
- // Walk up the tree until we find an ancestor whose DOM node we have cached.
- var parents = [];
- while (!inst._hostNode) {
- parents.push(inst);
- !inst._hostParent ? process.env.NODE_ENV !== 'production' ? invariant(false, 'React DOM tree root should always have a node reference.') : _prodInvariant('34') : void 0;
- inst = inst._hostParent;
- }
-
- // Now parents contains each ancestor that does *not* have a cached native
- // node, and `inst` is the deepest ancestor that does.
- for (; parents.length; inst = parents.pop()) {
- precacheChildNodes(inst, inst._hostNode);
- }
-
- return inst._hostNode;
-}
-
-var ReactDOMComponentTree = {
- getClosestInstanceFromNode: getClosestInstanceFromNode,
- getInstanceFromNode: getInstanceFromNode,
- getNodeFromInstance: getNodeFromInstance,
- precacheChildNodes: precacheChildNodes,
- precacheNode: precacheNode,
- uncacheNode: uncacheNode
-};
-
-module.exports = ReactDOMComponentTree;
-}).call(this,require('_process'))
-
-},{"./DOMProperty":58,"./ReactDOMComponentFlags":79,"./reactProdInvariant":167,"_process":43,"fbjs/lib/invariant":18}],81:[function(require,module,exports){
-(function (process){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-'use strict';
-
-var validateDOMNesting = require('./validateDOMNesting');
-
-var DOC_NODE_TYPE = 9;
-
-function ReactDOMContainerInfo(topLevelWrapper, node) {
- var info = {
- _topLevelWrapper: topLevelWrapper,
- _idCounter: 1,
- _ownerDocument: node ? node.nodeType === DOC_NODE_TYPE ? node : node.ownerDocument : null,
- _node: node,
- _tag: node ? node.nodeName.toLowerCase() : null,
- _namespaceURI: node ? node.namespaceURI : null
- };
- if (process.env.NODE_ENV !== 'production') {
- info._ancestorInfo = node ? validateDOMNesting.updatedAncestorInfo(null, info._tag, null) : null;
- }
- return info;
-}
-
-module.exports = ReactDOMContainerInfo;
-}).call(this,require('_process'))
-
-},{"./validateDOMNesting":173,"_process":43}],82:[function(require,module,exports){
-/**
- * Copyright 2014-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-'use strict';
-
-var _assign = require('object-assign');
-
-var DOMLazyTree = require('./DOMLazyTree');
-var ReactDOMComponentTree = require('./ReactDOMComponentTree');
-
-var ReactDOMEmptyComponent = function (instantiate) {
- // ReactCompositeComponent uses this:
- this._currentElement = null;
- // ReactDOMComponentTree uses these:
- this._hostNode = null;
- this._hostParent = null;
- this._hostContainerInfo = null;
- this._domID = 0;
-};
-_assign(ReactDOMEmptyComponent.prototype, {
- mountComponent: function (transaction, hostParent, hostContainerInfo, context) {
- var domID = hostContainerInfo._idCounter++;
- this._domID = domID;
- this._hostParent = hostParent;
- this._hostContainerInfo = hostContainerInfo;
-
- var nodeValue = ' react-empty: ' + this._domID + ' ';
- if (transaction.useCreateElement) {
- var ownerDocument = hostContainerInfo._ownerDocument;
- var node = ownerDocument.createComment(nodeValue);
- ReactDOMComponentTree.precacheNode(this, node);
- return DOMLazyTree(node);
- } else {
- if (transaction.renderToStaticMarkup) {
- // Normally we'd insert a comment node, but since this is a situation
- // where React won't take over (static pages), we can simply return
- // nothing.
- return '';
- }
- return '<!--' + nodeValue + '-->';
- }
- },
- receiveComponent: function () {},
- getHostNode: function () {
- return ReactDOMComponentTree.getNodeFromInstance(this);
- },
- unmountComponent: function () {
- ReactDOMComponentTree.uncacheNode(this);
- }
-});
-
-module.exports = ReactDOMEmptyComponent;
-},{"./DOMLazyTree":56,"./ReactDOMComponentTree":80,"object-assign":42}],83:[function(require,module,exports){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-'use strict';
-
-var ReactDOMFeatureFlags = {
- useCreateElement: true,
- useFiber: false
-};
-
-module.exports = ReactDOMFeatureFlags;
-},{}],84:[function(require,module,exports){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-'use strict';
-
-var DOMChildrenOperations = require('./DOMChildrenOperations');
-var ReactDOMComponentTree = require('./ReactDOMComponentTree');
-
-/**
- * Operations used to process updates to DOM nodes.
- */
-var ReactDOMIDOperations = {
-
- /**
- * Updates a component's children by processing a series of updates.
- *
- * @param {array<object>} updates List of update configurations.
- * @internal
- */
- dangerouslyProcessChildrenUpdates: function (parentInst, updates) {
- var node = ReactDOMComponentTree.getNodeFromInstance(parentInst);
- DOMChildrenOperations.processUpdates(node, updates);
- }
-};
-
-module.exports = ReactDOMIDOperations;
-},{"./DOMChildrenOperations":55,"./ReactDOMComponentTree":80}],85:[function(require,module,exports){
-(function (process){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-'use strict';
-
-var _prodInvariant = require('./reactProdInvariant'),
- _assign = require('object-assign');
-
-var DOMPropertyOperations = require('./DOMPropertyOperations');
-var LinkedValueUtils = require('./LinkedValueUtils');
-var ReactDOMComponentTree = require('./ReactDOMComponentTree');
-var ReactUpdates = require('./ReactUpdates');
-
-var invariant = require('fbjs/lib/invariant');
-var warning = require('fbjs/lib/warning');
-
-var didWarnValueLink = false;
-var didWarnCheckedLink = false;
-var didWarnValueDefaultValue = false;
-var didWarnCheckedDefaultChecked = false;
-var didWarnControlledToUncontrolled = false;
-var didWarnUncontrolledToControlled = false;
-
-function forceUpdateIfMounted() {
- if (this._rootNodeID) {
- // DOM component is still mounted; update
- ReactDOMInput.updateWrapper(this);
- }
-}
-
-function isControlled(props) {
- var usesChecked = props.type === 'checkbox' || props.type === 'radio';
- return usesChecked ? props.checked != null : props.value != null;
-}
-
-/**
- * Implements an <input> host component that allows setting these optional
- * props: `checked`, `value`, `defaultChecked`, and `defaultValue`.
- *
- * If `checked` or `value` are not supplied (or null/undefined), user actions
- * that affect the checked state or value will trigger updates to the element.
- *
- * If they are supplied (and not null/undefined), the rendered element will not
- * trigger updates to the element. Instead, the props must change in order for
- * the rendered element to be updated.
- *
- * The rendered element will be initialized as unchecked (or `defaultChecked`)
- * with an empty value (or `defaultValue`).
- *
- * @see http://www.w3.org/TR/2012/WD-html5-20121025/the-input-element.html
- */
-var ReactDOMInput = {
- getHostProps: function (inst, props) {
- var value = LinkedValueUtils.getValue(props);
- var checked = LinkedValueUtils.getChecked(props);
-
- var hostProps = _assign({
- // Make sure we set .type before any other properties (setting .value
- // before .type means .value is lost in IE11 and below)
- type: undefined,
- // Make sure we set .step before .value (setting .value before .step
- // means .value is rounded on mount, based upon step precision)
- step: undefined,
- // Make sure we set .min & .max before .value (to ensure proper order
- // in corner cases such as min or max deriving from value, e.g. Issue #7170)
- min: undefined,
- max: undefined
- }, props, {
- defaultChecked: undefined,
- defaultValue: undefined,
- value: value != null ? value : inst._wrapperState.initialValue,
- checked: checked != null ? checked : inst._wrapperState.initialChecked,
- onChange: inst._wrapperState.onChange
- });
-
- return hostProps;
- },
-
- mountWrapper: function (inst, props) {
- if (process.env.NODE_ENV !== 'production') {
- LinkedValueUtils.checkPropTypes('input', props, inst._currentElement._owner);
-
- var owner = inst._currentElement._owner;
-
- if (props.valueLink !== undefined && !didWarnValueLink) {
- process.env.NODE_ENV !== 'production' ? warning(false, '`valueLink` prop on `input` is deprecated; set `value` and `onChange` instead.') : void 0;
- didWarnValueLink = true;
- }
- if (props.checkedLink !== undefined && !didWarnCheckedLink) {
- process.env.NODE_ENV !== 'production' ? warning(false, '`checkedLink` prop on `input` is deprecated; set `value` and `onChange` instead.') : void 0;
- didWarnCheckedLink = true;
- }
- if (props.checked !== undefined && props.defaultChecked !== undefined && !didWarnCheckedDefaultChecked) {
- process.env.NODE_ENV !== 'production' ? warning(false, '%s contains an input of type %s with both checked and defaultChecked props. ' + 'Input elements must be either controlled or uncontrolled ' + '(specify either the checked prop, or the defaultChecked prop, but not ' + 'both). Decide between using a controlled or uncontrolled input ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components', owner && owner.getName() || 'A component', props.type) : void 0;
- didWarnCheckedDefaultChecked = true;
- }
- if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValueDefaultValue) {
- process.env.NODE_ENV !== 'production' ? warning(false, '%s contains an input of type %s with both value and defaultValue props. ' + 'Input elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled input ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components', owner && owner.getName() || 'A component', props.type) : void 0;
- didWarnValueDefaultValue = true;
- }
- }
-
- var defaultValue = props.defaultValue;
- inst._wrapperState = {
- initialChecked: props.checked != null ? props.checked : props.defaultChecked,
- initialValue: props.value != null ? props.value : defaultValue,
- listeners: null,
- onChange: _handleChange.bind(inst)
- };
-
- if (process.env.NODE_ENV !== 'production') {
- inst._wrapperState.controlled = isControlled(props);
- }
- },
-
- updateWrapper: function (inst) {
- var props = inst._currentElement.props;
-
- if (process.env.NODE_ENV !== 'production') {
- var controlled = isControlled(props);
- var owner = inst._currentElement._owner;
-
- if (!inst._wrapperState.controlled && controlled && !didWarnUncontrolledToControlled) {
- process.env.NODE_ENV !== 'production' ? warning(false, '%s is changing an uncontrolled input of type %s to be controlled. ' + 'Input elements should not switch from uncontrolled to controlled (or vice versa). ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://fb.me/react-controlled-components', owner && owner.getName() || 'A component', props.type) : void 0;
- didWarnUncontrolledToControlled = true;
- }
- if (inst._wrapperState.controlled && !controlled && !didWarnControlledToUncontrolled) {
- process.env.NODE_ENV !== 'production' ? warning(false, '%s is changing a controlled input of type %s to be uncontrolled. ' + 'Input elements should not switch from controlled to uncontrolled (or vice versa). ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://fb.me/react-controlled-components', owner && owner.getName() || 'A component', props.type) : void 0;
- didWarnControlledToUncontrolled = true;
- }
- }
-
- // TODO: Shouldn't this be getChecked(props)?
- var checked = props.checked;
- if (checked != null) {
- DOMPropertyOperations.setValueForProperty(ReactDOMComponentTree.getNodeFromInstance(inst), 'checked', checked || false);
- }
-
- var node = ReactDOMComponentTree.getNodeFromInstance(inst);
- var value = LinkedValueUtils.getValue(props);
- if (value != null) {
-
- // Cast `value` to a string to ensure the value is set correctly. While
- // browsers typically do this as necessary, jsdom doesn't.
- var newValue = '' + value;
-
- // To avoid side effects (such as losing text selection), only set value if changed
- if (newValue !== node.value) {
- node.value = newValue;
- }
- } else {
- if (props.value == null && props.defaultValue != null) {
- // In Chrome, assigning defaultValue to certain input types triggers input validation.
- // For number inputs, the display value loses trailing decimal points. For email inputs,
- // Chrome raises "The specified value <x> is not a valid email address".
- //
- // Here we check to see if the defaultValue has actually changed, avoiding these problems
- // when the user is inputting text
- //
- // https://github.com/facebook/react/issues/7253
- if (node.defaultValue !== '' + props.defaultValue) {
- node.defaultValue = '' + props.defaultValue;
- }
- }
- if (props.checked == null && props.defaultChecked != null) {
- node.defaultChecked = !!props.defaultChecked;
- }
- }
- },
-
- postMountWrapper: function (inst) {
- var props = inst._currentElement.props;
-
- // This is in postMount because we need access to the DOM node, which is not
- // available until after the component has mounted.
- var node = ReactDOMComponentTree.getNodeFromInstance(inst);
-
- // Detach value from defaultValue. We won't do anything if we're working on
- // submit or reset inputs as those values & defaultValues are linked. They
- // are not resetable nodes so this operation doesn't matter and actually
- // removes browser-default values (eg "Submit Query") when no value is
- // provided.
-
- switch (props.type) {
- case 'submit':
- case 'reset':
- break;
- case 'color':
- case 'date':
- case 'datetime':
- case 'datetime-local':
- case 'month':
- case 'time':
- case 'week':
- // This fixes the no-show issue on iOS Safari and Android Chrome:
- // https://github.com/facebook/react/issues/7233
- node.value = '';
- node.value = node.defaultValue;
- break;
- default:
- node.value = node.value;
- break;
- }
-
- // Normally, we'd just do `node.checked = node.checked` upon initial mount, less this bug
- // this is needed to work around a chrome bug where setting defaultChecked
- // will sometimes influence the value of checked (even after detachment).
- // Reference: https://bugs.chromium.org/p/chromium/issues/detail?id=608416
- // We need to temporarily unset name to avoid disrupting radio button groups.
- var name = node.name;
- if (name !== '') {
- node.name = '';
- }
- node.defaultChecked = !node.defaultChecked;
- node.defaultChecked = !node.defaultChecked;
- if (name !== '') {
- node.name = name;
- }
- }
-};
-
-function _handleChange(event) {
- var props = this._currentElement.props;
-
- var returnValue = LinkedValueUtils.executeOnChange(props, event);
-
- // Here we use asap to wait until all updates have propagated, which
- // is important when using controlled components within layers:
- // https://github.com/facebook/react/issues/1698
- ReactUpdates.asap(forceUpdateIfMounted, this);
-
- var name = props.name;
- if (props.type === 'radio' && name != null) {
- var rootNode = ReactDOMComponentTree.getNodeFromInstance(this);
- var queryRoot = rootNode;
-
- while (queryRoot.parentNode) {
- queryRoot = queryRoot.parentNode;
- }
-
- // If `rootNode.form` was non-null, then we could try `form.elements`,
- // but that sometimes behaves strangely in IE8. We could also try using
- // `form.getElementsByName`, but that will only return direct children
- // and won't include inputs that use the HTML5 `form=` attribute. Since
- // the input might not even be in a form, let's just use the global
- // `querySelectorAll` to ensure we don't miss anything.
- var group = queryRoot.querySelectorAll('input[name=' + JSON.stringify('' + name) + '][type="radio"]');
-
- for (var i = 0; i < group.length; i++) {
- var otherNode = group[i];
- if (otherNode === rootNode || otherNode.form !== rootNode.form) {
- continue;
- }
- // This will throw if radio buttons rendered by different copies of React
- // and the same name are rendered into the same form (same as #1939).
- // That's probably okay; we don't support it just as we don't support
- // mixing React radio buttons with non-React ones.
- var otherInstance = ReactDOMComponentTree.getInstanceFromNode(otherNode);
- !otherInstance ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactDOMInput: Mixing React and non-React radio inputs with the same `name` is not supported.') : _prodInvariant('90') : void 0;
- // If this is a controlled radio button group, forcing the input that
- // was previously checked to update will cause it to be come re-checked
- // as appropriate.
- ReactUpdates.asap(forceUpdateIfMounted, otherInstance);
- }
- }
-
- return returnValue;
-}
-
-module.exports = ReactDOMInput;
-}).call(this,require('_process'))
-
-},{"./DOMPropertyOperations":59,"./LinkedValueUtils":70,"./ReactDOMComponentTree":80,"./ReactUpdates":124,"./reactProdInvariant":167,"_process":43,"fbjs/lib/invariant":18,"fbjs/lib/warning":25,"object-assign":42}],86:[function(require,module,exports){
-(function (process){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-'use strict';
-
-var DOMProperty = require('./DOMProperty');
-var ReactComponentTreeHook = require('react/lib/ReactComponentTreeHook');
-
-var warning = require('fbjs/lib/warning');
-
-var warnedProperties = {};
-var rARIA = new RegExp('^(aria)-[' + DOMProperty.ATTRIBUTE_NAME_CHAR + ']*$');
-
-function validateProperty(tagName, name, debugID) {
- if (warnedProperties.hasOwnProperty(name) && warnedProperties[name]) {
- return true;
- }
-
- if (rARIA.test(name)) {
- var lowerCasedName = name.toLowerCase();
- var standardName = DOMProperty.getPossibleStandardName.hasOwnProperty(lowerCasedName) ? DOMProperty.getPossibleStandardName[lowerCasedName] : null;
-
- // If this is an aria-* attribute, but is not listed in the known DOM
- // DOM properties, then it is an invalid aria-* attribute.
- if (standardName == null) {
- warnedProperties[name] = true;
- return false;
- }
- // aria-* attributes should be lowercase; suggest the lowercase version.
- if (name !== standardName) {
- process.env.NODE_ENV !== 'production' ? warning(false, 'Unknown ARIA attribute %s. Did you mean %s?%s', name, standardName, ReactComponentTreeHook.getStackAddendumByID(debugID)) : void 0;
- warnedProperties[name] = true;
- return true;
- }
- }
-
- return true;
-}
-
-function warnInvalidARIAProps(debugID, element) {
- var invalidProps = [];
-
- for (var key in element.props) {
- var isValid = validateProperty(element.type, key, debugID);
- if (!isValid) {
- invalidProps.push(key);
- }
- }
-
- var unknownPropString = invalidProps.map(function (prop) {
- return '`' + prop + '`';
- }).join(', ');
-
- if (invalidProps.length === 1) {
- process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid aria prop %s on <%s> tag. ' + 'For details, see https://fb.me/invalid-aria-prop%s', unknownPropString, element.type, ReactComponentTreeHook.getStackAddendumByID(debugID)) : void 0;
- } else if (invalidProps.length > 1) {
- process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid aria props %s on <%s> tag. ' + 'For details, see https://fb.me/invalid-aria-prop%s', unknownPropString, element.type, ReactComponentTreeHook.getStackAddendumByID(debugID)) : void 0;
- }
-}
-
-function handleElement(debugID, element) {
- if (element == null || typeof element.type !== 'string') {
- return;
- }
- if (element.type.indexOf('-') >= 0 || element.props.is) {
- return;
- }
-
- warnInvalidARIAProps(debugID, element);
-}
-
-var ReactDOMInvalidARIAHook = {
- onBeforeMountComponent: function (debugID, element) {
- if (process.env.NODE_ENV !== 'production') {
- handleElement(debugID, element);
- }
- },
- onBeforeUpdateComponent: function (debugID, element) {
- if (process.env.NODE_ENV !== 'production') {
- handleElement(debugID, element);
- }
- }
-};
-
-module.exports = ReactDOMInvalidARIAHook;
-}).call(this,require('_process'))
-
-},{"./DOMProperty":58,"_process":43,"fbjs/lib/warning":25,"react/lib/ReactComponentTreeHook":194}],87:[function(require,module,exports){
-(function (process){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-'use strict';
-
-var ReactComponentTreeHook = require('react/lib/ReactComponentTreeHook');
-
-var warning = require('fbjs/lib/warning');
-
-var didWarnValueNull = false;
-
-function handleElement(debugID, element) {
- if (element == null) {
- return;
- }
- if (element.type !== 'input' && element.type !== 'textarea' && element.type !== 'select') {
- return;
- }
- if (element.props != null && element.props.value === null && !didWarnValueNull) {
- process.env.NODE_ENV !== 'production' ? warning(false, '`value` prop on `%s` should not be null. ' + 'Consider using the empty string to clear the component or `undefined` ' + 'for uncontrolled components.%s', element.type, ReactComponentTreeHook.getStackAddendumByID(debugID)) : void 0;
-
- didWarnValueNull = true;
- }
-}
-
-var ReactDOMNullInputValuePropHook = {
- onBeforeMountComponent: function (debugID, element) {
- handleElement(debugID, element);
- },
- onBeforeUpdateComponent: function (debugID, element) {
- handleElement(debugID, element);
- }
-};
-
-module.exports = ReactDOMNullInputValuePropHook;
-}).call(this,require('_process'))
-
-},{"_process":43,"fbjs/lib/warning":25,"react/lib/ReactComponentTreeHook":194}],88:[function(require,module,exports){
-(function (process){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-'use strict';
-
-var _assign = require('object-assign');
-
-var React = require('react/lib/React');
-var ReactDOMComponentTree = require('./ReactDOMComponentTree');
-var ReactDOMSelect = require('./ReactDOMSelect');
-
-var warning = require('fbjs/lib/warning');
-var didWarnInvalidOptionChildren = false;
-
-function flattenChildren(children) {
- var content = '';
-
- // Flatten children and warn if they aren't strings or numbers;
- // invalid types are ignored.
- React.Children.forEach(children, function (child) {
- if (child == null) {
- return;
- }
- if (typeof child === 'string' || typeof child === 'number') {
- content += child;
- } else if (!didWarnInvalidOptionChildren) {
- didWarnInvalidOptionChildren = true;
- process.env.NODE_ENV !== 'production' ? warning(false, 'Only strings and numbers are supported as <option> children.') : void 0;
- }
- });
-
- return content;
-}
-
-/**
- * Implements an <option> host component that warns when `selected` is set.
- */
-var ReactDOMOption = {
- mountWrapper: function (inst, props, hostParent) {
- // TODO (yungsters): Remove support for `selected` in <option>.
- if (process.env.NODE_ENV !== 'production') {
- process.env.NODE_ENV !== 'production' ? warning(props.selected == null, 'Use the `defaultValue` or `value` props on <select> instead of ' + 'setting `selected` on <option>.') : void 0;
- }
-
- // Look up whether this option is 'selected'
- var selectValue = null;
- if (hostParent != null) {
- var selectParent = hostParent;
-
- if (selectParent._tag === 'optgroup') {
- selectParent = selectParent._hostParent;
- }
-
- if (selectParent != null && selectParent._tag === 'select') {
- selectValue = ReactDOMSelect.getSelectValueContext(selectParent);
- }
- }
-
- // If the value is null (e.g., no specified value or after initial mount)
- // or missing (e.g., for <datalist>), we don't change props.selected
- var selected = null;
- if (selectValue != null) {
- var value;
- if (props.value != null) {
- value = props.value + '';
- } else {
- value = flattenChildren(props.children);
- }
- selected = false;
- if (Array.isArray(selectValue)) {
- // multiple
- for (var i = 0; i < selectValue.length; i++) {
- if ('' + selectValue[i] === value) {
- selected = true;
- break;
- }
- }
- } else {
- selected = '' + selectValue === value;
- }
- }
-
- inst._wrapperState = { selected: selected };
- },
-
- postMountWrapper: function (inst) {
- // value="" should make a value attribute (#6219)
- var props = inst._currentElement.props;
- if (props.value != null) {
- var node = ReactDOMComponentTree.getNodeFromInstance(inst);
- node.setAttribute('value', props.value);
- }
- },
-
- getHostProps: function (inst, props) {
- var hostProps = _assign({ selected: undefined, children: undefined }, props);
-
- // Read state only from initial mount because <select> updates value
- // manually; we need the initial state only for server rendering
- if (inst._wrapperState.selected != null) {
- hostProps.selected = inst._wrapperState.selected;
- }
-
- var content = flattenChildren(props.children);
-
- if (content) {
- hostProps.children = content;
- }
-
- return hostProps;
- }
-
-};
-
-module.exports = ReactDOMOption;
-}).call(this,require('_process'))
-
-},{"./ReactDOMComponentTree":80,"./ReactDOMSelect":89,"_process":43,"fbjs/lib/warning":25,"object-assign":42,"react/lib/React":190}],89:[function(require,module,exports){
-(function (process){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-'use strict';
-
-var _assign = require('object-assign');
-
-var LinkedValueUtils = require('./LinkedValueUtils');
-var ReactDOMComponentTree = require('./ReactDOMComponentTree');
-var ReactUpdates = require('./ReactUpdates');
-
-var warning = require('fbjs/lib/warning');
-
-var didWarnValueLink = false;
-var didWarnValueDefaultValue = false;
-
-function updateOptionsIfPendingUpdateAndMounted() {
- if (this._rootNodeID && this._wrapperState.pendingUpdate) {
- this._wrapperState.pendingUpdate = false;
-
- var props = this._currentElement.props;
- var value = LinkedValueUtils.getValue(props);
-
- if (value != null) {
- updateOptions(this, Boolean(props.multiple), value);
- }
- }
-}
-
-function getDeclarationErrorAddendum(owner) {
- if (owner) {
- var name = owner.getName();
- if (name) {
- return ' Check the render method of `' + name + '`.';
- }
- }
- return '';
-}
-
-var valuePropNames = ['value', 'defaultValue'];
-
-/**
- * Validation function for `value` and `defaultValue`.
- * @private
- */
-function checkSelectPropTypes(inst, props) {
- var owner = inst._currentElement._owner;
- LinkedValueUtils.checkPropTypes('select', props, owner);
-
- if (props.valueLink !== undefined && !didWarnValueLink) {
- process.env.NODE_ENV !== 'production' ? warning(false, '`valueLink` prop on `select` is deprecated; set `value` and `onChange` instead.') : void 0;
- didWarnValueLink = true;
- }
-
- for (var i = 0; i < valuePropNames.length; i++) {
- var propName = valuePropNames[i];
- if (props[propName] == null) {
- continue;
- }
- var isArray = Array.isArray(props[propName]);
- if (props.multiple && !isArray) {
- process.env.NODE_ENV !== 'production' ? warning(false, 'The `%s` prop supplied to <select> must be an array if ' + '`multiple` is true.%s', propName, getDeclarationErrorAddendum(owner)) : void 0;
- } else if (!props.multiple && isArray) {
- process.env.NODE_ENV !== 'production' ? warning(false, 'The `%s` prop supplied to <select> must be a scalar ' + 'value if `multiple` is false.%s', propName, getDeclarationErrorAddendum(owner)) : void 0;
- }
- }
-}
-
-/**
- * @param {ReactDOMComponent} inst
- * @param {boolean} multiple
- * @param {*} propValue A stringable (with `multiple`, a list of stringables).
- * @private
- */
-function updateOptions(inst, multiple, propValue) {
- var selectedValue, i;
- var options = ReactDOMComponentTree.getNodeFromInstance(inst).options;
-
- if (multiple) {
- selectedValue = {};
- for (i = 0; i < propValue.length; i++) {
- selectedValue['' + propValue[i]] = true;
- }
- for (i = 0; i < options.length; i++) {
- var selected = selectedValue.hasOwnProperty(options[i].value);
- if (options[i].selected !== selected) {
- options[i].selected = selected;
- }
- }
- } else {
- // Do not set `select.value` as exact behavior isn't consistent across all
- // browsers for all cases.
- selectedValue = '' + propValue;
- for (i = 0; i < options.length; i++) {
- if (options[i].value === selectedValue) {
- options[i].selected = true;
- return;
- }
- }
- if (options.length) {
- options[0].selected = true;
- }
- }
-}
-
-/**
- * Implements a <select> host component that allows optionally setting the
- * props `value` and `defaultValue`. If `multiple` is false, the prop must be a
- * stringable. If `multiple` is true, the prop must be an array of stringables.
- *
- * If `value` is not supplied (or null/undefined), user actions that change the
- * selected option will trigger updates to the rendered options.
- *
- * If it is supplied (and not null/undefined), the rendered options will not
- * update in response to user actions. Instead, the `value` prop must change in
- * order for the rendered options to update.
- *
- * If `defaultValue` is provided, any options with the supplied values will be
- * selected.
- */
-var ReactDOMSelect = {
- getHostProps: function (inst, props) {
- return _assign({}, props, {
- onChange: inst._wrapperState.onChange,
- value: undefined
- });
- },
-
- mountWrapper: function (inst, props) {
- if (process.env.NODE_ENV !== 'production') {
- checkSelectPropTypes(inst, props);
- }
-
- var value = LinkedValueUtils.getValue(props);
- inst._wrapperState = {
- pendingUpdate: false,
- initialValue: value != null ? value : props.defaultValue,
- listeners: null,
- onChange: _handleChange.bind(inst),
- wasMultiple: Boolean(props.multiple)
- };
-
- if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValueDefaultValue) {
- process.env.NODE_ENV !== 'production' ? warning(false, 'Select elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled select ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components') : void 0;
- didWarnValueDefaultValue = true;
- }
- },
-
- getSelectValueContext: function (inst) {
- // ReactDOMOption looks at this initial value so the initial generated
- // markup has correct `selected` attributes
- return inst._wrapperState.initialValue;
- },
-
- postUpdateWrapper: function (inst) {
- var props = inst._currentElement.props;
-
- // After the initial mount, we control selected-ness manually so don't pass
- // this value down
- inst._wrapperState.initialValue = undefined;
-
- var wasMultiple = inst._wrapperState.wasMultiple;
- inst._wrapperState.wasMultiple = Boolean(props.multiple);
-
- var value = LinkedValueUtils.getValue(props);
- if (value != null) {
- inst._wrapperState.pendingUpdate = false;
- updateOptions(inst, Boolean(props.multiple), value);
- } else if (wasMultiple !== Boolean(props.multiple)) {
- // For simplicity, reapply `defaultValue` if `multiple` is toggled.
- if (props.defaultValue != null) {
- updateOptions(inst, Boolean(props.multiple), props.defaultValue);
- } else {
- // Revert the select back to its default unselected state.
- updateOptions(inst, Boolean(props.multiple), props.multiple ? [] : '');
- }
- }
- }
-};
-
-function _handleChange(event) {
- var props = this._currentElement.props;
- var returnValue = LinkedValueUtils.executeOnChange(props, event);
-
- if (this._rootNodeID) {
- this._wrapperState.pendingUpdate = true;
- }
- ReactUpdates.asap(updateOptionsIfPendingUpdateAndMounted, this);
- return returnValue;
-}
-
-module.exports = ReactDOMSelect;
-}).call(this,require('_process'))
-
-},{"./LinkedValueUtils":70,"./ReactDOMComponentTree":80,"./ReactUpdates":124,"_process":43,"fbjs/lib/warning":25,"object-assign":42}],90:[function(require,module,exports){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-'use strict';
-
-var ExecutionEnvironment = require('fbjs/lib/ExecutionEnvironment');
-
-var getNodeForCharacterOffset = require('./getNodeForCharacterOffset');
-var getTextContentAccessor = require('./getTextContentAccessor');
-
-/**
- * While `isCollapsed` is available on the Selection object and `collapsed`
- * is available on the Range object, IE11 sometimes gets them wrong.
- * If the anchor/focus nodes and offsets are the same, the range is collapsed.
- */
-function isCollapsed(anchorNode, anchorOffset, focusNode, focusOffset) {
- return anchorNode === focusNode && anchorOffset === focusOffset;
-}
-
-/**
- * Get the appropriate anchor and focus node/offset pairs for IE.
- *
- * The catch here is that IE's selection API doesn't provide information
- * about whether the selection is forward or backward, so we have to
- * behave as though it's always forward.
- *
- * IE text differs from modern selection in that it behaves as though
- * block elements end with a new line. This means character offsets will
- * differ between the two APIs.
- *
- * @param {DOMElement} node
- * @return {object}
- */
-function getIEOffsets(node) {
- var selection = document.selection;
- var selectedRange = selection.createRange();
- var selectedLength = selectedRange.text.length;
-
- // Duplicate selection so we can move range without breaking user selection.
- var fromStart = selectedRange.duplicate();
- fromStart.moveToElementText(node);
- fromStart.setEndPoint('EndToStart', selectedRange);
-
- var startOffset = fromStart.text.length;
- var endOffset = startOffset + selectedLength;
-
- return {
- start: startOffset,
- end: endOffset
- };
-}
-
-/**
- * @param {DOMElement} node
- * @return {?object}
- */
-function getModernOffsets(node) {
- var selection = window.getSelection && window.getSelection();
-
- if (!selection || selection.rangeCount === 0) {
- return null;
- }
-
- var anchorNode = selection.anchorNode;
- var anchorOffset = selection.anchorOffset;
- var focusNode = selection.focusNode;
- var focusOffset = selection.focusOffset;
-
- var currentRange = selection.getRangeAt(0);
-
- // In Firefox, range.startContainer and range.endContainer can be "anonymous
- // divs", e.g. the up/down buttons on an <input type="number">. Anonymous
- // divs do not seem to expose properties, triggering a "Permission denied
- // error" if any of its properties are accessed. The only seemingly possible
- // way to avoid erroring is to access a property that typically works for
- // non-anonymous divs and catch any error that may otherwise arise. See
- // https://bugzilla.mozilla.org/show_bug.cgi?id=208427
- try {
- /* eslint-disable no-unused-expressions */
- currentRange.startContainer.nodeType;
- currentRange.endContainer.nodeType;
- /* eslint-enable no-unused-expressions */
- } catch (e) {
- return null;
- }
-
- // If the node and offset values are the same, the selection is collapsed.
- // `Selection.isCollapsed` is available natively, but IE sometimes gets
- // this value wrong.
- var isSelectionCollapsed = isCollapsed(selection.anchorNode, selection.anchorOffset, selection.focusNode, selection.focusOffset);
-
- var rangeLength = isSelectionCollapsed ? 0 : currentRange.toString().length;
-
- var tempRange = currentRange.cloneRange();
- tempRange.selectNodeContents(node);
- tempRange.setEnd(currentRange.startContainer, currentRange.startOffset);
-
- var isTempRangeCollapsed = isCollapsed(tempRange.startContainer, tempRange.startOffset, tempRange.endContainer, tempRange.endOffset);
-
- var start = isTempRangeCollapsed ? 0 : tempRange.toString().length;
- var end = start + rangeLength;
-
- // Detect whether the selection is backward.
- var detectionRange = document.createRange();
- detectionRange.setStart(anchorNode, anchorOffset);
- detectionRange.setEnd(focusNode, focusOffset);
- var isBackward = detectionRange.collapsed;
-
- return {
- start: isBackward ? end : start,
- end: isBackward ? start : end
- };
-}
-
-/**
- * @param {DOMElement|DOMTextNode} node
- * @param {object} offsets
- */
-function setIEOffsets(node, offsets) {
- var range = document.selection.createRange().duplicate();
- var start, end;
-
- if (offsets.end === undefined) {
- start = offsets.start;
- end = start;
- } else if (offsets.start > offsets.end) {
- start = offsets.end;
- end = offsets.start;
- } else {
- start = offsets.start;
- end = offsets.end;
- }
-
- range.moveToElementText(node);
- range.moveStart('character', start);
- range.setEndPoint('EndToStart', range);
- range.moveEnd('character', end - start);
- range.select();
-}
-
-/**
- * In modern non-IE browsers, we can support both forward and backward
- * selections.
- *
- * Note: IE10+ supports the Selection object, but it does not support
- * the `extend` method, which means that even in modern IE, it's not possible
- * to programmatically create a backward selection. Thus, for all IE
- * versions, we use the old IE API to create our selections.
- *
- * @param {DOMElement|DOMTextNode} node
- * @param {object} offsets
- */
-function setModernOffsets(node, offsets) {
- if (!window.getSelection) {
- return;
- }
-
- var selection = window.getSelection();
- var length = node[getTextContentAccessor()].length;
- var start = Math.min(offsets.start, length);
- var end = offsets.end === undefined ? start : Math.min(offsets.end, length);
-
- // IE 11 uses modern selection, but doesn't support the extend method.
- // Flip backward selections, so we can set with a single range.
- if (!selection.extend && start > end) {
- var temp = end;
- end = start;
- start = temp;
- }
-
- var startMarker = getNodeForCharacterOffset(node, start);
- var endMarker = getNodeForCharacterOffset(node, end);
-
- if (startMarker && endMarker) {
- var range = document.createRange();
- range.setStart(startMarker.node, startMarker.offset);
- selection.removeAllRanges();
-
- if (start > end) {
- selection.addRange(range);
- selection.extend(endMarker.node, endMarker.offset);
- } else {
- range.setEnd(endMarker.node, endMarker.offset);
- selection.addRange(range);
- }
- }
-}
-
-var useIEOffsets = ExecutionEnvironment.canUseDOM && 'selection' in document && !('getSelection' in window);
-
-var ReactDOMSelection = {
- /**
- * @param {DOMElement} node
- */
- getOffsets: useIEOffsets ? getIEOffsets : getModernOffsets,
-
- /**
- * @param {DOMElement|DOMTextNode} node
- * @param {object} offsets
- */
- setOffsets: useIEOffsets ? setIEOffsets : setModernOffsets
-};
-
-module.exports = ReactDOMSelection;
-},{"./getNodeForCharacterOffset":160,"./getTextContentAccessor":161,"fbjs/lib/ExecutionEnvironment":4}],91:[function(require,module,exports){
-(function (process){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-'use strict';
-
-var _prodInvariant = require('./reactProdInvariant'),
- _assign = require('object-assign');
-
-var DOMChildrenOperations = require('./DOMChildrenOperations');
-var DOMLazyTree = require('./DOMLazyTree');
-var ReactDOMComponentTree = require('./ReactDOMComponentTree');
-
-var escapeTextContentForBrowser = require('./escapeTextContentForBrowser');
-var invariant = require('fbjs/lib/invariant');
-var validateDOMNesting = require('./validateDOMNesting');
-
-/**
- * Text nodes violate a couple assumptions that React makes about components:
- *
- * - When mounting text into the DOM, adjacent text nodes are merged.
- * - Text nodes cannot be assigned a React root ID.
- *
- * This component is used to wrap strings between comment nodes so that they
- * can undergo the same reconciliation that is applied to elements.
- *
- * TODO: Investigate representing React components in the DOM with text nodes.
- *
- * @class ReactDOMTextComponent
- * @extends ReactComponent
- * @internal
- */
-var ReactDOMTextComponent = function (text) {
- // TODO: This is really a ReactText (ReactNode), not a ReactElement
- this._currentElement = text;
- this._stringText = '' + text;
- // ReactDOMComponentTree uses these:
- this._hostNode = null;
- this._hostParent = null;
-
- // Properties
- this._domID = 0;
- this._mountIndex = 0;
- this._closingComment = null;
- this._commentNodes = null;
-};
-
-_assign(ReactDOMTextComponent.prototype, {
-
- /**
- * Creates the markup for this text node. This node is not intended to have
- * any features besides containing text content.
- *
- * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
- * @return {string} Markup for this text node.
- * @internal
- */
- mountComponent: function (transaction, hostParent, hostContainerInfo, context) {
- if (process.env.NODE_ENV !== 'production') {
- var parentInfo;
- if (hostParent != null) {
- parentInfo = hostParent._ancestorInfo;
- } else if (hostContainerInfo != null) {
- parentInfo = hostContainerInfo._ancestorInfo;
- }
- if (parentInfo) {
- // parentInfo should always be present except for the top-level
- // component when server rendering
- validateDOMNesting(null, this._stringText, this, parentInfo);
- }
- }
-
- var domID = hostContainerInfo._idCounter++;
- var openingValue = ' react-text: ' + domID + ' ';
- var closingValue = ' /react-text ';
- this._domID = domID;
- this._hostParent = hostParent;
- if (transaction.useCreateElement) {
- var ownerDocument = hostContainerInfo._ownerDocument;
- var openingComment = ownerDocument.createComment(openingValue);
- var closingComment = ownerDocument.createComment(closingValue);
- var lazyTree = DOMLazyTree(ownerDocument.createDocumentFragment());
- DOMLazyTree.queueChild(lazyTree, DOMLazyTree(openingComment));
- if (this._stringText) {
- DOMLazyTree.queueChild(lazyTree, DOMLazyTree(ownerDocument.createTextNode(this._stringText)));
- }
- DOMLazyTree.queueChild(lazyTree, DOMLazyTree(closingComment));
- ReactDOMComponentTree.precacheNode(this, openingComment);
- this._closingComment = closingComment;
- return lazyTree;
- } else {
- var escapedText = escapeTextContentForBrowser(this._stringText);
-
- if (transaction.renderToStaticMarkup) {
- // Normally we'd wrap this between comment nodes for the reasons stated
- // above, but since this is a situation where React won't take over
- // (static pages), we can simply return the text as it is.
- return escapedText;
- }
-
- return '<!--' + openingValue + '-->' + escapedText + '<!--' + closingValue + '-->';
- }
- },
-
- /**
- * Updates this component by updating the text content.
- *
- * @param {ReactText} nextText The next text content
- * @param {ReactReconcileTransaction} transaction
- * @internal
- */
- receiveComponent: function (nextText, transaction) {
- if (nextText !== this._currentElement) {
- this._currentElement = nextText;
- var nextStringText = '' + nextText;
- if (nextStringText !== this._stringText) {
- // TODO: Save this as pending props and use performUpdateIfNecessary
- // and/or updateComponent to do the actual update for consistency with
- // other component types?
- this._stringText = nextStringText;
- var commentNodes = this.getHostNode();
- DOMChildrenOperations.replaceDelimitedText(commentNodes[0], commentNodes[1], nextStringText);
- }
- }
- },
-
- getHostNode: function () {
- var hostNode = this._commentNodes;
- if (hostNode) {
- return hostNode;
- }
- if (!this._closingComment) {
- var openingComment = ReactDOMComponentTree.getNodeFromInstance(this);
- var node = openingComment.nextSibling;
- while (true) {
- !(node != null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Missing closing comment for text component %s', this._domID) : _prodInvariant('67', this._domID) : void 0;
- if (node.nodeType === 8 && node.nodeValue === ' /react-text ') {
- this._closingComment = node;
- break;
- }
- node = node.nextSibling;
- }
- }
- hostNode = [this._hostNode, this._closingComment];
- this._commentNodes = hostNode;
- return hostNode;
- },
-
- unmountComponent: function () {
- this._closingComment = null;
- this._commentNodes = null;
- ReactDOMComponentTree.uncacheNode(this);
- }
-
-});
-
-module.exports = ReactDOMTextComponent;
-}).call(this,require('_process'))
-
-},{"./DOMChildrenOperations":55,"./DOMLazyTree":56,"./ReactDOMComponentTree":80,"./escapeTextContentForBrowser":149,"./reactProdInvariant":167,"./validateDOMNesting":173,"_process":43,"fbjs/lib/invariant":18,"object-assign":42}],92:[function(require,module,exports){
-(function (process){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-'use strict';
-
-var _prodInvariant = require('./reactProdInvariant'),
- _assign = require('object-assign');
-
-var LinkedValueUtils = require('./LinkedValueUtils');
-var ReactDOMComponentTree = require('./ReactDOMComponentTree');
-var ReactUpdates = require('./ReactUpdates');
-
-var invariant = require('fbjs/lib/invariant');
-var warning = require('fbjs/lib/warning');
-
-var didWarnValueLink = false;
-var didWarnValDefaultVal = false;
-
-function forceUpdateIfMounted() {
- if (this._rootNodeID) {
- // DOM component is still mounted; update
- ReactDOMTextarea.updateWrapper(this);
- }
-}
-
-/**
- * Implements a <textarea> host component that allows setting `value`, and
- * `defaultValue`. This differs from the traditional DOM API because value is
- * usually set as PCDATA children.
- *
- * If `value` is not supplied (or null/undefined), user actions that affect the
- * value will trigger updates to the element.
- *
- * If `value` is supplied (and not null/undefined), the rendered element will
- * not trigger updates to the element. Instead, the `value` prop must change in
- * order for the rendered element to be updated.
- *
- * The rendered element will be initialized with an empty value, the prop
- * `defaultValue` if specified, or the children content (deprecated).
- */
-var ReactDOMTextarea = {
- getHostProps: function (inst, props) {
- !(props.dangerouslySetInnerHTML == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, '`dangerouslySetInnerHTML` does not make sense on <textarea>.') : _prodInvariant('91') : void 0;
-
- // Always set children to the same thing. In IE9, the selection range will
- // get reset if `textContent` is mutated. We could add a check in setTextContent
- // to only set the value if/when the value differs from the node value (which would
- // completely solve this IE9 bug), but Sebastian+Ben seemed to like this solution.
- // The value can be a boolean or object so that's why it's forced to be a string.
- var hostProps = _assign({}, props, {
- value: undefined,
- defaultValue: undefined,
- children: '' + inst._wrapperState.initialValue,
- onChange: inst._wrapperState.onChange
- });
-
- return hostProps;
- },
-
- mountWrapper: function (inst, props) {
- if (process.env.NODE_ENV !== 'production') {
- LinkedValueUtils.checkPropTypes('textarea', props, inst._currentElement._owner);
- if (props.valueLink !== undefined && !didWarnValueLink) {
- process.env.NODE_ENV !== 'production' ? warning(false, '`valueLink` prop on `textarea` is deprecated; set `value` and `onChange` instead.') : void 0;
- didWarnValueLink = true;
- }
- if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValDefaultVal) {
- process.env.NODE_ENV !== 'production' ? warning(false, 'Textarea elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled textarea ' + 'and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components') : void 0;
- didWarnValDefaultVal = true;
- }
- }
-
- var value = LinkedValueUtils.getValue(props);
- var initialValue = value;
-
- // Only bother fetching default value if we're going to use it
- if (value == null) {
- var defaultValue = props.defaultValue;
- // TODO (yungsters): Remove support for children content in <textarea>.
- var children = props.children;
- if (children != null) {
- if (process.env.NODE_ENV !== 'production') {
- process.env.NODE_ENV !== 'production' ? warning(false, 'Use the `defaultValue` or `value` props instead of setting ' + 'children on <textarea>.') : void 0;
- }
- !(defaultValue == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'If you supply `defaultValue` on a <textarea>, do not pass children.') : _prodInvariant('92') : void 0;
- if (Array.isArray(children)) {
- !(children.length <= 1) ? process.env.NODE_ENV !== 'production' ? invariant(false, '<textarea> can only have at most one child.') : _prodInvariant('93') : void 0;
- children = children[0];
- }
-
- defaultValue = '' + children;
- }
- if (defaultValue == null) {
- defaultValue = '';
- }
- initialValue = defaultValue;
- }
-
- inst._wrapperState = {
- initialValue: '' + initialValue,
- listeners: null,
- onChange: _handleChange.bind(inst)
- };
- },
-
- updateWrapper: function (inst) {
- var props = inst._currentElement.props;
-
- var node = ReactDOMComponentTree.getNodeFromInstance(inst);
- var value = LinkedValueUtils.getValue(props);
- if (value != null) {
- // Cast `value` to a string to ensure the value is set correctly. While
- // browsers typically do this as necessary, jsdom doesn't.
- var newValue = '' + value;
-
- // To avoid side effects (such as losing text selection), only set value if changed
- if (newValue !== node.value) {
- node.value = newValue;
- }
- if (props.defaultValue == null) {
- node.defaultValue = newValue;
- }
- }
- if (props.defaultValue != null) {
- node.defaultValue = props.defaultValue;
- }
- },
-
- postMountWrapper: function (inst) {
- // This is in postMount because we need access to the DOM node, which is not
- // available until after the component has mounted.
- var node = ReactDOMComponentTree.getNodeFromInstance(inst);
- var textContent = node.textContent;
-
- // Only set node.value if textContent is equal to the expected
- // initial value. In IE10/IE11 there is a bug where the placeholder attribute
- // will populate textContent as well.
- // https://developer.microsoft.com/microsoft-edge/platform/issues/101525/
- if (textContent === inst._wrapperState.initialValue) {
- node.value = textContent;
- }
- }
-};
-
-function _handleChange(event) {
- var props = this._currentElement.props;
- var returnValue = LinkedValueUtils.executeOnChange(props, event);
- ReactUpdates.asap(forceUpdateIfMounted, this);
- return returnValue;
-}
-
-module.exports = ReactDOMTextarea;
-}).call(this,require('_process'))
-
-},{"./LinkedValueUtils":70,"./ReactDOMComponentTree":80,"./ReactUpdates":124,"./reactProdInvariant":167,"_process":43,"fbjs/lib/invariant":18,"fbjs/lib/warning":25,"object-assign":42}],93:[function(require,module,exports){
-(function (process){
-/**
- * Copyright 2015-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-'use strict';
-
-var _prodInvariant = require('./reactProdInvariant');
-
-var invariant = require('fbjs/lib/invariant');
-
-/**
- * Return the lowest common ancestor of A and B, or null if they are in
- * different trees.
- */
-function getLowestCommonAncestor(instA, instB) {
- !('_hostNode' in instA) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'getNodeFromInstance: Invalid argument.') : _prodInvariant('33') : void 0;
- !('_hostNode' in instB) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'getNodeFromInstance: Invalid argument.') : _prodInvariant('33') : void 0;
-
- var depthA = 0;
- for (var tempA = instA; tempA; tempA = tempA._hostParent) {
- depthA++;
- }
- var depthB = 0;
- for (var tempB = instB; tempB; tempB = tempB._hostParent) {
- depthB++;
- }
-
- // If A is deeper, crawl up.
- while (depthA - depthB > 0) {
- instA = instA._hostParent;
- depthA--;
- }
-
- // If B is deeper, crawl up.
- while (depthB - depthA > 0) {
- instB = instB._hostParent;
- depthB--;
- }
-
- // Walk in lockstep until we find a match.
- var depth = depthA;
- while (depth--) {
- if (instA === instB) {
- return instA;
- }
- instA = instA._hostParent;
- instB = instB._hostParent;
- }
- return null;
-}
-
-/**
- * Return if A is an ancestor of B.
- */
-function isAncestor(instA, instB) {
- !('_hostNode' in instA) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'isAncestor: Invalid argument.') : _prodInvariant('35') : void 0;
- !('_hostNode' in instB) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'isAncestor: Invalid argument.') : _prodInvariant('35') : void 0;
-
- while (instB) {
- if (instB === instA) {
- return true;
- }
- instB = instB._hostParent;
- }
- return false;
-}
-
-/**
- * Return the parent instance of the passed-in instance.
- */
-function getParentInstance(inst) {
- !('_hostNode' in inst) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'getParentInstance: Invalid argument.') : _prodInvariant('36') : void 0;
-
- return inst._hostParent;
-}
-
-/**
- * Simulates the traversal of a two-phase, capture/bubble event dispatch.
- */
-function traverseTwoPhase(inst, fn, arg) {
- var path = [];
- while (inst) {
- path.push(inst);
- inst = inst._hostParent;
- }
- var i;
- for (i = path.length; i-- > 0;) {
- fn(path[i], 'captured', arg);
- }
- for (i = 0; i < path.length; i++) {
- fn(path[i], 'bubbled', arg);
- }
-}
-
-/**
- * Traverses the ID hierarchy and invokes the supplied `cb` on any IDs that
- * should would receive a `mouseEnter` or `mouseLeave` event.
- *
- * Does not invoke the callback on the nearest common ancestor because nothing
- * "entered" or "left" that element.
- */
-function traverseEnterLeave(from, to, fn, argFrom, argTo) {
- var common = from && to ? getLowestCommonAncestor(from, to) : null;
- var pathFrom = [];
- while (from && from !== common) {
- pathFrom.push(from);
- from = from._hostParent;
- }
- var pathTo = [];
- while (to && to !== common) {
- pathTo.push(to);
- to = to._hostParent;
- }
- var i;
- for (i = 0; i < pathFrom.length; i++) {
- fn(pathFrom[i], 'bubbled', argFrom);
- }
- for (i = pathTo.length; i-- > 0;) {
- fn(pathTo[i], 'captured', argTo);
- }
-}
-
-module.exports = {
- isAncestor: isAncestor,
- getLowestCommonAncestor: getLowestCommonAncestor,
- getParentInstance: getParentInstance,
- traverseTwoPhase: traverseTwoPhase,
- traverseEnterLeave: traverseEnterLeave
-};
-}).call(this,require('_process'))
-
-},{"./reactProdInvariant":167,"_process":43,"fbjs/lib/invariant":18}],94:[function(require,module,exports){
-(function (process){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-'use strict';
-
-var DOMProperty = require('./DOMProperty');
-var EventPluginRegistry = require('./EventPluginRegistry');
-var ReactComponentTreeHook = require('react/lib/ReactComponentTreeHook');
-
-var warning = require('fbjs/lib/warning');
-
-if (process.env.NODE_ENV !== 'production') {
- var reactProps = {
- children: true,
- dangerouslySetInnerHTML: true,
- key: true,
- ref: true,
-
- autoFocus: true,
- defaultValue: true,
- valueLink: true,
- defaultChecked: true,
- checkedLink: true,
- innerHTML: true,
- suppressContentEditableWarning: true,
- onFocusIn: true,
- onFocusOut: true
- };
- var warnedProperties = {};
-
- var validateProperty = function (tagName, name, debugID) {
- if (DOMProperty.properties.hasOwnProperty(name) || DOMProperty.isCustomAttribute(name)) {
- return true;
- }
- if (reactProps.hasOwnProperty(name) && reactProps[name] || warnedProperties.hasOwnProperty(name) && warnedProperties[name]) {
- return true;
- }
- if (EventPluginRegistry.registrationNameModules.hasOwnProperty(name)) {
- return true;
- }
- warnedProperties[name] = true;
- var lowerCasedName = name.toLowerCase();
-
- // data-* attributes should be lowercase; suggest the lowercase version
- var standardName = DOMProperty.isCustomAttribute(lowerCasedName) ? lowerCasedName : DOMProperty.getPossibleStandardName.hasOwnProperty(lowerCasedName) ? DOMProperty.getPossibleStandardName[lowerCasedName] : null;
-
- var registrationName = EventPluginRegistry.possibleRegistrationNames.hasOwnProperty(lowerCasedName) ? EventPluginRegistry.possibleRegistrationNames[lowerCasedName] : null;
-
- if (standardName != null) {
- process.env.NODE_ENV !== 'production' ? warning(false, 'Unknown DOM property %s. Did you mean %s?%s', name, standardName, ReactComponentTreeHook.getStackAddendumByID(debugID)) : void 0;
- return true;
- } else if (registrationName != null) {
- process.env.NODE_ENV !== 'production' ? warning(false, 'Unknown event handler property %s. Did you mean `%s`?%s', name, registrationName, ReactComponentTreeHook.getStackAddendumByID(debugID)) : void 0;
- return true;
- } else {
- // We were unable to guess which prop the user intended.
- // It is likely that the user was just blindly spreading/forwarding props
- // Components should be careful to only render valid props/attributes.
- // Warning will be invoked in warnUnknownProperties to allow grouping.
- return false;
- }
- };
-}
-
-var warnUnknownProperties = function (debugID, element) {
- var unknownProps = [];
- for (var key in element.props) {
- var isValid = validateProperty(element.type, key, debugID);
- if (!isValid) {
- unknownProps.push(key);
- }
- }
-
- var unknownPropString = unknownProps.map(function (prop) {
- return '`' + prop + '`';
- }).join(', ');
-
- if (unknownProps.length === 1) {
- process.env.NODE_ENV !== 'production' ? warning(false, 'Unknown prop %s on <%s> tag. Remove this prop from the element. ' + 'For details, see https://fb.me/react-unknown-prop%s', unknownPropString, element.type, ReactComponentTreeHook.getStackAddendumByID(debugID)) : void 0;
- } else if (unknownProps.length > 1) {
- process.env.NODE_ENV !== 'production' ? warning(false, 'Unknown props %s on <%s> tag. Remove these props from the element. ' + 'For details, see https://fb.me/react-unknown-prop%s', unknownPropString, element.type, ReactComponentTreeHook.getStackAddendumByID(debugID)) : void 0;
- }
-};
-
-function handleElement(debugID, element) {
- if (element == null || typeof element.type !== 'string') {
- return;
- }
- if (element.type.indexOf('-') >= 0 || element.props.is) {
- return;
- }
- warnUnknownProperties(debugID, element);
-}
-
-var ReactDOMUnknownPropertyHook = {
- onBeforeMountComponent: function (debugID, element) {
- handleElement(debugID, element);
- },
- onBeforeUpdateComponent: function (debugID, element) {
- handleElement(debugID, element);
- }
-};
-
-module.exports = ReactDOMUnknownPropertyHook;
-}).call(this,require('_process'))
-
-},{"./DOMProperty":58,"./EventPluginRegistry":64,"_process":43,"fbjs/lib/warning":25,"react/lib/ReactComponentTreeHook":194}],95:[function(require,module,exports){
-(function (process){
-/**
- * Copyright 2016-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- *
- */
-
-'use strict';
-
-var ReactInvalidSetStateWarningHook = require('./ReactInvalidSetStateWarningHook');
-var ReactHostOperationHistoryHook = require('./ReactHostOperationHistoryHook');
-var ReactComponentTreeHook = require('react/lib/ReactComponentTreeHook');
-var ExecutionEnvironment = require('fbjs/lib/ExecutionEnvironment');
-
-var performanceNow = require('fbjs/lib/performanceNow');
-var warning = require('fbjs/lib/warning');
-
-var hooks = [];
-var didHookThrowForEvent = {};
-
-function callHook(event, fn, context, arg1, arg2, arg3, arg4, arg5) {
- try {
- fn.call(context, arg1, arg2, arg3, arg4, arg5);
- } catch (e) {
- process.env.NODE_ENV !== 'production' ? warning(didHookThrowForEvent[event], 'Exception thrown by hook while handling %s: %s', event, e + '\n' + e.stack) : void 0;
- didHookThrowForEvent[event] = true;
- }
-}
-
-function emitEvent(event, arg1, arg2, arg3, arg4, arg5) {
- for (var i = 0; i < hooks.length; i++) {
- var hook = hooks[i];
- var fn = hook[event];
- if (fn) {
- callHook(event, fn, hook, arg1, arg2, arg3, arg4, arg5);
- }
- }
-}
-
-var isProfiling = false;
-var flushHistory = [];
-var lifeCycleTimerStack = [];
-var currentFlushNesting = 0;
-var currentFlushMeasurements = [];
-var currentFlushStartTime = 0;
-var currentTimerDebugID = null;
-var currentTimerStartTime = 0;
-var currentTimerNestedFlushDuration = 0;
-var currentTimerType = null;
-
-var lifeCycleTimerHasWarned = false;
-
-function clearHistory() {
- ReactComponentTreeHook.purgeUnmountedComponents();
- ReactHostOperationHistoryHook.clearHistory();
-}
-
-function getTreeSnapshot(registeredIDs) {
- return registeredIDs.reduce(function (tree, id) {
- var ownerID = ReactComponentTreeHook.getOwnerID(id);
- var parentID = ReactComponentTreeHook.getParentID(id);
- tree[id] = {
- displayName: ReactComponentTreeHook.getDisplayName(id),
- text: ReactComponentTreeHook.getText(id),
- updateCount: ReactComponentTreeHook.getUpdateCount(id),
- childIDs: ReactComponentTreeHook.getChildIDs(id),
- // Text nodes don't have owners but this is close enough.
- ownerID: ownerID || parentID && ReactComponentTreeHook.getOwnerID(parentID) || 0,
- parentID: parentID
- };
- return tree;
- }, {});
-}
-
-function resetMeasurements() {
- var previousStartTime = currentFlushStartTime;
- var previousMeasurements = currentFlushMeasurements;
- var previousOperations = ReactHostOperationHistoryHook.getHistory();
-
- if (currentFlushNesting === 0) {
- currentFlushStartTime = 0;
- currentFlushMeasurements = [];
- clearHistory();
- return;
- }
-
- if (previousMeasurements.length || previousOperations.length) {
- var registeredIDs = ReactComponentTreeHook.getRegisteredIDs();
- flushHistory.push({
- duration: performanceNow() - previousStartTime,
- measurements: previousMeasurements || [],
- operations: previousOperations || [],
- treeSnapshot: getTreeSnapshot(registeredIDs)
- });
- }
-
- clearHistory();
- currentFlushStartTime = performanceNow();
- currentFlushMeasurements = [];
-}
-
-function checkDebugID(debugID) {
- var allowRoot = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
-
- if (allowRoot && debugID === 0) {
- return;
- }
- if (!debugID) {
- process.env.NODE_ENV !== 'production' ? warning(false, 'ReactDebugTool: debugID may not be empty.') : void 0;
- }
-}
-
-function beginLifeCycleTimer(debugID, timerType) {
- if (currentFlushNesting === 0) {
- return;
- }
- if (currentTimerType && !lifeCycleTimerHasWarned) {
- process.env.NODE_ENV !== 'production' ? warning(false, 'There is an internal error in the React performance measurement code. ' + 'Did not expect %s timer to start while %s timer is still in ' + 'progress for %s instance.', timerType, currentTimerType || 'no', debugID === currentTimerDebugID ? 'the same' : 'another') : void 0;
- lifeCycleTimerHasWarned = true;
- }
- currentTimerStartTime = performanceNow();
- currentTimerNestedFlushDuration = 0;
- currentTimerDebugID = debugID;
- currentTimerType = timerType;
-}
-
-function endLifeCycleTimer(debugID, timerType) {
- if (currentFlushNesting === 0) {
- return;
- }
- if (currentTimerType !== timerType && !lifeCycleTimerHasWarned) {
- process.env.NODE_ENV !== 'production' ? warning(false, 'There is an internal error in the React performance measurement code. ' + 'We did not expect %s timer to stop while %s timer is still in ' + 'progress for %s instance. Please report this as a bug in React.', timerType, currentTimerType || 'no', debugID === currentTimerDebugID ? 'the same' : 'another') : void 0;
- lifeCycleTimerHasWarned = true;
- }
- if (isProfiling) {
- currentFlushMeasurements.push({
- timerType: timerType,
- instanceID: debugID,
- duration: performanceNow() - currentTimerStartTime - currentTimerNestedFlushDuration
- });
- }
- currentTimerStartTime = 0;
- currentTimerNestedFlushDuration = 0;
- currentTimerDebugID = null;
- currentTimerType = null;
-}
-
-function pauseCurrentLifeCycleTimer() {
- var currentTimer = {
- startTime: currentTimerStartTime,
- nestedFlushStartTime: performanceNow(),
- debugID: currentTimerDebugID,
- timerType: currentTimerType
- };
- lifeCycleTimerStack.push(currentTimer);
- currentTimerStartTime = 0;
- currentTimerNestedFlushDuration = 0;
- currentTimerDebugID = null;
- currentTimerType = null;
-}
-
-function resumeCurrentLifeCycleTimer() {
- var _lifeCycleTimerStack$ = lifeCycleTimerStack.pop(),
- startTime = _lifeCycleTimerStack$.startTime,
- nestedFlushStartTime = _lifeCycleTimerStack$.nestedFlushStartTime,
- debugID = _lifeCycleTimerStack$.debugID,
- timerType = _lifeCycleTimerStack$.timerType;
-
- var nestedFlushDuration = performanceNow() - nestedFlushStartTime;
- currentTimerStartTime = startTime;
- currentTimerNestedFlushDuration += nestedFlushDuration;
- currentTimerDebugID = debugID;
- currentTimerType = timerType;
-}
-
-var lastMarkTimeStamp = 0;
-var canUsePerformanceMeasure =
-// $FlowFixMe https://github.com/facebook/flow/issues/2345
-typeof performance !== 'undefined' && typeof performance.mark === 'function' && typeof performance.clearMarks === 'function' && typeof performance.measure === 'function' && typeof performance.clearMeasures === 'function';
-
-function shouldMark(debugID) {
- if (!isProfiling || !canUsePerformanceMeasure) {
- return false;
- }
- var element = ReactComponentTreeHook.getElement(debugID);
- if (element == null || typeof element !== 'object') {
- return false;
- }
- var isHostElement = typeof element.type === 'string';
- if (isHostElement) {
- return false;
- }
- return true;
-}
-
-function markBegin(debugID, markType) {
- if (!shouldMark(debugID)) {
- return;
- }
-
- var markName = debugID + '::' + markType;
- lastMarkTimeStamp = performanceNow();
- performance.mark(markName);
-}
-
-function markEnd(debugID, markType) {
- if (!shouldMark(debugID)) {
- return;
- }
-
- var markName = debugID + '::' + markType;
- var displayName = ReactComponentTreeHook.getDisplayName(debugID) || 'Unknown';
-
- // Chrome has an issue of dropping markers recorded too fast:
- // https://bugs.chromium.org/p/chromium/issues/detail?id=640652
- // To work around this, we will not report very small measurements.
- // I determined the magic number by tweaking it back and forth.
- // 0.05ms was enough to prevent the issue, but I set it to 0.1ms to be safe.
- // When the bug is fixed, we can `measure()` unconditionally if we want to.
- var timeStamp = performanceNow();
- if (timeStamp - lastMarkTimeStamp > 0.1) {
- var measurementName = displayName + ' [' + markType + ']';
- performance.measure(measurementName, markName);
- }
-
- performance.clearMarks(markName);
- performance.clearMeasures(measurementName);
-}
-
-var ReactDebugTool = {
- addHook: function (hook) {
- hooks.push(hook);
- },
- removeHook: function (hook) {
- for (var i = 0; i < hooks.length; i++) {
- if (hooks[i] === hook) {
- hooks.splice(i, 1);
- i--;
- }
- }
- },
- isProfiling: function () {
- return isProfiling;
- },
- beginProfiling: function () {
- if (isProfiling) {
- return;
- }
-
- isProfiling = true;
- flushHistory.length = 0;
- resetMeasurements();
- ReactDebugTool.addHook(ReactHostOperationHistoryHook);
- },
- endProfiling: function () {
- if (!isProfiling) {
- return;
- }
-
- isProfiling = false;
- resetMeasurements();
- ReactDebugTool.removeHook(ReactHostOperationHistoryHook);
- },
- getFlushHistory: function () {
- return flushHistory;
- },
- onBeginFlush: function () {
- currentFlushNesting++;
- resetMeasurements();
- pauseCurrentLifeCycleTimer();
- emitEvent('onBeginFlush');
- },
- onEndFlush: function () {
- resetMeasurements();
- currentFlushNesting--;
- resumeCurrentLifeCycleTimer();
- emitEvent('onEndFlush');
- },
- onBeginLifeCycleTimer: function (debugID, timerType) {
- checkDebugID(debugID);
- emitEvent('onBeginLifeCycleTimer', debugID, timerType);
- markBegin(debugID, timerType);
- beginLifeCycleTimer(debugID, timerType);
- },
- onEndLifeCycleTimer: function (debugID, timerType) {
- checkDebugID(debugID);
- endLifeCycleTimer(debugID, timerType);
- markEnd(debugID, timerType);
- emitEvent('onEndLifeCycleTimer', debugID, timerType);
- },
- onBeginProcessingChildContext: function () {
- emitEvent('onBeginProcessingChildContext');
- },
- onEndProcessingChildContext: function () {
- emitEvent('onEndProcessingChildContext');
- },
- onHostOperation: function (operation) {
- checkDebugID(operation.instanceID);
- emitEvent('onHostOperation', operation);
- },
- onSetState: function () {
- emitEvent('onSetState');
- },
- onSetChildren: function (debugID, childDebugIDs) {
- checkDebugID(debugID);
- childDebugIDs.forEach(checkDebugID);
- emitEvent('onSetChildren', debugID, childDebugIDs);
- },
- onBeforeMountComponent: function (debugID, element, parentDebugID) {
- checkDebugID(debugID);
- checkDebugID(parentDebugID, true);
- emitEvent('onBeforeMountComponent', debugID, element, parentDebugID);
- markBegin(debugID, 'mount');
- },
- onMountComponent: function (debugID) {
- checkDebugID(debugID);
- markEnd(debugID, 'mount');
- emitEvent('onMountComponent', debugID);
- },
- onBeforeUpdateComponent: function (debugID, element) {
- checkDebugID(debugID);
- emitEvent('onBeforeUpdateComponent', debugID, element);
- markBegin(debugID, 'update');
- },
- onUpdateComponent: function (debugID) {
- checkDebugID(debugID);
- markEnd(debugID, 'update');
- emitEvent('onUpdateComponent', debugID);
- },
- onBeforeUnmountComponent: function (debugID) {
- checkDebugID(debugID);
- emitEvent('onBeforeUnmountComponent', debugID);
- markBegin(debugID, 'unmount');
- },
- onUnmountComponent: function (debugID) {
- checkDebugID(debugID);
- markEnd(debugID, 'unmount');
- emitEvent('onUnmountComponent', debugID);
- },
- onTestEvent: function () {
- emitEvent('onTestEvent');
- }
-};
-
-// TODO remove these when RN/www gets updated
-ReactDebugTool.addDevtool = ReactDebugTool.addHook;
-ReactDebugTool.removeDevtool = ReactDebugTool.removeHook;
-
-ReactDebugTool.addHook(ReactInvalidSetStateWarningHook);
-ReactDebugTool.addHook(ReactComponentTreeHook);
-var url = ExecutionEnvironment.canUseDOM && window.location.href || '';
-if (/[?&]react_perf\b/.test(url)) {
- ReactDebugTool.beginProfiling();
-}
-
-module.exports = ReactDebugTool;
-}).call(this,require('_process'))
-
-},{"./ReactHostOperationHistoryHook":105,"./ReactInvalidSetStateWarningHook":110,"_process":43,"fbjs/lib/ExecutionEnvironment":4,"fbjs/lib/performanceNow":23,"fbjs/lib/warning":25,"react/lib/ReactComponentTreeHook":194}],96:[function(require,module,exports){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-'use strict';
-
-var _assign = require('object-assign');
-
-var ReactUpdates = require('./ReactUpdates');
-var Transaction = require('./Transaction');
-
-var emptyFunction = require('fbjs/lib/emptyFunction');
-
-var RESET_BATCHED_UPDATES = {
- initialize: emptyFunction,
- close: function () {
- ReactDefaultBatchingStrategy.isBatchingUpdates = false;
- }
-};
-
-var FLUSH_BATCHED_UPDATES = {
- initialize: emptyFunction,
- close: ReactUpdates.flushBatchedUpdates.bind(ReactUpdates)
-};
-
-var TRANSACTION_WRAPPERS = [FLUSH_BATCHED_UPDATES, RESET_BATCHED_UPDATES];
-
-function ReactDefaultBatchingStrategyTransaction() {
- this.reinitializeTransaction();
-}
-
-_assign(ReactDefaultBatchingStrategyTransaction.prototype, Transaction, {
- getTransactionWrappers: function () {
- return TRANSACTION_WRAPPERS;
- }
-});
-
-var transaction = new ReactDefaultBatchingStrategyTransaction();
-
-var ReactDefaultBatchingStrategy = {
- isBatchingUpdates: false,
-
- /**
- * Call the provided function in a context within which calls to `setState`
- * and friends are batched such that components aren't updated unnecessarily.
- */
- batchedUpdates: function (callback, a, b, c, d, e) {
- var alreadyBatchingUpdates = ReactDefaultBatchingStrategy.isBatchingUpdates;
-
- ReactDefaultBatchingStrategy.isBatchingUpdates = true;
-
- // The code is written this way to avoid extra allocations
- if (alreadyBatchingUpdates) {
- return callback(a, b, c, d, e);
- } else {
- return transaction.perform(callback, null, a, b, c, d, e);
- }
- }
-};
-
-module.exports = ReactDefaultBatchingStrategy;
-},{"./ReactUpdates":124,"./Transaction":142,"fbjs/lib/emptyFunction":10,"object-assign":42}],97:[function(require,module,exports){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-'use strict';
-
-var ARIADOMPropertyConfig = require('./ARIADOMPropertyConfig');
-var BeforeInputEventPlugin = require('./BeforeInputEventPlugin');
-var ChangeEventPlugin = require('./ChangeEventPlugin');
-var DefaultEventPluginOrder = require('./DefaultEventPluginOrder');
-var EnterLeaveEventPlugin = require('./EnterLeaveEventPlugin');
-var HTMLDOMPropertyConfig = require('./HTMLDOMPropertyConfig');
-var ReactComponentBrowserEnvironment = require('./ReactComponentBrowserEnvironment');
-var ReactDOMComponent = require('./ReactDOMComponent');
-var ReactDOMComponentTree = require('./ReactDOMComponentTree');
-var ReactDOMEmptyComponent = require('./ReactDOMEmptyComponent');
-var ReactDOMTreeTraversal = require('./ReactDOMTreeTraversal');
-var ReactDOMTextComponent = require('./ReactDOMTextComponent');
-var ReactDefaultBatchingStrategy = require('./ReactDefaultBatchingStrategy');
-var ReactEventListener = require('./ReactEventListener');
-var ReactInjection = require('./ReactInjection');
-var ReactReconcileTransaction = require('./ReactReconcileTransaction');
-var SVGDOMPropertyConfig = require('./SVGDOMPropertyConfig');
-var SelectEventPlugin = require('./SelectEventPlugin');
-var SimpleEventPlugin = require('./SimpleEventPlugin');
-
-var alreadyInjected = false;
-
-function inject() {
- if (alreadyInjected) {
- // TODO: This is currently true because these injections are shared between
- // the client and the server package. They should be built independently
- // and not share any injection state. Then this problem will be solved.
- return;
- }
- alreadyInjected = true;
-
- ReactInjection.EventEmitter.injectReactEventListener(ReactEventListener);
-
- /**
- * Inject modules for resolving DOM hierarchy and plugin ordering.
- */
- ReactInjection.EventPluginHub.injectEventPluginOrder(DefaultEventPluginOrder);
- ReactInjection.EventPluginUtils.injectComponentTree(ReactDOMComponentTree);
- ReactInjection.EventPluginUtils.injectTreeTraversal(ReactDOMTreeTraversal);
-
- /**
- * Some important event plugins included by default (without having to require
- * them).
- */
- ReactInjection.EventPluginHub.injectEventPluginsByName({
- SimpleEventPlugin: SimpleEventPlugin,
- EnterLeaveEventPlugin: EnterLeaveEventPlugin,
- ChangeEventPlugin: ChangeEventPlugin,
- SelectEventPlugin: SelectEventPlugin,
- BeforeInputEventPlugin: BeforeInputEventPlugin
- });
-
- ReactInjection.HostComponent.injectGenericComponentClass(ReactDOMComponent);
-
- ReactInjection.HostComponent.injectTextComponentClass(ReactDOMTextComponent);
-
- ReactInjection.DOMProperty.injectDOMPropertyConfig(ARIADOMPropertyConfig);
- ReactInjection.DOMProperty.injectDOMPropertyConfig(HTMLDOMPropertyConfig);
- ReactInjection.DOMProperty.injectDOMPropertyConfig(SVGDOMPropertyConfig);
-
- ReactInjection.EmptyComponent.injectEmptyComponentFactory(function (instantiate) {
- return new ReactDOMEmptyComponent(instantiate);
- });
-
- ReactInjection.Updates.injectReconcileTransaction(ReactReconcileTransaction);
- ReactInjection.Updates.injectBatchingStrategy(ReactDefaultBatchingStrategy);
-
- ReactInjection.Component.injectEnvironment(ReactComponentBrowserEnvironment);
-}
-
-module.exports = {
- inject: inject
-};
-},{"./ARIADOMPropertyConfig":48,"./BeforeInputEventPlugin":50,"./ChangeEventPlugin":54,"./DefaultEventPluginOrder":61,"./EnterLeaveEventPlugin":62,"./HTMLDOMPropertyConfig":68,"./ReactComponentBrowserEnvironment":74,"./ReactDOMComponent":78,"./ReactDOMComponentTree":80,"./ReactDOMEmptyComponent":82,"./ReactDOMTextComponent":91,"./ReactDOMTreeTraversal":93,"./ReactDefaultBatchingStrategy":96,"./ReactEventListener":102,"./ReactInjection":106,"./ReactReconcileTransaction":118,"./SVGDOMPropertyConfig":126,"./SelectEventPlugin":127,"./SimpleEventPlugin":128}],98:[function(require,module,exports){
-/**
- * Copyright 2014-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- *
- */
-
-'use strict';
-
-// The Symbol used to tag the ReactElement type. If there is no native Symbol
-// nor polyfill, then a plain number is used for performance.
-
-var REACT_ELEMENT_TYPE = typeof Symbol === 'function' && Symbol['for'] && Symbol['for']('react.element') || 0xeac7;
-
-module.exports = REACT_ELEMENT_TYPE;
-},{}],99:[function(require,module,exports){
-/**
- * Copyright 2014-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-'use strict';
-
-var emptyComponentFactory;
-
-var ReactEmptyComponentInjection = {
- injectEmptyComponentFactory: function (factory) {
- emptyComponentFactory = factory;
- }
-};
-
-var ReactEmptyComponent = {
- create: function (instantiate) {
- return emptyComponentFactory(instantiate);
- }
-};
-
-ReactEmptyComponent.injection = ReactEmptyComponentInjection;
-
-module.exports = ReactEmptyComponent;
-},{}],100:[function(require,module,exports){
-(function (process){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- *
- */
-
-'use strict';
-
-var caughtError = null;
-
-/**
- * Call a function while guarding against errors that happens within it.
- *
- * @param {String} name of the guard to use for logging or debugging
- * @param {Function} func The function to invoke
- * @param {*} a First argument
- * @param {*} b Second argument
- */
-function invokeGuardedCallback(name, func, a) {
- try {
- func(a);
- } catch (x) {
- if (caughtError === null) {
- caughtError = x;
- }
- }
-}
-
-var ReactErrorUtils = {
- invokeGuardedCallback: invokeGuardedCallback,
-
- /**
- * Invoked by ReactTestUtils.Simulate so that any errors thrown by the event
- * handler are sure to be rethrown by rethrowCaughtError.
- */
- invokeGuardedCallbackWithCatch: invokeGuardedCallback,
-
- /**
- * During execution of guarded functions we will capture the first error which
- * we will rethrow to be handled by the top level error handler.
- */
- rethrowCaughtError: function () {
- if (caughtError) {
- var error = caughtError;
- caughtError = null;
- throw error;
- }
- }
-};
-
-if (process.env.NODE_ENV !== 'production') {
- /**
- * To help development we can get better devtools integration by simulating a
- * real browser event.
- */
- if (typeof window !== 'undefined' && typeof window.dispatchEvent === 'function' && typeof document !== 'undefined' && typeof document.createEvent === 'function') {
- var fakeNode = document.createElement('react');
- ReactErrorUtils.invokeGuardedCallback = function (name, func, a) {
- var boundFunc = func.bind(null, a);
- var evtType = 'react-' + name;
- fakeNode.addEventListener(evtType, boundFunc, false);
- var evt = document.createEvent('Event');
- // $FlowFixMe https://github.com/facebook/flow/issues/2336
- evt.initEvent(evtType, false, false);
- fakeNode.dispatchEvent(evt);
- fakeNode.removeEventListener(evtType, boundFunc, false);
- };
- }
-}
-
-module.exports = ReactErrorUtils;
-}).call(this,require('_process'))
-
-},{"_process":43}],101:[function(require,module,exports){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-'use strict';
-
-var EventPluginHub = require('./EventPluginHub');
-
-function runEventQueueInBatch(events) {
- EventPluginHub.enqueueEvents(events);
- EventPluginHub.processEventQueue(false);
-}
-
-var ReactEventEmitterMixin = {
-
- /**
- * Streams a fired top-level event to `EventPluginHub` where plugins have the
- * opportunity to create `ReactEvent`s to be dispatched.
- */
- handleTopLevel: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
- var events = EventPluginHub.extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget);
- runEventQueueInBatch(events);
- }
-};
-
-module.exports = ReactEventEmitterMixin;
-},{"./EventPluginHub":63}],102:[function(require,module,exports){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-'use strict';
-
-var _assign = require('object-assign');
-
-var EventListener = require('fbjs/lib/EventListener');
-var ExecutionEnvironment = require('fbjs/lib/ExecutionEnvironment');
-var PooledClass = require('./PooledClass');
-var ReactDOMComponentTree = require('./ReactDOMComponentTree');
-var ReactUpdates = require('./ReactUpdates');
-
-var getEventTarget = require('./getEventTarget');
-var getUnboundedScrollPosition = require('fbjs/lib/getUnboundedScrollPosition');
-
-/**
- * Find the deepest React component completely containing the root of the
- * passed-in instance (for use when entire React trees are nested within each
- * other). If React trees are not nested, returns null.
- */
-function findParent(inst) {
- // TODO: It may be a good idea to cache this to prevent unnecessary DOM
- // traversal, but caching is difficult to do correctly without using a
- // mutation observer to listen for all DOM changes.
- while (inst._hostParent) {
- inst = inst._hostParent;
- }
- var rootNode = ReactDOMComponentTree.getNodeFromInstance(inst);
- var container = rootNode.parentNode;
- return ReactDOMComponentTree.getClosestInstanceFromNode(container);
-}
-
-// Used to store ancestor hierarchy in top level callback
-function TopLevelCallbackBookKeeping(topLevelType, nativeEvent) {
- this.topLevelType = topLevelType;
- this.nativeEvent = nativeEvent;
- this.ancestors = [];
-}
-_assign(TopLevelCallbackBookKeeping.prototype, {
- destructor: function () {
- this.topLevelType = null;
- this.nativeEvent = null;
- this.ancestors.length = 0;
- }
-});
-PooledClass.addPoolingTo(TopLevelCallbackBookKeeping, PooledClass.twoArgumentPooler);
-
-function handleTopLevelImpl(bookKeeping) {
- var nativeEventTarget = getEventTarget(bookKeeping.nativeEvent);
- var targetInst = ReactDOMComponentTree.getClosestInstanceFromNode(nativeEventTarget);
-
- // Loop through the hierarchy, in case there's any nested components.
- // It's important that we build the array of ancestors before calling any
- // event handlers, because event handlers can modify the DOM, leading to
- // inconsistencies with ReactMount's node cache. See #1105.
- var ancestor = targetInst;
- do {
- bookKeeping.ancestors.push(ancestor);
- ancestor = ancestor && findParent(ancestor);
- } while (ancestor);
-
- for (var i = 0; i < bookKeeping.ancestors.length; i++) {
- targetInst = bookKeeping.ancestors[i];
- ReactEventListener._handleTopLevel(bookKeeping.topLevelType, targetInst, bookKeeping.nativeEvent, getEventTarget(bookKeeping.nativeEvent));
- }
-}
-
-function scrollValueMonitor(cb) {
- var scrollPosition = getUnboundedScrollPosition(window);
- cb(scrollPosition);
-}
-
-var ReactEventListener = {
- _enabled: true,
- _handleTopLevel: null,
-
- WINDOW_HANDLE: ExecutionEnvironment.canUseDOM ? window : null,
-
- setHandleTopLevel: function (handleTopLevel) {
- ReactEventListener._handleTopLevel = handleTopLevel;
- },
-
- setEnabled: function (enabled) {
- ReactEventListener._enabled = !!enabled;
- },
-
- isEnabled: function () {
- return ReactEventListener._enabled;
- },
-
- /**
- * Traps top-level events by using event bubbling.
- *
- * @param {string} topLevelType Record from `EventConstants`.
- * @param {string} handlerBaseName Event name (e.g. "click").
- * @param {object} element Element on which to attach listener.
- * @return {?object} An object with a remove function which will forcefully
- * remove the listener.
- * @internal
- */
- trapBubbledEvent: function (topLevelType, handlerBaseName, element) {
- if (!element) {
- return null;
- }
- return EventListener.listen(element, handlerBaseName, ReactEventListener.dispatchEvent.bind(null, topLevelType));
- },
-
- /**
- * Traps a top-level event by using event capturing.
- *
- * @param {string} topLevelType Record from `EventConstants`.
- * @param {string} handlerBaseName Event name (e.g. "click").
- * @param {object} element Element on which to attach listener.
- * @return {?object} An object with a remove function which will forcefully
- * remove the listener.
- * @internal
- */
- trapCapturedEvent: function (topLevelType, handlerBaseName, element) {
- if (!element) {
- return null;
- }
- return EventListener.capture(element, handlerBaseName, ReactEventListener.dispatchEvent.bind(null, topLevelType));
- },
-
- monitorScrollValue: function (refresh) {
- var callback = scrollValueMonitor.bind(null, refresh);
- EventListener.listen(window, 'scroll', callback);
- },
-
- dispatchEvent: function (topLevelType, nativeEvent) {
- if (!ReactEventListener._enabled) {
- return;
- }
-
- var bookKeeping = TopLevelCallbackBookKeeping.getPooled(topLevelType, nativeEvent);
- try {
- // Event queue being processed in the same cycle allows
- // `preventDefault`.
- ReactUpdates.batchedUpdates(handleTopLevelImpl, bookKeeping);
- } finally {
- TopLevelCallbackBookKeeping.release(bookKeeping);
- }
- }
-};
-
-module.exports = ReactEventListener;
-},{"./PooledClass":71,"./ReactDOMComponentTree":80,"./ReactUpdates":124,"./getEventTarget":156,"fbjs/lib/EventListener":3,"fbjs/lib/ExecutionEnvironment":4,"fbjs/lib/getUnboundedScrollPosition":15,"object-assign":42}],103:[function(require,module,exports){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- *
- */
-
-'use strict';
-
-var ReactFeatureFlags = {
- // When true, call console.time() before and .timeEnd() after each top-level
- // render (both initial renders and updates). Useful when looking at prod-mode
- // timeline profiles in Chrome, for example.
- logTopLevelRenders: false
-};
-
-module.exports = ReactFeatureFlags;
-},{}],104:[function(require,module,exports){
-(function (process){
-/**
- * Copyright 2014-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-'use strict';
-
-var _prodInvariant = require('./reactProdInvariant');
-
-var invariant = require('fbjs/lib/invariant');
-
-var genericComponentClass = null;
-var textComponentClass = null;
-
-var ReactHostComponentInjection = {
- // This accepts a class that receives the tag string. This is a catch all
- // that can render any kind of tag.
- injectGenericComponentClass: function (componentClass) {
- genericComponentClass = componentClass;
- },
- // This accepts a text component class that takes the text string to be
- // rendered as props.
- injectTextComponentClass: function (componentClass) {
- textComponentClass = componentClass;
- }
-};
-
-/**
- * Get a host internal component class for a specific tag.
- *
- * @param {ReactElement} element The element to create.
- * @return {function} The internal class constructor function.
- */
-function createInternalComponent(element) {
- !genericComponentClass ? process.env.NODE_ENV !== 'production' ? invariant(false, 'There is no registered component for the tag %s', element.type) : _prodInvariant('111', element.type) : void 0;
- return new genericComponentClass(element);
-}
-
-/**
- * @param {ReactText} text
- * @return {ReactComponent}
- */
-function createInstanceForText(text) {
- return new textComponentClass(text);
-}
-
-/**
- * @param {ReactComponent} component
- * @return {boolean}
- */
-function isTextComponent(component) {
- return component instanceof textComponentClass;
-}
-
-var ReactHostComponent = {
- createInternalComponent: createInternalComponent,
- createInstanceForText: createInstanceForText,
- isTextComponent: isTextComponent,
- injection: ReactHostComponentInjection
-};
-
-module.exports = ReactHostComponent;
-}).call(this,require('_process'))
-
-},{"./reactProdInvariant":167,"_process":43,"fbjs/lib/invariant":18}],105:[function(require,module,exports){
-/**
- * Copyright 2016-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- *
- */
-
-'use strict';
-
-var history = [];
-
-var ReactHostOperationHistoryHook = {
- onHostOperation: function (operation) {
- history.push(operation);
- },
- clearHistory: function () {
- if (ReactHostOperationHistoryHook._preventClearing) {
- // Should only be used for tests.
- return;
- }
-
- history = [];
- },
- getHistory: function () {
- return history;
- }
-};
-
-module.exports = ReactHostOperationHistoryHook;
-},{}],106:[function(require,module,exports){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-'use strict';
-
-var DOMProperty = require('./DOMProperty');
-var EventPluginHub = require('./EventPluginHub');
-var EventPluginUtils = require('./EventPluginUtils');
-var ReactComponentEnvironment = require('./ReactComponentEnvironment');
-var ReactEmptyComponent = require('./ReactEmptyComponent');
-var ReactBrowserEventEmitter = require('./ReactBrowserEventEmitter');
-var ReactHostComponent = require('./ReactHostComponent');
-var ReactUpdates = require('./ReactUpdates');
-
-var ReactInjection = {
- Component: ReactComponentEnvironment.injection,
- DOMProperty: DOMProperty.injection,
- EmptyComponent: ReactEmptyComponent.injection,
- EventPluginHub: EventPluginHub.injection,
- EventPluginUtils: EventPluginUtils.injection,
- EventEmitter: ReactBrowserEventEmitter.injection,
- HostComponent: ReactHostComponent.injection,
- Updates: ReactUpdates.injection
-};
-
-module.exports = ReactInjection;
-},{"./DOMProperty":58,"./EventPluginHub":63,"./EventPluginUtils":65,"./ReactBrowserEventEmitter":72,"./ReactComponentEnvironment":75,"./ReactEmptyComponent":99,"./ReactHostComponent":104,"./ReactUpdates":124}],107:[function(require,module,exports){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-'use strict';
-
-var ReactDOMSelection = require('./ReactDOMSelection');
-
-var containsNode = require('fbjs/lib/containsNode');
-var focusNode = require('fbjs/lib/focusNode');
-var getActiveElement = require('fbjs/lib/getActiveElement');
-
-function isInDocument(node) {
- return containsNode(document.documentElement, node);
-}
-
-/**
- * @ReactInputSelection: React input selection module. Based on Selection.js,
- * but modified to be suitable for react and has a couple of bug fixes (doesn't
- * assume buttons have range selections allowed).
- * Input selection module for React.
- */
-var ReactInputSelection = {
-
- hasSelectionCapabilities: function (elem) {
- var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();
- return nodeName && (nodeName === 'input' && elem.type === 'text' || nodeName === 'textarea' || elem.contentEditable === 'true');
- },
-
- getSelectionInformation: function () {
- var focusedElem = getActiveElement();
- return {
- focusedElem: focusedElem,
- selectionRange: ReactInputSelection.hasSelectionCapabilities(focusedElem) ? ReactInputSelection.getSelection(focusedElem) : null
- };
- },
-
- /**
- * @restoreSelection: If any selection information was potentially lost,
- * restore it. This is useful when performing operations that could remove dom
- * nodes and place them back in, resulting in focus being lost.
- */
- restoreSelection: function (priorSelectionInformation) {
- var curFocusedElem = getActiveElement();
- var priorFocusedElem = priorSelectionInformation.focusedElem;
- var priorSelectionRange = priorSelectionInformation.selectionRange;
- if (curFocusedElem !== priorFocusedElem && isInDocument(priorFocusedElem)) {
- if (ReactInputSelection.hasSelectionCapabilities(priorFocusedElem)) {
- ReactInputSelection.setSelection(priorFocusedElem, priorSelectionRange);
- }
- focusNode(priorFocusedElem);
- }
- },
-
- /**
- * @getSelection: Gets the selection bounds of a focused textarea, input or
- * contentEditable node.
- * -@input: Look up selection bounds of this input
- * -@return {start: selectionStart, end: selectionEnd}
- */
- getSelection: function (input) {
- var selection;
-
- if ('selectionStart' in input) {
- // Modern browser with input or textarea.
- selection = {
- start: input.selectionStart,
- end: input.selectionEnd
- };
- } else if (document.selection && input.nodeName && input.nodeName.toLowerCase() === 'input') {
- // IE8 input.
- var range = document.selection.createRange();
- // There can only be one selection per document in IE, so it must
- // be in our element.
- if (range.parentElement() === input) {
- selection = {
- start: -range.moveStart('character', -input.value.length),
- end: -range.moveEnd('character', -input.value.length)
- };
- }
- } else {
- // Content editable or old IE textarea.
- selection = ReactDOMSelection.getOffsets(input);
- }
-
- return selection || { start: 0, end: 0 };
- },
-
- /**
- * @setSelection: Sets the selection bounds of a textarea or input and focuses
- * the input.
- * -@input Set selection bounds of this input or textarea
- * -@offsets Object of same form that is returned from get*
- */
- setSelection: function (input, offsets) {
- var start = offsets.start;
- var end = offsets.end;
- if (end === undefined) {
- end = start;
- }
-
- if ('selectionStart' in input) {
- input.selectionStart = start;
- input.selectionEnd = Math.min(end, input.value.length);
- } else if (document.selection && input.nodeName && input.nodeName.toLowerCase() === 'input') {
- var range = input.createTextRange();
- range.collapse(true);
- range.moveStart('character', start);
- range.moveEnd('character', end - start);
- range.select();
- } else {
- ReactDOMSelection.setOffsets(input, offsets);
- }
- }
-};
-
-module.exports = ReactInputSelection;
-},{"./ReactDOMSelection":90,"fbjs/lib/containsNode":7,"fbjs/lib/focusNode":12,"fbjs/lib/getActiveElement":13}],108:[function(require,module,exports){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-'use strict';
-
-/**
- * `ReactInstanceMap` maintains a mapping from a public facing stateful
- * instance (key) and the internal representation (value). This allows public
- * methods to accept the user facing instance as an argument and map them back
- * to internal methods.
- */
-
-// TODO: Replace this with ES6: var ReactInstanceMap = new Map();
-
-var ReactInstanceMap = {
-
- /**
- * This API should be called `delete` but we'd have to make sure to always
- * transform these to strings for IE support. When this transform is fully
- * supported we can rename it.
- */
- remove: function (key) {
- key._reactInternalInstance = undefined;
- },
-
- get: function (key) {
- return key._reactInternalInstance;
- },
-
- has: function (key) {
- return key._reactInternalInstance !== undefined;
- },
-
- set: function (key, value) {
- key._reactInternalInstance = value;
- }
-
-};
-
-module.exports = ReactInstanceMap;
-},{}],109:[function(require,module,exports){
-(function (process){
-/**
- * Copyright 2016-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- *
- */
-
-'use strict';
-
-// Trust the developer to only use ReactInstrumentation with a __DEV__ check
-
-var debugTool = null;
-
-if (process.env.NODE_ENV !== 'production') {
- var ReactDebugTool = require('./ReactDebugTool');
- debugTool = ReactDebugTool;
-}
-
-module.exports = { debugTool: debugTool };
-}).call(this,require('_process'))
-
-},{"./ReactDebugTool":95,"_process":43}],110:[function(require,module,exports){
-(function (process){
-/**
- * Copyright 2016-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- *
- */
-
-'use strict';
-
-var warning = require('fbjs/lib/warning');
-
-if (process.env.NODE_ENV !== 'production') {
- var processingChildContext = false;
-
- var warnInvalidSetState = function () {
- process.env.NODE_ENV !== 'production' ? warning(!processingChildContext, 'setState(...): Cannot call setState() inside getChildContext()') : void 0;
- };
-}
-
-var ReactInvalidSetStateWarningHook = {
- onBeginProcessingChildContext: function () {
- processingChildContext = true;
- },
- onEndProcessingChildContext: function () {
- processingChildContext = false;
- },
- onSetState: function () {
- warnInvalidSetState();
- }
-};
-
-module.exports = ReactInvalidSetStateWarningHook;
-}).call(this,require('_process'))
-
-},{"_process":43,"fbjs/lib/warning":25}],111:[function(require,module,exports){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-'use strict';
-
-var adler32 = require('./adler32');
-
-var TAG_END = /\/?>/;
-var COMMENT_START = /^<\!\-\-/;
-
-var ReactMarkupChecksum = {
- CHECKSUM_ATTR_NAME: 'data-react-checksum',
-
- /**
- * @param {string} markup Markup string
- * @return {string} Markup string with checksum attribute attached
- */
- addChecksumToMarkup: function (markup) {
- var checksum = adler32(markup);
-
- // Add checksum (handle both parent tags, comments and self-closing tags)
- if (COMMENT_START.test(markup)) {
- return markup;
- } else {
- return markup.replace(TAG_END, ' ' + ReactMarkupChecksum.CHECKSUM_ATTR_NAME + '="' + checksum + '"$&');
- }
- },
-
- /**
- * @param {string} markup to use
- * @param {DOMElement} element root React element
- * @returns {boolean} whether or not the markup is the same
- */
- canReuseMarkup: function (markup, element) {
- var existingChecksum = element.getAttribute(ReactMarkupChecksum.CHECKSUM_ATTR_NAME);
- existingChecksum = existingChecksum && parseInt(existingChecksum, 10);
- var markupChecksum = adler32(markup);
- return markupChecksum === existingChecksum;
- }
-};
-
-module.exports = ReactMarkupChecksum;
-},{"./adler32":145}],112:[function(require,module,exports){
-(function (process){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-'use strict';
-
-var _prodInvariant = require('./reactProdInvariant');
-
-var DOMLazyTree = require('./DOMLazyTree');
-var DOMProperty = require('./DOMProperty');
-var React = require('react/lib/React');
-var ReactBrowserEventEmitter = require('./ReactBrowserEventEmitter');
-var ReactCurrentOwner = require('react/lib/ReactCurrentOwner');
-var ReactDOMComponentTree = require('./ReactDOMComponentTree');
-var ReactDOMContainerInfo = require('./ReactDOMContainerInfo');
-var ReactDOMFeatureFlags = require('./ReactDOMFeatureFlags');
-var ReactFeatureFlags = require('./ReactFeatureFlags');
-var ReactInstanceMap = require('./ReactInstanceMap');
-var ReactInstrumentation = require('./ReactInstrumentation');
-var ReactMarkupChecksum = require('./ReactMarkupChecksum');
-var ReactReconciler = require('./ReactReconciler');
-var ReactUpdateQueue = require('./ReactUpdateQueue');
-var ReactUpdates = require('./ReactUpdates');
-
-var emptyObject = require('fbjs/lib/emptyObject');
-var instantiateReactComponent = require('./instantiateReactComponent');
-var invariant = require('fbjs/lib/invariant');
-var setInnerHTML = require('./setInnerHTML');
-var shouldUpdateReactComponent = require('./shouldUpdateReactComponent');
-var warning = require('fbjs/lib/warning');
-
-var ATTR_NAME = DOMProperty.ID_ATTRIBUTE_NAME;
-var ROOT_ATTR_NAME = DOMProperty.ROOT_ATTRIBUTE_NAME;
-
-var ELEMENT_NODE_TYPE = 1;
-var DOC_NODE_TYPE = 9;
-var DOCUMENT_FRAGMENT_NODE_TYPE = 11;
-
-var instancesByReactRootID = {};
-
-/**
- * Finds the index of the first character
- * that's not common between the two given strings.
- *
- * @return {number} the index of the character where the strings diverge
- */
-function firstDifferenceIndex(string1, string2) {
- var minLen = Math.min(string1.length, string2.length);
- for (var i = 0; i < minLen; i++) {
- if (string1.charAt(i) !== string2.charAt(i)) {
- return i;
- }
- }
- return string1.length === string2.length ? -1 : minLen;
-}
-
-/**
- * @param {DOMElement|DOMDocument} container DOM element that may contain
- * a React component
- * @return {?*} DOM element that may have the reactRoot ID, or null.
- */
-function getReactRootElementInContainer(container) {
- if (!container) {
- return null;
- }
-
- if (container.nodeType === DOC_NODE_TYPE) {
- return container.documentElement;
- } else {
- return container.firstChild;
- }
-}
-
-function internalGetID(node) {
- // If node is something like a window, document, or text node, none of
- // which support attributes or a .getAttribute method, gracefully return
- // the empty string, as if the attribute were missing.
- return node.getAttribute && node.getAttribute(ATTR_NAME) || '';
-}
-
-/**
- * Mounts this component and inserts it into the DOM.
- *
- * @param {ReactComponent} componentInstance The instance to mount.
- * @param {DOMElement} container DOM element to mount into.
- * @param {ReactReconcileTransaction} transaction
- * @param {boolean} shouldReuseMarkup If true, do not insert markup
- */
-function mountComponentIntoNode(wrapperInstance, container, transaction, shouldReuseMarkup, context) {
- var markerName;
- if (ReactFeatureFlags.logTopLevelRenders) {
- var wrappedElement = wrapperInstance._currentElement.props.child;
- var type = wrappedElement.type;
- markerName = 'React mount: ' + (typeof type === 'string' ? type : type.displayName || type.name);
- console.time(markerName);
- }
-
- var markup = ReactReconciler.mountComponent(wrapperInstance, transaction, null, ReactDOMContainerInfo(wrapperInstance, container), context, 0 /* parentDebugID */
- );
-
- if (markerName) {
- console.timeEnd(markerName);
- }
-
- wrapperInstance._renderedComponent._topLevelWrapper = wrapperInstance;
- ReactMount._mountImageIntoNode(markup, container, wrapperInstance, shouldReuseMarkup, transaction);
-}
-
-/**
- * Batched mount.
- *
- * @param {ReactComponent} componentInstance The instance to mount.
- * @param {DOMElement} container DOM element to mount into.
- * @param {boolean} shouldReuseMarkup If true, do not insert markup
- */
-function batchedMountComponentIntoNode(componentInstance, container, shouldReuseMarkup, context) {
- var transaction = ReactUpdates.ReactReconcileTransaction.getPooled(
- /* useCreateElement */
- !shouldReuseMarkup && ReactDOMFeatureFlags.useCreateElement);
- transaction.perform(mountComponentIntoNode, null, componentInstance, container, transaction, shouldReuseMarkup, context);
- ReactUpdates.ReactReconcileTransaction.release(transaction);
-}
-
-/**
- * Unmounts a component and removes it from the DOM.
- *
- * @param {ReactComponent} instance React component instance.
- * @param {DOMElement} container DOM element to unmount from.
- * @final
- * @internal
- * @see {ReactMount.unmountComponentAtNode}
- */
-function unmountComponentFromNode(instance, container, safely) {
- if (process.env.NODE_ENV !== 'production') {
- ReactInstrumentation.debugTool.onBeginFlush();
- }
- ReactReconciler.unmountComponent(instance, safely);
- if (process.env.NODE_ENV !== 'production') {
- ReactInstrumentation.debugTool.onEndFlush();
- }
-
- if (container.nodeType === DOC_NODE_TYPE) {
- container = container.documentElement;
- }
-
- // http://jsperf.com/emptying-a-node
- while (container.lastChild) {
- container.removeChild(container.lastChild);
- }
-}
-
-/**
- * True if the supplied DOM node has a direct React-rendered child that is
- * not a React root element. Useful for warning in `render`,
- * `unmountComponentAtNode`, etc.
- *
- * @param {?DOMElement} node The candidate DOM node.
- * @return {boolean} True if the DOM element contains a direct child that was
- * rendered by React but is not a root element.
- * @internal
- */
-function hasNonRootReactChild(container) {
- var rootEl = getReactRootElementInContainer(container);
- if (rootEl) {
- var inst = ReactDOMComponentTree.getInstanceFromNode(rootEl);
- return !!(inst && inst._hostParent);
- }
-}
-
-/**
- * True if the supplied DOM node is a React DOM element and
- * it has been rendered by another copy of React.
- *
- * @param {?DOMElement} node The candidate DOM node.
- * @return {boolean} True if the DOM has been rendered by another copy of React
- * @internal
- */
-function nodeIsRenderedByOtherInstance(container) {
- var rootEl = getReactRootElementInContainer(container);
- return !!(rootEl && isReactNode(rootEl) && !ReactDOMComponentTree.getInstanceFromNode(rootEl));
-}
-
-/**
- * True if the supplied DOM node is a valid node element.
- *
- * @param {?DOMElement} node The candidate DOM node.
- * @return {boolean} True if the DOM is a valid DOM node.
- * @internal
- */
-function isValidContainer(node) {
- return !!(node && (node.nodeType === ELEMENT_NODE_TYPE || node.nodeType === DOC_NODE_TYPE || node.nodeType === DOCUMENT_FRAGMENT_NODE_TYPE));
-}
-
-/**
- * True if the supplied DOM node is a valid React node element.
- *
- * @param {?DOMElement} node The candidate DOM node.
- * @return {boolean} True if the DOM is a valid React DOM node.
- * @internal
- */
-function isReactNode(node) {
- return isValidContainer(node) && (node.hasAttribute(ROOT_ATTR_NAME) || node.hasAttribute(ATTR_NAME));
-}
-
-function getHostRootInstanceInContainer(container) {
- var rootEl = getReactRootElementInContainer(container);
- var prevHostInstance = rootEl && ReactDOMComponentTree.getInstanceFromNode(rootEl);
- return prevHostInstance && !prevHostInstance._hostParent ? prevHostInstance : null;
-}
-
-function getTopLevelWrapperInContainer(container) {
- var root = getHostRootInstanceInContainer(container);
- return root ? root._hostContainerInfo._topLevelWrapper : null;
-}
-
-/**
- * Temporary (?) hack so that we can store all top-level pending updates on
- * composites instead of having to worry about different types of components
- * here.
- */
-var topLevelRootCounter = 1;
-var TopLevelWrapper = function () {
- this.rootID = topLevelRootCounter++;
-};
-TopLevelWrapper.prototype.isReactComponent = {};
-if (process.env.NODE_ENV !== 'production') {
- TopLevelWrapper.displayName = 'TopLevelWrapper';
-}
-TopLevelWrapper.prototype.render = function () {
- return this.props.child;
-};
-TopLevelWrapper.isReactTopLevelWrapper = true;
-
-/**
- * Mounting is the process of initializing a React component by creating its
- * representative DOM elements and inserting them into a supplied `container`.
- * Any prior content inside `container` is destroyed in the process.
- *
- * ReactMount.render(
- * component,
- * document.getElementById('container')
- * );
- *
- * <div id="container"> <-- Supplied `container`.
- * <div data-reactid=".3"> <-- Rendered reactRoot of React
- * // ... component.
- * </div>
- * </div>
- *
- * Inside of `container`, the first element rendered is the "reactRoot".
- */
-var ReactMount = {
-
- TopLevelWrapper: TopLevelWrapper,
-
- /**
- * Used by devtools. The keys are not important.
- */
- _instancesByReactRootID: instancesByReactRootID,
-
- /**
- * This is a hook provided to support rendering React components while
- * ensuring that the apparent scroll position of its `container` does not
- * change.
- *
- * @param {DOMElement} container The `container` being rendered into.
- * @param {function} renderCallback This must be called once to do the render.
- */
- scrollMonitor: function (container, renderCallback) {
- renderCallback();
- },
-
- /**
- * Take a component that's already mounted into the DOM and replace its props
- * @param {ReactComponent} prevComponent component instance already in the DOM
- * @param {ReactElement} nextElement component instance to render
- * @param {DOMElement} container container to render into
- * @param {?function} callback function triggered on completion
- */
- _updateRootComponent: function (prevComponent, nextElement, nextContext, container, callback) {
- ReactMount.scrollMonitor(container, function () {
- ReactUpdateQueue.enqueueElementInternal(prevComponent, nextElement, nextContext);
- if (callback) {
- ReactUpdateQueue.enqueueCallbackInternal(prevComponent, callback);
- }
- });
-
- return prevComponent;
- },
-
- /**
- * Render a new component into the DOM. Hooked by hooks!
- *
- * @param {ReactElement} nextElement element to render
- * @param {DOMElement} container container to render into
- * @param {boolean} shouldReuseMarkup if we should skip the markup insertion
- * @return {ReactComponent} nextComponent
- */
- _renderNewRootComponent: function (nextElement, container, shouldReuseMarkup, context) {
- // Various parts of our code (such as ReactCompositeComponent's
- // _renderValidatedComponent) assume that calls to render aren't nested;
- // verify that that's the case.
- process.env.NODE_ENV !== 'production' ? warning(ReactCurrentOwner.current == null, '_renderNewRootComponent(): Render methods should be a pure function ' + 'of props and state; triggering nested component updates from ' + 'render is not allowed. If necessary, trigger nested updates in ' + 'componentDidUpdate. Check the render method of %s.', ReactCurrentOwner.current && ReactCurrentOwner.current.getName() || 'ReactCompositeComponent') : void 0;
-
- !isValidContainer(container) ? process.env.NODE_ENV !== 'production' ? invariant(false, '_registerComponent(...): Target container is not a DOM element.') : _prodInvariant('37') : void 0;
-
- ReactBrowserEventEmitter.ensureScrollValueMonitoring();
- var componentInstance = instantiateReactComponent(nextElement, false);
-
- // The initial render is synchronous but any updates that happen during
- // rendering, in componentWillMount or componentDidMount, will be batched
- // according to the current batching strategy.
-
- ReactUpdates.batchedUpdates(batchedMountComponentIntoNode, componentInstance, container, shouldReuseMarkup, context);
-
- var wrapperID = componentInstance._instance.rootID;
- instancesByReactRootID[wrapperID] = componentInstance;
-
- return componentInstance;
- },
-
- /**
- * Renders a React component into the DOM in the supplied `container`.
- *
- * If the React component was previously rendered into `container`, this will
- * perform an update on it and only mutate the DOM as necessary to reflect the
- * latest React component.
- *
- * @param {ReactComponent} parentComponent The conceptual parent of this render tree.
- * @param {ReactElement} nextElement Component element to render.
- * @param {DOMElement} container DOM element to render into.
- * @param {?function} callback function triggered on completion
- * @return {ReactComponent} Component instance rendered in `container`.
- */
- renderSubtreeIntoContainer: function (parentComponent, nextElement, container, callback) {
- !(parentComponent != null && ReactInstanceMap.has(parentComponent)) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'parentComponent must be a valid React Component') : _prodInvariant('38') : void 0;
- return ReactMount._renderSubtreeIntoContainer(parentComponent, nextElement, container, callback);
- },
-
- _renderSubtreeIntoContainer: function (parentComponent, nextElement, container, callback) {
- ReactUpdateQueue.validateCallback(callback, 'ReactDOM.render');
- !React.isValidElement(nextElement) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactDOM.render(): Invalid component element.%s', typeof nextElement === 'string' ? ' Instead of passing a string like \'div\', pass ' + 'React.createElement(\'div\') or <div />.' : typeof nextElement === 'function' ? ' Instead of passing a class like Foo, pass ' + 'React.createElement(Foo) or <Foo />.' :
- // Check if it quacks like an element
- nextElement != null && nextElement.props !== undefined ? ' This may be caused by unintentionally loading two independent ' + 'copies of React.' : '') : _prodInvariant('39', typeof nextElement === 'string' ? ' Instead of passing a string like \'div\', pass ' + 'React.createElement(\'div\') or <div />.' : typeof nextElement === 'function' ? ' Instead of passing a class like Foo, pass ' + 'React.createElement(Foo) or <Foo />.' : nextElement != null && nextElement.props !== undefined ? ' This may be caused by unintentionally loading two independent ' + 'copies of React.' : '') : void 0;
-
- process.env.NODE_ENV !== 'production' ? warning(!container || !container.tagName || container.tagName.toUpperCase() !== 'BODY', 'render(): Rendering components directly into document.body is ' + 'discouraged, since its children are often manipulated by third-party ' + 'scripts and browser extensions. This may lead to subtle ' + 'reconciliation issues. Try rendering into a container element created ' + 'for your app.') : void 0;
-
- var nextWrappedElement = React.createElement(TopLevelWrapper, { child: nextElement });
-
- var nextContext;
- if (parentComponent) {
- var parentInst = ReactInstanceMap.get(parentComponent);
- nextContext = parentInst._processChildContext(parentInst._context);
- } else {
- nextContext = emptyObject;
- }
-
- var prevComponent = getTopLevelWrapperInContainer(container);
-
- if (prevComponent) {
- var prevWrappedElement = prevComponent._currentElement;
- var prevElement = prevWrappedElement.props.child;
- if (shouldUpdateReactComponent(prevElement, nextElement)) {
- var publicInst = prevComponent._renderedComponent.getPublicInstance();
- var updatedCallback = callback && function () {
- callback.call(publicInst);
- };
- ReactMount._updateRootComponent(prevComponent, nextWrappedElement, nextContext, container, updatedCallback);
- return publicInst;
- } else {
- ReactMount.unmountComponentAtNode(container);
- }
- }
-
- var reactRootElement = getReactRootElementInContainer(container);
- var containerHasReactMarkup = reactRootElement && !!internalGetID(reactRootElement);
- var containerHasNonRootReactChild = hasNonRootReactChild(container);
-
- if (process.env.NODE_ENV !== 'production') {
- process.env.NODE_ENV !== 'production' ? warning(!containerHasNonRootReactChild, 'render(...): Replacing React-rendered children with a new root ' + 'component. If you intended to update the children of this node, ' + 'you should instead have the existing children update their state ' + 'and render the new components instead of calling ReactDOM.render.') : void 0;
-
- if (!containerHasReactMarkup || reactRootElement.nextSibling) {
- var rootElementSibling = reactRootElement;
- while (rootElementSibling) {
- if (internalGetID(rootElementSibling)) {
- process.env.NODE_ENV !== 'production' ? warning(false, 'render(): Target node has markup rendered by React, but there ' + 'are unrelated nodes as well. This is most commonly caused by ' + 'white-space inserted around server-rendered markup.') : void 0;
- break;
- }
- rootElementSibling = rootElementSibling.nextSibling;
- }
- }
- }
-
- var shouldReuseMarkup = containerHasReactMarkup && !prevComponent && !containerHasNonRootReactChild;
- var component = ReactMount._renderNewRootComponent(nextWrappedElement, container, shouldReuseMarkup, nextContext)._renderedComponent.getPublicInstance();
- if (callback) {
- callback.call(component);
- }
- return component;
- },
-
- /**
- * Renders a React component into the DOM in the supplied `container`.
- * See https://facebook.github.io/react/docs/top-level-api.html#reactdom.render
- *
- * If the React component was previously rendered into `container`, this will
- * perform an update on it and only mutate the DOM as necessary to reflect the
- * latest React component.
- *
- * @param {ReactElement} nextElement Component element to render.
- * @param {DOMElement} container DOM element to render into.
- * @param {?function} callback function triggered on completion
- * @return {ReactComponent} Component instance rendered in `container`.
- */
- render: function (nextElement, container, callback) {
- return ReactMount._renderSubtreeIntoContainer(null, nextElement, container, callback);
- },
-
- /**
- * Unmounts and destroys the React component rendered in the `container`.
- * See https://facebook.github.io/react/docs/top-level-api.html#reactdom.unmountcomponentatnode
- *
- * @param {DOMElement} container DOM element containing a React component.
- * @return {boolean} True if a component was found in and unmounted from
- * `container`
- */
- unmountComponentAtNode: function (container) {
- // Various parts of our code (such as ReactCompositeComponent's
- // _renderValidatedComponent) assume that calls to render aren't nested;
- // verify that that's the case. (Strictly speaking, unmounting won't cause a
- // render but we still don't expect to be in a render call here.)
- process.env.NODE_ENV !== 'production' ? warning(ReactCurrentOwner.current == null, 'unmountComponentAtNode(): Render methods should be a pure function ' + 'of props and state; triggering nested component updates from render ' + 'is not allowed. If necessary, trigger nested updates in ' + 'componentDidUpdate. Check the render method of %s.', ReactCurrentOwner.current && ReactCurrentOwner.current.getName() || 'ReactCompositeComponent') : void 0;
-
- !isValidContainer(container) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'unmountComponentAtNode(...): Target container is not a DOM element.') : _prodInvariant('40') : void 0;
-
- if (process.env.NODE_ENV !== 'production') {
- process.env.NODE_ENV !== 'production' ? warning(!nodeIsRenderedByOtherInstance(container), 'unmountComponentAtNode(): The node you\'re attempting to unmount ' + 'was rendered by another copy of React.') : void 0;
- }
-
- var prevComponent = getTopLevelWrapperInContainer(container);
- if (!prevComponent) {
- // Check if the node being unmounted was rendered by React, but isn't a
- // root node.
- var containerHasNonRootReactChild = hasNonRootReactChild(container);
-
- // Check if the container itself is a React root node.
- var isContainerReactRoot = container.nodeType === 1 && container.hasAttribute(ROOT_ATTR_NAME);
-
- if (process.env.NODE_ENV !== 'production') {
- process.env.NODE_ENV !== 'production' ? warning(!containerHasNonRootReactChild, 'unmountComponentAtNode(): The node you\'re attempting to unmount ' + 'was rendered by React and is not a top-level container. %s', isContainerReactRoot ? 'You may have accidentally passed in a React root node instead ' + 'of its container.' : 'Instead, have the parent component update its state and ' + 'rerender in order to remove this component.') : void 0;
- }
-
- return false;
- }
- delete instancesByReactRootID[prevComponent._instance.rootID];
- ReactUpdates.batchedUpdates(unmountComponentFromNode, prevComponent, container, false);
- return true;
- },
-
- _mountImageIntoNode: function (markup, container, instance, shouldReuseMarkup, transaction) {
- !isValidContainer(container) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'mountComponentIntoNode(...): Target container is not valid.') : _prodInvariant('41') : void 0;
-
- if (shouldReuseMarkup) {
- var rootElement = getReactRootElementInContainer(container);
- if (ReactMarkupChecksum.canReuseMarkup(markup, rootElement)) {
- ReactDOMComponentTree.precacheNode(instance, rootElement);
- return;
- } else {
- var checksum = rootElement.getAttribute(ReactMarkupChecksum.CHECKSUM_ATTR_NAME);
- rootElement.removeAttribute(ReactMarkupChecksum.CHECKSUM_ATTR_NAME);
-
- var rootMarkup = rootElement.outerHTML;
- rootElement.setAttribute(ReactMarkupChecksum.CHECKSUM_ATTR_NAME, checksum);
-
- var normalizedMarkup = markup;
- if (process.env.NODE_ENV !== 'production') {
- // because rootMarkup is retrieved from the DOM, various normalizations
- // will have occurred which will not be present in `markup`. Here,
- // insert markup into a <div> or <iframe> depending on the container
- // type to perform the same normalizations before comparing.
- var normalizer;
- if (container.nodeType === ELEMENT_NODE_TYPE) {
- normalizer = document.createElement('div');
- normalizer.innerHTML = markup;
- normalizedMarkup = normalizer.innerHTML;
- } else {
- normalizer = document.createElement('iframe');
- document.body.appendChild(normalizer);
- normalizer.contentDocument.write(markup);
- normalizedMarkup = normalizer.contentDocument.documentElement.outerHTML;
- document.body.removeChild(normalizer);
- }
- }
-
- var diffIndex = firstDifferenceIndex(normalizedMarkup, rootMarkup);
- var difference = ' (client) ' + normalizedMarkup.substring(diffIndex - 20, diffIndex + 20) + '\n (server) ' + rootMarkup.substring(diffIndex - 20, diffIndex + 20);
-
- !(container.nodeType !== DOC_NODE_TYPE) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'You\'re trying to render a component to the document using server rendering but the checksum was invalid. This usually means you rendered a different component type or props on the client from the one on the server, or your render() methods are impure. React cannot handle this case due to cross-browser quirks by rendering at the document root. You should look for environment dependent code in your components and ensure the props are the same client and server side:\n%s', difference) : _prodInvariant('42', difference) : void 0;
-
- if (process.env.NODE_ENV !== 'production') {
- process.env.NODE_ENV !== 'production' ? warning(false, 'React attempted to reuse markup in a container but the ' + 'checksum was invalid. This generally means that you are ' + 'using server rendering and the markup generated on the ' + 'server was not what the client was expecting. React injected ' + 'new markup to compensate which works but you have lost many ' + 'of the benefits of server rendering. Instead, figure out ' + 'why the markup being generated is different on the client ' + 'or server:\n%s', difference) : void 0;
- }
- }
- }
-
- !(container.nodeType !== DOC_NODE_TYPE) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'You\'re trying to render a component to the document but you didn\'t use server rendering. We can\'t do this without using server rendering due to cross-browser quirks. See ReactDOMServer.renderToString() for server rendering.') : _prodInvariant('43') : void 0;
-
- if (transaction.useCreateElement) {
- while (container.lastChild) {
- container.removeChild(container.lastChild);
- }
- DOMLazyTree.insertTreeBefore(container, markup, null);
- } else {
- setInnerHTML(container, markup);
- ReactDOMComponentTree.precacheNode(instance, container.firstChild);
- }
-
- if (process.env.NODE_ENV !== 'production') {
- var hostNode = ReactDOMComponentTree.getInstanceFromNode(container.firstChild);
- if (hostNode._debugID !== 0) {
- ReactInstrumentation.debugTool.onHostOperation({
- instanceID: hostNode._debugID,
- type: 'mount',
- payload: markup.toString()
- });
- }
- }
- }
-};
-
-module.exports = ReactMount;
-}).call(this,require('_process'))
-
-},{"./DOMLazyTree":56,"./DOMProperty":58,"./ReactBrowserEventEmitter":72,"./ReactDOMComponentTree":80,"./ReactDOMContainerInfo":81,"./ReactDOMFeatureFlags":83,"./ReactFeatureFlags":103,"./ReactInstanceMap":108,"./ReactInstrumentation":109,"./ReactMarkupChecksum":111,"./ReactReconciler":119,"./ReactUpdateQueue":123,"./ReactUpdates":124,"./instantiateReactComponent":163,"./reactProdInvariant":167,"./setInnerHTML":169,"./shouldUpdateReactComponent":171,"_process":43,"fbjs/lib/emptyObject":11,"fbjs/lib/invariant":18,"fbjs/lib/warning":25,"react/lib/React":190,"react/lib/ReactCurrentOwner":195}],113:[function(require,module,exports){
-(function (process){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-'use strict';
-
-var _prodInvariant = require('./reactProdInvariant');
-
-var ReactComponentEnvironment = require('./ReactComponentEnvironment');
-var ReactInstanceMap = require('./ReactInstanceMap');
-var ReactInstrumentation = require('./ReactInstrumentation');
-
-var ReactCurrentOwner = require('react/lib/ReactCurrentOwner');
-var ReactReconciler = require('./ReactReconciler');
-var ReactChildReconciler = require('./ReactChildReconciler');
-
-var emptyFunction = require('fbjs/lib/emptyFunction');
-var flattenChildren = require('./flattenChildren');
-var invariant = require('fbjs/lib/invariant');
-
-/**
- * Make an update for markup to be rendered and inserted at a supplied index.
- *
- * @param {string} markup Markup that renders into an element.
- * @param {number} toIndex Destination index.
- * @private
- */
-function makeInsertMarkup(markup, afterNode, toIndex) {
- // NOTE: Null values reduce hidden classes.
- return {
- type: 'INSERT_MARKUP',
- content: markup,
- fromIndex: null,
- fromNode: null,
- toIndex: toIndex,
- afterNode: afterNode
- };
-}
-
-/**
- * Make an update for moving an existing element to another index.
- *
- * @param {number} fromIndex Source index of the existing element.
- * @param {number} toIndex Destination index of the element.
- * @private
- */
-function makeMove(child, afterNode, toIndex) {
- // NOTE: Null values reduce hidden classes.
- return {
- type: 'MOVE_EXISTING',
- content: null,
- fromIndex: child._mountIndex,
- fromNode: ReactReconciler.getHostNode(child),
- toIndex: toIndex,
- afterNode: afterNode
- };
-}
-
-/**
- * Make an update for removing an element at an index.
- *
- * @param {number} fromIndex Index of the element to remove.
- * @private
- */
-function makeRemove(child, node) {
- // NOTE: Null values reduce hidden classes.
- return {
- type: 'REMOVE_NODE',
- content: null,
- fromIndex: child._mountIndex,
- fromNode: node,
- toIndex: null,
- afterNode: null
- };
-}
-
-/**
- * Make an update for setting the markup of a node.
- *
- * @param {string} markup Markup that renders into an element.
- * @private
- */
-function makeSetMarkup(markup) {
- // NOTE: Null values reduce hidden classes.
- return {
- type: 'SET_MARKUP',
- content: markup,
- fromIndex: null,
- fromNode: null,
- toIndex: null,
- afterNode: null
- };
-}
-
-/**
- * Make an update for setting the text content.
- *
- * @param {string} textContent Text content to set.
- * @private
- */
-function makeTextContent(textContent) {
- // NOTE: Null values reduce hidden classes.
- return {
- type: 'TEXT_CONTENT',
- content: textContent,
- fromIndex: null,
- fromNode: null,
- toIndex: null,
- afterNode: null
- };
-}
-
-/**
- * Push an update, if any, onto the queue. Creates a new queue if none is
- * passed and always returns the queue. Mutative.
- */
-function enqueue(queue, update) {
- if (update) {
- queue = queue || [];
- queue.push(update);
- }
- return queue;
-}
-
-/**
- * Processes any enqueued updates.
- *
- * @private
- */
-function processQueue(inst, updateQueue) {
- ReactComponentEnvironment.processChildrenUpdates(inst, updateQueue);
-}
-
-var setChildrenForInstrumentation = emptyFunction;
-if (process.env.NODE_ENV !== 'production') {
- var getDebugID = function (inst) {
- if (!inst._debugID) {
- // Check for ART-like instances. TODO: This is silly/gross.
- var internal;
- if (internal = ReactInstanceMap.get(inst)) {
- inst = internal;
- }
- }
- return inst._debugID;
- };
- setChildrenForInstrumentation = function (children) {
- var debugID = getDebugID(this);
- // TODO: React Native empty components are also multichild.
- // This means they still get into this method but don't have _debugID.
- if (debugID !== 0) {
- ReactInstrumentation.debugTool.onSetChildren(debugID, children ? Object.keys(children).map(function (key) {
- return children[key]._debugID;
- }) : []);
- }
- };
-}
-
-/**
- * ReactMultiChild are capable of reconciling multiple children.
- *
- * @class ReactMultiChild
- * @internal
- */
-var ReactMultiChild = {
-
- /**
- * Provides common functionality for components that must reconcile multiple
- * children. This is used by `ReactDOMComponent` to mount, update, and
- * unmount child components.
- *
- * @lends {ReactMultiChild.prototype}
- */
- Mixin: {
-
- _reconcilerInstantiateChildren: function (nestedChildren, transaction, context) {
- if (process.env.NODE_ENV !== 'production') {
- var selfDebugID = getDebugID(this);
- if (this._currentElement) {
- try {
- ReactCurrentOwner.current = this._currentElement._owner;
- return ReactChildReconciler.instantiateChildren(nestedChildren, transaction, context, selfDebugID);
- } finally {
- ReactCurrentOwner.current = null;
- }
- }
- }
- return ReactChildReconciler.instantiateChildren(nestedChildren, transaction, context);
- },
-
- _reconcilerUpdateChildren: function (prevChildren, nextNestedChildrenElements, mountImages, removedNodes, transaction, context) {
- var nextChildren;
- var selfDebugID = 0;
- if (process.env.NODE_ENV !== 'production') {
- selfDebugID = getDebugID(this);
- if (this._currentElement) {
- try {
- ReactCurrentOwner.current = this._currentElement._owner;
- nextChildren = flattenChildren(nextNestedChildrenElements, selfDebugID);
- } finally {
- ReactCurrentOwner.current = null;
- }
- ReactChildReconciler.updateChildren(prevChildren, nextChildren, mountImages, removedNodes, transaction, this, this._hostContainerInfo, context, selfDebugID);
- return nextChildren;
- }
- }
- nextChildren = flattenChildren(nextNestedChildrenElements, selfDebugID);
- ReactChildReconciler.updateChildren(prevChildren, nextChildren, mountImages, removedNodes, transaction, this, this._hostContainerInfo, context, selfDebugID);
- return nextChildren;
- },
-
- /**
- * Generates a "mount image" for each of the supplied children. In the case
- * of `ReactDOMComponent`, a mount image is a string of markup.
- *
- * @param {?object} nestedChildren Nested child maps.
- * @return {array} An array of mounted representations.
- * @internal
- */
- mountChildren: function (nestedChildren, transaction, context) {
- var children = this._reconcilerInstantiateChildren(nestedChildren, transaction, context);
- this._renderedChildren = children;
-
- var mountImages = [];
- var index = 0;
- for (var name in children) {
- if (children.hasOwnProperty(name)) {
- var child = children[name];
- var selfDebugID = 0;
- if (process.env.NODE_ENV !== 'production') {
- selfDebugID = getDebugID(this);
- }
- var mountImage = ReactReconciler.mountComponent(child, transaction, this, this._hostContainerInfo, context, selfDebugID);
- child._mountIndex = index++;
- mountImages.push(mountImage);
- }
- }
-
- if (process.env.NODE_ENV !== 'production') {
- setChildrenForInstrumentation.call(this, children);
- }
-
- return mountImages;
- },
-
- /**
- * Replaces any rendered children with a text content string.
- *
- * @param {string} nextContent String of content.
- * @internal
- */
- updateTextContent: function (nextContent) {
- var prevChildren = this._renderedChildren;
- // Remove any rendered children.
- ReactChildReconciler.unmountChildren(prevChildren, false);
- for (var name in prevChildren) {
- if (prevChildren.hasOwnProperty(name)) {
- !false ? process.env.NODE_ENV !== 'production' ? invariant(false, 'updateTextContent called on non-empty component.') : _prodInvariant('118') : void 0;
- }
- }
- // Set new text content.
- var updates = [makeTextContent(nextContent)];
- processQueue(this, updates);
- },
-
- /**
- * Replaces any rendered children with a markup string.
- *
- * @param {string} nextMarkup String of markup.
- * @internal
- */
- updateMarkup: function (nextMarkup) {
- var prevChildren = this._renderedChildren;
- // Remove any rendered children.
- ReactChildReconciler.unmountChildren(prevChildren, false);
- for (var name in prevChildren) {
- if (prevChildren.hasOwnProperty(name)) {
- !false ? process.env.NODE_ENV !== 'production' ? invariant(false, 'updateTextContent called on non-empty component.') : _prodInvariant('118') : void 0;
- }
- }
- var updates = [makeSetMarkup(nextMarkup)];
- processQueue(this, updates);
- },
-
- /**
- * Updates the rendered children with new children.
- *
- * @param {?object} nextNestedChildrenElements Nested child element maps.
- * @param {ReactReconcileTransaction} transaction
- * @internal
- */
- updateChildren: function (nextNestedChildrenElements, transaction, context) {
- // Hook used by React ART
- this._updateChildren(nextNestedChildrenElements, transaction, context);
- },
-
- /**
- * @param {?object} nextNestedChildrenElements Nested child element maps.
- * @param {ReactReconcileTransaction} transaction
- * @final
- * @protected
- */
- _updateChildren: function (nextNestedChildrenElements, transaction, context) {
- var prevChildren = this._renderedChildren;
- var removedNodes = {};
- var mountImages = [];
- var nextChildren = this._reconcilerUpdateChildren(prevChildren, nextNestedChildrenElements, mountImages, removedNodes, transaction, context);
- if (!nextChildren && !prevChildren) {
- return;
- }
- var updates = null;
- var name;
- // `nextIndex` will increment for each child in `nextChildren`, but
- // `lastIndex` will be the last index visited in `prevChildren`.
- var nextIndex = 0;
- var lastIndex = 0;
- // `nextMountIndex` will increment for each newly mounted child.
- var nextMountIndex = 0;
- var lastPlacedNode = null;
- for (name in nextChildren) {
- if (!nextChildren.hasOwnProperty(name)) {
- continue;
- }
- var prevChild = prevChildren && prevChildren[name];
- var nextChild = nextChildren[name];
- if (prevChild === nextChild) {
- updates = enqueue(updates, this.moveChild(prevChild, lastPlacedNode, nextIndex, lastIndex));
- lastIndex = Math.max(prevChild._mountIndex, lastIndex);
- prevChild._mountIndex = nextIndex;
- } else {
- if (prevChild) {
- // Update `lastIndex` before `_mountIndex` gets unset by unmounting.
- lastIndex = Math.max(prevChild._mountIndex, lastIndex);
- // The `removedNodes` loop below will actually remove the child.
- }
- // The child must be instantiated before it's mounted.
- updates = enqueue(updates, this._mountChildAtIndex(nextChild, mountImages[nextMountIndex], lastPlacedNode, nextIndex, transaction, context));
- nextMountIndex++;
- }
- nextIndex++;
- lastPlacedNode = ReactReconciler.getHostNode(nextChild);
- }
- // Remove children that are no longer present.
- for (name in removedNodes) {
- if (removedNodes.hasOwnProperty(name)) {
- updates = enqueue(updates, this._unmountChild(prevChildren[name], removedNodes[name]));
- }
- }
- if (updates) {
- processQueue(this, updates);
- }
- this._renderedChildren = nextChildren;
-
- if (process.env.NODE_ENV !== 'production') {
- setChildrenForInstrumentation.call(this, nextChildren);
- }
- },
-
- /**
- * Unmounts all rendered children. This should be used to clean up children
- * when this component is unmounted. It does not actually perform any
- * backend operations.
- *
- * @internal
- */
- unmountChildren: function (safely) {
- var renderedChildren = this._renderedChildren;
- ReactChildReconciler.unmountChildren(renderedChildren, safely);
- this._renderedChildren = null;
- },
-
- /**
- * Moves a child component to the supplied index.
- *
- * @param {ReactComponent} child Component to move.
- * @param {number} toIndex Destination index of the element.
- * @param {number} lastIndex Last index visited of the siblings of `child`.
- * @protected
- */
- moveChild: function (child, afterNode, toIndex, lastIndex) {
- // If the index of `child` is less than `lastIndex`, then it needs to
- // be moved. Otherwise, we do not need to move it because a child will be
- // inserted or moved before `child`.
- if (child._mountIndex < lastIndex) {
- return makeMove(child, afterNode, toIndex);
- }
- },
-
- /**
- * Creates a child component.
- *
- * @param {ReactComponent} child Component to create.
- * @param {string} mountImage Markup to insert.
- * @protected
- */
- createChild: function (child, afterNode, mountImage) {
- return makeInsertMarkup(mountImage, afterNode, child._mountIndex);
- },
-
- /**
- * Removes a child component.
- *
- * @param {ReactComponent} child Child to remove.
- * @protected
- */
- removeChild: function (child, node) {
- return makeRemove(child, node);
- },
-
- /**
- * Mounts a child with the supplied name.
- *
- * NOTE: This is part of `updateChildren` and is here for readability.
- *
- * @param {ReactComponent} child Component to mount.
- * @param {string} name Name of the child.
- * @param {number} index Index at which to insert the child.
- * @param {ReactReconcileTransaction} transaction
- * @private
- */
- _mountChildAtIndex: function (child, mountImage, afterNode, index, transaction, context) {
- child._mountIndex = index;
- return this.createChild(child, afterNode, mountImage);
- },
-
- /**
- * Unmounts a rendered child.
- *
- * NOTE: This is part of `updateChildren` and is here for readability.
- *
- * @param {ReactComponent} child Component to unmount.
- * @private
- */
- _unmountChild: function (child, node) {
- var update = this.removeChild(child, node);
- child._mountIndex = null;
- return update;
- }
-
- }
-
-};
-
-module.exports = ReactMultiChild;
-}).call(this,require('_process'))
-
-},{"./ReactChildReconciler":73,"./ReactComponentEnvironment":75,"./ReactInstanceMap":108,"./ReactInstrumentation":109,"./ReactReconciler":119,"./flattenChildren":151,"./reactProdInvariant":167,"_process":43,"fbjs/lib/emptyFunction":10,"fbjs/lib/invariant":18,"react/lib/ReactCurrentOwner":195}],114:[function(require,module,exports){
-(function (process){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- *
- */
-
-'use strict';
-
-var _prodInvariant = require('./reactProdInvariant');
-
-var React = require('react/lib/React');
-
-var invariant = require('fbjs/lib/invariant');
-
-var ReactNodeTypes = {
- HOST: 0,
- COMPOSITE: 1,
- EMPTY: 2,
-
- getType: function (node) {
- if (node === null || node === false) {
- return ReactNodeTypes.EMPTY;
- } else if (React.isValidElement(node)) {
- if (typeof node.type === 'function') {
- return ReactNodeTypes.COMPOSITE;
- } else {
- return ReactNodeTypes.HOST;
- }
- }
- !false ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unexpected node: %s', node) : _prodInvariant('26', node) : void 0;
- }
-};
-
-module.exports = ReactNodeTypes;
-}).call(this,require('_process'))
-
-},{"./reactProdInvariant":167,"_process":43,"fbjs/lib/invariant":18,"react/lib/React":190}],115:[function(require,module,exports){
-(function (process){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- *
- */
+module.exports=require("./lib/index");
-'use strict';
-
-var _prodInvariant = require('./reactProdInvariant');
-
-var invariant = require('fbjs/lib/invariant');
-
-/**
- * @param {?object} object
- * @return {boolean} True if `object` is a valid owner.
- * @final
- */
-function isValidOwner(object) {
- return !!(object && typeof object.attachRef === 'function' && typeof object.detachRef === 'function');
-}
-
-/**
- * ReactOwners are capable of storing references to owned components.
- *
- * All components are capable of //being// referenced by owner components, but
- * only ReactOwner components are capable of //referencing// owned components.
- * The named reference is known as a "ref".
- *
- * Refs are available when mounted and updated during reconciliation.
- *
- * var MyComponent = React.createClass({
- * render: function() {
- * return (
- * <div onClick={this.handleClick}>
- * <CustomComponent ref="custom" />
- * </div>
- * );
- * },
- * handleClick: function() {
- * this.refs.custom.handleClick();
- * },
- * componentDidMount: function() {
- * this.refs.custom.initialize();
- * }
- * });
- *
- * Refs should rarely be used. When refs are used, they should only be done to
- * control data that is not handled by React's data flow.
- *
- * @class ReactOwner
- */
-var ReactOwner = {
- /**
- * Adds a component by ref to an owner component.
- *
- * @param {ReactComponent} component Component to reference.
- * @param {string} ref Name by which to refer to the component.
- * @param {ReactOwner} owner Component on which to record the ref.
- * @final
- * @internal
- */
- addComponentAsRefTo: function (component, ref, owner) {
- !isValidOwner(owner) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'addComponentAsRefTo(...): Only a ReactOwner can have refs. You might be adding a ref to a component that was not created inside a component\'s `render` method, or you have multiple copies of React loaded (details: https://fb.me/react-refs-must-have-owner).') : _prodInvariant('119') : void 0;
- owner.attachRef(ref, component);
- },
-
- /**
- * Removes a component by ref from an owner component.
- *
- * @param {ReactComponent} component Component to dereference.
- * @param {string} ref Name of the ref to remove.
- * @param {ReactOwner} owner Component on which the ref is recorded.
- * @final
- * @internal
- */
- removeComponentAsRefFrom: function (component, ref, owner) {
- !isValidOwner(owner) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'removeComponentAsRefFrom(...): Only a ReactOwner can have refs. You might be removing a ref to a component that was not created inside a component\'s `render` method, or you have multiple copies of React loaded (details: https://fb.me/react-refs-must-have-owner).') : _prodInvariant('120') : void 0;
- var ownerPublicInstance = owner.getPublicInstance();
- // Check that `component`'s owner is still alive and that `component` is still the current ref
- // because we do not want to detach the ref if another component stole it.
- if (ownerPublicInstance && ownerPublicInstance.refs[ref] === component.getPublicInstance()) {
- owner.detachRef(ref);
- }
- }
-
-};
-
-module.exports = ReactOwner;
-}).call(this,require('_process'))
-
-},{"./reactProdInvariant":167,"_process":43,"fbjs/lib/invariant":18}],116:[function(require,module,exports){
-(function (process){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- *
- */
-
-'use strict';
-
-var ReactPropTypeLocationNames = {};
-
-if (process.env.NODE_ENV !== 'production') {
- ReactPropTypeLocationNames = {
- prop: 'prop',
- context: 'context',
- childContext: 'child context'
- };
-}
-
-module.exports = ReactPropTypeLocationNames;
-}).call(this,require('_process'))
-
-},{"_process":43}],117:[function(require,module,exports){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- *
- */
-
-'use strict';
-
-var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
-
-module.exports = ReactPropTypesSecret;
-},{}],118:[function(require,module,exports){
-(function (process){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-'use strict';
-
-var _assign = require('object-assign');
-
-var CallbackQueue = require('./CallbackQueue');
-var PooledClass = require('./PooledClass');
-var ReactBrowserEventEmitter = require('./ReactBrowserEventEmitter');
-var ReactInputSelection = require('./ReactInputSelection');
-var ReactInstrumentation = require('./ReactInstrumentation');
-var Transaction = require('./Transaction');
-var ReactUpdateQueue = require('./ReactUpdateQueue');
-
-/**
- * Ensures that, when possible, the selection range (currently selected text
- * input) is not disturbed by performing the transaction.
- */
-var SELECTION_RESTORATION = {
- /**
- * @return {Selection} Selection information.
- */
- initialize: ReactInputSelection.getSelectionInformation,
- /**
- * @param {Selection} sel Selection information returned from `initialize`.
- */
- close: ReactInputSelection.restoreSelection
-};
-
-/**
- * Suppresses events (blur/focus) that could be inadvertently dispatched due to
- * high level DOM manipulations (like temporarily removing a text input from the
- * DOM).
- */
-var EVENT_SUPPRESSION = {
- /**
- * @return {boolean} The enabled status of `ReactBrowserEventEmitter` before
- * the reconciliation.
- */
- initialize: function () {
- var currentlyEnabled = ReactBrowserEventEmitter.isEnabled();
- ReactBrowserEventEmitter.setEnabled(false);
- return currentlyEnabled;
- },
-
- /**
- * @param {boolean} previouslyEnabled Enabled status of
- * `ReactBrowserEventEmitter` before the reconciliation occurred. `close`
- * restores the previous value.
- */
- close: function (previouslyEnabled) {
- ReactBrowserEventEmitter.setEnabled(previouslyEnabled);
- }
-};
-
-/**
- * Provides a queue for collecting `componentDidMount` and
- * `componentDidUpdate` callbacks during the transaction.
- */
-var ON_DOM_READY_QUEUEING = {
- /**
- * Initializes the internal `onDOMReady` queue.
- */
- initialize: function () {
- this.reactMountReady.reset();
- },
-
- /**
- * After DOM is flushed, invoke all registered `onDOMReady` callbacks.
- */
- close: function () {
- this.reactMountReady.notifyAll();
- }
-};
-
-/**
- * Executed within the scope of the `Transaction` instance. Consider these as
- * being member methods, but with an implied ordering while being isolated from
- * each other.
- */
-var TRANSACTION_WRAPPERS = [SELECTION_RESTORATION, EVENT_SUPPRESSION, ON_DOM_READY_QUEUEING];
-
-if (process.env.NODE_ENV !== 'production') {
- TRANSACTION_WRAPPERS.push({
- initialize: ReactInstrumentation.debugTool.onBeginFlush,
- close: ReactInstrumentation.debugTool.onEndFlush
- });
-}
-
-/**
- * Currently:
- * - The order that these are listed in the transaction is critical:
- * - Suppresses events.
- * - Restores selection range.
- *
- * Future:
- * - Restore document/overflow scroll positions that were unintentionally
- * modified via DOM insertions above the top viewport boundary.
- * - Implement/integrate with customized constraint based layout system and keep
- * track of which dimensions must be remeasured.
- *
- * @class ReactReconcileTransaction
- */
-function ReactReconcileTransaction(useCreateElement) {
- this.reinitializeTransaction();
- // Only server-side rendering really needs this option (see
- // `ReactServerRendering`), but server-side uses
- // `ReactServerRenderingTransaction` instead. This option is here so that it's
- // accessible and defaults to false when `ReactDOMComponent` and
- // `ReactDOMTextComponent` checks it in `mountComponent`.`
- this.renderToStaticMarkup = false;
- this.reactMountReady = CallbackQueue.getPooled(null);
- this.useCreateElement = useCreateElement;
-}
-
-var Mixin = {
- /**
- * @see Transaction
- * @abstract
- * @final
- * @return {array<object>} List of operation wrap procedures.
- * TODO: convert to array<TransactionWrapper>
- */
- getTransactionWrappers: function () {
- return TRANSACTION_WRAPPERS;
- },
-
- /**
- * @return {object} The queue to collect `onDOMReady` callbacks with.
- */
- getReactMountReady: function () {
- return this.reactMountReady;
- },
-
- /**
- * @return {object} The queue to collect React async events.
- */
- getUpdateQueue: function () {
- return ReactUpdateQueue;
- },
-
- /**
- * Save current transaction state -- if the return value from this method is
- * passed to `rollback`, the transaction will be reset to that state.
- */
- checkpoint: function () {
- // reactMountReady is the our only stateful wrapper
- return this.reactMountReady.checkpoint();
- },
-
- rollback: function (checkpoint) {
- this.reactMountReady.rollback(checkpoint);
- },
-
- /**
- * `PooledClass` looks for this, and will invoke this before allowing this
- * instance to be reused.
- */
- destructor: function () {
- CallbackQueue.release(this.reactMountReady);
- this.reactMountReady = null;
- }
-};
-
-_assign(ReactReconcileTransaction.prototype, Transaction, Mixin);
-
-PooledClass.addPoolingTo(ReactReconcileTransaction);
-
-module.exports = ReactReconcileTransaction;
-}).call(this,require('_process'))
-
-},{"./CallbackQueue":53,"./PooledClass":71,"./ReactBrowserEventEmitter":72,"./ReactInputSelection":107,"./ReactInstrumentation":109,"./ReactUpdateQueue":123,"./Transaction":142,"_process":43,"object-assign":42}],119:[function(require,module,exports){
-(function (process){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-'use strict';
-
-var ReactRef = require('./ReactRef');
-var ReactInstrumentation = require('./ReactInstrumentation');
-
-var warning = require('fbjs/lib/warning');
-
-/**
- * Helper to call ReactRef.attachRefs with this composite component, split out
- * to avoid allocations in the transaction mount-ready queue.
- */
-function attachRefs() {
- ReactRef.attachRefs(this, this._currentElement);
-}
-
-var ReactReconciler = {
-
- /**
- * Initializes the component, renders markup, and registers event listeners.
- *
- * @param {ReactComponent} internalInstance
- * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
- * @param {?object} the containing host component instance
- * @param {?object} info about the host container
- * @return {?string} Rendered markup to be inserted into the DOM.
- * @final
- * @internal
- */
- mountComponent: function (internalInstance, transaction, hostParent, hostContainerInfo, context, parentDebugID // 0 in production and for roots
- ) {
- if (process.env.NODE_ENV !== 'production') {
- if (internalInstance._debugID !== 0) {
- ReactInstrumentation.debugTool.onBeforeMountComponent(internalInstance._debugID, internalInstance._currentElement, parentDebugID);
- }
- }
- var markup = internalInstance.mountComponent(transaction, hostParent, hostContainerInfo, context, parentDebugID);
- if (internalInstance._currentElement && internalInstance._currentElement.ref != null) {
- transaction.getReactMountReady().enqueue(attachRefs, internalInstance);
- }
- if (process.env.NODE_ENV !== 'production') {
- if (internalInstance._debugID !== 0) {
- ReactInstrumentation.debugTool.onMountComponent(internalInstance._debugID);
- }
- }
- return markup;
- },
-
- /**
- * Returns a value that can be passed to
- * ReactComponentEnvironment.replaceNodeWithMarkup.
- */
- getHostNode: function (internalInstance) {
- return internalInstance.getHostNode();
- },
-
- /**
- * Releases any resources allocated by `mountComponent`.
- *
- * @final
- * @internal
- */
- unmountComponent: function (internalInstance, safely) {
- if (process.env.NODE_ENV !== 'production') {
- if (internalInstance._debugID !== 0) {
- ReactInstrumentation.debugTool.onBeforeUnmountComponent(internalInstance._debugID);
- }
- }
- ReactRef.detachRefs(internalInstance, internalInstance._currentElement);
- internalInstance.unmountComponent(safely);
- if (process.env.NODE_ENV !== 'production') {
- if (internalInstance._debugID !== 0) {
- ReactInstrumentation.debugTool.onUnmountComponent(internalInstance._debugID);
- }
- }
- },
-
- /**
- * Update a component using a new element.
- *
- * @param {ReactComponent} internalInstance
- * @param {ReactElement} nextElement
- * @param {ReactReconcileTransaction} transaction
- * @param {object} context
- * @internal
- */
- receiveComponent: function (internalInstance, nextElement, transaction, context) {
- var prevElement = internalInstance._currentElement;
-
- if (nextElement === prevElement && context === internalInstance._context) {
- // Since elements are immutable after the owner is rendered,
- // we can do a cheap identity compare here to determine if this is a
- // superfluous reconcile. It's possible for state to be mutable but such
- // change should trigger an update of the owner which would recreate
- // the element. We explicitly check for the existence of an owner since
- // it's possible for an element created outside a composite to be
- // deeply mutated and reused.
-
- // TODO: Bailing out early is just a perf optimization right?
- // TODO: Removing the return statement should affect correctness?
- return;
- }
-
- if (process.env.NODE_ENV !== 'production') {
- if (internalInstance._debugID !== 0) {
- ReactInstrumentation.debugTool.onBeforeUpdateComponent(internalInstance._debugID, nextElement);
- }
- }
-
- var refsChanged = ReactRef.shouldUpdateRefs(prevElement, nextElement);
-
- if (refsChanged) {
- ReactRef.detachRefs(internalInstance, prevElement);
- }
-
- internalInstance.receiveComponent(nextElement, transaction, context);
-
- if (refsChanged && internalInstance._currentElement && internalInstance._currentElement.ref != null) {
- transaction.getReactMountReady().enqueue(attachRefs, internalInstance);
- }
-
- if (process.env.NODE_ENV !== 'production') {
- if (internalInstance._debugID !== 0) {
- ReactInstrumentation.debugTool.onUpdateComponent(internalInstance._debugID);
- }
- }
- },
-
- /**
- * Flush any dirty changes in a component.
- *
- * @param {ReactComponent} internalInstance
- * @param {ReactReconcileTransaction} transaction
- * @internal
- */
- performUpdateIfNecessary: function (internalInstance, transaction, updateBatchNumber) {
- if (internalInstance._updateBatchNumber !== updateBatchNumber) {
- // The component's enqueued batch number should always be the current
- // batch or the following one.
- process.env.NODE_ENV !== 'production' ? warning(internalInstance._updateBatchNumber == null || internalInstance._updateBatchNumber === updateBatchNumber + 1, 'performUpdateIfNecessary: Unexpected batch number (current %s, ' + 'pending %s)', updateBatchNumber, internalInstance._updateBatchNumber) : void 0;
- return;
- }
- if (process.env.NODE_ENV !== 'production') {
- if (internalInstance._debugID !== 0) {
- ReactInstrumentation.debugTool.onBeforeUpdateComponent(internalInstance._debugID, internalInstance._currentElement);
- }
- }
- internalInstance.performUpdateIfNecessary(transaction);
- if (process.env.NODE_ENV !== 'production') {
- if (internalInstance._debugID !== 0) {
- ReactInstrumentation.debugTool.onUpdateComponent(internalInstance._debugID);
- }
- }
- }
-
-};
-
-module.exports = ReactReconciler;
-}).call(this,require('_process'))
-
-},{"./ReactInstrumentation":109,"./ReactRef":120,"_process":43,"fbjs/lib/warning":25}],120:[function(require,module,exports){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- *
- */
-
-'use strict';
-
-var ReactOwner = require('./ReactOwner');
-
-var ReactRef = {};
-
-function attachRef(ref, component, owner) {
- if (typeof ref === 'function') {
- ref(component.getPublicInstance());
- } else {
- // Legacy ref
- ReactOwner.addComponentAsRefTo(component, ref, owner);
- }
-}
-
-function detachRef(ref, component, owner) {
- if (typeof ref === 'function') {
- ref(null);
- } else {
- // Legacy ref
- ReactOwner.removeComponentAsRefFrom(component, ref, owner);
- }
-}
-
-ReactRef.attachRefs = function (instance, element) {
- if (element === null || typeof element !== 'object') {
- return;
- }
- var ref = element.ref;
- if (ref != null) {
- attachRef(ref, instance, element._owner);
- }
-};
-
-ReactRef.shouldUpdateRefs = function (prevElement, nextElement) {
- // If either the owner or a `ref` has changed, make sure the newest owner
- // has stored a reference to `this`, and the previous owner (if different)
- // has forgotten the reference to `this`. We use the element instead
- // of the public this.props because the post processing cannot determine
- // a ref. The ref conceptually lives on the element.
-
- // TODO: Should this even be possible? The owner cannot change because
- // it's forbidden by shouldUpdateReactComponent. The ref can change
- // if you swap the keys of but not the refs. Reconsider where this check
- // is made. It probably belongs where the key checking and
- // instantiateReactComponent is done.
-
- var prevRef = null;
- var prevOwner = null;
- if (prevElement !== null && typeof prevElement === 'object') {
- prevRef = prevElement.ref;
- prevOwner = prevElement._owner;
- }
-
- var nextRef = null;
- var nextOwner = null;
- if (nextElement !== null && typeof nextElement === 'object') {
- nextRef = nextElement.ref;
- nextOwner = nextElement._owner;
- }
-
- return prevRef !== nextRef ||
- // If owner changes but we have an unchanged function ref, don't update refs
- typeof nextRef === 'string' && nextOwner !== prevOwner;
-};
-
-ReactRef.detachRefs = function (instance, element) {
- if (element === null || typeof element !== 'object') {
- return;
- }
- var ref = element.ref;
- if (ref != null) {
- detachRef(ref, instance, element._owner);
- }
-};
-
-module.exports = ReactRef;
-},{"./ReactOwner":115}],121:[function(require,module,exports){
-(function (process){
-/**
- * Copyright 2014-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-'use strict';
-
-var _assign = require('object-assign');
-
-var PooledClass = require('./PooledClass');
-var Transaction = require('./Transaction');
-var ReactInstrumentation = require('./ReactInstrumentation');
-var ReactServerUpdateQueue = require('./ReactServerUpdateQueue');
-
-/**
- * Executed within the scope of the `Transaction` instance. Consider these as
- * being member methods, but with an implied ordering while being isolated from
- * each other.
- */
-var TRANSACTION_WRAPPERS = [];
-
-if (process.env.NODE_ENV !== 'production') {
- TRANSACTION_WRAPPERS.push({
- initialize: ReactInstrumentation.debugTool.onBeginFlush,
- close: ReactInstrumentation.debugTool.onEndFlush
- });
-}
-
-var noopCallbackQueue = {
- enqueue: function () {}
-};
-
-/**
- * @class ReactServerRenderingTransaction
- * @param {boolean} renderToStaticMarkup
- */
-function ReactServerRenderingTransaction(renderToStaticMarkup) {
- this.reinitializeTransaction();
- this.renderToStaticMarkup = renderToStaticMarkup;
- this.useCreateElement = false;
- this.updateQueue = new ReactServerUpdateQueue(this);
-}
-
-var Mixin = {
- /**
- * @see Transaction
- * @abstract
- * @final
- * @return {array} Empty list of operation wrap procedures.
- */
- getTransactionWrappers: function () {
- return TRANSACTION_WRAPPERS;
- },
-
- /**
- * @return {object} The queue to collect `onDOMReady` callbacks with.
- */
- getReactMountReady: function () {
- return noopCallbackQueue;
- },
-
- /**
- * @return {object} The queue to collect React async events.
- */
- getUpdateQueue: function () {
- return this.updateQueue;
- },
-
- /**
- * `PooledClass` looks for this, and will invoke this before allowing this
- * instance to be reused.
- */
- destructor: function () {},
-
- checkpoint: function () {},
-
- rollback: function () {}
-};
-
-_assign(ReactServerRenderingTransaction.prototype, Transaction, Mixin);
-
-PooledClass.addPoolingTo(ReactServerRenderingTransaction);
-
-module.exports = ReactServerRenderingTransaction;
-}).call(this,require('_process'))
-
-},{"./PooledClass":71,"./ReactInstrumentation":109,"./ReactServerUpdateQueue":122,"./Transaction":142,"_process":43,"object-assign":42}],122:[function(require,module,exports){
-(function (process){
-/**
- * Copyright 2015-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- *
- */
-
-'use strict';
-
-function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
-var ReactUpdateQueue = require('./ReactUpdateQueue');
-
-var warning = require('fbjs/lib/warning');
-
-function warnNoop(publicInstance, callerName) {
- if (process.env.NODE_ENV !== 'production') {
- var constructor = publicInstance.constructor;
- process.env.NODE_ENV !== 'production' ? warning(false, '%s(...): Can only update a mounting component. ' + 'This usually means you called %s() outside componentWillMount() on the server. ' + 'This is a no-op. Please check the code for the %s component.', callerName, callerName, constructor && (constructor.displayName || constructor.name) || 'ReactClass') : void 0;
- }
-}
-
-/**
- * This is the update queue used for server rendering.
- * It delegates to ReactUpdateQueue while server rendering is in progress and
- * switches to ReactNoopUpdateQueue after the transaction has completed.
- * @class ReactServerUpdateQueue
- * @param {Transaction} transaction
- */
-
-var ReactServerUpdateQueue = function () {
- function ReactServerUpdateQueue(transaction) {
- _classCallCheck(this, ReactServerUpdateQueue);
-
- this.transaction = transaction;
- }
-
- /**
- * Checks whether or not this composite component is mounted.
- * @param {ReactClass} publicInstance The instance we want to test.
- * @return {boolean} True if mounted, false otherwise.
- * @protected
- * @final
- */
-
-
- ReactServerUpdateQueue.prototype.isMounted = function isMounted(publicInstance) {
- return false;
- };
-
- /**
- * Enqueue a callback that will be executed after all the pending updates
- * have processed.
- *
- * @param {ReactClass} publicInstance The instance to use as `this` context.
- * @param {?function} callback Called after state is updated.
- * @internal
- */
-
-
- ReactServerUpdateQueue.prototype.enqueueCallback = function enqueueCallback(publicInstance, callback, callerName) {
- if (this.transaction.isInTransaction()) {
- ReactUpdateQueue.enqueueCallback(publicInstance, callback, callerName);
- }
- };
-
- /**
- * Forces an update. This should only be invoked when it is known with
- * certainty that we are **not** in a DOM transaction.
- *
- * You may want to call this when you know that some deeper aspect of the
- * component's state has changed but `setState` was not called.
- *
- * This will not invoke `shouldComponentUpdate`, but it will invoke
- * `componentWillUpdate` and `componentDidUpdate`.
- *
- * @param {ReactClass} publicInstance The instance that should rerender.
- * @internal
- */
-
-
- ReactServerUpdateQueue.prototype.enqueueForceUpdate = function enqueueForceUpdate(publicInstance) {
- if (this.transaction.isInTransaction()) {
- ReactUpdateQueue.enqueueForceUpdate(publicInstance);
- } else {
- warnNoop(publicInstance, 'forceUpdate');
- }
- };
-
- /**
- * Replaces all of the state. Always use this or `setState` to mutate state.
- * You should treat `this.state` as immutable.
- *
- * There is no guarantee that `this.state` will be immediately updated, so
- * accessing `this.state` after calling this method may return the old value.
- *
- * @param {ReactClass} publicInstance The instance that should rerender.
- * @param {object|function} completeState Next state.
- * @internal
- */
-
-
- ReactServerUpdateQueue.prototype.enqueueReplaceState = function enqueueReplaceState(publicInstance, completeState) {
- if (this.transaction.isInTransaction()) {
- ReactUpdateQueue.enqueueReplaceState(publicInstance, completeState);
- } else {
- warnNoop(publicInstance, 'replaceState');
- }
- };
-
- /**
- * Sets a subset of the state. This only exists because _pendingState is
- * internal. This provides a merging strategy that is not available to deep
- * properties which is confusing. TODO: Expose pendingState or don't use it
- * during the merge.
- *
- * @param {ReactClass} publicInstance The instance that should rerender.
- * @param {object|function} partialState Next partial state to be merged with state.
- * @internal
- */
-
-
- ReactServerUpdateQueue.prototype.enqueueSetState = function enqueueSetState(publicInstance, partialState) {
- if (this.transaction.isInTransaction()) {
- ReactUpdateQueue.enqueueSetState(publicInstance, partialState);
- } else {
- warnNoop(publicInstance, 'setState');
- }
- };
-
- return ReactServerUpdateQueue;
-}();
-
-module.exports = ReactServerUpdateQueue;
-}).call(this,require('_process'))
-
-},{"./ReactUpdateQueue":123,"_process":43,"fbjs/lib/warning":25}],123:[function(require,module,exports){
-(function (process){
-/**
- * Copyright 2015-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-'use strict';
-
-var _prodInvariant = require('./reactProdInvariant');
-
-var ReactCurrentOwner = require('react/lib/ReactCurrentOwner');
-var ReactInstanceMap = require('./ReactInstanceMap');
-var ReactInstrumentation = require('./ReactInstrumentation');
-var ReactUpdates = require('./ReactUpdates');
-
-var invariant = require('fbjs/lib/invariant');
-var warning = require('fbjs/lib/warning');
-
-function enqueueUpdate(internalInstance) {
- ReactUpdates.enqueueUpdate(internalInstance);
-}
-
-function formatUnexpectedArgument(arg) {
- var type = typeof arg;
- if (type !== 'object') {
- return type;
- }
- var displayName = arg.constructor && arg.constructor.name || type;
- var keys = Object.keys(arg);
- if (keys.length > 0 && keys.length < 20) {
- return displayName + ' (keys: ' + keys.join(', ') + ')';
- }
- return displayName;
-}
-
-function getInternalInstanceReadyForUpdate(publicInstance, callerName) {
- var internalInstance = ReactInstanceMap.get(publicInstance);
- if (!internalInstance) {
- if (process.env.NODE_ENV !== 'production') {
- var ctor = publicInstance.constructor;
- // Only warn when we have a callerName. Otherwise we should be silent.
- // We're probably calling from enqueueCallback. We don't want to warn
- // there because we already warned for the corresponding lifecycle method.
- process.env.NODE_ENV !== 'production' ? warning(!callerName, '%s(...): Can only update a mounted or mounting component. ' + 'This usually means you called %s() on an unmounted component. ' + 'This is a no-op. Please check the code for the %s component.', callerName, callerName, ctor && (ctor.displayName || ctor.name) || 'ReactClass') : void 0;
- }
- return null;
- }
-
- if (process.env.NODE_ENV !== 'production') {
- process.env.NODE_ENV !== 'production' ? warning(ReactCurrentOwner.current == null, '%s(...): Cannot update during an existing state transition (such as ' + 'within `render` or another component\'s constructor). Render methods ' + 'should be a pure function of props and state; constructor ' + 'side-effects are an anti-pattern, but can be moved to ' + '`componentWillMount`.', callerName) : void 0;
- }
-
- return internalInstance;
-}
-
-/**
- * ReactUpdateQueue allows for state updates to be scheduled into a later
- * reconciliation step.
- */
-var ReactUpdateQueue = {
-
- /**
- * Checks whether or not this composite component is mounted.
- * @param {ReactClass} publicInstance The instance we want to test.
- * @return {boolean} True if mounted, false otherwise.
- * @protected
- * @final
- */
- isMounted: function (publicInstance) {
- if (process.env.NODE_ENV !== 'production') {
- var owner = ReactCurrentOwner.current;
- if (owner !== null) {
- process.env.NODE_ENV !== 'production' ? warning(owner._warnedAboutRefsInRender, '%s is accessing isMounted inside its render() function. ' + 'render() should be a pure function of props and state. It should ' + 'never access something that requires stale data from the previous ' + 'render, such as refs. Move this logic to componentDidMount and ' + 'componentDidUpdate instead.', owner.getName() || 'A component') : void 0;
- owner._warnedAboutRefsInRender = true;
- }
- }
- var internalInstance = ReactInstanceMap.get(publicInstance);
- if (internalInstance) {
- // During componentWillMount and render this will still be null but after
- // that will always render to something. At least for now. So we can use
- // this hack.
- return !!internalInstance._renderedComponent;
- } else {
- return false;
- }
- },
-
- /**
- * Enqueue a callback that will be executed after all the pending updates
- * have processed.
- *
- * @param {ReactClass} publicInstance The instance to use as `this` context.
- * @param {?function} callback Called after state is updated.
- * @param {string} callerName Name of the calling function in the public API.
- * @internal
- */
- enqueueCallback: function (publicInstance, callback, callerName) {
- ReactUpdateQueue.validateCallback(callback, callerName);
- var internalInstance = getInternalInstanceReadyForUpdate(publicInstance);
-
- // Previously we would throw an error if we didn't have an internal
- // instance. Since we want to make it a no-op instead, we mirror the same
- // behavior we have in other enqueue* methods.
- // We also need to ignore callbacks in componentWillMount. See
- // enqueueUpdates.
- if (!internalInstance) {
- return null;
- }
-
- if (internalInstance._pendingCallbacks) {
- internalInstance._pendingCallbacks.push(callback);
- } else {
- internalInstance._pendingCallbacks = [callback];
- }
- // TODO: The callback here is ignored when setState is called from
- // componentWillMount. Either fix it or disallow doing so completely in
- // favor of getInitialState. Alternatively, we can disallow
- // componentWillMount during server-side rendering.
- enqueueUpdate(internalInstance);
- },
-
- enqueueCallbackInternal: function (internalInstance, callback) {
- if (internalInstance._pendingCallbacks) {
- internalInstance._pendingCallbacks.push(callback);
- } else {
- internalInstance._pendingCallbacks = [callback];
- }
- enqueueUpdate(internalInstance);
- },
-
- /**
- * Forces an update. This should only be invoked when it is known with
- * certainty that we are **not** in a DOM transaction.
- *
- * You may want to call this when you know that some deeper aspect of the
- * component's state has changed but `setState` was not called.
- *
- * This will not invoke `shouldComponentUpdate`, but it will invoke
- * `componentWillUpdate` and `componentDidUpdate`.
- *
- * @param {ReactClass} publicInstance The instance that should rerender.
- * @internal
- */
- enqueueForceUpdate: function (publicInstance) {
- var internalInstance = getInternalInstanceReadyForUpdate(publicInstance, 'forceUpdate');
-
- if (!internalInstance) {
- return;
- }
-
- internalInstance._pendingForceUpdate = true;
-
- enqueueUpdate(internalInstance);
- },
-
- /**
- * Replaces all of the state. Always use this or `setState` to mutate state.
- * You should treat `this.state` as immutable.
- *
- * There is no guarantee that `this.state` will be immediately updated, so
- * accessing `this.state` after calling this method may return the old value.
- *
- * @param {ReactClass} publicInstance The instance that should rerender.
- * @param {object} completeState Next state.
- * @internal
- */
- enqueueReplaceState: function (publicInstance, completeState) {
- var internalInstance = getInternalInstanceReadyForUpdate(publicInstance, 'replaceState');
-
- if (!internalInstance) {
- return;
- }
-
- internalInstance._pendingStateQueue = [completeState];
- internalInstance._pendingReplaceState = true;
-
- enqueueUpdate(internalInstance);
- },
-
- /**
- * Sets a subset of the state. This only exists because _pendingState is
- * internal. This provides a merging strategy that is not available to deep
- * properties which is confusing. TODO: Expose pendingState or don't use it
- * during the merge.
- *
- * @param {ReactClass} publicInstance The instance that should rerender.
- * @param {object} partialState Next partial state to be merged with state.
- * @internal
- */
- enqueueSetState: function (publicInstance, partialState) {
- if (process.env.NODE_ENV !== 'production') {
- ReactInstrumentation.debugTool.onSetState();
- process.env.NODE_ENV !== 'production' ? warning(partialState != null, 'setState(...): You passed an undefined or null state object; ' + 'instead, use forceUpdate().') : void 0;
- }
-
- var internalInstance = getInternalInstanceReadyForUpdate(publicInstance, 'setState');
-
- if (!internalInstance) {
- return;
- }
-
- var queue = internalInstance._pendingStateQueue || (internalInstance._pendingStateQueue = []);
- queue.push(partialState);
-
- enqueueUpdate(internalInstance);
- },
-
- enqueueElementInternal: function (internalInstance, nextElement, nextContext) {
- internalInstance._pendingElement = nextElement;
- // TODO: introduce _pendingContext instead of setting it directly.
- internalInstance._context = nextContext;
- enqueueUpdate(internalInstance);
- },
-
- validateCallback: function (callback, callerName) {
- !(!callback || typeof callback === 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s(...): Expected the last optional `callback` argument to be a function. Instead received: %s.', callerName, formatUnexpectedArgument(callback)) : _prodInvariant('122', callerName, formatUnexpectedArgument(callback)) : void 0;
- }
-
-};
-
-module.exports = ReactUpdateQueue;
-}).call(this,require('_process'))
-
-},{"./ReactInstanceMap":108,"./ReactInstrumentation":109,"./ReactUpdates":124,"./reactProdInvariant":167,"_process":43,"fbjs/lib/invariant":18,"fbjs/lib/warning":25,"react/lib/ReactCurrentOwner":195}],124:[function(require,module,exports){
-(function (process){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-'use strict';
-
-var _prodInvariant = require('./reactProdInvariant'),
- _assign = require('object-assign');
-
-var CallbackQueue = require('./CallbackQueue');
-var PooledClass = require('./PooledClass');
-var ReactFeatureFlags = require('./ReactFeatureFlags');
-var ReactReconciler = require('./ReactReconciler');
-var Transaction = require('./Transaction');
-
-var invariant = require('fbjs/lib/invariant');
-
-var dirtyComponents = [];
-var updateBatchNumber = 0;
-var asapCallbackQueue = CallbackQueue.getPooled();
-var asapEnqueued = false;
-
-var batchingStrategy = null;
-
-function ensureInjected() {
- !(ReactUpdates.ReactReconcileTransaction && batchingStrategy) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates: must inject a reconcile transaction class and batching strategy') : _prodInvariant('123') : void 0;
-}
-
-var NESTED_UPDATES = {
- initialize: function () {
- this.dirtyComponentsLength = dirtyComponents.length;
- },
- close: function () {
- if (this.dirtyComponentsLength !== dirtyComponents.length) {
- // Additional updates were enqueued by componentDidUpdate handlers or
- // similar; before our own UPDATE_QUEUEING wrapper closes, we want to run
- // these new updates so that if A's componentDidUpdate calls setState on
- // B, B will update before the callback A's updater provided when calling
- // setState.
- dirtyComponents.splice(0, this.dirtyComponentsLength);
- flushBatchedUpdates();
- } else {
- dirtyComponents.length = 0;
- }
- }
-};
-
-var UPDATE_QUEUEING = {
- initialize: function () {
- this.callbackQueue.reset();
- },
- close: function () {
- this.callbackQueue.notifyAll();
- }
-};
-
-var TRANSACTION_WRAPPERS = [NESTED_UPDATES, UPDATE_QUEUEING];
-
-function ReactUpdatesFlushTransaction() {
- this.reinitializeTransaction();
- this.dirtyComponentsLength = null;
- this.callbackQueue = CallbackQueue.getPooled();
- this.reconcileTransaction = ReactUpdates.ReactReconcileTransaction.getPooled(
- /* useCreateElement */true);
-}
-
-_assign(ReactUpdatesFlushTransaction.prototype, Transaction, {
- getTransactionWrappers: function () {
- return TRANSACTION_WRAPPERS;
- },
-
- destructor: function () {
- this.dirtyComponentsLength = null;
- CallbackQueue.release(this.callbackQueue);
- this.callbackQueue = null;
- ReactUpdates.ReactReconcileTransaction.release(this.reconcileTransaction);
- this.reconcileTransaction = null;
- },
-
- perform: function (method, scope, a) {
- // Essentially calls `this.reconcileTransaction.perform(method, scope, a)`
- // with this transaction's wrappers around it.
- return Transaction.perform.call(this, this.reconcileTransaction.perform, this.reconcileTransaction, method, scope, a);
- }
-});
-
-PooledClass.addPoolingTo(ReactUpdatesFlushTransaction);
-
-function batchedUpdates(callback, a, b, c, d, e) {
- ensureInjected();
- return batchingStrategy.batchedUpdates(callback, a, b, c, d, e);
-}
-
-/**
- * Array comparator for ReactComponents by mount ordering.
- *
- * @param {ReactComponent} c1 first component you're comparing
- * @param {ReactComponent} c2 second component you're comparing
- * @return {number} Return value usable by Array.prototype.sort().
- */
-function mountOrderComparator(c1, c2) {
- return c1._mountOrder - c2._mountOrder;
-}
-
-function runBatchedUpdates(transaction) {
- var len = transaction.dirtyComponentsLength;
- !(len === dirtyComponents.length) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Expected flush transaction\'s stored dirty-components length (%s) to match dirty-components array length (%s).', len, dirtyComponents.length) : _prodInvariant('124', len, dirtyComponents.length) : void 0;
-
- // Since reconciling a component higher in the owner hierarchy usually (not
- // always -- see shouldComponentUpdate()) will reconcile children, reconcile
- // them before their children by sorting the array.
- dirtyComponents.sort(mountOrderComparator);
-
- // Any updates enqueued while reconciling must be performed after this entire
- // batch. Otherwise, if dirtyComponents is [A, B] where A has children B and
- // C, B could update twice in a single batch if C's render enqueues an update
- // to B (since B would have already updated, we should skip it, and the only
- // way we can know to do so is by checking the batch counter).
- updateBatchNumber++;
-
- for (var i = 0; i < len; i++) {
- // If a component is unmounted before pending changes apply, it will still
- // be here, but we assume that it has cleared its _pendingCallbacks and
- // that performUpdateIfNecessary is a noop.
- var component = dirtyComponents[i];
-
- // If performUpdateIfNecessary happens to enqueue any new updates, we
- // shouldn't execute the callbacks until the next render happens, so
- // stash the callbacks first
- var callbacks = component._pendingCallbacks;
- component._pendingCallbacks = null;
-
- var markerName;
- if (ReactFeatureFlags.logTopLevelRenders) {
- var namedComponent = component;
- // Duck type TopLevelWrapper. This is probably always true.
- if (component._currentElement.type.isReactTopLevelWrapper) {
- namedComponent = component._renderedComponent;
- }
- markerName = 'React update: ' + namedComponent.getName();
- console.time(markerName);
- }
-
- ReactReconciler.performUpdateIfNecessary(component, transaction.reconcileTransaction, updateBatchNumber);
-
- if (markerName) {
- console.timeEnd(markerName);
- }
-
- if (callbacks) {
- for (var j = 0; j < callbacks.length; j++) {
- transaction.callbackQueue.enqueue(callbacks[j], component.getPublicInstance());
- }
- }
- }
-}
-
-var flushBatchedUpdates = function () {
- // ReactUpdatesFlushTransaction's wrappers will clear the dirtyComponents
- // array and perform any updates enqueued by mount-ready handlers (i.e.,
- // componentDidUpdate) but we need to check here too in order to catch
- // updates enqueued by setState callbacks and asap calls.
- while (dirtyComponents.length || asapEnqueued) {
- if (dirtyComponents.length) {
- var transaction = ReactUpdatesFlushTransaction.getPooled();
- transaction.perform(runBatchedUpdates, null, transaction);
- ReactUpdatesFlushTransaction.release(transaction);
- }
-
- if (asapEnqueued) {
- asapEnqueued = false;
- var queue = asapCallbackQueue;
- asapCallbackQueue = CallbackQueue.getPooled();
- queue.notifyAll();
- CallbackQueue.release(queue);
- }
- }
-};
-
-/**
- * Mark a component as needing a rerender, adding an optional callback to a
- * list of functions which will be executed once the rerender occurs.
- */
-function enqueueUpdate(component) {
- ensureInjected();
-
- // Various parts of our code (such as ReactCompositeComponent's
- // _renderValidatedComponent) assume that calls to render aren't nested;
- // verify that that's the case. (This is called by each top-level update
- // function, like setState, forceUpdate, etc.; creation and
- // destruction of top-level components is guarded in ReactMount.)
-
- if (!batchingStrategy.isBatchingUpdates) {
- batchingStrategy.batchedUpdates(enqueueUpdate, component);
- return;
- }
-
- dirtyComponents.push(component);
- if (component._updateBatchNumber == null) {
- component._updateBatchNumber = updateBatchNumber + 1;
- }
-}
-
-/**
- * Enqueue a callback to be run at the end of the current batching cycle. Throws
- * if no updates are currently being performed.
- */
-function asap(callback, context) {
- !batchingStrategy.isBatchingUpdates ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates.asap: Can\'t enqueue an asap callback in a context whereupdates are not being batched.') : _prodInvariant('125') : void 0;
- asapCallbackQueue.enqueue(callback, context);
- asapEnqueued = true;
-}
-
-var ReactUpdatesInjection = {
- injectReconcileTransaction: function (ReconcileTransaction) {
- !ReconcileTransaction ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates: must provide a reconcile transaction class') : _prodInvariant('126') : void 0;
- ReactUpdates.ReactReconcileTransaction = ReconcileTransaction;
- },
-
- injectBatchingStrategy: function (_batchingStrategy) {
- !_batchingStrategy ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates: must provide a batching strategy') : _prodInvariant('127') : void 0;
- !(typeof _batchingStrategy.batchedUpdates === 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates: must provide a batchedUpdates() function') : _prodInvariant('128') : void 0;
- !(typeof _batchingStrategy.isBatchingUpdates === 'boolean') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates: must provide an isBatchingUpdates boolean attribute') : _prodInvariant('129') : void 0;
- batchingStrategy = _batchingStrategy;
- }
-};
-
-var ReactUpdates = {
- /**
- * React references `ReactReconcileTransaction` using this property in order
- * to allow dependency injection.
- *
- * @internal
- */
- ReactReconcileTransaction: null,
-
- batchedUpdates: batchedUpdates,
- enqueueUpdate: enqueueUpdate,
- flushBatchedUpdates: flushBatchedUpdates,
- injection: ReactUpdatesInjection,
- asap: asap
-};
-
-module.exports = ReactUpdates;
-}).call(this,require('_process'))
-
-},{"./CallbackQueue":53,"./PooledClass":71,"./ReactFeatureFlags":103,"./ReactReconciler":119,"./Transaction":142,"./reactProdInvariant":167,"_process":43,"fbjs/lib/invariant":18,"object-assign":42}],125:[function(require,module,exports){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-'use strict';
-
-module.exports = '15.4.2';
-},{}],126:[function(require,module,exports){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-'use strict';
-
-var NS = {
- xlink: 'http://www.w3.org/1999/xlink',
- xml: 'http://www.w3.org/XML/1998/namespace'
-};
-
-// We use attributes for everything SVG so let's avoid some duplication and run
-// code instead.
-// The following are all specified in the HTML config already so we exclude here.
-// - class (as className)
-// - color
-// - height
-// - id
-// - lang
-// - max
-// - media
-// - method
-// - min
-// - name
-// - style
-// - target
-// - type
-// - width
-var ATTRS = {
- accentHeight: 'accent-height',
- accumulate: 0,
- additive: 0,
- alignmentBaseline: 'alignment-baseline',
- allowReorder: 'allowReorder',
- alphabetic: 0,
- amplitude: 0,
- arabicForm: 'arabic-form',
- ascent: 0,
- attributeName: 'attributeName',
- attributeType: 'attributeType',
- autoReverse: 'autoReverse',
- azimuth: 0,
- baseFrequency: 'baseFrequency',
- baseProfile: 'baseProfile',
- baselineShift: 'baseline-shift',
- bbox: 0,
- begin: 0,
- bias: 0,
- by: 0,
- calcMode: 'calcMode',
- capHeight: 'cap-height',
- clip: 0,
- clipPath: 'clip-path',
- clipRule: 'clip-rule',
- clipPathUnits: 'clipPathUnits',
- colorInterpolation: 'color-interpolation',
- colorInterpolationFilters: 'color-interpolation-filters',
- colorProfile: 'color-profile',
- colorRendering: 'color-rendering',
- contentScriptType: 'contentScriptType',
- contentStyleType: 'contentStyleType',
- cursor: 0,
- cx: 0,
- cy: 0,
- d: 0,
- decelerate: 0,
- descent: 0,
- diffuseConstant: 'diffuseConstant',
- direction: 0,
- display: 0,
- divisor: 0,
- dominantBaseline: 'dominant-baseline',
- dur: 0,
- dx: 0,
- dy: 0,
- edgeMode: 'edgeMode',
- elevation: 0,
- enableBackground: 'enable-background',
- end: 0,
- exponent: 0,
- externalResourcesRequired: 'externalResourcesRequired',
- fill: 0,
- fillOpacity: 'fill-opacity',
- fillRule: 'fill-rule',
- filter: 0,
- filterRes: 'filterRes',
- filterUnits: 'filterUnits',
- floodColor: 'flood-color',
- floodOpacity: 'flood-opacity',
- focusable: 0,
- fontFamily: 'font-family',
- fontSize: 'font-size',
- fontSizeAdjust: 'font-size-adjust',
- fontStretch: 'font-stretch',
- fontStyle: 'font-style',
- fontVariant: 'font-variant',
- fontWeight: 'font-weight',
- format: 0,
- from: 0,
- fx: 0,
- fy: 0,
- g1: 0,
- g2: 0,
- glyphName: 'glyph-name',
- glyphOrientationHorizontal: 'glyph-orientation-horizontal',
- glyphOrientationVertical: 'glyph-orientation-vertical',
- glyphRef: 'glyphRef',
- gradientTransform: 'gradientTransform',
- gradientUnits: 'gradientUnits',
- hanging: 0,
- horizAdvX: 'horiz-adv-x',
- horizOriginX: 'horiz-origin-x',
- ideographic: 0,
- imageRendering: 'image-rendering',
- 'in': 0,
- in2: 0,
- intercept: 0,
- k: 0,
- k1: 0,
- k2: 0,
- k3: 0,
- k4: 0,
- kernelMatrix: 'kernelMatrix',
- kernelUnitLength: 'kernelUnitLength',
- kerning: 0,
- keyPoints: 'keyPoints',
- keySplines: 'keySplines',
- keyTimes: 'keyTimes',
- lengthAdjust: 'lengthAdjust',
- letterSpacing: 'letter-spacing',
- lightingColor: 'lighting-color',
- limitingConeAngle: 'limitingConeAngle',
- local: 0,
- markerEnd: 'marker-end',
- markerMid: 'marker-mid',
- markerStart: 'marker-start',
- markerHeight: 'markerHeight',
- markerUnits: 'markerUnits',
- markerWidth: 'markerWidth',
- mask: 0,
- maskContentUnits: 'maskContentUnits',
- maskUnits: 'maskUnits',
- mathematical: 0,
- mode: 0,
- numOctaves: 'numOctaves',
- offset: 0,
- opacity: 0,
- operator: 0,
- order: 0,
- orient: 0,
- orientation: 0,
- origin: 0,
- overflow: 0,
- overlinePosition: 'overline-position',
- overlineThickness: 'overline-thickness',
- paintOrder: 'paint-order',
- panose1: 'panose-1',
- pathLength: 'pathLength',
- patternContentUnits: 'patternContentUnits',
- patternTransform: 'patternTransform',
- patternUnits: 'patternUnits',
- pointerEvents: 'pointer-events',
- points: 0,
- pointsAtX: 'pointsAtX',
- pointsAtY: 'pointsAtY',
- pointsAtZ: 'pointsAtZ',
- preserveAlpha: 'preserveAlpha',
- preserveAspectRatio: 'preserveAspectRatio',
- primitiveUnits: 'primitiveUnits',
- r: 0,
- radius: 0,
- refX: 'refX',
- refY: 'refY',
- renderingIntent: 'rendering-intent',
- repeatCount: 'repeatCount',
- repeatDur: 'repeatDur',
- requiredExtensions: 'requiredExtensions',
- requiredFeatures: 'requiredFeatures',
- restart: 0,
- result: 0,
- rotate: 0,
- rx: 0,
- ry: 0,
- scale: 0,
- seed: 0,
- shapeRendering: 'shape-rendering',
- slope: 0,
- spacing: 0,
- specularConstant: 'specularConstant',
- specularExponent: 'specularExponent',
- speed: 0,
- spreadMethod: 'spreadMethod',
- startOffset: 'startOffset',
- stdDeviation: 'stdDeviation',
- stemh: 0,
- stemv: 0,
- stitchTiles: 'stitchTiles',
- stopColor: 'stop-color',
- stopOpacity: 'stop-opacity',
- strikethroughPosition: 'strikethrough-position',
- strikethroughThickness: 'strikethrough-thickness',
- string: 0,
- stroke: 0,
- strokeDasharray: 'stroke-dasharray',
- strokeDashoffset: 'stroke-dashoffset',
- strokeLinecap: 'stroke-linecap',
- strokeLinejoin: 'stroke-linejoin',
- strokeMiterlimit: 'stroke-miterlimit',
- strokeOpacity: 'stroke-opacity',
- strokeWidth: 'stroke-width',
- surfaceScale: 'surfaceScale',
- systemLanguage: 'systemLanguage',
- tableValues: 'tableValues',
- targetX: 'targetX',
- targetY: 'targetY',
- textAnchor: 'text-anchor',
- textDecoration: 'text-decoration',
- textRendering: 'text-rendering',
- textLength: 'textLength',
- to: 0,
- transform: 0,
- u1: 0,
- u2: 0,
- underlinePosition: 'underline-position',
- underlineThickness: 'underline-thickness',
- unicode: 0,
- unicodeBidi: 'unicode-bidi',
- unicodeRange: 'unicode-range',
- unitsPerEm: 'units-per-em',
- vAlphabetic: 'v-alphabetic',
- vHanging: 'v-hanging',
- vIdeographic: 'v-ideographic',
- vMathematical: 'v-mathematical',
- values: 0,
- vectorEffect: 'vector-effect',
- version: 0,
- vertAdvY: 'vert-adv-y',
- vertOriginX: 'vert-origin-x',
- vertOriginY: 'vert-origin-y',
- viewBox: 'viewBox',
- viewTarget: 'viewTarget',
- visibility: 0,
- widths: 0,
- wordSpacing: 'word-spacing',
- writingMode: 'writing-mode',
- x: 0,
- xHeight: 'x-height',
- x1: 0,
- x2: 0,
- xChannelSelector: 'xChannelSelector',
- xlinkActuate: 'xlink:actuate',
- xlinkArcrole: 'xlink:arcrole',
- xlinkHref: 'xlink:href',
- xlinkRole: 'xlink:role',
- xlinkShow: 'xlink:show',
- xlinkTitle: 'xlink:title',
- xlinkType: 'xlink:type',
- xmlBase: 'xml:base',
- xmlns: 0,
- xmlnsXlink: 'xmlns:xlink',
- xmlLang: 'xml:lang',
- xmlSpace: 'xml:space',
- y: 0,
- y1: 0,
- y2: 0,
- yChannelSelector: 'yChannelSelector',
- z: 0,
- zoomAndPan: 'zoomAndPan'
-};
-
-var SVGDOMPropertyConfig = {
- Properties: {},
- DOMAttributeNamespaces: {
- xlinkActuate: NS.xlink,
- xlinkArcrole: NS.xlink,
- xlinkHref: NS.xlink,
- xlinkRole: NS.xlink,
- xlinkShow: NS.xlink,
- xlinkTitle: NS.xlink,
- xlinkType: NS.xlink,
- xmlBase: NS.xml,
- xmlLang: NS.xml,
- xmlSpace: NS.xml
- },
- DOMAttributeNames: {}
-};
-
-Object.keys(ATTRS).forEach(function (key) {
- SVGDOMPropertyConfig.Properties[key] = 0;
- if (ATTRS[key]) {
- SVGDOMPropertyConfig.DOMAttributeNames[key] = ATTRS[key];
- }
-});
-
-module.exports = SVGDOMPropertyConfig;
-},{}],127:[function(require,module,exports){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-'use strict';
-
-var EventPropagators = require('./EventPropagators');
-var ExecutionEnvironment = require('fbjs/lib/ExecutionEnvironment');
-var ReactDOMComponentTree = require('./ReactDOMComponentTree');
-var ReactInputSelection = require('./ReactInputSelection');
-var SyntheticEvent = require('./SyntheticEvent');
-
-var getActiveElement = require('fbjs/lib/getActiveElement');
-var isTextInputElement = require('./isTextInputElement');
-var shallowEqual = require('fbjs/lib/shallowEqual');
-
-var skipSelectionChangeEvent = ExecutionEnvironment.canUseDOM && 'documentMode' in document && document.documentMode <= 11;
-
-var eventTypes = {
- select: {
- phasedRegistrationNames: {
- bubbled: 'onSelect',
- captured: 'onSelectCapture'
- },
- dependencies: ['topBlur', 'topContextMenu', 'topFocus', 'topKeyDown', 'topKeyUp', 'topMouseDown', 'topMouseUp', 'topSelectionChange']
- }
-};
-
-var activeElement = null;
-var activeElementInst = null;
-var lastSelection = null;
-var mouseDown = false;
-
-// Track whether a listener exists for this plugin. If none exist, we do
-// not extract events. See #3639.
-var hasListener = false;
-
-/**
- * Get an object which is a unique representation of the current selection.
- *
- * The return value will not be consistent across nodes or browsers, but
- * two identical selections on the same node will return identical objects.
- *
- * @param {DOMElement} node
- * @return {object}
- */
-function getSelection(node) {
- if ('selectionStart' in node && ReactInputSelection.hasSelectionCapabilities(node)) {
- return {
- start: node.selectionStart,
- end: node.selectionEnd
- };
- } else if (window.getSelection) {
- var selection = window.getSelection();
- return {
- anchorNode: selection.anchorNode,
- anchorOffset: selection.anchorOffset,
- focusNode: selection.focusNode,
- focusOffset: selection.focusOffset
- };
- } else if (document.selection) {
- var range = document.selection.createRange();
- return {
- parentElement: range.parentElement(),
- text: range.text,
- top: range.boundingTop,
- left: range.boundingLeft
- };
- }
-}
-
-/**
- * Poll selection to see whether it's changed.
- *
- * @param {object} nativeEvent
- * @return {?SyntheticEvent}
- */
-function constructSelectEvent(nativeEvent, nativeEventTarget) {
- // Ensure we have the right element, and that the user is not dragging a
- // selection (this matches native `select` event behavior). In HTML5, select
- // fires only on input and textarea thus if there's no focused element we
- // won't dispatch.
- if (mouseDown || activeElement == null || activeElement !== getActiveElement()) {
- return null;
- }
-
- // Only fire when selection has actually changed.
- var currentSelection = getSelection(activeElement);
- if (!lastSelection || !shallowEqual(lastSelection, currentSelection)) {
- lastSelection = currentSelection;
-
- var syntheticEvent = SyntheticEvent.getPooled(eventTypes.select, activeElementInst, nativeEvent, nativeEventTarget);
-
- syntheticEvent.type = 'select';
- syntheticEvent.target = activeElement;
-
- EventPropagators.accumulateTwoPhaseDispatches(syntheticEvent);
-
- return syntheticEvent;
- }
-
- return null;
-}
-
-/**
- * This plugin creates an `onSelect` event that normalizes select events
- * across form elements.
- *
- * Supported elements are:
- * - input (see `isTextInputElement`)
- * - textarea
- * - contentEditable
- *
- * This differs from native browser implementations in the following ways:
- * - Fires on contentEditable fields as well as inputs.
- * - Fires for collapsed selection.
- * - Fires after user input.
- */
-var SelectEventPlugin = {
-
- eventTypes: eventTypes,
-
- extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
- if (!hasListener) {
- return null;
- }
-
- var targetNode = targetInst ? ReactDOMComponentTree.getNodeFromInstance(targetInst) : window;
-
- switch (topLevelType) {
- // Track the input node that has focus.
- case 'topFocus':
- if (isTextInputElement(targetNode) || targetNode.contentEditable === 'true') {
- activeElement = targetNode;
- activeElementInst = targetInst;
- lastSelection = null;
- }
- break;
- case 'topBlur':
- activeElement = null;
- activeElementInst = null;
- lastSelection = null;
- break;
-
- // Don't fire the event while the user is dragging. This matches the
- // semantics of the native select event.
- case 'topMouseDown':
- mouseDown = true;
- break;
- case 'topContextMenu':
- case 'topMouseUp':
- mouseDown = false;
- return constructSelectEvent(nativeEvent, nativeEventTarget);
-
- // Chrome and IE fire non-standard event when selection is changed (and
- // sometimes when it hasn't). IE's event fires out of order with respect
- // to key and input events on deletion, so we discard it.
- //
- // Firefox doesn't support selectionchange, so check selection status
- // after each key entry. The selection changes after keydown and before
- // keyup, but we check on keydown as well in the case of holding down a
- // key, when multiple keydown events are fired but only one keyup is.
- // This is also our approach for IE handling, for the reason above.
- case 'topSelectionChange':
- if (skipSelectionChangeEvent) {
- break;
- }
- // falls through
- case 'topKeyDown':
- case 'topKeyUp':
- return constructSelectEvent(nativeEvent, nativeEventTarget);
- }
-
- return null;
- },
-
- didPutListener: function (inst, registrationName, listener) {
- if (registrationName === 'onSelect') {
- hasListener = true;
- }
- }
-};
-
-module.exports = SelectEventPlugin;
-},{"./EventPropagators":66,"./ReactDOMComponentTree":80,"./ReactInputSelection":107,"./SyntheticEvent":133,"./isTextInputElement":165,"fbjs/lib/ExecutionEnvironment":4,"fbjs/lib/getActiveElement":13,"fbjs/lib/shallowEqual":24}],128:[function(require,module,exports){
-(function (process){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- *
- */
-
-'use strict';
-
-var _prodInvariant = require('./reactProdInvariant');
-
-var EventListener = require('fbjs/lib/EventListener');
-var EventPropagators = require('./EventPropagators');
-var ReactDOMComponentTree = require('./ReactDOMComponentTree');
-var SyntheticAnimationEvent = require('./SyntheticAnimationEvent');
-var SyntheticClipboardEvent = require('./SyntheticClipboardEvent');
-var SyntheticEvent = require('./SyntheticEvent');
-var SyntheticFocusEvent = require('./SyntheticFocusEvent');
-var SyntheticKeyboardEvent = require('./SyntheticKeyboardEvent');
-var SyntheticMouseEvent = require('./SyntheticMouseEvent');
-var SyntheticDragEvent = require('./SyntheticDragEvent');
-var SyntheticTouchEvent = require('./SyntheticTouchEvent');
-var SyntheticTransitionEvent = require('./SyntheticTransitionEvent');
-var SyntheticUIEvent = require('./SyntheticUIEvent');
-var SyntheticWheelEvent = require('./SyntheticWheelEvent');
-
-var emptyFunction = require('fbjs/lib/emptyFunction');
-var getEventCharCode = require('./getEventCharCode');
-var invariant = require('fbjs/lib/invariant');
-
-/**
- * Turns
- * ['abort', ...]
- * into
- * eventTypes = {
- * 'abort': {
- * phasedRegistrationNames: {
- * bubbled: 'onAbort',
- * captured: 'onAbortCapture',
- * },
- * dependencies: ['topAbort'],
- * },
- * ...
- * };
- * topLevelEventsToDispatchConfig = {
- * 'topAbort': { sameConfig }
- * };
- */
-var eventTypes = {};
-var topLevelEventsToDispatchConfig = {};
-['abort', 'animationEnd', 'animationIteration', 'animationStart', 'blur', 'canPlay', 'canPlayThrough', 'click', 'contextMenu', 'copy', 'cut', 'doubleClick', 'drag', 'dragEnd', 'dragEnter', 'dragExit', 'dragLeave', 'dragOver', 'dragStart', 'drop', 'durationChange', 'emptied', 'encrypted', 'ended', 'error', 'focus', 'input', 'invalid', 'keyDown', 'keyPress', 'keyUp', 'load', 'loadedData', 'loadedMetadata', 'loadStart', 'mouseDown', 'mouseMove', 'mouseOut', 'mouseOver', 'mouseUp', 'paste', 'pause', 'play', 'playing', 'progress', 'rateChange', 'reset', 'scroll', 'seeked', 'seeking', 'stalled', 'submit', 'suspend', 'timeUpdate', 'touchCancel', 'touchEnd', 'touchMove', 'touchStart', 'transitionEnd', 'volumeChange', 'waiting', 'wheel'].forEach(function (event) {
- var capitalizedEvent = event[0].toUpperCase() + event.slice(1);
- var onEvent = 'on' + capitalizedEvent;
- var topEvent = 'top' + capitalizedEvent;
-
- var type = {
- phasedRegistrationNames: {
- bubbled: onEvent,
- captured: onEvent + 'Capture'
- },
- dependencies: [topEvent]
- };
- eventTypes[event] = type;
- topLevelEventsToDispatchConfig[topEvent] = type;
-});
-
-var onClickListeners = {};
-
-function getDictionaryKey(inst) {
- // Prevents V8 performance issue:
- // https://github.com/facebook/react/pull/7232
- return '.' + inst._rootNodeID;
-}
-
-function isInteractive(tag) {
- return tag === 'button' || tag === 'input' || tag === 'select' || tag === 'textarea';
-}
-
-var SimpleEventPlugin = {
-
- eventTypes: eventTypes,
-
- extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
- var dispatchConfig = topLevelEventsToDispatchConfig[topLevelType];
- if (!dispatchConfig) {
- return null;
- }
- var EventConstructor;
- switch (topLevelType) {
- case 'topAbort':
- case 'topCanPlay':
- case 'topCanPlayThrough':
- case 'topDurationChange':
- case 'topEmptied':
- case 'topEncrypted':
- case 'topEnded':
- case 'topError':
- case 'topInput':
- case 'topInvalid':
- case 'topLoad':
- case 'topLoadedData':
- case 'topLoadedMetadata':
- case 'topLoadStart':
- case 'topPause':
- case 'topPlay':
- case 'topPlaying':
- case 'topProgress':
- case 'topRateChange':
- case 'topReset':
- case 'topSeeked':
- case 'topSeeking':
- case 'topStalled':
- case 'topSubmit':
- case 'topSuspend':
- case 'topTimeUpdate':
- case 'topVolumeChange':
- case 'topWaiting':
- // HTML Events
- // @see http://www.w3.org/TR/html5/index.html#events-0
- EventConstructor = SyntheticEvent;
- break;
- case 'topKeyPress':
- // Firefox creates a keypress event for function keys too. This removes
- // the unwanted keypress events. Enter is however both printable and
- // non-printable. One would expect Tab to be as well (but it isn't).
- if (getEventCharCode(nativeEvent) === 0) {
- return null;
- }
- /* falls through */
- case 'topKeyDown':
- case 'topKeyUp':
- EventConstructor = SyntheticKeyboardEvent;
- break;
- case 'topBlur':
- case 'topFocus':
- EventConstructor = SyntheticFocusEvent;
- break;
- case 'topClick':
- // Firefox creates a click event on right mouse clicks. This removes the
- // unwanted click events.
- if (nativeEvent.button === 2) {
- return null;
- }
- /* falls through */
- case 'topDoubleClick':
- case 'topMouseDown':
- case 'topMouseMove':
- case 'topMouseUp':
- // TODO: Disabled elements should not respond to mouse events
- /* falls through */
- case 'topMouseOut':
- case 'topMouseOver':
- case 'topContextMenu':
- EventConstructor = SyntheticMouseEvent;
- break;
- case 'topDrag':
- case 'topDragEnd':
- case 'topDragEnter':
- case 'topDragExit':
- case 'topDragLeave':
- case 'topDragOver':
- case 'topDragStart':
- case 'topDrop':
- EventConstructor = SyntheticDragEvent;
- break;
- case 'topTouchCancel':
- case 'topTouchEnd':
- case 'topTouchMove':
- case 'topTouchStart':
- EventConstructor = SyntheticTouchEvent;
- break;
- case 'topAnimationEnd':
- case 'topAnimationIteration':
- case 'topAnimationStart':
- EventConstructor = SyntheticAnimationEvent;
- break;
- case 'topTransitionEnd':
- EventConstructor = SyntheticTransitionEvent;
- break;
- case 'topScroll':
- EventConstructor = SyntheticUIEvent;
- break;
- case 'topWheel':
- EventConstructor = SyntheticWheelEvent;
- break;
- case 'topCopy':
- case 'topCut':
- case 'topPaste':
- EventConstructor = SyntheticClipboardEvent;
- break;
- }
- !EventConstructor ? process.env.NODE_ENV !== 'production' ? invariant(false, 'SimpleEventPlugin: Unhandled event type, `%s`.', topLevelType) : _prodInvariant('86', topLevelType) : void 0;
- var event = EventConstructor.getPooled(dispatchConfig, targetInst, nativeEvent, nativeEventTarget);
- EventPropagators.accumulateTwoPhaseDispatches(event);
- return event;
- },
-
- didPutListener: function (inst, registrationName, listener) {
- // Mobile Safari does not fire properly bubble click events on
- // non-interactive elements, which means delegated click listeners do not
- // fire. The workaround for this bug involves attaching an empty click
- // listener on the target node.
- // http://www.quirksmode.org/blog/archives/2010/09/click_event_del.html
- if (registrationName === 'onClick' && !isInteractive(inst._tag)) {
- var key = getDictionaryKey(inst);
- var node = ReactDOMComponentTree.getNodeFromInstance(inst);
- if (!onClickListeners[key]) {
- onClickListeners[key] = EventListener.listen(node, 'click', emptyFunction);
- }
- }
- },
-
- willDeleteListener: function (inst, registrationName) {
- if (registrationName === 'onClick' && !isInteractive(inst._tag)) {
- var key = getDictionaryKey(inst);
- onClickListeners[key].remove();
- delete onClickListeners[key];
- }
- }
-
-};
-
-module.exports = SimpleEventPlugin;
-}).call(this,require('_process'))
-
-},{"./EventPropagators":66,"./ReactDOMComponentTree":80,"./SyntheticAnimationEvent":129,"./SyntheticClipboardEvent":130,"./SyntheticDragEvent":132,"./SyntheticEvent":133,"./SyntheticFocusEvent":134,"./SyntheticKeyboardEvent":136,"./SyntheticMouseEvent":137,"./SyntheticTouchEvent":138,"./SyntheticTransitionEvent":139,"./SyntheticUIEvent":140,"./SyntheticWheelEvent":141,"./getEventCharCode":153,"./reactProdInvariant":167,"_process":43,"fbjs/lib/EventListener":3,"fbjs/lib/emptyFunction":10,"fbjs/lib/invariant":18}],129:[function(require,module,exports){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-'use strict';
-
-var SyntheticEvent = require('./SyntheticEvent');
-
-/**
- * @interface Event
- * @see http://www.w3.org/TR/css3-animations/#AnimationEvent-interface
- * @see https://developer.mozilla.org/en-US/docs/Web/API/AnimationEvent
- */
-var AnimationEventInterface = {
- animationName: null,
- elapsedTime: null,
- pseudoElement: null
-};
-
-/**
- * @param {object} dispatchConfig Configuration used to dispatch this event.
- * @param {string} dispatchMarker Marker identifying the event target.
- * @param {object} nativeEvent Native browser event.
- * @extends {SyntheticEvent}
- */
-function SyntheticAnimationEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
- return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
-}
-
-SyntheticEvent.augmentClass(SyntheticAnimationEvent, AnimationEventInterface);
-
-module.exports = SyntheticAnimationEvent;
-},{"./SyntheticEvent":133}],130:[function(require,module,exports){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-'use strict';
-
-var SyntheticEvent = require('./SyntheticEvent');
-
-/**
- * @interface Event
- * @see http://www.w3.org/TR/clipboard-apis/
- */
-var ClipboardEventInterface = {
- clipboardData: function (event) {
- return 'clipboardData' in event ? event.clipboardData : window.clipboardData;
- }
-};
-
-/**
- * @param {object} dispatchConfig Configuration used to dispatch this event.
- * @param {string} dispatchMarker Marker identifying the event target.
- * @param {object} nativeEvent Native browser event.
- * @extends {SyntheticUIEvent}
- */
-function SyntheticClipboardEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
- return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
-}
-
-SyntheticEvent.augmentClass(SyntheticClipboardEvent, ClipboardEventInterface);
-
-module.exports = SyntheticClipboardEvent;
-},{"./SyntheticEvent":133}],131:[function(require,module,exports){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-'use strict';
-
-var SyntheticEvent = require('./SyntheticEvent');
-
-/**
- * @interface Event
- * @see http://www.w3.org/TR/DOM-Level-3-Events/#events-compositionevents
- */
-var CompositionEventInterface = {
- data: null
-};
-
-/**
- * @param {object} dispatchConfig Configuration used to dispatch this event.
- * @param {string} dispatchMarker Marker identifying the event target.
- * @param {object} nativeEvent Native browser event.
- * @extends {SyntheticUIEvent}
- */
-function SyntheticCompositionEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
- return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
-}
-
-SyntheticEvent.augmentClass(SyntheticCompositionEvent, CompositionEventInterface);
-
-module.exports = SyntheticCompositionEvent;
-},{"./SyntheticEvent":133}],132:[function(require,module,exports){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-'use strict';
-
-var SyntheticMouseEvent = require('./SyntheticMouseEvent');
-
-/**
- * @interface DragEvent
- * @see http://www.w3.org/TR/DOM-Level-3-Events/
- */
-var DragEventInterface = {
- dataTransfer: null
-};
-
-/**
- * @param {object} dispatchConfig Configuration used to dispatch this event.
- * @param {string} dispatchMarker Marker identifying the event target.
- * @param {object} nativeEvent Native browser event.
- * @extends {SyntheticUIEvent}
- */
-function SyntheticDragEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
- return SyntheticMouseEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
-}
-
-SyntheticMouseEvent.augmentClass(SyntheticDragEvent, DragEventInterface);
-
-module.exports = SyntheticDragEvent;
-},{"./SyntheticMouseEvent":137}],133:[function(require,module,exports){
-(function (process){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-'use strict';
-
-var _assign = require('object-assign');
-
-var PooledClass = require('./PooledClass');
-
-var emptyFunction = require('fbjs/lib/emptyFunction');
-var warning = require('fbjs/lib/warning');
-
-var didWarnForAddedNewProperty = false;
-var isProxySupported = typeof Proxy === 'function';
-
-var shouldBeReleasedProperties = ['dispatchConfig', '_targetInst', 'nativeEvent', 'isDefaultPrevented', 'isPropagationStopped', '_dispatchListeners', '_dispatchInstances'];
-
-/**
- * @interface Event
- * @see http://www.w3.org/TR/DOM-Level-3-Events/
- */
-var EventInterface = {
- type: null,
- target: null,
- // currentTarget is set when dispatching; no use in copying it here
- currentTarget: emptyFunction.thatReturnsNull,
- eventPhase: null,
- bubbles: null,
- cancelable: null,
- timeStamp: function (event) {
- return event.timeStamp || Date.now();
- },
- defaultPrevented: null,
- isTrusted: null
-};
-
-/**
- * Synthetic events are dispatched by event plugins, typically in response to a
- * top-level event delegation handler.
- *
- * These systems should generally use pooling to reduce the frequency of garbage
- * collection. The system should check `isPersistent` to determine whether the
- * event should be released into the pool after being dispatched. Users that
- * need a persisted event should invoke `persist`.
- *
- * Synthetic events (and subclasses) implement the DOM Level 3 Events API by
- * normalizing browser quirks. Subclasses do not necessarily have to implement a
- * DOM interface; custom application-specific events can also subclass this.
- *
- * @param {object} dispatchConfig Configuration used to dispatch this event.
- * @param {*} targetInst Marker identifying the event target.
- * @param {object} nativeEvent Native browser event.
- * @param {DOMEventTarget} nativeEventTarget Target node.
- */
-function SyntheticEvent(dispatchConfig, targetInst, nativeEvent, nativeEventTarget) {
- if (process.env.NODE_ENV !== 'production') {
- // these have a getter/setter for warnings
- delete this.nativeEvent;
- delete this.preventDefault;
- delete this.stopPropagation;
- }
-
- this.dispatchConfig = dispatchConfig;
- this._targetInst = targetInst;
- this.nativeEvent = nativeEvent;
-
- var Interface = this.constructor.Interface;
- for (var propName in Interface) {
- if (!Interface.hasOwnProperty(propName)) {
- continue;
- }
- if (process.env.NODE_ENV !== 'production') {
- delete this[propName]; // this has a getter/setter for warnings
- }
- var normalize = Interface[propName];
- if (normalize) {
- this[propName] = normalize(nativeEvent);
- } else {
- if (propName === 'target') {
- this.target = nativeEventTarget;
- } else {
- this[propName] = nativeEvent[propName];
- }
- }
- }
-
- var defaultPrevented = nativeEvent.defaultPrevented != null ? nativeEvent.defaultPrevented : nativeEvent.returnValue === false;
- if (defaultPrevented) {
- this.isDefaultPrevented = emptyFunction.thatReturnsTrue;
- } else {
- this.isDefaultPrevented = emptyFunction.thatReturnsFalse;
- }
- this.isPropagationStopped = emptyFunction.thatReturnsFalse;
- return this;
-}
-
-_assign(SyntheticEvent.prototype, {
-
- preventDefault: function () {
- this.defaultPrevented = true;
- var event = this.nativeEvent;
- if (!event) {
- return;
- }
-
- if (event.preventDefault) {
- event.preventDefault();
- } else if (typeof event.returnValue !== 'unknown') {
- // eslint-disable-line valid-typeof
- event.returnValue = false;
- }
- this.isDefaultPrevented = emptyFunction.thatReturnsTrue;
- },
-
- stopPropagation: function () {
- var event = this.nativeEvent;
- if (!event) {
- return;
- }
-
- if (event.stopPropagation) {
- event.stopPropagation();
- } else if (typeof event.cancelBubble !== 'unknown') {
- // eslint-disable-line valid-typeof
- // The ChangeEventPlugin registers a "propertychange" event for
- // IE. This event does not support bubbling or cancelling, and
- // any references to cancelBubble throw "Member not found". A
- // typeof check of "unknown" circumvents this issue (and is also
- // IE specific).
- event.cancelBubble = true;
- }
-
- this.isPropagationStopped = emptyFunction.thatReturnsTrue;
- },
-
- /**
- * We release all dispatched `SyntheticEvent`s after each event loop, adding
- * them back into the pool. This allows a way to hold onto a reference that
- * won't be added back into the pool.
- */
- persist: function () {
- this.isPersistent = emptyFunction.thatReturnsTrue;
- },
-
- /**
- * Checks if this event should be released back into the pool.
- *
- * @return {boolean} True if this should not be released, false otherwise.
- */
- isPersistent: emptyFunction.thatReturnsFalse,
-
- /**
- * `PooledClass` looks for `destructor` on each instance it releases.
- */
- destructor: function () {
- var Interface = this.constructor.Interface;
- for (var propName in Interface) {
- if (process.env.NODE_ENV !== 'production') {
- Object.defineProperty(this, propName, getPooledWarningPropertyDefinition(propName, Interface[propName]));
- } else {
- this[propName] = null;
- }
- }
- for (var i = 0; i < shouldBeReleasedProperties.length; i++) {
- this[shouldBeReleasedProperties[i]] = null;
- }
- if (process.env.NODE_ENV !== 'production') {
- Object.defineProperty(this, 'nativeEvent', getPooledWarningPropertyDefinition('nativeEvent', null));
- Object.defineProperty(this, 'preventDefault', getPooledWarningPropertyDefinition('preventDefault', emptyFunction));
- Object.defineProperty(this, 'stopPropagation', getPooledWarningPropertyDefinition('stopPropagation', emptyFunction));
- }
- }
-
-});
-
-SyntheticEvent.Interface = EventInterface;
-
-if (process.env.NODE_ENV !== 'production') {
- if (isProxySupported) {
- /*eslint-disable no-func-assign */
- SyntheticEvent = new Proxy(SyntheticEvent, {
- construct: function (target, args) {
- return this.apply(target, Object.create(target.prototype), args);
- },
- apply: function (constructor, that, args) {
- return new Proxy(constructor.apply(that, args), {
- set: function (target, prop, value) {
- if (prop !== 'isPersistent' && !target.constructor.Interface.hasOwnProperty(prop) && shouldBeReleasedProperties.indexOf(prop) === -1) {
- process.env.NODE_ENV !== 'production' ? warning(didWarnForAddedNewProperty || target.isPersistent(), 'This synthetic event is reused for performance reasons. If you\'re ' + 'seeing this, you\'re adding a new property in the synthetic event object. ' + 'The property is never released. See ' + 'https://fb.me/react-event-pooling for more information.') : void 0;
- didWarnForAddedNewProperty = true;
- }
- target[prop] = value;
- return true;
- }
- });
- }
- });
- /*eslint-enable no-func-assign */
- }
-}
-/**
- * Helper to reduce boilerplate when creating subclasses.
- *
- * @param {function} Class
- * @param {?object} Interface
- */
-SyntheticEvent.augmentClass = function (Class, Interface) {
- var Super = this;
-
- var E = function () {};
- E.prototype = Super.prototype;
- var prototype = new E();
-
- _assign(prototype, Class.prototype);
- Class.prototype = prototype;
- Class.prototype.constructor = Class;
-
- Class.Interface = _assign({}, Super.Interface, Interface);
- Class.augmentClass = Super.augmentClass;
-
- PooledClass.addPoolingTo(Class, PooledClass.fourArgumentPooler);
-};
-
-PooledClass.addPoolingTo(SyntheticEvent, PooledClass.fourArgumentPooler);
-
-module.exports = SyntheticEvent;
-
-/**
- * Helper to nullify syntheticEvent instance properties when destructing
- *
- * @param {object} SyntheticEvent
- * @param {String} propName
- * @return {object} defineProperty object
- */
-function getPooledWarningPropertyDefinition(propName, getVal) {
- var isFunction = typeof getVal === 'function';
- return {
- configurable: true,
- set: set,
- get: get
- };
-
- function set(val) {
- var action = isFunction ? 'setting the method' : 'setting the property';
- warn(action, 'This is effectively a no-op');
- return val;
- }
-
- function get() {
- var action = isFunction ? 'accessing the method' : 'accessing the property';
- var result = isFunction ? 'This is a no-op function' : 'This is set to null';
- warn(action, result);
- return getVal;
- }
-
- function warn(action, result) {
- var warningCondition = false;
- process.env.NODE_ENV !== 'production' ? warning(warningCondition, 'This synthetic event is reused for performance reasons. If you\'re seeing this, ' + 'you\'re %s `%s` on a released/nullified synthetic event. %s. ' + 'If you must keep the original synthetic event around, use event.persist(). ' + 'See https://fb.me/react-event-pooling for more information.', action, propName, result) : void 0;
- }
-}
-}).call(this,require('_process'))
-
-},{"./PooledClass":71,"_process":43,"fbjs/lib/emptyFunction":10,"fbjs/lib/warning":25,"object-assign":42}],134:[function(require,module,exports){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-'use strict';
-
-var SyntheticUIEvent = require('./SyntheticUIEvent');
-
-/**
- * @interface FocusEvent
- * @see http://www.w3.org/TR/DOM-Level-3-Events/
- */
-var FocusEventInterface = {
- relatedTarget: null
-};
-
-/**
- * @param {object} dispatchConfig Configuration used to dispatch this event.
- * @param {string} dispatchMarker Marker identifying the event target.
- * @param {object} nativeEvent Native browser event.
- * @extends {SyntheticUIEvent}
- */
-function SyntheticFocusEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
- return SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
-}
-
-SyntheticUIEvent.augmentClass(SyntheticFocusEvent, FocusEventInterface);
-
-module.exports = SyntheticFocusEvent;
-},{"./SyntheticUIEvent":140}],135:[function(require,module,exports){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-'use strict';
-
-var SyntheticEvent = require('./SyntheticEvent');
-
-/**
- * @interface Event
- * @see http://www.w3.org/TR/2013/WD-DOM-Level-3-Events-20131105
- * /#events-inputevents
- */
-var InputEventInterface = {
- data: null
-};
-
-/**
- * @param {object} dispatchConfig Configuration used to dispatch this event.
- * @param {string} dispatchMarker Marker identifying the event target.
- * @param {object} nativeEvent Native browser event.
- * @extends {SyntheticUIEvent}
- */
-function SyntheticInputEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
- return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
-}
-
-SyntheticEvent.augmentClass(SyntheticInputEvent, InputEventInterface);
-
-module.exports = SyntheticInputEvent;
-},{"./SyntheticEvent":133}],136:[function(require,module,exports){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-'use strict';
-
-var SyntheticUIEvent = require('./SyntheticUIEvent');
-
-var getEventCharCode = require('./getEventCharCode');
-var getEventKey = require('./getEventKey');
-var getEventModifierState = require('./getEventModifierState');
-
-/**
- * @interface KeyboardEvent
- * @see http://www.w3.org/TR/DOM-Level-3-Events/
- */
-var KeyboardEventInterface = {
- key: getEventKey,
- location: null,
- ctrlKey: null,
- shiftKey: null,
- altKey: null,
- metaKey: null,
- repeat: null,
- locale: null,
- getModifierState: getEventModifierState,
- // Legacy Interface
- charCode: function (event) {
- // `charCode` is the result of a KeyPress event and represents the value of
- // the actual printable character.
-
- // KeyPress is deprecated, but its replacement is not yet final and not
- // implemented in any major browser. Only KeyPress has charCode.
- if (event.type === 'keypress') {
- return getEventCharCode(event);
- }
- return 0;
- },
- keyCode: function (event) {
- // `keyCode` is the result of a KeyDown/Up event and represents the value of
- // physical keyboard key.
-
- // The actual meaning of the value depends on the users' keyboard layout
- // which cannot be detected. Assuming that it is a US keyboard layout
- // provides a surprisingly accurate mapping for US and European users.
- // Due to this, it is left to the user to implement at this time.
- if (event.type === 'keydown' || event.type === 'keyup') {
- return event.keyCode;
- }
- return 0;
- },
- which: function (event) {
- // `which` is an alias for either `keyCode` or `charCode` depending on the
- // type of the event.
- if (event.type === 'keypress') {
- return getEventCharCode(event);
- }
- if (event.type === 'keydown' || event.type === 'keyup') {
- return event.keyCode;
- }
- return 0;
- }
-};
-
-/**
- * @param {object} dispatchConfig Configuration used to dispatch this event.
- * @param {string} dispatchMarker Marker identifying the event target.
- * @param {object} nativeEvent Native browser event.
- * @extends {SyntheticUIEvent}
- */
-function SyntheticKeyboardEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
- return SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
-}
-
-SyntheticUIEvent.augmentClass(SyntheticKeyboardEvent, KeyboardEventInterface);
-
-module.exports = SyntheticKeyboardEvent;
-},{"./SyntheticUIEvent":140,"./getEventCharCode":153,"./getEventKey":154,"./getEventModifierState":155}],137:[function(require,module,exports){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-'use strict';
-
-var SyntheticUIEvent = require('./SyntheticUIEvent');
-var ViewportMetrics = require('./ViewportMetrics');
-
-var getEventModifierState = require('./getEventModifierState');
-
-/**
- * @interface MouseEvent
- * @see http://www.w3.org/TR/DOM-Level-3-Events/
- */
-var MouseEventInterface = {
- screenX: null,
- screenY: null,
- clientX: null,
- clientY: null,
- ctrlKey: null,
- shiftKey: null,
- altKey: null,
- metaKey: null,
- getModifierState: getEventModifierState,
- button: function (event) {
- // Webkit, Firefox, IE9+
- // which: 1 2 3
- // button: 0 1 2 (standard)
- var button = event.button;
- if ('which' in event) {
- return button;
- }
- // IE<9
- // which: undefined
- // button: 0 0 0
- // button: 1 4 2 (onmouseup)
- return button === 2 ? 2 : button === 4 ? 1 : 0;
- },
- buttons: null,
- relatedTarget: function (event) {
- return event.relatedTarget || (event.fromElement === event.srcElement ? event.toElement : event.fromElement);
- },
- // "Proprietary" Interface.
- pageX: function (event) {
- return 'pageX' in event ? event.pageX : event.clientX + ViewportMetrics.currentScrollLeft;
- },
- pageY: function (event) {
- return 'pageY' in event ? event.pageY : event.clientY + ViewportMetrics.currentScrollTop;
- }
-};
-
-/**
- * @param {object} dispatchConfig Configuration used to dispatch this event.
- * @param {string} dispatchMarker Marker identifying the event target.
- * @param {object} nativeEvent Native browser event.
- * @extends {SyntheticUIEvent}
- */
-function SyntheticMouseEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
- return SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
-}
-
-SyntheticUIEvent.augmentClass(SyntheticMouseEvent, MouseEventInterface);
-
-module.exports = SyntheticMouseEvent;
-},{"./SyntheticUIEvent":140,"./ViewportMetrics":143,"./getEventModifierState":155}],138:[function(require,module,exports){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-'use strict';
-
-var SyntheticUIEvent = require('./SyntheticUIEvent');
-
-var getEventModifierState = require('./getEventModifierState');
-
-/**
- * @interface TouchEvent
- * @see http://www.w3.org/TR/touch-events/
- */
-var TouchEventInterface = {
- touches: null,
- targetTouches: null,
- changedTouches: null,
- altKey: null,
- metaKey: null,
- ctrlKey: null,
- shiftKey: null,
- getModifierState: getEventModifierState
-};
-
-/**
- * @param {object} dispatchConfig Configuration used to dispatch this event.
- * @param {string} dispatchMarker Marker identifying the event target.
- * @param {object} nativeEvent Native browser event.
- * @extends {SyntheticUIEvent}
- */
-function SyntheticTouchEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
- return SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
-}
-
-SyntheticUIEvent.augmentClass(SyntheticTouchEvent, TouchEventInterface);
-
-module.exports = SyntheticTouchEvent;
-},{"./SyntheticUIEvent":140,"./getEventModifierState":155}],139:[function(require,module,exports){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-'use strict';
-
-var SyntheticEvent = require('./SyntheticEvent');
-
-/**
- * @interface Event
- * @see http://www.w3.org/TR/2009/WD-css3-transitions-20090320/#transition-events-
- * @see https://developer.mozilla.org/en-US/docs/Web/API/TransitionEvent
- */
-var TransitionEventInterface = {
- propertyName: null,
- elapsedTime: null,
- pseudoElement: null
-};
-
-/**
- * @param {object} dispatchConfig Configuration used to dispatch this event.
- * @param {string} dispatchMarker Marker identifying the event target.
- * @param {object} nativeEvent Native browser event.
- * @extends {SyntheticEvent}
- */
-function SyntheticTransitionEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
- return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
-}
-
-SyntheticEvent.augmentClass(SyntheticTransitionEvent, TransitionEventInterface);
-
-module.exports = SyntheticTransitionEvent;
-},{"./SyntheticEvent":133}],140:[function(require,module,exports){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-'use strict';
-
-var SyntheticEvent = require('./SyntheticEvent');
-
-var getEventTarget = require('./getEventTarget');
-
-/**
- * @interface UIEvent
- * @see http://www.w3.org/TR/DOM-Level-3-Events/
- */
-var UIEventInterface = {
- view: function (event) {
- if (event.view) {
- return event.view;
- }
-
- var target = getEventTarget(event);
- if (target.window === target) {
- // target is a window object
- return target;
- }
-
- var doc = target.ownerDocument;
- // TODO: Figure out why `ownerDocument` is sometimes undefined in IE8.
- if (doc) {
- return doc.defaultView || doc.parentWindow;
- } else {
- return window;
- }
- },
- detail: function (event) {
- return event.detail || 0;
- }
-};
-
-/**
- * @param {object} dispatchConfig Configuration used to dispatch this event.
- * @param {string} dispatchMarker Marker identifying the event target.
- * @param {object} nativeEvent Native browser event.
- * @extends {SyntheticEvent}
- */
-function SyntheticUIEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
- return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
-}
-
-SyntheticEvent.augmentClass(SyntheticUIEvent, UIEventInterface);
-
-module.exports = SyntheticUIEvent;
-},{"./SyntheticEvent":133,"./getEventTarget":156}],141:[function(require,module,exports){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-'use strict';
-
-var SyntheticMouseEvent = require('./SyntheticMouseEvent');
-
-/**
- * @interface WheelEvent
- * @see http://www.w3.org/TR/DOM-Level-3-Events/
- */
-var WheelEventInterface = {
- deltaX: function (event) {
- return 'deltaX' in event ? event.deltaX :
- // Fallback to `wheelDeltaX` for Webkit and normalize (right is positive).
- 'wheelDeltaX' in event ? -event.wheelDeltaX : 0;
- },
- deltaY: function (event) {
- return 'deltaY' in event ? event.deltaY :
- // Fallback to `wheelDeltaY` for Webkit and normalize (down is positive).
- 'wheelDeltaY' in event ? -event.wheelDeltaY :
- // Fallback to `wheelDelta` for IE<9 and normalize (down is positive).
- 'wheelDelta' in event ? -event.wheelDelta : 0;
- },
- deltaZ: null,
-
- // Browsers without "deltaMode" is reporting in raw wheel delta where one
- // notch on the scroll is always +/- 120, roughly equivalent to pixels.
- // A good approximation of DOM_DELTA_LINE (1) is 5% of viewport size or
- // ~40 pixels, for DOM_DELTA_SCREEN (2) it is 87.5% of viewport size.
- deltaMode: null
-};
-
-/**
- * @param {object} dispatchConfig Configuration used to dispatch this event.
- * @param {string} dispatchMarker Marker identifying the event target.
- * @param {object} nativeEvent Native browser event.
- * @extends {SyntheticMouseEvent}
- */
-function SyntheticWheelEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
- return SyntheticMouseEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
-}
-
-SyntheticMouseEvent.augmentClass(SyntheticWheelEvent, WheelEventInterface);
-
-module.exports = SyntheticWheelEvent;
-},{"./SyntheticMouseEvent":137}],142:[function(require,module,exports){
-(function (process){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- *
- */
-
-'use strict';
-
-var _prodInvariant = require('./reactProdInvariant');
-
-var invariant = require('fbjs/lib/invariant');
-
-var OBSERVED_ERROR = {};
-
-/**
- * `Transaction` creates a black box that is able to wrap any method such that
- * certain invariants are maintained before and after the method is invoked
- * (Even if an exception is thrown while invoking the wrapped method). Whoever
- * instantiates a transaction can provide enforcers of the invariants at
- * creation time. The `Transaction` class itself will supply one additional
- * automatic invariant for you - the invariant that any transaction instance
- * should not be run while it is already being run. You would typically create a
- * single instance of a `Transaction` for reuse multiple times, that potentially
- * is used to wrap several different methods. Wrappers are extremely simple -
- * they only require implementing two methods.
- *
- * <pre>
- * wrappers (injected at creation time)
- * + +
- * | |
- * +-----------------|--------|--------------+
- * | v | |
- * | +---------------+ | |
- * | +--| wrapper1 |---|----+ |
- * | | +---------------+ v | |
- * | | +-------------+ | |
- * | | +----| wrapper2 |--------+ |
- * | | | +-------------+ | | |
- * | | | | | |
- * | v v v v | wrapper
- * | +---+ +---+ +---------+ +---+ +---+ | invariants
- * perform(anyMethod) | | | | | | | | | | | | maintained
- * +----------------->|-|---|-|---|-->|anyMethod|---|---|-|---|-|-------->
- * | | | | | | | | | | | |
- * | | | | | | | | | | | |
- * | | | | | | | | | | | |
- * | +---+ +---+ +---------+ +---+ +---+ |
- * | initialize close |
- * +-----------------------------------------+
- * </pre>
- *
- * Use cases:
- * - Preserving the input selection ranges before/after reconciliation.
- * Restoring selection even in the event of an unexpected error.
- * - Deactivating events while rearranging the DOM, preventing blurs/focuses,
- * while guaranteeing that afterwards, the event system is reactivated.
- * - Flushing a queue of collected DOM mutations to the main UI thread after a
- * reconciliation takes place in a worker thread.
- * - Invoking any collected `componentDidUpdate` callbacks after rendering new
- * content.
- * - (Future use case): Wrapping particular flushes of the `ReactWorker` queue
- * to preserve the `scrollTop` (an automatic scroll aware DOM).
- * - (Future use case): Layout calculations before and after DOM updates.
- *
- * Transactional plugin API:
- * - A module that has an `initialize` method that returns any precomputation.
- * - and a `close` method that accepts the precomputation. `close` is invoked
- * when the wrapped process is completed, or has failed.
- *
- * @param {Array<TransactionalWrapper>} transactionWrapper Wrapper modules
- * that implement `initialize` and `close`.
- * @return {Transaction} Single transaction for reuse in thread.
- *
- * @class Transaction
- */
-var TransactionImpl = {
- /**
- * Sets up this instance so that it is prepared for collecting metrics. Does
- * so such that this setup method may be used on an instance that is already
- * initialized, in a way that does not consume additional memory upon reuse.
- * That can be useful if you decide to make your subclass of this mixin a
- * "PooledClass".
- */
- reinitializeTransaction: function () {
- this.transactionWrappers = this.getTransactionWrappers();
- if (this.wrapperInitData) {
- this.wrapperInitData.length = 0;
- } else {
- this.wrapperInitData = [];
- }
- this._isInTransaction = false;
- },
-
- _isInTransaction: false,
-
- /**
- * @abstract
- * @return {Array<TransactionWrapper>} Array of transaction wrappers.
- */
- getTransactionWrappers: null,
-
- isInTransaction: function () {
- return !!this._isInTransaction;
- },
-
- /**
- * Executes the function within a safety window. Use this for the top level
- * methods that result in large amounts of computation/mutations that would
- * need to be safety checked. The optional arguments helps prevent the need
- * to bind in many cases.
- *
- * @param {function} method Member of scope to call.
- * @param {Object} scope Scope to invoke from.
- * @param {Object?=} a Argument to pass to the method.
- * @param {Object?=} b Argument to pass to the method.
- * @param {Object?=} c Argument to pass to the method.
- * @param {Object?=} d Argument to pass to the method.
- * @param {Object?=} e Argument to pass to the method.
- * @param {Object?=} f Argument to pass to the method.
- *
- * @return {*} Return value from `method`.
- */
- perform: function (method, scope, a, b, c, d, e, f) {
- !!this.isInTransaction() ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Transaction.perform(...): Cannot initialize a transaction when there is already an outstanding transaction.') : _prodInvariant('27') : void 0;
- var errorThrown;
- var ret;
- try {
- this._isInTransaction = true;
- // Catching errors makes debugging more difficult, so we start with
- // errorThrown set to true before setting it to false after calling
- // close -- if it's still set to true in the finally block, it means
- // one of these calls threw.
- errorThrown = true;
- this.initializeAll(0);
- ret = method.call(scope, a, b, c, d, e, f);
- errorThrown = false;
- } finally {
- try {
- if (errorThrown) {
- // If `method` throws, prefer to show that stack trace over any thrown
- // by invoking `closeAll`.
- try {
- this.closeAll(0);
- } catch (err) {}
- } else {
- // Since `method` didn't throw, we don't want to silence the exception
- // here.
- this.closeAll(0);
- }
- } finally {
- this._isInTransaction = false;
- }
- }
- return ret;
- },
-
- initializeAll: function (startIndex) {
- var transactionWrappers = this.transactionWrappers;
- for (var i = startIndex; i < transactionWrappers.length; i++) {
- var wrapper = transactionWrappers[i];
- try {
- // Catching errors makes debugging more difficult, so we start with the
- // OBSERVED_ERROR state before overwriting it with the real return value
- // of initialize -- if it's still set to OBSERVED_ERROR in the finally
- // block, it means wrapper.initialize threw.
- this.wrapperInitData[i] = OBSERVED_ERROR;
- this.wrapperInitData[i] = wrapper.initialize ? wrapper.initialize.call(this) : null;
- } finally {
- if (this.wrapperInitData[i] === OBSERVED_ERROR) {
- // The initializer for wrapper i threw an error; initialize the
- // remaining wrappers but silence any exceptions from them to ensure
- // that the first error is the one to bubble up.
- try {
- this.initializeAll(i + 1);
- } catch (err) {}
- }
- }
- }
- },
-
- /**
- * Invokes each of `this.transactionWrappers.close[i]` functions, passing into
- * them the respective return values of `this.transactionWrappers.init[i]`
- * (`close`rs that correspond to initializers that failed will not be
- * invoked).
- */
- closeAll: function (startIndex) {
- !this.isInTransaction() ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Transaction.closeAll(): Cannot close transaction when none are open.') : _prodInvariant('28') : void 0;
- var transactionWrappers = this.transactionWrappers;
- for (var i = startIndex; i < transactionWrappers.length; i++) {
- var wrapper = transactionWrappers[i];
- var initData = this.wrapperInitData[i];
- var errorThrown;
- try {
- // Catching errors makes debugging more difficult, so we start with
- // errorThrown set to true before setting it to false after calling
- // close -- if it's still set to true in the finally block, it means
- // wrapper.close threw.
- errorThrown = true;
- if (initData !== OBSERVED_ERROR && wrapper.close) {
- wrapper.close.call(this, initData);
- }
- errorThrown = false;
- } finally {
- if (errorThrown) {
- // The closer for wrapper i threw an error; close the remaining
- // wrappers but silence any exceptions from them to ensure that the
- // first error is the one to bubble up.
- try {
- this.closeAll(i + 1);
- } catch (e) {}
- }
- }
- }
- this.wrapperInitData.length = 0;
- }
-};
-
-module.exports = TransactionImpl;
-}).call(this,require('_process'))
-
-},{"./reactProdInvariant":167,"_process":43,"fbjs/lib/invariant":18}],143:[function(require,module,exports){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-'use strict';
-
-var ViewportMetrics = {
-
- currentScrollLeft: 0,
-
- currentScrollTop: 0,
-
- refreshScrollValues: function (scrollPosition) {
- ViewportMetrics.currentScrollLeft = scrollPosition.x;
- ViewportMetrics.currentScrollTop = scrollPosition.y;
- }
-
-};
-
-module.exports = ViewportMetrics;
-},{}],144:[function(require,module,exports){
-(function (process){
-/**
- * Copyright 2014-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- *
- */
-
-'use strict';
-
-var _prodInvariant = require('./reactProdInvariant');
-
-var invariant = require('fbjs/lib/invariant');
-
-/**
- * Accumulates items that must not be null or undefined into the first one. This
- * is used to conserve memory by avoiding array allocations, and thus sacrifices
- * API cleanness. Since `current` can be null before being passed in and not
- * null after this function, make sure to assign it back to `current`:
- *
- * `a = accumulateInto(a, b);`
- *
- * This API should be sparingly used. Try `accumulate` for something cleaner.
- *
- * @return {*|array<*>} An accumulation of items.
- */
-
-function accumulateInto(current, next) {
- !(next != null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'accumulateInto(...): Accumulated items must not be null or undefined.') : _prodInvariant('30') : void 0;
-
- if (current == null) {
- return next;
- }
-
- // Both are not empty. Warning: Never call x.concat(y) when you are not
- // certain that x is an Array (x could be a string with concat method).
- if (Array.isArray(current)) {
- if (Array.isArray(next)) {
- current.push.apply(current, next);
- return current;
- }
- current.push(next);
- return current;
- }
-
- if (Array.isArray(next)) {
- // A bit too dangerous to mutate `next`.
- return [current].concat(next);
- }
-
- return [current, next];
-}
-
-module.exports = accumulateInto;
-}).call(this,require('_process'))
-
-},{"./reactProdInvariant":167,"_process":43,"fbjs/lib/invariant":18}],145:[function(require,module,exports){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- *
- */
-
-'use strict';
-
-var MOD = 65521;
-
-// adler32 is not cryptographically strong, and is only used to sanity check that
-// markup generated on the server matches the markup generated on the client.
-// This implementation (a modified version of the SheetJS version) has been optimized
-// for our use case, at the expense of conforming to the adler32 specification
-// for non-ascii inputs.
-function adler32(data) {
- var a = 1;
- var b = 0;
- var i = 0;
- var l = data.length;
- var m = l & ~0x3;
- while (i < m) {
- var n = Math.min(i + 4096, m);
- for (; i < n; i += 4) {
- b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));
- }
- a %= MOD;
- b %= MOD;
- }
- for (; i < l; i++) {
- b += a += data.charCodeAt(i);
- }
- a %= MOD;
- b %= MOD;
- return a | b << 16;
-}
-
-module.exports = adler32;
-},{}],146:[function(require,module,exports){
-(function (process){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-'use strict';
-
-var _prodInvariant = require('./reactProdInvariant');
-
-var ReactPropTypeLocationNames = require('./ReactPropTypeLocationNames');
-var ReactPropTypesSecret = require('./ReactPropTypesSecret');
-
-var invariant = require('fbjs/lib/invariant');
-var warning = require('fbjs/lib/warning');
-
-var ReactComponentTreeHook;
-
-if (typeof process !== 'undefined' && process.env && process.env.NODE_ENV === 'test') {
- // Temporary hack.
- // Inline requires don't work well with Jest:
- // https://github.com/facebook/react/issues/7240
- // Remove the inline requires when we don't need them anymore:
- // https://github.com/facebook/react/pull/7178
- ReactComponentTreeHook = require('react/lib/ReactComponentTreeHook');
-}
-
-var loggedTypeFailures = {};
-
-/**
- * Assert that the values match with the type specs.
- * Error messages are memorized and will only be shown once.
- *
- * @param {object} typeSpecs Map of name to a ReactPropType
- * @param {object} values Runtime values that need to be type-checked
- * @param {string} location e.g. "prop", "context", "child context"
- * @param {string} componentName Name of the component for error messages.
- * @param {?object} element The React element that is being type-checked
- * @param {?number} debugID The React component instance that is being type-checked
- * @private
- */
-function checkReactTypeSpec(typeSpecs, values, location, componentName, element, debugID) {
- for (var typeSpecName in typeSpecs) {
- if (typeSpecs.hasOwnProperty(typeSpecName)) {
- var error;
- // Prop type validation may throw. In case they do, we don't want to
- // fail the render phase where it didn't fail before. So we log it.
- // After these have been cleaned up, we'll let them throw.
- try {
- // This is intentionally an invariant that gets caught. It's the same
- // behavior as without this statement except with a better message.
- !(typeof typeSpecs[typeSpecName] === 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s: %s type `%s` is invalid; it must be a function, usually from React.PropTypes.', componentName || 'React class', ReactPropTypeLocationNames[location], typeSpecName) : _prodInvariant('84', componentName || 'React class', ReactPropTypeLocationNames[location], typeSpecName) : void 0;
- error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
- } catch (ex) {
- error = ex;
- }
- process.env.NODE_ENV !== 'production' ? warning(!error || error instanceof Error, '%s: type specification of %s `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', ReactPropTypeLocationNames[location], typeSpecName, typeof error) : void 0;
- if (error instanceof Error && !(error.message in loggedTypeFailures)) {
- // Only monitor this failure once because there tends to be a lot of the
- // same error.
- loggedTypeFailures[error.message] = true;
-
- var componentStackInfo = '';
-
- if (process.env.NODE_ENV !== 'production') {
- if (!ReactComponentTreeHook) {
- ReactComponentTreeHook = require('react/lib/ReactComponentTreeHook');
- }
- if (debugID !== null) {
- componentStackInfo = ReactComponentTreeHook.getStackAddendumByID(debugID);
- } else if (element !== null) {
- componentStackInfo = ReactComponentTreeHook.getCurrentStackAddendum(element);
- }
- }
-
- process.env.NODE_ENV !== 'production' ? warning(false, 'Failed %s type: %s%s', location, error.message, componentStackInfo) : void 0;
- }
- }
- }
-}
-
-module.exports = checkReactTypeSpec;
-}).call(this,require('_process'))
-
-},{"./ReactPropTypeLocationNames":116,"./ReactPropTypesSecret":117,"./reactProdInvariant":167,"_process":43,"fbjs/lib/invariant":18,"fbjs/lib/warning":25,"react/lib/ReactComponentTreeHook":194}],147:[function(require,module,exports){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-/* globals MSApp */
-
-'use strict';
-
-/**
- * Create a function which has 'unsafe' privileges (required by windows8 apps)
- */
-
-var createMicrosoftUnsafeLocalFunction = function (func) {
- if (typeof MSApp !== 'undefined' && MSApp.execUnsafeLocalFunction) {
- return function (arg0, arg1, arg2, arg3) {
- MSApp.execUnsafeLocalFunction(function () {
- return func(arg0, arg1, arg2, arg3);
- });
- };
- } else {
- return func;
- }
-};
-
-module.exports = createMicrosoftUnsafeLocalFunction;
-},{}],148:[function(require,module,exports){
-(function (process){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-'use strict';
-
-var CSSProperty = require('./CSSProperty');
-var warning = require('fbjs/lib/warning');
-
-var isUnitlessNumber = CSSProperty.isUnitlessNumber;
-var styleWarnings = {};
-
-/**
- * Convert a value into the proper css writable value. The style name `name`
- * should be logical (no hyphens), as specified
- * in `CSSProperty.isUnitlessNumber`.
- *
- * @param {string} name CSS property name such as `topMargin`.
- * @param {*} value CSS property value such as `10px`.
- * @param {ReactDOMComponent} component
- * @return {string} Normalized style value with dimensions applied.
- */
-function dangerousStyleValue(name, value, component) {
- // Note that we've removed escapeTextForBrowser() calls here since the
- // whole string will be escaped when the attribute is injected into
- // the markup. If you provide unsafe user data here they can inject
- // arbitrary CSS which may be problematic (I couldn't repro this):
- // https://www.owasp.org/index.php/XSS_Filter_Evasion_Cheat_Sheet
- // http://www.thespanner.co.uk/2007/11/26/ultimate-xss-css-injection/
- // This is not an XSS hole but instead a potential CSS injection issue
- // which has lead to a greater discussion about how we're going to
- // trust URLs moving forward. See #2115901
-
- var isEmpty = value == null || typeof value === 'boolean' || value === '';
- if (isEmpty) {
- return '';
- }
-
- var isNonNumeric = isNaN(value);
- if (isNonNumeric || value === 0 || isUnitlessNumber.hasOwnProperty(name) && isUnitlessNumber[name]) {
- return '' + value; // cast to string
- }
-
- if (typeof value === 'string') {
- if (process.env.NODE_ENV !== 'production') {
- // Allow '0' to pass through without warning. 0 is already special and
- // doesn't require units, so we don't need to warn about it.
- if (component && value !== '0') {
- var owner = component._currentElement._owner;
- var ownerName = owner ? owner.getName() : null;
- if (ownerName && !styleWarnings[ownerName]) {
- styleWarnings[ownerName] = {};
- }
- var warned = false;
- if (ownerName) {
- var warnings = styleWarnings[ownerName];
- warned = warnings[name];
- if (!warned) {
- warnings[name] = true;
- }
- }
- if (!warned) {
- process.env.NODE_ENV !== 'production' ? warning(false, 'a `%s` tag (owner: `%s`) was passed a numeric string value ' + 'for CSS property `%s` (value: `%s`) which will be treated ' + 'as a unitless number in a future version of React.', component._currentElement.type, ownerName || 'unknown', name, value) : void 0;
- }
- }
- }
- value = value.trim();
- }
- return value + 'px';
-}
-
-module.exports = dangerousStyleValue;
-}).call(this,require('_process'))
-
-},{"./CSSProperty":51,"_process":43,"fbjs/lib/warning":25}],149:[function(require,module,exports){
-/**
- * Copyright 2016-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- * Based on the escape-html library, which is used under the MIT License below:
- *
- * Copyright (c) 2012-2013 TJ Holowaychuk
- * Copyright (c) 2015 Andreas Lubbe
- * Copyright (c) 2015 Tiancheng "Timothy" Gu
- *
- * 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.
- *
- */
-
-'use strict';
-
-// code copied and modified from escape-html
-/**
- * Module variables.
- * @private
- */
-
-var matchHtmlRegExp = /["'&<>]/;
-
-/**
- * Escape special characters in the given string of html.
- *
- * @param {string} string The string to escape for inserting into HTML
- * @return {string}
- * @public
- */
-
-function escapeHtml(string) {
- var str = '' + string;
- var match = matchHtmlRegExp.exec(str);
-
- if (!match) {
- return str;
- }
-
- var escape;
- var html = '';
- var index = 0;
- var lastIndex = 0;
-
- for (index = match.index; index < str.length; index++) {
- switch (str.charCodeAt(index)) {
- case 34:
- // "
- escape = '&quot;';
- break;
- case 38:
- // &
- escape = '&amp;';
- break;
- case 39:
- // '
- escape = '&#x27;'; // modified from escape-html; used to be '&#39'
- break;
- case 60:
- // <
- escape = '&lt;';
- break;
- case 62:
- // >
- escape = '&gt;';
- break;
- default:
- continue;
- }
-
- if (lastIndex !== index) {
- html += str.substring(lastIndex, index);
- }
-
- lastIndex = index + 1;
- html += escape;
- }
-
- return lastIndex !== index ? html + str.substring(lastIndex, index) : html;
-}
-// end code copied and modified from escape-html
-
-
-/**
- * Escapes text to prevent scripting attacks.
- *
- * @param {*} text Text value to escape.
- * @return {string} An escaped string.
- */
-function escapeTextContentForBrowser(text) {
- if (typeof text === 'boolean' || typeof text === 'number') {
- // this shortcircuit helps perf for types that we know will never have
- // special characters, especially given that this function is used often
- // for numeric dom ids.
- return '' + text;
- }
- return escapeHtml(text);
-}
-
-module.exports = escapeTextContentForBrowser;
-},{}],150:[function(require,module,exports){
-(function (process){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-'use strict';
-
-var _prodInvariant = require('./reactProdInvariant');
-
-var ReactCurrentOwner = require('react/lib/ReactCurrentOwner');
-var ReactDOMComponentTree = require('./ReactDOMComponentTree');
-var ReactInstanceMap = require('./ReactInstanceMap');
-
-var getHostComponentFromComposite = require('./getHostComponentFromComposite');
-var invariant = require('fbjs/lib/invariant');
-var warning = require('fbjs/lib/warning');
-
-/**
- * Returns the DOM node rendered by this element.
- *
- * See https://facebook.github.io/react/docs/top-level-api.html#reactdom.finddomnode
- *
- * @param {ReactComponent|DOMElement} componentOrElement
- * @return {?DOMElement} The root node of this element.
- */
-function findDOMNode(componentOrElement) {
- if (process.env.NODE_ENV !== 'production') {
- var owner = ReactCurrentOwner.current;
- if (owner !== null) {
- process.env.NODE_ENV !== 'production' ? warning(owner._warnedAboutRefsInRender, '%s is accessing findDOMNode inside its render(). ' + 'render() should be a pure function of props and state. It should ' + 'never access something that requires stale data from the previous ' + 'render, such as refs. Move this logic to componentDidMount and ' + 'componentDidUpdate instead.', owner.getName() || 'A component') : void 0;
- owner._warnedAboutRefsInRender = true;
- }
- }
- if (componentOrElement == null) {
- return null;
- }
- if (componentOrElement.nodeType === 1) {
- return componentOrElement;
- }
-
- var inst = ReactInstanceMap.get(componentOrElement);
- if (inst) {
- inst = getHostComponentFromComposite(inst);
- return inst ? ReactDOMComponentTree.getNodeFromInstance(inst) : null;
- }
-
- if (typeof componentOrElement.render === 'function') {
- !false ? process.env.NODE_ENV !== 'production' ? invariant(false, 'findDOMNode was called on an unmounted component.') : _prodInvariant('44') : void 0;
- } else {
- !false ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Element appears to be neither ReactComponent nor DOMNode (keys: %s)', Object.keys(componentOrElement)) : _prodInvariant('45', Object.keys(componentOrElement)) : void 0;
- }
-}
-
-module.exports = findDOMNode;
-}).call(this,require('_process'))
-
-},{"./ReactDOMComponentTree":80,"./ReactInstanceMap":108,"./getHostComponentFromComposite":157,"./reactProdInvariant":167,"_process":43,"fbjs/lib/invariant":18,"fbjs/lib/warning":25,"react/lib/ReactCurrentOwner":195}],151:[function(require,module,exports){
-(function (process){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- *
- */
-
-'use strict';
-
-var KeyEscapeUtils = require('./KeyEscapeUtils');
-var traverseAllChildren = require('./traverseAllChildren');
-var warning = require('fbjs/lib/warning');
-
-var ReactComponentTreeHook;
-
-if (typeof process !== 'undefined' && process.env && process.env.NODE_ENV === 'test') {
- // Temporary hack.
- // Inline requires don't work well with Jest:
- // https://github.com/facebook/react/issues/7240
- // Remove the inline requires when we don't need them anymore:
- // https://github.com/facebook/react/pull/7178
- ReactComponentTreeHook = require('react/lib/ReactComponentTreeHook');
-}
-
-/**
- * @param {function} traverseContext Context passed through traversal.
- * @param {?ReactComponent} child React child component.
- * @param {!string} name String name of key path to child.
- * @param {number=} selfDebugID Optional debugID of the current internal instance.
- */
-function flattenSingleChildIntoContext(traverseContext, child, name, selfDebugID) {
- // We found a component instance.
- if (traverseContext && typeof traverseContext === 'object') {
- var result = traverseContext;
- var keyUnique = result[name] === undefined;
- if (process.env.NODE_ENV !== 'production') {
- if (!ReactComponentTreeHook) {
- ReactComponentTreeHook = require('react/lib/ReactComponentTreeHook');
- }
- if (!keyUnique) {
- process.env.NODE_ENV !== 'production' ? warning(false, 'flattenChildren(...): Encountered two children with the same key, ' + '`%s`. Child keys must be unique; when two children share a key, only ' + 'the first child will be used.%s', KeyEscapeUtils.unescape(name), ReactComponentTreeHook.getStackAddendumByID(selfDebugID)) : void 0;
- }
- }
- if (keyUnique && child != null) {
- result[name] = child;
- }
- }
-}
-
-/**
- * Flattens children that are typically specified as `props.children`. Any null
- * children will not be included in the resulting object.
- * @return {!object} flattened children keyed by name.
- */
-function flattenChildren(children, selfDebugID) {
- if (children == null) {
- return children;
- }
- var result = {};
-
- if (process.env.NODE_ENV !== 'production') {
- traverseAllChildren(children, function (traverseContext, child, name) {
- return flattenSingleChildIntoContext(traverseContext, child, name, selfDebugID);
- }, result);
- } else {
- traverseAllChildren(children, flattenSingleChildIntoContext, result);
- }
- return result;
-}
-
-module.exports = flattenChildren;
-}).call(this,require('_process'))
-
-},{"./KeyEscapeUtils":69,"./traverseAllChildren":172,"_process":43,"fbjs/lib/warning":25,"react/lib/ReactComponentTreeHook":194}],152:[function(require,module,exports){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- *
- */
-
-'use strict';
-
-/**
- * @param {array} arr an "accumulation" of items which is either an Array or
- * a single item. Useful when paired with the `accumulate` module. This is a
- * simple utility that allows us to reason about a collection of items, but
- * handling the case when there is exactly one item (and we do not need to
- * allocate an array).
- */
-
-function forEachAccumulated(arr, cb, scope) {
- if (Array.isArray(arr)) {
- arr.forEach(cb, scope);
- } else if (arr) {
- cb.call(scope, arr);
- }
-}
-
-module.exports = forEachAccumulated;
-},{}],153:[function(require,module,exports){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-'use strict';
-
-/**
- * `charCode` represents the actual "character code" and is safe to use with
- * `String.fromCharCode`. As such, only keys that correspond to printable
- * characters produce a valid `charCode`, the only exception to this is Enter.
- * The Tab-key is considered non-printable and does not have a `charCode`,
- * presumably because it does not produce a tab-character in browsers.
- *
- * @param {object} nativeEvent Native browser event.
- * @return {number} Normalized `charCode` property.
- */
-
-function getEventCharCode(nativeEvent) {
- var charCode;
- var keyCode = nativeEvent.keyCode;
-
- if ('charCode' in nativeEvent) {
- charCode = nativeEvent.charCode;
-
- // FF does not set `charCode` for the Enter-key, check against `keyCode`.
- if (charCode === 0 && keyCode === 13) {
- charCode = 13;
- }
- } else {
- // IE8 does not implement `charCode`, but `keyCode` has the correct value.
- charCode = keyCode;
- }
-
- // Some non-printable keys are reported in `charCode`/`keyCode`, discard them.
- // Must not discard the (non-)printable Enter-key.
- if (charCode >= 32 || charCode === 13) {
- return charCode;
- }
-
- return 0;
-}
-
-module.exports = getEventCharCode;
-},{}],154:[function(require,module,exports){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-'use strict';
-
-var getEventCharCode = require('./getEventCharCode');
-
-/**
- * Normalization of deprecated HTML5 `key` values
- * @see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent#Key_names
- */
-var normalizeKey = {
- 'Esc': 'Escape',
- 'Spacebar': ' ',
- 'Left': 'ArrowLeft',
- 'Up': 'ArrowUp',
- 'Right': 'ArrowRight',
- 'Down': 'ArrowDown',
- 'Del': 'Delete',
- 'Win': 'OS',
- 'Menu': 'ContextMenu',
- 'Apps': 'ContextMenu',
- 'Scroll': 'ScrollLock',
- 'MozPrintableKey': 'Unidentified'
-};
-
-/**
- * Translation from legacy `keyCode` to HTML5 `key`
- * Only special keys supported, all others depend on keyboard layout or browser
- * @see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent#Key_names
- */
-var translateToKey = {
- 8: 'Backspace',
- 9: 'Tab',
- 12: 'Clear',
- 13: 'Enter',
- 16: 'Shift',
- 17: 'Control',
- 18: 'Alt',
- 19: 'Pause',
- 20: 'CapsLock',
- 27: 'Escape',
- 32: ' ',
- 33: 'PageUp',
- 34: 'PageDown',
- 35: 'End',
- 36: 'Home',
- 37: 'ArrowLeft',
- 38: 'ArrowUp',
- 39: 'ArrowRight',
- 40: 'ArrowDown',
- 45: 'Insert',
- 46: 'Delete',
- 112: 'F1', 113: 'F2', 114: 'F3', 115: 'F4', 116: 'F5', 117: 'F6',
- 118: 'F7', 119: 'F8', 120: 'F9', 121: 'F10', 122: 'F11', 123: 'F12',
- 144: 'NumLock',
- 145: 'ScrollLock',
- 224: 'Meta'
-};
-
-/**
- * @param {object} nativeEvent Native browser event.
- * @return {string} Normalized `key` property.
- */
-function getEventKey(nativeEvent) {
- if (nativeEvent.key) {
- // Normalize inconsistent values reported by browsers due to
- // implementations of a working draft specification.
-
- // FireFox implements `key` but returns `MozPrintableKey` for all
- // printable characters (normalized to `Unidentified`), ignore it.
- var key = normalizeKey[nativeEvent.key] || nativeEvent.key;
- if (key !== 'Unidentified') {
- return key;
- }
- }
-
- // Browser does not implement `key`, polyfill as much of it as we can.
- if (nativeEvent.type === 'keypress') {
- var charCode = getEventCharCode(nativeEvent);
-
- // The enter-key is technically both printable and non-printable and can
- // thus be captured by `keypress`, no other non-printable key should.
- return charCode === 13 ? 'Enter' : String.fromCharCode(charCode);
- }
- if (nativeEvent.type === 'keydown' || nativeEvent.type === 'keyup') {
- // While user keyboard layout determines the actual meaning of each
- // `keyCode` value, almost all function keys have a universal value.
- return translateToKey[nativeEvent.keyCode] || 'Unidentified';
- }
- return '';
-}
-
-module.exports = getEventKey;
-},{"./getEventCharCode":153}],155:[function(require,module,exports){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-'use strict';
-
-/**
- * Translation from modifier key to the associated property in the event.
- * @see http://www.w3.org/TR/DOM-Level-3-Events/#keys-Modifiers
- */
-
-var modifierKeyToProp = {
- 'Alt': 'altKey',
- 'Control': 'ctrlKey',
- 'Meta': 'metaKey',
- 'Shift': 'shiftKey'
-};
-
-// IE8 does not implement getModifierState so we simply map it to the only
-// modifier keys exposed by the event itself, does not support Lock-keys.
-// Currently, all major browsers except Chrome seems to support Lock-keys.
-function modifierStateGetter(keyArg) {
- var syntheticEvent = this;
- var nativeEvent = syntheticEvent.nativeEvent;
- if (nativeEvent.getModifierState) {
- return nativeEvent.getModifierState(keyArg);
- }
- var keyProp = modifierKeyToProp[keyArg];
- return keyProp ? !!nativeEvent[keyProp] : false;
-}
-
-function getEventModifierState(nativeEvent) {
- return modifierStateGetter;
-}
-
-module.exports = getEventModifierState;
-},{}],156:[function(require,module,exports){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-'use strict';
-
-/**
- * Gets the target node from a native browser event by accounting for
- * inconsistencies in browser DOM APIs.
- *
- * @param {object} nativeEvent Native browser event.
- * @return {DOMEventTarget} Target node.
- */
-
-function getEventTarget(nativeEvent) {
- var target = nativeEvent.target || nativeEvent.srcElement || window;
-
- // Normalize SVG <use> element events #4963
- if (target.correspondingUseElement) {
- target = target.correspondingUseElement;
- }
-
- // Safari may fire events on text nodes (Node.TEXT_NODE is 3).
- // @see http://www.quirksmode.org/js/events_properties.html
- return target.nodeType === 3 ? target.parentNode : target;
-}
-
-module.exports = getEventTarget;
-},{}],157:[function(require,module,exports){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-'use strict';
-
-var ReactNodeTypes = require('./ReactNodeTypes');
-
-function getHostComponentFromComposite(inst) {
- var type;
-
- while ((type = inst._renderedNodeType) === ReactNodeTypes.COMPOSITE) {
- inst = inst._renderedComponent;
- }
-
- if (type === ReactNodeTypes.HOST) {
- return inst._renderedComponent;
- } else if (type === ReactNodeTypes.EMPTY) {
- return null;
- }
-}
-
-module.exports = getHostComponentFromComposite;
-},{"./ReactNodeTypes":114}],158:[function(require,module,exports){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- *
- */
-
-'use strict';
-
-/* global Symbol */
-
-var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
-var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
-
-/**
- * Returns the iterator method function contained on the iterable object.
- *
- * Be sure to invoke the function with the iterable as context:
- *
- * var iteratorFn = getIteratorFn(myIterable);
- * if (iteratorFn) {
- * var iterator = iteratorFn.call(myIterable);
- * ...
- * }
- *
- * @param {?object} maybeIterable
- * @return {?function}
- */
-function getIteratorFn(maybeIterable) {
- var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
- if (typeof iteratorFn === 'function') {
- return iteratorFn;
- }
-}
-
-module.exports = getIteratorFn;
-},{}],159:[function(require,module,exports){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- *
- */
-
-'use strict';
-
-var nextDebugID = 1;
-
-function getNextDebugID() {
- return nextDebugID++;
-}
-
-module.exports = getNextDebugID;
-},{}],160:[function(require,module,exports){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-'use strict';
-
-/**
- * Given any node return the first leaf node without children.
- *
- * @param {DOMElement|DOMTextNode} node
- * @return {DOMElement|DOMTextNode}
- */
-
-function getLeafNode(node) {
- while (node && node.firstChild) {
- node = node.firstChild;
- }
- return node;
-}
-
-/**
- * Get the next sibling within a container. This will walk up the
- * DOM if a node's siblings have been exhausted.
- *
- * @param {DOMElement|DOMTextNode} node
- * @return {?DOMElement|DOMTextNode}
- */
-function getSiblingNode(node) {
- while (node) {
- if (node.nextSibling) {
- return node.nextSibling;
- }
- node = node.parentNode;
- }
-}
-
-/**
- * Get object describing the nodes which contain characters at offset.
- *
- * @param {DOMElement|DOMTextNode} root
- * @param {number} offset
- * @return {?object}
- */
-function getNodeForCharacterOffset(root, offset) {
- var node = getLeafNode(root);
- var nodeStart = 0;
- var nodeEnd = 0;
-
- while (node) {
- if (node.nodeType === 3) {
- nodeEnd = nodeStart + node.textContent.length;
-
- if (nodeStart <= offset && nodeEnd >= offset) {
- return {
- node: node,
- offset: offset - nodeStart
- };
- }
-
- nodeStart = nodeEnd;
- }
-
- node = getLeafNode(getSiblingNode(node));
- }
-}
-
-module.exports = getNodeForCharacterOffset;
-},{}],161:[function(require,module,exports){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-'use strict';
-
-var ExecutionEnvironment = require('fbjs/lib/ExecutionEnvironment');
-
-var contentKey = null;
-
-/**
- * Gets the key used to access text content on a DOM node.
- *
- * @return {?string} Key used to access text content.
- * @internal
- */
-function getTextContentAccessor() {
- if (!contentKey && ExecutionEnvironment.canUseDOM) {
- // Prefer textContent to innerText because many browsers support both but
- // SVG <text> elements don't support innerText even when <div> does.
- contentKey = 'textContent' in document.documentElement ? 'textContent' : 'innerText';
- }
- return contentKey;
-}
-
-module.exports = getTextContentAccessor;
-},{"fbjs/lib/ExecutionEnvironment":4}],162:[function(require,module,exports){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-'use strict';
-
-var ExecutionEnvironment = require('fbjs/lib/ExecutionEnvironment');
-
-/**
- * Generate a mapping of standard vendor prefixes using the defined style property and event name.
- *
- * @param {string} styleProp
- * @param {string} eventName
- * @returns {object}
- */
-function makePrefixMap(styleProp, eventName) {
- var prefixes = {};
-
- prefixes[styleProp.toLowerCase()] = eventName.toLowerCase();
- prefixes['Webkit' + styleProp] = 'webkit' + eventName;
- prefixes['Moz' + styleProp] = 'moz' + eventName;
- prefixes['ms' + styleProp] = 'MS' + eventName;
- prefixes['O' + styleProp] = 'o' + eventName.toLowerCase();
-
- return prefixes;
-}
-
-/**
- * A list of event names to a configurable list of vendor prefixes.
- */
-var vendorPrefixes = {
- animationend: makePrefixMap('Animation', 'AnimationEnd'),
- animationiteration: makePrefixMap('Animation', 'AnimationIteration'),
- animationstart: makePrefixMap('Animation', 'AnimationStart'),
- transitionend: makePrefixMap('Transition', 'TransitionEnd')
-};
-
-/**
- * Event names that have already been detected and prefixed (if applicable).
- */
-var prefixedEventNames = {};
-
-/**
- * Element to check for prefixes on.
- */
-var style = {};
-
-/**
- * Bootstrap if a DOM exists.
- */
-if (ExecutionEnvironment.canUseDOM) {
- style = document.createElement('div').style;
-
- // On some platforms, in particular some releases of Android 4.x,
- // the un-prefixed "animation" and "transition" properties are defined on the
- // style object but the events that fire will still be prefixed, so we need
- // to check if the un-prefixed events are usable, and if not remove them from the map.
- if (!('AnimationEvent' in window)) {
- delete vendorPrefixes.animationend.animation;
- delete vendorPrefixes.animationiteration.animation;
- delete vendorPrefixes.animationstart.animation;
- }
-
- // Same as above
- if (!('TransitionEvent' in window)) {
- delete vendorPrefixes.transitionend.transition;
- }
-}
-
-/**
- * Attempts to determine the correct vendor prefixed event name.
- *
- * @param {string} eventName
- * @returns {string}
- */
-function getVendorPrefixedEventName(eventName) {
- if (prefixedEventNames[eventName]) {
- return prefixedEventNames[eventName];
- } else if (!vendorPrefixes[eventName]) {
- return eventName;
- }
-
- var prefixMap = vendorPrefixes[eventName];
-
- for (var styleProp in prefixMap) {
- if (prefixMap.hasOwnProperty(styleProp) && styleProp in style) {
- return prefixedEventNames[eventName] = prefixMap[styleProp];
- }
- }
-
- return '';
-}
-
-module.exports = getVendorPrefixedEventName;
-},{"fbjs/lib/ExecutionEnvironment":4}],163:[function(require,module,exports){
-(function (process){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-'use strict';
-
-var _prodInvariant = require('./reactProdInvariant'),
- _assign = require('object-assign');
-
-var ReactCompositeComponent = require('./ReactCompositeComponent');
-var ReactEmptyComponent = require('./ReactEmptyComponent');
-var ReactHostComponent = require('./ReactHostComponent');
-
-var getNextDebugID = require('./getNextDebugID');
-var invariant = require('fbjs/lib/invariant');
-var warning = require('fbjs/lib/warning');
-
-// To avoid a cyclic dependency, we create the final class in this module
-var ReactCompositeComponentWrapper = function (element) {
- this.construct(element);
-};
-_assign(ReactCompositeComponentWrapper.prototype, ReactCompositeComponent, {
- _instantiateReactComponent: instantiateReactComponent
-});
-
-function getDeclarationErrorAddendum(owner) {
- if (owner) {
- var name = owner.getName();
- if (name) {
- return ' Check the render method of `' + name + '`.';
- }
- }
- return '';
-}
-
-/**
- * Check if the type reference is a known internal type. I.e. not a user
- * provided composite type.
- *
- * @param {function} type
- * @return {boolean} Returns true if this is a valid internal type.
- */
-function isInternalComponentType(type) {
- return typeof type === 'function' && typeof type.prototype !== 'undefined' && typeof type.prototype.mountComponent === 'function' && typeof type.prototype.receiveComponent === 'function';
-}
-
-/**
- * Given a ReactNode, create an instance that will actually be mounted.
- *
- * @param {ReactNode} node
- * @param {boolean} shouldHaveDebugID
- * @return {object} A new instance of the element's constructor.
- * @protected
- */
-function instantiateReactComponent(node, shouldHaveDebugID) {
- var instance;
-
- if (node === null || node === false) {
- instance = ReactEmptyComponent.create(instantiateReactComponent);
- } else if (typeof node === 'object') {
- var element = node;
- var type = element.type;
- if (typeof type !== 'function' && typeof type !== 'string') {
- var info = '';
- if (process.env.NODE_ENV !== 'production') {
- if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
- info += ' You likely forgot to export your component from the file ' + 'it\'s defined in.';
- }
- }
- info += getDeclarationErrorAddendum(element._owner);
- !false ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s', type == null ? type : typeof type, info) : _prodInvariant('130', type == null ? type : typeof type, info) : void 0;
- }
-
- // Special case string values
- if (typeof element.type === 'string') {
- instance = ReactHostComponent.createInternalComponent(element);
- } else if (isInternalComponentType(element.type)) {
- // This is temporarily available for custom components that are not string
- // representations. I.e. ART. Once those are updated to use the string
- // representation, we can drop this code path.
- instance = new element.type(element);
-
- // We renamed this. Allow the old name for compat. :(
- if (!instance.getHostNode) {
- instance.getHostNode = instance.getNativeNode;
- }
- } else {
- instance = new ReactCompositeComponentWrapper(element);
- }
- } else if (typeof node === 'string' || typeof node === 'number') {
- instance = ReactHostComponent.createInstanceForText(node);
- } else {
- !false ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Encountered invalid React node of type %s', typeof node) : _prodInvariant('131', typeof node) : void 0;
- }
-
- if (process.env.NODE_ENV !== 'production') {
- process.env.NODE_ENV !== 'production' ? warning(typeof instance.mountComponent === 'function' && typeof instance.receiveComponent === 'function' && typeof instance.getHostNode === 'function' && typeof instance.unmountComponent === 'function', 'Only React Components can be mounted.') : void 0;
- }
-
- // These two fields are used by the DOM and ART diffing algorithms
- // respectively. Instead of using expandos on components, we should be
- // storing the state needed by the diffing algorithms elsewhere.
- instance._mountIndex = 0;
- instance._mountImage = null;
-
- if (process.env.NODE_ENV !== 'production') {
- instance._debugID = shouldHaveDebugID ? getNextDebugID() : 0;
- }
-
- // Internal instances should fully constructed at this point, so they should
- // not get any new fields added to them at this point.
- if (process.env.NODE_ENV !== 'production') {
- if (Object.preventExtensions) {
- Object.preventExtensions(instance);
- }
- }
-
- return instance;
-}
-
-module.exports = instantiateReactComponent;
-}).call(this,require('_process'))
-
-},{"./ReactCompositeComponent":76,"./ReactEmptyComponent":99,"./ReactHostComponent":104,"./getNextDebugID":159,"./reactProdInvariant":167,"_process":43,"fbjs/lib/invariant":18,"fbjs/lib/warning":25,"object-assign":42}],164:[function(require,module,exports){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-'use strict';
-
-var ExecutionEnvironment = require('fbjs/lib/ExecutionEnvironment');
-
-var useHasFeature;
-if (ExecutionEnvironment.canUseDOM) {
- useHasFeature = document.implementation && document.implementation.hasFeature &&
- // always returns true in newer browsers as per the standard.
- // @see http://dom.spec.whatwg.org/#dom-domimplementation-hasfeature
- document.implementation.hasFeature('', '') !== true;
-}
-
-/**
- * Checks if an event is supported in the current execution environment.
- *
- * NOTE: This will not work correctly for non-generic events such as `change`,
- * `reset`, `load`, `error`, and `select`.
- *
- * Borrows from Modernizr.
- *
- * @param {string} eventNameSuffix Event name, e.g. "click".
- * @param {?boolean} capture Check if the capture phase is supported.
- * @return {boolean} True if the event is supported.
- * @internal
- * @license Modernizr 3.0.0pre (Custom Build) | MIT
- */
-function isEventSupported(eventNameSuffix, capture) {
- if (!ExecutionEnvironment.canUseDOM || capture && !('addEventListener' in document)) {
- return false;
- }
-
- var eventName = 'on' + eventNameSuffix;
- var isSupported = eventName in document;
-
- if (!isSupported) {
- var element = document.createElement('div');
- element.setAttribute(eventName, 'return;');
- isSupported = typeof element[eventName] === 'function';
- }
-
- if (!isSupported && useHasFeature && eventNameSuffix === 'wheel') {
- // This is the only way to test support for the `wheel` event in IE9+.
- isSupported = document.implementation.hasFeature('Events.wheel', '3.0');
- }
-
- return isSupported;
-}
-
-module.exports = isEventSupported;
-},{"fbjs/lib/ExecutionEnvironment":4}],165:[function(require,module,exports){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- *
- */
-
-'use strict';
-
-/**
- * @see http://www.whatwg.org/specs/web-apps/current-work/multipage/the-input-element.html#input-type-attr-summary
- */
-
-var supportedInputTypes = {
- 'color': true,
- 'date': true,
- 'datetime': true,
- 'datetime-local': true,
- 'email': true,
- 'month': true,
- 'number': true,
- 'password': true,
- 'range': true,
- 'search': true,
- 'tel': true,
- 'text': true,
- 'time': true,
- 'url': true,
- 'week': true
-};
-
-function isTextInputElement(elem) {
- var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();
-
- if (nodeName === 'input') {
- return !!supportedInputTypes[elem.type];
- }
-
- if (nodeName === 'textarea') {
- return true;
- }
-
- return false;
-}
-
-module.exports = isTextInputElement;
-},{}],166:[function(require,module,exports){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-'use strict';
-
-var escapeTextContentForBrowser = require('./escapeTextContentForBrowser');
-
-/**
- * Escapes attribute value to prevent scripting attacks.
- *
- * @param {*} value Value to escape.
- * @return {string} An escaped string.
- */
-function quoteAttributeValueForBrowser(value) {
- return '"' + escapeTextContentForBrowser(value) + '"';
-}
-
-module.exports = quoteAttributeValueForBrowser;
-},{"./escapeTextContentForBrowser":149}],167:[function(require,module,exports){
-/**
- * Copyright (c) 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- *
- */
-'use strict';
-
-/**
- * WARNING: DO NOT manually require this module.
- * This is a replacement for `invariant(...)` used by the error code system
- * and will _only_ be required by the corresponding babel pass.
- * It always throws.
- */
-
-function reactProdInvariant(code) {
- var argCount = arguments.length - 1;
-
- var message = 'Minified React error #' + code + '; visit ' + 'http://facebook.github.io/react/docs/error-decoder.html?invariant=' + code;
-
- for (var argIdx = 0; argIdx < argCount; argIdx++) {
- message += '&args[]=' + encodeURIComponent(arguments[argIdx + 1]);
- }
-
- message += ' for the full message or use the non-minified dev environment' + ' for full errors and additional helpful warnings.';
-
- var error = new Error(message);
- error.name = 'Invariant Violation';
- error.framesToPop = 1; // we don't care about reactProdInvariant's own frame
-
- throw error;
-}
-
-module.exports = reactProdInvariant;
-},{}],168:[function(require,module,exports){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-'use strict';
-
-var ReactMount = require('./ReactMount');
-
-module.exports = ReactMount.renderSubtreeIntoContainer;
-},{"./ReactMount":112}],169:[function(require,module,exports){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-'use strict';
-
-var ExecutionEnvironment = require('fbjs/lib/ExecutionEnvironment');
-var DOMNamespaces = require('./DOMNamespaces');
-
-var WHITESPACE_TEST = /^[ \r\n\t\f]/;
-var NONVISIBLE_TEST = /<(!--|link|noscript|meta|script|style)[ \r\n\t\f\/>]/;
-
-var createMicrosoftUnsafeLocalFunction = require('./createMicrosoftUnsafeLocalFunction');
-
-// SVG temp container for IE lacking innerHTML
-var reusableSVGContainer;
-
-/**
- * Set the innerHTML property of a node, ensuring that whitespace is preserved
- * even in IE8.
- *
- * @param {DOMElement} node
- * @param {string} html
- * @internal
- */
-var setInnerHTML = createMicrosoftUnsafeLocalFunction(function (node, html) {
- // IE does not have innerHTML for SVG nodes, so instead we inject the
- // new markup in a temp node and then move the child nodes across into
- // the target node
- if (node.namespaceURI === DOMNamespaces.svg && !('innerHTML' in node)) {
- reusableSVGContainer = reusableSVGContainer || document.createElement('div');
- reusableSVGContainer.innerHTML = '<svg>' + html + '</svg>';
- var svgNode = reusableSVGContainer.firstChild;
- while (svgNode.firstChild) {
- node.appendChild(svgNode.firstChild);
- }
- } else {
- node.innerHTML = html;
- }
-});
-
-if (ExecutionEnvironment.canUseDOM) {
- // IE8: When updating a just created node with innerHTML only leading
- // whitespace is removed. When updating an existing node with innerHTML
- // whitespace in root TextNodes is also collapsed.
- // @see quirksmode.org/bugreports/archives/2004/11/innerhtml_and_t.html
-
- // Feature detection; only IE8 is known to behave improperly like this.
- var testElement = document.createElement('div');
- testElement.innerHTML = ' ';
- if (testElement.innerHTML === '') {
- setInnerHTML = function (node, html) {
- // Magic theory: IE8 supposedly differentiates between added and updated
- // nodes when processing innerHTML, innerHTML on updated nodes suffers
- // from worse whitespace behavior. Re-adding a node like this triggers
- // the initial and more favorable whitespace behavior.
- // TODO: What to do on a detached node?
- if (node.parentNode) {
- node.parentNode.replaceChild(node, node);
- }
-
- // We also implement a workaround for non-visible tags disappearing into
- // thin air on IE8, this only happens if there is no visible text
- // in-front of the non-visible tags. Piggyback on the whitespace fix
- // and simply check if any non-visible tags appear in the source.
- if (WHITESPACE_TEST.test(html) || html[0] === '<' && NONVISIBLE_TEST.test(html)) {
- // Recover leading whitespace by temporarily prepending any character.
- // \uFEFF has the potential advantage of being zero-width/invisible.
- // UglifyJS drops U+FEFF chars when parsing, so use String.fromCharCode
- // in hopes that this is preserved even if "\uFEFF" is transformed to
- // the actual Unicode character (by Babel, for example).
- // https://github.com/mishoo/UglifyJS2/blob/v2.4.20/lib/parse.js#L216
- node.innerHTML = String.fromCharCode(0xFEFF) + html;
-
- // deleteData leaves an empty `TextNode` which offsets the index of all
- // children. Definitely want to avoid this.
- var textNode = node.firstChild;
- if (textNode.data.length === 1) {
- node.removeChild(textNode);
- } else {
- textNode.deleteData(0, 1);
- }
- } else {
- node.innerHTML = html;
- }
- };
- }
- testElement = null;
-}
-
-module.exports = setInnerHTML;
-},{"./DOMNamespaces":57,"./createMicrosoftUnsafeLocalFunction":147,"fbjs/lib/ExecutionEnvironment":4}],170:[function(require,module,exports){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-'use strict';
-
-var ExecutionEnvironment = require('fbjs/lib/ExecutionEnvironment');
-var escapeTextContentForBrowser = require('./escapeTextContentForBrowser');
-var setInnerHTML = require('./setInnerHTML');
-
-/**
- * Set the textContent property of a node, ensuring that whitespace is preserved
- * even in IE8. innerText is a poor substitute for textContent and, among many
- * issues, inserts <br> instead of the literal newline chars. innerHTML behaves
- * as it should.
- *
- * @param {DOMElement} node
- * @param {string} text
- * @internal
- */
-var setTextContent = function (node, text) {
- if (text) {
- var firstChild = node.firstChild;
-
- if (firstChild && firstChild === node.lastChild && firstChild.nodeType === 3) {
- firstChild.nodeValue = text;
- return;
- }
- }
- node.textContent = text;
-};
-
-if (ExecutionEnvironment.canUseDOM) {
- if (!('textContent' in document.documentElement)) {
- setTextContent = function (node, text) {
- if (node.nodeType === 3) {
- node.nodeValue = text;
- return;
- }
- setInnerHTML(node, escapeTextContentForBrowser(text));
- };
- }
-}
-
-module.exports = setTextContent;
-},{"./escapeTextContentForBrowser":149,"./setInnerHTML":169,"fbjs/lib/ExecutionEnvironment":4}],171:[function(require,module,exports){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-'use strict';
-
-/**
- * Given a `prevElement` and `nextElement`, determines if the existing
- * instance should be updated as opposed to being destroyed or replaced by a new
- * instance. Both arguments are elements. This ensures that this logic can
- * operate on stateless trees without any backing instance.
- *
- * @param {?object} prevElement
- * @param {?object} nextElement
- * @return {boolean} True if the existing instance should be updated.
- * @protected
- */
-
-function shouldUpdateReactComponent(prevElement, nextElement) {
- var prevEmpty = prevElement === null || prevElement === false;
- var nextEmpty = nextElement === null || nextElement === false;
- if (prevEmpty || nextEmpty) {
- return prevEmpty === nextEmpty;
- }
-
- var prevType = typeof prevElement;
- var nextType = typeof nextElement;
- if (prevType === 'string' || prevType === 'number') {
- return nextType === 'string' || nextType === 'number';
- } else {
- return nextType === 'object' && prevElement.type === nextElement.type && prevElement.key === nextElement.key;
- }
-}
-
-module.exports = shouldUpdateReactComponent;
-},{}],172:[function(require,module,exports){
-(function (process){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-'use strict';
-
-var _prodInvariant = require('./reactProdInvariant');
-
-var ReactCurrentOwner = require('react/lib/ReactCurrentOwner');
-var REACT_ELEMENT_TYPE = require('./ReactElementSymbol');
-
-var getIteratorFn = require('./getIteratorFn');
-var invariant = require('fbjs/lib/invariant');
-var KeyEscapeUtils = require('./KeyEscapeUtils');
-var warning = require('fbjs/lib/warning');
-
-var SEPARATOR = '.';
-var SUBSEPARATOR = ':';
-
-/**
- * This is inlined from ReactElement since this file is shared between
- * isomorphic and renderers. We could extract this to a
- *
- */
-
-/**
- * TODO: Test that a single child and an array with one item have the same key
- * pattern.
- */
-
-var didWarnAboutMaps = false;
-
-/**
- * Generate a key string that identifies a component within a set.
- *
- * @param {*} component A component that could contain a manual key.
- * @param {number} index Index that is used if a manual key is not provided.
- * @return {string}
- */
-function getComponentKey(component, index) {
- // Do some typechecking here since we call this blindly. We want to ensure
- // that we don't block potential future ES APIs.
- if (component && typeof component === 'object' && component.key != null) {
- // Explicit key
- return KeyEscapeUtils.escape(component.key);
- }
- // Implicit key determined by the index in the set
- return index.toString(36);
-}
-
-/**
- * @param {?*} children Children tree container.
- * @param {!string} nameSoFar Name of the key path so far.
- * @param {!function} callback Callback to invoke with each child found.
- * @param {?*} traverseContext Used to pass information throughout the traversal
- * process.
- * @return {!number} The number of children in this subtree.
- */
-function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext) {
- var type = typeof children;
-
- if (type === 'undefined' || type === 'boolean') {
- // All of the above are perceived as null.
- children = null;
- }
-
- if (children === null || type === 'string' || type === 'number' ||
- // The following is inlined from ReactElement. This means we can optimize
- // some checks. React Fiber also inlines this logic for similar purposes.
- type === 'object' && children.$$typeof === REACT_ELEMENT_TYPE) {
- callback(traverseContext, children,
- // If it's the only child, treat the name as if it was wrapped in an array
- // so that it's consistent if the number of children grows.
- nameSoFar === '' ? SEPARATOR + getComponentKey(children, 0) : nameSoFar);
- return 1;
- }
-
- var child;
- var nextName;
- var subtreeCount = 0; // Count of children found in the current subtree.
- var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR;
-
- if (Array.isArray(children)) {
- for (var i = 0; i < children.length; i++) {
- child = children[i];
- nextName = nextNamePrefix + getComponentKey(child, i);
- subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
- }
- } else {
- var iteratorFn = getIteratorFn(children);
- if (iteratorFn) {
- var iterator = iteratorFn.call(children);
- var step;
- if (iteratorFn !== children.entries) {
- var ii = 0;
- while (!(step = iterator.next()).done) {
- child = step.value;
- nextName = nextNamePrefix + getComponentKey(child, ii++);
- subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
- }
- } else {
- if (process.env.NODE_ENV !== 'production') {
- var mapsAsChildrenAddendum = '';
- if (ReactCurrentOwner.current) {
- var mapsAsChildrenOwnerName = ReactCurrentOwner.current.getName();
- if (mapsAsChildrenOwnerName) {
- mapsAsChildrenAddendum = ' Check the render method of `' + mapsAsChildrenOwnerName + '`.';
- }
- }
- process.env.NODE_ENV !== 'production' ? warning(didWarnAboutMaps, 'Using Maps as children is not yet fully supported. It is an ' + 'experimental feature that might be removed. Convert it to a ' + 'sequence / iterable of keyed ReactElements instead.%s', mapsAsChildrenAddendum) : void 0;
- didWarnAboutMaps = true;
- }
- // Iterator will provide entry [k,v] tuples rather than values.
- while (!(step = iterator.next()).done) {
- var entry = step.value;
- if (entry) {
- child = entry[1];
- nextName = nextNamePrefix + KeyEscapeUtils.escape(entry[0]) + SUBSEPARATOR + getComponentKey(child, 0);
- subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
- }
- }
- }
- } else if (type === 'object') {
- var addendum = '';
- if (process.env.NODE_ENV !== 'production') {
- addendum = ' If you meant to render a collection of children, use an array ' + 'instead or wrap the object using createFragment(object) from the ' + 'React add-ons.';
- if (children._isReactElement) {
- addendum = ' It looks like you\'re using an element created by a different ' + 'version of React. Make sure to use only one copy of React.';
- }
- if (ReactCurrentOwner.current) {
- var name = ReactCurrentOwner.current.getName();
- if (name) {
- addendum += ' Check the render method of `' + name + '`.';
- }
- }
- }
- var childrenString = String(children);
- !false ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Objects are not valid as a React child (found: %s).%s', childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString, addendum) : _prodInvariant('31', childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString, addendum) : void 0;
- }
- }
-
- return subtreeCount;
-}
-
-/**
- * Traverses children that are typically specified as `props.children`, but
- * might also be specified through attributes:
- *
- * - `traverseAllChildren(this.props.children, ...)`
- * - `traverseAllChildren(this.props.leftPanelChildren, ...)`
- *
- * The `traverseContext` is an optional argument that is passed through the
- * entire traversal. It can be used to store accumulations or anything else that
- * the callback might find relevant.
- *
- * @param {?*} children Children tree object.
- * @param {!function} callback To invoke upon traversing each child.
- * @param {?*} traverseContext Context for traversal.
- * @return {!number} The number of children in this subtree.
- */
-function traverseAllChildren(children, callback, traverseContext) {
- if (children == null) {
- return 0;
- }
-
- return traverseAllChildrenImpl(children, '', callback, traverseContext);
-}
-
-module.exports = traverseAllChildren;
-}).call(this,require('_process'))
-
-},{"./KeyEscapeUtils":69,"./ReactElementSymbol":98,"./getIteratorFn":158,"./reactProdInvariant":167,"_process":43,"fbjs/lib/invariant":18,"fbjs/lib/warning":25,"react/lib/ReactCurrentOwner":195}],173:[function(require,module,exports){
-(function (process){
-/**
- * Copyright 2015-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-'use strict';
-
-var _assign = require('object-assign');
-
-var emptyFunction = require('fbjs/lib/emptyFunction');
-var warning = require('fbjs/lib/warning');
-
-var validateDOMNesting = emptyFunction;
-
-if (process.env.NODE_ENV !== 'production') {
- // This validation code was written based on the HTML5 parsing spec:
- // https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-scope
- //
- // Note: this does not catch all invalid nesting, nor does it try to (as it's
- // not clear what practical benefit doing so provides); instead, we warn only
- // for cases where the parser will give a parse tree differing from what React
- // intended. For example, <b><div></div></b> is invalid but we don't warn
- // because it still parses correctly; we do warn for other cases like nested
- // <p> tags where the beginning of the second element implicitly closes the
- // first, causing a confusing mess.
-
- // https://html.spec.whatwg.org/multipage/syntax.html#special
- var specialTags = ['address', 'applet', 'area', 'article', 'aside', 'base', 'basefont', 'bgsound', 'blockquote', 'body', 'br', 'button', 'caption', 'center', 'col', 'colgroup', 'dd', 'details', 'dir', 'div', 'dl', 'dt', 'embed', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'frame', 'frameset', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'iframe', 'img', 'input', 'isindex', 'li', 'link', 'listing', 'main', 'marquee', 'menu', 'menuitem', 'meta', 'nav', 'noembed', 'noframes', 'noscript', 'object', 'ol', 'p', 'param', 'plaintext', 'pre', 'script', 'section', 'select', 'source', 'style', 'summary', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'title', 'tr', 'track', 'ul', 'wbr', 'xmp'];
-
- // https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-scope
- var inScopeTags = ['applet', 'caption', 'html', 'table', 'td', 'th', 'marquee', 'object', 'template',
-
- // https://html.spec.whatwg.org/multipage/syntax.html#html-integration-point
- // TODO: Distinguish by namespace here -- for <title>, including it here
- // errs on the side of fewer warnings
- 'foreignObject', 'desc', 'title'];
-
- // https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-button-scope
- var buttonScopeTags = inScopeTags.concat(['button']);
-
- // https://html.spec.whatwg.org/multipage/syntax.html#generate-implied-end-tags
- var impliedEndTags = ['dd', 'dt', 'li', 'option', 'optgroup', 'p', 'rp', 'rt'];
-
- var emptyAncestorInfo = {
- current: null,
-
- formTag: null,
- aTagInScope: null,
- buttonTagInScope: null,
- nobrTagInScope: null,
- pTagInButtonScope: null,
-
- listItemTagAutoclosing: null,
- dlItemTagAutoclosing: null
- };
-
- var updatedAncestorInfo = function (oldInfo, tag, instance) {
- var ancestorInfo = _assign({}, oldInfo || emptyAncestorInfo);
- var info = { tag: tag, instance: instance };
-
- if (inScopeTags.indexOf(tag) !== -1) {
- ancestorInfo.aTagInScope = null;
- ancestorInfo.buttonTagInScope = null;
- ancestorInfo.nobrTagInScope = null;
- }
- if (buttonScopeTags.indexOf(tag) !== -1) {
- ancestorInfo.pTagInButtonScope = null;
- }
-
- // See rules for 'li', 'dd', 'dt' start tags in
- // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inbody
- if (specialTags.indexOf(tag) !== -1 && tag !== 'address' && tag !== 'div' && tag !== 'p') {
- ancestorInfo.listItemTagAutoclosing = null;
- ancestorInfo.dlItemTagAutoclosing = null;
- }
-
- ancestorInfo.current = info;
-
- if (tag === 'form') {
- ancestorInfo.formTag = info;
- }
- if (tag === 'a') {
- ancestorInfo.aTagInScope = info;
- }
- if (tag === 'button') {
- ancestorInfo.buttonTagInScope = info;
- }
- if (tag === 'nobr') {
- ancestorInfo.nobrTagInScope = info;
- }
- if (tag === 'p') {
- ancestorInfo.pTagInButtonScope = info;
- }
- if (tag === 'li') {
- ancestorInfo.listItemTagAutoclosing = info;
- }
- if (tag === 'dd' || tag === 'dt') {
- ancestorInfo.dlItemTagAutoclosing = info;
- }
-
- return ancestorInfo;
- };
-
- /**
- * Returns whether
- */
- var isTagValidWithParent = function (tag, parentTag) {
- // First, let's check if we're in an unusual parsing mode...
- switch (parentTag) {
- // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inselect
- case 'select':
- return tag === 'option' || tag === 'optgroup' || tag === '#text';
- case 'optgroup':
- return tag === 'option' || tag === '#text';
- // Strictly speaking, seeing an <option> doesn't mean we're in a <select>
- // but
- case 'option':
- return tag === '#text';
-
- // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intd
- // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-incaption
- // No special behavior since these rules fall back to "in body" mode for
- // all except special table nodes which cause bad parsing behavior anyway.
-
- // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intr
- case 'tr':
- return tag === 'th' || tag === 'td' || tag === 'style' || tag === 'script' || tag === 'template';
-
- // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intbody
- case 'tbody':
- case 'thead':
- case 'tfoot':
- return tag === 'tr' || tag === 'style' || tag === 'script' || tag === 'template';
-
- // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-incolgroup
- case 'colgroup':
- return tag === 'col' || tag === 'template';
-
- // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intable
- case 'table':
- return tag === 'caption' || tag === 'colgroup' || tag === 'tbody' || tag === 'tfoot' || tag === 'thead' || tag === 'style' || tag === 'script' || tag === 'template';
-
- // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inhead
- case 'head':
- return tag === 'base' || tag === 'basefont' || tag === 'bgsound' || tag === 'link' || tag === 'meta' || tag === 'title' || tag === 'noscript' || tag === 'noframes' || tag === 'style' || tag === 'script' || tag === 'template';
-
- // https://html.spec.whatwg.org/multipage/semantics.html#the-html-element
- case 'html':
- return tag === 'head' || tag === 'body';
- case '#document':
- return tag === 'html';
- }
-
- // Probably in the "in body" parsing mode, so we outlaw only tag combos
- // where the parsing rules cause implicit opens or closes to be added.
- // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inbody
- switch (tag) {
- case 'h1':
- case 'h2':
- case 'h3':
- case 'h4':
- case 'h5':
- case 'h6':
- return parentTag !== 'h1' && parentTag !== 'h2' && parentTag !== 'h3' && parentTag !== 'h4' && parentTag !== 'h5' && parentTag !== 'h6';
-
- case 'rp':
- case 'rt':
- return impliedEndTags.indexOf(parentTag) === -1;
-
- case 'body':
- case 'caption':
- case 'col':
- case 'colgroup':
- case 'frame':
- case 'head':
- case 'html':
- case 'tbody':
- case 'td':
- case 'tfoot':
- case 'th':
- case 'thead':
- case 'tr':
- // These tags are only valid with a few parents that have special child
- // parsing rules -- if we're down here, then none of those matched and
- // so we allow it only if we don't know what the parent is, as all other
- // cases are invalid.
- return parentTag == null;
- }
-
- return true;
- };
-
- /**
- * Returns whether
- */
- var findInvalidAncestorForTag = function (tag, ancestorInfo) {
- switch (tag) {
- case 'address':
- case 'article':
- case 'aside':
- case 'blockquote':
- case 'center':
- case 'details':
- case 'dialog':
- case 'dir':
- case 'div':
- case 'dl':
- case 'fieldset':
- case 'figcaption':
- case 'figure':
- case 'footer':
- case 'header':
- case 'hgroup':
- case 'main':
- case 'menu':
- case 'nav':
- case 'ol':
- case 'p':
- case 'section':
- case 'summary':
- case 'ul':
-
- case 'pre':
- case 'listing':
-
- case 'table':
-
- case 'hr':
-
- case 'xmp':
-
- case 'h1':
- case 'h2':
- case 'h3':
- case 'h4':
- case 'h5':
- case 'h6':
- return ancestorInfo.pTagInButtonScope;
-
- case 'form':
- return ancestorInfo.formTag || ancestorInfo.pTagInButtonScope;
-
- case 'li':
- return ancestorInfo.listItemTagAutoclosing;
-
- case 'dd':
- case 'dt':
- return ancestorInfo.dlItemTagAutoclosing;
-
- case 'button':
- return ancestorInfo.buttonTagInScope;
-
- case 'a':
- // Spec says something about storing a list of markers, but it sounds
- // equivalent to this check.
- return ancestorInfo.aTagInScope;
-
- case 'nobr':
- return ancestorInfo.nobrTagInScope;
- }
-
- return null;
- };
-
- /**
- * Given a ReactCompositeComponent instance, return a list of its recursive
- * owners, starting at the root and ending with the instance itself.
- */
- var findOwnerStack = function (instance) {
- if (!instance) {
- return [];
- }
-
- var stack = [];
- do {
- stack.push(instance);
- } while (instance = instance._currentElement._owner);
- stack.reverse();
- return stack;
- };
-
- var didWarn = {};
-
- validateDOMNesting = function (childTag, childText, childInstance, ancestorInfo) {
- ancestorInfo = ancestorInfo || emptyAncestorInfo;
- var parentInfo = ancestorInfo.current;
- var parentTag = parentInfo && parentInfo.tag;
-
- if (childText != null) {
- process.env.NODE_ENV !== 'production' ? warning(childTag == null, 'validateDOMNesting: when childText is passed, childTag should be null') : void 0;
- childTag = '#text';
- }
-
- var invalidParent = isTagValidWithParent(childTag, parentTag) ? null : parentInfo;
- var invalidAncestor = invalidParent ? null : findInvalidAncestorForTag(childTag, ancestorInfo);
- var problematic = invalidParent || invalidAncestor;
-
- if (problematic) {
- var ancestorTag = problematic.tag;
- var ancestorInstance = problematic.instance;
-
- var childOwner = childInstance && childInstance._currentElement._owner;
- var ancestorOwner = ancestorInstance && ancestorInstance._currentElement._owner;
-
- var childOwners = findOwnerStack(childOwner);
- var ancestorOwners = findOwnerStack(ancestorOwner);
-
- var minStackLen = Math.min(childOwners.length, ancestorOwners.length);
- var i;
-
- var deepestCommon = -1;
- for (i = 0; i < minStackLen; i++) {
- if (childOwners[i] === ancestorOwners[i]) {
- deepestCommon = i;
- } else {
- break;
- }
- }
-
- var UNKNOWN = '(unknown)';
- var childOwnerNames = childOwners.slice(deepestCommon + 1).map(function (inst) {
- return inst.getName() || UNKNOWN;
- });
- var ancestorOwnerNames = ancestorOwners.slice(deepestCommon + 1).map(function (inst) {
- return inst.getName() || UNKNOWN;
- });
- var ownerInfo = [].concat(
- // If the parent and child instances have a common owner ancestor, start
- // with that -- otherwise we just start with the parent's owners.
- deepestCommon !== -1 ? childOwners[deepestCommon].getName() || UNKNOWN : [], ancestorOwnerNames, ancestorTag,
- // If we're warning about an invalid (non-parent) ancestry, add '...'
- invalidAncestor ? ['...'] : [], childOwnerNames, childTag).join(' > ');
-
- var warnKey = !!invalidParent + '|' + childTag + '|' + ancestorTag + '|' + ownerInfo;
- if (didWarn[warnKey]) {
- return;
- }
- didWarn[warnKey] = true;
-
- var tagDisplayName = childTag;
- var whitespaceInfo = '';
- if (childTag === '#text') {
- if (/\S/.test(childText)) {
- tagDisplayName = 'Text nodes';
- } else {
- tagDisplayName = 'Whitespace text nodes';
- whitespaceInfo = ' Make sure you don\'t have any extra whitespace between tags on ' + 'each line of your source code.';
- }
- } else {
- tagDisplayName = '<' + childTag + '>';
- }
-
- if (invalidParent) {
- var info = '';
- if (ancestorTag === 'table' && childTag === 'tr') {
- info += ' Add a <tbody> to your code to match the DOM tree generated by ' + 'the browser.';
- }
- process.env.NODE_ENV !== 'production' ? warning(false, 'validateDOMNesting(...): %s cannot appear as a child of <%s>.%s ' + 'See %s.%s', tagDisplayName, ancestorTag, whitespaceInfo, ownerInfo, info) : void 0;
- } else {
- process.env.NODE_ENV !== 'production' ? warning(false, 'validateDOMNesting(...): %s cannot appear as a descendant of ' + '<%s>. See %s.', tagDisplayName, ancestorTag, ownerInfo) : void 0;
- }
- }
- };
-
- validateDOMNesting.updatedAncestorInfo = updatedAncestorInfo;
-
- // For testing
- validateDOMNesting.isTagValidInContext = function (tag, ancestorInfo) {
- ancestorInfo = ancestorInfo || emptyAncestorInfo;
- var parentInfo = ancestorInfo.current;
- var parentTag = parentInfo && parentInfo.tag;
- return isTagValidWithParent(tag, parentTag) && !findInvalidAncestorForTag(tag, ancestorInfo);
- };
-}
-
-module.exports = validateDOMNesting;
-}).call(this,require('_process'))
-
-},{"_process":43,"fbjs/lib/emptyFunction":10,"fbjs/lib/warning":25,"object-assign":42}],174:[function(require,module,exports){
-(function (process){
-'use strict';
-
-exports.__esModule = true;
-exports.default = undefined;
-
-var _react = require('react');
-
-var _Subscription = require('../utils/Subscription');
-
-var _Subscription2 = _interopRequireDefault(_Subscription);
-
-var _storeShape = require('../utils/storeShape');
-
-var _storeShape2 = _interopRequireDefault(_storeShape);
-
-var _warning = require('../utils/warning');
-
-var _warning2 = _interopRequireDefault(_warning);
-
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
-function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
-function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
-
-function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
-
-var didWarnAboutReceivingStore = false;
-function warnAboutReceivingStore() {
- if (didWarnAboutReceivingStore) {
- return;
- }
- didWarnAboutReceivingStore = true;
-
- (0, _warning2.default)('<Provider> does not support changing `store` on the fly. ' + 'It is most likely that you see this error because you updated to ' + 'Redux 2.x and React Redux 2.x which no longer hot reload reducers ' + 'automatically. See https://github.com/reactjs/react-redux/releases/' + 'tag/v2.0.0 for the migration instructions.');
-}
-
-var Provider = function (_Component) {
- _inherits(Provider, _Component);
-
- Provider.prototype.getChildContext = function getChildContext() {
- return { store: this.store, storeSubscription: null };
- };
-
- function Provider(props, context) {
- _classCallCheck(this, Provider);
-
- var _this = _possibleConstructorReturn(this, _Component.call(this, props, context));
-
- _this.store = props.store;
- return _this;
- }
-
- Provider.prototype.render = function render() {
- return _react.Children.only(this.props.children);
- };
-
- return Provider;
-}(_react.Component);
-
-exports.default = Provider;
-
-
-if (process.env.NODE_ENV !== 'production') {
- Provider.prototype.componentWillReceiveProps = function (nextProps) {
- var store = this.store;
- var nextStore = nextProps.store;
-
-
- if (store !== nextStore) {
- warnAboutReceivingStore();
- }
- };
-}
-
-Provider.propTypes = {
- store: _storeShape2.default.isRequired,
- children: _react.PropTypes.element.isRequired
-};
-Provider.childContextTypes = {
- store: _storeShape2.default.isRequired,
- storeSubscription: _react.PropTypes.instanceOf(_Subscription2.default)
-};
-Provider.displayName = 'Provider';
-}).call(this,require('_process'))
-
-},{"../utils/Subscription":183,"../utils/storeShape":185,"../utils/warning":187,"_process":43,"react":"react"}],175:[function(require,module,exports){
-(function (process){
-'use strict';
-
-exports.__esModule = true;
-
-var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
-
-exports.default = connectAdvanced;
-
-var _hoistNonReactStatics = require('hoist-non-react-statics');
-
-var _hoistNonReactStatics2 = _interopRequireDefault(_hoistNonReactStatics);
-
-var _invariant = require('invariant');
-
-var _invariant2 = _interopRequireDefault(_invariant);
-
-var _react = require('react');
-
-var _Subscription = require('../utils/Subscription');
-
-var _Subscription2 = _interopRequireDefault(_Subscription);
-
-var _storeShape = require('../utils/storeShape');
-
-var _storeShape2 = _interopRequireDefault(_storeShape);
-
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
-function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
-function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
-
-function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
-
-function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
-
-var hotReloadingVersion = 0;
-function connectAdvanced(
-/*
- selectorFactory is a func that is responsible for returning the selector function used to
- compute new props from state, props, and dispatch. For example:
- export default connectAdvanced((dispatch, options) => (state, props) => ({
- thing: state.things[props.thingId],
- saveThing: fields => dispatch(actionCreators.saveThing(props.thingId, fields)),
- }))(YourComponent)
- Access to dispatch is provided to the factory so selectorFactories can bind actionCreators
- outside of their selector as an optimization. Options passed to connectAdvanced are passed to
- the selectorFactory, along with displayName and WrappedComponent, as the second argument.
- Note that selectorFactory is responsible for all caching/memoization of inbound and outbound
- props. Do not use connectAdvanced directly without memoizing results between calls to your
- selector, otherwise the Connect component will re-render on every state or props change.
-*/
-selectorFactory) {
- var _contextTypes, _childContextTypes;
-
- var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
- _ref$getDisplayName = _ref.getDisplayName,
- getDisplayName = _ref$getDisplayName === undefined ? function (name) {
- return 'ConnectAdvanced(' + name + ')';
- } : _ref$getDisplayName,
- _ref$methodName = _ref.methodName,
- methodName = _ref$methodName === undefined ? 'connectAdvanced' : _ref$methodName,
- _ref$renderCountProp = _ref.renderCountProp,
- renderCountProp = _ref$renderCountProp === undefined ? undefined : _ref$renderCountProp,
- _ref$shouldHandleStat = _ref.shouldHandleStateChanges,
- shouldHandleStateChanges = _ref$shouldHandleStat === undefined ? true : _ref$shouldHandleStat,
- _ref$storeKey = _ref.storeKey,
- storeKey = _ref$storeKey === undefined ? 'store' : _ref$storeKey,
- _ref$withRef = _ref.withRef,
- withRef = _ref$withRef === undefined ? false : _ref$withRef,
- connectOptions = _objectWithoutProperties(_ref, ['getDisplayName', 'methodName', 'renderCountProp', 'shouldHandleStateChanges', 'storeKey', 'withRef']);
-
- var subscriptionKey = storeKey + 'Subscription';
- var version = hotReloadingVersion++;
-
- var contextTypes = (_contextTypes = {}, _contextTypes[storeKey] = _storeShape2.default, _contextTypes[subscriptionKey] = _react.PropTypes.instanceOf(_Subscription2.default), _contextTypes);
- var childContextTypes = (_childContextTypes = {}, _childContextTypes[subscriptionKey] = _react.PropTypes.instanceOf(_Subscription2.default), _childContextTypes);
-
- return function wrapWithConnect(WrappedComponent) {
- (0, _invariant2.default)(typeof WrappedComponent == 'function', 'You must pass a component to the function returned by ' + ('connect. Instead received ' + WrappedComponent));
-
- var wrappedComponentName = WrappedComponent.displayName || WrappedComponent.name || 'Component';
-
- var displayName = getDisplayName(wrappedComponentName);
-
- var selectorFactoryOptions = _extends({}, connectOptions, {
- getDisplayName: getDisplayName,
- methodName: methodName,
- renderCountProp: renderCountProp,
- shouldHandleStateChanges: shouldHandleStateChanges,
- storeKey: storeKey,
- withRef: withRef,
- displayName: displayName,
- wrappedComponentName: wrappedComponentName,
- WrappedComponent: WrappedComponent
- });
-
- var Connect = function (_Component) {
- _inherits(Connect, _Component);
-
- function Connect(props, context) {
- _classCallCheck(this, Connect);
-
- var _this = _possibleConstructorReturn(this, _Component.call(this, props, context));
-
- _this.version = version;
- _this.state = {};
- _this.renderCount = 0;
- _this.store = _this.props[storeKey] || _this.context[storeKey];
- _this.parentSub = props[subscriptionKey] || context[subscriptionKey];
-
- _this.setWrappedInstance = _this.setWrappedInstance.bind(_this);
-
- (0, _invariant2.default)(_this.store, 'Could not find "' + storeKey + '" in either the context or ' + ('props of "' + displayName + '". ') + 'Either wrap the root component in a <Provider>, ' + ('or explicitly pass "' + storeKey + '" as a prop to "' + displayName + '".'));
-
- // make sure `getState` is properly bound in order to avoid breaking
- // custom store implementations that rely on the store's context
- _this.getState = _this.store.getState.bind(_this.store);
-
- _this.initSelector();
- _this.initSubscription();
- return _this;
- }
-
- Connect.prototype.getChildContext = function getChildContext() {
- var _ref2;
-
- return _ref2 = {}, _ref2[subscriptionKey] = this.subscription || this.parentSub, _ref2;
- };
-
- Connect.prototype.componentDidMount = function componentDidMount() {
- if (!shouldHandleStateChanges) return;
-
- // componentWillMount fires during server side rendering, but componentDidMount and
- // componentWillUnmount do not. Because of this, trySubscribe happens during ...didMount.
- // Otherwise, unsubscription would never take place during SSR, causing a memory leak.
- // To handle the case where a child component may have triggered a state change by
- // dispatching an action in its componentWillMount, we have to re-run the select and maybe
- // re-render.
- this.subscription.trySubscribe();
- this.selector.run(this.props);
- if (this.selector.shouldComponentUpdate) this.forceUpdate();
- };
-
- Connect.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
- this.selector.run(nextProps);
- };
-
- Connect.prototype.shouldComponentUpdate = function shouldComponentUpdate() {
- return this.selector.shouldComponentUpdate;
- };
-
- Connect.prototype.componentWillUnmount = function componentWillUnmount() {
- if (this.subscription) this.subscription.tryUnsubscribe();
- // these are just to guard against extra memory leakage if a parent element doesn't
- // dereference this instance properly, such as an async callback that never finishes
- this.subscription = null;
- this.store = null;
- this.parentSub = null;
- this.selector.run = function () {};
- };
-
- Connect.prototype.getWrappedInstance = function getWrappedInstance() {
- (0, _invariant2.default)(withRef, 'To access the wrapped instance, you need to specify ' + ('{ withRef: true } in the options argument of the ' + methodName + '() call.'));
- return this.wrappedInstance;
- };
-
- Connect.prototype.setWrappedInstance = function setWrappedInstance(ref) {
- this.wrappedInstance = ref;
- };
-
- Connect.prototype.initSelector = function initSelector() {
- var dispatch = this.store.dispatch;
- var getState = this.getState;
-
- var sourceSelector = selectorFactory(dispatch, selectorFactoryOptions);
-
- // wrap the selector in an object that tracks its results between runs
- var selector = this.selector = {
- shouldComponentUpdate: true,
- props: sourceSelector(getState(), this.props),
- run: function runComponentSelector(props) {
- try {
- var nextProps = sourceSelector(getState(), props);
- if (selector.error || nextProps !== selector.props) {
- selector.shouldComponentUpdate = true;
- selector.props = nextProps;
- selector.error = null;
- }
- } catch (error) {
- selector.shouldComponentUpdate = true;
- selector.error = error;
- }
- }
- };
- };
-
- Connect.prototype.initSubscription = function initSubscription() {
- var _this2 = this;
-
- if (shouldHandleStateChanges) {
- (function () {
- var subscription = _this2.subscription = new _Subscription2.default(_this2.store, _this2.parentSub);
- var dummyState = {};
-
- subscription.onStateChange = function onStateChange() {
- this.selector.run(this.props);
-
- if (!this.selector.shouldComponentUpdate) {
- subscription.notifyNestedSubs();
- } else {
- this.componentDidUpdate = function componentDidUpdate() {
- this.componentDidUpdate = undefined;
- subscription.notifyNestedSubs();
- };
-
- this.setState(dummyState);
- }
- }.bind(_this2);
- })();
- }
- };
-
- Connect.prototype.isSubscribed = function isSubscribed() {
- return Boolean(this.subscription) && this.subscription.isSubscribed();
- };
-
- Connect.prototype.addExtraProps = function addExtraProps(props) {
- if (!withRef && !renderCountProp) return props;
- // make a shallow copy so that fields added don't leak to the original selector.
- // this is especially important for 'ref' since that's a reference back to the component
- // instance. a singleton memoized selector would then be holding a reference to the
- // instance, preventing the instance from being garbage collected, and that would be bad
- var withExtras = _extends({}, props);
- if (withRef) withExtras.ref = this.setWrappedInstance;
- if (renderCountProp) withExtras[renderCountProp] = this.renderCount++;
- return withExtras;
- };
-
- Connect.prototype.render = function render() {
- var selector = this.selector;
- selector.shouldComponentUpdate = false;
-
- if (selector.error) {
- throw selector.error;
- } else {
- return (0, _react.createElement)(WrappedComponent, this.addExtraProps(selector.props));
- }
- };
-
- return Connect;
- }(_react.Component);
-
- Connect.WrappedComponent = WrappedComponent;
- Connect.displayName = displayName;
- Connect.childContextTypes = childContextTypes;
- Connect.contextTypes = contextTypes;
- Connect.propTypes = contextTypes;
-
- if (process.env.NODE_ENV !== 'production') {
- Connect.prototype.componentWillUpdate = function componentWillUpdate() {
- // We are hot reloading!
- if (this.version !== version) {
- this.version = version;
- this.initSelector();
-
- if (this.subscription) this.subscription.tryUnsubscribe();
- this.initSubscription();
- if (shouldHandleStateChanges) this.subscription.trySubscribe();
- }
- };
- }
-
- return (0, _hoistNonReactStatics2.default)(Connect, WrappedComponent);
- };
-}
-}).call(this,require('_process'))
-
-},{"../utils/Subscription":183,"../utils/storeShape":185,"_process":43,"hoist-non-react-statics":26,"invariant":27,"react":"react"}],176:[function(require,module,exports){
-'use strict';
-
-exports.__esModule = true;
-
-var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
-
-exports.createConnect = createConnect;
-
-var _connectAdvanced = require('../components/connectAdvanced');
-
-var _connectAdvanced2 = _interopRequireDefault(_connectAdvanced);
-
-var _shallowEqual = require('../utils/shallowEqual');
-
-var _shallowEqual2 = _interopRequireDefault(_shallowEqual);
-
-var _mapDispatchToProps = require('./mapDispatchToProps');
-
-var _mapDispatchToProps2 = _interopRequireDefault(_mapDispatchToProps);
-
-var _mapStateToProps = require('./mapStateToProps');
-
-var _mapStateToProps2 = _interopRequireDefault(_mapStateToProps);
-
-var _mergeProps = require('./mergeProps');
-
-var _mergeProps2 = _interopRequireDefault(_mergeProps);
-
-var _selectorFactory = require('./selectorFactory');
-
-var _selectorFactory2 = _interopRequireDefault(_selectorFactory);
-
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
-function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
-
-/*
- connect is a facade over connectAdvanced. It turns its args into a compatible
- selectorFactory, which has the signature:
-
- (dispatch, options) => (nextState, nextOwnProps) => nextFinalProps
-
- connect passes its args to connectAdvanced as options, which will in turn pass them to
- selectorFactory each time a Connect component instance is instantiated or hot reloaded.
-
- selectorFactory returns a final props selector from its mapStateToProps,
- mapStateToPropsFactories, mapDispatchToProps, mapDispatchToPropsFactories, mergeProps,
- mergePropsFactories, and pure args.
-
- The resulting final props selector is called by the Connect component instance whenever
- it receives new props or store state.
- */
-
-function match(arg, factories, name) {
- for (var i = factories.length - 1; i >= 0; i--) {
- var result = factories[i](arg);
- if (result) return result;
- }
-
- return function (dispatch, options) {
- throw new Error('Invalid value of type ' + typeof arg + ' for ' + name + ' argument when connecting component ' + options.wrappedComponentName + '.');
- };
-}
-
-function strictEqual(a, b) {
- return a === b;
-}
-
-// createConnect with default args builds the 'official' connect behavior. Calling it with
-// different options opens up some testing and extensibility scenarios
-function createConnect() {
- var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
- _ref$connectHOC = _ref.connectHOC,
- connectHOC = _ref$connectHOC === undefined ? _connectAdvanced2.default : _ref$connectHOC,
- _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,
- mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? _mapStateToProps2.default : _ref$mapStateToPropsF,
- _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,
- mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? _mapDispatchToProps2.default : _ref$mapDispatchToPro,
- _ref$mergePropsFactor = _ref.mergePropsFactories,
- mergePropsFactories = _ref$mergePropsFactor === undefined ? _mergeProps2.default : _ref$mergePropsFactor,
- _ref$selectorFactory = _ref.selectorFactory,
- selectorFactory = _ref$selectorFactory === undefined ? _selectorFactory2.default : _ref$selectorFactory;
-
- return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {
- var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},
- _ref2$pure = _ref2.pure,
- pure = _ref2$pure === undefined ? true : _ref2$pure,
- _ref2$areStatesEqual = _ref2.areStatesEqual,
- areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,
- _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,
- areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? _shallowEqual2.default : _ref2$areOwnPropsEqua,
- _ref2$areStatePropsEq = _ref2.areStatePropsEqual,
- areStatePropsEqual = _ref2$areStatePropsEq === undefined ? _shallowEqual2.default : _ref2$areStatePropsEq,
- _ref2$areMergedPropsE = _ref2.areMergedPropsEqual,
- areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? _shallowEqual2.default : _ref2$areMergedPropsE,
- extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);
-
- var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');
- var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');
- var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');
-
- return connectHOC(selectorFactory, _extends({
- // used in error messages
- methodName: 'connect',
-
- // used to compute Connect's displayName from the wrapped component's displayName.
- getDisplayName: function getDisplayName(name) {
- return 'Connect(' + name + ')';
- },
-
- // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes
- shouldHandleStateChanges: Boolean(mapStateToProps),
-
- // passed through to selectorFactory
- initMapStateToProps: initMapStateToProps,
- initMapDispatchToProps: initMapDispatchToProps,
- initMergeProps: initMergeProps,
- pure: pure,
- areStatesEqual: areStatesEqual,
- areOwnPropsEqual: areOwnPropsEqual,
- areStatePropsEqual: areStatePropsEqual,
- areMergedPropsEqual: areMergedPropsEqual
-
- }, extraOptions));
- };
-}
-
-exports.default = createConnect();
-},{"../components/connectAdvanced":175,"../utils/shallowEqual":184,"./mapDispatchToProps":177,"./mapStateToProps":178,"./mergeProps":179,"./selectorFactory":180}],177:[function(require,module,exports){
-'use strict';
-
-exports.__esModule = true;
-exports.whenMapDispatchToPropsIsFunction = whenMapDispatchToPropsIsFunction;
-exports.whenMapDispatchToPropsIsMissing = whenMapDispatchToPropsIsMissing;
-exports.whenMapDispatchToPropsIsObject = whenMapDispatchToPropsIsObject;
-
-var _redux = require('redux');
-
-var _wrapMapToProps = require('./wrapMapToProps');
-
-function whenMapDispatchToPropsIsFunction(mapDispatchToProps) {
- return typeof mapDispatchToProps === 'function' ? (0, _wrapMapToProps.wrapMapToPropsFunc)(mapDispatchToProps, 'mapDispatchToProps') : undefined;
-}
-
-function whenMapDispatchToPropsIsMissing(mapDispatchToProps) {
- return !mapDispatchToProps ? (0, _wrapMapToProps.wrapMapToPropsConstant)(function (dispatch) {
- return { dispatch: dispatch };
- }) : undefined;
-}
-
-function whenMapDispatchToPropsIsObject(mapDispatchToProps) {
- return mapDispatchToProps && typeof mapDispatchToProps === 'object' ? (0, _wrapMapToProps.wrapMapToPropsConstant)(function (dispatch) {
- return (0, _redux.bindActionCreators)(mapDispatchToProps, dispatch);
- }) : undefined;
-}
-
-exports.default = [whenMapDispatchToPropsIsFunction, whenMapDispatchToPropsIsMissing, whenMapDispatchToPropsIsObject];
-},{"./wrapMapToProps":182,"redux":"redux"}],178:[function(require,module,exports){
-'use strict';
-
-exports.__esModule = true;
-exports.whenMapStateToPropsIsFunction = whenMapStateToPropsIsFunction;
-exports.whenMapStateToPropsIsMissing = whenMapStateToPropsIsMissing;
-
-var _wrapMapToProps = require('./wrapMapToProps');
-
-function whenMapStateToPropsIsFunction(mapStateToProps) {
- return typeof mapStateToProps === 'function' ? (0, _wrapMapToProps.wrapMapToPropsFunc)(mapStateToProps, 'mapStateToProps') : undefined;
-}
-
-function whenMapStateToPropsIsMissing(mapStateToProps) {
- return !mapStateToProps ? (0, _wrapMapToProps.wrapMapToPropsConstant)(function () {
- return {};
- }) : undefined;
-}
-
-exports.default = [whenMapStateToPropsIsFunction, whenMapStateToPropsIsMissing];
-},{"./wrapMapToProps":182}],179:[function(require,module,exports){
-(function (process){
-'use strict';
-
-exports.__esModule = true;
-
-var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
-
-exports.defaultMergeProps = defaultMergeProps;
-exports.wrapMergePropsFunc = wrapMergePropsFunc;
-exports.whenMergePropsIsFunction = whenMergePropsIsFunction;
-exports.whenMergePropsIsOmitted = whenMergePropsIsOmitted;
-
-var _verifyPlainObject = require('../utils/verifyPlainObject');
-
-var _verifyPlainObject2 = _interopRequireDefault(_verifyPlainObject);
-
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
-function defaultMergeProps(stateProps, dispatchProps, ownProps) {
- return _extends({}, ownProps, stateProps, dispatchProps);
-}
-
-function wrapMergePropsFunc(mergeProps) {
- return function initMergePropsProxy(dispatch, _ref) {
- var displayName = _ref.displayName,
- pure = _ref.pure,
- areMergedPropsEqual = _ref.areMergedPropsEqual;
-
- var hasRunOnce = false;
- var mergedProps = void 0;
-
- return function mergePropsProxy(stateProps, dispatchProps, ownProps) {
- var nextMergedProps = mergeProps(stateProps, dispatchProps, ownProps);
-
- if (hasRunOnce) {
- if (!pure || !areMergedPropsEqual(nextMergedProps, mergedProps)) mergedProps = nextMergedProps;
- } else {
- hasRunOnce = true;
- mergedProps = nextMergedProps;
-
- if (process.env.NODE_ENV !== 'production') (0, _verifyPlainObject2.default)(mergedProps, displayName, 'mergeProps');
- }
-
- return mergedProps;
- };
- };
-}
-
-function whenMergePropsIsFunction(mergeProps) {
- return typeof mergeProps === 'function' ? wrapMergePropsFunc(mergeProps) : undefined;
-}
-
-function whenMergePropsIsOmitted(mergeProps) {
- return !mergeProps ? function () {
- return defaultMergeProps;
- } : undefined;
-}
-
-exports.default = [whenMergePropsIsFunction, whenMergePropsIsOmitted];
-}).call(this,require('_process'))
-
-},{"../utils/verifyPlainObject":186,"_process":43}],180:[function(require,module,exports){
-(function (process){
-'use strict';
-
-exports.__esModule = true;
-exports.impureFinalPropsSelectorFactory = impureFinalPropsSelectorFactory;
-exports.pureFinalPropsSelectorFactory = pureFinalPropsSelectorFactory;
-exports.default = finalPropsSelectorFactory;
-
-var _verifySubselectors = require('./verifySubselectors');
-
-var _verifySubselectors2 = _interopRequireDefault(_verifySubselectors);
-
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
-function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
-
-function impureFinalPropsSelectorFactory(mapStateToProps, mapDispatchToProps, mergeProps, dispatch) {
- return function impureFinalPropsSelector(state, ownProps) {
- return mergeProps(mapStateToProps(state, ownProps), mapDispatchToProps(dispatch, ownProps), ownProps);
- };
-}
-
-function pureFinalPropsSelectorFactory(mapStateToProps, mapDispatchToProps, mergeProps, dispatch, _ref) {
- var areStatesEqual = _ref.areStatesEqual,
- areOwnPropsEqual = _ref.areOwnPropsEqual,
- areStatePropsEqual = _ref.areStatePropsEqual;
-
- var hasRunAtLeastOnce = false;
- var state = void 0;
- var ownProps = void 0;
- var stateProps = void 0;
- var dispatchProps = void 0;
- var mergedProps = void 0;
-
- function handleFirstCall(firstState, firstOwnProps) {
- state = firstState;
- ownProps = firstOwnProps;
- stateProps = mapStateToProps(state, ownProps);
- dispatchProps = mapDispatchToProps(dispatch, ownProps);
- mergedProps = mergeProps(stateProps, dispatchProps, ownProps);
- hasRunAtLeastOnce = true;
- return mergedProps;
- }
-
- function handleNewPropsAndNewState() {
- stateProps = mapStateToProps(state, ownProps);
-
- if (mapDispatchToProps.dependsOnOwnProps) dispatchProps = mapDispatchToProps(dispatch, ownProps);
-
- mergedProps = mergeProps(stateProps, dispatchProps, ownProps);
- return mergedProps;
- }
-
- function handleNewProps() {
- if (mapStateToProps.dependsOnOwnProps) stateProps = mapStateToProps(state, ownProps);
-
- if (mapDispatchToProps.dependsOnOwnProps) dispatchProps = mapDispatchToProps(dispatch, ownProps);
-
- mergedProps = mergeProps(stateProps, dispatchProps, ownProps);
- return mergedProps;
- }
-
- function handleNewState() {
- var nextStateProps = mapStateToProps(state, ownProps);
- var statePropsChanged = !areStatePropsEqual(nextStateProps, stateProps);
- stateProps = nextStateProps;
-
- if (statePropsChanged) mergedProps = mergeProps(stateProps, dispatchProps, ownProps);
-
- return mergedProps;
- }
-
- function handleSubsequentCalls(nextState, nextOwnProps) {
- var propsChanged = !areOwnPropsEqual(nextOwnProps, ownProps);
- var stateChanged = !areStatesEqual(nextState, state);
- state = nextState;
- ownProps = nextOwnProps;
-
- if (propsChanged && stateChanged) return handleNewPropsAndNewState();
- if (propsChanged) return handleNewProps();
- if (stateChanged) return handleNewState();
- return mergedProps;
- }
-
- return function pureFinalPropsSelector(nextState, nextOwnProps) {
- return hasRunAtLeastOnce ? handleSubsequentCalls(nextState, nextOwnProps) : handleFirstCall(nextState, nextOwnProps);
- };
-}
-
-// TODO: Add more comments
-
-// If pure is true, the selector returned by selectorFactory will memoize its results,
-// allowing connectAdvanced's shouldComponentUpdate to return false if final
-// props have not changed. If false, the selector will always return a new
-// object and shouldComponentUpdate will always return true.
-
-function finalPropsSelectorFactory(dispatch, _ref2) {
- var initMapStateToProps = _ref2.initMapStateToProps,
- initMapDispatchToProps = _ref2.initMapDispatchToProps,
- initMergeProps = _ref2.initMergeProps,
- options = _objectWithoutProperties(_ref2, ['initMapStateToProps', 'initMapDispatchToProps', 'initMergeProps']);
-
- var mapStateToProps = initMapStateToProps(dispatch, options);
- var mapDispatchToProps = initMapDispatchToProps(dispatch, options);
- var mergeProps = initMergeProps(dispatch, options);
-
- if (process.env.NODE_ENV !== 'production') {
- (0, _verifySubselectors2.default)(mapStateToProps, mapDispatchToProps, mergeProps, options.displayName);
- }
-
- var selectorFactory = options.pure ? pureFinalPropsSelectorFactory : impureFinalPropsSelectorFactory;
-
- return selectorFactory(mapStateToProps, mapDispatchToProps, mergeProps, dispatch, options);
-}
-}).call(this,require('_process'))
-
-},{"./verifySubselectors":181,"_process":43}],181:[function(require,module,exports){
-'use strict';
-
-exports.__esModule = true;
-exports.default = verifySubselectors;
-
-var _warning = require('../utils/warning');
-
-var _warning2 = _interopRequireDefault(_warning);
-
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
-function verify(selector, methodName, displayName) {
- if (!selector) {
- throw new Error('Unexpected value for ' + methodName + ' in ' + displayName + '.');
- } else if (methodName === 'mapStateToProps' || methodName === 'mapDispatchToProps') {
- if (!selector.hasOwnProperty('dependsOnOwnProps')) {
- (0, _warning2.default)('The selector for ' + methodName + ' of ' + displayName + ' did not specify a value for dependsOnOwnProps.');
- }
- }
-}
-
-function verifySubselectors(mapStateToProps, mapDispatchToProps, mergeProps, displayName) {
- verify(mapStateToProps, 'mapStateToProps', displayName);
- verify(mapDispatchToProps, 'mapDispatchToProps', displayName);
- verify(mergeProps, 'mergeProps', displayName);
-}
-},{"../utils/warning":187}],182:[function(require,module,exports){
-(function (process){
-'use strict';
-
-exports.__esModule = true;
-exports.wrapMapToPropsConstant = wrapMapToPropsConstant;
-exports.getDependsOnOwnProps = getDependsOnOwnProps;
-exports.wrapMapToPropsFunc = wrapMapToPropsFunc;
-
-var _verifyPlainObject = require('../utils/verifyPlainObject');
-
-var _verifyPlainObject2 = _interopRequireDefault(_verifyPlainObject);
-
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
-function wrapMapToPropsConstant(getConstant) {
- return function initConstantSelector(dispatch, options) {
- var constant = getConstant(dispatch, options);
-
- function constantSelector() {
- return constant;
- }
- constantSelector.dependsOnOwnProps = false;
- return constantSelector;
- };
-}
-
-// dependsOnOwnProps is used by createMapToPropsProxy to determine whether to pass props as args
-// to the mapToProps function being wrapped. It is also used by makePurePropsSelector to determine
-// whether mapToProps needs to be invoked when props have changed.
-//
-// A length of one signals that mapToProps does not depend on props from the parent component.
-// A length of zero is assumed to mean mapToProps is getting args via arguments or ...args and
-// therefore not reporting its length accurately..
-function getDependsOnOwnProps(mapToProps) {
- return mapToProps.dependsOnOwnProps !== null && mapToProps.dependsOnOwnProps !== undefined ? Boolean(mapToProps.dependsOnOwnProps) : mapToProps.length !== 1;
-}
-
-// Used by whenMapStateToPropsIsFunction and whenMapDispatchToPropsIsFunction,
-// this function wraps mapToProps in a proxy function which does several things:
-//
-// * Detects whether the mapToProps function being called depends on props, which
-// is used by selectorFactory to decide if it should reinvoke on props changes.
-//
-// * On first call, handles mapToProps if returns another function, and treats that
-// new function as the true mapToProps for subsequent calls.
-//
-// * On first call, verifies the first result is a plain object, in order to warn
-// the developer that their mapToProps function is not returning a valid result.
-//
-function wrapMapToPropsFunc(mapToProps, methodName) {
- return function initProxySelector(dispatch, _ref) {
- var displayName = _ref.displayName;
-
- var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {
- return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);
- };
-
- proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);
-
- proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {
- proxy.mapToProps = mapToProps;
- var props = proxy(stateOrDispatch, ownProps);
-
- if (typeof props === 'function') {
- proxy.mapToProps = props;
- proxy.dependsOnOwnProps = getDependsOnOwnProps(props);
- props = proxy(stateOrDispatch, ownProps);
- }
-
- if (process.env.NODE_ENV !== 'production') (0, _verifyPlainObject2.default)(props, displayName, methodName);
-
- return props;
- };
-
- return proxy;
- };
-}
-}).call(this,require('_process'))
-
-},{"../utils/verifyPlainObject":186,"_process":43}],183:[function(require,module,exports){
-"use strict";
-
-exports.__esModule = true;
-
-function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
-// encapsulates the subscription logic for connecting a component to the redux store, as
-// well as nesting subscriptions of descendant components, so that we can ensure the
-// ancestor components re-render before descendants
-
-var CLEARED = null;
-var nullListeners = {
- notify: function notify() {}
-};
-
-function createListenerCollection() {
- // the current/next pattern is copied from redux's createStore code.
- // TODO: refactor+expose that code to be reusable here?
- var current = [];
- var next = [];
-
- return {
- clear: function clear() {
- next = CLEARED;
- current = CLEARED;
- },
- notify: function notify() {
- var listeners = current = next;
- for (var i = 0; i < listeners.length; i++) {
- listeners[i]();
- }
- },
- subscribe: function subscribe(listener) {
- var isSubscribed = true;
- if (next === current) next = current.slice();
- next.push(listener);
-
- return function unsubscribe() {
- if (!isSubscribed || current === CLEARED) return;
- isSubscribed = false;
-
- if (next === current) next = current.slice();
- next.splice(next.indexOf(listener), 1);
- };
- }
- };
-}
-
-var Subscription = function () {
- function Subscription(store, parentSub) {
- _classCallCheck(this, Subscription);
-
- this.store = store;
- this.parentSub = parentSub;
- this.unsubscribe = null;
- this.listeners = nullListeners;
- }
-
- Subscription.prototype.addNestedSub = function addNestedSub(listener) {
- this.trySubscribe();
- return this.listeners.subscribe(listener);
- };
-
- Subscription.prototype.notifyNestedSubs = function notifyNestedSubs() {
- this.listeners.notify();
- };
-
- Subscription.prototype.isSubscribed = function isSubscribed() {
- return Boolean(this.unsubscribe);
- };
-
- Subscription.prototype.trySubscribe = function trySubscribe() {
- if (!this.unsubscribe) {
- // this.onStateChange is set by connectAdvanced.initSubscription()
- this.unsubscribe = this.parentSub ? this.parentSub.addNestedSub(this.onStateChange) : this.store.subscribe(this.onStateChange);
-
- this.listeners = createListenerCollection();
- }
- };
-
- Subscription.prototype.tryUnsubscribe = function tryUnsubscribe() {
- if (this.unsubscribe) {
- this.unsubscribe();
- this.unsubscribe = null;
- this.listeners.clear();
- this.listeners = nullListeners;
- }
- };
-
- return Subscription;
-}();
-
-exports.default = Subscription;
-},{}],184:[function(require,module,exports){
-"use strict";
-
-exports.__esModule = true;
-exports.default = shallowEqual;
-var hasOwn = Object.prototype.hasOwnProperty;
-
-function shallowEqual(a, b) {
- if (a === b) return true;
-
- var countA = 0;
- var countB = 0;
-
- for (var key in a) {
- if (hasOwn.call(a, key) && a[key] !== b[key]) return false;
- countA++;
- }
-
- for (var _key in b) {
- if (hasOwn.call(b, _key)) countB++;
- }
-
- return countA === countB;
-}
-},{}],185:[function(require,module,exports){
-'use strict';
-
-exports.__esModule = true;
-
-var _react = require('react');
-
-exports.default = _react.PropTypes.shape({
- subscribe: _react.PropTypes.func.isRequired,
- dispatch: _react.PropTypes.func.isRequired,
- getState: _react.PropTypes.func.isRequired
-});
-},{"react":"react"}],186:[function(require,module,exports){
-'use strict';
-
-exports.__esModule = true;
-exports.default = verifyPlainObject;
-
-var _isPlainObject = require('lodash/isPlainObject');
-
-var _isPlainObject2 = _interopRequireDefault(_isPlainObject);
-
-var _warning = require('./warning');
-
-var _warning2 = _interopRequireDefault(_warning);
-
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
-function verifyPlainObject(value, displayName, methodName) {
- if (!(0, _isPlainObject2.default)(value)) {
- (0, _warning2.default)(methodName + '() in ' + displayName + ' must return a plain object. Instead received ' + value + '.');
- }
-}
-},{"./warning":187,"lodash/isPlainObject":41}],187:[function(require,module,exports){
-'use strict';
-
-exports.__esModule = true;
-exports.default = warning;
-/**
- * Prints a warning in the console if it exists.
- *
- * @param {String} message The warning message.
- * @returns {void}
- */
-function warning(message) {
- /* eslint-disable no-console */
- if (typeof console !== 'undefined' && typeof console.error === 'function') {
- console.error(message);
- }
- /* eslint-enable no-console */
- try {
- // This error was thrown as a convenience so that if you enable
- // "break on all exceptions" in your console,
- // it would pause the execution at this line.
- throw new Error(message);
- /* eslint-disable no-empty */
- } catch (e) {}
- /* eslint-enable no-empty */
-}
-},{}],188:[function(require,module,exports){
-arguments[4][69][0].apply(exports,arguments)
-},{"dup":69}],189:[function(require,module,exports){
-(function (process){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- *
- */
-
-'use strict';
-
-var _prodInvariant = require('./reactProdInvariant');
-
-var invariant = require('fbjs/lib/invariant');
-
-/**
- * Static poolers. Several custom versions for each potential number of
- * arguments. A completely generic pooler is easy to implement, but would
- * require accessing the `arguments` object. In each of these, `this` refers to
- * the Class itself, not an instance. If any others are needed, simply add them
- * here, or in their own files.
- */
-var oneArgumentPooler = function (copyFieldsFrom) {
- var Klass = this;
- if (Klass.instancePool.length) {
- var instance = Klass.instancePool.pop();
- Klass.call(instance, copyFieldsFrom);
- return instance;
- } else {
- return new Klass(copyFieldsFrom);
- }
-};
-
-var twoArgumentPooler = function (a1, a2) {
- var Klass = this;
- if (Klass.instancePool.length) {
- var instance = Klass.instancePool.pop();
- Klass.call(instance, a1, a2);
- return instance;
- } else {
- return new Klass(a1, a2);
- }
-};
-
-var threeArgumentPooler = function (a1, a2, a3) {
- var Klass = this;
- if (Klass.instancePool.length) {
- var instance = Klass.instancePool.pop();
- Klass.call(instance, a1, a2, a3);
- return instance;
- } else {
- return new Klass(a1, a2, a3);
- }
-};
-
-var fourArgumentPooler = function (a1, a2, a3, a4) {
- var Klass = this;
- if (Klass.instancePool.length) {
- var instance = Klass.instancePool.pop();
- Klass.call(instance, a1, a2, a3, a4);
- return instance;
- } else {
- return new Klass(a1, a2, a3, a4);
- }
-};
-
-var standardReleaser = function (instance) {
- var Klass = this;
- !(instance instanceof Klass) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Trying to release an instance into a pool of a different type.') : _prodInvariant('25') : void 0;
- instance.destructor();
- if (Klass.instancePool.length < Klass.poolSize) {
- Klass.instancePool.push(instance);
- }
-};
-
-var DEFAULT_POOL_SIZE = 10;
-var DEFAULT_POOLER = oneArgumentPooler;
-
-/**
- * Augments `CopyConstructor` to be a poolable class, augmenting only the class
- * itself (statically) not adding any prototypical fields. Any CopyConstructor
- * you give this may have a `poolSize` property, and will look for a
- * prototypical `destructor` on instances.
- *
- * @param {Function} CopyConstructor Constructor that can be used to reset.
- * @param {Function} pooler Customizable pooler.
- */
-var addPoolingTo = function (CopyConstructor, pooler) {
- // Casting as any so that flow ignores the actual implementation and trusts
- // it to match the type we declared
- var NewKlass = CopyConstructor;
- NewKlass.instancePool = [];
- NewKlass.getPooled = pooler || DEFAULT_POOLER;
- if (!NewKlass.poolSize) {
- NewKlass.poolSize = DEFAULT_POOL_SIZE;
- }
- NewKlass.release = standardReleaser;
- return NewKlass;
-};
-
-var PooledClass = {
- addPoolingTo: addPoolingTo,
- oneArgumentPooler: oneArgumentPooler,
- twoArgumentPooler: twoArgumentPooler,
- threeArgumentPooler: threeArgumentPooler,
- fourArgumentPooler: fourArgumentPooler
-};
-
-module.exports = PooledClass;
-}).call(this,require('_process'))
-
-},{"./reactProdInvariant":210,"_process":43,"fbjs/lib/invariant":18}],190:[function(require,module,exports){
-(function (process){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-'use strict';
-
-var _assign = require('object-assign');
-
-var ReactChildren = require('./ReactChildren');
-var ReactComponent = require('./ReactComponent');
-var ReactPureComponent = require('./ReactPureComponent');
-var ReactClass = require('./ReactClass');
-var ReactDOMFactories = require('./ReactDOMFactories');
-var ReactElement = require('./ReactElement');
-var ReactPropTypes = require('./ReactPropTypes');
-var ReactVersion = require('./ReactVersion');
-
-var onlyChild = require('./onlyChild');
-var warning = require('fbjs/lib/warning');
-
-var createElement = ReactElement.createElement;
-var createFactory = ReactElement.createFactory;
-var cloneElement = ReactElement.cloneElement;
-
-if (process.env.NODE_ENV !== 'production') {
- var ReactElementValidator = require('./ReactElementValidator');
- createElement = ReactElementValidator.createElement;
- createFactory = ReactElementValidator.createFactory;
- cloneElement = ReactElementValidator.cloneElement;
-}
-
-var __spread = _assign;
-
-if (process.env.NODE_ENV !== 'production') {
- var warned = false;
- __spread = function () {
- process.env.NODE_ENV !== 'production' ? warning(warned, 'React.__spread is deprecated and should not be used. Use ' + 'Object.assign directly or another helper function with similar ' + 'semantics. You may be seeing this warning due to your compiler. ' + 'See https://fb.me/react-spread-deprecation for more details.') : void 0;
- warned = true;
- return _assign.apply(null, arguments);
- };
-}
-
-var React = {
-
- // Modern
-
- Children: {
- map: ReactChildren.map,
- forEach: ReactChildren.forEach,
- count: ReactChildren.count,
- toArray: ReactChildren.toArray,
- only: onlyChild
- },
-
- Component: ReactComponent,
- PureComponent: ReactPureComponent,
-
- createElement: createElement,
- cloneElement: cloneElement,
- isValidElement: ReactElement.isValidElement,
-
- // Classic
-
- PropTypes: ReactPropTypes,
- createClass: ReactClass.createClass,
- createFactory: createFactory,
- createMixin: function (mixin) {
- // Currently a noop. Will be used to validate and trace mixins.
- return mixin;
- },
-
- // This looks DOM specific but these are actually isomorphic helpers
- // since they are just generating DOM strings.
- DOM: ReactDOMFactories,
-
- version: ReactVersion,
-
- // Deprecated hook for JSX spread, don't use this for anything.
- __spread: __spread
-};
-
-module.exports = React;
-}).call(this,require('_process'))
-
-},{"./ReactChildren":191,"./ReactClass":192,"./ReactComponent":193,"./ReactDOMFactories":196,"./ReactElement":197,"./ReactElementValidator":199,"./ReactPropTypes":202,"./ReactPureComponent":204,"./ReactVersion":205,"./onlyChild":209,"_process":43,"fbjs/lib/warning":25,"object-assign":42}],191:[function(require,module,exports){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-'use strict';
-
-var PooledClass = require('./PooledClass');
-var ReactElement = require('./ReactElement');
-
-var emptyFunction = require('fbjs/lib/emptyFunction');
-var traverseAllChildren = require('./traverseAllChildren');
-
-var twoArgumentPooler = PooledClass.twoArgumentPooler;
-var fourArgumentPooler = PooledClass.fourArgumentPooler;
-
-var userProvidedKeyEscapeRegex = /\/+/g;
-function escapeUserProvidedKey(text) {
- return ('' + text).replace(userProvidedKeyEscapeRegex, '$&/');
-}
-
-/**
- * PooledClass representing the bookkeeping associated with performing a child
- * traversal. Allows avoiding binding callbacks.
- *
- * @constructor ForEachBookKeeping
- * @param {!function} forEachFunction Function to perform traversal with.
- * @param {?*} forEachContext Context to perform context with.
- */
-function ForEachBookKeeping(forEachFunction, forEachContext) {
- this.func = forEachFunction;
- this.context = forEachContext;
- this.count = 0;
-}
-ForEachBookKeeping.prototype.destructor = function () {
- this.func = null;
- this.context = null;
- this.count = 0;
-};
-PooledClass.addPoolingTo(ForEachBookKeeping, twoArgumentPooler);
-
-function forEachSingleChild(bookKeeping, child, name) {
- var func = bookKeeping.func,
- context = bookKeeping.context;
-
- func.call(context, child, bookKeeping.count++);
-}
-
-/**
- * Iterates through children that are typically specified as `props.children`.
- *
- * See https://facebook.github.io/react/docs/top-level-api.html#react.children.foreach
- *
- * The provided forEachFunc(child, index) will be called for each
- * leaf child.
- *
- * @param {?*} children Children tree container.
- * @param {function(*, int)} forEachFunc
- * @param {*} forEachContext Context for forEachContext.
- */
-function forEachChildren(children, forEachFunc, forEachContext) {
- if (children == null) {
- return children;
- }
- var traverseContext = ForEachBookKeeping.getPooled(forEachFunc, forEachContext);
- traverseAllChildren(children, forEachSingleChild, traverseContext);
- ForEachBookKeeping.release(traverseContext);
-}
-
-/**
- * PooledClass representing the bookkeeping associated with performing a child
- * mapping. Allows avoiding binding callbacks.
- *
- * @constructor MapBookKeeping
- * @param {!*} mapResult Object containing the ordered map of results.
- * @param {!function} mapFunction Function to perform mapping with.
- * @param {?*} mapContext Context to perform mapping with.
- */
-function MapBookKeeping(mapResult, keyPrefix, mapFunction, mapContext) {
- this.result = mapResult;
- this.keyPrefix = keyPrefix;
- this.func = mapFunction;
- this.context = mapContext;
- this.count = 0;
-}
-MapBookKeeping.prototype.destructor = function () {
- this.result = null;
- this.keyPrefix = null;
- this.func = null;
- this.context = null;
- this.count = 0;
-};
-PooledClass.addPoolingTo(MapBookKeeping, fourArgumentPooler);
-
-function mapSingleChildIntoContext(bookKeeping, child, childKey) {
- var result = bookKeeping.result,
- keyPrefix = bookKeeping.keyPrefix,
- func = bookKeeping.func,
- context = bookKeeping.context;
-
-
- var mappedChild = func.call(context, child, bookKeeping.count++);
- if (Array.isArray(mappedChild)) {
- mapIntoWithKeyPrefixInternal(mappedChild, result, childKey, emptyFunction.thatReturnsArgument);
- } else if (mappedChild != null) {
- if (ReactElement.isValidElement(mappedChild)) {
- mappedChild = ReactElement.cloneAndReplaceKey(mappedChild,
- // Keep both the (mapped) and old keys if they differ, just as
- // traverseAllChildren used to do for objects as children
- keyPrefix + (mappedChild.key && (!child || child.key !== mappedChild.key) ? escapeUserProvidedKey(mappedChild.key) + '/' : '') + childKey);
- }
- result.push(mappedChild);
- }
-}
-
-function mapIntoWithKeyPrefixInternal(children, array, prefix, func, context) {
- var escapedPrefix = '';
- if (prefix != null) {
- escapedPrefix = escapeUserProvidedKey(prefix) + '/';
- }
- var traverseContext = MapBookKeeping.getPooled(array, escapedPrefix, func, context);
- traverseAllChildren(children, mapSingleChildIntoContext, traverseContext);
- MapBookKeeping.release(traverseContext);
-}
-
-/**
- * Maps children that are typically specified as `props.children`.
- *
- * See https://facebook.github.io/react/docs/top-level-api.html#react.children.map
- *
- * The provided mapFunction(child, key, index) will be called for each
- * leaf child.
- *
- * @param {?*} children Children tree container.
- * @param {function(*, int)} func The map function.
- * @param {*} context Context for mapFunction.
- * @return {object} Object containing the ordered map of results.
- */
-function mapChildren(children, func, context) {
- if (children == null) {
- return children;
- }
- var result = [];
- mapIntoWithKeyPrefixInternal(children, result, null, func, context);
- return result;
-}
-
-function forEachSingleChildDummy(traverseContext, child, name) {
- return null;
-}
-
-/**
- * Count the number of children that are typically specified as
- * `props.children`.
- *
- * See https://facebook.github.io/react/docs/top-level-api.html#react.children.count
- *
- * @param {?*} children Children tree container.
- * @return {number} The number of children.
- */
-function countChildren(children, context) {
- return traverseAllChildren(children, forEachSingleChildDummy, null);
-}
-
-/**
- * Flatten a children object (typically specified as `props.children`) and
- * return an array with appropriately re-keyed children.
- *
- * See https://facebook.github.io/react/docs/top-level-api.html#react.children.toarray
- */
-function toArray(children) {
- var result = [];
- mapIntoWithKeyPrefixInternal(children, result, null, emptyFunction.thatReturnsArgument);
- return result;
-}
-
-var ReactChildren = {
- forEach: forEachChildren,
- map: mapChildren,
- mapIntoWithKeyPrefixInternal: mapIntoWithKeyPrefixInternal,
- count: countChildren,
- toArray: toArray
-};
-
-module.exports = ReactChildren;
-},{"./PooledClass":189,"./ReactElement":197,"./traverseAllChildren":211,"fbjs/lib/emptyFunction":10}],192:[function(require,module,exports){
-(function (process){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-'use strict';
-
-var _prodInvariant = require('./reactProdInvariant'),
- _assign = require('object-assign');
-
-var ReactComponent = require('./ReactComponent');
-var ReactElement = require('./ReactElement');
-var ReactPropTypeLocationNames = require('./ReactPropTypeLocationNames');
-var ReactNoopUpdateQueue = require('./ReactNoopUpdateQueue');
-
-var emptyObject = require('fbjs/lib/emptyObject');
-var invariant = require('fbjs/lib/invariant');
-var warning = require('fbjs/lib/warning');
-
-var MIXINS_KEY = 'mixins';
-
-// Helper function to allow the creation of anonymous functions which do not
-// have .name set to the name of the variable being assigned to.
-function identity(fn) {
- return fn;
-}
-
-/**
- * Policies that describe methods in `ReactClassInterface`.
- */
-
-
-var injectedMixins = [];
-
-/**
- * Composite components are higher-level components that compose other composite
- * or host components.
- *
- * To create a new type of `ReactClass`, pass a specification of
- * your new class to `React.createClass`. The only requirement of your class
- * specification is that you implement a `render` method.
- *
- * var MyComponent = React.createClass({
- * render: function() {
- * return <div>Hello World</div>;
- * }
- * });
- *
- * The class specification supports a specific protocol of methods that have
- * special meaning (e.g. `render`). See `ReactClassInterface` for
- * more the comprehensive protocol. Any other properties and methods in the
- * class specification will be available on the prototype.
- *
- * @interface ReactClassInterface
- * @internal
- */
-var ReactClassInterface = {
-
- /**
- * An array of Mixin objects to include when defining your component.
- *
- * @type {array}
- * @optional
- */
- mixins: 'DEFINE_MANY',
-
- /**
- * An object containing properties and methods that should be defined on
- * the component's constructor instead of its prototype (static methods).
- *
- * @type {object}
- * @optional
- */
- statics: 'DEFINE_MANY',
-
- /**
- * Definition of prop types for this component.
- *
- * @type {object}
- * @optional
- */
- propTypes: 'DEFINE_MANY',
-
- /**
- * Definition of context types for this component.
- *
- * @type {object}
- * @optional
- */
- contextTypes: 'DEFINE_MANY',
-
- /**
- * Definition of context types this component sets for its children.
- *
- * @type {object}
- * @optional
- */
- childContextTypes: 'DEFINE_MANY',
-
- // ==== Definition methods ====
-
- /**
- * Invoked when the component is mounted. Values in the mapping will be set on
- * `this.props` if that prop is not specified (i.e. using an `in` check).
- *
- * This method is invoked before `getInitialState` and therefore cannot rely
- * on `this.state` or use `this.setState`.
- *
- * @return {object}
- * @optional
- */
- getDefaultProps: 'DEFINE_MANY_MERGED',
-
- /**
- * Invoked once before the component is mounted. The return value will be used
- * as the initial value of `this.state`.
- *
- * getInitialState: function() {
- * return {
- * isOn: false,
- * fooBaz: new BazFoo()
- * }
- * }
- *
- * @return {object}
- * @optional
- */
- getInitialState: 'DEFINE_MANY_MERGED',
-
- /**
- * @return {object}
- * @optional
- */
- getChildContext: 'DEFINE_MANY_MERGED',
-
- /**
- * Uses props from `this.props` and state from `this.state` to render the
- * structure of the component.
- *
- * No guarantees are made about when or how often this method is invoked, so
- * it must not have side effects.
- *
- * render: function() {
- * var name = this.props.name;
- * return <div>Hello, {name}!</div>;
- * }
- *
- * @return {ReactComponent}
- * @nosideeffects
- * @required
- */
- render: 'DEFINE_ONCE',
-
- // ==== Delegate methods ====
-
- /**
- * Invoked when the component is initially created and about to be mounted.
- * This may have side effects, but any external subscriptions or data created
- * by this method must be cleaned up in `componentWillUnmount`.
- *
- * @optional
- */
- componentWillMount: 'DEFINE_MANY',
-
- /**
- * Invoked when the component has been mounted and has a DOM representation.
- * However, there is no guarantee that the DOM node is in the document.
- *
- * Use this as an opportunity to operate on the DOM when the component has
- * been mounted (initialized and rendered) for the first time.
- *
- * @param {DOMElement} rootNode DOM element representing the component.
- * @optional
- */
- componentDidMount: 'DEFINE_MANY',
-
- /**
- * Invoked before the component receives new props.
- *
- * Use this as an opportunity to react to a prop transition by updating the
- * state using `this.setState`. Current props are accessed via `this.props`.
- *
- * componentWillReceiveProps: function(nextProps, nextContext) {
- * this.setState({
- * likesIncreasing: nextProps.likeCount > this.props.likeCount
- * });
- * }
- *
- * NOTE: There is no equivalent `componentWillReceiveState`. An incoming prop
- * transition may cause a state change, but the opposite is not true. If you
- * need it, you are probably looking for `componentWillUpdate`.
- *
- * @param {object} nextProps
- * @optional
- */
- componentWillReceiveProps: 'DEFINE_MANY',
-
- /**
- * Invoked while deciding if the component should be updated as a result of
- * receiving new props, state and/or context.
- *
- * Use this as an opportunity to `return false` when you're certain that the
- * transition to the new props/state/context will not require a component
- * update.
- *
- * shouldComponentUpdate: function(nextProps, nextState, nextContext) {
- * return !equal(nextProps, this.props) ||
- * !equal(nextState, this.state) ||
- * !equal(nextContext, this.context);
- * }
- *
- * @param {object} nextProps
- * @param {?object} nextState
- * @param {?object} nextContext
- * @return {boolean} True if the component should update.
- * @optional
- */
- shouldComponentUpdate: 'DEFINE_ONCE',
-
- /**
- * Invoked when the component is about to update due to a transition from
- * `this.props`, `this.state` and `this.context` to `nextProps`, `nextState`
- * and `nextContext`.
- *
- * Use this as an opportunity to perform preparation before an update occurs.
- *
- * NOTE: You **cannot** use `this.setState()` in this method.
- *
- * @param {object} nextProps
- * @param {?object} nextState
- * @param {?object} nextContext
- * @param {ReactReconcileTransaction} transaction
- * @optional
- */
- componentWillUpdate: 'DEFINE_MANY',
-
- /**
- * Invoked when the component's DOM representation has been updated.
- *
- * Use this as an opportunity to operate on the DOM when the component has
- * been updated.
- *
- * @param {object} prevProps
- * @param {?object} prevState
- * @param {?object} prevContext
- * @param {DOMElement} rootNode DOM element representing the component.
- * @optional
- */
- componentDidUpdate: 'DEFINE_MANY',
-
- /**
- * Invoked when the component is about to be removed from its parent and have
- * its DOM representation destroyed.
- *
- * Use this as an opportunity to deallocate any external resources.
- *
- * NOTE: There is no `componentDidUnmount` since your component will have been
- * destroyed by that point.
- *
- * @optional
- */
- componentWillUnmount: 'DEFINE_MANY',
-
- // ==== Advanced methods ====
-
- /**
- * Updates the component's currently mounted DOM representation.
- *
- * By default, this implements React's rendering and reconciliation algorithm.
- * Sophisticated clients may wish to override this.
- *
- * @param {ReactReconcileTransaction} transaction
- * @internal
- * @overridable
- */
- updateComponent: 'OVERRIDE_BASE'
-
-};
-
-/**
- * Mapping from class specification keys to special processing functions.
- *
- * Although these are declared like instance properties in the specification
- * when defining classes using `React.createClass`, they are actually static
- * and are accessible on the constructor instead of the prototype. Despite
- * being static, they must be defined outside of the "statics" key under
- * which all other static methods are defined.
- */
-var RESERVED_SPEC_KEYS = {
- displayName: function (Constructor, displayName) {
- Constructor.displayName = displayName;
- },
- mixins: function (Constructor, mixins) {
- if (mixins) {
- for (var i = 0; i < mixins.length; i++) {
- mixSpecIntoComponent(Constructor, mixins[i]);
- }
- }
- },
- childContextTypes: function (Constructor, childContextTypes) {
- if (process.env.NODE_ENV !== 'production') {
- validateTypeDef(Constructor, childContextTypes, 'childContext');
- }
- Constructor.childContextTypes = _assign({}, Constructor.childContextTypes, childContextTypes);
- },
- contextTypes: function (Constructor, contextTypes) {
- if (process.env.NODE_ENV !== 'production') {
- validateTypeDef(Constructor, contextTypes, 'context');
- }
- Constructor.contextTypes = _assign({}, Constructor.contextTypes, contextTypes);
- },
- /**
- * Special case getDefaultProps which should move into statics but requires
- * automatic merging.
- */
- getDefaultProps: function (Constructor, getDefaultProps) {
- if (Constructor.getDefaultProps) {
- Constructor.getDefaultProps = createMergedResultFunction(Constructor.getDefaultProps, getDefaultProps);
- } else {
- Constructor.getDefaultProps = getDefaultProps;
- }
- },
- propTypes: function (Constructor, propTypes) {
- if (process.env.NODE_ENV !== 'production') {
- validateTypeDef(Constructor, propTypes, 'prop');
- }
- Constructor.propTypes = _assign({}, Constructor.propTypes, propTypes);
- },
- statics: function (Constructor, statics) {
- mixStaticSpecIntoComponent(Constructor, statics);
- },
- autobind: function () {} };
-
-function validateTypeDef(Constructor, typeDef, location) {
- for (var propName in typeDef) {
- if (typeDef.hasOwnProperty(propName)) {
- // use a warning instead of an invariant so components
- // don't show up in prod but only in __DEV__
- process.env.NODE_ENV !== 'production' ? warning(typeof typeDef[propName] === 'function', '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'React.PropTypes.', Constructor.displayName || 'ReactClass', ReactPropTypeLocationNames[location], propName) : void 0;
- }
- }
-}
-
-function validateMethodOverride(isAlreadyDefined, name) {
- var specPolicy = ReactClassInterface.hasOwnProperty(name) ? ReactClassInterface[name] : null;
-
- // Disallow overriding of base class methods unless explicitly allowed.
- if (ReactClassMixin.hasOwnProperty(name)) {
- !(specPolicy === 'OVERRIDE_BASE') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactClassInterface: You are attempting to override `%s` from your class specification. Ensure that your method names do not overlap with React methods.', name) : _prodInvariant('73', name) : void 0;
- }
-
- // Disallow defining methods more than once unless explicitly allowed.
- if (isAlreadyDefined) {
- !(specPolicy === 'DEFINE_MANY' || specPolicy === 'DEFINE_MANY_MERGED') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactClassInterface: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.', name) : _prodInvariant('74', name) : void 0;
- }
-}
-
-/**
- * Mixin helper which handles policy validation and reserved
- * specification keys when building React classes.
- */
-function mixSpecIntoComponent(Constructor, spec) {
- if (!spec) {
- if (process.env.NODE_ENV !== 'production') {
- var typeofSpec = typeof spec;
- var isMixinValid = typeofSpec === 'object' && spec !== null;
-
- process.env.NODE_ENV !== 'production' ? warning(isMixinValid, '%s: You\'re attempting to include a mixin that is either null ' + 'or not an object. Check the mixins included by the component, ' + 'as well as any mixins they include themselves. ' + 'Expected object but got %s.', Constructor.displayName || 'ReactClass', spec === null ? null : typeofSpec) : void 0;
- }
-
- return;
- }
-
- !(typeof spec !== 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactClass: You\'re attempting to use a component class or function as a mixin. Instead, just use a regular object.') : _prodInvariant('75') : void 0;
- !!ReactElement.isValidElement(spec) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactClass: You\'re attempting to use a component as a mixin. Instead, just use a regular object.') : _prodInvariant('76') : void 0;
-
- var proto = Constructor.prototype;
- var autoBindPairs = proto.__reactAutoBindPairs;
-
- // By handling mixins before any other properties, we ensure the same
- // chaining order is applied to methods with DEFINE_MANY policy, whether
- // mixins are listed before or after these methods in the spec.
- if (spec.hasOwnProperty(MIXINS_KEY)) {
- RESERVED_SPEC_KEYS.mixins(Constructor, spec.mixins);
- }
-
- for (var name in spec) {
- if (!spec.hasOwnProperty(name)) {
- continue;
- }
-
- if (name === MIXINS_KEY) {
- // We have already handled mixins in a special case above.
- continue;
- }
-
- var property = spec[name];
- var isAlreadyDefined = proto.hasOwnProperty(name);
- validateMethodOverride(isAlreadyDefined, name);
-
- if (RESERVED_SPEC_KEYS.hasOwnProperty(name)) {
- RESERVED_SPEC_KEYS[name](Constructor, property);
- } else {
- // Setup methods on prototype:
- // The following member methods should not be automatically bound:
- // 1. Expected ReactClass methods (in the "interface").
- // 2. Overridden methods (that were mixed in).
- var isReactClassMethod = ReactClassInterface.hasOwnProperty(name);
- var isFunction = typeof property === 'function';
- var shouldAutoBind = isFunction && !isReactClassMethod && !isAlreadyDefined && spec.autobind !== false;
-
- if (shouldAutoBind) {
- autoBindPairs.push(name, property);
- proto[name] = property;
- } else {
- if (isAlreadyDefined) {
- var specPolicy = ReactClassInterface[name];
-
- // These cases should already be caught by validateMethodOverride.
- !(isReactClassMethod && (specPolicy === 'DEFINE_MANY_MERGED' || specPolicy === 'DEFINE_MANY')) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactClass: Unexpected spec policy %s for key %s when mixing in component specs.', specPolicy, name) : _prodInvariant('77', specPolicy, name) : void 0;
-
- // For methods which are defined more than once, call the existing
- // methods before calling the new property, merging if appropriate.
- if (specPolicy === 'DEFINE_MANY_MERGED') {
- proto[name] = createMergedResultFunction(proto[name], property);
- } else if (specPolicy === 'DEFINE_MANY') {
- proto[name] = createChainedFunction(proto[name], property);
- }
- } else {
- proto[name] = property;
- if (process.env.NODE_ENV !== 'production') {
- // Add verbose displayName to the function, which helps when looking
- // at profiling tools.
- if (typeof property === 'function' && spec.displayName) {
- proto[name].displayName = spec.displayName + '_' + name;
- }
- }
- }
- }
- }
- }
-}
-
-function mixStaticSpecIntoComponent(Constructor, statics) {
- if (!statics) {
- return;
- }
- for (var name in statics) {
- var property = statics[name];
- if (!statics.hasOwnProperty(name)) {
- continue;
- }
-
- var isReserved = name in RESERVED_SPEC_KEYS;
- !!isReserved ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactClass: You are attempting to define a reserved property, `%s`, that shouldn\'t be on the "statics" key. Define it as an instance property instead; it will still be accessible on the constructor.', name) : _prodInvariant('78', name) : void 0;
-
- var isInherited = name in Constructor;
- !!isInherited ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactClass: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.', name) : _prodInvariant('79', name) : void 0;
- Constructor[name] = property;
- }
-}
-
-/**
- * Merge two objects, but throw if both contain the same key.
- *
- * @param {object} one The first object, which is mutated.
- * @param {object} two The second object
- * @return {object} one after it has been mutated to contain everything in two.
- */
-function mergeIntoWithNoDuplicateKeys(one, two) {
- !(one && two && typeof one === 'object' && typeof two === 'object') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.') : _prodInvariant('80') : void 0;
-
- for (var key in two) {
- if (two.hasOwnProperty(key)) {
- !(one[key] === undefined) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'mergeIntoWithNoDuplicateKeys(): Tried to merge two objects with the same key: `%s`. This conflict may be due to a mixin; in particular, this may be caused by two getInitialState() or getDefaultProps() methods returning objects with clashing keys.', key) : _prodInvariant('81', key) : void 0;
- one[key] = two[key];
- }
- }
- return one;
-}
-
-/**
- * Creates a function that invokes two functions and merges their return values.
- *
- * @param {function} one Function to invoke first.
- * @param {function} two Function to invoke second.
- * @return {function} Function that invokes the two argument functions.
- * @private
- */
-function createMergedResultFunction(one, two) {
- return function mergedResult() {
- var a = one.apply(this, arguments);
- var b = two.apply(this, arguments);
- if (a == null) {
- return b;
- } else if (b == null) {
- return a;
- }
- var c = {};
- mergeIntoWithNoDuplicateKeys(c, a);
- mergeIntoWithNoDuplicateKeys(c, b);
- return c;
- };
-}
-
-/**
- * Creates a function that invokes two functions and ignores their return vales.
- *
- * @param {function} one Function to invoke first.
- * @param {function} two Function to invoke second.
- * @return {function} Function that invokes the two argument functions.
- * @private
- */
-function createChainedFunction(one, two) {
- return function chainedFunction() {
- one.apply(this, arguments);
- two.apply(this, arguments);
- };
-}
-
-/**
- * Binds a method to the component.
- *
- * @param {object} component Component whose method is going to be bound.
- * @param {function} method Method to be bound.
- * @return {function} The bound method.
- */
-function bindAutoBindMethod(component, method) {
- var boundMethod = method.bind(component);
- if (process.env.NODE_ENV !== 'production') {
- boundMethod.__reactBoundContext = component;
- boundMethod.__reactBoundMethod = method;
- boundMethod.__reactBoundArguments = null;
- var componentName = component.constructor.displayName;
- var _bind = boundMethod.bind;
- boundMethod.bind = function (newThis) {
- for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
- args[_key - 1] = arguments[_key];
- }
-
- // User is trying to bind() an autobound method; we effectively will
- // ignore the value of "this" that the user is trying to use, so
- // let's warn.
- if (newThis !== component && newThis !== null) {
- process.env.NODE_ENV !== 'production' ? warning(false, 'bind(): React component methods may only be bound to the ' + 'component instance. See %s', componentName) : void 0;
- } else if (!args.length) {
- process.env.NODE_ENV !== 'production' ? warning(false, 'bind(): You are binding a component method to the component. ' + 'React does this for you automatically in a high-performance ' + 'way, so you can safely remove this call. See %s', componentName) : void 0;
- return boundMethod;
- }
- var reboundMethod = _bind.apply(boundMethod, arguments);
- reboundMethod.__reactBoundContext = component;
- reboundMethod.__reactBoundMethod = method;
- reboundMethod.__reactBoundArguments = args;
- return reboundMethod;
- };
- }
- return boundMethod;
-}
-
-/**
- * Binds all auto-bound methods in a component.
- *
- * @param {object} component Component whose method is going to be bound.
- */
-function bindAutoBindMethods(component) {
- var pairs = component.__reactAutoBindPairs;
- for (var i = 0; i < pairs.length; i += 2) {
- var autoBindKey = pairs[i];
- var method = pairs[i + 1];
- component[autoBindKey] = bindAutoBindMethod(component, method);
- }
-}
-
-/**
- * Add more to the ReactClass base class. These are all legacy features and
- * therefore not already part of the modern ReactComponent.
- */
-var ReactClassMixin = {
-
- /**
- * TODO: This will be deprecated because state should always keep a consistent
- * type signature and the only use case for this, is to avoid that.
- */
- replaceState: function (newState, callback) {
- this.updater.enqueueReplaceState(this, newState);
- if (callback) {
- this.updater.enqueueCallback(this, callback, 'replaceState');
- }
- },
-
- /**
- * Checks whether or not this composite component is mounted.
- * @return {boolean} True if mounted, false otherwise.
- * @protected
- * @final
- */
- isMounted: function () {
- return this.updater.isMounted(this);
- }
-};
-
-var ReactClassComponent = function () {};
-_assign(ReactClassComponent.prototype, ReactComponent.prototype, ReactClassMixin);
-
-/**
- * Module for creating composite components.
- *
- * @class ReactClass
- */
-var ReactClass = {
-
- /**
- * Creates a composite component class given a class specification.
- * See https://facebook.github.io/react/docs/top-level-api.html#react.createclass
- *
- * @param {object} spec Class specification (which must define `render`).
- * @return {function} Component constructor function.
- * @public
- */
- createClass: function (spec) {
- // To keep our warnings more understandable, we'll use a little hack here to
- // ensure that Constructor.name !== 'Constructor'. This makes sure we don't
- // unnecessarily identify a class without displayName as 'Constructor'.
- var Constructor = identity(function (props, context, updater) {
- // This constructor gets overridden by mocks. The argument is used
- // by mocks to assert on what gets mounted.
-
- if (process.env.NODE_ENV !== 'production') {
- process.env.NODE_ENV !== 'production' ? warning(this instanceof Constructor, 'Something is calling a React component directly. Use a factory or ' + 'JSX instead. See: https://fb.me/react-legacyfactory') : void 0;
- }
-
- // Wire up auto-binding
- if (this.__reactAutoBindPairs.length) {
- bindAutoBindMethods(this);
- }
-
- this.props = props;
- this.context = context;
- this.refs = emptyObject;
- this.updater = updater || ReactNoopUpdateQueue;
-
- this.state = null;
-
- // ReactClasses doesn't have constructors. Instead, they use the
- // getInitialState and componentWillMount methods for initialization.
-
- var initialState = this.getInitialState ? this.getInitialState() : null;
- if (process.env.NODE_ENV !== 'production') {
- // We allow auto-mocks to proceed as if they're returning null.
- if (initialState === undefined && this.getInitialState._isMockFunction) {
- // This is probably bad practice. Consider warning here and
- // deprecating this convenience.
- initialState = null;
- }
- }
- !(typeof initialState === 'object' && !Array.isArray(initialState)) ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s.getInitialState(): must return an object or null', Constructor.displayName || 'ReactCompositeComponent') : _prodInvariant('82', Constructor.displayName || 'ReactCompositeComponent') : void 0;
-
- this.state = initialState;
- });
- Constructor.prototype = new ReactClassComponent();
- Constructor.prototype.constructor = Constructor;
- Constructor.prototype.__reactAutoBindPairs = [];
-
- injectedMixins.forEach(mixSpecIntoComponent.bind(null, Constructor));
-
- mixSpecIntoComponent(Constructor, spec);
-
- // Initialize the defaultProps property after all mixins have been merged.
- if (Constructor.getDefaultProps) {
- Constructor.defaultProps = Constructor.getDefaultProps();
- }
-
- if (process.env.NODE_ENV !== 'production') {
- // This is a tag to indicate that the use of these method names is ok,
- // since it's used with createClass. If it's not, then it's likely a
- // mistake so we'll warn you to use the static property, property
- // initializer or constructor respectively.
- if (Constructor.getDefaultProps) {
- Constructor.getDefaultProps.isReactClassApproved = {};
- }
- if (Constructor.prototype.getInitialState) {
- Constructor.prototype.getInitialState.isReactClassApproved = {};
- }
- }
-
- !Constructor.prototype.render ? process.env.NODE_ENV !== 'production' ? invariant(false, 'createClass(...): Class specification must implement a `render` method.') : _prodInvariant('83') : void 0;
-
- if (process.env.NODE_ENV !== 'production') {
- process.env.NODE_ENV !== 'production' ? warning(!Constructor.prototype.componentShouldUpdate, '%s has a method called ' + 'componentShouldUpdate(). Did you mean shouldComponentUpdate()? ' + 'The name is phrased as a question because the function is ' + 'expected to return a value.', spec.displayName || 'A component') : void 0;
- process.env.NODE_ENV !== 'production' ? warning(!Constructor.prototype.componentWillRecieveProps, '%s has a method called ' + 'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?', spec.displayName || 'A component') : void 0;
- }
-
- // Reduce time spent doing lookups by setting these on the prototype.
- for (var methodName in ReactClassInterface) {
- if (!Constructor.prototype[methodName]) {
- Constructor.prototype[methodName] = null;
- }
- }
-
- return Constructor;
- },
-
- injection: {
- injectMixin: function (mixin) {
- injectedMixins.push(mixin);
- }
- }
-
-};
-
-module.exports = ReactClass;
-}).call(this,require('_process'))
-
-},{"./ReactComponent":193,"./ReactElement":197,"./ReactNoopUpdateQueue":200,"./ReactPropTypeLocationNames":201,"./reactProdInvariant":210,"_process":43,"fbjs/lib/emptyObject":11,"fbjs/lib/invariant":18,"fbjs/lib/warning":25,"object-assign":42}],193:[function(require,module,exports){
-(function (process){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-'use strict';
-
-var _prodInvariant = require('./reactProdInvariant');
-
-var ReactNoopUpdateQueue = require('./ReactNoopUpdateQueue');
-
-var canDefineProperty = require('./canDefineProperty');
-var emptyObject = require('fbjs/lib/emptyObject');
-var invariant = require('fbjs/lib/invariant');
-var warning = require('fbjs/lib/warning');
-
-/**
- * Base class helpers for the updating state of a component.
- */
-function ReactComponent(props, context, updater) {
- this.props = props;
- this.context = context;
- this.refs = emptyObject;
- // We initialize the default updater but the real one gets injected by the
- // renderer.
- this.updater = updater || ReactNoopUpdateQueue;
-}
-
-ReactComponent.prototype.isReactComponent = {};
-
-/**
- * Sets a subset of the state. Always use this to mutate
- * state. You should treat `this.state` as immutable.
- *
- * There is no guarantee that `this.state` will be immediately updated, so
- * accessing `this.state` after calling this method may return the old value.
- *
- * There is no guarantee that calls to `setState` will run synchronously,
- * as they may eventually be batched together. You can provide an optional
- * callback that will be executed when the call to setState is actually
- * completed.
- *
- * When a function is provided to setState, it will be called at some point in
- * the future (not synchronously). It will be called with the up to date
- * component arguments (state, props, context). These values can be different
- * from this.* because your function may be called after receiveProps but before
- * shouldComponentUpdate, and this new state, props, and context will not yet be
- * assigned to this.
- *
- * @param {object|function} partialState Next partial state or function to
- * produce next partial state to be merged with current state.
- * @param {?function} callback Called after state is updated.
- * @final
- * @protected
- */
-ReactComponent.prototype.setState = function (partialState, callback) {
- !(typeof partialState === 'object' || typeof partialState === 'function' || partialState == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'setState(...): takes an object of state variables to update or a function which returns an object of state variables.') : _prodInvariant('85') : void 0;
- this.updater.enqueueSetState(this, partialState);
- if (callback) {
- this.updater.enqueueCallback(this, callback, 'setState');
- }
-};
-
-/**
- * Forces an update. This should only be invoked when it is known with
- * certainty that we are **not** in a DOM transaction.
- *
- * You may want to call this when you know that some deeper aspect of the
- * component's state has changed but `setState` was not called.
- *
- * This will not invoke `shouldComponentUpdate`, but it will invoke
- * `componentWillUpdate` and `componentDidUpdate`.
- *
- * @param {?function} callback Called after update is complete.
- * @final
- * @protected
- */
-ReactComponent.prototype.forceUpdate = function (callback) {
- this.updater.enqueueForceUpdate(this);
- if (callback) {
- this.updater.enqueueCallback(this, callback, 'forceUpdate');
- }
-};
-
-/**
- * Deprecated APIs. These APIs used to exist on classic React classes but since
- * we would like to deprecate them, we're not going to move them over to this
- * modern base class. Instead, we define a getter that warns if it's accessed.
- */
-if (process.env.NODE_ENV !== 'production') {
- var deprecatedAPIs = {
- isMounted: ['isMounted', 'Instead, make sure to clean up subscriptions and pending requests in ' + 'componentWillUnmount to prevent memory leaks.'],
- replaceState: ['replaceState', 'Refactor your code to use setState instead (see ' + 'https://github.com/facebook/react/issues/3236).']
- };
- var defineDeprecationWarning = function (methodName, info) {
- if (canDefineProperty) {
- Object.defineProperty(ReactComponent.prototype, methodName, {
- get: function () {
- process.env.NODE_ENV !== 'production' ? warning(false, '%s(...) is deprecated in plain JavaScript React classes. %s', info[0], info[1]) : void 0;
- return undefined;
- }
- });
- }
- };
- for (var fnName in deprecatedAPIs) {
- if (deprecatedAPIs.hasOwnProperty(fnName)) {
- defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);
- }
- }
-}
-
-module.exports = ReactComponent;
-}).call(this,require('_process'))
-
-},{"./ReactNoopUpdateQueue":200,"./canDefineProperty":206,"./reactProdInvariant":210,"_process":43,"fbjs/lib/emptyObject":11,"fbjs/lib/invariant":18,"fbjs/lib/warning":25}],194:[function(require,module,exports){
-(function (process){
-/**
- * Copyright 2016-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- *
- */
-
-'use strict';
-
-var _prodInvariant = require('./reactProdInvariant');
-
-var ReactCurrentOwner = require('./ReactCurrentOwner');
-
-var invariant = require('fbjs/lib/invariant');
-var warning = require('fbjs/lib/warning');
-
-function isNative(fn) {
- // Based on isNative() from Lodash
- var funcToString = Function.prototype.toString;
- var hasOwnProperty = Object.prototype.hasOwnProperty;
- var reIsNative = RegExp('^' + funcToString
- // Take an example native function source for comparison
- .call(hasOwnProperty)
- // Strip regex characters so we can use it for regex
- .replace(/[\\^$.*+?()[\]{}|]/g, '\\$&')
- // Remove hasOwnProperty from the template to make it generic
- .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$');
- try {
- var source = funcToString.call(fn);
- return reIsNative.test(source);
- } catch (err) {
- return false;
- }
-}
-
-var canUseCollections =
-// Array.from
-typeof Array.from === 'function' &&
-// Map
-typeof Map === 'function' && isNative(Map) &&
-// Map.prototype.keys
-Map.prototype != null && typeof Map.prototype.keys === 'function' && isNative(Map.prototype.keys) &&
-// Set
-typeof Set === 'function' && isNative(Set) &&
-// Set.prototype.keys
-Set.prototype != null && typeof Set.prototype.keys === 'function' && isNative(Set.prototype.keys);
-
-var setItem;
-var getItem;
-var removeItem;
-var getItemIDs;
-var addRoot;
-var removeRoot;
-var getRootIDs;
-
-if (canUseCollections) {
- var itemMap = new Map();
- var rootIDSet = new Set();
-
- setItem = function (id, item) {
- itemMap.set(id, item);
- };
- getItem = function (id) {
- return itemMap.get(id);
- };
- removeItem = function (id) {
- itemMap['delete'](id);
- };
- getItemIDs = function () {
- return Array.from(itemMap.keys());
- };
-
- addRoot = function (id) {
- rootIDSet.add(id);
- };
- removeRoot = function (id) {
- rootIDSet['delete'](id);
- };
- getRootIDs = function () {
- return Array.from(rootIDSet.keys());
- };
-} else {
- var itemByKey = {};
- var rootByKey = {};
-
- // Use non-numeric keys to prevent V8 performance issues:
- // https://github.com/facebook/react/pull/7232
- var getKeyFromID = function (id) {
- return '.' + id;
- };
- var getIDFromKey = function (key) {
- return parseInt(key.substr(1), 10);
- };
-
- setItem = function (id, item) {
- var key = getKeyFromID(id);
- itemByKey[key] = item;
- };
- getItem = function (id) {
- var key = getKeyFromID(id);
- return itemByKey[key];
- };
- removeItem = function (id) {
- var key = getKeyFromID(id);
- delete itemByKey[key];
- };
- getItemIDs = function () {
- return Object.keys(itemByKey).map(getIDFromKey);
- };
-
- addRoot = function (id) {
- var key = getKeyFromID(id);
- rootByKey[key] = true;
- };
- removeRoot = function (id) {
- var key = getKeyFromID(id);
- delete rootByKey[key];
- };
- getRootIDs = function () {
- return Object.keys(rootByKey).map(getIDFromKey);
- };
-}
-
-var unmountedIDs = [];
-
-function purgeDeep(id) {
- var item = getItem(id);
- if (item) {
- var childIDs = item.childIDs;
-
- removeItem(id);
- childIDs.forEach(purgeDeep);
- }
-}
-
-function describeComponentFrame(name, source, ownerName) {
- return '\n in ' + (name || 'Unknown') + (source ? ' (at ' + source.fileName.replace(/^.*[\\\/]/, '') + ':' + source.lineNumber + ')' : ownerName ? ' (created by ' + ownerName + ')' : '');
-}
-
-function getDisplayName(element) {
- if (element == null) {
- return '#empty';
- } else if (typeof element === 'string' || typeof element === 'number') {
- return '#text';
- } else if (typeof element.type === 'string') {
- return element.type;
- } else {
- return element.type.displayName || element.type.name || 'Unknown';
- }
-}
-
-function describeID(id) {
- var name = ReactComponentTreeHook.getDisplayName(id);
- var element = ReactComponentTreeHook.getElement(id);
- var ownerID = ReactComponentTreeHook.getOwnerID(id);
- var ownerName;
- if (ownerID) {
- ownerName = ReactComponentTreeHook.getDisplayName(ownerID);
- }
- process.env.NODE_ENV !== 'production' ? warning(element, 'ReactComponentTreeHook: Missing React element for debugID %s when ' + 'building stack', id) : void 0;
- return describeComponentFrame(name, element && element._source, ownerName);
-}
-
-var ReactComponentTreeHook = {
- onSetChildren: function (id, nextChildIDs) {
- var item = getItem(id);
- !item ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Item must have been set') : _prodInvariant('144') : void 0;
- item.childIDs = nextChildIDs;
-
- for (var i = 0; i < nextChildIDs.length; i++) {
- var nextChildID = nextChildIDs[i];
- var nextChild = getItem(nextChildID);
- !nextChild ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Expected hook events to fire for the child before its parent includes it in onSetChildren().') : _prodInvariant('140') : void 0;
- !(nextChild.childIDs != null || typeof nextChild.element !== 'object' || nextChild.element == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Expected onSetChildren() to fire for a container child before its parent includes it in onSetChildren().') : _prodInvariant('141') : void 0;
- !nextChild.isMounted ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Expected onMountComponent() to fire for the child before its parent includes it in onSetChildren().') : _prodInvariant('71') : void 0;
- if (nextChild.parentID == null) {
- nextChild.parentID = id;
- // TODO: This shouldn't be necessary but mounting a new root during in
- // componentWillMount currently causes not-yet-mounted components to
- // be purged from our tree data so their parent id is missing.
- }
- !(nextChild.parentID === id) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Expected onBeforeMountComponent() parent and onSetChildren() to be consistent (%s has parents %s and %s).', nextChildID, nextChild.parentID, id) : _prodInvariant('142', nextChildID, nextChild.parentID, id) : void 0;
- }
- },
- onBeforeMountComponent: function (id, element, parentID) {
- var item = {
- element: element,
- parentID: parentID,
- text: null,
- childIDs: [],
- isMounted: false,
- updateCount: 0
- };
- setItem(id, item);
- },
- onBeforeUpdateComponent: function (id, element) {
- var item = getItem(id);
- if (!item || !item.isMounted) {
- // We may end up here as a result of setState() in componentWillUnmount().
- // In this case, ignore the element.
- return;
- }
- item.element = element;
- },
- onMountComponent: function (id) {
- var item = getItem(id);
- !item ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Item must have been set') : _prodInvariant('144') : void 0;
- item.isMounted = true;
- var isRoot = item.parentID === 0;
- if (isRoot) {
- addRoot(id);
- }
- },
- onUpdateComponent: function (id) {
- var item = getItem(id);
- if (!item || !item.isMounted) {
- // We may end up here as a result of setState() in componentWillUnmount().
- // In this case, ignore the element.
- return;
- }
- item.updateCount++;
- },
- onUnmountComponent: function (id) {
- var item = getItem(id);
- if (item) {
- // We need to check if it exists.
- // `item` might not exist if it is inside an error boundary, and a sibling
- // error boundary child threw while mounting. Then this instance never
- // got a chance to mount, but it still gets an unmounting event during
- // the error boundary cleanup.
- item.isMounted = false;
- var isRoot = item.parentID === 0;
- if (isRoot) {
- removeRoot(id);
- }
- }
- unmountedIDs.push(id);
- },
- purgeUnmountedComponents: function () {
- if (ReactComponentTreeHook._preventPurging) {
- // Should only be used for testing.
- return;
- }
-
- for (var i = 0; i < unmountedIDs.length; i++) {
- var id = unmountedIDs[i];
- purgeDeep(id);
- }
- unmountedIDs.length = 0;
- },
- isMounted: function (id) {
- var item = getItem(id);
- return item ? item.isMounted : false;
- },
- getCurrentStackAddendum: function (topElement) {
- var info = '';
- if (topElement) {
- var name = getDisplayName(topElement);
- var owner = topElement._owner;
- info += describeComponentFrame(name, topElement._source, owner && owner.getName());
- }
-
- var currentOwner = ReactCurrentOwner.current;
- var id = currentOwner && currentOwner._debugID;
-
- info += ReactComponentTreeHook.getStackAddendumByID(id);
- return info;
- },
- getStackAddendumByID: function (id) {
- var info = '';
- while (id) {
- info += describeID(id);
- id = ReactComponentTreeHook.getParentID(id);
- }
- return info;
- },
- getChildIDs: function (id) {
- var item = getItem(id);
- return item ? item.childIDs : [];
- },
- getDisplayName: function (id) {
- var element = ReactComponentTreeHook.getElement(id);
- if (!element) {
- return null;
- }
- return getDisplayName(element);
- },
- getElement: function (id) {
- var item = getItem(id);
- return item ? item.element : null;
- },
- getOwnerID: function (id) {
- var element = ReactComponentTreeHook.getElement(id);
- if (!element || !element._owner) {
- return null;
- }
- return element._owner._debugID;
- },
- getParentID: function (id) {
- var item = getItem(id);
- return item ? item.parentID : null;
- },
- getSource: function (id) {
- var item = getItem(id);
- var element = item ? item.element : null;
- var source = element != null ? element._source : null;
- return source;
- },
- getText: function (id) {
- var element = ReactComponentTreeHook.getElement(id);
- if (typeof element === 'string') {
- return element;
- } else if (typeof element === 'number') {
- return '' + element;
- } else {
- return null;
- }
- },
- getUpdateCount: function (id) {
- var item = getItem(id);
- return item ? item.updateCount : 0;
- },
-
-
- getRootIDs: getRootIDs,
- getRegisteredIDs: getItemIDs
-};
-
-module.exports = ReactComponentTreeHook;
-}).call(this,require('_process'))
-
-},{"./ReactCurrentOwner":195,"./reactProdInvariant":210,"_process":43,"fbjs/lib/invariant":18,"fbjs/lib/warning":25}],195:[function(require,module,exports){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- *
- */
-
-'use strict';
-
-/**
- * Keeps track of the current owner.
- *
- * The current owner is the component who should own any components that are
- * currently being constructed.
- */
-var ReactCurrentOwner = {
-
- /**
- * @internal
- * @type {ReactComponent}
- */
- current: null
-
-};
-
-module.exports = ReactCurrentOwner;
-},{}],196:[function(require,module,exports){
-(function (process){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-'use strict';
-
-var ReactElement = require('./ReactElement');
-
-/**
- * Create a factory that creates HTML tag elements.
- *
- * @private
- */
-var createDOMFactory = ReactElement.createFactory;
-if (process.env.NODE_ENV !== 'production') {
- var ReactElementValidator = require('./ReactElementValidator');
- createDOMFactory = ReactElementValidator.createFactory;
-}
-
-/**
- * Creates a mapping from supported HTML tags to `ReactDOMComponent` classes.
- * This is also accessible via `React.DOM`.
- *
- * @public
- */
-var ReactDOMFactories = {
- a: createDOMFactory('a'),
- abbr: createDOMFactory('abbr'),
- address: createDOMFactory('address'),
- area: createDOMFactory('area'),
- article: createDOMFactory('article'),
- aside: createDOMFactory('aside'),
- audio: createDOMFactory('audio'),
- b: createDOMFactory('b'),
- base: createDOMFactory('base'),
- bdi: createDOMFactory('bdi'),
- bdo: createDOMFactory('bdo'),
- big: createDOMFactory('big'),
- blockquote: createDOMFactory('blockquote'),
- body: createDOMFactory('body'),
- br: createDOMFactory('br'),
- button: createDOMFactory('button'),
- canvas: createDOMFactory('canvas'),
- caption: createDOMFactory('caption'),
- cite: createDOMFactory('cite'),
- code: createDOMFactory('code'),
- col: createDOMFactory('col'),
- colgroup: createDOMFactory('colgroup'),
- data: createDOMFactory('data'),
- datalist: createDOMFactory('datalist'),
- dd: createDOMFactory('dd'),
- del: createDOMFactory('del'),
- details: createDOMFactory('details'),
- dfn: createDOMFactory('dfn'),
- dialog: createDOMFactory('dialog'),
- div: createDOMFactory('div'),
- dl: createDOMFactory('dl'),
- dt: createDOMFactory('dt'),
- em: createDOMFactory('em'),
- embed: createDOMFactory('embed'),
- fieldset: createDOMFactory('fieldset'),
- figcaption: createDOMFactory('figcaption'),
- figure: createDOMFactory('figure'),
- footer: createDOMFactory('footer'),
- form: createDOMFactory('form'),
- h1: createDOMFactory('h1'),
- h2: createDOMFactory('h2'),
- h3: createDOMFactory('h3'),
- h4: createDOMFactory('h4'),
- h5: createDOMFactory('h5'),
- h6: createDOMFactory('h6'),
- head: createDOMFactory('head'),
- header: createDOMFactory('header'),
- hgroup: createDOMFactory('hgroup'),
- hr: createDOMFactory('hr'),
- html: createDOMFactory('html'),
- i: createDOMFactory('i'),
- iframe: createDOMFactory('iframe'),
- img: createDOMFactory('img'),
- input: createDOMFactory('input'),
- ins: createDOMFactory('ins'),
- kbd: createDOMFactory('kbd'),
- keygen: createDOMFactory('keygen'),
- label: createDOMFactory('label'),
- legend: createDOMFactory('legend'),
- li: createDOMFactory('li'),
- link: createDOMFactory('link'),
- main: createDOMFactory('main'),
- map: createDOMFactory('map'),
- mark: createDOMFactory('mark'),
- menu: createDOMFactory('menu'),
- menuitem: createDOMFactory('menuitem'),
- meta: createDOMFactory('meta'),
- meter: createDOMFactory('meter'),
- nav: createDOMFactory('nav'),
- noscript: createDOMFactory('noscript'),
- object: createDOMFactory('object'),
- ol: createDOMFactory('ol'),
- optgroup: createDOMFactory('optgroup'),
- option: createDOMFactory('option'),
- output: createDOMFactory('output'),
- p: createDOMFactory('p'),
- param: createDOMFactory('param'),
- picture: createDOMFactory('picture'),
- pre: createDOMFactory('pre'),
- progress: createDOMFactory('progress'),
- q: createDOMFactory('q'),
- rp: createDOMFactory('rp'),
- rt: createDOMFactory('rt'),
- ruby: createDOMFactory('ruby'),
- s: createDOMFactory('s'),
- samp: createDOMFactory('samp'),
- script: createDOMFactory('script'),
- section: createDOMFactory('section'),
- select: createDOMFactory('select'),
- small: createDOMFactory('small'),
- source: createDOMFactory('source'),
- span: createDOMFactory('span'),
- strong: createDOMFactory('strong'),
- style: createDOMFactory('style'),
- sub: createDOMFactory('sub'),
- summary: createDOMFactory('summary'),
- sup: createDOMFactory('sup'),
- table: createDOMFactory('table'),
- tbody: createDOMFactory('tbody'),
- td: createDOMFactory('td'),
- textarea: createDOMFactory('textarea'),
- tfoot: createDOMFactory('tfoot'),
- th: createDOMFactory('th'),
- thead: createDOMFactory('thead'),
- time: createDOMFactory('time'),
- title: createDOMFactory('title'),
- tr: createDOMFactory('tr'),
- track: createDOMFactory('track'),
- u: createDOMFactory('u'),
- ul: createDOMFactory('ul'),
- 'var': createDOMFactory('var'),
- video: createDOMFactory('video'),
- wbr: createDOMFactory('wbr'),
-
- // SVG
- circle: createDOMFactory('circle'),
- clipPath: createDOMFactory('clipPath'),
- defs: createDOMFactory('defs'),
- ellipse: createDOMFactory('ellipse'),
- g: createDOMFactory('g'),
- image: createDOMFactory('image'),
- line: createDOMFactory('line'),
- linearGradient: createDOMFactory('linearGradient'),
- mask: createDOMFactory('mask'),
- path: createDOMFactory('path'),
- pattern: createDOMFactory('pattern'),
- polygon: createDOMFactory('polygon'),
- polyline: createDOMFactory('polyline'),
- radialGradient: createDOMFactory('radialGradient'),
- rect: createDOMFactory('rect'),
- stop: createDOMFactory('stop'),
- svg: createDOMFactory('svg'),
- text: createDOMFactory('text'),
- tspan: createDOMFactory('tspan')
-};
-
-module.exports = ReactDOMFactories;
-}).call(this,require('_process'))
-
-},{"./ReactElement":197,"./ReactElementValidator":199,"_process":43}],197:[function(require,module,exports){
-(function (process){
-/**
- * Copyright 2014-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-'use strict';
-
-var _assign = require('object-assign');
-
-var ReactCurrentOwner = require('./ReactCurrentOwner');
-
-var warning = require('fbjs/lib/warning');
-var canDefineProperty = require('./canDefineProperty');
-var hasOwnProperty = Object.prototype.hasOwnProperty;
-
-var REACT_ELEMENT_TYPE = require('./ReactElementSymbol');
-
-var RESERVED_PROPS = {
- key: true,
- ref: true,
- __self: true,
- __source: true
-};
-
-var specialPropKeyWarningShown, specialPropRefWarningShown;
-
-function hasValidRef(config) {
- if (process.env.NODE_ENV !== 'production') {
- if (hasOwnProperty.call(config, 'ref')) {
- var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;
- if (getter && getter.isReactWarning) {
- return false;
- }
- }
- }
- return config.ref !== undefined;
-}
-
-function hasValidKey(config) {
- if (process.env.NODE_ENV !== 'production') {
- if (hasOwnProperty.call(config, 'key')) {
- var getter = Object.getOwnPropertyDescriptor(config, 'key').get;
- if (getter && getter.isReactWarning) {
- return false;
- }
- }
- }
- return config.key !== undefined;
-}
-
-function defineKeyPropWarningGetter(props, displayName) {
- var warnAboutAccessingKey = function () {
- if (!specialPropKeyWarningShown) {
- specialPropKeyWarningShown = true;
- process.env.NODE_ENV !== 'production' ? warning(false, '%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://fb.me/react-special-props)', displayName) : void 0;
- }
- };
- warnAboutAccessingKey.isReactWarning = true;
- Object.defineProperty(props, 'key', {
- get: warnAboutAccessingKey,
- configurable: true
- });
-}
-
-function defineRefPropWarningGetter(props, displayName) {
- var warnAboutAccessingRef = function () {
- if (!specialPropRefWarningShown) {
- specialPropRefWarningShown = true;
- process.env.NODE_ENV !== 'production' ? warning(false, '%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://fb.me/react-special-props)', displayName) : void 0;
- }
- };
- warnAboutAccessingRef.isReactWarning = true;
- Object.defineProperty(props, 'ref', {
- get: warnAboutAccessingRef,
- configurable: true
- });
-}
-
-/**
- * Factory method to create a new React element. This no longer adheres to
- * the class pattern, so do not use new to call it. Also, no instanceof check
- * will work. Instead test $$typeof field against Symbol.for('react.element') to check
- * if something is a React Element.
- *
- * @param {*} type
- * @param {*} key
- * @param {string|object} ref
- * @param {*} self A *temporary* helper to detect places where `this` is
- * different from the `owner` when React.createElement is called, so that we
- * can warn. We want to get rid of owner and replace string `ref`s with arrow
- * functions, and as long as `this` and owner are the same, there will be no
- * change in behavior.
- * @param {*} source An annotation object (added by a transpiler or otherwise)
- * indicating filename, line number, and/or other information.
- * @param {*} owner
- * @param {*} props
- * @internal
- */
-var ReactElement = function (type, key, ref, self, source, owner, props) {
- var element = {
- // This tag allow us to uniquely identify this as a React Element
- $$typeof: REACT_ELEMENT_TYPE,
-
- // Built-in properties that belong on the element
- type: type,
- key: key,
- ref: ref,
- props: props,
-
- // Record the component responsible for creating this element.
- _owner: owner
- };
-
- if (process.env.NODE_ENV !== 'production') {
- // The validation flag is currently mutative. We put it on
- // an external backing store so that we can freeze the whole object.
- // This can be replaced with a WeakMap once they are implemented in
- // commonly used development environments.
- element._store = {};
-
- // To make comparing ReactElements easier for testing purposes, we make
- // the validation flag non-enumerable (where possible, which should
- // include every environment we run tests in), so the test framework
- // ignores it.
- if (canDefineProperty) {
- Object.defineProperty(element._store, 'validated', {
- configurable: false,
- enumerable: false,
- writable: true,
- value: false
- });
- // self and source are DEV only properties.
- Object.defineProperty(element, '_self', {
- configurable: false,
- enumerable: false,
- writable: false,
- value: self
- });
- // Two elements created in two different places should be considered
- // equal for testing purposes and therefore we hide it from enumeration.
- Object.defineProperty(element, '_source', {
- configurable: false,
- enumerable: false,
- writable: false,
- value: source
- });
- } else {
- element._store.validated = false;
- element._self = self;
- element._source = source;
- }
- if (Object.freeze) {
- Object.freeze(element.props);
- Object.freeze(element);
- }
- }
-
- return element;
-};
-
-/**
- * Create and return a new ReactElement of the given type.
- * See https://facebook.github.io/react/docs/top-level-api.html#react.createelement
- */
-ReactElement.createElement = function (type, config, children) {
- var propName;
-
- // Reserved names are extracted
- var props = {};
-
- var key = null;
- var ref = null;
- var self = null;
- var source = null;
-
- if (config != null) {
- if (hasValidRef(config)) {
- ref = config.ref;
- }
- if (hasValidKey(config)) {
- key = '' + config.key;
- }
-
- self = config.__self === undefined ? null : config.__self;
- source = config.__source === undefined ? null : config.__source;
- // Remaining properties are added to a new props object
- for (propName in config) {
- if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
- props[propName] = config[propName];
- }
- }
- }
-
- // Children can be more than one argument, and those are transferred onto
- // the newly allocated props object.
- var childrenLength = arguments.length - 2;
- if (childrenLength === 1) {
- props.children = children;
- } else if (childrenLength > 1) {
- var childArray = Array(childrenLength);
- for (var i = 0; i < childrenLength; i++) {
- childArray[i] = arguments[i + 2];
- }
- if (process.env.NODE_ENV !== 'production') {
- if (Object.freeze) {
- Object.freeze(childArray);
- }
- }
- props.children = childArray;
- }
-
- // Resolve default props
- if (type && type.defaultProps) {
- var defaultProps = type.defaultProps;
- for (propName in defaultProps) {
- if (props[propName] === undefined) {
- props[propName] = defaultProps[propName];
- }
- }
- }
- if (process.env.NODE_ENV !== 'production') {
- if (key || ref) {
- if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {
- var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;
- if (key) {
- defineKeyPropWarningGetter(props, displayName);
- }
- if (ref) {
- defineRefPropWarningGetter(props, displayName);
- }
- }
- }
- }
- return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
-};
-
-/**
- * Return a function that produces ReactElements of a given type.
- * See https://facebook.github.io/react/docs/top-level-api.html#react.createfactory
- */
-ReactElement.createFactory = function (type) {
- var factory = ReactElement.createElement.bind(null, type);
- // Expose the type on the factory and the prototype so that it can be
- // easily accessed on elements. E.g. `<Foo />.type === Foo`.
- // This should not be named `constructor` since this may not be the function
- // that created the element, and it may not even be a constructor.
- // Legacy hook TODO: Warn if this is accessed
- factory.type = type;
- return factory;
-};
-
-ReactElement.cloneAndReplaceKey = function (oldElement, newKey) {
- var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);
-
- return newElement;
-};
-
-/**
- * Clone and return a new ReactElement using element as the starting point.
- * See https://facebook.github.io/react/docs/top-level-api.html#react.cloneelement
- */
-ReactElement.cloneElement = function (element, config, children) {
- var propName;
-
- // Original props are copied
- var props = _assign({}, element.props);
-
- // Reserved names are extracted
- var key = element.key;
- var ref = element.ref;
- // Self is preserved since the owner is preserved.
- var self = element._self;
- // Source is preserved since cloneElement is unlikely to be targeted by a
- // transpiler, and the original source is probably a better indicator of the
- // true owner.
- var source = element._source;
-
- // Owner will be preserved, unless ref is overridden
- var owner = element._owner;
-
- if (config != null) {
- if (hasValidRef(config)) {
- // Silently steal the ref from the parent.
- ref = config.ref;
- owner = ReactCurrentOwner.current;
- }
- if (hasValidKey(config)) {
- key = '' + config.key;
- }
-
- // Remaining properties override existing props
- var defaultProps;
- if (element.type && element.type.defaultProps) {
- defaultProps = element.type.defaultProps;
- }
- for (propName in config) {
- if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
- if (config[propName] === undefined && defaultProps !== undefined) {
- // Resolve default props
- props[propName] = defaultProps[propName];
- } else {
- props[propName] = config[propName];
- }
- }
- }
- }
-
- // Children can be more than one argument, and those are transferred onto
- // the newly allocated props object.
- var childrenLength = arguments.length - 2;
- if (childrenLength === 1) {
- props.children = children;
- } else if (childrenLength > 1) {
- var childArray = Array(childrenLength);
- for (var i = 0; i < childrenLength; i++) {
- childArray[i] = arguments[i + 2];
- }
- props.children = childArray;
- }
-
- return ReactElement(element.type, key, ref, self, source, owner, props);
-};
-
-/**
- * Verifies the object is a ReactElement.
- * See https://facebook.github.io/react/docs/top-level-api.html#react.isvalidelement
- * @param {?object} object
- * @return {boolean} True if `object` is a valid component.
- * @final
- */
-ReactElement.isValidElement = function (object) {
- return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
-};
-
-module.exports = ReactElement;
-}).call(this,require('_process'))
-
-},{"./ReactCurrentOwner":195,"./ReactElementSymbol":198,"./canDefineProperty":206,"_process":43,"fbjs/lib/warning":25,"object-assign":42}],198:[function(require,module,exports){
-arguments[4][98][0].apply(exports,arguments)
-},{"dup":98}],199:[function(require,module,exports){
-(function (process){
-/**
- * Copyright 2014-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-/**
- * ReactElementValidator provides a wrapper around a element factory
- * which validates the props passed to the element. This is intended to be
- * used only in DEV and could be replaced by a static type checker for languages
- * that support it.
- */
-
-'use strict';
-
-var ReactCurrentOwner = require('./ReactCurrentOwner');
-var ReactComponentTreeHook = require('./ReactComponentTreeHook');
-var ReactElement = require('./ReactElement');
-
-var checkReactTypeSpec = require('./checkReactTypeSpec');
-
-var canDefineProperty = require('./canDefineProperty');
-var getIteratorFn = require('./getIteratorFn');
-var warning = require('fbjs/lib/warning');
-
-function getDeclarationErrorAddendum() {
- if (ReactCurrentOwner.current) {
- var name = ReactCurrentOwner.current.getName();
- if (name) {
- return ' Check the render method of `' + name + '`.';
- }
- }
- return '';
-}
-
-/**
- * Warn if there's no key explicitly set on dynamic arrays of children or
- * object keys are not valid. This allows us to keep track of children between
- * updates.
- */
-var ownerHasKeyUseWarning = {};
-
-function getCurrentComponentErrorInfo(parentType) {
- var info = getDeclarationErrorAddendum();
-
- if (!info) {
- var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;
- if (parentName) {
- info = ' Check the top-level render call using <' + parentName + '>.';
- }
- }
- return info;
-}
-
-/**
- * Warn if the element doesn't have an explicit key assigned to it.
- * This element is in an array. The array could grow and shrink or be
- * reordered. All children that haven't already been validated are required to
- * have a "key" property assigned to it. Error statuses are cached so a warning
- * will only be shown once.
- *
- * @internal
- * @param {ReactElement} element Element that requires a key.
- * @param {*} parentType element's parent's type.
- */
-function validateExplicitKey(element, parentType) {
- if (!element._store || element._store.validated || element.key != null) {
- return;
- }
- element._store.validated = true;
-
- var memoizer = ownerHasKeyUseWarning.uniqueKey || (ownerHasKeyUseWarning.uniqueKey = {});
-
- var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
- if (memoizer[currentComponentErrorInfo]) {
- return;
- }
- memoizer[currentComponentErrorInfo] = true;
-
- // Usually the current owner is the offender, but if it accepts children as a
- // property, it may be the creator of the child that's responsible for
- // assigning it a key.
- var childOwner = '';
- if (element && element._owner && element._owner !== ReactCurrentOwner.current) {
- // Give the component that originally created this child.
- childOwner = ' It was passed a child from ' + element._owner.getName() + '.';
- }
-
- process.env.NODE_ENV !== 'production' ? warning(false, 'Each child in an array or iterator should have a unique "key" prop.' + '%s%s See https://fb.me/react-warning-keys for more information.%s', currentComponentErrorInfo, childOwner, ReactComponentTreeHook.getCurrentStackAddendum(element)) : void 0;
-}
-
-/**
- * Ensure that every element either is passed in a static location, in an
- * array with an explicit keys property defined, or in an object literal
- * with valid key property.
- *
- * @internal
- * @param {ReactNode} node Statically passed child of any type.
- * @param {*} parentType node's parent's type.
- */
-function validateChildKeys(node, parentType) {
- if (typeof node !== 'object') {
- return;
- }
- if (Array.isArray(node)) {
- for (var i = 0; i < node.length; i++) {
- var child = node[i];
- if (ReactElement.isValidElement(child)) {
- validateExplicitKey(child, parentType);
- }
- }
- } else if (ReactElement.isValidElement(node)) {
- // This element was passed in a valid location.
- if (node._store) {
- node._store.validated = true;
- }
- } else if (node) {
- var iteratorFn = getIteratorFn(node);
- // Entry iterators provide implicit keys.
- if (iteratorFn) {
- if (iteratorFn !== node.entries) {
- var iterator = iteratorFn.call(node);
- var step;
- while (!(step = iterator.next()).done) {
- if (ReactElement.isValidElement(step.value)) {
- validateExplicitKey(step.value, parentType);
- }
- }
- }
- }
- }
-}
-
-/**
- * Given an element, validate that its props follow the propTypes definition,
- * provided by the type.
- *
- * @param {ReactElement} element
- */
-function validatePropTypes(element) {
- var componentClass = element.type;
- if (typeof componentClass !== 'function') {
- return;
- }
- var name = componentClass.displayName || componentClass.name;
- if (componentClass.propTypes) {
- checkReactTypeSpec(componentClass.propTypes, element.props, 'prop', name, element, null);
- }
- if (typeof componentClass.getDefaultProps === 'function') {
- process.env.NODE_ENV !== 'production' ? warning(componentClass.getDefaultProps.isReactClassApproved, 'getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.') : void 0;
- }
-}
-
-var ReactElementValidator = {
-
- createElement: function (type, props, children) {
- var validType = typeof type === 'string' || typeof type === 'function';
- // We warn in this case but don't throw. We expect the element creation to
- // succeed and there will likely be errors in render.
- if (!validType) {
- if (typeof type !== 'function' && typeof type !== 'string') {
- var info = '';
- if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
- info += ' You likely forgot to export your component from the file ' + 'it\'s defined in.';
- }
- info += getDeclarationErrorAddendum();
- process.env.NODE_ENV !== 'production' ? warning(false, 'React.createElement: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', type == null ? type : typeof type, info) : void 0;
- }
- }
-
- var element = ReactElement.createElement.apply(this, arguments);
-
- // The result can be nullish if a mock or a custom function is used.
- // TODO: Drop this when these are no longer allowed as the type argument.
- if (element == null) {
- return element;
- }
-
- // Skip key warning if the type isn't valid since our key validation logic
- // doesn't expect a non-string/function type and can throw confusing errors.
- // We don't want exception behavior to differ between dev and prod.
- // (Rendering will throw with a helpful message and as soon as the type is
- // fixed, the key warnings will appear.)
- if (validType) {
- for (var i = 2; i < arguments.length; i++) {
- validateChildKeys(arguments[i], type);
- }
- }
-
- validatePropTypes(element);
-
- return element;
- },
-
- createFactory: function (type) {
- var validatedFactory = ReactElementValidator.createElement.bind(null, type);
- // Legacy hook TODO: Warn if this is accessed
- validatedFactory.type = type;
-
- if (process.env.NODE_ENV !== 'production') {
- if (canDefineProperty) {
- Object.defineProperty(validatedFactory, 'type', {
- enumerable: false,
- get: function () {
- process.env.NODE_ENV !== 'production' ? warning(false, 'Factory.type is deprecated. Access the class directly ' + 'before passing it to createFactory.') : void 0;
- Object.defineProperty(this, 'type', {
- value: type
- });
- return type;
- }
- });
- }
- }
-
- return validatedFactory;
- },
-
- cloneElement: function (element, props, children) {
- var newElement = ReactElement.cloneElement.apply(this, arguments);
- for (var i = 2; i < arguments.length; i++) {
- validateChildKeys(arguments[i], newElement.type);
- }
- validatePropTypes(newElement);
- return newElement;
- }
-
-};
-
-module.exports = ReactElementValidator;
-}).call(this,require('_process'))
-
-},{"./ReactComponentTreeHook":194,"./ReactCurrentOwner":195,"./ReactElement":197,"./canDefineProperty":206,"./checkReactTypeSpec":207,"./getIteratorFn":208,"_process":43,"fbjs/lib/warning":25}],200:[function(require,module,exports){
-(function (process){
-/**
- * Copyright 2015-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-'use strict';
-
-var warning = require('fbjs/lib/warning');
-
-function warnNoop(publicInstance, callerName) {
- if (process.env.NODE_ENV !== 'production') {
- var constructor = publicInstance.constructor;
- process.env.NODE_ENV !== 'production' ? warning(false, '%s(...): Can only update a mounted or mounting component. ' + 'This usually means you called %s() on an unmounted component. ' + 'This is a no-op. Please check the code for the %s component.', callerName, callerName, constructor && (constructor.displayName || constructor.name) || 'ReactClass') : void 0;
- }
-}
-
-/**
- * This is the abstract API for an update queue.
- */
-var ReactNoopUpdateQueue = {
-
- /**
- * Checks whether or not this composite component is mounted.
- * @param {ReactClass} publicInstance The instance we want to test.
- * @return {boolean} True if mounted, false otherwise.
- * @protected
- * @final
- */
- isMounted: function (publicInstance) {
- return false;
- },
-
- /**
- * Enqueue a callback that will be executed after all the pending updates
- * have processed.
- *
- * @param {ReactClass} publicInstance The instance to use as `this` context.
- * @param {?function} callback Called after state is updated.
- * @internal
- */
- enqueueCallback: function (publicInstance, callback) {},
-
- /**
- * Forces an update. This should only be invoked when it is known with
- * certainty that we are **not** in a DOM transaction.
- *
- * You may want to call this when you know that some deeper aspect of the
- * component's state has changed but `setState` was not called.
- *
- * This will not invoke `shouldComponentUpdate`, but it will invoke
- * `componentWillUpdate` and `componentDidUpdate`.
- *
- * @param {ReactClass} publicInstance The instance that should rerender.
- * @internal
- */
- enqueueForceUpdate: function (publicInstance) {
- warnNoop(publicInstance, 'forceUpdate');
- },
-
- /**
- * Replaces all of the state. Always use this or `setState` to mutate state.
- * You should treat `this.state` as immutable.
- *
- * There is no guarantee that `this.state` will be immediately updated, so
- * accessing `this.state` after calling this method may return the old value.
- *
- * @param {ReactClass} publicInstance The instance that should rerender.
- * @param {object} completeState Next state.
- * @internal
- */
- enqueueReplaceState: function (publicInstance, completeState) {
- warnNoop(publicInstance, 'replaceState');
- },
-
- /**
- * Sets a subset of the state. This only exists because _pendingState is
- * internal. This provides a merging strategy that is not available to deep
- * properties which is confusing. TODO: Expose pendingState or don't use it
- * during the merge.
- *
- * @param {ReactClass} publicInstance The instance that should rerender.
- * @param {object} partialState Next partial state to be merged with state.
- * @internal
- */
- enqueueSetState: function (publicInstance, partialState) {
- warnNoop(publicInstance, 'setState');
- }
-};
-
-module.exports = ReactNoopUpdateQueue;
-}).call(this,require('_process'))
-
-},{"_process":43,"fbjs/lib/warning":25}],201:[function(require,module,exports){
-(function (process){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- *
- */
-
-'use strict';
-
-var ReactPropTypeLocationNames = {};
-
-if (process.env.NODE_ENV !== 'production') {
- ReactPropTypeLocationNames = {
- prop: 'prop',
- context: 'context',
- childContext: 'child context'
- };
-}
-
-module.exports = ReactPropTypeLocationNames;
-}).call(this,require('_process'))
-
-},{"_process":43}],202:[function(require,module,exports){
-(function (process){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-'use strict';
-
-var ReactElement = require('./ReactElement');
-var ReactPropTypeLocationNames = require('./ReactPropTypeLocationNames');
-var ReactPropTypesSecret = require('./ReactPropTypesSecret');
-
-var emptyFunction = require('fbjs/lib/emptyFunction');
-var getIteratorFn = require('./getIteratorFn');
-var warning = require('fbjs/lib/warning');
-
-/**
- * Collection of methods that allow declaration and validation of props that are
- * supplied to React components. Example usage:
- *
- * var Props = require('ReactPropTypes');
- * var MyArticle = React.createClass({
- * propTypes: {
- * // An optional string prop named "description".
- * description: Props.string,
- *
- * // A required enum prop named "category".
- * category: Props.oneOf(['News','Photos']).isRequired,
- *
- * // A prop named "dialog" that requires an instance of Dialog.
- * dialog: Props.instanceOf(Dialog).isRequired
- * },
- * render: function() { ... }
- * });
- *
- * A more formal specification of how these methods are used:
- *
- * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)
- * decl := ReactPropTypes.{type}(.isRequired)?
- *
- * Each and every declaration produces a function with the same signature. This
- * allows the creation of custom validation functions. For example:
- *
- * var MyLink = React.createClass({
- * propTypes: {
- * // An optional string or URI prop named "href".
- * href: function(props, propName, componentName) {
- * var propValue = props[propName];
- * if (propValue != null && typeof propValue !== 'string' &&
- * !(propValue instanceof URI)) {
- * return new Error(
- * 'Expected a string or an URI for ' + propName + ' in ' +
- * componentName
- * );
- * }
- * }
- * },
- * render: function() {...}
- * });
- *
- * @internal
- */
-
-var ANONYMOUS = '<<anonymous>>';
-
-var ReactPropTypes = {
- array: createPrimitiveTypeChecker('array'),
- bool: createPrimitiveTypeChecker('boolean'),
- func: createPrimitiveTypeChecker('function'),
- number: createPrimitiveTypeChecker('number'),
- object: createPrimitiveTypeChecker('object'),
- string: createPrimitiveTypeChecker('string'),
- symbol: createPrimitiveTypeChecker('symbol'),
-
- any: createAnyTypeChecker(),
- arrayOf: createArrayOfTypeChecker,
- element: createElementTypeChecker(),
- instanceOf: createInstanceTypeChecker,
- node: createNodeChecker(),
- objectOf: createObjectOfTypeChecker,
- oneOf: createEnumTypeChecker,
- oneOfType: createUnionTypeChecker,
- shape: createShapeTypeChecker
-};
-
-/**
- * inlined Object.is polyfill to avoid requiring consumers ship their own
- * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
- */
-/*eslint-disable no-self-compare*/
-function is(x, y) {
- // SameValue algorithm
- if (x === y) {
- // Steps 1-5, 7-10
- // Steps 6.b-6.e: +0 != -0
- return x !== 0 || 1 / x === 1 / y;
- } else {
- // Step 6.a: NaN == NaN
- return x !== x && y !== y;
- }
-}
-/*eslint-enable no-self-compare*/
-
-/**
- * We use an Error-like object for backward compatibility as people may call
- * PropTypes directly and inspect their output. However we don't use real
- * Errors anymore. We don't inspect their stack anyway, and creating them
- * is prohibitively expensive if they are created too often, such as what
- * happens in oneOfType() for any type before the one that matched.
- */
-function PropTypeError(message) {
- this.message = message;
- this.stack = '';
-}
-// Make `instanceof Error` still work for returned errors.
-PropTypeError.prototype = Error.prototype;
-
-function createChainableTypeChecker(validate) {
- if (process.env.NODE_ENV !== 'production') {
- var manualPropTypeCallCache = {};
- }
- function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
- componentName = componentName || ANONYMOUS;
- propFullName = propFullName || propName;
- if (process.env.NODE_ENV !== 'production') {
- if (secret !== ReactPropTypesSecret && typeof console !== 'undefined') {
- var cacheKey = componentName + ':' + propName;
- if (!manualPropTypeCallCache[cacheKey]) {
- process.env.NODE_ENV !== 'production' ? warning(false, 'You are manually calling a React.PropTypes validation ' + 'function for the `%s` prop on `%s`. This is deprecated ' + 'and will not work in production with the next major version. ' + 'You may be seeing this warning due to a third-party PropTypes ' + 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.', propFullName, componentName) : void 0;
- manualPropTypeCallCache[cacheKey] = true;
- }
- }
- }
- if (props[propName] == null) {
- var locationName = ReactPropTypeLocationNames[location];
- if (isRequired) {
- if (props[propName] === null) {
- return new PropTypeError('The ' + locationName + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));
- }
- return new PropTypeError('The ' + locationName + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));
- }
- return null;
- } else {
- return validate(props, propName, componentName, location, propFullName);
- }
- }
-
- var chainedCheckType = checkType.bind(null, false);
- chainedCheckType.isRequired = checkType.bind(null, true);
-
- return chainedCheckType;
-}
-
-function createPrimitiveTypeChecker(expectedType) {
- function validate(props, propName, componentName, location, propFullName, secret) {
- var propValue = props[propName];
- var propType = getPropType(propValue);
- if (propType !== expectedType) {
- var locationName = ReactPropTypeLocationNames[location];
- // `propValue` being instance of, say, date/regexp, pass the 'object'
- // check, but we can offer a more precise error message here rather than
- // 'of type `object`'.
- var preciseType = getPreciseType(propValue);
-
- return new PropTypeError('Invalid ' + locationName + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'));
- }
- return null;
- }
- return createChainableTypeChecker(validate);
-}
-
-function createAnyTypeChecker() {
- return createChainableTypeChecker(emptyFunction.thatReturns(null));
-}
-
-function createArrayOfTypeChecker(typeChecker) {
- function validate(props, propName, componentName, location, propFullName) {
- if (typeof typeChecker !== 'function') {
- return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
- }
- var propValue = props[propName];
- if (!Array.isArray(propValue)) {
- var locationName = ReactPropTypeLocationNames[location];
- var propType = getPropType(propValue);
- return new PropTypeError('Invalid ' + locationName + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
- }
- for (var i = 0; i < propValue.length; i++) {
- var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret);
- if (error instanceof Error) {
- return error;
- }
- }
- return null;
- }
- return createChainableTypeChecker(validate);
-}
-
-function createElementTypeChecker() {
- function validate(props, propName, componentName, location, propFullName) {
- var propValue = props[propName];
- if (!ReactElement.isValidElement(propValue)) {
- var locationName = ReactPropTypeLocationNames[location];
- var propType = getPropType(propValue);
- return new PropTypeError('Invalid ' + locationName + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));
- }
- return null;
- }
- return createChainableTypeChecker(validate);
-}
-
-function createInstanceTypeChecker(expectedClass) {
- function validate(props, propName, componentName, location, propFullName) {
- if (!(props[propName] instanceof expectedClass)) {
- var locationName = ReactPropTypeLocationNames[location];
- var expectedClassName = expectedClass.name || ANONYMOUS;
- var actualClassName = getClassName(props[propName]);
- return new PropTypeError('Invalid ' + locationName + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
- }
- return null;
- }
- return createChainableTypeChecker(validate);
-}
-
-function createEnumTypeChecker(expectedValues) {
- if (!Array.isArray(expectedValues)) {
- process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid argument supplied to oneOf, expected an instance of array.') : void 0;
- return emptyFunction.thatReturnsNull;
- }
-
- function validate(props, propName, componentName, location, propFullName) {
- var propValue = props[propName];
- for (var i = 0; i < expectedValues.length; i++) {
- if (is(propValue, expectedValues[i])) {
- return null;
- }
- }
-
- var locationName = ReactPropTypeLocationNames[location];
- var valuesString = JSON.stringify(expectedValues);
- return new PropTypeError('Invalid ' + locationName + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
- }
- return createChainableTypeChecker(validate);
-}
-
-function createObjectOfTypeChecker(typeChecker) {
- function validate(props, propName, componentName, location, propFullName) {
- if (typeof typeChecker !== 'function') {
- return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
- }
- var propValue = props[propName];
- var propType = getPropType(propValue);
- if (propType !== 'object') {
- var locationName = ReactPropTypeLocationNames[location];
- return new PropTypeError('Invalid ' + locationName + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
- }
- for (var key in propValue) {
- if (propValue.hasOwnProperty(key)) {
- var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
- if (error instanceof Error) {
- return error;
- }
- }
- }
- return null;
- }
- return createChainableTypeChecker(validate);
-}
-
-function createUnionTypeChecker(arrayOfTypeCheckers) {
- if (!Array.isArray(arrayOfTypeCheckers)) {
- process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid argument supplied to oneOfType, expected an instance of array.') : void 0;
- return emptyFunction.thatReturnsNull;
- }
-
- function validate(props, propName, componentName, location, propFullName) {
- for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
- var checker = arrayOfTypeCheckers[i];
- if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret) == null) {
- return null;
- }
- }
-
- var locationName = ReactPropTypeLocationNames[location];
- return new PropTypeError('Invalid ' + locationName + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.'));
- }
- return createChainableTypeChecker(validate);
-}
-
-function createNodeChecker() {
- function validate(props, propName, componentName, location, propFullName) {
- if (!isNode(props[propName])) {
- var locationName = ReactPropTypeLocationNames[location];
- return new PropTypeError('Invalid ' + locationName + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
- }
- return null;
- }
- return createChainableTypeChecker(validate);
-}
-
-function createShapeTypeChecker(shapeTypes) {
- function validate(props, propName, componentName, location, propFullName) {
- var propValue = props[propName];
- var propType = getPropType(propValue);
- if (propType !== 'object') {
- var locationName = ReactPropTypeLocationNames[location];
- return new PropTypeError('Invalid ' + locationName + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
- }
- for (var key in shapeTypes) {
- var checker = shapeTypes[key];
- if (!checker) {
- continue;
- }
- var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
- if (error) {
- return error;
- }
- }
- return null;
- }
- return createChainableTypeChecker(validate);
-}
-
-function isNode(propValue) {
- switch (typeof propValue) {
- case 'number':
- case 'string':
- case 'undefined':
- return true;
- case 'boolean':
- return !propValue;
- case 'object':
- if (Array.isArray(propValue)) {
- return propValue.every(isNode);
- }
- if (propValue === null || ReactElement.isValidElement(propValue)) {
- return true;
- }
-
- var iteratorFn = getIteratorFn(propValue);
- if (iteratorFn) {
- var iterator = iteratorFn.call(propValue);
- var step;
- if (iteratorFn !== propValue.entries) {
- while (!(step = iterator.next()).done) {
- if (!isNode(step.value)) {
- return false;
- }
- }
- } else {
- // Iterator will provide entry [k,v] tuples rather than values.
- while (!(step = iterator.next()).done) {
- var entry = step.value;
- if (entry) {
- if (!isNode(entry[1])) {
- return false;
- }
- }
- }
- }
- } else {
- return false;
- }
-
- return true;
- default:
- return false;
- }
-}
-
-function isSymbol(propType, propValue) {
- // Native Symbol.
- if (propType === 'symbol') {
- return true;
- }
-
- // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'
- if (propValue['@@toStringTag'] === 'Symbol') {
- return true;
- }
-
- // Fallback for non-spec compliant Symbols which are polyfilled.
- if (typeof Symbol === 'function' && propValue instanceof Symbol) {
- return true;
- }
-
- return false;
-}
-
-// Equivalent of `typeof` but with special handling for array and regexp.
-function getPropType(propValue) {
- var propType = typeof propValue;
- if (Array.isArray(propValue)) {
- return 'array';
- }
- if (propValue instanceof RegExp) {
- // Old webkits (at least until Android 4.0) return 'function' rather than
- // 'object' for typeof a RegExp. We'll normalize this here so that /bla/
- // passes PropTypes.object.
- return 'object';
- }
- if (isSymbol(propType, propValue)) {
- return 'symbol';
- }
- return propType;
-}
-
-// This handles more types than `getPropType`. Only used for error messages.
-// See `createPrimitiveTypeChecker`.
-function getPreciseType(propValue) {
- var propType = getPropType(propValue);
- if (propType === 'object') {
- if (propValue instanceof Date) {
- return 'date';
- } else if (propValue instanceof RegExp) {
- return 'regexp';
- }
- }
- return propType;
-}
-
-// Returns class name of the object, if any.
-function getClassName(propValue) {
- if (!propValue.constructor || !propValue.constructor.name) {
- return ANONYMOUS;
- }
- return propValue.constructor.name;
-}
-
-module.exports = ReactPropTypes;
-}).call(this,require('_process'))
-
-},{"./ReactElement":197,"./ReactPropTypeLocationNames":201,"./ReactPropTypesSecret":203,"./getIteratorFn":208,"_process":43,"fbjs/lib/emptyFunction":10,"fbjs/lib/warning":25}],203:[function(require,module,exports){
-arguments[4][117][0].apply(exports,arguments)
-},{"dup":117}],204:[function(require,module,exports){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-'use strict';
-
-var _assign = require('object-assign');
-
-var ReactComponent = require('./ReactComponent');
-var ReactNoopUpdateQueue = require('./ReactNoopUpdateQueue');
-
-var emptyObject = require('fbjs/lib/emptyObject');
-
-/**
- * Base class helpers for the updating state of a component.
- */
-function ReactPureComponent(props, context, updater) {
- // Duplicated from ReactComponent.
- this.props = props;
- this.context = context;
- this.refs = emptyObject;
- // We initialize the default updater but the real one gets injected by the
- // renderer.
- this.updater = updater || ReactNoopUpdateQueue;
-}
-
-function ComponentDummy() {}
-ComponentDummy.prototype = ReactComponent.prototype;
-ReactPureComponent.prototype = new ComponentDummy();
-ReactPureComponent.prototype.constructor = ReactPureComponent;
-// Avoid an extra prototype jump for these methods.
-_assign(ReactPureComponent.prototype, ReactComponent.prototype);
-ReactPureComponent.prototype.isPureReactComponent = true;
-
-module.exports = ReactPureComponent;
-},{"./ReactComponent":193,"./ReactNoopUpdateQueue":200,"fbjs/lib/emptyObject":11,"object-assign":42}],205:[function(require,module,exports){
-arguments[4][125][0].apply(exports,arguments)
-},{"dup":125}],206:[function(require,module,exports){
-(function (process){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- *
- */
-
-'use strict';
-
-var canDefineProperty = false;
-if (process.env.NODE_ENV !== 'production') {
- try {
- // $FlowFixMe https://github.com/facebook/flow/issues/285
- Object.defineProperty({}, 'x', { get: function () {} });
- canDefineProperty = true;
- } catch (x) {
- // IE will fail on defineProperty
- }
-}
-
-module.exports = canDefineProperty;
-}).call(this,require('_process'))
-
-},{"_process":43}],207:[function(require,module,exports){
-(function (process){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-'use strict';
-
-var _prodInvariant = require('./reactProdInvariant');
-
-var ReactPropTypeLocationNames = require('./ReactPropTypeLocationNames');
-var ReactPropTypesSecret = require('./ReactPropTypesSecret');
-
-var invariant = require('fbjs/lib/invariant');
-var warning = require('fbjs/lib/warning');
-
-var ReactComponentTreeHook;
-
-if (typeof process !== 'undefined' && process.env && process.env.NODE_ENV === 'test') {
- // Temporary hack.
- // Inline requires don't work well with Jest:
- // https://github.com/facebook/react/issues/7240
- // Remove the inline requires when we don't need them anymore:
- // https://github.com/facebook/react/pull/7178
- ReactComponentTreeHook = require('./ReactComponentTreeHook');
-}
-
-var loggedTypeFailures = {};
-
-/**
- * Assert that the values match with the type specs.
- * Error messages are memorized and will only be shown once.
- *
- * @param {object} typeSpecs Map of name to a ReactPropType
- * @param {object} values Runtime values that need to be type-checked
- * @param {string} location e.g. "prop", "context", "child context"
- * @param {string} componentName Name of the component for error messages.
- * @param {?object} element The React element that is being type-checked
- * @param {?number} debugID The React component instance that is being type-checked
- * @private
- */
-function checkReactTypeSpec(typeSpecs, values, location, componentName, element, debugID) {
- for (var typeSpecName in typeSpecs) {
- if (typeSpecs.hasOwnProperty(typeSpecName)) {
- var error;
- // Prop type validation may throw. In case they do, we don't want to
- // fail the render phase where it didn't fail before. So we log it.
- // After these have been cleaned up, we'll let them throw.
- try {
- // This is intentionally an invariant that gets caught. It's the same
- // behavior as without this statement except with a better message.
- !(typeof typeSpecs[typeSpecName] === 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s: %s type `%s` is invalid; it must be a function, usually from React.PropTypes.', componentName || 'React class', ReactPropTypeLocationNames[location], typeSpecName) : _prodInvariant('84', componentName || 'React class', ReactPropTypeLocationNames[location], typeSpecName) : void 0;
- error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
- } catch (ex) {
- error = ex;
- }
- process.env.NODE_ENV !== 'production' ? warning(!error || error instanceof Error, '%s: type specification of %s `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', ReactPropTypeLocationNames[location], typeSpecName, typeof error) : void 0;
- if (error instanceof Error && !(error.message in loggedTypeFailures)) {
- // Only monitor this failure once because there tends to be a lot of the
- // same error.
- loggedTypeFailures[error.message] = true;
-
- var componentStackInfo = '';
-
- if (process.env.NODE_ENV !== 'production') {
- if (!ReactComponentTreeHook) {
- ReactComponentTreeHook = require('./ReactComponentTreeHook');
- }
- if (debugID !== null) {
- componentStackInfo = ReactComponentTreeHook.getStackAddendumByID(debugID);
- } else if (element !== null) {
- componentStackInfo = ReactComponentTreeHook.getCurrentStackAddendum(element);
- }
- }
-
- process.env.NODE_ENV !== 'production' ? warning(false, 'Failed %s type: %s%s', location, error.message, componentStackInfo) : void 0;
- }
- }
- }
-}
-
-module.exports = checkReactTypeSpec;
-}).call(this,require('_process'))
-
-},{"./ReactComponentTreeHook":194,"./ReactPropTypeLocationNames":201,"./ReactPropTypesSecret":203,"./reactProdInvariant":210,"_process":43,"fbjs/lib/invariant":18,"fbjs/lib/warning":25}],208:[function(require,module,exports){
-arguments[4][158][0].apply(exports,arguments)
-},{"dup":158}],209:[function(require,module,exports){
-(function (process){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-'use strict';
-
-var _prodInvariant = require('./reactProdInvariant');
-
-var ReactElement = require('./ReactElement');
-
-var invariant = require('fbjs/lib/invariant');
-
-/**
- * Returns the first child in a collection of children and verifies that there
- * is only one child in the collection.
- *
- * See https://facebook.github.io/react/docs/top-level-api.html#react.children.only
- *
- * The current implementation of this function assumes that a single child gets
- * passed without a wrapper, but the purpose of this helper function is to
- * abstract away the particular structure of children.
- *
- * @param {?object} children Child collection structure.
- * @return {ReactElement} The first and only `ReactElement` contained in the
- * structure.
- */
-function onlyChild(children) {
- !ReactElement.isValidElement(children) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'React.Children.only expected to receive a single React element child.') : _prodInvariant('143') : void 0;
- return children;
-}
-
-module.exports = onlyChild;
-}).call(this,require('_process'))
-
-},{"./ReactElement":197,"./reactProdInvariant":210,"_process":43,"fbjs/lib/invariant":18}],210:[function(require,module,exports){
-arguments[4][167][0].apply(exports,arguments)
-},{"dup":167}],211:[function(require,module,exports){
-(function (process){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-'use strict';
-
-var _prodInvariant = require('./reactProdInvariant');
-
-var ReactCurrentOwner = require('./ReactCurrentOwner');
-var REACT_ELEMENT_TYPE = require('./ReactElementSymbol');
-
-var getIteratorFn = require('./getIteratorFn');
-var invariant = require('fbjs/lib/invariant');
-var KeyEscapeUtils = require('./KeyEscapeUtils');
-var warning = require('fbjs/lib/warning');
-
-var SEPARATOR = '.';
-var SUBSEPARATOR = ':';
-
-/**
- * This is inlined from ReactElement since this file is shared between
- * isomorphic and renderers. We could extract this to a
- *
- */
-
-/**
- * TODO: Test that a single child and an array with one item have the same key
- * pattern.
- */
-
-var didWarnAboutMaps = false;
-
-/**
- * Generate a key string that identifies a component within a set.
- *
- * @param {*} component A component that could contain a manual key.
- * @param {number} index Index that is used if a manual key is not provided.
- * @return {string}
- */
-function getComponentKey(component, index) {
- // Do some typechecking here since we call this blindly. We want to ensure
- // that we don't block potential future ES APIs.
- if (component && typeof component === 'object' && component.key != null) {
- // Explicit key
- return KeyEscapeUtils.escape(component.key);
- }
- // Implicit key determined by the index in the set
- return index.toString(36);
-}
-
-/**
- * @param {?*} children Children tree container.
- * @param {!string} nameSoFar Name of the key path so far.
- * @param {!function} callback Callback to invoke with each child found.
- * @param {?*} traverseContext Used to pass information throughout the traversal
- * process.
- * @return {!number} The number of children in this subtree.
- */
-function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext) {
- var type = typeof children;
-
- if (type === 'undefined' || type === 'boolean') {
- // All of the above are perceived as null.
- children = null;
- }
-
- if (children === null || type === 'string' || type === 'number' ||
- // The following is inlined from ReactElement. This means we can optimize
- // some checks. React Fiber also inlines this logic for similar purposes.
- type === 'object' && children.$$typeof === REACT_ELEMENT_TYPE) {
- callback(traverseContext, children,
- // If it's the only child, treat the name as if it was wrapped in an array
- // so that it's consistent if the number of children grows.
- nameSoFar === '' ? SEPARATOR + getComponentKey(children, 0) : nameSoFar);
- return 1;
- }
-
- var child;
- var nextName;
- var subtreeCount = 0; // Count of children found in the current subtree.
- var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR;
-
- if (Array.isArray(children)) {
- for (var i = 0; i < children.length; i++) {
- child = children[i];
- nextName = nextNamePrefix + getComponentKey(child, i);
- subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
- }
- } else {
- var iteratorFn = getIteratorFn(children);
- if (iteratorFn) {
- var iterator = iteratorFn.call(children);
- var step;
- if (iteratorFn !== children.entries) {
- var ii = 0;
- while (!(step = iterator.next()).done) {
- child = step.value;
- nextName = nextNamePrefix + getComponentKey(child, ii++);
- subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
- }
- } else {
- if (process.env.NODE_ENV !== 'production') {
- var mapsAsChildrenAddendum = '';
- if (ReactCurrentOwner.current) {
- var mapsAsChildrenOwnerName = ReactCurrentOwner.current.getName();
- if (mapsAsChildrenOwnerName) {
- mapsAsChildrenAddendum = ' Check the render method of `' + mapsAsChildrenOwnerName + '`.';
- }
- }
- process.env.NODE_ENV !== 'production' ? warning(didWarnAboutMaps, 'Using Maps as children is not yet fully supported. It is an ' + 'experimental feature that might be removed. Convert it to a ' + 'sequence / iterable of keyed ReactElements instead.%s', mapsAsChildrenAddendum) : void 0;
- didWarnAboutMaps = true;
- }
- // Iterator will provide entry [k,v] tuples rather than values.
- while (!(step = iterator.next()).done) {
- var entry = step.value;
- if (entry) {
- child = entry[1];
- nextName = nextNamePrefix + KeyEscapeUtils.escape(entry[0]) + SUBSEPARATOR + getComponentKey(child, 0);
- subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
- }
- }
- }
- } else if (type === 'object') {
- var addendum = '';
- if (process.env.NODE_ENV !== 'production') {
- addendum = ' If you meant to render a collection of children, use an array ' + 'instead or wrap the object using createFragment(object) from the ' + 'React add-ons.';
- if (children._isReactElement) {
- addendum = ' It looks like you\'re using an element created by a different ' + 'version of React. Make sure to use only one copy of React.';
- }
- if (ReactCurrentOwner.current) {
- var name = ReactCurrentOwner.current.getName();
- if (name) {
- addendum += ' Check the render method of `' + name + '`.';
- }
- }
- }
- var childrenString = String(children);
- !false ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Objects are not valid as a React child (found: %s).%s', childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString, addendum) : _prodInvariant('31', childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString, addendum) : void 0;
- }
- }
-
- return subtreeCount;
-}
-
-/**
- * Traverses children that are typically specified as `props.children`, but
- * might also be specified through attributes:
- *
- * - `traverseAllChildren(this.props.children, ...)`
- * - `traverseAllChildren(this.props.leftPanelChildren, ...)`
- *
- * The `traverseContext` is an optional argument that is passed through the
- * entire traversal. It can be used to store accumulations or anything else that
- * the callback might find relevant.
- *
- * @param {?*} children Children tree object.
- * @param {!function} callback To invoke upon traversing each child.
- * @param {?*} traverseContext Context for traversal.
- * @return {!number} The number of children in this subtree.
- */
-function traverseAllChildren(children, callback, traverseContext) {
- if (children == null) {
- return 0;
- }
-
- return traverseAllChildrenImpl(children, '', callback, traverseContext);
-}
-
-module.exports = traverseAllChildren;
-}).call(this,require('_process'))
-
-},{"./KeyEscapeUtils":188,"./ReactCurrentOwner":195,"./ReactElementSymbol":198,"./getIteratorFn":208,"./reactProdInvariant":210,"_process":43,"fbjs/lib/invariant":18,"fbjs/lib/warning":25}],212:[function(require,module,exports){
-'use strict';
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-
-var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
-
-exports.printBuffer = printBuffer;
-
-var _helpers = require('./helpers');
-
-var _diff = require('./diff');
-
-var _diff2 = _interopRequireDefault(_diff);
-
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
-function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
-
-/**
- * Get log level string based on supplied params
- *
- * @param {string | function | object} level - console[level]
- * @param {object} action - selected action
- * @param {array} payload - selected payload
- * @param {string} type - log entry type
- *
- * @returns {string} level
- */
-function getLogLevel(level, action, payload, type) {
- switch (typeof level === 'undefined' ? 'undefined' : _typeof(level)) {
- case 'object':
- return typeof level[type] === 'function' ? level[type].apply(level, _toConsumableArray(payload)) : level[type];
- case 'function':
- return level(action);
- default:
- return level;
- }
-}
-
-function defaultTitleFormatter(options) {
- var timestamp = options.timestamp,
- duration = options.duration;
-
-
- return function (action, time, took) {
- var parts = ['action'];
-
- if (timestamp) parts.push('@ ' + time);
- parts.push(String(action.type));
- if (duration) parts.push('(in ' + took.toFixed(2) + ' ms)');
-
- return parts.join(' ');
- };
-}
-
-function printBuffer(buffer, options) {
- var logger = options.logger,
- actionTransformer = options.actionTransformer,
- _options$titleFormatt = options.titleFormatter,
- titleFormatter = _options$titleFormatt === undefined ? defaultTitleFormatter(options) : _options$titleFormatt,
- collapsed = options.collapsed,
- colors = options.colors,
- level = options.level,
- diff = options.diff;
-
-
- buffer.forEach(function (logEntry, key) {
- var started = logEntry.started,
- startedTime = logEntry.startedTime,
- action = logEntry.action,
- prevState = logEntry.prevState,
- error = logEntry.error;
- var took = logEntry.took,
- nextState = logEntry.nextState;
-
- var nextEntry = buffer[key + 1];
-
- if (nextEntry) {
- nextState = nextEntry.prevState;
- took = nextEntry.started - started;
- }
-
- // Message
- var formattedAction = actionTransformer(action);
- var isCollapsed = typeof collapsed === 'function' ? collapsed(function () {
- return nextState;
- }, action, logEntry) : collapsed;
-
- var formattedTime = (0, _helpers.formatTime)(startedTime);
- var titleCSS = colors.title ? 'color: ' + colors.title(formattedAction) + ';' : null;
- var title = titleFormatter(formattedAction, formattedTime, took);
-
- // Render
- try {
- if (isCollapsed) {
- if (colors.title) logger.groupCollapsed('%c ' + title, titleCSS);else logger.groupCollapsed(title);
- } else {
- if (colors.title) logger.group('%c ' + title, titleCSS);else logger.group(title);
- }
- } catch (e) {
- logger.log(title);
- }
-
- var prevStateLevel = getLogLevel(level, formattedAction, [prevState], 'prevState');
- var actionLevel = getLogLevel(level, formattedAction, [formattedAction], 'action');
- var errorLevel = getLogLevel(level, formattedAction, [error, prevState], 'error');
- var nextStateLevel = getLogLevel(level, formattedAction, [nextState], 'nextState');
-
- if (prevStateLevel) {
- if (colors.prevState) logger[prevStateLevel]('%c prev state', 'color: ' + colors.prevState(prevState) + '; font-weight: bold', prevState);else logger[prevStateLevel]('prev state', prevState);
- }
-
- if (actionLevel) {
- if (colors.action) logger[actionLevel]('%c action', 'color: ' + colors.action(formattedAction) + '; font-weight: bold', formattedAction);else logger[actionLevel]('action', formattedAction);
- }
-
- if (error && errorLevel) {
- if (colors.error) logger[errorLevel]('%c error', 'color: ' + colors.error(error, prevState) + '; font-weight: bold', error);else logger[errorLevel]('error', error);
- }
-
- if (nextStateLevel) {
- if (colors.nextState) logger[nextStateLevel]('%c next state', 'color: ' + colors.nextState(nextState) + '; font-weight: bold', nextState);else logger[nextStateLevel]('next state', nextState);
- }
-
- if (diff) {
- (0, _diff2.default)(prevState, nextState, logger, isCollapsed);
- }
-
- try {
- logger.groupEnd();
- } catch (e) {
- logger.log('\u2014\u2014 log end \u2014\u2014');
- }
- });
-}
-},{"./diff":214,"./helpers":215}],213:[function(require,module,exports){
-"use strict";
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports.default = {
- level: "log",
- logger: console,
- logErrors: true,
- collapsed: undefined,
- predicate: undefined,
- duration: false,
- timestamp: true,
- stateTransformer: function stateTransformer(state) {
- return state;
- },
- actionTransformer: function actionTransformer(action) {
- return action;
- },
- errorTransformer: function errorTransformer(error) {
- return error;
- },
- colors: {
- title: function title() {
- return "inherit";
- },
- prevState: function prevState() {
- return "#9E9E9E";
- },
- action: function action() {
- return "#03A9F4";
- },
- nextState: function nextState() {
- return "#4CAF50";
- },
- error: function error() {
- return "#F20404";
- }
- },
- diff: false,
- diffPredicate: undefined,
-
- // Deprecated options
- transformer: undefined
-};
-module.exports = exports["default"];
-},{}],214:[function(require,module,exports){
-'use strict';
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports.default = diffLogger;
-
-var _deepDiff = require('deep-diff');
-
-var _deepDiff2 = _interopRequireDefault(_deepDiff);
-
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
-function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
-
-// https://github.com/flitbit/diff#differences
-var dictionary = {
- 'E': {
- color: '#2196F3',
- text: 'CHANGED:'
- },
- 'N': {
- color: '#4CAF50',
- text: 'ADDED:'
- },
- 'D': {
- color: '#F44336',
- text: 'DELETED:'
- },
- 'A': {
- color: '#2196F3',
- text: 'ARRAY:'
- }
-};
-
-function style(kind) {
- return 'color: ' + dictionary[kind].color + '; font-weight: bold';
-}
-
-function render(diff) {
- var kind = diff.kind,
- path = diff.path,
- lhs = diff.lhs,
- rhs = diff.rhs,
- index = diff.index,
- item = diff.item;
-
-
- switch (kind) {
- case 'E':
- return [path.join('.'), lhs, '\u2192', rhs];
- case 'N':
- return [path.join('.'), rhs];
- case 'D':
- return [path.join('.')];
- case 'A':
- return [path.join('.') + '[' + index + ']', item];
- default:
- return [];
- }
-}
-
-function diffLogger(prevState, newState, logger, isCollapsed) {
- var diff = (0, _deepDiff2.default)(prevState, newState);
-
- try {
- if (isCollapsed) {
- logger.groupCollapsed('diff');
- } else {
- logger.group('diff');
- }
- } catch (e) {
- logger.log('diff');
- }
-
- if (diff) {
- diff.forEach(function (elem) {
- var kind = elem.kind;
-
- var output = render(elem);
-
- logger.log.apply(logger, ['%c ' + dictionary[kind].text, style(kind)].concat(_toConsumableArray(output)));
- });
- } else {
- logger.log('\u2014\u2014 no diff \u2014\u2014');
- }
-
- try {
- logger.groupEnd();
- } catch (e) {
- logger.log('\u2014\u2014 diff end \u2014\u2014 ');
- }
-}
-module.exports = exports['default'];
-},{"deep-diff":2}],215:[function(require,module,exports){
-"use strict";
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-var repeat = exports.repeat = function repeat(str, times) {
- return new Array(times + 1).join(str);
-};
-
-var pad = exports.pad = function pad(num, maxLength) {
- return repeat("0", maxLength - num.toString().length) + num;
-};
-
-var formatTime = exports.formatTime = function formatTime(time) {
- return pad(time.getHours(), 2) + ":" + pad(time.getMinutes(), 2) + ":" + pad(time.getSeconds(), 2) + "." + pad(time.getMilliseconds(), 3);
-};
-
-// Use performance API if it's available in order to get better precision
-var timer = exports.timer = typeof performance !== "undefined" && performance !== null && typeof performance.now === "function" ? performance : Date;
-},{}],216:[function(require,module,exports){
-'use strict';
-
-exports.__esModule = true;
-
-var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
-
-exports['default'] = applyMiddleware;
-
-var _compose = require('./compose');
-
-var _compose2 = _interopRequireDefault(_compose);
-
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
-
-/**
- * Creates a store enhancer that applies middleware to the dispatch method
- * of the Redux store. This is handy for a variety of tasks, such as expressing
- * asynchronous actions in a concise manner, or logging every action payload.
- *
- * See `redux-thunk` package as an example of the Redux middleware.
- *
- * Because middleware is potentially asynchronous, this should be the first
- * store enhancer in the composition chain.
- *
- * Note that each middleware will be given the `dispatch` and `getState` functions
- * as named arguments.
- *
- * @param {...Function} middlewares The middleware chain to be applied.
- * @returns {Function} A store enhancer applying the middleware.
- */
-function applyMiddleware() {
- for (var _len = arguments.length, middlewares = Array(_len), _key = 0; _key < _len; _key++) {
- middlewares[_key] = arguments[_key];
- }
-
- return function (createStore) {
- return function (reducer, preloadedState, enhancer) {
- var store = createStore(reducer, preloadedState, enhancer);
- var _dispatch = store.dispatch;
- var chain = [];
-
- var middlewareAPI = {
- getState: store.getState,
- dispatch: function dispatch(action) {
- return _dispatch(action);
- }
- };
- chain = middlewares.map(function (middleware) {
- return middleware(middlewareAPI);
- });
- _dispatch = _compose2['default'].apply(undefined, chain)(store.dispatch);
-
- return _extends({}, store, {
- dispatch: _dispatch
- });
- };
- };
-}
-},{"./compose":219}],217:[function(require,module,exports){
-'use strict';
-
-exports.__esModule = true;
-exports['default'] = bindActionCreators;
-function bindActionCreator(actionCreator, dispatch) {
- return function () {
- return dispatch(actionCreator.apply(undefined, arguments));
- };
-}
-
-/**
- * Turns an object whose values are action creators, into an object with the
- * same keys, but with every function wrapped into a `dispatch` call so they
- * may be invoked directly. This is just a convenience method, as you can call
- * `store.dispatch(MyActionCreators.doSomething())` yourself just fine.
- *
- * For convenience, you can also pass a single function as the first argument,
- * and get a function in return.
- *
- * @param {Function|Object} actionCreators An object whose values are action
- * creator functions. One handy way to obtain it is to use ES6 `import * as`
- * syntax. You may also pass a single function.
- *
- * @param {Function} dispatch The `dispatch` function available on your Redux
- * store.
- *
- * @returns {Function|Object} The object mimicking the original object, but with
- * every action creator wrapped into the `dispatch` call. If you passed a
- * function as `actionCreators`, the return value will also be a single
- * function.
- */
-function bindActionCreators(actionCreators, dispatch) {
- if (typeof actionCreators === 'function') {
- return bindActionCreator(actionCreators, dispatch);
- }
-
- if (typeof actionCreators !== 'object' || actionCreators === null) {
- throw new Error('bindActionCreators expected an object or a function, instead received ' + (actionCreators === null ? 'null' : typeof actionCreators) + '. ' + 'Did you write "import ActionCreators from" instead of "import * as ActionCreators from"?');
- }
-
- var keys = Object.keys(actionCreators);
- var boundActionCreators = {};
- for (var i = 0; i < keys.length; i++) {
- var key = keys[i];
- var actionCreator = actionCreators[key];
- if (typeof actionCreator === 'function') {
- boundActionCreators[key] = bindActionCreator(actionCreator, dispatch);
- }
- }
- return boundActionCreators;
-}
-},{}],218:[function(require,module,exports){
-(function (process){
-'use strict';
-
-exports.__esModule = true;
-exports['default'] = combineReducers;
-
-var _createStore = require('./createStore');
-
-var _isPlainObject = require('lodash/isPlainObject');
-
-var _isPlainObject2 = _interopRequireDefault(_isPlainObject);
-
-var _warning = require('./utils/warning');
-
-var _warning2 = _interopRequireDefault(_warning);
-
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
-
-function getUndefinedStateErrorMessage(key, action) {
- var actionType = action && action.type;
- var actionName = actionType && '"' + actionType.toString() + '"' || 'an action';
-
- return 'Given action ' + actionName + ', reducer "' + key + '" returned undefined. ' + 'To ignore an action, you must explicitly return the previous state.';
-}
-
-function getUnexpectedStateShapeWarningMessage(inputState, reducers, action, unexpectedKeyCache) {
- var reducerKeys = Object.keys(reducers);
- var argumentName = action && action.type === _createStore.ActionTypes.INIT ? 'preloadedState argument passed to createStore' : 'previous state received by the reducer';
-
- if (reducerKeys.length === 0) {
- return 'Store does not have a valid reducer. Make sure the argument passed ' + 'to combineReducers is an object whose values are reducers.';
- }
-
- if (!(0, _isPlainObject2['default'])(inputState)) {
- return 'The ' + argumentName + ' has unexpected type of "' + {}.toString.call(inputState).match(/\s([a-z|A-Z]+)/)[1] + '". Expected argument to be an object with the following ' + ('keys: "' + reducerKeys.join('", "') + '"');
- }
-
- var unexpectedKeys = Object.keys(inputState).filter(function (key) {
- return !reducers.hasOwnProperty(key) && !unexpectedKeyCache[key];
- });
-
- unexpectedKeys.forEach(function (key) {
- unexpectedKeyCache[key] = true;
- });
-
- if (unexpectedKeys.length > 0) {
- return 'Unexpected ' + (unexpectedKeys.length > 1 ? 'keys' : 'key') + ' ' + ('"' + unexpectedKeys.join('", "') + '" found in ' + argumentName + '. ') + 'Expected to find one of the known reducer keys instead: ' + ('"' + reducerKeys.join('", "') + '". Unexpected keys will be ignored.');
- }
-}
-
-function assertReducerSanity(reducers) {
- Object.keys(reducers).forEach(function (key) {
- var reducer = reducers[key];
- var initialState = reducer(undefined, { type: _createStore.ActionTypes.INIT });
-
- if (typeof initialState === 'undefined') {
- throw new Error('Reducer "' + key + '" returned undefined during initialization. ' + 'If the state passed to the reducer is undefined, you must ' + 'explicitly return the initial state. The initial state may ' + 'not be undefined.');
- }
-
- var type = '@@redux/PROBE_UNKNOWN_ACTION_' + Math.random().toString(36).substring(7).split('').join('.');
- if (typeof reducer(undefined, { type: type }) === 'undefined') {
- throw new Error('Reducer "' + key + '" returned undefined when probed with a random type. ' + ('Don\'t try to handle ' + _createStore.ActionTypes.INIT + ' or other actions in "redux/*" ') + 'namespace. They are considered private. Instead, you must return the ' + 'current state for any unknown actions, unless it is undefined, ' + 'in which case you must return the initial state, regardless of the ' + 'action type. The initial state may not be undefined.');
- }
- });
-}
-
-/**
- * Turns an object whose values are different reducer functions, into a single
- * reducer function. It will call every child reducer, and gather their results
- * into a single state object, whose keys correspond to the keys of the passed
- * reducer functions.
- *
- * @param {Object} reducers An object whose values correspond to different
- * reducer functions that need to be combined into one. One handy way to obtain
- * it is to use ES6 `import * as reducers` syntax. The reducers may never return
- * undefined for any action. Instead, they should return their initial state
- * if the state passed to them was undefined, and the current state for any
- * unrecognized action.
- *
- * @returns {Function} A reducer function that invokes every reducer inside the
- * passed object, and builds a state object with the same shape.
- */
-function combineReducers(reducers) {
- var reducerKeys = Object.keys(reducers);
- var finalReducers = {};
- for (var i = 0; i < reducerKeys.length; i++) {
- var key = reducerKeys[i];
-
- if (process.env.NODE_ENV !== 'production') {
- if (typeof reducers[key] === 'undefined') {
- (0, _warning2['default'])('No reducer provided for key "' + key + '"');
- }
- }
-
- if (typeof reducers[key] === 'function') {
- finalReducers[key] = reducers[key];
- }
- }
- var finalReducerKeys = Object.keys(finalReducers);
-
- if (process.env.NODE_ENV !== 'production') {
- var unexpectedKeyCache = {};
- }
-
- var sanityError;
- try {
- assertReducerSanity(finalReducers);
- } catch (e) {
- sanityError = e;
- }
-
- return function combination() {
- var state = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
- var action = arguments[1];
-
- if (sanityError) {
- throw sanityError;
- }
-
- if (process.env.NODE_ENV !== 'production') {
- var warningMessage = getUnexpectedStateShapeWarningMessage(state, finalReducers, action, unexpectedKeyCache);
- if (warningMessage) {
- (0, _warning2['default'])(warningMessage);
- }
- }
-
- var hasChanged = false;
- var nextState = {};
- for (var i = 0; i < finalReducerKeys.length; i++) {
- var key = finalReducerKeys[i];
- var reducer = finalReducers[key];
- var previousStateForKey = state[key];
- var nextStateForKey = reducer(previousStateForKey, action);
- if (typeof nextStateForKey === 'undefined') {
- var errorMessage = getUndefinedStateErrorMessage(key, action);
- throw new Error(errorMessage);
- }
- nextState[key] = nextStateForKey;
- hasChanged = hasChanged || nextStateForKey !== previousStateForKey;
- }
- return hasChanged ? nextState : state;
- };
-}
-}).call(this,require('_process'))
-
-},{"./createStore":220,"./utils/warning":221,"_process":43,"lodash/isPlainObject":41}],219:[function(require,module,exports){
-"use strict";
-
-exports.__esModule = true;
-exports["default"] = compose;
-/**
- * Composes single-argument functions from right to left. The rightmost
- * function can take multiple arguments as it provides the signature for
- * the resulting composite function.
- *
- * @param {...Function} funcs The functions to compose.
- * @returns {Function} A function obtained by composing the argument functions
- * from right to left. For example, compose(f, g, h) is identical to doing
- * (...args) => f(g(h(...args))).
- */
-
-function compose() {
- for (var _len = arguments.length, funcs = Array(_len), _key = 0; _key < _len; _key++) {
- funcs[_key] = arguments[_key];
- }
-
- if (funcs.length === 0) {
- return function (arg) {
- return arg;
- };
- }
-
- if (funcs.length === 1) {
- return funcs[0];
- }
-
- var last = funcs[funcs.length - 1];
- var rest = funcs.slice(0, -1);
- return function () {
- return rest.reduceRight(function (composed, f) {
- return f(composed);
- }, last.apply(undefined, arguments));
- };
-}
-},{}],220:[function(require,module,exports){
-'use strict';
-
-exports.__esModule = true;
-exports.ActionTypes = undefined;
-exports['default'] = createStore;
-
-var _isPlainObject = require('lodash/isPlainObject');
-
-var _isPlainObject2 = _interopRequireDefault(_isPlainObject);
-
-var _symbolObservable = require('symbol-observable');
-
-var _symbolObservable2 = _interopRequireDefault(_symbolObservable);
-
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
-
-/**
- * These are private action types reserved by Redux.
- * For any unknown actions, you must return the current state.
- * If the current state is undefined, you must return the initial state.
- * Do not reference these action types directly in your code.
- */
-var ActionTypes = exports.ActionTypes = {
- INIT: '@@redux/INIT'
-};
-
-/**
- * Creates a Redux store that holds the state tree.
- * The only way to change the data in the store is to call `dispatch()` on it.
- *
- * There should only be a single store in your app. To specify how different
- * parts of the state tree respond to actions, you may combine several reducers
- * into a single reducer function by using `combineReducers`.
- *
- * @param {Function} reducer A function that returns the next state tree, given
- * the current state tree and the action to handle.
- *
- * @param {any} [preloadedState] The initial state. You may optionally specify it
- * to hydrate the state from the server in universal apps, or to restore a
- * previously serialized user session.
- * If you use `combineReducers` to produce the root reducer function, this must be
- * an object with the same shape as `combineReducers` keys.
- *
- * @param {Function} enhancer The store enhancer. You may optionally specify it
- * to enhance the store with third-party capabilities such as middleware,
- * time travel, persistence, etc. The only store enhancer that ships with Redux
- * is `applyMiddleware()`.
- *
- * @returns {Store} A Redux store that lets you read the state, dispatch actions
- * and subscribe to changes.
- */
-function createStore(reducer, preloadedState, enhancer) {
- var _ref2;
-
- if (typeof preloadedState === 'function' && typeof enhancer === 'undefined') {
- enhancer = preloadedState;
- preloadedState = undefined;
- }
-
- if (typeof enhancer !== 'undefined') {
- if (typeof enhancer !== 'function') {
- throw new Error('Expected the enhancer to be a function.');
- }
-
- return enhancer(createStore)(reducer, preloadedState);
- }
-
- if (typeof reducer !== 'function') {
- throw new Error('Expected the reducer to be a function.');
- }
-
- var currentReducer = reducer;
- var currentState = preloadedState;
- var currentListeners = [];
- var nextListeners = currentListeners;
- var isDispatching = false;
-
- function ensureCanMutateNextListeners() {
- if (nextListeners === currentListeners) {
- nextListeners = currentListeners.slice();
- }
- }
-
- /**
- * Reads the state tree managed by the store.
- *
- * @returns {any} The current state tree of your application.
- */
- function getState() {
- return currentState;
- }
-
- /**
- * Adds a change listener. It will be called any time an action is dispatched,
- * and some part of the state tree may potentially have changed. You may then
- * call `getState()` to read the current state tree inside the callback.
- *
- * You may call `dispatch()` from a change listener, with the following
- * caveats:
- *
- * 1. The subscriptions are snapshotted just before every `dispatch()` call.
- * If you subscribe or unsubscribe while the listeners are being invoked, this
- * will not have any effect on the `dispatch()` that is currently in progress.
- * However, the next `dispatch()` call, whether nested or not, will use a more
- * recent snapshot of the subscription list.
- *
- * 2. The listener should not expect to see all state changes, as the state
- * might have been updated multiple times during a nested `dispatch()` before
- * the listener is called. It is, however, guaranteed that all subscribers
- * registered before the `dispatch()` started will be called with the latest
- * state by the time it exits.
- *
- * @param {Function} listener A callback to be invoked on every dispatch.
- * @returns {Function} A function to remove this change listener.
- */
- function subscribe(listener) {
- if (typeof listener !== 'function') {
- throw new Error('Expected listener to be a function.');
- }
-
- var isSubscribed = true;
-
- ensureCanMutateNextListeners();
- nextListeners.push(listener);
-
- return function unsubscribe() {
- if (!isSubscribed) {
- return;
- }
-
- isSubscribed = false;
-
- ensureCanMutateNextListeners();
- var index = nextListeners.indexOf(listener);
- nextListeners.splice(index, 1);
- };
- }
-
- /**
- * Dispatches an action. It is the only way to trigger a state change.
- *
- * The `reducer` function, used to create the store, will be called with the
- * current state tree and the given `action`. Its return value will
- * be considered the **next** state of the tree, and the change listeners
- * will be notified.
- *
- * The base implementation only supports plain object actions. If you want to
- * dispatch a Promise, an Observable, a thunk, or something else, you need to
- * wrap your store creating function into the corresponding middleware. For
- * example, see the documentation for the `redux-thunk` package. Even the
- * middleware will eventually dispatch plain object actions using this method.
- *
- * @param {Object} action A plain object representing “what changed”. It is
- * a good idea to keep actions serializable so you can record and replay user
- * sessions, or use the time travelling `redux-devtools`. An action must have
- * a `type` property which may not be `undefined`. It is a good idea to use
- * string constants for action types.
- *
- * @returns {Object} For convenience, the same action object you dispatched.
- *
- * Note that, if you use a custom middleware, it may wrap `dispatch()` to
- * return something else (for example, a Promise you can await).
- */
- function dispatch(action) {
- if (!(0, _isPlainObject2['default'])(action)) {
- throw new Error('Actions must be plain objects. ' + 'Use custom middleware for async actions.');
- }
-
- if (typeof action.type === 'undefined') {
- throw new Error('Actions may not have an undefined "type" property. ' + 'Have you misspelled a constant?');
- }
-
- if (isDispatching) {
- throw new Error('Reducers may not dispatch actions.');
- }
-
- try {
- isDispatching = true;
- currentState = currentReducer(currentState, action);
- } finally {
- isDispatching = false;
- }
-
- var listeners = currentListeners = nextListeners;
- for (var i = 0; i < listeners.length; i++) {
- listeners[i]();
- }
-
- return action;
- }
-
- /**
- * Replaces the reducer currently used by the store to calculate the state.
- *
- * You might need this if your app implements code splitting and you want to
- * load some of the reducers dynamically. You might also need this if you
- * implement a hot reloading mechanism for Redux.
- *
- * @param {Function} nextReducer The reducer for the store to use instead.
- * @returns {void}
- */
- function replaceReducer(nextReducer) {
- if (typeof nextReducer !== 'function') {
- throw new Error('Expected the nextReducer to be a function.');
- }
-
- currentReducer = nextReducer;
- dispatch({ type: ActionTypes.INIT });
- }
-
- /**
- * Interoperability point for observable/reactive libraries.
- * @returns {observable} A minimal observable of state changes.
- * For more information, see the observable proposal:
- * https://github.com/zenparsing/es-observable
- */
- function observable() {
- var _ref;
-
- var outerSubscribe = subscribe;
- return _ref = {
- /**
- * The minimal observable subscription method.
- * @param {Object} observer Any object that can be used as an observer.
- * The observer object should have a `next` method.
- * @returns {subscription} An object with an `unsubscribe` method that can
- * be used to unsubscribe the observable from the store, and prevent further
- * emission of values from the observable.
- */
- subscribe: function subscribe(observer) {
- if (typeof observer !== 'object') {
- throw new TypeError('Expected the observer to be an object.');
- }
-
- function observeState() {
- if (observer.next) {
- observer.next(getState());
- }
- }
-
- observeState();
- var unsubscribe = outerSubscribe(observeState);
- return { unsubscribe: unsubscribe };
- }
- }, _ref[_symbolObservable2['default']] = function () {
- return this;
- }, _ref;
- }
-
- // When a store is created, an "INIT" action is dispatched so that every
- // reducer returns their initial state. This effectively populates
- // the initial state tree.
- dispatch({ type: ActionTypes.INIT });
-
- return _ref2 = {
- dispatch: dispatch,
- subscribe: subscribe,
- getState: getState,
- replaceReducer: replaceReducer
- }, _ref2[_symbolObservable2['default']] = observable, _ref2;
-}
-},{"lodash/isPlainObject":41,"symbol-observable":223}],221:[function(require,module,exports){
-'use strict';
-
-exports.__esModule = true;
-exports['default'] = warning;
-/**
- * Prints a warning in the console if it exists.
- *
- * @param {String} message The warning message.
- * @returns {void}
- */
-function warning(message) {
- /* eslint-disable no-console */
- if (typeof console !== 'undefined' && typeof console.error === 'function') {
- console.error(message);
- }
- /* eslint-enable no-console */
- try {
- // This error was thrown as a convenience so that if you enable
- // "break on all exceptions" in your console,
- // it would pause the execution at this line.
- throw new Error(message);
- /* eslint-disable no-empty */
- } catch (e) {}
- /* eslint-enable no-empty */
-}
-},{}],222:[function(require,module,exports){
-/**
- * lodash 3.1.2 (Custom Build) <https://lodash.com/>
- * Build: `lodash modern modularize exports="npm" -o ./`
- * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/>
- * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
- * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
- * Available under MIT license <https://lodash.com/license>
- */
-var getNative = require('lodash._getnative'),
- isArguments = require('lodash.isarguments'),
- isArray = require('lodash.isarray');
-
-/** Used to detect unsigned integer values. */
-var reIsUint = /^\d+$/;
-
-/** Used for native method references. */
-var objectProto = Object.prototype;
-
-/** Used to check objects for own properties. */
-var hasOwnProperty = objectProto.hasOwnProperty;
-
-/* Native method references for those with the same name as other `lodash` methods. */
-var nativeKeys = getNative(Object, 'keys');
-
-/**
- * Used as the [maximum length](http://ecma-international.org/ecma-262/6.0/#sec-number.max_safe_integer)
- * of an array-like value.
- */
-var MAX_SAFE_INTEGER = 9007199254740991;
-
-/**
- * The base implementation of `_.property` without support for deep paths.
- *
- * @private
- * @param {string} key The key of the property to get.
- * @returns {Function} Returns the new function.
- */
-function baseProperty(key) {
- return function(object) {
- return object == null ? undefined : object[key];
- };
-}
-
-/**
- * Gets the "length" property value of `object`.
- *
- * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792)
- * that affects Safari on at least iOS 8.1-8.3 ARM64.
- *
- * @private
- * @param {Object} object The object to query.
- * @returns {*} Returns the "length" value.
- */
-var getLength = baseProperty('length');
-
-/**
- * Checks if `value` is array-like.
- *
- * @private
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
- */
-function isArrayLike(value) {
- return value != null && isLength(getLength(value));
-}
-
-/**
- * Checks if `value` is a valid array-like index.
- *
- * @private
- * @param {*} value The value to check.
- * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
- * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
- */
-function isIndex(value, length) {
- value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1;
- length = length == null ? MAX_SAFE_INTEGER : length;
- return value > -1 && value % 1 == 0 && value < length;
-}
-
-/**
- * Checks if `value` is a valid array-like length.
- *
- * **Note:** This function is based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength).
- *
- * @private
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
- */
-function isLength(value) {
- return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
-}
-
-/**
- * A fallback implementation of `Object.keys` which creates an array of the
- * own enumerable property names of `object`.
- *
- * @private
- * @param {Object} object The object to query.
- * @returns {Array} Returns the array of property names.
- */
-function shimKeys(object) {
- var props = keysIn(object),
- propsLength = props.length,
- length = propsLength && object.length;
-
- var allowIndexes = !!length && isLength(length) &&
- (isArray(object) || isArguments(object));
-
- var index = -1,
- result = [];
-
- while (++index < propsLength) {
- var key = props[index];
- if ((allowIndexes && isIndex(key, length)) || hasOwnProperty.call(object, key)) {
- result.push(key);
- }
- }
- return result;
-}
-
-/**
- * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`.
- * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
- *
- * @static
- * @memberOf _
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is an object, else `false`.
- * @example
- *
- * _.isObject({});
- * // => true
- *
- * _.isObject([1, 2, 3]);
- * // => true
- *
- * _.isObject(1);
- * // => false
- */
-function isObject(value) {
- // Avoid a V8 JIT bug in Chrome 19-20.
- // See https://code.google.com/p/v8/issues/detail?id=2291 for more details.
- var type = typeof value;
- return !!value && (type == 'object' || type == 'function');
-}
-
-/**
- * Creates an array of the own enumerable property names of `object`.
- *
- * **Note:** Non-object values are coerced to objects. See the
- * [ES spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys)
- * for more details.
- *
- * @static
- * @memberOf _
- * @category Object
- * @param {Object} object The object to query.
- * @returns {Array} Returns the array of property names.
- * @example
- *
- * function Foo() {
- * this.a = 1;
- * this.b = 2;
- * }
- *
- * Foo.prototype.c = 3;
- *
- * _.keys(new Foo);
- * // => ['a', 'b'] (iteration order is not guaranteed)
- *
- * _.keys('hi');
- * // => ['0', '1']
- */
-var keys = !nativeKeys ? shimKeys : function(object) {
- var Ctor = object == null ? undefined : object.constructor;
- if ((typeof Ctor == 'function' && Ctor.prototype === object) ||
- (typeof object != 'function' && isArrayLike(object))) {
- return shimKeys(object);
- }
- return isObject(object) ? nativeKeys(object) : [];
-};
-
-/**
- * Creates an array of the own and inherited enumerable property names of `object`.
- *
- * **Note:** Non-object values are coerced to objects.
- *
- * @static
- * @memberOf _
- * @category Object
- * @param {Object} object The object to query.
- * @returns {Array} Returns the array of property names.
- * @example
- *
- * function Foo() {
- * this.a = 1;
- * this.b = 2;
- * }
- *
- * Foo.prototype.c = 3;
- *
- * _.keysIn(new Foo);
- * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
- */
-function keysIn(object) {
- if (object == null) {
- return [];
- }
- if (!isObject(object)) {
- object = Object(object);
- }
- var length = object.length;
- length = (length && isLength(length) &&
- (isArray(object) || isArguments(object)) && length) || 0;
-
- var Ctor = object.constructor,
- index = -1,
- isProto = typeof Ctor == 'function' && Ctor.prototype === object,
- result = Array(length),
- skipIndexes = length > 0;
-
- while (++index < length) {
- result[index] = (index + '');
- }
- for (var key in object) {
- if (!(skipIndexes && isIndex(key, length)) &&
- !(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
- result.push(key);
- }
- }
- return result;
-}
-
-module.exports = keys;
-
-},{"lodash._getnative":28,"lodash.isarguments":30,"lodash.isarray":31}],223:[function(require,module,exports){
-module.exports = require('./lib/index');
-
-},{"./lib/index":224}],224:[function(require,module,exports){
+},{"./lib/index":59}],59:[function(require,module,exports){
(function (global){
-'use strict';
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-
-var _ponyfill = require('./ponyfill');
-
-var _ponyfill2 = _interopRequireDefault(_ponyfill);
-
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
-
-var root; /* global window */
-
-
-if (typeof self !== 'undefined') {
- root = self;
-} else if (typeof window !== 'undefined') {
- root = window;
-} else if (typeof global !== 'undefined') {
- root = global;
-} else if (typeof module !== 'undefined') {
- root = module;
-} else {
- root = Function('return this')();
-}
+"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(exports,"__esModule",{value:!0});var _ponyfill=require("./ponyfill"),_ponyfill2=_interopRequireDefault(_ponyfill),root;root="undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof module?module:Function("return this")();var result=(0,_ponyfill2.default)(root);exports.default=result;
-var result = (0, _ponyfill2['default'])(root);
-exports['default'] = result;
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
-},{"./ponyfill":225}],225:[function(require,module,exports){
-'use strict';
+},{"./ponyfill":60}],60:[function(require,module,exports){
+"use strict";function symbolObservablePonyfill(e){var b,l=e.Symbol;return"function"==typeof l?l.observable?b=l.observable:(b=l("observable"),l.observable=b):b="@@observable",b}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=symbolObservablePonyfill;
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports['default'] = symbolObservablePonyfill;
-function symbolObservablePonyfill(root) {
- var result;
- var _Symbol = root.Symbol;
-
- if (typeof _Symbol === 'function') {
- if (_Symbol.observable) {
- result = _Symbol.observable;
- } else {
- result = _Symbol('observable');
- _Symbol.observable = result;
- }
- } else {
- result = '@@observable';
- }
-
- return result;
-};
},{}],"classnames":[function(require,module,exports){
-/*!
- Copyright (c) 2016 Jed Watson.
- Licensed under the MIT License (MIT), see
- http://jedwatson.github.io/classnames
-*/
-/* global define */
-
-(function () {
- 'use strict';
-
- var hasOwn = {}.hasOwnProperty;
-
- function classNames () {
- var classes = [];
-
- for (var i = 0; i < arguments.length; i++) {
- var arg = arguments[i];
- if (!arg) continue;
-
- var argType = typeof arg;
-
- if (argType === 'string' || argType === 'number') {
- classes.push(arg);
- } else if (Array.isArray(arg)) {
- classes.push(classNames.apply(null, arg));
- } else if (argType === 'object') {
- for (var key in arg) {
- if (hasOwn.call(arg, key) && arg[key]) {
- classes.push(key);
- }
- }
- }
- }
-
- return classes.join(' ');
- }
-
- if (typeof module !== 'undefined' && module.exports) {
- module.exports = classNames;
- } else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {
- // register as 'classnames', consistent with npm package name
- define('classnames', [], function () {
- return classNames;
- });
- } else {
- window.classNames = classNames;
- }
-}());
+!function(){"use strict";function e(){for(var r=[],o=0;o<arguments.length;o++){var f=arguments[o];if(f){var i=typeof f;if("string"===i||"number"===i)r.push(f);else if(Array.isArray(f))r.push(e.apply(null,f));else if("object"===i)for(var t in f)n.call(f,t)&&f[t]&&r.push(t)}}return r.join(" ")}var n={}.hasOwnProperty;"undefined"!=typeof module&&module.exports?module.exports=e:"function"==typeof define&&"object"==typeof define.amd&&define.amd?define("classnames",[],function(){return e}):window.classNames=e}();
},{}],"lodash":[function(require,module,exports){
(function (global){
-/**
- * @license
- * Lodash <https://lodash.com/>
- * Copyright JS Foundation and other contributors <https://js.foundation/>
- * Released under MIT license <https://lodash.com/license>
- * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
- * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
- */
-;(function() {
-
- /** Used as a safe reference for `undefined` in pre-ES5 environments. */
- var undefined;
-
- /** Used as the semantic version number. */
- var VERSION = '4.17.4';
-
- /** Used as the size to enable large array optimizations. */
- var LARGE_ARRAY_SIZE = 200;
-
- /** Error message constants. */
- var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.',
- FUNC_ERROR_TEXT = 'Expected a function';
-
- /** Used to stand-in for `undefined` hash values. */
- var HASH_UNDEFINED = '__lodash_hash_undefined__';
-
- /** Used as the maximum memoize cache size. */
- var MAX_MEMOIZE_SIZE = 500;
-
- /** Used as the internal argument placeholder. */
- var PLACEHOLDER = '__lodash_placeholder__';
-
- /** Used to compose bitmasks for cloning. */
- var CLONE_DEEP_FLAG = 1,
- CLONE_FLAT_FLAG = 2,
- CLONE_SYMBOLS_FLAG = 4;
-
- /** Used to compose bitmasks for value comparisons. */
- var COMPARE_PARTIAL_FLAG = 1,
- COMPARE_UNORDERED_FLAG = 2;
-
- /** Used to compose bitmasks for function metadata. */
- var WRAP_BIND_FLAG = 1,
- WRAP_BIND_KEY_FLAG = 2,
- WRAP_CURRY_BOUND_FLAG = 4,
- WRAP_CURRY_FLAG = 8,
- WRAP_CURRY_RIGHT_FLAG = 16,
- WRAP_PARTIAL_FLAG = 32,
- WRAP_PARTIAL_RIGHT_FLAG = 64,
- WRAP_ARY_FLAG = 128,
- WRAP_REARG_FLAG = 256,
- WRAP_FLIP_FLAG = 512;
-
- /** Used as default options for `_.truncate`. */
- var DEFAULT_TRUNC_LENGTH = 30,
- DEFAULT_TRUNC_OMISSION = '...';
-
- /** Used to detect hot functions by number of calls within a span of milliseconds. */
- var HOT_COUNT = 800,
- HOT_SPAN = 16;
-
- /** Used to indicate the type of lazy iteratees. */
- var LAZY_FILTER_FLAG = 1,
- LAZY_MAP_FLAG = 2,
- LAZY_WHILE_FLAG = 3;
-
- /** Used as references for various `Number` constants. */
- var INFINITY = 1 / 0,
- MAX_SAFE_INTEGER = 9007199254740991,
- MAX_INTEGER = 1.7976931348623157e+308,
- NAN = 0 / 0;
-
- /** Used as references for the maximum length and index of an array. */
- var MAX_ARRAY_LENGTH = 4294967295,
- MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1,
- HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
-
- /** Used to associate wrap methods with their bit flags. */
- var wrapFlags = [
- ['ary', WRAP_ARY_FLAG],
- ['bind', WRAP_BIND_FLAG],
- ['bindKey', WRAP_BIND_KEY_FLAG],
- ['curry', WRAP_CURRY_FLAG],
- ['curryRight', WRAP_CURRY_RIGHT_FLAG],
- ['flip', WRAP_FLIP_FLAG],
- ['partial', WRAP_PARTIAL_FLAG],
- ['partialRight', WRAP_PARTIAL_RIGHT_FLAG],
- ['rearg', WRAP_REARG_FLAG]
- ];
-
- /** `Object#toString` result references. */
- var argsTag = '[object Arguments]',
- arrayTag = '[object Array]',
- asyncTag = '[object AsyncFunction]',
- boolTag = '[object Boolean]',
- dateTag = '[object Date]',
- domExcTag = '[object DOMException]',
- errorTag = '[object Error]',
- funcTag = '[object Function]',
- genTag = '[object GeneratorFunction]',
- mapTag = '[object Map]',
- numberTag = '[object Number]',
- nullTag = '[object Null]',
- objectTag = '[object Object]',
- promiseTag = '[object Promise]',
- proxyTag = '[object Proxy]',
- regexpTag = '[object RegExp]',
- setTag = '[object Set]',
- stringTag = '[object String]',
- symbolTag = '[object Symbol]',
- undefinedTag = '[object Undefined]',
- weakMapTag = '[object WeakMap]',
- weakSetTag = '[object WeakSet]';
-
- var arrayBufferTag = '[object ArrayBuffer]',
- dataViewTag = '[object DataView]',
- float32Tag = '[object Float32Array]',
- float64Tag = '[object Float64Array]',
- int8Tag = '[object Int8Array]',
- int16Tag = '[object Int16Array]',
- int32Tag = '[object Int32Array]',
- uint8Tag = '[object Uint8Array]',
- uint8ClampedTag = '[object Uint8ClampedArray]',
- uint16Tag = '[object Uint16Array]',
- uint32Tag = '[object Uint32Array]';
-
- /** Used to match empty string literals in compiled template source. */
- var reEmptyStringLeading = /\b__p \+= '';/g,
- reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
- reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
-
- /** Used to match HTML entities and HTML characters. */
- var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g,
- reUnescapedHtml = /[&<>"']/g,
- reHasEscapedHtml = RegExp(reEscapedHtml.source),
- reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
-
- /** Used to match template delimiters. */
- var reEscape = /<%-([\s\S]+?)%>/g,
- reEvaluate = /<%([\s\S]+?)%>/g,
- reInterpolate = /<%=([\s\S]+?)%>/g;
-
- /** Used to match property names within property paths. */
- var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
- reIsPlainProp = /^\w*$/,
- reLeadingDot = /^\./,
- rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
-
- /**
- * Used to match `RegExp`
- * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
- */
- var reRegExpChar = /[\\^$.*+?()[\]{}|]/g,
- reHasRegExpChar = RegExp(reRegExpChar.source);
-
- /** Used to match leading and trailing whitespace. */
- var reTrim = /^\s+|\s+$/g,
- reTrimStart = /^\s+/,
- reTrimEnd = /\s+$/;
-
- /** Used to match wrap detail comments. */
- var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,
- reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/,
- reSplitDetails = /,? & /;
-
- /** Used to match words composed of alphanumeric characters. */
- var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
-
- /** Used to match backslashes in property paths. */
- var reEscapeChar = /\\(\\)?/g;
-
- /**
- * Used to match
- * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components).
- */
- var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
-
- /** Used to match `RegExp` flags from their coerced string values. */
- var reFlags = /\w*$/;
-
- /** Used to detect bad signed hexadecimal string values. */
- var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
-
- /** Used to detect binary string values. */
- var reIsBinary = /^0b[01]+$/i;
-
- /** Used to detect host constructors (Safari). */
- var reIsHostCtor = /^\[object .+?Constructor\]$/;
-
- /** Used to detect octal string values. */
- var reIsOctal = /^0o[0-7]+$/i;
-
- /** Used to detect unsigned integer values. */
- var reIsUint = /^(?:0|[1-9]\d*)$/;
-
- /** Used to match Latin Unicode letters (excluding mathematical operators). */
- var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
-
- /** Used to ensure capturing order of template delimiters. */
- var reNoMatch = /($^)/;
-
- /** Used to match unescaped characters in compiled string literals. */
- var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
-
- /** Used to compose unicode character classes. */
- var rsAstralRange = '\\ud800-\\udfff',
- rsComboMarksRange = '\\u0300-\\u036f',
- reComboHalfMarksRange = '\\ufe20-\\ufe2f',
- rsComboSymbolsRange = '\\u20d0-\\u20ff',
- rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
- rsDingbatRange = '\\u2700-\\u27bf',
- rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff',
- rsMathOpRange = '\\xac\\xb1\\xd7\\xf7',
- rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf',
- rsPunctuationRange = '\\u2000-\\u206f',
- rsSpaceRange = ' \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000',
- rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde',
- rsVarRange = '\\ufe0e\\ufe0f',
- rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
-
- /** Used to compose unicode capture groups. */
- var rsApos = "['\u2019]",
- rsAstral = '[' + rsAstralRange + ']',
- rsBreak = '[' + rsBreakRange + ']',
- rsCombo = '[' + rsComboRange + ']',
- rsDigits = '\\d+',
- rsDingbat = '[' + rsDingbatRange + ']',
- rsLower = '[' + rsLowerRange + ']',
- rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',
- rsFitz = '\\ud83c[\\udffb-\\udfff]',
- rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
- rsNonAstral = '[^' + rsAstralRange + ']',
- rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
- rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
- rsUpper = '[' + rsUpperRange + ']',
- rsZWJ = '\\u200d';
-
- /** Used to compose unicode regexes. */
- var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',
- rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',
- rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',
- rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',
- reOptMod = rsModifier + '?',
- rsOptVar = '[' + rsVarRange + ']?',
- rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
- rsOrdLower = '\\d*(?:(?:1st|2nd|3rd|(?![123])\\dth)\\b)',
- rsOrdUpper = '\\d*(?:(?:1ST|2ND|3RD|(?![123])\\dTH)\\b)',
- rsSeq = rsOptVar + reOptMod + rsOptJoin,
- rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq,
- rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
-
- /** Used to match apostrophes. */
- var reApos = RegExp(rsApos, 'g');
-
- /**
- * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and
- * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).
- */
- var reComboMark = RegExp(rsCombo, 'g');
-
- /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
- var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
-
- /** Used to match complex or compound words. */
- var reUnicodeWord = RegExp([
- rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',
- rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',
- rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,
- rsUpper + '+' + rsOptContrUpper,
- rsOrdUpper,
- rsOrdLower,
- rsDigits,
- rsEmoji
- ].join('|'), 'g');
-
- /** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */
- var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');
-
- /** Used to detect strings that need a more robust regexp to match words. */
- var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;
-
- /** Used to assign default `context` object properties. */
- var contextProps = [
- 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array',
- 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object',
- 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array',
- 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap',
- '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout'
- ];
-
- /** Used to make template sourceURLs easier to identify. */
- var templateCounter = -1;
-
- /** Used to identify `toStringTag` values of typed arrays. */
- var typedArrayTags = {};
- typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
- typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
- typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
- typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
- typedArrayTags[uint32Tag] = true;
- typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
- typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
- typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
- typedArrayTags[errorTag] = typedArrayTags[funcTag] =
- typedArrayTags[mapTag] = typedArrayTags[numberTag] =
- typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
- typedArrayTags[setTag] = typedArrayTags[stringTag] =
- typedArrayTags[weakMapTag] = false;
-
- /** Used to identify `toStringTag` values supported by `_.clone`. */
- var cloneableTags = {};
- cloneableTags[argsTag] = cloneableTags[arrayTag] =
- cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
- cloneableTags[boolTag] = cloneableTags[dateTag] =
- cloneableTags[float32Tag] = cloneableTags[float64Tag] =
- cloneableTags[int8Tag] = cloneableTags[int16Tag] =
- cloneableTags[int32Tag] = cloneableTags[mapTag] =
- cloneableTags[numberTag] = cloneableTags[objectTag] =
- cloneableTags[regexpTag] = cloneableTags[setTag] =
- cloneableTags[stringTag] = cloneableTags[symbolTag] =
- cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
- cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
- cloneableTags[errorTag] = cloneableTags[funcTag] =
- cloneableTags[weakMapTag] = false;
-
- /** Used to map Latin Unicode letters to basic Latin letters. */
- var deburredLetters = {
- // Latin-1 Supplement block.
- '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A',
- '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a',
- '\xc7': 'C', '\xe7': 'c',
- '\xd0': 'D', '\xf0': 'd',
- '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E',
- '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e',
- '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I',
- '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i',
- '\xd1': 'N', '\xf1': 'n',
- '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O',
- '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o',
- '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U',
- '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u',
- '\xdd': 'Y', '\xfd': 'y', '\xff': 'y',
- '\xc6': 'Ae', '\xe6': 'ae',
- '\xde': 'Th', '\xfe': 'th',
- '\xdf': 'ss',
- // Latin Extended-A block.
- '\u0100': 'A', '\u0102': 'A', '\u0104': 'A',
- '\u0101': 'a', '\u0103': 'a', '\u0105': 'a',
- '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C',
- '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c',
- '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd',
- '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E',
- '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e',
- '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G',
- '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g',
- '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h',
- '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I',
- '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i',
- '\u0134': 'J', '\u0135': 'j',
- '\u0136': 'K', '\u0137': 'k', '\u0138': 'k',
- '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L',
- '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l',
- '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N',
- '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n',
- '\u014c': 'O', '\u014e': 'O', '\u0150': 'O',
- '\u014d': 'o', '\u014f': 'o', '\u0151': 'o',
- '\u0154': 'R', '\u0156': 'R', '\u0158': 'R',
- '\u0155': 'r', '\u0157': 'r', '\u0159': 'r',
- '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S',
- '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's',
- '\u0162': 'T', '\u0164': 'T', '\u0166': 'T',
- '\u0163': 't', '\u0165': 't', '\u0167': 't',
- '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U',
- '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u',
- '\u0174': 'W', '\u0175': 'w',
- '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y',
- '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z',
- '\u017a': 'z', '\u017c': 'z', '\u017e': 'z',
- '\u0132': 'IJ', '\u0133': 'ij',
- '\u0152': 'Oe', '\u0153': 'oe',
- '\u0149': "'n", '\u017f': 's'
- };
-
- /** Used to map characters to HTML entities. */
- var htmlEscapes = {
- '&': '&amp;',
- '<': '&lt;',
- '>': '&gt;',
- '"': '&quot;',
- "'": '&#39;'
- };
-
- /** Used to map HTML entities to characters. */
- var htmlUnescapes = {
- '&amp;': '&',
- '&lt;': '<',
- '&gt;': '>',
- '&quot;': '"',
- '&#39;': "'"
- };
-
- /** Used to escape characters for inclusion in compiled string literals. */
- var stringEscapes = {
- '\\': '\\',
- "'": "'",
- '\n': 'n',
- '\r': 'r',
- '\u2028': 'u2028',
- '\u2029': 'u2029'
- };
-
- /** Built-in method references without a dependency on `root`. */
- var freeParseFloat = parseFloat,
- freeParseInt = parseInt;
-
- /** Detect free variable `global` from Node.js. */
- var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
-
- /** Detect free variable `self`. */
- var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
-
- /** Used as a reference to the global object. */
- var root = freeGlobal || freeSelf || Function('return this')();
-
- /** Detect free variable `exports`. */
- var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
-
- /** Detect free variable `module`. */
- var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
-
- /** Detect the popular CommonJS extension `module.exports`. */
- var moduleExports = freeModule && freeModule.exports === freeExports;
-
- /** Detect free variable `process` from Node.js. */
- var freeProcess = moduleExports && freeGlobal.process;
-
- /** Used to access faster Node.js helpers. */
- var nodeUtil = (function() {
- try {
- return freeProcess && freeProcess.binding && freeProcess.binding('util');
- } catch (e) {}
- }());
-
- /* Node.js helper references. */
- var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer,
- nodeIsDate = nodeUtil && nodeUtil.isDate,
- nodeIsMap = nodeUtil && nodeUtil.isMap,
- nodeIsRegExp = nodeUtil && nodeUtil.isRegExp,
- nodeIsSet = nodeUtil && nodeUtil.isSet,
- nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
-
- /*--------------------------------------------------------------------------*/
-
- /**
- * Adds the key-value `pair` to `map`.
- *
- * @private
- * @param {Object} map The map to modify.
- * @param {Array} pair The key-value pair to add.
- * @returns {Object} Returns `map`.
- */
- function addMapEntry(map, pair) {
- // Don't return `map.set` because it's not chainable in IE 11.
- map.set(pair[0], pair[1]);
- return map;
- }
-
- /**
- * Adds `value` to `set`.
- *
- * @private
- * @param {Object} set The set to modify.
- * @param {*} value The value to add.
- * @returns {Object} Returns `set`.
- */
- function addSetEntry(set, value) {
- // Don't return `set.add` because it's not chainable in IE 11.
- set.add(value);
- return set;
- }
-
- /**
- * A faster alternative to `Function#apply`, this function invokes `func`
- * with the `this` binding of `thisArg` and the arguments of `args`.
- *
- * @private
- * @param {Function} func The function to invoke.
- * @param {*} thisArg The `this` binding of `func`.
- * @param {Array} args The arguments to invoke `func` with.
- * @returns {*} Returns the result of `func`.
- */
- function apply(func, thisArg, args) {
- switch (args.length) {
- case 0: return func.call(thisArg);
- case 1: return func.call(thisArg, args[0]);
- case 2: return func.call(thisArg, args[0], args[1]);
- case 3: return func.call(thisArg, args[0], args[1], args[2]);
- }
- return func.apply(thisArg, args);
- }
-
- /**
- * A specialized version of `baseAggregator` for arrays.
- *
- * @private
- * @param {Array} [array] The array to iterate over.
- * @param {Function} setter The function to set `accumulator` values.
- * @param {Function} iteratee The iteratee to transform keys.
- * @param {Object} accumulator The initial aggregated object.
- * @returns {Function} Returns `accumulator`.
- */
- function arrayAggregator(array, setter, iteratee, accumulator) {
- var index = -1,
- length = array == null ? 0 : array.length;
-
- while (++index < length) {
- var value = array[index];
- setter(accumulator, value, iteratee(value), array);
- }
- return accumulator;
- }
-
- /**
- * A specialized version of `_.forEach` for arrays without support for
- * iteratee shorthands.
- *
- * @private
- * @param {Array} [array] The array to iterate over.
- * @param {Function} iteratee The function invoked per iteration.
- * @returns {Array} Returns `array`.
- */
- function arrayEach(array, iteratee) {
- var index = -1,
- length = array == null ? 0 : array.length;
-
- while (++index < length) {
- if (iteratee(array[index], index, array) === false) {
- break;
- }
- }
- return array;
- }
-
- /**
- * A specialized version of `_.forEachRight` for arrays without support for
- * iteratee shorthands.
- *
- * @private
- * @param {Array} [array] The array to iterate over.
- * @param {Function} iteratee The function invoked per iteration.
- * @returns {Array} Returns `array`.
- */
- function arrayEachRight(array, iteratee) {
- var length = array == null ? 0 : array.length;
-
- while (length--) {
- if (iteratee(array[length], length, array) === false) {
- break;
- }
- }
- return array;
- }
-
- /**
- * A specialized version of `_.every` for arrays without support for
- * iteratee shorthands.
- *
- * @private
- * @param {Array} [array] The array to iterate over.
- * @param {Function} predicate The function invoked per iteration.
- * @returns {boolean} Returns `true` if all elements pass the predicate check,
- * else `false`.
- */
- function arrayEvery(array, predicate) {
- var index = -1,
- length = array == null ? 0 : array.length;
-
- while (++index < length) {
- if (!predicate(array[index], index, array)) {
- return false;
- }
- }
- return true;
- }
-
- /**
- * A specialized version of `_.filter` for arrays without support for
- * iteratee shorthands.
- *
- * @private
- * @param {Array} [array] The array to iterate over.
- * @param {Function} predicate The function invoked per iteration.
- * @returns {Array} Returns the new filtered array.
- */
- function arrayFilter(array, predicate) {
- var index = -1,
- length = array == null ? 0 : array.length,
- resIndex = 0,
- result = [];
-
- while (++index < length) {
- var value = array[index];
- if (predicate(value, index, array)) {
- result[resIndex++] = value;
- }
- }
- return result;
- }
-
- /**
- * A specialized version of `_.includes` for arrays without support for
- * specifying an index to search from.
- *
- * @private
- * @param {Array} [array] The array to inspect.
- * @param {*} target The value to search for.
- * @returns {boolean} Returns `true` if `target` is found, else `false`.
- */
- function arrayIncludes(array, value) {
- var length = array == null ? 0 : array.length;
- return !!length && baseIndexOf(array, value, 0) > -1;
- }
-
- /**
- * This function is like `arrayIncludes` except that it accepts a comparator.
- *
- * @private
- * @param {Array} [array] The array to inspect.
- * @param {*} target The value to search for.
- * @param {Function} comparator The comparator invoked per element.
- * @returns {boolean} Returns `true` if `target` is found, else `false`.
- */
- function arrayIncludesWith(array, value, comparator) {
- var index = -1,
- length = array == null ? 0 : array.length;
-
- while (++index < length) {
- if (comparator(value, array[index])) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * A specialized version of `_.map` for arrays without support for iteratee
- * shorthands.
- *
- * @private
- * @param {Array} [array] The array to iterate over.
- * @param {Function} iteratee The function invoked per iteration.
- * @returns {Array} Returns the new mapped array.
- */
- function arrayMap(array, iteratee) {
- var index = -1,
- length = array == null ? 0 : array.length,
- result = Array(length);
-
- while (++index < length) {
- result[index] = iteratee(array[index], index, array);
- }
- return result;
- }
-
- /**
- * Appends the elements of `values` to `array`.
- *
- * @private
- * @param {Array} array The array to modify.
- * @param {Array} values The values to append.
- * @returns {Array} Returns `array`.
- */
- function arrayPush(array, values) {
- var index = -1,
- length = values.length,
- offset = array.length;
-
- while (++index < length) {
- array[offset + index] = values[index];
- }
- return array;
- }
-
- /**
- * A specialized version of `_.reduce` for arrays without support for
- * iteratee shorthands.
- *
- * @private
- * @param {Array} [array] The array to iterate over.
- * @param {Function} iteratee The function invoked per iteration.
- * @param {*} [accumulator] The initial value.
- * @param {boolean} [initAccum] Specify using the first element of `array` as
- * the initial value.
- * @returns {*} Returns the accumulated value.
- */
- function arrayReduce(array, iteratee, accumulator, initAccum) {
- var index = -1,
- length = array == null ? 0 : array.length;
-
- if (initAccum && length) {
- accumulator = array[++index];
- }
- while (++index < length) {
- accumulator = iteratee(accumulator, array[index], index, array);
- }
- return accumulator;
- }
-
- /**
- * A specialized version of `_.reduceRight` for arrays without support for
- * iteratee shorthands.
- *
- * @private
- * @param {Array} [array] The array to iterate over.
- * @param {Function} iteratee The function invoked per iteration.
- * @param {*} [accumulator] The initial value.
- * @param {boolean} [initAccum] Specify using the last element of `array` as
- * the initial value.
- * @returns {*} Returns the accumulated value.
- */
- function arrayReduceRight(array, iteratee, accumulator, initAccum) {
- var length = array == null ? 0 : array.length;
- if (initAccum && length) {
- accumulator = array[--length];
- }
- while (length--) {
- accumulator = iteratee(accumulator, array[length], length, array);
- }
- return accumulator;
- }
-
- /**
- * A specialized version of `_.some` for arrays without support for iteratee
- * shorthands.
- *
- * @private
- * @param {Array} [array] The array to iterate over.
- * @param {Function} predicate The function invoked per iteration.
- * @returns {boolean} Returns `true` if any element passes the predicate check,
- * else `false`.
- */
- function arraySome(array, predicate) {
- var index = -1,
- length = array == null ? 0 : array.length;
-
- while (++index < length) {
- if (predicate(array[index], index, array)) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * Gets the size of an ASCII `string`.
- *
- * @private
- * @param {string} string The string inspect.
- * @returns {number} Returns the string size.
- */
- var asciiSize = baseProperty('length');
-
- /**
- * Converts an ASCII `string` to an array.
- *
- * @private
- * @param {string} string The string to convert.
- * @returns {Array} Returns the converted array.
- */
- function asciiToArray(string) {
- return string.split('');
- }
-
- /**
- * Splits an ASCII `string` into an array of its words.
- *
- * @private
- * @param {string} The string to inspect.
- * @returns {Array} Returns the words of `string`.
- */
- function asciiWords(string) {
- return string.match(reAsciiWord) || [];
- }
-
- /**
- * The base implementation of methods like `_.findKey` and `_.findLastKey`,
- * without support for iteratee shorthands, which iterates over `collection`
- * using `eachFunc`.
- *
- * @private
- * @param {Array|Object} collection The collection to inspect.
- * @param {Function} predicate The function invoked per iteration.
- * @param {Function} eachFunc The function to iterate over `collection`.
- * @returns {*} Returns the found element or its key, else `undefined`.
- */
- function baseFindKey(collection, predicate, eachFunc) {
- var result;
- eachFunc(collection, function(value, key, collection) {
- if (predicate(value, key, collection)) {
- result = key;
- return false;
- }
- });
- return result;
- }
-
- /**
- * The base implementation of `_.findIndex` and `_.findLastIndex` without
- * support for iteratee shorthands.
- *
- * @private
- * @param {Array} array The array to inspect.
- * @param {Function} predicate The function invoked per iteration.
- * @param {number} fromIndex The index to search from.
- * @param {boolean} [fromRight] Specify iterating from right to left.
- * @returns {number} Returns the index of the matched value, else `-1`.
- */
- function baseFindIndex(array, predicate, fromIndex, fromRight) {
- var length = array.length,
- index = fromIndex + (fromRight ? 1 : -1);
-
- while ((fromRight ? index-- : ++index < length)) {
- if (predicate(array[index], index, array)) {
- return index;
- }
- }
- return -1;
- }
-
- /**
- * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
- *
- * @private
- * @param {Array} array The array to inspect.
- * @param {*} value The value to search for.
- * @param {number} fromIndex The index to search from.
- * @returns {number} Returns the index of the matched value, else `-1`.
- */
- function baseIndexOf(array, value, fromIndex) {
- return value === value
- ? strictIndexOf(array, value, fromIndex)
- : baseFindIndex(array, baseIsNaN, fromIndex);
- }
-
- /**
- * This function is like `baseIndexOf` except that it accepts a comparator.
- *
- * @private
- * @param {Array} array The array to inspect.
- * @param {*} value The value to search for.
- * @param {number} fromIndex The index to search from.
- * @param {Function} comparator The comparator invoked per element.
- * @returns {number} Returns the index of the matched value, else `-1`.
- */
- function baseIndexOfWith(array, value, fromIndex, comparator) {
- var index = fromIndex - 1,
- length = array.length;
-
- while (++index < length) {
- if (comparator(array[index], value)) {
- return index;
- }
- }
- return -1;
- }
-
- /**
- * The base implementation of `_.isNaN` without support for number objects.
- *
- * @private
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
- */
- function baseIsNaN(value) {
- return value !== value;
- }
-
- /**
- * The base implementation of `_.mean` and `_.meanBy` without support for
- * iteratee shorthands.
- *
- * @private
- * @param {Array} array The array to iterate over.
- * @param {Function} iteratee The function invoked per iteration.
- * @returns {number} Returns the mean.
- */
- function baseMean(array, iteratee) {
- var length = array == null ? 0 : array.length;
- return length ? (baseSum(array, iteratee) / length) : NAN;
- }
-
- /**
- * The base implementation of `_.property` without support for deep paths.
- *
- * @private
- * @param {string} key The key of the property to get.
- * @returns {Function} Returns the new accessor function.
- */
- function baseProperty(key) {
- return function(object) {
- return object == null ? undefined : object[key];
- };
- }
-
- /**
- * The base implementation of `_.propertyOf` without support for deep paths.
- *
- * @private
- * @param {Object} object The object to query.
- * @returns {Function} Returns the new accessor function.
- */
- function basePropertyOf(object) {
- return function(key) {
- return object == null ? undefined : object[key];
- };
- }
-
- /**
- * The base implementation of `_.reduce` and `_.reduceRight`, without support
- * for iteratee shorthands, which iterates over `collection` using `eachFunc`.
- *
- * @private
- * @param {Array|Object} collection The collection to iterate over.
- * @param {Function} iteratee The function invoked per iteration.
- * @param {*} accumulator The initial value.
- * @param {boolean} initAccum Specify using the first or last element of
- * `collection` as the initial value.
- * @param {Function} eachFunc The function to iterate over `collection`.
- * @returns {*} Returns the accumulated value.
- */
- function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {
- eachFunc(collection, function(value, index, collection) {
- accumulator = initAccum
- ? (initAccum = false, value)
- : iteratee(accumulator, value, index, collection);
- });
- return accumulator;
- }
-
- /**
- * The base implementation of `_.sortBy` which uses `comparer` to define the
- * sort order of `array` and replaces criteria objects with their corresponding
- * values.
- *
- * @private
- * @param {Array} array The array to sort.
- * @param {Function} comparer The function to define sort order.
- * @returns {Array} Returns `array`.
- */
- function baseSortBy(array, comparer) {
- var length = array.length;
-
- array.sort(comparer);
- while (length--) {
- array[length] = array[length].value;
- }
- return array;
- }
-
- /**
- * The base implementation of `_.sum` and `_.sumBy` without support for
- * iteratee shorthands.
- *
- * @private
- * @param {Array} array The array to iterate over.
- * @param {Function} iteratee The function invoked per iteration.
- * @returns {number} Returns the sum.
- */
- function baseSum(array, iteratee) {
- var result,
- index = -1,
- length = array.length;
-
- while (++index < length) {
- var current = iteratee(array[index]);
- if (current !== undefined) {
- result = result === undefined ? current : (result + current);
- }
- }
- return result;
- }
-
- /**
- * The base implementation of `_.times` without support for iteratee shorthands
- * or max array length checks.
- *
- * @private
- * @param {number} n The number of times to invoke `iteratee`.
- * @param {Function} iteratee The function invoked per iteration.
- * @returns {Array} Returns the array of results.
- */
- function baseTimes(n, iteratee) {
- var index = -1,
- result = Array(n);
-
- while (++index < n) {
- result[index] = iteratee(index);
- }
- return result;
- }
-
- /**
- * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array
- * of key-value pairs for `object` corresponding to the property names of `props`.
- *
- * @private
- * @param {Object} object The object to query.
- * @param {Array} props The property names to get values for.
- * @returns {Object} Returns the key-value pairs.
- */
- function baseToPairs(object, props) {
- return arrayMap(props, function(key) {
- return [key, object[key]];
- });
- }
-
- /**
- * The base implementation of `_.unary` without support for storing metadata.
- *
- * @private
- * @param {Function} func The function to cap arguments for.
- * @returns {Function} Returns the new capped function.
- */
- function baseUnary(func) {
- return function(value) {
- return func(value);
- };
- }
-
- /**
- * The base implementation of `_.values` and `_.valuesIn` which creates an
- * array of `object` property values corresponding to the property names
- * of `props`.
- *
- * @private
- * @param {Object} object The object to query.
- * @param {Array} props The property names to get values for.
- * @returns {Object} Returns the array of property values.
- */
- function baseValues(object, props) {
- return arrayMap(props, function(key) {
- return object[key];
- });
- }
-
- /**
- * Checks if a `cache` value for `key` exists.
- *
- * @private
- * @param {Object} cache The cache to query.
- * @param {string} key The key of the entry to check.
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
- */
- function cacheHas(cache, key) {
- return cache.has(key);
- }
-
- /**
- * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol
- * that is not found in the character symbols.
- *
- * @private
- * @param {Array} strSymbols The string symbols to inspect.
- * @param {Array} chrSymbols The character symbols to find.
- * @returns {number} Returns the index of the first unmatched string symbol.
- */
- function charsStartIndex(strSymbols, chrSymbols) {
- var index = -1,
- length = strSymbols.length;
-
- while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
- return index;
- }
-
- /**
- * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol
- * that is not found in the character symbols.
- *
- * @private
- * @param {Array} strSymbols The string symbols to inspect.
- * @param {Array} chrSymbols The character symbols to find.
- * @returns {number} Returns the index of the last unmatched string symbol.
- */
- function charsEndIndex(strSymbols, chrSymbols) {
- var index = strSymbols.length;
-
- while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
- return index;
- }
-
- /**
- * Gets the number of `placeholder` occurrences in `array`.
- *
- * @private
- * @param {Array} array The array to inspect.
- * @param {*} placeholder The placeholder to search for.
- * @returns {number} Returns the placeholder count.
- */
- function countHolders(array, placeholder) {
- var length = array.length,
- result = 0;
-
- while (length--) {
- if (array[length] === placeholder) {
- ++result;
- }
- }
- return result;
- }
-
- /**
- * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A
- * letters to basic Latin letters.
- *
- * @private
- * @param {string} letter The matched letter to deburr.
- * @returns {string} Returns the deburred letter.
- */
- var deburrLetter = basePropertyOf(deburredLetters);
-
- /**
- * Used by `_.escape` to convert characters to HTML entities.
- *
- * @private
- * @param {string} chr The matched character to escape.
- * @returns {string} Returns the escaped character.
- */
- var escapeHtmlChar = basePropertyOf(htmlEscapes);
-
- /**
- * Used by `_.template` to escape characters for inclusion in compiled string literals.
- *
- * @private
- * @param {string} chr The matched character to escape.
- * @returns {string} Returns the escaped character.
- */
- function escapeStringChar(chr) {
- return '\\' + stringEscapes[chr];
- }
-
- /**
- * Gets the value at `key` of `object`.
- *
- * @private
- * @param {Object} [object] The object to query.
- * @param {string} key The key of the property to get.
- * @returns {*} Returns the property value.
- */
- function getValue(object, key) {
- return object == null ? undefined : object[key];
- }
-
- /**
- * Checks if `string` contains Unicode symbols.
- *
- * @private
- * @param {string} string The string to inspect.
- * @returns {boolean} Returns `true` if a symbol is found, else `false`.
- */
- function hasUnicode(string) {
- return reHasUnicode.test(string);
- }
-
- /**
- * Checks if `string` contains a word composed of Unicode symbols.
- *
- * @private
- * @param {string} string The string to inspect.
- * @returns {boolean} Returns `true` if a word is found, else `false`.
- */
- function hasUnicodeWord(string) {
- return reHasUnicodeWord.test(string);
- }
-
- /**
- * Converts `iterator` to an array.
- *
- * @private
- * @param {Object} iterator The iterator to convert.
- * @returns {Array} Returns the converted array.
- */
- function iteratorToArray(iterator) {
- var data,
- result = [];
-
- while (!(data = iterator.next()).done) {
- result.push(data.value);
- }
- return result;
- }
-
- /**
- * Converts `map` to its key-value pairs.
- *
- * @private
- * @param {Object} map The map to convert.
- * @returns {Array} Returns the key-value pairs.
- */
- function mapToArray(map) {
- var index = -1,
- result = Array(map.size);
-
- map.forEach(function(value, key) {
- result[++index] = [key, value];
- });
- return result;
- }
-
- /**
- * Creates a unary function that invokes `func` with its argument transformed.
- *
- * @private
- * @param {Function} func The function to wrap.
- * @param {Function} transform The argument transform.
- * @returns {Function} Returns the new function.
- */
- function overArg(func, transform) {
- return function(arg) {
- return func(transform(arg));
- };
- }
-
- /**
- * Replaces all `placeholder` elements in `array` with an internal placeholder
- * and returns an array of their indexes.
- *
- * @private
- * @param {Array} array The array to modify.
- * @param {*} placeholder The placeholder to replace.
- * @returns {Array} Returns the new array of placeholder indexes.
- */
- function replaceHolders(array, placeholder) {
- var index = -1,
- length = array.length,
- resIndex = 0,
- result = [];
-
- while (++index < length) {
- var value = array[index];
- if (value === placeholder || value === PLACEHOLDER) {
- array[index] = PLACEHOLDER;
- result[resIndex++] = index;
- }
- }
- return result;
- }
-
- /**
- * Converts `set` to an array of its values.
- *
- * @private
- * @param {Object} set The set to convert.
- * @returns {Array} Returns the values.
- */
- function setToArray(set) {
- var index = -1,
- result = Array(set.size);
-
- set.forEach(function(value) {
- result[++index] = value;
- });
- return result;
- }
-
- /**
- * Converts `set` to its value-value pairs.
- *
- * @private
- * @param {Object} set The set to convert.
- * @returns {Array} Returns the value-value pairs.
- */
- function setToPairs(set) {
- var index = -1,
- result = Array(set.size);
-
- set.forEach(function(value) {
- result[++index] = [value, value];
- });
- return result;
- }
-
- /**
- * A specialized version of `_.indexOf` which performs strict equality
- * comparisons of values, i.e. `===`.
- *
- * @private
- * @param {Array} array The array to inspect.
- * @param {*} value The value to search for.
- * @param {number} fromIndex The index to search from.
- * @returns {number} Returns the index of the matched value, else `-1`.
- */
- function strictIndexOf(array, value, fromIndex) {
- var index = fromIndex - 1,
- length = array.length;
-
- while (++index < length) {
- if (array[index] === value) {
- return index;
- }
- }
- return -1;
- }
-
- /**
- * A specialized version of `_.lastIndexOf` which performs strict equality
- * comparisons of values, i.e. `===`.
- *
- * @private
- * @param {Array} array The array to inspect.
- * @param {*} value The value to search for.
- * @param {number} fromIndex The index to search from.
- * @returns {number} Returns the index of the matched value, else `-1`.
- */
- function strictLastIndexOf(array, value, fromIndex) {
- var index = fromIndex + 1;
- while (index--) {
- if (array[index] === value) {
- return index;
- }
- }
- return index;
- }
-
- /**
- * Gets the number of symbols in `string`.
- *
- * @private
- * @param {string} string The string to inspect.
- * @returns {number} Returns the string size.
- */
- function stringSize(string) {
- return hasUnicode(string)
- ? unicodeSize(string)
- : asciiSize(string);
- }
-
- /**
- * Converts `string` to an array.
- *
- * @private
- * @param {string} string The string to convert.
- * @returns {Array} Returns the converted array.
- */
- function stringToArray(string) {
- return hasUnicode(string)
- ? unicodeToArray(string)
- : asciiToArray(string);
- }
-
- /**
- * Used by `_.unescape` to convert HTML entities to characters.
- *
- * @private
- * @param {string} chr The matched character to unescape.
- * @returns {string} Returns the unescaped character.
- */
- var unescapeHtmlChar = basePropertyOf(htmlUnescapes);
-
- /**
- * Gets the size of a Unicode `string`.
- *
- * @private
- * @param {string} string The string inspect.
- * @returns {number} Returns the string size.
- */
- function unicodeSize(string) {
- var result = reUnicode.lastIndex = 0;
- while (reUnicode.test(string)) {
- ++result;
- }
- return result;
- }
-
- /**
- * Converts a Unicode `string` to an array.
- *
- * @private
- * @param {string} string The string to convert.
- * @returns {Array} Returns the converted array.
- */
- function unicodeToArray(string) {
- return string.match(reUnicode) || [];
- }
-
- /**
- * Splits a Unicode `string` into an array of its words.
- *
- * @private
- * @param {string} The string to inspect.
- * @returns {Array} Returns the words of `string`.
- */
- function unicodeWords(string) {
- return string.match(reUnicodeWord) || [];
- }
-
- /*--------------------------------------------------------------------------*/
-
- /**
- * Create a new pristine `lodash` function using the `context` object.
- *
- * @static
- * @memberOf _
- * @since 1.1.0
- * @category Util
- * @param {Object} [context=root] The context object.
- * @returns {Function} Returns a new `lodash` function.
- * @example
- *
- * _.mixin({ 'foo': _.constant('foo') });
- *
- * var lodash = _.runInContext();
- * lodash.mixin({ 'bar': lodash.constant('bar') });
- *
- * _.isFunction(_.foo);
- * // => true
- * _.isFunction(_.bar);
- * // => false
- *
- * lodash.isFunction(lodash.foo);
- * // => false
- * lodash.isFunction(lodash.bar);
- * // => true
- *
- * // Create a suped-up `defer` in Node.js.
- * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer;
- */
- var runInContext = (function runInContext(context) {
- context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));
-
- /** Built-in constructor references. */
- var Array = context.Array,
- Date = context.Date,
- Error = context.Error,
- Function = context.Function,
- Math = context.Math,
- Object = context.Object,
- RegExp = context.RegExp,
- String = context.String,
- TypeError = context.TypeError;
-
- /** Used for built-in method references. */
- var arrayProto = Array.prototype,
- funcProto = Function.prototype,
- objectProto = Object.prototype;
-
- /** Used to detect overreaching core-js shims. */
- var coreJsData = context['__core-js_shared__'];
-
- /** Used to resolve the decompiled source of functions. */
- var funcToString = funcProto.toString;
-
- /** Used to check objects for own properties. */
- var hasOwnProperty = objectProto.hasOwnProperty;
-
- /** Used to generate unique IDs. */
- var idCounter = 0;
-
- /** Used to detect methods masquerading as native. */
- var maskSrcKey = (function() {
- var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
- return uid ? ('Symbol(src)_1.' + uid) : '';
- }());
-
- /**
- * Used to resolve the
- * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
- * of values.
- */
- var nativeObjectToString = objectProto.toString;
-
- /** Used to infer the `Object` constructor. */
- var objectCtorString = funcToString.call(Object);
-
- /** Used to restore the original `_` reference in `_.noConflict`. */
- var oldDash = root._;
-
- /** Used to detect if a method is native. */
- var reIsNative = RegExp('^' +
- funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
- .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
- );
-
- /** Built-in value references. */
- var Buffer = moduleExports ? context.Buffer : undefined,
- Symbol = context.Symbol,
- Uint8Array = context.Uint8Array,
- allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined,
- getPrototype = overArg(Object.getPrototypeOf, Object),
- objectCreate = Object.create,
- propertyIsEnumerable = objectProto.propertyIsEnumerable,
- splice = arrayProto.splice,
- spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined,
- symIterator = Symbol ? Symbol.iterator : undefined,
- symToStringTag = Symbol ? Symbol.toStringTag : undefined;
-
- var defineProperty = (function() {
- try {
- var func = getNative(Object, 'defineProperty');
- func({}, '', {});
- return func;
- } catch (e) {}
- }());
-
- /** Mocked built-ins. */
- var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout,
- ctxNow = Date && Date.now !== root.Date.now && Date.now,
- ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;
-
- /* Built-in method references for those with the same name as other `lodash` methods. */
- var nativeCeil = Math.ceil,
- nativeFloor = Math.floor,
- nativeGetSymbols = Object.getOwnPropertySymbols,
- nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,
- nativeIsFinite = context.isFinite,
- nativeJoin = arrayProto.join,
- nativeKeys = overArg(Object.keys, Object),
- nativeMax = Math.max,
- nativeMin = Math.min,
- nativeNow = Date.now,
- nativeParseInt = context.parseInt,
- nativeRandom = Math.random,
- nativeReverse = arrayProto.reverse;
-
- /* Built-in method references that are verified to be native. */
- var DataView = getNative(context, 'DataView'),
- Map = getNative(context, 'Map'),
- Promise = getNative(context, 'Promise'),
- Set = getNative(context, 'Set'),
- WeakMap = getNative(context, 'WeakMap'),
- nativeCreate = getNative(Object, 'create');
-
- /** Used to store function metadata. */
- var metaMap = WeakMap && new WeakMap;
-
- /** Used to lookup unminified function names. */
- var realNames = {};
-
- /** Used to detect maps, sets, and weakmaps. */
- var dataViewCtorString = toSource(DataView),
- mapCtorString = toSource(Map),
- promiseCtorString = toSource(Promise),
- setCtorString = toSource(Set),
- weakMapCtorString = toSource(WeakMap);
-
- /** Used to convert symbols to primitives and strings. */
- var symbolProto = Symbol ? Symbol.prototype : undefined,
- symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,
- symbolToString = symbolProto ? symbolProto.toString : undefined;
-
- /*------------------------------------------------------------------------*/
-
- /**
- * Creates a `lodash` object which wraps `value` to enable implicit method
- * chain sequences. Methods that operate on and return arrays, collections,
- * and functions can be chained together. Methods that retrieve a single value
- * or may return a primitive value will automatically end the chain sequence
- * and return the unwrapped value. Otherwise, the value must be unwrapped
- * with `_#value`.
- *
- * Explicit chain sequences, which must be unwrapped with `_#value`, may be
- * enabled using `_.chain`.
- *
- * The execution of chained methods is lazy, that is, it's deferred until
- * `_#value` is implicitly or explicitly called.
- *
- * Lazy evaluation allows several methods to support shortcut fusion.
- * Shortcut fusion is an optimization to merge iteratee calls; this avoids
- * the creation of intermediate arrays and can greatly reduce the number of
- * iteratee executions. Sections of a chain sequence qualify for shortcut
- * fusion if the section is applied to an array and iteratees accept only
- * one argument. The heuristic for whether a section qualifies for shortcut
- * fusion is subject to change.
- *
- * Chaining is supported in custom builds as long as the `_#value` method is
- * directly or indirectly included in the build.
- *
- * In addition to lodash methods, wrappers have `Array` and `String` methods.
- *
- * The wrapper `Array` methods are:
- * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`
- *
- * The wrapper `String` methods are:
- * `replace` and `split`
- *
- * The wrapper methods that support shortcut fusion are:
- * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,
- * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,
- * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`
- *
- * The chainable wrapper methods are:
- * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,
- * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,
- * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,
- * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,
- * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,
- * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,
- * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,
- * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,
- * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,
- * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,
- * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,
- * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,
- * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,
- * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,
- * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,
- * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,
- * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,
- * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,
- * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,
- * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,
- * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,
- * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,
- * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,
- * `zipObject`, `zipObjectDeep`, and `zipWith`
- *
- * The wrapper methods that are **not** chainable by default are:
- * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,
- * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,
- * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,
- * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,
- * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,
- * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,
- * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,
- * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,
- * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,
- * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,
- * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,
- * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,
- * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,
- * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,
- * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`,
- * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`,
- * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,
- * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,
- * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,
- * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`,
- * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`,
- * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`,
- * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`,
- * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`,
- * `upperFirst`, `value`, and `words`
- *
- * @name _
- * @constructor
- * @category Seq
- * @param {*} value The value to wrap in a `lodash` instance.
- * @returns {Object} Returns the new `lodash` wrapper instance.
- * @example
- *
- * function square(n) {
- * return n * n;
- * }
- *
- * var wrapped = _([1, 2, 3]);
- *
- * // Returns an unwrapped value.
- * wrapped.reduce(_.add);
- * // => 6
- *
- * // Returns a wrapped value.
- * var squares = wrapped.map(square);
- *
- * _.isArray(squares);
- * // => false
- *
- * _.isArray(squares.value());
- * // => true
- */
- function lodash(value) {
- if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
- if (value instanceof LodashWrapper) {
- return value;
- }
- if (hasOwnProperty.call(value, '__wrapped__')) {
- return wrapperClone(value);
- }
- }
- return new LodashWrapper(value);
- }
-
- /**
- * The base implementation of `_.create` without support for assigning
- * properties to the created object.
- *
- * @private
- * @param {Object} proto The object to inherit from.
- * @returns {Object} Returns the new object.
- */
- var baseCreate = (function() {
- function object() {}
- return function(proto) {
- if (!isObject(proto)) {
- return {};
- }
- if (objectCreate) {
- return objectCreate(proto);
- }
- object.prototype = proto;
- var result = new object;
- object.prototype = undefined;
- return result;
- };
- }());
-
- /**
- * The function whose prototype chain sequence wrappers inherit from.
- *
- * @private
- */
- function baseLodash() {
- // No operation performed.
- }
-
- /**
- * The base constructor for creating `lodash` wrapper objects.
- *
- * @private
- * @param {*} value The value to wrap.
- * @param {boolean} [chainAll] Enable explicit method chain sequences.
- */
- function LodashWrapper(value, chainAll) {
- this.__wrapped__ = value;
- this.__actions__ = [];
- this.__chain__ = !!chainAll;
- this.__index__ = 0;
- this.__values__ = undefined;
- }
-
- /**
- * By default, the template delimiters used by lodash are like those in
- * embedded Ruby (ERB) as well as ES2015 template strings. Change the
- * following template settings to use alternative delimiters.
- *
- * @static
- * @memberOf _
- * @type {Object}
- */
- lodash.templateSettings = {
-
- /**
- * Used to detect `data` property values to be HTML-escaped.
- *
- * @memberOf _.templateSettings
- * @type {RegExp}
- */
- 'escape': reEscape,
-
- /**
- * Used to detect code to be evaluated.
- *
- * @memberOf _.templateSettings
- * @type {RegExp}
- */
- 'evaluate': reEvaluate,
-
- /**
- * Used to detect `data` property values to inject.
- *
- * @memberOf _.templateSettings
- * @type {RegExp}
- */
- 'interpolate': reInterpolate,
-
- /**
- * Used to reference the data object in the template text.
- *
- * @memberOf _.templateSettings
- * @type {string}
- */
- 'variable': '',
-
- /**
- * Used to import variables into the compiled template.
- *
- * @memberOf _.templateSettings
- * @type {Object}
- */
- 'imports': {
-
- /**
- * A reference to the `lodash` function.
- *
- * @memberOf _.templateSettings.imports
- * @type {Function}
- */
- '_': lodash
- }
- };
-
- // Ensure wrappers are instances of `baseLodash`.
- lodash.prototype = baseLodash.prototype;
- lodash.prototype.constructor = lodash;
-
- LodashWrapper.prototype = baseCreate(baseLodash.prototype);
- LodashWrapper.prototype.constructor = LodashWrapper;
-
- /*------------------------------------------------------------------------*/
-
- /**
- * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.
- *
- * @private
- * @constructor
- * @param {*} value The value to wrap.
- */
- function LazyWrapper(value) {
- this.__wrapped__ = value;
- this.__actions__ = [];
- this.__dir__ = 1;
- this.__filtered__ = false;
- this.__iteratees__ = [];
- this.__takeCount__ = MAX_ARRAY_LENGTH;
- this.__views__ = [];
- }
-
- /**
- * Creates a clone of the lazy wrapper object.
- *
- * @private
- * @name clone
- * @memberOf LazyWrapper
- * @returns {Object} Returns the cloned `LazyWrapper` object.
- */
- function lazyClone() {
- var result = new LazyWrapper(this.__wrapped__);
- result.__actions__ = copyArray(this.__actions__);
- result.__dir__ = this.__dir__;
- result.__filtered__ = this.__filtered__;
- result.__iteratees__ = copyArray(this.__iteratees__);
- result.__takeCount__ = this.__takeCount__;
- result.__views__ = copyArray(this.__views__);
- return result;
- }
-
- /**
- * Reverses the direction of lazy iteration.
- *
- * @private
- * @name reverse
- * @memberOf LazyWrapper
- * @returns {Object} Returns the new reversed `LazyWrapper` object.
- */
- function lazyReverse() {
- if (this.__filtered__) {
- var result = new LazyWrapper(this);
- result.__dir__ = -1;
- result.__filtered__ = true;
- } else {
- result = this.clone();
- result.__dir__ *= -1;
- }
- return result;
- }
-
- /**
- * Extracts the unwrapped value from its lazy wrapper.
- *
- * @private
- * @name value
- * @memberOf LazyWrapper
- * @returns {*} Returns the unwrapped value.
- */
- function lazyValue() {
- var array = this.__wrapped__.value(),
- dir = this.__dir__,
- isArr = isArray(array),
- isRight = dir < 0,
- arrLength = isArr ? array.length : 0,
- view = getView(0, arrLength, this.__views__),
- start = view.start,
- end = view.end,
- length = end - start,
- index = isRight ? end : (start - 1),
- iteratees = this.__iteratees__,
- iterLength = iteratees.length,
- resIndex = 0,
- takeCount = nativeMin(length, this.__takeCount__);
-
- if (!isArr || (!isRight && arrLength == length && takeCount == length)) {
- return baseWrapperValue(array, this.__actions__);
- }
- var result = [];
-
- outer:
- while (length-- && resIndex < takeCount) {
- index += dir;
-
- var iterIndex = -1,
- value = array[index];
-
- while (++iterIndex < iterLength) {
- var data = iteratees[iterIndex],
- iteratee = data.iteratee,
- type = data.type,
- computed = iteratee(value);
-
- if (type == LAZY_MAP_FLAG) {
- value = computed;
- } else if (!computed) {
- if (type == LAZY_FILTER_FLAG) {
- continue outer;
- } else {
- break outer;
- }
- }
- }
- result[resIndex++] = value;
- }
- return result;
- }
-
- // Ensure `LazyWrapper` is an instance of `baseLodash`.
- LazyWrapper.prototype = baseCreate(baseLodash.prototype);
- LazyWrapper.prototype.constructor = LazyWrapper;
-
- /*------------------------------------------------------------------------*/
-
- /**
- * Creates a hash object.
- *
- * @private
- * @constructor
- * @param {Array} [entries] The key-value pairs to cache.
- */
- function Hash(entries) {
- var index = -1,
- length = entries == null ? 0 : entries.length;
-
- this.clear();
- while (++index < length) {
- var entry = entries[index];
- this.set(entry[0], entry[1]);
- }
- }
-
- /**
- * Removes all key-value entries from the hash.
- *
- * @private
- * @name clear
- * @memberOf Hash
- */
- function hashClear() {
- this.__data__ = nativeCreate ? nativeCreate(null) : {};
- this.size = 0;
- }
-
- /**
- * Removes `key` and its value from the hash.
- *
- * @private
- * @name delete
- * @memberOf Hash
- * @param {Object} hash The hash to modify.
- * @param {string} key The key of the value to remove.
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
- */
- function hashDelete(key) {
- var result = this.has(key) && delete this.__data__[key];
- this.size -= result ? 1 : 0;
- return result;
- }
-
- /**
- * Gets the hash value for `key`.
- *
- * @private
- * @name get
- * @memberOf Hash
- * @param {string} key The key of the value to get.
- * @returns {*} Returns the entry value.
- */
- function hashGet(key) {
- var data = this.__data__;
- if (nativeCreate) {
- var result = data[key];
- return result === HASH_UNDEFINED ? undefined : result;
- }
- return hasOwnProperty.call(data, key) ? data[key] : undefined;
- }
-
- /**
- * Checks if a hash value for `key` exists.
- *
- * @private
- * @name has
- * @memberOf Hash
- * @param {string} key The key of the entry to check.
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
- */
- function hashHas(key) {
- var data = this.__data__;
- return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
- }
-
- /**
- * Sets the hash `key` to `value`.
- *
- * @private
- * @name set
- * @memberOf Hash
- * @param {string} key The key of the value to set.
- * @param {*} value The value to set.
- * @returns {Object} Returns the hash instance.
- */
- function hashSet(key, value) {
- var data = this.__data__;
- this.size += this.has(key) ? 0 : 1;
- data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
- return this;
- }
-
- // Add methods to `Hash`.
- Hash.prototype.clear = hashClear;
- Hash.prototype['delete'] = hashDelete;
- Hash.prototype.get = hashGet;
- Hash.prototype.has = hashHas;
- Hash.prototype.set = hashSet;
-
- /*------------------------------------------------------------------------*/
-
- /**
- * Creates an list cache object.
- *
- * @private
- * @constructor
- * @param {Array} [entries] The key-value pairs to cache.
- */
- function ListCache(entries) {
- var index = -1,
- length = entries == null ? 0 : entries.length;
-
- this.clear();
- while (++index < length) {
- var entry = entries[index];
- this.set(entry[0], entry[1]);
- }
- }
-
- /**
- * Removes all key-value entries from the list cache.
- *
- * @private
- * @name clear
- * @memberOf ListCache
- */
- function listCacheClear() {
- this.__data__ = [];
- this.size = 0;
- }
-
- /**
- * Removes `key` and its value from the list cache.
- *
- * @private
- * @name delete
- * @memberOf ListCache
- * @param {string} key The key of the value to remove.
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
- */
- function listCacheDelete(key) {
- var data = this.__data__,
- index = assocIndexOf(data, key);
-
- if (index < 0) {
- return false;
- }
- var lastIndex = data.length - 1;
- if (index == lastIndex) {
- data.pop();
- } else {
- splice.call(data, index, 1);
- }
- --this.size;
- return true;
- }
-
- /**
- * Gets the list cache value for `key`.
- *
- * @private
- * @name get
- * @memberOf ListCache
- * @param {string} key The key of the value to get.
- * @returns {*} Returns the entry value.
- */
- function listCacheGet(key) {
- var data = this.__data__,
- index = assocIndexOf(data, key);
-
- return index < 0 ? undefined : data[index][1];
- }
-
- /**
- * Checks if a list cache value for `key` exists.
- *
- * @private
- * @name has
- * @memberOf ListCache
- * @param {string} key The key of the entry to check.
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
- */
- function listCacheHas(key) {
- return assocIndexOf(this.__data__, key) > -1;
- }
-
- /**
- * Sets the list cache `key` to `value`.
- *
- * @private
- * @name set
- * @memberOf ListCache
- * @param {string} key The key of the value to set.
- * @param {*} value The value to set.
- * @returns {Object} Returns the list cache instance.
- */
- function listCacheSet(key, value) {
- var data = this.__data__,
- index = assocIndexOf(data, key);
-
- if (index < 0) {
- ++this.size;
- data.push([key, value]);
- } else {
- data[index][1] = value;
- }
- return this;
- }
-
- // Add methods to `ListCache`.
- ListCache.prototype.clear = listCacheClear;
- ListCache.prototype['delete'] = listCacheDelete;
- ListCache.prototype.get = listCacheGet;
- ListCache.prototype.has = listCacheHas;
- ListCache.prototype.set = listCacheSet;
-
- /*------------------------------------------------------------------------*/
-
- /**
- * Creates a map cache object to store key-value pairs.
- *
- * @private
- * @constructor
- * @param {Array} [entries] The key-value pairs to cache.
- */
- function MapCache(entries) {
- var index = -1,
- length = entries == null ? 0 : entries.length;
-
- this.clear();
- while (++index < length) {
- var entry = entries[index];
- this.set(entry[0], entry[1]);
- }
- }
-
- /**
- * Removes all key-value entries from the map.
- *
- * @private
- * @name clear
- * @memberOf MapCache
- */
- function mapCacheClear() {
- this.size = 0;
- this.__data__ = {
- 'hash': new Hash,
- 'map': new (Map || ListCache),
- 'string': new Hash
- };
- }
-
- /**
- * Removes `key` and its value from the map.
- *
- * @private
- * @name delete
- * @memberOf MapCache
- * @param {string} key The key of the value to remove.
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
- */
- function mapCacheDelete(key) {
- var result = getMapData(this, key)['delete'](key);
- this.size -= result ? 1 : 0;
- return result;
- }
-
- /**
- * Gets the map value for `key`.
- *
- * @private
- * @name get
- * @memberOf MapCache
- * @param {string} key The key of the value to get.
- * @returns {*} Returns the entry value.
- */
- function mapCacheGet(key) {
- return getMapData(this, key).get(key);
- }
-
- /**
- * Checks if a map value for `key` exists.
- *
- * @private
- * @name has
- * @memberOf MapCache
- * @param {string} key The key of the entry to check.
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
- */
- function mapCacheHas(key) {
- return getMapData(this, key).has(key);
- }
-
- /**
- * Sets the map `key` to `value`.
- *
- * @private
- * @name set
- * @memberOf MapCache
- * @param {string} key The key of the value to set.
- * @param {*} value The value to set.
- * @returns {Object} Returns the map cache instance.
- */
- function mapCacheSet(key, value) {
- var data = getMapData(this, key),
- size = data.size;
-
- data.set(key, value);
- this.size += data.size == size ? 0 : 1;
- return this;
- }
-
- // Add methods to `MapCache`.
- MapCache.prototype.clear = mapCacheClear;
- MapCache.prototype['delete'] = mapCacheDelete;
- MapCache.prototype.get = mapCacheGet;
- MapCache.prototype.has = mapCacheHas;
- MapCache.prototype.set = mapCacheSet;
-
- /*------------------------------------------------------------------------*/
-
- /**
- *
- * Creates an array cache object to store unique values.
- *
- * @private
- * @constructor
- * @param {Array} [values] The values to cache.
- */
- function SetCache(values) {
- var index = -1,
- length = values == null ? 0 : values.length;
-
- this.__data__ = new MapCache;
- while (++index < length) {
- this.add(values[index]);
- }
- }
-
- /**
- * Adds `value` to the array cache.
- *
- * @private
- * @name add
- * @memberOf SetCache
- * @alias push
- * @param {*} value The value to cache.
- * @returns {Object} Returns the cache instance.
- */
- function setCacheAdd(value) {
- this.__data__.set(value, HASH_UNDEFINED);
- return this;
- }
-
- /**
- * Checks if `value` is in the array cache.
- *
- * @private
- * @name has
- * @memberOf SetCache
- * @param {*} value The value to search for.
- * @returns {number} Returns `true` if `value` is found, else `false`.
- */
- function setCacheHas(value) {
- return this.__data__.has(value);
- }
-
- // Add methods to `SetCache`.
- SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
- SetCache.prototype.has = setCacheHas;
-
- /*------------------------------------------------------------------------*/
-
- /**
- * Creates a stack cache object to store key-value pairs.
- *
- * @private
- * @constructor
- * @param {Array} [entries] The key-value pairs to cache.
- */
- function Stack(entries) {
- var data = this.__data__ = new ListCache(entries);
- this.size = data.size;
- }
-
- /**
- * Removes all key-value entries from the stack.
- *
- * @private
- * @name clear
- * @memberOf Stack
- */
- function stackClear() {
- this.__data__ = new ListCache;
- this.size = 0;
- }
-
- /**
- * Removes `key` and its value from the stack.
- *
- * @private
- * @name delete
- * @memberOf Stack
- * @param {string} key The key of the value to remove.
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
- */
- function stackDelete(key) {
- var data = this.__data__,
- result = data['delete'](key);
-
- this.size = data.size;
- return result;
- }
-
- /**
- * Gets the stack value for `key`.
- *
- * @private
- * @name get
- * @memberOf Stack
- * @param {string} key The key of the value to get.
- * @returns {*} Returns the entry value.
- */
- function stackGet(key) {
- return this.__data__.get(key);
- }
-
- /**
- * Checks if a stack value for `key` exists.
- *
- * @private
- * @name has
- * @memberOf Stack
- * @param {string} key The key of the entry to check.
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
- */
- function stackHas(key) {
- return this.__data__.has(key);
- }
-
- /**
- * Sets the stack `key` to `value`.
- *
- * @private
- * @name set
- * @memberOf Stack
- * @param {string} key The key of the value to set.
- * @param {*} value The value to set.
- * @returns {Object} Returns the stack cache instance.
- */
- function stackSet(key, value) {
- var data = this.__data__;
- if (data instanceof ListCache) {
- var pairs = data.__data__;
- if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
- pairs.push([key, value]);
- this.size = ++data.size;
- return this;
- }
- data = this.__data__ = new MapCache(pairs);
- }
- data.set(key, value);
- this.size = data.size;
- return this;
- }
-
- // Add methods to `Stack`.
- Stack.prototype.clear = stackClear;
- Stack.prototype['delete'] = stackDelete;
- Stack.prototype.get = stackGet;
- Stack.prototype.has = stackHas;
- Stack.prototype.set = stackSet;
-
- /*------------------------------------------------------------------------*/
-
- /**
- * Creates an array of the enumerable property names of the array-like `value`.
- *
- * @private
- * @param {*} value The value to query.
- * @param {boolean} inherited Specify returning inherited property names.
- * @returns {Array} Returns the array of property names.
- */
- function arrayLikeKeys(value, inherited) {
- var isArr = isArray(value),
- isArg = !isArr && isArguments(value),
- isBuff = !isArr && !isArg && isBuffer(value),
- isType = !isArr && !isArg && !isBuff && isTypedArray(value),
- skipIndexes = isArr || isArg || isBuff || isType,
- result = skipIndexes ? baseTimes(value.length, String) : [],
- length = result.length;
-
- for (var key in value) {
- if ((inherited || hasOwnProperty.call(value, key)) &&
- !(skipIndexes && (
- // Safari 9 has enumerable `arguments.length` in strict mode.
- key == 'length' ||
- // Node.js 0.10 has enumerable non-index properties on buffers.
- (isBuff && (key == 'offset' || key == 'parent')) ||
- // PhantomJS 2 has enumerable non-index properties on typed arrays.
- (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
- // Skip index properties.
- isIndex(key, length)
- ))) {
- result.push(key);
- }
- }
- return result;
- }
-
- /**
- * A specialized version of `_.sample` for arrays.
- *
- * @private
- * @param {Array} array The array to sample.
- * @returns {*} Returns the random element.
- */
- function arraySample(array) {
- var length = array.length;
- return length ? array[baseRandom(0, length - 1)] : undefined;
- }
-
- /**
- * A specialized version of `_.sampleSize` for arrays.
- *
- * @private
- * @param {Array} array The array to sample.
- * @param {number} n The number of elements to sample.
- * @returns {Array} Returns the random elements.
- */
- function arraySampleSize(array, n) {
- return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length));
- }
-
- /**
- * A specialized version of `_.shuffle` for arrays.
- *
- * @private
- * @param {Array} array The array to shuffle.
- * @returns {Array} Returns the new shuffled array.
- */
- function arrayShuffle(array) {
- return shuffleSelf(copyArray(array));
- }
-
- /**
- * This function is like `assignValue` except that it doesn't assign
- * `undefined` values.
- *
- * @private
- * @param {Object} object The object to modify.
- * @param {string} key The key of the property to assign.
- * @param {*} value The value to assign.
- */
- function assignMergeValue(object, key, value) {
- if ((value !== undefined && !eq(object[key], value)) ||
- (value === undefined && !(key in object))) {
- baseAssignValue(object, key, value);
- }
- }
-
- /**
- * Assigns `value` to `key` of `object` if the existing value is not equivalent
- * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
- * for equality comparisons.
- *
- * @private
- * @param {Object} object The object to modify.
- * @param {string} key The key of the property to assign.
- * @param {*} value The value to assign.
- */
- function assignValue(object, key, value) {
- var objValue = object[key];
- if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
- (value === undefined && !(key in object))) {
- baseAssignValue(object, key, value);
- }
- }
-
- /**
- * Gets the index at which the `key` is found in `array` of key-value pairs.
- *
- * @private
- * @param {Array} array The array to inspect.
- * @param {*} key The key to search for.
- * @returns {number} Returns the index of the matched value, else `-1`.
- */
- function assocIndexOf(array, key) {
- var length = array.length;
- while (length--) {
- if (eq(array[length][0], key)) {
- return length;
- }
- }
- return -1;
- }
-
- /**
- * Aggregates elements of `collection` on `accumulator` with keys transformed
- * by `iteratee` and values set by `setter`.
- *
- * @private
- * @param {Array|Object} collection The collection to iterate over.
- * @param {Function} setter The function to set `accumulator` values.
- * @param {Function} iteratee The iteratee to transform keys.
- * @param {Object} accumulator The initial aggregated object.
- * @returns {Function} Returns `accumulator`.
- */
- function baseAggregator(collection, setter, iteratee, accumulator) {
- baseEach(collection, function(value, key, collection) {
- setter(accumulator, value, iteratee(value), collection);
- });
- return accumulator;
- }
-
- /**
- * The base implementation of `_.assign` without support for multiple sources
- * or `customizer` functions.
- *
- * @private
- * @param {Object} object The destination object.
- * @param {Object} source The source object.
- * @returns {Object} Returns `object`.
- */
- function baseAssign(object, source) {
- return object && copyObject(source, keys(source), object);
- }
-
- /**
- * The base implementation of `_.assignIn` without support for multiple sources
- * or `customizer` functions.
- *
- * @private
- * @param {Object} object The destination object.
- * @param {Object} source The source object.
- * @returns {Object} Returns `object`.
- */
- function baseAssignIn(object, source) {
- return object && copyObject(source, keysIn(source), object);
- }
-
- /**
- * The base implementation of `assignValue` and `assignMergeValue` without
- * value checks.
- *
- * @private
- * @param {Object} object The object to modify.
- * @param {string} key The key of the property to assign.
- * @param {*} value The value to assign.
- */
- function baseAssignValue(object, key, value) {
- if (key == '__proto__' && defineProperty) {
- defineProperty(object, key, {
- 'configurable': true,
- 'enumerable': true,
- 'value': value,
- 'writable': true
- });
- } else {
- object[key] = value;
- }
- }
-
- /**
- * The base implementation of `_.at` without support for individual paths.
- *
- * @private
- * @param {Object} object The object to iterate over.
- * @param {string[]} paths The property paths to pick.
- * @returns {Array} Returns the picked elements.
- */
- function baseAt(object, paths) {
- var index = -1,
- length = paths.length,
- result = Array(length),
- skip = object == null;
-
- while (++index < length) {
- result[index] = skip ? undefined : get(object, paths[index]);
- }
- return result;
- }
-
- /**
- * The base implementation of `_.clamp` which doesn't coerce arguments.
- *
- * @private
- * @param {number} number The number to clamp.
- * @param {number} [lower] The lower bound.
- * @param {number} upper The upper bound.
- * @returns {number} Returns the clamped number.
- */
- function baseClamp(number, lower, upper) {
- if (number === number) {
- if (upper !== undefined) {
- number = number <= upper ? number : upper;
- }
- if (lower !== undefined) {
- number = number >= lower ? number : lower;
- }
- }
- return number;
- }
-
- /**
- * The base implementation of `_.clone` and `_.cloneDeep` which tracks
- * traversed objects.
- *
- * @private
- * @param {*} value The value to clone.
- * @param {boolean} bitmask The bitmask flags.
- * 1 - Deep clone
- * 2 - Flatten inherited properties
- * 4 - Clone symbols
- * @param {Function} [customizer] The function to customize cloning.
- * @param {string} [key] The key of `value`.
- * @param {Object} [object] The parent object of `value`.
- * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
- * @returns {*} Returns the cloned value.
- */
- function baseClone(value, bitmask, customizer, key, object, stack) {
- var result,
- isDeep = bitmask & CLONE_DEEP_FLAG,
- isFlat = bitmask & CLONE_FLAT_FLAG,
- isFull = bitmask & CLONE_SYMBOLS_FLAG;
-
- if (customizer) {
- result = object ? customizer(value, key, object, stack) : customizer(value);
- }
- if (result !== undefined) {
- return result;
- }
- if (!isObject(value)) {
- return value;
- }
- var isArr = isArray(value);
- if (isArr) {
- result = initCloneArray(value);
- if (!isDeep) {
- return copyArray(value, result);
- }
- } else {
- var tag = getTag(value),
- isFunc = tag == funcTag || tag == genTag;
-
- if (isBuffer(value)) {
- return cloneBuffer(value, isDeep);
- }
- if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
- result = (isFlat || isFunc) ? {} : initCloneObject(value);
- if (!isDeep) {
- return isFlat
- ? copySymbolsIn(value, baseAssignIn(result, value))
- : copySymbols(value, baseAssign(result, value));
- }
- } else {
- if (!cloneableTags[tag]) {
- return object ? value : {};
- }
- result = initCloneByTag(value, tag, baseClone, isDeep);
- }
- }
- // Check for circular references and return its corresponding clone.
- stack || (stack = new Stack);
- var stacked = stack.get(value);
- if (stacked) {
- return stacked;
- }
- stack.set(value, result);
-
- var keysFunc = isFull
- ? (isFlat ? getAllKeysIn : getAllKeys)
- : (isFlat ? keysIn : keys);
-
- var props = isArr ? undefined : keysFunc(value);
- arrayEach(props || value, function(subValue, key) {
- if (props) {
- key = subValue;
- subValue = value[key];
- }
- // Recursively populate clone (susceptible to call stack limits).
- assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));
- });
- return result;
- }
-
- /**
- * The base implementation of `_.conforms` which doesn't clone `source`.
- *
- * @private
- * @param {Object} source The object of property predicates to conform to.
- * @returns {Function} Returns the new spec function.
- */
- function baseConforms(source) {
- var props = keys(source);
- return function(object) {
- return baseConformsTo(object, source, props);
- };
- }
-
- /**
- * The base implementation of `_.conformsTo` which accepts `props` to check.
- *
- * @private
- * @param {Object} object The object to inspect.
- * @param {Object} source The object of property predicates to conform to.
- * @returns {boolean} Returns `true` if `object` conforms, else `false`.
- */
- function baseConformsTo(object, source, props) {
- var length = props.length;
- if (object == null) {
- return !length;
- }
- object = Object(object);
- while (length--) {
- var key = props[length],
- predicate = source[key],
- value = object[key];
-
- if ((value === undefined && !(key in object)) || !predicate(value)) {
- return false;
- }
- }
- return true;
- }
-
- /**
- * The base implementation of `_.delay` and `_.defer` which accepts `args`
- * to provide to `func`.
- *
- * @private
- * @param {Function} func The function to delay.
- * @param {number} wait The number of milliseconds to delay invocation.
- * @param {Array} args The arguments to provide to `func`.
- * @returns {number|Object} Returns the timer id or timeout object.
- */
- function baseDelay(func, wait, args) {
- if (typeof func != 'function') {
- throw new TypeError(FUNC_ERROR_TEXT);
- }
- return setTimeout(function() { func.apply(undefined, args); }, wait);
- }
-
- /**
- * The base implementation of methods like `_.difference` without support
- * for excluding multiple arrays or iteratee shorthands.
- *
- * @private
- * @param {Array} array The array to inspect.
- * @param {Array} values The values to exclude.
- * @param {Function} [iteratee] The iteratee invoked per element.
- * @param {Function} [comparator] The comparator invoked per element.
- * @returns {Array} Returns the new array of filtered values.
- */
- function baseDifference(array, values, iteratee, comparator) {
- var index = -1,
- includes = arrayIncludes,
- isCommon = true,
- length = array.length,
- result = [],
- valuesLength = values.length;
-
- if (!length) {
- return result;
- }
- if (iteratee) {
- values = arrayMap(values, baseUnary(iteratee));
- }
- if (comparator) {
- includes = arrayIncludesWith;
- isCommon = false;
- }
- else if (values.length >= LARGE_ARRAY_SIZE) {
- includes = cacheHas;
- isCommon = false;
- values = new SetCache(values);
- }
- outer:
- while (++index < length) {
- var value = array[index],
- computed = iteratee == null ? value : iteratee(value);
-
- value = (comparator || value !== 0) ? value : 0;
- if (isCommon && computed === computed) {
- var valuesIndex = valuesLength;
- while (valuesIndex--) {
- if (values[valuesIndex] === computed) {
- continue outer;
- }
- }
- result.push(value);
- }
- else if (!includes(values, computed, comparator)) {
- result.push(value);
- }
- }
- return result;
- }
-
- /**
- * The base implementation of `_.forEach` without support for iteratee shorthands.
- *
- * @private
- * @param {Array|Object} collection The collection to iterate over.
- * @param {Function} iteratee The function invoked per iteration.
- * @returns {Array|Object} Returns `collection`.
- */
- var baseEach = createBaseEach(baseForOwn);
-
- /**
- * The base implementation of `_.forEachRight` without support for iteratee shorthands.
- *
- * @private
- * @param {Array|Object} collection The collection to iterate over.
- * @param {Function} iteratee The function invoked per iteration.
- * @returns {Array|Object} Returns `collection`.
- */
- var baseEachRight = createBaseEach(baseForOwnRight, true);
-
- /**
- * The base implementation of `_.every` without support for iteratee shorthands.
- *
- * @private
- * @param {Array|Object} collection The collection to iterate over.
- * @param {Function} predicate The function invoked per iteration.
- * @returns {boolean} Returns `true` if all elements pass the predicate check,
- * else `false`
- */
- function baseEvery(collection, predicate) {
- var result = true;
- baseEach(collection, function(value, index, collection) {
- result = !!predicate(value, index, collection);
- return result;
- });
- return result;
- }
-
- /**
- * The base implementation of methods like `_.max` and `_.min` which accepts a
- * `comparator` to determine the extremum value.
- *
- * @private
- * @param {Array} array The array to iterate over.
- * @param {Function} iteratee The iteratee invoked per iteration.
- * @param {Function} comparator The comparator used to compare values.
- * @returns {*} Returns the extremum value.
- */
- function baseExtremum(array, iteratee, comparator) {
- var index = -1,
- length = array.length;
-
- while (++index < length) {
- var value = array[index],
- current = iteratee(value);
-
- if (current != null && (computed === undefined
- ? (current === current && !isSymbol(current))
- : comparator(current, computed)
- )) {
- var computed = current,
- result = value;
- }
- }
- return result;
- }
-
- /**
- * The base implementation of `_.fill` without an iteratee call guard.
- *
- * @private
- * @param {Array} array The array to fill.
- * @param {*} value The value to fill `array` with.
- * @param {number} [start=0] The start position.
- * @param {number} [end=array.length] The end position.
- * @returns {Array} Returns `array`.
- */
- function baseFill(array, value, start, end) {
- var length = array.length;
-
- start = toInteger(start);
- if (start < 0) {
- start = -start > length ? 0 : (length + start);
- }
- end = (end === undefined || end > length) ? length : toInteger(end);
- if (end < 0) {
- end += length;
- }
- end = start > end ? 0 : toLength(end);
- while (start < end) {
- array[start++] = value;
- }
- return array;
- }
-
- /**
- * The base implementation of `_.filter` without support for iteratee shorthands.
- *
- * @private
- * @param {Array|Object} collection The collection to iterate over.
- * @param {Function} predicate The function invoked per iteration.
- * @returns {Array} Returns the new filtered array.
- */
- function baseFilter(collection, predicate) {
- var result = [];
- baseEach(collection, function(value, index, collection) {
- if (predicate(value, index, collection)) {
- result.push(value);
- }
- });
- return result;
- }
-
- /**
- * The base implementation of `_.flatten` with support for restricting flattening.
- *
- * @private
- * @param {Array} array The array to flatten.
- * @param {number} depth The maximum recursion depth.
- * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
- * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
- * @param {Array} [result=[]] The initial result value.
- * @returns {Array} Returns the new flattened array.
- */
- function baseFlatten(array, depth, predicate, isStrict, result) {
- var index = -1,
- length = array.length;
-
- predicate || (predicate = isFlattenable);
- result || (result = []);
-
- while (++index < length) {
- var value = array[index];
- if (depth > 0 && predicate(value)) {
- if (depth > 1) {
- // Recursively flatten arrays (susceptible to call stack limits).
- baseFlatten(value, depth - 1, predicate, isStrict, result);
- } else {
- arrayPush(result, value);
- }
- } else if (!isStrict) {
- result[result.length] = value;
- }
- }
- return result;
- }
-
- /**
- * The base implementation of `baseForOwn` which iterates over `object`
- * properties returned by `keysFunc` and invokes `iteratee` for each property.
- * Iteratee functions may exit iteration early by explicitly returning `false`.
- *
- * @private
- * @param {Object} object The object to iterate over.
- * @param {Function} iteratee The function invoked per iteration.
- * @param {Function} keysFunc The function to get the keys of `object`.
- * @returns {Object} Returns `object`.
- */
- var baseFor = createBaseFor();
-
- /**
- * This function is like `baseFor` except that it iterates over properties
- * in the opposite order.
- *
- * @private
- * @param {Object} object The object to iterate over.
- * @param {Function} iteratee The function invoked per iteration.
- * @param {Function} keysFunc The function to get the keys of `object`.
- * @returns {Object} Returns `object`.
- */
- var baseForRight = createBaseFor(true);
-
- /**
- * The base implementation of `_.forOwn` without support for iteratee shorthands.
- *
- * @private
- * @param {Object} object The object to iterate over.
- * @param {Function} iteratee The function invoked per iteration.
- * @returns {Object} Returns `object`.
- */
- function baseForOwn(object, iteratee) {
- return object && baseFor(object, iteratee, keys);
- }
-
- /**
- * The base implementation of `_.forOwnRight` without support for iteratee shorthands.
- *
- * @private
- * @param {Object} object The object to iterate over.
- * @param {Function} iteratee The function invoked per iteration.
- * @returns {Object} Returns `object`.
- */
- function baseForOwnRight(object, iteratee) {
- return object && baseForRight(object, iteratee, keys);
- }
-
- /**
- * The base implementation of `_.functions` which creates an array of
- * `object` function property names filtered from `props`.
- *
- * @private
- * @param {Object} object The object to inspect.
- * @param {Array} props The property names to filter.
- * @returns {Array} Returns the function names.
- */
- function baseFunctions(object, props) {
- return arrayFilter(props, function(key) {
- return isFunction(object[key]);
- });
- }
-
- /**
- * The base implementation of `_.get` without support for default values.
- *
- * @private
- * @param {Object} object The object to query.
- * @param {Array|string} path The path of the property to get.
- * @returns {*} Returns the resolved value.
- */
- function baseGet(object, path) {
- path = castPath(path, object);
-
- var index = 0,
- length = path.length;
-
- while (object != null && index < length) {
- object = object[toKey(path[index++])];
- }
- return (index && index == length) ? object : undefined;
- }
-
- /**
- * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
- * `keysFunc` and `symbolsFunc` to get the enumerable property names and
- * symbols of `object`.
- *
- * @private
- * @param {Object} object The object to query.
- * @param {Function} keysFunc The function to get the keys of `object`.
- * @param {Function} symbolsFunc The function to get the symbols of `object`.
- * @returns {Array} Returns the array of property names and symbols.
- */
- function baseGetAllKeys(object, keysFunc, symbolsFunc) {
- var result = keysFunc(object);
- return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
- }
-
- /**
- * The base implementation of `getTag` without fallbacks for buggy environments.
- *
- * @private
- * @param {*} value The value to query.
- * @returns {string} Returns the `toStringTag`.
- */
- function baseGetTag(value) {
- if (value == null) {
- return value === undefined ? undefinedTag : nullTag;
- }
- return (symToStringTag && symToStringTag in Object(value))
- ? getRawTag(value)
- : objectToString(value);
- }
-
- /**
- * The base implementation of `_.gt` which doesn't coerce arguments.
- *
- * @private
- * @param {*} value The value to compare.
- * @param {*} other The other value to compare.
- * @returns {boolean} Returns `true` if `value` is greater than `other`,
- * else `false`.
- */
- function baseGt(value, other) {
- return value > other;
- }
-
- /**
- * The base implementation of `_.has` without support for deep paths.
- *
- * @private
- * @param {Object} [object] The object to query.
- * @param {Array|string} key The key to check.
- * @returns {boolean} Returns `true` if `key` exists, else `false`.
- */
- function baseHas(object, key) {
- return object != null && hasOwnProperty.call(object, key);
- }
-
- /**
- * The base implementation of `_.hasIn` without support for deep paths.
- *
- * @private
- * @param {Object} [object] The object to query.
- * @param {Array|string} key The key to check.
- * @returns {boolean} Returns `true` if `key` exists, else `false`.
- */
- function baseHasIn(object, key) {
- return object != null && key in Object(object);
- }
-
- /**
- * The base implementation of `_.inRange` which doesn't coerce arguments.
- *
- * @private
- * @param {number} number The number to check.
- * @param {number} start The start of the range.
- * @param {number} end The end of the range.
- * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
- */
- function baseInRange(number, start, end) {
- return number >= nativeMin(start, end) && number < nativeMax(start, end);
- }
-
- /**
- * The base implementation of methods like `_.intersection`, without support
- * for iteratee shorthands, that accepts an array of arrays to inspect.
- *
- * @private
- * @param {Array} arrays The arrays to inspect.
- * @param {Function} [iteratee] The iteratee invoked per element.
- * @param {Function} [comparator] The comparator invoked per element.
- * @returns {Array} Returns the new array of shared values.
- */
- function baseIntersection(arrays, iteratee, comparator) {
- var includes = comparator ? arrayIncludesWith : arrayIncludes,
- length = arrays[0].length,
- othLength = arrays.length,
- othIndex = othLength,
- caches = Array(othLength),
- maxLength = Infinity,
- result = [];
-
- while (othIndex--) {
- var array = arrays[othIndex];
- if (othIndex && iteratee) {
- array = arrayMap(array, baseUnary(iteratee));
- }
- maxLength = nativeMin(array.length, maxLength);
- caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))
- ? new SetCache(othIndex && array)
- : undefined;
- }
- array = arrays[0];
-
- var index = -1,
- seen = caches[0];
-
- outer:
- while (++index < length && result.length < maxLength) {
- var value = array[index],
- computed = iteratee ? iteratee(value) : value;
-
- value = (comparator || value !== 0) ? value : 0;
- if (!(seen
- ? cacheHas(seen, computed)
- : includes(result, computed, comparator)
- )) {
- othIndex = othLength;
- while (--othIndex) {
- var cache = caches[othIndex];
- if (!(cache
- ? cacheHas(cache, computed)
- : includes(arrays[othIndex], computed, comparator))
- ) {
- continue outer;
- }
- }
- if (seen) {
- seen.push(computed);
- }
- result.push(value);
- }
- }
- return result;
- }
-
- /**
- * The base implementation of `_.invert` and `_.invertBy` which inverts
- * `object` with values transformed by `iteratee` and set by `setter`.
- *
- * @private
- * @param {Object} object The object to iterate over.
- * @param {Function} setter The function to set `accumulator` values.
- * @param {Function} iteratee The iteratee to transform values.
- * @param {Object} accumulator The initial inverted object.
- * @returns {Function} Returns `accumulator`.
- */
- function baseInverter(object, setter, iteratee, accumulator) {
- baseForOwn(object, function(value, key, object) {
- setter(accumulator, iteratee(value), key, object);
- });
- return accumulator;
- }
-
- /**
- * The base implementation of `_.invoke` without support for individual
- * method arguments.
- *
- * @private
- * @param {Object} object The object to query.
- * @param {Array|string} path The path of the method to invoke.
- * @param {Array} args The arguments to invoke the method with.
- * @returns {*} Returns the result of the invoked method.
- */
- function baseInvoke(object, path, args) {
- path = castPath(path, object);
- object = parent(object, path);
- var func = object == null ? object : object[toKey(last(path))];
- return func == null ? undefined : apply(func, object, args);
- }
-
- /**
- * The base implementation of `_.isArguments`.
- *
- * @private
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is an `arguments` object,
- */
- function baseIsArguments(value) {
- return isObjectLike(value) && baseGetTag(value) == argsTag;
- }
-
- /**
- * The base implementation of `_.isArrayBuffer` without Node.js optimizations.
- *
- * @private
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
- */
- function baseIsArrayBuffer(value) {
- return isObjectLike(value) && baseGetTag(value) == arrayBufferTag;
- }
-
- /**
- * The base implementation of `_.isDate` without Node.js optimizations.
- *
- * @private
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
- */
- function baseIsDate(value) {
- return isObjectLike(value) && baseGetTag(value) == dateTag;
- }
-
- /**
- * The base implementation of `_.isEqual` which supports partial comparisons
- * and tracks traversed objects.
- *
- * @private
- * @param {*} value The value to compare.
- * @param {*} other The other value to compare.
- * @param {boolean} bitmask The bitmask flags.
- * 1 - Unordered comparison
- * 2 - Partial comparison
- * @param {Function} [customizer] The function to customize comparisons.
- * @param {Object} [stack] Tracks traversed `value` and `other` objects.
- * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
- */
- function baseIsEqual(value, other, bitmask, customizer, stack) {
- if (value === other) {
- return true;
- }
- if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {
- return value !== value && other !== other;
- }
- return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
- }
-
- /**
- * A specialized version of `baseIsEqual` for arrays and objects which performs
- * deep comparisons and tracks traversed objects enabling objects with circular
- * references to be compared.
- *
- * @private
- * @param {Object} object The object to compare.
- * @param {Object} other The other object to compare.
- * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
- * @param {Function} customizer The function to customize comparisons.
- * @param {Function} equalFunc The function to determine equivalents of values.
- * @param {Object} [stack] Tracks traversed `object` and `other` objects.
- * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
- */
- function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
- var objIsArr = isArray(object),
- othIsArr = isArray(other),
- objTag = objIsArr ? arrayTag : getTag(object),
- othTag = othIsArr ? arrayTag : getTag(other);
-
- objTag = objTag == argsTag ? objectTag : objTag;
- othTag = othTag == argsTag ? objectTag : othTag;
-
- var objIsObj = objTag == objectTag,
- othIsObj = othTag == objectTag,
- isSameTag = objTag == othTag;
-
- if (isSameTag && isBuffer(object)) {
- if (!isBuffer(other)) {
- return false;
- }
- objIsArr = true;
- objIsObj = false;
- }
- if (isSameTag && !objIsObj) {
- stack || (stack = new Stack);
- return (objIsArr || isTypedArray(object))
- ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)
- : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
- }
- if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
- var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
- othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
-
- if (objIsWrapped || othIsWrapped) {
- var objUnwrapped = objIsWrapped ? object.value() : object,
- othUnwrapped = othIsWrapped ? other.value() : other;
-
- stack || (stack = new Stack);
- return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
- }
- }
- if (!isSameTag) {
- return false;
- }
- stack || (stack = new Stack);
- return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
- }
-
- /**
- * The base implementation of `_.isMap` without Node.js optimizations.
- *
- * @private
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a map, else `false`.
- */
- function baseIsMap(value) {
- return isObjectLike(value) && getTag(value) == mapTag;
- }
-
- /**
- * The base implementation of `_.isMatch` without support for iteratee shorthands.
- *
- * @private
- * @param {Object} object The object to inspect.
- * @param {Object} source The object of property values to match.
- * @param {Array} matchData The property names, values, and compare flags to match.
- * @param {Function} [customizer] The function to customize comparisons.
- * @returns {boolean} Returns `true` if `object` is a match, else `false`.
- */
- function baseIsMatch(object, source, matchData, customizer) {
- var index = matchData.length,
- length = index,
- noCustomizer = !customizer;
-
- if (object == null) {
- return !length;
- }
- object = Object(object);
- while (index--) {
- var data = matchData[index];
- if ((noCustomizer && data[2])
- ? data[1] !== object[data[0]]
- : !(data[0] in object)
- ) {
- return false;
- }
- }
- while (++index < length) {
- data = matchData[index];
- var key = data[0],
- objValue = object[key],
- srcValue = data[1];
-
- if (noCustomizer && data[2]) {
- if (objValue === undefined && !(key in object)) {
- return false;
- }
- } else {
- var stack = new Stack;
- if (customizer) {
- var result = customizer(objValue, srcValue, key, object, source, stack);
- }
- if (!(result === undefined
- ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)
- : result
- )) {
- return false;
- }
- }
- }
- return true;
- }
-
- /**
- * The base implementation of `_.isNative` without bad shim checks.
- *
- * @private
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a native function,
- * else `false`.
- */
- function baseIsNative(value) {
- if (!isObject(value) || isMasked(value)) {
- return false;
- }
- var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
- return pattern.test(toSource(value));
- }
-
- /**
- * The base implementation of `_.isRegExp` without Node.js optimizations.
- *
- * @private
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
- */
- function baseIsRegExp(value) {
- return isObjectLike(value) && baseGetTag(value) == regexpTag;
- }
-
- /**
- * The base implementation of `_.isSet` without Node.js optimizations.
- *
- * @private
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a set, else `false`.
- */
- function baseIsSet(value) {
- return isObjectLike(value) && getTag(value) == setTag;
- }
-
- /**
- * The base implementation of `_.isTypedArray` without Node.js optimizations.
- *
- * @private
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
- */
- function baseIsTypedArray(value) {
- return isObjectLike(value) &&
- isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
- }
-
- /**
- * The base implementation of `_.iteratee`.
- *
- * @private
- * @param {*} [value=_.identity] The value to convert to an iteratee.
- * @returns {Function} Returns the iteratee.
- */
- function baseIteratee(value) {
- // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
- // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
- if (typeof value == 'function') {
- return value;
- }
- if (value == null) {
- return identity;
- }
- if (typeof value == 'object') {
- return isArray(value)
- ? baseMatchesProperty(value[0], value[1])
- : baseMatches(value);
- }
- return property(value);
- }
-
- /**
- * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
- *
- * @private
- * @param {Object} object The object to query.
- * @returns {Array} Returns the array of property names.
- */
- function baseKeys(object) {
- if (!isPrototype(object)) {
- return nativeKeys(object);
- }
- var result = [];
- for (var key in Object(object)) {
- if (hasOwnProperty.call(object, key) && key != 'constructor') {
- result.push(key);
- }
- }
- return result;
- }
-
- /**
- * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
- *
- * @private
- * @param {Object} object The object to query.
- * @returns {Array} Returns the array of property names.
- */
- function baseKeysIn(object) {
- if (!isObject(object)) {
- return nativeKeysIn(object);
- }
- var isProto = isPrototype(object),
- result = [];
-
- for (var key in object) {
- if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
- result.push(key);
- }
- }
- return result;
- }
-
- /**
- * The base implementation of `_.lt` which doesn't coerce arguments.
- *
- * @private
- * @param {*} value The value to compare.
- * @param {*} other The other value to compare.
- * @returns {boolean} Returns `true` if `value` is less than `other`,
- * else `false`.
- */
- function baseLt(value, other) {
- return value < other;
- }
-
- /**
- * The base implementation of `_.map` without support for iteratee shorthands.
- *
- * @private
- * @param {Array|Object} collection The collection to iterate over.
- * @param {Function} iteratee The function invoked per iteration.
- * @returns {Array} Returns the new mapped array.
- */
- function baseMap(collection, iteratee) {
- var index = -1,
- result = isArrayLike(collection) ? Array(collection.length) : [];
-
- baseEach(collection, function(value, key, collection) {
- result[++index] = iteratee(value, key, collection);
- });
- return result;
- }
-
- /**
- * The base implementation of `_.matches` which doesn't clone `source`.
- *
- * @private
- * @param {Object} source The object of property values to match.
- * @returns {Function} Returns the new spec function.
- */
- function baseMatches(source) {
- var matchData = getMatchData(source);
- if (matchData.length == 1 && matchData[0][2]) {
- return matchesStrictComparable(matchData[0][0], matchData[0][1]);
- }
- return function(object) {
- return object === source || baseIsMatch(object, source, matchData);
- };
- }
-
- /**
- * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
- *
- * @private
- * @param {string} path The path of the property to get.
- * @param {*} srcValue The value to match.
- * @returns {Function} Returns the new spec function.
- */
- function baseMatchesProperty(path, srcValue) {
- if (isKey(path) && isStrictComparable(srcValue)) {
- return matchesStrictComparable(toKey(path), srcValue);
- }
- return function(object) {
- var objValue = get(object, path);
- return (objValue === undefined && objValue === srcValue)
- ? hasIn(object, path)
- : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
- };
- }
-
- /**
- * The base implementation of `_.merge` without support for multiple sources.
- *
- * @private
- * @param {Object} object The destination object.
- * @param {Object} source The source object.
- * @param {number} srcIndex The index of `source`.
- * @param {Function} [customizer] The function to customize merged values.
- * @param {Object} [stack] Tracks traversed source values and their merged
- * counterparts.
- */
- function baseMerge(object, source, srcIndex, customizer, stack) {
- if (object === source) {
- return;
- }
- baseFor(source, function(srcValue, key) {
- if (isObject(srcValue)) {
- stack || (stack = new Stack);
- baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
- }
- else {
- var newValue = customizer
- ? customizer(object[key], srcValue, (key + ''), object, source, stack)
- : undefined;
-
- if (newValue === undefined) {
- newValue = srcValue;
- }
- assignMergeValue(object, key, newValue);
- }
- }, keysIn);
- }
-
- /**
- * A specialized version of `baseMerge` for arrays and objects which performs
- * deep merges and tracks traversed objects enabling objects with circular
- * references to be merged.
- *
- * @private
- * @param {Object} object The destination object.
- * @param {Object} source The source object.
- * @param {string} key The key of the value to merge.
- * @param {number} srcIndex The index of `source`.
- * @param {Function} mergeFunc The function to merge values.
- * @param {Function} [customizer] The function to customize assigned values.
- * @param {Object} [stack] Tracks traversed source values and their merged
- * counterparts.
- */
- function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
- var objValue = object[key],
- srcValue = source[key],
- stacked = stack.get(srcValue);
-
- if (stacked) {
- assignMergeValue(object, key, stacked);
- return;
- }
- var newValue = customizer
- ? customizer(objValue, srcValue, (key + ''), object, source, stack)
- : undefined;
-
- var isCommon = newValue === undefined;
-
- if (isCommon) {
- var isArr = isArray(srcValue),
- isBuff = !isArr && isBuffer(srcValue),
- isTyped = !isArr && !isBuff && isTypedArray(srcValue);
-
- newValue = srcValue;
- if (isArr || isBuff || isTyped) {
- if (isArray(objValue)) {
- newValue = objValue;
- }
- else if (isArrayLikeObject(objValue)) {
- newValue = copyArray(objValue);
- }
- else if (isBuff) {
- isCommon = false;
- newValue = cloneBuffer(srcValue, true);
- }
- else if (isTyped) {
- isCommon = false;
- newValue = cloneTypedArray(srcValue, true);
- }
- else {
- newValue = [];
- }
- }
- else if (isPlainObject(srcValue) || isArguments(srcValue)) {
- newValue = objValue;
- if (isArguments(objValue)) {
- newValue = toPlainObject(objValue);
- }
- else if (!isObject(objValue) || (srcIndex && isFunction(objValue))) {
- newValue = initCloneObject(srcValue);
- }
- }
- else {
- isCommon = false;
- }
- }
- if (isCommon) {
- // Recursively merge objects and arrays (susceptible to call stack limits).
- stack.set(srcValue, newValue);
- mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
- stack['delete'](srcValue);
- }
- assignMergeValue(object, key, newValue);
- }
-
- /**
- * The base implementation of `_.nth` which doesn't coerce arguments.
- *
- * @private
- * @param {Array} array The array to query.
- * @param {number} n The index of the element to return.
- * @returns {*} Returns the nth element of `array`.
- */
- function baseNth(array, n) {
- var length = array.length;
- if (!length) {
- return;
- }
- n += n < 0 ? length : 0;
- return isIndex(n, length) ? array[n] : undefined;
- }
-
- /**
- * The base implementation of `_.orderBy` without param guards.
- *
- * @private
- * @param {Array|Object} collection The collection to iterate over.
- * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
- * @param {string[]} orders The sort orders of `iteratees`.
- * @returns {Array} Returns the new sorted array.
- */
- function baseOrderBy(collection, iteratees, orders) {
- var index = -1;
- iteratees = arrayMap(iteratees.length ? iteratees : [identity], baseUnary(getIteratee()));
-
- var result = baseMap(collection, function(value, key, collection) {
- var criteria = arrayMap(iteratees, function(iteratee) {
- return iteratee(value);
- });
- return { 'criteria': criteria, 'index': ++index, 'value': value };
- });
-
- return baseSortBy(result, function(object, other) {
- return compareMultiple(object, other, orders);
- });
- }
-
- /**
- * The base implementation of `_.pick` without support for individual
- * property identifiers.
- *
- * @private
- * @param {Object} object The source object.
- * @param {string[]} paths The property paths to pick.
- * @returns {Object} Returns the new object.
- */
- function basePick(object, paths) {
- return basePickBy(object, paths, function(value, path) {
- return hasIn(object, path);
- });
- }
-
- /**
- * The base implementation of `_.pickBy` without support for iteratee shorthands.
- *
- * @private
- * @param {Object} object The source object.
- * @param {string[]} paths The property paths to pick.
- * @param {Function} predicate The function invoked per property.
- * @returns {Object} Returns the new object.
- */
- function basePickBy(object, paths, predicate) {
- var index = -1,
- length = paths.length,
- result = {};
-
- while (++index < length) {
- var path = paths[index],
- value = baseGet(object, path);
-
- if (predicate(value, path)) {
- baseSet(result, castPath(path, object), value);
- }
- }
- return result;
- }
-
- /**
- * A specialized version of `baseProperty` which supports deep paths.
- *
- * @private
- * @param {Array|string} path The path of the property to get.
- * @returns {Function} Returns the new accessor function.
- */
- function basePropertyDeep(path) {
- return function(object) {
- return baseGet(object, path);
- };
- }
-
- /**
- * The base implementation of `_.pullAllBy` without support for iteratee
- * shorthands.
- *
- * @private
- * @param {Array} array The array to modify.
- * @param {Array} values The values to remove.
- * @param {Function} [iteratee] The iteratee invoked per element.
- * @param {Function} [comparator] The comparator invoked per element.
- * @returns {Array} Returns `array`.
- */
- function basePullAll(array, values, iteratee, comparator) {
- var indexOf = comparator ? baseIndexOfWith : baseIndexOf,
- index = -1,
- length = values.length,
- seen = array;
-
- if (array === values) {
- values = copyArray(values);
- }
- if (iteratee) {
- seen = arrayMap(array, baseUnary(iteratee));
- }
- while (++index < length) {
- var fromIndex = 0,
- value = values[index],
- computed = iteratee ? iteratee(value) : value;
-
- while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {
- if (seen !== array) {
- splice.call(seen, fromIndex, 1);
- }
- splice.call(array, fromIndex, 1);
- }
- }
- return array;
- }
-
- /**
- * The base implementation of `_.pullAt` without support for individual
- * indexes or capturing the removed elements.
- *
- * @private
- * @param {Array} array The array to modify.
- * @param {number[]} indexes The indexes of elements to remove.
- * @returns {Array} Returns `array`.
- */
- function basePullAt(array, indexes) {
- var length = array ? indexes.length : 0,
- lastIndex = length - 1;
-
- while (length--) {
- var index = indexes[length];
- if (length == lastIndex || index !== previous) {
- var previous = index;
- if (isIndex(index)) {
- splice.call(array, index, 1);
- } else {
- baseUnset(array, index);
- }
- }
- }
- return array;
- }
-
- /**
- * The base implementation of `_.random` without support for returning
- * floating-point numbers.
- *
- * @private
- * @param {number} lower The lower bound.
- * @param {number} upper The upper bound.
- * @returns {number} Returns the random number.
- */
- function baseRandom(lower, upper) {
- return lower + nativeFloor(nativeRandom() * (upper - lower + 1));
- }
-
- /**
- * The base implementation of `_.range` and `_.rangeRight` which doesn't
- * coerce arguments.
- *
- * @private
- * @param {number} start The start of the range.
- * @param {number} end The end of the range.
- * @param {number} step The value to increment or decrement by.
- * @param {boolean} [fromRight] Specify iterating from right to left.
- * @returns {Array} Returns the range of numbers.
- */
- function baseRange(start, end, step, fromRight) {
- var index = -1,
- length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),
- result = Array(length);
-
- while (length--) {
- result[fromRight ? length : ++index] = start;
- start += step;
- }
- return result;
- }
-
- /**
- * The base implementation of `_.repeat` which doesn't coerce arguments.
- *
- * @private
- * @param {string} string The string to repeat.
- * @param {number} n The number of times to repeat the string.
- * @returns {string} Returns the repeated string.
- */
- function baseRepeat(string, n) {
- var result = '';
- if (!string || n < 1 || n > MAX_SAFE_INTEGER) {
- return result;
- }
- // Leverage the exponentiation by squaring algorithm for a faster repeat.
- // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.
- do {
- if (n % 2) {
- result += string;
- }
- n = nativeFloor(n / 2);
- if (n) {
- string += string;
- }
- } while (n);
-
- return result;
- }
-
- /**
- * The base implementation of `_.rest` which doesn't validate or coerce arguments.
- *
- * @private
- * @param {Function} func The function to apply a rest parameter to.
- * @param {number} [start=func.length-1] The start position of the rest parameter.
- * @returns {Function} Returns the new function.
- */
- function baseRest(func, start) {
- return setToString(overRest(func, start, identity), func + '');
- }
-
- /**
- * The base implementation of `_.sample`.
- *
- * @private
- * @param {Array|Object} collection The collection to sample.
- * @returns {*} Returns the random element.
- */
- function baseSample(collection) {
- return arraySample(values(collection));
- }
-
- /**
- * The base implementation of `_.sampleSize` without param guards.
- *
- * @private
- * @param {Array|Object} collection The collection to sample.
- * @param {number} n The number of elements to sample.
- * @returns {Array} Returns the random elements.
- */
- function baseSampleSize(collection, n) {
- var array = values(collection);
- return shuffleSelf(array, baseClamp(n, 0, array.length));
- }
-
- /**
- * The base implementation of `_.set`.
- *
- * @private
- * @param {Object} object The object to modify.
- * @param {Array|string} path The path of the property to set.
- * @param {*} value The value to set.
- * @param {Function} [customizer] The function to customize path creation.
- * @returns {Object} Returns `object`.
- */
- function baseSet(object, path, value, customizer) {
- if (!isObject(object)) {
- return object;
- }
- path = castPath(path, object);
-
- var index = -1,
- length = path.length,
- lastIndex = length - 1,
- nested = object;
-
- while (nested != null && ++index < length) {
- var key = toKey(path[index]),
- newValue = value;
-
- if (index != lastIndex) {
- var objValue = nested[key];
- newValue = customizer ? customizer(objValue, key, nested) : undefined;
- if (newValue === undefined) {
- newValue = isObject(objValue)
- ? objValue
- : (isIndex(path[index + 1]) ? [] : {});
- }
- }
- assignValue(nested, key, newValue);
- nested = nested[key];
- }
- return object;
- }
-
- /**
- * The base implementation of `setData` without support for hot loop shorting.
- *
- * @private
- * @param {Function} func The function to associate metadata with.
- * @param {*} data The metadata.
- * @returns {Function} Returns `func`.
- */
- var baseSetData = !metaMap ? identity : function(func, data) {
- metaMap.set(func, data);
- return func;
- };
-
- /**
- * The base implementation of `setToString` without support for hot loop shorting.
- *
- * @private
- * @param {Function} func The function to modify.
- * @param {Function} string The `toString` result.
- * @returns {Function} Returns `func`.
- */
- var baseSetToString = !defineProperty ? identity : function(func, string) {
- return defineProperty(func, 'toString', {
- 'configurable': true,
- 'enumerable': false,
- 'value': constant(string),
- 'writable': true
- });
- };
-
- /**
- * The base implementation of `_.shuffle`.
- *
- * @private
- * @param {Array|Object} collection The collection to shuffle.
- * @returns {Array} Returns the new shuffled array.
- */
- function baseShuffle(collection) {
- return shuffleSelf(values(collection));
- }
-
- /**
- * The base implementation of `_.slice` without an iteratee call guard.
- *
- * @private
- * @param {Array} array The array to slice.
- * @param {number} [start=0] The start position.
- * @param {number} [end=array.length] The end position.
- * @returns {Array} Returns the slice of `array`.
- */
- function baseSlice(array, start, end) {
- var index = -1,
- length = array.length;
-
- if (start < 0) {
- start = -start > length ? 0 : (length + start);
- }
- end = end > length ? length : end;
- if (end < 0) {
- end += length;
- }
- length = start > end ? 0 : ((end - start) >>> 0);
- start >>>= 0;
-
- var result = Array(length);
- while (++index < length) {
- result[index] = array[index + start];
- }
- return result;
- }
-
- /**
- * The base implementation of `_.some` without support for iteratee shorthands.
- *
- * @private
- * @param {Array|Object} collection The collection to iterate over.
- * @param {Function} predicate The function invoked per iteration.
- * @returns {boolean} Returns `true` if any element passes the predicate check,
- * else `false`.
- */
- function baseSome(collection, predicate) {
- var result;
-
- baseEach(collection, function(value, index, collection) {
- result = predicate(value, index, collection);
- return !result;
- });
- return !!result;
- }
-
- /**
- * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which
- * performs a binary search of `array` to determine the index at which `value`
- * should be inserted into `array` in order to maintain its sort order.
- *
- * @private
- * @param {Array} array The sorted array to inspect.
- * @param {*} value The value to evaluate.
- * @param {boolean} [retHighest] Specify returning the highest qualified index.
- * @returns {number} Returns the index at which `value` should be inserted
- * into `array`.
- */
- function baseSortedIndex(array, value, retHighest) {
- var low = 0,
- high = array == null ? low : array.length;
-
- if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
- while (low < high) {
- var mid = (low + high) >>> 1,
- computed = array[mid];
-
- if (computed !== null && !isSymbol(computed) &&
- (retHighest ? (computed <= value) : (computed < value))) {
- low = mid + 1;
- } else {
- high = mid;
- }
- }
- return high;
- }
- return baseSortedIndexBy(array, value, identity, retHighest);
- }
-
- /**
- * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy`
- * which invokes `iteratee` for `value` and each element of `array` to compute
- * their sort ranking. The iteratee is invoked with one argument; (value).
- *
- * @private
- * @param {Array} array The sorted array to inspect.
- * @param {*} value The value to evaluate.
- * @param {Function} iteratee The iteratee invoked per element.
- * @param {boolean} [retHighest] Specify returning the highest qualified index.
- * @returns {number} Returns the index at which `value` should be inserted
- * into `array`.
- */
- function baseSortedIndexBy(array, value, iteratee, retHighest) {
- value = iteratee(value);
-
- var low = 0,
- high = array == null ? 0 : array.length,
- valIsNaN = value !== value,
- valIsNull = value === null,
- valIsSymbol = isSymbol(value),
- valIsUndefined = value === undefined;
-
- while (low < high) {
- var mid = nativeFloor((low + high) / 2),
- computed = iteratee(array[mid]),
- othIsDefined = computed !== undefined,
- othIsNull = computed === null,
- othIsReflexive = computed === computed,
- othIsSymbol = isSymbol(computed);
-
- if (valIsNaN) {
- var setLow = retHighest || othIsReflexive;
- } else if (valIsUndefined) {
- setLow = othIsReflexive && (retHighest || othIsDefined);
- } else if (valIsNull) {
- setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);
- } else if (valIsSymbol) {
- setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);
- } else if (othIsNull || othIsSymbol) {
- setLow = false;
- } else {
- setLow = retHighest ? (computed <= value) : (computed < value);
- }
- if (setLow) {
- low = mid + 1;
- } else {
- high = mid;
- }
- }
- return nativeMin(high, MAX_ARRAY_INDEX);
- }
-
- /**
- * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without
- * support for iteratee shorthands.
- *
- * @private
- * @param {Array} array The array to inspect.
- * @param {Function} [iteratee] The iteratee invoked per element.
- * @returns {Array} Returns the new duplicate free array.
- */
- function baseSortedUniq(array, iteratee) {
- var index = -1,
- length = array.length,
- resIndex = 0,
- result = [];
-
- while (++index < length) {
- var value = array[index],
- computed = iteratee ? iteratee(value) : value;
-
- if (!index || !eq(computed, seen)) {
- var seen = computed;
- result[resIndex++] = value === 0 ? 0 : value;
- }
- }
- return result;
- }
-
- /**
- * The base implementation of `_.toNumber` which doesn't ensure correct
- * conversions of binary, hexadecimal, or octal string values.
- *
- * @private
- * @param {*} value The value to process.
- * @returns {number} Returns the number.
- */
- function baseToNumber(value) {
- if (typeof value == 'number') {
- return value;
- }
- if (isSymbol(value)) {
- return NAN;
- }
- return +value;
- }
-
- /**
- * The base implementation of `_.toString` which doesn't convert nullish
- * values to empty strings.
- *
- * @private
- * @param {*} value The value to process.
- * @returns {string} Returns the string.
- */
- function baseToString(value) {
- // Exit early for strings to avoid a performance hit in some environments.
- if (typeof value == 'string') {
- return value;
- }
- if (isArray(value)) {
- // Recursively convert values (susceptible to call stack limits).
- return arrayMap(value, baseToString) + '';
- }
- if (isSymbol(value)) {
- return symbolToString ? symbolToString.call(value) : '';
- }
- var result = (value + '');
- return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
- }
-
- /**
- * The base implementation of `_.uniqBy` without support for iteratee shorthands.
- *
- * @private
- * @param {Array} array The array to inspect.
- * @param {Function} [iteratee] The iteratee invoked per element.
- * @param {Function} [comparator] The comparator invoked per element.
- * @returns {Array} Returns the new duplicate free array.
- */
- function baseUniq(array, iteratee, comparator) {
- var index = -1,
- includes = arrayIncludes,
- length = array.length,
- isCommon = true,
- result = [],
- seen = result;
-
- if (comparator) {
- isCommon = false;
- includes = arrayIncludesWith;
- }
- else if (length >= LARGE_ARRAY_SIZE) {
- var set = iteratee ? null : createSet(array);
- if (set) {
- return setToArray(set);
- }
- isCommon = false;
- includes = cacheHas;
- seen = new SetCache;
- }
- else {
- seen = iteratee ? [] : result;
- }
- outer:
- while (++index < length) {
- var value = array[index],
- computed = iteratee ? iteratee(value) : value;
-
- value = (comparator || value !== 0) ? value : 0;
- if (isCommon && computed === computed) {
- var seenIndex = seen.length;
- while (seenIndex--) {
- if (seen[seenIndex] === computed) {
- continue outer;
- }
- }
- if (iteratee) {
- seen.push(computed);
- }
- result.push(value);
- }
- else if (!includes(seen, computed, comparator)) {
- if (seen !== result) {
- seen.push(computed);
- }
- result.push(value);
- }
- }
- return result;
- }
-
- /**
- * The base implementation of `_.unset`.
- *
- * @private
- * @param {Object} object The object to modify.
- * @param {Array|string} path The property path to unset.
- * @returns {boolean} Returns `true` if the property is deleted, else `false`.
- */
- function baseUnset(object, path) {
- path = castPath(path, object);
- object = parent(object, path);
- return object == null || delete object[toKey(last(path))];
- }
-
- /**
- * The base implementation of `_.update`.
- *
- * @private
- * @param {Object} object The object to modify.
- * @param {Array|string} path The path of the property to update.
- * @param {Function} updater The function to produce the updated value.
- * @param {Function} [customizer] The function to customize path creation.
- * @returns {Object} Returns `object`.
- */
- function baseUpdate(object, path, updater, customizer) {
- return baseSet(object, path, updater(baseGet(object, path)), customizer);
- }
-
- /**
- * The base implementation of methods like `_.dropWhile` and `_.takeWhile`
- * without support for iteratee shorthands.
- *
- * @private
- * @param {Array} array The array to query.
- * @param {Function} predicate The function invoked per iteration.
- * @param {boolean} [isDrop] Specify dropping elements instead of taking them.
- * @param {boolean} [fromRight] Specify iterating from right to left.
- * @returns {Array} Returns the slice of `array`.
- */
- function baseWhile(array, predicate, isDrop, fromRight) {
- var length = array.length,
- index = fromRight ? length : -1;
-
- while ((fromRight ? index-- : ++index < length) &&
- predicate(array[index], index, array)) {}
-
- return isDrop
- ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))
- : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));
- }
-
- /**
- * The base implementation of `wrapperValue` which returns the result of
- * performing a sequence of actions on the unwrapped `value`, where each
- * successive action is supplied the return value of the previous.
- *
- * @private
- * @param {*} value The unwrapped value.
- * @param {Array} actions Actions to perform to resolve the unwrapped value.
- * @returns {*} Returns the resolved value.
- */
- function baseWrapperValue(value, actions) {
- var result = value;
- if (result instanceof LazyWrapper) {
- result = result.value();
- }
- return arrayReduce(actions, function(result, action) {
- return action.func.apply(action.thisArg, arrayPush([result], action.args));
- }, result);
- }
-
- /**
- * The base implementation of methods like `_.xor`, without support for
- * iteratee shorthands, that accepts an array of arrays to inspect.
- *
- * @private
- * @param {Array} arrays The arrays to inspect.
- * @param {Function} [iteratee] The iteratee invoked per element.
- * @param {Function} [comparator] The comparator invoked per element.
- * @returns {Array} Returns the new array of values.
- */
- function baseXor(arrays, iteratee, comparator) {
- var length = arrays.length;
- if (length < 2) {
- return length ? baseUniq(arrays[0]) : [];
- }
- var index = -1,
- result = Array(length);
-
- while (++index < length) {
- var array = arrays[index],
- othIndex = -1;
-
- while (++othIndex < length) {
- if (othIndex != index) {
- result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator);
- }
- }
- }
- return baseUniq(baseFlatten(result, 1), iteratee, comparator);
- }
-
- /**
- * This base implementation of `_.zipObject` which assigns values using `assignFunc`.
- *
- * @private
- * @param {Array} props The property identifiers.
- * @param {Array} values The property values.
- * @param {Function} assignFunc The function to assign values.
- * @returns {Object} Returns the new object.
- */
- function baseZipObject(props, values, assignFunc) {
- var index = -1,
- length = props.length,
- valsLength = values.length,
- result = {};
-
- while (++index < length) {
- var value = index < valsLength ? values[index] : undefined;
- assignFunc(result, props[index], value);
- }
- return result;
- }
-
- /**
- * Casts `value` to an empty array if it's not an array like object.
- *
- * @private
- * @param {*} value The value to inspect.
- * @returns {Array|Object} Returns the cast array-like object.
- */
- function castArrayLikeObject(value) {
- return isArrayLikeObject(value) ? value : [];
- }
-
- /**
- * Casts `value` to `identity` if it's not a function.
- *
- * @private
- * @param {*} value The value to inspect.
- * @returns {Function} Returns cast function.
- */
- function castFunction(value) {
- return typeof value == 'function' ? value : identity;
- }
-
- /**
- * Casts `value` to a path array if it's not one.
- *
- * @private
- * @param {*} value The value to inspect.
- * @param {Object} [object] The object to query keys on.
- * @returns {Array} Returns the cast property path array.
- */
- function castPath(value, object) {
- if (isArray(value)) {
- return value;
- }
- return isKey(value, object) ? [value] : stringToPath(toString(value));
- }
-
- /**
- * A `baseRest` alias which can be replaced with `identity` by module
- * replacement plugins.
- *
- * @private
- * @type {Function}
- * @param {Function} func The function to apply a rest parameter to.
- * @returns {Function} Returns the new function.
- */
- var castRest = baseRest;
-
- /**
- * Casts `array` to a slice if it's needed.
- *
- * @private
- * @param {Array} array The array to inspect.
- * @param {number} start The start position.
- * @param {number} [end=array.length] The end position.
- * @returns {Array} Returns the cast slice.
- */
- function castSlice(array, start, end) {
- var length = array.length;
- end = end === undefined ? length : end;
- return (!start && end >= length) ? array : baseSlice(array, start, end);
- }
-
- /**
- * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout).
- *
- * @private
- * @param {number|Object} id The timer id or timeout object of the timer to clear.
- */
- var clearTimeout = ctxClearTimeout || function(id) {
- return root.clearTimeout(id);
- };
-
- /**
- * Creates a clone of `buffer`.
- *
- * @private
- * @param {Buffer} buffer The buffer to clone.
- * @param {boolean} [isDeep] Specify a deep clone.
- * @returns {Buffer} Returns the cloned buffer.
- */
- function cloneBuffer(buffer, isDeep) {
- if (isDeep) {
- return buffer.slice();
- }
- var length = buffer.length,
- result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
-
- buffer.copy(result);
- return result;
- }
-
- /**
- * Creates a clone of `arrayBuffer`.
- *
- * @private
- * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
- * @returns {ArrayBuffer} Returns the cloned array buffer.
- */
- function cloneArrayBuffer(arrayBuffer) {
- var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
- new Uint8Array(result).set(new Uint8Array(arrayBuffer));
- return result;
- }
-
- /**
- * Creates a clone of `dataView`.
- *
- * @private
- * @param {Object} dataView The data view to clone.
- * @param {boolean} [isDeep] Specify a deep clone.
- * @returns {Object} Returns the cloned data view.
- */
- function cloneDataView(dataView, isDeep) {
- var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
- return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
- }
-
- /**
- * Creates a clone of `map`.
- *
- * @private
- * @param {Object} map The map to clone.
- * @param {Function} cloneFunc The function to clone values.
- * @param {boolean} [isDeep] Specify a deep clone.
- * @returns {Object} Returns the cloned map.
- */
- function cloneMap(map, isDeep, cloneFunc) {
- var array = isDeep ? cloneFunc(mapToArray(map), CLONE_DEEP_FLAG) : mapToArray(map);
- return arrayReduce(array, addMapEntry, new map.constructor);
- }
-
- /**
- * Creates a clone of `regexp`.
- *
- * @private
- * @param {Object} regexp The regexp to clone.
- * @returns {Object} Returns the cloned regexp.
- */
- function cloneRegExp(regexp) {
- var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
- result.lastIndex = regexp.lastIndex;
- return result;
- }
-
- /**
- * Creates a clone of `set`.
- *
- * @private
- * @param {Object} set The set to clone.
- * @param {Function} cloneFunc The function to clone values.
- * @param {boolean} [isDeep] Specify a deep clone.
- * @returns {Object} Returns the cloned set.
- */
- function cloneSet(set, isDeep, cloneFunc) {
- var array = isDeep ? cloneFunc(setToArray(set), CLONE_DEEP_FLAG) : setToArray(set);
- return arrayReduce(array, addSetEntry, new set.constructor);
- }
-
- /**
- * Creates a clone of the `symbol` object.
- *
- * @private
- * @param {Object} symbol The symbol object to clone.
- * @returns {Object} Returns the cloned symbol object.
- */
- function cloneSymbol(symbol) {
- return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
- }
-
- /**
- * Creates a clone of `typedArray`.
- *
- * @private
- * @param {Object} typedArray The typed array to clone.
- * @param {boolean} [isDeep] Specify a deep clone.
- * @returns {Object} Returns the cloned typed array.
- */
- function cloneTypedArray(typedArray, isDeep) {
- var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
- return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
- }
-
- /**
- * Compares values to sort them in ascending order.
- *
- * @private
- * @param {*} value The value to compare.
- * @param {*} other The other value to compare.
- * @returns {number} Returns the sort order indicator for `value`.
- */
- function compareAscending(value, other) {
- if (value !== other) {
- var valIsDefined = value !== undefined,
- valIsNull = value === null,
- valIsReflexive = value === value,
- valIsSymbol = isSymbol(value);
-
- var othIsDefined = other !== undefined,
- othIsNull = other === null,
- othIsReflexive = other === other,
- othIsSymbol = isSymbol(other);
-
- if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||
- (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||
- (valIsNull && othIsDefined && othIsReflexive) ||
- (!valIsDefined && othIsReflexive) ||
- !valIsReflexive) {
- return 1;
- }
- if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||
- (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||
- (othIsNull && valIsDefined && valIsReflexive) ||
- (!othIsDefined && valIsReflexive) ||
- !othIsReflexive) {
- return -1;
- }
- }
- return 0;
- }
-
- /**
- * Used by `_.orderBy` to compare multiple properties of a value to another
- * and stable sort them.
- *
- * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,
- * specify an order of "desc" for descending or "asc" for ascending sort order
- * of corresponding values.
- *
- * @private
- * @param {Object} object The object to compare.
- * @param {Object} other The other object to compare.
- * @param {boolean[]|string[]} orders The order to sort by for each property.
- * @returns {number} Returns the sort order indicator for `object`.
- */
- function compareMultiple(object, other, orders) {
- var index = -1,
- objCriteria = object.criteria,
- othCriteria = other.criteria,
- length = objCriteria.length,
- ordersLength = orders.length;
-
- while (++index < length) {
- var result = compareAscending(objCriteria[index], othCriteria[index]);
- if (result) {
- if (index >= ordersLength) {
- return result;
- }
- var order = orders[index];
- return result * (order == 'desc' ? -1 : 1);
- }
- }
- // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
- // that causes it, under certain circumstances, to provide the same value for
- // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247
- // for more details.
- //
- // This also ensures a stable sort in V8 and other engines.
- // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.
- return object.index - other.index;
- }
-
- /**
- * Creates an array that is the composition of partially applied arguments,
- * placeholders, and provided arguments into a single array of arguments.
- *
- * @private
- * @param {Array} args The provided arguments.
- * @param {Array} partials The arguments to prepend to those provided.
- * @param {Array} holders The `partials` placeholder indexes.
- * @params {boolean} [isCurried] Specify composing for a curried function.
- * @returns {Array} Returns the new array of composed arguments.
- */
- function composeArgs(args, partials, holders, isCurried) {
- var argsIndex = -1,
- argsLength = args.length,
- holdersLength = holders.length,
- leftIndex = -1,
- leftLength = partials.length,
- rangeLength = nativeMax(argsLength - holdersLength, 0),
- result = Array(leftLength + rangeLength),
- isUncurried = !isCurried;
-
- while (++leftIndex < leftLength) {
- result[leftIndex] = partials[leftIndex];
- }
- while (++argsIndex < holdersLength) {
- if (isUncurried || argsIndex < argsLength) {
- result[holders[argsIndex]] = args[argsIndex];
- }
- }
- while (rangeLength--) {
- result[leftIndex++] = args[argsIndex++];
- }
- return result;
- }
-
- /**
- * This function is like `composeArgs` except that the arguments composition
- * is tailored for `_.partialRight`.
- *
- * @private
- * @param {Array} args The provided arguments.
- * @param {Array} partials The arguments to append to those provided.
- * @param {Array} holders The `partials` placeholder indexes.
- * @params {boolean} [isCurried] Specify composing for a curried function.
- * @returns {Array} Returns the new array of composed arguments.
- */
- function composeArgsRight(args, partials, holders, isCurried) {
- var argsIndex = -1,
- argsLength = args.length,
- holdersIndex = -1,
- holdersLength = holders.length,
- rightIndex = -1,
- rightLength = partials.length,
- rangeLength = nativeMax(argsLength - holdersLength, 0),
- result = Array(rangeLength + rightLength),
- isUncurried = !isCurried;
-
- while (++argsIndex < rangeLength) {
- result[argsIndex] = args[argsIndex];
- }
- var offset = argsIndex;
- while (++rightIndex < rightLength) {
- result[offset + rightIndex] = partials[rightIndex];
- }
- while (++holdersIndex < holdersLength) {
- if (isUncurried || argsIndex < argsLength) {
- result[offset + holders[holdersIndex]] = args[argsIndex++];
- }
- }
- return result;
- }
-
- /**
- * Copies the values of `source` to `array`.
- *
- * @private
- * @param {Array} source The array to copy values from.
- * @param {Array} [array=[]] The array to copy values to.
- * @returns {Array} Returns `array`.
- */
- function copyArray(source, array) {
- var index = -1,
- length = source.length;
-
- array || (array = Array(length));
- while (++index < length) {
- array[index] = source[index];
- }
- return array;
- }
-
- /**
- * Copies properties of `source` to `object`.
- *
- * @private
- * @param {Object} source The object to copy properties from.
- * @param {Array} props The property identifiers to copy.
- * @param {Object} [object={}] The object to copy properties to.
- * @param {Function} [customizer] The function to customize copied values.
- * @returns {Object} Returns `object`.
- */
- function copyObject(source, props, object, customizer) {
- var isNew = !object;
- object || (object = {});
-
- var index = -1,
- length = props.length;
-
- while (++index < length) {
- var key = props[index];
-
- var newValue = customizer
- ? customizer(object[key], source[key], key, object, source)
- : undefined;
-
- if (newValue === undefined) {
- newValue = source[key];
- }
- if (isNew) {
- baseAssignValue(object, key, newValue);
- } else {
- assignValue(object, key, newValue);
- }
- }
- return object;
- }
-
- /**
- * Copies own symbols of `source` to `object`.
- *
- * @private
- * @param {Object} source The object to copy symbols from.
- * @param {Object} [object={}] The object to copy symbols to.
- * @returns {Object} Returns `object`.
- */
- function copySymbols(source, object) {
- return copyObject(source, getSymbols(source), object);
- }
-
- /**
- * Copies own and inherited symbols of `source` to `object`.
- *
- * @private
- * @param {Object} source The object to copy symbols from.
- * @param {Object} [object={}] The object to copy symbols to.
- * @returns {Object} Returns `object`.
- */
- function copySymbolsIn(source, object) {
- return copyObject(source, getSymbolsIn(source), object);
- }
-
- /**
- * Creates a function like `_.groupBy`.
- *
- * @private
- * @param {Function} setter The function to set accumulator values.
- * @param {Function} [initializer] The accumulator object initializer.
- * @returns {Function} Returns the new aggregator function.
- */
- function createAggregator(setter, initializer) {
- return function(collection, iteratee) {
- var func = isArray(collection) ? arrayAggregator : baseAggregator,
- accumulator = initializer ? initializer() : {};
-
- return func(collection, setter, getIteratee(iteratee, 2), accumulator);
- };
- }
-
- /**
- * Creates a function like `_.assign`.
- *
- * @private
- * @param {Function} assigner The function to assign values.
- * @returns {Function} Returns the new assigner function.
- */
- function createAssigner(assigner) {
- return baseRest(function(object, sources) {
- var index = -1,
- length = sources.length,
- customizer = length > 1 ? sources[length - 1] : undefined,
- guard = length > 2 ? sources[2] : undefined;
-
- customizer = (assigner.length > 3 && typeof customizer == 'function')
- ? (length--, customizer)
- : undefined;
-
- if (guard && isIterateeCall(sources[0], sources[1], guard)) {
- customizer = length < 3 ? undefined : customizer;
- length = 1;
- }
- object = Object(object);
- while (++index < length) {
- var source = sources[index];
- if (source) {
- assigner(object, source, index, customizer);
- }
- }
- return object;
- });
- }
-
- /**
- * Creates a `baseEach` or `baseEachRight` function.
- *
- * @private
- * @param {Function} eachFunc The function to iterate over a collection.
- * @param {boolean} [fromRight] Specify iterating from right to left.
- * @returns {Function} Returns the new base function.
- */
- function createBaseEach(eachFunc, fromRight) {
- return function(collection, iteratee) {
- if (collection == null) {
- return collection;
- }
- if (!isArrayLike(collection)) {
- return eachFunc(collection, iteratee);
- }
- var length = collection.length,
- index = fromRight ? length : -1,
- iterable = Object(collection);
-
- while ((fromRight ? index-- : ++index < length)) {
- if (iteratee(iterable[index], index, iterable) === false) {
- break;
- }
- }
- return collection;
- };
- }
-
- /**
- * Creates a base function for methods like `_.forIn` and `_.forOwn`.
- *
- * @private
- * @param {boolean} [fromRight] Specify iterating from right to left.
- * @returns {Function} Returns the new base function.
- */
- function createBaseFor(fromRight) {
- return function(object, iteratee, keysFunc) {
- var index = -1,
- iterable = Object(object),
- props = keysFunc(object),
- length = props.length;
-
- while (length--) {
- var key = props[fromRight ? length : ++index];
- if (iteratee(iterable[key], key, iterable) === false) {
- break;
- }
- }
- return object;
- };
- }
-
- /**
- * Creates a function that wraps `func` to invoke it with the optional `this`
- * binding of `thisArg`.
- *
- * @private
- * @param {Function} func The function to wrap.
- * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
- * @param {*} [thisArg] The `this` binding of `func`.
- * @returns {Function} Returns the new wrapped function.
- */
- function createBind(func, bitmask, thisArg) {
- var isBind = bitmask & WRAP_BIND_FLAG,
- Ctor = createCtor(func);
-
- function wrapper() {
- var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
- return fn.apply(isBind ? thisArg : this, arguments);
- }
- return wrapper;
- }
-
- /**
- * Creates a function like `_.lowerFirst`.
- *
- * @private
- * @param {string} methodName The name of the `String` case method to use.
- * @returns {Function} Returns the new case function.
- */
- function createCaseFirst(methodName) {
- return function(string) {
- string = toString(string);
-
- var strSymbols = hasUnicode(string)
- ? stringToArray(string)
- : undefined;
-
- var chr = strSymbols
- ? strSymbols[0]
- : string.charAt(0);
-
- var trailing = strSymbols
- ? castSlice(strSymbols, 1).join('')
- : string.slice(1);
-
- return chr[methodName]() + trailing;
- };
- }
-
- /**
- * Creates a function like `_.camelCase`.
- *
- * @private
- * @param {Function} callback The function to combine each word.
- * @returns {Function} Returns the new compounder function.
- */
- function createCompounder(callback) {
- return function(string) {
- return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');
- };
- }
-
- /**
- * Creates a function that produces an instance of `Ctor` regardless of
- * whether it was invoked as part of a `new` expression or by `call` or `apply`.
- *
- * @private
- * @param {Function} Ctor The constructor to wrap.
- * @returns {Function} Returns the new wrapped function.
- */
- function createCtor(Ctor) {
- return function() {
- // Use a `switch` statement to work with class constructors. See
- // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
- // for more details.
- var args = arguments;
- switch (args.length) {
- case 0: return new Ctor;
- case 1: return new Ctor(args[0]);
- case 2: return new Ctor(args[0], args[1]);
- case 3: return new Ctor(args[0], args[1], args[2]);
- case 4: return new Ctor(args[0], args[1], args[2], args[3]);
- case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);
- case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
- case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
- }
- var thisBinding = baseCreate(Ctor.prototype),
- result = Ctor.apply(thisBinding, args);
-
- // Mimic the constructor's `return` behavior.
- // See https://es5.github.io/#x13.2.2 for more details.
- return isObject(result) ? result : thisBinding;
- };
- }
-
- /**
- * Creates a function that wraps `func` to enable currying.
- *
- * @private
- * @param {Function} func The function to wrap.
- * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
- * @param {number} arity The arity of `func`.
- * @returns {Function} Returns the new wrapped function.
- */
- function createCurry(func, bitmask, arity) {
- var Ctor = createCtor(func);
-
- function wrapper() {
- var length = arguments.length,
- args = Array(length),
- index = length,
- placeholder = getHolder(wrapper);
-
- while (index--) {
- args[index] = arguments[index];
- }
- var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)
- ? []
- : replaceHolders(args, placeholder);
-
- length -= holders.length;
- if (length < arity) {
- return createRecurry(
- func, bitmask, createHybrid, wrapper.placeholder, undefined,
- args, holders, undefined, undefined, arity - length);
- }
- var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
- return apply(fn, this, args);
- }
- return wrapper;
- }
-
- /**
- * Creates a `_.find` or `_.findLast` function.
- *
- * @private
- * @param {Function} findIndexFunc The function to find the collection index.
- * @returns {Function} Returns the new find function.
- */
- function createFind(findIndexFunc) {
- return function(collection, predicate, fromIndex) {
- var iterable = Object(collection);
- if (!isArrayLike(collection)) {
- var iteratee = getIteratee(predicate, 3);
- collection = keys(collection);
- predicate = function(key) { return iteratee(iterable[key], key, iterable); };
- }
- var index = findIndexFunc(collection, predicate, fromIndex);
- return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;
- };
- }
-
- /**
- * Creates a `_.flow` or `_.flowRight` function.
- *
- * @private
- * @param {boolean} [fromRight] Specify iterating from right to left.
- * @returns {Function} Returns the new flow function.
- */
- function createFlow(fromRight) {
- return flatRest(function(funcs) {
- var length = funcs.length,
- index = length,
- prereq = LodashWrapper.prototype.thru;
-
- if (fromRight) {
- funcs.reverse();
- }
- while (index--) {
- var func = funcs[index];
- if (typeof func != 'function') {
- throw new TypeError(FUNC_ERROR_TEXT);
- }
- if (prereq && !wrapper && getFuncName(func) == 'wrapper') {
- var wrapper = new LodashWrapper([], true);
- }
- }
- index = wrapper ? index : length;
- while (++index < length) {
- func = funcs[index];
-
- var funcName = getFuncName(func),
- data = funcName == 'wrapper' ? getData(func) : undefined;
-
- if (data && isLaziable(data[0]) &&
- data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) &&
- !data[4].length && data[9] == 1
- ) {
- wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);
- } else {
- wrapper = (func.length == 1 && isLaziable(func))
- ? wrapper[funcName]()
- : wrapper.thru(func);
- }
- }
- return function() {
- var args = arguments,
- value = args[0];
-
- if (wrapper && args.length == 1 && isArray(value)) {
- return wrapper.plant(value).value();
- }
- var index = 0,
- result = length ? funcs[index].apply(this, args) : value;
-
- while (++index < length) {
- result = funcs[index].call(this, result);
- }
- return result;
- };
- });
- }
-
- /**
- * Creates a function that wraps `func` to invoke it with optional `this`
- * binding of `thisArg`, partial application, and currying.
- *
- * @private
- * @param {Function|string} func The function or method name to wrap.
- * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
- * @param {*} [thisArg] The `this` binding of `func`.
- * @param {Array} [partials] The arguments to prepend to those provided to
- * the new function.
- * @param {Array} [holders] The `partials` placeholder indexes.
- * @param {Array} [partialsRight] The arguments to append to those provided
- * to the new function.
- * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.
- * @param {Array} [argPos] The argument positions of the new function.
- * @param {number} [ary] The arity cap of `func`.
- * @param {number} [arity] The arity of `func`.
- * @returns {Function} Returns the new wrapped function.
- */
- function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
- var isAry = bitmask & WRAP_ARY_FLAG,
- isBind = bitmask & WRAP_BIND_FLAG,
- isBindKey = bitmask & WRAP_BIND_KEY_FLAG,
- isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG),
- isFlip = bitmask & WRAP_FLIP_FLAG,
- Ctor = isBindKey ? undefined : createCtor(func);
-
- function wrapper() {
- var length = arguments.length,
- args = Array(length),
- index = length;
-
- while (index--) {
- args[index] = arguments[index];
- }
- if (isCurried) {
- var placeholder = getHolder(wrapper),
- holdersCount = countHolders(args, placeholder);
- }
- if (partials) {
- args = composeArgs(args, partials, holders, isCurried);
- }
- if (partialsRight) {
- args = composeArgsRight(args, partialsRight, holdersRight, isCurried);
- }
- length -= holdersCount;
- if (isCurried && length < arity) {
- var newHolders = replaceHolders(args, placeholder);
- return createRecurry(
- func, bitmask, createHybrid, wrapper.placeholder, thisArg,
- args, newHolders, argPos, ary, arity - length
- );
- }
- var thisBinding = isBind ? thisArg : this,
- fn = isBindKey ? thisBinding[func] : func;
-
- length = args.length;
- if (argPos) {
- args = reorder(args, argPos);
- } else if (isFlip && length > 1) {
- args.reverse();
- }
- if (isAry && ary < length) {
- args.length = ary;
- }
- if (this && this !== root && this instanceof wrapper) {
- fn = Ctor || createCtor(fn);
- }
- return fn.apply(thisBinding, args);
- }
- return wrapper;
- }
-
- /**
- * Creates a function like `_.invertBy`.
- *
- * @private
- * @param {Function} setter The function to set accumulator values.
- * @param {Function} toIteratee The function to resolve iteratees.
- * @returns {Function} Returns the new inverter function.
- */
- function createInverter(setter, toIteratee) {
- return function(object, iteratee) {
- return baseInverter(object, setter, toIteratee(iteratee), {});
- };
- }
-
- /**
- * Creates a function that performs a mathematical operation on two values.
- *
- * @private
- * @param {Function} operator The function to perform the operation.
- * @param {number} [defaultValue] The value used for `undefined` arguments.
- * @returns {Function} Returns the new mathematical operation function.
- */
- function createMathOperation(operator, defaultValue) {
- return function(value, other) {
- var result;
- if (value === undefined && other === undefined) {
- return defaultValue;
- }
- if (value !== undefined) {
- result = value;
- }
- if (other !== undefined) {
- if (result === undefined) {
- return other;
- }
- if (typeof value == 'string' || typeof other == 'string') {
- value = baseToString(value);
- other = baseToString(other);
- } else {
- value = baseToNumber(value);
- other = baseToNumber(other);
- }
- result = operator(value, other);
- }
- return result;
- };
- }
-
- /**
- * Creates a function like `_.over`.
- *
- * @private
- * @param {Function} arrayFunc The function to iterate over iteratees.
- * @returns {Function} Returns the new over function.
- */
- function createOver(arrayFunc) {
- return flatRest(function(iteratees) {
- iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
- return baseRest(function(args) {
- var thisArg = this;
- return arrayFunc(iteratees, function(iteratee) {
- return apply(iteratee, thisArg, args);
- });
- });
- });
- }
-
- /**
- * Creates the padding for `string` based on `length`. The `chars` string
- * is truncated if the number of characters exceeds `length`.
- *
- * @private
- * @param {number} length The padding length.
- * @param {string} [chars=' '] The string used as padding.
- * @returns {string} Returns the padding for `string`.
- */
- function createPadding(length, chars) {
- chars = chars === undefined ? ' ' : baseToString(chars);
-
- var charsLength = chars.length;
- if (charsLength < 2) {
- return charsLength ? baseRepeat(chars, length) : chars;
- }
- var result = baseRepeat(chars, nativeCeil(length / stringSize(chars)));
- return hasUnicode(chars)
- ? castSlice(stringToArray(result), 0, length).join('')
- : result.slice(0, length);
- }
-
- /**
- * Creates a function that wraps `func` to invoke it with the `this` binding
- * of `thisArg` and `partials` prepended to the arguments it receives.
- *
- * @private
- * @param {Function} func The function to wrap.
- * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
- * @param {*} thisArg The `this` binding of `func`.
- * @param {Array} partials The arguments to prepend to those provided to
- * the new function.
- * @returns {Function} Returns the new wrapped function.
- */
- function createPartial(func, bitmask, thisArg, partials) {
- var isBind = bitmask & WRAP_BIND_FLAG,
- Ctor = createCtor(func);
-
- function wrapper() {
- var argsIndex = -1,
- argsLength = arguments.length,
- leftIndex = -1,
- leftLength = partials.length,
- args = Array(leftLength + argsLength),
- fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
-
- while (++leftIndex < leftLength) {
- args[leftIndex] = partials[leftIndex];
- }
- while (argsLength--) {
- args[leftIndex++] = arguments[++argsIndex];
- }
- return apply(fn, isBind ? thisArg : this, args);
- }
- return wrapper;
- }
-
- /**
- * Creates a `_.range` or `_.rangeRight` function.
- *
- * @private
- * @param {boolean} [fromRight] Specify iterating from right to left.
- * @returns {Function} Returns the new range function.
- */
- function createRange(fromRight) {
- return function(start, end, step) {
- if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {
- end = step = undefined;
- }
- // Ensure the sign of `-0` is preserved.
- start = toFinite(start);
- if (end === undefined) {
- end = start;
- start = 0;
- } else {
- end = toFinite(end);
- }
- step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);
- return baseRange(start, end, step, fromRight);
- };
- }
-
- /**
- * Creates a function that performs a relational operation on two values.
- *
- * @private
- * @param {Function} operator The function to perform the operation.
- * @returns {Function} Returns the new relational operation function.
- */
- function createRelationalOperation(operator) {
- return function(value, other) {
- if (!(typeof value == 'string' && typeof other == 'string')) {
- value = toNumber(value);
- other = toNumber(other);
- }
- return operator(value, other);
- };
- }
-
- /**
- * Creates a function that wraps `func` to continue currying.
- *
- * @private
- * @param {Function} func The function to wrap.
- * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
- * @param {Function} wrapFunc The function to create the `func` wrapper.
- * @param {*} placeholder The placeholder value.
- * @param {*} [thisArg] The `this` binding of `func`.
- * @param {Array} [partials] The arguments to prepend to those provided to
- * the new function.
- * @param {Array} [holders] The `partials` placeholder indexes.
- * @param {Array} [argPos] The argument positions of the new function.
- * @param {number} [ary] The arity cap of `func`.
- * @param {number} [arity] The arity of `func`.
- * @returns {Function} Returns the new wrapped function.
- */
- function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {
- var isCurry = bitmask & WRAP_CURRY_FLAG,
- newHolders = isCurry ? holders : undefined,
- newHoldersRight = isCurry ? undefined : holders,
- newPartials = isCurry ? partials : undefined,
- newPartialsRight = isCurry ? undefined : partials;
-
- bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG);
- bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);
-
- if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {
- bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);
- }
- var newData = [
- func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,
- newHoldersRight, argPos, ary, arity
- ];
-
- var result = wrapFunc.apply(undefined, newData);
- if (isLaziable(func)) {
- setData(result, newData);
- }
- result.placeholder = placeholder;
- return setWrapToString(result, func, bitmask);
- }
-
- /**
- * Creates a function like `_.round`.
- *
- * @private
- * @param {string} methodName The name of the `Math` method to use when rounding.
- * @returns {Function} Returns the new round function.
- */
- function createRound(methodName) {
- var func = Math[methodName];
- return function(number, precision) {
- number = toNumber(number);
- precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);
- if (precision) {
- // Shift with exponential notation to avoid floating-point issues.
- // See [MDN](https://mdn.io/round#Examples) for more details.
- var pair = (toString(number) + 'e').split('e'),
- value = func(pair[0] + 'e' + (+pair[1] + precision));
-
- pair = (toString(value) + 'e').split('e');
- return +(pair[0] + 'e' + (+pair[1] - precision));
- }
- return func(number);
- };
- }
-
- /**
- * Creates a set object of `values`.
- *
- * @private
- * @param {Array} values The values to add to the set.
- * @returns {Object} Returns the new set.
- */
- var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
- return new Set(values);
- };
-
- /**
- * Creates a `_.toPairs` or `_.toPairsIn` function.
- *
- * @private
- * @param {Function} keysFunc The function to get the keys of a given object.
- * @returns {Function} Returns the new pairs function.
- */
- function createToPairs(keysFunc) {
- return function(object) {
- var tag = getTag(object);
- if (tag == mapTag) {
- return mapToArray(object);
- }
- if (tag == setTag) {
- return setToPairs(object);
- }
- return baseToPairs(object, keysFunc(object));
- };
- }
-
- /**
- * Creates a function that either curries or invokes `func` with optional
- * `this` binding and partially applied arguments.
- *
- * @private
- * @param {Function|string} func The function or method name to wrap.
- * @param {number} bitmask The bitmask flags.
- * 1 - `_.bind`
- * 2 - `_.bindKey`
- * 4 - `_.curry` or `_.curryRight` of a bound function
- * 8 - `_.curry`
- * 16 - `_.curryRight`
- * 32 - `_.partial`
- * 64 - `_.partialRight`
- * 128 - `_.rearg`
- * 256 - `_.ary`
- * 512 - `_.flip`
- * @param {*} [thisArg] The `this` binding of `func`.
- * @param {Array} [partials] The arguments to be partially applied.
- * @param {Array} [holders] The `partials` placeholder indexes.
- * @param {Array} [argPos] The argument positions of the new function.
- * @param {number} [ary] The arity cap of `func`.
- * @param {number} [arity] The arity of `func`.
- * @returns {Function} Returns the new wrapped function.
- */
- function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {
- var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;
- if (!isBindKey && typeof func != 'function') {
- throw new TypeError(FUNC_ERROR_TEXT);
- }
- var length = partials ? partials.length : 0;
- if (!length) {
- bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);
- partials = holders = undefined;
- }
- ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0);
- arity = arity === undefined ? arity : toInteger(arity);
- length -= holders ? holders.length : 0;
-
- if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {
- var partialsRight = partials,
- holdersRight = holders;
-
- partials = holders = undefined;
- }
- var data = isBindKey ? undefined : getData(func);
-
- var newData = [
- func, bitmask, thisArg, partials, holders, partialsRight, holdersRight,
- argPos, ary, arity
- ];
-
- if (data) {
- mergeData(newData, data);
- }
- func = newData[0];
- bitmask = newData[1];
- thisArg = newData[2];
- partials = newData[3];
- holders = newData[4];
- arity = newData[9] = newData[9] === undefined
- ? (isBindKey ? 0 : func.length)
- : nativeMax(newData[9] - length, 0);
-
- if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {
- bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);
- }
- if (!bitmask || bitmask == WRAP_BIND_FLAG) {
- var result = createBind(func, bitmask, thisArg);
- } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {
- result = createCurry(func, bitmask, arity);
- } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {
- result = createPartial(func, bitmask, thisArg, partials);
- } else {
- result = createHybrid.apply(undefined, newData);
- }
- var setter = data ? baseSetData : setData;
- return setWrapToString(setter(result, newData), func, bitmask);
- }
-
- /**
- * Used by `_.defaults` to customize its `_.assignIn` use to assign properties
- * of source objects to the destination object for all destination properties
- * that resolve to `undefined`.
- *
- * @private
- * @param {*} objValue The destination value.
- * @param {*} srcValue The source value.
- * @param {string} key The key of the property to assign.
- * @param {Object} object The parent object of `objValue`.
- * @returns {*} Returns the value to assign.
- */
- function customDefaultsAssignIn(objValue, srcValue, key, object) {
- if (objValue === undefined ||
- (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {
- return srcValue;
- }
- return objValue;
- }
-
- /**
- * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source
- * objects into destination objects that are passed thru.
- *
- * @private
- * @param {*} objValue The destination value.
- * @param {*} srcValue The source value.
- * @param {string} key The key of the property to merge.
- * @param {Object} object The parent object of `objValue`.
- * @param {Object} source The parent object of `srcValue`.
- * @param {Object} [stack] Tracks traversed source values and their merged
- * counterparts.
- * @returns {*} Returns the value to assign.
- */
- function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {
- if (isObject(objValue) && isObject(srcValue)) {
- // Recursively merge objects and arrays (susceptible to call stack limits).
- stack.set(srcValue, objValue);
- baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack);
- stack['delete'](srcValue);
- }
- return objValue;
- }
-
- /**
- * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain
- * objects.
- *
- * @private
- * @param {*} value The value to inspect.
- * @param {string} key The key of the property to inspect.
- * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.
- */
- function customOmitClone(value) {
- return isPlainObject(value) ? undefined : value;
- }
-
- /**
- * A specialized version of `baseIsEqualDeep` for arrays with support for
- * partial deep comparisons.
- *
- * @private
- * @param {Array} array The array to compare.
- * @param {Array} other The other array to compare.
- * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
- * @param {Function} customizer The function to customize comparisons.
- * @param {Function} equalFunc The function to determine equivalents of values.
- * @param {Object} stack Tracks traversed `array` and `other` objects.
- * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
- */
- function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
- var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
- arrLength = array.length,
- othLength = other.length;
-
- if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
- return false;
- }
- // Assume cyclic values are equal.
- var stacked = stack.get(array);
- if (stacked && stack.get(other)) {
- return stacked == other;
- }
- var index = -1,
- result = true,
- seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;
-
- stack.set(array, other);
- stack.set(other, array);
-
- // Ignore non-index properties.
- while (++index < arrLength) {
- var arrValue = array[index],
- othValue = other[index];
-
- if (customizer) {
- var compared = isPartial
- ? customizer(othValue, arrValue, index, other, array, stack)
- : customizer(arrValue, othValue, index, array, other, stack);
- }
- if (compared !== undefined) {
- if (compared) {
- continue;
- }
- result = false;
- break;
- }
- // Recursively compare arrays (susceptible to call stack limits).
- if (seen) {
- if (!arraySome(other, function(othValue, othIndex) {
- if (!cacheHas(seen, othIndex) &&
- (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
- return seen.push(othIndex);
- }
- })) {
- result = false;
- break;
- }
- } else if (!(
- arrValue === othValue ||
- equalFunc(arrValue, othValue, bitmask, customizer, stack)
- )) {
- result = false;
- break;
- }
- }
- stack['delete'](array);
- stack['delete'](other);
- return result;
- }
-
- /**
- * A specialized version of `baseIsEqualDeep` for comparing objects of
- * the same `toStringTag`.
- *
- * **Note:** This function only supports comparing values with tags of
- * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
- *
- * @private
- * @param {Object} object The object to compare.
- * @param {Object} other The other object to compare.
- * @param {string} tag The `toStringTag` of the objects to compare.
- * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
- * @param {Function} customizer The function to customize comparisons.
- * @param {Function} equalFunc The function to determine equivalents of values.
- * @param {Object} stack Tracks traversed `object` and `other` objects.
- * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
- */
- function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
- switch (tag) {
- case dataViewTag:
- if ((object.byteLength != other.byteLength) ||
- (object.byteOffset != other.byteOffset)) {
- return false;
- }
- object = object.buffer;
- other = other.buffer;
-
- case arrayBufferTag:
- if ((object.byteLength != other.byteLength) ||
- !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
- return false;
- }
- return true;
-
- case boolTag:
- case dateTag:
- case numberTag:
- // Coerce booleans to `1` or `0` and dates to milliseconds.
- // Invalid dates are coerced to `NaN`.
- return eq(+object, +other);
-
- case errorTag:
- return object.name == other.name && object.message == other.message;
-
- case regexpTag:
- case stringTag:
- // Coerce regexes to strings and treat strings, primitives and objects,
- // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
- // for more details.
- return object == (other + '');
-
- case mapTag:
- var convert = mapToArray;
-
- case setTag:
- var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
- convert || (convert = setToArray);
-
- if (object.size != other.size && !isPartial) {
- return false;
- }
- // Assume cyclic values are equal.
- var stacked = stack.get(object);
- if (stacked) {
- return stacked == other;
- }
- bitmask |= COMPARE_UNORDERED_FLAG;
-
- // Recursively compare objects (susceptible to call stack limits).
- stack.set(object, other);
- var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
- stack['delete'](object);
- return result;
-
- case symbolTag:
- if (symbolValueOf) {
- return symbolValueOf.call(object) == symbolValueOf.call(other);
- }
- }
- return false;
- }
-
- /**
- * A specialized version of `baseIsEqualDeep` for objects with support for
- * partial deep comparisons.
- *
- * @private
- * @param {Object} object The object to compare.
- * @param {Object} other The other object to compare.
- * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
- * @param {Function} customizer The function to customize comparisons.
- * @param {Function} equalFunc The function to determine equivalents of values.
- * @param {Object} stack Tracks traversed `object` and `other` objects.
- * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
- */
- function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
- var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
- objProps = getAllKeys(object),
- objLength = objProps.length,
- othProps = getAllKeys(other),
- othLength = othProps.length;
-
- if (objLength != othLength && !isPartial) {
- return false;
- }
- var index = objLength;
- while (index--) {
- var key = objProps[index];
- if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
- return false;
- }
- }
- // Assume cyclic values are equal.
- var stacked = stack.get(object);
- if (stacked && stack.get(other)) {
- return stacked == other;
- }
- var result = true;
- stack.set(object, other);
- stack.set(other, object);
-
- var skipCtor = isPartial;
- while (++index < objLength) {
- key = objProps[index];
- var objValue = object[key],
- othValue = other[key];
-
- if (customizer) {
- var compared = isPartial
- ? customizer(othValue, objValue, key, other, object, stack)
- : customizer(objValue, othValue, key, object, other, stack);
- }
- // Recursively compare objects (susceptible to call stack limits).
- if (!(compared === undefined
- ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
- : compared
- )) {
- result = false;
- break;
- }
- skipCtor || (skipCtor = key == 'constructor');
- }
- if (result && !skipCtor) {
- var objCtor = object.constructor,
- othCtor = other.constructor;
-
- // Non `Object` object instances with different constructors are not equal.
- if (objCtor != othCtor &&
- ('constructor' in object && 'constructor' in other) &&
- !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
- typeof othCtor == 'function' && othCtor instanceof othCtor)) {
- result = false;
- }
- }
- stack['delete'](object);
- stack['delete'](other);
- return result;
- }
-
- /**
- * A specialized version of `baseRest` which flattens the rest array.
- *
- * @private
- * @param {Function} func The function to apply a rest parameter to.
- * @returns {Function} Returns the new function.
- */
- function flatRest(func) {
- return setToString(overRest(func, undefined, flatten), func + '');
- }
-
- /**
- * Creates an array of own enumerable property names and symbols of `object`.
- *
- * @private
- * @param {Object} object The object to query.
- * @returns {Array} Returns the array of property names and symbols.
- */
- function getAllKeys(object) {
- return baseGetAllKeys(object, keys, getSymbols);
- }
-
- /**
- * Creates an array of own and inherited enumerable property names and
- * symbols of `object`.
- *
- * @private
- * @param {Object} object The object to query.
- * @returns {Array} Returns the array of property names and symbols.
- */
- function getAllKeysIn(object) {
- return baseGetAllKeys(object, keysIn, getSymbolsIn);
- }
-
- /**
- * Gets metadata for `func`.
- *
- * @private
- * @param {Function} func The function to query.
- * @returns {*} Returns the metadata for `func`.
- */
- var getData = !metaMap ? noop : function(func) {
- return metaMap.get(func);
- };
-
- /**
- * Gets the name of `func`.
- *
- * @private
- * @param {Function} func The function to query.
- * @returns {string} Returns the function name.
- */
- function getFuncName(func) {
- var result = (func.name + ''),
- array = realNames[result],
- length = hasOwnProperty.call(realNames, result) ? array.length : 0;
-
- while (length--) {
- var data = array[length],
- otherFunc = data.func;
- if (otherFunc == null || otherFunc == func) {
- return data.name;
- }
- }
- return result;
- }
-
- /**
- * Gets the argument placeholder value for `func`.
- *
- * @private
- * @param {Function} func The function to inspect.
- * @returns {*} Returns the placeholder value.
- */
- function getHolder(func) {
- var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func;
- return object.placeholder;
- }
-
- /**
- * Gets the appropriate "iteratee" function. If `_.iteratee` is customized,
- * this function returns the custom method, otherwise it returns `baseIteratee`.
- * If arguments are provided, the chosen function is invoked with them and
- * its result is returned.
- *
- * @private
- * @param {*} [value] The value to convert to an iteratee.
- * @param {number} [arity] The arity of the created iteratee.
- * @returns {Function} Returns the chosen function or its result.
- */
- function getIteratee() {
- var result = lodash.iteratee || iteratee;
- result = result === iteratee ? baseIteratee : result;
- return arguments.length ? result(arguments[0], arguments[1]) : result;
- }
-
- /**
- * Gets the data for `map`.
- *
- * @private
- * @param {Object} map The map to query.
- * @param {string} key The reference key.
- * @returns {*} Returns the map data.
- */
- function getMapData(map, key) {
- var data = map.__data__;
- return isKeyable(key)
- ? data[typeof key == 'string' ? 'string' : 'hash']
- : data.map;
- }
-
- /**
- * Gets the property names, values, and compare flags of `object`.
- *
- * @private
- * @param {Object} object The object to query.
- * @returns {Array} Returns the match data of `object`.
- */
- function getMatchData(object) {
- var result = keys(object),
- length = result.length;
-
- while (length--) {
- var key = result[length],
- value = object[key];
-
- result[length] = [key, value, isStrictComparable(value)];
- }
- return result;
- }
-
- /**
- * Gets the native function at `key` of `object`.
- *
- * @private
- * @param {Object} object The object to query.
- * @param {string} key The key of the method to get.
- * @returns {*} Returns the function if it's native, else `undefined`.
- */
- function getNative(object, key) {
- var value = getValue(object, key);
- return baseIsNative(value) ? value : undefined;
- }
-
- /**
- * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
- *
- * @private
- * @param {*} value The value to query.
- * @returns {string} Returns the raw `toStringTag`.
- */
- function getRawTag(value) {
- var isOwn = hasOwnProperty.call(value, symToStringTag),
- tag = value[symToStringTag];
-
- try {
- value[symToStringTag] = undefined;
- var unmasked = true;
- } catch (e) {}
-
- var result = nativeObjectToString.call(value);
- if (unmasked) {
- if (isOwn) {
- value[symToStringTag] = tag;
- } else {
- delete value[symToStringTag];
- }
- }
- return result;
- }
-
- /**
- * Creates an array of the own enumerable symbols of `object`.
- *
- * @private
- * @param {Object} object The object to query.
- * @returns {Array} Returns the array of symbols.
- */
- var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
- if (object == null) {
- return [];
- }
- object = Object(object);
- return arrayFilter(nativeGetSymbols(object), function(symbol) {
- return propertyIsEnumerable.call(object, symbol);
- });
- };
-
- /**
- * Creates an array of the own and inherited enumerable symbols of `object`.
- *
- * @private
- * @param {Object} object The object to query.
- * @returns {Array} Returns the array of symbols.
- */
- var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
- var result = [];
- while (object) {
- arrayPush(result, getSymbols(object));
- object = getPrototype(object);
- }
- return result;
- };
-
- /**
- * Gets the `toStringTag` of `value`.
- *
- * @private
- * @param {*} value The value to query.
- * @returns {string} Returns the `toStringTag`.
- */
- var getTag = baseGetTag;
-
- // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
- if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
- (Map && getTag(new Map) != mapTag) ||
- (Promise && getTag(Promise.resolve()) != promiseTag) ||
- (Set && getTag(new Set) != setTag) ||
- (WeakMap && getTag(new WeakMap) != weakMapTag)) {
- getTag = function(value) {
- var result = baseGetTag(value),
- Ctor = result == objectTag ? value.constructor : undefined,
- ctorString = Ctor ? toSource(Ctor) : '';
-
- if (ctorString) {
- switch (ctorString) {
- case dataViewCtorString: return dataViewTag;
- case mapCtorString: return mapTag;
- case promiseCtorString: return promiseTag;
- case setCtorString: return setTag;
- case weakMapCtorString: return weakMapTag;
- }
- }
- return result;
- };
- }
-
- /**
- * Gets the view, applying any `transforms` to the `start` and `end` positions.
- *
- * @private
- * @param {number} start The start of the view.
- * @param {number} end The end of the view.
- * @param {Array} transforms The transformations to apply to the view.
- * @returns {Object} Returns an object containing the `start` and `end`
- * positions of the view.
- */
- function getView(start, end, transforms) {
- var index = -1,
- length = transforms.length;
-
- while (++index < length) {
- var data = transforms[index],
- size = data.size;
-
- switch (data.type) {
- case 'drop': start += size; break;
- case 'dropRight': end -= size; break;
- case 'take': end = nativeMin(end, start + size); break;
- case 'takeRight': start = nativeMax(start, end - size); break;
- }
- }
- return { 'start': start, 'end': end };
- }
-
- /**
- * Extracts wrapper details from the `source` body comment.
- *
- * @private
- * @param {string} source The source to inspect.
- * @returns {Array} Returns the wrapper details.
- */
- function getWrapDetails(source) {
- var match = source.match(reWrapDetails);
- return match ? match[1].split(reSplitDetails) : [];
- }
-
- /**
- * Checks if `path` exists on `object`.
- *
- * @private
- * @param {Object} object The object to query.
- * @param {Array|string} path The path to check.
- * @param {Function} hasFunc The function to check properties.
- * @returns {boolean} Returns `true` if `path` exists, else `false`.
- */
- function hasPath(object, path, hasFunc) {
- path = castPath(path, object);
-
- var index = -1,
- length = path.length,
- result = false;
-
- while (++index < length) {
- var key = toKey(path[index]);
- if (!(result = object != null && hasFunc(object, key))) {
- break;
- }
- object = object[key];
- }
- if (result || ++index != length) {
- return result;
- }
- length = object == null ? 0 : object.length;
- return !!length && isLength(length) && isIndex(key, length) &&
- (isArray(object) || isArguments(object));
- }
-
- /**
- * Initializes an array clone.
- *
- * @private
- * @param {Array} array The array to clone.
- * @returns {Array} Returns the initialized clone.
- */
- function initCloneArray(array) {
- var length = array.length,
- result = array.constructor(length);
-
- // Add properties assigned by `RegExp#exec`.
- if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
- result.index = array.index;
- result.input = array.input;
- }
- return result;
- }
-
- /**
- * Initializes an object clone.
- *
- * @private
- * @param {Object} object The object to clone.
- * @returns {Object} Returns the initialized clone.
- */
- function initCloneObject(object) {
- return (typeof object.constructor == 'function' && !isPrototype(object))
- ? baseCreate(getPrototype(object))
- : {};
- }
-
- /**
- * Initializes an object clone based on its `toStringTag`.
- *
- * **Note:** This function only supports cloning values with tags of
- * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
- *
- * @private
- * @param {Object} object The object to clone.
- * @param {string} tag The `toStringTag` of the object to clone.
- * @param {Function} cloneFunc The function to clone values.
- * @param {boolean} [isDeep] Specify a deep clone.
- * @returns {Object} Returns the initialized clone.
- */
- function initCloneByTag(object, tag, cloneFunc, isDeep) {
- var Ctor = object.constructor;
- switch (tag) {
- case arrayBufferTag:
- return cloneArrayBuffer(object);
-
- case boolTag:
- case dateTag:
- return new Ctor(+object);
-
- case dataViewTag:
- return cloneDataView(object, isDeep);
-
- case float32Tag: case float64Tag:
- case int8Tag: case int16Tag: case int32Tag:
- case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:
- return cloneTypedArray(object, isDeep);
-
- case mapTag:
- return cloneMap(object, isDeep, cloneFunc);
-
- case numberTag:
- case stringTag:
- return new Ctor(object);
-
- case regexpTag:
- return cloneRegExp(object);
-
- case setTag:
- return cloneSet(object, isDeep, cloneFunc);
-
- case symbolTag:
- return cloneSymbol(object);
- }
- }
-
- /**
- * Inserts wrapper `details` in a comment at the top of the `source` body.
- *
- * @private
- * @param {string} source The source to modify.
- * @returns {Array} details The details to insert.
- * @returns {string} Returns the modified source.
- */
- function insertWrapDetails(source, details) {
- var length = details.length;
- if (!length) {
- return source;
- }
- var lastIndex = length - 1;
- details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];
- details = details.join(length > 2 ? ', ' : ' ');
- return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n');
- }
-
- /**
- * Checks if `value` is a flattenable `arguments` object or array.
- *
- * @private
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
- */
- function isFlattenable(value) {
- return isArray(value) || isArguments(value) ||
- !!(spreadableSymbol && value && value[spreadableSymbol]);
- }
-
- /**
- * Checks if `value` is a valid array-like index.
- *
- * @private
- * @param {*} value The value to check.
- * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
- * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
- */
- function isIndex(value, length) {
- length = length == null ? MAX_SAFE_INTEGER : length;
- return !!length &&
- (typeof value == 'number' || reIsUint.test(value)) &&
- (value > -1 && value % 1 == 0 && value < length);
- }
-
- /**
- * Checks if the given arguments are from an iteratee call.
- *
- * @private
- * @param {*} value The potential iteratee value argument.
- * @param {*} index The potential iteratee index or key argument.
- * @param {*} object The potential iteratee object argument.
- * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
- * else `false`.
- */
- function isIterateeCall(value, index, object) {
- if (!isObject(object)) {
- return false;
- }
- var type = typeof index;
- if (type == 'number'
- ? (isArrayLike(object) && isIndex(index, object.length))
- : (type == 'string' && index in object)
- ) {
- return eq(object[index], value);
- }
- return false;
- }
-
- /**
- * Checks if `value` is a property name and not a property path.
- *
- * @private
- * @param {*} value The value to check.
- * @param {Object} [object] The object to query keys on.
- * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
- */
- function isKey(value, object) {
- if (isArray(value)) {
- return false;
- }
- var type = typeof value;
- if (type == 'number' || type == 'symbol' || type == 'boolean' ||
- value == null || isSymbol(value)) {
- return true;
- }
- return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
- (object != null && value in Object(object));
- }
-
- /**
- * Checks if `value` is suitable for use as unique object key.
- *
- * @private
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
- */
- function isKeyable(value) {
- var type = typeof value;
- return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
- ? (value !== '__proto__')
- : (value === null);
- }
-
- /**
- * Checks if `func` has a lazy counterpart.
- *
- * @private
- * @param {Function} func The function to check.
- * @returns {boolean} Returns `true` if `func` has a lazy counterpart,
- * else `false`.
- */
- function isLaziable(func) {
- var funcName = getFuncName(func),
- other = lodash[funcName];
-
- if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {
- return false;
- }
- if (func === other) {
- return true;
- }
- var data = getData(other);
- return !!data && func === data[0];
- }
-
- /**
- * Checks if `func` has its source masked.
- *
- * @private
- * @param {Function} func The function to check.
- * @returns {boolean} Returns `true` if `func` is masked, else `false`.
- */
- function isMasked(func) {
- return !!maskSrcKey && (maskSrcKey in func);
- }
-
- /**
- * Checks if `func` is capable of being masked.
- *
- * @private
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `func` is maskable, else `false`.
- */
- var isMaskable = coreJsData ? isFunction : stubFalse;
-
- /**
- * Checks if `value` is likely a prototype object.
- *
- * @private
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
- */
- function isPrototype(value) {
- var Ctor = value && value.constructor,
- proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
-
- return value === proto;
- }
-
- /**
- * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
- *
- * @private
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` if suitable for strict
- * equality comparisons, else `false`.
- */
- function isStrictComparable(value) {
- return value === value && !isObject(value);
- }
-
- /**
- * A specialized version of `matchesProperty` for source values suitable
- * for strict equality comparisons, i.e. `===`.
- *
- * @private
- * @param {string} key The key of the property to get.
- * @param {*} srcValue The value to match.
- * @returns {Function} Returns the new spec function.
- */
- function matchesStrictComparable(key, srcValue) {
- return function(object) {
- if (object == null) {
- return false;
- }
- return object[key] === srcValue &&
- (srcValue !== undefined || (key in Object(object)));
- };
- }
-
- /**
- * A specialized version of `_.memoize` which clears the memoized function's
- * cache when it exceeds `MAX_MEMOIZE_SIZE`.
- *
- * @private
- * @param {Function} func The function to have its output memoized.
- * @returns {Function} Returns the new memoized function.
- */
- function memoizeCapped(func) {
- var result = memoize(func, function(key) {
- if (cache.size === MAX_MEMOIZE_SIZE) {
- cache.clear();
- }
- return key;
- });
-
- var cache = result.cache;
- return result;
- }
-
- /**
- * Merges the function metadata of `source` into `data`.
- *
- * Merging metadata reduces the number of wrappers used to invoke a function.
- * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`
- * may be applied regardless of execution order. Methods like `_.ary` and
- * `_.rearg` modify function arguments, making the order in which they are
- * executed important, preventing the merging of metadata. However, we make
- * an exception for a safe combined case where curried functions have `_.ary`
- * and or `_.rearg` applied.
- *
- * @private
- * @param {Array} data The destination metadata.
- * @param {Array} source The source metadata.
- * @returns {Array} Returns `data`.
- */
- function mergeData(data, source) {
- var bitmask = data[1],
- srcBitmask = source[1],
- newBitmask = bitmask | srcBitmask,
- isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);
-
- var isCombo =
- ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) ||
- ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) ||
- ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG));
-
- // Exit early if metadata can't be merged.
- if (!(isCommon || isCombo)) {
- return data;
- }
- // Use source `thisArg` if available.
- if (srcBitmask & WRAP_BIND_FLAG) {
- data[2] = source[2];
- // Set when currying a bound function.
- newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;
- }
- // Compose partial arguments.
- var value = source[3];
- if (value) {
- var partials = data[3];
- data[3] = partials ? composeArgs(partials, value, source[4]) : value;
- data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];
- }
- // Compose partial right arguments.
- value = source[5];
- if (value) {
- partials = data[5];
- data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;
- data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];
- }
- // Use source `argPos` if available.
- value = source[7];
- if (value) {
- data[7] = value;
- }
- // Use source `ary` if it's smaller.
- if (srcBitmask & WRAP_ARY_FLAG) {
- data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
- }
- // Use source `arity` if one is not provided.
- if (data[9] == null) {
- data[9] = source[9];
- }
- // Use source `func` and merge bitmasks.
- data[0] = source[0];
- data[1] = newBitmask;
-
- return data;
- }
-
- /**
- * This function is like
- * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
- * except that it includes inherited enumerable properties.
- *
- * @private
- * @param {Object} object The object to query.
- * @returns {Array} Returns the array of property names.
- */
- function nativeKeysIn(object) {
- var result = [];
- if (object != null) {
- for (var key in Object(object)) {
- result.push(key);
- }
- }
- return result;
- }
-
- /**
- * Converts `value` to a string using `Object.prototype.toString`.
- *
- * @private
- * @param {*} value The value to convert.
- * @returns {string} Returns the converted string.
- */
- function objectToString(value) {
- return nativeObjectToString.call(value);
- }
-
- /**
- * A specialized version of `baseRest` which transforms the rest array.
- *
- * @private
- * @param {Function} func The function to apply a rest parameter to.
- * @param {number} [start=func.length-1] The start position of the rest parameter.
- * @param {Function} transform The rest array transform.
- * @returns {Function} Returns the new function.
- */
- function overRest(func, start, transform) {
- start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
- return function() {
- var args = arguments,
- index = -1,
- length = nativeMax(args.length - start, 0),
- array = Array(length);
-
- while (++index < length) {
- array[index] = args[start + index];
- }
- index = -1;
- var otherArgs = Array(start + 1);
- while (++index < start) {
- otherArgs[index] = args[index];
- }
- otherArgs[start] = transform(array);
- return apply(func, this, otherArgs);
- };
- }
-
- /**
- * Gets the parent value at `path` of `object`.
- *
- * @private
- * @param {Object} object The object to query.
- * @param {Array} path The path to get the parent value of.
- * @returns {*} Returns the parent value.
- */
- function parent(object, path) {
- return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));
- }
-
- /**
- * Reorder `array` according to the specified indexes where the element at
- * the first index is assigned as the first element, the element at
- * the second index is assigned as the second element, and so on.
- *
- * @private
- * @param {Array} array The array to reorder.
- * @param {Array} indexes The arranged array indexes.
- * @returns {Array} Returns `array`.
- */
- function reorder(array, indexes) {
- var arrLength = array.length,
- length = nativeMin(indexes.length, arrLength),
- oldArray = copyArray(array);
-
- while (length--) {
- var index = indexes[length];
- array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;
- }
- return array;
- }
-
- /**
- * Sets metadata for `func`.
- *
- * **Note:** If this function becomes hot, i.e. is invoked a lot in a short
- * period of time, it will trip its breaker and transition to an identity
- * function to avoid garbage collection pauses in V8. See
- * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070)
- * for more details.
- *
- * @private
- * @param {Function} func The function to associate metadata with.
- * @param {*} data The metadata.
- * @returns {Function} Returns `func`.
- */
- var setData = shortOut(baseSetData);
-
- /**
- * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout).
- *
- * @private
- * @param {Function} func The function to delay.
- * @param {number} wait The number of milliseconds to delay invocation.
- * @returns {number|Object} Returns the timer id or timeout object.
- */
- var setTimeout = ctxSetTimeout || function(func, wait) {
- return root.setTimeout(func, wait);
- };
-
- /**
- * Sets the `toString` method of `func` to return `string`.
- *
- * @private
- * @param {Function} func The function to modify.
- * @param {Function} string The `toString` result.
- * @returns {Function} Returns `func`.
- */
- var setToString = shortOut(baseSetToString);
-
- /**
- * Sets the `toString` method of `wrapper` to mimic the source of `reference`
- * with wrapper details in a comment at the top of the source body.
- *
- * @private
- * @param {Function} wrapper The function to modify.
- * @param {Function} reference The reference function.
- * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
- * @returns {Function} Returns `wrapper`.
- */
- function setWrapToString(wrapper, reference, bitmask) {
- var source = (reference + '');
- return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));
- }
-
- /**
- * Creates a function that'll short out and invoke `identity` instead
- * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
- * milliseconds.
- *
- * @private
- * @param {Function} func The function to restrict.
- * @returns {Function} Returns the new shortable function.
- */
- function shortOut(func) {
- var count = 0,
- lastCalled = 0;
-
- return function() {
- var stamp = nativeNow(),
- remaining = HOT_SPAN - (stamp - lastCalled);
-
- lastCalled = stamp;
- if (remaining > 0) {
- if (++count >= HOT_COUNT) {
- return arguments[0];
- }
- } else {
- count = 0;
- }
- return func.apply(undefined, arguments);
- };
- }
-
- /**
- * A specialized version of `_.shuffle` which mutates and sets the size of `array`.
- *
- * @private
- * @param {Array} array The array to shuffle.
- * @param {number} [size=array.length] The size of `array`.
- * @returns {Array} Returns `array`.
- */
- function shuffleSelf(array, size) {
- var index = -1,
- length = array.length,
- lastIndex = length - 1;
-
- size = size === undefined ? length : size;
- while (++index < size) {
- var rand = baseRandom(index, lastIndex),
- value = array[rand];
-
- array[rand] = array[index];
- array[index] = value;
- }
- array.length = size;
- return array;
- }
-
- /**
- * Converts `string` to a property path array.
- *
- * @private
- * @param {string} string The string to convert.
- * @returns {Array} Returns the property path array.
- */
- var stringToPath = memoizeCapped(function(string) {
- var result = [];
- if (reLeadingDot.test(string)) {
- result.push('');
- }
- string.replace(rePropName, function(match, number, quote, string) {
- result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
- });
- return result;
- });
-
- /**
- * Converts `value` to a string key if it's not a string or symbol.
- *
- * @private
- * @param {*} value The value to inspect.
- * @returns {string|symbol} Returns the key.
- */
- function toKey(value) {
- if (typeof value == 'string' || isSymbol(value)) {
- return value;
- }
- var result = (value + '');
- return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
- }
-
- /**
- * Converts `func` to its source code.
- *
- * @private
- * @param {Function} func The function to convert.
- * @returns {string} Returns the source code.
- */
- function toSource(func) {
- if (func != null) {
- try {
- return funcToString.call(func);
- } catch (e) {}
- try {
- return (func + '');
- } catch (e) {}
- }
- return '';
- }
-
- /**
- * Updates wrapper `details` based on `bitmask` flags.
- *
- * @private
- * @returns {Array} details The details to modify.
- * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
- * @returns {Array} Returns `details`.
- */
- function updateWrapDetails(details, bitmask) {
- arrayEach(wrapFlags, function(pair) {
- var value = '_.' + pair[0];
- if ((bitmask & pair[1]) && !arrayIncludes(details, value)) {
- details.push(value);
- }
- });
- return details.sort();
- }
-
- /**
- * Creates a clone of `wrapper`.
- *
- * @private
- * @param {Object} wrapper The wrapper to clone.
- * @returns {Object} Returns the cloned wrapper.
- */
- function wrapperClone(wrapper) {
- if (wrapper instanceof LazyWrapper) {
- return wrapper.clone();
- }
- var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);
- result.__actions__ = copyArray(wrapper.__actions__);
- result.__index__ = wrapper.__index__;
- result.__values__ = wrapper.__values__;
- return result;
- }
-
- /*------------------------------------------------------------------------*/
-
- /**
- * Creates an array of elements split into groups the length of `size`.
- * If `array` can't be split evenly, the final chunk will be the remaining
- * elements.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Array
- * @param {Array} array The array to process.
- * @param {number} [size=1] The length of each chunk
- * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
- * @returns {Array} Returns the new array of chunks.
- * @example
- *
- * _.chunk(['a', 'b', 'c', 'd'], 2);
- * // => [['a', 'b'], ['c', 'd']]
- *
- * _.chunk(['a', 'b', 'c', 'd'], 3);
- * // => [['a', 'b', 'c'], ['d']]
- */
- function chunk(array, size, guard) {
- if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) {
- size = 1;
- } else {
- size = nativeMax(toInteger(size), 0);
- }
- var length = array == null ? 0 : array.length;
- if (!length || size < 1) {
- return [];
- }
- var index = 0,
- resIndex = 0,
- result = Array(nativeCeil(length / size));
-
- while (index < length) {
- result[resIndex++] = baseSlice(array, index, (index += size));
- }
- return result;
- }
-
- /**
- * Creates an array with all falsey values removed. The values `false`, `null`,
- * `0`, `""`, `undefined`, and `NaN` are falsey.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Array
- * @param {Array} array The array to compact.
- * @returns {Array} Returns the new array of filtered values.
- * @example
- *
- * _.compact([0, 1, false, 2, '', 3]);
- * // => [1, 2, 3]
- */
- function compact(array) {
- var index = -1,
- length = array == null ? 0 : array.length,
- resIndex = 0,
- result = [];
-
- while (++index < length) {
- var value = array[index];
- if (value) {
- result[resIndex++] = value;
- }
- }
- return result;
- }
-
- /**
- * Creates a new array concatenating `array` with any additional arrays
- * and/or values.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Array
- * @param {Array} array The array to concatenate.
- * @param {...*} [values] The values to concatenate.
- * @returns {Array} Returns the new concatenated array.
- * @example
- *
- * var array = [1];
- * var other = _.concat(array, 2, [3], [[4]]);
- *
- * console.log(other);
- * // => [1, 2, 3, [4]]
- *
- * console.log(array);
- * // => [1]
- */
- function concat() {
- var length = arguments.length;
- if (!length) {
- return [];
- }
- var args = Array(length - 1),
- array = arguments[0],
- index = length;
-
- while (index--) {
- args[index - 1] = arguments[index];
- }
- return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1));
- }
-
- /**
- * Creates an array of `array` values not included in the other given arrays
- * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
- * for equality comparisons. The order and references of result values are
- * determined by the first array.
- *
- * **Note:** Unlike `_.pullAll`, this method returns a new array.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Array
- * @param {Array} array The array to inspect.
- * @param {...Array} [values] The values to exclude.
- * @returns {Array} Returns the new array of filtered values.
- * @see _.without, _.xor
- * @example
- *
- * _.difference([2, 1], [2, 3]);
- * // => [1]
- */
- var difference = baseRest(function(array, values) {
- return isArrayLikeObject(array)
- ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))
- : [];
- });
-
- /**
- * This method is like `_.difference` except that it accepts `iteratee` which
- * is invoked for each element of `array` and `values` to generate the criterion
- * by which they're compared. The order and references of result values are
- * determined by the first array. The iteratee is invoked with one argument:
- * (value).
- *
- * **Note:** Unlike `_.pullAllBy`, this method returns a new array.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Array
- * @param {Array} array The array to inspect.
- * @param {...Array} [values] The values to exclude.
- * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
- * @returns {Array} Returns the new array of filtered values.
- * @example
- *
- * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor);
- * // => [1.2]
- *
- * // The `_.property` iteratee shorthand.
- * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');
- * // => [{ 'x': 2 }]
- */
- var differenceBy = baseRest(function(array, values) {
- var iteratee = last(values);
- if (isArrayLikeObject(iteratee)) {
- iteratee = undefined;
- }
- return isArrayLikeObject(array)
- ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2))
- : [];
- });
-
- /**
- * This method is like `_.difference` except that it accepts `comparator`
- * which is invoked to compare elements of `array` to `values`. The order and
- * references of result values are determined by the first array. The comparator
- * is invoked with two arguments: (arrVal, othVal).
- *
- * **Note:** Unlike `_.pullAllWith`, this method returns a new array.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Array
- * @param {Array} array The array to inspect.
- * @param {...Array} [values] The values to exclude.
- * @param {Function} [comparator] The comparator invoked per element.
- * @returns {Array} Returns the new array of filtered values.
- * @example
- *
- * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
- *
- * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);
- * // => [{ 'x': 2, 'y': 1 }]
- */
- var differenceWith = baseRest(function(array, values) {
- var comparator = last(values);
- if (isArrayLikeObject(comparator)) {
- comparator = undefined;
- }
- return isArrayLikeObject(array)
- ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator)
- : [];
- });
-
- /**
- * Creates a slice of `array` with `n` elements dropped from the beginning.
- *
- * @static
- * @memberOf _
- * @since 0.5.0
- * @category Array
- * @param {Array} array The array to query.
- * @param {number} [n=1] The number of elements to drop.
- * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
- * @returns {Array} Returns the slice of `array`.
- * @example
- *
- * _.drop([1, 2, 3]);
- * // => [2, 3]
- *
- * _.drop([1, 2, 3], 2);
- * // => [3]
- *
- * _.drop([1, 2, 3], 5);
- * // => []
- *
- * _.drop([1, 2, 3], 0);
- * // => [1, 2, 3]
- */
- function drop(array, n, guard) {
- var length = array == null ? 0 : array.length;
- if (!length) {
- return [];
- }
- n = (guard || n === undefined) ? 1 : toInteger(n);
- return baseSlice(array, n < 0 ? 0 : n, length);
- }
-
- /**
- * Creates a slice of `array` with `n` elements dropped from the end.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Array
- * @param {Array} array The array to query.
- * @param {number} [n=1] The number of elements to drop.
- * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
- * @returns {Array} Returns the slice of `array`.
- * @example
- *
- * _.dropRight([1, 2, 3]);
- * // => [1, 2]
- *
- * _.dropRight([1, 2, 3], 2);
- * // => [1]
- *
- * _.dropRight([1, 2, 3], 5);
- * // => []
- *
- * _.dropRight([1, 2, 3], 0);
- * // => [1, 2, 3]
- */
- function dropRight(array, n, guard) {
- var length = array == null ? 0 : array.length;
- if (!length) {
- return [];
- }
- n = (guard || n === undefined) ? 1 : toInteger(n);
- n = length - n;
- return baseSlice(array, 0, n < 0 ? 0 : n);
- }
-
- /**
- * Creates a slice of `array` excluding elements dropped from the end.
- * Elements are dropped until `predicate` returns falsey. The predicate is
- * invoked with three arguments: (value, index, array).
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Array
- * @param {Array} array The array to query.
- * @param {Function} [predicate=_.identity] The function invoked per iteration.
- * @returns {Array} Returns the slice of `array`.
- * @example
- *
- * var users = [
- * { 'user': 'barney', 'active': true },
- * { 'user': 'fred', 'active': false },
- * { 'user': 'pebbles', 'active': false }
- * ];
- *
- * _.dropRightWhile(users, function(o) { return !o.active; });
- * // => objects for ['barney']
- *
- * // The `_.matches` iteratee shorthand.
- * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false });
- * // => objects for ['barney', 'fred']
- *
- * // The `_.matchesProperty` iteratee shorthand.
- * _.dropRightWhile(users, ['active', false]);
- * // => objects for ['barney']
- *
- * // The `_.property` iteratee shorthand.
- * _.dropRightWhile(users, 'active');
- * // => objects for ['barney', 'fred', 'pebbles']
- */
- function dropRightWhile(array, predicate) {
- return (array && array.length)
- ? baseWhile(array, getIteratee(predicate, 3), true, true)
- : [];
- }
-
- /**
- * Creates a slice of `array` excluding elements dropped from the beginning.
- * Elements are dropped until `predicate` returns falsey. The predicate is
- * invoked with three arguments: (value, index, array).
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Array
- * @param {Array} array The array to query.
- * @param {Function} [predicate=_.identity] The function invoked per iteration.
- * @returns {Array} Returns the slice of `array`.
- * @example
- *
- * var users = [
- * { 'user': 'barney', 'active': false },
- * { 'user': 'fred', 'active': false },
- * { 'user': 'pebbles', 'active': true }
- * ];
- *
- * _.dropWhile(users, function(o) { return !o.active; });
- * // => objects for ['pebbles']
- *
- * // The `_.matches` iteratee shorthand.
- * _.dropWhile(users, { 'user': 'barney', 'active': false });
- * // => objects for ['fred', 'pebbles']
- *
- * // The `_.matchesProperty` iteratee shorthand.
- * _.dropWhile(users, ['active', false]);
- * // => objects for ['pebbles']
- *
- * // The `_.property` iteratee shorthand.
- * _.dropWhile(users, 'active');
- * // => objects for ['barney', 'fred', 'pebbles']
- */
- function dropWhile(array, predicate) {
- return (array && array.length)
- ? baseWhile(array, getIteratee(predicate, 3), true)
- : [];
- }
-
- /**
- * Fills elements of `array` with `value` from `start` up to, but not
- * including, `end`.
- *
- * **Note:** This method mutates `array`.
- *
- * @static
- * @memberOf _
- * @since 3.2.0
- * @category Array
- * @param {Array} array The array to fill.
- * @param {*} value The value to fill `array` with.
- * @param {number} [start=0] The start position.
- * @param {number} [end=array.length] The end position.
- * @returns {Array} Returns `array`.
- * @example
- *
- * var array = [1, 2, 3];
- *
- * _.fill(array, 'a');
- * console.log(array);
- * // => ['a', 'a', 'a']
- *
- * _.fill(Array(3), 2);
- * // => [2, 2, 2]
- *
- * _.fill([4, 6, 8, 10], '*', 1, 3);
- * // => [4, '*', '*', 10]
- */
- function fill(array, value, start, end) {
- var length = array == null ? 0 : array.length;
- if (!length) {
- return [];
- }
- if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {
- start = 0;
- end = length;
- }
- return baseFill(array, value, start, end);
- }
-
- /**
- * This method is like `_.find` except that it returns the index of the first
- * element `predicate` returns truthy for instead of the element itself.
- *
- * @static
- * @memberOf _
- * @since 1.1.0
- * @category Array
- * @param {Array} array The array to inspect.
- * @param {Function} [predicate=_.identity] The function invoked per iteration.
- * @param {number} [fromIndex=0] The index to search from.
- * @returns {number} Returns the index of the found element, else `-1`.
- * @example
- *
- * var users = [
- * { 'user': 'barney', 'active': false },
- * { 'user': 'fred', 'active': false },
- * { 'user': 'pebbles', 'active': true }
- * ];
- *
- * _.findIndex(users, function(o) { return o.user == 'barney'; });
- * // => 0
- *
- * // The `_.matches` iteratee shorthand.
- * _.findIndex(users, { 'user': 'fred', 'active': false });
- * // => 1
- *
- * // The `_.matchesProperty` iteratee shorthand.
- * _.findIndex(users, ['active', false]);
- * // => 0
- *
- * // The `_.property` iteratee shorthand.
- * _.findIndex(users, 'active');
- * // => 2
- */
- function findIndex(array, predicate, fromIndex) {
- var length = array == null ? 0 : array.length;
- if (!length) {
- return -1;
- }
- var index = fromIndex == null ? 0 : toInteger(fromIndex);
- if (index < 0) {
- index = nativeMax(length + index, 0);
- }
- return baseFindIndex(array, getIteratee(predicate, 3), index);
- }
-
- /**
- * This method is like `_.findIndex` except that it iterates over elements
- * of `collection` from right to left.
- *
- * @static
- * @memberOf _
- * @since 2.0.0
- * @category Array
- * @param {Array} array The array to inspect.
- * @param {Function} [predicate=_.identity] The function invoked per iteration.
- * @param {number} [fromIndex=array.length-1] The index to search from.
- * @returns {number} Returns the index of the found element, else `-1`.
- * @example
- *
- * var users = [
- * { 'user': 'barney', 'active': true },
- * { 'user': 'fred', 'active': false },
- * { 'user': 'pebbles', 'active': false }
- * ];
- *
- * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });
- * // => 2
- *
- * // The `_.matches` iteratee shorthand.
- * _.findLastIndex(users, { 'user': 'barney', 'active': true });
- * // => 0
- *
- * // The `_.matchesProperty` iteratee shorthand.
- * _.findLastIndex(users, ['active', false]);
- * // => 2
- *
- * // The `_.property` iteratee shorthand.
- * _.findLastIndex(users, 'active');
- * // => 0
- */
- function findLastIndex(array, predicate, fromIndex) {
- var length = array == null ? 0 : array.length;
- if (!length) {
- return -1;
- }
- var index = length - 1;
- if (fromIndex !== undefined) {
- index = toInteger(fromIndex);
- index = fromIndex < 0
- ? nativeMax(length + index, 0)
- : nativeMin(index, length - 1);
- }
- return baseFindIndex(array, getIteratee(predicate, 3), index, true);
- }
-
- /**
- * Flattens `array` a single level deep.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Array
- * @param {Array} array The array to flatten.
- * @returns {Array} Returns the new flattened array.
- * @example
- *
- * _.flatten([1, [2, [3, [4]], 5]]);
- * // => [1, 2, [3, [4]], 5]
- */
- function flatten(array) {
- var length = array == null ? 0 : array.length;
- return length ? baseFlatten(array, 1) : [];
- }
-
- /**
- * Recursively flattens `array`.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Array
- * @param {Array} array The array to flatten.
- * @returns {Array} Returns the new flattened array.
- * @example
- *
- * _.flattenDeep([1, [2, [3, [4]], 5]]);
- * // => [1, 2, 3, 4, 5]
- */
- function flattenDeep(array) {
- var length = array == null ? 0 : array.length;
- return length ? baseFlatten(array, INFINITY) : [];
- }
-
- /**
- * Recursively flatten `array` up to `depth` times.
- *
- * @static
- * @memberOf _
- * @since 4.4.0
- * @category Array
- * @param {Array} array The array to flatten.
- * @param {number} [depth=1] The maximum recursion depth.
- * @returns {Array} Returns the new flattened array.
- * @example
- *
- * var array = [1, [2, [3, [4]], 5]];
- *
- * _.flattenDepth(array, 1);
- * // => [1, 2, [3, [4]], 5]
- *
- * _.flattenDepth(array, 2);
- * // => [1, 2, 3, [4], 5]
- */
- function flattenDepth(array, depth) {
- var length = array == null ? 0 : array.length;
- if (!length) {
- return [];
- }
- depth = depth === undefined ? 1 : toInteger(depth);
- return baseFlatten(array, depth);
- }
-
- /**
- * The inverse of `_.toPairs`; this method returns an object composed
- * from key-value `pairs`.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Array
- * @param {Array} pairs The key-value pairs.
- * @returns {Object} Returns the new object.
- * @example
- *
- * _.fromPairs([['a', 1], ['b', 2]]);
- * // => { 'a': 1, 'b': 2 }
- */
- function fromPairs(pairs) {
- var index = -1,
- length = pairs == null ? 0 : pairs.length,
- result = {};
-
- while (++index < length) {
- var pair = pairs[index];
- result[pair[0]] = pair[1];
- }
- return result;
- }
-
- /**
- * Gets the first element of `array`.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @alias first
- * @category Array
- * @param {Array} array The array to query.
- * @returns {*} Returns the first element of `array`.
- * @example
- *
- * _.head([1, 2, 3]);
- * // => 1
- *
- * _.head([]);
- * // => undefined
- */
- function head(array) {
- return (array && array.length) ? array[0] : undefined;
- }
-
- /**
- * Gets the index at which the first occurrence of `value` is found in `array`
- * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
- * for equality comparisons. If `fromIndex` is negative, it's used as the
- * offset from the end of `array`.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Array
- * @param {Array} array The array to inspect.
- * @param {*} value The value to search for.
- * @param {number} [fromIndex=0] The index to search from.
- * @returns {number} Returns the index of the matched value, else `-1`.
- * @example
- *
- * _.indexOf([1, 2, 1, 2], 2);
- * // => 1
- *
- * // Search from the `fromIndex`.
- * _.indexOf([1, 2, 1, 2], 2, 2);
- * // => 3
- */
- function indexOf(array, value, fromIndex) {
- var length = array == null ? 0 : array.length;
- if (!length) {
- return -1;
- }
- var index = fromIndex == null ? 0 : toInteger(fromIndex);
- if (index < 0) {
- index = nativeMax(length + index, 0);
- }
- return baseIndexOf(array, value, index);
- }
-
- /**
- * Gets all but the last element of `array`.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Array
- * @param {Array} array The array to query.
- * @returns {Array} Returns the slice of `array`.
- * @example
- *
- * _.initial([1, 2, 3]);
- * // => [1, 2]
- */
- function initial(array) {
- var length = array == null ? 0 : array.length;
- return length ? baseSlice(array, 0, -1) : [];
- }
-
- /**
- * Creates an array of unique values that are included in all given arrays
- * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
- * for equality comparisons. The order and references of result values are
- * determined by the first array.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Array
- * @param {...Array} [arrays] The arrays to inspect.
- * @returns {Array} Returns the new array of intersecting values.
- * @example
- *
- * _.intersection([2, 1], [2, 3]);
- * // => [2]
- */
- var intersection = baseRest(function(arrays) {
- var mapped = arrayMap(arrays, castArrayLikeObject);
- return (mapped.length && mapped[0] === arrays[0])
- ? baseIntersection(mapped)
- : [];
- });
-
- /**
- * This method is like `_.intersection` except that it accepts `iteratee`
- * which is invoked for each element of each `arrays` to generate the criterion
- * by which they're compared. The order and references of result values are
- * determined by the first array. The iteratee is invoked with one argument:
- * (value).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Array
- * @param {...Array} [arrays] The arrays to inspect.
- * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
- * @returns {Array} Returns the new array of intersecting values.
- * @example
- *
- * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor);
- * // => [2.1]
- *
- * // The `_.property` iteratee shorthand.
- * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
- * // => [{ 'x': 1 }]
- */
- var intersectionBy = baseRest(function(arrays) {
- var iteratee = last(arrays),
- mapped = arrayMap(arrays, castArrayLikeObject);
-
- if (iteratee === last(mapped)) {
- iteratee = undefined;
- } else {
- mapped.pop();
- }
- return (mapped.length && mapped[0] === arrays[0])
- ? baseIntersection(mapped, getIteratee(iteratee, 2))
- : [];
- });
-
- /**
- * This method is like `_.intersection` except that it accepts `comparator`
- * which is invoked to compare elements of `arrays`. The order and references
- * of result values are determined by the first array. The comparator is
- * invoked with two arguments: (arrVal, othVal).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Array
- * @param {...Array} [arrays] The arrays to inspect.
- * @param {Function} [comparator] The comparator invoked per element.
- * @returns {Array} Returns the new array of intersecting values.
- * @example
- *
- * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
- * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
- *
- * _.intersectionWith(objects, others, _.isEqual);
- * // => [{ 'x': 1, 'y': 2 }]
- */
- var intersectionWith = baseRest(function(arrays) {
- var comparator = last(arrays),
- mapped = arrayMap(arrays, castArrayLikeObject);
-
- comparator = typeof comparator == 'function' ? comparator : undefined;
- if (comparator) {
- mapped.pop();
- }
- return (mapped.length && mapped[0] === arrays[0])
- ? baseIntersection(mapped, undefined, comparator)
- : [];
- });
-
- /**
- * Converts all elements in `array` into a string separated by `separator`.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Array
- * @param {Array} array The array to convert.
- * @param {string} [separator=','] The element separator.
- * @returns {string} Returns the joined string.
- * @example
- *
- * _.join(['a', 'b', 'c'], '~');
- * // => 'a~b~c'
- */
- function join(array, separator) {
- return array == null ? '' : nativeJoin.call(array, separator);
- }
-
- /**
- * Gets the last element of `array`.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Array
- * @param {Array} array The array to query.
- * @returns {*} Returns the last element of `array`.
- * @example
- *
- * _.last([1, 2, 3]);
- * // => 3
- */
- function last(array) {
- var length = array == null ? 0 : array.length;
- return length ? array[length - 1] : undefined;
- }
-
- /**
- * This method is like `_.indexOf` except that it iterates over elements of
- * `array` from right to left.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Array
- * @param {Array} array The array to inspect.
- * @param {*} value The value to search for.
- * @param {number} [fromIndex=array.length-1] The index to search from.
- * @returns {number} Returns the index of the matched value, else `-1`.
- * @example
- *
- * _.lastIndexOf([1, 2, 1, 2], 2);
- * // => 3
- *
- * // Search from the `fromIndex`.
- * _.lastIndexOf([1, 2, 1, 2], 2, 2);
- * // => 1
- */
- function lastIndexOf(array, value, fromIndex) {
- var length = array == null ? 0 : array.length;
- if (!length) {
- return -1;
- }
- var index = length;
- if (fromIndex !== undefined) {
- index = toInteger(fromIndex);
- index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);
- }
- return value === value
- ? strictLastIndexOf(array, value, index)
- : baseFindIndex(array, baseIsNaN, index, true);
- }
-
- /**
- * Gets the element at index `n` of `array`. If `n` is negative, the nth
- * element from the end is returned.
- *
- * @static
- * @memberOf _
- * @since 4.11.0
- * @category Array
- * @param {Array} array The array to query.
- * @param {number} [n=0] The index of the element to return.
- * @returns {*} Returns the nth element of `array`.
- * @example
- *
- * var array = ['a', 'b', 'c', 'd'];
- *
- * _.nth(array, 1);
- * // => 'b'
- *
- * _.nth(array, -2);
- * // => 'c';
- */
- function nth(array, n) {
- return (array && array.length) ? baseNth(array, toInteger(n)) : undefined;
- }
-
- /**
- * Removes all given values from `array` using
- * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
- * for equality comparisons.
- *
- * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`
- * to remove elements from an array by predicate.
- *
- * @static
- * @memberOf _
- * @since 2.0.0
- * @category Array
- * @param {Array} array The array to modify.
- * @param {...*} [values] The values to remove.
- * @returns {Array} Returns `array`.
- * @example
- *
- * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
- *
- * _.pull(array, 'a', 'c');
- * console.log(array);
- * // => ['b', 'b']
- */
- var pull = baseRest(pullAll);
-
- /**
- * This method is like `_.pull` except that it accepts an array of values to remove.
- *
- * **Note:** Unlike `_.difference`, this method mutates `array`.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Array
- * @param {Array} array The array to modify.
- * @param {Array} values The values to remove.
- * @returns {Array} Returns `array`.
- * @example
- *
- * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
- *
- * _.pullAll(array, ['a', 'c']);
- * console.log(array);
- * // => ['b', 'b']
- */
- function pullAll(array, values) {
- return (array && array.length && values && values.length)
- ? basePullAll(array, values)
- : array;
- }
-
- /**
- * This method is like `_.pullAll` except that it accepts `iteratee` which is
- * invoked for each element of `array` and `values` to generate the criterion
- * by which they're compared. The iteratee is invoked with one argument: (value).
- *
- * **Note:** Unlike `_.differenceBy`, this method mutates `array`.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Array
- * @param {Array} array The array to modify.
- * @param {Array} values The values to remove.
- * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
- * @returns {Array} Returns `array`.
- * @example
- *
- * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];
- *
- * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');
- * console.log(array);
- * // => [{ 'x': 2 }]
- */
- function pullAllBy(array, values, iteratee) {
- return (array && array.length && values && values.length)
- ? basePullAll(array, values, getIteratee(iteratee, 2))
- : array;
- }
-
- /**
- * This method is like `_.pullAll` except that it accepts `comparator` which
- * is invoked to compare elements of `array` to `values`. The comparator is
- * invoked with two arguments: (arrVal, othVal).
- *
- * **Note:** Unlike `_.differenceWith`, this method mutates `array`.
- *
- * @static
- * @memberOf _
- * @since 4.6.0
- * @category Array
- * @param {Array} array The array to modify.
- * @param {Array} values The values to remove.
- * @param {Function} [comparator] The comparator invoked per element.
- * @returns {Array} Returns `array`.
- * @example
- *
- * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];
- *
- * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);
- * console.log(array);
- * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]
- */
- function pullAllWith(array, values, comparator) {
- return (array && array.length && values && values.length)
- ? basePullAll(array, values, undefined, comparator)
- : array;
- }
-
- /**
- * Removes elements from `array` corresponding to `indexes` and returns an
- * array of removed elements.
- *
- * **Note:** Unlike `_.at`, this method mutates `array`.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Array
- * @param {Array} array The array to modify.
- * @param {...(number|number[])} [indexes] The indexes of elements to remove.
- * @returns {Array} Returns the new array of removed elements.
- * @example
- *
- * var array = ['a', 'b', 'c', 'd'];
- * var pulled = _.pullAt(array, [1, 3]);
- *
- * console.log(array);
- * // => ['a', 'c']
- *
- * console.log(pulled);
- * // => ['b', 'd']
- */
- var pullAt = flatRest(function(array, indexes) {
- var length = array == null ? 0 : array.length,
- result = baseAt(array, indexes);
-
- basePullAt(array, arrayMap(indexes, function(index) {
- return isIndex(index, length) ? +index : index;
- }).sort(compareAscending));
-
- return result;
- });
-
- /**
- * Removes all elements from `array` that `predicate` returns truthy for
- * and returns an array of the removed elements. The predicate is invoked
- * with three arguments: (value, index, array).
- *
- * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`
- * to pull elements from an array by value.
- *
- * @static
- * @memberOf _
- * @since 2.0.0
- * @category Array
- * @param {Array} array The array to modify.
- * @param {Function} [predicate=_.identity] The function invoked per iteration.
- * @returns {Array} Returns the new array of removed elements.
- * @example
- *
- * var array = [1, 2, 3, 4];
- * var evens = _.remove(array, function(n) {
- * return n % 2 == 0;
- * });
- *
- * console.log(array);
- * // => [1, 3]
- *
- * console.log(evens);
- * // => [2, 4]
- */
- function remove(array, predicate) {
- var result = [];
- if (!(array && array.length)) {
- return result;
- }
- var index = -1,
- indexes = [],
- length = array.length;
-
- predicate = getIteratee(predicate, 3);
- while (++index < length) {
- var value = array[index];
- if (predicate(value, index, array)) {
- result.push(value);
- indexes.push(index);
- }
- }
- basePullAt(array, indexes);
- return result;
- }
-
- /**
- * Reverses `array` so that the first element becomes the last, the second
- * element becomes the second to last, and so on.
- *
- * **Note:** This method mutates `array` and is based on
- * [`Array#reverse`](https://mdn.io/Array/reverse).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Array
- * @param {Array} array The array to modify.
- * @returns {Array} Returns `array`.
- * @example
- *
- * var array = [1, 2, 3];
- *
- * _.reverse(array);
- * // => [3, 2, 1]
- *
- * console.log(array);
- * // => [3, 2, 1]
- */
- function reverse(array) {
- return array == null ? array : nativeReverse.call(array);
- }
-
- /**
- * Creates a slice of `array` from `start` up to, but not including, `end`.
- *
- * **Note:** This method is used instead of
- * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are
- * returned.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Array
- * @param {Array} array The array to slice.
- * @param {number} [start=0] The start position.
- * @param {number} [end=array.length] The end position.
- * @returns {Array} Returns the slice of `array`.
- */
- function slice(array, start, end) {
- var length = array == null ? 0 : array.length;
- if (!length) {
- return [];
- }
- if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {
- start = 0;
- end = length;
- }
- else {
- start = start == null ? 0 : toInteger(start);
- end = end === undefined ? length : toInteger(end);
- }
- return baseSlice(array, start, end);
- }
-
- /**
- * Uses a binary search to determine the lowest index at which `value`
- * should be inserted into `array` in order to maintain its sort order.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Array
- * @param {Array} array The sorted array to inspect.
- * @param {*} value The value to evaluate.
- * @returns {number} Returns the index at which `value` should be inserted
- * into `array`.
- * @example
- *
- * _.sortedIndex([30, 50], 40);
- * // => 1
- */
- function sortedIndex(array, value) {
- return baseSortedIndex(array, value);
- }
-
- /**
- * This method is like `_.sortedIndex` except that it accepts `iteratee`
- * which is invoked for `value` and each element of `array` to compute their
- * sort ranking. The iteratee is invoked with one argument: (value).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Array
- * @param {Array} array The sorted array to inspect.
- * @param {*} value The value to evaluate.
- * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
- * @returns {number} Returns the index at which `value` should be inserted
- * into `array`.
- * @example
- *
- * var objects = [{ 'x': 4 }, { 'x': 5 }];
- *
- * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
- * // => 0
- *
- * // The `_.property` iteratee shorthand.
- * _.sortedIndexBy(objects, { 'x': 4 }, 'x');
- * // => 0
- */
- function sortedIndexBy(array, value, iteratee) {
- return baseSortedIndexBy(array, value, getIteratee(iteratee, 2));
- }
-
- /**
- * This method is like `_.indexOf` except that it performs a binary
- * search on a sorted `array`.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Array
- * @param {Array} array The array to inspect.
- * @param {*} value The value to search for.
- * @returns {number} Returns the index of the matched value, else `-1`.
- * @example
- *
- * _.sortedIndexOf([4, 5, 5, 5, 6], 5);
- * // => 1
- */
- function sortedIndexOf(array, value) {
- var length = array == null ? 0 : array.length;
- if (length) {
- var index = baseSortedIndex(array, value);
- if (index < length && eq(array[index], value)) {
- return index;
- }
- }
- return -1;
- }
-
- /**
- * This method is like `_.sortedIndex` except that it returns the highest
- * index at which `value` should be inserted into `array` in order to
- * maintain its sort order.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Array
- * @param {Array} array The sorted array to inspect.
- * @param {*} value The value to evaluate.
- * @returns {number} Returns the index at which `value` should be inserted
- * into `array`.
- * @example
- *
- * _.sortedLastIndex([4, 5, 5, 5, 6], 5);
- * // => 4
- */
- function sortedLastIndex(array, value) {
- return baseSortedIndex(array, value, true);
- }
-
- /**
- * This method is like `_.sortedLastIndex` except that it accepts `iteratee`
- * which is invoked for `value` and each element of `array` to compute their
- * sort ranking. The iteratee is invoked with one argument: (value).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Array
- * @param {Array} array The sorted array to inspect.
- * @param {*} value The value to evaluate.
- * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
- * @returns {number} Returns the index at which `value` should be inserted
- * into `array`.
- * @example
- *
- * var objects = [{ 'x': 4 }, { 'x': 5 }];
- *
- * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
- * // => 1
- *
- * // The `_.property` iteratee shorthand.
- * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x');
- * // => 1
- */
- function sortedLastIndexBy(array, value, iteratee) {
- return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true);
- }
-
- /**
- * This method is like `_.lastIndexOf` except that it performs a binary
- * search on a sorted `array`.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Array
- * @param {Array} array The array to inspect.
- * @param {*} value The value to search for.
- * @returns {number} Returns the index of the matched value, else `-1`.
- * @example
- *
- * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5);
- * // => 3
- */
- function sortedLastIndexOf(array, value) {
- var length = array == null ? 0 : array.length;
- if (length) {
- var index = baseSortedIndex(array, value, true) - 1;
- if (eq(array[index], value)) {
- return index;
- }
- }
- return -1;
- }
-
- /**
- * This method is like `_.uniq` except that it's designed and optimized
- * for sorted arrays.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Array
- * @param {Array} array The array to inspect.
- * @returns {Array} Returns the new duplicate free array.
- * @example
- *
- * _.sortedUniq([1, 1, 2]);
- * // => [1, 2]
- */
- function sortedUniq(array) {
- return (array && array.length)
- ? baseSortedUniq(array)
- : [];
- }
-
- /**
- * This method is like `_.uniqBy` except that it's designed and optimized
- * for sorted arrays.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Array
- * @param {Array} array The array to inspect.
- * @param {Function} [iteratee] The iteratee invoked per element.
- * @returns {Array} Returns the new duplicate free array.
- * @example
- *
- * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);
- * // => [1.1, 2.3]
- */
- function sortedUniqBy(array, iteratee) {
- return (array && array.length)
- ? baseSortedUniq(array, getIteratee(iteratee, 2))
- : [];
- }
-
- /**
- * Gets all but the first element of `array`.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Array
- * @param {Array} array The array to query.
- * @returns {Array} Returns the slice of `array`.
- * @example
- *
- * _.tail([1, 2, 3]);
- * // => [2, 3]
- */
- function tail(array) {
- var length = array == null ? 0 : array.length;
- return length ? baseSlice(array, 1, length) : [];
- }
-
- /**
- * Creates a slice of `array` with `n` elements taken from the beginning.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Array
- * @param {Array} array The array to query.
- * @param {number} [n=1] The number of elements to take.
- * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
- * @returns {Array} Returns the slice of `array`.
- * @example
- *
- * _.take([1, 2, 3]);
- * // => [1]
- *
- * _.take([1, 2, 3], 2);
- * // => [1, 2]
- *
- * _.take([1, 2, 3], 5);
- * // => [1, 2, 3]
- *
- * _.take([1, 2, 3], 0);
- * // => []
- */
- function take(array, n, guard) {
- if (!(array && array.length)) {
- return [];
- }
- n = (guard || n === undefined) ? 1 : toInteger(n);
- return baseSlice(array, 0, n < 0 ? 0 : n);
- }
-
- /**
- * Creates a slice of `array` with `n` elements taken from the end.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Array
- * @param {Array} array The array to query.
- * @param {number} [n=1] The number of elements to take.
- * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
- * @returns {Array} Returns the slice of `array`.
- * @example
- *
- * _.takeRight([1, 2, 3]);
- * // => [3]
- *
- * _.takeRight([1, 2, 3], 2);
- * // => [2, 3]
- *
- * _.takeRight([1, 2, 3], 5);
- * // => [1, 2, 3]
- *
- * _.takeRight([1, 2, 3], 0);
- * // => []
- */
- function takeRight(array, n, guard) {
- var length = array == null ? 0 : array.length;
- if (!length) {
- return [];
- }
- n = (guard || n === undefined) ? 1 : toInteger(n);
- n = length - n;
- return baseSlice(array, n < 0 ? 0 : n, length);
- }
-
- /**
- * Creates a slice of `array` with elements taken from the end. Elements are
- * taken until `predicate` returns falsey. The predicate is invoked with
- * three arguments: (value, index, array).
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Array
- * @param {Array} array The array to query.
- * @param {Function} [predicate=_.identity] The function invoked per iteration.
- * @returns {Array} Returns the slice of `array`.
- * @example
- *
- * var users = [
- * { 'user': 'barney', 'active': true },
- * { 'user': 'fred', 'active': false },
- * { 'user': 'pebbles', 'active': false }
- * ];
- *
- * _.takeRightWhile(users, function(o) { return !o.active; });
- * // => objects for ['fred', 'pebbles']
- *
- * // The `_.matches` iteratee shorthand.
- * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false });
- * // => objects for ['pebbles']
- *
- * // The `_.matchesProperty` iteratee shorthand.
- * _.takeRightWhile(users, ['active', false]);
- * // => objects for ['fred', 'pebbles']
- *
- * // The `_.property` iteratee shorthand.
- * _.takeRightWhile(users, 'active');
- * // => []
- */
- function takeRightWhile(array, predicate) {
- return (array && array.length)
- ? baseWhile(array, getIteratee(predicate, 3), false, true)
- : [];
- }
-
- /**
- * Creates a slice of `array` with elements taken from the beginning. Elements
- * are taken until `predicate` returns falsey. The predicate is invoked with
- * three arguments: (value, index, array).
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Array
- * @param {Array} array The array to query.
- * @param {Function} [predicate=_.identity] The function invoked per iteration.
- * @returns {Array} Returns the slice of `array`.
- * @example
- *
- * var users = [
- * { 'user': 'barney', 'active': false },
- * { 'user': 'fred', 'active': false },
- * { 'user': 'pebbles', 'active': true }
- * ];
- *
- * _.takeWhile(users, function(o) { return !o.active; });
- * // => objects for ['barney', 'fred']
- *
- * // The `_.matches` iteratee shorthand.
- * _.takeWhile(users, { 'user': 'barney', 'active': false });
- * // => objects for ['barney']
- *
- * // The `_.matchesProperty` iteratee shorthand.
- * _.takeWhile(users, ['active', false]);
- * // => objects for ['barney', 'fred']
- *
- * // The `_.property` iteratee shorthand.
- * _.takeWhile(users, 'active');
- * // => []
- */
- function takeWhile(array, predicate) {
- return (array && array.length)
- ? baseWhile(array, getIteratee(predicate, 3))
- : [];
- }
-
- /**
- * Creates an array of unique values, in order, from all given arrays using
- * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
- * for equality comparisons.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Array
- * @param {...Array} [arrays] The arrays to inspect.
- * @returns {Array} Returns the new array of combined values.
- * @example
- *
- * _.union([2], [1, 2]);
- * // => [2, 1]
- */
- var union = baseRest(function(arrays) {
- return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));
- });
-
- /**
- * This method is like `_.union` except that it accepts `iteratee` which is
- * invoked for each element of each `arrays` to generate the criterion by
- * which uniqueness is computed. Result values are chosen from the first
- * array in which the value occurs. The iteratee is invoked with one argument:
- * (value).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Array
- * @param {...Array} [arrays] The arrays to inspect.
- * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
- * @returns {Array} Returns the new array of combined values.
- * @example
- *
- * _.unionBy([2.1], [1.2, 2.3], Math.floor);
- * // => [2.1, 1.2]
- *
- * // The `_.property` iteratee shorthand.
- * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
- * // => [{ 'x': 1 }, { 'x': 2 }]
- */
- var unionBy = baseRest(function(arrays) {
- var iteratee = last(arrays);
- if (isArrayLikeObject(iteratee)) {
- iteratee = undefined;
- }
- return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2));
- });
-
- /**
- * This method is like `_.union` except that it accepts `comparator` which
- * is invoked to compare elements of `arrays`. Result values are chosen from
- * the first array in which the value occurs. The comparator is invoked
- * with two arguments: (arrVal, othVal).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Array
- * @param {...Array} [arrays] The arrays to inspect.
- * @param {Function} [comparator] The comparator invoked per element.
- * @returns {Array} Returns the new array of combined values.
- * @example
- *
- * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
- * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
- *
- * _.unionWith(objects, others, _.isEqual);
- * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
- */
- var unionWith = baseRest(function(arrays) {
- var comparator = last(arrays);
- comparator = typeof comparator == 'function' ? comparator : undefined;
- return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator);
- });
-
- /**
- * Creates a duplicate-free version of an array, using
- * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
- * for equality comparisons, in which only the first occurrence of each element
- * is kept. The order of result values is determined by the order they occur
- * in the array.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Array
- * @param {Array} array The array to inspect.
- * @returns {Array} Returns the new duplicate free array.
- * @example
- *
- * _.uniq([2, 1, 2]);
- * // => [2, 1]
- */
- function uniq(array) {
- return (array && array.length) ? baseUniq(array) : [];
- }
-
- /**
- * This method is like `_.uniq` except that it accepts `iteratee` which is
- * invoked for each element in `array` to generate the criterion by which
- * uniqueness is computed. The order of result values is determined by the
- * order they occur in the array. The iteratee is invoked with one argument:
- * (value).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Array
- * @param {Array} array The array to inspect.
- * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
- * @returns {Array} Returns the new duplicate free array.
- * @example
- *
- * _.uniqBy([2.1, 1.2, 2.3], Math.floor);
- * // => [2.1, 1.2]
- *
- * // The `_.property` iteratee shorthand.
- * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
- * // => [{ 'x': 1 }, { 'x': 2 }]
- */
- function uniqBy(array, iteratee) {
- return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : [];
- }
-
- /**
- * This method is like `_.uniq` except that it accepts `comparator` which
- * is invoked to compare elements of `array`. The order of result values is
- * determined by the order they occur in the array.The comparator is invoked
- * with two arguments: (arrVal, othVal).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Array
- * @param {Array} array The array to inspect.
- * @param {Function} [comparator] The comparator invoked per element.
- * @returns {Array} Returns the new duplicate free array.
- * @example
- *
- * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }];
- *
- * _.uniqWith(objects, _.isEqual);
- * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]
- */
- function uniqWith(array, comparator) {
- comparator = typeof comparator == 'function' ? comparator : undefined;
- return (array && array.length) ? baseUniq(array, undefined, comparator) : [];
- }
-
- /**
- * This method is like `_.zip` except that it accepts an array of grouped
- * elements and creates an array regrouping the elements to their pre-zip
- * configuration.
- *
- * @static
- * @memberOf _
- * @since 1.2.0
- * @category Array
- * @param {Array} array The array of grouped elements to process.
- * @returns {Array} Returns the new array of regrouped elements.
- * @example
- *
- * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]);
- * // => [['a', 1, true], ['b', 2, false]]
- *
- * _.unzip(zipped);
- * // => [['a', 'b'], [1, 2], [true, false]]
- */
- function unzip(array) {
- if (!(array && array.length)) {
- return [];
- }
- var length = 0;
- array = arrayFilter(array, function(group) {
- if (isArrayLikeObject(group)) {
- length = nativeMax(group.length, length);
- return true;
- }
- });
- return baseTimes(length, function(index) {
- return arrayMap(array, baseProperty(index));
- });
- }
-
- /**
- * This method is like `_.unzip` except that it accepts `iteratee` to specify
- * how regrouped values should be combined. The iteratee is invoked with the
- * elements of each group: (...group).
- *
- * @static
- * @memberOf _
- * @since 3.8.0
- * @category Array
- * @param {Array} array The array of grouped elements to process.
- * @param {Function} [iteratee=_.identity] The function to combine
- * regrouped values.
- * @returns {Array} Returns the new array of regrouped elements.
- * @example
- *
- * var zipped = _.zip([1, 2], [10, 20], [100, 200]);
- * // => [[1, 10, 100], [2, 20, 200]]
- *
- * _.unzipWith(zipped, _.add);
- * // => [3, 30, 300]
- */
- function unzipWith(array, iteratee) {
- if (!(array && array.length)) {
- return [];
- }
- var result = unzip(array);
- if (iteratee == null) {
- return result;
- }
- return arrayMap(result, function(group) {
- return apply(iteratee, undefined, group);
- });
- }
-
- /**
- * Creates an array excluding all given values using
- * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
- * for equality comparisons.
- *
- * **Note:** Unlike `_.pull`, this method returns a new array.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Array
- * @param {Array} array The array to inspect.
- * @param {...*} [values] The values to exclude.
- * @returns {Array} Returns the new array of filtered values.
- * @see _.difference, _.xor
- * @example
- *
- * _.without([2, 1, 2, 3], 1, 2);
- * // => [3]
- */
- var without = baseRest(function(array, values) {
- return isArrayLikeObject(array)
- ? baseDifference(array, values)
- : [];
- });
-
- /**
- * Creates an array of unique values that is the
- * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)
- * of the given arrays. The order of result values is determined by the order
- * they occur in the arrays.
- *
- * @static
- * @memberOf _
- * @since 2.4.0
- * @category Array
- * @param {...Array} [arrays] The arrays to inspect.
- * @returns {Array} Returns the new array of filtered values.
- * @see _.difference, _.without
- * @example
- *
- * _.xor([2, 1], [2, 3]);
- * // => [1, 3]
- */
- var xor = baseRest(function(arrays) {
- return baseXor(arrayFilter(arrays, isArrayLikeObject));
- });
-
- /**
- * This method is like `_.xor` except that it accepts `iteratee` which is
- * invoked for each element of each `arrays` to generate the criterion by
- * which by which they're compared. The order of result values is determined
- * by the order they occur in the arrays. The iteratee is invoked with one
- * argument: (value).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Array
- * @param {...Array} [arrays] The arrays to inspect.
- * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
- * @returns {Array} Returns the new array of filtered values.
- * @example
- *
- * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor);
- * // => [1.2, 3.4]
- *
- * // The `_.property` iteratee shorthand.
- * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
- * // => [{ 'x': 2 }]
- */
- var xorBy = baseRest(function(arrays) {
- var iteratee = last(arrays);
- if (isArrayLikeObject(iteratee)) {
- iteratee = undefined;
- }
- return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2));
- });
-
- /**
- * This method is like `_.xor` except that it accepts `comparator` which is
- * invoked to compare elements of `arrays`. The order of result values is
- * determined by the order they occur in the arrays. The comparator is invoked
- * with two arguments: (arrVal, othVal).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Array
- * @param {...Array} [arrays] The arrays to inspect.
- * @param {Function} [comparator] The comparator invoked per element.
- * @returns {Array} Returns the new array of filtered values.
- * @example
- *
- * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
- * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
- *
- * _.xorWith(objects, others, _.isEqual);
- * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
- */
- var xorWith = baseRest(function(arrays) {
- var comparator = last(arrays);
- comparator = typeof comparator == 'function' ? comparator : undefined;
- return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator);
- });
-
- /**
- * Creates an array of grouped elements, the first of which contains the
- * first elements of the given arrays, the second of which contains the
- * second elements of the given arrays, and so on.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Array
- * @param {...Array} [arrays] The arrays to process.
- * @returns {Array} Returns the new array of grouped elements.
- * @example
- *
- * _.zip(['a', 'b'], [1, 2], [true, false]);
- * // => [['a', 1, true], ['b', 2, false]]
- */
- var zip = baseRest(unzip);
-
- /**
- * This method is like `_.fromPairs` except that it accepts two arrays,
- * one of property identifiers and one of corresponding values.
- *
- * @static
- * @memberOf _
- * @since 0.4.0
- * @category Array
- * @param {Array} [props=[]] The property identifiers.
- * @param {Array} [values=[]] The property values.
- * @returns {Object} Returns the new object.
- * @example
- *
- * _.zipObject(['a', 'b'], [1, 2]);
- * // => { 'a': 1, 'b': 2 }
- */
- function zipObject(props, values) {
- return baseZipObject(props || [], values || [], assignValue);
- }
-
- /**
- * This method is like `_.zipObject` except that it supports property paths.
- *
- * @static
- * @memberOf _
- * @since 4.1.0
- * @category Array
- * @param {Array} [props=[]] The property identifiers.
- * @param {Array} [values=[]] The property values.
- * @returns {Object} Returns the new object.
- * @example
- *
- * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]);
- * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }
- */
- function zipObjectDeep(props, values) {
- return baseZipObject(props || [], values || [], baseSet);
- }
-
- /**
- * This method is like `_.zip` except that it accepts `iteratee` to specify
- * how grouped values should be combined. The iteratee is invoked with the
- * elements of each group: (...group).
- *
- * @static
- * @memberOf _
- * @since 3.8.0
- * @category Array
- * @param {...Array} [arrays] The arrays to process.
- * @param {Function} [iteratee=_.identity] The function to combine
- * grouped values.
- * @returns {Array} Returns the new array of grouped elements.
- * @example
- *
- * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) {
- * return a + b + c;
- * });
- * // => [111, 222]
- */
- var zipWith = baseRest(function(arrays) {
- var length = arrays.length,
- iteratee = length > 1 ? arrays[length - 1] : undefined;
-
- iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined;
- return unzipWith(arrays, iteratee);
- });
-
- /*------------------------------------------------------------------------*/
-
- /**
- * Creates a `lodash` wrapper instance that wraps `value` with explicit method
- * chain sequences enabled. The result of such sequences must be unwrapped
- * with `_#value`.
- *
- * @static
- * @memberOf _
- * @since 1.3.0
- * @category Seq
- * @param {*} value The value to wrap.
- * @returns {Object} Returns the new `lodash` wrapper instance.
- * @example
- *
- * var users = [
- * { 'user': 'barney', 'age': 36 },
- * { 'user': 'fred', 'age': 40 },
- * { 'user': 'pebbles', 'age': 1 }
- * ];
- *
- * var youngest = _
- * .chain(users)
- * .sortBy('age')
- * .map(function(o) {
- * return o.user + ' is ' + o.age;
- * })
- * .head()
- * .value();
- * // => 'pebbles is 1'
- */
- function chain(value) {
- var result = lodash(value);
- result.__chain__ = true;
- return result;
- }
-
- /**
- * This method invokes `interceptor` and returns `value`. The interceptor
- * is invoked with one argument; (value). The purpose of this method is to
- * "tap into" a method chain sequence in order to modify intermediate results.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Seq
- * @param {*} value The value to provide to `interceptor`.
- * @param {Function} interceptor The function to invoke.
- * @returns {*} Returns `value`.
- * @example
- *
- * _([1, 2, 3])
- * .tap(function(array) {
- * // Mutate input array.
- * array.pop();
- * })
- * .reverse()
- * .value();
- * // => [2, 1]
- */
- function tap(value, interceptor) {
- interceptor(value);
- return value;
- }
-
- /**
- * This method is like `_.tap` except that it returns the result of `interceptor`.
- * The purpose of this method is to "pass thru" values replacing intermediate
- * results in a method chain sequence.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Seq
- * @param {*} value The value to provide to `interceptor`.
- * @param {Function} interceptor The function to invoke.
- * @returns {*} Returns the result of `interceptor`.
- * @example
- *
- * _(' abc ')
- * .chain()
- * .trim()
- * .thru(function(value) {
- * return [value];
- * })
- * .value();
- * // => ['abc']
- */
- function thru(value, interceptor) {
- return interceptor(value);
- }
-
- /**
- * This method is the wrapper version of `_.at`.
- *
- * @name at
- * @memberOf _
- * @since 1.0.0
- * @category Seq
- * @param {...(string|string[])} [paths] The property paths to pick.
- * @returns {Object} Returns the new `lodash` wrapper instance.
- * @example
- *
- * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
- *
- * _(object).at(['a[0].b.c', 'a[1]']).value();
- * // => [3, 4]
- */
- var wrapperAt = flatRest(function(paths) {
- var length = paths.length,
- start = length ? paths[0] : 0,
- value = this.__wrapped__,
- interceptor = function(object) { return baseAt(object, paths); };
-
- if (length > 1 || this.__actions__.length ||
- !(value instanceof LazyWrapper) || !isIndex(start)) {
- return this.thru(interceptor);
- }
- value = value.slice(start, +start + (length ? 1 : 0));
- value.__actions__.push({
- 'func': thru,
- 'args': [interceptor],
- 'thisArg': undefined
- });
- return new LodashWrapper(value, this.__chain__).thru(function(array) {
- if (length && !array.length) {
- array.push(undefined);
- }
- return array;
- });
- });
-
- /**
- * Creates a `lodash` wrapper instance with explicit method chain sequences enabled.
- *
- * @name chain
- * @memberOf _
- * @since 0.1.0
- * @category Seq
- * @returns {Object} Returns the new `lodash` wrapper instance.
- * @example
- *
- * var users = [
- * { 'user': 'barney', 'age': 36 },
- * { 'user': 'fred', 'age': 40 }
- * ];
- *
- * // A sequence without explicit chaining.
- * _(users).head();
- * // => { 'user': 'barney', 'age': 36 }
- *
- * // A sequence with explicit chaining.
- * _(users)
- * .chain()
- * .head()
- * .pick('user')
- * .value();
- * // => { 'user': 'barney' }
- */
- function wrapperChain() {
- return chain(this);
- }
-
- /**
- * Executes the chain sequence and returns the wrapped result.
- *
- * @name commit
- * @memberOf _
- * @since 3.2.0
- * @category Seq
- * @returns {Object} Returns the new `lodash` wrapper instance.
- * @example
- *
- * var array = [1, 2];
- * var wrapped = _(array).push(3);
- *
- * console.log(array);
- * // => [1, 2]
- *
- * wrapped = wrapped.commit();
- * console.log(array);
- * // => [1, 2, 3]
- *
- * wrapped.last();
- * // => 3
- *
- * console.log(array);
- * // => [1, 2, 3]
- */
- function wrapperCommit() {
- return new LodashWrapper(this.value(), this.__chain__);
- }
-
- /**
- * Gets the next value on a wrapped object following the
- * [iterator protocol](https://mdn.io/iteration_protocols#iterator).
- *
- * @name next
- * @memberOf _
- * @since 4.0.0
- * @category Seq
- * @returns {Object} Returns the next iterator value.
- * @example
- *
- * var wrapped = _([1, 2]);
- *
- * wrapped.next();
- * // => { 'done': false, 'value': 1 }
- *
- * wrapped.next();
- * // => { 'done': false, 'value': 2 }
- *
- * wrapped.next();
- * // => { 'done': true, 'value': undefined }
- */
- function wrapperNext() {
- if (this.__values__ === undefined) {
- this.__values__ = toArray(this.value());
- }
- var done = this.__index__ >= this.__values__.length,
- value = done ? undefined : this.__values__[this.__index__++];
-
- return { 'done': done, 'value': value };
- }
-
- /**
- * Enables the wrapper to be iterable.
- *
- * @name Symbol.iterator
- * @memberOf _
- * @since 4.0.0
- * @category Seq
- * @returns {Object} Returns the wrapper object.
- * @example
- *
- * var wrapped = _([1, 2]);
- *
- * wrapped[Symbol.iterator]() === wrapped;
- * // => true
- *
- * Array.from(wrapped);
- * // => [1, 2]
- */
- function wrapperToIterator() {
- return this;
- }
-
- /**
- * Creates a clone of the chain sequence planting `value` as the wrapped value.
- *
- * @name plant
- * @memberOf _
- * @since 3.2.0
- * @category Seq
- * @param {*} value The value to plant.
- * @returns {Object} Returns the new `lodash` wrapper instance.
- * @example
- *
- * function square(n) {
- * return n * n;
- * }
- *
- * var wrapped = _([1, 2]).map(square);
- * var other = wrapped.plant([3, 4]);
- *
- * other.value();
- * // => [9, 16]
- *
- * wrapped.value();
- * // => [1, 4]
- */
- function wrapperPlant(value) {
- var result,
- parent = this;
-
- while (parent instanceof baseLodash) {
- var clone = wrapperClone(parent);
- clone.__index__ = 0;
- clone.__values__ = undefined;
- if (result) {
- previous.__wrapped__ = clone;
- } else {
- result = clone;
- }
- var previous = clone;
- parent = parent.__wrapped__;
- }
- previous.__wrapped__ = value;
- return result;
- }
-
- /**
- * This method is the wrapper version of `_.reverse`.
- *
- * **Note:** This method mutates the wrapped array.
- *
- * @name reverse
- * @memberOf _
- * @since 0.1.0
- * @category Seq
- * @returns {Object} Returns the new `lodash` wrapper instance.
- * @example
- *
- * var array = [1, 2, 3];
- *
- * _(array).reverse().value()
- * // => [3, 2, 1]
- *
- * console.log(array);
- * // => [3, 2, 1]
- */
- function wrapperReverse() {
- var value = this.__wrapped__;
- if (value instanceof LazyWrapper) {
- var wrapped = value;
- if (this.__actions__.length) {
- wrapped = new LazyWrapper(this);
- }
- wrapped = wrapped.reverse();
- wrapped.__actions__.push({
- 'func': thru,
- 'args': [reverse],
- 'thisArg': undefined
- });
- return new LodashWrapper(wrapped, this.__chain__);
- }
- return this.thru(reverse);
- }
-
- /**
- * Executes the chain sequence to resolve the unwrapped value.
- *
- * @name value
- * @memberOf _
- * @since 0.1.0
- * @alias toJSON, valueOf
- * @category Seq
- * @returns {*} Returns the resolved unwrapped value.
- * @example
- *
- * _([1, 2, 3]).value();
- * // => [1, 2, 3]
- */
- function wrapperValue() {
- return baseWrapperValue(this.__wrapped__, this.__actions__);
- }
-
- /*------------------------------------------------------------------------*/
-
- /**
- * Creates an object composed of keys generated from the results of running
- * each element of `collection` thru `iteratee`. The corresponding value of
- * each key is the number of times the key was returned by `iteratee`. The
- * iteratee is invoked with one argument: (value).
- *
- * @static
- * @memberOf _
- * @since 0.5.0
- * @category Collection
- * @param {Array|Object} collection The collection to iterate over.
- * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
- * @returns {Object} Returns the composed aggregate object.
- * @example
- *
- * _.countBy([6.1, 4.2, 6.3], Math.floor);
- * // => { '4': 1, '6': 2 }
- *
- * // The `_.property` iteratee shorthand.
- * _.countBy(['one', 'two', 'three'], 'length');
- * // => { '3': 2, '5': 1 }
- */
- var countBy = createAggregator(function(result, value, key) {
- if (hasOwnProperty.call(result, key)) {
- ++result[key];
- } else {
- baseAssignValue(result, key, 1);
- }
- });
-
- /**
- * Checks if `predicate` returns truthy for **all** elements of `collection`.
- * Iteration is stopped once `predicate` returns falsey. The predicate is
- * invoked with three arguments: (value, index|key, collection).
- *
- * **Note:** This method returns `true` for
- * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because
- * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of
- * elements of empty collections.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Collection
- * @param {Array|Object} collection The collection to iterate over.
- * @param {Function} [predicate=_.identity] The function invoked per iteration.
- * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
- * @returns {boolean} Returns `true` if all elements pass the predicate check,
- * else `false`.
- * @example
- *
- * _.every([true, 1, null, 'yes'], Boolean);
- * // => false
- *
- * var users = [
- * { 'user': 'barney', 'age': 36, 'active': false },
- * { 'user': 'fred', 'age': 40, 'active': false }
- * ];
- *
- * // The `_.matches` iteratee shorthand.
- * _.every(users, { 'user': 'barney', 'active': false });
- * // => false
- *
- * // The `_.matchesProperty` iteratee shorthand.
- * _.every(users, ['active', false]);
- * // => true
- *
- * // The `_.property` iteratee shorthand.
- * _.every(users, 'active');
- * // => false
- */
- function every(collection, predicate, guard) {
- var func = isArray(collection) ? arrayEvery : baseEvery;
- if (guard && isIterateeCall(collection, predicate, guard)) {
- predicate = undefined;
- }
- return func(collection, getIteratee(predicate, 3));
- }
-
- /**
- * Iterates over elements of `collection`, returning an array of all elements
- * `predicate` returns truthy for. The predicate is invoked with three
- * arguments: (value, index|key, collection).
- *
- * **Note:** Unlike `_.remove`, this method returns a new array.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Collection
- * @param {Array|Object} collection The collection to iterate over.
- * @param {Function} [predicate=_.identity] The function invoked per iteration.
- * @returns {Array} Returns the new filtered array.
- * @see _.reject
- * @example
- *
- * var users = [
- * { 'user': 'barney', 'age': 36, 'active': true },
- * { 'user': 'fred', 'age': 40, 'active': false }
- * ];
- *
- * _.filter(users, function(o) { return !o.active; });
- * // => objects for ['fred']
- *
- * // The `_.matches` iteratee shorthand.
- * _.filter(users, { 'age': 36, 'active': true });
- * // => objects for ['barney']
- *
- * // The `_.matchesProperty` iteratee shorthand.
- * _.filter(users, ['active', false]);
- * // => objects for ['fred']
- *
- * // The `_.property` iteratee shorthand.
- * _.filter(users, 'active');
- * // => objects for ['barney']
- */
- function filter(collection, predicate) {
- var func = isArray(collection) ? arrayFilter : baseFilter;
- return func(collection, getIteratee(predicate, 3));
- }
-
- /**
- * Iterates over elements of `collection`, returning the first element
- * `predicate` returns truthy for. The predicate is invoked with three
- * arguments: (value, index|key, collection).
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Collection
- * @param {Array|Object} collection The collection to inspect.
- * @param {Function} [predicate=_.identity] The function invoked per iteration.
- * @param {number} [fromIndex=0] The index to search from.
- * @returns {*} Returns the matched element, else `undefined`.
- * @example
- *
- * var users = [
- * { 'user': 'barney', 'age': 36, 'active': true },
- * { 'user': 'fred', 'age': 40, 'active': false },
- * { 'user': 'pebbles', 'age': 1, 'active': true }
- * ];
- *
- * _.find(users, function(o) { return o.age < 40; });
- * // => object for 'barney'
- *
- * // The `_.matches` iteratee shorthand.
- * _.find(users, { 'age': 1, 'active': true });
- * // => object for 'pebbles'
- *
- * // The `_.matchesProperty` iteratee shorthand.
- * _.find(users, ['active', false]);
- * // => object for 'fred'
- *
- * // The `_.property` iteratee shorthand.
- * _.find(users, 'active');
- * // => object for 'barney'
- */
- var find = createFind(findIndex);
-
- /**
- * This method is like `_.find` except that it iterates over elements of
- * `collection` from right to left.
- *
- * @static
- * @memberOf _
- * @since 2.0.0
- * @category Collection
- * @param {Array|Object} collection The collection to inspect.
- * @param {Function} [predicate=_.identity] The function invoked per iteration.
- * @param {number} [fromIndex=collection.length-1] The index to search from.
- * @returns {*} Returns the matched element, else `undefined`.
- * @example
- *
- * _.findLast([1, 2, 3, 4], function(n) {
- * return n % 2 == 1;
- * });
- * // => 3
- */
- var findLast = createFind(findLastIndex);
-
- /**
- * Creates a flattened array of values by running each element in `collection`
- * thru `iteratee` and flattening the mapped results. The iteratee is invoked
- * with three arguments: (value, index|key, collection).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Collection
- * @param {Array|Object} collection The collection to iterate over.
- * @param {Function} [iteratee=_.identity] The function invoked per iteration.
- * @returns {Array} Returns the new flattened array.
- * @example
- *
- * function duplicate(n) {
- * return [n, n];
- * }
- *
- * _.flatMap([1, 2], duplicate);
- * // => [1, 1, 2, 2]
- */
- function flatMap(collection, iteratee) {
- return baseFlatten(map(collection, iteratee), 1);
- }
-
- /**
- * This method is like `_.flatMap` except that it recursively flattens the
- * mapped results.
- *
- * @static
- * @memberOf _
- * @since 4.7.0
- * @category Collection
- * @param {Array|Object} collection The collection to iterate over.
- * @param {Function} [iteratee=_.identity] The function invoked per iteration.
- * @returns {Array} Returns the new flattened array.
- * @example
- *
- * function duplicate(n) {
- * return [[[n, n]]];
- * }
- *
- * _.flatMapDeep([1, 2], duplicate);
- * // => [1, 1, 2, 2]
- */
- function flatMapDeep(collection, iteratee) {
- return baseFlatten(map(collection, iteratee), INFINITY);
- }
-
- /**
- * This method is like `_.flatMap` except that it recursively flattens the
- * mapped results up to `depth` times.
- *
- * @static
- * @memberOf _
- * @since 4.7.0
- * @category Collection
- * @param {Array|Object} collection The collection to iterate over.
- * @param {Function} [iteratee=_.identity] The function invoked per iteration.
- * @param {number} [depth=1] The maximum recursion depth.
- * @returns {Array} Returns the new flattened array.
- * @example
- *
- * function duplicate(n) {
- * return [[[n, n]]];
- * }
- *
- * _.flatMapDepth([1, 2], duplicate, 2);
- * // => [[1, 1], [2, 2]]
- */
- function flatMapDepth(collection, iteratee, depth) {
- depth = depth === undefined ? 1 : toInteger(depth);
- return baseFlatten(map(collection, iteratee), depth);
- }
-
- /**
- * Iterates over elements of `collection` and invokes `iteratee` for each element.
- * The iteratee is invoked with three arguments: (value, index|key, collection).
- * Iteratee functions may exit iteration early by explicitly returning `false`.
- *
- * **Note:** As with other "Collections" methods, objects with a "length"
- * property are iterated like arrays. To avoid this behavior use `_.forIn`
- * or `_.forOwn` for object iteration.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @alias each
- * @category Collection
- * @param {Array|Object} collection The collection to iterate over.
- * @param {Function} [iteratee=_.identity] The function invoked per iteration.
- * @returns {Array|Object} Returns `collection`.
- * @see _.forEachRight
- * @example
- *
- * _.forEach([1, 2], function(value) {
- * console.log(value);
- * });
- * // => Logs `1` then `2`.
- *
- * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {
- * console.log(key);
- * });
- * // => Logs 'a' then 'b' (iteration order is not guaranteed).
- */
- function forEach(collection, iteratee) {
- var func = isArray(collection) ? arrayEach : baseEach;
- return func(collection, getIteratee(iteratee, 3));
- }
-
- /**
- * This method is like `_.forEach` except that it iterates over elements of
- * `collection` from right to left.
- *
- * @static
- * @memberOf _
- * @since 2.0.0
- * @alias eachRight
- * @category Collection
- * @param {Array|Object} collection The collection to iterate over.
- * @param {Function} [iteratee=_.identity] The function invoked per iteration.
- * @returns {Array|Object} Returns `collection`.
- * @see _.forEach
- * @example
- *
- * _.forEachRight([1, 2], function(value) {
- * console.log(value);
- * });
- * // => Logs `2` then `1`.
- */
- function forEachRight(collection, iteratee) {
- var func = isArray(collection) ? arrayEachRight : baseEachRight;
- return func(collection, getIteratee(iteratee, 3));
- }
-
- /**
- * Creates an object composed of keys generated from the results of running
- * each element of `collection` thru `iteratee`. The order of grouped values
- * is determined by the order they occur in `collection`. The corresponding
- * value of each key is an array of elements responsible for generating the
- * key. The iteratee is invoked with one argument: (value).
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Collection
- * @param {Array|Object} collection The collection to iterate over.
- * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
- * @returns {Object} Returns the composed aggregate object.
- * @example
- *
- * _.groupBy([6.1, 4.2, 6.3], Math.floor);
- * // => { '4': [4.2], '6': [6.1, 6.3] }
- *
- * // The `_.property` iteratee shorthand.
- * _.groupBy(['one', 'two', 'three'], 'length');
- * // => { '3': ['one', 'two'], '5': ['three'] }
- */
- var groupBy = createAggregator(function(result, value, key) {
- if (hasOwnProperty.call(result, key)) {
- result[key].push(value);
- } else {
- baseAssignValue(result, key, [value]);
- }
- });
-
- /**
- * Checks if `value` is in `collection`. If `collection` is a string, it's
- * checked for a substring of `value`, otherwise
- * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
- * is used for equality comparisons. If `fromIndex` is negative, it's used as
- * the offset from the end of `collection`.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Collection
- * @param {Array|Object|string} collection The collection to inspect.
- * @param {*} value The value to search for.
- * @param {number} [fromIndex=0] The index to search from.
- * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
- * @returns {boolean} Returns `true` if `value` is found, else `false`.
- * @example
- *
- * _.includes([1, 2, 3], 1);
- * // => true
- *
- * _.includes([1, 2, 3], 1, 2);
- * // => false
- *
- * _.includes({ 'a': 1, 'b': 2 }, 1);
- * // => true
- *
- * _.includes('abcd', 'bc');
- * // => true
- */
- function includes(collection, value, fromIndex, guard) {
- collection = isArrayLike(collection) ? collection : values(collection);
- fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0;
-
- var length = collection.length;
- if (fromIndex < 0) {
- fromIndex = nativeMax(length + fromIndex, 0);
- }
- return isString(collection)
- ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)
- : (!!length && baseIndexOf(collection, value, fromIndex) > -1);
- }
-
- /**
- * Invokes the method at `path` of each element in `collection`, returning
- * an array of the results of each invoked method. Any additional arguments
- * are provided to each invoked method. If `path` is a function, it's invoked
- * for, and `this` bound to, each element in `collection`.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Collection
- * @param {Array|Object} collection The collection to iterate over.
- * @param {Array|Function|string} path The path of the method to invoke or
- * the function invoked per iteration.
- * @param {...*} [args] The arguments to invoke each method with.
- * @returns {Array} Returns the array of results.
- * @example
- *
- * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');
- * // => [[1, 5, 7], [1, 2, 3]]
- *
- * _.invokeMap([123, 456], String.prototype.split, '');
- * // => [['1', '2', '3'], ['4', '5', '6']]
- */
- var invokeMap = baseRest(function(collection, path, args) {
- var index = -1,
- isFunc = typeof path == 'function',
- result = isArrayLike(collection) ? Array(collection.length) : [];
-
- baseEach(collection, function(value) {
- result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args);
- });
- return result;
- });
-
- /**
- * Creates an object composed of keys generated from the results of running
- * each element of `collection` thru `iteratee`. The corresponding value of
- * each key is the last element responsible for generating the key. The
- * iteratee is invoked with one argument: (value).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Collection
- * @param {Array|Object} collection The collection to iterate over.
- * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
- * @returns {Object} Returns the composed aggregate object.
- * @example
- *
- * var array = [
- * { 'dir': 'left', 'code': 97 },
- * { 'dir': 'right', 'code': 100 }
- * ];
- *
- * _.keyBy(array, function(o) {
- * return String.fromCharCode(o.code);
- * });
- * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
- *
- * _.keyBy(array, 'dir');
- * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }
- */
- var keyBy = createAggregator(function(result, value, key) {
- baseAssignValue(result, key, value);
- });
-
- /**
- * Creates an array of values by running each element in `collection` thru
- * `iteratee`. The iteratee is invoked with three arguments:
- * (value, index|key, collection).
- *
- * Many lodash methods are guarded to work as iteratees for methods like
- * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
- *
- * The guarded methods are:
- * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,
- * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,
- * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,
- * `template`, `trim`, `trimEnd`, `trimStart`, and `words`
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Collection
- * @param {Array|Object} collection The collection to iterate over.
- * @param {Function} [iteratee=_.identity] The function invoked per iteration.
- * @returns {Array} Returns the new mapped array.
- * @example
- *
- * function square(n) {
- * return n * n;
- * }
- *
- * _.map([4, 8], square);
- * // => [16, 64]
- *
- * _.map({ 'a': 4, 'b': 8 }, square);
- * // => [16, 64] (iteration order is not guaranteed)
- *
- * var users = [
- * { 'user': 'barney' },
- * { 'user': 'fred' }
- * ];
- *
- * // The `_.property` iteratee shorthand.
- * _.map(users, 'user');
- * // => ['barney', 'fred']
- */
- function map(collection, iteratee) {
- var func = isArray(collection) ? arrayMap : baseMap;
- return func(collection, getIteratee(iteratee, 3));
- }
-
- /**
- * This method is like `_.sortBy` except that it allows specifying the sort
- * orders of the iteratees to sort by. If `orders` is unspecified, all values
- * are sorted in ascending order. Otherwise, specify an order of "desc" for
- * descending or "asc" for ascending sort order of corresponding values.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Collection
- * @param {Array|Object} collection The collection to iterate over.
- * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]]
- * The iteratees to sort by.
- * @param {string[]} [orders] The sort orders of `iteratees`.
- * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
- * @returns {Array} Returns the new sorted array.
- * @example
- *
- * var users = [
- * { 'user': 'fred', 'age': 48 },
- * { 'user': 'barney', 'age': 34 },
- * { 'user': 'fred', 'age': 40 },
- * { 'user': 'barney', 'age': 36 }
- * ];
- *
- * // Sort by `user` in ascending order and by `age` in descending order.
- * _.orderBy(users, ['user', 'age'], ['asc', 'desc']);
- * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
- */
- function orderBy(collection, iteratees, orders, guard) {
- if (collection == null) {
- return [];
- }
- if (!isArray(iteratees)) {
- iteratees = iteratees == null ? [] : [iteratees];
- }
- orders = guard ? undefined : orders;
- if (!isArray(orders)) {
- orders = orders == null ? [] : [orders];
- }
- return baseOrderBy(collection, iteratees, orders);
- }
-
- /**
- * Creates an array of elements split into two groups, the first of which
- * contains elements `predicate` returns truthy for, the second of which
- * contains elements `predicate` returns falsey for. The predicate is
- * invoked with one argument: (value).
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Collection
- * @param {Array|Object} collection The collection to iterate over.
- * @param {Function} [predicate=_.identity] The function invoked per iteration.
- * @returns {Array} Returns the array of grouped elements.
- * @example
- *
- * var users = [
- * { 'user': 'barney', 'age': 36, 'active': false },
- * { 'user': 'fred', 'age': 40, 'active': true },
- * { 'user': 'pebbles', 'age': 1, 'active': false }
- * ];
- *
- * _.partition(users, function(o) { return o.active; });
- * // => objects for [['fred'], ['barney', 'pebbles']]
- *
- * // The `_.matches` iteratee shorthand.
- * _.partition(users, { 'age': 1, 'active': false });
- * // => objects for [['pebbles'], ['barney', 'fred']]
- *
- * // The `_.matchesProperty` iteratee shorthand.
- * _.partition(users, ['active', false]);
- * // => objects for [['barney', 'pebbles'], ['fred']]
- *
- * // The `_.property` iteratee shorthand.
- * _.partition(users, 'active');
- * // => objects for [['fred'], ['barney', 'pebbles']]
- */
- var partition = createAggregator(function(result, value, key) {
- result[key ? 0 : 1].push(value);
- }, function() { return [[], []]; });
-
- /**
- * Reduces `collection` to a value which is the accumulated result of running
- * each element in `collection` thru `iteratee`, where each successive
- * invocation is supplied the return value of the previous. If `accumulator`
- * is not given, the first element of `collection` is used as the initial
- * value. The iteratee is invoked with four arguments:
- * (accumulator, value, index|key, collection).
- *
- * Many lodash methods are guarded to work as iteratees for methods like
- * `_.reduce`, `_.reduceRight`, and `_.transform`.
- *
- * The guarded methods are:
- * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,
- * and `sortBy`
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Collection
- * @param {Array|Object} collection The collection to iterate over.
- * @param {Function} [iteratee=_.identity] The function invoked per iteration.
- * @param {*} [accumulator] The initial value.
- * @returns {*} Returns the accumulated value.
- * @see _.reduceRight
- * @example
- *
- * _.reduce([1, 2], function(sum, n) {
- * return sum + n;
- * }, 0);
- * // => 3
- *
- * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
- * (result[value] || (result[value] = [])).push(key);
- * return result;
- * }, {});
- * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)
- */
- function reduce(collection, iteratee, accumulator) {
- var func = isArray(collection) ? arrayReduce : baseReduce,
- initAccum = arguments.length < 3;
-
- return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach);
- }
-
- /**
- * This method is like `_.reduce` except that it iterates over elements of
- * `collection` from right to left.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Collection
- * @param {Array|Object} collection The collection to iterate over.
- * @param {Function} [iteratee=_.identity] The function invoked per iteration.
- * @param {*} [accumulator] The initial value.
- * @returns {*} Returns the accumulated value.
- * @see _.reduce
- * @example
- *
- * var array = [[0, 1], [2, 3], [4, 5]];
- *
- * _.reduceRight(array, function(flattened, other) {
- * return flattened.concat(other);
- * }, []);
- * // => [4, 5, 2, 3, 0, 1]
- */
- function reduceRight(collection, iteratee, accumulator) {
- var func = isArray(collection) ? arrayReduceRight : baseReduce,
- initAccum = arguments.length < 3;
-
- return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight);
- }
-
- /**
- * The opposite of `_.filter`; this method returns the elements of `collection`
- * that `predicate` does **not** return truthy for.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Collection
- * @param {Array|Object} collection The collection to iterate over.
- * @param {Function} [predicate=_.identity] The function invoked per iteration.
- * @returns {Array} Returns the new filtered array.
- * @see _.filter
- * @example
- *
- * var users = [
- * { 'user': 'barney', 'age': 36, 'active': false },
- * { 'user': 'fred', 'age': 40, 'active': true }
- * ];
- *
- * _.reject(users, function(o) { return !o.active; });
- * // => objects for ['fred']
- *
- * // The `_.matches` iteratee shorthand.
- * _.reject(users, { 'age': 40, 'active': true });
- * // => objects for ['barney']
- *
- * // The `_.matchesProperty` iteratee shorthand.
- * _.reject(users, ['active', false]);
- * // => objects for ['fred']
- *
- * // The `_.property` iteratee shorthand.
- * _.reject(users, 'active');
- * // => objects for ['barney']
- */
- function reject(collection, predicate) {
- var func = isArray(collection) ? arrayFilter : baseFilter;
- return func(collection, negate(getIteratee(predicate, 3)));
- }
-
- /**
- * Gets a random element from `collection`.
- *
- * @static
- * @memberOf _
- * @since 2.0.0
- * @category Collection
- * @param {Array|Object} collection The collection to sample.
- * @returns {*} Returns the random element.
- * @example
- *
- * _.sample([1, 2, 3, 4]);
- * // => 2
- */
- function sample(collection) {
- var func = isArray(collection) ? arraySample : baseSample;
- return func(collection);
- }
-
- /**
- * Gets `n` random elements at unique keys from `collection` up to the
- * size of `collection`.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Collection
- * @param {Array|Object} collection The collection to sample.
- * @param {number} [n=1] The number of elements to sample.
- * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
- * @returns {Array} Returns the random elements.
- * @example
- *
- * _.sampleSize([1, 2, 3], 2);
- * // => [3, 1]
- *
- * _.sampleSize([1, 2, 3], 4);
- * // => [2, 3, 1]
- */
- function sampleSize(collection, n, guard) {
- if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) {
- n = 1;
- } else {
- n = toInteger(n);
- }
- var func = isArray(collection) ? arraySampleSize : baseSampleSize;
- return func(collection, n);
- }
-
- /**
- * Creates an array of shuffled values, using a version of the
- * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Collection
- * @param {Array|Object} collection The collection to shuffle.
- * @returns {Array} Returns the new shuffled array.
- * @example
- *
- * _.shuffle([1, 2, 3, 4]);
- * // => [4, 1, 3, 2]
- */
- function shuffle(collection) {
- var func = isArray(collection) ? arrayShuffle : baseShuffle;
- return func(collection);
- }
-
- /**
- * Gets the size of `collection` by returning its length for array-like
- * values or the number of own enumerable string keyed properties for objects.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Collection
- * @param {Array|Object|string} collection The collection to inspect.
- * @returns {number} Returns the collection size.
- * @example
- *
- * _.size([1, 2, 3]);
- * // => 3
- *
- * _.size({ 'a': 1, 'b': 2 });
- * // => 2
- *
- * _.size('pebbles');
- * // => 7
- */
- function size(collection) {
- if (collection == null) {
- return 0;
- }
- if (isArrayLike(collection)) {
- return isString(collection) ? stringSize(collection) : collection.length;
- }
- var tag = getTag(collection);
- if (tag == mapTag || tag == setTag) {
- return collection.size;
- }
- return baseKeys(collection).length;
- }
-
- /**
- * Checks if `predicate` returns truthy for **any** element of `collection`.
- * Iteration is stopped once `predicate` returns truthy. The predicate is
- * invoked with three arguments: (value, index|key, collection).
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Collection
- * @param {Array|Object} collection The collection to iterate over.
- * @param {Function} [predicate=_.identity] The function invoked per iteration.
- * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
- * @returns {boolean} Returns `true` if any element passes the predicate check,
- * else `false`.
- * @example
- *
- * _.some([null, 0, 'yes', false], Boolean);
- * // => true
- *
- * var users = [
- * { 'user': 'barney', 'active': true },
- * { 'user': 'fred', 'active': false }
- * ];
- *
- * // The `_.matches` iteratee shorthand.
- * _.some(users, { 'user': 'barney', 'active': false });
- * // => false
- *
- * // The `_.matchesProperty` iteratee shorthand.
- * _.some(users, ['active', false]);
- * // => true
- *
- * // The `_.property` iteratee shorthand.
- * _.some(users, 'active');
- * // => true
- */
- function some(collection, predicate, guard) {
- var func = isArray(collection) ? arraySome : baseSome;
- if (guard && isIterateeCall(collection, predicate, guard)) {
- predicate = undefined;
- }
- return func(collection, getIteratee(predicate, 3));
- }
-
- /**
- * Creates an array of elements, sorted in ascending order by the results of
- * running each element in a collection thru each iteratee. This method
- * performs a stable sort, that is, it preserves the original sort order of
- * equal elements. The iteratees are invoked with one argument: (value).
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Collection
- * @param {Array|Object} collection The collection to iterate over.
- * @param {...(Function|Function[])} [iteratees=[_.identity]]
- * The iteratees to sort by.
- * @returns {Array} Returns the new sorted array.
- * @example
- *
- * var users = [
- * { 'user': 'fred', 'age': 48 },
- * { 'user': 'barney', 'age': 36 },
- * { 'user': 'fred', 'age': 40 },
- * { 'user': 'barney', 'age': 34 }
- * ];
- *
- * _.sortBy(users, [function(o) { return o.user; }]);
- * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
- *
- * _.sortBy(users, ['user', 'age']);
- * // => objects for [['barney', 34], ['barney', 36], ['fred', 40], ['fred', 48]]
- */
- var sortBy = baseRest(function(collection, iteratees) {
- if (collection == null) {
- return [];
- }
- var length = iteratees.length;
- if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {
- iteratees = [];
- } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
- iteratees = [iteratees[0]];
- }
- return baseOrderBy(collection, baseFlatten(iteratees, 1), []);
- });
-
- /*------------------------------------------------------------------------*/
-
- /**
- * Gets the timestamp of the number of milliseconds that have elapsed since
- * the Unix epoch (1 January 1970 00:00:00 UTC).
- *
- * @static
- * @memberOf _
- * @since 2.4.0
- * @category Date
- * @returns {number} Returns the timestamp.
- * @example
- *
- * _.defer(function(stamp) {
- * console.log(_.now() - stamp);
- * }, _.now());
- * // => Logs the number of milliseconds it took for the deferred invocation.
- */
- var now = ctxNow || function() {
- return root.Date.now();
- };
-
- /*------------------------------------------------------------------------*/
-
- /**
- * The opposite of `_.before`; this method creates a function that invokes
- * `func` once it's called `n` or more times.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Function
- * @param {number} n The number of calls before `func` is invoked.
- * @param {Function} func The function to restrict.
- * @returns {Function} Returns the new restricted function.
- * @example
- *
- * var saves = ['profile', 'settings'];
- *
- * var done = _.after(saves.length, function() {
- * console.log('done saving!');
- * });
- *
- * _.forEach(saves, function(type) {
- * asyncSave({ 'type': type, 'complete': done });
- * });
- * // => Logs 'done saving!' after the two async saves have completed.
- */
- function after(n, func) {
- if (typeof func != 'function') {
- throw new TypeError(FUNC_ERROR_TEXT);
- }
- n = toInteger(n);
- return function() {
- if (--n < 1) {
- return func.apply(this, arguments);
- }
- };
- }
-
- /**
- * Creates a function that invokes `func`, with up to `n` arguments,
- * ignoring any additional arguments.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Function
- * @param {Function} func The function to cap arguments for.
- * @param {number} [n=func.length] The arity cap.
- * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
- * @returns {Function} Returns the new capped function.
- * @example
- *
- * _.map(['6', '8', '10'], _.ary(parseInt, 1));
- * // => [6, 8, 10]
- */
- function ary(func, n, guard) {
- n = guard ? undefined : n;
- n = (func && n == null) ? func.length : n;
- return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n);
- }
-
- /**
- * Creates a function that invokes `func`, with the `this` binding and arguments
- * of the created function, while it's called less than `n` times. Subsequent
- * calls to the created function return the result of the last `func` invocation.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Function
- * @param {number} n The number of calls at which `func` is no longer invoked.
- * @param {Function} func The function to restrict.
- * @returns {Function} Returns the new restricted function.
- * @example
- *
- * jQuery(element).on('click', _.before(5, addContactToList));
- * // => Allows adding up to 4 contacts to the list.
- */
- function before(n, func) {
- var result;
- if (typeof func != 'function') {
- throw new TypeError(FUNC_ERROR_TEXT);
- }
- n = toInteger(n);
- return function() {
- if (--n > 0) {
- result = func.apply(this, arguments);
- }
- if (n <= 1) {
- func = undefined;
- }
- return result;
- };
- }
-
- /**
- * Creates a function that invokes `func` with the `this` binding of `thisArg`
- * and `partials` prepended to the arguments it receives.
- *
- * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,
- * may be used as a placeholder for partially applied arguments.
- *
- * **Note:** Unlike native `Function#bind`, this method doesn't set the "length"
- * property of bound functions.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Function
- * @param {Function} func The function to bind.
- * @param {*} thisArg The `this` binding of `func`.
- * @param {...*} [partials] The arguments to be partially applied.
- * @returns {Function} Returns the new bound function.
- * @example
- *
- * function greet(greeting, punctuation) {
- * return greeting + ' ' + this.user + punctuation;
- * }
- *
- * var object = { 'user': 'fred' };
- *
- * var bound = _.bind(greet, object, 'hi');
- * bound('!');
- * // => 'hi fred!'
- *
- * // Bound with placeholders.
- * var bound = _.bind(greet, object, _, '!');
- * bound('hi');
- * // => 'hi fred!'
- */
- var bind = baseRest(function(func, thisArg, partials) {
- var bitmask = WRAP_BIND_FLAG;
- if (partials.length) {
- var holders = replaceHolders(partials, getHolder(bind));
- bitmask |= WRAP_PARTIAL_FLAG;
- }
- return createWrap(func, bitmask, thisArg, partials, holders);
- });
-
- /**
- * Creates a function that invokes the method at `object[key]` with `partials`
- * prepended to the arguments it receives.
- *
- * This method differs from `_.bind` by allowing bound functions to reference
- * methods that may be redefined or don't yet exist. See
- * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)
- * for more details.
- *
- * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic
- * builds, may be used as a placeholder for partially applied arguments.
- *
- * @static
- * @memberOf _
- * @since 0.10.0
- * @category Function
- * @param {Object} object The object to invoke the method on.
- * @param {string} key The key of the method.
- * @param {...*} [partials] The arguments to be partially applied.
- * @returns {Function} Returns the new bound function.
- * @example
- *
- * var object = {
- * 'user': 'fred',
- * 'greet': function(greeting, punctuation) {
- * return greeting + ' ' + this.user + punctuation;
- * }
- * };
- *
- * var bound = _.bindKey(object, 'greet', 'hi');
- * bound('!');
- * // => 'hi fred!'
- *
- * object.greet = function(greeting, punctuation) {
- * return greeting + 'ya ' + this.user + punctuation;
- * };
- *
- * bound('!');
- * // => 'hiya fred!'
- *
- * // Bound with placeholders.
- * var bound = _.bindKey(object, 'greet', _, '!');
- * bound('hi');
- * // => 'hiya fred!'
- */
- var bindKey = baseRest(function(object, key, partials) {
- var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;
- if (partials.length) {
- var holders = replaceHolders(partials, getHolder(bindKey));
- bitmask |= WRAP_PARTIAL_FLAG;
- }
- return createWrap(key, bitmask, object, partials, holders);
- });
-
- /**
- * Creates a function that accepts arguments of `func` and either invokes
- * `func` returning its result, if at least `arity` number of arguments have
- * been provided, or returns a function that accepts the remaining `func`
- * arguments, and so on. The arity of `func` may be specified if `func.length`
- * is not sufficient.
- *
- * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,
- * may be used as a placeholder for provided arguments.
- *
- * **Note:** This method doesn't set the "length" property of curried functions.
- *
- * @static
- * @memberOf _
- * @since 2.0.0
- * @category Function
- * @param {Function} func The function to curry.
- * @param {number} [arity=func.length] The arity of `func`.
- * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
- * @returns {Function} Returns the new curried function.
- * @example
- *
- * var abc = function(a, b, c) {
- * return [a, b, c];
- * };
- *
- * var curried = _.curry(abc);
- *
- * curried(1)(2)(3);
- * // => [1, 2, 3]
- *
- * curried(1, 2)(3);
- * // => [1, 2, 3]
- *
- * curried(1, 2, 3);
- * // => [1, 2, 3]
- *
- * // Curried with placeholders.
- * curried(1)(_, 3)(2);
- * // => [1, 2, 3]
- */
- function curry(func, arity, guard) {
- arity = guard ? undefined : arity;
- var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
- result.placeholder = curry.placeholder;
- return result;
- }
-
- /**
- * This method is like `_.curry` except that arguments are applied to `func`
- * in the manner of `_.partialRight` instead of `_.partial`.
- *
- * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic
- * builds, may be used as a placeholder for provided arguments.
- *
- * **Note:** This method doesn't set the "length" property of curried functions.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Function
- * @param {Function} func The function to curry.
- * @param {number} [arity=func.length] The arity of `func`.
- * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
- * @returns {Function} Returns the new curried function.
- * @example
- *
- * var abc = function(a, b, c) {
- * return [a, b, c];
- * };
- *
- * var curried = _.curryRight(abc);
- *
- * curried(3)(2)(1);
- * // => [1, 2, 3]
- *
- * curried(2, 3)(1);
- * // => [1, 2, 3]
- *
- * curried(1, 2, 3);
- * // => [1, 2, 3]
- *
- * // Curried with placeholders.
- * curried(3)(1, _)(2);
- * // => [1, 2, 3]
- */
- function curryRight(func, arity, guard) {
- arity = guard ? undefined : arity;
- var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
- result.placeholder = curryRight.placeholder;
- return result;
- }
-
- /**
- * Creates a debounced function that delays invoking `func` until after `wait`
- * milliseconds have elapsed since the last time the debounced function was
- * invoked. The debounced function comes with a `cancel` method to cancel
- * delayed `func` invocations and a `flush` method to immediately invoke them.
- * Provide `options` to indicate whether `func` should be invoked on the
- * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
- * with the last arguments provided to the debounced function. Subsequent
- * calls to the debounced function return the result of the last `func`
- * invocation.
- *
- * **Note:** If `leading` and `trailing` options are `true`, `func` is
- * invoked on the trailing edge of the timeout only if the debounced function
- * is invoked more than once during the `wait` timeout.
- *
- * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
- * until to the next tick, similar to `setTimeout` with a timeout of `0`.
- *
- * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
- * for details over the differences between `_.debounce` and `_.throttle`.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Function
- * @param {Function} func The function to debounce.
- * @param {number} [wait=0] The number of milliseconds to delay.
- * @param {Object} [options={}] The options object.
- * @param {boolean} [options.leading=false]
- * Specify invoking on the leading edge of the timeout.
- * @param {number} [options.maxWait]
- * The maximum time `func` is allowed to be delayed before it's invoked.
- * @param {boolean} [options.trailing=true]
- * Specify invoking on the trailing edge of the timeout.
- * @returns {Function} Returns the new debounced function.
- * @example
- *
- * // Avoid costly calculations while the window size is in flux.
- * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
- *
- * // Invoke `sendMail` when clicked, debouncing subsequent calls.
- * jQuery(element).on('click', _.debounce(sendMail, 300, {
- * 'leading': true,
- * 'trailing': false
- * }));
- *
- * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
- * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
- * var source = new EventSource('/stream');
- * jQuery(source).on('message', debounced);
- *
- * // Cancel the trailing debounced invocation.
- * jQuery(window).on('popstate', debounced.cancel);
- */
- function debounce(func, wait, options) {
- var lastArgs,
- lastThis,
- maxWait,
- result,
- timerId,
- lastCallTime,
- lastInvokeTime = 0,
- leading = false,
- maxing = false,
- trailing = true;
-
- if (typeof func != 'function') {
- throw new TypeError(FUNC_ERROR_TEXT);
- }
- wait = toNumber(wait) || 0;
- if (isObject(options)) {
- leading = !!options.leading;
- maxing = 'maxWait' in options;
- maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
- trailing = 'trailing' in options ? !!options.trailing : trailing;
- }
-
- function invokeFunc(time) {
- var args = lastArgs,
- thisArg = lastThis;
-
- lastArgs = lastThis = undefined;
- lastInvokeTime = time;
- result = func.apply(thisArg, args);
- return result;
- }
-
- function leadingEdge(time) {
- // Reset any `maxWait` timer.
- lastInvokeTime = time;
- // Start the timer for the trailing edge.
- timerId = setTimeout(timerExpired, wait);
- // Invoke the leading edge.
- return leading ? invokeFunc(time) : result;
- }
-
- function remainingWait(time) {
- var timeSinceLastCall = time - lastCallTime,
- timeSinceLastInvoke = time - lastInvokeTime,
- result = wait - timeSinceLastCall;
-
- return maxing ? nativeMin(result, maxWait - timeSinceLastInvoke) : result;
- }
-
- function shouldInvoke(time) {
- var timeSinceLastCall = time - lastCallTime,
- timeSinceLastInvoke = time - lastInvokeTime;
-
- // Either this is the first call, activity has stopped and we're at the
- // trailing edge, the system time has gone backwards and we're treating
- // it as the trailing edge, or we've hit the `maxWait` limit.
- return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
- (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
- }
-
- function timerExpired() {
- var time = now();
- if (shouldInvoke(time)) {
- return trailingEdge(time);
- }
- // Restart the timer.
- timerId = setTimeout(timerExpired, remainingWait(time));
- }
-
- function trailingEdge(time) {
- timerId = undefined;
-
- // Only invoke if we have `lastArgs` which means `func` has been
- // debounced at least once.
- if (trailing && lastArgs) {
- return invokeFunc(time);
- }
- lastArgs = lastThis = undefined;
- return result;
- }
-
- function cancel() {
- if (timerId !== undefined) {
- clearTimeout(timerId);
- }
- lastInvokeTime = 0;
- lastArgs = lastCallTime = lastThis = timerId = undefined;
- }
-
- function flush() {
- return timerId === undefined ? result : trailingEdge(now());
- }
-
- function debounced() {
- var time = now(),
- isInvoking = shouldInvoke(time);
-
- lastArgs = arguments;
- lastThis = this;
- lastCallTime = time;
-
- if (isInvoking) {
- if (timerId === undefined) {
- return leadingEdge(lastCallTime);
- }
- if (maxing) {
- // Handle invocations in a tight loop.
- timerId = setTimeout(timerExpired, wait);
- return invokeFunc(lastCallTime);
- }
- }
- if (timerId === undefined) {
- timerId = setTimeout(timerExpired, wait);
- }
- return result;
- }
- debounced.cancel = cancel;
- debounced.flush = flush;
- return debounced;
- }
-
- /**
- * Defers invoking the `func` until the current call stack has cleared. Any
- * additional arguments are provided to `func` when it's invoked.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Function
- * @param {Function} func The function to defer.
- * @param {...*} [args] The arguments to invoke `func` with.
- * @returns {number} Returns the timer id.
- * @example
- *
- * _.defer(function(text) {
- * console.log(text);
- * }, 'deferred');
- * // => Logs 'deferred' after one millisecond.
- */
- var defer = baseRest(function(func, args) {
- return baseDelay(func, 1, args);
- });
-
- /**
- * Invokes `func` after `wait` milliseconds. Any additional arguments are
- * provided to `func` when it's invoked.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Function
- * @param {Function} func The function to delay.
- * @param {number} wait The number of milliseconds to delay invocation.
- * @param {...*} [args] The arguments to invoke `func` with.
- * @returns {number} Returns the timer id.
- * @example
- *
- * _.delay(function(text) {
- * console.log(text);
- * }, 1000, 'later');
- * // => Logs 'later' after one second.
- */
- var delay = baseRest(function(func, wait, args) {
- return baseDelay(func, toNumber(wait) || 0, args);
- });
-
- /**
- * Creates a function that invokes `func` with arguments reversed.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Function
- * @param {Function} func The function to flip arguments for.
- * @returns {Function} Returns the new flipped function.
- * @example
- *
- * var flipped = _.flip(function() {
- * return _.toArray(arguments);
- * });
- *
- * flipped('a', 'b', 'c', 'd');
- * // => ['d', 'c', 'b', 'a']
- */
- function flip(func) {
- return createWrap(func, WRAP_FLIP_FLAG);
- }
-
- /**
- * Creates a function that memoizes the result of `func`. If `resolver` is
- * provided, it determines the cache key for storing the result based on the
- * arguments provided to the memoized function. By default, the first argument
- * provided to the memoized function is used as the map cache key. The `func`
- * is invoked with the `this` binding of the memoized function.
- *
- * **Note:** The cache is exposed as the `cache` property on the memoized
- * function. Its creation may be customized by replacing the `_.memoize.Cache`
- * constructor with one whose instances implement the
- * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
- * method interface of `clear`, `delete`, `get`, `has`, and `set`.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Function
- * @param {Function} func The function to have its output memoized.
- * @param {Function} [resolver] The function to resolve the cache key.
- * @returns {Function} Returns the new memoized function.
- * @example
- *
- * var object = { 'a': 1, 'b': 2 };
- * var other = { 'c': 3, 'd': 4 };
- *
- * var values = _.memoize(_.values);
- * values(object);
- * // => [1, 2]
- *
- * values(other);
- * // => [3, 4]
- *
- * object.a = 2;
- * values(object);
- * // => [1, 2]
- *
- * // Modify the result cache.
- * values.cache.set(object, ['a', 'b']);
- * values(object);
- * // => ['a', 'b']
- *
- * // Replace `_.memoize.Cache`.
- * _.memoize.Cache = WeakMap;
- */
- function memoize(func, resolver) {
- if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
- throw new TypeError(FUNC_ERROR_TEXT);
- }
- var memoized = function() {
- var args = arguments,
- key = resolver ? resolver.apply(this, args) : args[0],
- cache = memoized.cache;
-
- if (cache.has(key)) {
- return cache.get(key);
- }
- var result = func.apply(this, args);
- memoized.cache = cache.set(key, result) || cache;
- return result;
- };
- memoized.cache = new (memoize.Cache || MapCache);
- return memoized;
- }
-
- // Expose `MapCache`.
- memoize.Cache = MapCache;
-
- /**
- * Creates a function that negates the result of the predicate `func`. The
- * `func` predicate is invoked with the `this` binding and arguments of the
- * created function.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Function
- * @param {Function} predicate The predicate to negate.
- * @returns {Function} Returns the new negated function.
- * @example
- *
- * function isEven(n) {
- * return n % 2 == 0;
- * }
- *
- * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));
- * // => [1, 3, 5]
- */
- function negate(predicate) {
- if (typeof predicate != 'function') {
- throw new TypeError(FUNC_ERROR_TEXT);
- }
- return function() {
- var args = arguments;
- switch (args.length) {
- case 0: return !predicate.call(this);
- case 1: return !predicate.call(this, args[0]);
- case 2: return !predicate.call(this, args[0], args[1]);
- case 3: return !predicate.call(this, args[0], args[1], args[2]);
- }
- return !predicate.apply(this, args);
- };
- }
-
- /**
- * Creates a function that is restricted to invoking `func` once. Repeat calls
- * to the function return the value of the first invocation. The `func` is
- * invoked with the `this` binding and arguments of the created function.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Function
- * @param {Function} func The function to restrict.
- * @returns {Function} Returns the new restricted function.
- * @example
- *
- * var initialize = _.once(createApplication);
- * initialize();
- * initialize();
- * // => `createApplication` is invoked once
- */
- function once(func) {
- return before(2, func);
- }
-
- /**
- * Creates a function that invokes `func` with its arguments transformed.
- *
- * @static
- * @since 4.0.0
- * @memberOf _
- * @category Function
- * @param {Function} func The function to wrap.
- * @param {...(Function|Function[])} [transforms=[_.identity]]
- * The argument transforms.
- * @returns {Function} Returns the new function.
- * @example
- *
- * function doubled(n) {
- * return n * 2;
- * }
- *
- * function square(n) {
- * return n * n;
- * }
- *
- * var func = _.overArgs(function(x, y) {
- * return [x, y];
- * }, [square, doubled]);
- *
- * func(9, 3);
- * // => [81, 6]
- *
- * func(10, 5);
- * // => [100, 10]
- */
- var overArgs = castRest(function(func, transforms) {
- transforms = (transforms.length == 1 && isArray(transforms[0]))
- ? arrayMap(transforms[0], baseUnary(getIteratee()))
- : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee()));
-
- var funcsLength = transforms.length;
- return baseRest(function(args) {
- var index = -1,
- length = nativeMin(args.length, funcsLength);
-
- while (++index < length) {
- args[index] = transforms[index].call(this, args[index]);
- }
- return apply(func, this, args);
- });
- });
-
- /**
- * Creates a function that invokes `func` with `partials` prepended to the
- * arguments it receives. This method is like `_.bind` except it does **not**
- * alter the `this` binding.
- *
- * The `_.partial.placeholder` value, which defaults to `_` in monolithic
- * builds, may be used as a placeholder for partially applied arguments.
- *
- * **Note:** This method doesn't set the "length" property of partially
- * applied functions.
- *
- * @static
- * @memberOf _
- * @since 0.2.0
- * @category Function
- * @param {Function} func The function to partially apply arguments to.
- * @param {...*} [partials] The arguments to be partially applied.
- * @returns {Function} Returns the new partially applied function.
- * @example
- *
- * function greet(greeting, name) {
- * return greeting + ' ' + name;
- * }
- *
- * var sayHelloTo = _.partial(greet, 'hello');
- * sayHelloTo('fred');
- * // => 'hello fred'
- *
- * // Partially applied with placeholders.
- * var greetFred = _.partial(greet, _, 'fred');
- * greetFred('hi');
- * // => 'hi fred'
- */
- var partial = baseRest(function(func, partials) {
- var holders = replaceHolders(partials, getHolder(partial));
- return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders);
- });
-
- /**
- * This method is like `_.partial` except that partially applied arguments
- * are appended to the arguments it receives.
- *
- * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic
- * builds, may be used as a placeholder for partially applied arguments.
- *
- * **Note:** This method doesn't set the "length" property of partially
- * applied functions.
- *
- * @static
- * @memberOf _
- * @since 1.0.0
- * @category Function
- * @param {Function} func The function to partially apply arguments to.
- * @param {...*} [partials] The arguments to be partially applied.
- * @returns {Function} Returns the new partially applied function.
- * @example
- *
- * function greet(greeting, name) {
- * return greeting + ' ' + name;
- * }
- *
- * var greetFred = _.partialRight(greet, 'fred');
- * greetFred('hi');
- * // => 'hi fred'
- *
- * // Partially applied with placeholders.
- * var sayHelloTo = _.partialRight(greet, 'hello', _);
- * sayHelloTo('fred');
- * // => 'hello fred'
- */
- var partialRight = baseRest(function(func, partials) {
- var holders = replaceHolders(partials, getHolder(partialRight));
- return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders);
- });
-
- /**
- * Creates a function that invokes `func` with arguments arranged according
- * to the specified `indexes` where the argument value at the first index is
- * provided as the first argument, the argument value at the second index is
- * provided as the second argument, and so on.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Function
- * @param {Function} func The function to rearrange arguments for.
- * @param {...(number|number[])} indexes The arranged argument indexes.
- * @returns {Function} Returns the new function.
- * @example
- *
- * var rearged = _.rearg(function(a, b, c) {
- * return [a, b, c];
- * }, [2, 0, 1]);
- *
- * rearged('b', 'c', 'a')
- * // => ['a', 'b', 'c']
- */
- var rearg = flatRest(function(func, indexes) {
- return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes);
- });
-
- /**
- * Creates a function that invokes `func` with the `this` binding of the
- * created function and arguments from `start` and beyond provided as
- * an array.
- *
- * **Note:** This method is based on the
- * [rest parameter](https://mdn.io/rest_parameters).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Function
- * @param {Function} func The function to apply a rest parameter to.
- * @param {number} [start=func.length-1] The start position of the rest parameter.
- * @returns {Function} Returns the new function.
- * @example
- *
- * var say = _.rest(function(what, names) {
- * return what + ' ' + _.initial(names).join(', ') +
- * (_.size(names) > 1 ? ', & ' : '') + _.last(names);
- * });
- *
- * say('hello', 'fred', 'barney', 'pebbles');
- * // => 'hello fred, barney, & pebbles'
- */
- function rest(func, start) {
- if (typeof func != 'function') {
- throw new TypeError(FUNC_ERROR_TEXT);
- }
- start = start === undefined ? start : toInteger(start);
- return baseRest(func, start);
- }
-
- /**
- * Creates a function that invokes `func` with the `this` binding of the
- * create function and an array of arguments much like
- * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply).
- *
- * **Note:** This method is based on the
- * [spread operator](https://mdn.io/spread_operator).
- *
- * @static
- * @memberOf _
- * @since 3.2.0
- * @category Function
- * @param {Function} func The function to spread arguments over.
- * @param {number} [start=0] The start position of the spread.
- * @returns {Function} Returns the new function.
- * @example
- *
- * var say = _.spread(function(who, what) {
- * return who + ' says ' + what;
- * });
- *
- * say(['fred', 'hello']);
- * // => 'fred says hello'
- *
- * var numbers = Promise.all([
- * Promise.resolve(40),
- * Promise.resolve(36)
- * ]);
- *
- * numbers.then(_.spread(function(x, y) {
- * return x + y;
- * }));
- * // => a Promise of 76
- */
- function spread(func, start) {
- if (typeof func != 'function') {
- throw new TypeError(FUNC_ERROR_TEXT);
- }
- start = start == null ? 0 : nativeMax(toInteger(start), 0);
- return baseRest(function(args) {
- var array = args[start],
- otherArgs = castSlice(args, 0, start);
-
- if (array) {
- arrayPush(otherArgs, array);
- }
- return apply(func, this, otherArgs);
- });
- }
-
- /**
- * Creates a throttled function that only invokes `func` at most once per
- * every `wait` milliseconds. The throttled function comes with a `cancel`
- * method to cancel delayed `func` invocations and a `flush` method to
- * immediately invoke them. Provide `options` to indicate whether `func`
- * should be invoked on the leading and/or trailing edge of the `wait`
- * timeout. The `func` is invoked with the last arguments provided to the
- * throttled function. Subsequent calls to the throttled function return the
- * result of the last `func` invocation.
- *
- * **Note:** If `leading` and `trailing` options are `true`, `func` is
- * invoked on the trailing edge of the timeout only if the throttled function
- * is invoked more than once during the `wait` timeout.
- *
- * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
- * until to the next tick, similar to `setTimeout` with a timeout of `0`.
- *
- * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
- * for details over the differences between `_.throttle` and `_.debounce`.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Function
- * @param {Function} func The function to throttle.
- * @param {number} [wait=0] The number of milliseconds to throttle invocations to.
- * @param {Object} [options={}] The options object.
- * @param {boolean} [options.leading=true]
- * Specify invoking on the leading edge of the timeout.
- * @param {boolean} [options.trailing=true]
- * Specify invoking on the trailing edge of the timeout.
- * @returns {Function} Returns the new throttled function.
- * @example
- *
- * // Avoid excessively updating the position while scrolling.
- * jQuery(window).on('scroll', _.throttle(updatePosition, 100));
- *
- * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
- * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
- * jQuery(element).on('click', throttled);
- *
- * // Cancel the trailing throttled invocation.
- * jQuery(window).on('popstate', throttled.cancel);
- */
- function throttle(func, wait, options) {
- var leading = true,
- trailing = true;
-
- if (typeof func != 'function') {
- throw new TypeError(FUNC_ERROR_TEXT);
- }
- if (isObject(options)) {
- leading = 'leading' in options ? !!options.leading : leading;
- trailing = 'trailing' in options ? !!options.trailing : trailing;
- }
- return debounce(func, wait, {
- 'leading': leading,
- 'maxWait': wait,
- 'trailing': trailing
- });
- }
-
- /**
- * Creates a function that accepts up to one argument, ignoring any
- * additional arguments.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Function
- * @param {Function} func The function to cap arguments for.
- * @returns {Function} Returns the new capped function.
- * @example
- *
- * _.map(['6', '8', '10'], _.unary(parseInt));
- * // => [6, 8, 10]
- */
- function unary(func) {
- return ary(func, 1);
- }
-
- /**
- * Creates a function that provides `value` to `wrapper` as its first
- * argument. Any additional arguments provided to the function are appended
- * to those provided to the `wrapper`. The wrapper is invoked with the `this`
- * binding of the created function.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Function
- * @param {*} value The value to wrap.
- * @param {Function} [wrapper=identity] The wrapper function.
- * @returns {Function} Returns the new function.
- * @example
- *
- * var p = _.wrap(_.escape, function(func, text) {
- * return '<p>' + func(text) + '</p>';
- * });
- *
- * p('fred, barney, & pebbles');
- * // => '<p>fred, barney, &amp; pebbles</p>'
- */
- function wrap(value, wrapper) {
- return partial(castFunction(wrapper), value);
- }
-
- /*------------------------------------------------------------------------*/
-
- /**
- * Casts `value` as an array if it's not one.
- *
- * @static
- * @memberOf _
- * @since 4.4.0
- * @category Lang
- * @param {*} value The value to inspect.
- * @returns {Array} Returns the cast array.
- * @example
- *
- * _.castArray(1);
- * // => [1]
- *
- * _.castArray({ 'a': 1 });
- * // => [{ 'a': 1 }]
- *
- * _.castArray('abc');
- * // => ['abc']
- *
- * _.castArray(null);
- * // => [null]
- *
- * _.castArray(undefined);
- * // => [undefined]
- *
- * _.castArray();
- * // => []
- *
- * var array = [1, 2, 3];
- * console.log(_.castArray(array) === array);
- * // => true
- */
- function castArray() {
- if (!arguments.length) {
- return [];
- }
- var value = arguments[0];
- return isArray(value) ? value : [value];
- }
-
- /**
- * Creates a shallow clone of `value`.
- *
- * **Note:** This method is loosely based on the
- * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)
- * and supports cloning arrays, array buffers, booleans, date objects, maps,
- * numbers, `Object` objects, regexes, sets, strings, symbols, and typed
- * arrays. The own enumerable properties of `arguments` objects are cloned
- * as plain objects. An empty object is returned for uncloneable values such
- * as error objects, functions, DOM nodes, and WeakMaps.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Lang
- * @param {*} value The value to clone.
- * @returns {*} Returns the cloned value.
- * @see _.cloneDeep
- * @example
- *
- * var objects = [{ 'a': 1 }, { 'b': 2 }];
- *
- * var shallow = _.clone(objects);
- * console.log(shallow[0] === objects[0]);
- * // => true
- */
- function clone(value) {
- return baseClone(value, CLONE_SYMBOLS_FLAG);
- }
-
- /**
- * This method is like `_.clone` except that it accepts `customizer` which
- * is invoked to produce the cloned value. If `customizer` returns `undefined`,
- * cloning is handled by the method instead. The `customizer` is invoked with
- * up to four arguments; (value [, index|key, object, stack]).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {*} value The value to clone.
- * @param {Function} [customizer] The function to customize cloning.
- * @returns {*} Returns the cloned value.
- * @see _.cloneDeepWith
- * @example
- *
- * function customizer(value) {
- * if (_.isElement(value)) {
- * return value.cloneNode(false);
- * }
- * }
- *
- * var el = _.cloneWith(document.body, customizer);
- *
- * console.log(el === document.body);
- * // => false
- * console.log(el.nodeName);
- * // => 'BODY'
- * console.log(el.childNodes.length);
- * // => 0
- */
- function cloneWith(value, customizer) {
- customizer = typeof customizer == 'function' ? customizer : undefined;
- return baseClone(value, CLONE_SYMBOLS_FLAG, customizer);
- }
-
- /**
- * This method is like `_.clone` except that it recursively clones `value`.
- *
- * @static
- * @memberOf _
- * @since 1.0.0
- * @category Lang
- * @param {*} value The value to recursively clone.
- * @returns {*} Returns the deep cloned value.
- * @see _.clone
- * @example
- *
- * var objects = [{ 'a': 1 }, { 'b': 2 }];
- *
- * var deep = _.cloneDeep(objects);
- * console.log(deep[0] === objects[0]);
- * // => false
- */
- function cloneDeep(value) {
- return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
- }
-
- /**
- * This method is like `_.cloneWith` except that it recursively clones `value`.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {*} value The value to recursively clone.
- * @param {Function} [customizer] The function to customize cloning.
- * @returns {*} Returns the deep cloned value.
- * @see _.cloneWith
- * @example
- *
- * function customizer(value) {
- * if (_.isElement(value)) {
- * return value.cloneNode(true);
- * }
- * }
- *
- * var el = _.cloneDeepWith(document.body, customizer);
- *
- * console.log(el === document.body);
- * // => false
- * console.log(el.nodeName);
- * // => 'BODY'
- * console.log(el.childNodes.length);
- * // => 20
- */
- function cloneDeepWith(value, customizer) {
- customizer = typeof customizer == 'function' ? customizer : undefined;
- return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);
- }
-
- /**
- * Checks if `object` conforms to `source` by invoking the predicate
- * properties of `source` with the corresponding property values of `object`.
- *
- * **Note:** This method is equivalent to `_.conforms` when `source` is
- * partially applied.
- *
- * @static
- * @memberOf _
- * @since 4.14.0
- * @category Lang
- * @param {Object} object The object to inspect.
- * @param {Object} source The object of property predicates to conform to.
- * @returns {boolean} Returns `true` if `object` conforms, else `false`.
- * @example
- *
- * var object = { 'a': 1, 'b': 2 };
- *
- * _.conformsTo(object, { 'b': function(n) { return n > 1; } });
- * // => true
- *
- * _.conformsTo(object, { 'b': function(n) { return n > 2; } });
- * // => false
- */
- function conformsTo(object, source) {
- return source == null || baseConformsTo(object, source, keys(source));
- }
-
- /**
- * Performs a
- * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
- * comparison between two values to determine if they are equivalent.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {*} value The value to compare.
- * @param {*} other The other value to compare.
- * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
- * @example
- *
- * var object = { 'a': 1 };
- * var other = { 'a': 1 };
- *
- * _.eq(object, object);
- * // => true
- *
- * _.eq(object, other);
- * // => false
- *
- * _.eq('a', 'a');
- * // => true
- *
- * _.eq('a', Object('a'));
- * // => false
- *
- * _.eq(NaN, NaN);
- * // => true
- */
- function eq(value, other) {
- return value === other || (value !== value && other !== other);
- }
-
- /**
- * Checks if `value` is greater than `other`.
- *
- * @static
- * @memberOf _
- * @since 3.9.0
- * @category Lang
- * @param {*} value The value to compare.
- * @param {*} other The other value to compare.
- * @returns {boolean} Returns `true` if `value` is greater than `other`,
- * else `false`.
- * @see _.lt
- * @example
- *
- * _.gt(3, 1);
- * // => true
- *
- * _.gt(3, 3);
- * // => false
- *
- * _.gt(1, 3);
- * // => false
- */
- var gt = createRelationalOperation(baseGt);
-
- /**
- * Checks if `value` is greater than or equal to `other`.
- *
- * @static
- * @memberOf _
- * @since 3.9.0
- * @category Lang
- * @param {*} value The value to compare.
- * @param {*} other The other value to compare.
- * @returns {boolean} Returns `true` if `value` is greater than or equal to
- * `other`, else `false`.
- * @see _.lte
- * @example
- *
- * _.gte(3, 1);
- * // => true
- *
- * _.gte(3, 3);
- * // => true
- *
- * _.gte(1, 3);
- * // => false
- */
- var gte = createRelationalOperation(function(value, other) {
- return value >= other;
- });
-
- /**
- * Checks if `value` is likely an `arguments` object.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is an `arguments` object,
- * else `false`.
- * @example
- *
- * _.isArguments(function() { return arguments; }());
- * // => true
- *
- * _.isArguments([1, 2, 3]);
- * // => false
- */
- var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
- return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
- !propertyIsEnumerable.call(value, 'callee');
- };
-
- /**
- * Checks if `value` is classified as an `Array` object.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is an array, else `false`.
- * @example
- *
- * _.isArray([1, 2, 3]);
- * // => true
- *
- * _.isArray(document.body.children);
- * // => false
- *
- * _.isArray('abc');
- * // => false
- *
- * _.isArray(_.noop);
- * // => false
- */
- var isArray = Array.isArray;
-
- /**
- * Checks if `value` is classified as an `ArrayBuffer` object.
- *
- * @static
- * @memberOf _
- * @since 4.3.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
- * @example
- *
- * _.isArrayBuffer(new ArrayBuffer(2));
- * // => true
- *
- * _.isArrayBuffer(new Array(2));
- * // => false
- */
- var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;
-
- /**
- * Checks if `value` is array-like. A value is considered array-like if it's
- * not a function and has a `value.length` that's an integer greater than or
- * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
- * @example
- *
- * _.isArrayLike([1, 2, 3]);
- * // => true
- *
- * _.isArrayLike(document.body.children);
- * // => true
- *
- * _.isArrayLike('abc');
- * // => true
- *
- * _.isArrayLike(_.noop);
- * // => false
- */
- function isArrayLike(value) {
- return value != null && isLength(value.length) && !isFunction(value);
- }
-
- /**
- * This method is like `_.isArrayLike` except that it also checks if `value`
- * is an object.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is an array-like object,
- * else `false`.
- * @example
- *
- * _.isArrayLikeObject([1, 2, 3]);
- * // => true
- *
- * _.isArrayLikeObject(document.body.children);
- * // => true
- *
- * _.isArrayLikeObject('abc');
- * // => false
- *
- * _.isArrayLikeObject(_.noop);
- * // => false
- */
- function isArrayLikeObject(value) {
- return isObjectLike(value) && isArrayLike(value);
- }
-
- /**
- * Checks if `value` is classified as a boolean primitive or object.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a boolean, else `false`.
- * @example
- *
- * _.isBoolean(false);
- * // => true
- *
- * _.isBoolean(null);
- * // => false
- */
- function isBoolean(value) {
- return value === true || value === false ||
- (isObjectLike(value) && baseGetTag(value) == boolTag);
- }
-
- /**
- * Checks if `value` is a buffer.
- *
- * @static
- * @memberOf _
- * @since 4.3.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
- * @example
- *
- * _.isBuffer(new Buffer(2));
- * // => true
- *
- * _.isBuffer(new Uint8Array(2));
- * // => false
- */
- var isBuffer = nativeIsBuffer || stubFalse;
-
- /**
- * Checks if `value` is classified as a `Date` object.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
- * @example
- *
- * _.isDate(new Date);
- * // => true
- *
- * _.isDate('Mon April 23 2012');
- * // => false
- */
- var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;
-
- /**
- * Checks if `value` is likely a DOM element.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`.
- * @example
- *
- * _.isElement(document.body);
- * // => true
- *
- * _.isElement('<body>');
- * // => false
- */
- function isElement(value) {
- return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);
- }
-
- /**
- * Checks if `value` is an empty object, collection, map, or set.
- *
- * Objects are considered empty if they have no own enumerable string keyed
- * properties.
- *
- * Array-like values such as `arguments` objects, arrays, buffers, strings, or
- * jQuery-like collections are considered empty if they have a `length` of `0`.
- * Similarly, maps and sets are considered empty if they have a `size` of `0`.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is empty, else `false`.
- * @example
- *
- * _.isEmpty(null);
- * // => true
- *
- * _.isEmpty(true);
- * // => true
- *
- * _.isEmpty(1);
- * // => true
- *
- * _.isEmpty([1, 2, 3]);
- * // => false
- *
- * _.isEmpty({ 'a': 1 });
- * // => false
- */
- function isEmpty(value) {
- if (value == null) {
- return true;
- }
- if (isArrayLike(value) &&
- (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||
- isBuffer(value) || isTypedArray(value) || isArguments(value))) {
- return !value.length;
- }
- var tag = getTag(value);
- if (tag == mapTag || tag == setTag) {
- return !value.size;
- }
- if (isPrototype(value)) {
- return !baseKeys(value).length;
- }
- for (var key in value) {
- if (hasOwnProperty.call(value, key)) {
- return false;
- }
- }
- return true;
- }
-
- /**
- * Performs a deep comparison between two values to determine if they are
- * equivalent.
- *
- * **Note:** This method supports comparing arrays, array buffers, booleans,
- * date objects, error objects, maps, numbers, `Object` objects, regexes,
- * sets, strings, symbols, and typed arrays. `Object` objects are compared
- * by their own, not inherited, enumerable properties. Functions and DOM
- * nodes are compared by strict equality, i.e. `===`.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Lang
- * @param {*} value The value to compare.
- * @param {*} other The other value to compare.
- * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
- * @example
- *
- * var object = { 'a': 1 };
- * var other = { 'a': 1 };
- *
- * _.isEqual(object, other);
- * // => true
- *
- * object === other;
- * // => false
- */
- function isEqual(value, other) {
- return baseIsEqual(value, other);
- }
-
- /**
- * This method is like `_.isEqual` except that it accepts `customizer` which
- * is invoked to compare values. If `customizer` returns `undefined`, comparisons
- * are handled by the method instead. The `customizer` is invoked with up to
- * six arguments: (objValue, othValue [, index|key, object, other, stack]).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {*} value The value to compare.
- * @param {*} other The other value to compare.
- * @param {Function} [customizer] The function to customize comparisons.
- * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
- * @example
- *
- * function isGreeting(value) {
- * return /^h(?:i|ello)$/.test(value);
- * }
- *
- * function customizer(objValue, othValue) {
- * if (isGreeting(objValue) && isGreeting(othValue)) {
- * return true;
- * }
- * }
- *
- * var array = ['hello', 'goodbye'];
- * var other = ['hi', 'goodbye'];
- *
- * _.isEqualWith(array, other, customizer);
- * // => true
- */
- function isEqualWith(value, other, customizer) {
- customizer = typeof customizer == 'function' ? customizer : undefined;
- var result = customizer ? customizer(value, other) : undefined;
- return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result;
- }
-
- /**
- * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,
- * `SyntaxError`, `TypeError`, or `URIError` object.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is an error object, else `false`.
- * @example
- *
- * _.isError(new Error);
- * // => true
- *
- * _.isError(Error);
- * // => false
- */
- function isError(value) {
- if (!isObjectLike(value)) {
- return false;
- }
- var tag = baseGetTag(value);
- return tag == errorTag || tag == domExcTag ||
- (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value));
- }
-
- /**
- * Checks if `value` is a finite primitive number.
- *
- * **Note:** This method is based on
- * [`Number.isFinite`](https://mdn.io/Number/isFinite).
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a finite number, else `false`.
- * @example
- *
- * _.isFinite(3);
- * // => true
- *
- * _.isFinite(Number.MIN_VALUE);
- * // => true
- *
- * _.isFinite(Infinity);
- * // => false
- *
- * _.isFinite('3');
- * // => false
- */
- function isFinite(value) {
- return typeof value == 'number' && nativeIsFinite(value);
- }
-
- /**
- * Checks if `value` is classified as a `Function` object.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a function, else `false`.
- * @example
- *
- * _.isFunction(_);
- * // => true
- *
- * _.isFunction(/abc/);
- * // => false
- */
- function isFunction(value) {
- if (!isObject(value)) {
- return false;
- }
- // The use of `Object#toString` avoids issues with the `typeof` operator
- // in Safari 9 which returns 'object' for typed arrays and other constructors.
- var tag = baseGetTag(value);
- return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
- }
-
- /**
- * Checks if `value` is an integer.
- *
- * **Note:** This method is based on
- * [`Number.isInteger`](https://mdn.io/Number/isInteger).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is an integer, else `false`.
- * @example
- *
- * _.isInteger(3);
- * // => true
- *
- * _.isInteger(Number.MIN_VALUE);
- * // => false
- *
- * _.isInteger(Infinity);
- * // => false
- *
- * _.isInteger('3');
- * // => false
- */
- function isInteger(value) {
- return typeof value == 'number' && value == toInteger(value);
- }
-
- /**
- * Checks if `value` is a valid array-like length.
- *
- * **Note:** This method is loosely based on
- * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
- * @example
- *
- * _.isLength(3);
- * // => true
- *
- * _.isLength(Number.MIN_VALUE);
- * // => false
- *
- * _.isLength(Infinity);
- * // => false
- *
- * _.isLength('3');
- * // => false
- */
- function isLength(value) {
- return typeof value == 'number' &&
- value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
- }
-
- /**
- * Checks if `value` is the
- * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
- * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is an object, else `false`.
- * @example
- *
- * _.isObject({});
- * // => true
- *
- * _.isObject([1, 2, 3]);
- * // => true
- *
- * _.isObject(_.noop);
- * // => true
- *
- * _.isObject(null);
- * // => false
- */
- function isObject(value) {
- var type = typeof value;
- return value != null && (type == 'object' || type == 'function');
- }
-
- /**
- * Checks if `value` is object-like. A value is object-like if it's not `null`
- * and has a `typeof` result of "object".
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
- * @example
- *
- * _.isObjectLike({});
- * // => true
- *
- * _.isObjectLike([1, 2, 3]);
- * // => true
- *
- * _.isObjectLike(_.noop);
- * // => false
- *
- * _.isObjectLike(null);
- * // => false
- */
- function isObjectLike(value) {
- return value != null && typeof value == 'object';
- }
-
- /**
- * Checks if `value` is classified as a `Map` object.
- *
- * @static
- * @memberOf _
- * @since 4.3.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a map, else `false`.
- * @example
- *
- * _.isMap(new Map);
- * // => true
- *
- * _.isMap(new WeakMap);
- * // => false
- */
- var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
-
- /**
- * Performs a partial deep comparison between `object` and `source` to
- * determine if `object` contains equivalent property values.
- *
- * **Note:** This method is equivalent to `_.matches` when `source` is
- * partially applied.
- *
- * Partial comparisons will match empty array and empty object `source`
- * values against any array or object value, respectively. See `_.isEqual`
- * for a list of supported value comparisons.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Lang
- * @param {Object} object The object to inspect.
- * @param {Object} source The object of property values to match.
- * @returns {boolean} Returns `true` if `object` is a match, else `false`.
- * @example
- *
- * var object = { 'a': 1, 'b': 2 };
- *
- * _.isMatch(object, { 'b': 2 });
- * // => true
- *
- * _.isMatch(object, { 'b': 1 });
- * // => false
- */
- function isMatch(object, source) {
- return object === source || baseIsMatch(object, source, getMatchData(source));
- }
-
- /**
- * This method is like `_.isMatch` except that it accepts `customizer` which
- * is invoked to compare values. If `customizer` returns `undefined`, comparisons
- * are handled by the method instead. The `customizer` is invoked with five
- * arguments: (objValue, srcValue, index|key, object, source).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {Object} object The object to inspect.
- * @param {Object} source The object of property values to match.
- * @param {Function} [customizer] The function to customize comparisons.
- * @returns {boolean} Returns `true` if `object` is a match, else `false`.
- * @example
- *
- * function isGreeting(value) {
- * return /^h(?:i|ello)$/.test(value);
- * }
- *
- * function customizer(objValue, srcValue) {
- * if (isGreeting(objValue) && isGreeting(srcValue)) {
- * return true;
- * }
- * }
- *
- * var object = { 'greeting': 'hello' };
- * var source = { 'greeting': 'hi' };
- *
- * _.isMatchWith(object, source, customizer);
- * // => true
- */
- function isMatchWith(object, source, customizer) {
- customizer = typeof customizer == 'function' ? customizer : undefined;
- return baseIsMatch(object, source, getMatchData(source), customizer);
- }
-
- /**
- * Checks if `value` is `NaN`.
- *
- * **Note:** This method is based on
- * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as
- * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for
- * `undefined` and other non-number values.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
- * @example
- *
- * _.isNaN(NaN);
- * // => true
- *
- * _.isNaN(new Number(NaN));
- * // => true
- *
- * isNaN(undefined);
- * // => true
- *
- * _.isNaN(undefined);
- * // => false
- */
- function isNaN(value) {
- // An `NaN` primitive is the only value that is not equal to itself.
- // Perform the `toStringTag` check first to avoid errors with some
- // ActiveX objects in IE.
- return isNumber(value) && value != +value;
- }
-
- /**
- * Checks if `value` is a pristine native function.
- *
- * **Note:** This method can't reliably detect native functions in the presence
- * of the core-js package because core-js circumvents this kind of detection.
- * Despite multiple requests, the core-js maintainer has made it clear: any
- * attempt to fix the detection will be obstructed. As a result, we're left
- * with little choice but to throw an error. Unfortunately, this also affects
- * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill),
- * which rely on core-js.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a native function,
- * else `false`.
- * @example
- *
- * _.isNative(Array.prototype.push);
- * // => true
- *
- * _.isNative(_);
- * // => false
- */
- function isNative(value) {
- if (isMaskable(value)) {
- throw new Error(CORE_ERROR_TEXT);
- }
- return baseIsNative(value);
- }
-
- /**
- * Checks if `value` is `null`.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is `null`, else `false`.
- * @example
- *
- * _.isNull(null);
- * // => true
- *
- * _.isNull(void 0);
- * // => false
- */
- function isNull(value) {
- return value === null;
- }
-
- /**
- * Checks if `value` is `null` or `undefined`.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is nullish, else `false`.
- * @example
- *
- * _.isNil(null);
- * // => true
- *
- * _.isNil(void 0);
- * // => true
- *
- * _.isNil(NaN);
- * // => false
- */
- function isNil(value) {
- return value == null;
- }
-
- /**
- * Checks if `value` is classified as a `Number` primitive or object.
- *
- * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are
- * classified as numbers, use the `_.isFinite` method.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a number, else `false`.
- * @example
- *
- * _.isNumber(3);
- * // => true
- *
- * _.isNumber(Number.MIN_VALUE);
- * // => true
- *
- * _.isNumber(Infinity);
- * // => true
- *
- * _.isNumber('3');
- * // => false
- */
- function isNumber(value) {
- return typeof value == 'number' ||
- (isObjectLike(value) && baseGetTag(value) == numberTag);
- }
-
- /**
- * Checks if `value` is a plain object, that is, an object created by the
- * `Object` constructor or one with a `[[Prototype]]` of `null`.
- *
- * @static
- * @memberOf _
- * @since 0.8.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
- * @example
- *
- * function Foo() {
- * this.a = 1;
- * }
- *
- * _.isPlainObject(new Foo);
- * // => false
- *
- * _.isPlainObject([1, 2, 3]);
- * // => false
- *
- * _.isPlainObject({ 'x': 0, 'y': 0 });
- * // => true
- *
- * _.isPlainObject(Object.create(null));
- * // => true
- */
- function isPlainObject(value) {
- if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
- return false;
- }
- var proto = getPrototype(value);
- if (proto === null) {
- return true;
- }
- var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
- return typeof Ctor == 'function' && Ctor instanceof Ctor &&
- funcToString.call(Ctor) == objectCtorString;
- }
-
- /**
- * Checks if `value` is classified as a `RegExp` object.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
- * @example
- *
- * _.isRegExp(/abc/);
- * // => true
- *
- * _.isRegExp('/abc/');
- * // => false
- */
- var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;
-
- /**
- * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754
- * double precision number which isn't the result of a rounded unsafe integer.
- *
- * **Note:** This method is based on
- * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`.
- * @example
- *
- * _.isSafeInteger(3);
- * // => true
- *
- * _.isSafeInteger(Number.MIN_VALUE);
- * // => false
- *
- * _.isSafeInteger(Infinity);
- * // => false
- *
- * _.isSafeInteger('3');
- * // => false
- */
- function isSafeInteger(value) {
- return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;
- }
-
- /**
- * Checks if `value` is classified as a `Set` object.
- *
- * @static
- * @memberOf _
- * @since 4.3.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a set, else `false`.
- * @example
- *
- * _.isSet(new Set);
- * // => true
- *
- * _.isSet(new WeakSet);
- * // => false
- */
- var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
-
- /**
- * Checks if `value` is classified as a `String` primitive or object.
- *
- * @static
- * @since 0.1.0
- * @memberOf _
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a string, else `false`.
- * @example
- *
- * _.isString('abc');
- * // => true
- *
- * _.isString(1);
- * // => false
- */
- function isString(value) {
- return typeof value == 'string' ||
- (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);
- }
-
- /**
- * Checks if `value` is classified as a `Symbol` primitive or object.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
- * @example
- *
- * _.isSymbol(Symbol.iterator);
- * // => true
- *
- * _.isSymbol('abc');
- * // => false
- */
- function isSymbol(value) {
- return typeof value == 'symbol' ||
- (isObjectLike(value) && baseGetTag(value) == symbolTag);
- }
-
- /**
- * Checks if `value` is classified as a typed array.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
- * @example
- *
- * _.isTypedArray(new Uint8Array);
- * // => true
- *
- * _.isTypedArray([]);
- * // => false
- */
- var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
-
- /**
- * Checks if `value` is `undefined`.
- *
- * @static
- * @since 0.1.0
- * @memberOf _
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.
- * @example
- *
- * _.isUndefined(void 0);
- * // => true
- *
- * _.isUndefined(null);
- * // => false
- */
- function isUndefined(value) {
- return value === undefined;
- }
-
- /**
- * Checks if `value` is classified as a `WeakMap` object.
- *
- * @static
- * @memberOf _
- * @since 4.3.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a weak map, else `false`.
- * @example
- *
- * _.isWeakMap(new WeakMap);
- * // => true
- *
- * _.isWeakMap(new Map);
- * // => false
- */
- function isWeakMap(value) {
- return isObjectLike(value) && getTag(value) == weakMapTag;
- }
-
- /**
- * Checks if `value` is classified as a `WeakSet` object.
- *
- * @static
- * @memberOf _
- * @since 4.3.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a weak set, else `false`.
- * @example
- *
- * _.isWeakSet(new WeakSet);
- * // => true
- *
- * _.isWeakSet(new Set);
- * // => false
- */
- function isWeakSet(value) {
- return isObjectLike(value) && baseGetTag(value) == weakSetTag;
- }
-
- /**
- * Checks if `value` is less than `other`.
- *
- * @static
- * @memberOf _
- * @since 3.9.0
- * @category Lang
- * @param {*} value The value to compare.
- * @param {*} other The other value to compare.
- * @returns {boolean} Returns `true` if `value` is less than `other`,
- * else `false`.
- * @see _.gt
- * @example
- *
- * _.lt(1, 3);
- * // => true
- *
- * _.lt(3, 3);
- * // => false
- *
- * _.lt(3, 1);
- * // => false
- */
- var lt = createRelationalOperation(baseLt);
-
- /**
- * Checks if `value` is less than or equal to `other`.
- *
- * @static
- * @memberOf _
- * @since 3.9.0
- * @category Lang
- * @param {*} value The value to compare.
- * @param {*} other The other value to compare.
- * @returns {boolean} Returns `true` if `value` is less than or equal to
- * `other`, else `false`.
- * @see _.gte
- * @example
- *
- * _.lte(1, 3);
- * // => true
- *
- * _.lte(3, 3);
- * // => true
- *
- * _.lte(3, 1);
- * // => false
- */
- var lte = createRelationalOperation(function(value, other) {
- return value <= other;
- });
-
- /**
- * Converts `value` to an array.
- *
- * @static
- * @since 0.1.0
- * @memberOf _
- * @category Lang
- * @param {*} value The value to convert.
- * @returns {Array} Returns the converted array.
- * @example
- *
- * _.toArray({ 'a': 1, 'b': 2 });
- * // => [1, 2]
- *
- * _.toArray('abc');
- * // => ['a', 'b', 'c']
- *
- * _.toArray(1);
- * // => []
- *
- * _.toArray(null);
- * // => []
- */
- function toArray(value) {
- if (!value) {
- return [];
- }
- if (isArrayLike(value)) {
- return isString(value) ? stringToArray(value) : copyArray(value);
- }
- if (symIterator && value[symIterator]) {
- return iteratorToArray(value[symIterator]());
- }
- var tag = getTag(value),
- func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values);
-
- return func(value);
- }
-
- /**
- * Converts `value` to a finite number.
- *
- * @static
- * @memberOf _
- * @since 4.12.0
- * @category Lang
- * @param {*} value The value to convert.
- * @returns {number} Returns the converted number.
- * @example
- *
- * _.toFinite(3.2);
- * // => 3.2
- *
- * _.toFinite(Number.MIN_VALUE);
- * // => 5e-324
- *
- * _.toFinite(Infinity);
- * // => 1.7976931348623157e+308
- *
- * _.toFinite('3.2');
- * // => 3.2
- */
- function toFinite(value) {
- if (!value) {
- return value === 0 ? value : 0;
- }
- value = toNumber(value);
- if (value === INFINITY || value === -INFINITY) {
- var sign = (value < 0 ? -1 : 1);
- return sign * MAX_INTEGER;
- }
- return value === value ? value : 0;
- }
-
- /**
- * Converts `value` to an integer.
- *
- * **Note:** This method is loosely based on
- * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {*} value The value to convert.
- * @returns {number} Returns the converted integer.
- * @example
- *
- * _.toInteger(3.2);
- * // => 3
- *
- * _.toInteger(Number.MIN_VALUE);
- * // => 0
- *
- * _.toInteger(Infinity);
- * // => 1.7976931348623157e+308
- *
- * _.toInteger('3.2');
- * // => 3
- */
- function toInteger(value) {
- var result = toFinite(value),
- remainder = result % 1;
-
- return result === result ? (remainder ? result - remainder : result) : 0;
- }
-
- /**
- * Converts `value` to an integer suitable for use as the length of an
- * array-like object.
- *
- * **Note:** This method is based on
- * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {*} value The value to convert.
- * @returns {number} Returns the converted integer.
- * @example
- *
- * _.toLength(3.2);
- * // => 3
- *
- * _.toLength(Number.MIN_VALUE);
- * // => 0
- *
- * _.toLength(Infinity);
- * // => 4294967295
- *
- * _.toLength('3.2');
- * // => 3
- */
- function toLength(value) {
- return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0;
- }
-
- /**
- * Converts `value` to a number.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {*} value The value to process.
- * @returns {number} Returns the number.
- * @example
- *
- * _.toNumber(3.2);
- * // => 3.2
- *
- * _.toNumber(Number.MIN_VALUE);
- * // => 5e-324
- *
- * _.toNumber(Infinity);
- * // => Infinity
- *
- * _.toNumber('3.2');
- * // => 3.2
- */
- function toNumber(value) {
- if (typeof value == 'number') {
- return value;
- }
- if (isSymbol(value)) {
- return NAN;
- }
- if (isObject(value)) {
- var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
- value = isObject(other) ? (other + '') : other;
- }
- if (typeof value != 'string') {
- return value === 0 ? value : +value;
- }
- value = value.replace(reTrim, '');
- var isBinary = reIsBinary.test(value);
- return (isBinary || reIsOctal.test(value))
- ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
- : (reIsBadHex.test(value) ? NAN : +value);
- }
-
- /**
- * Converts `value` to a plain object flattening inherited enumerable string
- * keyed properties of `value` to own properties of the plain object.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Lang
- * @param {*} value The value to convert.
- * @returns {Object} Returns the converted plain object.
- * @example
- *
- * function Foo() {
- * this.b = 2;
- * }
- *
- * Foo.prototype.c = 3;
- *
- * _.assign({ 'a': 1 }, new Foo);
- * // => { 'a': 1, 'b': 2 }
- *
- * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
- * // => { 'a': 1, 'b': 2, 'c': 3 }
- */
- function toPlainObject(value) {
- return copyObject(value, keysIn(value));
- }
-
- /**
- * Converts `value` to a safe integer. A safe integer can be compared and
- * represented correctly.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {*} value The value to convert.
- * @returns {number} Returns the converted integer.
- * @example
- *
- * _.toSafeInteger(3.2);
- * // => 3
- *
- * _.toSafeInteger(Number.MIN_VALUE);
- * // => 0
- *
- * _.toSafeInteger(Infinity);
- * // => 9007199254740991
- *
- * _.toSafeInteger('3.2');
- * // => 3
- */
- function toSafeInteger(value) {
- return value
- ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER)
- : (value === 0 ? value : 0);
- }
-
- /**
- * Converts `value` to a string. An empty string is returned for `null`
- * and `undefined` values. The sign of `-0` is preserved.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {*} value The value to convert.
- * @returns {string} Returns the converted string.
- * @example
- *
- * _.toString(null);
- * // => ''
- *
- * _.toString(-0);
- * // => '-0'
- *
- * _.toString([1, 2, 3]);
- * // => '1,2,3'
- */
- function toString(value) {
- return value == null ? '' : baseToString(value);
- }
-
- /*------------------------------------------------------------------------*/
-
- /**
- * Assigns own enumerable string keyed properties of source objects to the
- * destination object. Source objects are applied from left to right.
- * Subsequent sources overwrite property assignments of previous sources.
- *
- * **Note:** This method mutates `object` and is loosely based on
- * [`Object.assign`](https://mdn.io/Object/assign).
- *
- * @static
- * @memberOf _
- * @since 0.10.0
- * @category Object
- * @param {Object} object The destination object.
- * @param {...Object} [sources] The source objects.
- * @returns {Object} Returns `object`.
- * @see _.assignIn
- * @example
- *
- * function Foo() {
- * this.a = 1;
- * }
- *
- * function Bar() {
- * this.c = 3;
- * }
- *
- * Foo.prototype.b = 2;
- * Bar.prototype.d = 4;
- *
- * _.assign({ 'a': 0 }, new Foo, new Bar);
- * // => { 'a': 1, 'c': 3 }
- */
- var assign = createAssigner(function(object, source) {
- if (isPrototype(source) || isArrayLike(source)) {
- copyObject(source, keys(source), object);
- return;
- }
- for (var key in source) {
- if (hasOwnProperty.call(source, key)) {
- assignValue(object, key, source[key]);
- }
- }
- });
-
- /**
- * This method is like `_.assign` except that it iterates over own and
- * inherited source properties.
- *
- * **Note:** This method mutates `object`.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @alias extend
- * @category Object
- * @param {Object} object The destination object.
- * @param {...Object} [sources] The source objects.
- * @returns {Object} Returns `object`.
- * @see _.assign
- * @example
- *
- * function Foo() {
- * this.a = 1;
- * }
- *
- * function Bar() {
- * this.c = 3;
- * }
- *
- * Foo.prototype.b = 2;
- * Bar.prototype.d = 4;
- *
- * _.assignIn({ 'a': 0 }, new Foo, new Bar);
- * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }
- */
- var assignIn = createAssigner(function(object, source) {
- copyObject(source, keysIn(source), object);
- });
-
- /**
- * This method is like `_.assignIn` except that it accepts `customizer`
- * which is invoked to produce the assigned values. If `customizer` returns
- * `undefined`, assignment is handled by the method instead. The `customizer`
- * is invoked with five arguments: (objValue, srcValue, key, object, source).
- *
- * **Note:** This method mutates `object`.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @alias extendWith
- * @category Object
- * @param {Object} object The destination object.
- * @param {...Object} sources The source objects.
- * @param {Function} [customizer] The function to customize assigned values.
- * @returns {Object} Returns `object`.
- * @see _.assignWith
- * @example
- *
- * function customizer(objValue, srcValue) {
- * return _.isUndefined(objValue) ? srcValue : objValue;
- * }
- *
- * var defaults = _.partialRight(_.assignInWith, customizer);
- *
- * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
- * // => { 'a': 1, 'b': 2 }
- */
- var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {
- copyObject(source, keysIn(source), object, customizer);
- });
-
- /**
- * This method is like `_.assign` except that it accepts `customizer`
- * which is invoked to produce the assigned values. If `customizer` returns
- * `undefined`, assignment is handled by the method instead. The `customizer`
- * is invoked with five arguments: (objValue, srcValue, key, object, source).
- *
- * **Note:** This method mutates `object`.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Object
- * @param {Object} object The destination object.
- * @param {...Object} sources The source objects.
- * @param {Function} [customizer] The function to customize assigned values.
- * @returns {Object} Returns `object`.
- * @see _.assignInWith
- * @example
- *
- * function customizer(objValue, srcValue) {
- * return _.isUndefined(objValue) ? srcValue : objValue;
- * }
- *
- * var defaults = _.partialRight(_.assignWith, customizer);
- *
- * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
- * // => { 'a': 1, 'b': 2 }
- */
- var assignWith = createAssigner(function(object, source, srcIndex, customizer) {
- copyObject(source, keys(source), object, customizer);
- });
-
- /**
- * Creates an array of values corresponding to `paths` of `object`.
- *
- * @static
- * @memberOf _
- * @since 1.0.0
- * @category Object
- * @param {Object} object The object to iterate over.
- * @param {...(string|string[])} [paths] The property paths to pick.
- * @returns {Array} Returns the picked values.
- * @example
- *
- * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
- *
- * _.at(object, ['a[0].b.c', 'a[1]']);
- * // => [3, 4]
- */
- var at = flatRest(baseAt);
-
- /**
- * Creates an object that inherits from the `prototype` object. If a
- * `properties` object is given, its own enumerable string keyed properties
- * are assigned to the created object.
- *
- * @static
- * @memberOf _
- * @since 2.3.0
- * @category Object
- * @param {Object} prototype The object to inherit from.
- * @param {Object} [properties] The properties to assign to the object.
- * @returns {Object} Returns the new object.
- * @example
- *
- * function Shape() {
- * this.x = 0;
- * this.y = 0;
- * }
- *
- * function Circle() {
- * Shape.call(this);
- * }
- *
- * Circle.prototype = _.create(Shape.prototype, {
- * 'constructor': Circle
- * });
- *
- * var circle = new Circle;
- * circle instanceof Circle;
- * // => true
- *
- * circle instanceof Shape;
- * // => true
- */
- function create(prototype, properties) {
- var result = baseCreate(prototype);
- return properties == null ? result : baseAssign(result, properties);
- }
-
- /**
- * Assigns own and inherited enumerable string keyed properties of source
- * objects to the destination object for all destination properties that
- * resolve to `undefined`. Source objects are applied from left to right.
- * Once a property is set, additional values of the same property are ignored.
- *
- * **Note:** This method mutates `object`.
- *
- * @static
- * @since 0.1.0
- * @memberOf _
- * @category Object
- * @param {Object} object The destination object.
- * @param {...Object} [sources] The source objects.
- * @returns {Object} Returns `object`.
- * @see _.defaultsDeep
- * @example
- *
- * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
- * // => { 'a': 1, 'b': 2 }
- */
- var defaults = baseRest(function(args) {
- args.push(undefined, customDefaultsAssignIn);
- return apply(assignInWith, undefined, args);
- });
-
- /**
- * This method is like `_.defaults` except that it recursively assigns
- * default properties.
- *
- * **Note:** This method mutates `object`.
- *
- * @static
- * @memberOf _
- * @since 3.10.0
- * @category Object
- * @param {Object} object The destination object.
- * @param {...Object} [sources] The source objects.
- * @returns {Object} Returns `object`.
- * @see _.defaults
- * @example
- *
- * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });
- * // => { 'a': { 'b': 2, 'c': 3 } }
- */
- var defaultsDeep = baseRest(function(args) {
- args.push(undefined, customDefaultsMerge);
- return apply(mergeWith, undefined, args);
- });
-
- /**
- * This method is like `_.find` except that it returns the key of the first
- * element `predicate` returns truthy for instead of the element itself.
- *
- * @static
- * @memberOf _
- * @since 1.1.0
- * @category Object
- * @param {Object} object The object to inspect.
- * @param {Function} [predicate=_.identity] The function invoked per iteration.
- * @returns {string|undefined} Returns the key of the matched element,
- * else `undefined`.
- * @example
- *
- * var users = {
- * 'barney': { 'age': 36, 'active': true },
- * 'fred': { 'age': 40, 'active': false },
- * 'pebbles': { 'age': 1, 'active': true }
- * };
- *
- * _.findKey(users, function(o) { return o.age < 40; });
- * // => 'barney' (iteration order is not guaranteed)
- *
- * // The `_.matches` iteratee shorthand.
- * _.findKey(users, { 'age': 1, 'active': true });
- * // => 'pebbles'
- *
- * // The `_.matchesProperty` iteratee shorthand.
- * _.findKey(users, ['active', false]);
- * // => 'fred'
- *
- * // The `_.property` iteratee shorthand.
- * _.findKey(users, 'active');
- * // => 'barney'
- */
- function findKey(object, predicate) {
- return baseFindKey(object, getIteratee(predicate, 3), baseForOwn);
- }
-
- /**
- * This method is like `_.findKey` except that it iterates over elements of
- * a collection in the opposite order.
- *
- * @static
- * @memberOf _
- * @since 2.0.0
- * @category Object
- * @param {Object} object The object to inspect.
- * @param {Function} [predicate=_.identity] The function invoked per iteration.
- * @returns {string|undefined} Returns the key of the matched element,
- * else `undefined`.
- * @example
- *
- * var users = {
- * 'barney': { 'age': 36, 'active': true },
- * 'fred': { 'age': 40, 'active': false },
- * 'pebbles': { 'age': 1, 'active': true }
- * };
- *
- * _.findLastKey(users, function(o) { return o.age < 40; });
- * // => returns 'pebbles' assuming `_.findKey` returns 'barney'
- *
- * // The `_.matches` iteratee shorthand.
- * _.findLastKey(users, { 'age': 36, 'active': true });
- * // => 'barney'
- *
- * // The `_.matchesProperty` iteratee shorthand.
- * _.findLastKey(users, ['active', false]);
- * // => 'fred'
- *
- * // The `_.property` iteratee shorthand.
- * _.findLastKey(users, 'active');
- * // => 'pebbles'
- */
- function findLastKey(object, predicate) {
- return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight);
- }
-
- /**
- * Iterates over own and inherited enumerable string keyed properties of an
- * object and invokes `iteratee` for each property. The iteratee is invoked
- * with three arguments: (value, key, object). Iteratee functions may exit
- * iteration early by explicitly returning `false`.
- *
- * @static
- * @memberOf _
- * @since 0.3.0
- * @category Object
- * @param {Object} object The object to iterate over.
- * @param {Function} [iteratee=_.identity] The function invoked per iteration.
- * @returns {Object} Returns `object`.
- * @see _.forInRight
- * @example
- *
- * function Foo() {
- * this.a = 1;
- * this.b = 2;
- * }
- *
- * Foo.prototype.c = 3;
- *
- * _.forIn(new Foo, function(value, key) {
- * console.log(key);
- * });
- * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).
- */
- function forIn(object, iteratee) {
- return object == null
- ? object
- : baseFor(object, getIteratee(iteratee, 3), keysIn);
- }
-
- /**
- * This method is like `_.forIn` except that it iterates over properties of
- * `object` in the opposite order.
- *
- * @static
- * @memberOf _
- * @since 2.0.0
- * @category Object
- * @param {Object} object The object to iterate over.
- * @param {Function} [iteratee=_.identity] The function invoked per iteration.
- * @returns {Object} Returns `object`.
- * @see _.forIn
- * @example
- *
- * function Foo() {
- * this.a = 1;
- * this.b = 2;
- * }
- *
- * Foo.prototype.c = 3;
- *
- * _.forInRight(new Foo, function(value, key) {
- * console.log(key);
- * });
- * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'.
- */
- function forInRight(object, iteratee) {
- return object == null
- ? object
- : baseForRight(object, getIteratee(iteratee, 3), keysIn);
- }
-
- /**
- * Iterates over own enumerable string keyed properties of an object and
- * invokes `iteratee` for each property. The iteratee is invoked with three
- * arguments: (value, key, object). Iteratee functions may exit iteration
- * early by explicitly returning `false`.
- *
- * @static
- * @memberOf _
- * @since 0.3.0
- * @category Object
- * @param {Object} object The object to iterate over.
- * @param {Function} [iteratee=_.identity] The function invoked per iteration.
- * @returns {Object} Returns `object`.
- * @see _.forOwnRight
- * @example
- *
- * function Foo() {
- * this.a = 1;
- * this.b = 2;
- * }
- *
- * Foo.prototype.c = 3;
- *
- * _.forOwn(new Foo, function(value, key) {
- * console.log(key);
- * });
- * // => Logs 'a' then 'b' (iteration order is not guaranteed).
- */
- function forOwn(object, iteratee) {
- return object && baseForOwn(object, getIteratee(iteratee, 3));
- }
-
- /**
- * This method is like `_.forOwn` except that it iterates over properties of
- * `object` in the opposite order.
- *
- * @static
- * @memberOf _
- * @since 2.0.0
- * @category Object
- * @param {Object} object The object to iterate over.
- * @param {Function} [iteratee=_.identity] The function invoked per iteration.
- * @returns {Object} Returns `object`.
- * @see _.forOwn
- * @example
- *
- * function Foo() {
- * this.a = 1;
- * this.b = 2;
- * }
- *
- * Foo.prototype.c = 3;
- *
- * _.forOwnRight(new Foo, function(value, key) {
- * console.log(key);
- * });
- * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'.
- */
- function forOwnRight(object, iteratee) {
- return object && baseForOwnRight(object, getIteratee(iteratee, 3));
- }
-
- /**
- * Creates an array of function property names from own enumerable properties
- * of `object`.
- *
- * @static
- * @since 0.1.0
- * @memberOf _
- * @category Object
- * @param {Object} object The object to inspect.
- * @returns {Array} Returns the function names.
- * @see _.functionsIn
- * @example
- *
- * function Foo() {
- * this.a = _.constant('a');
- * this.b = _.constant('b');
- * }
- *
- * Foo.prototype.c = _.constant('c');
- *
- * _.functions(new Foo);
- * // => ['a', 'b']
- */
- function functions(object) {
- return object == null ? [] : baseFunctions(object, keys(object));
- }
-
- /**
- * Creates an array of function property names from own and inherited
- * enumerable properties of `object`.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Object
- * @param {Object} object The object to inspect.
- * @returns {Array} Returns the function names.
- * @see _.functions
- * @example
- *
- * function Foo() {
- * this.a = _.constant('a');
- * this.b = _.constant('b');
- * }
- *
- * Foo.prototype.c = _.constant('c');
- *
- * _.functionsIn(new Foo);
- * // => ['a', 'b', 'c']
- */
- function functionsIn(object) {
- return object == null ? [] : baseFunctions(object, keysIn(object));
- }
-
- /**
- * Gets the value at `path` of `object`. If the resolved value is
- * `undefined`, the `defaultValue` is returned in its place.
- *
- * @static
- * @memberOf _
- * @since 3.7.0
- * @category Object
- * @param {Object} object The object to query.
- * @param {Array|string} path The path of the property to get.
- * @param {*} [defaultValue] The value returned for `undefined` resolved values.
- * @returns {*} Returns the resolved value.
- * @example
- *
- * var object = { 'a': [{ 'b': { 'c': 3 } }] };
- *
- * _.get(object, 'a[0].b.c');
- * // => 3
- *
- * _.get(object, ['a', '0', 'b', 'c']);
- * // => 3
- *
- * _.get(object, 'a.b.c', 'default');
- * // => 'default'
- */
- function get(object, path, defaultValue) {
- var result = object == null ? undefined : baseGet(object, path);
- return result === undefined ? defaultValue : result;
- }
-
- /**
- * Checks if `path` is a direct property of `object`.
- *
- * @static
- * @since 0.1.0
- * @memberOf _
- * @category Object
- * @param {Object} object The object to query.
- * @param {Array|string} path The path to check.
- * @returns {boolean} Returns `true` if `path` exists, else `false`.
- * @example
- *
- * var object = { 'a': { 'b': 2 } };
- * var other = _.create({ 'a': _.create({ 'b': 2 }) });
- *
- * _.has(object, 'a');
- * // => true
- *
- * _.has(object, 'a.b');
- * // => true
- *
- * _.has(object, ['a', 'b']);
- * // => true
- *
- * _.has(other, 'a');
- * // => false
- */
- function has(object, path) {
- return object != null && hasPath(object, path, baseHas);
- }
-
- /**
- * Checks if `path` is a direct or inherited property of `object`.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Object
- * @param {Object} object The object to query.
- * @param {Array|string} path The path to check.
- * @returns {boolean} Returns `true` if `path` exists, else `false`.
- * @example
- *
- * var object = _.create({ 'a': _.create({ 'b': 2 }) });
- *
- * _.hasIn(object, 'a');
- * // => true
- *
- * _.hasIn(object, 'a.b');
- * // => true
- *
- * _.hasIn(object, ['a', 'b']);
- * // => true
- *
- * _.hasIn(object, 'b');
- * // => false
- */
- function hasIn(object, path) {
- return object != null && hasPath(object, path, baseHasIn);
- }
-
- /**
- * Creates an object composed of the inverted keys and values of `object`.
- * If `object` contains duplicate values, subsequent values overwrite
- * property assignments of previous values.
- *
- * @static
- * @memberOf _
- * @since 0.7.0
- * @category Object
- * @param {Object} object The object to invert.
- * @returns {Object} Returns the new inverted object.
- * @example
- *
- * var object = { 'a': 1, 'b': 2, 'c': 1 };
- *
- * _.invert(object);
- * // => { '1': 'c', '2': 'b' }
- */
- var invert = createInverter(function(result, value, key) {
- result[value] = key;
- }, constant(identity));
-
- /**
- * This method is like `_.invert` except that the inverted object is generated
- * from the results of running each element of `object` thru `iteratee`. The
- * corresponding inverted value of each inverted key is an array of keys
- * responsible for generating the inverted value. The iteratee is invoked
- * with one argument: (value).
- *
- * @static
- * @memberOf _
- * @since 4.1.0
- * @category Object
- * @param {Object} object The object to invert.
- * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
- * @returns {Object} Returns the new inverted object.
- * @example
- *
- * var object = { 'a': 1, 'b': 2, 'c': 1 };
- *
- * _.invertBy(object);
- * // => { '1': ['a', 'c'], '2': ['b'] }
- *
- * _.invertBy(object, function(value) {
- * return 'group' + value;
- * });
- * // => { 'group1': ['a', 'c'], 'group2': ['b'] }
- */
- var invertBy = createInverter(function(result, value, key) {
- if (hasOwnProperty.call(result, value)) {
- result[value].push(key);
- } else {
- result[value] = [key];
- }
- }, getIteratee);
-
- /**
- * Invokes the method at `path` of `object`.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Object
- * @param {Object} object The object to query.
- * @param {Array|string} path The path of the method to invoke.
- * @param {...*} [args] The arguments to invoke the method with.
- * @returns {*} Returns the result of the invoked method.
- * @example
- *
- * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };
- *
- * _.invoke(object, 'a[0].b.c.slice', 1, 3);
- * // => [2, 3]
- */
- var invoke = baseRest(baseInvoke);
-
- /**
- * Creates an array of the own enumerable property names of `object`.
- *
- * **Note:** Non-object values are coerced to objects. See the
- * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
- * for more details.
- *
- * @static
- * @since 0.1.0
- * @memberOf _
- * @category Object
- * @param {Object} object The object to query.
- * @returns {Array} Returns the array of property names.
- * @example
- *
- * function Foo() {
- * this.a = 1;
- * this.b = 2;
- * }
- *
- * Foo.prototype.c = 3;
- *
- * _.keys(new Foo);
- * // => ['a', 'b'] (iteration order is not guaranteed)
- *
- * _.keys('hi');
- * // => ['0', '1']
- */
- function keys(object) {
- return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
- }
-
- /**
- * Creates an array of the own and inherited enumerable property names of `object`.
- *
- * **Note:** Non-object values are coerced to objects.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Object
- * @param {Object} object The object to query.
- * @returns {Array} Returns the array of property names.
- * @example
- *
- * function Foo() {
- * this.a = 1;
- * this.b = 2;
- * }
- *
- * Foo.prototype.c = 3;
- *
- * _.keysIn(new Foo);
- * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
- */
- function keysIn(object) {
- return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
- }
-
- /**
- * The opposite of `_.mapValues`; this method creates an object with the
- * same values as `object` and keys generated by running each own enumerable
- * string keyed property of `object` thru `iteratee`. The iteratee is invoked
- * with three arguments: (value, key, object).
- *
- * @static
- * @memberOf _
- * @since 3.8.0
- * @category Object
- * @param {Object} object The object to iterate over.
- * @param {Function} [iteratee=_.identity] The function invoked per iteration.
- * @returns {Object} Returns the new mapped object.
- * @see _.mapValues
- * @example
- *
- * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {
- * return key + value;
- * });
- * // => { 'a1': 1, 'b2': 2 }
- */
- function mapKeys(object, iteratee) {
- var result = {};
- iteratee = getIteratee(iteratee, 3);
-
- baseForOwn(object, function(value, key, object) {
- baseAssignValue(result, iteratee(value, key, object), value);
- });
- return result;
- }
-
- /**
- * Creates an object with the same keys as `object` and values generated
- * by running each own enumerable string keyed property of `object` thru
- * `iteratee`. The iteratee is invoked with three arguments:
- * (value, key, object).
- *
- * @static
- * @memberOf _
- * @since 2.4.0
- * @category Object
- * @param {Object} object The object to iterate over.
- * @param {Function} [iteratee=_.identity] The function invoked per iteration.
- * @returns {Object} Returns the new mapped object.
- * @see _.mapKeys
- * @example
- *
- * var users = {
- * 'fred': { 'user': 'fred', 'age': 40 },
- * 'pebbles': { 'user': 'pebbles', 'age': 1 }
- * };
- *
- * _.mapValues(users, function(o) { return o.age; });
- * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
- *
- * // The `_.property` iteratee shorthand.
- * _.mapValues(users, 'age');
- * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
- */
- function mapValues(object, iteratee) {
- var result = {};
- iteratee = getIteratee(iteratee, 3);
-
- baseForOwn(object, function(value, key, object) {
- baseAssignValue(result, key, iteratee(value, key, object));
- });
- return result;
- }
-
- /**
- * This method is like `_.assign` except that it recursively merges own and
- * inherited enumerable string keyed properties of source objects into the
- * destination object. Source properties that resolve to `undefined` are
- * skipped if a destination value exists. Array and plain object properties
- * are merged recursively. Other objects and value types are overridden by
- * assignment. Source objects are applied from left to right. Subsequent
- * sources overwrite property assignments of previous sources.
- *
- * **Note:** This method mutates `object`.
- *
- * @static
- * @memberOf _
- * @since 0.5.0
- * @category Object
- * @param {Object} object The destination object.
- * @param {...Object} [sources] The source objects.
- * @returns {Object} Returns `object`.
- * @example
- *
- * var object = {
- * 'a': [{ 'b': 2 }, { 'd': 4 }]
- * };
- *
- * var other = {
- * 'a': [{ 'c': 3 }, { 'e': 5 }]
- * };
- *
- * _.merge(object, other);
- * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }
- */
- var merge = createAssigner(function(object, source, srcIndex) {
- baseMerge(object, source, srcIndex);
- });
-
- /**
- * This method is like `_.merge` except that it accepts `customizer` which
- * is invoked to produce the merged values of the destination and source
- * properties. If `customizer` returns `undefined`, merging is handled by the
- * method instead. The `customizer` is invoked with six arguments:
- * (objValue, srcValue, key, object, source, stack).
- *
- * **Note:** This method mutates `object`.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Object
- * @param {Object} object The destination object.
- * @param {...Object} sources The source objects.
- * @param {Function} customizer The function to customize assigned values.
- * @returns {Object} Returns `object`.
- * @example
- *
- * function customizer(objValue, srcValue) {
- * if (_.isArray(objValue)) {
- * return objValue.concat(srcValue);
- * }
- * }
- *
- * var object = { 'a': [1], 'b': [2] };
- * var other = { 'a': [3], 'b': [4] };
- *
- * _.mergeWith(object, other, customizer);
- * // => { 'a': [1, 3], 'b': [2, 4] }
- */
- var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {
- baseMerge(object, source, srcIndex, customizer);
- });
-
- /**
- * The opposite of `_.pick`; this method creates an object composed of the
- * own and inherited enumerable property paths of `object` that are not omitted.
- *
- * **Note:** This method is considerably slower than `_.pick`.
- *
- * @static
- * @since 0.1.0
- * @memberOf _
- * @category Object
- * @param {Object} object The source object.
- * @param {...(string|string[])} [paths] The property paths to omit.
- * @returns {Object} Returns the new object.
- * @example
- *
- * var object = { 'a': 1, 'b': '2', 'c': 3 };
- *
- * _.omit(object, ['a', 'c']);
- * // => { 'b': '2' }
- */
- var omit = flatRest(function(object, paths) {
- var result = {};
- if (object == null) {
- return result;
- }
- var isDeep = false;
- paths = arrayMap(paths, function(path) {
- path = castPath(path, object);
- isDeep || (isDeep = path.length > 1);
- return path;
- });
- copyObject(object, getAllKeysIn(object), result);
- if (isDeep) {
- result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);
- }
- var length = paths.length;
- while (length--) {
- baseUnset(result, paths[length]);
- }
- return result;
- });
-
- /**
- * The opposite of `_.pickBy`; this method creates an object composed of
- * the own and inherited enumerable string keyed properties of `object` that
- * `predicate` doesn't return truthy for. The predicate is invoked with two
- * arguments: (value, key).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Object
- * @param {Object} object The source object.
- * @param {Function} [predicate=_.identity] The function invoked per property.
- * @returns {Object} Returns the new object.
- * @example
- *
- * var object = { 'a': 1, 'b': '2', 'c': 3 };
- *
- * _.omitBy(object, _.isNumber);
- * // => { 'b': '2' }
- */
- function omitBy(object, predicate) {
- return pickBy(object, negate(getIteratee(predicate)));
- }
-
- /**
- * Creates an object composed of the picked `object` properties.
- *
- * @static
- * @since 0.1.0
- * @memberOf _
- * @category Object
- * @param {Object} object The source object.
- * @param {...(string|string[])} [paths] The property paths to pick.
- * @returns {Object} Returns the new object.
- * @example
- *
- * var object = { 'a': 1, 'b': '2', 'c': 3 };
- *
- * _.pick(object, ['a', 'c']);
- * // => { 'a': 1, 'c': 3 }
- */
- var pick = flatRest(function(object, paths) {
- return object == null ? {} : basePick(object, paths);
- });
-
- /**
- * Creates an object composed of the `object` properties `predicate` returns
- * truthy for. The predicate is invoked with two arguments: (value, key).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Object
- * @param {Object} object The source object.
- * @param {Function} [predicate=_.identity] The function invoked per property.
- * @returns {Object} Returns the new object.
- * @example
- *
- * var object = { 'a': 1, 'b': '2', 'c': 3 };
- *
- * _.pickBy(object, _.isNumber);
- * // => { 'a': 1, 'c': 3 }
- */
- function pickBy(object, predicate) {
- if (object == null) {
- return {};
- }
- var props = arrayMap(getAllKeysIn(object), function(prop) {
- return [prop];
- });
- predicate = getIteratee(predicate);
- return basePickBy(object, props, function(value, path) {
- return predicate(value, path[0]);
- });
- }
-
- /**
- * This method is like `_.get` except that if the resolved value is a
- * function it's invoked with the `this` binding of its parent object and
- * its result is returned.
- *
- * @static
- * @since 0.1.0
- * @memberOf _
- * @category Object
- * @param {Object} object The object to query.
- * @param {Array|string} path The path of the property to resolve.
- * @param {*} [defaultValue] The value returned for `undefined` resolved values.
- * @returns {*} Returns the resolved value.
- * @example
- *
- * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };
- *
- * _.result(object, 'a[0].b.c1');
- * // => 3
- *
- * _.result(object, 'a[0].b.c2');
- * // => 4
- *
- * _.result(object, 'a[0].b.c3', 'default');
- * // => 'default'
- *
- * _.result(object, 'a[0].b.c3', _.constant('default'));
- * // => 'default'
- */
- function result(object, path, defaultValue) {
- path = castPath(path, object);
-
- var index = -1,
- length = path.length;
-
- // Ensure the loop is entered when path is empty.
- if (!length) {
- length = 1;
- object = undefined;
- }
- while (++index < length) {
- var value = object == null ? undefined : object[toKey(path[index])];
- if (value === undefined) {
- index = length;
- value = defaultValue;
- }
- object = isFunction(value) ? value.call(object) : value;
- }
- return object;
- }
-
- /**
- * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
- * it's created. Arrays are created for missing index properties while objects
- * are created for all other missing properties. Use `_.setWith` to customize
- * `path` creation.
- *
- * **Note:** This method mutates `object`.
- *
- * @static
- * @memberOf _
- * @since 3.7.0
- * @category Object
- * @param {Object} object The object to modify.
- * @param {Array|string} path The path of the property to set.
- * @param {*} value The value to set.
- * @returns {Object} Returns `object`.
- * @example
- *
- * var object = { 'a': [{ 'b': { 'c': 3 } }] };
- *
- * _.set(object, 'a[0].b.c', 4);
- * console.log(object.a[0].b.c);
- * // => 4
- *
- * _.set(object, ['x', '0', 'y', 'z'], 5);
- * console.log(object.x[0].y.z);
- * // => 5
- */
- function set(object, path, value) {
- return object == null ? object : baseSet(object, path, value);
- }
-
- /**
- * This method is like `_.set` except that it accepts `customizer` which is
- * invoked to produce the objects of `path`. If `customizer` returns `undefined`
- * path creation is handled by the method instead. The `customizer` is invoked
- * with three arguments: (nsValue, key, nsObject).
- *
- * **Note:** This method mutates `object`.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Object
- * @param {Object} object The object to modify.
- * @param {Array|string} path The path of the property to set.
- * @param {*} value The value to set.
- * @param {Function} [customizer] The function to customize assigned values.
- * @returns {Object} Returns `object`.
- * @example
- *
- * var object = {};
- *
- * _.setWith(object, '[0][1]', 'a', Object);
- * // => { '0': { '1': 'a' } }
- */
- function setWith(object, path, value, customizer) {
- customizer = typeof customizer == 'function' ? customizer : undefined;
- return object == null ? object : baseSet(object, path, value, customizer);
- }
-
- /**
- * Creates an array of own enumerable string keyed-value pairs for `object`
- * which can be consumed by `_.fromPairs`. If `object` is a map or set, its
- * entries are returned.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @alias entries
- * @category Object
- * @param {Object} object The object to query.
- * @returns {Array} Returns the key-value pairs.
- * @example
- *
- * function Foo() {
- * this.a = 1;
- * this.b = 2;
- * }
- *
- * Foo.prototype.c = 3;
- *
- * _.toPairs(new Foo);
- * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)
- */
- var toPairs = createToPairs(keys);
-
- /**
- * Creates an array of own and inherited enumerable string keyed-value pairs
- * for `object` which can be consumed by `_.fromPairs`. If `object` is a map
- * or set, its entries are returned.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @alias entriesIn
- * @category Object
- * @param {Object} object The object to query.
- * @returns {Array} Returns the key-value pairs.
- * @example
- *
- * function Foo() {
- * this.a = 1;
- * this.b = 2;
- * }
- *
- * Foo.prototype.c = 3;
- *
- * _.toPairsIn(new Foo);
- * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed)
- */
- var toPairsIn = createToPairs(keysIn);
-
- /**
- * An alternative to `_.reduce`; this method transforms `object` to a new
- * `accumulator` object which is the result of running each of its own
- * enumerable string keyed properties thru `iteratee`, with each invocation
- * potentially mutating the `accumulator` object. If `accumulator` is not
- * provided, a new object with the same `[[Prototype]]` will be used. The
- * iteratee is invoked with four arguments: (accumulator, value, key, object).
- * Iteratee functions may exit iteration early by explicitly returning `false`.
- *
- * @static
- * @memberOf _
- * @since 1.3.0
- * @category Object
- * @param {Object} object The object to iterate over.
- * @param {Function} [iteratee=_.identity] The function invoked per iteration.
- * @param {*} [accumulator] The custom accumulator value.
- * @returns {*} Returns the accumulated value.
- * @example
- *
- * _.transform([2, 3, 4], function(result, n) {
- * result.push(n *= n);
- * return n % 2 == 0;
- * }, []);
- * // => [4, 9]
- *
- * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
- * (result[value] || (result[value] = [])).push(key);
- * }, {});
- * // => { '1': ['a', 'c'], '2': ['b'] }
- */
- function transform(object, iteratee, accumulator) {
- var isArr = isArray(object),
- isArrLike = isArr || isBuffer(object) || isTypedArray(object);
-
- iteratee = getIteratee(iteratee, 4);
- if (accumulator == null) {
- var Ctor = object && object.constructor;
- if (isArrLike) {
- accumulator = isArr ? new Ctor : [];
- }
- else if (isObject(object)) {
- accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};
- }
- else {
- accumulator = {};
- }
- }
- (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) {
- return iteratee(accumulator, value, index, object);
- });
- return accumulator;
- }
-
- /**
- * Removes the property at `path` of `object`.
- *
- * **Note:** This method mutates `object`.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Object
- * @param {Object} object The object to modify.
- * @param {Array|string} path The path of the property to unset.
- * @returns {boolean} Returns `true` if the property is deleted, else `false`.
- * @example
- *
- * var object = { 'a': [{ 'b': { 'c': 7 } }] };
- * _.unset(object, 'a[0].b.c');
- * // => true
- *
- * console.log(object);
- * // => { 'a': [{ 'b': {} }] };
- *
- * _.unset(object, ['a', '0', 'b', 'c']);
- * // => true
- *
- * console.log(object);
- * // => { 'a': [{ 'b': {} }] };
- */
- function unset(object, path) {
- return object == null ? true : baseUnset(object, path);
- }
-
- /**
- * This method is like `_.set` except that accepts `updater` to produce the
- * value to set. Use `_.updateWith` to customize `path` creation. The `updater`
- * is invoked with one argument: (value).
- *
- * **Note:** This method mutates `object`.
- *
- * @static
- * @memberOf _
- * @since 4.6.0
- * @category Object
- * @param {Object} object The object to modify.
- * @param {Array|string} path The path of the property to set.
- * @param {Function} updater The function to produce the updated value.
- * @returns {Object} Returns `object`.
- * @example
- *
- * var object = { 'a': [{ 'b': { 'c': 3 } }] };
- *
- * _.update(object, 'a[0].b.c', function(n) { return n * n; });
- * console.log(object.a[0].b.c);
- * // => 9
- *
- * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; });
- * console.log(object.x[0].y.z);
- * // => 0
- */
- function update(object, path, updater) {
- return object == null ? object : baseUpdate(object, path, castFunction(updater));
- }
-
- /**
- * This method is like `_.update` except that it accepts `customizer` which is
- * invoked to produce the objects of `path`. If `customizer` returns `undefined`
- * path creation is handled by the method instead. The `customizer` is invoked
- * with three arguments: (nsValue, key, nsObject).
- *
- * **Note:** This method mutates `object`.
- *
- * @static
- * @memberOf _
- * @since 4.6.0
- * @category Object
- * @param {Object} object The object to modify.
- * @param {Array|string} path The path of the property to set.
- * @param {Function} updater The function to produce the updated value.
- * @param {Function} [customizer] The function to customize assigned values.
- * @returns {Object} Returns `object`.
- * @example
- *
- * var object = {};
- *
- * _.updateWith(object, '[0][1]', _.constant('a'), Object);
- * // => { '0': { '1': 'a' } }
- */
- function updateWith(object, path, updater, customizer) {
- customizer = typeof customizer == 'function' ? customizer : undefined;
- return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);
- }
-
- /**
- * Creates an array of the own enumerable string keyed property values of `object`.
- *
- * **Note:** Non-object values are coerced to objects.
- *
- * @static
- * @since 0.1.0
- * @memberOf _
- * @category Object
- * @param {Object} object The object to query.
- * @returns {Array} Returns the array of property values.
- * @example
- *
- * function Foo() {
- * this.a = 1;
- * this.b = 2;
- * }
- *
- * Foo.prototype.c = 3;
- *
- * _.values(new Foo);
- * // => [1, 2] (iteration order is not guaranteed)
- *
- * _.values('hi');
- * // => ['h', 'i']
- */
- function values(object) {
- return object == null ? [] : baseValues(object, keys(object));
- }
-
- /**
- * Creates an array of the own and inherited enumerable string keyed property
- * values of `object`.
- *
- * **Note:** Non-object values are coerced to objects.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Object
- * @param {Object} object The object to query.
- * @returns {Array} Returns the array of property values.
- * @example
- *
- * function Foo() {
- * this.a = 1;
- * this.b = 2;
- * }
- *
- * Foo.prototype.c = 3;
- *
- * _.valuesIn(new Foo);
- * // => [1, 2, 3] (iteration order is not guaranteed)
- */
- function valuesIn(object) {
- return object == null ? [] : baseValues(object, keysIn(object));
- }
-
- /*------------------------------------------------------------------------*/
-
- /**
- * Clamps `number` within the inclusive `lower` and `upper` bounds.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Number
- * @param {number} number The number to clamp.
- * @param {number} [lower] The lower bound.
- * @param {number} upper The upper bound.
- * @returns {number} Returns the clamped number.
- * @example
- *
- * _.clamp(-10, -5, 5);
- * // => -5
- *
- * _.clamp(10, -5, 5);
- * // => 5
- */
- function clamp(number, lower, upper) {
- if (upper === undefined) {
- upper = lower;
- lower = undefined;
- }
- if (upper !== undefined) {
- upper = toNumber(upper);
- upper = upper === upper ? upper : 0;
- }
- if (lower !== undefined) {
- lower = toNumber(lower);
- lower = lower === lower ? lower : 0;
- }
- return baseClamp(toNumber(number), lower, upper);
- }
-
- /**
- * Checks if `n` is between `start` and up to, but not including, `end`. If
- * `end` is not specified, it's set to `start` with `start` then set to `0`.
- * If `start` is greater than `end` the params are swapped to support
- * negative ranges.
- *
- * @static
- * @memberOf _
- * @since 3.3.0
- * @category Number
- * @param {number} number The number to check.
- * @param {number} [start=0] The start of the range.
- * @param {number} end The end of the range.
- * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
- * @see _.range, _.rangeRight
- * @example
- *
- * _.inRange(3, 2, 4);
- * // => true
- *
- * _.inRange(4, 8);
- * // => true
- *
- * _.inRange(4, 2);
- * // => false
- *
- * _.inRange(2, 2);
- * // => false
- *
- * _.inRange(1.2, 2);
- * // => true
- *
- * _.inRange(5.2, 4);
- * // => false
- *
- * _.inRange(-3, -2, -6);
- * // => true
- */
- function inRange(number, start, end) {
- start = toFinite(start);
- if (end === undefined) {
- end = start;
- start = 0;
- } else {
- end = toFinite(end);
- }
- number = toNumber(number);
- return baseInRange(number, start, end);
- }
-
- /**
- * Produces a random number between the inclusive `lower` and `upper` bounds.
- * If only one argument is provided a number between `0` and the given number
- * is returned. If `floating` is `true`, or either `lower` or `upper` are
- * floats, a floating-point number is returned instead of an integer.
- *
- * **Note:** JavaScript follows the IEEE-754 standard for resolving
- * floating-point values which can produce unexpected results.
- *
- * @static
- * @memberOf _
- * @since 0.7.0
- * @category Number
- * @param {number} [lower=0] The lower bound.
- * @param {number} [upper=1] The upper bound.
- * @param {boolean} [floating] Specify returning a floating-point number.
- * @returns {number} Returns the random number.
- * @example
- *
- * _.random(0, 5);
- * // => an integer between 0 and 5
- *
- * _.random(5);
- * // => also an integer between 0 and 5
- *
- * _.random(5, true);
- * // => a floating-point number between 0 and 5
- *
- * _.random(1.2, 5.2);
- * // => a floating-point number between 1.2 and 5.2
- */
- function random(lower, upper, floating) {
- if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) {
- upper = floating = undefined;
- }
- if (floating === undefined) {
- if (typeof upper == 'boolean') {
- floating = upper;
- upper = undefined;
- }
- else if (typeof lower == 'boolean') {
- floating = lower;
- lower = undefined;
- }
- }
- if (lower === undefined && upper === undefined) {
- lower = 0;
- upper = 1;
- }
- else {
- lower = toFinite(lower);
- if (upper === undefined) {
- upper = lower;
- lower = 0;
- } else {
- upper = toFinite(upper);
- }
- }
- if (lower > upper) {
- var temp = lower;
- lower = upper;
- upper = temp;
- }
- if (floating || lower % 1 || upper % 1) {
- var rand = nativeRandom();
- return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper);
- }
- return baseRandom(lower, upper);
- }
-
- /*------------------------------------------------------------------------*/
-
- /**
- * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category String
- * @param {string} [string=''] The string to convert.
- * @returns {string} Returns the camel cased string.
- * @example
- *
- * _.camelCase('Foo Bar');
- * // => 'fooBar'
- *
- * _.camelCase('--foo-bar--');
- * // => 'fooBar'
- *
- * _.camelCase('__FOO_BAR__');
- * // => 'fooBar'
- */
- var camelCase = createCompounder(function(result, word, index) {
- word = word.toLowerCase();
- return result + (index ? capitalize(word) : word);
- });
-
- /**
- * Converts the first character of `string` to upper case and the remaining
- * to lower case.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category String
- * @param {string} [string=''] The string to capitalize.
- * @returns {string} Returns the capitalized string.
- * @example
- *
- * _.capitalize('FRED');
- * // => 'Fred'
- */
- function capitalize(string) {
- return upperFirst(toString(string).toLowerCase());
- }
-
- /**
- * Deburrs `string` by converting
- * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
- * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)
- * letters to basic Latin letters and removing
- * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category String
- * @param {string} [string=''] The string to deburr.
- * @returns {string} Returns the deburred string.
- * @example
- *
- * _.deburr('déjà vu');
- * // => 'deja vu'
- */
- function deburr(string) {
- string = toString(string);
- return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');
- }
-
- /**
- * Checks if `string` ends with the given target string.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category String
- * @param {string} [string=''] The string to inspect.
- * @param {string} [target] The string to search for.
- * @param {number} [position=string.length] The position to search up to.
- * @returns {boolean} Returns `true` if `string` ends with `target`,
- * else `false`.
- * @example
- *
- * _.endsWith('abc', 'c');
- * // => true
- *
- * _.endsWith('abc', 'b');
- * // => false
- *
- * _.endsWith('abc', 'b', 2);
- * // => true
- */
- function endsWith(string, target, position) {
- string = toString(string);
- target = baseToString(target);
-
- var length = string.length;
- position = position === undefined
- ? length
- : baseClamp(toInteger(position), 0, length);
-
- var end = position;
- position -= target.length;
- return position >= 0 && string.slice(position, end) == target;
- }
-
- /**
- * Converts the characters "&", "<", ">", '"', and "'" in `string` to their
- * corresponding HTML entities.
- *
- * **Note:** No other characters are escaped. To escape additional
- * characters use a third-party library like [_he_](https://mths.be/he).
- *
- * Though the ">" character is escaped for symmetry, characters like
- * ">" and "/" don't need escaping in HTML and have no special meaning
- * unless they're part of a tag or unquoted attribute value. See
- * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)
- * (under "semi-related fun fact") for more details.
- *
- * When working with HTML you should always
- * [quote attribute values](http://wonko.com/post/html-escaping) to reduce
- * XSS vectors.
- *
- * @static
- * @since 0.1.0
- * @memberOf _
- * @category String
- * @param {string} [string=''] The string to escape.
- * @returns {string} Returns the escaped string.
- * @example
- *
- * _.escape('fred, barney, & pebbles');
- * // => 'fred, barney, &amp; pebbles'
- */
- function escape(string) {
- string = toString(string);
- return (string && reHasUnescapedHtml.test(string))
- ? string.replace(reUnescapedHtml, escapeHtmlChar)
- : string;
- }
-
- /**
- * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+",
- * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category String
- * @param {string} [string=''] The string to escape.
- * @returns {string} Returns the escaped string.
- * @example
- *
- * _.escapeRegExp('[lodash](https://lodash.com/)');
- * // => '\[lodash\]\(https://lodash\.com/\)'
- */
- function escapeRegExp(string) {
- string = toString(string);
- return (string && reHasRegExpChar.test(string))
- ? string.replace(reRegExpChar, '\\$&')
- : string;
- }
-
- /**
- * Converts `string` to
- * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category String
- * @param {string} [string=''] The string to convert.
- * @returns {string} Returns the kebab cased string.
- * @example
- *
- * _.kebabCase('Foo Bar');
- * // => 'foo-bar'
- *
- * _.kebabCase('fooBar');
- * // => 'foo-bar'
- *
- * _.kebabCase('__FOO_BAR__');
- * // => 'foo-bar'
- */
- var kebabCase = createCompounder(function(result, word, index) {
- return result + (index ? '-' : '') + word.toLowerCase();
- });
-
- /**
- * Converts `string`, as space separated words, to lower case.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category String
- * @param {string} [string=''] The string to convert.
- * @returns {string} Returns the lower cased string.
- * @example
- *
- * _.lowerCase('--Foo-Bar--');
- * // => 'foo bar'
- *
- * _.lowerCase('fooBar');
- * // => 'foo bar'
- *
- * _.lowerCase('__FOO_BAR__');
- * // => 'foo bar'
- */
- var lowerCase = createCompounder(function(result, word, index) {
- return result + (index ? ' ' : '') + word.toLowerCase();
- });
-
- /**
- * Converts the first character of `string` to lower case.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category String
- * @param {string} [string=''] The string to convert.
- * @returns {string} Returns the converted string.
- * @example
- *
- * _.lowerFirst('Fred');
- * // => 'fred'
- *
- * _.lowerFirst('FRED');
- * // => 'fRED'
- */
- var lowerFirst = createCaseFirst('toLowerCase');
-
- /**
- * Pads `string` on the left and right sides if it's shorter than `length`.
- * Padding characters are truncated if they can't be evenly divided by `length`.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category String
- * @param {string} [string=''] The string to pad.
- * @param {number} [length=0] The padding length.
- * @param {string} [chars=' '] The string used as padding.
- * @returns {string} Returns the padded string.
- * @example
- *
- * _.pad('abc', 8);
- * // => ' abc '
- *
- * _.pad('abc', 8, '_-');
- * // => '_-abc_-_'
- *
- * _.pad('abc', 3);
- * // => 'abc'
- */
- function pad(string, length, chars) {
- string = toString(string);
- length = toInteger(length);
-
- var strLength = length ? stringSize(string) : 0;
- if (!length || strLength >= length) {
- return string;
- }
- var mid = (length - strLength) / 2;
- return (
- createPadding(nativeFloor(mid), chars) +
- string +
- createPadding(nativeCeil(mid), chars)
- );
- }
-
- /**
- * Pads `string` on the right side if it's shorter than `length`. Padding
- * characters are truncated if they exceed `length`.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category String
- * @param {string} [string=''] The string to pad.
- * @param {number} [length=0] The padding length.
- * @param {string} [chars=' '] The string used as padding.
- * @returns {string} Returns the padded string.
- * @example
- *
- * _.padEnd('abc', 6);
- * // => 'abc '
- *
- * _.padEnd('abc', 6, '_-');
- * // => 'abc_-_'
- *
- * _.padEnd('abc', 3);
- * // => 'abc'
- */
- function padEnd(string, length, chars) {
- string = toString(string);
- length = toInteger(length);
-
- var strLength = length ? stringSize(string) : 0;
- return (length && strLength < length)
- ? (string + createPadding(length - strLength, chars))
- : string;
- }
-
- /**
- * Pads `string` on the left side if it's shorter than `length`. Padding
- * characters are truncated if they exceed `length`.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category String
- * @param {string} [string=''] The string to pad.
- * @param {number} [length=0] The padding length.
- * @param {string} [chars=' '] The string used as padding.
- * @returns {string} Returns the padded string.
- * @example
- *
- * _.padStart('abc', 6);
- * // => ' abc'
- *
- * _.padStart('abc', 6, '_-');
- * // => '_-_abc'
- *
- * _.padStart('abc', 3);
- * // => 'abc'
- */
- function padStart(string, length, chars) {
- string = toString(string);
- length = toInteger(length);
-
- var strLength = length ? stringSize(string) : 0;
- return (length && strLength < length)
- ? (createPadding(length - strLength, chars) + string)
- : string;
- }
-
- /**
- * Converts `string` to an integer of the specified radix. If `radix` is
- * `undefined` or `0`, a `radix` of `10` is used unless `value` is a
- * hexadecimal, in which case a `radix` of `16` is used.
- *
- * **Note:** This method aligns with the
- * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`.
- *
- * @static
- * @memberOf _
- * @since 1.1.0
- * @category String
- * @param {string} string The string to convert.
- * @param {number} [radix=10] The radix to interpret `value` by.
- * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
- * @returns {number} Returns the converted integer.
- * @example
- *
- * _.parseInt('08');
- * // => 8
- *
- * _.map(['6', '08', '10'], _.parseInt);
- * // => [6, 8, 10]
- */
- function parseInt(string, radix, guard) {
- if (guard || radix == null) {
- radix = 0;
- } else if (radix) {
- radix = +radix;
- }
- return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0);
- }
-
- /**
- * Repeats the given string `n` times.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category String
- * @param {string} [string=''] The string to repeat.
- * @param {number} [n=1] The number of times to repeat the string.
- * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
- * @returns {string} Returns the repeated string.
- * @example
- *
- * _.repeat('*', 3);
- * // => '***'
- *
- * _.repeat('abc', 2);
- * // => 'abcabc'
- *
- * _.repeat('abc', 0);
- * // => ''
- */
- function repeat(string, n, guard) {
- if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) {
- n = 1;
- } else {
- n = toInteger(n);
- }
- return baseRepeat(toString(string), n);
- }
-
- /**
- * Replaces matches for `pattern` in `string` with `replacement`.
- *
- * **Note:** This method is based on
- * [`String#replace`](https://mdn.io/String/replace).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category String
- * @param {string} [string=''] The string to modify.
- * @param {RegExp|string} pattern The pattern to replace.
- * @param {Function|string} replacement The match replacement.
- * @returns {string} Returns the modified string.
- * @example
- *
- * _.replace('Hi Fred', 'Fred', 'Barney');
- * // => 'Hi Barney'
- */
- function replace() {
- var args = arguments,
- string = toString(args[0]);
-
- return args.length < 3 ? string : string.replace(args[1], args[2]);
- }
-
- /**
- * Converts `string` to
- * [snake case](https://en.wikipedia.org/wiki/Snake_case).
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category String
- * @param {string} [string=''] The string to convert.
- * @returns {string} Returns the snake cased string.
- * @example
- *
- * _.snakeCase('Foo Bar');
- * // => 'foo_bar'
- *
- * _.snakeCase('fooBar');
- * // => 'foo_bar'
- *
- * _.snakeCase('--FOO-BAR--');
- * // => 'foo_bar'
- */
- var snakeCase = createCompounder(function(result, word, index) {
- return result + (index ? '_' : '') + word.toLowerCase();
- });
-
- /**
- * Splits `string` by `separator`.
- *
- * **Note:** This method is based on
- * [`String#split`](https://mdn.io/String/split).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category String
- * @param {string} [string=''] The string to split.
- * @param {RegExp|string} separator The separator pattern to split by.
- * @param {number} [limit] The length to truncate results to.
- * @returns {Array} Returns the string segments.
- * @example
- *
- * _.split('a-b-c', '-', 2);
- * // => ['a', 'b']
- */
- function split(string, separator, limit) {
- if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) {
- separator = limit = undefined;
- }
- limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0;
- if (!limit) {
- return [];
- }
- string = toString(string);
- if (string && (
- typeof separator == 'string' ||
- (separator != null && !isRegExp(separator))
- )) {
- separator = baseToString(separator);
- if (!separator && hasUnicode(string)) {
- return castSlice(stringToArray(string), 0, limit);
- }
- }
- return string.split(separator, limit);
- }
-
- /**
- * Converts `string` to
- * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).
- *
- * @static
- * @memberOf _
- * @since 3.1.0
- * @category String
- * @param {string} [string=''] The string to convert.
- * @returns {string} Returns the start cased string.
- * @example
- *
- * _.startCase('--foo-bar--');
- * // => 'Foo Bar'
- *
- * _.startCase('fooBar');
- * // => 'Foo Bar'
- *
- * _.startCase('__FOO_BAR__');
- * // => 'FOO BAR'
- */
- var startCase = createCompounder(function(result, word, index) {
- return result + (index ? ' ' : '') + upperFirst(word);
- });
-
- /**
- * Checks if `string` starts with the given target string.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category String
- * @param {string} [string=''] The string to inspect.
- * @param {string} [target] The string to search for.
- * @param {number} [position=0] The position to search from.
- * @returns {boolean} Returns `true` if `string` starts with `target`,
- * else `false`.
- * @example
- *
- * _.startsWith('abc', 'a');
- * // => true
- *
- * _.startsWith('abc', 'b');
- * // => false
- *
- * _.startsWith('abc', 'b', 1);
- * // => true
- */
- function startsWith(string, target, position) {
- string = toString(string);
- position = position == null
- ? 0
- : baseClamp(toInteger(position), 0, string.length);
-
- target = baseToString(target);
- return string.slice(position, position + target.length) == target;
- }
-
- /**
- * Creates a compiled template function that can interpolate data properties
- * in "interpolate" delimiters, HTML-escape interpolated data properties in
- * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data
- * properties may be accessed as free variables in the template. If a setting
- * object is given, it takes precedence over `_.templateSettings` values.
- *
- * **Note:** In the development build `_.template` utilizes
- * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
- * for easier debugging.
- *
- * For more information on precompiling templates see
- * [lodash's custom builds documentation](https://lodash.com/custom-builds).
- *
- * For more information on Chrome extension sandboxes see
- * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).
- *
- * @static
- * @since 0.1.0
- * @memberOf _
- * @category String
- * @param {string} [string=''] The template string.
- * @param {Object} [options={}] The options object.
- * @param {RegExp} [options.escape=_.templateSettings.escape]
- * The HTML "escape" delimiter.
- * @param {RegExp} [options.evaluate=_.templateSettings.evaluate]
- * The "evaluate" delimiter.
- * @param {Object} [options.imports=_.templateSettings.imports]
- * An object to import into the template as free variables.
- * @param {RegExp} [options.interpolate=_.templateSettings.interpolate]
- * The "interpolate" delimiter.
- * @param {string} [options.sourceURL='lodash.templateSources[n]']
- * The sourceURL of the compiled template.
- * @param {string} [options.variable='obj']
- * The data object variable name.
- * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
- * @returns {Function} Returns the compiled template function.
- * @example
- *
- * // Use the "interpolate" delimiter to create a compiled template.
- * var compiled = _.template('hello <%= user %>!');
- * compiled({ 'user': 'fred' });
- * // => 'hello fred!'
- *
- * // Use the HTML "escape" delimiter to escape data property values.
- * var compiled = _.template('<b><%- value %></b>');
- * compiled({ 'value': '<script>' });
- * // => '<b>&lt;script&gt;</b>'
- *
- * // Use the "evaluate" delimiter to execute JavaScript and generate HTML.
- * var compiled = _.template('<% _.forEach(users, function(user) { %><li><%- user %></li><% }); %>');
- * compiled({ 'users': ['fred', 'barney'] });
- * // => '<li>fred</li><li>barney</li>'
- *
- * // Use the internal `print` function in "evaluate" delimiters.
- * var compiled = _.template('<% print("hello " + user); %>!');
- * compiled({ 'user': 'barney' });
- * // => 'hello barney!'
- *
- * // Use the ES template literal delimiter as an "interpolate" delimiter.
- * // Disable support by replacing the "interpolate" delimiter.
- * var compiled = _.template('hello ${ user }!');
- * compiled({ 'user': 'pebbles' });
- * // => 'hello pebbles!'
- *
- * // Use backslashes to treat delimiters as plain text.
- * var compiled = _.template('<%= "\\<%- value %\\>" %>');
- * compiled({ 'value': 'ignored' });
- * // => '<%- value %>'
- *
- * // Use the `imports` option to import `jQuery` as `jq`.
- * var text = '<% jq.each(users, function(user) { %><li><%- user %></li><% }); %>';
- * var compiled = _.template(text, { 'imports': { 'jq': jQuery } });
- * compiled({ 'users': ['fred', 'barney'] });
- * // => '<li>fred</li><li>barney</li>'
- *
- * // Use the `sourceURL` option to specify a custom sourceURL for the template.
- * var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' });
- * compiled(data);
- * // => Find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector.
- *
- * // Use the `variable` option to ensure a with-statement isn't used in the compiled template.
- * var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' });
- * compiled.source;
- * // => function(data) {
- * // var __t, __p = '';
- * // __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!';
- * // return __p;
- * // }
- *
- * // Use custom template delimiters.
- * _.templateSettings.interpolate = /{{([\s\S]+?)}}/g;
- * var compiled = _.template('hello {{ user }}!');
- * compiled({ 'user': 'mustache' });
- * // => 'hello mustache!'
- *
- * // Use the `source` property to inline compiled templates for meaningful
- * // line numbers in error messages and stack traces.
- * fs.writeFileSync(path.join(process.cwd(), 'jst.js'), '\
- * var JST = {\
- * "main": ' + _.template(mainText).source + '\
- * };\
- * ');
- */
- function template(string, options, guard) {
- // Based on John Resig's `tmpl` implementation
- // (http://ejohn.org/blog/javascript-micro-templating/)
- // and Laura Doktorova's doT.js (https://github.com/olado/doT).
- var settings = lodash.templateSettings;
-
- if (guard && isIterateeCall(string, options, guard)) {
- options = undefined;
- }
- string = toString(string);
- options = assignInWith({}, options, settings, customDefaultsAssignIn);
-
- var imports = assignInWith({}, options.imports, settings.imports, customDefaultsAssignIn),
- importsKeys = keys(imports),
- importsValues = baseValues(imports, importsKeys);
-
- var isEscaping,
- isEvaluating,
- index = 0,
- interpolate = options.interpolate || reNoMatch,
- source = "__p += '";
-
- // Compile the regexp to match each delimiter.
- var reDelimiters = RegExp(
- (options.escape || reNoMatch).source + '|' +
- interpolate.source + '|' +
- (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' +
- (options.evaluate || reNoMatch).source + '|$'
- , 'g');
-
- // Use a sourceURL for easier debugging.
- var sourceURL = '//# sourceURL=' +
- ('sourceURL' in options
- ? options.sourceURL
- : ('lodash.templateSources[' + (++templateCounter) + ']')
- ) + '\n';
-
- string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {
- interpolateValue || (interpolateValue = esTemplateValue);
-
- // Escape characters that can't be included in string literals.
- source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar);
-
- // Replace delimiters with snippets.
- if (escapeValue) {
- isEscaping = true;
- source += "' +\n__e(" + escapeValue + ") +\n'";
- }
- if (evaluateValue) {
- isEvaluating = true;
- source += "';\n" + evaluateValue + ";\n__p += '";
- }
- if (interpolateValue) {
- source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'";
- }
- index = offset + match.length;
-
- // The JS engine embedded in Adobe products needs `match` returned in
- // order to produce the correct `offset` value.
- return match;
- });
-
- source += "';\n";
-
- // If `variable` is not specified wrap a with-statement around the generated
- // code to add the data object to the top of the scope chain.
- var variable = options.variable;
- if (!variable) {
- source = 'with (obj) {\n' + source + '\n}\n';
- }
- // Cleanup code by stripping empty strings.
- source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source)
- .replace(reEmptyStringMiddle, '$1')
- .replace(reEmptyStringTrailing, '$1;');
-
- // Frame code as the function body.
- source = 'function(' + (variable || 'obj') + ') {\n' +
- (variable
- ? ''
- : 'obj || (obj = {});\n'
- ) +
- "var __t, __p = ''" +
- (isEscaping
- ? ', __e = _.escape'
- : ''
- ) +
- (isEvaluating
- ? ', __j = Array.prototype.join;\n' +
- "function print() { __p += __j.call(arguments, '') }\n"
- : ';\n'
- ) +
- source +
- 'return __p\n}';
-
- var result = attempt(function() {
- return Function(importsKeys, sourceURL + 'return ' + source)
- .apply(undefined, importsValues);
- });
-
- // Provide the compiled function's source by its `toString` method or
- // the `source` property as a convenience for inlining compiled templates.
- result.source = source;
- if (isError(result)) {
- throw result;
- }
- return result;
- }
-
- /**
- * Converts `string`, as a whole, to lower case just like
- * [String#toLowerCase](https://mdn.io/toLowerCase).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category String
- * @param {string} [string=''] The string to convert.
- * @returns {string} Returns the lower cased string.
- * @example
- *
- * _.toLower('--Foo-Bar--');
- * // => '--foo-bar--'
- *
- * _.toLower('fooBar');
- * // => 'foobar'
- *
- * _.toLower('__FOO_BAR__');
- * // => '__foo_bar__'
- */
- function toLower(value) {
- return toString(value).toLowerCase();
- }
-
- /**
- * Converts `string`, as a whole, to upper case just like
- * [String#toUpperCase](https://mdn.io/toUpperCase).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category String
- * @param {string} [string=''] The string to convert.
- * @returns {string} Returns the upper cased string.
- * @example
- *
- * _.toUpper('--foo-bar--');
- * // => '--FOO-BAR--'
- *
- * _.toUpper('fooBar');
- * // => 'FOOBAR'
- *
- * _.toUpper('__foo_bar__');
- * // => '__FOO_BAR__'
- */
- function toUpper(value) {
- return toString(value).toUpperCase();
- }
-
- /**
- * Removes leading and trailing whitespace or specified characters from `string`.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category String
- * @param {string} [string=''] The string to trim.
- * @param {string} [chars=whitespace] The characters to trim.
- * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
- * @returns {string} Returns the trimmed string.
- * @example
- *
- * _.trim(' abc ');
- * // => 'abc'
- *
- * _.trim('-_-abc-_-', '_-');
- * // => 'abc'
- *
- * _.map([' foo ', ' bar '], _.trim);
- * // => ['foo', 'bar']
- */
- function trim(string, chars, guard) {
- string = toString(string);
- if (string && (guard || chars === undefined)) {
- return string.replace(reTrim, '');
- }
- if (!string || !(chars = baseToString(chars))) {
- return string;
- }
- var strSymbols = stringToArray(string),
- chrSymbols = stringToArray(chars),
- start = charsStartIndex(strSymbols, chrSymbols),
- end = charsEndIndex(strSymbols, chrSymbols) + 1;
-
- return castSlice(strSymbols, start, end).join('');
- }
-
- /**
- * Removes trailing whitespace or specified characters from `string`.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category String
- * @param {string} [string=''] The string to trim.
- * @param {string} [chars=whitespace] The characters to trim.
- * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
- * @returns {string} Returns the trimmed string.
- * @example
- *
- * _.trimEnd(' abc ');
- * // => ' abc'
- *
- * _.trimEnd('-_-abc-_-', '_-');
- * // => '-_-abc'
- */
- function trimEnd(string, chars, guard) {
- string = toString(string);
- if (string && (guard || chars === undefined)) {
- return string.replace(reTrimEnd, '');
- }
- if (!string || !(chars = baseToString(chars))) {
- return string;
- }
- var strSymbols = stringToArray(string),
- end = charsEndIndex(strSymbols, stringToArray(chars)) + 1;
-
- return castSlice(strSymbols, 0, end).join('');
- }
-
- /**
- * Removes leading whitespace or specified characters from `string`.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category String
- * @param {string} [string=''] The string to trim.
- * @param {string} [chars=whitespace] The characters to trim.
- * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
- * @returns {string} Returns the trimmed string.
- * @example
- *
- * _.trimStart(' abc ');
- * // => 'abc '
- *
- * _.trimStart('-_-abc-_-', '_-');
- * // => 'abc-_-'
- */
- function trimStart(string, chars, guard) {
- string = toString(string);
- if (string && (guard || chars === undefined)) {
- return string.replace(reTrimStart, '');
- }
- if (!string || !(chars = baseToString(chars))) {
- return string;
- }
- var strSymbols = stringToArray(string),
- start = charsStartIndex(strSymbols, stringToArray(chars));
-
- return castSlice(strSymbols, start).join('');
- }
-
- /**
- * Truncates `string` if it's longer than the given maximum string length.
- * The last characters of the truncated string are replaced with the omission
- * string which defaults to "...".
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category String
- * @param {string} [string=''] The string to truncate.
- * @param {Object} [options={}] The options object.
- * @param {number} [options.length=30] The maximum string length.
- * @param {string} [options.omission='...'] The string to indicate text is omitted.
- * @param {RegExp|string} [options.separator] The separator pattern to truncate to.
- * @returns {string} Returns the truncated string.
- * @example
- *
- * _.truncate('hi-diddly-ho there, neighborino');
- * // => 'hi-diddly-ho there, neighbo...'
- *
- * _.truncate('hi-diddly-ho there, neighborino', {
- * 'length': 24,
- * 'separator': ' '
- * });
- * // => 'hi-diddly-ho there,...'
- *
- * _.truncate('hi-diddly-ho there, neighborino', {
- * 'length': 24,
- * 'separator': /,? +/
- * });
- * // => 'hi-diddly-ho there...'
- *
- * _.truncate('hi-diddly-ho there, neighborino', {
- * 'omission': ' [...]'
- * });
- * // => 'hi-diddly-ho there, neig [...]'
- */
- function truncate(string, options) {
- var length = DEFAULT_TRUNC_LENGTH,
- omission = DEFAULT_TRUNC_OMISSION;
-
- if (isObject(options)) {
- var separator = 'separator' in options ? options.separator : separator;
- length = 'length' in options ? toInteger(options.length) : length;
- omission = 'omission' in options ? baseToString(options.omission) : omission;
- }
- string = toString(string);
-
- var strLength = string.length;
- if (hasUnicode(string)) {
- var strSymbols = stringToArray(string);
- strLength = strSymbols.length;
- }
- if (length >= strLength) {
- return string;
- }
- var end = length - stringSize(omission);
- if (end < 1) {
- return omission;
- }
- var result = strSymbols
- ? castSlice(strSymbols, 0, end).join('')
- : string.slice(0, end);
-
- if (separator === undefined) {
- return result + omission;
- }
- if (strSymbols) {
- end += (result.length - end);
- }
- if (isRegExp(separator)) {
- if (string.slice(end).search(separator)) {
- var match,
- substring = result;
-
- if (!separator.global) {
- separator = RegExp(separator.source, toString(reFlags.exec(separator)) + 'g');
- }
- separator.lastIndex = 0;
- while ((match = separator.exec(substring))) {
- var newEnd = match.index;
- }
- result = result.slice(0, newEnd === undefined ? end : newEnd);
- }
- } else if (string.indexOf(baseToString(separator), end) != end) {
- var index = result.lastIndexOf(separator);
- if (index > -1) {
- result = result.slice(0, index);
- }
- }
- return result + omission;
- }
-
- /**
- * The inverse of `_.escape`; this method converts the HTML entities
- * `&amp;`, `&lt;`, `&gt;`, `&quot;`, and `&#39;` in `string` to
- * their corresponding characters.
- *
- * **Note:** No other HTML entities are unescaped. To unescape additional
- * HTML entities use a third-party library like [_he_](https://mths.be/he).
- *
- * @static
- * @memberOf _
- * @since 0.6.0
- * @category String
- * @param {string} [string=''] The string to unescape.
- * @returns {string} Returns the unescaped string.
- * @example
- *
- * _.unescape('fred, barney, &amp; pebbles');
- * // => 'fred, barney, & pebbles'
- */
- function unescape(string) {
- string = toString(string);
- return (string && reHasEscapedHtml.test(string))
- ? string.replace(reEscapedHtml, unescapeHtmlChar)
- : string;
- }
-
- /**
- * Converts `string`, as space separated words, to upper case.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category String
- * @param {string} [string=''] The string to convert.
- * @returns {string} Returns the upper cased string.
- * @example
- *
- * _.upperCase('--foo-bar');
- * // => 'FOO BAR'
- *
- * _.upperCase('fooBar');
- * // => 'FOO BAR'
- *
- * _.upperCase('__foo_bar__');
- * // => 'FOO BAR'
- */
- var upperCase = createCompounder(function(result, word, index) {
- return result + (index ? ' ' : '') + word.toUpperCase();
- });
-
- /**
- * Converts the first character of `string` to upper case.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category String
- * @param {string} [string=''] The string to convert.
- * @returns {string} Returns the converted string.
- * @example
- *
- * _.upperFirst('fred');
- * // => 'Fred'
- *
- * _.upperFirst('FRED');
- * // => 'FRED'
- */
- var upperFirst = createCaseFirst('toUpperCase');
-
- /**
- * Splits `string` into an array of its words.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category String
- * @param {string} [string=''] The string to inspect.
- * @param {RegExp|string} [pattern] The pattern to match words.
- * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
- * @returns {Array} Returns the words of `string`.
- * @example
- *
- * _.words('fred, barney, & pebbles');
- * // => ['fred', 'barney', 'pebbles']
- *
- * _.words('fred, barney, & pebbles', /[^, ]+/g);
- * // => ['fred', 'barney', '&', 'pebbles']
- */
- function words(string, pattern, guard) {
- string = toString(string);
- pattern = guard ? undefined : pattern;
-
- if (pattern === undefined) {
- return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);
- }
- return string.match(pattern) || [];
- }
-
- /*------------------------------------------------------------------------*/
-
- /**
- * Attempts to invoke `func`, returning either the result or the caught error
- * object. Any additional arguments are provided to `func` when it's invoked.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Util
- * @param {Function} func The function to attempt.
- * @param {...*} [args] The arguments to invoke `func` with.
- * @returns {*} Returns the `func` result or error object.
- * @example
- *
- * // Avoid throwing errors for invalid selectors.
- * var elements = _.attempt(function(selector) {
- * return document.querySelectorAll(selector);
- * }, '>_>');
- *
- * if (_.isError(elements)) {
- * elements = [];
- * }
- */
- var attempt = baseRest(function(func, args) {
- try {
- return apply(func, undefined, args);
- } catch (e) {
- return isError(e) ? e : new Error(e);
- }
- });
-
- /**
- * Binds methods of an object to the object itself, overwriting the existing
- * method.
- *
- * **Note:** This method doesn't set the "length" property of bound functions.
- *
- * @static
- * @since 0.1.0
- * @memberOf _
- * @category Util
- * @param {Object} object The object to bind and assign the bound methods to.
- * @param {...(string|string[])} methodNames The object method names to bind.
- * @returns {Object} Returns `object`.
- * @example
- *
- * var view = {
- * 'label': 'docs',
- * 'click': function() {
- * console.log('clicked ' + this.label);
- * }
- * };
- *
- * _.bindAll(view, ['click']);
- * jQuery(element).on('click', view.click);
- * // => Logs 'clicked docs' when clicked.
- */
- var bindAll = flatRest(function(object, methodNames) {
- arrayEach(methodNames, function(key) {
- key = toKey(key);
- baseAssignValue(object, key, bind(object[key], object));
- });
- return object;
- });
-
- /**
- * Creates a function that iterates over `pairs` and invokes the corresponding
- * function of the first predicate to return truthy. The predicate-function
- * pairs are invoked with the `this` binding and arguments of the created
- * function.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Util
- * @param {Array} pairs The predicate-function pairs.
- * @returns {Function} Returns the new composite function.
- * @example
- *
- * var func = _.cond([
- * [_.matches({ 'a': 1 }), _.constant('matches A')],
- * [_.conforms({ 'b': _.isNumber }), _.constant('matches B')],
- * [_.stubTrue, _.constant('no match')]
- * ]);
- *
- * func({ 'a': 1, 'b': 2 });
- * // => 'matches A'
- *
- * func({ 'a': 0, 'b': 1 });
- * // => 'matches B'
- *
- * func({ 'a': '1', 'b': '2' });
- * // => 'no match'
- */
- function cond(pairs) {
- var length = pairs == null ? 0 : pairs.length,
- toIteratee = getIteratee();
-
- pairs = !length ? [] : arrayMap(pairs, function(pair) {
- if (typeof pair[1] != 'function') {
- throw new TypeError(FUNC_ERROR_TEXT);
- }
- return [toIteratee(pair[0]), pair[1]];
- });
-
- return baseRest(function(args) {
- var index = -1;
- while (++index < length) {
- var pair = pairs[index];
- if (apply(pair[0], this, args)) {
- return apply(pair[1], this, args);
- }
- }
- });
- }
-
- /**
- * Creates a function that invokes the predicate properties of `source` with
- * the corresponding property values of a given object, returning `true` if
- * all predicates return truthy, else `false`.
- *
- * **Note:** The created function is equivalent to `_.conformsTo` with
- * `source` partially applied.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Util
- * @param {Object} source The object of property predicates to conform to.
- * @returns {Function} Returns the new spec function.
- * @example
- *
- * var objects = [
- * { 'a': 2, 'b': 1 },
- * { 'a': 1, 'b': 2 }
- * ];
- *
- * _.filter(objects, _.conforms({ 'b': function(n) { return n > 1; } }));
- * // => [{ 'a': 1, 'b': 2 }]
- */
- function conforms(source) {
- return baseConforms(baseClone(source, CLONE_DEEP_FLAG));
- }
-
- /**
- * Creates a function that returns `value`.
- *
- * @static
- * @memberOf _
- * @since 2.4.0
- * @category Util
- * @param {*} value The value to return from the new function.
- * @returns {Function} Returns the new constant function.
- * @example
- *
- * var objects = _.times(2, _.constant({ 'a': 1 }));
- *
- * console.log(objects);
- * // => [{ 'a': 1 }, { 'a': 1 }]
- *
- * console.log(objects[0] === objects[1]);
- * // => true
- */
- function constant(value) {
- return function() {
- return value;
- };
- }
-
- /**
- * Checks `value` to determine whether a default value should be returned in
- * its place. The `defaultValue` is returned if `value` is `NaN`, `null`,
- * or `undefined`.
- *
- * @static
- * @memberOf _
- * @since 4.14.0
- * @category Util
- * @param {*} value The value to check.
- * @param {*} defaultValue The default value.
- * @returns {*} Returns the resolved value.
- * @example
- *
- * _.defaultTo(1, 10);
- * // => 1
- *
- * _.defaultTo(undefined, 10);
- * // => 10
- */
- function defaultTo(value, defaultValue) {
- return (value == null || value !== value) ? defaultValue : value;
- }
-
- /**
- * Creates a function that returns the result of invoking the given functions
- * with the `this` binding of the created function, where each successive
- * invocation is supplied the return value of the previous.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Util
- * @param {...(Function|Function[])} [funcs] The functions to invoke.
- * @returns {Function} Returns the new composite function.
- * @see _.flowRight
- * @example
- *
- * function square(n) {
- * return n * n;
- * }
- *
- * var addSquare = _.flow([_.add, square]);
- * addSquare(1, 2);
- * // => 9
- */
- var flow = createFlow();
-
- /**
- * This method is like `_.flow` except that it creates a function that
- * invokes the given functions from right to left.
- *
- * @static
- * @since 3.0.0
- * @memberOf _
- * @category Util
- * @param {...(Function|Function[])} [funcs] The functions to invoke.
- * @returns {Function} Returns the new composite function.
- * @see _.flow
- * @example
- *
- * function square(n) {
- * return n * n;
- * }
- *
- * var addSquare = _.flowRight([square, _.add]);
- * addSquare(1, 2);
- * // => 9
- */
- var flowRight = createFlow(true);
-
- /**
- * This method returns the first argument it receives.
- *
- * @static
- * @since 0.1.0
- * @memberOf _
- * @category Util
- * @param {*} value Any value.
- * @returns {*} Returns `value`.
- * @example
- *
- * var object = { 'a': 1 };
- *
- * console.log(_.identity(object) === object);
- * // => true
- */
- function identity(value) {
- return value;
- }
-
- /**
- * Creates a function that invokes `func` with the arguments of the created
- * function. If `func` is a property name, the created function returns the
- * property value for a given element. If `func` is an array or object, the
- * created function returns `true` for elements that contain the equivalent
- * source properties, otherwise it returns `false`.
- *
- * @static
- * @since 4.0.0
- * @memberOf _
- * @category Util
- * @param {*} [func=_.identity] The value to convert to a callback.
- * @returns {Function} Returns the callback.
- * @example
- *
- * var users = [
- * { 'user': 'barney', 'age': 36, 'active': true },
- * { 'user': 'fred', 'age': 40, 'active': false }
- * ];
- *
- * // The `_.matches` iteratee shorthand.
- * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true }));
- * // => [{ 'user': 'barney', 'age': 36, 'active': true }]
- *
- * // The `_.matchesProperty` iteratee shorthand.
- * _.filter(users, _.iteratee(['user', 'fred']));
- * // => [{ 'user': 'fred', 'age': 40 }]
- *
- * // The `_.property` iteratee shorthand.
- * _.map(users, _.iteratee('user'));
- * // => ['barney', 'fred']
- *
- * // Create custom iteratee shorthands.
- * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) {
- * return !_.isRegExp(func) ? iteratee(func) : function(string) {
- * return func.test(string);
- * };
- * });
- *
- * _.filter(['abc', 'def'], /ef/);
- * // => ['def']
- */
- function iteratee(func) {
- return baseIteratee(typeof func == 'function' ? func : baseClone(func, CLONE_DEEP_FLAG));
- }
-
- /**
- * Creates a function that performs a partial deep comparison between a given
- * object and `source`, returning `true` if the given object has equivalent
- * property values, else `false`.
- *
- * **Note:** The created function is equivalent to `_.isMatch` with `source`
- * partially applied.
- *
- * Partial comparisons will match empty array and empty object `source`
- * values against any array or object value, respectively. See `_.isEqual`
- * for a list of supported value comparisons.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Util
- * @param {Object} source The object of property values to match.
- * @returns {Function} Returns the new spec function.
- * @example
- *
- * var objects = [
- * { 'a': 1, 'b': 2, 'c': 3 },
- * { 'a': 4, 'b': 5, 'c': 6 }
- * ];
- *
- * _.filter(objects, _.matches({ 'a': 4, 'c': 6 }));
- * // => [{ 'a': 4, 'b': 5, 'c': 6 }]
- */
- function matches(source) {
- return baseMatches(baseClone(source, CLONE_DEEP_FLAG));
- }
-
- /**
- * Creates a function that performs a partial deep comparison between the
- * value at `path` of a given object to `srcValue`, returning `true` if the
- * object value is equivalent, else `false`.
- *
- * **Note:** Partial comparisons will match empty array and empty object
- * `srcValue` values against any array or object value, respectively. See
- * `_.isEqual` for a list of supported value comparisons.
- *
- * @static
- * @memberOf _
- * @since 3.2.0
- * @category Util
- * @param {Array|string} path The path of the property to get.
- * @param {*} srcValue The value to match.
- * @returns {Function} Returns the new spec function.
- * @example
- *
- * var objects = [
- * { 'a': 1, 'b': 2, 'c': 3 },
- * { 'a': 4, 'b': 5, 'c': 6 }
- * ];
- *
- * _.find(objects, _.matchesProperty('a', 4));
- * // => { 'a': 4, 'b': 5, 'c': 6 }
- */
- function matchesProperty(path, srcValue) {
- return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG));
- }
-
- /**
- * Creates a function that invokes the method at `path` of a given object.
- * Any additional arguments are provided to the invoked method.
- *
- * @static
- * @memberOf _
- * @since 3.7.0
- * @category Util
- * @param {Array|string} path The path of the method to invoke.
- * @param {...*} [args] The arguments to invoke the method with.
- * @returns {Function} Returns the new invoker function.
- * @example
- *
- * var objects = [
- * { 'a': { 'b': _.constant(2) } },
- * { 'a': { 'b': _.constant(1) } }
- * ];
- *
- * _.map(objects, _.method('a.b'));
- * // => [2, 1]
- *
- * _.map(objects, _.method(['a', 'b']));
- * // => [2, 1]
- */
- var method = baseRest(function(path, args) {
- return function(object) {
- return baseInvoke(object, path, args);
- };
- });
-
- /**
- * The opposite of `_.method`; this method creates a function that invokes
- * the method at a given path of `object`. Any additional arguments are
- * provided to the invoked method.
- *
- * @static
- * @memberOf _
- * @since 3.7.0
- * @category Util
- * @param {Object} object The object to query.
- * @param {...*} [args] The arguments to invoke the method with.
- * @returns {Function} Returns the new invoker function.
- * @example
- *
- * var array = _.times(3, _.constant),
- * object = { 'a': array, 'b': array, 'c': array };
- *
- * _.map(['a[2]', 'c[0]'], _.methodOf(object));
- * // => [2, 0]
- *
- * _.map([['a', '2'], ['c', '0']], _.methodOf(object));
- * // => [2, 0]
- */
- var methodOf = baseRest(function(object, args) {
- return function(path) {
- return baseInvoke(object, path, args);
- };
- });
-
- /**
- * Adds all own enumerable string keyed function properties of a source
- * object to the destination object. If `object` is a function, then methods
- * are added to its prototype as well.
- *
- * **Note:** Use `_.runInContext` to create a pristine `lodash` function to
- * avoid conflicts caused by modifying the original.
- *
- * @static
- * @since 0.1.0
- * @memberOf _
- * @category Util
- * @param {Function|Object} [object=lodash] The destination object.
- * @param {Object} source The object of functions to add.
- * @param {Object} [options={}] The options object.
- * @param {boolean} [options.chain=true] Specify whether mixins are chainable.
- * @returns {Function|Object} Returns `object`.
- * @example
- *
- * function vowels(string) {
- * return _.filter(string, function(v) {
- * return /[aeiou]/i.test(v);
- * });
- * }
- *
- * _.mixin({ 'vowels': vowels });
- * _.vowels('fred');
- * // => ['e']
- *
- * _('fred').vowels().value();
- * // => ['e']
- *
- * _.mixin({ 'vowels': vowels }, { 'chain': false });
- * _('fred').vowels();
- * // => ['e']
- */
- function mixin(object, source, options) {
- var props = keys(source),
- methodNames = baseFunctions(source, props);
-
- if (options == null &&
- !(isObject(source) && (methodNames.length || !props.length))) {
- options = source;
- source = object;
- object = this;
- methodNames = baseFunctions(source, keys(source));
- }
- var chain = !(isObject(options) && 'chain' in options) || !!options.chain,
- isFunc = isFunction(object);
-
- arrayEach(methodNames, function(methodName) {
- var func = source[methodName];
- object[methodName] = func;
- if (isFunc) {
- object.prototype[methodName] = function() {
- var chainAll = this.__chain__;
- if (chain || chainAll) {
- var result = object(this.__wrapped__),
- actions = result.__actions__ = copyArray(this.__actions__);
-
- actions.push({ 'func': func, 'args': arguments, 'thisArg': object });
- result.__chain__ = chainAll;
- return result;
- }
- return func.apply(object, arrayPush([this.value()], arguments));
- };
- }
- });
-
- return object;
- }
-
- /**
- * Reverts the `_` variable to its previous value and returns a reference to
- * the `lodash` function.
- *
- * @static
- * @since 0.1.0
- * @memberOf _
- * @category Util
- * @returns {Function} Returns the `lodash` function.
- * @example
- *
- * var lodash = _.noConflict();
- */
- function noConflict() {
- if (root._ === this) {
- root._ = oldDash;
- }
- return this;
- }
-
- /**
- * This method returns `undefined`.
- *
- * @static
- * @memberOf _
- * @since 2.3.0
- * @category Util
- * @example
- *
- * _.times(2, _.noop);
- * // => [undefined, undefined]
- */
- function noop() {
- // No operation performed.
- }
-
- /**
- * Creates a function that gets the argument at index `n`. If `n` is negative,
- * the nth argument from the end is returned.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Util
- * @param {number} [n=0] The index of the argument to return.
- * @returns {Function} Returns the new pass-thru function.
- * @example
- *
- * var func = _.nthArg(1);
- * func('a', 'b', 'c', 'd');
- * // => 'b'
- *
- * var func = _.nthArg(-2);
- * func('a', 'b', 'c', 'd');
- * // => 'c'
- */
- function nthArg(n) {
- n = toInteger(n);
- return baseRest(function(args) {
- return baseNth(args, n);
- });
- }
-
- /**
- * Creates a function that invokes `iteratees` with the arguments it receives
- * and returns their results.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Util
- * @param {...(Function|Function[])} [iteratees=[_.identity]]
- * The iteratees to invoke.
- * @returns {Function} Returns the new function.
- * @example
- *
- * var func = _.over([Math.max, Math.min]);
- *
- * func(1, 2, 3, 4);
- * // => [4, 1]
- */
- var over = createOver(arrayMap);
-
- /**
- * Creates a function that checks if **all** of the `predicates` return
- * truthy when invoked with the arguments it receives.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Util
- * @param {...(Function|Function[])} [predicates=[_.identity]]
- * The predicates to check.
- * @returns {Function} Returns the new function.
- * @example
- *
- * var func = _.overEvery([Boolean, isFinite]);
- *
- * func('1');
- * // => true
- *
- * func(null);
- * // => false
- *
- * func(NaN);
- * // => false
- */
- var overEvery = createOver(arrayEvery);
-
- /**
- * Creates a function that checks if **any** of the `predicates` return
- * truthy when invoked with the arguments it receives.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Util
- * @param {...(Function|Function[])} [predicates=[_.identity]]
- * The predicates to check.
- * @returns {Function} Returns the new function.
- * @example
- *
- * var func = _.overSome([Boolean, isFinite]);
- *
- * func('1');
- * // => true
- *
- * func(null);
- * // => true
- *
- * func(NaN);
- * // => false
- */
- var overSome = createOver(arraySome);
-
- /**
- * Creates a function that returns the value at `path` of a given object.
- *
- * @static
- * @memberOf _
- * @since 2.4.0
- * @category Util
- * @param {Array|string} path The path of the property to get.
- * @returns {Function} Returns the new accessor function.
- * @example
- *
- * var objects = [
- * { 'a': { 'b': 2 } },
- * { 'a': { 'b': 1 } }
- * ];
- *
- * _.map(objects, _.property('a.b'));
- * // => [2, 1]
- *
- * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
- * // => [1, 2]
- */
- function property(path) {
- return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
- }
-
- /**
- * The opposite of `_.property`; this method creates a function that returns
- * the value at a given path of `object`.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Util
- * @param {Object} object The object to query.
- * @returns {Function} Returns the new accessor function.
- * @example
- *
- * var array = [0, 1, 2],
- * object = { 'a': array, 'b': array, 'c': array };
- *
- * _.map(['a[2]', 'c[0]'], _.propertyOf(object));
- * // => [2, 0]
- *
- * _.map([['a', '2'], ['c', '0']], _.propertyOf(object));
- * // => [2, 0]
- */
- function propertyOf(object) {
- return function(path) {
- return object == null ? undefined : baseGet(object, path);
- };
- }
-
- /**
- * Creates an array of numbers (positive and/or negative) progressing from
- * `start` up to, but not including, `end`. A step of `-1` is used if a negative
- * `start` is specified without an `end` or `step`. If `end` is not specified,
- * it's set to `start` with `start` then set to `0`.
- *
- * **Note:** JavaScript follows the IEEE-754 standard for resolving
- * floating-point values which can produce unexpected results.
- *
- * @static
- * @since 0.1.0
- * @memberOf _
- * @category Util
- * @param {number} [start=0] The start of the range.
- * @param {number} end The end of the range.
- * @param {number} [step=1] The value to increment or decrement by.
- * @returns {Array} Returns the range of numbers.
- * @see _.inRange, _.rangeRight
- * @example
- *
- * _.range(4);
- * // => [0, 1, 2, 3]
- *
- * _.range(-4);
- * // => [0, -1, -2, -3]
- *
- * _.range(1, 5);
- * // => [1, 2, 3, 4]
- *
- * _.range(0, 20, 5);
- * // => [0, 5, 10, 15]
- *
- * _.range(0, -4, -1);
- * // => [0, -1, -2, -3]
- *
- * _.range(1, 4, 0);
- * // => [1, 1, 1]
- *
- * _.range(0);
- * // => []
- */
- var range = createRange();
-
- /**
- * This method is like `_.range` except that it populates values in
- * descending order.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Util
- * @param {number} [start=0] The start of the range.
- * @param {number} end The end of the range.
- * @param {number} [step=1] The value to increment or decrement by.
- * @returns {Array} Returns the range of numbers.
- * @see _.inRange, _.range
- * @example
- *
- * _.rangeRight(4);
- * // => [3, 2, 1, 0]
- *
- * _.rangeRight(-4);
- * // => [-3, -2, -1, 0]
- *
- * _.rangeRight(1, 5);
- * // => [4, 3, 2, 1]
- *
- * _.rangeRight(0, 20, 5);
- * // => [15, 10, 5, 0]
- *
- * _.rangeRight(0, -4, -1);
- * // => [-3, -2, -1, 0]
- *
- * _.rangeRight(1, 4, 0);
- * // => [1, 1, 1]
- *
- * _.rangeRight(0);
- * // => []
- */
- var rangeRight = createRange(true);
-
- /**
- * This method returns a new empty array.
- *
- * @static
- * @memberOf _
- * @since 4.13.0
- * @category Util
- * @returns {Array} Returns the new empty array.
- * @example
- *
- * var arrays = _.times(2, _.stubArray);
- *
- * console.log(arrays);
- * // => [[], []]
- *
- * console.log(arrays[0] === arrays[1]);
- * // => false
- */
- function stubArray() {
- return [];
- }
-
- /**
- * This method returns `false`.
- *
- * @static
- * @memberOf _
- * @since 4.13.0
- * @category Util
- * @returns {boolean} Returns `false`.
- * @example
- *
- * _.times(2, _.stubFalse);
- * // => [false, false]
- */
- function stubFalse() {
- return false;
- }
-
- /**
- * This method returns a new empty object.
- *
- * @static
- * @memberOf _
- * @since 4.13.0
- * @category Util
- * @returns {Object} Returns the new empty object.
- * @example
- *
- * var objects = _.times(2, _.stubObject);
- *
- * console.log(objects);
- * // => [{}, {}]
- *
- * console.log(objects[0] === objects[1]);
- * // => false
- */
- function stubObject() {
- return {};
- }
-
- /**
- * This method returns an empty string.
- *
- * @static
- * @memberOf _
- * @since 4.13.0
- * @category Util
- * @returns {string} Returns the empty string.
- * @example
- *
- * _.times(2, _.stubString);
- * // => ['', '']
- */
- function stubString() {
- return '';
- }
-
- /**
- * This method returns `true`.
- *
- * @static
- * @memberOf _
- * @since 4.13.0
- * @category Util
- * @returns {boolean} Returns `true`.
- * @example
- *
- * _.times(2, _.stubTrue);
- * // => [true, true]
- */
- function stubTrue() {
- return true;
- }
-
- /**
- * Invokes the iteratee `n` times, returning an array of the results of
- * each invocation. The iteratee is invoked with one argument; (index).
- *
- * @static
- * @since 0.1.0
- * @memberOf _
- * @category Util
- * @param {number} n The number of times to invoke `iteratee`.
- * @param {Function} [iteratee=_.identity] The function invoked per iteration.
- * @returns {Array} Returns the array of results.
- * @example
- *
- * _.times(3, String);
- * // => ['0', '1', '2']
- *
- * _.times(4, _.constant(0));
- * // => [0, 0, 0, 0]
- */
- function times(n, iteratee) {
- n = toInteger(n);
- if (n < 1 || n > MAX_SAFE_INTEGER) {
- return [];
- }
- var index = MAX_ARRAY_LENGTH,
- length = nativeMin(n, MAX_ARRAY_LENGTH);
-
- iteratee = getIteratee(iteratee);
- n -= MAX_ARRAY_LENGTH;
-
- var result = baseTimes(length, iteratee);
- while (++index < n) {
- iteratee(index);
- }
- return result;
- }
-
- /**
- * Converts `value` to a property path array.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Util
- * @param {*} value The value to convert.
- * @returns {Array} Returns the new property path array.
- * @example
- *
- * _.toPath('a.b.c');
- * // => ['a', 'b', 'c']
- *
- * _.toPath('a[0].b.c');
- * // => ['a', '0', 'b', 'c']
- */
- function toPath(value) {
- if (isArray(value)) {
- return arrayMap(value, toKey);
- }
- return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value)));
- }
-
- /**
- * Generates a unique ID. If `prefix` is given, the ID is appended to it.
- *
- * @static
- * @since 0.1.0
- * @memberOf _
- * @category Util
- * @param {string} [prefix=''] The value to prefix the ID with.
- * @returns {string} Returns the unique ID.
- * @example
- *
- * _.uniqueId('contact_');
- * // => 'contact_104'
- *
- * _.uniqueId();
- * // => '105'
- */
- function uniqueId(prefix) {
- var id = ++idCounter;
- return toString(prefix) + id;
- }
-
- /*------------------------------------------------------------------------*/
-
- /**
- * Adds two numbers.
- *
- * @static
- * @memberOf _
- * @since 3.4.0
- * @category Math
- * @param {number} augend The first number in an addition.
- * @param {number} addend The second number in an addition.
- * @returns {number} Returns the total.
- * @example
- *
- * _.add(6, 4);
- * // => 10
- */
- var add = createMathOperation(function(augend, addend) {
- return augend + addend;
- }, 0);
-
- /**
- * Computes `number` rounded up to `precision`.
- *
- * @static
- * @memberOf _
- * @since 3.10.0
- * @category Math
- * @param {number} number The number to round up.
- * @param {number} [precision=0] The precision to round up to.
- * @returns {number} Returns the rounded up number.
- * @example
- *
- * _.ceil(4.006);
- * // => 5
- *
- * _.ceil(6.004, 2);
- * // => 6.01
- *
- * _.ceil(6040, -2);
- * // => 6100
- */
- var ceil = createRound('ceil');
-
- /**
- * Divide two numbers.
- *
- * @static
- * @memberOf _
- * @since 4.7.0
- * @category Math
- * @param {number} dividend The first number in a division.
- * @param {number} divisor The second number in a division.
- * @returns {number} Returns the quotient.
- * @example
- *
- * _.divide(6, 4);
- * // => 1.5
- */
- var divide = createMathOperation(function(dividend, divisor) {
- return dividend / divisor;
- }, 1);
-
- /**
- * Computes `number` rounded down to `precision`.
- *
- * @static
- * @memberOf _
- * @since 3.10.0
- * @category Math
- * @param {number} number The number to round down.
- * @param {number} [precision=0] The precision to round down to.
- * @returns {number} Returns the rounded down number.
- * @example
- *
- * _.floor(4.006);
- * // => 4
- *
- * _.floor(0.046, 2);
- * // => 0.04
- *
- * _.floor(4060, -2);
- * // => 4000
- */
- var floor = createRound('floor');
-
- /**
- * Computes the maximum value of `array`. If `array` is empty or falsey,
- * `undefined` is returned.
- *
- * @static
- * @since 0.1.0
- * @memberOf _
- * @category Math
- * @param {Array} array The array to iterate over.
- * @returns {*} Returns the maximum value.
- * @example
- *
- * _.max([4, 2, 8, 6]);
- * // => 8
- *
- * _.max([]);
- * // => undefined
- */
- function max(array) {
- return (array && array.length)
- ? baseExtremum(array, identity, baseGt)
- : undefined;
- }
-
- /**
- * This method is like `_.max` except that it accepts `iteratee` which is
- * invoked for each element in `array` to generate the criterion by which
- * the value is ranked. The iteratee is invoked with one argument: (value).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Math
- * @param {Array} array The array to iterate over.
- * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
- * @returns {*} Returns the maximum value.
- * @example
- *
- * var objects = [{ 'n': 1 }, { 'n': 2 }];
- *
- * _.maxBy(objects, function(o) { return o.n; });
- * // => { 'n': 2 }
- *
- * // The `_.property` iteratee shorthand.
- * _.maxBy(objects, 'n');
- * // => { 'n': 2 }
- */
- function maxBy(array, iteratee) {
- return (array && array.length)
- ? baseExtremum(array, getIteratee(iteratee, 2), baseGt)
- : undefined;
- }
-
- /**
- * Computes the mean of the values in `array`.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Math
- * @param {Array} array The array to iterate over.
- * @returns {number} Returns the mean.
- * @example
- *
- * _.mean([4, 2, 8, 6]);
- * // => 5
- */
- function mean(array) {
- return baseMean(array, identity);
- }
-
- /**
- * This method is like `_.mean` except that it accepts `iteratee` which is
- * invoked for each element in `array` to generate the value to be averaged.
- * The iteratee is invoked with one argument: (value).
- *
- * @static
- * @memberOf _
- * @since 4.7.0
- * @category Math
- * @param {Array} array The array to iterate over.
- * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
- * @returns {number} Returns the mean.
- * @example
- *
- * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
- *
- * _.meanBy(objects, function(o) { return o.n; });
- * // => 5
- *
- * // The `_.property` iteratee shorthand.
- * _.meanBy(objects, 'n');
- * // => 5
- */
- function meanBy(array, iteratee) {
- return baseMean(array, getIteratee(iteratee, 2));
- }
-
- /**
- * Computes the minimum value of `array`. If `array` is empty or falsey,
- * `undefined` is returned.
- *
- * @static
- * @since 0.1.0
- * @memberOf _
- * @category Math
- * @param {Array} array The array to iterate over.
- * @returns {*} Returns the minimum value.
- * @example
- *
- * _.min([4, 2, 8, 6]);
- * // => 2
- *
- * _.min([]);
- * // => undefined
- */
- function min(array) {
- return (array && array.length)
- ? baseExtremum(array, identity, baseLt)
- : undefined;
- }
-
- /**
- * This method is like `_.min` except that it accepts `iteratee` which is
- * invoked for each element in `array` to generate the criterion by which
- * the value is ranked. The iteratee is invoked with one argument: (value).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Math
- * @param {Array} array The array to iterate over.
- * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
- * @returns {*} Returns the minimum value.
- * @example
- *
- * var objects = [{ 'n': 1 }, { 'n': 2 }];
- *
- * _.minBy(objects, function(o) { return o.n; });
- * // => { 'n': 1 }
- *
- * // The `_.property` iteratee shorthand.
- * _.minBy(objects, 'n');
- * // => { 'n': 1 }
- */
- function minBy(array, iteratee) {
- return (array && array.length)
- ? baseExtremum(array, getIteratee(iteratee, 2), baseLt)
- : undefined;
- }
-
- /**
- * Multiply two numbers.
- *
- * @static
- * @memberOf _
- * @since 4.7.0
- * @category Math
- * @param {number} multiplier The first number in a multiplication.
- * @param {number} multiplicand The second number in a multiplication.
- * @returns {number} Returns the product.
- * @example
- *
- * _.multiply(6, 4);
- * // => 24
- */
- var multiply = createMathOperation(function(multiplier, multiplicand) {
- return multiplier * multiplicand;
- }, 1);
-
- /**
- * Computes `number` rounded to `precision`.
- *
- * @static
- * @memberOf _
- * @since 3.10.0
- * @category Math
- * @param {number} number The number to round.
- * @param {number} [precision=0] The precision to round to.
- * @returns {number} Returns the rounded number.
- * @example
- *
- * _.round(4.006);
- * // => 4
- *
- * _.round(4.006, 2);
- * // => 4.01
- *
- * _.round(4060, -2);
- * // => 4100
- */
- var round = createRound('round');
-
- /**
- * Subtract two numbers.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Math
- * @param {number} minuend The first number in a subtraction.
- * @param {number} subtrahend The second number in a subtraction.
- * @returns {number} Returns the difference.
- * @example
- *
- * _.subtract(6, 4);
- * // => 2
- */
- var subtract = createMathOperation(function(minuend, subtrahend) {
- return minuend - subtrahend;
- }, 0);
-
- /**
- * Computes the sum of the values in `array`.
- *
- * @static
- * @memberOf _
- * @since 3.4.0
- * @category Math
- * @param {Array} array The array to iterate over.
- * @returns {number} Returns the sum.
- * @example
- *
- * _.sum([4, 2, 8, 6]);
- * // => 20
- */
- function sum(array) {
- return (array && array.length)
- ? baseSum(array, identity)
- : 0;
- }
-
- /**
- * This method is like `_.sum` except that it accepts `iteratee` which is
- * invoked for each element in `array` to generate the value to be summed.
- * The iteratee is invoked with one argument: (value).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Math
- * @param {Array} array The array to iterate over.
- * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
- * @returns {number} Returns the sum.
- * @example
- *
- * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
- *
- * _.sumBy(objects, function(o) { return o.n; });
- * // => 20
- *
- * // The `_.property` iteratee shorthand.
- * _.sumBy(objects, 'n');
- * // => 20
- */
- function sumBy(array, iteratee) {
- return (array && array.length)
- ? baseSum(array, getIteratee(iteratee, 2))
- : 0;
- }
-
- /*------------------------------------------------------------------------*/
-
- // Add methods that return wrapped values in chain sequences.
- lodash.after = after;
- lodash.ary = ary;
- lodash.assign = assign;
- lodash.assignIn = assignIn;
- lodash.assignInWith = assignInWith;
- lodash.assignWith = assignWith;
- lodash.at = at;
- lodash.before = before;
- lodash.bind = bind;
- lodash.bindAll = bindAll;
- lodash.bindKey = bindKey;
- lodash.castArray = castArray;
- lodash.chain = chain;
- lodash.chunk = chunk;
- lodash.compact = compact;
- lodash.concat = concat;
- lodash.cond = cond;
- lodash.conforms = conforms;
- lodash.constant = constant;
- lodash.countBy = countBy;
- lodash.create = create;
- lodash.curry = curry;
- lodash.curryRight = curryRight;
- lodash.debounce = debounce;
- lodash.defaults = defaults;
- lodash.defaultsDeep = defaultsDeep;
- lodash.defer = defer;
- lodash.delay = delay;
- lodash.difference = difference;
- lodash.differenceBy = differenceBy;
- lodash.differenceWith = differenceWith;
- lodash.drop = drop;
- lodash.dropRight = dropRight;
- lodash.dropRightWhile = dropRightWhile;
- lodash.dropWhile = dropWhile;
- lodash.fill = fill;
- lodash.filter = filter;
- lodash.flatMap = flatMap;
- lodash.flatMapDeep = flatMapDeep;
- lodash.flatMapDepth = flatMapDepth;
- lodash.flatten = flatten;
- lodash.flattenDeep = flattenDeep;
- lodash.flattenDepth = flattenDepth;
- lodash.flip = flip;
- lodash.flow = flow;
- lodash.flowRight = flowRight;
- lodash.fromPairs = fromPairs;
- lodash.functions = functions;
- lodash.functionsIn = functionsIn;
- lodash.groupBy = groupBy;
- lodash.initial = initial;
- lodash.intersection = intersection;
- lodash.intersectionBy = intersectionBy;
- lodash.intersectionWith = intersectionWith;
- lodash.invert = invert;
- lodash.invertBy = invertBy;
- lodash.invokeMap = invokeMap;
- lodash.iteratee = iteratee;
- lodash.keyBy = keyBy;
- lodash.keys = keys;
- lodash.keysIn = keysIn;
- lodash.map = map;
- lodash.mapKeys = mapKeys;
- lodash.mapValues = mapValues;
- lodash.matches = matches;
- lodash.matchesProperty = matchesProperty;
- lodash.memoize = memoize;
- lodash.merge = merge;
- lodash.mergeWith = mergeWith;
- lodash.method = method;
- lodash.methodOf = methodOf;
- lodash.mixin = mixin;
- lodash.negate = negate;
- lodash.nthArg = nthArg;
- lodash.omit = omit;
- lodash.omitBy = omitBy;
- lodash.once = once;
- lodash.orderBy = orderBy;
- lodash.over = over;
- lodash.overArgs = overArgs;
- lodash.overEvery = overEvery;
- lodash.overSome = overSome;
- lodash.partial = partial;
- lodash.partialRight = partialRight;
- lodash.partition = partition;
- lodash.pick = pick;
- lodash.pickBy = pickBy;
- lodash.property = property;
- lodash.propertyOf = propertyOf;
- lodash.pull = pull;
- lodash.pullAll = pullAll;
- lodash.pullAllBy = pullAllBy;
- lodash.pullAllWith = pullAllWith;
- lodash.pullAt = pullAt;
- lodash.range = range;
- lodash.rangeRight = rangeRight;
- lodash.rearg = rearg;
- lodash.reject = reject;
- lodash.remove = remove;
- lodash.rest = rest;
- lodash.reverse = reverse;
- lodash.sampleSize = sampleSize;
- lodash.set = set;
- lodash.setWith = setWith;
- lodash.shuffle = shuffle;
- lodash.slice = slice;
- lodash.sortBy = sortBy;
- lodash.sortedUniq = sortedUniq;
- lodash.sortedUniqBy = sortedUniqBy;
- lodash.split = split;
- lodash.spread = spread;
- lodash.tail = tail;
- lodash.take = take;
- lodash.takeRight = takeRight;
- lodash.takeRightWhile = takeRightWhile;
- lodash.takeWhile = takeWhile;
- lodash.tap = tap;
- lodash.throttle = throttle;
- lodash.thru = thru;
- lodash.toArray = toArray;
- lodash.toPairs = toPairs;
- lodash.toPairsIn = toPairsIn;
- lodash.toPath = toPath;
- lodash.toPlainObject = toPlainObject;
- lodash.transform = transform;
- lodash.unary = unary;
- lodash.union = union;
- lodash.unionBy = unionBy;
- lodash.unionWith = unionWith;
- lodash.uniq = uniq;
- lodash.uniqBy = uniqBy;
- lodash.uniqWith = uniqWith;
- lodash.unset = unset;
- lodash.unzip = unzip;
- lodash.unzipWith = unzipWith;
- lodash.update = update;
- lodash.updateWith = updateWith;
- lodash.values = values;
- lodash.valuesIn = valuesIn;
- lodash.without = without;
- lodash.words = words;
- lodash.wrap = wrap;
- lodash.xor = xor;
- lodash.xorBy = xorBy;
- lodash.xorWith = xorWith;
- lodash.zip = zip;
- lodash.zipObject = zipObject;
- lodash.zipObjectDeep = zipObjectDeep;
- lodash.zipWith = zipWith;
-
- // Add aliases.
- lodash.entries = toPairs;
- lodash.entriesIn = toPairsIn;
- lodash.extend = assignIn;
- lodash.extendWith = assignInWith;
-
- // Add methods to `lodash.prototype`.
- mixin(lodash, lodash);
-
- /*------------------------------------------------------------------------*/
-
- // Add methods that return unwrapped values in chain sequences.
- lodash.add = add;
- lodash.attempt = attempt;
- lodash.camelCase = camelCase;
- lodash.capitalize = capitalize;
- lodash.ceil = ceil;
- lodash.clamp = clamp;
- lodash.clone = clone;
- lodash.cloneDeep = cloneDeep;
- lodash.cloneDeepWith = cloneDeepWith;
- lodash.cloneWith = cloneWith;
- lodash.conformsTo = conformsTo;
- lodash.deburr = deburr;
- lodash.defaultTo = defaultTo;
- lodash.divide = divide;
- lodash.endsWith = endsWith;
- lodash.eq = eq;
- lodash.escape = escape;
- lodash.escapeRegExp = escapeRegExp;
- lodash.every = every;
- lodash.find = find;
- lodash.findIndex = findIndex;
- lodash.findKey = findKey;
- lodash.findLast = findLast;
- lodash.findLastIndex = findLastIndex;
- lodash.findLastKey = findLastKey;
- lodash.floor = floor;
- lodash.forEach = forEach;
- lodash.forEachRight = forEachRight;
- lodash.forIn = forIn;
- lodash.forInRight = forInRight;
- lodash.forOwn = forOwn;
- lodash.forOwnRight = forOwnRight;
- lodash.get = get;
- lodash.gt = gt;
- lodash.gte = gte;
- lodash.has = has;
- lodash.hasIn = hasIn;
- lodash.head = head;
- lodash.identity = identity;
- lodash.includes = includes;
- lodash.indexOf = indexOf;
- lodash.inRange = inRange;
- lodash.invoke = invoke;
- lodash.isArguments = isArguments;
- lodash.isArray = isArray;
- lodash.isArrayBuffer = isArrayBuffer;
- lodash.isArrayLike = isArrayLike;
- lodash.isArrayLikeObject = isArrayLikeObject;
- lodash.isBoolean = isBoolean;
- lodash.isBuffer = isBuffer;
- lodash.isDate = isDate;
- lodash.isElement = isElement;
- lodash.isEmpty = isEmpty;
- lodash.isEqual = isEqual;
- lodash.isEqualWith = isEqualWith;
- lodash.isError = isError;
- lodash.isFinite = isFinite;
- lodash.isFunction = isFunction;
- lodash.isInteger = isInteger;
- lodash.isLength = isLength;
- lodash.isMap = isMap;
- lodash.isMatch = isMatch;
- lodash.isMatchWith = isMatchWith;
- lodash.isNaN = isNaN;
- lodash.isNative = isNative;
- lodash.isNil = isNil;
- lodash.isNull = isNull;
- lodash.isNumber = isNumber;
- lodash.isObject = isObject;
- lodash.isObjectLike = isObjectLike;
- lodash.isPlainObject = isPlainObject;
- lodash.isRegExp = isRegExp;
- lodash.isSafeInteger = isSafeInteger;
- lodash.isSet = isSet;
- lodash.isString = isString;
- lodash.isSymbol = isSymbol;
- lodash.isTypedArray = isTypedArray;
- lodash.isUndefined = isUndefined;
- lodash.isWeakMap = isWeakMap;
- lodash.isWeakSet = isWeakSet;
- lodash.join = join;
- lodash.kebabCase = kebabCase;
- lodash.last = last;
- lodash.lastIndexOf = lastIndexOf;
- lodash.lowerCase = lowerCase;
- lodash.lowerFirst = lowerFirst;
- lodash.lt = lt;
- lodash.lte = lte;
- lodash.max = max;
- lodash.maxBy = maxBy;
- lodash.mean = mean;
- lodash.meanBy = meanBy;
- lodash.min = min;
- lodash.minBy = minBy;
- lodash.stubArray = stubArray;
- lodash.stubFalse = stubFalse;
- lodash.stubObject = stubObject;
- lodash.stubString = stubString;
- lodash.stubTrue = stubTrue;
- lodash.multiply = multiply;
- lodash.nth = nth;
- lodash.noConflict = noConflict;
- lodash.noop = noop;
- lodash.now = now;
- lodash.pad = pad;
- lodash.padEnd = padEnd;
- lodash.padStart = padStart;
- lodash.parseInt = parseInt;
- lodash.random = random;
- lodash.reduce = reduce;
- lodash.reduceRight = reduceRight;
- lodash.repeat = repeat;
- lodash.replace = replace;
- lodash.result = result;
- lodash.round = round;
- lodash.runInContext = runInContext;
- lodash.sample = sample;
- lodash.size = size;
- lodash.snakeCase = snakeCase;
- lodash.some = some;
- lodash.sortedIndex = sortedIndex;
- lodash.sortedIndexBy = sortedIndexBy;
- lodash.sortedIndexOf = sortedIndexOf;
- lodash.sortedLastIndex = sortedLastIndex;
- lodash.sortedLastIndexBy = sortedLastIndexBy;
- lodash.sortedLastIndexOf = sortedLastIndexOf;
- lodash.startCase = startCase;
- lodash.startsWith = startsWith;
- lodash.subtract = subtract;
- lodash.sum = sum;
- lodash.sumBy = sumBy;
- lodash.template = template;
- lodash.times = times;
- lodash.toFinite = toFinite;
- lodash.toInteger = toInteger;
- lodash.toLength = toLength;
- lodash.toLower = toLower;
- lodash.toNumber = toNumber;
- lodash.toSafeInteger = toSafeInteger;
- lodash.toString = toString;
- lodash.toUpper = toUpper;
- lodash.trim = trim;
- lodash.trimEnd = trimEnd;
- lodash.trimStart = trimStart;
- lodash.truncate = truncate;
- lodash.unescape = unescape;
- lodash.uniqueId = uniqueId;
- lodash.upperCase = upperCase;
- lodash.upperFirst = upperFirst;
-
- // Add aliases.
- lodash.each = forEach;
- lodash.eachRight = forEachRight;
- lodash.first = head;
-
- mixin(lodash, (function() {
- var source = {};
- baseForOwn(lodash, function(func, methodName) {
- if (!hasOwnProperty.call(lodash.prototype, methodName)) {
- source[methodName] = func;
- }
- });
- return source;
- }()), { 'chain': false });
-
- /*------------------------------------------------------------------------*/
-
- /**
- * The semantic version number.
- *
- * @static
- * @memberOf _
- * @type {string}
- */
- lodash.VERSION = VERSION;
-
- // Assign default placeholders.
- arrayEach(['bind', 'bindKey', 'curry', 'curryRight', 'partial', 'partialRight'], function(methodName) {
- lodash[methodName].placeholder = lodash;
- });
-
- // Add `LazyWrapper` methods for `_.drop` and `_.take` variants.
- arrayEach(['drop', 'take'], function(methodName, index) {
- LazyWrapper.prototype[methodName] = function(n) {
- n = n === undefined ? 1 : nativeMax(toInteger(n), 0);
-
- var result = (this.__filtered__ && !index)
- ? new LazyWrapper(this)
- : this.clone();
-
- if (result.__filtered__) {
- result.__takeCount__ = nativeMin(n, result.__takeCount__);
- } else {
- result.__views__.push({
- 'size': nativeMin(n, MAX_ARRAY_LENGTH),
- 'type': methodName + (result.__dir__ < 0 ? 'Right' : '')
- });
- }
- return result;
- };
-
- LazyWrapper.prototype[methodName + 'Right'] = function(n) {
- return this.reverse()[methodName](n).reverse();
- };
- });
-
- // Add `LazyWrapper` methods that accept an `iteratee` value.
- arrayEach(['filter', 'map', 'takeWhile'], function(methodName, index) {
- var type = index + 1,
- isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG;
-
- LazyWrapper.prototype[methodName] = function(iteratee) {
- var result = this.clone();
- result.__iteratees__.push({
- 'iteratee': getIteratee(iteratee, 3),
- 'type': type
- });
- result.__filtered__ = result.__filtered__ || isFilter;
- return result;
- };
- });
-
- // Add `LazyWrapper` methods for `_.head` and `_.last`.
- arrayEach(['head', 'last'], function(methodName, index) {
- var takeName = 'take' + (index ? 'Right' : '');
-
- LazyWrapper.prototype[methodName] = function() {
- return this[takeName](1).value()[0];
- };
- });
-
- // Add `LazyWrapper` methods for `_.initial` and `_.tail`.
- arrayEach(['initial', 'tail'], function(methodName, index) {
- var dropName = 'drop' + (index ? '' : 'Right');
-
- LazyWrapper.prototype[methodName] = function() {
- return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1);
- };
- });
-
- LazyWrapper.prototype.compact = function() {
- return this.filter(identity);
- };
-
- LazyWrapper.prototype.find = function(predicate) {
- return this.filter(predicate).head();
- };
-
- LazyWrapper.prototype.findLast = function(predicate) {
- return this.reverse().find(predicate);
- };
-
- LazyWrapper.prototype.invokeMap = baseRest(function(path, args) {
- if (typeof path == 'function') {
- return new LazyWrapper(this);
- }
- return this.map(function(value) {
- return baseInvoke(value, path, args);
- });
- });
-
- LazyWrapper.prototype.reject = function(predicate) {
- return this.filter(negate(getIteratee(predicate)));
- };
-
- LazyWrapper.prototype.slice = function(start, end) {
- start = toInteger(start);
-
- var result = this;
- if (result.__filtered__ && (start > 0 || end < 0)) {
- return new LazyWrapper(result);
- }
- if (start < 0) {
- result = result.takeRight(-start);
- } else if (start) {
- result = result.drop(start);
- }
- if (end !== undefined) {
- end = toInteger(end);
- result = end < 0 ? result.dropRight(-end) : result.take(end - start);
- }
- return result;
- };
-
- LazyWrapper.prototype.takeRightWhile = function(predicate) {
- return this.reverse().takeWhile(predicate).reverse();
- };
-
- LazyWrapper.prototype.toArray = function() {
- return this.take(MAX_ARRAY_LENGTH);
- };
-
- // Add `LazyWrapper` methods to `lodash.prototype`.
- baseForOwn(LazyWrapper.prototype, function(func, methodName) {
- var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName),
- isTaker = /^(?:head|last)$/.test(methodName),
- lodashFunc = lodash[isTaker ? ('take' + (methodName == 'last' ? 'Right' : '')) : methodName],
- retUnwrapped = isTaker || /^find/.test(methodName);
-
- if (!lodashFunc) {
- return;
- }
- lodash.prototype[methodName] = function() {
- var value = this.__wrapped__,
- args = isTaker ? [1] : arguments,
- isLazy = value instanceof LazyWrapper,
- iteratee = args[0],
- useLazy = isLazy || isArray(value);
-
- var interceptor = function(value) {
- var result = lodashFunc.apply(lodash, arrayPush([value], args));
- return (isTaker && chainAll) ? result[0] : result;
- };
-
- if (useLazy && checkIteratee && typeof iteratee == 'function' && iteratee.length != 1) {
- // Avoid lazy use if the iteratee has a "length" value other than `1`.
- isLazy = useLazy = false;
- }
- var chainAll = this.__chain__,
- isHybrid = !!this.__actions__.length,
- isUnwrapped = retUnwrapped && !chainAll,
- onlyLazy = isLazy && !isHybrid;
-
- if (!retUnwrapped && useLazy) {
- value = onlyLazy ? value : new LazyWrapper(this);
- var result = func.apply(value, args);
- result.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined });
- return new LodashWrapper(result, chainAll);
- }
- if (isUnwrapped && onlyLazy) {
- return func.apply(this, args);
- }
- result = this.thru(interceptor);
- return isUnwrapped ? (isTaker ? result.value()[0] : result.value()) : result;
- };
- });
-
- // Add `Array` methods to `lodash.prototype`.
- arrayEach(['pop', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) {
- var func = arrayProto[methodName],
- chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru',
- retUnwrapped = /^(?:pop|shift)$/.test(methodName);
-
- lodash.prototype[methodName] = function() {
- var args = arguments;
- if (retUnwrapped && !this.__chain__) {
- var value = this.value();
- return func.apply(isArray(value) ? value : [], args);
- }
- return this[chainName](function(value) {
- return func.apply(isArray(value) ? value : [], args);
- });
- };
- });
-
- // Map minified method names to their real names.
- baseForOwn(LazyWrapper.prototype, function(func, methodName) {
- var lodashFunc = lodash[methodName];
- if (lodashFunc) {
- var key = (lodashFunc.name + ''),
- names = realNames[key] || (realNames[key] = []);
-
- names.push({ 'name': methodName, 'func': lodashFunc });
- }
- });
-
- realNames[createHybrid(undefined, WRAP_BIND_KEY_FLAG).name] = [{
- 'name': 'wrapper',
- 'func': undefined
- }];
-
- // Add methods to `LazyWrapper`.
- LazyWrapper.prototype.clone = lazyClone;
- LazyWrapper.prototype.reverse = lazyReverse;
- LazyWrapper.prototype.value = lazyValue;
-
- // Add chain sequence methods to the `lodash` wrapper.
- lodash.prototype.at = wrapperAt;
- lodash.prototype.chain = wrapperChain;
- lodash.prototype.commit = wrapperCommit;
- lodash.prototype.next = wrapperNext;
- lodash.prototype.plant = wrapperPlant;
- lodash.prototype.reverse = wrapperReverse;
- lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue;
-
- // Add lazy aliases.
- lodash.prototype.first = lodash.prototype.head;
-
- if (symIterator) {
- lodash.prototype[symIterator] = wrapperToIterator;
- }
- return lodash;
- });
-
- /*--------------------------------------------------------------------------*/
-
- // Export lodash.
- var _ = runInContext();
-
- // Some AMD build optimizers, like r.js, check for condition patterns like:
- if (typeof define == 'function' && typeof define.amd == 'object' && define.amd) {
- // Expose Lodash on the global object to prevent errors when Lodash is
- // loaded by a script tag in the presence of an AMD loader.
- // See http://requirejs.org/docs/errors.html#mismatch for more details.
- // Use `_.noConflict` to remove Lodash from the global object.
- root._ = _;
-
- // Define as an anonymous module so, through path mapping, it can be
- // referenced as the "underscore" module.
- define(function() {
- return _;
- });
- }
- // Check for `exports` after `define` in case a build optimizer adds it.
- else if (freeModule) {
- // Export for Node.js.
- (freeModule.exports = _)._ = _;
- // Export for CommonJS support.
- freeExports._ = _;
- }
- else {
- // Export to the global object.
- root._ = _;
- }
-}.call(this));
+(function(){function n(n,t){return n.set(t[0],t[1]),n}function t(n,t){return n.add(t),n}function r(n,t,r){switch(r.length){case 0:return n.call(t);case 1:return n.call(t,r[0]);case 2:return n.call(t,r[0],r[1]);case 3:return n.call(t,r[0],r[1],r[2])}return n.apply(t,r)}function e(n,t,r,e){for(var u=-1,i=null==n?0:n.length;++u<i;){var o=n[u];t(e,o,r(o),n)}return e}function u(n,t){for(var r=-1,e=null==n?0:n.length;++r<e&&t(n[r],r,n)!==!1;);return n}function i(n,t){for(var r=null==n?0:n.length;r--&&t(n[r],r,n)!==!1;);return n}function o(n,t){for(var r=-1,e=null==n?0:n.length;++r<e;)if(!t(n[r],r,n))return!1;return!0}function f(n,t){for(var r=-1,e=null==n?0:n.length,u=0,i=[];++r<e;){var o=n[r];t(o,r,n)&&(i[u++]=o)}return i}function a(n,t){var r=null==n?0:n.length;return!!r&&b(n,t,0)>-1}function c(n,t,r){for(var e=-1,u=null==n?0:n.length;++e<u;)if(r(t,n[e]))return!0;return!1}function l(n,t){for(var r=-1,e=null==n?0:n.length,u=Array(e);++r<e;)u[r]=t(n[r],r,n);return u}function s(n,t){for(var r=-1,e=t.length,u=n.length;++r<e;)n[u+r]=t[r];return n}function h(n,t,r,e){var u=-1,i=null==n?0:n.length;for(e&&i&&(r=n[++u]);++u<i;)r=t(r,n[u],u,n);return r}function p(n,t,r,e){var u=null==n?0:n.length;for(e&&u&&(r=n[--u]);u--;)r=t(r,n[u],u,n);return r}function v(n,t){for(var r=-1,e=null==n?0:n.length;++r<e;)if(t(n[r],r,n))return!0;return!1}function _(n){return n.split("")}function g(n){return n.match(Dt)||[]}function y(n,t,r){var e;return r(n,function(n,r,u){if(t(n,r,u))return e=r,!1}),e}function d(n,t,r,e){for(var u=n.length,i=r+(e?1:-1);e?i--:++i<u;)if(t(n[i],i,n))return i;return-1}function b(n,t,r){return t===t?K(n,t,r):d(n,m,r)}function w(n,t,r,e){for(var u=r-1,i=n.length;++u<i;)if(e(n[u],t))return u;return-1}function m(n){return n!==n}function x(n,t){var r=null==n?0:n.length;return r?I(n,t)/r:Ln}function j(n){return function(t){return null==t?X:t[n]}}function A(n){return function(t){return null==n?X:n[t]}}function k(n,t,r,e,u){return u(n,function(n,u,i){r=e?(e=!1,n):t(r,n,u,i)}),r}function O(n,t){var r=n.length;for(n.sort(t);r--;)n[r]=n[r].value;return n}function I(n,t){for(var r,e=-1,u=n.length;++e<u;){var i=t(n[e]);i!==X&&(r=r===X?i:r+i)}return r}function R(n,t){for(var r=-1,e=Array(n);++r<n;)e[r]=t(r);return e}function z(n,t){return l(t,function(t){return[t,n[t]]})}function E(n){return function(t){return n(t)}}function S(n,t){return l(t,function(t){return n[t]})}function W(n,t){return n.has(t)}function L(n,t){for(var r=-1,e=n.length;++r<e&&b(t,n[r],0)>-1;);return r}function C(n,t){for(var r=n.length;r--&&b(t,n[r],0)>-1;);return r}function U(n,t){for(var r=n.length,e=0;r--;)n[r]===t&&++e;return e}function B(n){return"\\"+Yr[n]}function T(n,t){return null==n?X:n[t]}function $(n){return Nr.test(n)}function D(n){return Pr.test(n)}function M(n){for(var t,r=[];!(t=n.next()).done;)r.push(t.value);return r}function F(n){var t=-1,r=Array(n.size);return n.forEach(function(n,e){r[++t]=[e,n]}),r}function N(n,t){return function(r){return n(t(r))}}function P(n,t){for(var r=-1,e=n.length,u=0,i=[];++r<e;){var o=n[r];o!==t&&o!==fn||(n[r]=fn,i[u++]=r)}return i}function q(n){var t=-1,r=Array(n.size);return n.forEach(function(n){r[++t]=n}),r}function Z(n){var t=-1,r=Array(n.size);return n.forEach(function(n){r[++t]=[n,n]}),r}function K(n,t,r){for(var e=r-1,u=n.length;++e<u;)if(n[e]===t)return e;return-1}function V(n,t,r){for(var e=r+1;e--;)if(n[e]===t)return e;return e}function G(n){return $(n)?J(n):ve(n)}function H(n){return $(n)?Y(n):_(n)}function J(n){for(var t=Mr.lastIndex=0;Mr.test(n);)++t;return t}function Y(n){return n.match(Mr)||[]}function Q(n){return n.match(Fr)||[]}var X,nn="4.17.4",tn=200,rn="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",en="Expected a function",un="__lodash_hash_undefined__",on=500,fn="__lodash_placeholder__",an=1,cn=2,ln=4,sn=1,hn=2,pn=1,vn=2,_n=4,gn=8,yn=16,dn=32,bn=64,wn=128,mn=256,xn=512,jn=30,An="...",kn=800,On=16,In=1,Rn=2,zn=3,En=1/0,Sn=9007199254740991,Wn=1.7976931348623157e308,Ln=NaN,Cn=4294967295,Un=Cn-1,Bn=Cn>>>1,Tn=[["ary",wn],["bind",pn],["bindKey",vn],["curry",gn],["curryRight",yn],["flip",xn],["partial",dn],["partialRight",bn],["rearg",mn]],$n="[object Arguments]",Dn="[object Array]",Mn="[object AsyncFunction]",Fn="[object Boolean]",Nn="[object Date]",Pn="[object DOMException]",qn="[object Error]",Zn="[object Function]",Kn="[object GeneratorFunction]",Vn="[object Map]",Gn="[object Number]",Hn="[object Null]",Jn="[object Object]",Yn="[object Promise]",Qn="[object Proxy]",Xn="[object RegExp]",nt="[object Set]",tt="[object String]",rt="[object Symbol]",et="[object Undefined]",ut="[object WeakMap]",it="[object WeakSet]",ot="[object ArrayBuffer]",ft="[object DataView]",at="[object Float32Array]",ct="[object Float64Array]",lt="[object Int8Array]",st="[object Int16Array]",ht="[object Int32Array]",pt="[object Uint8Array]",vt="[object Uint8ClampedArray]",_t="[object Uint16Array]",gt="[object Uint32Array]",yt=/\b__p \+= '';/g,dt=/\b(__p \+=) '' \+/g,bt=/(__e\(.*?\)|\b__t\)) \+\n'';/g,wt=/&(?:amp|lt|gt|quot|#39);/g,mt=/[&<>"']/g,xt=RegExp(wt.source),jt=RegExp(mt.source),At=/<%-([\s\S]+?)%>/g,kt=/<%([\s\S]+?)%>/g,Ot=/<%=([\s\S]+?)%>/g,It=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Rt=/^\w*$/,zt=/^\./,Et=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,St=/[\\^$.*+?()[\]{}|]/g,Wt=RegExp(St.source),Lt=/^\s+|\s+$/g,Ct=/^\s+/,Ut=/\s+$/,Bt=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Tt=/\{\n\/\* \[wrapped with (.+)\] \*/,$t=/,? & /,Dt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Mt=/\\(\\)?/g,Ft=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Nt=/\w*$/,Pt=/^[-+]0x[0-9a-f]+$/i,qt=/^0b[01]+$/i,Zt=/^\[object .+?Constructor\]$/,Kt=/^0o[0-7]+$/i,Vt=/^(?:0|[1-9]\d*)$/,Gt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Ht=/($^)/,Jt=/['\n\r\u2028\u2029\\]/g,Yt="\\ud800-\\udfff",Qt="\\u0300-\\u036f",Xt="\\ufe20-\\ufe2f",nr="\\u20d0-\\u20ff",tr=Qt+Xt+nr,rr="\\u2700-\\u27bf",er="a-z\\xdf-\\xf6\\xf8-\\xff",ur="\\xac\\xb1\\xd7\\xf7",ir="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",or="\\u2000-\\u206f",fr=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",ar="A-Z\\xc0-\\xd6\\xd8-\\xde",cr="\\ufe0e\\ufe0f",lr=ur+ir+or+fr,sr="['’]",hr="["+Yt+"]",pr="["+lr+"]",vr="["+tr+"]",_r="\\d+",gr="["+rr+"]",yr="["+er+"]",dr="[^"+Yt+lr+_r+rr+er+ar+"]",br="\\ud83c[\\udffb-\\udfff]",wr="(?:"+vr+"|"+br+")",mr="[^"+Yt+"]",xr="(?:\\ud83c[\\udde6-\\uddff]){2}",jr="[\\ud800-\\udbff][\\udc00-\\udfff]",Ar="["+ar+"]",kr="\\u200d",Or="(?:"+yr+"|"+dr+")",Ir="(?:"+Ar+"|"+dr+")",Rr="(?:"+sr+"(?:d|ll|m|re|s|t|ve))?",zr="(?:"+sr+"(?:D|LL|M|RE|S|T|VE))?",Er=wr+"?",Sr="["+cr+"]?",Wr="(?:"+kr+"(?:"+[mr,xr,jr].join("|")+")"+Sr+Er+")*",Lr="\\d*(?:(?:1st|2nd|3rd|(?![123])\\dth)\\b)",Cr="\\d*(?:(?:1ST|2ND|3RD|(?![123])\\dTH)\\b)",Ur=Sr+Er+Wr,Br="(?:"+[gr,xr,jr].join("|")+")"+Ur,Tr="(?:"+[mr+vr+"?",vr,xr,jr,hr].join("|")+")",$r=RegExp(sr,"g"),Dr=RegExp(vr,"g"),Mr=RegExp(br+"(?="+br+")|"+Tr+Ur,"g"),Fr=RegExp([Ar+"?"+yr+"+"+Rr+"(?="+[pr,Ar,"$"].join("|")+")",Ir+"+"+zr+"(?="+[pr,Ar+Or,"$"].join("|")+")",Ar+"?"+Or+"+"+Rr,Ar+"+"+zr,Cr,Lr,_r,Br].join("|"),"g"),Nr=RegExp("["+kr+Yt+tr+cr+"]"),Pr=/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,qr=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Zr=-1,Kr={};Kr[at]=Kr[ct]=Kr[lt]=Kr[st]=Kr[ht]=Kr[pt]=Kr[vt]=Kr[_t]=Kr[gt]=!0,Kr[$n]=Kr[Dn]=Kr[ot]=Kr[Fn]=Kr[ft]=Kr[Nn]=Kr[qn]=Kr[Zn]=Kr[Vn]=Kr[Gn]=Kr[Jn]=Kr[Xn]=Kr[nt]=Kr[tt]=Kr[ut]=!1;var Vr={};Vr[$n]=Vr[Dn]=Vr[ot]=Vr[ft]=Vr[Fn]=Vr[Nn]=Vr[at]=Vr[ct]=Vr[lt]=Vr[st]=Vr[ht]=Vr[Vn]=Vr[Gn]=Vr[Jn]=Vr[Xn]=Vr[nt]=Vr[tt]=Vr[rt]=Vr[pt]=Vr[vt]=Vr[_t]=Vr[gt]=!0,Vr[qn]=Vr[Zn]=Vr[ut]=!1;var Gr={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"},Hr={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Jr={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},Yr={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Qr=parseFloat,Xr=parseInt,ne="object"==typeof global&&global&&global.Object===Object&&global,te="object"==typeof self&&self&&self.Object===Object&&self,re=ne||te||Function("return this")(),ee="object"==typeof exports&&exports&&!exports.nodeType&&exports,ue=ee&&"object"==typeof module&&module&&!module.nodeType&&module,ie=ue&&ue.exports===ee,oe=ie&&ne.process,fe=function(){try{return oe&&oe.binding&&oe.binding("util")}catch(n){}}(),ae=fe&&fe.isArrayBuffer,ce=fe&&fe.isDate,le=fe&&fe.isMap,se=fe&&fe.isRegExp,he=fe&&fe.isSet,pe=fe&&fe.isTypedArray,ve=j("length"),_e=A(Gr),ge=A(Hr),ye=A(Jr),de=function _(A){function K(n){if(la(n)&&!mh(n)&&!(n instanceof Dt)){if(n instanceof Y)return n;if(ml.call(n,"__wrapped__"))return io(n)}return new Y(n)}function J(){}function Y(n,t){this.__wrapped__=n,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=X}function Dt(n){this.__wrapped__=n,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=Cn,this.__views__=[]}function Yt(){var n=new Dt(this.__wrapped__);return n.__actions__=Mu(this.__actions__),n.__dir__=this.__dir__,n.__filtered__=this.__filtered__,n.__iteratees__=Mu(this.__iteratees__),n.__takeCount__=this.__takeCount__,n.__views__=Mu(this.__views__),n}function Qt(){if(this.__filtered__){var n=new Dt(this);n.__dir__=-1,n.__filtered__=!0}else n=this.clone(),n.__dir__*=-1;return n}function Xt(){var n=this.__wrapped__.value(),t=this.__dir__,r=mh(n),e=t<0,u=r?n.length:0,i=zi(0,u,this.__views__),o=i.start,f=i.end,a=f-o,c=e?f:o-1,l=this.__iteratees__,s=l.length,h=0,p=Yl(a,this.__takeCount__);if(!r||!e&&u==a&&p==a)return mu(n,this.__actions__);var v=[];n:for(;a--&&h<p;){c+=t;for(var _=-1,g=n[c];++_<s;){var y=l[_],d=y.iteratee,b=y.type,w=d(g);if(b==Rn)g=w;else if(!w){if(b==In)continue n;break n}}v[h++]=g}return v}function nr(n){var t=-1,r=null==n?0:n.length;for(this.clear();++t<r;){var e=n[t];this.set(e[0],e[1])}}function tr(){this.__data__=fs?fs(null):{},this.size=0}function rr(n){var t=this.has(n)&&delete this.__data__[n];return this.size-=t?1:0,t}function er(n){var t=this.__data__;if(fs){var r=t[n];return r===un?X:r}return ml.call(t,n)?t[n]:X}function ur(n){var t=this.__data__;return fs?t[n]!==X:ml.call(t,n)}function ir(n,t){var r=this.__data__;return this.size+=this.has(n)?0:1,r[n]=fs&&t===X?un:t,this}function or(n){var t=-1,r=null==n?0:n.length;for(this.clear();++t<r;){var e=n[t];this.set(e[0],e[1])}}function fr(){this.__data__=[],this.size=0}function ar(n){var t=this.__data__,r=Lr(t,n);if(r<0)return!1;var e=t.length-1;return r==e?t.pop():Ul.call(t,r,1),--this.size,!0}function cr(n){var t=this.__data__,r=Lr(t,n);return r<0?X:t[r][1]}function lr(n){return Lr(this.__data__,n)>-1}function sr(n,t){var r=this.__data__,e=Lr(r,n);return e<0?(++this.size,r.push([n,t])):r[e][1]=t,this}function hr(n){var t=-1,r=null==n?0:n.length;for(this.clear();++t<r;){var e=n[t];this.set(e[0],e[1])}}function pr(){this.size=0,this.__data__={hash:new nr,map:new(es||or),string:new nr}}function vr(n){var t=ki(this,n).delete(n);return this.size-=t?1:0,t}function _r(n){return ki(this,n).get(n)}function gr(n){return ki(this,n).has(n)}function yr(n,t){var r=ki(this,n),e=r.size;return r.set(n,t),this.size+=r.size==e?0:1,this}function dr(n){var t=-1,r=null==n?0:n.length;for(this.__data__=new hr;++t<r;)this.add(n[t])}function br(n){return this.__data__.set(n,un),this}function wr(n){return this.__data__.has(n)}function mr(n){var t=this.__data__=new or(n);this.size=t.size}function xr(){this.__data__=new or,this.size=0}function jr(n){var t=this.__data__,r=t.delete(n);return this.size=t.size,r}function Ar(n){return this.__data__.get(n)}function kr(n){return this.__data__.has(n)}function Or(n,t){var r=this.__data__;if(r instanceof or){var e=r.__data__;if(!es||e.length<tn-1)return e.push([n,t]),this.size=++r.size,this;r=this.__data__=new hr(e)}return r.set(n,t),this.size=r.size,this}function Ir(n,t){var r=mh(n),e=!r&&wh(n),u=!r&&!e&&jh(n),i=!r&&!e&&!u&&Rh(n),o=r||e||u||i,f=o?R(n.length,vl):[],a=f.length;for(var c in n)!t&&!ml.call(n,c)||o&&("length"==c||u&&("offset"==c||"parent"==c)||i&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||Ti(c,a))||f.push(c);return f}function Rr(n){var t=n.length;return t?n[ru(0,t-1)]:X}function zr(n,t){return to(Mu(n),Fr(t,0,n.length))}function Er(n){return to(Mu(n))}function Sr(n,t,r){(r===X||Jf(n[t],r))&&(r!==X||t in n)||Tr(n,t,r)}function Wr(n,t,r){var e=n[t];ml.call(n,t)&&Jf(e,r)&&(r!==X||t in n)||Tr(n,t,r)}function Lr(n,t){for(var r=n.length;r--;)if(Jf(n[r][0],t))return r;return-1}function Cr(n,t,r,e){return bs(n,function(n,u,i){t(e,n,r(n),i)}),e}function Ur(n,t){return n&&Fu(t,Za(t),n)}function Br(n,t){return n&&Fu(t,Ka(t),n)}function Tr(n,t,r){"__proto__"==t&&Dl?Dl(n,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):n[t]=r}function Mr(n,t){for(var r=-1,e=t.length,u=fl(e),i=null==n;++r<e;)u[r]=i?X:Na(n,t[r]);return u}function Fr(n,t,r){return n===n&&(r!==X&&(n=n<=r?n:r),t!==X&&(n=n>=t?n:t)),n}function Nr(n,t,r,e,i,o){var f,a=t&an,c=t&cn,l=t&ln;if(r&&(f=i?r(n,e,i,o):r(n)),f!==X)return f;if(!ca(n))return n;var s=mh(n);if(s){if(f=Wi(n),!a)return Mu(n,f)}else{var h=Ss(n),p=h==Zn||h==Kn;if(jh(n))return Ru(n,a);if(h==Jn||h==$n||p&&!i){if(f=c||p?{}:Li(n),!a)return c?Pu(n,Br(f,n)):Nu(n,Ur(f,n))}else{if(!Vr[h])return i?n:{};f=Ci(n,h,Nr,a)}}o||(o=new mr);var v=o.get(n);if(v)return v;o.set(n,f);var _=l?c?mi:wi:c?Ka:Za,g=s?X:_(n);return u(g||n,function(e,u){g&&(u=e,e=n[u]),Wr(f,u,Nr(e,t,r,u,n,o))}),f}function Pr(n){var t=Za(n);return function(r){return Gr(r,n,t)}}function Gr(n,t,r){var e=r.length;if(null==n)return!e;for(n=hl(n);e--;){var u=r[e],i=t[u],o=n[u];if(o===X&&!(u in n)||!i(o))return!1}return!0}function Hr(n,t,r){if("function"!=typeof n)throw new _l(en);return Cs(function(){n.apply(X,r)},t)}function Jr(n,t,r,e){var u=-1,i=a,o=!0,f=n.length,s=[],h=t.length;if(!f)return s;r&&(t=l(t,E(r))),e?(i=c,o=!1):t.length>=tn&&(i=W,o=!1,t=new dr(t));n:for(;++u<f;){var p=n[u],v=null==r?p:r(p);if(p=e||0!==p?p:0,o&&v===v){for(var _=h;_--;)if(t[_]===v)continue n;s.push(p)}else i(t,v,e)||s.push(p)}return s}function Yr(n,t){var r=!0;return bs(n,function(n,e,u){return r=!!t(n,e,u)}),r}function ne(n,t,r){for(var e=-1,u=n.length;++e<u;){var i=n[e],o=t(i);if(null!=o&&(f===X?o===o&&!ma(o):r(o,f)))var f=o,a=i}return a}function te(n,t,r,e){var u=n.length;for(r=Ia(r),r<0&&(r=-r>u?0:u+r),e=e===X||e>u?u:Ia(e),e<0&&(e+=u),e=r>e?0:Ra(e);r<e;)n[r++]=t;return n}function ee(n,t){var r=[];return bs(n,function(n,e,u){t(n,e,u)&&r.push(n)}),r}function ue(n,t,r,e,u){var i=-1,o=n.length;for(r||(r=Bi),u||(u=[]);++i<o;){var f=n[i];t>0&&r(f)?t>1?ue(f,t-1,r,e,u):s(u,f):e||(u[u.length]=f)}return u}function oe(n,t){return n&&ms(n,t,Za)}function fe(n,t){return n&&xs(n,t,Za)}function ve(n,t){return f(t,function(t){return oa(n[t])})}function de(n,t){t=Ou(t,n);for(var r=0,e=t.length;null!=n&&r<e;)n=n[ro(t[r++])];return r&&r==e?n:X}function we(n,t,r){var e=t(n);return mh(n)?e:s(e,r(n))}function me(n){return null==n?n===X?et:Hn:$l&&$l in hl(n)?Ri(n):Hi(n)}function xe(n,t){return n>t}function je(n,t){return null!=n&&ml.call(n,t)}function Ae(n,t){return null!=n&&t in hl(n)}function ke(n,t,r){return n>=Yl(t,r)&&n<Jl(t,r)}function Oe(n,t,r){for(var e=r?c:a,u=n[0].length,i=n.length,o=i,f=fl(i),s=1/0,h=[];o--;){var p=n[o];o&&t&&(p=l(p,E(t))),s=Yl(p.length,s),f[o]=!r&&(t||u>=120&&p.length>=120)?new dr(o&&p):X}p=n[0];var v=-1,_=f[0];n:for(;++v<u&&h.length<s;){var g=p[v],y=t?t(g):g;if(g=r||0!==g?g:0,!(_?W(_,y):e(h,y,r))){for(o=i;--o;){var d=f[o];if(!(d?W(d,y):e(n[o],y,r)))continue n}_&&_.push(y),h.push(g)}}return h}function Ie(n,t,r,e){return oe(n,function(n,u,i){t(e,r(n),u,i)}),e}function Re(n,t,e){t=Ou(t,n),n=Yi(n,t);var u=null==n?n:n[ro(ko(t))];return null==u?X:r(u,n,e)}function ze(n){return la(n)&&me(n)==$n}function Ee(n){return la(n)&&me(n)==ot}function Se(n){return la(n)&&me(n)==Nn}function We(n,t,r,e,u){return n===t||(null==n||null==t||!la(n)&&!la(t)?n!==n&&t!==t:Le(n,t,r,e,We,u))}function Le(n,t,r,e,u,i){var o=mh(n),f=mh(t),a=o?Dn:Ss(n),c=f?Dn:Ss(t);a=a==$n?Jn:a,c=c==$n?Jn:c;var l=a==Jn,s=c==Jn,h=a==c;if(h&&jh(n)){if(!jh(t))return!1;o=!0,l=!1}if(h&&!l)return i||(i=new mr),o||Rh(n)?gi(n,t,r,e,u,i):yi(n,t,a,r,e,u,i);if(!(r&sn)){var p=l&&ml.call(n,"__wrapped__"),v=s&&ml.call(t,"__wrapped__");if(p||v){var _=p?n.value():n,g=v?t.value():t;return i||(i=new mr),u(_,g,r,e,i)}}return!!h&&(i||(i=new mr),di(n,t,r,e,u,i))}function Ce(n){return la(n)&&Ss(n)==Vn}function Ue(n,t,r,e){var u=r.length,i=u,o=!e;if(null==n)return!i;for(n=hl(n);u--;){var f=r[u];if(o&&f[2]?f[1]!==n[f[0]]:!(f[0]in n))return!1}for(;++u<i;){f=r[u];var a=f[0],c=n[a],l=f[1];if(o&&f[2]){if(c===X&&!(a in n))return!1}else{var s=new mr;if(e)var h=e(c,l,a,n,t,s);if(!(h===X?We(l,c,sn|hn,e,s):h))return!1}}return!0}function Be(n){if(!ca(n)||Ni(n))return!1;var t=oa(n)?Il:Zt;return t.test(eo(n))}function Te(n){return la(n)&&me(n)==Xn}function $e(n){return la(n)&&Ss(n)==nt}function De(n){return la(n)&&aa(n.length)&&!!Kr[me(n)]}function Me(n){return"function"==typeof n?n:null==n?Uc:"object"==typeof n?mh(n)?Ke(n[0],n[1]):Ze(n):Pc(n)}function Fe(n){if(!Pi(n))return Hl(n);var t=[];for(var r in hl(n))ml.call(n,r)&&"constructor"!=r&&t.push(r);return t}function Ne(n){if(!ca(n))return Gi(n);var t=Pi(n),r=[];for(var e in n)("constructor"!=e||!t&&ml.call(n,e))&&r.push(e);return r}function Pe(n,t){return n<t}function qe(n,t){var r=-1,e=Yf(n)?fl(n.length):[];return bs(n,function(n,u,i){e[++r]=t(n,u,i)}),e}function Ze(n){var t=Oi(n);return 1==t.length&&t[0][2]?Zi(t[0][0],t[0][1]):function(r){return r===n||Ue(r,n,t)}}function Ke(n,t){return Di(n)&&qi(t)?Zi(ro(n),t):function(r){var e=Na(r,n);return e===X&&e===t?qa(r,n):We(t,e,sn|hn)}}function Ve(n,t,r,e,u){n!==t&&ms(t,function(i,o){if(ca(i))u||(u=new mr),Ge(n,t,o,r,Ve,e,u);else{var f=e?e(n[o],i,o+"",n,t,u):X;f===X&&(f=i),Sr(n,o,f)}},Ka)}function Ge(n,t,r,e,u,i,o){var f=n[r],a=t[r],c=o.get(a);if(c)return void Sr(n,r,c);var l=i?i(f,a,r+"",n,t,o):X,s=l===X;if(s){var h=mh(a),p=!h&&jh(a),v=!h&&!p&&Rh(a);l=a,h||p||v?mh(f)?l=f:Qf(f)?l=Mu(f):p?(s=!1,l=Ru(a,!0)):v?(s=!1,l=Uu(a,!0)):l=[]:da(a)||wh(a)?(l=f,wh(f)?l=Ea(f):(!ca(f)||e&&oa(f))&&(l=Li(a))):s=!1}s&&(o.set(a,l),u(l,a,e,i,o),o.delete(a)),Sr(n,r,l)}function He(n,t){var r=n.length;if(r)return t+=t<0?r:0,Ti(t,r)?n[t]:X}function Je(n,t,r){var e=-1;t=l(t.length?t:[Uc],E(Ai()));var u=qe(n,function(n,r,u){var i=l(t,function(t){return t(n)});return{criteria:i,index:++e,value:n}});return O(u,function(n,t){return Tu(n,t,r)})}function Ye(n,t){return Qe(n,t,function(t,r){return qa(n,r)})}function Qe(n,t,r){for(var e=-1,u=t.length,i={};++e<u;){var o=t[e],f=de(n,o);r(f,o)&&au(i,Ou(o,n),f)}return i}function Xe(n){return function(t){return de(t,n)}}function nu(n,t,r,e){var u=e?w:b,i=-1,o=t.length,f=n;for(n===t&&(t=Mu(t)),r&&(f=l(n,E(r)));++i<o;)for(var a=0,c=t[i],s=r?r(c):c;(a=u(f,s,a,e))>-1;)f!==n&&Ul.call(f,a,1),Ul.call(n,a,1);return n}function tu(n,t){for(var r=n?t.length:0,e=r-1;r--;){var u=t[r];if(r==e||u!==i){var i=u;Ti(u)?Ul.call(n,u,1):du(n,u)}}return n}function ru(n,t){return n+ql(ns()*(t-n+1))}function eu(n,t,r,e){for(var u=-1,i=Jl(Pl((t-n)/(r||1)),0),o=fl(i);i--;)o[e?i:++u]=n,n+=r;return o}function uu(n,t){var r="";if(!n||t<1||t>Sn)return r;do t%2&&(r+=n),t=ql(t/2),t&&(n+=n);while(t);return r}function iu(n,t){return Us(Ji(n,t,Uc),n+"")}function ou(n){return Rr(uc(n))}function fu(n,t){var r=uc(n);return to(r,Fr(t,0,r.length))}function au(n,t,r,e){if(!ca(n))return n;t=Ou(t,n);for(var u=-1,i=t.length,o=i-1,f=n;null!=f&&++u<i;){var a=ro(t[u]),c=r;if(u!=o){var l=f[a];c=e?e(l,a,f):X,c===X&&(c=ca(l)?l:Ti(t[u+1])?[]:{})}Wr(f,a,c),f=f[a]}return n}function cu(n){return to(uc(n))}function lu(n,t,r){var e=-1,u=n.length;t<0&&(t=-t>u?0:u+t),r=r>u?u:r,r<0&&(r+=u),u=t>r?0:r-t>>>0,t>>>=0;for(var i=fl(u);++e<u;)i[e]=n[e+t];return i}function su(n,t){var r;return bs(n,function(n,e,u){return r=t(n,e,u),!r}),!!r}function hu(n,t,r){var e=0,u=null==n?e:n.length;if("number"==typeof t&&t===t&&u<=Bn){for(;e<u;){var i=e+u>>>1,o=n[i];null!==o&&!ma(o)&&(r?o<=t:o<t)?e=i+1:u=i}return u}return pu(n,t,Uc,r)}function pu(n,t,r,e){t=r(t);for(var u=0,i=null==n?0:n.length,o=t!==t,f=null===t,a=ma(t),c=t===X;u<i;){var l=ql((u+i)/2),s=r(n[l]),h=s!==X,p=null===s,v=s===s,_=ma(s);if(o)var g=e||v;else g=c?v&&(e||h):f?v&&h&&(e||!p):a?v&&h&&!p&&(e||!_):!p&&!_&&(e?s<=t:s<t);g?u=l+1:i=l}return Yl(i,Un)}function vu(n,t){for(var r=-1,e=n.length,u=0,i=[];++r<e;){var o=n[r],f=t?t(o):o;if(!r||!Jf(f,a)){var a=f;i[u++]=0===o?0:o}}return i}function _u(n){return"number"==typeof n?n:ma(n)?Ln:+n}function gu(n){if("string"==typeof n)return n;if(mh(n))return l(n,gu)+"";if(ma(n))return ys?ys.call(n):"";var t=n+"";return"0"==t&&1/n==-En?"-0":t}function yu(n,t,r){var e=-1,u=a,i=n.length,o=!0,f=[],l=f;if(r)o=!1,u=c;else if(i>=tn){var s=t?null:Is(n);if(s)return q(s);o=!1,u=W,l=new dr}else l=t?[]:f;n:for(;++e<i;){var h=n[e],p=t?t(h):h;if(h=r||0!==h?h:0,o&&p===p){for(var v=l.length;v--;)if(l[v]===p)continue n;t&&l.push(p),f.push(h)}else u(l,p,r)||(l!==f&&l.push(p),f.push(h))}return f}function du(n,t){return t=Ou(t,n),n=Yi(n,t),null==n||delete n[ro(ko(t))]}function bu(n,t,r,e){return au(n,t,r(de(n,t)),e)}function wu(n,t,r,e){for(var u=n.length,i=e?u:-1;(e?i--:++i<u)&&t(n[i],i,n););return r?lu(n,e?0:i,e?i+1:u):lu(n,e?i+1:0,e?u:i)}function mu(n,t){var r=n;return r instanceof Dt&&(r=r.value()),h(t,function(n,t){return t.func.apply(t.thisArg,s([n],t.args))},r)}function xu(n,t,r){var e=n.length;if(e<2)return e?yu(n[0]):[];for(var u=-1,i=fl(e);++u<e;)for(var o=n[u],f=-1;++f<e;)f!=u&&(i[u]=Jr(i[u]||o,n[f],t,r));return yu(ue(i,1),t,r)}function ju(n,t,r){for(var e=-1,u=n.length,i=t.length,o={};++e<u;){var f=e<i?t[e]:X;r(o,n[e],f)}return o}function Au(n){return Qf(n)?n:[]}function ku(n){return"function"==typeof n?n:Uc}function Ou(n,t){return mh(n)?n:Di(n,t)?[n]:Bs(Wa(n))}function Iu(n,t,r){var e=n.length;return r=r===X?e:r,!t&&r>=e?n:lu(n,t,r)}function Ru(n,t){if(t)return n.slice();var r=n.length,e=Sl?Sl(r):new n.constructor(r);return n.copy(e),e}function zu(n){var t=new n.constructor(n.byteLength);return new El(t).set(new El(n)),t}function Eu(n,t){var r=t?zu(n.buffer):n.buffer;return new n.constructor(r,n.byteOffset,n.byteLength)}function Su(t,r,e){var u=r?e(F(t),an):F(t);return h(u,n,new t.constructor)}function Wu(n){var t=new n.constructor(n.source,Nt.exec(n));return t.lastIndex=n.lastIndex,t}function Lu(n,r,e){var u=r?e(q(n),an):q(n);return h(u,t,new n.constructor)}function Cu(n){return gs?hl(gs.call(n)):{}}function Uu(n,t){var r=t?zu(n.buffer):n.buffer;return new n.constructor(r,n.byteOffset,n.length)}function Bu(n,t){if(n!==t){var r=n!==X,e=null===n,u=n===n,i=ma(n),o=t!==X,f=null===t,a=t===t,c=ma(t);if(!f&&!c&&!i&&n>t||i&&o&&a&&!f&&!c||e&&o&&a||!r&&a||!u)return 1;if(!e&&!i&&!c&&n<t||c&&r&&u&&!e&&!i||f&&r&&u||!o&&u||!a)return-1}return 0}function Tu(n,t,r){for(var e=-1,u=n.criteria,i=t.criteria,o=u.length,f=r.length;++e<o;){var a=Bu(u[e],i[e]);if(a){if(e>=f)return a;var c=r[e];return a*("desc"==c?-1:1)}}return n.index-t.index}function $u(n,t,r,e){for(var u=-1,i=n.length,o=r.length,f=-1,a=t.length,c=Jl(i-o,0),l=fl(a+c),s=!e;++f<a;)l[f]=t[f];for(;++u<o;)(s||u<i)&&(l[r[u]]=n[u]);for(;c--;)l[f++]=n[u++];return l}function Du(n,t,r,e){for(var u=-1,i=n.length,o=-1,f=r.length,a=-1,c=t.length,l=Jl(i-f,0),s=fl(l+c),h=!e;++u<l;)s[u]=n[u];for(var p=u;++a<c;)s[p+a]=t[a];for(;++o<f;)(h||u<i)&&(s[p+r[o]]=n[u++]);return s}function Mu(n,t){var r=-1,e=n.length;for(t||(t=fl(e));++r<e;)t[r]=n[r];return t}function Fu(n,t,r,e){var u=!r;r||(r={});for(var i=-1,o=t.length;++i<o;){var f=t[i],a=e?e(r[f],n[f],f,r,n):X;a===X&&(a=n[f]),u?Tr(r,f,a):Wr(r,f,a)}return r}function Nu(n,t){return Fu(n,zs(n),t)}function Pu(n,t){return Fu(n,Es(n),t)}function qu(n,t){return function(r,u){var i=mh(r)?e:Cr,o=t?t():{};return i(r,n,Ai(u,2),o)}}function Zu(n){return iu(function(t,r){var e=-1,u=r.length,i=u>1?r[u-1]:X,o=u>2?r[2]:X;for(i=n.length>3&&"function"==typeof i?(u--,i):X,o&&$i(r[0],r[1],o)&&(i=u<3?X:i,u=1),t=hl(t);++e<u;){var f=r[e];f&&n(t,f,e,i)}return t})}function Ku(n,t){return function(r,e){if(null==r)return r;if(!Yf(r))return n(r,e);for(var u=r.length,i=t?u:-1,o=hl(r);(t?i--:++i<u)&&e(o[i],i,o)!==!1;);return r}}function Vu(n){return function(t,r,e){for(var u=-1,i=hl(t),o=e(t),f=o.length;f--;){var a=o[n?f:++u];if(r(i[a],a,i)===!1)break}return t}}function Gu(n,t,r){function e(){var t=this&&this!==re&&this instanceof e?i:n;return t.apply(u?r:this,arguments)}var u=t&pn,i=Yu(n);return e}function Hu(n){return function(t){t=Wa(t);var r=$(t)?H(t):X,e=r?r[0]:t.charAt(0),u=r?Iu(r,1).join(""):t.slice(1);return e[n]()+u}}function Ju(n){return function(t){return h(Ec(lc(t).replace($r,"")),n,"")}}function Yu(n){return function(){var t=arguments;switch(t.length){case 0:return new n;case 1:return new n(t[0]);case 2:return new n(t[0],t[1]);case 3:return new n(t[0],t[1],t[2]);case 4:return new n(t[0],t[1],t[2],t[3]);case 5:return new n(t[0],t[1],t[2],t[3],t[4]);case 6:return new n(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new n(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var r=ds(n.prototype),e=n.apply(r,t);return ca(e)?e:r}}function Qu(n,t,e){function u(){for(var o=arguments.length,f=fl(o),a=o,c=ji(u);a--;)f[a]=arguments[a];var l=o<3&&f[0]!==c&&f[o-1]!==c?[]:P(f,c);if(o-=l.length,o<e)return ci(n,t,ti,u.placeholder,X,f,l,X,X,e-o);var s=this&&this!==re&&this instanceof u?i:n;return r(s,this,f)}var i=Yu(n);return u}function Xu(n){return function(t,r,e){var u=hl(t);if(!Yf(t)){var i=Ai(r,3);t=Za(t),r=function(n){return i(u[n],n,u)}}var o=n(t,r,e);return o>-1?u[i?t[o]:o]:X}}function ni(n){return bi(function(t){var r=t.length,e=r,u=Y.prototype.thru;for(n&&t.reverse();e--;){var i=t[e];if("function"!=typeof i)throw new _l(en);if(u&&!o&&"wrapper"==xi(i))var o=new Y([],!0)}for(e=o?e:r;++e<r;){i=t[e];var f=xi(i),a="wrapper"==f?Rs(i):X;o=a&&Fi(a[0])&&a[1]==(wn|gn|dn|mn)&&!a[4].length&&1==a[9]?o[xi(a[0])].apply(o,a[3]):1==i.length&&Fi(i)?o[f]():o.thru(i)}return function(){var n=arguments,e=n[0];if(o&&1==n.length&&mh(e))return o.plant(e).value();for(var u=0,i=r?t[u].apply(this,n):e;++u<r;)i=t[u].call(this,i);return i}})}function ti(n,t,r,e,u,i,o,f,a,c){function l(){for(var y=arguments.length,d=fl(y),b=y;b--;)d[b]=arguments[b];if(v)var w=ji(l),m=U(d,w);if(e&&(d=$u(d,e,u,v)),i&&(d=Du(d,i,o,v)),y-=m,v&&y<c){var x=P(d,w);return ci(n,t,ti,l.placeholder,r,d,x,f,a,c-y)}var j=h?r:this,A=p?j[n]:n;return y=d.length,f?d=Qi(d,f):_&&y>1&&d.reverse(),s&&a<y&&(d.length=a),this&&this!==re&&this instanceof l&&(A=g||Yu(A)),A.apply(j,d)}var s=t&wn,h=t&pn,p=t&vn,v=t&(gn|yn),_=t&xn,g=p?X:Yu(n);return l}function ri(n,t){return function(r,e){return Ie(r,n,t(e),{})}}function ei(n,t){return function(r,e){var u;if(r===X&&e===X)return t;if(r!==X&&(u=r),e!==X){if(u===X)return e;"string"==typeof r||"string"==typeof e?(r=gu(r),e=gu(e)):(r=_u(r),e=_u(e)),u=n(r,e)}return u}}function ui(n){return bi(function(t){return t=l(t,E(Ai())),iu(function(e){var u=this;return n(t,function(n){return r(n,u,e)})})})}function ii(n,t){t=t===X?" ":gu(t);var r=t.length;if(r<2)return r?uu(t,n):t;var e=uu(t,Pl(n/G(t)));return $(t)?Iu(H(e),0,n).join(""):e.slice(0,n)}function oi(n,t,e,u){function i(){for(var t=-1,a=arguments.length,c=-1,l=u.length,s=fl(l+a),h=this&&this!==re&&this instanceof i?f:n;++c<l;)s[c]=u[c];for(;a--;)s[c++]=arguments[++t];return r(h,o?e:this,s)}var o=t&pn,f=Yu(n);return i}function fi(n){return function(t,r,e){return e&&"number"!=typeof e&&$i(t,r,e)&&(r=e=X),t=Oa(t),r===X?(r=t,t=0):r=Oa(r),e=e===X?t<r?1:-1:Oa(e),eu(t,r,e,n)}}function ai(n){return function(t,r){return"string"==typeof t&&"string"==typeof r||(t=za(t),r=za(r)),n(t,r)}}function ci(n,t,r,e,u,i,o,f,a,c){var l=t&gn,s=l?o:X,h=l?X:o,p=l?i:X,v=l?X:i;t|=l?dn:bn,t&=~(l?bn:dn),t&_n||(t&=~(pn|vn));var _=[n,t,u,p,s,v,h,f,a,c],g=r.apply(X,_);return Fi(n)&&Ls(g,_),g.placeholder=e,Xi(g,n,t)}function li(n){var t=sl[n];return function(n,r){if(n=za(n),r=null==r?0:Yl(Ia(r),292)){var e=(Wa(n)+"e").split("e"),u=t(e[0]+"e"+(+e[1]+r));return e=(Wa(u)+"e").split("e"),+(e[0]+"e"+(+e[1]-r))}return t(n)}}function si(n){return function(t){var r=Ss(t);return r==Vn?F(t):r==nt?Z(t):z(t,n(t))}}function hi(n,t,r,e,u,i,o,f){var a=t&vn;if(!a&&"function"!=typeof n)throw new _l(en);var c=e?e.length:0;if(c||(t&=~(dn|bn),e=u=X),o=o===X?o:Jl(Ia(o),0),f=f===X?f:Ia(f),c-=u?u.length:0,t&bn){var l=e,s=u;e=u=X}var h=a?X:Rs(n),p=[n,t,r,e,u,l,s,i,o,f];if(h&&Vi(p,h),n=p[0],t=p[1],r=p[2],e=p[3],u=p[4],f=p[9]=p[9]===X?a?0:n.length:Jl(p[9]-c,0),!f&&t&(gn|yn)&&(t&=~(gn|yn)),t&&t!=pn)v=t==gn||t==yn?Qu(n,t,f):t!=dn&&t!=(pn|dn)||u.length?ti.apply(X,p):oi(n,t,r,e);else var v=Gu(n,t,r);var _=h?js:Ls;return Xi(_(v,p),n,t)}function pi(n,t,r,e){return n===X||Jf(n,dl[r])&&!ml.call(e,r)?t:n}function vi(n,t,r,e,u,i){return ca(n)&&ca(t)&&(i.set(t,n),Ve(n,t,X,vi,i),i.delete(t)),n}function _i(n){return da(n)?X:n}function gi(n,t,r,e,u,i){var o=r&sn,f=n.length,a=t.length;if(f!=a&&!(o&&a>f))return!1;var c=i.get(n);if(c&&i.get(t))return c==t;var l=-1,s=!0,h=r&hn?new dr:X;for(i.set(n,t),i.set(t,n);++l<f;){var p=n[l],_=t[l];if(e)var g=o?e(_,p,l,t,n,i):e(p,_,l,n,t,i);if(g!==X){if(g)continue;s=!1;break}if(h){if(!v(t,function(n,t){if(!W(h,t)&&(p===n||u(p,n,r,e,i)))return h.push(t)})){s=!1;break}}else if(p!==_&&!u(p,_,r,e,i)){s=!1;break}}return i.delete(n),i.delete(t),s}function yi(n,t,r,e,u,i,o){switch(r){case ft:if(n.byteLength!=t.byteLength||n.byteOffset!=t.byteOffset)return!1;n=n.buffer,t=t.buffer;case ot:return!(n.byteLength!=t.byteLength||!i(new El(n),new El(t)));case Fn:case Nn:case Gn:return Jf(+n,+t);case qn:return n.name==t.name&&n.message==t.message;case Xn:case tt:return n==t+"";case Vn:var f=F;case nt:var a=e&sn;if(f||(f=q),n.size!=t.size&&!a)return!1;var c=o.get(n);if(c)return c==t;e|=hn,o.set(n,t);var l=gi(f(n),f(t),e,u,i,o);return o.delete(n),l;case rt:if(gs)return gs.call(n)==gs.call(t)}return!1}function di(n,t,r,e,u,i){var o=r&sn,f=wi(n),a=f.length,c=wi(t),l=c.length;if(a!=l&&!o)return!1;for(var s=a;s--;){var h=f[s];if(!(o?h in t:ml.call(t,h)))return!1}var p=i.get(n);if(p&&i.get(t))return p==t;var v=!0;i.set(n,t),i.set(t,n);for(var _=o;++s<a;){h=f[s];var g=n[h],y=t[h];if(e)var d=o?e(y,g,h,t,n,i):e(g,y,h,n,t,i);if(!(d===X?g===y||u(g,y,r,e,i):d)){v=!1;break}_||(_="constructor"==h)}if(v&&!_){var b=n.constructor,w=t.constructor;b!=w&&"constructor"in n&&"constructor"in t&&!("function"==typeof b&&b instanceof b&&"function"==typeof w&&w instanceof w)&&(v=!1);
+}return i.delete(n),i.delete(t),v}function bi(n){return Us(Ji(n,X,go),n+"")}function wi(n){return we(n,Za,zs)}function mi(n){return we(n,Ka,Es)}function xi(n){for(var t=n.name+"",r=cs[t],e=ml.call(cs,t)?r.length:0;e--;){var u=r[e],i=u.func;if(null==i||i==n)return u.name}return t}function ji(n){var t=ml.call(K,"placeholder")?K:n;return t.placeholder}function Ai(){var n=K.iteratee||Bc;return n=n===Bc?Me:n,arguments.length?n(arguments[0],arguments[1]):n}function ki(n,t){var r=n.__data__;return Mi(t)?r["string"==typeof t?"string":"hash"]:r.map}function Oi(n){for(var t=Za(n),r=t.length;r--;){var e=t[r],u=n[e];t[r]=[e,u,qi(u)]}return t}function Ii(n,t){var r=T(n,t);return Be(r)?r:X}function Ri(n){var t=ml.call(n,$l),r=n[$l];try{n[$l]=X;var e=!0}catch(n){}var u=Al.call(n);return e&&(t?n[$l]=r:delete n[$l]),u}function zi(n,t,r){for(var e=-1,u=r.length;++e<u;){var i=r[e],o=i.size;switch(i.type){case"drop":n+=o;break;case"dropRight":t-=o;break;case"take":t=Yl(t,n+o);break;case"takeRight":n=Jl(n,t-o)}}return{start:n,end:t}}function Ei(n){var t=n.match(Tt);return t?t[1].split($t):[]}function Si(n,t,r){t=Ou(t,n);for(var e=-1,u=t.length,i=!1;++e<u;){var o=ro(t[e]);if(!(i=null!=n&&r(n,o)))break;n=n[o]}return i||++e!=u?i:(u=null==n?0:n.length,!!u&&aa(u)&&Ti(o,u)&&(mh(n)||wh(n)))}function Wi(n){var t=n.length,r=n.constructor(t);return t&&"string"==typeof n[0]&&ml.call(n,"index")&&(r.index=n.index,r.input=n.input),r}function Li(n){return"function"!=typeof n.constructor||Pi(n)?{}:ds(Wl(n))}function Ci(n,t,r,e){var u=n.constructor;switch(t){case ot:return zu(n);case Fn:case Nn:return new u(+n);case ft:return Eu(n,e);case at:case ct:case lt:case st:case ht:case pt:case vt:case _t:case gt:return Uu(n,e);case Vn:return Su(n,e,r);case Gn:case tt:return new u(n);case Xn:return Wu(n);case nt:return Lu(n,e,r);case rt:return Cu(n)}}function Ui(n,t){var r=t.length;if(!r)return n;var e=r-1;return t[e]=(r>1?"& ":"")+t[e],t=t.join(r>2?", ":" "),n.replace(Bt,"{\n/* [wrapped with "+t+"] */\n")}function Bi(n){return mh(n)||wh(n)||!!(Bl&&n&&n[Bl])}function Ti(n,t){return t=null==t?Sn:t,!!t&&("number"==typeof n||Vt.test(n))&&n>-1&&n%1==0&&n<t}function $i(n,t,r){if(!ca(r))return!1;var e=typeof t;return!!("number"==e?Yf(r)&&Ti(t,r.length):"string"==e&&t in r)&&Jf(r[t],n)}function Di(n,t){if(mh(n))return!1;var r=typeof n;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=n&&!ma(n))||(Rt.test(n)||!It.test(n)||null!=t&&n in hl(t))}function Mi(n){var t=typeof n;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==n:null===n}function Fi(n){var t=xi(n),r=K[t];if("function"!=typeof r||!(t in Dt.prototype))return!1;if(n===r)return!0;var e=Rs(r);return!!e&&n===e[0]}function Ni(n){return!!jl&&jl in n}function Pi(n){var t=n&&n.constructor,r="function"==typeof t&&t.prototype||dl;return n===r}function qi(n){return n===n&&!ca(n)}function Zi(n,t){return function(r){return null!=r&&(r[n]===t&&(t!==X||n in hl(r)))}}function Ki(n){var t=Bf(n,function(n){return r.size===on&&r.clear(),n}),r=t.cache;return t}function Vi(n,t){var r=n[1],e=t[1],u=r|e,i=u<(pn|vn|wn),o=e==wn&&r==gn||e==wn&&r==mn&&n[7].length<=t[8]||e==(wn|mn)&&t[7].length<=t[8]&&r==gn;if(!i&&!o)return n;e&pn&&(n[2]=t[2],u|=r&pn?0:_n);var f=t[3];if(f){var a=n[3];n[3]=a?$u(a,f,t[4]):f,n[4]=a?P(n[3],fn):t[4]}return f=t[5],f&&(a=n[5],n[5]=a?Du(a,f,t[6]):f,n[6]=a?P(n[5],fn):t[6]),f=t[7],f&&(n[7]=f),e&wn&&(n[8]=null==n[8]?t[8]:Yl(n[8],t[8])),null==n[9]&&(n[9]=t[9]),n[0]=t[0],n[1]=u,n}function Gi(n){var t=[];if(null!=n)for(var r in hl(n))t.push(r);return t}function Hi(n){return Al.call(n)}function Ji(n,t,e){return t=Jl(t===X?n.length-1:t,0),function(){for(var u=arguments,i=-1,o=Jl(u.length-t,0),f=fl(o);++i<o;)f[i]=u[t+i];i=-1;for(var a=fl(t+1);++i<t;)a[i]=u[i];return a[t]=e(f),r(n,this,a)}}function Yi(n,t){return t.length<2?n:de(n,lu(t,0,-1))}function Qi(n,t){for(var r=n.length,e=Yl(t.length,r),u=Mu(n);e--;){var i=t[e];n[e]=Ti(i,r)?u[i]:X}return n}function Xi(n,t,r){var e=t+"";return Us(n,Ui(e,uo(Ei(e),r)))}function no(n){var t=0,r=0;return function(){var e=Ql(),u=On-(e-r);if(r=e,u>0){if(++t>=kn)return arguments[0]}else t=0;return n.apply(X,arguments)}}function to(n,t){var r=-1,e=n.length,u=e-1;for(t=t===X?e:t;++r<t;){var i=ru(r,u),o=n[i];n[i]=n[r],n[r]=o}return n.length=t,n}function ro(n){if("string"==typeof n||ma(n))return n;var t=n+"";return"0"==t&&1/n==-En?"-0":t}function eo(n){if(null!=n){try{return wl.call(n)}catch(n){}try{return n+""}catch(n){}}return""}function uo(n,t){return u(Tn,function(r){var e="_."+r[0];t&r[1]&&!a(n,e)&&n.push(e)}),n.sort()}function io(n){if(n instanceof Dt)return n.clone();var t=new Y(n.__wrapped__,n.__chain__);return t.__actions__=Mu(n.__actions__),t.__index__=n.__index__,t.__values__=n.__values__,t}function oo(n,t,r){t=(r?$i(n,t,r):t===X)?1:Jl(Ia(t),0);var e=null==n?0:n.length;if(!e||t<1)return[];for(var u=0,i=0,o=fl(Pl(e/t));u<e;)o[i++]=lu(n,u,u+=t);return o}function fo(n){for(var t=-1,r=null==n?0:n.length,e=0,u=[];++t<r;){var i=n[t];i&&(u[e++]=i)}return u}function ao(){var n=arguments.length;if(!n)return[];for(var t=fl(n-1),r=arguments[0],e=n;e--;)t[e-1]=arguments[e];return s(mh(r)?Mu(r):[r],ue(t,1))}function co(n,t,r){var e=null==n?0:n.length;return e?(t=r||t===X?1:Ia(t),lu(n,t<0?0:t,e)):[]}function lo(n,t,r){var e=null==n?0:n.length;return e?(t=r||t===X?1:Ia(t),t=e-t,lu(n,0,t<0?0:t)):[]}function so(n,t){return n&&n.length?wu(n,Ai(t,3),!0,!0):[]}function ho(n,t){return n&&n.length?wu(n,Ai(t,3),!0):[]}function po(n,t,r,e){var u=null==n?0:n.length;return u?(r&&"number"!=typeof r&&$i(n,t,r)&&(r=0,e=u),te(n,t,r,e)):[]}function vo(n,t,r){var e=null==n?0:n.length;if(!e)return-1;var u=null==r?0:Ia(r);return u<0&&(u=Jl(e+u,0)),d(n,Ai(t,3),u)}function _o(n,t,r){var e=null==n?0:n.length;if(!e)return-1;var u=e-1;return r!==X&&(u=Ia(r),u=r<0?Jl(e+u,0):Yl(u,e-1)),d(n,Ai(t,3),u,!0)}function go(n){var t=null==n?0:n.length;return t?ue(n,1):[]}function yo(n){var t=null==n?0:n.length;return t?ue(n,En):[]}function bo(n,t){var r=null==n?0:n.length;return r?(t=t===X?1:Ia(t),ue(n,t)):[]}function wo(n){for(var t=-1,r=null==n?0:n.length,e={};++t<r;){var u=n[t];e[u[0]]=u[1]}return e}function mo(n){return n&&n.length?n[0]:X}function xo(n,t,r){var e=null==n?0:n.length;if(!e)return-1;var u=null==r?0:Ia(r);return u<0&&(u=Jl(e+u,0)),b(n,t,u)}function jo(n){var t=null==n?0:n.length;return t?lu(n,0,-1):[]}function Ao(n,t){return null==n?"":Gl.call(n,t)}function ko(n){var t=null==n?0:n.length;return t?n[t-1]:X}function Oo(n,t,r){var e=null==n?0:n.length;if(!e)return-1;var u=e;return r!==X&&(u=Ia(r),u=u<0?Jl(e+u,0):Yl(u,e-1)),t===t?V(n,t,u):d(n,m,u,!0)}function Io(n,t){return n&&n.length?He(n,Ia(t)):X}function Ro(n,t){return n&&n.length&&t&&t.length?nu(n,t):n}function zo(n,t,r){return n&&n.length&&t&&t.length?nu(n,t,Ai(r,2)):n}function Eo(n,t,r){return n&&n.length&&t&&t.length?nu(n,t,X,r):n}function So(n,t){var r=[];if(!n||!n.length)return r;var e=-1,u=[],i=n.length;for(t=Ai(t,3);++e<i;){var o=n[e];t(o,e,n)&&(r.push(o),u.push(e))}return tu(n,u),r}function Wo(n){return null==n?n:ts.call(n)}function Lo(n,t,r){var e=null==n?0:n.length;return e?(r&&"number"!=typeof r&&$i(n,t,r)?(t=0,r=e):(t=null==t?0:Ia(t),r=r===X?e:Ia(r)),lu(n,t,r)):[]}function Co(n,t){return hu(n,t)}function Uo(n,t,r){return pu(n,t,Ai(r,2))}function Bo(n,t){var r=null==n?0:n.length;if(r){var e=hu(n,t);if(e<r&&Jf(n[e],t))return e}return-1}function To(n,t){return hu(n,t,!0)}function $o(n,t,r){return pu(n,t,Ai(r,2),!0)}function Do(n,t){var r=null==n?0:n.length;if(r){var e=hu(n,t,!0)-1;if(Jf(n[e],t))return e}return-1}function Mo(n){return n&&n.length?vu(n):[]}function Fo(n,t){return n&&n.length?vu(n,Ai(t,2)):[]}function No(n){var t=null==n?0:n.length;return t?lu(n,1,t):[]}function Po(n,t,r){return n&&n.length?(t=r||t===X?1:Ia(t),lu(n,0,t<0?0:t)):[]}function qo(n,t,r){var e=null==n?0:n.length;return e?(t=r||t===X?1:Ia(t),t=e-t,lu(n,t<0?0:t,e)):[]}function Zo(n,t){return n&&n.length?wu(n,Ai(t,3),!1,!0):[]}function Ko(n,t){return n&&n.length?wu(n,Ai(t,3)):[]}function Vo(n){return n&&n.length?yu(n):[]}function Go(n,t){return n&&n.length?yu(n,Ai(t,2)):[]}function Ho(n,t){return t="function"==typeof t?t:X,n&&n.length?yu(n,X,t):[]}function Jo(n){if(!n||!n.length)return[];var t=0;return n=f(n,function(n){if(Qf(n))return t=Jl(n.length,t),!0}),R(t,function(t){return l(n,j(t))})}function Yo(n,t){if(!n||!n.length)return[];var e=Jo(n);return null==t?e:l(e,function(n){return r(t,X,n)})}function Qo(n,t){return ju(n||[],t||[],Wr)}function Xo(n,t){return ju(n||[],t||[],au)}function nf(n){var t=K(n);return t.__chain__=!0,t}function tf(n,t){return t(n),n}function rf(n,t){return t(n)}function ef(){return nf(this)}function uf(){return new Y(this.value(),this.__chain__)}function of(){this.__values__===X&&(this.__values__=ka(this.value()));var n=this.__index__>=this.__values__.length,t=n?X:this.__values__[this.__index__++];return{done:n,value:t}}function ff(){return this}function af(n){for(var t,r=this;r instanceof J;){var e=io(r);e.__index__=0,e.__values__=X,t?u.__wrapped__=e:t=e;var u=e;r=r.__wrapped__}return u.__wrapped__=n,t}function cf(){var n=this.__wrapped__;if(n instanceof Dt){var t=n;return this.__actions__.length&&(t=new Dt(this)),t=t.reverse(),t.__actions__.push({func:rf,args:[Wo],thisArg:X}),new Y(t,this.__chain__)}return this.thru(Wo)}function lf(){return mu(this.__wrapped__,this.__actions__)}function sf(n,t,r){var e=mh(n)?o:Yr;return r&&$i(n,t,r)&&(t=X),e(n,Ai(t,3))}function hf(n,t){var r=mh(n)?f:ee;return r(n,Ai(t,3))}function pf(n,t){return ue(bf(n,t),1)}function vf(n,t){return ue(bf(n,t),En)}function _f(n,t,r){return r=r===X?1:Ia(r),ue(bf(n,t),r)}function gf(n,t){var r=mh(n)?u:bs;return r(n,Ai(t,3))}function yf(n,t){var r=mh(n)?i:ws;return r(n,Ai(t,3))}function df(n,t,r,e){n=Yf(n)?n:uc(n),r=r&&!e?Ia(r):0;var u=n.length;return r<0&&(r=Jl(u+r,0)),wa(n)?r<=u&&n.indexOf(t,r)>-1:!!u&&b(n,t,r)>-1}function bf(n,t){var r=mh(n)?l:qe;return r(n,Ai(t,3))}function wf(n,t,r,e){return null==n?[]:(mh(t)||(t=null==t?[]:[t]),r=e?X:r,mh(r)||(r=null==r?[]:[r]),Je(n,t,r))}function mf(n,t,r){var e=mh(n)?h:k,u=arguments.length<3;return e(n,Ai(t,4),r,u,bs)}function xf(n,t,r){var e=mh(n)?p:k,u=arguments.length<3;return e(n,Ai(t,4),r,u,ws)}function jf(n,t){var r=mh(n)?f:ee;return r(n,Tf(Ai(t,3)))}function Af(n){var t=mh(n)?Rr:ou;return t(n)}function kf(n,t,r){t=(r?$i(n,t,r):t===X)?1:Ia(t);var e=mh(n)?zr:fu;return e(n,t)}function Of(n){var t=mh(n)?Er:cu;return t(n)}function If(n){if(null==n)return 0;if(Yf(n))return wa(n)?G(n):n.length;var t=Ss(n);return t==Vn||t==nt?n.size:Fe(n).length}function Rf(n,t,r){var e=mh(n)?v:su;return r&&$i(n,t,r)&&(t=X),e(n,Ai(t,3))}function zf(n,t){if("function"!=typeof t)throw new _l(en);return n=Ia(n),function(){if(--n<1)return t.apply(this,arguments)}}function Ef(n,t,r){return t=r?X:t,t=n&&null==t?n.length:t,hi(n,wn,X,X,X,X,t)}function Sf(n,t){var r;if("function"!=typeof t)throw new _l(en);return n=Ia(n),function(){return--n>0&&(r=t.apply(this,arguments)),n<=1&&(t=X),r}}function Wf(n,t,r){t=r?X:t;var e=hi(n,gn,X,X,X,X,X,t);return e.placeholder=Wf.placeholder,e}function Lf(n,t,r){t=r?X:t;var e=hi(n,yn,X,X,X,X,X,t);return e.placeholder=Lf.placeholder,e}function Cf(n,t,r){function e(t){var r=h,e=p;return h=p=X,d=t,_=n.apply(e,r)}function u(n){return d=n,g=Cs(f,t),b?e(n):_}function i(n){var r=n-y,e=n-d,u=t-r;return w?Yl(u,v-e):u}function o(n){var r=n-y,e=n-d;return y===X||r>=t||r<0||w&&e>=v}function f(){var n=ch();return o(n)?a(n):void(g=Cs(f,i(n)))}function a(n){return g=X,m&&h?e(n):(h=p=X,_)}function c(){g!==X&&Os(g),d=0,h=y=p=g=X}function l(){return g===X?_:a(ch())}function s(){var n=ch(),r=o(n);if(h=arguments,p=this,y=n,r){if(g===X)return u(y);if(w)return g=Cs(f,t),e(y)}return g===X&&(g=Cs(f,t)),_}var h,p,v,_,g,y,d=0,b=!1,w=!1,m=!0;if("function"!=typeof n)throw new _l(en);return t=za(t)||0,ca(r)&&(b=!!r.leading,w="maxWait"in r,v=w?Jl(za(r.maxWait)||0,t):v,m="trailing"in r?!!r.trailing:m),s.cancel=c,s.flush=l,s}function Uf(n){return hi(n,xn)}function Bf(n,t){if("function"!=typeof n||null!=t&&"function"!=typeof t)throw new _l(en);var r=function(){var e=arguments,u=t?t.apply(this,e):e[0],i=r.cache;if(i.has(u))return i.get(u);var o=n.apply(this,e);return r.cache=i.set(u,o)||i,o};return r.cache=new(Bf.Cache||hr),r}function Tf(n){if("function"!=typeof n)throw new _l(en);return function(){var t=arguments;switch(t.length){case 0:return!n.call(this);case 1:return!n.call(this,t[0]);case 2:return!n.call(this,t[0],t[1]);case 3:return!n.call(this,t[0],t[1],t[2])}return!n.apply(this,t)}}function $f(n){return Sf(2,n)}function Df(n,t){if("function"!=typeof n)throw new _l(en);return t=t===X?t:Ia(t),iu(n,t)}function Mf(n,t){if("function"!=typeof n)throw new _l(en);return t=null==t?0:Jl(Ia(t),0),iu(function(e){var u=e[t],i=Iu(e,0,t);return u&&s(i,u),r(n,this,i)})}function Ff(n,t,r){var e=!0,u=!0;if("function"!=typeof n)throw new _l(en);return ca(r)&&(e="leading"in r?!!r.leading:e,u="trailing"in r?!!r.trailing:u),Cf(n,t,{leading:e,maxWait:t,trailing:u})}function Nf(n){return Ef(n,1)}function Pf(n,t){return _h(ku(t),n)}function qf(){if(!arguments.length)return[];var n=arguments[0];return mh(n)?n:[n]}function Zf(n){return Nr(n,ln)}function Kf(n,t){return t="function"==typeof t?t:X,Nr(n,ln,t)}function Vf(n){return Nr(n,an|ln)}function Gf(n,t){return t="function"==typeof t?t:X,Nr(n,an|ln,t)}function Hf(n,t){return null==t||Gr(n,t,Za(t))}function Jf(n,t){return n===t||n!==n&&t!==t}function Yf(n){return null!=n&&aa(n.length)&&!oa(n)}function Qf(n){return la(n)&&Yf(n)}function Xf(n){return n===!0||n===!1||la(n)&&me(n)==Fn}function na(n){return la(n)&&1===n.nodeType&&!da(n)}function ta(n){if(null==n)return!0;if(Yf(n)&&(mh(n)||"string"==typeof n||"function"==typeof n.splice||jh(n)||Rh(n)||wh(n)))return!n.length;var t=Ss(n);if(t==Vn||t==nt)return!n.size;if(Pi(n))return!Fe(n).length;for(var r in n)if(ml.call(n,r))return!1;return!0}function ra(n,t){return We(n,t)}function ea(n,t,r){r="function"==typeof r?r:X;var e=r?r(n,t):X;return e===X?We(n,t,X,r):!!e}function ua(n){if(!la(n))return!1;var t=me(n);return t==qn||t==Pn||"string"==typeof n.message&&"string"==typeof n.name&&!da(n)}function ia(n){return"number"==typeof n&&Vl(n)}function oa(n){if(!ca(n))return!1;var t=me(n);return t==Zn||t==Kn||t==Mn||t==Qn}function fa(n){return"number"==typeof n&&n==Ia(n)}function aa(n){return"number"==typeof n&&n>-1&&n%1==0&&n<=Sn}function ca(n){var t=typeof n;return null!=n&&("object"==t||"function"==t)}function la(n){return null!=n&&"object"==typeof n}function sa(n,t){return n===t||Ue(n,t,Oi(t))}function ha(n,t,r){return r="function"==typeof r?r:X,Ue(n,t,Oi(t),r)}function pa(n){return ya(n)&&n!=+n}function va(n){if(Ws(n))throw new cl(rn);return Be(n)}function _a(n){return null===n}function ga(n){return null==n}function ya(n){return"number"==typeof n||la(n)&&me(n)==Gn}function da(n){if(!la(n)||me(n)!=Jn)return!1;var t=Wl(n);if(null===t)return!0;var r=ml.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&wl.call(r)==kl}function ba(n){return fa(n)&&n>=-Sn&&n<=Sn}function wa(n){return"string"==typeof n||!mh(n)&&la(n)&&me(n)==tt}function ma(n){return"symbol"==typeof n||la(n)&&me(n)==rt}function xa(n){return n===X}function ja(n){return la(n)&&Ss(n)==ut}function Aa(n){return la(n)&&me(n)==it}function ka(n){if(!n)return[];if(Yf(n))return wa(n)?H(n):Mu(n);if(Tl&&n[Tl])return M(n[Tl]());var t=Ss(n),r=t==Vn?F:t==nt?q:uc;return r(n)}function Oa(n){if(!n)return 0===n?n:0;if(n=za(n),n===En||n===-En){var t=n<0?-1:1;return t*Wn}return n===n?n:0}function Ia(n){var t=Oa(n),r=t%1;return t===t?r?t-r:t:0}function Ra(n){return n?Fr(Ia(n),0,Cn):0}function za(n){if("number"==typeof n)return n;if(ma(n))return Ln;if(ca(n)){var t="function"==typeof n.valueOf?n.valueOf():n;n=ca(t)?t+"":t}if("string"!=typeof n)return 0===n?n:+n;n=n.replace(Lt,"");var r=qt.test(n);return r||Kt.test(n)?Xr(n.slice(2),r?2:8):Pt.test(n)?Ln:+n}function Ea(n){return Fu(n,Ka(n))}function Sa(n){return n?Fr(Ia(n),-Sn,Sn):0===n?n:0}function Wa(n){return null==n?"":gu(n)}function La(n,t){var r=ds(n);return null==t?r:Ur(r,t)}function Ca(n,t){return y(n,Ai(t,3),oe)}function Ua(n,t){return y(n,Ai(t,3),fe)}function Ba(n,t){return null==n?n:ms(n,Ai(t,3),Ka)}function Ta(n,t){return null==n?n:xs(n,Ai(t,3),Ka)}function $a(n,t){return n&&oe(n,Ai(t,3))}function Da(n,t){return n&&fe(n,Ai(t,3))}function Ma(n){return null==n?[]:ve(n,Za(n))}function Fa(n){return null==n?[]:ve(n,Ka(n))}function Na(n,t,r){var e=null==n?X:de(n,t);return e===X?r:e}function Pa(n,t){return null!=n&&Si(n,t,je)}function qa(n,t){return null!=n&&Si(n,t,Ae)}function Za(n){return Yf(n)?Ir(n):Fe(n)}function Ka(n){return Yf(n)?Ir(n,!0):Ne(n)}function Va(n,t){var r={};return t=Ai(t,3),oe(n,function(n,e,u){Tr(r,t(n,e,u),n)}),r}function Ga(n,t){var r={};return t=Ai(t,3),oe(n,function(n,e,u){Tr(r,e,t(n,e,u))}),r}function Ha(n,t){return Ja(n,Tf(Ai(t)))}function Ja(n,t){if(null==n)return{};var r=l(mi(n),function(n){return[n]});return t=Ai(t),Qe(n,r,function(n,r){return t(n,r[0])})}function Ya(n,t,r){t=Ou(t,n);var e=-1,u=t.length;for(u||(u=1,n=X);++e<u;){var i=null==n?X:n[ro(t[e])];i===X&&(e=u,i=r),n=oa(i)?i.call(n):i}return n}function Qa(n,t,r){return null==n?n:au(n,t,r)}function Xa(n,t,r,e){return e="function"==typeof e?e:X,null==n?n:au(n,t,r,e)}function nc(n,t,r){var e=mh(n),i=e||jh(n)||Rh(n);if(t=Ai(t,4),null==r){var o=n&&n.constructor;r=i?e?new o:[]:ca(n)&&oa(o)?ds(Wl(n)):{}}return(i?u:oe)(n,function(n,e,u){return t(r,n,e,u)}),r}function tc(n,t){return null==n||du(n,t)}function rc(n,t,r){return null==n?n:bu(n,t,ku(r))}function ec(n,t,r,e){return e="function"==typeof e?e:X,null==n?n:bu(n,t,ku(r),e)}function uc(n){return null==n?[]:S(n,Za(n))}function ic(n){return null==n?[]:S(n,Ka(n))}function oc(n,t,r){return r===X&&(r=t,t=X),r!==X&&(r=za(r),r=r===r?r:0),t!==X&&(t=za(t),t=t===t?t:0),Fr(za(n),t,r)}function fc(n,t,r){return t=Oa(t),r===X?(r=t,t=0):r=Oa(r),n=za(n),ke(n,t,r)}function ac(n,t,r){if(r&&"boolean"!=typeof r&&$i(n,t,r)&&(t=r=X),r===X&&("boolean"==typeof t?(r=t,t=X):"boolean"==typeof n&&(r=n,n=X)),n===X&&t===X?(n=0,t=1):(n=Oa(n),t===X?(t=n,n=0):t=Oa(t)),n>t){var e=n;n=t,t=e}if(r||n%1||t%1){var u=ns();return Yl(n+u*(t-n+Qr("1e-"+((u+"").length-1))),t)}return ru(n,t)}function cc(n){return np(Wa(n).toLowerCase())}function lc(n){return n=Wa(n),n&&n.replace(Gt,_e).replace(Dr,"")}function sc(n,t,r){n=Wa(n),t=gu(t);var e=n.length;r=r===X?e:Fr(Ia(r),0,e);var u=r;return r-=t.length,r>=0&&n.slice(r,u)==t}function hc(n){return n=Wa(n),n&&jt.test(n)?n.replace(mt,ge):n}function pc(n){return n=Wa(n),n&&Wt.test(n)?n.replace(St,"\\$&"):n}function vc(n,t,r){n=Wa(n),t=Ia(t);var e=t?G(n):0;if(!t||e>=t)return n;var u=(t-e)/2;return ii(ql(u),r)+n+ii(Pl(u),r)}function _c(n,t,r){n=Wa(n),t=Ia(t);var e=t?G(n):0;return t&&e<t?n+ii(t-e,r):n}function gc(n,t,r){n=Wa(n),t=Ia(t);var e=t?G(n):0;return t&&e<t?ii(t-e,r)+n:n}function yc(n,t,r){return r||null==t?t=0:t&&(t=+t),Xl(Wa(n).replace(Ct,""),t||0)}function dc(n,t,r){return t=(r?$i(n,t,r):t===X)?1:Ia(t),uu(Wa(n),t)}function bc(){var n=arguments,t=Wa(n[0]);return n.length<3?t:t.replace(n[1],n[2])}function wc(n,t,r){return r&&"number"!=typeof r&&$i(n,t,r)&&(t=r=X),(r=r===X?Cn:r>>>0)?(n=Wa(n),n&&("string"==typeof t||null!=t&&!Oh(t))&&(t=gu(t),!t&&$(n))?Iu(H(n),0,r):n.split(t,r)):[]}function mc(n,t,r){return n=Wa(n),r=null==r?0:Fr(Ia(r),0,n.length),t=gu(t),n.slice(r,r+t.length)==t}function xc(n,t,r){var e=K.templateSettings;r&&$i(n,t,r)&&(t=X),n=Wa(n),t=Lh({},t,e,pi);var u,i,o=Lh({},t.imports,e.imports,pi),f=Za(o),a=S(o,f),c=0,l=t.interpolate||Ht,s="__p += '",h=pl((t.escape||Ht).source+"|"+l.source+"|"+(l===Ot?Ft:Ht).source+"|"+(t.evaluate||Ht).source+"|$","g"),p="//# sourceURL="+("sourceURL"in t?t.sourceURL:"lodash.templateSources["+ ++Zr+"]")+"\n";n.replace(h,function(t,r,e,o,f,a){return e||(e=o),s+=n.slice(c,a).replace(Jt,B),r&&(u=!0,s+="' +\n__e("+r+") +\n'"),f&&(i=!0,s+="';\n"+f+";\n__p += '"),e&&(s+="' +\n((__t = ("+e+")) == null ? '' : __t) +\n'"),c=a+t.length,t}),s+="';\n";var v=t.variable;v||(s="with (obj) {\n"+s+"\n}\n"),s=(i?s.replace(yt,""):s).replace(dt,"$1").replace(bt,"$1;"),s="function("+(v||"obj")+") {\n"+(v?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(u?", __e = _.escape":"")+(i?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+s+"return __p\n}";var _=tp(function(){return ll(f,p+"return "+s).apply(X,a)});if(_.source=s,ua(_))throw _;return _}function jc(n){return Wa(n).toLowerCase()}function Ac(n){return Wa(n).toUpperCase()}function kc(n,t,r){if(n=Wa(n),n&&(r||t===X))return n.replace(Lt,"");if(!n||!(t=gu(t)))return n;var e=H(n),u=H(t),i=L(e,u),o=C(e,u)+1;return Iu(e,i,o).join("")}function Oc(n,t,r){if(n=Wa(n),n&&(r||t===X))return n.replace(Ut,"");if(!n||!(t=gu(t)))return n;var e=H(n),u=C(e,H(t))+1;return Iu(e,0,u).join("")}function Ic(n,t,r){if(n=Wa(n),n&&(r||t===X))return n.replace(Ct,"");if(!n||!(t=gu(t)))return n;var e=H(n),u=L(e,H(t));return Iu(e,u).join("")}function Rc(n,t){var r=jn,e=An;if(ca(t)){var u="separator"in t?t.separator:u;r="length"in t?Ia(t.length):r,e="omission"in t?gu(t.omission):e}n=Wa(n);var i=n.length;if($(n)){var o=H(n);i=o.length}if(r>=i)return n;var f=r-G(e);if(f<1)return e;var a=o?Iu(o,0,f).join(""):n.slice(0,f);if(u===X)return a+e;if(o&&(f+=a.length-f),Oh(u)){if(n.slice(f).search(u)){var c,l=a;for(u.global||(u=pl(u.source,Wa(Nt.exec(u))+"g")),u.lastIndex=0;c=u.exec(l);)var s=c.index;a=a.slice(0,s===X?f:s)}}else if(n.indexOf(gu(u),f)!=f){var h=a.lastIndexOf(u);h>-1&&(a=a.slice(0,h))}return a+e}function zc(n){return n=Wa(n),n&&xt.test(n)?n.replace(wt,ye):n}function Ec(n,t,r){return n=Wa(n),t=r?X:t,t===X?D(n)?Q(n):g(n):n.match(t)||[]}function Sc(n){var t=null==n?0:n.length,e=Ai();return n=t?l(n,function(n){if("function"!=typeof n[1])throw new _l(en);return[e(n[0]),n[1]]}):[],iu(function(e){for(var u=-1;++u<t;){var i=n[u];if(r(i[0],this,e))return r(i[1],this,e)}})}function Wc(n){return Pr(Nr(n,an))}function Lc(n){return function(){return n}}function Cc(n,t){return null==n||n!==n?t:n}function Uc(n){return n}function Bc(n){return Me("function"==typeof n?n:Nr(n,an))}function Tc(n){return Ze(Nr(n,an))}function $c(n,t){return Ke(n,Nr(t,an))}function Dc(n,t,r){var e=Za(t),i=ve(t,e);null!=r||ca(t)&&(i.length||!e.length)||(r=t,t=n,n=this,i=ve(t,Za(t)));var o=!(ca(r)&&"chain"in r&&!r.chain),f=oa(n);return u(i,function(r){var e=t[r];n[r]=e,f&&(n.prototype[r]=function(){var t=this.__chain__;if(o||t){var r=n(this.__wrapped__),u=r.__actions__=Mu(this.__actions__);return u.push({func:e,args:arguments,thisArg:n}),r.__chain__=t,r}return e.apply(n,s([this.value()],arguments))})}),n}function Mc(){return re._===this&&(re._=Ol),this}function Fc(){}function Nc(n){return n=Ia(n),iu(function(t){return He(t,n)})}function Pc(n){return Di(n)?j(ro(n)):Xe(n)}function qc(n){return function(t){return null==n?X:de(n,t)}}function Zc(){return[]}function Kc(){return!1}function Vc(){return{}}function Gc(){return""}function Hc(){return!0}function Jc(n,t){if(n=Ia(n),n<1||n>Sn)return[];var r=Cn,e=Yl(n,Cn);t=Ai(t),n-=Cn;for(var u=R(e,t);++r<n;)t(r);return u}function Yc(n){return mh(n)?l(n,ro):ma(n)?[n]:Mu(Bs(Wa(n)))}function Qc(n){var t=++xl;return Wa(n)+t}function Xc(n){return n&&n.length?ne(n,Uc,xe):X}function nl(n,t){return n&&n.length?ne(n,Ai(t,2),xe):X}function tl(n){return x(n,Uc)}function rl(n,t){return x(n,Ai(t,2))}function el(n){return n&&n.length?ne(n,Uc,Pe):X}function ul(n,t){return n&&n.length?ne(n,Ai(t,2),Pe):X}function il(n){return n&&n.length?I(n,Uc):0}function ol(n,t){return n&&n.length?I(n,Ai(t,2)):0}A=null==A?re:be.defaults(re.Object(),A,be.pick(re,qr));var fl=A.Array,al=A.Date,cl=A.Error,ll=A.Function,sl=A.Math,hl=A.Object,pl=A.RegExp,vl=A.String,_l=A.TypeError,gl=fl.prototype,yl=ll.prototype,dl=hl.prototype,bl=A["__core-js_shared__"],wl=yl.toString,ml=dl.hasOwnProperty,xl=0,jl=function(){var n=/[^.]+$/.exec(bl&&bl.keys&&bl.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""}(),Al=dl.toString,kl=wl.call(hl),Ol=re._,Il=pl("^"+wl.call(ml).replace(St,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Rl=ie?A.Buffer:X,zl=A.Symbol,El=A.Uint8Array,Sl=Rl?Rl.allocUnsafe:X,Wl=N(hl.getPrototypeOf,hl),Ll=hl.create,Cl=dl.propertyIsEnumerable,Ul=gl.splice,Bl=zl?zl.isConcatSpreadable:X,Tl=zl?zl.iterator:X,$l=zl?zl.toStringTag:X,Dl=function(){try{var n=Ii(hl,"defineProperty");return n({},"",{}),n}catch(n){}}(),Ml=A.clearTimeout!==re.clearTimeout&&A.clearTimeout,Fl=al&&al.now!==re.Date.now&&al.now,Nl=A.setTimeout!==re.setTimeout&&A.setTimeout,Pl=sl.ceil,ql=sl.floor,Zl=hl.getOwnPropertySymbols,Kl=Rl?Rl.isBuffer:X,Vl=A.isFinite,Gl=gl.join,Hl=N(hl.keys,hl),Jl=sl.max,Yl=sl.min,Ql=al.now,Xl=A.parseInt,ns=sl.random,ts=gl.reverse,rs=Ii(A,"DataView"),es=Ii(A,"Map"),us=Ii(A,"Promise"),is=Ii(A,"Set"),os=Ii(A,"WeakMap"),fs=Ii(hl,"create"),as=os&&new os,cs={},ls=eo(rs),ss=eo(es),hs=eo(us),ps=eo(is),vs=eo(os),_s=zl?zl.prototype:X,gs=_s?_s.valueOf:X,ys=_s?_s.toString:X,ds=function(){function n(){}return function(t){if(!ca(t))return{};if(Ll)return Ll(t);n.prototype=t;var r=new n;return n.prototype=X,r}}();K.templateSettings={escape:At,evaluate:kt,interpolate:Ot,variable:"",imports:{_:K}},K.prototype=J.prototype,K.prototype.constructor=K,Y.prototype=ds(J.prototype),Y.prototype.constructor=Y,Dt.prototype=ds(J.prototype),Dt.prototype.constructor=Dt,nr.prototype.clear=tr,nr.prototype.delete=rr,nr.prototype.get=er,nr.prototype.has=ur,nr.prototype.set=ir,or.prototype.clear=fr,or.prototype.delete=ar,or.prototype.get=cr,or.prototype.has=lr,or.prototype.set=sr,hr.prototype.clear=pr,hr.prototype.delete=vr,hr.prototype.get=_r,hr.prototype.has=gr,hr.prototype.set=yr,dr.prototype.add=dr.prototype.push=br,dr.prototype.has=wr,mr.prototype.clear=xr,mr.prototype.delete=jr,mr.prototype.get=Ar,mr.prototype.has=kr,mr.prototype.set=Or;var bs=Ku(oe),ws=Ku(fe,!0),ms=Vu(),xs=Vu(!0),js=as?function(n,t){return as.set(n,t),n}:Uc,As=Dl?function(n,t){return Dl(n,"toString",{configurable:!0,enumerable:!1,value:Lc(t),writable:!0})}:Uc,ks=iu,Os=Ml||function(n){return re.clearTimeout(n)},Is=is&&1/q(new is([,-0]))[1]==En?function(n){return new is(n)}:Fc,Rs=as?function(n){return as.get(n)}:Fc,zs=Zl?function(n){return null==n?[]:(n=hl(n),f(Zl(n),function(t){return Cl.call(n,t)}))}:Zc,Es=Zl?function(n){for(var t=[];n;)s(t,zs(n)),n=Wl(n);return t}:Zc,Ss=me;(rs&&Ss(new rs(new ArrayBuffer(1)))!=ft||es&&Ss(new es)!=Vn||us&&Ss(us.resolve())!=Yn||is&&Ss(new is)!=nt||os&&Ss(new os)!=ut)&&(Ss=function(n){var t=me(n),r=t==Jn?n.constructor:X,e=r?eo(r):"";if(e)switch(e){case ls:return ft;case ss:return Vn;case hs:return Yn;case ps:return nt;case vs:return ut}return t});var Ws=bl?oa:Kc,Ls=no(js),Cs=Nl||function(n,t){return re.setTimeout(n,t)},Us=no(As),Bs=Ki(function(n){var t=[];return zt.test(n)&&t.push(""),n.replace(Et,function(n,r,e,u){t.push(e?u.replace(Mt,"$1"):r||n)}),t}),Ts=iu(function(n,t){return Qf(n)?Jr(n,ue(t,1,Qf,!0)):[]}),$s=iu(function(n,t){var r=ko(t);return Qf(r)&&(r=X),Qf(n)?Jr(n,ue(t,1,Qf,!0),Ai(r,2)):[]}),Ds=iu(function(n,t){var r=ko(t);return Qf(r)&&(r=X),Qf(n)?Jr(n,ue(t,1,Qf,!0),X,r):[]}),Ms=iu(function(n){var t=l(n,Au);return t.length&&t[0]===n[0]?Oe(t):[]}),Fs=iu(function(n){var t=ko(n),r=l(n,Au);return t===ko(r)?t=X:r.pop(),r.length&&r[0]===n[0]?Oe(r,Ai(t,2)):[]}),Ns=iu(function(n){var t=ko(n),r=l(n,Au);return t="function"==typeof t?t:X,t&&r.pop(),r.length&&r[0]===n[0]?Oe(r,X,t):[]}),Ps=iu(Ro),qs=bi(function(n,t){var r=null==n?0:n.length,e=Mr(n,t);return tu(n,l(t,function(n){return Ti(n,r)?+n:n}).sort(Bu)),e}),Zs=iu(function(n){return yu(ue(n,1,Qf,!0))}),Ks=iu(function(n){var t=ko(n);return Qf(t)&&(t=X),yu(ue(n,1,Qf,!0),Ai(t,2))}),Vs=iu(function(n){var t=ko(n);return t="function"==typeof t?t:X,yu(ue(n,1,Qf,!0),X,t)}),Gs=iu(function(n,t){return Qf(n)?Jr(n,t):[]}),Hs=iu(function(n){return xu(f(n,Qf))}),Js=iu(function(n){var t=ko(n);return Qf(t)&&(t=X),xu(f(n,Qf),Ai(t,2))}),Ys=iu(function(n){var t=ko(n);return t="function"==typeof t?t:X,xu(f(n,Qf),X,t)}),Qs=iu(Jo),Xs=iu(function(n){var t=n.length,r=t>1?n[t-1]:X;return r="function"==typeof r?(n.pop(),r):X,Yo(n,r)}),nh=bi(function(n){var t=n.length,r=t?n[0]:0,e=this.__wrapped__,u=function(t){return Mr(t,n)};return!(t>1||this.__actions__.length)&&e instanceof Dt&&Ti(r)?(e=e.slice(r,+r+(t?1:0)),e.__actions__.push({func:rf,args:[u],thisArg:X}),new Y(e,this.__chain__).thru(function(n){return t&&!n.length&&n.push(X),n})):this.thru(u)}),th=qu(function(n,t,r){ml.call(n,r)?++n[r]:Tr(n,r,1)}),rh=Xu(vo),eh=Xu(_o),uh=qu(function(n,t,r){ml.call(n,r)?n[r].push(t):Tr(n,r,[t])}),ih=iu(function(n,t,e){var u=-1,i="function"==typeof t,o=Yf(n)?fl(n.length):[];return bs(n,function(n){o[++u]=i?r(t,n,e):Re(n,t,e)}),o}),oh=qu(function(n,t,r){Tr(n,r,t)}),fh=qu(function(n,t,r){n[r?0:1].push(t)},function(){return[[],[]]}),ah=iu(function(n,t){if(null==n)return[];var r=t.length;return r>1&&$i(n,t[0],t[1])?t=[]:r>2&&$i(t[0],t[1],t[2])&&(t=[t[0]]),Je(n,ue(t,1),[])}),ch=Fl||function(){return re.Date.now()},lh=iu(function(n,t,r){var e=pn;if(r.length){var u=P(r,ji(lh));e|=dn}return hi(n,e,t,r,u)}),sh=iu(function(n,t,r){var e=pn|vn;if(r.length){var u=P(r,ji(sh));e|=dn}return hi(t,e,n,r,u)}),hh=iu(function(n,t){return Hr(n,1,t)}),ph=iu(function(n,t,r){return Hr(n,za(t)||0,r)});Bf.Cache=hr;var vh=ks(function(n,t){t=1==t.length&&mh(t[0])?l(t[0],E(Ai())):l(ue(t,1),E(Ai()));var e=t.length;return iu(function(u){for(var i=-1,o=Yl(u.length,e);++i<o;)u[i]=t[i].call(this,u[i]);return r(n,this,u)})}),_h=iu(function(n,t){var r=P(t,ji(_h));return hi(n,dn,X,t,r)}),gh=iu(function(n,t){var r=P(t,ji(gh));return hi(n,bn,X,t,r)}),yh=bi(function(n,t){return hi(n,mn,X,X,X,t)}),dh=ai(xe),bh=ai(function(n,t){return n>=t}),wh=ze(function(){return arguments}())?ze:function(n){return la(n)&&ml.call(n,"callee")&&!Cl.call(n,"callee")},mh=fl.isArray,xh=ae?E(ae):Ee,jh=Kl||Kc,Ah=ce?E(ce):Se,kh=le?E(le):Ce,Oh=se?E(se):Te,Ih=he?E(he):$e,Rh=pe?E(pe):De,zh=ai(Pe),Eh=ai(function(n,t){return n<=t}),Sh=Zu(function(n,t){if(Pi(t)||Yf(t))return void Fu(t,Za(t),n);for(var r in t)ml.call(t,r)&&Wr(n,r,t[r])}),Wh=Zu(function(n,t){Fu(t,Ka(t),n)}),Lh=Zu(function(n,t,r,e){Fu(t,Ka(t),n,e)}),Ch=Zu(function(n,t,r,e){Fu(t,Za(t),n,e)}),Uh=bi(Mr),Bh=iu(function(n){return n.push(X,pi),r(Lh,X,n)}),Th=iu(function(n){return n.push(X,vi),r(Nh,X,n)}),$h=ri(function(n,t,r){n[t]=r},Lc(Uc)),Dh=ri(function(n,t,r){ml.call(n,t)?n[t].push(r):n[t]=[r]},Ai),Mh=iu(Re),Fh=Zu(function(n,t,r){Ve(n,t,r)}),Nh=Zu(function(n,t,r,e){Ve(n,t,r,e)}),Ph=bi(function(n,t){var r={};if(null==n)return r;var e=!1;t=l(t,function(t){return t=Ou(t,n),e||(e=t.length>1),t}),Fu(n,mi(n),r),e&&(r=Nr(r,an|cn|ln,_i));for(var u=t.length;u--;)du(r,t[u]);return r}),qh=bi(function(n,t){return null==n?{}:Ye(n,t)}),Zh=si(Za),Kh=si(Ka),Vh=Ju(function(n,t,r){return t=t.toLowerCase(),n+(r?cc(t):t)}),Gh=Ju(function(n,t,r){return n+(r?"-":"")+t.toLowerCase()}),Hh=Ju(function(n,t,r){return n+(r?" ":"")+t.toLowerCase()}),Jh=Hu("toLowerCase"),Yh=Ju(function(n,t,r){return n+(r?"_":"")+t.toLowerCase()}),Qh=Ju(function(n,t,r){return n+(r?" ":"")+np(t)}),Xh=Ju(function(n,t,r){return n+(r?" ":"")+t.toUpperCase()}),np=Hu("toUpperCase"),tp=iu(function(n,t){try{return r(n,X,t)}catch(n){return ua(n)?n:new cl(n)}}),rp=bi(function(n,t){return u(t,function(t){t=ro(t),Tr(n,t,lh(n[t],n))}),n}),ep=ni(),up=ni(!0),ip=iu(function(n,t){return function(r){return Re(r,n,t)}}),op=iu(function(n,t){return function(r){return Re(n,r,t)}}),fp=ui(l),ap=ui(o),cp=ui(v),lp=fi(),sp=fi(!0),hp=ei(function(n,t){return n+t},0),pp=li("ceil"),vp=ei(function(n,t){return n/t},1),_p=li("floor"),gp=ei(function(n,t){return n*t},1),yp=li("round"),dp=ei(function(n,t){return n-t},0);return K.after=zf,K.ary=Ef,K.assign=Sh,K.assignIn=Wh,K.assignInWith=Lh,K.assignWith=Ch,K.at=Uh,K.before=Sf,K.bind=lh,K.bindAll=rp,K.bindKey=sh,K.castArray=qf,K.chain=nf,K.chunk=oo,K.compact=fo,K.concat=ao,K.cond=Sc,K.conforms=Wc,K.constant=Lc,K.countBy=th,K.create=La,K.curry=Wf,K.curryRight=Lf,K.debounce=Cf,K.defaults=Bh,K.defaultsDeep=Th,K.defer=hh,K.delay=ph,K.difference=Ts,K.differenceBy=$s,K.differenceWith=Ds,K.drop=co,
+K.dropRight=lo,K.dropRightWhile=so,K.dropWhile=ho,K.fill=po,K.filter=hf,K.flatMap=pf,K.flatMapDeep=vf,K.flatMapDepth=_f,K.flatten=go,K.flattenDeep=yo,K.flattenDepth=bo,K.flip=Uf,K.flow=ep,K.flowRight=up,K.fromPairs=wo,K.functions=Ma,K.functionsIn=Fa,K.groupBy=uh,K.initial=jo,K.intersection=Ms,K.intersectionBy=Fs,K.intersectionWith=Ns,K.invert=$h,K.invertBy=Dh,K.invokeMap=ih,K.iteratee=Bc,K.keyBy=oh,K.keys=Za,K.keysIn=Ka,K.map=bf,K.mapKeys=Va,K.mapValues=Ga,K.matches=Tc,K.matchesProperty=$c,K.memoize=Bf,K.merge=Fh,K.mergeWith=Nh,K.method=ip,K.methodOf=op,K.mixin=Dc,K.negate=Tf,K.nthArg=Nc,K.omit=Ph,K.omitBy=Ha,K.once=$f,K.orderBy=wf,K.over=fp,K.overArgs=vh,K.overEvery=ap,K.overSome=cp,K.partial=_h,K.partialRight=gh,K.partition=fh,K.pick=qh,K.pickBy=Ja,K.property=Pc,K.propertyOf=qc,K.pull=Ps,K.pullAll=Ro,K.pullAllBy=zo,K.pullAllWith=Eo,K.pullAt=qs,K.range=lp,K.rangeRight=sp,K.rearg=yh,K.reject=jf,K.remove=So,K.rest=Df,K.reverse=Wo,K.sampleSize=kf,K.set=Qa,K.setWith=Xa,K.shuffle=Of,K.slice=Lo,K.sortBy=ah,K.sortedUniq=Mo,K.sortedUniqBy=Fo,K.split=wc,K.spread=Mf,K.tail=No,K.take=Po,K.takeRight=qo,K.takeRightWhile=Zo,K.takeWhile=Ko,K.tap=tf,K.throttle=Ff,K.thru=rf,K.toArray=ka,K.toPairs=Zh,K.toPairsIn=Kh,K.toPath=Yc,K.toPlainObject=Ea,K.transform=nc,K.unary=Nf,K.union=Zs,K.unionBy=Ks,K.unionWith=Vs,K.uniq=Vo,K.uniqBy=Go,K.uniqWith=Ho,K.unset=tc,K.unzip=Jo,K.unzipWith=Yo,K.update=rc,K.updateWith=ec,K.values=uc,K.valuesIn=ic,K.without=Gs,K.words=Ec,K.wrap=Pf,K.xor=Hs,K.xorBy=Js,K.xorWith=Ys,K.zip=Qs,K.zipObject=Qo,K.zipObjectDeep=Xo,K.zipWith=Xs,K.entries=Zh,K.entriesIn=Kh,K.extend=Wh,K.extendWith=Lh,Dc(K,K),K.add=hp,K.attempt=tp,K.camelCase=Vh,K.capitalize=cc,K.ceil=pp,K.clamp=oc,K.clone=Zf,K.cloneDeep=Vf,K.cloneDeepWith=Gf,K.cloneWith=Kf,K.conformsTo=Hf,K.deburr=lc,K.defaultTo=Cc,K.divide=vp,K.endsWith=sc,K.eq=Jf,K.escape=hc,K.escapeRegExp=pc,K.every=sf,K.find=rh,K.findIndex=vo,K.findKey=Ca,K.findLast=eh,K.findLastIndex=_o,K.findLastKey=Ua,K.floor=_p,K.forEach=gf,K.forEachRight=yf,K.forIn=Ba,K.forInRight=Ta,K.forOwn=$a,K.forOwnRight=Da,K.get=Na,K.gt=dh,K.gte=bh,K.has=Pa,K.hasIn=qa,K.head=mo,K.identity=Uc,K.includes=df,K.indexOf=xo,K.inRange=fc,K.invoke=Mh,K.isArguments=wh,K.isArray=mh,K.isArrayBuffer=xh,K.isArrayLike=Yf,K.isArrayLikeObject=Qf,K.isBoolean=Xf,K.isBuffer=jh,K.isDate=Ah,K.isElement=na,K.isEmpty=ta,K.isEqual=ra,K.isEqualWith=ea,K.isError=ua,K.isFinite=ia,K.isFunction=oa,K.isInteger=fa,K.isLength=aa,K.isMap=kh,K.isMatch=sa,K.isMatchWith=ha,K.isNaN=pa,K.isNative=va,K.isNil=ga,K.isNull=_a,K.isNumber=ya,K.isObject=ca,K.isObjectLike=la,K.isPlainObject=da,K.isRegExp=Oh,K.isSafeInteger=ba,K.isSet=Ih,K.isString=wa,K.isSymbol=ma,K.isTypedArray=Rh,K.isUndefined=xa,K.isWeakMap=ja,K.isWeakSet=Aa,K.join=Ao,K.kebabCase=Gh,K.last=ko,K.lastIndexOf=Oo,K.lowerCase=Hh,K.lowerFirst=Jh,K.lt=zh,K.lte=Eh,K.max=Xc,K.maxBy=nl,K.mean=tl,K.meanBy=rl,K.min=el,K.minBy=ul,K.stubArray=Zc,K.stubFalse=Kc,K.stubObject=Vc,K.stubString=Gc,K.stubTrue=Hc,K.multiply=gp,K.nth=Io,K.noConflict=Mc,K.noop=Fc,K.now=ch,K.pad=vc,K.padEnd=_c,K.padStart=gc,K.parseInt=yc,K.random=ac,K.reduce=mf,K.reduceRight=xf,K.repeat=dc,K.replace=bc,K.result=Ya,K.round=yp,K.runInContext=_,K.sample=Af,K.size=If,K.snakeCase=Yh,K.some=Rf,K.sortedIndex=Co,K.sortedIndexBy=Uo,K.sortedIndexOf=Bo,K.sortedLastIndex=To,K.sortedLastIndexBy=$o,K.sortedLastIndexOf=Do,K.startCase=Qh,K.startsWith=mc,K.subtract=dp,K.sum=il,K.sumBy=ol,K.template=xc,K.times=Jc,K.toFinite=Oa,K.toInteger=Ia,K.toLength=Ra,K.toLower=jc,K.toNumber=za,K.toSafeInteger=Sa,K.toString=Wa,K.toUpper=Ac,K.trim=kc,K.trimEnd=Oc,K.trimStart=Ic,K.truncate=Rc,K.unescape=zc,K.uniqueId=Qc,K.upperCase=Xh,K.upperFirst=np,K.each=gf,K.eachRight=yf,K.first=mo,Dc(K,function(){var n={};return oe(K,function(t,r){ml.call(K.prototype,r)||(n[r]=t)}),n}(),{chain:!1}),K.VERSION=nn,u(["bind","bindKey","curry","curryRight","partial","partialRight"],function(n){K[n].placeholder=K}),u(["drop","take"],function(n,t){Dt.prototype[n]=function(r){r=r===X?1:Jl(Ia(r),0);var e=this.__filtered__&&!t?new Dt(this):this.clone();return e.__filtered__?e.__takeCount__=Yl(r,e.__takeCount__):e.__views__.push({size:Yl(r,Cn),type:n+(e.__dir__<0?"Right":"")}),e},Dt.prototype[n+"Right"]=function(t){return this.reverse()[n](t).reverse()}}),u(["filter","map","takeWhile"],function(n,t){var r=t+1,e=r==In||r==zn;Dt.prototype[n]=function(n){var t=this.clone();return t.__iteratees__.push({iteratee:Ai(n,3),type:r}),t.__filtered__=t.__filtered__||e,t}}),u(["head","last"],function(n,t){var r="take"+(t?"Right":"");Dt.prototype[n]=function(){return this[r](1).value()[0]}}),u(["initial","tail"],function(n,t){var r="drop"+(t?"":"Right");Dt.prototype[n]=function(){return this.__filtered__?new Dt(this):this[r](1)}}),Dt.prototype.compact=function(){return this.filter(Uc)},Dt.prototype.find=function(n){return this.filter(n).head()},Dt.prototype.findLast=function(n){return this.reverse().find(n)},Dt.prototype.invokeMap=iu(function(n,t){return"function"==typeof n?new Dt(this):this.map(function(r){return Re(r,n,t)})}),Dt.prototype.reject=function(n){return this.filter(Tf(Ai(n)))},Dt.prototype.slice=function(n,t){n=Ia(n);var r=this;return r.__filtered__&&(n>0||t<0)?new Dt(r):(n<0?r=r.takeRight(-n):n&&(r=r.drop(n)),t!==X&&(t=Ia(t),r=t<0?r.dropRight(-t):r.take(t-n)),r)},Dt.prototype.takeRightWhile=function(n){return this.reverse().takeWhile(n).reverse()},Dt.prototype.toArray=function(){return this.take(Cn)},oe(Dt.prototype,function(n,t){var r=/^(?:filter|find|map|reject)|While$/.test(t),e=/^(?:head|last)$/.test(t),u=K[e?"take"+("last"==t?"Right":""):t],i=e||/^find/.test(t);u&&(K.prototype[t]=function(){var t=this.__wrapped__,o=e?[1]:arguments,f=t instanceof Dt,a=o[0],c=f||mh(t),l=function(n){var t=u.apply(K,s([n],o));return e&&h?t[0]:t};c&&r&&"function"==typeof a&&1!=a.length&&(f=c=!1);var h=this.__chain__,p=!!this.__actions__.length,v=i&&!h,_=f&&!p;if(!i&&c){t=_?t:new Dt(this);var g=n.apply(t,o);return g.__actions__.push({func:rf,args:[l],thisArg:X}),new Y(g,h)}return v&&_?n.apply(this,o):(g=this.thru(l),v?e?g.value()[0]:g.value():g)})}),u(["pop","push","shift","sort","splice","unshift"],function(n){var t=gl[n],r=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",e=/^(?:pop|shift)$/.test(n);K.prototype[n]=function(){var n=arguments;if(e&&!this.__chain__){var u=this.value();return t.apply(mh(u)?u:[],n)}return this[r](function(r){return t.apply(mh(r)?r:[],n)})}}),oe(Dt.prototype,function(n,t){var r=K[t];if(r){var e=r.name+"",u=cs[e]||(cs[e]=[]);u.push({name:t,func:r})}}),cs[ti(X,vn).name]=[{name:"wrapper",func:X}],Dt.prototype.clone=Yt,Dt.prototype.reverse=Qt,Dt.prototype.value=Xt,K.prototype.at=nh,K.prototype.chain=ef,K.prototype.commit=uf,K.prototype.next=of,K.prototype.plant=af,K.prototype.reverse=cf,K.prototype.toJSON=K.prototype.valueOf=K.prototype.value=lf,K.prototype.first=K.prototype.head,Tl&&(K.prototype[Tl]=ff),K},be=de();"function"==typeof define&&"object"==typeof define.amd&&define.amd?(re._=be,define(function(){return be})):ue?((ue.exports=be)._=be,ee._=be):re._=be}).call(this);
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
-},{}],"prop-types":[function(require,module,exports){
-(function (process){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- */
-
-if (process.env.NODE_ENV !== 'production') {
- var REACT_ELEMENT_TYPE = (typeof Symbol === 'function' &&
- Symbol.for &&
- Symbol.for('react.element')) ||
- 0xeac7;
-
- var isValidElement = function(object) {
- return typeof object === 'object' &&
- object !== null &&
- object.$$typeof === REACT_ELEMENT_TYPE;
- };
-
- // By explicitly using `prop-types` you are opting into new development behavior.
- // http://fb.me/prop-types-in-prod
- var throwOnDirectAccess = true;
- module.exports = require('./factoryWithTypeCheckers')(isValidElement, throwOnDirectAccess);
-} else {
- // By explicitly using `prop-types` you are opting into new production behavior.
- // http://fb.me/prop-types-in-prod
- module.exports = require('./factoryWithThrowingShims')();
-}
-
-}).call(this,require('_process'))
-
-},{"./factoryWithThrowingShims":45,"./factoryWithTypeCheckers":46,"_process":43}],"react-codemirror":[function(require,module,exports){
-'use strict';
-
-var React = require('react');
-var ReactDOM = require('react-dom');
-var findDOMNode = ReactDOM.findDOMNode;
-var className = require('classnames');
-var debounce = require('lodash.debounce');
-
-function normalizeLineEndings(str) {
- if (!str) return str;
- return str.replace(/\r\n|\r/g, '\n');
-}
-
-var CodeMirror = React.createClass({
- displayName: 'CodeMirror',
-
- propTypes: {
- className: React.PropTypes.any,
- codeMirrorInstance: React.PropTypes.func,
- defaultValue: React.PropTypes.string,
- onChange: React.PropTypes.func,
- onFocusChange: React.PropTypes.func,
- onScroll: React.PropTypes.func,
- options: React.PropTypes.object,
- path: React.PropTypes.string,
- value: React.PropTypes.string,
- preserveScrollPosition: React.PropTypes.bool
- },
- getDefaultProps: function getDefaultProps() {
- return {
- preserveScrollPosition: false
- };
- },
- getCodeMirrorInstance: function getCodeMirrorInstance() {
- return this.props.codeMirrorInstance || require('codemirror');
- },
- getInitialState: function getInitialState() {
- return {
- isFocused: false
- };
- },
- componentWillMount: function componentWillMount() {
- this.componentWillReceiveProps = debounce(this.componentWillReceiveProps, 0);
- },
- componentDidMount: function componentDidMount() {
- var textareaNode = findDOMNode(this.refs.textarea);
- var codeMirrorInstance = this.getCodeMirrorInstance();
- this.codeMirror = codeMirrorInstance.fromTextArea(textareaNode, this.props.options);
- this.codeMirror.on('change', this.codemirrorValueChanged);
- this.codeMirror.on('focus', this.focusChanged.bind(this, true));
- this.codeMirror.on('blur', this.focusChanged.bind(this, false));
- this.codeMirror.on('scroll', this.scrollChanged);
- this.codeMirror.setValue(this.props.defaultValue || this.props.value || '');
- },
- componentWillUnmount: function componentWillUnmount() {
- // is there a lighter-weight way to remove the cm instance?
- if (this.codeMirror) {
- this.codeMirror.toTextArea();
- }
- },
- componentWillReceiveProps: function componentWillReceiveProps(nextProps) {
- if (this.codeMirror && nextProps.value !== undefined && normalizeLineEndings(this.codeMirror.getValue()) !== normalizeLineEndings(nextProps.value)) {
- if (this.props.preserveScrollPosition) {
- var prevScrollPosition = this.codeMirror.getScrollInfo();
- this.codeMirror.setValue(nextProps.value);
- this.codeMirror.scrollTo(prevScrollPosition.left, prevScrollPosition.top);
- } else {
- this.codeMirror.setValue(nextProps.value);
- }
- }
- if (typeof nextProps.options === 'object') {
- for (var optionName in nextProps.options) {
- if (nextProps.options.hasOwnProperty(optionName)) {
- this.codeMirror.setOption(optionName, nextProps.options[optionName]);
- }
- }
- }
- },
- getCodeMirror: function getCodeMirror() {
- return this.codeMirror;
- },
- focus: function focus() {
- if (this.codeMirror) {
- this.codeMirror.focus();
- }
- },
- focusChanged: function focusChanged(focused) {
- this.setState({
- isFocused: focused
- });
- this.props.onFocusChange && this.props.onFocusChange(focused);
- },
- scrollChanged: function scrollChanged(cm) {
- this.props.onScroll && this.props.onScroll(cm.getScrollInfo());
- },
- codemirrorValueChanged: function codemirrorValueChanged(doc, change) {
- if (this.props.onChange && change.origin !== 'setValue') {
- this.props.onChange(doc.getValue(), change);
- }
- },
- render: function render() {
- var editorClassName = className('ReactCodeMirror', this.state.isFocused ? 'ReactCodeMirror--focused' : null, this.props.className);
- return React.createElement(
- 'div',
- { className: editorClassName },
- React.createElement('textarea', { ref: 'textarea', name: this.props.path, defaultValue: this.props.value, autoComplete: 'off' })
- );
- }
-});
-
-module.exports = CodeMirror;
-},{"classnames":"classnames","codemirror":1,"lodash.debounce":29,"react":"react","react-dom":"react-dom"}],"react-dom":[function(require,module,exports){
-'use strict';
-
-module.exports = require('./lib/ReactDOM');
-
-},{"./lib/ReactDOM":77}],"react-redux":[function(require,module,exports){
-'use strict';
-
-exports.__esModule = true;
-exports.connect = exports.connectAdvanced = exports.Provider = undefined;
-
-var _Provider = require('./components/Provider');
-
-var _Provider2 = _interopRequireDefault(_Provider);
-
-var _connectAdvanced = require('./components/connectAdvanced');
-
-var _connectAdvanced2 = _interopRequireDefault(_connectAdvanced);
-
-var _connect = require('./connect/connect');
-
-var _connect2 = _interopRequireDefault(_connect);
-
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
-exports.Provider = _Provider2.default;
-exports.connectAdvanced = _connectAdvanced2.default;
-exports.connect = _connect2.default;
-},{"./components/Provider":174,"./components/connectAdvanced":175,"./connect/connect":176}],"react":[function(require,module,exports){
-'use strict';
-
-module.exports = require('./lib/React');
-
-},{"./lib/React":190}],"redux-logger":[function(require,module,exports){
-'use strict';
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-
-var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
-
-var _core = require('./core');
-
-var _helpers = require('./helpers');
-
-var _defaults = require('./defaults');
-
-var _defaults2 = _interopRequireDefault(_defaults);
-
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+},{}],"mock-xmlhttprequest":[function(require,module,exports){
+"use strict";module.exports=require("./src/MockXhr");
-/**
- * Creates logger with following options
- *
- * @namespace
- * @param {object} options - options for logger
- * @param {string | function | object} options.level - console[level]
- * @param {boolean} options.duration - print duration of each action?
- * @param {boolean} options.timestamp - print timestamp with each action?
- * @param {object} options.colors - custom colors
- * @param {object} options.logger - implementation of the `console` API
- * @param {boolean} options.logErrors - should errors in action execution be caught, logged, and re-thrown?
- * @param {boolean} options.collapsed - is group collapsed?
- * @param {boolean} options.predicate - condition which resolves logger behavior
- * @param {function} options.stateTransformer - transform state before print
- * @param {function} options.actionTransformer - transform action before print
- * @param {function} options.errorTransformer - transform error before print
- *
- * @returns {function} logger middleware
- */
-function createLogger() {
- var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
+},{"./src/MockXhr":32}],"prop-types":[function(require,module,exports){
+var REACT_ELEMENT_TYPE,isValidElement,throwOnDirectAccess;module.exports=require("./factoryWithThrowingShims")();
- var loggerOptions = _extends({}, _defaults2.default, options);
+},{"./factoryWithThrowingShims":34}],"react-codemirror":[function(require,module,exports){
+"use strict";function normalizeLineEndings(o){return o?o.replace(/\r\n|\r/g,"\n"):o}var React=require("react"),ReactDOM=require("react-dom"),PropTypes=require("prop-types"),className=require("classnames"),debounce=require("lodash.debounce"),isEqual=require("lodash.isequal"),createReactClass=require("create-react-class"),CodeMirror=createReactClass({propTypes:{autoFocus:PropTypes.bool,className:PropTypes.any,codeMirrorInstance:PropTypes.func,defaultValue:PropTypes.string,name:PropTypes.string,onChange:PropTypes.func,onCursorActivity:PropTypes.func,onFocusChange:PropTypes.func,onScroll:PropTypes.func,options:PropTypes.object,path:PropTypes.string,value:PropTypes.string,preserveScrollPosition:PropTypes.bool},getDefaultProps:function(){return{preserveScrollPosition:!1}},getCodeMirrorInstance:function(){return this.props.codeMirrorInstance||require("codemirror")},getInitialState:function(){return{isFocused:!1}},componentWillMount:function(){this.componentWillReceiveProps=debounce(this.componentWillReceiveProps,0),this.props.path&&console.error("Warning: react-codemirror: the `path` prop has been changed to `name`")},componentDidMount:function(){var o=this.getCodeMirrorInstance();this.codeMirror=o.fromTextArea(this.textareaNode,this.props.options),this.codeMirror.on("change",this.codemirrorValueChanged),this.codeMirror.on("cursorActivity",this.cursorActivity),this.codeMirror.on("focus",this.focusChanged.bind(this,!0)),this.codeMirror.on("blur",this.focusChanged.bind(this,!1)),this.codeMirror.on("scroll",this.scrollChanged),this.codeMirror.setValue(this.props.defaultValue||this.props.value||"")},componentWillUnmount:function(){this.codeMirror&&this.codeMirror.toTextArea()},componentWillReceiveProps:function(o){if(this.codeMirror&&void 0!==o.value&&o.value!==this.props.value&&normalizeLineEndings(this.codeMirror.getValue())!==normalizeLineEndings(o.value))if(this.props.preserveScrollPosition){var e=this.codeMirror.getScrollInfo();this.codeMirror.setValue(o.value),this.codeMirror.scrollTo(e.left,e.top)}else this.codeMirror.setValue(o.value);if("object"==typeof o.options)for(var r in o.options)o.options.hasOwnProperty(r)&&this.setOptionIfChanged(r,o.options[r])},setOptionIfChanged:function(o,e){var r=this.codeMirror.getOption(o);isEqual(r,e)||this.codeMirror.setOption(o,e)},getCodeMirror:function(){return this.codeMirror},focus:function(){this.codeMirror&&this.codeMirror.focus()},focusChanged:function(o){this.setState({isFocused:o}),this.props.onFocusChange&&this.props.onFocusChange(o)},cursorActivity:function(o){this.props.onCursorActivity&&this.props.onCursorActivity(o)},scrollChanged:function(o){this.props.onScroll&&this.props.onScroll(o.getScrollInfo())},codemirrorValueChanged:function(o,e){this.props.onChange&&"setValue"!==e.origin&&this.props.onChange(o.getValue(),e)},render:function(){var o=this,e=className("ReactCodeMirror",this.state.isFocused?"ReactCodeMirror--focused":null,this.props.className);return React.createElement("div",{className:e},React.createElement("textarea",{ref:function(e){return o.textareaNode=e},name:this.props.name||this.props.path,defaultValue:this.props.value,autoComplete:"off",autoFocus:this.props.autoFocus}))}});module.exports=CodeMirror;
- var logger = loggerOptions.logger,
- transformer = loggerOptions.transformer,
- stateTransformer = loggerOptions.stateTransformer,
- errorTransformer = loggerOptions.errorTransformer,
- predicate = loggerOptions.predicate,
- logErrors = loggerOptions.logErrors,
- diffPredicate = loggerOptions.diffPredicate;
+},{"classnames":"classnames","codemirror":1,"create-react-class":3,"lodash.debounce":17,"lodash.isequal":18,"prop-types":"prop-types","react":"react","react-dom":"react-dom"}],"react-dom":[function(require,module,exports){
+"use strict";module.exports=require("./cjs/react-dom.production.min.js");
- // Return if 'console' object is not defined
+},{"./cjs/react-dom.production.min.js":36}],"react-redux":[function(require,module,exports){
+"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}exports.__esModule=!0,exports.connect=exports.connectAdvanced=exports.createProvider=exports.Provider=void 0;var _Provider=require("./components/Provider"),_Provider2=_interopRequireDefault(_Provider),_connectAdvanced=require("./components/connectAdvanced"),_connectAdvanced2=_interopRequireDefault(_connectAdvanced),_connect=require("./connect/connect"),_connect2=_interopRequireDefault(_connect);exports.Provider=_Provider2.default,exports.createProvider=_Provider.createProvider,exports.connectAdvanced=_connectAdvanced2.default,exports.connect=_connect2.default;
- if (typeof logger === 'undefined') {
- return function () {
- return function (next) {
- return function (action) {
- return next(action);
- };
- };
- };
- }
+},{"./components/Provider":37,"./components/connectAdvanced":38,"./connect/connect":39}],"react-test-renderer":[function(require,module,exports){
+"use strict";throw Error("test renderer is not available in production mode.");
- if (transformer) {
- console.error('Option \'transformer\' is deprecated, use \'stateTransformer\' instead!'); // eslint-disable-line no-console
- }
+},{}],"react":[function(require,module,exports){
+"use strict";module.exports=require("./cjs/react.production.min.js");
- var logBuffer = [];
-
- return function (_ref) {
- var getState = _ref.getState;
- return function (next) {
- return function (action) {
- // Exit early if predicate function returns 'false'
- if (typeof predicate === 'function' && !predicate(getState, action)) {
- return next(action);
- }
-
- var logEntry = {};
- logBuffer.push(logEntry);
-
- logEntry.started = _helpers.timer.now();
- logEntry.startedTime = new Date();
- logEntry.prevState = stateTransformer(getState());
- logEntry.action = action;
-
- var returnedValue = void 0;
- if (logErrors) {
- try {
- returnedValue = next(action);
- } catch (e) {
- logEntry.error = errorTransformer(e);
- }
- } else {
- returnedValue = next(action);
- }
-
- logEntry.took = _helpers.timer.now() - logEntry.started;
- logEntry.nextState = stateTransformer(getState());
-
- var diff = loggerOptions.diff && typeof diffPredicate === 'function' ? diffPredicate(getState, action) : loggerOptions.diff;
-
- (0, _core.printBuffer)(logBuffer, _extends({}, loggerOptions, { diff: diff }));
- logBuffer.length = 0;
-
- if (logEntry.error) throw logEntry.error;
- return returnedValue;
- };
- };
- };
-}
-
-exports.default = createLogger;
-module.exports = exports['default'];
-},{"./core":212,"./defaults":213,"./helpers":215}],"redux-thunk":[function(require,module,exports){
-'use strict';
+},{"./cjs/react.production.min.js":51}],"redux-logger":[function(require,module,exports){
+(function (global){
+!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(e.reduxLogger=e.reduxLogger||{})}(this,function(e){"use strict";function t(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}function r(e,t){Object.defineProperty(this,"kind",{value:e,enumerable:!0}),t&&t.length&&Object.defineProperty(this,"path",{value:t,enumerable:!0})}function n(e,t,r){n.super_.call(this,"E",e),Object.defineProperty(this,"lhs",{value:t,enumerable:!0}),Object.defineProperty(this,"rhs",{value:r,enumerable:!0})}function o(e,t){o.super_.call(this,"N",e),Object.defineProperty(this,"rhs",{value:t,enumerable:!0})}function i(e,t){i.super_.call(this,"D",e),Object.defineProperty(this,"lhs",{value:t,enumerable:!0})}function a(e,t,r){a.super_.call(this,"A",e),Object.defineProperty(this,"index",{value:t,enumerable:!0}),Object.defineProperty(this,"item",{value:r,enumerable:!0})}function f(e,t,r){var n=e.slice((r||t)+1||e.length);return e.length=t<0?e.length+t:t,e.push.apply(e,n),e}function u(e){var t="undefined"==typeof e?"undefined":N(e);return"object"!==t?t:e===Math?"math":null===e?"null":Array.isArray(e)?"array":"[object Date]"===Object.prototype.toString.call(e)?"date":"function"==typeof e.toString&&/^\/.*\//.test(e.toString())?"regexp":"object"}function l(e,t,r,c,s,d,p){s=s||[],p=p||[];var g=s.slice(0);if("undefined"!=typeof d){if(c){if("function"==typeof c&&c(g,d))return;if("object"===("undefined"==typeof c?"undefined":N(c))){if(c.prefilter&&c.prefilter(g,d))return;if(c.normalize){var h=c.normalize(g,d,e,t);h&&(e=h[0],t=h[1])}}}g.push(d)}"regexp"===u(e)&&"regexp"===u(t)&&(e=e.toString(),t=t.toString());var y="undefined"==typeof e?"undefined":N(e),v="undefined"==typeof t?"undefined":N(t),b="undefined"!==y||p&&p[p.length-1].lhs&&p[p.length-1].lhs.hasOwnProperty(d),m="undefined"!==v||p&&p[p.length-1].rhs&&p[p.length-1].rhs.hasOwnProperty(d);if(!b&&m)r(new o(g,t));else if(!m&&b)r(new i(g,e));else if(u(e)!==u(t))r(new n(g,e,t));else if("date"===u(e)&&e-t!==0)r(new n(g,e,t));else if("object"===y&&null!==e&&null!==t)if(p.filter(function(t){return t.lhs===e}).length)e!==t&&r(new n(g,e,t));else{if(p.push({lhs:e,rhs:t}),Array.isArray(e)){var w;for(e.length,w=0;w<e.length;w++)w>=t.length?r(new a(g,w,new i(void 0,e[w]))):l(e[w],t[w],r,c,g,w,p);for(;w<t.length;)r(new a(g,w,new o(void 0,t[w++])))}else{var x=Object.keys(e),S=Object.keys(t);x.forEach(function(n,o){var i=S.indexOf(n);i>=0?(l(e[n],t[n],r,c,g,n,p),S=f(S,i)):l(e[n],void 0,r,c,g,n,p)}),S.forEach(function(e){l(void 0,t[e],r,c,g,e,p)})}p.length=p.length-1}else e!==t&&("number"===y&&isNaN(e)&&isNaN(t)||r(new n(g,e,t)))}function c(e,t,r,n){return n=n||[],l(e,t,function(e){e&&n.push(e)},r),n.length?n:void 0}function s(e,t,r){if(r.path&&r.path.length){var n,o=e[t],i=r.path.length-1;for(n=0;n<i;n++)o=o[r.path[n]];switch(r.kind){case"A":s(o[r.path[n]],r.index,r.item);break;case"D":delete o[r.path[n]];break;case"E":case"N":o[r.path[n]]=r.rhs}}else switch(r.kind){case"A":s(e[t],r.index,r.item);break;case"D":e=f(e,t);break;case"E":case"N":e[t]=r.rhs}return e}function d(e,t,r){if(e&&t&&r&&r.kind){for(var n=e,o=-1,i=r.path?r.path.length-1:0;++o<i;)"undefined"==typeof n[r.path[o]]&&(n[r.path[o]]="number"==typeof r.path[o]?[]:{}),n=n[r.path[o]];switch(r.kind){case"A":s(r.path?n[r.path[o]]:n,r.index,r.item);break;case"D":delete n[r.path[o]];break;case"E":case"N":n[r.path[o]]=r.rhs}}}function p(e,t,r){if(r.path&&r.path.length){var n,o=e[t],i=r.path.length-1;for(n=0;n<i;n++)o=o[r.path[n]];switch(r.kind){case"A":p(o[r.path[n]],r.index,r.item);break;case"D":o[r.path[n]]=r.lhs;break;case"E":o[r.path[n]]=r.lhs;break;case"N":delete o[r.path[n]]}}else switch(r.kind){case"A":p(e[t],r.index,r.item);break;case"D":e[t]=r.lhs;break;case"E":e[t]=r.lhs;break;case"N":e=f(e,t)}return e}function g(e,t,r){if(e&&t&&r&&r.kind){var n,o,i=e;for(o=r.path.length-1,n=0;n<o;n++)"undefined"==typeof i[r.path[n]]&&(i[r.path[n]]={}),i=i[r.path[n]];switch(r.kind){case"A":p(i[r.path[n]],r.index,r.item);break;case"D":i[r.path[n]]=r.lhs;break;case"E":i[r.path[n]]=r.lhs;break;case"N":delete i[r.path[n]]}}}function h(e,t,r){if(e&&t){var n=function(n){r&&!r(e,t,n)||d(e,t,n)};l(e,t,n)}}function y(e){return"color: "+F[e].color+"; font-weight: bold"}function v(e){var t=e.kind,r=e.path,n=e.lhs,o=e.rhs,i=e.index,a=e.item;switch(t){case"E":return[r.join("."),n,"→",o];case"N":return[r.join("."),o];case"D":return[r.join(".")];case"A":return[r.join(".")+"["+i+"]",a];default:return[]}}function b(e,t,r,n){var o=c(e,t);try{n?r.groupCollapsed("diff"):r.group("diff")}catch(e){r.log("diff")}o?o.forEach(function(e){var t=e.kind,n=v(e);r.log.apply(r,["%c "+F[t].text,y(t)].concat(P(n)))}):r.log("—— no diff ——");try{r.groupEnd()}catch(e){r.log("—— diff end —— ")}}function m(e,t,r,n){switch("undefined"==typeof e?"undefined":N(e)){case"object":return"function"==typeof e[n]?e[n].apply(e,P(r)):e[n];case"function":return e(t);default:return e}}function w(e){var t=e.timestamp,r=e.duration;return function(e,n,o){var i=["action"];return i.push("%c"+String(e.type)),t&&i.push("%c@ "+n),r&&i.push("%c(in "+o.toFixed(2)+" ms)"),i.join(" ")}}function x(e,t){var r=t.logger,n=t.actionTransformer,o=t.titleFormatter,i=void 0===o?w(t):o,a=t.collapsed,f=t.colors,u=t.level,l=t.diff,c="undefined"==typeof t.titleFormatter;e.forEach(function(o,s){var d=o.started,p=o.startedTime,g=o.action,h=o.prevState,y=o.error,v=o.took,w=o.nextState,x=e[s+1];x&&(w=x.prevState,v=x.started-d);var S=n(g),k="function"==typeof a?a(function(){return w},g,o):a,j=D(p),E=f.title?"color: "+f.title(S)+";":"",A=["color: gray; font-weight: lighter;"];A.push(E),t.timestamp&&A.push("color: gray; font-weight: lighter;"),t.duration&&A.push("color: gray; font-weight: lighter;");var O=i(S,j,v);try{k?f.title&&c?r.groupCollapsed.apply(r,["%c "+O].concat(A)):r.groupCollapsed(O):f.title&&c?r.group.apply(r,["%c "+O].concat(A)):r.group(O)}catch(e){r.log(O)}var N=m(u,S,[h],"prevState"),P=m(u,S,[S],"action"),C=m(u,S,[y,h],"error"),F=m(u,S,[w],"nextState");if(N)if(f.prevState){var L="color: "+f.prevState(h)+"; font-weight: bold";r[N]("%c prev state",L,h)}else r[N]("prev state",h);if(P)if(f.action){var T="color: "+f.action(S)+"; font-weight: bold";r[P]("%c action ",T,S)}else r[P]("action ",S);if(y&&C)if(f.error){var M="color: "+f.error(y,h)+"; font-weight: bold;";r[C]("%c error ",M,y)}else r[C]("error ",y);if(F)if(f.nextState){var _="color: "+f.nextState(w)+"; font-weight: bold";r[F]("%c next state",_,w)}else r[F]("next state",w);l&&b(h,w,r,k);try{r.groupEnd()}catch(e){r.log("—— log end ——")}})}function S(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=Object.assign({},L,e),r=t.logger,n=t.stateTransformer,o=t.errorTransformer,i=t.predicate,a=t.logErrors,f=t.diffPredicate;if("undefined"==typeof r)return function(){return function(e){return function(t){return e(t)}}};if(e.getState&&e.dispatch)return console.error("[redux-logger] redux-logger not installed. Make sure to pass logger instance as middleware:\n// Logger with default options\nimport { logger } from 'redux-logger'\nconst store = createStore(\n reducer,\n applyMiddleware(logger)\n)\n// Or you can create your own logger with custom options http://bit.ly/redux-logger-options\nimport createLogger from 'redux-logger'\nconst logger = createLogger({\n // ...options\n});\nconst store = createStore(\n reducer,\n applyMiddleware(logger)\n)\n"),function(){return function(e){return function(t){return e(t)}}};var u=[];return function(e){var r=e.getState;return function(e){return function(l){if("function"==typeof i&&!i(r,l))return e(l);var c={};u.push(c),c.started=O.now(),c.startedTime=new Date,c.prevState=n(r()),c.action=l;var s=void 0;if(a)try{s=e(l)}catch(e){c.error=o(e)}else s=e(l);c.took=O.now()-c.started,c.nextState=n(r());var d=t.diff&&"function"==typeof f?f(r,l):t.diff;if(x(u,Object.assign({},t,{diff:d})),u.length=0,c.error)throw c.error;return s}}}}var k,j,E=function(e,t){return new Array(t+1).join(e)},A=function(e,t){return E("0",t-e.toString().length)+e},D=function(e){return A(e.getHours(),2)+":"+A(e.getMinutes(),2)+":"+A(e.getSeconds(),2)+"."+A(e.getMilliseconds(),3)},O="undefined"!=typeof performance&&null!==performance&&"function"==typeof performance.now?performance:Date,N="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},P=function(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return Array.from(e)},C=[];k="object"===("undefined"==typeof global?"undefined":N(global))&&global?global:"undefined"!=typeof window?window:{},j=k.DeepDiff,j&&C.push(function(){"undefined"!=typeof j&&k.DeepDiff===c&&(k.DeepDiff=j,j=void 0)}),t(n,r),t(o,r),t(i,r),t(a,r),Object.defineProperties(c,{diff:{value:c,enumerable:!0},observableDiff:{value:l,enumerable:!0},applyDiff:{value:h,enumerable:!0},applyChange:{value:d,enumerable:!0},revertChange:{value:g,enumerable:!0},isConflict:{value:function(){return"undefined"!=typeof j},enumerable:!0},noConflict:{value:function(){return C&&(C.forEach(function(e){e()}),C=null),c},enumerable:!0}});var F={E:{color:"#2196F3",text:"CHANGED:"},N:{color:"#4CAF50",text:"ADDED:"},D:{color:"#F44336",text:"DELETED:"},A:{color:"#2196F3",text:"ARRAY:"}},L={level:"log",logger:console,logErrors:!0,collapsed:void 0,predicate:void 0,duration:!1,timestamp:!0,stateTransformer:function(e){return e},actionTransformer:function(e){return e},errorTransformer:function(e){return e},colors:{title:function(){return"inherit"},prevState:function(){return"#9E9E9E"},action:function(){return"#03A9F4"},nextState:function(){return"#4CAF50"},error:function(){return"#F20404"}},diff:!1,diffPredicate:void 0,transformer:void 0},T=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.dispatch,r=e.getState;return"function"==typeof t||"function"==typeof r?S()({dispatch:t,getState:r}):void console.error("\n[redux-logger v3] BREAKING CHANGE\n[redux-logger v3] Since 3.0.0 redux-logger exports by default logger with default settings.\n[redux-logger v3] Change\n[redux-logger v3] import createLogger from 'redux-logger'\n[redux-logger v3] to\n[redux-logger v3] import { createLogger } from 'redux-logger'\n")};e.defaults=L,e.createLogger=S,e.logger=T,e.default=T,Object.defineProperty(e,"__esModule",{value:!0})});
-exports.__esModule = true;
-function createThunkMiddleware(extraArgument) {
- return function (_ref) {
- var dispatch = _ref.dispatch,
- getState = _ref.getState;
- return function (next) {
- return function (action) {
- if (typeof action === 'function') {
- return action(dispatch, getState, extraArgument);
- }
+}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
- return next(action);
- };
- };
- };
-}
+},{}],"redux-mock-store":[function(require,module,exports){
+"use strict";function _toConsumableArray(n){if(Array.isArray(n)){for(var e=0,r=Array(n.length);e<n.length;e++)r[e]=n[e];return r}return Array.from(n)}function configureStore(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return function(){function e(){var n=[],e=[],t={getState:function(){return isFunction(r)?r():r},getActions:function(){return n},dispatch:function(r){if("undefined"==typeof r)throw new Error("Actions may not be an undefined.");if("undefined"==typeof r.type)throw new Error('Actions may not have an undefined "type" property. Have you misspelled a constant? Action: '+JSON.stringify(r));n.push(r);for(var t=0;t<e.length;t++)e[t]();return r},clearActions:function(){n=[]},subscribe:function(n){return isFunction(n)&&e.push(n),function(){var r=e.indexOf(n);r<0||e.splice(r,1)}},replaceReducer:function(n){if(!isFunction(n))throw new Error("Expected the nextReducer to be a function.")}};return t}var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=_redux.applyMiddleware.apply(void 0,_toConsumableArray(n))(e);return t()}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=configureStore;var _redux=require("redux"),isFunction=function(n){return"function"==typeof n};
-var thunk = createThunkMiddleware();
-thunk.withExtraArgument = createThunkMiddleware;
+},{"redux":"redux"}],"redux-thunk":[function(require,module,exports){
+"use strict";function createThunkMiddleware(t){return function(e){var n=e.dispatch,r=e.getState;return function(e){return function(u){return"function"==typeof u?u(n,r,t):e(u)}}}}exports.__esModule=!0;var thunk=createThunkMiddleware();thunk.withExtraArgument=createThunkMiddleware,exports.default=thunk;
-exports['default'] = thunk;
},{}],"redux":[function(require,module,exports){
-(function (process){
-'use strict';
-
-exports.__esModule = true;
-exports.compose = exports.applyMiddleware = exports.bindActionCreators = exports.combineReducers = exports.createStore = undefined;
-
-var _createStore = require('./createStore');
-
-var _createStore2 = _interopRequireDefault(_createStore);
-
-var _combineReducers = require('./combineReducers');
-
-var _combineReducers2 = _interopRequireDefault(_combineReducers);
-
-var _bindActionCreators = require('./bindActionCreators');
-
-var _bindActionCreators2 = _interopRequireDefault(_bindActionCreators);
-
-var _applyMiddleware = require('./applyMiddleware');
-
-var _applyMiddleware2 = _interopRequireDefault(_applyMiddleware);
-
-var _compose = require('./compose');
-
-var _compose2 = _interopRequireDefault(_compose);
-
-var _warning = require('./utils/warning');
-
-var _warning2 = _interopRequireDefault(_warning);
-
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
-
-/*
-* This is a dummy function to check if the function name has been altered by minification.
-* If the function has been minified and NODE_ENV !== 'production', warn the user.
-*/
-function isCrushed() {}
-
-if (process.env.NODE_ENV !== 'production' && typeof isCrushed.name === 'string' && isCrushed.name !== 'isCrushed') {
- (0, _warning2['default'])('You are currently using minified code outside of NODE_ENV === \'production\'. ' + 'This means that you are running a slower development build of Redux. ' + 'You can use loose-envify (https://github.com/zertosh/loose-envify) for browserify ' + 'or DefinePlugin for webpack (http://stackoverflow.com/questions/30030031) ' + 'to ensure you have the correct code for your production build.');
-}
-
-exports.createStore = _createStore2['default'];
-exports.combineReducers = _combineReducers2['default'];
-exports.bindActionCreators = _bindActionCreators2['default'];
-exports.applyMiddleware = _applyMiddleware2['default'];
-exports.compose = _compose2['default'];
-}).call(this,require('_process'))
-
-},{"./applyMiddleware":216,"./bindActionCreators":217,"./combineReducers":218,"./compose":219,"./createStore":220,"./utils/warning":221,"_process":43}],"shallowequal":[function(require,module,exports){
-'use strict';
-
-var fetchKeys = require('lodash.keys');
-
-module.exports = function shallowEqual(objA, objB, compare, compareContext) {
-
- var ret = compare ? compare.call(compareContext, objA, objB) : void 0;
-
- if (ret !== void 0) {
- return !!ret;
- }
-
- if (objA === objB) {
- return true;
- }
-
- if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {
- return false;
- }
-
- var keysA = fetchKeys(objA);
- var keysB = fetchKeys(objB);
-
- var len = keysA.length;
- if (len !== keysB.length) {
- return false;
- }
-
- compareContext = compareContext || null;
-
- // Test for A's keys different from B.
- var bHasOwnProperty = Object.prototype.hasOwnProperty.bind(objB);
- for (var i = 0; i < len; i++) {
- var key = keysA[i];
- if (!bHasOwnProperty(key)) {
- return false;
- }
- var valueA = objA[key];
- var valueB = objB[key];
+"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function isCrushed(){}exports.__esModule=!0,exports.compose=exports.applyMiddleware=exports.bindActionCreators=exports.combineReducers=exports.createStore=void 0;var _createStore=require("./createStore"),_createStore2=_interopRequireDefault(_createStore),_combineReducers=require("./combineReducers"),_combineReducers2=_interopRequireDefault(_combineReducers),_bindActionCreators=require("./bindActionCreators"),_bindActionCreators2=_interopRequireDefault(_bindActionCreators),_applyMiddleware=require("./applyMiddleware"),_applyMiddleware2=_interopRequireDefault(_applyMiddleware),_compose=require("./compose"),_compose2=_interopRequireDefault(_compose),_warning=require("./utils/warning"),_warning2=_interopRequireDefault(_warning);exports.createStore=_createStore2.default,exports.combineReducers=_combineReducers2.default,exports.bindActionCreators=_bindActionCreators2.default,exports.applyMiddleware=_applyMiddleware2.default,exports.compose=_compose2.default;
- var _ret = compare ? compare.call(compareContext, valueA, valueB, key) : void 0;
- if (_ret === false || _ret === void 0 && valueA !== valueB) {
- return false;
- }
- }
+},{"./applyMiddleware":52,"./bindActionCreators":53,"./combineReducers":54,"./compose":55,"./createStore":56,"./utils/warning":57}],"shallowequal":[function(require,module,exports){
+module.exports=function(r,e,t,o){var n=t?t.call(o,r,e):void 0;if(void 0!==n)return!!n;if(r===e)return!0;if("object"!=typeof r||!r||"object"!=typeof e||!e)return!1;var i=Object.keys(r),f=Object.keys(e);if(i.length!==f.length)return!1;for(var u=Object.prototype.hasOwnProperty.bind(e),v=0;v<i.length;v++){var a=i[v];if(!u(a))return!1;var c=r[a],l=e[a];if(n=t?t.call(o,c,l,a):void 0,n===!1||void 0===n&&c!==l)return!1}return!0};
- return true;
-};
-},{"lodash.keys":222}]},{},[])
+},{}]},{},[])
//# sourceMappingURL=vendor.js.map