From 0ff8fcac6acbcf9189fe752991eb7bd721967292 Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Fri, 8 Oct 2021 15:09:27 +0300 Subject: [PATCH] app/vmui: follow-up after 7bfb44113e7891a4efb0d3189761e175f144175f * Run `vmui-update` * Document the changes in README.md and CHANGELOG.md --- README.md | 11 +- app/vmselect/vmui/asset-manifest.json | 22 +- app/vmselect/vmui/index.html | 2 +- .../vmui/static/css/2.a684aa27.chunk.css | 1 + ...f12a.chunk.css => main.cbb91dd8.chunk.css} | 2 +- .../vmui/static/js/2.537d84e3.chunk.js | 2 - .../vmui/static/js/2.72d7cb01.chunk.js | 2 + ...SE.txt => 2.72d7cb01.chunk.js.LICENSE.txt} | 43 +- ....948e3ea3.chunk.js => 3.3cf0cbc4.chunk.js} | 2 +- .../vmui/static/js/main.1dce7b43.chunk.js | 1 - .../vmui/static/js/main.3fb3f4d1.chunk.js | 1 + ...n.0d27da20.js => runtime-main.22ec3f63.js} | 2 +- app/vmui/packages/vmui/package-lock.json | 20846 +++++++++++++++- docs/CHANGELOG.md | 2 +- docs/README.md | 11 +- docs/Single-server-VictoriaMetrics.md | 11 +- 16 files changed, 20907 insertions(+), 54 deletions(-) create mode 100644 app/vmselect/vmui/static/css/2.a684aa27.chunk.css rename app/vmselect/vmui/static/css/{main.0d21f12a.chunk.css => main.cbb91dd8.chunk.css} (75%) delete mode 100644 app/vmselect/vmui/static/js/2.537d84e3.chunk.js create mode 100644 app/vmselect/vmui/static/js/2.72d7cb01.chunk.js rename app/vmselect/vmui/static/js/{2.537d84e3.chunk.js.LICENSE.txt => 2.72d7cb01.chunk.js.LICENSE.txt} (77%) rename app/vmselect/vmui/static/js/{3.948e3ea3.chunk.js => 3.3cf0cbc4.chunk.js} (97%) delete mode 100644 app/vmselect/vmui/static/js/main.1dce7b43.chunk.js create mode 100644 app/vmselect/vmui/static/js/main.3fb3f4d1.chunk.js rename app/vmselect/vmui/static/js/{runtime-main.0d27da20.js => runtime-main.22ec3f63.js} (94%) diff --git a/README.md b/README.md index 004085342..bc947e1d7 100644 --- a/README.md +++ b/README.md @@ -525,7 +525,7 @@ By default, VictoriaMetrics returns time series for the last 5 minutes from `/ap Additionally VictoriaMetrics provides the following handlers: -* `/vmui` - Basic Web UI +* `/vmui` - Basic Web UI. See [these docs](#vmui). * `/api/v1/series/count` - returns the total number of time series in the database. Some notes: * the handler scans all the inverted index, so it can be slow if the database contains tens of millions of time series; * the handler may count [deleted time series](#how-to-delete-time-series) additionally to normal time series due to internal implementation restrictions; @@ -596,6 +596,15 @@ VictoriaMetrics supports the following handlers from [Graphite Tags API](https:/ * [/tags/delSeries](https://graphite.readthedocs.io/en/stable/tags.html#removing-series-from-the-tagdb) +## vmui + +VictoriaMetrics provides UI for query troubleshooting and exploration. The UI is available at `http://victoriametrics:8428/vmui`. +The UI allows exploring query results via graphs and tables. Graphs support scrolling and zooming: + +* Drag the graph to the left / right in order to move the displayed time range into the past / future. +* Hold `Ctrl` (or `Cmd` on MacOS) and scroll up / down in order to zoom in / out the graph. + + ## How to build from sources We recommend using either [binary releases](https://github.com/VictoriaMetrics/VictoriaMetrics/releases) or diff --git a/app/vmselect/vmui/asset-manifest.json b/app/vmselect/vmui/asset-manifest.json index 8df5987c7..b901f2893 100644 --- a/app/vmselect/vmui/asset-manifest.json +++ b/app/vmselect/vmui/asset-manifest.json @@ -1,17 +1,19 @@ { "files": { - "main.css": "./static/css/main.0d21f12a.chunk.css", - "main.js": "./static/js/main.1dce7b43.chunk.js", - "runtime-main.js": "./static/js/runtime-main.0d27da20.js", - "static/js/2.537d84e3.chunk.js": "./static/js/2.537d84e3.chunk.js", - "static/js/3.948e3ea3.chunk.js": "./static/js/3.948e3ea3.chunk.js", + "main.css": "./static/css/main.cbb91dd8.chunk.css", + "main.js": "./static/js/main.3fb3f4d1.chunk.js", + "runtime-main.js": "./static/js/runtime-main.22ec3f63.js", + "static/css/2.a684aa27.chunk.css": "./static/css/2.a684aa27.chunk.css", + "static/js/2.72d7cb01.chunk.js": "./static/js/2.72d7cb01.chunk.js", + "static/js/3.3cf0cbc4.chunk.js": "./static/js/3.3cf0cbc4.chunk.js", "index.html": "./index.html", - "static/js/2.537d84e3.chunk.js.LICENSE.txt": "./static/js/2.537d84e3.chunk.js.LICENSE.txt" + "static/js/2.72d7cb01.chunk.js.LICENSE.txt": "./static/js/2.72d7cb01.chunk.js.LICENSE.txt" }, "entrypoints": [ - "static/js/runtime-main.0d27da20.js", - "static/js/2.537d84e3.chunk.js", - "static/css/main.0d21f12a.chunk.css", - "static/js/main.1dce7b43.chunk.js" + "static/js/runtime-main.22ec3f63.js", + "static/css/2.a684aa27.chunk.css", + "static/js/2.72d7cb01.chunk.js", + "static/css/main.cbb91dd8.chunk.css", + "static/js/main.3fb3f4d1.chunk.js" ] } \ No newline at end of file diff --git a/app/vmselect/vmui/index.html b/app/vmselect/vmui/index.html index 024d6c794..801909ecc 100644 --- a/app/vmselect/vmui/index.html +++ b/app/vmselect/vmui/index.html @@ -1 +1 @@ -VM UI
\ No newline at end of file +VM UI
\ No newline at end of file diff --git a/app/vmselect/vmui/static/css/2.a684aa27.chunk.css b/app/vmselect/vmui/static/css/2.a684aa27.chunk.css new file mode 100644 index 000000000..a992b729f --- /dev/null +++ b/app/vmselect/vmui/static/css/2.a684aa27.chunk.css @@ -0,0 +1 @@ +.uplot,.uplot *,.uplot :after,.uplot :before{box-sizing:border-box}.uplot{font-family:system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";line-height:1.5;width:-webkit-min-content;width:-moz-min-content;width:min-content}.u-title{text-align:center;font-size:18px;font-weight:700}.u-wrap{position:relative;-webkit-user-select:none;-ms-user-select:none;user-select:none}.u-over,.u-under{position:absolute}.u-under{overflow:hidden}.uplot canvas{display:block;position:relative;width:100%;height:100%}.u-legend{font-size:14px;margin:auto;text-align:center}.u-inline{display:block}.u-inline *{display:inline-block}.u-inline tr{margin-right:16px}.u-legend th{font-weight:600}.u-legend th>*{vertical-align:middle;display:inline-block}.u-legend .u-marker{width:1em;height:1em;margin-right:4px;background-clip:padding-box!important}.u-inline.u-live th:after{content:":";vertical-align:middle}.u-inline:not(.u-live) .u-value{display:none}.u-series>*{padding:4px}.u-series th{cursor:pointer}.u-legend .u-off>*{opacity:.3}.u-select{background:rgba(0,0,0,.07)}.u-cursor-x,.u-cursor-y,.u-select{position:absolute;pointer-events:none}.u-cursor-x,.u-cursor-y{left:0;top:0;will-change:transform;z-index:100}.u-hz .u-cursor-x,.u-vt .u-cursor-y{height:100%;border-right:1px dashed #607d8b}.u-hz .u-cursor-y,.u-vt .u-cursor-x{width:100%;border-bottom:1px dashed #607d8b}.u-cursor-pt{position:absolute;top:0;left:0;border-radius:50%;border:0 solid;pointer-events:none;will-change:transform;z-index:100;background-clip:padding-box!important}.u-cursor-pt.u-off,.u-cursor-x.u-off,.u-cursor-y.u-off,.u-select.u-off{display:none} \ No newline at end of file diff --git a/app/vmselect/vmui/static/css/main.0d21f12a.chunk.css b/app/vmselect/vmui/static/css/main.cbb91dd8.chunk.css similarity index 75% rename from app/vmselect/vmui/static/css/main.0d21f12a.chunk.css rename to app/vmselect/vmui/static/css/main.cbb91dd8.chunk.css index 5a8bda8cb..40fd14ec2 100644 --- a/app/vmselect/vmui/static/css/main.0d21f12a.chunk.css +++ b/app/vmselect/vmui/static/css/main.cbb91dd8.chunk.css @@ -1 +1 @@ -body{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Roboto","Oxygen","Ubuntu","Cantarell","Fira Sans","Droid Sans","Helvetica Neue",sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}code{font-family:source-code-pro,Menlo,Monaco,Consolas,"Courier New",monospace}.MuiAccordionSummary-content{margin:10px 0!important}.cm-activeLine{background-color:inherit!important}.cm-wrap{border-radius:4px;border:1px solid #b9b9b9;font-size:10px}.one-line-scroll .cm-wrap{height:24px}.cm-content,.cm-gutter{min-height:51px}.one-line-scroll .cm-content,.one-line-scroll .cm-gutter{min-height:auto} \ No newline at end of file +body{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Roboto","Oxygen","Ubuntu","Cantarell","Fira Sans","Droid Sans","Helvetica Neue",sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}code{font-family:source-code-pro,Menlo,Monaco,Consolas,"Courier New",monospace}.MuiAccordionSummary-content{margin:10px 0!important}.cm-activeLine{background-color:inherit!important}.cm-wrap{border-radius:4px;border:1px solid #b9b9b9;font-size:10px}.one-line-scroll .cm-wrap{height:24px}.cm-content,.cm-gutter{min-height:51px}.one-line-scroll .cm-content,.one-line-scroll .cm-gutter{min-height:auto}.uplot .u-legend{display:grid;align-items:center;justify-content:start;text-align:left;margin-top:25px}.uplot .u-legend .u-series{font-size:12px} \ No newline at end of file diff --git a/app/vmselect/vmui/static/js/2.537d84e3.chunk.js b/app/vmselect/vmui/static/js/2.537d84e3.chunk.js deleted file mode 100644 index 54c1b7a75..000000000 --- a/app/vmselect/vmui/static/js/2.537d84e3.chunk.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! For license information please see 2.537d84e3.chunk.js.LICENSE.txt */ -(this.webpackJsonpvmui=this.webpackJsonpvmui||[]).push([[2],[function(e,t,n){"use strict";e.exports=n(225)},function(e,t,n){"use strict";n.d(t,"a",(function(){return Ke})),n.d(t,"b",(function(){return xt})),n.d(t,"c",(function(){return S})),n.d(t,"d",(function(){return un})),n.d(t,"e",(function(){return nn})),n.d(t,"f",(function(){return hn})),n.d(t,"g",(function(){return l})),n.d(t,"h",(function(){return dn})),n.d(t,"i",(function(){return H})),n.d(t,"j",(function(){return tn})),n.d(t,"k",(function(){return q})),n.d(t,"l",(function(){return K})),n.d(t,"m",(function(){return O})),n.d(t,"n",(function(){return j})),n.d(t,"o",(function(){return jt})),n.d(t,"p",(function(){return ne})),n.d(t,"q",(function(){return $})),n.d(t,"r",(function(){return tt})),n.d(t,"s",(function(){return ue})),n.d(t,"t",(function(){return rt})),n.d(t,"u",(function(){return F})),n.d(t,"v",(function(){return st})),n.d(t,"w",(function(){return ft})),n.d(t,"x",(function(){return ct})),n.d(t,"y",(function(){return kt})),n.d(t,"z",(function(){return f})),n.d(t,"A",(function(){return d})),n.d(t,"B",(function(){return Dt})),n.d(t,"C",(function(){return wt})),n.d(t,"D",(function(){return T})),n.d(t,"E",(function(){return L})),n.d(t,"F",(function(){return Ge})),n.d(t,"G",(function(){return I})),n.d(t,"H",(function(){return Rt})),n.d(t,"I",(function(){return At})),n.d(t,"J",(function(){return Lt})),n.d(t,"K",(function(){return _})),n.d(t,"L",(function(){return v})),n.d(t,"M",(function(){return u})),n.d(t,"N",(function(){return ee})),n.d(t,"O",(function(){return X})),n.d(t,"P",(function(){return J})),n.d(t,"Q",(function(){return Z})),n.d(t,"R",(function(){return re})),n.d(t,"S",(function(){return nt})),n.d(t,"T",(function(){return Mt})),n.d(t,"U",(function(){return St})),n.d(t,"V",(function(){return fn})),n.d(t,"W",(function(){return it})),n.d(t,"X",(function(){return z})),n.d(t,"Y",(function(){return C})),n.d(t,"Z",(function(){return ie})),n.d(t,"ab",(function(){return bt})),n.d(t,"bb",(function(){return en})),n.d(t,"cb",(function(){return Cn})),n.d(t,"db",(function(){return Sn})),n.d(t,"eb",(function(){return vn})),n.d(t,"fb",(function(){return mn})),n.d(t,"gb",(function(){return pn})),n.d(t,"hb",(function(){return lt})),n.d(t,"ib",(function(){return ut})),n.d(t,"jb",(function(){return at})),n.d(t,"kb",(function(){return pt})),n.d(t,"lb",(function(){return yt})),n.d(t,"mb",(function(){return Ot})),n.d(t,"nb",(function(){return jn})),n.d(t,"ob",(function(){return se})),n.d(t,"pb",(function(){return yn})),n.d(t,"qb",(function(){return On})),n.d(t,"rb",(function(){return h})),n.d(t,"sb",(function(){return xn})),n.d(t,"tb",(function(){return p})),n.d(t,"ub",(function(){return ae})),n.d(t,"vb",(function(){return g})),n.d(t,"wb",(function(){return Ye})),n.d(t,"xb",(function(){return et})),n.d(t,"yb",(function(){return pe})),n.d(t,"zb",(function(){return R})),n.d(t,"Ab",(function(){return y})),n.d(t,"Bb",(function(){return N})),n.d(t,"Cb",(function(){return b})),n.d(t,"Db",(function(){return m})),n.d(t,"Eb",(function(){return k})),n.d(t,"Fb",(function(){return Tt})),n.d(t,"Gb",(function(){return w})),n.d(t,"Hb",(function(){return bn})),n.d(t,"Ib",(function(){return ce})),n.d(t,"Jb",(function(){return G})),n.d(t,"Kb",(function(){return le})),n.d(t,"Lb",(function(){return c})),n.d(t,"Mb",(function(){return Y})),n.d(t,"Nb",(function(){return te})),n.d(t,"Ob",(function(){return _t})),n.d(t,"Pb",(function(){return x})),n.d(t,"Qb",(function(){return Ct})),n.d(t,"Rb",(function(){return cn})),n.d(t,"Sb",(function(){return ot})),n.d(t,"Tb",(function(){return Et}));var r=n(25),i=n(13),a=n(4),o=n(6),s=n(7);var c="undefined"===typeof window?function(e){return e()}:window.requestAnimationFrame;function l(e,t,n){var r=n||function(e){return Array.prototype.slice.call(e)},i=!1,a=[];return function(){for(var n=arguments.length,o=new Array(n),s=0;s=0;i--)t.call(n,e[i],i);else for(i=0;in;)e=e[t.substr(n,r-n)],r=A(t,n=r+1);return e}function L(e){return e.charAt(0).toUpperCase()+e.slice(1)}var N=function(e){return"undefined"!==typeof e},I=function(e){return"function"===typeof e},z=function(e,t){if(e.size!==t.size)return!1;var n,r=Object(s.a)(e);try{for(r.s();!(n=r.n()).done;){var i=n.value;if(!t.has(i))return!1}}catch(a){r.e(a)}finally{r.f()}return!0},$=Math.PI,F=2*$,B=F+$,Q=Number.POSITIVE_INFINITY,W=$/180,H=$/2,V=$/4,U=2*$/3,q=Math.log10,Y=Math.sign;function X(e){var t=Math.round(e);e=Z(e,t,e/1e3)?t:e;var n=Math.pow(10,Math.floor(q(e))),r=e/n;return(r<=1?1:r<=2?2:r<=5?5:10)*n}function K(e){var t,n=[],r=Math.sqrt(e);for(t=1;t=e}function ee(e,t,n){var r,i,a;for(r=0,i=e.length;rc&&l=1?e:-(Math.sqrt(1-e*e)-1)},easeOutCirc:function(e){return Math.sqrt(1-(e-=1)*e)},easeInOutCirc:function(e){return(e/=.5)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)},easeInElastic:function(e){return fe(e)?e:de(e,.075,.3)},easeOutElastic:function(e){return fe(e)?e:he(e,.075,.3)},easeInOutElastic:function(e){var t=.1125;return fe(e)?e:e<.5?.5*de(2*e,t,.45):.5+.5*he(2*e-1,t,.45)},easeInBack:function(e){var t=1.70158;return e*e*((t+1)*e-t)},easeOutBack:function(e){var t=1.70158;return(e-=1)*e*((t+1)*e+t)+1},easeInOutBack:function(e){var t=1.70158;return(e/=.5)<1?e*e*((1+(t*=1.525))*e-t)*.5:.5*((e-=2)*e*((1+(t*=1.525))*e+t)+2)},easeInBounce:function(e){return 1-pe.easeOutBounce(1-e)},easeOutBounce:function(e){var t=7.5625,n=2.75;return e<1/n?t*e*e:e<2/n?t*(e-=1.5/n)*e+.75:e<2.5/n?t*(e-=2.25/n)*e+.9375:t*(e-=2.625/n)*e+.984375},easeInOutBounce:function(e){return e<.5?.5*pe.easeInBounce(2*e):.5*pe.easeOutBounce(2*e-1)+.5}},ve={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},me="0123456789ABCDEF",ge=function(e){return me[15&e]},be=function(e){return me[(240&e)>>4]+me[15&e]},ye=function(e){return(240&e)>>4===(15&e)};function Oe(e){var t=function(e){return ye(e.r)&&ye(e.g)&&ye(e.b)&&ye(e.a)}(e)?ge:be;return e?"#"+t(e.r)+t(e.g)+t(e.b)+(e.a<255?t(e.a):""):e}function xe(e){return e+.5|0}var ke=function(e,t,n){return Math.max(Math.min(e,n),t)};function we(e){return ke(xe(2.55*e),0,255)}function je(e){return ke(xe(255*e),0,255)}function Se(e){return ke(xe(e/2.55)/100,0,1)}function Ce(e){return ke(xe(100*e),0,100)}var Ee=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;var Me=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Pe(e,t,n){var r=t*Math.min(n,1-n),i=function(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(t+e/30)%12;return n-r*Math.max(Math.min(i-3,9-i,1),-1)};return[i(0),i(8),i(4)]}function Te(e,t,n){var r=function(r){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(r+e/60)%6;return n-n*t*Math.max(Math.min(i,4-i,1),0)};return[r(5),r(3),r(1)]}function _e(e,t,n){var r,i=Pe(e,1,.5);for(t+n>1&&(t*=r=1/(t+n),n*=r),r=0;r<3;r++)i[r]*=1-t-n,i[r]+=t;return i}function De(e){var t,n,r,i=e.r/255,a=e.g/255,o=e.b/255,s=Math.max(i,a,o),c=Math.min(i,a,o),l=(s+c)/2;return s!==c&&(r=s-c,n=l>.5?r/(2-s-c):r/(s+c),t=60*(t=s===i?(a-o)/r+(a>16&255,n>>8&255,255&n]}return a}()).transparent=[0,0,0,0]);var t=Ie[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:4===t.length?t[3]:255}}function Be(e,t,n){if(e){var r=De(e);r[t]=Math.max(0,Math.min(r[t]+r[t]*n,0===t?360:1)),r=Re(r),e.r=r[0],e.g=r[1],e.b=r[2]}}function Qe(e,t){return e?Object.assign(t||{},e):e}function We(e){var t={r:0,g:0,b:0,a:255};return Array.isArray(e)?e.length>=3&&(t={r:e[0],g:e[1],b:e[2],a:255},e.length>3&&(t.a=je(e[3]))):(t=Qe(e,{r:0,g:0,b:0,a:1})).a=je(t.a),t}function He(e){return"r"===e.charAt(0)?function(e){var t,n,r,i=Ee.exec(e),a=255;if(i){if(i[7]!==t){var o=+i[7];a=255&(i[8]?we(o):255*o)}return t=+i[1],n=+i[3],r=+i[5],{r:t=255&(i[2]?we(t):t),g:n=255&(i[4]?we(n):n),b:r=255&(i[6]?we(r):r),a:a}}}(e):Ne(e)}var Ve=function(){function e(t){if(Object(a.a)(this,e),t instanceof e)return t;var n,r=typeof t;"object"===r?n=We(t):"string"===r&&(n=function(e){var t,n=e.length;return"#"===e[0]&&(4===n||5===n?t={r:255&17*ve[e[1]],g:255&17*ve[e[2]],b:255&17*ve[e[3]],a:5===n?17*ve[e[4]]:255}:7!==n&&9!==n||(t={r:ve[e[1]]<<4|ve[e[2]],g:ve[e[3]]<<4|ve[e[4]],b:ve[e[5]]<<4|ve[e[6]],a:9===n?ve[e[7]]<<4|ve[e[8]]:255})),t}(t)||Fe(t)||He(t)),this._rgb=n,this._valid=!!n}return Object(o.a)(e,[{key:"rgbString",value:function(){return this._valid?(e=this._rgb)&&(e.a<255?"rgba(".concat(e.r,", ").concat(e.g,", ").concat(e.b,", ").concat(Se(e.a),")"):"rgb(".concat(e.r,", ").concat(e.g,", ").concat(e.b,")")):this._rgb;var e}},{key:"hexString",value:function(){return this._valid?Oe(this._rgb):this._rgb}},{key:"hslString",value:function(){return this._valid?function(e){if(e){var t=De(e),n=t[0],r=Ce(t[1]),i=Ce(t[2]);return e.a<255?"hsla(".concat(n,", ").concat(r,"%, ").concat(i,"%, ").concat(Se(e.a),")"):"hsl(".concat(n,", ").concat(r,"%, ").concat(i,"%)")}}(this._rgb):this._rgb}},{key:"mix",value:function(e,t){var n=this;if(e){var r,i=n.rgb,a=e.rgb,o=t===r?.5:t,s=2*o-1,c=i.a-a.a,l=((s*c===-1?s:(s+c)/(1+s*c))+1)/2;r=1-l,i.r=255&l*i.r+r*a.r+.5,i.g=255&l*i.g+r*a.g+.5,i.b=255&l*i.b+r*a.b+.5,i.a=o*i.a+(1-o)*a.a,n.rgb=i}return n}},{key:"clone",value:function(){return new e(this.rgb)}},{key:"alpha",value:function(e){return this._rgb.a=je(e),this}},{key:"clearer",value:function(e){return this._rgb.a*=1-e,this}},{key:"greyscale",value:function(){var e=this._rgb,t=xe(.3*e.r+.59*e.g+.11*e.b);return e.r=e.g=e.b=t,this}},{key:"opaquer",value:function(e){return this._rgb.a*=1+e,this}},{key:"negate",value:function(){var e=this._rgb;return e.r=255-e.r,e.g=255-e.g,e.b=255-e.b,this}},{key:"lighten",value:function(e){return Be(this._rgb,2,e),this}},{key:"darken",value:function(e){return Be(this._rgb,2,-e),this}},{key:"saturate",value:function(e){return Be(this._rgb,1,e),this}},{key:"desaturate",value:function(e){return Be(this._rgb,1,-e),this}},{key:"rotate",value:function(e){return function(e,t){var n=De(e);n[0]=Le(n[0]+t),n=Re(n),e.r=n[0],e.g=n[1],e.b=n[2]}(this._rgb,e),this}},{key:"valid",get:function(){return this._valid}},{key:"rgb",get:function(){var e=Qe(this._rgb);return e&&(e.a=Se(e.a)),e},set:function(e){this._rgb=We(e)}}]),e}();function Ue(e){return new Ve(e)}var qe=function(e){return e instanceof CanvasGradient||e instanceof CanvasPattern};function Ye(e){return qe(e)?e:Ue(e)}function Xe(e){return qe(e)?e:Ue(e).saturate(.5).darken(.1).hexString()}var Ke=Object.create(null),Ge=Object.create(null);function Ze(e,t){if(!t)return e;for(var n=t.split("."),r=0,i=n.length;rr&&(r=a),r}function nt(e,t,n,r){var i=(r=r||{}).data=r.data||{},a=r.garbageCollect=r.garbageCollect||[];r.font!==t&&(i=r.data={},a=r.garbageCollect=[],r.font=t),e.save(),e.font=t;var o,s,c,l,u,f=0,d=n.length;for(o=0;on.length){for(o=0;o0&&e.stroke()}}function ot(e,t,n){return n=n||.5,!t||e&&e.x>t.left-n&&e.xt.top-n&&e.y5&&void 0!==arguments[5]?arguments[5]:{},c=g(t)?t:[t],l=s.strokeWidth>0&&""!==s.strokeColor;for(e.save(),e.font=i.string,dt(e,s),a=0;a1;)n(r=a+i>>1)?a=r:i=r;return{lo:a,hi:i}}var Ct=function(e,t,n){return St(e,n,(function(r){return e[r][t]=n}))};function Mt(e,t,n){for(var r=0,i=e.length;rr&&e[i-1]>n;)i--;return r>0||i0||(Pt.forEach((function(t){delete e[t]})),delete e._chartjs)}}function Dt(e){var t,n,r=new Set;for(t=0,n=e.length;t1&&void 0!==arguments[1]?arguments[1]:[""],a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e,o=arguments.length>3?arguments[3]:void 0,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:function(){return e[0]};N(o)||(o=Vt("_fallback",e));var c=(t={},Object(i.a)(t,Symbol.toStringTag,"Object"),Object(i.a)(t,"_cacheable",!0),Object(i.a)(t,"_scopes",e),Object(i.a)(t,"_rootScopes",a),Object(i.a)(t,"_fallback",o),Object(i.a)(t,"_getTarget",s),Object(i.a)(t,"override",(function(t){return At([t].concat(Object(r.a)(e)),n,a,o)})),t);return new Proxy(c,{deleteProperty:function(t,n){return delete t[n],delete t._keys,delete e[0][n],!0},get:function(t,r){return zt(t,r,(function(){return Ht(r,n,e,t)}))},getOwnPropertyDescriptor:function(e,t){return Reflect.getOwnPropertyDescriptor(e._scopes[0],t)},getPrototypeOf:function(){return Reflect.getPrototypeOf(e[0])},has:function(e,t){return Ut(e).includes(t)},ownKeys:function(e){return Ut(e)},set:function(e,t,n){return(e._storage||(e._storage=s()))[t]=n,delete e[t],delete e._keys,!0}})}function Rt(e,t,n,r){var i={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:Lt(e,r),setContext:function(t){return Rt(e,t,n,r)},override:function(i){return Rt(e.override(i),t,n,r)}};return new Proxy(i,{deleteProperty:function(t,n){return delete t[n],delete e[n],!0},get:function(e,t,n){return zt(e,t,(function(){return function(e,t,n){var r=e._proxy,i=e._context,a=e._subProxy,o=e._descriptors,c=r[t];I(c)&&o.isScriptable(t)&&(c=function(e,t,n,r){var i=n._proxy,a=n._context,o=n._subProxy,s=n._stack;if(s.has(e))throw new Error("Recursion detected: "+Array.from(s).join("->")+"->"+e);s.add(e),t=t(a,o||r),s.delete(e),b(t)&&(t=Qt(i._scopes,i,e,t));return t}(t,c,e,n));g(c)&&c.length&&(c=function(e,t,n,r){var i=n._proxy,a=n._context,o=n._subProxy,c=n._descriptors;if(N(a.index)&&r(e))t=t[a.index%t.length];else if(b(t[0])){var l=t,u=i._scopes.filter((function(e){return e!==l}));t=[];var f,d=Object(s.a)(l);try{for(d.s();!(f=d.n()).done;){var h=Qt(u,i,e,f.value);t.push(Rt(h,a,o&&o[e],c))}}catch(p){d.e(p)}finally{d.f()}}return t}(t,c,e,o.isIndexable));It(t,c)&&(c=Rt(c,i,a&&a[t],o));return c}(e,t,n)}))},getOwnPropertyDescriptor:function(t,n){return t._descriptors.allKeys?Reflect.has(e,n)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,n)},getPrototypeOf:function(){return Reflect.getPrototypeOf(e)},has:function(t,n){return Reflect.has(e,n)},ownKeys:function(){return Reflect.ownKeys(e)},set:function(t,n,r){return e[n]=r,delete t[n],!0}})}function Lt(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{scriptable:!0,indexable:!0},n=e._scriptable,r=void 0===n?t.scriptable:n,i=e._indexable,a=void 0===i?t.indexable:i,o=e._allKeys,s=void 0===o?t.allKeys:o;return{allKeys:s,scriptable:r,indexable:a,isScriptable:I(r)?r:function(){return r},isIndexable:I(a)?a:function(){return a}}}var Nt=function(e,t){return e?e+L(t):t},It=function(e,t){return b(t)&&"adapters"!==e};function zt(e,t,n){var r=e[t];return N(r)||(r=n(),N(r)&&(e[t]=r)),r}function $t(e,t,n){return I(e)?e(t,n):e}var Ft=function(e,t){return!0===e?t:"string"===typeof e?R(t,e):void 0};function Bt(e,t,n,r){var i,a=Object(s.a)(t);try{for(a.s();!(i=a.n()).done;){var o=i.value,c=Ft(n,o);if(c){e.add(c);var l=$t(c._fallback,n,c);if(N(l)&&l!==n&&l!==r)return l}else if(!1===c&&N(r)&&n!==r)return null}}catch(u){a.e(u)}finally{a.f()}return!1}function Qt(e,t,n,i){var a=t._rootScopes,o=$t(t._fallback,n,i),s=[].concat(Object(r.a)(e),Object(r.a)(a)),c=new Set;c.add(i);var l=Wt(c,s,n,o||n);return null!==l&&((!N(o)||o===n||null!==(l=Wt(c,s,o,l)))&&At(Array.from(c),[""],a,o,(function(){return function(e,t,n){var r=e._getTarget();t in r||(r[t]={});var i=r[t];if(g(i)&&b(n))return n;return i}(t,n,i)})))}function Wt(e,t,n,r){for(;n;)n=Bt(e,t,n,r);return n}function Ht(e,t,n,r){var i,a,o=Object(s.a)(t);try{for(o.s();!(a=o.n()).done;){var c=a.value;if(i=Vt(Nt(c,e),n),N(i))return It(e,i)?Qt(n,r,e,i):i}}catch(l){o.e(l)}finally{o.f()}}function Vt(e,t){var n,r=Object(s.a)(t);try{for(r.s();!(n=r.n()).done;){var i=n.value;if(i){var a=i[e];if(N(a))return a}}}catch(o){r.e(o)}finally{r.f()}}function Ut(e){var t=e._keys;return t||(t=e._keys=function(e){var t,n=new Set,r=Object(s.a)(e);try{for(r.s();!(t=r.n()).done;){var i,a=t.value,o=Object(s.a)(Object.keys(a).filter((function(e){return!e.startsWith("_")})));try{for(o.s();!(i=o.n()).done;){var c=i.value;n.add(c)}}catch(l){o.e(l)}finally{o.f()}}}catch(l){r.e(l)}finally{r.f()}return Array.from(n)}(e._scopes)),t}var qt=Number.EPSILON||1e-14,Yt=function(e,t){return t2&&void 0!==arguments[2]?arguments[2]:"x",o=Xt(a),s=e.length,c=Yt(e,0),l=0;l1&&void 0!==arguments[1]?arguments[1]:"x",a=Xt(i),o=e.length,s=Array(o).fill(0),c=Array(o),l=Yt(e,0);for(t=0;t0||t>0)&&(!n||!n.shadowRoot)}(s,c,i.target))n=s,r=c;else{var u=t.getBoundingClientRect();n=o.clientX-u.left,r=o.clientY-u.top,l=!0}return{x:n,y:r,box:l}}(e,n),l=c.x,u=c.y,f=c.box,d=o.left+(f&&s.left),h=o.top+(f&&s.top),p=t.width,v=t.height;return a&&(p-=o.width+s.width,v-=o.height+s.height),{x:Math.round((l-d)/p*n.width/r),y:Math.round((u-h)/v*n.height/r)}}var ln=function(e){return Math.round(10*e)/10};function un(e,t,n,r){var i=an(e),a=sn(i,"margin"),o=rn(i.maxWidth,e,"clientWidth")||Q,s=rn(i.maxHeight,e,"clientHeight")||Q,c=function(e,t,n){var r,i;if(void 0===t||void 0===n){var a=nn(e);if(a){var o=a.getBoundingClientRect(),s=an(a),c=sn(s,"border","width"),l=sn(s,"padding");t=o.width-l.width-c.width,n=o.height-l.height-c.height,r=rn(s.maxWidth,a,"clientWidth"),i=rn(s.maxHeight,a,"clientHeight")}else t=e.clientWidth,n=e.clientHeight}return{width:t,height:n,maxWidth:r||Q,maxHeight:i||Q}}(e,t,n),l=c.width,u=c.height;if("content-box"===i.boxSizing){var f=sn(i,"border","width"),d=sn(i,"padding");l-=d.width+f.width,u-=d.height+f.height}return l=Math.max(0,l-a.width),u=Math.max(0,r?Math.floor(l/r):u-a.height),l=ln(Math.min(l,o,c.maxWidth)),u=ln(Math.min(u,s,c.maxHeight)),l&&!u&&(u=ln(l/2)),{width:l,height:u}}function fn(e,t,n){var r=t||1,i=Math.floor(e.height*r),a=Math.floor(e.width*r);e.height=i/r,e.width=a/r;var o=e.canvas;return o.style&&(n||!o.style.height&&!o.style.width)&&(o.style.height="".concat(e.height,"px"),o.style.width="".concat(e.width,"px")),(e.currentDevicePixelRatio!==r||o.height!==i||o.width!==a)&&(e.currentDevicePixelRatio=r,o.height=i,o.width=a,e.ctx.setTransform(r,0,0,r,0,0),!0)}var dn=function(){var e=!1;try{var t={get passive(){return e=!0,!1}};window.addEventListener("test",null,t),window.removeEventListener("test",null,t)}catch(n){}return e}();function hn(e,t){var n=function(e,t){return an(e).getPropertyValue(t)}(e,t),r=n&&n.match(/^(\d+)(\.\d+)?px$/);return r?+r[1]:void 0}function pn(e,t,n,r){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function vn(e,t,n,r){return{x:e.x+n*(t.x-e.x),y:"middle"===r?n<.5?e.y:t.y:"after"===r?n<1?e.y:t.y:n>0?t.y:e.y}}function mn(e,t,n,r){var i={x:e.cp2x,y:e.cp2y},a={x:t.cp1x,y:t.cp1y},o=pn(e,i,n),s=pn(i,a,n),c=pn(a,t,n),l=pn(o,s,n),u=pn(s,c,n);return pn(l,u,n)}var gn=new Map;function bn(e,t,n){return function(e,t){t=t||{};var n=e+JSON.stringify(t),r=gn.get(n);return r||(r=new Intl.NumberFormat(e,t),gn.set(n,r)),r}(t,n).format(e)}function yn(e,t,n){return e?function(e,t){return{x:function(n){return e+e+t-n},setWidth:function(e){t=e},textAlign:function(e){return"center"===e?e:"right"===e?"left":"right"},xPlus:function(e,t){return e-t},leftForLtr:function(e,t){return e-t}}}(t,n):{x:function(e){return e},setWidth:function(e){},textAlign:function(e){return e},xPlus:function(e,t){return e+t},leftForLtr:function(e,t){return e}}}function On(e,t){var n,r;"ltr"!==t&&"rtl"!==t||(r=[(n=e.canvas.style).getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",t,"important"),e.prevTextDirection=r)}function xn(e,t){void 0!==t&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function kn(e){return"angle"===e?{between:ce,compare:oe,normalize:se}:{between:function(e,t,n){return e>=Math.min(t,n)&&e<=Math.max(n,t)},compare:function(e,t){return e-t},normalize:function(e){return e}}}function wn(e){var t=e.start,n=e.end,r=e.count;return{start:t%r,end:n%r,loop:e.loop&&(n-t+1)%r===0,style:e.style}}function jn(e,t,n){if(!n)return[e];for(var r,i,a,o=n.property,s=n.start,c=n.end,l=t.length,u=kn(o),f=u.compare,d=u.between,h=u.normalize,p=function(e,t,n){var r,i,a=n.property,o=n.start,s=n.end,c=kn(a),l=c.between,u=c.normalize,f=t.length,d=e.start,h=e.end,p=e.loop;if(p){for(d+=f,h+=f,r=0,i=f;ri&&e[a%t].skip;)a--;return{start:i,end:a%=t}}(n,i,a,r),s=o.start,c=o.end;return En(e,!0===r?[{start:s,end:c,loop:a}]:function(e,t,n,r){var i,a=e.length,o=[],s=t,c=e[t];for(i=t+1;i<=n;++i){var l=e[i%a];l.skip||l.stop?c.skip||(r=!1,o.push({start:t%a,end:(i-1)%a,loop:r}),t=s=l.stop?i:null):(s=i,c.skip&&(t=i)),c=l}return null!==s&&o.push({start:t%a,end:s%a,loop:r}),o}(n,s,c1&&void 0!==arguments[1]&&arguments[1];m(this,e,t)}},{key:"composeDesc",value:function(e){return this.empty?e:e.empty?this:b(this,e)}},{key:"mapDesc",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return e.empty?this:g(this,e,t)}},{key:"mapPos",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.Simple,r=0,i=0,a=0;ae)return i+(e-r);i+=o}else{if(n!=l.Simple&&c>=e&&(n==l.TrackDel&&re||n==l.TrackBefore&&re))return-1;if(c>e||c==e&&t<0&&!o)return e==r||t<0?i:i+s;i+=s}r=c}if(e>r)throw new RangeError("Position ".concat(e," is out of range for changeset of length ").concat(r));return i}},{key:"mapPosStable",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,n=0,r=0,i=0,a=0;ae)return r+Math.max(0,e-n);i=r+=o}else{if(t<=0&&c>=e)return i;r+=s}n=c}return r}},{key:"touchesRange",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,n=0,r=0;n=0&&r<=t&&o>=e)return!(rt)||"cover";r=o}return!1}},{key:"toString",value:function(){for(var e="",t=0;t=0?":"+r:"")}return e}},{key:"length",get:function(){for(var e=0,t=0;t1&&void 0!==arguments[1]&&arguments[1];return g(this,e,t,!0)}},{key:"invert",value:function(e){for(var t=this.sections.slice(),r=[],i=0,a=0;i=0){t[i]=s,t[i+1]=o;for(var l=i>>1;r.length1&&void 0!==arguments[1]&&arguments[1];return e.empty?this:g(this,e,t,!0)}},{key:"iterChanges",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];m(this,e,t)}},{key:"filter",value:function(e){var t=[],r=[],i=[],a=new y(this);e:for(var o=0,s=0;;){for(var c=o==e.length?1e9:e[o++];s0&&v(r,t,a.text),a.forward(l),s+=l}for(var f=e[o++];s>1].toJSON()])}return e}},{key:"desc",get:function(){return new d(this.sections)}}],[{key:"of",value:function(e,t,i){var a=[],o=[],s=0,l=null;function u(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(e||a.length){sy||g<0||y>t)throw new RangeError("Invalid change range ".concat(g," to ").concat(y," (in doc of length ").concat(t,")"));var x=O?"string"==typeof O?c.a.of(O.split(i||f)):O:c.a.empty,k=x.length;if(g==y&&0==k)return;gs&&p(a,g-s,-1),p(a,y-g,k),v(o,a,x),s=y}}(e),u(!l),l}},{key:"empty",value:function(e){return new n(e?[e,-1]:[],[])}},{key:"fromJSON",value:function(e){for(var t=[],r=[],i=0;i3&&void 0!==arguments[3]&&arguments[3];if(!(0==t&&n<=0)){var i=e.length-2;i>=0&&n<=0&&n==e[i+1]?e[i]+=t:0==t&&0==e[i]?e[i+1]+=n:r?(e[i]+=t,e[i+1]+=n):e.push(t,n)}}function v(e,t,n){if(0!=n.length){var r=t.length-2>>1;if(r>1])),!(n||o==e.sections.length||e.sections[o+1]<0);)s=e.sections[o++],l=e.sections[o++];t(i,u,a,f,d),i=u,a=f}}}function g(e,t,n){for(var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=[],a=r?[]:null,o=new y(e),s=new y(t),c=0,l=0;;)if(-1==o.ins)c+=o.len,o.next();else if(-1==s.ins&&l=0&&(o.done||ll&&!o.done&&c+o.len=0)){if(o.done&&s.done)return a?new h(i,a):new d(i);throw new Error("Mismatched change set lengths")}for(var f=0,m=c+o.len;;)if(s.ins>=0&&l>c&&l+s.len2&&void 0!==arguments[2]&&arguments[2],r=[],i=n?[]:null,a=new y(e),o=new y(t),s=!1;;){if(a.done&&o.done)return i?new h(r,i):new d(r);if(0==a.ins)p(r,a.len,0,s),a.next();else if(0!=o.len||o.done){if(a.done||o.done)throw new Error("Mismatched change set lengths");var c=Math.min(a.len2,o.len),l=r.length;if(-1==a.ins){var u=-1==o.ins?-1:o.off?0:o.ins;p(r,c,u,s),i&&u&&v(i,r,o.text)}else-1==o.ins?(p(r,a.off?0:a.len,c,s),i&&v(i,r,a.textBit(c))):(p(r,a.off?0:a.len,o.off?0:o.ins,s),i&&!o.off&&v(i,r,o.text));s=(a.ins>c||o.ins>=0&&o.len>c)&&(s||r.length>l),a.forward2(c),o.forward(c)}else p(r,0,o.ins,s),i&&v(i,r,o.text),o.next()}}var y=function(){function e(t){Object(o.a)(this,e),this.set=t,this.i=0,this.next()}return Object(s.a)(e,[{key:"next",value:function(){var e=this.set.sections;this.i>1;return n>=t.length&&!e?c.a.empty:t[n].slice(this.off,null==e?void 0:this.off+e)}},{key:"forward",value:function(e){e==this.len?this.next():(this.len-=e,this.off+=e)}},{key:"forward2",value:function(e){-1==this.ins?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}},{key:"done",get:function(){return-2==this.ins}},{key:"len2",get:function(){return this.ins<0?this.len:this.ins}},{key:"text",get:function(){var e=this.set.inserted,t=this.i-2>>1;return t>=e.length?c.a.empty:e[t]}}]),e}(),O=function(){function e(t,n,r){Object(o.a)(this,e),this.from=t,this.to=n,this.flags=r}return Object(s.a)(e,[{key:"map",value:function(t){var n=t.mapPos(this.from),r=t.mapPos(this.to);return n==this.from&&r==this.to?this:new e(n,r,this.flags)}},{key:"extend",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;if(e<=this.anchor&&t>=this.anchor)return x.range(e,t);var n=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return x.range(this.anchor,n)}},{key:"eq",value:function(e){return this.anchor==e.anchor&&this.head==e.head}},{key:"toJSON",value:function(){return{anchor:this.anchor,head:this.head}}},{key:"anchor",get:function(){return 16&this.flags?this.to:this.from}},{key:"head",get:function(){return 16&this.flags?this.from:this.to}},{key:"empty",get:function(){return this.from==this.to}},{key:"assoc",get:function(){return 4&this.flags?-1:8&this.flags?1:0}},{key:"bidiLevel",get:function(){var e=3&this.flags;return 3==e?null:e}},{key:"goalColumn",get:function(){var e=this.flags>>5;return 33554431==e?void 0:e}}],[{key:"fromJSON",value:function(e){if(!e||"number"!=typeof e.anchor||"number"!=typeof e.head)throw new RangeError("Invalid JSON representation for SelectionRange");return x.range(e.anchor,e.head)}}]),e}(),x=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;Object(o.a)(this,e),this.ranges=t,this.primaryIndex=n}return Object(s.a)(e,[{key:"map",value:function(t){return t.empty?this:e.create(this.ranges.map((function(e){return e.map(t)})),this.primaryIndex)}},{key:"eq",value:function(e){if(this.ranges.length!=e.ranges.length||this.primaryIndex!=e.primaryIndex)return!1;for(var t=0;t1&&void 0!==arguments[1])||arguments[1];return e.create([t].concat(this.ranges),n?0:this.primaryIndex+1)}},{key:"replaceRange",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.primaryIndex,r=this.ranges.slice();return r[n]=t,e.create(r,this.primaryIndex)}},{key:"toJSON",value:function(){return{ranges:this.ranges.map((function(e){return e.toJSON()})),primaryIndex:this.primaryIndex}}},{key:"primary",get:function(){return this.ranges[this.primaryIndex]}}],[{key:"fromJSON",value:function(t){if(!t||!Array.isArray(t.ranges)||"number"!=typeof t.primaryIndex||t.primaryIndex>=t.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new e(t.ranges.map((function(e){return O.fromJSON(e)})),t.primaryIndex)}},{key:"single",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;return new e([e.range(t,n)],0)}},{key:"create",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(0==t.length)throw new RangeError("A selection needs at least one range");for(var r=0,i=0;i1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;return new O(e,e,(0==t?0:t<0?4:8)|(null==n?3:Math.min(2,n))|(null!==r&&void 0!==r?r:33554431)<<5)}},{key:"range",value:function(e,t,n){var r=(null!==n&&void 0!==n?n:33554431)<<5;return t1&&void 0!==arguments[1]?arguments[1]:0,n=e[t];e.sort((function(e,t){return e.from-t.from})),t=e.indexOf(n);for(var r=1;ri.head?x.range(s,o):x.range(o,s))}}return new x(e,t)}function w(e,t){var n,i=Object(r.a)(e.ranges);try{for(i.s();!(n=i.n()).done;){if(n.value.to>t)throw new RangeError("Selection points outside of document")}}catch(a){i.e(a)}finally{i.f()}}var j=0,S=function(){function e(t,n,r,i){Object(o.a)(this,e),this.combine=t,this.compareInput=n,this.compare=r,this.isStatic=i,this.id=j++,this.default=t([])}return Object(s.a)(e,[{key:"of",value:function(e){return new E([],this,0,e)}},{key:"compute",value:function(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new E(e,this,1,t)}},{key:"computeN",value:function(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new E(e,this,2,t)}},{key:"from",value:function(e,t){var n=this;return function(r){return D(t,n.compute([r],(function(t){return e(t.field(r))})))}}},{key:"nFrom",value:function(e,t){var n=this;return function(r){return D(t,n.computeN([r],(function(t){return e(t.field(r))})))}}}],[{key:"define",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new e(t.combine||function(e){return e},t.compareInput||function(e,t){return e===t},t.compare||(t.combine?function(e,t){return e===t}:C),!!t.static)}}]),e}();function C(e,t){return e==t||e.length==t.length&&e.every((function(e,n){return e===t[n]}))}var E=function(){function e(t,n,r,i){Object(o.a)(this,e),this.dependencies=t,this.facet=n,this.type=r,this.value=i,this.id=j++}return Object(s.a)(e,[{key:"dynamicSlot",value:function(e){var t,n=this.value,i=this.facet.compareInput,a=e[this.id]>>1,o=2==this.type,s=!1,c=!1,l=[],u=Object(r.a)(this.dependencies);try{for(u.s();!(t=u.n()).done;){var f=t.value;"doc"==f?s=!0:"selection"==f?c=!0:0==(1&e[f.id])&&l.push(e[f.id])}}catch(d){u.e(d)}finally{u.f()}return function(e,t){if(!t||t.reconfigure)return e.values[a]=n(e),1;if(!(s&&t.docChanged||c&&(t.docChanged||t.selection)||l.some((function(t){return(1&I(e,t))>0}))))return 0;var r=n(e),u=t.startState.values[a];return(o?function(e,t,n){if(e.length!=t.length)return!1;for(var r=0;r>1;return function(e,n){var c,l=n?n.reconfigure?n.startState.config.address[t.id]:s<<1:null,u=null==l,f=Object(r.a)(o);try{for(f.s();!(c=f.n()).done;){1&I(e,c.value)&&(u=!0)}}catch(y){f.e(y)}finally{f.f()}if(!u)return 0;for(var d=[],h=0;h>1;return function(e,r){if(!r)return e.values[n]=t.createF(e),1;var i,a=0;if(r.reconfigure){var o=function(e,t){var n=e.config.address[t];return null==n?null:n>>1}(r.startState,t.id);i=null==o?t.createF(r.startState):r.startState.values[o],a=1}else i=r.startState.values[n];var s=t.updateF(i,r);return a||t.compareF(i,s)||(a=1),a&&(e.values[n]=s),a}}}],[{key:"define",value:function(t){var n=[],i=new e(j++,t.create,t.update,t.compare||function(e,t){return e===t},n);if(t.provide){var a,o=Object(r.a)(t.provide);try{for(o.s();!(a=o.n()).done;){var s=a.value;s instanceof S?n.push(s.compute([i],(function(e){return e.field(i)}))):n.push(s(i))}}catch(c){o.e(c)}finally{o.f()}}return i}}]),e}(),T={fallback:3,default:2,extend:1,override:0};function _(e,t){if(!T.hasOwnProperty(t))throw new RangeError("Invalid precedence: ".concat(t));return new A(e,T[t])}function D(e,t){return e?_(t,e):t}var A=function e(t,n){Object(o.a)(this,e),this.e=t,this.prec=n},R=function e(t,n){Object(o.a)(this,e),this.tag=t,this.extension=n};var L=function(){function e(t,n,r,i,a){for(Object(o.a)(this,e),this.source=t,this.replacements=n,this.dynamicSlots=r,this.address=i,this.staticValues=a,this.statusTemplate=[];this.statusTemplate.length>1]}}],[{key:"resolve",value:function(t){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object.create(null),a=arguments.length>2?arguments[2]:void 0,o=[],s=Object.create(null),c=Object(r.a)(N(t,i));try{for(c.s();!(n=c.n()).done;){var l=n.value;l instanceof P?o.push(l):(s[l.facet.id]||(s[l.facet.id]=[])).push(l)}}catch(b){c.e(b)}finally{c.f()}for(var u=Object.create(null),f=[],d=[],h=function(){var e=v[p];u[e.id]=d.length<<1,d.push((function(t){return e.slot(t)}))},p=0,v=o;p=s)return;var l=n[c].indexOf(e);l>-1&&n[c].splice(l,1)}if(i.set(e,s),Array.isArray(e)){var u,f=Object(r.a)(e);try{for(f.s();!(u=f.n()).done;){o(u.value,s)}}catch(d){f.e(d)}finally{f.f()}}else if(e instanceof R){if(e.tag in a)throw new RangeError("Duplicate use of tag '".concat(String(e.tag),"' in extensions"));a[e.tag]=!0,o(t[e.tag]||e.extension,s)}else e.extension?o(e.extension,s):e instanceof A?o(e.e,e.prec):(n[s].push(e),e instanceof P&&o(e.facets,s))}o(e,T.default);var s,c,l=Object(r.a)((c=t,(Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(c):[]).concat(Object.keys(c))));try{for(l.s();!(s=l.n()).done;){var u=s.value;!(u in a)&&"full"!=u&&t[u]&&(a[u]=!0,o(t[u],T.default))}}catch(f){l.e(f)}finally{l.f()}return n.reduce((function(e,t){return e.concat(t)}))}function I(e,t){if(1&t)return 2;var n=t>>1,r=e.status[n];if(4==r)throw new Error("Cyclic dependency between fields and/or facets");if(2&r)return r;e.status[n]=4;var i=e.config.dynamicSlots[n](e,e.applying);return e.status[n]=2|i}function z(e,t){return 1&t?e.config.staticValues[t>>1]:e.values[t>>1]}var $=S.define({combine:function(e){return e.some((function(e){return e}))},static:!0}),F=S.define({combine:function(e){return e.length?e[0]:void 0},static:!0}),B=S.define(),Q=S.define(),W=new u.c,H=S.define(),V=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(o.a)(this,e),this.state=t,this.options=n}return Object(s.a)(e,[{key:"textAfterPos",value:function(e){var t,n,r=null===(t=this.options)||void 0===t?void 0:t.simulateBreak;return e==r&&(null===(n=this.options)||void 0===n?void 0:n.simulateDoubleBreak)?"":this.state.sliceDoc(e,Math.min(e+100,null!=r&&r>e?r:1e9,this.state.doc.lineAt(e).to))}},{key:"countColumn",value:function(e,t){return Object(c.d)(t<0?e:e.slice(0,t),0,this.state.tabSize)}},{key:"lineIndent",value:function(e){var t,n=null===(t=this.options)||void 0===t?void 0:t.overrideIndentation;if(n){var r=n(e.from);if(r>-1)return r}var i=e.slice(0,Math.min(100,e.length));return this.countColumn(i,i.search(/\S/))}},{key:"column",value:function(e){var t,n=this.state.doc.lineAt(e),r=n.slice(0,e-n.from),i=this.countColumn(r,e-n.from),a=(null===(t=this.options)||void 0===t?void 0:t.overrideIndentation)?this.options.overrideIndentation(n.from):-1;return a>-1&&(i+=a-this.countColumn(r,r.search(/\S/))),i}},{key:"unit",get:function(){return this.state.indentUnit}}]),e}(),U=function(){function e(t,n){Object(o.a)(this,e),this.type=t,this.value=n}return Object(s.a)(e,null,[{key:"define",value:function(){return new q}}]),e}(),q=function(){function e(){Object(o.a)(this,e)}return Object(s.a)(e,[{key:"of",value:function(e){return new U(this,e)}}]),e}(),Y=function(){function e(t,n){Object(o.a)(this,e),this.type=t,this.value=n}return Object(s.a)(e,[{key:"map",value:function(t){var n=this.type.map(this.value,t);return void 0===n?void 0:n==this.value?this:new e(this.type,n)}},{key:"is",value:function(e){return this.type==e}}],[{key:"define",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new X(e.map||function(e){return e})}},{key:"mapEffects",value:function(e,t){if(!e.length)return e;var n,i=[],a=Object(r.a)(e);try{for(a.s();!(n=a.n()).done;){var o=n.value.map(t);o&&i.push(o)}}catch(s){a.e(s)}finally{a.f()}return i}}]),e}(),X=function(){function e(t){Object(o.a)(this,e),this.map=t}return Object(s.a)(e,[{key:"of",value:function(e){return new Y(this,e)}}]),e}(),K=function(){function e(t,n,r,i,a,s,c){Object(o.a)(this,e),this.startState=t,this.changes=n,this.selection=r,this.effects=i,this.annotations=a,this.reconfigure=s,this.scrollIntoView=c,this._doc=null,this._state=null,r&&w(r,n.newLength),a.some((function(t){return t.type==e.time}))||(this.annotations=a.concat(e.time.of(Date.now())))}return Object(s.a)(e,[{key:"annotation",value:function(e){var t,n=Object(r.a)(this.annotations);try{for(n.s();!(t=n.n()).done;){var i=t.value;if(i.type==e)return i.value}}catch(a){n.e(a)}finally{n.f()}}},{key:"newDoc",get:function(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}},{key:"newSelection",get:function(){return this.selection||this.startState.selection.map(this.changes)}},{key:"state",get:function(){return this._state||this.startState.applyTransaction(this),this._state}},{key:"docChanged",get:function(){return!this.changes.empty}}]),e}();function G(e,t){for(var n=[],r=0,i=0;;){var a=void 0,o=void 0;if(r=e[r]))a=e[r++],o=e[r++];else{if(!(i=0;f--){var d=u[f](e);e=d instanceof K?d:Array.isArray(d)&&1==d.length&&d[0]instanceof K?d[0]:ee(n,Array.isArray(d)?d:[d],!1)}return e}(s):s}K.time=U.define(),K.userEvent=U.define(),K.addToHistory=U.define();var te,ne=[];!function(e){e[e.Word=0]="Word",e[e.Space=1]="Space",e[e.Other=2]="Other"}(te||(te={}));var re,ie=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;try{re=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch(ce){}function ae(e){return function(t){if(!/\S/.test(t))return te.Space;if(function(e){if(re)return re.test(e);for(var t=0;t"\x80"&&(n.toUpperCase()!=n.toLowerCase()||ie.test(n)))return!0}return!1}(t))return te.Word;for(var n=0;n-1)return te.Word;return te.Other}}var oe=function(){function e(t,n,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;if(Object(o.a)(this,e),this.config=t,this.doc=n,this.selection=r,this.applying=null,this.status=t.statusTemplate.slice(),i&&!i.reconfigure)this.values=i.startState.values.slice();else if(this.values=t.dynamicSlots.map((function(e){return null})),i)for(var a in t.address){var s=t.address[a],c=i.startState.config.address[a];null!=c&&0==(1&s)&&(this.values[s>>1]=z(i.startState,c))}this.applying=i,i&&(i._state=this);for(var l=0;l1&&void 0!==arguments[1])||arguments[1],n=this.config.address[e.id];if(null!=n)return I(this,n),z(this,n);if(t)throw new RangeError("Field is not present in this state")}},{key:"update",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n0&&void 0!==arguments[0]?arguments[0]:[];return t instanceof h?t:h.of(t,this.doc.length,this.facet(e.lineSeparator))}},{key:"toText",value:function(t){return c.a.of(t.split(this.facet(e.lineSeparator)||f))}},{key:"sliceDoc",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.doc.length;return this.doc.sliceString(e,t,this.lineBreak)}},{key:"facet",value:function(e){var t=this.config.address[e.id];return null==t?e.default:(I(this,t),z(this,t))}},{key:"toJSON",value:function(){return{doc:this.sliceDoc(),selection:this.selection.toJSON()}}},{key:"indentString",value:function(t){var n="";if(9==this.facet(e.indentUnit).charCodeAt(0))for(;t>=this.tabSize;)n+="\t",t-=this.tabSize;for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:{};if(!t||"string"!=typeof t.doc)throw new RangeError("Invalid JSON representation for EditorState");return e.create({doc:t.doc,selection:x.fromJSON(t.selection),extensions:n.extensions})}},{key:"create",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=L.resolve(t.extensions||[]),r=t.doc instanceof c.a?t.doc:c.a.of((t.doc||"").split(n.staticFacet(e.lineSeparator)||f)),i=t.selection?t.selection instanceof x?t.selection:x.single(t.selection.anchor,t.selection.head):x.single(0);return w(i,r.length),n.staticFacet($)||(i=i.asSingle()),new e(n,r,i)}}]),e}();function se(e,t){var n,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a={},o=Object(r.a)(e);try{for(o.s();!(n=o.n()).done;)for(var s=n.value,c=0,l=Object.keys(s);c=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,c=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return s=e.done,e},e:function(e){c=!0,o=e},f:function(){try{s||null==n.return||n.return()}finally{if(c)throw o}}}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(57);function i(e,t){if(null==e)return{};var n,i,a=Object(r.a)(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}},function(e,t,n){"use strict";function r(e){var t,n,i="";if("string"===typeof e||"number"===typeof e)i+=e;else if("object"===typeof e)if(Array.isArray(e))for(t=0;t",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"',229:"Q"},O="undefined"!=typeof navigator&&/Chrome\/(\d+)/.exec(navigator.userAgent),x="undefined"!=typeof navigator&&/Apple Computer/.test(navigator.vendor),k="undefined"!=typeof navigator&&/Gecko\/\d+/.test(navigator.userAgent),w="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),j="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),S=O&&(w||+O[1]<57)||k&&w,C=0;C<10;C++)b[48+C]=b[96+C]=String(C);for(C=1;C<=24;C++)b[C+111]="F"+C;for(C=65;C<=90;C++)b[C]=String.fromCharCode(C+32),y[C]=String.fromCharCode(C);for(var E in b)y.hasOwnProperty(E)||(y[E]=b[E]);var M="undefined"!=typeof navigator?[navigator,document]:[{userAgent:"",vendor:"",platform:""},{documentElement:{style:{}}}],P=Object(h.a)(M,2),T=P[0],_=P[1],D=/Edge\/(\d+)/.exec(T.userAgent),A=/MSIE \d/.test(T.userAgent),R=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(T.userAgent),L=!!(A||R||D),N=!L&&/gecko\/(\d+)/i.test(T.userAgent),I=!L&&/Chrome\/(\d+)/.exec(T.userAgent),z="webkitFontSmoothing"in _.documentElement.style,$={mac:/Mac/.test(T.platform),ie:L,ie_version:A?_.documentMode||6:R?+R[1]:D?+D[1]:0,gecko:N,gecko_version:N?+(/Firefox\/(\d+)/.exec(T.userAgent)||[0,0])[1]:0,chrome:!!I,chrome_version:I?+I[1]:0,ios:!L&&/AppleWebKit/.test(T.userAgent)&&/Mobile\/\w+/.test(T.userAgent),android:/Android\b/.test(T.userAgent),webkit:z,safari:/Apple Computer/.test(T.vendor),webkit_version:z?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,tabSize:null!=_.documentElement.style.tabSize?"tab-size":"-moz-tab-size"};function F(e){return e.getSelection?e.getSelection():document.getSelection()}function B(e,t){if(!t.anchorNode)return!1;try{return e.contains(3==t.anchorNode.nodeType?t.anchorNode.parentNode:t.anchorNode)}catch(n){return!1}}function Q(e){if(3==e.nodeType){var t=J();return t.setEnd(e,e.nodeValue.length),t.setStart(e,0),t.getClientRects()}return 1==e.nodeType?e.getClientRects():[]}function W(e,t,n,r){return!!n&&(V(e,t,n,r,-1)||V(e,t,n,r,1))}function H(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t}function V(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:U(e))){if("DIV"==e.nodeName)return!1;var a=e.parentNode;if(!a||1!=a.nodeType)return!1;t=H(e)+(i<0?0:1),e=a}else{if(1!=e.nodeType)return!1;e=e.childNodes[t+(i<0?-1:0)],t=i<0?U(e):0}}}function U(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function q(e,t){var n=t?e.left:e.right;return{left:n,right:n,top:e.top,bottom:e.bottom}}function Y(e){return{left:0,right:e.innerWidth,top:0,bottom:e.innerHeight}}var X,K=function(){function e(){Object(f.a)(this,e),this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}return Object(d.a)(e,[{key:"eq",value:function(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}},{key:"set",value:function(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}}]),e}(),G=null;function Z(e){if(e.setActive)return e.setActive();if(G)return e.focus(G);for(var t=[],n=e;n&&(t.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(e.focus(null==G?{get preventScroll(){return G={preventScroll:!0},!0}}:void 0),!G){G=!1;for(var r=0;r2&&void 0!==arguments[2])||arguments[2];Object(f.a)(this,e),this.node=t,this.offset=n,this.precise=r}return Object(d.a)(e,null,[{key:"before",value:function(t,n){return new e(t.parentNode,H(t),n)}},{key:"after",value:function(t,n){return new e(t.parentNode,H(t)+1,n)}}]),e}(),te=[],ne=function(){function e(){Object(f.a)(this,e),this.parent=null,this.dom=null,this.dirty=2}return Object(d.a)(e,[{key:"posBefore",value:function(e){var t,n=this.posAtStart,r=Object(u.a)(this.children);try{for(r.s();!(t=r.n()).done;){var i=t.value;if(i==e)return n;n+=i.length+i.breakAfter}}catch(a){r.e(a)}finally{r.f()}throw new RangeError("Invalid child in posBefore")}},{key:"posAfter",value:function(e){return this.posBefore(e)+e.length}},{key:"coordsAt",value:function(e,t){return null}},{key:"sync",value:function(t){if(2&this.dirty){var n,r=this.dom,i=null,a=Object(u.a)(this.children);try{for(a.s();!(n=a.n()).done;){var o=n.value;if(o.dirty){var s=i?i.nextSibling:r.firstChild;!s||o.dom||e.get(s)||o.reuseDOM(s),o.sync(t),o.dirty=0}t&&t.node==r&&i!=o.dom&&(t.written=!0),ie(r,i,o.dom),i=o.dom}}catch(h){a.e(h)}finally{a.f()}var c=i?i.nextSibling:r.firstChild;for(c&&t&&t.node==r&&(t.written=!0);c;)c=re(c)}else if(1&this.dirty){var l,f=Object(u.a)(this.children);try{for(f.s();!(l=f.n()).done;){var d=l.value;d.dirty&&(d.sync(t),d.dirty=0)}}catch(h){f.e(h)}finally{f.f()}}}},{key:"reuseDOM",value:function(e){return!1}},{key:"localPosFromDOM",value:function(t,n){var r;if(t==this.dom)r=this.dom.childNodes[n];else{for(var i=0==U(t)?0:0==n?-1:1;;){var a=t.parentNode;if(a==this.dom)break;0==i&&a.firstChild!=a.lastChild&&(i=t==a.firstChild?-1:1),t=a}r=i<0?t:t.nextSibling}if(r==this.dom.firstChild)return 0;for(;r&&!e.get(r);)r=r.nextSibling;if(!r)return this.length;for(var o=0,s=0;;o++){var c=this.children[o];if(c.dom==r)return s;s+=c.length+c.breakAfter}}},{key:"domBoundsAround",value:function(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=-1,i=-1,a=-1,o=-1,s=0,c=n;st)return l.domBoundsAround(e,t,c);if(u>=e&&-1==r&&(r=s,i=c),u>=t&&-1==a){a=s,o=u;break}c=u+l.breakAfter}return{from:i,to:o,startDOM:(r?this.children[r-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:a0&&void 0!==arguments[0]&&arguments[0];2&this.dirty||(this.dirty|=2,this.markParentsDirty(e))}},{key:"markParentsDirty",value:function(e){for(var t=this.parent;t;t=t.parent){if(e&&(t.dirty|=2),1&t.dirty)return;t.dirty|=1,e=!1}}},{key:"setParent",value:function(e){this.parent!=e&&(this.parent=e,this.dirty&&this.markParentsDirty(!0))}},{key:"setDOM",value:function(e){this.dom=e,e.cmView=this}},{key:"replaceChildren",value:function(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:te;this.markDirty();for(var i=e;i0&&void 0!==arguments[0]?arguments[0]:this.length;return new ae(this.children,e,this.children.length)}},{key:"childPos",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return this.childCursor().findPos(e,t)}},{key:"toString",value:function(){var e=this.constructor.name.replace("View","");return e+(this.children.length?"("+this.children.join()+")":this.length?"["+("Text"==e?this.text:this.length)+"]":"")+(this.breakAfter?"#":"")}},{key:"editorView",get:function(){if(!this.parent)throw new Error("Accessing view in orphan content view");return this.parent.editorView}},{key:"overrideDOMText",get:function(){return null}},{key:"posAtStart",get:function(){return this.parent?this.parent.posBefore(this):0}},{key:"posAtEnd",get:function(){return this.posAtStart+this.length}},{key:"rootView",get:function(){for(var e=this;;){var t=e.parent;if(!t)return e;e=t}}}],[{key:"get",value:function(e){return e.cmView}}]),e}();function re(e){var t=e.nextSibling;return e.parentNode.removeChild(e),t}function ie(e,t,n){var r=t?t.nextSibling:e.firstChild;if(n.parentNode==e)for(;r!=n;)r=re(r);else e.insertBefore(n,r)}ne.prototype.breakAfter=0;var ae=function(){function e(t,n,r){Object(f.a)(this,e),this.children=t,this.pos=n,this.i=r,this.off=0}return Object(d.a)(e,[{key:"findPos",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;;){if(e>this.pos||e==this.pos&&(t>0||0==this.i||this.children[this.i-1].breakAfter))return this.off=e-this.pos,this;var n=this.children[--this.i];this.pos-=n.length+n.breakAfter}}}]),e}(),oe=[],se=function(e){Object(s.a)(n,e);var t=Object(c.a)(n);function n(){return Object(f.a)(this,n),t.apply(this,arguments)}return Object(d.a)(n,[{key:"become",value:function(e){return!1}},{key:"getSide",value:function(){return 0}}]),n}(ne);se.prototype.children=oe;var ce=function(e){Object(s.a)(n,e);var t=Object(c.a)(n);function n(e){var r;return Object(f.a)(this,n),(r=t.call(this)).text=e,r}return Object(d.a)(n,[{key:"createDOM",value:function(e){this.setDOM(e||document.createTextNode(this.text))}},{key:"sync",value:function(e){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(e&&e.node==this.dom&&(e.written=!0),this.dom.nodeValue=this.text)}},{key:"reuseDOM",value:function(e){return 3==e.nodeType&&(this.createDOM(e),!0)}},{key:"merge",value:function(e,t,r){return(!r||r instanceof n&&!(this.length-(t-e)+r.length>256))&&(this.text=this.text.slice(0,e)+(r?r.text:"")+this.text.slice(t),this.markDirty(),!0)}},{key:"slice",value:function(e){return new n(this.text.slice(e))}},{key:"localPosFromDOM",value:function(e,t){return e==this.dom?t:t?this.text.length:0}},{key:"domAtPos",value:function(e){return new ee(this.dom,e)}},{key:"domBoundsAround",value:function(e,t,n){return{from:n,to:n+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}},{key:"coordsAt",value:function(e,t){return ue(this.dom,e,t,this.length)}},{key:"length",get:function(){return this.text.length}}]),n}(se),le=function(e){Object(s.a)(n,e);var t=Object(c.a)(n);function n(e){var r,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;Object(f.a)(this,n),(r=t.call(this)).mark=e,r.children=a,r.length=o;var s,c=Object(u.a)(a);try{for(c.s();!(s=c.n()).done;){var l=s.value;l.setParent(Object(i.a)(r))}}catch(d){c.e(d)}finally{c.f()}return r}return Object(d.a)(n,[{key:"createDOM",value:function(){var e=document.createElement(this.mark.tagName);if(this.mark.class&&(e.className=this.mark.class),this.mark.attrs)for(var t in this.mark.attrs)e.setAttribute(t,this.mark.attrs[t]);this.setDOM(e)}},{key:"sync",value:function(e){this.dom||this.createDOM(),Object(a.a)(Object(o.a)(n.prototype),"sync",this).call(this,e)}},{key:"merge",value:function(e,t,r,i,a){return(!r||!(!(r instanceof n&&r.mark.eq(this.mark))||e&&i<=0||tt&&r.push(i=0?$.chrome||$.gecko||(t?(i--,o=1):(a++,o=-1)):n<0?i--:a++;var s=J();s.setEnd(e,a),s.setStart(e,i);var c=s.getBoundingClientRect();return o?q(c,o<0):c}var fe=function(e){Object(s.a)(n,e);var t=Object(c.a)(n);function n(e,r,i){var a;return Object(f.a)(this,n),(a=t.call(this)).widget=e,a.length=r,a.side=i,a}return Object(d.a)(n,[{key:"slice",value:function(e){return n.create(this.widget,this.length-e,this.side)}},{key:"sync",value:function(){this.dom&&this.widget.updateDOM(this.dom)||(this.setDOM(this.widget.toDOM(this.editorView)),this.dom.contentEditable="false")}},{key:"getSide",value:function(){return this.side}},{key:"merge",value:function(e,t,r,i,a){return!(r&&(!(r instanceof n&&this.widget.compare(r.widget))||e>0&&i<=0||t0?n.length-1:0;r=n[i],!(e>0?0==i:i==n.length-1||r.top0?-1:1);return r}},{key:"overrideDOMText",get:function(){if(0==this.length)return g.a.empty;for(var e=this;e.parent;)e=e.parent;var t=e.editorView,n=t&&t.state.doc,r=this.posAtStart;return n?n.slice(r,r+this.length):g.a.empty}}],[{key:"create",value:function(e,t,r){return new(e.customView||n)(e,t,r)}}]),n}(se),de=function(e){Object(s.a)(n,e);var t=Object(c.a)(n);function n(){return Object(f.a)(this,n),t.apply(this,arguments)}return Object(d.a)(n,[{key:"domAtPos",value:function(e){return new ee(this.widget.text,e)}},{key:"sync",value:function(){this.dom||this.setDOM(this.widget.toDOM())}},{key:"localPosFromDOM",value:function(e,t){return t?3==e.nodeType?Math.min(t,this.length):this.length:0}},{key:"ignoreMutation",value:function(){return!1}},{key:"coordsAt",value:function(e,t){return ue(this.widget.text,e,t,this.length)}},{key:"overrideDOMText",get:function(){return null}}]),n}(fe);function he(e,t,n,r,i,a){var o,s=e.childCursor(),c=s.findPos(n,1),l=c.i,f=c.off,d=s.findPos(t,-1),h=d.i,p=d.off,v=t-n,m=Object(u.a)(r);try{for(m.s();!(o=m.n()).done;){v+=o.value.length}}catch(w){m.e(w)}finally{m.f()}e.length+=v;var g=e.children;if(h==l&&p){var b=g[h];if(1==r.length&&b.merge(p,f,r[0],i,a))return;if(0==r.length)return void b.merge(p,f,null,i,a);var y=b.slice(f);y.merge(0,0,r[r.length-1],0,a)?r[r.length-1]=y:r.push(y),l++,a=f=0}if(f){var O=g[l];r.length&&O.merge(0,f,r[r.length-1],0,a)?(r.pop(),a=0):O.merge(0,f,null,0,0)}else li&&n0;r--){var s=t[r-1].dom;if(s.parentNode==e)return ee.after(s)}return new ee(e,0)}function ve(e,t,n){var r,i=e.children;n>0&&t instanceof le&&i.length&&(r=i[i.length-1])instanceof le&&r.mark.eq(t.mark)?ve(r,t.children[0],n-1):(i.push(t),t.setParent(e)),e.length+=t.length}function me(e,t,n){for(var r=0,i=0;i=t:o>t)return a.coordsAt(t-r,n);r=o}}return(e.dom.lastChild||e.dom).getBoundingClientRect()}function ge(e,t){for(var n in e)"class"==n&&t.class?t.class+=" "+e.class:"style"==n&&t.style?t.style+=";"+e.style:t[n]=e[n];return t}function be(e,t){if(e==t)return!0;if(!e||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!=r.length)return!1;for(var i=0,a=n;i-1}},{key:"heightRelevant",get:function(){return!1}}],[{key:"mark",value:function(e){return new we(e)}},{key:"widget",value:function(e){var t=e.side||0;return e.block&&(t+=200000001*(t>0?1:-1)),new Se(e,t,t,!!e.block,e.widget||null,!1)}},{key:"replace",value:function(e){var t=!!e.block,n=Ce(e),r=n.start,i=n.end;return new Se(e,t?-2e8*(r?2:1):1e8*(r?-1:1),t?2e8*(i?2:1):1e8*(i?1:-1),t,e.widget||null,!0)}},{key:"line",value:function(e){return new je(e)}},{key:"set",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return m.b.of(e,t)}}]),n}(m.d);ke.none=m.b.empty;var we=function(e){Object(s.a)(n,e);var t=Object(c.a)(n);function n(e){var r;Object(f.a)(this,n);var i=Ce(e),a=i.start,o=i.end;return(r=t.call(this,1e8*(a?-1:1),1e8*(o?1:-1),null,e)).tagName=e.tagName||"span",r.class=e.class||"",r.attrs=e.attributes||null,r}return Object(d.a)(n,[{key:"eq",value:function(e){return this==e||e instanceof n&&this.tagName==e.tagName&&this.class==e.class&&be(this.attrs,e.attrs)}},{key:"range",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;if(e>=t)throw new RangeError("Mark decorations may not be empty");return Object(a.a)(Object(o.a)(n.prototype),"range",this).call(this,e,t)}}]),n}(ke);we.prototype.point=!1;var je=function(e){Object(s.a)(n,e);var t=Object(c.a)(n);function n(e){return Object(f.a)(this,n),t.call(this,-1e8,-1e8,null,e)}return Object(d.a)(n,[{key:"eq",value:function(e){return e instanceof n&&be(this.spec.attributes,e.spec.attributes)}},{key:"range",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;if(t!=e)throw new RangeError("Line decoration ranges must be zero-length");return Object(a.a)(Object(o.a)(n.prototype),"range",this).call(this,e,t)}}]),n}(ke);je.prototype.mapMode=p.h.TrackBefore,je.prototype.point=!0;var Se=function(e){Object(s.a)(n,e);var t=Object(c.a)(n);function n(e,r,i,a,o,s){var c;return Object(f.a)(this,n),(c=t.call(this,r,i,o,e)).block=a,c.isReplace=s,c.mapMode=a?r<0?p.h.TrackBefore:p.h.TrackAfter:p.h.TrackDel,c}return Object(d.a)(n,[{key:"eq",value:function(e){return e instanceof n&&(t=this.widget,r=e.widget,t==r||!!(t&&r&&t.compare(r)))&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide;var t,r}},{key:"range",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;if(this.isReplace&&(e>t||e==t&&this.startSide>0&&this.endSide<0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&t!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return Object(a.a)(Object(o.a)(n.prototype),"range",this).call(this,e,t)}},{key:"type",get:function(){return this.startSide=5}}]),n}(ke);function Ce(e){var t=e.inclusiveStart,n=e.inclusiveEnd;return null==t&&(t=e.inclusive),null==n&&(n=e.inclusive),{start:t||!1,end:n||!1}}Se.prototype.point=!0;function Ee(e,t,n){var r=n.length-1;r>=0&&n[r]+4>e?n[r]=Math.max(n[r],t):n.push(e,t)}var Me=p.f.define({combine:function(e){return e.join(" ")}}),Pe=p.f.define({combine:function(e){return e.indexOf(!0)>-1}}),Te=v.a.newName();function _e(e){return e.replace(/\$\w[\w\.]*/g,(function(e){for(var t=e.slice(1).split("."),n="",r=1;r<=t.length;r++)n+=".cm-"+t.slice(0,r).join("-");return n}))}function De(e,t){return new v.a(t,{process:function(t){return t=_e(t),/\$/.test(t)?t.replace(/\$/,e):e+" "+t},extend:function(t,n){return t=_e(t),n.slice(0,e.length+1)==e+" "?e+" "+t.replace(/&/,n.slice(e.length+1)):t.replace(/&/,n)}})}function Ae(e){if(e.indexOf(".")<0)return"cm-"+e;for(var t=e.split("."),n="",r=1;r<=t.length;r++)n+=(n?" ":"")+"cm-"+t.slice(0,r).join("-");return n}var Re,Le=De("."+Te,{$:{position:"relative !important",boxSizing:"border-box","&$focused":{outline_fallback:"1px dotted #212121",outline:"5px auto -webkit-focus-ring-color"},display:"flex !important",flexDirection:"column"},$scroller:{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0},$content:{margin:0,flexGrow:2,minHeight:"100%",display:"block",whiteSpace:"pre",boxSizing:"border-box",padding:"4px 0",outline:"none"},"$$light $content":{caretColor:"black"},"$$dark $content":{caretColor:"white"},$line:{display:"block",padding:"0 2px 0 4px"},$selectionLayer:{zIndex:-1,contain:"size style"},$selectionBackground:{position:"absolute"},"$$light $selectionBackground":{background:"#d9d9d9"},"$$dark $selectionBackground":{background:"#222"},"$$focused$light $selectionBackground":{background:"#d7d4f0"},"$$focused$dark $selectionBackground":{background:"#233"},$cursorLayer:{zIndex:100,contain:"size style",pointerEvents:"none"},"$$focused $cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{visibility:"hidden"},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{visibility:"hidden"},"100%":{}},$cursor:{position:"absolute",borderLeft:"1.2px solid #aaa",marginLeft:"-0.6px",pointerEvents:"none"},"$$focused $cursor":{borderLeft:"1.2px solid black"},$placeholder:{color:"#888",display:"inline-block"},$button:{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"3px"},"$$light $button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"$$dark $button":{backgroundImage:"linear-gradient(#555, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},$textfield:{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"$$light $textfield":{backgroundColor:"white"},"$$dark $textfield":{border:"1px solid #555",backgroundColor:"inherit"}}),Ne=Ae("line"),Ie=function(e){Object(s.a)(n,e);var t=Object(c.a)(n);function n(){var e;return Object(f.a)(this,n),(e=t.apply(this,arguments)).children=[],e.length=0,e.prevAttrs=void 0,e.attrs=null,e.breakAfter=0,e}return Object(d.a)(n,[{key:"merge",value:function(e,t,r,i,a,o){if(r){if(!(r instanceof n))return!1;this.dom||r.transferDOM(this)}return i&&this.setDeco(r?r.attrs:null),he(this,e,t,r?r.children:ze,a,o),!0}},{key:"split",value:function(e){var t=new n;if(t.breakAfter=this.breakAfter,0==this.length)return t;var r=this.childPos(e),i=r.i,a=r.off;a&&(t.append(this.children[i].slice(a),0),this.children[i].merge(a,this.children[i].length,null,0,0),i++);for(var o=i;o0&&0==this.children[i-1].length;)this.children[i-1].parent=null,i--;return this.children.length=i,this.markDirty(),this.length=e,t}},{key:"transferDOM",value:function(e){this.dom&&(e.setDOM(this.dom),e.prevAttrs=void 0===this.prevAttrs?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}},{key:"setDeco",value:function(e){be(this.attrs,e)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=e)}},{key:"append",value:function(e,t){ve(this,e,t)}},{key:"addLineDeco",value:function(e){var t=e.spec.attributes;t&&(this.attrs=ge(t,this.attrs||{}))}},{key:"domAtPos",value:function(e){return pe(this.dom,this.children,e)}},{key:"sync",value:function(e){this.dom||(this.setDOM(document.createElement("div")),this.dom.className=Ne,this.prevAttrs=this.attrs?null:void 0),void 0!==this.prevAttrs&&(ye(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add(Ne),this.prevAttrs=void 0),Object(a.a)(Object(o.a)(n.prototype),"sync",this).call(this,e);var t=this.dom.lastChild;if(!t||"BR"!=t.nodeName&&ne.get(t)instanceof fe){var r=document.createElement("BR");r.cmIgnore=!0,this.dom.appendChild(r)}}},{key:"measureTextSize",value:function(){if(0==this.children.length||this.length>20)return null;var e,t=0,n=Object(u.a)(this.children);try{for(n.s();!(e=n.n()).done;){var r=e.value;if(!(r instanceof ce))return null;var i=Q(r.dom);if(1!=i.length)return null;t+=i[0].width}}catch(a){n.e(a)}finally{n.f()}return{lineHeight:this.dom.getBoundingClientRect().height,charWidth:t/this.length}}},{key:"coordsAt",value:function(e,t){return me(this,e,t)}},{key:"match",value:function(e){return!1}},{key:"type",get:function(){return Oe.Text}}],[{key:"find",value:function(e,t){for(var r=0,i=0;;r++){var a=e.children[r],o=i+a.length;if(o>=t){if(a instanceof n)return a;if(a.length)return null}i=o+a.breakAfter}}}]),n}(ne),ze=[],$e=function(e){Object(s.a)(n,e);var t=Object(c.a)(n);function n(e,r,i){var a;return Object(f.a)(this,n),(a=t.call(this)).widget=e,a.length=r,a.type=i,a.breakAfter=0,a}return Object(d.a)(n,[{key:"merge",value:function(e,t,r,i,a,o){return!(r&&(!(r instanceof n&&this.widget.compare(r.widget))||e>0&&a<=0||t=0;n--)e=new le(t[n],[e],e.length);return e}},{key:"buildText",value:function(e,t,n){for(;e>0;){if(this.textOff==this.text.length){var r=this.cursor.next(this.skip),i=r.value,a=r.lineBreak,o=r.done;if(this.skip=0,o)throw new Error("Ran out of text content when drawing inline views");if(a){this.posCovered()||this.getLine(),this.content.length?this.content[this.content.length-1].breakAfter=1:this.breakAtStart=1,this.curLine=null,e--;continue}this.text=i,this.textOff=0}var s=Math.min(this.text.length-this.textOff,e);this.getLine().append(this.wrapMarks(new ce(this.text.slice(this.textOff,this.textOff+s)),t),n),e-=s,this.textOff+=s}}},{key:"span",value:function(e,t,n,r){this.buildText(t-e,n,r),this.pos=t,this.openStart<0&&(this.openStart=r)}},{key:"point",value:function(e,t,n,r,i){var a=t-e;if(n instanceof Se)if(n.block){var o=n.type;o!=Oe.WidgetAfter||this.posCovered()||this.getLine(),this.addWidget(new $e(n.widget||new Be("div"),a,o))}else{var s=this.wrapMarks(fe.create(n.widget||new Be("span"),a,n.startSide),r);this.getLine().append(s,i)}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(n);a&&(this.textOff+a<=this.text.length?this.textOff+=a:(this.skip+=a-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=t),this.openStart<0&&(this.openStart=i)}}],[{key:"build",value:function(t,n,r,i){var a=new e(t,n,r);return a.openEnd=m.b.spans(i,n,r,a),a.openStart<0&&(a.openStart=a.openEnd),a.finish(),a}}]),e}(),Be=function(e){Object(s.a)(n,e);var t=Object(c.a)(n);function n(e){var r;return Object(f.a)(this,n),(r=t.call(this)).tag=e,r}return Object(d.a)(n,[{key:"eq",value:function(e){return e.tag==this.tag}},{key:"toDOM",value:function(){return document.createElement(this.tag)}},{key:"updateDOM",value:function(e){return e.nodeName.toLowerCase()==this.tag}}]),n}(xe);!function(e){e[e.LTR=0]="LTR",e[e.RTL=1]="RTL"}(Re||(Re={}));var Qe=Re.LTR,We=Re.RTL;function He(e){for(var t=[],n=0;n=t){if(o.level==n)return a;(i<0||(0!=r?r<0?o.fromt:e[i].level>o.level))&&(i=a)}}if(i<0)throw new RangeError("Index out of range");return i}}]),e}(),Xe=[];function Ke(e,t){var n,r=e.length,i=t==Qe?1:2;if(!e||1==i&&!qe.test(e))return Ge(r);for(var a=0,o=i,s=i;aw;){for(var C=S,E=2!=Xe[--S];S>w&&E==(2!=Xe[S-1]);)S--;x.push(new Ye(S,C,E?2:1))}else x.push(new Ye(w,k,0))}else for(var M=0;M-1!=this.lineWrapping||this.direction!=n}},{key:"refresh",value:function(e,t,n,r,i,a){var o=tt.indexOf(e)>-1,s=Math.round(n)!=Math.round(this.lineHeight)||this.lineWrapping!=o||this.direction!=t;if(this.lineWrapping=o,this.direction=t,this.lineHeight=n,this.charWidth=r,this.lineLength=i,s){this.heightSamples={};for(var c=0;c2&&void 0!==arguments[2]?arguments[2]:2;Object(f.a)(this,e),this.length=t,this.height=n,this.flags=r}return Object(d.a)(e,[{key:"setHeight",value:function(e,t){this.height!=t&&(Math.abs(this.height-t)>1e-4&&(e.heightChanged=!0),this.height=t)}},{key:"replace",value:function(t,n,r){return e.of(r)}},{key:"decomposeLeft",value:function(e,t){t.push(this)}},{key:"decomposeRight",value:function(e,t){t.push(this)}},{key:"applyChanges",value:function(e,t,n,r){for(var i=this,a=r.length-1;a>=0;a--){var o=r[a],s=o.fromA,c=o.toA,l=o.fromB,u=o.toB,f=i.lineAt(s,et.ByPosNoHeight,t,0,0),d=f.to>=c?f:i.lineAt(c,et.ByPosNoHeight,t,0,0);for(u+=d.to-c,c=d.to;a>0&&f.from<=r[a-1].toA;)s=r[a-1].fromA,l=r[a-1].fromB,a--,s0},set:function(e){this.flags=(e?2:0)|-3&this.flags}}],[{key:"empty",value:function(){return new st(0,0)}},{key:"of",value:function(t){if(1==t.length)return t[0];for(var n=0,r=t.length,i=0,a=0;;)if(n==r)if(i>2*a){var o=t[n-1];o.break?t.splice(--n,1,o.left,null,o.right):t.splice(--n,1,o.left,o.right),r+=1+o.break,i-=o.size}else{if(!(a>2*i))break;var s=t[r];s.break?t.splice(r,1,s.left,null,s.right):t.splice(r,1,s.left,s.right),r+=2+s.break,a-=s.size}else if(i1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>3?arguments[3]:void 0;return n&&n.from<=t&&n.more&&this.setHeight(e,n.heights[n.index++]),this.outdated=!1,this}},{key:"toString",value:function(){return"block(".concat(this.length,")")}}]),n}(at),st=function(e){Object(s.a)(n,e);var t=Object(c.a)(n);function n(e,r){var i;return Object(f.a)(this,n),(i=t.call(this,e,r,Oe.Text)).collapsed=0,i.widgetHeight=0,i}return Object(d.a)(n,[{key:"replace",value:function(e,t,r){var i=r[0];return 1==r.length&&(i instanceof n||i instanceof ct&&4&i.flags)&&Math.abs(this.length-i.length)<10?(i instanceof ct?i=new n(i.length,this.height):i.height=this.height,this.outdated||(i.outdated=!1),i):at.of(r)}},{key:"updateHeight",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3?arguments[3]:void 0;return r&&r.from<=t&&r.more?this.setHeight(e,r.heights[r.index++]):(n||this.outdated)&&this.setHeight(e,Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))),this.outdated=!1,this}},{key:"toString",value:function(){return"line(".concat(this.length).concat(this.collapsed?-this.collapsed:"").concat(this.widgetHeight?":"+this.widgetHeight:"",")")}}]),n}(ot),ct=function(e){Object(s.a)(n,e);var t=Object(c.a)(n);function n(e){return Object(f.a)(this,n),t.call(this,e,0)}return Object(d.a)(n,[{key:"lines",value:function(e,t){var n=e.lineAt(t).number,r=e.lineAt(t+this.length).number;return{firstLine:n,lastLine:r,lineHeight:this.height/(r-n+1)}}},{key:"blockAt",value:function(e,t,n,r){var i=this.lines(t,r),a=i.firstLine,o=i.lastLine,s=i.lineHeight,c=Math.max(0,Math.min(o-a,Math.floor((e-n)/s))),l=t.line(a+c),u=l.from,f=l.length;return new it(u,f,n+s*c,s,Oe.Text)}},{key:"lineAt",value:function(e,t,n,r,i){if(t==et.ByHeight)return this.blockAt(e,n,r,i);if(t==et.ByPosNoHeight){var a=n.lineAt(e),o=a.from,s=a.to;return new it(o,s-o,0,0,Oe.Text)}var c=this.lines(n,i),l=c.firstLine,u=c.lineHeight,f=n.lineAt(e),d=f.from,h=f.length,p=f.number;return new it(d,h,r+u*(p-l),u,Oe.Text)}},{key:"forEachLine",value:function(e,t,n,r,i,a){for(var o=this.lines(n,i),s=o.firstLine,c=o.lineHeight,l=e;l0){var a=r[r.length-1];a instanceof n?r[r.length-1]=new n(a.length+i):r.push(null,new n(i-1))}if(e>0){var o=r[0];o instanceof n?r[0]=new n(e+o.length):r.unshift(new n(e-1),null)}return at.of(r)}},{key:"decomposeLeft",value:function(e,t){t.push(new n(e-1),null)}},{key:"decomposeRight",value:function(e,t){t.push(null,new n(this.length-e-1))}},{key:"updateHeight",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3?arguments[3]:void 0,a=t+this.length;if(i&&i.from<=t+this.length&&i.more){var o=[],s=Math.max(t,i.from);for(i.from>t&&o.push(new n(i.from-t-1).updateHeight(e,t));s<=a&&i.more;){var c=e.doc.lineAt(s).length;o.length&&o.push(null);var l=new st(c,i.heights[i.index++]);l.outdated=!1,o.push(l),s+=c+1}return s<=a&&o.push(null,new n(a-s).updateHeight(e,s)),e.heightChanged=!0,at.of(o)}return(r||this.outdated)&&(this.setHeight(e,e.heightForGap(t,t+this.length)),this.outdated=!1),this}},{key:"toString",value:function(){return"gap(".concat(this.length,")")}}]),n}(at),lt=function(e){Object(s.a)(n,e);var t=Object(c.a)(n);function n(e,r,i){var a;return Object(f.a)(this,n),(a=t.call(this,e.length+r+i.length,e.height+i.height,r|(e.outdated||i.outdated?2:0))).left=e,a.right=i,a.size=e.size+i.size,a}return Object(d.a)(n,[{key:"blockAt",value:function(e,t,n,r){var i=n+this.left.height;return eo))return c;var l=t==et.ByPosNoHeight?et.ByPosNoHeight:et.ByPos;return s?c.join(this.right.lineAt(o,l,n,a,o)):this.left.lineAt(o,l,n,r,i).join(c)}},{key:"forEachLine",value:function(e,t,n,r,i,a){var o=r+this.left.height,s=i+this.left.length+this.break;if(this.break)e=s&&this.right.forEachLine(e,t,n,o,s,a);else{var c=this.lineAt(s,et.ByPos,n,r,i);e=e&&c.from<=t&&a(c),t>c.to&&this.right.forEachLine(c.to+1,t,n,o,s,a)}}},{key:"replace",value:function(e,t,n){var r=this.left.length+this.break;if(tthis.left.length)return this.balanced(this.left,this.right.replace(e-r,t-r,n));var i=[];e>0&&this.decomposeLeft(e,i);var a,o=i.length,s=Object(u.a)(n);try{for(s.s();!(a=s.n()).done;){var c=a.value;i.push(c)}}catch(f){s.e(f)}finally{s.f()}if(e>0&&ut(i,o-1),t=++n&&t.push(null),e>n&&this.right.decomposeLeft(e-n,t)}},{key:"decomposeRight",value:function(e,t){var n=this.left.length,r=n+this.break;if(e>=r)return this.right.decomposeRight(e-r,t);e2*t.size||t.size>2*e.size?at.of(this.break?[e,null,t]:[e,t]):(this.left=e,this.right=t,this.height=e.height+t.height,this.outdated=e.outdated||t.outdated,this.size=e.size+t.size,this.length=e.length+this.break+t.length,this)}},{key:"updateHeight",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3?arguments[3]:void 0,i=this.left,a=this.right,o=t+i.length+this.break,s=null;return r&&r.from<=t+i.length&&r.more?s=i=i.updateHeight(e,t,n,r):i.updateHeight(e,t,n),r&&r.from<=o+a.length&&r.more?s=a=a.updateHeight(e,o,n,r):a.updateHeight(e,o,n),s?this.balanced(i,a):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}},{key:"toString",value:function(){return this.left+(this.break?" ":"-")+this.right}},{key:"break",get:function(){return 1&this.flags}}]),n}(at);function ut(e,t){var n,r;null==e[t]&&(n=e[t-1])instanceof ct&&(r=e[t+1])instanceof ct&&e.splice(t-1,3,new ct(n.length+1+r.length))}var ft=function(){function e(t,n){Object(f.a)(this,e),this.pos=t,this.oracle=n,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=t}return Object(d.a)(e,[{key:"span",value:function(e,t){if(this.lineStart>-1){var n=Math.min(t,this.lineEnd),r=this.nodes[this.nodes.length-1];r instanceof st?r.length+=n-this.pos:(n>this.pos||!this.isCovered)&&this.nodes.push(new st(n-this.pos,-1)),this.writtenTo=n,t>n&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}},{key:"point",value:function(e,t,n){if(e=5)&&this.addLineDeco(r,i)}else t>e&&this.span(e,t);this.lineEnd>-1&&this.lineEnd-1)){var e=this.oracle.doc.lineAt(this.pos),t=e.from,n=e.to;this.lineStart=t,this.lineEnd=n,this.writtenTot&&this.nodes.push(new st(this.pos-t,-1)),this.writtenTo=this.pos}}},{key:"blankContent",value:function(e,t){var n=new ct(t-e);return this.oracle.doc.lineAt(e).to==t&&(n.flags|=4),n}},{key:"ensureLine",value:function(){this.enterLine();var e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof st)return e;var t=new st(0,-1);return this.nodes.push(t),t}},{key:"addBlock",value:function(e){this.enterLine(),e.type!=Oe.WidgetAfter||this.isCovered||this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,e.type!=Oe.WidgetBefore&&(this.covering=e)}},{key:"addLineDeco",value:function(e,t){var n=this.ensureLine();n.length+=t,n.collapsed+=t,n.widgetHeight=Math.max(n.widgetHeight,e),this.writtenTo=this.pos=this.pos+t}},{key:"finish",value:function(e){var t=0==this.nodes.length?null:this.nodes[this.nodes.length-1];!(this.lineStart>-1)||t instanceof st||this.isCovered?(this.writtenTo0;t--){var r=e[t-1];if(!(r.fromA>n.toA)){if(r.toAu)break;a+=2}if(!c)return r;new e(c.fromA,c.toA,c.fromB,c.toB).addToSet(r),o=c.toA,s=c.toB}}}]),e}(),Nt=function(){function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:pt;Object(f.a)(this,e),this.view=t,this.state=n,this.transactions=r,this.flags=0,this.prevState=t.state,this.changes=p.b.empty(this.prevState.doc.length);var i,a=Object(u.a)(r);try{for(a.s();!(i=a.n()).done;){var o=i.value;this.changes=this.changes.compose(o.changes)}}catch(l){a.e(l)}finally{a.f()}var s=[];this.changes.iterChangedRanges((function(e,t,n,r){return s.push(new Lt(e,t,n,r))})),this.changedRanges=s;var c=t.hasFocus;c!=t.inputState.notifiedFocused&&(t.inputState.notifiedFocused=c,this.flags),this.docChanged&&(this.flags|=2)}return Object(d.a)(e,[{key:"viewportChanged",get:function(){return(4&this.flags)>0}},{key:"heightChanged",get:function(){return(2&this.flags)>0}},{key:"geometryChanged",get:function(){return this.docChanged||(18&this.flags)>0}},{key:"focusChanged",get:function(){return(1&this.flags)>0}},{key:"docChanged",get:function(){return this.transactions.some((function(e){return e.docChanged}))}},{key:"selectionSet",get:function(){return this.transactions.some((function(e){return e.selection}))}},{key:"empty",get:function(){return 0==this.flags&&0==this.transactions.length}}]),e}();var It=function(){function e(t,n,r){Object(f.a)(this,e),this.from=t,this.to=n,this.size=r}return Object(d.a)(e,[{key:"draw",value:function(e){return ke.replace({widget:new zt(this.size,e)}).range(this.from,this.to)}}],[{key:"same",value:function(e,t){if(e.length!=t.length)return!1;for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:null,n=this.state;this.state=e.state;var r=this.state.facet(At),i=e.changedRanges,a=Lt.extendWithRanges(i,dt(e.prevState.facet(At),r,e?e.changes:p.b.empty(this.state.doc.length))),o=this.heightMap.height;this.heightMap=this.heightMap.applyChanges(r,n.doc,this.heightOracle.setDoc(this.state.doc),a),this.heightMap.height!=o&&(e.flags|=2);var s=a.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.heads.to)||!this.viewportIsAppropriate(s))&&(s=this.getViewport(0,t)),s.eq(this.viewport)||(this.viewport=s,e.flags|=4),(this.lineGaps.length||this.viewport.to-this.viewport.from>15e3)&&(e.flags|=this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes)))),this.computeVisibleRanges(),t&&(this.scrollTo=t),!this.mustEnforceCursorAssoc&&e.selectionSet&&e.view.lineWrapping&&e.state.selection.primary.empty&&e.state.selection.primary.assoc&&(this.mustEnforceCursorAssoc=!0)}},{key:"measure",value:function(e,t){var n=e.dom,r="",i=Re.LTR;if(!t){var a=window.getComputedStyle(n);r=a.whiteSpace,i="rtl"==a.direction?Re.RTL:Re.LTR,this.paddingTop=parseInt(a.paddingTop)||0,this.paddingBottom=parseInt(a.paddingBottom)||0}var o=this.printing?{top:-1e8,bottom:1e8,left:-1e8,right:1e8}:function(e,t){for(var n=e.getBoundingClientRect(),r=Math.max(0,n.left),i=Math.min(innerWidth,n.right),a=Math.max(0,n.top),o=Math.min(innerHeight,n.bottom),s=e.parentNode;s;)if(1==s.nodeType){if((s.scrollHeight>s.clientHeight||s.scrollWidth>s.clientWidth)&&"visible"!=window.getComputedStyle(s).overflow){var c=s.getBoundingClientRect();r=Math.max(r,c.left),i=Math.min(i,c.right),a=Math.max(a,c.top),o=Math.min(o,c.bottom)}s=s.parentNode}else{if(11!=s.nodeType)break;s=s.host}return{left:r-n.left,right:i-n.left,top:a-(n.top+t),bottom:o-(n.top+t)}}(n,this.paddingTop),s=o.top-this.pixelViewport.top,c=o.bottom-this.pixelViewport.bottom;if(this.pixelViewport=o,this.inView=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left,!this.inView)return 0;var l=e.measureVisibleLineHeights(),u=!1,f=0,d=0,h=this.heightOracle;if(!t){var p=e.dom.clientWidth;if(h.mustRefresh(l,r,i)||h.lineWrapping&&Math.abs(p-this.contentWidth)>h.charWidth){var v=e.measureTextSize(),m=v.lineHeight,g=v.charWidth;(u=h.refresh(r,i,m,g,p/g,l))&&(e.minWidth=0,d|=16)}this.contentWidth!=p&&(this.contentWidth=p,d|=16),s>0&&c>0?f=Math.max(s,c):s<0&&c<0&&(f=Math.min(s,c))}return h.heightChanged=!1,this.heightMap=this.heightMap.updateHeight(h,0,u,new rt(this.viewport.from,l)),h.heightChanged&&(d|=2),(!this.viewportIsAppropriate(this.viewport,f)||this.scrollTo&&(this.scrollTo.headthis.viewport.to))&&(this.viewport=this.getViewport(f,this.scrollTo),d|=4),(this.lineGaps.length||this.viewport.to-this.viewport.from>15e3)&&(d|=this.updateLineGaps(this.ensureLineGaps(u?[]:this.lineGaps))),this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.enforceCursorAssoc()),d}},{key:"getViewport",value:function(e,t){var n=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),r=this.heightMap,i=this.state.doc,a=this.pixelViewport,o=a.top,s=a.bottom,c=new Ft(r.lineAt(o-1e3*n,et.ByHeight,i,0,0).from,r.lineAt(s+1e3*(1-n),et.ByHeight,i,0,0).to);if(t)if(t.headc.to){var u=r.lineAt(t.head,et.ByPos,i,0,0).bottom;c=new Ft(r.lineAt(u-(s-o)-500,et.ByHeight,i,0,0).from,r.lineAt(u+500,et.ByHeight,i,0,0).to)}return c}},{key:"mapViewport",value:function(e,t){var n=t.mapPos(e.from,-1),r=t.mapPos(e.to,1);return new Ft(this.heightMap.lineAt(n,et.ByPos,this.state.doc,0,0).from,this.heightMap.lineAt(r,et.ByPos,this.state.doc,0,0).to)}},{key:"viewportIsAppropriate",value:function(e){var t=e.from,n=e.to,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=this.heightMap.lineAt(t,et.ByPos,this.state.doc,0,0),a=i.top,o=this.heightMap.lineAt(n,et.ByPos,this.state.doc,0,0),s=o.bottom;return(0==t||a<=this.pixelViewport.top-Math.max(10,Math.min(-r,250)))&&(n==this.state.doc.length||s>=this.pixelViewport.bottom+Math.max(10,Math.min(r,250)))&&a>this.pixelViewport.top-2e3&&si&&(r.push({from:i,to:e}),a+=e-i),i=t},minPointSize:20}),i=r.from&&(a=c.from),c.from<=r.to&&c.to>=o&&(o=c.to);var l=a-1e4,u=o+1e4;l>r.from+5e3&&n.push(Wt(e,(function(e){return e.from==r.from&&e.to>l-5e3&&e.tou-5e3&&e.from=1)return r[r.length-1].to;for(var i=Math.floor(n*t),a=0;;a++){var o=r[a],s=o.from,c=o.to-s;if(i<=c)return s+i;i-=c}}function Qt(e,t){var n,r=0,i=Object(u.a)(e.ranges);try{for(i.s();!(n=i.n()).done;){var a=n.value,o=a.from,s=a.to;if(t<=s){r+=t-o;break}r+=s-o}}catch(c){i.e(c)}finally{i.f()}return r/e.total}function Wt(e,t){var n,r=Object(u.a)(e);try{for(r.s();!(n=r.n()).done;){var i=n.value;if(t(i))return i}}catch(a){r.e(a)}finally{r.f()}}var Ht=[],Vt=function(e){Object(s.a)(n,e);var t=Object(c.a)(n);function n(e){var r;return Object(f.a)(this,n),(r=t.call(this)).view=e,r.viewports=Ht,r.compositionDeco=ke.none,r.decorations=[],r.minWidth=0,r.minWidthFrom=0,r.minWidthTo=0,r.impreciseAnchor=null,r.impreciseHead=null,r.setDOM(e.contentDOM),r.children=[new Ie],r.children[0].setParent(Object(i.a)(r)),r.updateInner([new Lt(0,0,0,e.state.doc.length)],r.updateDeco(),0),r}return Object(d.a)(n,[{key:"update",value:function(e){var t,n=this,r=e.changedRanges;this.minWidth>0&&r.length&&(r.every((function(e){var t=e.fromA;return e.toAn.minWidthTo}))?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=0),(null===(t=this.view.inputState)||void 0===t?void 0:t.composing)?e.transactions.length&&(this.compositionDeco=function(e,t){var n=F(e.root),r=n.focusNode&&Xt(n.focusNode,n.focusOffset,0);if(!r)return ke.none;var i,a,o=e.docView.nearest(r),s=r;if(o instanceof se){for(;o.parent instanceof se;)o=o.parent;a=(i=o.posAtStart)+o.length,s=o.dom}else{if(!(o instanceof Ie))return ke.none;for(;s.parentNode!=o.dom;)s=s.parentNode;for(var c=s.previousSibling;c&&!ne.get(c);)c=c.previousSibling;i=a=c?ne.get(c).posAtEnd:o.posAtStart}var l=t.mapPos(i,1),u=Math.max(l,t.mapPos(a,-1)),f=r.nodeValue,d=e.state;if(u-l=this.view.viewport.from&&e.state.selection.primary.to<=this.view.viewport.to?(this.updateSelection(i,c),!1):(this.updateInner(r,o,e.prevState.doc.length,i,c),!0)}},{key:"updateInner",value:function(e,t,n){var r=this,i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],a=arguments.length>4&&void 0!==arguments[4]&&arguments[4];this.updateChildren(e,t,n),this.view.observer.ignore((function(){r.dom.style.height=r.view.viewState.heightMap.height+"px",r.dom.style.minWidth=r.minWidth?r.minWidth+"px":"";var e=$.chrome?{node:F(r.view.root).focusNode,written:!1}:void 0;r.sync(e),r.dirty=0,(null===e||void 0===e?void 0:e.written)&&(i=!0),r.updateSelection(i,a),r.dom.style.height=""}))}},{key:"updateChildren",value:function(e,t,n){for(var r=this.childCursor(n),i=e.length-1;;i--){var a=i>=0?e[i]:null;if(!a)break;var o=a.fromA,s=a.toA,c=a.fromB,l=a.toB,u=Fe.build(this.view.state.doc,c,l,t),f=u.content,d=u.breakAtStart,h=u.openStart,p=u.openEnd,v=r.findPos(s,1),m=v.i,g=v.off,b=r.findPos(o,-1),y=b.i,O=b.off;this.replaceRange(y,O,m,g,f,d,h,p)}}},{key:"replaceRange",value:function(e,t,n,r,i,a,o,s){var c=this.children[e],l=i.length?i[i.length-1]:null,u=l?l.breakAfter:a;if(e!=n||a||u||!(i.length<2)||!c.merge(t,r,i.length?l:null,0==t,o,s)){var f=this.children[n];for(r0&&(!a&&i.length&&c.merge(t,c.length,i[0],!1,o,0)?c.breakAfter=i.shift().breakAfter:(t0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(t||this.mayControlSelection()){var n=this.view.state.selection.primary,r=this.domAtPos(n.anchor),i=this.domAtPos(n.head),a=F(this.root);(e||!a.focusNode||$.gecko&&n.empty&&Kt(a.focusNode,a.focusOffset)||!W(r.node,r.offset,a.anchorNode,a.anchorOffset)||!W(i.node,i.offset,a.focusNode,a.focusOffset))&&this.view.observer.ignore((function(){if(n.empty){if($.gecko){var e=Kt(r.node,r.offset);if(e&&3!=e){var t=Xt(r.node,r.offset,1==e?1:-1);t&&(r=new ee(t,1==e?0:t.nodeValue.length))}}a.collapse(r.node,r.offset),null!=n.bidiLevel&&null!=a.cursorBidiLevel&&(a.cursorBidiLevel=n.bidiLevel)}else if(a.extend)a.collapse(r.node,r.offset),a.extend(i.node,i.offset);else{var o=document.createRange();if(n.anchor>n.head){var s=[i,r];r=s[0],i=s[1]}o.setEnd(i.node,i.offset),o.setStart(r.node,r.offset),a.removeAllRanges(),a.addRange(o)}})),this.impreciseAnchor=r.precise?null:new ee(a.anchorNode,a.anchorOffset),this.impreciseHead=i.precise?null:new ee(a.focusNode,a.focusOffset)}}},{key:"enforceCursorAssoc",value:function(){var e=this.view.state.selection.primary,t=F(this.root);if(e.empty&&e.assoc&&t.modify){var n=Ie.find(this,e.head);if(n){var r=n.posAtStart;if(e.head!=r&&e.head!=r+n.length){var i=this.coordsAt(e.head,-1),a=this.coordsAt(e.head,1);if(i&&a&&!(i.bottom>a.top)){var o=this.domAtPos(e.head+e.assoc);t.collapse(o.node,o.offset),t.modify("move",e.assoc<0?"forward":"backward","lineboundary")}}}}}},{key:"mayControlSelection",value:function(){return this.view.state.facet(kt)?this.root.activeElement==this.dom:B(this.dom,F(this.root))}},{key:"nearest",value:function(e){for(var t=e;t;){var n=ne.get(t);if(n&&n.rootView==this)return n;t=t.parentNode}return null}},{key:"posFromDOM",value:function(e,t){var n=this.nearest(e);if(!n)throw new RangeError("Trying to find position for a DOM position outside of the document");return n.localPosFromDOM(e,t)+n.posAtStart}},{key:"domAtPos",value:function(e){for(var t=this.childCursor().findPos(e,-1),n=t.i,r=t.off;n=a&&i.type!=Oe.WidgetAfter)return i.coordsAt(e-a,t);n=a}}},{key:"measureVisibleLineHeights",value:function(){for(var e=[],t=this.view.viewState.viewport,n=t.from,r=t.to,i=Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,a=0,o=0;or)break;if(a>=n){e.push(s.dom.getBoundingClientRect().height);var l=s.dom.scrollWidth;l>i&&(this.minWidth=i=l,this.minWidthFrom=a,this.minWidthTo=c)}a=c+s.breakAfter}return e}},{key:"measureTextSize",value:function(){var e,t=this,n=Object(u.a)(this.children);try{for(n.s();!(e=n.n()).done;){var r=e.value;if(r instanceof Ie){var i=r.measureTextSize();if(i)return i}}}catch(c){n.e(c)}finally{n.f()}var a,o,s=document.createElement("div");return s.className="cm-line",s.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore((function(){t.dom.appendChild(s);var e=Q(s.firstChild)[0];a=s.getBoundingClientRect().height,o=e?e.width/27:7,s.remove()})),{lineHeight:a,charWidth:o}}},{key:"childCursor",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.length,t=this.children.length;return t&&(e-=this.children[--t].length),new ae(this.children,e,t)}},{key:"computeBlockGapDeco",value:function(){var e=this.view.viewState.viewport,t=[e],n=this.view.state.selection.primary,r=n.head,i=n.anchor;if(re.to){var a=this.view.viewState.lineAt(r,0),o=a.from,s=a.to;t.push(new Ft(o,s))}if(!t.some((function(e){var t=e.from,n=e.to;return i>=t&&i<=n}))){var c=this.view.viewState.lineAt(i,0),l=c.from,u=c.to;t.push(new Ft(l,u))}this.viewports=t.sort((function(e,t){return e.from-t.from}));for(var f=[],d=0,h=0;;h++){var p=h==t.length?null:t[h],v=p?p.from-1:this.length;if(v>d){var m=this.view.viewState.lineAt(v,0).bottom-this.view.viewState.lineAt(d,0).top;f.push(ke.replace({widget:new qt(m),block:!0,inclusive:!0}).range(d,v))}if(!p)break;d=p.to+1}return ke.set(f)}},{key:"updateDeco",value:function(){return this.decorations=[this.computeBlockGapDeco(),this.view.viewState.lineGapDeco,this.compositionDeco].concat(Object(l.a)(this.view.state.facet(At)),Object(l.a)(this.view.pluginField(Mt)))}},{key:"scrollPosIntoView",value:function(e,t){var n=this.coordsAt(e,t);if(n){var r,i=0,a=0,o=0,s=0,c=Object(u.a)(this.view.pluginField(jt.scrollMargins));try{for(c.s();!(r=c.n()).done;){var l=r.value;if(l){var f=l.left,d=l.right,h=l.top,p=l.bottom;null!=f&&(i=Math.max(i,f)),null!=d&&(a=Math.max(a,d)),null!=h&&(o=Math.max(o,h)),null!=p&&(s=Math.max(s,p))}}}catch(v){c.e(v)}finally{c.f()}!function(e,t){for(var n=e.ownerDocument.defaultView,r=e.parentNode;r;)if(1==r.nodeType){var i=void 0,a=r==document.body;if(a)i=Y(n);else{if(r.scrollHeight<=r.clientHeight&&r.scrollWidth<=r.clientWidth){r=r.parentNode;continue}var o=r.getBoundingClientRect();i={left:o.left,right:o.left+r.clientWidth,top:o.top,bottom:o.top+r.clientHeight}}var s=0,c=0;if(t.topi.bottom&&(c=t.bottom-i.bottom+5),t.lefti.right&&(s=t.right-i.right+5),s||c)if(a)n.scrollBy(s,c);else{if(c){var l=r.scrollTop;r.scrollTop+=c,c=r.scrollTop-l}if(s){var u=r.scrollLeft;r.scrollLeft+=s,s=r.scrollLeft-u}t={left:t.left-s,top:t.top-c,right:t.right-s,bottom:t.bottom-c}}if(a)break;r=r.parentNode}else{if(11!=r.nodeType)break;r=r.host}}(this.dom,{left:n.left-i,top:n.top-o,right:n.right+a,bottom:n.bottom+s})}}},{key:"root",get:function(){return this.view.root}},{key:"editorView",get:function(){return this.view}},{key:"length",get:function(){return this.view.state.doc.length}}]),n}(ne),Ut=1e7,qt=function(e){Object(s.a)(n,e);var t=Object(c.a)(n);function n(e){var r;return Object(f.a)(this,n),(r=t.call(this)).height=e,r}return Object(d.a)(n,[{key:"toDOM",value:function(){var e=document.createElement("div");return this.updateDOM(e),e}},{key:"eq",value:function(e){return e.height==this.height}},{key:"updateDOM",value:function(e){if(this.height0;t-=Ut){e.appendChild(document.createElement("div")).style.height=Math.min(t,Ut)+"px"}}return!0}},{key:"estimatedHeight",get:function(){return this.height}}]),n}(xe);var Yt=function(e){Object(s.a)(n,e);var t=Object(c.a)(n);function n(e,r){var i;return Object(f.a)(this,n),(i=t.call(this)).top=e,i.text=r,i}return Object(d.a)(n,[{key:"eq",value:function(e){return this.top==e.top&&this.text==e.text}},{key:"toDOM",value:function(){return this.top}},{key:"ignoreEvent",value:function(){return!1}},{key:"customView",get:function(){return de}}]),n}(xe);function Xt(e,t,n){for(;;){if(3==e.nodeType)return e;if(1==e.nodeType&&t>0&&n<=0)t=U(e=e.childNodes[t-1]);else{if(!(1==e.nodeType&&t=0))return null;e=e.childNodes[t],t=0}}}function Kt(e,t){return 1!=e.nodeType?0:(t&&"false"==e.childNodes[t-1].contentEditable?1:0)|(te?t.left-e:Math.max(0,e-t.right)}function Jt(e,t){return t.top>e?t.top-e:Math.max(0,e-t.bottom)}function en(e,t){return e.topt.top+1}function tn(e,t){return te.bottom?{top:e.top,left:e.left,right:e.right,bottom:t}:e}function rn(e,t,n){for(var r,i,a,o,s,c,l,u,f=e.firstChild;f;f=f.nextSibling)for(var d=Q(f),h=0;hm||o==m&&a>v)&&(r=f,i=p,a=v,o=m),0==v?n>p.bottom&&(!l||l.bottomp.top)&&(c=f,u=p):l&&en(l,p)?l=nn(l,p.bottom):u&&en(u,p)&&(u=tn(u,p.top))}if(l&&l.bottom>=n?(r=s,i=l):u&&u.top<=n&&(r=c,i=u),!r)return{node:e,offset:0};var g=Math.max(i.left,Math.min(i.right,t));return 3==r.nodeType?an(r,g,n):a||"true"!=r.contentEditable?{node:e,offset:Array.prototype.indexOf.call(e.childNodes,r)+(t>=(i.left+i.right)/2?1:0)}:rn(r,g,n)}function an(e,t,n){for(var r=e.nodeValue.length,i=J(),a=0;a=t&&c.top-1<=n&&c.bottom+1>=n)){var l=t>=(c.left+c.right)/2,u=l;if($.chrome||$.gecko)i.setEnd(e,a),i.getBoundingClientRect().left==c.right&&(u=!l);return{node:e,offset:a+(u?1:0)}}}}return{node:e,offset:0}}function on(e,t){for(var n,r=t.x,i=t.y,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1,o=e.contentDOM.getBoundingClientRect(),s=e.defaultLineHeight/2,c=!1;;){if((n=e.blockAtHeight(i,o.top)).top>i||n.bottomi?-1:1,i=Math.min(n.bottom-s,Math.max(n.top+s,i)),c)return-1;c=!0}if(n.type==Oe.Text)break;i=a>0?n.bottom+s:n.top-s}var l=n.from;if(le.viewport.to)return e.viewport.to==e.state.doc.length?e.state.doc.length:-1;r=Math.max(o.left+1,Math.min(o.right-1,r));var u,f=e.root,d=f.elementFromPoint(r,i),h=-1;if(d&&e.contentDOM.contains(d)&&!(e.docView.nearest(d)instanceof fe))if(f.caretPositionFromPoint){var p=f.caretPositionFromPoint(r,i);p&&(u=p.offsetNode,h=p.offset)}else if(f.caretRangeFromPoint){var v=f.caretRangeFromPoint(r,i);v&&(u=v.startContainer,h=v.startOffset)}if(!u||!e.docView.dom.contains(u)){var m=Ie.find(e.docView,l),g=rn(m.dom,r,i);u=g.node,h=g.offset}return e.docView.posFromDOM(u,h)}function sn(e,t,n,r){var i=e.state.doc.lineAt(t.head),a=r&&e.lineWrapping?e.coordsAtPos(t.assoc<0&&t.head>i.from?t.head-1:t.head):null;if(a){var o=e.dom.getBoundingClientRect(),s=e.posAtCoords({x:n==(e.textDirection==Re.LTR)?o.right-1:o.left+1,y:(a.top+a.bottom)/2});if(s>-1)return p.d.cursor(s,n?-1:1)}var c=Ie.find(e.docView,t.head),l=c?n?c.posAtEnd:c.posAtStart:n?i.to:i.from;return p.d.cursor(l,n?-1:1)}function cn(e,t,n,r){for(var i=e.state.doc.lineAt(t.head),a=e.bidiSpans(i),o=t,s=null;;){var c=Je(i,a,e.textDirection,o,n),l=Ze;if(!c){if(i.number==(n?e.state.doc.lines:1))return o;l="\n",i=e.state.doc.line(i.number+(n?1:-1)),a=e.bidiSpans(i),c=p.d.cursor(n?i.from:i.to)}if(s){if(!s(l))return o}else{if(!r)return c;s=r(l)}o=c}}var ln=function(){function e(t){var n=this;Object(f.a)(this,e),this.lastKeyCode=0,this.lastKeyTime=0,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.scrollHandlers=[],this.registeredEvents=[],this.customHandlers=[],this.composing=!1,this.compositionEndedAt=0,this.mouseSelection=null;var r=function(e){var r=dn[e];t.contentDOM.addEventListener(e,(function(i){fn(t,i)&&!n.ignoreDuringComposition(i)&&(n.mustFlushObserver(i)&&t.observer.forceFlush(),n.runCustomHandlers(e,t,i)?i.preventDefault():r(t,i))})),n.registeredEvents.push(e)};for(var i in dn)r(i);t.contentDOM.addEventListener("keydown",(function(e){t.inputState.lastKeyCode=e.keyCode,t.inputState.lastKeyTime=Date.now()})),this.notifiedFocused=t.hasFocus,this.ensureHandlers(t)}return Object(d.a)(e,[{key:"setSelectionOrigin",value:function(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}},{key:"ensureHandlers",value:function(e){var t,n=this,r=this.customHandlers=e.pluginField(Pt),i=Object(u.a)(r);try{for(i.s();!(t=i.n()).done;){var a=t.value,o=function(t){n.registeredEvents.indexOf(t)<0&&"scroll"!=t&&(n.registeredEvents.push(t),e.contentDOM.addEventListener(t,(function(r){fn(e,r)&&n.runCustomHandlers(t,e,r)&&r.preventDefault()})))};for(var s in a.handlers)o(s)}}catch(c){i.e(c)}finally{i.f()}}},{key:"runCustomHandlers",value:function(e,t,n){var r,i=Object(u.a)(this.customHandlers);try{for(i.s();!(r=i.n()).done;){var a=r.value,o=a.handlers[e];if(o)try{if(o.call(a.plugin,n,t)||n.defaultPrevented)return!0}catch(s){xt(t.state,s)}}}catch(c){i.e(c)}finally{i.f()}return!1}},{key:"runScrollHandlers",value:function(e,t){var n,r=Object(u.a)(this.customHandlers);try{for(r.s();!(n=r.n()).done;){var i=n.value,a=i.handlers.scroll;if(a)try{a.call(i.plugin,t,e)}catch(o){xt(e.state,o)}}}catch(s){r.e(s)}finally{r.f()}}},{key:"ignoreDuringComposition",value:function(e){return!!/^key/.test(e.type)&&(!!this.composing||!!($.safari&&e.timeStamp-this.compositionEndedAt<500)&&(this.compositionEndedAt=0,!0))}},{key:"mustFlushObserver",value:function(e){return"keydown"==e.type||"compositionend"==e.type}},{key:"startMouseSelection",value:function(e,t,n){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=new un(this,e,t,n)}},{key:"update",value:function(e){this.mouseSelection&&this.mouseSelection.update(e),this.lastKeyCode=this.lastSelectionTime=0}},{key:"destroy",value:function(){this.mouseSelection&&this.mouseSelection.destroy()}}]),e}(),un=function(){function e(t,n,r,i){Object(f.a)(this,e),this.inputState=t,this.view=n,this.startEvent=r,this.style=i;var a=n.contentDOM.ownerDocument;a.addEventListener("mousemove",this.move=this.move.bind(this)),a.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=r.shiftKey,this.multiple=n.state.facet(p.e.allowMultipleSelections)&&function(e,t){var n=e.state.facet(vt);return n.length?n[0](t):$.mac?t.metaKey:t.ctrlKey}(n,r),this.dragMove=function(e,t){var n=e.state.facet(mt);return n.length?n[0](t):$.mac?!t.altKey:!t.ctrlKey}(n,r),this.dragging=!!function(e,t){if(e.state.selection.primary.empty)return!1;var n=F(e.root);if(0==n.rangeCount)return!0;for(var r=n.getRangeAt(0).getClientRects(),i=0;i=t.clientX&&a.top<=t.clientY&&a.bottom>=t.clientY)return!0}return!1}(n,r)&&null,!1===this.dragging&&(r.preventDefault(),this.select(r))}return Object(d.a)(e,[{key:"move",value:function(e){if(0==e.buttons)return this.destroy();!1===this.dragging&&this.select(e)}},{key:"up",value:function(e){null==this.dragging&&this.select(this.startEvent),this.dragging||e.preventDefault(),this.destroy()}},{key:"destroy",value:function(){var e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.inputState.mouseSelection=null}},{key:"select",value:function(e){var t=this.style.get(e,this.extend,this.multiple);t.eq(this.view.state.selection)&&t.primary.assoc==this.view.state.selection.primary.assoc||this.view.dispatch({selection:t,annotations:p.l.userEvent.of("pointerselection"),scrollIntoView:!0})}},{key:"update",value:function(e){e.docChanged&&this.dragging&&(this.dragging=this.dragging.map(e.changes)),this.style.update(e)}}]),e}();function fn(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(var n,r=t.target;r!=e.contentDOM;r=r.parentNode)if(!r||11==r.nodeType||(n=ne.get(r))&&n.ignoreEvent(t))return!1;return!0}var dn=Object.create(null),hn=$.ie&&$.ie_version<15||$.ios&&$.webkit_version<604;function pn(e,t){var n,r=e.state,i=1,a=r.toText(t),o=a.lines==r.selection.ranges.length;n=wn&&r.selection.ranges.every((function(e){return e.empty}))&&wn==a.toString()?{changes:r.selection.ranges.map((function(e){return r.doc.lineAt(e.from)})).filter((function(e,t,n){return 0==t||n[t-1]!=e})).map((function(e){return{from:e.from,insert:(o?a.line(i++).slice():t)+r.lineBreak}}))}:o?r.changeByRange((function(e){var t=a.line(i++);return{changes:{from:e.from,to:e.to,insert:t.slice()},range:p.d.cursor(e.from+t.length)}})):r.replaceSelection(a),e.dispatch(n,{annotations:p.l.userEvent.of("paste"),scrollIntoView:!0})}function vn(e,t,n,r){if(1==r)return p.d.cursor(t,n);if(2==r)return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=e.charCategorizer(t),i=e.doc.lineAt(t),a=t-i.from;if(0==i.length)return p.d.cursor(t);0==a?n=1:a==i.length&&(n=-1);var o=a,s=a;n<0?o=i.findClusterBreak(a,!1):s=i.findClusterBreak(a,!0);for(var c=r(i.slice(o,s));o>0;){var l=i.findClusterBreak(o,!1);if(r(i.slice(l,o))!=c)break;o=l}for(;sDate.now()-400&&Math.abs(t.clientX-e.clientX)<2&&Math.abs(t.clientY-e.clientY)<2?(kn+1)%3:1}(t),i=e.state.selection,a=n,o=t;return{update:function(e){e.changes&&(n&&(n.pos=e.changes.mapPos(n.pos)),i=i.map(e.changes))},get:function(t,s,c){var l;if(t.clientX==o.clientX&&t.clientY==o.clientY?l=a:(l=a=yn(e,t),o=t),!l||!n)return i;var u=vn(e,l.pos,l.bias,r);if(n.pos!=l.pos&&!s){var f=vn(e,n.pos,n.bias,r),d=Math.min(f.from,u.from),h=Math.max(f.to,u.to);u=d=t.top&&e<=t.bottom},gn=function(e,t,n){return mn(t,n)&&e>=n.left&&e<=n.right};function bn(e,t,n,r){var i=Ie.find(e.docView,t);if(!i)return 1;var a=t-i.posAtStart;if(0==a)return 1;if(a==i.length)return-1;var o=i.coordsAt(a,-1);if(o&&gn(n,r,o))return-1;var s=i.coordsAt(a,1);return s&&gn(n,r,s)?1:o&&mn(r,o)?-1:1}function yn(e,t){var n=e.posAtCoords({x:t.clientX,y:t.clientY});return n<0?null:{pos:n,bias:bn(e,n,t.clientX,t.clientY)}}var On=$.ie&&$.ie_version<=11,xn=null,kn=0;dn.dragstart=function(e,t){var n=e.state.selection.primary,r=e.inputState.mouseSelection;r&&(r.dragging=n),t.dataTransfer&&(t.dataTransfer.setData("Text",e.state.sliceDoc(n.from,n.to)),t.dataTransfer.effectAllowed="copyMove")},dn.drop=function(e,t){if(t.dataTransfer){var n=e.posAtCoords({x:t.clientX,y:t.clientY}),r=t.dataTransfer.getData("Text");if(!(n<0)&&r){t.preventDefault();var i=e.inputState.mouseSelection,a=i&&i.dragging&&i.dragMove?{from:i.dragging.from,to:i.dragging.to}:null,o={from:n,insert:r},s=e.state.changes(a?[a,o]:o);e.focus(),e.dispatch({changes:s,selection:{anchor:s.mapPos(n,-1),head:s.mapPos(n,1)},annotations:p.l.userEvent.of("drop")})}}},dn.paste=function(e,t){e.observer.flush();var n=hn?null:t.clipboardData,r=n&&n.getData("text/plain");r?(pn(e,r),t.preventDefault()):function(e){var t=e.dom.parentNode;if(t){var n=t.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus(),setTimeout((function(){e.focus(),n.remove(),pn(e,n.value)}),50)}}(e)};var wn=null;function jn(e){e.docView.compositionDeco.size&&e.update([])}dn.copy=dn.cut=function(e,t){var n=function(e){var t,n=[],r=[],i=!1,a=Object(u.a)(e.selection.ranges);try{for(a.s();!(t=a.n()).done;){var o=t.value;o.empty||(n.push(e.sliceDoc(o.from,o.to)),r.push(o))}}catch(h){a.e(h)}finally{a.f()}if(!n.length){var s,c=-1,l=Object(u.a)(e.selection.ranges);try{for(l.s();!(s=l.n()).done;){var f=s.value.from,d=e.doc.lineAt(f);d.number>c&&(n.push(d.slice()),r.push({from:d.from,to:Math.min(e.doc.length,d.to+1)})),c=d.number}}catch(h){l.e(h)}finally{l.f()}i=!0}return{text:n.join(e.lineBreak),ranges:r,linewise:i}}(e.state),r=n.text,i=n.ranges,a=n.linewise;if(r){wn=a?r:null;var o=hn?null:t.clipboardData;o?(t.preventDefault(),o.clearData(),o.setData("text/plain",r)):function(e,t){var n=e.dom.parentNode;if(n){var r=n.appendChild(document.createElement("textarea"));r.style.cssText="position: fixed; left: -10000px; top: 10px",r.value=t,r.focus(),r.selectionEnd=t.length,r.selectionStart=0,setTimeout((function(){r.remove(),e.focus()}),50)}}(e,r),"cut"==t.type&&e.dispatch({changes:i,scrollIntoView:!0,annotations:p.l.userEvent.of("cut")})}},dn.focus=dn.blur=function(e){setTimeout((function(){e.hasFocus!=e.inputState.notifiedFocused&&e.update([])}),10)},dn.beforeprint=function(e){e.viewState.printing=!0,e.requestMeasure(),setTimeout((function(){e.viewState.printing=!1,e.requestMeasure()}),2e3)},dn.compositionstart=dn.compositionupdate=function(e){e.inputState.composing||(e.docView.compositionDeco.size&&(e.observer.flush(),jn(e)),e.inputState.composing=!0)},dn.compositionend=function(e){e.inputState.composing=!1,e.inputState.compositionEndedAt=Date.now(),setTimeout((function(){e.inputState.composing||jn(e)}),50)};var Sn={childList:!0,characterData:!0,subtree:!0,characterDataOldValue:!0},Cn=$.ie&&$.ie_version<=11,En=function(){function e(t,n,r){var i=this;Object(f.a)(this,e),this.view=t,this.onChange=n,this.onScrollChanged=r,this.active=!1,this.ignoreSelection=new K,this.delayedFlush=-1,this.queue=[],this.scrollTargets=[],this.intersection=null,this.intersecting=!1,this.parentCheck=-1,this.dom=t.contentDOM,this.observer=new MutationObserver((function(e){var t,n=Object(u.a)(e);try{for(n.s();!(t=n.n()).done;){var r=t.value;i.queue.push(r)}}catch(a){n.e(a)}finally{n.f()}$.ie&&$.ie_version<=11&&e.some((function(e){return"childList"==e.type&&e.removedNodes.length||"characterData"==e.type&&e.oldValue.length>e.target.nodeValue.length}))?i.flushSoon():i.flush()})),Cn&&(this.onCharData=function(e){i.queue.push({target:e.target,type:"characterData",oldValue:e.prevValue}),i.flushSoon()}),this.onSelectionChange=function(){if(i.view.root.activeElement==i.dom){if($.ie&&$.ie_version<=11&&!i.view.state.selection.primary.empty){var e=F(i.view.root);if(e.focusNode&&W(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return i.flushSoon()}i.flush()}},this.start(),this.onScroll=this.onScroll.bind(this),window.addEventListener("scroll",this.onScroll),"function"==typeof IntersectionObserver&&(this.intersection=new IntersectionObserver((function(e){i.parentCheck<0&&(i.parentCheck=setTimeout(i.listenForScroll.bind(i),1e3)),e[e.length-1].intersectionRatio>0!=i.intersecting&&(i.intersecting=!i.intersecting,i.onScrollChanged(document.createEvent("Event")))}),{}),this.intersection.observe(this.dom)),this.listenForScroll()}return Object(d.a)(e,[{key:"onScroll",value:function(e){this.intersecting&&(this.flush(),this.onScrollChanged(e))}},{key:"listenForScroll",value:function(){this.parentCheck=-1;for(var e=0,t=null,n=this.dom;n;)if(1==n.nodeType)!t&&e=0&&(window.clearTimeout(this.delayedFlush),this.delayedFlush=-1,this.flush())}},{key:"flush",value:function(){var e=this;if(!(this.delayedFlush>=0)){var t,n=this.queue,r=Object(u.a)(this.observer.takeRecords());try{for(r.s();!(t=r.n()).done;){var i=t.value;n.push(i)}}catch(m){r.e(m)}finally{r.f()}n.length&&(this.queue=[]);var a=F(this.view.root),o=!this.ignoreSelection.eq(a)&&B(this.dom,a);if(0!=n.length||o){var s,c=-1,l=-1,f=!1,d=Object(u.a)(n);try{for(d.s();!(s=d.n()).done;){var h=s.value,p=this.readMutation(h);p&&(p.typeOver&&(f=!0),-1==c?(c=p.from,l=p.to):(c=Math.min(p.from,c),l=Math.max(p.to,l)))}}catch(m){d.e(m)}finally{d.f()}var v=this.view.state;(c>-1||o)&&this.onChange(c,l,f),this.view.state==v&&(this.view.docView.dirty&&(this.ignore((function(){return e.view.docView.sync()})),this.view.docView.dirty=0),this.view.docView.updateSelection()),this.clearSelection()}}}},{key:"readMutation",value:function(e){var t=this.view.docView.nearest(e.target);if(!t||t.ignoreMutation(e))return null;if(t.markDirty(),"childList"==e.type){var n=Mn(t,e.previousSibling||e.target.previousSibling,-1),r=Mn(t,e.nextSibling||e.target.nextSibling,1);return{from:n?t.posAfter(n):t.posAtStart,to:r?t.posBefore(r):t.posAtEnd,typeOver:!1}}return{from:t.posAtStart,to:t.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}}},{key:"destroy",value:function(){this.stop(),this.intersection&&this.intersection.disconnect();var e,t=Object(u.a)(this.scrollTargets);try{for(t.s();!(e=t.n()).done;){e.value.removeEventListener("scroll",this.onScroll)}}catch(n){t.e(n)}finally{t.f()}window.removeEventListener("scroll",this.onScroll),clearTimeout(this.parentCheck)}}]),e}();function Mn(e,t,n){for(;t;){var r=ne.get(t);if(r&&r.parent==e)return r;var i=t.parentNode;t=i!=e.dom?i:n>0?t.nextSibling:t.previousSibling}return null}var Pn="\ufdda";function Tn(e,t,n,r){var i,a,o,s=e.state.selection.primary;if(t>-1&&(o=e.docView.domBoundsAround(t,n,0))){var c=o,l=c.from,u=c.to,f=e.docView.impreciseHead||e.docView.impreciseAnchor?[]:function(e,t){var n=[];if(t.activeElement!=e)return n;var r=F(t),i=r.anchorNode,a=r.anchorOffset,o=r.focusNode,s=r.focusOffset;i&&(n.push(new An(i,a)),o==i&&s==a||n.push(new An(o,s)));return n}(e.contentDOM,e.root),d=new _n(f);d.readRange(o.startDOM,o.endDOM),a=function(e,t){if(0==e.length)return null;var n=e[0].pos,r=2==e.length?e[1].pos:n;return n>-1&&r>-1?p.d.single(n+t,r+t):null}(f,l);var h=s.from,v=null;8===e.inputState.lastKeyCode&&e.inputState.lastKeyTime>Date.now()-100&&(h=s.to,v="end");var m=function(e,t,n,r){var i=Math.min(e.length,t.length),a=0;for(;a0&&s>0&&e.charCodeAt(o-1)==t.charCodeAt(s-1);)o--,s--;if("end"==r){n-=o+Math.max(0,a-Math.min(o,s))-a}if(o=o?a-n:0)+(s-o),o=a}else if(s=s?a-n:0)+(o-s),s=a}return{from:a,toA:o,toB:s}}(e.state.doc.sliceString(l,u,Pn),d.text,h-l,v);m&&(i={from:l+m.from,to:l+m.toA,insert:p.k.of(d.text.slice(m.from,m.toB).split(Pn))})}else if(e.hasFocus){var g=F(e.root),b=e.docView,y=b.impreciseHead,O=b.impreciseAnchor,x=y&&y.node==g.focusNode&&y.offset==g.focusOffset?e.state.selection.primary.head:e.docView.posFromDOM(g.focusNode,g.focusOffset),k=O&&O.node==g.anchorNode&&O.offset==g.anchorOffset?e.state.selection.primary.anchor:function(e){var t=e.isCollapsed;return t&&$.chrome&&e.rangeCount&&!e.getRangeAt(0).collapsed&&(t=!1),t}(g)?x:e.docView.posFromDOM(g.anchorNode,g.anchorOffset);x==s.head&&k==s.anchor||(a=p.d.single(k,x))}if(i||a)if(!i&&r&&!s.empty&&a&&a.primary.empty&&(i={from:s.from,to:s.to,insert:e.state.doc.slice(s.from,s.to)}),i){var w=e.state;if($.android&&(i.from==s.from&&i.to==s.to&&1==i.insert.length&&2==i.insert.lines&&Rn(e,"Enter",10)||i.from==s.from-1&&i.to==s.to&&0==i.insert.length&&Rn(e,"Backspace",8)||i.from==s.from&&i.to==s.to+1&&0==i.insert.length&&Rn(e,"Delete",46)))return;var j,S=i.insert.toString();if(e.state.facet(Ot).some((function(t){return t(e,i.from,i.to,S)})))return;if(i.from>=s.from&&i.to<=s.to&&i.to-i.from>=(s.to-s.from)/3){var C=s.fromi.to?w.doc.sliceString(i.to,s.to,Pn):"";j=w.replaceSelection(p.k.of((C+i.insert.sliceString(0,void 0,Pn)+E).split(Pn)))}else{var M=w.changes(i);j={changes:M,selection:a&&!w.selection.primary.eq(a.primary)&&a.primary.to<=M.newLength?w.selection.replaceRange(a.primary):void 0}}e.dispatch(j,{scrollIntoView:!0,annotations:p.l.userEvent.of("input")})}else if(a&&!a.primary.eq(s)){var P,T=!1;e.inputState.lastSelectionTime>Date.now()-50&&("keyboardselection"==e.inputState.lastSelectionOrigin?T=!0:P=p.l.userEvent.of(e.inputState.lastSelectionOrigin)),e.dispatch({selection:a,scrollIntoView:T,annotations:P})}}var _n=function(){function e(t){Object(f.a)(this,e),this.points=t,this.text=""}return Object(d.a)(e,[{key:"readRange",value:function(e,t){if(e){for(var n=e.parentNode,r=e;;){this.findPointBefore(n,r),this.readNode(r);var i=r.nextSibling;if(i==t)break;var a=ne.get(r),o=ne.get(i);((a?a.breakAfter:Dn(r))||(o?o.breakAfter:Dn(i))&&("BR"!=r.nodeName||r.cmIgnore))&&(this.text+=Pn),r=i}this.findPointBefore(n,t)}}},{key:"readNode",value:function(e){if(!e.cmIgnore){var t,n=ne.get(e),r=n&&n.overrideDOMText;null!=r?t=r.sliceString(0,void 0,Pn):3==e.nodeType?t=e.nodeValue:"BR"==e.nodeName?t=e.nextSibling?Pn:"":1==e.nodeType&&this.readRange(e.firstChild,null),null!=t&&(this.findPointIn(e,t.length),this.text+=t)}}},{key:"findPointBefore",value:function(e,t){var n,r=Object(u.a)(this.points);try{for(r.s();!(n=r.n()).done;){var i=n.value;i.node==e&&e.childNodes[i.offset]==t&&(i.pos=this.text.length)}}catch(a){r.e(a)}finally{r.f()}}},{key:"findPointIn",value:function(e,t){var n,r=Object(u.a)(this.points);try{for(r.s();!(n=r.n()).done;){var i=n.value;i.node==e&&(i.pos=this.text.length+Math.min(i.offset,t))}}catch(a){r.e(a)}finally{r.f()}}}]),e}();function Dn(e){return 1==e.nodeType&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(e.nodeName)}var An=function e(t,n){Object(f.a)(this,e),this.node=t,this.offset=n,this.pos=-1};function Rn(e,t,n){var r={key:t,code:t,keyCode:n,which:n,cancelable:!0},i=new KeyboardEvent("keydown",r);e.contentDOM.dispatchEvent(i);var a=new KeyboardEvent("keyup",r);return e.contentDOM.dispatchEvent(a),i.defaultPrevented||a.defaultPrevented}var Ln=function(){function e(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(f.a)(this,e),this.plugins=[],this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.className=Ae("scroller"),this.scrollDOM.appendChild(this.contentDOM),this.dom=document.createElement("div"),this.dom.appendChild(this.scrollDOM),this._dispatch=n.dispatch||function(e){return t.update([e])},this.dispatch=this.dispatch.bind(this),this.root=n.root||document,this.viewState=new $t(n.state||p.e.create()),this.plugins=this.state.facet(Ct).map((function(e){return Tt.create(e,t)})),this.observer=new En(this,(function(e,n,r){return Tn(t,e,n,r)}),(function(e){t.inputState.runScrollHandlers(t,e),t.measure()})),this.docView=new Vt(this),this.inputState=new ln(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,$n(),this.requestMeasure(),n.parent&&n.parent.appendChild(this.dom)}return Object(d.a)(e,[{key:"dispatch",value:function(){var e;this._dispatch(1==arguments.length&&(arguments.length<=0?void 0:arguments[0])instanceof p.l?arguments.length<=0?void 0:arguments[0]:(e=this.state).update.apply(e,arguments))}},{key:"update",value:function(e){if(0!=this.updateState)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");this.updateState=2;var t,n=this.state,r=Object(u.a)(e);try{for(r.s();!(t=r.n()).done;){var i=t.value;if(i.startState!=n)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");n=i.state}}catch(f){r.e(f)}finally{r.f()}var a=new Nt(this,n,e),o=e.some((function(e){return e.scrollIntoView}))?n.selection.primary:null;this.viewState.update(a,o),this.bidiCache=Qn.update(this.bidiCache,a.changes),a.empty||this.updatePlugins(a);var s=this.docView.update(a);this.state.facet(Rt)!=this.styleModules&&this.mountStyles(),this.updateAttrs(),this.updateState=0,(s||o||this.viewState.mustEnforceCursorAssoc)&&this.requestMeasure();var c,l=Object(u.a)(this.state.facet(yt));try{for(l.s();!(c=l.n()).done;){(0,c.value)(a)}}catch(f){l.e(f)}finally{l.f()}}},{key:"setState",value:function(e){var t=this;if(0!=this.updateState)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");this.updateState=2;var n,r=Object(u.a)(this.plugins);try{for(r.s();!(n=r.n()).done;){n.value.destroy(this)}}catch(i){r.e(i)}finally{r.f()}this.viewState=new $t(e),this.plugins=e.facet(Ct).map((function(e){return Tt.create(e,t)})),this.docView=new Vt(this),this.inputState.ensureHandlers(this),this.mountStyles(),this.updateAttrs(),this.bidiCache=[],this.updateState=0,this.requestMeasure()}},{key:"updatePlugins",value:function(e){var t=e.prevState.facet(Ct),n=e.state.facet(Ct);if(t!=n){var r,i=[],a=[],o=Object(u.a)(n);try{for(o.s();!(r=o.n()).done;){var s=r.value,c=t.indexOf(s);if(c<0)i.push(Tt.create(s,this));else{var l=this.plugins[c].update(e);a.push(l),i.push(l)}}}catch(v){o.e(v)}finally{o.f()}var f,d=Object(u.a)(this.plugins);try{for(d.s();!(f=d.n()).done;){var h=f.value;a.indexOf(h)<0&&h.destroy(this)}}catch(v){d.e(v)}finally{d.f()}this.plugins=i,this.inputState.ensureHandlers(this)}else for(var p=0;p-1&&cancelAnimationFrame(this.measureScheduled),this.measureScheduled=-1;for(var t=null,n=0;;n++){this.updateState=1;var r=this.viewState.measure(this.docView,n>0),i=this.measureRequests;if(!r&&!i.length&&null==this.viewState.scrollTo)break;if(this.measureRequests=[],n>5){console.warn("Viewport failed to stabilize");break}var a=i.map((function(t){try{return t.read(e)}catch(n){return xt(e.state,n),Bn}})),o=new Nt(this,this.state);o.flags|=r,t?t.flags|=r:t=o,this.updateState=2,this.updatePlugins(o),r&&this.docView.update(o);for(var s=0;s1&&void 0!==arguments[1]?arguments[1]:0;return this.docView.posFromDOM(e,t)}},{key:"readMeasured",value:function(){if(2==this.updateState)throw new Error("Reading the editor layout isn't allowed during an update");0==this.updateState&&this.measureScheduled>-1&&this.measure()}},{key:"requestMeasure",value:function(e){var t=this;if(this.measureScheduled<0&&(this.measureScheduled=requestAnimationFrame((function(){return t.measure()}))),e){if(null!=e.key)for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:0;return this.viewState.lineAt(e,t)}},{key:"viewportLines",value:function(e,t){var n=this.viewport,r=n.from,i=n.to;this.viewState.forEachLine(r,i,e,In(t,this.contentDOM))}},{key:"moveByChar",value:function(e,t,n){return cn(this,e,t,n)}},{key:"moveByGroup",value:function(e,t){var n=this;return cn(this,e,t,(function(t){return function(e,t,n){var r=e.state.charCategorizer(t),i=r(n);return function(e){var t=r(e);return i==p.c.Space&&(i=t),i==t}}(n,e.head,t)}))}},{key:"moveToLineBoundary",value:function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return sn(this,e,t,n)}},{key:"moveVertically",value:function(e,t,n){return function(e,t,n,r){var i,a=t.head,o=n?1:-1;if(a==(n?e.state.doc.length:0))return p.d.cursor(a);var s=e.coordsAtPos(a);if(s)for(var c=e.dom.getBoundingClientRect(),l=null!==(i=t.goalColumn)&&void 0!==i?i:s.left-c.left,u=c.left+l,f=null!==r&&void 0!==r?r:5,d=o<0?s.top:s.bottom,h=0;h<50;h+=10){var v=on(e,{x:u,y:d+(f+h)*o},o);if(v<0)break;if(v!=a)return p.d.cursor(v,void 0,void 0,l)}var m=e.state.doc,b=m.lineAt(a),y=e.state.tabSize,O=t.goalColumn,x=0;if(null==O){for(var k=m.iterRange(b.from,a);!k.next().done;)x=Object(g.d)(k.value,x,y);O=x*e.defaultCharacterWidth}else x=Math.round(O/e.defaultCharacterWidth);if(o<0&&0==b.from)return p.d.cursor(0);if(o>0&&b.to==m.length)return p.d.cursor(b.to);for(var w=m.line(b.number+o),j=w.from,S=0,C=m.iterRange(w.from,w.to);S>=x&&!C.next().done;){var E=Object(g.e)(C.value,S,x,y),M=E.offset;S=x-E.leftOver,j+=M}return p.d.cursor(j,void 0,void 0,O)}(this,e,t,n)}},{key:"scrollPosIntoView",value:function(e){this.viewState.scrollTo=p.d.cursor(e),this.requestMeasure()}},{key:"posAtCoords",value:function(e){return this.readMeasured(),on(this,e)}},{key:"coordsAtPos",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;this.readMeasured();var n=this.docView.coordsAt(e,t);if(!n||n.left==n.right)return n;var r=this.state.doc.lineAt(e),i=this.bidiSpans(r),a=i[Ye.find(i,e-r.from,-1,t)];return q(n,a.dir==Re.LTR==t>0)}},{key:"bidiSpans",value:function(e){if(e.length>Nn)return Ge(e.length);var t,n=this.textDirection,r=Object(u.a)(this.bidiCache);try{for(r.s();!(t=r.n()).done;){var i=t.value;if(i.from==e.from&&i.dir==n)return i.order}}catch(o){r.e(o)}finally{r.f()}var a=Ke(e.slice(),this.textDirection);return this.bidiCache.push(new Qn(e.from,e.to,n,a)),a}},{key:"focus",value:function(){var e=this;this.observer.ignore((function(){Z(e.contentDOM),e.docView.updateSelection()}))}},{key:"destroy",value:function(){var e,t=Object(u.a)(this.plugins);try{for(t.s();!(e=t.n()).done;){e.value.destroy(this)}}catch(n){t.e(n)}finally{t.f()}this.inputState.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&cancelAnimationFrame(this.measureScheduled)}},{key:"state",get:function(){return this.viewState.state}},{key:"viewport",get:function(){return this.viewState.viewport}},{key:"visibleRanges",get:function(){return this.viewState.visibleRanges}},{key:"inView",get:function(){return this.viewState.inView}},{key:"composing",get:function(){return this.inputState.composing}},{key:"themeClasses",get:function(){return Te+" "+(this.state.facet(Pe)?"cm-dark":"cm-light")+" "+this.state.facet(Me)}},{key:"contentHeight",get:function(){return this.viewState.heightMap.height+this.viewState.paddingTop+this.viewState.paddingBottom}},{key:"defaultCharacterWidth",get:function(){return this.viewState.heightOracle.charWidth}},{key:"defaultLineHeight",get:function(){return this.viewState.heightOracle.lineHeight}},{key:"textDirection",get:function(){return this.viewState.heightOracle.direction}},{key:"lineWrapping",get:function(){return this.viewState.heightOracle.lineWrapping}},{key:"hasFocus",get:function(){return this.root.activeElement==this.contentDOM}}],[{key:"domEventHandlers",value:function(e){return Et.define((function(){return{}}),{eventHandlers:e})}},{key:"theme",value:function(e,t){var n=v.a.newName(),r=[Me.of(n),Rt.of(De(".".concat(Te,".").concat(n),e))];return t&&t.dark&&r.push(Pe.of(!0)),r}},{key:"baseTheme",value:function(e){return Object(p.o)(Rt.of(De("."+Te,e)),"fallback")}}]),e}();Ln.styleModule=Rt,Ln.inputHandler=Ot,Ln.exceptionSink=bt,Ln.updateListener=yt,Ln.editable=kt,Ln.dragMovesSelection=mt,Ln.clickAddsSelectionRange=vt,Ln.mouseSelectionStyle=gt,Ln.decorations=At,Ln.lineWrapping=Ln.theme({$content:{whiteSpace:"pre-wrap"}}),Ln.contentAttributes=Dt,Ln.editorAttributes=_t;var Nn=4096;function In(e,t){return null==e?t.getBoundingClientRect().top:e}var zn=-1;function $n(){window.addEventListener("resize",(function(){-1==zn&&(zn=setTimeout(Fn,50))}))}function Fn(){zn=-1;for(var e=document.querySelectorAll(".cm-content"),t=0;t1&&void 0!==arguments[1]?arguments[1]:Wn,r=Object.create(null),i=Object.create(null),a=function(e,t){var n=i[e];if(null==n)i[e]=t;else if(n!=t)throw new Error("Key binding "+e+" is used both as a regular binding and as a multi-stroke prefix")},o=function(e,t,i,o){for(var s=r[e]||(r[e]=Object.create(null)),c=t.split(/ (?!$)/).map((function(e){return Hn(e,n)})),l=function(t){var n=c.slice(0,t).join(" ");a(n,!0),s[n]||(s[n]={preventDefault:!0,commands:[function(t){var r=Kn={view:t,prefix:n,scope:e};return setTimeout((function(){Kn==r&&(Kn=null)}),4e3),!0}]})},u=1;u0&&void 0!==arguments[0]?arguments[0]:{};return[er.of(e),rr,ar]}var nr=function(){function e(t,n,r,i,a){Object(f.a)(this,e),this.left=t,this.top=n,this.width=r,this.height=i,this.className=a}return Object(d.a)(e,[{key:"draw",value:function(){var e=document.createElement("div");return e.className=this.className,e.style.left=this.left+"px",e.style.top=this.top+"px",this.width>=0&&(e.style.width=this.width+"px"),e.style.height=this.height+"px",e}},{key:"eq",value:function(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}}]),e}(),rr=Et.fromClass(function(){function e(t){Object(f.a)(this,e),this.view=t,this.rangePieces=[],this.cursors=[],this.measureReq={read:this.readPos.bind(this),write:this.drawSel.bind(this)},this.selectionLayer=t.scrollDOM.appendChild(document.createElement("div")),this.selectionLayer.className=Ae("selectionLayer"),this.selectionLayer.setAttribute("aria-hidden","true"),this.cursorLayer=t.scrollDOM.appendChild(document.createElement("div")),this.cursorLayer.className=Ae("cursorLayer"),this.cursorLayer.setAttribute("aria-hidden","true"),t.requestMeasure(this.measureReq),this.setBlinkRate()}return Object(d.a)(e,[{key:"setBlinkRate",value:function(){this.cursorLayer.style.animationDuration=this.view.state.facet(er).cursorBlinkRate+"ms"}},{key:"update",value:function(e){var t=e.prevState.facet(er)!=e.state.facet(er);(t||e.selectionSet||e.geometryChanged||e.viewportChanged)&&this.view.requestMeasure(this.measureReq),e.transactions.some((function(e){return e.scrollIntoView}))&&(this.cursorLayer.style.animationName="cm-blink"==this.cursorLayer.style.animationName?"cm-blink2":"cm-blink"),t&&this.setBlinkRate()}},{key:"readPos",value:function(){var e,t=this,n=this.view.state,r=n.facet(er),i=n.selection.ranges.map((function(e){return e.empty?[]:function(e,t){if(t.to<=e.viewport.from||t.from>=e.viewport.to)return[];var n=Math.max(t.from,e.viewport.from),r=Math.min(t.to,e.viewport.to),i=e.textDirection==Re.LTR,a=e.contentDOM,o=a.getBoundingClientRect(),s=sr(e),c=window.getComputedStyle(a.firstChild),l=o.left+parseInt(c.paddingLeft),f=o.right-parseInt(c.paddingRight),d=e.visualLineAt(n),h=e.visualLineAt(r);if(d.from==h.from)return y(O(t.from,t.to));var v=O(t.from,null),m=O(null,t.to),g=[];return d.tod&&m.from=b)break;j>g&&s(Math.max(w,g),null==t&&w<=d,Math.min(j,b),null==n&&j>=h,k.dir)}}catch(C){x.e(C)}finally{x.f()}if((g=O.to+1)>=b)break}}}catch(C){v.e(C)}finally{v.f()}if(0==o.length){var S=e.coordsAtPos(d,-1);r=Math.min(S.top,r),a=Math.max(S.bottom,a)}return{top:r,bottom:a,horizontal:o}}}(t.view,e)})).reduce((function(e,t){return e.concat(t)})),a=[],o=Object(u.a)(n.selection.ranges);try{for(o.s();!(e=o.n()).done;){var s=e.value,c=s==n.selection.primary;if(s.empty?!c||Jn:r.drawRangeCursor){var l=ur(this.view,s,c);l&&a.push(l)}}}catch(f){o.e(f)}finally{o.f()}return{rangePieces:i,cursors:a}}},{key:"drawSel",value:function(e){var t=this,n=e.rangePieces,r=e.cursors;if(n.length!=this.rangePieces.length||n.some((function(e,n){return!e.eq(t.rangePieces[n])}))){this.selectionLayer.textContent="";var i,a=Object(u.a)(n);try{for(a.s();!(i=a.n()).done;){var o=i.value;this.selectionLayer.appendChild(o.draw())}}catch(f){a.e(f)}finally{a.f()}this.rangePieces=n}if(r.length!=this.cursors.length||r.some((function(e,n){return!e.eq(t.cursors[n])}))){this.cursorLayer.textContent="";var s,c=Object(u.a)(r);try{for(c.s();!(s=c.n()).done;){var l=s.value;this.cursorLayer.appendChild(l.draw())}}catch(f){c.e(f)}finally{c.f()}this.cursors=r}}},{key:"destroy",value:function(){this.selectionLayer.remove(),this.cursorLayer.remove()}}]),e}()),ir={$content:{"& ::selection":{backgroundColor:"transparent !important"}}};Jn&&(ir.$content.caretColor="transparent !important");var ar=Object(p.o)(Ln.theme(ir),"override"),or=Ae("selectionBackground");function sr(e){var t=e.scrollDOM.getBoundingClientRect();return{left:t.left-e.scrollDOM.scrollLeft,top:t.top-e.scrollDOM.scrollTop}}var cr=Ae("cursor.primary"),lr=Ae("cursor.secondary");function ur(e,t,n){var r=e.coordsAtPos(t.head,t.assoc||1);if(!r)return null;var i=sr(e);return new nr(r.left-i.left,r.top-i.top,-1,r.bottom-r.top,n?cr:lr)}var fr=/[\0-\x08\n-\x1F\x7F-\x9F\xAD\u061C\u200B\u200C\u200E\u200F\u2028\u2029\uFEFF\uFFF9-\uFFFC]/g,dr={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"},hr=null;function pr(){if(null==hr&&"undefined"!=typeof document&&document.body){var e=document.body.style;hr=null!=(e.tabSize||e.MozTabSize)}return hr||!1}var vr=null!=/x/.unicode?"gu":"g",mr=p.f.define({combine:function(e){var t=Object(p.m)(e,{render:null,specialChars:fr,addSpecialChars:null});return(t.replaceTabs=!pr())&&(t.specialChars=new RegExp("\t|"+t.specialChars.source,vr)),t.addSpecialChars&&(t.specialChars=new RegExp(t.specialChars.source+"|"+t.addSpecialChars.source,vr)),t}});function gr(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=[mr.of(e),br];return pr()||t.push(kr),t}var br=Et.fromClass(function(){function e(t){Object(f.a)(this,e),this.view=t,this.decorations=ke.none,this.decorationCache=Object.create(null),this.recompute()}return Object(d.a)(e,[{key:"update",value:function(e){var t=e.prevState.facet(mr)!=e.state.facet(mr);t&&(this.decorationCache=Object.create(null)),(t||e.changes.length||e.viewportChanged)&&this.recompute()}},{key:"recompute",value:function(){var e,t=[],n=Object(u.a)(this.view.visibleRanges);try{for(n.s();!(e=n.n()).done;){var r=e.value,i=r.from,a=r.to;this.getDecorationsFor(i,a,t)}}catch(o){n.e(o)}finally{n.f()}this.decorations=ke.set(t)}},{key:"getDecorationsFor",value:function(e,t,n){for(var r,i=this.view.state.facet(mr),a=this.view.state.doc,o=e,s=a.iterRange(e,t);!s.next().done;){if(!s.lineBreak)for(;r=i.specialChars.exec(s.value);){var c=Object(g.b)(r[0],0),l=void 0;if(null!=c){if(9==c){var u=a.lineAt(o+r.index),f=this.view.state.tabSize,d=Object(g.d)(a.sliceString(u.from,o+r.index),0,f);l=ke.replace({widget:new Or((f-d%f)*this.view.defaultCharacterWidth)})}else l=this.decorationCache[c]||(this.decorationCache[c]=ke.replace({widget:new yr(i,c)}));n.push(l.range(o+r.index,o+r.index+r[0].length))}}o+=s.value.length}}}]),e}(),{decorations:function(e){return e.decorations}});var yr=function(e){Object(s.a)(n,e);var t=Object(c.a)(n);function n(e,r){var i;return Object(f.a)(this,n),(i=t.call(this)).options=e,i.code=r,i}return Object(d.a)(n,[{key:"eq",value:function(e){return e.code==this.code}},{key:"toDOM",value:function(){var e,t=((e=this.code)>=32?null:10==e?"\u2424":String.fromCharCode(9216+e))||"\u2022",n="Control character "+(dr[this.code]||this.code),r=this.options.render&&this.options.render(this.code,n,t);if(r)return r;var i=document.createElement("span");return i.textContent=t,i.title=n,i.setAttribute("aria-label",n),i.style.color="red",i}},{key:"ignoreEvent",value:function(){return!1}}]),n}(xe),Or=function(e){Object(s.a)(n,e);var t=Object(c.a)(n);function n(e){var r;return Object(f.a)(this,n),(r=t.call(this)).width=e,r}return Object(d.a)(n,[{key:"eq",value:function(e){return e.width==this.width}},{key:"toDOM",value:function(){var e=document.createElement("span");return e.textContent="\t",e.className=xr,e.style.width=this.width+"px",e}},{key:"ignoreEvent",value:function(){return!1}}]),n}(xe),xr=v.a.newName(),kr=Ln.styleModule.of(new v.a(Object(r.a)({},"."+xr,{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"})));function wr(){return p.e.transactionFilter.of((function(e){if(!e.docChanged||"input"!=e.annotation(p.l.userEvent))return e;var t=e.startState.languageDataAt("indentOnInput",e.startState.selection.primary.head);if(!t.length)return e;var n=e.newDoc,r=e.newSelection.primary.head,i=n.lineAt(r);if(r>i.from+200)return e;var a=n.sliceString(i.from,r);if(!t.some((function(e){return e.test(a)})))return e;var o,s=e.state,c=-1,f=[],d=Object(u.a)(s.selection.ranges);try{var h=function(){var e=o.value.head,t=s.doc.lineAt(e);if(t.from==c)return"continue";c=t.from;var n=Math.max.apply(Math,Object(l.a)(s.facet(p.e.indentation).map((function(e){return e(new p.g(s),t.from)}))));if(n<0)return"continue";var r=/^\s*/.exec(t.slice(0,Math.min(t.length,200)))[0],i=s.indentString(n);r!=i&&f.push({from:t.from,to:t.from+r.length,insert:i})};for(d.s();!(o=d.n()).done;)h()}catch(v){d.e(v)}finally{d.f()}return f.length?[e,{changes:f}]:e}))}},function(e,t,n){"use strict";var r=n(2),i=n(8),a=n(0),o=n.n(a),s=(n(12),n(113)),c=n.n(s),l=n(345),u=n(376),f=n(204),d=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(n){var a=t.defaultTheme,s=t.withTheme,d=void 0!==s&&s,h=t.name,p=Object(i.a)(t,["defaultTheme","withTheme","name"]);var v=h,m=Object(l.a)(e,Object(r.a)({defaultTheme:a,Component:n,name:h||n.displayName,classNamePrefix:v},p)),g=o.a.forwardRef((function(e,t){e.classes;var s,c=e.innerRef,l=Object(i.a)(e,["classes","innerRef"]),p=m(Object(r.a)(Object(r.a)({},n.defaultProps),e)),v=l;return("string"===typeof h||d)&&(s=Object(f.a)()||a,h&&(v=Object(u.a)({theme:s,name:h,props:l})),d&&!v.theme&&(v.theme=s)),o.a.createElement(n,Object(r.a)({ref:c||t,classes:p},v))}));return c()(g,n),g}},h=n(69);t.a=function(e,t){return d(e,Object(r.a)({defaultTheme:h.a},t))}},function(e,t,n){e.exports=n(230)()},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";n.d(t,"a",(function(){return a}));var r=n(13);function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function a(e){for(var t=1;te)return u[t-1]<=e;return!1}function h(e){return e>=127462&&e<=127487}function p(e,t){if(t==e.length)return t;t&&m(e.charCodeAt(t))&&g(e.charCodeAt(t-1))&&t--;var n=b(e,t);for(t+=O(n);t=0&&h(b(e,a));)i++,a-=2;if(i%2==0)break;t+=2}}return t}function v(e,t){for(;t>0;){var n=p(e,t-2);if(n=56320&&e<57344}function g(e){return e>=55296&&e<56320}function b(e,t){var n=e.charCodeAt(t);if(!g(n)||t+1==e.length)return n;var r=e.charCodeAt(t+1);return m(r)?r-56320+(n-55296<<10)+65536:n}function y(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e)))}function O(e){return e<65536?1:2}function x(e,t,n){for(var r=0;r=n)return{offset:i,leftOver:0};t+=9==e.charCodeAt(i)?r-t%r:1,i=p(e,i)}return{offset:e.length,leftOver:n-t}}var w=function(){function e(){Object(c.a)(this,e)}return Object(l.a)(e,[{key:"lineAt",value:function(e){if(e<0||e>this.length)throw new RangeError("Invalid position ".concat(e," in document of length ").concat(this.length));var t,n=Object(s.a)(j);try{for(n.s();!(t=n.n()).done;){var r=t.value;if(r.doc==this&&r.from<=e&&r.to>=e)return r}}catch(i){n.e(i)}finally{n.f()}return C(this.lineInner(e,!1,1,0).finish(this))}},{key:"line",value:function(e){if(e<1||e>this.lines)throw new RangeError("Invalid line number ".concat(e," in ").concat(this.lines,"-line document"));var t,n=Object(s.a)(j);try{for(n.s();!(t=n.n()).done;){var r=t.value;if(r.doc==this&&r.number==e)return r}}catch(i){n.e(i)}finally{n.f()}return C(this.lineInner(e,!0,1,0).finish(this))}},{key:"replace",value:function(e,t,n){var r=[];return this.decompose(0,e,r),r.push(n),this.decompose(t,this.length,r),M.from(r,this.length-(t-e)+n.length)}},{key:"append",value:function(e){return 0==this.length?e:0==e.length?this:M.from([this,e],this.length+e.length)}},{key:"slice",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.length,n=[];return this.decompose(e,t,n),M.from(n,t-e)}},{key:"eq",value:function(e){return this==e||function(e,t){if(e.length!=t.length||e.lines!=t.lines)return!1;for(var n=new D(e),r=new D(t),i=0,a=0;;){if(n.lineBreak!=r.lineBreak||n.done!=r.done)return!1;if(n.done)return!0;if(n.lineBreak)n.next(),r.next(),i=a=0;else{var o=n.value.slice(i),s=r.value.slice(a);if(o.length==s.length){if(o!=s)return!1;n.next(),r.next(),i=a=0}else if(o.length>s.length){if(o.slice(0,s.length)!=s)return!1;i+=s.length,r.next(),a=0}else{if(s.slice(0,o.length)!=o)return!1;a+=o.length,n.next(),i=0}}}}(this,e)}},{key:"iter",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return new D(this,e)}},{key:"iterRange",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.length;return new A(this,e,t)}},{key:"iterLines",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return new R(this,e)}},{key:"toString",value:function(){return this.sliceString(0)}},{key:"toJSON",value:function(){for(var e=[],t=this.iterLines();!t.next().done;)e.push(t.value);return e}}],[{key:"of",value:function(t){if(0==t.length)throw new RangeError("A document must have at least one line");if(1==t.length&&!t[0]&&e.empty)return e.empty;var n=P(t);return n<1024?new E(t,n):M.from(E.split(t,[]),n)}}]),e}();"undefined"!=typeof Symbol&&(w.prototype[Symbol.iterator]=function(){return this.iter()});var j=[],S=-1;function C(e){return j[S=(S+1)%10]=e}var E=function(e){Object(a.a)(n,e);var t=Object(o.a)(n);function n(e){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:P(e);return Object(c.a)(this,n),(r=t.call(this)).text=e,r.length=i,r}return Object(l.a)(n,[{key:"lineInner",value:function(e,t,n,r){for(var i=0;;i++){var a=this.text[i],o=r+a.length;if((t?n:o)>=e)return new L(r,o,n,a);r=o+1,n++}}},{key:"decompose",value:function(e,t,r){r.push(new n(_(this.text,e,t),Math.min(t,this.length)-Math.max(0,e)))}},{key:"lastLineLength",value:function(){return this.text[this.text.length-1].length}},{key:"firstLineLength",value:function(){return this.text[0].length}},{key:"replace",value:function(e,t,a){var o=this.length+a.length-(t-e);return o>=1024||!(a instanceof n)?Object(r.a)(Object(i.a)(n.prototype),"replace",this).call(this,e,t,a):new n(T(this.text,T(a.text,_(this.text,0,e)),t),o)}},{key:"sliceString",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.length,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"\n",r="",i=0,a=0;i<=t&&ae&&a&&(r+=n),ei&&(r+=o.slice(Math.max(0,e-i),t-i)),i=s+1}return r}},{key:"flatten",value:function(e){e[e.length-1]+=this.text[0];for(var t=1;t=56320&&f<57344&&u++,i.push(c.slice(0,u)),t.push(new n(i,512)),c=c.slice(u),a=-1,i=[]}}catch(d){o.e(d)}finally{o.f()}return-1!=a&&t.push(new n(i,a)),t}}]),n}(w),M=function(e){Object(a.a)(n,e);var t=Object(o.a)(n);function n(e,r){var i;Object(c.a)(this,n),(i=t.call(this)).children=e,i.length=r,i.lines=1;var a,o=Object(s.a)(e);try{for(o.s();!(a=o.n()).done;){var l=a.value;i.lines+=l.lines-1}}catch(u){o.e(u)}finally{o.f()}return i}return Object(l.a)(n,[{key:"lineInner",value:function(e,t,n,r){for(var i=0;;i++){var a=this.children[i],o=r+a.length,s=n+a.lines-1;if((t?s:o)>=e){var c=a.lineInner(e,t,n,r),l=void 0;return c.from==r&&(l=this.lineLengthTo(i))&&(c.from-=l,c.content=null),c.to==o&&(l=this.lineLengthFrom(i+1))&&(c.to+=l,c.content=null),c}r=o,n=s}}},{key:"decompose",value:function(e,t,n){for(var r=0,i=0;ii&&(i>=e&&o<=t?n.push(a):a.decompose(e-i,t-i,n)),i=o}}},{key:"lineLengthTo",value:function(e){for(var t=0,n=e-1;n>=0;n--){var r=this.children[n];if(r.lines>1)return t+r.lastLineLength();t+=r.length}return t}},{key:"lastLineLength",value:function(){return this.lineLengthTo(this.children.length)}},{key:"lineLengthFrom",value:function(e){for(var t=0,n=e;n1)return t+r.firstLineLength();t+=r.length}return t}},{key:"firstLineLength",value:function(){return this.lineLengthFrom(0)}},{key:"replace",value:function(e,t,a){if(a.length<512&&t-e<512)for(var o=a.length-(t-e),s=0,c=0;s=c&&t<=u&&l.length+o>2&&l.length+o>0){var f=this.children.slice();return f[s]=l.replace(e-c,t-c,a),new n(f,this.length+o)}c=u}return Object(r.a)(Object(i.a)(n.prototype),"replace",this).call(this,e,t,a)}},{key:"sliceString",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.length,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"\n",r="",i=0,a=0;aa){var c=o.sliceString(e-a,t-a,n);if(e>=a&&t<=s)return c;r+=c}a=s}return r}},{key:"flatten",value:function(e){var t,n=Object(s.a)(this.children);try{for(n.s();!(t=n.n()).done;){t.value.flatten(e)}}catch(r){n.e(r)}finally{n.f()}}}],[{key:"from",value:function(e,t){if(!e.every((function(e){return e instanceof w})))throw new Error("NOP");if(t<1024){var r,i=[""],a=Object(s.a)(e);try{for(a.s();!(r=a.n()).done;){r.value.flatten(i)}}catch(g){a.e(g)}finally{a.f()}return new E(i,t)}var o=Math.max(512,t>>3),c=o<<1,l=o>>1,u=[],f=0,d=[];function h(e){var t,r=e.length;if(r)if(r>c&&e instanceof n){var i,a=Object(s.a)(e.children);try{for(a.s();!(i=a.n()).done;){h(i.value)}}catch(g){a.e(g)}finally{a.f()}}else r>l&&(f>l||0==f)?(p(),u.push(e)):e instanceof E&&f>0&&(t=d[d.length-1])instanceof E&&e.length+t.length<=512?(f+=r,d[d.length-1]=new E(T(e.text,t.text.slice()),e.length+t.length)):(f+r>o&&p(),f+=r,d.push(e))}function p(){0!=f&&(u.push(1==d.length?d[0]:n.from(d,f)),f=0,d.length=0)}var v,m=Object(s.a)(e);try{for(m.s();!(v=m.n()).done;){h(v.value)}}catch(g){m.e(g)}finally{m.f()}return p(),1==u.length?u[0]:new n(u,t)}}]),n}(w);function P(e){var t,n=-1,r=Object(s.a)(e);try{for(r.s();!(t=r.n()).done;){n+=t.value.length+1}}catch(i){r.e(i)}finally{r.f()}return n}function T(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1e9,i=0,a=0,o=!0;a=n&&(c>r&&(s=s.slice(0,r-i)),i1&&void 0!==arguments[1]?arguments[1]:1;Object(c.a)(this,e),this.dir=n,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[t],this.offsets=[n>0?0:t instanceof E?t.text.length:t.children.length]}return Object(l.a)(e,[{key:"next",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;;){var t=this.nodes.length-1;if(t<0)return this.done=!0,this.value="",this.lineBreak=!1,this;var n=this.nodes[t],r=this.offsets[t];if(n instanceof E){if(r!=(this.dir>0?0:n.text.length)&&!this.lineBreak){if(this.lineBreak=!0,0==e)return this.value="\n",this;e--;continue}var i=n.text[r-(this.dir<0?1:0)];if(this.offsets[t]=r+=this.dir,r==(this.dir>0?n.text.length:0)&&(this.nodes.pop(),this.offsets.pop()),this.lineBreak=!1,i.length>Math.max(0,e))return this.value=0==e?i:this.dir>0?i.slice(e):i.slice(0,i.length-e),this;e-=i.length}else if(r==(this.dir>0?n.children.length:0))this.nodes.pop(),this.offsets.pop();else{var a=n.children[this.dir>0?r:r-1],o=a.length;this.offsets[t]=r+this.dir,e>o?e-=o:(this.nodes.push(a),this.offsets.push(this.dir>0?0:a instanceof E?a.text.length:a.children.length))}}}}]),e}(),A=function(){function e(t,n,r){Object(c.a)(this,e),this.value="",this.cursor=new D(t,n>r?-1:1),n>r?(this.skip=t.length-n,this.limit=n-r):(this.skip=n,this.limit=r-n)}return Object(l.a)(e,[{key:"next",value:function(){if(this.limit<=0)this.limit=-1;else{var e=this.cursor.next(this.skip),t=e.value,n=e.lineBreak,r=e.done;this.skip=0,this.value=t;var i=n?1:t.length;i>this.limit&&(this.value=this.cursor.dir>0?t.slice(0,this.limit):t.slice(i-this.limit)),r||0==this.value.length?this.limit=-1:this.limit-=this.value.length}return this}},{key:"lineBreak",get:function(){return this.cursor.lineBreak}},{key:"done",get:function(){return this.limit<0}}]),e}(),R=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;Object(c.a)(this,e),this.value="",this.done=!1,this.cursor=t.iter(),this.skip=n}return Object(l.a)(e,[{key:"next",value:function(){if(this.cursor.done)return this.done=!0,this.value="",this;for(this.value="";;){var e=this.cursor.next(this.skip),t=e.value,n=e.lineBreak,r=e.done;if(this.skip=0,r||n)return this;this.value+=t}}},{key:"lineBreak",get:function(){return!1}}]),e}(),L=function(){function e(t,n,r,i){Object(c.a)(this,e),this.from=t,this.to=n,this.number=r,this.content=i}return Object(l.a)(e,[{key:"slice",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.length;if(e==t)return"";if("string"==typeof this.content)return this.content.slice(e,t);this.content||(this.content=new N(this.doc,this.from));var n=this.content.slice(e,t);return 0==e&&t==this.length&&(this.content=n),n}},{key:"finish",value:function(e){return this.doc=e,this}},{key:"findClusterBreak",value:function(e,t){if(e<0||e>this.length)throw new RangeError("Invalid position given to Line.findClusterBreak");var n,r;return"string"==this.content?(n=this.from,r=this.content):(n=Math.max(0,e-256),r=this.slice(n,Math.min(this.length,n+512))),(t?p:v)(r,e-n)+n}},{key:"length",get:function(){return this.to-this.from}}]),e}(),N=function(){function e(t,n){Object(c.a)(this,e),this.doc=t,this.start=n,this.cursor=null,this.strings=null}return Object(l.a)(e,[{key:"slice",value:function(e,t){this.cursor||(this.cursor=this.doc.iter(),this.strings=[this.cursor.next(this.start).value]);for(var n="",r=0,i=0;;i++){if(i==this.strings.length){var a=this.cursor.next().value;if(!a)return n;this.strings.push(a)}var o=this.strings[i],s=r;if(!((r+=o.length)<=e)&&(n+=o.slice(Math.max(0,e-s),Math.min(o.length,t-s)),r>=t))return n}}}]),e}()},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";n.d(t,"a",(function(){return i}));var r=n(83);function i(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(e)){var n=[],r=!0,i=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(r=(o=s.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(c){i=!0,a=c}finally{try{r||null==s.return||s.return()}finally{if(i)throw a}}return n}}(e,t)||Object(r.a)(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},,function(e,t,n){"use strict";n.d(t,"d",(function(){return s})),n.d(t,"b",(function(){return l})),n.d(t,"c",(function(){return u})),n.d(t,"a",(function(){return f})),n.d(t,"e",(function(){return d}));var r=n(205);function i(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return Math.min(Math.max(t,e),n)}function a(e){if(e.type)return e;if("#"===e.charAt(0))return a(function(e){e=e.substr(1);var t=new RegExp(".{1,".concat(e.length>=6?2:1,"}"),"g"),n=e.match(t);return n&&1===n[0].length&&(n=n.map((function(e){return e+e}))),n?"rgb".concat(4===n.length?"a":"","(").concat(n.map((function(e,t){return t<3?parseInt(e,16):Math.round(parseInt(e,16)/255*1e3)/1e3})).join(", "),")"):""}(e));var t=e.indexOf("("),n=e.substring(0,t);if(-1===["rgb","rgba","hsl","hsla"].indexOf(n))throw new Error(Object(r.a)(3,e));var i=e.substring(t+1,e.length-1).split(",");return{type:n,values:i=i.map((function(e){return parseFloat(e)}))}}function o(e){var t=e.type,n=e.values;return-1!==t.indexOf("rgb")?n=n.map((function(e,t){return t<3?parseInt(e,10):e})):-1!==t.indexOf("hsl")&&(n[1]="".concat(n[1],"%"),n[2]="".concat(n[2],"%")),"".concat(t,"(").concat(n.join(", "),")")}function s(e,t){var n=c(e),r=c(t);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function c(e){var t="hsl"===(e=a(e)).type?a(function(e){var t=(e=a(e)).values,n=t[0],r=t[1]/100,i=t[2]/100,s=r*Math.min(i,1-i),c=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(e+n/30)%12;return i-s*Math.max(Math.min(t-3,9-t,1),-1)},l="rgb",u=[Math.round(255*c(0)),Math.round(255*c(8)),Math.round(255*c(4))];return"hsla"===e.type&&(l+="a",u.push(t[3])),o({type:l,values:u})}(e)).values:e.values;return t=t.map((function(e){return(e/=255)<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)})),Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function l(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.15;return c(e)>.5?f(e,t):d(e,t)}function u(e,t){return e=a(e),t=i(t),"rgb"!==e.type&&"hsl"!==e.type||(e.type+="a"),e.values[3]=t,o(e)}function f(e,t){if(e=a(e),t=i(t),-1!==e.type.indexOf("hsl"))e.values[2]*=1-t;else if(-1!==e.type.indexOf("rgb"))for(var n=0;n<3;n+=1)e.values[n]*=1-t;return o(e)}function d(e,t){if(e=a(e),t=i(t),-1!==e.type.indexOf("hsl"))e.values[2]+=(100-e.values[2])*t;else if(-1!==e.type.indexOf("rgb"))for(var n=0;n<3;n+=1)e.values[n]+=(255-e.values[n])*t;return o(e)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(0),i=n(38);function a(e,t){return r.useMemo((function(){return null==e&&null==t?null:function(n){Object(i.a)(e,n),Object(i.a)(t,n)}}),[e,t])}},function(e,t,n){"use strict";n.d(t,"a",(function(){return c})),n.d(t,"c",(function(){return f})),n.d(t,"d",(function(){return h})),n.d(t,"b",(function(){return p})),n.d(t,"e",(function(){return m})),n.d(t,"f",(function(){return y}));var r=n(16),i=n(15),a=n(7),o=n(4),s=n(6),c=1024,l=function(){function e(t,n){Object(o.a)(this,e),this.enter=t,this.leave=n,this.result=void 0}return Object(s.a)(e,[{key:"doEnter",value:function(e,t,n){var r=this.enter(e,t,n);return void 0===r||(!1!==r&&(this.result=r),!1)}},{key:"done",get:function(){return void 0!==this.result}}]),e}(),u=0,f=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.deserialize;Object(o.a)(this,e),this.id=u++,this.deserialize=n||function(){throw new Error("This node type doesn't define a deserialize function")}}return Object(s.a)(e,[{key:"set",value:function(e,t){return e[this.id]=t,e}},{key:"add",value:function(e){return new d(this,"function"==typeof e?e:h.match(e))}}],[{key:"string",value:function(){return new e({deserialize:function(e){return e}})}},{key:"number",value:function(){return new e({deserialize:Number})}},{key:"flag",value:function(){return new e({deserialize:function(){return!0}})}}]),e}();f.error=f.flag(),f.skipped=f.flag(),f.closedBy=new f({deserialize:function(e){return e.split(" ")}}),f.openedBy=new f({deserialize:function(e){return e.split(" ")}}),f.top=f.flag();var d=function e(t,n){Object(o.a)(this,e),this.prop=t,this.f=n},h=function(){function e(t,n,r){Object(o.a)(this,e),this.name=t,this.props=n,this.id=r}return Object(s.a)(e,[{key:"prop",value:function(e){return this.props[e.id]}}],[{key:"match",value:function(e){var t=Object.create(null);for(var n in e){var r,i=Object(a.a)(n.split(" "));try{for(i.s();!(r=i.n()).done;){var o=r.value;t[o]=e[n]}}catch(s){i.e(s)}finally{i.f()}}return function(e){return t[e.name]}}}]),e}();h.none=new h("",Object.create(null),0);var p=function(){function e(t){Object(o.a)(this,e),this.types=t;for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:0,n=this.resolveAt(e);if(0!=t)for(;;){var r=t<0?n.childBefore(e):n.childAfter(e);if(!r||(t<0?r.end:r.start)!=e)break;n=r}return n}},{key:"name",get:function(){return this.type.name}},{key:"depth",get:function(){for(var e=0,t=this.parent;t;t=t.parent)e++;return e}},{key:"root",get:function(){for(var e=this;e.parent;)e=e.parent;return e}},{key:"firstChild",get:function(){return this.childAfter(this.start-1)}},{key:"lastChild",get:function(){return this.childBefore(this.end+1)}}]),e}(),m=function(e){Object(r.a)(n,e);var t=Object(i.a)(n);function n(e,r,i,a){var s;return Object(o.a)(this,n),(s=t.call(this)).type=e,s.children=r,s.positions=i,s.length=a,s}return Object(s.a)(n,[{key:"toString",value:function(){var e=this.children.map((function(e){return e.toString()})).join();return this.name?(/\W/.test(this.name)&&!this.type.prop(f.error)?JSON.stringify(this.name):this.name)+(e.length?"("+e+")":""):e}},{key:"partial",value:function(e,t,r,i,a){for(var o=0;ot)break;var c=this.children[o],l=s+c.length;l=l?(i.push(c),a.push(s+r)):c instanceof n&&c.partial(e-s,t-s,r+s,i,a))}}},{key:"applyChanges",value:function(e){if(0==e.length)return this;var t=[],r=[];function i(e,t,n){var r=-1;return e.iterate({from:t,to:n<0?0:e.length,enter:function(){return r<0&&void 0},leave:function(e,i,a){r<0&&(n<0?a<=t:i>=t)&&!e.prop(f.error)&&(r=n<0?Math.min(t,a-1):Math.max(t,i+1))}}),r>-1?r:n<0?0:e.length}for(var a=0,o=0,s=0;;o++){var c=o==e.length?null:e[o],l=c?i(this,c.fromA,-1):this.length;if(l>s&&this.partial(s,l,a,t,r),!c)break;s=i(this,c.toA,1),a+=c.toB-c.fromB-(c.toA-c.fromA)}return new n(h.none,t,r,this.length+a)}},{key:"cut",value:function(e){if(e>=this.length)return this;for(var t=[],r=[],i=0;i=e)break;var o=this.children[i],s=a+o.length;t.push(s<=e?o:o.cut(e-a)),r.push(a)}return new n(this.type,t,r,e)}},{key:"iterate",value:function(e){var t=e.from,n=void 0===t?this.start:t,r=e.to,i=void 0===r?this.end:r,a=e.enter,o=e.leave,s=new l(a,o);return this.iterInner(n,i,0,s),s.result}},{key:"iterInner",value:function(e,t,n,r){if(!this.type.name||r.doEnter(this.type,n,n+this.length)){if(e<=t)for(var i=0;it)break;s=0&&!r.done;c--){var l=this.children[c],u=this.positions[c]+n;if(u+l.lengthe||l.iterInner(e,t,u,r)}r.leave&&this.type.name&&r.leave(this.type,n,n+this.length)}}},{key:"resolveAt",value:function(e){if(g==this)for(var t=b;;){var n=t.parent;if(!n)break;if(t.starte)return t.resolve(e);t=n}return g=this,b=this.resolveInner(e,0,this)}},{key:"childBefore",value:function(e){return this.findChild(e,-1,0,this)}},{key:"childAfter",value:function(e){return this.findChild(e,1,0,this)}},{key:"findChild",value:function(e,t,r,i){for(var a=0;a=e)if(t<0&&a>0)s=a-1;else{if(!(t>0))break;s=a}if(s<0&&(o+this.children[a].length>e||t<0&&a==this.children.length-1)&&(s=a),s>=0){var c=this.children[s],l=this.positions[s]+r;if(0==c.length&&l==e)continue;if(c instanceof n)return c.type.name?new O(c,l,i):c.findChild(e,t,l,i);var u=c.findIndex(e,t,l,0,c.buffer.length);if(u>-1)return new x(c,l,u,i)}}return null}},{key:"resolveInner",value:function(e,t,n){var r=this.findChild(e,0,t,n);return r?r.resolveAt(e):n}},{key:"append",value:function(e){if(e.children.length&&e.positions[0]0&&void 0!==arguments[0]?arguments[0]:c;return this.children.length<=w?this:S(this.type,h.none,this.children,this.positions,0,this.children.length,0,e,this.length)}},{key:"start",get:function(){return 0}},{key:"end",get:function(){return this.length}}],[{key:"build",value:function(e){return j(e)}}]),n}(v);m.empty=new m(h.none,[],[],0),m.prototype.parent=null;var g=m.empty,b=m.empty,y=function(){function e(t,n,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:h.none;Object(o.a)(this,e),this.buffer=t,this.length=n,this.group=r,this.type=i}return Object(s.a)(e,[{key:"toString",value:function(){for(var e=[],t=0;t(e+=4)){for(var o=[];et)return this.buffer.length;if(s>=e&&i.doEnter(a,o,s)){for(;r0?(c=s.pop(),l=o.buffer[c+3]):l=-1};u();e:for(var f=i;f>r&&!a.done;){for(;l==f;){var d=c,h=this.buffer[d],p=this.buffer[d+1]+n,v=this.buffer[d+2]+n;if(u(),p<=e&&v>=t&&!a.doEnter(this.group.types[h],p,v)){for(f=d;l>d;)u();continue e}}var m=this.buffer[--f],g=this.buffer[--f]+n,b=this.buffer[--f]+n,y=this.buffer[--f];b>e||g=e){if(t>0&&!u)return o;break}if(l>e)return o;u||(a=o),o=s[o+3]}return t<0?a:-1}}]),e}(),O=function(e){Object(r.a)(n,e);var t=Object(i.a)(n);function n(e,r,i){var a;return Object(o.a)(this,n),(a=t.call(this)).node=e,a.start=r,a.parent=i,a}return Object(s.a)(n,[{key:"resolveAt",value:function(e){return e<=this.start||e>=this.end?this.parent.resolveAt(e):this.node.resolveInner(e,this.start,this)}},{key:"childBefore",value:function(e){return this.node.findChild(e,-1,this.start,this)}},{key:"childAfter",value:function(e){return this.node.findChild(e,1,this.start,this)}},{key:"toString",value:function(){return this.node.toString()}},{key:"iterate",value:function(e){var t=e.from,n=void 0===t?this.start:t,r=e.to,i=void 0===r?this.end:r,a=e.enter,o=e.leave,s=new l(a,o);return this.node.iterInner(n,i,this.start,s),s.result}},{key:"type",get:function(){return this.node.type}},{key:"end",get:function(){return this.start+this.node.length}}]),n}(v),x=function(e){Object(r.a)(n,e);var t=Object(i.a)(n);function n(e,r,i,a){var s;return Object(o.a)(this,n),(s=t.call(this)).buffer=e,s.bufferStart=r,s.index=i,s.parent=a,s}return Object(s.a)(n,[{key:"childBefore",value:function(e){var t=this.buffer.findIndex(e,-1,this.bufferStart,this.index+4,this.endIndex);return t<0?null:new n(this.buffer,this.bufferStart,t,this)}},{key:"childAfter",value:function(e){var t=this.buffer.findIndex(e,1,this.bufferStart,this.index+4,this.endIndex);return t<0?null:new n(this.buffer,this.bufferStart,t,this)}},{key:"iterate",value:function(e){var t=e.from,n=void 0===t?this.start:t,r=e.to,i=void 0===r?this.end:r,a=e.enter,o=e.leave,s=new l(a,o);return n<=i?this.buffer.iterChild(n,i,this.bufferStart,this.index,s):this.buffer.iterRev(n,i,this.bufferStart,this.index,this.endIndex,s),s.result}},{key:"resolveAt",value:function(e){if(e<=this.start||e>=this.end)return this.parent.resolveAt(e);var t=this.buffer.findIndex(e,0,this.bufferStart,this.index+4,this.endIndex);return t<0?this:new n(this.buffer,this.bufferStart,t,this).resolveAt(e)}},{key:"toString",value:function(){var e=[];return this.buffer.childToString(this.index,e),e.join("")}},{key:"type",get:function(){return this.buffer.group.types[this.buffer.buffer[this.index]]}},{key:"start",get:function(){return this.buffer.buffer[this.index+1]+this.bufferStart}},{key:"end",get:function(){return this.buffer.buffer[this.index+2]+this.bufferStart}},{key:"endIndex",get:function(){return this.buffer.buffer[this.index+3]}}]),n}(v),k=function(){function e(t,n){Object(o.a)(this,e),this.buffer=t,this.index=n}return Object(s.a)(e,[{key:"next",value:function(){this.index-=4}},{key:"fork",value:function(){return new e(this.buffer,this.index)}},{key:"id",get:function(){return this.buffer[this.index-4]}},{key:"start",get:function(){return this.buffer[this.index-3]}},{key:"end",get:function(){return this.buffer[this.index-2]}},{key:"size",get:function(){return this.buffer[this.index-1]}},{key:"pos",get:function(){return this.index}}]),e}(),w=8;function j(e){var t=e.buffer,n=e.group,r=e.topID,i=void 0===r?0:r,a=e.maxBufferLength,o=void 0===a?c:a,s=e.reused,l=void 0===s?[]:s,u=e.minRepeatType,f=void 0===u?n.types.length:u,d=Array.isArray(t)?new k(t,t.length):t,p=n.types;function v(e,t,r,i,a){for(var s=d.id,c=d.start,u=d.end,b=d.size;s==a;)d.next(),s=d.id,c=d.start,u=d.end,b=d.size;var O=c-e;if(b<0)return r.push(l[s]),i.push(O),void d.next();var x,k,j=p[s];if(u-c<=o&&(k=function(e,t){var n=d.fork(),r=0,i=0,a=0,s=n.end-o,c={size:0,start:0,skip:0};e:for(var l=n.pos-e;n.pos>l;)if(n.id!=t){var u=n.size,h=n.pos-u;if(u<0||h=f?4:0,v=n.start;for(n.next();n.pos>h;){if(n.size<0)break e;n.id>=f&&(p+=4),n.next()}i=v,r+=u,a+=p}else c.size=r,c.start=i,c.skip=a,a+=4,r+=4,n.next();(t<0||r==e)&&(c.size=r,c.start=i,c.skip=a);return c.size>4?c:void 0}(d.pos-t,a))){for(var C=new Uint16Array(k.size-k.skip),E=d.pos-k.size,M=C.length;d.pos>E;)M=g(k.start,C,M,a);x=new y(C,u-k.start,n,a<0?h.none:p[a]),O=k.start-e}else{var P=d.pos-b;d.next();for(var T=[],_=[],D=s>=f?s:-1;d.pos>P;)v(c,P,T,_,D);T.reverse(),_.reverse(),x=D>-1&&T.length>w?S(j,j,T,_,0,T.length,0,o,u-c):new m(j,T,_,u-c)}r.push(x),i.push(O)}function g(e,t,n,r){var i=d.id,a=d.start,o=d.end,s=d.size;if(d.next(),i==r)return n;var c=n;if(s>4)for(var l=d.pos-(s-4);d.pos>l;)n=g(e,t,n,r);return i0;)v(0,0,b,O,-1);var x=b.length?O[0]+b[0].length:0;return new m(n.types[i],b.reverse(),O.reverse(),x)}function S(e,t,n,r,i,a,o,s,c){var l=[],u=[];if(c<=s)for(var f=i;fd)break}if(p==v+1){var b=n[v];if(b instanceof m&&b.type==t&&b.length>d<<1){for(var y=0;y1&&void 0!==arguments[1]?arguments[1]:e;return new c(e,t,this)}}]),e}();s.prototype.startSide=s.prototype.endSide=0,s.prototype.point=!1,s.prototype.mapMode=o.h.TrackDel;var c=function e(t,n,r){Object(i.a)(this,e),this.from=t,this.to=n,this.value=r};function l(e,t){return e.from-t.from||e.value.startSide-t.value.startSide}var u=500,f=1e9,d=function(){function e(t,n,r,a){Object(i.a)(this,e),this.from=t,this.to=n,this.value=r,this.maxPoint=a}return Object(a.a)(e,[{key:"findIndex",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t*f,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;if(e<=0)return r;for(var i=t<0?this.to:this.from,a=r,o=i.length;;){if(a==o)return a;var s=a+o>>1,c=i[s]-e||(t<0?this.value[s].startSide:this.value[s].endSide)-n;if(s==a)return c>=0?a:o;c>=0?o=s:a=s+1}}},{key:"between",value:function(e,t,n,r){for(var i=this.findIndex(t,-1),a=this.findIndex(n,1,void 0,i);i(h=n.mapPos(f,l.endSide))||d==h&&l.startSide>0&&l.endSide<=0)continue;(h-d||l.endSide-l.startSide)<0||(o<0&&(o=d),l.point&&(s=Math.max(s,h-d)),r.push(l),i.push(d-o),a.push(h-o))}return{mapped:r.length?new e(i,a,r,s):null,pos:o}}},{key:"length",get:function(){return this.to[this.to.length-1]}}]),e}(),h=function(){function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.empty,a=arguments.length>3?arguments[3]:void 0;Object(i.a)(this,e),this.chunkPos=t,this.chunk=n,this.nextLayer=r,this.maxPoint=a}return Object(a.a)(e,[{key:"chunkEnd",value:function(e){return this.chunkPos[e]+this.chunk[e].length}},{key:"update",value:function(t){var n=t.add,r=void 0===n?[]:n,i=t.sort,a=void 0!==i&&i,o=t.filter,s=t.filterFrom,u=void 0===s?0:s,f=t.filterTo,d=void 0===f?this.length:f;if(0==r.length&&!o)return this;if(a&&r.slice().sort(l),this==e.empty)return r.length?e.of(r):this;for(var h=new v(this,null,-1).goto(0),m=0,g=[],b=new p;h.value||m=0){var y=r[m++];b.addInner(y.from,y.to,y.value)||g.push(y)}else 1==h.rangeIndex&&h.chunkIndexthis.chunkEnd(h.chunkIndex)||dh.to||d=a&&t<=a+o.length&&!1===o.between(a,t-a,n-a,r))return}this.nextLayer.between(t,n,r)}}},{key:"iter",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return m.from([this]).goto(e)}},{key:"length",get:function(){var e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}},{key:"size",get:function(){if(this==e.empty)return 0;var t,n=this.nextLayer.size,i=Object(r.a)(this.chunk);try{for(i.s();!(t=i.n()).done;){n+=t.value.value.length}}catch(a){i.e(a)}finally{i.f()}return n}}],[{key:"iter",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return m.from(e).goto(t)}},{key:"compare",value:function(t,n,i,a){var o,s=null!==(o=a.minPointSize)&&void 0!==o?o:-1,c=t.filter((function(t){return t.maxPoint>=500||t!=e.empty&&n.indexOf(t)<0&&t.maxPoint>=s})),l=n.filter((function(n){return n.maxPoint>=500||n!=e.empty&&t.indexOf(n)<0&&n.maxPoint>=s})),f=function(e,t){var n,i=new Map,a=Object(r.a)(e);try{for(a.s();!(n=a.n()).done;)for(var o=n.value,s=0;sc?1:0)):c>o&&(r.span(o,c,a.active,s),s=a.openEnd(c)),a.to>n)break;o=a.to,a.next()}return s}},{key:"of",value:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=new p,a=Object(r.a)(e instanceof c?[e]:n?e.slice().sort(l):e);try{for(a.s();!(t=a.n()).done;){var o=t.value;i.add(o.from,o.to,o.value)}}catch(s){a.e(s)}finally{a.f()}return i.finish()}}]),e}();h.empty=new h([],[],null,-1),h.empty.nextLayer=h.empty;var p=function(){function e(){Object(i.a)(this,e),this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-f,this.lastTo=-f,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}return Object(a.a)(e,[{key:"finishChunk",value:function(e){this.chunks.push(new d(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}},{key:"add",value:function(t,n,r){this.addInner(t,n,r)||(this.nextLayer||(this.nextLayer=new e)).add(t,n,r)}},{key:"addInner",value:function(e,t,n){var r=e-this.lastTo||n.startSide-this.last.endSide;if(r<=0&&(e-this.lastFrom||n.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return!(r<0)&&(250==this.from.length&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(t-this.chunkStart),this.last=n,this.lastFrom=e,this.lastTo=t,this.value.push(n),n.point&&(this.maxPoint=Math.max(this.maxPoint,t-e)),!0)}},{key:"addChunk",value:function(e,t){if((e-this.lastTo||t.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,t.maxPoint),this.chunks.push(t),this.chunkPos.push(e);var n=t.value.length-1;return this.last=t.value[n],this.lastFrom=t.from[n]+e,this.lastTo=t.to[n]+e,!0}},{key:"finish",value:function(){return this.finishInner(h.empty)}},{key:"finishInner",value:function(e){if(this.from.length&&this.finishChunk(!1),0==this.chunks.length)return e;var t=new h(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}}]),e}();var v=function(){function e(t,n,r){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;Object(i.a)(this,e),this.layer=t,this.skip=n,this.minPoint=r,this.rank=a}return Object(a.a)(e,[{key:"goto",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-f;return this.chunkIndex=this.rangeIndex=0,this.gotoInner(e,t,!1),this}},{key:"gotoInner",value:function(e,t,n){for(;this.chunkIndex=this.minPoint)break}}},{key:"nextChunk",value:function(){this.chunkIndex++,this.rangeIndex=0,this.next()}},{key:"compare",value:function(e){return this.from-e.from||this.startSide-e.startSide||this.to-e.to||this.endSide-e.endSide}},{key:"startSide",get:function(){return this.value?this.value.startSide:0}},{key:"endSide",get:function(){return this.value?this.value.endSide:0}}]),e}(),m=function(){function e(t){Object(i.a)(this,e),this.heap=t}return Object(a.a)(e,[{key:"goto",value:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-f,i=Object(r.a)(this.heap);try{for(i.s();!(t=i.n()).done;){var a=t.value;a.goto(e,n)}}catch(s){i.e(s)}finally{i.f()}for(var o=this.heap.length>>1;o>=0;o--)g(this.heap,o);return this.next(),this}},{key:"forward",value:function(e,t){var n,i=Object(r.a)(this.heap);try{for(i.s();!(n=i.n()).done;){n.value.forward(e,t)}}catch(o){i.e(o)}finally{i.f()}for(var a=this.heap.length>>1;a>=0;a--)g(this.heap,a);(this.to-e||this.value.endSide-t)<0&&this.next()}},{key:"next",value:function(){if(0==this.heap.length)this.from=this.to=f,this.value=null,this.rank=-1;else{var e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),g(this.heap,0)}}},{key:"startSide",get:function(){return this.value?this.value.startSide:0}}],[{key:"from",value:function(t){for(var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1,i=[],a=0;a=r&&i.push(new v(o,n,r,a));return 1==i.length?i[0]:new e(i)}}]),e}();function g(e,t){for(var n=e[t];;){var r=1+(t<<1);if(r>=e.length)break;var i=e[r];if(r+1=0&&(i=e[r+1],r++),n.compare(i)<0)break;e[r]=n,e[t]=i,t=r}}var b=function(){function e(t,n,r){Object(i.a)(this,e),this.minPoint=r,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-f,this.endSide=0,this.openStart=-1,this.cursor=m.from(t,n,r)}return Object(a.a)(e,[{key:"goto",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-f;return this.cursor.goto(e,t),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=t,this.openStart=-1,this.next(),this}},{key:"forward",value:function(e,t){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-t)<0;)this.removeActive(this.minActive);this.cursor.forward(e,t)}},{key:"removeActive",value:function(e){x(this.active,e),x(this.activeTo,e),x(this.activeRank,e),this.minActive=w(this.active,this.activeTo)}},{key:"addActive",value:function(e){for(var t=0,n=this.cursor,r=n.value,i=n.to,a=n.rank;t-1&&(this.activeTo[r]-this.cursor.from||this.active[r].endSide-this.cursor.startSide)<0){if(this.activeTo[r]>e){this.to=this.activeTo[r],this.endSide=this.active[r].endSide;break}this.removeActive(r),t&&x(t,r)}else{if(!this.cursor.value){this.to=this.endSide=f;break}if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}var i=this.cursor.value;if(i.point){this.point=i,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=i.endSide,this.cursor.frome&&this.forward(this.to,this.endSide);break}this.addActive(t),this.cursor.next()}}if(t){for(var a=0;athis.pointRank);n++)(this.activeTo[n]>e||this.activeTo[n]==e&&this.active[n].endSide>this.point.endSide)&&t.push(this.active[n]);return t}},{key:"openEnd",value:function(e){for(var t=0;te;)t++;return t}}]),e}();function y(e,t,n,r,i,a){e.goto(t),n.goto(r);for(var o=r+i,s=r,c=r-t;;){var l=e.to+c-n.to||e.endSide-n.endSide,u=l<0?e.to+c:n.to,f=Math.min(u,o);if(e.point||n.point?e.point&&n.point&&(e.point==n.point||e.point.eq(n.point))||a.comparePoint(s,f,e.point,n.point):f>s&&!O(e.active,n.active)&&a.compareRange(s,f,e.active,n.active),u>o)break;s=u,l<=0&&e.next(),l>=0&&n.next()}}function O(e,t){if(e.length!=t.length)return!1;for(var n=0;n=t;r--)e[r+1]=e[r];e[t]=n}function w(e,t){for(var n=-1,r=f,i=0;i-1?n.panels[r]:null}var d=o.f.fromClass(function(){function e(t){Object(r.a)(this,e),this.specs=t.state.facet(u),this.panels=this.specs.map((function(e){return e(t)}));var n=t.state.facet(c);this.top=new p(t,!0,n.topContainer),this.bottom=new p(t,!1,n.bottomContainer),this.top.sync(this.panels.filter((function(e){return e.top}))),this.bottom.sync(this.panels.filter((function(e){return!e.top})));var i,o=Object(a.a)(this.panels);try{for(o.s();!(i=o.n()).done;){var s=i.value;s.dom.className+=" "+h(s),s.mount&&s.mount()}}catch(l){o.e(l)}finally{o.f()}}return Object(i.a)(e,[{key:"update",value:function(e){var t=e.state.facet(c);this.top.container!=t.topContainer&&(this.top.sync([]),this.top=new p(e.view,!0,t.topContainer)),this.bottom.container!=t.bottomContainer&&(this.bottom.sync([]),this.bottom=new p(e.view,!1,t.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();var n=e.state.facet(u);if(n!=this.specs){var r,i=[],o=[],s=[],l=[],f=Object(a.a)(n);try{for(f.s();!(r=f.n()).done;){var d=r.value,v=this.specs.indexOf(d),m=void 0;v<0?(m=d(e.view),l.push(m)):(m=this.panels[v]).update&&m.update(e),i.push(m),(m.top?o:s).push(m)}}catch(w){f.e(w)}finally{f.f()}this.specs=n,this.panels=i,this.top.sync(o),this.bottom.sync(s);for(var g=0,b=l;g0&&void 0!==arguments[0]?arguments[0]:["all"],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.duration,s=void 0===n?a.standard:n,c=t.easing,l=void 0===c?i.easeInOut:c,u=t.delay,f=void 0===u?0:u;Object(r.a)(t,["duration","easing","delay"]);return(Array.isArray(e)?e:[e]).map((function(e){return"".concat(e," ").concat("string"===typeof s?s:o(s)," ").concat(l," ").concat("string"===typeof f?f:o(f))})).join(",")},getAutoHeightDuration:function(e){if(!e)return 0;var t=e/36;return Math.round(10*(4+15*Math.pow(t,.25)+t/5))}}},function(e,t,n){e.exports=function(){"use strict";var e=1e3,t=6e4,n=36e5,r="millisecond",i="second",a="minute",o="hour",s="day",c="week",l="month",u="quarter",f="year",d="date",h="Invalid Date",p=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,v=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,m={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")},g=function(e,t,n){var r=String(e);return!r||r.length>=t?e:""+Array(t+1-r.length).join(n)+e},b={s:g,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),r=Math.floor(n/60),i=n%60;return(t<=0?"+":"-")+g(r,2,"0")+":"+g(i,2,"0")},m:function e(t,n){if(t.date()0&&void 0!==arguments[0]?arguments[0]:Date.now(),t=this,n=0;t._charts.forEach((function(r,i){if(r.running&&r.items.length){for(var a,o=r.items,s=o.length-1,c=!1;s>=0;--s)(a=o[s])._active?(a._total>r.duration&&(r.duration=a._total),a.tick(e),c=!0):(o[s]=o[o.length-1],o.pop());c&&(i.draw(),t._notify(i,r,e,"progress")),o.length||(r.running=!1,t._notify(i,r,e,"complete"),r.initial=!1),n+=o.length}})),t._lastDate=e,0===n&&(t._running=!1)}},{key:"_getAnims",value:function(e){var t=this._charts,n=t.get(e);return n||(n={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},t.set(e,n)),n}},{key:"listen",value:function(e,t,n){this._getAnims(e).listeners[t].push(n)}},{key:"add",value:function(e,t){var n;t&&t.length&&(n=this._getAnims(e).items).push.apply(n,Object(d.a)(t))}},{key:"has",value:function(e){return this._getAnims(e).items.length>0}},{key:"start",value:function(e){var t=this._charts.get(e);t&&(t.running=!0,t.start=Date.now(),t.duration=t.items.reduce((function(e,t){return Math.max(e,t._duration)}),0),this._refresh())}},{key:"running",value:function(e){if(!this._running)return!1;var t=this._charts.get(e);return!!(t&&t.running&&t.items.length)}},{key:"stop",value:function(e){var t=this._charts.get(e);if(t&&t.items.length){for(var n=t.items,r=n.length-1;r>=0;--r)n[r].cancel();t.items=[],this._notify(e,t,Date.now(),"complete")}}},{key:"remove",value:function(e){return this._charts.delete(e)}}]),e}()),g="transparent",b={boolean:function(e,t,n){return n>.5?t:e},color:function(e,t,n){var r=Object(v.wb)(e||g),i=r.valid&&Object(v.wb)(t||g);return i&&i.valid?i.mix(r,n).hexString():t},number:function(e,t,n){return e+(t-e)*n}},y=function(){function e(t,n,r,i){Object(h.a)(this,e);var a=n[r];i=Object(v.C)([t.to,i,a,t.from]);var o=Object(v.C)([t.from,a,i]);this._active=!0,this._fn=t.fn||b[t.type||typeof o],this._easing=v.yb[t.easing]||v.yb.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=n,this._prop=r,this._from=o,this._to=i,this._promises=void 0}return Object(p.a)(e,[{key:"active",value:function(){return this._active}},{key:"update",value:function(e,t,n){var r=this;if(r._active){r._notify(!1);var i=r._target[r._prop],a=n-r._start,o=r._duration-a;r._start=n,r._duration=Math.floor(Math.max(o,e.duration)),r._total+=a,r._loop=!!e.loop,r._to=Object(v.C)([e.to,t,i,e.from]),r._from=Object(v.C)([e.from,i,t])}}},{key:"cancel",value:function(){var e=this;e._active&&(e.tick(Date.now()),e._active=!1,e._notify(!1))}},{key:"tick",value:function(e){var t,n=this,r=e-n._start,i=n._duration,a=n._prop,o=n._from,s=n._loop,c=n._to;if(n._active=o!==c&&(s||r1?2-t:t,t=n._easing(Math.min(1,Math.max(0,t))),n._target[a]=n._fn(o,c,t))}},{key:"wait",value:function(){var e=this._promises||(this._promises=[]);return new Promise((function(t,n){e.push({res:t,rej:n})}))}},{key:"_notify",value:function(e){for(var t=e?"res":"rej",n=this._promises||[],r=0;r=0;--n){var c=o[n];if("$"!==c.charAt(0))if("options"!==c){var l=t[c],u=a[c],f=r.get(c);if(u){if(f&&u.active()){u.update(f,l,s);continue}u.cancel()}f&&f.duration?(a[c]=u=new y(f,e,c,l),i.push(u)):e[c]=l}else i.push.apply(i,Object(d.a)(this._animateOptions(e,t)))}return i}},{key:"update",value:function(e,t){if(0!==this._properties.size){var n=this._createAnimations(e,t);return n.length?(m.add(this._chart,n),!0):void 0}Object.assign(e,t)}}]),e}();function k(e,t){var n=e&&e.options||{},r=n.reverse,i=void 0===n.min?t:0,a=void 0===n.max?t:0;return{start:r?a:i,end:r?i:a}}function w(e,t){var n,r,i=[],a=e._getSortedDatasetMetas(t);for(n=0,r=a.length;n0||!n&&o<0)return a.index}}catch(s){i.e(s)}finally{i.f()}return null}function M(e,t){for(var n,r=e.chart,i=e._cachedMeta,a=r._stacks||(r._stacks={}),o=i.iScale,s=i.vScale,c=i.index,l=o.axis,u=s.axis,f=function(e,t,n){return"".concat(e.id,".").concat(t.id,".").concat(n.stack||n.type)}(o,s,i),d=t.length,h=0;h0&&o._parsed[e-1];if(!1===a._parsing)o._parsed=s,o._sorted=!0,i=s;else{i=Object(v.vb)(s[e])?a.parseArrayData(o,s,e,t):Object(v.Cb)(s[e])?a.parseObjectData(o,s,e,t):a.parsePrimitiveData(o,s,e,t);for(n=0;na||g=0;--n)if(!b()){o.updateRangeFromParsed(h,e,i,d);break}return h}},{key:"getAllParsedValues",value:function(e){var t,n,r,i=this._cachedMeta._parsed,a=[];for(t=0,n=i.length;t=0&&e1&&void 0!==arguments[1]?arguments[1]:"default",n=arguments.length>2?arguments[2]:void 0,r=this,i="active"===t,a=r._cachedDataOpts,o=e+"-"+t,s=a[o],c=r.enableOptionSharing&&Object(v.Bb)(n);if(s)return D(s,c);var l=r.chart.config,u=l.datasetElementScopeKeys(r._type,e),f=i?["".concat(e,"Hover"),"hover",e,""]:[e,""],d=l.getOptionScopes(r.getDataset(),u),h=Object.keys(v.xb.elements[e]),p=function(){return r.getContext(n,i)},m=l.resolveNamedOptions(d,h,p,f);return m.$shared&&(m.$shared=c,a[o]=Object.freeze(D(m,c))),m}},{key:"_resolveAnimations",value:function(e,t,n){var r,i=this,a=i.chart,o=i._cachedDataOpts,s="animation-".concat(t),c=o[s];if(c)return c;if(!1!==a.options.animation){var l=i.chart.config,u=l.datasetAnimationScopeKeys(i._type,t),f=l.getOptionScopes(i.getDataset(),u);r=l.createResolver(f,i.getContext(e,n,t))}var d=new x(a,r&&r.animations);return r&&r._cacheable&&(o[s]=Object.freeze(d)),d}},{key:"getSharedOptions",value:function(e){if(e.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},e))}},{key:"includeOptions",value:function(e,t){return!t||_(e)||this.chart._animationsDisabled}},{key:"updateElement",value:function(e,t,n,r){_(r)?Object.assign(e,n):this._resolveAnimations(t,r).update(e,n)}},{key:"updateSharedOptions",value:function(e,t,n){e&&!_(t)&&this._resolveAnimations(void 0,t).update(e,n)}},{key:"_setStyle",value:function(e,t,n,r){e.active=r;var i=this.getStyle(t,r);this._resolveAnimations(t,n,r).update(e,{options:!r&&this.getSharedOptions(i)||i})}},{key:"removeHoverStyle",value:function(e,t,n){this._setStyle(e,n,"active",!1)}},{key:"setHoverStyle",value:function(e,t,n){this._setStyle(e,n,"active",!0)}},{key:"_removeDatasetHoverStyle",value:function(){var e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!1)}},{key:"_setDatasetHoverStyle",value:function(){var e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!0)}},{key:"_resyncElements",value:function(e){var t,n=this,r=n._data,i=n._cachedMeta.data,a=Object(f.a)(n._syncList);try{for(a.s();!(t=a.n()).done;){var o=Object(l.a)(t.value,3),s=o[0],c=o[1],u=o[2];n[s](c,u)}}catch(v){a.e(v)}finally{a.f()}n._syncList=[];var d=i.length,h=r.length,p=Math.min(h,d);p&&n.parse(0,p),h>d?n._insertElements(d,h-d,e):h2&&void 0!==arguments[2])||arguments[2],i=this,a=i._cachedMeta,o=a.data,s=e+t,c=function(e){for(e.length+=t,n=e.length-1;n>=s;n--)e[n]=e[n-t]};for(c(o),n=e;nMath.abs(s)&&(c=s,l=o),t[n.axis]=l,t._custom={barStart:c,barEnd:l,start:i,end:a,min:o,max:s}}(e,t,n,r):t[n.axis]=n.parse(e,r),t}function N(e,t,n,r){var i,a,o,s,c=e.iScale,l=e.vScale,u=c.getLabels(),f=c===l,d=[];for(i=n,a=n+r;ie.x,n="left",r="right"):(t=e.base=n?1:-1)}(n,a,u)*l,p===u&&(y-=n/2),t=y+n),y===a.getPixelForValue(u)){var O=Object(v.Mb)(n)*a.getLineWidthForValue(u)/2;y+=O,n-=O}return{size:n,base:y,head:t,center:t+n/2}}},{key:"_calculateBarIndexPixels",value:function(e,t){var n,r,i=this,a=t.scale,o=i.options,s=o.skipNull,c=Object(v.Pb)(o.maxBarThickness,1/0);if(t.grouped){var l=s?i._getStackCount(e):t.stackCount,u="flex"===o.barThickness?function(e,t,n,r){var i=t.pixels,a=i[e],o=e>0?i[e-1]:null,s=e=0;--i)r=Math.max(r,t[i].size()/2,n[i]._custom);return r>0&&r}},{key:"getLabelAndValue",value:function(e){var t=this._cachedMeta,n=t.xScale,r=t.yScale,i=this.getParsed(e),a=n.getLabelForValue(i.x),o=r.getLabelForValue(i.y),s=i._custom;return{label:t.label,value:"("+a+", "+o+(s?", "+s:"")+")"}}},{key:"update",value:function(e){var t=this._cachedMeta.data;this.updateElements(t,0,t.length,e)}},{key:"updateElements",value:function(e,t,n,r){for(var i=this,a="reset"===r,o=i._cachedMeta,s=o.iScale,c=o.vScale,l=i.resolveDataElementOptions(t,r),u=i.getSharedOptions(l),f=i.includeOptions(r,u),d=s.axis,h=c.axis,p=t;p0&&!isNaN(e)?v.u*(Math.abs(e)/t):0}},{key:"getLabelAndValue",value:function(e){var t=this._cachedMeta,n=this.chart,r=n.data.labels||[],i=Object(v.Hb)(t._parsed[e],n.options.locale);return{label:r[e]||"",value:i}}},{key:"getMaxBorderWidth",value:function(e){var t,n,r,i,a,o=0,s=this.chart;if(!e)for(t=0,n=s.data.datasets.length;t0&&i.getParsed(t-1),O=t;O0&&k[h]-y[h]>g,w.parsed=k,d&&(w.options=f||i.resolveDataElementOptions(O,x.active?"active":r)),b||i.updateElement(x,O,w,r),y=k}i.updateSharedOptions(f,r,u)}},{key:"getMaxOverflow",value:function(){var e=this,t=e._cachedMeta,n=t.dataset,r=n.options&&n.options.borderWidth||0,i=t.data||[];if(!i.length)return r;var a=i[0].size(e.resolveDataElementOptions(0)),o=i[i.length-1].size(e.resolveDataElementOptions(i.length-1));return Math.max(r,a,o)/2}},{key:"draw",value:function(){var e=this._cachedMeta;e.dataset.updateControlPoints(this.chart.chartArea,e.iScale.axis),Object(a.a)(Object(o.a)(n.prototype),"draw",this).call(this)}}]),n}(A);H.id="line",H.defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1},H.overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};var V=function(e){Object(s.a)(n,e);var t=Object(c.a)(n);function n(e,r){var i;return Object(h.a)(this,n),(i=t.call(this,e,r)).innerRadius=void 0,i.outerRadius=void 0,i}return Object(p.a)(n,[{key:"getLabelAndValue",value:function(e){var t=this._cachedMeta,n=this.chart,r=n.data.labels||[],i=Object(v.Hb)(t._parsed[e].r,n.options.locale);return{label:r[e]||"",value:i}}},{key:"update",value:function(e){var t=this._cachedMeta.data;this._updateRadius(),this.updateElements(t,0,t.length,e)}},{key:"_updateRadius",value:function(){var e=this,t=e.chart,n=t.chartArea,r=t.options,i=Math.min(n.right-n.left,n.bottom-n.top),a=Math.max(i/2,0),o=(a-Math.max(r.cutoutPercentage?a/100*r.cutoutPercentage:1,0))/t.getVisibleDatasetCount();e.outerRadius=a-o*e.index,e.innerRadius=e.outerRadius-o}},{key:"updateElements",value:function(e,t,n,r){var i,a=this,o="reset"===r,s=a.chart,c=a.getDataset(),l=s.options.animation,u=a._cachedMeta.rScale,f=u.xCenter,d=u.yCenter,h=u.getIndexAngle(0)-.5*v.q,p=h,m=360/a.countVisibleElements();for(i=0;i0){var s=o[0].datasetIndex,c=e.getDatasetMeta(s).data;o=[];for(var l=0;l1){var o=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(o<1e-4||o>1e15)&&(r="scientific"),a=function(e,t){var n=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;Math.abs(n)>=1&&e!==Math.floor(e)&&(n=e-Math.floor(e));return n}(e,n)}var s=Object(v.k)(Math.abs(a)),c=Math.max(Math.min(-1*Math.floor(s),20),0),l={notation:r,minimumFractionDigits:c,maximumFractionDigits:c};return Object.assign(l,this.options.ticks.format),Object(v.Hb)(e,i,l)},logarithmic:function(e,t,n){if(0===e)return"0";var r=e/Math.pow(10,Math.floor(Object(v.k)(e)));return 1===r||2===r||5===r?ze.numeric.call(this,e,t,n):""}};var $e={formatters:ze};function Fe(e,t){var n=e.options.ticks,r=n.maxTicksLimit||function(e){var t=e.options.offset,n=e._tickSize(),r=e._length/n+(t?0:1),i=e._maxLength/n;return Math.floor(Math.min(r,i))}(e),i=n.major.enabled?function(e){var t,n,r=[];for(t=0,n=e.length;tr)return function(e,t,n,r){var i,a=0,o=n[0];for(r=Math.ceil(r),i=0;ii)return c}return Math.max(i,1)}(i,t,r);if(a>0){var u,f,d=a>1?Math.round((s-o)/(a-1)):null;for(Be(t,c,l,Object(v.Db)(d)?0:o-d,o),u=0,f=a-1;us+c)))return l}function Ve(e){return e.drawTicks?e.tickLength:0}function Ue(e,t){if(!e.display)return 0;var n=Object(v.y)(e.font,t),r=Object(v.b)(e.padding);return(Object(v.vb)(e.text)?e.text.length:1)*n.lineHeight+r.height}function qe(e,t,n){var r=Object(v.z)(e);return(n&&"right"!==t||!n&&"right"===t)&&(r=function(e){return"left"===e?"right":"right"===e?"left":e}(r)),r}var Ye=function(e){Object(s.a)(n,e);var t=Object(c.a)(n);function n(e){var r;return Object(h.a)(this,n),(r=t.call(this)).id=e.id,r.type=e.type,r.options=void 0,r.ctx=e.ctx,r.chart=e.chart,r.top=void 0,r.bottom=void 0,r.left=void 0,r.right=void 0,r.width=void 0,r.height=void 0,r._margins={left:0,right:0,top:0,bottom:0},r.maxWidth=void 0,r.maxHeight=void 0,r.paddingTop=void 0,r.paddingBottom=void 0,r.paddingLeft=void 0,r.paddingRight=void 0,r.axis=void 0,r.labelRotation=void 0,r.min=void 0,r.max=void 0,r._range=void 0,r.ticks=[],r._gridLineItems=null,r._labelItems=null,r._labelSizes=null,r._length=0,r._maxLength=0,r._longestTextCache={},r._startPixel=void 0,r._endPixel=void 0,r._reversePixels=!1,r._userMax=void 0,r._userMin=void 0,r._suggestedMax=void 0,r._suggestedMin=void 0,r._ticksLength=0,r._borderValue=0,r._cache={},r._dataLimitsCached=!1,r.$context=void 0,r}return Object(p.a)(n,[{key:"init",value:function(e){var t=this;t.options=e.setContext(t.getContext()),t.axis=e.axis,t._userMin=t.parse(e.min),t._userMax=t.parse(e.max),t._suggestedMin=t.parse(e.suggestedMin),t._suggestedMax=t.parse(e.suggestedMax)}},{key:"parse",value:function(e,t){return e}},{key:"getUserBounds",value:function(){var e=this._userMin,t=this._userMax,n=this._suggestedMin,r=this._suggestedMax;return e=Object(v.m)(e,Number.POSITIVE_INFINITY),t=Object(v.m)(t,Number.NEGATIVE_INFINITY),n=Object(v.m)(n,Number.POSITIVE_INFINITY),r=Object(v.m)(r,Number.NEGATIVE_INFINITY),{min:Object(v.m)(e,n),max:Object(v.m)(t,r),minDefined:Object(v.Ab)(e),maxDefined:Object(v.Ab)(t)}}},{key:"getMinMax",value:function(e){var t,n=this,r=n.getUserBounds(),i=r.min,a=r.max,o=r.minDefined,s=r.maxDefined;if(o&&s)return{min:i,max:a};for(var c=n.getMatchingVisibleMetas(),l=0,u=c.length;l=c||o<=1||!r.isHorizontal())r.labelRotation=s;else{var u=r._getLabelSizes(),f=u.widest.width,d=u.highest.height,h=Object(v.Kb)(r.chart.width-f,0,r.maxWidth);f+6>(e=i.offset?r.maxWidth/o:h/(o-1))&&(e=h/(o-(i.offset?.5:1)),t=r.maxHeight-Ve(i.grid)-a.padding-Ue(i.title,r.chart.options.font),n=Math.sqrt(f*f+d*d),l=Object(v.p)(Math.min(Math.asin(Object(v.Kb)((u.highest.height+6)/e,-1,1)),Math.asin(Object(v.Kb)(t/n,-1,1))-Math.asin(Object(v.Kb)(d/n,-1,1)))),l=Math.max(s,Math.min(c,l))),r.labelRotation=l}}},{key:"afterCalculateLabelRotation",value:function(){Object(v.n)(this.options.afterCalculateLabelRotation,[this])}},{key:"beforeFit",value:function(){Object(v.n)(this.options.beforeFit,[this])}},{key:"fit",value:function(){var e=this,t={width:0,height:0},n=e.chart,r=e.options,i=r.ticks,a=r.title,o=r.grid,s=e._isVisible(),c=e.isHorizontal();if(s){var l=Ue(a,n.options.font);if(c?(t.width=e.maxWidth,t.height=Ve(o)+l):(t.height=e.maxHeight,t.width=Ve(o)+l),i.display&&e.ticks.length){var u=e._getLabelSizes(),f=u.first,d=u.last,h=u.widest,p=u.highest,m=2*i.padding,g=Object(v.Nb)(e.labelRotation),b=Math.cos(g),y=Math.sin(g);if(c){var O=i.mirror?0:y*h.width+b*p.height;t.height=Math.min(e.maxHeight,t.height+O+m)}else{var x=i.mirror?0:b*h.width+y*p.height;t.width=Math.min(e.maxWidth,t.width+x+m)}e._calculatePadding(f,d,y,b)}}e._handleMargins(),c?(e.width=e._length=n.width-e._margins.left-e._margins.right,e.height=t.height):(e.width=t.width,e.height=e._length=n.height-e._margins.top-e._margins.bottom)}},{key:"_calculatePadding",value:function(e,t,n,r){var i=this,a=i.options,o=a.ticks,s=o.align,c=o.padding,l=a.position,u=0!==i.labelRotation,f="top"!==l&&"x"===i.axis;if(i.isHorizontal()){var d=i.getPixelForTick(0)-i.left,h=i.right-i.getPixelForTick(i.ticks.length-1),p=0,v=0;u?f?(p=r*e.width,v=n*t.height):(p=n*e.height,v=r*t.width):"start"===s?v=t.width:"end"===s?p=e.width:(p=e.width/2,v=t.width/2),i.paddingLeft=Math.max((p-d+c)*i.width/(i.width-d),0),i.paddingRight=Math.max((v-h+c)*i.width/(i.width-h),0)}else{var m=t.height/2,g=e.height/2;"start"===s?(m=0,g=e.height):"end"===s&&(m=t.height,g=0),i.paddingTop=m+c,i.paddingBottom=g+c}}},{key:"_handleMargins",value:function(){var e=this;e._margins&&(e._margins.left=Math.max(e.paddingLeft,e._margins.left),e._margins.top=Math.max(e.paddingTop,e._margins.top),e._margins.right=Math.max(e.paddingRight,e._margins.right),e._margins.bottom=Math.max(e.paddingBottom,e._margins.bottom))}},{key:"afterFit",value:function(){Object(v.n)(this.options.afterFit,[this])}},{key:"isHorizontal",value:function(){var e=this.options,t=e.axis,n=e.position;return"top"===n||"bottom"===n||"x"===t}},{key:"isFullSize",value:function(){return this.options.fullSize}},{key:"_convertTicksToLabels",value:function(e){var t,n,r=this;for(r.beforeTickToLabelConversion(),r.generateTickLabels(e),t=0,n=e.length;tt){for(n=0;nt.length-1?null:this.getPixelForValue(t[e].value)}},{key:"getPixelForDecimal",value:function(e){var t=this;t._reversePixels&&(e=1-e);var n=t._startPixel+e*t._length;return Object(v.s)(t._alignToPixels?Object(v.t)(t.chart,n,0):n)}},{key:"getDecimalForPixel",value:function(e){var t=(e-this._startPixel)/this._length;return this._reversePixels?1-t:t}},{key:"getBasePixel",value:function(){return this.getPixelForValue(this.getBaseValue())}},{key:"getBaseValue",value:function(){var e=this.min,t=this.max;return e<0&&t<0?t:e>0&&t>0?e:0}},{key:"getContext",value:function(e){var t,n,r=this,i=r.ticks||[];if(e>=0&&es*i?s/r:c/i:c*i0}},{key:"_computeGridLineItems",value:function(e){var t,n,r,i,a,o,s,c,l,u,f,d,h=this,p=h.axis,m=h.chart,g=h.options,b=g.grid,y=g.position,O=b.offset,x=h.isHorizontal(),k=h.ticks.length+(O?1:0),w=Ve(b),j=[],S=b.setContext(h.getContext()),C=S.drawBorder?S.borderWidth:0,E=C/2,M=function(e){return Object(v.t)(m,e,C)};if("top"===y)t=M(h.bottom),o=h.bottom-w,c=t-E,u=M(e.top)+E,d=e.bottom;else if("bottom"===y)t=M(h.top),u=e.top,d=M(e.bottom)-E,o=t+E,c=h.top+w;else if("left"===y)t=M(h.right),a=h.right-w,s=t-E,l=M(e.left)+E,f=e.right;else if("right"===y)t=M(h.left),l=e.left,f=M(e.right)-E,a=t+E,s=h.left+w;else if("x"===p){if("center"===y)t=M((e.top+e.bottom)/2+.5);else if(Object(v.Cb)(y)){var P=Object.keys(y)[0],T=y[P];t=M(h.chart.scales[P].getPixelForValue(T))}u=e.top,d=e.bottom,c=(o=t+E)+w}else if("y"===p){if("center"===y)t=M((e.left+e.right)/2);else if(Object(v.Cb)(y)){var _=Object.keys(y)[0],D=y[_];t=M(h.chart.scales[_].getPixelForValue(D))}s=(a=t-E)-w,l=e.left,f=e.right}var A=Object(v.Pb)(g.ticks.maxTicksLimit,k),R=Math.max(1,Math.ceil(k/A));for(n=0;n=0?n.setContext(t.getContext(r)).lineWidth:0}},{key:"drawGrid",value:function(e){var t,n,r=this,i=r.options.grid,a=r.ctx,o=r._gridLineItems||(r._gridLineItems=r._computeGridLineItems(e)),s=function(e,t,n){n.width&&n.color&&(a.save(),a.lineWidth=n.width,a.strokeStyle=n.color,a.setLineDash(n.borderDash||[]),a.lineDashOffset=n.borderDashOffset,a.beginPath(),a.moveTo(e.x,e.y),a.lineTo(t.x,t.y),a.stroke(),a.restore())};if(i.display)for(t=0,n=o.length;t3&&void 0!==arguments[3]?arguments[3]:[""],i={$shared:!0},a=lt(this._resolverCache,e,r),o=a.resolver,s=a.subPrefixes,c=o;if(ut(o,t)){i.$shared=!1,n=Object(v.G)(n)?n():n;var l=this.createResolver(e,n,s);c=Object(v.H)(o,n,l)}var u,d=Object(f.a)(t);try{for(d.s();!(u=d.n()).done;){var h=u.value;i[h]=c[h]}}catch(p){d.e(p)}finally{d.f()}return i}},{key:"createResolver",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[""],r=arguments.length>3?arguments[3]:void 0,i=lt(this._resolverCache,e,n),a=i.resolver;return Object(v.Cb)(t)?Object(v.H)(a,t,void 0,r):a}},{key:"platform",get:function(){return this._config.platform}},{key:"type",get:function(){return this._config.type},set:function(e){this._config.type=e}},{key:"data",get:function(){return this._config.data},set:function(e){this._config.data=rt(e)}},{key:"options",get:function(){return this._config.options},set:function(e){this._config.options=e}},{key:"plugins",get:function(){return this._config.plugins}}]),e}();function lt(e,t,n){var r=e.get(t);r||(r=new Map,e.set(t,r));var i=n.join(),a=r.get(i);a||(a={resolver:Object(v.I)(t,n),subPrefixes:n.filter((function(e){return!e.toLowerCase().includes("hover")}))},r.set(i,a));return a}function ut(e,t){var n,r=Object(v.J)(e),i=r.isScriptable,a=r.isIndexable,o=Object(f.a)(t);try{for(o.s();!(n=o.n()).done;){var s=n.value;if(i(s)&&Object(v.G)(e[s])||a(s)&&Object(v.vb)(e[s]))return!0}}catch(c){o.e(c)}finally{o.f()}return!1}var ft=["top","bottom","left","right","chartArea"];function dt(e,t){return"top"===e||"bottom"===e||-1===ft.indexOf(e)&&"x"===t}function ht(e,t){return function(n,r){return n[e]===r[e]?n[t]-r[t]:n[e]-r[e]}}function pt(e){var t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),Object(v.n)(n&&n.onComplete,[e],t)}function vt(e){var t=e.chart,n=t.options.animation;Object(v.n)(n&&n.onProgress,[e],t)}function mt(e){return Object(v.j)()&&"string"===typeof e?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}var gt={},bt=function(e){var t=mt(e);return Object.values(gt).filter((function(e){return e.canvas===t})).pop()},yt=function(){function e(t,n){var r=this;Object(h.a)(this,e);var i=this,a=this.config=new ct(n),o=mt(t),s=bt(o);if(s)throw new Error("Canvas is already in use. Chart with ID '"+s.id+"' must be destroyed before the canvas can be reused.");var c=a.createResolver(a.chartOptionScopes(),i.getContext());this.platform=new(a.platform||function(e){return!Object(v.j)()||"undefined"!==typeof OffscreenCanvas&&e instanceof OffscreenCanvas?we:Ne}(o));var l=i.platform.acquireContext(o,c.aspectRatio),u=l&&l.canvas,f=u&&u.height,d=u&&u.width;this.id=Object(v.L)(),this.ctx=l,this.canvas=u,this.width=d,this.height=f,this._options=c,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new Ge,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=Object(v.M)((function(){return r.update("resize")}),c.resizeDelay||0),gt[i.id]=i,l&&u?(m.listen(i,"complete",pt),m.listen(i,"progress",vt),i._initialize(),i.attached&&i.update()):console.error("Failed to create chart: can't acquire context from the given item")}return Object(p.a)(e,[{key:"_initialize",value:function(){var e=this;return e.notifyPlugins("beforeInit"),e.options.responsive?e.resize():Object(v.V)(e,e.options.devicePixelRatio),e.bindEvents(),e.notifyPlugins("afterInit"),e}},{key:"clear",value:function(){return Object(v.W)(this.canvas,this.ctx),this}},{key:"stop",value:function(){return m.stop(this),this}},{key:"resize",value:function(e,t){m.running(this)?this._resizeBeforeDraw={width:e,height:t}:this._resize(e,t)}},{key:"_resize",value:function(e,t){var n=this,r=n.options,i=n.canvas,a=r.maintainAspectRatio&&n.aspectRatio,o=n.platform.getMaximumSize(i,e,t,a),s=r.devicePixelRatio||n.platform.getDevicePixelRatio();n.width=o.width,n.height=o.height,n._aspectRatio=n.aspectRatio,Object(v.V)(n,s,!0)&&(n.notifyPlugins("resize",{size:o}),Object(v.n)(r.onResize,[n,o],n),n.attached&&n._doResize()&&n.render())}},{key:"ensureScalesHaveIDs",value:function(){var e=this.options.scales||{};Object(v.c)(e,(function(e,t){e.id=t}))}},{key:"buildOrUpdateScales",value:function(){var e=this,t=e.options,n=t.scales,r=e.scales,i=Object.keys(r).reduce((function(e,t){return e[t]=!1,e}),{}),a=[];n&&(a=a.concat(Object.keys(n).map((function(e){var t=n[e],r=tt(e,t),i="r"===r,a="x"===r;return{options:t,dposition:i?"chartArea":a?"bottom":"left",dtype:i?"radialLinear":a?"category":"linear"}})))),Object(v.c)(a,(function(n){var a=n.options,o=a.id,s=tt(o,a),c=Object(v.Pb)(a.type,n.dtype);void 0!==a.position&&dt(a.position,s)===dt(n.dposition)||(a.position=n.dposition),i[o]=!0;var l=null;o in r&&r[o].type===c?l=r[o]:(l=new(Ke.getScale(c))({id:o,type:c,ctx:e.ctx,chart:e}),r[l.id]=l);l.init(a,t)})),Object(v.c)(i,(function(e,t){e||delete r[t]})),Object(v.c)(r,(function(t){Oe(e,t,t.options),be(e,t)}))}},{key:"_updateMetasets",value:function(){var e=this,t=e._metasets,n=e.data.datasets.length,r=t.length;if(t.sort((function(e,t){return e.index-t.index})),r>n){for(var i=n;in.length&&delete e._stacks,t.forEach((function(t,r){0===n.filter((function(e){return e===t._dataset})).length&&e._destroyDatasetMeta(r)}))}},{key:"buildOrUpdateControllers",value:function(){var e,t,n=this,r=[],i=n.data.datasets;for(n._removeUnreferencedMetasets(),e=0,t=i.length;e=0;--n)e._drawDataset(t[n]);e.notifyPlugins("afterDatasetsDraw")}}},{key:"_drawDataset",value:function(e){var t=this,n=t.ctx,r=e._clip,i=!r.disabled,a=t.chartArea,o={meta:e,index:e.index,cancelable:!0};!1!==t.notifyPlugins("beforeDatasetDraw",o)&&(i&&Object(v.v)(n,{left:!1===r.left?0:a.left-r.left,right:!1===r.right?t.width:a.right+r.right,top:!1===r.top?0:a.top-r.top,bottom:!1===r.bottom?t.height:a.bottom+r.bottom}),e.controller.draw(),i&&Object(v.x)(n),o.cancelable=!1,t.notifyPlugins("afterDatasetDraw",o))}},{key:"getElementsAtEventForMode",value:function(e,t,n,r){var i=ae.modes[t];return"function"===typeof i?i(this,e,n,r):[]}},{key:"getDatasetMeta",value:function(e){var t=this.data.datasets[e],n=this._metasets,r=n.filter((function(e){return e&&e._dataset===t})).pop();return r||(r={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:t&&t.order||0,index:e,_dataset:t,_parsed:[],_sorted:!1},n.push(r)),r}},{key:"getContext",value:function(){return this.$context||(this.$context={chart:this,type:"chart"})}},{key:"getVisibleDatasetCount",value:function(){return this.getSortedVisibleDatasetMetas().length}},{key:"isDatasetVisible",value:function(e){var t=this.data.datasets[e];if(!t)return!1;var n=this.getDatasetMeta(e);return"boolean"===typeof n.hidden?!n.hidden:!t.hidden}},{key:"setDatasetVisibility",value:function(e,t){this.getDatasetMeta(e).hidden=!t}},{key:"toggleDataVisibility",value:function(e){this._hiddenIndices[e]=!this._hiddenIndices[e]}},{key:"getDataVisibility",value:function(e){return!this._hiddenIndices[e]}},{key:"_updateVisibility",value:function(e,t,n){var r=this,i=n?"show":"hide",a=r.getDatasetMeta(e),o=a.controller._resolveAnimations(void 0,i);Object(v.Bb)(t)?(a.data[t].hidden=!n,r.update()):(r.setDatasetVisibility(e,n),o.update(a,{visible:n}),r.update((function(t){return t.datasetIndex===e?i:void 0})))}},{key:"hide",value:function(e,t){this._updateVisibility(e,t,!1)}},{key:"show",value:function(e,t){this._updateVisibility(e,t,!0)}},{key:"_destroyDatasetMeta",value:function(e){var t=this,n=t._metasets&&t._metasets[e];n&&n.controller&&(n.controller._destroy(),delete t._metasets[e])}},{key:"destroy",value:function(){var e,t,n=this,r=n.canvas,i=n.ctx;for(n.stop(),m.remove(n),e=0,t=n.data.datasets.length;ei?(l=i/c,e.arc(a,o,c,n+l,r-l,!0)):e.arc(a,o,i,n+v.i,r-v.i),e.closePath(),e.clip()}function wt(e,t,n,r){var i,a=(i=e.options.borderRadius,Object(v.ab)(i,["outerStart","outerEnd","innerStart","innerEnd"])),o=(n-t)/2,s=Math.min(o,r*t/2),c=function(e){var t=(n-Math.min(o,e))*r/2;return Object(v.Kb)(e,0,Math.min(o,t))};return{outerStart:c(a.outerStart),outerEnd:c(a.outerEnd),innerStart:Object(v.Kb)(a.innerStart,0,s),innerEnd:Object(v.Kb)(a.innerEnd,0,s)}}function jt(e,t,n,r){return{x:n+e*Math.cos(t),y:r+e*Math.sin(t)}}function St(e,t,n,r,i){var a=t.x,o=t.y,s=t.startAngle,c=t.pixelMargin,l=t.innerRadius,u=Math.max(t.outerRadius+r+n-c,0),f=l>0?l+r+n+c:0,d=0,h=i-s;if(r){var p=((l>0?l-r:0)+(u>0?u-r:0))/2;d=(h-(0!==p?h*p/(p+r):h))/2}var m=(h-Math.max(.001,h*u-n/v.q)/u)/2,g=s+m+d,b=i-m-d,y=wt(t,f,u,b-g),O=y.outerStart,x=y.outerEnd,k=y.innerStart,w=y.innerEnd,j=u-O,S=u-x,C=g+O/j,E=b-x/S,M=f+k,P=f+w,T=g+k/M,_=b-w/P;if(e.beginPath(),e.arc(a,o,u,C,E),x>0){var D=jt(S,E,a,o);e.arc(D.x,D.y,x,E,b+v.i)}var A=jt(P,b,a,o);if(e.lineTo(A.x,A.y),w>0){var R=jt(P,_,a,o);e.arc(R.x,R.y,w,b+v.i,_+Math.PI)}if(e.arc(a,o,f,b-w/f,g+k/f,!0),k>0){var L=jt(M,T,a,o);e.arc(L.x,L.y,k,T+Math.PI,g-v.i)}var N=jt(j,g,a,o);if(e.lineTo(N.x,N.y),O>0){var I=jt(j,C,a,o);e.arc(I.x,I.y,O,g-v.i,C)}e.closePath()}function Ct(e,t,n,r,i){var a=t.options,o="inner"===a.borderAlign;a.borderWidth&&(o?(e.lineWidth=2*a.borderWidth,e.lineJoin="round"):(e.lineWidth=a.borderWidth,e.lineJoin="bevel"),t.fullCircles&&function(e,t,n){var r,i=t.x,a=t.y,o=t.startAngle,s=t.pixelMargin,c=t.fullCircles,l=Math.max(t.outerRadius-s,0),u=t.innerRadius+s;for(n&&kt(e,t,o+v.u),e.beginPath(),e.arc(i,a,u,o+v.u,o,!0),r=0;r=v.u||Object(v.Ib)(a,c,l))&&(o>=u+h&&o<=f+h)}},{key:"getCenterPoint",value:function(e){var t=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius","circumference"],e),n=t.x,r=t.y,i=t.startAngle,a=t.endAngle,o=t.innerRadius,s=t.outerRadius,c=this.options,l=c.offset,u=(i+a)/2,f=(o+s+c.spacing+l)/2;return{x:n+Math.cos(u)*f,y:r+Math.sin(u)*f}}},{key:"tooltipPosition",value:function(e){return this.getCenterPoint(e)}},{key:"draw",value:function(e){var t=this,n=t.options,r=t.circumference,i=(n.offset||0)/2,a=(n.spacing||0)/2;if(t.pixelMargin="inner"===n.borderAlign?.33:0,t.fullCircles=r>v.u?Math.floor(r/v.u):0,!(0===r||t.innerRadius<0||t.outerRadius<0)){e.save();var o=0;if(i){o=i/2;var s=(t.startAngle+t.endAngle)/2;e.translate(Math.cos(s)*o,Math.sin(s)*o),t.circumference>=v.q&&(o=i)}e.fillStyle=n.backgroundColor,e.strokeStyle=n.borderColor;var c=function(e,t,n,r){var i=t.fullCircles,a=t.startAngle,o=t.circumference,s=t.endAngle;if(i){St(e,t,n,r,a+v.u);for(var c=0;c2&&void 0!==arguments[2]?arguments[2]:t;e.lineCap=Object(v.Pb)(n.borderCapStyle,t.borderCapStyle),e.setLineDash(Object(v.Pb)(n.borderDash,t.borderDash)),e.lineDashOffset=Object(v.Pb)(n.borderDashOffset,t.borderDashOffset),e.lineJoin=Object(v.Pb)(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=Object(v.Pb)(n.borderWidth,t.borderWidth),e.strokeStyle=Object(v.Pb)(n.borderColor,t.borderColor)}function Pt(e,t,n){e.lineTo(n.x,n.y)}function Tt(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=e.length,i=n.start,a=void 0===i?0:i,o=n.end,s=void 0===o?r-1:o,c=t.start,l=t.end,u=Math.max(a,c),f=Math.min(s,l),d=al&&s>l;return{count:r,start:u,loop:t.loop,ilen:fc&&(c=j),y=(O*y+w)/++O):(k(),e.lineTo(w,j),o=S,O=0,s=c=j),l=j}k()}function At(e){var t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&"monotone"!==t.cubicInterpolationMode&&!t.stepped&&!n?Dt:_t}Et.id="arc",Et.defaults={borderAlign:"center",borderColor:"#fff",borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0},Et.defaultRoutes={backgroundColor:"backgroundColor"};var Rt="function"===typeof Path2D;function Lt(e,t,n,r){Rt&&1===t.segments.length?function(e,t,n,r){var i=t._path;i||(i=t._path=new Path2D,t.path(i,n,r)&&i.closePath()),Mt(e,t.options),e.stroke(i)}(e,t,n,r):function(e,t,n,r){var i,a=t.segments,o=t.options,s=At(t),c=Object(f.a)(a);try{for(c.s();!(i=c.n()).done;){var l=i.value;Mt(e,o,l.style),e.beginPath(),s(e,t,l,{start:n,end:n+r-1})&&e.closePath(),e.stroke()}}catch(u){c.e(u)}finally{c.f()}}(e,t,n,r)}var Nt=function(e){Object(s.a)(n,e);var t=Object(c.a)(n);function n(e){var r;return Object(h.a)(this,n),(r=t.call(this)).animated=!0,r.options=void 0,r._loop=void 0,r._fullLoop=void 0,r._path=void 0,r._points=void 0,r._segments=void 0,r._decimated=!1,r._pointsUpdated=!1,r._datasetIndex=void 0,e&&Object.assign(Object(i.a)(r),e),r}return Object(p.a)(n,[{key:"updateControlPoints",value:function(e,t){var n=this,r=n.options;if((r.tension||"monotone"===r.cubicInterpolationMode)&&!r.stepped&&!n._pointsUpdated){var i=r.spanGaps?n._loop:n._fullLoop;Object(v.bb)(n._points,r,e,i,t),n._pointsUpdated=!0}}},{key:"first",value:function(){var e=this.segments,t=this.points;return e.length&&t[e[0].start]}},{key:"last",value:function(){var e=this.segments,t=this.points,n=e.length;return n&&t[e[n-1].end]}},{key:"interpolate",value:function(e,t){var n=this,r=n.options,i=e[t],a=n.points,o=Object(v.db)(n,{property:t,start:i,end:i});if(o.length){var s,c,l=[],u=function(e){return e.stepped?v.eb:e.tension||"monotone"===e.cubicInterpolationMode?v.fb:v.gb}(r);for(s=0,c=o.length;s=o.left&&t<=o.right)&&(a||n>=o.top&&n<=o.bottom)}function Wt(e,t){e.rect(t.x,t.y,t.w,t.h)}function Ht(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=e.x!==n.x?-t:0,i=e.y!==n.y?-t:0,a=(e.x+e.w!==n.x+n.w?t:0)-r,o=(e.y+e.h!==n.y+n.h?t:0)-i;return{x:e.x+r,y:e.y+i,w:e.w+a,h:e.h+o,radius:e.radius}}zt.id="point",zt.defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0},zt.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};var Vt=function(e){Object(s.a)(n,e);var t=Object(c.a)(n);function n(e){var r;return Object(h.a)(this,n),(r=t.call(this)).options=void 0,r.horizontal=void 0,r.base=void 0,r.width=void 0,r.height=void 0,e&&Object.assign(Object(i.a)(r),e),r}return Object(p.a)(n,[{key:"draw",value:function(e){var t,n=this.options,r=Bt(this),i=r.inner,a=r.outer,o=(t=a.radius).topLeft||t.topRight||t.bottomLeft||t.bottomRight?v.kb:Wt,s=.33;e.save(),a.w===i.w&&a.h===i.h||(e.beginPath(),o(e,Ht(a,s,i)),e.clip(),o(e,Ht(i,-.33,a)),e.fillStyle=n.borderColor,e.fill("evenodd")),e.beginPath(),o(e,Ht(i,s,a)),e.fillStyle=n.backgroundColor,e.fill(),e.restore()}},{key:"inRange",value:function(e,t,n){return Qt(this,e,t,n)}},{key:"inXRange",value:function(e,t){return Qt(this,e,null,t)}},{key:"inYRange",value:function(e,t){return Qt(this,null,e,t)}},{key:"getCenterPoint",value:function(e){var t=this.getProps(["x","y","base","horizontal"],e),n=t.x,r=t.y,i=t.base,a=t.horizontal;return{x:a?(n+i)/2:n,y:a?r:(r+i)/2}}},{key:"getRange",value:function(e){return"x"===e?this.width/2:this.height/2}}]),n}(Ie);Vt.id="bar",Vt.defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,enableBorderRadius:!0,pointStyle:void 0},Vt.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};var Ut=Object.freeze({__proto__:null,ArcElement:Et,LineElement:Nt,PointElement:zt,BarElement:Vt});function qt(e){if(e._decimated){var t=e._data;delete e._decimated,delete e._data,Object.defineProperty(e,"data",{value:t})}}function Yt(e){e.data.datasets.forEach((function(e){qt(e)}))}var Xt={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:function(e,t,n){if(n.enabled){var i=e.width;e.data.datasets.forEach((function(t,a){var o=t._data,s=t.indexAxis,c=e.getDatasetMeta(a),l=o||t.data;if("y"!==Object(v.C)([s,e.options.indexAxis])&&"line"===c.type){var u=e.scales[c.xAxisID];if(("linear"===u.type||"time"===u.type)&&!e.options.parsing){var f=function(e,t){var n=t.length,r=0,i=e.iScale,a=i.getUserBounds(),o=a.min,s=a.max,c=a.minDefined,l=a.maxDefined;return c&&(r=Object(v.Kb)(Object(v.Qb)(t,i.axis,o).lo,0,n-1)),{start:r,count:l?Object(v.Kb)(Object(v.Qb)(t,i.axis,s).hi+1,r,n)-r:n-r}}(c,l),d=f.start,h=f.count;if(h<=(n.threshold||4*i))qt(t);else{var p;switch(Object(v.Db)(o)&&(t._data=l,delete t.data,Object.defineProperty(t,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(e){this._data=e}})),n.algorithm){case"lttb":p=function(e,t,n,r,i){var a=i.samples||r;if(a>=n)return e.slice(t,t+n);var o,s,c,l,u,f=[],d=(n-2)/(a-2),h=0,p=t+n-1,v=t;for(f[h++]=e[v],o=0;oc&&(c=l,s=e[b],u=b);f[h++]=s,v=u}return f[h++]=e[p],f}(l,d,h,i,n);break;case"min-max":p=function(e,t,n,i){var a,o,s,c,l,u,f,d,h,p,m=0,g=0,b=[],y=t+n-1,O=e[t].x,x=e[y].x-O;for(a=t;ap&&(p=c,f=a),m=(g*m+o.x)/++g;else{var w=a-1;if(!Object(v.Db)(u)&&!Object(v.Db)(f)){var j=Math.min(u,f),S=Math.max(u,f);j!==d&&j!==w&&b.push(Object(r.a)(Object(r.a)({},e[j]),{},{x:m})),S!==d&&S!==w&&b.push(Object(r.a)(Object(r.a)({},e[S]),{},{x:m}))}a>0&&w!==d&&b.push(e[w]),b.push(o),l=k,g=0,h=p=c,u=f=d=a}}return b}(l,d,h,i);break;default:throw new Error("Unsupported decimation algorithm '".concat(n.algorithm,"'"))}t._decimated=p}}}}))}else Yt(e)},destroy:function(e){Yt(e)}};function Kt(e,t,n){var r=function(e){var t=e.options,n=t.fill,r=Object(v.Pb)(n&&n.target,n);return void 0===r&&(r=!!t.backgroundColor),!1!==r&&null!==r&&(!0===r?"origin":r)}(e);if(Object(v.Cb)(r))return!isNaN(r.value)&&r;var i=parseFloat(r);return Object(v.Ab)(i)&&Math.floor(i)===i?("-"!==r[0]&&"+"!==r[0]||(i=t+i),!(i===t||i<0||i>=n)&&i):["origin","start","end","stack","shape"].indexOf(r)>=0&&r}var Gt=function(){function e(t){Object(h.a)(this,e),this.x=t.x,this.y=t.y,this.radius=t.radius}return Object(p.a)(e,[{key:"pathSegment",value:function(e,t,n){var r=this.x,i=this.y,a=this.radius;return t=t||{start:0,end:v.u},e.arc(r,i,a,t.end,t.start,!0),!n.bounds}},{key:"interpolate",value:function(e){var t=this.x,n=this.y,r=this.radius,i=e.angle;return{x:t+Math.cos(i)*r,y:n+Math.sin(i)*r,angle:i}}}]),e}();function Zt(e){return(e.scale||{}).getPointPositionForValue?function(e){var t,n,r,i=e.scale,a=e.fill,o=i.options,s=i.getLabels().length,c=[],l=o.reverse?i.max:i.min,u=o.reverse?i.min:i.max;if(r="start"===a?l:"end"===a?u:Object(v.Cb)(a)?a.value:i.getBaseValue(),o.grid.circular)return n=i.getPointPositionForValue(0,l),new Gt({x:n.x,y:n.y,radius:i.getDistanceFromCenterForValue(r)});for(t=0;te;t--){var r=n[t];if(!isNaN(r.x)&&!isNaN(r.y))break}return t}function en(e){var t=e.chart,n=e.scale,r=e.index,i=e.line,a=[],o=i.segments,s=i.points,c=function(e,t){for(var n=[],r=e.getSortedVisibleDatasetMetas(),i=0;i=f&&i<=d){s=i===f,c=i===d;break}}return{first:s,last:c,point:r}}function an(e,t){var n=[],r=!1;return Object(v.vb)(e)?(r=!0,n=e):n=function(e,t){var n=e||{},r=n.x,i=void 0===r?null:r,a=n.y,o=void 0===a?null:a,s=t.points,c=[];return t.segments.forEach((function(e){var t=e.start,n=e.end;n=Jt(t,n,s);var r=s[t],a=s[n];null!==o?(c.push({x:r.x,y:o}),c.push({x:a.x,y:o})):null!==i&&(c.push({x:i,y:r.y}),c.push({x:i,y:a.y}))})),c}(e,t),n.length?new Nt({points:n,options:{tension:0},_loop:r,_fullLoop:r}):null}function on(e,t,n){var r,i=e[t].fill,a=[t];if(!n)return i;for(;!1!==i&&-1===a.indexOf(i);){if(!Object(v.Ab)(i))return i;if(!(r=e[i]))return!1;if(r.visible)return i;a.push(i),i=r.fill}return!1}function sn(e,t,n){e.beginPath(),t.path(e),e.lineTo(t.last().x,n),e.lineTo(t.first().x,n),e.closePath(),e.clip()}function cn(e,t,n,r){if(!r){var i=t[e],a=n[e];return"angle"===e&&(i=Object(v.ob)(i),a=Object(v.ob)(a)),{property:e,start:i,end:a}}}function ln(e,t,n,r){return e&&t?r(e[n],t[n]):e?e[n]:t?t[n]:0}function un(e,t,n){var r=t.chart.chartArea,i=r.top,a=r.bottom,o=n||{},s=o.property,c=o.start,l=o.end;"x"===s&&(e.beginPath(),e.rect(c,i,l-c,a-i),e.clip())}function fn(e,t,n,r){var i=t.interpolate(n,r);i&&e.lineTo(i.x,i.y)}function dn(e,t){var n,r=t.line,i=t.target,a=t.property,o=t.color,s=t.scale,c=function(e,t,n){var r,i=e.segments,a=e.points,o=t.points,s=[],c=Object(f.a)(i);try{for(c.s();!(r=c.n()).done;){var l=r.value,d=l.start,h=l.end;h=Jt(d,h,a);var p=cn(n,a[d],a[h],l.loop);if(t.segments){var m,g=Object(v.db)(t,p),b=Object(f.a)(g);try{for(b.s();!(m=b.n()).done;){var y,O=m.value,x=cn(n,o[O.start],o[O.end],O.loop),k=Object(v.nb)(l,a,x),w=Object(f.a)(k);try{for(w.s();!(y=w.n()).done;){var j=y.value;s.push({source:j,target:O,start:Object(u.a)({},n,ln(p,x,"start",Math.max)),end:Object(u.a)({},n,ln(p,x,"end",Math.min))})}}catch(S){w.e(S)}finally{w.f()}}}catch(S){b.e(S)}finally{b.f()}}else s.push({source:l,target:p,start:a[d],end:a[h]})}}catch(S){c.e(S)}finally{c.f()}return s}(r,i,a),l=Object(f.a)(c);try{for(l.s();!(n=l.n()).done;){var d=n.value,h=d.source,p=d.target,m=d.start,g=d.end,b=h.style,y=(b=void 0===b?{}:b).backgroundColor,O=void 0===y?o:y,x=!0!==i;e.save(),e.fillStyle=O,un(e,s,x&&cn(a,m,g)),e.beginPath();var k=!!r.pathSegment(e,h),w=void 0;if(x){k?e.closePath():fn(e,i,g,a);var j=!!i.pathSegment(e,p,{move:k,reverse:!0});(w=k&&j)||fn(e,i,m,a)}e.closePath(),e.fill(w?"evenodd":"nonzero"),e.restore()}}catch(S){l.e(S)}finally{l.f()}}function hn(e,t,n){var r=function(e){var t=e.chart,n=e.fill,r=e.line;if(Object(v.Ab)(n))return function(e,t){var n=e.getDatasetMeta(t);return n&&e.isDatasetVisible(t)?n.dataset:null}(t,n);if("stack"===n)return en(e);if("shape"===n)return!0;var i=Zt(e);return i instanceof Gt?i:an(i,r)}(t),i=t.line,a=t.scale,o=t.axis,s=i.options,c=s.fill,l=s.backgroundColor,u=c||{},f=u.above,d=void 0===f?l:f,h=u.below,p=void 0===h?l:h;r&&i.points.length&&(Object(v.v)(e,n),function(e,t){var n=t.line,r=t.target,i=t.above,a=t.below,o=t.area,s=t.scale,c=n._loop?"angle":t.axis;e.save(),"x"===c&&a!==i&&(sn(e,r,o.top),dn(e,{line:n,target:r,color:i,scale:s,property:c}),e.restore(),e.save(),sn(e,r,o.bottom)),dn(e,{line:n,target:r,color:a,scale:s,property:c}),e.restore()}(e,{line:i,target:r,above:d,below:p,area:n,scale:a,axis:o}),Object(v.x)(e))}var pn={id:"filler",afterDatasetsUpdate:function(e,t,n){var r,i,a,o,s=(e.data.datasets||[]).length,c=[];for(i=0;i=0;--o){var s=i[o].$filler;s&&(s.line.updateControlPoints(a,s.axis),r&&hn(e.ctx,s,a))}},beforeDatasetsDraw:function(e,t,n){if("beforeDatasetsDraw"===n.drawTime)for(var r=e.getSortedVisibleDatasetMetas(),i=r.length-1;i>=0;--i){var a=r[i].$filler;a&&hn(e.ctx,a,e.chartArea)}},beforeDatasetDraw:function(e,t,n){var r=t.meta.$filler;r&&!1!==r.fill&&"beforeDatasetDraw"===n.drawTime&&hn(e.ctx,r,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}},vn=function(e,t){var n=e.boxHeight,r=void 0===n?t:n,i=e.boxWidth,a=void 0===i?t:i;return e.usePointStyle&&(r=Math.min(r,t),a=Math.min(a,t)),{boxWidth:a,boxHeight:r,itemHeight:Math.max(t,r)}},mn=function(e){Object(s.a)(n,e);var t=Object(c.a)(n);function n(e){var r;return Object(h.a)(this,n),(r=t.call(this))._added=!1,r.legendHitBoxes=[],r._hoveredItem=null,r.doughnutMode=!1,r.chart=e.chart,r.options=e.options,r.ctx=e.ctx,r.legendItems=void 0,r.columnSizes=void 0,r.lineWidths=void 0,r.maxHeight=void 0,r.maxWidth=void 0,r.top=void 0,r.bottom=void 0,r.left=void 0,r.right=void 0,r.height=void 0,r.width=void 0,r._margins=void 0,r.position=void 0,r.weight=void 0,r.fullSize=void 0,r}return Object(p.a)(n,[{key:"update",value:function(e,t,n){var r=this;r.maxWidth=e,r.maxHeight=t,r._margins=n,r.setDimensions(),r.buildLabels(),r.fit()}},{key:"setDimensions",value:function(){var e=this;e.isHorizontal()?(e.width=e.maxWidth,e.left=e._margins.left,e.right=e.width):(e.height=e.maxHeight,e.top=e._margins.top,e.bottom=e.height)}},{key:"buildLabels",value:function(){var e=this,t=e.options.labels||{},n=Object(v.n)(t.generateLabels,[e.chart],e)||[];t.filter&&(n=n.filter((function(n){return t.filter(n,e.chart.data)}))),t.sort&&(n=n.sort((function(n,r){return t.sort(n,r,e.chart.data)}))),e.options.reverse&&n.reverse(),e.legendItems=n}},{key:"fit",value:function(){var e=this,t=e.options,n=e.ctx;if(t.display){var r,i,a=t.labels,o=Object(v.y)(a.font),s=o.size,c=e._computeTitleHeight(),l=vn(a,s),u=l.boxWidth,f=l.itemHeight;n.font=o.string,e.isHorizontal()?(r=e.maxWidth,i=e._fitRows(c,s,u,f)+10):(i=e.maxHeight,r=e._fitCols(c,s,u,f)+10),e.width=Math.min(r,t.maxWidth||e.maxWidth),e.height=Math.min(i,t.maxHeight||e.maxHeight)}else e.width=e.height=0}},{key:"_fitRows",value:function(e,t,n,r){var i=this,a=i.ctx,o=i.maxWidth,s=i.options.labels.padding,c=i.legendHitBoxes=[],l=i.lineWidths=[0],u=r+s,f=e;a.textAlign="left",a.textBaseline="middle";var d=-1,h=-u;return i.legendItems.forEach((function(e,i){var p=n+t/2+a.measureText(e.text).width;(0===i||l[l.length-1]+p+2*s>o)&&(f+=u,l[l.length-(i>0?0:1)]=0,h+=u,d++),c[i]={left:0,top:h,row:d,width:p,height:r},l[l.length-1]+=p+s})),f}},{key:"_fitCols",value:function(e,t,n,r){var i=this,a=i.ctx,o=i.maxHeight,s=i.options.labels.padding,c=i.legendHitBoxes=[],l=i.columnSizes=[],u=o-e,f=s,d=0,h=0,p=0,v=0;return i.legendItems.forEach((function(e,i){var o=n+t/2+a.measureText(e.text).width;i>0&&h+r+2*s>u&&(f+=d+s,l.push({width:d,height:h}),p+=d+s,v++,d=h=0),c[i]={left:p,top:h,col:v,width:o,height:r},d=Math.max(d,o),h+=r+s})),f+=d,l.push({width:d,height:h}),f}},{key:"adjustHitBoxes",value:function(){var e=this;if(e.options.display){var t=e._computeTitleHeight(),n=e.legendHitBoxes,r=e.options,i=r.align,a=r.labels.padding,o=r.rtl,s=Object(v.pb)(o,e.left,e.width);if(this.isHorizontal()){var c,l=0,u=Object(v.A)(i,e.left+a,e.right-e.lineWidths[l]),d=Object(f.a)(n);try{for(d.s();!(c=d.n()).done;){var h=c.value;l!==h.row&&(l=h.row,u=Object(v.A)(i,e.left+a,e.right-e.lineWidths[l])),h.top+=e.top+t+a,h.left=s.leftForLtr(s.x(u),h.width),u+=h.width+a}}catch(O){d.e(O)}finally{d.f()}}else{var p,m=0,g=Object(v.A)(i,e.top+t+a,e.bottom-e.columnSizes[m].height),b=Object(f.a)(n);try{for(b.s();!(p=b.n()).done;){var y=p.value;y.col!==m&&(m=y.col,g=Object(v.A)(i,e.top+t+a,e.bottom-e.columnSizes[m].height)),y.top=g,y.left+=e.left+a,y.left=s.leftForLtr(s.x(y.left),y.width),g+=y.height+a}}catch(O){b.e(O)}finally{b.f()}}}}},{key:"isHorizontal",value:function(){return"top"===this.options.position||"bottom"===this.options.position}},{key:"draw",value:function(){var e=this;if(e.options.display){var t=e.ctx;Object(v.v)(t,e),e._draw(),Object(v.x)(t)}}},{key:"_draw",value:function(){var e,t=this,n=t.options,r=t.columnSizes,i=t.lineWidths,a=t.ctx,o=n.align,s=n.labels,c=v.xb.color,l=Object(v.pb)(n.rtl,t.left,t.width),u=Object(v.y)(s.font),f=s.color,d=s.padding,h=u.size,p=h/2;t.drawTitle(),a.textAlign=l.textAlign("left"),a.textBaseline="middle",a.lineWidth=.5,a.font=u.string;var m=vn(s,h),g=m.boxWidth,b=m.boxHeight,y=m.itemHeight,O=t.isHorizontal(),x=this._computeTitleHeight();e=O?{x:Object(v.A)(o,t.left+d,t.right-i[0]),y:t.top+d+x,line:0}:{x:t.left+d,y:Object(v.A)(o,t.top+x+d,t.bottom-r[0].height),line:0},Object(v.qb)(t.ctx,n.textDirection);var k=y+d;t.legendItems.forEach((function(m,w){a.strokeStyle=m.fontColor||f,a.fillStyle=m.fontColor||f;var j=a.measureText(m.text).width,S=l.textAlign(m.textAlign||(m.textAlign=s.textAlign)),C=g+p+j,E=e.x,M=e.y;l.setWidth(t.width),O?w>0&&E+C+d>t.right&&(M=e.y+=k,e.line++,E=e.x=Object(v.A)(o,t.left+d,t.right-i[e.line])):w>0&&M+k>t.bottom&&(E=e.x=E+r[e.line].width+d,e.line++,M=e.y=Object(v.A)(o,t.top+x+d,t.bottom-r[e.line].height)),function(e,t,n){if(!(isNaN(g)||g<=0||isNaN(b)||b<0)){a.save();var r=Object(v.Pb)(n.lineWidth,1);if(a.fillStyle=Object(v.Pb)(n.fillStyle,c),a.lineCap=Object(v.Pb)(n.lineCap,"butt"),a.lineDashOffset=Object(v.Pb)(n.lineDashOffset,0),a.lineJoin=Object(v.Pb)(n.lineJoin,"miter"),a.lineWidth=r,a.strokeStyle=Object(v.Pb)(n.strokeStyle,c),a.setLineDash(Object(v.Pb)(n.lineDash,[])),s.usePointStyle){var i={radius:g*Math.SQRT2/2,pointStyle:n.pointStyle,rotation:n.rotation,borderWidth:r},o=l.xPlus(e,g/2),u=t+p;Object(v.jb)(a,i,o,u)}else{var f=t+Math.max((h-b)/2,0),d=l.leftForLtr(e,g),m=Object(v.mb)(n.borderRadius);a.beginPath(),Object.values(m).some((function(e){return 0!==e}))?Object(v.kb)(a,{x:d,y:f,w:g,h:b,radius:m}):a.rect(d,f,g,b),a.fill(),0!==r&&a.stroke()}a.restore()}}(l.x(E),M,m),E=Object(v.rb)(S,E+g+p,O?E+C:t.right,n.rtl),function(e,t,n){Object(v.w)(a,n.text,e,t+y/2,u,{strikethrough:n.hidden,textAlign:l.textAlign(n.textAlign)})}(l.x(E),M,m),O?e.x+=C+d:e.y+=k})),Object(v.sb)(t.ctx,n.textDirection)}},{key:"drawTitle",value:function(){var e=this,t=e.options,n=t.title,r=Object(v.y)(n.font),i=Object(v.b)(n.padding);if(n.display){var a,o=Object(v.pb)(t.rtl,e.left,e.width),s=e.ctx,c=n.position,l=r.size/2,u=i.top+l,f=e.left,h=e.width;if(this.isHorizontal())h=Math.max.apply(Math,Object(d.a)(e.lineWidths)),a=e.top+u,f=Object(v.A)(t.align,f,e.right-h);else{var p=e.columnSizes.reduce((function(e,t){return Math.max(e,t.height)}),0);a=u+Object(v.A)(t.align,e.top,e.bottom-p-t.labels.padding-e._computeTitleHeight())}var m=Object(v.A)(c,f,f+h);s.textAlign=o.textAlign(Object(v.z)(c)),s.textBaseline="middle",s.strokeStyle=n.color,s.fillStyle=n.color,s.font=r.string,Object(v.w)(s,n.text,m,a,r)}}},{key:"_computeTitleHeight",value:function(){var e=this.options.title,t=Object(v.y)(e.font),n=Object(v.b)(e.padding);return e.display?t.lineHeight+n.height:0}},{key:"_getLegendItemAt",value:function(e,t){var n,r,i,a=this;if(e>=a.left&&e<=a.right&&t>=a.top&&t<=a.bottom)for(i=a.legendHitBoxes,n=0;n=(r=i[n]).left&&e<=r.left+r.width&&t>=r.top&&t<=r.top+r.height)return a.legendItems[n];return null}},{key:"handleEvent",value:function(e){var t=this,n=t.options;if(function(e,t){if("mousemove"===e&&(t.onHover||t.onLeave))return!0;if(t.onClick&&("click"===e||"mouseup"===e))return!0;return!1}(e.type,n)){var r,i,a=t._getLegendItemAt(e.x,e.y);if("mousemove"===e.type){var o=t._hoveredItem,s=(i=a,null!==(r=o)&&null!==i&&r.datasetIndex===i.datasetIndex&&r.index===i.index);o&&!s&&Object(v.n)(n.onLeave,[e,o,t],t),t._hoveredItem=a,a&&!s&&Object(v.n)(n.onHover,[e,a,t],t)}else a&&Object(v.n)(n.onClick,[e,a,t],t)}}}]),n}(Ie);var gn={id:"legend",_element:mn,start:function(e,t,n){var r=e.legend=new mn({ctx:e.ctx,options:n,chart:e});Oe(e,r,n),be(e,r)},stop:function(e){ye(e,e.legend),delete e.legend},beforeUpdate:function(e,t,n){var r=e.legend;Oe(e,r,n),r.options=n},afterUpdate:function(e){var t=e.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent:function(e,t){t.replay||e.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick:function(e,t,n){var r=t.datasetIndex,i=n.chart;i.isDatasetVisible(r)?(i.hide(r),t.hidden=!0):(i.show(r),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:function(e){return e.chart.options.color},boxWidth:40,padding:10,generateLabels:function(e){var t=e.data.datasets,n=e.legend.options.labels,r=n.usePointStyle,i=n.pointStyle,a=n.textAlign,o=n.color;return e._getSortedDatasetMetas().map((function(e){var n=e.controller.getStyle(r?0:void 0),s=Object(v.b)(n.borderWidth);return{text:t[e.index].label,fillStyle:n.backgroundColor,fontColor:o,hidden:!e.visible,lineCap:n.borderCapStyle,lineDash:n.borderDash,lineDashOffset:n.borderDashOffset,lineJoin:n.borderJoinStyle,lineWidth:(s.width+s.height)/4,strokeStyle:n.borderColor,pointStyle:i||n.pointStyle,rotation:n.rotation,textAlign:a||n.textAlign,borderRadius:0,datasetIndex:e.index}}),this)}},title:{color:function(e){return e.chart.options.color},display:!1,position:"center",text:""}},descriptors:{_scriptable:function(e){return!e.startsWith("on")},labels:{_scriptable:function(e){return!["generateLabels","filter","sort"].includes(e)}}}},bn=function(e){Object(s.a)(n,e);var t=Object(c.a)(n);function n(e){var r;return Object(h.a)(this,n),(r=t.call(this)).chart=e.chart,r.options=e.options,r.ctx=e.ctx,r._padding=void 0,r.top=void 0,r.bottom=void 0,r.left=void 0,r.right=void 0,r.width=void 0,r.height=void 0,r.position=void 0,r.weight=void 0,r.fullSize=void 0,r}return Object(p.a)(n,[{key:"update",value:function(e,t){var n=this,r=n.options;if(n.left=0,n.top=0,r.display){n.width=n.right=e,n.height=n.bottom=t;var i=Object(v.vb)(r.text)?r.text.length:1;n._padding=Object(v.b)(r.padding);var a=i*Object(v.y)(r.font).lineHeight+n._padding.height;n.isHorizontal()?n.height=a:n.width=a}else n.width=n.height=n.right=n.bottom=0}},{key:"isHorizontal",value:function(){var e=this.options.position;return"top"===e||"bottom"===e}},{key:"_drawArgs",value:function(e){var t,n,r,i=this.top,a=this.left,o=this.bottom,s=this.right,c=this.options,l=c.align,u=0;return this.isHorizontal()?(n=Object(v.A)(l,a,s),r=i+e,t=s-a):("left"===c.position?(n=a+e,r=Object(v.A)(l,o,i),u=-.5*v.q):(n=s-e,r=Object(v.A)(l,i,o),u=.5*v.q),t=o-i),{titleX:n,titleY:r,maxWidth:t,rotation:u}}},{key:"draw",value:function(){var e=this,t=e.ctx,n=e.options;if(n.display){var r=Object(v.y)(n.font),i=r.lineHeight/2+e._padding.top,a=e._drawArgs(i),o=a.titleX,s=a.titleY,c=a.maxWidth,l=a.rotation;Object(v.w)(t,n.text,0,0,r,{color:n.color,maxWidth:c,rotation:l,textAlign:Object(v.z)(n.align),textBaseline:"middle",translation:[o,s]})}}}]),n}(Ie);var yn={id:"title",_element:bn,start:function(e,t,n){!function(e,t){var n=new bn({ctx:e.ctx,options:t,chart:e});Oe(e,n,t),be(e,n),e.titleBlock=n}(e,n)},stop:function(e){var t=e.titleBlock;ye(e,t),delete e.titleBlock},beforeUpdate:function(e,t,n){var r=e.titleBlock;Oe(e,r,n),r.options=n},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}},On=new WeakMap,xn={id:"subtitle",start:function(e,t,n){var r=new bn({ctx:e.ctx,options:n,chart:e});Oe(e,r,n),be(e,r),On.set(e,r)},stop:function(e){ye(e,On.get(e)),On.delete(e)},beforeUpdate:function(e,t,n){var r=On.get(e);Oe(e,r,n),r.options=n},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}},kn={average:function(e){if(!e.length)return!1;var t,n,r=0,i=0,a=0;for(t=0,n=e.length;t-1?e.split("\n"):e}function Sn(e,t){var n=t.element,r=t.datasetIndex,i=t.index,a=e.getDatasetMeta(r).controller,o=a.getLabelAndValue(i),s=o.label,c=o.value;return{chart:e,label:s,parsed:a.getParsed(i),raw:e.data.datasets[r].data[i],formattedValue:c,dataset:a.getDataset(),dataIndex:i,datasetIndex:r,element:n}}function Cn(e,t){var n=e._chart.ctx,r=e.body,i=e.footer,a=e.title,o=t.boxWidth,s=t.boxHeight,c=Object(v.y)(t.bodyFont),l=Object(v.y)(t.titleFont),u=Object(v.y)(t.footerFont),f=a.length,d=i.length,h=r.length,p=Object(v.b)(t.padding),m=p.height,g=0,b=r.reduce((function(e,t){return e+t.before.length+t.lines.length+t.after.length}),0);(b+=e.beforeBody.length+e.afterBody.length,f&&(m+=f*l.lineHeight+(f-1)*t.titleSpacing+t.titleMarginBottom),b)&&(m+=h*(t.displayColors?Math.max(s,c.lineHeight):c.lineHeight)+(b-h)*c.lineHeight+(b-1)*t.bodySpacing);d&&(m+=t.footerMarginTop+d*u.lineHeight+(d-1)*t.footerSpacing);var y=0,O=function(e){g=Math.max(g,n.measureText(e).width+y)};return n.save(),n.font=l.string,Object(v.c)(e.title,O),n.font=c.string,Object(v.c)(e.beforeBody.concat(e.afterBody),O),y=t.displayColors?o+2:0,Object(v.c)(r,(function(e){Object(v.c)(e.before,O),Object(v.c)(e.lines,O),Object(v.c)(e.after,O)})),y=0,n.font=u.string,Object(v.c)(e.footer,O),n.restore(),{width:g+=p.width,height:m}}function En(e,t,n,r){var i=n.x,a=n.width,o=e.width,s=e.chartArea,c=s.left,l=s.right,u="center";return"center"===r?u=i<=(c+l)/2?"left":"right":i<=a/2?u="left":i>=o-a/2&&(u="right"),function(e,t,n,r){var i=r.x,a=r.width,o=n.caretSize+n.caretPadding;return"left"===e&&i+a+o>t.width||"right"===e&&i-a-o<0||void 0}(u,e,t,n)&&(u="center"),u}function Mn(e,t,n){var r=t.yAlign||function(e,t){var n=t.y,r=t.height;return ne.height-r/2?"bottom":"center"}(e,n);return{xAlign:t.xAlign||En(e,t,n,r),yAlign:r}}function Pn(e,t,n,r){var i=e.caretSize,a=e.caretPadding,o=e.cornerRadius,s=n.xAlign,c=n.yAlign,l=i+a,u=o+a,f=function(e,t){var n=e.x,r=e.width;return"right"===t?n-=r:"center"===t&&(n-=r/2),n}(t,s),d=function(e,t,n){var r=e.y,i=e.height;return"top"===t?r+=n:r-="bottom"===t?i+n:i/2,r}(t,c,l);return"center"===c?"left"===s?f+=l:"right"===s&&(f-=l):"left"===s?f-=u:"right"===s&&(f+=u),{x:Object(v.Kb)(f,0,r.width-t.width),y:Object(v.Kb)(d,0,r.height-t.height)}}function Tn(e,t,n){var r=Object(v.b)(n.padding);return"center"===t?e.x+e.width/2:"right"===t?e.x+e.width-r.right:e.x+r.left}function _n(e){return wn([],jn(e))}function Dn(e,t){var n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}var An=function(e){Object(s.a)(n,e);var t=Object(c.a)(n);function n(e){var r;return Object(h.a)(this,n),(r=t.call(this)).opacity=0,r._active=[],r._chart=e._chart,r._eventPosition=void 0,r._size=void 0,r._cachedAnimations=void 0,r._tooltipItems=[],r.$animations=void 0,r.$context=void 0,r.options=e.options,r.dataPoints=void 0,r.title=void 0,r.beforeBody=void 0,r.body=void 0,r.afterBody=void 0,r.footer=void 0,r.xAlign=void 0,r.yAlign=void 0,r.x=void 0,r.y=void 0,r.height=void 0,r.width=void 0,r.caretX=void 0,r.caretY=void 0,r.labelColors=void 0,r.labelPointStyles=void 0,r.labelTextColors=void 0,r}return Object(p.a)(n,[{key:"initialize",value:function(e){this.options=e,this._cachedAnimations=void 0,this.$context=void 0}},{key:"_resolveAnimations",value:function(){var e=this,t=e._cachedAnimations;if(t)return t;var n=e._chart,r=e.options.setContext(e.getContext()),i=r.enabled&&n.options.animation&&r.animations,a=new x(e._chart,i);return i._cacheable&&(e._cachedAnimations=Object.freeze(a)),a}},{key:"getContext",value:function(){var e,t,n,r=this;return r.$context||(r.$context=(e=r._chart.getContext(),t=r,n=r._tooltipItems,Object.assign(Object.create(e),{tooltip:t,tooltipItems:n,type:"tooltip"})))}},{key:"getTitle",value:function(e,t){var n=this,r=t.callbacks,i=r.beforeTitle.apply(n,[e]),a=r.title.apply(n,[e]),o=r.afterTitle.apply(n,[e]),s=[];return s=wn(s,jn(i)),s=wn(s,jn(a)),s=wn(s,jn(o))}},{key:"getBeforeBody",value:function(e,t){return _n(t.callbacks.beforeBody.apply(this,[e]))}},{key:"getBody",value:function(e,t){var n=this,r=t.callbacks,i=[];return Object(v.c)(e,(function(e){var t={before:[],lines:[],after:[]},a=Dn(r,e);wn(t.before,jn(a.beforeLabel.call(n,e))),wn(t.lines,a.label.call(n,e)),wn(t.after,jn(a.afterLabel.call(n,e))),i.push(t)})),i}},{key:"getAfterBody",value:function(e,t){return _n(t.callbacks.afterBody.apply(this,[e]))}},{key:"getFooter",value:function(e,t){var n=this,r=t.callbacks,i=r.beforeFooter.apply(n,[e]),a=r.footer.apply(n,[e]),o=r.afterFooter.apply(n,[e]),s=[];return s=wn(s,jn(i)),s=wn(s,jn(a)),s=wn(s,jn(o))}},{key:"_createItems",value:function(e){var t,n,r=this,i=r._active,a=r._chart.data,o=[],s=[],c=[],l=[];for(t=0,n=i.length;t0&&t.stroke()}},{key:"_updateAnimationTarget",value:function(e){var t=this,n=t._chart,r=t.$animations,i=r&&r.x,a=r&&r.y;if(i||a){var o=kn[e.position].call(t,t._active,t._eventPosition);if(!o)return;var s=t._size=Cn(t,e),c=Object.assign({},o,t._size),l=Mn(n,e,c),u=Pn(e,c,l,n);i._to===u.x&&a._to===u.y||(t.xAlign=l.xAlign,t.yAlign=l.yAlign,t.width=s.width,t.height=s.height,t.caretX=o.x,t.caretY=o.y,t._resolveAnimations().update(t,u))}}},{key:"draw",value:function(e){var t=this,n=t.options.setContext(t.getContext()),r=t.opacity;if(r){t._updateAnimationTarget(n);var i={width:t.width,height:t.height},a={x:t.x,y:t.y};r=Math.abs(r)<.001?0:r;var o=Object(v.b)(n.padding),s=t.title.length||t.beforeBody.length||t.body.length||t.afterBody.length||t.footer.length;n.enabled&&s&&(e.save(),e.globalAlpha=r,t.drawBackground(a,e,i,n),Object(v.qb)(e,n.textDirection),a.y+=o.top,t.drawTitle(a,e,n),t.drawBody(a,e,n),t.drawFooter(a,e,n),Object(v.sb)(e,n.textDirection),e.restore())}}},{key:"getActiveElements",value:function(){return this._active||[]}},{key:"setActiveElements",value:function(e,t){var n=this,r=n._active,i=e.map((function(e){var t=e.datasetIndex,r=e.index,i=n._chart.getDatasetMeta(t);if(!i)throw new Error("Cannot find a dataset at index "+t);return{datasetIndex:t,element:i.data[r],index:r}})),a=!Object(v.Y)(r,i),o=n._positionChanged(i,t);(a||o)&&(n._active=i,n._eventPosition=t,n.update(!0))}},{key:"handleEvent",value:function(e,t){var n,r=this,i=r.options,a=r._active||[],o=[];"mouseout"!==e.type&&(o=r._chart.getElementsAtEventForMode(e,i.mode,i,t),i.reverse&&o.reverse());var s=r._positionChanged(o,e);return(n=t||!Object(v.Y)(o,a)||s)&&(r._active=o,(i.enabled||i.external)&&(r._eventPosition={x:e.x,y:e.y},r.update(!0,t))),n}},{key:"_positionChanged",value:function(e,t){var n=this.caretX,r=this.caretY,i=this.options,a=kn[i.position].call(this,e,t);return!1!==a&&(n!==a.x||r!==a.y)}}]),n}(Ie);An.positioners=kn;var Rn={id:"tooltip",_element:An,positioners:kn,afterInit:function(e,t,n){n&&(e.tooltip=new An({_chart:e,options:n}))},beforeUpdate:function(e,t,n){e.tooltip&&e.tooltip.initialize(n)},reset:function(e,t,n){e.tooltip&&e.tooltip.initialize(n)},afterDraw:function(e){var t=e.tooltip,n={tooltip:t};!1!==e.notifyPlugins("beforeTooltipDraw",n)&&(t&&t.draw(e.ctx),e.notifyPlugins("afterTooltipDraw",n))},afterEvent:function(e,t){if(e.tooltip){var n=t.replay;e.tooltip.handleEvent(t.event,n)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:function(e,t){return t.bodyFont.size},boxWidth:function(e,t){return t.bodyFont.size},multiKeyBackground:"#fff",displayColors:!0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:{beforeTitle:v.tb,title:function(e){if(e.length>0){var t=e[0],n=t.chart.data.labels,r=n?n.length:0;if(this&&this.options&&"dataset"===this.options.mode)return t.dataset.label||"";if(t.label)return t.label;if(r>0&&t.dataIndex=0&&et.length-1?null:this.getPixelForValue(t[e].value)}},{key:"getValueForPixel",value:function(e){var t=this;return Math.round(t._startValue+t.getDecimalForPixel(e)*t._valueRange)}},{key:"getBasePixel",value:function(){return this.bottom}}]),n}(Ye);function zn(e,t,n){var r=n.horizontal,i=n.minRotation,a=Object(v.Nb)(i),o=(r?Math.sin(a):Math.cos(a))||.001,s=.75*t*(""+e).length;return Math.min(t/o,s)}In.id="category",In.defaults={ticks:{callback:In.prototype.getLabelForValue}};var $n=function(e){Object(s.a)(n,e);var t=Object(c.a)(n);function n(e){var r;return Object(h.a)(this,n),(r=t.call(this,e)).start=void 0,r.end=void 0,r._startValue=void 0,r._endValue=void 0,r._valueRange=0,r}return Object(p.a)(n,[{key:"parse",value:function(e,t){return Object(v.Db)(e)||("number"===typeof e||e instanceof Number)&&!isFinite(+e)?null:+e}},{key:"handleTickRangeOptions",value:function(){var e=this,t=e.options.beginAtZero,n=e.getUserBounds(),r=n.minDefined,i=n.maxDefined,a=e.min,o=e.max,s=function(e){return a=r?a:e},c=function(e){return o=i?o:e};if(t){var l=Object(v.Mb)(a),u=Object(v.Mb)(o);l<0&&u<0?c(0):l>0&&u>0&&s(0)}if(a===o){var f=1;(o>=Number.MAX_SAFE_INTEGER||a<=Number.MIN_SAFE_INTEGER)&&(f=Math.abs(.05*o)),c(o+f),t||s(a-f)}e.min=a,e.max=o}},{key:"getTickLimit",value:function(){var e,t=this,n=t.options.ticks,r=n.maxTicksLimit,i=n.stepSize;return i?e=Math.ceil(t.max/i)-Math.floor(t.min/i)+1:(e=t.computeTickLimit(),r=r||11),r&&(e=Math.min(r,e)),e}},{key:"computeTickLimit",value:function(){return Number.POSITIVE_INFINITY}},{key:"buildTicks",value:function(){var e=this,t=e.options,n=t.ticks,r=e.getTickLimit(),i=function(e,t){var n,r,i,a,o=[],s=e.bounds,c=e.step,l=e.min,u=e.max,f=e.precision,d=e.count,h=e.maxTicks,p=e.maxDigits,m=e.includeBounds,g=c||1,b=h-1,y=t.min,O=t.max,x=!Object(v.Db)(l),k=!Object(v.Db)(u),w=!Object(v.Db)(d),j=(O-y)/(p+1),S=Object(v.O)((O-y)/b/g)*g;if(S<1e-14&&!x&&!k)return[{value:y},{value:O}];(a=Math.ceil(O/S)-Math.floor(y/S))>b&&(S=Object(v.O)(a*S/b/g)*g),Object(v.Db)(f)||(n=Math.pow(10,f),S=Math.ceil(S*n)/n),"ticks"===s?(r=Math.floor(y/S)*S,i=Math.ceil(O/S)*S):(r=y,i=O),x&&k&&c&&Object(v.P)((u-l)/c,S/1e3)?(S=(u-l)/(a=Math.round(Math.min((u-l)/S,h))),r=l,i=u):w?S=((i=k?u:i)-(r=x?l:r))/(a=d-1):(a=(i-r)/S,a=Object(v.Q)(a,Math.round(a),S/1e3)?Math.round(a):Math.ceil(a));var C=Math.max(Object(v.R)(S),Object(v.R)(r));n=Math.pow(10,Object(v.Db)(f)?C:f),r=Math.round(r*n)/n,i=Math.round(i*n)/n;var E=0;for(x&&(m&&r!==l?(o.push({value:l}),r0?n:null;this._zero=!0}},{key:"determineDataLimits",value:function(){var e=this,t=e.getMinMax(!0),n=t.min,r=t.max;e.min=Object(v.Ab)(n)?Math.max(0,n):null,e.max=Object(v.Ab)(r)?Math.max(0,r):null,e.options.beginAtZero&&(e._zero=!0),e.handleTickRangeOptions()}},{key:"handleTickRangeOptions",value:function(){var e=this,t=e.getUserBounds(),n=t.minDefined,r=t.maxDefined,i=e.min,a=e.max,o=function(e){return i=n?i:e},s=function(e){return a=r?a:e},c=function(e,t){return Math.pow(10,Math.floor(Object(v.k)(e))+t)};i===a&&(i<=0?(o(1),s(10)):(o(c(i,-1)),s(c(a,1)))),i<=0&&o(c(a,-1)),a<=0&&s(c(i,1)),e._zero&&e.min!==e._suggestedMin&&i===c(e.min,0)&&o(c(i,-1)),e.min=i,e.max=a}},{key:"buildTicks",value:function(){var e=this,t=e.options,n=function(e,t){var n=Math.floor(Object(v.k)(t.max)),r=Math.ceil(t.max/Math.pow(10,n)),i=[],a=Object(v.m)(e.min,Math.pow(10,Math.floor(Object(v.k)(t.min)))),o=Math.floor(Object(v.k)(a)),s=Math.floor(a/Math.pow(10,o)),c=o<0?Math.pow(10,Math.abs(o)):1;do{i.push({value:a,major:Bn(a)}),10===++s&&(s=1,c=++o>=0?1:c),a=Math.round(s*Math.pow(10,o)*c)/c}while(oi?{start:t-n,end:t}:{start:t,end:t+n}}function Vn(e){for(var t,n,r,i={l:0,r:e.width,t:0,b:e.height-e.paddingTop},a={},o=[],s=[],c=e.getLabels().length,l=0;li.r&&(i.r=g.end,a.r=p),b.starti.b&&(i.b=b.end,a.b=p)}e._setReductions(e.drawingArea,i,a),e._pointLabelItems=function(e,t,n){for(var r=[],i=e.getLabels().length,a=e.options,o=Wn(a),s=e.getDistanceFromCenterForValue(a.ticks.reverse?e.min:e.max),c=0;c270||n<90)&&(e-=t),e}function Xn(e,t,n,r){var i=e.ctx;if(n)i.arc(e.xCenter,e.yCenter,t,0,v.u);else{var a=e.getPointPosition(0,t);i.moveTo(a.x,a.y);for(var o=1;o=0&&e=0;i--){var a=r.setContext(e.getPointLabelContext(i)),o=Object(v.y)(a.font),s=e._pointLabelItems[i],c=s.x,l=s.y,u=s.textAlign,f=s.left,d=s.top,h=s.right,p=s.bottom,m=a.backdropColor;if(!Object(v.Db)(m)){var g=Object(v.b)(a.backdropPadding);n.fillStyle=m,n.fillRect(f-g.left,d-g.top,h-f+g.width,p-d+g.height)}Object(v.w)(n,e._pointLabels[i],c,l+o.lineHeight/2,o,{color:a.color,textAlign:u,textBaseline:"middle"})}}(r,c),s.display&&r.ticks.forEach((function(e,n){if(0!==n){t=r.getDistanceFromCenterForValue(e.value);var i=s.setContext(r.getContext(n-1));!function(e,t,n,r){var i=e.ctx,a=t.circular,o=t.color,s=t.lineWidth;!a&&!r||!o||!s||n<0||(i.save(),i.strokeStyle=o,i.lineWidth=s,i.setLineDash(t.borderDash),i.lineDashOffset=t.borderDashOffset,i.beginPath(),Xn(e,n,a,r),i.closePath(),i.stroke(),i.restore())}(r,i,t,c)}})),o.display){for(i.save(),e=r.getLabels().length-1;e>=0;e--){var l=o.setContext(r.getPointLabelContext(e)),u=l.color,f=l.lineWidth;f&&u&&(i.lineWidth=f,i.strokeStyle=u,i.setLineDash(l.borderDash),i.lineDashOffset=l.borderDashOffset,t=r.getDistanceFromCenterForValue(a.ticks.reverse?r.min:r.max),n=r.getPointPosition(e,t),i.beginPath(),i.moveTo(r.xCenter,r.yCenter),i.lineTo(n.x,n.y),i.stroke())}i.restore()}}},{key:"drawBorder",value:function(){}},{key:"drawLabels",value:function(){var e=this,t=e.ctx,n=e.options,r=n.ticks;if(r.display){var i,a,o=e.getIndexAngle(0);t.save(),t.translate(e.xCenter,e.yCenter),t.rotate(o),t.textAlign="center",t.textBaseline="middle",e.ticks.forEach((function(o,s){if(0!==s||n.reverse){var c=r.setContext(e.getContext(s)),l=Object(v.y)(c.font);if(i=e.getDistanceFromCenterForValue(e.ticks[s].value),c.showLabelBackdrop){t.font=l.string,a=t.measureText(o.label).width,t.fillStyle=c.backdropColor;var u=Object(v.b)(c.backdropPadding);t.fillRect(-a/2-u.left,-i-l.size/2-u.top,a+u.width,l.size+u.height)}Object(v.w)(t,o.label,0,-i,l,{color:c.color})}})),t.restore()}}},{key:"drawTitle",value:function(){}}]),n}($n);Gn.id="radialLinear",Gn.defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:$e.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback:function(e){return e},padding:5}},Gn.defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"},Gn.descriptors={angleLines:{_fallback:"grid"}};var Zn={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},Jn=Object.keys(Zn);function er(e,t){return e-t}function tr(e,t){if(Object(v.Db)(t))return null;var n=e._adapter,r=e._parseOpts,i=r.parser,a=r.round,o=r.isoWeekday,s=t;return"function"===typeof i&&(s=i(s)),Object(v.Ab)(s)||(s="string"===typeof i?n.parse(s,i):n.parse(s)),null===s?null:(a&&(s="week"!==a||!Object(v.Jb)(o)&&!0!==o?n.startOf(s,a):n.startOf(s,"isoWeek",o)),+s)}function nr(e,t,n,r){for(var i=Jn.length,a=Jn.indexOf(e);a=t?n[i]:n[a]]=!0}}else e[t]=!0}function ir(e,t,n){var r,i,a=[],o={},s=t.length;for(r=0;r=0&&(t[a].major=!0);return t}(e,a,o,n):a}var ar=function(e){Object(s.a)(n,e);var t=Object(c.a)(n);function n(e){var r;return Object(h.a)(this,n),(r=t.call(this,e))._cache={data:[],labels:[],all:[]},r._unit="day",r._majorUnit=void 0,r._offsets={},r._normalized=!1,r._parseOpts=void 0,r}return Object(p.a)(n,[{key:"init",value:function(e,t){var r=e.time||(e.time={}),i=this._adapter=new Z._date(e.adapters.date);Object(v.K)(r.displayFormats,i.formats()),this._parseOpts={parser:r.parser,round:r.round,isoWeekday:r.isoWeekday},Object(a.a)(Object(o.a)(n.prototype),"init",this).call(this,e),this._normalized=t.normalized}},{key:"parse",value:function(e,t){return void 0===e?null:tr(this,e)}},{key:"beforeLayout",value:function(){Object(a.a)(Object(o.a)(n.prototype),"beforeLayout",this).call(this),this._cache={data:[],labels:[],all:[]}}},{key:"determineDataLimits",value:function(){var e=this,t=e.options,n=e._adapter,r=t.time.unit||"day",i=e.getUserBounds(),a=i.min,o=i.max,s=i.minDefined,c=i.maxDefined;function l(e){s||isNaN(e.min)||(a=Math.min(a,e.min)),c||isNaN(e.max)||(o=Math.max(o,e.max))}s&&c||(l(e._getLabelBounds()),"ticks"===t.bounds&&"labels"===t.ticks.source||l(e.getMinMax(!1))),a=Object(v.Ab)(a)&&!isNaN(a)?a:+n.startOf(Date.now(),r),o=Object(v.Ab)(o)&&!isNaN(o)?o:+n.endOf(Date.now(),r)+1,e.min=Math.min(a,o-1),e.max=Math.max(a+1,o)}},{key:"_getLabelBounds",value:function(){var e=this.getLabelTimestamps(),t=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY;return e.length&&(t=e[0],n=e[e.length-1]),{min:t,max:n}}},{key:"buildTicks",value:function(){var e=this,t=e.options,n=t.time,r=t.ticks,i="labels"===r.source?e.getLabelTimestamps():e._generate();"ticks"===t.bounds&&i.length&&(e.min=e._userMin||i[0],e.max=e._userMax||i[i.length-1]);var a=e.min,o=e.max,s=Object(v.T)(i,a,o);return e._unit=n.unit||(r.autoSkip?nr(n.minUnit,e.min,e.max,e._getLabelCapacity(a)):function(e,t,n,r,i){for(var a=Jn.length-1;a>=Jn.indexOf(n);a--){var o=Jn[a];if(Zn[o].common&&e._adapter.diff(i,r,o)>=t-1)return o}return Jn[n?Jn.indexOf(n):0]}(e,s.length,n.minUnit,e.min,e.max)),e._majorUnit=r.major.enabled&&"year"!==e._unit?function(e){for(var t=Jn.indexOf(e)+1,n=Jn.length;t1e5*l)throw new Error(i+" and "+a+" are too far apart with stepSize of "+l+" "+c);var p="data"===o.ticks.source&&n.getDataTimestamps();for(e=h,t=0;e0?s:1}},{key:"getDataTimestamps",value:function(){var e,t,n=this,r=n._cache.data||[];if(r.length)return r;var i=n.getMatchingVisibleMetas();if(n._normalized&&i.length)return n._cache.data=i[0].controller.getAllParsedValues(n);for(e=0,t=i.length;e=e[s].pos&&t<=e[c].pos){var l=Object(v.Qb)(e,"pos",t);s=l.lo,c=l.hi}var u=e[s];r=u.pos,a=u.time;var f=e[c];i=f.pos,o=f.time}else{if(t>=e[s].time&&t<=e[c].time){var d=Object(v.Qb)(e,"time",t);s=d.lo,c=d.hi}var h=e[s];r=h.time,a=h.pos;var p=e[c];i=p.time,o=p.pos}var m=i-r;return m?a+(o-a)*(t-r)/m:a}ar.id="time",ar.defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",major:{enabled:!1}}};var sr=function(e){Object(s.a)(n,e);var t=Object(c.a)(n);function n(e){var r;return Object(h.a)(this,n),(r=t.call(this,e))._table=[],r._minPos=void 0,r._tableRange=void 0,r}return Object(p.a)(n,[{key:"initOffsets",value:function(){var e=this,t=e._getTimestampsForTable(),r=e._table=e.buildLookupTable(t);e._minPos=or(r,e.min),e._tableRange=or(r,e.max)-e._minPos,Object(a.a)(Object(o.a)(n.prototype),"initOffsets",this).call(this,t)}},{key:"buildLookupTable",value:function(e){var t,n,r,i,a,o=this.min,s=this.max,c=[],l=[];for(t=0,n=e.length;t=o&&i<=s&&c.push(i);if(c.length<2)return[{time:o,pos:0},{time:s,pos:1}];for(t=0,n=c.length;t1&&void 0!==arguments[1]?arguments[1]:166;function r(){for(var r=arguments.length,i=new Array(r),a=0;a=0||(i[n]=e[n]);return i}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(93);var i=n(111),a=n(84);function o(e){return function(e){if(Array.isArray(e))return Object(r.a)(e)}(e)||Object(i.a)(e)||Object(a.a)(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},function(e,t,n){"use strict";n.d(t,"b",(function(){return a}));var r=n(0),i=r.createContext();function a(){return r.useContext(i)}t.a=i},function(e,t,n){"use strict";function r(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return c}));var r=n(4),i=n(6),a="undefined"==typeof Symbol?"__\u037c":Symbol.for("\u037c"),o="undefined"==typeof Symbol?"__styleSet"+Math.floor(1e8*Math.random()):Symbol("styleSet"),s="undefined"==typeof e?window:e,c=function(){function e(t,n){Object(r.a)(this,e),this.rules=[];var i=n||{},a=i.process,o=i.extend;function s(e){if(/^@/.test(e))return[e];var t=e.split(",");return a?t.map(a):t}function c(e,t,n){var r=[],i=/^@(\w+)\b/.exec(e[0]);if(i&&null==t)return n.push(e[0]+";");var a=function(a){var l=t[a];if(/&/.test(a))c(e.map((function(e){return o?o(a,e):a.replace(/&/,e)})),l,n);else if(l&&"object"==typeof l){if(!i)throw new RangeError("The value of a property ("+a+") should be a primitive value.");c("keyframes"==i[1]?[a]:s(a),l,r)}else null!=l&&r.push(a.replace(/_.*/,"").replace(/[A-Z]/g,(function(e){return"-"+e.toLowerCase()}))+": "+l+";")};for(var l in t)a(l);(r.length||i&&"keyframes"==i[1])&&n.push(e.join(",")+" {"+r.join(" ")+"}")}for(var l in t)c(s(l),t[l],this.rules)}return Object(i.a)(e,null,[{key:"newName",value:function(){var e=s[a]||1;return s[a]=e+1,"\u037c"+e.toString(36)}},{key:"mount",value:function(e,t){(e[o]||new u(e)).mount(Array.isArray(t)?t:[t])}}]),e}(),l=null,u=function(){function e(t){if(Object(r.a)(this,e),t.adoptedStyleSheets&&"undefined"!=typeof CSSStyleSheet){if(l)return t.adoptedStyleSheets=[l.sheet].concat(t.adoptedStyleSheets),t[o]=l;this.sheet=new CSSStyleSheet,t.adoptedStyleSheets=[this.sheet].concat(t.adoptedStyleSheets),l=this}else{this.styleTag=(t.ownerDocument||t).createElement("style");var n=t.head||t;n.insertBefore(this.styleTag,n.firstChild)}this.modules=[],t[o]=this}return Object(i.a)(e,[{key:"mount",value:function(e){for(var t=this.sheet,n=0,r=0,i=0;i-1&&(this.modules.splice(o,1),r--,o=-1),-1==o){if(this.modules.splice(r++,0,a),t)for(var s=0;s0&&m(t.state,c.head-1,1,o)||o.afterCursor&&(m(t.state,c.head,1,o)||c.head0&&void 0!==arguments[0]?arguments[0]:{};return[u.of(e),h]}function v(e,t,n){var r=e.prop(t<0?o.c.openedBy:o.c.closedBy);if(r)return r;if(1==e.name.length){var i=n.indexOf(e.name);if(i>-1&&i%2==(t<0?1:0))return[n[i+t]]}return null}function m(e,t,n){var r,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=i.maxScanDistance||c,o=i.brackets||l,s=e.tree,u=s.resolve(t,n);return(r=v(u.type,n,o))?g(e,t,n,u,r,o):b(e,t,n,s,u.type,a,o)}function g(e,t,n,r,i,a){var o=r.parent,s={from:r.start,to:r.end},c=0;return o&&o.iterate({from:n<0?r.start:r.end,to:n<0?o.start:o.end,enter:function(e,t,o){if(!(n<0?o>r.start:t-1)return{start:s,end:{from:t,to:o},matched:!0};if(v(e,n,a))c++;else if(v(e,-n,a)&&0==--c)return{start:s,end:{from:t,to:o},matched:!1};return!1}}})||{start:s,matched:!1}}function b(e,t,n,r,i,a,o){var s=n<0?e.sliceDoc(t-1,t):e.sliceDoc(t,t+1),c=o.indexOf(s);if(c<0||c%2==0!=n>0)return null;for(var l={from:n<0?t-1:t,to:n>0?t+1:t},u=e.doc.iterRange(t,n>0?e.doc.length:0),f=0,d=0;!u.next().done&&d<=a;){var h=u.value;n<0&&(d+=h.length);for(var p=t+d*n,v=n>0?0:h.length-1,m=n>0?h.length:-1;v!=m;v+=n){var g=o.indexOf(h[v]);if(!(g<0||r.resolve(p+v,1).type!=i))if(g%2==0==n>0)f++;else{if(1==f)return{start:l,end:{from:p+v,to:p+v+1},matched:g>>1==c>>1};f--}}n>0&&(d+=h.length)}return u.done?{start:l,matched:!1}:null}},function(e,t,n){"use strict";n.d(t,"a",(function(){return p}));var r=n(0),i=n(26),a=!0,o=!1,s=null,c={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,"datetime-local":!0};function l(e){e.metaKey||e.altKey||e.ctrlKey||(a=!0)}function u(){a=!1}function f(){"hidden"===this.visibilityState&&o&&(a=!0)}function d(e){var t=e.target;try{return t.matches(":focus-visible")}catch(n){}return a||function(e){var t=e.type,n=e.tagName;return!("INPUT"!==n||!c[t]||e.readOnly)||"TEXTAREA"===n&&!e.readOnly||!!e.isContentEditable}(t)}function h(){o=!0,window.clearTimeout(s),s=window.setTimeout((function(){o=!1}),100)}function p(){return{isFocusVisible:d,onBlurVisible:h,ref:r.useCallback((function(e){var t,n=i.findDOMNode(e);null!=n&&((t=n.ownerDocument).addEventListener("keydown",l,!0),t.addEventListener("mousedown",u,!0),t.addEventListener("pointerdown",u,!0),t.addEventListener("touchstart",u,!0),t.addEventListener("visibilitychange",f,!0))}),[])}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(29);function i(e){return Object(r.a)(e).defaultView||window}},function(e,t,n){"use strict";var r=n(199),i=Object(r.a)();t.a=i},function(e,t,n){"use strict";var r=n(344);t.a=function(e,t){return t?Object(r.a)(e,t,{clone:!1}):e}},function(e,t,n){"use strict";var r=n(0),i=r.createContext();t.a=i},,function(e,t,n){"use strict";e.exports=n(232)},function(e,t,n){var r=n(247),i=n(252);e.exports=function(e,t){var n=i(e,t);return r(n)?n:void 0}},function(e,t){e.exports=function(e){return null!=e&&"object"==typeof e}},function(e,t,n){"use strict";function r(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";function r(e){return null!=e&&!(Array.isArray(e)&&0===e.length)}function i(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return e&&(r(e.value)&&""!==e.value||t&&r(e.defaultValue)&&""!==e.defaultValue)}function a(e){return e.startAdornment}n.d(t,"b",(function(){return i})),n.d(t,"a",(function(){return a}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return J})),n.d(t,"b",(function(){return ee})),n.d(t,"c",(function(){return K}));n(20);var r=n(25),i=n(16),a=n(15),o=n(7),s=n(4),c=n(6),l=n(94),u=n(5),f=n(10),d=n(18),h=function(){function e(t,n,r){Object(s.a)(this,e),this.state=t,this.pos=n,this.explicit=r,this.abortListeners=[]}return Object(c.a)(e,[{key:"tokenBefore",value:function(e){for(var t=this.state.tree.resolve(this.pos,-1);t&&e.indexOf(t.name)<0;)t=t.parent;return t?{from:t.start,to:this.pos,text:this.state.sliceDoc(t.start,this.pos),type:t.type}:null}},{key:"matchBefore",value:function(e){var t=this.state.doc.lineAt(this.pos),n=Math.max(t.from,this.pos-250),r=t.slice(n-t.from,this.pos-t.from),i=r.search(m(e,!1));return i<0?null:{from:n+i,to:this.pos,text:r.slice(i)}}},{key:"addEventListener",value:function(e,t){this.abortListeners&&this.abortListeners.push(t)}},{key:"aborted",get:function(){return null==this.abortListeners}}]),e}(),p=function e(t,n,r){Object(s.a)(this,e),this.completion=t,this.source=n,this.match=r};function v(e){return e.selection.primary.head}function m(e,t){var n,r=e.source,i=t&&"^"!=r[0],a="$"!=r[r.length-1];return i||a?new RegExp("".concat(i?"^":"","(?:").concat(r,")").concat(a?"$":""),null!==(n=e.flags)&&void 0!==n?n:e.ignoreCase?"i":""):e}function g(e,t){var n=t.completion.apply||t.completion.label,r=t.source;"string"==typeof n?e.dispatch({changes:{from:r.from,to:r.to,insert:n},selection:{anchor:r.from+n.length}}):n(e,t.completion,r.from,r.to)}var b=function(){function e(t){Object(s.a)(this,e),this.pattern=t,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[];for(var n=0;n=48&&w<=57||w>=97&&w<=122?2:w>=65&&w<=90?1:0:(j=Object(d.f)(w))!=j.toLowerCase()?1:j!=j.toUpperCase()?2:0;(1==S||0==k&&0!=S&&(this.chars[v]==w||this.folded[v]==w&&(m=!0)))&&(a[v++]=O),k=S,O+=Object(d.c)(w)}return v==c&&0==a[0]?this.result((m?-200:0)-100,a,e):g==c&&0==b?[-200,0,y]:s>-1?[-700,s,s+this.pattern.length]:g==c?[-900,b,y]:v==c?this.result((m?-200:0)-100-700,a,e):2==t.length?null:this.result((r[0]?-700:0)-200-1100,r,e)}},{key:"result",value:function(e,t,n){var r,i=[e],a=1,s=Object(o.a)(t);try{for(s.s();!(r=s.n()).done;){var c=r.value,l=c+(this.astral?Object(d.c)(Object(d.b)(n,c)):1);a>1&&i[a-1]==c?i[a-1]=l:(i[a++]=c,i[a++]=l)}}catch(u){s.e(u)}finally{s.f()}return i}}]),e}(),y=u.f.define({combine:function(e){return Object(u.m)(e,{activateOnTyping:!0,override:null,maxRenderedOptions:100})}}),O=f.d.baseTheme({"$tooltip.autocomplete":{"& > ul":{fontFamily:"monospace",overflowY:"auto",whiteSpace:"nowrap",maxHeight:"10em",listStyle:"none",margin:0,padding:0,"& > li":{cursor:"pointer",padding:"1px 1em 1px 3px",lineHeight:1.2},"& > li[aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"}}},"$completionListIncompleteTop:before, $completionListIncompleteBottom:after":{content:'"\xb7\xb7\xb7"',opacity:.5,display:"block",textAlign:"center"},"$tooltip.completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"300px"},"$tooltip.completionInfo.left":{right:"100%"},"$tooltip.completionInfo.right":{left:"100%"},"$$light $snippetField":{backgroundColor:"#ddd"},"$$dark $snippetField":{backgroundColor:"#333"},$snippetFieldPosition:{verticalAlign:"text-top",width:0,height:"1.15em",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},$completionMatchedText:{textDecoration:"underline"},$completionDetail:{marginLeft:"0.5em",fontStyle:"italic"},$completionIcon:{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6"},"$completionIcon.function, $completionIcon.method":{"&:after":{content:"'\u0192'"}},"$completionIcon.class":{"&:after":{content:"'\u25cb'"}},"$completionIcon.interface":{"&:after":{content:"'\u25cc'"}},"$completionIcon.variable":{"&:after":{content:"'\ud835\udc65'"}},"$completionIcon.constant":{"&:after":{content:"'\ud835\udc36'"}},"$completionIcon.type":{"&:after":{content:"'\ud835\udc61'"}},"$completionIcon.enum":{"&:after":{content:"'\u222a'"}},"$completionIcon.property":{"&:after":{content:"'\u25a1'"}},"$completionIcon.keyword":{"&:after":{content:"'\ud83d\udd11\ufe0e'"}},"$completionIcon.namespace":{"&:after":{content:"'\u25a2'"}},"$completionIcon.text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});function x(e,t,n){var r=document.createElement("ul");r.id=t,r.setAttribute("role","listbox"),r.setAttribute("aria-expanded","true");for(var i=n.from;ip&&u.appendChild(document.createTextNode(d.slice(p,m)));var b=u.appendChild(document.createElement("span"));b.appendChild(document.createTextNode(d.slice(m,g))),b.className=Object(f.n)("completionMatchedText"),p=g}if(p>1){var r=Math.floor(t/n);return{from:r*n,to:(r+1)*n}}var i=Math.floor((e-t)/n);return{from:e-(i+1)*n,to:e-i*n}}var w=function(){function e(t,n){var r=this;Object(s.a)(this,e),this.view=t,this.stateField=n,this.info=null,this.placeInfo={read:function(){return r.measureInfo()},write:function(e){return r.positionInfo(e)},key:this};var i=t.state.field(n),a=i.open,o=a.options,c=a.selected,l=t.state.facet(y);this.range=k(o.length,c,l.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.addEventListener("mousedown",(function(e){for(var n=r.range.from,i=e.target;i&&i!=r.list&&i.parentNode!=r.list;)i=i.parentNode;for(;i=i.previousSibling;)n++;n>=0&&n=this.range.to)&&(this.range=k(n.options.length,n.selected,this.view.state.facet(y).maxRenderedOptions),this.list.remove(),this.list=this.dom.appendChild(x(n.options,t.id,this.range)),this.list.addEventListener("scroll",(function(){e.info&&e.view.requestMeasure(e.placeInfo)}))),this.updateSelectedOption(n.selected)){this.info&&(this.info.remove(),this.info=null);var r=n.options[n.selected];r.completion.info&&(this.info=this.dom.appendChild(function(e){var t=document.createElement("div");t.className=Object(f.n)("tooltip.completionInfo");var n=e.completion.info;return"string"==typeof n?t.textContent=n:t.appendChild(n(e.completion)),t}(r)),this.view.requestMeasure(this.placeInfo))}}},{key:"updateSelectedOption",value:function(e){for(var t=null,n=this.list.firstChild,r=this.range.from;n;n=n.nextSibling,r++)r==e?n.hasAttribute("aria-selected")||(n.setAttribute("aria-selected","true"),t=n):n.hasAttribute("aria-selected")&&n.removeAttribute("aria-selected");return t&&function(e,t){var n=e.getBoundingClientRect(),r=t.getBoundingClientRect();r.topn.bottom&&(e.scrollTop+=r.bottom-n.bottom)}(this.list,t),t}},{key:"measureInfo",value:function(){var e=this.dom.querySelector("[aria-selected]");if(!e)return null;var t=this.dom.getBoundingClientRect(),n=e.getBoundingClientRect().top-t.top;if(n<0||n>this.list.clientHeight-10)return null;var r=this.view.textDirection==f.c.RTL,i=t.left,a=innerWidth-t.right;return r&&i=this.options.length?this:new e(this.options,C(n,t),this.tooltip,this.timestamp,t)}},{key:"map",value:function(t){return new e(this.options,this.attrs,[Object.assign(Object.assign({},this.tooltip[0]),{pos:t.mapPos(this.tooltip[0].pos)})],this.timestamp,this.selected)}}],[{key:"build",value:function(t,n,r,i){var a=function(e,t){var n,r=[],i=Object(o.a)(e);try{for(i.s();!(n=i.n()).done;){var a=n.value;if(a.hasResult()){var s,c=new b(t.sliceDoc(a.from,a.to)),l=void 0,u=Object(o.a)(a.result.options);try{for(u.s();!(s=u.n()).done;){var f=s.value;(l=c.match(f.label))&&(null!=f.boost&&(l[0]+=f.boost),r.push(new p(f,a,l)))}}catch(d){u.e(d)}finally{u.f()}}}}catch(d){i.e(d)}finally{i.f()}return r.sort(P),r.length>300?r.slice(0,300):r}(t,n);if(!a.length)return null;var s,c=0;if(i)for(var l=i.options[i.selected].completion,u=0;ua?new T(this.source,"input"==t&&r.activateOnTyping?1:0,!1):this.span&&(i==a||this.span.test(e.state.sliceDoc(i,a)))?new n(this.source,this.explicit,this.result,i,a,this.span):new T(this.source,1,this.explicit)}},{key:"handleChange",value:function(e){return e.changes.touchesRange(this.from,this.to)?new T(this.source,0,!1):new n(this.source,this.explicit,this.result,e.changes.mapPos(this.from),e.changes.mapPos(this.to,1),this.span)}},{key:"map",value:function(e){return new n(this.source,this.explicit,this.result,e.mapPos(this.from),e.mapPos(this.to,1),this.span)}}]),n}(T),D=u.i.define(),A=u.i.define({map:function(e,t){return e.map((function(e){return e.hasResult()&&!t.empty?e.map(t):e}))}}),R=u.i.define(),L=u.j.define({create:function(){return S.start()},update:function(e,t){return e.update(t)},provide:[l.b.nFrom((function(e){return e.tooltip})),f.d.contentAttributes.from((function(e){return e.attrs}))]});function N(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"option";return function(n){var r=n.state.field(L,!1);if(!r||!r.open||Date.now()-r.open.timestamp<75)return!1;var i,a=1;"page"==t&&(i=n.dom.querySelector(".cm-tooltip-autocomplete"))&&(a=Math.max(2,Math.floor(i.offsetHeight/i.firstChild.offsetHeight)));var o=r.open.selected+a*(e?1:-1),s=r.open.options.length;return o<0?o="page"==t?0:s-1:o>=s&&(o="page"==t?s-1:0),n.dispatch({effects:R.of(o)}),!0}}var I=function(e){var t=e.state.field(L,!1);return!(!t||!t.open||Date.now()-t.open.timestamp<75)&&(g(e,t.open.options[t.open.selected]),!0)},z=function e(t,n){Object(s.a)(this,e),this.source=t,this.context=n,this.time=Date.now(),this.updates=[],this.done=void 0},$=f.f.fromClass(function(){function e(t){Object(s.a)(this,e),this.view=t,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1;var n,r=Object(o.a)(t.state.field(L).active);try{for(r.s();!(n=r.n()).done;){var i=n.value;1==i.state&&this.startQuery(i)}}catch(a){r.e(a)}finally{r.f()}}return Object(c.a)(e,[{key:"update",value:function(e){var t=this,n=e.state.field(L);if(e.selectionSet||e.docChanged||e.prevState.field(L)!=n){for(var i=e.transactions.some((function(e){var t=e.annotation(u.l.userEvent);return(e.selection||e.docChanged)&&"input"!=t&&"delete"!=t})),a=0;a50&&s.time-Date.now()>1e3){var c,l=Object(o.a)(s.context.abortListeners);try{for(l.s();!(c=l.n()).done;){var d=c.value;try{d()}catch(p){Object(f.l)(this.view.state,p)}}}catch(v){l.e(v)}finally{l.f()}s.context.abortListeners=null,this.running.splice(a--,1)}else{var h;(h=s.updates).push.apply(h,Object(r.a)(e.transactions))}}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),this.debounceUpdate=n.active.some((function(e){return 1==e.state&&!t.running.some((function(t){return t.source==e.source}))}))?setTimeout((function(){return t.startUpdate()}),50):-1}}},{key:"startUpdate",value:function(){var e=this;this.debounceUpdate=-1;var t,n=this.view.state.field(L),r=Object(o.a)(n.active);try{var i=function(){var n=t.value;1!=n.state||e.running.some((function(e){return e.source==n.source}))||e.startQuery(n)};for(r.s();!(t=r.n()).done;)i()}catch(a){r.e(a)}finally{r.f()}}},{key:"startQuery",value:function(e){var t=this,n=this.view.state,r=v(n),i=new h(n,r,e.explicit),a=new z(e.source,i);this.running.push(a),Promise.resolve(e.source(i)).then((function(e){a.context.aborted||(a.done=e||null,t.scheduleAccept())}),(function(e){t.view.dispatch({effects:D.of(!1)}),Object(f.l)(t.view.state,e)}))}},{key:"scheduleAccept",value:function(){var e=this;this.running.every((function(e){return void 0!==e.done}))?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout((function(){return e.accept()}),50))}},{key:"accept",value:function(){var e,t=this;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;for(var n=[],r=this.view.state.facet(y),i=function(i){var s=t.running[i];if(void 0===s.done)return a=i,"continue";if(t.running.splice(i--,1),s.done){var c,l=new _(s.source,s.context.explicit,s.done,s.done.from,null!==(e=s.done.to)&&void 0!==e?e:v(s.updates.length?s.updates[0].startState:t.view.state),s.done.span?m(s.done.span,!0):null),u=Object(o.a)(s.updates);try{for(u.s();!(c=u.n()).done;){var f=c.value;l=l.update(f,r)}}catch(y){u.e(y)}finally{u.f()}if(l.hasResult())return n.push(l),a=i,"continue"}var d=t.view.state.field(L).active.find((function(e){return e.source==s.source}));if(d&&1==d.state)if(null==s.done){var h,p=new T(s.source,0,!1),g=Object(o.a)(s.updates);try{for(g.s();!(h=g.n()).done;){var b=h.value;p=p.update(b,r)}}catch(y){g.e(y)}finally{g.f()}1!=p.state&&n.push(p)}else t.startQuery(d);a=i},a=0;a=e.to}))}))}}]),e}(),U=u.i.define({map:function(e,t){return e&&e.map(t)}}),q=u.i.define(),Y=u.j.define({create:function(){return null},update:function(e,t){var n,r=Object(o.a)(t.effects);try{for(r.s();!(n=r.n()).done;){var i=n.value;if(i.is(U))return i.value;if(i.is(q)&&e)return new V(e.ranges,i.value)}}catch(a){r.e(a)}finally{r.f()}return e&&t.docChanged&&(e=e.map(t.changes)),e&&t.selection&&!e.selectionInsideField(t.selection)&&(e=null),e},provide:[f.d.decorations.from((function(e){return e?e.deco:f.b.none}))]});function X(e,t){return u.d.create(e.filter((function(e){return e.field==t})).map((function(e){return u.d.range(e.from,e.to)})))}function K(e){var t=Q.parse(e);return function(e,n,r,i){var a=t.instantiate(e.state,r),o=a.text,s=a.ranges,c={changes:{from:r,to:i,insert:u.k.of(o)}};s.length&&(c.selection=X(s,0)),s.length>1&&(c.effects=U.of(new V(s,0)),void 0===e.state.field(Y,!1)&&(c.reconfigure={append:[Y,Z,O]})),e.dispatch(e.state.update(c))}}function G(e){return function(t){var n=t.state,r=t.dispatch,i=n.field(Y,!1);if(!i||e<0&&0==i.active)return!1;var a=i.active+e,o=e>0&&!i.ranges.some((function(t){return t.field==a+e}));return r(n.update({selection:X(i.ranges,a),effects:U.of(o?null:new V(i.ranges,a))})),!0}}var Z=Object(u.o)(Object(f.k)([{key:"Tab",run:G(1),shift:G(-1)},{key:"Escape",run:function(e){var t=e.state,n=e.dispatch;return!!t.field(Y,!1)&&(n(t.update({effects:U.of(null)})),!0)}}]),"override");function J(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return[L,y.of(e),$,O,Object(l.c)(),Object(u.o)(Object(f.k)([{key:"ArrowDown",run:N(!0)},{key:"ArrowUp",run:N(!1)},{key:"PageDown",run:N(!0,"page")},{key:"PageUp",run:N(!1,"page")},{key:"Enter",run:I}]),"override")]}var ee=[{key:"Mod-Space",run:function(e){return!!e.state.field(L,!1)&&(e.dispatch({effects:D.of(!0)}),!0)}},{key:"Escape",run:function(e){var t=e.state.field(L,!1);return!(!t||!t.active.some((function(e){return 0!=e.state})))&&(e.dispatch({effects:D.of(!1)}),!0)}}]},,,function(e,t,n){var r=n(99),i=n(248),a=n(249),o=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":o&&o in Object(e)?i(e):a(e)}},function(e,t,n){var r=n(133),i=n(138);e.exports=function(e){return null!=e&&i(e.length)&&!r(e)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(92);function i(e,t){if(e){if("string"===typeof e)return Object(r.a)(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Object(r.a)(e,t):void 0}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(93);function i(e,t){if(e){if("string"===typeof e)return Object(r.a)(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Object(r.a)(e,t):void 0}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(0);function i(e,t){return r.isValidElement(e)&&-1!==t.indexOf(e.type.muiName)}},function(e,t,n){"use strict";var r=n(0),i=n.n(r);t.a=i.a.createContext(null)},function(e,t,n){var r;!function(i,a,o,s){"use strict";var c,l=["","webkit","Moz","MS","ms","o"],u=a.createElement("div"),f=Math.round,d=Math.abs,h=Date.now;function p(e,t,n){return setTimeout(x(e,n),t)}function v(e,t,n){return!!Array.isArray(e)&&(m(e,n[t],n),!0)}function m(e,t,n){var r;if(e)if(e.forEach)e.forEach(t,n);else if(e.length!==s)for(r=0;r\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",a=i.console&&(i.console.warn||i.console.log);return a&&a.call(i.console,r,n),e.apply(this,arguments)}}c="function"!==typeof Object.assign?function(e){if(e===s||null===e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=1;n-1}function M(e){return e.trim().split(/\s+/g)}function P(e,t,n){if(e.indexOf&&!n)return e.indexOf(t);for(var r=0;rn[t]})):r.sort()),r}function D(e,t){for(var n,r,i=t[0].toUpperCase()+t.slice(1),a=0;a1&&!n.firstMultiple?n.firstMultiple=V(t):1===i&&(n.firstMultiple=!1);var a=n.firstInput,o=n.firstMultiple,c=o?o.center:a.center,l=t.center=U(r);t.timeStamp=h(),t.deltaTime=t.timeStamp-a.timeStamp,t.angle=K(c,l),t.distance=X(c,l),function(e,t){var n=t.center,r=e.offsetDelta||{},i=e.prevDelta||{},a=e.prevInput||{};1!==t.eventType&&4!==a.eventType||(i=e.prevDelta={x:a.deltaX||0,y:a.deltaY||0},r=e.offsetDelta={x:n.x,y:n.y});t.deltaX=i.x+(n.x-r.x),t.deltaY=i.y+(n.y-r.y)}(n,t),t.offsetDirection=Y(t.deltaX,t.deltaY);var u=q(t.deltaTime,t.deltaX,t.deltaY);t.overallVelocityX=u.x,t.overallVelocityY=u.y,t.overallVelocity=d(u.x)>d(u.y)?u.x:u.y,t.scale=o?(f=o.pointers,p=r,X(p[0],p[1],Q)/X(f[0],f[1],Q)):1,t.rotation=o?function(e,t){return K(t[1],t[0],Q)+K(e[1],e[0],Q)}(o.pointers,r):0,t.maxPointers=n.prevInput?t.pointers.length>n.prevInput.maxPointers?t.pointers.length:n.prevInput.maxPointers:t.pointers.length,function(e,t){var n,r,i,a,o=e.lastInterval||t,c=t.timeStamp-o.timeStamp;if(8!=t.eventType&&(c>25||o.velocity===s)){var l=t.deltaX-o.deltaX,u=t.deltaY-o.deltaY,f=q(c,l,u);r=f.x,i=f.y,n=d(f.x)>d(f.y)?f.x:f.y,a=Y(l,u),e.lastInterval=t}else n=o.velocity,r=o.velocityX,i=o.velocityY,a=o.direction;t.velocity=n,t.velocityX=r,t.velocityY=i,t.direction=a}(n,t);var f,p;var v=e.element;C(t.srcEvent.target,v)&&(v=t.srcEvent.target);t.target=v}(e,n),e.emit("hammer.input",n),e.recognize(n),e.session.prevInput=n}function V(e){for(var t=[],n=0;n=d(t)?e<0?2:4:t<0?8:16}function X(e,t,n){n||(n=B);var r=t[n[0]]-e[n[0]],i=t[n[1]]-e[n[1]];return Math.sqrt(r*r+i*i)}function K(e,t,n){n||(n=B);var r=t[n[0]]-e[n[0]],i=t[n[1]]-e[n[1]];return 180*Math.atan2(i,r)/Math.PI}W.prototype={handler:function(){},init:function(){this.evEl&&j(this.element,this.evEl,this.domHandler),this.evTarget&&j(this.target,this.evTarget,this.domHandler),this.evWin&&j(R(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&S(this.element,this.evEl,this.domHandler),this.evTarget&&S(this.target,this.evTarget,this.domHandler),this.evWin&&S(R(this.element),this.evWin,this.domHandler)}};var G={mousedown:1,mousemove:2,mouseup:4},Z="mousedown",J="mousemove mouseup";function ee(){this.evEl=Z,this.evWin=J,this.pressed=!1,W.apply(this,arguments)}O(ee,W,{handler:function(e){var t=G[e.type];1&t&&0===e.button&&(this.pressed=!0),2&t&&1!==e.which&&(t=4),this.pressed&&(4&t&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:$,srcEvent:e}))}});var te={pointerdown:1,pointermove:2,pointerup:4,pointercancel:8,pointerout:8},ne={2:z,3:"pen",4:$,5:"kinect"},re="pointerdown",ie="pointermove pointerup pointercancel";function ae(){this.evEl=re,this.evWin=ie,W.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}i.MSPointerEvent&&!i.PointerEvent&&(re="MSPointerDown",ie="MSPointerMove MSPointerUp MSPointerCancel"),O(ae,W,{handler:function(e){var t=this.store,n=!1,r=e.type.toLowerCase().replace("ms",""),i=te[r],a=ne[e.pointerType]||e.pointerType,o=a==z,s=P(t,e.pointerId,"pointerId");1&i&&(0===e.button||o)?s<0&&(t.push(e),s=t.length-1):12&i&&(n=!0),s<0||(t[s]=e,this.callback(this.manager,i,{pointers:t,changedPointers:[e],pointerType:a,srcEvent:e}),n&&t.splice(s,1))}});var oe={touchstart:1,touchmove:2,touchend:4,touchcancel:8},se="touchstart",ce="touchstart touchmove touchend touchcancel";function le(){this.evTarget=se,this.evWin=ce,this.started=!1,W.apply(this,arguments)}function ue(e,t){var n=T(e.touches),r=T(e.changedTouches);return 12&t&&(n=_(n.concat(r),"identifier",!0)),[n,r]}O(le,W,{handler:function(e){var t=oe[e.type];if(1===t&&(this.started=!0),this.started){var n=ue.call(this,e,t);12&t&&n[0].length-n[1].length===0&&(this.started=!1),this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:z,srcEvent:e})}}});var fe={touchstart:1,touchmove:2,touchend:4,touchcancel:8},de="touchstart touchmove touchend touchcancel";function he(){this.evTarget=de,this.targetIds={},W.apply(this,arguments)}function pe(e,t){var n=T(e.touches),r=this.targetIds;if(3&t&&1===n.length)return r[n[0].identifier]=!0,[n,n];var i,a,o=T(e.changedTouches),s=[],c=this.target;if(a=n.filter((function(e){return C(e.target,c)})),1===t)for(i=0;i-1&&r.splice(e,1)}),2500)}}function be(e){for(var t=e.srcEvent.clientX,n=e.srcEvent.clientY,r=0;r-1&&this.requireFail.splice(t,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(e){return!!this.simultaneous[e.id]},emit:function(e){var t=this,n=this.state;function r(n){t.manager.emit(n,e)}n<8&&r(t.options.event+_e(n)),r(t.options.event),e.additionalEvent&&r(e.additionalEvent),n>=8&&r(t.options.event+_e(n))},tryEmit:function(e){if(this.canEmit())return this.emit(e);this.state=Pe},canEmit:function(){for(var e=0;et.threshold&&i&t.direction},attrTest:function(e){return Re.prototype.attrTest.call(this,e)&&(2&this.state||!(2&this.state)&&this.directionTest(e))},emit:function(e){this.pX=e.deltaX,this.pY=e.deltaY;var t=De(e.direction);t&&(e.additionalEvent=this.options.event+t),this._super.emit.call(this,e)}}),O(Ne,Re,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[je]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.scale-1)>this.options.threshold||2&this.state)},emit:function(e){if(1!==e.scale){var t=e.scale<1?"in":"out";e.additionalEvent=this.options.event+t}this._super.emit.call(this,e)}}),O(Ie,Te,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[ke]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,r=e.distancet.time;if(this._input=e,!r||!n||12&e.eventType&&!i)this.reset();else if(1&e.eventType)this.reset(),this._timer=p((function(){this.state=8,this.tryEmit()}),t.time,this);else if(4&e.eventType)return 8;return Pe},reset:function(){clearTimeout(this._timer)},emit:function(e){8===this.state&&(e&&4&e.eventType?this.manager.emit(this.options.event+"up",e):(this._input.timeStamp=h(),this.manager.emit(this.options.event,this._input)))}}),O(ze,Re,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[je]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.rotation)>this.options.threshold||2&this.state)}}),O($e,Re,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:30,pointers:1},getTouchAction:function(){return Le.prototype.getTouchAction.call(this)},attrTest:function(e){var t,n=this.options.direction;return 30&n?t=e.overallVelocity:6&n?t=e.overallVelocityX:n&F&&(t=e.overallVelocityY),this._super.attrTest.call(this,e)&&n&e.offsetDirection&&e.distance>this.options.threshold&&e.maxPointers==this.options.pointers&&d(t)>this.options.velocity&&4&e.eventType},emit:function(e){var t=De(e.offsetDirection);t&&this.manager.emit(this.options.event+t,e),this.manager.emit(this.options.event,e)}}),O(Fe,Te,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[we]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,r=e.distancee.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n=t.bottom||s.right<=t.left||s.left>=t.right)a.style.top="-10000px";else{var l=c.right-c.left,u=c.bottom-c.top,f=this.view.textDirection==o.c.LTR?Math.min(s.left,e.innerWidth-l):Math.max(0,s.left-l),d=!!r.above;!r.strictSide&&(d?s.top-(c.bottom-c.top)<0:s.bottom+(c.bottom-c.top)>e.innerHeight)&&(d=!d),a.style.top=(d?s.top-u:s.bottom)+"px",a.style.left=f+"px",a.classList.toggle("cm-tooltip-above",d),a.classList.toggle("cm-tooltip-below",!d),i.positioned&&i.positioned()}}}},{key:"maybeMeasure",value:function(){this.tooltips.length&&((this.view.inView||this.inView)&&this.view.requestMeasure(this.measureReq),this.inView=this.view.inView)}}]),e}(),{eventHandlers:{scroll:function(){this.maybeMeasure()}}}),l=o.d.baseTheme({$tooltip:{position:"fixed",border:"1px solid #ddd",backgroundColor:"#f5f5f5",zIndex:100}});function u(){return[c,l]}var f=s.f.define(),d=function(){function e(t,n,r,a){Object(i.a)(this,e),this.view=t,this.source=n,this.field=r,this.setHover=a,this.lastMouseMove=null,this.hoverTimeout=-1,this.mouseInside=!1,this.checkHover=this.checkHover.bind(this),t.dom.addEventListener("mouseenter",this.mouseenter=this.mouseenter.bind(this)),t.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),t.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}return Object(a.a)(e,[{key:"checkHover",value:function(){var e=this;if(this.hoverTimeout=-1,this.mouseInside&&!this.active){var t=Date.now(),n=this.lastMouseMove;if(t-n.timeStamp<750)this.hoverTimeout=setTimeout(this.checkHover,750-(t-n.timeStamp));else{var r=this.view.contentDOM.contains(n.target)?this.view.posAtCoords({x:n.clientX,y:n.clientY}):-1,i=r<0?null:this.source(this.view,(function(t,i){return t<=r&&i>=r&&(t==i||h(e.view,t,i,n.clientX,n.clientY))}));i&&this.view.dispatch({effects:this.setHover.of(i)})}}}},{key:"mousemove",value:function(e){var t;this.lastMouseMove=e,this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,750));var n=this.active;if(n&&!function(e){for(var t=e;t;t=t.parentNode)if(1==t.nodeType&&t.classList.contains("cm-tooltip"))return!0;return!1}(e.target)){var r=n.pos,i=null!==(t=n.end)&&void 0!==t?t:r;(r==i?this.view.posAtCoords({x:e.clientX,y:e.clientY})==r:h(this.view,r,i,e.clientX,e.clientY,10))||this.view.dispatch({effects:this.setHover.of(null)})}}},{key:"mouseenter",value:function(){this.mouseInside=!0}},{key:"mouseleave",value:function(){this.mouseInside=!1,this.active&&this.view.dispatch({effects:this.setHover.of(null)})}},{key:"destroy",value:function(){this.view.dom.removeEventListener("mouseenter",this.mouseenter),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}},{key:"active",get:function(){return this.view.state.field(this.field)}}]),e}();function h(e,t,n,r,i){var a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,o=document.createRange(),s=e.domAtPos(t),c=e.domAtPos(n);o.setEnd(c.node,c.offset),o.setStart(s.node,s.offset);for(var l=o.getClientRects(),u=0;u1&&void 0!==arguments[1]?arguments[1]:{},n=s.i.define(),i=s.j.define({create:function(){return null},update:function(e,i){if(e&&t.hideOnChange&&(i.docChanged||i.selection))return null;var a,o=Object(r.a)(i.effects);try{for(o.s();!(a=o.n()).done;){var c=a.value;if(c.is(n))return c.value}}catch(f){o.e(f)}finally{o.f()}if(e&&i.docChanged){var l=i.changes.mapPos(e.pos,-1,s.h.TrackDel);if(l<0)return null;var u=Object.assign(Object.create(null),e);return u.pos=l,null!=e.end&&(u.end=i.changes.mapPos(e.end)),u}return e},provide:[f.nFrom((function(e){return e?[e]:[]}))]});return[i,o.f.define((function(t){return new d(t,e,i,n)})),u()]}},function(e,t,n){"use strict";var r=n(2),i=n(8),a=n(0),o=(n(12),n(9)),s=n(11),c=n(17),l={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p"},u=a.forwardRef((function(e,t){var n=e.align,s=void 0===n?"inherit":n,u=e.classes,f=e.className,d=e.color,h=void 0===d?"initial":d,p=e.component,v=e.display,m=void 0===v?"initial":v,g=e.gutterBottom,b=void 0!==g&&g,y=e.noWrap,O=void 0!==y&&y,x=e.paragraph,k=void 0!==x&&x,w=e.variant,j=void 0===w?"body1":w,S=e.variantMapping,C=void 0===S?l:S,E=Object(i.a)(e,["align","classes","className","color","component","display","gutterBottom","noWrap","paragraph","variant","variantMapping"]),M=p||(k?"p":C[j]||l[j])||"span";return a.createElement(M,Object(r.a)({className:Object(o.a)(u.root,f,"inherit"!==j&&u[j],"initial"!==h&&u["color".concat(Object(c.a)(h))],O&&u.noWrap,b&&u.gutterBottom,k&&u.paragraph,"inherit"!==s&&u["align".concat(Object(c.a)(s))],"initial"!==m&&u["display".concat(Object(c.a)(m))]),ref:t},E))}));t.a=Object(s.a)((function(e){return{root:{margin:0},body2:e.typography.body2,body1:e.typography.body1,caption:e.typography.caption,button:e.typography.button,h1:e.typography.h1,h2:e.typography.h2,h3:e.typography.h3,h4:e.typography.h4,h5:e.typography.h5,h6:e.typography.h6,subtitle1:e.typography.subtitle1,subtitle2:e.typography.subtitle2,overline:e.typography.overline,srOnly:{position:"absolute",height:1,width:1,overflow:"hidden"},alignLeft:{textAlign:"left"},alignCenter:{textAlign:"center"},alignRight:{textAlign:"right"},alignJustify:{textAlign:"justify"},noWrap:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},gutterBottom:{marginBottom:"0.35em"},paragraph:{marginBottom:16},colorInherit:{color:"inherit"},colorPrimary:{color:e.palette.primary.main},colorSecondary:{color:e.palette.secondary.main},colorTextPrimary:{color:e.palette.text.primary},colorTextSecondary:{color:e.palette.text.secondary},colorError:{color:e.palette.error.main},displayInline:{display:"inline"},displayBlock:{display:"block"}}}),{name:"MuiTypography"})(u)},function(e,t,n){"use strict";var r=n(2),i=n(8),a=n(0),o=(n(12),n(26)),s=n(9),c=n(23),l=n(31),u=n(11),f=n(67),d=n(58),h=n(417),p="undefined"===typeof window?a.useEffect:a.useLayoutEffect;var v=function(e){var t=e.classes,n=e.pulsate,r=void 0!==n&&n,i=e.rippleX,o=e.rippleY,c=e.rippleSize,u=e.in,f=e.onExited,d=void 0===f?function(){}:f,h=e.timeout,v=a.useState(!1),m=v[0],g=v[1],b=Object(s.a)(t.ripple,t.rippleVisible,r&&t.ripplePulsate),y={width:c,height:c,top:-c/2+o,left:-c/2+i},O=Object(s.a)(t.child,m&&t.childLeaving,r&&t.childPulsate),x=Object(l.a)(d);return p((function(){if(!u){g(!0);var e=setTimeout(x,h);return function(){clearTimeout(e)}}}),[x,u,h]),a.createElement("span",{className:b,style:y},a.createElement("span",{className:O}))},m=a.forwardRef((function(e,t){var n=e.center,o=void 0!==n&&n,c=e.classes,l=e.className,u=Object(i.a)(e,["center","classes","className"]),f=a.useState([]),p=f[0],m=f[1],g=a.useRef(0),b=a.useRef(null);a.useEffect((function(){b.current&&(b.current(),b.current=null)}),[p]);var y=a.useRef(!1),O=a.useRef(null),x=a.useRef(null),k=a.useRef(null);a.useEffect((function(){return function(){clearTimeout(O.current)}}),[]);var w=a.useCallback((function(e){var t=e.pulsate,n=e.rippleX,r=e.rippleY,i=e.rippleSize,o=e.cb;m((function(e){return[].concat(Object(d.a)(e),[a.createElement(v,{key:g.current,classes:c,timeout:550,pulsate:t,rippleX:n,rippleY:r,rippleSize:i})])})),g.current+=1,b.current=o}),[c]),j=a.useCallback((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,r=t.pulsate,i=void 0!==r&&r,a=t.center,s=void 0===a?o||t.pulsate:a,c=t.fakeElement,l=void 0!==c&&c;if("mousedown"===e.type&&y.current)y.current=!1;else{"touchstart"===e.type&&(y.current=!0);var u,f,d,h=l?null:k.current,p=h?h.getBoundingClientRect():{width:0,height:0,left:0,top:0};if(s||0===e.clientX&&0===e.clientY||!e.clientX&&!e.touches)u=Math.round(p.width/2),f=Math.round(p.height/2);else{var v=e.touches?e.touches[0]:e,m=v.clientX,g=v.clientY;u=Math.round(m-p.left),f=Math.round(g-p.top)}if(s)(d=Math.sqrt((2*Math.pow(p.width,2)+Math.pow(p.height,2))/3))%2===0&&(d+=1);else{var b=2*Math.max(Math.abs((h?h.clientWidth:0)-u),u)+2,j=2*Math.max(Math.abs((h?h.clientHeight:0)-f),f)+2;d=Math.sqrt(Math.pow(b,2)+Math.pow(j,2))}e.touches?null===x.current&&(x.current=function(){w({pulsate:i,rippleX:u,rippleY:f,rippleSize:d,cb:n})},O.current=setTimeout((function(){x.current&&(x.current(),x.current=null)}),80)):w({pulsate:i,rippleX:u,rippleY:f,rippleSize:d,cb:n})}}),[o,w]),S=a.useCallback((function(){j({},{pulsate:!0})}),[j]),C=a.useCallback((function(e,t){if(clearTimeout(O.current),"touchend"===e.type&&x.current)return e.persist(),x.current(),x.current=null,void(O.current=setTimeout((function(){C(e,t)})));x.current=null,m((function(e){return e.length>0?e.slice(1):e})),b.current=t}),[]);return a.useImperativeHandle(t,(function(){return{pulsate:S,start:j,stop:C}}),[S,j,C]),a.createElement("span",Object(r.a)({className:Object(s.a)(c.root,l),ref:k},u),a.createElement(h.a,{component:null,exit:!0},p))})),g=Object(u.a)((function(e){return{root:{overflow:"hidden",pointerEvents:"none",position:"absolute",zIndex:0,top:0,right:0,bottom:0,left:0,borderRadius:"inherit"},ripple:{opacity:0,position:"absolute"},rippleVisible:{opacity:.3,transform:"scale(1)",animation:"$enter ".concat(550,"ms ").concat(e.transitions.easing.easeInOut)},ripplePulsate:{animationDuration:"".concat(e.transitions.duration.shorter,"ms")},child:{opacity:1,display:"block",width:"100%",height:"100%",borderRadius:"50%",backgroundColor:"currentColor"},childLeaving:{opacity:0,animation:"$exit ".concat(550,"ms ").concat(e.transitions.easing.easeInOut)},childPulsate:{position:"absolute",left:0,top:0,animation:"$pulsate 2500ms ".concat(e.transitions.easing.easeInOut," 200ms infinite")},"@keyframes enter":{"0%":{transform:"scale(0)",opacity:.1},"100%":{transform:"scale(1)",opacity:.3}},"@keyframes exit":{"0%":{opacity:1},"100%":{opacity:0}},"@keyframes pulsate":{"0%":{transform:"scale(1)"},"50%":{transform:"scale(0.92)"},"100%":{transform:"scale(1)"}}}}),{flip:!1,name:"MuiTouchRipple"})(a.memo(m)),b=a.forwardRef((function(e,t){var n=e.action,u=e.buttonRef,d=e.centerRipple,h=void 0!==d&&d,p=e.children,v=e.classes,m=e.className,b=e.component,y=void 0===b?"button":b,O=e.disabled,x=void 0!==O&&O,k=e.disableRipple,w=void 0!==k&&k,j=e.disableTouchRipple,S=void 0!==j&&j,C=e.focusRipple,E=void 0!==C&&C,M=e.focusVisibleClassName,P=e.onBlur,T=e.onClick,_=e.onFocus,D=e.onFocusVisible,A=e.onKeyDown,R=e.onKeyUp,L=e.onMouseDown,N=e.onMouseLeave,I=e.onMouseUp,z=e.onTouchEnd,$=e.onTouchMove,F=e.onTouchStart,B=e.onDragLeave,Q=e.tabIndex,W=void 0===Q?0:Q,H=e.TouchRippleProps,V=e.type,U=void 0===V?"button":V,q=Object(i.a)(e,["action","buttonRef","centerRipple","children","classes","className","component","disabled","disableRipple","disableTouchRipple","focusRipple","focusVisibleClassName","onBlur","onClick","onFocus","onFocusVisible","onKeyDown","onKeyUp","onMouseDown","onMouseLeave","onMouseUp","onTouchEnd","onTouchMove","onTouchStart","onDragLeave","tabIndex","TouchRippleProps","type"]),Y=a.useRef(null);var X=a.useRef(null),K=a.useState(!1),G=K[0],Z=K[1];x&&G&&Z(!1);var J=Object(f.a)(),ee=J.isFocusVisible,te=J.onBlurVisible,ne=J.ref;function re(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:S;return Object(l.a)((function(r){return t&&t(r),!n&&X.current&&X.current[e](r),!0}))}a.useImperativeHandle(n,(function(){return{focusVisible:function(){Z(!0),Y.current.focus()}}}),[]),a.useEffect((function(){G&&E&&!w&&X.current.pulsate()}),[w,E,G]);var ie=re("start",L),ae=re("stop",B),oe=re("stop",I),se=re("stop",(function(e){G&&e.preventDefault(),N&&N(e)})),ce=re("start",F),le=re("stop",z),ue=re("stop",$),fe=re("stop",(function(e){G&&(te(e),Z(!1)),P&&P(e)}),!1),de=Object(l.a)((function(e){Y.current||(Y.current=e.currentTarget),ee(e)&&(Z(!0),D&&D(e)),_&&_(e)})),he=function(){var e=o.findDOMNode(Y.current);return y&&"button"!==y&&!("A"===e.tagName&&e.href)},pe=a.useRef(!1),ve=Object(l.a)((function(e){E&&!pe.current&&G&&X.current&&" "===e.key&&(pe.current=!0,e.persist(),X.current.stop(e,(function(){X.current.start(e)}))),e.target===e.currentTarget&&he()&&" "===e.key&&e.preventDefault(),A&&A(e),e.target===e.currentTarget&&he()&&"Enter"===e.key&&!x&&(e.preventDefault(),T&&T(e))})),me=Object(l.a)((function(e){E&&" "===e.key&&X.current&&G&&!e.defaultPrevented&&(pe.current=!1,e.persist(),X.current.stop(e,(function(){X.current.pulsate(e)}))),R&&R(e),T&&e.target===e.currentTarget&&he()&&" "===e.key&&!e.defaultPrevented&&T(e)})),ge=y;"button"===ge&&q.href&&(ge="a");var be={};"button"===ge?(be.type=U,be.disabled=x):("a"===ge&&q.href||(be.role="button"),be["aria-disabled"]=x);var ye=Object(c.a)(u,t),Oe=Object(c.a)(ne,Y),xe=Object(c.a)(ye,Oe),ke=a.useState(!1),we=ke[0],je=ke[1];a.useEffect((function(){je(!0)}),[]);var Se=we&&!w&&!x;return a.createElement(ge,Object(r.a)({className:Object(s.a)(v.root,m,G&&[v.focusVisible,M],x&&v.disabled),onBlur:fe,onClick:T,onFocus:de,onKeyDown:ve,onKeyUp:me,onMouseDown:ie,onMouseLeave:se,onMouseUp:oe,onDragLeave:ae,onTouchEnd:le,onTouchMove:ue,onTouchStart:ce,ref:xe,tabIndex:x?-1:W},be,q),p,Se?a.createElement(g,Object(r.a)({ref:X,center:h},H)):null)}));t.a=Object(u.a)({root:{display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle","-moz-appearance":"none","-webkit-appearance":"none",textDecoration:"none",color:"inherit","&::-moz-focus-inner":{borderStyle:"none"},"&$disabled":{pointerEvents:"none",cursor:"default"},"@media print":{colorAdjust:"exact"}},disabled:{},focusVisible:{}},{name:"MuiButtonBase"})(b)},function(e,t,n){var r=n(237),i=n(238),a=n(239),o=n(240),s=n(241);function c(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t2||/[^\s,.;:]/.test(e.sliceDoc(t.start,t.end)))||t.firstChild}function b(e,t,n){for(var r=e.tree.resolve(t.head),a=n?c.c.closedBy:c.c.openedBy,o=t.head;;){var l=n?r.childAfter(o):r.childBefore(o);if(!l)break;g(e,l,a)?r=l:o=n?l.end:l.start}var u,f;return f=r.type.prop(a)&&(u=n?Object(s.b)(e,r.start,1):Object(s.b)(e,r.end,-1))&&u.matched?n?u.end.to:u.end.from:n?r.end:r.start,i.d.cursor(f,n?-1:1)}function y(e,t){return f(e,(function(n){return n.empty?e.moveVertically(n,t):d(n,t)}))}var O=function(e){return y(e,!1)},x=function(e){return y(e,!0)};function k(e,t){return f(e,(function(n){return n.empty?e.moveVertically(n,t,e.dom.clientHeight):d(n,t)}))}var w=function(e){return k(e,!1)},j=function(e){return k(e,!0)};function S(e,t,n){var r=e.visualLineAt(t.head),a=e.moveToLineBoundary(t,n);if(a.head==t.head&&a.head!=(n?r.to:r.from)&&(a=e.moveToLineBoundary(t,n,!1)),!n&&a.head==r.from&&r.length){var o=/^\s*/.exec(e.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;o&&t.head>r.from+o&&(a=i.d.cursor(r.from+o))}return a}var C=function(e){return f(e,(function(t){return i.d.cursor(e.visualLineAt(t.head).from,1)}))},E=function(e){return f(e,(function(t){return i.d.cursor(e.visualLineAt(t.head).to,-1)}))};function M(e,t,n){var r=!1,a=l(e.selection,(function(t){var a=Object(s.b)(e,t.head,-1)||Object(s.b)(e,t.head,1)||t.head>0&&Object(s.b)(e,t.head-1,1)||t.headc.from&&r-1)return o}}catch(s){a.e(s)}finally{a.f()}return-1}function ne(e,t){var n=-1;return e.changeByRange((function(r){for(var a=[],o=e.doc.lineAt(r.from);o.number>n&&(t(o,a,r),n=o.number),!(r.to<=o.to);)o=e.doc.lineAt(o.to+1);var s=e.changes(a);return{changes:a,range:i.d.range(s.mapPos(r.anchor,1),s.mapPos(r.head,1))}}))}var re=[{key:"ArrowLeft",run:p,shift:_},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:function(e){return m(e,e.textDirection!=o.c.LTR)},shift:function(e){return A(e,e.textDirection!=o.c.LTR)}},{mac:"Cmd-ArrowLeft",run:C,shift:F},{key:"ArrowRight",run:v,shift:D},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:function(e){return m(e,e.textDirection==o.c.LTR)},shift:function(e){return A(e,e.textDirection==o.c.LTR)}},{mac:"Cmd-ArrowRight",run:E,shift:B},{key:"ArrowUp",run:O,shift:L},{mac:"Cmd-ArrowUp",run:Q,shift:H},{mac:"Ctrl-ArrowUp",run:w,shift:z},{key:"ArrowDown",run:x,shift:N},{mac:"Cmd-ArrowDown",run:W,shift:V},{mac:"Ctrl-ArrowDown",run:j,shift:$},{key:"PageUp",run:w,shift:z},{key:"PageDown",run:j,shift:$},{key:"Home",run:function(e){return f(e,(function(t){return S(e,t,!1)}))},shift:function(e){return P(e,(function(t){return S(e,t,!1)}))}},{key:"Mod-Home",run:Q,shift:H},{key:"End",run:function(e){return f(e,(function(t){return S(e,t,!0)}))},shift:function(e){return P(e,(function(t){return S(e,t,!0)}))}},{key:"Mod-End",run:W,shift:V},{key:"Enter",run:function(e){var t=e.state,n=e.dispatch,r=t.changeByRange((function(e){var n=e.from,r=e.to,o=n==r&&function(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};var n,r=e.tree.resolve(t),i=r.childBefore(t),a=r.childAfter(t);return i&&a&&i.end<=t&&a.start>=t&&(n=i.type.prop(c.c.closedBy))&&n.indexOf(a.name)>-1?{from:i.end,to:a.start}:null}(t,n),s=new i.g(t,{simulateBreak:n,simulateDoubleBreak:!!o}),l=te(s,n);l<0&&(l=/^\s*/.exec(t.doc.lineAt(n).slice(0,50))[0].length);for(var u=t.doc.lineAt(n);ru.from&&n",run:W},{key:"Ctrl-v",run:j},{key:"Alt-v",run:w}].map((function(e){return{mac:e.key,run:e.run,shift:e.shift}}))),ie=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:function(e){return f(e,(function(t){return b(e.state,t,e.textDirection!=o.c.LTR)}))},shift:function(e){return P(e,(function(t){return b(e.state,t,e.textDirection!=o.c.LTR)}))}},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:function(e){return f(e,(function(t){return b(e.state,t,e.textDirection==o.c.LTR)}))},shift:function(e){return P(e,(function(t){return b(e.state,t,e.textDirection==o.c.LTR)}))}},{key:"Alt-ArrowUp",run:function(e){return J(e.state,e.dispatch,!1)}},{key:"Shift-Alt-ArrowUp",run:function(e){return ee(e.state,e.dispatch,!1)}},{key:"Alt-ArrowDown",run:function(e){return J(e.state,e.dispatch,!0)}},{key:"Shift-Alt-ArrowDown",run:function(e){return ee(e.state,e.dispatch,!0)}},{key:"Escape",run:function(e){var t=e.state,n=e.dispatch,r=t.selection,a=null;return r.ranges.length>1?a=new i.d([r.primary]):r.primary.empty||(a=new i.d([i.d.cursor(r.primary.head)])),!!a&&(n(u(t,a)),!0)}},{key:"Mod-l",run:function(e){var t=e.state,n=e.dispatch,r=Z(t).map((function(e){var n=e.from,r=e.to;return i.d.range(n,Math.min(r+1,t.doc.length))}));return n(t.update({selection:new i.d(r),annotations:i.l.userEvent.of("keyboardselection")})),!0}},{key:"Mod-i",run:function(e){var t=e.state,n=e.dispatch,r=l(t.selection,(function(e){for(var n,r=t.tree.resolve(e.head,1);!(r.start=e.to||r.end>e.to&&r.start<=e.from)&&(null===(n=r.parent)||void 0===n?void 0:n.parent);)r=r.parent;return i.d.range(r.end,r.start)}));return n(u(t,r)),!0}},{key:"Mod-[",run:function(e){var t=e.state;return(0,e.dispatch)(t.update(ne(t,(function(e,n){var r=e.slice(0,Math.min(e.length,200)),i=/^\s*/.exec(r)[0];if(i){for(var o=Object(a.d)(i,0,t.tabSize),s=t.indentString(Math.max(0,o-t.indentUnit)),c=0;c0?n--:r30||this.typeNames.length>Math.pow(2,30-this.flags.length))throw new RangeError("Too many style tag flags to fit in a 30-bit integer")}return Object(a.a)(e,[{key:"get",value:function(e){var t,n=0,i=Object(r.a)(e.split(" "));try{for(i.s();!(t=i.n()).done;){var a=t.value;if(a){var o=this.flags.indexOf(a);if(o>-1)n+=1<>this.typeShift)throw new RangeError("Multiple tag types specified in '".concat(e,"'"));n+=s<1&&void 0!==arguments[1]?arguments[1]:{},n=this.getWithMode(e),r=n.mode,i=n.tag;return this.prop.set(t,new h(i,r,d))}},{key:"add",value:function(e){var t=Object.create(null);for(var n in e){var i,a=e[n],o=this.getWithMode(a),s=o.mode,c=o.tag,l=Object(r.a)(n.split(" "));try{for(l.s();!(i=l.n()).done;){var u=i.value.split("/"),f=u[u.length-1],p=u.length>1?u.slice(0,u.length-1).map((function(e){return"*"==e?null:e})):d,v=new h(c,s,p);t[f]=v.sort(t[f])}}catch(m){l.e(m)}finally{l.f()}}return this.prop.add(t)}},{key:"highlighter",value:function(e){var t=this,n=new m(this,e);return[Object(l.o)(c.f.define((function(e){return new g(e,t.prop,n)}),{decorations:function(e){return e.decorations}}),"fallback"),c.d.styleModule.of(n.module)]}},{key:"specificity",value:function(e){for(var t=e&this.flagMask,n=0,r=1;r<=this.flags.length;r++)t&1<>this.typeShift;i;i=this.parents[i])n+=/#/.test(this.typeNames[i])?500:1e3;return n}}]),e}())({flags:["invalid","meta","standard","definition","constant","local","control","link","strong","emphasis","monospace","changed","inserted","deleted"],subtypes:7,types:["comment","lineComment=comment","blockComment=comment","docComment=comment","name","variableName=name","typeName=name","propertyName=name","className=name","labelName=name","functionName=name","namespace=name","literal","string=literal","docString=string","character=string","number=literal","integer=number","float=number","bool=literal","regexp=literal","escape=literal","color=literal","content","heading=content","list=content","quote=content","keyword","self=keyword","null=keyword","atom=keyword","unit=keyword","modifier=keyword","operatorKeyword=keyword","operator","derefOperator=operator","arithmeticOperator=operator","logicOperator=operator","bitwiseOperator=operator","compareOperator=operator","updateOperator=operator","typeOperator=operator","punctuation","separator=punctuation","bracket=punctuation","angleBracket=bracket","squareBracket=bracket","paren=bracket","brace=bracket"]}),d=[],h=function(){function e(t,n,r,a){Object(i.a)(this,e),this.tag=t,this.mode=n,this.context=r,this.next=a}return Object(a.a)(e,[{key:"sort",value:function(e){return!e||e.context.length>t.typeShift,h&t.flagMask,t.specificity(h),l))}}catch(p){f.e(p)}finally{f.f()}}this.rules=o.sort((function(e,t){return t.specificity-e.specificity})),this.module=new s.a(a)}return Object(a.a)(e,[{key:"match",value:function(e){var t=this.cache[e];if(null!=t)return t;for(var n="",i=e>>this.tags.typeShift,a=e&this.tags.flagMask;;){var o,s=Object(r.a)(this.rules);try{for(s.s();!(o=s.n()).done;){var c=o.value;if(c.type==i&&(c.flags&a)==c.flags&&(n&&(n+=" "),n+=c.cls,a&=~c.flags,i))break}}catch(l){s.e(l)}finally{s.f()}if(!i)break;i=this.tags.parents[i]}return this.cache[e]=n}}]),e}(),g=function(){function e(t,n,r){Object(i.a)(this,e),this.prop=n,this.styling=r,this.nodeStack=[""],this.classStack=[""],this.inheritStack=[""],this.tree=t.state.tree,this.decorations=this.buildDeco(t.visibleRanges,this.tree)}return Object(a.a)(e,[{key:"update",value:function(e){var t=e.state.facet(l.e.syntax);t.length?t[0].parsePos(e.state)n&&t&&s.add(n,e,c.b.mark({class:t})),n=e}var f,d=this.nodeStack,h=this.classStack,p=this.inheritStack,v=Object(r.a)(e);try{var m=function(){var e=f.value,r=e.from,s=e.to;i="",a=0,n=r,t.iterate({from:r,to:s,enter:function(e,t){a++;for(var n=p[a-1],r=n,s=e.prop(o.prop),c=!1;s;){if(!s.context.length||b(s.context,d,a)){var u=o.styling.match(s.tag);u&&(r&&(r+=" "),r+=u,1==s.mode?n=r:0==s.mode&&(c=!0));break}s=s.next}if(r!=i&&(l(t,i),i=r),c)return a--,!1;h[a]=r,p[a]=n,d[a]=e.name},leave:function(e,t,n){a--;var r=h[a];r!=i&&(l(Math.min(s,n),i),i=r)}})};for(v.s();!(f=v.n()).done;)m()}catch(g){v.e(g)}finally{v.f()}return s.finish()}}]),e}();function b(e,t,n){if(e.length>n-1)return!1;for(var r=n-1,i=e.length-1;i>=0;i--,r--){var a=e[i];if(a&&a!=t[r])return!1}return!0}var y,O=(y={deleted:{textDecoration:"line-through"},inserted:{textDecoration:"underline"},link:{textDecoration:"underline"},strong:{fontWeight:"bold"},emphasis:{fontStyle:"italic"},keyword:{color:"#708"},"atom, bool":{color:"#219"},number:{color:"#164"},string:{color:"#a11"},"regexp, escape, string#2":{color:"#e40"},"variableName definition":{color:"#00f"},typeName:{color:"#085"},className:{color:"#167"},"name#2":{color:"#256"},"propertyName definition":{color:"#00c"},comment:{color:"#940"},meta:{color:"#555"},invalid:{color:"#f00"}},f.highlighter(y))},function(e,t,n){"use strict";n.d(t,"a",(function(){return w})),n.d(t,"b",(function(){return S}));var r=n(16),i=n(15),a=n(6),o=n(7),s=n(4),c=n(10),l=n(5),u=n(94),f=n(35),d=function e(t,n,r){Object(s.a)(this,e),this.from=t,this.to=n,this.diagnostic=r},h=function e(t,n,r){Object(s.a)(this,e),this.diagnostics=t,this.panel=n,this.selected=r};function p(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=null;return e.between(n,e.length,(function(e,n,i){var a=i.spec;if(!t||a.diagnostic==t)return r=new d(e,n,a.diagnostic),!1})),r}function v(e){return e.field(y,!1)?void 0:{append:[y,c.d.decorations.compute([y],(function(e){var t=e.field(y),n=t.selected,r=t.panel;return n&&r&&n.from!=n.to?c.b.set([O.range(n.from,n.to)]):c.b.none})),Object(f.b)(),Object(u.a)(x),_]}}var m=l.i.define(),g=l.i.define(),b=l.i.define(),y=l.j.define({create:function(){return new h(c.b.none,null,null)},update:function(e,t){if(t.docChanged){var n=e.diagnostics.map(t.changes),r=null;if(e.selected){var i=t.changes.mapPos(e.selected.from,1);r=p(n,e.selected.diagnostic,i)||p(n,null,i)}e=new h(n,e.panel,r)}var a,s=Object(o.a)(t.effects);try{for(s.s();!(a=s.n()).done;){var l=a.value;if(l.is(m)){var u=c.b.set(l.value.map((function(e){return e.fromi&&(e.items.splice(i,u-i),a=!0)),r&&c.diagnostic==r.diagnostic?c.dom.hasAttribute("aria-selected")||(c.dom.setAttribute("aria-selected","true"),o=c):c.dom.hasAttribute("aria-selected")&&c.dom.removeAttribute("aria-selected"),i++}));ir.bottom&&(e.list.scrollTop+=n.bottom-r.bottom)}})):this.items.length||this.list.removeAttribute("aria-activedescendant"),a&&this.sync()}},{key:"sync",value:function(){var e=this.list.firstChild;function t(){var t=e;e=t.nextSibling,t.remove()}var n,r=Object(o.a)(this.items);try{for(r.s();!(n=r.n()).done;){var i=n.value;if(i.dom.parentNode==this.list){for(;e!=i.dom;)t();e=i.dom.nextSibling}else this.list.insertBefore(i.dom,e)}}catch(a){r.e(a)}finally{r.f()}for(;e;)t();this.list.firstChild||this.list.appendChild(C(this.view,{severity:"info",message:this.view.state.phrase("No diagnostics")}))}},{key:"moveSelection",value:function(e){if(0!=this.items.length){var t=p(this.view.state.field(y).diagnostics,this.items[e].diagnostic);t&&this.view.dispatch({selection:{anchor:t.from,head:t.to},scrollIntoView:!0,effects:b.of(t)})}}},{key:"selectedIndex",get:function(){var e=this.view.state.field(y).selected;if(!e)return-1;for(var t=0;t\n ');return"url('data:image/svg+xml;base64,".concat(btoa(t),"')")}var _=c.d.baseTheme({$diagnostic:{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block"},"$diagnostic.error":{borderLeft:"5px solid #d11"},"$diagnostic.warning":{borderLeft:"5px solid orange"},"$diagnostic.info":{borderLeft:"5px solid #999"},$diagnosticAction:{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px"},$lintRange:{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x"},"$lintRange.error":{backgroundImage:T("#d11")},"$lintRange.warning":{backgroundImage:T("orange")},"$lintRange.info":{backgroundImage:T("#999")},"$lintRange.active":{backgroundColor:"#ffdd9980"},$lintPoint:{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},"$lintPoint.warning":{"&:after":{borderBottomColor:"orange"}},"$lintPoint.info":{"&:after":{borderBottomColor:"#999"}},"$panel.lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd"},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}},"$tooltip.lint":{padding:0,margin:0}})},function(e,t,n){"use strict";function r(){var e=document.createElement("div");e.style.width="99px",e.style.height="99px",e.style.position="absolute",e.style.top="-9999px",e.style.overflow="scroll",document.body.appendChild(e);var t=e.offsetWidth-e.clientWidth;return document.body.removeChild(e),t}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";var r=n(0),i=r.createContext({});t.a=i},function(e,t,n){"use strict";function r(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},a=Object.keys(e);for(r=0;r=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}n.d(t,"a",(function(){return r}))},function(e,t,n){var r=n(167),i=n(166),a=n(170),o=n(82),s=n(102),c=n(103),l=Object.prototype.hasOwnProperty,u=a((function(e,t){if(s(t)||o(t))i(t,c(t),e);else for(var n in t)l.call(t,n)&&r(e,n,t[n])}));e.exports=u},function(e,t,n){"use strict";(function(e){n.d(t,"b",(function(){return k}));var r=n(24);n.d(t,"a",(function(){return r.c}));var i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};var a,o=function(){function e(e,t,n,r,i,a,o,s,c){this.cx=e,this.stack=t,this.state=n,this.reducePos=r,this.pos=i,this.score=a,this.buffer=o,this.bufferBase=s,this.parent=c}return e.prototype.toString=function(){return"["+this.stack.filter((function(e,t){return t%3==0})).concat(this.state)+"]@"+this.pos+(this.score?"!"+this.score:"")},e.start=function(t,n,r){return void 0===r&&(r=0),new e(t,[],n,r,r,0,[],0,null)},e.prototype.pushState=function(e,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=e},e.prototype.reduce=function(e){var t=e>>19,n=65535&e,r=this.cx.parser,i=r.dynamicPrecedence(n);if(i&&(this.score+=i),0==t)return na;)this.stack.pop()},e.prototype.storeNode=function(e,t,n,r,i){if(void 0===r&&(r=4),void 0===i&&(i=!1),0==e){var a=this,o=this.buffer.length;if(0==o&&a.parent&&(o=a.bufferBase-a.parent.bufferBase,a=a.parent),o>0&&0==a.buffer[o-4]&&a.buffer[o-1]>-1){if(t==n)return;if(a.buffer[o-2]>=t)return void(a.buffer[o-2]=n)}}if(i&&this.pos!=n){var s=this.buffer.length;if(s>0&&0!=this.buffer[s-4])for(;s>0&&this.buffer[s-2]>n;)this.buffer[s]=this.buffer[s-4],this.buffer[s+1]=this.buffer[s-3],this.buffer[s+2]=this.buffer[s-2],this.buffer[s+3]=this.buffer[s-1],s-=4,r>4&&(r-=4);this.buffer[s]=e,this.buffer[s+1]=t,this.buffer[s+2]=n,this.buffer[s+3]=r}else this.buffer.push(e,t,n,r)},e.prototype.shift=function(e,t,n){if(131072&e)this.pushState(65535&e,this.pos);else if(0==(262144&e)){var r=this.pos,i=e,a=this.cx.parser;(n>this.pos||t<=a.maxNode)&&(this.pos=n,a.stateFlag(i,1)||(this.reducePos=n)),this.pushState(i,r),t<=a.maxNode&&this.buffer.push(t,r,n,4)}else t<=this.cx.parser.maxNode&&this.buffer.push(t,this.pos,n,4),this.pos=n},e.prototype.apply=function(e,t,n){65536&e?this.reduce(e):this.shift(e,t,n)},e.prototype.useNode=function(e,t){var n=this.cx.reused.length-1;(n<0||this.cx.reused[n]!=e)&&(this.cx.reused.push(e),n++);var r=this.pos;this.reducePos=this.pos=r+e.length,this.pushState(t,r),this.buffer.push(n,r,this.reducePos,-1)},e.prototype.split=function(){for(var t=this,n=t.buffer.length;n>0&&t.buffer[n-2]>t.reducePos;)n-=4;for(var r=t.buffer.slice(n),i=t.bufferBase+n;t&&i==t.bufferBase;)t=t.parent;return new e(this.cx,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,r,i,t)},e.prototype.recoverByDelete=function(e,t){var n=e<=this.cx.parser.maxNode;n&&this.storeNode(e,this.pos,t),this.storeNode(0,this.pos,t,n?8:4),this.pos=this.reducePos=t,this.score-=200},e.prototype.canShift=function(e){for(var t=new s(this);;){var n=this.cx.parser.stateSlot(t.top,4)||this.cx.parser.hasAction(t.top,e);if(0==(65536&n))return!0;if(0==n)return!1;t.reduce(n)}},Object.defineProperty(e.prototype,"ruleStart",{get:function(){for(var e=this.state,t=this.stack.length;;){var n=this.cx.parser.stateSlot(e,5);if(!(65536&n))return 0;if(t-=3*(n>>19),(65535&n)>19,o=65535&i;if(e.indexOf(o)>-1){var s=n-3*(i>>19);return this.stack[s+1]}if(0==n)return-1;0==a?(n-=3,t=this.stack[n]):(n-=3*(a-1),t=r.getGoto(this.stack[n-3],o,!0))}},e.prototype.recoverByInsert=function(e){var t=this;if(this.stack.length>=300)return[];var n=this.cx.parser.nextStates(this.state);if(n.length>4||this.stack.length>=120){var r=n.filter((function(n){return n!=t.state&&t.cx.parser.hasAction(n,e)}));if(this.stack.length<120)for(var i=0;r.length<4&&i>19;0==n?(this.rest==this.stack.stack&&(this.rest=this.rest.slice()),this.rest.push(this.top,0,0),this.offset+=3):this.offset-=3*(n-1);var r=this.stack.cx.parser.getGoto(this.rest[this.offset-3],t,!0);this.top=r},e}(),c=function(){function e(e,t,n){this.stack=e,this.pos=t,this.index=n,this.buffer=e.buffer,0==this.index&&this.maybeNext()}return e.create=function(t){return new e(t,t.bufferBase+t.buffer.length,t.buffer.length)},e.prototype.maybeNext=function(){var e=this.stack.parent;null!=e&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)},Object.defineProperty(e.prototype,"id",{get:function(){return this.buffer[this.index-4]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"start",{get:function(){return this.buffer[this.index-3]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"end",{get:function(){return this.buffer[this.index-2]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"size",{get:function(){return this.buffer[this.index-1]},enumerable:!0,configurable:!0}),e.prototype.next=function(){this.index-=4,this.pos-=4,0==this.index&&this.maybeNext()},e.prototype.fork=function(){return new e(this.stack,this.pos,this.index)},e}(),l=function(){function e(){this.start=-1,this.value=-1,this.end=-1}return e.prototype.accept=function(e,t){this.value=e,this.end=t},e}(),u=function(){function e(e,t){void 0===t&&(t=e.length),this.string=e,this.length=t}return e.prototype.get=function(e){return e<0||e>=this.length?-1:this.string.charCodeAt(e)},e.prototype.read=function(e,t){return this.string.slice(e,Math.min(this.length,t))},e.prototype.clip=function(t){return new e(this.string,t)},e}(),f=function(){function e(e,t){this.data=e,this.id=t}return e.prototype.token=function(e,t,n){!function(e,t,n,r,i){var a=0,o=1<0){var f=e[u];if(s.allows(f)&&(-1==n.value||n.value==f||r.cx.parser.overrides(f,n.value))){n.accept(f,c);break}}for(var d=t.get(c++),h=0,p=e[a+2];h>1,m=l+v+(v<<1),g=e[m],b=e[m+1];if(d=b)){a=e[m+2];continue e}h=v+1}}break}}(this.data,e,t,n,this.id)},e}();f.prototype.contextual=f.prototype.fallback=f.prototype.extend=!1;function d(e,t){if(void 0===t&&(t=Uint16Array),"string"!=typeof e)return e;for(var n=null,r=0,i=0;r=92&&o--,o>=34&&o--;var c=o-32;if(c>=46&&(c-=46,s=!0),a+=c,s)break;a*=46}n?n[i++]=a:n=new t(a)}return n}var h="undefined"!=typeof e&&/\bparse\b/.test(Object({NODE_ENV:"production",PUBLIC_URL:".",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}).LOG),p=null,v=function(){function e(e){this.start=[0],this.index=[0],this.nextStart=0,this.trees=[e]}return e.prototype.nodeAt=function(e){if(e=e)return o==e?a:null;a instanceof r.f?(this.index[t]++,this.nextStart=o+a.length):(this.index[t]++,o+a.length>=e&&(this.trees.push(a),this.start.push(o),this.index.push(0)))}else this.trees.pop(),this.start.pop(),this.index.pop()}},e}(),m=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.extended=-1,t.mask=0,t}return function(e,t){function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),t.prototype.clear=function(e){this.start=e,this.value=this.extended=-1},t}(l),g=new l,b=function(){function e(e){this.tokens=[],this.mainToken=g,this.actions=[],this.tokens=e.tokenizers.map((function(e){return new m}))}return e.prototype.getActions=function(e,t){for(var n=0,r=null,i=e.cx.parser,a=i.tokenizers,o=i.stateSlot(e.state,3),s=0;s-1&&(n=this.addActions(e,l.extended,l.end,n)),n=this.addActions(e,l.value,l.end,n),!c.extend&&(r=l,n>u))break}}for(;this.actions.length>n;)this.actions.pop();return r||((r=g).start=e.pos,e.pos==t.length?r.accept(e.cx.parser.eofTerm,e.pos):r.accept(0,e.pos+1)),this.mainToken=r,this.actions},e.prototype.updateCachedToken=function(e,t,n,r){if(e.clear(n.pos),t.token(r,e,n),e.value>-1){for(var i=n.cx.parser,a=0;a=0&&n.cx.dialect.allows(o>>1)){0==(1&o)?e.value=o>>1:e.extended=o>>1;break}}}else n.pos==r.length?e.accept(n.cx.parser.eofTerm,n.pos):e.accept(0,n.pos+1)},e.prototype.putAction=function(e,t,n,r){for(var i=0;it)this.putStack(a);else{var o=this.advanceStack(a,e);if(o){a=o;continue}n||(n=[],r=[]),n.push(a);var s=a.cx.tokens.mainToken;r.push(s.value,s.end)}break}if(!this.stacks.length){var c;if(c=n&&function(e){for(var t=null,n=0,r=e;nl&&(this.stacks.sort((function(e,t){return t.score-e.score})),this.stacks.length=l),this.stacks.some((function(e){return e.reducePos>t}))&&this.recovering--}else if(this.stacks.length>1)e:for(i=0;i200&&f.buffer.length>200){if(!((a.score-f.score||a.buffer.length-f.buffer.length)>0)){this.stacks.splice(i--,1);continue e}this.stacks.splice(u--,1)}}}return this.tokenCount++,null},e.prototype.advanceStack=function(e,t){var n=e.pos,i=e.cx,a=i.input,s=i.parser,c=h?this.stackID(e)+" -> ":"";if(this.cache)for(var l=this.cache.nodeAt(n);l;){var u=s.group.types[l.type.id]==l.type?s.getGoto(e.state,l.type.id):-1;if(u>-1)return e.useNode(l,u),h&&console.log(c+this.stackID(e)+" (via reuse of "+s.getName(l.type.id)+")"),e;if(!(l instanceof r.e)||0==l.children.length||l.positions[0]>0)break;var f=l.children[0];if(!(f instanceof r.e))break;l=f}var d=s.startNested(e.state);e:if(d>-1){var p=s.nested[d],v=p.grammar,m=p.end,g=p.placeholder,b=void 0,O=null,x=void 0,k=void 0,w=void 0,j=void 0;if("function"==typeof v){var S=v(a,e);if(S.stay)break e;O=S.parseNode,x=S.parser,k=S.top,w=S.dialect,b=S.filterEnd,j=S.wrapType}else x=v;var C=this.scanForNestEnd(e,m,b),E=e.cx.input.clip(C);if(O||!x){var M=O?O(E,e.pos):r.e.empty;return M.length!=C-e.pos&&(M=new r.e(M.type,M.children,M.positions,C-e.pos)),null!=j&&(M=new r.e(s.group.types[j],[M],[0],M.length)),e.useNode(M,s.getGoto(e.state,g,!0)),e}var P=k?x.topRules[k]:x.defaultTop,T=o.start(new y(x,e.cx.maxBufferLength,E,P[1],x.parseDialect(w),e,j),P[0],e.pos);return h&&console.log(c+this.stackID(T)+" (nested)"),T}var _=s.stateSlot(e.state,4);if(_>0)return e.reduce(_),h&&console.log(c+this.stackID(e)+" (via always-reduce "+s.getName(65535&_)+")"),e;for(var D=e.cx.tokens.getActions(e,a),A=0;An?this.putStack(I):t.push(I)}return e.cx.parent&&e.pos==a.length?this.finishNested(e):null},e.prototype.advanceFully=function(e){for(var t=e.pos;;){var n=this.advanceStack(e,null);if(!n)return e;if(n.pos>t)return this.putStackDedup(n),null;e=n}},e.prototype.runRecovery=function(e,t){for(var n=null,r=!1,i=0;i ":"";if(a.deadEnd){if(r)continue;if(r=!0,a.restart(),h&&console.log(c+this.stackID(a)+" (restarted)"),!(d=this.advanceFully(a)))continue;a=d}for(var l=a.split(),u=c,f=0;l.forceReduce()&&f<10;f++){var d;if(h&&console.log(u+this.stackID(l)+" (via force-reduce)"),!(d=this.advanceFully(l)))break;l=d,h&&(u=this.stackID(d)+" -> ")}for(var p=0,v=a.recoverByInsert(o);pa.pos?(s==a.pos&&(s++,o=0),a.recoverByDelete(o,s),h&&console.log(c+this.stackID(a)+" (via recover-delete "+a.cx.parser.getName(o)+")"),this.putStackDedup(a)):a.cx.parent||n&&!(n.score-1&&(!n||n(r.read(i,g.end))))return i;return r.length},e.prototype.finishNested=function(e){if(-2==e.cx.wrapType)return null;var t=e.cx.parent,n=e.forceAll().toTree(),i=t.cx.parser,a=i.nested[i.startNested(t.state)];return n=new r.e(n.type,n.children,n.positions.map((function(e){return e-t.pos})),e.pos-t.pos),e.cx.wrapType>-1&&(n=new r.e(i.group.types[e.cx.wrapType],[n],[0],n.length)),e.cx.wrapType=-2,t.useNode(n,i.getGoto(t.state,a.placeholder,!0)),h&&console.log(this.stackID(t)+" (via unnest "+(e.cx.wrapType>-1?i.getName(e.cx.wrapType):n.type.name)+")"),t},e.prototype.stackID=function(e){var t=(p||(p=new WeakMap)).get(e);return t||p.set(e,t=String.fromCodePoint(this.nextStackID++)),t+e},e}(),x=function(){function e(e,t,n){this.source=e,this.flags=t,this.disabled=n}return e.prototype.allows=function(e){return!this.disabled||0==this.disabled[e]},e}(),k=function(){function e(e){this.nextStateCache=[],this.cachedDialect=null;var t=d(e.tokenData),n=e.nodeNames.split(" ");this.minRepeatTerm=n.length;for(var i=0;i=r[0])return-1;for(var i=r[t+1];;){var a=r[i++],o=1&a,s=r[i++];if(o&&n)return s;for(var c=i+(a>>1);i0},e.prototype.startNested=function(e){var t=this.stateSlot(e,0);return 4&t?t>>10:-1},e.prototype.validAction=function(e,t){if(t==this.stateSlot(e,4))return!0;for(var n=this.stateSlot(e,1);;n+=3){if(65535==this.data[n]){if(1!=this.data[n+1])return!1;n=w(this.data,n+2)}if(t==w(this.data,n+1))return!0}},e.prototype.nextStates=function(e){var t=this.nextStateCache[e];if(t)return t;for(var n=[],r=this.stateSlot(e,1);;r+=3){if(65535==this.data[r]){if(1!=this.data[r+1])break;r=w(this.data,r+2)}0==(1&this.data[r+2])&&n.indexOf(this.data[r+1])<0&&n.push(this.data[r+1])}for(var i=this.goto,a=i[0],o=0;o>1);s0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"defaultTop",{get:function(){return this.topRules[Object.keys(this.topRules)[0]]},enumerable:!0,configurable:!0}),e.prototype.dynamicPrecedence=function(e){var t=this.dynamicPrecedences;return null==t?0:t[e]||0},Object.defineProperty(e.prototype,"topType",{get:function(){return this.group.types[this.defaultTop[1]]},enumerable:!0,configurable:!0}),e.prototype.parseDialect=function(e){if(this.cachedDialect&&this.cachedDialect.source==e)return this.cachedDialect;var t=Object.keys(this.dialects),n=t.map((function(){return!1}));if(e)for(var r=0,i=e.split(" ");r=0&&(n[l]=!0)}for(var o=null,s=0;s-1&&e%1==0&&e<=9007199254740991}},function(e,t,n){(function(e){var r=n(54),i=n(276),a=t&&!t.nodeType&&t,o=a&&"object"==typeof e&&e&&!e.nodeType&&e,s=o&&o.exports===a?r.Buffer:void 0,c=(s?s.isBuffer:void 0)||i;e.exports=c}).call(this,n(136)(e))},function(e,t,n){var r=n(278),i=n(279),a=n(280),o=a&&a.isTypedArray,s=o?i(o):r;e.exports=s},function(e,t){var n=/^(?:0|[1-9]\d*)$/;e.exports=function(e,t){var r=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==r||"symbol"!=r&&n.test(e))&&e>-1&&e%1==0&&e-1},T.prototype.set=function(e,t){var n=this.__data__,r=D(n,e);return r<0?n.push([e,t]):n[r][1]=t,this},_.prototype.clear=function(){this.__data__={hash:new P,map:new(S||T),string:new P}},_.prototype.delete=function(e){return L(this,e).delete(e)},_.prototype.get=function(e){return L(this,e).get(e)},_.prototype.has=function(e){return L(this,e).has(e)},_.prototype.set=function(e,t){return L(this,e).set(e,t),this};var I=$((function(e){var t;e=null==(t=e)?"":function(e){if("string"==typeof e)return e;if(Q(e))return M?M.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}(t);var n=[];return s.test(e)&&n.push(""),e.replace(c,(function(e,t,r,i){n.push(r?i.replace(l,"$1"):t||e)})),n}));function z(e){if("string"==typeof e||Q(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function $(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function n(){var r=arguments,i=t?t.apply(this,r):r[0],a=n.cache;if(a.has(i))return a.get(i);var o=e.apply(this,r);return n.cache=a.set(i,o),o};return n.cache=new($.Cache||_),n}$.Cache=_;var F=Array.isArray;function B(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function Q(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==x.call(e)}e.exports=function(e,t,n){var r=null==e?void 0:A(e,t);return void 0===r?n:r}}).call(this,n(90))},function(e,t,n){(function(t){var n=/^\s+|\s+$/g,r=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,a=/^0o[0-7]+$/i,o=parseInt,s="object"==typeof t&&t&&t.Object===Object&&t,c="object"==typeof self&&self&&self.Object===Object&&self,l=s||c||Function("return this")(),u=Object.prototype.toString,f=Math.max,d=Math.min,h=function(){return l.Date.now()};function p(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function v(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==u.call(e)}(e))return NaN;if(p(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=p(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(n,"");var s=i.test(e);return s||a.test(e)?o(e.slice(2),s?2:8):r.test(e)?NaN:+e}e.exports=function(e,t,n){var r,i,a,o,s,c,l=0,u=!1,m=!1,g=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function b(t){var n=r,a=i;return r=i=void 0,l=t,o=e.apply(a,n)}function y(e){return l=e,s=setTimeout(x,t),u?b(e):o}function O(e){var n=e-c;return void 0===c||n>=t||n<0||m&&e-l>=a}function x(){var e=h();if(O(e))return k(e);s=setTimeout(x,function(e){var n=t-(e-c);return m?d(n,a-(e-l)):n}(e))}function k(e){return s=void 0,g&&r?b(e):(r=i=void 0,o)}function w(){var e=h(),n=O(e);if(r=arguments,i=this,c=e,n){if(void 0===s)return y(c);if(m)return s=setTimeout(x,t),b(c)}return void 0===s&&(s=setTimeout(x,t)),o}return t=v(t)||0,p(n)&&(u=!!n.leading,a=(m="maxWait"in n)?f(v(n.maxWait)||0,t):a,g="trailing"in n?!!n.trailing:g),w.cancel=function(){void 0!==s&&clearTimeout(s),l=0,r=c=i=s=void 0},w.flush=function(){return void 0===s?o:k(h())},w}}).call(this,n(90))},function(e,t,n){e.exports=n(340)},,,,,,,,,,function(e,t,n){"use strict";var r=Object.prototype.hasOwnProperty,i=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),a=function(e,t){for(var n=t&&t.plainObjects?Object.create(null):{},r=0;r=48&&a<=57||a>=65&&a<=90||a>=97&&a<=122?n+=t.charAt(r):a<128?n+=i[a]:a<2048?n+=i[192|a>>6]+i[128|63&a]:a<55296||a>=57344?n+=i[224|a>>12]+i[128|a>>6&63]+i[128|63&a]:(r+=1,a=65536+((1023&a)<<10|1023&t.charCodeAt(r)),n+=i[240|a>>18]+i[128|a>>12&63]+i[128|a>>6&63]+i[128|63&a])}return n},isBuffer:function(e){return null!==e&&"undefined"!==typeof e&&!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},merge:function e(t,n,i){if(!n)return t;if("object"!==typeof n){if(Array.isArray(t))t.push(n);else{if("object"!==typeof t)return[t,n];(i.plainObjects||i.allowPrototypes||!r.call(Object.prototype,n))&&(t[n]=!0)}return t}if("object"!==typeof t)return[t].concat(n);var o=t;return Array.isArray(t)&&!Array.isArray(n)&&(o=a(t,i)),Array.isArray(t)&&Array.isArray(n)?(n.forEach((function(n,a){r.call(t,a)?t[a]&&"object"===typeof t[a]?t[a]=e(t[a],n,i):t.push(n):t[a]=n})),t):Object.keys(n).reduce((function(t,a){var o=n[a];return r.call(t,a)?t[a]=e(t[a],o,i):t[a]=o,t}),o)}}},function(e,t,n){"use strict";var r=String.prototype.replace,i=/%20/g;e.exports={default:"RFC3986",formatters:{RFC1738:function(e){return r.call(e,i,"+")},RFC3986:function(e){return e}},RFC1738:"RFC1738",RFC3986:"RFC3986"}},function(e,t,n){(function(t){var n="object"==typeof t&&t&&t.Object===Object&&t;e.exports=n}).call(this,n(90))},function(e,t){var n=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return n.call(e)}catch(t){}try{return e+""}catch(t){}}return""}},function(e,t,n){var r=n(135),i=n(91);e.exports=function(e,t,n){(void 0!==n&&!i(e[t],n)||void 0===n&&!(t in e))&&r(e,t,n)}},function(e,t,n){var r=n(74),i=function(){try{var e=r(Object,"defineProperty");return e({},"",{}),e}catch(t){}}();e.exports=i},function(e,t,n){var r=n(54).Uint8Array;e.exports=r},function(e,t,n){var r=n(164)(Object.getPrototypeOf,Object);e.exports=r},function(e,t){e.exports=function(e,t){return function(n){return e(t(n))}}},function(e,t){e.exports=function(e,t){if(("constructor"!==t||"function"!==typeof e[t])&&"__proto__"!=t)return e[t]}},function(e,t,n){var r=n(167),i=n(135);e.exports=function(e,t,n,a){var o=!n;n||(n={});for(var s=-1,c=t.length;++s1?n[a-1]:void 0,s=a>2?n[2]:void 0;for(o=e.length>3&&"function"==typeof o?(a--,o):void 0,s&&i(n[0],n[1],s)&&(o=a<3?void 0:o,a=1),t=Object(t);++ru))return!1;var d=c.get(e),h=c.get(t);if(d&&h)return d==t&&h==e;var p=-1,v=!0,m=2&n?new r:void 0;for(c.set(e,t),c.set(t,e);++p=0)return 1;return 0}();var i=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()}),r))}};function a(e){return e&&"[object Function]"==={}.toString.call(e)}function o(e,t){if(1!==e.nodeType)return[];var n=e.ownerDocument.defaultView.getComputedStyle(e,null);return t?n[t]:n}function s(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=o(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/(auto|scroll|overlay)/.test(n+i+r)?e:c(s(e))}function l(e){return e&&e.referenceNode?e.referenceNode:e}var u=n&&!(!window.MSInputMethodContext||!document.documentMode),f=n&&/MSIE 10/.test(navigator.userAgent);function d(e){return 11===e?u:10===e?f:u||f}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"===o(n,"position")?h(n):n:e?e.ownerDocument.documentElement:document.documentElement}function p(e){return null!==e.parentNode?p(e.parentNode):e}function v(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,i=n?t:e,a=document.createRange();a.setStart(r,0),a.setEnd(i,0);var o=a.commonAncestorContainer;if(e!==o&&t!==o||r.contains(i))return function(e){var t=e.nodeName;return"BODY"!==t&&("HTML"===t||h(e.firstElementChild)===e)}(o)?o:h(o);var s=p(e);return s.host?v(s.host,t):v(e,p(t).host)}function m(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"top",n="top"===t?"scrollTop":"scrollLeft",r=e.nodeName;if("BODY"===r||"HTML"===r){var i=e.ownerDocument.documentElement,a=e.ownerDocument.scrollingElement||i;return a[n]}return e[n]}function g(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=m(t,"top"),i=m(t,"left"),a=n?-1:1;return e.top+=r*a,e.bottom+=r*a,e.left+=i*a,e.right+=i*a,e}function b(e,t){var n="x"===t?"Left":"Top",r="Left"===n?"Right":"Bottom";return parseFloat(e["border"+n+"Width"])+parseFloat(e["border"+r+"Width"])}function y(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 O(e){var t=e.body,n=e.documentElement,r=d(10)&&getComputedStyle(n);return{height:y("Height",t,n,r),width:y("Width",t,n,r)}}var x=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},k=function(){function e(e,t){for(var n=0;n2&&void 0!==arguments[2]&&arguments[2],r=d(10),i="HTML"===t.nodeName,a=C(e),s=C(t),l=c(e),u=o(t),f=parseFloat(u.borderTopWidth),h=parseFloat(u.borderLeftWidth);n&&i&&(s.top=Math.max(s.top,0),s.left=Math.max(s.left,0));var p=S({top:a.top-s.top-f,left:a.left-s.left-h,width:a.width,height:a.height});if(p.marginTop=0,p.marginLeft=0,!r&&i){var v=parseFloat(u.marginTop),m=parseFloat(u.marginLeft);p.top-=f-v,p.bottom-=f-v,p.left-=h-m,p.right-=h-m,p.marginTop=v,p.marginLeft=m}return(r&&!n?t.contains(l):t===l&&"BODY"!==l.nodeName)&&(p=g(p,t)),p}function M(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e.ownerDocument.documentElement,r=E(e,n),i=Math.max(n.clientWidth,window.innerWidth||0),a=Math.max(n.clientHeight,window.innerHeight||0),o=t?0:m(n),s=t?0:m(n,"left"),c={top:o-r.top+r.marginTop,left:s-r.left+r.marginLeft,width:i,height:a};return S(c)}function P(e){var t=e.nodeName;if("BODY"===t||"HTML"===t)return!1;if("fixed"===o(e,"position"))return!0;var n=s(e);return!!n&&P(n)}function T(e){if(!e||!e.parentElement||d())return document.documentElement;for(var t=e.parentElement;t&&"none"===o(t,"transform");)t=t.parentElement;return t||document.documentElement}function _(e,t,n,r){var i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],a={top:0,left:0},o=i?T(e):v(e,l(t));if("viewport"===r)a=M(o,i);else{var u=void 0;"scrollParent"===r?"BODY"===(u=c(s(t))).nodeName&&(u=e.ownerDocument.documentElement):u="window"===r?e.ownerDocument.documentElement:r;var f=E(u,o,i);if("HTML"!==u.nodeName||P(o))a=f;else{var d=O(e.ownerDocument),h=d.height,p=d.width;a.top+=f.top-f.marginTop,a.bottom=h+f.top,a.left+=f.left-f.marginLeft,a.right=p+f.left}}var m="number"===typeof(n=n||0);return a.left+=m?n:n.left||0,a.top+=m?n:n.top||0,a.right-=m?n:n.right||0,a.bottom-=m?n:n.bottom||0,a}function D(e){return e.width*e.height}function A(e,t,n,r,i){var a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;if(-1===e.indexOf("auto"))return e;var o=_(n,r,a,i),s={top:{width:o.width,height:t.top-o.top},right:{width:o.right-t.right,height:o.height},bottom:{width:o.width,height:o.bottom-t.bottom},left:{width:t.left-o.left,height:o.height}},c=Object.keys(s).map((function(e){return j({key:e},s[e],{area:D(s[e])})})).sort((function(e,t){return t.area-e.area})),l=c.filter((function(e){var t=e.width,r=e.height;return t>=n.clientWidth&&r>=n.clientHeight})),u=l.length>0?l[0].key:c[0].key,f=e.split("-")[1];return u+(f?"-"+f:"")}function R(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,i=r?T(t):v(t,l(n));return E(n,i,r)}function L(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 N(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 I(e,t,n){n=n.split("-")[0];var r=L(e),i={width:r.width,height:r.height},a=-1!==["right","left"].indexOf(n),o=a?"top":"left",s=a?"left":"top",c=a?"height":"width",l=a?"width":"height";return i[o]=t[o]+t[c]/2-r[c]/2,i[s]=n===s?t[s]-r[l]:t[N(s)],i}function z(e,t){return Array.prototype.find?e.find(t):e.filter(t)[0]}function $(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=z(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&&a(n)&&(t.offsets.popper=S(t.offsets.popper),t.offsets.reference=S(t.offsets.reference),t=n(t,e))})),t}function F(){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=A(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=I(this.popper,e.offsets.reference,e.placement),e.offsets.popper.position=this.options.positionFixed?"fixed":"absolute",e=$(this.modifiers,e),this.state.isCreated?this.options.onUpdate(e):(this.state.isCreated=!0,this.options.onCreate(e))}}function B(e,t){return e.some((function(e){var n=e.name;return e.enabled&&n===t}))}function Q(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=ee.indexOf(e),r=ee.slice(n+1).concat(ee.slice(0,n));return t?r.reverse():r}var ne="flip",re="clockwise",ie="counterclockwise";function ae(e,t,n,r){var i=[0,0],a=-1!==["right","left"].indexOf(r),o=e.split(/(\+|\-)/).map((function(e){return e.trim()})),s=o.indexOf(z(o,(function(e){return-1!==e.search(/,|\s/)})));o[s]&&-1===o[s].indexOf(",")&&console.warn("Offsets separated by white space(s) are deprecated, use a comma (,) instead.");var c=/\s*,\s*|\s+/,l=-1!==s?[o.slice(0,s).concat([o[s].split(c)[0]]),[o[s].split(c)[1]].concat(o.slice(s+1))]:[o];return(l=l.map((function(e,r){var i=(1===r?!a:a)?"height":"width",o=!1;return e.reduce((function(e,t){return""===e[e.length-1]&&-1!==["+","-"].indexOf(t)?(e[e.length-1]=t,o=!0,e):o?(e[e.length-1]+=t,o=!1,e):e.concat(t)}),[]).map((function(e){return function(e,t,n,r){var i=e.match(/((?:\-|\+)?\d*\.?\d*)(.*)/),a=+i[1],o=i[2];if(!a)return e;if(0===o.indexOf("%")){var s=void 0;switch(o){case"%p":s=n;break;case"%":case"%r":default:s=r}return S(s)[t]/100*a}if("vh"===o||"vw"===o)return("vh"===o?Math.max(document.documentElement.clientHeight,window.innerHeight||0):Math.max(document.documentElement.clientWidth,window.innerWidth||0))/100*a;return a}(e,i,t,n)}))}))).forEach((function(e,t){e.forEach((function(n,r){X(n)&&(i[t]+=n*("-"===e[r-1]?-1:1))}))})),i}var oe={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 i=e.offsets,a=i.reference,o=i.popper,s=-1!==["bottom","top"].indexOf(n),c=s?"left":"top",l=s?"width":"height",u={start:w({},c,a[c]),end:w({},c,a[c]+a[l]-o[l])};e.offsets.popper=j({},o,u[r])}return e}},offset:{order:200,enabled:!0,fn:function(e,t){var n=t.offset,r=e.placement,i=e.offsets,a=i.popper,o=i.reference,s=r.split("-")[0],c=void 0;return c=X(+n)?[+n,0]:ae(n,a,o,s),"left"===s?(a.top+=c[0],a.left-=c[1]):"right"===s?(a.top+=c[0],a.left+=c[1]):"top"===s?(a.left+=c[0],a.top-=c[1]):"bottom"===s&&(a.left+=c[0],a.top+=c[1]),e.popper=a,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=Q("transform"),i=e.instance.popper.style,a=i.top,o=i.left,s=i[r];i.top="",i.left="",i[r]="";var c=_(e.instance.popper,e.instance.reference,t.padding,n,e.positionFixed);i.top=a,i.left=o,i[r]=s,t.boundaries=c;var l=t.priority,u=e.offsets.popper,f={primary:function(e){var n=u[e];return u[e]c[e]&&!t.escapeWithReference&&(r=Math.min(u[n],c[e]-("right"===e?u.width:u.height))),w({},n,r)}};return l.forEach((function(e){var t=-1!==["left","top"].indexOf(e)?"primary":"secondary";u=j({},u,f[t](e))})),e.offsets.popper=u,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,i=e.placement.split("-")[0],a=Math.floor,o=-1!==["top","bottom"].indexOf(i),s=o?"right":"bottom",c=o?"left":"top",l=o?"width":"height";return n[s]a(r[s])&&(e.offsets.popper[c]=a(r[s])),e}},arrow:{order:500,enabled:!0,fn:function(e,t){var n;if(!Z(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 i=e.placement.split("-")[0],a=e.offsets,s=a.popper,c=a.reference,l=-1!==["left","right"].indexOf(i),u=l?"height":"width",f=l?"Top":"Left",d=f.toLowerCase(),h=l?"left":"top",p=l?"bottom":"right",v=L(r)[u];c[p]-vs[p]&&(e.offsets.popper[d]+=c[d]+v-s[p]),e.offsets.popper=S(e.offsets.popper);var m=c[d]+c[u]/2-v/2,g=o(e.instance.popper),b=parseFloat(g["margin"+f]),y=parseFloat(g["border"+f+"Width"]),O=m-e.offsets.popper[d]-b-y;return O=Math.max(Math.min(s[u]-v,O),0),e.arrowElement=r,e.offsets.arrow=(w(n={},d,Math.round(O)),w(n,h,""),n),e},element:"[x-arrow]"},flip:{order:600,enabled:!0,fn:function(e,t){if(B(e.instance.modifiers,"inner"))return e;if(e.flipped&&e.placement===e.originalPlacement)return e;var n=_(e.instance.popper,e.instance.reference,t.padding,t.boundariesElement,e.positionFixed),r=e.placement.split("-")[0],i=N(r),a=e.placement.split("-")[1]||"",o=[];switch(t.behavior){case ne:o=[r,i];break;case re:o=te(r);break;case ie:o=te(r,!0);break;default:o=t.behavior}return o.forEach((function(s,c){if(r!==s||o.length===c+1)return e;r=e.placement.split("-")[0],i=N(r);var l=e.offsets.popper,u=e.offsets.reference,f=Math.floor,d="left"===r&&f(l.right)>f(u.left)||"right"===r&&f(l.left)f(u.top)||"bottom"===r&&f(l.top)f(n.right),v=f(l.top)f(n.bottom),g="left"===r&&h||"right"===r&&p||"top"===r&&v||"bottom"===r&&m,b=-1!==["top","bottom"].indexOf(r),y=!!t.flipVariations&&(b&&"start"===a&&h||b&&"end"===a&&p||!b&&"start"===a&&v||!b&&"end"===a&&m),O=!!t.flipVariationsByContent&&(b&&"start"===a&&p||b&&"end"===a&&h||!b&&"start"===a&&m||!b&&"end"===a&&v),x=y||O;(d||g||x)&&(e.flipped=!0,(d||g)&&(r=o[c+1]),x&&(a=function(e){return"end"===e?"start":"start"===e?"end":e}(a)),e.placement=r+(a?"-"+a:""),e.offsets.popper=j({},e.offsets.popper,I(e.instance.popper,e.offsets.reference,e.placement)),e=$(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,i=r.popper,a=r.reference,o=-1!==["left","right"].indexOf(n),s=-1===["top","left"].indexOf(n);return i[o?"left":"top"]=a[n]-(s?i[o?"width":"height"]:0),e.placement=N(t),e.offsets.popper=S(i),e}},hide:{order:800,enabled:!0,fn:function(e){if(!Z(e.instance.modifiers,"hide","preventOverflow"))return e;var t=e.offsets.reference,n=z(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=i(this.update.bind(this)),this.options=j({},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(j({},e.Defaults.modifiers,o.modifiers)).forEach((function(t){r.options.modifiers[t]=j({},e.Defaults.modifiers[t]||{},o.modifiers?o.modifiers[t]:{})})),this.modifiers=Object.keys(this.options.modifiers).map((function(e){return j({name:e},r.options.modifiers[e])})).sort((function(e,t){return e.order-t.order})),this.modifiers.forEach((function(e){e.enabled&&a(e.onLoad)&&e.onLoad(r.reference,r.popper,r.options,e,r.state)})),this.update();var s=this.options.eventsEnabled;s&&this.enableEventListeners(),this.state.eventsEnabled=s}return k(e,[{key:"update",value:function(){return F.call(this)}},{key:"destroy",value:function(){return W.call(this)}},{key:"enableEventListeners",value:function(){return q.call(this)}},{key:"disableEventListeners",value:function(){return Y.call(this)}}]),e}();se.Utils=("undefined"!==typeof window?window:e).PopperUtils,se.placements=J,se.Defaults=oe,t.a=se}).call(this,n(90))},function(e,t,n){"use strict";var r=n(48),i=n(49);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=i(n(0)),o=(0,r(n(50)).default)(a.createElement("path",{d:"M10 20h4V4h-4v16zm-6 0h4v-8H4v8zM16 9v11h4V9h-4z"}),"Equalizer");t.default=o},function(e,t,n){"use strict";var r=n(48),i=n(49);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=i(n(0)),o=(0,r(n(50)).default)(a.createElement("path",{d:"M3.5 18.49l6-6.01 4 4L22 6.92l-1.41-1.41-7.09 7.97-4-4L2 16.99z"}),"ShowChart");t.default=o},function(e,t,n){"use strict";var r=n(48),i=n(49);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=i(n(0)),o=(0,r(n(50)).default)(a.createElement("path",{d:"M9.4 16.6L4.8 12l4.6-4.6L8 6l-6 6 6 6 1.4-1.4zm5.2 0l4.6-4.6-4.6-4.6L16 6l6 6-6 6-1.4-1.4z"}),"Code");t.default=o},function(e,t,n){"use strict";var r=n(48),i=n(49);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=i(n(0)),o=(0,r(n(50)).default)(a.createElement("path",{d:"M10 10.02h5V21h-5zM17 21h3c1.1 0 2-.9 2-2v-9h-5v11zm3-18H5c-1.1 0-2 .9-2 2v3h19V5c0-1.1-.9-2-2-2zM3 19c0 1.1.9 2 2 2h3V10H3v9z"}),"TableChart");t.default=o},function(e,t,n){var r=n(236),i=n(170)((function(e,t,n){r(e,t,n)}));e.exports=i},function(e,t,n){var r=n(295)(n(334));e.exports=r},function(e,t,n){"use strict";var r=n(48),i=n(49);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=i(n(0)),o=(0,r(n(50)).default)(a.createElement("path",{d:"M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"}),"Person");t.default=o},function(e,t,n){"use strict";var r=n(48),i=n(49);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=i(n(0)),o=(0,r(n(50)).default)(a.createElement("path",{d:"M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zm-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2zm3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1 1.71 0 3.1 1.39 3.1 3.1v2z"}),"Lock");t.default=o},function(e,t,n){"use strict";var r=n(48),i=n(49);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=i(n(0)),o=(0,r(n(50)).default)(a.createElement("path",{d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"}),"ExpandMore");t.default=o},function(e,t,n){"use strict";var r=n(48),i=n(49);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=i(n(0)),o=(0,r(n(50)).default)(a.createElement("path",{d:"M10 16.5l6-4.5-6-4.5v9zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z"}),"PlayCircleOutline");t.default=o},function(e,t,n){"use strict";var r=n(48),i=n(49);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=i(n(0)),o=(0,r(n(50)).default)(a.createElement("path",{d:"M12 1L3 5v6c0 5.55 3.84 10.74 9 12 5.16-1.26 9-6.45 9-12V5l-9-4zm0 10.99h7c-.53 4.12-3.28 7.79-7 8.94V12H5V6.3l7-3.11v8.8z"}),"Security");t.default=o},function(e,t,n){"use strict";var r=n(48),i=n(49);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=i(n(0)),o=(0,r(n(50)).default)(a.createElement("path",{d:"M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6z"}),"Settings");t.default=o},function(e,t,n){"use strict";function r(e,t,n,r,i,a,o){try{var s=e[a](o),c=s.value}catch(l){return void n(l)}s.done?t(c):Promise.resolve(c).then(r,i)}function i(e){return function(){var t=this,n=arguments;return new Promise((function(i,a){var o=e.apply(t,n);function s(e){r(o,i,a,s,c,"next",e)}function c(e){r(o,i,a,s,c,"throw",e)}s(void 0)}))}}n.d(t,"a",(function(){return i}))},function(e,t,n){"use strict";var r=n(48),i=n(49);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=i(n(0)),o=(0,r(n(50)).default)(a.createElement("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm-1 4l6 6v10c0 1.1-.9 2-2 2H7.99C6.89 23 6 22.1 6 21l.01-14c0-1.1.89-2 1.99-2h7zm-1 7h5.5L14 6.5V12z"}),"FileCopy");t.default=o},function(e,t,n){"use strict";var r=n(44),i=n.n(r),a=n(197),o=n.n(a),s=n(198),c=n.n(s);i.a.extend(o.a),i.a.extend(c.a);var l=function(){function e(e){var t=void 0===e?{}:e,n=t.locale,r=t.instance,a=t.dayjs;this.yearFormat="YYYY",this.yearMonthFormat="MMMM YYYY",this.dateTime12hFormat="MMMM Do hh:mm a",this.dateTime24hFormat="MMMM Do HH:mm",this.time12hFormat="hh:mm A",this.time24hFormat="HH:mm",this.dateFormat="MMMM Do",this.dayjs=function(e,t){return t?function(){for(var n=[],r=0;r68?1900:2e3)},s=function(e){return function(t){this[e]=+t}},c=[/[+-]\d\d:?(\d\d)?|Z/,function(e){(this.zone||(this.zone={})).offset=function(e){if(!e)return 0;if("Z"===e)return 0;var t=e.match(/([+-]|\d\d)/g),n=60*t[1]+(+t[2]||0);return 0===n?0:"+"===t[0]?-n:n}(e)}],l=function(e){var t=a[e];return t&&(t.indexOf?t:t.s.concat(t.f))},u=function(e,t){var n,r=a.meridiem;if(r){for(var i=1;i<=24;i+=1)if(e.indexOf(r(i,0,t))>-1){n=i>12;break}}else n=e===(t?"pm":"PM");return n},f={A:[i,function(e){this.afternoon=u(e,!1)}],a:[i,function(e){this.afternoon=u(e,!0)}],S:[/\d/,function(e){this.milliseconds=100*+e}],SS:[n,function(e){this.milliseconds=10*+e}],SSS:[/\d{3}/,function(e){this.milliseconds=+e}],s:[r,s("seconds")],ss:[r,s("seconds")],m:[r,s("minutes")],mm:[r,s("minutes")],H:[r,s("hours")],h:[r,s("hours")],HH:[r,s("hours")],hh:[r,s("hours")],D:[r,s("day")],DD:[n,s("day")],Do:[i,function(e){var t=a.ordinal,n=e.match(/\d+/);if(this.day=n[0],t)for(var r=1;r<=31;r+=1)t(r).replace(/\[|\]/g,"")===e&&(this.day=r)}],M:[r,s("month")],MM:[n,s("month")],MMM:[i,function(e){var t=l("months"),n=(l("monthsShort")||t.map((function(e){return e.substr(0,3)}))).indexOf(e)+1;if(n<1)throw new Error;this.month=n%12||n}],MMMM:[i,function(e){var t=l("months").indexOf(e)+1;if(t<1)throw new Error;this.month=t%12||t}],Y:[/[+-]?\d+/,s("year")],YY:[n,function(e){this.year=o(e)}],YYYY:[/\d{4}/,s("year")],Z:c,ZZ:c};function d(n){var r,i;r=n,i=a&&a.formats;for(var o=(n=r.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(t,n,r){var a=r&&r.toUpperCase();return n||i[r]||e[r]||i[a].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(e,t,n){return t||n.slice(1)}))}))).match(t),s=o.length,c=0;c-1)return new Date(("X"===t?1e3:1)*e);var r=d(t)(e),i=r.year,a=r.month,o=r.day,s=r.hours,c=r.minutes,l=r.seconds,u=r.milliseconds,f=r.zone,h=new Date,p=o||(i||a?1:h.getDate()),v=i||h.getFullYear(),m=0;i&&!a||(m=a>0?a-1:h.getMonth());var g=s||0,b=c||0,y=l||0,O=u||0;return f?new Date(Date.UTC(v,m,p,g,b,y,O+60*f.offset*1e3)):n?new Date(Date.UTC(v,m,p,g,b,y,O)):new Date(v,m,p,g,b,y,O)}catch(e){return new Date("")}}(t,s,r),this.init(),f&&!0!==f&&(this.$L=this.locale(f).$L),u&&t!=this.format(s)&&(this.$d=new Date("")),a={}}else if(s instanceof Array)for(var h=s.length,p=1;p<=h;p+=1){o[1]=s[p-1];var v=n.apply(this,o);if(v.isValid()){this.$d=v.$d,this.$L=v.$L,this.init();break}p===h&&(this.$d=new Date(""))}else i.call(this,e)}}}()},function(e,t,n){e.exports=function(){"use strict";return function(e,t,n){var r=t.prototype,i=r.format;n.en.ordinal=function(e){var t=["th","st","nd","rd"],n=e%100;return"["+e+(t[(n-20)%10]||t[n]||t[0])+"]"},r.format=function(e){var t=this,n=this.$locale();if(!this.isValid())return i.bind(this)(e);var r=this.$utils(),a=(e||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,(function(e){switch(e){case"Q":return Math.ceil((t.$M+1)/3);case"Do":return n.ordinal(t.$D);case"gggg":return t.weekYear();case"GGGG":return t.isoWeekYear();case"wo":return n.ordinal(t.week(),"W");case"w":case"ww":return r.s(t.week(),"w"===e?1:2,"0");case"W":case"WW":return r.s(t.isoWeek(),"W"===e?1:2,"0");case"k":case"kk":return r.s(String(0===t.$H?24:t.$H),"k"===e?1:2,"0");case"X":return Math.floor(t.$d.getTime()/1e3);case"x":return t.$d.getTime();case"z":return"["+t.offsetName()+"]";case"zzz":return"["+t.offsetName("long")+"]";default:return e}}));return i.bind(this)(a)}}}()},function(e,t,n){"use strict";var r=n(19),i=n(8),a=n(344),o=n(2),s=["xs","sm","md","lg","xl"];function c(e){var t=e.values,n=void 0===t?{xs:0,sm:600,md:960,lg:1280,xl:1920}:t,r=e.unit,a=void 0===r?"px":r,c=e.step,l=void 0===c?5:c,u=Object(i.a)(e,["values","unit","step"]);function f(e){var t="number"===typeof n[e]?n[e]:e;return"@media (min-width:".concat(t).concat(a,")")}function d(e,t){var r=s.indexOf(t);return r===s.length-1?f(e):"@media (min-width:".concat("number"===typeof n[e]?n[e]:e).concat(a,") and ")+"(max-width:".concat((-1!==r&&"number"===typeof n[s[r+1]]?n[s[r+1]]:t)-l/100).concat(a,")")}return Object(o.a)({keys:s,values:n,up:f,down:function(e){var t=s.indexOf(e)+1,r=n[s[t]];return t===s.length?f("xs"):"@media (max-width:".concat(("number"===typeof r&&t>0?r:e)-l/100).concat(a,")")},between:d,only:function(e){return d(e,e)},width:function(e){return n[e]}},u)}function l(e,t,n){var i;return Object(o.a)({gutters:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object(o.a)({paddingLeft:t(2),paddingRight:t(2)},n,Object(r.a)({},e.up("sm"),Object(o.a)({paddingLeft:t(3),paddingRight:t(3)},n[e.up("sm")])))},toolbar:(i={minHeight:56},Object(r.a)(i,"".concat(e.up("xs")," and (orientation: landscape)"),{minHeight:48}),Object(r.a)(i,e.up("sm"),{minHeight:64}),i)},n)}var u=n(205),f={black:"#000",white:"#fff"},d={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#d5d5d5",A200:"#aaaaaa",A400:"#303030",A700:"#616161"},h={50:"#e8eaf6",100:"#c5cae9",200:"#9fa8da",300:"#7986cb",400:"#5c6bc0",500:"#3f51b5",600:"#3949ab",700:"#303f9f",800:"#283593",900:"#1a237e",A100:"#8c9eff",A200:"#536dfe",A400:"#3d5afe",A700:"#304ffe"},p={50:"#fce4ec",100:"#f8bbd0",200:"#f48fb1",300:"#f06292",400:"#ec407a",500:"#e91e63",600:"#d81b60",700:"#c2185b",800:"#ad1457",900:"#880e4f",A100:"#ff80ab",A200:"#ff4081",A400:"#f50057",A700:"#c51162"},v={50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",A100:"#ff8a80",A200:"#ff5252",A400:"#ff1744",A700:"#d50000"},m={50:"#fff3e0",100:"#ffe0b2",200:"#ffcc80",300:"#ffb74d",400:"#ffa726",500:"#ff9800",600:"#fb8c00",700:"#f57c00",800:"#ef6c00",900:"#e65100",A100:"#ffd180",A200:"#ffab40",A400:"#ff9100",A700:"#ff6d00"},g={50:"#e3f2fd",100:"#bbdefb",200:"#90caf9",300:"#64b5f6",400:"#42a5f5",500:"#2196f3",600:"#1e88e5",700:"#1976d2",800:"#1565c0",900:"#0d47a1",A100:"#82b1ff",A200:"#448aff",A400:"#2979ff",A700:"#2962ff"},b={50:"#e8f5e9",100:"#c8e6c9",200:"#a5d6a7",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20",A100:"#b9f6ca",A200:"#69f0ae",A400:"#00e676",A700:"#00c853"},y=n(22),O={text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.54)",disabled:"rgba(0, 0, 0, 0.38)",hint:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:f.white,default:d[50]},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}},x={text:{primary:f.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",hint:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:d[800],default:"#303030"},action:{active:f.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}};function k(e,t,n,r){var i=r.light||r,a=r.dark||1.5*r;e[t]||(e.hasOwnProperty(n)?e[t]=e[n]:"light"===t?e.light=Object(y.e)(e.main,i):"dark"===t&&(e.dark=Object(y.a)(e.main,a)))}function w(e){var t=e.primary,n=void 0===t?{light:h[300],main:h[500],dark:h[700]}:t,r=e.secondary,s=void 0===r?{light:p.A200,main:p.A400,dark:p.A700}:r,c=e.error,l=void 0===c?{light:v[300],main:v[500],dark:v[700]}:c,w=e.warning,j=void 0===w?{light:m[300],main:m[500],dark:m[700]}:w,S=e.info,C=void 0===S?{light:g[300],main:g[500],dark:g[700]}:S,E=e.success,M=void 0===E?{light:b[300],main:b[500],dark:b[700]}:E,P=e.type,T=void 0===P?"light":P,_=e.contrastThreshold,D=void 0===_?3:_,A=e.tonalOffset,R=void 0===A?.2:A,L=Object(i.a)(e,["primary","secondary","error","warning","info","success","type","contrastThreshold","tonalOffset"]);function N(e){return Object(y.d)(e,x.text.primary)>=D?x.text.primary:O.text.primary}var I=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:500,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:300,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:700;if(!(e=Object(o.a)({},e)).main&&e[t]&&(e.main=e[t]),!e.main)throw new Error(Object(u.a)(4,t));if("string"!==typeof e.main)throw new Error(Object(u.a)(5,JSON.stringify(e.main)));return k(e,"light",n,R),k(e,"dark",r,R),e.contrastText||(e.contrastText=N(e.main)),e},z={dark:x,light:O};return Object(a.a)(Object(o.a)({common:f,type:T,primary:I(n),secondary:I(s,"A400","A200","A700"),error:I(l),warning:I(j),info:I(C),success:I(M),grey:d,contrastThreshold:D,getContrastText:N,augmentColor:I,tonalOffset:R},z[T]),L)}function j(e){return Math.round(1e5*e)/1e5}var S={textTransform:"uppercase"},C='"Roboto", "Helvetica", "Arial", sans-serif';function E(e,t){var n="function"===typeof t?t(e):t,r=n.fontFamily,s=void 0===r?C:r,c=n.fontSize,l=void 0===c?14:c,u=n.fontWeightLight,f=void 0===u?300:u,d=n.fontWeightRegular,h=void 0===d?400:d,p=n.fontWeightMedium,v=void 0===p?500:p,m=n.fontWeightBold,g=void 0===m?700:m,b=n.htmlFontSize,y=void 0===b?16:b,O=n.allVariants,x=n.pxToRem,k=Object(i.a)(n,["fontFamily","fontSize","fontWeightLight","fontWeightRegular","fontWeightMedium","fontWeightBold","htmlFontSize","allVariants","pxToRem"]);var w=l/14,E=x||function(e){return"".concat(e/y*w,"rem")},M=function(e,t,n,r,i){return Object(o.a)({fontFamily:s,fontWeight:e,fontSize:E(t),lineHeight:n},s===C?{letterSpacing:"".concat(j(r/t),"em")}:{},i,O)},P={h1:M(f,96,1.167,-1.5),h2:M(f,60,1.2,-.5),h3:M(h,48,1.167,0),h4:M(h,34,1.235,.25),h5:M(h,24,1.334,0),h6:M(v,20,1.6,.15),subtitle1:M(h,16,1.75,.15),subtitle2:M(v,14,1.57,.1),body1:M(h,16,1.5,.15),body2:M(h,14,1.43,.15),button:M(v,14,1.75,.4,S),caption:M(h,12,1.66,.4),overline:M(h,12,2.66,1,S)};return Object(a.a)(Object(o.a)({htmlFontSize:y,pxToRem:E,round:j,fontFamily:s,fontSize:l,fontWeightLight:f,fontWeightRegular:h,fontWeightMedium:v,fontWeightBold:g},P),k,{clone:!1})}function M(){return["".concat(arguments.length<=0?void 0:arguments[0],"px ").concat(arguments.length<=1?void 0:arguments[1],"px ").concat(arguments.length<=2?void 0:arguments[2],"px ").concat(arguments.length<=3?void 0:arguments[3],"px rgba(0,0,0,").concat(.2,")"),"".concat(arguments.length<=4?void 0:arguments[4],"px ").concat(arguments.length<=5?void 0:arguments[5],"px ").concat(arguments.length<=6?void 0:arguments[6],"px ").concat(arguments.length<=7?void 0:arguments[7],"px rgba(0,0,0,").concat(.14,")"),"".concat(arguments.length<=8?void 0:arguments[8],"px ").concat(arguments.length<=9?void 0:arguments[9],"px ").concat(arguments.length<=10?void 0:arguments[10],"px ").concat(arguments.length<=11?void 0:arguments[11],"px rgba(0,0,0,").concat(.12,")")].join(",")}var P=["none",M(0,2,1,-1,0,1,1,0,0,1,3,0),M(0,3,1,-2,0,2,2,0,0,1,5,0),M(0,3,3,-2,0,3,4,0,0,1,8,0),M(0,2,4,-1,0,4,5,0,0,1,10,0),M(0,3,5,-1,0,5,8,0,0,1,14,0),M(0,3,5,-1,0,6,10,0,0,1,18,0),M(0,4,5,-2,0,7,10,1,0,2,16,1),M(0,5,5,-3,0,8,10,1,0,3,14,2),M(0,5,6,-3,0,9,12,1,0,3,16,2),M(0,6,6,-3,0,10,14,1,0,4,18,3),M(0,6,7,-4,0,11,15,1,0,4,20,3),M(0,7,8,-4,0,12,17,2,0,5,22,4),M(0,7,8,-4,0,13,19,2,0,5,24,4),M(0,7,9,-4,0,14,21,2,0,5,26,4),M(0,8,9,-5,0,15,22,2,0,6,28,5),M(0,8,10,-5,0,16,24,2,0,6,30,5),M(0,8,11,-5,0,17,26,2,0,6,32,5),M(0,9,11,-5,0,18,28,2,0,7,34,6),M(0,9,12,-6,0,19,29,2,0,7,36,6),M(0,10,13,-6,0,20,31,3,0,8,38,7),M(0,10,13,-6,0,21,33,3,0,8,40,7),M(0,10,14,-6,0,22,35,3,0,8,42,7),M(0,11,14,-7,0,23,36,3,0,9,44,8),M(0,11,15,-7,0,24,38,3,0,9,46,8)],T={borderRadius:4},_=n(423);function D(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:8;if(e.mui)return e;var t=Object(_.a)({spacing:e}),n=function(){for(var e=arguments.length,n=new Array(e),r=0;r0&&void 0!==arguments[0]?arguments[0]:{},t=e.breakpoints,n=void 0===t?{}:t,r=e.mixins,o=void 0===r?{}:r,s=e.palette,u=void 0===s?{}:s,f=e.spacing,d=e.typography,h=void 0===d?{}:d,p=Object(i.a)(e,["breakpoints","mixins","palette","spacing","typography"]),v=w(u),m=c(n),g=D(f),b=Object(a.a)({breakpoints:m,direction:"ltr",mixins:l(m,g,o),overrides:{},palette:v,props:{},shadows:P,typography:E(v,h),spacing:g,shape:T,transitions:A.a,zIndex:R.a},p),y=arguments.length,O=new Array(y>1?y-1:0),x=1;x-1;return function(e){return b(e,!0,1,void 0,a&&!function(e){var t,n;return e.pos==(null===(t=e.options)||void 0===t?void 0:t.simulateBreak)&&(null===(n=e.options)||void 0===n?void 0:n.simulateDoubleBreak)}(e)?i.start:void 0)}}return null==e.parent?v:null}function v(){return 0}var m=function(e){Object(s.a)(n,e);var t=Object(c.a)(n);function n(e,i,a){var o;return Object(r.a)(this,n),(o=t.call(this,e.state,e.options)).pos=i,o.node=a,o}return Object(i.a)(n,[{key:"textAfter",get:function(){return this.textAfterPos(this.pos)}},{key:"baseIndent",get:function(){for(var e=this.state.doc.lineAt(this.node.start);;){for(var t=this.node.resolve(e.from);t.parent&&t.parent.start==t.start;)t=t.parent;if(g(t,this.node))break;e=this.state.doc.lineAt(t.start)}return this.lineIndent(e)}}]),n}(u.g);function g(e,t){for(var n=t;n;n=n.parent)if(e==n)return!0;return!1}function b(e,t,n,r,i){var a=e.textAfter,o=a.match(/^\s*/)[0].length,s=r&&a.slice(o,o+r.length)==r||i==e.pos+o,c=t?function(e){var t,n=e.node,r=n.childAfter(n.start),i=n.lastChild;if(!r)return null;for(var a=null===(t=e.options)||void 0===t?void 0:t.simulateBreak,o=e.state.doc.lineAt(r.start),s=null==a||a<=o.from?o.to:Math.min(o.to,a),c=r.end;;){var u=n.childAfter(c);if(!u||u==i)return null;if(!u.type.prop(l.c.skipped))return u.startn)){if(r&&i.start=t&&s.to>n&&(r=s)}}return r})))]}return Object(i.a)(e,[{key:"withDialect",value:function(t){return new e(this.parser,t,this.languageData)}},{key:"getTree",value:function(e){return e.field(this.field).tree}},{key:"parsePos",value:function(e){return e.field(this.field).upto}},{key:"ensureTree",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:100,r=e.field(this.field);if(r.upto>=t)return r.updatedTree;if(r.parse||r.startParse(this,e.doc),r.parse.pos1&&void 0!==arguments[1]?arguments[1]:{},r=u.f.define({combine:n.languageData?function(e){return e.concat(n.languageData)}:void 0});return new e(t.withProps(u.n.add(Object(o.a)({},t.topType.name,r))),n.dialect||"",r)}}]),e}(),x=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.length;Object(r.a)(this,e),this.doc=t,this.length=n,this.cursorPos=0,this.string="",this.cursor=t.iter()}return Object(i.a)(e,[{key:"get",value:function(e){if(e>=this.length)return-1;var t=this.cursorPos-this.string.length;return(e=this.cursorPos)&&(e=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-n,t-n)}},{key:"clip",value:function(t){return new e(this.doc,t)}}]),e}();function k(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:5e6,r=Date.now()+t;;){var i=e.advance();if(i)return i;if(e.pos>n||Date.now()>r)return null}}function w(e,t){var n=e.forceFinish(),r=n.applyChanges([{fromA:e.pos,toA:n.length,fromB:e.pos,toB:n.length}]).append(t.applyChanges([{fromA:0,toA:e.pos,fromB:0,toB:e.pos}]));return{parsed:n,cache:r}}var j=function(){function e(t,n,i){Object(r.a)(this,e),this.tree=t,this.upto=n,this.cache=i,this.parse=null,this.updatedTree=t}return Object(i.a)(e,[{key:"apply",value:function(t,n,r){var i,o=Object(a.a)(t.effects);try{for(o.s();!(i=o.n()).done;){var s=i.value;if(s.is(r))return s.value}}catch(l){o.e(l)}finally{o.f()}if(!t.docChanged)return this;var c=[];return t.changes.iterChangedRanges((function(e,t,n,r){return c.push({fromA:e,toA:t,fromB:n,toB:r})})),e.advance((this.parse?w(this.parse,this.updatedTree).cache:this.cache).applyChanges(c),n,t.state.doc)}},{key:"startParse",value:function(e,t){this.parse=e.parser.startParse(new x(t),{cache:this.cache,dialect:e.dialect})}},{key:"stopParse",value:function(e,t){if(e)this.cache=e;else{var n=w(this.parse,this.updatedTree);e=n.parsed,this.cache=n.cache}return this.updatedTree=e,this.upto=null!==t&&void 0!==t?t:this.parse.pos,this.parse=null,e}}],[{key:"advance",value:function(t,n,r){var i=n.parser.startParse(new x(r),{cache:t,dialect:n.dialect}),a=k(i,25);if(a)return new e(a,r.length,a);var o=w(i,t);return new e(o.parsed,i.pos,o.cache)}}]),e}(),S="undefined"!=typeof window&&window.requestIdleCallback||function(e,t){var n=t.timeout;return setTimeout(e,n)},C="undefined"!=typeof window&&window.cancelIdleCallback||clearTimeout,E=function(){function e(t,n,i){Object(r.a)(this,e),this.view=t,this.syntax=n,this.setSyntax=i,this.working=-1,this.work=this.work.bind(this),this.scheduleWork()}return Object(i.a)(e,[{key:"update",value:function(e){e.docChanged&&this.scheduleWork()}},{key:"scheduleWork",value:function(){if(!(this.working>-1)){var e=this.view.state;e.field(this.syntax.field).upto>=e.doc.length||(this.working=S(this.work,{timeout:200}))}}},{key:"work",value:function(e){this.working=-1;var t=this.view.state,n=t.field(this.syntax.field);if(!(n.upto>=t.doc.length)){n.parse||n.startParse(this.syntax,t.doc);var r=k(n.parse,e?Math.max(25,e.timeRemaining()):100);if(r||n.parse.badness>.8){var i=n.stopParse(r,t.doc.length);this.view.dispatch({effects:this.setSyntax.of(new j(i,t.doc.length,n.cache))})}else this.scheduleWork()}}},{key:"destroy",value:function(){this.working>=0&&C(this.working)}}]),e}(),M=n(124),P={bool:1,ignoring:2,on:3,group_left:4,group_right:5,offset:6},T={avg:7,bottomk:8,count:9,count_values:10,group:11,max:12,min:13,quantile:14,stddev:15,stdvar:16,sum:17,topk:18,by:19,without:20,and:21,or:22,unless:23},_={__proto__:null,absent_over_time:257,absent:259,abs:261,avg_over_time:263,ceil:265,changes:267,clamp_max:269,clamp_min:271,count_over_time:273,days_in_month:275,day_of_month:277,day_of_week:279,delta:281,deriv:283,exp:285,floor:287,histogram_quantile:289,holt_winters:291,hour:293,idelta:295,increase:297,irate:299,label_replace:301,label_join:303,ln:305,log10:307,log2:309,max_over_time:311,min_over_time:313,minute:315,month:317,predict_linear:319,quantile_over_time:321,rate:323,resets:325,round:327,scalar:329,sort:331,sort_desc:333,sqrt:335,stddev_over_time:337,stdvar_over_time:339,sum_over_time:341,timestamp:343,time:345,vector:347,year:349},D=M.b.deserialize({states:"2SO%jQPOOOOQO'#Cx'#CxO%nQPO'#CwQ'QQQOOOOQO'#De'#DeO%tQPO'#DdO%jQPO'#ElOOQO'#Ep'#EpO%jQPO'#EoOOQO'#Er'#ErO'UQSO'#EsO'^QQO'#EqOOQO'#Eq'#EqOOQO'#Cv'#CvOOQO'#Df'#DfOOQO'#Dh'#DhOOQO'#Di'#DiOOQO'#Dj'#DjOOQO'#Dk'#DkOOQO'#Dl'#DlOOQO'#Dm'#DmOOQO'#Dn'#DnOOQO'#Do'#DoOOQO'#Dp'#DpOOQO'#Dq'#DqOOQO'#Dr'#DrOOQO'#Ds'#DsOOQO'#Dt'#DtOOQO'#Du'#DuOOQO'#Dv'#DvOOQO'#Dw'#DwOOQO'#Dx'#DxOOQO'#Dy'#DyOOQO'#Dz'#DzOOQO'#D{'#D{OOQO'#D|'#D|OOQO'#D}'#D}OOQO'#EO'#EOOOQO'#EP'#EPOOQO'#EQ'#EQOOQO'#ER'#EROOQO'#ES'#ESOOQO'#ET'#ETOOQO'#EU'#EUOOQO'#EV'#EVOOQO'#EW'#EWOOQO'#EX'#EXOOQO'#EY'#EYOOQO'#EZ'#EZOOQO'#E['#E[OOQO'#E]'#E]OOQO'#E^'#E^OOQO'#E_'#E_OOQO'#E`'#E`OOQO'#Ea'#EaOOQO'#Eb'#EbOOQO'#Ec'#EcOOQO'#Ed'#EdOOQO'#Ee'#EeOOQO'#Ef'#EfOOQO'#Eg'#EgO(qQPO'#CyO(vQPO'#DOO%tQPO,59cO(}QQO,59cO/OQPO,59lO/OQPO,59lO/OQPO,59lO/OQPO,59lO/OQPO,59lO/SQQO,5;SO/XQQO,5;VOOQO,5:O,5:OO/^QQO,5;WO/eQQO,5;ZO0uQPO'#EuO1TQPO,5;_OOQO'#Et'#EtOOQO,5;_,5;_OOQO,5;],5;]O1]QSO'#CzOOQO,59e,59eO1eQPO,59jO1mQQO'#DPOOQO,59j,59jOOQO1G.}1G.}OOQO'#DU'#DUO6XQPO'#DTO6cQPO'#DTOOQO'#DS'#DSO%jQPO1G/WO%jQPO1G/WO%jQPO1G/WO%jQPO1G/WO%jQPO1G/WO6mQSO1G0nOOQO1G0q1G0qOOQO1G0r1G0rOOQO'#Ev'#EvO6uQPO,5;aO6zQSO1G0yOOQO1G0y1G0yOOQO'#C|'#C|O7SQPO,59fOOQO'#C{'#C{OOQO,59f,59fO%jQPO,59kOOQO1G/U1G/UO(qQPO,59qO7[QPO,59oO]QQO7+$rO>sQQO7+$rO@XQQO7+$rOOQO7+&Y7+&YO@oQQO7+&`OOQO1G0{1G0{OOQO1G0z1G0zOOQO7+&e7+&eO@wQSO1G/QOOQO1G/Q1G/QOAPQQO1G/VOOQO1G/]1G/]OOQO'#DW'#DWOOQO1G/Z1G/ZOOQO<|Q;xP#]Q!Q![;{QR#g#h+rQ>UR!Q![>R#a#b>_#g#h>eQ>bP#g#h+rQ>jP#]Q!Q![>mQ>pQ!Q![>m#a#b>vQ>yP#g#h+rQ?RP#]Q!Q![?UQ?XQ!Q![?U#a#b?_Q?bP#g#h+rQ?jP#]Q!Q![?mQ?pR!Q![?m#a#b?y#g#hAPQ@OQ#]Q!Q![@U#g#h+rQ@XR!Q![@U#a#b@b#g#h@hQ@eP#g#h+rQ@mP#]Q!Q![@pQ@sQ!Q![@p#a#b@yQ@|P#g#h+rQAUP#]Q!Q![AXQA[Q!Q![AX#a#bAbQAeP#g#h+rQAmQ#]Q!Q![As#g#h+rQAvR!Q![As#a#bBP#g#hBVQBSP#g#h+rQB[P#]Q!Q![B_QBbQ!Q![B_#a#bBhQBkP#g#h+rQBsP#]Q!Q![BvQByQ!Q![Bv#a#bCPQCSP#g#h+rQC[P#]Q!Q![C_QCbT!Q![C_#W#XCq#[#]Gz#a#bI}#g#hKTQCvP#]Q!Q![CyQC|S!Q![Cy#[#]DY#a#bF]#g#hGcQD_P#]Q!Q![DbQDeR!Q![Db#a#bDn#g#hEtQDsQ#]Q!Q![Dy#g#h+rQD|R!Q![Dy#a#bEV#g#hE]QEYP#g#h+rQEbP#]Q!Q![EeQEhQ!Q![Ee#a#bEnQEqP#g#h+rQEyP#]Q!Q![E|QFPQ!Q![E|#a#bFVQFYP#g#h+rQFbQ#]Q!Q![Fh#g#h+rQFkR!Q![Fh#a#bFt#g#hFzQFwP#g#h+rQGPP#]Q!Q![GSQGVQ!Q![GS#a#bG]QG`P#g#h+rQGhP#]Q!Q![GkQGnQ!Q![Gk#a#bGtQGwP#g#h+rQHPP#]Q!Q![HSQHVR!Q![HS#a#bH`#g#hIfQHeQ#]Q!Q![Hk#g#h+rQHnR!Q![Hk#a#bHw#g#hH}QHzP#g#h+rQISP#]Q!Q![IVQIYQ!Q![IV#a#bI`QIcP#g#h+rQIkP#]Q!Q![InQIqQ!Q![In#a#bIwQIzP#g#h+rQJSQ#]Q!Q![JY#g#h+rQJ]R!Q![JY#a#bJf#g#hJlQJiP#g#h+rQJqP#]Q!Q![JtQJwQ!Q![Jt#a#bJ}QKQP#g#h+rQKYP#]Q!Q![K]QK`Q!Q![K]#a#bKfQKiP#g#h+rPKoR!Q![Kx!c!iKx#T#ZKxPK}R#^P!Q![Kx!c!iKx#T#ZKxVL_T$wS!ZR!Q![Ln![!]Ln!c!}Ln#R#SLn#T#oLnRLsT!ZR!Q![Ln![!]Ln!c!}Ln#R#SLn#T#oLn~MXP!U~!_!`M[~MaO!T~~MfQ#kP!_!`Ml#r#sMqQMqO!QQ~MvO#l~~M{P!S~!_!`NO~NTO!R~VN[T!ZRqS!Q![NT![!]Ln!c!}NT#R#SNT#T#oNT~NpO$u~~NuO$v~~NzOu~~N}RO#SNz#S#T%Y#T~Nz~! ]O$z~~! bO${~",tokenizers:[0,1,2],topRules:{"@top":[0,25]},specialized:[{term:57,get:function(e,t){return function(e,t){return P[e.toLowerCase()]||-1}(e)<<1}},{term:57,get:function(e,t){return function(e,t){return T[e.toLowerCase()]||-1}(e)<<1|1}},{term:57,get:function(e){return _[e]||-1}}],tokenPrec:0}),A=26,R=36,L=38,N=39,I=104,z=107,$=109,F=113,B=117,Q=119,W=n(118),H=n(20),V=n(25);function U(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r=n.length){var o=e.resolve(a,-1);if(o.type.id===t.id&&o.start===r&&o.end===a)return o;for(o=e.resolve(r,1);o&&(o.type.id!==t.id||o.start!==r||o.end!==a);)o=o.parent;return o}}})}function q(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r="},{label:">"},{label:"<"},{label:"<="},{label:"!="},{label:"and"},{label:"or"},{label:"unless"}],Z=[{label:"avg",detail:"aggregation",info:"Calculate the average over dimensions",type:"keyword"},{label:"bottomk",detail:"aggregation",info:"Smallest k elements by sample value",type:"keyword"},{label:"count",detail:"aggregation",info:"Count number of elements in the vector",type:"keyword"},{label:"count_values",detail:"aggregation",info:"Count number of elements with the same value",type:"keyword"},{label:"group",detail:"aggregation",info:"Group series, while setting the sample value to 1",type:"keyword"},{label:"max",detail:"aggregation",info:"Select maximum over dimensions",type:"keyword"},{label:"min",detail:"aggregation",info:"Select minimum over dimensions",type:"keyword"},{label:"quantile",detail:"aggregation",info:"Calculate \u03c6-quantile (0 \u2264 \u03c6 \u2264 1) over dimensions",type:"keyword"},{label:"stddev",detail:"aggregation",info:"Calculate population standard deviation over dimensions",type:"keyword"},{label:"stdvar",detail:"aggregation",info:"Calculate population standard variance over dimensions",type:"keyword"},{label:"sum",detail:"aggregation",info:"Calculate sum over dimensions",type:"keyword"},{label:"topk",detail:"aggregation",info:"Largest k elements by sample value",type:"keyword"}],J=[{label:"sum(rate(__input_vector__[5m]))",type:"function",detail:"snippet",info:"Sum over rates of increase",apply:Object(K.c)("sum(rate(${__input_vector__}[5m]))")},{label:"histogram_quantile(__quantile__, sum by(le) (rate(__histogram_metric__[5m])))",type:"function",detail:"snippet",info:"Approximate a quantile value from an aggregated histogram",apply:Object(K.c)("histogram_quantile(${__quantile__}, sum by(le) (rate(${__histogram_metric__}[5m])))")},{label:'label_replace(__input_vector__, "__dst__", "__replacement__", "__src__", "__regex__")',type:"function",detail:"snippet",info:"Set or replace a label value in an input vector",apply:Object(K.c)('label_replace(${__input_vector__}, "${__dst__}", "${__replacement__}", "${__src__}", "${__regex__}")')}],ee={matchOp:[{label:"="},{label:"!="},{label:"=~"},{label:"!~"}],binOp:G,duration:[{label:"y"},{label:"w"},{label:"d"},{label:"h"},{label:"m"},{label:"s"},{label:"ms"}],binOpModifier:[{label:"on",info:"Match only on specified labels",type:"keyword"},{label:"ignoring",info:"Ignore specified labels for matching",type:"keyword"},{label:"group_left",info:"Allow many-to-one matching",type:"keyword"},{label:"group_right",info:"Allow one-to-many matching",type:"keyword"}],functionIdentifier:[{label:"abs",detail:"function",info:"Return absolute values of input series",type:"function"},{label:"absent",detail:"function",info:"Determine whether input vector is empty",type:"function"},{label:"absent_over_time",detail:"function",info:"Determine whether input range vector is empty",type:"function"},{label:"avg_over_time",detail:"function",info:"Average series values over time",type:"function"},{label:"ceil",detail:"function",info:"Round up values of input series to nearest integer",type:"function"},{label:"changes",detail:"function",info:"Return number of value changes in input series over time",type:"function"},{label:"clamp_max",detail:"function",info:"Limit the value of input series to a maximum",type:"function"},{label:"clamp_min",detail:"function",info:"Limit the value of input series to a minimum",type:"function"},{label:"count_over_time",detail:"function",info:"Count the number of values for each input series",type:"function"},{label:"days_in_month",detail:"function",info:"Return the number of days in current month for provided timestamps",type:"function"},{label:"day_of_month",detail:"function",info:"Return the day of the month for provided timestamps",type:"function"},{label:"day_of_week",detail:"function",info:"Return the day of the week for provided timestamps",type:"function"},{label:"delta",detail:"function",info:"Calculate the difference between beginning and end of a range vector (for gauges)",type:"function"},{label:"deriv",detail:"function",info:"Calculate the per-second derivative over series in a range vector (for gauges)",type:"function"},{label:"exp",detail:"function",info:"Calculate exponential function for input vector values",type:"function"},{label:"floor",detail:"function",info:"Round down values of input series to nearest integer",type:"function"},{label:"histogram_quantile",detail:"function",info:"Calculate quantiles from histogram buckets",type:"function"},{label:"holt_winters",detail:"function",info:"Calculate smoothed value of input series",type:"function"},{label:"hour",detail:"function",info:"Return the hour of the day for provided timestamps",type:"function"},{label:"idelta",detail:"function",info:"Calculate the difference between the last two samples of a range vector (for counters)",type:"function"},{label:"increase",detail:"function",info:"Calculate the increase in value over a range of time (for counters)",type:"function"},{label:"irate",detail:"function",info:"Calculate the per-second increase over the last two samples of a range vector (for counters)",type:"function"},{label:"label_replace",detail:"function",info:"Set or replace label values",type:"function"},{label:"label_join",detail:"function",info:"Join together label values into new label",type:"function"},{label:"ln",detail:"function",info:"Calculate natural logarithm of input series",type:"function"},{label:"log10",detail:"function",info:"Calulcate base-10 logarithm of input series",type:"function"},{label:"log2",detail:"function",info:"Calculate base-2 logarithm of input series",type:"function"},{label:"max_over_time",detail:"function",info:"Return the maximum value over time for input series",type:"function"},{label:"min_over_time",detail:"function",info:"Return the minimum value over time for input series",type:"function"},{label:"minute",detail:"function",info:"Return the minute of the hour for provided timestamps",type:"function"},{label:"month",detail:"function",info:"Return the month for provided timestamps",type:"function"},{label:"predict_linear",detail:"function",info:"Predict the value of a gauge into the future",type:"function"},{label:"quantile_over_time",detail:"function",info:"Calculate value quantiles over time for input series",type:"function"},{label:"rate",detail:"function",info:"Calculate per-second increase over a range vector (for counters)",type:"function"},{label:"resets",detail:"function",info:"Return number of value decreases (resets) in input series of time",type:"function"},{label:"round",detail:"function",info:"Round values of input series to nearest integer",type:"function"},{label:"scalar",detail:"function",info:"Convert single-element series vector into scalar value",type:"function"},{label:"sort",detail:"function",info:"Sort input series ascendingly by value",type:"function"},{label:"sort_desc",detail:"function",info:"Sort input series descendingly by value",type:"function"},{label:"sqrt",detail:"function",info:"Return the square root for input series",type:"function"},{label:"stddev_over_time",detail:"function",info:"Calculate the standard deviation within input series over time",type:"function"},{label:"stdvar_over_time",detail:"function",info:"Calculate the standard variation within input series over time",type:"function"},{label:"sum_over_time",detail:"function",info:"Calculate the sum over the values of input series over time",type:"function"},{label:"time",detail:"function",info:"Return the Unix timestamp at the current evaluation time",type:"function"},{label:"timestamp",detail:"function",info:"Return the Unix timestamp for the samples in the input vector",type:"function"},{label:"vector",detail:"function",info:"Convert a scalar value into a single-element series vector",type:"function"},{label:"year",detail:"function",info:"Return the year for provided timestamps",type:"function"}],aggregateOp:Z,aggregateOpModifier:[{label:"by",info:"Keep the listed labels, remove all others.",type:"keyword"},{label:"without",info:"Remove the listed labels, preserve all others.",type:"keyword"}]};function te(e,t){var n=function(e,t){for(var n=e;n&&n.type.id!==t;)n=n.parent;return n}(e,F);return n&&(n=U(n,114,57))?t.sliceDoc(n.start,n.end):""}function ne(e,t){var n,r,i,a,o,s,c,l,u,f,d,h,p,v,m,g,b,y=[];switch(t.type.id){case 0:if((null===(n=t.parent)||void 0===n?void 0:n.type.id)===z){y.push({kind:X.Duration});break}if((null===(r=t.parent)||void 0===r?void 0:r.type.id)===I){y.push({kind:X.Duration});break}var O=e.sliceDoc(t.start,t.end);G.filter((function(e){return e.label.includes(O)})).length>0&&y.push({kind:X.BinOp});break;case 57:if(0===(null===(i=t.parent)||void 0===i?void 0:i.type.id)){if(27===(null===(a=t.parent.parent)||void 0===a?void 0:a.type.id)){y.push({kind:X.AggregateOpModifier},{kind:X.BinOp});break}if((null===(o=t.parent.parent)||void 0===o?void 0:o.type.id)===F){var x=te(t,e);Z.filter((function(e){return e.label===x})).length>0&&y.push({kind:X.AggregateOpModifier}),y.push({kind:X.BinOp},{kind:X.Offset});break}}var k=null===(l=null===(c=null===(s=t.parent)||void 0===s?void 0:s.parent)||void 0===c?void 0:c.parent)||void 0===l?void 0:l.parent;if(!k){y.push({kind:X.MetricName},{kind:X.Function},{kind:X.Aggregation});break}(function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r0&&i++;var a=0,o=e.iterate({enter:function(t){if(t.id!==e.type.id||0!==i)return(t.id===n[a]||t.name===n[a])&&++a>=n.length;i++}});return void 0!==o&&o})(k,A,A)?k.type.id!==R||q(k,0)?(k.type.id!==R||k.type.id===R&&q(k,0))&&y.push({kind:X.BinOp},{kind:X.Offset}):y.push({kind:X.MetricName},{kind:X.Function},{kind:X.Aggregation},{kind:X.BinOpModifier}):y.push({kind:X.MetricName},{kind:X.Function},{kind:X.Aggregation});break;case 30:y.push({kind:X.LabelName});break;case 115:y.push({kind:X.LabelName,metricName:te(t,e)});break;case 33:32===(null===(u=t.parent)||void 0===u?void 0:u.type.id)?y.push({kind:X.LabelName}):(null===(f=t.parent)||void 0===f?void 0:f.type.id)===B&&y.push({kind:X.LabelName,metricName:te(t,e)});break;case B:33===(null===(d=t.firstChild)||void 0===d?void 0:d.type.id)&&0===(null===(h=t.lastChild)||void 0===h?void 0:h.type.id)&&null===(null===(p=t.lastChild)||void 0===p?void 0:p.firstChild)&&y.push({kind:X.MatchOp});break;case $:if((null===(v=t.parent)||void 0===v?void 0:v.type.id)===B){var w="";33===(null===(m=t.parent.firstChild)||void 0===m?void 0:m.type.id)&&(w=e.sliceDoc(t.parent.firstChild.start,t.parent.firstChild.end));var j=te(t,e);y.push({kind:X.LabelValue,metricName:j,labelName:w})}break;case 105:case z:y.push({kind:X.Duration});break;case 34:y.push({kind:X.MetricName},{kind:X.Function},{kind:X.Aggregation});break;case 53:118===(null===(g=t.parent)||void 0===g?void 0:g.type.id)?y.push({kind:X.MatchOp}):(null===(b=t.parent)||void 0===b?void 0:b.type.id)===R&&y.push({kind:X.BinOp});break;case Q:case 120:case 121:case 118:y.push({kind:X.MatchOp});break;case 37:case 43:case 44:case 45:case 46:case 47:case 48:case 49:case 50:case 51:case 52:case 21:case 23:case 22:case R:y.push({kind:X.BinOp})}return y}!function(e){e[e.MetricName=0]="MetricName",e[e.LabelName=1]="LabelName",e[e.LabelValue=2]="LabelValue",e[e.Function=3]="Function",e[e.Aggregation=4]="Aggregation",e[e.BinOpModifier=5]="BinOpModifier",e[e.BinOp=6]="BinOp",e[e.MatchOp=7]="MatchOp",e[e.AggregateOpModifier=8]="AggregateOpModifier",e[e.Duration=9]="Duration",e[e.Offset=10]="Offset"}(X||(X={}));var re=function(){function e(t){Object(r.a)(this,e),this.prometheusClient=t}return Object(i.a)(e,[{key:"promQL",value:function(e){var t,n=this,r=e.state,i=e.pos,o=r.tree.resolve(i,-1),s=ne(r,o),c=Promise.resolve([]),l=!1,u=!0,f=Object(a.a)(s);try{var d=function(){var e=t.value;switch(e.kind){case X.Aggregation:c=c.then((function(e){return e.concat(ee.aggregateOp)}));break;case X.Function:c=c.then((function(e){return e.concat(ee.functionIdentifier)}));break;case X.BinOpModifier:c=c.then((function(e){return e.concat(ee.binOpModifier)}));break;case X.BinOp:c=c.then((function(e){return e.concat(ee.binOp)}));break;case X.MatchOp:c=c.then((function(e){return e.concat(ee.matchOp)}));break;case X.AggregateOpModifier:c=c.then((function(e){return e.concat(ee.aggregateOpModifier)}));break;case X.Duration:u=!1,c=c.then((function(e){return e.concat(ee.duration)}));break;case X.Offset:c=c.then((function(e){return e.concat([{label:"offset"}])}));break;case X.MetricName:c=c.then((function(e){return l=!0,n.autocompleteMetricName(e)}));break;case X.LabelName:c=c.then((function(t){return n.autocompleteLabelName(t,e.metricName)}));break;case X.LabelValue:c=c.then((function(t){return n.autocompleteLabelValue(t,e.labelName,e.metricName)}))}};for(f.s();!(t=f.n()).done;)d()}catch(h){f.e(h)}finally{f.f()}return c.then((function(e){return function(e,t,n){var r=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],i=e;return arguments.length>3&&void 0!==arguments[3]&&arguments[3]&&i.push.apply(i,Object(V.a)(J)),{from:t,to:n,options:i,span:r?/^[a-zA-Z0-9_:]+$/:void 0}}(e,function(e,t){var n,r,i,a,o,s,c=e.start;return 30===e.type.id||115===e.type.id||34===e.type.id||e.type.id===$&&(null===(n=e.parent)||void 0===n?void 0:n.type.id)===B?c++:e.type.id===B&&33===(null===(r=e.firstChild)||void 0===r?void 0:r.type.id)&&0===(null===(i=e.lastChild)||void 0===i?void 0:i.type.id)&&null===(null===(a=e.lastChild)||void 0===a?void 0:a.firstChild)?c=e.lastChild.start:e.type.id!==z&&(0!==e.type.id||(null===(o=e.parent)||void 0===o?void 0:o.type.id)!==z&&(null===(s=e.parent)||void 0===s?void 0:s.type.id)!==I)||(c=t),c}(o,i),i,l,u)}))}},{key:"autocompleteMetricName",value:function(e){var t=this;if(!this.prometheusClient)return e;var n=new Map;return this.prometheusClient.labelValues("__name__").then((function(e){var r,i,o=Object(a.a)(e);try{for(o.s();!(i=o.n()).done;){var s=i.value;n.set(s,{label:s,type:"constant"})}}catch(c){o.e(c)}finally{o.f()}if(e.length<=1e4)return null===(r=t.prometheusClient)||void 0===r?void 0:r.metricMetadata()})).then((function(t){if(t){var r,i=Object(a.a)(n);try{for(i.s();!(r=i.n()).done;){var o=Object(H.a)(r.value,2),s=o[0],c=o[1],l=t.get(s.replace(/(_count|_sum|_bucket)$/,""));if(l)if(l.length>1){var u,f=Object(a.a)(l);try{for(f.s();!(u=f.n()).done;){var d=u.value;""===c.detail?c.detail=d.type:c.detail!==d.type&&(c.detail="unknown",c.info="multiple different definitions for this metric"),""===c.info?c.info=d.help:c.info!==d.help&&(c.info="multiple different definitions for this metric")}}catch(m){f.e(m)}finally{f.f()}}else if(1===l.length){var h=l[0],p=h.type,v=h.help;"histogram"!==p&&"summary"!==p||(s.endsWith("_count")&&(p="counter",v="The total number of observations for: ".concat(v)),s.endsWith("_sum")&&(p="counter",v="The total sum of observations for: ".concat(v)),s.endsWith("_bucket")&&(p="counter",v="The total count of observations for a bucket in the histogram: ".concat(v))),c.detail=p,c.info=v}}}catch(m){i.e(m)}finally{i.f()}}return e.concat(Array.from(n.values()))}))}},{key:"autocompleteLabelName",value:function(e,t){return this.prometheusClient?this.prometheusClient.labelNames(t).then((function(t){return e.concat(t.map((function(e){return{label:e,type:"constant"}})))})):e}},{key:"autocompleteLabelValue",value:function(e,t,n){return this.prometheusClient&&t?this.prometheusClient.labelValues(t,n).then((function(t){return e.concat(t.map((function(e){return{label:e,type:"text"}})))})):e}}]),e}(),ie="/api/v1/label/:name/values",ae=function(){function e(){Object(r.a)(this,e),this.completeAssociation=new Map,this.metricMetadata=new Map,this.labelValues=new Map,this.labelNames=[]}return Object(i.a)(e,[{key:"setAssociation",value:function(e,t){var n=this.completeAssociation.get(e);n||(n=new Map,this.completeAssociation.set(e,n));for(var r=0,i=Object.entries(t);r0)return Promise.resolve(this.cache.getLabelNames(e));var n=new Date,r=new Date(n.getTime()-this.lookbackInterval);if(void 0===e||""===e){var i=new URLSearchParams({start:r.toISOString(),end:n.toISOString()});return this.fetchAPI("".concat("/api/v1/labels","?").concat(i)).then((function(e){return t.cache.setLabelNames(e),e})).catch((function(e){return t.errorHandler&&t.errorHandler(e),[]}))}return this.series(e,r,n).then((function(n){return t.cache.getLabelNames(e)}))}},{key:"labelValues",value:function(e,t){var n=this;if(this.cache.getLabelValues(e,t)&&this.cache.getLabelValues(e,t).length>0)return Promise.resolve(this.cache.getLabelValues(e,t));var r=new Date,i=new Date(r.getTime()-this.lookbackInterval);if(!t||0===t.length){var a=new URLSearchParams({start:i.toISOString(),end:r.toISOString()});return this.fetchAPI("".concat(ie.replace(/:name/gi,e),"?").concat(a)).then((function(t){return n.cache.setLabelValues(e,t),t})).catch((function(e){return n.errorHandler&&n.errorHandler(e),[]}))}return this.series(t,i,r).then((function(r){return n.cache.getLabelValues(e,t)}))}},{key:"metricMetadata",value:function(){var e=this;return this.cache.getMetricMetadata()&&this.cache.getMetricMetadata().size>0?Promise.resolve(this.cache.getMetricMetadata()):this.fetchAPI("/api/v1/metadata").then((function(t){for(var n=0,r=Object.entries(t);n0){var s,c=Object(a.a)(o);try{for(c.s();!(s=c.n()).done;){var l=s.value;n.matchingLabels.push(e.sliceDoc(l.start,l.end))}}catch(m){c.e(m)}finally{c.f()}}}var u=U(t,L,N,4),f=U(t,L,N,5);if(u||f){n.card=u?pe.CardManyToOne:pe.CardOneToMany;var d=Y(U(t,L,N,42,30),31,32);if(d.length>0){var h,p=Object(a.a)(d);try{for(p.s();!(h=p.n()).done;){var v=h.value;n.include.push(e.sliceDoc(v.start,v.end))}}catch(m){p.e(m)}finally{p.f()}}}return q(t,21,22,23)&&n.card===pe.CardOneToOne&&(n.card=pe.CardManyToMany),n}(this.state,e);if(null!==l&&l.on){var u,f=Object(a.a)(l.matchingLabels);try{for(f.s();!(u=f.n()).done;){var d,h=u.value,p=Object(a.a)(l.include);try{for(p.s();!(d=p.n()).done;){h===d.value&&this.addDiagnostic(e,'label "'.concat(h,'" must not occur in ON and GROUP clause at once'))}}catch(v){p.e(v)}finally{p.f()}}}catch(v){f.e(v)}finally{f.f()}}r!==de.scalar&&r!==de.vector&&this.addDiagnostic(t,"binary expression must contain only scalar and instant vector types"),i!==de.scalar&&i!==de.vector&&this.addDiagnostic(n,"binary expression must contain only scalar and instant vector types"),r===de.vector&&i===de.vector||null===l?c&&((null===l||void 0===l?void 0:l.card)!==pe.CardOneToMany&&(null===l||void 0===l?void 0:l.card)!==pe.CardManyToOne||this.addDiagnostic(e,"no grouping allowed for set operations"),(null===l||void 0===l?void 0:l.card)!==pe.CardManyToMany&&this.addDiagnostic(e,"set operations must always be many-to-many")):l.matchingLabels.length>0&&this.addDiagnostic(e,"vector matching only allowed between instant vectors"),r!==de.scalar&&i!==de.scalar||!c||this.addDiagnostic(e,"set operator not allowed in binary scalar expression")}else this.addDiagnostic(e,"left or right expression is missing in binary expression")}},{key:"checkCallFunction",value:function(e){var t,n=null===(t=e.firstChild)||void 0===t?void 0:t.firstChild;if(n){var r=Y(U(e,34),35,A),i=me(n.type.id),a=i.argTypes.length;if(0===i.variadic)r.length!==a&&this.addDiagnostic(e,"expected ".concat(a," argument(s) in call to ").concat(i.name,", got ").concat(r.length));else{var o=a-1;if(o>r.length)this.addDiagnostic(e,"expected at least ".concat(o," argument(s) in call to ").concat(i.name,", got ").concat(r.length));else{var s=o+i.variadic;i.variadic>0&&s=i.argTypes.length){if(0===i.variadic)break;c=i.argTypes.length-1}this.expectType(r[l],i.argTypes[c],"call to function ".concat(i.name))}}else this.addDiagnostic(e,"function not defined")}},{key:"checkVectorSelector",value:function(e){var t=ye(Y(U(e,115,116),116,B),this.state),n="",r=U(e,114,57);if(r&&(n=this.state.sliceDoc(r.start,r.end)),""!==n){var i=t.find((function(e){return"__name__"===e.name}));i&&this.addDiagnostic(e,"metric name must not be set twice: ".concat(n," or ").concat(i.value)),t.push(new be(Q,"__name__",n))}t.every((function(e){return e.matchesEmpty()}))&&this.addDiagnostic(e,"vector selector must contain at least one non-empty matcher")}},{key:"expectType",value:function(e,t,n){var r=this.checkAST(e);r!==t&&this.addDiagnostic(e,"expected type ".concat(t," in ").concat(n,", got ").concat(r))}},{key:"addDiagnostic",value:function(e,t){this.diagnostics.push({severity:"error",message:t,from:e.start,to:e.end})}}]),e}(),xe=function(){function e(){Object(r.a)(this,e)}return Object(i.a)(e,[{key:"promQL",value:function(){return function(e){var t=new Oe(e.state);return t.analyze(),t.getDiagnostics()}}}]),e}();var ke=O.define(D.withProps(Object(W.b)({LineComment:"comment",LabelName:"labelName",StringLiteral:"string",NumberLiteral:"number",Duration:"number","Abs Absent AbsentOverTime AvgOverTime Ceil Changes ClampMax ClampMin CountOverTime DaysInMonth DayOfMonth DayOfWeek Delta Deriv Exp Floor HistogramQuantile HoltWinters Hour Idelta Increase Irate LabelReplace LabelJoin Ln Log10 Log2 MaxOverTime MinOverTime Minute Month PredictLinear QuantileOverTime Rate Resets Round Scalar Sort SortDesc Sqrt StddevOverTime StdvarOverTime SumOverTime Time Timestamp Vector Year":"functionName","Avg Bottomk Count Count_values Group Max Min Quantile Stddev Stdvar Sum Topk":"operatorKeyword","By Without Bool On Ignoring GroupLeft GroupRight Offset":"modifier","And Unless Or":"logicOperator","Sub Add Mul Mod Div Eql Neq Lte Lss Gte Gtr EqlRegex EqlSingle NeqRegex Pow":"operator",UnaryOp:"arithmeticOperator","( )":"paren","[ ]":"squareBracket","{ }":"brace","\u26a0":"invalid"})),{languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"#"}}}),we=function(){function e(){Object(r.a)(this,e),this.complete=ue(),this.lint=new xe,this.enableLinter=!0,this.enableCompletion=!0}return Object(i.a)(e,[{key:"setComplete",value:function(e){return this.complete=ue(e),this}},{key:"activateCompletion",value:function(e){return this.enableCompletion=e,this}},{key:"activateLinter",value:function(e){return this.enableLinter=e,this}},{key:"asExtension",value:function(){var e,t,n=this,r=[ke];if(this.enableCompletion){var i=ke.languageData.of({autocomplete:function(e){return n.complete.promQL(e)}});r=r.concat(i)}return this.enableLinter&&(r=r.concat((e=this.lint.promQL,t=this.lint,Object(he.b)(e.call(t))))),r}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",(function(){return Pt}));var r=n(25),i=n(10),a=n(5),o=n(7),s=n(4),c=n(6),l=a.a.define(),u=a.a.define(),f=a.f.define(),d=a.f.define({combine:function(e){return Object(a.m)(e,{minDepth:100,newGroupDelay:500},{minDepth:Math.max,newGroupDelay:Math.min})}}),h=a.j.define({create:function(){return M.empty},update:function(e,t){var n=t.state.facet(d),r=t.annotation(l);if(r){var i=O.fromTransaction(t),o=r.side,s=0==o?e.undone:e.done;return s=i?x(s,s.length,n.minDepth,i):j(s,t.startState.selection),new M(0==o?r.rest:s,0==o?s:r.rest)}var c=t.annotation(u);if("full"!=c&&"before"!=c||(e=e.isolate()),!1===t.annotation(a.l.addToHistory))return t.changes.length?e.addMapping(t.changes.desc):e;var f=O.fromTransaction(t),h=t.annotation(a.l.time),p=t.annotation(a.l.userEvent);return f?e=e.addChanges(f,h,p,n.newGroupDelay,n.minDepth):t.selection&&(e=e.addSelection(t.startState.selection,h,p,n.newGroupDelay)),"full"!=c&&"after"!=c||(e=e.isolate()),e}});function p(e,t){return function(n){var r=n.state,i=n.dispatch,a=r.field(h,!1);if(!a)return!1;var o=a.pop(e,r,t);return!!o&&(i(o),!0)}}var v=p(0,!1),m=p(1,!1),g=p(0,!0),b=p(1,!0);function y(e){return function(t){var n=t.field(h,!1);if(!n)return 0;var r=0==e?n.done:n.undone;return r.length-(r.length&&!r[0].changes?1:0)}}y(0),y(1);var O=function(){function e(t,n,r,i,a){Object(s.a)(this,e),this.changes=t,this.effects=n,this.mapped=r,this.startSelection=i,this.selectionsAfter=a}return Object(c.a)(e,[{key:"setSelAfter",value:function(t){return new e(this.changes,this.effects,this.mapped,this.startSelection,t)}}],[{key:"fromTransaction",value:function(t){var n,r=w,i=Object(o.a)(t.startState.facet(f));try{for(i.s();!(n=i.n()).done;){var a=(0,n.value)(t);a.length&&(r=r.concat(a))}}catch(s){i.e(s)}finally{i.f()}return!r.length&&t.changes.empty?null:new e(t.changes.invert(t.startState.doc),r,void 0,t.startState.selection,w)}},{key:"selection",value:function(t){return new e(void 0,w,void 0,void 0,t)}}]),e}();function x(e,t,n,r){var i=t+1>n+20?t-n-1:0,a=e.slice(i,t);return a.push(r),a}function k(e,t){return e.length?t.length?e.concat(t):e:t}var w=[];function j(e,t){if(e.length){var n=e[e.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-200));return r.length&&r[r.length-1].eq(t)?e:(r.push(t),x(e,e.length-1,1e9,n.setSelAfter(r)))}return[O.selection([t])]}function S(e){var t=e[e.length-1],n=e.slice();return n[e.length-1]=t.setSelAfter(t.selectionsAfter.slice(0,t.selectionsAfter.length-1)),n}function C(e,t){if(!e.length)return e;for(var n=e.length,r=w;n;){var i=E(e[n-1],t,r);if(i.changes&&!i.changes.empty||i.effects.length){var a=e.slice(0,n);return a[n-1]=i,a}t=i.mapped,n--,r=i.selectionsAfter}return r.length?[O.selection(r)]:w}function E(e,t,n){var r=k(e.selectionsAfter.length?e.selectionsAfter.map((function(e){return e.map(t)})):w,n);if(!e.changes)return O.selection(r);var i=e.changes.map(t),o=t.mapDesc(e.changes,!0),s=e.mapped?e.mapped.composeDesc(o):o;return new O(i,a.i.mapEffects(e.effects,t),s,e.startSelection.map(o),r)}var M=function(){function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:void 0;Object(s.a)(this,e),this.done=t,this.undone=n,this.prevTime=r,this.prevUserEvent=i}return Object(c.a)(e,[{key:"isolate",value:function(){return this.prevTime?new e(this.done,this.undone):this}},{key:"addChanges",value:function(t,n,r,i,a){var o=this.done,s=o[o.length-1];return new e(o=s&&s.changes&&n-this.prevTime=s&&i<=c&&(r=!0)}})),r}(s.changes,t.changes)?x(o,o.length-1,a,new O(t.changes.compose(s.changes),k(t.effects,s.effects),s.mapped,s.startSelection,w)):x(o,o.length,a,t),w,n,r)}},{key:"addSelection",value:function(t,n,r,i){var a,o,s=this.done.length?this.done[this.done.length-1].selectionsAfter:w;return s.length>0&&n-this.prevTimethis.i;)e.dom.removeChild(e.elements.pop().dom)}}]),e}(),Q=function(){function e(t,n){var r=this;Object(s.a)(this,e),this.view=t,this.config=n,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className=Object(i.n)("gutter"+(this.config.style?"."+this.config.style:"")),this.elementClass=Object(i.n)("gutterElement"+(this.config.style?"."+this.config.style:""));var a=function(e){r.dom.addEventListener(e,(function(r){var i=t.visualLineAtHeight(r.clientY,t.contentDOM.getBoundingClientRect().top);n.domEventHandlers[e](t,i,r)&&r.preventDefault()}))};for(var o in n.domEventHandlers)a(o);this.markers=n.markers(t.state),n.initialSpacer&&(this.spacer=new W(t,0,0,[n.initialSpacer(t)],this.elementClass),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}return Object(c.a)(e,[{key:"update",value:function(e){var t=this.markers;if(this.markers=this.config.markers(e.state),this.spacer&&this.config.updateSpacer){var n=this.config.updateSpacer(this.spacer.markers[0],e);n!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[n],this.elementClass)}return this.markers!=t}}]),e}(),W=function(){function e(t,n,r,i,a){Object(s.a)(this,e),this.height=-1,this.above=0,this.dom=document.createElement("div"),this.update(t,n,r,i,a)}return Object(c.a)(e,[{key:"update",value:function(e,t,n,r,i){if(this.height!=t&&(this.dom.style.height=(this.height=t)+"px"),this.above!=n&&(this.dom.style.marginTop=(this.above=n)?n+"px":""),this.markers!=r){this.markers=r;for(var a;a=this.dom.lastChild;)a.remove();var s,c=i,l=Object(o.a)(r);try{for(l.s();!(s=l.n()).done;){var u=s.value,f=u.toDOM(e);f&&this.dom.appendChild(f);var d=u.elementClass;d&&(c+=" "+d)}}catch(h){l.e(h)}finally{l.f()}this.dom.className=c}}}]),e}();var H=a.f.define(),V=a.f.define({combine:function(e){return Object(a.m)(e,{formatNumber:String,domEventHandlers:{}},{domEventHandlers:function(e,t){var n=Object.assign({},e),r=function(e){var r=n[e],i=t[e];n[e]=r?function(e,t,n){return r(e,t,n)||i(e,t,n)}:i};for(var i in t)r(i);return n}})}}),U=function(e){Object(T.a)(n,e);var t=Object(_.a)(n);function n(e){var r;return Object(s.a)(this,n),(r=t.call(this)).number=e,r}return Object(c.a)(n,[{key:"eq",value:function(e){return this.number==e.number}},{key:"toDOM",value:function(e){var t=e.state.facet(V);return document.createTextNode(t.formatNumber(this.number))}}]),n}(A),q=N({style:"lineNumber",markers:function(e){return e.facet(H)},lineMarker:function(e,t,n){return n.length?null:new U(e.state.doc.lineAt(t.from).number)},initialSpacer:function(e){return new U(Y(e.state.doc.lines))},updateSpacer:function(e,t){var n=Y(t.view.state.doc.lines);return n==e.number?e:new U(n)}});function Y(e){for(var t=9;t=r?void 0:{from:n,to:r}}var K=a.i.define({map:X}),G=a.i.define({map:X});function Z(e){var t,n=[],r=Object(o.a)(e.state.selection.ranges);try{var i=function(){var r=t.value.head;if(n.some((function(e){return e.from<=r&&e.to>=r})))return"continue";n.push(e.visualLineAt(r))};for(r.s();!(t=r.n()).done;)i()}catch(a){r.e(a)}finally{r.f()}return n}var J=a.j.define({create:function(){return i.b.none},update:function(e,t){e=e.map(t.changes);var n,r=Object(o.a)(t.effects);try{var i=function(){var t=n.value;t.is(K)&&!function(e,t,n){var r=!1;return e.between(t,t,(function(e,i){e==t&&i==n&&(r=!0)})),r}(e,t.value.from,t.value.to)?e=e.update({add:[se.range(t.value.from,t.value.to)]}):t.is(G)&&(e=e.update({filter:function(e,n){return t.value.from!=e||t.value.to!=n},filterFrom:t.value.from,filterTo:t.value.to}))};for(r.s();!(n=r.n()).done;)i()}catch(c){r.e(c)}finally{r.f()}if(t.selection){var a=!1,s=t.selection.primary.head;e.between(s,s,(function(e,t){es&&(a=!0)})),a&&(e=e.update({filterFrom:s,filterTo:s,filter:function(e,t){return t<=s||e>=s}}))}return e},provide:[i.d.decorations]});function ee(e,t,n){var r,i=null;return null===(r=e.field(J,!1))||void 0===r||r.between(t,n,(function(e,t){(!i||i.from>e)&&(i={from:e,to:t})})),i}function te(e,t,n){return e.facet(a.e.foldable).reduce((function(r,i){return r||i(e,t,n)}),null)}function ne(e){return e.field(J,!1)?void 0:{append:oe()}}var re=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:function(e){var t,n=Object(o.a)(Z(e));try{for(n.s();!(t=n.n()).done;){var r=t.value,i=te(e.state,r.from,r.to);if(i)return e.dispatch({effects:K.of(i),reconfigure:ne(e.state)}),!0}}catch(a){n.e(a)}finally{n.f()}return!1}},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:function(e){if(!e.state.field(J,!1))return!1;var t,n=[],r=Object(o.a)(Z(e));try{for(r.s();!(t=r.n()).done;){var i=t.value,a=ee(e.state,i.from,i.to);a&&n.push(G.of(a))}}catch(s){r.e(s)}finally{r.f()}return n.length&&e.dispatch({effects:n}),n.length>0}},{key:"Ctrl-Alt-[",run:function(e){for(var t=e.state,n=[],r=0;r"};var ve="()[]{}<>";function me(e){for(var t=0;t2||2==r.length&&1==Object(he.c)(Object(he.b)(r,0))||t!=i.from||n!=i.to)return!1;var a=function(e,t){var n,r=ge(e,e.selection.primary.head),i=r.brackets||pe.brackets,a=Object(o.a)(i);try{for(a.s();!(n=a.n()).done;){var s=n.value,c=me(Object(he.b)(s,0));if(t==s)return c==s?we(e,s,i.indexOf(s+s+s)>-1):xe(e,s,c,r.before||pe.before);if(t==c)return ke(e,s,c)}}catch(l){a.e(l)}finally{a.f()}return null}(e.state,r);return!!a&&(e.dispatch(a),!0)}var ye=[{key:"Backspace",run:function(e){var t=e.state,n=e.dispatch,r=ge(t,t.selection.primary.head).brackets||pe.brackets,i=null,s=t.changeByRange((function(e){if(e.empty){var n,s=function(e,t){var n=e.sliceString(t-2,t);return Object(he.c)(Object(he.b)(n,0))==n.length?n:n.slice(1)}(t.doc,e.head),c=Object(o.a)(r);try{for(c.s();!(n=c.n()).done;){var l=n.value;if(l==s&&Oe(t.doc,e.head)==me(Object(he.b)(l,0)))return{changes:{from:e.head-l.length,to:e.head+l.length},range:a.d.cursor(e.head-l.length),annotations:a.l.userEvent.of("delete")}}}catch(u){c.e(u)}finally{c.f()}}return{range:i=e}}));return i||n(t.update(s,{scrollIntoView:!0})),!i}}];function Oe(e,t){var n=e.sliceString(t,t+2);return n.slice(0,Object(he.c)(Object(he.b)(n,0)))}function xe(e,t,n,r){var i=null,o=e.changeByRange((function(o){if(!o.empty)return{changes:[{insert:t,from:o.from},{insert:n,from:o.to}],range:a.d.range(o.anchor+t.length,o.head+t.length)};var s=Oe(e.doc,o.head);return!s||/\s/.test(s)||r.indexOf(s)>-1?{changes:{insert:t+n,from:o.head},range:a.d.cursor(o.head+t.length)}:{range:i=o}}));return i?null:e.update(o,{scrollIntoView:!0,annotations:a.l.userEvent.of("input")})}function ke(e,t,n){var r=null,i=e.selection.ranges.map((function(t){return t.empty&&Oe(e.doc,t.head)==n?a.d.cursor(t.head+n.length):r=t}));return r?null:e.update({selection:a.d.create(i,e.selection.primaryIndex),scrollIntoView:!0})}function we(e,t,n){var r=null,i=e.changeByRange((function(i){if(!i.empty)return{changes:[{insert:t,from:i.from},{insert:t,from:i.to}],range:a.d.range(i.anchor+t.length,i.head+t.length)};var o=i.head,s=Oe(e.doc,o);if(s==t){if(je(e,o))return{changes:{insert:t+t,from:o},range:a.d.cursor(o+t.length)};var c=n&&e.sliceDoc(o,o+3*t.length)==t+t+t;return{range:a.d.cursor(o+t.length*(c?3:1))}}if(n&&e.sliceDoc(o-2*t.length,o)==t+t&&je(e,o-2*t.length))return{changes:{insert:t+t+t+t,from:o},range:a.d.cursor(o+t.length)};if(e.charCategorizer(o)(s)!=a.c.Word){var l=e.sliceDoc(o-1,o);if(l!=t&&e.charCategorizer(o)(l)!=a.c.Word)return{changes:{insert:t+t,from:o},range:a.d.cursor(o+t.length)}}return{range:r=i}}));return r?null:e.update(i,{scrollIntoView:!0,annotations:a.l.userEvent.of("input")})}function je(e,t){var n=e.tree.resolve(t+1);return n.parent&&n.start==t}var Se=n(35),Ce="function"==typeof String.prototype.normalize?function(e){return e.normalize("NFKD")}:function(e){return e},Ee=function(){function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:t.length,a=arguments.length>4?arguments[4]:void 0;Object(s.a)(this,e),this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=t.iterRange(r,i),this.bufferStart=r,this.normalize=a?function(e){return a(Ce(e))}:Ce,this.query=this.normalize(n)}return Object(c.a)(e,[{key:"peek",value:function(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return this.buffer.charCodeAt(this.bufferPos)}},{key:"next",value:function(){for(;;){var e=this.peek();if(e<0)return this.done=!0,this;var t=String.fromCharCode(e),n=this.bufferStart+this.bufferPos;for(this.bufferPos++;;){var r=this.peek();if(r<56320||r>=57344)break;this.bufferPos++,t+=String.fromCharCode(r)}for(var i=this.normalize(t),a=0,o=n;;a++){var s=i.charCodeAt(a),c=this.match(s,o);if(c)return this.value=c,this;if(a==i.length-1)break;o==n&&a1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length;return new Ee(e,this.search,t,n,this.caseInsensitive?function(e){return e.toLowerCase()}:void 0)}},{key:"valid",get:function(){return!!this.search}}]),e}(),Pe=a.i.define(),Te=a.i.define(),_e=a.j.define({create:function(){return new De(new Me("","",!1),[])},update:function(e,t){var n,r=Object(o.a)(t.effects);try{for(r.s();!(n=r.n()).done;){var i=n.value;i.is(Pe)?e=new De(i.value,e.panel):i.is(Te)&&(e=new De(e.query,i.value?[He]:[]))}}catch(a){r.e(a)}finally{r.f()}return e},provide:[Se.c.nFrom((function(e){return e.panel}))]}),De=function e(t,n){Object(s.a)(this,e),this.query=t,this.panel=n},Ae=i.b.mark({class:Object(i.n)("searchMatch")}),Re=i.b.mark({class:Object(i.n)("searchMatch.selected")}),Le=i.f.fromClass(function(){function e(t){Object(s.a)(this,e),this.view=t,this.decorations=this.highlight(t.state.field(_e))}return Object(c.a)(e,[{key:"update",value:function(e){var t=e.state.field(_e);(t!=e.prevState.field(_e)||e.docChanged||e.selectionSet)&&(this.decorations=this.highlight(t))}},{key:"highlight",value:function(e){var t=e.query;if(!e.panel.length||!t.valid)return i.b.none;for(var n=this.view.state,r=this.view.viewport,a=t.cursor(n.doc,Math.max(0,r.from-t.search.length),Math.min(r.to+t.search.length,n.doc.length)),o=new D.c,s=function(){var e=a.value,t=e.from,r=e.to,i=n.selection.ranges.some((function(e){return e.from==t&&e.to==r}));o.add(t,r,i?Re:Ae)};!a.next().done;)s();return o.finish()}}]),e}(),{decorations:function(e){return e.decorations}});function Ne(e){return function(t){var n=t.state.field(_e,!1);return n&&n.query.valid?e(t,n):Ve(t)}}function Ie(e,t,n){var r=n.cursor(e,t).next();return r.done&&(r=n.cursor(e,0,t+n.search.length-1).next()).done?null:r.value}var ze=Ne((function(e,t){var n=e.state.selection.primary,r=n.from,i=n.to,a=Ie(e.state.doc,e.state.selection.primary.from+1,t.query);return!(!a||a.from==r&&a.to==i)&&(e.dispatch({selection:{anchor:a.from,head:a.to},scrollIntoView:!0}),Ge(e),!0)}));function $e(e,t,n,r){for(var i=r;;){for(var a=Math.max(n,i-1e4-e.search.length),o=e.cursor(t,a,i),s=null;!o.next().done;)s=o.value;if(s)return s;if(a==n)return null;i-=1e4}}var Fe=Ne((function(e,t){var n=t.query,r=e.state,i=$e(n,r.doc,0,r.selection.primary.to-1)||$e(n,r.doc,r.selection.primary.from+1,r.doc.length);return!!i&&(e.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0}),Ge(e),!0)})),Be=Ne((function(e,t){for(var n=t.query.cursor(e.state.doc),r=[];!n.next().done;)r.push(a.d.range(n.value.from,n.value.to));return!!r.length&&(e.dispatch({selection:a.d.create(r)}),!0)})),Qe=Ne((function(e,t){var n=t.query,r=e.state,i=Ie(r.doc,r.selection.primary.from,n);if(!i)return!1;var a,o=r.selection.primary,s=o.from,c=o.to,l=[];if(i.from==s&&i.to==c&&(l.push({from:i.from,to:i.to,insert:n.replace}),i=Ie(r.doc,i.to,n)),i){var u=0==l.length||l[0].from>=i.to?0:i.to-i.from-n.replace.length;a={anchor:i.from-u,head:i.to-u}}return e.dispatch({changes:l,selection:a,scrollIntoView:!!a}),i&&Ge(e),!0})),We=Ne((function(e,t){for(var n=t.query,r=n.cursor(e.state.doc),i=[];!r.next().done;){var a=r.value,o=a.from,s=a.to;i.push({from:o,to:s,insert:n.replace})}return!!i.length&&(e.dispatch({changes:i}),!0)}));function He(e){var t=e.state.field(_e).query;return{dom:Xe({view:e,query:t,updateQuery:function(n){t.eq(n)||(t=n,e.dispatch({effects:Pe.of(t)}))}}),mount:function(){this.dom.querySelector("[name=search]").select()},pos:80,style:"search"}}var Ve=function(e){var t=e.state.field(_e,!1);if(t&&t.panel.length){var n=Object(Se.a)(e,He);if(!n)return!1;n.dom.querySelector("[name=search]").focus()}else e.dispatch({effects:Te.of(!0),reconfigure:t?void 0:{append:et}});return!0},Ue=function(e){var t=e.state.field(_e,!1);if(!t||!t.panel.length)return!1;var n=Object(Se.a)(e,He);return n&&n.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:Te.of(!1)}),!0},qe=[{key:"Mod-f",run:Ve,scope:"editor search-panel"},{key:"F3",run:ze,shift:Fe,scope:"editor search-panel"},{key:"Mod-g",run:ze,shift:Fe,scope:"editor search-panel"},{key:"Escape",run:Ue,scope:"editor search-panel"},{key:"Mod-Shift-l",run:function(e){var t=e.state,n=e.dispatch,r=t.selection;if(r.ranges.length>1||r.primary.empty)return!1;for(var i=r.primary,o=i.from,s=i.to,c=[],l=0,u=new Ee(t.doc,t.sliceDoc(o,s));!u.next().done;){if(c.length>1e3)return!1;u.value.from==o&&(l=c.length),c.push(a.d.range(u.value.from,u.value.to))}return n(t.update({selection:new a.d(c,l)})),!0}}];function Ye(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=document.createElement(e);if(t)for(var i in t){var a=t[i];"string"==typeof a?r.setAttribute(i,a):r[i]=a}var s,c=Object(o.a)(n);try{for(c.s();!(s=c.n()).done;){var l=s.value;r.appendChild("string"==typeof l?document.createTextNode(l):l)}}catch(u){c.e(u)}finally{c.f()}return r}function Xe(e){function t(t){return e.view.state.phrase(t)}var n=Ye("input",{value:e.query.search,placeholder:t("Find"),"aria-label":t("Find"),class:Object(i.n)("textfield"),name:"search",onchange:o,onkeyup:o}),r=Ye("input",{value:e.query.replace,placeholder:t("Replace"),"aria-label":t("Replace"),class:Object(i.n)("textfield"),name:"replace",onchange:o,onkeyup:o}),a=Ye("input",{type:"checkbox",name:"case",checked:!e.query.caseInsensitive,onchange:o});function o(){e.updateQuery(new Me(n.value,r.value,!a.checked))}function s(e,t,n){return Ye("button",{class:Object(i.n)("button"),name:e,onclick:t},n)}return Ye("div",{onkeydown:function(t){Object(i.m)(e.view,t,"search-panel")?t.preventDefault():13==t.keyCode&&t.target==n?(t.preventDefault(),(t.shiftKey?Fe:ze)(e.view)):13==t.keyCode&&t.target==r&&(t.preventDefault(),Qe(e.view))}},[n,s("next",(function(){return ze(e.view)}),[t("next")]),s("prev",(function(){return Fe(e.view)}),[t("previous")]),s("select",(function(){return Be(e.view)}),[t("all")]),Ye("label",null,[a,"match case"]),Ye("br"),r,s("replace",(function(){return Qe(e.view)}),[t("replace")]),s("replaceAll",(function(){return We(e.view)}),[t("replace all")]),Ye("button",{name:"close",onclick:function(){return Ue(e.view)},"aria-label":t("close")},["\xd7"]),Ye("div",{style:"position: absolute; top: -10000px","aria-live":"polite"})])}var Ke=/[\s\.,:;?!]/;function Ge(e){var t=e.state.selection.primary,n=t.from,r=t.to,i=e.state.doc.lineAt(n).from,a=e.state.doc.lineAt(r).to,o=Math.max(i,n-30),s=Math.min(a,r+30),c=e.state.sliceDoc(o,s);if(o!=i)for(var l=0;l<30;l++)if(!Ke.test(c[l+1])&&Ke.test(c[l])){c=c.slice(l);break}if(s!=a)for(var u=c.length-1;u>c.length-30;u--)if(!Ke.test(c[u-1])&&Ke.test(c[u])){c=c.slice(0,u);break}var f=Object(Se.a)(e,He);f&&f.dom.contains(e.root.activeElement)&&(f.dom.querySelector("div[aria-live]").textContent=e.state.phrase("current match")+". "+c)}var Ze,Je=i.d.baseTheme({"$panel.search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button":{margin:".2em .5em .2em 0"},"& label":{fontSize:"80%"}},"$$light $searchMatch":{backgroundColor:"#ffff0054"},"$$dark $searchMatch":{backgroundColor:"#00ffff8a"},"$$light $searchMatch.selected":{backgroundColor:"#ff6a0054"},"$$dark $searchMatch.selected":{backgroundColor:"#ff00ff8a"}}),et=[_e,Object(a.o)(Le,"override"),Object(Se.b)(),Je],tt=n(78),nt=[{key:"Mod-/",run:function(e){return rt(ot(Ze.Toggle),e)}},{key:"Alt-A",run:function(e){return rt(at(Ze.Toggle),e)}}];function rt(e,t){var n=e(t.state);return!!n&&(t.dispatch(n),!0)}function it(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.selection.primary.head;return e.languageDataAt("commentTokens",t)[0]||{}}!function(e){e[e.Toggle=0]="Toggle",e[e.OnlyComment=1]="OnlyComment",e[e.OnlyUncomment=2]="OnlyUncomment"}(Ze||(Ze={}));var at=function(e){return function(t){var n=it(t);return n.block?new st(n.block.open,n.block.close).toggle(e,t):null}},ot=function(e){return function(t){var n=it(t);return n.line?new lt(n.line).toggle(e,t):null}},st=function(){function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:" ";Object(s.a)(this,e),this.open=t,this.close=n,this.margin=r}return Object(c.a)(e,[{key:"toggle",value:function(e,t){var n=this,r=this.isSelectionCommented(t);if(null!==r){if(e!==Ze.OnlyComment)return t.update({changes:r.map((function(e){var t=e.open,r=e.close;return[{from:t.pos-n.open.length,to:t.pos+t.margin},{from:r.pos-r.margin,to:r.pos+n.close.length}]}))})}else if(e!==Ze.OnlyUncomment)return t.update(t.changeByRange((function(e){var t=(n.open+n.margin).length;return{changes:[{from:e.from,insert:n.open+n.margin},{from:e.to,insert:n.margin+n.close}],range:a.d.range(e.anchor+t,e.head+t)}})));return null}},{key:"isSelectionCommented",value:function(e){var t,n=[],r=Object(o.a)(e.selection.ranges);try{for(r.s();!(t=r.n()).done;){var i=t.value,a=this.isRangeCommented(e,i);if(null===a)return null;n.push(a)}}catch(s){r.e(s)}finally{r.f()}return n}},{key:"isRangeCommented",value:function(e,t){var n,r,i=e.sliceDoc(t.from-ct,t.from),a=e.sliceDoc(t.to,t.to+ct),o=/\s*$/.exec(i)[0].length,s=/^\s*/.exec(a)[0].length,c=i.length-o;if(i.slice(c-this.open.length,c)==this.open&&a.slice(s,s+this.close.length)==this.close)return{open:{pos:t.from-o,margin:o&&1},close:{pos:t.to+s,margin:s&&1}};t.to-t.from<=2*ct?n=r=e.sliceDoc(t.from,t.to):(n=e.sliceDoc(t.from,t.from+ct),r=e.sliceDoc(t.to-ct,t.to));var l=/^\s*/.exec(n)[0].length,u=/\s*$/.exec(r)[0].length,f=r.length-u-this.close.length;return n.slice(l,l+this.open.length)==this.open&&r.slice(f,f+this.close.length)==this.close?{open:{pos:t.from+l+this.open.length,margin:/\s/.test(n.charAt(l+this.open.length))?1:0},close:{pos:t.to-u-this.close.length,margin:/\s/.test(r.charAt(f-1))?1:0}}:null}}]),e}(),ct=50,lt=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:" ";Object(s.a)(this,e),this.lineCommentToken=t,this.margin=n}return Object(c.a)(e,[{key:"toggle",value:function(e,t){for(var n=[],i={},a=0;a1&&c.isLineSkipped[p.number])){var v=p.from+c.minCol,m=c.minCol+this.lineCommentToken.length,g=" "==p.slice(m,m+1)?1:0;l.push({from:v,to:v+this.lineCommentToken.length+g})}}}catch(j){h.e(j)}finally{h.f()}}return t.update({changes:l})}}else if(e!=Ze.OnlyUncomment){for(var b=[],y=0;yft?-1:i==r.length?function(e,t){var n=e.coordsAtPos(e.viewport.from);return n?Math.round(Math.abs((n.left-t)/e.defaultCharacterWidth)):-1}(e,t.clientX):Object(he.d)(r.slice(0,n-r.from),0,e.state.tabSize);return{line:r.number,col:a,off:i}}function ht(e,t){var n=dt(e,t),r=e.state.selection;return{update:function(e){if(e.docChanged){var t=e.changes.mapPos(e.prevState.doc.line(n.line).from),i=e.state.doc.lineAt(t);n={line:i.number,col:n.col,off:Math.min(n.off,i.length)},r=r.map(e.changes)}},get:function(t,i,o){var s=dt(e,t),c=function(e,t,n){var r=Math.min(t.line,n.line),i=Math.max(t.line,n.line),o=[];if(t.off>ft||n.off>ft||t.col<0||n.col<0)for(var s=Math.min(t.off,n.off),c=Math.max(t.off,n.off),l=r;l<=i;l++){var u=e.doc.line(l);u.length<=c&&o.push(a.d.range(u.from+s,u.to+c))}else for(var f=Math.min(t.col,n.col),d=Math.max(t.col,n.col),h=r;h<=i;h++){var p=e.doc.line(h),v=p.length>ft?p.slice(0,2*d):p.slice(),m=Object(he.e)(v,0,f,e.tabSize),g=Object(he.e)(v,0,d,e.tabSize);m.leftOver||o.push(a.d.range(p.from+m.offset,p.from+g.offset))}return o}(e.state,n,s);return c.length?o?a.d.create(c.concat(r.ranges)):a.d.create(c):r}}}var pt=n(13),vt="undefined"==typeof Symbol?"__goto-line":Symbol("goto-line");function mt(e){var t=document.createElement("form");t.innerHTML="\n");var n=t.querySelector("input");function r(){var t=parseInt(n.value,10);e.dispatch({reconfigure:Object(pt.a)({},vt,[gt]),selection:!isNaN(t)&&t>0&&t<=e.state.doc.lines?a.d.cursor(e.state.doc.line(t).from):void 0,scrollIntoView:!0}),e.focus()}return t.addEventListener("keydown",(function(t){27==t.keyCode?(t.preventDefault(),e.dispatch({reconfigure:{append:[gt]}}),e.focus()):13==t.keyCode&&(t.preventDefault(),r())})),t.addEventListener("submit",r),{dom:t,style:"gotoLine",pos:-10}}var gt=i.d.baseTheme({"$panel.gotoLine":{padding:"2px 6px 4px","& label":{fontSize:"80%"}}}),bt=[{key:"Alt-g",run:function(e){var t=Object(Se.a)(e,mt);return t||(e.dispatch({reconfigure:{append:[Object(Se.b)(),Se.c.of(mt),gt]}}),t=Object(Se.a)(e,mt)),t&&t.dom.querySelector("input").focus(),!0}}];var yt=i.b.line({attributes:{class:Object(i.n)("activeLine")}}),Ot=i.f.fromClass(function(){function e(t){Object(s.a)(this,e),this.decorations=this.getDeco(t)}return Object(c.a)(e,[{key:"update",value:function(e){(e.docChanged||e.selectionSet)&&(this.decorations=this.getDeco(e.view))}},{key:"getDeco",value:function(e){var t,n=-1,r=[],a=Object(o.a)(e.state.selection.ranges);try{for(a.s();!(t=a.n()).done;){var s=t.value;if(s.empty){var c=e.visualLineAt(s.head);c.from>n&&(r.push(yt.range(c.from)),n=c.from)}}}catch(l){a.e(l)}finally{a.f()}return i.b.set(r)}}]),e}(),{decorations:function(e){return e.decorations}}),xt={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100},kt=a.f.define({combine:function(e){return Object(a.m)(e,xt,{highlightWordAroundCursor:function(e,t){return e||t},minSelectionLength:Math.min,maxMatches:Math.min})}});var wt=i.b.mark({class:Object(i.n)("selectionMatch")}),jt=i.b.mark({class:Object(i.n)("selectionMatch.main")}),St=i.f.fromClass(function(){function e(t){Object(s.a)(this,e),this.decorations=this.getDeco(t)}return Object(c.a)(e,[{key:"update",value:function(e){(e.selectionSet||e.docChanged||e.viewportChanged)&&(this.decorations=this.getDeco(e.view))}},{key:"getDeco",value:function(e){var t=e.state.facet(kt),n=e.state,r=n.selection;if(r.ranges.length>1)return i.b.none;var s,c=r.primary,l=null;if(c.empty){if(!t.highlightWordAroundCursor)return i.b.none;if(l=n.charCategorizer(c.head),!(s=function(e,t,n){for(var r=e.lineAt(t),i=t-r.from,o=t-r.from;i>0;){var s=r.findClusterBreak(i,!1);if(n(r.slice(s,i))!=a.c.Word)break;i=s}for(;o200)return i.b.none;if(!(s=n.sliceDoc(c.from,c.to).trim()))return i.b.none}var f,d=[],h=Object(o.a)(e.visibleRanges);try{for(h.s();!(f=h.n()).done;)for(var p=f.value,v=new Ee(n.doc,s,p.from,p.to);!v.next().done;){var m=v.value,g=m.from,b=m.to;if((!l||(0==g||l(n.sliceDoc(g-1,g))!=a.c.Word)&&(b==n.doc.length||l(n.sliceDoc(b,b+1))!=a.c.Word))&&(l&&g<=c.from&&b>=c.to?d.push(jt.range(g,b)):(g>=c.to||b<=c.from)&&d.push(wt.range(g,b)),d.length>t.maxMatches))return i.b.none}}catch(y){h.e(y)}finally{h.f()}return i.b.set(d)}}]),e}(),{decorations:function(e){return e.decorations}}),Ct=i.d.baseTheme({"$$light $activeLine":{backgroundColor:"#eff5ff"},"$$dark $activeLine":{backgroundColor:"#223039"},$selectionMatch:{backgroundColor:"#99ff7780"},"$searchMatch $selectionMatch":{backgroundColor:"transparent"}}),Et=n(118),Mt=n(119),Pt=[function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return[V.of(e),q]}(),Object(i.i)(),function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return[h,d.of(e)]}(),function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=Object.assign(Object.assign({},ce),e),n=new le(t,!0),r=new le(t,!1);return[N({style:"foldGutter",lineMarker:function(e,t){return ee(e.state,t.from,t.to)?r:te(e.state,t.from,t.to)?n:null},initialSpacer:function(){return new le(t,!1)},domEventHandlers:{click:function(e,t){var n=ee(e.state,t.from,t.to);if(n)return e.dispatch({effects:G.of(n)}),!0;var r=te(e.state,t.from,t.to);return!!r&&(e.dispatch({effects:K.of(r)}),!0)}}}),oe()]}(),Object(i.h)(),a.e.allowMultipleSelections.of(!0),Object(i.j)(),Et.a,Object(de.a)(),i.d.inputHandler.of(be),Object(tt.a)(),function(e){var t=e||function(e){return e.altKey&&0==e.button};return i.d.mouseSelectionStyle.of((function(e,n){return t(n)?ht(e,n):null}))}(),[Ct,Ot],function(e){var t=[Ct,St];return e&&t.push(kt.of(e)),t}(),Object(i.k)([].concat(Object(r.a)(ye),Object(r.a)(fe.a),Object(r.a)(qe),Object(r.a)(P),Object(r.a)(re),Object(r.a)(nt),Object(r.a)(bt),Object(r.a)(tt.b),Object(r.a)(Mt.a)))]},function(e,t,n){"use strict";var r=n(87),i=n.n(r),a=n(1),o=function(e){return e&&e.enabled&&e.modifierKey},s=function(e,t){return e&&t[e+"Key"]},c=function(e,t){return e&&!t[e+"Key"]};function l(e,t,n){return void 0===e||("string"===typeof e?-1!==e.indexOf(t):"function"===typeof e&&-1!==e({chart:n}).indexOf(t))}function u(e,t,n){var r=function(e,t){for(var n=e.x,r=e.y,i=t.scales,a=Object.keys(i),o=0;o=s.top&&r<=s.bottom&&n>=s.left&&n<=s.right)return s}return null}(t,n);if(r&&l(e,r.axis,n))return[r];var i=[];return Object(a.c)(n.scales,(function(t){l(e,t.axis,n)||i.push(t)})),i}var f=new WeakMap;function d(e){var t=f.get(e);return t||(t={originalScaleLimits:{},updatedScaleLimits:{},handlers:{},panDelta:{}},f.set(e,t)),t}function h(e,t,n){var r=e.max-e.min,i=r*(t-1),a=e.isHorizontal()?n.x:n.y,o=(e.getValueForPixel(a)-e.min)/r||0;return{min:i*o,max:i*(1-o)}}function p(e,t,n,r,i){var o=n[r];if("original"===o){var s=e.originalScaleLimits[t.id][r];o=Object(a.Pb)(s.options,s.scale)}return Object(a.Pb)(o,i)}function v(e,t,n){var r=t.min,i=t.max,a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=d(e.chart),s=e.id,c=e.axis,l=e.options,u=n&&(n[s]||n[c])||{},f=u.minRange,h=void 0===f?0:f,v=p(o,e,u,"min",-1/0),m=p(o,e,u,"max",1/0),g=Math.max(r,v),b=Math.min(i,m),y=a?Math.max(b-g,h):e.max-e.min;if(b-g!==y)if(v>b-y)r=g,i=g+y;else if(m3&&void 0!==arguments[3]&&arguments[3],i=e.min,a=e.max,o=e.options,s=o.time&&o.time.round,c=g[s]||0,l=e.getValueForPixel(e.getPixelForValue(i+c)-t),u=e.getValueForPixel(e.getPixelForValue(a+c)-t),f=r&&n&&n[e.axis]||{},d=f.min,h=void 0===d?-1/0:d,p=f.max,m=void 0===p?1/0:p;return!!(isNaN(l)||isNaN(u)||lm)||v(e,{min:l,max:u},n,r)}function y(e,t,n){return b(e,t,n,!0)}var O={category:function(e,t,n,r){var i=h(e,t,n);return e.min===e.max&&t<1&&function(e){var t=e.getLabels().length-1;e.min>0&&(e.min-=1),e.maxc&&(a=Math.max(0,a-l),o=1===s?a:a+s,r=0===a),v(e,{min:a,max:o},n)||r},default:b,logarithmic:y,timeseries:y};function k(e,t){Object(a.c)(e,(function(n,r){t[r]||delete e[r]}))}function w(e,t){var n=e.scales,r=t.originalScaleLimits,i=t.updatedScaleLimits;return Object(a.c)(n,(function(e){(function(e,t,n){var r=e.id,i=e.options,a=i.min,o=i.max;if(!t[r]||!n[r])return!0;var s=n[r];return s.min!==a||s.max!==o})(e,r,i)&&(r[e.id]={min:{scale:e.min,options:e.options.min},max:{scale:e.max,options:e.options.max}})})),k(r,n),k(i,n),r}function j(e,t,n,r){var i=O[e.type]||O.default;Object(a.n)(i,[e,t,n,r])}function S(e){var t=e.chartArea;return{x:(t.left+t.right)/2,y:(t.top+t.bottom)/2}}function C(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"none",r="number"===typeof t?{x:t,y:t}:t,i=r.x,o=void 0===i?1:i,s=r.y,c=void 0===s?1:s,f=r.focalPoint,h=void 0===f?S(e):f,p=d(e),v=p.options,m=v.limits,g=v.zoom,b=g||{},y=b.mode,O=void 0===y?"xy":y,x=b.overScaleMode;w(e,p);var k=1!==o&&l(O,"x",e),C=1!==c&&l(O,"y",e),E=x&&u(x,h,e);Object(a.c)(E||e.scales,(function(e){e.isHorizontal()&&k?j(e,o,h,m):!e.isHorizontal()&&C&&j(e,c,h,m)})),e.update(n),Object(a.n)(g.onZoom,[{chart:e}])}function E(e,t,n){var r=e.getValueForPixel(t),i=e.getValueForPixel(n);return{min:Math.min(r,i),max:Math.max(r,i)}}function M(e){var t=d(e),n=1,r=1;return Object(a.c)(e.scales,(function(e){var i=function(e,t){var n=e.originalScaleLimits[t];if(n){var r=n.min,i=n.max;return Object(a.Pb)(i.options,i.scale)-Object(a.Pb)(r.options,r.scale)}}(t,e.id);if(i){var o=Math.round(i/(e.max-e.min)*100)/100;n=Math.min(n,o),r=Math.max(r,o)}})),n<1?n:r}function P(e,t,n,r){var i=r.panDelta,o=i[e.id]||0;Object(a.Mb)(o)===Object(a.Mb)(t)&&(t+=o);var s=x[e.type]||x.default;Object(a.n)(s,[e,t,n])?i[e.id]=0:i[e.id]=t}function T(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"none",i="number"===typeof t?{x:t,y:t}:t,o=i.x,s=void 0===o?0:o,c=i.y,u=void 0===c?0:c,f=d(e),h=f.options,p=h.pan,v=h.limits,m=p||{},g=m.mode,b=void 0===g?"xy":g,y=m.onPan;w(e,f);var O=0!==s&&l(b,"x",e),x=0!==u&&l(b,"y",e);Object(a.c)(n||e.scales,(function(e){e.isHorizontal()&&O?P(e,s,v,f):!e.isHorizontal()&&x&&P(e,u,v,f)})),e.update(r),Object(a.n)(y,[{chart:e}])}function _(e,t){var n=d(e).handlers,r=n[t];r&&r.target&&(r.target.removeEventListener(t,r),delete n[t])}function D(e,t,n,r){var i=d(e),a=i.handlers,o=i.options;_(e,n),a[n]=function(t){return r(e,t,o)},a[n].target=t,t.addEventListener(n,a[n])}function A(e,t){var n=d(e);n.dragStart&&(n.dragging=!0,n.dragEnd=t,e.update("none"))}function R(e,t,n){var r=n.onZoomStart,i=n.onZoomRejected;if(r){var o=t.target.getBoundingClientRect(),s=o.left,c=o.top,l={x:t.clientX-s,y:t.clientY-c};if(!1===Object(a.n)(r,[{chart:e,event:t,point:l}]))return Object(a.n)(i,[{chart:e,event:t}]),!1}}function L(e,t){var n=d(e),r=n.options,i=r.pan,l=r.zoom,u=void 0===l?{}:l;if(s(o(i),t)||c(o(u.drag),t))return Object(a.n)(u.onZoomRejected,[{chart:e,event:t}]);!1!==R(e,t,u)&&(n.dragStart=t,D(e,e.canvas,"mousemove",A))}function N(e,t,n,r){var i=n.target.getBoundingClientRect(),a=i.left,o=i.top,s=l(t,"x",e),c=l(t,"y",e),u=e.chartArea,f=u.top,d=u.left,h=u.right,p=u.bottom,v=u.width,m=u.height;s&&(d=Math.min(n.clientX,r.clientX)-a,h=Math.max(n.clientX,r.clientX)-a),c&&(f=Math.min(n.clientY,r.clientY)-o,p=Math.max(n.clientY,r.clientY)-o);var g=h-d,b=p-f;return{left:d,top:f,right:h,bottom:p,width:g,height:b,zoomX:s&&g?1+(v-g)/v:1,zoomY:c&&b?1+(m-b)/m:1}}function I(e,t){var n=d(e);if(n.dragStart){_(e,"mousemove");var r=n.options.zoom,i=r.mode,o=r.onZoomComplete,s=r.drag.threshold,c=void 0===s?0:s,u=N(e,i,n.dragStart,t),f=l(i,"x",e)?u.width:0,h=l(i,"y",e)?u.height:0,p=Math.sqrt(f*f+h*h);if(n.dragStart=n.dragEnd=null,p<=c)return n.dragging=!1,void e.update("none");!function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"none",i=d(e),o=i.options,s=o.limits,c=o.zoom,u=c.mode,f=void 0===u?"xy":u;w(e,i);var h=l(f,"x",e),p=l(f,"y",e);Object(a.c)(e.scales,(function(e){e.isHorizontal()&&h?v(e,E(e,t.x,n.x),s,!0):!e.isHorizontal()&&p&&v(e,E(e,t.y,n.y),s,!0)})),e.update(r),Object(a.n)(c.onZoom,[{chart:e}])}(e,{x:u.left,y:u.top},{x:u.right,y:u.bottom},"zoom"),setTimeout((function(){return n.dragging=!1}),500),Object(a.n)(o,[{chart:e}])}}function z(e,t){var n=d(e),r=n.handlers.onZoomComplete,i=n.options.zoom;if(function(e,t,n){if(c(o(n.wheel),t))Object(a.n)(n.onZoomRejected,[{chart:e,event:t}]);else if(!1!==R(e,t,n)&&(t.cancelable&&t.preventDefault(),void 0!==t.deltaY))return!0}(e,t,i)){var s=t.target.getBoundingClientRect(),l=1+(t.deltaY>=0?-i.wheel.speed:i.wheel.speed);C(e,{x:l,y:l,focalPoint:{x:t.clientX-s.left,y:t.clientY-s.top}}),r&&r()}}function $(e,t,n,r){n&&(d(e).handlers[t]=function(e,t){var n;return function(){return clearTimeout(n),n=setTimeout(e,t),t}}((function(){return Object(a.n)(n,[{chart:e}])}),r))}function F(e,t){return function(n,r){var i=t.options,l=i.pan,u=i.zoom,f=void 0===u?{}:u;if(!l||!l.enabled)return!1;var d=r&&r.srcEvent;return!d||(!(!t.panning&&"mouse"===r.pointerType&&(c(o(l),d)||s(o(f.drag),d)))||(Object(a.n)(l.onPanRejected,[{chart:e,event:r}]),!1))}}function B(e,t,n){if(t.scale){var r=n.center,i=n.pointers,a=1/t.scale*n.scale,o=n.target.getBoundingClientRect(),s=function(e,t){var n,r,i=Math.abs(e.clientX-t.clientX),a=Math.abs(e.clientY-t.clientY),o=i/a;return o>.3&&o<1.7?n=r=!0:i>a?n=!0:r=!0,{x:n,y:r}}(i[0],i[1]),c=t.options.zoom.mode;C(e,{x:s.x&&l(c,"x",e)?a:1,y:s.y&&l(c,"y",e)?a:1,focalPoint:{x:r.x-o.left,y:r.y-o.top}}),t.scale=n.scale}}function Q(e,t,n){var r=t.delta;r&&(t.panning=!0,T(e,{x:n.deltaX-r.x,y:n.deltaY-r.y},t.panScales),t.delta={x:n.deltaX,y:n.deltaY})}var W=new WeakMap;function H(e,t){var n=d(e),r=e.canvas,o=t.pan,s=t.zoom,c=new i.a.Manager(r);s&&s.pinch.enabled&&(c.add(new i.a.Pinch),c.on("pinchstart",(function(){return function(e,t){t.options.zoom.pinch.enabled&&(t.scale=1)}(0,n)})),c.on("pinch",(function(t){return B(e,n,t)})),c.on("pinchend",(function(t){return function(e,t,n){t.scale&&(B(e,t,n),t.scale=null,Object(a.n)(t.options.zoom.onZoomComplete,[{chart:e}]))}(e,n,t)}))),o&&o.enabled&&(c.add(new i.a.Pan({threshold:o.threshold,enable:F(e,n)})),c.on("panstart",(function(t){return function(e,t,n){var r=t.options.pan,i=r.enabled,o=r.overScaleMode,s=r.onPanStart,c=r.onPanRejected;if(i){var l=n.target.getBoundingClientRect(),f={x:n.center.x-l.left,y:n.center.y-l.top};if(!1===Object(a.n)(s,[{chart:e,event:n,point:f}]))return Object(a.n)(c,[{chart:e,event:n}]);t.panScales=o&&u(o,f,e),t.delta={x:0,y:0},clearTimeout(t.panEndTimeout),Q(e,t,n)}}(e,n,t)})),c.on("panmove",(function(t){return Q(e,n,t)})),c.on("panend",(function(){return function(e,t){t.delta=null,t.panning&&(t.panEndTimeout=setTimeout((function(){return t.panning=!1}),500),Object(a.n)(t.options.pan.onPanComplete,[{chart:e}]))}(e,n)}))),W.set(e,c)}var V={id:"zoom",version:"1.1.1",defaults:{pan:{enabled:!1,mode:"xy",threshold:10,modifierKey:null},zoom:{wheel:{enabled:!1,speed:.1,modifierKey:null},drag:{enabled:!1,modifierKey:null},pinch:{enabled:!1},mode:"xy"}},start:function(e,t,n){d(e).options=n,Object.prototype.hasOwnProperty.call(n.zoom,"enabled")&&console.warn("The option `zoom.enabled` is no longer supported. Please use `zoom.wheel.enabled`, `zoom.drag.enabled`, or `zoom.pinch.enabled`."),i.a&&H(e,n),e.pan=function(t,n,r){return T(e,t,n,r)},e.zoom=function(t,n){return C(e,t,n)},e.zoomScale=function(t,n,r){return function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"none";w(e,d(e)),v(e.scales[t],n,void 0,!0),e.update(r)}(e,t,n,r)},e.resetZoom=function(t){return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"default",n=d(e),r=w(e,n);Object(a.c)(e.scales,(function(e){var t=e.options;r[e.id]?(t.min=r[e.id].min.options,t.max=r[e.id].max.options):(delete t.min,delete t.max)})),e.update(t),Object(a.n)(n.options.zoom.onZoomComplete,[{chart:e}])}(e,t)},e.getZoomLevel=function(){return M(e)}},beforeEvent:function(e){var t=d(e);if(t.panning||t.dragging)return!1},beforeUpdate:function(e,t,n){d(e).options=n,function(e,t){var n=e.canvas,r=t.zoom,i=r.wheel,a=r.drag,o=r.onZoomComplete;i.enabled?(D(e,n,"wheel",z),$(e,"onZoomComplete",o,250)):_(e,"wheel"),a.enabled?(D(e,n,"mousedown",L),D(e,n.ownerDocument,"mouseup",I)):(_(e,"mousedown"),_(e,"mousemove"),_(e,"mouseup"))}(e,n)},beforeDatasetsDraw:function(e,t,n){var r=d(e),i=r.dragStart,a=r.dragEnd;if(a){var o=N(e,n.zoom.mode,i,a),s=o.left,c=o.top,l=o.width,u=o.height,f=n.zoom.drag,h=e.ctx;h.save(),h.beginPath(),h.fillStyle=f.backgroundColor||"rgba(225,225,225,0.3)",h.fillRect(s,c,l,u),f.borderWidth>0&&(h.lineWidth=f.borderWidth,h.strokeStyle=f.borderColor||"rgba(225,225,225)",h.strokeRect(s,c,l,u)),h.restore()}},stop:function(e){!function(e){_(e,"mousedown"),_(e,"mousemove"),_(e,"mouseup"),_(e,"wheel"),_(e,"click")}(e),i.a&&function(e){var t=W.get(e);t&&(t.remove("pinchstart"),t.remove("pinch"),t.remove("pinchend"),t.remove("panstart"),t.remove("pan"),t.remove("panend"),t.destroy(),W.delete(e))}(e),function(e){f.delete(e)}(e)},panFunctions:x,zoomFunctions:O};t.a=V},function(e,t,n){"use strict";n.d(t,"a",(function(){return g}));var r=n(0),i=n.n(r),a=n(25),o=n(46);o.a.register.apply(o.a,Object(a.a)(o.d));var s=o.a,c=n(186),l=n.n(c),u=n(123),f=n.n(u),d=n(187),h=n.n(d);function p(){return(p=Object.assign||function(e){for(var t=1;t=0||(i[n]=e[n]);return i}var m=Object(r.forwardRef)((function(e,t){var n=e.id,a=e.className,o=e.height,c=void 0===o?150:o,u=e.width,d=void 0===u?300:u,m=e.redraw,g=void 0!==m&&m,b=e.type,y=e.data,O=e.options,x=void 0===O?{}:O,k=e.plugins,w=void 0===k?[]:k,j=e.getDatasetAtEvent,S=e.getElementAtEvent,C=e.getElementsAtEvent,E=e.fallbackContent,M=v(e,["id","className","height","width","redraw","type","data","options","plugins","getDatasetAtEvent","getElementAtEvent","getElementsAtEvent","fallbackContent"]),P=Object(r.useRef)(null),T=Object(r.useMemo)((function(){return"function"===typeof y?P.current?y(P.current):{}:l()({},y)}),[y,P.current]),_=Object(r.useState)(),D=_[0],A=_[1];Object(r.useImperativeHandle)(t,(function(){return D}),[D]);var R=function(){P.current&&A(new s(P.current,{type:b,data:T,options:x,plugins:w}))},L=function(){D&&D.destroy()};return Object(r.useEffect)((function(){return R(),function(){return L()}}),[]),Object(r.useEffect)((function(){g?(L(),setTimeout((function(){R()}),0)):function(){if(D){if(x&&(D.options=p({},x)),!D.config.data)return D.config.data=T,void D.update();var e=T.datasets,t=void 0===e?[]:e,n=v(T,["datasets"]),r=D.config.data.datasets,i=void 0===r?[]:r;f()(D.config.data,n),D.config.data.datasets=t.map((function(e){var t=h()(i,(function(t){return t.label===e.label&&t.type===e.type}));return t&&e.data?(t.data?t.data.length=e.data.length:t.data=[],f()(t.data,e.data),f()(t,p({},e,{data:t.data})),t):p({},e)})),D.update()}}()}),[e,T]),i.a.createElement("canvas",Object.assign({},M,{height:c,width:d,ref:P,id:n,className:a,onClick:function(e){D&&(j&&j(D.getElementsAtEventForMode(e,"dataset",{intersect:!0},!1),e),S&&S(D.getElementsAtEventForMode(e,"nearest",{intersect:!0},!1),e),C&&C(D.getElementsAtEventForMode(e,"index",{intersect:!0},!1),e))},"data-testid":"canvas",role:"img"}),E)})),g=Object(r.forwardRef)((function(e,t){return i.a.createElement(m,Object.assign({},e,{type:"line",ref:t,options:e.options||{}}))}));Object(r.forwardRef)((function(e,t){return i.a.createElement(m,Object.assign({},e,{type:"bar",ref:t,options:e.options||{}}))})),Object(r.forwardRef)((function(e,t){return i.a.createElement(m,Object.assign({},e,{type:"radar",ref:t,options:e.options||{}}))})),Object(r.forwardRef)((function(e,t){return i.a.createElement(m,Object.assign({},e,{type:"doughnut",ref:t,options:e.options||{}}))})),Object(r.forwardRef)((function(e,t){return i.a.createElement(m,Object.assign({},e,{type:"polarArea",ref:t,options:e.options||{}}))})),Object(r.forwardRef)((function(e,t){return i.a.createElement(m,Object.assign({},e,{type:"bubble",ref:t,options:e.options||{}}))})),Object(r.forwardRef)((function(e,t){return i.a.createElement(m,Object.assign({},e,{type:"pie",ref:t,options:e.options||{}}))})),Object(r.forwardRef)((function(e,t){return i.a.createElement(m,Object.assign({},e,{type:"scatter",ref:t,options:e.options||{}}))})),o.c,o.a},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(0),i=n.n(r),a=n(109);function o(){return i.a.useContext(a.a)}},function(e,t,n){"use strict";function r(e){for(var t="https://material-ui.com/production-error/?code="+e,n=1;n