aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsslyxhz <sslyxhz@hotmail.com>2018-03-11 14:47:13 +0800
committerolOwOlo <26087907+olOwOlo@users.noreply.github.com>2018-03-11 14:47:13 +0800
commit1da110d6b1d03824eba1aed1cf14ca5dee763e58 (patch)
tree3ec8ebdf4e5f93e31583fcd74604b7c8fb403582
parent52777345e4db7693d665699346b86ffb25ae8077 (diff)
feat: add gitment module (#36)
-rw-r--r--exampleSite/config.toml8
-rw-r--r--layouts/partials/comments.html33
-rw-r--r--static/lib/gitment/gitment-0.0.3.min.css1
-rw-r--r--static/lib/gitment/gitment-0.0.3.min.js1
4 files changed, 41 insertions, 2 deletions
diff --git a/exampleSite/config.toml b/exampleSite/config.toml
index 984abf3..6376691 100644
--- a/exampleSite/config.toml
+++ b/exampleSite/config.toml
@@ -92,6 +92,14 @@ copyright = "" # default: author.name ↓ # 默认为下面配
slideout = '<script src="https://cdn.jsdelivr.net/npm/slideout@1.0.1/dist/slideout.min.js" integrity="sha256-t+zJ/g8/KXIJMjSVQdnibt4dlaDxc9zXr/9oNPeWqdg=" crossorigin="anonymous"></script>'
fancyboxJs = '<script src="https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@3.1.20/dist/jquery.fancybox.min.js" integrity="sha256-XVLffZaxoWfGUEbdzuLi7pwaUJv1cecsQJQqGLe7axY=" crossorigin="anonymous"></script>'
fancyboxCss = '<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@3.1.20/dist/jquery.fancybox.min.css" integrity="sha256-7TyXnr2YU040zfSP+rEcz29ggW4j56/ujTPwjMzyqFY=" crossorigin="anonymous">'
+ gitmentJS = '<script src="https://cdn.jsdelivr.net/npm/gitment@0.0.3/dist/gitment.browser.min.js" crossorigin="anonymous"></script>'
+ gitmentCSS = '<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/gitment@0.0.3/style/default.min.css" crossorigin="anonymous">'
+
+ [params.gitment] # Gitment is a comment system based on GitHub issues. see https://github.com/imsun/gitment
+ owner = "" # Your GitHub ID
+ repo = "" # The repo to store comments
+ clientId = "" # Your client ID
+ clientSecret = "" # Your client secret
[params.busuanzi] # count web traffic by busuanzi # 是否使用不蒜子统计站点访问量
enable = false
diff --git a/layouts/partials/comments.html b/layouts/partials/comments.html
index afce2a3..eb75615 100644
--- a/layouts/partials/comments.html
+++ b/layouts/partials/comments.html
@@ -15,7 +15,7 @@
})();
</script>
<noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
- {{- end }}
+ {{- end -}}
<!-- changyan -->
{{- if and .Site.Params.changyanAppid .Site.Params.changyanAppkey -}}
@@ -30,7 +30,7 @@
if (width < 960) {window.document.write('<script id="changyan_mobile_js" charset="utf-8" type="text/javascript" src="https://changyan.sohu.com/upload/mobile/wap-js/changyan_mobile.js?client_id=' + appid + '&conf=' + conf + '"><\/script>'); } else { var loadJs=function(d,a){var c=document.getElementsByTagName("head")[0]||document.head||document.documentElement;var b=document.createElement("script");b.setAttribute("type","text/javascript");b.setAttribute("charset","UTF-8");b.setAttribute("src",d);if(typeof a==="function"){if(window.attachEvent){b.onreadystatechange=function(){var e=b.readyState;if(e==="loaded"||e==="complete"){b.onreadystatechange=null;a()}}}else{b.onload=a}}c.appendChild(b)};loadJs("https://changyan.sohu.com/upload/changyan.js",function(){window.changyan.api.config({appid:appid,conf:conf})}); }
})();
</script>
- {{- end }}
+ {{- end -}}
<!-- LiveRe -->
{{- if .Site.Params.livereUID -}}
@@ -50,5 +50,34 @@
</script>
<noscript>Please enable JavaScript to view the comments powered by <a href="https://livere.com/">LiveRe.</a></noscript>
</div>
+ {{- end -}}
+
+ <!-- gitment -->
+ {{- if .Site.Params.gitment.owner -}}
+ <div id="comments-gitment"></div>
+ {{ if .Site.Params.publicCDN.enable -}}
+ {{ .Site.Params.publicCDN.gitmentCSS | safeHTML }}
+ {{ .Site.Params.publicCDN.gitmentJS | safeHTML }}
+ {{- else -}}
+ <link rel="stylesheet" href="{{ "lib/gitment/gitment-0.0.3.min.css" | relURL }}">
+ <script src="{{ "lib/gitment/gitment-0.0.3.min.js" | relURL }}"></script>
{{- end }}
+ <script type="text/javascript">
+ const gitment = new Gitment({
+ id: '{{ .Date }}',
+ title: '{{ .Title }}',
+ link: decodeURI(location.href),
+ desc: '{{ .Summary }}',
+ owner: '{{ .Site.Params.gitment.owner }}',
+ repo: '{{ .Site.Params.gitment.repo }}',
+ oauth: {
+ client_id: '{{ .Site.Params.gitment.clientId }}',
+ client_secret: '{{ .Site.Params.gitment.clientSecret }}'
+ }
+ })
+ gitment.render('comments-gitment')
+ </script>
+ <noscript>Please enable JavaScript to view the <a href="https://github.com/imsun/gitment">comments powered by gitment.</a></noscript>
+ {{- end }}
+
{{- end }} \ No newline at end of file
diff --git a/static/lib/gitment/gitment-0.0.3.min.css b/static/lib/gitment/gitment-0.0.3.min.css
new file mode 100644
index 0000000..9ec26a6
--- /dev/null
+++ b/static/lib/gitment/gitment-0.0.3.min.css
@@ -0,0 +1 @@
+.gitment-markdown hr::after,.gitment-markdown::after{clear:both}.gitment-container{font-family:sans-serif;font-size:14px;line-height:1.5;color:#333;word-wrap:break-word}.gitment-container *{box-sizing:border-box}.gitment-container :disabled{cursor:not-allowed}.gitment-container a,.gitment-container a:visited{cursor:pointer;text-decoration:none}.gitment-container a:hover{text-decoration:underline}.gitment-container .gitment-hidden{display:none}.gitment-container .gitment-spinner-icon{fill:#333;-webkit-animation:gitment-spin 1s steps(12) infinite;animation:gitment-spin 1s steps(12) infinite}@-webkit-keyframes gitment-spin{100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes gitment-spin{100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.gitment-header-container,.gitment-root-container{margin:19px 0}.gitment-comment-like-btn,.gitment-comment-reply-btn,.gitment-header-like-btn{cursor:pointer}.gitment-comment-like-btn,.gitment-comment-reply-btn{float:right}.gitment-comment-like-btn.liked{color:#F44336}.gitment-header-like-btn svg{vertical-align:middle;height:30px}.gitment-comment-like-btn svg,.gitment-comment-reply-btn svg{vertical-align:middle;height:20px}.gitment-comment-like-btn.liked svg,.gitment-header-like-btn.liked svg{fill:#F44336}a.gitment-header-issue-link,a.gitment-header-issue-link:visited{float:right;line-height:30px;color:#666}a.gitment-header-issue-link:hover{color:#666}.gitment-comments-empty,.gitment-comments-error,.gitment-comments-loading{text-align:center;margin:50px 0}.gitment-comments-list{list-style:none;padding-left:0;margin:0 0 38px}.gitment-comment,.gitment-editor-container{position:relative;min-height:60px;padding-left:60px;margin:19px 0}.gitment-comment-avatar,.gitment-editor-avatar{float:left;margin-left:-60px}.gitment-comment-avatar,.gitment-comment-avatar-img,.gitment-editor-avatar svg,.gitment-editor-avatar-img{width:44px;height:44px;border-radius:3px}.gitment-editor-avatar .gitment-github-icon{fill:#fff;background-color:#333}.gitment-comment-main,.gitment-editor-main{position:relative;border:1px solid #CFD8DC;border-radius:0}.gitment-comment-main::after,.gitment-comment-main::before,.gitment-editor-main::after,.gitment-editor-main::before{position:absolute;top:11px;left:-16px;display:block;width:0;height:0;pointer-events:none;content:"";border-color:transparent;border-style:solid solid outset}.gitment-comment-main::before,.gitment-editor-main::before{border-width:8px;border-right-color:#CFD8DC}.gitment-comment-main::after,.gitment-editor-main::after{margin-top:1px;margin-left:2px;border-width:7px;border-right-color:#fff}.gitment-comment-header{margin:12px 15px;color:#666;background-color:#fff;border-radius:3px}.gitment-editor-header{padding:0;margin:0;border-bottom:1px solid #CFD8DC}a.gitment-comment-name,a.gitment-comment-name:visited{font-weight:600;color:#666}.gitment-editor-tabs{margin-bottom:-1px;margin-left:-1px}.gitment-editor-tab{display:inline-block;padding:11px 12px;font-size:14px;line-height:20px;color:#666;text-decoration:none;background-color:transparent;border-width:0 1px;border-style:solid;border-color:transparent;border-radius:0;white-space:nowrap;cursor:pointer;user-select:none;outline:0}.gitment-editor-tab.gitment-selected{color:#333;background-color:#fff;border-color:#CFD8DC}.gitment-editor-login{float:right;margin-top:-30px;margin-right:15px}a.gitment-editor-login-link,a.gitment-editor-login-link:visited,a.gitment-footer-project-link,a.gitment-footer-project-link:visited{color:#2196F3}a.gitment-editor-logout-link,a.gitment-editor-logout-link:visited{color:#666}a.gitment-editor-logout-link:hover{color:#2196F3;text-decoration:none}.gitment-comment-body{position:relative;margin:12px 15px;overflow:hidden;border-radius:3px}.gitment-comment-body-folded::after,.gitment-comment-body-folded::before{display:block!important;position:absolute;left:0;pointer-events:none;width:100%}.gitment-comment-body-folded{cursor:pointer}.gitment-comment-body-folded::before{content:"";top:0;bottom:50px;background:-webkit-linear-gradient(top,rgba(255,255,255,0),rgba(255,255,255,.9));background:linear-gradient(180deg,rgba(255,255,255,0),rgba(255,255,255,.9))}.gitment-comment-body-folded::after{content:"Click to Expand"!important;text-align:center;color:#666;height:50px;line-height:50px;bottom:0;background:rgba(255,255,255,.9)}.gitment-editor-body{margin:0}.gitment-comment-body>:first-child,.gitment-editor-preview>:first-child{margin-top:0!important}.gitment-comment-body>:last-child,.gitment-editor-preview>:last-child{margin-bottom:0!important}.gitment-editor-body textarea{display:block;width:100%;min-height:150px;max-height:500px;padding:16px;resize:vertical;max-width:100%;margin:0;font-size:14px;line-height:1.6;background-color:#fff;color:#333;vertical-align:middle;border:none;border-radius:0;outline:0;box-shadow:none;overflow:visible}.gitment-editor-body textarea:focus{background-color:#fff}.gitment-editor-preview{min-height:150px;padding:16px;background-color:transparent;width:100%;font-size:14px;line-height:1.5;word-wrap:break-word}.gitment-editor-footer{padding:0;margin-top:10px}.gitment-editor-footer::after{display:table;clear:both;content:""}a.gitment-editor-footer-tip{display:inline-block;padding-top:10px;font-size:12px;color:#666}a.gitment-editor-footer-tip:hover{color:#2196F3;text-decoration:none}.gitment-comments-pagination{list-style:none;text-align:right;border-radius:0;margin:-19px 0 19px}.gitment-comments-page-item{display:inline-block;cursor:pointer;border:1px solid #CFD8DC;margin-left:-1px;padding:.25rem .5rem}.gitment-comments-page-item.gitment-selected,.gitment-comments-page-item:hover{background-color:#f5f5f5}.gitment-comments-init-btn,.gitment-editor-submit{color:#fff;background-color:#00BCD4;position:relative;display:inline-block;padding:7px 13px;font-size:14px;font-weight:600;line-height:20px;white-space:nowrap;vertical-align:middle;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-size:110% 110%;border:none;-webkit-appearance:none;-moz-appearance:none;appearance:none}.gitment-comments-init-btn:hover,.gitment-editor-submit:hover{background-color:#00ACC1}.gitment-comments-init-btn:disabled,.gitment-editor-submit:disabled{color:rgba(255,255,255,.75);background-color:#4DD0E1;box-shadow:none}.gitment-editor-submit{float:right}.gitment-footer-container{margin-top:30px;margin-bottom:20px;text-align:right;font-size:12px}.gitment-markdown{-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;color:#333;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-size:16px;line-height:1.5;word-wrap:break-word}.gitment-markdown .pl-c{color:#969896}.gitment-markdown .pl-c1,.gitment-markdown .pl-s .pl-v{color:#0086b3}.gitment-markdown .pl-e,.gitment-markdown .pl-en{color:#795da3}.gitment-markdown .pl-s .pl-s1,.gitment-markdown .pl-smi{color:#333}.gitment-markdown .pl-ent{color:#63a35c}.gitment-markdown .pl-k{color:#a71d5d}.gitment-markdown .pl-pds,.gitment-markdown .pl-s,.gitment-markdown .pl-s .pl-pse .pl-s1,.gitment-markdown .pl-sr,.gitment-markdown .pl-sr .pl-cce,.gitment-markdown .pl-sr .pl-sra,.gitment-markdown .pl-sr .pl-sre{color:#183691}.gitment-markdown .pl-smw,.gitment-markdown .pl-v{color:#ed6a43}.gitment-markdown .pl-bu{color:#b52a1d}.gitment-markdown .pl-c2,.gitment-markdown .pl-ii{color:#f8f8f8;background-color:#b52a1d}.gitment-markdown .pl-c2::before{content:"^M"}.gitment-markdown .pl-sr .pl-cce{font-weight:700;color:#63a35c}.gitment-markdown .pl-ml{color:#693a17}.gitment-markdown .pl-mh,.gitment-markdown .pl-mh .pl-en,.gitment-markdown .pl-ms{font-weight:700;color:#1d3e81}.gitment-markdown .pl-mq{color:teal}.gitment-markdown .pl-mi{font-style:italic;color:#333}.gitment-markdown .pl-mb{font-weight:700;color:#333}.gitment-markdown .pl-md{color:#bd2c00;background-color:#ffecec}.gitment-markdown .pl-mi1{color:#55a532;background-color:#eaffea}.gitment-markdown .pl-mc{color:#ef9700;background-color:#ffe3b4}.gitment-markdown .pl-mi2{color:#d8d8d8;background-color:grey}.gitment-markdown .pl-mdr{font-weight:700;color:#795da3}.gitment-markdown .pl-mo{color:#1d3e81}.gitment-markdown .pl-ba{color:#595e62}.gitment-markdown .pl-sg{color:silver}.gitment-markdown .pl-corl{text-decoration:underline;color:#183691}.gitment-markdown .octicon{display:inline-block;fill:currentColor;vertical-align:text-bottom}.gitment-markdown hr::after,.gitment-markdown hr::before,.gitment-markdown::after,.gitment-markdown::before{display:table;content:""}.gitment-markdown a{background-color:transparent;-webkit-text-decoration-skip:objects;color:#0366d6;text-decoration:none}.gitment-markdown a:active,.gitment-markdown a:hover{outline-width:0}.gitment-markdown h1{margin:.67em 0}.gitment-markdown img{border-style:none}.gitment-markdown svg:not(:root){overflow:hidden}.gitment-markdown hr{box-sizing:content-box}.gitment-markdown input{font:inherit;margin:0;overflow:visible;font-family:inherit;font-size:inherit;line-height:inherit}.gitment-markdown [type=checkbox]{box-sizing:border-box;padding:0}.gitment-markdown *{box-sizing:border-box}.gitment-markdown a:hover{text-decoration:underline}.gitment-markdown strong{font-weight:600}.gitment-markdown td,.gitment-markdown th{padding:0}.gitment-markdown blockquote{margin:0}.gitment-markdown ol ol,.gitment-markdown ul ol{list-style-type:lower-roman}.gitment-markdown ol ol ol,.gitment-markdown ol ul ol,.gitment-markdown ul ol ol,.gitment-markdown ul ul ol{list-style-type:lower-alpha}.gitment-markdown dd{margin-left:0}.gitment-markdown code{font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace}.gitment-markdown pre{font:12px SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;word-wrap:normal}.gitment-markdown .pl-0{padding-left:0!important}.gitment-markdown .pl-1{padding-left:4px!important}.gitment-markdown .pl-2{padding-left:8px!important}.gitment-markdown .pl-3{padding-left:16px!important}.gitment-markdown .pl-4{padding-left:24px!important}.gitment-markdown .pl-5{padding-left:32px!important}.gitment-markdown .pl-6{padding-left:40px!important}.gitment-markdown>:first-child{margin-top:0!important}.gitment-markdown>:last-child{margin-bottom:0!important}.gitment-markdown a:not([href]){color:inherit;text-decoration:none}.gitment-markdown .anchor{float:left;padding-right:4px;margin-left:-20px;line-height:1}.gitment-markdown .anchor:focus{outline:0}.gitment-markdown blockquote,.gitment-markdown dl,.gitment-markdown ol,.gitment-markdown p,.gitment-markdown pre,.gitment-markdown table,.gitment-markdown ul{margin-top:0;margin-bottom:16px}.gitment-markdown hr{overflow:hidden;background:#e1e4e8;height:.25em;padding:0;margin:24px 0;border:0}.gitment-markdown blockquote{padding:0 1em;color:#6a737d;border-left:.25em solid #dfe2e5}.gitment-markdown h1,.gitment-markdown h2{padding-bottom:.3em;border-bottom:1px solid #eaecef}.gitment-markdown blockquote>:first-child{margin-top:0}.gitment-markdown blockquote>:last-child{margin-bottom:0}.gitment-markdown h1,.gitment-markdown h2,.gitment-markdown h3,.gitment-markdown h4,.gitment-markdown h5,.gitment-markdown h6{margin-top:24px;margin-bottom:16px;font-weight:600;line-height:1.25}.gitment-markdown h1 .octicon-link,.gitment-markdown h2 .octicon-link,.gitment-markdown h3 .octicon-link,.gitment-markdown h4 .octicon-link,.gitment-markdown h5 .octicon-link,.gitment-markdown h6 .octicon-link{color:#1b1f23;vertical-align:middle;visibility:hidden}.gitment-markdown h1:hover .anchor,.gitment-markdown h2:hover .anchor,.gitment-markdown h3:hover .anchor,.gitment-markdown h4:hover .anchor,.gitment-markdown h5:hover .anchor,.gitment-markdown h6:hover .anchor{text-decoration:none}.gitment-markdown h1:hover .anchor .octicon-link,.gitment-markdown h2:hover .anchor .octicon-link,.gitment-markdown h3:hover .anchor .octicon-link,.gitment-markdown h4:hover .anchor .octicon-link,.gitment-markdown h5:hover .anchor .octicon-link,.gitment-markdown h6:hover .anchor .octicon-link{visibility:visible}.gitment-markdown h1{font-size:2em}.gitment-markdown h2{font-size:1.5em}.gitment-markdown h3{font-size:1.25em}.gitment-markdown h4{font-size:1em}.gitment-markdown h5{font-size:.875em}.gitment-markdown h6{font-size:.85em;color:#6a737d}.gitment-markdown ol,.gitment-markdown ul{padding-left:2em}.gitment-markdown ol ol,.gitment-markdown ol ul,.gitment-markdown ul ol,.gitment-markdown ul ul{margin-top:0;margin-bottom:0}.gitment-markdown li>p{margin-top:16px}.gitment-markdown li+li{margin-top:.25em}.gitment-markdown dl{padding:0}.gitment-markdown dl dt{padding:0;margin-top:16px;font-size:1em;font-style:italic;font-weight:600}.gitment-markdown dl dd{padding:0 16px;margin-bottom:16px}.gitment-markdown table{border-spacing:0;border-collapse:collapse;display:block;width:100%;overflow:auto}.gitment-markdown table th{font-weight:600}.gitment-markdown table td,.gitment-markdown table th{padding:6px 13px;border:1px solid #dfe2e5}.gitment-markdown table tr{background-color:#fff;border-top:1px solid #c6cbd1}.gitment-markdown table tr:nth-child(2n){background-color:#f5f5f5}.gitment-markdown img{max-width:100%;box-sizing:content-box;background-color:#fff}.gitment-markdown code{padding:.2em 0;margin:0;font-size:85%;background-color:rgba(27,31,35,.05);border-radius:0}.gitment-markdown code::after,.gitment-markdown code::before{letter-spacing:-.2em;content:"\00a0"}.gitment-markdown pre>code{padding:0;margin:0;font-size:100%;word-break:normal;white-space:pre;background:0 0;border:0}.gitment-markdown .highlight{margin-bottom:16px}.gitment-markdown .highlight pre{margin-bottom:0;word-break:normal}.gitment-markdown .highlight pre,.gitment-markdown pre{padding:16px;overflow:auto;font-size:85%;line-height:1.45;background-color:#f5f5f5;border-radius:0}.gitment-markdown pre code{display:inline;max-width:auto;padding:0;margin:0;overflow:visible;line-height:inherit;word-wrap:normal;background-color:transparent;border:0}.gitment-markdown pre code::after,.gitment-markdown pre code::before{content:normal}.gitment-markdown .full-commit .btn-outline:not(:disabled):hover{color:#005cc5;border-color:#005cc5}.gitment-markdown kbd{display:inline-block;padding:3px 5px;font:11px SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;line-height:10px;color:#444d56;vertical-align:middle;background-color:#fcfcfc;border:1px solid #c6cbd1;border-bottom-color:#959da5;border-radius:0;box-shadow:inset 0 -1px 0 #959da5}.gitment-markdown :checked+.radio-label{position:relative;z-index:1;border-color:#0366d6}.gitment-markdown .task-list-item{list-style-type:none}.gitment-markdown .task-list-item+.task-list-item{margin-top:3px}.gitment-markdown .task-list-item input{margin:0 .2em .25em -1.6em;vertical-align:middle}.gitment-markdown hr{border-bottom-color:#eee} \ No newline at end of file
diff --git a/static/lib/gitment/gitment-0.0.3.min.js b/static/lib/gitment/gitment-0.0.3.min.js
new file mode 100644
index 0000000..9b2592d
--- /dev/null
+++ b/static/lib/gitment/gitment-0.0.3.min.js
@@ -0,0 +1 @@
+var Gitment=function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};return t.m=e,t.c=n,t.i=function(e){return e},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=5)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.LS_ACCESS_TOKEN_KEY="gitment-comments-token",t.LS_USER_KEY="gitment-user-info",t.NOT_INITIALIZED_ERROR=new Error("Comments Not Initialized")},function(e,t,n){"use strict";(function(n){function r(e){return function(t,n,r){return r&&"function"==typeof r.value?(r.value=V(e,r.value),r.enumerable=!1,r.configurable=!0,r):Kt(e).apply(this,arguments)}}function i(e,t,n){var r="string"==typeof e?e:e.name||"<unnamed action>",i="function"==typeof e?e:t,o="function"==typeof e?t:n;return wt("function"==typeof i,vt("m002")),wt(0===i.length,vt("m003")),wt("string"==typeof r&&r.length>0,"actions should have valid names, got: '"+r+"'"),z(r,i,o,void 0)}function o(e){return"function"==typeof e&&!0===e.isMobxAction}function a(e,t,n){var r=function(){return z(t,n,e,arguments)};r.isMobxAction=!0,Ct(e,t,r)}function s(e,t,n){function r(){a(u)}var i,a,s;"string"==typeof e?(i=e,a=t,s=n):(i=e.name||"Autorun@"+bt(),a=e,s=t),wt("function"==typeof a,vt("m004")),wt(!1===o(a),vt("m005")),s&&(a=a.bind(s));var u=new fn(i,function(){this.track(r)});return u.schedule(),u.getDisposer()}function u(e,t,n,r){var i,o,a,u;return"string"==typeof e?(i=e,o=t,a=n,u=r):(i="When@"+bt(),o=e,a=t,u=n),s(i,function(e){if(o.call(u)){e.dispose();var t=te();a.call(u),ne(t)}})}function c(e,t,n,r){function i(){s(h)}var a,s,u,c;"string"==typeof e?(a=e,s=t,u=n,c=r):(a=e.name||"AutorunAsync@"+bt(),s=e,u=t,c=n),wt(!1===o(s),vt("m006")),void 0===u&&(u=1),c&&(s=s.bind(c));var l=!1,h=new fn(a,function(){l||(l=!0,setTimeout(function(){l=!1,h.isDisposed||h.track(i)},u))});return h.schedule(),h.getDisposer()}function l(e,t,n){function r(){if(!u.isDisposed){var n=!1;u.track(function(){var t=e(u);n=Tt(i.compareStructural,o,t),o=t}),a&&i.fireImmediately&&t(o,u),a||!0!==n||t(o,u),a&&(a=!1)}}arguments.length>3&&yt(vt("m007")),Ve(e)&&yt(vt("m008"));var i;i="object"===(void 0===n?"undefined":Ut(n))?n:{},i.name=i.name||e.name||t.name||"Reaction@"+bt(),i.fireImmediately=!0===n||!0===i.fireImmediately,i.delay=i.delay||0,i.compareStructural=i.compareStructural||i.struct||!1,t=Yt(i.name,i.context?t.bind(i.context):t),i.context&&(e=e.bind(i.context));var o,a=!0,s=!1,u=new fn(i.name,function(){a||i.delay<1?r():s||(s=!0,setTimeout(function(){s=!1,r()},i.delay))});return u.schedule(),u.getDisposer()}function h(e){return ct(function(t,n,r,i,o){wt(void 0!==o,vt("m009")),wt("function"==typeof o.get,vt("m010")),Ze(Fe(t,""),n,o.get,o.set,e,!1)},function(e){var t=this.$mobx.values[e];if(void 0!==t)return t.get()},function(e,t){this.$mobx.values[e].set(t)},!1,!1)}function d(e,t){wt("function"==typeof e&&e.length<2,"createTransformer expects a function that accepts one argument");var n={},r=pn.resetId,i=function(r){function i(t,n){var i=r.call(this,function(){return e(n)},void 0,!1,"Transformer-"+e.name+"-"+t,void 0)||this;return i.sourceIdentifier=t,i.sourceObject=n,i}return Ht(i,r),i.prototype.onBecomeUnobserved=function(){var e=this.value;r.prototype.onBecomeUnobserved.call(this),delete n[this.sourceIdentifier],t&&t(e,this.sourceObject)},i}(sn);return function(e){r!==pn.resetId&&(n={},r=pn.resetId);var t=p(e),o=n[t];return o?o.get():(o=n[t]=new i(t,e),o.get())}}function p(e){if("string"==typeof e||"number"==typeof e)return e;if(null===e||"object"!==(void 0===e?"undefined":Ut(e)))throw new Error("[mobx] transform expected some kind of object or primitive value, got: "+e);var t=e.$transformId;return void 0===t&&(t=bt(),Ct(e,"$transformId",t)),t}function f(e,t){return J()||console.warn(vt("m013")),Jt(e,{context:t}).get()}function m(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return g(e,Be,t)}function v(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return g(e,Ue,t)}function g(e,t,n){wt(arguments.length>=2,vt("m014")),wt("object"===(void 0===e?"undefined":Ut(e)),vt("m015")),wt(!Tn(e),vt("m016")),n.forEach(function(e){wt("object"===(void 0===e?"undefined":Ut(e)),vt("m017")),wt(!A(e),vt("m018"))});for(var r=Fe(e),i={},o=n.length-1;o>=0;o--){var a=n[o];for(var s in a)if(!0!==i[s]&&Lt(a,s)){if(i[s]=!0,e===a&&!jt(e,s))continue;var u=Object.getOwnPropertyDescriptor(a,s);Xe(r,s,u,t)}}return e}function b(e,t){return y(at(e,t))}function y(e){var t={name:e.name};return e.observing&&e.observing.length>0&&(t.dependencies=St(e.observing).map(y)),t}function w(e,t){return _(at(e,t))}function _(e){var t={name:e.name};return se(e)&&(t.observers=ue(e).map(_)),t}function x(e,t,n){return"function"==typeof n?O(e,t,n):S(e,t)}function S(e,t){return st(e).intercept(t)}function O(e,t,n){return st(e,t).intercept(n)}function k(e,t){if(null===e||void 0===e)return!1;if(void 0!==t){if(!1===ot(e))return!1;var n=at(e,t);return cn(n)}return cn(e)}function A(e,t){if(null===e||void 0===e)return!1;if(void 0!==t){if(qe(e)||Tn(e))throw new Error(vt("m019"));if(ot(e)){var n=e.$mobx;return n.values&&!!n.values[t]}return!1}return ot(e)||!!e.$mobx||an(e)||gn(e)||cn(e)}function E(e){if(void 0===e&&(e=void 0),"string"==typeof arguments[1])return Ft.apply(null,arguments);if(wt(arguments.length<=1,vt("m021")),wt(!Ve(e),vt("m020")),A(e))return e;var t=Be(e,void 0,void 0);return t!==e?t:nn.box(e)}function T(e){yt("Expected one or two arguments to observable."+e+". Did you accidentally try to use observable."+e+" as decorator?")}function L(e){return wt(!!e,":("),ct(function(t,n,r,i,o){Rt(t,n),wt(!o||!o.get,vt("m022")),Qe(Fe(t,void 0),n,r,e)},function(e){var t=this.$mobx.values[e];if(void 0!==t)return t.get()},function(e,t){rt(this,e,t)},!0,!1)}function C(e,t,n,r){return"function"==typeof n?j(e,t,n,r):I(e,t,n)}function I(e,t,n){return st(e).observe(t,n)}function j(e,t,n,r){return st(e,t).observe(n,r)}function R(e,t,n){function r(r){return t&&n.push([e,r]),r}if(void 0===t&&(t=!0),void 0===n&&(n=[]),A(e)){if(t&&null===n&&(n=[]),t&&null!==e&&"object"===(void 0===e?"undefined":Ut(e)))for(var i=0,o=n.length;i<o;i++)if(n[i][0]===e)return n[i][1];if(qe(e)){var a=r([]),s=e.map(function(e){return R(e,t,n)});a.length=s.length;for(var i=0,o=s.length;i<o;i++)a[i]=s[i];return a}if(ot(e)){var a=r({});for(var u in e)a[u]=R(e[u],t,n);return a}if(Tn(e)){var c=r({});return e.forEach(function(e,r){return c[r]=R(e,t,n)}),c}if(Mn(e))return R(e.get(),t,n)}return e}function P(e,t){return void 0===t&&(t=void 0),_t(vt("m023")),M.apply(void 0,arguments)}function M(e,t){return void 0===t&&(t=void 0),z("",e)}function D(e){return console.log(e),e}function N(e,t){switch(arguments.length){case 0:if(!(e=pn.trackingDerivation))return D(vt("m024"));break;case 2:e=at(e,t)}return e=at(e),cn(e)?D(e.whyRun()):gn(e)?D(e.whyRun()):yt(vt("m025"))}function V(e,t){wt("function"==typeof t,vt("m026")),wt("string"==typeof e&&e.length>0,"actions should have valid names, got: '"+e+"'");var n=function(){return z(e,t,this,arguments)};return n.originalFn=t,n.isMobxAction=!0,n}function z(e,t,n,r){var i=B(e,t,n,r);try{return t.apply(n,r)}finally{$(i)}}function B(e,t,n,r){var i=Se()&&!!e,o=0;if(i){o=Date.now();var a=r&&r.length||0,s=new Array(a);if(a>0)for(var u=0;u<a;u++)s[u]=r[u];ke({type:"action",name:e,fn:t,object:n,arguments:s})}var c=te();return de(),{prevDerivation:c,prevAllowStateChanges:G(!0),notifySpy:i,startTime:o}}function $(e){Y(e.prevAllowStateChanges),pe(),ne(e.prevDerivation),e.notifySpy&&Ae({time:Date.now()-e.startTime})}function U(e){wt(null===pn.trackingDerivation,vt("m028")),pn.strictMode=e,pn.allowStateChanges=!e}function H(){return pn.strictMode}function K(e,t){var n,r=G(e);try{n=t()}finally{Y(r)}return n}function G(e){var t=pn.allowStateChanges;return pn.allowStateChanges=e,t}function Y(e){pn.allowStateChanges=e}function W(e){return e instanceof ln}function q(e){switch(e.dependenciesState){case un.UP_TO_DATE:return!1;case un.NOT_TRACKING:case un.STALE:return!0;case un.POSSIBLY_STALE:for(var t=te(),n=e.observing,r=n.length,i=0;i<r;i++){var o=n[i];if(cn(o)){try{o.get()}catch(e){return ne(t),!0}if(e.dependenciesState===un.STALE)return ne(t),!0}}return re(e),ne(t),!1}}function J(){return null!==pn.trackingDerivation}function F(e){var t=e.observers.length>0;pn.computationDepth>0&&t&&yt(vt("m031")+e.name),!pn.allowStateChanges&&t&&yt(vt(pn.strictMode?"m030a":"m030b")+e.name)}function X(e,t,n){re(e),e.newObserving=new Array(e.observing.length+100),e.unboundDepsCount=0,e.runId=++pn.runId;var r=pn.trackingDerivation;pn.trackingDerivation=e;var i;try{i=t.call(n)}catch(e){i=new ln(e)}return pn.trackingDerivation=r,Q(e),i}function Q(e){var t=e.observing,n=e.observing=e.newObserving,r=un.UP_TO_DATE;e.newObserving=null;for(var i=0,o=e.unboundDepsCount,a=0;a<o;a++){var s=n[a];0===s.diffValue&&(s.diffValue=1,i!==a&&(n[i]=s),i++),s.dependenciesState>r&&(r=s.dependenciesState)}for(n.length=i,o=t.length;o--;){var s=t[o];0===s.diffValue&&le(s,e),s.diffValue=0}for(;i--;){var s=n[i];1===s.diffValue&&(s.diffValue=0,ce(s,e))}r!==un.UP_TO_DATE&&(e.dependenciesState=r,e.onBecomeStale())}function Z(e){var t=e.observing;e.observing=[];for(var n=t.length;n--;)le(t[n],e);e.dependenciesState=un.NOT_TRACKING}function ee(e){var t=te(),n=e();return ne(t),n}function te(){var e=pn.trackingDerivation;return pn.trackingDerivation=null,e}function ne(e){pn.trackingDerivation=e}function re(e){if(e.dependenciesState!==un.UP_TO_DATE){e.dependenciesState=un.UP_TO_DATE;for(var t=e.observing,n=t.length;n--;)t[n].lowestObserverState=un.UP_TO_DATE}}function ie(){var e=gt(),t=pn;if(e.__mobservableTrackingStack||e.__mobservableViewStack)throw new Error("[mobx] An incompatible version of mobservable is already loaded.");if(e.__mobxGlobal&&e.__mobxGlobal.version!==t.version)throw new Error("[mobx] An incompatible version of mobx is already loaded.");e.__mobxGlobal?pn=e.__mobxGlobal:e.__mobxGlobal=t}function oe(){return pn}function ae(){pn.resetId++;var e=new dn;for(var t in e)-1===hn.indexOf(t)&&(pn[t]=e[t]);pn.allowStateChanges=!pn.strictMode}function se(e){return e.observers&&e.observers.length>0}function ue(e){return e.observers}function ce(e,t){var n=e.observers.length;n&&(e.observersIndexes[t.__mapid]=n),e.observers[n]=t,e.lowestObserverState>t.dependenciesState&&(e.lowestObserverState=t.dependenciesState)}function le(e,t){if(1===e.observers.length)e.observers.length=0,he(e);else{var n=e.observers,r=e.observersIndexes,i=n.pop();if(i!==t){var o=r[t.__mapid]||0;o?r[i.__mapid]=o:delete r[i.__mapid],n[o]=i}delete r[t.__mapid]}}function he(e){e.isPendingUnobservation||(e.isPendingUnobservation=!0,pn.pendingUnobservations.push(e))}function de(){pn.inBatch++}function pe(){if(0==--pn.inBatch){we();for(var e=pn.pendingUnobservations,t=0;t<e.length;t++){var n=e[t];n.isPendingUnobservation=!1,0===n.observers.length&&n.onBecomeUnobserved()}pn.pendingUnobservations=[]}}function fe(e){var t=pn.trackingDerivation;null!==t?t.runId!==e.lastAccessedBy&&(e.lastAccessedBy=t.runId,t.newObserving[t.unboundDepsCount++]=e):0===e.observers.length&&he(e)}function me(e){if(e.lowestObserverState!==un.STALE){e.lowestObserverState=un.STALE;for(var t=e.observers,n=t.length;n--;){var r=t[n];r.dependenciesState===un.UP_TO_DATE&&r.onBecomeStale(),r.dependenciesState=un.STALE}}}function ve(e){if(e.lowestObserverState!==un.STALE){e.lowestObserverState=un.STALE;for(var t=e.observers,n=t.length;n--;){var r=t[n];r.dependenciesState===un.POSSIBLY_STALE?r.dependenciesState=un.STALE:r.dependenciesState===un.UP_TO_DATE&&(e.lowestObserverState=un.UP_TO_DATE)}}}function ge(e){if(e.lowestObserverState===un.UP_TO_DATE){e.lowestObserverState=un.POSSIBLY_STALE;for(var t=e.observers,n=t.length;n--;){var r=t[n];r.dependenciesState===un.UP_TO_DATE&&(r.dependenciesState=un.POSSIBLY_STALE,r.onBecomeStale())}}}function be(e){wt(this&&this.$mobx&&gn(this.$mobx),"Invalid `this`"),wt(!this.$mobx.errorHandler,"Only one onErrorHandler can be registered"),this.$mobx.errorHandler=e}function ye(e){return pn.globalReactionErrorHandlers.push(e),function(){var t=pn.globalReactionErrorHandlers.indexOf(e);t>=0&&pn.globalReactionErrorHandlers.splice(t,1)}}function we(){pn.inBatch>0||pn.isRunningReactions||vn(_e)}function _e(){pn.isRunningReactions=!0;for(var e=pn.pendingReactions,t=0;e.length>0;){++t===mn&&(console.error("Reaction doesn't converge to a stable state after "+mn+" iterations. Probably there is a cycle in the reactive function: "+e[0]),e.splice(0));for(var n=e.splice(0),r=0,i=n.length;r<i;r++)n[r].runReaction()}pn.isRunningReactions=!1}function xe(e){var t=vn;vn=function(n){return e(function(){return t(n)})}}function Se(){return!!pn.spyListeners.length}function Oe(e){if(pn.spyListeners.length)for(var t=pn.spyListeners,n=0,r=t.length;n<r;n++)t[n](e)}function ke(e){Oe(Et({},e,{spyReportStart:!0}))}function Ae(e){Oe(e?Et({},e,bn):bn)}function Ee(e){return pn.spyListeners.push(e),xt(function(){var t=pn.spyListeners.indexOf(e);-1!==t&&pn.spyListeners.splice(t,1)})}function Te(e){return e.interceptors&&e.interceptors.length>0}function Le(e,t){var n=e.interceptors||(e.interceptors=[]);return n.push(t),xt(function(){var e=n.indexOf(t);-1!==e&&n.splice(e,1)})}function Ce(e,t){var n=te();try{var r=e.interceptors;if(r)for(var i=0,o=r.length;i<o&&(t=r[i](t),wt(!t||t.type,"Intercept handlers should return nothing or a change object"),t);i++);return t}finally{ne(n)}}function Ie(e){return e.changeListeners&&e.changeListeners.length>0}function je(e,t){var n=e.changeListeners||(e.changeListeners=[]);return n.push(t),xt(function(){var e=n.indexOf(t);-1!==e&&n.splice(e,1)})}function Re(e,t){var n=te(),r=e.changeListeners;if(r){r=r.slice();for(var i=0,o=r.length;i<o;i++)r[i](t);ne(n)}}function Pe(e){return _t("asReference is deprecated, use observable.ref instead"),nn.ref(e)}function Me(e){return _t("asStructure is deprecated. Use observable.struct, computed.struct or reaction options instead."),nn.struct(e)}function De(e){return _t("asFlat is deprecated, use observable.shallow instead"),nn.shallow(e)}function Ne(e){return _t("asMap is deprecated, use observable.map or observable.shallowMap instead"),nn.map(e||{})}function Ve(e){return"object"===(void 0===e?"undefined":Ut(e))&&null!==e&&!0===e.isMobxModifierDescriptor}function ze(e,t){return wt(!Ve(t),"Modifiers cannot be nested"),{isMobxModifierDescriptor:!0,initialValue:t,enhancer:e}}function Be(e,t,n){return Ve(e)&&yt("You tried to assign a modifier wrapped value to a collection, please define modifiers when creating the collection, not when modifying it"),A(e)?e:Array.isArray(e)?nn.array(e,n):At(e)?nn.object(e,n):zt(e)?nn.map(e,n):e}function $e(e,t,n){return Ve(e)&&yt("You tried to assign a modifier wrapped value to a collection, please define modifiers when creating the collection, not when modifying it"),void 0===e||null===e?e:ot(e)||qe(e)||Tn(e)?e:Array.isArray(e)?nn.shallowArray(e,n):At(e)?nn.shallowObject(e,n):zt(e)?nn.shallowMap(e,n):yt("The shallow modifier / decorator can only used in combination with arrays, objects and maps")}function Ue(e){return e}function He(e,t,n){if(Mt(e,t))return t;if(A(e))return e;if(Array.isArray(e))return new Sn(e,He,n);if(zt(e))return new En(e,He,n);if(At(e)){var r={};return Fe(r,n),g(r,He,[e]),r}return e}function Ke(e,t,n){return Mt(e,t)?t:e}function Ge(e){return{enumerable:!1,configurable:!1,get:function(){return this.get(e)},set:function(t){this.set(e,t)}}}function Ye(e){Object.defineProperty(Sn.prototype,""+e,Ge(e))}function We(e){for(var t=wn;t<e;t++)Ye(t);wn=e}function qe(e){return kt(e)&&kn(e.$mobx)}function Je(e){return _t("`mobx.map` is deprecated, use `new ObservableMap` or `mobx.observable.map` instead"),nn.map(e)}function Fe(e,t){if(ot(e))return e.$mobx;wt(Object.isExtensible(e),vt("m035")),At(e)||(t=(e.constructor.name||"ObservableObject")+"@"+bt()),t||(t="ObservableObject@"+bt());var n=new Ln(e,t);return It(e,"$mobx",n),n}function Xe(e,t,n,r){if(e.values[t])return wt("value"in n,"The property "+t+" in "+e.name+" is already observable, cannot redefine it as computed property"),void(e.target[t]=n.value);if("value"in n)if(Ve(n.value)){var i=n.value;Qe(e,t,i.initialValue,i.enhancer)}else o(n.value)&&!0===n.value.autoBind?a(e.target,t,n.value.originalFn):cn(n.value)?et(e,t,n.value):Qe(e,t,n.value,r);else Ze(e,t,n.get,n.set,!1,!0)}function Qe(e,t,n,r){if(Rt(e.target,t),Te(e)){var i=Ce(e,{object:e.target,name:t,type:"add",newValue:n});if(!i)return;n=i.newValue}n=(e.values[t]=new Pn(n,r,e.name+"."+t,!1)).value,Object.defineProperty(e.target,t,tt(t)),it(e,e.target,t,n)}function Ze(e,t,n,r,i,o){o&&Rt(e.target,t),e.values[t]=new sn(n,e.target,i,e.name+"."+t,r),o&&Object.defineProperty(e.target,t,nt(t))}function et(e,t,n){var r=e.name+"."+t;n.name=r,n.scope||(n.scope=e.target),e.values[t]=n,Object.defineProperty(e.target,t,nt(t))}function tt(e){return Cn[e]||(Cn[e]={configurable:!0,enumerable:!0,get:function(){return this.$mobx.values[e].get()},set:function(t){rt(this,e,t)}})}function nt(e){return In[e]||(In[e]={configurable:!0,enumerable:!1,get:function(){return this.$mobx.values[e].get()},set:function(t){return this.$mobx.values[e].set(t)}})}function rt(e,t,n){var r=e.$mobx,i=r.values[t];if(Te(r)){var o=Ce(r,{type:"update",object:e,name:t,newValue:n});if(!o)return;n=o.newValue}if((n=i.prepareNewValue(n))!==Rn){var a=Ie(r),s=Se(),o=a||s?{type:"update",object:e,oldValue:i.value,name:t,newValue:n}:null;s&&ke(o),i.setNewValue(n),a&&Re(r,o),s&&Ae()}}function it(e,t,n,r){var i=Ie(e),o=Se(),a=i||o?{type:"add",object:t,name:n,newValue:r}:null;o&&ke(a),i&&Re(e,a),o&&Ae()}function ot(e){return!!kt(e)&&(ht(e),jn(e.$mobx))}function at(e,t){if("object"===(void 0===e?"undefined":Ut(e))&&null!==e){if(qe(e))return wt(void 0===t,vt("m036")),e.$mobx.atom;if(Tn(e)){var n=e;if(void 0===t)return at(n._keys);var r=n._data[t]||n._hasMap[t];return wt(!!r,"the entry '"+t+"' does not exist in the observable map '"+ut(e)+"'"),r}if(ht(e),ot(e)){if(!t)return yt("please specify a property");var i=e.$mobx.values[t];return wt(!!i,"no observable property '"+t+"' found on the observable object '"+ut(e)+"'"),i}if(an(e)||cn(e)||gn(e))return e}else if("function"==typeof e&&gn(e.$mobx))return e.$mobx;return yt("Cannot obtain atom from "+e)}function st(e,t){return wt(e,"Expecting some object"),void 0!==t?st(at(e,t)):an(e)||cn(e)||gn(e)?e:Tn(e)?e:(ht(e),e.$mobx?e.$mobx:void wt(!1,"Cannot obtain administration from "+e))}function ut(e,t){var n;return n=void 0!==t?at(e,t):ot(e)||Tn(e)?st(e):at(e),n.name}function ct(e,t,n,r,i){function o(o,a,s,u,c){if(void 0===c&&(c=0),wt(i||dt(arguments),"This function is a decorator, but it wasn't invoked like a decorator"),s){Lt(o,"__mobxLazyInitializers")||Ct(o,"__mobxLazyInitializers",o.__mobxLazyInitializers&&o.__mobxLazyInitializers.slice()||[]);var l=s.value,h=s.initializer;return o.__mobxLazyInitializers.push(function(t){e(t,a,h?h.call(t):l,u,s)}),{enumerable:r,configurable:!0,get:function(){return!0!==this.__mobxDidRunLazyInitializers&&ht(this),t.call(this,a)},set:function(e){!0!==this.__mobxDidRunLazyInitializers&&ht(this),n.call(this,a,e)}}}var d={enumerable:r,configurable:!0,get:function(){return this.__mobxInitializedProps&&!0===this.__mobxInitializedProps[a]||lt(this,a,void 0,e,u,s),t.call(this,a)},set:function(t){this.__mobxInitializedProps&&!0===this.__mobxInitializedProps[a]?n.call(this,a,t):lt(this,a,t,e,u,s)}};return(arguments.length<3||5===arguments.length&&c<3)&&Object.defineProperty(o,a,d),d}return i?function(){if(dt(arguments))return o.apply(null,arguments);var e=arguments,t=arguments.length;return function(n,r,i){return o(n,r,i,e,t)}}:o}function lt(e,t,n,r,i,o){Lt(e,"__mobxInitializedProps")||Ct(e,"__mobxInitializedProps",{}),e.__mobxInitializedProps[t]=!0,r(e,t,n,i,o)}function ht(e){!0!==e.__mobxDidRunLazyInitializers&&e.__mobxLazyInitializers&&(Ct(e,"__mobxDidRunLazyInitializers",!0),e.__mobxDidRunLazyInitializers&&e.__mobxLazyInitializers.forEach(function(t){return t(e)}))}function dt(e){return(2===e.length||3===e.length)&&"string"==typeof e[1]}function pt(){return"function"==typeof Symbol&&Symbol.iterator||"@@iterator"}function ft(e){wt(!0!==e[Dn],"Illegal state: cannot recycle array as iterator"),It(e,Dn,!0);var t=-1;return It(e,"next",function(){return t++,{done:t>=this.length,value:t<this.length?this[t]:void 0}}),e}function mt(e,t){It(e,pt(),t)}function vt(e){return Nn[e]}function gt(){return n}function bt(){return++pn.mobxGuid}function yt(e,t){throw wt(!1,e,t),"X"}function wt(e,t,n){if(!e)throw new Error("[mobx] Invariant failed: "+t+(n?" in '"+n+"'":""))}function _t(e){return-1===zn.indexOf(e)&&(zn.push(e),console.error("[mobx] Deprecated: "+e),!0)}function xt(e){var t=!1;return function(){if(!t)return t=!0,e.apply(this,arguments)}}function St(e){var t=[];return e.forEach(function(e){-1===t.indexOf(e)&&t.push(e)}),t}function Ot(e,t,n){return void 0===t&&(t=100),void 0===n&&(n=" - "),e?e.slice(0,t).join(n)+(e.length>t?" (... and "+(e.length-t)+"more)":""):""}function kt(e){return null!==e&&"object"===(void 0===e?"undefined":Ut(e))}function At(e){if(null===e||"object"!==(void 0===e?"undefined":Ut(e)))return!1;var t=Object.getPrototypeOf(e);return t===Object.prototype||null===t}function Et(){for(var e=arguments[0],t=1,n=arguments.length;t<n;t++){var r=arguments[t];for(var i in r)Lt(r,i)&&(e[i]=r[i])}return e}function Tt(e,t,n){return"number"==typeof t&&isNaN(t)?"number"!=typeof n||!isNaN(n):e?!Mt(t,n):t!==n}function Lt(e,t){return $n.call(e,t)}function Ct(e,t,n){Object.defineProperty(e,t,{enumerable:!1,writable:!0,configurable:!0,value:n})}function It(e,t,n){Object.defineProperty(e,t,{enumerable:!1,writable:!1,configurable:!0,value:n})}function jt(e,t){var n=Object.getOwnPropertyDescriptor(e,t);return!n||!1!==n.configurable&&!1!==n.writable}function Rt(e,t){wt(jt(e,t),"Cannot make property '"+t+"' observable, it is not configurable and writable in the target object")}function Pt(e){var t=[];for(var n in e)t.push(n);return t}function Mt(e,t){if(null===e&&null===t)return!0;if(void 0===e&&void 0===t)return!0;if("object"!==(void 0===e?"undefined":Ut(e)))return e===t;var n=Nt(e),r=Vt(e);if(n!==Nt(t))return!1;if(r!==Vt(t))return!1;if(n){if(e.length!==t.length)return!1;for(var i=e.length-1;i>=0;i--)if(!Mt(e[i],t[i]))return!1;return!0}if(r){if(e.size!==t.size)return!1;var o=!0;return e.forEach(function(e,n){o=o&&Mt(t.get(n),e)}),o}if("object"===(void 0===e?"undefined":Ut(e))&&"object"===(void 0===t?"undefined":Ut(t))){if(null===e||null===t)return!1;if(Vt(e)&&Vt(t))return e.size===t.size&&Mt(nn.shallowMap(e).entries(),nn.shallowMap(t).entries());if(Pt(e).length!==Pt(t).length)return!1;for(var a in e){if(!(a in t))return!1;if(!Mt(e[a],t[a]))return!1}return!0}return!1}function Dt(e,t){var n="isMobX"+e;return t.prototype[n]=!0,function(e){return kt(e)&&!0===e[n]}}function Nt(e){return Array.isArray(e)||qe(e)}function Vt(e){return zt(e)||Tn(e)}function zt(e){return void 0!==gt().Map&&e instanceof gt().Map}function Bt(){return"function"==typeof Symbol&&Symbol.toPrimitive||"@@toPrimitive"}function $t(e){return null===e?null:"object"===(void 0===e?"undefined":Ut(e))?""+e:e}var Ut="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ht=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0}),t.extras={allowStateChanges:K,deepEqual:Mt,getAtom:at,getDebugName:ut,getDependencyTree:b,getAdministration:st,getGlobalState:oe,getObserverTree:w,isComputingDerivation:J,isSpyEnabled:Se,onReactionError:ye,reserveArrayBuffer:We,resetGlobalState:ae,shareGlobalState:ie,spyReport:Oe,spyReportEnd:Ae,spyReportStart:ke,setReactionScheduler:xe},"object"===("undefined"==typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__?"undefined":Ut(__MOBX_DEVTOOLS_GLOBAL_HOOK__))&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx(e.exports),e.exports.default=e.exports;var Kt=ct(function(e,t,n,r,i){var o=r&&1===r.length?r[0]:n.name||t||"<unnamed action>";Ct(e,t,Yt(o,n))},function(e){return this[e]},function(){wt(!1,vt("m001"))},!1,!0),Gt=ct(function(e,t,n){a(e,t,n)},function(e){return this[e]},function(){wt(!1,vt("m001"))},!1,!1),Yt=function(e,t,n,i){return 1===arguments.length&&"function"==typeof e?V(e.name||"<unnamed action>",e):2===arguments.length&&"function"==typeof t?V(e,t):1===arguments.length&&"string"==typeof e?r(e):r(t).apply(null,arguments)};t.action=Yt,Yt.bound=function(e,t,n){if("function"==typeof e){var r=V("<not yet bound action>",e);return r.autoBind=!0,r}return Gt.apply(null,arguments)},t.runInAction=i,t.isAction=o,t.autorun=s,t.when=u,t.autorunAsync=c,t.reaction=l;var Wt=h(!1),qt=h(!0),Jt=function(e,t,n){if("string"==typeof t)return Wt.apply(null,arguments);wt("function"==typeof e,vt("m011")),wt(arguments.length<3,vt("m012"));var r="object"===(void 0===t?"undefined":Ut(t))?t:{};return r.setter="function"==typeof t?t:r.setter,new sn(e,r.context,r.compareStructural||r.struct||!1,r.name||e.name||"",r.setter)};t.computed=Jt,Jt.struct=qt,t.createTransformer=d,t.expr=f,t.extendObservable=m,t.extendShallowObservable=v,t.intercept=x,t.isComputed=k,t.isObservable=A;var Ft=L(Be),Xt=L($e),Qt=L(Ue),Zt=L(He),en=L(Ke),tn=function(){function e(){}return e.prototype.box=function(e,t){return arguments.length>2&&T("box"),new Pn(e,Be,t)},e.prototype.shallowBox=function(e,t){return arguments.length>2&&T("shallowBox"),new Pn(e,Ue,t)},e.prototype.array=function(e,t){return arguments.length>2&&T("array"),new Sn(e,Be,t)},e.prototype.shallowArray=function(e,t){return arguments.length>2&&T("shallowArray"),new Sn(e,Ue,t)},e.prototype.map=function(e,t){return arguments.length>2&&T("map"),new En(e,Be,t)},e.prototype.shallowMap=function(e,t){return arguments.length>2&&T("shallowMap"),new En(e,Ue,t)},e.prototype.object=function(e,t){arguments.length>2&&T("object");var n={};return Fe(n,t),m(n,e),n},e.prototype.shallowObject=function(e,t){arguments.length>2&&T("shallowObject");var n={};return Fe(n,t),v(n,e),n},e.prototype.ref=function(){return arguments.length<2?ze(Ue,arguments[0]):Qt.apply(null,arguments)},e.prototype.shallow=function(){return arguments.length<2?ze($e,arguments[0]):Xt.apply(null,arguments)},e.prototype.deep=function(){return arguments.length<2?ze(Be,arguments[0]):Ft.apply(null,arguments)},e.prototype.struct=function(){return arguments.length<2?ze(He,arguments[0]):Zt.apply(null,arguments)},e}();t.IObservableFactories=tn;var nn=E;t.observable=nn,Object.keys(tn.prototype).forEach(function(e){return nn[e]=tn.prototype[e]}),nn.deep.struct=nn.struct,nn.ref.struct=function(){return arguments.length<2?ze(Ke,arguments[0]):en.apply(null,arguments)},t.observe=C,t.toJS=R,t.transaction=P,t.whyRun=N,t.useStrict=U,t.isStrictModeEnabled=H;var rn=function(){function e(e){void 0===e&&(e="Atom@"+bt()),this.name=e,this.isPendingUnobservation=!0,this.observers=[],this.observersIndexes={},this.diffValue=0,this.lastAccessedBy=0,this.lowestObserverState=un.NOT_TRACKING}return e.prototype.onBecomeUnobserved=function(){},e.prototype.reportObserved=function(){fe(this)},e.prototype.reportChanged=function(){de(),me(this),pe()},e.prototype.toString=function(){return this.name},e}();t.BaseAtom=rn;var on=function(e){function t(t,n,r){void 0===t&&(t="Atom@"+bt()),void 0===n&&(n=Bn),void 0===r&&(r=Bn);var i=e.call(this,t)||this;return i.name=t,i.onBecomeObservedHandler=n,i.onBecomeUnobservedHandler=r,i.isPendingUnobservation=!1,i.isBeingTracked=!1,i}return Ht(t,e),t.prototype.reportObserved=function(){return de(),e.prototype.reportObserved.call(this),this.isBeingTracked||(this.isBeingTracked=!0,this.onBecomeObservedHandler()),pe(),!!pn.trackingDerivation},t.prototype.onBecomeUnobserved=function(){this.isBeingTracked=!1,this.onBecomeUnobservedHandler()},t}(rn);t.Atom=on;var an=Dt("Atom",rn),sn=function(){function e(e,t,n,r,i){this.derivation=e,this.scope=t,this.compareStructural=n,this.dependenciesState=un.NOT_TRACKING,this.observing=[],this.newObserving=null,this.isPendingUnobservation=!1,this.observers=[],this.observersIndexes={},this.diffValue=0,this.runId=0,this.lastAccessedBy=0,this.lowestObserverState=un.UP_TO_DATE,this.unboundDepsCount=0,this.__mapid="#"+bt(),this.value=void 0,this.isComputing=!1,this.isRunningSetter=!1,this.name=r||"ComputedValue@"+bt(),i&&(this.setter=V(r+"-setter",i))}return e.prototype.onBecomeStale=function(){ge(this)},e.prototype.onBecomeUnobserved=function(){Z(this),this.value=void 0},e.prototype.get=function(){wt(!this.isComputing,"Cycle detected in computation "+this.name,this.derivation),0===pn.inBatch?(de(),q(this)&&(this.value=this.computeValue(!1)),pe()):(fe(this),q(this)&&this.trackAndCompute()&&ve(this));var e=this.value;if(W(e))throw e.cause;return e},e.prototype.peek=function(){var e=this.computeValue(!1);if(W(e))throw e.cause;return e},e.prototype.set=function(e){if(this.setter){wt(!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,e)}finally{this.isRunningSetter=!1}}else wt(!1,"[ComputedValue '"+this.name+"'] It is not possible to assign a new value to a computed value.")},e.prototype.trackAndCompute=function(){Se()&&Oe({object:this.scope,type:"compute",fn:this.derivation});var e=this.value,t=this.value=this.computeValue(!0);return W(t)||Tt(this.compareStructural,t,e)},e.prototype.computeValue=function(e){this.isComputing=!0,pn.computationDepth++;var t;if(e)t=X(this,this.derivation,this.scope);else try{t=this.derivation.call(this.scope)}catch(e){t=new ln(e)}return pn.computationDepth--,this.isComputing=!1,t},e.prototype.observe=function(e,t){var n=this,r=!0,i=void 0;return s(function(){var o=n.get();if(!r||t){var a=te();e({type:"update",object:n,newValue:o,oldValue:i}),ne(a)}r=!1,i=o})},e.prototype.toJSON=function(){return this.get()},e.prototype.toString=function(){return this.name+"["+this.derivation.toString()+"]"},e.prototype.valueOf=function(){return $t(this.get())},e.prototype.whyRun=function(){var e=Boolean(pn.trackingDerivation),t=St(this.isComputing?this.newObserving:this.observing).map(function(e){return e.name}),n=St(ue(this).map(function(e){return e.name}));return"\nWhyRun? computation '"+this.name+"':\n * Running because: "+(e?"[active] the value of this computation is needed by a reaction":this.isComputing?"[get] The value of this computed was requested outside a reaction":"[idle] not running at the moment")+"\n"+(this.dependenciesState===un.NOT_TRACKING?vt("m032"):" * This computation will re-run if any of the following observables changes:\n "+Ot(t)+"\n "+(this.isComputing&&e?" (... or any observable accessed during the remainder of the current run)":"")+"\n\t"+vt("m038")+"\n\n * If the outcome of this computation changes, the following observers will be re-run:\n "+Ot(n)+"\n")},e}();sn.prototype[Bt()]=sn.prototype.valueOf;var un,cn=Dt("ComputedValue",sn);!function(e){e[e.NOT_TRACKING=-1]="NOT_TRACKING",e[e.UP_TO_DATE=0]="UP_TO_DATE",e[e.POSSIBLY_STALE=1]="POSSIBLY_STALE",e[e.STALE=2]="STALE"}(un||(un={})),t.IDerivationState=un;var ln=function(){function e(e){this.cause=e}return e}();t.untracked=ee;var hn=["mobxGuid","resetId","spyListeners","strictMode","runId"],dn=function(){function e(){this.version=5,this.trackingDerivation=null,this.computationDepth=0,this.runId=0,this.mobxGuid=0,this.inBatch=0,this.pendingUnobservations=[],this.pendingReactions=[],this.isRunningReactions=!1,this.allowStateChanges=!0,this.strictMode=!1,this.resetId=0,this.spyListeners=[],this.globalReactionErrorHandlers=[]}return e}(),pn=new dn,fn=function(){function e(e,t){void 0===e&&(e="Reaction@"+bt()),this.name=e,this.onInvalidate=t,this.observing=[],this.newObserving=[],this.dependenciesState=un.NOT_TRACKING,this.diffValue=0,this.runId=0,this.unboundDepsCount=0,this.__mapid="#"+bt(),this.isDisposed=!1,this._isScheduled=!1,this._isTrackPending=!1,this._isRunning=!1}return e.prototype.onBecomeStale=function(){this.schedule()},e.prototype.schedule=function(){this._isScheduled||(this._isScheduled=!0,pn.pendingReactions.push(this),we())},e.prototype.isScheduled=function(){return this._isScheduled},e.prototype.runReaction=function(){this.isDisposed||(de(),this._isScheduled=!1,q(this)&&(this._isTrackPending=!0,this.onInvalidate(),this._isTrackPending&&Se()&&Oe({object:this,type:"scheduled-reaction"})),pe())},e.prototype.track=function(e){de();var t,n=Se();n&&(t=Date.now(),ke({object:this,type:"reaction",fn:e})),this._isRunning=!0;var r=X(this,e,void 0);this._isRunning=!1,this._isTrackPending=!1,this.isDisposed&&Z(this),W(r)&&this.reportExceptionInDerivation(r.cause),n&&Ae({time:Date.now()-t}),pe()},e.prototype.reportExceptionInDerivation=function(e){var t=this;if(this.errorHandler)return void this.errorHandler(e,this);var n="[mobx] Encountered an uncaught exception that was thrown by a reaction or observer component, in: '"+this,r=vt("m037");console.error(n||r,e),Se()&&Oe({type:"error",message:n,error:e,object:this}),pn.globalReactionErrorHandlers.forEach(function(n){return n(e,t)})},e.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this._isRunning||(de(),Z(this),pe()))},e.prototype.getDisposer=function(){var e=this.dispose.bind(this);return e.$mobx=this,e.onError=be,e},e.prototype.toString=function(){return"Reaction["+this.name+"]"},e.prototype.whyRun=function(){var e=St(this._isRunning?this.newObserving:this.observing).map(function(e){return e.name});return"\nWhyRun? reaction '"+this.name+"':\n * Status: ["+(this.isDisposed?"stopped":this._isRunning?"running":this.isScheduled()?"scheduled":"idle")+"]\n * This reaction will re-run if any of the following observables changes:\n "+Ot(e)+"\n "+(this._isRunning?" (... or any observable accessed during the remainder of the current run)":"")+"\n\t"+vt("m038")+"\n"},e}();t.Reaction=fn;var mn=100,vn=function(e){return e()},gn=Dt("Reaction",fn),bn={spyReportEnd:!0};t.spy=Ee,t.asReference=Pe,t.asStructure=Me,t.asFlat=De,t.asMap=Ne,t.isModifierDescriptor=Ve;var yn=function(){var e=!1,t={};return Object.defineProperty(t,"0",{set:function(){e=!0}}),Object.create(t)[0]=1,!1===e}(),wn=0,_n=function(){function e(){}return e}();_n.prototype=[];var xn=function(){function e(e,t,n,r){this.array=n,this.owned=r,this.lastKnownLength=0,this.interceptors=null,this.changeListeners=null,this.atom=new rn(e||"ObservableArray@"+bt()),this.enhancer=function(n,r){return t(n,r,e+"[..]")}}return e.prototype.intercept=function(e){return Le(this,e)},e.prototype.observe=function(e,t){return void 0===t&&(t=!1),t&&e({object:this.array,type:"splice",index:0,added:this.values.slice(),addedCount:this.values.length,removed:[],removedCount:0}),je(this,e)},e.prototype.getArrayLength=function(){return this.atom.reportObserved(),this.values.length},e.prototype.setArrayLength=function(e){if("number"!=typeof e||e<0)throw new Error("[mobx.array] Out of range: "+e);var t=this.values.length;if(e!==t)if(e>t){for(var n=new Array(e-t),r=0;r<e-t;r++)n[r]=void 0;this.spliceWithArray(t,0,n)}else this.spliceWithArray(e,t-e)},e.prototype.updateArrayLength=function(e,t){if(e!==this.lastKnownLength)throw new Error("[mobx] Modification exception: the internal structure of an observable array was changed. Did you use peek() to change it?");this.lastKnownLength+=t,t>0&&e+t+1>wn&&We(e+t+1)},e.prototype.spliceWithArray=function(e,t,n){var r=this;F(this.atom);var i=this.values.length;if(void 0===e?e=0:e>i?e=i:e<0&&(e=Math.max(0,i+e)),t=1===arguments.length?i-e:void 0===t||null===t?0:Math.max(0,Math.min(t,i-e)),void 0===n&&(n=[]),Te(this)){var o=Ce(this,{object:this.array,type:"splice",index:e,removedCount:t,added:n});if(!o)return Vn;t=o.removedCount,n=o.added}n=n.map(function(e){return r.enhancer(e,void 0)});var a=n.length-t;this.updateArrayLength(i,a);var s=this.spliceItemsIntoValues(e,t,n);return 0===t&&0===n.length||this.notifyArraySplice(e,n,s),s},e.prototype.spliceItemsIntoValues=function(e,t,n){if(n.length<1e4)return(i=this.values).splice.apply(i,[e,t].concat(n));var r=this.values.slice(e,e+t);return this.values=this.values.slice(0,e).concat(n,this.values.slice(e+t)),r;var i},e.prototype.notifyArrayChildUpdate=function(e,t,n){var r=!this.owned&&Se(),i=Ie(this),o=i||r?{object:this.array,type:"update",index:e,newValue:t,oldValue:n}:null;r&&ke(o),this.atom.reportChanged(),i&&Re(this,o),r&&Ae()},e.prototype.notifyArraySplice=function(e,t,n){var r=!this.owned&&Se(),i=Ie(this),o=i||r?{object:this.array,type:"splice",index:e,removed:n,added:t,removedCount:n.length,addedCount:t.length}:null;r&&ke(o),this.atom.reportChanged(),i&&Re(this,o),r&&Ae()},e}(),Sn=function(e){function t(t,n,r,i){void 0===r&&(r="ObservableArray@"+bt()),void 0===i&&(i=!1);var o=e.call(this)||this,a=new xn(r,n,o,i);return It(o,"$mobx",a),t&&t.length?(a.updateArrayLength(0,t.length),a.values=t.map(function(e){return n(e,void 0,r+"[..]")}),a.notifyArraySplice(0,a.values.slice(),Vn)):a.values=[],yn&&Object.defineProperty(a.array,"0",On),o}return Ht(t,e),t.prototype.intercept=function(e){return this.$mobx.intercept(e)},t.prototype.observe=function(e,t){return void 0===t&&(t=!1),this.$mobx.observe(e,t)},t.prototype.clear=function(){return this.splice(0)},t.prototype.concat=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return this.$mobx.atom.reportObserved(),Array.prototype.concat.apply(this.peek(),e.map(function(e){return qe(e)?e.peek():e}))},t.prototype.replace=function(e){return this.$mobx.spliceWithArray(0,this.$mobx.values.length,e)},t.prototype.toJS=function(){return this.slice()},t.prototype.toJSON=function(){return this.toJS()},t.prototype.peek=function(){return this.$mobx.values},t.prototype.find=function(e,t,n){void 0===n&&(n=0),this.$mobx.atom.reportObserved();for(var r=this.$mobx.values,i=r.length,o=n;o<i;o++)if(e.call(t,r[o],o,this))return r[o]},t.prototype.splice=function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];switch(arguments.length){case 0:return[];case 1:return this.$mobx.spliceWithArray(e);case 2:return this.$mobx.spliceWithArray(e,t)}return this.$mobx.spliceWithArray(e,t,n)},t.prototype.spliceWithArray=function(e,t,n){return this.$mobx.spliceWithArray(e,t,n)},t.prototype.push=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=this.$mobx;return n.spliceWithArray(n.values.length,0,e),n.values.length},t.prototype.pop=function(){return this.splice(Math.max(this.$mobx.values.length-1,0),1)[0]},t.prototype.shift=function(){return this.splice(0,1)[0]},t.prototype.unshift=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=this.$mobx;return n.spliceWithArray(0,0,e),n.values.length},t.prototype.reverse=function(){this.$mobx.atom.reportObserved();var e=this.slice();return e.reverse.apply(e,arguments)},t.prototype.sort=function(e){this.$mobx.atom.reportObserved();var t=this.slice();return t.sort.apply(t,arguments)},t.prototype.remove=function(e){var t=this.$mobx.values.indexOf(e);return t>-1&&(this.splice(t,1),!0)},t.prototype.move=function(e,t){function n(e){if(e<0)throw new Error("[mobx.array] Index out of bounds: "+e+" is negative");var t=this.$mobx.values.length;if(e>=t)throw new Error("[mobx.array] Index out of bounds: "+e+" is not smaller than "+t)}if(n.call(this,e),n.call(this,t),e!==t){var r,i=this.$mobx.values;r=e<t?i.slice(0,e).concat(i.slice(e+1,t+1),[i[e]],i.slice(t+1)):i.slice(0,t).concat([i[e]],i.slice(t,e),i.slice(e+1)),this.replace(r)}},t.prototype.toString=function(){return this.$mobx.atom.reportObserved(),Array.prototype.toString.apply(this.$mobx.values,arguments)},t.prototype.toLocaleString=function(){return this.$mobx.atom.reportObserved(),Array.prototype.toLocaleString.apply(this.$mobx.values,arguments)},t.prototype.get=function(e){var t=this.$mobx;if(t){if(e<t.values.length)return t.atom.reportObserved(),t.values[e];console.warn("[mobx.array] Attempt to read an array index ("+e+") that is out of bounds ("+t.values.length+"). Please check length first. Out of bound indices will not be tracked by MobX")}},t.prototype.set=function(e,t){var n=this.$mobx,r=n.values;if(e<r.length){F(n.atom);var i=r[e];if(Te(n)){var o=Ce(n,{type:"update",object:this,index:e,newValue:t});if(!o)return;t=o.newValue}t=n.enhancer(t,i);t!==i&&(r[e]=t,n.notifyArrayChildUpdate(e,t,i))}else{if(e!==r.length)throw new Error("[mobx.array] Index out of bounds, "+e+" is larger than "+r.length);n.spliceWithArray(e,0,[t])}},t}(_n);mt(Sn.prototype,function(){return ft(this.slice())}),function(e,t){for(var n=0;n<t.length;n++)Ct(e,t[n],e[t[n]])}(Sn.prototype,["constructor","intercept","observe","clear","concat","get","replace","toJS","toJSON","peek","find","splice","spliceWithArray","push","pop","set","shift","unshift","reverse","sort","remove","move","toString","toLocaleString"]),Object.defineProperty(Sn.prototype,"length",{enumerable:!1,configurable:!0,get:function(){return this.$mobx.getArrayLength()},set:function(e){this.$mobx.setArrayLength(e)}}),["every","filter","forEach","indexOf","join","lastIndexOf","map","reduce","reduceRight","slice","some"].forEach(function(e){var t=Array.prototype[e];wt("function"==typeof t,"Base function not defined on Array prototype: '"+e+"'"),Ct(Sn.prototype,e,function(){return this.$mobx.atom.reportObserved(),t.apply(this.$mobx.values,arguments)})});var On=Ge(0);We(1e3);var kn=Dt("ObservableArrayAdministration",xn);t.isObservableArray=qe;var An={},En=function(){function e(e,t,n){void 0===t&&(t=Be),void 0===n&&(n="ObservableMap@"+bt()),this.enhancer=t,this.name=n,this.$mobx=An,this._data=Object.create(null),this._hasMap=Object.create(null),this._keys=new Sn(void 0,Ue,this.name+".keys()",!0),this.interceptors=null,this.changeListeners=null,this.merge(e)}return e.prototype._has=function(e){return void 0!==this._data[e]},e.prototype.has=function(e){return!!this.isValidKey(e)&&(e=""+e,this._hasMap[e]?this._hasMap[e].get():this._updateHasMapEntry(e,!1).get())},e.prototype.set=function(e,t){this.assertValidKey(e),e=""+e;var n=this._has(e);if(Te(this)){var r=Ce(this,{type:n?"update":"add",object:this,newValue:t,name:e});if(!r)return this;t=r.newValue}return n?this._updateValue(e,t):this._addValue(e,t),this},e.prototype.delete=function(e){var t=this;if(this.assertValidKey(e),e=""+e,Te(this)){var n=Ce(this,{type:"delete",object:this,name:e});if(!n)return!1}if(this._has(e)){var r=Se(),i=Ie(this),n=i||r?{type:"delete",object:this,oldValue:this._data[e].value,name:e}:null;return r&&ke(n),M(function(){t._keys.remove(e),t._updateHasMapEntry(e,!1),t._data[e].setNewValue(void 0),t._data[e]=void 0}),i&&Re(this,n),r&&Ae(),!0}return!1},e.prototype._updateHasMapEntry=function(e,t){var n=this._hasMap[e];return n?n.setNewValue(t):n=this._hasMap[e]=new Pn(t,Ue,this.name+"."+e+"?",!1),n},e.prototype._updateValue=function(e,t){var n=this._data[e];if((t=n.prepareNewValue(t))!==Rn){var r=Se(),i=Ie(this),o=i||r?{type:"update",object:this,oldValue:n.value,name:e,newValue:t}:null;r&&ke(o),n.setNewValue(t),i&&Re(this,o),r&&Ae()}},e.prototype._addValue=function(e,t){var n=this;M(function(){var r=n._data[e]=new Pn(t,n.enhancer,n.name+"."+e,!1);t=r.value,n._updateHasMapEntry(e,!0),n._keys.push(e)});var r=Se(),i=Ie(this),o=i||r?{type:"add",object:this,name:e,newValue:t}:null;r&&ke(o),i&&Re(this,o),r&&Ae()},e.prototype.get=function(e){if(e=""+e,this.has(e))return this._data[e].get()},e.prototype.keys=function(){return ft(this._keys.slice())},e.prototype.values=function(){return ft(this._keys.map(this.get,this))},e.prototype.entries=function(){var e=this;return ft(this._keys.map(function(t){return[t,e.get(t)]}))},e.prototype.forEach=function(e,t){var n=this;this.keys().forEach(function(r){return e.call(t,n.get(r),r,n)})},e.prototype.merge=function(e){var t=this;return Tn(e)&&(e=e.toJS()),M(function(){At(e)?Object.keys(e).forEach(function(n){return t.set(n,e[n])}):Array.isArray(e)?e.forEach(function(e){var n=e[0],r=e[1];return t.set(n,r)}):zt(e)?e.forEach(function(e,n){return t.set(n,e)}):null!==e&&void 0!==e&&yt("Cannot initialize map from "+e)}),this},e.prototype.clear=function(){var e=this;M(function(){ee(function(){e.keys().forEach(e.delete,e)})})},e.prototype.replace=function(e){var t=this;return M(function(){t.clear(),t.merge(e)}),this},Object.defineProperty(e.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),e.prototype.toJS=function(){var e=this,t={};return this.keys().forEach(function(n){return t[n]=e.get(n)}),t},e.prototype.toJSON=function(){return this.toJS()},e.prototype.isValidKey=function(e){return null!==e&&void 0!==e&&("string"==typeof e||"number"==typeof e||"boolean"==typeof e)},e.prototype.assertValidKey=function(e){if(!this.isValidKey(e))throw new Error("[mobx.map] Invalid key: '"+e+"', only strings, numbers and booleans are accepted as key in observable maps.")},e.prototype.toString=function(){var e=this;return this.name+"[{ "+this.keys().map(function(t){return t+": "+e.get(t)}).join(", ")+" }]"},e.prototype.observe=function(e,t){return wt(!0!==t,vt("m033")),je(this,e)},e.prototype.intercept=function(e){return Le(this,e)},e}();t.ObservableMap=En,mt(En.prototype,function(){return this.entries()}),t.map=Je;var Tn=Dt("ObservableMap",En);t.isObservableMap=Tn;var Ln=function(){function e(e,t){this.target=e,this.name=t,this.values={},this.changeListeners=null,this.interceptors=null}return e.prototype.observe=function(e,t){return wt(!0!==t,"`observe` doesn't support the fire immediately property for observable objects."),je(this,e)},e.prototype.intercept=function(e){return Le(this,e)},e}(),Cn={},In={},jn=Dt("ObservableObjectAdministration",Ln);t.isObservableObject=ot;var Rn={},Pn=function(e){function t(t,n,r,i){void 0===r&&(r="ObservableValue@"+bt()),void 0===i&&(i=!0);var o=e.call(this,r)||this;return o.enhancer=n,o.hasUnreportedChange=!1,o.value=n(t,void 0,r),i&&Se()&&Oe({type:"create",object:o,newValue:o.value}),o}return Ht(t,e),t.prototype.set=function(e){var t=this.value;if((e=this.prepareNewValue(e))!==Rn){var n=Se();n&&ke({type:"update",object:this,newValue:e,oldValue:t}),this.setNewValue(e),n&&Ae()}},t.prototype.prepareNewValue=function(e){if(F(this),Te(this)){var t=Ce(this,{object:this,type:"update",newValue:e});if(!t)return Rn;e=t.newValue}return e=this.enhancer(e,this.value,this.name),this.value!==e?e:Rn},t.prototype.setNewValue=function(e){var t=this.value;this.value=e,this.reportChanged(),Ie(this)&&Re(this,{type:"update",object:this,newValue:e,oldValue:t})},t.prototype.get=function(){return this.reportObserved(),this.value},t.prototype.intercept=function(e){return Le(this,e)},t.prototype.observe=function(e,t){return t&&e({object:this,type:"update",newValue:this.value,oldValue:void 0}),je(this,e)},t.prototype.toJSON=function(){return this.get()},t.prototype.toString=function(){return this.name+"["+this.value+"]"},t.prototype.valueOf=function(){return $t(this.get())},t}(rn);Pn.prototype[Bt()]=Pn.prototype.valueOf;var Mn=Dt("ObservableValue",Pn);t.isBoxedObservable=Mn;var Dn="__$$iterating",Nn={m001:"It is not allowed to assign new values to @action fields",m002:"`runInAction` expects a function",m003:"`runInAction` expects a function without arguments",m004:"autorun expects a function",m005:"Warning: attempted to pass an action to autorun. Actions are untracked and will not trigger on state changes. Use `reaction` or wrap only your state modification code in an action.",m006:"Warning: attempted to pass an action to autorunAsync. Actions are untracked and will not trigger on state changes. Use `reaction` or wrap only your state modification code in an action.",m007:"reaction only accepts 2 or 3 arguments. If migrating from MobX 2, please provide an options object",m008:"wrapping reaction expression in `asReference` is no longer supported, use options object instead",m009:"@computed can only be used on getter functions, like: '@computed get myProps() { return ...; }'. It looks like it was used on a property.",m010:"@computed can only be used on getter functions, like: '@computed get myProps() { return ...; }'",m011:"First argument to `computed` should be an expression. If using computed as decorator, don't pass it arguments",m012:"computed takes one or two arguments if used as function",m013:"[mobx.expr] 'expr' should only be used inside other reactive functions.",m014:"extendObservable expected 2 or more arguments",m015:"extendObservable expects an object as first argument",m016:"extendObservable should not be used on maps, use map.merge instead",m017:"all arguments of extendObservable should be objects",m018:"extending an object with another observable (object) is not supported. Please construct an explicit propertymap, using `toJS` if need. See issue #540",m019:"[mobx.isObservable] isObservable(object, propertyName) is not supported for arrays and maps. Use map.has or array.length instead.",m020:"modifiers can only be used for individual object properties",m021:"observable expects zero or one arguments",m022:"@observable can not be used on getters, use @computed instead",m023:"Using `transaction` is deprecated, use `runInAction` or `(@)action` instead.",m024:"whyRun() can only be used if a derivation is active, or by passing an computed value / reaction explicitly. If you invoked whyRun from inside a computation; the computation is currently suspended but re-evaluating because somebody requested its value.",m025:"whyRun can only be used on reactions and computed values",m026:"`action` can only be invoked on functions",m028:"It is not allowed to set `useStrict` when a derivation is running",m029:"INTERNAL ERROR only onBecomeUnobserved shouldn't be called twice in a row",m030a:"Since strict-mode is enabled, changing observed observable values outside actions is not allowed. Please wrap the code in an `action` if this change is intended. Tried to modify: ",m030b:"Side effects like changing state are not allowed at this point. Are you trying to modify state from, for example, the render function of a React component? Tried to modify: ",m031:"Computed values are not allowed to not cause side effects by changing observables that are already being observed. Tried to modify: ",m032:"* This computation is suspended (not in use by any reaction) and won't run automatically.\n\tDidn't expect this computation to be suspended at this point?\n\t 1. Make sure this computation is used by a reaction (reaction, autorun, observer).\n\t 2. Check whether you are using this computation synchronously (in the same stack as they reaction that needs it).",m033:"`observe` doesn't support the fire immediately property for observable maps.",m034:"`mobx.map` is deprecated, use `new ObservableMap` or `mobx.observable.map` instead",m035:"Cannot make the designated object observable; it is not extensible",m036:"It is not possible to get index atoms from arrays",m037:'Hi there! I\'m sorry you have just run into an exception.\nIf your debugger ends up here, know that some reaction (like the render() of an observer component, autorun or reaction)\nthrew an exception and that mobx caught it, to avoid that it brings the rest of your application down.\nThe original cause of the exception (the code that caused this reaction to run (again)), is still in the stack.\n\nHowever, more interesting is the actual stack trace of the error itself.\nHopefully the error is an instanceof Error, because in that case you can inspect the original stack of the error from where it was thrown.\nSee `error.stack` property, or press the very subtle "(...)" link you see near the console.error message that probably brought you here.\nThat stack is more interesting than the stack of this console.error itself.\n\nIf the exception you see is an exception you created yourself, make sure to use `throw new Error("Oops")` instead of `throw "Oops"`,\nbecause the javascript environment will only preserve the original stack trace in the first form.\n\nYou can also make sure the debugger pauses the next time this very same exception is thrown by enabling "Pause on caught exception".\n(Note that it might pause on many other, unrelated exception as well).\n\nIf that all doesn\'t help you out, feel free to open an issue https://github.com/mobxjs/mobx/issues!\n',m038:"Missing items in this list?\n 1. Check whether all used values are properly marked as observable (use isObservable to verify)\n 2. Make sure you didn't dereference values too early. MobX observes props, not primitives. E.g: use 'person.name' instead of 'name' in your computation.\n"},Vn=[];Object.freeze(Vn);var zn=[],Bn=function(){},$n=Object.prototype.hasOwnProperty;t.isArrayLike=Nt}).call(t,n(4))},function(e,t,n){"use strict";function r(e,t){var n=e.meta,r=e.user,i=e.reactions,o=document.createElement("div");o.lang="en-US",o.className="gitment-container gitment-header-container";var a=document.createElement("span"),s=i.find(function(e){return"heart"===e.content&&e.user.login===r.login});a.className="gitment-header-like-btn",a.innerHTML="\n "+c.heart+"\n "+(s?"Unlike":"Like")+"\n "+(n.reactions&&n.reactions.heart?" • <strong>"+n.reactions.heart+"</strong> Liked":"")+"\n ",s?(a.classList.add("liked"),a.onclick=function(){return t.unlike()}):(a.classList.remove("liked"),a.onclick=function(){return t.like()}),o.appendChild(a);var u=document.createElement("span");u.innerHTML="\n "+(n.comments?" • <strong>"+n.comments+"</strong> Comments":"")+"\n ",o.appendChild(u);var l=document.createElement("a");return l.className="gitment-header-issue-link",l.href=n.html_url,l.target="_blank",l.innerText="Issue Page",o.appendChild(l),o}function i(e,t){var n=e.meta,r=e.comments,i=e.commentReactions,o=e.currentPage,a=e.user,s=e.error,u=document.createElement("div");if(u.lang="en-US",u.className="gitment-container gitment-comments-container",s){var h=document.createElement("div");if(h.className="gitment-comments-error",s===l.NOT_INITIALIZED_ERROR&&a.login&&a.login.toLowerCase()===t.owner.toLowerCase()){var d=document.createElement("div"),p=document.createElement("button");p.className="gitment-comments-init-btn",p.onclick=function(){p.setAttribute("disabled",!0),t.init().catch(function(e){p.removeAttribute("disabled"),alert(e)})},p.innerText="Initialize Comments",d.appendChild(p),h.appendChild(d)}else h.innerText=s;return u.appendChild(h),u}if(void 0===r){var f=document.createElement("div");return f.innerText="Loading comments...",f.className="gitment-comments-loading",u.appendChild(f),u}if(!r.length){var m=document.createElement("div");return m.className="gitment-comments-empty",m.innerText="No Comment Yet",u.appendChild(m),u}var v=document.createElement("ul");if(v.className="gitment-comments-list",r.forEach(function(e){var n=new Date(e.created_at),r=new Date(e.updated_at),o=document.createElement("li");o.className="gitment-comment",o.innerHTML='\n <a class="gitment-comment-avatar" href="'+e.user.html_url+'" target="_blank">\n <img class="gitment-comment-avatar-img" src="'+e.user.avatar_url+'"/>\n </a>\n <div class="gitment-comment-main">\n <div class="gitment-comment-header">\n <a class="gitment-comment-name" href="'+e.user.html_url+'" target="_blank">\n '+e.user.login+'\n </a>\n commented on\n <span title="'+n+'">'+n.toDateString()+"</span>\n "+(n.toString()!==r.toString()?' • <span title="comment was edited at '+r+'">edited</span>':"")+'\n <div class="gitment-comment-reply-btn">'+c.reply+'</div>\n <div class="gitment-comment-like-btn">'+c.heart+" "+(e.reactions.heart||"")+'</div>\n </div>\n <div class="gitment-comment-body gitment-markdown">'+e.body_html+"</div>\n </div>\n ";var s=o.querySelector(".gitment-comment-like-btn");i[e.id]&&i[e.id].find(function(e){return"heart"===e.content&&e.user.login===a.login})?(s.classList.add("liked"),s.onclick=function(){return t.unlikeAComment(e.id)}):(s.classList.remove("liked"),s.onclick=function(){return t.likeAComment(e.id)}),o.querySelector(".gitment-comment-reply-btn").onclick=function(){return t.replyAComment(e.user.login)};var u=document.createElement("img"),l=o.querySelector(".gitment-comment-body");u.className="gitment-hidden",u.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",u.onload=function(){l.clientHeight>t.maxCommentHeight&&(l.classList.add("gitment-comment-body-folded"),l.style.maxHeight=t.maxCommentHeight+"px",l.title="Click to Expand",l.onclick=function(){l.classList.remove("gitment-comment-body-folded"),l.style.maxHeight="",l.title="",l.onclick=null})},o.appendChild(u),v.appendChild(o)}),u.appendChild(v),n){var g=Math.ceil(n.comments/t.perPage);if(g>1){var b=document.createElement("ul");if(b.className="gitment-comments-pagination",o>1){var y=document.createElement("li");y.className="gitment-comments-page-item",y.innerText="Previous",y.onclick=function(){return t.goto(o-1)},b.appendChild(y)}for(var w=1;w<=g;w++)!function(e){var n=document.createElement("li");n.className="gitment-comments-page-item",n.innerText=e,n.onclick=function(){return t.goto(e)},o===e&&n.classList.add("gitment-selected"),b.appendChild(n)}(w);if(o<g){var _=document.createElement("li");_.className="gitment-comments-page-item",_.innerText="Next",_.onclick=function(){return t.goto(o+1)},b.appendChild(_)}u.appendChild(b)}}return u}function o(e,t){var n=e.user,r=e.error,i=document.createElement("div");i.lang="en-US",i.className="gitment-container gitment-editor-container";var o=n.login&&!r?"":"disabled",a=n.login?"":"Login to Comment";i.innerHTML="\n "+(n.login?'<a class="gitment-editor-avatar" href="'+n.html_url+'" target="_blank">\n <img class="gitment-editor-avatar-img" src="'+n.avatar_url+'"/>\n </a>':n.isLoggingIn?'<div class="gitment-editor-avatar">'+c.spinner+"</div>":'<a class="gitment-editor-avatar" href="'+t.loginLink+'" title="login with GitHub">\n '+c.github+"\n </a>")+'\n </a>\n <div class="gitment-editor-main">\n <div class="gitment-editor-header">\n <nav class="gitment-editor-tabs">\n <button class="gitment-editor-tab gitment-selected">Write</button>\n <button class="gitment-editor-tab">Preview</button>\n </nav>\n <div class="gitment-editor-login">\n '+(n.login?'<a class="gitment-editor-logout-link">Logout</a>':n.isLoggingIn?"Logging in...":'<a class="gitment-editor-login-link" href="'+t.loginLink+'">Login</a> with GitHub')+'\n </div>\n </div>\n <div class="gitment-editor-body">\n <div class="gitment-editor-write-field">\n <textarea placeholder="Leave a comment" id="gitment-editor" title="'+a+'" '+o+'></textarea>\n </div>\n <div class="gitment-editor-preview-field gitment-hidden">\n <div class="gitment-editor-preview gitment-markdown"></div>\n </div>\n </div>\n </div>\n <div class="gitment-editor-footer">\n <a class="gitment-editor-footer-tip" href="https://guides.github.com/features/mastering-markdown/" target="_blank">\n Styling with Markdown is supported\n </a>\n <button class="gitment-editor-submit" title="'+a+'" '+o+">Comment</button>\n </div>\n ",n.login&&(i.querySelector(".gitment-editor-logout-link").onclick=function(){return t.logout()});var s=i.querySelector(".gitment-editor-write-field"),l=i.querySelector(".gitment-editor-preview-field"),h=s.querySelector("textarea");h.oninput=function(){h.style.height="auto";var e=window.getComputedStyle(h,null),t=parseInt(e.height,10),n=h.clientHeight,r=h.scrollHeight;n<r&&(h.style.height=t+r-n+"px")};var d=i.querySelectorAll(".gitment-editor-tab"),p=u(d,2),f=p[0],m=p[1];f.onclick=function(){f.classList.add("gitment-selected"),m.classList.remove("gitment-selected"),s.classList.remove("gitment-hidden"),l.classList.add("gitment-hidden"),h.focus()},m.onclick=function(){m.classList.add("gitment-selected"),f.classList.remove("gitment-selected"),l.classList.remove("gitment-hidden"),s.classList.add("gitment-hidden");var e=l.querySelector(".gitment-editor-preview"),n=h.value.trim();if(!n)return void(e.innerText="Nothing to preview");e.innerText="Loading preview...",t.markdown(n).then(function(t){return e.innerHTML=t})};var v=i.querySelector(".gitment-editor-submit");return v.onclick=function(){v.innerText="Submitting...",v.setAttribute("disabled",!0),t.post(h.value.trim()).then(function(e){h.value="",h.style.height="auto",v.removeAttribute("disabled"),v.innerText="Comment"}).catch(function(e){alert(e),v.removeAttribute("disabled"),v.innerText="Comment"})},i}function a(){var e=document.createElement("div");return e.lang="en-US",e.className="gitment-container gitment-footer-container",e.innerHTML='\n Powered by\n <a class="gitment-footer-project-link" href="https://github.com/imsun/gitment" target="_blank">\n Gitment\n </a>\n ',e}function s(e,t){var n=document.createElement("div");return n.lang="en-US",n.className="gitment-container gitment-root-container",n.appendChild(t.renderHeader(e,t)),n.appendChild(t.renderComments(e,t)),n.appendChild(t.renderEditor(e,t)),n.appendChild(t.renderFooter(e,t)),n}Object.defineProperty(t,"__esModule",{value:!0});var u=function(){function e(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{!r&&s.return&&s.return()}finally{if(i)throw o}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),c=n(6),l=n(0);t.default={render:s,renderHeader:r,renderComments:i,renderEditor:o,renderFooter:a}},function(e,t,n){"use strict";function r(e){return e instanceof Element?e:s(e)?document.getElementById(e):document.createElement("div")}function i(e){return function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"https://api.github.com",i=new XMLHttpRequest,o=localStorage.getItem(a.LS_ACCESS_TOKEN_KEY),s=""+r+t,c=null;"GET"!==e&&"DELETE"!==e||(s+=u.stringify(n));var l=new Promise(function(e,t){i.addEventListener("load",function(){var n=i.getResponseHeader("content-type"),r=i.responseText;if(!/json/.test(n))return void e(r);var o=i.responseText?JSON.parse(r):{};o.message?t(new Error(o.message)):e(o)}),i.addEventListener("error",function(e){return t(e)})});return i.open(e,s,!0),i.setRequestHeader("Accept","application/vnd.github.squirrel-girl-preview, application/vnd.github.html+json"),o&&i.setRequestHeader("Authorization","token "+o),"GET"!==e&&"DELETE"!==e&&(c=JSON.stringify(n),i.setRequestHeader("Content-Type","application/json")),i.send(c),l}}Object.defineProperty(t,"__esModule",{value:!0}),t.http=t.Query=t.isString=void 0;var o=function(){function e(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{!r&&s.return&&s.return()}finally{if(i)throw o}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();t.getTargetContainer=r;var a=n(0),s=t.isString=function(e){return"[object String]"===toString.call(e)},u=t.Query={parse:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.location.search;if(!e)return{};var t="?"===e[0]?e.substring(1):e,n={};return t.split("&").forEach(function(e){var t=e.split("="),r=o(t,2),i=r[0],a=r[1];i&&(n[i]=a)}),n},stringify:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"?",n=Object.keys(e).map(function(t){return t+"="+encodeURIComponent(e[t]||"")}).join("&");return n?t+n:""}};t.http={get:i("GET"),post:i("POST"),delete:i("DELETE"),put:i("PUT")}},function(e,t,n){"use strict";var r,i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};r=function(){return this}();try{r=r||Function("return this")()||(0,eval)("this")}catch(e){"object"===("undefined"==typeof window?"undefined":i(window))&&(r=window)}e.exports=r},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){e[t]=function(n){var r=(0,u.getTargetContainer)(n),i=e.theme[t]||e.defaultTheme[t];return(0,a.autorun)(function(){var t=i(e.state,e);r.firstChild?r.replaceChild(t,r.firstChild):r.appendChild(t)}),r}}var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(1),s=n(0),u=n(3),c=n(2),l=function(e){return e&&e.__esModule?e:{default:e}}(c),h=function(){function e(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};r(this,e),this.defaultTheme=l.default,this.useTheme(l.default),Object.assign(this,{id:window.location.href,title:window.document.title,link:window.location.href,desc:"",labels:[],theme:l.default,oauth:{},perPage:20,maxCommentHeight:250},n),this.useTheme(this.theme);var i={};try{var o=localStorage.getItem(s.LS_USER_KEY);this.accessToken&&o&&Object.assign(i,JSON.parse(o),{fromCache:!0})}catch(e){localStorage.removeItem(s.LS_USER_KEY)}this.state=(0,a.observable)({user:i,error:null,meta:{},comments:void 0,reactions:[],commentReactions:{},currentPage:1});var c=u.Query.parse();if(c.code){var h=this.oauth,d=h.client_id,p=h.client_secret,f=c.code;delete c.code;var m=u.Query.stringify(c),v=""+window.location.origin+window.location.pathname+m+window.location.hash;history.replaceState({},"",v),Object.assign(this,{id:v,link:v},n),this.state.user.isLoggingIn=!0,u.http.post("https://gh-oauth.imsun.net",{code:f,client_id:d,client_secret:p},"").then(function(e){t.accessToken=e.access_token,t.update()}).catch(function(e){t.state.user.isLoggingIn=!1,alert(e)})}else this.update()}return o(e,[{key:"accessToken",get:function(){return localStorage.getItem(s.LS_ACCESS_TOKEN_KEY)},set:function(e){localStorage.setItem(s.LS_ACCESS_TOKEN_KEY,e)}},{key:"loginLink",get:function(){var e=this.oauth.redirect_uri||window.location.href,t=Object.assign({scope:"public_repo",redirect_uri:e},this.oauth);return"https://github.com/login/oauth/authorize"+u.Query.stringify(t)}}]),o(e,[{key:"init",value:function(){var e=this;return this.createIssue().then(function(){return e.loadComments()}).then(function(t){return e.state.error=null,t})}},{key:"useTheme",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.theme=t,Object.keys(this.theme).forEach(function(t){return i(e,t)})}},{key:"update",value:function(){var e=this;return Promise.all([this.loadMeta(),this.loadUserInfo()]).then(function(){return Promise.all([e.loadComments().then(function(){return e.loadCommentReactions()}),e.loadReactions()])}).catch(function(t){return e.state.error=t})}},{key:"markdown",value:function(e){return u.http.post("/markdown",{text:e,mode:"gfm"})}},{key:"createIssue",value:function(){var e=this,t=this.id,n=this.owner,r=this.repo,i=this.title,o=this.link,a=this.desc,s=this.labels;return u.http.post("/repos/"+n+"/"+r+"/issues",{title:i,labels:s.concat(["gitment",t]),body:o+"\n\n"+a}).then(function(t){return e.state.meta=t,t})}},{key:"getIssue",value:function(){return this.state.meta.id?Promise.resolve(this.state.meta):this.loadMeta()}},{key:"post",value:function(e){var t=this;return this.getIssue().then(function(t){return u.http.post(t.comments_url,{body:e},"")}).then(function(e){t.state.meta.comments++;var n=Math.ceil(t.state.meta.comments/t.perPage);return t.state.currentPage===n&&t.state.comments.push(e),e})}},{key:"loadMeta",value:function(){var e=this,t=this.id,n=this.owner,r=this.repo;return u.http.get("/repos/"+n+"/"+r+"/issues",{creator:n,labels:t}).then(function(t){return t.length?(e.state.meta=t[0],t[0]):Promise.reject(s.NOT_INITIALIZED_ERROR)})}},{key:"loadComments",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.state.currentPage;return this.getIssue().then(function(n){return u.http.get(n.comments_url,{page:t,per_page:e.perPage},"")}).then(function(t){return e.state.comments=t,t})}},{key:"loadUserInfo",value:function(){var e=this;return this.accessToken?u.http.get("/user").then(function(t){return e.state.user=t,localStorage.setItem(s.LS_USER_KEY,JSON.stringify(t)),t}):(this.logout(),Promise.resolve({}))}},{key:"loadReactions",value:function(){var e=this;return this.accessToken?this.getIssue().then(function(e){return e.reactions.total_count?u.http.get(e.reactions.url,{},""):[]}).then(function(t){return e.state.reactions=t,t}):(this.state.reactions=[],Promise.resolve([]))}},{key:"loadCommentReactions",value:function(){var e=this;if(!this.accessToken)return this.state.commentReactions={},Promise.resolve([]);var t=this.state.comments,n={};return Promise.all(t.map(function(t){if(!t.reactions.total_count)return[];var n=e.owner,r=e.repo;return u.http.get("/repos/"+n+"/"+r+"/issues/comments/"+t.id+"/reactions",{})})).then(function(r){return t.forEach(function(e,t){n[e.id]=r[t]}),e.state.commentReactions=n,n})}},{key:"login",value:function(){window.location.href=this.loginLink}},{key:"logout",value:function(){localStorage.removeItem(s.LS_ACCESS_TOKEN_KEY),localStorage.removeItem(s.LS_USER_KEY),this.state.user={}}},{key:"goto",value:function(e){return this.state.currentPage=e,this.state.comments=void 0,this.loadComments(e)}},{key:"like",value:function(){var e=this;if(!this.accessToken)return alert("Login to Like"),Promise.reject();var t=this.owner,n=this.repo;return u.http.post("/repos/"+t+"/"+n+"/issues/"+this.state.meta.number+"/reactions",{content:"heart"}).then(function(t){e.state.reactions.push(t),e.state.meta.reactions.heart++})}},{key:"unlike",value:function(){var e=this;if(!this.accessToken)return Promise.reject();var t=this.state,n=t.user,r=t.reactions,i=r.findIndex(function(e){return e.user.login===n.login});return u.http.delete("/reactions/"+r[i].id).then(function(){r.splice(i,1),e.state.meta.reactions.heart--})}},{key:"likeAComment",value:function(e){var t=this;if(!this.accessToken)return alert("Login to Like"),Promise.reject();var n=this.owner,r=this.repo,i=this.state.comments.find(function(t){return t.id===e});return u.http.post("/repos/"+n+"/"+r+"/issues/comments/"+e+"/reactions",{content:"heart"}).then(function(n){t.state.commentReactions[e].push(n),i.reactions.heart++})}},{key:"unlikeAComment",value:function(e){if(!this.accessToken)return Promise.reject();var t=this.state.commentReactions[e],n=this.state.comments.find(function(t){return t.id===e}),r=this.state.user,i=t.findIndex(function(e){return e.user.login===r.login});return u.http.delete("/reactions/"+t[i].id).then(function(){t.splice(i,1),n.reactions.heart--})}},{key:"replyAComment",value:function(e){if(!this.accessToken)return Promise.reject();var t=document.getElementById("gitment-editor");t.innerText+="@"+e+" ",t.focus()}}]),e}();e.exports=h},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.close='<svg class="gitment-close-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 50 50"><path d="M37.304 11.282l1.414 1.414-26.022 26.02-1.414-1.413z"/><path d="M12.696 11.282l26.022 26.02-1.414 1.415-26.022-26.02z"/></svg>',t.github='<svg class="gitment-github-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 50 50"><path d="M25 10c-8.3 0-15 6.7-15 15 0 6.6 4.3 12.2 10.3 14.2.8.1 1-.3 1-.7v-2.6c-4.2.9-5.1-2-5.1-2-.7-1.7-1.7-2.2-1.7-2.2-1.4-.9.1-.9.1-.9 1.5.1 2.3 1.5 2.3 1.5 1.3 2.3 3.5 1.6 4.4 1.2.1-1 .5-1.6 1-2-3.3-.4-6.8-1.7-6.8-7.4 0-1.6.6-3 1.5-4-.2-.4-.7-1.9.1-4 0 0 1.3-.4 4.1 1.5 1.2-.3 2.5-.5 3.8-.5 1.3 0 2.6.2 3.8.5 2.9-1.9 4.1-1.5 4.1-1.5.8 2.1.3 3.6.1 4 1 1 1.5 2.4 1.5 4 0 5.8-3.5 7-6.8 7.4.5.5 1 1.4 1 2.8v4.1c0 .4.3.9 1 .7 6-2 10.2-7.6 10.2-14.2C40 16.7 33.3 10 25 10z"/></svg>',t.heart='<svg class="gitment-heart-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 50 50"><path d="M25 39.7l-.6-.5C11.5 28.7 8 25 8 19c0-5 4-9 9-9 4.1 0 6.4 2.3 8 4.1 1.6-1.8 3.9-4.1 8-4.1 5 0 9 4 9 9 0 6-3.5 9.7-16.4 20.2l-.6.5zM17 12c-3.9 0-7 3.1-7 7 0 5.1 3.2 8.5 15 18.1 11.8-9.6 15-13 15-18.1 0-3.9-3.1-7-7-7-3.5 0-5.4 2.1-6.9 3.8L25 17.1l-1.1-1.3C22.4 14.1 20.5 12 17 12z"/></svg>',t.spinner='<svg class="gitment-spinner-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 50 50"><path d="M25 18c-.6 0-1-.4-1-1V9c0-.6.4-1 1-1s1 .4 1 1v8c0 .6-.4 1-1 1z"/><path opacity=".3" d="M25 42c-.6 0-1-.4-1-1v-8c0-.6.4-1 1-1s1 .4 1 1v8c0 .6-.4 1-1 1z"/><path opacity=".3" d="M29 19c-.2 0-.3 0-.5-.1-.4-.3-.6-.8-.3-1.3l4-6.9c.3-.4.8-.6 1.3-.3.4.3.6.8.3 1.3l-4 6.9c-.2.2-.5.4-.8.4z"/><path opacity=".3" d="M17 39.8c-.2 0-.3 0-.5-.1-.4-.3-.6-.8-.3-1.3l4-6.9c.3-.4.8-.6 1.3-.3.4.3.6.8.3 1.3l-4 6.9c-.2.2-.5.4-.8.4z"/><path opacity=".93" d="M21 19c-.3 0-.6-.2-.8-.5l-4-6.9c-.3-.4-.1-1 .3-1.3.4-.3 1-.1 1.3.3l4 6.9c.3.4.1 1-.3 1.3-.2.2-.3.2-.5.2z"/><path opacity=".3" d="M33 39.8c-.3 0-.6-.2-.8-.5l-4-6.9c-.3-.4-.1-1 .3-1.3.4-.3 1-.1 1.3.3l4 6.9c.3.4.1 1-.3 1.3-.2.1-.3.2-.5.2z"/><path opacity=".65" d="M17 26H9c-.6 0-1-.4-1-1s.4-1 1-1h8c.6 0 1 .4 1 1s-.4 1-1 1z"/><path opacity=".3" d="M41 26h-8c-.6 0-1-.4-1-1s.4-1 1-1h8c.6 0 1 .4 1 1s-.4 1-1 1z"/><path opacity=".86" d="M18.1 21.9c-.2 0-.3 0-.5-.1l-6.9-4c-.4-.3-.6-.8-.3-1.3.3-.4.8-.6 1.3-.3l6.9 4c.4.3.6.8.3 1.3-.2.3-.5.4-.8.4z"/><path opacity=".3" d="M38.9 33.9c-.2 0-.3 0-.5-.1l-6.9-4c-.4-.3-.6-.8-.3-1.3.3-.4.8-.6 1.3-.3l6.9 4c.4.3.6.8.3 1.3-.2.3-.5.4-.8.4z"/><path opacity=".44" d="M11.1 33.9c-.3 0-.6-.2-.8-.5-.3-.4-.1-1 .3-1.3l6.9-4c.4-.3 1-.1 1.3.3.3.4.1 1-.3 1.3l-6.9 4c-.1.2-.3.2-.5.2z"/><path opacity=".3" d="M31.9 21.9c-.3 0-.6-.2-.8-.5-.3-.4-.1-1 .3-1.3l6.9-4c.4-.3 1-.1 1.3.3.3.4.1 1-.3 1.3l-6.9 4c-.2.2-.3.2-.5.2z"/></svg>',t.reply='<svg class="gitment-reply-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 19 19"><path d="M1.307,5.988 L6.616,1.343 C7.027,0.933 7.507,0.864 7.918,1.275 L7.918,4.407 C8.014,4.406 8.098,4.406 8.147,4.406 C13.163,4.406 16.885,7.969 16.885,12.816 C16.885,14.504 16.111,13.889 15.788,13.3 C14.266,10.52 11.591,8.623 8.107,8.623 C8.066,8.623 7.996,8.624 7.917,8.624 L7.917,11.689 C7.506,12.099 6.976,12.05 6.615,11.757 L1.306,7.474 C0.897,7.064 0.897,6.399 1.307,5.988 L1.307,5.988 Z" fill="#434343" class="si-glyph-fill"></path></svg>'}]); \ No newline at end of file