From 140c78022f90a5eb61c649dc14ec0cb6b026be2a Mon Sep 17 00:00:00 2001 From: Michael Raman Date: Sat, 25 Sep 2021 15:54:32 -0400 Subject: [PATCH 1/2] Adding build folder to resolve last minute deployment issue --- client/build/asset-manifest.json | 15 +++++++ client/build/favicon.ico | Bin 0 -> 3870 bytes client/build/favicon.png | Bin 0 -> 1563 bytes client/build/index.html | 1 + client/build/judging_map.svg | 3 ++ client/build/manifest.json | 15 +++++++ ...nifest.a528dea505573c9dc803ef7b17d0db34.js | 22 ++++++++++ client/build/service-worker.js | 39 ++++++++++++++++++ .../build/static/css/main.498dfaa0.chunk.css | 2 + .../static/css/main.498dfaa0.chunk.css.map | 1 + client/build/static/js/2.e657e8ae.chunk.js | 2 + .../build/static/js/2.e657e8ae.chunk.js.map | 1 + client/build/static/js/main.6259ef67.chunk.js | 2 + .../static/js/main.6259ef67.chunk.js.map | 1 + .../build/static/js/runtime~main.a8a9905a.js | 2 + .../static/js/runtime~main.a8a9905a.js.map | 1 + 16 files changed, 107 insertions(+) create mode 100644 client/build/asset-manifest.json create mode 100644 client/build/favicon.ico create mode 100644 client/build/favicon.png create mode 100644 client/build/index.html create mode 100644 client/build/judging_map.svg create mode 100644 client/build/manifest.json create mode 100644 client/build/precache-manifest.a528dea505573c9dc803ef7b17d0db34.js create mode 100644 client/build/service-worker.js create mode 100644 client/build/static/css/main.498dfaa0.chunk.css create mode 100644 client/build/static/css/main.498dfaa0.chunk.css.map create mode 100644 client/build/static/js/2.e657e8ae.chunk.js create mode 100644 client/build/static/js/2.e657e8ae.chunk.js.map create mode 100644 client/build/static/js/main.6259ef67.chunk.js create mode 100644 client/build/static/js/main.6259ef67.chunk.js.map create mode 100644 client/build/static/js/runtime~main.a8a9905a.js create mode 100644 client/build/static/js/runtime~main.a8a9905a.js.map diff --git a/client/build/asset-manifest.json b/client/build/asset-manifest.json new file mode 100644 index 0000000..5c25954 --- /dev/null +++ b/client/build/asset-manifest.json @@ -0,0 +1,15 @@ +{ + "files": { + "main.css": "/static/css/main.498dfaa0.chunk.css", + "main.js": "/static/js/main.6259ef67.chunk.js", + "main.js.map": "/static/js/main.6259ef67.chunk.js.map", + "runtime~main.js": "/static/js/runtime~main.a8a9905a.js", + "runtime~main.js.map": "/static/js/runtime~main.a8a9905a.js.map", + "static/js/2.e657e8ae.chunk.js": "/static/js/2.e657e8ae.chunk.js", + "static/js/2.e657e8ae.chunk.js.map": "/static/js/2.e657e8ae.chunk.js.map", + "index.html": "/index.html", + "precache-manifest.a528dea505573c9dc803ef7b17d0db34.js": "/precache-manifest.a528dea505573c9dc803ef7b17d0db34.js", + "service-worker.js": "/service-worker.js", + "static/css/main.498dfaa0.chunk.css.map": "/static/css/main.498dfaa0.chunk.css.map" + } +} \ No newline at end of file diff --git a/client/build/favicon.ico b/client/build/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..a11777cc471a4344702741ab1c8a588998b1311a GIT binary patch literal 3870 zcma);c{J4h9>;%nil|2-o+rCuEF-(I%-F}ijC~o(k~HKAkr0)!FCj~d>`RtpD?8b; zXOC1OD!V*IsqUwzbMF1)-gEDD=A573Z-&G7^LoAC9|WO7Xc0Cx1g^Zu0u_SjAPB3vGa^W|sj)80f#V0@M_CAZTIO(t--xg= z!sii`1giyH7EKL_+Wi0ab<)&E_0KD!3Rp2^HNB*K2@PHCs4PWSA32*-^7d{9nH2_E zmC{C*N*)(vEF1_aMamw2A{ZH5aIDqiabnFdJ|y0%aS|64E$`s2ccV~3lR!u<){eS` z#^Mx6o(iP1Ix%4dv`t@!&Za-K@mTm#vadc{0aWDV*_%EiGK7qMC_(`exc>-$Gb9~W!w_^{*pYRm~G zBN{nA;cm^w$VWg1O^^<6vY`1XCD|s_zv*g*5&V#wv&s#h$xlUilPe4U@I&UXZbL z0)%9Uj&@yd03n;!7do+bfixH^FeZ-Ema}s;DQX2gY+7g0s(9;`8GyvPY1*vxiF&|w z>!vA~GA<~JUqH}d;DfBSi^IT*#lrzXl$fNpq0_T1tA+`A$1?(gLb?e#0>UELvljtQ zK+*74m0jn&)5yk8mLBv;=@}c{t0ztT<v;Avck$S6D`Z)^c0(jiwKhQsn|LDRY&w(Fmi91I7H6S;b0XM{e zXp0~(T@k_r-!jkLwd1_Vre^v$G4|kh4}=Gi?$AaJ)3I+^m|Zyj#*?Kp@w(lQdJZf4 z#|IJW5z+S^e9@(6hW6N~{pj8|NO*>1)E=%?nNUAkmv~OY&ZV;m-%?pQ_11)hAr0oAwILrlsGawpxx4D43J&K=n+p3WLnlDsQ$b(9+4 z?mO^hmV^F8MV{4Lx>(Q=aHhQ1){0d*(e&s%G=i5rq3;t{JC zmgbn5Nkl)t@fPH$v;af26lyhH!k+#}_&aBK4baYPbZy$5aFx4}ka&qxl z$=Rh$W;U)>-=S-0=?7FH9dUAd2(q#4TCAHky!$^~;Dz^j|8_wuKc*YzfdAht@Q&ror?91Dm!N03=4=O!a)I*0q~p0g$Fm$pmr$ zb;wD;STDIi$@M%y1>p&_>%?UP($15gou_ue1u0!4(%81;qcIW8NyxFEvXpiJ|H4wz z*mFT(qVx1FKufG11hByuX%lPk4t#WZ{>8ka2efjY`~;AL6vWyQKpJun2nRiZYDij$ zP>4jQXPaP$UC$yIVgGa)jDV;F0l^n(V=HMRB5)20V7&r$jmk{UUIe zVjKroK}JAbD>B`2cwNQ&GDLx8{pg`7hbA~grk|W6LgiZ`8y`{Iq0i>t!3p2}MS6S+ zO_ruKyAElt)rdS>CtF7j{&6rP-#c=7evGMt7B6`7HG|-(WL`bDUAjyn+k$mx$CH;q2Dz4x;cPP$hW=`pFfLO)!jaCL@V2+F)So3}vg|%O*^T1j>C2lx zsURO-zIJC$^$g2byVbRIo^w>UxK}74^TqUiRR#7s_X$e)$6iYG1(PcW7un-va-S&u zHk9-6Zn&>T==A)lM^D~bk{&rFzCi35>UR!ZjQkdSiNX*-;l4z9j*7|q`TBl~Au`5& z+c)*8?#-tgUR$Zd%Q3bs96w6k7q@#tUn`5rj+r@_sAVVLqco|6O{ILX&U-&-cbVa3 zY?ngHR@%l{;`ri%H*0EhBWrGjv!LE4db?HEWb5mu*t@{kv|XwK8?npOshmzf=vZA@ zVSN9sL~!sn?r(AK)Q7Jk2(|M67Uy3I{eRy z_l&Y@A>;vjkWN5I2xvFFTLX0i+`{qz7C_@bo`ZUzDugfq4+>a3?1v%)O+YTd6@Ul7 zAfLfm=nhZ`)P~&v90$&UcF+yXm9sq!qCx3^9gzIcO|Y(js^Fj)Rvq>nQAHI92ap=P z10A4@prk+AGWCb`2)dQYFuR$|H6iDE8p}9a?#nV2}LBCoCf(Xi2@szia7#gY>b|l!-U`c}@ zLdhvQjc!BdLJvYvzzzngnw51yRYCqh4}$oRCy-z|v3Hc*d|?^Wj=l~18*E~*cR_kU z{XsxM1i{V*4GujHQ3DBpl2w4FgFR48Nma@HPgnyKoIEY-MqmMeY=I<%oG~l!f<+FN z1ZY^;10j4M4#HYXP zw5eJpA_y(>uLQ~OucgxDLuf}fVs272FaMxhn4xnDGIyLXnw>Xsd^J8XhcWIwIoQ9} z%FoSJTAGW(SRGwJwb=@pY7r$uQRK3Zd~XbxU)ts!4XsJrCycrWSI?e!IqwqIR8+Jh zlRjZ`UO1I!BtJR_2~7AbkbSm%XQqxEPkz6BTGWx8e}nQ=w7bZ|eVP4?*Tb!$(R)iC z9)&%bS*u(lXqzitAN)Oo=&Ytn>%Hzjc<5liuPi>zC_nw;Z0AE3Y$Jao_Q90R-gl~5 z_xAb2J%eArrC1CN4G$}-zVvCqF1;H;abAu6G*+PDHSYFx@Tdbfox*uEd3}BUyYY-l zTfEsOqsi#f9^FoLO;ChK<554qkri&Av~SIM*{fEYRE?vH7pTAOmu2pz3X?Wn*!ROX ztd54huAk&mFBemMooL33RV-*1f0Q3_(7hl$<#*|WF9P!;r;4_+X~k~uKEqdzZ$5Al zV63XN@)j$FN#cCD;ek1R#l zv%pGrhB~KWgoCj%GT?%{@@o(AJGt*PG#l3i>lhmb_twKH^EYvacVY-6bsCl5*^~L0 zonm@lk2UvvTKr2RS%}T>^~EYqdL1q4nD%0n&Xqr^cK^`J5W;lRRB^R-O8b&HENO||mo0xaD+S=I8RTlIfVgqN@SXDr2&-)we--K7w= zJVU8?Z+7k9dy;s;^gDkQa`0nz6N{T?(A&Iz)2!DEecLyRa&FI!id#5Z7B*O2=PsR0 zEvc|8{NS^)!d)MDX(97Xw}m&kEO@5jqRaDZ!+%`wYOI<23q|&js`&o4xvjP7D_xv@ z5hEwpsp{HezI9!~6O{~)lLR@oF7?J7i>1|5a~UuoN=q&6N}EJPV_GD`&M*v8Y`^2j zKII*d_@Fi$+i*YEW+Hbzn{iQk~yP z>7N{S4)r*!NwQ`(qcN#8SRQsNK6>{)X12nbF`*7#ecO7I)Q$uZsV+xS4E7aUn+U(K baj7?x%VD!5Cxk2YbYLNVeiXvvpMCWYo=by@ literal 0 HcmV?d00001 diff --git a/client/build/favicon.png b/client/build/favicon.png new file mode 100644 index 0000000000000000000000000000000000000000..d3bd5ad7f3f974ee7f7bf36faeb26b69b96eea95 GIT binary patch literal 1563 zcmV+$2ITpPP)g-vF%f%=|dCyP#Q03dePN1)o7y-?OU@2|DAKb^FQB=5)o`bVc3-mc!p`$0MrBJVb|y&B8gsw zB2p$IU6MGuEE|Q1`jM#PgRQp$tH|Q0^5d&)asASPOWg5y%D30+~ZLyxUb6U0w)W0I{O2rl3tN zMU8*nY}DI=(YP17DiK3Wf=O;P&w7;mB|8Xo0}HI(JR$)vu;$)gddGL*KWRFo11b$| zVliss8}jusaEr6YFJTw!aXl3>&4 zNc*o~_^pv>M?bd<{q#2EW{r8znT|@HjLlejFM*BmTF^Upqk=agXR6K`r0N&O7#qV0 z6vf+Hi7&cL@4r3P1d0X-6h=y$5#gN71B6VVaDYH;QGc)q5I2Db5QUnx`^F8GzAnm0 zxp2%a9@$9S--y3?Gz4;;Q4ZikvrEru9I127jGDO?aV$48oL2(Vm&BP3W2mbb{!5PCH_Z-@k5=hP->Rjsyq;Vh8?~ks98jcaH-jDPKEGZ6-tU0J>KSrhJ*hgScHgq0D zx_%F-QPR-drKpL^tliCrQTsLYT#8+d_V-|1K8#-DHQNiI3(kd`P_tjRk-$K7d#@sG z`;owf!Lxvtw{1{`8ns^xe;(*-!MJt+0_~`rHK?p-LU#Sl$UonsUq1`Fpk>X$@!F1& zx2CwWPf8wY`c|a70^`OWaOFpCm-jwu(u-lEcNA$o0s$ZNftLXNIj(IKK ziX8tGqq8Aqf1Fmi&l5M1%%wOoqv$_pXz}Z9UqMfuHSNM?Wmh%w$7Y-_e1^(iWZF$i zjmM1!E&Oyd7LYqt&|epQc~u=q)O@{WOM&(Nq5P2{(ESiP-#tKpdrK8|LM3|;l@Wcj z&smg+X>a&}rfkgOq^03-Z-H_1B8tAG`R}3fixaV27EYiXsIb-Xwo?%FS)-7PWBOLK zoDU#*iWT*hI9~Y%@>YfV+&F{YQ4@>xis7mfCr341Qrw}`*l`LvD$zWpsO;tD^NGuF z49Je~RO@fXsQebAy*gwoZPG|piP#HUapnD6=aI(!i2v$f>5(Ki+U!ktNryolRQ)6R z)#HO=4gp8*a8mba$h+}uzB(ecBu#W!0%F^w(C{?{M*9*NJakHm-WN8(q52l8hR^|1eL^B)}UGkHzD(c1t3 N002ovPDHLkV1g2~=xqQ1 literal 0 HcmV?d00001 diff --git a/client/build/index.html b/client/build/index.html new file mode 100644 index 0000000..6c4b9e9 --- /dev/null +++ b/client/build/index.html @@ -0,0 +1 @@ +HackGT Expo
\ No newline at end of file diff --git a/client/build/judging_map.svg b/client/build/judging_map.svg new file mode 100644 index 0000000..7f65edb --- /dev/null +++ b/client/build/judging_map.svg @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/client/build/manifest.json b/client/build/manifest.json new file mode 100644 index 0000000..1f2f141 --- /dev/null +++ b/client/build/manifest.json @@ -0,0 +1,15 @@ +{ + "short_name": "React App", + "name": "Create React App Sample", + "icons": [ + { + "src": "favicon.ico", + "sizes": "64x64 32x32 24x24 16x16", + "type": "image/x-icon" + } + ], + "start_url": ".", + "display": "standalone", + "theme_color": "#000000", + "background_color": "#ffffff" +} diff --git a/client/build/precache-manifest.a528dea505573c9dc803ef7b17d0db34.js b/client/build/precache-manifest.a528dea505573c9dc803ef7b17d0db34.js new file mode 100644 index 0000000..d0d4524 --- /dev/null +++ b/client/build/precache-manifest.a528dea505573c9dc803ef7b17d0db34.js @@ -0,0 +1,22 @@ +self.__precacheManifest = (self.__precacheManifest || []).concat([ + { + "revision": "f54df82ed66fc0d0370dfbf0c84d124d", + "url": "/index.html" + }, + { + "revision": "1e2c449f4829735ca082", + "url": "/static/css/main.498dfaa0.chunk.css" + }, + { + "revision": "ef1c6fbde192e3cacf3b", + "url": "/static/js/2.e657e8ae.chunk.js" + }, + { + "revision": "1e2c449f4829735ca082", + "url": "/static/js/main.6259ef67.chunk.js" + }, + { + "revision": "42ac5946195a7306e2a5", + "url": "/static/js/runtime~main.a8a9905a.js" + } +]); \ No newline at end of file diff --git a/client/build/service-worker.js b/client/build/service-worker.js new file mode 100644 index 0000000..3b06a95 --- /dev/null +++ b/client/build/service-worker.js @@ -0,0 +1,39 @@ +/** + * Welcome to your Workbox-powered service worker! + * + * You'll need to register this file in your web app and you should + * disable HTTP caching for this file too. + * See https://goo.gl/nhQhGp + * + * The rest of the code is auto-generated. Please don't update this file + * directly; instead, make changes to your Workbox build configuration + * and re-run your build process. + * See https://goo.gl/2aRDsh + */ + +importScripts("https://storage.googleapis.com/workbox-cdn/releases/4.3.1/workbox-sw.js"); + +importScripts( + "/precache-manifest.a528dea505573c9dc803ef7b17d0db34.js" +); + +self.addEventListener('message', (event) => { + if (event.data && event.data.type === 'SKIP_WAITING') { + self.skipWaiting(); + } +}); + +workbox.core.clientsClaim(); + +/** + * The workboxSW.precacheAndRoute() method efficiently caches and responds to + * requests for URLs in the manifest. + * See https://goo.gl/S9QRab + */ +self.__precacheManifest = [].concat(self.__precacheManifest || []); +workbox.precaching.precacheAndRoute(self.__precacheManifest, {}); + +workbox.routing.registerNavigationRoute(workbox.precaching.getCacheKeyForURL("/index.html"), { + + blacklist: [/^\/_/,/\/[^/]+\.[^/]+$/], +}); diff --git a/client/build/static/css/main.498dfaa0.chunk.css b/client/build/static/css/main.498dfaa0.chunk.css new file mode 100644 index 0000000..21cf6fd --- /dev/null +++ b/client/build/static/css/main.498dfaa0.chunk.css @@ -0,0 +1,2 @@ +.slider{-webkit-appearance:none;width:100%;height:10px;margin:15px;border-radius:5px;background:#d3d3d3;outline:none;opacity:.7;-webkit-transition:.2s;-webkit-transition:opacity .2s;transition:opacity .2s}.slider::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:25px;height:25px;border-radius:50%;background:#444;cursor:pointer}.slider::-moz-range-thumb{width:25px;height:25px;border-radius:50%;background:#444;cursor:pointer} +/*# sourceMappingURL=main.498dfaa0.chunk.css.map */ \ No newline at end of file diff --git a/client/build/static/css/main.498dfaa0.chunk.css.map b/client/build/static/css/main.498dfaa0.chunk.css.map new file mode 100644 index 0000000..611702d --- /dev/null +++ b/client/build/static/css/main.498dfaa0.chunk.css.map @@ -0,0 +1 @@ +{"version":3,"sources":["PageJudging.css"],"names":[],"mappings":"AAAA,QACE,uBAAwB,CACxB,UAAW,CACX,WAAY,CACZ,WAAY,CACZ,iBAAkB,CAClB,kBAAmB,CACnB,YAAa,CACb,UAAY,CACZ,sBAAuB,CACvB,8BAAuB,CAAvB,sBACF,CAEA,8BACE,uBAAwB,CACxB,eAAgB,CAChB,UAAW,CACX,WAAY,CACZ,iBAAkB,CAClB,eAAmB,CACnB,cACF,CAEA,0BACE,UAAW,CACX,WAAY,CACZ,iBAAkB,CAClB,eAAmB,CACnB,cACF","file":"main.498dfaa0.chunk.css","sourcesContent":[".slider {\r\n -webkit-appearance: none;\r\n width: 100%;\r\n height: 10px;\r\n margin: 15px;\r\n border-radius: 5px;\r\n background: #d3d3d3;\r\n outline: none;\r\n opacity: 0.7;\r\n -webkit-transition: .2s;\r\n transition: opacity .2s;\r\n}\r\n\r\n.slider::-webkit-slider-thumb {\r\n -webkit-appearance: none;\r\n appearance: none;\r\n width: 25px;\r\n height: 25px;\r\n border-radius: 50%;\r\n background: #444444;\r\n cursor: pointer;\r\n}\r\n\r\n.slider::-moz-range-thumb {\r\n width: 25px;\r\n height: 25px;\r\n border-radius: 50%;\r\n background: #444444;\r\n cursor: pointer;\r\n}\r\n"]} \ No newline at end of file diff --git a/client/build/static/js/2.e657e8ae.chunk.js b/client/build/static/js/2.e657e8ae.chunk.js new file mode 100644 index 0000000..b4dead0 --- /dev/null +++ b/client/build/static/js/2.e657e8ae.chunk.js @@ -0,0 +1,2 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[2],[function(e,t,n){"use strict";e.exports=n(136)},function(e,t,n){"use strict";n.d(t,"a",function(){return o});var r=n(10);function o(e){for(var t=1;t=0||(o[n]=e[n]);return o}n.d(t,"a",function(){return r})},function(e,t,n){var r;!function(){"use strict";var n={}.hasOwnProperty;function o(){for(var e=[],t=0;t=0||(o[n]=e[n]);return o}var v=n(49),g=n.n(v),b=n(22),w=n.n(b),x=n(48),C=[],E=[null,null];function k(e,t){var n=e[1];return[t.payload,n+1]}var O=function(){return[null,0]},_="undefined"!==typeof window&&"undefined"!==typeof window.document&&"undefined"!==typeof window.document.createElement?r.useLayoutEffect:r.useEffect;function S(e,t){void 0===t&&(t={});var n=t,i=n.getDisplayName,a=void 0===i?function(e){return"ConnectAdvanced("+e+")"}:i,u=n.methodName,l=void 0===u?"connectAdvanced":u,c=n.renderCountProp,f=void 0===c?void 0:c,d=n.shouldHandleStateChanges,h=void 0===d||d,v=n.storeKey,b=void 0===v?"store":v,S=n.withRef,T=void 0!==S&&S,P=n.forwardRef,N=void 0!==P&&P,R=n.context,j=void 0===R?s:R,A=y(n,["getDisplayName","methodName","renderCountProp","shouldHandleStateChanges","storeKey","withRef","forwardRef","context"]);w()(void 0===f,"renderCountProp is removed. render counting is built into the latest React Dev Tools profiling extension"),w()(!T,"withRef is removed. To access the wrapped instance, use a ref on the connected component");w()("store"===b,"storeKey has been removed and does not do anything. To use a custom Redux store for specific components, create a custom React context with React.createContext(), and pass the context object to React Redux's Provider and specific components like: . You may also pass a {context : MyContext} option to connect");var M=j;return function(t){var n=t.displayName||t.name||"Component",i=a(n),s=m({},A,{getDisplayName:a,methodName:l,renderCountProp:f,shouldHandleStateChanges:h,storeKey:b,displayName:i,wrappedComponentName:n,WrappedComponent:t}),u=A.pure;var c=u?r.useMemo:function(e){return e()};function d(n){var a=Object(r.useMemo)(function(){var e=n.forwardedRef,t=y(n,["forwardedRef"]);return[n.context,e,t]},[n]),u=a[0],l=a[1],f=a[2],d=Object(r.useMemo)(function(){return u&&u.Consumer&&Object(x.isContextConsumer)(o.a.createElement(u.Consumer,null))?u:M},[u,M]),v=Object(r.useContext)(d),g=Boolean(n.store),b=Boolean(v)&&Boolean(v.store);w()(g||b,'Could not find "store" in the context of "'+i+'". Either wrap the root component in a , or pass a custom React context provider to and the corresponding React context consumer to '+i+" in connect options.");var S=n.store||v.store,T=Object(r.useMemo)(function(){return function(t){return e(t.dispatch,s)}(S)},[S]),P=Object(r.useMemo)(function(){if(!h)return E;var e=new p(S,g?null:v.subscription),t=e.notifyNestedSubs.bind(e);return[e,t]},[S,g,v]),N=P[0],R=P[1],j=Object(r.useMemo)(function(){return g?v:m({},v,{subscription:N})},[g,v,N]),A=Object(r.useReducer)(k,C,O),F=A[0][0],D=A[1];if(F&&F.error)throw F.error;var I=Object(r.useRef)(),L=Object(r.useRef)(f),U=Object(r.useRef)(),B=Object(r.useRef)(!1),z=c(function(){return U.current&&f===L.current?U.current:T(S.getState(),f)},[S,F,f]);_(function(){L.current=f,I.current=z,B.current=!1,U.current&&(U.current=null,R())}),_(function(){if(h){var e=!1,t=null,n=function(){if(!e){var n,r,o=S.getState();try{n=T(o,L.current)}catch(i){r=i,t=i}r||(t=null),n===I.current?B.current||R():(I.current=n,U.current=n,B.current=!0,D({type:"STORE_UPDATED",payload:{latestStoreState:o,error:r}}))}};N.onStateChange=n,N.trySubscribe(),n();return function(){if(e=!0,N.tryUnsubscribe(),t)throw t}}},[S,N,T]);var q=Object(r.useMemo)(function(){return o.a.createElement(t,m({},z,{ref:l}))},[l,t,z]);return Object(r.useMemo)(function(){return h?o.a.createElement(d.Provider,{value:j},q):q},[d,q,j])}var v=u?o.a.memo(d):d;if(v.WrappedComponent=t,v.displayName=i,N){var S=o.a.forwardRef(function(e,t){return o.a.createElement(v,m({},e,{forwardedRef:t}))});return S.displayName=i,S.WrappedComponent=t,g()(S,t)}return g()(v,t)}}var T=Object.prototype.hasOwnProperty;function P(e,t){return e===t?0!==e||0!==t||1/e===1/t:e!==e&&t!==t}function N(e,t){if(P(e,t))return!0;if("object"!==typeof e||null===e||"object"!==typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var o=0;o=0;r--){var o=t[r](e);if(o)return o}return function(t,r){throw new Error("Invalid value of type "+typeof e+" for "+n+" argument when connecting component "+r.wrappedComponentName+".")}}function H(e,t){return e===t}var V=function(e){var t=void 0===e?{}:e,n=t.connectHOC,r=void 0===n?S:n,o=t.mapStateToPropsFactories,i=void 0===o?D:o,a=t.mapDispatchToPropsFactories,s=void 0===a?F:a,u=t.mergePropsFactories,l=void 0===u?L:u,c=t.selectorFactory,f=void 0===c?z:c;return function(e,t,n,o){void 0===o&&(o={});var a=o,u=a.pure,c=void 0===u||u,p=a.areStatesEqual,d=void 0===p?H:p,h=a.areOwnPropsEqual,v=void 0===h?N:h,g=a.areStatePropsEqual,b=void 0===g?N:g,w=a.areMergedPropsEqual,x=void 0===w?N:w,C=y(a,["pure","areStatesEqual","areOwnPropsEqual","areStatePropsEqual","areMergedPropsEqual"]),E=q(e,i,"mapStateToProps"),k=q(t,s,"mapDispatchToProps"),O=q(n,l,"mergeProps");return r(f,m({methodName:"connect",getDisplayName:function(e){return"Connect("+e+")"},shouldHandleStateChanges:Boolean(e),initMapStateToProps:E,initMapDispatchToProps:k,initMergeProps:O,pure:c,areStatesEqual:d,areOwnPropsEqual:v,areStatePropsEqual:b,areMergedPropsEqual:x},C))}}();"undefined"!==typeof window?r.useLayoutEffect:r.useEffect;var W,K=n(19);n.d(t,"a",function(){return h}),n.d(t,"b",function(){return V}),W=K.unstable_batchedUpdates,u=W},function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}n.d(t,"a",function(){return r})},function(e,t,n){"use strict";function r(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}n.d(t,"a",function(){return r})},function(e,t,n){"use strict";function r(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],r=!0,o=!1,i=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(u){o=!0,i=u}finally{try{r||null==s.return||s.return()}finally{if(o)throw i}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}n.d(t,"a",function(){return r})},function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}},function(e,t,n){e.exports=n(140)()},function(e,t,n){"use strict";n.d(t,"a",function(){return d});var r=n(2),o=n(4),i=n(5),a=n.n(i),s=n(0),u=n.n(s),l=n(78),c=n.n(l),f=n(6),p=function(e){return e[0].toUpperCase()+c()(e).slice(1)};function d(e,t){var n=void 0===t?{}:t,i=n.displayName,s=void 0===i?p(e):i,l=n.Component,c=void 0===l?"div":l,d=n.defaultProps,h=u.a.forwardRef(function(t,n){var i=t.className,s=t.bsPrefix,l=t.as,p=void 0===l?c:l,d=Object(o.a)(t,["className","bsPrefix","as"]),h=Object(f.b)(s,e);return u.a.createElement(p,Object(r.a)({ref:n,className:a()(i,h)},d))});return h.defaultProps=d,h.displayName=s,h}},,function(e,t){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},function(e,t){e.exports=function(e){return e&&e.__esModule?e:{default:e}}},function(e,t,n){"use strict";!function e(){if("undefined"!==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"===typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}(),e.exports=n(137)},function(e,t,n){"use strict";function r(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}n.d(t,"a",function(){return r})},function(e,t,n){"use strict";var r=n(0),o=n.n(r),i=n(33),a=n.n(i),s=n(14),u=n.n(s),l=n(79),c=n.n(l),f=1073741823;var p=o.a.createContext||function(e,t){var n,o,i="__create-react-context-"+c()()+"__",s=function(e){function n(){var t;return(t=e.apply(this,arguments)||this).emitter=function(e){var t=[];return{on:function(e){t.push(e)},off:function(e){t=t.filter(function(t){return t!==e})},get:function(){return e},set:function(n,r){e=n,t.forEach(function(t){return t(e,r)})}}}(t.props.value),t}a()(n,e);var r=n.prototype;return r.getChildContext=function(){var e;return(e={})[i]=this.emitter,e},r.componentWillReceiveProps=function(e){if(this.props.value!==e.value){var n,r=this.props.value,o=e.value;((i=r)===(a=o)?0!==i||1/i===1/a:i!==i&&a!==a)?n=0:(n="function"===typeof t?t(r,o):f,0!==(n|=0)&&this.emitter.set(e.value,n))}var i,a},r.render=function(){return this.props.children},n}(r.Component);s.childContextTypes=((n={})[i]=u.a.object.isRequired,n);var l=function(t){function n(){var e;return(e=t.apply(this,arguments)||this).state={value:e.getValue()},e.onUpdate=function(t,n){0!==((0|e.observedBits)&n)&&e.setState({value:e.getValue()})},e}a()(n,t);var r=n.prototype;return r.componentWillReceiveProps=function(e){var t=e.observedBits;this.observedBits=void 0===t||null===t?f:t},r.componentDidMount=function(){this.context[i]&&this.context[i].on(this.onUpdate);var e=this.props.observedBits;this.observedBits=void 0===e||null===e?f:e},r.componentWillUnmount=function(){this.context[i]&&this.context[i].off(this.onUpdate)},r.getValue=function(){return this.context[i]?this.context[i].get():e},r.render=function(){return(e=this.props.children,Array.isArray(e)?e[0]:e)(this.state.value);var e},n}(r.Component);return l.contextTypes=((o={})[i]=u.a.object,o),{Provider:s,Consumer:l}},d=n(11),h=n(27),m=n(26),y=n(82),v=n.n(y),g=n(2),b=(n(48),n(4)),w=n(49),x=n.n(w);n.d(t,"a",function(){return P}),n.d(t,"b",function(){return M}),n.d(t,"c",function(){return E}),n.d(t,"d",function(){return B}),n.d(t,"f",function(){return A}),n.d(t,"g",function(){return z}),n.d(t,"e",function(){return C});var C=function(e){var t=p();return t.displayName=e,t}("Router"),E=function(e){function t(t){var n;return(n=e.call(this,t)||this).state={location:t.history.location},n._isMounted=!1,n._pendingLocation=null,t.staticContext||(n.unlisten=t.history.listen(function(e){n._isMounted?n.setState({location:e}):n._pendingLocation=e})),n}Object(d.a)(t,e),t.computeRootMatch=function(e){return{path:"/",url:"/",params:{},isExact:"/"===e}};var n=t.prototype;return n.componentDidMount=function(){this._isMounted=!0,this._pendingLocation&&this.setState({location:this._pendingLocation})},n.componentWillUnmount=function(){this.unlisten&&this.unlisten()},n.render=function(){return o.a.createElement(C.Provider,{children:this.props.children||null,value:{history:this.props.history,location:this.state.location,match:t.computeRootMatch(this.state.location.pathname),staticContext:this.props.staticContext}})},t}(o.a.Component);o.a.Component;var k=function(e){function t(){return e.apply(this,arguments)||this}Object(d.a)(t,e);var n=t.prototype;return n.componentDidMount=function(){this.props.onMount&&this.props.onMount.call(this,this)},n.componentDidUpdate=function(e){this.props.onUpdate&&this.props.onUpdate.call(this,this,e)},n.componentWillUnmount=function(){this.props.onUnmount&&this.props.onUnmount.call(this,this)},n.render=function(){return null},t}(o.a.Component);var O={},_=1e4,S=0;function T(e,t){return void 0===e&&(e="/"),void 0===t&&(t={}),"/"===e?e:function(e){if(O[e])return O[e];var t=v.a.compile(e);return S<_&&(O[e]=t,S++),t}(e)(t,{pretty:!0})}function P(e){var t=e.computedMatch,n=e.to,r=e.push,i=void 0!==r&&r;return o.a.createElement(C.Consumer,null,function(e){e||Object(m.a)(!1);var r=e.history,a=e.staticContext,s=i?r.push:r.replace,u=Object(h.c)(t?"string"===typeof n?T(n,t.params):Object(g.a)({},n,{pathname:T(n.pathname,t.params)}):n);return a?(s(u),null):o.a.createElement(k,{onMount:function(){s(u)},onUpdate:function(e,t){var n=Object(h.c)(t.to);Object(h.f)(n,Object(g.a)({},u,{key:n.key}))||s(u)},to:n})})}var N={},R=1e4,j=0;function A(e,t){void 0===t&&(t={}),"string"===typeof t&&(t={path:t});var n=t,r=n.path,o=n.exact,i=void 0!==o&&o,a=n.strict,s=void 0!==a&&a,u=n.sensitive,l=void 0!==u&&u;return[].concat(r).reduce(function(t,n){if(!n)return null;if(t)return t;var r=function(e,t){var n=""+t.end+t.strict+t.sensitive,r=N[n]||(N[n]={});if(r[e])return r[e];var o=[],i={regexp:v()(e,o,t),keys:o};return j1&&void 0!==arguments[1]?arguments[1]:"",n=e&&e.split("/")||[],r=t&&t.split("/")||[],a=e&&o(e),s=t&&o(t),u=a||s;if(e&&o(e)?r=n:n.length&&(r.pop(),r=r.concat(n)),!r.length)return"/";var l=void 0;if(r.length){var c=r[r.length-1];l="."===c||".."===c||""===c}else l=!1;for(var f=0,p=r.length;p>=0;p--){var d=r[p];"."===d?i(r,p):".."===d?(i(r,p),f++):f&&(i(r,p),f--)}if(!u)for(;f--;f)r.unshift("..");!u||""===r[0]||r[0]&&o(r[0])||r.unshift("");var h=r.join("/");return l&&"/"!==h.substr(-1)&&(h+="/"),h},s="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};var u=function e(t,n){if(t===n)return!0;if(null==t||null==n)return!1;if(Array.isArray(t))return Array.isArray(n)&&t.length===n.length&&t.every(function(t,r){return e(t,n[r])});var r="undefined"===typeof t?"undefined":s(t);if(r!==("undefined"===typeof n?"undefined":s(n)))return!1;if("object"===r){var o=t.valueOf(),i=n.valueOf();if(o!==t||i!==n)return e(o,i);var a=Object.keys(t),u=Object.keys(n);return a.length===u.length&&a.every(function(r){return e(t[r],n[r])})}return!1},l=n(26);function c(e){return"/"===e.charAt(0)?e:"/"+e}function f(e){return"/"===e.charAt(0)?e.substr(1):e}function p(e,t){return function(e,t){return new RegExp("^"+t+"(\\/|\\?|#|$)","i").test(e)}(e,t)?e.substr(t.length):e}function d(e){return"/"===e.charAt(e.length-1)?e.slice(0,-1):e}function h(e){var t=e.pathname,n=e.search,r=e.hash,o=t||"/";return n&&"?"!==n&&(o+="?"===n.charAt(0)?n:"?"+n),r&&"#"!==r&&(o+="#"===r.charAt(0)?r:"#"+r),o}function m(e,t,n,o){var i;"string"===typeof e?(i=function(e){var t=e||"/",n="",r="",o=t.indexOf("#");-1!==o&&(r=t.substr(o),t=t.substr(0,o));var i=t.indexOf("?");return-1!==i&&(n=t.substr(i),t=t.substr(0,i)),{pathname:t,search:"?"===n?"":n,hash:"#"===r?"":r}}(e)).state=t:(void 0===(i=Object(r.a)({},e)).pathname&&(i.pathname=""),i.search?"?"!==i.search.charAt(0)&&(i.search="?"+i.search):i.search="",i.hash?"#"!==i.hash.charAt(0)&&(i.hash="#"+i.hash):i.hash="",void 0!==t&&void 0===i.state&&(i.state=t));try{i.pathname=decodeURI(i.pathname)}catch(s){throw s instanceof URIError?new URIError('Pathname "'+i.pathname+'" could not be decoded. This is likely caused by an invalid percent-encoding.'):s}return n&&(i.key=n),o?i.pathname?"/"!==i.pathname.charAt(0)&&(i.pathname=a(i.pathname,o.pathname)):i.pathname=o.pathname:i.pathname||(i.pathname="/"),i}function y(e,t){return e.pathname===t.pathname&&e.search===t.search&&e.hash===t.hash&&e.key===t.key&&u(e.state,t.state)}function v(){var e=null;var t=[];return{setPrompt:function(t){return e=t,function(){e===t&&(e=null)}},confirmTransitionTo:function(t,n,r,o){if(null!=e){var i="function"===typeof e?e(t,n):e;"string"===typeof i?"function"===typeof r?r(i,o):o(!0):o(!1!==i)}else o(!0)},appendListener:function(e){var n=!0;function r(){n&&e.apply(void 0,arguments)}return t.push(r),function(){n=!1,t=t.filter(function(e){return e!==r})}},notifyListeners:function(){for(var e=arguments.length,n=new Array(e),r=0;r=0?t:0)+"#"+e)}function T(e){void 0===e&&(e={}),g||Object(l.a)(!1);var t=window.history,n=(window.navigator.userAgent.indexOf("Firefox"),e),o=n.getUserConfirmation,i=void 0===o?b:o,a=n.hashType,s=void 0===a?"slash":a,u=e.basename?d(c(e.basename)):"",f=O[s],w=f.encodePath,x=f.decodePath;function C(){var e=x(_());return u&&(e=p(e,u)),m(e)}var E=v();function T(e){Object(r.a)(B,e),B.length=t.length,E.notifyListeners(B.location,B.action)}var P=!1,N=null;function R(){var e=_(),t=w(e);if(e!==t)S(t);else{var n=C(),r=B.location;if(!P&&y(r,n))return;if(N===h(n))return;N=null,function(e){if(P)P=!1,T();else{E.confirmTransitionTo(e,"POP",i,function(t){t?T({action:"POP",location:e}):function(e){var t=B.location,n=F.lastIndexOf(h(t));-1===n&&(n=0);var r=F.lastIndexOf(h(e));-1===r&&(r=0);var o=n-r;o&&(P=!0,D(o))}(e)})}}(n)}}var j=_(),A=w(j);j!==A&&S(A);var M=C(),F=[h(M)];function D(e){t.go(e)}var I=0;function L(e){1===(I+=e)&&1===e?window.addEventListener(k,R):0===I&&window.removeEventListener(k,R)}var U=!1;var B={length:t.length,action:"POP",location:M,createHref:function(e){return"#"+w(u+h(e))},push:function(e,t){var n=m(e,void 0,void 0,B.location);E.confirmTransitionTo(n,"PUSH",i,function(e){if(e){var t=h(n),r=w(u+t);if(_()!==r){N=t,function(e){window.location.hash=e}(r);var o=F.lastIndexOf(h(B.location)),i=F.slice(0,-1===o?0:o+1);i.push(t),F=i,T({action:"PUSH",location:n})}else T()}})},replace:function(e,t){var n=m(e,void 0,void 0,B.location);E.confirmTransitionTo(n,"REPLACE",i,function(e){if(e){var t=h(n),r=w(u+t);_()!==r&&(N=t,S(r));var o=F.indexOf(h(B.location));-1!==o&&(F[o]=t),T({action:"REPLACE",location:n})}})},go:D,goBack:function(){D(-1)},goForward:function(){D(1)},block:function(e){void 0===e&&(e=!1);var t=E.setPrompt(e);return U||(L(1),U=!0),function(){return U&&(U=!1,L(-1)),t()}},listen:function(e){var t=E.appendListener(e);return L(1),function(){L(-1),t()}}};return B}function P(e,t,n){return Math.min(Math.max(e,t),n)}function N(e){void 0===e&&(e={});var t=e,n=t.getUserConfirmation,o=t.initialEntries,i=void 0===o?["/"]:o,a=t.initialIndex,s=void 0===a?0:a,u=t.keyLength,l=void 0===u?6:u,c=v();function f(e){Object(r.a)(w,e),w.length=w.entries.length,c.notifyListeners(w.location,w.action)}function p(){return Math.random().toString(36).substr(2,l)}var d=P(s,0,i.length-1),y=i.map(function(e){return m(e,void 0,"string"===typeof e?p():e.key||p())}),g=h;function b(e){var t=P(w.index+e,0,w.entries.length-1),r=w.entries[t];c.confirmTransitionTo(r,"POP",n,function(e){e?f({action:"POP",location:r,index:t}):f()})}var w={length:y.length,action:"POP",location:y[d],index:d,entries:y,createHref:g,push:function(e,t){var r=m(e,t,p(),w.location);c.confirmTransitionTo(r,"PUSH",n,function(e){if(e){var t=w.index+1,n=w.entries.slice(0);n.length>t?n.splice(t,n.length-t,r):n.push(r),f({action:"PUSH",location:r,index:t,entries:n})}})},replace:function(e,t){var r=m(e,t,p(),w.location);c.confirmTransitionTo(r,"REPLACE",n,function(e){e&&(w.entries[w.index]=r,f({action:"REPLACE",location:r}))})},go:b,goBack:function(){b(-1)},goForward:function(){b(1)},canGo:function(e){var t=w.index+e;return t>=0&&t=0||(o[n]=e[n]);return o}(t,["children"]);if(delete r.in,delete r.mountOnEnter,delete r.unmountOnExit,delete r.appear,delete r.enter,delete r.exit,delete r.timeout,delete r.addEndListener,delete r.onEnter,delete r.onEntering,delete r.onEntered,delete r.onExit,delete r.onExiting,delete r.onExited,"function"===typeof n)return o.a.createElement(u.Provider,{value:null},n(e,r));var i=o.a.Children.only(n);return o.a.createElement(u.Provider,{value:null},o.a.cloneElement(i,r))},r}(o.a.Component);function m(){}h.contextType=u,h.propTypes={},h.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:m,onEntering:m,onEntered:m,onExit:m,onExiting:m,onExited:m},h.UNMOUNTED=0,h.EXITED=1,h.ENTERING=2,h.ENTERED=3,h.EXITING=4;t.e=h},function(e,t,n){"use strict";var r=n(18);t.__esModule=!0,t.default=function(e,t,n){var r="",c="",f=t;if("string"===typeof t){if(void 0===n)return e.style[(0,o.default)(t)]||(0,a.default)(e).getPropertyValue((0,i.default)(t));(f={})[t]=n}Object.keys(f).forEach(function(t){var n=f[t];n||0===n?(0,l.default)(t)?c+=t+"("+n+") ":r+=(0,i.default)(t)+": "+n+";":(0,s.default)(e,(0,i.default)(t))}),c&&(r+=u.transform+": "+c+";");e.style.cssText+=";"+r};var o=r(n(97)),i=r(n(168)),a=r(n(170)),s=r(n(171)),u=n(98),l=r(n(172));e.exports=t.default},function(e,t){e.exports=function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}},function(e,t){function n(){return e.exports=n=Object.assign||function(e){for(var t=1;t1?{type:d[o],data:e.substring(1)}:{type:d[o]}:h}o=new Uint8Array(e)[0];var i=a(e,1);return m&&"blob"===n&&(i=new m([i])),{type:d[o],data:i}},t.decodeBase64Packet=function(e,t){var n=d[e.charAt(0)];if(!r)return{type:n,data:{base64:!0,data:e.substr(1)}};var o=r.decode(e.substr(1));return"blob"===t&&m&&(o=new m([o])),{type:n,data:o}},t.encodePayload=function(e,n,r){"function"===typeof n&&(r=n,n=null);var o=i(e);if(n&&o)return m&&!f?t.encodePayloadAsBlob(e,r):t.encodePayloadAsArrayBuffer(e,r);if(!e.length)return r("0:");y(e,function(e,r){t.encodePacket(e,!!o&&n,!1,function(e){r(null,function(e){return e.length+":"+e}(e))})},function(e,t){return r(t.join(""))})},t.decodePayload=function(e,n,r){if("string"!==typeof e)return t.decodePayloadAsBinary(e,n,r);var o;if("function"===typeof n&&(r=n,n=null),""===e)return r(h,0,1);for(var i,a,s="",u=0,l=e.length;u0;){for(var s=new Uint8Array(o),u=0===s[0],l="",c=1;255!==s[c];c++){if(l.length>310)return r(h,0,1);l+=s[c]}o=a(o,2+l.length),l=parseInt(l);var f=a(o,0,l);if(u)try{f=String.fromCharCode.apply(null,new Uint8Array(f))}catch(m){var p=new Uint8Array(f);f="";for(c=0;c1?t-1:0),r=1;r=0||(o[n]=e[n]);return o}var i=n(0),a=n.n(i),s=n(22),u=n.n(s),l=function(){};function c(e,t){return void 0!==e[t]}function f(e){return"default"+e.charAt(0).toUpperCase()+e.substr(1)}t.a=function e(t,n,i){void 0===i&&(i=[]);var s,p=t.displayName||t.name||"Component",d=!!(s=t)&&("function"!==typeof s||s.prototype&&s.prototype.isReactComponent),h=Object.keys(n),m=h.map(f);!d&&i.length&&u()(!1);var y=function(e){var s,u;function l(){for(var t,r=arguments.length,o=new Array(r),a=0;a1?i-1:0),s=1;s1)for(var n=1;n=31||"undefined"!==typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage="undefined"!=typeof chrome&&"undefined"!=typeof chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.formatters.j=function(e){try{return JSON.stringify(e)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}},t.enable(o())}).call(this,n(50))},function(e,t){t.encode=function(e){var t="";for(var n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t},t.decode=function(e){for(var t={},n=e.split("&"),r=0,o=n.length;r=31||"undefined"!==typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage="undefined"!=typeof chrome&&"undefined"!=typeof chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.formatters.j=function(e){try{return JSON.stringify(e)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}},t.enable(o())}).call(this,n(50))},function(e,t,n){"use strict";var r=function(){};e.exports=r},function(e,t,n){"use strict";var r=n(0),o=n.n(r);t.a=o.a.createContext(null)},function(e,t,n){"use strict";var r=n(0),o=n.n(r).a.createContext(null);t.a=o},function(e,t,n){"use strict";var r=n(2),o=n(4),i=n(5),a=n.n(i),s=n(0),u=n.n(s),l=n(36),c=n.n(l),f=n(58),p=n(23),d=u.a.forwardRef(function(e,t){var n=e.active,i=e.className,l=e.tabIndex,d=e.eventKey,h=e.onSelect,m=e.onClick,y=e.as,v=Object(o.a)(e,["active","className","tabIndex","eventKey","onSelect","onClick","as"]),g=Object(p.b)(d,v.href),b=Object(s.useContext)(p.a),w=Object(s.useContext)(f.a),x=n;w&&(v.role||"tablist"!==w.role||(v.role="tab"),v["data-rb-event-key"]=g,v.id=w.getControllerId(g),v["aria-controls"]=w.getControlledId(g),x=null==n&&null!=g?w.activeKey===g:n),"tab"===v.role&&(v.tabIndex=x?l:-1,v["aria-selected"]=x);var C=c()(function(e){m&&m(e),null!=g&&(h&&h(g,e),b&&b(g,e))});return u.a.createElement(y,Object(r.a)({},v,{ref:t,onClick:C,className:a()(i,x&&"active")}))});d.defaultProps={disabled:!1},t.a=d},function(e,t,n){"use strict";var r,o=n(2),i=n(4),a=n(11),s=n(5),u=n.n(s),l=n(32),c=n.n(l),f=n(0),p=n.n(f),d=n(61),h=n.n(d),m=n(31),y=n(62),v=n(30),g={height:["marginTop","marginBottom"],width:["marginLeft","marginRight"]};var b=((r={})[m.c]="collapse",r[m.d]="collapsing",r[m.b]="collapsing",r[m.a]="collapse show",r),w={in:!1,timeout:300,mountOnEnter:!1,unmountOnExit:!1,appear:!1,dimension:"height",getDimensionValue:function(e,t){var n=t["offset"+e[0].toUpperCase()+e.slice(1)],r=g[e];return n+parseInt(c()(t,r[0]),10)+parseInt(c()(t,r[1]),10)}},x=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),o=0;o=t.length&&(o=0),o<0&&(o=t.length-1),t[o]},n.render=function(){var e=this.props,t=e.as,n=void 0===t?"ul":t,i=(e.onSelect,e.parentOnSelect,e.getControlledId,e.getControllerId,e.activeKey,Object(o.a)(e,["as","onSelect","parentOnSelect","getControlledId","getControllerId","activeKey"]));return"tablist"===i.role&&(i.onKeyDown=this.handleKeyDown),s.a.createElement(p.a.Provider,{value:this.handleSelect},s.a.createElement(d.a.Provider,{value:this.state.navContext},s.a.createElement(n,Object(r.a)({},i,{onKeyDown:this.handleKeyDown,ref:this.attachRef}))))},t}(s.a.Component);t.a=f()([p.a,h],function(e,t,n){var r=n.role;return t?{activeKey:t.activeKey,parentOnSelect:e,role:r||"tablist",getControllerId:t.getControllerId,getControlledId:t.getControlledId}:{parentOnSelect:e}},y)},function(e,t,n){"use strict";var r=n(18);t.__esModule=!0,t.default=void 0;var o=r(n(99));t.on=o.default;var i=r(n(100));t.off=i.default;var a=r(n(176));t.filter=a.default;var s=r(n(71));t.listen=s.default;var u={on:o.default,off:i.default,filter:a.default,listen:s.default};t.default=u},,function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){function t(t,n,r,o,i,a){var s=o||"<>",u=a||r;if(null==n[r])return t?new Error("Required "+i+" `"+u+"` was not specified in `"+s+"`."):null;for(var l=arguments.length,c=Array(l>6?l-6:0),f=6;f=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|e}function h(e,t){if(u.isBuffer(e))return e.length;if("undefined"!==typeof ArrayBuffer&&"function"===typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!==typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return B(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return z(e).length;default:if(r)return B(e).length;t=(""+t).toLowerCase(),r=!0}}function m(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function y(e,t,n,r,o){if(0===e.length)return-1;if("string"===typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=o?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(o)return-1;n=e.length-1}else if(n<0){if(!o)return-1;n=0}if("string"===typeof t&&(t=u.from(t,r)),u.isBuffer(t))return 0===t.length?-1:v(e,t,n,r,o);if("number"===typeof t)return t&=255,u.TYPED_ARRAY_SUPPORT&&"function"===typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):v(e,[t],n,r,o);throw new TypeError("val must be string, number or Buffer")}function v(e,t,n,r,o){var i,a=1,s=e.length,u=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,n/=2}function l(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(o){var c=-1;for(i=n;is&&(n=s-u),i=n;i>=0;i--){for(var f=!0,p=0;po&&(r=o):r=o;var i=t.length;if(i%2!==0)throw new TypeError("Invalid hex string");r>i/2&&(r=i/2);for(var a=0;a>8,o=n%256,i.push(o),i.push(r);return i}(t,e.length-n),e,n,r)}function k(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function O(e,t,n){n=Math.min(e.length,n);for(var r=[],o=t;o239?4:l>223?3:l>191?2:1;if(o+f<=n)switch(f){case 1:l<128&&(c=l);break;case 2:128===(192&(i=e[o+1]))&&(u=(31&l)<<6|63&i)>127&&(c=u);break;case 3:i=e[o+1],a=e[o+2],128===(192&i)&&128===(192&a)&&(u=(15&l)<<12|(63&i)<<6|63&a)>2047&&(u<55296||u>57343)&&(c=u);break;case 4:i=e[o+1],a=e[o+2],s=e[o+3],128===(192&i)&&128===(192&a)&&128===(192&s)&&(u=(15&l)<<18|(63&i)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(c=u)}null===c?(c=65533,f=1):c>65535&&(c-=65536,r.push(c>>>10&1023|55296),c=56320|1023&c),r.push(c),o+=f}return function(e){var t=e.length;if(t<=_)return String.fromCharCode.apply(String,e);var n="",r=0;for(;rthis.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return P(this,t,n);case"utf8":case"utf-8":return O(this,t,n);case"ascii":return S(this,t,n);case"latin1":case"binary":return T(this,t,n);case"base64":return k(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return N(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}.apply(this,arguments)},u.prototype.equals=function(e){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===u.compare(this,e)},u.prototype.inspect=function(){var e="",n=t.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(e+=" ... ")),""},u.prototype.compare=function(e,t,n,r,o){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===o&&(o=this.length),t<0||n>e.length||r<0||o>this.length)throw new RangeError("out of range index");if(r>=o&&t>=n)return 0;if(r>=o)return-1;if(t>=n)return 1;if(this===e)return 0;for(var i=(o>>>=0)-(r>>>=0),a=(n>>>=0)-(t>>>=0),s=Math.min(i,a),l=this.slice(r,o),c=e.slice(t,n),f=0;fo)&&(n=o),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var i=!1;;)switch(r){case"hex":return g(this,e,t,n);case"utf8":case"utf-8":return b(this,e,t,n);case"ascii":return w(this,e,t,n);case"latin1":case"binary":return x(this,e,t,n);case"base64":return C(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,e,t,n);default:if(i)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),i=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var _=4096;function S(e,t,n){var r="";n=Math.min(e.length,n);for(var o=t;or)&&(n=r);for(var o="",i=t;in)throw new RangeError("Trying to access beyond buffer length")}function j(e,t,n,r,o,i){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||te.length)throw new RangeError("Index out of range")}function A(e,t,n,r){t<0&&(t=65535+t+1);for(var o=0,i=Math.min(e.length-n,2);o>>8*(r?o:1-o)}function M(e,t,n,r){t<0&&(t=4294967295+t+1);for(var o=0,i=Math.min(e.length-n,4);o>>8*(r?o:3-o)&255}function F(e,t,n,r,o,i){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function D(e,t,n,r,i){return i||F(e,0,n,4),o.write(e,t,n,r,23,4),n+4}function I(e,t,n,r,i){return i||F(e,0,n,8),o.write(e,t,n,r,52,8),n+8}u.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t0&&(o*=256);)r+=this[e+--t]*o;return r},u.prototype.readUInt8=function(e,t){return t||R(e,1,this.length),this[e]},u.prototype.readUInt16LE=function(e,t){return t||R(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUInt16BE=function(e,t){return t||R(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUInt32LE=function(e,t){return t||R(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUInt32BE=function(e,t){return t||R(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||R(e,t,this.length);for(var r=this[e],o=1,i=0;++i=(o*=128)&&(r-=Math.pow(2,8*t)),r},u.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||R(e,t,this.length);for(var r=t,o=1,i=this[e+--r];r>0&&(o*=256);)i+=this[e+--r]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*t)),i},u.prototype.readInt8=function(e,t){return t||R(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){t||R(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt16BE=function(e,t){t||R(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt32LE=function(e,t){return t||R(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return t||R(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readFloatLE=function(e,t){return t||R(e,4,this.length),o.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return t||R(e,4,this.length),o.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return t||R(e,8,this.length),o.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return t||R(e,8,this.length),o.read(this,e,!1,52,8)},u.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||j(this,e,t,n,Math.pow(2,8*n)-1,0);var o=1,i=0;for(this[t]=255&e;++i=0&&(i*=256);)this[t+o]=e/i&255;return t+n},u.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||j(this,e,t,1,255,0),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},u.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||j(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):A(this,e,t,!0),t+2},u.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||j(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):A(this,e,t,!1),t+2},u.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||j(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):M(this,e,t,!0),t+4},u.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||j(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):M(this,e,t,!1),t+4},u.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var o=Math.pow(2,8*n-1);j(this,e,t,n,o-1,-o)}var i=0,a=1,s=0;for(this[t]=255&e;++i>0)-s&255;return t+n},u.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var o=Math.pow(2,8*n-1);j(this,e,t,n,o-1,-o)}var i=n-1,a=1,s=0;for(this[t+i]=255&e;--i>=0&&(a*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/a>>0)-s&255;return t+n},u.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||j(this,e,t,1,127,-128),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||j(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):A(this,e,t,!0),t+2},u.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||j(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):A(this,e,t,!1),t+2},u.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||j(this,e,t,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):M(this,e,t,!0),t+4},u.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||j(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):M(this,e,t,!1),t+4},u.prototype.writeFloatLE=function(e,t,n){return D(this,e,t,!0,n)},u.prototype.writeFloatBE=function(e,t,n){return D(this,e,t,!1,n)},u.prototype.writeDoubleLE=function(e,t,n){return I(this,e,t,!0,n)},u.prototype.writeDoubleBE=function(e,t,n){return I(this,e,t,!1,n)},u.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t=0;--o)e[o+t]=this[o+n];else if(i<1e3||!u.TYPED_ARRAY_SUPPORT)for(o=0;o>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"===typeof e)for(i=t;i55295&&n<57344){if(!o){if(n>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&i.push(239,191,189);continue}o=n;continue}if(n<56320){(t-=3)>-1&&i.push(239,191,189),o=n;continue}n=65536+(o-55296<<10|n-56320)}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,n<128){if((t-=1)<0)break;i.push(n)}else if(n<2048){if((t-=2)<0)break;i.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;i.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return i}function z(e){return r.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(L,"")).length<2)return"";for(;e.length%4!==0;)e+="=";return e}(e))}function q(e,t,n,r){for(var o=0;o=t.length||o>=e.length);++o)t[o+n]=e[o];return o}}).call(this,n(40))},function(e,t,n){var r=n(207);e.exports=function(e){var t=e.xdomain,n=e.xscheme,o=e.enablesXDR;try{if("undefined"!==typeof XMLHttpRequest&&(!t||r))return new XMLHttpRequest}catch(i){}try{if("undefined"!==typeof XDomainRequest&&!n&&o)return new XDomainRequest}catch(i){}if(!t)try{return new(self[["Active"].concat("Object").join("X")])("Microsoft.XMLHTTP")}catch(i){}}},function(e,t,n){var r=n(41),o=n(76);function i(e){this.path=e.path,this.hostname=e.hostname,this.port=e.port,this.secure=e.secure,this.query=e.query,this.timestampParam=e.timestampParam,this.timestampRequests=e.timestampRequests,this.readyState="",this.agent=e.agent||!1,this.socket=e.socket,this.enablesXDR=e.enablesXDR,this.pfx=e.pfx,this.key=e.key,this.passphrase=e.passphrase,this.cert=e.cert,this.ca=e.ca,this.ciphers=e.ciphers,this.rejectUnauthorized=e.rejectUnauthorized,this.forceNode=e.forceNode,this.isReactNative=e.isReactNative,this.extraHeaders=e.extraHeaders,this.localAddress=e.localAddress}e.exports=i,o(i.prototype),i.prototype.onError=function(e,t){var n=new Error(e);return n.type="TransportError",n.description=t,this.emit("error",n),this},i.prototype.open=function(){return"closed"!==this.readyState&&""!==this.readyState||(this.readyState="opening",this.doOpen()),this},i.prototype.close=function(){return"opening"!==this.readyState&&"open"!==this.readyState||(this.doClose(),this.onClose()),this},i.prototype.send=function(e){if("open"!==this.readyState)throw new Error("Transport not open");this.write(e)},i.prototype.onOpen=function(){this.readyState="open",this.writable=!0,this.emit("open")},i.prototype.onData=function(e){var t=r.decodePacket(e,this.socket.binaryType);this.onPacket(t)},i.prototype.onPacket=function(e){this.emit("packet",e)},i.prototype.onClose=function(){this.readyState="closed",this.emit("close")}},function(e,t,n){function r(e){if(e)return function(e){for(var t in r.prototype)e[t]=r.prototype[t];return e}(e)}e.exports=r,r.prototype.on=r.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},r.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},r.prototype.off=r.prototype.removeListener=r.prototype.removeAllListeners=r.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n,r=this._callbacks["$"+e];if(!r)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var o=0;o=0){o=1;break}var a=n&&window.Promise?function(e){var t=!1;return function(){t||(t=!0,window.Promise.resolve().then(function(){t=!1,e()}))}}:function(e){var t=!1;return function(){t||(t=!0,setTimeout(function(){t=!1,e()},o))}};function s(e){return e&&"[object Function]"==={}.toString.call(e)}function u(e,t){if(1!==e.nodeType)return[];var n=e.ownerDocument.defaultView.getComputedStyle(e,null);return t?n[t]:n}function l(e){return"HTML"===e.nodeName?e:e.parentNode||e.host}function c(e){if(!e)return document.body;switch(e.nodeName){case"HTML":case"BODY":return e.ownerDocument.body;case"#document":return e.body}var t=u(e),n=t.overflow,r=t.overflowX,o=t.overflowY;return/(auto|scroll|overlay)/.test(n+o+r)?e:c(l(e))}var f=n&&!(!window.MSInputMethodContext||!document.documentMode),p=n&&/MSIE 10/.test(navigator.userAgent);function d(e){return 11===e?f:10===e?p:f||p}function h(e){if(!e)return document.documentElement;for(var t=d(10)?document.body:null,n=e.offsetParent||null;n===t&&e.nextElementSibling;)n=(e=e.nextElementSibling).offsetParent;var r=n&&n.nodeName;return r&&"BODY"!==r&&"HTML"!==r?-1!==["TH","TD","TABLE"].indexOf(n.nodeName)&&"static"===u(n,"position")?h(n):n:e?e.ownerDocument.documentElement:document.documentElement}function m(e){return null!==e.parentNode?m(e.parentNode):e}function y(e,t){if(!e||!e.nodeType||!t||!t.nodeType)return document.documentElement;var n=e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING,r=n?e:t,o=n?t:e,i=document.createRange();i.setStart(r,0),i.setEnd(o,0);var a=i.commonAncestorContainer;if(e!==a&&t!==a||r.contains(o))return function(e){var t=e.nodeName;return"BODY"!==t&&("HTML"===t||h(e.firstElementChild)===e)}(a)?a:h(a);var s=m(e);return s.host?y(s.host,t):y(e,m(t).host)}function v(e){var t="top"===(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"top")?"scrollTop":"scrollLeft",n=e.nodeName;if("BODY"===n||"HTML"===n){var r=e.ownerDocument.documentElement;return(e.ownerDocument.scrollingElement||r)[t]}return e[t]}function g(e,t){var n="x"===t?"Left":"Top",r="Left"===n?"Right":"Bottom";return parseFloat(e["border"+n+"Width"],10)+parseFloat(e["border"+r+"Width"],10)}function b(e,t,n,r){return Math.max(t["offset"+e],t["scroll"+e],n["client"+e],n["offset"+e],n["scroll"+e],d(10)?parseInt(n["offset"+e])+parseInt(r["margin"+("Height"===e?"Top":"Left")])+parseInt(r["margin"+("Height"===e?"Bottom":"Right")]):0)}function w(e){var t=e.body,n=e.documentElement,r=d(10)&&getComputedStyle(n);return{height:b("Height",t,n,r),width:b("Width",t,n,r)}}var x=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},C=function(){function e(e,t){for(var n=0;n2&&void 0!==arguments[2]&&arguments[2],r=d(10),o="HTML"===t.nodeName,i=_(e),a=_(t),s=c(e),l=u(t),f=parseFloat(l.borderTopWidth,10),p=parseFloat(l.borderLeftWidth,10);n&&o&&(a.top=Math.max(a.top,0),a.left=Math.max(a.left,0));var h=O({top:i.top-a.top-f,left:i.left-a.left-p,width:i.width,height:i.height});if(h.marginTop=0,h.marginLeft=0,!r&&o){var m=parseFloat(l.marginTop,10),y=parseFloat(l.marginLeft,10);h.top-=f-m,h.bottom-=f-m,h.left-=p-y,h.right-=p-y,h.marginTop=m,h.marginLeft=y}return(r&&!n?t.contains(s):t===s&&"BODY"!==s.nodeName)&&(h=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=v(t,"top"),o=v(t,"left"),i=n?-1:1;return e.top+=r*i,e.bottom+=r*i,e.left+=o*i,e.right+=o*i,e}(h,t)),h}function T(e){if(!e||!e.parentElement||d())return document.documentElement;for(var t=e.parentElement;t&&"none"===u(t,"transform");)t=t.parentElement;return t||document.documentElement}function P(e,t,n,r){var o=arguments.length>4&&void 0!==arguments[4]&&arguments[4],i={top:0,left:0},a=o?T(e):y(e,t);if("viewport"===r)i=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e.ownerDocument.documentElement,r=S(e,n),o=Math.max(n.clientWidth,window.innerWidth||0),i=Math.max(n.clientHeight,window.innerHeight||0),a=t?0:v(n),s=t?0:v(n,"left");return O({top:a-r.top+r.marginTop,left:s-r.left+r.marginLeft,width:o,height:i})}(a,o);else{var s=void 0;"scrollParent"===r?"BODY"===(s=c(l(t))).nodeName&&(s=e.ownerDocument.documentElement):s="window"===r?e.ownerDocument.documentElement:r;var f=S(s,a,o);if("HTML"!==s.nodeName||function e(t){var n=t.nodeName;if("BODY"===n||"HTML"===n)return!1;if("fixed"===u(t,"position"))return!0;var r=l(t);return!!r&&e(r)}(a))i=f;else{var p=w(e.ownerDocument),d=p.height,h=p.width;i.top+=f.top-f.marginTop,i.bottom=d+f.top,i.left+=f.left-f.marginLeft,i.right=h+f.left}}var m="number"===typeof(n=n||0);return i.left+=m?n:n.left||0,i.top+=m?n:n.top||0,i.right-=m?n:n.right||0,i.bottom-=m?n:n.bottom||0,i}function N(e,t,n,r,o){var i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;if(-1===e.indexOf("auto"))return e;var a=P(n,r,i,o),s={top:{width:a.width,height:t.top-a.top},right:{width:a.right-t.right,height:a.height},bottom:{width:a.width,height:a.bottom-t.bottom},left:{width:t.left-a.left,height:a.height}},u=Object.keys(s).map(function(e){return k({key:e},s[e],{area:(t=s[e],t.width*t.height)});var t}).sort(function(e,t){return t.area-e.area}),l=u.filter(function(e){var t=e.width,r=e.height;return t>=n.clientWidth&&r>=n.clientHeight}),c=l.length>0?l[0].key:u[0].key,f=e.split("-")[1];return c+(f?"-"+f:"")}function R(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return S(n,r?T(t):y(t,n),r)}function j(e){var t=e.ownerDocument.defaultView.getComputedStyle(e),n=parseFloat(t.marginTop||0)+parseFloat(t.marginBottom||0),r=parseFloat(t.marginLeft||0)+parseFloat(t.marginRight||0);return{width:e.offsetWidth+r,height:e.offsetHeight+n}}function A(e){var t={left:"right",right:"left",bottom:"top",top:"bottom"};return e.replace(/left|right|bottom|top/g,function(e){return t[e]})}function M(e,t,n){n=n.split("-")[0];var r=j(e),o={width:r.width,height:r.height},i=-1!==["right","left"].indexOf(n),a=i?"top":"left",s=i?"left":"top",u=i?"height":"width",l=i?"width":"height";return o[a]=t[a]+t[u]/2-r[u]/2,o[s]=n===s?t[s]-r[l]:t[A(s)],o}function F(e,t){return Array.prototype.find?e.find(t):e.filter(t)[0]}function D(e,t,n){return(void 0===n?e:e.slice(0,function(e,t,n){if(Array.prototype.findIndex)return e.findIndex(function(e){return e[t]===n});var r=F(e,function(e){return e[t]===n});return e.indexOf(r)}(e,"name",n))).forEach(function(e){e.function&&console.warn("`modifier.function` is deprecated, use `modifier.fn`!");var n=e.function||e.fn;e.enabled&&s(n)&&(t.offsets.popper=O(t.offsets.popper),t.offsets.reference=O(t.offsets.reference),t=n(t,e))}),t}function I(e,t){return e.some(function(e){var n=e.name;return e.enabled&&n===t})}function L(e){for(var t=[!1,"ms","Webkit","Moz","O"],n=e.charAt(0).toUpperCase()+e.slice(1),r=0;r1&&void 0!==arguments[1]&&arguments[1],n=$.indexOf(e),r=$.slice(n+1).concat($.slice(0,n));return t?r.reverse():r}var X={FLIP:"flip",CLOCKWISE:"clockwise",COUNTERCLOCKWISE:"counterclockwise"};function G(e,t,n,r){var o=[0,0],i=-1!==["right","left"].indexOf(r),a=e.split(/(\+|\-)/).map(function(e){return e.trim()}),s=a.indexOf(F(a,function(e){return-1!==e.search(/,|\s/)}));a[s]&&-1===a[s].indexOf(",")&&console.warn("Offsets separated by white space(s) are deprecated, use a comma (,) instead.");var u=/\s*,\s*|\s+/,l=-1!==s?[a.slice(0,s).concat([a[s].split(u)[0]]),[a[s].split(u)[1]].concat(a.slice(s+1))]:[a];return(l=l.map(function(e,r){var o=(1===r?!i:i)?"height":"width",a=!1;return e.reduce(function(e,t){return""===e[e.length-1]&&-1!==["+","-"].indexOf(t)?(e[e.length-1]=t,a=!0,e):a?(e[e.length-1]+=t,a=!1,e):e.concat(t)},[]).map(function(e){return function(e,t,n,r){var o=e.match(/((?:\-|\+)?\d*\.?\d*)(.*)/),i=+o[1],a=o[2];if(!i)return e;if(0===a.indexOf("%")){var s=void 0;switch(a){case"%p":s=n;break;case"%":case"%r":default:s=r}return O(s)[t]/100*i}if("vh"===a||"vw"===a)return("vh"===a?Math.max(document.documentElement.clientHeight,window.innerHeight||0):Math.max(document.documentElement.clientWidth,window.innerWidth||0))/100*i;return i}(e,o,t,n)})})).forEach(function(e,t){e.forEach(function(n,r){q(n)&&(o[t]+=n*("-"===e[r-1]?-1:1))})}),o}var Q={placement:"bottom",positionFixed:!1,eventsEnabled:!0,removeOnDestroy:!1,onCreate:function(){},onUpdate:function(){},modifiers:{shift:{order:100,enabled:!0,fn:function(e){var t=e.placement,n=t.split("-")[0],r=t.split("-")[1];if(r){var o=e.offsets,i=o.reference,a=o.popper,s=-1!==["bottom","top"].indexOf(n),u=s?"left":"top",l=s?"width":"height",c={start:E({},u,i[u]),end:E({},u,i[u]+i[l]-a[l])};e.offsets.popper=k({},a,c[r])}return e}},offset:{order:200,enabled:!0,fn:function(e,t){var n=t.offset,r=e.placement,o=e.offsets,i=o.popper,a=o.reference,s=r.split("-")[0],u=void 0;return u=q(+n)?[+n,0]:G(n,i,a,s),"left"===s?(i.top+=u[0],i.left-=u[1]):"right"===s?(i.top+=u[0],i.left+=u[1]):"top"===s?(i.left+=u[0],i.top-=u[1]):"bottom"===s&&(i.left+=u[0],i.top+=u[1]),e.popper=i,e},offset:0},preventOverflow:{order:300,enabled:!0,fn:function(e,t){var n=t.boundariesElement||h(e.instance.popper);e.instance.reference===n&&(n=h(n));var r=L("transform"),o=e.instance.popper.style,i=o.top,a=o.left,s=o[r];o.top="",o.left="",o[r]="";var u=P(e.instance.popper,e.instance.reference,t.padding,n,e.positionFixed);o.top=i,o.left=a,o[r]=s,t.boundaries=u;var l=t.priority,c=e.offsets.popper,f={primary:function(e){var n=c[e];return c[e]u[e]&&!t.escapeWithReference&&(r=Math.min(c[n],u[e]-("right"===e?c.width:c.height))),E({},n,r)}};return l.forEach(function(e){var t=-1!==["left","top"].indexOf(e)?"primary":"secondary";c=k({},c,f[t](e))}),e.offsets.popper=c,e},priority:["left","right","top","bottom"],padding:5,boundariesElement:"scrollParent"},keepTogether:{order:400,enabled:!0,fn:function(e){var t=e.offsets,n=t.popper,r=t.reference,o=e.placement.split("-")[0],i=Math.floor,a=-1!==["top","bottom"].indexOf(o),s=a?"right":"bottom",u=a?"left":"top",l=a?"width":"height";return n[s]i(r[s])&&(e.offsets.popper[u]=i(r[s])),e}},arrow:{order:500,enabled:!0,fn:function(e,t){var n;if(!W(e.instance.modifiers,"arrow","keepTogether"))return e;var r=t.element;if("string"===typeof r){if(!(r=e.instance.popper.querySelector(r)))return e}else if(!e.instance.popper.contains(r))return console.warn("WARNING: `arrow.element` must be child of its popper element!"),e;var o=e.placement.split("-")[0],i=e.offsets,a=i.popper,s=i.reference,l=-1!==["left","right"].indexOf(o),c=l?"height":"width",f=l?"Top":"Left",p=f.toLowerCase(),d=l?"left":"top",h=l?"bottom":"right",m=j(r)[c];s[h]-ma[h]&&(e.offsets.popper[p]+=s[p]+m-a[h]),e.offsets.popper=O(e.offsets.popper);var y=s[p]+s[c]/2-m/2,v=u(e.instance.popper),g=parseFloat(v["margin"+f],10),b=parseFloat(v["border"+f+"Width"],10),w=y-e.offsets.popper[p]-g-b;return w=Math.max(Math.min(a[c]-m,w),0),e.arrowElement=r,e.offsets.arrow=(E(n={},p,Math.round(w)),E(n,d,""),n),e},element:"[x-arrow]"},flip:{order:600,enabled:!0,fn:function(e,t){if(I(e.instance.modifiers,"inner"))return e;if(e.flipped&&e.placement===e.originalPlacement)return e;var n=P(e.instance.popper,e.instance.reference,t.padding,t.boundariesElement,e.positionFixed),r=e.placement.split("-")[0],o=A(r),i=e.placement.split("-")[1]||"",a=[];switch(t.behavior){case X.FLIP:a=[r,o];break;case X.CLOCKWISE:a=Y(r);break;case X.COUNTERCLOCKWISE:a=Y(r,!0);break;default:a=t.behavior}return a.forEach(function(s,u){if(r!==s||a.length===u+1)return e;r=e.placement.split("-")[0],o=A(r);var l=e.offsets.popper,c=e.offsets.reference,f=Math.floor,p="left"===r&&f(l.right)>f(c.left)||"right"===r&&f(l.left)f(c.top)||"bottom"===r&&f(l.top)f(n.right),m=f(l.top)f(n.bottom),v="left"===r&&d||"right"===r&&h||"top"===r&&m||"bottom"===r&&y,g=-1!==["top","bottom"].indexOf(r),b=!!t.flipVariations&&(g&&"start"===i&&d||g&&"end"===i&&h||!g&&"start"===i&&m||!g&&"end"===i&&y),w=!!t.flipVariationsByContent&&(g&&"start"===i&&h||g&&"end"===i&&d||!g&&"start"===i&&y||!g&&"end"===i&&m),x=b||w;(p||v||x)&&(e.flipped=!0,(p||v)&&(r=a[u+1]),x&&(i=function(e){return"end"===e?"start":"start"===e?"end":e}(i)),e.placement=r+(i?"-"+i:""),e.offsets.popper=k({},e.offsets.popper,M(e.instance.popper,e.offsets.reference,e.placement)),e=D(e.instance.modifiers,e,"flip"))}),e},behavior:"flip",padding:5,boundariesElement:"viewport",flipVariations:!1,flipVariationsByContent:!1},inner:{order:700,enabled:!1,fn:function(e){var t=e.placement,n=t.split("-")[0],r=e.offsets,o=r.popper,i=r.reference,a=-1!==["left","right"].indexOf(n),s=-1===["top","left"].indexOf(n);return o[a?"left":"top"]=i[n]-(s?o[a?"width":"height"]:0),e.placement=A(t),e.offsets.popper=O(o),e}},hide:{order:800,enabled:!0,fn:function(e){if(!W(e.instance.modifiers,"hide","preventOverflow"))return e;var t=e.offsets.reference,n=F(e.instance.modifiers,function(e){return"preventOverflow"===e.name}).boundaries;if(t.bottomn.right||t.top>n.bottom||t.right2&&void 0!==arguments[2]?arguments[2]:{};x(this,e),this.scheduleUpdate=function(){return requestAnimationFrame(r.update)},this.update=a(this.update.bind(this)),this.options=k({},e.Defaults,o),this.state={isDestroyed:!1,isCreated:!1,scrollParents:[]},this.reference=t&&t.jquery?t[0]:t,this.popper=n&&n.jquery?n[0]:n,this.options.modifiers={},Object.keys(k({},e.Defaults.modifiers,o.modifiers)).forEach(function(t){r.options.modifiers[t]=k({},e.Defaults.modifiers[t]||{},o.modifiers?o.modifiers[t]:{})}),this.modifiers=Object.keys(this.options.modifiers).map(function(e){return k({name:e},r.options.modifiers[e])}).sort(function(e,t){return e.order-t.order}),this.modifiers.forEach(function(e){e.enabled&&s(e.onLoad)&&e.onLoad(r.reference,r.popper,r.options,e,r.state)}),this.update();var i=this.options.eventsEnabled;i&&this.enableEventListeners(),this.state.eventsEnabled=i}return C(e,[{key:"update",value:function(){return function(){if(!this.state.isDestroyed){var e={instance:this,styles:{},arrowStyles:{},attributes:{},flipped:!1,offsets:{}};e.offsets.reference=R(this.state,this.popper,this.reference,this.options.positionFixed),e.placement=N(this.options.placement,e.offsets.reference,this.popper,this.reference,this.options.modifiers.flip.boundariesElement,this.options.modifiers.flip.padding),e.originalPlacement=e.placement,e.positionFixed=this.options.positionFixed,e.offsets.popper=M(this.popper,e.offsets.reference,e.placement),e.offsets.popper.position=this.options.positionFixed?"fixed":"absolute",e=D(this.modifiers,e),this.state.isCreated?this.options.onUpdate(e):(this.state.isCreated=!0,this.options.onCreate(e))}}.call(this)}},{key:"destroy",value:function(){return function(){return this.state.isDestroyed=!0,I(this.modifiers,"applyStyle")&&(this.popper.removeAttribute("x-placement"),this.popper.style.position="",this.popper.style.top="",this.popper.style.left="",this.popper.style.right="",this.popper.style.bottom="",this.popper.style.willChange="",this.popper.style[L("transform")]=""),this.disableEventListeners(),this.options.removeOnDestroy&&this.popper.parentNode.removeChild(this.popper),this}.call(this)}},{key:"enableEventListeners",value:function(){return function(){this.state.eventsEnabled||(this.state=B(this.reference,this.options,this.state,this.scheduleUpdate))}.call(this)}},{key:"disableEventListeners",value:function(){return z.call(this)}}]),e}();J.Utils=("undefined"!==typeof window?window:e).PopperUtils,J.placements=K,J.Defaults=Q,t.a=J}).call(this,n(40))},function(e,t,n){var r=n(194),o=n(72),i=n(110),a=n(52)("socket.io-client");e.exports=t=u;var s=t.managers={};function u(e,t){"object"===typeof e&&(t=e,e=void 0),t=t||{};var n,o=r(e),u=o.source,l=o.id,c=o.path,f=s[l]&&c in s[l].nsps;return t.forceNew||t["force new connection"]||!1===t.multiplex||f?(a("ignoring socket cache for %s",u),n=i(u,t)):(s[l]||(a("new io instance for %s",u),s[l]=i(u,t)),n=s[l]),o.query&&!t.query&&(t.query=o.query),n.socket(o.path,t)}t.protocol=o.protocol,t.connect=u,t.Manager=n(110),t.Socket=n(116)},function(e,t,n){"use strict";function r(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};r.forEach(["delete","get","head"],function(e){s.headers[e]={}}),r.forEach(["post","put","patch"],function(e){s.headers[e]=r.merge(i)}),e.exports=s}).call(this,n(50))},function(e,t,n){"use strict";var r=n(24),o=n(153),i=n(89),a=n(155),s=n(156),u=n(93);e.exports=function(e){return new Promise(function(t,l){var c=e.data,f=e.headers;r.isFormData(c)&&delete f["Content-Type"];var p=new XMLHttpRequest;if(e.auth){var d=e.auth.username||"",h=e.auth.password||"";f.Authorization="Basic "+btoa(d+":"+h)}if(p.open(e.method.toUpperCase(),i(e.url,e.params,e.paramsSerializer),!0),p.timeout=e.timeout,p.onreadystatechange=function(){if(p&&4===p.readyState&&(0!==p.status||p.responseURL&&0===p.responseURL.indexOf("file:"))){var n="getAllResponseHeaders"in p?a(p.getAllResponseHeaders()):null,r={data:e.responseType&&"text"!==e.responseType?p.response:p.responseText,status:p.status,statusText:p.statusText,headers:n,config:e,request:p};o(t,l,r),p=null}},p.onabort=function(){p&&(l(u("Request aborted",e,"ECONNABORTED",p)),p=null)},p.onerror=function(){l(u("Network Error",e,null,p)),p=null},p.ontimeout=function(){l(u("timeout of "+e.timeout+"ms exceeded",e,"ECONNABORTED",p)),p=null},r.isStandardBrowserEnv()){var m=n(157),y=(e.withCredentials||s(e.url))&&e.xsrfCookieName?m.read(e.xsrfCookieName):void 0;y&&(f[e.xsrfHeaderName]=y)}if("setRequestHeader"in p&&r.forEach(f,function(e,t){"undefined"===typeof c&&"content-type"===t.toLowerCase()?delete f[t]:p.setRequestHeader(t,e)}),e.withCredentials&&(p.withCredentials=!0),e.responseType)try{p.responseType=e.responseType}catch(v){if("json"!==e.responseType)throw v}"function"===typeof e.onDownloadProgress&&p.addEventListener("progress",e.onDownloadProgress),"function"===typeof e.onUploadProgress&&p.upload&&p.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then(function(e){p&&(p.abort(),l(e),p=null)}),void 0===c&&(c=null),p.send(c)})}},function(e,t,n){"use strict";var r=n(154);e.exports=function(e,t,n,o,i){var a=new Error(e);return r(a,t,n,o,i)}},function(e,t,n){"use strict";var r=n(24);e.exports=function(e,t){t=t||{};var n={};return r.forEach(["url","method","params","data"],function(e){"undefined"!==typeof t[e]&&(n[e]=t[e])}),r.forEach(["headers","auth","proxy"],function(o){r.isObject(t[o])?n[o]=r.deepMerge(e[o],t[o]):"undefined"!==typeof t[o]?n[o]=t[o]:r.isObject(e[o])?n[o]=r.deepMerge(e[o]):"undefined"!==typeof e[o]&&(n[o]=e[o])}),r.forEach(["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","maxContentLength","validateStatus","maxRedirects","httpAgent","httpsAgent","cancelToken","socketPath"],function(r){"undefined"!==typeof t[r]?n[r]=t[r]:"undefined"!==typeof e[r]&&(n[r]=e[r])}),n}},function(e,t,n){"use strict";function r(e){this.message=e}r.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},r.prototype.__CANCEL__=!0,e.exports=r},function(e,t){e.exports=function(e){return e&&e.__esModule?e:{default:e}}},function(e,t,n){"use strict";var r=n(18);t.__esModule=!0,t.default=function(e){return(0,o.default)(e.replace(i,"ms-"))};var o=r(n(78)),i=/^-ms-/;e.exports=t.default},function(e,t,n){"use strict";var r=n(18);t.__esModule=!0,t.default=t.animationEnd=t.animationDelay=t.animationTiming=t.animationDuration=t.animationName=t.transitionEnd=t.transitionDuration=t.transitionDelay=t.transitionTiming=t.transitionProperty=t.transform=void 0;var o,i,a,s,u,l,c,f,p,d,h,m=r(n(28)),y="transform";if(t.transform=y,t.animationEnd=a,t.transitionEnd=i,t.transitionDelay=c,t.transitionTiming=l,t.transitionDuration=u,t.transitionProperty=s,t.animationDelay=h,t.animationTiming=d,t.animationDuration=p,t.animationName=f,m.default){var v=function(){for(var e,t,n=document.createElement("div").style,r={O:function(e){return"o"+e.toLowerCase()},Moz:function(e){return e.toLowerCase()},Webkit:function(e){return"webkit"+e},ms:function(e){return"MS"+e}},o=Object.keys(r),i="",a=0;a0&&!this.encoding){var e=this.packetBuffer.shift();this.packet(e)}},d.prototype.cleanup=function(){l("cleanup");for(var e=this.subs.length,t=0;t=this._reconnectionAttempts)l("reconnect failed"),this.backoff.reset(),this.emitAll("reconnect_failed"),this.reconnecting=!1;else{var t=this.backoff.duration();l("will wait %dms before reconnect attempt",t),this.reconnecting=!0;var n=setTimeout(function(){e.skipReconnect||(l("attempting reconnect"),e.emitAll("reconnect_attempt",e.backoff.attempts),e.emitAll("reconnecting",e.backoff.attempts),e.skipReconnect||e.open(function(t){t?(l("reconnect attempt error"),e.reconnecting=!1,e.reconnect(),e.emitAll("reconnect_error",t.data)):(l("reconnect success"),e.onreconnect())}))},t);this.subs.push({destroy:function(){clearTimeout(n)}})}},d.prototype.onreconnect=function(){var e=this.backoff.attempts;this.reconnecting=!1,this.backoff.reset(),this.updateSocketIds(),this.emitAll("reconnect",e)}},function(e,t,n){var r=n(74),o=n(208),i=n(218),a=n(219);t.polling=function(e){var t=!1,n=!1,a=!1!==e.jsonp;if("undefined"!==typeof location){var s="https:"===location.protocol,u=location.port;u||(u=s?443:80),t=e.hostname!==location.hostname||u!==e.port,n=e.secure!==s}if(e.xdomain=t,e.xscheme=n,"open"in new r(e)&&!e.forceJSONP)return new o(e);if(!a)throw new Error("JSONP disabled");return new i(e)},t.websocket=a},function(e,t,n){var r=n(75),o=n(53),i=n(41),a=n(54),s=n(114),u=n(55)("engine.io-client:polling");e.exports=c;var l=null!=new(n(74))({xdomain:!1}).responseType;function c(e){var t=e&&e.forceBase64;l&&!t||(this.supportsBinary=!1),r.call(this,e)}a(c,r),c.prototype.name="polling",c.prototype.doOpen=function(){this.poll()},c.prototype.pause=function(e){var t=this;function n(){u("paused"),t.readyState="paused",e()}if(this.readyState="pausing",this.polling||!this.writable){var r=0;this.polling&&(u("we are currently polling - waiting to pause"),r++,this.once("pollComplete",function(){u("pre-pause polling complete"),--r||n()})),this.writable||(u("we are currently writing - waiting to pause"),r++,this.once("drain",function(){u("pre-pause writing complete"),--r||n()}))}else n()},c.prototype.poll=function(){u("polling"),this.polling=!0,this.doPoll(),this.emit("poll")},c.prototype.onData=function(e){var t=this;u("polling got data %s",e);i.decodePayload(e,this.socket.binaryType,function(e,n,r){if("opening"===t.readyState&&t.onOpen(),"close"===e.type)return t.onClose(),!1;t.onPacket(e)}),"closed"!==this.readyState&&(this.polling=!1,this.emit("pollComplete"),"open"===this.readyState?this.poll():u('ignoring poll - transport state "%s"',this.readyState))},c.prototype.doClose=function(){var e=this;function t(){u("writing close packet"),e.write([{type:"close"}])}"open"===this.readyState?(u("transport open - closing"),t()):(u("transport not open - deferring close"),this.once("open",t))},c.prototype.write=function(e){var t=this;this.writable=!1;var n=function(){t.writable=!0,t.emit("drain")};i.encodePayload(e,this.supportsBinary,function(e){t.doWrite(e,n)})},c.prototype.uri=function(){var e=this.query||{},t=this.secure?"https":"http",n="";return!1!==this.timestampRequests&&(e[this.timestampParam]=s()),this.supportsBinary||e.sid||(e.b64=1),e=o.encode(e),this.port&&("https"===t&&443!==Number(this.port)||"http"===t&&80!==Number(this.port))&&(n=":"+this.port),e.length&&(e="?"+e),t+"://"+(-1!==this.hostname.indexOf(":")?"["+this.hostname+"]":this.hostname)+n+this.path+e}},function(e,t,n){(function(t){var r=n(210),o=Object.prototype.toString,i="function"===typeof Blob||"undefined"!==typeof Blob&&"[object BlobConstructor]"===o.call(Blob),a="function"===typeof File||"undefined"!==typeof File&&"[object FileConstructor]"===o.call(File);e.exports=function e(n){if(!n||"object"!==typeof n)return!1;if(r(n)){for(var o=0,s=n.length;o0);return t}function c(){var e=l(+new Date);return e!==r?(s=0,r=e):e+"."+l(s++)}for(;u=0||(o[n]=e[n]);return o}(e,["show","container","children","renderDialog","role","transition","backdrop","className","style","onExit","onExiting","onEnter","onEntering","onEntered"]);if(!(t||u&&!this.state.exited))return null;var x=v({role:a,ref:this.setDialogRef,"aria-modal":"dialog"===a||void 0},function(e,t){var n=Object.keys(e),r={};return n.map(function(n){Object.prototype.hasOwnProperty.call(t,n)||(r[n]=e[n])}),r}(w,s.propTypes),{style:p,className:f,tabIndex:"-1"}),C=o?o(x):c.default.createElement("div",x,c.default.cloneElement(r,{role:"document"}));return u&&(C=c.default.createElement(u,{appear:!0,unmountOnExit:!0,in:t,onExit:h,onExiting:m,onExited:this.handleHidden,onEnter:y,onEntering:g,onEntered:b},C)),c.default.createElement(d.default,{container:n,onRendered:this.onPortalRendered},c.default.createElement(c.default.Fragment,null,l&&this.renderBackdrop(),C))},s}(c.default.Component);w.propTypes={show:s.default.bool,container:s.default.oneOfType([u.default,s.default.func]),onShow:s.default.func,onHide:s.default.func,backdrop:s.default.oneOfType([s.default.bool,s.default.oneOf(["static"])]),renderDialog:s.default.func,renderBackdrop:s.default.func,onEscapeKeyDown:s.default.func,onBackdropClick:s.default.func,containerClassName:s.default.string,keyboard:s.default.bool,transition:l.default,backdropTransition:l.default,autoFocus:s.default.bool,enforceFocus:s.default.bool,restoreFocus:s.default.bool,onEnter:s.default.func,onEntering:s.default.func,onEntered:s.default.func,onExit:s.default.func,onExiting:s.default.func,onExited:s.default.func,manager:s.default.object.isRequired},w.defaultProps={show:!1,role:"dialog",backdrop:!0,keyboard:!0,autoFocus:!0,enforceFocus:!0,restoreFocus:!0,onHide:function(){},manager:b,renderBackdrop:function(e){return c.default.createElement("div",e)}},w.Manager=p.default;var x=w;t.default=x,e.exports=t.default},function(e,t,n){var r=n(184),o=n(185);e.exports=function(e,t,n){var i=t&&n||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null);var a=(e=e||{}).random||(e.rng||r)();if(a[6]=15&a[6]|64,a[8]=63&a[8]|128,t)for(var s=0;s<16;++s)t[i+s]=a[s];return t||o(a)}},function(e,t,n){"use strict";var r=n(2),o=n(4),i=n(5),a=n.n(i),s=n(0),u=n.n(s),l=n(6),c=u.a.forwardRef(function(e,t){var n=e.bsPrefix,i=e.size,s=e.toggle,c=e.vertical,f=e.className,p=e.as,d=void 0===p?"div":p,h=Object(o.a)(e,["bsPrefix","size","toggle","vertical","className","as"]),m=Object(l.b)(n,"btn-group"),y=m;return c&&(y=m+"-vertical"),u.a.createElement(d,Object(r.a)({},h,{ref:t,className:a()(f,y,i&&m+"-"+i,s&&m+"-toggle")}))});c.displayName="ButtonGroup",c.defaultProps={vertical:!1,toggle:!1,role:"group"},t.a=c},function(e,t,n){"use strict";var r=n(2),o=n(4),i=n(11),a=n(5),s=n.n(a),u=n(0),l=n.n(u),c=n(124),f=function(){},p=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),o=0;o=this._config.preview;if(r)t.postMessage({results:s,workerId:a.WORKER_ID,finished:l});else if(x(this._config.chunk)&&!n){if(this._config.chunk(s,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);s=void 0,this._completeResults=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(s.data),this._completeResults.errors=this._completeResults.errors.concat(s.errors),this._completeResults.meta=s.meta),this._completed||!l||!x(this._config.complete)||s&&s.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),l||s&&s.meta.paused||this._nextChunk(),s}this._halted=!0},this._sendError=function(e){x(this._config.error)?this._config.error(e):r&&this._config.error&&t.postMessage({workerId:a.WORKER_ID,error:e,finished:!1})}}function l(e){var t;(e=e||{}).chunkSize||(e.chunkSize=a.RemoteChunkSize),u.call(this,e),this._nextChunk=n?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(e){this._input=e,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(t=new XMLHttpRequest,this._config.withCredentials&&(t.withCredentials=this._config.withCredentials),n||(t.onload=w(this._chunkLoaded,this),t.onerror=w(this._chunkError,this)),t.open("GET",this._input,!n),this._config.downloadRequestHeaders){var e=this._config.downloadRequestHeaders;for(var r in e)t.setRequestHeader(r,e[r])}if(this._config.chunkSize){var o=this._start+this._config.chunkSize-1;t.setRequestHeader("Range","bytes="+this._start+"-"+o)}try{t.send()}catch(e){this._chunkError(e.message)}n&&0===t.status?this._chunkError():this._start+=this._config.chunkSize}},this._chunkLoaded=function(){4===t.readyState&&(t.status<200||400<=t.status?this._chunkError():(this._finished=!this._config.chunkSize||this._start>function(e){var t=e.getResponseHeader("Content-Range");return null===t?-1:parseInt(t.substr(t.lastIndexOf("/")+1))}(t),this.parseChunk(t.responseText)))},this._chunkError=function(e){var n=t.statusText||e;this._sendError(new Error(n))}}function c(e){var t,n;(e=e||{}).chunkSize||(e.chunkSize=a.LocalChunkSize),u.call(this,e);var r="undefined"!=typeof FileReader;this.stream=function(e){this._input=e,n=e.slice||e.webkitSlice||e.mozSlice,r?((t=new FileReader).onload=w(this._chunkLoaded,this),t.onerror=w(this._chunkError,this)):t=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount=this._input.size,this.parseChunk(e.target.result)},this._chunkError=function(){this._sendError(t.error)}}function f(e){var t;u.call(this,e=e||{}),this.stream=function(e){return t=e,this._nextChunk()},this._nextChunk=function(){if(!this._finished){var e=this._config.chunkSize,n=e?t.substr(0,e):t;return t=e?t.substr(e):"",this._finished=!t,this.parseChunk(n)}}}function p(e){u.call(this,e=e||{});var t=[],n=!0,r=!1;this.pause=function(){u.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){u.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(e){this._input=e,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){r&&1===t.length&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),t.length?this.parseChunk(t.shift()):n=!0},this._streamData=w(function(e){try{t.push("string"==typeof e?e:e.toString(this._config.encoding)),n&&(n=!1,this._checkIsFinished(),this.parseChunk(t.shift()))}catch(e){this._streamError(e)}},this),this._streamError=w(function(e){this._streamCleanUp(),this._sendError(e)},this),this._streamEnd=w(function(){this._streamCleanUp(),r=!0,this._streamData("")},this),this._streamCleanUp=w(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function d(e){var t,n,r,o=/^\s*-?(\d*\.?\d+|\d+\.?\d*)(e[-+]?\d+)?\s*$/i,i=/(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))/,s=this,u=0,l=0,c=!1,f=!1,p=[],d={data:[],errors:[],meta:{}};if(x(e.step)){var y=e.step;e.step=function(t){if(d=t,w())g();else{if(g(),0===d.data.length)return;u+=t.data.length,e.preview&&u>e.preview?n.abort():y(d,s)}}}function v(t){return"greedy"===e.skipEmptyLines?""===t.join("").trim():1===t.length&&0===t[0].length}function g(){if(d&&r&&(E("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+a.DefaultDelimiter+"'"),r=!1),e.skipEmptyLines)for(var t=0;t=p.length?"__parsed_extra":p[r]),e.transform&&(a=e.transform(a,i)),a=C(i,a),"__parsed_extra"===i?(o[i]=o[i]||[],o[i].push(a)):o[i]=a}return e.header&&(r>p.length?E("FieldMismatch","TooManyFields","Too many fields: expected "+p.length+" fields but parsed "+r,l+n):r=r.length/2?"\r\n":"\r"}(o,u)),r=!1,e.delimiter)x(e.delimiter)&&(e.delimiter=e.delimiter(o),d.meta.delimiter=e.delimiter);else{var l=function(t,n,r,o,i){var s,u,l,c;i=i||[",","\t","|",";",a.RECORD_SEP,a.UNIT_SEP];for(var f=0;f=s)return I(!0)}else for(P=c,c++;;){if(-1===(P=e.indexOf(t,P+1)))return p||w.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:b.length,index:c}),F();if(P===d-1)return F(e.substring(c,P).replace(T,t));if(t!==l||e[P+1]!==l){if(t===l||0===P||e[P-1]!==l){var R=M(-1===S?_:Math.min(_,S));if(e[P+1+R]===n){C.push(e.substring(c,P).replace(T,t)),e[c=P+1+R+m]!==t&&(P=e.indexOf(t,c)),_=e.indexOf(n,c),S=e.indexOf(r,c);break}var j=M(S);if(e.substr(P+1+j,y)===r){if(C.push(e.substring(c,P).replace(T,t)),D(P+1+j+y),_=e.indexOf(n,c),P=e.indexOf(t,c),g&&(L(),f))return I();if(s&&b.length>=s)return I(!0);break}w.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:b.length,index:c}),P++}}else P++}return F();function A(e){b.push(e),E=c}function M(t){var n=0;if(-1!==t){var r=e.substring(P+1,t);r&&""===r.trim()&&(n=r.length)}return n}function F(t){return p||(void 0===t&&(t=e.substr(c)),C.push(t),c=d,A(C),g&&L()),I()}function D(t){c=t,A(C),C=[],S=e.indexOf(r,c)}function I(e,t){return{data:t?b[0]:b,errors:w,meta:{delimiter:n,linebreak:r,aborted:f,truncated:!!e,cursor:E+(a||0)}}}function L(){i(I(void 0,!0)),b=[],w=[]}function U(r,o,i){var a={nextDelim:void 0,quoteSearch:void 0},s=e.indexOf(t,o+1);if(o=0||(o[n]=e[n]);return o}function y(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var v=function(e){var t,n;function r(t,n){var r;return(r=e.call(this,t,n)||this).handleHidden=function(){var e;(r.setState({exited:!0}),r.props.onExited)&&(e=r.props).onExited.apply(e,arguments)},r.state={exited:!t.show},r.onHiddenListener=r.handleHidden.bind(y(y(r))),r._lastTarget=null,r}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n,r.getDerivedStateFromProps=function(e){return e.show?{exited:!1}:e.transition?null:{exited:!0}};var o=r.prototype;return o.componentDidMount=function(){this.setState({target:this.getTarget()})},o.componentDidUpdate=function(e){if(this.props!==e){var t=this.getTarget();t!==this.state.target&&this.setState({target:t})}},o.getTarget=function(){var e=this.props.target;return(e="function"===typeof e?e():e)&&s.default.findDOMNode(e)||null},o.render=function(){var e=this,t=this.props,n=(t.target,t.container),r=t.containerPadding,o=t.placement,i=t.rootClose,s=t.children,f=t.flip,p=t.popperConfig,d=void 0===p?{}:p,y=t.transition,v=m(t,["target","container","containerPadding","placement","rootClose","children","flip","popperConfig","transition"]),g=this.state.target;if(!(v.show||y&&!this.state.exited))return null;var b=s,w=d.modifiers,x=void 0===w?{}:w,C=h({},d,{placement:o,referenceElement:g,enableEvents:v.show,modifiers:h({},x,{preventOverflow:h({padding:r||5},x.preventOverflow),flip:h({enabled:!!f},x.preventOverflow)})});return b=a.default.createElement(c.Popper,C,function(t){var n=t.arrowProps,r=t.style,i=t.ref,s=m(t,["arrowProps","style","ref"]);e.popper=s;var u=e.props.children(h({},s,{placement:s.placement||o,show:v.show,arrowProps:n,props:{ref:i,style:r}}));if(y){var l=v.onExit,c=v.onExiting,f=v.onEnter,p=v.onEntering,d=v.onEntered;u=a.default.createElement(y,{in:v.show,appear:!0,onExit:l,onExiting:c,onExited:e.onHiddenListener,onEnter:f,onEntering:p,onEntered:d},u)}return u}),i&&(b=a.default.createElement(l.default,{onRootClose:v.onHide,event:v.rootCloseEvent,disabled:v.rootCloseDisabled},b)),a.default.createElement(u.default,{container:n},b)},r}(a.default.Component);v.propTypes=h({},u.default.propTypes,{show:r.default.bool,placement:r.default.oneOf(c.placements),container:r.default.oneOfType([i.default,r.default.func]),flip:r.default.bool,children:r.default.func.isRequired,popperConfig:r.default.object,rootClose:r.default.bool,rootCloseEvent:l.default.propTypes.event,rootCloseDisabled:l.default.propTypes.disabled,onHide:function(e){var t=r.default.func;e.rootClose&&(t=t.isRequired);for(var n=arguments.length,o=new Array(n>1?n-1:0),i=1;i=0||(o[n]=e[n]);return o}},function(e,t,n){"use strict";t.__esModule=!0;var r=i(n(0)),o=i(n(189));function i(e){return e&&e.__esModule?e:{default:e}}t.default=r.default.createContext||o.default,e.exports=t.default},function(e,t,n){"use strict";var r=n(2),o=n(4),i=n(11),a=n(5),s=n.n(a),u=n(0),l=n.n(u),c=n(59),f=n(23),p=n(6),d=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),o=0;oj.length&&j.push(e)}function F(e,t,n){return null==e?0:function e(t,n,r,o){var s=typeof t;"undefined"!==s&&"boolean"!==s||(t=null);var u=!1;if(null===t)u=!0;else switch(s){case"string":case"number":u=!0;break;case"object":switch(t.$$typeof){case i:case a:u=!0}}if(u)return r(o,t,""===n?"."+D(t,0):n),1;if(u=0,n=""===n?".":n+":",Array.isArray(t))for(var l=0;lthis.eventPool.length&&this.eventPool.push(e)}function fe(e){e.eventPool=[],e.getPooled=le,e.release=ce}o(ue.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!==typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=ae)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!==typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=ae)},persist:function(){this.isPersistent=ae},isPersistent:se,destructor:function(){var e,t=this.constructor.Interface;for(e in t)this[e]=null;this.nativeEvent=this._targetInst=this.dispatchConfig=null,this.isPropagationStopped=this.isDefaultPrevented=se,this._dispatchInstances=this._dispatchListeners=null}}),ue.Interface={type:null,target:null,currentTarget:function(){return null},eventPhase:null,bubbles:null,cancelable:null,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:null,isTrusted:null},ue.extend=function(e){function t(){}function n(){return r.apply(this,arguments)}var r=this;t.prototype=r.prototype;var i=new t;return o(i,n.prototype),n.prototype=i,n.prototype.constructor=n,n.Interface=o({},r.Interface,e),n.extend=r.extend,fe(n),n},fe(ue);var pe=ue.extend({data:null}),de=ue.extend({data:null}),he=[9,13,27,32],me=W&&"CompositionEvent"in window,ye=null;W&&"documentMode"in document&&(ye=document.documentMode);var ve=W&&"TextEvent"in window&&!ye,ge=W&&(!me||ye&&8=ye),be=String.fromCharCode(32),we={beforeInput:{phasedRegistrationNames:{bubbled:"onBeforeInput",captured:"onBeforeInputCapture"},dependencies:["compositionend","keypress","textInput","paste"]},compositionEnd:{phasedRegistrationNames:{bubbled:"onCompositionEnd",captured:"onCompositionEndCapture"},dependencies:"blur compositionend keydown keypress keyup mousedown".split(" ")},compositionStart:{phasedRegistrationNames:{bubbled:"onCompositionStart",captured:"onCompositionStartCapture"},dependencies:"blur compositionstart keydown keypress keyup mousedown".split(" ")},compositionUpdate:{phasedRegistrationNames:{bubbled:"onCompositionUpdate",captured:"onCompositionUpdateCapture"},dependencies:"blur compositionupdate keydown keypress keyup mousedown".split(" ")}},xe=!1;function Ce(e,t){switch(e){case"keyup":return-1!==he.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"blur":return!0;default:return!1}}function Ee(e){return"object"===typeof(e=e.detail)&&"data"in e?e.data:null}var ke=!1;var Oe={eventTypes:we,extractEvents:function(e,t,n,r){var o=void 0,i=void 0;if(me)e:{switch(e){case"compositionstart":o=we.compositionStart;break e;case"compositionend":o=we.compositionEnd;break e;case"compositionupdate":o=we.compositionUpdate;break e}o=void 0}else ke?Ce(e,n)&&(o=we.compositionEnd):"keydown"===e&&229===n.keyCode&&(o=we.compositionStart);return o?(ge&&"ko"!==n.locale&&(ke||o!==we.compositionStart?o===we.compositionEnd&&ke&&(i=ie()):(re="value"in(ne=r)?ne.value:ne.textContent,ke=!0)),o=pe.getPooled(o,t,n,r),i?o.data=i:null!==(i=Ee(n))&&(o.data=i),V(o),i=o):i=null,(e=ve?function(e,t){switch(e){case"compositionend":return Ee(t);case"keypress":return 32!==t.which?null:(xe=!0,be);case"textInput":return(e=t.data)===be&&xe?null:e;default:return null}}(e,n):function(e,t){if(ke)return"compositionend"===e||!me&&Ce(e,t)?(e=ie(),oe=re=ne=null,ke=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1
Note: If the above video call does not work, please open it in a different tab here
\r\n\t\t\t\t\t{_renderBallots()}\r\n\t\t\t\t\t _handleScoreBallots()}\r\n\t\t\t\t\t>Submit Scores\r\n\t\t\t\t\t{ _getSkipButtons()}\r\n\t\t\t\t\r\n\t\t\t);\r\n\t\t}\r\n\r\n\t\treturn null;\r\n\t};\r\n\r\n\tconst _renderNextProject = () => {\r\n\t\tconst exclamations = [\r\n\t\t\t'You are out of control!',\r\n\t\t\t'Absolutely incredible!',\r\n\t\t\t'Congratulations!',\r\n\t\t\t`You're on a roll!`,\r\n\t\t\t`Keep it going!`,\r\n\t\t\t`Just a couple hundred projects left to go!`,\r\n\t\t\t`Great Job`,\r\n\t\t];\r\n\t\treturn (\r\n\t\t\t
\r\n\t\t\t\t

{exclamations[Math.floor(Math.random() * exclamations.length)]}

\r\n\t\t\t\t

Your scores have been submitted!

\r\n\t\t\t\t\r\n\t\t\t
\r\n\t\t);\r\n\t};\r\n\r\n\tconst _renderNoProject = () => {\r\n\t\treturn (\r\n\t\t\t
\r\n\t\t\t\t

There are currently no projects assigned to you.

\r\n\t\t\t\t\r\n\t\t\t
\r\n\t\t);\r\n\t};\r\n\r\n\tif (\r\n\t\tObject.values(props.tableGroups).length === 0\r\n\t\t|| !state.currentProject\r\n\t\t|| Object.values(props.categories.criteria).length === 0) {\r\n\t\treturn null;\r\n\t\t// TODO loading\r\n\t}\r\n\r\n\t// TODO replace showImHere with round properties\r\n\tlet showImHere = false;\r\n\r\n\tswitch (state.judgingState) {\r\n\t\tcase JudgingState.FindProject:\r\n\t\t\tif (!showImHere) {\r\n\t\t\t\tprops.startBallots(props.account.id!, state.currentProject!.id!);\r\n\t\t\t\treturn _renderJudgeProject();\r\n\t\t\t}\r\n\t\t\treturn _renderFindProject();\r\n\t\tcase JudgingState.JudgeProject:\r\n\t\t\treturn _renderJudgeProject();\r\n\t\tcase JudgingState.NextProject:\r\n\t\t\treturn _renderNextProject();\r\n\t\tcase JudgingState.NoProject:\r\n\t\t\treturn _renderNoProject();\r\n\t}\r\n\r\n\treturn null;\r\n};\r\n\r\nconst PageJudging = connect(mapStateToProps, mapDispatchToProps)(PageJudgingComponent);\r\n\r\nexport default PageJudging;\r\n","import React from 'react';\r\nimport { withRouter } from 'react-router';\r\nimport { Nav } from 'react-bootstrap';\r\nimport { adminRoute } from './PageAdmin';\r\n\r\ninterface AdminNavigationProps {\r\n history: any;\r\n location: any;\r\n match: any;\r\n}\r\n\r\nconst AdminNavigation: React.FC = (props) => {\r\n const actualPage = () => {\r\n const pageString = props.location.pathname.split('/')[2];\r\n return pageString ? `/${pageString}` : '/';\r\n };\r\n\r\n const [curPage, changeCurPage] = React.useState(actualPage());\r\n\r\n React.useEffect(() => {\r\n changeCurPage(actualPage());\r\n });\r\n\r\n const navTo = (link: string) => {\r\n props.history.push(link);\r\n changeCurPage(actualPage());\r\n };\r\n\r\n return (\r\n \r\n \r\n navTo(`${adminRoute}`)}>\r\n Projects\r\n \r\n \r\n {/* \r\n navTo(`${adminRoute}/projects`)}>\r\n Projects\r\n \r\n */}\r\n \r\n navTo(`${adminRoute}/categories`)}>\r\n Categories\r\n \r\n \r\n \r\n navTo(`${adminRoute}/users`)}>\r\n Users\r\n \r\n \r\n \r\n navTo(`${adminRoute}/dashboard`)}>\r\n Dashboard\r\n \r\n \r\n \r\n // \r\n // navTo('/admin')}>Epicenter\r\n // navTo('/admin/projects')}>Projects\r\n // navTo('/admin/categories')}>Categories\r\n // navTo('/admin/users')}>Users\r\n // \r\n );\r\n}\r\n\r\nexport default withRouter(AdminNavigation);","import User, { UserState, roleStringToEnum } from '../types/User';\r\nimport Axios from 'axios';\r\n\r\n// Action Types\r\nexport const ADD_USER = 'ADD_USER';\r\nexport const DELETE_USER = 'DELETE_USER';\r\nexport const UPDATE_USER = 'UPDATE_USER';\r\nexport const FILL_USERS = 'FILL_USERS';\r\n\r\n// Action Creators\r\nexport function addUser(newUser: User) {\r\n return { type: ADD_USER, user: newUser };\r\n}\r\n\r\nexport function deleteUser(userID: number) {\r\n return { type: DELETE_USER, id: userID };\r\n}\r\n\r\nexport function updateUser(updatedUser: User) {\r\n return { type: UPDATE_USER, user: updatedUser };\r\n}\r\n\r\nexport function fillUsers(users: UserState) {\r\n return { type: FILL_USERS, users }\r\n}\r\n\r\nexport function fetchUsers() {\r\n return async (dispatch: any) => {\r\n try {\r\n const result = await Axios.get('/api/users/allUsers');\r\n if (result.status) {\r\n const payload: UserState = result.data;\r\n const toFill: UserState = {};\r\n for (const user of Object.values(payload)) {\r\n toFill[user.id] = {\r\n ...user,\r\n role: roleStringToEnum(user.role),\r\n };\r\n };\r\n dispatch(fillUsers(toFill));\r\n } else {\r\n throw new Error('API Error');\r\n }\r\n } catch (error) {\r\n console.log(error);\r\n return Promise.resolve();\r\n }\r\n };\r\n}\r\n\r\n// Reducer\r\nexport default function users(state: UserState = {}, action: any) {\r\n switch (action.type) {\r\n case ADD_USER:\r\n case UPDATE_USER:\r\n return {\r\n ...state,\r\n [action.user.id]: action.user,\r\n };\r\n case DELETE_USER:\r\n const newState = state;\r\n delete newState[action.id];\r\n return newState;\r\n case FILL_USERS:\r\n return action.users;\r\n default:\r\n return state;\r\n }\r\n}","import Axios from 'axios';\r\nimport React from 'react';\r\nimport { Form, ButtonToolbar, ToggleButtonGroup, ToggleButton, Button, Modal } from 'react-bootstrap';\r\nimport { connect } from 'react-redux';\r\n\r\nimport { AppState } from '../../state/Store';\r\nimport User, { UserRole, serverDataToClientUser, clientUserToServerUser } from '../../types/User';\r\nimport { updateUser } from '../../state/User';\r\nimport { requestFinish, requestStart } from '../../state/Request';\r\nimport { fetchCompanies } from '../../state/Company';\r\n\r\nconst mapStateToProps = (state: AppState) => {\r\n\treturn {\r\n account: state.account,\r\n companies: state.companies,\r\n\t};\r\n};\r\n\r\nconst mapDispatchToProps = (dispatch: any) => {\r\n\treturn {\r\n\t\tupdateUser: (user: User) => {\r\n\t\t\tdispatch(updateUser(user));\r\n },\r\n requestFinish: () => {\r\n dispatch(requestFinish());\r\n },\r\n requestStart: () => {\r\n dispatch(requestStart());\r\n },\r\n\t};\r\n};\r\n\r\ninterface PageAdminUsersModalProps {\r\n account: User;\r\n companies: string[];\r\n modalOpen: boolean;\r\n user: User;\r\n closeModal: () => void;\r\n updateUser: (user: User) => void;\r\n requestFinish: () => void;\r\n requestStart: () => void;\r\n}\r\n\r\ntype State = {\r\n requesting: boolean;\r\n user: User;\r\n}\r\n\r\ntype Action =\r\n | { type: 'update-user', user: User };\r\n\r\nconst PageAdminUsersModalComponent: React.FC = (props) => {\r\n\tconst [state, dispatch] = React.useReducer((state: State, action: Action) => {\r\n\t\tswitch (action.type) {\r\n case 'update-user':\r\n return { ...state, user: action.user };\r\n\t\t\tdefault:\r\n\t\t\t\treturn state;\r\n\t\t}\r\n\t}, {\r\n requesting: false,\r\n user: props.user,\r\n }, undefined);\r\n\r\n const user = props.user;\r\n\r\n React.useEffect(() => {\r\n dispatch({ type: 'update-user', user: props.user });\r\n }, [user]);\r\n\r\n const _handleSaveChanges = async () => {\r\n try {\r\n props.requestStart();\r\n const result = await Axios.post('/api/users/update', {\r\n user: clientUserToServerUser(state.user),\r\n });\r\n if (result.status) {\r\n const data = result.data;\r\n props.requestFinish();\r\n props.closeModal();\r\n props.updateUser(serverDataToClientUser(data));\r\n } else {\r\n // TODO add error checking.\r\n }\r\n } catch(error) {\r\n // TODO improve error handling.\r\n alert('Server error. Please try again.');\r\n window.location.reload();\r\n }\r\n };\r\n\r\n const _getCompanyList = () => {\r\n return props.companies.map((company: string) => {\r\n return (\r\n \r\n );\r\n });\r\n };\r\n\r\n const _getForm = () => {\r\n return (\r\n
\r\n \r\n Name\r\n dispatch({\r\n type: 'update-user',\r\n user: {\r\n ...state.user,\r\n name: event.target.value,\r\n },\r\n })}\r\n value={state.user.name}\r\n type=\"text\"\r\n placeholder=\"Name\" />\r\n \r\n \r\n Permission Level\r\n \r\n dispatch({\r\n type: 'update-user',\r\n user: {\r\n ...state.user,\r\n role: value,\r\n }\r\n })}\r\n type='radio'\r\n value={state.user.role} >\r\n \r\n Pending\r\n \r\n \r\n Judge\r\n \r\n \r\n Admin\r\n \r\n \r\n Owner\r\n \r\n \r\n \r\n \r\n \r\n Company/Group Name\r\n dispatch({\r\n type: 'update-user',\r\n user: {\r\n ...state.user,\r\n company: event.target.value,\r\n },\r\n })}\r\n value={state.user.company}\r\n type=\"text\"\r\n placeholder=\"Company\">\r\n {_getCompanyList()}\r\n \r\n \r\n \r\n \r\n \r\n
\r\n );\r\n };\r\n\r\n\treturn (\r\n\t\t\r\n \r\n Edit User {props.user.id}\r\n \r\n \r\n {_getForm()}\r\n \r\n \r\n \r\n \r\n \r\n \r\n\t);\r\n};\r\n\r\nconst PageAdminUsersModal = connect(mapStateToProps, mapDispatchToProps)(PageAdminUsersModalComponent);\r\n\r\nexport default PageAdminUsersModal;\r\n","import Axios from 'axios';\r\nimport React from 'react';\r\nimport { Badge, Card, ButtonGroup, Button } from 'react-bootstrap';\r\nimport { connect } from 'react-redux';\r\n\r\nimport User, { UserRole, clientUserToServerUser, serverDataToClientUser, getRoleString } from '../../types/User';\r\nimport { updateUser } from '../../state/User';\r\nimport { requestFinish, requestStart } from '../../state/Request';\r\nimport { AppState } from '../../state/Store';\r\n\r\nconst mapStateToProps = (state: AppState) => {\r\n return {\r\n requesting: state.requesting,\r\n }\r\n}\r\n\r\nconst mapDispatchToProps = (dispatch: any) => {\r\n\treturn {\r\n requestFinish: () => {\r\n\t\t\tdispatch(requestFinish());\r\n\t\t},\r\n\t\trequestStart: () => {\r\n\t\t\tdispatch(requestStart());\r\n\t\t},\r\n\t\tupdateUser: (user: User) => {\r\n dispatch(updateUser(user));\r\n },\r\n\t};\r\n};\r\n\r\ninterface PageAdminUserCardProps {\r\n requesting: boolean;\r\n user: User;\r\n openModal: (event: any, user: User) => void;\r\n requestFinish: () => void;\r\n\trequestStart: () => void;\r\n\tupdateUser: (user: User) => void;\r\n}\r\n\r\nconst PageAdminUserCardComponent: React.FC = (props) => {\r\n const approve = async (event: any, user: User) => {\r\n try {\r\n event.preventDefault();\r\n props.requestStart();\r\n user.role = UserRole.Judge;\r\n user.isJudging = true;\r\n const result = await Axios.post('/api/users/update', {\r\n user: clientUserToServerUser(user),\r\n });\r\n if (result.status) {\r\n props.updateUser(serverDataToClientUser(result.data));\r\n props.requestFinish();\r\n } else {\r\n // TODO add error checking.\r\n }\r\n } catch(error) {\r\n // TODO improve error handling.\r\n alert('Server error. Please try again.');\r\n window.location.reload();\r\n }\r\n };\r\n\r\n const includeExclude = async (event: any, user: User, include: boolean) => {\r\n try {\r\n event.preventDefault();\r\n props.requestStart();\r\n user.isJudging = include;\r\n const result = await Axios.post('/api/users/update', {\r\n user: clientUserToServerUser(user),\r\n });\r\n if (result.status) {\r\n props.updateUser(serverDataToClientUser(result.data));\r\n props.requestFinish();\r\n } else {\r\n // TODO add error checking.\r\n }\r\n } catch(error) {\r\n // TODO improve error handling.\r\n alert('Server error. Please try again.');\r\n window.location.reload();\r\n }\r\n };\r\n\r\n const getActionButtons = (user: User) => {\r\n if (user.role === UserRole.Pending) {\r\n return (\r\n approve(event, props.user)}\r\n size='sm'\r\n variant='outline-success'>\r\n Approve\r\n \r\n );\r\n } else if (user.isJudging) {\r\n return (\r\n includeExclude(event, props.user, false)}\r\n size='sm'\r\n variant='outline-danger'>\r\n Exclude From Judging\r\n \r\n );\r\n } else {\r\n return (\r\n includeExclude(event, props.user, true)}\r\n size='sm'\r\n variant='outline-success'>\r\n Include In Judging\r\n \r\n );\r\n }\r\n };\r\n\r\n\treturn (\r\n\t\t\r\n \r\n {props.user.name}\r\n \r\n {getRoleString(props.user.role)}\r\n {props.user.isJudging ? 'Included In Judging' : 'Excluded From Judging'}\r\n \r\n \r\n {props.user.email}
\r\n {props.user.company}
\r\n {props.user.tags && props.user.tags.length > 0 ? {props.user.tags} : No tags}\r\n
\r\n \r\n props.openModal(event, props.user)}\r\n size='sm'\r\n variant='primary'>\r\n Edit\r\n \r\n {getActionButtons(props.user)}\r\n \r\n
\r\n \r\n\t);\r\n};\r\n\r\nconst PageAdminUserCard = connect(mapStateToProps, mapDispatchToProps)(PageAdminUserCardComponent);\r\n\r\nexport default PageAdminUserCard;\r\n","import Axios from \"axios\";\r\n\r\nexport const UPDATE_COMPANIES = 'UPDATE_COMPANIES';\r\n\r\nexport function updateCompanies(companies: string[]) {\r\n return { type: UPDATE_COMPANIES, companies };\r\n}\r\n\r\nexport function fetchCompanies() {\r\n return async (dispatch: any) => {\r\n try {\r\n const result = await Axios.get('/api/categories/companies');\r\n if (result.status) {\r\n const payload: string[] = result.data;\r\n dispatch(updateCompanies(payload));\r\n } else {\r\n throw new Error('API Error');\r\n }\r\n } catch (error) {\r\n console.log(error);\r\n return Promise.resolve();\r\n }\r\n };\r\n}\r\n\r\nexport default function companies(state: string[] = [], action: any) {\r\n switch (action.type) {\r\n case UPDATE_COMPANIES:\r\n return action.companies;\r\n default:\r\n return state;\r\n }\r\n}\r\n","import React from 'react';\r\nimport { connect } from 'react-redux';\r\n\r\nimport User, { EMPTY_USER, UserState } from '../../types/User';\r\nimport { AppState } from '../../state/Store';\r\nimport { fetchUsers } from '../../state/User';\r\n\r\nimport PageAdminUsersModal from './PageAdminUsersModal';\r\nimport PageAdminUserCard from './PageAdminUserCard';\r\nimport { requestFinish, requestStart } from '../../state/Request';\r\nimport { fetchCompanies } from '../../state/Company';\r\n\r\nconst mapStateToProps = (state: AppState) => {\r\n return {\r\n account: state.account,\r\n requesting: state.requesting,\r\n users: state.users,\r\n };\r\n};\r\n\r\nconst mapDispatchToProps = (dispatch: any) => {\r\n return {\r\n fetchCompanies: () => {\r\n dispatch(fetchCompanies());\r\n },\r\n fetchUsers: () => {\r\n dispatch(fetchUsers());\r\n },\r\n requestFinish: () => {\r\n dispatch(requestFinish());\r\n },\r\n requestStart: () => {\r\n dispatch(requestStart());\r\n },\r\n };\r\n};\r\n\r\ninterface PageAdminUsersProps {\r\n account: User;\r\n requesting: boolean;\r\n users: UserState;\r\n fetchCompanies: () => void;\r\n requestFinish: () => void;\r\n requestStart: () => void;\r\n fetchUsers: () => void;\r\n}\r\n\r\ntype State = {\r\n newUser: User;\r\n modalOpen: boolean;\r\n modalUser: User;\r\n};\r\n\r\ntype Action =\r\n | { type: 'change-newUser', newUser: Partial }\r\n | { type: 'modal-open', user: User }\r\n | { type: 'modal-close' };\r\n\r\nconst PageAdminUsersComponent: React.FC = (props) => {\r\n const initialState = {\r\n newUser: EMPTY_USER,\r\n modalOpen: false,\r\n modalUser: EMPTY_USER,\r\n };\r\n const [state, dispatch] = React.useReducer((state: State, action: Action) => {\r\n switch (action.type) {\r\n case 'modal-open':\r\n return { ...state, modalOpen: true, modalUser: action.user };\r\n case 'modal-close':\r\n return { ...state, modalOpen: false };\r\n case 'change-newUser':\r\n return {\r\n ...state,\r\n newUser: {\r\n ...state.newUser,\r\n ...action.newUser,\r\n }\r\n }\r\n default:\r\n return state;\r\n }\r\n }, initialState, undefined);\r\n\r\n React.useEffect(() => {\r\n fetchUsers();\r\n props.fetchCompanies();\r\n }, []);\r\n\r\n const fetchUsers = async () => {\r\n props.requestStart();\r\n props.fetchUsers();\r\n props.requestFinish();\r\n };\r\n\r\n const getUserCards = () => {\r\n const openModal = (event: any, user: User) => {\r\n event.preventDefault();\r\n dispatch({ type: 'modal-open', user });\r\n };\r\n\r\n return Object.values(props.users).map((user: User) => {\r\n return (\r\n \r\n )\r\n });\r\n };\r\n\r\n if (Object.keys(props.users).length > 0) {\r\n return (\r\n
\r\n

Users

\r\n
\r\n {getUserCards()}\r\n dispatch({ type: 'modal-close' })}\r\n user={state.modalUser} />\r\n
\r\n
\r\n );\r\n } else {\r\n if (props.requesting) {\r\n return
Fetching users.
;\r\n // TODO replace with spinner.\r\n } else {\r\n return
Error fetching users.
;\r\n // TODO add try again button.\r\n }\r\n }\r\n};\r\n\r\nconst PageAdminUsers = connect(mapStateToProps, mapDispatchToProps)(PageAdminUsersComponent);\r\n\r\nexport default PageAdminUsers;\r\n","import Axios from 'axios';\r\nimport React from 'react';\r\nimport { Button, Form, Modal } from 'react-bootstrap';\r\nimport { connect } from 'react-redux';\r\n\r\nimport { fillProjects } from '../../state/Project';\r\nimport Project, { ProjectState, TableGroupState, TableGroup } from '../../types/Project';\r\nimport Papa from 'papaparse';\r\nimport { AppState } from '../../state/Store';\r\nimport Category, { CategoryState, NameToCategoryMapping, CategoryCriteriaState } from '../../types/Category';\r\nimport { updateCategory, fillCategories } from '../../state/Category';\r\nimport { clearBallots } from '../../state/Ballot';\r\nimport { string } from 'prop-types';\r\n\r\nconst requiredHeaders = [\r\n 'Submission Title',\r\n 'Submission Url',\r\n 'Plain Description',\r\n 'Built With',\r\n 'Desired Prizes',\r\n];\r\n\r\nconst mapStateToProps = (state: AppState) => {\r\n return {\r\n tableGroups: state.tableGroups,\r\n categories: state.categories,\r\n };\r\n};\r\n\r\nconst mapDispatchToProps = (dispatch: any) => {\r\n return {\r\n fillCategories: (categories: CategoryState) => {\r\n dispatch(fillCategories(categories));\r\n },\r\n updateCategory: (categories: CategoryState) => {\r\n dispatch(updateCategory(categories));\r\n },\r\n fillProjects: (projects: ProjectState) => {\r\n dispatch(fillProjects(projects));\r\n },\r\n clearBallots: () => {\r\n dispatch(clearBallots());\r\n },\r\n };\r\n};\r\n\r\ninterface PageAdminProjectsUploadModalProps {\r\n categories: CategoryCriteriaState;\r\n modalOpen: boolean;\r\n tableGroups: TableGroupState;\r\n closeModal: () => void;\r\n clearBallots: () => void;\r\n updateCategory: (categories: CategoryState) => void;\r\n fillProjects: (projects: ProjectState) => void;\r\n fillCategories: (categories: CategoryState) => void;\r\n}\r\n\r\ntype State = {\r\n csv: string[][];\r\n csvHeaderIndicies: { [header: string]: number };\r\n requesting: boolean;\r\n totalProjectsToAccountFor: number;\r\n totalProjectsAccountedFor: number;\r\n inputNumberExpos: number;\r\n inputTableGroups: { [tableGroupID: number]: number };\r\n useSelfAssign: boolean;\r\n}\r\n\r\ntype Action =\r\n | { type: 'use-self-assign', enabled: boolean }\r\n | { type: 'adjust-totals', numberExpos: number }\r\n | { type: 'adjust-counts', tableGroups: { [tableGroupID: number]: number } }\r\n | { type: 'update-csv', csv: string[][], csvHeaderIndicies: { [header: string]: number } }\r\n | { type: 'request-start' }\r\n | { type: 'request-finish' };\r\n\r\nconst PageAdminProjectsUploadModalComponent: React.FC = (props) => {\r\n const initialState = {\r\n csv: [],\r\n csvHeaderIndicies: {},\r\n totalProjectsToAccountFor: -1,\r\n totalProjectsAccountedFor: 0,\r\n inputNumberExpos: 1,\r\n inputTableGroups: {},\r\n requesting: false,\r\n useSelfAssign: false,\r\n }\r\n\r\n const [state, dispatch] = React.useReducer((state: State, action: Action) => {\r\n switch (action.type) {\r\n case 'use-self-assign':\r\n return {\r\n ...state,\r\n useSelfAssign: action.enabled,\r\n };\r\n case 'adjust-totals':\r\n return {\r\n ...state,\r\n inputNumberExpos: action.numberExpos > 0 ? action.numberExpos : 1,\r\n totalProjectsToAccountFor: Math.ceil(state.csv.length / action.numberExpos)\r\n };\r\n case 'adjust-counts':\r\n const inputTableGroups = {\r\n ...state.inputTableGroups,\r\n ...action.tableGroups,\r\n };\r\n return {\r\n ...state,\r\n inputTableGroups,\r\n totalProjectsAccountedFor: Object.values(inputTableGroups).reduce((counter, curVal) => counter + curVal, 0),\r\n };\r\n case 'update-csv':\r\n return {\r\n ...state,\r\n csv: action.csv,\r\n csvHeaderIndicies: action.csvHeaderIndicies,\r\n totalProjectsToAccountFor: action.csv.length\r\n };\r\n case 'request-start':\r\n return { ...state, requesting: true };\r\n case 'request-finish':\r\n return { ...state, requesting: false };\r\n default:\r\n return state;\r\n }\r\n }, initialState, undefined);\r\n\r\n const effectInputTableGroups = props.tableGroups;\r\n\r\n React.useEffect(() => {\r\n const initialTableGroups: { [tableGroupID: number]: number } = {};\r\n for (const tableGroup of Object.values(props.tableGroups)) {\r\n initialTableGroups[tableGroup.id!] = 10;\r\n }\r\n dispatch({ type: 'adjust-counts', tableGroups: initialTableGroups });\r\n }, [effectInputTableGroups]);\r\n\r\n React.useEffect(() => {\r\n const initialFetch = async () => {\r\n // Fetch categories into state, just in case.\r\n const fetchCategoriesResult = await Axios.get('/api/categories/allCategoriesCriteria');\r\n if (fetchCategoriesResult.status) {\r\n const payload: CategoryState = fetchCategoriesResult.data;\r\n props.fillCategories(payload);\r\n } else {\r\n // TODO error checking\r\n }\r\n };\r\n\r\n initialFetch();\r\n }, []);\r\n\r\n const handleUpload = async () => {\r\n dispatch({ type: 'request-start' });\r\n\r\n props.fillProjects({});\r\n\r\n // Generate a set of all categories for optional prizes.\r\n const generatedCategories = new Set();\r\n for (const row of state.csv) {\r\n const categoriesString = row[state.csvHeaderIndicies['Desired Prizes']];\r\n if (categoriesString.length > 0) {\r\n const splitCategories = categoriesString.split(',');\r\n for (const category of splitCategories) {\r\n generatedCategories.add(category.trim());\r\n }\r\n }\r\n }\r\n\r\n // Check if the any of the generated categories is a preexisting nongenerated category.\r\n const existingCategoriesArray = Object.values(props.categories.categories).reduce((array: string[], category: Category) => {\r\n if (!category.generated) {\r\n array.push(category.name);\r\n }\r\n return array;\r\n }, []);\r\n for (const generatedCategory of Array.from(generatedCategories)) {\r\n for (const existingCategory of existingCategoriesArray) {\r\n if (existingCategory === generatedCategory) {\r\n generatedCategories.delete(generatedCategory);\r\n }\r\n }\r\n }\r\n\r\n // Delete all generated categories.\r\n const deleteGeneratedCategoriesResult = await Axios.delete('/api/categories/deleteGenerated');\r\n if (!deleteGeneratedCategoriesResult) {\r\n return;\r\n // TODO throw error couldn't reset generated categories.\r\n }\r\n\r\n // Create new generated categories.\r\n const categoriesToSend: Category[] = Array.from(generatedCategories).map((categoryName) => {\r\n return {\r\n name: categoryName,\r\n isDefault: false,\r\n generated: true,\r\n isHidden: false,\r\n description: `Sponsor prize generated when projects were uploaded. Do not remove. - ${categoryName}`,\r\n company: '',\r\n criteria: [],\r\n };\r\n });\r\n const addGeneratedCategoriesResult = await Axios.post('/api/categories/update', {\r\n categories: categoriesToSend,\r\n });\r\n if (!addGeneratedCategoriesResult.status) {\r\n return;\r\n // TODO throw error couldn't generate new categories.\r\n }\r\n const payload: CategoryState = addGeneratedCategoriesResult.data;\r\n const onlyNonGenerated: CategoryState = Object.values(props.categories.categories).reduce((dict: CategoryState, currentCategory: Category) => {\r\n if (!currentCategory.generated) {\r\n dict[currentCategory.id!] = currentCategory;\r\n }\r\n return dict;\r\n }, {});\r\n console.log('nongenerated', onlyNonGenerated, payload);\r\n const newCategories = {\r\n ...onlyNonGenerated,\r\n ...payload,\r\n };\r\n props.fillCategories({\r\n ...onlyNonGenerated,\r\n ...payload,\r\n });\r\n\r\n // Create category name to category mapping\r\n const nameToCategoryMapping: NameToCategoryMapping = Object.values(newCategories).reduce((dict: NameToCategoryMapping, currentCategory: Category) => {\r\n dict[currentCategory.name] = currentCategory;\r\n return dict;\r\n }, {});\r\n const defaultCategoryIDs: number[] = Object.values(newCategories).reduce((array: number[], category: Category) => {\r\n if (category.isDefault) {\r\n array.push(category.id!);\r\n }\r\n return array;\r\n }, []);\r\n\r\n const projectsToSend: Project[] = [];\r\n const tableGroups: TableGroup[] = Object.values(props.tableGroups);\r\n const tableGroupNameMapping = tableGroups.map((tableGroup) => tableGroup.name);\r\n const allocatedTables: { [table: string]: number } = {};\r\n\r\n if (state.useSelfAssign) {\r\n for (let i = 0; i < state.csv.length; i++) {\r\n const csvRow = state.csv[i];\r\n const tableNumber = csvRow[state.csvHeaderIndicies['Table Number']];\r\n if (tableNumber) {\r\n const tableParts = tableNumber.split(' ');\r\n if (tableParts.length !== 3) {\r\n throw new Error('Need 3 parts: expo, group, number');\r\n }\r\n\r\n if (allocatedTables[tableNumber]) {\r\n throw new Error('Duplicate table');\r\n }\r\n\r\n if (!tableGroupNameMapping.includes(tableParts[1])) {\r\n throw new Error('Invalid table group name');\r\n }\r\n\r\n allocatedTables[tableNumber] = i;\r\n }\r\n }\r\n }\r\n\r\n const allocatedRows = Object.values(allocatedTables);\r\n let csvRowNumber = 0;\r\n\r\n // Pass 2 allocate rest.\r\n for (let expoNumber = 1; expoNumber <= state.inputNumberExpos; expoNumber++) {\r\n for (const tableGroup of tableGroups) {\r\n for (let tableNumber = 1; tableNumber <= state.inputTableGroups[tableGroup.id!]; tableNumber++) {\r\n const finalTableGroupName = `${expoNumber} ${tableGroup.name} ${tableNumber}`;\r\n if (allocatedTables[finalTableGroupName] === undefined) {\r\n while (allocatedRows.includes(csvRowNumber)) {\r\n csvRowNumber++;\r\n }\r\n\r\n let csvRow = state.csv[csvRowNumber];\r\n // console.log(csvRow);\r\n if (csvRow) {\r\n allocatedTables[finalTableGroupName] = csvRowNumber;\r\n allocatedRows.push(csvRowNumber);\r\n csvRowNumber++;\r\n }\r\n } else {\r\n console.log('thegame', finalTableGroupName);\r\n }\r\n }\r\n }\r\n }\r\n\r\n console.log(allocatedTables, allocatedRows.sort((a: number, b: number) => a - b));\r\n const tableGroupNameToObject: { [name: string]: TableGroup } = Object.values(props.tableGroups).reduce((dict, tableGroup: TableGroup) => {\r\n dict[tableGroup.name] = tableGroup;\r\n return dict;\r\n }, {});\r\n\r\n for (const tableKey of Object.keys(allocatedTables)) {\r\n const csvRow = state.csv[allocatedTables[tableKey]];\r\n const parts = tableKey.split(' ');\r\n const devpostDesiredCategories: number[] = csvRow[state.csvHeaderIndicies['Desired Prizes']].split(',').reduce((array: number[], categoryName: string) => {\r\n categoryName = categoryName.trim();\r\n if (categoryName) {\r\n array.push(nameToCategoryMapping[categoryName.trim()].id!);\r\n }\r\n return array;\r\n }, []);\r\n projectsToSend.push({\r\n name: csvRow[state.csvHeaderIndicies['Submission Title']],\r\n devpostURL: csvRow[state.csvHeaderIndicies['Submission Url']],\r\n expoNumber: parseInt(parts[0]),\r\n roundNumber: 1,\r\n tableGroupID: tableGroupNameToObject[parts[1]].id!,\r\n tableNumber: parseInt(parts[2]),\r\n roomUrl: '',\r\n categoryIDs: devpostDesiredCategories.concat(defaultCategoryIDs),\r\n tags: [],\r\n });\r\n }\r\n\r\n console.log(projectsToSend);\r\n\r\n const batchUploadResult = await Axios.post('/api/projects/upload', {\r\n projects: projectsToSend,\r\n });\r\n if (batchUploadResult.status) {\r\n const data = batchUploadResult.data;\r\n // console.log(data);\r\n props.fillProjects(data);\r\n props.clearBallots();\r\n props.closeModal();\r\n dispatch({ type: 'request-finish' });\r\n }\r\n };\r\n\r\n const getFileUploadForm = () => {\r\n const throwError = (message: string) => {\r\n dispatch({ type: 'update-csv', csv: [], csvHeaderIndicies: {} });\r\n // console.log(message);\r\n // TODO throw real error.\r\n return;\r\n };\r\n\r\n const parseResult = (result: Papa.ParseResult) => {\r\n const csvData: string[][] = result.data;\r\n if (csvData.length < 1) {\r\n return throwError('Empty');\r\n }\r\n if (csvData.length === 1) {\r\n return throwError('No content');\r\n }\r\n const csvHeaders = csvData[0];\r\n const csvHeaderIndicies: { [header: string]: number } = {};\r\n for (const header of requiredHeaders) {\r\n const headerIndex = csvHeaders.indexOf(header);\r\n if (headerIndex === -1) {\r\n return throwError('Required headers missing');\r\n }\r\n csvHeaderIndicies[header] = headerIndex;\r\n }\r\n csvHeaderIndicies['Table Number'] = csvHeaders.indexOf('Table Number');\r\n csvData.splice(0, 1)\r\n dispatch({ type: 'update-csv', csv: csvData, csvHeaderIndicies });\r\n };\r\n\r\n const handleFileUpload = (event: any) => {\r\n const target = event.target;\r\n const fileList: FileList = target.files;\r\n if (fileList.length !== 1) {\r\n return throwError('No file or too many files.');\r\n }\r\n const file = fileList[0];\r\n if (!file.name.endsWith('.csv')) {\r\n return throwError('Not CSV');\r\n }\r\n Papa.parse(file, {\r\n complete: parseResult,\r\n skipEmptyLines: true,\r\n });\r\n };\r\n\r\n return (\r\n \r\n Devpost CSV\r\n \r\n \r\n Please download the CSV containing all projects from Devpost and upload it here.\r\n \r\n \r\n );\r\n };\r\n\r\n const getPropertiesForm = () => {\r\n if (state.csv.length > 0) {\r\n return (\r\n
\r\n \r\n Number of Expos\r\n {\r\n dispatch({ type: 'adjust-totals', numberExpos: event.target.value })\r\n }}\r\n type='number'\r\n value={\"\" + state.inputNumberExpos} />\r\n \r\n How many expos will there be at this event?\r\n \r\n \r\n {Object.values(props.tableGroups).map((tableGroup: TableGroup) => {\r\n return (\r\n \r\n # {tableGroup.name} Tables\r\n {\r\n dispatch({\r\n type: 'adjust-counts', tableGroups: {\r\n [tableGroup.id!]: +event.target.value\r\n }\r\n });\r\n }}\r\n type='number'\r\n value={\"\" + state.inputTableGroups[tableGroup.id!]} />\r\n \r\n How many tables are available in the {tableGroup.name} group in each expo?\r\n \r\n \r\n )\r\n })}\r\n

Projects Accounted For: {state.totalProjectsAccountedFor} / {state.totalProjectsToAccountFor}

\r\n \r\n dispatch({\r\n type: 'use-self-assign',\r\n enabled: event.target.value === 'on',\r\n })}\r\n type=\"checkbox\"\r\n label=\"Use Table Self-Assign\" />\r\n \r\n Check if you want to use the \"Table Number\" column in the Devpost submission.\r\n \r\n \r\n
\r\n );\r\n }\r\n };\r\n\r\n const closeModal = () => {\r\n dispatch({ type: 'update-csv', csv: [], csvHeaderIndicies: {} });\r\n props.closeModal();\r\n }\r\n\r\n return (\r\n \r\n \r\n Upload Projects\r\n \r\n \r\n
\r\n {getFileUploadForm()}\r\n {getPropertiesForm()}\r\n
\r\n
\r\n \r\n \r\n Close & Discard\r\n \r\n \r\n Upload Projects\r\n \r\n \r\n
\r\n );\r\n};\r\n\r\nconst PageAdminProjectsUploadModal = connect(\r\n mapStateToProps,\r\n mapDispatchToProps\r\n)(PageAdminProjectsUploadModalComponent);\r\n\r\nexport default PageAdminProjectsUploadModal;\r\n\r\n","import React from 'react';\r\nimport { Button, Form, Col } from 'react-bootstrap';\r\n\r\nimport { TableGroup } from '../../types/Project';\r\n\r\ninterface PageAdminProjectsManageTableGroupsModalGroupRowProps {\r\n tableGroup: TableGroup;\r\n requesting: boolean;\r\n updateTableGroup: (tableGroup: TableGroup) => void;\r\n deleteTableGroup: (tableGroupID: number) => void;\r\n}\r\n\r\nconst PageAdminProjectsManageTableGroupsModalGroupRow: React.FC = (props) => {\r\n const handleChange = (event: any) => {\r\n const target = event.target;\r\n props.updateTableGroup({\r\n ...props.tableGroup,\r\n [target.name]: target.value,\r\n });\r\n };\r\n\r\n\treturn (\r\n\t\t
\r\n
\r\n \r\n \r\n Table Group Name\r\n \r\n \r\n \r\n Shortcode\r\n \r\n \r\n \r\n Color\r\n \r\n \r\n \r\n props.deleteTableGroup(props.tableGroup.id!)}>\r\n Delete\r\n \r\n
\r\n\t);\r\n};\r\n\r\nexport default PageAdminProjectsManageTableGroupsModalGroupRow;\r\n\r\n","import Axios from 'axios';\r\nimport React from 'react';\r\nimport { Button, Form, Modal } from 'react-bootstrap';\r\nimport { connect } from 'react-redux';\r\n\r\nimport { TableGroupState, TableGroup, EMPTY_TABLE_GROUP } from '../../types/Project';\r\nimport { AppState } from '../../state/Store';\r\n\r\nimport PageAdminProjectsManageTableGroupsModalGroupRow from './PageAdminProjectsManageTableGroupsModalGroupRow';\r\nimport { fillTableGroups } from '../../state/TableGroup';\r\n\r\nconst mapStateToProps = (state: AppState) => {\r\n return {\r\n tableGroups: state.tableGroups,\r\n };\r\n};\r\n\r\nconst mapDispatchToProps = (dispatch: any) => {\r\n\treturn {\r\n\t\tfillTableGroups: (tableGroups: TableGroupState) => {\r\n\t\t\tdispatch(fillTableGroups(tableGroups));\r\n\t\t},\r\n\t};\r\n};\r\n\r\ninterface PageAdminProjectsManageTableGroupsModalProps {\r\n modalOpen: boolean;\r\n tableGroups: TableGroupState;\r\n closeModal: () => void;\r\n\tfillTableGroups: (tableGroups: TableGroupState) => void;\r\n}\r\n\r\ntype State = {\r\n currentNewID: number;\r\n tableGroups: TableGroupState;\r\n requesting: boolean;\r\n}\r\n\r\ntype Action =\r\n | { type: 'increase-new-id' }\r\n | { type: 'update-table-group', tableGroups: TableGroupState }\r\n\t| { type: 'request-start'}\r\n | { type: 'request-finish'};\r\n\r\nconst PageAdminProjectsManageTableGroupsModalComponent: React.FC = (props) => {\r\n\tconst [state, dispatch] = React.useReducer((state: State, action: Action) => {\r\n\t\tswitch (action.type) {\r\n case 'increase-new-id':\r\n return { ...state, currentNewID: state.currentNewID - 1 }\r\n case 'update-table-group':\r\n return { ...state, tableGroups: action.tableGroups };\r\n\t\t\tcase 'request-start':\r\n\t\t\t\treturn { ...state, requesting: true };\r\n\t\t\tcase 'request-finish':\r\n return { ...state, requesting: false };\r\n\t\t\tdefault:\r\n\t\t\t\treturn state;\r\n\t\t}\r\n\t}, {\r\n currentNewID: -1,\r\n tableGroups: {},\r\n requesting: false,\r\n }, undefined);\r\n\r\n const tableGroupsEffect = props.tableGroups;\r\n\r\n React.useEffect(() => {\r\n dispatch({ type: 'update-table-group', tableGroups: props.tableGroups });\r\n }, [tableGroupsEffect]);\r\n\r\n const handleSaveChanges = async () => {\r\n try {\r\n dispatch({ type: 'request-start' });\r\n const result = await Axios.post('/api/tableGroups/update', {\r\n tableGroups: Object.values(state.tableGroups),\r\n });\r\n if (result.status) {\r\n const data = result.data;\r\n props.fillTableGroups(data);\r\n props.closeModal();\r\n dispatch({ type: 'request-finish' });\r\n } else {\r\n // TODO add error checking.\r\n }\r\n } catch(error) {\r\n // TODO improve error handling.\r\n alert('Server error. Please try again.');\r\n window.location.reload();\r\n }\r\n };\r\n\r\n const getForm = () => {\r\n const updateTableGroup = (tableGroup: TableGroup) => {\r\n dispatch({\r\n type: 'update-table-group',\r\n tableGroups: {\r\n ...state.tableGroups,\r\n [tableGroup.id!]: tableGroup,\r\n },\r\n });\r\n };\r\n const deleteTableGroup = (tableGroupID: number) => {\r\n let {[tableGroupID]: omit, ...rest} = state.tableGroups;\r\n dispatch({\r\n type: 'update-table-group',\r\n tableGroups: rest,\r\n });\r\n };\r\n\r\n if (Object.values(state.tableGroups).length > 0) {\r\n return Object.values(state.tableGroups).map((tableGroup: TableGroup) => {\r\n return \r\n });\r\n }\r\n return
No Table Groups
;\r\n };\r\n\r\n const handleNewTableGroup = () => {\r\n const newGroup = {\r\n ...EMPTY_TABLE_GROUP,\r\n id: state.currentNewID,\r\n };\r\n dispatch({ type: 'increase-new-id' });\r\n dispatch({\r\n type: 'update-table-group',\r\n tableGroups: {\r\n ...state.tableGroups,\r\n [newGroup.id]: newGroup,\r\n }\r\n });\r\n };\r\n\r\n\treturn (\r\n\t\t\r\n \r\n Manage Table Groups\r\n \r\n \r\n

Table groups are how your expo will be organized. Table groups can be a color, some fancy name, or a room number. You must have at least one table group in order to upload projects.

\r\n
\r\n {getForm()}\r\n
\r\n \r\n New Table Group\r\n \r\n
\r\n \r\n \r\n Close\r\n \r\n \r\n Save Changes\r\n \r\n \r\n
\r\n\t);\r\n};\r\n\r\nconst PageAdminProjectsManageTableGroupsModal = connect(\r\n mapStateToProps,\r\n mapDispatchToProps\r\n)(PageAdminProjectsManageTableGroupsModalComponent);\r\n\r\nexport default PageAdminProjectsManageTableGroupsModal;\r\n\r\n","import React, { ReactElement } from 'react';\r\nimport { InputGroup, Card, FormControl, Accordion } from 'react-bootstrap';\r\nimport { connect } from 'react-redux';\r\n\r\nimport PageAdminProjectsEpicenterProjectDot from './PageAdminProjectsEpicenterProjectDot';\r\nimport PageAdminProjectsEpicenterEmptyDot from './PageAdminProjectsEpicenterEmptyDot';\r\nimport Project, { ProjectState, TableGroupState, ProjectWithHealth } from '../../types/Project';\r\nimport User from '../../types/User';\r\nimport { AppState } from '../../state/Store';\r\nimport Ballot, { BallotState, BallotStatus } from '../../types/Ballot';\r\nimport Category, { CategoryState, CategoryCriteriaState } from '../../types/Category';\r\nimport { queueProjectEmit, subscribeQueuedProject, subscribeQueueProject, queueProject, subscribeGetProject, subscribeScoreProject, unsubscribeAll, subscribeSkipProject, subscribeMissingProject, subscribeBusyProject } from '../../state/Ballot';\r\nimport { requestStart, requestFinish } from '../../state/Request';\r\nimport { UserState } from '../../types/User';\r\nimport { Button } from 'react-bootstrap';\r\nimport Axios from \"axios\";\r\n\r\nconst mapStateToProps = (state: AppState) => {\r\n return {\r\n account: state.account,\r\n ballots: state.ballots,\r\n categories: state.categories,\r\n tableGroups: state.tableGroups,\r\n projects: state.projects,\r\n users: state.users,\r\n };\r\n};\r\n\r\nconst mapDispatchToProps = (dispatch: any) => {\r\n return {\r\n queueProject: (projectID: number, userID: number) => {\r\n dispatch(queueProject(projectID, userID));\r\n },\r\n queueProjectEmit: (projectID: number, userID: number) => {\r\n dispatch(queueProjectEmit(projectID, userID));\r\n },\r\n subscribeQueueProject: () => {\r\n dispatch(subscribeQueueProject());\r\n },\r\n subscribeQueuedProject: () => {\r\n dispatch(subscribeQueuedProject());\r\n },\r\n subscribeGotProject: () => {\r\n dispatch(subscribeGetProject());\r\n },\r\n subscribeScoreProject: () => {\r\n dispatch(subscribeScoreProject());\r\n },\r\n subscribeSkipProject: () => {\r\n dispatch(subscribeSkipProject());\r\n },\r\n subscribeMissingProject: () => {\r\n dispatch(subscribeMissingProject());\r\n },\r\n subscribeBusyProject: () => {\r\n dispatch(subscribeBusyProject());\r\n },\r\n unsubscribeAll: () => {\r\n dispatch(unsubscribeAll());\r\n },\r\n requestFinish: () => {\r\n dispatch(requestFinish());\r\n },\r\n requestStart: () => {\r\n dispatch(requestStart());\r\n },\r\n };\r\n};\r\n\r\ninterface PageAdminProjectsEpicenterProps {\r\n account: User;\r\n ballots: BallotState;\r\n categories: CategoryCriteriaState;\r\n projects: ProjectState;\r\n tableGroups: TableGroupState;\r\n users: UserState;\r\n queueProject: (projectID: number, userID: number) => void;\r\n queueProjectEmit: (projectID: number, userID: number) => void;\r\n subscribeQueueProject: () => void;\r\n subscribeQueuedProject: () => void;\r\n subscribeGotProject: () => void;\r\n subscribeScoreProject: () => void;\r\n subscribeMissingProject: () => void;\r\n subscribeBusyProject: () => void;\r\n subscribeSkipProject: () => void;\r\n unsubscribeAll: () => void;\r\n requestFinish: () => void;\r\n requestStart: () => void;\r\n}\r\n\r\nenum SortType {\r\n Location,\r\n AverageScore,\r\n ProjectHealth,\r\n TimesJudged,\r\n}\r\n\r\ntype State = {\r\n selectedProject: string;\r\n judgeSelectedProject: string;\r\n currentExpo: number;\r\n currentRound: number;\r\n powerGoodness: number;\r\n powerVariance: number;\r\n powerSkip: number;\r\n projects: { [projectID: number]: ProjectWithHealth };\r\n sortBy: SortType;\r\n filterBy: number | undefined;\r\n}\r\n\r\ntype Action =\r\n | { type: 'change-current-expo', currentExpo: number }\r\n | { type: 'change-current-round', currentRound: number }\r\n | { type: 'change-selected-project', projectID: string }\r\n | { type: 'change-judge-selected-project', projectID: string }\r\n | { type: 'change-parameters', goodness: number, variance: number, skip: number }\r\n | { type: 'change-sort-by', sortBy: SortType }\r\n | { type: 'change-filter-by', filterBy: number | undefined }\r\n | { type: 'update-projects', projects: { [projectID: number]: ProjectWithHealth } };\r\n\r\nconst PageAdminProjectsEpicenterComponent: React.FC = (props) => {\r\n const [state, dispatch] = React.useReducer((state: State, action: Action) => {\r\n switch (action.type) {\r\n case 'change-current-expo':\r\n return { ...state, currentExpo: action.currentExpo > 0 ? action.currentExpo : 1 };\r\n case 'change-current-round':\r\n return { ...state, currentRound: action.currentRound > 0 ? action.currentRound : 1 };\r\n case 'change-selected-project':\r\n return { ...state, selectedProject: action.projectID, judgeSelectedProject: '' };\r\n case 'change-judge-selected-project':\r\n return { ...state, selectedProject: '', judgeSelectedProject: action.projectID };\r\n case 'change-sort-by':\r\n return { ...state, sortBy: action.sortBy };\r\n case 'change-filter-by':\r\n return { ...state, filterBy: action.filterBy };\r\n case 'update-projects':\r\n return { ...state, projects: action.projects };\r\n case 'change-parameters':\r\n return {\r\n ...state,\r\n powerGoodness: action.goodness > 0 ? action.goodness : 0,\r\n powerVariance: action.variance > 0 ? action.variance : 0,\r\n powerSkip: action.skip > 0 ? action.skip : 0,\r\n };\r\n default:\r\n return state;\r\n }\r\n }, {\r\n currentExpo: 1,\r\n currentRound: 1,\r\n selectedProject: '',\r\n judgeSelectedProject: '',\r\n powerGoodness: 0.5,\r\n powerSkip: 0.5,\r\n powerVariance: 0.5,\r\n projects: {},\r\n sortBy: SortType.Location,\r\n filterBy: undefined,\r\n });\r\n\r\n React.useEffect(() => {\r\n const projectsWithHealth: { [projectID: number]: ProjectWithHealth } = {};\r\n for (const projectID of Object.keys(props.projects)) {\r\n projectsWithHealth[+projectID] = {\r\n ...props.projects[+projectID],\r\n health: calculateProjectHealth(props.projects[+projectID]),\r\n }\r\n }\r\n dispatch({ type: 'update-projects', projects: projectsWithHealth });\r\n }, [props.projects, state.powerGoodness, state.powerSkip, state.powerVariance, props.ballots]);\r\n\r\n const calculateProjectHealth = (project: Project) => {\r\n let totalHealth = 0;\r\n\r\n /* \r\n // This block checks the number of times a project has been judged for the default category\r\n\r\n // If project has already been judged\r\n if (props.ballots.dProjectScores[project.id!] && Object.values(props.ballots.dProjectScores[project.id!]).length > 0) {\r\n const categoryScoreArrays: { [userID: number]: number } = {};\r\n const allUserBallots = Object.values(props.ballots.dProjectScores[project.id!]);\r\n // The default prize category\r\n let defaultCategoryID = Object.values(props.categories.categories).filter((category: Category) => {\r\n return category.isDefault\r\n })[0].id;\r\n console.log('default', defaultCategoryID);\r\n // Iterate over all ballots for project\r\n for (const userBallots of allUserBallots) {\r\n // Get the ballot associated with that judgement\r\n for (const ballot of userBallots) {\r\n // If the judge was for the default category (i.e. overall hackgt or how all judging is in healthtech)\r\n if (props.categories.criteria[ballot.criteriaID].categoryID === defaultCategoryID) {\r\n // If the judge hasn't been put into the map\r\n if (!categoryScoreArrays[ballot.userID]) {\r\n categoryScoreArrays[ballot.userID] = 0;\r\n }\r\n // Add the judge's id -> score into the map\r\n categoryScoreArrays[ballot.userID] += ballot.score;\r\n }\r\n }\r\n }\r\n\r\n console.log('calcProjectHe', categoryScoreArrays);\r\n // Add the number of times the project has been judged\r\n totalHealth += Object.values(categoryScoreArrays).length;\r\n }\r\n */\r\n\r\n for (const judgeQueue of Object.values(props.ballots.dJudgeQueues)) {\r\n // If project is in the queue increase the health by 1\r\n if (judgeQueue.queuedProject && judgeQueue.queuedProject.id === project.id!) {\r\n totalHealth++;\r\n }\r\n\r\n // If project is currently being judged increase health by 2\r\n if (judgeQueue.activeProjectID === project.id!) {\r\n totalHealth += 2;\r\n }\r\n\r\n // If judge already judged this project\r\n if (judgeQueue.otherProjectIDs.includes(project.id!)) {\r\n totalHealth += 2;\r\n }\r\n }\r\n\r\n return totalHealth;\r\n }\r\n\r\n const autoAssign = () => {\r\n // get users who are judges\r\n const userIDs = Object.keys(props.users).map((value) => parseInt(value)).reduce((judgingUsers: number[], userID) => {\r\n // check that user ID is an approved judge\r\n if (props.users[userID].isJudging!) {\r\n // check that judge's user ID is not in judge queues\r\n // or does not have a queued project\r\n // or has a queued project with ID = 0\r\n if (!props.ballots.dJudgeQueues[userID]\r\n || props.ballots.dJudgeQueues[userID].queuedProject === undefined\r\n || props.ballots.dJudgeQueues[userID].queuedProject.id === 0) {\r\n judgingUsers.push(userID);\r\n }\r\n }\r\n return judgingUsers;\r\n }, []);\r\n console.log(\"User IDS\", userIDs);\r\n // check that there is at least one judge that we can assign the project to\r\n if (userIDs.length > 0) {\r\n // pick a random judge\r\n const randomUserID = userIDs[Math.floor(Math.random() * userIDs.length)];\r\n console.log(\"Random judge\", randomUserID);\r\n let judgeCompany = props.users[randomUserID].company!\r\n // get projects that can be assigned to a judge\r\n const canAssignProjects = Object.values(state.projects).filter((project: Project) => {\r\n // check that project is in current expo & round\r\n if (project.expoNumber != state.currentExpo || project.roundNumber !== state.currentRound) {\r\n return false;\r\n }\r\n\r\n // check that project is not currently assigned to the judge or in the judge's queue\r\n if (props.ballots.dJudgeQueues[randomUserID]) {\r\n if (project.id! === props.ballots.dJudgeQueues[randomUserID].activeProjectID\r\n || props.ballots.dJudgeQueues[randomUserID].otherProjectIDs.includes(project.id!)) {\r\n return false;\r\n }\r\n }\r\n // map projects to companies\r\n const projectCompanyList = project.categoryIDs.map((categoryID: number) => {\r\n return props.categories.categories[categoryID].company;\r\n });\r\n // return projects that match the judge's company\r\n return projectCompanyList.includes(props.users[randomUserID].company!);\r\n // sort projects by health\r\n }).sort((a: ProjectWithHealth, b: ProjectWithHealth) => {\r\n // return a.health - b.health;\r\n return calculateProjectCompanyHealth(a, judgeCompany) - calculateProjectCompanyHealth(b, judgeCompany)\r\n });\r\n console.log(\"Projects to be assigned\", canAssignProjects);\r\n\r\n if (canAssignProjects.length > 0) {\r\n // get lowest health value\r\n // const lowestHealth = canAssignProjects[0].health;\r\n const lowestHealth = calculateProjectCompanyHealth(canAssignProjects[0], judgeCompany);\r\n // get projects with health = lowest health value\r\n const sameLowestHealthProjects = canAssignProjects.filter((project: ProjectWithHealth) => {\r\n // return project.health === lowestHealth;\r\n return calculateProjectCompanyHealth(project, judgeCompany) === lowestHealth;\r\n });\r\n\r\n // randomly pick project to assign from among projects with health = lowest health value\r\n // assign project to judge\r\n queueProject(sameLowestHealthProjects[Math.floor(Math.random() * sameLowestHealthProjects.length)].id!, randomUserID);\r\n }\r\n }\r\n };\r\n\r\n // Calculates the health of a project for a certain company\r\n const calculateProjectCompanyHealth = (project: Project, company: string): number => {\r\n let categoryHealth = 0;\r\n\r\n // Iterate over all judges\r\n for (const judgeID of Object.keys(props.ballots.dJudgeQueues).map(Number)) {\r\n // If the judge is not of the same company\r\n if (props.users[judgeID].company! !== company) {\r\n continue\r\n }\r\n let judgeQueue = props.ballots.dJudgeQueues[judgeID];\r\n // If project is in the queue increase the health by 1\r\n if (judgeQueue.queuedProject && judgeQueue.queuedProject.id === project.id!) {\r\n categoryHealth++;\r\n }\r\n\r\n // If project is currently being judged increase health by 2\r\n if (judgeQueue.activeProjectID === project.id!) {\r\n categoryHealth += 2;\r\n }\r\n\r\n // If judge already judged this project\r\n if (judgeQueue.otherProjectIDs.includes(project.id!)) {\r\n categoryHealth += 2;\r\n }\r\n }\r\n return categoryHealth;\r\n }\r\n\r\n const calculateProjectScore = (projectId: number): number => {\r\n if (!props.ballots.dProjectScores[projectId!]) {\r\n return 0;\r\n }\r\n\r\n const categoryScoreArrays: { [projectID: number]: { [userID: number]: number } } = {\r\n [projectId!]: {}\r\n };\r\n const defaultCategoryID = Object.values(props.categories.categories).filter((category: Category) => {\r\n return state.filterBy ? category.id! === state.filterBy : category.isDefault;\r\n })[0].id;\r\n const allUserBallots = Object.values(props.ballots.dProjectScores[projectId!]);\r\n for (const userBallots of allUserBallots) {\r\n for (const ballot of userBallots) {\r\n if (ballot.status === BallotStatus.Submitted) {\r\n if (props.categories.criteria[ballot.criteriaID].categoryID === defaultCategoryID) {\r\n if (!categoryScoreArrays[ballot.projectID][ballot.userID]) {\r\n categoryScoreArrays[ballot.projectID][ballot.userID] = 0;\r\n }\r\n\r\n categoryScoreArrays[ballot.projectID][ballot.userID] += ballot.score;\r\n }\r\n }\r\n }\r\n }\r\n\r\n const catScoreArrays = Object.values(categoryScoreArrays[projectId!]);\r\n const score = catScoreArrays.reduce((total, score) => total + score, 0) / (catScoreArrays.length > 0 ? catScoreArrays.length : 1);\r\n console.log(score);\r\n return score;\r\n }\r\n\r\n const moveProjectsToRound2 = async () => {\r\n const projects = [];\r\n for (const projectId of Object.keys(props.projects)) {\r\n if (calculateProjectScore(parseInt(projectId)) >= 0.5) {\r\n projects.push(props.projects[parseInt(projectId)]);\r\n }\r\n }\r\n const newRoundNumber = 2;\r\n try {\r\n const result = await Axios.post('/api/projects/changeProjectRounds', {\r\n projects,\r\n newRoundNumber\r\n });\r\n if (result.status) {\r\n alert('Projects moved to round 2!');\r\n window.location.reload();\r\n }\r\n } catch (error) {\r\n alert('Error moving projects!');\r\n console.log(error);\r\n return Promise.resolve();\r\n }\r\n }\r\n\r\n document.onkeypress = (event: any) => {\r\n if (event.key === ' ') {\r\n event.preventDefault();\r\n autoAssign();\r\n }\r\n }\r\n\r\n React.useEffect(() => {\r\n const onClick = (event: any) => {\r\n console.log(event.target.className);\r\n if (event.target.className !== 'dot' && !event.target.className.includes('judge')) {\r\n dismissPopover();\r\n }\r\n };\r\n const keydown = (event: any) => {\r\n if (event.key === 'Escape') {\r\n dismissPopover();\r\n }\r\n };\r\n\r\n document.addEventListener('mousedown', onClick);\r\n document.addEventListener('keydown', keydown);\r\n props.subscribeQueueProject();\r\n props.subscribeQueuedProject();\r\n props.subscribeGotProject();\r\n props.subscribeScoreProject();\r\n props.subscribeBusyProject();\r\n props.subscribeMissingProject();\r\n props.subscribeSkipProject();\r\n\r\n return () => {\r\n document.removeEventListener('mousedown', onClick);\r\n document.removeEventListener('keydown', keydown);\r\n props.unsubscribeAll();\r\n };\r\n }, []);\r\n\r\n const queueProject = (projectID: number, userID: number) => {\r\n props.queueProject(projectID, userID);\r\n props.queueProjectEmit(projectID, userID);\r\n };\r\n\r\n const dismissPopover = () => {\r\n dispatch({\r\n type: 'change-selected-project',\r\n projectID: '',\r\n });\r\n };\r\n\r\n const _getProjects = () => {\r\n const _handleSelectedProjectChange = async (projectID: string) => {\r\n if (state.selectedProject === projectID) {\r\n dispatch({ type: 'change-selected-project', projectID: '' });\r\n } else {\r\n dispatch({ type: 'change-selected-project', projectID });\r\n }\r\n };\r\n\r\n if (Object.values(props.tableGroups).length > 0 && Object.values(state.projects).length > 0) {\r\n // TODO sort projects by health, instead of just score.\r\n const projectCircles = Object.values(state.projects)\r\n .filter((project: ProjectWithHealth) => {\r\n return state.filterBy ? project.categoryIDs.includes(state.filterBy) : true;\r\n })\r\n .sort((a: ProjectWithHealth, b: ProjectWithHealth) => {\r\n switch (state.sortBy) {\r\n case SortType.AverageScore:\r\n if (!props.ballots.dProjectScores[a.id!] && !props.ballots.dProjectScores[b.id!]) {\r\n return 0;\r\n }\r\n if (!props.ballots.dProjectScores[b.id!]) {\r\n return -1;\r\n }\r\n if (!props.ballots.dProjectScores[a.id!]) {\r\n return 1;\r\n }\r\n\r\n const categoryScoreArrays: { [projectID: number]: { [userID: number]: number } } = {\r\n [a.id!]: {},\r\n [b.id!]: {},\r\n };\r\n const defaultCategoryID = Object.values(props.categories.categories).filter((category: Category) => {\r\n return state.filterBy ? category.id! === state.filterBy : category.isDefault;\r\n })[0].id;\r\n const allUserBallots = Object.values(props.ballots.dProjectScores[a.id!]).concat(Object.values(props.ballots.dProjectScores[b.id!]));\r\n for (const userBallots of allUserBallots) {\r\n for (const ballot of userBallots) {\r\n if (ballot.status === BallotStatus.Submitted) {\r\n if (props.categories.criteria[ballot.criteriaID].categoryID === defaultCategoryID) {\r\n if (!categoryScoreArrays[ballot.projectID][ballot.userID]) {\r\n categoryScoreArrays[ballot.projectID][ballot.userID] = 0;\r\n }\r\n\r\n categoryScoreArrays[ballot.projectID][ballot.userID] += ballot.score;\r\n }\r\n }\r\n }\r\n }\r\n\r\n const aCatScoreArrays = Object.values(categoryScoreArrays[a.id!]);\r\n const bCatScoreArrays = Object.values(categoryScoreArrays[b.id!]);\r\n console.log(aCatScoreArrays, bCatScoreArrays);\r\n\r\n const aScore = aCatScoreArrays.reduce((total, score) => total + score, 0) / (aCatScoreArrays.length > 0 ? aCatScoreArrays.length : 1);\r\n const bScore = bCatScoreArrays.reduce((total, score) => total + score, 0) / (bCatScoreArrays.length > 0 ? bCatScoreArrays.length : 1);\r\n // console.log(Object.values(categoryScoreArrays[a.id!]).length);\r\n console.log(aScore, bScore);\r\n return aScore < bScore ? 1 : -1;\r\n case SortType.ProjectHealth:\r\n return a.health - b.health;\r\n default:\r\n return ((a.tableGroupID * 1000) + a.tableNumber) - ((b.tableGroupID * 1000) + b.tableNumber);\r\n }\r\n })\r\n .reduce((output: ReactElement[], project: ProjectWithHealth) => {\r\n const tableGroup = props.tableGroups[project.tableGroupID];\r\n if (project.expoNumber === state.currentExpo && project.roundNumber === state.currentRound) {\r\n output.push(\r\n \r\n );\r\n }\r\n return output;\r\n }, []);\r\n\r\n if (projectCircles.length === 0) {\r\n return

No projects in this expo/round.

;\r\n }\r\n\r\n return projectCircles;\r\n }\r\n };\r\n\r\n const _getJudges = () => {\r\n const _handleJudgeSelection = (userID: number) => {\r\n console.log(state.selectedProject);\r\n if (state.selectedProject.length === 0) {\r\n return null;\r\n }\r\n\r\n if (\r\n props.ballots.dJudgeQueues[userID]\r\n && props.ballots.dJudgeQueues[userID].activeProjectID === +state.selectedProject\r\n || props.ballots.dJudgeQueues[userID]\r\n && props.ballots.dJudgeQueues[userID].otherProjectIDs.includes(+state.selectedProject)\r\n ) {\r\n return null;\r\n }\r\n\r\n if (props.projects[+state.selectedProject].categoryIDs.map((categoryID: number) => {\r\n return props.categories.categories[categoryID].company === props.users[userID].company!;\r\n }).includes(true)) {\r\n queueProject(+state.selectedProject, userID);\r\n dismissPopover();\r\n } else {\r\n // TOOD error\r\n }\r\n };\r\n\r\n const _handleJudgeSelectedProject = async (projectID: string) => {\r\n if (state.judgeSelectedProject === projectID) {\r\n dispatch({ type: 'change-judge-selected-project', projectID: '' });\r\n } else {\r\n dispatch({ type: 'change-judge-selected-project', projectID });\r\n }\r\n };\r\n\r\n const _getDerivedProjects = (userID: number) => {\r\n const toReturn = [];\r\n if (props.ballots.dJudgeQueues[userID]) {\r\n\r\n const queuedProject = props.ballots.dJudgeQueues[userID].queuedProject;\r\n if (queuedProject && queuedProject.id !== 0 && props.projects[queuedProject.id]) {\r\n toReturn.push(\r\n {\r\n console.log(event.type);\r\n event.preventDefault();\r\n // TODO dequeue project here.\r\n return false;\r\n }}\r\n handleSelectedProjectChange={() => _handleJudgeSelectedProject(queuedProject.id + ' ' + userID)}\r\n />\r\n );\r\n } else {\r\n toReturn.push(\r\n \r\n )\r\n }\r\n\r\n const activeProjectID = props.ballots.dJudgeQueues[userID].activeProjectID;\r\n if (activeProjectID && props.projects[activeProjectID]) {\r\n toReturn.push(\r\n _handleJudgeSelectedProject(activeProjectID + ' ' + userID)}\r\n />\r\n );\r\n } else {\r\n toReturn.push(\r\n \r\n )\r\n }\r\n\r\n const otherProjectIDs = props.ballots.dJudgeQueues[userID].otherProjectIDs;\r\n if (otherProjectIDs) {\r\n const other = [];\r\n for (const projectID of otherProjectIDs) {\r\n if (props.projects[projectID]) {\r\n other.push(\r\n _handleJudgeSelectedProject(projectID + ' ' + userID)}\r\n />\r\n );\r\n }\r\n }\r\n toReturn.push(other.reverse());\r\n }\r\n } else {\r\n toReturn.push([\r\n ,\r\n ,\r\n ]);\r\n }\r\n\r\n return toReturn;\r\n };\r\n\r\n return Object.values(props.users).sort((a: User, b: User) => {\r\n return a.company! < b.company! ? -1 : 1;\r\n }).reduce((toShow: ReactElement[], user: User) => {\r\n if (user.isJudging) {\r\n toShow.push(\r\n _handleJudgeSelection(user.id!)}>\r\n \r\n {user.name}\r\n \r\n {user.company}\r\n \r\n
\r\n {_getDerivedProjects(user.id!)}\r\n
\r\n
\r\n \r\n );\r\n }\r\n return toShow;\r\n }, []);\r\n };\r\n\r\n return (\r\n <>\r\n \r\n \r\n \r\n Filter/Sort\r\n \r\n \r\n \r\n

Sort

\r\n \r\n \r\n \r\n \r\n

\r\n Currently sorting By {SortType[state.sortBy]}\r\n

\r\n

Filter

\r\n {Object.values(props.categories.categories).reduce((buttons: ReactElement[], category: Category) => {\r\n if (!category.generated) {\r\n buttons.push(\r\n dispatch({\r\n type: 'change-filter-by',\r\n filterBy: category.id,\r\n })}>By {category.name}\r\n );\r\n }\r\n return buttons;\r\n }, [])}\r\n {state.filterBy &&\r\n

\r\n Currently filtering By {Object.values(props.categories.categories)\r\n .find((category: Category) => {return category.id === state.filterBy}).name}\r\n

\r\n }\r\n
\r\n
\r\n
\r\n \r\n \r\n Expo {state.currentExpo} | Round {state.currentRound}\r\n {/* | Goodness {state.powerGoodness} | Variance {state.powerVariance} | Skip {state.powerSkip} */}\r\n \r\n \r\n \r\n \r\n Expo #\r\n dispatch({ type: 'change-current-expo', currentExpo: +event.target.value })}\r\n type='number'\r\n value={\"\" + state.currentExpo} />\r\n \r\n \r\n Round #\r\n dispatch({ type: 'change-current-round', currentRound: +event.target.value })}\r\n type='number'\r\n value={\"\" + state.currentRound} />\r\n \r\n {/* \r\n Goodness Power\r\n dispatch({\r\n type: 'change-parameters',\r\n goodness: +event.target.value,\r\n variance: state.powerVariance,\r\n skip: state.powerSkip,\r\n })}\r\n step='0.1'\r\n type='number'\r\n value={\"\" + state.powerGoodness} />\r\n \r\n

