diff --git a/src-view/Routes.js b/src-view/Routes.js index 8c79910..add5789 100644 --- a/src-view/Routes.js +++ b/src-view/Routes.js @@ -2,14 +2,18 @@ import React from 'react' import LandingView from './views/LandingView' import { Router } from '@reach/router' import LoginView from './views/LoginView' +import Transition from './views/Transition' +// import Login from './views/Login' +// import Signup from './views/Signup' import SignUpView from './views/SignUpView' export default () => { return ( - - + + {/* */} + {/* */} ) } diff --git a/src-view/assets/styles/Transition.module.scss b/src-view/assets/styles/Transition.module.scss new file mode 100644 index 0000000..c5ec897 --- /dev/null +++ b/src-view/assets/styles/Transition.module.scss @@ -0,0 +1,152 @@ +@import './variables'; +@import './mixins'; + +body { + + font-family: "Montserrat", sans-serif; + // background: rgb(15,11,84); + // background: radial-gradient(circle, rgba(15,11,84,1) 0%, rgba(29,29,173,1) 45%, rgba(0,212,255,1) 96%); + background-image: linear-gradient(to right, var(--violet), var(--green)); + + } + + h1 { + text-align: center; + color: #ffffff; + } + + .title{ + color: red; + } + + .tank-title { + font-size: 30px; + } + + //Custom Fonts + @import url("https://fonts.googleapis.com/css?family=Open+Sans&display=swap"); + + .App { + text-align: center; + display: flex; + justify-content: center; + align-items: center; + font-family: "Open Sans", sans-serif; + } + + .App-logo { + animation: App-logo-spin infinite 20s linear; + height: 40vmin; + pointer-events: none; + } + + .App-header { + background-color: #282c34; + min-height: 100vh; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + font-size: calc(10px + 2vmin); + color: white; + } + + .App-link { + color: #61dafb; + } + + @keyframes App-logo-spin { + from { + transform: rotate(0deg); + } + to { + transform: rotate(360deg); + } + } + + //Login Main Container + .login { + background-color:red; + width: 27em; + height: 40em; + //min-height: 44em; + display: flex; + justify-content: center; + align-items: center; + margin-top: 150px; + position: relative; + z-index: 99; + .container { + display: flex; + justify-content: center; + align-items: center; + background-color: #fff; + box-shadow: 0px 0px 12px 2px rgba(15, 15, 15, 0.2); + border-radius: 4px; + position: relative; + z-index: 99; + width: 100%; + height: 100%; + z-index: 99; + padding: 17px 10px; + //transition: transform 200ms ease-in-out; + } + .rightSide { + display: flex; + flex-direction: column; + justify-content: center; + height: 90%; + background-color:#4830C2; + width: 100%; + position: absolute; + right: -34%; + border-radius: 6px; + z-index: 1; + transition: all 400ms ease-in-out; + cursor: pointer; + box-shadow: 0px 0px 12px 2px rgba(15, 15, 15, 0.281); + + &.right { + right: -40%; + align-items: flex-end; + background-color:#4830C2; + &:hover { + right: -45%; + } + } + &.left { + right: 40%; + align-items: flex-start; + background-color:#00E4BF; + &:hover { + right: 45%; + } + } + + .text { + font-size: 21px; + font-weight: 500; + color: #fff; + margin-right: 3em; + margin-left: 3em; + } + } + } + + //Button + .btn { + font-size: 21px; + padding: 5px 20px; + border: 0; + background-color: #3498db; + color: #fff; + border-radius: 3px; + transition: all 250ms ease-in-out; + cursor: pointer; + &:hover { + background-color: #2386c8; + } + &:focus { + outline: none; + } + } \ No newline at end of file diff --git a/src-view/assets/styles/login-signup-styles.module.scss b/src-view/assets/styles/login-signup-styles.module.scss new file mode 100644 index 0000000..a00221e --- /dev/null +++ b/src-view/assets/styles/login-signup-styles.module.scss @@ -0,0 +1,94 @@ +@import './variables'; +@import './mixins'; + +.baseContainer { + width: 100%; + display: flex; + flex-direction: column; + align-items: center; + .header { + font-size: 24px; + font-family: "Open Sans", sans-serif; + } + + .content { + display: flex; + flex-direction: column; + + .image { + width: 21em; + img { + width: 100%; + height: 100%; + } + } + + .form { + margin-top: 2em; + display: flex; + flex-direction: column; + align-items: center; + + .formGroup { + display: flex; + flex-direction: column; + align-items: flex-start; + width: fit-content; + label { + font-size: 20px; + } + input { + margin-top: 6px; + min-width: 18em; + height: 37px; + padding: 0px 10px; + font-size: 16px; + font-family: "Open Sans", sans-serif; + background-color: #f3f3f3; + border: 0; + border-radius: 4px; + margin-bottom: 31px; + transition: all 250ms ease-in-out; + &:hover { + background-color: #ffffff; + box-shadow: 0px 0px 14px 0.3px #0e81ce96; + } + + &:focus { + outline: none; + box-shadow: 0px 0px 12px 0.8px #3474dbb2; + } + } + } + } + } + + .footer { + margin-top: 3em; + } + .btn { + box-shadow: 3px 4px 0px 0px #1564ad; + background:linear-gradient(to bottom, #79bbff 5%, #378de5 100%); + background-color:#79bbff; + border-radius:5px; + border:1px solid #337bc4; + display:inline-block; + cursor:pointer; + color:#ffffff; + font-family:Arial; + font-size:17px; + font-weight:bold; + padding:12px 44px; + text-decoration:none; + text-shadow:0px 1px 0px #528ecc; + } + .btn:hover { + background:linear-gradient(to bottom, #378de5 5%, #79bbff 100%); + background-color:#378de5; + } + .btn:active { + position:relative; + top:1px; + } + + } \ No newline at end of file diff --git a/src-view/css/login.css b/src-view/css/login.css index 135453e..5daf46e 100644 --- a/src-view/css/login.css +++ b/src-view/css/login.css @@ -1,4 +1,8 @@ .login-container { display: flex; justify-content: center; +} + +.test{ + background-color: brown; } \ No newline at end of file diff --git a/src-view/dist/src-view.e31bb0bc.css b/src-view/dist/src-view.e31bb0bc.css index 8ead1d4..0c2318c 100644 --- a/src-view/dist/src-view.e31bb0bc.css +++ b/src-view/dist/src-view.e31bb0bc.css @@ -22,46 +22,46 @@ --icon-hamburger: url('data:image/svg+xml,'); --icon-deals-info: url('data:image/svg+xml,'); } -._landingContainer_4ce18 { +._landingContainer_e76e4 { background-image: linear-gradient(to right, var(--violet), var(--green)); height: 100vh; display: flex; flex-direction: column; justify-content: space-between; } - ._landingContainer_4ce18 ._landingNavbar_4ce18 { + ._landingContainer_e76e4 ._landingNavbar_e76e4 { padding: 1rem; } - ._landingContainer_4ce18 ._heroDiv_4ce18 { + ._landingContainer_e76e4 ._heroDiv_e76e4 { display: flex; justify-content: space-evenly; flex-wrap: wrap-reverse; } - ._landingContainer_4ce18 ._heroText_4ce18 { + ._landingContainer_e76e4 ._heroText_e76e4 { display: flex; flex-direction: column; justify-content: center; font-size: 1.5rem; line-height: 2rem; } - ._landingContainer_4ce18 ._heroText_4ce18 > h3 { + ._landingContainer_e76e4 ._heroText_e76e4 > h3 { font-size: 2rem; } - ._landingContainer_4ce18 ._heroText_4ce18 ._landingButton_4ce18 { + ._landingContainer_e76e4 ._heroText_e76e4 ._landingButton_e76e4 { margin-top: 1rem; } - ._landingContainer_4ce18 ._heroText_4ce18 ._greenButton_4ce18 { + ._landingContainer_e76e4 ._heroText_e76e4 ._greenButton_e76e4 { width: 100%; } - ._landingContainer_4ce18 ._heroImage_4ce18 { + ._landingContainer_e76e4 ._heroImage_e76e4 { display: none; } @media (orientation: landscape) and (min-device-aspect-ratio: 1 / 1) { - ._landingContainer_4ce18 ._heroImage_4ce18 { + ._landingContainer_e76e4 ._heroImage_e76e4 { display: inline; } } -._navbar_7e8b6 { +._navbar_6b6e4 { display: flex; } - ._navbar_7e8b6 ._navRight_7e8b6 { + ._navbar_6b6e4 ._navRight_6b6e4 { font-weight: 600; display: flex; flex-grow: 1; justify-content: flex-end; margin-top: 0.5rem; } -._loginDiv_8c853 { +._loginDiv_a1505 { display: flex; justify-content: center; align-content: center; @@ -71,54 +71,288 @@ padding: 5rem 0rem; width: 80%; max-width: 36rem; } - ._loginDiv_8c853 > a { + ._loginDiv_a1505 > a { cursor: pointer; align-self: center; margin-top: 1rem; } - ._loginDiv_8c853 > h1 { + ._loginDiv_a1505 > h1 { align-self: center; font-weight: 400; } @media (orientation: landscape) and (min-device-aspect-ratio: 1 / 1) { - ._loginDiv_8c853 { + ._loginDiv_a1505 { box-shadow: 0px 0px 30px -2px rgba(150, 144, 150, 0.85); padding: 5rem 3rem; width: 50%; } } - ._loginDivWrapper_8c853 { + ._loginDivWrapper_a1505 { display: flex; flex-direction: column; height: 100%; justify-content: center; } - ._loginDiv_8c853 ._loginForm_8c853 { + ._loginDiv_a1505 ._loginForm_a1505 { display: flex; flex-direction: column; margin: 2rem 0 0 0; } - ._loginDiv_8c853 ._loginForm_8c853 > button { + ._loginDiv_a1505 ._loginForm_a1505 > button { width: 100%; margin: 2rem 0 0 0; } -._AppLayout_bdfc1 { +._AppLayout_6bcc6 { display: flex; flex-direction: column; } - ._AppLayout_bdfc1 ._navbar_bdfc1 { + ._AppLayout_6bcc6 ._navbar_6bcc6 { padding: 1rem; box-shadow: 0px 2px 5px rgba(68, 68, 68, 0.6); } - ._AppLayout_bdfc1 ._childContent_bdfc1 { + ._AppLayout_6bcc6 ._childContent_6bcc6 { position: relative; flex: 1; padding: 0 1rem; margin-bottom: 2rem; } @media (orientation: landscape) and (min-device-aspect-ratio: 1 / 1) { - ._AppLayout_bdfc1 ._childContent_bdfc1 { + ._AppLayout_6bcc6 ._childContent_6bcc6 { padding: 0 1.625rem; } } - ._AppLayout_bdfc1 ._childContentWrapper_bdfc1 { + ._AppLayout_6bcc6 ._childContentWrapper_6bcc6 { display: flex; flex-flow: column; min-height: 90vh; } @media (orientation: landscape) and (min-device-aspect-ratio: 1 / 1) { - ._AppLayout_bdfc1 ._childContentWrapper_bdfc1 { + ._AppLayout_6bcc6 ._childContentWrapper_6bcc6 { flex-flow: row; } } -._signUpDiv_b0e2c { +:root { + --white: hsl(0, 0%, 98%); + --black: hsl(0, 0%, 12%); + --gray: hsl(0, 0%, 65%); + --space: 1.25rem; + --ruby: #ff9494; + --red: #ee534c; + --violet: #9349c1; + --light-violet: #ECCCFF; + --green: #28E2BC; + --dark-blue: #186c8a; + --light-blue: #e6f4fa; + --apple-green: #48b049; + --moss-green: #a4d6a5; + --light-lime-green: #f1faf1; + --font: 'Rubik', "Open Sans"; + --max-width: 65rem; + --border-radius: 5px; + --card-shadow: 0 4px 8px 0 hsla(0, 0%, 0%, 0.08), + 0 1px 2px 0 hsla(0, 0%, 0%, 0.04); + --icon-close: url('data:image/svg+xml,'); + --icon-hamburger: url('data:image/svg+xml,'); + --icon-deals-info: url('data:image/svg+xml,'); } + +._baseContainer_4c61a { + width: 100%; + display: flex; + flex-direction: column; + align-items: center; } + ._baseContainer_4c61a ._header_4c61a { + font-size: 24px; + font-family: "Open Sans", sans-serif; } + ._baseContainer_4c61a ._content_4c61a { + display: flex; + flex-direction: column; } + ._baseContainer_4c61a ._content_4c61a ._image_4c61a { + width: 21em; } + ._baseContainer_4c61a ._content_4c61a ._image_4c61a img { + width: 100%; + height: 100%; } + ._baseContainer_4c61a ._content_4c61a ._form_4c61a { + margin-top: 2em; + display: flex; + flex-direction: column; + align-items: center; } + ._baseContainer_4c61a ._content_4c61a ._form_4c61a ._formGroup_4c61a { + display: flex; + flex-direction: column; + align-items: flex-start; + width: fit-content; } + ._baseContainer_4c61a ._content_4c61a ._form_4c61a ._formGroup_4c61a label { + font-size: 20px; } + ._baseContainer_4c61a ._content_4c61a ._form_4c61a ._formGroup_4c61a input { + margin-top: 6px; + min-width: 18em; + height: 37px; + padding: 0px 10px; + font-size: 16px; + font-family: "Open Sans", sans-serif; + background-color: #f3f3f3; + border: 0; + border-radius: 4px; + margin-bottom: 31px; + transition: all 250ms ease-in-out; } + ._baseContainer_4c61a ._content_4c61a ._form_4c61a ._formGroup_4c61a input:hover { + background-color: #ffffff; + box-shadow: 0px 0px 14px 0.3px #0e81ce96; } + ._baseContainer_4c61a ._content_4c61a ._form_4c61a ._formGroup_4c61a input:focus { + outline: none; + box-shadow: 0px 0px 12px 0.8px #3474dbb2; } + ._baseContainer_4c61a ._footer_4c61a { + margin-top: 3em; } + ._baseContainer_4c61a ._btn_4c61a { + box-shadow: 3px 4px 0px 0px #1564ad; + background: linear-gradient(to bottom, #79bbff 5%, #378de5 100%); + background-color: #79bbff; + border-radius: 5px; + border: 1px solid #337bc4; + display: inline-block; + cursor: pointer; + color: #ffffff; + font-family: Arial; + font-size: 17px; + font-weight: bold; + padding: 12px 44px; + text-decoration: none; + text-shadow: 0px 1px 0px #528ecc; } + ._baseContainer_4c61a ._btn_4c61a:hover { + background: linear-gradient(to bottom, #378de5 5%, #79bbff 100%); + background-color: #378de5; } + ._baseContainer_4c61a ._btn_4c61a:active { + position: relative; + top: 1px; } + +@import url("https://fonts.googleapis.com/css?family=Open+Sans&display=swap"); +:root { + --white: hsl(0, 0%, 98%); + --black: hsl(0, 0%, 12%); + --gray: hsl(0, 0%, 65%); + --space: 1.25rem; + --ruby: #ff9494; + --red: #ee534c; + --violet: #9349c1; + --light-violet: #ECCCFF; + --green: #28E2BC; + --dark-blue: #186c8a; + --light-blue: #e6f4fa; + --apple-green: #48b049; + --moss-green: #a4d6a5; + --light-lime-green: #f1faf1; + --font: 'Rubik', "Open Sans"; + --max-width: 65rem; + --border-radius: 5px; + --card-shadow: 0 4px 8px 0 hsla(0, 0%, 0%, 0.08), + 0 1px 2px 0 hsla(0, 0%, 0%, 0.04); + --icon-close: url('data:image/svg+xml,'); + --icon-hamburger: url('data:image/svg+xml,'); + --icon-deals-info: url('data:image/svg+xml,'); } + +body { + font-family: "Montserrat", sans-serif; + background-image: linear-gradient(to right, var(--violet), var(--green)); } + +h1 { + text-align: center; + color: #ffffff; } + +._title_50a7d { + color: red; } + +._tank-title_50a7d { + font-size: 30px; } + +._App_50a7d { + text-align: center; + display: flex; + justify-content: center; + align-items: center; + font-family: "Open Sans", sans-serif; } + +._App-logo_50a7d { + animation: _App-logo-spin_50a7d infinite 20s linear; + height: 40vmin; + pointer-events: none; } + +._App-header_50a7d { + background-color: #282c34; + min-height: 100vh; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + font-size: calc(10px + 2vmin); + color: white; } + +._App-link_50a7d { + color: #61dafb; } + +@keyframes _App-logo-spin_50a7d { + from { + transform: rotate(0deg); } + to { + transform: rotate(360deg); } } + +._login_50a7d { + background-color: red; + width: 27em; + height: 40em; + display: flex; + justify-content: center; + align-items: center; + margin-top: 150px; + position: relative; + z-index: 99; } + ._login_50a7d ._container_50a7d { + display: flex; + justify-content: center; + align-items: center; + background-color: #fff; + box-shadow: 0px 0px 12px 2px rgba(15, 15, 15, 0.2); + border-radius: 4px; + position: relative; + z-index: 99; + width: 100%; + height: 100%; + z-index: 99; + padding: 17px 10px; } + ._login_50a7d ._rightSide_50a7d { + display: flex; + flex-direction: column; + justify-content: center; + height: 90%; + background-color: #4830C2; + width: 100%; + position: absolute; + right: -34%; + border-radius: 6px; + z-index: 1; + transition: all 400ms ease-in-out; + cursor: pointer; + box-shadow: 0px 0px 12px 2px rgba(15, 15, 15, 0.281); } + ._login_50a7d ._rightSide_50a7d._right_50a7d { + right: -40%; + align-items: flex-end; + background-color: #4830C2; } + ._login_50a7d ._rightSide_50a7d._right_50a7d:hover { + right: -45%; } + ._login_50a7d ._rightSide_50a7d._left_50a7d { + right: 40%; + align-items: flex-start; + background-color: #00E4BF; } + ._login_50a7d ._rightSide_50a7d._left_50a7d:hover { + right: 45%; } + ._login_50a7d ._rightSide_50a7d ._text_50a7d { + font-size: 21px; + font-weight: 500; + color: #fff; + margin-right: 3em; + margin-left: 3em; } + +._btn_50a7d { + font-size: 21px; + padding: 5px 20px; + border: 0; + background-color: #3498db; + color: #fff; + border-radius: 3px; + transition: all 250ms ease-in-out; + cursor: pointer; } + ._btn_50a7d:hover { + background-color: #2386c8; } + ._btn_50a7d:focus { + outline: none; } + +._signUpDiv_d02dc { display: flex; justify-content: center; align-content: center; @@ -128,24 +362,24 @@ padding: 5rem 0rem; width: 80%; max-width: 36rem; } - ._signUpDiv_b0e2c > h1 { + ._signUpDiv_d02dc > h1 { align-self: center; font-weight: 400; } @media (orientation: landscape) and (min-device-aspect-ratio: 1 / 1) { - ._signUpDiv_b0e2c { + ._signUpDiv_d02dc { box-shadow: 0px 0px 30px -2px rgba(150, 144, 150, 0.85); padding: 5rem 3rem; width: 50%; } } - ._signUpDivWrapper_b0e2c { + ._signUpDivWrapper_d02dc { display: flex; flex-direction: column; height: 100%; justify-content: center; } - ._signUpDiv_b0e2c ._signUpForm_b0e2c { + ._signUpDiv_d02dc ._signUpForm_d02dc { display: flex; flex-direction: column; margin: 2rem 0 0 0; } - ._signUpDiv_b0e2c ._signUpForm_b0e2c > button { + ._signUpDiv_d02dc ._signUpForm_d02dc > button { width: 100%; margin: 2rem 0 0 0; } diff --git a/src-view/dist/src-view.e31bb0bc.css.map b/src-view/dist/src-view.e31bb0bc.css.map index af2b7df..8033ab9 100644 --- a/src-view/dist/src-view.e31bb0bc.css.map +++ b/src-view/dist/src-view.e31bb0bc.css.map @@ -1 +1 @@ -{"version":3,"sources":["assets/styles/_variables.scss","assets/styles/components/LandingView.module.scss","assets/styles/_mixins.scss","assets/styles/components/Navbar.module.scss","assets/styles/LoginView.module.scss","assets/styles/components/AppLayout.module.scss","assets/styles/SignUpView.module.scss"],"names":[],"mappings":"AAGA;EACI,wBAAQ;EACR,wBAAQ;EACR,uBAAO;EACP,gBAAQ;EACR,eAAO;EACP,cAAM;EACN,iBAAS;EACT,uBAAe;EACf,gBAAQ;EACR,oBAAY;EACZ,qBAAa;EACb,sBAAc;EACd,qBAAa;EACb,2BAAmB;EACnB,4BAAO;EACP,kBAAY;EACZ,oBAAgB;EAChB;yCAAc;EAEd,+bAAa;EACb,2hBAAiB;EACjB,6RAAkB,EAAA;;ACrBtB;EACI,wEAAwE;EACxE,aAAa;EACb,aAAa;EACb,sBAAsB;EACtB,8BAA8B,EAAA;EALlC;IASQ,aAAa,EAAA;EATrB;IAaQ,aAAa;IACb,6BAA6B;IAC7B,uBAAuB,EAAA;EAf/B;IAuBQ,aAAa;IACb,sBAAsB;IACtB,uBAAuB;IACvB,iBAAiB;IACjB,iBAAiB,EAAA;IA3BzB;MAoBY,eAAe,EAAA;IApB3B;MA8BY,gBAAgB,EAAA;IA9B5B;MAkCY,WAAW,EAAA;EAlCvB;IAuCQ,aAAa,EAAA;IC1CjB;MDGJ;QA0CY,eAAe,EAAA,EAEtB;;AEhDL;EACE,aAAa,EAAA;EADf;IAII,gBAAgB;IAChB,aAAa;IACb,YAAY;IACZ,yBAAyB;IACzB,kBAAkB,EAAA;;ACNtB;EACI,aAAa;EACb,uBAAuB;EACvB,qBAAqB;EACrB,sBAAsB;EACtB,kBAAkB;EAClB,cAAc;EACd,kBAAkB;EAClB,UAAU;EACV,gBAAgB,EAAA;EATpB;IAYQ,eAAe;IACf,kBAAkB;IAClB,gBAAgB,EAAA;EAdxB;IAkBQ,kBAAkB;IAClB,gBAAgB,EAAA;EFpBpB;IECJ;MAuBQ,uDAAuD;MACvD,kBAAkB;MAClB,UAAU,EAAA,EAqBjB;EAjBG;IACI,aAAa;IACb,sBAAsB;IACtB,YAAY;IACZ,uBAAuB,EAAA;EAjC/B;IAqCQ,aAAa;IACb,sBAAsB;IACtB,kBAAkB,EAAA;IAvC1B;MA0CY,WAAW;MACX,kBAAkB,EAAA;;AC3C9B;EAME,aAAa;EACb,sBAAsB,EAAA;EAPxB;IAEI,aAAa;IACb,6CAA6C,EAAA;EAHjD;IAUI,kBAAkB;IAClB,OAAO;IACP,eAAe;IACf,mBAAmB,EAAA;IHdnB;MGCJ;QAgBM,mBAAmB,EAAA,EActB;IA9BH;MAqBM,aAAa;MACb,iBAAiB;MACjB,gBAAgB,EAAA;MHxBlB;QGCJ;UA0BQ,cAAc,EAAA,EAEjB;;AC5BL;EACI,aAAa;EACb,uBAAuB;EACvB,qBAAqB;EACrB,sBAAsB;EACtB,kBAAkB;EAClB,cAAc;EACd,kBAAkB;EAClB,UAAU;EACV,gBAAgB,EAAA;EATpB;IAYQ,kBAAkB;IAClB,gBAAgB,EAAA;EJdpB;IICJ;MAiBQ,uDAAuD;MACvD,kBAAkB;MAClB,UAAU,EAAA,EAqBjB;EAjBG;IACI,aAAa;IACb,sBAAsB;IACtB,YAAY;IACZ,uBAAuB,EAAA;EA3B/B;IA+BQ,aAAa;IACb,sBAAsB;IACtB,kBAAkB,EAAA;IAjC1B;MAoCY,WAAW;MACX,kBAAkB,EAAA","file":"src-view.e31bb0bc.css","sourceRoot":"..","sourcesContent":["$primary-violet: hsl(277, 49%, 52%);\n$primary-green: #28E2BC;\n\n:root {\n --white: hsl(0, 0%, 98%);\n --black: hsl(0, 0%, 12%);\n --gray: hsl(0, 0%, 65%);\n --space: 1.25rem;\n --ruby: #ff9494;\n --red: #ee534c;\n --violet: #{$primary-violet};\n --light-violet: #ECCCFF;\n --green: #{$primary-green};\n --dark-blue: #186c8a;\n --light-blue: #e6f4fa;\n --apple-green: #48b049;\n --moss-green: #a4d6a5;\n --light-lime-green: #f1faf1;\n --font: 'Rubik', \"Open Sans\";\n --max-width: 65rem;\n --border-radius: 5px;\n --card-shadow: 0 4px 8px 0 hsla(0, 0%, 0%, 0.08),\n 0 1px 2px 0 hsla(0, 0%, 0%, 0.04);\n --icon-close: url('data:image/svg+xml,');\n --icon-hamburger: url('data:image/svg+xml,');\n --icon-deals-info: url('data:image/svg+xml,');\n}\n","@import '../variables';\n@import '../mixins';\n\n\n.landingContainer {\n background-image: linear-gradient(to right, var(--violet), var(--green));\n height: 100vh;\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n\n .landingNavbar {\n // justify-self: flex-start;\n padding: 1rem;\n }\n\n .heroDiv {\n display: flex;\n justify-content: space-evenly;\n flex-wrap: wrap-reverse;\n }\n\n .heroText {\n >h3 {\n font-size: 2rem;\n }\n\n display: flex;\n flex-direction: column;\n justify-content: center;\n font-size: 1.5rem;\n line-height: 2rem;\n\n .landingButton {\n margin-top: 1rem;\n }\n\n .greenButton {\n width: 100%;\n }\n }\n\n .heroImage {\n display: none;\n\n @include for-desktop {\n display: inline;\n }\n }\n}\n","@mixin for-desktop {\n @media (orientation: landscape) and (min-device-aspect-ratio: 1/1) {\n @content;\n }\n}\n",".navbar {\n display: flex;\n\n .navRight {\n font-weight: 600;\n display: flex;\n flex-grow: 1;\n justify-content: flex-end;\n margin-top: 0.5rem;\n }\n}\n","@import './mixins';\n\n.loginDiv {\n display: flex;\n justify-content: center;\n align-content: center;\n flex-direction: column;\n align-self: center;\n flex-shrink: 1;\n padding: 5rem 0rem;\n width: 80%;\n max-width: 36rem;\n\n >a {\n cursor: pointer;\n align-self: center;\n margin-top: 1rem;\n }\n\n >h1 {\n align-self: center;\n font-weight: 400;\n }\n\n @include for-desktop {\n box-shadow: 0px 0px 30px -2px rgba(150, 144, 150, 0.85);\n padding: 5rem 3rem;\n width: 50%;\n\n }\n\n &Wrapper {\n display: flex;\n flex-direction: column;\n height: 100%;\n justify-content: center;\n }\n\n .loginForm {\n display: flex;\n flex-direction: column;\n margin: 2rem 0 0 0;\n\n >button {\n width: 100%;\n margin: 2rem 0 0 0;\n }\n }\n}\n","@import '../mixins';\n\n.AppLayout {\n .navbar {\n padding: 1rem;\n box-shadow: 0px 2px 5px rgba(68, 68, 68, 0.6);\n }\n\n display: flex;\n flex-direction: column;\n\n .childContent {\n position: relative;\n flex: 1;\n padding: 0 1rem;\n margin-bottom: 2rem;\n\n @include for-desktop {\n padding: 0 1.625rem;\n }\n\n\n &Wrapper {\n display: flex;\n flex-flow: column;\n min-height: 90vh;\n\n @include for-desktop {\n flex-flow: row;\n }\n }\n\n }\n}\n","@import './mixins';\n\n.signUpDiv {\n display: flex;\n justify-content: center;\n align-content: center;\n flex-direction: column;\n align-self: center;\n flex-shrink: 1;\n padding: 5rem 0rem;\n width: 80%;\n max-width: 36rem;\n\n >h1 {\n align-self: center;\n font-weight: 400;\n }\n\n @include for-desktop {\n box-shadow: 0px 0px 30px -2px rgba(150, 144, 150, 0.85);\n padding: 5rem 3rem;\n width: 50%;\n\n }\n\n &Wrapper {\n display: flex;\n flex-direction: column;\n height: 100%;\n justify-content: center;\n }\n\n .signUpForm {\n display: flex;\n flex-direction: column;\n margin: 2rem 0 0 0;\n\n >button {\n width: 100%;\n margin: 2rem 0 0 0;\n }\n }\n}\n"]} \ No newline at end of file +{"version":3,"sources":["assets/styles/_variables.scss","assets/styles/components/LandingView.module.scss","assets/styles/_mixins.scss","assets/styles/components/Navbar.module.scss","assets/styles/LoginView.module.scss","assets/styles/components/AppLayout.module.scss","assets/styles/login-signup-styles.module.scss","assets/styles/Transition.module.scss","assets/styles/SignUpView.module.scss"],"names":[],"mappings":"AAGA;EACI,wBAAQ;EACR,wBAAQ;EACR,uBAAO;EACP,gBAAQ;EACR,eAAO;EACP,cAAM;EACN,iBAAS;EACT,uBAAe;EACf,gBAAQ;EACR,oBAAY;EACZ,qBAAa;EACb,sBAAc;EACd,qBAAa;EACb,2BAAmB;EACnB,4BAAO;EACP,kBAAY;EACZ,oBAAgB;EAChB;yCAAc;EAEd,+bAAa;EACb,2hBAAiB;EACjB,6RAAkB,EAAA;;ACrBtB;EACI,wEAAwE;EACxE,aAAa;EACb,aAAa;EACb,sBAAsB;EACtB,8BAA8B,EAAA;EALlC;IASQ,aAAa,EAAA;EATrB;IAaQ,aAAa;IACb,6BAA6B;IAC7B,uBAAuB,EAAA;EAf/B;IAuBQ,aAAa;IACb,sBAAsB;IACtB,uBAAuB;IACvB,iBAAiB;IACjB,iBAAiB,EAAA;IA3BzB;MAoBY,eAAe,EAAA;IApB3B;MA8BY,gBAAgB,EAAA;IA9B5B;MAkCY,WAAW,EAAA;EAlCvB;IAuCQ,aAAa,EAAA;IC1CjB;MDGJ;QA0CY,eAAe,EAAA,EAEtB;;AEhDL;EACE,aAAa,EAAA;EADf;IAII,gBAAgB;IAChB,aAAa;IACb,YAAY;IACZ,yBAAyB;IACzB,kBAAkB,EAAA;;ACNtB;EACI,aAAa;EACb,uBAAuB;EACvB,qBAAqB;EACrB,sBAAsB;EACtB,kBAAkB;EAClB,cAAc;EACd,kBAAkB;EAClB,UAAU;EACV,gBAAgB,EAAA;EATpB;IAYQ,eAAe;IACf,kBAAkB;IAClB,gBAAgB,EAAA;EAdxB;IAkBQ,kBAAkB;IAClB,gBAAgB,EAAA;EFpBpB;IECJ;MAuBQ,uDAAuD;MACvD,kBAAkB;MAClB,UAAU,EAAA,EAqBjB;EAjBG;IACI,aAAa;IACb,sBAAsB;IACtB,YAAY;IACZ,uBAAuB,EAAA;EAjC/B;IAqCQ,aAAa;IACb,sBAAsB;IACtB,kBAAkB,EAAA;IAvC1B;MA0CY,WAAW;MACX,kBAAkB,EAAA;;AC3C9B;EAME,aAAa;EACb,sBAAsB,EAAA;EAPxB;IAEI,aAAa;IACb,6CAA6C,EAAA;EAHjD;IAUI,kBAAkB;IAClB,OAAO;IACP,eAAe;IACf,mBAAmB,EAAA;IHdnB;MGCJ;QAgBM,mBAAmB,EAAA,EActB;IA9BH;MAqBM,aAAa;MACb,iBAAiB;MACjB,gBAAgB,EAAA;MHxBlB;QGCJ;UA0BQ,cAAc,EAAA,EAEjB;;AL3BL;EACI,wBAAQ;EACR,wBAAQ;EACR,uBAAO;EACP,gBAAQ;EACR,eAAO;EACP,cAAM;EACN,iBAAS;EACT,uBAAe;EACf,gBAAQ;EACR,oBAAY;EACZ,qBAAa;EACb,sBAAc;EACd,qBAAa;EACb,2BAAmB;EACnB,4BAAO;EACP,kBAAY;EACZ,oBAAgB;EAChB;yCAAc;EAEd,+bAAa;EACb,2hBAAiB;EACjB,6RAAkB,EAAA;;AMtBtB;EACI,WAAW;EACX,aAAa;EACb,sBAAsB;EACtB,mBAAmB,EAAA;EAJvB;IAMM,eAAe;IACf,oCAAoC,EAAA;EAP1C;IAWM,aAAa;IACb,sBAAsB,EAAA;IAZ5B;MAeQ,WAAW,EAAA;MAfnB;QAiBU,WAAW;QACX,YAAY,EAAA;IAlBtB;MAuBQ,eAAe;MACf,aAAa;MACb,sBAAsB;MACtB,mBAAmB,EAAA;MA1B3B;QA6BU,aAAa;QACb,sBAAsB;QACtB,uBAAuB;QACvB,kBAAkB,EAAA;QAhC5B;UAkCY,eAAe,EAAA;QAlC3B;UAqCY,eAAe;UACf,eAAe;UACf,YAAY;UACZ,iBAAiB;UACjB,eAAe;UACf,oCAAoC;UACpC,yBAAyB;UACzB,SAAS;UACT,kBAAkB;UAClB,mBAAmB;UACnB,iCAAiC,EAAA;UA/C7C;YAiDc,yBAAyB;YACzB,wCAAwC,EAAA;UAlDtD;YAsDc,aAAa;YACb,wCAAwC,EAAA;EAvDtD;IA+DM,eAAe,EAAA;EA/DrB;IAkEM,mCAAmC;IACnC,gEAA+D;IAC/D,yBAAwB;IACxB,kBAAiB;IACjB,yBAAwB;IACxB,qBAAoB;IACpB,eAAc;IACd,cAAa;IACb,kBAAiB;IACjB,eAAc;IACd,iBAAgB;IAChB,kBAAiB;IACjB,qBAAoB;IACpB,gCAA+B,EAAA;EA/ErC;IAkFM,gEAA+D;IAC/D,yBAAwB,EAAA;EAnF9B;IAsFM,kBAAiB;IACjB,QAAO,EAAA;;AChEX,6EAAY;APvBd;EACI,wBAAQ;EACR,wBAAQ;EACR,uBAAO;EACP,gBAAQ;EACR,eAAO;EACP,cAAM;EACN,iBAAS;EACT,uBAAe;EACf,gBAAQ;EACR,oBAAY;EACZ,qBAAa;EACb,sBAAc;EACd,qBAAa;EACb,2BAAmB;EACnB,4BAAO;EACP,kBAAY;EACZ,oBAAgB;EAChB;yCAAc;EAEd,+bAAa;EACb,2hBAAiB;EACjB,6RAAkB,EAAA;;AOtBtB;EAEI,qCAAqC;EAGrC,wEAAwE,EAAA;;AAI1E;EACE,kBAAkB;EAClB,cAAc,EAAA;;AAGhB;EACE,UAAU,EAAA;;AAGZ;EACE,eAAe,EAAA;;AAMjB;EACE,kBAAkB;EAClB,aAAa;EACb,uBAAuB;EACvB,mBAAmB;EACnB,oCAAoC,EAAA;;AAGtC;EACE,mDAA4C;EAC5C,cAAc;EACd,oBAAoB,EAAA;;AAGtB;EACE,yBAAyB;EACzB,iBAAiB;EACjB,aAAa;EACb,sBAAsB;EACtB,mBAAmB;EACnB,uBAAuB;EACvB,6BAA6B;EAC7B,YAAY,EAAA;;AAGd;EACE,cAAc,EAAA;;AAGhB;EACE;IACE,uBAAuB,EAAA;EAEzB;IACE,yBAAyB,EAAA,EAAA;;AAK7B;EACE,qBAAoB;EACpB,WAAW;EACX,YAAY;EAEZ,aAAa;EACb,uBAAuB;EACvB,mBAAmB;EACnB,iBAAiB;EACjB,kBAAkB;EAClB,WAAW,EAAA;EAVb;IAYI,aAAa;IACb,uBAAuB;IACvB,mBAAmB;IACnB,sBAAsB;IACtB,kDAAkD;IAClD,kBAAkB;IAClB,kBAAkB;IAClB,WAAW;IACX,WAAW;IACX,YAAY;IACZ,WAAW;IACX,kBAAkB,EAAA;EAvBtB;IA2BI,aAAa;IACb,sBAAsB;IACtB,uBAAuB;IACvB,WAAW;IACX,yBAAwB;IACxB,WAAW;IACX,kBAAkB;IAClB,WAAW;IACX,kBAAkB;IAClB,UAAU;IACV,iCAAiC;IACjC,eAAe;IACf,oDAAoD,EAAA;IAvCxD;MA0CM,WAAW;MACX,qBAAqB;MACrB,yBAAwB,EAAA;MA5C9B;QA8CQ,WAAW,EAAA;IA9CnB;MAkDM,UAAU;MACV,uBAAuB;MACvB,yBAAwB,EAAA;MApD9B;QAsDQ,UAAU,EAAA;IAtDlB;MA2DM,eAAe;MACf,gBAAgB;MAChB,WAAW;MACX,iBAAiB;MACjB,gBAAgB,EAAA;;AAMtB;EACE,eAAe;EACf,iBAAiB;EACjB,SAAS;EACT,yBAAyB;EACzB,WAAW;EACX,kBAAkB;EAClB,iCAAiC;EACjC,eAAe,EAAA;EARjB;IAUI,yBAAyB,EAAA;EAV7B;IAaI,aAAa,EAAA;;ACnJnB;EACI,aAAa;EACb,uBAAuB;EACvB,qBAAqB;EACrB,sBAAsB;EACtB,kBAAkB;EAClB,cAAc;EACd,kBAAkB;EAClB,UAAU;EACV,gBAAgB,EAAA;EATpB;IAYQ,kBAAkB;IAClB,gBAAgB,EAAA;ENdpB;IMCJ;MAiBQ,uDAAuD;MACvD,kBAAkB;MAClB,UAAU,EAAA,EAqBjB;EAjBG;IACI,aAAa;IACb,sBAAsB;IACtB,YAAY;IACZ,uBAAuB,EAAA;EA3B/B;IA+BQ,aAAa;IACb,sBAAsB;IACtB,kBAAkB,EAAA;IAjC1B;MAoCY,WAAW;MACX,kBAAkB,EAAA","file":"src-view.e31bb0bc.css","sourceRoot":"..","sourcesContent":["$primary-violet: hsl(277, 49%, 52%);\n$primary-green: #28E2BC;\n\n:root {\n --white: hsl(0, 0%, 98%);\n --black: hsl(0, 0%, 12%);\n --gray: hsl(0, 0%, 65%);\n --space: 1.25rem;\n --ruby: #ff9494;\n --red: #ee534c;\n --violet: #{$primary-violet};\n --light-violet: #ECCCFF;\n --green: #{$primary-green};\n --dark-blue: #186c8a;\n --light-blue: #e6f4fa;\n --apple-green: #48b049;\n --moss-green: #a4d6a5;\n --light-lime-green: #f1faf1;\n --font: 'Rubik', \"Open Sans\";\n --max-width: 65rem;\n --border-radius: 5px;\n --card-shadow: 0 4px 8px 0 hsla(0, 0%, 0%, 0.08),\n 0 1px 2px 0 hsla(0, 0%, 0%, 0.04);\n --icon-close: url('data:image/svg+xml,');\n --icon-hamburger: url('data:image/svg+xml,');\n --icon-deals-info: url('data:image/svg+xml,');\n}\n","@import '../variables';\n@import '../mixins';\n\n\n.landingContainer {\n background-image: linear-gradient(to right, var(--violet), var(--green));\n height: 100vh;\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n\n .landingNavbar {\n // justify-self: flex-start;\n padding: 1rem;\n }\n\n .heroDiv {\n display: flex;\n justify-content: space-evenly;\n flex-wrap: wrap-reverse;\n }\n\n .heroText {\n >h3 {\n font-size: 2rem;\n }\n\n display: flex;\n flex-direction: column;\n justify-content: center;\n font-size: 1.5rem;\n line-height: 2rem;\n\n .landingButton {\n margin-top: 1rem;\n }\n\n .greenButton {\n width: 100%;\n }\n }\n\n .heroImage {\n display: none;\n\n @include for-desktop {\n display: inline;\n }\n }\n}\n","@mixin for-desktop {\n @media (orientation: landscape) and (min-device-aspect-ratio: 1/1) {\n @content;\n }\n}\n",".navbar {\n display: flex;\n\n .navRight {\n font-weight: 600;\n display: flex;\n flex-grow: 1;\n justify-content: flex-end;\n margin-top: 0.5rem;\n }\n}\n","@import './mixins';\n\n.loginDiv {\n display: flex;\n justify-content: center;\n align-content: center;\n flex-direction: column;\n align-self: center;\n flex-shrink: 1;\n padding: 5rem 0rem;\n width: 80%;\n max-width: 36rem;\n\n >a {\n cursor: pointer;\n align-self: center;\n margin-top: 1rem;\n }\n\n >h1 {\n align-self: center;\n font-weight: 400;\n }\n\n @include for-desktop {\n box-shadow: 0px 0px 30px -2px rgba(150, 144, 150, 0.85);\n padding: 5rem 3rem;\n width: 50%;\n\n }\n\n &Wrapper {\n display: flex;\n flex-direction: column;\n height: 100%;\n justify-content: center;\n }\n\n .loginForm {\n display: flex;\n flex-direction: column;\n margin: 2rem 0 0 0;\n\n >button {\n width: 100%;\n margin: 2rem 0 0 0;\n }\n }\n}\n","@import '../mixins';\n\n.AppLayout {\n .navbar {\n padding: 1rem;\n box-shadow: 0px 2px 5px rgba(68, 68, 68, 0.6);\n }\n\n display: flex;\n flex-direction: column;\n\n .childContent {\n position: relative;\n flex: 1;\n padding: 0 1rem;\n margin-bottom: 2rem;\n\n @include for-desktop {\n padding: 0 1.625rem;\n }\n\n\n &Wrapper {\n display: flex;\n flex-flow: column;\n min-height: 90vh;\n\n @include for-desktop {\n flex-flow: row;\n }\n }\n\n }\n}\n","@import './variables';\n@import './mixins';\n\n.baseContainer {\n width: 100%;\n display: flex;\n flex-direction: column;\n align-items: center;\n .header {\n font-size: 24px;\n font-family: \"Open Sans\", sans-serif;\n }\n \n .content {\n display: flex;\n flex-direction: column;\n \n .image {\n width: 21em;\n img {\n width: 100%;\n height: 100%;\n }\n }\n \n .form {\n margin-top: 2em;\n display: flex;\n flex-direction: column;\n align-items: center;\n \n .formGroup {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n width: fit-content;\n label {\n font-size: 20px;\n }\n input {\n margin-top: 6px;\n min-width: 18em;\n height: 37px;\n padding: 0px 10px;\n font-size: 16px;\n font-family: \"Open Sans\", sans-serif;\n background-color: #f3f3f3;\n border: 0;\n border-radius: 4px;\n margin-bottom: 31px;\n transition: all 250ms ease-in-out;\n &:hover {\n background-color: #ffffff;\n box-shadow: 0px 0px 14px 0.3px #0e81ce96;\n }\n \n &:focus {\n outline: none;\n box-shadow: 0px 0px 12px 0.8px #3474dbb2;\n }\n }\n }\n }\n }\n \n .footer {\n margin-top: 3em;\n }\n .btn {\n box-shadow: 3px 4px 0px 0px #1564ad;\n background:linear-gradient(to bottom, #79bbff 5%, #378de5 100%);\n background-color:#79bbff;\n border-radius:5px;\n border:1px solid #337bc4;\n display:inline-block;\n cursor:pointer;\n color:#ffffff;\n font-family:Arial;\n font-size:17px;\n font-weight:bold;\n padding:12px 44px;\n text-decoration:none;\n text-shadow:0px 1px 0px #528ecc;\n }\n .btn:hover {\n background:linear-gradient(to bottom, #378de5 5%, #79bbff 100%);\n background-color:#378de5;\n }\n .btn:active {\n position:relative;\n top:1px;\n }\n \n }","@import './variables';\n@import './mixins';\n\nbody {\n\n font-family: \"Montserrat\", sans-serif;\n // background: rgb(15,11,84);\n // background: radial-gradient(circle, rgba(15,11,84,1) 0%, rgba(29,29,173,1) 45%, rgba(0,212,255,1) 96%); \n background-image: linear-gradient(to right, var(--violet), var(--green));\n\n }\n \n h1 {\n text-align: center;\n color: #ffffff;\n }\n \n .title{\n color: red;\n }\n \n .tank-title {\n font-size: 30px;\n }\n \n //Custom Fonts\n @import url(\"https://fonts.googleapis.com/css?family=Open+Sans&display=swap\");\n \n .App {\n text-align: center;\n display: flex;\n justify-content: center;\n align-items: center;\n font-family: \"Open Sans\", sans-serif;\n }\n \n .App-logo {\n animation: App-logo-spin infinite 20s linear;\n height: 40vmin;\n pointer-events: none;\n }\n \n .App-header {\n background-color: #282c34;\n min-height: 100vh;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n font-size: calc(10px + 2vmin);\n color: white;\n }\n \n .App-link {\n color: #61dafb;\n }\n \n @keyframes App-logo-spin {\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n }\n \n //Login Main Container\n .login {\n background-color:red;\n width: 27em;\n height: 40em;\n //min-height: 44em;\n display: flex;\n justify-content: center;\n align-items: center;\n margin-top: 150px;\n position: relative;\n z-index: 99;\n .container {\n display: flex;\n justify-content: center;\n align-items: center;\n background-color: #fff;\n box-shadow: 0px 0px 12px 2px rgba(15, 15, 15, 0.2);\n border-radius: 4px;\n position: relative;\n z-index: 99;\n width: 100%;\n height: 100%;\n z-index: 99;\n padding: 17px 10px;\n //transition: transform 200ms ease-in-out;\n }\n .rightSide {\n display: flex;\n flex-direction: column;\n justify-content: center;\n height: 90%;\n background-color:#4830C2;\n width: 100%;\n position: absolute;\n right: -34%;\n border-radius: 6px;\n z-index: 1;\n transition: all 400ms ease-in-out;\n cursor: pointer;\n box-shadow: 0px 0px 12px 2px rgba(15, 15, 15, 0.281);\n \n &.right {\n right: -40%;\n align-items: flex-end;\n background-color:#4830C2;\n &:hover {\n right: -45%;\n }\n }\n &.left {\n right: 40%;\n align-items: flex-start;\n background-color:#00E4BF;\n &:hover {\n right: 45%;\n }\n }\n \n .text {\n font-size: 21px;\n font-weight: 500;\n color: #fff;\n margin-right: 3em;\n margin-left: 3em;\n }\n }\n }\n \n //Button\n .btn {\n font-size: 21px;\n padding: 5px 20px;\n border: 0;\n background-color: #3498db;\n color: #fff;\n border-radius: 3px;\n transition: all 250ms ease-in-out;\n cursor: pointer;\n &:hover {\n background-color: #2386c8;\n }\n &:focus {\n outline: none;\n }\n }","@import './mixins';\n\n.signUpDiv {\n display: flex;\n justify-content: center;\n align-content: center;\n flex-direction: column;\n align-self: center;\n flex-shrink: 1;\n padding: 5rem 0rem;\n width: 80%;\n max-width: 36rem;\n\n >h1 {\n align-self: center;\n font-weight: 400;\n }\n\n @include for-desktop {\n box-shadow: 0px 0px 30px -2px rgba(150, 144, 150, 0.85);\n padding: 5rem 3rem;\n width: 50%;\n\n }\n\n &Wrapper {\n display: flex;\n flex-direction: column;\n height: 100%;\n justify-content: center;\n }\n\n .signUpForm {\n display: flex;\n flex-direction: column;\n margin: 2rem 0 0 0;\n\n >button {\n width: 100%;\n margin: 2rem 0 0 0;\n }\n }\n}\n"]} \ No newline at end of file diff --git a/src-view/dist/src-view.e31bb0bc.js b/src-view/dist/src-view.e31bb0bc.js index 7164339..465b872 100644 --- a/src-view/dist/src-view.e31bb0bc.js +++ b/src-view/dist/src-view.e31bb0bc.js @@ -324,7 +324,7 @@ checkPropTypes.resetWarningCache = function () { module.exports = checkPropTypes; },{"./lib/ReactPropTypesSecret":"node_modules/prop-types/lib/ReactPropTypesSecret.js"}],"node_modules/react/cjs/react.development.js":[function(require,module,exports) { -/** @license React v16.11.0 +/** @license React v16.13.1 * react.development.js * * Copyright (c) Facebook, Inc. and its affiliates. @@ -340,10 +340,9 @@ if ("development" !== "production") { var _assign = require('object-assign'); - var checkPropTypes = require('prop-types/checkPropTypes'); // TODO: this is special because it gets imported during build. - + var checkPropTypes = require('prop-types/checkPropTypes'); - var ReactVersion = '16.11.0'; // The Symbol used to tag the ReactElement-like types. If there is no native Symbol + var ReactVersion = '16.13.1'; // The Symbol used to tag the ReactElement-like types. If there is no native Symbol // nor polyfill, then a plain number is used for performance. var hasSymbol = typeof Symbol === 'function' && Symbol.for; @@ -354,7 +353,6 @@ if ("development" !== "production") { var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2; var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd; var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary - // (unstable) APIs that have been removed. Can we remove the symbols? var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf; var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0; @@ -362,6 +360,7 @@ if ("development" !== "production") { var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8; var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3; var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4; + var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9; var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5; var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6; var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7; @@ -380,114 +379,264 @@ if ("development" !== "production") { } return null; - } // Do not require this module directly! Use normal `invariant` calls with - // template literal strings. The messages will be replaced with error codes - // during build. + } + /** + * Keeps track of the current dispatcher. + */ + + var ReactCurrentDispatcher = { + /** + * @internal + * @type {ReactComponent} + */ + current: null + }; /** - * 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. + * Keeps track of the current batch's configuration such as how long an update + * should suspend for if it needs to. */ + var ReactCurrentBatchConfig = { + suspense: null + }; /** - * Forked from fbjs/warning: - * https://github.com/facebook/fbjs/blob/e66ba20ad5be433eb54423f2b097d829324d9de6/packages/fbjs/src/__forks__/warning.js + * Keeps track of the current owner. * - * Only change is we use console.warn instead of console.error, - * and do nothing when 'console' is not supported. - * This really simplifies the code. - * --- - * 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. + * The current owner is the component who should own any components that are + * currently being constructed. */ + var ReactCurrentOwner = { + /** + * @internal + * @type {ReactComponent} + */ + current: null + }; + var BEFORE_SLASH_RE = /^(.*)[\\\/]/; - var lowPriorityWarningWithoutStack = function () {}; + function describeComponentFrame(name, source, ownerName) { + var sourceInfo = ''; - { - var printWarning = function (format) { - for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - args[_key - 1] = arguments[_key]; + if (source) { + var path = source.fileName; + var fileName = path.replace(BEFORE_SLASH_RE, ''); + { + // In DEV, include code for a common special case: + // prefer "folder/index.js" instead of just "index.js". + if (/^index\./.test(fileName)) { + var match = path.match(BEFORE_SLASH_RE); + + if (match) { + var pathBeforeSlash = match[1]; + + if (pathBeforeSlash) { + var folderName = pathBeforeSlash.replace(BEFORE_SLASH_RE, ''); + fileName = folderName + '/' + fileName; + } + } + } } + sourceInfo = ' (at ' + fileName + ':' + source.lineNumber + ')'; + } else if (ownerName) { + sourceInfo = ' (created by ' + ownerName + ')'; + } - var argIndex = 0; - var message = 'Warning: ' + format.replace(/%s/g, function () { - return args[argIndex++]; - }); + return '\n in ' + (name || 'Unknown') + sourceInfo; + } - if (typeof console !== 'undefined') { - console.warn(message); + var Resolved = 1; + + function refineResolvedLazyComponent(lazyComponent) { + return lazyComponent._status === Resolved ? lazyComponent._result : null; + } + + function getWrappedName(outerType, innerType, wrapperName) { + var functionName = innerType.displayName || innerType.name || ''; + return outerType.displayName || (functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName); + } + + function getComponentName(type) { + if (type == null) { + // Host root, text node or just invalid type. + return null; + } + + { + if (typeof type.tag === 'number') { + error('Received an unexpected object in getComponentName(). ' + 'This is likely a bug in React. Please file an issue.'); } + } - 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) {} - }; + if (typeof type === 'function') { + return type.displayName || type.name || null; + } - lowPriorityWarningWithoutStack = function (condition, format) { - if (format === undefined) { - throw new Error('`lowPriorityWarningWithoutStack(condition, format, ...args)` requires a warning ' + 'message argument'); + if (typeof type === 'string') { + return type; + } + + switch (type) { + case REACT_FRAGMENT_TYPE: + return 'Fragment'; + + case REACT_PORTAL_TYPE: + return 'Portal'; + + case REACT_PROFILER_TYPE: + return "Profiler"; + + case REACT_STRICT_MODE_TYPE: + return 'StrictMode'; + + case REACT_SUSPENSE_TYPE: + return 'Suspense'; + + case REACT_SUSPENSE_LIST_TYPE: + return 'SuspenseList'; + } + + if (typeof type === 'object') { + switch (type.$$typeof) { + case REACT_CONTEXT_TYPE: + return 'Context.Consumer'; + + case REACT_PROVIDER_TYPE: + return 'Context.Provider'; + + case REACT_FORWARD_REF_TYPE: + return getWrappedName(type, type.render, 'ForwardRef'); + + case REACT_MEMO_TYPE: + return getComponentName(type.type); + + case REACT_BLOCK_TYPE: + return getComponentName(type.render); + + case REACT_LAZY_TYPE: + { + var thenable = type; + var resolvedThenable = refineResolvedLazyComponent(thenable); + + if (resolvedThenable) { + return getComponentName(resolvedThenable); + } + + break; + } } + } - if (!condition) { - for (var _len2 = arguments.length, args = new Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) { - args[_key2 - 2] = arguments[_key2]; - } + return null; + } + + var ReactDebugCurrentFrame = {}; + var currentlyValidatingElement = null; + + function setCurrentlyValidatingElement(element) { + { + currentlyValidatingElement = element; + } + } + + { + // Stack implementation injected by the current renderer. + ReactDebugCurrentFrame.getCurrentStack = null; + + ReactDebugCurrentFrame.getStackAddendum = function () { + var stack = ''; // Add an extra top frame while an element is being validated + + if (currentlyValidatingElement) { + var name = getComponentName(currentlyValidatingElement.type); + var owner = currentlyValidatingElement._owner; + stack += describeComponentFrame(name, currentlyValidatingElement._source, owner && getComponentName(owner.type)); + } // Delegate to the injected renderer-specific implementation + + + var impl = ReactDebugCurrentFrame.getCurrentStack; - printWarning.apply(void 0, [format].concat(args)); + if (impl) { + stack += impl() || ''; } + + return stack; }; } - var lowPriorityWarningWithoutStack$1 = lowPriorityWarningWithoutStack; /** - * 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. + * Used by act() to track whether you're inside an act() scope. */ - var warningWithoutStack = function () {}; - + var IsSomeRendererActing = { + current: false + }; + var ReactSharedInternals = { + ReactCurrentDispatcher: ReactCurrentDispatcher, + ReactCurrentBatchConfig: ReactCurrentBatchConfig, + ReactCurrentOwner: ReactCurrentOwner, + IsSomeRendererActing: IsSomeRendererActing, + // Used by renderers to avoid bundling object-assign twice in UMD bundles: + assign: _assign + }; { - warningWithoutStack = function (condition, format) { - for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { - args[_key - 2] = arguments[_key]; - } + _assign(ReactSharedInternals, { + // These should not be included in production. + ReactDebugCurrentFrame: ReactDebugCurrentFrame, + // Shim for React DOM 16.0.0 which still destructured (but not used) this. + // TODO: remove in React 17.0. + ReactComponentTreeHook: {} + }); + } // by calls to these methods by a Babel plugin. + // + // In PROD (or in packages without access to React internals), + // they are left as they are instead. - if (format === undefined) { - throw new Error('`warningWithoutStack(condition, format, ...args)` requires a warning ' + 'message argument'); + function warn(format) { + { + for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; } - if (args.length > 8) { - // Check before the condition to catch violations early. - throw new Error('warningWithoutStack() currently supports at most 8 arguments.'); - } + printWarning('warn', format, args); + } + } - if (condition) { - return; + function error(format) { + { + for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { + args[_key2 - 1] = arguments[_key2]; } - if (typeof console !== 'undefined') { - var argsWithFormat = args.map(function (item) { - return '' + item; - }); - argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it - // breaks IE9: https://github.com/facebook/react/issues/13610 + printWarning('error', format, args); + } + } - Function.prototype.apply.call(console.error, console, argsWithFormat); + function printWarning(level, format, args) { + // When changing this logic, you might want to also + // update consoleWithStackDev.www.js as well. + { + var hasExistingStack = args.length > 0 && typeof args[args.length - 1] === 'string' && args[args.length - 1].indexOf('\n in') === 0; + + if (!hasExistingStack) { + var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame; + var stack = ReactDebugCurrentFrame.getStackAddendum(); + + if (stack !== '') { + format += '%s'; + args = args.concat([stack]); + } } + var argsWithFormat = args.map(function (item) { + return '' + item; + }); // Careful: RN currently depends on this prefix + + argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it + // breaks IE9: https://github.com/facebook/react/issues/13610 + // eslint-disable-next-line react-internal/no-production-logging + + Function.prototype.apply.call(console[level], console, argsWithFormat); + try { // --- Welcome to debugging React --- // This error was thrown as a convenience so that you can use this stack @@ -498,9 +647,9 @@ if ("development" !== "production") { }); throw new Error(message); } catch (x) {} - }; + } } - var warningWithoutStack$1 = warningWithoutStack; + var didWarnStateUpdateForUnmountedComponent = {}; function warnNoop(publicInstance, callerName) { @@ -513,7 +662,7 @@ if ("development" !== "production") { return; } - warningWithoutStack$1(false, "Can't call %s on a component that is not yet mounted. " + 'This is a no-op, but it might indicate a bug in your application. ' + 'Instead, assign to `this.state` directly or define a `state = {};` ' + 'class property with the desired state in the %s component.', callerName, componentName); + error("Can't call %s on a component that is not yet mounted. " + 'This is a no-op, but it might indicate a bug in your application. ' + 'Instead, assign to `this.state` directly or define a `state = {};` ' + 'class property with the desired state in the %s component.', callerName, componentName); didWarnStateUpdateForUnmountedComponent[warningKey] = true; } } @@ -675,7 +824,7 @@ if ("development" !== "production") { var defineDeprecationWarning = function (methodName, info) { Object.defineProperty(Component.prototype, methodName, { get: function () { - lowPriorityWarningWithoutStack$1(false, '%s(...) is deprecated in plain JavaScript React classes. %s', info[0], info[1]); + warn('%s(...) is deprecated in plain JavaScript React classes. %s', info[0], info[1]); return undefined; } }); @@ -719,235 +868,7 @@ if ("development" !== "production") { } return refObject; } - /** - * Keeps track of the current dispatcher. - */ - - - var ReactCurrentDispatcher = { - /** - * @internal - * @type {ReactComponent} - */ - current: null - }; - /** - * Keeps track of the current batch's configuration such as how long an update - * should suspend for if it needs to. - */ - - var ReactCurrentBatchConfig = { - suspense: null - }; - /** - * 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 - }; - var BEFORE_SLASH_RE = /^(.*)[\\\/]/; - - var describeComponentFrame = function (name, source, ownerName) { - var sourceInfo = ''; - - if (source) { - var path = source.fileName; - var fileName = path.replace(BEFORE_SLASH_RE, ''); - { - // In DEV, include code for a common special case: - // prefer "folder/index.js" instead of just "index.js". - if (/^index\./.test(fileName)) { - var match = path.match(BEFORE_SLASH_RE); - - if (match) { - var pathBeforeSlash = match[1]; - - if (pathBeforeSlash) { - var folderName = pathBeforeSlash.replace(BEFORE_SLASH_RE, ''); - fileName = folderName + '/' + fileName; - } - } - } - } - sourceInfo = ' (at ' + fileName + ':' + source.lineNumber + ')'; - } else if (ownerName) { - sourceInfo = ' (created by ' + ownerName + ')'; - } - - return '\n in ' + (name || 'Unknown') + sourceInfo; - }; - - var Resolved = 1; - - function refineResolvedLazyComponent(lazyComponent) { - return lazyComponent._status === Resolved ? lazyComponent._result : null; - } - - function getWrappedName(outerType, innerType, wrapperName) { - var functionName = innerType.displayName || innerType.name || ''; - return outerType.displayName || (functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName); - } - - function getComponentName(type) { - if (type == null) { - // Host root, text node or just invalid type. - return null; - } - - { - if (typeof type.tag === 'number') { - warningWithoutStack$1(false, 'Received an unexpected object in getComponentName(). ' + 'This is likely a bug in React. Please file an issue.'); - } - } - - if (typeof type === 'function') { - return type.displayName || type.name || null; - } - - if (typeof type === 'string') { - return type; - } - - switch (type) { - case REACT_FRAGMENT_TYPE: - return 'Fragment'; - - case REACT_PORTAL_TYPE: - return 'Portal'; - - case REACT_PROFILER_TYPE: - return "Profiler"; - - case REACT_STRICT_MODE_TYPE: - return 'StrictMode'; - - case REACT_SUSPENSE_TYPE: - return 'Suspense'; - - case REACT_SUSPENSE_LIST_TYPE: - return 'SuspenseList'; - } - - if (typeof type === 'object') { - switch (type.$$typeof) { - case REACT_CONTEXT_TYPE: - return 'Context.Consumer'; - - case REACT_PROVIDER_TYPE: - return 'Context.Provider'; - - case REACT_FORWARD_REF_TYPE: - return getWrappedName(type, type.render, 'ForwardRef'); - - case REACT_MEMO_TYPE: - return getComponentName(type.type); - - case REACT_LAZY_TYPE: - { - var thenable = type; - var resolvedThenable = refineResolvedLazyComponent(thenable); - - if (resolvedThenable) { - return getComponentName(resolvedThenable); - } - - break; - } - } - } - - return null; - } - - var ReactDebugCurrentFrame = {}; - var currentlyValidatingElement = null; - - function setCurrentlyValidatingElement(element) { - { - currentlyValidatingElement = element; - } - } - - { - // Stack implementation injected by the current renderer. - ReactDebugCurrentFrame.getCurrentStack = null; - - ReactDebugCurrentFrame.getStackAddendum = function () { - var stack = ''; // Add an extra top frame while an element is being validated - - if (currentlyValidatingElement) { - var name = getComponentName(currentlyValidatingElement.type); - var owner = currentlyValidatingElement._owner; - stack += describeComponentFrame(name, currentlyValidatingElement._source, owner && getComponentName(owner.type)); - } // Delegate to the injected renderer-specific implementation - - - var impl = ReactDebugCurrentFrame.getCurrentStack; - - if (impl) { - stack += impl() || ''; - } - - return stack; - }; - } - /** - * Used by act() to track whether you're inside an act() scope. - */ - - var IsSomeRendererActing = { - current: false - }; - var ReactSharedInternals = { - ReactCurrentDispatcher: ReactCurrentDispatcher, - ReactCurrentBatchConfig: ReactCurrentBatchConfig, - ReactCurrentOwner: ReactCurrentOwner, - IsSomeRendererActing: IsSomeRendererActing, - // Used by renderers to avoid bundling object-assign twice in UMD bundles: - assign: _assign - }; - { - _assign(ReactSharedInternals, { - // These should not be included in production. - ReactDebugCurrentFrame: ReactDebugCurrentFrame, - // Shim for React DOM 16.0.0 which still destructured (but not used) this. - // TODO: remove in React 17.0. - ReactComponentTreeHook: {} - }); - } - /** - * 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 = warningWithoutStack$1; - { - warning = function (condition, format) { - if (condition) { - return; - } - - var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame; - var stack = ReactDebugCurrentFrame.getStackAddendum(); // eslint-disable-next-line react-internal/warning-and-invariant-args - - for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { - args[_key - 2] = arguments[_key]; - } - warningWithoutStack$1.apply(void 0, [false, format + '%s'].concat(args, [stack])); - }; - } - var warning$1 = warning; var hasOwnProperty = Object.prototype.hasOwnProperty; var RESERVED_PROPS = { key: true, @@ -955,8 +876,10 @@ if ("development" !== "production") { __self: true, __source: true }; - var specialPropKeyWarningShown; - var specialPropRefWarningShown; + var specialPropKeyWarningShown, specialPropRefWarningShown, didWarnAboutStringRefs; + { + didWarnAboutStringRefs = {}; + } function hasValidRef(config) { { @@ -986,9 +909,11 @@ if ("development" !== "production") { function defineKeyPropWarningGetter(props, displayName) { var warnAboutAccessingKey = function () { - if (!specialPropKeyWarningShown) { - specialPropKeyWarningShown = true; - warningWithoutStack$1(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); + { + if (!specialPropKeyWarningShown) { + specialPropKeyWarningShown = true; + error('%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); + } } }; @@ -1001,9 +926,11 @@ if ("development" !== "production") { function defineRefPropWarningGetter(props, displayName) { var warnAboutAccessingRef = function () { - if (!specialPropRefWarningShown) { - specialPropRefWarningShown = true; - warningWithoutStack$1(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); + { + if (!specialPropRefWarningShown) { + specialPropRefWarningShown = true; + error('%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); + } } }; @@ -1013,6 +940,19 @@ if ("development" !== "production") { configurable: true }); } + + function warnIfStringRefCannotBeAutoConverted(config) { + { + if (typeof config.ref === 'string' && ReactCurrentOwner.current && config.__self && ReactCurrentOwner.current.stateNode !== config.__self) { + var componentName = getComponentName(ReactCurrentOwner.current.type); + + if (!didWarnAboutStringRefs[componentName]) { + error('Component "%s" contains the string ref "%s". ' + 'Support for string refs will be removed in a future major release. ' + 'This case cannot be automatically converted to an arrow function. ' + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://fb.me/react-strict-mode-string-ref', getComponentName(ReactCurrentOwner.current.type), config.ref); + didWarnAboutStringRefs[componentName] = 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, instanceof check @@ -1087,110 +1027,42 @@ if ("development" !== "production") { return element; }; /** - * https://github.com/reactjs/rfcs/pull/107 - * @param {*} type - * @param {object} props - * @param {string} key - */ - - /** - * https://github.com/reactjs/rfcs/pull/107 - * @param {*} type - * @param {object} props - * @param {string} key + * Create and return a new ReactElement of the given type. + * See https://reactjs.org/docs/react-api.html#createelement */ - function jsxDEV(type, config, maybeKey, source, self) { + function createElement(type, config, children) { var propName; // Reserved names are extracted var props = {}; var key = null; - var ref = null; // Currently, key can be spread in as a prop. This causes a potential - // issue if key is also explicitly declared (ie.
- // or
). We want to deprecate key spread, - // but as an intermediary step, we will use jsxDEV for everything except - //
, because we aren't currently able to tell if - // key is explicitly declared to be undefined or not. - - if (maybeKey !== undefined) { - key = '' + maybeKey; - } - - if (hasValidKey(config)) { - key = '' + config.key; - } - - if (hasValidRef(config)) { - ref = config.ref; - } // Remaining properties are added to a new props object - + var ref = null; + var self = null; + var source = null; - for (propName in config) { - if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) { - props[propName] = config[propName]; + if (config != null) { + if (hasValidRef(config)) { + ref = config.ref; + { + warnIfStringRefCannotBeAutoConverted(config); + } } - } // Resolve default props + if (hasValidKey(config)) { + key = '' + config.key; + } - if (type && type.defaultProps) { - var defaultProps = type.defaultProps; + 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 defaultProps) { - if (props[propName] === undefined) { - props[propName] = defaultProps[propName]; + for (propName in config) { + if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) { + props[propName] = config[propName]; } } - } - - if (key || ref) { - 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); - } - /** - * Create and return a new ReactElement of the given type. - * See https://reactjs.org/docs/react-api.html#createelement - */ - - - function createElement(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. + } // Children can be more than one argument, and those are transferred onto + // the newly allocated props object. var childrenLength = arguments.length - 2; @@ -1238,11 +1110,6 @@ if ("development" !== "production") { } return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props); } - /** - * Return a function that produces ReactElements of a given type. - * See https://reactjs.org/docs/react-api.html#createfactory - */ - function cloneAndReplaceKey(oldElement, newKey) { var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props); @@ -1470,7 +1337,10 @@ if ("development" !== "production") { { // Warn about using Maps as children if (iteratorFn === children.entries) { - !didWarnAboutMaps ? warning$1(false, 'Using Maps as children is unsupported and will likely yield ' + 'unexpected results. Convert it to a sequence/iterable of keyed ' + 'ReactElements instead.') : void 0; + if (!didWarnAboutMaps) { + warn('Using Maps as children is deprecated and will be removed in ' + 'a future major release. Consider converting children to ' + 'an array of keyed ReactElements instead.'); + } + didWarnAboutMaps = true; } } @@ -1693,7 +1563,9 @@ if ("development" !== "production") { calculateChangedBits = null; } else { { - !(calculateChangedBits === null || typeof calculateChangedBits === 'function') ? warningWithoutStack$1(false, 'createContext: Expected the optional second argument to be a ' + 'function. Instead received: %s', calculateChangedBits) : void 0; + if (calculateChangedBits !== null && typeof calculateChangedBits !== 'function') { + error('createContext: Expected the optional second argument to be a ' + 'function. Instead received: %s', calculateChangedBits); + } } } @@ -1735,7 +1607,7 @@ if ("development" !== "production") { get: function () { if (!hasWarnedAboutUsingConsumerProvider) { hasWarnedAboutUsingConsumerProvider = true; - warning$1(false, 'Rendering is not supported and will be removed in ' + 'a future major release. Did you mean to render instead?'); + error('Rendering is not supported and will be removed in ' + 'a future major release. Did you mean to render instead?'); } return context.Provider; @@ -1772,7 +1644,7 @@ if ("development" !== "production") { get: function () { if (!hasWarnedAboutUsingNestedContextConsumers) { hasWarnedAboutUsingNestedContextConsumers = true; - warning$1(false, 'Rendering is not supported and will be removed in ' + 'a future major release. Did you mean to render instead?'); + error('Rendering is not supported and will be removed in ' + 'a future major release. Did you mean to render instead?'); } return context.Consumer; @@ -1808,7 +1680,7 @@ if ("development" !== "production") { return defaultProps; }, set: function (newDefaultProps) { - warning$1(false, 'React.lazy(...): It is not supported to assign `defaultProps` to ' + 'a lazy component import. Either specify them where the component ' + 'is defined, or create a wrapping component around it.'); + error('React.lazy(...): It is not supported to assign `defaultProps` to ' + 'a lazy component import. Either specify them where the component ' + 'is defined, or create a wrapping component around it.'); defaultProps = newDefaultProps; // Match production behavior more closely: Object.defineProperty(lazyType, 'defaultProps', { @@ -1822,7 +1694,7 @@ if ("development" !== "production") { return propTypes; }, set: function (newPropTypes) { - warning$1(false, 'React.lazy(...): It is not supported to assign `propTypes` to ' + 'a lazy component import. Either specify them where the component ' + 'is defined, or create a wrapping component around it.'); + error('React.lazy(...): It is not supported to assign `propTypes` to ' + 'a lazy component import. Either specify them where the component ' + 'is defined, or create a wrapping component around it.'); propTypes = newPropTypes; // Match production behavior more closely: Object.defineProperty(lazyType, 'propTypes', { @@ -1838,16 +1710,19 @@ if ("development" !== "production") { function forwardRef(render) { { if (render != null && render.$$typeof === REACT_MEMO_TYPE) { - warningWithoutStack$1(false, 'forwardRef requires a render function but received a `memo` ' + 'component. Instead of forwardRef(memo(...)), use ' + 'memo(forwardRef(...)).'); + error('forwardRef requires a render function but received a `memo` ' + 'component. Instead of forwardRef(memo(...)), use ' + 'memo(forwardRef(...)).'); } else if (typeof render !== 'function') { - warningWithoutStack$1(false, 'forwardRef requires a render function but was given %s.', render === null ? 'null' : typeof render); + error('forwardRef requires a render function but was given %s.', render === null ? 'null' : typeof render); } else { - !( // Do not warn for 0 arguments because it could be due to usage of the 'arguments' object - render.length === 0 || render.length === 2) ? warningWithoutStack$1(false, 'forwardRef render functions accept exactly two parameters: props and ref. %s', render.length === 1 ? 'Did you forget to use the ref parameter?' : 'Any additional parameter will be undefined.') : void 0; + if (render.length !== 0 && render.length !== 2) { + error('forwardRef render functions accept exactly two parameters: props and ref. %s', render.length === 1 ? 'Did you forget to use the ref parameter?' : 'Any additional parameter will be undefined.'); + } } if (render != null) { - !(render.defaultProps == null && render.propTypes == null) ? warningWithoutStack$1(false, 'forwardRef render functions do not support propTypes or defaultProps. ' + 'Did you accidentally pass a React component?') : void 0; + if (render.defaultProps != null || render.propTypes != null) { + error('forwardRef render functions do not support propTypes or defaultProps. ' + 'Did you accidentally pass a React component?'); + } } } return { @@ -1858,13 +1733,13 @@ if ("development" !== "production") { function isValidElementType(type) { return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill. - type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE); + type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE); } function memo(type, compare) { { if (!isValidElementType(type)) { - warningWithoutStack$1(false, 'memo: The first argument must be a component. Instead ' + 'received: %s', type === null ? 'null' : typeof type); + error('memo: The first argument must be a component. Instead ' + 'received: %s', type === null ? 'null' : typeof type); } } return { @@ -1889,16 +1764,19 @@ if ("development" !== "production") { function useContext(Context, unstable_observedBits) { var dispatcher = resolveDispatcher(); { - !(unstable_observedBits === undefined) ? warning$1(false, 'useContext() second argument is reserved for future ' + 'use in React. Passing it is not supported. ' + 'You passed: %s.%s', unstable_observedBits, typeof unstable_observedBits === 'number' && Array.isArray(arguments[2]) ? '\n\nDid you call array.map(useContext)? ' + 'Calling Hooks inside a loop is not supported. ' + 'Learn more at https://fb.me/rules-of-hooks' : '') : void 0; // TODO: add a more generic warning for invalid values. + if (unstable_observedBits !== undefined) { + error('useContext() second argument is reserved for future ' + 'use in React. Passing it is not supported. ' + 'You passed: %s.%s', unstable_observedBits, typeof unstable_observedBits === 'number' && Array.isArray(arguments[2]) ? '\n\nDid you call array.map(useContext)? ' + 'Calling Hooks inside a loop is not supported. ' + 'Learn more at https://fb.me/rules-of-hooks' : ''); + } // TODO: add a more generic warning for invalid values. + if (Context._context !== undefined) { var realContext = Context._context; // Don't deduplicate because this legitimately causes bugs // and nobody should be using this in existing code. if (realContext.Consumer === Context) { - warning$1(false, 'Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be ' + 'removed in a future major release. Did you mean to call useContext(Context) instead?'); + error('Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be ' + 'removed in a future major release. Did you mean to call useContext(Context) instead?'); } else if (realContext.Provider === Context) { - warning$1(false, 'Calling useContext(Context.Provider) is not supported. ' + 'Did you mean to call useContext(Context) instead?'); + error('Calling useContext(Context.Provider) is not supported. ' + 'Did you mean to call useContext(Context) instead?'); } } } @@ -1920,29 +1798,29 @@ if ("development" !== "production") { return dispatcher.useRef(initialValue); } - function useEffect(create, inputs) { + function useEffect(create, deps) { var dispatcher = resolveDispatcher(); - return dispatcher.useEffect(create, inputs); + return dispatcher.useEffect(create, deps); } - function useLayoutEffect(create, inputs) { + function useLayoutEffect(create, deps) { var dispatcher = resolveDispatcher(); - return dispatcher.useLayoutEffect(create, inputs); + return dispatcher.useLayoutEffect(create, deps); } - function useCallback(callback, inputs) { + function useCallback(callback, deps) { var dispatcher = resolveDispatcher(); - return dispatcher.useCallback(callback, inputs); + return dispatcher.useCallback(callback, deps); } - function useMemo(create, inputs) { + function useMemo(create, deps) { var dispatcher = resolveDispatcher(); - return dispatcher.useMemo(create, inputs); + return dispatcher.useMemo(create, deps); } - function useImperativeHandle(ref, create, inputs) { + function useImperativeHandle(ref, create, deps) { var dispatcher = resolveDispatcher(); - return dispatcher.useImperativeHandle(ref, create, inputs); + return dispatcher.useImperativeHandle(ref, create, deps); } function useDebugValue(value, formatterFn) { @@ -1952,52 +1830,10 @@ if ("development" !== "production") { } } - var emptyObject$1 = {}; - - function useResponder(responder, listenerProps) { - var dispatcher = resolveDispatcher(); - { - if (responder == null || responder.$$typeof !== REACT_RESPONDER_TYPE) { - warning$1(false, 'useResponder: invalid first argument. Expected an event responder, but instead got %s', responder); - return; - } - } - return dispatcher.useResponder(responder, listenerProps || emptyObject$1); - } - - function useTransition(config) { - var dispatcher = resolveDispatcher(); - return dispatcher.useTransition(config); - } - - function useDeferredValue(value, config) { - var dispatcher = resolveDispatcher(); - return dispatcher.useDeferredValue(value, config); - } - - function withSuspenseConfig(scope, config) { - var previousConfig = ReactCurrentBatchConfig.suspense; - ReactCurrentBatchConfig.suspense = config === undefined ? null : config; - - try { - scope(); - } finally { - ReactCurrentBatchConfig.suspense = previousConfig; - } - } - /** - * 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. - */ - - var propTypesMisspellWarningShown; { propTypesMisspellWarningShown = false; } - var hasOwnProperty$1 = Object.prototype.hasOwnProperty; function getDeclarationErrorAddendum() { if (ReactCurrentOwner.current) { @@ -2088,7 +1924,7 @@ if ("development" !== "production") { setCurrentlyValidatingElement(element); { - warning$1(false, 'Each child in a list should have a unique "key" prop.' + '%s%s See https://fb.me/react-warning-keys for more information.', currentComponentErrorInfo, childOwner); + error('Each child in a list should have a unique "key" prop.' + '%s%s See https://fb.me/react-warning-keys for more information.', currentComponentErrorInfo, childOwner); } setCurrentlyValidatingElement(null); } @@ -2149,36 +1985,38 @@ if ("development" !== "production") { function validatePropTypes(element) { - var type = element.type; + { + var type = element.type; - if (type === null || type === undefined || typeof type === 'string') { - return; - } + if (type === null || type === undefined || typeof type === 'string') { + return; + } - var name = getComponentName(type); - var propTypes; + var name = getComponentName(type); + var propTypes; - if (typeof type === 'function') { - propTypes = type.propTypes; - } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here. - // Inner props are checked in the reconciler. - type.$$typeof === REACT_MEMO_TYPE)) { - propTypes = type.propTypes; - } else { - return; - } + if (typeof type === 'function') { + propTypes = type.propTypes; + } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here. + // Inner props are checked in the reconciler. + type.$$typeof === REACT_MEMO_TYPE)) { + propTypes = type.propTypes; + } else { + return; + } - if (propTypes) { - setCurrentlyValidatingElement(element); - checkPropTypes(propTypes, element.props, 'prop', name, ReactDebugCurrentFrame.getStackAddendum); - setCurrentlyValidatingElement(null); - } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) { - propTypesMisspellWarningShown = true; - warningWithoutStack$1(false, 'Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', name || 'Unknown'); - } + if (propTypes) { + setCurrentlyValidatingElement(element); + checkPropTypes(propTypes, element.props, 'prop', name, ReactDebugCurrentFrame.getStackAddendum); + setCurrentlyValidatingElement(null); + } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) { + propTypesMisspellWarningShown = true; + error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', name || 'Unknown'); + } - if (typeof type.getDefaultProps === 'function') { - !type.getDefaultProps.isReactClassApproved ? warningWithoutStack$1(false, 'getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.') : void 0; + if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) { + error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.'); + } } } /** @@ -2188,117 +2026,25 @@ if ("development" !== "production") { function validateFragmentProps(fragment) { - setCurrentlyValidatingElement(fragment); - var keys = Object.keys(fragment.props); - - for (var i = 0; i < keys.length; i++) { - var key = keys[i]; - - if (key !== 'children' && key !== 'key') { - warning$1(false, 'Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key); - break; - } - } - - if (fragment.ref !== null) { - warning$1(false, 'Invalid attribute `ref` supplied to `React.Fragment`.'); - } - - setCurrentlyValidatingElement(null); - } - - function jsxWithValidation(type, props, key, isStaticChildren, source, self) { - var validType = isValidElementType(type); // 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) { - 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, or you might have mixed up default and named imports."; - } - - var sourceInfo = getSourceInfoErrorAddendum(source); - - if (sourceInfo) { - info += sourceInfo; - } else { - info += getDeclarationErrorAddendum(); - } - - var typeString; - - if (type === null) { - typeString = 'null'; - } else if (Array.isArray(type)) { - typeString = 'array'; - } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) { - typeString = "<" + (getComponentName(type.type) || 'Unknown') + " />"; - info = ' Did you accidentally export a JSX literal instead of a component?'; - } else { - typeString = typeof type; - } - - warning$1(false, 'React.jsx: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info); - } - - var element = jsxDEV(type, props, key, source, self); // 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) { - var children = props.children; + { + setCurrentlyValidatingElement(fragment); + var keys = Object.keys(fragment.props); - if (children !== undefined) { - if (isStaticChildren) { - if (Array.isArray(children)) { - for (var i = 0; i < children.length; i++) { - validateChildKeys(children[i], type); - } + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; - if (Object.freeze) { - Object.freeze(children); - } - } else { - warning$1(false, 'React.jsx: Static children should always be an array. ' + 'You are likely explicitly calling React.jsxs or React.jsxDEV. ' + 'Use the Babel transform instead.'); - } - } else { - validateChildKeys(children, type); + if (key !== 'children' && key !== 'key') { + error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key); + break; } } - } - if (hasOwnProperty$1.call(props, 'key')) { - warning$1(false, 'React.jsx: Spreading a key to JSX is a deprecated pattern. ' + 'Explicitly pass a key after spreading props in your JSX call. ' + 'E.g. '); - } + if (fragment.ref !== null) { + error('Invalid attribute `ref` supplied to `React.Fragment`.'); + } - if (type === REACT_FRAGMENT_TYPE) { - validateFragmentProps(element); - } else { - validatePropTypes(element); + setCurrentlyValidatingElement(null); } - - return element; - } // These two functions exist to still get child warnings in dev - // even with the prod transform. This means that jsxDEV is purely - // opt-in behavior for better messages but that we won't stop - // giving you warnings if you use production apis. - - - function jsxWithValidationStatic(type, props, key) { - return jsxWithValidation(type, props, key, true); - } - - function jsxWithValidationDynamic(type, props, key) { - return jsxWithValidation(type, props, key, false); } function createElementWithValidation(type, props, children) { @@ -2333,7 +2079,9 @@ if ("development" !== "production") { typeString = typeof type; } - warning$1(false, 'React.createElement: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info); + { + error('React.createElement: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info); + } } var element = createElement.apply(this, arguments); // The result can be nullish if a mock or a custom function is used. @@ -2363,15 +2111,22 @@ if ("development" !== "production") { return element; } + var didWarnAboutDeprecatedCreateFactory = false; + function createFactoryWithValidation(type) { var validatedFactory = createElementWithValidation.bind(null, type); - validatedFactory.type = type; // Legacy hook: remove it - + validatedFactory.type = type; { + if (!didWarnAboutDeprecatedCreateFactory) { + didWarnAboutDeprecatedCreateFactory = true; + warn('React.createFactory() is deprecated and will be removed in ' + 'a future major release. Consider using JSX ' + 'or use React.createElement() directly instead.'); + } // Legacy hook: remove it + + Object.defineProperty(validatedFactory, 'type', { enumerable: false, get: function () { - lowPriorityWarningWithoutStack$1(false, 'Factory.type is deprecated. Access the class directly ' + 'before passing it to createFactory.'); + warn('Factory.type is deprecated. Access the class directly ' + 'before passing it to createFactory.'); Object.defineProperty(this, 'type', { value: type }); @@ -2393,10 +2148,7 @@ if ("development" !== "production") { return newElement; } - var hasBadMapPolyfill; { - hasBadMapPolyfill = false; - try { var frozenObject = Object.freeze({}); var testMap = new Map([[frozenObject, null]]); @@ -2406,187 +2158,46 @@ if ("development" !== "production") { testMap.set(0, 0); testSet.add(0); - } catch (e) { - // TODO: Consider warning about bad polyfills - hasBadMapPolyfill = true; - } - } - - function createFundamentalComponent(impl) { - // We use responder as a Map key later on. When we have a bad - // polyfill, then we can't use it as a key as the polyfill tries - // to add a property to the object. - if (true && !hasBadMapPolyfill) { - Object.freeze(impl); - } - - var fundamantalComponent = { - $$typeof: REACT_FUNDAMENTAL_TYPE, - impl: impl - }; - { - Object.freeze(fundamantalComponent); - } - return fundamantalComponent; - } - - function createEventResponder(displayName, responderConfig) { - var getInitialState = responderConfig.getInitialState, - onEvent = responderConfig.onEvent, - onMount = responderConfig.onMount, - onUnmount = responderConfig.onUnmount, - onRootEvent = responderConfig.onRootEvent, - rootEventTypes = responderConfig.rootEventTypes, - targetEventTypes = responderConfig.targetEventTypes, - targetPortalPropagation = responderConfig.targetPortalPropagation; - var eventResponder = { - $$typeof: REACT_RESPONDER_TYPE, - displayName: displayName, - getInitialState: getInitialState || null, - onEvent: onEvent || null, - onMount: onMount || null, - onRootEvent: onRootEvent || null, - onUnmount: onUnmount || null, - rootEventTypes: rootEventTypes || null, - targetEventTypes: targetEventTypes || null, - targetPortalPropagation: targetPortalPropagation || false - }; // We use responder as a Map key later on. When we have a bad - // polyfill, then we can't use it as a key as the polyfill tries - // to add a property to the object. - - if (true && !hasBadMapPolyfill) { - Object.freeze(eventResponder); - } - - return eventResponder; - } - - function createScope() { - var scopeComponent = { - $$typeof: REACT_SCOPE_TYPE - }; - { - Object.freeze(scopeComponent); - } - return scopeComponent; - } // Helps identify side effects in begin-phase lifecycle hooks and setState reducers: - // In some cases, StrictMode should also double-render lifecycles. - // This can be confusing for tests though, - // And it can be bad for performance in production. - // This feature flag can be used to control the behavior: - // To preserve the "Pause on caught exceptions" behavior of the debugger, we - // replay the begin phase of a failed component inside invokeGuardedCallback. - // Warn about deprecated, async-unsafe lifecycles; relates to RFC #6: - // Gather advanced timing metrics for Profiler subtrees. - // Trace which interactions trigger each commit. - // SSR experiments - // Only used in www builds. - // Only used in www builds. - // Disable javascript: URL strings in href for XSS protection. - // React Fire: prevent the value and checked attributes from syncing - // with their related DOM properties - // These APIs will no longer be "unstable" in the upcoming 16.7 release, - // Control this behavior with a flag to support 16.6 minor releases in the meanwhile. - - - var exposeConcurrentModeAPIs = false; // Experimental React Flare event system and event components support. - - var enableFlareAPI = false; // Experimental Host Component support. - - var enableFundamentalAPI = false; // Experimental Scope support. - - var enableScopeAPI = false; // New API for JSX transforms to target - https://github.com/reactjs/rfcs/pull/107 - - var enableJSXTransformAPI = false; // We will enforce mocking scheduler with scheduler/unstable_mock at some point. (v17?) - // Till then, we warn about the missing mock, but still fallback to a sync mode compatible version - // For tests, we flush suspense fallbacks in an act scope; - // *except* in some of our own tests, where we test incremental loading states. - // Add a callback property to suspense to notify which promises are currently - // in the update queue. This allows reporting and tracing of what is causing - // the user to see a loading state. - // Also allows hydration callbacks to fire when a dehydrated boundary gets - // hydrated or deleted. - // Part of the simplification of React.createElement so we can eventually move - // from React.createElement to React.jsx - // https://github.com/reactjs/rfcs/blob/createlement-rfc/text/0000-create-element-changes.md - - var React = { - Children: { - map: mapChildren, - forEach: forEachChildren, - count: countChildren, - toArray: toArray, - only: onlyChild - }, - createRef: createRef, - Component: Component, - PureComponent: PureComponent, - createContext: createContext, - forwardRef: forwardRef, - lazy: lazy, - memo: memo, - useCallback: useCallback, - useContext: useContext, - useEffect: useEffect, - useImperativeHandle: useImperativeHandle, - useDebugValue: useDebugValue, - useLayoutEffect: useLayoutEffect, - useMemo: useMemo, - useReducer: useReducer, - useRef: useRef, - useState: useState, - Fragment: REACT_FRAGMENT_TYPE, - Profiler: REACT_PROFILER_TYPE, - StrictMode: REACT_STRICT_MODE_TYPE, - Suspense: REACT_SUSPENSE_TYPE, - createElement: createElementWithValidation, - cloneElement: cloneElementWithValidation, - createFactory: createFactoryWithValidation, - isValidElement: isValidElement, - version: ReactVersion, - __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: ReactSharedInternals + } catch (e) {} + } + var createElement$1 = createElementWithValidation; + var cloneElement$1 = cloneElementWithValidation; + var createFactory = createFactoryWithValidation; + var Children = { + map: mapChildren, + forEach: forEachChildren, + count: countChildren, + toArray: toArray, + only: onlyChild }; - - if (exposeConcurrentModeAPIs) { - React.useTransition = useTransition; - React.useDeferredValue = useDeferredValue; - React.SuspenseList = REACT_SUSPENSE_LIST_TYPE; - React.unstable_withSuspenseConfig = withSuspenseConfig; - } - - if (enableFlareAPI) { - React.unstable_useResponder = useResponder; - React.unstable_createResponder = createEventResponder; - } - - if (enableFundamentalAPI) { - React.unstable_createFundamental = createFundamentalComponent; - } - - if (enableScopeAPI) { - React.unstable_createScope = createScope; - } // Note: some APIs are added with feature flags. - // Make sure that stable builds for open source - // don't modify the React object to avoid deopts. - // Also let's not expose their names in stable builds. - - - if (enableJSXTransformAPI) { - { - React.jsxDEV = jsxWithValidation; - React.jsx = jsxWithValidationDynamic; - React.jsxs = jsxWithValidationStatic; - } - } - - var React$2 = Object.freeze({ - default: React - }); - var React$3 = React$2 && React || React$2; // TODO: decide on the top-level export form. - // This is hacky but makes it work with both Rollup and Jest. - - var react = React$3.default || React$3; - module.exports = react; + exports.Children = Children; + exports.Component = Component; + exports.Fragment = REACT_FRAGMENT_TYPE; + exports.Profiler = REACT_PROFILER_TYPE; + exports.PureComponent = PureComponent; + exports.StrictMode = REACT_STRICT_MODE_TYPE; + exports.Suspense = REACT_SUSPENSE_TYPE; + exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = ReactSharedInternals; + exports.cloneElement = cloneElement$1; + exports.createContext = createContext; + exports.createElement = createElement$1; + exports.createFactory = createFactory; + exports.createRef = createRef; + exports.forwardRef = forwardRef; + exports.isValidElement = isValidElement; + exports.lazy = lazy; + exports.memo = memo; + exports.useCallback = useCallback; + exports.useContext = useContext; + exports.useDebugValue = useDebugValue; + exports.useEffect = useEffect; + exports.useImperativeHandle = useImperativeHandle; + exports.useLayoutEffect = useLayoutEffect; + exports.useMemo = useMemo; + exports.useReducer = useReducer; + exports.useRef = useRef; + exports.useState = useState; + exports.version = ReactVersion; })(); } },{"object-assign":"node_modules/object-assign/index.js","prop-types/checkPropTypes":"node_modules/prop-types/checkPropTypes.js"}],"node_modules/react/index.js":[function(require,module,exports) { @@ -2598,7 +2209,7 @@ if ("development" === 'production') { module.exports = require('./cjs/react.development.js'); } },{"./cjs/react.development.js":"node_modules/react/cjs/react.development.js"}],"node_modules/react-dom/node_modules/scheduler/cjs/scheduler.development.js":[function(require,module,exports) { -/** @license React v0.16.2 +/** @license React v0.19.1 * scheduler.development.js * * Copyright (c) Facebook, Inc. and its affiliates. @@ -2612,19 +2223,8 @@ if ("development" !== "production") { (function () { 'use strict'; - Object.defineProperty(exports, '__esModule', { - value: true - }); var enableSchedulerDebugging = false; - var enableIsInputPending = false; - var enableMessageLoopImplementation = true; - var enableProfiling = true; // works by scheduling a requestAnimationFrame, storing the time for the start - // of the frame, then scheduling a postMessage which gets scheduled after paint. - // Within the postMessage handler do as much work as possible until time + frame - // rate. By separating the idle call into a separate event tick we ensure that - // layout, paint and other browser work is counted against the available time. - // The frame rate is dynamically adjusted. - + var enableProfiling = true; var requestHostCallback; var requestHostTimeout; var cancelHostTimeout; @@ -2691,17 +2291,22 @@ if ("development" !== "production") { var _Date = window.Date; var _setTimeout = window.setTimeout; var _clearTimeout = window.clearTimeout; - var requestAnimationFrame = window.requestAnimationFrame; - var cancelAnimationFrame = window.cancelAnimationFrame; if (typeof console !== 'undefined') { - // TODO: Remove fb.me link + // TODO: Scheduler no longer requires these methods to be polyfilled. But + // maybe we want to continue warning if they don't exist, to preserve the + // option to rely on it in the future? + var requestAnimationFrame = window.requestAnimationFrame; + var cancelAnimationFrame = window.cancelAnimationFrame; // TODO: Remove fb.me link + if (typeof requestAnimationFrame !== 'function') { - console.error("This browser doesn't support requestAnimationFrame. " + 'Make sure that you load a ' + 'polyfill in older browsers. https://fb.me/react-polyfills'); + // Using console['error'] to evade Babel and ESLint + console['error']("This browser doesn't support requestAnimationFrame. " + 'Make sure that you load a ' + 'polyfill in older browsers. https://fb.me/react-polyfills'); } if (typeof cancelAnimationFrame !== 'function') { - console.error("This browser doesn't support cancelAnimationFrame. " + 'Make sure that you load a ' + 'polyfill in older browsers. https://fb.me/react-polyfills'); + // Using console['error'] to evade Babel and ESLint + console['error']("This browser doesn't support cancelAnimationFrame. " + 'Make sure that you load a ' + 'polyfill in older browsers. https://fb.me/react-polyfills'); } } @@ -2717,65 +2322,21 @@ if ("development" !== "production") { }; } - var isRAFLoopRunning = false; var isMessageLoopRunning = false; var scheduledHostCallback = null; - var rAFTimeoutID = -1; - var taskTimeoutID = -1; - var frameLength = enableMessageLoopImplementation ? // We won't attempt to align with the vsync. Instead we'll yield multiple - // times per frame, often enough to keep it responsive even at really - // high frame rates > 120. - 5 : // Use a heuristic to measure the frame rate and yield at the end of the - // frame. We start out assuming that we run at 30fps but then the - // heuristic tracking will adjust this value to a faster fps if we get - // more frequent animation frames. - 33.33; - var prevRAFTime = -1; - var prevRAFInterval = -1; - var frameDeadline = 0; - var fpsLocked = false; // TODO: Make this configurable - // TODO: Adjust this based on priority? - - var maxFrameLength = 300; - var needsPaint = false; - - if (enableIsInputPending && navigator !== undefined && navigator.scheduling !== undefined && navigator.scheduling.isInputPending !== undefined) { - var scheduling = navigator.scheduling; - - shouldYieldToHost = function () { - var currentTime = exports.unstable_now(); - - if (currentTime >= frameDeadline) { - // There's no time left in the frame. We may want to yield control of - // the main thread, so the browser can perform high priority tasks. The - // main ones are painting and user input. If there's a pending paint or - // a pending input, then we should yield. But if there's neither, then - // we can yield less often while remaining responsive. We'll eventually - // yield regardless, since there could be a pending paint that wasn't - // accompanied by a call to `requestPaint`, or other main thread tasks - // like network events. - if (needsPaint || scheduling.isInputPending()) { - // There is either a pending paint or a pending input. - return true; - } // There's no pending input. Only yield if we've reached the max - // frame length. + var taskTimeoutID = -1; // Scheduler periodically yields in case there is other work on the main + // thread, like user events. By default, it yields multiple times per frame. + // It does not attempt to align with frame boundaries, since most tasks don't + // need to be frame aligned; for those that do, use requestAnimationFrame. + var yieldInterval = 5; + var deadline = 0; // TODO: Make this configurable - return currentTime >= frameDeadline + maxFrameLength; - } else { - // There's still time left in the frame. - return false; - } - }; - - requestPaint = function () { - needsPaint = true; - }; - } else { + { // `isInputPending` is not available. Since we have no way of knowing if // there's pending input, always yield at the end of the frame. shouldYieldToHost = function () { - return exports.unstable_now() >= frameDeadline; + return exports.unstable_now() >= deadline; }; // Since we yield every frame regardless, `requestPaint` has no effect. @@ -2784,171 +2345,61 @@ if ("development" !== "production") { exports.unstable_forceFrameRate = function (fps) { if (fps < 0 || fps > 125) { - console.error('forceFrameRate takes a positive int between 0 and 125, ' + 'forcing framerates higher than 125 fps is not unsupported'); + // Using console['error'] to evade Babel and ESLint + console['error']('forceFrameRate takes a positive int between 0 and 125, ' + 'forcing framerates higher than 125 fps is not unsupported'); return; } if (fps > 0) { - frameLength = Math.floor(1000 / fps); - fpsLocked = true; + yieldInterval = Math.floor(1000 / fps); } else { // reset the framerate - frameLength = 33.33; - fpsLocked = false; + yieldInterval = 5; } }; var performWorkUntilDeadline = function () { - if (enableMessageLoopImplementation) { - if (scheduledHostCallback !== null) { - var currentTime = exports.unstable_now(); // Yield after `frameLength` ms, regardless of where we are in the vsync - // cycle. This means there's always time remaining at the beginning of - // the message event. + if (scheduledHostCallback !== null) { + var currentTime = exports.unstable_now(); // Yield after `yieldInterval` ms, regardless of where we are in the vsync + // cycle. This means there's always time remaining at the beginning of + // the message event. - frameDeadline = currentTime + frameLength; - var hasTimeRemaining = true; + deadline = currentTime + yieldInterval; + var hasTimeRemaining = true; - try { - var hasMoreWork = scheduledHostCallback(hasTimeRemaining, currentTime); + try { + var hasMoreWork = scheduledHostCallback(hasTimeRemaining, currentTime); - if (!hasMoreWork) { - isMessageLoopRunning = false; - scheduledHostCallback = null; - } else { - // If there's more work, schedule the next message event at the end - // of the preceding one. - port.postMessage(null); - } - } catch (error) { - // If a scheduler task throws, exit the current browser task so the - // error can be observed. + if (!hasMoreWork) { + isMessageLoopRunning = false; + scheduledHostCallback = null; + } else { + // If there's more work, schedule the next message event at the end + // of the preceding one. port.postMessage(null); - throw error; } - } else { - isMessageLoopRunning = false; - } // Yielding to the browser will give it a chance to paint, so we can - // reset this. - - - needsPaint = false; + } catch (error) { + // If a scheduler task throws, exit the current browser task so the + // error can be observed. + port.postMessage(null); + throw error; + } } else { - if (scheduledHostCallback !== null) { - var _currentTime = exports.unstable_now(); - - var _hasTimeRemaining = frameDeadline - _currentTime > 0; + isMessageLoopRunning = false; + } // Yielding to the browser will give it a chance to paint, so we can - try { - var _hasMoreWork = scheduledHostCallback(_hasTimeRemaining, _currentTime); - - if (!_hasMoreWork) { - scheduledHostCallback = null; - } - } catch (error) { - // If a scheduler task throws, exit the current browser task so the - // error can be observed, and post a new task as soon as possible - // so we can continue where we left off. - port.postMessage(null); - throw error; - } - } // Yielding to the browser will give it a chance to paint, so we can - // reset this. - - - needsPaint = false; - } }; var channel = new MessageChannel(); var port = channel.port2; channel.port1.onmessage = performWorkUntilDeadline; - var onAnimationFrame = function (rAFTime) { - if (scheduledHostCallback === null) { - // No scheduled work. Exit. - prevRAFTime = -1; - prevRAFInterval = -1; - isRAFLoopRunning = false; - return; - } // Eagerly schedule the next animation callback at the beginning of the - // frame. If the scheduler queue is not empty at the end of the frame, it - // will continue flushing inside that callback. If the queue *is* empty, - // then it will exit immediately. Posting the callback at the start of the - // frame ensures it's fired within the earliest possible frame. If we - // waited until the end of the frame to post the callback, we risk the - // browser skipping a frame and not firing the callback until the frame - // after that. - - - isRAFLoopRunning = true; - requestAnimationFrame(function (nextRAFTime) { - _clearTimeout(rAFTimeoutID); - - onAnimationFrame(nextRAFTime); - }); // requestAnimationFrame is throttled when the tab is backgrounded. We - // don't want to stop working entirely. So we'll fallback to a timeout loop. - // TODO: Need a better heuristic for backgrounded work. - - var onTimeout = function () { - frameDeadline = exports.unstable_now() + frameLength / 2; - performWorkUntilDeadline(); - rAFTimeoutID = _setTimeout(onTimeout, frameLength * 3); - }; - - rAFTimeoutID = _setTimeout(onTimeout, frameLength * 3); - - if (prevRAFTime !== -1 && // Make sure this rAF time is different from the previous one. This check - // could fail if two rAFs fire in the same frame. - rAFTime - prevRAFTime > 0.1) { - var rAFInterval = rAFTime - prevRAFTime; - - if (!fpsLocked && prevRAFInterval !== -1) { - // We've observed two consecutive frame intervals. We'll use this to - // dynamically adjust the frame rate. - // - // If one frame goes long, then the next one can be short to catch up. - // If two frames are short in a row, then that's an indication that we - // actually have a higher frame rate than what we're currently - // optimizing. For example, if we're running on 120hz display or 90hz VR - // display. Take the max of the two in case one of them was an anomaly - // due to missed frame deadlines. - if (rAFInterval < frameLength && prevRAFInterval < frameLength) { - frameLength = rAFInterval < prevRAFInterval ? prevRAFInterval : rAFInterval; - - if (frameLength < 8.33) { - // Defensive coding. We don't support higher frame rates than 120hz. - // If the calculated frame length gets lower than 8, it is probably - // a bug. - frameLength = 8.33; - } - } - } - - prevRAFInterval = rAFInterval; - } - - prevRAFTime = rAFTime; - frameDeadline = rAFTime + frameLength; // We use the postMessage trick to defer idle work until after the repaint. - - port.postMessage(null); - }; - requestHostCallback = function (callback) { scheduledHostCallback = callback; - if (enableMessageLoopImplementation) { - if (!isMessageLoopRunning) { - isMessageLoopRunning = true; - port.postMessage(null); - } - } else { - if (!isRAFLoopRunning) { - // Start a rAF loop. - isRAFLoopRunning = true; - requestAnimationFrame(function (rAFTime) { - onAnimationFrame(rAFTime); - }); - } + if (!isMessageLoopRunning) { + isMessageLoopRunning = true; + port.postMessage(null); } }; @@ -2997,7 +2448,7 @@ if ("development" !== "production") { var index = i; while (true) { - var parentIndex = Math.floor((index - 1) / 2); + var parentIndex = index - 1 >>> 1; var parent = heap[parentIndex]; if (parent !== undefined && compare(parent, node) > 0) { @@ -3059,18 +2510,17 @@ if ("development" !== "production") { var runIdCounter = 0; var mainThreadIdCounter = 0; var profilingStateSize = 4; - var sharedProfilingBuffer = enableProfiling ? // $FlowFixMe Flow doesn't know about SharedArrayBuffer + var sharedProfilingBuffer = // $FlowFixMe Flow doesn't know about SharedArrayBuffer typeof SharedArrayBuffer === 'function' ? new SharedArrayBuffer(profilingStateSize * Int32Array.BYTES_PER_ELEMENT) : // $FlowFixMe Flow doesn't know about ArrayBuffer typeof ArrayBuffer === 'function' ? new ArrayBuffer(profilingStateSize * Int32Array.BYTES_PER_ELEMENT) : null // Don't crash the init path on IE9 - : null; - var profilingState = enableProfiling && sharedProfilingBuffer !== null ? new Int32Array(sharedProfilingBuffer) : []; // We can't read this but it helps save bytes for null checks + ; + var profilingState = sharedProfilingBuffer !== null ? new Int32Array(sharedProfilingBuffer) : []; // We can't read this but it helps save bytes for null checks var PRIORITY = 0; var CURRENT_TASK_ID = 1; var CURRENT_RUN_ID = 2; var QUEUE_SIZE = 3; - - if (enableProfiling) { + { profilingState[PRIORITY] = NoPriority; // This is maintained with a counter, because the size of the priority queue // array might include canceled tasks. @@ -3078,7 +2528,6 @@ if ("development" !== "production") { profilingState[CURRENT_TASK_ID] = 0; } // Bytes per element is 4 - var INITIAL_EVENT_LOG_SIZE = 131072; var MAX_EVENT_LOG_SIZE = 524288; // Equivalent to 2 megabytes @@ -3104,7 +2553,8 @@ if ("development" !== "production") { eventLogSize *= 2; if (eventLogSize > MAX_EVENT_LOG_SIZE) { - console.error("Scheduler Profiling: Event log exceeded maximum size. Don't " + 'forget to call `stopLoggingProfilingEvents()`.'); + // Using console['error'] to evade Babel and ESLint + console['error']("Scheduler Profiling: Event log exceeded maximum size. Don't " + 'forget to call `stopLoggingProfilingEvents()`.'); stopLoggingProfilingEvents(); return; } @@ -3135,89 +2585,92 @@ if ("development" !== "production") { return buffer; } - function markTaskStart(task, time) { - if (enableProfiling) { + function markTaskStart(task, ms) { + { profilingState[QUEUE_SIZE]++; if (eventLog !== null) { - logEvent([TaskStartEvent, time, task.id, task.priorityLevel]); + // performance.now returns a float, representing milliseconds. When the + // event is logged, it's coerced to an int. Convert to microseconds to + // maintain extra degrees of precision. + logEvent([TaskStartEvent, ms * 1000, task.id, task.priorityLevel]); } } } - function markTaskCompleted(task, time) { - if (enableProfiling) { + function markTaskCompleted(task, ms) { + { profilingState[PRIORITY] = NoPriority; profilingState[CURRENT_TASK_ID] = 0; profilingState[QUEUE_SIZE]--; if (eventLog !== null) { - logEvent([TaskCompleteEvent, time, task.id]); + logEvent([TaskCompleteEvent, ms * 1000, task.id]); } } } - function markTaskCanceled(task, time) { - if (enableProfiling) { + function markTaskCanceled(task, ms) { + { profilingState[QUEUE_SIZE]--; if (eventLog !== null) { - logEvent([TaskCancelEvent, time, task.id]); + logEvent([TaskCancelEvent, ms * 1000, task.id]); } } } - function markTaskErrored(task, time) { - if (enableProfiling) { + function markTaskErrored(task, ms) { + { profilingState[PRIORITY] = NoPriority; profilingState[CURRENT_TASK_ID] = 0; profilingState[QUEUE_SIZE]--; if (eventLog !== null) { - logEvent([TaskErrorEvent, time, task.id]); + logEvent([TaskErrorEvent, ms * 1000, task.id]); } } } - function markTaskRun(task, time) { - if (enableProfiling) { + function markTaskRun(task, ms) { + { runIdCounter++; profilingState[PRIORITY] = task.priorityLevel; profilingState[CURRENT_TASK_ID] = task.id; profilingState[CURRENT_RUN_ID] = runIdCounter; if (eventLog !== null) { - logEvent([TaskRunEvent, time, task.id, runIdCounter]); + logEvent([TaskRunEvent, ms * 1000, task.id, runIdCounter]); } } } - function markTaskYield(task, time) { - if (enableProfiling) { + function markTaskYield(task, ms) { + { profilingState[PRIORITY] = NoPriority; profilingState[CURRENT_TASK_ID] = 0; profilingState[CURRENT_RUN_ID] = 0; if (eventLog !== null) { - logEvent([TaskYieldEvent, time, task.id, runIdCounter]); + logEvent([TaskYieldEvent, ms * 1000, task.id, runIdCounter]); } } } - function markSchedulerSuspended(time) { - if (enableProfiling) { + function markSchedulerSuspended(ms) { + { mainThreadIdCounter++; if (eventLog !== null) { - logEvent([SchedulerSuspendEvent, time, mainThreadIdCounter]); + logEvent([SchedulerSuspendEvent, ms * 1000, mainThreadIdCounter]); } } } - function markSchedulerUnsuspended(time) { - if (enableProfiling) { + function markSchedulerUnsuspended(ms) { + { if (eventLog !== null) { - logEvent([SchedulerResumeEvent, time, mainThreadIdCounter]); + logEvent([SchedulerResumeEvent, ms * 1000, mainThreadIdCounter]); } } } @@ -3241,7 +2694,6 @@ if ("development" !== "production") { var taskIdCounter = 1; // Pausing the scheduler is useful for debugging. - var isSchedulerPaused = false; var currentTask = null; var currentPriorityLevel = NormalPriority; // This is set while performing work, to prevent re-entrancy. @@ -3262,8 +2714,7 @@ if ("development" !== "production") { pop(timerQueue); timer.sortIndex = timer.expirationTime; push(taskQueue, timer); - - if (enableProfiling) { + { markTaskStart(timer, currentTime); timer.isQueued = true; } @@ -3295,11 +2746,10 @@ if ("development" !== "production") { } function flushWork(hasTimeRemaining, initialTime) { - if (enableProfiling) { + { markSchedulerUnsuspended(initialTime); } // We'll need a host callback the next time work is scheduled. - isHostCallbackScheduled = false; if (isHostTimeoutScheduled) { @@ -3332,8 +2782,7 @@ if ("development" !== "production") { currentTask = null; currentPriorityLevel = previousPriorityLevel; isPerformingWork = false; - - if (enableProfiling) { + { var _currentTime = exports.unstable_now(); markSchedulerSuspended(_currentTime); @@ -3346,7 +2795,7 @@ if ("development" !== "production") { advanceTimers(currentTime); currentTask = peek(taskQueue); - while (currentTask !== null && !(enableSchedulerDebugging && isSchedulerPaused)) { + while (currentTask !== null && !enableSchedulerDebugging) { if (currentTask.expirationTime > currentTime && (!hasTimeRemaining || shouldYieldToHost())) { // This currentTask hasn't expired, and we've reached the deadline. break; @@ -3366,7 +2815,7 @@ if ("development" !== "production") { currentTask.callback = continuationCallback; markTaskYield(currentTask, currentTime); } else { - if (enableProfiling) { + { markTaskCompleted(currentTask, currentTime); currentTask.isQueued = false; } @@ -3512,8 +2961,7 @@ if ("development" !== "production") { expirationTime: expirationTime, sortIndex: -1 }; - - if (enableProfiling) { + { newTask.isQueued = false; } @@ -3537,14 +2985,12 @@ if ("development" !== "production") { } else { newTask.sortIndex = expirationTime; push(taskQueue, newTask); - - if (enableProfiling) { + { markTaskStart(newTask, currentTime); newTask.isQueued = true; } // Schedule a host callback, if needed. If we're already performing work, // wait until the next time we yield. - if (!isHostCallbackScheduled && !isPerformingWork) { isHostCallbackScheduled = true; requestHostCallback(flushWork); @@ -3554,13 +3000,9 @@ if ("development" !== "production") { return newTask; } - function unstable_pauseExecution() { - isSchedulerPaused = true; - } + function unstable_pauseExecution() {} function unstable_continueExecution() { - isSchedulerPaused = false; - if (!isHostCallbackScheduled && !isPerformingWork) { isHostCallbackScheduled = true; requestHostCallback(flushWork); @@ -3572,7 +3014,7 @@ if ("development" !== "production") { } function unstable_cancelCallback(task) { - if (enableProfiling) { + { if (task.isQueued) { var currentTime = exports.unstable_now(); markTaskCanceled(task, currentTime); @@ -3582,7 +3024,6 @@ if ("development" !== "production") { // remove from the queue because you can't remove arbitrary nodes from an // array based heap, only the first one.) - task.callback = null; } @@ -3598,28 +3039,28 @@ if ("development" !== "production") { } var unstable_requestPaint = requestPaint; - var unstable_Profiling = enableProfiling ? { + var unstable_Profiling = { startLoggingProfilingEvents: startLoggingProfilingEvents, stopLoggingProfilingEvents: stopLoggingProfilingEvents, sharedProfilingBuffer: sharedProfilingBuffer - } : null; - exports.unstable_ImmediatePriority = ImmediatePriority; - exports.unstable_UserBlockingPriority = UserBlockingPriority; - exports.unstable_NormalPriority = NormalPriority; + }; exports.unstable_IdlePriority = IdlePriority; + exports.unstable_ImmediatePriority = ImmediatePriority; exports.unstable_LowPriority = LowPriority; - exports.unstable_runWithPriority = unstable_runWithPriority; - exports.unstable_next = unstable_next; - exports.unstable_scheduleCallback = unstable_scheduleCallback; + exports.unstable_NormalPriority = NormalPriority; + exports.unstable_Profiling = unstable_Profiling; + exports.unstable_UserBlockingPriority = UserBlockingPriority; exports.unstable_cancelCallback = unstable_cancelCallback; - exports.unstable_wrapCallback = unstable_wrapCallback; - exports.unstable_getCurrentPriorityLevel = unstable_getCurrentPriorityLevel; - exports.unstable_shouldYield = unstable_shouldYield; - exports.unstable_requestPaint = unstable_requestPaint; exports.unstable_continueExecution = unstable_continueExecution; - exports.unstable_pauseExecution = unstable_pauseExecution; + exports.unstable_getCurrentPriorityLevel = unstable_getCurrentPriorityLevel; exports.unstable_getFirstCallbackNode = unstable_getFirstCallbackNode; - exports.unstable_Profiling = unstable_Profiling; + exports.unstable_next = unstable_next; + exports.unstable_pauseExecution = unstable_pauseExecution; + exports.unstable_requestPaint = unstable_requestPaint; + exports.unstable_runWithPriority = unstable_runWithPriority; + exports.unstable_scheduleCallback = unstable_scheduleCallback; + exports.unstable_shouldYield = unstable_shouldYield; + exports.unstable_wrapCallback = unstable_wrapCallback; })(); } },{}],"node_modules/react-dom/node_modules/scheduler/index.js":[function(require,module,exports) { @@ -3631,7 +3072,7 @@ if ("development" === 'production') { module.exports = require('./cjs/scheduler.development.js'); } },{"./cjs/scheduler.development.js":"node_modules/react-dom/node_modules/scheduler/cjs/scheduler.development.js"}],"node_modules/react-dom/node_modules/scheduler/cjs/scheduler-tracing.development.js":[function(require,module,exports) { -/** @license React v0.16.2 +/** @license React v0.19.1 * scheduler-tracing.development.js * * Copyright (c) Facebook, Inc. and its affiliates. @@ -3645,50 +3086,6 @@ if ("development" !== "production") { (function () { 'use strict'; - Object.defineProperty(exports, '__esModule', { - value: true - }); // Helps identify side effects in begin-phase lifecycle hooks and setState reducers: - // In some cases, StrictMode should also double-render lifecycles. - // This can be confusing for tests though, - // And it can be bad for performance in production. - // This feature flag can be used to control the behavior: - // To preserve the "Pause on caught exceptions" behavior of the debugger, we - // replay the begin phase of a failed component inside invokeGuardedCallback. - // Warn about deprecated, async-unsafe lifecycles; relates to RFC #6: - // Gather advanced timing metrics for Profiler subtrees. - // Trace which interactions trigger each commit. - - var enableSchedulerTracing = true; // Only used in www builds. - // TODO: true? Here it might just be false. - // Only used in www builds. - // Only used in www builds. - // Disable javascript: URL strings in href for XSS protection. - // React Fire: prevent the value and checked attributes from syncing - // with their related DOM properties - // These APIs will no longer be "unstable" in the upcoming 16.7 release, - // Control this behavior with a flag to support 16.6 minor releases in the meanwhile. - // See https://github.com/react-native-community/discussions-and-proposals/issues/72 for more information - // This is a flag so we can fix warnings in RN core before turning it on - // Experimental React Flare event system and event components support. - // Experimental Host Component support. - // Experimental Scope support. - // New API for JSX transforms to target - https://github.com/reactjs/rfcs/pull/107 - // We will enforce mocking scheduler with scheduler/unstable_mock at some point. (v17?) - // Till then, we warn about the missing mock, but still fallback to a sync mode compatible version - // For tests, we flush suspense fallbacks in an act scope; - // *except* in some of our own tests, where we test incremental loading states. - // Changes priority of some events like mousemove to user-blocking priority, - // but without making them discrete. The flag exists in case it causes - // starvation problems. - // Add a callback property to suspense to notify which promises are currently - // in the update queue. This allows reporting and tracing of what is causing - // the user to see a loading state. - // Also allows hydration callbacks to fire when a dehydrated boundary gets - // hydrated or deleted. - // Part of the simplification of React.createElement so we can eventually move - // from React.createElement to React.jsx - // https://github.com/reactjs/rfcs/blob/createlement-rfc/text/0000-create-element-changes.md - var DEFAULT_THREAD_ID = 0; // Counters used to generate unique IDs. var interactionIDCounter = 0; @@ -3700,8 +3097,7 @@ if ("development" !== "production") { exports.__interactionsRef = null; // Listener(s) to notify when interactions begin and end. exports.__subscriberRef = null; - - if (enableSchedulerTracing) { + { exports.__interactionsRef = { current: new Set() }; @@ -3711,10 +3107,6 @@ if ("development" !== "production") { } function unstable_clear(callback) { - if (!enableSchedulerTracing) { - return callback(); - } - var prevInteractions = exports.__interactionsRef.current; exports.__interactionsRef.current = new Set(); @@ -3726,9 +3118,7 @@ if ("development" !== "production") { } function unstable_getCurrent() { - if (!enableSchedulerTracing) { - return null; - } else { + { return exports.__interactionsRef.current; } } @@ -3739,11 +3129,6 @@ if ("development" !== "production") { function unstable_trace(name, timestamp, callback) { var threadID = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : DEFAULT_THREAD_ID; - - if (!enableSchedulerTracing) { - return callback(); - } - var interaction = { __count: 1, id: interactionIDCounter++, @@ -3796,11 +3181,6 @@ if ("development" !== "production") { function unstable_wrap(callback) { var threadID = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DEFAULT_THREAD_ID; - - if (!enableSchedulerTracing) { - return callback; - } - var wrappedInteractions = exports.__interactionsRef.current; var subscriber = exports.__subscriberRef.current; @@ -3885,13 +3265,12 @@ if ("development" !== "production") { } var subscribers = null; - - if (enableSchedulerTracing) { + { subscribers = new Set(); } function unstable_subscribe(subscriber) { - if (enableSchedulerTracing) { + { subscribers.add(subscriber); if (subscribers.size === 1) { @@ -3908,7 +3287,7 @@ if ("development" !== "production") { } function unstable_unsubscribe(subscriber) { - if (enableSchedulerTracing) { + { subscribers.delete(subscriber); if (subscribers.size === 0) { @@ -4034,10 +3413,10 @@ if ("development" !== "production") { exports.unstable_clear = unstable_clear; exports.unstable_getCurrent = unstable_getCurrent; exports.unstable_getThreadID = unstable_getThreadID; - exports.unstable_trace = unstable_trace; - exports.unstable_wrap = unstable_wrap; exports.unstable_subscribe = unstable_subscribe; + exports.unstable_trace = unstable_trace; exports.unstable_unsubscribe = unstable_unsubscribe; + exports.unstable_wrap = unstable_wrap; })(); } },{}],"node_modules/react-dom/node_modules/scheduler/tracing.js":[function(require,module,exports) { @@ -4049,7 +3428,7 @@ if ("development" === 'production') { module.exports = require('./cjs/scheduler-tracing.development.js'); } },{"./cjs/scheduler-tracing.development.js":"node_modules/react-dom/node_modules/scheduler/cjs/scheduler-tracing.development.js"}],"node_modules/react-dom/cjs/react-dom.development.js":[function(require,module,exports) { -/** @license React v16.10.2 +/** @license React v16.13.1 * react-dom.development.js * * Copyright (c) Facebook, Inc. and its affiliates. @@ -4071,262 +3450,90 @@ if ("development" !== "production") { var checkPropTypes = require('prop-types/checkPropTypes'); - var tracing = require('scheduler/tracing'); // Do not require this module directly! Use normal `invariant` calls with - // template literal strings. The messages will be converted to ReactError during - // build, and in production they will be minified. - // Do not require this module directly! Use normal `invariant` calls with - // template literal strings. The messages will be converted to ReactError during - // build, and in production they will be minified. + var tracing = require('scheduler/tracing'); + var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; // Prevent newer renderers from RTE when used with older react package versions. + // Current owner and dispatcher used to share the same ref, + // but PR #14548 split them out to better support the react-debug-tools package. - function ReactError(error) { - error.name = 'Invariant Violation'; - return error; + if (!ReactSharedInternals.hasOwnProperty('ReactCurrentDispatcher')) { + ReactSharedInternals.ReactCurrentDispatcher = { + current: null + }; } - /** - * 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. - */ - - - (function () { - if (!React) { - { - throw ReactError(Error("ReactDOM was loaded before React. Make sure you load the React package before loading ReactDOM.")); - } - } - })(); - /** - * 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); + if (!ReactSharedInternals.hasOwnProperty('ReactCurrentBatchConfig')) { + ReactSharedInternals.ReactCurrentBatchConfig = { + suspense: null + }; + } // by calls to these methods by a Babel plugin. + // + // In PROD (or in packages without access to React internals), + // they are left as they are instead. - (function () { - if (!(pluginIndex > -1)) { - { - throw ReactError(Error("EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `" + pluginName + "`.")); - } - } - })(); - if (plugins[pluginIndex]) { - continue; + function warn(format) { + { + for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; } - (function () { - if (!pluginModule.extractEvents) { - { - throw ReactError(Error("EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `" + pluginName + "` does not.")); - } - } - })(); - - plugins[pluginIndex] = pluginModule; - var publishedEvents = pluginModule.eventTypes; - - for (var eventName in publishedEvents) { - (function () { - if (!publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName)) { - { - throw ReactError(Error("EventPluginRegistry: Failed to publish event `" + eventName + "` for plugin `" + pluginName + "`.")); - } - } - })(); - } + printWarning('warn', format, args); } } - /** - * 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) { - (function () { - if (!!eventNameDispatchConfigs.hasOwnProperty(eventName)) { - { - throw ReactError(Error("EventPluginHub: More than one plugin attempted to publish the same event name, `" + eventName + "`.")); - } - } - })(); - 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); - } + function error(format) { + { + for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { + args[_key2 - 1] = arguments[_key2]; } - return true; - } else if (dispatchConfig.registrationName) { - publishRegistrationName(dispatchConfig.registrationName, pluginModule, eventName); - return true; + printWarning('error', format, args); } - - return false; } - /** - * Publishes a registration name that is used to identify dispatched events. - * - * @param {string} registrationName Registration name to add. - * @param {object} PluginModule Plugin publishing the event. - * @private - */ - - - function publishRegistrationName(registrationName, pluginModule, eventName) { - (function () { - if (!!registrationNameModules[registrationName]) { - { - throw ReactError(Error("EventPluginHub: More than one plugin attempted to publish the same registration name, `" + registrationName + "`.")); - } - } - })(); - registrationNameModules[registrationName] = pluginModule; - registrationNameDependencies[registrationName] = pluginModule.eventTypes[eventName].dependencies; + function printWarning(level, format, args) { + // When changing this logic, you might want to also + // update consoleWithStackDev.www.js as well. { - var lowerCasedName = registrationName.toLowerCase(); - possibleRegistrationNames[lowerCasedName] = registrationName; - - if (registrationName === 'onDoubleClick') { - possibleRegistrationNames.ondblclick = registrationName; - } - } - } - /** - * Registers plugins so that they can extract and dispatch events. - * - * @see {EventPluginHub} - */ - - /** - * Ordered list of injected plugins. - */ - - - var plugins = []; - /** - * Mapping from event name to dispatch config - */ - - var eventNameDispatchConfigs = {}; - /** - * Mapping from registration name to plugin module - */ - - var registrationNameModules = {}; - /** - * Mapping from registration name to event name - */ - - var registrationNameDependencies = {}; - /** - * Mapping from lowercase registration names to the properly cased version, - * used to warn in the case of missing event handlers. Available - * only in true. - * @type {Object} - */ - - var possibleRegistrationNames = {}; // Trust the developer to only use possibleRegistrationNames in true + var hasExistingStack = args.length > 0 && typeof args[args.length - 1] === 'string' && args[args.length - 1].indexOf('\n in') === 0; - /** - * 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} - */ + if (!hasExistingStack) { + var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame; + var stack = ReactDebugCurrentFrame.getStackAddendum(); - function injectEventPluginOrder(injectedEventPluginOrder) { - (function () { - if (!!eventPluginOrder) { - { - throw ReactError(Error("EventPluginRegistry: Cannot inject event plugin ordering more than once. You are likely trying to load more than one copy of React.")); + if (stack !== '') { + format += '%s'; + args = args.concat([stack]); } } - })(); // 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} - */ - - - function injectEventPluginsByName(injectedNamesToPlugins) { - var isOrderingDirty = false; - for (var pluginName in injectedNamesToPlugins) { - if (!injectedNamesToPlugins.hasOwnProperty(pluginName)) { - continue; - } + var argsWithFormat = args.map(function (item) { + return '' + item; + }); // Careful: RN currently depends on this prefix - var pluginModule = injectedNamesToPlugins[pluginName]; + argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it + // breaks IE9: https://github.com/facebook/react/issues/13610 + // eslint-disable-next-line react-internal/no-production-logging - if (!namesToPlugins.hasOwnProperty(pluginName) || namesToPlugins[pluginName] !== pluginModule) { - (function () { - if (!!namesToPlugins[pluginName]) { - { - throw ReactError(Error("EventPluginRegistry: Cannot inject two different event plugins using the same name, `" + pluginName + "`.")); - } - } - })(); + Function.prototype.apply.call(console[level], console, argsWithFormat); - namesToPlugins[pluginName] = pluginModule; - isOrderingDirty = true; - } + 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. + var argIndex = 0; + var message = 'Warning: ' + format.replace(/%s/g, function () { + return args[argIndex++]; + }); + throw new Error(message); + } catch (x) {} } + } - if (isOrderingDirty) { - recomputePluginOrdering(); + if (!React) { + { + throw Error("ReactDOM was loaded before React. Make sure you load the React package before loading ReactDOM."); } } @@ -4369,13 +3576,11 @@ if ("development" !== "production") { // when we call document.createEvent(). However this can cause confusing // errors: https://github.com/facebookincubator/create-react-app/issues/3482 // So we preemptively throw with a better message instead. - (function () { - if (!(typeof document !== 'undefined')) { - { - throw ReactError(Error("The `document` global was defined when React was initialized, but is not defined anymore. This can happen in a test environment if a component schedules an update from an asynchronous callback, but the test has already finished running. To solve this, you can either unmount the component at the end of your test (and ensure that any asynchronous operations get canceled in `componentWillUnmount`), or you can change the test itself to be asynchronous.")); - } + if (!(typeof document !== 'undefined')) { + { + throw Error("The `document` global was defined when React was initialized, but is not defined anymore. This can happen in a test environment if a component schedules an update from an asynchronous callback, but the test has already finished running. To solve this, you can either unmount the component at the end of your test (and ensure that any asynchronous operations get canceled in `componentWillUnmount`), or you can change the test itself to be asynchronous."); } - })(); + } var evt = document.createEvent('Event'); // Keeps track of whether the user-provided callback threw an error. We // set this to true at the beginning, then set it to false right after @@ -4565,67 +3770,14 @@ if ("development" !== "production") { caughtError = null; return error; } else { - (function () { + { { - { - throw ReactError(Error("clearCaughtError was called but no error was captured. This error is likely caused by a bug in React. Please file an issue.")); - } + throw Error("clearCaughtError was called but no error was captured. This error is likely caused by a bug in React. Please file an issue."); } - })(); + } } } - /** - * 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 warningWithoutStack = function () {}; - - { - warningWithoutStack = function (condition, format) { - for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { - args[_key - 2] = arguments[_key]; - } - - if (format === undefined) { - throw new Error('`warningWithoutStack(condition, format, ...args)` requires a warning ' + 'message argument'); - } - - if (args.length > 8) { - // Check before the condition to catch violations early. - throw new Error('warningWithoutStack() currently supports at most 8 arguments.'); - } - - if (condition) { - return; - } - - if (typeof console !== 'undefined') { - var argsWithFormat = args.map(function (item) { - return '' + item; - }); - argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it - // breaks IE9: https://github.com/facebook/react/issues/13610 - - Function.prototype.apply.call(console.error, console, argsWithFormat); - } - 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. - var argIndex = 0; - var message = 'Warning: ' + format.replace(/%s/g, function () { - return args[argIndex++]; - }); - throw new Error(message); - } catch (x) {} - }; - } - var warningWithoutStack$1 = warningWithoutStack; var getFiberCurrentPropsFromNode = null; var getInstanceFromNode = null; var getNodeFromInstance = null; @@ -4635,7 +3787,9 @@ if ("development" !== "production") { getInstanceFromNode = getInstanceFromNodeImpl; getNodeFromInstance = getNodeFromInstanceImpl; { - !(getNodeFromInstance && getInstanceFromNode) ? warningWithoutStack$1(false, 'EventPluginUtils.setComponentTree(...): Injected ' + 'module is missing getNodeFromInstance or getInstanceFromNode.') : void 0; + if (!getNodeFromInstance || !getInstanceFromNode) { + error('EventPluginUtils.setComponentTree(...): Injected ' + 'module is missing getNodeFromInstance or getInstanceFromNode.'); + } } } @@ -4648,7 +3802,10 @@ if ("development" !== "production") { var listenersLen = listenersIsArr ? dispatchListeners.length : dispatchListeners ? 1 : 0; var instancesIsArr = Array.isArray(dispatchInstances); var instancesLen = instancesIsArr ? dispatchInstances.length : dispatchInstances ? 1 : 0; - !(instancesIsArr === listenersIsArr && instancesLen === listenersLen) ? warningWithoutStack$1(false, 'EventPluginUtils: Invalid `event`.') : void 0; + + if (instancesIsArr !== listenersIsArr || instancesLen !== listenersLen) { + error('EventPluginUtils: Invalid `event`.'); + } }; } /** @@ -4692,772 +3849,332 @@ if ("development" !== "production") { event._dispatchListeners = null; event._dispatchInstances = null; } - /** - * @see executeDispatchesInOrderStopAtTrueImpl - */ + var FunctionComponent = 0; + var ClassComponent = 1; + var IndeterminateComponent = 2; // Before we know whether it is function or class + + var HostRoot = 3; // Root of a host tree. Could be nested inside another node. + + var HostPortal = 4; // A subtree. Could be an entry point to a different renderer. + + var HostComponent = 5; + var HostText = 6; + var Fragment = 7; + var Mode = 8; + var ContextConsumer = 9; + var ContextProvider = 10; + var ForwardRef = 11; + var Profiler = 12; + var SuspenseComponent = 13; + var MemoComponent = 14; + var SimpleMemoComponent = 15; + var LazyComponent = 16; + var IncompleteClassComponent = 17; + var DehydratedFragment = 18; + var SuspenseListComponent = 19; + var FundamentalComponent = 20; + var ScopeComponent = 21; + var Block = 22; /** - * 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. + * Injectable ordering of event plugins. */ + var eventPluginOrder = null; /** - * @param {SyntheticEvent} event - * @return {boolean} True iff number of dispatches accumulated is greater than 0. + * Injectable mapping from names to event plugin modules. */ + var namesToPlugins = {}; /** - * 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. + * Recomputes the plugin list using the injected plugins and plugin ordering. * - * @return {*|array<*>} An accumulation of items. + * @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); - function accumulateInto(current, next) { - (function () { - if (!(next != null)) { + if (!(pluginIndex > -1)) { { - throw ReactError(Error("accumulateInto(...): Accumulated items must not be null or undefined.")); + throw Error("EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `" + pluginName + "`."); } } - })(); - - 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; + if (plugins[pluginIndex]) { + continue; } - current.push(next); - return current; - } - - if (Array.isArray(next)) { - // A bit too dangerous to mutate `next`. - return [current].concat(next); - } - - return [current, next]; - } - /** - * @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). - * @param {function} cb Callback invoked with each element or a collection. - * @param {?} [scope] Scope used as `this` in a callback. - */ + if (!pluginModule.extractEvents) { + { + throw Error("EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `" + pluginName + "` does not."); + } + } + plugins[pluginIndex] = pluginModule; + var publishedEvents = pluginModule.eventTypes; - function forEachAccumulated(arr, cb, scope) { - if (Array.isArray(arr)) { - arr.forEach(cb, scope); - } else if (arr) { - cb.call(scope, arr); + for (var eventName in publishedEvents) { + if (!publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName)) { + { + throw Error("EventPluginRegistry: Failed to publish event `" + eventName + "` for plugin `" + pluginName + "`."); + } + } + } } } /** - * 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. + * Publishes an event so that it can be dispatched by the supplied plugin. * - * @param {?object} event Synthetic event to be dispatched. + * @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 */ - var executeDispatchesAndRelease = function (event) { - if (event) { - executeDispatchesInOrder(event); - if (!event.isPersistent()) { - event.constructor.release(event); + function publishEventForPlugin(dispatchConfig, pluginModule, eventName) { + if (!!eventNameDispatchConfigs.hasOwnProperty(eventName)) { + { + throw Error("EventPluginRegistry: More than one plugin attempted to publish the same event name, `" + eventName + "`."); } } - }; - - var executeDispatchesAndReleaseTopLevel = function (e) { - return executeDispatchesAndRelease(e); - }; - - function runEventsInBatch(events) { - if (events !== null) { - eventQueue = accumulateInto(eventQueue, events); - } // 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 (!processingEventQueue) { - return; - } - forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseTopLevel); + eventNameDispatchConfigs[eventName] = dispatchConfig; + var phasedRegistrationNames = dispatchConfig.phasedRegistrationNames; - (function () { - if (!!eventQueue) { - { - throw ReactError(Error("processEventQueue(): Additional events were enqueued while processing an event queue. Support for this has not yet been implemented.")); + if (phasedRegistrationNames) { + for (var phaseName in phasedRegistrationNames) { + if (phasedRegistrationNames.hasOwnProperty(phaseName)) { + var phasedRegistrationName = phasedRegistrationNames[phaseName]; + publishRegistrationName(phasedRegistrationName, pluginModule, eventName); } } - })(); // This would be a good time to rethrow if any of the event handlers threw. + return true; + } else if (dispatchConfig.registrationName) { + publishRegistrationName(dispatchConfig.registrationName, pluginModule, eventName); + return true; + } - rethrowCaughtError(); + return false; } + /** + * Publishes a registration name that is used to identify dispatched events. + * + * @param {string} registrationName Registration name to add. + * @param {object} PluginModule Plugin publishing the event. + * @private + */ - 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)); + function publishRegistrationName(registrationName, pluginModule, eventName) { + if (!!registrationNameModules[registrationName]) { + { + throw Error("EventPluginRegistry: More than one plugin attempted to publish the same registration name, `" + registrationName + "`."); + } + } - default: - return false; + registrationNameModules[registrationName] = pluginModule; + registrationNameDependencies[registrationName] = pluginModule.eventTypes[eventName].dependencies; + { + var lowerCasedName = registrationName.toLowerCase(); + possibleRegistrationNames[lowerCasedName] = registrationName; + + if (registrationName === 'onDoubleClick') { + possibleRegistrationNames.ondblclick = registrationName; + } } } /** - * 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 + * Registers plugins so that they can extract and dispatch events. */ /** - * Methods for injecting dependencies. + * Ordered list of injected plugins. */ - var injection = { - /** - * @param {array} InjectedEventPluginOrder - * @public - */ - injectEventPluginOrder: injectEventPluginOrder, - - /** - * @param {object} injectedNamesToPlugins Map from names to plugin modules. - */ - injectEventPluginsByName: injectEventPluginsByName - }; + var plugins = []; /** - * @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. + * Mapping from event name to dispatch config */ - function getListener(inst, registrationName) { - var listener; // TODO: shouldPreventMouseEvent is DOM-specific and definitely should not - // live here; needs to be moved to a better place soon - - var stateNode = inst.stateNode; - - if (!stateNode) { - // Work in progress (ex: onload events in incremental mode). - return null; - } + var eventNameDispatchConfigs = {}; + /** + * Mapping from registration name to plugin module + */ - var props = getFiberCurrentPropsFromNode(stateNode); + var registrationNameModules = {}; + /** + * Mapping from registration name to event name + */ - if (!props) { - // Work in progress. - return null; - } + var registrationNameDependencies = {}; + /** + * Mapping from lowercase registration names to the properly cased version, + * used to warn in the case of missing event handlers. Available + * only in true. + * @type {Object} + */ - listener = props[registrationName]; + var possibleRegistrationNames = {}; // Trust the developer to only use possibleRegistrationNames in true - if (shouldPreventMouseEvent(registrationName, inst.type, props)) { - return null; - } + /** + * 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 + */ - (function () { - if (!(!listener || typeof listener === 'function')) { - { - throw ReactError(Error("Expected `" + registrationName + "` listener to be a function, instead got a value of `" + typeof listener + "` type.")); - } + function injectEventPluginOrder(injectedEventPluginOrder) { + if (!!eventPluginOrder) { + { + throw Error("EventPluginRegistry: Cannot inject event plugin ordering more than once. You are likely trying to load more than one copy of React."); } - })(); + } // Clone the ordering so it cannot be dynamically mutated. - return listener; + + eventPluginOrder = Array.prototype.slice.call(injectedEventPluginOrder); + recomputePluginOrdering(); } /** - * Allows registered plugins an opportunity to extract events from top-level - * native browser events. + * Injects plugins to be used by plugin event system. The plugin names must be + * in the ordering injected by `injectEventPluginOrder`. * - * @return {*} An accumulation of synthetic events. + * Plugins can be injected as part of page initialization or on-the-fly. + * + * @param {object} injectedNamesToPlugins Map from names to plugin modules. * @internal */ - function extractPluginEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags) { - var events = null; + function injectEventPluginsByName(injectedNamesToPlugins) { + var isOrderingDirty = false; - for (var i = 0; i < plugins.length; i++) { - // Not every plugin in the ordering may be loaded at runtime. - var possiblePlugin = plugins[i]; + for (var pluginName in injectedNamesToPlugins) { + if (!injectedNamesToPlugins.hasOwnProperty(pluginName)) { + continue; + } - if (possiblePlugin) { - var extractedEvents = possiblePlugin.extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags); + var pluginModule = injectedNamesToPlugins[pluginName]; - if (extractedEvents) { - events = accumulateInto(events, extractedEvents); + if (!namesToPlugins.hasOwnProperty(pluginName) || namesToPlugins[pluginName] !== pluginModule) { + if (!!namesToPlugins[pluginName]) { + { + throw Error("EventPluginRegistry: Cannot inject two different event plugins using the same name, `" + pluginName + "`."); + } } + + namesToPlugins[pluginName] = pluginModule; + isOrderingDirty = true; } } - return events; + if (isOrderingDirty) { + recomputePluginOrdering(); + } } - function runExtractedPluginEventsInBatch(topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags) { - var events = extractPluginEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags); - runEventsInBatch(events); - } + var canUseDOM = !!(typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined'); + var PLUGIN_EVENT_SYSTEM = 1; + var IS_REPLAYED = 1 << 5; + var IS_FIRST_ANCESTOR = 1 << 6; + var restoreImpl = null; + var restoreTarget = null; + var restoreQueue = null; - var FunctionComponent = 0; - var ClassComponent = 1; - var IndeterminateComponent = 2; // Before we know whether it is function or class + function restoreStateOfTarget(target) { + // We perform this translation at the end of the event loop so that we + // always receive the correct fiber here + var internalInstance = getInstanceFromNode(target); - var HostRoot = 3; // Root of a host tree. Could be nested inside another node. + if (!internalInstance) { + // Unmounted + return; + } - var HostPortal = 4; // A subtree. Could be an entry point to a different renderer. + if (!(typeof restoreImpl === 'function')) { + { + throw Error("setRestoreImplementation() needs to be called to handle a target for controlled events. This error is likely caused by a bug in React. Please file an issue."); + } + } - var HostComponent = 5; - var HostText = 6; - var Fragment = 7; - var Mode = 8; - var ContextConsumer = 9; - var ContextProvider = 10; - var ForwardRef = 11; - var Profiler = 12; - var SuspenseComponent = 13; - var MemoComponent = 14; - var SimpleMemoComponent = 15; - var LazyComponent = 16; - var IncompleteClassComponent = 17; - var DehydratedFragment = 18; - var SuspenseListComponent = 19; - var FundamentalComponent = 20; - var ScopeComponent = 21; - var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; // Prevent newer renderers from RTE when used with older react package versions. - // Current owner and dispatcher used to share the same ref, - // but PR #14548 split them out to better support the react-debug-tools package. + var stateNode = internalInstance.stateNode; // Guard against Fiber being unmounted. - if (!ReactSharedInternals.hasOwnProperty('ReactCurrentDispatcher')) { - ReactSharedInternals.ReactCurrentDispatcher = { - current: null - }; - } + if (stateNode) { + var _props = getFiberCurrentPropsFromNode(stateNode); - if (!ReactSharedInternals.hasOwnProperty('ReactCurrentBatchConfig')) { - ReactSharedInternals.ReactCurrentBatchConfig = { - suspense: null - }; + restoreImpl(internalInstance.stateNode, internalInstance.type, _props); + } } - var BEFORE_SLASH_RE = /^(.*)[\\\/]/; - - var describeComponentFrame = function (name, source, ownerName) { - var sourceInfo = ''; - - if (source) { - var path = source.fileName; - var fileName = path.replace(BEFORE_SLASH_RE, ''); - { - // In DEV, include code for a common special case: - // prefer "folder/index.js" instead of just "index.js". - if (/^index\./.test(fileName)) { - var match = path.match(BEFORE_SLASH_RE); - - if (match) { - var pathBeforeSlash = match[1]; + function setRestoreImplementation(impl) { + restoreImpl = impl; + } - if (pathBeforeSlash) { - var folderName = pathBeforeSlash.replace(BEFORE_SLASH_RE, ''); - fileName = folderName + '/' + fileName; - } - } - } + function enqueueStateRestore(target) { + if (restoreTarget) { + if (restoreQueue) { + restoreQueue.push(target); + } else { + restoreQueue = [target]; } - sourceInfo = ' (at ' + fileName + ':' + source.lineNumber + ')'; - } else if (ownerName) { - sourceInfo = ' (created by ' + ownerName + ')'; + } else { + restoreTarget = target; } + } - return '\n in ' + (name || 'Unknown') + sourceInfo; - }; // The Symbol used to tag the ReactElement-like types. If there is no native Symbol - // nor polyfill, then a plain number is used for performance. - - - var hasSymbol = typeof Symbol === 'function' && Symbol.for; - var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7; - var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca; - var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb; - var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc; - var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2; - var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd; - var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary - // (unstable) APIs that have been removed. Can we remove the symbols? - - var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf; - var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0; - var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1; - var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8; - var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3; - var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4; - var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5; - var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6; - var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7; - var MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator; - var FAUX_ITERATOR_SYMBOL = '@@iterator'; + function needsStateRestore() { + return restoreTarget !== null || restoreQueue !== null; + } - function getIteratorFn(maybeIterable) { - if (maybeIterable === null || typeof maybeIterable !== 'object') { - return null; + function restoreStateIfNeeded() { + if (!restoreTarget) { + return; } - var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]; + var target = restoreTarget; + var queuedTargets = restoreQueue; + restoreTarget = null; + restoreQueue = null; + restoreStateOfTarget(target); - if (typeof maybeIterator === 'function') { - return maybeIterator; + if (queuedTargets) { + for (var i = 0; i < queuedTargets.length; i++) { + restoreStateOfTarget(queuedTargets[i]); + } } - - return null; } - /** - * 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 enableProfilerTimer = true; // Trace which interactions trigger each commit. - var warning = warningWithoutStack$1; - { - warning = function (condition, format) { - if (condition) { - return; - } + var enableDeprecatedFlareAPI = false; // Experimental Host Component support. - var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame; - var stack = ReactDebugCurrentFrame.getStackAddendum(); // eslint-disable-next-line react-internal/warning-and-invariant-args + var enableFundamentalAPI = false; // Experimental Scope support. - for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { - args[_key - 2] = arguments[_key]; - } + var warnAboutStringRefs = false; // the renderer. Such as when we're dispatching events or if third party + // libraries need to call batchedUpdates. Eventually, this API will go away when + // everything is batched by default. We'll then have a similar API to opt-out of + // scheduled work and instead do synchronous work. + // Defaults - warningWithoutStack$1.apply(void 0, [false, format + '%s'].concat(args, [stack])); - }; - } - var warning$1 = warning; - var Uninitialized = -1; - var Pending = 0; - var Resolved = 1; - var Rejected = 2; + var batchedUpdatesImpl = function (fn, bookkeeping) { + return fn(bookkeeping); + }; - function refineResolvedLazyComponent(lazyComponent) { - return lazyComponent._status === Resolved ? lazyComponent._result : null; - } - - function initializeLazyComponentType(lazyComponent) { - if (lazyComponent._status === Uninitialized) { - lazyComponent._status = Pending; - var ctor = lazyComponent._ctor; - var thenable = ctor(); - lazyComponent._result = thenable; - thenable.then(function (moduleObject) { - if (lazyComponent._status === Pending) { - var defaultExport = moduleObject.default; - { - if (defaultExport === undefined) { - warning$1(false, 'lazy: Expected the result of a dynamic import() call. ' + 'Instead received: %s\n\nYour code should look like: \n ' + "const MyComponent = lazy(() => import('./MyComponent'))", moduleObject); - } - } - lazyComponent._status = Resolved; - lazyComponent._result = defaultExport; - } - }, function (error) { - if (lazyComponent._status === Pending) { - lazyComponent._status = Rejected; - lazyComponent._result = error; - } - }); - } - } - - function getWrappedName(outerType, innerType, wrapperName) { - var functionName = innerType.displayName || innerType.name || ''; - return outerType.displayName || (functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName); - } - - function getComponentName(type) { - if (type == null) { - // Host root, text node or just invalid type. - return null; - } - - { - if (typeof type.tag === 'number') { - warningWithoutStack$1(false, 'Received an unexpected object in getComponentName(). ' + 'This is likely a bug in React. Please file an issue.'); - } - } - - if (typeof type === 'function') { - return type.displayName || type.name || null; - } - - if (typeof type === 'string') { - return type; - } - - switch (type) { - case REACT_FRAGMENT_TYPE: - return 'Fragment'; - - case REACT_PORTAL_TYPE: - return 'Portal'; - - case REACT_PROFILER_TYPE: - return "Profiler"; - - case REACT_STRICT_MODE_TYPE: - return 'StrictMode'; - - case REACT_SUSPENSE_TYPE: - return 'Suspense'; - - case REACT_SUSPENSE_LIST_TYPE: - return 'SuspenseList'; - } - - if (typeof type === 'object') { - switch (type.$$typeof) { - case REACT_CONTEXT_TYPE: - return 'Context.Consumer'; - - case REACT_PROVIDER_TYPE: - return 'Context.Provider'; - - case REACT_FORWARD_REF_TYPE: - return getWrappedName(type, type.render, 'ForwardRef'); - - case REACT_MEMO_TYPE: - return getComponentName(type.type); - - case REACT_LAZY_TYPE: - { - var thenable = type; - var resolvedThenable = refineResolvedLazyComponent(thenable); - - if (resolvedThenable) { - return getComponentName(resolvedThenable); - } - - break; - } - } - } - - return null; - } - - var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame; - - function describeFiber(fiber) { - switch (fiber.tag) { - case HostRoot: - case HostPortal: - case HostText: - case Fragment: - case ContextProvider: - case ContextConsumer: - return ''; - - default: - var owner = fiber._debugOwner; - var source = fiber._debugSource; - var name = getComponentName(fiber.type); - var ownerName = null; - - if (owner) { - ownerName = getComponentName(owner.type); - } - - return describeComponentFrame(name, source, ownerName); - } - } - - function getStackByFiberInDevAndProd(workInProgress) { - var info = ''; - var node = workInProgress; - - do { - info += describeFiber(node); - node = node.return; - } while (node); - - return info; - } - - var current = null; - var phase = null; - - function getCurrentFiberOwnerNameInDevOrNull() { - { - if (current === null) { - return null; - } - - var owner = current._debugOwner; - - if (owner !== null && typeof owner !== 'undefined') { - return getComponentName(owner.type); - } - } - return null; - } - - function getCurrentFiberStackInDev() { - { - if (current === null) { - return ''; - } // Safe because if current fiber exists, we are reconciling, - // and it is guaranteed to be the work-in-progress version. - - - return getStackByFiberInDevAndProd(current); - } - return ''; - } - - function resetCurrentFiber() { - { - ReactDebugCurrentFrame.getCurrentStack = null; - current = null; - phase = null; - } - } - - function setCurrentFiber(fiber) { - { - ReactDebugCurrentFrame.getCurrentStack = getCurrentFiberStackInDev; - current = fiber; - phase = null; - } - } - - function setCurrentPhase(lifeCyclePhase) { - { - phase = lifeCyclePhase; - } - } - - var canUseDOM = !!(typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined'); - - function endsWith(subject, search) { - var length = subject.length; - return subject.substring(length - search.length, length) === search; - } - - var PLUGIN_EVENT_SYSTEM = 1; - var RESPONDER_EVENT_SYSTEM = 1 << 1; - var IS_PASSIVE = 1 << 2; - var IS_ACTIVE = 1 << 3; - var PASSIVE_NOT_SUPPORTED = 1 << 4; - var IS_REPLAYED = 1 << 5; - var restoreImpl = null; - var restoreTarget = null; - var restoreQueue = null; - - function restoreStateOfTarget(target) { - // We perform this translation at the end of the event loop so that we - // always receive the correct fiber here - var internalInstance = getInstanceFromNode(target); - - if (!internalInstance) { - // Unmounted - return; - } - - (function () { - if (!(typeof restoreImpl === 'function')) { - { - throw ReactError(Error("setRestoreImplementation() needs to be called to handle a target for controlled events. This error is likely caused by a bug in React. Please file an issue.")); - } - } - })(); - - var props = getFiberCurrentPropsFromNode(internalInstance.stateNode); - restoreImpl(internalInstance.stateNode, internalInstance.type, props); - } - - function setRestoreImplementation(impl) { - restoreImpl = impl; - } - - function enqueueStateRestore(target) { - if (restoreTarget) { - if (restoreQueue) { - restoreQueue.push(target); - } else { - restoreQueue = [target]; - } - } else { - restoreTarget = target; - } - } - - function needsStateRestore() { - return restoreTarget !== null || restoreQueue !== null; - } - - function restoreStateIfNeeded() { - if (!restoreTarget) { - return; - } - - var target = restoreTarget; - var queuedTargets = restoreQueue; - restoreTarget = null; - restoreQueue = null; - restoreStateOfTarget(target); - - if (queuedTargets) { - for (var i = 0; i < queuedTargets.length; i++) { - restoreStateOfTarget(queuedTargets[i]); - } - } - } - - var enableUserTimingAPI = true; // Helps identify side effects in begin-phase lifecycle hooks and setState reducers: - - var debugRenderPhaseSideEffects = false; // In some cases, StrictMode should also double-render lifecycles. - // This can be confusing for tests though, - // And it can be bad for performance in production. - // This feature flag can be used to control the behavior: - - var debugRenderPhaseSideEffectsForStrictMode = true; // To preserve the "Pause on caught exceptions" behavior of the debugger, we - // replay the begin phase of a failed component inside invokeGuardedCallback. - - var replayFailedUnitOfWorkWithInvokeGuardedCallback = true; // Warn about deprecated, async-unsafe lifecycles; relates to RFC #6: - - var warnAboutDeprecatedLifecycles = true; // Gather advanced timing metrics for Profiler subtrees. - - var enableProfilerTimer = true; // Trace which interactions trigger each commit. - - var enableSchedulerTracing = true; // Only used in www builds. - - var enableSuspenseServerRenderer = false; // TODO: true? Here it might just be false. - - var enableSelectiveHydration = false; // Only used in www builds. - // Only used in www builds. - // Disable javascript: URL strings in href for XSS protection. - - var disableJavaScriptURLs = false; // React Fire: prevent the value and checked attributes from syncing - // with their related DOM properties - - var disableInputAttributeSyncing = false; // These APIs will no longer be "unstable" in the upcoming 16.7 release, - // Control this behavior with a flag to support 16.6 minor releases in the meanwhile. - - var enableStableConcurrentModeAPIs = false; - var warnAboutShorthandPropertyCollision = false; // See https://github.com/react-native-community/discussions-and-proposals/issues/72 for more information - // This is a flag so we can fix warnings in RN core before turning it on - // Experimental React Flare event system and event components support. - - var enableFlareAPI = false; // Experimental Host Component support. - - var enableFundamentalAPI = false; // Experimental Scope support. - - var enableScopeAPI = false; // New API for JSX transforms to target - https://github.com/reactjs/rfcs/pull/107 - // We will enforce mocking scheduler with scheduler/unstable_mock at some point. (v17?) - // Till then, we warn about the missing mock, but still fallback to a sync mode compatible version - - var warnAboutUnmockedScheduler = false; // For tests, we flush suspense fallbacks in an act scope; - // *except* in some of our own tests, where we test incremental loading states. - - var flushSuspenseFallbacksInTests = true; // Changes priority of some events like mousemove to user-blocking priority, - // but without making them discrete. The flag exists in case it causes - // starvation problems. - - var enableUserBlockingEvents = false; // Add a callback property to suspense to notify which promises are currently - // in the update queue. This allows reporting and tracing of what is causing - // the user to see a loading state. - // Also allows hydration callbacks to fire when a dehydrated boundary gets - // hydrated or deleted. - - var enableSuspenseCallback = false; // Part of the simplification of React.createElement so we can eventually move - // from React.createElement to React.jsx - // https://github.com/reactjs/rfcs/blob/createlement-rfc/text/0000-create-element-changes.md - - var warnAboutDefaultPropsOnFunctionComponents = false; - var warnAboutStringRefs = false; - var disableLegacyContext = false; - var disableSchedulerTimeoutBasedOnReactExpirationTime = false; - var enableTrustedTypesIntegration = false; // the renderer. Such as when we're dispatching events or if third party - // libraries need to call batchedUpdates. Eventually, this API will go away when - // everything is batched by default. We'll then have a similar API to opt-out of - // scheduled work and instead do synchronous work. - // Defaults - - var batchedUpdatesImpl = function (fn, bookkeeping) { - return fn(bookkeeping); - }; - - var discreteUpdatesImpl = function (fn, a, b, c) { - return fn(a, b, c); - }; + var discreteUpdatesImpl = function (fn, a, b, c, d) { + return fn(a, b, c, d); + }; var flushDiscreteUpdatesImpl = function () {}; @@ -5516,24 +4233,12 @@ if ("development" !== "production") { } // This is for the React Flare event system - function executeUserEventHandler(fn, value) { - var previouslyInEventHandler = isInsideEventHandler; - - try { - isInsideEventHandler = true; - var type = typeof value === 'object' && value !== null ? value.type : ''; - invokeGuardedCallbackAndCatchFirstError(type, fn, undefined, value); - } finally { - isInsideEventHandler = previouslyInEventHandler; - } - } - - function discreteUpdates(fn, a, b, c) { + function discreteUpdates(fn, a, b, c, d) { var prevIsInsideEventHandler = isInsideEventHandler; isInsideEventHandler = true; try { - return discreteUpdatesImpl(fn, a, b, c); + return discreteUpdatesImpl(fn, a, b, c, d); } finally { isInsideEventHandler = prevIsInsideEventHandler; @@ -5543,8 +4248,6 @@ if ("development" !== "production") { } } - var lastFlushedEventTimeStamp = 0; - function flushDiscreteUpdatesIfNeeded(timeStamp) { // event.timeStamp isn't overly reliable due to inconsistencies in // how different browsers have historically provided the time stamp. @@ -5558,8 +4261,7 @@ if ("development" !== "production") { // such as if an earlier flush removes or adds event listeners that // are fired in the subsequent flush. However, this is the same // behaviour as we had before this change, so the risks are low. - if (!isInsideEventHandler && (!enableFlareAPI || timeStamp === 0 || lastFlushedEventTimeStamp !== timeStamp)) { - lastFlushedEventTimeStamp = timeStamp; + if (!isInsideEventHandler && !enableDeprecatedFlareAPI) { flushDiscreteUpdatesImpl(); } } @@ -5573,732 +4275,169 @@ if ("development" !== "production") { var DiscreteEvent = 0; var UserBlockingEvent = 1; - var ContinuousEvent = 2; // CommonJS interop named imports. - - var UserBlockingPriority = Scheduler.unstable_UserBlockingPriority; - var runWithPriority = Scheduler.unstable_runWithPriority; - var listenToResponderEventTypesImpl; - - function setListenToResponderEventTypes(_listenToResponderEventTypesImpl) { - listenToResponderEventTypesImpl = _listenToResponderEventTypesImpl; - } - - var activeTimeouts = new Map(); - var rootEventTypesToEventResponderInstances = new Map(); - var DoNotPropagateToNextResponder = 0; - var PropagateToNextResponder = 1; - var currentTimeStamp = 0; - var currentTimers = new Map(); - var currentInstance = null; - var currentTimerIDCounter = 0; - var currentDocument = null; - var currentPropagationBehavior = DoNotPropagateToNextResponder; - var eventResponderContext = { - dispatchEvent: function (eventValue, eventListener, eventPriority) { - validateResponderContext(); - validateEventValue(eventValue); - - switch (eventPriority) { - case DiscreteEvent: - { - flushDiscreteUpdatesIfNeeded(currentTimeStamp); - discreteUpdates(function () { - return executeUserEventHandler(eventListener, eventValue); - }); - break; - } - - case UserBlockingEvent: - { - if (enableUserBlockingEvents) { - runWithPriority(UserBlockingPriority, function () { - return executeUserEventHandler(eventListener, eventValue); - }); - } else { - executeUserEventHandler(eventListener, eventValue); - } + var ContinuousEvent = 2; // A reserved attribute. + // It is handled by React separately and shouldn't be written to the DOM. - break; - } + var RESERVED = 0; // A simple string attribute. + // Attributes that aren't in the whitelist are presumed to have this type. - case ContinuousEvent: - { - executeUserEventHandler(eventListener, eventValue); - break; - } - } - }, - isTargetWithinResponder: function (target) { - validateResponderContext(); + var STRING = 1; // A string attribute that accepts booleans in React. In HTML, these are called + // "enumerated" attributes with "true" and "false" as possible values. + // When true, it should be set to a "true" string. + // When false, it should be set to a "false" string. - if (target != null) { - var fiber = getClosestInstanceFromNode(target); - var responderFiber = currentInstance.fiber; + var BOOLEANISH_STRING = 2; // A real boolean attribute. + // When true, it should be present (set either to an empty string or its name). + // When false, it should be omitted. - while (fiber !== null) { - if (fiber === responderFiber || fiber.alternate === responderFiber) { - return true; - } + var BOOLEAN = 3; // An attribute that can be used as a flag as well as with a value. + // When true, it should be present (set either to an empty string or its name). + // When false, it should be omitted. + // For any other value, should be present with that value. - fiber = fiber.return; - } - } + var OVERLOADED_BOOLEAN = 4; // An attribute that must be numeric or parse as a numeric. + // When falsy, it should be removed. - return false; - }, - isTargetWithinResponderScope: function (target) { - validateResponderContext(); - var componentInstance = currentInstance; - var responder = componentInstance.responder; + var NUMERIC = 5; // An attribute that must be positive numeric or parse as a positive numeric. + // When falsy, it should be removed. - if (target != null) { - var fiber = getClosestInstanceFromNode(target); - var responderFiber = currentInstance.fiber; + var POSITIVE_NUMERIC = 6; + /* eslint-disable max-len */ - while (fiber !== null) { - if (fiber === responderFiber || fiber.alternate === responderFiber) { - return true; - } + 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 */ - if (doesFiberHaveResponder(fiber, responder)) { - return false; - } + var ATTRIBUTE_NAME_CHAR = ATTRIBUTE_NAME_START_CHAR + "\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040"; + var ROOT_ATTRIBUTE_NAME = 'data-reactroot'; + var VALID_ATTRIBUTE_NAME_REGEX = new RegExp('^[' + ATTRIBUTE_NAME_START_CHAR + '][' + ATTRIBUTE_NAME_CHAR + ']*$'); + var hasOwnProperty = Object.prototype.hasOwnProperty; + var illegalAttributeNameCache = {}; + var validatedAttributeNameCache = {}; - fiber = fiber.return; - } - } + function isAttributeNameSafe(attributeName) { + if (hasOwnProperty.call(validatedAttributeNameCache, attributeName)) { + return true; + } + if (hasOwnProperty.call(illegalAttributeNameCache, attributeName)) { return false; - }, - isTargetWithinNode: function (childTarget, parentTarget) { - validateResponderContext(); - var childFiber = getClosestInstanceFromNode(childTarget); - var parentFiber = getClosestInstanceFromNode(parentTarget); - - if (childFiber != null && parentFiber != null) { - var parentAlternateFiber = parentFiber.alternate; - var node = childFiber; - - while (node !== null) { - if (node === parentFiber || node === parentAlternateFiber) { - return true; - } - - node = node.return; - } - - return false; - } // Fallback to DOM APIs - - - return parentTarget.contains(childTarget); - }, - addRootEventTypes: function (rootEventTypes) { - validateResponderContext(); - listenToResponderEventTypesImpl(rootEventTypes, currentDocument); - - for (var i = 0; i < rootEventTypes.length; i++) { - var rootEventType = rootEventTypes[i]; - var eventResponderInstance = currentInstance; - registerRootEventType(rootEventType, eventResponderInstance); - } - }, - removeRootEventTypes: function (rootEventTypes) { - validateResponderContext(); - - for (var i = 0; i < rootEventTypes.length; i++) { - var rootEventType = rootEventTypes[i]; - var rootEventResponders = rootEventTypesToEventResponderInstances.get(rootEventType); - var rootEventTypesSet = currentInstance.rootEventTypes; - - if (rootEventTypesSet !== null) { - rootEventTypesSet.delete(rootEventType); - } - - if (rootEventResponders !== undefined) { - rootEventResponders.delete(currentInstance); - } - } - }, - setTimeout: function (func, delay) { - validateResponderContext(); - - if (currentTimers === null) { - currentTimers = new Map(); - } - - var timeout = currentTimers.get(delay); - var timerId = currentTimerIDCounter++; - - if (timeout === undefined) { - var timers = new Map(); - var id = setTimeout(function () { - processTimers(timers, delay); - }, delay); - timeout = { - id: id, - timers: timers - }; - currentTimers.set(delay, timeout); - } - - timeout.timers.set(timerId, { - instance: currentInstance, - func: func, - id: timerId, - timeStamp: currentTimeStamp - }); - activeTimeouts.set(timerId, timeout); - return timerId; - }, - clearTimeout: function (timerId) { - validateResponderContext(); - var timeout = activeTimeouts.get(timerId); - - if (timeout !== undefined) { - var timers = timeout.timers; - timers.delete(timerId); + } - if (timers.size === 0) { - clearTimeout(timeout.id); - } - } - }, - getActiveDocument: getActiveDocument, - objectAssign: _assign, - getTimeStamp: function () { - validateResponderContext(); - return currentTimeStamp; - }, - isTargetWithinHostComponent: function (target, elementType) { - validateResponderContext(); - var fiber = getClosestInstanceFromNode(target); + if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName)) { + validatedAttributeNameCache[attributeName] = true; + return true; + } - while (fiber !== null) { - if (fiber.tag === HostComponent && fiber.type === elementType) { - return true; - } + illegalAttributeNameCache[attributeName] = true; + { + error('Invalid attribute name: `%s`', attributeName); + } + return false; + } - fiber = fiber.return; - } + function shouldIgnoreAttribute(name, propertyInfo, isCustomComponentTag) { + if (propertyInfo !== null) { + return propertyInfo.type === RESERVED; + } + if (isCustomComponentTag) { return false; - }, - continuePropagation: function () { - currentPropagationBehavior = PropagateToNextResponder; - }, - enqueueStateRestore: enqueueStateRestore, - getResponderNode: function () { - validateResponderContext(); - var responderFiber = currentInstance.fiber; - - if (responderFiber.tag === ScopeComponent) { - return null; - } + } - return responderFiber.stateNode; + if (name.length > 2 && (name[0] === 'o' || name[0] === 'O') && (name[1] === 'n' || name[1] === 'N')) { + return true; } - }; - function validateEventValue(eventValue) { - if (typeof eventValue === 'object' && eventValue !== null) { - var target = eventValue.target, - type = eventValue.type, - timeStamp = eventValue.timeStamp; + return false; + } - if (target == null || type == null || timeStamp == null) { - throw new Error('context.dispatchEvent: "target", "timeStamp", and "type" fields on event object are required.'); - } + function shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag) { + if (propertyInfo !== null && propertyInfo.type === RESERVED) { + return false; + } - var showWarning = function (name) { - { - warning$1(false, '%s is not available on event objects created from event responder modules (React Flare). ' + 'Try wrapping in a conditional, i.e. `if (event.type !== "press") { event.%s }`', name, name); - } - }; + switch (typeof value) { + case 'function': // $FlowIssue symbol is perfectly valid here - eventValue.isDefaultPrevented = function () { - { - showWarning('isDefaultPrevented()'); - } - }; + case 'symbol': + // eslint-disable-line + return true; - eventValue.isPropagationStopped = function () { + case 'boolean': { - showWarning('isPropagationStopped()'); - } - }; // $FlowFixMe: we don't need value, Flow thinks we do - + if (isCustomComponentTag) { + return false; + } - Object.defineProperty(eventValue, 'nativeEvent', { - get: function () { - { - showWarning('nativeEvent'); + if (propertyInfo !== null) { + return !propertyInfo.acceptsBooleans; + } else { + var prefix = name.toLowerCase().slice(0, 5); + return prefix !== 'data-' && prefix !== 'aria-'; } } - }); - } - } - function doesFiberHaveResponder(fiber, responder) { - var tag = fiber.tag; - - if (tag === HostComponent || tag === ScopeComponent) { - var dependencies = fiber.dependencies; - - if (dependencies !== null) { - var respondersMap = dependencies.responders; - - if (respondersMap !== null && respondersMap.has(responder)) { - return true; - } - } + default: + return false; } - - return false; - } - - function getActiveDocument() { - return currentDocument; } - function processTimers(timers, delay) { - var timersArr = Array.from(timers.values()); - var previousInstance = currentInstance; - var previousTimers = currentTimers; + function shouldRemoveAttribute(name, value, propertyInfo, isCustomComponentTag) { + if (value === null || typeof value === 'undefined') { + return true; + } - try { - batchedEventUpdates(function () { - for (var i = 0; i < timersArr.length; i++) { - var _timersArr$i = timersArr[i], - instance = _timersArr$i.instance, - func = _timersArr$i.func, - id = _timersArr$i.id, - timeStamp = _timersArr$i.timeStamp; - currentInstance = instance; - currentTimeStamp = timeStamp + delay; + if (shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag)) { + return true; + } - try { - func(); - } finally { - activeTimeouts.delete(id); - } - } - }); - } finally { - currentTimers = previousTimers; - currentInstance = previousInstance; - currentTimeStamp = 0; + if (isCustomComponentTag) { + return false; } - } - function createDOMResponderEvent(topLevelType, nativeEvent, nativeEventTarget, passive, passiveSupported) { - var _ref = nativeEvent, - buttons = _ref.buttons, - pointerType = _ref.pointerType; - var eventPointerType = ''; + if (propertyInfo !== null) { + switch (propertyInfo.type) { + case BOOLEAN: + return !value; - if (pointerType !== undefined) { - eventPointerType = pointerType; - } else if (nativeEvent.key !== undefined) { - eventPointerType = 'keyboard'; - } else if (buttons !== undefined) { - eventPointerType = 'mouse'; - } else if (nativeEvent.changedTouches !== undefined) { - eventPointerType = 'touch'; - } + case OVERLOADED_BOOLEAN: + return value === false; - return { - nativeEvent: nativeEvent, - passive: passive, - passiveSupported: passiveSupported, - pointerType: eventPointerType, - target: nativeEventTarget, - type: topLevelType - }; - } + case NUMERIC: + return isNaN(value); - function responderEventTypesContainType(eventTypes, type) { - for (var i = 0, len = eventTypes.length; i < len; i++) { - if (eventTypes[i] === type) { - return true; + case POSITIVE_NUMERIC: + return isNaN(value) || value < 1; } } return false; } - function validateResponderTargetEventTypes(eventType, responder) { - var targetEventTypes = responder.targetEventTypes; // Validate the target event type exists on the responder - - if (targetEventTypes !== null) { - return responderEventTypesContainType(targetEventTypes, eventType); - } - - return false; + function getPropertyInfo(name) { + return properties.hasOwnProperty(name) ? properties[name] : null; } - function traverseAndHandleEventResponderInstances(topLevelType, targetFiber, nativeEvent, nativeEventTarget, eventSystemFlags) { - var isPassiveEvent = (eventSystemFlags & IS_PASSIVE) !== 0; - var isPassiveSupported = (eventSystemFlags & PASSIVE_NOT_SUPPORTED) === 0; - var isPassive = isPassiveEvent || !isPassiveSupported; - var eventType = isPassive ? topLevelType : topLevelType + '_active'; // Trigger event responders in this order: - // - Bubble target responder phase - // - Root responder phase - - var visitedResponders = new Set(); - var responderEvent = createDOMResponderEvent(topLevelType, nativeEvent, nativeEventTarget, isPassiveEvent, isPassiveSupported); - var node = targetFiber; - var insidePortal = false; - - while (node !== null) { - var _node = node, - dependencies = _node.dependencies, - tag = _node.tag; - - if (tag === HostPortal) { - insidePortal = true; - } else if ((tag === HostComponent || tag === ScopeComponent) && dependencies !== null) { - var respondersMap = dependencies.responders; - - if (respondersMap !== null) { - var responderInstances = Array.from(respondersMap.values()); - - for (var i = 0, length = responderInstances.length; i < length; i++) { - var responderInstance = responderInstances[i]; - var props = responderInstance.props, - responder = responderInstance.responder, - state = responderInstance.state; - - if (!visitedResponders.has(responder) && validateResponderTargetEventTypes(eventType, responder) && (!insidePortal || responder.targetPortalPropagation)) { - visitedResponders.add(responder); - var onEvent = responder.onEvent; - - if (onEvent !== null) { - currentInstance = responderInstance; - onEvent(responderEvent, eventResponderContext, props, state); - - if (currentPropagationBehavior === PropagateToNextResponder) { - visitedResponders.delete(responder); - currentPropagationBehavior = DoNotPropagateToNextResponder; - } - } - } - } - } - } - - node = node.return; - } // Root phase - - - var rootEventResponderInstances = rootEventTypesToEventResponderInstances.get(eventType); - - if (rootEventResponderInstances !== undefined) { - var _responderInstances = Array.from(rootEventResponderInstances); - - for (var _i = 0; _i < _responderInstances.length; _i++) { - var _responderInstance = _responderInstances[_i]; - var props = _responderInstance.props, - responder = _responderInstance.responder, - state = _responderInstance.state; - var onRootEvent = responder.onRootEvent; - - if (onRootEvent !== null) { - currentInstance = _responderInstance; - onRootEvent(responderEvent, eventResponderContext, props, state); - } - } - } - } - - function mountEventResponder(responder, responderInstance, props, state) { - var onMount = responder.onMount; - - if (onMount !== null) { - var previousInstance = currentInstance; - var previousTimers = currentTimers; - currentInstance = responderInstance; - - try { - batchedEventUpdates(function () { - onMount(eventResponderContext, props, state); - }); - } finally { - currentInstance = previousInstance; - currentTimers = previousTimers; - } - } - } - - function unmountEventResponder(responderInstance) { - var responder = responderInstance.responder; - var onUnmount = responder.onUnmount; - - if (onUnmount !== null) { - var props = responderInstance.props, - state = responderInstance.state; - var previousInstance = currentInstance; - var previousTimers = currentTimers; - currentInstance = responderInstance; - - try { - batchedEventUpdates(function () { - onUnmount(eventResponderContext, props, state); - }); - } finally { - currentInstance = previousInstance; - currentTimers = previousTimers; - } - } - - var rootEventTypesSet = responderInstance.rootEventTypes; - - if (rootEventTypesSet !== null) { - var rootEventTypes = Array.from(rootEventTypesSet); - - for (var i = 0; i < rootEventTypes.length; i++) { - var topLevelEventType = rootEventTypes[i]; - var rootEventResponderInstances = rootEventTypesToEventResponderInstances.get(topLevelEventType); - - if (rootEventResponderInstances !== undefined) { - rootEventResponderInstances.delete(responderInstance); - } - } - } - } - - function validateResponderContext() { - (function () { - if (!(currentInstance !== null)) { - { - throw ReactError(Error("An event responder context was used outside of an event cycle. Use context.setTimeout() to use asynchronous responder context outside of event cycle .")); - } - } - })(); - } - - function dispatchEventForResponderEventSystem(topLevelType, targetFiber, nativeEvent, nativeEventTarget, eventSystemFlags) { - if (enableFlareAPI) { - var previousInstance = currentInstance; - var previousTimers = currentTimers; - var previousTimeStamp = currentTimeStamp; - var previousDocument = currentDocument; - var previousPropagationBehavior = currentPropagationBehavior; - currentPropagationBehavior = DoNotPropagateToNextResponder; - currentTimers = null; // nodeType 9 is DOCUMENT_NODE - - currentDocument = nativeEventTarget.nodeType === 9 ? nativeEventTarget : nativeEventTarget.ownerDocument; // We might want to control timeStamp another way here - - currentTimeStamp = nativeEvent.timeStamp; - - try { - batchedEventUpdates(function () { - traverseAndHandleEventResponderInstances(topLevelType, targetFiber, nativeEvent, nativeEventTarget, eventSystemFlags); - }); - } finally { - currentTimers = previousTimers; - currentInstance = previousInstance; - currentTimeStamp = previousTimeStamp; - currentDocument = previousDocument; - currentPropagationBehavior = previousPropagationBehavior; - } - } - } - - function addRootEventTypesForResponderInstance(responderInstance, rootEventTypes) { - for (var i = 0; i < rootEventTypes.length; i++) { - var rootEventType = rootEventTypes[i]; - registerRootEventType(rootEventType, responderInstance); - } - } - - function registerRootEventType(rootEventType, eventResponderInstance) { - var rootEventResponderInstances = rootEventTypesToEventResponderInstances.get(rootEventType); - - if (rootEventResponderInstances === undefined) { - rootEventResponderInstances = new Set(); - rootEventTypesToEventResponderInstances.set(rootEventType, rootEventResponderInstances); - } - - var rootEventTypesSet = eventResponderInstance.rootEventTypes; - - if (rootEventTypesSet === null) { - rootEventTypesSet = eventResponderInstance.rootEventTypes = new Set(); - } - - (function () { - if (!!rootEventTypesSet.has(rootEventType)) { - { - throw ReactError(Error("addRootEventTypes() found a duplicate root event type of \"" + rootEventType + "\". This might be because the event type exists in the event responder \"rootEventTypes\" array or because of a previous addRootEventTypes() using this root event type.")); - } - } - })(); - - rootEventTypesSet.add(rootEventType); - rootEventResponderInstances.add(eventResponderInstance); - } // A reserved attribute. - // It is handled by React separately and shouldn't be written to the DOM. - - - var RESERVED = 0; // A simple string attribute. - // Attributes that aren't in the whitelist are presumed to have this type. - - var STRING = 1; // A string attribute that accepts booleans in React. In HTML, these are called - // "enumerated" attributes with "true" and "false" as possible values. - // When true, it should be set to a "true" string. - // When false, it should be set to a "false" string. - - var BOOLEANISH_STRING = 2; // A real boolean attribute. - // When true, it should be present (set either to an empty string or its name). - // When false, it should be omitted. - - var BOOLEAN = 3; // An attribute that can be used as a flag as well as with a value. - // When true, it should be present (set either to an empty string or its name). - // When false, it should be omitted. - // For any other value, should be present with that value. - - var OVERLOADED_BOOLEAN = 4; // An attribute that must be numeric or parse as a numeric. - // When falsy, it should be removed. - - var NUMERIC = 5; // An attribute that must be positive numeric or parse as a positive numeric. - // When falsy, it should be removed. - - var POSITIVE_NUMERIC = 6; - /* 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 */ - - var ATTRIBUTE_NAME_CHAR = ATTRIBUTE_NAME_START_CHAR + "\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040"; - var ROOT_ATTRIBUTE_NAME = 'data-reactroot'; - var VALID_ATTRIBUTE_NAME_REGEX = new RegExp('^[' + ATTRIBUTE_NAME_START_CHAR + '][' + ATTRIBUTE_NAME_CHAR + ']*$'); - var hasOwnProperty = Object.prototype.hasOwnProperty; - var illegalAttributeNameCache = {}; - var validatedAttributeNameCache = {}; - - function isAttributeNameSafe(attributeName) { - if (hasOwnProperty.call(validatedAttributeNameCache, attributeName)) { - return true; - } - - if (hasOwnProperty.call(illegalAttributeNameCache, attributeName)) { - return false; - } - - if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName)) { - validatedAttributeNameCache[attributeName] = true; - return true; - } - - illegalAttributeNameCache[attributeName] = true; - { - warning$1(false, 'Invalid attribute name: `%s`', attributeName); - } - return false; - } - - function shouldIgnoreAttribute(name, propertyInfo, isCustomComponentTag) { - if (propertyInfo !== null) { - return propertyInfo.type === RESERVED; - } - - if (isCustomComponentTag) { - return false; - } - - if (name.length > 2 && (name[0] === 'o' || name[0] === 'O') && (name[1] === 'n' || name[1] === 'N')) { - return true; - } - - return false; - } - - function shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag) { - if (propertyInfo !== null && propertyInfo.type === RESERVED) { - return false; - } - - switch (typeof value) { - case 'function': // $FlowIssue symbol is perfectly valid here - - case 'symbol': - // eslint-disable-line - return true; - - case 'boolean': - { - if (isCustomComponentTag) { - return false; - } - - if (propertyInfo !== null) { - return !propertyInfo.acceptsBooleans; - } else { - var prefix = name.toLowerCase().slice(0, 5); - return prefix !== 'data-' && prefix !== 'aria-'; - } - } - - default: - return false; - } - } - - function shouldRemoveAttribute(name, value, propertyInfo, isCustomComponentTag) { - if (value === null || typeof value === 'undefined') { - return true; - } - - if (shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag)) { - return true; - } - - if (isCustomComponentTag) { - return false; - } - - if (propertyInfo !== null) { - switch (propertyInfo.type) { - case BOOLEAN: - return !value; - - case OVERLOADED_BOOLEAN: - return value === false; - - case NUMERIC: - return isNaN(value); - - case POSITIVE_NUMERIC: - return isNaN(value) || value < 1; - } - } - - return false; - } - - function getPropertyInfo(name) { - return properties.hasOwnProperty(name) ? properties[name] : null; - } - - function PropertyInfoRecord(name, type, mustUseProperty, attributeName, attributeNamespace, sanitizeURL) { - this.acceptsBooleans = type === BOOLEANISH_STRING || type === BOOLEAN || type === OVERLOADED_BOOLEAN; - this.attributeName = attributeName; - this.attributeNamespace = attributeNamespace; - this.mustUseProperty = mustUseProperty; - this.propertyName = name; - this.type = type; - this.sanitizeURL = sanitizeURL; - } // When adding attributes to this list, be sure to also add them to - // the `possibleStandardNames` module to ensure casing and incorrect - // name warnings. + function PropertyInfoRecord(name, type, mustUseProperty, attributeName, attributeNamespace, sanitizeURL) { + this.acceptsBooleans = type === BOOLEANISH_STRING || type === BOOLEAN || type === OVERLOADED_BOOLEAN; + this.attributeName = attributeName; + this.attributeNamespace = attributeNamespace; + this.mustUseProperty = mustUseProperty; + this.propertyName = name; + this.type = type; + this.sanitizeURL = sanitizeURL; + } // When adding attributes to this list, be sure to also add them to + // the `possibleStandardNames` module to ensure casing and incorrect + // name warnings. var properties = {}; // These props are reserved by React. They shouldn't be written to the DOM. - ['children', 'dangerouslySetInnerHTML', // TODO: This prevents the assignment of defaultValue to regular + var reservedProps = ['children', 'dangerouslySetInnerHTML', // TODO: This prevents the assignment of defaultValue to regular // elements (not just inputs). Now that ReactDOMInput assigns to the // defaultValue property -- do we need this? - 'defaultValue', 'defaultChecked', 'innerHTML', 'suppressContentEditableWarning', 'suppressHydrationWarning', 'style'].forEach(function (name) { + 'defaultValue', 'defaultChecked', 'innerHTML', 'suppressContentEditableWarning', 'suppressHydrationWarning', 'style']; + reservedProps.forEach(function (name) { properties[name] = new PropertyInfoRecord(name, RESERVED, false, // mustUseProperty name, // attributeName null, // attributeNamespace @@ -6347,7 +4486,10 @@ if ("development" !== "production") { ['checked', // Note: `option.selected` is not updated if `select.multiple` is // disabled with `removeAttribute`. We have special logic for handling this. - 'multiple', 'muted', 'selected'].forEach(function (name) { + 'multiple', 'muted', 'selected' // NOTE: if you add a camelCased prop to this list, + // you'll need to set attributeName to name.toLowerCase() + // instead in the assignment below. + ].forEach(function (name) { properties[name] = new PropertyInfoRecord(name, BOOLEAN, true, // mustUseProperty name, // attributeName null, // attributeNamespace @@ -6355,14 +4497,20 @@ if ("development" !== "production") { }); // These are HTML attributes that are "overloaded booleans": they behave like // booleans, but can also accept a string value. - ['capture', 'download'].forEach(function (name) { + ['capture', 'download' // NOTE: if you add a camelCased prop to this list, + // you'll need to set attributeName to name.toLowerCase() + // instead in the assignment below. + ].forEach(function (name) { properties[name] = new PropertyInfoRecord(name, OVERLOADED_BOOLEAN, false, // mustUseProperty name, // attributeName null, // attributeNamespace false); }); // These are HTML attributes that must be positive numbers. - ['cols', 'rows', 'size', 'span'].forEach(function (name) { + ['cols', 'rows', 'size', 'span' // NOTE: if you add a camelCased prop to this list, + // you'll need to set attributeName to name.toLowerCase() + // instead in the assignment below. + ].forEach(function (name) { properties[name] = new PropertyInfoRecord(name, POSITIVE_NUMERIC, false, // mustUseProperty name, // attributeName null, // attributeNamespace @@ -6383,23 +4531,32 @@ if ("development" !== "production") { // or boolean value assignment. Regular attributes that just accept strings // and have the same names are omitted, just like in the HTML whitelist. // Some of these attributes can be hard to find. This list was created by - // scrapping the MDN documentation. + // scraping the MDN documentation. - ['accent-height', 'alignment-baseline', 'arabic-form', 'baseline-shift', 'cap-height', 'clip-path', 'clip-rule', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'dominant-baseline', 'enable-background', 'fill-opacity', 'fill-rule', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'glyph-name', 'glyph-orientation-horizontal', 'glyph-orientation-vertical', 'horiz-adv-x', 'horiz-origin-x', 'image-rendering', 'letter-spacing', 'lighting-color', 'marker-end', 'marker-mid', 'marker-start', 'overline-position', 'overline-thickness', 'paint-order', 'panose-1', 'pointer-events', 'rendering-intent', 'shape-rendering', 'stop-color', 'stop-opacity', 'strikethrough-position', 'strikethrough-thickness', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'text-anchor', 'text-decoration', 'text-rendering', 'underline-position', 'underline-thickness', 'unicode-bidi', 'unicode-range', 'units-per-em', 'v-alphabetic', 'v-hanging', 'v-ideographic', 'v-mathematical', 'vector-effect', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'word-spacing', 'writing-mode', 'xmlns:xlink', 'x-height'].forEach(function (attributeName) { + ['accent-height', 'alignment-baseline', 'arabic-form', 'baseline-shift', 'cap-height', 'clip-path', 'clip-rule', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'dominant-baseline', 'enable-background', 'fill-opacity', 'fill-rule', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'glyph-name', 'glyph-orientation-horizontal', 'glyph-orientation-vertical', 'horiz-adv-x', 'horiz-origin-x', 'image-rendering', 'letter-spacing', 'lighting-color', 'marker-end', 'marker-mid', 'marker-start', 'overline-position', 'overline-thickness', 'paint-order', 'panose-1', 'pointer-events', 'rendering-intent', 'shape-rendering', 'stop-color', 'stop-opacity', 'strikethrough-position', 'strikethrough-thickness', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'text-anchor', 'text-decoration', 'text-rendering', 'underline-position', 'underline-thickness', 'unicode-bidi', 'unicode-range', 'units-per-em', 'v-alphabetic', 'v-hanging', 'v-ideographic', 'v-mathematical', 'vector-effect', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'word-spacing', 'writing-mode', 'xmlns:xlink', 'x-height' // NOTE: if you add a camelCased prop to this list, + // you'll need to set attributeName to name.toLowerCase() + // instead in the assignment below. + ].forEach(function (attributeName) { var name = attributeName.replace(CAMELIZE, capitalize); properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty attributeName, null, // attributeNamespace false); }); // String SVG attributes with the xlink namespace. - ['xlink:actuate', 'xlink:arcrole', 'xlink:role', 'xlink:show', 'xlink:title', 'xlink:type'].forEach(function (attributeName) { + ['xlink:actuate', 'xlink:arcrole', 'xlink:role', 'xlink:show', 'xlink:title', 'xlink:type' // NOTE: if you add a camelCased prop to this list, + // you'll need to set attributeName to name.toLowerCase() + // instead in the assignment below. + ].forEach(function (attributeName) { var name = attributeName.replace(CAMELIZE, capitalize); properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty attributeName, 'http://www.w3.org/1999/xlink', false); }); // String SVG attributes with the xml namespace. - ['xml:base', 'xml:lang', 'xml:space'].forEach(function (attributeName) { + ['xml:base', 'xml:lang', 'xml:space' // NOTE: if you add a camelCased prop to this list, + // you'll need to set attributeName to name.toLowerCase() + // instead in the assignment below. + ].forEach(function (attributeName) { var name = attributeName.replace(CAMELIZE, capitalize); properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty attributeName, 'http://www.w3.org/XML/1998/namespace', false); @@ -6424,9 +4581,9 @@ if ("development" !== "production") { null, // attributeNamespace true); }); - var ReactDebugCurrentFrame$1 = null; + var ReactDebugCurrentFrame = null; { - ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame; + ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame; } // A javascript: URL can contain leading C0 control or \u0020 SPACE, // and any newline or tab are filtered out as if they're not part of the URL. // https://url.spec.whatwg.org/#url-parsing @@ -6442,89 +4599,12 @@ if ("development" !== "production") { var didWarn = false; function sanitizeURL(url) { - if (disableJavaScriptURLs) { - (function () { - if (!!isJavaScriptProtocol.test(url)) { - { - throw ReactError(Error("React has blocked a javascript: URL as a security precaution." + ReactDebugCurrentFrame$1.getStackAddendum())); - } - } - })(); - } else if (true && !didWarn && isJavaScriptProtocol.test(url)) { - didWarn = true; - warning$1(false, 'A future version of React will block javascript: URLs as a security precaution. ' + 'Use event handlers instead if you can. If you need to generate unsafe HTML try ' + 'using dangerouslySetInnerHTML instead. React was passed %s.', JSON.stringify(url)); - } - } // Flow does not allow string concatenation of most non-string types. To work - // around this limitation, we use an opaque type that can only be obtained by - // passing the value through getToStringValue first. - - - function toString(value) { - return '' + value; - } - - function getToStringValue(value) { - switch (typeof value) { - case 'boolean': - case 'number': - case 'object': - case 'string': - case 'undefined': - return value; - - default: - // function, symbol are assigned as empty strings - return ''; - } - } - /** Trusted value is a wrapper for "safe" values which can be assigned to DOM execution sinks. */ - - /** - * We allow passing objects with toString method as element attributes or in dangerouslySetInnerHTML - * and we do validations that the value is safe. Once we do validation we want to use the validated - * value instead of the object (because object.toString may return something else on next call). - * - * If application uses Trusted Types we don't stringify trusted values, but preserve them as objects. - */ - - - var toStringOrTrustedType = toString; - - if (enableTrustedTypesIntegration && typeof trustedTypes !== 'undefined') { - var isHTML = trustedTypes.isHTML; - var isScript = trustedTypes.isScript; - var isScriptURL = trustedTypes.isScriptURL; // TrustedURLs are deprecated and will be removed soon: https://github.com/WICG/trusted-types/pull/204 - - var isURL = trustedTypes.isURL ? trustedTypes.isURL : function (value) { - return false; - }; - - toStringOrTrustedType = function (value) { - if (typeof value === 'object' && (isHTML(value) || isScript(value) || isScriptURL(value) || isURL(value))) { - // Pass Trusted Types through. - return value; + { + if (!didWarn && isJavaScriptProtocol.test(url)) { + didWarn = true; + error('A future version of React will block javascript: URLs as a security precaution. ' + 'Use event handlers instead if you can. If you need to generate unsafe HTML try ' + 'using dangerouslySetInnerHTML instead. React was passed %s.', JSON.stringify(url)); } - - return toString(value); - }; - } - /** - * Set attribute for a node. The attribute value can be either string or - * Trusted value (if application uses Trusted Types). - */ - - - function setAttribute(node, attributeName, attributeValue) { - node.setAttribute(attributeName, attributeValue); - } - /** - * Set attribute with namespace for a node. The attribute value can be either string or - * Trusted value (if application uses Trusted Types). - */ - - - function setAttributeNS(node, attributeNamespace, attributeName, attributeValue) { - node.setAttributeNS(attributeNamespace, attributeName, attributeValue); + } } /** * Get the value for a property on a node. Only used in DEV for SSR validation. @@ -6539,7 +4619,7 @@ if ("development" !== "production") { var propertyName = propertyInfo.propertyName; return node[propertyName]; } else { - if (!disableJavaScriptURLs && propertyInfo.sanitizeURL) { + if (propertyInfo.sanitizeURL) { // If we haven't fully disabled javascript: URLs, and if // the hydration is successful of a javascript: URL, we // still want to warn on the client. @@ -6651,7 +4731,7 @@ if ("development" !== "production") { if (value === null) { node.removeAttribute(_attributeName); } else { - setAttribute(node, _attributeName, toStringOrTrustedType(value)); + node.setAttribute(_attributeName, '' + value); } } @@ -6692,7 +4772,9 @@ if ("development" !== "production") { } else { // `setAttribute` with objects becomes only `[object]` in IE8/9, // ('' + value) makes it output the correct toString()-value. - attributeValue = toStringOrTrustedType(value); + { + attributeValue = '' + value; + } if (propertyInfo.sanitizeURL) { sanitizeURL(attributeValue.toString()); @@ -6700,162 +4782,454 @@ if ("development" !== "production") { } if (attributeNamespace) { - setAttributeNS(node, attributeNamespace, attributeName, attributeValue); + node.setAttributeNS(attributeNamespace, attributeName, attributeValue); } else { - setAttribute(node, attributeName, attributeValue); + node.setAttribute(attributeName, attributeValue); } } } - var ReactDebugCurrentFrame$2 = null; - var ReactControlledValuePropTypes = { - checkPropTypes: null - }; - { - ReactDebugCurrentFrame$2 = ReactSharedInternals.ReactDebugCurrentFrame; - var hasReadOnlyValue = { - button: true, - checkbox: true, - image: true, - hidden: true, - radio: true, - reset: true, - submit: true - }; - var propTypes = { - value: function (props, propName, componentName) { - if (hasReadOnlyValue[props.type] || props.onChange || props.readOnly || props.disabled || props[propName] == null || enableFlareAPI && props.listeners) { - return null; - } + var BEFORE_SLASH_RE = /^(.*)[\\\/]/; - 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.onChange || props.readOnly || props.disabled || props[propName] == null || enableFlareAPI && props.listeners) { - return null; - } + function describeComponentFrame(name, source, ownerName) { + var sourceInfo = ''; - 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`.'); - } - }; - /** - * Provide a linked `value` attribute for controlled forms. You should not use - * this outside of the ReactDOM controlled form components. - */ + if (source) { + var path = source.fileName; + var fileName = path.replace(BEFORE_SLASH_RE, ''); + { + // In DEV, include code for a common special case: + // prefer "folder/index.js" instead of just "index.js". + if (/^index\./.test(fileName)) { + var match = path.match(BEFORE_SLASH_RE); - ReactControlledValuePropTypes.checkPropTypes = function (tagName, props) { - checkPropTypes(propTypes, props, 'prop', tagName, ReactDebugCurrentFrame$2.getStackAddendum); - }; - } + if (match) { + var pathBeforeSlash = match[1]; - function isCheckable(elem) { - var type = elem.type; - var nodeName = elem.nodeName; - return nodeName && nodeName.toLowerCase() === 'input' && (type === 'checkbox' || type === 'radio'); - } + if (pathBeforeSlash) { + var folderName = pathBeforeSlash.replace(BEFORE_SLASH_RE, ''); + fileName = folderName + '/' + fileName; + } + } + } + } + sourceInfo = ' (at ' + fileName + ':' + source.lineNumber + ')'; + } else if (ownerName) { + sourceInfo = ' (created by ' + ownerName + ')'; + } - function getTracker(node) { - return node._valueTracker; - } + return '\n in ' + (name || 'Unknown') + sourceInfo; + } // The Symbol used to tag the ReactElement-like types. If there is no native Symbol + // nor polyfill, then a plain number is used for performance. - function detachTracker(node) { - node._valueTracker = null; - } - function getValueFromNode(node) { - var value = ''; + var hasSymbol = typeof Symbol === 'function' && Symbol.for; + var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7; + var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca; + var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb; + var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc; + var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2; + var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd; + var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary - if (!node) { - return value; + var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf; + var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0; + var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1; + var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8; + var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3; + var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4; + var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9; + var MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator; + var FAUX_ITERATOR_SYMBOL = '@@iterator'; + + function getIteratorFn(maybeIterable) { + if (maybeIterable === null || typeof maybeIterable !== 'object') { + return null; } - if (isCheckable(node)) { - value = node.checked ? 'true' : 'false'; - } else { - value = node.value; + var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]; + + if (typeof maybeIterator === 'function') { + return maybeIterator; } - return value; + return null; } - function trackValueOnNode(node) { - var valueField = isCheckable(node) ? 'checked' : 'value'; - var descriptor = Object.getOwnPropertyDescriptor(node.constructor.prototype, valueField); - var currentValue = '' + node[valueField]; // if someone has already defined a value or Safari, then bail - // and don't track value will cause over reporting of changes, - // but it's better then a hard failure - // (needed for certain tests that spyOn input values and Safari) + var Uninitialized = -1; + var Pending = 0; + var Resolved = 1; + var Rejected = 2; - if (node.hasOwnProperty(valueField) || typeof descriptor === 'undefined' || typeof descriptor.get !== 'function' || typeof descriptor.set !== 'function') { - return; - } + function refineResolvedLazyComponent(lazyComponent) { + return lazyComponent._status === Resolved ? lazyComponent._result : null; + } - var get = descriptor.get, - set = descriptor.set; - Object.defineProperty(node, valueField, { - configurable: true, - get: function () { - return get.call(this); - }, - set: function (value) { - currentValue = '' + value; - set.call(this, value); - } - }); // We could've passed this the first time - // but it triggers a bug in IE11 and Edge 14/15. - // Calling defineProperty() again should be equivalent. - // https://github.com/facebook/react/issues/11768 + function initializeLazyComponentType(lazyComponent) { + if (lazyComponent._status === Uninitialized) { + lazyComponent._status = Pending; + var ctor = lazyComponent._ctor; + var thenable = ctor(); + lazyComponent._result = thenable; + thenable.then(function (moduleObject) { + if (lazyComponent._status === Pending) { + var defaultExport = moduleObject.default; + { + if (defaultExport === undefined) { + error('lazy: Expected the result of a dynamic import() call. ' + 'Instead received: %s\n\nYour code should look like: \n ' + "const MyComponent = lazy(() => import('./MyComponent'))", moduleObject); + } + } + lazyComponent._status = Resolved; + lazyComponent._result = defaultExport; + } + }, function (error) { + if (lazyComponent._status === Pending) { + lazyComponent._status = Rejected; + lazyComponent._result = error; + } + }); + } + } - Object.defineProperty(node, valueField, { - enumerable: descriptor.enumerable - }); - var tracker = { - getValue: function () { - return currentValue; - }, - setValue: function (value) { - currentValue = '' + value; - }, - stopTracking: function () { - detachTracker(node); - delete node[valueField]; - } - }; - return tracker; + function getWrappedName(outerType, innerType, wrapperName) { + var functionName = innerType.displayName || innerType.name || ''; + return outerType.displayName || (functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName); } - function track(node) { - if (getTracker(node)) { - return; - } // TODO: Once it's just Fiber we can move this to node._wrapperState + function getComponentName(type) { + if (type == null) { + // Host root, text node or just invalid type. + return null; + } + { + if (typeof type.tag === 'number') { + error('Received an unexpected object in getComponentName(). ' + 'This is likely a bug in React. Please file an issue.'); + } + } - node._valueTracker = trackValueOnNode(node); - } + if (typeof type === 'function') { + return type.displayName || type.name || null; + } - function updateValueIfChanged(node) { - if (!node) { - return false; + if (typeof type === 'string') { + return type; } - var tracker = getTracker(node); // if there is no tracker at this point it's unlikely - // that trying again will succeed + switch (type) { + case REACT_FRAGMENT_TYPE: + return 'Fragment'; - if (!tracker) { - return true; - } + case REACT_PORTAL_TYPE: + return 'Portal'; - var lastValue = tracker.getValue(); - var nextValue = getValueFromNode(node); + case REACT_PROFILER_TYPE: + return "Profiler"; - if (nextValue !== lastValue) { - tracker.setValue(nextValue); - return true; + case REACT_STRICT_MODE_TYPE: + return 'StrictMode'; + + case REACT_SUSPENSE_TYPE: + return 'Suspense'; + + case REACT_SUSPENSE_LIST_TYPE: + return 'SuspenseList'; } - return false; - } // TODO: direct imports like some-package/src/* are bad. Fix me. + if (typeof type === 'object') { + switch (type.$$typeof) { + case REACT_CONTEXT_TYPE: + return 'Context.Consumer'; + case REACT_PROVIDER_TYPE: + return 'Context.Provider'; + + case REACT_FORWARD_REF_TYPE: + return getWrappedName(type, type.render, 'ForwardRef'); + + case REACT_MEMO_TYPE: + return getComponentName(type.type); + + case REACT_BLOCK_TYPE: + return getComponentName(type.render); + + case REACT_LAZY_TYPE: + { + var thenable = type; + var resolvedThenable = refineResolvedLazyComponent(thenable); + + if (resolvedThenable) { + return getComponentName(resolvedThenable); + } + + break; + } + } + } + + return null; + } + + var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame; + + function describeFiber(fiber) { + switch (fiber.tag) { + case HostRoot: + case HostPortal: + case HostText: + case Fragment: + case ContextProvider: + case ContextConsumer: + return ''; + + default: + var owner = fiber._debugOwner; + var source = fiber._debugSource; + var name = getComponentName(fiber.type); + var ownerName = null; + + if (owner) { + ownerName = getComponentName(owner.type); + } + + return describeComponentFrame(name, source, ownerName); + } + } + + function getStackByFiberInDevAndProd(workInProgress) { + var info = ''; + var node = workInProgress; + + do { + info += describeFiber(node); + node = node.return; + } while (node); + + return info; + } + + var current = null; + var isRendering = false; + + function getCurrentFiberOwnerNameInDevOrNull() { + { + if (current === null) { + return null; + } + + var owner = current._debugOwner; + + if (owner !== null && typeof owner !== 'undefined') { + return getComponentName(owner.type); + } + } + return null; + } + + function getCurrentFiberStackInDev() { + { + if (current === null) { + return ''; + } // Safe because if current fiber exists, we are reconciling, + // and it is guaranteed to be the work-in-progress version. + + + return getStackByFiberInDevAndProd(current); + } + } + + function resetCurrentFiber() { + { + ReactDebugCurrentFrame$1.getCurrentStack = null; + current = null; + isRendering = false; + } + } + + function setCurrentFiber(fiber) { + { + ReactDebugCurrentFrame$1.getCurrentStack = getCurrentFiberStackInDev; + current = fiber; + isRendering = false; + } + } + + function setIsRendering(rendering) { + { + isRendering = rendering; + } + } // Flow does not allow string concatenation of most non-string types. To work + // around this limitation, we use an opaque type that can only be obtained by + // passing the value through getToStringValue first. + + + function toString(value) { + return '' + value; + } + + function getToStringValue(value) { + switch (typeof value) { + case 'boolean': + case 'number': + case 'object': + case 'string': + case 'undefined': + return value; + + default: + // function, symbol are assigned as empty strings + return ''; + } + } + + var ReactDebugCurrentFrame$2 = null; + var ReactControlledValuePropTypes = { + checkPropTypes: null + }; + { + ReactDebugCurrentFrame$2 = ReactSharedInternals.ReactDebugCurrentFrame; + var hasReadOnlyValue = { + button: true, + checkbox: true, + image: true, + hidden: true, + radio: true, + reset: true, + submit: true + }; + var propTypes = { + value: function (props, propName, componentName) { + if (hasReadOnlyValue[props.type] || props.onChange || props.readOnly || props.disabled || props[propName] == null || enableDeprecatedFlareAPI) { + 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.onChange || props.readOnly || props.disabled || props[propName] == null || enableDeprecatedFlareAPI) { + 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`.'); + } + }; + /** + * Provide a linked `value` attribute for controlled forms. You should not use + * this outside of the ReactDOM controlled form components. + */ + + ReactControlledValuePropTypes.checkPropTypes = function (tagName, props) { + checkPropTypes(propTypes, props, 'prop', tagName, ReactDebugCurrentFrame$2.getStackAddendum); + }; + } + + function isCheckable(elem) { + var type = elem.type; + var nodeName = elem.nodeName; + return nodeName && nodeName.toLowerCase() === 'input' && (type === 'checkbox' || type === 'radio'); + } + + function getTracker(node) { + return node._valueTracker; + } + + function detachTracker(node) { + node._valueTracker = null; + } + + function getValueFromNode(node) { + var value = ''; + + if (!node) { + return value; + } + + if (isCheckable(node)) { + value = node.checked ? 'true' : 'false'; + } else { + value = node.value; + } + + return value; + } + + function trackValueOnNode(node) { + var valueField = isCheckable(node) ? 'checked' : 'value'; + var descriptor = Object.getOwnPropertyDescriptor(node.constructor.prototype, valueField); + var currentValue = '' + node[valueField]; // if someone has already defined a value or Safari, then bail + // and don't track value will cause over reporting of changes, + // but it's better then a hard failure + // (needed for certain tests that spyOn input values and Safari) + + if (node.hasOwnProperty(valueField) || typeof descriptor === 'undefined' || typeof descriptor.get !== 'function' || typeof descriptor.set !== 'function') { + return; + } + + var get = descriptor.get, + set = descriptor.set; + Object.defineProperty(node, valueField, { + configurable: true, + get: function () { + return get.call(this); + }, + set: function (value) { + currentValue = '' + value; + set.call(this, value); + } + }); // We could've passed this the first time + // but it triggers a bug in IE11 and Edge 14/15. + // Calling defineProperty() again should be equivalent. + // https://github.com/facebook/react/issues/11768 + + Object.defineProperty(node, valueField, { + enumerable: descriptor.enumerable + }); + var tracker = { + getValue: function () { + return currentValue; + }, + setValue: function (value) { + currentValue = '' + value; + }, + stopTracking: function () { + detachTracker(node); + delete node[valueField]; + } + }; + return tracker; + } + + function track(node) { + if (getTracker(node)) { + return; + } // TODO: Once it's just Fiber we can move this to node._wrapperState + + + node._valueTracker = trackValueOnNode(node); + } + + function updateValueIfChanged(node) { + if (!node) { + return false; + } + + var tracker = getTracker(node); // if there is no tracker at this point it's unlikely + // that trying again will succeed + + if (!tracker) { + return true; + } + + var lastValue = tracker.getValue(); + var nextValue = getValueFromNode(node); + + if (nextValue !== lastValue) { + tracker.setValue(nextValue); + return true; + } + + return false; + } var didWarnValueDefaultValue = false; var didWarnCheckedDefaultChecked = false; @@ -6903,12 +5277,12 @@ if ("development" !== "production") { ReactControlledValuePropTypes.checkPropTypes('input', props); if (props.checked !== undefined && props.defaultChecked !== undefined && !didWarnCheckedDefaultChecked) { - warning$1(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', getCurrentFiberOwnerNameInDevOrNull() || 'A component', props.type); + error('%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', getCurrentFiberOwnerNameInDevOrNull() || 'A component', props.type); didWarnCheckedDefaultChecked = true; } if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValueDefaultValue) { - warning$1(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', getCurrentFiberOwnerNameInDevOrNull() || 'A component', props.type); + error('%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', getCurrentFiberOwnerNameInDevOrNull() || 'A component', props.type); didWarnValueDefaultValue = true; } } @@ -6936,12 +5310,12 @@ if ("development" !== "production") { var controlled = isControlled(props); if (!node._wrapperState.controlled && controlled && !didWarnUncontrolledToControlled) { - warning$1(false, 'A component 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', props.type); + error('A component 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', props.type); didWarnUncontrolledToControlled = true; } if (node._wrapperState.controlled && !controlled && !didWarnControlledToUncontrolled) { - warning$1(false, 'A component 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', props.type); + error('A component 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', props.type); didWarnControlledToUncontrolled = true; } } @@ -6966,14 +5340,7 @@ if ("development" !== "production") { return; } - if (disableInputAttributeSyncing) { - // When not syncing the value attribute, React only assigns a new value - // whenever the defaultValue React prop has changed. When not present, - // React does nothing - if (props.hasOwnProperty('defaultValue')) { - setDefaultValue(node, props.type, getToStringValue(props.defaultValue)); - } - } else { + { // When syncing the value attribute, the value comes from a cascade of // properties: // 1. The value React property @@ -6985,17 +5352,7 @@ if ("development" !== "production") { setDefaultValue(node, props.type, getToStringValue(props.defaultValue)); } } - - if (disableInputAttributeSyncing) { - // When not syncing the checked attribute, the attribute is directly - // controllable from the defaultValue React property. It needs to be - // updated as new props come in. - if (props.defaultChecked == null) { - node.removeAttribute('checked'); - } else { - node.defaultChecked = !!props.defaultChecked; - } - } else { + { // When syncing the checked attribute, it only changes when it needs // to be removed, such as transitioning from a checkbox into a text input if (props.checked == null && props.defaultChecked != null) { @@ -7021,24 +5378,7 @@ if ("development" !== "production") { // from being lost during SSR hydration. if (!isHydrating) { - if (disableInputAttributeSyncing) { - var value = getToStringValue(props.value); // When not syncing the value attribute, the value property points - // directly to the React prop. Only assign it if it exists. - - if (value != null) { - // Always assign on buttons so that it is possible to assign an - // empty string to clear button text. - // - // Otherwise, do not re-assign the value property if is empty. This - // potentially avoids a DOM write and prevents Firefox (~60.0.1) from - // prematurely marking required inputs as invalid. Equality is compared - // to the current value in case the browser provided value is not an - // empty string. - if (isButton || value !== node.value) { - node.value = toString(value); - } - } - } else { + { // When syncing the value attribute, the value property should use // the wrapperState._initialValue property. This uses: // @@ -7051,15 +5391,7 @@ if ("development" !== "production") { } } - if (disableInputAttributeSyncing) { - // When not syncing the value attribute, assign the value attribute - // directly from the defaultValue React property (when present) - var defaultValue = getToStringValue(props.defaultValue); - - if (defaultValue != null) { - node.defaultValue = toString(defaultValue); - } - } else { + { // Otherwise, the value attribute is synchronized to the property, // so we assign defaultValue to the same thing as the value property // assignment step above. @@ -7078,23 +5410,7 @@ if ("development" !== "production") { node.name = ''; } - if (disableInputAttributeSyncing) { - // When not syncing the checked attribute, the checked property - // never gets assigned. It must be manually set. We don't want - // to do this when hydrating so that existing user input isn't - // modified - if (!isHydrating) { - updateChecked(element, props); - } // Only assign the checked attribute if it is defined. This saves - // a DOM write when controlling the checked attribute isn't needed - // (text inputs, submit/reset) - - - if (props.hasOwnProperty('defaultChecked')) { - node.defaultChecked = !node.defaultChecked; - node.defaultChecked = !!props.defaultChecked; - } - } else { + { // When syncing the checked attribute, both the checked property and // attribute are assigned at the same time using defaultChecked. This uses: // @@ -7110,7 +5426,7 @@ if ("development" !== "production") { } } - function restoreControlledState$1(element, props) { + function restoreControlledState(element, props) { var node = element; updateWrapper(node, props); updateNamedCousins(node, props); @@ -7148,13 +5464,11 @@ if ("development" !== "production") { var otherProps = getFiberCurrentPropsFromNode$1(otherNode); - (function () { - if (!otherProps) { - { - throw ReactError(Error("ReactDOMInput: Mixing React and non-React radio inputs with the same `name` is not supported.")); - } + if (!otherProps) { + { + throw Error("ReactDOMInput: Mixing React and non-React radio inputs with the same `name` is not supported."); } - })(); // We need update the tracked value on the named cousin since the value + } // We need update the tracked value on the named cousin since the value // was changed but the input saw no event or value set @@ -7234,14 +5548,14 @@ if ("development" !== "production") { if (!didWarnInvalidChild) { didWarnInvalidChild = true; - warning$1(false, 'Only strings and numbers are supported as