├── .babelrc
├── .editorconfig
├── .eslintignore
├── .eslintrc.js
├── .gitignore
├── .nvmrc
├── CHANGELOG.md
├── CONTRIBUTING.md
├── LICENSE
├── README.md
├── docs
├── app.7191e.js
└── index.html
├── package-lock.json
├── package.json
├── src
├── docs
│ ├── index.html
│ └── index.js
└── index.js
├── webpack.common.config.js
├── webpack.dev.config.js
└── webpack.prod.config.js
/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "presets": [
3 | [
4 | "env",
5 | {
6 | "targets": {
7 | "browsers": [
8 | "last 2 versions",
9 | "safari >= 7"
10 | ],
11 | "node": 8
12 | }
13 | }
14 | ],
15 | "react"
16 | ],
17 | "plugins": [
18 | "transform-object-rest-spread"
19 | ]
20 | }
21 |
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | # EditorConfig is awesome: http://EditorConfig.org
2 |
3 | # top-most EditorConfig file
4 | root = true
5 |
6 | # Default styles
7 | [*]
8 | indent_style = space
9 | indent_size = 2
10 | end_of_line = lf
11 | charset = utf-8
12 | trim_trailing_whitespace = true
13 | insert_final_newline = true
--------------------------------------------------------------------------------
/.eslintignore:
--------------------------------------------------------------------------------
1 | build
2 | node_modules
3 | docs
4 | webpack.*.js
5 |
--------------------------------------------------------------------------------
/.eslintrc.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | "extends": "airbnb",
3 | "rules": {
4 | "react/jsx-filename-extension": 0,
5 | "import/no-extraneous-dependencies": 0
6 | },
7 | "globals": {
8 | document: true
9 | }
10 | };
11 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Build
2 | build
3 |
4 | # Logs
5 | logs
6 | *.log
7 | npm-debug.log*
8 | yarn-debug.log*
9 | yarn-error.log*
10 |
11 | # since we use npm
12 | yarn.lock
13 |
14 | # Dependency directories
15 | node_modules/
16 |
17 | # Optional npm cache directory
18 | .npm
19 |
20 | # Optional eslint cache
21 | .eslintcache
22 |
23 | # Output of 'npm pack'
24 | *.tgz
25 | package
26 |
27 | # Yarn Integrity file
28 | .yarn-integrity
29 |
30 | # dotenv environment variables file
31 | .env
32 |
33 |
--------------------------------------------------------------------------------
/.nvmrc:
--------------------------------------------------------------------------------
1 | v8.9.4
2 |
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # Changelog
2 |
3 | All notable changes to this project will be documented in this file.
4 |
5 | The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6 | and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7 |
8 | ## [Unreleased]
9 |
10 | - Add a [CHANGELOG.md](https://keepachangelog.com) ([#14](https://github.com/abinavseelan/react-input-trigger/pull/14))
11 |
12 | ## [1.1.2] - 2018-06-17
13 |
14 | - **Issues**
15 | - Fix issue with child refs ([#2](https://github.com/abinavseelan/react-input-trigger/pull/2)) - [@goldylucks](https://github.com/goldylucks)
16 |
17 | ## [1.1.1] - 2018-06-17
18 |
19 | - **Issues**
20 | - Fix styling issues due to intermediate `
` ([#4](https://github.com/abinavseelan/react-input-trigger/issues/4))
21 | - **Contributing**
22 | - Add a [Contributing Guide](https://github.com/abinavseelan/react-input-trigger/blob/master/CONTRIBUTING.md) to help others get started with contributing to this project. 😄
23 | - **Other**
24 | - Lock in port `3000` for development.
25 |
26 | ## [1.1.0] - 2018-04-15
27 |
28 | - **Issues**
29 | - Fix [#1](https://github.com/abinavseelan/react-input-trigger/issues/1)
30 | - **Features**
31 | - `react-input-trigger` can now be imported via:
32 | - [CommonJS](http://www.commonjs.org/) (through `package.json`: main)
33 | - ES2015 Modules (through `package.json`: module)
34 | - **Contributing**
35 | - Project structural changes:
36 | - Parallelize the build process
37 | - Docs structure clean-up (remove view)
38 |
39 | [Unreleased]: https://github.com/abinavseelan/react-input-trigger/compare/v1.1.2...HEAD
40 | [1.1.2]: https://github.com/abinavseelan/react-input-trigger/compare/v1.1.1...v1.1.2
41 | [1.1.1]: https://github.com/abinavseelan/react-input-trigger/compare/v1.1.0...v1.1.1
42 | [1.1.0]: https://github.com/abinavseelan/react-input-trigger/tree/v1.1.0
43 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # React Input Trigger Contributing Guide
2 |
3 | Before submitting your contribution, please take a moment and read through the following guidelines.
4 |
5 | - [Pull Request Guidelines](#pull-request-guidelines)
6 | - [Development Setup](#development-setup)
7 | - [Project Structure](#project-structure)
8 |
9 | ## Pull Request Guidelines
10 |
11 | - All development would require you to just edit the contents of `src`. Please do not modify the contents of `/build`, or `/docs` directly. `/build` will always be generated by the maintainers before publishing to npm, and `/docs` is generated automatically on publish from `/src/docs`.
12 |
13 | - A preferred convention for branch names is `
/`. For example:
14 | - `bugfix/missing-props`
15 | - `feature/handle-refs`
16 |
17 | - As for commit guidelines on your branch, do not fret! 🙂 The commits will be squash merged by the maintainers before merging to `master`.
18 |
19 | - Make sure `npm run lint` passes. This command runs [eslint](https://eslint.org/) to enforce the code-style conventions.
20 |
21 | - Make sure `npm run test` passes. This will check if the package can be built correctly without build errors.
22 |
23 | - If there are any changes to the dependencies, please make sure to use `npm` rather than `yarn` and that your changes are reflected in both the `package.json` and `package-lock.json` files.
24 |
25 | - If adding a new feature:
26 | - Describe your use-case / need for the feature, so that we can understand the scenario better.
27 | - Preferably raise a suggestion issue, so that we can have a discussion before you start working on the PR. 👩💻
28 |
29 | - If fixing a bug:
30 | - Reference any open/closed github issues related to this bug.
31 | - Provide detailed description of the bug in the PR. Live demo preferred. 🚀
32 |
33 | ## Development Setup
34 |
35 | You will need [Node.js](http://nodejs.org) **version 6+**
36 |
37 | After cloning the repo, run:
38 |
39 | ``` bash
40 | $ npm install
41 | ```
42 |
43 | **Note: If you're using `yarn`, just make sure you aren't committing the yarn lockfile.**
44 |
45 | ### Committing Changes
46 |
47 | There is a `pre-commit` hook that runs the linter to check for code style. Please make sure that any issues that come up during this linter check are fixed when raising the Pull Request.
48 |
49 | ### Commonly used NPM scripts
50 |
51 | ``` bash
52 | # Runs the example project in `/src/docs`, using webpack-dev-server.
53 | # Use this demo sandbox to test your changes. It has HMR out of the box!
54 | $ npm start
55 |
56 | # Check for linting issues.
57 | # This command will also auto-fix some common issues.
58 | $ npm run lint
59 |
60 | # Tests if the package can be built correctly without errors.
61 | $ npm test
62 | ```
63 |
64 | ## Project Structure
65 |
66 | - **src**
67 | - **index.js**: This is the main `` component source.
68 | - **docs**: This is the code pertaining to the demo project.
69 |
70 | - **build**
71 |
72 | This contains the production builds of the component. **Do not edit this directly**
73 |
74 | - **docs**
75 |
76 | This is the production example for the component. **Do not edit this directly**
77 |
78 | ## Credits
79 |
80 | This file has been adapted from the awesome folks at Vuejs: [VueJS's Contributing Guidelines](https://github.com/vuejs/vue/blob/dev/.github/CONTRIBUTING.md).
81 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2018 Abinav Seelan
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # React Input Trigger
2 |
3 | [![npm][npm-badge]][npm-url]
4 | [![license][license-badge]][license-url]
5 | [![downloads][downloads-badge]][downloads-url]
6 | [![size][size-badge]][size-url]
7 |
8 | [![deps][deps-badge]][deps-url]
9 | [![peer-deps][peer-deps-badge]][peer-deps-url]
10 |
11 | > React component for handling character triggers inside textareas and input fields. 🐼
12 |
13 | ## Description
14 |
15 | Useful for building applications that need Slack-like emoji suggestions (triggered by typing `:`) or Github-like user mentions (triggered by typing `@`).
16 |
17 | The component provides the following hooks:
18 |
19 | * `onStart`: whenever the trigger is first activated (eg. when `@` is first typed).
20 | * `onType`: when something is being typed after it's been triggered.
21 | * `onCancel`: when the trigger is canceled.
22 |
23 | The hooks pass some meta-data such as the cursor position and/or the text that has been typed since the trigger has been activated.
24 |
25 | 
26 |
27 | ## Demo
28 |
29 | A live demo of this component can be found [here](https://abinavseelan.com/react-input-trigger).
30 |
31 | A detailed guide on using this component to build a Github-style user mentions component [can be found on CampVanilla](https://blog.campvanilla.com/reactjs-input-trigger-github-twitter-mentions-8ad1d878110d).
32 |
33 | ## Usage
34 |
35 | ### Getting Started
36 |
37 | * Install the component
38 |
39 | ```bash
40 | $ npm install react-input-trigger
41 | ```
42 |
43 | * Import the component from the package.
44 |
45 | ```js
46 | import InputTrigger from 'react-input-trigger';
47 | ```
48 |
49 | * Wrap your existing `` or `` element with ``
50 |
51 | ```jsx
52 |
53 |
54 |
55 | ```
56 |
57 | ---
58 |
59 | Or get it in the browser directly via [unpkg](https://unpkg.com/react-input-trigger@latest/build/lib/react-input-trigger.js):
60 |
61 | ```html
62 |
66 | ```
67 |
68 | ## Component Props
69 |
70 | `` can take in the following props:
71 |
72 | ### trigger
73 |
74 | This prop takes an object that defines the trigger. The object can have the following properties
75 |
76 | * `keyCode`: This is the character code that will fire the trigger.
77 | * `shiftKey`: (Optional) Set this to `true` if you need the shift key to be pressed along with the `keyCode` to start the trigger. Ignore this property if it's not required.
78 | * `ctrlKey`: (Optional) Set this to `true` if you need the ctrl key to be pressed along with the `keyCode` to start the trigger. Ignore this property if it's not required.
79 | * `metaKey`: (Optional) Set this to `true` if you need the cmd key to be pressed along with the `keyCode` to start the trigger. Ignore this property if it's not required.
80 |
81 | ```jsx
82 |
88 | ```
89 |
90 | ### onStart
91 |
92 | This prop takes a function that will fire whenever trigger is activated. The function is passed some meta information about the cursor's position that you can use.
93 |
94 | ```jsx
95 | { console.log(obj); }}
101 | >
102 | ```
103 |
104 | The parameter `obj` contains the following meta information
105 |
106 | ```js
107 | {
108 | "hookType": "start",
109 | "cursor": {
110 | "selectionStart",
111 | "selectionEnd",
112 | "top",
113 | "left",
114 | "height"
115 | }
116 | }
117 | ```
118 |
119 | ### onCancel
120 |
121 | This prop takes a function that will fire everytime the user presses backspace and removes the trigger from the input section. The function is passed some meta information about the cursor's position that you can use.
122 |
123 | ```jsx
124 | { console.log(obj); }}
130 | >
131 | ```
132 |
133 | The parameter `obj` contains the following meta information
134 |
135 | ```js
136 | {
137 | "hookType": "cancel",
138 | "cursor": {
139 | "selectionStart",
140 | "selectionEnd",
141 | "top",
142 | "left",
143 | "height"
144 | }
145 | }
146 | ```
147 |
148 | ### onType
149 |
150 | This prop takes a function that will trigger everytime the user continues typing after starting the trigger. The function is passed some meta information about the cursor's position, as well as the text that the user has typed after triggering that you can use.
151 |
152 | ```jsx
153 | { console.log(obj); }}
159 | >
160 | ```
161 |
162 | The parameter `obj` contains the following meta information
163 |
164 | ```js
165 | {
166 | "hookType": "typing",
167 | "cursor": {
168 | "selectionStart",
169 | "selectionEnd",
170 | "top",
171 | "left",
172 | "height"
173 | },
174 | "text"
175 | }
176 | ```
177 |
178 | ### endTrigger
179 |
180 | This prop takes a function that returns a function that you need to keep in your parent component. This returned method needs to be called manually by the parent component whenever you are done using the trigger and want to end the trigger.
181 |
182 | ```jsx
183 | {
186 | this.endTriggerHandler = endTriggerHandler;
187 |
188 | /*
189 | Now you can call `this.endTriggerHandler`
190 | anywhere inside the parent component
191 | whenever you want to stop the trigger!
192 | */
193 | }
194 | }
195 | >
196 | ```
197 |
198 | ## Contributing
199 |
200 | Want to fix something, add a new feature or raise an issue? Please read the [contributing guide](https://github.com/abinavseelan/react-input-trigger/blob/master/CONTRIBUTING.md) to get started. :smile:
201 |
202 | ## Contributors
203 |
204 | Thanks goes to these wonderful people ([emoji key](https://github.com/kentcdodds/all-contributors#emoji-key)):
205 |
206 |
207 |
208 |
209 | | [
Abinav Seelan](https://abinavseelan.com)
[💻](https://github.com/abinavseelan/react-input-trigger/commits?author=abinavseelan "Code") [📖](https://github.com/abinavseelan/react-input-trigger/commits?author=abinavseelan "Documentation") | [
Aditi Mohanty](https://github.com/rheaditi)
[💻](https://github.com/abinavseelan/react-input-trigger/commits?author=rheaditi "Code") [📖](https://github.com/abinavseelan/react-input-trigger/commits?author=rheaditi "Documentation") | [
Adam Goldman](https://github.com/goldylucks)
[💻](https://github.com/abinavseelan/react-input-trigger/commits?author=goldylucks "Code") |
210 | | :---: | :---: | :---: |
211 |
212 |
213 |
214 | This project follows the [all-contributors](https://github.com/kentcdodds/all-contributors) specification. Contributions of any kind welcome!
215 |
216 | [npm-badge]: https://img.shields.io/npm/v/react-input-trigger.svg?style=flat-square
217 | [npm-url]: https://www.npmjs.com/package/react-input-trigger
218 | [license-badge]: https://img.shields.io/npm/l/react-input-trigger.svg?style=flat-square&color=blue
219 | [license-url]: https://github.com/abinavseelan/react-input-trigger/blob/master/LICENSE
220 | [downloads-badge]: https://img.shields.io/npm/dt/react-input-trigger.svg?style=flat-square&color=blue
221 | [downloads-url]: https://www.npmjs.com/package/react-input-trigger
222 | [deps-badge]: https://img.shields.io/david/abinavseelan/react-input-trigger.svg?style=flat-square
223 | [deps-url]: https://david-dm.org/abinavseelan/react-input-trigger
224 | [peer-deps-badge]: https://img.shields.io/david/peer/abinavseelan/react-input-trigger.svg?style=flat-square
225 | [peer-deps-url]: https://david-dm.org/abinavseelan/react-input-trigger/peer-status
226 | [size-badge]: https://img.shields.io/bundlephobia/minzip/react-input-trigger.svg?style=flat-square&label=gzipped
227 | [size-url]: https://bundlephobia.com/result?p=react-input-trigger
228 |
--------------------------------------------------------------------------------
/docs/app.7191e.js:
--------------------------------------------------------------------------------
1 | !function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="./",t(t.s=4)}([function(e,t,n){"use strict";e.exports=n(5)},function(e,t,n){"use strict";function r(e){return function(){return e}}var o=function(){};o.thatReturns=r,o.thatReturnsFalse=r(!1),o.thatReturnsTrue=r(!0),o.thatReturnsNull=r(null),o.thatReturnsThis=function(){return this},o.thatReturnsArgument=function(e){return e},e.exports=o},function(e,t,n){"use strict";function r(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}/*
2 | object-assign
3 | (c) Sindre Sorhus
4 | @license MIT
5 | */
6 | var o=Object.getOwnPropertySymbols,a=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(e){r[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,l,u=r(e),c=1;cU.length&&U.push(e)}function d(e,t,n,o){var a=typeof e;"undefined"!==a&&"boolean"!==a||(e=null);var i=!1;if(null===e)i=!0;else switch(a){case"string":case"number":i=!0;break;case"object":switch(e.$$typeof){case w:case x:i=!0}}if(i)return n(o,e,""===t?"."+p(e,0):t),1;if(i=0,t=""===t?".":t+":",Array.isArray(e))for(var l=0;lthis.eventPool.length&&this.eventPool.push(e)}function L(e){e.eventPool=[],e.getPooled=M,e.release=U}function z(e,t){switch(e){case"topKeyUp":return-1!==Vn.indexOf(t.keyCode);case"topKeyDown":return 229!==t.keyCode;case"topKeyPress":case"topMouseDown":case"topBlur":return!0;default:return!1}}function j(e){return e=e.detail,"object"==typeof e&&"data"in e?e.data:null}function A(e,t){switch(e){case"topCompositionEnd":return j(t);case"topKeyPress":return 32!==t.which?null:(Gn=!0,$n);case"topTextInput":return e=t.data,e===$n&&Gn?null:e;default:return null}}function H(e,t){if(Yn)return"topCompositionEnd"===e||!Wn&&z(e,t)?(e=R(),Ln._root=null,Ln._startText=null,Ln._fallbackText=null,Yn=!1,e):null;switch(e){case"topPaste":return null;case"topKeyPress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1t}return!1}function ce(e,t,n,r,o){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t}function se(e){return e[1].toUpperCase()}function fe(e,t,n,r){var o=wr.hasOwnProperty(t)?wr[t]:null;(null!==o?0===o.type:!r&&(2$r.length&&$r.push(e)}}}function Ke(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n["ms"+e]="MS"+t,n["O"+e]="o"+t.toLowerCase(),n}function Qe(e){if(Xr[e])return Xr[e];if(!Yr[e])return e;var t,n=Yr[e];for(t in n)if(n.hasOwnProperty(t)&&t in Zr)return Xr[e]=n[t];return e}function $e(e){return Object.prototype.hasOwnProperty.call(e,ro)||(e[ro]=no++,to[e[ro]]={}),to[e[ro]]}function qe(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Ge(e,t){var n=qe(e);e=0;for(var r;n;){if(3===n.nodeType){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=qe(n)}}function Ye(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&"text"===e.type||"textarea"===t||"true"===e.contentEditable)}function Xe(e,t){if(co||null==io||io!==pn())return null;var n=io;return"selectionStart"in n&&Ye(n)?n={start:n.selectionStart,end:n.selectionEnd}:window.getSelection?(n=window.getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}):n=void 0,uo&&hn(uo,n)?null:(uo=n,e=F.getPooled(ao.select,lo,e,t),e.type="select",e.target=io,N(e),e)}function Ze(e,t,n,r){this.tag=e,this.key=n,this.stateNode=this.type=null,this.sibling=this.child=this.return=null,this.index=0,this.ref=null,this.pendingProps=t,this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.effectTag=0,this.lastEffect=this.firstEffect=this.nextEffect=null,this.expirationTime=0,this.alternate=null}function Je(e,t,n){var r=e.alternate;return null===r?(r=new Ze(e.tag,t,e.key,e.mode),r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.effectTag=0,r.nextEffect=null,r.firstEffect=null,r.lastEffect=null),r.expirationTime=n,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function et(e,t,n){var o=e.type,a=e.key;e=e.props;var i=void 0;if("function"==typeof o)i=o.prototype&&o.prototype.isReactComponent?2:0;else if("string"==typeof o)i=5;else switch(o){case fr:return tt(e.children,t,n,a);case mr:i=11,t|=3;break;case dr:i=11,t|=2;break;case ur:i=7;break;case cr:i=9;break;default:if("object"==typeof o&&null!==o)switch(o.$$typeof){case pr:i=13;break;case hr:i=12;break;case gr:i=14;break;default:if("number"==typeof o.tag)return t=o,t.pendingProps=e,t.expirationTime=n,t;r("130",null==o?o:typeof o,"")}else r("130",null==o?o:typeof o,"")}return t=new Ze(i,e,a,t),t.type=o,t.expirationTime=n,t}function tt(e,t,n,r){return e=new Ze(10,e,r,t),e.expirationTime=n,e}function nt(e,t,n){return e=new Ze(6,e,null,t),e.expirationTime=n,e}function rt(e,t,n){return t=new Ze(4,null!==e.children?e.children:[],e.key,t),t.expirationTime=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function ot(e){return function(t){try{return e(t)}catch(e){}}}function at(e){if("undefined"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__)return!1;var t=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(t.isDisabled||!t.supportsFiber)return!0;try{var n=t.inject(e);fo=ot(function(e){return t.onCommitFiberRoot(n,e)}),po=ot(function(e){return t.onCommitFiberUnmount(n,e)})}catch(e){}return!0}function it(e){"function"==typeof fo&&fo(e)}function lt(e){"function"==typeof po&&po(e)}function ut(e){return{baseState:e,expirationTime:0,first:null,last:null,callbackList:null,hasForceUpdate:!1,isInitialized:!1,capturedValues:null}}function ct(e,t){null===e.last?e.first=e.last=t:(e.last.next=t,e.last=t),(0===e.expirationTime||e.expirationTime>t.expirationTime)&&(e.expirationTime=t.expirationTime)}function st(e){ho=mo=null;var t=e.alternate,n=e.updateQueue;null===n&&(n=e.updateQueue=ut(null)),null!==t?null===(e=t.updateQueue)&&(e=t.updateQueue=ut(null)):e=null,ho=n,mo=e!==n?e:null}function ft(e,t){st(e),e=ho;var n=mo;null===n?ct(e,t):null===e.last||null===n.last?(ct(e,t),ct(n,t)):(ct(e,t),n.last=t)}function dt(e,t,n,r){return e=e.partialState,"function"==typeof e?e.call(t,n,r):e}function pt(e,t,n,r,o,a){null!==e&&e.updateQueue===n&&(n=t.updateQueue={baseState:n.baseState,expirationTime:n.expirationTime,first:n.first,last:n.last,isInitialized:n.isInitialized,capturedValues:n.capturedValues,callbackList:null,hasForceUpdate:!1}),n.expirationTime=0,n.isInitialized?e=n.baseState:(e=n.baseState=t.memoizedState,n.isInitialized=!0);for(var i=!0,l=n.first,u=!1;null!==l;){var c=l.expirationTime;if(c>a){var s=n.expirationTime;(0===s||s>c)&&(n.expirationTime=c),u||(u=!0,n.baseState=e)}else u||(n.first=l.next,null===n.first&&(n.last=null)),l.isReplace?(e=dt(l,r,e,o),i=!0):(c=dt(l,r,e,o))&&(e=i?fn({},e,c):fn(e,c),i=!1),l.isForced&&(n.hasForceUpdate=!0),null!==l.callback&&(c=n.callbackList,null===c&&(c=n.callbackList=[]),c.push(l)),null!==l.capturedValue&&(c=n.capturedValues,null===c?n.capturedValues=[l.capturedValue]:c.push(l.capturedValue));l=l.next}return null!==n.callbackList?t.effectTag|=32:null!==n.first||n.hasForceUpdate||null!==n.capturedValues||(t.updateQueue=null),u||(n.baseState=e),e}function ht(e,t){var n=e.callbackList;if(null!==n)for(e.callbackList=null,e=0;em?(g=f,f=null):g=f.sibling;var y=p(r,f,l[m],u);if(null===y){null===f&&(f=g);break}e&&f&&null===y.alternate&&t(r,f),a=i(y,a,m),null===s?c=y:s.sibling=y,s=y,f=g}if(m===l.length)return n(r,f),c;if(null===f){for(;mg?(y=m,m=null):y=m.sibling;var b=p(a,m,v.value,c);if(null===b){m||(m=y);break}e&&m&&null===b.alternate&&t(a,m),l=i(b,l,g),null===f?s=b:f.sibling=b,f=b,m=y}if(v.done)return n(a,m),s;if(null===m){for(;!v.done;g++,v=u.next())null!==(v=d(a,v.value,c))&&(l=i(v,l,g),null===f?s=v:f.sibling=v,f=v);return s}for(m=o(a,m);!v.done;g++,v=u.next())null!==(v=h(m,a,g,v.value,c))&&(e&&null!==v.alternate&&m.delete(null===v.key?g:v.key),l=i(v,l,g),null===f?s=v:f.sibling=v,f=v);return e&&m.forEach(function(e){return t(a,e)}),s}return function(e,o,i,u){"object"==typeof i&&null!==i&&i.type===fr&&null===i.key&&(i=i.props.children);var c="object"==typeof i&&null!==i;if(c)switch(i.$$typeof){case lr:e:{var s=i.key;for(c=o;null!==c;){if(c.key===s){if(10===c.tag?i.type===fr:c.type===i.type){n(e,c.sibling),o=a(c,i.type===fr?i.props.children:i.props,u),o.ref=gt(e,c,i),o.return=e,e=o;break e}n(e,c);break}t(e,c),c=c.sibling}i.type===fr?(o=tt(i.props.children,e.mode,u,i.key),o.return=e,e=o):(u=et(i,e.mode,u),u.ref=gt(e,o,i),u.return=e,e=u)}return l(e);case sr:e:{for(c=i.key;null!==o;){if(o.key===c){if(4===o.tag&&o.stateNode.containerInfo===i.containerInfo&&o.stateNode.implementation===i.implementation){n(e,o.sibling),o=a(o,i.children||[],u),o.return=e,e=o;break e}n(e,o);break}t(e,o),o=o.sibling}o=rt(i,e.mode,u),o.return=e,e=o}return l(e)}if("string"==typeof i||"number"==typeof i)return i=""+i,null!==o&&6===o.tag?(n(e,o.sibling),o=a(o,i,u)):(n(e,o),o=nt(i,e.mode,u)),o.return=e,e=o,l(e);if(go(i))return m(e,o,i,u);if(re(i))return g(e,o,i,u);if(c&&yt(e,i),void 0===i)switch(e.tag){case 2:case 1:u=e.type,r("152",u.displayName||u.name||"Component")}return n(e,o)}}function bt(e,t,n,o,a,i,l){function u(e,t,n){c(e,t,n,t.expirationTime)}function c(e,t,n,r){t.child=null===e?vo(t,null,n,r):yo(t,e.child,n,r)}function s(e,t){var n=t.ref;(null===e&&null!==n||null!==e&&e.ref!==n)&&(t.effectTag|=128)}function f(e,t,n,r,o,a){if(s(e,t),!n&&!o)return r&&S(t,!1),m(e,t);n=t.stateNode,ar.current=t;var i=o?null:n.render();return t.effectTag|=1,o&&(c(e,t,null,a),t.child=null),c(e,t,i,a),t.memoizedState=n.state,t.memoizedProps=n.props,r&&S(t,!0),t.child}function d(e){var t=e.stateNode;t.pendingContext?E(e,t.pendingContext,t.pendingContext!==t.context):t.context&&E(e,t.context,!1),b(e,t.containerInfo)}function p(e,t,n,r){var o=e.child;for(null!==o&&(o.return=e);null!==o;){switch(o.tag){case 12:var a=0|o.stateNode;if(o.type===t&&0!=(a&n)){for(a=o;null!==a;){var i=a.alternate;if(0===a.expirationTime||a.expirationTime>r)a.expirationTime=r,null!==i&&(0===i.expirationTime||i.expirationTime>r)&&(i.expirationTime=r);else{if(null===i||!(0===i.expirationTime||i.expirationTime>r))break;i.expirationTime=r}a=a.return}a=null}else a=o.child;break;case 13:a=o.type===e.type?null:o.child;break;default:a=o.child}if(null!==a)a.return=o;else for(a=o;null!==a;){if(a===e){a=null;break}if(null!==(o=a.sibling)){a=o;break}a=a.return}o=a}}function h(e,t,n){var r=t.type._context,o=t.pendingProps,a=t.memoizedProps;if(!k()&&a===o)return t.stateNode=0,C(t),m(e,t);var i=o.value;if(t.memoizedProps=o,null===a)i=1073741823;else if(a.value===o.value){if(a.children===o.children)return t.stateNode=0,C(t),m(e,t);i=0}else{var l=a.value;if(l===i&&(0!==l||1/l==1/i)||l!==l&&i!==i){if(a.children===o.children)return t.stateNode=0,C(t),m(e,t);i=0}else if(i="function"==typeof r._calculateChangedBits?r._calculateChangedBits(l,i):1073741823,0===(i|=0)){if(a.children===o.children)return t.stateNode=0,C(t),m(e,t)}else p(t,r,i,n)}return t.stateNode=i,C(t),u(e,t,o.children),t.child}function m(e,t){if(null!==e&&t.child!==e.child&&r("153"),null!==t.child){e=t.child;var n=Je(e,e.pendingProps,e.expirationTime);for(t.child=n,n.return=t;null!==e.sibling;)e=e.sibling,n=n.sibling=Je(e,e.pendingProps,e.expirationTime),n.return=t;n.sibling=null}return t.child}var g=e.shouldSetTextContent,y=e.shouldDeprioritizeSubtree,v=t.pushHostContext,b=t.pushHostContainer,C=o.pushProvider,w=n.getMaskedContext,x=n.getUnmaskedContext,k=n.hasContextChanged,T=n.pushContextProvider,E=n.pushTopLevelContextObject,S=n.invalidateContextProvider,_=a.enterHydrationState,P=a.resetHydrationState,N=a.tryToClaimNextHydratableInstance;e=mt(n,i,l,function(e,t){e.memoizedProps=t},function(e,t){e.memoizedState=t});var I=e.adoptClassInstance,O=e.callGetDerivedStateFromProps,R=e.constructClassInstance,D=e.mountClassInstance,F=e.resumeMountClassInstance,M=e.updateClassInstance;return{beginWork:function(e,t,n){if(0===t.expirationTime||t.expirationTime>n){switch(t.tag){case 3:d(t);break;case 2:T(t);break;case 4:b(t,t.stateNode.containerInfo);break;case 13:C(t)}return null}switch(t.tag){case 0:null!==e&&r("155");var o=t.type,a=t.pendingProps,i=x(t);return i=w(t,i),o=o(a,i),t.effectTag|=1,"object"==typeof o&&null!==o&&"function"==typeof o.render&&void 0===o.$$typeof?(i=t.type,t.tag=2,t.memoizedState=null!==o.state&&void 0!==o.state?o.state:null,"function"==typeof i.getDerivedStateFromProps&&null!==(a=O(t,o,a,t.memoizedState))&&void 0!==a&&(t.memoizedState=fn({},t.memoizedState,a)),a=T(t),I(t,o),D(t,n),e=f(e,t,!0,a,!1,n)):(t.tag=1,u(e,t,o),t.memoizedProps=a,e=t.child),e;case 1:return a=t.type,n=t.pendingProps,k()||t.memoizedProps!==n?(o=x(t),o=w(t,o),a=a(n,o),t.effectTag|=1,u(e,t,a),t.memoizedProps=n,e=t.child):e=m(e,t),e;case 2:a=T(t),null===e?null===t.stateNode?(R(t,t.pendingProps),D(t,n),o=!0):o=F(t,n):o=M(e,t,n),i=!1;var l=t.updateQueue;return null!==l&&null!==l.capturedValues&&(i=o=!0),f(e,t,o,a,i,n);case 3:e:if(d(t),null!==(o=t.updateQueue)){if(i=t.memoizedState,a=pt(e,t,o,null,null,n),t.memoizedState=a,null!==(o=t.updateQueue)&&null!==o.capturedValues)o=null;else{if(i===a){P(),e=m(e,t);break e}o=a.element}i=t.stateNode,(null===e||null===e.child)&&i.hydrate&&_(t)?(t.effectTag|=2,t.child=vo(t,null,o,n)):(P(),u(e,t,o)),t.memoizedState=a,e=t.child}else P(),e=m(e,t);return e;case 5:return v(t),null===e&&N(t),a=t.type,l=t.memoizedProps,o=t.pendingProps,i=null!==e?e.memoizedProps:null,k()||l!==o||((l=1&t.mode&&y(a,o))&&(t.expirationTime=1073741823),l&&1073741823===n)?(l=o.children,g(a,o)?l=null:i&&g(a,i)&&(t.effectTag|=16),s(e,t),1073741823!==n&&1&t.mode&&y(a,o)?(t.expirationTime=1073741823,t.memoizedProps=o,e=null):(u(e,t,l),t.memoizedProps=o,e=t.child)):e=m(e,t),e;case 6:return null===e&&N(t),t.memoizedProps=t.pendingProps,null;case 8:t.tag=7;case 7:return a=t.pendingProps,k()||t.memoizedProps!==a||(a=t.memoizedProps),o=a.children,t.stateNode=null===e?vo(t,t.stateNode,o,n):yo(t,e.stateNode,o,n),t.memoizedProps=a,t.stateNode;case 9:return null;case 4:return b(t,t.stateNode.containerInfo),a=t.pendingProps,k()||t.memoizedProps!==a?(null===e?t.child=yo(t,null,a,n):u(e,t,a),t.memoizedProps=a,e=t.child):e=m(e,t),e;case 14:return n=t.type.render,n=n(t.pendingProps,t.ref),u(e,t,n),t.memoizedProps=n,t.child;case 10:return n=t.pendingProps,k()||t.memoizedProps!==n?(u(e,t,n),t.memoizedProps=n,e=t.child):e=m(e,t),e;case 11:return n=t.pendingProps.children,k()||null!==n&&t.memoizedProps!==n?(u(e,t,n),t.memoizedProps=n,e=t.child):e=m(e,t),e;case 13:return h(e,t,n);case 12:o=t.type,i=t.pendingProps;var c=t.memoizedProps;return a=o._currentValue,l=o._changedBits,k()||0!==l||c!==i?(t.memoizedProps=i,c=i.unstable_observedBits,void 0!==c&&null!==c||(c=1073741823),t.stateNode=c,0!=(l&c)&&p(t,o,l,n),n=i.children,n=n(a),u(e,t,n),e=t.child):e=m(e,t),e;default:r("156")}}}}function Ct(e,t,n,o,a){function i(e){e.effectTag|=4}var l=e.createInstance,u=e.createTextInstance,c=e.appendInitialChild,s=e.finalizeInitialChildren,f=e.prepareUpdate,d=e.persistence,p=t.getRootHostContainer,h=t.popHostContext,m=t.getHostContext,g=t.popHostContainer,y=n.popContextProvider,v=n.popTopLevelContextObject,b=o.popProvider,C=a.prepareToHydrateHostInstance,w=a.prepareToHydrateHostTextInstance,x=a.popHydrationState,k=void 0,T=void 0,E=void 0;return e.mutation?(k=function(){},T=function(e,t,n){(t.updateQueue=n)&&i(t)},E=function(e,t,n,r){n!==r&&i(t)}):r(d?"235":"236"),{completeWork:function(e,t,n){var o=t.pendingProps;switch(t.tag){case 1:return null;case 2:return y(t),e=t.stateNode,o=t.updateQueue,null!==o&&null!==o.capturedValues&&(t.effectTag&=-65,"function"==typeof e.componentDidCatch?t.effectTag|=256:o.capturedValues=null),null;case 3:return g(t),v(t),o=t.stateNode,o.pendingContext&&(o.context=o.pendingContext,o.pendingContext=null),null!==e&&null!==e.child||(x(t),t.effectTag&=-3),k(t),e=t.updateQueue,null!==e&&null!==e.capturedValues&&(t.effectTag|=256),null;case 5:h(t),n=p();var a=t.type;if(null!==e&&null!=t.stateNode){var d=e.memoizedProps,S=t.stateNode,_=m();S=f(S,a,d,o,n,_),T(e,t,S,a,d,o,n,_),e.ref!==t.ref&&(t.effectTag|=128)}else{if(!o)return null===t.stateNode&&r("166"),null;if(e=m(),x(t))C(t,n,e)&&i(t);else{d=l(a,o,n,e,t);e:for(_=t.child;null!==_;){if(5===_.tag||6===_.tag)c(d,_.stateNode);else if(4!==_.tag&&null!==_.child){_.child.return=_,_=_.child;continue}if(_===t)break;for(;null===_.sibling;){if(null===_.return||_.return===t)break e;_=_.return}_.sibling.return=_.return,_=_.sibling}s(d,a,o,n,e)&&i(t),t.stateNode=d}null!==t.ref&&(t.effectTag|=128)}return null;case 6:if(e&&null!=t.stateNode)E(e,t,e.memoizedProps,o);else{if("string"!=typeof o)return null===t.stateNode&&r("166"),null;e=p(),n=m(),x(t)?w(t)&&i(t):t.stateNode=u(o,e,n,t)}return null;case 7:(o=t.memoizedProps)||r("165"),t.tag=8,a=[];e:for((d=t.stateNode)&&(d.return=t);null!==d;){if(5===d.tag||6===d.tag||4===d.tag)r("247");else if(9===d.tag)a.push(d.pendingProps.value);else if(null!==d.child){d.child.return=d,d=d.child;continue}for(;null===d.sibling;){if(null===d.return||d.return===t)break e;d=d.return}d.sibling.return=d.return,d=d.sibling}return d=o.handler,o=d(o.props,a),t.child=yo(t,null!==e?e.child:null,o,n),t.child;case 8:return t.tag=7,null;case 9:case 14:case 10:case 11:return null;case 4:return g(t),k(t),null;case 13:return b(t),null;case 12:return null;case 0:r("167");default:r("156")}}}}function wt(e,t,n,r,o){var a=e.popHostContainer,i=e.popHostContext,l=t.popContextProvider,u=t.popTopLevelContextObject,c=n.popProvider;return{throwException:function(e,t,n){t.effectTag|=512,t.firstEffect=t.lastEffect=null,t={value:n,source:t,stack:ae(t)};do{switch(e.tag){case 3:return st(e),e.updateQueue.capturedValues=[t],void(e.effectTag|=1024);case 2:if(n=e.stateNode,0==(64&e.effectTag)&&null!==n&&"function"==typeof n.componentDidCatch&&!o(n)){st(e),n=e.updateQueue;var r=n.capturedValues;return null===r?n.capturedValues=[t]:r.push(t),void(e.effectTag|=1024)}}e=e.return}while(null!==e)},unwindWork:function(e){switch(e.tag){case 2:l(e);var t=e.effectTag;return 1024&t?(e.effectTag=-1025&t|64,e):null;case 3:return a(e),u(e),t=e.effectTag,1024&t?(e.effectTag=-1025&t|64,e):null;case 5:return i(e),null;case 4:return a(e),null;case 13:return c(e),null;default:return null}},unwindInterruptedWork:function(e){switch(e.tag){case 2:l(e);break;case 3:a(e),u(e);break;case 5:i(e);break;case 4:a(e);break;case 13:c(e)}}}}function xt(e,t){var n=t.source;null===t.stack&&ae(n),null!==n&&oe(n),t=t.value,null!==e&&2===e.tag&&oe(e);try{t&&t.suppressReactErrorLogging||console.error(t)}catch(e){e&&e.suppressReactErrorLogging||console.error(e)}}function kt(e,t,n,o,a){function i(e){var n=e.ref;if(null!==n)if("function"==typeof n)try{n(null)}catch(n){t(e,n)}else n.current=null}function l(e){switch("function"==typeof lt&<(e),e.tag){case 2:i(e);var n=e.stateNode;if("function"==typeof n.componentWillUnmount)try{n.props=e.memoizedProps,n.state=e.memoizedState,n.componentWillUnmount()}catch(n){t(e,n)}break;case 5:i(e);break;case 7:u(e.stateNode);break;case 4:d&&s(e)}}function u(e){for(var t=e;;)if(l(t),null===t.child||d&&4===t.tag){if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return;t=t.return}t.sibling.return=t.return,t=t.sibling}else t.child.return=t,t=t.child}function c(e){return 5===e.tag||3===e.tag||4===e.tag}function s(e){for(var t=e,n=!1,o=void 0,a=void 0;;){if(!n){n=t.return;e:for(;;){switch(null===n&&r("160"),n.tag){case 5:o=n.stateNode,a=!1;break e;case 3:case 4:o=n.stateNode.containerInfo,a=!0;break e}n=n.return}n=!0}if(5===t.tag||6===t.tag)u(t),a?x(o,t.stateNode):w(o,t.stateNode);else if(4===t.tag?o=t.stateNode.containerInfo:l(t),null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return;t=t.return,4===t.tag&&(n=!1)}t.sibling.return=t.return,t=t.sibling}}var f=e.getPublicInstance,d=e.mutation;e=e.persistence,d||r(e?"235":"236");var p=d.commitMount,h=d.commitUpdate,m=d.resetTextContent,g=d.commitTextUpdate,y=d.appendChild,v=d.appendChildToContainer,b=d.insertBefore,C=d.insertInContainerBefore,w=d.removeChild,x=d.removeChildFromContainer;return{commitBeforeMutationLifeCycles:function(e,t){switch(t.tag){case 2:if(2048&t.effectTag&&null!==e){var n=e.memoizedProps,o=e.memoizedState;e=t.stateNode,e.props=t.memoizedProps,e.state=t.memoizedState,t=e.getSnapshotBeforeUpdate(n,o),e.__reactInternalSnapshotBeforeUpdate=t}break;case 3:case 5:case 6:case 4:break;default:r("163")}},commitResetTextContent:function(e){m(e.stateNode)},commitPlacement:function(e){e:{for(var t=e.return;null!==t;){if(c(t)){var n=t;break e}t=t.return}r("160"),n=void 0}var o=t=void 0;switch(n.tag){case 5:t=n.stateNode,o=!1;break;case 3:case 4:t=n.stateNode.containerInfo,o=!0;break;default:r("161")}16&n.effectTag&&(m(t),n.effectTag&=-17);e:t:for(n=e;;){for(;null===n.sibling;){if(null===n.return||c(n.return)){n=null;break e}n=n.return}for(n.sibling.return=n.return,n=n.sibling;5!==n.tag&&6!==n.tag;){if(2&n.effectTag)continue t;if(null===n.child||4===n.tag)continue t;n.child.return=n,n=n.child}if(!(2&n.effectTag)){n=n.stateNode;break e}}for(var a=e;;){if(5===a.tag||6===a.tag)n?o?C(t,a.stateNode,n):b(t,a.stateNode,n):o?v(t,a.stateNode):y(t,a.stateNode);else if(4!==a.tag&&null!==a.child){a.child.return=a,a=a.child;continue}if(a===e)break;for(;null===a.sibling;){if(null===a.return||a.return===e)return;a=a.return}a.sibling.return=a.return,a=a.sibling}},commitDeletion:function(e){s(e),e.return=null,e.child=null,e.alternate&&(e.alternate.child=null,e.alternate.return=null)},commitWork:function(e,t){switch(t.tag){case 2:break;case 5:var n=t.stateNode;if(null!=n){var o=t.memoizedProps;e=null!==e?e.memoizedProps:o;var a=t.type,i=t.updateQueue;t.updateQueue=null,null!==i&&h(n,i,a,e,o,t)}break;case 6:null===t.stateNode&&r("162"),n=t.memoizedProps,g(t.stateNode,null!==e?e.memoizedProps:n,n);break;case 3:break;default:r("163")}},commitLifeCycles:function(e,t,n){switch(n.tag){case 2:if(e=n.stateNode,4&n.effectTag)if(null===t)e.props=n.memoizedProps,e.state=n.memoizedState,e.componentDidMount();else{var o=t.memoizedProps;t=t.memoizedState,e.props=n.memoizedProps,e.state=n.memoizedState,e.componentDidUpdate(o,t,e.__reactInternalSnapshotBeforeUpdate)}n=n.updateQueue,null!==n&&ht(n,e);break;case 3:if(null!==(t=n.updateQueue)){if(e=null,null!==n.child)switch(n.child.tag){case 5:e=f(n.child.stateNode);break;case 2:e=n.child.stateNode}ht(t,e)}break;case 5:e=n.stateNode,null===t&&4&n.effectTag&&p(e,n.type,n.memoizedProps,n);break;case 6:case 4:break;default:r("163")}},commitErrorLogging:function(e,t){switch(e.tag){case 2:var n=e.type;t=e.stateNode;var o=e.updateQueue;(null===o||null===o.capturedValues)&&r("264");var i=o.capturedValues;for(o.capturedValues=null,"function"!=typeof n.getDerivedStateFromCatch&&a(t),t.props=e.memoizedProps,t.state=e.memoizedState,n=0;nt||(n.current=e[t],e[t]=null,t--)},push:function(n,r){t++,e[t]=n.current,n.current=r},checkThatStackIsEmpty:function(){},resetStackAfterFatalErrorInDev:function(){}}}function Nt(e){function t(){if(null!==J)for(var e=J.return;null!==e;)R(e),e=e.return;ee=null,te=0,J=null,oe=!1}function n(e){return null!==ie&&ie.has(e)}function o(e){for(;;){var t=e.alternate,n=e.return,r=e.sibling;if(0==(512&e.effectTag)){t=N(t,e,te);var o=e;if(1073741823===te||1073741823!==o.expirationTime){e:switch(o.tag){case 3:case 2:var a=o.updateQueue;a=null===a?0:a.expirationTime;break e;default:a=0}for(var i=o.child;null!==i;)0!==i.expirationTime&&(0===a||a>i.expirationTime)&&(a=i.expirationTime),i=i.sibling;o.expirationTime=a}if(null!==t)return t;if(null!==n&&0==(512&n.effectTag)&&(null===n.firstEffect&&(n.firstEffect=e.firstEffect),null!==e.lastEffect&&(null!==n.lastEffect&&(n.lastEffect.nextEffect=e.firstEffect),n.lastEffect=e.lastEffect),1he)&&(he=e),e}function s(e,n){e:{for(;null!==e;){if((0===e.expirationTime||e.expirationTime>n)&&(e.expirationTime=n),null!==e.alternate&&(0===e.alternate.expirationTime||e.alternate.expirationTime>n)&&(e.alternate.expirationTime=n),null===e.return){if(3!==e.tag){n=void 0;break e}var o=e.stateNode;!Z&&0!==te&&nke&&r("185")}e=e.return}n=void 0}return n}function f(){return G=V()-$,q=2+(G/10|0)}function d(e,t,n,r,o){var a=X;X=1;try{return e(t,n,r,o)}finally{X=a}}function p(e){if(0!==ce){if(e>ce)return;B(se)}var t=V()-$;ce=e,se=W(g,{timeout:10*(e-2)-t})}function h(e,t){if(null===e.nextScheduledRoot)e.remainingExpirationTime=t,null===ue?(le=ue=e,e.nextScheduledRoot=e):(ue=ue.nextScheduledRoot=e,ue.nextScheduledRoot=le);else{var n=e.remainingExpirationTime;(0===n||t=pe)&&(!me||f()>=pe);)C(de,pe,!me),m();else for(;null!==de&&0!==pe&&(0===e||e>=pe);)C(de,pe,!1),m();null!==ve&&(ce=0,se=-1),0!==pe&&p(pe),ve=null,me=!1,b()}function b(){if(Te=0,null!==xe){var e=xe;xe=null;for(var t=0;tEe)&&(me=!0)}function k(e){null===de&&r("246"),de.remainingExpirationTime=0,ge||(ge=!0,ye=e)}var T=Pt(),E=Tt(e,T),S=St(T);T=_t(T);var _=Et(e),P=bt(e,E,S,T,_,s,c).beginWork,N=Ct(e,E,S,T,_).completeWork;E=wt(E,S,T,s,n);var I=E.throwException,O=E.unwindWork,R=E.unwindInterruptedWork;E=kt(e,u,s,c,function(e){null===ie?ie=new Set([e]):ie.add(e)},f);var D=E.commitBeforeMutationLifeCycles,F=E.commitResetTextContent,M=E.commitPlacement,U=E.commitDeletion,L=E.commitWork,z=E.commitLifeCycles,j=E.commitErrorLogging,A=E.commitAttachRef,H=E.commitDetachRef,V=e.now,W=e.scheduleDeferredCallback,B=e.cancelDeferredCallback,K=e.prepareForCommit,Q=e.resetAfterCommit,$=V(),q=2,G=$,Y=0,X=0,Z=!1,J=null,ee=null,te=0,ne=null,re=!1,oe=!1,ie=null,le=null,ue=null,ce=0,se=-1,fe=!1,de=null,pe=0,he=0,me=!1,ge=!1,ye=null,ve=null,be=!1,Ce=!1,we=!1,xe=null,ke=1e3,Te=0,Ee=1;return{recalculateCurrentTime:f,computeExpirationForFiber:c,scheduleWork:s,requestWork:h,flushRoot:function(e,t){fe&&r("253"),de=e,pe=t,C(e,t,!1),y(),b()},batchedUpdates:function(e,t){var n=be;be=!0;try{return e(t)}finally{(be=n)||fe||y()}},unbatchedUpdates:function(e,t){if(be&&!Ce){Ce=!0;try{return e(t)}finally{Ce=!1}}return e(t)},flushSync:function(e,t){fe&&r("187");var n=be;be=!0;try{return d(e,t)}finally{be=n,y()}},flushControlled:function(e){var t=be;be=!0;try{d(e)}finally{(be=t)||fe||v(1,!1,null)}},deferredUpdates:function(e){var t=X;X=25*(1+((f()+500)/25|0));try{return e()}finally{X=t}},syncUpdates:d,interactiveUpdates:function(e,t,n){if(we)return e(t,n);be||fe||0===he||(v(he,!1,null),he=0);var r=we,o=be;be=we=!0;try{return e(t,n)}finally{we=r,(be=o)||fe||y()}},flushInteractiveUpdates:function(){fe||0===he||(v(he,!1,null),he=0)},computeUniqueAsyncExpiration:function(){var e=25*(1+((f()+500)/25|0));return e<=Y&&(e=Y+1),Y=e},legacyContext:S}}function It(e){function t(e,t,n,r,o,a){if(r=t.current,n){n=n._reactInternalFiber;var l=u(n);n=c(n)?s(n,l):l}else n=gn;return null===t.context?t.context=n:t.pendingContext=n,t=a,ft(r,{expirationTime:o,partialState:{element:e},callback:void 0===t?null:t,isReplace:!1,isForced:!1,capturedValue:null,next:null}),i(r,o),o}function n(e){return e=Me(e),null===e?null:e.stateNode}var r=e.getPublicInstance;e=Nt(e);var o=e.recalculateCurrentTime,a=e.computeExpirationForFiber,i=e.scheduleWork,l=e.legacyContext,u=l.findCurrentUnmaskedContext,c=l.isContextProvider,s=l.processChildContext;return{createContainer:function(e,t,n){return t=new Ze(3,null,null,t?3:0),e={current:t,containerInfo:e,pendingChildren:null,pendingCommitExpirationTime:0,finishedWork:null,context:null,pendingContext:null,hydrate:n,remainingExpirationTime:0,firstBatch:null,nextScheduledRoot:null},t.stateNode=e},updateContainer:function(e,n,r,i){var l=n.current,u=o();return l=a(l),t(e,n,r,u,l,i)},updateContainerAtExpirationTime:function(e,n,r,a,i){return t(e,n,r,o(),a,i)},flushRoot:e.flushRoot,requestWork:e.requestWork,computeUniqueAsyncExpiration:e.computeUniqueAsyncExpiration,batchedUpdates:e.batchedUpdates,unbatchedUpdates:e.unbatchedUpdates,deferredUpdates:e.deferredUpdates,syncUpdates:e.syncUpdates,interactiveUpdates:e.interactiveUpdates,flushInteractiveUpdates:e.flushInteractiveUpdates,flushControlled:e.flushControlled,flushSync:e.flushSync,getPublicRootInstance:function(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return r(e.child.stateNode);default:return e.child.stateNode}},findHostInstance:n,findHostInstanceWithNoPortals:function(e){return e=Ue(e),null===e?null:e.stateNode},injectIntoDevTools:function(e){var t=e.findFiberByHostInstance;return at(fn({},e,{findHostInstanceByFiber:function(e){return n(e)},findFiberByHostInstance:function(e){return t?t(e):null}}))}}}function Ot(e,t,n){var r=3=t.length||r("93"),t=t[0]),n=""+t),null==n&&(n="")),e._wrapperState={initialValue:""+n}}function zt(e,t){var n=t.value;null!=n&&(n=""+n,n!==e.value&&(e.value=n),null==t.defaultValue&&(e.defaultValue=n)),null!=t.defaultValue&&(e.defaultValue=t.defaultValue)}function jt(e){var t=e.textContent;t===e._wrapperState.initialValue&&(e.value=t)}function At(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Ht(e,t){return null==e||"http://www.w3.org/1999/xhtml"===e?At(t):"http://www.w3.org/2000/svg"===e&&"foreignObject"===t?"http://www.w3.org/1999/xhtml":e}function Vt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t}function Wt(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=0===n.indexOf("--"),o=n,a=t[n];o=null==a||"boolean"==typeof a||""===a?"":r||"number"!=typeof a||0===a||Ao.hasOwnProperty(o)&&Ao[o]?(""+a).trim():a+"px","float"===n&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}function Bt(e,t,n){t&&(Vo[e]&&(null!=t.children||null!=t.dangerouslySetInnerHTML)&&r("137",e,n()),null!=t.dangerouslySetInnerHTML&&(null!=t.children&&r("60"),"object"==typeof t.dangerouslySetInnerHTML&&"__html"in t.dangerouslySetInnerHTML||r("61")),null!=t.style&&"object"!=typeof t.style&&r("62",n()))}function Kt(e,t){if(-1===e.indexOf("-"))return"string"==typeof t.is;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}function Qt(e,t){e=9===e.nodeType||11===e.nodeType?e:e.ownerDocument;var n=$e(e);t=kn[t];for(var r=0;r<\/script>",e=e.removeChild(e.firstChild)):e="string"==typeof t.is?n.createElement(e,{is:t.is}):n.createElement(e):e=n.createElementNS(r,e),e}function qt(e,t){return(9===t.nodeType?t:t.ownerDocument).createTextNode(e)}function Gt(e,t,n,r){var o=Kt(t,n);switch(t){case"iframe":case"object":He("topLoad","load",e);var a=n;break;case"video":case"audio":for(a in eo)eo.hasOwnProperty(a)&&He(a,eo[a],e);a=n;break;case"source":He("topError","error",e),a=n;break;case"img":case"image":case"link":He("topError","error",e),He("topLoad","load",e),a=n;break;case"form":He("topReset","reset",e),He("topSubmit","submit",e),a=n;break;case"details":He("topToggle","toggle",e),a=n;break;case"input":pe(e,n),a=de(e,n),He("topInvalid","invalid",e),Qt(r,"onChange");break;case"option":a=Dt(e,n);break;case"select":Mt(e,n),a=fn({},n,{value:void 0}),He("topInvalid","invalid",e),Qt(r,"onChange");break;case"textarea":Lt(e,n),a=Ut(e,n),He("topInvalid","invalid",e),Qt(r,"onChange");break;default:a=n}Bt(t,a,Bo);var i,l=a;for(i in l)if(l.hasOwnProperty(i)){var u=l[i];"style"===i?Wt(e,u,Bo):"dangerouslySetInnerHTML"===i?null!=(u=u?u.__html:void 0)&&jo(e,u):"children"===i?"string"==typeof u?("textarea"!==t||""!==u)&&Vt(e,u):"number"==typeof u&&Vt(e,""+u):"suppressContentEditableWarning"!==i&&"suppressHydrationWarning"!==i&&"autoFocus"!==i&&(xn.hasOwnProperty(i)?null!=u&&Qt(r,i):null!=u&&fe(e,i,u,o))}switch(t){case"input":te(e),ge(e,n);break;case"textarea":te(e),jt(e,n);break;case"option":null!=n.value&&e.setAttribute("value",n.value);break;case"select":e.multiple=!!n.multiple,t=n.value,null!=t?Ft(e,!!n.multiple,t,!1):null!=n.defaultValue&&Ft(e,!!n.multiple,n.defaultValue,!0);break;default:"function"==typeof a.onClick&&(e.onclick=dn)}}function Yt(e,t,n,r,o){var a=null;switch(t){case"input":n=de(e,n),r=de(e,r),a=[];break;case"option":n=Dt(e,n),r=Dt(e,r),a=[];break;case"select":n=fn({},n,{value:void 0}),r=fn({},r,{value:void 0}),a=[];break;case"textarea":n=Ut(e,n),r=Ut(e,r),a=[];break;default:"function"!=typeof n.onClick&&"function"==typeof r.onClick&&(e.onclick=dn)}Bt(t,r,Bo),t=e=void 0;var i=null;for(e in n)if(!r.hasOwnProperty(e)&&n.hasOwnProperty(e)&&null!=n[e])if("style"===e){var l=n[e];for(t in l)l.hasOwnProperty(t)&&(i||(i={}),i[t]="")}else"dangerouslySetInnerHTML"!==e&&"children"!==e&&"suppressContentEditableWarning"!==e&&"suppressHydrationWarning"!==e&&"autoFocus"!==e&&(xn.hasOwnProperty(e)?a||(a=[]):(a=a||[]).push(e,null));for(e in r){var u=r[e];if(l=null!=n?n[e]:void 0,r.hasOwnProperty(e)&&u!==l&&(null!=u||null!=l))if("style"===e)if(l){for(t in l)!l.hasOwnProperty(t)||u&&u.hasOwnProperty(t)||(i||(i={}),i[t]="");for(t in u)u.hasOwnProperty(t)&&l[t]!==u[t]&&(i||(i={}),i[t]=u[t])}else i||(a||(a=[]),a.push(e,i)),i=u;else"dangerouslySetInnerHTML"===e?(u=u?u.__html:void 0,l=l?l.__html:void 0,null!=u&&l!==u&&(a=a||[]).push(e,""+u)):"children"===e?l===u||"string"!=typeof u&&"number"!=typeof u||(a=a||[]).push(e,""+u):"suppressContentEditableWarning"!==e&&"suppressHydrationWarning"!==e&&(xn.hasOwnProperty(e)?(null!=u&&Qt(o,e),a||l===u||(a=[])):(a=a||[]).push(e,u))}return i&&(a=a||[]).push("style",i),a}function Xt(e,t,n,r,o){"input"===n&&"radio"===o.type&&null!=o.name&&he(e,o),Kt(n,r),r=Kt(n,o);for(var a=0;a=Bn),$n=String.fromCharCode(32),qn={beforeInput:{phasedRegistrationNames:{bubbled:"onBeforeInput",captured:"onBeforeInputCapture"},dependencies:["topCompositionEnd","topKeyPress","topTextInput","topPaste"]},compositionEnd:{phasedRegistrationNames:{bubbled:"onCompositionEnd",captured:"onCompositionEndCapture"},dependencies:"topBlur topCompositionEnd topKeyDown topKeyPress topKeyUp topMouseDown".split(" ")},compositionStart:{phasedRegistrationNames:{bubbled:"onCompositionStart",captured:"onCompositionStartCapture"},dependencies:"topBlur topCompositionStart topKeyDown topKeyPress topKeyUp topMouseDown".split(" ")},compositionUpdate:{phasedRegistrationNames:{bubbled:"onCompositionUpdate",captured:"onCompositionUpdateCapture"},dependencies:"topBlur topCompositionUpdate topKeyDown topKeyPress topKeyUp topMouseDown".split(" ")}},Gn=!1,Yn=!1,Xn={eventTypes:qn,extractEvents:function(e,t,n,r){var o=void 0,a=void 0;if(Wn)e:{switch(e){case"topCompositionStart":o=qn.compositionStart;break e;case"topCompositionEnd":o=qn.compositionEnd;break e;case"topCompositionUpdate":o=qn.compositionUpdate;break e}o=void 0}else Yn?z(e,n)&&(o=qn.compositionEnd):"topKeyDown"===e&&229===n.keyCode&&(o=qn.compositionStart);return o?(Qn&&(Yn||o!==qn.compositionStart?o===qn.compositionEnd&&Yn&&(a=R()):(Ln._root=r,Ln._startText=D(),Yn=!0)),o=An.getPooled(o,t,n,r),a?o.data=a:null!==(a=j(n))&&(o.data=a),N(o),a=o):a=null,(e=Kn?A(e,n):H(e,n))?(t=Hn.getPooled(qn.beforeInput,t,n,r),t.data=e,N(t)):t=null,null===a?t:null===t?a:[a,t]}},Zn=null,Jn=null,er=null,tr={injectFiberControlledHostComponent:function(e){Zn=e}},nr=Object.freeze({injection:tr,enqueueStateRestore:W,needsStateRestore:B,restoreStateIfNeeded:K}),rr=!1,or={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0},ar=cn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,ir="function"==typeof Symbol&&Symbol.for,lr=ir?Symbol.for("react.element"):60103,ur=ir?Symbol.for("react.call"):60104,cr=ir?Symbol.for("react.return"):60105,sr=ir?Symbol.for("react.portal"):60106,fr=ir?Symbol.for("react.fragment"):60107,dr=ir?Symbol.for("react.strict_mode"):60108,pr=ir?Symbol.for("react.provider"):60109,hr=ir?Symbol.for("react.context"):60110,mr=ir?Symbol.for("react.async_mode"):60111,gr=ir?Symbol.for("react.forward_ref"):60112,yr="function"==typeof Symbol&&Symbol.iterator,vr=/^[: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][: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\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,br={},Cr={},wr={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){wr[e]=new ce(e,0,!1,e,null)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];wr[t]=new ce(t,1,!1,e[1],null)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){wr[e]=new ce(e,2,!1,e.toLowerCase(),null)}),["autoReverse","externalResourcesRequired","preserveAlpha"].forEach(function(e){wr[e]=new ce(e,2,!1,e,null)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){wr[e]=new ce(e,3,!1,e.toLowerCase(),null)}),["checked","multiple","muted","selected"].forEach(function(e){wr[e]=new ce(e,3,!0,e.toLowerCase(),null)}),["capture","download"].forEach(function(e){wr[e]=new ce(e,4,!1,e.toLowerCase(),null)}),["cols","rows","size","span"].forEach(function(e){wr[e]=new ce(e,6,!1,e.toLowerCase(),null)}),["rowSpan","start"].forEach(function(e){wr[e]=new ce(e,5,!1,e.toLowerCase(),null)});var xr=/[\-\:]([a-z])/g;"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".split(" ").forEach(function(e){var t=e.replace(xr,se);wr[t]=new ce(t,1,!1,e,null)}),"xlink:actuate xlink:arcrole xlink:href xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(xr,se);wr[t]=new ce(t,1,!1,e,"http://www.w3.org/1999/xlink")}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(xr,se);wr[t]=new ce(t,1,!1,e,"http://www.w3.org/XML/1998/namespace")}),wr.tabIndex=new ce("tabIndex",1,!1,"tabindex",null);var kr={change:{phasedRegistrationNames:{bubbled:"onChange",captured:"onChangeCapture"},dependencies:"topBlur topChange topClick topFocus topInput topKeyDown topKeyUp topSelectionChange".split(" ")}},Tr=null,Er=null,Sr=!1;sn.canUseDOM&&(Sr=Z("input")&&(!document.documentMode||9=document.documentMode,ao={select:{phasedRegistrationNames:{bubbled:"onSelect",captured:"onSelectCapture"},dependencies:"topBlur topContextMenu topFocus topKeyDown topKeyUp topMouseDown topMouseUp topSelectionChange".split(" ")}},io=null,lo=null,uo=null,co=!1,so={eventTypes:ao,extractEvents:function(e,t,n,r){var o,a=r.window===r?r.document:9===r.nodeType?r:r.ownerDocument;if(!(o=!a)){e:{a=$e(a),o=kn.onSelect;for(var i=0;i=Oo-e){if(!(-1!==No&&No<=e))return void(Io||(Io=!0,requestAnimationFrame(Uo)));Fo.didTimeout=!0}else Fo.didTimeout=!1;No=-1,e=_o,_o=null,null!==e&&e(Fo)}},!1);var Uo=function(e){Io=!1;var t=e-Oo+Do;tt&&(t=8),Do=t"+t+"",t=zo.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}}),Ao={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Ho=["Webkit","ms","Moz","O"];Object.keys(Ao).forEach(function(e){Ho.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Ao[t]=Ao[e]})});var Vo=fn({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0}),Wo=Lo.html,Bo=dn.thatReturns(""),Ko=Object.freeze({createElement:$t,createTextNode:qt,setInitialProperties:Gt,diffProperties:Yt,updateProperties:Xt,diffHydratedProperties:Zt,diffHydratedText:Jt,warnForUnmatchedText:function(){},warnForDeletedHydratableElement:function(){},warnForDeletedHydratableText:function(){},warnForInsertedHydratedElement:function(){},warnForInsertedHydratedText:function(){},restoreControlledState:function(e,t,n){switch(t){case"input":if(me(e,n),t=n.name,"radio"===n.type&&null!=t){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;tr&&(o=r,r=e,e=o),o=Ge(n,e);var a=Ge(n,r);if(o&&a&&(1!==t.rangeCount||t.anchorNode!==o.node||t.anchorOffset!==o.offset||t.focusNode!==a.node||t.focusOffset!==a.offset)){var i=document.createRange();i.setStart(o.node,o.offset),t.removeAllRanges(),e>r?(t.addRange(i),t.extend(a.node,a.offset)):(i.setEnd(a.node,a.offset),t.addRange(i))}}for(t=[],e=n;e=e.parentNode;)1===e.nodeType&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(n.focus(),n=0;n=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function u(e,t,n){var r=(0,g.default)(t,t.selectionEnd),o={hookType:e,cursor:{selectionStart:t.selectionStart,selectionEnd:t.selectionEnd,top:r.top,left:r.left,height:r.height}};return n?(o.text=t.value.substr(n,t.selectionStart),o):o}Object.defineProperty(t,"__esModule",{value:!0});var c=Object.assign||function(e){for(var t=1;tparseInt(s.height)&&(c.overflowY="scroll"):c.overflow="hidden",u.textContent=e.value.substring(0,t),f&&(u.textContent=u.textContent.replace(/\s/g," "));var d=document.createElement("span");d.textContent=e.value.substring(t)||".",u.appendChild(d);var p={top:d.offsetTop+parseInt(s.borderTopWidth),left:d.offsetLeft+parseInt(s.borderLeftWidth),height:parseInt(s.lineHeight)};return i?d.style.backgroundColor="#aaa":document.body.removeChild(u),p}var n=["direction","boxSizing","width","height","overflowX","overflowY","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderStyle","paddingTop","paddingRight","paddingBottom","paddingLeft","fontStyle","fontVariant","fontWeight","fontStretch","fontSize","fontSizeAdjust","lineHeight","fontFamily","textAlign","textTransform","textIndent","textDecoration","letterSpacing","wordSpacing","tabSize","MozTabSize"],r="undefined"!=typeof window,o=r&&null!=window.mozInnerScreenX;void 0!==e&&void 0!==e.exports?e.exports=t:r&&(window.getCaretCoordinates=t)}()}]);
--------------------------------------------------------------------------------
/docs/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | InputTrigger Test
8 |
69 |
70 |
71 |
72 |
73 |
75 |
76 |
77 |
78 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "react-input-trigger",
3 | "description": "React component for handling character triggers inside textareas and input fields. 🐼",
4 | "version": "1.1.2",
5 | "main": "build/lib/react-input-trigger.js",
6 | "module": "build/es/react-input-trigger.js",
7 | "repository": "git@github.com:abinavseelan/react-input-trigger.git",
8 | "author": "Abinav Seelan ",
9 | "license": "MIT",
10 | "private": false,
11 | "scripts": {
12 | "start": "webpack-dev-server --config=webpack.dev.config.js --progress --colors",
13 | "prebuild": "npm run clean && cross-env mkdir -p build/es",
14 | "prepublish": "npm run build",
15 | "build": "run-p build:es build:prod",
16 | "build:es": "cross-env BABEL_ENV=es babel src/index.js --out-file build/es/react-input-trigger.js",
17 | "build:prod": "webpack --config=webpack.prod.config.js --progress",
18 | "test": "npm run build 1> /dev/null && echo '✅ Cool! Builds sucessfully 😅' && npm run clean 1> /dev/null",
19 | "lint": "echo '🔍 Running linter in fix mode' && eslint . --fix",
20 | "lint:no-fix": "echo '🔍 Running linter' && eslint .",
21 | "success": "echo '✅ Done! 🎉'",
22 | "clean": "rimraf build docs"
23 | },
24 | "files": [
25 | "build"
26 | ],
27 | "pre-commit": [
28 | "lint:no-fix",
29 | "success"
30 | ],
31 | "devDependencies": {
32 | "babel-cli": "^6.26.0",
33 | "babel-core": "^6.26.0",
34 | "babel-loader": "^7.1.3",
35 | "babel-plugin-transform-object-rest-spread": "^6.26.0",
36 | "babel-preset-env": "^1.6.1",
37 | "babel-preset-react": "^6.24.1",
38 | "cross-env": "^5.1.4",
39 | "eslint": "^4.18.1",
40 | "eslint-config-airbnb": "^16.1.0",
41 | "eslint-plugin-import": "^2.9.0",
42 | "eslint-plugin-jsx-a11y": "^6.0.3",
43 | "eslint-plugin-react": "^7.7.0",
44 | "html-webpack-plugin": "^2.30.1",
45 | "npm-run-all": "^4.1.2",
46 | "pre-commit": "^1.2.2",
47 | "prop-types": ">=15.6.1",
48 | "react": ">=15.6.1",
49 | "react-dom": ">=15.6.1",
50 | "rimraf": "^2.6.2",
51 | "webpack": "^3",
52 | "webpack-dev-server": "^2",
53 | "webpack-merge": "^4.1.2"
54 | },
55 | "dependencies": {
56 | "textarea-caret": "^3.1.0"
57 | },
58 | "peerDependencies": {
59 | "prop-types": ">=15.6.1",
60 | "react": ">=15.6.1"
61 | }
62 | }
63 |
--------------------------------------------------------------------------------
/src/docs/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | InputTrigger Test
8 |
69 |
70 |
71 |
72 |
73 |
75 |
76 |
77 |
78 |
--------------------------------------------------------------------------------
/src/docs/index.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react';
2 | import { render } from 'react-dom';
3 |
4 | import InputHandler from '../index';
5 |
6 | class App extends Component {
7 | constructor() {
8 | super();
9 |
10 | this.state = {
11 | isTriggered: false,
12 | };
13 | }
14 |
15 | render() {
16 | return (
17 |
18 |
19 | {`Is Triggered: ${this.state.isTriggered}`}
20 | {
21 | this.state.isTriggered
22 | ? (
23 |
35 | )
36 | : (
37 | null
38 | )
39 | }
40 |
41 |
42 |
{ this.setState({ isTriggered: true, obj }); }}
48 | onType={(obj) => { this.setState({ isTriggered: true, obj }); }}
49 | onCancel={(obj) => { this.setState({ isTriggered: false, obj }); }}
50 | endTrigger={(endHandler) => { this.endHandler = endHandler; }}
51 | >
52 |
53 |
54 |
55 | {
56 | this.state.obj
57 | ? (
58 |
59 | {
60 | JSON.stringify(this.state.obj, null, 2)
61 | }
62 |
63 | )
64 | : (
65 | null
66 | )
67 | }
68 |
69 | View on Github!
70 |
71 |
72 | );
73 | }
74 | }
75 |
76 | render(, document.getElementById('app'));
77 |
--------------------------------------------------------------------------------
/src/index.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react';
2 | import PropTypes from 'prop-types';
3 | import getCaretCoordinates from 'textarea-caret';
4 |
5 | function getHookObject(type, element, startPoint) {
6 | const caret = getCaretCoordinates(element, element.selectionEnd);
7 |
8 | const result = {
9 | hookType: type,
10 | cursor: {
11 | selectionStart: element.selectionStart,
12 | selectionEnd: element.selectionEnd,
13 | top: caret.top,
14 | left: caret.left,
15 | height: caret.height,
16 | },
17 | };
18 |
19 | if (!startPoint) {
20 | return result;
21 | }
22 |
23 | result.text = element.value.substr(startPoint, element.selectionStart);
24 |
25 | return result;
26 | }
27 |
28 | class InputTrigger extends Component {
29 | constructor(args) {
30 | super(args);
31 |
32 | this.state = {
33 | triggered: false,
34 | triggerStartPosition: null,
35 | };
36 |
37 | this.handleTrigger = this.handleTrigger.bind(this);
38 | this.resetState = this.resetState.bind(this);
39 | this.element = this.props.elementRef;
40 | }
41 |
42 | componentDidMount() {
43 | this.props.endTrigger(this.resetState);
44 | }
45 |
46 | handleTrigger(event) {
47 | const {
48 | trigger,
49 | onStart,
50 | onCancel,
51 | onType,
52 | } = this.props;
53 |
54 | const {
55 | which,
56 | shiftKey,
57 | metaKey,
58 | ctrlKey,
59 | } = event;
60 |
61 | const { selectionStart } = event.target;
62 | const { triggered, triggerStartPosition } = this.state;
63 |
64 | if (!triggered) {
65 | if (
66 | which === trigger.keyCode &&
67 | shiftKey === !!trigger.shiftKey &&
68 | ctrlKey === !!trigger.ctrlKey &&
69 | metaKey === !!trigger.metaKey
70 | ) {
71 | this.setState({
72 | triggered: true,
73 | triggerStartPosition: selectionStart + 1,
74 | }, () => {
75 | setTimeout(() => {
76 | onStart(getHookObject('start', this.element));
77 | }, 0);
78 | });
79 | return null;
80 | }
81 | } else {
82 | if (which === 8 && selectionStart <= triggerStartPosition) {
83 | this.setState({
84 | triggered: false,
85 | triggerStartPosition: null,
86 | }, () => {
87 | setTimeout(() => {
88 | onCancel(getHookObject('cancel', this.element));
89 | }, 0);
90 | });
91 |
92 | return null;
93 | }
94 |
95 | setTimeout(() => {
96 | onType(getHookObject('typing', this.element, triggerStartPosition));
97 | }, 0);
98 | }
99 |
100 | return null;
101 | }
102 |
103 | resetState() {
104 | this.setState({
105 | triggered: false,
106 | triggerStartPosition: null,
107 | });
108 | }
109 |
110 | render() {
111 | const {
112 | elementRef,
113 | children,
114 | trigger,
115 | onStart,
116 | onCancel,
117 | onType,
118 | endTrigger,
119 | ...rest
120 | } = this.props;
121 |
122 | return (
123 |
129 | {
130 | !elementRef
131 | ? (
132 | React.Children.map(this.props.children, child => (
133 | React.cloneElement(child, {
134 | ref: (element) => {
135 | this.element = element;
136 | if (typeof child.ref === 'function') {
137 | child.ref(element);
138 | }
139 | },
140 | })
141 | ))
142 | )
143 | : (
144 | children
145 | )
146 | }
147 |
148 | );
149 | }
150 | }
151 |
152 | InputTrigger.propTypes = {
153 | trigger: PropTypes.shape({
154 | keyCode: PropTypes.number,
155 | shiftKey: PropTypes.bool,
156 | ctrlKey: PropTypes.bool,
157 | metaKey: PropTypes.bool,
158 | }),
159 | onStart: PropTypes.func,
160 | onCancel: PropTypes.func,
161 | onType: PropTypes.func,
162 | endTrigger: PropTypes.func,
163 | children: PropTypes.element.isRequired,
164 | elementRef: PropTypes.element,
165 | };
166 |
167 | InputTrigger.defaultProps = {
168 | trigger: {
169 | keyCode: null,
170 | shiftKey: false,
171 | ctrlKey: false,
172 | metaKey: false,
173 | },
174 | onStart: () => {},
175 | onCancel: () => {},
176 | onType: () => {},
177 | endTrigger: () => {},
178 | elementRef: null,
179 | };
180 |
181 | export default InputTrigger;
182 |
--------------------------------------------------------------------------------
/webpack.common.config.js:
--------------------------------------------------------------------------------
1 | const path = require('path');
2 |
3 | module.exports = {
4 | entry: {
5 | 'react-input-trigger': path.resolve(__dirname, 'src/index.js'),
6 | },
7 | module: {
8 | rules: [
9 | {
10 | test: /\.jsx?$/,
11 | exclude: /node_modules/,
12 | use: 'babel-loader',
13 | },
14 | ],
15 | },
16 | };
17 |
--------------------------------------------------------------------------------
/webpack.dev.config.js:
--------------------------------------------------------------------------------
1 | const webpack = require('webpack');
2 | const path = require('path');
3 | const HtmlWebpackPlugin = require('html-webpack-plugin');
4 |
5 | const merge = require('webpack-merge');
6 | const commonConfiguration = require('./webpack.common.config');
7 |
8 | module.exports = merge.strategy({ entry: 'replace' })(commonConfiguration, {
9 | entry: { app: path.resolve(__dirname, 'src', 'docs', 'index.js'), },
10 | context: path.resolve(__dirname, 'src', 'docs'),
11 | devtool: 'cheap-eval-source-map', // transformed code (lines only),
12 | devServer: {
13 | contentBase: path.resolve(__dirname, 'docs'),
14 | port: 3000,
15 | hot: true,
16 | open: true,
17 | },
18 | output: {
19 | path: path.resolve(__dirname, 'docs'),
20 | publicPath: '/',
21 | filename: '[name].js',
22 | },
23 | plugins: [
24 | new HtmlWebpackPlugin({ template: './index.html' }),
25 | new webpack.NamedModulesPlugin(), // for HMR
26 | new webpack.HotModuleReplacementPlugin(),
27 | ],
28 | });
29 |
--------------------------------------------------------------------------------
/webpack.prod.config.js:
--------------------------------------------------------------------------------
1 | const webpack = require('webpack');
2 | const path = require('path');
3 | const merge = require('webpack-merge');
4 | const commonConfiguration = require('./webpack.common.config');
5 | const HtmlWebpackPlugin = require('html-webpack-plugin');
6 | const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
7 |
8 | const outputPath = path.join(__dirname, 'build', 'lib');
9 | const filename = 'react-input-trigger';
10 | const libraryName = 'ReactInputTrigger';
11 | const production = JSON.stringify('production');
12 | const devtool = 'source-map'; // original source - for use in production
13 |
14 | const externals = { react: 'react' };
15 | const definePlugin = new webpack.DefinePlugin({ 'process.env.NODE_ENV': production });
16 | const uglifyPlugin = new UglifyJsPlugin();
17 |
18 | const libraryConfiguration = merge(commonConfiguration, {
19 | devtool,
20 | output: {
21 | path: outputPath,
22 | filename: '[name].js',
23 | libraryTarget: 'commonjs2',
24 | },
25 | externals,
26 | plugins: [uglifyPlugin, definePlugin],
27 | });
28 |
29 | const docsConfiguration = merge.strategy({ entry: 'replace' })(commonConfiguration, {
30 | entry: { app: path.resolve(__dirname, 'src', 'docs', 'index.js'), },
31 | context: path.resolve(__dirname, 'src', 'docs'),
32 | output: {
33 | path: path.resolve(__dirname, 'docs'),
34 | publicPath: './',
35 | filename: '[name].[chunkhash:5].js',
36 | },
37 | plugins: [
38 | new HtmlWebpackPlugin({ template: './index.html' }),
39 | definePlugin,
40 | uglifyPlugin,
41 | ],
42 | devtool,
43 | });
44 |
45 | module.exports = [
46 | libraryConfiguration,
47 | docsConfiguration,
48 | ];
49 |
--------------------------------------------------------------------------------