Good projects with >= 2 judges have lower health. Multiplier is taken to the (times judged * goodness power) power. 0 to disable.

\r\n \r\n Variance Power\r\n dispatch({\r\n type: 'change-parameters',\r\n goodness: state.powerGoodness,\r\n variance: +event.target.value,\r\n skip: state.powerSkip,\r\n })}\r\n step='0.1'\r\n type='number'\r\n value={\"\" + state.powerVariance} />\r\n \r\n

Higher-variance projects with >= 2 judges have lower health. (5 / (5 + sstdev)) to the variancePower. 0 to disable.

\r\n \r\n Skip Power\r\n dispatch({\r\n type: 'change-parameters',\r\n goodness: state.powerGoodness,\r\n variance: state.powerVariance,\r\n skip: +event.target.value,\r\n })}\r\n step='0.1'\r\n type='number'\r\n value={\"\" + state.powerSkip} />\r\n \r\n

Twice-skipped projects have lower health. Multiplier is (# skipped) to the skipPower. 0 to disable.

*/}\r\n
\r\n
\r\n
\r\n \r\n \r\n Bulk Move Projects\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n
\r\n {_getProjects()}\r\n
\r\n
\r\n {_getJudges()}\r\n
\r\n \r\n );\r\n};\r\n\r\nconst PageAdminProjectsEpicenter = connect(mapStateToProps, mapDispatchToProps)(PageAdminProjectsEpicenterComponent);\r\n\r\nexport default PageAdminProjectsEpicenter;\r\n","import React from 'react';\r\nimport { Button, Form, Modal } from 'react-bootstrap';\r\nimport { connect } from 'react-redux';\r\n\r\nimport { fillProjects } from '../../state/Project';\r\nimport { ProjectState } from '../../types/Project';\r\n\r\nconst mapDispatchToProps = (dispatch: any) => {\r\n\treturn {\r\n\t\tfillProjects: (projects: ProjectState) => {\r\n\t\t\tdispatch(fillProjects(projects));\r\n\t\t},\r\n\t};\r\n};\r\n\r\ninterface PageAdminProjectsAddProjectModalProps {\r\n modalOpen: boolean;\r\n closeModal: () => void;\r\n\tfillProjects: (projects: ProjectState) => void;\r\n}\r\n\r\ntype State = {\r\n requesting: boolean;\r\n}\r\n\r\ntype Action =\r\n\t| { type: 'request-start'}\r\n | { type: 'request-finish'};\r\n\r\nconst PageAdminProjectsAddProjectModalComponent: React.FC = (props) => {\r\n\tconst [state, dispatch] = React.useReducer((state: State, action: Action) => {\r\n\t\tswitch (action.type) {\r\n\t\t\tcase 'request-start':\r\n\t\t\t\treturn { ...state, requesting: true };\r\n\t\t\tcase 'request-finish':\r\n return { ...state, requesting: false };\r\n\t\t\tdefault:\r\n\t\t\t\treturn state;\r\n\t\t}\r\n\t}, {\r\n requesting: false,\r\n }, undefined);\r\n\r\n const handleSaveChanges = async () => {\r\n dispatch({ type: 'request-start' });\r\n // const result = await Axios.post('/api/categories/update', {\r\n // });\r\n // if (result.status) {\r\n // const data = result.data;\r\n // props.closeModal();\r\n // dispatch({ type: 'request-finish' });\r\n // } else {\r\n // // TODO add error checking.\r\n // }\r\n };\r\n\r\n const getForm = () => {\r\n return (\r\n
\r\n \r\n Devpost CSV\r\n \r\n \r\n Please download the CSV containing all projects from Devpost and upload it here.\r\n \r\n \r\n
\r\n );\r\n };\r\n\r\n\treturn (\r\n\t\t\r\n \r\n Add Project\r\n \r\n \r\n {getForm()}\r\n \r\n \r\n \r\n Close\r\n \r\n \r\n Save Changes\r\n \r\n \r\n \r\n\t);\r\n};\r\n\r\nconst PageAdminProjectsAddProjectModal = connect(null, mapDispatchToProps)(PageAdminProjectsAddProjectModalComponent);\r\n\r\nexport default PageAdminProjectsAddProjectModal;\r\n\r\n","import React, { ReactElement } from 'react';\r\nimport { Badge, Button, Overlay, Popover, Spinner } from 'react-bootstrap';\r\nimport Project, { ProjectWithHealth, TableGroup } from '../../types/Project';\r\nimport { AppState } from '../../state/Store';\r\nimport { connect } from 'react-redux';\r\nimport { CategoryCriteriaState } from '../../types/Category';\r\nimport { BallotState } from '../../types/Ballot';\r\nimport { changeProjectRound } from \"../../state/Project\";\r\n\r\nconst mapStateToProps = (state: AppState) => {\r\n return {\r\n categories: state.categories,\r\n ballots: state.ballots,\r\n };\r\n};\r\n\r\nconst mapDispatchToProps = (dispatch: any) => {\r\n return {\r\n changeProjectRound: (project: Project, newRoundNumber: number) => {\r\n dispatch(changeProjectRound(project, newRoundNumber));\r\n }\r\n }\r\n}\r\n\r\ninterface PageAdminProjectsEpicenterProjectDotProps {\r\n ballots: BallotState;\r\n dimmed: boolean;\r\n categories: CategoryCriteriaState;\r\n loading: boolean;\r\n tableGroup: TableGroup;\r\n project: ProjectWithHealth;\r\n selectedProject: string;\r\n userID: number;\r\n onClick?: (event: any) => void;\r\n onContextMenu?: (event: any) => void;\r\n handleSelectedProjectChange: (projectID: string) => void;\r\n changeProjectRound: (project: Project, newRoundNumber: number) => void;\r\n}\r\n\r\nconst PageAdminProjectsEpicenterProjectDotComponent: React.FC = (props) => {\r\n const ref: any = React.useRef(React.createRef());\r\n\r\n const _getOverlay = () => {\r\n const categoryScoreArrays: {\r\n [categoryID: number]: {\r\n [userID: number]: number;\r\n };\r\n } = {};\r\n if (props.ballots.dProjectScores[props.project.id!] && Object.values(props.ballots.dProjectScores[props.project.id!]).length > 0 && Object.values(props.categories.criteria).length > 0) {\r\n const allUserBallots = Object.values(props.ballots.dProjectScores[props.project.id!]);\r\n for (const userBallots of allUserBallots) {\r\n for (const ballot of userBallots) {\r\n if (!categoryScoreArrays[props.categories.criteria[ballot.criteriaID].categoryID]) {\r\n categoryScoreArrays[props.categories.criteria[ballot.criteriaID].categoryID] = {};\r\n }\r\n\r\n if (!categoryScoreArrays[props.categories.criteria[ballot.criteriaID].categoryID][ballot.userID]) {\r\n categoryScoreArrays[props.categories.criteria[ballot.criteriaID].categoryID][ballot.userID] = 0;\r\n }\r\n\r\n categoryScoreArrays[props.categories.criteria[ballot.criteriaID].categoryID][ballot.userID] += ballot.score;\r\n }\r\n }\r\n }\r\n\r\n const _changeRound = (difference: number) => {\r\n props.changeProjectRound(props.project, props.project.roundNumber + difference);\r\n }\r\n\r\n return (\r\n \r\n \r\n {props.project.name}\r\n

