├── .babelrc
├── .gitignore
├── .npmignore
├── LICENSE
├── README.md
├── dist
├── gitment.browser.js
└── gitment.browser.js.map
├── package.json
├── src
├── constants.js
├── gitment.js
├── icons.js
├── test.js
├── theme
│ └── default.js
└── utils.js
├── style
└── default.css
├── test
├── gitment.browser.html
├── gitment.html
└── style.css
├── webpack.config.js
└── webpack.dev.config.js
/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "presets": [
3 | ["@babel/env", {
4 | "useBuiltIns": "usage",
5 | "targets": {
6 | "ie": "10"
7 | }
8 | }]
9 | ]
10 | }
11 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | .idea
3 |
4 | node_modules
5 |
6 | test/config.js
7 | index.html
--------------------------------------------------------------------------------
/.npmignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | .idea
3 | .gitignore
4 | .npmignore
5 | .babelrc
6 |
7 | node_modules
8 |
9 | src
10 | test
11 | index.html
12 | webpack.config.js
13 | webpack.dev.config.js
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2016 imsun
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy of
6 | this software and associated documentation files (the "Software"), to deal in
7 | the Software without restriction, including without limitation the rights to
8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9 | the Software, and to permit persons to whom the Software is furnished to do so,
10 | 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, FITNESS
17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Gitment Pro
2 |
3 | > 基于gitment项目的修复升级版本
4 |
5 | * 授权接口改为 `https://gh-oauth.openapi.link`
6 | * 兼容至IE10
7 | * 开发环境升级
8 | * 构造方法改为 => `const gitment = new Gitment.construct({...`
9 |
10 | [应用示例](https://refined-x.com)
11 |
12 | ---------------------
13 |
14 | Gitment is a comment system based on GitHub Issues,
15 | which can be used in the frontend without any server-side implementation.
16 |
17 | [Demo Page](https://imsun.github.io/gitment/)
18 |
19 | [中文简介](https://imsun.net/posts/gitment-introduction/)
20 |
21 | - [Features](#features)
22 | - [Get Started](#get-started)
23 | - [Methods](#methods)
24 | - [Customize](#customize)
25 | - [About Security](#about-security)
26 |
27 | ## Features
28 |
29 | - GitHub Login
30 | - Markdown / GFM support
31 | - Syntax highlighting
32 | - Notifications from GitHub
33 | - Easy to customize
34 | - No server-side implementation
35 |
36 | ## Get Started
37 |
38 | ### 1. Install
39 |
40 | ```html
41 |
42 | ```
43 |
44 | ```html
45 |
46 | ```
47 |
48 | or via npm:
49 |
50 | ```sh
51 | $ npm i --save gitment
52 | ```
53 |
54 | ```javascript
55 | import 'gitment/style/default.css'
56 | import Gitment from 'gitment'
57 | ```
58 |
59 | ### 2. Register An OAuth Application
60 |
61 | [Click here](https://github.com/settings/applications/new) to register an OAuth application, and you will get a client ID and a client secret.
62 |
63 | Make sure the callback URL is right. Generally it's the origin of your site, like [https://imsun.net](https://imsun.net).
64 |
65 | ### 3. Render Gitment
66 |
67 | ```javascript
68 | const gitment = new Gitment({
69 | id: 'Your page ID', // optional
70 | owner: 'Your GitHub ID',
71 | repo: 'The repo to store comments',
72 | oauth: {
73 | client_id: 'Your client ID',
74 | client_secret: 'Your client secret',
75 | },
76 | // ...
77 | // For more available options, check out the documentation below
78 | })
79 |
80 | gitment.render('comments')
81 | // or
82 | // gitment.render(document.getElementById('comments'))
83 | // or
84 | // document.body.appendChild(gitment.render())
85 | ```
86 |
87 | ### 4. Initialize Your Comments
88 |
89 | After the page is published, you should visit your page, login with your GitHub account(make sure you're repo's owner), and click the initialize button, to create a related issue in your repo.
90 | After that, others can leave their comments.
91 |
92 | ## Methods
93 |
94 | ### constructor(options)
95 |
96 | #### options:
97 |
98 | Type: `object`
99 |
100 | - owner: Your GitHub ID. Required.
101 | - repo: The repository to store your comments. Make sure you're repo's owner. Required.
102 | - oauth: An object contains your client ID and client secret. Required.
103 | - client_id: GitHub client ID. Required.
104 | - client_secret: GitHub client secret. Required.
105 | - id: An optional string to identify your page. Default `location.href`.
106 | - title: An optional title for your page, used as issue's title. Default `document.title`.
107 | - link: An optional link for your page, used in issue's body. Default `location.href`.
108 | - desc: An optional description for your page, used in issue's body. Default `''`.
109 | - labels: An optional array of labels your want to add when creating the issue. Default `[]`.
110 | - theme: An optional Gitment theme object. Default `gitment.defaultTheme`.
111 | - perPage: An optional number to which comments will be paginated. Default `20`.
112 | - maxCommentHeight: An optional number to limit comments' max height, over which comments will be folded. Default `250`.
113 |
114 | ### gitment.render([element])
115 |
116 | #### element
117 |
118 | Type: `HTMLElement` or `string`
119 |
120 | The DOM element to which comments will be rendered. Can be an HTML element or element's id. When omitted, this function will create a new `div` element.
121 |
122 | This function returns the element to which comments be rendered.
123 |
124 | ### gitment.renderHeader([element])
125 |
126 | Same like `gitment.render([element])`. But only renders the header.
127 |
128 | ### gitment.renderComments([element])
129 |
130 | Same like `gitment.render([element])`. But only renders comments list.
131 |
132 |
133 | ### gitment.renderEditor([element])
134 |
135 | Same like `gitment.render([element])`. But only renders the editor.
136 |
137 |
138 | ### gitment.renderFooter([element])
139 |
140 | Same like `gitment.render([element])`. But only renders the footer.
141 |
142 | ### gitment.init()
143 |
144 | Initialize a new page. Returns a `Promise` and resolves when initialized.
145 |
146 | ### gitment.update()
147 |
148 | Update data and views. Returns a `Promise` and resolves when data updated.
149 |
150 | ### gitment.post()
151 |
152 | Post comment in the editor. Returns a `Promise` and resolves when posted.
153 |
154 | ### gitment.markdown(text)
155 |
156 | #### text
157 |
158 | Type: `string`
159 |
160 | Returns a `Promise` and resolves rendered text.
161 |
162 | ### gitment.login()
163 |
164 | Jump to GitHub OAuth page to login.
165 |
166 | ### gitment.logout()
167 |
168 | Log out current user.
169 |
170 | ### goto(page)
171 |
172 | #### page
173 |
174 | Type: `number`
175 |
176 | Jump to the target page of comments. Notice that `page` starts from `1`. Returns a `Promise` and resolves when comments loaded.
177 |
178 | ### gitment.like()
179 |
180 | Like current page. Returns a `Promise` and resolves when liked.
181 |
182 | ### gitment.unlike()
183 |
184 | Unlike current page. Returns a `Promise` and resolves when unliked.
185 |
186 | ### gitment.likeAComment(commentId)
187 |
188 | #### commentId
189 |
190 | Type: `string`
191 |
192 | Like a comment. Returns a `Promise` and resolves when liked.
193 |
194 | ### gitment.unlikeAComment(commentId)
195 |
196 | #### commentId
197 |
198 | Type: `string`
199 |
200 | Unlike a comment. Returns a `Promise` and resolves when unliked.
201 |
202 | ## Customize
203 |
204 | Gitment is easy to customize. You can use your own CSS or write a theme.
205 | (The difference is that customized CSS can't modify DOM structure)
206 |
207 | ### Use Customized CSS
208 |
209 | Gitment does't use any atomic CSS, making it easier and more flexible to customize.
210 | You can inspect the DOM structure in the browser and write your own styles.
211 |
212 | ### Write A Theme
213 |
214 | A Gitment theme is an object contains several render functions.
215 |
216 | By default Gitment has five render functions: `render`, `renderHeader`, `renderComments`, `renderEditor`, `renderFooter`.
217 | The last four render independent components and `render` functions render them together.
218 | All of them can be used independently.
219 |
220 | You can override any render function above or write your own render function.
221 |
222 | For example, you can override the `render` function to put an editor before the comment list, and render a new component.
223 |
224 | ```javascript
225 | const myTheme = {
226 | render(state, instance) {
227 | const container = document.createElement('div')
228 | container.lang = "en-US"
229 | container.className = 'gitment-container gitment-root-container'
230 |
231 | // your custom component
232 | container.appendChild(instance.renderSomething(state, instance))
233 |
234 | container.appendChild(instance.renderHeader(state, instance))
235 | container.appendChild(instance.renderEditor(state, instance))
236 | container.appendChild(instance.renderComments(state, instance))
237 | container.appendChild(instance.renderFooter(state, instance))
238 | return container
239 | },
240 | renderSomething(state, instance) {
241 | const container = document.createElement('div')
242 | container.lang = "en-US"
243 | if (state.user.login) {
244 | container.innerText = `Hello, ${state.user.login}`
245 | }
246 | return container
247 | }
248 | }
249 |
250 | const gitment = new Gitment({
251 | // ...
252 | theme: myTheme,
253 | })
254 |
255 | gitment.render(document.body)
256 | // or
257 | // gitment.renderSomthing(document.body)
258 | ```
259 |
260 | Each render function should receive a state object and a gitment instance, and return an HTML element.
261 | It will be wrapped attached to the Gitment instance with the same name.
262 |
263 | Gitment uses [MobX](https://github.com/mobxjs/mobx) to detect states used in render functions.
264 | Once used states change, Gitment will call the render function to get a new element and render it.
265 | Unused states' changing won't affect rendered elements.
266 |
267 | Available states:
268 |
269 | - user: `object`. User info returned from [GitHub Users API](https://developer.github.com/v3/users/#get-the-authenticated-user) with two more keys.
270 | - isLoggingIn: `bool`. Indicates if user is logging in.
271 | - fromCache: `bool`. Gitment will cache user's information. Its value indicates if current user info is from cache.
272 | - error: `Error Object`. Will be null if no error occurs.
273 | - meta: `object`. Issue's info returned from [GitHub Issues API](https://developer.github.com/v3/issues/#list-issues).
274 | - comments: `array`. Array of comment returned from [GitHub Issue Comments API](/repos/:owner/:repo/issues/:number/comments). Will be `undefined` when comments not loaded.
275 | - reactions: `array`. Array of reactions added to current page, returned from [GitHub Issues' Reactions API](https://developer.github.com/v3/reactions/#list-reactions-for-an-issue).
276 | - commentReactions: `object`. Object of reactions added to comments, with comment ID as key, returned from [GitHub Issue Comments' Reactions API](/repos/:owner/:repo/issues/comments/:id/reactions).
277 | - currentPage: `number`. Which page of comments is user on. Starts from `1`.
278 |
279 | ## About Security
280 |
281 | ### Is it safe to make my client secret public?
282 |
283 | Client secret is necessary for OAuth, without which users can't login or comment with their GitHub accounts.
284 | Although GitHub does't recommend to hard code client secret in the frontend, you can still do that because GitHub will verify your callback URL.
285 | In theory, no one else can use your secret except your site.
286 |
287 | If you find a way to hack it, please [open an issue](https://github.com/imsun/gitment/issues/new).
288 |
289 | ### Why does Gitment send a request to gh-oauth.imsun.net?
290 |
291 | [https://gh-oauth.imsun.net](https://gh-oauth.imsun.net) is an simple open-source service to proxy [one request](https://developer.github.com/v3/oauth/#2-github-redirects-back-to-your-site) during users logging in.
292 | Because GitHub doesn't attach a CORS header to it.
293 |
294 | This service won't record or store anything. It only attaches a CORS header to that request and provides proxy.
295 | So that users can login in the frontend without any server-side implementation.
296 |
297 | For more details, checkout [this project](https://github.com/imsun/gh-oauth-server).
298 |
--------------------------------------------------------------------------------
/dist/gitment.browser.js:
--------------------------------------------------------------------------------
1 | var Gitment=function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=99)}([function(t,e,n){var r=n(30)("wks"),o=n(15),i=n(1).Symbol,a="function"==typeof i;(t.exports=function(t){return r[t]||(r[t]=a&&i[t]||(a?i:o)("Symbol."+t))}).store=r},function(t,e){var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(t,e,n){var r=n(3);t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e,n){t.exports=!n(5)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e,n){var r=n(1),o=n(9),i=n(7),a=n(10),s=n(16),c=function(t,e,n){var u,l,f,h,p=t&c.F,d=t&c.G,v=t&c.S,m=t&c.P,g=t&c.B,y=d?r:v?r[e]||(r[e]={}):(r[e]||{}).prototype,b=d?o:o[e]||(o[e]={}),w=b.prototype||(b.prototype={});for(u in d&&(n=e),n)f=((l=!p&&y&&void 0!==y[u])?y:n)[u],h=g&&l?s(f,r):m&&"function"==typeof f?s(Function.call,f):f,y&&a(y,u,f,t&c.U),b[u]!=f&&i(b,u,h),m&&w[u]!=f&&(w[u]=f)};r.core=o,c.F=1,c.G=2,c.S=4,c.P=8,c.B=16,c.W=32,c.U=64,c.R=128,t.exports=c},function(t,e,n){var r=n(8),o=n(20);t.exports=n(4)?function(t,e,n){return r.f(t,e,o(1,n))}:function(t,e,n){return t[e]=n,t}},function(t,e,n){var r=n(2),o=n(39),i=n(26),a=Object.defineProperty;e.f=n(4)?Object.defineProperty:function(t,e,n){if(r(t),e=i(e,!0),r(n),o)try{return a(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},function(t,e){var n=t.exports={version:"2.5.7"};"number"==typeof __e&&(__e=n)},function(t,e,n){var r=n(1),o=n(7),i=n(11),a=n(15)("src"),s=Function.toString,c=(""+s).split("toString");n(9).inspectSource=function(t){return s.call(t)},(t.exports=function(t,e,n,s){var u="function"==typeof n;u&&(i(n,"name")||o(n,"name",e)),t[e]!==n&&(u&&(i(n,a)||o(n,a,t[e]?""+t[e]:c.join(String(e)))),t===r?t[e]=n:s?t[e]?t[e]=n:o(t,e,n):(delete t[e],o(t,e,n)))})(Function.prototype,"toString",function(){return"function"==typeof this&&this[a]||s.call(this)})},function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},function(t,e,n){var r=n(49),o=n(33);t.exports=Object.keys||function(t){return r(t,o)}},function(t,e,n){var r=n(27),o=n(17);t.exports=function(t){return r(o(t))}},function(t,e){var n=0,r=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++n+r).toString(36))}},function(t,e,n){var r=n(21);t.exports=function(t,e,n){if(r(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,o){return t.call(e,n,r,o)}}return function(){return t.apply(e,arguments)}}},function(t,e){t.exports=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t}},function(t,e){t.exports=!1},function(t,e){t.exports={}},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,e,n){var r=n(17);t.exports=function(t){return Object(r(t))}},function(t,e,n){var r=n(8).f,o=n(11),i=n(0)("toStringTag");t.exports=function(t,e,n){t&&!o(t=n?t:t.prototype,i)&&r(t,i,{configurable:!0,value:e})}},function(t,e){e.f={}.propertyIsEnumerable},function(t,e,n){var r=n(3),o=n(1).document,i=r(o)&&r(o.createElement);t.exports=function(t){return i?o.createElement(t):{}}},function(t,e,n){var r=n(3);t.exports=function(t,e){if(!r(t))return t;var n,o;if(e&&"function"==typeof(n=t.toString)&&!r(o=n.call(t)))return o;if("function"==typeof(n=t.valueOf)&&!r(o=n.call(t)))return o;if(!e&&"function"==typeof(n=t.toString)&&!r(o=n.call(t)))return o;throw TypeError("Can't convert object to primitive value")}},function(t,e,n){var r=n(12);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==r(t)?t.split(""):Object(t)}},function(t,e,n){var r=n(29),o=Math.min;t.exports=function(t){return t>0?o(r(t),9007199254740991):0}},function(t,e){var n=Math.ceil,r=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?r:n)(t)}},function(t,e,n){var r=n(9),o=n(1),i=o["__core-js_shared__"]||(o["__core-js_shared__"]={});(t.exports=function(t,e){return i[t]||(i[t]=void 0!==e?e:{})})("versions",[]).push({version:r.version,mode:n(18)?"pure":"global",copyright:"© 2018 Denis Pushkarev (zloirock.ru)"})},function(t,e,n){var r=n(0)("unscopables"),o=Array.prototype;null==o[r]&&n(7)(o,r,{}),t.exports=function(t){o[r][t]=!0}},function(t,e,n){var r=n(30)("keys"),o=n(15);t.exports=function(t){return r[t]||(r[t]=o(t))}},function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,e,n){for(var r=n(35),o=n(13),i=n(10),a=n(1),s=n(7),c=n(19),u=n(0),l=u("iterator"),f=u("toStringTag"),h=c.Array,p={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},d=o(p),v=0;v=t.length?(this._t=void 0,o(1)):o(0,"keys"==e?n:"values"==e?t[n]:[n,t[n]])},"values"),i.Arguments=i.Array,r("keys"),r("values"),r("entries")},function(t,e){e.f=Object.getOwnPropertySymbols},function(t,e,n){"use strict";(function(t,r){n.d(e,"b",function(){return dt}),n.d(e,"a",function(){return N});
2 | /*! *****************************************************************************
3 | Copyright (c) Microsoft Corporation. All rights reserved.
4 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use
5 | this file except in compliance with the License. You may obtain a copy of the
6 | License at http://www.apache.org/licenses/LICENSE-2.0
7 |
8 | THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
9 | KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
10 | WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
11 | MERCHANTABLITY OR NON-INFRINGEMENT.
12 |
13 | See the Apache Version 2.0 License for specific language governing permissions
14 | and limitations under the License.
15 | ***************************************************************************** */
16 | var o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};function i(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var a=Object.assign||function(t){for(var e,n=1,r=arguments.length;n0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function c(){for(var t=[],e=0;e0)for(var c=0;c",t):2===arguments.length&&"function"==typeof e?y(t,e):1===arguments.length&&"string"==typeof t?O(t):!0!==r?O(e).apply(null,arguments):void(t[e]=y(t.name||e,n.value))};function k(t,e,n){ne(t,e,y(e,n.bind(t)))}S.bound=function(t,e,n,r){return!0===r?(k(t,e,n.value),null):n?{configurable:!0,enumerable:!1,get:function(){return k(this,e,n.value||n.initializer.call(this)),this[e]},set:x}:{enumerable:!1,configurable:!0,set:function(t){k(this,e,t)},get:function(){}}};var A=Object.prototype.toString;function E(t,e){return T(t,e)}function T(t,e,n,r){if(t===e)return 0!==t||1/t==1/e;if(null==t||null==e)return!1;if(t!=t)return e!=e;var o=typeof t;return("function"===o||"object"===o||"object"==typeof e)&&function(t,e,n,r){t=j(t),e=j(e);var o=A.call(t);if(o!==A.call(e))return!1;switch(o){case"[object RegExp]":case"[object String]":return""+t==""+e;case"[object Number]":return+t!=+t?+e!=+e:0==+t?1/+t==1/e:+t==+e;case"[object Date]":case"[object Boolean]":return+t==+e;case"[object Symbol]":return"undefined"!=typeof Symbol&&Symbol.valueOf.call(t)===Symbol.valueOf.call(e)}var i="[object Array]"===o;if(!i){if("object"!=typeof t||"object"!=typeof e)return!1;var a=t.constructor,s=e.constructor;if(a!==s&&!("function"==typeof a&&a instanceof a&&"function"==typeof s&&s instanceof s)&&"constructor"in t&&"constructor"in e)return!1}r=r||[];var c=(n=n||[]).length;for(;c--;)if(n[c]===t)return r[c]===e;if(n.push(t),r.push(e),i){if((c=t.length)!==e.length)return!1;for(;c--;)if(!T(t[c],e[c],n,r))return!1}else{var u,l=Object.keys(t);if(c=l.length,Object.keys(e).length!==c)return!1;for(;c--;)if(u=l[c],!L(e,u)||!T(t[u],e[u],n,r))return!1}return n.pop(),r.pop(),!0}(t,e,n,r)}function j(t){return zt(t)?t.peek():ie(t)||Et(t)?ae(t.entries()):t}function L(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function P(t,e){return t===e}var C={identity:P,structural:function(t,e){return E(t,e)},default:function(t,e){return function(t,e){return"number"==typeof t&&"number"==typeof e&&isNaN(t)&&isNaN(e)}(t,e)||P(t,e)}};function N(t,e){void 0===e&&(e=Kt);var n,r=e&&e.name||t.name||"Autorun@"+Jt();if(!e.scheduler&&!e.delay)n=new Ne(r,function(){this.track(a)},e.onError);else{var o=M(e),i=!1;n=new Ne(r,function(){i||(i=!0,o(function(){i=!1,n.isDisposed||n.track(a)}))},e.onError)}function a(){t(n)}return n.schedule(),n.getDisposer()}var I=function(t){return t()};function M(t){return t.scheduler?t.scheduler:t.delay?function(e){return setTimeout(e,t.delay)}:I}var D=function(){function t(t){this.dependenciesState=ue.NOT_TRACKING,this.observing=[],this.newObserving=null,this.isBeingObserved=!1,this.isPendingUnobservation=!1,this.observers=[],this.observersIndexes={},this.diffValue=0,this.runId=0,this.lastAccessedBy=0,this.lowestObserverState=ue.UP_TO_DATE,this.unboundDepsCount=0,this.__mapid="#"+Jt(),this.value=new Oe(null),this.isComputing=!1,this.isRunningSetter=!1,this.isTracing=le.NONE,this.derivation=t.get,this.name=t.name||"ComputedValue@"+Jt(),t.set&&(this.setter=y(this.name+"-setter",t.set)),this.equals=t.equals||(t.compareStructural||t.struct?C.structural:C.default),this.scope=t.context,this.requiresReaction=!!t.requiresReaction,this.keepAlive=!!t.keepAlive}return t.prototype.onBecomeStale=function(){!function(t){if(t.lowestObserverState!==ue.UP_TO_DATE)return;t.lowestObserverState=ue.POSSIBLY_STALE;var e=t.observers,n=e.length;for(;n--;){var r=e[n];r.dependenciesState===ue.UP_TO_DATE&&(r.dependenciesState=ue.POSSIBLY_STALE,r.isTracing!==le.NONE&&xe(r,t),r.onBecomeStale())}}(this)},t.prototype.onBecomeUnobserved=function(){},t.prototype.onBecomeObserved=function(){},t.prototype.get=function(){this.isComputing&&Yt("Cycle detected in computation "+this.name+": "+this.derivation),0!==de.inBatch||0!==this.observers.length||this.keepAlive?(_e(this),ke(this)&&this.trackAndCompute()&&function(t){if(t.lowestObserverState===ue.STALE)return;t.lowestObserverState=ue.STALE;var e=t.observers,n=e.length;for(;n--;){var r=e[n];r.dependenciesState===ue.POSSIBLY_STALE?r.dependenciesState=ue.STALE:r.dependenciesState===ue.UP_TO_DATE&&(t.lowestObserverState=ue.UP_TO_DATE)}}(this)):ke(this)&&(this.warnAboutUntrackedRead(),be(),this.value=this.computeValue(!1),we());var t=this.value;if(Se(t))throw t.cause;return t},t.prototype.peek=function(){var t=this.computeValue(!1);if(Se(t))throw t.cause;return t},t.prototype.set=function(t){if(this.setter){Xt(!this.isRunningSetter,"The setter of computed value '"+this.name+"' is trying to update itself. Did you intend to update an _observable_ value, instead of the computed property?"),this.isRunningSetter=!0;try{this.setter.call(this.scope,t)}finally{this.isRunningSetter=!1}}else Xt(!1,!1)},t.prototype.trackAndCompute=function(){p()&&d({object:this.scope,type:"compute",name:this.name});var t=this.value,e=this.dependenciesState===ue.NOT_TRACKING,n=this.computeValue(!0),r=e||Se(t)||Se(n)||!this.equals(t,n);return r&&(this.value=n),r},t.prototype.computeValue=function(t){var e;if(this.isComputing=!0,de.computationDepth++,t)e=Ee(this,this.derivation,this.scope);else if(!0===de.disableErrorBoundaries)e=this.derivation.call(this.scope);else try{e=this.derivation.call(this.scope)}catch(t){e=new Oe(t)}return de.computationDepth--,this.isComputing=!1,e},t.prototype.suspend=function(){this.keepAlive||(Te(this),this.value=void 0)},t.prototype.observe=function(t,e){var n=this,r=!0,o=void 0;return N(function(){var i=n.get();if(!r||e){var a=je();t({type:"update",object:n,newValue:i,oldValue:o}),Le(a)}r=!1,o=i})},t.prototype.warnAboutUntrackedRead=function(){},t.prototype.toJSON=function(){return this.get()},t.prototype.toString=function(){return this.name+"["+this.derivation.toString()+"]"},t.prototype.valueOf=function(){return ce(this.get())},t}();D.prototype[se()]=D.prototype.valueOf;var R=oe("ComputedValue",D);function V(t){return void 0!==t.interceptors&&t.interceptors.length>0}function B(t,e){var n=t.interceptors||(t.interceptors=[]);return n.push(e),Zt(function(){var t=n.indexOf(e);-1!==t&&n.splice(t,1)})}function U(t,e){var n=je();try{var r=t.interceptors;if(r)for(var o=0,i=r.length;o0}function H(t,e){var n=t.changeListeners||(t.changeListeners=[]);return n.push(e),Zt(function(){var t=n.indexOf(e);-1!==t&&n.splice(t,1)})}function $(t,e){var n=je(),r=t.changeListeners;if(r){for(var o=0,i=(r=r.slice()).length;o2&&vt("box");var n=st(e);return new z(t,ct(n),n.name)},shallowBox:function(t,e){return arguments.length>2&&vt("shallowBox"),Qt("observable.shallowBox","observable.box(value, { deep: false })"),dt.box(t,{name:e,deep:!1})},array:function(t,e){arguments.length>2&&vt("array");var n=st(e);return new Vt(t,ct(n),n.name)},shallowArray:function(t,e){return arguments.length>2&&vt("shallowArray"),Qt("observable.shallowArray","observable.array(values, { deep: false })"),dt.array(t,{name:e,deep:!1})},map:function(t,e){arguments.length>2&&vt("map");var n=st(e);return new St(t,ct(n),n.name)},shallowMap:function(t,e){return arguments.length>2&&vt("shallowMap"),Qt("observable.shallowMap","observable.map(values, { deep: false })"),dt.map(t,{name:e,deep:!1})},object:function(t,e,n){return"string"==typeof arguments[1]&&vt("object"),ot({},t,e,st(n))},shallowObject:function(t,e){return"string"==typeof arguments[1]&&vt("shallowObject"),Qt("observable.shallowObject","observable.object(values, {}, { deep: false })"),dt.object(t,{},{name:e,deep:!1})},ref:ft,shallow:lt,deep:ut,struct:ht},dt=function(t,e,n){if("string"==typeof arguments[1])return ut.apply(null,arguments);if(nt(t))return t;var r=ee(t)?dt.object(t,e,n):Array.isArray(t)?dt.array(t,e):ie(t)?dt.map(t,e):t;if(r!==t)return r;Yt(!1)};function vt(t){Yt("Expected one or two arguments to observable."+t+". Did you accidentally try to use observable."+t+" as decorator?")}function mt(t,e,n){return nt(t)?t:Array.isArray(t)?dt.array(t,{name:n}):ee(t)?dt.object(t,void 0,{name:n}):ie(t)?dt.map(t,{name:n}):t}function gt(t){return t}function yt(){return"function"==typeof Symbol&&Symbol.iterator||"@@iterator"}function bt(t,e){re(t,yt(),e)}function wt(t){return t[yt()]=_t,t}function _t(){return this}function xt(t,e){void 0===e&&(e=void 0),be();try{return t.apply(e)}finally{we()}}Object.keys(pt).forEach(function(t){return dt[t]=pt[t]});var Ot={},St=function(){function t(t,e,n){if(void 0===e&&(e=mt),void 0===n&&(n="ObservableMap@"+Jt()),this.enhancer=e,this.name=n,this.$mobx=Ot,this._keys=new Vt(void 0,gt,this.name+".keys()",!0),"function"!=typeof Map)throw new Error("mobx.map requires Map polyfill for the current browser. Check babel-polyfill or core-js/es6/map.js");this._data=new Map,this._hasMap=new Map,this.merge(t)}return t.prototype._has=function(t){return this._data.has(t)},t.prototype.has=function(t){return this._hasMap.has(t)?this._hasMap.get(t).get():this._updateHasMapEntry(t,!1).get()},t.prototype.set=function(t,e){var n=this._has(t);if(V(this)){var r=U(this,{type:n?"update":"add",object:this,newValue:e,name:t});if(!r)return this;e=r.newValue}return n?this._updateValue(t,e):this._addValue(t,e),this},t.prototype.delete=function(t){var e=this;if(V(this)&&!(o=U(this,{type:"delete",object:this,name:t})))return!1;if(this._has(t)){var n=p(),r=G(this),o=r||n?{type:"delete",object:this,oldValue:this._data.get(t).value,name:t}:null;return n&&v(a({},o,{name:this.name,key:t})),xt(function(){e._keys.remove(t),e._updateHasMapEntry(t,!1),e._data.get(t).setNewValue(void 0),e._data.delete(t)}),r&&$(this,o),n&&g(),!0}return!1},t.prototype._updateHasMapEntry=function(t,e){var n=this._hasMap.get(t);return n?n.setNewValue(e):(n=new z(e,gt,this.name+"."+t+"?",!1),this._hasMap.set(t,n)),n},t.prototype._updateValue=function(t,e){var n=this._data.get(t);if((e=n.prepareNewValue(e))!==de.UNCHANGED){var r=p(),o=G(this),i=o||r?{type:"update",object:this,oldValue:n.value,name:t,newValue:e}:null;r&&v(a({},i,{name:this.name,key:t})),n.setNewValue(e),o&&$(this,i),r&&g()}},t.prototype._addValue=function(t,e){var n=this;xt(function(){var r=new z(e,n.enhancer,n.name+"."+t,!1);n._data.set(t,r),e=r.value,n._updateHasMapEntry(t,!0),n._keys.push(t)});var r=p(),o=G(this),i=o||r?{type:"add",object:this,name:t,newValue:e}:null;r&&v(a({},i,{name:this.name,key:t})),o&&$(this,i),r&&g()},t.prototype.get=function(t){return this.has(t)?this.dehanceValue(this._data.get(t).get()):this.dehanceValue(void 0)},t.prototype.dehanceValue=function(t){return void 0!==this.dehancer?this.dehancer(t):t},t.prototype.keys=function(){return this._keys[yt()]()},t.prototype.values=function(){var t=this,e=0;return wt({next:function(){return e0?t.map(this.dehancer):t},t.prototype.intercept=function(t){return B(this,t)},t.prototype.observe=function(t,e){return void 0===e&&(e=!1),e&&t({object:this.array,type:"splice",index:0,added:this.values.slice(),addedCount:this.values.length,removed:[],removedCount:0}),H(this,t)},t.prototype.getArrayLength=function(){return this.atom.reportObserved(),this.values.length},t.prototype.setArrayLength=function(t){if("number"!=typeof t||t<0)throw new Error("[mobx.array] Out of range: "+t);var e=this.values.length;if(t!==e)if(t>e){for(var n=new Array(t-e),r=0;r0&&t+e+1>Mt&&Ht(t+e+1)},t.prototype.spliceWithArray=function(t,e,n){var r=this;Ae(this.atom);var o=this.values.length;if(void 0===t?t=0:t>o?t=o:t<0&&(t=Math.max(0,o+t)),e=1===arguments.length?o-t:null==e?0:Math.max(0,Math.min(e,o-t)),void 0===n&&(n=qt),V(this)){var i=U(this,{object:this.array,type:"splice",index:t,removedCount:e,added:n});if(!i)return qt;e=i.removedCount,n=i.added}var a=(n=0===n.length?n:n.map(function(t){return r.enhancer(t,void 0)})).length-e;this.updateArrayLength(o,a);var s=this.spliceItemsIntoValues(t,e,n);return 0===e&&0===n.length||this.notifyArraySplice(t,n,s),this.dehanceValues(s)},t.prototype.spliceItemsIntoValues=function(t,e,n){var r;if(n.length<1e4)return(r=this.values).splice.apply(r,c([t,e],n));var o=this.values.slice(t,t+e);return this.values=this.values.slice(0,t).concat(n,this.values.slice(t+e)),o},t.prototype.notifyArrayChildUpdate=function(t,e,n){var r=!this.owned&&p(),o=G(this),i=o||r?{object:this.array,type:"update",index:t,newValue:e,oldValue:n}:null;r&&v(a({},i,{name:this.atom.name})),this.atom.reportChanged(),o&&$(this,i),r&&g()},t.prototype.notifyArraySplice=function(t,e,n){var r=!this.owned&&p(),o=G(this),i=o||r?{object:this.array,type:"splice",index:t,removed:n,added:e,removedCount:n.length,addedCount:e.length}:null;r&&v(a({},i,{name:this.atom.name})),this.atom.reportChanged(),o&&$(this,i),r&&g()},t}(),Vt=function(t){function e(e,n,r,o){void 0===r&&(r="ObservableArray@"+Jt()),void 0===o&&(o=!1);var i=t.call(this)||this,a=new Rt(r,n,i,o);if(re(i,"$mobx",a),e&&e.length){var s=w(!0);i.spliceWithArray(0,0,e),_(s)}return It&&Object.defineProperty(a.array,"0",Bt),i}return i(e,t),e.prototype.intercept=function(t){return this.$mobx.intercept(t)},e.prototype.observe=function(t,e){return void 0===e&&(e=!1),this.$mobx.observe(t,e)},e.prototype.clear=function(){return this.splice(0)},e.prototype.concat=function(){for(var t=[],e=0;e-1&&(this.splice(e,1),!0)},e.prototype.move=function(t,e){function n(t){if(t<0)throw new Error("[mobx.array] Index out of bounds: "+t+" is negative");var e=this.$mobx.values.length;if(t>=e)throw new Error("[mobx.array] Index out of bounds: "+t+" is not smaller than "+e)}if(Qt("observableArray.move is deprecated, use .slice() & .replace() instead"),n.call(this,t),n.call(this,e),t!==e){var r,o=this.$mobx.values;r=t0&&!t.__mobxGlobals&&(he=!1),t.__mobxGlobals&&t.__mobxGlobals.version!==(new fe).version&&(he=!1),he?t.__mobxGlobals?(t.__mobxInstanceCount+=1,t.__mobxGlobals.UNCHANGED||(t.__mobxGlobals.UNCHANGED={}),t.__mobxGlobals):(t.__mobxInstanceCount=1,t.__mobxGlobals=new fe):(setTimeout(function(){pe||Yt("There are multiple, different versions of MobX active. Make sure MobX is loaded only once or use `configure({ isolateGlobalState: true })`")},1),new fe)}();function ve(t){var e,n,r={name:t.name};return t.observing&&t.observing.length>0&&(r.dependencies=(e=t.observing,n=[],e.forEach(function(t){-1===n.indexOf(t)&&n.push(t)}),n).map(ve)),r}function me(t,e){var n=t.observers.length;n&&(t.observersIndexes[e.__mapid]=n),t.observers[n]=e,t.lowestObserverState>e.dependenciesState&&(t.lowestObserverState=e.dependenciesState)}function ge(t,e){if(1===t.observers.length)t.observers.length=0,ye(t);else{var n=t.observers,r=t.observersIndexes,o=n.pop();if(o!==e){var i=r[e.__mapid]||0;i?r[o.__mapid]=i:delete r[o.__mapid],n[i]=o}delete r[e.__mapid]}}function ye(t){!1===t.isPendingUnobservation&&(t.isPendingUnobservation=!0,de.pendingUnobservations.push(t))}function be(){de.inBatch++}function we(){if(0==--de.inBatch){De();for(var t=de.pendingUnobservations,e=0;e0&&ye(t),!1)}function xe(t,e){if(console.log("[mobx.trace] '"+t.name+"' is invalidated due to a change in: '"+e.name+"'"),t.isTracing===le.BREAK){var n=[];!function t(e,n,r){if(n.length>=1e3)return void n.push("(and many more)");n.push(""+new Array(r).join("\t")+e.name);e.dependencies&&e.dependencies.forEach(function(e){return t(e,n,r+1)})}((r=t,ve(Tt(r,o))),n,1),new Function("debugger;\n/*\nTracing '"+t.name+"'\n\nYou are entering this break point because derivation '"+t.name+"' is being traced and '"+e.name+"' is now forcing it to update.\nJust follow the stacktrace you should now see in the devtools to see precisely what piece of your code is causing this update\nThe stackframe you are looking for is at least ~6-8 stack-frames up.\n\n"+(t instanceof D?t.derivation.toString():"")+"\n\nThe dependencies for this derivation are:\n\n"+n.join("\n")+"\n*/\n ")()}var r,o}!function(t){t[t.NOT_TRACKING=-1]="NOT_TRACKING",t[t.UP_TO_DATE=0]="UP_TO_DATE",t[t.POSSIBLY_STALE=1]="POSSIBLY_STALE",t[t.STALE=2]="STALE"}(ue||(ue={})),function(t){t[t.NONE=0]="NONE",t[t.LOG=1]="LOG",t[t.BREAK=2]="BREAK"}(le||(le={}));var Oe=function(){return function(t){this.cause=t}}();function Se(t){return t instanceof Oe}function ke(t){switch(t.dependenciesState){case ue.UP_TO_DATE:return!1;case ue.NOT_TRACKING:case ue.STALE:return!0;case ue.POSSIBLY_STALE:for(var e=je(),n=t.observing,r=n.length,o=0;o0;de.computationDepth>0&&e&&Yt(!1),de.allowStateChanges||!e&&"strict"!==de.enforceActions||Yt(!1)}function Ee(t,e,n){Pe(t),t.newObserving=new Array(t.observing.length+100),t.unboundDepsCount=0,t.runId=++de.runId;var r,o=de.trackingDerivation;if(de.trackingDerivation=t,!0===de.disableErrorBoundaries)r=e.call(n);else try{r=e.call(n)}catch(t){r=new Oe(t)}return de.trackingDerivation=o,function(t){for(var e=t.observing,n=t.observing=t.newObserving,r=ue.UP_TO_DATE,o=0,i=t.unboundDepsCount,a=0;ar&&(r=s.dependenciesState)}n.length=o,t.newObserving=null,i=e.length;for(;i--;){var s=e[i];0===s.diffValue&&ge(s,t),s.diffValue=0}for(;o--;){var s=n[o];1===s.diffValue&&(s.diffValue=0,me(s,t))}r!==ue.UP_TO_DATE&&(t.dependenciesState=r,t.onBecomeStale())}(t),r}function Te(t){var e=t.observing;t.observing=[];for(var n=e.length;n--;)ge(e[n],t);t.dependenciesState=ue.NOT_TRACKING}function je(){var t=de.trackingDerivation;return de.trackingDerivation=null,t}function Le(t){de.trackingDerivation=t}function Pe(t){if(t.dependenciesState!==ue.UP_TO_DATE){t.dependenciesState=ue.UP_TO_DATE;for(var e=t.observing,n=e.length;n--;)e[n].lowestObserverState=ue.UP_TO_DATE}}function Ce(){for(var t=[],e=0;e0||de.isRunningReactions||Me(Re)}function Re(){de.isRunningReactions=!0;for(var t=de.pendingReactions,e=0;t.length>0;){++e===Ie&&(console.error("Reaction doesn't converge to a stable state after "+Ie+" iterations. Probably there is a cycle in the reactive function: "+t[0]),t.splice(0));for(var n=t.splice(0),r=0,o=n.length;r1?arguments[1]:void 0)}}),n(31)("find")},function(t,e,n){t.exports=!n(4)&&!n(5)(function(){return 7!=Object.defineProperty(n(25)("div"),"a",{get:function(){return 7}}).a})},function(t,e,n){var r=n(16),o=n(27),i=n(22),a=n(28),s=n(58);t.exports=function(t,e){var n=1==t,c=2==t,u=3==t,l=4==t,f=6==t,h=5==t||f,p=e||s;return function(e,s,d){for(var v,m,g=i(e),y=o(g),b=r(s,d,3),w=a(y.length),_=0,x=n?p(e,w):c?p(e,0):void 0;w>_;_++)if((h||_ in y)&&(m=b(v=y[_],_,g),t))if(n)x[_]=m;else if(m)switch(t){case 3:return!0;case 5:return v;case 6:return _;case 2:x.push(v)}else if(l)return!1;return f?-1:u||l?l:x}}},function(t,e,n){var r=n(12);t.exports=Array.isArray||function(t){return"Array"==r(t)}},function(t,e,n){"use strict";var r,o,i,a,s=n(18),c=n(1),u=n(16),l=n(43),f=n(6),h=n(3),p=n(21),d=n(63),v=n(64),m=n(68),g=n(44).set,y=n(70)(),b=n(46),w=n(71),_=n(72),x=n(73),O=c.TypeError,S=c.process,k=S&&S.versions,A=k&&k.v8||"",E=c.Promise,T="process"==l(S),j=function(){},L=o=b.f,P=!!function(){try{var t=E.resolve(1),e=(t.constructor={})[n(0)("species")]=function(t){t(j,j)};return(T||"function"==typeof PromiseRejectionEvent)&&t.then(j)instanceof e&&0!==A.indexOf("6.6")&&-1===_.indexOf("Chrome/66")}catch(t){}}(),C=function(t){var e;return!(!h(t)||"function"!=typeof(e=t.then))&&e},N=function(t,e){if(!t._n){t._n=!0;var n=t._c;y(function(){for(var r=t._v,o=1==t._s,i=0,a=function(e){var n,i,a,s=o?e.ok:e.fail,c=e.resolve,u=e.reject,l=e.domain;try{s?(o||(2==t._h&&D(t),t._h=1),!0===s?n=r:(l&&l.enter(),n=s(r),l&&(l.exit(),a=!0)),n===e.promise?u(O("Promise-chain cycle")):(i=C(n))?i.call(n,c,u):c(n)):u(r)}catch(t){l&&!a&&l.exit(),u(t)}};n.length>i;)a(n[i++]);t._c=[],t._n=!1,e&&!t._h&&I(t)})}},I=function(t){g.call(c,function(){var e,n,r,o=t._v,i=M(t);if(i&&(e=w(function(){T?S.emit("unhandledRejection",o,t):(n=c.onunhandledrejection)?n({promise:t,reason:o}):(r=c.console)&&r.error&&r.error("Unhandled promise rejection",o)}),t._h=T||M(t)?2:1),t._a=void 0,i&&e.e)throw e.v})},M=function(t){return 1!==t._h&&0===(t._a||t._c).length},D=function(t){g.call(c,function(){var e;T?S.emit("rejectionHandled",t):(e=c.onrejectionhandled)&&e({promise:t,reason:t._v})})},R=function(t){var e=this;e._d||(e._d=!0,(e=e._w||e)._v=t,e._s=2,e._a||(e._a=e._c.slice()),N(e,!0))},V=function(t){var e,n=this;if(!n._d){n._d=!0,n=n._w||n;try{if(n===t)throw O("Promise can't be resolved itself");(e=C(t))?y(function(){var r={_w:n,_d:!1};try{e.call(t,u(V,r,1),u(R,r,1))}catch(t){R.call(r,t)}}):(n._v=t,n._s=1,N(n,!1))}catch(t){R.call({_w:n,_d:!1},t)}}};P||(E=function(t){d(this,E,"Promise","_h"),p(t),r.call(this);try{t(u(V,this,1),u(R,this,1))}catch(t){R.call(this,t)}},(r=function(t){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1}).prototype=n(74)(E.prototype,{then:function(t,e){var n=L(m(this,E));return n.ok="function"!=typeof t||t,n.fail="function"==typeof e&&e,n.domain=T?S.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&N(this,!1),n.promise},catch:function(t){return this.then(void 0,t)}}),i=function(){var t=new r;this.promise=t,this.resolve=u(V,t,1),this.reject=u(R,t,1)},b.f=L=function(t){return t===E||t===a?new i(t):o(t)}),f(f.G+f.W+f.F*!P,{Promise:E}),n(23)(E,"Promise"),n(75)("Promise"),a=n(9).Promise,f(f.S+f.F*!P,"Promise",{reject:function(t){var e=L(this);return(0,e.reject)(t),e.promise}}),f(f.S+f.F*(s||!P),"Promise",{resolve:function(t){return x(s&&this===a?E:this,t)}}),f(f.S+f.F*!(P&&n(76)(function(t){E.all(t).catch(j)})),"Promise",{all:function(t){var e=this,n=L(e),r=n.resolve,o=n.reject,i=w(function(){var n=[],i=0,a=1;v(t,!1,function(t){var s=i++,c=!1;n.push(void 0),a++,e.resolve(t).then(function(t){c||(c=!0,n[s]=t,--a||r(n))},o)}),--a||r(n)});return i.e&&o(i.v),n.promise},race:function(t){var e=this,n=L(e),r=n.reject,o=w(function(){v(t,!1,function(t){e.resolve(t).then(n.resolve,r)})});return o.e&&r(o.v),n.promise}})},function(t,e,n){var r=n(12),o=n(0)("toStringTag"),i="Arguments"==r(function(){return arguments}());t.exports=function(t){var e,n,a;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=function(t,e){try{return t[e]}catch(t){}}(e=Object(t),o))?n:i?r(e):"Object"==(a=r(e))&&"function"==typeof e.callee?"Arguments":a}},function(t,e,n){var r,o,i,a=n(16),s=n(69),c=n(45),u=n(25),l=n(1),f=l.process,h=l.setImmediate,p=l.clearImmediate,d=l.MessageChannel,v=l.Dispatch,m=0,g={},y=function(){var t=+this;if(g.hasOwnProperty(t)){var e=g[t];delete g[t],e()}},b=function(t){y.call(t.data)};h&&p||(h=function(t){for(var e=[],n=1;arguments.length>n;)e.push(arguments[n++]);return g[++m]=function(){s("function"==typeof t?t:Function(t),e)},r(m),m},p=function(t){delete g[t]},"process"==n(12)(f)?r=function(t){f.nextTick(a(y,t,1))}:v&&v.now?r=function(t){v.now(a(y,t,1))}:d?(i=(o=new d).port2,o.port1.onmessage=b,r=a(i.postMessage,i,1)):l.addEventListener&&"function"==typeof postMessage&&!l.importScripts?(r=function(t){l.postMessage(t+"","*")},l.addEventListener("message",b,!1)):r="onreadystatechange"in u("script")?function(t){c.appendChild(u("script")).onreadystatechange=function(){c.removeChild(this),y.call(t)}}:function(t){setTimeout(a(y,t,1),0)}),t.exports={set:h,clear:p}},function(t,e,n){var r=n(1).document;t.exports=r&&r.documentElement},function(t,e,n){"use strict";var r=n(21);function o(t){var e,n;this.promise=new t(function(t,r){if(void 0!==e||void 0!==n)throw TypeError("Bad Promise constructor");e=t,n=r}),this.resolve=r(e),this.reject=r(n)}t.exports.f=function(t){return new o(t)}},function(t,e,n){"use strict";var r=n(18),o=n(6),i=n(10),a=n(7),s=n(19),c=n(79),u=n(23),l=n(83),f=n(0)("iterator"),h=!([].keys&&"next"in[].keys()),p=function(){return this};t.exports=function(t,e,n,d,v,m,g){c(n,e,d);var y,b,w,_=function(t){if(!h&&t in k)return k[t];switch(t){case"keys":case"values":return function(){return new n(this,t)}}return function(){return new n(this,t)}},x=e+" Iterator",O="values"==v,S=!1,k=t.prototype,A=k[f]||k["@@iterator"]||v&&k[v],E=A||_(v),T=v?O?_("entries"):E:void 0,j="Array"==e&&k.entries||A;if(j&&(w=l(j.call(new t)))!==Object.prototype&&w.next&&(u(w,x,!0),r||"function"==typeof w[f]||a(w,f,p)),O&&A&&"values"!==A.name&&(S=!0,E=function(){return A.call(this)}),r&&!g||!h&&!S&&k[f]||a(k,f,E),s[e]=E,s[x]=p,v)if(y={values:O?E:_("values"),keys:m?E:_("keys"),entries:T},g)for(b in y)b in k||i(k,b,y[b]);else o(o.P+o.F*(h||S),e,y);return y}},function(t,e,n){var r=n(2),o=n(80),i=n(33),a=n(32)("IE_PROTO"),s=function(){},c=function(){var t,e=n(25)("iframe"),r=i.length;for(e.style.display="none",n(45).appendChild(e),e.src="javascript:",(t=e.contentWindow.document).open(),t.write("
13 |
14 |
15 |