{props.project.devpostURL}
\r\n {props.project.categoryIDs.reduce((badges: ReactElement[], categoryID: number) => {\r\n if (props.categories.categories[categoryID]) {\r\n const badgeVariant =\r\n props.categories.categories[categoryID].generated\r\n ? 'secondary'\r\n : props.categories.categories[categoryID].isDefault\r\n ? 'success' : 'primary';\r\n badges.push(\r\n \r\n {props.categories.categories[categoryID].name}\r\n \r\n );\r\n }\r\n return badges;\r\n }, [])}\r\n

\r\n

Health: {props.project.health}

\r\n {Object.keys(categoryScoreArrays).length > 0\r\n ? Object.keys(categoryScoreArrays).map((categoryID: string) => {\r\n const scoresArray = Object.values(categoryScoreArrays[+categoryID])\r\n return (\r\n

\r\n {props.categories.categories[+categoryID].name} -\r\n AVG: {scoresArray.reduce((total, value) => total + value, 0) / scoresArray.length} [{scoresArray.join(', ')}]\r\n

\r\n )\r\n })\r\n : 'No Scores'}\r\n


Join Meeting Room

\r\n

Change Round

\r\n _changeRound(-1)}\r\n disabled={props.project.roundNumber == 1}\r\n >\r\n Move Back 1\r\n \r\n {' '}\r\n _changeRound(1)}\r\n >\r\n Move Up 1\r\n \r\n
\r\n \r\n );\r\n };\r\n\r\n if (!props.project) {\r\n return null;\r\n }\r\n\r\n return (\r\n
\r\n props.handleSelectedProjectChange('' + props.project.id!)}>\r\n
\r\n {props.loading ? : null}\r\n E: {props.project.expoNumber}\r\n R: {props.project.roundNumber}\r\n {props.tableGroup.shortcode}{props.project.tableNumber}\r\n
\r\n
\r\n {_getOverlay()}\r\n \r\n );\r\n};\r\n\r\nconst PageAdminProjectsEpicenterProjectDot = connect(mapStateToProps, mapDispatchToProps)(PageAdminProjectsEpicenterProjectDotComponent);\r\n\r\nexport default PageAdminProjectsEpicenterProjectDot;\r\n\r\n","import React from 'react';\r\n\r\ninterface PageAdminProjectsEpicenterEmptyDotProps {\r\n solid: boolean;\r\n}\r\n\r\nconst PageAdminProjectsEpicenterEmptyDot: React.FC = (props) => {\r\n return (\r\n \r\n )\r\n}\r\n\r\nexport default PageAdminProjectsEpicenterEmptyDot;\r\n","import React from 'react';\r\nimport { Button, ButtonGroup } from 'react-bootstrap';\r\nimport { connect } from 'react-redux';\r\n\r\nimport { AppState } from '../../state/Store';\r\nimport { TableGroupState, ProjectState } from '../../types/Project';\r\nimport { fetchTableGroups } from '../../state/TableGroup';\r\nimport { fetchProjects } from '../../state/Project';\r\n\r\nimport PageAdminProjectsUploadModal from './PageAdminProjectsUploadModal';\r\nimport PageAdminProjectsManageTableGroupsModal from './PageAdminProjectsManageTableGroupsModal';\r\nimport PageAdminProjectsAddProjectModal from './PageAdminProjectsAddProjectModal';\r\nimport PageAdminProjectsEpicenter from './PageAdminProjectsEpicenter';\r\nimport { fetchUsers } from '../../state/User';\r\nimport { requestFinish, requestStart } from '../../state/Request';\r\nimport { UserState } from '../../types/User';\r\nimport { fetchBallots } from '../../state/Ballot';\r\nimport { CategoryCriteriaState } from '../../types/Category';\r\nimport Axios from \"axios\";\r\n\r\nconst mapStateToProps = (state: AppState) => {\r\n\treturn {\r\n\t\tcategories: state.categories,\r\n\t\trequesting: state.requesting,\r\n\t\ttableGroups: state.tableGroups,\r\n\t\tprojects: state.projects,\r\n\t\tusers: state.users,\r\n\t};\r\n};\r\n\r\nconst mapDispatchToProps = (dispatch: any) => {\r\n\treturn {\r\n\t\tfetchBallots: () => dispatch(fetchBallots()),\r\n\t\tfetchTableGroups: () => dispatch(fetchTableGroups()),\r\n\t\tfetchProjects: () => dispatch(fetchProjects()),\r\n\t\tfetchUsers: () => dispatch(fetchUsers()),\r\n\t\trequestFinish: () => dispatch(requestFinish()),\r\n\t\trequestStart: () => dispatch(requestStart()),\r\n\t};\r\n};\r\n\r\ninterface PageAdminProjectsProps {\r\n\tcategories: CategoryCriteriaState;\r\n\trequesting: boolean;\r\n\ttableGroups: TableGroupState;\r\n\tprojects: ProjectState;\r\n\tusers: UserState;\r\n\tfetchBallots: () => void;\r\n\tfetchTableGroups: () => void;\r\n\tfetchProjects: () => void;\r\n\tfetchUsers: () => void;\r\n\trequestFinish: () => void;\r\n\trequestStart: () => void;\r\n}\r\n\r\nenum ModalType {\r\n\tUploadProjects,\r\n\tAddProject,\r\n\tManageTableGroups,\r\n\tNone,\r\n}\r\n\r\ntype State = {\r\n\tmodalOpen: ModalType,\r\n}\r\n\r\ntype Action =\r\n\t| { type: 'modal-close' }\r\n\t| { type: 'modal-open', modal: ModalType };\r\n\r\nconst PageAdminProjectsComponent: React.FC = (props) => {\r\n\tconst [state, dispatch] = React.useReducer((state: State, action: Action) => {\r\n\t\tswitch (action.type) {\r\n\t\t\tcase 'modal-close':\r\n\t\t\t\treturn { ...state, modalOpen: ModalType.None }\r\n\t\t\tcase 'modal-open':\r\n\t\t\t\treturn { ...state, modalOpen: action.modal }\r\n\t\t\tdefault:\r\n\t\t\t\treturn state;\r\n\t\t}\r\n\t}, {\r\n\t\tmodalOpen: ModalType.None,\r\n\t}, undefined);\r\n\tconst closeModal = () => dispatch({ type: 'modal-close' });\r\n\r\n\tReact.useEffect(() => {\r\n\t\tconst initialFetch = async () => {\r\n\t\t\tprops.requestStart();\r\n\t\t\tawait Promise.all([\r\n\t\t\t\tprops.fetchBallots(),\r\n\t\t\t\tprops.fetchTableGroups(),\r\n\t\t\t\tprops.fetchProjects(),\r\n\t\t\t\tprops.fetchUsers(),\r\n\t\t\t]);\r\n\t\t\tprops.requestFinish();\r\n\t\t};\r\n\r\n\t\tif (!(Object.values(props.users).length > 0\r\n\t\t\t&& Object.values(props.projects).length > 0\r\n\t\t\t&& Object.values(props.tableGroups).length > 0)) {\r\n\t\t\tinitialFetch();\r\n\t\t}\r\n\t}, []);\r\n\r\n\tconst getInnerContent = () => {\r\n\t\tif (props.requesting) {\r\n\t\t\treturn 'Loading';\r\n\t\t}\r\n\r\n\t\tif (Object.values(props.users).length === 0) {\r\n\t\t\treturn 'Loading';\r\n\t\t\t// TODO add real spinner\r\n\t\t}\r\n\r\n\t\treturn (\r\n\t\t\t<>\r\n\t\t\t\t
\r\n\t\t\t\t\t\r\n {\r\n if (window.confirm('This operation will replace all existing projects and generated categories. Continue?')) {\r\n const projects = await Axios.get('/api/submit/import/true/false');\r\n if (projects.status) {\r\n const data = projects.data;\r\n console.log(data);\r\n alert('Projects and categories imported!');\r\n window.location.reload();\r\n } else {\r\n alert('Import error!');\r\n }\r\n\t\t\t\t\t\t\t\t}\r\n }}\r\n size='sm'>\r\n Import Projects and Categories\r\n \r\n {\r\n if (window.confirm('This operation will replace all existing projects. Continue?')) {\r\n const projects = await Axios.get('/api/submit/import/false/false');\r\n if (projects.status) {\r\n const data = projects.data;\r\n console.log(data);\r\n alert('Projects imported!');\r\n window.location.reload();\r\n } else {\r\n alert('Import error!');\r\n }\r\n }\r\n }}\r\n size='sm'>\r\n Import Projects\r\n \r\n {\r\n if (window.confirm('This operation will replace all existing projects and generated categories. Continue?')) {\r\n const projects = await Axios.get('/api/submit/import/true/true');\r\n if (projects.status) {\r\n const data = projects.data;\r\n console.log(data);\r\n alert('Projects and categories imported!');\r\n window.location.reload();\r\n } else {\r\n alert('Import error!');\r\n }\r\n }\r\n }}\r\n size='sm'>\r\n Import Accepted Projects and Categories\r\n \r\n {\r\n if (window.confirm('This operation will replace all existing projects. Continue?')) {\r\n const projects = await Axios.get('/api/submit/import/false/true');\r\n if (projects.status) {\r\n const data = projects.data;\r\n console.log(data);\r\n alert('Projects imported!');\r\n window.location.reload();\r\n } else {\r\n alert('Import error!');\r\n }\r\n }\r\n }}\r\n size='sm'>\r\n Import Accepted Projects\r\n \r\n {\r\n if (window.confirm('This operation will accept projects in Submit. Continue?')) {\r\n const projects = await Axios.get('/api/submit/accept');\r\n if (projects.status) {\r\n const data = projects.data;\r\n console.log(data);\r\n alert('Projects accepted!');\r\n } else {\r\n alert('Acceptance error!');\r\n }\r\n }\r\n }}\r\n size='sm'>\r\n Accept Projects to Submit\r\n \r\n\t\t\t\t\t\t dispatch({\r\n\t\t\t\t\t\t\t\ttype: 'modal-open',\r\n\t\t\t\t\t\t\t\tmodal: ModalType.UploadProjects,\r\n\t\t\t\t\t\t\t})}\r\n\t\t\t\t\t\t\tsize='sm'>\r\n\t\t\t\t\t\t\tUpload Projects\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t dispatch({\r\n\t\t\t\t\t\t\t\ttype: 'modal-open',\r\n\t\t\t\t\t\t\t\tmodal: ModalType.ManageTableGroups,\r\n\t\t\t\t\t\t\t})}\r\n\t\t\t\t\t\t\tvariant={\r\n\t\t\t\t\t\t\t\tObject.values(props.tableGroups).length > 0 || props.requesting\r\n\t\t\t\t\t\t\t\t\t? 'outline-primary'\r\n\t\t\t\t\t\t\t\t\t: 'danger'\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tsize='sm'>\r\n\t\t\t\t\t\t\tManage Table Groups\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t dispatch({\r\n\t\t\t\t\t\t\t\ttype: 'modal-open',\r\n\t\t\t\t\t\t\t\tmodal: ModalType.AddProject,\r\n\t\t\t\t\t\t\t})}\r\n\t\t\t\t\t\t\tvariant='outline-primary'\r\n\t\t\t\t\t\t\tsize='sm'>\r\n\t\t\t\t\t\t\tAdd Project\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t\t\t{Object.values(props.projects).length !== 0\r\n\t\t\t\t\t\t&& Object.values(props.tableGroups).length !== 0\r\n\t\t\t\t\t\t&& Object.values(props.categories.criteria).length !== 0\r\n\t\t\t\t\t\t? \r\n\t\t\t\t\t\t: null}\r\n\t\t\t\t
\r\n\t\t\t\r\n\t\t)\r\n\t}\r\n\r\n\treturn (\r\n\t\t
\r\n\t\t\t

Projects

\r\n\t\t\t{getInnerContent()}\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t
\r\n\t);\r\n};\r\n\r\nconst PageAdminProjects = connect(\r\n\tmapStateToProps,\r\n\tmapDispatchToProps\r\n)(PageAdminProjectsComponent);\r\n\r\nexport default PageAdminProjects;\r\n","export default interface Category {\r\n id?: number;\r\n name: string;\r\n isDefault: boolean;\r\n generated: boolean;\r\n isHidden: boolean;\r\n description: string;\r\n company: string;\r\n criteria: CriteriaState;\r\n}\r\n\r\nexport interface Criteria {\r\n id?: number;\r\n name: string;\r\n rubric: string;\r\n minScore: number;\r\n maxScore: number;\r\n categoryID: number;\r\n}\r\n\r\nexport interface CategoryCriteriaState {\r\n categories: CategoryState;\r\n criteria: CriteriaState;\r\n}\r\n\r\nexport interface CategoryState {\r\n [ id: number ]: Category;\r\n}\r\n\r\nexport interface CriteriaState {\r\n [ id: number ]: Criteria;\r\n}\r\n\r\nexport interface NameToCategoryMapping {\r\n [ categoryName: string]: Category;\r\n}\r\n\r\nconst createPlaceholderCriteria = () => {\r\n\tconst criteriaDict: { [id: number]: Criteria} = {};\r\n\tcriteriaDict[-1] = createEmptyCriteria(-1);\r\n\treturn criteriaDict;\r\n};\r\n\r\nexport const EMPTY_CATEGORY = {\r\n name: '',\r\n isDefault: false,\r\n generated: false,\r\n isHidden: false,\r\n description: '',\r\n company: '',\r\n criteria: createPlaceholderCriteria(),\r\n};\r\n\r\nexport function createEmptyCriteria(id: number) {\r\n return {\r\n id,\r\n\t\tname: '',\r\n\t\trubric: '',\r\n\t\tminScore: 1,\r\n\t\tmaxScore: 10,\r\n\t\tcategoryID: -1,\r\n };\r\n}\r\n","import React from 'react';\r\nimport { Form, Col, Button } from 'react-bootstrap';\r\n\r\nimport { Criteria } from '../../types/Category';\r\n\r\ninterface PageAdminCategoriesModalCriteriaProps {\r\n criteria: Criteria;\r\n requesting: boolean;\r\n updateCriteria: (criteria: Criteria) => void;\r\n deleteCriteria: (criteriaID: number) => void;\r\n}\r\n\r\nconst PageAdminCategoriesModalCriteria: React.FC = (props) => {\r\n const handleChange = (event: any) => {\r\n const target = event.target;\r\n props.updateCriteria({\r\n ...props.criteria,\r\n [target.name]: target.value,\r\n });\r\n };\r\n\r\n return (\r\n
\r\n
\r\n \r\n Criteria Name\r\n \r\n \r\n \r\n Rubric\r\n \r\n \r\n \r\n \r\n Min Score\r\n \r\n \r\n \r\n Max Score\r\n \r\n \r\n \r\n props.deleteCriteria(props.criteria.id!)}\r\n size='sm'\r\n variant='outline-danger'>\r\n Delete Criteria\r\n \r\n
\r\n );\r\n};\r\n\r\nexport default PageAdminCategoriesModalCriteria;\r\n","import React from 'react';\r\nimport { Button, Form, Modal } from 'react-bootstrap';\r\nimport { connect } from 'react-redux';\r\n\r\nimport Category, { Criteria, createEmptyCriteria, CategoryState } from '../../types/Category';\r\nimport { updateCategory } from '../../state/Category';\r\nimport PageAdminCategoriesModalCriteria from './PageAdminCategoriesModalCriteria';\r\nimport Axios from 'axios';\r\nimport { requestFinish, requestStart } from '../../state/Request';\r\n\r\nconst mapDispatchToProps = (dispatch: any) => {\r\n\treturn {\r\n\t\tupdateCategory: (categories: CategoryState) => {\r\n\t\t\tdispatch(updateCategory(categories));\r\n },\r\n requestFinish: () => {\r\n dispatch(requestFinish());\r\n },\r\n requestStart: () => {\r\n dispatch(requestStart());\r\n },\r\n\t};\r\n};\r\n\r\ninterface PageAdminCategoriesModalProps {\r\n modalOpen: boolean;\r\n category: Category;\r\n closeModal: () => void;\r\n updateCategory: (category: CategoryState) => void;\r\n requestFinish: () => void;\r\n requestStart: () => void;\r\n}\r\n\r\ntype State = {\r\n category: Category;\r\n currentNewCategoryID: number;\r\n requesting: boolean;\r\n}\r\n\r\ntype Action =\r\n | { type: 'increase-new-category-id' }\r\n | { type: 'update-category', category: Category };\r\n\r\nconst PageAdminCategoriesModalComponent: React.FC = (props) => {\r\n\tconst [state, dispatch] = React.useReducer((state: State, action: Action) => {\r\n\t\tswitch (action.type) {\r\n case 'increase-new-category-id':\r\n return { ...state, currentNewCategoryID: state.currentNewCategoryID - 1}\r\n case 'update-category':\r\n return { ...state, category: action.category };\r\n\t\t\tdefault:\r\n\t\t\t\treturn state;\r\n\t\t}\r\n\t}, {\r\n requesting: false,\r\n category: props.category,\r\n currentNewCategoryID: -2,\r\n }, undefined);\r\n\r\n const category = props.category;\r\n\r\n React.useEffect(() => {\r\n dispatch({ type: 'update-category', category: props.category });\r\n }, [category]);\r\n\r\n const handleSaveChanges = async () => {\r\n try {\r\n props.requestStart();\r\n const result = await Axios.post('/api/categories/update', {\r\n categories: [{\r\n ...state.category,\r\n criteria: Object.values(state.category.criteria).map((criteria: Criteria) => {\r\n const { name, rubric, minScore, maxScore } = criteria;\r\n return { name, rubric, minScore, maxScore };\r\n }),\r\n }],\r\n });\r\n if (result.status) {\r\n const data = result.data;\r\n props.updateCategory(data);\r\n props.closeModal();\r\n props.requestFinish();\r\n } else {\r\n // TODO add error checking.\r\n }\r\n } catch(error) {\r\n // TODO improve error handling.\r\n alert('Server error. Please try again.');\r\n window.location.reload();\r\n }\r\n };\r\n\r\n const getCriteriaRows = () => {\r\n const updateCriteria = (criteria: Criteria) => {\r\n dispatch({\r\n type: 'update-category',\r\n category: {\r\n ...state.category,\r\n criteria: {\r\n ...state.category.criteria,\r\n [criteria.id!]: criteria,\r\n },\r\n },\r\n });\r\n };\r\n\r\n const deleteCriteria = (criteriaID: number) => {\r\n let {[criteriaID]: omitCategory, ...rest} = state.category.criteria;\r\n dispatch({\r\n type: 'update-category',\r\n category: {\r\n ...state.category,\r\n criteria: rest,\r\n },\r\n });\r\n };\r\n\r\n return Object.values(state.category.criteria).map((criteria) => {\r\n return \r\n });\r\n };\r\n\r\n const handleNewCriteria = () => {\r\n const criteria = state.category.criteria;\r\n criteria[state.currentNewCategoryID] = createEmptyCriteria(state.currentNewCategoryID);\r\n dispatch({ type: 'increase-new-category-id' });\r\n dispatch({\r\n type: 'update-category',\r\n category: {\r\n ...state.category,\r\n criteria,\r\n }\r\n });\r\n };\r\n\r\n const getForm = () => {\r\n return (\r\n
\r\n \r\n Category Name\r\n dispatch({\r\n type: 'update-category',\r\n category: {\r\n ...state.category,\r\n name: event.target.value,\r\n },\r\n })}\r\n value={state.category.name}\r\n type='text'\r\n placeholder='Name' />\r\n \r\n If you are using Ballot for optional prizes, this name needs to match the Devpost output.\r\n \r\n \r\n \r\n dispatch({\r\n type: 'update-category',\r\n category: {\r\n ...state.category,\r\n isDefault: event.target.checked,\r\n }\r\n })}\r\n type=\"checkbox\"\r\n label=\"Default Category\" />\r\n \r\n Check this box if all submissions are eligible for this category.\r\n \r\n \r\n \r\n dispatch({\r\n type: 'update-category',\r\n category: {\r\n ...state.category,\r\n isHidden: event.target.checked,\r\n }\r\n })}\r\n type=\"checkbox\"\r\n label=\"Hidden Category\" />\r\n \r\n Check this box if this is a hidden category.\r\n \r\n \r\n \r\n Company\r\n dispatch({\r\n type: 'update-category',\r\n category: {\r\n ...state.category,\r\n company: event.target.value,\r\n }\r\n })}\r\n value={state.category.company}\r\n placeholder='Company' />\r\n \r\n \r\n Category Description\r\n dispatch({\r\n type: 'update-category',\r\n category: {\r\n ...state.category,\r\n description: event.target.value,\r\n }\r\n })}\r\n value={state.category.description}\r\n placeholder='Description' />\r\n \r\n {getCriteriaRows()}\r\n New Criteria\r\n \r\n );\r\n };\r\n\r\n\treturn (\r\n\t\t\r\n \r\n Edit Category\r\n \r\n \r\n {getForm()}\r\n \r\n \r\n \r\n Close\r\n \r\n \r\n Save Changes\r\n \r\n \r\n \r\n\t);\r\n};\r\n\r\nconst PageAdminCategoriesModal = connect(null, mapDispatchToProps)(PageAdminCategoriesModalComponent);\r\n\r\nexport default PageAdminCategoriesModal;\r\n\r\n","import Axios from 'axios';\r\nimport React from 'react';\r\nimport { Card, ListGroup, ListGroupItem, ButtonGroup, Button, Badge } from 'react-bootstrap';\r\nimport { connect } from 'react-redux';\r\n\r\nimport { deleteCategory } from '../../state/Category';\r\nimport Category, { Criteria } from '../../types/Category';\r\nimport { requestFinish, requestStart } from '../../state/Request';\r\nimport { AppState } from '../../state/Store';\r\n\r\nconst mapStateToProps = (state: AppState) => {\r\n\treturn {\r\n\t\trequesting: state.requesting,\r\n\t};\r\n};\r\n\r\nconst mapDispatchToProps = (dispatch: any) => {\r\n\treturn {\r\n\t\tdeleteCategory: (categoryID: number) => {\r\n\t\t\tdispatch(deleteCategory(categoryID));\r\n\t\t},\r\n\t\trequestFinish: () => {\r\n dispatch(requestFinish());\r\n },\r\n requestStart: () => {\r\n dispatch(requestStart());\r\n },\r\n\t};\r\n};\r\n\r\ninterface PageAdminCategoriesProps {\r\n\tcategory: Category;\r\n\trequesting: boolean;\r\n\topenModal: (event: any, category: Category) => void;\r\n\tdeleteCategory: (categoryID: number) => void;\r\n\trequestFinish: () => void;\r\n requestStart: () => void;\r\n}\r\n\r\nconst PageAdminCategoriesComponent: React.FC = (props) => {\r\n\tconst handleDelete = async (event: any) => {\r\n\t\tevent.preventDefault();\r\n\t\tprops.requestStart();\r\n\t\tconst result = await Axios.post('/api/categories/delete', {\r\n\t\t\tcategoryID: props.category.id!,\r\n\t\t});\r\n\t\tif (result.status) {\r\n\t\t\tprops.deleteCategory(props.category.id!);\r\n\t\t\tprops.requestFinish();\r\n\t\t}\r\n\t};\r\n\r\n\tconst getCriteriaRows = () => {\r\n\t\tif (props.category.criteria) {\r\n\t\t\treturn Object.values(props.category.criteria).map((criteria: Criteria) => {\r\n\t\t\t\treturn (\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t
{criteria.name}
\r\n\t\t\t\t\t\t

Scored: {criteria.minScore} - {criteria.maxScore}
\r\n\t\t\t\t\t\t{criteria.rubric}

\r\n\t\t\t\t\t
\r\n\t\t\t\t);\r\n\t\t\t});\r\n\t\t}\r\n\t};\r\n\r\n\treturn (\r\n\t\t\r\n \r\n\t\t\t\t\r\n\t\t\t\t\t{props.category.name}\r\n\t\t\t\t\t{props.category.isDefault ? Default: <>}{props.category.generated ? Generated : <>}\r\n\t\t\t\t\t{props.category.isHidden ? Hidden: <>}\r\n\t\t\t\t\t
{props.category.company}
\r\n\t\t\t\t
\r\n\t\t\t\t\r\n\t\t\t\t\t{props.category.description}\r\n\t\t\t\t\r\n
\r\n \r\n {getCriteriaRows()}\r\n \r\n \r\n\t\t\t\t\r\n props.openModal(event, props.category)}\r\n size='sm'\r\n variant='primary'>\r\n Edit\r\n \r\n\t\t\t\t\t\r\n\t\t\t\t\t\tDelete\r\n\t\t\t\t\t\r\n \r\n \r\n
\r\n\t);\r\n};\r\n\r\nconst PageAdminCategories = connect(mapStateToProps, mapDispatchToProps)(PageAdminCategoriesComponent);\r\n\r\nexport default PageAdminCategories;\r\n","import Axios from 'axios';\r\nimport React from 'react';\r\nimport { Button } from 'react-bootstrap';\r\nimport { connect } from 'react-redux';\r\n\r\nimport { AppState } from '../../state/Store';\r\nimport Category, { CategoryState, EMPTY_CATEGORY, CategoryCriteriaState } from '../../types/Category';\r\nimport { fillCategories } from '../../state/Category';\r\n\r\nimport PageAdminCategoriesModal from './PageAdminCategoriesModal';\r\nimport PageAdminCategoriesCard from './PageAdminCategoriesCard';\r\n\r\nconst mapStateToProps = (state: AppState) => {\r\n\treturn {\r\n\t\tcategories: state.categories,\r\n\t};\r\n};\r\n\r\nconst mapDispatchToProps = (dispatch: any) => {\r\n\treturn {\r\n\t\tfillCategories: (categories: CategoryState) => {\r\n\t\t\tdispatch(fillCategories(categories));\r\n\t\t},\r\n\t};\r\n};\r\n\r\ninterface PageAdminCategoriesProps {\r\n\tcategories: CategoryCriteriaState;\r\n\tfillCategories: (categories: CategoryState) => void;\r\n}\r\n\r\ntype State = {\r\n\tmodalCategory: Category;\r\n\tmodalOpen: boolean;\r\n\trequesting: boolean;\r\n}\r\n\r\ntype Action =\r\n\t| { type: 'modal-open', modalCategory: Category }\r\n\t| { type: 'modal-close' }\r\n\t| { type: 'request-start'}\r\n\t| { type: 'request-finish'};\r\n\r\nconst PageAdminCategoriesComponent: React.FC = (props) => {\r\n\tconst [state, dispatch] = React.useReducer((state: State, action: Action) => {\r\n\t\tswitch (action.type) {\r\n\t\t\tcase 'modal-open':\r\n return { ...state, modalOpen: true, modalCategory: action.modalCategory };\r\n case 'modal-close':\r\n return { ...state, modalOpen: false };\r\n\t\t\tcase 'request-start':\r\n\t\t\t\treturn { ...state, requesting: true };\r\n\t\t\tcase 'request-finish':\r\n\t\t\t\treturn { ...state, requesting: false };\r\n\t\t\tdefault:\r\n\t\t\t\treturn state;\r\n\t\t}\r\n\t}, {\r\n\t\tmodalCategory: EMPTY_CATEGORY,\r\n\t\tmodalOpen: false,\r\n\t\trequesting: false,\r\n\t}, undefined);\r\n\r\n\tReact.useEffect(() => {\r\n\t\tfetchCategories();\r\n\t}, []);\r\n\r\n\tconst fetchCategories = async () => {\r\n\t\tdispatch({ type: 'request-start' });\r\n\t\tconst result = await Axios.get('/api/categories/allCategoriesCriteria');\r\n\r\n\t\tif (result.status) {\r\n\t\t\tconst payload: CategoryState = result.data;\r\n\t\t\tprops.fillCategories(payload);\r\n\t\t\tdispatch({ type: 'request-finish' });\r\n\t\t} else {\r\n\t\t\t// TODO error checking\r\n\t\t}\r\n\t};\r\n\r\n\tconst getCategoryCards = () => {\r\n\t\tconst openModal = (event: any, modalCategory: Category) => {\r\n\t\t\tevent.preventDefault();\r\n\t\t\tdispatch({ type: 'modal-open', modalCategory });\r\n\t\t};\r\n\r\n\t\tconst createdCategories:any[] = [];\r\n\t\tconst generatedCategories:any[] = [];\r\n\r\n\t\tfor (const category of Object.values(props.categories.categories)) {\r\n\t\t\tif (category.generated) {\r\n\t\t\t\tgeneratedCategories.push(\r\n\t\t\t\t\t\r\n\t\t\t\t);\r\n\t\t\t} else {\r\n\t\t\t\tcreatedCategories.push(\r\n\t\t\t\t\t\r\n\t\t\t\t)\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn (\r\n\t\t\t<>\r\n\t\t\t\t{createdCategories}\r\n\t\t\t\t{generatedCategories}\r\n\t\t\t\r\n\t\t)\r\n\t};\r\n\r\n\treturn (\r\n\t\t
\r\n\t\t\t

Categories

\r\n\t\t\t
\r\n\t\t\t\t\r\n\t\t\t
\r\n\t\t\t
\r\n\t\t\t\t{getCategoryCards()}\r\n\t\t\t\t dispatch({ type: 'modal-close' })} />\r\n\t\t\t
\r\n\t\t
\r\n\t);\r\n};\r\n\r\nconst PageAdminCategories = connect(\r\n\tmapStateToProps,\r\n\tmapDispatchToProps\r\n)(PageAdminCategoriesComponent);\r\n\r\nexport default PageAdminCategories;\r\n","import React from 'react';\r\nimport { Table } from 'react-bootstrap';\r\nimport { connect } from 'react-redux';\r\n\r\nimport { AppState } from '../../state/Store';\r\nimport Project, { TableGroupState, ProjectState } from '../../types/Project';\r\nimport { fetchTableGroups } from '../../state/TableGroup';\r\nimport { fetchProjects } from '../../state/Project';\r\n\r\nimport { fetchUsers } from '../../state/User';\r\nimport { requestFinish, requestStart } from '../../state/Request';\r\nimport { UserState } from '../../types/User';\r\nimport { fetchBallots } from '../../state/Ballot';\r\nimport { CategoryCriteriaState } from '../../types/Category';\r\nimport Ballot, { BallotState } from \"../../types/Ballot\";\r\nimport { fetchCategories } from \"../../state/Category\";\r\nimport { fetchCompanies } from \"../../state/Company\";\r\n\r\nconst mapStateToProps = (state: AppState) => {\r\n\treturn {\r\n\t\tballots: state.ballots,\r\n\t\tcategories: state.categories,\r\n\t\trequesting: state.requesting,\r\n\t\ttableGroups: state.tableGroups,\r\n\t\tprojects: state.projects,\r\n\t\tusers: state.users,\r\n\t};\r\n};\r\n\r\nconst mapDispatchToProps = (dispatch: any) => {\r\n\treturn {\r\n\t\tfetchBallots: () => dispatch(fetchBallots()),\r\n\t\tfetchTableGroups: () => dispatch(fetchTableGroups()),\r\n\t\tfetchProjects: () => dispatch(fetchProjects()),\r\n\t\tfetchUsers: () => dispatch(fetchUsers()),\r\n\t\tfetchCategories: () => dispatch(fetchCategories()),\r\n\t\tfetchCompanies: () => dispatch(fetchCompanies()),\r\n\t\trequestFinish: () => dispatch(requestFinish()),\r\n\t\trequestStart: () => dispatch(requestStart()),\r\n\t};\r\n};\r\n\r\ninterface PageAdminDashboardProps {\r\n\tballots: BallotState;\r\n\tcategories: CategoryCriteriaState;\r\n\trequesting: boolean;\r\n\ttableGroups: TableGroupState;\r\n\tprojects: ProjectState;\r\n\tusers: UserState;\r\n\tfetchBallots: () => void;\r\n\tfetchTableGroups: () => void;\r\n\tfetchProjects: () => void;\r\n\tfetchUsers: () => void;\r\n\tfetchCategories: () => void;\r\n\tfetchCompanies: () => void;\r\n\trequestFinish: () => void;\r\n\trequestStart: () => void;\r\n}\r\n\r\nconst PageAdminDashboardComponent: React.FC = (props) => {\r\n\tReact.useEffect(() => {\r\n\t\tconst initialFetch = async () => {\r\n\t\t\tprops.requestStart();\r\n\t\t\tawait Promise.all([\r\n\t\t\t\tprops.fetchBallots(),\r\n\t\t\t\tprops.fetchTableGroups(),\r\n\t\t\t\tprops.fetchProjects(),\r\n\t\t\t\tprops.fetchUsers(),\r\n\t\t\t\tprops.fetchCompanies(),\r\n\t\t\t\tprops.fetchCategories()\r\n\t\t\t]);\r\n\t\t\tprops.requestFinish();\r\n\t\t};\r\n\r\n\t\tif (!(Object.values(props.users).length > 0\r\n\t\t\t&& Object.values(props.projects).length > 0\r\n\t\t\t&& Object.values(props.tableGroups).length > 0)) {\r\n\t\t\tinitialFetch();\r\n\t\t}\r\n\t}, []);\r\n\r\n\tif (props.requesting) {\r\n\t\treturn

Loading

;\r\n\t}\r\n\r\n\tconsole.log(props);\r\n\r\n\treturn (\r\n\t\t
\r\n\t\t\t

Dashboard

\r\n\t\t\t{Object.values(props.projects).map((project: Project) => {\r\n\t\t\t\treturn (\r\n\t\t\t\t\t
\r\n\t\t\t\t\t\t

{project.id} - {project.name}

\r\n\t\t\t\t\t\t{project.categoryIDs.map((categoryID: number) => {\r\n\t\t\t\t\t\t\tif (!props.categories.categories[categoryID]) {\r\n\t\t\t\t\t\t\t\treturn
Category ID: {categoryID}
\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tif (!props.ballots.dProjectScores[project.id!]) {\r\n\t\t\t\t\t\t\t\treturn
{props.categories.categories[categoryID].name}
;\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tconst criteriaIDs: number[] = Object.values(props.categories.categories[categoryID].criteria).map((criteria) => criteria.id);\r\n\t\t\t\t\t\t\tconst criteriaNames: string[] = Object.values(props.categories.categories[categoryID].criteria).map((criteria) => criteria.name);\r\n\r\n\t\t\t\t\t\t\treturn (\r\n\t\t\t\t\t\t\t\t<>\r\n\t\t\t\t\t\t\t\t\t
{props.categories.categories[categoryID].name}
\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t{criteriaNames.map((name) => )}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t{Object.values(props.ballots.dProjectScores[project.id!]).map((ballots: Ballot[]) => {\r\n\t\t\t\t\t\t\t\t\t\t\t\tlet scores: number[] = [];\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\tfor (let criteriaID of criteriaIDs) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tlet foundBallot = ballots.find(ballot => ballot.criteriaID == criteriaID);\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (foundBallot) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tscores.push(foundBallot.score);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\tif (scores.length == criteriaIDs.length) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\treturn (\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{scores.map(score => )}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\treturn null;\r\n\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t})}\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t
Judge{name}Total
{props.users[ballots[0].userID].name}{score}{scores.reduce((a, b) => a + b, 0)}
\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t})}\r\n\t\t\t\t\t
\r\n\t\t\t\t);\r\n\t\t\t})}\r\n\t\t
\r\n\t);\r\n};\r\n\r\n\r\nconst PageAdminDashboard = connect(\r\n\tmapStateToProps,\r\n\tmapDispatchToProps\r\n)(PageAdminDashboardComponent);\r\n\r\nexport default PageAdminDashboard;\r\n","import React from 'react';\r\nimport { connect } from 'react-redux';\r\nimport { Route, Redirect, Switch } from 'react-router-dom';\r\n\r\nimport User from '../../types/User';\r\nimport { AppState } from '../../state/Store';\r\nimport { loginUser } from '../../state/Account';\r\n\r\nimport AdminNavigation from './AdminNavigation';\r\nimport PageAdminUsers from './PageAdminUsers';\r\nimport PageAdminProjects from './PageAdminProjects';\r\nimport PageAdminCategories from './PageAdminCategories';\r\nimport PageAdminDashboard from \"./PageAdminDashboard\";\r\n\r\nexport const adminRoute = '/admin';\r\n\r\nconst mapStateToProps = (state: AppState) => {\r\n return {\r\n account: state.account,\r\n };\r\n};\r\n\r\nconst mapDispatchToProps = (dispatch: any) => {\r\n return {\r\n loginUser: (user: User) => {\r\n dispatch(loginUser(user));\r\n },\r\n };\r\n};\r\n\r\ninterface PageAdminProps {\r\n account: User;\r\n loginUser: (user: User) => void;\r\n}\r\n\r\ntype State = {\r\n requesting: boolean;\r\n}\r\n\r\ntype Action =\r\n | { type: 'request-start'}\r\n | { type: 'request-finish'};\r\n\r\nconst PageAdminComponent: React.FC = (props) => {\r\n const [state, dispatch] = React.useReducer((state: State, action: Action) => {\r\n switch (action.type) {\r\n case 'request-start':\r\n return { ...state, requesting: true };\r\n case 'request-finish':\r\n return { ...state, requesting: false };\r\n default:\r\n return state;\r\n }\r\n }, {\r\n requesting: false,\r\n }, undefined);\r\n\r\n return (\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n );\r\n};\r\n\r\nconst PageAdmin = connect(mapStateToProps, mapDispatchToProps)(PageAdminComponent);\r\n\r\nexport default PageAdmin;\r\n","import * as qs from 'querystring';\r\nimport Axios from 'axios';\r\nimport React from 'react';\r\nimport { connect } from 'react-redux';\r\n\r\nimport User from '../../types/User';\r\nimport { AppState } from '../../state/Store';\r\nimport { loginUser } from '../../state/Account';\r\nimport { Form, Button, Alert, Spinner } from 'react-bootstrap';\r\nimport { UIError } from '../../types/Common';\r\nimport { Redirect } from 'react-router';\r\nimport { fetchCompanies } from '../../state/Company';\r\n\r\nconst mapStateToProps = (state: AppState) => {\r\n return {\r\n account: state.account,\r\n companies: state.companies,\r\n };\r\n};\r\n\r\nconst mapDispatchToProps = (dispatch: any) => {\r\n return {\r\n fetchCompanies: () => {\r\n dispatch(fetchCompanies());\r\n },\r\n loginUser: (user: User) => {\r\n dispatch(loginUser(user));\r\n },\r\n };\r\n};\r\n\r\ninterface PageRegisterProps {\r\n account: User;\r\n companies: string[];\r\n loginUser: (user: User) => void;\r\n fetchCompanies: () => void;\r\n}\r\n\r\ninterface Inputs {\r\n name: string;\r\n email: string;\r\n password: string;\r\n passwordConfirm: string;\r\n company: string;\r\n}\r\n\r\ntype State = {\r\n requesting: boolean;\r\n inputs: Inputs;\r\n error: UIError;\r\n success: boolean;\r\n}\r\n\r\ntype Action =\r\n | { type: 'change-error', error: UIError }\r\n | { type: 'change-inputs', inputs: Partial }\r\n | { type: 'request-start'}\r\n | { type: 'request-success'}\r\n | { type: 'request-finish'};\r\n\r\nconst PageRegisterComponent: React.FC = (props) => {\r\n const initialState = {\r\n requesting: false,\r\n inputs: {\r\n name: '',\r\n email: '',\r\n password: '',\r\n passwordConfirm: '',\r\n company: '',\r\n },\r\n error: {\r\n name: '',\r\n message: '',\r\n },\r\n success: false,\r\n };\r\n const [state, dispatch] = React.useReducer((state: State, action: Action) => {\r\n switch (action.type) {\r\n case 'change-error':\r\n return {\r\n ...state,\r\n error: action.error,\r\n requesting: false,\r\n };\r\n case 'change-inputs':\r\n return { ...state, inputs: {\r\n ...state.inputs,\r\n ...action.inputs,\r\n }};\r\n case 'request-start':\r\n return {\r\n ...state,\r\n requesting: true,\r\n error: { name: '', message: '' },\r\n };\r\n case 'request-success':\r\n return { ...state, success: true, requesting: false };\r\n case 'request-finish':\r\n return { ...state, requesting: false, success: false };\r\n default:\r\n return state;\r\n }\r\n }, initialState, undefined);\r\n\r\n React.useEffect(() => {\r\n props.fetchCompanies();\r\n }, []);\r\n\r\n const handleRegister = async (event: any) => {\r\n event.preventDefault();\r\n const pattern = /^[a-zA-Z0-9\\-_]+(\\.[a-zA-Z0-9\\-_]+)*@[a-z0-9]+(-[a-z0-9]+)*(\\.[a-z0-9]+(-[a-z0-9]+)*)*\\.[a-z]{2,4}$/;\r\n if (state.inputs.name.length === 0\r\n || state.inputs.email.length === 0\r\n || state.inputs.password.length === 0\r\n || state.inputs.passwordConfirm.length === 0) {\r\n dispatch({\r\n type: 'change-error',\r\n error: {\r\n name: 'Error Creating Account',\r\n message: 'One or more fields were left blank.',\r\n },\r\n });\r\n return;\r\n }\r\n if (!pattern.test(state.inputs.email)) {\r\n dispatch({\r\n type: 'change-error',\r\n error: {\r\n name: 'Error Creating Account',\r\n message: 'Your email is invalid.',\r\n },\r\n });\r\n return;\r\n }\r\n if (state.inputs.password !== state.inputs.passwordConfirm) {\r\n dispatch({\r\n type: 'change-error',\r\n error: {\r\n name: 'Error Creating Account',\r\n message: 'Your passwords do not match.',\r\n },\r\n });\r\n return;\r\n }\r\n\r\n dispatch({ type: 'request-start' });\r\n const registerResult = await Axios.post('/auth/signup', qs.stringify({\r\n 'name': state.inputs.name,\r\n 'email': state.inputs.email,\r\n 'password': state.inputs.password,\r\n 'company': state.inputs.company,\r\n }), {\r\n headers: {\r\n 'Content-Type': 'application/x-www-form-urlencoded',\r\n },\r\n });\r\n\r\n if (!registerResult.data.status) {\r\n dispatch({\r\n type: 'change-error',\r\n error: {\r\n name: 'Error Creating Account',\r\n message: 'Account already exists.',\r\n }\r\n });\r\n return;\r\n }\r\n dispatch({ type: 'request-success' });\r\n }\r\n\r\n const genErrorBox = () => {\r\n return state.error.name\r\n ? \r\n {state.error.name}\r\n
{state.error.message}
\r\n
\r\n : null\r\n };\r\n\r\n\r\n if (state.success) {\r\n return ;\r\n }\r\n\r\n const _getCompanyList = () => {\r\n return props.companies.map((company: string) => {\r\n return (\r\n \r\n );\r\n });\r\n };\r\n\r\n return (\r\n
\r\n

Register

\r\n
\r\n \r\n Name\r\n dispatch({\r\n type: 'change-inputs',\r\n inputs: {\r\n name: event.target.value,\r\n },\r\n })}\r\n value={state.inputs.name}\r\n type=\"text\"\r\n placeholder=\"George P. Beardell\" />\r\n \r\n \r\n Email\r\n dispatch({\r\n type: 'change-inputs',\r\n inputs: {\r\n email: event.target.value,\r\n },\r\n })}\r\n value={state.inputs.email}\r\n type=\"email\"\r\n placeholder=\"beardell@hack.gt\" />\r\n \r\n \r\n Password\r\n dispatch({\r\n type: 'change-inputs',\r\n inputs: {\r\n password: event.target.value,\r\n },\r\n })}\r\n value={state.inputs.password}\r\n type=\"password\"\r\n placeholder=\"******\" />\r\n \r\n \r\n Password (confirm)\r\n dispatch({\r\n type: 'change-inputs',\r\n inputs: {\r\n passwordConfirm: event.target.value,\r\n },\r\n })}\r\n value={state.inputs.passwordConfirm}\r\n type=\"password\"\r\n placeholder=\"******\" />\r\n \r\n \r\n Company/Group Name\r\n dispatch({\r\n type: 'change-inputs',\r\n inputs: {\r\n company: event.target.value,\r\n },\r\n })}\r\n value={state.inputs.company}\r\n type=\"text\"\r\n placeholder=\"Company\">\r\n {_getCompanyList()}\r\n \r\n \r\n {state.requesting\r\n ? \r\n : 'Register'}\r\n {genErrorBox()}\r\n \r\n
\r\n );\r\n};\r\n\r\nconst PageRegister = connect(mapStateToProps, mapDispatchToProps)(PageRegisterComponent);\r\n\r\nexport default PageRegister;\r\n","import React from 'react';\r\nimport { AppState } from '../state/Store';\r\nimport User, { UserRole, getRoleString } from '../types/User';\r\nimport { loginUser } from '../state/Account';\r\nimport { connect } from 'react-redux';\r\nimport PageProjects from './expo/PageProjects';\r\n\r\nconst mapStateToProps = (state: AppState) => {\r\n return {\r\n account: state.account,\r\n };\r\n};\r\n\r\nconst mapDispatchToProps = (dispatch: any) => {\r\n return {\r\n loginUser: (user: User) => {\r\n dispatch(loginUser(user));\r\n },\r\n };\r\n};\r\n\r\ninterface PageHomeProps {\r\n account: User;\r\n loginUser: (user: User) => void;\r\n}\r\n\r\ntype State = {\r\n requesting: boolean;\r\n}\r\n\r\ntype Action =\r\n | { type: 'request-start'}\r\n | { type: 'request-finish'};\r\n\r\nconst containerStyle: React.CSSProperties = {\r\n maxWidth: 720,\r\n margin: '0 auto',\r\n};\r\n\r\nconst PageHomeComponent: React.FC = (props) => {\r\n const [state, dispatch] = React.useReducer((state: State, action: Action) => {\r\n switch (action.type) {\r\n case 'request-start':\r\n return { ...state, requesting: true };\r\n case 'request-finish':\r\n return { ...state, requesting: false };\r\n default:\r\n return state;\r\n }\r\n }, {\r\n requesting: false,\r\n }, undefined);\r\n\r\n const header =

Welcome To Ballot!

;\r\n const yourRole = Your Status: {getRoleString(props.account.role)};\r\n const adminBlurb =

Hello {props.account.name}! Thank you for using Ballot! As an owner, you have full control over every aspect of the judging and expo process. You will be able to assign tables, judges, and how projects are scored. This also means you have the potential to cause issues if you are not careful. Please make sure you have read through all the user guides before messing with the available tools.

\r\n const mobileBlurb =

Ballot works on devices of all screen sizes! If you are using a tablet or laptop, you can use the navigation bar to navigation throughout this application. If you are on a mobile device, simply click the menu button on the upper right to access all the pages.

\r\n const projectsBlurb =

To view all the projects at this hackathon, go to the projects page. Each project has an expo number and table number. If you tap/click on the project, you will be directed to the Devpost entry, where the group will go into more detail about the project, present videos and images, and show where you can see their project.

;\r\n const judgingBlurb =

If you go to the judging page, you will be able to judge projects as they are assigned to you. Projects will automatically be assigned to you, so all you have to do is wait for the next project to pop in. Ballot will guide you through the process and will provide you with a timer to keep you on track. You will also be presented with the judging criteria and rubric while you're scoring.

\r\n const profileBlurb =

Make sure to go to your profile to add any skills, programming languages, fields, or other keywords so that Ballot can try to optimize the projects you receive to match your experience and expertise!

\r\n const pendingBlurb =

Congratulations! You just signed up for an account; however, you are not yet approved to judge. Your page will automatically update once the admins have approved you to judge!

\r\n\r\n const ownerBody = (\r\n
\r\n {header}\r\n {yourRole}\r\n {adminBlurb}\r\n {mobileBlurb}\r\n\r\n
\r\n );\r\n const adminBody = (\r\n
\r\n {header}\r\n {yourRole}\r\n {adminBlurb}\r\n {mobileBlurb}\r\n
\r\n );\r\n const judgeBody = (\r\n
\r\n {header}\r\n {yourRole}\r\n {mobileBlurb}\r\n {projectsBlurb}\r\n {judgingBlurb}\r\n {/* {profileBlurb} */}\r\n
\r\n );\r\n const pendingBody = (\r\n
\r\n {header}\r\n {yourRole}\r\n {mobileBlurb}\r\n {projectsBlurb}\r\n {pendingBlurb}\r\n {/* {profileBlurb} */}\r\n
\r\n );\r\n\r\n switch (props.account.role) {\r\n case UserRole.Owner:\r\n return ownerBody;\r\n case UserRole.Admin:\r\n return adminBody;\r\n case UserRole.Judge:\r\n return judgeBody;\r\n case UserRole.Pending:\r\n return pendingBody;\r\n }\r\n\r\n return (\r\n \r\n );\r\n};\r\n\r\nconst PageHome = connect(mapStateToProps, mapDispatchToProps)(PageHomeComponent);\r\n\r\nexport default PageHome;\r\n","import React from 'react';\r\n\r\nconst Footer: React.FC = () => {\r\n return (\r\n
Made with 🚄 by the HackGTeam\r\n
\r\n );\r\n}\r\n\r\nexport default Footer;\r\n","import Axios from 'axios';\nimport React from 'react';\nimport { AppState } from './state/Store';\nimport { BrowserRouter as Router, Route, Redirect, Switch } from 'react-router-dom';\nimport { connect } from 'react-redux';\nimport { loginUser } from './state/Account';\n\nimport Navigation from './components/Navigation';\nimport PageLogin from './components/account/PageLogin';\nimport PageLogout from './components/account/PageLogout';\nimport PageProfile from './components/account/PageProfile';\nimport PageProjects from './components/expo/PageProjects';\nimport PageJudging from './components/judge/PageJudging';\nimport PageAdmin from './components/admin/PageAdmin';\nimport PageRegister from './components/account/PageRegister';\nimport PageHome from './components/PageHome';\nimport User, { roleStringToEnum, UserRole } from './types/User';\nimport Footer from './components/Footer';\nimport { Spinner } from 'react-bootstrap';\n\ninterface AppProps {\n account: User;\n loginUser: (user: User) => void;\n}\n\nconst AppComponent: React.FC = (props) => {\n const AuthRoute = ({component, roleNeeded, curRole, ...rest}: any) => {\n const routeComponent = (props: any) => (\n curRole >= roleNeeded\n ? React.createElement(component, props)\n : \n );\n\n return ;\n };\n\n const [loginFetched, changeLoginFetched] = React.useState(false);\n\n React.useEffect(() => {\n const checkUserData = async () => {\n const result = await Axios.get('/auth/user_data');\n\n props.loginUser({\n ...result.data,\n role: roleStringToEnum(result.data.role),\n });\n\n changeLoginFetched(true);\n };\n\n checkUserData();\n }, [props.loginUser]);\n\n if (!loginFetched) {\n return \n }\n\n return (\n <>\n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n
\n
\n